"use client"
import{a as m}from"./chunk-NWME2ANF.mjs";import{j as n}from"./chunk-J746XYVQ.mjs";import*as t from"@radix-ui/react-dialog";import{useRouter as y}from"next/navigation";import{Drawer as r}from"vaul";import{jsx as o,jsxs as i}from"react/jsx-runtime";function C({children:l,className:d,showModal:s,setShowModal:a,onClose:p,desktopOnly:f,preventDefaultClose:g,drawerRootProps:u}){let b=y(),c=({dragged:e}={})=>{g&&!e||(p&&p(),a?a(!1):b.back())},{isMobile:D}=m();return D&&!f?o(r.Root,{open:a?s:!0,onOpenChange:e=>{e||c({dragged:!0})},...u,children:i(r.Portal,{children:[o(r.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),i(r.Content,{className:n("fixed bottom-0 left-0 right-0 z-50 rounded-t-[10px] border-t border-gray-200 bg-white",d),children:[o("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:o("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),l]}),o(r.Overlay,{})]})}):o(t.Root,{open:a?s:!0,onOpenChange:e=>{e||c()},children:i(t.Portal,{children:[o(t.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),o(t.Content,{onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>e.preventDefault(),className:n("animate-scale-in fixed inset-0 z-40 m-auto max-h-fit w-full max-w-md overflow-hidden border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl",d),children:l})]})})}export{C as a};
