isVisible-8OcOPiZa.mjs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { M as w, a4 as I, a0 as d, L as c, x as f, _ as y, j as i, a5 as P, W, d as E, a as g, G as h, e as M, o as B } from "./base-component-BMXjNJAi.mjs";
  2. import { f as $ } from "./fadeClass-CLIYI_zn.mjs";
  3. import { s as r } from "./showClass-C8hdJfjQ.mjs";
  4. import { a as T, m as u, o as C, r as V } from "./popupContainer-BY58HXTH.mjs";
  5. const N = "Modal", Q = "Offcanvas", j = "fixed-top", A = "fixed-bottom", S = "sticky-top", x = "position-sticky", O = (s) => [
  6. ...i(j, s),
  7. ...i(A, s),
  8. ...i(S, s),
  9. ...i(x, s),
  10. ...i("is-fixed", s)
  11. ], G = (s) => {
  12. const a = d(s);
  13. f(a, {
  14. paddingRight: "",
  15. overflow: ""
  16. });
  17. const o = O(a);
  18. o.length && o.forEach((e) => {
  19. f(e, {
  20. paddingRight: "",
  21. marginRight: ""
  22. });
  23. });
  24. }, _ = (s) => {
  25. const { clientWidth: a } = w(s), { innerWidth: o } = I(s);
  26. return Math.abs(o - a);
  27. }, U = (s, a) => {
  28. const o = d(s), e = parseInt(c(o, "paddingRight"), 10), l = c(o, "overflow") === "hidden" && e ? 0 : _(s), m = O(o);
  29. a && (f(o, {
  30. overflow: "hidden",
  31. paddingRight: `${e + l}px`
  32. }), m.length && m.forEach((n) => {
  33. const k = c(n, "paddingRight");
  34. if (n.style.paddingRight = `${parseInt(k, 10) + l}px`, [S, x].some((p) => y(n, p))) {
  35. const p = c(n, "marginRight");
  36. n.style.marginRight = `${parseInt(p, 10) - l}px`;
  37. }
  38. }));
  39. }, R = "backdrop", v = `${u}-${R}`, b = `${C}-${R}`, F = `.${u}.${r}`, L = `.${C}.${r}`, t = P("div"), Z = (s) => W(
  40. `${F},${L}`,
  41. E(s)
  42. ), q = (s) => {
  43. const a = s ? v : b;
  44. [v, b].forEach((o) => {
  45. g(t, o);
  46. }), h(t, a);
  47. }, X = (s, a, o) => {
  48. q(o), T(t, d(s)), a && h(t, $);
  49. }, Y = () => {
  50. y(t, r) || (h(t, r), M(t));
  51. }, ss = () => {
  52. g(t, r);
  53. }, os = (s) => {
  54. Z(s) || (g(t, $), V(t, d(s)), G(s));
  55. }, as = (s) => B(s) && c(s, "visibility") !== "hidden" && s.offsetParent !== null;
  56. export {
  57. X as a,
  58. _ as b,
  59. U as c,
  60. Q as d,
  61. F as e,
  62. L as f,
  63. Z as g,
  64. ss as h,
  65. as as i,
  66. N as m,
  67. t as o,
  68. os as r,
  69. Y as s,
  70. q as t
  71. };
  72. //# sourceMappingURL=isVisible-8OcOPiZa.mjs.map