import{B as e,E as t,F as n,H as r,It as i,Mt as a,Q as o,T as s,W as c,Z as l,_t as u,at as d,d as f,ft as p,g as m,ht as h,i as g,jt as _,mt as v,ot as y,pt as b,s as x,st as S,t as ee,x as C}from"./BA99CCI5.js";import"./xihTtKlq.js";import"./DGo8yE5j.js";var w=c(`<div></div>`),T=c(`<!> <div><div class="bg-white/80 dark:bg-neutral-800/50"><!></div></div>`,1);function E(c,E){a(E,!1);let D=h(),O=h(),k=h(),A=h(),j=h(),M=h(),N=ee(),P=x(E,`position`,8,`left`),F=x(E,`mobilePosition`,8,null),te=x(E,`minWidth`,8,`12rem`),I=x(E,`width`,8,void 0),L=x(E,`compact`,8,!1),R=x(E,`placement`,8,`auto`),z=x(E,`fixed`,8,!1),B=x(E,`triggerEl`,8,null),V=x(E,`onboarding`,8,void 0),H=h(),U=h(``),W=h(`bottom`),G=null,K={left:`left-0`,right:`right-0`,middle:`left-1/2 -translate-x-1/2`},q={"middle-to-right":`left-1/2 -translate-x-1/2 md:left-auto md:right-0 md:translate-x-0`,"middle-to-left":`left-1/2 -translate-x-1/2 md:left-0 md:translate-x-0`,"left-to-right":`left-0 md:left-auto md:right-0`,"right-to-left":`right-0 md:right-auto md:left-0`};function J(e){return R()===`auto`?e.top+e.height/2>window.innerHeight/2?`top`:`bottom`:R()}function Y(){if(!B())return;let e=B().getBoundingClientRect();if(u(W,J(e)),o(W)!==G&&(G=o(W),N(`placementchange`,o(W))),!z())return;let t=e.left;P()===`right`?(t=e.right,o(H)&&(t=e.right-o(H).offsetWidth)):P()===`middle`&&(t=e.left+e.width/2,o(H)&&(t-=o(H).offsetWidth/2));let n=o(W)===`top`?`bottom: ${window.innerHeight-e.top+o(A)}px;`:`top: ${e.bottom+o(A)}px;`;u(U,`${n} left: ${t}px;`)}g(()=>{if(B()&&Y(),z()&&B())return window.addEventListener(`scroll`,Y,!0),window.addEventListener(`resize`,Y),()=>{window.removeEventListener(`scroll`,Y,!0),window.removeEventListener(`resize`,Y)}}),d(()=>(l(z()),l(F()),l(P())),()=>{u(D,z()?``:F()&&F()!==P()&&q[`${F()}-to-${P()}`]||K[P()])}),d(()=>l(L()),()=>{u(O,L()?`mt-1`:`mt-3`)}),d(()=>l(L()),()=>{u(k,L()?`mb-1`:`mb-3`)}),d(()=>l(L()),()=>{u(A,L()?4:12)}),d(()=>l(L()),()=>{u(j,L()?`rounded-lg`:`rounded-xl`)}),d(()=>(o(W),o(k),o(O)),()=>{u(M,o(W)===`top`?`bottom-full ${o(k)}`:`top-full ${o(O)}`)}),d(()=>(l(B()),o(H)),()=>{B()&&o(H)&&Y()}),y(),f();var X=T(),Z=b(X),ne=e=>{var n=w();S(()=>t(n,1,`absolute z-40 h-3 w-full ${o(W)===`top`?`bottom-full`:`top-full`}`)),r(e,n)};e(Z,e=>{z()||e(ne)});var Q=v(Z,2),$=p(Q),re=p($);n(re,E,`default`,{},null),i($),i(Q),m(Q,e=>u(H,e),()=>o(H)),S(()=>{C(Q,`data-onboarding`,V()),t(Q,1,`z-50 overflow-hidden border border-neutral-300 bg-neutral-100 shadow-xl dark:border-neutral-700/60 dark:bg-neutral-900 dark:shadow-black/25 ${o(j)??``} ${z()?`fixed`:`absolute `+o(M)} ${o(D)??``}`),s(Q,`min-width: ${te()??``}; ${I()?`width: ${I()};`:``} ${(z()?o(U):``)??``}`)}),r(c,X),_()}export{E as t};