import{o as e}from"./rolldown-runtime.C0FnF6B9.js";import{r as t}from"./emotion-is-prop-valid.esm.CuYlOKOk.js";import{i as n}from"./emotion-styled.browser.esm.BYv_Qzcq.js";import{i as r}from"./Tooltip.CcubhKj6.js";import{n as i,t as a}from"./styled-components.BjKbfR5p.js";import{t as o}from"./BaseButton.eTlHCX_j.js";import{t as s}from"./BaseButtonTooltip.B83DZSNb.js";import{i as c,t as l}from"./DynamicButtonLabel.BTjDBnmI.js";import{t as u}from"./useResolvedWrap.DnjqnyWR.js";import{t as d}from"./iconPosition.DwITqWdC.js";var f=e(t(),1);function p(e){let{disabled:t,element:p,widgetMgr:m,fragmentId:h}=e,g=p.shortcut?p.shortcut:void 0,_=u(p.wrap),v=!_&&!p.help,y=a.SECONDARY;p.type===`primary`?y=a.PRIMARY:p.type===`tertiary`&&(y=a.TERTIARY);let b=(0,f.useCallback)(()=>{t||m.setTriggerValue(p,{fromUi:!0},h)},[t,m,p,h]);return c({shortcut:g,disabled:t,onActivate:b}),n(r,{className:`stButton`,"data-testid":`stButton`,children:n(s,{help:p.help,containerWidth:!0,children:n(o,{kind:y,size:i.SMALL,disabled:t,containerWidth:!0,onClick:b,children:n(l,{icon:p.icon,iconPosition:d(p.iconPosition),label:p.label,shortcut:g,wrap:_,addTitleTooltip:v})})})})}var m=(0,f.memo)(p);export{m as default};