@cntrl-site/components 1.0.101 → 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 -28862
  99. package/dist/index.mjs +16 -62473
  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,523 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),o=require("react"),Nt=require("react-dom"),di=require("./useScopedStyles-Bf6yohVQ.js"),G=require("./useLightboxSwipeDismiss-Br9uE5G0.js"),lt=require("./scalingValue-CSHYgTZl.js"),ui=require("./SvgImage-DFlmxAoL.js"),hi=require("./useLightboxScrollLock-Hf16Eq4g.js"),l=require("./utils-033j3qNL.js"),fi=({prefix:e,entries:J,settings:I,isEditor:w,isEditMode:f,isPreviewMode:te,initialSlideIndex:U=0,enableUrlSync:j=!1,journalItemId:N=null,onBeforeClose:q,onClose:X})=>{const{type:k,coverFit:re,backgroundColor:_e,imageGap:L,maxWidth:De,maxHeight:ae,textTransition:E,title1Width:V,title2Width:Y,title3Width:C,title1MarginLeft:H=0,title2MarginLeft:S=0,title3MarginLeft:we=0,titleRowMarginBottom:ie=0,titleHeaderLayout:Ae="single-row",countCloseGap:b=0,closeIcon:M,closeIconMaxWidth:F,closeIconColor:ce,closeIconHoverColor:st,contentMarginTop:kt=0,iconMarginRight:Ct=0}=I,m=o.useCallback(t=>lt.scalingValue(t,w??!1),[w]),Je=m(L??0),Lt=`${De}%`,Ht=`${ae}%`,ye=m(b),Mt=m(kt),rt=m(Ct),ne=l.journalTextFieldsToCss("title1",l.resolveJournalTextFields(I,"title1"),w),de=l.journalTextFieldsToCss("title2",l.resolveJournalTextFields(I,"title2"),w),ue=l.journalTextFieldsToCss("title3",l.resolveJournalTextFields(I,"title3"),w),_t=l.journalTextFieldsToCss("count",l.resolveJournalTextFields(I,"count"),w),p=Ae==="mobile",z=!w||!!te,Dt=!f&&(!w||!!te),u=o.useMemo(()=>l.buildJournalSlides(J,k),[J,k]),[y,Ee]=o.useState(U),he=u[y],h=he==null?void 0:he.entry,[at,ct]=o.useState(!1),[dt,fe]=o.useState(null),[$,me]=o.useState(!1),[ut,Fe]=o.useState(null),[ht,ze]=o.useState(!1),[Be,ft]=o.useState(0),[oe,ge]=o.useState(),[be,xe]=o.useState(),[$e,Te]=o.useState(null),Z=o.useRef(null),Se=o.useRef(0),Ie=o.useRef(0),mt=o.useRef(0),gt=o.useRef(!1),Ke=o.useRef(null),Oe=o.useRef(null),B=o.useRef(null),K=o.useRef(null),Ge=o.useRef(null),xt=o.useRef(null),je=o.useRef(null),pt=o.useCallback(()=>{const t=Oe.current;if(!t)return;const n=t.closest(`.${e}-lightbox-content-area`);if(!n)return t.getBoundingClientRect().width;const a=Array.from(n.children).reduce((s,r)=>!(r instanceof HTMLElement)||r.contains(t)?s:s+r.getBoundingClientRect().width,0);return n.getBoundingClientRect().width-a},[e]),Q=o.useCallback(()=>{Z.current&&(clearTimeout(Z.current),Z.current=null)},[]),At=o.useCallback(t=>{t===Se.current&&(Fe(null),ze(!1))},[]),pe=o.useCallback(()=>{f||gt.current||(gt.current=!0,q==null||q(),ct(!1),Ke.current=setTimeout(()=>{X()},300))},[f,q,X]),Jt=o.useCallback(t=>!!(t.closest("[data-controls]")||t.closest(`.${e}-close-icon`)),[e]),{isSwipeDragging:Ue,backdropStyle:Et,mediaAreaStyle:Ft,overlayContentStyle:zt,swipeHandlers:Bt,dismissAreaStyle:Kt}=G.useLightboxSwipeDismiss({enabled:Dt,onClose:pe,animMs:300,isBlockedTarget:Jt}),vt=o.useCallback(t=>{j&&l.setJournalUrlParam(t+1,N,!0)},[j,N]),qe=o.useCallback(t=>{if(t)return t.getBoundingClientRect().height},[]),le=o.useCallback(t=>{if(u.length===0)return;const n=(t%u.length+u.length)%u.length;if(n===y)return;const a=u[y],s=u[n];Se.current+=1;const r=Se.current,d=E==="fade"&&l.getEntryTitleKey(a==null?void 0:a.entry)!==l.getEntryTitleKey(s==null?void 0:s.entry),x=qe(B.current),c=d?(()=>{const R=pt();Nt.flushSync(()=>{Te(s.entry)}),B.current&&R&&(B.current.style.width=`${R}px`);const Me=qe(B.current);return B.current&&(B.current.style.width=""),{measuredIncomingTitlesHeight:Me,incomingTitlesMeasureWidth:R}})():void 0,T=Math.max(x??0,(c==null?void 0:c.measuredIncomingTitlesHeight)??0)||void 0;ft(r),Fe(y),ze(!0),Ee(n),vt(n),mt.current=n,d?(Q(),T&&ge(T),c!=null&&c.incomingTitlesMeasureWidth&&xe(c.incomingTitlesMeasureWidth),fe((a==null?void 0:a.entryIndex)??null),me(!0),Ie.current=s.entryIndex,Z.current=setTimeout(()=>{fe(null),me(!1),ge(void 0),xe(void 0),Te(null),Z.current=null},400)):(Q(),fe(null),me(!1),ge(void 0),xe(void 0),Te(null),Ie.current=s.entryIndex)},[y,Q,pt,qe,u,vt,E]),ve=o.useCallback(()=>{je.current=null},[]),Ot=o.useCallback(t=>{!z||u.length<=1||t.pointerType==="mouse"&&t.button!==0||t.target.closest("[data-controls]")||(je.current={startX:t.clientX,startY:t.clientY,pointerId:t.pointerId})},[z,u.length]),Gt=o.useCallback(t=>{var R;if(!z||u.length<=1||t.pointerType==="mouse"&&t.button!==0)return;if(Ue){ve();return}const n=je.current;if(!n||n.pointerId!==t.pointerId||(ve(),t.target.closest("[data-controls]")))return;const s=t.clientX-n.startX,r=t.clientY-n.startY,d=Math.abs(s),x=Math.abs(r);if(d>=l.STRIP_NAV_SWIPE_MIN_PX&&d>x){le(s>0?y-1:y+1);return}if(d>l.STRIP_NAV_TAP_MAX_PX||x>l.STRIP_NAV_TAP_MAX_PX)return;const c=(R=K.current)==null?void 0:R.getBoundingClientRect(),T=c?c.left+c.width/2:window.innerWidth/2;le(t.clientX<T?y-1:y+1)},[y,z,le,Ue,ve,u.length]),Ut=o.useCallback(t=>{const n=je.current;(n==null?void 0:n.pointerId)===t.pointerId&&ve()},[ve]);hi.useLightboxScrollLock(),o.useEffect(()=>{xt.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const t=requestAnimationFrame(()=>{ct(!0),requestAnimationFrame(()=>{Ge.current?Ge.current.focus():K.current&&K.current.focus()})});return()=>{cancelAnimationFrame(t),Ke.current&&clearTimeout(Ke.current),Z.current&&clearTimeout(Z.current);const n=xt.current;n&&document.contains(n)&&n.focus({preventScroll:!0})}},[]),o.useEffect(()=>{var t;E!=="fade"&&(Ie.current=((t=u[y])==null?void 0:t.entryIndex)??0,Q(),fe(null),me(!1),ge(void 0),xe(void 0))},[y,Q,u,E]),o.useEffect(()=>{const t=n=>{if(n.key==="Escape"){pe();return}if(n.key==="ArrowLeft"&&u.length>1){le(y-1);return}if(n.key==="ArrowRight"&&u.length>1){le(y+1);return}if(n.key==="Tab"&&K.current){const a=K.current.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'),s=Array.from(a).filter(c=>!c.closest('[aria-hidden="true"]'));if(s.length===0)return;const r=s[0],d=s[s.length-1],x=document.activeElement;n.shiftKey?(x===r||!K.current.contains(x))&&(n.preventDefault(),d.focus()):(x===d||!K.current.contains(x))&&(n.preventDefault(),r.focus())}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[le,pe,y,u.length]),o.useLayoutEffect(()=>{Q(),Se.current=0,ft(0),Fe(null),ze(!1),fe(null),me(!1),ge(void 0),xe(void 0),Te(null),Ee(t=>{const n=Math.max(0,u.length-1);return Math.min(t,n)})},[Q,J.length,k,u.length]),o.useLayoutEffect(()=>{var a;const t=Math.max(0,u.length-1),n=Math.min(Math.max(0,U),t);mt.current=n,Ie.current=((a=u[n])==null?void 0:a.entryIndex)??0,Ee(n)},[U]);const g=dt!==null?J[dt]:null,wt=ut!==null?u[ut]:null,We=(h==null?void 0:h.title1)||(h==null?void 0:h.title2)||(h==null?void 0:h.title3)||(g==null?void 0:g.title1)||(g==null?void 0:g.title2)||(g==null?void 0:g.title3),P=l.shouldShowCounter(k,u,J),se=M!==null,qt=We||P||se,Xt=P&&se?{gap:ye}:void 0,Re=`${e}-titles-stack${p?` ${e}-titles-stack-stacked`:""}`,yt=`${e}-titles-layer-out${p?` ${e}-titles-layer-out-stacked`:""}`,Vt=`${e}-titles-layer-out`,Xe=(H??0)>0||f,Yt=m(ie),W=o.useMemo(()=>({title1Width:V??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:Y??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:C??l.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[V,Y,C]),_=o.useMemo(()=>({title2MarginLeft:S,title3MarginLeft:we}),[S,we]),v=o.useMemo(()=>h?l.buildJournalTitleSlots(e,h,ne,de,ue):[],[e,h,ne,de,ue]),Ne=o.useMemo(()=>v.map(t=>W[t.widthKey]),[v,W]),D=o.useMemo(()=>l.resolveJournalTitleWidths(v.length,Ne),[v.length,Ne]),bt=o.useMemo(()=>l.getEffectiveJournalTitleWidths(v.length,Ne),[v.length,Ne]),ke=o.useMemo(()=>v.filter(t=>t.prefix==="title1"),[v]),A=o.useMemo(()=>v.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[v]),Ce=o.useMemo(()=>l.getRowScopedJournalTitleWidths(ke,W),[ke,W]),O=o.useMemo(()=>l.getRowScopedJournalTitleWidths(A,W),[A,W]),Ve=o.useCallback((t,n)=>{const a=v.findIndex(r=>r.prefix===t.prefix);if(!p||n==="single-row")return{effectiveWidth:bt[a]??0,resolvedWidth:D[a]??0,maxWidth:l.getJournalTitleMaxWidth(a,D)};if(n==="two-row-top"){const r=ke.findIndex(d=>d.prefix===t.prefix);return{effectiveWidth:Ce.effective[r]??0,resolvedWidth:Ce.resolved[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,Ce.resolved)}}const s=A.findIndex(r=>r.prefix===t.prefix);return{effectiveWidth:O.effective[s]??0,resolvedWidth:O.resolved[s]??0,maxWidth:l.getJournalTitleMaxWidth(s,O.resolved)}},[v,A,O,bt,D,ke,Ce,p]),Zt=o.useCallback(t=>l.getJournalTitleBoundaryOffset(v,D,_,t)+(p?0:H??0),[v,D,_,p,H]),Qt=o.useCallback(()=>p?0:H??0,[p,H]),Ye=o.useCallback(t=>A.slice(0,t).reduce((n,a,s)=>n+(a.marginLeftKey?_[a.marginLeftKey]??0:0)+(O.resolved[s]??0),0),[A,O.resolved,_]),Pt=o.useCallback(t=>{const n=A[t];return Ye(t)+(n.marginLeftKey?_[n.marginLeftKey]??0:0)+(O.resolved[t]??0)},[A,O.resolved,Ye,_]),Ze=o.useCallback((t,n,a)=>{if(!p||a==="single-row"){const c=t.findIndex(ee=>ee.prefix===n.prefix),T=t.map(ee=>W[ee.widthKey]),R=l.resolveJournalTitleWidths(t.length,T);return{effectiveWidth:l.getEffectiveJournalTitleWidths(t.length,T)[c]??0,resolvedWidth:R[c]??0,maxWidth:l.getJournalTitleMaxWidth(c,R)}}if(a==="two-row-top"){const c=t.filter(ee=>ee.prefix==="title1"),T=c.findIndex(ee=>ee.prefix===n.prefix),{resolved:R,effective:Me}=l.getRowScopedJournalTitleWidths(c,W);return{effectiveWidth:Me[T]??0,resolvedWidth:R[T]??0,maxWidth:l.getJournalTitleMaxWidth(T,R)}}const s=t.filter(c=>c.prefix==="title2"||c.prefix==="title3"),r=s.findIndex(c=>c.prefix===n.prefix),{resolved:d,effective:x}=l.getRowScopedJournalTitleWidths(s,W);return{effectiveWidth:x[r]??0,resolvedWidth:d[r]??0,maxWidth:l.getJournalTitleMaxWidth(r,d)}},[W,p]),Qe=(t,n,a)=>{const s=t.marginLeftKey?_[t.marginLeftKey]??0:0,{effectiveWidth:r,resolvedWidth:d,maxWidth:x}=a??Ve(t,n),c=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH),T=f&&n==="two-row-top";return i.jsxs("div",{className:`${e}-title-cell`,"data-title":t.prefix,style:{width:m(r),...s>0?{marginLeft:m(s)}:{}},children:[i.jsx("p",{className:t.className,style:t.style,children:t.text}),T&&t.marginLeftKey?i.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d),style:{position:"absolute",top:0,left:m(-s),width:m(c),height:"100%",pointerEvents:"auto"}}):null,T?i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,right:m(-l.TITLE_RESIZE_HANDLE_WIDTH/2),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}}):null]},t.className)},Pe=(t="two-row")=>{const n=v.findIndex(r=>r.prefix==="title1"),a=n>=0?D[n]:W.title1Width,s=t==="two-row"&&f;return i.jsx("div",{...s?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(a)}:{},style:{width:m(H??0),flexShrink:0,alignSelf:"stretch",...s?{pointerEvents:"auto"}:{}}})},et=()=>i.jsx("span",{className:`${e}-titles-baseline-strut`,style:ne,"aria-hidden":"true",children:" "}),$t=()=>i.jsx("span",{className:`${e}-entry-counter`,style:_t,"aria-live":"polite","aria-atomic":"true",children:l.formatSlideCounter(u,y,k,J)}),ei=()=>P?f&&se?i.jsxs("div",{className:`${e}-text-bar-cell`,style:{flexShrink:0},children:[$t(),i.jsx("div",{"data-controls":"countCloseGap","data-controls-axis":"x","data-controls-reverse":"true",style:{position:"absolute",top:0,right:`calc(-0.5 * (${l.getGapControlSize(ye)} + ${ye}))`,width:l.getGapControlSize(ye),height:"100%",pointerEvents:"auto",zIndex:3}})]}):$t():null,tt=()=>!P&&!se?null:i.jsxs("div",{className:`${e}-titles-row-header-controls`,style:Xt,children:[ei(),se?ni():null]}),ti=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[P||We?et():null,Xe?Pe("single-row"):null,St(h),i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"}),tt(),ot()]}),ii=()=>i.jsxs("div",{className:`${e}-titles-row ${e}-titles-row-header`,style:{width:"100%",position:"relative"},children:[P||We?et():null,Xe?Pe("single-row"):null,i.jsxs("div",{className:`${e}-titles-row-titles`,style:$&&oe?{minHeight:oe}:void 0,children:[i.jsx("div",{ref:B,className:Re,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:He($e||h)}),i.jsxs("div",{ref:Oe,className:Re,style:{position:$?"absolute":"relative",inset:$?0:void 0,width:"100%",...$&&be?{width:be,maxWidth:"100%"}:void 0},children:[g&&$?i.jsx("div",{className:`${yt} ${e}-titles-fade-out`,children:He(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${$?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:He(h)})]})]}),tt(),ot()]}),ni=()=>i.jsxs("div",{className:`${e}-close-icon`,style:{width:lt.scalingValue(F??0,w),height:lt.scalingValue(F??0,w),marginRight:rt,"--close-icon-hover-color":st},children:[i.jsx("button",{ref:Ge,type:"button",className:`${e}-close-icon-inner`,onClick:pe,"aria-label":"Close",children:i.jsx(ui.SvgImage,{url:M??"",fill:ce,hoverFill:w&&!te?ce:st,className:`${e}-close-icon-img`})}),f&&i.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:rt,height:"100%",pointerEvents:"auto"}})]}),Tt=(t,n)=>i.jsxs("div",{className:`${e}-titles-row-top`,children:[P||We?et():null,Xe?Pe("two-row"):null,n!==void 0?i.jsx("div",{className:`${e}-titles-row-titles`,style:{position:"relative",flex:1,minWidth:0,minHeight:n},children:t}):i.jsxs(i.Fragment,{children:[t,i.jsx("div",{style:{flex:1,minWidth:0},"aria-hidden":"true"})]}),tt()]}),St=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,de,ue);return i.jsx(i.Fragment,{children:n.map(a=>Qe(a,"single-row",Ze(n,a,"single-row")))})},it=t=>{if(!t)return null;const n=l.buildJournalTitleSlots(e,t,ne,de,ue),a=n.find(s=>s.prefix==="title1");return a?Qe(a,"two-row-top",Ze(n,a,"two-row-top")):null},nt=(t,n=!1)=>{const a=t?l.buildJournalTitleSlots(e,t,ne,de,ue):[],s=a.filter(x=>x.prefix==="title2"||x.prefix==="title3"),r=f&&n;return s.length>0||r||(ie??0)>0?i.jsxs("div",{className:`${e}-titles-row-bottom-wrap`,children:[s.length>0?i.jsxs("div",{className:`${e}-titles-row-bottom`,children:[s.map(x=>Qe(x,"two-row-bottom",Ze(a,x,"two-row-bottom"))),n&&f?i.jsxs(i.Fragment,{children:[si(),ri()]}):null]}):null,(ie??0)>0||r?i.jsx("div",{"data-controls":r?"titleRowMarginBottom":void 0,"data-controls-axis":r?"y":void 0,"data-controls-reverse":r?"":void 0,className:r?`${e}-control`:void 0,style:{height:Yt,width:"100%",flexShrink:0,pointerEvents:r?"auto":"none"}}):null]}):null},Le=(t,n=!1)=>i.jsxs(i.Fragment,{children:[Tt(it(t)),nt(t,n)]}),He=t=>p?i.jsx("div",{className:`${e}-titles-row-two-row`,children:Le(t)}):t?i.jsx("div",{className:`${e}-titles-row`,style:{width:"100%"},children:St(t)}):null,oi=()=>{const t=p?-1:v.findIndex(s=>s.prefix==="title1"),n=!p&&(f||(H??0)>0)?(()=>{const s=H??0,r=t>=0?D[t]:W.title1Width,d=Math.max(s,l.TITLE_PADDING_HANDLE_WIDTH);return i.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(r),style:{position:"absolute",top:0,left:0,width:m(d),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,a=v.flatMap((s,r)=>{if(!s.marginLeftKey)return[];const d=_[s.marginLeftKey]??0,x=l.getJournalTitleOffsetBeforeSlot(v,D,_,r)+Qt(),c=Math.max(d,l.TITLE_PADDING_HANDLE_WIDTH);return i.jsx("div",{"data-controls":s.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(D[r]),style:{position:"absolute",top:0,left:m(x),width:m(c),height:"100%",pointerEvents:"auto"}},s.marginLeftKey)});return n?[n,...a]:a},li=()=>v.map((t,n)=>{const a=l.getJournalTitleMaxWidth(n,D),r=Zt(n)-l.TITLE_RESIZE_HANDLE_WIDTH/2;return i.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(a),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:m(r),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),si=()=>A.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const a=_[t.marginLeftKey]??0,s=Ye(n),r=Math.max(a,l.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:d}=Ve(t,"two-row-bottom");return i.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(d),style:{position:"absolute",top:0,left:m(s),width:m(r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),ri=()=>A.map((t,n)=>{const{maxWidth:a}=Ve(t,"two-row-bottom"),r=Pt(n)-l.TITLE_RESIZE_HANDLE_WIDTH/2;return i.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:i.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(a),"data-controls-variant":"column-width",className:`${e}-title-resize-handle`,style:{position:"absolute",top:0,left:m(r),width:m(l.TITLE_RESIZE_HANDLE_WIDTH),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!f||p?null:i.jsxs(i.Fragment,{children:[oi(),li()]}),It=t=>{const n=!t.objectFit&&G.isImageRatioCover(re);return{className:`${e}-slide-image-cell${n?` ${e}-slide-image-cell-cover`:""}`,style:{maxWidth:Lt,maxHeight:Ht,...n?{"--image-aspect-ratio":G.getAspectRatio(re)}:{}}}},jt=t=>t.objectFit?{className:`${e}-slide-image ${e}-slide-image-custom`,style:{"--image-object-fit":t.objectFit}}:G.isImageRatioCover(re)?{className:`${e}-slide-image ${e}-slide-image-cover`}:{className:`${e}-slide-image ${e}-slide-image-fit`},Wt=t=>{if(t.length===0)return null;const n=t.length>1,a=l.getGapControlSize(Je),s=`calc(-0.5 * (${a} + ${Je}))`;if(t.length===1){const r=t[0];return i.jsx("div",{...It(r),children:i.jsx("img",{...jt(r),src:r.assetId,alt:r.name??"",draggable:!1})})}return i.jsx("div",{className:`${e}-slide-inner`,style:n?{gap:Je}:void 0,children:t.map((r,d)=>i.jsxs("div",{...It(r),children:[i.jsx("img",{...jt(r),src:r.assetId,alt:r.name??"",draggable:!1}),f&&n&&d<t.length-1&&i.jsx("div",{"data-controls":"imageGap","data-controls-axis":"x",style:{position:"absolute",top:0,right:s,width:a,height:"100%",pointerEvents:"auto",zIndex:3}})]},`${r.assetId}-${d}`))})},Rt=!!(h!=null&&h.title2||h!=null&&h.title3||g!=null&&g.title2||g!=null&&g.title3||(ie??0)>0||f),ai=()=>i.jsxs("div",{style:{position:"relative",width:"100%",flex:1,alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,height:"100%"},children:[i.jsx("div",{ref:B,className:Re,style:{position:"absolute",visibility:"hidden",pointerEvents:"none",left:0,right:0,top:0,width:"100%",height:"auto"},"aria-hidden":"true",children:Le($e||h)}),i.jsxs("div",{ref:Oe,className:`${e}-titles-row-two-row`,style:{...$&&oe?{minHeight:oe}:void 0,...$&&be?{width:be,maxWidth:"100%"}:void 0},children:[Tt(i.jsxs("div",{className:Re,style:{position:$?"absolute":"relative",inset:$?0:void 0,width:"100%"},children:[g&&$?i.jsx("div",{className:`${Vt} ${e}-titles-fade-out`,children:it(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${$?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}`,children:it(h)})]}),$&&oe?oe:void 0),Rt?i.jsxs("div",{className:`${e}-titles-row-bottom-area`,children:[g&&$?i.jsx("div",{className:`${yt} ${e}-titles-layer-out-bottom ${e}-titles-fade-out`,children:nt(g)}):null,i.jsx("div",{className:`${e}-titles-layer-in${$?` ${e}-titles-layer-in-fading ${e}-titles-fade-in`:""}${p?` ${e}-titles-layer-in-stacked`:""}`,children:nt(h,!0)})]}):null]})]}),ci=()=>{const t=Rt;return i.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...t?{flex:1,height:"100%"}:{}},children:[i.jsx("div",{className:`${e}-titles-row-two-row`,style:t?void 0:{flex:"0 0 auto",height:"auto"},children:Le(h,!0)}),ot()]})};return i.jsxs("div",{ref:K,"data-selection":"none",className:`${e}-lightbox${w?` ${e}-lightbox-editor`:""}${f?` ${e}-lightbox-edit-mode`:""}`,onClick:()=>{Ue||pe()},role:"dialog","aria-modal":"true","aria-label":"Journal gallery",tabIndex:se?void 0:-1,style:{opacity:at?1:0,transition:"opacity 300ms ease",pointerEvents:at?"auto":"none"},children:[i.jsx("div",{className:`${e}-lightbox-backdrop`,style:{backgroundColor:_e,...Et}}),i.jsxs("div",{className:`${e}-lightbox-dismiss-area`,style:Kt,...Bt,children:[i.jsx("div",{className:`${e}-lightbox-content`,style:Ft,onClick:t=>t.stopPropagation(),children:i.jsx("div",{className:`${e}-lightbox-strip`,"data-desktop-nav":z&&u.length>1?"true":"false",onPointerDown:z?Ot:void 0,onPointerUp:z?Gt:void 0,onPointerCancel:z?Ut:void 0,children:i.jsxs("div",{className:`${e}-slide-stack`,children:[wt&&ht?i.jsx("div",{className:`${e}-slide-layer-out ${e}-slide-fade-out`,onAnimationEnd:t=>{t.target===t.currentTarget&&At(Be)},children:i.jsx("div",{className:`${e}-slide-area`,children:Wt(wt.images)})},`slide-out-${Be}`):null,i.jsx("div",{className:`${e}-slide-layer-in${ht?` ${e}-slide-fade-in`:""}`,children:i.jsx("div",{className:`${e}-slide-area`,children:he?Wt(he.images):null})},`slide-in-${Be}-${y}`)]})})}),i.jsxs("div",{className:`${e}-lightbox-overlay-content`,style:zt,children:[i.jsx("div",{"data-controls":f?"contentMarginTop":void 0,className:f?`${e}-control`:void 0,style:{height:Mt,width:"100%"}}),i.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...p?{flex:1,minHeight:0}:{}},children:i.jsx("div",{className:`${e}-lightbox-content-area${p?` ${e}-lightbox-content-area-stacked`:""}`,children:qt&&i.jsx("div",{className:`${e}-text-bar-cell${p?` ${e}-text-bar-cell-stacked`:""}`,style:p?void 0:{flex:1,minWidth:0,width:"100%"},children:p?E==="fade"?ai():ci():E==="fade"?ii():ti()})})})]})]})]})};function mi(e){return`
2
+ .${e}-wrapper {
3
+ position: relative;
4
+ width: 100%;
5
+ height: 100%;
6
+ }
7
+
8
+ .${e}-cover {
9
+ position: relative;
10
+ width: 100%;
11
+ height: 100%;
12
+ cursor: pointer;
13
+ pointer-events: auto;
14
+ }
15
+
16
+ .${e}-ratio-wrapper-cover {
17
+ aspect-ratio: var(--image-aspect-ratio);
18
+ height: auto;
19
+ overflow: hidden;
20
+ width: 100%;
21
+ }
22
+
23
+ .${e}-ratio-wrapper-fit {
24
+ height: 100%;
25
+ width: 100%;
26
+ }
27
+
28
+ .${e}-cover-image {
29
+ display: block;
30
+ }
31
+
32
+ .${e}-cover-image-cover {
33
+ object-fit: cover;
34
+ width: 100%;
35
+ height: 100%;
36
+ max-width: 100%;
37
+ }
38
+
39
+ .${e}-cover-image-fit {
40
+ object-fit: contain;
41
+ width: auto;
42
+ height: auto;
43
+ max-width: 100%;
44
+ }
45
+
46
+ .${e}-lightbox {
47
+ position: fixed;
48
+ inset: 0;
49
+ z-index: 9997;
50
+ display: flex;
51
+ flex-direction: column;
52
+ align-items: center;
53
+ justify-content: center;
54
+ overscroll-behavior: none;
55
+ }
56
+
57
+ .${e}-lightbox-editor {
58
+ inset: auto;
59
+ top: var(--cntrl-article-top, 0);
60
+ left: var(--cntrl-article-left, 0);
61
+ width: var(--cntrl-article-width, 100vw) !important;
62
+ height: var(--cntrl-viewport-height, 100vh) !important;
63
+ }
64
+
65
+ .${e}-lightbox-edit-mode {
66
+ z-index: 1;
67
+ }
68
+
69
+ .${e}-lightbox-content {
70
+ position: relative;
71
+ z-index: 1;
72
+ display: flex;
73
+ flex-direction: column;
74
+ align-items: center;
75
+ justify-content: center;
76
+ width: 100%;
77
+ height: 100%;
78
+ box-sizing: border-box;
79
+ }
80
+
81
+ .${e}-lightbox-backdrop {
82
+ position: absolute;
83
+ inset: 0;
84
+ pointer-events: none;
85
+ }
86
+
87
+ .${e}-lightbox-dismiss-area {
88
+ position: relative;
89
+ width: 100%;
90
+ height: 100%;
91
+ }
92
+
93
+ .${e}-lightbox-strip {
94
+ position: relative;
95
+ flex: 1;
96
+ width: 100%;
97
+ min-height: 0;
98
+ display: flex;
99
+ align-items: center;
100
+ justify-content: center;
101
+ max-width: 100%;
102
+ overflow: hidden;
103
+ box-sizing: border-box;
104
+ }
105
+
106
+ .${e}-lightbox-strip[data-desktop-nav="true"]::before,
107
+ .${e}-lightbox-strip[data-desktop-nav="true"]::after {
108
+ content: '';
109
+ position: absolute;
110
+ top: 0;
111
+ bottom: 0;
112
+ width: 50%;
113
+ z-index: 2;
114
+ }
115
+
116
+ .${e}-lightbox-strip[data-desktop-nav="true"]::before {
117
+ left: 0;
118
+ cursor: w-resize;
119
+ }
120
+
121
+ .${e}-lightbox-strip[data-desktop-nav="true"]::after {
122
+ right: 0;
123
+ cursor: e-resize;
124
+ }
125
+
126
+ .${e}-slide-stack {
127
+ position: relative;
128
+ width: 100%;
129
+ height: 100%;
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ }
134
+
135
+ .${e}-slide-layer-out {
136
+ position: absolute;
137
+ inset: 0;
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ z-index: 1;
142
+ }
143
+
144
+ .${e}-slide-layer-in {
145
+ position: absolute;
146
+ inset: 0;
147
+ display: flex;
148
+ align-items: center;
149
+ justify-content: center;
150
+ z-index: 0;
151
+ }
152
+
153
+ @keyframes ${e}-slide-fade-in {
154
+ from { opacity: 0; }
155
+ to { opacity: 1; }
156
+ }
157
+
158
+ @keyframes ${e}-slide-fade-out {
159
+ from { opacity: 1; }
160
+ to { opacity: 0; }
161
+ }
162
+
163
+ .${e}-slide-fade-in {
164
+ opacity: 0;
165
+ animation: ${e}-slide-fade-in 300ms ease-in-out forwards;
166
+ }
167
+
168
+ .${e}-slide-fade-out {
169
+ animation: ${e}-slide-fade-out 300ms ease-in-out forwards;
170
+ }
171
+
172
+ .${e}-slide-area {
173
+ position: relative;
174
+ width: 100%;
175
+ height: 100%;
176
+ min-width: 0;
177
+ min-height: 0;
178
+ box-sizing: border-box;
179
+ display: flex;
180
+ justify-content: center;
181
+ align-items: center;
182
+ }
183
+
184
+ .${e}-slide-inner {
185
+ display: flex;
186
+ flex-direction: row;
187
+ align-items: center;
188
+ justify-content: center;
189
+ width: 100%;
190
+ height: 100%;
191
+ box-sizing: border-box;
192
+ }
193
+
194
+ .${e}-slide-image-cell {
195
+ position: relative;
196
+ min-width: 0;
197
+ height: 100%;
198
+ }
199
+
200
+ .${e}-slide-image-cell-cover {
201
+ aspect-ratio: var(--image-aspect-ratio);
202
+ overflow: hidden;
203
+ height: auto;
204
+ width: 100%;
205
+ }
206
+
207
+ .${e}-slide-image {
208
+ display: block;
209
+ user-select: none;
210
+ }
211
+
212
+ .${e}-slide-image-cover {
213
+ object-fit: cover;
214
+ width: 100%;
215
+ height: 100%;
216
+ max-width: 100%;
217
+ }
218
+
219
+ .${e}-slide-image-fit {
220
+ object-fit: contain;
221
+ width: auto;
222
+ height: auto;
223
+ max-width: 100%;
224
+ }
225
+
226
+ .${e}-slide-image-custom {
227
+ object-fit: var(--image-object-fit);
228
+ max-width: 100%;
229
+ height: 100%;
230
+ }
231
+
232
+ .${e}-close-icon {
233
+ position: relative;
234
+ flex-shrink: 0;
235
+ align-self: center;
236
+ pointer-events: auto;
237
+ z-index: 2;
238
+ display: flex;
239
+ align-items: center;
240
+ justify-content: center;
241
+ border: none;
242
+ background-color: transparent;
243
+ padding: 0;
244
+ }
245
+
246
+ .${e}-close-icon-inner {
247
+ all: unset;
248
+ position: relative;
249
+ cursor: pointer;
250
+ width: 100%;
251
+ height: 100%;
252
+ pointer-events: auto;
253
+ }
254
+
255
+ .${e}-close-icon-img {
256
+ position: absolute;
257
+ top: 50%;
258
+ left: 50%;
259
+ transform: translate(-50%, -50%);
260
+ }
261
+
262
+ .${e}-titles-row {
263
+ position: relative;
264
+ flex: 0 1 auto;
265
+ z-index: 2;
266
+ box-sizing: border-box;
267
+ pointer-events: none;
268
+ word-break: break-word;
269
+ min-width: 0;
270
+ display: flex;
271
+ flex-direction: row;
272
+ align-items: baseline;
273
+ }
274
+
275
+ .${e}-titles-row-header {
276
+ flex: 1;
277
+ align-items: baseline;
278
+ }
279
+
280
+ .${e}-titles-row-header-controls {
281
+ display: flex;
282
+ flex-direction: row;
283
+ align-items: baseline;
284
+ flex-shrink: 0;
285
+ }
286
+
287
+ .${e}-titles-baseline-strut {
288
+ width: 0;
289
+ overflow: hidden;
290
+ flex-shrink: 0;
291
+ pointer-events: none;
292
+ white-space: nowrap;
293
+ }
294
+
295
+ .${e}-titles-row-titles {
296
+ position: relative;
297
+ flex: 1;
298
+ min-width: 0;
299
+ align-self: flex-start;
300
+ }
301
+
302
+ .${e}-titles-row-two-row {
303
+ display: flex;
304
+ flex: 1;
305
+ height: 100%;
306
+ min-height: 0;
307
+ align-self: stretch;
308
+ flex-direction: column;
309
+ width: 100%;
310
+ }
311
+
312
+ .${e}-titles-row-top {
313
+ display: flex;
314
+ flex-direction: row;
315
+ align-items: baseline;
316
+ width: 100%;
317
+ flex-shrink: 0;
318
+ margin-bottom: 0;
319
+ }
320
+
321
+ .${e}-titles-row-top .${e}-title-cell[data-title="title1"] {
322
+ flex: 0 0 auto;
323
+ min-width: 0;
324
+ }
325
+
326
+ .${e}-titles-row-bottom-wrap {
327
+ display: flex;
328
+ flex-direction: column;
329
+ width: 100%;
330
+ margin-top: auto;
331
+ flex-shrink: 0;
332
+ }
333
+
334
+ .${e}-titles-row-bottom-area {
335
+ position: relative;
336
+ flex: 1;
337
+ min-height: 0;
338
+ display: flex;
339
+ flex-direction: column;
340
+ width: 100%;
341
+ }
342
+
343
+ .${e}-titles-row-bottom {
344
+ position: relative;
345
+ display: flex;
346
+ flex-direction: row;
347
+ align-items: flex-end;
348
+ width: 100%;
349
+ }
350
+
351
+ .${e}-titles-row-bottom .${e}-title-cell {
352
+ flex: 0 0 auto;
353
+ }
354
+
355
+ .${e}-title-cell {
356
+ position: relative;
357
+ flex: 0 0 auto;
358
+ min-width: 0;
359
+ box-sizing: border-box;
360
+ }
361
+
362
+ .${e}-text-bar-cell {
363
+ position: relative;
364
+ flex: 0 1 auto;
365
+ min-width: 0;
366
+ display: flex;
367
+ align-items: baseline;
368
+ }
369
+
370
+ .${e}-title1,
371
+ .${e}-title2,
372
+ .${e}-title3 {
373
+ margin: 0;
374
+ min-width: 0;
375
+ }
376
+
377
+ .${e}-title-resize-handle {
378
+ background: transparent;
379
+ }
380
+
381
+ .${e}-titles-stack {
382
+ position: relative;
383
+ display: flex;
384
+ flex-direction: row;
385
+ align-items: baseline;
386
+ align-self: flex-start;
387
+ min-width: 0;
388
+ }
389
+
390
+ .${e}-titles-stack-stacked {
391
+ flex-direction: column;
392
+ align-items: stretch;
393
+ height: 100%;
394
+ }
395
+
396
+ .${e}-titles-layer-out {
397
+ position: absolute;
398
+ inset: 0;
399
+ display: flex;
400
+ flex-direction: row;
401
+ align-items: baseline;
402
+ z-index: 1;
403
+ overflow: visible;
404
+ }
405
+
406
+ .${e}-titles-layer-out-stacked {
407
+ flex-direction: column;
408
+ align-items: stretch;
409
+ }
410
+
411
+ .${e}-titles-layer-out-bottom {
412
+ justify-content: flex-end;
413
+ }
414
+
415
+ .${e}-titles-layer-in {
416
+ position: relative;
417
+ display: flex;
418
+ flex-direction: row;
419
+ align-items: baseline;
420
+ min-width: 0;
421
+ }
422
+
423
+ .${e}-titles-layer-in-stacked {
424
+ flex-direction: column;
425
+ align-items: stretch;
426
+ flex: 1;
427
+ min-height: 0;
428
+ }
429
+
430
+ .${e}-titles-layer-in-fading {
431
+ position: absolute;
432
+ inset: 0;
433
+ z-index: 0;
434
+ overflow: visible;
435
+ }
436
+
437
+ .${e}-titles-fade-in,
438
+ .${e}-titles-fade-out {
439
+ overflow: visible;
440
+ }
441
+
442
+ @keyframes ${e}-titles-fade-in {
443
+ from { opacity: 0; }
444
+ to { opacity: 1; }
445
+ }
446
+
447
+ @keyframes ${e}-titles-fade-out {
448
+ from { opacity: 1; }
449
+ to { opacity: 0; }
450
+ }
451
+
452
+ .${e}-titles-fade-in {
453
+ opacity: 0;
454
+ animation: ${e}-titles-fade-in 400ms ease-in-out forwards;
455
+ }
456
+
457
+ .${e}-titles-fade-out {
458
+ animation: ${e}-titles-fade-out 400ms ease-in-out forwards;
459
+ }
460
+
461
+ .${e}-lightbox-overlay-content {
462
+ position: absolute;
463
+ inset: 0;
464
+ z-index: 3;
465
+ pointer-events: none;
466
+ display: flex;
467
+ flex-direction: column;
468
+ isolation: isolate;
469
+ }
470
+
471
+ .${e}-lightbox-content-area {
472
+ position: relative;
473
+ display: flex;
474
+ flex-direction: row;
475
+ align-items: flex-start;
476
+ flex: 1;
477
+ min-width: 0;
478
+ min-height: 0;
479
+ }
480
+
481
+ .${e}-lightbox-content-area-stacked {
482
+ align-items: stretch;
483
+ align-self: stretch;
484
+ }
485
+
486
+ .${e}-text-bar-cell-stacked {
487
+ align-self: stretch;
488
+ flex: 1;
489
+ min-width: 0;
490
+ min-height: 0;
491
+ height: 100%;
492
+ flex-direction: column;
493
+ align-items: stretch;
494
+ }
495
+
496
+ .${e}-entry-counter {
497
+ position: relative;
498
+ z-index: 2;
499
+ pointer-events: none;
500
+ white-space: nowrap;
501
+ flex-shrink: 0;
502
+ }
503
+
504
+ .${e}-control {
505
+ position: relative;
506
+ z-index: 2;
507
+ pointer-events: auto;
508
+ flex-shrink: 0;
509
+ }
510
+
511
+ .${e}-control::before {
512
+ content: "";
513
+ position: absolute;
514
+ top: 0;
515
+ left: 0;
516
+ width: 100%;
517
+ height: 100%;
518
+ min-width: 20px;
519
+ min-height: 20px;
520
+ pointer-events: auto;
521
+ z-index: 10;
522
+ }
523
+ `}const gi=({settings:e,content:J,isEditor:I,isEditMode:w,isPreviewMode:f,portalId:te,metadata:U})=>{const{prefix:j}=di.useScopedStyles(),N=(U==null?void 0:U.itemId)??null,{cover:q,coverFit:X,type:k}=e,re=o.useRef(null),[_e,L]=o.useState(!1),[De,ae]=o.useState(0),E=o.useRef(!1),V=o.useRef(!1),Y=o.useRef(!1),C=o.useMemo(()=>(J??[]).filter(b=>l.getEntryImages(b).length>0),[J]),H=_e&&C.length>0,S=!I,we=o.useCallback(()=>{S&&(Y.current=!0,l.removeJournalUrlParam(V.current,N),V.current=!1)},[S,N]),ie=(b=0)=>{if(C.length===0||I&&!w&&!f)return;const M=l.buildJournalSlides(C,k),F=Math.max(0,Math.min(b,M.length-1));if(ae(F),S){const ce=l.hasJournalUrlParam();l.setJournalUrlParam(F+1,N,ce),V.current=!ce}L(!0)},Ae=o.useCallback(()=>{L(!1),Y.current=!1},[]);return o.useEffect(()=>{!I||w||f||L(!1)},[I,w,f]),o.useEffect(()=>{if(!S||typeof window>"u")return;const b=window.history.scrollRestoration;return window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration=b}},[S]),o.useEffect(()=>{if(!S||E.current)return;E.current=!0;const b=l.findJournalUrlSlideNumber(N);if(!b)return;const M=l.slideNumberToIndex(b,l.buildJournalSlides(C,k).length);M<0||(ae(M),L(!0))},[C,N,S,k]),o.useEffect(()=>{if(!S)return;const b=()=>{if(Y.current){Y.current=!1,L(!1);return}const M=l.findJournalUrlSlideNumber(N);if(!M){L(!1);return}const F=l.slideNumberToIndex(M,l.buildJournalSlides(C,k).length);if(F<0){L(!1);return}V.current=!1,ae(F),L(!0)};return window.addEventListener("popstate",b),()=>window.removeEventListener("popstate",b)},[C,N,S,k]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{ref:re,className:`${j}-wrapper`,children:[i.jsx("style",{dangerouslySetInnerHTML:{__html:mi(j)}}),q?i.jsx("button",{type:"button",className:`${j}-cover ${G.isImageRatioCover(X)?`${j}-ratio-wrapper-cover`:`${j}-ratio-wrapper-fit`}`,onClick:()=>ie(),style:{display:"block",padding:0,border:"none",background:"transparent",pointerEvents:I&&!w&&!f?"none":void 0,...G.isImageRatioCover(X)?{"--image-aspect-ratio":G.getAspectRatio(X)}:{}},"aria-label":"Open journal gallery",children:i.jsx("img",{className:`${j}-cover-image ${G.isImageRatioCover(X)?`${j}-cover-image-cover`:`${j}-cover-image-fit`}`,src:q,alt:"cover"})}):null]}),H&&typeof document<"u"&&(()=>{const b=(te?document.getElementById(te):null)??document.body;return Nt.createPortal(i.jsx(fi,{prefix:j,entries:C,settings:e,isEditor:I,isEditMode:w,isPreviewMode:f,initialSlideIndex:De,enableUrlSync:S,journalItemId:N,onBeforeClose:we,onClose:Ae}),b)})()]})};exports.LightboxJournal=gi;