import { $n as e, D as t, E as n, Lt as r, On as i, Zn as a, _ as o, b as s, et as c, g as l, jt as u, mt as d, qt as f, tr as p, v as m, wn as h, xt as g, y as _, z as v } from "./runtime-core.esm-bundler-Ci9kEgM7.js";
import { I as y, S as b, X as x, b as S, m as C, t as w, x as T } from "./Button-CzGEASGR.js";
import { A as E } from "./dist-D5YmEqpM.js";
import { f as D, i as O } from "./Tooltip-CmrGYuQV.js";
import { a as k, c as A, i as j, l as M, n as N, o as P, r as F, s as I } from "./useOverlay-D6IDAxlU.js";
import { t as L } from "./overlay-DR-nxSLa.js";
var R = { slots: { overlay: `fixed inset-0 bg-elevated/75`, content: `fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none`, header: `flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)`, wrapper: ``, body: `flex-1 overflow-y-auto p-4 sm:p-6`, footer: `flex items-center gap-1.5 p-4 sm:px-6`, title: `text-highlighted font-semibold`, description: `mt-1 text-muted text-sm`, close: `absolute top-4 end-4` }, variants: { side: { top: { content: `` }, right: { content: `max-w-md` }, bottom: { content: `` }, left: { content: `max-w-md` } }, inset: { true: { content: `rounded-lg` } }, transition: { true: { overlay: `data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]` } } }, compoundVariants: [{ side: `top`, inset: true, class: { content: `max-h-[calc(100%-2rem)] inset-x-4 top-4` } }, { side: `top`, inset: false, class: { content: `max-h-full inset-x-0 top-0` } }, { side: `right`, inset: true, class: { content: `w-[calc(100%-2rem)] inset-y-4 right-4` } }, { side: `right`, inset: false, class: { content: `w-full inset-y-0 right-0` } }, { side: `bottom`, inset: true, class: { content: `max-h-[calc(100%-2rem)] inset-x-4 bottom-4` } }, { side: `bottom`, inset: false, class: { content: `max-h-full inset-x-0 bottom-0` } }, { side: `left`, inset: true, class: { content: `w-[calc(100%-2rem)] inset-y-4 left-4` } }, { side: `left`, inset: false, class: { content: `w-full inset-y-0 left-0` } }, { transition: true, side: `top`, class: { content: `data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]` } }, { transition: true, side: `right`, class: { content: `data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]` } }, { transition: true, side: `bottom`, class: { content: `data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]` } }, { transition: true, side: `left`, class: { content: `data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]` } }] }, z = { __name: `Slideover`, props: { title: { type: String, required: false }, description: { type: String, required: false }, content: { type: Object, required: false }, overlay: { type: Boolean, required: false, default: true }, transition: { type: Boolean, required: false, default: true }, side: { type: null, required: false, default: `right` }, inset: { type: Boolean, required: false }, portal: { type: [Boolean, String], required: false, skipCheck: true, default: true }, close: { type: [Boolean, Object], required: false, default: true }, closeIcon: { type: null, required: false }, dismissible: { type: Boolean, required: false, default: true }, class: { type: null, required: false }, ui: { type: Object, required: false }, open: { type: Boolean, required: false }, defaultOpen: { type: Boolean, required: false }, modal: { type: Boolean, required: false, default: true } }, emits: [`leave`, `after:leave`, `enter`, `after:enter`, `close:prevent`, `update:open`], setup(z2, { emit: B }) {
  let V = z2, H = B, U = r(), W = b(`slideover`, V), { t: G } = y(), K = x(), q = T(E(W, `open`, `defaultOpen`, `modal`), H), J = O(h(() => W.portal)), Y = h(() => W.content), X = l(() => W.dismissible ? { pointerDownOutside: L } : [`interactOutside`, `escapeKeyDown`].reduce((e2, t2) => (e2[t2] = (e3) => {
    e3.preventDefault(), H(`close:prevent`);
  }, e2), {})), Z = l(() => S({ extend: S(R), ...K.ui?.slideover || {} })({ transition: W.transition, side: W.side, inset: W.inset }));
  return (r2, l2) => (d(), m(i(M), e(v(i(q))), { default: f(({ open: h2, close: y2 }) => [U.default ? (d(), m(i(N), { key: 0, "as-child": ``, class: a(i(W).class) }, { default: f(() => [g(r2.$slots, `default`, { open: h2 })]), _: 2 }, 1032, [`class`])) : _(``, true), t(i(j), e(v(i(J))), { default: f(() => [t(i(C), null, { default: f(() => [i(W).overlay ? (d(), m(i(k), { key: 0, "data-slot": `overlay`, class: a(Z.value.overlay({ class: i(W).ui?.overlay })) }, null, 8, [`class`])) : _(``, true), t(i(I), c({ "data-side": i(W).side, "data-slot": `content`, class: Z.value.content({ class: [!U.default && i(W).class, i(W).ui?.content] }) }, Y.value, { onEnter: l2[0] || (l2[0] = (e2) => H(`enter`)), onAfterEnter: l2[1] || (l2[1] = (e2) => H(`after:enter`)), onLeave: l2[2] || (l2[2] = (e2) => H(`leave`)), onAfterLeave: l2[3] || (l2[3] = (e2) => H(`after:leave`)) }, u(X.value)), { default: f(() => [!i(W).title && !U.title || !i(W).description && !U.description || U.content ? (d(), m(i(D), { key: 0 }, { default: f(() => [!i(W).title && !U.title ? (d(), m(i(F), { key: 0 })) : U.content ? (d(), m(i(F), { key: 1 }, { default: f(() => [g(r2.$slots, `title`, {}, () => [n(p(i(W).title), 1)])]), _: 3 })) : _(``, true), !i(W).description && !U.description ? (d(), m(i(P), { key: 2 })) : U.content ? (d(), m(i(P), { key: 3 }, { default: f(() => [g(r2.$slots, `description`, {}, () => [n(p(i(W).description), 1)])]), _: 3 })) : _(``, true)]), _: 3 })) : _(``, true), g(r2.$slots, `content`, { close: y2 }, () => [U.header || i(W).title || U.title || i(W).description || U.description || i(W).close || U.close ? (d(), s(`div`, { key: 0, "data-slot": `header`, class: a(Z.value.header({ class: i(W).ui?.header })) }, [g(r2.$slots, `header`, { close: y2 }, () => [i(W).title || U.title || i(W).description || U.description ? (d(), s(`div`, { key: 0, "data-slot": `wrapper`, class: a(Z.value.wrapper({ class: i(W).ui?.wrapper })) }, [i(W).title || U.title ? (d(), m(i(F), { key: 0, "data-slot": `title`, class: a(Z.value.title({ class: i(W).ui?.title })) }, { default: f(() => [g(r2.$slots, `title`, {}, () => [n(p(i(W).title), 1)])]), _: 3 }, 8, [`class`])) : _(``, true), i(W).description || U.description ? (d(), m(i(P), { key: 1, "data-slot": `description`, class: a(Z.value.description({ class: i(W).ui?.description })) }, { default: f(() => [g(r2.$slots, `description`, {}, () => [n(p(i(W).description), 1)])]), _: 3 }, 8, [`class`])) : _(``, true)], 2)) : _(``, true), g(r2.$slots, `actions`), i(W).close || U.close ? (d(), m(i(A), { key: 1, "as-child": `` }, { default: f(() => [g(r2.$slots, `close`, { ui: Z.value }, () => [i(W).close ? (d(), m(w, c({ key: 0, icon: i(W).closeIcon || i(K).ui.icons.close, color: `neutral`, variant: `ghost`, "aria-label": i(G)(`slideover.close`) }, typeof i(W).close == `object` ? i(W).close : {}, { "data-slot": `close`, class: Z.value.close({ class: i(W).ui?.close }) }), null, 16, [`icon`, `aria-label`, `class`])) : _(``, true)])]), _: 2 }, 1024)) : _(``, true)])], 2)) : _(``, true), o(`div`, { "data-slot": `body`, class: a(Z.value.body({ class: i(W).ui?.body })) }, [g(r2.$slots, `body`, { close: y2 })], 2), U.footer ? (d(), s(`div`, { key: 1, "data-slot": `footer`, class: a(Z.value.footer({ class: i(W).ui?.footer })) }, [g(r2.$slots, `footer`, { close: y2 })], 2)) : _(``, true)])]), _: 2 }, 1040, [`data-side`, `class`])]), _: 2 }, 1024)]), _: 2 }, 1040)]), _: 3 }, 16));
} };
export {
  z as t
};
