"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
var _chunkRFAFE6LMcjs = require('./chunk-RFAFE6LM.cjs');var _chunkIW3D5V6Lcjs = require('./chunk-IW3D5V6L.cjs');var _chunk5KRCPBZRcjs = require('./chunk-5KRCPBZR.cjs');var _chunk3CNSKST2cjs = require('./chunk-3CNSKST2.cjs');var _chunk5NXYDZPPcjs = require('./chunk-5NXYDZPP.cjs');var _react = require('react');var _clsx = require('clsx'); var _clsx2 = _interopRequireDefault(_clsx);var R=_chunk3CNSKST2cjs.a.call(void 0, "EulPopover",["root","anchor","content","open"]),h=e=>_chunk5KRCPBZRcjs.e.call(void 0, "EulPopover",{anchor:["anchor"],content:["content"],root:["root",e.open&&"open"]}),S= exports.a =R;var _jsxruntime = require('react/jsx-runtime');var p=_react.forwardRef.call(void 0, (e,E)=>{let{children:t,content:o,id:x,isPanel:T,open:l,placement:k}=e,[a,N]=_react.useState.call(void 0, null),w=_chunk5KRCPBZRcjs.i.call(void 0, t.props.ref,N,E),[c,m]=_react.useState.call(void 0, !1),B=()=>{m(!0),_optionalChain([e, 'access', _ => _.onOpen, 'optionalCall', _2 => _2()])},A=()=>{m(!1),_optionalChain([e, 'access', _3 => _3.onClose, 'optionalCall', _4 => _4()])},r=h({open:c}),L=t&&_react.cloneElement.call(void 0, t,{...t.props,className:_clsx2.default.call(void 0, t.props.className,r.anchor),key:"popover-child",onClick:B,ref:w}),O=o&&_react.isValidElement.call(void 0, o)?_react.cloneElement.call(void 0, o,{...o.props,className:_clsx2.default.call(void 0, o.props.className,r.content),key:"popover-content"}):o;return _jsxruntime.jsx.call(void 0, _chunkIW3D5V6Lcjs.a,{onClickAway:A,children:_jsxruntime.jsx.call(void 0, _chunk5NXYDZPPcjs.s,{className:_clsx2.default.call(void 0, r.root),children:_jsxruntime.jsx.call(void 0, _chunkRFAFE6LMcjs.b,{anchorEl:a,content:O,id:x,isPanel:T,open:(typeof l<"u"?l:c)&&Boolean(a),placement:k,children:L})})})});p.displayName="Popover";p.defaultProps={placement:"bottom",touchDelay:700,touchEndDelay:1500};var M=p;exports.a = S; exports.b = M;
