@agentica/chat 0.30.6 → 0.30.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.
@@ -27,7 +27,7 @@ import{O as FAe,r as ln,P as jIn,Q as HIn,d as Im,S as zIn,U as UIn,V as $Ae,x a
27
27
  animation: ${EBt} 1.4s ease-in-out infinite;
28
28
  `:null,WOn=o=>{const{classes:s,variant:p,color:y,disableShrink:C}=o,N={root:["root",p,`color${fa(y)}`],svg:["svg"],circle:["circle",`circle${fa(p)}`,C&&"circleDisableShrink"]};return Hc(N,zOn,s)},KOn=Ia("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[p.variant],s[`color${fa(p.color)}`]]}})(pu(({theme:o})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:o.transitions.create("transform")}},{props:{variant:"indeterminate"},style:UOn||{animation:`${xBt} 1.4s linear infinite`}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{color:(o.vars||o).palette[s].main}}))]}))),GOn=Ia("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(o,s)=>s.svg})({display:"block"}),YOn=Ia("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.circle,s[`circle${fa(p.variant)}`],p.disableShrink&&s.circleDisableShrink]}})(pu(({theme:o})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:o.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:s})=>s.variant==="indeterminate"&&!s.disableShrink,style:qOn||{animation:`${EBt} 1.4s ease-in-out infinite`}}]}))),eIe=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCircularProgress"}),{className:C,color:N="primary",disableShrink:L=!1,size:z=40,style:G,thickness:q=3.6,value:et=0,variant:tt="indeterminate",...nt}=y,st={...y,color:N,disableShrink:L,size:z,thickness:q,value:et,variant:tt},at=WOn(st),Ot={},Dt={},St={};if(tt==="determinate"){const ae=2*Math.PI*((eC-q)/2);Ot.strokeDasharray=ae.toFixed(3),St["aria-valuenow"]=Math.round(et),Ot.strokeDashoffset=`${((100-et)/100*ae).toFixed(3)}px`,Dt.transform="rotate(-90deg)"}return le.jsx(KOn,{className:bo(at.root,C),style:{width:z,height:z,...Dt,...G},ownerState:st,ref:p,role:"progressbar",...St,...nt,children:le.jsx(GOn,{className:at.svg,ownerState:st,viewBox:`${eC/2} ${eC/2} ${eC} ${eC}`,children:le.jsx(YOn,{className:at.circle,style:Ot,ownerState:st,cx:eC,cy:eC,r:(eC-q)/2,fill:"none",strokeWidth:q})})})});function VOn(o){return Vc("MuiIconButton",o)}const YSe=au("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),XOn=o=>{const{classes:s,disabled:p,color:y,edge:C,size:N,loading:L}=o,z={root:["root",L&&"loading",p&&"disabled",y!=="default"&&`color${fa(y)}`,C&&`edge${fa(C)}`,`size${fa(N)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Hc(z,VOn,s)},QOn=Ia(GF,{name:"MuiIconButton",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.loading&&s.loading,p.color!=="default"&&s[`color${fa(p.color)}`],p.edge&&s[`edge${fa(p.edge)}`],s[`size${fa(p.size)}`]]}})(pu(({theme:o})=>({textAlign:"center",flex:"0 0 auto",fontSize:o.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(o.vars||o).palette.action.active,transition:o.transitions.create("background-color",{duration:o.transitions.duration.shortest}),variants:[{props:s=>!s.disableRipple,style:{"--IconButton-hoverBg":o.vars?`rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.action.active,o.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}}]})),pu(({theme:o})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{color:(o.vars||o).palette[s].main}})),...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{"--IconButton-hoverBg":o.vars?`rgba(${(o.vars||o).palette[s].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef((o.vars||o).palette[s].main,o.palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:o.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:o.typography.pxToRem(28)}}],[`&.${YSe.disabled}`]:{backgroundColor:"transparent",color:(o.vars||o).palette.action.disabled},[`&.${YSe.loading}`]:{color:"transparent"}}))),JOn=Ia("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(o,s)=>s.loadingIndicator})(({theme:o})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(o.vars||o).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),VSe=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiIconButton"}),{edge:C=!1,children:N,className:L,color:z="default",disabled:G=!1,disableFocusRipple:q=!1,size:et="medium",id:tt,loading:nt=null,loadingIndicator:st,...at}=y,Ot=VQ(tt),Dt=st??le.jsx(eIe,{"aria-labelledby":Ot,color:"inherit",size:16}),St={...y,edge:C,color:z,disabled:G,disableFocusRipple:q,loading:nt,loadingIndicator:Dt,size:et},ae=XOn(St);return le.jsxs(QOn,{id:nt?Ot:tt,className:bo(ae.root,L),centerRipple:!0,focusRipple:!q,disabled:G||nt,ref:p,...at,ownerState:St,children:[typeof nt=="boolean"&&le.jsx("span",{className:ae.loadingWrapper,style:{display:"contents"},children:le.jsx(JOn,{className:ae.loadingIndicator,ownerState:St,children:nt&&Dt})}),N]})});function ZOn(o){return Vc("MuiAppBar",o)}au("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const tNn=o=>{const{color:s,position:p,classes:y}=o,C={root:["root",`color${fa(s)}`,`position${fa(p)}`]};return Hc(C,ZOn,y)},XSe=(o,s)=>o?`${o==null?void 0:o.replace(")","")}, ${s})`:s,eNn=Ia(XQ,{name:"MuiAppBar",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[`position${fa(p.position)}`],s[`color${fa(p.color)}`]]}})(pu(({theme:o})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[100],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[100]),...o.applyStyles("dark",{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[900],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[900])})}},...Object.entries(o.palette).filter(Am(["contrastText"])).map(([s])=>({props:{color:s},style:{"--AppBar-background":(o.vars??o).palette[s].main,"--AppBar-color":(o.vars??o).palette[s].contrastText}})),{props:s=>s.enableColorOnDark===!0&&!["inherit","transparent"].includes(s.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:s=>s.enableColorOnDark===!1&&!["inherit","transparent"].includes(s.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundColor:o.vars?XSe(o.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:o.vars?XSe(o.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundImage:"none"})}}]}))),QSe=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiAppBar"}),{className:C,color:N="primary",enableColorOnDark:L=!1,position:z="fixed",...G}=y,q={...y,color:N,position:z,enableColorOnDark:L},et=tNn(q);return le.jsx(eNn,{square:!0,component:"header",ownerState:q,elevation:4,className:bo(et.root,C,z==="fixed"&&"mui-fixed"),ref:p,...G})});function nNn(o){return typeof o=="function"?o():o}const rNn=ln.forwardRef(function(s,p){const{children:y,container:C,disablePortal:N=!1}=s,[L,z]=ln.useState(null),G=Im(ln.isValidElement(y)?r$(y):null,p);if(bP(()=>{N||z(nNn(C)||document.body)},[C,N]),bP(()=>{if(L&&!N)return qSe(p,L),()=>{qSe(p,null)}},[p,L,N]),N){if(ln.isValidElement(y)){const q={ref:G};return ln.cloneElement(y,q)}return y}return L&&XIn.createPortal(y,L)}),iNn=a5(le.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 aNn(o){return Vc("MuiChip",o)}const Fu=au("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"]),sNn=o=>{const{classes:s,disabled:p,size:y,color:C,iconColor:N,onDelete:L,clickable:z,variant:G}=o,q={root:["root",G,p&&"disabled",`size${fa(y)}`,`color${fa(C)}`,z&&"clickable",z&&`clickableColor${fa(C)}`,L&&"deletable",L&&`deletableColor${fa(C)}`,`${G}${fa(C)}`],label:["label",`label${fa(y)}`],avatar:["avatar",`avatar${fa(y)}`,`avatarColor${fa(C)}`],icon:["icon",`icon${fa(y)}`,`iconColor${fa(N)}`],deleteIcon:["deleteIcon",`deleteIcon${fa(y)}`,`deleteIconColor${fa(C)}`,`deleteIcon${fa(G)}Color${fa(C)}`]};return Hc(q,aNn,s)},oNn=Ia("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o,{color:y,iconColor:C,clickable:N,onDelete:L,size:z,variant:G}=p;return[{[`& .${Fu.avatar}`]:s.avatar},{[`& .${Fu.avatar}`]:s[`avatar${fa(z)}`]},{[`& .${Fu.avatar}`]:s[`avatarColor${fa(y)}`]},{[`& .${Fu.icon}`]:s.icon},{[`& .${Fu.icon}`]:s[`icon${fa(z)}`]},{[`& .${Fu.icon}`]:s[`iconColor${fa(C)}`]},{[`& .${Fu.deleteIcon}`]:s.deleteIcon},{[`& .${Fu.deleteIcon}`]:s[`deleteIcon${fa(z)}`]},{[`& .${Fu.deleteIcon}`]:s[`deleteIconColor${fa(y)}`]},{[`& .${Fu.deleteIcon}`]:s[`deleteIcon${fa(G)}Color${fa(y)}`]},s.root,s[`size${fa(z)}`],s[`color${fa(y)}`],N&&s.clickable,N&&y!=="default"&&s[`clickableColor${fa(y)})`],L&&s.deletable,L&&y!=="default"&&s[`deletableColor${fa(y)}`],s[G],s[`${G}${fa(y)}`]]}})(pu(({theme:o})=>{const s=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return{maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Fu.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Fu.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:s,fontSize:o.typography.pxToRem(12)},[`& .${Fu.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${Fu.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${Fu.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${Fu.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Fu.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.26)`:Ef(o.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.4)`:Ef(o.palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Fu.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Fu.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(o.palette).filter(Am(["contrastText"])).map(([p])=>({props:{color:p},style:{backgroundColor:(o.vars||o).palette[p].main,color:(o.vars||o).palette[p].contrastText,[`& .${Fu.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[p].contrastTextChannel} / 0.7)`:Ef(o.palette[p].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[p].contrastText}}}})),{props:p=>p.iconColor===p.color,style:{[`& .${Fu.icon}`]:{color:o.vars?o.vars.palette.Chip.defaultIconColor:s}}},{props:p=>p.iconColor===p.color&&p.color!=="default",style:{[`& .${Fu.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Fu.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:Ef(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}}},...Object.entries(o.palette).filter(Am(["dark"])).map(([p])=>({props:{color:p,onDelete:!0},style:{[`&.${Fu.focusVisible}`]:{background:(o.vars||o).palette[p].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:Ef(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)},[`&.${Fu.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:Ef(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)},"&:active":{boxShadow:(o.vars||o).shadows[1]}}},...Object.entries(o.palette).filter(Am(["dark"])).map(([p])=>({props:{color:p,clickable:!0},style:{[`&:hover, &.${Fu.focusVisible}`]:{backgroundColor:(o.vars||o).palette[p].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${Fu.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${Fu.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${Fu.avatar}`]:{marginLeft:4},[`& .${Fu.avatarSmall}`]:{marginLeft:2},[`& .${Fu.icon}`]:{marginLeft:4},[`& .${Fu.iconSmall}`]:{marginLeft:2},[`& .${Fu.deleteIcon}`]:{marginRight:5},[`& .${Fu.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(o.palette).filter(Am()).map(([p])=>({props:{variant:"outlined",color:p},style:{color:(o.vars||o).palette[p].main,border:`1px solid ${o.vars?`rgba(${o.vars.palette[p].mainChannel} / 0.7)`:Ef(o.palette[p].main,.7)}`,[`&.${Fu.clickable}:hover`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[p].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[p].main,o.palette.action.hoverOpacity)},[`&.${Fu.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[p].mainChannel} / ${o.vars.palette.action.focusOpacity})`:Ef(o.palette[p].main,o.palette.action.focusOpacity)},[`& .${Fu.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[p].mainChannel} / 0.7)`:Ef(o.palette[p].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[p].main}}}}))]}})),cNn=Ia("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,s)=>{const{ownerState:p}=o,{size:y}=p;return[s.label,s[`label${fa(y)}`]]}})({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 JSe(o){return o.key==="Backspace"||o.key==="Delete"}const QQ=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiChip"}),{avatar:C,className:N,clickable:L,color:z="default",component:G,deleteIcon:q,disabled:et=!1,icon:tt,label:nt,onClick:st,onDelete:at,onKeyDown:Ot,onKeyUp:Dt,size:St="medium",variant:ae="filled",tabIndex:ie,skipFocusWhenDisabled:Ne=!1,...pn}=y,de=ln.useRef(null),an=Im(de,p),Jn=li=>{li.stopPropagation(),at&&at(li)},Rn=li=>{li.currentTarget===li.target&&JSe(li)&&li.preventDefault(),Ot&&Ot(li)},jn=li=>{li.currentTarget===li.target&&at&&JSe(li)&&at(li),Dt&&Dt(li)},sr=L!==!1&&st?!0:L,fr=sr||at?GF:G||"div",fi={...y,component:fr,disabled:et,size:St,color:z,iconColor:ln.isValidElement(tt)&&tt.props.color||z,onDelete:!!at,clickable:sr,variant:ae},pi=sNn(fi),Or=fr===GF?{component:G||"div",focusVisibleClassName:pi.focusVisible,...at&&{disableRipple:!0}}:{};let di=null;at&&(di=q&&ln.isValidElement(q)?ln.cloneElement(q,{className:bo(q.props.className,pi.deleteIcon),onClick:Jn}):le.jsx(iNn,{className:bo(pi.deleteIcon),onClick:Jn}));let Ea=null;C&&ln.isValidElement(C)&&(Ea=ln.cloneElement(C,{className:bo(pi.avatar,C.props.className)}));let Qi=null;return tt&&ln.isValidElement(tt)&&(Qi=ln.cloneElement(tt,{className:bo(pi.icon,tt.props.className)})),le.jsxs(oNn,{as:fr,className:bo(pi.root,N),disabled:sr&&et?!0:void 0,onClick:st,onKeyDown:Rn,onKeyUp:jn,ref:an,tabIndex:Ne&&et?-1:ie,ownerState:fi,...Or,...pn,children:[Ea||Qi,le.jsx(cNn,{className:bo(pi.label),ownerState:fi,children:nt}),di]})});function _bt(o){return parseInt(o,10)||0}const uNn={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function lNn(o){for(const s in o)return!1;return!0}function ZSe(o){return lNn(o)||o.outerHeightStyle===0&&!o.overflowing}const hNn=ln.forwardRef(function(s,p){const{onChange:y,maxRows:C,minRows:N=1,style:L,value:z,...G}=s,{current:q}=ln.useRef(z!=null),et=ln.useRef(null),tt=Im(p,et),nt=ln.useRef(null),st=ln.useRef(null),at=ln.useCallback(()=>{const ie=et.current,Ne=st.current;if(!ie||!Ne)return;const de=r5(ie).getComputedStyle(ie);if(de.width==="0px")return{outerHeightStyle:0,overflowing:!1};Ne.style.width=de.width,Ne.value=ie.value||s.placeholder||"x",Ne.value.slice(-1)===`
29
29
  `&&(Ne.value+=" ");const an=de.boxSizing,Jn=_bt(de.paddingBottom)+_bt(de.paddingTop),Rn=_bt(de.borderBottomWidth)+_bt(de.borderTopWidth),jn=Ne.scrollHeight;Ne.value="x";const sr=Ne.scrollHeight;let fr=jn;N&&(fr=Math.max(Number(N)*sr,fr)),C&&(fr=Math.min(Number(C)*sr,fr)),fr=Math.max(fr,sr);const fi=fr+(an==="border-box"?Jn+Rn:0),pi=Math.abs(fr-jn)<=1;return{outerHeightStyle:fi,overflowing:pi}},[C,N,s.placeholder]),Ot=yBt(()=>{const ie=et.current,Ne=at();if(!ie||!Ne||ZSe(Ne))return!1;const pn=Ne.outerHeightStyle;return nt.current!=null&&nt.current!==pn}),Dt=ln.useCallback(()=>{const ie=et.current,Ne=at();if(!ie||!Ne||ZSe(Ne))return;const pn=Ne.outerHeightStyle;nt.current!==pn&&(nt.current=pn,ie.style.height=`${pn}px`),ie.style.overflow=Ne.overflowing?"hidden":""},[at]),St=ln.useRef(-1);bP(()=>{const ie=PFt(Dt),Ne=et==null?void 0:et.current;if(!Ne)return;const pn=r5(Ne);pn.addEventListener("resize",ie);let de;return typeof ResizeObserver<"u"&&(de=new ResizeObserver(()=>{Ot()&&(de.unobserve(Ne),cancelAnimationFrame(St.current),Dt(),St.current=requestAnimationFrame(()=>{de.observe(Ne)}))}),de.observe(Ne)),()=>{ie.clear(),cancelAnimationFrame(St.current),pn.removeEventListener("resize",ie),de&&de.disconnect()}},[at,Dt,Ot]),bP(()=>{Dt()});const ae=ie=>{q||Dt(),y&&y(ie)};return le.jsxs(ln.Fragment,{children:[le.jsx("textarea",{value:z,onChange:ae,ref:tt,rows:N,style:L,...G}),le.jsx("textarea",{"aria-hidden":!0,className:s.className,readOnly:!0,ref:st,tabIndex:-1,style:{...uNn.shadow,...L,paddingTop:0,paddingBottom:0}})]})});function xC({props:o,states:s,muiFormControl:p}){return s.reduce((y,C)=>(y[C]=o[C],p&&typeof o[C]>"u"&&(y[C]=p[C]),y),{})}const MFt=ln.createContext(void 0);function N6(){return ln.useContext(MFt)}function tCe(o){return o!=null&&!(Array.isArray(o)&&o.length===0)}function tmt(o,s=!1){return o&&(tCe(o.value)&&o.value!==""||s&&tCe(o.defaultValue)&&o.defaultValue!=="")}function fNn(o){return o.startAdornment}function dNn(o){return Vc("MuiInputBase",o)}const YF=au("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var eCe;const Bmt=(o,s)=>{const{ownerState:p}=o;return[s.root,p.formControl&&s.formControl,p.startAdornment&&s.adornedStart,p.endAdornment&&s.adornedEnd,p.error&&s.error,p.size==="small"&&s.sizeSmall,p.multiline&&s.multiline,p.color&&s[`color${fa(p.color)}`],p.fullWidth&&s.fullWidth,p.hiddenLabel&&s.hiddenLabel]},Fmt=(o,s)=>{const{ownerState:p}=o;return[s.input,p.size==="small"&&s.inputSizeSmall,p.multiline&&s.inputMultiline,p.type==="search"&&s.inputTypeSearch,p.startAdornment&&s.inputAdornedStart,p.endAdornment&&s.inputAdornedEnd,p.hiddenLabel&&s.inputHiddenLabel]},pNn=o=>{const{classes:s,color:p,disabled:y,error:C,endAdornment:N,focused:L,formControl:z,fullWidth:G,hiddenLabel:q,multiline:et,readOnly:tt,size:nt,startAdornment:st,type:at}=o,Ot={root:["root",`color${fa(p)}`,y&&"disabled",C&&"error",G&&"fullWidth",L&&"focused",z&&"formControl",nt&&nt!=="medium"&&`size${fa(nt)}`,et&&"multiline",st&&"adornedStart",N&&"adornedEnd",q&&"hiddenLabel",tt&&"readOnly"],input:["input",y&&"disabled",at==="search"&&"inputTypeSearch",et&&"inputMultiline",nt==="small"&&"inputSizeSmall",q&&"inputHiddenLabel",st&&"inputAdornedStart",N&&"inputAdornedEnd",tt&&"readOnly"]};return Hc(Ot,dNn,s)},$mt=Ia("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Bmt})(pu(({theme:o})=>({...o.typography.body1,color:(o.vars||o).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${YF.disabled}`]:{color:(o.vars||o).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:s})=>s.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:s,size:p})=>s.multiline&&p==="small",style:{paddingTop:1}},{props:({ownerState:s})=>s.fullWidth,style:{width:"100%"}}]}))),jmt=Ia("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Fmt})(pu(({theme:o})=>{const s=o.palette.mode==="light",p={color:"currentColor",...o.vars?{opacity:o.vars.opacity.inputPlaceholder}:{opacity:s?.42:.5},transition:o.transitions.create("opacity",{duration:o.transitions.duration.shorter})},y={opacity:"0 !important"},C=o.vars?{opacity:o.vars.opacity.inputPlaceholder}:{opacity:s?.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":p,"&::-moz-placeholder":p,"&::-ms-input-placeholder":p,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${YF.formControl} &`]:{"&::-webkit-input-placeholder":y,"&::-moz-placeholder":y,"&::-ms-input-placeholder":y,"&:focus::-webkit-input-placeholder":C,"&:focus::-moz-placeholder":C,"&:focus::-ms-input-placeholder":C},[`&.${YF.disabled}`]:{opacity:1,WebkitTextFillColor:(o.vars||o).palette.text.disabled},variants:[{props:({ownerState:N})=>!N.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:N})=>N.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),nCe=QIn({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),RFt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiInputBase"}),{"aria-describedby":C,autoComplete:N,autoFocus:L,className:z,color:G,components:q={},componentsProps:et={},defaultValue:tt,disabled:nt,disableInjectingGlobalStyles:st,endAdornment:at,error:Ot,fullWidth:Dt=!1,id:St,inputComponent:ae="input",inputProps:ie={},inputRef:Ne,margin:pn,maxRows:de,minRows:an,multiline:Jn=!1,name:Rn,onBlur:jn,onChange:sr,onClick:fr,onFocus:fi,onKeyDown:pi,onKeyUp:Or,placeholder:di,readOnly:Ea,renderSuffix:Qi,rows:li,size:ze,slotProps:Na={},slots:Ts={},startAdornment:Ke,type:xo="text",value:Ss,...La}=y,zo=ie.value!=null?ie.value:Ss,{current:$u}=ln.useRef(zo!=null),gu=ln.useRef(),Ds=ln.useCallback(su=>{},[]),pc=Im(gu,Ne,ie.ref,Ds),[bu,P1]=ln.useState(!1),il=N6(),Rh=xC({props:y,muiFormControl:il,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Rh.focused=il?il.focused:bu,ln.useEffect(()=>{!il&&nt&&bu&&(P1(!1),jn&&jn())},[il,nt,bu,jn]);const Mg=il&&il.onFilled,Rg=il&&il.onEmpty,Dg=ln.useCallback(su=>{tmt(su)?Mg&&Mg():Rg&&Rg()},[Mg,Rg]);bP(()=>{$u&&Dg({value:zo})},[zo,Dg,$u]);const iy=su=>{fi&&fi(su),ie.onFocus&&ie.onFocus(su),il&&il.onFocus?il.onFocus(su):P1(!0)},Yp=su=>{jn&&jn(su),ie.onBlur&&ie.onBlur(su),il&&il.onBlur?il.onBlur(su):P1(!1)},wd=(su,...Bg)=>{if(!$u){const d0=su.target||gu.current;if(d0==null)throw new Error(KAe(1));Dg({value:d0.value})}ie.onChange&&ie.onChange(su,...Bg),sr&&sr(su,...Bg)};ln.useEffect(()=>{Dg(gu.current)},[]);const Vp=su=>{gu.current&&su.currentTarget===su.target&&gu.current.focus(),fr&&fr(su)};let Ow=ae,Jd=ie;Jn&&Ow==="input"&&(li?Jd={type:void 0,minRows:li,maxRows:li,...Jd}:Jd={type:void 0,maxRows:de,minRows:an,...Jd},Ow=hNn);const R3=su=>{Dg(su.animationName==="mui-auto-fill-cancel"?gu.current:{value:"x"})};ln.useEffect(()=>{il&&il.setAdornedStart(!!Ke)},[il,Ke]);const Hr={...y,color:Rh.color||"primary",disabled:Rh.disabled,endAdornment:at,error:Rh.error,focused:Rh.focused,formControl:il,fullWidth:Dt,hiddenLabel:Rh.hiddenLabel,multiline:Jn,size:Rh.size,startAdornment:Ke,type:xo},da=pNn(Hr),Ws=Ts.root||q.Root||$mt,gc=Na.root||et.root||{},Cu=Ts.input||q.Input||jmt;return Jd={...Jd,...Na.input??et.input},le.jsxs(ln.Fragment,{children:[!st&&typeof nCe=="function"&&(eCe||(eCe=le.jsx(nCe,{}))),le.jsxs(Ws,{...gc,ref:p,onClick:Vp,...La,...!wBt(Ws)&&{ownerState:{...Hr,...gc.ownerState}},className:bo(da.root,gc.className,z,Ea&&"MuiInputBase-readOnly"),children:[Ke,le.jsx(MFt.Provider,{value:null,children:le.jsx(Cu,{"aria-invalid":Rh.error,"aria-describedby":C,autoComplete:N,autoFocus:L,defaultValue:tt,disabled:Rh.disabled,id:St,onAnimationStart:R3,name:Rn,placeholder:di,readOnly:Ea,required:Rh.required,rows:li,value:zo,onKeyDown:pi,onKeyUp:Or,type:xo,...Jd,...!wBt(Cu)&&{as:Ow,ownerState:{...Hr,...Jd.ownerState}},ref:pc,className:bo(da.input,Jd.className,Ea&&"MuiInputBase-readOnly"),onBlur:Yp,onChange:wd,onFocus:iy})}),at,Qi?Qi({...Rh,startAdornment:Ke}):null]})]})});function gNn(o){return Vc("MuiInput",o)}const oQ={...YF,...au("MuiInput",["root","underline","input"])};function bNn(o){return Vc("MuiOutlinedInput",o)}const m6={...YF,...au("MuiOutlinedInput",["root","notchedOutline","input"])};function mNn(o){return Vc("MuiFilledInput",o)}const rP={...YF,...au("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},yNn=a5(le.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),wNn={entering:{opacity:1},entered:{opacity:1}},vNn=ln.forwardRef(function(s,p){const y=vP(),C={enter:y.transitions.duration.enteringScreen,exit:y.transitions.duration.leavingScreen},{addEndListener:N,appear:L=!0,children:z,easing:G,in:q,onEnter:et,onEntered:tt,onEntering:nt,onExit:st,onExited:at,onExiting:Ot,style:Dt,timeout:St=C,TransitionComponent:ae=L3,...ie}=s,Ne=ln.useRef(null),pn=Im(Ne,r$(z),p),de=pi=>Or=>{if(pi){const di=Ne.current;Or===void 0?pi(di):pi(di,Or)}},an=de(nt),Jn=de((pi,Or)=>{LFt(pi);const di=gC({style:Dt,timeout:St,easing:G},{mode:"enter"});pi.style.webkitTransition=y.transitions.create("opacity",di),pi.style.transition=y.transitions.create("opacity",di),et&&et(pi,Or)}),Rn=de(tt),jn=de(Ot),sr=de(pi=>{const Or=gC({style:Dt,timeout:St,easing:G},{mode:"exit"});pi.style.webkitTransition=y.transitions.create("opacity",Or),pi.style.transition=y.transitions.create("opacity",Or),st&&st(pi)}),fr=de(at),fi=pi=>{N&&N(Ne.current,pi)};return le.jsx(ae,{appear:L,in:q,nodeRef:Ne,onEnter:Jn,onEntered:Rn,onEntering:an,onExit:sr,onExited:fr,onExiting:jn,addEndListener:fi,timeout:St,...ie,children:(pi,{ownerState:Or,...di})=>ln.cloneElement(z,{style:{opacity:0,visibility:pi==="exited"&&!q?"hidden":void 0,...wNn[pi],...Dt,...z.props.style},ref:pn,...di})})});function _Nn(o){return Vc("MuiBackdrop",o)}au("MuiBackdrop",["root","invisible"]);const xNn=o=>{const{classes:s,invisible:p}=o;return Hc({root:["root",p&&"invisible"]},_Nn,s)},ENn=Ia("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.invisible&&s.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"}}]}),TNn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiBackdrop"}),{children:C,className:N,component:L="div",invisible:z=!1,open:G,components:q={},componentsProps:et={},slotProps:tt={},slots:nt={},TransitionComponent:st,transitionDuration:at,...Ot}=y,Dt={...y,component:L,invisible:z},St=xNn(Dt),ae={transition:st,root:q.Root,...nt},ie={...et,...tt},Ne={slots:ae,slotProps:ie},[pn,de]=wh("root",{elementType:ENn,externalForwardedProps:Ne,className:bo(St.root,N),ownerState:Dt}),[an,Jn]=wh("transition",{elementType:vNn,externalForwardedProps:Ne,ownerState:Dt});return le.jsx(an,{in:G,timeout:at,...Ot,...Jn,children:le.jsx(pn,{"aria-hidden":!0,...de,classes:St,ref:p,children:C})})});function kNn(o){return Vc("MuiButton",o)}const iP=au("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"]),SNn=ln.createContext({}),CNn=ln.createContext(void 0),ANn=o=>{const{color:s,disableElevation:p,fullWidth:y,size:C,variant:N,loading:L,loadingPosition:z,classes:G}=o,q={root:["root",L&&"loading",N,`${N}${fa(s)}`,`size${fa(C)}`,`${N}Size${fa(C)}`,`color${fa(s)}`,p&&"disableElevation",y&&"fullWidth",L&&`loadingPosition${fa(z)}`],startIcon:["icon","startIcon",`iconSize${fa(C)}`],endIcon:["icon","endIcon",`iconSize${fa(C)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},et=Hc(q,kNn,G);return{...G,...et}},nIe=[{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}}}],INn=Ia(GF,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[p.variant],s[`${p.variant}${fa(p.color)}`],s[`size${fa(p.size)}`],s[`${p.variant}Size${fa(p.size)}`],p.color==="inherit"&&s.colorInherit,p.disableElevation&&s.disableElevation,p.fullWidth&&s.fullWidth,p.loading&&s.loading]}})(pu(({theme:o})=>{const s=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],p=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return{...o.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${iP.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(o.vars||o).shadows[2],"&:hover":{boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2]}},"&:active":{boxShadow:(o.vars||o).shadows[8]},[`&.${iP.focusVisible}`]:{boxShadow:(o.vars||o).shadows[6]},[`&.${iP.disabled}`]:{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).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)",[`&.${iP.disabled}`]:{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(o.palette).filter(Am()).map(([y])=>({props:{color:y},style:{"--variant-textColor":(o.vars||o).palette[y].main,"--variant-outlinedColor":(o.vars||o).palette[y].main,"--variant-outlinedBorder":o.vars?`rgba(${o.vars.palette[y].mainChannel} / 0.5)`:Ef(o.palette[y].main,.5),"--variant-containedColor":(o.vars||o).palette[y].contrastText,"--variant-containedBg":(o.vars||o).palette[y].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(o.vars||o).palette[y].dark,"--variant-textBg":o.vars?`rgba(${o.vars.palette[y].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[y].main,o.palette.action.hoverOpacity),"--variant-outlinedBorder":(o.vars||o).palette[y].main,"--variant-outlinedBg":o.vars?`rgba(${o.vars.palette[y].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[y].main,o.palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedBg:s,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedHoverBg:p,"--variant-textBg":o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.text.primary,o.palette.action.hoverOpacity),"--variant-outlinedBg":o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.text.primary,o.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:o.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${iP.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${iP.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:o.transitions.create(["background-color","box-shadow","border-color"],{duration:o.transitions.duration.short}),[`&.${iP.loading}`]:{color:"transparent"}}}]}})),ONn=Ia("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.startIcon,p.loading&&s.startIconLoadingStart,s[`iconSize${fa(p.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...nIe]})),NNn=Ia("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.endIcon,p.loading&&s.endIconLoadingEnd,s[`iconSize${fa(p.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...nIe]})),PNn=Ia("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(o,s)=>s.loadingIndicator})(({theme:o})=>({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:(o.vars||o).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}}]})),rCe=Ia("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(o,s)=>s.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),emt=ln.forwardRef(function(s,p){const y=ln.useContext(SNn),C=ln.useContext(CNn),N=$Ae(y,s),L=Su({props:N,name:"MuiButton"}),{children:z,color:G="primary",component:q="button",className:et,disabled:tt=!1,disableElevation:nt=!1,disableFocusRipple:st=!1,endIcon:at,focusVisibleClassName:Ot,fullWidth:Dt=!1,id:St,loading:ae=null,loadingIndicator:ie,loadingPosition:Ne="center",size:pn="medium",startIcon:de,type:an,variant:Jn="text",...Rn}=L,jn=VQ(St),sr=ie??le.jsx(eIe,{"aria-labelledby":jn,color:"inherit",size:16}),fr={...L,color:G,component:q,disabled:tt,disableElevation:nt,disableFocusRipple:st,fullWidth:Dt,loading:ae,loadingIndicator:sr,loadingPosition:Ne,size:pn,type:an,variant:Jn},fi=ANn(fr),pi=(de||ae&&Ne==="start")&&le.jsx(ONn,{className:fi.startIcon,ownerState:fr,children:de||le.jsx(rCe,{className:fi.loadingIconPlaceholder,ownerState:fr})}),Or=(at||ae&&Ne==="end")&&le.jsx(NNn,{className:fi.endIcon,ownerState:fr,children:at||le.jsx(rCe,{className:fi.loadingIconPlaceholder,ownerState:fr})}),di=C||"",Ea=typeof ae=="boolean"?le.jsx("span",{className:fi.loadingWrapper,style:{display:"contents"},children:ae&&le.jsx(PNn,{className:fi.loadingIndicator,ownerState:fr,children:sr})}):null;return le.jsxs(INn,{ownerState:fr,className:bo(y.className,fi.root,et,di),component:q,disabled:tt||ae,focusRipple:!st,focusVisibleClassName:bo(fi.focusVisible,Ot),ref:p,type:an,id:ae?jn:St,...Rn,classes:fi,children:[pi,Ne!=="end"&&Ea,z,Ne==="end"&&Ea,Or]})});function LNn(o){return Vc("MuiCard",o)}au("MuiCard",["root"]);const MNn=o=>{const{classes:s}=o;return Hc({root:["root"]},LNn,s)},RNn=Ia(XQ,{name:"MuiCard",slot:"Root",overridesResolver:(o,s)=>s.root})({overflow:"hidden"}),JQ=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCard"}),{className:C,raised:N=!1,...L}=y,z={...y,raised:N},G=MNn(z);return le.jsx(RNn,{className:bo(G.root,C),elevation:N?8:void 0,ref:p,ownerState:z,...L})});function DNn(o){return Vc("MuiCardActions",o)}au("MuiCardActions",["root","spacing"]);const BNn=o=>{const{classes:s,disableSpacing:p}=o;return Hc({root:["root",!p&&"spacing"]},DNn,s)},FNn=Ia("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.disableSpacing&&s.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),rIe=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCardActions"}),{disableSpacing:C=!1,className:N,...L}=y,z={...y,disableSpacing:C},G=BNn(z);return le.jsx(FNn,{className:bo(G.root,N),ownerState:z,ref:p,...L})});function $Nn(o){return Vc("MuiCardContent",o)}au("MuiCardContent",["root"]);const jNn=o=>{const{classes:s}=o;return Hc({root:["root"]},$Nn,s)},HNn=Ia("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(o,s)=>s.root})({padding:16,"&:last-child":{paddingBottom:24}}),mP=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiCardContent"}),{className:C,component:N="div",...L}=y,z={...y,component:N},G=jNn(z);return le.jsx(HNn,{as:N,className:bo(G.root,C),ownerState:z,ref:p,...L})});function zNn(o){return Vc("PrivateSwitchBase",o)}au("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const UNn=o=>{const{classes:s,checked:p,disabled:y,edge:C}=o,N={root:["root",p&&"checked",y&&"disabled",C&&`edge${fa(C)}`],input:["input"]};return Hc(N,zNn,s)},qNn=Ia(GF)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:o,ownerState:s})=>o==="start"&&s.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:o,ownerState:s})=>o==="end"&&s.size!=="small",style:{marginRight:-12}}]}),WNn=Ia("input",{shouldForwardProp:ny})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),KNn=ln.forwardRef(function(s,p){const{autoFocus:y,checked:C,checkedIcon:N,defaultChecked:L,disabled:z,disableFocusRipple:G=!1,edge:q=!1,icon:et,id:tt,inputProps:nt,inputRef:st,name:at,onBlur:Ot,onChange:Dt,onFocus:St,readOnly:ae,required:ie=!1,tabIndex:Ne,type:pn,value:de,slots:an={},slotProps:Jn={},...Rn}=s,[jn,sr]=jQ({controlled:C,default:!!L,name:"SwitchBase",state:"checked"}),fr=N6(),fi=Ss=>{St&&St(Ss),fr&&fr.onFocus&&fr.onFocus(Ss)},pi=Ss=>{Ot&&Ot(Ss),fr&&fr.onBlur&&fr.onBlur(Ss)},Or=Ss=>{if(Ss.nativeEvent.defaultPrevented)return;const La=Ss.target.checked;sr(La),Dt&&Dt(Ss,La)};let di=z;fr&&typeof di>"u"&&(di=fr.disabled);const Ea=pn==="checkbox"||pn==="radio",Qi={...s,checked:jn,disabled:di,disableFocusRipple:G,edge:q},li=UNn(Qi),ze={slots:an,slotProps:{input:nt,...Jn}},[Na,Ts]=wh("root",{ref:p,elementType:qNn,className:li.root,shouldForwardComponentProp:!0,externalForwardedProps:{...ze,component:"span",...Rn},getSlotProps:Ss=>({...Ss,onFocus:La=>{var zo;(zo=Ss.onFocus)==null||zo.call(Ss,La),fi(La)},onBlur:La=>{var zo;(zo=Ss.onBlur)==null||zo.call(Ss,La),pi(La)}}),ownerState:Qi,additionalProps:{centerRipple:!0,focusRipple:!G,disabled:di,role:void 0,tabIndex:null}}),[Ke,xo]=wh("input",{ref:st,elementType:WNn,className:li.input,externalForwardedProps:ze,getSlotProps:Ss=>({onChange:La=>{var zo;(zo=Ss.onChange)==null||zo.call(Ss,La),Or(La)}}),ownerState:Qi,additionalProps:{autoFocus:y,checked:C,defaultChecked:L,disabled:di,id:Ea?tt:void 0,name:at,readOnly:ae,required:ie,tabIndex:Ne,type:pn,...pn==="checkbox"&&de===void 0?{}:{value:de}}});return le.jsxs(Na,{...Ts,children:[le.jsx(Ke,{...xo}),jn?N:et]})}),iCe=mOn({createStyledComponent:Ia("div",{name:"MuiContainer",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[`maxWidth${fa(String(p.maxWidth))}`],p.fixed&&s.fixed,p.disableGutters&&s.disableGutters]}}),useThemeProps:o=>Su({props:o,name:"MuiContainer"})});function GNn(o){const s=n5(o);return s.body===o?r5(o).innerWidth>s.documentElement.clientWidth:o.scrollHeight>o.clientHeight}function CQ(o,s){s?o.setAttribute("aria-hidden","true"):o.removeAttribute("aria-hidden")}function aCe(o){return parseInt(r5(o).getComputedStyle(o).paddingRight,10)||0}function YNn(o){const p=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(o.tagName),y=o.tagName==="INPUT"&&o.getAttribute("type")==="hidden";return p||y}function sCe(o,s,p,y,C){const N=[s,p,...y];[].forEach.call(o.children,L=>{const z=!N.includes(L),G=!YNn(L);z&&G&&CQ(L,C)})}function RDt(o,s){let p=-1;return o.some((y,C)=>s(y)?(p=C,!0):!1),p}function VNn(o,s){const p=[],y=o.container;if(!s.disableScrollLock){if(GNn(y)){const L=YAe(r5(y));p.push({value:y.style.paddingRight,property:"padding-right",el:y}),y.style.paddingRight=`${aCe(y)+L}px`;const z=n5(y).querySelectorAll(".mui-fixed");[].forEach.call(z,G=>{p.push({value:G.style.paddingRight,property:"padding-right",el:G}),G.style.paddingRight=`${aCe(G)+L}px`})}let N;if(y.parentNode instanceof DocumentFragment)N=n5(y).body;else{const L=y.parentElement,z=r5(y);N=(L==null?void 0:L.nodeName)==="HTML"&&z.getComputedStyle(L).overflowY==="scroll"?L:y}p.push({value:N.style.overflow,property:"overflow",el:N},{value:N.style.overflowX,property:"overflow-x",el:N},{value:N.style.overflowY,property:"overflow-y",el:N}),N.style.overflow="hidden"}return()=>{p.forEach(({value:N,el:L,property:z})=>{N?L.style.setProperty(z,N):L.style.removeProperty(z)})}}function XNn(o){const s=[];return[].forEach.call(o.children,p=>{p.getAttribute("aria-hidden")==="true"&&s.push(p)}),s}class QNn{constructor(){this.modals=[],this.containers=[]}add(s,p){let y=this.modals.indexOf(s);if(y!==-1)return y;y=this.modals.length,this.modals.push(s),s.modalRef&&CQ(s.modalRef,!1);const C=XNn(p);sCe(p,s.mount,s.modalRef,C,!0);const N=RDt(this.containers,L=>L.container===p);return N!==-1?(this.containers[N].modals.push(s),y):(this.containers.push({modals:[s],container:p,restore:null,hiddenSiblings:C}),y)}mount(s,p){const y=RDt(this.containers,N=>N.modals.includes(s)),C=this.containers[y];C.restore||(C.restore=VNn(C,p))}remove(s,p=!0){const y=this.modals.indexOf(s);if(y===-1)return y;const C=RDt(this.containers,L=>L.modals.includes(s)),N=this.containers[C];if(N.modals.splice(N.modals.indexOf(s),1),this.modals.splice(y,1),N.modals.length===0)N.restore&&N.restore(),s.modalRef&&CQ(s.modalRef,p),sCe(N.container,s.mount,s.modalRef,N.hiddenSiblings,!1),this.containers.splice(C,1);else{const L=N.modals[N.modals.length-1];L.modalRef&&CQ(L.modalRef,!1)}return y}isTopModal(s){return this.modals.length>0&&this.modals[this.modals.length-1]===s}}const JNn=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function ZNn(o){const s=parseInt(o.getAttribute("tabindex")||"",10);return Number.isNaN(s)?o.contentEditable==="true"||(o.nodeName==="AUDIO"||o.nodeName==="VIDEO"||o.nodeName==="DETAILS")&&o.getAttribute("tabindex")===null?0:o.tabIndex:s}function tPn(o){if(o.tagName!=="INPUT"||o.type!=="radio"||!o.name)return!1;const s=y=>o.ownerDocument.querySelector(`input[type="radio"]${y}`);let p=s(`[name="${o.name}"]:checked`);return p||(p=s(`[name="${o.name}"]`)),p!==o}function ePn(o){return!(o.disabled||o.tagName==="INPUT"&&o.type==="hidden"||tPn(o))}function nPn(o){const s=[],p=[];return Array.from(o.querySelectorAll(JNn)).forEach((y,C)=>{const N=ZNn(y);N===-1||!ePn(y)||(N===0?s.push(y):p.push({documentOrder:C,tabIndex:N,node:y}))}),p.sort((y,C)=>y.tabIndex===C.tabIndex?y.documentOrder-C.documentOrder:y.tabIndex-C.tabIndex).map(y=>y.node).concat(s)}function rPn(){return!0}function iPn(o){const{children:s,disableAutoFocus:p=!1,disableEnforceFocus:y=!1,disableRestoreFocus:C=!1,getTabbable:N=nPn,isEnabled:L=rPn,open:z}=o,G=ln.useRef(!1),q=ln.useRef(null),et=ln.useRef(null),tt=ln.useRef(null),nt=ln.useRef(null),st=ln.useRef(!1),at=ln.useRef(null),Ot=Im(r$(s),at),Dt=ln.useRef(null);ln.useEffect(()=>{!z||!at.current||(st.current=!p)},[p,z]),ln.useEffect(()=>{if(!z||!at.current)return;const ie=n5(at.current);return at.current.contains(ie.activeElement)||(at.current.hasAttribute("tabIndex")||at.current.setAttribute("tabIndex","-1"),st.current&&at.current.focus()),()=>{C||(tt.current&&tt.current.focus&&(G.current=!0,tt.current.focus()),tt.current=null)}},[z]),ln.useEffect(()=>{if(!z||!at.current)return;const ie=n5(at.current),Ne=an=>{Dt.current=an,!(y||!L()||an.key!=="Tab")&&ie.activeElement===at.current&&an.shiftKey&&(G.current=!0,et.current&&et.current.focus())},pn=()=>{var Rn,jn;const an=at.current;if(an===null)return;if(!ie.hasFocus()||!L()||G.current){G.current=!1;return}if(an.contains(ie.activeElement)||y&&ie.activeElement!==q.current&&ie.activeElement!==et.current)return;if(ie.activeElement!==nt.current)nt.current=null;else if(nt.current!==null)return;if(!st.current)return;let Jn=[];if((ie.activeElement===q.current||ie.activeElement===et.current)&&(Jn=N(at.current)),Jn.length>0){const sr=!!((Rn=Dt.current)!=null&&Rn.shiftKey&&((jn=Dt.current)==null?void 0:jn.key)==="Tab"),fr=Jn[0],fi=Jn[Jn.length-1];typeof fr!="string"&&typeof fi!="string"&&(sr?fi.focus():fr.focus())}else an.focus()};ie.addEventListener("focusin",pn),ie.addEventListener("keydown",Ne,!0);const de=setInterval(()=>{ie.activeElement&&ie.activeElement.tagName==="BODY"&&pn()},50);return()=>{clearInterval(de),ie.removeEventListener("focusin",pn),ie.removeEventListener("keydown",Ne,!0)}},[p,y,C,L,z,N]);const St=ie=>{tt.current===null&&(tt.current=ie.relatedTarget),st.current=!0,nt.current=ie.target;const Ne=s.props.onFocus;Ne&&Ne(ie)},ae=ie=>{tt.current===null&&(tt.current=ie.relatedTarget),st.current=!0};return le.jsxs(ln.Fragment,{children:[le.jsx("div",{tabIndex:z?0:-1,onFocus:ae,ref:q,"data-testid":"sentinelStart"}),ln.cloneElement(s,{ref:Ot,onFocus:St}),le.jsx("div",{tabIndex:z?0:-1,onFocus:ae,ref:et,"data-testid":"sentinelEnd"})]})}function aPn(o){return typeof o=="function"?o():o}function sPn(o){return o?o.props.hasOwnProperty("in"):!1}const oCe=()=>{},xbt=new QNn;function oPn(o){const{container:s,disableEscapeKeyDown:p=!1,disableScrollLock:y=!1,closeAfterTransition:C=!1,onTransitionEnter:N,onTransitionExited:L,children:z,onClose:G,open:q,rootRef:et}=o,tt=ln.useRef({}),nt=ln.useRef(null),st=ln.useRef(null),at=Im(st,et),[Ot,Dt]=ln.useState(!q),St=sPn(z);let ae=!0;(o["aria-hidden"]==="false"||o["aria-hidden"]===!1)&&(ae=!1);const ie=()=>n5(nt.current),Ne=()=>(tt.current.modalRef=st.current,tt.current.mount=nt.current,tt.current),pn=()=>{xbt.mount(Ne(),{disableScrollLock:y}),st.current&&(st.current.scrollTop=0)},de=yBt(()=>{const Or=aPn(s)||ie().body;xbt.add(Ne(),Or),st.current&&pn()}),an=()=>xbt.isTopModal(Ne()),Jn=yBt(Or=>{nt.current=Or,Or&&(q&&an()?pn():st.current&&CQ(st.current,ae))}),Rn=ln.useCallback(()=>{xbt.remove(Ne(),ae)},[ae]);ln.useEffect(()=>()=>{Rn()},[Rn]),ln.useEffect(()=>{q?de():(!St||!C)&&Rn()},[q,Rn,St,C,de]);const jn=Or=>di=>{var Ea;(Ea=Or.onKeyDown)==null||Ea.call(Or,di),!(di.key!=="Escape"||di.which===229||!an())&&(p||(di.stopPropagation(),G&&G(di,"escapeKeyDown")))},sr=Or=>di=>{var Ea;(Ea=Or.onClick)==null||Ea.call(Or,di),di.target===di.currentTarget&&G&&G(di,"backdropClick")};return{getRootProps:(Or={})=>{const di=JIn(o);delete di.onTransitionEnter,delete di.onTransitionExited;const Ea={...di,...Or};return{role:"presentation",...Ea,onKeyDown:jn(Ea),ref:at}},getBackdropProps:(Or={})=>{const di=Or;return{"aria-hidden":!0,...di,onClick:sr(di),open:q}},getTransitionProps:()=>{const Or=()=>{Dt(!1),N&&N()},di=()=>{Dt(!0),L&&L(),C&&Rn()};return{onEnter:vBt(Or,(z==null?void 0:z.props.onEnter)??oCe),onExited:vBt(di,(z==null?void 0:z.props.onExited)??oCe)}},rootRef:at,portalRef:Jn,isTopModal:an,exited:Ot,hasTransition:St}}function cPn(o){return Vc("MuiModal",o)}au("MuiModal",["root","hidden","backdrop"]);const uPn=o=>{const{open:s,exited:p,classes:y}=o;return Hc({root:["root",!s&&p&&"hidden"],backdrop:["backdrop"]},cPn,y)},lPn=Ia("div",{name:"MuiModal",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.open&&p.exited&&s.hidden]}})(pu(({theme:o})=>({position:"fixed",zIndex:(o.vars||o).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:s})=>!s.open&&s.exited,style:{visibility:"hidden"}}]}))),hPn=Ia(TNn,{name:"MuiModal",slot:"Backdrop",overridesResolver:(o,s)=>s.backdrop})({zIndex:-1}),iIe=ln.forwardRef(function(s,p){const y=Su({name:"MuiModal",props:s}),{BackdropComponent:C=hPn,BackdropProps:N,classes:L,className:z,closeAfterTransition:G=!1,children:q,container:et,component:tt,components:nt={},componentsProps:st={},disableAutoFocus:at=!1,disableEnforceFocus:Ot=!1,disableEscapeKeyDown:Dt=!1,disablePortal:St=!1,disableRestoreFocus:ae=!1,disableScrollLock:ie=!1,hideBackdrop:Ne=!1,keepMounted:pn=!1,onBackdropClick:de,onClose:an,onTransitionEnter:Jn,onTransitionExited:Rn,open:jn,slotProps:sr={},slots:fr={},theme:fi,...pi}=y,Or={...y,closeAfterTransition:G,disableAutoFocus:at,disableEnforceFocus:Ot,disableEscapeKeyDown:Dt,disablePortal:St,disableRestoreFocus:ae,disableScrollLock:ie,hideBackdrop:Ne,keepMounted:pn},{getRootProps:di,getBackdropProps:Ea,getTransitionProps:Qi,portalRef:li,isTopModal:ze,exited:Na,hasTransition:Ts}=oPn({...Or,rootRef:p}),Ke={...Or,exited:Na},xo=uPn(Ke),Ss={};if(q.props.tabIndex===void 0&&(Ss.tabIndex="-1"),Ts){const{onEnter:pc,onExited:bu}=Qi();Ss.onEnter=pc,Ss.onExited=bu}const La={slots:{root:nt.Root,backdrop:nt.Backdrop,...fr},slotProps:{...st,...sr}},[zo,$u]=wh("root",{ref:p,elementType:lPn,externalForwardedProps:{...La,...pi,component:tt},getSlotProps:di,ownerState:Ke,className:bo(z,xo==null?void 0:xo.root,!Ke.open&&Ke.exited&&(xo==null?void 0:xo.hidden))}),[gu,Ds]=wh("backdrop",{ref:N==null?void 0:N.ref,elementType:C,externalForwardedProps:La,shouldForwardComponentProp:!0,additionalProps:N,getSlotProps:pc=>Ea({...pc,onClick:bu=>{de&&de(bu),pc!=null&&pc.onClick&&pc.onClick(bu)}}),className:bo(N==null?void 0:N.className,xo==null?void 0:xo.backdrop),ownerState:Ke});return!pn&&!jn&&(!Ts||Na)?null:le.jsx(rNn,{ref:li,container:et,disablePortal:St,children:le.jsxs(zo,{...$u,children:[!Ne&&C?le.jsx(gu,{...Ds}):null,le.jsx(iPn,{disableEnforceFocus:Ot,disableAutoFocus:at,disableRestoreFocus:ae,isEnabled:ze,open:jn,children:ln.cloneElement(q,Ss)})]})})});function fPn(o,s,p){const y=s.getBoundingClientRect(),C=p&&p.getBoundingClientRect(),N=r5(s);let L;if(s.fakeTransform)L=s.fakeTransform;else{const q=N.getComputedStyle(s);L=q.getPropertyValue("-webkit-transform")||q.getPropertyValue("transform")}let z=0,G=0;if(L&&L!=="none"&&typeof L=="string"){const q=L.split("(")[1].split(")")[0].split(",");z=parseInt(q[4],10),G=parseInt(q[5],10)}return o==="left"?C?`translateX(${C.right+z-y.left}px)`:`translateX(${N.innerWidth+z-y.left}px)`:o==="right"?C?`translateX(-${y.right-C.left-z}px)`:`translateX(-${y.left+y.width-z}px)`:o==="up"?C?`translateY(${C.bottom+G-y.top}px)`:`translateY(${N.innerHeight+G-y.top}px)`:C?`translateY(-${y.top-C.top+y.height-G}px)`:`translateY(-${y.top+y.height-G}px)`}function dPn(o){return typeof o=="function"?o():o}function Ebt(o,s,p){const y=dPn(p),C=fPn(o,s,y);C&&(s.style.webkitTransform=C,s.style.transform=C)}const pPn=ln.forwardRef(function(s,p){const y=vP(),C={enter:y.transitions.easing.easeOut,exit:y.transitions.easing.sharp},N={enter:y.transitions.duration.enteringScreen,exit:y.transitions.duration.leavingScreen},{addEndListener:L,appear:z=!0,children:G,container:q,direction:et="down",easing:tt=C,in:nt,onEnter:st,onEntered:at,onEntering:Ot,onExit:Dt,onExited:St,onExiting:ae,style:ie,timeout:Ne=N,TransitionComponent:pn=L3,...de}=s,an=ln.useRef(null),Jn=Im(r$(G),an,p),Rn=Qi=>li=>{Qi&&(li===void 0?Qi(an.current):Qi(an.current,li))},jn=Rn((Qi,li)=>{Ebt(et,Qi,q),LFt(Qi),st&&st(Qi,li)}),sr=Rn((Qi,li)=>{const ze=gC({timeout:Ne,style:ie,easing:tt},{mode:"enter"});Qi.style.webkitTransition=y.transitions.create("-webkit-transform",{...ze}),Qi.style.transition=y.transitions.create("transform",{...ze}),Qi.style.webkitTransform="none",Qi.style.transform="none",Ot&&Ot(Qi,li)}),fr=Rn(at),fi=Rn(ae),pi=Rn(Qi=>{const li=gC({timeout:Ne,style:ie,easing:tt},{mode:"exit"});Qi.style.webkitTransition=y.transitions.create("-webkit-transform",li),Qi.style.transition=y.transitions.create("transform",li),Ebt(et,Qi,q),Dt&&Dt(Qi)}),Or=Rn(Qi=>{Qi.style.webkitTransition="",Qi.style.transition="",St&&St(Qi)}),di=Qi=>{L&&L(an.current,Qi)},Ea=ln.useCallback(()=>{an.current&&Ebt(et,an.current,q)},[et,q]);return ln.useEffect(()=>{if(nt||et==="down"||et==="right")return;const Qi=PFt(()=>{an.current&&Ebt(et,an.current,q)}),li=r5(an.current);return li.addEventListener("resize",Qi),()=>{Qi.clear(),li.removeEventListener("resize",Qi)}},[et,nt,q]),ln.useEffect(()=>{nt||Ea()},[nt,Ea]),le.jsx(pn,{nodeRef:an,onEnter:jn,onEntered:fr,onEntering:sr,onExit:pi,onExited:Or,onExiting:fi,addEndListener:di,appear:z,in:nt,timeout:Ne,...de,children:(Qi,{ownerState:li,...ze})=>ln.cloneElement(G,{ref:Jn,style:{visibility:Qi==="exited"&&!nt?"hidden":void 0,...ie,...G.props.style},...ze})})});function gPn(o){return Vc("MuiDrawer",o)}au("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const aIe=(o,s)=>{const{ownerState:p}=o;return[s.root,(p.variant==="permanent"||p.variant==="persistent")&&s.docked,s.modal]},bPn=o=>{const{classes:s,anchor:p,variant:y}=o,C={root:["root",`anchor${fa(p)}`],docked:[(y==="permanent"||y==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${fa(p)}`,y!=="temporary"&&`paperAnchorDocked${fa(p)}`]};return Hc(C,gPn,s)},mPn=Ia(iIe,{name:"MuiDrawer",slot:"Root",overridesResolver:aIe})(pu(({theme:o})=>({zIndex:(o.vars||o).zIndex.drawer}))),yPn=Ia("div",{shouldForwardProp:ny,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:aIe})({flex:"0 0 auto"}),wPn=Ia(XQ,{name:"MuiDrawer",slot:"Paper",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.paper,s[`paperAnchor${fa(p.anchor)}`],p.variant!=="temporary"&&s[`paperAnchorDocked${fa(p.anchor)}`]]}})(pu(({theme:o})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(o.vars||o).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:s})=>s.anchor==="left"&&s.variant!=="temporary",style:{borderRight:`1px solid ${(o.vars||o).palette.divider}`}},{props:({ownerState:s})=>s.anchor==="top"&&s.variant!=="temporary",style:{borderBottom:`1px solid ${(o.vars||o).palette.divider}`}},{props:({ownerState:s})=>s.anchor==="right"&&s.variant!=="temporary",style:{borderLeft:`1px solid ${(o.vars||o).palette.divider}`}},{props:({ownerState:s})=>s.anchor==="bottom"&&s.variant!=="temporary",style:{borderTop:`1px solid ${(o.vars||o).palette.divider}`}}]}))),sIe={left:"right",right:"left",top:"down",bottom:"up"};function vPn(o){return["left","right"].includes(o)}function _Pn({direction:o},s){return o==="rtl"&&vPn(s)?sIe[s]:s}const xPn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiDrawer"}),C=vP(),N=JAe(),L={enter:C.transitions.duration.enteringScreen,exit:C.transitions.duration.leavingScreen},{anchor:z="left",BackdropProps:G,children:q,className:et,elevation:tt=16,hideBackdrop:nt=!1,ModalProps:{BackdropProps:st,...at}={},onClose:Ot,open:Dt=!1,PaperProps:St={},SlideProps:ae,TransitionComponent:ie,transitionDuration:Ne=L,variant:pn="temporary",slots:de={},slotProps:an={},...Jn}=y,Rn=ln.useRef(!1);ln.useEffect(()=>{Rn.current=!0},[]);const jn=_Pn({direction:N?"rtl":"ltr"},z),fr={...y,anchor:z,elevation:tt,open:Dt,variant:pn,...Jn},fi=bPn(fr),pi={slots:{transition:ie,...de},slotProps:{paper:St,transition:ae,...an,backdrop:ZAe(an.backdrop||{...G,...st},{transitionDuration:Ne})}},[Or,di]=wh("root",{ref:p,elementType:mPn,className:bo(fi.root,fi.modal,et),shouldForwardComponentProp:!0,ownerState:fr,externalForwardedProps:{...pi,...Jn,...at},additionalProps:{open:Dt,onClose:Ot,hideBackdrop:nt,slots:{backdrop:pi.slots.backdrop},slotProps:{backdrop:pi.slotProps.backdrop}}}),[Ea,Qi]=wh("paper",{elementType:wPn,shouldForwardComponentProp:!0,className:bo(fi.paper,St.className),ownerState:fr,externalForwardedProps:pi,additionalProps:{elevation:pn==="temporary"?tt:0,square:!0}}),[li,ze]=wh("docked",{elementType:yPn,ref:p,className:bo(fi.root,fi.docked,et),ownerState:fr,externalForwardedProps:pi,additionalProps:Jn}),[Na,Ts]=wh("transition",{elementType:pPn,ownerState:fr,externalForwardedProps:pi,additionalProps:{in:Dt,direction:sIe[jn],timeout:Ne,appear:Rn.current}}),Ke=le.jsx(Ea,{...Qi,children:q});if(pn==="permanent")return le.jsx(li,{...ze,children:Ke});const xo=le.jsx(Na,{...Ts,children:Ke});return pn==="persistent"?le.jsx(li,{...ze,children:xo}):le.jsx(Or,{...di,children:xo})}),EPn=o=>{const{classes:s,disableUnderline:p,startAdornment:y,endAdornment:C,size:N,hiddenLabel:L,multiline:z}=o,G={root:["root",!p&&"underline",y&&"adornedStart",C&&"adornedEnd",N==="small"&&`size${fa(N)}`,L&&"hiddenLabel",z&&"multiline"],input:["input"]},q=Hc(G,mNn,s);return{...s,...q}},TPn=Ia($mt,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[...Bmt(o,s),!p.disableUnderline&&s.underline]}})(pu(({theme:o})=>{const s=o.palette.mode==="light",p=s?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",y=s?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",C=s?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",N=s?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y,borderTopLeftRadius:(o.vars||o).shape.borderRadius,borderTopRightRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create("background-color",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),"&:hover":{backgroundColor:o.vars?o.vars.palette.FilledInput.hoverBg:C,"@media (hover: none)":{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y}},[`&.${rP.focused}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:y},[`&.${rP.disabled}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.disabledBg:N},variants:[{props:({ownerState:L})=>!L.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rP.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rP.error}`]:{"&::before, &::after":{borderBottomColor:(o.vars||o).palette.error.main}},"&::before":{borderBottom:`1px solid ${o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / ${o.vars.opacity.inputUnderline})`:p}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:o.transitions.create("border-bottom-color",{duration:o.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rP.disabled}, .${rP.error}):before`]:{borderBottom:`1px solid ${(o.vars||o).palette.text.primary}`},[`&.${rP.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(o.palette).filter(Am()).map(([L])=>{var z;return{props:{disableUnderline:!1,color:L},style:{"&::after":{borderBottom:`2px solid ${(z=(o.vars||o).palette[L])==null?void 0:z.main}`}}}}),{props:({ownerState:L})=>L.startAdornment,style:{paddingLeft:12}},{props:({ownerState:L})=>L.endAdornment,style:{paddingRight:12}},{props:({ownerState:L})=>L.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:L,size:z})=>L.multiline&&z==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:L})=>L.multiline&&L.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:L})=>L.multiline&&L.hiddenLabel&&L.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),kPn=Ia(jmt,{name:"MuiFilledInput",slot:"Input",overridesResolver:Fmt})(pu(({theme:o})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!o.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:o.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:o.palette.mode==="light"?null:"#fff",caretColor:o.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...o.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[o.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:s})=>s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:0}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:0}},{props:({ownerState:s})=>s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:s})=>s.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),DFt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFilledInput"}),{disableUnderline:C=!1,components:N={},componentsProps:L,fullWidth:z=!1,hiddenLabel:G,inputComponent:q="input",multiline:et=!1,slotProps:tt,slots:nt={},type:st="text",...at}=y,Ot={...y,disableUnderline:C,fullWidth:z,inputComponent:q,multiline:et,type:st},Dt=EPn(y),St={root:{ownerState:Ot},input:{ownerState:Ot}},ae=tt??L?NFt(St,tt??L):St,ie=nt.root??N.Root??TPn,Ne=nt.input??N.Input??kPn;return le.jsx(RFt,{slots:{root:ie,input:Ne},slotProps:ae,fullWidth:z,inputComponent:q,multiline:et,ref:p,type:st,...at,classes:Dt})});DFt.muiName="Input";function SPn(o){return Vc("MuiFormControl",o)}au("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const CPn=o=>{const{classes:s,margin:p,fullWidth:y}=o,C={root:["root",p!=="none"&&`margin${fa(p)}`,y&&"fullWidth"]};return Hc(C,SPn,s)},APn=Ia("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[`margin${fa(p.margin)}`],p.fullWidth&&s.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%"}}]}),IPn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormControl"}),{children:C,className:N,color:L="primary",component:z="div",disabled:G=!1,error:q=!1,focused:et,fullWidth:tt=!1,hiddenLabel:nt=!1,margin:st="none",required:at=!1,size:Ot="medium",variant:Dt="outlined",...St}=y,ae={...y,color:L,component:z,disabled:G,error:q,fullWidth:tt,hiddenLabel:nt,margin:st,required:at,size:Ot,variant:Dt},ie=CPn(ae),[Ne,pn]=ln.useState(()=>{let Or=!1;return C&&ln.Children.forEach(C,di=>{if(!MDt(di,["Input","Select"]))return;const Ea=MDt(di,["Select"])?di.props.input:di;Ea&&fNn(Ea.props)&&(Or=!0)}),Or}),[de,an]=ln.useState(()=>{let Or=!1;return C&&ln.Children.forEach(C,di=>{MDt(di,["Input","Select"])&&(tmt(di.props,!0)||tmt(di.props.inputProps,!0))&&(Or=!0)}),Or}),[Jn,Rn]=ln.useState(!1);G&&Jn&&Rn(!1);const jn=et!==void 0&&!G?et:Jn;let sr;ln.useRef(!1);const fr=ln.useCallback(()=>{an(!0)},[]),fi=ln.useCallback(()=>{an(!1)},[]),pi=ln.useMemo(()=>({adornedStart:Ne,setAdornedStart:pn,color:L,disabled:G,error:q,filled:de,focused:jn,fullWidth:tt,hiddenLabel:nt,size:Ot,onBlur:()=>{Rn(!1)},onFocus:()=>{Rn(!0)},onEmpty:fi,onFilled:fr,registerEffect:sr,required:at,variant:Dt}),[Ne,L,G,q,de,jn,tt,nt,sr,fi,fr,at,Ot,Dt]);return le.jsx(MFt.Provider,{value:pi,children:le.jsx(APn,{as:z,ownerState:ae,className:bo(ie.root,N),ref:p,...St,children:C})})});function OPn(o){return Vc("MuiFormControlLabel",o)}const mQ=au("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),NPn=o=>{const{classes:s,disabled:p,labelPlacement:y,error:C,required:N}=o,L={root:["root",p&&"disabled",`labelPlacement${fa(y)}`,C&&"error",N&&"required"],label:["label",p&&"disabled"],asterisk:["asterisk",C&&"error"]};return Hc(L,OPn,s)},PPn=Ia("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`& .${mQ.label}`]:s.label},s.root,s[`labelPlacement${fa(p.labelPlacement)}`]]}})(pu(({theme:o})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${mQ.disabled}`]:{cursor:"default"},[`& .${mQ.label}`]:{[`&.${mQ.disabled}`]:{color:(o.vars||o).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:s})=>s==="start"||s==="top"||s==="bottom",style:{marginLeft:16}}]}))),LPn=Ia("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(o,s)=>s.asterisk})(pu(({theme:o})=>({[`&.${mQ.error}`]:{color:(o.vars||o).palette.error.main}}))),hk=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormControlLabel"}),{checked:C,className:N,componentsProps:L={},control:z,disabled:G,disableTypography:q,inputRef:et,label:tt,labelPlacement:nt="end",name:st,onChange:at,required:Ot,slots:Dt={},slotProps:St={},value:ae,...ie}=y,Ne=N6(),pn=G??z.props.disabled??(Ne==null?void 0:Ne.disabled),de=Ot??z.props.required,an={disabled:pn,required:de};["checked","name","onChange","value","inputRef"].forEach(Or=>{typeof z.props[Or]>"u"&&typeof y[Or]<"u"&&(an[Or]=y[Or])});const Jn=xC({props:y,muiFormControl:Ne,states:["error"]}),Rn={...y,disabled:pn,labelPlacement:nt,required:de,error:Jn.error},jn=NPn(Rn),sr={slots:Dt,slotProps:{...L,...St}},[fr,fi]=wh("typography",{elementType:I3,externalForwardedProps:sr,ownerState:Rn});let pi=tt;return pi!=null&&pi.type!==I3&&!q&&(pi=le.jsx(fr,{component:"span",...fi,className:bo(jn.label,fi==null?void 0:fi.className),children:pi})),le.jsxs(PPn,{className:bo(jn.root,N),ownerState:Rn,ref:p,...ie,children:[ln.cloneElement(z,an),de?le.jsxs("div",{children:[pi,le.jsxs(LPn,{ownerState:Rn,"aria-hidden":!0,className:jn.asterisk,children:[" ","*"]})]}):pi]})});function MPn(o){return Vc("MuiFormGroup",o)}au("MuiFormGroup",["root","row","error"]);const RPn=o=>{const{classes:s,row:p,error:y}=o;return Hc({root:["root",p&&"row",y&&"error"]},MPn,s)},DPn=Ia("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.row&&s.row]}})({display:"flex",flexDirection:"column",flexWrap:"wrap",variants:[{props:{row:!0},style:{flexDirection:"row"}}]}),BPn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormGroup"}),{className:C,row:N=!1,...L}=y,z=N6(),G=xC({props:y,muiFormControl:z,states:["error"]}),q={...y,row:N,error:G.error},et=RPn(q);return le.jsx(DPn,{className:bo(et.root,C),ownerState:q,ref:p,...L})});function FPn(o){return Vc("MuiFormHelperText",o)}const cCe=au("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var uCe;const $Pn=o=>{const{classes:s,contained:p,size:y,disabled:C,error:N,filled:L,focused:z,required:G}=o,q={root:["root",C&&"disabled",N&&"error",y&&`size${fa(y)}`,p&&"contained",z&&"focused",L&&"filled",G&&"required"]};return Hc(q,FPn,s)},jPn=Ia("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.size&&s[`size${fa(p.size)}`],p.contained&&s.contained,p.filled&&s.filled]}})(pu(({theme:o})=>({color:(o.vars||o).palette.text.secondary,...o.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${cCe.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${cCe.error}`]:{color:(o.vars||o).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:s})=>s.contained,style:{marginLeft:14,marginRight:14}}]}))),HPn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormHelperText"}),{children:C,className:N,component:L="p",disabled:z,error:G,filled:q,focused:et,margin:tt,required:nt,variant:st,...at}=y,Ot=N6(),Dt=xC({props:y,muiFormControl:Ot,states:["variant","size","disabled","error","filled","focused","required"]}),St={...y,component:L,contained:Dt.variant==="filled"||Dt.variant==="outlined",variant:Dt.variant,size:Dt.size,disabled:Dt.disabled,error:Dt.error,filled:Dt.filled,focused:Dt.focused,required:Dt.required};delete St.ownerState;const ae=$Pn(St);return le.jsx(jPn,{as:L,className:bo(ae.root,N),ref:p,...at,ownerState:St,children:C===" "?uCe||(uCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):C})});function zPn(o){return Vc("MuiFormLabel",o)}const AQ=au("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),UPn=o=>{const{classes:s,color:p,focused:y,disabled:C,error:N,filled:L,required:z}=o,G={root:["root",`color${fa(p)}`,C&&"disabled",N&&"error",L&&"filled",y&&"focused",z&&"required"],asterisk:["asterisk",N&&"error"]};return Hc(G,zPn,s)},qPn=Ia("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.color==="secondary"&&s.colorSecondary,p.filled&&s.filled]}})(pu(({theme:o})=>({color:(o.vars||o).palette.text.secondary,...o.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s},style:{[`&.${AQ.focused}`]:{color:(o.vars||o).palette[s].main}}})),{props:{},style:{[`&.${AQ.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${AQ.error}`]:{color:(o.vars||o).palette.error.main}}}]}))),WPn=Ia("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(o,s)=>s.asterisk})(pu(({theme:o})=>({[`&.${AQ.error}`]:{color:(o.vars||o).palette.error.main}}))),KPn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiFormLabel"}),{children:C,className:N,color:L,component:z="label",disabled:G,error:q,filled:et,focused:tt,required:nt,...st}=y,at=N6(),Ot=xC({props:y,muiFormControl:at,states:["color","required","focused","disabled","error","filled"]}),Dt={...y,color:Ot.color||"primary",component:z,disabled:Ot.disabled,error:Ot.error,filled:Ot.filled,focused:Ot.focused,required:Ot.required},St=UPn(Dt);return le.jsxs(qPn,{as:z,ownerState:Dt,className:bo(St.root,N),ref:p,...st,children:[C,Ot.required&&le.jsxs(WPn,{ownerState:Dt,"aria-hidden":!0,className:St.asterisk,children:[" ","*"]})]})});function TBt(o){return`scale(${o}, ${o**2})`}const GPn={entering:{opacity:1,transform:TBt(1)},entered:{opacity:1,transform:"none"}},DDt=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),kBt=ln.forwardRef(function(s,p){const{addEndListener:y,appear:C=!0,children:N,easing:L,in:z,onEnter:G,onEntered:q,onEntering:et,onExit:tt,onExited:nt,onExiting:st,style:at,timeout:Ot="auto",TransitionComponent:Dt=L3,...St}=s,ae=UAe(),ie=ln.useRef(),Ne=vP(),pn=ln.useRef(null),de=Im(pn,r$(N),p),an=Or=>di=>{if(Or){const Ea=pn.current;di===void 0?Or(Ea):Or(Ea,di)}},Jn=an(et),Rn=an((Or,di)=>{LFt(Or);const{duration:Ea,delay:Qi,easing:li}=gC({style:at,timeout:Ot,easing:L},{mode:"enter"});let ze;Ot==="auto"?(ze=Ne.transitions.getAutoHeightDuration(Or.clientHeight),ie.current=ze):ze=Ea,Or.style.transition=[Ne.transitions.create("opacity",{duration:ze,delay:Qi}),Ne.transitions.create("transform",{duration:DDt?ze:ze*.666,delay:Qi,easing:li})].join(","),G&&G(Or,di)}),jn=an(q),sr=an(st),fr=an(Or=>{const{duration:di,delay:Ea,easing:Qi}=gC({style:at,timeout:Ot,easing:L},{mode:"exit"});let li;Ot==="auto"?(li=Ne.transitions.getAutoHeightDuration(Or.clientHeight),ie.current=li):li=di,Or.style.transition=[Ne.transitions.create("opacity",{duration:li,delay:Ea}),Ne.transitions.create("transform",{duration:DDt?li:li*.666,delay:DDt?Ea:Ea||li*.333,easing:Qi})].join(","),Or.style.opacity=0,Or.style.transform=TBt(.75),tt&&tt(Or)}),fi=an(nt),pi=Or=>{Ot==="auto"&&ae.start(ie.current||0,Or),y&&y(pn.current,Or)};return le.jsx(Dt,{appear:C,in:z,nodeRef:pn,onEnter:Rn,onEntered:jn,onEntering:Jn,onExit:fr,onExited:fi,onExiting:sr,addEndListener:pi,timeout:Ot==="auto"?null:Ot,...St,children:(Or,{ownerState:di,...Ea})=>ln.cloneElement(N,{style:{opacity:0,transform:TBt(.75),visibility:Or==="exited"&&!z?"hidden":void 0,...GPn[Or],...at,...N.props.style},ref:de,...Ea})})});kBt&&(kBt.muiSupportAuto=!0);const YPn=QAe({themeId:HAe}),VPn=o=>{const{classes:s,disableUnderline:p}=o,C=Hc({root:["root",!p&&"underline"],input:["input"]},gNn,s);return{...s,...C}},XPn=Ia($mt,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiInput",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[...Bmt(o,s),!p.disableUnderline&&s.underline]}})(pu(({theme:o})=>{let p=o.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return o.vars&&(p=`rgba(${o.vars.palette.common.onBackgroundChannel} / ${o.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:({ownerState:y})=>y.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:y})=>!y.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${oQ.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${oQ.error}`]:{"&::before, &::after":{borderBottomColor:(o.vars||o).palette.error.main}},"&::before":{borderBottom:`1px solid ${p}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:o.transitions.create("border-bottom-color",{duration:o.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${oQ.disabled}, .${oQ.error}):before`]:{borderBottom:`2px solid ${(o.vars||o).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${p}`}},[`&.${oQ.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(o.palette).filter(Am()).map(([y])=>({props:{color:y,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(o.vars||o).palette[y].main}`}}}))]}})),QPn=Ia(jmt,{name:"MuiInput",slot:"Input",overridesResolver:Fmt})({}),Hmt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiInput"}),{disableUnderline:C=!1,components:N={},componentsProps:L,fullWidth:z=!1,inputComponent:G="input",multiline:q=!1,slotProps:et,slots:tt={},type:nt="text",...st}=y,at=VPn(y),Dt={root:{ownerState:{disableUnderline:C}}},St=et??L?NFt(et??L,Dt):Dt,ae=tt.root??N.Root??XPn,ie=tt.input??N.Input??QPn;return le.jsx(RFt,{slots:{root:ae,input:ie},slotProps:St,fullWidth:z,inputComponent:G,multiline:q,ref:p,type:nt,...st,classes:at})});Hmt.muiName="Input";function JPn(o){return Vc("MuiInputLabel",o)}au("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const ZPn=o=>{const{classes:s,formControl:p,size:y,shrink:C,disableAnimation:N,variant:L,required:z}=o,G={root:["root",p&&"formControl",!N&&"animated",C&&"shrink",y&&y!=="normal"&&`size${fa(y)}`,L],asterisk:[z&&"asterisk"]},q=Hc(G,JPn,s);return{...s,...q}},tLn=Ia(KPn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`& .${AQ.asterisk}`]:s.asterisk},s.root,p.formControl&&s.formControl,p.size==="small"&&s.sizeSmall,p.shrink&&s.shrink,!p.disableAnimation&&s.animated,p.focused&&s.focused,s[p.variant]]}})(pu(({theme:o})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:s})=>s.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:s})=>s.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:s})=>!s.disableAnimation,style:{transition:o.transitions.create(["color","transform","max-width"],{duration:o.transitions.duration.shorter,easing:o.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:s,ownerState:p})=>s==="filled"&&p.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:s,ownerState:p,size:y})=>s==="filled"&&p.shrink&&y==="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:s,ownerState:p})=>s==="outlined"&&p.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),eLn=ln.forwardRef(function(s,p){const y=Su({name:"MuiInputLabel",props:s}),{disableAnimation:C=!1,margin:N,shrink:L,variant:z,className:G,...q}=y,et=N6();let tt=L;typeof tt>"u"&&et&&(tt=et.filled||et.focused||et.adornedStart);const nt=xC({props:y,muiFormControl:et,states:["size","variant","required","focused"]}),st={...y,disableAnimation:C,formControl:et,shrink:tt,size:nt.size,variant:nt.variant,required:nt.required,focused:nt.focused},at=ZPn(st);return le.jsx(tLn,{"data-shrink":tt,ref:p,className:bo(at.root,G),...q,ownerState:st,classes:at})});function BDt(o,s,p){return o===s?o.firstChild:s&&s.nextElementSibling?s.nextElementSibling:p?null:o.firstChild}function lCe(o,s,p){return o===s?p?o.firstChild:o.lastChild:s&&s.previousElementSibling?s.previousElementSibling:p?null:o.lastChild}function oIe(o,s){if(s===void 0)return!0;let p=o.innerText;return p===void 0&&(p=o.textContent),p=p.trim().toLowerCase(),p.length===0?!1:s.repeating?p[0]===s.keys[0]:p.startsWith(s.keys.join(""))}function cQ(o,s,p,y,C,N){let L=!1,z=C(o,s,s?p:!1);for(;z;){if(z===o.firstChild){if(L)return!1;L=!0}const G=y?!1:z.disabled||z.getAttribute("aria-disabled")==="true";if(!z.hasAttribute("tabindex")||!oIe(z,N)||G)z=C(o,z,p);else return z.focus(),!0}return!1}const nLn=ln.forwardRef(function(s,p){const{actions:y,autoFocus:C=!1,autoFocusItem:N=!1,children:L,className:z,disabledItemsFocusable:G=!1,disableListWrap:q=!1,onKeyDown:et,variant:tt="selectedMenu",...nt}=s,st=ln.useRef(null),at=ln.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});bP(()=>{C&&st.current.focus()},[C]),ln.useImperativeHandle(y,()=>({adjustStyleForScrollbar:(ie,{direction:Ne})=>{const pn=!st.current.style.width;if(ie.clientHeight<st.current.clientHeight&&pn){const de=`${YAe(r5(ie))}px`;st.current.style[Ne==="rtl"?"paddingLeft":"paddingRight"]=de,st.current.style.width=`calc(100% + ${de})`}return st.current}}),[]);const Ot=ie=>{const Ne=st.current,pn=ie.key;if(ie.ctrlKey||ie.metaKey||ie.altKey){et&&et(ie);return}const an=n5(Ne).activeElement;if(pn==="ArrowDown")ie.preventDefault(),cQ(Ne,an,q,G,BDt);else if(pn==="ArrowUp")ie.preventDefault(),cQ(Ne,an,q,G,lCe);else if(pn==="Home")ie.preventDefault(),cQ(Ne,null,q,G,BDt);else if(pn==="End")ie.preventDefault(),cQ(Ne,null,q,G,lCe);else if(pn.length===1){const Jn=at.current,Rn=pn.toLowerCase(),jn=performance.now();Jn.keys.length>0&&(jn-Jn.lastTime>500?(Jn.keys=[],Jn.repeating=!0,Jn.previousKeyMatched=!0):Jn.repeating&&Rn!==Jn.keys[0]&&(Jn.repeating=!1)),Jn.lastTime=jn,Jn.keys.push(Rn);const sr=an&&!Jn.repeating&&oIe(an,Jn);Jn.previousKeyMatched&&(sr||cQ(Ne,an,!1,G,BDt,Jn))?ie.preventDefault():Jn.previousKeyMatched=!1}et&&et(ie)},Dt=Im(st,p);let St=-1;ln.Children.forEach(L,(ie,Ne)=>{if(!ln.isValidElement(ie)){St===Ne&&(St+=1,St>=L.length&&(St=-1));return}ie.props.disabled||(tt==="selectedMenu"&&ie.props.selected||St===-1)&&(St=Ne),St===Ne&&(ie.props.disabled||ie.props.muiSkipListHighlight||ie.type.muiSkipListHighlight)&&(St+=1,St>=L.length&&(St=-1))});const ae=ln.Children.map(L,(ie,Ne)=>{if(Ne===St){const pn={};return N&&(pn.autoFocus=!0),ie.props.tabIndex===void 0&&tt==="selectedMenu"&&(pn.tabIndex=0),ln.cloneElement(ie,pn)}return ie});return le.jsx(ZIn,{role:"menu",ref:Dt,className:z,onKeyDown:Ot,tabIndex:C?0:-1,...nt,children:ae})});function rLn(o){return Vc("MuiPopover",o)}au("MuiPopover",["root","paper"]);function hCe(o,s){let p=0;return typeof s=="number"?p=s:s==="center"?p=o.height/2:s==="bottom"&&(p=o.height),p}function fCe(o,s){let p=0;return typeof s=="number"?p=s:s==="center"?p=o.width/2:s==="right"&&(p=o.width),p}function dCe(o){return[o.horizontal,o.vertical].map(s=>typeof s=="number"?`${s}px`:s).join(" ")}function Tbt(o){return typeof o=="function"?o():o}const iLn=o=>{const{classes:s}=o;return Hc({root:["root"],paper:["paper"]},rLn,s)},aLn=Ia(iIe,{name:"MuiPopover",slot:"Root",overridesResolver:(o,s)=>s.root})({}),cIe=Ia(XQ,{name:"MuiPopover",slot:"Paper",overridesResolver:(o,s)=>s.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),sLn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiPopover"}),{action:C,anchorEl:N,anchorOrigin:L={vertical:"top",horizontal:"left"},anchorPosition:z,anchorReference:G="anchorEl",children:q,className:et,container:tt,elevation:nt=8,marginThreshold:st=16,open:at,PaperProps:Ot={},slots:Dt={},slotProps:St={},transformOrigin:ae={vertical:"top",horizontal:"left"},TransitionComponent:ie,transitionDuration:Ne="auto",TransitionProps:pn={},disableScrollLock:de=!1,...an}=y,Jn=ln.useRef(),Rn={...y,anchorOrigin:L,anchorReference:G,elevation:nt,marginThreshold:st,transformOrigin:ae,TransitionComponent:ie,transitionDuration:Ne,TransitionProps:pn},jn=iLn(Rn),sr=ln.useCallback(()=>{if(G==="anchorPosition")return z;const Ds=Tbt(N),bu=(Ds&&Ds.nodeType===1?Ds:n5(Jn.current).body).getBoundingClientRect();return{top:bu.top+hCe(bu,L.vertical),left:bu.left+fCe(bu,L.horizontal)}},[N,L.horizontal,L.vertical,z,G]),fr=ln.useCallback(Ds=>({vertical:hCe(Ds,ae.vertical),horizontal:fCe(Ds,ae.horizontal)}),[ae.horizontal,ae.vertical]),fi=ln.useCallback(Ds=>{const pc={width:Ds.offsetWidth,height:Ds.offsetHeight},bu=fr(pc);if(G==="none")return{top:null,left:null,transformOrigin:dCe(bu)};const P1=sr();let il=P1.top-bu.vertical,Rh=P1.left-bu.horizontal;const Mg=il+pc.height,Rg=Rh+pc.width,Dg=r5(Tbt(N)),iy=Dg.innerHeight-st,Yp=Dg.innerWidth-st;if(st!==null&&il<st){const wd=il-st;il-=wd,bu.vertical+=wd}else if(st!==null&&Mg>iy){const wd=Mg-iy;il-=wd,bu.vertical+=wd}if(st!==null&&Rh<st){const wd=Rh-st;Rh-=wd,bu.horizontal+=wd}else if(Rg>Yp){const wd=Rg-Yp;Rh-=wd,bu.horizontal+=wd}return{top:`${Math.round(il)}px`,left:`${Math.round(Rh)}px`,transformOrigin:dCe(bu)}},[N,G,sr,fr,st]),[pi,Or]=ln.useState(at),di=ln.useCallback(()=>{const Ds=Jn.current;if(!Ds)return;const pc=fi(Ds);pc.top!==null&&Ds.style.setProperty("top",pc.top),pc.left!==null&&(Ds.style.left=pc.left),Ds.style.transformOrigin=pc.transformOrigin,Or(!0)},[fi]);ln.useEffect(()=>(de&&window.addEventListener("scroll",di),()=>window.removeEventListener("scroll",di)),[N,de,di]);const Ea=()=>{di()},Qi=()=>{Or(!1)};ln.useEffect(()=>{at&&di()}),ln.useImperativeHandle(C,()=>at?{updatePosition:()=>{di()}}:null,[at,di]),ln.useEffect(()=>{if(!at)return;const Ds=PFt(()=>{di()}),pc=r5(Tbt(N));return pc.addEventListener("resize",Ds),()=>{Ds.clear(),pc.removeEventListener("resize",Ds)}},[N,at,di]);let li=Ne;const ze={slots:{transition:ie,...Dt},slotProps:{transition:pn,paper:Ot,...St}},[Na,Ts]=wh("transition",{elementType:kBt,externalForwardedProps:ze,ownerState:Rn,getSlotProps:Ds=>({...Ds,onEntering:(pc,bu)=>{var P1;(P1=Ds.onEntering)==null||P1.call(Ds,pc,bu),Ea()},onExited:pc=>{var bu;(bu=Ds.onExited)==null||bu.call(Ds,pc),Qi()}}),additionalProps:{appear:!0,in:at}});Ne==="auto"&&!Na.muiSupportAuto&&(li=void 0);const Ke=tt||(N?n5(Tbt(N)).body:void 0),[xo,{slots:Ss,slotProps:La,...zo}]=wh("root",{ref:p,elementType:aLn,externalForwardedProps:{...ze,...an},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:Dt.backdrop},slotProps:{backdrop:ZAe(typeof St.backdrop=="function"?St.backdrop(Rn):St.backdrop,{invisible:!0})},container:Ke,open:at},ownerState:Rn,className:bo(jn.root,et)}),[$u,gu]=wh("paper",{ref:Jn,className:jn.paper,elementType:cIe,externalForwardedProps:ze,shouldForwardComponentProp:!0,additionalProps:{elevation:nt,style:pi?void 0:{opacity:0}},ownerState:Rn});return le.jsx(xo,{...zo,...!wBt(xo)&&{slots:Ss,slotProps:La,disableScrollLock:de},children:le.jsx(Na,{...Ts,timeout:li,children:le.jsx($u,{...gu,children:q})})})});function oLn(o){return Vc("MuiMenu",o)}au("MuiMenu",["root","paper","list"]);const cLn={vertical:"top",horizontal:"right"},uLn={vertical:"top",horizontal:"left"},lLn=o=>{const{classes:s}=o;return Hc({root:["root"],paper:["paper"],list:["list"]},oLn,s)},hLn=Ia(sLn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(o,s)=>s.root})({}),fLn=Ia(cIe,{name:"MuiMenu",slot:"Paper",overridesResolver:(o,s)=>s.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),dLn=Ia(nLn,{name:"MuiMenu",slot:"List",overridesResolver:(o,s)=>s.list})({outline:0}),pLn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiMenu"}),{autoFocus:C=!0,children:N,className:L,disableAutoFocusItem:z=!1,MenuListProps:G={},onClose:q,open:et,PaperProps:tt={},PopoverClasses:nt,transitionDuration:st="auto",TransitionProps:{onEntering:at,...Ot}={},variant:Dt="selectedMenu",slots:St={},slotProps:ae={},...ie}=y,Ne=JAe(),pn={...y,autoFocus:C,disableAutoFocusItem:z,MenuListProps:G,onEntering:at,PaperProps:tt,transitionDuration:st,TransitionProps:Ot,variant:Dt},de=lLn(pn),an=C&&!z&&et,Jn=ln.useRef(null),Rn=(li,ze)=>{Jn.current&&Jn.current.adjustStyleForScrollbar(li,{direction:Ne?"rtl":"ltr"}),at&&at(li,ze)},jn=li=>{li.key==="Tab"&&(li.preventDefault(),q&&q(li,"tabKeyDown"))};let sr=-1;ln.Children.map(N,(li,ze)=>{ln.isValidElement(li)&&(li.props.disabled||(Dt==="selectedMenu"&&li.props.selected||sr===-1)&&(sr=ze))});const fr={slots:St,slotProps:{list:G,transition:Ot,paper:tt,...ae}},fi=sOn({elementType:St.root,externalSlotProps:ae.root,ownerState:pn,className:[de.root,L]}),[pi,Or]=wh("paper",{className:de.paper,elementType:fLn,externalForwardedProps:fr,shouldForwardComponentProp:!0,ownerState:pn}),[di,Ea]=wh("list",{className:bo(de.list,G.className),elementType:dLn,shouldForwardComponentProp:!0,externalForwardedProps:fr,getSlotProps:li=>({...li,onKeyDown:ze=>{var Na;jn(ze),(Na=li.onKeyDown)==null||Na.call(li,ze)}}),ownerState:pn}),Qi=typeof fr.slotProps.transition=="function"?fr.slotProps.transition(pn):fr.slotProps.transition;return le.jsx(hLn,{onClose:q,anchorOrigin:{vertical:"bottom",horizontal:Ne?"right":"left"},transformOrigin:Ne?cLn:uLn,slots:{root:St.root,paper:pi,backdrop:St.backdrop,...St.transition&&{transition:St.transition}},slotProps:{root:fi,paper:Or,backdrop:typeof ae.backdrop=="function"?ae.backdrop(pn):ae.backdrop,transition:{...Qi,onEntering:(...li)=>{var ze;Rn(...li),(ze=Qi==null?void 0:Qi.onEntering)==null||ze.call(Qi,...li)}}},open:et,ref:p,transitionDuration:st,ownerState:pn,...ie,classes:nt,children:le.jsx(di,{actions:Jn,autoFocus:C&&(sr===-1||z),autoFocusItem:an,variant:Dt,...Ea,children:N})})});function gLn(o){return Vc("MuiNativeSelect",o)}const BFt=au("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),bLn=o=>{const{classes:s,variant:p,disabled:y,multiple:C,open:N,error:L}=o,z={select:["select",p,y&&"disabled",C&&"multiple",L&&"error"],icon:["icon",`icon${fa(p)}`,N&&"iconOpen",y&&"disabled"]};return Hc(z,gLn,s)},uIe=Ia("select")(({theme:o})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${BFt.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},variants:[{props:({ownerState:s})=>s.variant!=="filled"&&s.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}}]})),mLn=Ia(uIe,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:ny,overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.select,s[p.variant],p.error&&s.error,{[`&.${BFt.multiple}`]:s.multiple}]}})({}),lIe=Ia("svg")(({theme:o})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${BFt.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:({ownerState:s})=>s.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),yLn=Ia(lIe,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.icon,p.variant&&s[`icon${fa(p.variant)}`],p.open&&s.iconOpen]}})({}),wLn=ln.forwardRef(function(s,p){const{className:y,disabled:C,error:N,IconComponent:L,inputRef:z,variant:G="standard",...q}=s,et={...s,disabled:C,variant:G,error:N},tt=bLn(et);return le.jsxs(ln.Fragment,{children:[le.jsx(mLn,{ownerState:et,className:bo(tt.select,y),disabled:C,ref:z||p,...q}),s.multiple?null:le.jsx(yLn,{as:L,ownerState:et,className:tt.icon})]})});var pCe;const vLn=Ia("fieldset",{shouldForwardProp:ny})({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%"}),_Ln=Ia("legend",{shouldForwardProp:ny})(pu(({theme:o})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:s})=>!s.withLabel,style:{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})}},{props:({ownerState:s})=>s.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:s})=>s.withLabel&&s.notched,style:{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})}}]})));function xLn(o){const{children:s,classes:p,className:y,label:C,notched:N,...L}=o,z=C!=null&&C!=="",G={...o,notched:N,withLabel:z};return le.jsx(vLn,{"aria-hidden":!0,className:y,ownerState:G,...L,children:le.jsx(_Ln,{ownerState:G,children:z?le.jsx("span",{children:C}):pCe||(pCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const ELn=o=>{const{classes:s}=o,y=Hc({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},bNn,s);return{...s,...y}},TLn=Ia($mt,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Bmt})(pu(({theme:o})=>{const s=o.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(o.vars||o).shape.borderRadius,[`&:hover .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette.text.primary},"@media (hover: none)":{[`&:hover .${m6.notchedOutline}`]:{borderColor:o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.23)`:s}},[`&.${m6.focused} .${m6.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(o.palette).filter(Am()).map(([p])=>({props:{color:p},style:{[`&.${m6.focused} .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette[p].main}}})),{props:{},style:{[`&.${m6.error} .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette.error.main},[`&.${m6.disabled} .${m6.notchedOutline}`]:{borderColor:(o.vars||o).palette.action.disabled}}},{props:({ownerState:p})=>p.startAdornment,style:{paddingLeft:14}},{props:({ownerState:p})=>p.endAdornment,style:{paddingRight:14}},{props:({ownerState:p})=>p.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:p,size:y})=>p.multiline&&y==="small",style:{padding:"8.5px 14px"}}]}})),kLn=Ia(xLn,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(o,s)=>s.notchedOutline})(pu(({theme:o})=>{const s=o.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:o.vars?`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.23)`:s}})),SLn=Ia(jmt,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Fmt})(pu(({theme:o})=>({padding:"16.5px 14px",...!o.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:o.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:o.palette.mode==="light"?null:"#fff",caretColor:o.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...o.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[o.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:s})=>s.multiline,style:{padding:0}},{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:0}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:0}}]}))),FFt=ln.forwardRef(function(s,p){var y;const C=Su({props:s,name:"MuiOutlinedInput"}),{components:N={},fullWidth:L=!1,inputComponent:z="input",label:G,multiline:q=!1,notched:et,slots:tt={},type:nt="text",...st}=C,at=ELn(C),Ot=N6(),Dt=xC({props:C,muiFormControl:Ot,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),St={...C,color:Dt.color||"primary",disabled:Dt.disabled,error:Dt.error,focused:Dt.focused,formControl:Ot,fullWidth:L,hiddenLabel:Dt.hiddenLabel,multiline:q,size:Dt.size,type:nt},ae=tt.root??N.Root??TLn,ie=tt.input??N.Input??SLn;return le.jsx(RFt,{slots:{root:ae,input:ie},renderSuffix:Ne=>le.jsx(kLn,{ownerState:St,className:at.notchedOutline,label:G!=null&&G!==""&&Dt.required?y||(y=le.jsxs(ln.Fragment,{children:[G," ","*"]})):G,notched:typeof et<"u"?et:!!(Ne.startAdornment||Ne.filled||Ne.focused)}),fullWidth:L,inputComponent:z,multiline:q,ref:p,type:nt,...st,classes:{...at,notchedOutline:null}})});FFt.muiName="Input";const CLn=a5(le.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),ALn=a5(le.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),ILn=Ia("span",{shouldForwardProp:ny})({position:"relative",display:"flex"}),OLn=Ia(CLn)({transform:"scale(1)"}),NLn=Ia(ALn)(pu(({theme:o})=>({left:0,position:"absolute",transform:"scale(0)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeIn,duration:o.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:o.transitions.create("transform",{easing:o.transitions.easing.easeOut,duration:o.transitions.duration.shortest})}}]})));function hIe(o){const{checked:s=!1,classes:p={},fontSize:y}=o,C={...o,checked:s};return le.jsxs(ILn,{className:p.root,ownerState:C,children:[le.jsx(OLn,{fontSize:y,className:p.background,ownerState:C}),le.jsx(NLn,{fontSize:y,className:p.dot,ownerState:C})]})}const fIe=ln.createContext(void 0);function PLn(){return ln.useContext(fIe)}function LLn(o){return Vc("MuiRadio",o)}const gCe=au("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),MLn=o=>{const{classes:s,color:p,size:y}=o,C={root:["root",`color${fa(p)}`,y!=="medium"&&`size${fa(y)}`]};return{...s,...Hc(C,LLn,s)}},RLn=Ia(KNn,{shouldForwardProp:o=>ny(o)||o==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.size!=="medium"&&s[`size${fa(p.size)}`],s[`color${fa(p.color)}`]]}})(pu(({theme:o})=>({color:(o.vars||o).palette.text.secondary,[`&.${gCe.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.activeChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette.action.active,o.palette.action.hoverOpacity)}}},...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette[s].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:Ef(o.palette[s].main,o.palette.action.hoverOpacity)}}})),...Object.entries(o.palette).filter(Am()).map(([s])=>({props:{color:s,disabled:!1},style:{[`&.${gCe.checked}`]:{color:(o.vars||o).palette[s].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function DLn(o,s){return typeof s=="object"&&s!==null?o===s:String(o)===String(s)}const BLn=le.jsx(hIe,{checked:!0}),FLn=le.jsx(hIe,{}),fk=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiRadio"}),{checked:C,checkedIcon:N=BLn,color:L="primary",icon:z=FLn,name:G,onChange:q,size:et="medium",className:tt,disabled:nt,disableRipple:st=!1,slots:at={},slotProps:Ot={},inputProps:Dt,...St}=y,ae=N6();let ie=nt;ae&&typeof ie>"u"&&(ie=ae.disabled),ie??(ie=!1);const Ne={...y,disabled:ie,disableRipple:st,color:L,size:et},pn=MLn(Ne),de=PLn();let an=C;const Jn=vBt(q,de&&de.onChange);let Rn=G;de&&(typeof an>"u"&&(an=DLn(de.value,y.value)),typeof Rn>"u"&&(Rn=de.name));const jn=Ot.input??Dt,[sr,fr]=wh("root",{ref:p,elementType:RLn,className:bo(pn.root,tt),shouldForwardComponentProp:!0,externalForwardedProps:{slots:at,slotProps:Ot,...St},getSlotProps:fi=>({...fi,onChange:(pi,...Or)=>{var di;(di=fi.onChange)==null||di.call(fi,pi,...Or),Jn(pi,...Or)}}),ownerState:Ne,additionalProps:{type:"radio",icon:ln.cloneElement(z,{fontSize:z.props.fontSize??et}),checkedIcon:ln.cloneElement(N,{fontSize:N.props.fontSize??et}),disabled:ie,name:Rn,checked:an,slots:at,slotProps:{input:typeof jn=="function"?jn(Ne):jn}}});return le.jsx(sr,{...fr,classes:pn})});function $Ln(o){return Vc("MuiRadioGroup",o)}au("MuiRadioGroup",["root","row","error"]);const jLn=o=>{const{classes:s,row:p,error:y}=o;return Hc({root:["root",p&&"row",y&&"error"]},$Ln,s)},bCe=ln.forwardRef(function(s,p){const{actions:y,children:C,className:N,defaultValue:L,name:z,onChange:G,value:q,...et}=s,tt=ln.useRef(null),nt=jLn(s),[st,at]=jQ({controlled:q,default:L,name:"RadioGroup"});ln.useImperativeHandle(y,()=>({focus:()=>{let ae=tt.current.querySelector("input:not(:disabled):checked");ae||(ae=tt.current.querySelector("input:not(:disabled)")),ae&&ae.focus()}}),[]);const Ot=Im(p,tt),Dt=VQ(z),St=ln.useMemo(()=>({name:Dt,onChange(ae){at(ae.target.value),G&&G(ae,ae.target.value)},value:st}),[Dt,G,at,st]);return le.jsx(fIe.Provider,{value:St,children:le.jsx(BPn,{role:"radiogroup",ref:Ot,className:bo(nt.root,N),...et,children:C})})});function dIe(o){return Vc("MuiSelect",o)}const uQ=au("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var mCe;const HLn=Ia(uIe,{name:"MuiSelect",slot:"Select",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[{[`&.${uQ.select}`]:s.select},{[`&.${uQ.select}`]:s[p.variant]},{[`&.${uQ.error}`]:s.error},{[`&.${uQ.multiple}`]:s.multiple}]}})({[`&.${uQ.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),zLn=Ia(lIe,{name:"MuiSelect",slot:"Icon",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.icon,p.variant&&s[`icon${fa(p.variant)}`],p.open&&s.iconOpen]}})({}),ULn=Ia("input",{shouldForwardProp:o=>tOn(o)&&o!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(o,s)=>s.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function yCe(o,s){return typeof s=="object"&&s!==null?o===s:String(o)===String(s)}function qLn(o){return o==null||typeof o=="string"&&!o.trim()}const WLn=o=>{const{classes:s,variant:p,disabled:y,multiple:C,open:N,error:L}=o,z={select:["select",p,y&&"disabled",C&&"multiple",L&&"error"],icon:["icon",`icon${fa(p)}`,N&&"iconOpen",y&&"disabled"],nativeInput:["nativeInput"]};return Hc(z,dIe,s)},KLn=ln.forwardRef(function(s,p){var o5;const{"aria-describedby":y,"aria-label":C,autoFocus:N,autoWidth:L,children:z,className:G,defaultOpen:q,defaultValue:et,disabled:tt,displayEmpty:nt,error:st=!1,IconComponent:at,inputRef:Ot,labelId:Dt,MenuProps:St={},multiple:ae,name:ie,onBlur:Ne,onChange:pn,onClose:de,onFocus:an,onOpen:Jn,open:Rn,readOnly:jn,renderValue:sr,required:fr,SelectDisplayProps:fi={},tabIndex:pi,type:Or,value:di,variant:Ea="standard",...Qi}=s,[li,ze]=jQ({controlled:di,default:et,name:"Select"}),[Na,Ts]=jQ({controlled:Rn,default:q,name:"Select"}),Ke=ln.useRef(null),xo=ln.useRef(null),[Ss,La]=ln.useState(null),{current:zo}=ln.useRef(Rn!=null),[$u,gu]=ln.useState(),Ds=Im(p,Ot),pc=ln.useCallback(Ns=>{xo.current=Ns,Ns&&La(Ns)},[]),bu=Ss==null?void 0:Ss.parentNode;ln.useImperativeHandle(Ds,()=>({focus:()=>{xo.current.focus()},node:Ke.current,value:li}),[li]),ln.useEffect(()=>{q&&Na&&Ss&&!zo&&(gu(L?null:bu.clientWidth),xo.current.focus())},[Ss,L]),ln.useEffect(()=>{N&&xo.current.focus()},[N]),ln.useEffect(()=>{if(!Dt)return;const Ns=n5(xo.current).getElementById(Dt);if(Ns){const zc=()=>{getSelection().isCollapsed&&xo.current.focus()};return Ns.addEventListener("click",zc),()=>{Ns.removeEventListener("click",zc)}}},[Dt]);const P1=(Ns,zc)=>{Ns?Jn&&Jn(zc):de&&de(zc),zo||(gu(L?null:bu.clientWidth),Ts(Ns))},il=Ns=>{Ns.button===0&&(Ns.preventDefault(),xo.current.focus(),P1(!0,Ns))},Rh=Ns=>{P1(!1,Ns)},Mg=ln.Children.toArray(z),Rg=Ns=>{const zc=Mg.find(Dh=>Dh.props.value===Ns.target.value);zc!==void 0&&(ze(zc.props.value),pn&&pn(Ns,zc))},Dg=Ns=>zc=>{let Dh;if(zc.currentTarget.hasAttribute("tabindex")){if(ae){Dh=Array.isArray(li)?li.slice():[];const ap=li.indexOf(Ns.props.value);ap===-1?Dh.push(Ns.props.value):Dh.splice(ap,1)}else Dh=Ns.props.value;if(Ns.props.onClick&&Ns.props.onClick(zc),li!==Dh&&(ze(Dh),pn)){const ap=zc.nativeEvent||zc,uJ=new ap.constructor(ap.type,ap);Object.defineProperty(uJ,"target",{writable:!0,value:{value:Dh,name:ie}}),pn(uJ,Ns)}ae||P1(!1,zc)}},iy=Ns=>{jn||[" ","ArrowUp","ArrowDown","Enter"].includes(Ns.key)&&(Ns.preventDefault(),P1(!0,Ns))},Yp=Ss!==null&&Na,wd=Ns=>{!Yp&&Ne&&(Object.defineProperty(Ns,"target",{writable:!0,value:{value:li,name:ie}}),Ne(Ns))};delete Qi["aria-invalid"];let Vp,Ow;const Jd=[];let R3=!1;(tmt({value:li})||nt)&&(sr?Vp=sr(li):R3=!0);const Hr=Mg.map(Ns=>{if(!ln.isValidElement(Ns))return null;let zc;if(ae){if(!Array.isArray(li))throw new Error(KAe(2));zc=li.some(Dh=>yCe(Dh,Ns.props.value)),zc&&R3&&Jd.push(Ns.props.children)}else zc=yCe(li,Ns.props.value),zc&&R3&&(Ow=Ns.props.children);return ln.cloneElement(Ns,{"aria-selected":zc?"true":"false",onClick:Dg(Ns),onKeyUp:Dh=>{Dh.key===" "&&Dh.preventDefault(),Ns.props.onKeyUp&&Ns.props.onKeyUp(Dh)},role:"option",selected:zc,value:void 0,"data-value":Ns.props.value})});R3&&(ae?Jd.length===0?Vp=null:Vp=Jd.reduce((Ns,zc,Dh)=>(Ns.push(zc),Dh<Jd.length-1&&Ns.push(", "),Ns),[]):Vp=Ow);let da=$u;!L&&zo&&Ss&&(da=bu.clientWidth);let Ws;typeof pi<"u"?Ws=pi:Ws=tt?null:0;const gc=fi.id||(ie?`mui-component-select-${ie}`:void 0),Cu={...s,variant:Ea,value:li,open:Yp,error:st},su=WLn(Cu),Bg={...St.PaperProps,...(o5=St.slotProps)==null?void 0:o5.paper},d0=VQ();return le.jsxs(ln.Fragment,{children:[le.jsx(HLn,{as:"div",ref:pc,tabIndex:Ws,role:"combobox","aria-controls":Yp?d0:void 0,"aria-disabled":tt?"true":void 0,"aria-expanded":Yp?"true":"false","aria-haspopup":"listbox","aria-label":C,"aria-labelledby":[Dt,gc].filter(Boolean).join(" ")||void 0,"aria-describedby":y,"aria-required":fr?"true":void 0,"aria-invalid":st?"true":void 0,onKeyDown:iy,onMouseDown:tt||jn?null:il,onBlur:wd,onFocus:an,...fi,ownerState:Cu,className:bo(fi.className,su.select,G),id:gc,children:qLn(Vp)?mCe||(mCe=le.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):Vp}),le.jsx(ULn,{"aria-invalid":st,value:Array.isArray(li)?li.join(","):li,name:ie,ref:Ke,"aria-hidden":!0,onChange:Rg,tabIndex:-1,disabled:tt,className:su.nativeInput,autoFocus:N,required:fr,...Qi,ownerState:Cu}),le.jsx(zLn,{as:at,className:su.icon,ownerState:Cu}),le.jsx(pLn,{id:`menu-${ie||""}`,anchorEl:bu,open:Yp,onClose:Rh,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...St,slotProps:{...St.slotProps,list:{"aria-labelledby":Dt,role:"listbox","aria-multiselectable":ae?"true":void 0,disableListWrap:!0,id:d0,...St.MenuListProps},paper:{...Bg,style:{minWidth:da,...Bg!=null?Bg.style:null}}},children:Hr})]})}),GLn=o=>{const{classes:s}=o,y=Hc({root:["root"]},dIe,s);return{...s,...y}},$Ft={name:"MuiSelect",overridesResolver:(o,s)=>s.root,shouldForwardProp:o=>ny(o)&&o!=="variant",slot:"Root"},YLn=Ia(Hmt,$Ft)(""),VLn=Ia(FFt,$Ft)(""),XLn=Ia(DFt,$Ft)(""),pIe=ln.forwardRef(function(s,p){const y=Su({name:"MuiSelect",props:s}),{autoWidth:C=!1,children:N,classes:L={},className:z,defaultOpen:G=!1,displayEmpty:q=!1,IconComponent:et=yNn,id:tt,input:nt,inputProps:st,label:at,labelId:Ot,MenuProps:Dt,multiple:St=!1,native:ae=!1,onClose:ie,onOpen:Ne,open:pn,renderValue:de,SelectDisplayProps:an,variant:Jn="outlined",...Rn}=y,jn=ae?wLn:KLn,sr=N6(),fr=xC({props:y,muiFormControl:sr,states:["variant","error"]}),fi=fr.variant||Jn,pi={...y,variant:fi,classes:L},Or=GLn(pi),{root:di,...Ea}=Or,Qi=nt||{standard:le.jsx(YLn,{ownerState:pi}),outlined:le.jsx(VLn,{label:at,ownerState:pi}),filled:le.jsx(XLn,{ownerState:pi})}[fi],li=Im(p,r$(Qi));return le.jsx(ln.Fragment,{children:ln.cloneElement(Qi,{inputComponent:jn,inputProps:{children:N,error:fr.error,IconComponent:et,variant:fi,type:void 0,multiple:St,...ae?{id:tt}:{autoWidth:C,defaultOpen:G,displayEmpty:q,labelId:Ot,MenuProps:Dt,onClose:ie,onOpen:Ne,open:pn,renderValue:de,SelectDisplayProps:{id:tt,...an}},...st,classes:st?NFt(Ea,st.classes):Ea,...nt?nt.props.inputProps:{}},...(St&&ae||q)&&fi==="outlined"?{notched:!0}:{},ref:li,className:bo(Qi.props.className,z,Or.root),...!nt&&{variant:fi},...Rn})})});pIe.muiName="Select";const gIe=ln.createContext();function QLn(o){return Vc("MuiTable",o)}au("MuiTable",["root","stickyHeader"]);const JLn=o=>{const{classes:s,stickyHeader:p}=o;return Hc({root:["root",p&&"stickyHeader"]},QLn,s)},ZLn=Ia("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.stickyHeader&&s.stickyHeader]}})(pu(({theme:o})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...o.typography.body2,padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:s})=>s.stickyHeader,style:{borderCollapse:"separate"}}]}))),wCe="table",tMn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTable"}),{className:C,component:N=wCe,padding:L="normal",size:z="medium",stickyHeader:G=!1,...q}=y,et={...y,component:N,padding:L,size:z,stickyHeader:G},tt=JLn(et),nt=ln.useMemo(()=>({padding:L,size:z,stickyHeader:G}),[L,z,G]);return le.jsx(gIe.Provider,{value:nt,children:le.jsx(ZLn,{as:N,role:N===wCe?null:"table",ref:p,className:bo(tt.root,C),ownerState:et,...q})})}),zmt=ln.createContext();function eMn(o){return Vc("MuiTableBody",o)}au("MuiTableBody",["root"]);const nMn=o=>{const{classes:s}=o;return Hc({root:["root"]},eMn,s)},rMn=Ia("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-row-group"}),iMn={variant:"body"},vCe="tbody",aMn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableBody"}),{className:C,component:N=vCe,...L}=y,z={...y,component:N},G=nMn(z);return le.jsx(zmt.Provider,{value:iMn,children:le.jsx(rMn,{className:bo(G.root,C),as:N,ref:p,role:N===vCe?null:"rowgroup",ownerState:z,...L})})});function sMn(o){return Vc("MuiTableCell",o)}const oMn=au("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),cMn=o=>{const{classes:s,variant:p,align:y,padding:C,size:N,stickyHeader:L}=o,z={root:["root",p,L&&"stickyHeader",y!=="inherit"&&`align${fa(y)}`,C!=="normal"&&`padding${fa(C)}`,`size${fa(N)}`]};return Hc(z,sMn,s)},uMn=Ia("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,s[p.variant],s[`size${fa(p.size)}`],p.padding!=="normal"&&s[`padding${fa(p.padding)}`],p.align!=="inherit"&&s[`align${fa(p.align)}`],p.stickyHeader&&s.stickyHeader]}})(pu(({theme:o})=>({...o.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:o.vars?`1px solid ${o.vars.palette.TableCell.border}`:`1px solid
30
- ${o.palette.mode==="light"?eOn(Ef(o.palette.divider,1),.88):nOn(Ef(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${oMn.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:s})=>s.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),S3=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableCell"}),{align:C="inherit",className:N,component:L,padding:z,scope:G,size:q,sortDirection:et,variant:tt,...nt}=y,st=ln.useContext(gIe),at=ln.useContext(zmt),Ot=at&&at.variant==="head";let Dt;L?Dt=L:Dt=Ot?"th":"td";let St=G;Dt==="td"?St=void 0:!St&&Ot&&(St="col");const ae=tt||at&&at.variant,ie={...y,align:C,component:Dt,padding:z||(st&&st.padding?st.padding:"normal"),size:q||(st&&st.size?st.size:"medium"),sortDirection:et,stickyHeader:ae==="head"&&st&&st.stickyHeader,variant:ae},Ne=cMn(ie);let pn=null;return et&&(pn=et==="asc"?"ascending":"descending"),le.jsx(uMn,{as:Dt,ref:p,className:bo(Ne.root,N),"aria-sort":pn,scope:St,ownerState:ie,...nt})});function lMn(o){return Vc("MuiTableHead",o)}au("MuiTableHead",["root"]);const hMn=o=>{const{classes:s}=o;return Hc({root:["root"]},lMn,s)},fMn=Ia("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-header-group"}),dMn={variant:"head"},_Ce="thead",pMn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableHead"}),{className:C,component:N=_Ce,...L}=y,z={...y,component:N},G=hMn(z);return le.jsx(zmt.Provider,{value:dMn,children:le.jsx(fMn,{as:N,className:bo(G.root,C),ref:p,role:N===_Ce?null:"rowgroup",ownerState:z,...L})})});function gMn(o){return Vc("MuiToolbar",o)}au("MuiToolbar",["root","gutters","regular","dense"]);const bMn=o=>{const{classes:s,disableGutters:p,variant:y}=o;return Hc({root:["root",!p&&"gutters",y]},gMn,s)},mMn=Ia("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.disableGutters&&s.gutters,s[p.variant]]}})(pu(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:s})=>!s.disableGutters,style:{paddingLeft:o.spacing(2),paddingRight:o.spacing(2),[o.breakpoints.up("sm")]:{paddingLeft:o.spacing(3),paddingRight:o.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:o.mixins.toolbar}]}))),xCe=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiToolbar"}),{className:C,component:N="div",disableGutters:L=!1,variant:z="regular",...G}=y,q={...y,component:N,disableGutters:L,variant:z},et=bMn(q);return le.jsx(mMn,{as:N,className:bo(et.root,C),ref:p,ownerState:q,...G})});function yMn(o){return Vc("MuiTableRow",o)}const ECe=au("MuiTableRow",["root","selected","hover","head","footer"]),wMn=o=>{const{classes:s,selected:p,hover:y,head:C,footer:N}=o;return Hc({root:["root",p&&"selected",y&&"hover",C&&"head",N&&"footer"]},yMn,s)},vMn=Ia("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.head&&s.head,p.footer&&s.footer]}})(pu(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${ECe.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${ECe.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}}))),TCe="tr",kbt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableRow"}),{className:C,component:N=TCe,hover:L=!1,selected:z=!1,...G}=y,q=ln.useContext(zmt),et={...y,component:N,hover:L,selected:z,head:q&&q.variant==="head",footer:q&&q.variant==="footer"},tt=wMn(et);return le.jsx(vMn,{as:N,ref:p,className:bo(tt.root,C),role:N===TCe?null:"row",ownerState:et,...G})});function _Mn(o){return Vc("MuiTextField",o)}au("MuiTextField",["root"]);const xMn={standard:Hmt,filled:DFt,outlined:FFt},EMn=o=>{const{classes:s}=o;return Hc({root:["root"]},_Mn,s)},TMn=Ia(IPn,{name:"MuiTextField",slot:"Root",overridesResolver:(o,s)=>s.root})({}),FDt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTextField"}),{autoComplete:C,autoFocus:N=!1,children:L,className:z,color:G="primary",defaultValue:q,disabled:et=!1,error:tt=!1,FormHelperTextProps:nt,fullWidth:st=!1,helperText:at,id:Ot,InputLabelProps:Dt,inputProps:St,InputProps:ae,inputRef:ie,label:Ne,maxRows:pn,minRows:de,multiline:an=!1,name:Jn,onBlur:Rn,onChange:jn,onFocus:sr,placeholder:fr,required:fi=!1,rows:pi,select:Or=!1,SelectProps:di,slots:Ea={},slotProps:Qi={},type:li,value:ze,variant:Na="outlined",...Ts}=y,Ke={...y,autoFocus:N,color:G,disabled:et,error:tt,fullWidth:st,multiline:an,required:fi,select:Or,variant:Na},xo=EMn(Ke),Ss=VQ(Ot),La=at&&Ss?`${Ss}-helper-text`:void 0,zo=Ne&&Ss?`${Ss}-label`:void 0,$u=xMn[Na],gu={slots:Ea,slotProps:{input:ae,inputLabel:Dt,htmlInput:St,formHelperText:nt,select:di,...Qi}},Ds={},pc=gu.slotProps.inputLabel;Na==="outlined"&&(pc&&typeof pc.shrink<"u"&&(Ds.notched=pc.shrink),Ds.label=Ne),Or&&((!di||!di.native)&&(Ds.id=void 0),Ds["aria-describedby"]=void 0);const[bu,P1]=wh("root",{elementType:TMn,shouldForwardComponentProp:!0,externalForwardedProps:{...gu,...Ts},ownerState:Ke,className:bo(xo.root,z),ref:p,additionalProps:{disabled:et,error:tt,fullWidth:st,required:fi,color:G,variant:Na}}),[il,Rh]=wh("input",{elementType:$u,externalForwardedProps:gu,additionalProps:Ds,ownerState:Ke}),[Mg,Rg]=wh("inputLabel",{elementType:eLn,externalForwardedProps:gu,ownerState:Ke}),[Dg,iy]=wh("htmlInput",{elementType:"input",externalForwardedProps:gu,ownerState:Ke}),[Yp,wd]=wh("formHelperText",{elementType:HPn,externalForwardedProps:gu,ownerState:Ke}),[Vp,Ow]=wh("select",{elementType:pIe,externalForwardedProps:gu,ownerState:Ke}),Jd=le.jsx(il,{"aria-describedby":La,autoComplete:C,autoFocus:N,defaultValue:q,fullWidth:st,multiline:an,name:Jn,rows:pi,maxRows:pn,minRows:de,type:li,value:ze,id:Ss,inputRef:ie,onBlur:Rn,onChange:jn,onFocus:sr,placeholder:fr,inputProps:iy,slots:{input:Ea.htmlInput?Dg:void 0},...Rh});return le.jsxs(bu,{...P1,children:[Ne!=null&&Ne!==""&&le.jsx(Mg,{htmlFor:Ss,id:zo,...Rg,children:Ne}),Or?le.jsx(Vp,{"aria-describedby":La,id:Ss,labelId:zo,value:ze,input:Jd,...Ow,children:L}):Jd,at&&le.jsx(Yp,{id:La,...wd,children:at})]})});class bIe{constructor(s,p){this.it_=s,this.last_=p}next(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};{const s=this.it_;return this.it_=this.it_.next(),{done:!1,value:s.value}}}[Symbol.iterator](){return this}}class Umt{empty(){return this.size()===0}rbegin(){return this.end().reverse()}rend(){return this.begin().reverse()}[Symbol.iterator](){return new bIe(this.begin(),this.end())}toJSON(){const s=[];for(const p of this)s.push(p);return s}}class J2{constructor(s,p){this.data_=s,this.index_=p}index(){return this.index_}get value(){return this.data_[this.index_]}prev(){return--this.index_,this}next(){return++this.index_,this}advance(s){return this.index_+=s,this}equals(s){return this.data_===s.data_&&this.index_===s.index_}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.index_,s.index_]=[s.index_,this.index_]}}class mIe extends Umt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(p,y),this.size()}insert(...s){return s.length===1?this._Insert_by_key(s[0]):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this._Insert_by_hint(s[0],s[1])}erase(...s){return s.length===1&&!(s[0]instanceof this.end().constructor&&s[0].source()===this)?this._Erase_by_val(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class yIe extends Error{constructor(s){super(s);const p=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,p):this.__proto__=p}get name(){return this.constructor.name}what(){return this.message}toJSON(){return{name:this.name,message:this.message,stack:this.stack}}}class wIe extends yIe{constructor(s){super(s)}}class zQ extends wIe{constructor(s){super(s)}}class oC extends wIe{constructor(s){super(s)}}var yd;(function(o){function s(et){if(typeof et=="string")return et;let tt=et.constructor.name;return et.constructor.__MODULE&&(tt=`${et.constructor.__MODULE}.${tt}`),`std.${tt}`}o.get_class_name=s;function p(et,tt){return new oC(`Error on ${s(et)}.${tt}(): it's empty container.`)}o.empty=p;function y(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric index is negative -> (index = ${nt}).`)}o.negative_index=y;function C(et,tt,nt,st){return new oC(`Error on ${s(et)}.${tt}(): parametric index is equal or greater than size -> (index = ${nt}, size: ${st}).`)}o.excessive_index=C;function N(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator is not this container's own.`)}o.not_my_iterator=N;function L(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator, it already has been erased.`)}o.erased_iterator=L;function z(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric iterator is directing negative position -> (index = ${nt}).`)}o.negative_iterator=z;function G(et,tt="end"){const nt=s(et);return new oC(`Error on ${nt}.Iterator.value: cannot access to the ${nt}.${tt}().value.`)}o.iterator_end_value=G;function q(et,tt,nt){throw new oC(`Error on ${s(et)}.${tt}(): unable to find the matched key -> ${nt}`)}o.key_nout_found=q})(yd||(yd={}));class vIe extends mIe{count(s){return this.find(s).equals(this.end())?0:1}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(;!s.equals(p);s=s.next())this._Insert_by_key(s.value)}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_val(s)}_Extract_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);return this._Erase_by_range(p),s}_Extract_by_iterator(s){return s.equals(this.end())===!0||this.has(s.value)===!1?this.end():(this._Erase_by_range(s),s)}_Erase_by_val(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.value)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class _Ie extends mIe{insert(...s){return super.insert(...s)}_Erase_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.value);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}class xIe extends Umt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){const p=new J2(s,0),y=new J2(s,s.length);return this.insert(p,y),this.size()}insert(...s){return s.length===1?this.emplace(s[0].first,s[0].second):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this.emplace_hint(s[0],s[1].first,s[1].second)}erase(...s){return s.length===1&&(!(s[0]instanceof this.end().constructor)||s[0].source()!==this)?this._Erase_by_key(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class EIe extends xIe{count(s){return this.find(s).equals(this.end())?0:1}get(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"get",s);return p.second}take(s,p){const y=this.find(s);return y.equals(this.end())?this.emplace(s,p()).first.second:y.second}set(s,p){this.insert_or_assign(s,p)}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}insert_or_assign(...s){if(s.length===2)return this._Insert_or_assign_with_key_value(s[0],s[1]);if(s.length===3)return this._Insert_or_assign_with_hint(s[0],s[1],s[2])}_Insert_or_assign_with_key_value(s,p){const y=this.emplace(s,p);return y.second===!1&&(y.first.second=p),y}_Insert_or_assign_with_hint(s,p,y){const C=this.emplace_hint(s,p,y);return C.second!==y&&(C.second=y),C}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_key(s)}_Extract_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);const y=p.value;return this._Erase_by_range(p),y}_Extract_by_iterator(s){return s.equals(this.end())===!0?this.end():(this._Erase_by_range(s),s)}_Erase_by_key(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.first)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class TIe extends xIe{insert(...s){return super.insert(...s)}_Erase_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.first);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}var nmt;(function(o){function s(p,...y){let C,N;return y.length>=1&&y[0]instanceof Array?(C=()=>{const L=y[0];p.push(...L)},N=y.slice(1)):y.length>=2&&y[0].next instanceof Function&&y[1].next instanceof Function?(C=()=>{const L=y[0],z=y[1];p.assign(L,z)},N=y.slice(2)):(C=null,N=y),{ramda:C,tail:N}}o.construct=s})(nmt||(nmt={}));function kIe(){return $Dt===null&&($Dt=typeof global=="object"&&kMn(global)),$Dt}function kMn(o){return o!==null&&typeof o.process=="object"&&o.process!==null&&typeof o.process.versions=="object"&&o.process.versions!==null&&typeof o.process.versions.node<"u"}let $Dt=null;function SMn(){return lQ===null&&(lQ=kIe()?global:self,lQ.__s_iUID===void 0&&(lQ.__s_iUID=0)),lQ}let lQ=null;function bk(o){if(o instanceof Object){if(o.hasOwnProperty("__get_m_iUID")===!1){const s=++SMn().__s_iUID;Object.defineProperty(o,"__get_m_iUID",{value:function(){return s}})}return o.__get_m_iUID()}else return o===void 0?-1:0}function Z_(o,s){return o=o&&o.valueOf(),s=s&&s.valueOf(),o instanceof Object&&o.equals instanceof Function?o.equals(s):o===s}function CMn(o,s){return!Z_(o,s)}function i5(o,s){return o=o.valueOf(),s=s.valueOf(),o instanceof Object?o.less instanceof Function?o.less(s):bk(o)<bk(s):o<s}var ey;(function(o){function s(y,C,N,...L){let z=null,G=i5;if(L.length===1&&L[0]instanceof C){const q=L[0];G=q.key_comp(),z=()=>{const et=q.begin(),tt=q.end();y.assign(et,tt)}}else{const q=nmt.construct(y,...L);z=q.ramda,q.tail.length>=1&&(G=q.tail[0])}N(G),z!==null&&z()}o.construct=s;function p(y,C,N){const L=C.prev();let z=L.equals(y.end())||y.value_comp()(L.value,N);return z=z&&(C.equals(y.end())||y.value_comp()(N,C.value)),z}o.emplacable=p})(ey||(ey={}));function jFt(...o){let s=IMn;for(let p of o){p=p&&p.valueOf();const y=typeof p;if(y==="boolean")s=AMn(p,s);else if(y==="number"||y==="bigint")s=kCe(p,s);else if(y==="string")s=SIe(p,s);else if(p instanceof Object&&p.hashCode instanceof Function){const C=p.hashCode();if(o.length===1)return C;s=s^C,s*=HFt}else s=kCe(bk(p),s)}return Math.abs(s)}function AMn(o,s){return s^=o?1:0,s*=HFt,s}function kCe(o,s){return SIe(o.toString(),s)}function SIe(o,s){for(let p=0;p<o.length;++p)s^=o.charCodeAt(p),s*=HFt;return Math.abs(s)}const IMn=2166136261,HFt=16777619;class rp{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)&&Z_(this.second,s.second)}less(s){return Z_(this.first,s.first)===!1?i5(this.first,s.first):i5(this.second,s.second)}hashCode(){return jFt(this.first,this.second)}}class CIe extends vIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.value)?p.next():p)}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(p.value,s)?new rp(p,!1):(p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p).first}}class OMn extends yIe{constructor(s){super(s)}}let NMn=class extends OMn{constructor(s){super(s)}};class VF{constructor(s,p){this.index_=s,this.value_=p}index(){return this.index_}get value(){return this.value_}next(){return++this.index_,this}equals(s){return this.index_===s.index_}}class zFt extends Umt{begin(){return this.nth(0)}end(){return this.nth(this.size())}at(s){return this._At(s)}set(s,p){if(s<0)throw yd.negative_index(this.source(),"at",s);if(s>=this.size())throw yd.excessive_index(this.source(),"at",s,this.size());this._Set(s,p)}front(s){if(arguments.length===0)return this.at(0);this.set(0,s)}back(s){const p=this.size()-1;if(arguments.length===0)return this.at(p);this.set(p,s)}insert(s,...p){if(s._Get_array()!==this)throw yd.not_my_iterator(this.source(),"insert");if(s.index()<0)throw yd.negative_iterator(this.source(),"insert",s.index());return s.index()>this.size()&&(s=this.end()),p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}pop_back(){if(this.empty()===!0)throw yd.empty(this.source(),"pop_back");this._Pop_back()}erase(s,p=s.next()){if(s._Get_array()!==this||p._Get_array()!==this)throw yd.not_my_iterator(this.source(),"erase");if(s.index()<0)throw yd.negative_iterator(this.source(),"erase",s.index());if(s.index()>p.index())throw new NMn(`Error on ${yd.get_class_name(this.source())}.erase(): first iterator has greater index than last -> (first = ${s.index()}, last = ${p.index()}).`);return s.index()>=this.size()?this.end():this._Erase_by_range(s,p)}}class UFt extends zFt{constructor(){super()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_.splice(0,this.data_.length)}resize(s){this.data_.length=s}size(){return this.data_.length}_At(s){return this.data_[s]}_Set(s,p){this.data_[s]=p}data(){return this.data_}[Symbol.iterator](){return this.data_[Symbol.iterator]()}push(...s){return this.data_.push(...s)}push_back(s){this.data_.push(s)}_Insert_by_range(s,p,y){if(s.index()>=this.size()){const C=this.size();for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.nth(C)}else{const C=this.data_.splice(s.index());for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.data_.push(...C),s}}_Pop_back(){this.data_.pop()}_Erase_by_range(s,p){return s.index()>=this.size()?s:p.index()>=this.size()?(this.data_.splice(s.index()),this.end()):(this.data_.splice(s.index(),p.index()-s.index()),s)}equals(s){return this.data_===s.data_}swap(s){[this.data_,s.data_]=[s.data_,this.data_]}toJSON(){return this.data_}}class qFt{constructor(s,p){this.array_=s,this.index_=p}_Get_array(){return this.array_}index(){return this.index_}get value(){return this.array_.at(this.index_)}set value(s){this.array_.set(this.index_,s)}prev(){return this.advance(-1)}next(){return this.advance(1)}advance(s){return this.array_.nth(this.index_+s)}equals(s){return Z_(this.array_,s.array_)&&this.index_===s.index_}}let qmt=class{constructor(s){this.base_=s.prev()}source(){return this.base_.source()}base(){return this.base_.next()}get value(){return this.base_.value}prev(){return this._Create_neighbor(this.base().next())}next(){return this._Create_neighbor(this.base_)}equals(s){return this.base_.equals(s.base_)}};class WFt extends qmt{advance(s){return this._Create_neighbor(this.base().advance(-s))}index(){return this.base_.index()}get value(){return this.base_.value}set value(s){this.base_.value=s}}class N3 extends UFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new N3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends qFt{source(){return this._Get_array().source()}reverse(){return new p(this)}}o.Iterator=s;class p extends WFt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(N3||(N3={}));function Wmt(o,s){if(o.index instanceof Function)return PMn(o,s);let p=0;for(;!o.equals(s);o=o.next())++p;return p}function PMn(o,s){const p=o.index(),y=s.index();return o.base instanceof Function?p-y:y-p}function Kmt(o,s){if(s===0)return o;if(o.advance instanceof Function)return o.advance(s);let p;if(s<0){if(!(o.prev instanceof Function))throw new zQ("Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.");p=y=>y.prev(),s=-s}else p=y=>y.next();for(;s-- >0;)o=p(o);return o}function Gmt(o,s,p,y=i5){let C=Wmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Kmt(o,N);y(L.value,p)?(o=L.next(),C-=N+1):C=N}return o}function Ymt(o,s,p,y=i5){let C=Wmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Kmt(o,N);y(p,L.value)?C=N:(o=L.next(),C-=N+1)}return o}class rmt extends CIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,rmt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(rmt||(rmt={}));class AIe extends _Ie{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.value,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.upper_bound(s);return p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this._Insert_by_key(y.value)}}class imt extends AIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,imt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(imt||(imt={}));class mk{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)}less(s){return i5(this.first,s.first)}hashCode(){return jFt(this.first)}}class IIe extends EIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.first)?p.next():p)}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.lower_bound(s);return!y.equals(this.end())&&this._Key_eq(y.first,s)?new rp(y,!1):(y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y).first}}class P3 extends UFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new P3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends qFt{source(){return this._Get_array().source()}reverse(){return new p(this)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends WFt{_Create_neighbor(C){return new p(C)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.ReverseIterator=p})(P3||(P3={}));class amt extends IIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,amt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(amt||(amt={}));class OIe extends TIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.first,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.upper_bound(s);return y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}}class smt extends OIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,smt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(smt||(smt={}));class i$ extends WFt{_Create_neighbor(s){return new i$(s)}}class KFt extends qFt{reverse(){return new i$(this)}source(){return this._Get_array()}}class uC extends UFt{constructor(...s){if(super(),s.length===0)this.data_=[];else if(s[0]instanceof Array){const p=s[0];this.data_=s[1]===!0?p:p.slice()}else if(s.length===1&&s[0]instanceof uC){const p=s[0];this.data_=p.data_.slice()}else s.length===2&&(this.data_=[],this.assign(s[0],s[1]))}static wrap(s){return new uC(s,!0)}nth(s){return new uC.Iterator(this,s)}source(){return this}}(function(o){o.Iterator=KFt,o.ReverseIterator=i$})(uC||(uC={}));function SBt(o,s,p=i5){const y=s.index()-o.index();if(y<=0)return;const C=o.advance(Math.floor(y/2)),N=C.value;C.index()!==o.index()&&jDt(o,C);let L=1;for(let z=1;z<y;++z){const G=o.advance(z);p(G.value,N)&&(jDt(G,o.advance(L)),++L)}jDt(o,o.advance(L-1)),SBt(o,o.advance(L-1),p),SBt(o.advance(L),s,p)}function jDt(o,s){[o.value,s.value]=[s.value,o.value]}class qp extends zFt{constructor(...s){if(super(),s.length===0&&this.clear(),s.length===1&&s[0]instanceof Array){const p=s[0],y=new J2(p,0),C=new J2(p,p.length);this.assign(y,C)}else if(s.length===1&&s[0]instanceof qp){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.matrix_=[[]],this.size_=0,this.capacity_=qp.MIN_CAPACITY}resize(s){s=qp._Emend(s,"resize");const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(this.end().advance(-p),this.end())}reserve(s){this._Reserve(qp._Emend(s,"reserve"))}_Reserve(s){const p=[[]],y=this._Compute_col_size(s);for(let C=0;C<this.matrix_.length;++C){const N=this.matrix_[C];for(let L=0;L<N.length;++L){let z=p[p.length-1];p.length<qp.ROW_SIZE&&z.length===y&&(z=[],p.push(z)),z.push(N[L])}}this.matrix_=p,this.capacity_=s}shrink_to_fit(){this._Reserve(this.size())}swap(s){this._Swap(s)}_Swap(s){[this.matrix_,s.matrix_]=[s.matrix_,this.matrix_],[this.size_,s.size_]=[s.size_,this.size_],[this.capacity_,s.capacity_]=[s.capacity_,this.capacity_]}static _Emend(s,p){if(s=Math.floor(s),s<=0)throw new zQ(`Error on Deque.${p}(): n must be positive integer -> (n = ${s})`);return s}size(){return this.size_}capacity(){return this.capacity_}nth(s){return new qp.Iterator(this,s)}[Symbol.iterator](){return new qp.ForOfAdaptor(this.matrix_)}source(){return this}_At(s){const p=this._Fetch_index(s);return this.matrix_[p.first][p.second]}_Set(s,p){const y=this._Fetch_index(s);this.matrix_[y.first][y.second]=p}_Fetch_index(s){let p;for(p=0;p<this.matrix_.length;p++){const y=this.matrix_[p];if(s<y.length)break;s-=y.length}return p===this.matrix_.length&&p--,new rp(p,s)}_Compute_col_size(s=this.capacity_){return Math.floor(s/qp.ROW_SIZE)}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_front(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_front(),this.matrix_[0].unshift(s),++this.size_}push_back(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s),++this.size_}pop_front(){if(this.empty()===!0)throw yd.empty(this.constructor,"pop_front");this.matrix_[0].shift(),this.matrix_[0].length===0&&this.matrix_.length>1&&this.matrix_.shift(),this.size_--}_Pop_back(){const s=this.matrix_[this.matrix_.length-1];s.pop(),s.length===0&&this.matrix_.length>1&&this.matrix_.pop(),this.size_--}_Insert_by_range(s,p,y){const C=this.size_+Wmt(p,y);if(C===this.size_)return s;if(s.equals(this.end())===!0)this._Try_expand_capacity(C),this._Insert_to_end(p,y),s=this.nth(this.size_);else if(C>this.capacity_){const N=new qp;N._Reserve(Math.max(C,Math.floor(this.capacity_*qp.MAGNIFIER))),N._Insert_to_end(this.begin(),s),N._Insert_to_end(p,y),N._Insert_to_end(s,this.end()),this._Swap(N)}else this._Insert_to_middle(s,p,y);return this.size_=C,s}_Insert_to_middle(s,p,y){const C=this._Compute_col_size(),N=this._Fetch_index(s.index());let L=this.matrix_[N.first];const z=N.second,G=L.splice(z);for(;!p.equals(y);p=p.next()){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const q=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...q)}L.push(p.value)}for(let q=0;q<G.length;++q){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const et=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...et)}L.push(G[q])}}_Insert_to_end(s,p){for(;!s.equals(p);s=s.next())this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s.value)}_Try_expand_capacity(s){return s<=this.capacity_?!1:(s=Math.max(s,Math.floor(this.capacity_*qp.MAGNIFIER)),this._Reserve(s),!0)}_Try_add_row_at_front(){const s=this._Compute_col_size();return this.matrix_[0].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_=[[]].concat(...this.matrix_),!0):!1}_Try_add_row_at_back(){const s=this._Compute_col_size();return this.matrix_[this.matrix_.length-1].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_.push([]),!0):!1}_Erase_by_range(s,p){if(s.index()>=this.size())return s;let y;p.index()>=this.size()?y=this.size()-s.index():y=p.index()-s.index(),this.size_-=y;let C=null,N=null,L=0;for(;y!==0;){const z=this._Fetch_index(s.index()),G=this.matrix_[z.first],q=z.second,et=Math.min(y,G.length-q);G.splice(q,et),G.length!==0&&(L===0?C=G:N=G),G.length===0&&this.matrix_.length>1&&this.matrix_.splice(z.first,1),y-=et,++L}return C!==null&&N!==null&&C.length+N.length<=this._Compute_col_size()&&(C.push(...N),this.matrix_.splice(this.matrix_.indexOf(N),1)),s}}(function(o){o.Iterator=KFt,o.ReverseIterator=i$,o.ROW_SIZE=8,o.MIN_CAPACITY=36,o.MAGNIFIER=1.5;class s{constructor(y){this.matrix_=y,this.row_=0,this.col_=0}next(){if(this.row_===this.matrix_.length)return{done:!0,value:void 0};{const y=this.matrix_[this.row_][this.col_];return++this.col_===this.matrix_[this.row_].length&&(++this.row_,this.col_=0),{done:!1,value:y}}}[Symbol.iterator](){return this}}o.ForOfAdaptor=s})(qp||(qp={}));class v6{constructor(s,p,y){this.prev_=s,this.next_=p,this.value_=y}static _Set_prev(s,p){s.prev_=p}static _Set_next(s,p){s.next_=p}prev(){return this.prev_}next(){return this.next_}get value(){return this._Try_value(),this.value_}_Try_value(){if(this.value_===void 0&&this.equals(this.source().end())===!0)throw yd.iterator_end_value(this.source())}equals(s){return this===s}}class GFt extends Umt{constructor(){super(),this.end_=this._Create_iterator(null,null),this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){v6._Set_prev(this.end_,this.end_),v6._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(Kmt(this.end(),-p),this.end())}begin(){return this.begin_}end(){return this.end_}size(){return this.size_}push_front(s){this.insert(this.begin_,s)}push_back(s){this.insert(this.end_,s)}pop_front(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_front");this.erase(this.begin_)}pop_back(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_back");this.erase(this.end_.prev())}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}insert(s,...p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");return p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){let C=s.prev(),N=null,L=0;for(let z=p;z.equals(y)===!1;z=z.next()){const G=this._Create_iterator(C,null,z.value);L===0&&(N=G),v6._Set_next(C,G),C=G,++L}return s.equals(this.begin())===!0&&(this.begin_=N),v6._Set_next(C,s),v6._Set_prev(s,C),this.size_+=L,N}erase(s,p=s.next()){return this._Erase_by_range(s,p)}_Erase_by_range(s,p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");if(s.equals(this.end_))return this.end_;const y=s.prev();v6._Set_next(y,p),v6._Set_prev(p,y);for(let C=s;!C.equals(p);C=C.next())C.erased_=!0,--this.size_;return s.equals(this.begin_)&&(this.begin_=p),p}swap(s){[this.begin_,s.begin_]=[s.begin_,this.begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.size_,s.size_]=[s.size_,this.size_]}}class J_ extends GFt{constructor(...s){if(super(),this.ptr_={value:this},J_.Iterator._Set_source_ptr(this.end_,this.ptr_),s.length!==0)if(s.length===1&&s[0]instanceof Array){const p=s[0];this.push(...p)}else if(s.length===1&&s[0]instanceof J_){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}_Create_iterator(s,p,y){return J_.Iterator.create(this.ptr_,s,p,y)}front(s){if(arguments.length===0)return this.begin_.value;this.begin_.value=s}back(s){const p=this.end().prev();if(arguments.length===0)return p.value;p.value=s}unique(s=Z_){let p=this.begin().next();for(;!p.equals(this.end());)s(p.value,p.prev().value)===!0?p=this.erase(p):p=p.next()}remove(s){return this.remove_if(p=>Z_(p,s))}remove_if(s){let p=this.begin();for(;!p.equals(this.end());)s(p.value)===!0?p=this.erase(p):p=p.next()}merge(s,p=i5){if(this===s)return;let y=this.begin();for(;s.empty()===!1;){const C=s.begin();for(;!y.equals(this.end())&&p(y.value,C.value)===!0;)y=y.next();this.splice(y,s,C)}}splice(s,p,y,C){y===void 0?(y=p.begin(),C=p.end()):C===void 0&&(C=y.next()),this.insert(s,y,C),p.erase(y,C)}sort(s=i5){this._Quick_sort(this.begin(),this.end().prev(),s)}_Quick_sort(s,p,y){if(!s.equals(p)&&!p.equals(this.end())&&!s.equals(p.next())){const C=this._Quick_sort_partition(s,p,y);this._Quick_sort(s,C.prev(),y),this._Quick_sort(C.next(),p,y)}}_Quick_sort_partition(s,p,y){const C=p.value;let N=s.prev(),L=s;for(;!L.equals(p);L=L.next())y(L.value,C)&&(N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value]);return N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value],N}reverse(){const s=this.end_.prev(),p=this.begin();for(let y=this.begin();!y.equals(this.end());){const C=y.prev(),N=y.next();J_.Iterator._Set_prev(y,N),J_.Iterator._Set_next(y,C),y=N}this.begin_=s,J_.Iterator._Set_prev(this.end_,p),J_.Iterator._Set_next(this.end_,s)}swap(s){super.swap(s),[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}}(function(o){class s extends v6{constructor(C,N,L,z){super(N,L,z),this.source_ptr_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}static _Set_source_ptr(C,N){C.source_ptr_=N}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(C){this._Try_value(),this.value_=C}equals(C){return this===C}}o.Iterator=s;class p extends qmt{_Create_neighbor(C){return new p(C)}get value(){return this.base_.value}set value(C){this.base_.value=C}}o.ReverseIterator=p})(J_||(J_={}));class l0 extends GFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return l0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends v6{constructor(C,N,L,z){super(N,L,z),this.list_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.list_.associative()}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends qmt{_Create_neighbor(C){return new p(C)}get first(){return this.base_.first}get second(){return this.base_.second}set second(C){this.base_.second=C}}o.ReverseIterator=p})(l0||(l0={}));class LMn{constructor(s,p){this.value=s,this.color=p,this.parent=null,this.left=null,this.right=null}get grand(){return this.parent.parent}get sibling(){return this===this.parent.left?this.parent.right:this.parent.left}get uncle(){return this.parent.sibling}}class NIe{constructor(s){this.root_=null,this.comp_=s,this.equal_=function(p,y){return!s(p,y)&&!s(y,p)}}clear(){this.root_=null}root(){return this.root_}get(s){const p=this.nearest(s);return p===null||!this.equal_(s,p.value)?null:p}nearest(s){if(this.root_===null)return null;let p=this.root_;for(;;){let y=null;if(this.comp_(s,p.value))y=p.left;else if(this.comp_(p.value,s))y=p.right;else return p;if(y!==null)p=y;else break}return p}_Fetch_maximum(s){for(;s.right!==null;)s=s.right;return s}insert(s){const p=this.nearest(s),y=new LMn(s,1);p===null?this.root_=y:(y.parent=p,this.comp_(y.value,p.value)?p.left=y:p.right=y),this._Insert_case1(y)}_Insert_case1(s){s.parent===null?s.color=0:this._Insert_case2(s)}_Insert_case2(s){this._Fetch_color(s.parent)!==0&&this._Insert_case3(s)}_Insert_case3(s){this._Fetch_color(s.uncle)===1?(s.parent.color=0,s.uncle.color=0,s.grand.color=1,this._Insert_case1(s.grand)):this._Insert_case4(s)}_Insert_case4(s){s===s.parent.right&&s.parent===s.grand.left?(this._Rotate_left(s.parent),s=s.left):s===s.parent.left&&s.parent===s.grand.right&&(this._Rotate_right(s.parent),s=s.right),this._Insert_case5(s)}_Insert_case5(s){s.parent.color=0,s.grand.color=1,s===s.parent.left&&s.parent===s.grand.left?this._Rotate_right(s.grand):this._Rotate_left(s.grand)}erase(s){let p=this.get(s);if(p===null)return;if(p.left!==null&&p.right!==null){const C=this._Fetch_maximum(p.left);p.value=C.value,p=C}const y=p.right===null?p.left:p.right;this._Fetch_color(p)===0&&(p.color=this._Fetch_color(y),this._Erase_case1(p)),this._Replace_node(p,y),this._Fetch_color(this.root_)===1&&(this.root_.color=0)}_Erase_case1(s){s.parent!==null&&this._Erase_case2(s)}_Erase_case2(s){this._Fetch_color(s.sibling)===1&&(s.parent.color=1,s.sibling.color=0,s===s.parent.left?this._Rotate_left(s.parent):this._Rotate_right(s.parent)),this._Erase_case3(s)}_Erase_case3(s){this._Fetch_color(s.parent)===0&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,this._Erase_case1(s.parent)):this._Erase_case4(s)}_Erase_case4(s){this._Fetch_color(s.parent)===1&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.parent.color=0):this._Erase_case5(s)}_Erase_case5(s){s===s.parent.left&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===1&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.sibling.left.color=0,this._Rotate_right(s.sibling)):s===s.parent.right&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===1&&(s.sibling.color=1,s.sibling.right.color=0,this._Rotate_left(s.sibling)),this._Erase_case6(s)}_Erase_case6(s){s.sibling.color=this._Fetch_color(s.parent),s.parent.color=0,s===s.parent.left?(s.sibling.right.color=0,this._Rotate_left(s.parent)):(s.sibling.left.color=0,this._Rotate_right(s.parent))}_Rotate_left(s){const p=s.right;this._Replace_node(s,p),s.right=p.left,p.left!==null&&(p.left.parent=s),p.left=s,s.parent=p}_Rotate_right(s){const p=s.left;this._Replace_node(s,p),s.left=p.right,p.right!==null&&(p.right.parent=s),p.right=s,s.parent=p}_Replace_node(s,p){s.parent===null?this.root_=p:s===s.parent.left?s.parent.left=p:s.parent.right=p,p!==null&&(p.parent=s.parent)}_Fetch_color(s){return s===null?0:s.color}}class PIe extends NIe{constructor(s,p,y){super(y),this.source_=s,this.key_compare_=p,this.key_eq_=function(C,N){return!p(C,N)&&!p(N,C)},this.value_compare_=function(C,N){return p(C.first,N.first)}}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.first)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source().end():this.key_comp()(p.value.first,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_compare_}key_eq(){return this.key_eq_}value_comp(){return this.value_compare_}}class SCe extends PIe{constructor(s,p){super(s,p,(y,C)=>p(y.first,C.first))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.first))C=p.left;else if(this.key_comp()(y.first,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class XF extends IIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,XF,p=>{this.tree_=new SCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),SCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(XF||(XF={}));class UQ extends zFt{constructor(...s){if(super(),s.length===1&&s[0]instanceof UQ){const p=s[0];this.data_=new XF(p.data_.begin(),p.data_.end()),this.size_=p.size_}else s.length===1&&s[0]instanceof Array?(this.clear(),this.push(...s[0])):s.length===2?this.assign(s[0],s[1]):this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_=new XF,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,!1):p<0&&this.erase(this.end().advance(-p),this.end())}flip(){for(const s of this.data_)s.second=!s.second}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.size_,s.size_]=[s.size_,this.size_]}source(){return this}size(){return this.size_}_At(s){return this._Find_node(s).second}_Set(s,p){p=!!p;let y=this._Find_node(s);if(y.second===p||(y.first===s?y.second=p:y=this.data_.emplace(s,p).first,s===this.size()-1))return;const C=y.prev(),N=y.next();CMn(C,this.data_.end())&&C.second===y.second&&this.data_.erase(y),N.equals(this.data_.end())===!0||N.first!==s+1||N.second!==p?this.data_.emplace(s+1,!p):this.data_.erase(N)}nth(s){return new UQ.Iterator(this,s)}_Find_node(s){return this.data_.upper_bound(s).prev()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_back(s){const p=this.data_.rbegin(),y=this.size_++;s=!!s,(this.data_.empty()||p.second!==s)&&this.data_.emplace(y,s)}_Pop_back(){const s=this.data_.rbegin(),p=--this.size_;s.first===p&&this.data_.erase(s.base())}_Insert_by_repeating_val(s,p,y){const C=[];return C.push(new rp(p,y)),s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_by_range(s,p,y){const C=[];for(let N=p;!N.equals(y);N=N.next())C.length===0||C[C.length-1].second!==N.value?C.push(new rp(1,N.value)):++C[C.length-1].first;return s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_to_middle(s,p){const y=this._Find_node(s.index());for(let C=y;!C.equals(this.data_.end());C=C.next()){const N=C.next(),L=C.first<s.index()?s.index():C.first,G=(N.equals(this.data_.end())?this.size():N.first)-L,q=!!C.second;p.push(new rp(G,q))}return this.size_=s.index(),this.data_.erase(y.first===s.index()?y:y.next(),this.data_.end()),this._Insert_to_end(p)}_Insert_to_end(s){const p=this.size(),y=this.data_.empty()?null:this.data_.rbegin().second;for(let C=0;C<s.length;++C){const N=s[C],L=this.size(),z=!!N.second;this.size_+=N.first,!(C===0&&z===y)&&this.data_.emplace(L,z)}return this.begin().advance(p)}_Erase_by_range(s,p){const y=[];if(p.equals(this.end())===!1){const C=Math.min(this.size(),p.index());for(let N=this._Find_node(C);!N.equals(this.data_.end());N=N.next()){const L=N.next(),z=Math.max(N.first,C),q=(L.equals(this.data_.end())?this.size():L.first)-z,et=N.second;y.push(new rp(q,et))}}return this.size_=s.index(),this.data_.erase(this.data_.lower_bound(this.size_),this.data_.end()),this._Insert_to_end(y)}}(function(o){o.Iterator=KFt,o.ReverseIterator=i$})(UQ||(UQ={}));class Sw{constructor(...s){if(this.ptr_={value:this},this.end_=Sw.Iterator.create(this.ptr_,null),this.before_begin_=Sw.Iterator.create(this.ptr_,this.end_),this.size_=0,s.length===1&&s[0]instanceof Array){const p=s[0];let y=this.before_begin();for(const C of p)y=this.insert_after(y,C)}else s.length===1&&s[0]instanceof Sw?this.assign(s[0].begin(),s[0].end()):s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert_after(this.before_begin_,s,p)}clear(){Sw.Iterator._Set_next(this.before_begin_,this.end_),this.size_=0}size(){return this.size_}empty(){return this.size_===0}front(s){const p=this.begin();if(arguments.length===0)return p.value;p.value=s}before_begin(){return this.before_begin_}begin(){return this.before_begin_.next()}end(){return this.end_}[Symbol.iterator](){return new bIe(this.begin(),this.end())}push_front(s){this.insert_after(this.before_begin_,s)}insert_after(s,...p){let y;return p.length===1?y=this._Insert_by_repeating_val(s,1,p[0]):typeof p[0]=="number"?y=this._Insert_by_repeating_val(s,p[0],p[1]):y=this._Insert_by_range(s,p[0],p[1]),y}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){const C=[];let N=0;for(;!p.equals(y);p=p.next()){const L=Sw.Iterator.create(this.ptr_,null,p.value);C.push(L),++N}if(N===0)return s;for(let L=0;L<N-1;++L)Sw.Iterator._Set_next(C[L],C[L+1]);return Sw.Iterator._Set_next(C[C.length-1],s.next()),Sw.Iterator._Set_next(s,C[0]),this.size_+=N,C[C.length-1]}pop_front(){this.erase_after(this.before_begin())}erase_after(s,p=Kmt(s,2)){return this.size_-=Math.max(0,Wmt(s,p)-1),Sw.Iterator._Set_next(s,p),p}unique(s=Z_){for(let p=this.begin().next();!p.equals(this.end());p=p.next()){const y=p.next();if(y.equals(this.end()))break;s(p.value,y.value)&&this.erase_after(p)}}remove(s){return this.remove_if(p=>Z_(p,s))}remove_if(s){let p=0;for(let y=this.before_begin();!y.next().equals(this.end());y=y.next())s(y.next().value)===!0&&(Sw.Iterator._Set_next(y,y.next().next()),++p);this.size_-=p}merge(s,p=i5){if(this===s)return;let y=this.before_begin();for(;s.empty()===!1;){const C=s.begin().value;for(;!y.next().equals(this.end())&&p(y.next().value,C);)y=y.next();this.splice_after(y,s,s.before_begin())}}splice_after(s,p,y=p.before_begin(),C=y.next().next()){C===null&&(C=p.end()),this.insert_after(s,y.next(),C),p.erase_after(y,C)}sort(s=i5){const p=new uC(this.begin(),this.end());SBt(p.begin(),p.end(),s),this.assign(p.begin(),p.end())}reverse(){const s=new uC(this.begin(),this.end());this.assign(s.rbegin(),s.rend())}swap(s){[this.size_,s.size_]=[s.size_,this.size_],[this.before_begin_,s.before_begin_]=[s.before_begin_,this.before_begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}toJSON(){const s=[];for(const p of this)s.push(p);return s}}(function(o){class s{constructor(y,C,N){this.source_ptr_=y,this.next_=C,this.value_=N}static create(y,C,N){return new s(y,C,N)}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(y){this._Try_value(),this.value_=y}_Try_value(){if(this.value_===void 0){const y=this.source();if(this.equals(y.end())===!0)throw yd.iterator_end_value(y);if(this.equals(y.before_begin())===!0)throw yd.iterator_end_value(y,"before_begin")}}next(){return this.next_}equals(y){return this===y}static _Set_next(y,C){y.next_=C}}o.Iterator=s})(Sw||(Sw={}));class h0 extends GFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return h0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends v6{constructor(C,N,L,z){super(N,L,z),this.source_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.source_.associative()}}o.Iterator=s;class p extends qmt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(h0||(h0={}));class LIe extends NIe{constructor(s,p,y){super(y),this.source_=s,this.key_comp_=p,this.key_eq_=(C,N)=>!p(C,N)&&!p(N,C)}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.value)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source_.end():this.key_comp_(p.value.value,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_comp_}key_eq(){return this.key_eq_}value_comp(){return this.key_comp_}}class CCe extends LIe{constructor(s,p){super(s,p,(y,C)=>p(y.value,C.value))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.value))C=p.left;else if(this.key_comp()(y.value,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class omt extends CIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,omt,p=>{this.tree_=new CCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),CCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(omt||(omt={}));var QF;(function(o){function s(p,y,C,...N){let L=null,z=jFt,G=Z_;if(N.length===1&&N[0]instanceof y){const q=N[0];z=q.hash_function(),G=q.key_eq(),L=()=>{const et=q.begin(),tt=q.end();p.assign(et,tt)}}else{const q=nmt.construct(p,...N);L=q.ramda,q.tail.length>=1&&(z=q.tail[0]),q.tail.length>=2&&(G=q.tail[1])}C(z,G),L!==null&&L()}o.construct=s})(QF||(QF={}));class MIe{constructor(s,p){this.fetcher_=s,this.hasher_=p,this.max_load_factor_=MMn,this.data_=[],this.size_=0,this.initialize()}clear(){this.data_=[],this.size_=0,this.initialize()}rehash(s){s=Math.max(s,ACe);const p=[];for(let y=0;y<s;++y)p.push([]);for(const y of this.data_)for(const C of y){const N=this.hasher_(this.fetcher_(C))%p.length;p[N].push(C)}this.data_=p}reserve(s){s>this.capacity()&&(s=Math.floor(s/this.max_load_factor_),this.rehash(s))}initialize(){for(let s=0;s<ACe;++s)this.data_.push([])}length(){return this.data_.length}capacity(){return this.data_.length*this.max_load_factor_}at(s){return this.data_[s]}load_factor(){return this.size_/this.length()}max_load_factor(s=null){if(s===null)return this.max_load_factor_;this.max_load_factor_=s}hash_function(){return this.hasher_}index(s){return this.hasher_(this.fetcher_(s))%this.length()}insert(s){const p=this.capacity();++this.size_>p&&this.reserve(p*2);const y=this.index(s);this.data_[y].push(s)}erase(s){const p=this.index(s),y=this.data_[p];for(let C=0;C<y.length;++C)if(y[C]===s){y.splice(C,1),--this.size_;break}}}const ACe=10,MMn=1;class cmt extends MIe{constructor(s,p,y){super(RMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.value,s))return C;return this.source_.end()}}function RMn(o){return o.value}class umt extends vIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,umt,(p,y)=>{this.buckets_=new cmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),cmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}_Insert_by_key(s){let p=this.find(s);return p.equals(this.end())===!1?new rp(p,!1):(this.data_.push(s),p=p.prev(),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){let y=this.find(p);return y.equals(this.end())===!0&&(y=this.data_.insert(s,p),this._Handle_insert(y,y.next())),y}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(umt||(umt={}));class ICe extends LIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.value,C.value);return!N&&!p(C.value,y.value)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.value)?L=y.left:this.key_comp()(N.value,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class lmt extends AIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,lmt,p=>{this.tree_=new ICe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),ICe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(lmt||(lmt={}));class hmt extends _Ie{constructor(...s){super(p=>new h0(p)),QF.construct(this,hmt,(p,y)=>{this.buckets_=new cmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),cmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.value,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.rehash(Math.ceil(s*this.max_load_factor()))}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}_Insert_by_key(s){const p=this.data_.insert(this.data_.end(),s);return this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){const y=this.data_.insert(s,p);return this._Handle_insert(y,y.next()),y}_Insert_by_range(s,p){const y=this.data_.insert(this.data_.end(),s,p);this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(y,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(hmt||(hmt={}));class fmt extends MIe{constructor(s,p,y){super(DMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.first,s))return C;return this.source_.end()}}function DMn(o){return o.first}class dmt extends EIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,dmt,(p,y)=>{this.buckets_=new fmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),fmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}emplace(s,p){let y=this.find(s);return y.equals(this.end())===!1?new rp(y,!1):(this.data_.push(new mk(s,p)),y=y.prev(),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){let C=this.find(p);return C.equals(this.end())===!0&&(C=this.data_.insert(s,new mk(p,y)),this._Handle_insert(C,C.next())),C}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(dmt||(dmt={}));class OCe extends PIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.first,C.first);return!N&&!p(C.first,y.first)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.first)?L=y.left:this.key_comp()(N.first,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class pmt extends OIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,pmt,p=>{this.tree_=new OCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),OCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(pmt||(pmt={}));class gmt extends TIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,gmt,(p,y)=>{this.buckets_=new fmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),fmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.first,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}emplace(s,p){const y=this.data_.insert(this.data_.end(),new mk(s,p));return this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=this.data_.insert(s,new mk(p,y));return this._Handle_insert(C,C.next()),C}_Insert_by_range(s,p){const y=[];for(let N=s;!N.equals(p);N=N.next())y.push(new mk(N.value.first,N.value.second));const C=this.data_.insert(this.data_.end(),new J2(y,0),new J2(y,y.length));this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(C,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(gmt||(gmt={}));var NCe;(function(o){function s(N){if(C.length<=N)for(let L=C.length;L<=N;++L)C.push(C[L-1]*L);return C[N]}o.factorial=s;function p(N,L,z,G=100*1e3){if(L>z)[L,z]=[z,L];else if(L===z)return 0;const q=(z-L)/G;let et=0;for(;L<z;L+=q)et+=N(L)*q;return et}o.integral=p;function y(N,L,z){let G=0;for(;L<=z;++L)G+=N(L);return G}o.sigma=y;const C=[1,1]})(NCe||(NCe={}));function BMn(o){return new Promise(s=>{setTimeout(s,o)})}var k6;(function(o){async function s(C,N,L){await C(),await y(N,L)}o.lock=s;async function p(C,N,L){return await C()===!1?!1:(await y(N,L),!0)}o.try_lock=p;async function y(C,N){try{await N()}catch(L){throw await C(),L}await C()}})(k6||(k6={}));class PCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock(),()=>N.unlock(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock(),()=>N.unlock(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_for(L),()=>N.unlock(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_until(L),()=>N.unlock(),z)}o.try_lock_until=C})(PCe||(PCe={}));class LCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock_shared(),()=>N.unlock_shared(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock_shared(),()=>N.unlock_shared(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_shared_for(L),()=>N.unlock_shared(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_shared_until(L),()=>N.unlock_shared(),z)}o.try_lock_until=C})(LCe||(LCe={}));class CBt{constructor(s){this.queue_=new J_,this.acquiring_=0,this.max_=s}max(){return this.max_}acquire(){return new Promise(s=>{this.acquiring_<this.max_?(++this.acquiring_,s()):this.queue_.push_back({handler:s,lockType:0})})}async try_acquire(){return this.acquiring_<this.max_?(++this.acquiring_,!0):!1}async try_acquire_for(s){return new Promise(p=>{if(this.acquiring_<this.max_)++this.acquiring_,p(!0);else{const y=this.queue_.insert(this.queue_.end(),{handler:p,lockType:1});BMn(s).then(()=>{y.value.handler!==null&&this._Cancel(y)})}})}try_acquire_until(s){const p=new Date,y=s.getTime()-p.getTime();return this.try_acquire_for(y)}async release(s=1){if(s<1)throw new zQ(`Error on std.Semaphore.release(): parametric n is less than 1 -> (n = ${s}).`);if(s>this.max_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than max -> (n = ${s}, max = ${this.max_}).`);if(s>this.acquiring_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than acquiring -> (n = ${s}, acquiring = ${this.acquiring_}).`);const p=[];for(;this.queue_.empty()===!1&&p.length<s;){const y=this.queue_.front();y.handler!==null&&p.push({...y}),this.queue_.pop_front(),y.handler=null}this.acquiring_-=s-p.length;for(const y of p)y.lockType===0?y.handler():y.handler(!0)}_Cancel(s){const p=s.value.handler;s.value.handler=null,this.queue_.erase(s),p(!1)}}(function(o){function s(y){return new p(y)}o.get_lockable=s;class p{constructor(C){this.semahpore_=C}lock(){return this.semahpore_.acquire()}unlock(){return this.semahpore_.release()}try_lock(){return this.semahpore_.try_acquire()}try_lock_for(C){return this.semahpore_.try_acquire_for(C)}try_lock_until(C){return this.semahpore_.try_acquire_until(C)}}o.Lockable=p})(CBt||(CBt={}));const Ng=[];for(let o=0;o<256;++o)Ng.push((o+256).toString(16).slice(1));function FMn(o,s=0){return(Ng[o[s+0]]+Ng[o[s+1]]+Ng[o[s+2]]+Ng[o[s+3]]+"-"+Ng[o[s+4]]+Ng[o[s+5]]+"-"+Ng[o[s+6]]+Ng[o[s+7]]+"-"+Ng[o[s+8]]+Ng[o[s+9]]+"-"+Ng[o[s+10]]+Ng[o[s+11]]+Ng[o[s+12]]+Ng[o[s+13]]+Ng[o[s+14]]+Ng[o[s+15]]).toLowerCase()}let HDt;const $Mn=new Uint8Array(16);function jMn(){if(!HDt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");HDt=crypto.getRandomValues.bind(crypto)}return HDt($Mn)}const HMn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MCe={randomUUID:HMn};function wk(o,s,p){var C;if(MCe.randomUUID&&!o)return MCe.randomUUID();o=o||{};const y=o.random??((C=o.rng)==null?void 0:C.call(o))??jMn();if(y.length<16)throw new Error("Random bytes length must be >= 16");return y[6]=y[6]&15|64,y[8]=y[8]&63|128,FMn(y)}function zMn(o){var C,N,L,z,G;const s=o.usage[o.kind];s.total+=o.completionUsage.total_tokens,s.input.total+=o.completionUsage.prompt_tokens,s.input.total+=((C=o.completionUsage.prompt_tokens_details)==null?void 0:C.audio_tokens)??0,s.input.cached+=((N=o.completionUsage.prompt_tokens_details)==null?void 0:N.cached_tokens)??0,s.output.total+=o.completionUsage.completion_tokens,s.output.accepted_prediction+=((L=o.completionUsage.completion_tokens_details)==null?void 0:L.accepted_prediction_tokens)??0,s.output.reasoning+=((z=o.completionUsage.completion_tokens_details)==null?void 0:z.reasoning_tokens)??0,s.output.rejected_prediction+=((G=o.completionUsage.completion_tokens_details)==null?void 0:G.rejected_prediction_tokens)??0;const p=q=>Object.entries(o.usage).filter(([et])=>et!=="aggregate").map(([,et])=>q(et)).reduce((et,tt)=>et+tt,0),y=o.usage.aggregate;y.total=p(q=>q.total),y.input.total=p(q=>q.input.total),y.input.cached=p(q=>q.input.cached),y.output.total=p(q=>q.output.total),y.output.reasoning=p(q=>q.output.reasoning),y.output.accepted_prediction=p(q=>q.output.accepted_prediction),y.output.rejected_prediction=p(q=>q.output.rejected_prediction)}const RIe={aggregate:zMn};class pP{constructor(s){if(s===void 0){const p=pP.zero();this.aggregate=p.aggregate,this.initialize=p.initialize,this.select=p.select,this.cancel=p.cancel,this.call=p.call,this.describe=p.describe}else this.aggregate=s.aggregate,this.initialize=s.initialize,this.select=s.select,this.cancel=s.cancel,this.call=s.call,this.describe=s.describe}increment(s){const p=(y,C)=>{y.total+=C.total,y.input.total+=C.input.total,y.input.cached+=C.input.cached,y.output.total+=C.output.total,y.output.reasoning+=C.output.reasoning,y.output.accepted_prediction+=C.output.accepted_prediction,y.output.rejected_prediction+=C.output.rejected_prediction};p(this.aggregate,s.aggregate),p(this.initialize,s.initialize),p(this.select,s.select),p(this.cancel,s.cancel),p(this.call,s.call),p(this.describe,s.describe)}use(s,p){RIe.aggregate({kind:s,completionUsage:p,usage:this})}toJSON(){return(()=>{const s=N=>({aggregate:p(N.aggregate),initialize:p(N.initialize),select:p(N.select),cancel:p(N.cancel),call:p(N.call),describe:p(N.describe)}),p=N=>({total:N.total,input:y(N.input),output:C(N.output)}),y=N=>({total:N.total,cached:N.cached}),C=N=>({total:N.total,reasoning:N.reasoning,accepted_prediction:N.accepted_prediction,rejected_prediction:N.rejected_prediction});return N=>s(N)})()(this)}static zero(){const s=()=>({total:0,input:{total:0,cached:0},output:{total:0,reasoning:0,accepted_prediction:0,rejected_prediction:0}});return new pP({aggregate:s(),initialize:s(),select:s(),cancel:s(),call:s(),describe:s()})}static plus(s,p){const y=new pP(s);return y.increment(p.toJSON()),y}}function DIe(o,s,p){const y=o.get(s);if(y!==void 0)return y;const C=p();return o.set(s,C),C}function UMn(o){var z;const s=o.controllers.length===1||(()=>{const G=o.controllers.map(q=>q.application.functions.map(et=>et.name)).flat();return new Set(G).size===G.length})(),p=qMn({controllers:o.controllers,naming:(G,q)=>s?G:`_${q}_${G}`}),y=(z=o.config)==null?void 0:z.capacity,C=y!==void 0&&p.length>y?YMn({array:p,capacity:y}):void 0,N=new Map,L=new Map;for(const G of p)N.set(G.name,G),DIe(L,G.controller.name,()=>new Map).set(G.name,G);return{array:p,divided:C,flat:N,group:L}}function qMn(o){return o.controllers.flatMap((s,p)=>{switch(s.protocol){case"http":return WMn({controller:s,index:p,naming:o.naming});case"class":return KMn({controller:s,index:p,naming:o.naming});case"mcp":return GMn({controller:s,index:p,naming:o.naming});default:throw new Error(`Unsupported protocol: ${s.protocol}`)}})}function WMn(o){return o.controller.application.functions.map(s=>({protocol:"http",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"http",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function KMn(o){return o.controller.application.functions.map(s=>({protocol:"class",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"class",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function GMn(o){return o.controller.application.functions.map(s=>({protocol:"mcp",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"mcp",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function YMn(o){if(o.capacity<=0)throw new Error("Capacity must be a positive integer");if(Number.isNaN(o.capacity))throw new TypeError("Capacity must be a positive integer");if(o.capacity===1/0)throw new Error("Capacity must be a positive integer");const s=Math.ceil(o.array.length/o.capacity),p=Math.ceil(o.array.length/s),y=o.array.slice();return Array.from({length:s},()=>y.splice(0,p))}const VMn={compose:UMn};function a$(o){if(o.type==="describe")return[];if(o.type==="select"||o.type==="cancel")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:`${o.type}Functions`,arguments:JSON.stringify({function:{name:o.selection.operation.name,reason:o.selection.reason}})}}]},{role:"tool",tool_call_id:o.id,content:""}];if(o.type==="execute")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:o.operation.name,arguments:JSON.stringify(o.arguments)}}]},{role:"tool",tool_call_id:o.id,content:JSON.stringify({function:{protocol:o.operation.protocol,description:o.operation.function.description,parameters:o.operation.function.parameters,output:o.operation.function.output,...o.operation.protocol==="http"?{method:o.operation.function.method,path:o.operation.function.path}:{}},...o.operation.protocol==="http"?{status:o.value.status,data:o.value.body}:{value:o.value}})}];if(o.type==="assistantMessage")return[{role:"assistant",content:o.text}];if(o.type==="systemMessage")return[{role:"system",content:o.text}];if(o.type==="userMessage")return[{role:"user",content:o.contents.map(s$)}];throw new Error(`Unsupported history type, value: ${JSON.stringify(o)}`)}function s$(o){if(o.type==="text")return o;if(o.type==="audio")return{type:"input_audio",input_audio:{data:o.data,format:o.format}};if(o.type==="file")return{type:"file",file:o.file.type==="data"?{file_data:o.file.data,filename:o.file.name}:{file_id:o.file.id}};if(o.type==="image")return{type:"image_url",image_url:{url:o.url,detail:o.detail}};throw new Error(`Unsupported user message content type, value: ${JSON.stringify(o)}`)}function BIe(o){return{type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents,toJSON:()=>({type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents})}}function XMn(o){const s={type:"assistantMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function QMn(o){const s={type:"systemMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function JMn(o){return{type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes,toJSON:()=>({type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes.map(s=>s.toJSON())})}}function FIe(o){return{type:"select",id:o.id,selection:o.selection,created_at:o.created_at,toJSON:()=>({type:"select",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function ZMn(o){return{type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection,toJSON:()=>({type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function $Ie(o){return{type:"execute",protocol:o.operation.protocol,id:o.id,created_at:o.created_at,operation:o.operation,arguments:o.arguments,value:o.value,toJSON:()=>({type:"execute",id:o.id,created_at:o.created_at,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value})}}function tRn(){const o={id:wk(),type:"initialize",created_at:new Date().toISOString()};return{id:o.id,type:o.type,created_at:o.created_at,toJSON:()=>o}}function eRn(o){const s=wk(),p=new Date().toISOString();return{type:"select",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"select",id:s,created_at:p,selection:o.selection.toJSON()}),toHistory:()=>FIe({id:s,created_at:p,selection:o.selection})}}function nRn(o){const s=wk(),p=new Date().toISOString();return{type:"cancel",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"cancel",id:s,created_at:p,selection:o.selection.toJSON()})}}function rRn(o){const s=new Date().toISOString();return{type:"call",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,toJSON:()=>({type:"call",id:o.id,created_at:s,operation:o.operation.toJSON(),arguments:o.arguments})}}function iRn(o){const s=new Date().toISOString();return{type:"jsonParseError",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,errorMessage:o.errorMessage}}function aRn(o){const s=new Date().toISOString();return{type:"validate",id:o.id,created_at:s,operation:o.operation,result:o.result,toJSON:()=>({type:"validate",id:o.id,created_at:s,operation:o.operation.toJSON(),result:o.result})}}function bmt(o){const s=wk(),p=new Date().toISOString();return{type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation,arguments:o.arguments,value:o.value,toJSON:()=>({type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value}),toHistory:()=>$Ie({id:s,created_at:p,...o})}}function sRn(o){const s=wk(),p=new Date().toISOString();return{type:"userMessage",id:s,created_at:p,contents:o.contents,toJSON:()=>({type:"userMessage",id:s,created_at:p,contents:o.contents}),toHistory:()=>BIe({id:s,created_at:p,contents:o.contents})}}function YFt(o){const s=wk(),p=new Date().toISOString();return{type:"assistantMessage",id:s,created_at:p,stream:o.stream,join:o.join,toJSON:()=>({type:"assistantMessage",id:s,created_at:p,done:o.done(),text:o.get()}),toHistory:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get(),toJSON:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get()})})}}function oRn(o){const s=wk(),p=new Date().toISOString();return{type:"describe",id:s,created_at:p,executes:o.executes,stream:o.stream,join:o.join,toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),done:o.done(),text:o.get()}),toHistory:()=>({type:"describe",id:s,created_at:p,executes:o.executes,text:o.get(),toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),text:o.get()})})}}function cRn(o){const s=wk(),p=new Date().toISOString();return{type:"request",id:s,created_at:p,source:o.source,body:o.body,options:o.options}}var ABt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.0")})(ABt||(ABt={}));var IBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.1")})(IBt||(IBt={}));var OBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.swagger=="string"&&s.swagger.startsWith("2.0")})(OBt||(OBt={}));var mmt;(function(o){o.reference=s=>s.split("/").filter((p,y)=>!!p.length&&!(y===0&&p==="#")).join(".")})(mmt||(mmt={}));var lC;(function(o){o.take=s=>p=>y=>{const C=s.get(p);if(C)return C;const N=y();return s.set(p,N),N}})(lC||(lC={}));var JF;(function(o){o.variable=s=>o.reserved(s)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(s),o.reserved=s=>uRn.has(s)})(JF||(JF={}));const uRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","package","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var hC;(function(o){o.cascade=s=>{var C,N;const p=s.schema.$ref.split(s.prefix)[1].split("."),y=p.slice(0,s.escape?p.length:p.length-1).map((L,z,G)=>G.slice(0,z+1).join(".")).map(L=>{var z,G;return{key:L,description:(G=(z=s.components.schemas)==null?void 0:z[L])==null?void 0:G.description}}).reverse().filter((L,z)=>z===0||!!(L!=null&&L.description));if(!(!((C=s.schema.description)!=null&&C.length)&&y.length===0))return[...(N=s.schema.description)!=null&&N.length?[s.schema.description]:[],...y.map((L,z)=>L.description===void 0?`Current Type: {@link ${L.key}}`:`Description of the ${z===0&&s.escape?"current":"parent"} {@link ${L.key}} type:
30
+ ${o.palette.mode==="light"?eOn(Ef(o.palette.divider,1),.88):nOn(Ef(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${oMn.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:s})=>s.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),S3=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableCell"}),{align:C="inherit",className:N,component:L,padding:z,scope:G,size:q,sortDirection:et,variant:tt,...nt}=y,st=ln.useContext(gIe),at=ln.useContext(zmt),Ot=at&&at.variant==="head";let Dt;L?Dt=L:Dt=Ot?"th":"td";let St=G;Dt==="td"?St=void 0:!St&&Ot&&(St="col");const ae=tt||at&&at.variant,ie={...y,align:C,component:Dt,padding:z||(st&&st.padding?st.padding:"normal"),size:q||(st&&st.size?st.size:"medium"),sortDirection:et,stickyHeader:ae==="head"&&st&&st.stickyHeader,variant:ae},Ne=cMn(ie);let pn=null;return et&&(pn=et==="asc"?"ascending":"descending"),le.jsx(uMn,{as:Dt,ref:p,className:bo(Ne.root,N),"aria-sort":pn,scope:St,ownerState:ie,...nt})});function lMn(o){return Vc("MuiTableHead",o)}au("MuiTableHead",["root"]);const hMn=o=>{const{classes:s}=o;return Hc({root:["root"]},lMn,s)},fMn=Ia("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,s)=>s.root})({display:"table-header-group"}),dMn={variant:"head"},_Ce="thead",pMn=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableHead"}),{className:C,component:N=_Ce,...L}=y,z={...y,component:N},G=hMn(z);return le.jsx(zmt.Provider,{value:dMn,children:le.jsx(fMn,{as:N,className:bo(G.root,C),ref:p,role:N===_Ce?null:"rowgroup",ownerState:z,...L})})});function gMn(o){return Vc("MuiToolbar",o)}au("MuiToolbar",["root","gutters","regular","dense"]);const bMn=o=>{const{classes:s,disableGutters:p,variant:y}=o;return Hc({root:["root",!p&&"gutters",y]},gMn,s)},mMn=Ia("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,!p.disableGutters&&s.gutters,s[p.variant]]}})(pu(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:s})=>!s.disableGutters,style:{paddingLeft:o.spacing(2),paddingRight:o.spacing(2),[o.breakpoints.up("sm")]:{paddingLeft:o.spacing(3),paddingRight:o.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:o.mixins.toolbar}]}))),xCe=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiToolbar"}),{className:C,component:N="div",disableGutters:L=!1,variant:z="regular",...G}=y,q={...y,component:N,disableGutters:L,variant:z},et=bMn(q);return le.jsx(mMn,{as:N,className:bo(et.root,C),ref:p,ownerState:q,...G})});function yMn(o){return Vc("MuiTableRow",o)}const ECe=au("MuiTableRow",["root","selected","hover","head","footer"]),wMn=o=>{const{classes:s,selected:p,hover:y,head:C,footer:N}=o;return Hc({root:["root",p&&"selected",y&&"hover",C&&"head",N&&"footer"]},yMn,s)},vMn=Ia("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,s)=>{const{ownerState:p}=o;return[s.root,p.head&&s.head,p.footer&&s.footer]}})(pu(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${ECe.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${ECe.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:Ef(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}}))),TCe="tr",kbt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTableRow"}),{className:C,component:N=TCe,hover:L=!1,selected:z=!1,...G}=y,q=ln.useContext(zmt),et={...y,component:N,hover:L,selected:z,head:q&&q.variant==="head",footer:q&&q.variant==="footer"},tt=wMn(et);return le.jsx(vMn,{as:N,ref:p,className:bo(tt.root,C),role:N===TCe?null:"row",ownerState:et,...G})});function _Mn(o){return Vc("MuiTextField",o)}au("MuiTextField",["root"]);const xMn={standard:Hmt,filled:DFt,outlined:FFt},EMn=o=>{const{classes:s}=o;return Hc({root:["root"]},_Mn,s)},TMn=Ia(IPn,{name:"MuiTextField",slot:"Root",overridesResolver:(o,s)=>s.root})({}),FDt=ln.forwardRef(function(s,p){const y=Su({props:s,name:"MuiTextField"}),{autoComplete:C,autoFocus:N=!1,children:L,className:z,color:G="primary",defaultValue:q,disabled:et=!1,error:tt=!1,FormHelperTextProps:nt,fullWidth:st=!1,helperText:at,id:Ot,InputLabelProps:Dt,inputProps:St,InputProps:ae,inputRef:ie,label:Ne,maxRows:pn,minRows:de,multiline:an=!1,name:Jn,onBlur:Rn,onChange:jn,onFocus:sr,placeholder:fr,required:fi=!1,rows:pi,select:Or=!1,SelectProps:di,slots:Ea={},slotProps:Qi={},type:li,value:ze,variant:Na="outlined",...Ts}=y,Ke={...y,autoFocus:N,color:G,disabled:et,error:tt,fullWidth:st,multiline:an,required:fi,select:Or,variant:Na},xo=EMn(Ke),Ss=VQ(Ot),La=at&&Ss?`${Ss}-helper-text`:void 0,zo=Ne&&Ss?`${Ss}-label`:void 0,$u=xMn[Na],gu={slots:Ea,slotProps:{input:ae,inputLabel:Dt,htmlInput:St,formHelperText:nt,select:di,...Qi}},Ds={},pc=gu.slotProps.inputLabel;Na==="outlined"&&(pc&&typeof pc.shrink<"u"&&(Ds.notched=pc.shrink),Ds.label=Ne),Or&&((!di||!di.native)&&(Ds.id=void 0),Ds["aria-describedby"]=void 0);const[bu,P1]=wh("root",{elementType:TMn,shouldForwardComponentProp:!0,externalForwardedProps:{...gu,...Ts},ownerState:Ke,className:bo(xo.root,z),ref:p,additionalProps:{disabled:et,error:tt,fullWidth:st,required:fi,color:G,variant:Na}}),[il,Rh]=wh("input",{elementType:$u,externalForwardedProps:gu,additionalProps:Ds,ownerState:Ke}),[Mg,Rg]=wh("inputLabel",{elementType:eLn,externalForwardedProps:gu,ownerState:Ke}),[Dg,iy]=wh("htmlInput",{elementType:"input",externalForwardedProps:gu,ownerState:Ke}),[Yp,wd]=wh("formHelperText",{elementType:HPn,externalForwardedProps:gu,ownerState:Ke}),[Vp,Ow]=wh("select",{elementType:pIe,externalForwardedProps:gu,ownerState:Ke}),Jd=le.jsx(il,{"aria-describedby":La,autoComplete:C,autoFocus:N,defaultValue:q,fullWidth:st,multiline:an,name:Jn,rows:pi,maxRows:pn,minRows:de,type:li,value:ze,id:Ss,inputRef:ie,onBlur:Rn,onChange:jn,onFocus:sr,placeholder:fr,inputProps:iy,slots:{input:Ea.htmlInput?Dg:void 0},...Rh});return le.jsxs(bu,{...P1,children:[Ne!=null&&Ne!==""&&le.jsx(Mg,{htmlFor:Ss,id:zo,...Rg,children:Ne}),Or?le.jsx(Vp,{"aria-describedby":La,id:Ss,labelId:zo,value:ze,input:Jd,...Ow,children:L}):Jd,at&&le.jsx(Yp,{id:La,...wd,children:at})]})});class bIe{constructor(s,p){this.it_=s,this.last_=p}next(){if(this.it_.equals(this.last_))return{done:!0,value:void 0};{const s=this.it_;return this.it_=this.it_.next(),{done:!1,value:s.value}}}[Symbol.iterator](){return this}}class Umt{empty(){return this.size()===0}rbegin(){return this.end().reverse()}rend(){return this.begin().reverse()}[Symbol.iterator](){return new bIe(this.begin(),this.end())}toJSON(){const s=[];for(const p of this)s.push(p);return s}}class J2{constructor(s,p){this.data_=s,this.index_=p}index(){return this.index_}get value(){return this.data_[this.index_]}prev(){return--this.index_,this}next(){return++this.index_,this}advance(s){return this.index_+=s,this}equals(s){return this.data_===s.data_&&this.index_===s.index_}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.index_,s.index_]=[s.index_,this.index_]}}class mIe extends Umt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(p,y),this.size()}insert(...s){return s.length===1?this._Insert_by_key(s[0]):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this._Insert_by_hint(s[0],s[1])}erase(...s){return s.length===1&&!(s[0]instanceof this.end().constructor&&s[0].source()===this)?this._Erase_by_val(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class yIe extends Error{constructor(s){super(s);const p=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,p):this.__proto__=p}get name(){return this.constructor.name}what(){return this.message}toJSON(){return{name:this.name,message:this.message,stack:this.stack}}}class wIe extends yIe{constructor(s){super(s)}}class zQ extends wIe{constructor(s){super(s)}}class oC extends wIe{constructor(s){super(s)}}var yd;(function(o){function s(et){if(typeof et=="string")return et;let tt=et.constructor.name;return et.constructor.__MODULE&&(tt=`${et.constructor.__MODULE}.${tt}`),`std.${tt}`}o.get_class_name=s;function p(et,tt){return new oC(`Error on ${s(et)}.${tt}(): it's empty container.`)}o.empty=p;function y(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric index is negative -> (index = ${nt}).`)}o.negative_index=y;function C(et,tt,nt,st){return new oC(`Error on ${s(et)}.${tt}(): parametric index is equal or greater than size -> (index = ${nt}, size: ${st}).`)}o.excessive_index=C;function N(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator is not this container's own.`)}o.not_my_iterator=N;function L(et,tt){return new zQ(`Error on ${s(et)}.${tt}(): parametric iterator, it already has been erased.`)}o.erased_iterator=L;function z(et,tt,nt){return new oC(`Error on ${s(et)}.${tt}(): parametric iterator is directing negative position -> (index = ${nt}).`)}o.negative_iterator=z;function G(et,tt="end"){const nt=s(et);return new oC(`Error on ${nt}.Iterator.value: cannot access to the ${nt}.${tt}().value.`)}o.iterator_end_value=G;function q(et,tt,nt){throw new oC(`Error on ${s(et)}.${tt}(): unable to find the matched key -> ${nt}`)}o.key_nout_found=q})(yd||(yd={}));class vIe extends mIe{count(s){return this.find(s).equals(this.end())?0:1}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(;!s.equals(p);s=s.next())this._Insert_by_key(s.value)}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_val(s)}_Extract_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);return this._Erase_by_range(p),s}_Extract_by_iterator(s){return s.equals(this.end())===!0||this.has(s.value)===!1?this.end():(this._Erase_by_range(s),s)}_Erase_by_val(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.value)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class _Ie extends mIe{insert(...s){return super.insert(...s)}_Erase_by_val(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.value);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}class xIe extends Umt{constructor(s){super(),this.data_=s(this)}assign(s,p){this.clear(),this.insert(s,p)}clear(){this.data_.clear()}begin(){return this.data_.begin()}end(){return this.data_.end()}has(s){return!this.find(s).equals(this.end())}size(){return this.data_.size()}push(...s){const p=new J2(s,0),y=new J2(s,s.length);return this.insert(p,y),this.size()}insert(...s){return s.length===1?this.emplace(s[0].first,s[0].second):s[0].next instanceof Function&&s[1].next instanceof Function?this._Insert_by_range(s[0],s[1]):this.emplace_hint(s[0],s[1].first,s[1].second)}erase(...s){return s.length===1&&(!(s[0]instanceof this.end().constructor)||s[0].source()!==this)?this._Erase_by_key(s[0]):s.length===1?this._Erase_by_range(s[0]):this._Erase_by_range(s[0],s[1])}_Erase_by_range(s,p=s.next()){const y=this.data_.erase(s,p);return this._Handle_erase(s,p),y}}class EIe extends xIe{count(s){return this.find(s).equals(this.end())?0:1}get(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"get",s);return p.second}take(s,p){const y=this.find(s);return y.equals(this.end())?this.emplace(s,p()).first.second:y.second}set(s,p){this.insert_or_assign(s,p)}insert(...s){return super.insert(...s)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}insert_or_assign(...s){if(s.length===2)return this._Insert_or_assign_with_key_value(s[0],s[1]);if(s.length===3)return this._Insert_or_assign_with_hint(s[0],s[1],s[2])}_Insert_or_assign_with_key_value(s,p){const y=this.emplace(s,p);return y.second===!1&&(y.first.second=p),y}_Insert_or_assign_with_hint(s,p,y){const C=this.emplace_hint(s,p,y);return C.second!==y&&(C.second=y),C}extract(s){return s instanceof this.end().constructor?this._Extract_by_iterator(s):this._Extract_by_key(s)}_Extract_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)throw yd.key_nout_found(this,"extract",s);const y=p.value;return this._Erase_by_range(p),y}_Extract_by_iterator(s){return s.equals(this.end())===!0?this.end():(this._Erase_by_range(s),s)}_Erase_by_key(s){const p=this.find(s);return p.equals(this.end())===!0?0:(this._Erase_by_range(p),1)}merge(s){for(let p=s.begin();!p.equals(s.end());)this.has(p.first)===!1?(this.insert(p.value),p=s.erase(p)):p=p.next()}}class TIe extends xIe{insert(...s){return super.insert(...s)}_Erase_by_key(s){const p=this.find(s);if(p.equals(this.end())===!0)return 0;let y=p.next(),C=1;for(;!y.equals(this.end())&&this._Key_eq(s,y.first);)y=y.next(),++C;return this._Erase_by_range(p,y),C}merge(s){this.insert(s.begin(),s.end()),s.clear()}}var nmt;(function(o){function s(p,...y){let C,N;return y.length>=1&&y[0]instanceof Array?(C=()=>{const L=y[0];p.push(...L)},N=y.slice(1)):y.length>=2&&y[0].next instanceof Function&&y[1].next instanceof Function?(C=()=>{const L=y[0],z=y[1];p.assign(L,z)},N=y.slice(2)):(C=null,N=y),{ramda:C,tail:N}}o.construct=s})(nmt||(nmt={}));function kIe(){return $Dt===null&&($Dt=typeof global=="object"&&kMn(global)),$Dt}function kMn(o){return o!==null&&typeof o.process=="object"&&o.process!==null&&typeof o.process.versions=="object"&&o.process.versions!==null&&typeof o.process.versions.node<"u"}let $Dt=null;function SMn(){return lQ===null&&(lQ=kIe()?global:self,lQ.__s_iUID===void 0&&(lQ.__s_iUID=0)),lQ}let lQ=null;function bk(o){if(o instanceof Object){if(o.hasOwnProperty("__get_m_iUID")===!1){const s=++SMn().__s_iUID;Object.defineProperty(o,"__get_m_iUID",{value:function(){return s}})}return o.__get_m_iUID()}else return o===void 0?-1:0}function Z_(o,s){return o=o&&o.valueOf(),s=s&&s.valueOf(),o instanceof Object&&o.equals instanceof Function?o.equals(s):o===s}function CMn(o,s){return!Z_(o,s)}function i5(o,s){return o=o.valueOf(),s=s.valueOf(),o instanceof Object?o.less instanceof Function?o.less(s):bk(o)<bk(s):o<s}var ey;(function(o){function s(y,C,N,...L){let z=null,G=i5;if(L.length===1&&L[0]instanceof C){const q=L[0];G=q.key_comp(),z=()=>{const et=q.begin(),tt=q.end();y.assign(et,tt)}}else{const q=nmt.construct(y,...L);z=q.ramda,q.tail.length>=1&&(G=q.tail[0])}N(G),z!==null&&z()}o.construct=s;function p(y,C,N){const L=C.prev();let z=L.equals(y.end())||y.value_comp()(L.value,N);return z=z&&(C.equals(y.end())||y.value_comp()(N,C.value)),z}o.emplacable=p})(ey||(ey={}));function jFt(...o){let s=IMn;for(let p of o){p=p&&p.valueOf();const y=typeof p;if(y==="boolean")s=AMn(p,s);else if(y==="number"||y==="bigint")s=kCe(p,s);else if(y==="string")s=SIe(p,s);else if(p instanceof Object&&p.hashCode instanceof Function){const C=p.hashCode();if(o.length===1)return C;s=s^C,s*=HFt}else s=kCe(bk(p),s)}return Math.abs(s)}function AMn(o,s){return s^=o?1:0,s*=HFt,s}function kCe(o,s){return SIe(o.toString(),s)}function SIe(o,s){for(let p=0;p<o.length;++p)s^=o.charCodeAt(p),s*=HFt;return Math.abs(s)}const IMn=2166136261,HFt=16777619;class rp{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)&&Z_(this.second,s.second)}less(s){return Z_(this.first,s.first)===!1?i5(this.first,s.first):i5(this.second,s.second)}hashCode(){return jFt(this.first,this.second)}}class CIe extends vIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.value)?p.next():p)}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(p.value,s)?new rp(p,!1):(p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p).first}}class OMn extends yIe{constructor(s){super(s)}}let NMn=class extends OMn{constructor(s){super(s)}};class VF{constructor(s,p){this.index_=s,this.value_=p}index(){return this.index_}get value(){return this.value_}next(){return++this.index_,this}equals(s){return this.index_===s.index_}}class zFt extends Umt{begin(){return this.nth(0)}end(){return this.nth(this.size())}at(s){return this._At(s)}set(s,p){if(s<0)throw yd.negative_index(this.source(),"at",s);if(s>=this.size())throw yd.excessive_index(this.source(),"at",s,this.size());this._Set(s,p)}front(s){if(arguments.length===0)return this.at(0);this.set(0,s)}back(s){const p=this.size()-1;if(arguments.length===0)return this.at(p);this.set(p,s)}insert(s,...p){if(s._Get_array()!==this)throw yd.not_my_iterator(this.source(),"insert");if(s.index()<0)throw yd.negative_iterator(this.source(),"insert",s.index());return s.index()>this.size()&&(s=this.end()),p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}pop_back(){if(this.empty()===!0)throw yd.empty(this.source(),"pop_back");this._Pop_back()}erase(s,p=s.next()){if(s._Get_array()!==this||p._Get_array()!==this)throw yd.not_my_iterator(this.source(),"erase");if(s.index()<0)throw yd.negative_iterator(this.source(),"erase",s.index());if(s.index()>p.index())throw new NMn(`Error on ${yd.get_class_name(this.source())}.erase(): first iterator has greater index than last -> (first = ${s.index()}, last = ${p.index()}).`);return s.index()>=this.size()?this.end():this._Erase_by_range(s,p)}}class UFt extends zFt{constructor(){super()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_.splice(0,this.data_.length)}resize(s){this.data_.length=s}size(){return this.data_.length}_At(s){return this.data_[s]}_Set(s,p){this.data_[s]=p}data(){return this.data_}[Symbol.iterator](){return this.data_[Symbol.iterator]()}push(...s){return this.data_.push(...s)}push_back(s){this.data_.push(s)}_Insert_by_range(s,p,y){if(s.index()>=this.size()){const C=this.size();for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.nth(C)}else{const C=this.data_.splice(s.index());for(;!p.equals(y);p=p.next())this.data_.push(p.value);return this.data_.push(...C),s}}_Pop_back(){this.data_.pop()}_Erase_by_range(s,p){return s.index()>=this.size()?s:p.index()>=this.size()?(this.data_.splice(s.index()),this.end()):(this.data_.splice(s.index(),p.index()-s.index()),s)}equals(s){return this.data_===s.data_}swap(s){[this.data_,s.data_]=[s.data_,this.data_]}toJSON(){return this.data_}}class qFt{constructor(s,p){this.array_=s,this.index_=p}_Get_array(){return this.array_}index(){return this.index_}get value(){return this.array_.at(this.index_)}set value(s){this.array_.set(this.index_,s)}prev(){return this.advance(-1)}next(){return this.advance(1)}advance(s){return this.array_.nth(this.index_+s)}equals(s){return Z_(this.array_,s.array_)&&this.index_===s.index_}}let qmt=class{constructor(s){this.base_=s.prev()}source(){return this.base_.source()}base(){return this.base_.next()}get value(){return this.base_.value}prev(){return this._Create_neighbor(this.base().next())}next(){return this._Create_neighbor(this.base_)}equals(s){return this.base_.equals(s.base_)}};class WFt extends qmt{advance(s){return this._Create_neighbor(this.base().advance(-s))}index(){return this.base_.index()}get value(){return this.base_.value}set value(s){this.base_.value=s}}class N3 extends UFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new N3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends qFt{source(){return this._Get_array().source()}reverse(){return new p(this)}}o.Iterator=s;class p extends WFt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(N3||(N3={}));function Wmt(o,s){if(o.index instanceof Function)return PMn(o,s);let p=0;for(;!o.equals(s);o=o.next())++p;return p}function PMn(o,s){const p=o.index(),y=s.index();return o.base instanceof Function?p-y:y-p}function Kmt(o,s){if(s===0)return o;if(o.advance instanceof Function)return o.advance(s);let p;if(s<0){if(!(o.prev instanceof Function))throw new zQ("Error on std.advance(): parametric iterator is not a bi-directional iterator, thus advancing to negative direction is not possible.");p=y=>y.prev(),s=-s}else p=y=>y.next();for(;s-- >0;)o=p(o);return o}function Gmt(o,s,p,y=i5){let C=Wmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Kmt(o,N);y(L.value,p)?(o=L.next(),C-=N+1):C=N}return o}function Ymt(o,s,p,y=i5){let C=Wmt(o,s);for(;C>0;){const N=Math.floor(C/2),L=Kmt(o,N);y(p,L.value)?C=N:(o=L.next(),C-=N+1)}return o}class rmt extends CIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,rmt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(rmt||(rmt={}));class AIe extends _Ie{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.value)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.value,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return this.key_comp()}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}_Insert_by_key(s){let p=this.upper_bound(s);return p=this.data_.insert(p,s),this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){if(ey.emplacable(this,s,p)){const C=this.data_.insert(s,p);return this._Handle_insert(C,C.next()),C}else return this._Insert_by_key(p)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this._Insert_by_key(y.value)}}class imt extends AIe{constructor(...s){super(p=>new N3(p)),ey.construct(this,imt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],N3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),s,this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),s,this.value_comp())}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=N3.Iterator,o.ReverseIterator=N3.ReverseIterator,o.__MODULE="experimental"})(imt||(imt={}));class mk{constructor(s,p){this.first=s,this.second=p}equals(s){return Z_(this.first,s.first)}less(s){return i5(this.first,s.first)}hashCode(){return jFt(this.first)}}class IIe extends EIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}equal_range(s){const p=this.lower_bound(s);return new rp(p,!p.equals(this.end())&&this._Key_eq(s,p.first)?p.next():p)}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.lower_bound(s);return!y.equals(this.end())&&this._Key_eq(y.first,s)?new rp(y,!1):(y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y).first}}class P3 extends UFt{constructor(s){super(),this.data_=[],this.associative_=s}nth(s){return new P3.Iterator(this,s)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}source(){return this.associative_}}(function(o){class s extends qFt{source(){return this._Get_array().source()}reverse(){return new p(this)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends WFt{_Create_neighbor(C){return new p(C)}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.ReverseIterator=p})(P3||(P3={}));class amt extends IIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,amt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(amt||(amt={}));class OIe extends TIe{find(s){const p=this.lower_bound(s);return!p.equals(this.end())&&this._Key_eq(s,p.first)?p:this.end()}count(s){let p=this.find(s),y=0;for(;!p.equals(this.end())&&this._Key_eq(p.first,s);p=p.next())++y;return y}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}value_comp(){return(s,p)=>this.key_comp()(s.first,p.first)}_Key_eq(s,p){return!this.key_comp()(s,p)&&!this.key_comp()(p,s)}emplace(s,p){let y=this.upper_bound(s);return y=this.data_.insert(y,new mk(s,p)),this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=new mk(p,y);if(ey.emplacable(this,s,C)){const L=this.data_.insert(s,C);return this._Handle_insert(L,L.next()),L}else return this.emplace(p,y)}_Insert_by_range(s,p){for(let y=s;!y.equals(p);y=y.next())this.emplace(y.value.first,y.value.second)}}class smt extends OIe{constructor(...s){super(p=>new P3(p)),ey.construct(this,smt,p=>{this.key_comp_=p},...s)}swap(s){[this.data_,s.data_]=[s.data_,this.data_],P3._Swap_associative(this.data_,s.data_),[this.key_comp_,s.key_comp_]=[s.key_comp_,this.key_comp_]}nth(s){return this.data_.nth(s)}key_comp(){return this.key_comp_}lower_bound(s){return Gmt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}upper_bound(s){return Ymt(this.begin(),this.end(),this._Capsule_key(s),this.value_comp())}_Capsule_key(s){return{first:s}}_Handle_insert({},{}){}_Handle_erase({},{}){}}(function(o){o.Iterator=P3.Iterator,o.ReverseIterator=P3.ReverseIterator,o.__MODULE="experimental"})(smt||(smt={}));class i$ extends WFt{_Create_neighbor(s){return new i$(s)}}class KFt extends qFt{reverse(){return new i$(this)}source(){return this._Get_array()}}class uC extends UFt{constructor(...s){if(super(),s.length===0)this.data_=[];else if(s[0]instanceof Array){const p=s[0];this.data_=s[1]===!0?p:p.slice()}else if(s.length===1&&s[0]instanceof uC){const p=s[0];this.data_=p.data_.slice()}else s.length===2&&(this.data_=[],this.assign(s[0],s[1]))}static wrap(s){return new uC(s,!0)}nth(s){return new uC.Iterator(this,s)}source(){return this}}(function(o){o.Iterator=KFt,o.ReverseIterator=i$})(uC||(uC={}));function SBt(o,s,p=i5){const y=s.index()-o.index();if(y<=0)return;const C=o.advance(Math.floor(y/2)),N=C.value;C.index()!==o.index()&&jDt(o,C);let L=1;for(let z=1;z<y;++z){const G=o.advance(z);p(G.value,N)&&(jDt(G,o.advance(L)),++L)}jDt(o,o.advance(L-1)),SBt(o,o.advance(L-1),p),SBt(o.advance(L),s,p)}function jDt(o,s){[o.value,s.value]=[s.value,o.value]}class qp extends zFt{constructor(...s){if(super(),s.length===0&&this.clear(),s.length===1&&s[0]instanceof Array){const p=s[0],y=new J2(p,0),C=new J2(p,p.length);this.assign(y,C)}else if(s.length===1&&s[0]instanceof qp){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.matrix_=[[]],this.size_=0,this.capacity_=qp.MIN_CAPACITY}resize(s){s=qp._Emend(s,"resize");const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(this.end().advance(-p),this.end())}reserve(s){this._Reserve(qp._Emend(s,"reserve"))}_Reserve(s){const p=[[]],y=this._Compute_col_size(s);for(let C=0;C<this.matrix_.length;++C){const N=this.matrix_[C];for(let L=0;L<N.length;++L){let z=p[p.length-1];p.length<qp.ROW_SIZE&&z.length===y&&(z=[],p.push(z)),z.push(N[L])}}this.matrix_=p,this.capacity_=s}shrink_to_fit(){this._Reserve(this.size())}swap(s){this._Swap(s)}_Swap(s){[this.matrix_,s.matrix_]=[s.matrix_,this.matrix_],[this.size_,s.size_]=[s.size_,this.size_],[this.capacity_,s.capacity_]=[s.capacity_,this.capacity_]}static _Emend(s,p){if(s=Math.floor(s),s<=0)throw new zQ(`Error on Deque.${p}(): n must be positive integer -> (n = ${s})`);return s}size(){return this.size_}capacity(){return this.capacity_}nth(s){return new qp.Iterator(this,s)}[Symbol.iterator](){return new qp.ForOfAdaptor(this.matrix_)}source(){return this}_At(s){const p=this._Fetch_index(s);return this.matrix_[p.first][p.second]}_Set(s,p){const y=this._Fetch_index(s);this.matrix_[y.first][y.second]=p}_Fetch_index(s){let p;for(p=0;p<this.matrix_.length;p++){const y=this.matrix_[p];if(s<y.length)break;s-=y.length}return p===this.matrix_.length&&p--,new rp(p,s)}_Compute_col_size(s=this.capacity_){return Math.floor(s/qp.ROW_SIZE)}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_front(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_front(),this.matrix_[0].unshift(s),++this.size_}push_back(s){this._Try_expand_capacity(this.size_+1),this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s),++this.size_}pop_front(){if(this.empty()===!0)throw yd.empty(this.constructor,"pop_front");this.matrix_[0].shift(),this.matrix_[0].length===0&&this.matrix_.length>1&&this.matrix_.shift(),this.size_--}_Pop_back(){const s=this.matrix_[this.matrix_.length-1];s.pop(),s.length===0&&this.matrix_.length>1&&this.matrix_.pop(),this.size_--}_Insert_by_range(s,p,y){const C=this.size_+Wmt(p,y);if(C===this.size_)return s;if(s.equals(this.end())===!0)this._Try_expand_capacity(C),this._Insert_to_end(p,y),s=this.nth(this.size_);else if(C>this.capacity_){const N=new qp;N._Reserve(Math.max(C,Math.floor(this.capacity_*qp.MAGNIFIER))),N._Insert_to_end(this.begin(),s),N._Insert_to_end(p,y),N._Insert_to_end(s,this.end()),this._Swap(N)}else this._Insert_to_middle(s,p,y);return this.size_=C,s}_Insert_to_middle(s,p,y){const C=this._Compute_col_size(),N=this._Fetch_index(s.index());let L=this.matrix_[N.first];const z=N.second,G=L.splice(z);for(;!p.equals(y);p=p.next()){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const q=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...q)}L.push(p.value)}for(let q=0;q<G.length;++q){if(L.length===C&&this.matrix_.length<qp.ROW_SIZE){L=new Array;const et=this.matrix_.splice(++N.first);this.matrix_.push(L),this.matrix_.push(...et)}L.push(G[q])}}_Insert_to_end(s,p){for(;!s.equals(p);s=s.next())this._Try_add_row_at_back(),this.matrix_[this.matrix_.length-1].push(s.value)}_Try_expand_capacity(s){return s<=this.capacity_?!1:(s=Math.max(s,Math.floor(this.capacity_*qp.MAGNIFIER)),this._Reserve(s),!0)}_Try_add_row_at_front(){const s=this._Compute_col_size();return this.matrix_[0].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_=[[]].concat(...this.matrix_),!0):!1}_Try_add_row_at_back(){const s=this._Compute_col_size();return this.matrix_[this.matrix_.length-1].length>=s&&this.matrix_.length<qp.ROW_SIZE?(this.matrix_.push([]),!0):!1}_Erase_by_range(s,p){if(s.index()>=this.size())return s;let y;p.index()>=this.size()?y=this.size()-s.index():y=p.index()-s.index(),this.size_-=y;let C=null,N=null,L=0;for(;y!==0;){const z=this._Fetch_index(s.index()),G=this.matrix_[z.first],q=z.second,et=Math.min(y,G.length-q);G.splice(q,et),G.length!==0&&(L===0?C=G:N=G),G.length===0&&this.matrix_.length>1&&this.matrix_.splice(z.first,1),y-=et,++L}return C!==null&&N!==null&&C.length+N.length<=this._Compute_col_size()&&(C.push(...N),this.matrix_.splice(this.matrix_.indexOf(N),1)),s}}(function(o){o.Iterator=KFt,o.ReverseIterator=i$,o.ROW_SIZE=8,o.MIN_CAPACITY=36,o.MAGNIFIER=1.5;class s{constructor(y){this.matrix_=y,this.row_=0,this.col_=0}next(){if(this.row_===this.matrix_.length)return{done:!0,value:void 0};{const y=this.matrix_[this.row_][this.col_];return++this.col_===this.matrix_[this.row_].length&&(++this.row_,this.col_=0),{done:!1,value:y}}}[Symbol.iterator](){return this}}o.ForOfAdaptor=s})(qp||(qp={}));class v6{constructor(s,p,y){this.prev_=s,this.next_=p,this.value_=y}static _Set_prev(s,p){s.prev_=p}static _Set_next(s,p){s.next_=p}prev(){return this.prev_}next(){return this.next_}get value(){return this._Try_value(),this.value_}_Try_value(){if(this.value_===void 0&&this.equals(this.source().end())===!0)throw yd.iterator_end_value(this.source())}equals(s){return this===s}}class GFt extends Umt{constructor(){super(),this.end_=this._Create_iterator(null,null),this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){v6._Set_prev(this.end_,this.end_),v6._Set_next(this.end_,this.end_),this.begin_=this.end_,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,void 0):p<0&&this.erase(Kmt(this.end(),-p),this.end())}begin(){return this.begin_}end(){return this.end_}size(){return this.size_}push_front(s){this.insert(this.begin_,s)}push_back(s){this.insert(this.end_,s)}pop_front(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_front");this.erase(this.begin_)}pop_back(){if(this.empty()===!0)throw yd.empty(this.end_.source().constructor.name,"pop_back");this.erase(this.end_.prev())}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}insert(s,...p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");return p.length===1?this._Insert_by_repeating_val(s,1,p[0]):p.length===2&&typeof p[0]=="number"?this._Insert_by_repeating_val(s,p[0],p[1]):this._Insert_by_range(s,p[0],p[1])}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){let C=s.prev(),N=null,L=0;for(let z=p;z.equals(y)===!1;z=z.next()){const G=this._Create_iterator(C,null,z.value);L===0&&(N=G),v6._Set_next(C,G),C=G,++L}return s.equals(this.begin())===!0&&(this.begin_=N),v6._Set_next(C,s),v6._Set_prev(s,C),this.size_+=L,N}erase(s,p=s.next()){return this._Erase_by_range(s,p)}_Erase_by_range(s,p){if(s.source()!==this.end_.source())throw yd.not_my_iterator(this.end_.source(),"insert");if(s.erased_===!0)throw yd.erased_iterator(this.end_.source(),"insert");if(s.equals(this.end_))return this.end_;const y=s.prev();v6._Set_next(y,p),v6._Set_prev(p,y);for(let C=s;!C.equals(p);C=C.next())C.erased_=!0,--this.size_;return s.equals(this.begin_)&&(this.begin_=p),p}swap(s){[this.begin_,s.begin_]=[s.begin_,this.begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.size_,s.size_]=[s.size_,this.size_]}}class J_ extends GFt{constructor(...s){if(super(),this.ptr_={value:this},J_.Iterator._Set_source_ptr(this.end_,this.ptr_),s.length!==0)if(s.length===1&&s[0]instanceof Array){const p=s[0];this.push(...p)}else if(s.length===1&&s[0]instanceof J_){const p=s[0];this.assign(p.begin(),p.end())}else s.length===2&&this.assign(s[0],s[1])}_Create_iterator(s,p,y){return J_.Iterator.create(this.ptr_,s,p,y)}front(s){if(arguments.length===0)return this.begin_.value;this.begin_.value=s}back(s){const p=this.end().prev();if(arguments.length===0)return p.value;p.value=s}unique(s=Z_){let p=this.begin().next();for(;!p.equals(this.end());)s(p.value,p.prev().value)===!0?p=this.erase(p):p=p.next()}remove(s){return this.remove_if(p=>Z_(p,s))}remove_if(s){let p=this.begin();for(;!p.equals(this.end());)s(p.value)===!0?p=this.erase(p):p=p.next()}merge(s,p=i5){if(this===s)return;let y=this.begin();for(;s.empty()===!1;){const C=s.begin();for(;!y.equals(this.end())&&p(y.value,C.value)===!0;)y=y.next();this.splice(y,s,C)}}splice(s,p,y,C){y===void 0?(y=p.begin(),C=p.end()):C===void 0&&(C=y.next()),this.insert(s,y,C),p.erase(y,C)}sort(s=i5){this._Quick_sort(this.begin(),this.end().prev(),s)}_Quick_sort(s,p,y){if(!s.equals(p)&&!p.equals(this.end())&&!s.equals(p.next())){const C=this._Quick_sort_partition(s,p,y);this._Quick_sort(s,C.prev(),y),this._Quick_sort(C.next(),p,y)}}_Quick_sort_partition(s,p,y){const C=p.value;let N=s.prev(),L=s;for(;!L.equals(p);L=L.next())y(L.value,C)&&(N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value]);return N=N.equals(this.end())?s:N.next(),[N.value,L.value]=[L.value,N.value],N}reverse(){const s=this.end_.prev(),p=this.begin();for(let y=this.begin();!y.equals(this.end());){const C=y.prev(),N=y.next();J_.Iterator._Set_prev(y,N),J_.Iterator._Set_next(y,C),y=N}this.begin_=s,J_.Iterator._Set_prev(this.end_,p),J_.Iterator._Set_next(this.end_,s)}swap(s){super.swap(s),[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}}(function(o){class s extends v6{constructor(C,N,L,z){super(N,L,z),this.source_ptr_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}static _Set_source_ptr(C,N){C.source_ptr_=N}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(C){this._Try_value(),this.value_=C}equals(C){return this===C}}o.Iterator=s;class p extends qmt{_Create_neighbor(C){return new p(C)}get value(){return this.base_.value}set value(C){this.base_.value=C}}o.ReverseIterator=p})(J_||(J_={}));class l0 extends GFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return l0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends v6{constructor(C,N,L,z){super(N,L,z),this.list_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.list_.associative()}get first(){return this.value.first}get second(){return this.value.second}set second(C){this.value.second=C}}o.Iterator=s;class p extends qmt{_Create_neighbor(C){return new p(C)}get first(){return this.base_.first}get second(){return this.base_.second}set second(C){this.base_.second=C}}o.ReverseIterator=p})(l0||(l0={}));class LMn{constructor(s,p){this.value=s,this.color=p,this.parent=null,this.left=null,this.right=null}get grand(){return this.parent.parent}get sibling(){return this===this.parent.left?this.parent.right:this.parent.left}get uncle(){return this.parent.sibling}}class NIe{constructor(s){this.root_=null,this.comp_=s,this.equal_=function(p,y){return!s(p,y)&&!s(y,p)}}clear(){this.root_=null}root(){return this.root_}get(s){const p=this.nearest(s);return p===null||!this.equal_(s,p.value)?null:p}nearest(s){if(this.root_===null)return null;let p=this.root_;for(;;){let y=null;if(this.comp_(s,p.value))y=p.left;else if(this.comp_(p.value,s))y=p.right;else return p;if(y!==null)p=y;else break}return p}_Fetch_maximum(s){for(;s.right!==null;)s=s.right;return s}insert(s){const p=this.nearest(s),y=new LMn(s,1);p===null?this.root_=y:(y.parent=p,this.comp_(y.value,p.value)?p.left=y:p.right=y),this._Insert_case1(y)}_Insert_case1(s){s.parent===null?s.color=0:this._Insert_case2(s)}_Insert_case2(s){this._Fetch_color(s.parent)!==0&&this._Insert_case3(s)}_Insert_case3(s){this._Fetch_color(s.uncle)===1?(s.parent.color=0,s.uncle.color=0,s.grand.color=1,this._Insert_case1(s.grand)):this._Insert_case4(s)}_Insert_case4(s){s===s.parent.right&&s.parent===s.grand.left?(this._Rotate_left(s.parent),s=s.left):s===s.parent.left&&s.parent===s.grand.right&&(this._Rotate_right(s.parent),s=s.right),this._Insert_case5(s)}_Insert_case5(s){s.parent.color=0,s.grand.color=1,s===s.parent.left&&s.parent===s.grand.left?this._Rotate_right(s.grand):this._Rotate_left(s.grand)}erase(s){let p=this.get(s);if(p===null)return;if(p.left!==null&&p.right!==null){const C=this._Fetch_maximum(p.left);p.value=C.value,p=C}const y=p.right===null?p.left:p.right;this._Fetch_color(p)===0&&(p.color=this._Fetch_color(y),this._Erase_case1(p)),this._Replace_node(p,y),this._Fetch_color(this.root_)===1&&(this.root_.color=0)}_Erase_case1(s){s.parent!==null&&this._Erase_case2(s)}_Erase_case2(s){this._Fetch_color(s.sibling)===1&&(s.parent.color=1,s.sibling.color=0,s===s.parent.left?this._Rotate_left(s.parent):this._Rotate_right(s.parent)),this._Erase_case3(s)}_Erase_case3(s){this._Fetch_color(s.parent)===0&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,this._Erase_case1(s.parent)):this._Erase_case4(s)}_Erase_case4(s){this._Fetch_color(s.parent)===1&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.parent.color=0):this._Erase_case5(s)}_Erase_case5(s){s===s.parent.left&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===1&&this._Fetch_color(s.sibling.right)===0?(s.sibling.color=1,s.sibling.left.color=0,this._Rotate_right(s.sibling)):s===s.parent.right&&s.sibling!==null&&this._Fetch_color(s.sibling)===0&&this._Fetch_color(s.sibling.left)===0&&this._Fetch_color(s.sibling.right)===1&&(s.sibling.color=1,s.sibling.right.color=0,this._Rotate_left(s.sibling)),this._Erase_case6(s)}_Erase_case6(s){s.sibling.color=this._Fetch_color(s.parent),s.parent.color=0,s===s.parent.left?(s.sibling.right.color=0,this._Rotate_left(s.parent)):(s.sibling.left.color=0,this._Rotate_right(s.parent))}_Rotate_left(s){const p=s.right;this._Replace_node(s,p),s.right=p.left,p.left!==null&&(p.left.parent=s),p.left=s,s.parent=p}_Rotate_right(s){const p=s.left;this._Replace_node(s,p),s.left=p.right,p.right!==null&&(p.right.parent=s),p.right=s,s.parent=p}_Replace_node(s,p){s.parent===null?this.root_=p:s===s.parent.left?s.parent.left=p:s.parent.right=p,p!==null&&(p.parent=s.parent)}_Fetch_color(s){return s===null?0:s.color}}class PIe extends NIe{constructor(s,p,y){super(y),this.source_=s,this.key_compare_=p,this.key_eq_=function(C,N){return!p(C,N)&&!p(N,C)},this.value_compare_=function(C,N){return p(C.first,N.first)}}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.first)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source().end():this.key_comp()(p.value.first,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_compare_}key_eq(){return this.key_eq_}value_comp(){return this.value_compare_}}class SCe extends PIe{constructor(s,p){super(s,p,(y,C)=>p(y.first,C.first))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.first))C=p.left;else if(this.key_comp()(y.first,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class XF extends IIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,XF,p=>{this.tree_=new SCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),SCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(XF||(XF={}));class UQ extends zFt{constructor(...s){if(super(),s.length===1&&s[0]instanceof UQ){const p=s[0];this.data_=new XF(p.data_.begin(),p.data_.end()),this.size_=p.size_}else s.length===1&&s[0]instanceof Array?(this.clear(),this.push(...s[0])):s.length===2?this.assign(s[0],s[1]):this.clear()}assign(s,p){this.clear(),this.insert(this.end(),s,p)}clear(){this.data_=new XF,this.size_=0}resize(s){const p=s-this.size();p>0?this.insert(this.end(),p,!1):p<0&&this.erase(this.end().advance(-p),this.end())}flip(){for(const s of this.data_)s.second=!s.second}swap(s){[this.data_,s.data_]=[s.data_,this.data_],[this.size_,s.size_]=[s.size_,this.size_]}source(){return this}size(){return this.size_}_At(s){return this._Find_node(s).second}_Set(s,p){p=!!p;let y=this._Find_node(s);if(y.second===p||(y.first===s?y.second=p:y=this.data_.emplace(s,p).first,s===this.size()-1))return;const C=y.prev(),N=y.next();CMn(C,this.data_.end())&&C.second===y.second&&this.data_.erase(y),N.equals(this.data_.end())===!0||N.first!==s+1||N.second!==p?this.data_.emplace(s+1,!p):this.data_.erase(N)}nth(s){return new UQ.Iterator(this,s)}_Find_node(s){return this.data_.upper_bound(s).prev()}push(...s){if(s.length===0)return this.size();const p=new J2(s,0),y=new J2(s,s.length);return this._Insert_by_range(this.end(),p,y),this.size()}push_back(s){const p=this.data_.rbegin(),y=this.size_++;s=!!s,(this.data_.empty()||p.second!==s)&&this.data_.emplace(y,s)}_Pop_back(){const s=this.data_.rbegin(),p=--this.size_;s.first===p&&this.data_.erase(s.base())}_Insert_by_repeating_val(s,p,y){const C=[];return C.push(new rp(p,y)),s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_by_range(s,p,y){const C=[];for(let N=p;!N.equals(y);N=N.next())C.length===0||C[C.length-1].second!==N.value?C.push(new rp(1,N.value)):++C[C.length-1].first;return s.equals(this.end())===!0?this._Insert_to_end(C):this._Insert_to_middle(s,C)}_Insert_to_middle(s,p){const y=this._Find_node(s.index());for(let C=y;!C.equals(this.data_.end());C=C.next()){const N=C.next(),L=C.first<s.index()?s.index():C.first,G=(N.equals(this.data_.end())?this.size():N.first)-L,q=!!C.second;p.push(new rp(G,q))}return this.size_=s.index(),this.data_.erase(y.first===s.index()?y:y.next(),this.data_.end()),this._Insert_to_end(p)}_Insert_to_end(s){const p=this.size(),y=this.data_.empty()?null:this.data_.rbegin().second;for(let C=0;C<s.length;++C){const N=s[C],L=this.size(),z=!!N.second;this.size_+=N.first,!(C===0&&z===y)&&this.data_.emplace(L,z)}return this.begin().advance(p)}_Erase_by_range(s,p){const y=[];if(p.equals(this.end())===!1){const C=Math.min(this.size(),p.index());for(let N=this._Find_node(C);!N.equals(this.data_.end());N=N.next()){const L=N.next(),z=Math.max(N.first,C),q=(L.equals(this.data_.end())?this.size():L.first)-z,et=N.second;y.push(new rp(q,et))}}return this.size_=s.index(),this.data_.erase(this.data_.lower_bound(this.size_),this.data_.end()),this._Insert_to_end(y)}}(function(o){o.Iterator=KFt,o.ReverseIterator=i$})(UQ||(UQ={}));class Sw{constructor(...s){if(this.ptr_={value:this},this.end_=Sw.Iterator.create(this.ptr_,null),this.before_begin_=Sw.Iterator.create(this.ptr_,this.end_),this.size_=0,s.length===1&&s[0]instanceof Array){const p=s[0];let y=this.before_begin();for(const C of p)y=this.insert_after(y,C)}else s.length===1&&s[0]instanceof Sw?this.assign(s[0].begin(),s[0].end()):s.length===2&&this.assign(s[0],s[1])}assign(s,p){this.clear(),this.insert_after(this.before_begin_,s,p)}clear(){Sw.Iterator._Set_next(this.before_begin_,this.end_),this.size_=0}size(){return this.size_}empty(){return this.size_===0}front(s){const p=this.begin();if(arguments.length===0)return p.value;p.value=s}before_begin(){return this.before_begin_}begin(){return this.before_begin_.next()}end(){return this.end_}[Symbol.iterator](){return new bIe(this.begin(),this.end())}push_front(s){this.insert_after(this.before_begin_,s)}insert_after(s,...p){let y;return p.length===1?y=this._Insert_by_repeating_val(s,1,p[0]):typeof p[0]=="number"?y=this._Insert_by_repeating_val(s,p[0],p[1]):y=this._Insert_by_range(s,p[0],p[1]),y}_Insert_by_repeating_val(s,p,y){const C=new VF(0,y),N=new VF(p);return this._Insert_by_range(s,C,N)}_Insert_by_range(s,p,y){const C=[];let N=0;for(;!p.equals(y);p=p.next()){const L=Sw.Iterator.create(this.ptr_,null,p.value);C.push(L),++N}if(N===0)return s;for(let L=0;L<N-1;++L)Sw.Iterator._Set_next(C[L],C[L+1]);return Sw.Iterator._Set_next(C[C.length-1],s.next()),Sw.Iterator._Set_next(s,C[0]),this.size_+=N,C[C.length-1]}pop_front(){this.erase_after(this.before_begin())}erase_after(s,p=Kmt(s,2)){return this.size_-=Math.max(0,Wmt(s,p)-1),Sw.Iterator._Set_next(s,p),p}unique(s=Z_){for(let p=this.begin().next();!p.equals(this.end());p=p.next()){const y=p.next();if(y.equals(this.end()))break;s(p.value,y.value)&&this.erase_after(p)}}remove(s){return this.remove_if(p=>Z_(p,s))}remove_if(s){let p=0;for(let y=this.before_begin();!y.next().equals(this.end());y=y.next())s(y.next().value)===!0&&(Sw.Iterator._Set_next(y,y.next().next()),++p);this.size_-=p}merge(s,p=i5){if(this===s)return;let y=this.before_begin();for(;s.empty()===!1;){const C=s.begin().value;for(;!y.next().equals(this.end())&&p(y.next().value,C);)y=y.next();this.splice_after(y,s,s.before_begin())}}splice_after(s,p,y=p.before_begin(),C=y.next().next()){C===null&&(C=p.end()),this.insert_after(s,y.next(),C),p.erase_after(y,C)}sort(s=i5){const p=new uC(this.begin(),this.end());SBt(p.begin(),p.end(),s),this.assign(p.begin(),p.end())}reverse(){const s=new uC(this.begin(),this.end());this.assign(s.rbegin(),s.rend())}swap(s){[this.size_,s.size_]=[s.size_,this.size_],[this.before_begin_,s.before_begin_]=[s.before_begin_,this.before_begin_],[this.end_,s.end_]=[s.end_,this.end_],[this.ptr_,s.ptr_]=[s.ptr_,this.ptr_],[this.ptr_.value,s.ptr_.value]=[s.ptr_.value,this.ptr_.value]}toJSON(){const s=[];for(const p of this)s.push(p);return s}}(function(o){class s{constructor(y,C,N){this.source_ptr_=y,this.next_=C,this.value_=N}static create(y,C,N){return new s(y,C,N)}source(){return this.source_ptr_.value}get value(){return this._Try_value(),this.value_}set value(y){this._Try_value(),this.value_=y}_Try_value(){if(this.value_===void 0){const y=this.source();if(this.equals(y.end())===!0)throw yd.iterator_end_value(y);if(this.equals(y.before_begin())===!0)throw yd.iterator_end_value(y,"before_begin")}}next(){return this.next_}equals(y){return this===y}static _Set_next(y,C){y.next_=C}}o.Iterator=s})(Sw||(Sw={}));class h0 extends GFt{constructor(s){super(),this.associative_=s}_Create_iterator(s,p,y){return h0.Iterator.create(this,s,p,y)}static _Swap_associative(s,p){[s.associative_,p.associative_]=[p.associative_,s.associative_]}associative(){return this.associative_}}(function(o){class s extends v6{constructor(C,N,L,z){super(N,L,z),this.source_=C}static create(C,N,L,z){return new s(C,N,L,z)}reverse(){return new p(this)}source(){return this.source_.associative()}}o.Iterator=s;class p extends qmt{_Create_neighbor(C){return new p(C)}}o.ReverseIterator=p})(h0||(h0={}));class LIe extends NIe{constructor(s,p,y){super(y),this.source_=s,this.key_comp_=p,this.key_eq_=(C,N)=>!p(C,N)&&!p(N,C)}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}get_by_key(s){const p=this.nearest_by_key(s);return p===null||!this.key_eq_(s,p.value.value)?null:p}lower_bound(s){const p=this.nearest_by_key(s);return p===null?this.source_.end():this.key_comp_(p.value.value,s)?p.value.next():p.value}equal_range(s){return new rp(this.lower_bound(s),this.upper_bound(s))}source(){return this.source_}key_comp(){return this.key_comp_}key_eq(){return this.key_eq_}value_comp(){return this.key_comp_}}class CCe extends LIe{constructor(s,p){super(s,p,(y,C)=>p(y.value,C.value))}nearest_by_key(s){if(this.root_===null)return null;let p=this.root_;for(;;){const y=p.value;let C=null;if(this.key_comp()(s,y.value))C=p.left;else if(this.key_comp()(y.value,s))C=p.right;else return p;if(C===null)break;p=C}return p}upper_bound(s){const p=this.nearest_by_key(s);if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class omt extends CIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,omt,p=>{this.tree_=new CCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),CCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(omt||(omt={}));var QF;(function(o){function s(p,y,C,...N){let L=null,z=jFt,G=Z_;if(N.length===1&&N[0]instanceof y){const q=N[0];z=q.hash_function(),G=q.key_eq(),L=()=>{const et=q.begin(),tt=q.end();p.assign(et,tt)}}else{const q=nmt.construct(p,...N);L=q.ramda,q.tail.length>=1&&(z=q.tail[0]),q.tail.length>=2&&(G=q.tail[1])}C(z,G),L!==null&&L()}o.construct=s})(QF||(QF={}));class MIe{constructor(s,p){this.fetcher_=s,this.hasher_=p,this.max_load_factor_=MMn,this.data_=[],this.size_=0,this.initialize()}clear(){this.data_=[],this.size_=0,this.initialize()}rehash(s){s=Math.max(s,ACe);const p=[];for(let y=0;y<s;++y)p.push([]);for(const y of this.data_)for(const C of y){const N=this.hasher_(this.fetcher_(C))%p.length;p[N].push(C)}this.data_=p}reserve(s){s>this.capacity()&&(s=Math.floor(s/this.max_load_factor_),this.rehash(s))}initialize(){for(let s=0;s<ACe;++s)this.data_.push([])}length(){return this.data_.length}capacity(){return this.data_.length*this.max_load_factor_}at(s){return this.data_[s]}load_factor(){return this.size_/this.length()}max_load_factor(s=null){if(s===null)return this.max_load_factor_;this.max_load_factor_=s}hash_function(){return this.hasher_}index(s){return this.hasher_(this.fetcher_(s))%this.length()}insert(s){const p=this.capacity();++this.size_>p&&this.reserve(p*2);const y=this.index(s);this.data_[y].push(s)}erase(s){const p=this.index(s),y=this.data_[p];for(let C=0;C<y.length;++C)if(y[C]===s){y.splice(C,1),--this.size_;break}}}const ACe=10,MMn=1;class cmt extends MIe{constructor(s,p,y){super(RMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.value,s))return C;return this.source_.end()}}function RMn(o){return o.value}class umt extends vIe{constructor(...s){super(p=>new h0(p)),QF.construct(this,umt,(p,y)=>{this.buckets_=new cmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),cmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}_Insert_by_key(s){let p=this.find(s);return p.equals(this.end())===!1?new rp(p,!1):(this.data_.push(s),p=p.prev(),this._Handle_insert(p,p.next()),new rp(p,!0))}_Insert_by_hint(s,p){let y=this.find(p);return y.equals(this.end())===!0&&(y=this.data_.insert(s,p),this._Handle_insert(y,y.next())),y}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(umt||(umt={}));class ICe extends LIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.value,C.value);return!N&&!p(C.value,y.value)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.value)?L=y.left:this.key_comp()(N.value,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.value)?y:y.next()}}class lmt extends AIe{constructor(...s){super(p=>new h0(p)),ey.construct(this,lmt,p=>{this.tree_=new ICe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),ICe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(lmt||(lmt={}));class hmt extends _Ie{constructor(...s){super(p=>new h0(p)),QF.construct(this,hmt,(p,y)=>{this.buckets_=new cmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],h0._Swap_associative(this.data_,s.data_),cmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.value,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.rehash(Math.ceil(s*this.max_load_factor()))}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}_Insert_by_key(s){const p=this.data_.insert(this.data_.end(),s);return this._Handle_insert(p,p.next()),p}_Insert_by_hint(s,p){const y=this.data_.insert(s,p);return this._Handle_insert(y,y.next()),y}_Insert_by_range(s,p){const y=this.data_.insert(this.data_.end(),s,p);this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(y,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=h0.Iterator,o.ReverseIterator=h0.ReverseIterator})(hmt||(hmt={}));class fmt extends MIe{constructor(s,p,y){super(DMn,p),this.source_=s,this.key_eq_=y}static _Swap_source(s,p){[s.source_,p.source_]=[p.source_,s.source_]}key_eq(){return this.key_eq_}find(s){const p=this.hash_function()(s)%this.length(),y=this.at(p);for(const C of y)if(this.key_eq_(C.first,s))return C;return this.source_.end()}}function DMn(o){return o.first}class dmt extends EIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,dmt,(p,y)=>{this.buckets_=new fmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),fmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){this.buckets_.rehash(s)}emplace(s,p){let y=this.find(s);return y.equals(this.end())===!1?new rp(y,!1):(this.data_.push(new mk(s,p)),y=y.prev(),this._Handle_insert(y,y.next()),new rp(y,!0))}emplace_hint(s,p,y){let C=this.find(p);return C.equals(this.end())===!0&&(C=this.data_.insert(s,new mk(p,y)),this._Handle_insert(C,C.next())),C}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(dmt||(dmt={}));class OCe extends PIe{constructor(s,p){super(s,p,function(y,C){const N=p(y.first,C.first);return!N&&!p(C.first,y.first)?bk(y)<bk(C):N})}insert(s){bk(s),super.insert(s)}_Nearest_by_key(s,p){if(this.root_===null)return null;let y=this.root_,C=null;for(;;){const N=y.value;let L=null;if(this.key_comp()(s,N.first)?L=y.left:this.key_comp()(N.first,s)?L=y.right:(C=y,L=p(y)),L===null)break;y=L}return C!==null?C:y}nearest_by_key(s){return this._Nearest_by_key(s,function(p){return p.left})}upper_bound(s){const p=this._Nearest_by_key(s,function(C){return C.right});if(p===null)return this.source().end();const y=p.value;return this.key_comp()(s,y.first)?y:y.next()}}class pmt extends OIe{constructor(...s){super(p=>new l0(p)),ey.construct(this,pmt,p=>{this.tree_=new OCe(this,p)},...s)}clear(){super.clear(),this.tree_.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),OCe._Swap_source(this.tree_,s.tree_),[this.tree_,s.tree_]=[s.tree_,this.tree_]}key_comp(){return this.tree_.key_comp()}lower_bound(s){return this.tree_.lower_bound(s)}upper_bound(s){return this.tree_.upper_bound(s)}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.tree_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.tree_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(pmt||(pmt={}));class gmt extends TIe{constructor(...s){super(p=>new l0(p)),QF.construct(this,gmt,(p,y)=>{this.buckets_=new fmt(this,p,y)},...s)}clear(){this.buckets_.clear(),super.clear()}swap(s){[this.data_,s.data_]=[s.data_,this.data_],l0._Swap_associative(this.data_,s.data_),fmt._Swap_source(this.buckets_,s.buckets_),[this.buckets_,s.buckets_]=[s.buckets_,this.buckets_]}find(s){return this.buckets_.find(s)}count(s){const p=this.bucket(s),y=this.buckets_.at(p);let C=0;for(let N of y)this.buckets_.key_eq()(N.first,s)&&++C;return C}begin(s=null){return s===null?super.begin():this.buckets_.at(s)[0]}end(s=null){if(s===null)return super.end();{const p=this.buckets_.at(s);return p[p.length-1].next()}}rbegin(s=null){return this.end(s).reverse()}rend(s=null){return this.begin(s).reverse()}bucket_count(){return this.buckets_.length()}bucket_size(s){return this.buckets_.at(s).length}load_factor(){return this.buckets_.load_factor()}hash_function(){return this.buckets_.hash_function()}key_eq(){return this.buckets_.key_eq()}bucket(s){return this.hash_function()(s)%this.buckets_.length()}max_load_factor(s=null){return this.buckets_.max_load_factor(s)}reserve(s){this.buckets_.reserve(s)}rehash(s){s<=this.bucket_count()||this.buckets_.rehash(s)}_Key_eq(s,p){return this.key_eq()(s,p)}emplace(s,p){const y=this.data_.insert(this.data_.end(),new mk(s,p));return this._Handle_insert(y,y.next()),y}emplace_hint(s,p,y){const C=this.data_.insert(s,new mk(p,y));return this._Handle_insert(C,C.next()),C}_Insert_by_range(s,p){const y=[];for(let N=s;!N.equals(p);N=N.next())y.push(new mk(N.value.first,N.value.second));const C=this.data_.insert(this.data_.end(),new J2(y,0),new J2(y,y.length));this.size()>this.buckets_.capacity()&&this.reserve(Math.max(this.size(),this.buckets_.capacity()*2)),this._Handle_insert(C,this.end())}_Handle_insert(s,p){for(;!s.equals(p);s=s.next())this.buckets_.insert(s)}_Handle_erase(s,p){for(;!s.equals(p);s=s.next())this.buckets_.erase(s)}}(function(o){o.Iterator=l0.Iterator,o.ReverseIterator=l0.ReverseIterator})(gmt||(gmt={}));var NCe;(function(o){function s(N){if(C.length<=N)for(let L=C.length;L<=N;++L)C.push(C[L-1]*L);return C[N]}o.factorial=s;function p(N,L,z,G=100*1e3){if(L>z)[L,z]=[z,L];else if(L===z)return 0;const q=(z-L)/G;let et=0;for(;L<z;L+=q)et+=N(L)*q;return et}o.integral=p;function y(N,L,z){let G=0;for(;L<=z;++L)G+=N(L);return G}o.sigma=y;const C=[1,1]})(NCe||(NCe={}));function BMn(o){return new Promise(s=>{setTimeout(s,o)})}var k6;(function(o){async function s(C,N,L){await C(),await y(N,L)}o.lock=s;async function p(C,N,L){return await C()===!1?!1:(await y(N,L),!0)}o.try_lock=p;async function y(C,N){try{await N()}catch(L){throw await C(),L}await C()}})(k6||(k6={}));class PCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock(),()=>N.unlock(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock(),()=>N.unlock(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_for(L),()=>N.unlock(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_until(L),()=>N.unlock(),z)}o.try_lock_until=C})(PCe||(PCe={}));class LCe{}(function(o){function s(N,L){return k6.lock(()=>N.lock_shared(),()=>N.unlock_shared(),L)}o.lock=s;function p(N,L){return k6.try_lock(()=>N.try_lock_shared(),()=>N.unlock_shared(),L)}o.try_lock=p;function y(N,L,z){return k6.try_lock(()=>N.try_lock_shared_for(L),()=>N.unlock_shared(),z)}o.try_lock_for=y;function C(N,L,z){return k6.try_lock(()=>N.try_lock_shared_until(L),()=>N.unlock_shared(),z)}o.try_lock_until=C})(LCe||(LCe={}));class CBt{constructor(s){this.queue_=new J_,this.acquiring_=0,this.max_=s}max(){return this.max_}acquire(){return new Promise(s=>{this.acquiring_<this.max_?(++this.acquiring_,s()):this.queue_.push_back({handler:s,lockType:0})})}async try_acquire(){return this.acquiring_<this.max_?(++this.acquiring_,!0):!1}async try_acquire_for(s){return new Promise(p=>{if(this.acquiring_<this.max_)++this.acquiring_,p(!0);else{const y=this.queue_.insert(this.queue_.end(),{handler:p,lockType:1});BMn(s).then(()=>{y.value.handler!==null&&this._Cancel(y)})}})}try_acquire_until(s){const p=new Date,y=s.getTime()-p.getTime();return this.try_acquire_for(y)}async release(s=1){if(s<1)throw new zQ(`Error on std.Semaphore.release(): parametric n is less than 1 -> (n = ${s}).`);if(s>this.max_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than max -> (n = ${s}, max = ${this.max_}).`);if(s>this.acquiring_)throw new oC(`Error on std.Semaphore.release(): parametric n is greater than acquiring -> (n = ${s}, acquiring = ${this.acquiring_}).`);const p=[];for(;this.queue_.empty()===!1&&p.length<s;){const y=this.queue_.front();y.handler!==null&&p.push({...y}),this.queue_.pop_front(),y.handler=null}this.acquiring_-=s-p.length;for(const y of p)y.lockType===0?y.handler():y.handler(!0)}_Cancel(s){const p=s.value.handler;s.value.handler=null,this.queue_.erase(s),p(!1)}}(function(o){function s(y){return new p(y)}o.get_lockable=s;class p{constructor(C){this.semahpore_=C}lock(){return this.semahpore_.acquire()}unlock(){return this.semahpore_.release()}try_lock(){return this.semahpore_.try_acquire()}try_lock_for(C){return this.semahpore_.try_acquire_for(C)}try_lock_until(C){return this.semahpore_.try_acquire_until(C)}}o.Lockable=p})(CBt||(CBt={}));const Ng=[];for(let o=0;o<256;++o)Ng.push((o+256).toString(16).slice(1));function FMn(o,s=0){return(Ng[o[s+0]]+Ng[o[s+1]]+Ng[o[s+2]]+Ng[o[s+3]]+"-"+Ng[o[s+4]]+Ng[o[s+5]]+"-"+Ng[o[s+6]]+Ng[o[s+7]]+"-"+Ng[o[s+8]]+Ng[o[s+9]]+"-"+Ng[o[s+10]]+Ng[o[s+11]]+Ng[o[s+12]]+Ng[o[s+13]]+Ng[o[s+14]]+Ng[o[s+15]]).toLowerCase()}let HDt;const $Mn=new Uint8Array(16);function jMn(){if(!HDt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");HDt=crypto.getRandomValues.bind(crypto)}return HDt($Mn)}const HMn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MCe={randomUUID:HMn};function wk(o,s,p){var C;if(MCe.randomUUID&&!o)return MCe.randomUUID();o=o||{};const y=o.random??((C=o.rng)==null?void 0:C.call(o))??jMn();if(y.length<16)throw new Error("Random bytes length must be >= 16");return y[6]=y[6]&15|64,y[8]=y[8]&63|128,FMn(y)}function zMn(o){var C,N,L,z,G;const s=o.usage[o.kind];s.total+=o.completionUsage.total_tokens,s.input.total+=o.completionUsage.prompt_tokens,s.input.total+=((C=o.completionUsage.prompt_tokens_details)==null?void 0:C.audio_tokens)??0,s.input.cached+=((N=o.completionUsage.prompt_tokens_details)==null?void 0:N.cached_tokens)??0,s.output.total+=o.completionUsage.completion_tokens,s.output.accepted_prediction+=((L=o.completionUsage.completion_tokens_details)==null?void 0:L.accepted_prediction_tokens)??0,s.output.reasoning+=((z=o.completionUsage.completion_tokens_details)==null?void 0:z.reasoning_tokens)??0,s.output.rejected_prediction+=((G=o.completionUsage.completion_tokens_details)==null?void 0:G.rejected_prediction_tokens)??0;const p=q=>Object.entries(o.usage).filter(([et])=>et!=="aggregate").map(([,et])=>q(et)).reduce((et,tt)=>et+tt,0),y=o.usage.aggregate;y.total=p(q=>q.total),y.input.total=p(q=>q.input.total),y.input.cached=p(q=>q.input.cached),y.output.total=p(q=>q.output.total),y.output.reasoning=p(q=>q.output.reasoning),y.output.accepted_prediction=p(q=>q.output.accepted_prediction),y.output.rejected_prediction=p(q=>q.output.rejected_prediction)}const RIe={aggregate:zMn};class pP{constructor(s){if(s===void 0){const p=pP.zero();this.aggregate=p.aggregate,this.initialize=p.initialize,this.select=p.select,this.cancel=p.cancel,this.call=p.call,this.describe=p.describe}else this.aggregate=s.aggregate,this.initialize=s.initialize,this.select=s.select,this.cancel=s.cancel,this.call=s.call,this.describe=s.describe}increment(s){const p=(y,C)=>{y.total+=C.total,y.input.total+=C.input.total,y.input.cached+=C.input.cached,y.output.total+=C.output.total,y.output.reasoning+=C.output.reasoning,y.output.accepted_prediction+=C.output.accepted_prediction,y.output.rejected_prediction+=C.output.rejected_prediction};p(this.aggregate,s.aggregate),p(this.initialize,s.initialize),p(this.select,s.select),p(this.cancel,s.cancel),p(this.call,s.call),p(this.describe,s.describe)}use(s,p){RIe.aggregate({kind:s,completionUsage:p,usage:this})}toJSON(){return(()=>{const s=N=>({aggregate:p(N.aggregate),initialize:p(N.initialize),select:p(N.select),cancel:p(N.cancel),call:p(N.call),describe:p(N.describe)}),p=N=>({total:N.total,input:y(N.input),output:C(N.output)}),y=N=>({total:N.total,cached:N.cached}),C=N=>({total:N.total,reasoning:N.reasoning,accepted_prediction:N.accepted_prediction,rejected_prediction:N.rejected_prediction});return N=>s(N)})()(this)}static zero(){const s=()=>({total:0,input:{total:0,cached:0},output:{total:0,reasoning:0,accepted_prediction:0,rejected_prediction:0}});return new pP({aggregate:s(),initialize:s(),select:s(),cancel:s(),call:s(),describe:s()})}static plus(s,p){const y=new pP(s.toJSON());return y.increment(p.toJSON()),y}}function DIe(o,s,p){const y=o.get(s);if(y!==void 0)return y;const C=p();return o.set(s,C),C}function UMn(o){var z;const s=o.controllers.length===1||(()=>{const G=o.controllers.map(q=>q.application.functions.map(et=>et.name)).flat();return new Set(G).size===G.length})(),p=qMn({controllers:o.controllers,naming:(G,q)=>s?G:`_${q}_${G}`}),y=(z=o.config)==null?void 0:z.capacity,C=y!==void 0&&p.length>y?YMn({array:p,capacity:y}):void 0,N=new Map,L=new Map;for(const G of p)N.set(G.name,G),DIe(L,G.controller.name,()=>new Map).set(G.name,G);return{array:p,divided:C,flat:N,group:L}}function qMn(o){return o.controllers.flatMap((s,p)=>{switch(s.protocol){case"http":return WMn({controller:s,index:p,naming:o.naming});case"class":return KMn({controller:s,index:p,naming:o.naming});case"mcp":return GMn({controller:s,index:p,naming:o.naming});default:throw new Error(`Unsupported protocol: ${s.protocol}`)}})}function WMn(o){return o.controller.application.functions.map(s=>({protocol:"http",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"http",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function KMn(o){return o.controller.application.functions.map(s=>({protocol:"class",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"class",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function GMn(o){return o.controller.application.functions.map(s=>({protocol:"mcp",controller:o.controller,function:s,name:o.naming(s.name,o.index),toJSON:()=>({protocol:"mcp",controller:o.controller.name,function:s.name,name:o.naming(s.name,o.index)})}))}function YMn(o){if(o.capacity<=0)throw new Error("Capacity must be a positive integer");if(Number.isNaN(o.capacity))throw new TypeError("Capacity must be a positive integer");if(o.capacity===1/0)throw new Error("Capacity must be a positive integer");const s=Math.ceil(o.array.length/o.capacity),p=Math.ceil(o.array.length/s),y=o.array.slice();return Array.from({length:s},()=>y.splice(0,p))}const VMn={compose:UMn};function a$(o){if(o.type==="describe")return[];if(o.type==="select"||o.type==="cancel")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:`${o.type}Functions`,arguments:JSON.stringify({function:{name:o.selection.operation.name,reason:o.selection.reason}})}}]},{role:"tool",tool_call_id:o.id,content:""}];if(o.type==="execute")return[{role:"assistant",tool_calls:[{type:"function",id:o.id,function:{name:o.operation.name,arguments:JSON.stringify(o.arguments)}}]},{role:"tool",tool_call_id:o.id,content:JSON.stringify({function:{protocol:o.operation.protocol,description:o.operation.function.description,parameters:o.operation.function.parameters,output:o.operation.function.output,...o.operation.protocol==="http"?{method:o.operation.function.method,path:o.operation.function.path}:{}},...o.operation.protocol==="http"?{status:o.value.status,data:o.value.body}:{value:o.value}})}];if(o.type==="assistantMessage")return[{role:"assistant",content:o.text}];if(o.type==="systemMessage")return[{role:"system",content:o.text}];if(o.type==="userMessage")return[{role:"user",content:o.contents.map(s$)}];throw new Error(`Unsupported history type, value: ${JSON.stringify(o)}`)}function s$(o){if(o.type==="text")return o;if(o.type==="audio")return{type:"input_audio",input_audio:{data:o.data,format:o.format}};if(o.type==="file")return{type:"file",file:o.file.type==="data"?{file_data:o.file.data,filename:o.file.name}:{file_id:o.file.id}};if(o.type==="image")return{type:"image_url",image_url:{url:o.url,detail:o.detail}};throw new Error(`Unsupported user message content type, value: ${JSON.stringify(o)}`)}function BIe(o){return{type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents,toJSON:()=>({type:"userMessage",id:o.id,created_at:o.created_at,contents:o.contents})}}function XMn(o){const s={type:"assistantMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function QMn(o){const s={type:"systemMessage",id:o.id,created_at:o.created_at,text:o.text};return{...s,toJSON:()=>s}}function JMn(o){return{type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes,toJSON:()=>({type:"describe",id:o.id,created_at:o.created_at,text:o.text,executes:o.executes.map(s=>s.toJSON())})}}function FIe(o){return{type:"select",id:o.id,selection:o.selection,created_at:o.created_at,toJSON:()=>({type:"select",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function ZMn(o){return{type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection,toJSON:()=>({type:"cancel",id:o.id,created_at:o.created_at,selection:o.selection.toJSON()})}}function $Ie(o){return{type:"execute",protocol:o.operation.protocol,id:o.id,created_at:o.created_at,operation:o.operation,arguments:o.arguments,value:o.value,toJSON:()=>({type:"execute",id:o.id,created_at:o.created_at,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value})}}function tRn(){const o={id:wk(),type:"initialize",created_at:new Date().toISOString()};return{id:o.id,type:o.type,created_at:o.created_at,toJSON:()=>o}}function eRn(o){const s=wk(),p=new Date().toISOString();return{type:"select",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"select",id:s,created_at:p,selection:o.selection.toJSON()}),toHistory:()=>FIe({id:s,created_at:p,selection:o.selection})}}function nRn(o){const s=wk(),p=new Date().toISOString();return{type:"cancel",id:s,created_at:p,selection:o.selection,toJSON:()=>({type:"cancel",id:s,created_at:p,selection:o.selection.toJSON()})}}function rRn(o){const s=new Date().toISOString();return{type:"call",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,toJSON:()=>({type:"call",id:o.id,created_at:s,operation:o.operation.toJSON(),arguments:o.arguments})}}function iRn(o){const s=new Date().toISOString();return{type:"jsonParseError",id:o.id,created_at:s,operation:o.operation,arguments:o.arguments,errorMessage:o.errorMessage}}function aRn(o){const s=new Date().toISOString();return{type:"validate",id:o.id,created_at:s,operation:o.operation,result:o.result,toJSON:()=>({type:"validate",id:o.id,created_at:s,operation:o.operation.toJSON(),result:o.result})}}function bmt(o){const s=wk(),p=new Date().toISOString();return{type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation,arguments:o.arguments,value:o.value,toJSON:()=>({type:"execute",id:s,created_at:p,protocol:o.operation.protocol,operation:o.operation.toJSON(),arguments:o.arguments,value:o.value}),toHistory:()=>$Ie({id:s,created_at:p,...o})}}function sRn(o){const s=wk(),p=new Date().toISOString();return{type:"userMessage",id:s,created_at:p,contents:o.contents,toJSON:()=>({type:"userMessage",id:s,created_at:p,contents:o.contents}),toHistory:()=>BIe({id:s,created_at:p,contents:o.contents})}}function YFt(o){const s=wk(),p=new Date().toISOString();return{type:"assistantMessage",id:s,created_at:p,stream:o.stream,join:o.join,toJSON:()=>({type:"assistantMessage",id:s,created_at:p,done:o.done(),text:o.get()}),toHistory:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get(),toJSON:()=>({type:"assistantMessage",id:s,created_at:p,text:o.get()})})}}function oRn(o){const s=wk(),p=new Date().toISOString();return{type:"describe",id:s,created_at:p,executes:o.executes,stream:o.stream,join:o.join,toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),done:o.done(),text:o.get()}),toHistory:()=>({type:"describe",id:s,created_at:p,executes:o.executes,text:o.get(),toJSON:()=>({type:"describe",id:s,created_at:p,executes:o.executes.map(y=>y.toJSON()),text:o.get()})})}}function cRn(o){const s=wk(),p=new Date().toISOString();return{type:"request",id:s,created_at:p,source:o.source,body:o.body,options:o.options}}var ABt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.0")})(ABt||(ABt={}));var IBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.openapi=="string"&&s.openapi.startsWith("3.1")})(IBt||(IBt={}));var OBt;(function(o){o.is=s=>typeof s=="object"&&s!==null&&typeof s.swagger=="string"&&s.swagger.startsWith("2.0")})(OBt||(OBt={}));var mmt;(function(o){o.reference=s=>s.split("/").filter((p,y)=>!!p.length&&!(y===0&&p==="#")).join(".")})(mmt||(mmt={}));var lC;(function(o){o.take=s=>p=>y=>{const C=s.get(p);if(C)return C;const N=y();return s.set(p,N),N}})(lC||(lC={}));var JF;(function(o){o.variable=s=>o.reserved(s)===!1&&/^[a-zA-Z_$][a-zA-Z_$0-9]*$/g.test(s),o.reserved=s=>uRn.has(s)})(JF||(JF={}));const uRn=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","package","return","super","switch","this","throw","true","try","typeof","var","void","while","with"]);var hC;(function(o){o.cascade=s=>{var C,N;const p=s.schema.$ref.split(s.prefix)[1].split("."),y=p.slice(0,s.escape?p.length:p.length-1).map((L,z,G)=>G.slice(0,z+1).join(".")).map(L=>{var z,G;return{key:L,description:(G=(z=s.components.schemas)==null?void 0:z[L])==null?void 0:G.description}}).reverse().filter((L,z)=>z===0||!!(L!=null&&L.description));if(!(!((C=s.schema.description)!=null&&C.length)&&y.length===0))return[...(N=s.schema.description)!=null&&N.length?[s.schema.description]:[],...y.map((L,z)=>L.description===void 0?`Current Type: {@link ${L.key}}`:`Description of the ${z===0&&s.escape?"current":"parent"} {@link ${L.key}} type:
31
31
 
32
32
  `+L.description.split(`
33
33
  `).map(G=>`> ${G}`).join(`
@@ -1436,7 +1436,7 @@ You have been provided with \`IValidation.IError[][]\` containing **previous his
1436
1436
  - Redesign the entire AST structure using proper architectural patterns
1437
1437
  - Enhance with comprehensive business context and realistic data
1438
1438
 
1439
- **Success means: the error path never appears in future correction cycles.**`};var vDn={};const _Dn=new jIe(()=>{var o;return kIe()?((o=vDn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),xDn=new jIe(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function EDn(o){var y;if(((y=o==null?void 0:o.systemPrompt)==null?void 0:y.common)!==void 0)return o.systemPrompt.common(o);const s=(o==null?void 0:o.locale)??_Dn.get(),p=(o==null?void 0:o.timezone)??xDn.get();return A6.COMMON.replace("${locale}",s).replace("${timezone}",p).replace("${datetime}",new Date().toISOString())}const o$={write:EDn};function TDn(o){return typeof o.initialize=="function"}var ZBt;(o=>{function s(p){return new TextDecoder().decode(p)}o.toUtf8=s})(ZBt||(ZBt={}));function HIe(o,s){return{accepted_prediction_tokens:(o.accepted_prediction_tokens??0)+(s.accepted_prediction_tokens??0),reasoning_tokens:(o.reasoning_tokens??0)+(s.reasoning_tokens??0),rejected_prediction_tokens:(o.rejected_prediction_tokens??0)+(s.rejected_prediction_tokens??0)}}function zIe(o,s){return{audio_tokens:(o.audio_tokens??0)+(s.audio_tokens??0),cached_tokens:(o.cached_tokens??0)+(s.cached_tokens??0)}}function kDn(o,s){return{prompt_tokens:(o.prompt_tokens??0)+(s.prompt_tokens??0),completion_tokens:(o.completion_tokens??0)+(s.completion_tokens??0),total_tokens:(o.total_tokens??0)+(s.total_tokens??0),completion_tokens_details:HIe(o.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0},s.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0}),prompt_tokens_details:zIe(o.prompt_tokens_details??{audio_tokens:0,cached_tokens:0},s.prompt_tokens_details??{audio_tokens:0,cached_tokens:0})}}const SDn={sum:kDn,sumCompletionTokenDetail:HIe,sumPromptTokenDetail:zIe};function CDn(o){const s=o instanceof Uint8Array?ZBt.toUtf8(o):o;return JSON.parse(s)}function UIe(o,s){const p=o.choices;s.choices.forEach(C=>{const N=p[C.index];if(N!=null){p[C.index]=qIe(N,C);return}p[C.index]={index:C.index,finish_reason:C.finish_reason??null,logprobs:C.logprobs??null,message:{tool_calls:C.delta.tool_calls!==void 0?C.delta.tool_calls.reduce((L,z)=>{var G,q;return L[z.index]={id:z.id??"",type:"function",function:{name:((G=z.function)==null?void 0:G.name)??"",arguments:((q=z.function)==null?void 0:q.arguments)??""}},L},[]):void 0,content:C.delta.content??null,refusal:C.delta.refusal??null,role:"assistant"}}});const y=s.usage==null?o.usage:o.usage==null?s.usage:SDn.sum(o.usage,s.usage);return{...o,choices:p,usage:y}}function ADn(o){const s=o[0];if(s===void 0)throw new Error("No chunks received");return o.reduce(UIe,{id:s.id,choices:[],created:s.created,model:s.model,object:"chat.completion",usage:void 0,service_tier:s.service_tier,system_fingerprint:s.system_fingerprint})}function qIe(o,s){var p;if(o.finish_reason==null&&s.finish_reason!=null&&(o.finish_reason=s.finish_reason),o.logprobs==null&&s.logprobs!=null&&(o.logprobs=s.logprobs),s.delta.content!=null&&(o.message.content==null?o.message.content=s.delta.content:o.message.content+=s.delta.content),s.delta.refusal!=null&&(o.message.refusal==null?o.message.refusal=s.delta.refusal:o.message.refusal+=s.delta.refusal),s.delta.tool_calls!=null){(p=o.message).tool_calls??(p.tool_calls=[]);const y=o.message.tool_calls;s.delta.tool_calls.forEach(C=>{var L,z;const N=y[C.index];if(N!=null){y[C.index]=WIe(N,C);return}y[C.index]={id:C.id??"",type:"function",function:{name:((L=C.function)==null?void 0:L.name)??"",arguments:((z=C.function)==null?void 0:z.arguments)??""}}})}return o}function WIe(o,s){return s.function!=null&&(o.function.arguments+=s.function.arguments??"",o.function.name+=s.function.name??""),o.id+=s.id??"",o}const I6={transformCompletionChunk:CDn,accumulate:UIe,merge:ADn,mergeChoice:qIe,mergeToolCalls:WIe};async function IDn(o){const s=o.getReader(),p=[];for(;;){const{done:y,value:C}=await s.read();if(y)break;p.push(C)}return p}async function ODn(o,s,p){const y=o.getReader(),C=Vmt(y);let N=p??null;for await(const L of C){if(N===null){N=L;continue}N=s(N,L)}return N}function NDn(o){return new ReadableStream({start:p=>{p.enqueue(o),p.close()}})}async function*KIe(o){yield o}async function*Vmt(o){for(;;){const{done:s,value:p}=await o.read();if(s)break;yield p}}function PDn(o,s){const p=o.getReader();return new ReadableStream({pull:async y=>{const{done:C,value:N}=await p.read();C?y.close():y.enqueue(s(N))}})}const _C={readAll:IDn,reduce:ODn,from:NDn,transform:PDn};function Xmt(o){return{operation:o.operation,reason:o.reason,toJSON:()=>({operation:o.operation.toJSON(),reason:o.reason})}}function GIe(o,s){const p=o.stack.findIndex(N=>N.operation.name===s.name);if(p===-1)return;const y=o.stack[p];o.stack.splice(p,1);const C=nRn({selection:Xmt({operation:y.operation,reason:s.reason})});o.dispatch(C)}async function LDn(o,s){var z,G,q,et,tt,nt;const p=await o.request("call",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},...((G=(z=o.config)==null?void 0:z.systemPrompt)==null?void 0:G.execute)===null?[]:[{role:"system",content:((tt=(et=(q=o.config)==null?void 0:q.systemPrompt)==null?void 0:et.execute)==null?void 0:tt.call(et,o.histories))??A6.EXECUTE}]],tools:s.map(st=>({type:"function",function:{name:st.name,description:st.function.description,parameters:"separated"in st.function&&st.function.separated!==void 0?st.function.separated.llm??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}}:st.function.parameters}})),tool_choice:"auto"}),y=await _C.readAll(p),C=I6.merge(y),N=[],L=((nt=o.config)==null?void 0:nt.retry)??yk.RETRY;for(const st of C.choices){for(const at of st.message.tool_calls??[])if(at.type==="function"){const Ot=s.find(St=>St.name===at.function.name);if(Ot===void 0)continue;const Dt=await YIe(o,Ot,at,[],L);o.dispatch(Dt),N.push(Dt),TDn(o)&&GIe(o,{name:Dt.operation.name,reason:"completed"})}if(st.message.role==="assistant"&&st.message.content!=null&&st.message.content.length!==0){const at=st.message.content,Ot=YFt({get:()=>at,done:()=>!0,stream:KIe(at),join:async()=>Promise.resolve(at)});o.dispatch(Ot)}}return N}async function YIe(o,s,p,y,C){const N=DDn(s,p);if(o.dispatch(N),N.type==="jsonParseError")return RDn(o,N,y,C-1);const L=s.function.validate(N.arguments);if(L.success===!1){const z=aRn({id:p.id,operation:s,result:L});return o.dispatch(z),MDn(o,N,z,[...y,z],C-1)}return BDn(N,s)}async function MDn(o,s,p,y,C){var N,L,z;return VIe(o,{giveUp:()=>bmt({operation:s.operation,arguments:s.arguments,value:{name:"ValidationError",message:`Invalid arguments. The validation failed after ${yk.RETRY} retries.`,errors:p.result.errors}}),operation:s.operation,toolCall:{id:s.id,arguments:JSON.stringify(s.arguments),result:JSON.stringify(p.result.errors)},systemPrompt:((z=(L=(N=o.config)==null?void 0:N.systemPrompt)==null?void 0:L.validate)==null?void 0:z.call(L,y.slice(0,-1)))??[A6.VALIDATE,...y.length>1?["",A6.VALIDATE_REPEATED.replace("${{HISTORICAL_ERRORS}}",JSON.stringify(y.slice(0,-1).map(G=>G.result.errors)))]:[]].join(`
1439
+ **Success means: the error path never appears in future correction cycles.**`};var vDn={};const _Dn=new jIe(()=>{var o;return kIe()?((o=vDn.LANG)==null?void 0:o.split(".")[0])??"en-US":navigator.language}),xDn=new jIe(()=>Intl.DateTimeFormat().resolvedOptions().timeZone);function EDn(o){var y;if(((y=o==null?void 0:o.systemPrompt)==null?void 0:y.common)!==void 0)return o.systemPrompt.common(o);const s=(o==null?void 0:o.locale)??_Dn.get(),p=(o==null?void 0:o.timezone)??xDn.get();return A6.COMMON.replace("${locale}",s).replace("${timezone}",p).replace("${datetime}",new Date().toISOString())}const o$={write:EDn};function TDn(o){return typeof o.initialize=="function"}var ZBt;(o=>{function s(p){return new TextDecoder().decode(p)}o.toUtf8=s})(ZBt||(ZBt={}));function HIe(o,s){return{accepted_prediction_tokens:(o.accepted_prediction_tokens??0)+(s.accepted_prediction_tokens??0),reasoning_tokens:(o.reasoning_tokens??0)+(s.reasoning_tokens??0),rejected_prediction_tokens:(o.rejected_prediction_tokens??0)+(s.rejected_prediction_tokens??0)}}function zIe(o,s){return{audio_tokens:(o.audio_tokens??0)+(s.audio_tokens??0),cached_tokens:(o.cached_tokens??0)+(s.cached_tokens??0)}}function kDn(o,s){return{prompt_tokens:(o.prompt_tokens??0)+(s.prompt_tokens??0),completion_tokens:(o.completion_tokens??0)+(s.completion_tokens??0),total_tokens:(o.total_tokens??0)+(s.total_tokens??0),completion_tokens_details:HIe(o.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0},s.completion_tokens_details??{accepted_prediction_tokens:0,reasoning_tokens:0,rejected_prediction_tokens:0}),prompt_tokens_details:zIe(o.prompt_tokens_details??{audio_tokens:0,cached_tokens:0},s.prompt_tokens_details??{audio_tokens:0,cached_tokens:0})}}const SDn={sum:kDn,sumCompletionTokenDetail:HIe,sumPromptTokenDetail:zIe};function CDn(o){const s=o instanceof Uint8Array?ZBt.toUtf8(o):o;return JSON.parse(s)}function UIe(o,s){const p=o.choices;s.choices.forEach(C=>{const N=p[C.index];if(N!=null){p[C.index]=qIe(N,C);return}p[C.index]={index:C.index,finish_reason:C.finish_reason??null,logprobs:C.logprobs??null,message:{tool_calls:C.delta.tool_calls!==void 0?C.delta.tool_calls.reduce((L,z)=>{var G,q;return L[z.index]={id:z.id??"",type:"function",function:{name:((G=z.function)==null?void 0:G.name)??"",arguments:((q=z.function)==null?void 0:q.arguments)??""}},L},[]):void 0,content:C.delta.content??null,refusal:C.delta.refusal??null,role:"assistant"}}});const y=s.usage==null?o.usage:o.usage==null?s.usage:SDn.sum(o.usage,s.usage);return{...o,choices:p,usage:y}}function ADn(o){const s=o[0];if(s===void 0)throw new Error("No chunks received");const p=o.reduce(UIe,{id:s.id,choices:[],created:s.created,model:s.model,object:"chat.completion",usage:void 0,service_tier:s.service_tier,system_fingerprint:s.system_fingerprint});return p.choices.forEach(y=>{var C;(C=y.message.tool_calls)==null||C.forEach(N=>{N.function.arguments===""&&(N.function.arguments="{}")})}),p}function qIe(o,s){var p;if(o.finish_reason==null&&s.finish_reason!=null&&(o.finish_reason=s.finish_reason),o.logprobs==null&&s.logprobs!=null&&(o.logprobs=s.logprobs),s.delta.content!=null&&(o.message.content==null?o.message.content=s.delta.content:o.message.content+=s.delta.content),s.delta.refusal!=null&&(o.message.refusal==null?o.message.refusal=s.delta.refusal:o.message.refusal+=s.delta.refusal),s.delta.tool_calls!=null){(p=o.message).tool_calls??(p.tool_calls=[]);const y=o.message.tool_calls;s.delta.tool_calls.forEach(C=>{var L,z;const N=y[C.index];if(N!=null){y[C.index]=WIe(N,C);return}y[C.index]={id:C.id??"",type:"function",function:{name:((L=C.function)==null?void 0:L.name)??"",arguments:((z=C.function)==null?void 0:z.arguments)??""}}})}return o}function WIe(o,s){return s.function!=null&&(o.function.arguments+=s.function.arguments??"",o.function.name+=s.function.name??""),o.id+=s.id??"",o}const I6={transformCompletionChunk:CDn,accumulate:UIe,merge:ADn,mergeChoice:qIe,mergeToolCalls:WIe};async function IDn(o){const s=o.getReader(),p=[];for(;;){const{done:y,value:C}=await s.read();if(y)break;p.push(C)}return p}async function ODn(o,s,p){const y=o.getReader(),C=Vmt(y);let N=p??null;for await(const L of C){if(N===null){N=L;continue}N=s(N,L)}return N}function NDn(o){return new ReadableStream({start:p=>{p.enqueue(o),p.close()}})}async function*KIe(o){yield o}async function*Vmt(o){for(;;){const{done:s,value:p}=await o.read();if(s)break;yield p}}function PDn(o,s){const p=o.getReader();return new ReadableStream({pull:async y=>{const{done:C,value:N}=await p.read();C?y.close():y.enqueue(s(N))}})}const _C={readAll:IDn,reduce:ODn,from:NDn,transform:PDn};function Xmt(o){return{operation:o.operation,reason:o.reason,toJSON:()=>({operation:o.operation.toJSON(),reason:o.reason})}}function GIe(o,s){const p=o.stack.findIndex(N=>N.operation.name===s.name);if(p===-1)return;const y=o.stack[p];o.stack.splice(p,1);const C=nRn({selection:Xmt({operation:y.operation,reason:s.reason})});o.dispatch(C)}async function LDn(o,s){var z,G,q,et,tt,nt;const p=await o.request("call",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},...((G=(z=o.config)==null?void 0:z.systemPrompt)==null?void 0:G.execute)===null?[]:[{role:"system",content:((tt=(et=(q=o.config)==null?void 0:q.systemPrompt)==null?void 0:et.execute)==null?void 0:tt.call(et,o.histories))??A6.EXECUTE}]],tools:s.map(st=>({type:"function",function:{name:st.name,description:st.function.description,parameters:"separated"in st.function&&st.function.separated!==void 0?st.function.separated.llm??{type:"object",properties:{},required:[],additionalProperties:!1,$defs:{}}:st.function.parameters}})),tool_choice:"auto"}),y=await _C.readAll(p),C=I6.merge(y),N=[],L=((nt=o.config)==null?void 0:nt.retry)??yk.RETRY;for(const st of C.choices){for(const at of st.message.tool_calls??[])if(at.type==="function"){const Ot=s.find(St=>St.name===at.function.name);if(Ot===void 0)continue;const Dt=await YIe(o,Ot,at,[],L);o.dispatch(Dt),N.push(Dt),TDn(o)&&GIe(o,{name:Dt.operation.name,reason:"completed"})}if(st.message.role==="assistant"&&st.message.content!=null&&st.message.content.length!==0){const at=st.message.content,Ot=YFt({get:()=>at,done:()=>!0,stream:KIe(at),join:async()=>Promise.resolve(at)});o.dispatch(Ot)}}return N}async function YIe(o,s,p,y,C){const N=DDn(s,p);if(o.dispatch(N),N.type==="jsonParseError")return RDn(o,N,y,C-1);const L=s.function.validate(N.arguments);if(L.success===!1){const z=aRn({id:p.id,operation:s,result:L});return o.dispatch(z),MDn(o,N,z,[...y,z],C-1)}return BDn(N,s)}async function MDn(o,s,p,y,C){var N,L,z;return VIe(o,{giveUp:()=>bmt({operation:s.operation,arguments:s.arguments,value:{name:"ValidationError",message:`Invalid arguments. The validation failed after ${yk.RETRY} retries.`,errors:p.result.errors}}),operation:s.operation,toolCall:{id:s.id,arguments:JSON.stringify(s.arguments),result:JSON.stringify(p.result.errors)},systemPrompt:((z=(L=(N=o.config)==null?void 0:N.systemPrompt)==null?void 0:L.validate)==null?void 0:z.call(L,y.slice(0,-1)))??[A6.VALIDATE,...y.length>1?["",A6.VALIDATE_REPEATED.replace("${{HISTORICAL_ERRORS}}",JSON.stringify(y.slice(0,-1).map(G=>G.result.errors)))]:[]].join(`
1440
1440
  `),life:C,previousValidationErrors:y})}async function RDn(o,s,p,y){var C,N,L;return VIe(o,{giveUp:()=>bmt({operation:s.operation,arguments:{},value:{name:"JsonParseError",message:`Invalid JSON format. The parsing failed after ${yk.RETRY} retries.`,arguments:s.arguments,errorMessage:s.errorMessage}}),operation:s.operation,toolCall:{id:s.id,arguments:s.arguments,result:s.errorMessage},systemPrompt:((L=(N=(C=o.config)==null?void 0:C.systemPrompt)==null?void 0:N.jsonParseError)==null?void 0:L.call(N,s))??A6.JSON_PARSE_ERROR.replace("${{ERROR_MESSAGE}}",s.errorMessage),life:y,previousValidationErrors:p})}function DDn(o,s){try{const p=JSON.parse(s.function.arguments);return rRn({id:s.id,operation:o,arguments:p})}catch(p){return iRn({id:s.id,operation:o,arguments:s.function.arguments,errorMessage:p instanceof Error?p.message:String(p)})}}async function VIe(o,s){var L,z,G,q,et,tt;if(s.life<=0)return s.giveUp();const p=await o.request("call",{messages:[{role:"system",content:o$.write(o.config)},...o.histories.map(a$).flat(),{role:"user",content:o.prompt.contents.map(s$)},{role:"system",content:((G=(z=(L=o.config)==null?void 0:L.systemPrompt)==null?void 0:z.execute)==null?void 0:G.call(z,o.histories))??A6.EXECUTE},{role:"assistant",tool_calls:[{type:"function",id:s.toolCall.id,function:{name:s.operation.name,arguments:s.toolCall.arguments}}]},{role:"tool",content:s.toolCall.result,tool_call_id:s.toolCall.id},{role:"system",content:s.systemPrompt}],tools:[{type:"function",function:{name:s.operation.name,description:s.operation.function.description,parameters:"separated"in s.operation.function&&s.operation.function.separated!==void 0?((q=s.operation.function.separated)==null?void 0:q.llm)??{$defs:{},type:"object",properties:{},additionalProperties:!1,required:[]}:s.operation.function.parameters}}],tool_choice:"required"}),y=await _C.readAll(p),N=(tt=(et=I6.merge(y).choices[0])==null?void 0:et.message.tool_calls)==null?void 0:tt.find(nt=>nt.function.name===s.operation.name);return N===void 0?s.giveUp():YIe(o,s.operation,N,s.previousValidationErrors,s.life)}async function BDn(o,s){try{const p=await(async()=>{switch(s.protocol){case"class":return FDn(o,s);case"http":return $Dn(o,s);case"mcp":return jDn(o,s);default:throw new Error("Unknown protocol")}})();return bmt({operation:o.operation,arguments:o.arguments,value:p})}catch(p){return bmt({operation:o.operation,arguments:o.arguments,value:p instanceof Error?{...p,name:p.name,message:p.message}:p})}}async function FDn(o,s){const p=s.controller.execute;return typeof p=="function"?await p({application:s.controller.application,function:s.function,arguments:o.arguments}):await p[s.function.name](o.arguments)}async function $Dn(o,s){const p=s.controller.execute;return typeof p=="function"?await p({connection:s.controller.connection,application:s.controller.application,function:s.function,arguments:o.arguments}):await JBt.propagate({connection:s.controller.connection,application:s.controller.application,function:s.function,input:o.arguments})}async function jDn(o,s){return s.controller.client.callTool({method:s.function.name,name:s.function.name,arguments:o.arguments}).then(p=>p.content)}var VFt={};Object.defineProperty(VFt,"__esModule",{value:!0});var c$=VFt._validateReport=void 0;const HDn=o=>{const s=p=>{if(o.length===0)return!0;const y=o[o.length-1].path;return p.length>y.length||y.substring(0,p.length)!==p};return(p,y)=>{var C;return p&&s(y.path)&&(y.value===void 0&&((C=y.description)!==null&&C!==void 0||(y.description=["The value at this path is `undefined`.","",`Please fill the \`${y.expected}\` typed value next time.`].join(`
1441
1441
  `))),o.push(y)),!1}};c$=VFt._validateReport=HDn;const UDt={functions:[{name:"cancelFunctions",parameters:{description:` Properties of the function
1442
1442