import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i}from"./dist-DtfJeYQK.js";import{t as a}from"./jsx-runtime-C2wGStra.js";import{n as o,t as s}from"./dist-Cc1j9Pjk.js";import{l as c,u as l}from"./DialogCloseButton-DhTvKFyC.js";import{n as u,t as d}from"./useBreakpointMatch-CmOkxQJ1.js";var f,p,m,h=t((()=>{f=e(n(),1),i(),l(),s(),p=a(),m=({children:e,className:t,dataset:n,...i})=>{let a=(0,f.useRef)(null),s=(0,f.useRef)(null),l=[c.footer,t].filter(Boolean).join(` `),u=r(n,{preplyDsComponent:o.DialogFooter});return(0,f.useLayoutEffect)(()=>{if(!s.current||!a.current)return;let e=s.current,t=a.current,n=null,r=()=>{n?.disconnect(),n=new IntersectionObserver(([t])=>{e.toggleAttribute(`data-sticky`,!t.isIntersecting)},{root:e.closest(`[role=dialog]`),rootMargin:`0px 0px -${e.offsetHeight}px 0px`}),n.observe(t)};r();let i=new ResizeObserver(()=>{r()});return i.observe(e),()=>{n?.disconnect(),i.disconnect()}},[]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:c.scrollEndDetector,ref:a}),(0,p.jsx)(`footer`,{className:l,ref:s,...u,...i,children:e})]})};try{m.displayName=`DialogFooter`,m.__docgenInfo={description:``,displayName:`DialogFooter`,props:{dataset:{defaultValue:null,description:`@deprecated Pass data attributes as regular props instead
@example <DialogFooter data-testid="dialog-footer">...</DialogFooter>`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}})),g,_,v,y=t((()=>{g=e(n(),1),l(),s(),i(),d(),_=a(),v=(0,g.forwardRef)(function({children:e,className:t,dataset:n,...i},a){let s=[c.buttonStack,t].filter(Boolean).join(` `),l=r(n),d=u(`narrow-l`);return(0,_.jsx)(`div`,{ref:a,className:s,"data-preply-ds-component":o.DialogButtonStack,"data-horizontal-layout":d?``:void 0,...l,...i,children:e})});try{v.displayName=`DialogButtonStack`,v.__docgenInfo={description:``,displayName:`DialogButtonStack`,props:{dataset:{defaultValue:null,description:`@deprecated Pass data attributes as regular props instead
@example <DialogButtonStack data-testid="dialog-button-stack">...</DialogButtonStack>`,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}})),b,x,S,C=t((()=>{b=e(n(),1),h(),y(),x=a(),S=({primaryButton:e,secondaryButton:t})=>(0,x.jsx)(m,{children:(0,x.jsxs)(v,{children:[t,(0,x.jsx)(`div`,{style:{display:`contents`},onClick:(0,b.useCallback)(e=>{e.currentTarget.closest(`[role=dialog]`)?.toggleAttribute(`data-slides-up`,!0)},[]),children:e})]})});try{S.displayName=`DialogActions`,S.__docgenInfo={description:``,displayName:`DialogActions`,props:{primaryButton:{defaultValue:null,description:`Primary action button.
@example <DialogActions
 primaryButton={<Button size="medium" variant="primary" onClick={() => {}}>Let's go</Button>}
/>`,name:`primaryButton`,required:!0,type:{name:`enum`,value:[{value:`undefined`},{value:`null`},{value:`string`},{value:`number`},{value:`false`},{value:`true`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`},{value:`Iterable<ReactNode>`},{value:`ReactPortal`}]}},secondaryButton:{defaultValue:null,description:`Secondary action button.
@example <DialogActions
 secondaryButton={<Button size="medium" variant="tertiary" onClick={() => {}}>Cancel</Button>}
/>`,name:`secondaryButton`,required:!1,type:{name:`enum`,value:[{value:`null`},{value:`string`},{value:`number`},{value:`false`},{value:`true`},{value:`ReactElement<any, string | JSXElementConstructor<any>>`},{value:`Iterable<ReactNode>`},{value:`ReactPortal`}]}}}}}catch{}}));export{m as a,y as i,C as n,h as o,v as r,S as t};