import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{i as n}from"./emotion-styled.browser.esm.C7ab1lZK.js";import{i as r}from"./Tooltip.DJg7muty.js";import{n as i,t as a}from"./styled-components.BQZommyC.js";import{t as o}from"./BaseButton.CD99a2NM.js";import{t as s}from"./BaseButtonTooltip.9ZCtkLEj.js";import{i as c,t as l}from"./DynamicButtonLabel.BZWdvyzO.js";import{t as u}from"./iconPosition.C4GDw890.js";var d=e(t(),1);function f(e){let{disabled:t,element:f,widgetMgr:p,fragmentId:m}=e,h=f.shortcut?f.shortcut:void 0,g=a.SECONDARY;f.type===`primary`?g=a.PRIMARY:f.type===`tertiary`&&(g=a.TERTIARY);let _=(0,d.useCallback)(()=>{t||p.setTriggerValue(f,{fromUi:!0},m)},[t,p,f,m]);return c({shortcut:h,disabled:t,onActivate:_}),n(r,{className:`stButton`,"data-testid":`stButton`,children:n(s,{help:f.help,containerWidth:!0,children:n(o,{kind:g,size:i.SMALL,disabled:t,containerWidth:!0,onClick:_,children:n(l,{icon:f.icon,iconPosition:u(f.iconPosition),label:f.label,shortcut:h})})})})}var p=(0,d.memo)(f);export{p as default};