@cntrl-site/components 1.0.100 → 1.0.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -1
- package/dist/Burger-C6jI6C1c.js +661 -0
- package/dist/Burger-EMSn7TPB.mjs +1807 -0
- package/dist/ClickGallerie-D_O1XhAO.mjs +270 -0
- package/dist/ClickGallerie-M9xdGR1G.js +36 -0
- package/dist/Components/Burger/BurgerComponent.d.ts +0 -1
- package/dist/Components/ClickGallerie/ClickGallerieComponent.d.ts +0 -1
- package/dist/Components/FAQ/FAQComponent.d.ts +0 -1
- package/dist/Components/Form/FormComponent.d.ts +0 -1
- package/dist/Components/Grid/GridComponent.d.ts +0 -1
- package/dist/Components/Helix/HelixComponent.d.ts +0 -1
- package/dist/Components/Hive/HiveComponent.d.ts +0 -1
- package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +0 -1
- package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +0 -1
- package/dist/Components/List/ListComponent.d.ts +0 -1
- package/dist/Components/Marquee/MarqueeComponent.d.ts +0 -1
- package/dist/Components/MarqueeText/MarqueeTextComponent.d.ts +0 -1
- package/dist/Components/Mercury/MercuryComponent.d.ts +0 -1
- package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +0 -1
- package/dist/Components/Pretext/PretextComponent.d.ts +0 -1
- package/dist/Components/Scale/ScaleComponent.d.ts +0 -1
- package/dist/Components/SimpleButton/SimpleButtonComponent.d.ts +0 -1
- package/dist/Components/Slider20/Slider20Component.d.ts +0 -1
- package/dist/Components/TestimonialGrid/TestimonialGridComponent.d.ts +0 -1
- package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +0 -1
- package/dist/Components/Waterfall/WaterfallComponent.d.ts +0 -1
- package/dist/ControlSlider-SiOt22l_.js +1 -0
- package/dist/ControlSlider-pZv7H6BU.mjs +334 -0
- package/dist/FAQ-C7823fyi.js +166 -0
- package/dist/FAQ-CZ39u4m8.mjs +588 -0
- package/dist/Form-BX5_41nb.mjs +472 -0
- package/dist/Form-Dn-6A1He.js +153 -0
- package/dist/Grid-CemGhf3F.js +374 -0
- package/dist/Grid-cfQsXW3b.mjs +1553 -0
- package/dist/Helix-2Vr-9WBa.js +43 -0
- package/dist/Helix-BmkAKT1G.mjs +315 -0
- package/dist/Hive-BC6zQBsv.js +321 -0
- package/dist/Hive-BGMWinrW.mjs +1425 -0
- package/dist/HiveLightboxTitles-DhEeFKWs.mjs +507 -0
- package/dist/HiveLightboxTitles-DlyptAaK.js +1 -0
- package/dist/ImageRevealSlider-BBWtFjUF.js +1 -0
- package/dist/ImageRevealSlider-BdFGyVEP.mjs +184 -0
- package/dist/Lightbox-CIss_nOG.js +1 -0
- package/dist/Lightbox-eP9qAZzL.mjs +665 -0
- package/dist/LightboxJournal-D59ex6wH.mjs +1613 -0
- package/dist/LightboxJournal-DAEZOPDi.js +523 -0
- package/dist/LightboxStrip-BDjI1jyH.js +386 -0
- package/dist/LightboxStrip-YspzBP8N.mjs +1574 -0
- package/dist/List-C32WImI3.js +377 -0
- package/dist/List-DW7fyJbf.mjs +1891 -0
- package/dist/Marquee-BYClHHws.mjs +551 -0
- package/dist/Marquee-vmHaTGIP.js +133 -0
- package/dist/MarqueeText-4Rip_sQX.mjs +515 -0
- package/dist/MarqueeText-E6OubMOG.js +132 -0
- package/dist/Mercury-BwF_XW2w.js +267 -0
- package/dist/Mercury-DuKJQ1Zo.mjs +1701 -0
- package/dist/OnelinerForm-BEu7_sho.mjs +434 -0
- package/dist/OnelinerForm-C2Y_XMCY.js +194 -0
- package/dist/Pretext-10CcyP1E.mjs +2762 -0
- package/dist/Pretext-DvQ3xsni.js +231 -0
- package/dist/PretextComponent-C3YFICy8.js +1 -0
- package/dist/PretextComponent-Ct0newmn.mjs +11624 -0
- package/dist/RichTextRenderer-B6WtTYlR.mjs +32 -0
- package/dist/RichTextRenderer-CIy6yI8U.js +1 -0
- package/dist/Scale-976sjO8e.js +111 -0
- package/dist/Scale-rLNT4KAk.mjs +345 -0
- package/dist/SimpleButton-C-o2W9bS.mjs +451 -0
- package/dist/SimpleButton-nGEcO2gB.js +243 -0
- package/dist/Slider20-C9o2REDl.js +272 -0
- package/dist/Slider20-Dm8BeCli.mjs +851 -0
- package/dist/SvgImage-B5mR9y6q.mjs +51 -0
- package/dist/SvgImage-DFlmxAoL.js +1 -0
- package/dist/TestimonialGrid-CPu4qQ6B.mjs +492 -0
- package/dist/TestimonialGrid-D4ieiz9e.js +90 -0
- package/dist/TestimonialSingle-CVu15ZtV.js +125 -0
- package/dist/TestimonialSingle-DLdnAVF7.mjs +391 -0
- package/dist/Waterfall-A0FjM2my.mjs +1400 -0
- package/dist/Waterfall-DnPDHbCL.js +287 -0
- package/dist/buildColorVars-CE2D5cQV.js +1 -0
- package/dist/buildColorVars-CLyWQm5K.mjs +21 -0
- package/dist/components-OE3ac1dr.js +1 -0
- package/dist/components-w-jHX-2U.mjs +2053 -0
- package/dist/components.css +1 -1
- package/dist/elements.d.ts +7 -0
- package/dist/elements.js +1 -0
- package/dist/elements.mjs +63 -0
- package/dist/elements.node.d.ts +6 -0
- package/dist/elements.node.js +1 -0
- package/dist/elements.node.mjs +21 -0
- package/dist/forking.d.ts +1 -0
- package/dist/formFieldValidation-DZl2KVaF.js +1 -0
- package/dist/formFieldValidation-DvihFrq5.mjs +21 -0
- package/dist/getColorAlpha-BVBY0N5x.mjs +39 -0
- package/dist/getColorAlpha-CoSseoCn.js +1 -0
- package/dist/getImageRect-BQhQXvT8.js +1 -0
- package/dist/getImageRect-CBMhFNHM.mjs +109 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -28866
- package/dist/index.mjs +16 -62477
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
- package/dist/panelAvailability-D179wwJx.mjs +27 -0
- package/dist/panelAvailability-DnOe0rQ4.js +1 -0
- package/dist/react-splide.esm-CabaEmHi.js +6 -0
- package/dist/react-splide.esm-DQqds4PL.mjs +1750 -0
- package/dist/readTestimonialTextMeasure-BIXpGFEt.mjs +13 -0
- package/dist/readTestimonialTextMeasure-CEPaB4Sy.js +1 -0
- package/dist/scalingValue-C9JH5L6O.mjs +6 -0
- package/dist/scalingValue-CSHYgTZl.js +1 -0
- package/dist/sources.d.ts +1 -0
- package/dist/sources.js +23753 -0
- package/dist/sources.mjs +23779 -0
- package/dist/textStylesToCss-05Mn6I_2.mjs +32 -0
- package/dist/textStylesToCss-CNN3zZTV.js +1 -0
- package/dist/types/Component.d.ts +0 -1
- package/dist/useLightboxScrollLock-Hf16Eq4g.js +1 -0
- package/dist/useLightboxScrollLock-VQ07s7EJ.mjs +18 -0
- package/dist/useLightboxSwipeDismiss-Br9uE5G0.js +1 -0
- package/dist/useLightboxSwipeDismiss-SGv6Ra33.mjs +95 -0
- package/dist/useScopedStyles-Bf6yohVQ.js +1 -0
- package/dist/useScopedStyles-DhBG3557.mjs +11 -0
- package/dist/utils-033j3qNL.js +1 -0
- package/dist/utils-FxC9rcxw.mjs +247 -0
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +17 -11
- package/package.json +31 -2
- package/dist/index-2JTNRDR1.js +0 -1
- package/dist/index-DA8t6EZ4.mjs +0 -255
- package/dist/panelAvailability-CgSic84c.mjs +0 -126
- package/dist/panelAvailability-D8c7cdbu.js +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useEffect as u } from "react";
|
|
3
|
+
import g from "classnames";
|
|
4
|
+
import { i as p, l as k } from "./loadSvgMaskUrl-xHgGYgPe.mjs";
|
|
5
|
+
const v = "SvgImage-module__svg___q3xE-", C = "SvgImage-module__img___VsTm-", c = {
|
|
6
|
+
svg: v,
|
|
7
|
+
img: C
|
|
8
|
+
}, w = (s) => {
|
|
9
|
+
const e = s.trim().toLowerCase();
|
|
10
|
+
return !!(e.startsWith("data:image/svg+xml") || e.includes("image/svg+xml") || e.includes(".svg") || e.startsWith("blob:"));
|
|
11
|
+
}, _ = (s) => `url("${s.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}")`, x = ({ url: s, fill: e = "#000000", hoverFill: f = "#CCCCCC", className: a = "", style: i }) => {
|
|
12
|
+
const [n, d] = l(() => typeof window > "u" ? !0 : CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")')), [o, r] = l(() => p(s) ? s : null);
|
|
13
|
+
return u(() => {
|
|
14
|
+
if (typeof window < "u" && window.CSS) {
|
|
15
|
+
const t = CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")');
|
|
16
|
+
d(t);
|
|
17
|
+
}
|
|
18
|
+
}, []), u(() => {
|
|
19
|
+
if (!w(s)) {
|
|
20
|
+
r(null);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (p(s)) {
|
|
24
|
+
r(s);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
let t = !1;
|
|
28
|
+
return k(s).then((S) => {
|
|
29
|
+
t || r(S);
|
|
30
|
+
}).catch(() => {
|
|
31
|
+
t || r(null);
|
|
32
|
+
}), () => {
|
|
33
|
+
t = !0;
|
|
34
|
+
};
|
|
35
|
+
}, [s]), !o || !n ? /* @__PURE__ */ m("img", { src: s, alt: "", className: g(c.img, a), style: i }) : /* @__PURE__ */ m(
|
|
36
|
+
"span",
|
|
37
|
+
{
|
|
38
|
+
"data-supports-mask": n,
|
|
39
|
+
className: g(c.svg, a),
|
|
40
|
+
style: {
|
|
41
|
+
"--svg": _(o),
|
|
42
|
+
"--fill": e,
|
|
43
|
+
"--hover-fill": f,
|
|
44
|
+
...i ?? {}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
x as S
|
|
51
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const g=require("react/jsx-runtime"),a=require("react"),c=require("classnames"),n=require("./loadSvgMaskUrl-DfF7ay6h.js"),d="SvgImage-module__svg___q3xE-",k="SvgImage-module__img___VsTm-",m={svg:d,img:k},v=e=>{const s=e.trim().toLowerCase();return!!(s.startsWith("data:image/svg+xml")||s.includes("image/svg+xml")||s.includes(".svg")||s.startsWith("blob:"))},C=e=>`url("${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`,w=({url:e,fill:s="#000000",hoverFill:f="#CCCCCC",className:i="",style:u})=>{const[l,p]=a.useState(()=>typeof window>"u"?!0:CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")')),[o,r]=a.useState(()=>n.isInlineMaskUrl(e)?e:null);return a.useEffect(()=>{if(typeof window<"u"&&window.CSS){const t=CSS.supports("mask-image",'url("")')||CSS.supports("-webkit-mask-image",'url("")');p(t)}},[]),a.useEffect(()=>{if(!v(e)){r(null);return}if(n.isInlineMaskUrl(e)){r(e);return}let t=!1;return n.loadSvgMaskUrl(e).then(S=>{t||r(S)}).catch(()=>{t||r(null)}),()=>{t=!0}},[e]),!o||!l?g.jsx("img",{src:e,alt:"",className:c(m.img,i),style:u}):g.jsx("span",{"data-supports-mask":l,className:c(m.svg,i),style:{"--svg":C(o),"--fill":s,"--hover-fill":f,...u??{}}})};exports.SvgImage=w;
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { jsxs as y, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as M, useState as w, useMemo as T, useLayoutEffect as P, useCallback as V } from "react";
|
|
3
|
+
import He from "classnames";
|
|
4
|
+
import { R as Ae } from "./RichTextRenderer-B6WtTYlR.mjs";
|
|
5
|
+
import { s as Pe } from "./scalingValue-C9JH5L6O.mjs";
|
|
6
|
+
import { t as Re } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
7
|
+
import { u as qe } from "./useScopedStyles-DhBG3557.mjs";
|
|
8
|
+
import { r as We } from "./readTestimonialTextMeasure-BIXpGFEt.mjs";
|
|
9
|
+
function Ee(e, i) {
|
|
10
|
+
const m = i > 0 ? `${i}px` : "0px";
|
|
11
|
+
return `
|
|
12
|
+
.${e}-marquee-wrapper {
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@keyframes ${e}-marquee-left {
|
|
19
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
20
|
+
to { -webkit-transform: translate3d(-${m}, 0, 0); transform: translate3d(-${m}, 0, 0); }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@keyframes ${e}-marquee-right {
|
|
24
|
+
from { -webkit-transform: translate3d(-${m}, 0, 0); transform: translate3d(-${m}, 0, 0); }
|
|
25
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.${e}-marquee-track {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
width: max-content;
|
|
32
|
+
will-change: transform;
|
|
33
|
+
backface-visibility: hidden;
|
|
34
|
+
transform: translateZ(0);
|
|
35
|
+
-webkit-backface-visibility: hidden;
|
|
36
|
+
-webkit-transform: translateZ(0);
|
|
37
|
+
perspective: 1000px;
|
|
38
|
+
-webkit-animation-timing-function: linear;
|
|
39
|
+
animation-timing-function: linear;
|
|
40
|
+
-webkit-animation-iteration-count: infinite;
|
|
41
|
+
animation-iteration-count: infinite;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
45
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
46
|
+
animation-name: ${e}-marquee-left;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
50
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
51
|
+
animation-name: ${e}-marquee-right;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.${e}-marquee-set {
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: row;
|
|
57
|
+
flex: 0 0 auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.${e}-wrapper {
|
|
61
|
+
position: relative;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
order: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.${e}-cover {
|
|
68
|
+
position: absolute;
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 100%;
|
|
71
|
+
top: 0;
|
|
72
|
+
left: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.${e}-elements-overlay {
|
|
76
|
+
position: relative;
|
|
77
|
+
inset: 0;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.${e}-control {
|
|
84
|
+
position: relative;
|
|
85
|
+
z-index: 2;
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.${e}-control::before {
|
|
90
|
+
content: "";
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
min-height: 20px;
|
|
97
|
+
pointer-events: auto;
|
|
98
|
+
z-index: 10;
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
const Fe = 30, xe = 2, Ne = (e) => {
|
|
103
|
+
e.style.setProperty("animation-name", "none"), e.style.setProperty("-webkit-animation-name", "none"), e.offsetHeight, e.style.removeProperty("animation-name"), e.style.removeProperty("-webkit-animation-name");
|
|
104
|
+
}, Be = ({ settings: e, content: i, isEditor: m, isPreviewMode: pe, isEditMode: ye }) => {
|
|
105
|
+
const { prefix: d } = qe(), { align: S, speed: O, direction: j, pauseOnHover: ve, gap: v, cardWidth: R, corners: q, stroke: C, strokeColor: B, bgColor: K, padding: f, logoMarginTop: Z, logoWidth: W, logoHeight: E, captionMarginTop: X } = e, p = !!ye, be = ((i == null ? void 0 : i.length) ?? 0) > 0, k = O > 0 && (!m || pe), h = be && (k || m), G = Math.max(0, O) * Fe, o = (a) => Pe(a, m ?? !1), U = M(null), F = M(null), N = M(null), [_, we] = w(0), [x, J] = w(0), b = x > 0 ? x : 0, Q = T(() => Ee(d, b), [d, b]), [Y, ee] = w(0), D = k && ve === "on", [ge, ae] = w(!1), re = M(null), [te, $e] = w(0), [ie, Me] = w(0), ne = M(null), oe = (a) => {
|
|
106
|
+
var r, t, l, s, $;
|
|
107
|
+
return {
|
|
108
|
+
fontSettings: {
|
|
109
|
+
fontFamily: (e == null ? void 0 : e[`${a}FontFamily`]) ?? "Arial",
|
|
110
|
+
fontWeight: ((r = e == null ? void 0 : e[`${a}FontSettings`]) == null ? void 0 : r.fontWeight) ?? 400,
|
|
111
|
+
fontStyle: ((t = e == null ? void 0 : e[`${a}FontSettings`]) == null ? void 0 : t.fontStyle) ?? "normal"
|
|
112
|
+
},
|
|
113
|
+
textAppearance: {
|
|
114
|
+
textTransform: ((l = e == null ? void 0 : e[`${a}TextAppearance`]) == null ? void 0 : l.textTransform) ?? "none",
|
|
115
|
+
textDecoration: ((s = e == null ? void 0 : e[`${a}TextAppearance`]) == null ? void 0 : s.textDecoration) ?? "none",
|
|
116
|
+
fontVariant: (($ = e == null ? void 0 : e[`${a}TextAppearance`]) == null ? void 0 : $.fontVariant) ?? "normal"
|
|
117
|
+
},
|
|
118
|
+
letterSpacing: (e == null ? void 0 : e[`${a}LetterSpacing`]) ?? 0,
|
|
119
|
+
wordSpacing: (e == null ? void 0 : e[`${a}WordSpacing`]) ?? 0,
|
|
120
|
+
fontSize: (e == null ? void 0 : e[`${a}FontSize`]) ?? 0.01,
|
|
121
|
+
lineHeight: (e == null ? void 0 : e[`${a}LineHeight`]) ?? 0.01,
|
|
122
|
+
color: (e == null ? void 0 : e[`${a}Color`]) ?? "#000000"
|
|
123
|
+
};
|
|
124
|
+
}, le = oe("text"), ce = oe("caption"), H = T(
|
|
125
|
+
() => ((i == null ? void 0 : i.length) ?? 0) > 1 && (i ?? []).some((a) => {
|
|
126
|
+
var n, r;
|
|
127
|
+
return (((n = a.text) == null ? void 0 : n.length) ?? 0) > 0 || (((r = a.caption) == null ? void 0 : r.length) ?? 0) > 0;
|
|
128
|
+
}),
|
|
129
|
+
[i]
|
|
130
|
+
), de = T(() => !h || (i == null ? void 0 : i.length) === 0 ? 1 : x <= 0 || _ <= 0 ? xe : Math.max(xe, Math.ceil(_ / x) + 1), [h, i == null ? void 0 : i.length, x, _]);
|
|
131
|
+
P(() => {
|
|
132
|
+
if (!h) return;
|
|
133
|
+
const a = U.current, n = N.current;
|
|
134
|
+
if (!a || !n) return;
|
|
135
|
+
let r = 0;
|
|
136
|
+
const t = () => {
|
|
137
|
+
const $ = a.getBoundingClientRect().width, u = n.getBoundingClientRect().width, fe = ne.current, he = typeof fe == "number" && Math.abs(fe - u) <= 0.25;
|
|
138
|
+
if (ne.current = u, we($), typeof u == "number" && u > 0 && x <= 0) {
|
|
139
|
+
J(u);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
he && u !== x ? J(u) : !he && x <= 0 && (cancelAnimationFrame(r), r = requestAnimationFrame(t));
|
|
143
|
+
}, l = () => {
|
|
144
|
+
cancelAnimationFrame(r), r = requestAnimationFrame(t);
|
|
145
|
+
};
|
|
146
|
+
l();
|
|
147
|
+
const s = new ResizeObserver(l);
|
|
148
|
+
return s.observe(a), s.observe(n), () => {
|
|
149
|
+
cancelAnimationFrame(r), s.disconnect();
|
|
150
|
+
};
|
|
151
|
+
}, [k, h, x]);
|
|
152
|
+
const Te = b > 0 && G > 0 ? b / G * 1e3 : 0, se = `${Math.max(0, Te) / 1e3}s`;
|
|
153
|
+
P(() => {
|
|
154
|
+
if (!h || b <= 0) return;
|
|
155
|
+
const a = F.current;
|
|
156
|
+
a && Ne(a);
|
|
157
|
+
}, [h, b, j]), P(() => {
|
|
158
|
+
if (!h) {
|
|
159
|
+
ee(0);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const a = N.current, n = F.current;
|
|
163
|
+
if (!a || !n) return;
|
|
164
|
+
const r = () => {
|
|
165
|
+
let l = 0;
|
|
166
|
+
for (let s = 0; s < a.children.length; s++) {
|
|
167
|
+
const u = a.children[s].firstElementChild;
|
|
168
|
+
u && (l = Math.max(l, u.offsetHeight));
|
|
169
|
+
}
|
|
170
|
+
l <= 0 && (l = n.offsetHeight), ee(l > 0 ? l : 0);
|
|
171
|
+
};
|
|
172
|
+
r();
|
|
173
|
+
const t = new ResizeObserver(r);
|
|
174
|
+
return t.observe(a), t.observe(n), () => {
|
|
175
|
+
t.disconnect();
|
|
176
|
+
};
|
|
177
|
+
}, [h, de, i, m, v, R, f, C, q, W, E, te, ie]);
|
|
178
|
+
const Se = () => {
|
|
179
|
+
D && ae(!0);
|
|
180
|
+
}, Ce = () => {
|
|
181
|
+
D && ae(!1);
|
|
182
|
+
}, g = T(() => {
|
|
183
|
+
switch (S) {
|
|
184
|
+
case "center":
|
|
185
|
+
return "center";
|
|
186
|
+
case "end":
|
|
187
|
+
return "flex-end";
|
|
188
|
+
case "start":
|
|
189
|
+
default:
|
|
190
|
+
return "flex-start";
|
|
191
|
+
}
|
|
192
|
+
}, [S]), A = T(() => {
|
|
193
|
+
switch (S) {
|
|
194
|
+
case "center":
|
|
195
|
+
return "center";
|
|
196
|
+
case "end":
|
|
197
|
+
return "right";
|
|
198
|
+
case "start":
|
|
199
|
+
default:
|
|
200
|
+
return "left";
|
|
201
|
+
}
|
|
202
|
+
}, [S]), I = V(
|
|
203
|
+
(a, n, r, t) => /* @__PURE__ */ y(
|
|
204
|
+
"div",
|
|
205
|
+
{
|
|
206
|
+
style: {
|
|
207
|
+
display: "flex",
|
|
208
|
+
flexDirection: "column",
|
|
209
|
+
alignItems: g,
|
|
210
|
+
width: "100%"
|
|
211
|
+
},
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ c(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
"data-controls": p ? t == null ? void 0 : t.controlsName : void 0,
|
|
217
|
+
"data-controls-axis": p ? "y" : void 0,
|
|
218
|
+
className: p ? `${d}-control` : void 0,
|
|
219
|
+
style: { height: o((t == null ? void 0 : t.marginTop) ?? 0) }
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ c(
|
|
223
|
+
"div",
|
|
224
|
+
{
|
|
225
|
+
...t != null && t.dataMeasureKind ? { "data-testimonial-measure": t.dataMeasureKind } : {},
|
|
226
|
+
style: {
|
|
227
|
+
...Re(a, m),
|
|
228
|
+
textAlign: A,
|
|
229
|
+
pointerEvents: "auto",
|
|
230
|
+
...typeof (t == null ? void 0 : t.minHeightPx) == "number" && t.minHeightPx > 0 ? { minHeight: t.minHeightPx } : {}
|
|
231
|
+
},
|
|
232
|
+
children: /* @__PURE__ */ c(Ae, { content: n })
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
r
|
|
238
|
+
),
|
|
239
|
+
[g, A, m, p, d, o]
|
|
240
|
+
), z = V(
|
|
241
|
+
(a, n, r) => {
|
|
242
|
+
var t, l, s;
|
|
243
|
+
return /* @__PURE__ */ y(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
style: {
|
|
247
|
+
padding: `${o(f.top)} ${o(f.right)} ${o(f.bottom)} ${o(f.left)}`,
|
|
248
|
+
width: o(R + C * 2),
|
|
249
|
+
height: "100%",
|
|
250
|
+
borderRadius: o(q),
|
|
251
|
+
border: `${o(C)} solid ${B}`,
|
|
252
|
+
boxSizing: "border-box",
|
|
253
|
+
position: "relative",
|
|
254
|
+
overflow: "hidden"
|
|
255
|
+
},
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ c("div", { className: `${d}-cover`, style: { background: K } }),
|
|
258
|
+
/* @__PURE__ */ y(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
className: `${d}-elements-overlay`,
|
|
262
|
+
style: { alignItems: g, textAlign: A },
|
|
263
|
+
children: [
|
|
264
|
+
a.text && I(
|
|
265
|
+
le,
|
|
266
|
+
a.text,
|
|
267
|
+
"text",
|
|
268
|
+
r != null && r.dataMeasureAttrs ? { dataMeasureKind: "text" } : typeof (r == null ? void 0 : r.textMinHeightPx) == "number" && r.textMinHeightPx > 0 ? { minHeightPx: r.textMinHeightPx } : void 0
|
|
269
|
+
),
|
|
270
|
+
/* @__PURE__ */ y(
|
|
271
|
+
"div",
|
|
272
|
+
{
|
|
273
|
+
style: {
|
|
274
|
+
display: "flex",
|
|
275
|
+
flexDirection: "column",
|
|
276
|
+
alignItems: g,
|
|
277
|
+
width: "100%"
|
|
278
|
+
},
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ c(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
"data-controls": p && !(r != null && r.dataMeasureAttrs) ? "logoMarginTop" : void 0,
|
|
284
|
+
className: p && !(r != null && r.dataMeasureAttrs) ? `${d}-control` : void 0,
|
|
285
|
+
style: { height: o(Z) }
|
|
286
|
+
}
|
|
287
|
+
),
|
|
288
|
+
/* @__PURE__ */ c("div", { style: { width: o(W), height: o(E) }, children: ((t = a.logo) == null ? void 0 : t.assetId) && /* @__PURE__ */ c(
|
|
289
|
+
"img",
|
|
290
|
+
{
|
|
291
|
+
src: a.logo.assetId,
|
|
292
|
+
alt: ((l = a.logo) == null ? void 0 : l.name) ?? "",
|
|
293
|
+
style: { pointerEvents: "auto", width: "100%", height: "100%", objectFit: ((s = a.logo) == null ? void 0 : s.objectFit) || "contain" }
|
|
294
|
+
}
|
|
295
|
+
) })
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
a.caption && I(ce, a.caption, "caption", {
|
|
300
|
+
...r != null && r.dataMeasureAttrs ? {} : { controlsName: "captionMarginTop" },
|
|
301
|
+
marginTop: X,
|
|
302
|
+
...r != null && r.dataMeasureAttrs ? { dataMeasureKind: "caption" } : typeof (r == null ? void 0 : r.captionMinHeightPx) == "number" && r.captionMinHeightPx > 0 ? { minHeightPx: r.captionMinHeightPx } : {}
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
n
|
|
310
|
+
);
|
|
311
|
+
},
|
|
312
|
+
[
|
|
313
|
+
K,
|
|
314
|
+
X,
|
|
315
|
+
ce,
|
|
316
|
+
R,
|
|
317
|
+
q,
|
|
318
|
+
E,
|
|
319
|
+
Z,
|
|
320
|
+
W,
|
|
321
|
+
g,
|
|
322
|
+
A,
|
|
323
|
+
f.bottom,
|
|
324
|
+
f.left,
|
|
325
|
+
f.right,
|
|
326
|
+
f.top,
|
|
327
|
+
I,
|
|
328
|
+
C,
|
|
329
|
+
B,
|
|
330
|
+
le,
|
|
331
|
+
m,
|
|
332
|
+
p,
|
|
333
|
+
d
|
|
334
|
+
]
|
|
335
|
+
), L = V((a) => {
|
|
336
|
+
$e(a.maxTextPx), Me(a.maxCaptionPx);
|
|
337
|
+
}, []);
|
|
338
|
+
P(() => {
|
|
339
|
+
if (!H) {
|
|
340
|
+
L({ maxTextPx: 0, maxCaptionPx: 0 });
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const a = re.current;
|
|
344
|
+
if (!a) return;
|
|
345
|
+
const n = () => {
|
|
346
|
+
We(a, L);
|
|
347
|
+
};
|
|
348
|
+
n();
|
|
349
|
+
const r = new ResizeObserver(n);
|
|
350
|
+
return r.observe(a), () => {
|
|
351
|
+
r.disconnect();
|
|
352
|
+
};
|
|
353
|
+
}, [H, L, i, z]);
|
|
354
|
+
const ke = H ? { textMinHeightPx: te, captionMinHeightPx: ie } : void 0, me = H ? /* @__PURE__ */ c(
|
|
355
|
+
"div",
|
|
356
|
+
{
|
|
357
|
+
ref: re,
|
|
358
|
+
"aria-hidden": !0,
|
|
359
|
+
style: {
|
|
360
|
+
position: "absolute",
|
|
361
|
+
left: 0,
|
|
362
|
+
top: 0,
|
|
363
|
+
width: "100%",
|
|
364
|
+
visibility: "hidden",
|
|
365
|
+
pointerEvents: "none",
|
|
366
|
+
zIndex: -1
|
|
367
|
+
},
|
|
368
|
+
children: (i ?? []).map((a, n) => z(a, `measure-${n}`, { dataMeasureAttrs: !0 }))
|
|
369
|
+
}
|
|
370
|
+
) : null, ue = (a, n) => /* @__PURE__ */ y(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
style: {
|
|
374
|
+
position: "relative",
|
|
375
|
+
flex: "0 0 auto",
|
|
376
|
+
height: "100%",
|
|
377
|
+
transform: "translateZ(0)",
|
|
378
|
+
backfaceVisibility: "hidden",
|
|
379
|
+
WebkitBackfaceVisibility: "hidden",
|
|
380
|
+
willChange: "transform"
|
|
381
|
+
},
|
|
382
|
+
children: [
|
|
383
|
+
z(a, `card-${n}`, ke),
|
|
384
|
+
p && /* @__PURE__ */ c(
|
|
385
|
+
"div",
|
|
386
|
+
{
|
|
387
|
+
"data-controls": "gap",
|
|
388
|
+
"data-controls-axis": "x",
|
|
389
|
+
style: {
|
|
390
|
+
position: "absolute",
|
|
391
|
+
top: 0,
|
|
392
|
+
right: `calc(-1 * ${o(v)})`,
|
|
393
|
+
width: o(v),
|
|
394
|
+
height: "100%",
|
|
395
|
+
pointerEvents: "auto",
|
|
396
|
+
zIndex: 2
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
)
|
|
400
|
+
]
|
|
401
|
+
},
|
|
402
|
+
n
|
|
403
|
+
);
|
|
404
|
+
if (h) {
|
|
405
|
+
const a = k ? D && ge ? "paused" : "running" : "paused";
|
|
406
|
+
return /* @__PURE__ */ y(
|
|
407
|
+
"div",
|
|
408
|
+
{
|
|
409
|
+
ref: U,
|
|
410
|
+
className: He(`${d}-wrapper`, `${d}-marquee-wrapper`),
|
|
411
|
+
"aria-label": "Testimonials",
|
|
412
|
+
style: {
|
|
413
|
+
overflow: "hidden",
|
|
414
|
+
width: "100%",
|
|
415
|
+
...Y > 0 ? { height: Y } : {}
|
|
416
|
+
},
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ c("style", { dangerouslySetInnerHTML: { __html: Q } }),
|
|
419
|
+
me,
|
|
420
|
+
/* @__PURE__ */ c(
|
|
421
|
+
"div",
|
|
422
|
+
{
|
|
423
|
+
ref: F,
|
|
424
|
+
className: `${d}-marquee-track`,
|
|
425
|
+
"data-direction": j,
|
|
426
|
+
onMouseEnter: Se,
|
|
427
|
+
onMouseLeave: Ce,
|
|
428
|
+
style: {
|
|
429
|
+
display: "flex",
|
|
430
|
+
flexDirection: "row",
|
|
431
|
+
flexWrap: "nowrap",
|
|
432
|
+
width: "max-content",
|
|
433
|
+
willChange: "transform",
|
|
434
|
+
backfaceVisibility: "hidden",
|
|
435
|
+
WebkitBackfaceVisibility: "hidden",
|
|
436
|
+
transform: "translateZ(0)",
|
|
437
|
+
WebkitTransform: "translateZ(0)",
|
|
438
|
+
perspective: "1000px",
|
|
439
|
+
animationDuration: se,
|
|
440
|
+
WebkitAnimationDuration: se,
|
|
441
|
+
animationPlayState: a,
|
|
442
|
+
WebkitAnimationPlayState: a
|
|
443
|
+
},
|
|
444
|
+
children: Array.from({ length: de }, (n, r) => /* @__PURE__ */ c(
|
|
445
|
+
"div",
|
|
446
|
+
{
|
|
447
|
+
ref: r === 0 ? N : void 0,
|
|
448
|
+
className: `${d}-marquee-set`,
|
|
449
|
+
style: {
|
|
450
|
+
display: "flex",
|
|
451
|
+
flexDirection: "row",
|
|
452
|
+
flex: "0 0 auto",
|
|
453
|
+
gap: o(v),
|
|
454
|
+
paddingRight: o(v)
|
|
455
|
+
},
|
|
456
|
+
"aria-hidden": r > 0,
|
|
457
|
+
children: i == null ? void 0 : i.map(
|
|
458
|
+
(t, l) => ue(t, `${r}-${l}`)
|
|
459
|
+
)
|
|
460
|
+
},
|
|
461
|
+
`set-${r}`
|
|
462
|
+
))
|
|
463
|
+
}
|
|
464
|
+
)
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
return /* @__PURE__ */ y("div", { className: `${d}-wrapper`, children: [
|
|
470
|
+
/* @__PURE__ */ c("style", { dangerouslySetInnerHTML: { __html: Q } }),
|
|
471
|
+
me,
|
|
472
|
+
/* @__PURE__ */ c(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
style: {
|
|
476
|
+
gap: o(v),
|
|
477
|
+
justifyContent: "center",
|
|
478
|
+
overflowX: "auto",
|
|
479
|
+
display: "flex",
|
|
480
|
+
flexDirection: "row"
|
|
481
|
+
},
|
|
482
|
+
"aria-label": "Testimonials",
|
|
483
|
+
children: i == null ? void 0 : i.map(
|
|
484
|
+
(a, n) => ue(a, n)
|
|
485
|
+
)
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
] });
|
|
489
|
+
};
|
|
490
|
+
export {
|
|
491
|
+
Be as TestimonialGrid
|
|
492
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),Me=require("classnames"),Se=require("./RichTextRenderer-CIy6yI8U.js"),Te=require("./scalingValue-CSHYgTZl.js"),Ce=require("./textStylesToCss-CNN3zZTV.js"),ke=require("./useScopedStyles-Bf6yohVQ.js"),He=require("./readTestimonialTextMeasure-CEPaB4Sy.js");function Re(e,i){const m=i>0?`${i}px`:"0px";return`
|
|
2
|
+
.${e}-marquee-wrapper {
|
|
3
|
+
overflow: hidden;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@keyframes ${e}-marquee-left {
|
|
9
|
+
from { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
10
|
+
to { -webkit-transform: translate3d(-${m}, 0, 0); transform: translate3d(-${m}, 0, 0); }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes ${e}-marquee-right {
|
|
14
|
+
from { -webkit-transform: translate3d(-${m}, 0, 0); transform: translate3d(-${m}, 0, 0); }
|
|
15
|
+
to { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.${e}-marquee-track {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
width: max-content;
|
|
22
|
+
will-change: transform;
|
|
23
|
+
backface-visibility: hidden;
|
|
24
|
+
transform: translateZ(0);
|
|
25
|
+
-webkit-backface-visibility: hidden;
|
|
26
|
+
-webkit-transform: translateZ(0);
|
|
27
|
+
perspective: 1000px;
|
|
28
|
+
-webkit-animation-timing-function: linear;
|
|
29
|
+
animation-timing-function: linear;
|
|
30
|
+
-webkit-animation-iteration-count: infinite;
|
|
31
|
+
animation-iteration-count: infinite;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.${e}-marquee-track[data-direction="left"] {
|
|
35
|
+
-webkit-animation-name: ${e}-marquee-left;
|
|
36
|
+
animation-name: ${e}-marquee-left;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.${e}-marquee-track[data-direction="right"] {
|
|
40
|
+
-webkit-animation-name: ${e}-marquee-right;
|
|
41
|
+
animation-name: ${e}-marquee-right;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.${e}-marquee-set {
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: row;
|
|
47
|
+
flex: 0 0 auto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.${e}-wrapper {
|
|
51
|
+
position: relative;
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
order: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.${e}-cover {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
top: 0;
|
|
62
|
+
left: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.${e}-elements-overlay {
|
|
66
|
+
position: relative;
|
|
67
|
+
inset: 0;
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.${e}-control {
|
|
74
|
+
position: relative;
|
|
75
|
+
z-index: 2;
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.${e}-control::before {
|
|
80
|
+
content: "";
|
|
81
|
+
position: absolute;
|
|
82
|
+
top: 0;
|
|
83
|
+
left: 0;
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 100%;
|
|
86
|
+
min-height: 20px;
|
|
87
|
+
pointer-events: auto;
|
|
88
|
+
z-index: 10;
|
|
89
|
+
}
|
|
90
|
+
`}const je=30,de=2,qe=e=>{e.style.setProperty("animation-name","none"),e.style.setProperty("-webkit-animation-name","none"),e.offsetHeight,e.style.removeProperty("animation-name"),e.style.removeProperty("-webkit-animation-name")},Ae=({settings:e,content:i,isEditor:m,isPreviewMode:ue,isEditMode:me})=>{const{prefix:d}=ke.useScopedStyles(),{align:$,speed:L,direction:_,pauseOnHover:fe,gap:b,cardWidth:k,corners:H,stroke:M,strokeColor:D,bgColor:I,padding:h,logoMarginTop:z,logoWidth:R,logoHeight:j,captionMarginTop:V}=e,v=!!me,he=((i==null?void 0:i.length)??0)>0,S=L>0&&(!m||ue),x=he&&(S||m),O=Math.max(0,L)*je,s=t=>Te.scalingValue(t,m??!1),B=o.useRef(null),q=o.useRef(null),A=o.useRef(null),[P,xe]=o.useState(0),[y,K]=o.useState(0),p=y>0?y:0,Z=o.useMemo(()=>Re(d,p),[d,p]),[G,X]=o.useState(0),W=S&&fe==="on",[ye,U]=o.useState(!1),J=o.useRef(null),[Q,ve]=o.useState(0),[Y,be]=o.useState(0),ee=o.useRef(null),te=t=>{var a,r,c,u,g;return{fontSettings:{fontFamily:(e==null?void 0:e[`${t}FontFamily`])??"Arial",fontWeight:((a=e==null?void 0:e[`${t}FontSettings`])==null?void 0:a.fontWeight)??400,fontStyle:((r=e==null?void 0:e[`${t}FontSettings`])==null?void 0:r.fontStyle)??"normal"},textAppearance:{textTransform:((c=e==null?void 0:e[`${t}TextAppearance`])==null?void 0:c.textTransform)??"none",textDecoration:((u=e==null?void 0:e[`${t}TextAppearance`])==null?void 0:u.textDecoration)??"none",fontVariant:((g=e==null?void 0:e[`${t}TextAppearance`])==null?void 0:g.fontVariant)??"normal"},letterSpacing:(e==null?void 0:e[`${t}LetterSpacing`])??0,wordSpacing:(e==null?void 0:e[`${t}WordSpacing`])??0,fontSize:(e==null?void 0:e[`${t}FontSize`])??.01,lineHeight:(e==null?void 0:e[`${t}LineHeight`])??.01,color:(e==null?void 0:e[`${t}Color`])??"#000000"}},ae=te("text"),re=te("caption"),T=o.useMemo(()=>((i==null?void 0:i.length)??0)>1&&(i??[]).some(t=>{var n,a;return(((n=t.text)==null?void 0:n.length)??0)>0||(((a=t.caption)==null?void 0:a.length)??0)>0}),[i]),ie=o.useMemo(()=>!x||(i==null?void 0:i.length)===0?1:y<=0||P<=0?de:Math.max(de,Math.ceil(P/y)+1),[x,i==null?void 0:i.length,y,P]);o.useLayoutEffect(()=>{if(!x)return;const t=B.current,n=A.current;if(!t||!n)return;let a=0;const r=()=>{const g=t.getBoundingClientRect().width,f=n.getBoundingClientRect().width,se=ee.current,ce=typeof se=="number"&&Math.abs(se-f)<=.25;if(ee.current=f,xe(g),typeof f=="number"&&f>0&&y<=0){K(f);return}ce&&f!==y?K(f):!ce&&y<=0&&(cancelAnimationFrame(a),a=requestAnimationFrame(r))},c=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(r)};c();const u=new ResizeObserver(c);return u.observe(t),u.observe(n),()=>{cancelAnimationFrame(a),u.disconnect()}},[S,x,y]);const pe=p>0&&O>0?p/O*1e3:0,ne=`${Math.max(0,pe)/1e3}s`;o.useLayoutEffect(()=>{if(!x||p<=0)return;const t=q.current;t&&qe(t)},[x,p,_]),o.useLayoutEffect(()=>{if(!x){X(0);return}const t=A.current,n=q.current;if(!t||!n)return;const a=()=>{let c=0;for(let u=0;u<t.children.length;u++){const f=t.children[u].firstElementChild;f&&(c=Math.max(c,f.offsetHeight))}c<=0&&(c=n.offsetHeight),X(c>0?c:0)};a();const r=new ResizeObserver(a);return r.observe(t),r.observe(n),()=>{r.disconnect()}},[x,ie,i,m,b,k,h,M,H,R,j,Q,Y]);const we=()=>{W&&U(!0)},ge=()=>{W&&U(!1)},w=o.useMemo(()=>{switch($){case"center":return"center";case"end":return"flex-end";case"start":default:return"flex-start"}},[$]),C=o.useMemo(()=>{switch($){case"center":return"center";case"end":return"right";case"start":default:return"left"}},[$]),E=o.useCallback((t,n,a,r)=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[l.jsx("div",{"data-controls":v?r==null?void 0:r.controlsName:void 0,"data-controls-axis":v?"y":void 0,className:v?`${d}-control`:void 0,style:{height:s((r==null?void 0:r.marginTop)??0)}}),l.jsx("div",{...r!=null&&r.dataMeasureKind?{"data-testimonial-measure":r.dataMeasureKind}:{},style:{...Ce.textStylesToCss(t,m),textAlign:C,pointerEvents:"auto",...typeof(r==null?void 0:r.minHeightPx)=="number"&&r.minHeightPx>0?{minHeight:r.minHeightPx}:{}},children:l.jsx(Se.RichTextRenderer,{content:n})})]},a),[w,C,m,v,d,s]),F=o.useCallback((t,n,a)=>{var r,c,u;return l.jsxs("div",{style:{padding:`${s(h.top)} ${s(h.right)} ${s(h.bottom)} ${s(h.left)}`,width:s(k+M*2),height:"100%",borderRadius:s(H),border:`${s(M)} solid ${D}`,boxSizing:"border-box",position:"relative",overflow:"hidden"},children:[l.jsx("div",{className:`${d}-cover`,style:{background:I}}),l.jsxs("div",{className:`${d}-elements-overlay`,style:{alignItems:w,textAlign:C},children:[t.text&&E(ae,t.text,"text",a!=null&&a.dataMeasureAttrs?{dataMeasureKind:"text"}:typeof(a==null?void 0:a.textMinHeightPx)=="number"&&a.textMinHeightPx>0?{minHeightPx:a.textMinHeightPx}:void 0),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:w,width:"100%"},children:[l.jsx("div",{"data-controls":v&&!(a!=null&&a.dataMeasureAttrs)?"logoMarginTop":void 0,className:v&&!(a!=null&&a.dataMeasureAttrs)?`${d}-control`:void 0,style:{height:s(z)}}),l.jsx("div",{style:{width:s(R),height:s(j)},children:((r=t.logo)==null?void 0:r.assetId)&&l.jsx("img",{src:t.logo.assetId,alt:((c=t.logo)==null?void 0:c.name)??"",style:{pointerEvents:"auto",width:"100%",height:"100%",objectFit:((u=t.logo)==null?void 0:u.objectFit)||"contain"}})})]}),t.caption&&E(re,t.caption,"caption",{...a!=null&&a.dataMeasureAttrs?{}:{controlsName:"captionMarginTop"},marginTop:V,...a!=null&&a.dataMeasureAttrs?{dataMeasureKind:"caption"}:typeof(a==null?void 0:a.captionMinHeightPx)=="number"&&a.captionMinHeightPx>0?{minHeightPx:a.captionMinHeightPx}:{}})]})]},n)},[I,V,re,k,H,j,z,R,w,C,h.bottom,h.left,h.right,h.top,E,M,D,ae,m,v,d]),N=o.useCallback(t=>{ve(t.maxTextPx),be(t.maxCaptionPx)},[]);o.useLayoutEffect(()=>{if(!T){N({maxTextPx:0,maxCaptionPx:0});return}const t=J.current;if(!t)return;const n=()=>{He.readTestimonialTextMeasure(t,N)};n();const a=new ResizeObserver(n);return a.observe(t),()=>{a.disconnect()}},[T,N,i,F]);const $e=T?{textMinHeightPx:Q,captionMinHeightPx:Y}:void 0,oe=T?l.jsx("div",{ref:J,"aria-hidden":!0,style:{position:"absolute",left:0,top:0,width:"100%",visibility:"hidden",pointerEvents:"none",zIndex:-1},children:(i??[]).map((t,n)=>F(t,`measure-${n}`,{dataMeasureAttrs:!0}))}):null,le=(t,n)=>l.jsxs("div",{style:{position:"relative",flex:"0 0 auto",height:"100%",transform:"translateZ(0)",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",willChange:"transform"},children:[F(t,`card-${n}`,$e),v&&l.jsx("div",{"data-controls":"gap","data-controls-axis":"x",style:{position:"absolute",top:0,right:`calc(-1 * ${s(b)})`,width:s(b),height:"100%",pointerEvents:"auto",zIndex:2}})]},n);if(x){const t=S?W&&ye?"paused":"running":"paused";return l.jsxs("div",{ref:B,className:Me(`${d}-wrapper`,`${d}-marquee-wrapper`),"aria-label":"Testimonials",style:{overflow:"hidden",width:"100%",...G>0?{height:G}:{}},children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),oe,l.jsx("div",{ref:q,className:`${d}-marquee-track`,"data-direction":_,onMouseEnter:we,onMouseLeave:ge,style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",width:"max-content",willChange:"transform",backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",transform:"translateZ(0)",WebkitTransform:"translateZ(0)",perspective:"1000px",animationDuration:ne,WebkitAnimationDuration:ne,animationPlayState:t,WebkitAnimationPlayState:t},children:Array.from({length:ie},(n,a)=>l.jsx("div",{ref:a===0?A:void 0,className:`${d}-marquee-set`,style:{display:"flex",flexDirection:"row",flex:"0 0 auto",gap:s(b),paddingRight:s(b)},"aria-hidden":a>0,children:i==null?void 0:i.map((r,c)=>le(r,`${a}-${c}`))},`set-${a}`))})]})}return l.jsxs("div",{className:`${d}-wrapper`,children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:Z}}),oe,l.jsx("div",{style:{gap:s(b),justifyContent:"center",overflowX:"auto",display:"flex",flexDirection:"row"},"aria-label":"Testimonials",children:i==null?void 0:i.map((t,n)=>le(t,n))})]})};exports.TestimonialGrid=Ae;
|