"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[583],{10583:(o,r,e)=>{e.r(r),e.d(r,{default:()=>h});e(58878);var i=e(84720),t=e(98350),l=e(88987),a=e(89653),s=e(32735);function d(o,r){switch(o){case i.Pj.XSMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.sm}`,fontSize:r.fontSizes.sm};case i.Pj.SMALL:return{padding:`${r.spacing.twoXS} ${r.spacing.md}`};case i.Pj.LARGE:return{padding:`${r.spacing.md} ${r.spacing.md}`};default:return{padding:`${r.spacing.xs} ${r.spacing.md}`}}}const n=(0,a.A)("a",{target:"e16zdaao2"})((o=>{let{fluidWidth:r,size:e,theme:i}=o;const t="number"==typeof r?`${r}px`:"100%";return{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:i.fontWeights.normal,padding:`${i.spacing.xs} ${i.spacing.md}`,borderRadius:i.radii.default,minHeight:i.sizes.minElementHeight,margin:0,lineHeight:i.lineHeights.base,color:i.colors.primary,textDecoration:"none",width:r?t:"auto",userSelect:"none","&:visited":{color:i.colors.primary},"&:focus":{outline:"none"},"&:focus-visible":{boxShadow:`0 0 0 0.2rem ${(0,s.No)(i.colors.primary,.5)}`},"&:hover":{textDecoration:"none"},"&:active":{textDecoration:"none"},...d(e,i)}}),""),c=(0,a.A)(n,{target:"e16zdaao1"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.primary,color:r.colors.white,border:`${r.sizes.borderWidth} solid ${r.colors.primary}`,"&:hover":{backgroundColor:(0,s.e$)(r.colors.primary,.05),color:r.colors.white},"&:active":{backgroundColor:"transparent",color:r.colors.primary},"&:visited:not(:active)":{color:r.colors.white},"&[disabled], &[disabled]:hover, &[disabled]:active, &[disabled]:visited":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),""),u=(0,a.A)(n,{target:"e16zdaao0"})((o=>{let{theme:r}=o;return{backgroundColor:r.colors.lightenedBg05,color:r.colors.bodyText,border:`${r.sizes.borderWidth} solid ${r.colors.borderColor}`,"&:visited":{color:r.colors.bodyText},"&:hover":{borderColor:r.colors.primary,color:r.colors.primary},"&:active":{color:r.colors.white,borderColor:r.colors.primary,backgroundColor:r.colors.primary},"&:focus:not(:active)":{borderColor:r.colors.primary,color:r.colors.primary},"&[disabled], &[disabled]:hover, &[disabled]:active":{borderColor:r.colors.borderColor,backgroundColor:r.colors.transparent,color:r.colors.fadedText40,cursor:"not-allowed"}}}),"");var p=e(90782);const b=function(o){let{kind:r,size:e,disabled:t,fluidWidth:l,children:a,autoFocus:s,href:d,rel:n,target:b,onClick:h}=o,g=c;return r===i.KX.SECONDARY&&(g=u),(0,p.jsx)(g,{kind:r,size:e||i.Pj.MEDIUM,fluidWidth:l||!1,disabled:t||!1,autoFocus:s||!1,href:d,target:b,rel:n,onClick:h,tabIndex:t?-1:0,children:a})};const h=function(o){const{disabled:r,element:e,width:a}=o,s={width:a},d="primary"===e.type?i.KX.PRIMARY:i.KX.SECONDARY,n=!e.help||a;return(0,p.jsx)("div",{className:"stLinkButton","data-testid":"stLinkButton",style:s,children:(0,p.jsx)(t.F,{help:e.help,children:(0,p.jsx)(b,{kind:d,size:i.Pj.SMALL,disabled:r,onClick:r=>{o.disabled&&r.preventDefault()},fluidWidth:!!e.useContainerWidth&&n,href:e.url,target:"_blank",rel:"noreferrer","aria-disabled":r,children:(0,p.jsx)(l.Y,{icon:e.icon,label:e.label})})})})}}}]);