"use strict";(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[3513],{33513:(e,t,i)=>{i.r(t),i.d(t,{default:()=>u});var n=i(66845),l=i(81354),s=i(27446),a=i(9003),r=i(63730),d=i(66694),o=i(40864);const u=function(e){const{disabled:t,element:i,widgetMgr:u,width:c,endpoints:b,fragmentId:h}=e,p={width:c},{libConfig:{enforceDownloadInNewTab:w=!1}}=n.useContext(d.E),f="primary"===i.type?l.nW.PRIMARY:l.nW.SECONDARY,g=!i.help||c;return(0,o.jsx)("div",{className:"row-widget stDownloadButton","data-testid":"stDownloadButton",style:p,children:(0,o.jsx)(s.t,{help:i.help,children:(0,o.jsx)(a.ZP,{kind:f,size:l.V5.SMALL,disabled:t,onClick:()=>{u.setTriggerValue(i,{fromUi:!0},h);const e=function(e,t,i){const n=document.createElement("a"),l=e.buildMediaURL(t);return n.setAttribute("href",l),i?n.setAttribute("target","_blank"):n.setAttribute("target","_self"),n.setAttribute("download",""),n}(b,i.url,w);e.click()},fluidWidth:!!i.useContainerWidth&&g,children:(0,o.jsx)(r.ZP,{source:i.label,allowHTML:!1,isLabel:!0,largerLabel:!0,disableLinks:!0})})})})}}}]);