var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(t,r,a)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,s=(e,t)=>{for(var r in t||(t={}))n.call(t,r)&&l(e,r,t[r]);if(a)for(var r of a(t))o.call(t,r)&&l(e,r,t[r]);return e},i=(e,a)=>t(e,r(a)),c=(e,t)=>{var r={};for(var l in e)n.call(e,l)&&t.indexOf(l)<0&&(r[l]=e[l]);if(null!=e&&a)for(var l of a(e))t.indexOf(l)<0&&o.call(e,l)&&(r[l]=e[l]);return r};import{r as p,j as m}from"./vendor.3b6f54f7.js";var u="_spining_4i8sg_1";const{useState:b}=m;function d({children:e}){return p.exports.createElement("span",{className:u},e)}const h={right:10,bottom:10},f=e=>{var t=e,{children:r}=t,a=c(t,["children"]);return p.exports.createElement("button",i(s({type:"button"},a),{className:"rtf--ab"}),r)},x=e=>{var t=e,{children:r}=t,a=c(t,["children"]);return p.exports.createElement("button",s({type:"button",className:"rtf--mb"},a),r)},y={bottom:24,right:24},v=e=>{var t=e,{event:r="hover",style:a=y,alwaysShowTitle:n=!1,children:o,icon:l,mainButtonStyles:m,onClick:u,text:d}=t,h=c(t,["event","style","alwaysShowTitle","children","icon","mainButtonStyles","onClick","text"]);const[f,v]=b(!1),E=n||!f,g=()=>v(!0),w=()=>v(!1);return p.exports.createElement("ul",s({onMouseEnter:()=>"hover"===r&&g(),onMouseLeave:()=>"hover"===r&&w(),className:"rtf "+(f?"open":"closed"),"data-testid":"fab",style:a},h),p.exports.createElement("li",{className:"rtf--mb__c"},p.exports.createElement(x,{onClick:e=>u?u(e):(e.persist(),"click"===r?f?w():g():null),style:m,"data-testid":"main-button",role:"button","aria-label":"Floating menu",tabIndex:0},l),d&&p.exports.createElement("span",{className:`${"right"in a?"right":""} ${n?"always-show":""}`,"aria-hidden":E},d),p.exports.createElement("ul",null,p.exports.Children.map(o,((e,t)=>p.exports.isValidElement(e)?p.exports.createElement("li",{className:"rtf--ab__c "+("top"in a?"top":"")},p.exports.cloneElement(e,i(s({"data-testid":`action-button-${t}`,"aria-label":e.props.text||`Menu button ${t+1}`,"aria-hidden":E,tabIndex:f?0:-1},e.props),{onClick:t=>{e.props.onClick&&((e,t)=>{e.persist(),v(!1),setTimeout((()=>{t(e)}),1)})(t,e.props.onClick)}})),e.props.text&&p.exports.createElement("span",{className:`${"right"in a?"right":""} ${n?"always-show":""}`,"aria-hidden":E},e.props.text)):null)))))};export{f as A,v as F,d as I,h as p};
