import{d as k,ai as C,T as S,B as s,g as E,z as f}from"./app-D7zH3Nl5.js";import{K as c}from"./useFlexGapSupport-CpBR-RD-.js";var _=function(t,i){var l={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(l[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,e=Object.getOwnPropertySymbols(t);o<e.length;o++)i.indexOf(e[o])<0&&Object.prototype.propertyIsEnumerable.call(t,e[o])&&(l[e[o]]=t[e[o]]);return l};const h={border:0,background:"transparent",padding:0,lineHeight:"inherit",display:"inline-block"},B=k({compatConfig:{MODE:3},name:"TransButton",inheritAttrs:!1,props:{noStyle:{type:Boolean,default:void 0},onClick:Function,disabled:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0}},setup(t,i){let{slots:l,emit:e,attrs:o,expose:y}=i;const a=C(),p=n=>{const{keyCode:r}=n;r===c.ENTER&&n.preventDefault()},b=n=>{const{keyCode:r}=n;r===c.ENTER&&e("click",n)},m=n=>{e("click",n)},u=()=>{a.value&&a.value.focus()},v=()=>{a.value&&a.value.blur()};return S(()=>{t.autofocus&&u()}),y({focus:u,blur:v}),()=>{var n;const{noStyle:r,disabled:O}=t,g=_(t,["noStyle","disabled"]);let d={};return r||(d=s({},h)),O&&(d.pointerEvents="none"),E("div",f(f(f({role:"button",tabindex:0,ref:a},g),o),{},{onClick:m,onKeydown:p,onKeyup:b,style:s(s({},d),o.style||{})}),[(n=l.default)===null||n===void 0?void 0:n.call(l)])}}});export{B as T};
