"use client";
import{b as C}from"./chunk-WYBGEMUR.js";import{a as u}from"./chunk-BIJFRG3P.js";import{e as d,i as P}from"./chunk-TERSEXPI.js";import{a as f}from"./chunk-QKAMOL6D.js";import{s as i}from"./chunk-KEPQUAOX.js";import{cloneElement as v,forwardRef as H,isValidElement as M,useState as y}from"react";import r from"clsx";var S=f("EulPopover",["root","anchor","content","open"]),h=e=>d("EulPopover",{anchor:["anchor"],content:["content"],root:["root",e.open&&"open"]}),D=S;import{jsx as n}from"react/jsx-runtime";var l=H((e,E)=>{let{children:t,className:x,content:o,id:N,isPanel:T,open:p,placement:k}=e,[a,w]=y(null),[c,m]=y(!1),B=P(t.props.ref,w,E),s=h({open:c}),A=()=>{m(!0),e.onOpen?.()},L=()=>{m(!1),e.onClose?.()},O=t&&v(t,{...t.props,className:r(t.props.className,s.anchor),key:"popover-child",onClick:A,ref:B}),R=o&&M(o)?v(o,{...o.props,className:r(o.props.className,s.content),key:"popover-content"}):o;return n(u,{onClickAway:L,children:n(i,{className:r(s.root),children:n(C,{anchorEl:a,className:x,content:R,id:N,isPanel:T,open:(typeof p<"u"?p:c)&&Boolean(a),placement:k,children:O})})})});l.displayName="Popover";l.defaultProps={placement:"bottom",touchDelay:700,touchEndDelay:1500};var b=l;export{D as a,b};
