const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-dom-CwaHFgt6.js","assets/codemirror-core-vkcnXJgD.js","assets/react-dom-Cfkhaq8h.css"])))=>i.map(i=>d[i]);
import{L as H,_ as L,T as h,S as U,b as w,g as B}from"./index-BCSjj6Us.js";import{h as s,j as e}from"./codemirror-core-vkcnXJgD.js";import{p as F,q as b,L as j,m as C,i as _,A as V,v as q}from"./react-dom-CwaHFgt6.js";import{g as z}from"./chunk-WQVQ7P2I-DGUjpusB.js";import{p as G}from"./chunk-FGM523TA-BJSiCD_V.js";import{g as J}from"./chunk-KVDW62ZT-CicaeoN1.js";var[K,$]=H({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),y=()=>L(()=>import("./react-dom-CwaHFgt6.js").then(t=>t.bg),__vite__mapDeps([0,1,2])).then(t=>t.default),A=t=>{const{as:a,children:i,className:p,...o}=t,{Component:l,placement:r,backdrop:n,motionProps:v,disableAnimation:c,getPopoverProps:f,getDialogProps:d,getBackdropProps:m,getContentProps:u,isNonModal:I,onClose:g}=$(),x=s.useRef(null),{dialogProps:N,titleProps:M}=F({},x),O=d({ref:x,...N,...o}),D=a||l||"div",P=e.jsxs(e.Fragment,{children:[!I&&e.jsx(b,{onDismiss:g}),e.jsx(D,{...O,children:e.jsx("div",{...u({className:p}),children:typeof i=="function"?i(M):i})}),e.jsx(b,{onDismiss:g})]}),E=s.useMemo(()=>n==="transparent"?null:c?e.jsx("div",{...m()}):e.jsx(j,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"exit",variants:h.fade,...m()})}),[n,c,m]),S=r?z(r==="center"?"top":r):void 0,k=e.jsx(e.Fragment,{children:c?P:e.jsx(j,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"initial",style:S,variants:h.scaleSpringOpacity,...v,children:P})})});return e.jsxs("div",{...f(),children:[E,k]})};A.displayName="HeroUI.PopoverContent";var oe=A,R=t=>{var a;const{triggerRef:i,getTriggerProps:p}=$(),{children:o,...l}=t,r=s.useMemo(()=>typeof o=="string"?e.jsx("p",{children:o}):s.Children.only(o),[o]),n=(a=r.props.ref)!=null?a:r.ref,{onPress:v,isDisabled:c,...f}=s.useMemo(()=>p(_(l,r.props),n),[p,r.props,l,n]),[,d]=G(o,w),{buttonProps:m}=U({onPress:v,isDisabled:c},i),u=s.useMemo(()=>(d==null?void 0:d[0])!==void 0,[d]);return s.cloneElement(r,_(f,u?{onPress:v,isDisabled:c}:m))};R.displayName="HeroUI.PopoverTrigger";var re=R,T=B((t,a)=>{const{children:i,...p}=t,o=J({...p,ref:a}),[l,r]=s.Children.toArray(i),n=e.jsx(q,{portalContainer:o.portalContainer,children:r});return e.jsxs(K,{value:o,children:[l,o.disableAnimation&&o.isOpen?n:e.jsx(V,{children:o.isOpen?n:null})]})});T.displayName="HeroUI.Popover";var te=T;export{re as a,oe as b,te as p};
