import{K as n,j as r,C as o,N as e,k as a,l as t,m as i,n as l,o as c,t as u,u as s,f}from"../../vendor.js";import{forwardRef as p,useRef as d,useImperativeHandle as v,useMemo as m}from"react";import"react-popper";import"react-dom";import{u as h}from"../../hooks.js";import{I as j}from"../Icon/index.js";var k=["className","option","renderIcon","draggable","name","onClick"];function x(n,r){var o=u(n);if(s){var e=s(n);r&&(e=f(e).call(e,(function(r){return c(n,r).enumerable}))),o.push.apply(o,e)}return o}function b(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?x(Object(o),!0).forEach((function(r){a(n,r,o[r])})):t?i(n,t(o)):x(Object(o)).forEach((function(r){l(n,r,c(o,r))}))}return n}var g=p((function(a,t){var i,l=a.className,c=a.option,u=a.renderIcon,s=a.draggable,f=a.name,p=a.onClick,x=n(a,k),g=h().oakRef,O=d(),C=d();v(t,(function(){return{isOak:!0,innerRef:O,tooltipRef:C}}),[O.current]);var I=m((function(){return{modifiers:[{name:"preventOverflow",enabled:!0,options:{boundary:null==g?void 0:g.current}}]}}),[]),N=r.exports.jsx("a",b(b({},x),{},{onClick:function(n){var r;null===(r=C.current)||void 0===r||r.close(),null==p||p(n)},ref:O,href:"#",draggable:null!=s&&s,className:o("oak-option",l),children:u?null==u?void 0:u():"function"==typeof(null==c?void 0:c.icon)?null==c||null===(i=c.icon)||void 0===i?void 0:i.call(c):r.exports.jsx(j,{children:null==c?void 0:c.icon})}));return f?r.exports.jsx(e,{container:(null==g?void 0:g.current)||".oak",ref:function(n){var r;C.current=n,O.current=null==n||null===(r=n.innerRef)||void 0===r?void 0:r.current},popperOptions:I,text:f,children:N}):N}));export{g as O};
//# sourceMappingURL=index.js.map
