@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.
Files changed (130) hide show
  1. package/README.md +25 -1
  2. package/dist/Burger-C6jI6C1c.js +661 -0
  3. package/dist/Burger-EMSn7TPB.mjs +1807 -0
  4. package/dist/ClickGallerie-D_O1XhAO.mjs +270 -0
  5. package/dist/ClickGallerie-M9xdGR1G.js +36 -0
  6. package/dist/Components/Burger/BurgerComponent.d.ts +0 -1
  7. package/dist/Components/ClickGallerie/ClickGallerieComponent.d.ts +0 -1
  8. package/dist/Components/FAQ/FAQComponent.d.ts +0 -1
  9. package/dist/Components/Form/FormComponent.d.ts +0 -1
  10. package/dist/Components/Grid/GridComponent.d.ts +0 -1
  11. package/dist/Components/Helix/HelixComponent.d.ts +0 -1
  12. package/dist/Components/Hive/HiveComponent.d.ts +0 -1
  13. package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +0 -1
  14. package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +0 -1
  15. package/dist/Components/List/ListComponent.d.ts +0 -1
  16. package/dist/Components/Marquee/MarqueeComponent.d.ts +0 -1
  17. package/dist/Components/MarqueeText/MarqueeTextComponent.d.ts +0 -1
  18. package/dist/Components/Mercury/MercuryComponent.d.ts +0 -1
  19. package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +0 -1
  20. package/dist/Components/Pretext/PretextComponent.d.ts +0 -1
  21. package/dist/Components/Scale/ScaleComponent.d.ts +0 -1
  22. package/dist/Components/SimpleButton/SimpleButtonComponent.d.ts +0 -1
  23. package/dist/Components/Slider20/Slider20Component.d.ts +0 -1
  24. package/dist/Components/TestimonialGrid/TestimonialGridComponent.d.ts +0 -1
  25. package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +0 -1
  26. package/dist/Components/Waterfall/WaterfallComponent.d.ts +0 -1
  27. package/dist/ControlSlider-SiOt22l_.js +1 -0
  28. package/dist/ControlSlider-pZv7H6BU.mjs +334 -0
  29. package/dist/FAQ-C7823fyi.js +166 -0
  30. package/dist/FAQ-CZ39u4m8.mjs +588 -0
  31. package/dist/Form-BX5_41nb.mjs +472 -0
  32. package/dist/Form-Dn-6A1He.js +153 -0
  33. package/dist/Grid-CemGhf3F.js +374 -0
  34. package/dist/Grid-cfQsXW3b.mjs +1553 -0
  35. package/dist/Helix-2Vr-9WBa.js +43 -0
  36. package/dist/Helix-BmkAKT1G.mjs +315 -0
  37. package/dist/Hive-BC6zQBsv.js +321 -0
  38. package/dist/Hive-BGMWinrW.mjs +1425 -0
  39. package/dist/HiveLightboxTitles-DhEeFKWs.mjs +507 -0
  40. package/dist/HiveLightboxTitles-DlyptAaK.js +1 -0
  41. package/dist/ImageRevealSlider-BBWtFjUF.js +1 -0
  42. package/dist/ImageRevealSlider-BdFGyVEP.mjs +184 -0
  43. package/dist/Lightbox-CIss_nOG.js +1 -0
  44. package/dist/Lightbox-eP9qAZzL.mjs +665 -0
  45. package/dist/LightboxJournal-D59ex6wH.mjs +1613 -0
  46. package/dist/LightboxJournal-DAEZOPDi.js +523 -0
  47. package/dist/LightboxStrip-BDjI1jyH.js +386 -0
  48. package/dist/LightboxStrip-YspzBP8N.mjs +1574 -0
  49. package/dist/List-C32WImI3.js +377 -0
  50. package/dist/List-DW7fyJbf.mjs +1891 -0
  51. package/dist/Marquee-BYClHHws.mjs +551 -0
  52. package/dist/Marquee-vmHaTGIP.js +133 -0
  53. package/dist/MarqueeText-4Rip_sQX.mjs +515 -0
  54. package/dist/MarqueeText-E6OubMOG.js +132 -0
  55. package/dist/Mercury-BwF_XW2w.js +267 -0
  56. package/dist/Mercury-DuKJQ1Zo.mjs +1701 -0
  57. package/dist/OnelinerForm-BEu7_sho.mjs +434 -0
  58. package/dist/OnelinerForm-C2Y_XMCY.js +194 -0
  59. package/dist/Pretext-10CcyP1E.mjs +2762 -0
  60. package/dist/Pretext-DvQ3xsni.js +231 -0
  61. package/dist/PretextComponent-C3YFICy8.js +1 -0
  62. package/dist/PretextComponent-Ct0newmn.mjs +11624 -0
  63. package/dist/RichTextRenderer-B6WtTYlR.mjs +32 -0
  64. package/dist/RichTextRenderer-CIy6yI8U.js +1 -0
  65. package/dist/Scale-976sjO8e.js +111 -0
  66. package/dist/Scale-rLNT4KAk.mjs +345 -0
  67. package/dist/SimpleButton-C-o2W9bS.mjs +451 -0
  68. package/dist/SimpleButton-nGEcO2gB.js +243 -0
  69. package/dist/Slider20-C9o2REDl.js +272 -0
  70. package/dist/Slider20-Dm8BeCli.mjs +851 -0
  71. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  72. package/dist/SvgImage-DFlmxAoL.js +1 -0
  73. package/dist/TestimonialGrid-CPu4qQ6B.mjs +492 -0
  74. package/dist/TestimonialGrid-D4ieiz9e.js +90 -0
  75. package/dist/TestimonialSingle-CVu15ZtV.js +125 -0
  76. package/dist/TestimonialSingle-DLdnAVF7.mjs +391 -0
  77. package/dist/Waterfall-A0FjM2my.mjs +1400 -0
  78. package/dist/Waterfall-DnPDHbCL.js +287 -0
  79. package/dist/buildColorVars-CE2D5cQV.js +1 -0
  80. package/dist/buildColorVars-CLyWQm5K.mjs +21 -0
  81. package/dist/components-OE3ac1dr.js +1 -0
  82. package/dist/components-w-jHX-2U.mjs +2053 -0
  83. package/dist/components.css +1 -1
  84. package/dist/elements.d.ts +7 -0
  85. package/dist/elements.js +1 -0
  86. package/dist/elements.mjs +63 -0
  87. package/dist/elements.node.d.ts +6 -0
  88. package/dist/elements.node.js +1 -0
  89. package/dist/elements.node.mjs +21 -0
  90. package/dist/forking.d.ts +1 -0
  91. package/dist/formFieldValidation-DZl2KVaF.js +1 -0
  92. package/dist/formFieldValidation-DvihFrq5.mjs +21 -0
  93. package/dist/getColorAlpha-BVBY0N5x.mjs +39 -0
  94. package/dist/getColorAlpha-CoSseoCn.js +1 -0
  95. package/dist/getImageRect-BQhQXvT8.js +1 -0
  96. package/dist/getImageRect-CBMhFNHM.mjs +109 -0
  97. package/dist/index.d.ts +1 -0
  98. package/dist/index.js +1 -28866
  99. package/dist/index.mjs +16 -62477
  100. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  101. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  102. package/dist/panelAvailability-D179wwJx.mjs +27 -0
  103. package/dist/panelAvailability-DnOe0rQ4.js +1 -0
  104. package/dist/react-splide.esm-CabaEmHi.js +6 -0
  105. package/dist/react-splide.esm-DQqds4PL.mjs +1750 -0
  106. package/dist/readTestimonialTextMeasure-BIXpGFEt.mjs +13 -0
  107. package/dist/readTestimonialTextMeasure-CEPaB4Sy.js +1 -0
  108. package/dist/scalingValue-C9JH5L6O.mjs +6 -0
  109. package/dist/scalingValue-CSHYgTZl.js +1 -0
  110. package/dist/sources.d.ts +1 -0
  111. package/dist/sources.js +23753 -0
  112. package/dist/sources.mjs +23779 -0
  113. package/dist/textStylesToCss-05Mn6I_2.mjs +32 -0
  114. package/dist/textStylesToCss-CNN3zZTV.js +1 -0
  115. package/dist/types/Component.d.ts +0 -1
  116. package/dist/useLightboxScrollLock-Hf16Eq4g.js +1 -0
  117. package/dist/useLightboxScrollLock-VQ07s7EJ.mjs +18 -0
  118. package/dist/useLightboxSwipeDismiss-Br9uE5G0.js +1 -0
  119. package/dist/useLightboxSwipeDismiss-SGv6Ra33.mjs +95 -0
  120. package/dist/useScopedStyles-Bf6yohVQ.js +1 -0
  121. package/dist/useScopedStyles-DhBG3557.mjs +11 -0
  122. package/dist/utils-033j3qNL.js +1 -0
  123. package/dist/utils-FxC9rcxw.mjs +247 -0
  124. package/dist/utils.js +1 -1
  125. package/dist/utils.mjs +17 -11
  126. package/package.json +31 -2
  127. package/dist/index-2JTNRDR1.js +0 -1
  128. package/dist/index-DA8t6EZ4.mjs +0 -255
  129. package/dist/panelAvailability-CgSic84c.mjs +0 -126
  130. package/dist/panelAvailability-D8c7cdbu.js +0 -1
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),f=require("react"),ne=require("./scalingValue-CSHYgTZl.js"),Me=require("./useScopedStyles-Bf6yohVQ.js"),xe=10,Ie=400,Oe=1,Re=1120/1440,Ee=140/1440,Se=550/1440,Te=13,_e=4,Fe=38/100,Ae=28/100,se=2.8,we=.9,le=.22,Ne=.5,De=1,$e=1.5,Ce=0,He=.85;function Pe(e){return`
2
+ .${e}-wrapper {
3
+ position: relative;
4
+ box-sizing: border-box;
5
+ overflow: hidden;
6
+ isolation: isolate;
7
+ contain: layout paint;
8
+ }
9
+ .${e}-item {
10
+ position: absolute;
11
+ left: 0;
12
+ width: var(--helix-base-w);
13
+ overflow: hidden;
14
+ transform-origin: center center;
15
+ }
16
+ .${e}-item-cover {
17
+ height: var(--helix-base-h);
18
+ }
19
+ .${e}-media {
20
+ display: block;
21
+ width: 100%;
22
+ max-width: 100%;
23
+ height: auto;
24
+ vertical-align: top;
25
+ user-select: none;
26
+ pointer-events: none;
27
+ }
28
+ .${e}-cover {
29
+ display: block;
30
+ width: 100%;
31
+ height: 100%;
32
+ overflow: hidden;
33
+ position: relative;
34
+ }
35
+ .${e}-cover .${e}-media {
36
+ position: absolute;
37
+ inset: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ object-fit: cover;
41
+ object-position: center;
42
+ }
43
+ `}function ue(e){return Number(e.toFixed(4))}function ce(e,t,o,r){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,Math.round(a))):t}function G(e,t,o=0,r=9999){const a=(typeof e=="string"?Number(e):e)??t;return Number.isFinite(a)?Math.min(r,Math.max(o,a)):t}function ge(e){return typeof e=="string"?{display:e.toLowerCase()==="cover"?"cover":"fit",ratioValue:"2:3",reversed:!1}:{display:(typeof(e==null?void 0:e.display)=="string"?e.display.toLowerCase():"")==="cover"?"cover":"fit",ratioValue:(e==null?void 0:e.ratioValue)??"2:3",reversed:(e==null?void 0:e.reversed)??!1}}function Le(e){const[t,o]=e.ratioValue.split(":").map(Number),r=e.reversed?o:t;return(e.reversed?t:o)/r}function Ue(e){return e.type==="video"?!0:e.type==="image"?!1:/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name??"")||/\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId??"")}function de(e,t){return(1-e)/(1-e*Math.cos(t))}function je(e){let t=0;for(let o=0;o<360;o+=1){const r=o*Math.PI/180;t=Math.max(t,Math.abs(Math.sin(r)*de(e,r)))}return t||1}function ze(e,t){return e?1:1+le*(.35+t)}function We(e,t,o,r){const n=t*ze(o,r);return Math.max(0,(e-n)/2)}function Be(e,t,o){const r=de(e,o);return{offset:Math.sin(o)*r/t,scale:r}}function Ge(e,t,o){return e/2+t*o}function Ve(e,t,o){return`translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${ue(o)})`}function qe(e){return Math.round(e*1e3)}function fe(e,t,o){const r=Math.cos(e),n=Math.cos(He*Math.PI/2);if(r>=n)return o;const a=(r+1)/(n+1);return ue(t+(o-t)*a)}function ke(e){return fe(e,Ne,De)}function Xe(e){return fe(e,$e,Ce)}function Je(e,t){if(!t)return"none";const o=Xe(e);return o<=0?"none":`blur(${o}px)`}function ie(e,t){const o=t*Math.PI*2,{offset:r,scale:n}=Be(e.depthFactor,e.spreadFactor,o),a=Ge(e.width,e.orbitRadius,r);return{transform:Ve(e.scaled,a,n),zIndex:qe(n),opacity:ke(o),filter:Je(o,e.blurEnabled)}}function me(e,t){return(e%t+t)%t}function Ye(e,t){return V(e,t)/t}function V(e,t){return me(e,t)}function Ze(e,t){return Math.floor(e/t)}function Ke(e,t,o,r){return Ze(e,t)*o+V(e,t)*r}function ae(e){const t=Math.sin(e*12.9898)*43758.5453;return t-Math.floor(t)}function P(e){const t=e%1;return t<0?t+1:t}function Qe(e,t,o){const r=t/se,n=o==="left"?-e*r:e*r;return P(n)}function et({settings:e,content:t,isEditor:o,isPreviewMode:r}){const{prefix:n}=Me.useScopedStyles(),a=f.useRef(null),M=G((e==null?void 0:e.width)??(e==null?void 0:e.spread)??(e==null?void 0:e.wrapperWidth),Re),T=G(e==null?void 0:e.imageWidth,Ee),g=G(e==null?void 0:e.turnHeight,Se),h=ce(e==null?void 0:e.itemsPerTurn,Te,3,40),L=ce(e==null?void 0:e.turns,_e,1,30),_=Math.min(we,Math.max(0,Fe)),O=Math.min(1,Math.max(0,Ae)),F=Math.max(0,(e==null?void 0:e.speed)??se),U=(e==null?void 0:e.direction)==="left"?"left":"right",q=(e==null?void 0:e.playback)==="scroll"?"scroll":"autoplay",k=(e==null?void 0:e.cornerRadius)??0,X=(e==null?void 0:e.blur)!=="off",J=f.useMemo(()=>ge(e==null?void 0:e.imageDisplay),[e==null?void 0:e.imageDisplay]),b=J.display==="cover",v=i=>ne.scalingValue(i,o??!1),Y=f.useMemo(()=>je(_),[_]),Z=f.useMemo(()=>We(M,T,b,O),[M,T,b,O]),K=f.useMemo(()=>Pe(n),[n]),j=f.useMemo(()=>({scaled:i=>ne.scalingValue(i,o??!1),width:M,orbitRadius:Z,depthFactor:_,spreadFactor:Y,blurEnabled:X}),[o,M,Z,_,Y,X]),Q=f.useRef([]),R=f.useRef(0),A=f.useMemo(()=>(t??[]).filter(i=>{var u;return!!((u=i.image)!=null&&u.assetId)}),[t]),z=g/h,he=T*Le(J),pe=Math.min(Ie,L*h),w=Oe*h,ee=pe+w*2,be=Math.max(0,L-1)*g+(h-1)*z,te=F>0,N=q==="scroll"&&te,D=q==="autoplay"&&te&&(o?!!r:!0),oe=D?360/(F*xe):0,re=A.length===0?0:ee,W=f.useMemo(()=>Array.from({length:re},(i,u)=>Ye(u-w,h)),[re,w,h]);f.useEffect(()=>{if(!D&&!N)return;const i=a.current;if(!i)return;const u=c=>{R.current=c,W.forEach((s,I)=>{const m=Q.current[I];if(!m)return;const d=ie(j,P(s+c));m.style.transform=d.transform,m.style.zIndex=String(d.zIndex),m.style.opacity=String(d.opacity),m.style.filter=d.filter})};if(N){const c=i.ownerDocument.defaultView??window,s=()=>{const m=i.getBoundingClientRect(),d=c.innerHeight||i.ownerDocument.documentElement.clientHeight,S=d+m.height;if(S<=0)return;const H=Math.min(1,Math.max(0,(d-m.top)/S));u(Qe(H,F,U))};s(),c.addEventListener("scroll",s,{passive:!0,capture:!0}),c.addEventListener("resize",s);const I=new ResizeObserver(s);return I.observe(i),()=>{c.removeEventListener("scroll",s,{capture:!0}),c.removeEventListener("resize",s),I.disconnect()}}const x=U==="left"?-1:1;let y=null,p=null;const E=c=>{if(p!==null){const s=(c-p)/1e3/oe*x;R.current=P(R.current+s)}p=c,u(R.current),y=requestAnimationFrame(E)},B=()=>{y===null&&(p=null,y=requestAnimationFrame(E))},$=()=>{y!==null&&cancelAnimationFrame(y),y=null},C=new IntersectionObserver(([c])=>{c!=null&&c.isIntersecting?B():$()});return C.observe(i),()=>{$(),C.disconnect()}},[D,N,W,j,oe,F,U]);const ve=D||N?R.current:0;return A.length===0?l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:K}}),l.jsx("div",{className:`${n}-wrapper`,style:{width:v(M)}})]}):l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:K}}),l.jsx("div",{ref:a,className:`${n}-wrapper`,style:{width:v(M),height:v(be)},children:Array.from({length:ee},(i,u)=>{const x=u-w,p=A[me(x,A.length)].image,E=V(x,h),B=W[u],$=Ke(x,h,g,z),C=O===0?0:(ae(E+7.3)-.5)*O*z,c=b?1:1+(ae(E+3.1)-.5)*2*le*(.35+O),s=T*c,I={"--helix-base-w":v(s),...b?{"--helix-base-h":v(he)}:{}},m={top:v($+C),...I,...ie(j,P(B+ve))},d=k>0?{borderRadius:v(k)}:{},S=b?{...d,width:"100%",height:"100%",objectFit:"cover",objectPosition:"center"}:d,H=Ue(p)?l.jsx("video",{className:`${n}-media`,style:S,src:p.assetId,muted:!0,loop:!0,autoPlay:!0,playsInline:!0,preload:"auto"}):l.jsx("img",{className:`${n}-media`,style:S,src:p.assetId,alt:p.name??"",loading:"lazy",decoding:"async"});return l.jsx("div",{ref:ye=>{Q.current[u]=ye},className:b?`${n}-item ${n}-item-cover`:`${n}-item`,style:m,children:b?l.jsx("div",{className:`${n}-cover`,style:d,children:H}):H},`${L}-${h}-${x}`)})})]})}exports.Helix=et;
@@ -0,0 +1,315 @@
1
+ import { jsxs as ce, Fragment as ie, jsx as h } from "react/jsx-runtime";
2
+ import { useRef as j, useMemo as y, useEffect as Ee } from "react";
3
+ import { s as ae } from "./scalingValue-C9JH5L6O.mjs";
4
+ import { u as xe } from "./useScopedStyles-DhBG3557.mjs";
5
+ const Re = 10, Te = 400, _e = 1, Se = 1120 / 1440, Fe = 140 / 1440, Ae = 550 / 1440, we = 13, Ne = 4, De = 38 / 100, $e = 28 / 100, de = 2.8, Ce = 0.9, fe = 0.22, He = 0.5, Pe = 1, Le = 1.5, Ue = 0, ge = 0.85;
6
+ function ze(e) {
7
+ return `
8
+ .${e}-wrapper {
9
+ position: relative;
10
+ box-sizing: border-box;
11
+ overflow: hidden;
12
+ isolation: isolate;
13
+ contain: layout paint;
14
+ }
15
+ .${e}-item {
16
+ position: absolute;
17
+ left: 0;
18
+ width: var(--helix-base-w);
19
+ overflow: hidden;
20
+ transform-origin: center center;
21
+ }
22
+ .${e}-item-cover {
23
+ height: var(--helix-base-h);
24
+ }
25
+ .${e}-media {
26
+ display: block;
27
+ width: 100%;
28
+ max-width: 100%;
29
+ height: auto;
30
+ vertical-align: top;
31
+ user-select: none;
32
+ pointer-events: none;
33
+ }
34
+ .${e}-cover {
35
+ display: block;
36
+ width: 100%;
37
+ height: 100%;
38
+ overflow: hidden;
39
+ position: relative;
40
+ }
41
+ .${e}-cover .${e}-media {
42
+ position: absolute;
43
+ inset: 0;
44
+ width: 100%;
45
+ height: 100%;
46
+ object-fit: cover;
47
+ object-position: center;
48
+ }
49
+ `;
50
+ }
51
+ function me(e) {
52
+ return Number(e.toFixed(4));
53
+ }
54
+ function le(e, t, o, r) {
55
+ const a = (typeof e == "string" ? Number(e) : e) ?? t;
56
+ return Number.isFinite(a) ? Math.min(r, Math.max(o, Math.round(a))) : t;
57
+ }
58
+ function V(e, t, o = 0, r = 9999) {
59
+ const a = (typeof e == "string" ? Number(e) : e) ?? t;
60
+ return Number.isFinite(a) ? Math.min(r, Math.max(o, a)) : t;
61
+ }
62
+ function We(e) {
63
+ return typeof e == "string" ? {
64
+ display: e.toLowerCase() === "cover" ? "cover" : "fit",
65
+ ratioValue: "2:3",
66
+ reversed: !1
67
+ } : {
68
+ display: (typeof (e == null ? void 0 : e.display) == "string" ? e.display.toLowerCase() : "") === "cover" ? "cover" : "fit",
69
+ ratioValue: (e == null ? void 0 : e.ratioValue) ?? "2:3",
70
+ reversed: (e == null ? void 0 : e.reversed) ?? !1
71
+ };
72
+ }
73
+ function Be(e) {
74
+ const [t, o] = e.ratioValue.split(":").map(Number), r = e.reversed ? o : t;
75
+ return (e.reversed ? t : o) / r;
76
+ }
77
+ function Ge(e) {
78
+ return e.type === "video" ? !0 : e.type === "image" ? !1 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name ?? "") || /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId ?? "");
79
+ }
80
+ function he(e, t) {
81
+ return (1 - e) / (1 - e * Math.cos(t));
82
+ }
83
+ function je(e) {
84
+ let t = 0;
85
+ for (let o = 0; o < 360; o += 1) {
86
+ const r = o * Math.PI / 180;
87
+ t = Math.max(t, Math.abs(Math.sin(r) * he(e, r)));
88
+ }
89
+ return t || 1;
90
+ }
91
+ function Ve(e, t) {
92
+ return e ? 1 : 1 + fe * (0.35 + t);
93
+ }
94
+ function ke(e, t, o, r) {
95
+ const n = t * Ve(o, r);
96
+ return Math.max(0, (e - n) / 2);
97
+ }
98
+ function Xe(e, t, o) {
99
+ const r = he(e, o);
100
+ return {
101
+ offset: Math.sin(o) * r / t,
102
+ scale: r
103
+ };
104
+ }
105
+ function Je(e, t, o) {
106
+ return e / 2 + t * o;
107
+ }
108
+ function Ye(e, t, o) {
109
+ return `translate(calc(${e(t)} - var(--helix-base-w) / 2), -50%) scale(${me(o)})`;
110
+ }
111
+ function Ze(e) {
112
+ return Math.round(e * 1e3);
113
+ }
114
+ function pe(e, t, o) {
115
+ const r = Math.cos(e), n = Math.cos(ge * Math.PI / 2);
116
+ if (r >= n)
117
+ return o;
118
+ const a = (r + 1) / (n + 1);
119
+ return me(t + (o - t) * a);
120
+ }
121
+ function qe(e) {
122
+ return pe(e, He, Pe);
123
+ }
124
+ function Ke(e) {
125
+ return pe(e, Le, Ue);
126
+ }
127
+ function Qe(e, t) {
128
+ if (!t) return "none";
129
+ const o = Ke(e);
130
+ return o <= 0 ? "none" : `blur(${o}px)`;
131
+ }
132
+ function se(e, t) {
133
+ const o = t * Math.PI * 2, { offset: r, scale: n } = Xe(e.depthFactor, e.spreadFactor, o), a = Je(e.width, e.orbitRadius, r);
134
+ return {
135
+ transform: Ye(e.scaled, a, n),
136
+ zIndex: Ze(n),
137
+ opacity: qe(o),
138
+ filter: Qe(o, e.blurEnabled)
139
+ };
140
+ }
141
+ function be(e, t) {
142
+ return (e % t + t) % t;
143
+ }
144
+ function et(e, t) {
145
+ return k(e, t) / t;
146
+ }
147
+ function k(e, t) {
148
+ return be(e, t);
149
+ }
150
+ function tt(e, t) {
151
+ return Math.floor(e / t);
152
+ }
153
+ function ot(e, t, o, r) {
154
+ return tt(e, t) * o + k(e, t) * r;
155
+ }
156
+ function ue(e) {
157
+ const t = Math.sin(e * 12.9898) * 43758.5453;
158
+ return t - Math.floor(t);
159
+ }
160
+ function P(e) {
161
+ const t = e % 1;
162
+ return t < 0 ? t + 1 : t;
163
+ }
164
+ function rt(e, t, o) {
165
+ const r = t / de, n = o === "left" ? -e * r : e * r;
166
+ return P(n);
167
+ }
168
+ function st({
169
+ settings: e,
170
+ content: t,
171
+ isEditor: o,
172
+ isPreviewMode: r
173
+ }) {
174
+ const { prefix: n } = xe(), a = j(null), M = V(
175
+ (e == null ? void 0 : e.width) ?? (e == null ? void 0 : e.spread) ?? (e == null ? void 0 : e.wrapperWidth),
176
+ Se
177
+ ), _ = V(e == null ? void 0 : e.imageWidth, Fe), L = V(e == null ? void 0 : e.turnHeight, Ae), f = le(e == null ? void 0 : e.itemsPerTurn, we, 3, 40), U = le(e == null ? void 0 : e.turns, Ne, 1, 30), S = Math.min(Ce, Math.max(0, De)), E = Math.min(1, Math.max(0, $e)), F = Math.max(0, (e == null ? void 0 : e.speed) ?? de), g = (e == null ? void 0 : e.direction) === "left" ? "left" : "right", X = (e == null ? void 0 : e.playback) === "scroll" ? "scroll" : "autoplay", J = (e == null ? void 0 : e.cornerRadius) ?? 0, Y = (e == null ? void 0 : e.blur) !== "off", Z = y(() => We(e == null ? void 0 : e.imageDisplay), [e == null ? void 0 : e.imageDisplay]), p = Z.display === "cover", b = (i) => ae(i, o ?? !1), q = y(() => je(S), [S]), K = y(
178
+ () => ke(M, _, p, E),
179
+ [M, _, p, E]
180
+ ), Q = y(() => ze(n), [n]), z = y(
181
+ () => ({
182
+ scaled: (i) => ae(i, o ?? !1),
183
+ width: M,
184
+ orbitRadius: K,
185
+ depthFactor: S,
186
+ spreadFactor: q,
187
+ blurEnabled: Y
188
+ }),
189
+ [o, M, K, S, q, Y]
190
+ ), ee = j([]), x = j(0), A = y(
191
+ () => (t ?? []).filter((i) => {
192
+ var s;
193
+ return !!((s = i.image) != null && s.assetId);
194
+ }),
195
+ [t]
196
+ ), W = L / f, ve = _ * Be(Z), ye = Math.min(Te, U * f), w = _e * f, te = ye + w * 2, Me = Math.max(0, U - 1) * L + (f - 1) * W, oe = F > 0, N = X === "scroll" && oe, D = X === "autoplay" && oe && (o ? !!r : !0), re = D ? 360 / (F * Re) : 0, ne = A.length === 0 ? 0 : te, B = y(
197
+ () => Array.from({ length: ne }, (i, s) => et(s - w, f)),
198
+ [ne, w, f]
199
+ );
200
+ Ee(() => {
201
+ if (!D && !N) return;
202
+ const i = a.current;
203
+ if (!i) return;
204
+ const s = (c) => {
205
+ x.current = c, B.forEach((l, O) => {
206
+ const d = ee.current[O];
207
+ if (!d) return;
208
+ const u = se(z, P(l + c));
209
+ d.style.transform = u.transform, d.style.zIndex = String(u.zIndex), d.style.opacity = String(u.opacity), d.style.filter = u.filter;
210
+ });
211
+ };
212
+ if (N) {
213
+ const c = i.ownerDocument.defaultView ?? window, l = () => {
214
+ const d = i.getBoundingClientRect(), u = c.innerHeight || i.ownerDocument.documentElement.clientHeight, T = u + d.height;
215
+ if (T <= 0) return;
216
+ const H = Math.min(1, Math.max(0, (u - d.top) / T));
217
+ s(rt(H, F, g));
218
+ };
219
+ l(), c.addEventListener("scroll", l, { passive: !0, capture: !0 }), c.addEventListener("resize", l);
220
+ const O = new ResizeObserver(l);
221
+ return O.observe(i), () => {
222
+ c.removeEventListener("scroll", l, { capture: !0 }), c.removeEventListener("resize", l), O.disconnect();
223
+ };
224
+ }
225
+ const I = g === "left" ? -1 : 1;
226
+ let v = null, m = null;
227
+ const R = (c) => {
228
+ if (m !== null) {
229
+ const l = (c - m) / 1e3 / re * I;
230
+ x.current = P(x.current + l);
231
+ }
232
+ m = c, s(x.current), v = requestAnimationFrame(R);
233
+ }, G = () => {
234
+ v === null && (m = null, v = requestAnimationFrame(R));
235
+ }, $ = () => {
236
+ v !== null && cancelAnimationFrame(v), v = null;
237
+ }, C = new IntersectionObserver(([c]) => {
238
+ c != null && c.isIntersecting ? G() : $();
239
+ });
240
+ return C.observe(i), () => {
241
+ $(), C.disconnect();
242
+ };
243
+ }, [D, N, B, z, re, F, g]);
244
+ const Ie = D || N ? x.current : 0;
245
+ return A.length === 0 ? /* @__PURE__ */ ce(ie, { children: [
246
+ /* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: Q } }),
247
+ /* @__PURE__ */ h("div", { className: `${n}-wrapper`, style: { width: b(M) } })
248
+ ] }) : /* @__PURE__ */ ce(ie, { children: [
249
+ /* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: Q } }),
250
+ /* @__PURE__ */ h(
251
+ "div",
252
+ {
253
+ ref: a,
254
+ className: `${n}-wrapper`,
255
+ style: {
256
+ width: b(M),
257
+ height: b(Me)
258
+ },
259
+ children: Array.from({ length: te }, (i, s) => {
260
+ const I = s - w, m = A[be(I, A.length)].image, R = k(I, f), G = B[s], $ = ot(I, f, L, W), C = E === 0 ? 0 : (ue(R + 7.3) - 0.5) * E * W, c = p ? 1 : 1 + (ue(R + 3.1) - 0.5) * 2 * fe * (0.35 + E), l = _ * c, O = {
261
+ "--helix-base-w": b(l),
262
+ ...p ? { "--helix-base-h": b(ve) } : {}
263
+ }, d = {
264
+ top: b($ + C),
265
+ ...O,
266
+ ...se(z, P(G + Ie))
267
+ }, u = J > 0 ? { borderRadius: b(J) } : {}, T = p ? {
268
+ ...u,
269
+ width: "100%",
270
+ height: "100%",
271
+ objectFit: "cover",
272
+ objectPosition: "center"
273
+ } : u, H = Ge(m) ? /* @__PURE__ */ h(
274
+ "video",
275
+ {
276
+ className: `${n}-media`,
277
+ style: T,
278
+ src: m.assetId,
279
+ muted: !0,
280
+ loop: !0,
281
+ autoPlay: !0,
282
+ playsInline: !0,
283
+ preload: "auto"
284
+ }
285
+ ) : /* @__PURE__ */ h(
286
+ "img",
287
+ {
288
+ className: `${n}-media`,
289
+ style: T,
290
+ src: m.assetId,
291
+ alt: m.name ?? "",
292
+ loading: "lazy",
293
+ decoding: "async"
294
+ }
295
+ );
296
+ return /* @__PURE__ */ h(
297
+ "div",
298
+ {
299
+ ref: (Oe) => {
300
+ ee.current[s] = Oe;
301
+ },
302
+ className: p ? `${n}-item ${n}-item-cover` : `${n}-item`,
303
+ style: d,
304
+ children: p ? /* @__PURE__ */ h("div", { className: `${n}-cover`, style: u, children: H }) : H
305
+ },
306
+ `${U}-${f}-${I}`
307
+ );
308
+ })
309
+ }
310
+ )
311
+ ] });
312
+ }
313
+ export {
314
+ st as Helix
315
+ };