@cntrl-site/components 1.0.112 → 1.0.113-alpha.0

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 (60) hide show
  1. package/dist/{Burger-C3yVbQcq.js → Burger-B4kXX9aY.js} +1 -1
  2. package/dist/{Burger-BkVgNMGU.mjs → Burger-DyORh_vF.mjs} +1 -1
  3. package/dist/{ChroniclesComponent-FFenN7yL.js → ChroniclesComponent-B6L-8Gn2.js} +1 -1
  4. package/dist/{ChroniclesComponent-cZLqN307.mjs → ChroniclesComponent-adaAqTy8.mjs} +12 -12
  5. package/dist/Components/PopupMenu/PopupMenu.d.ts +70 -0
  6. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +578 -0
  7. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +176 -0
  8. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +7 -0
  9. package/dist/{ControlSlider-DqKfaKMG.mjs → ControlSlider-3w-bHQEg.mjs} +1 -1
  10. package/dist/{ControlSlider-C8ckUIDm.js → ControlSlider-DB4nbVLT.js} +1 -1
  11. package/dist/{FAQ-BS-vO0l-.mjs → FAQ-BjLLn81l.mjs} +1 -1
  12. package/dist/{FAQ-Ct0YfqX1.js → FAQ-C5evIqbl.js} +1 -1
  13. package/dist/{Grid-CU1dsdoO.js → Grid-BXUT_Hn6.js} +1 -1
  14. package/dist/{Grid-qbqchSLi.mjs → Grid-Dn44dvgx.mjs} +1 -1
  15. package/dist/{Hive-CzabuuCc.js → Hive-34KvKNsa.js} +1 -1
  16. package/dist/{Hive-DyxYd5eg.mjs → Hive-7xHXyMM1.mjs} +1 -1
  17. package/dist/{HiveLightboxTitles-DhEeFKWs.mjs → HiveLightboxTitles-BCoL46-V.mjs} +1 -1
  18. package/dist/{HiveLightboxTitles-DlyptAaK.js → HiveLightboxTitles-DEeyQGcf.js} +1 -1
  19. package/dist/{Lightbox-DZckgBzK.js → Lightbox-Cb7lyaNt.js} +1 -1
  20. package/dist/{Lightbox-BY99NS14.mjs → Lightbox-DzPqgKP4.mjs} +1 -1
  21. package/dist/{LightboxJournal-DAEZOPDi.js → LightboxJournal-BFF5aKRz.js} +1 -1
  22. package/dist/{LightboxJournal-D59ex6wH.mjs → LightboxJournal-C_q7_s-B.mjs} +1 -1
  23. package/dist/{LightboxStrip-YspzBP8N.mjs → LightboxStrip-BrNj7ipX.mjs} +1 -1
  24. package/dist/{LightboxStrip-BDjI1jyH.js → LightboxStrip-CC2e0_9A.js} +1 -1
  25. package/dist/{Mercury-B-s2Kvuq.js → Mercury-BmhtFYOw.js} +1 -1
  26. package/dist/{Mercury-CCW0Es-s.mjs → Mercury-Q788wrYQ.mjs} +1 -1
  27. package/dist/{OnelinerForm-C2Y_XMCY.js → OnelinerForm-CUmY-bXL.js} +1 -1
  28. package/dist/{OnelinerForm-BEu7_sho.mjs → OnelinerForm-D8WIB9Qy.mjs} +1 -1
  29. package/dist/PopupMenu-BYZy1R1y.js +356 -0
  30. package/dist/PopupMenu-DXWVDnPf.mjs +972 -0
  31. package/dist/{SimpleButton-C-o2W9bS.mjs → SimpleButton-DTpzfmb6.mjs} +1 -1
  32. package/dist/{SimpleButton-nGEcO2gB.js → SimpleButton-DtaCYa3y.js} +1 -1
  33. package/dist/{Slider20-DUi6qwnd.mjs → Slider20-CKngROrc.mjs} +1 -1
  34. package/dist/{Slider20-BOmjDRf2.js → Slider20-q0iGgnE3.js} +1 -1
  35. package/dist/SvgImage-CwRq9-ec.mjs +56 -0
  36. package/dist/SvgImage-_QN8ngad.js +1 -0
  37. package/dist/{TestimonialSingle-DrnyReim.mjs → TestimonialSingle-Bax71Hyo.mjs} +1 -1
  38. package/dist/{TestimonialSingle-BORQom3u.js → TestimonialSingle-CpEUendN.js} +1 -1
  39. package/dist/{Waterfall-DII4-WV5.js → Waterfall-B9YWMhrg.js} +1 -1
  40. package/dist/{Waterfall-3kKioKh2.mjs → Waterfall-znaoynn5.mjs} +1 -1
  41. package/dist/components-Ce8GmbzS.js +1 -0
  42. package/dist/{components-DtO0Ti47.mjs → components-QxlSJUUn.mjs} +638 -30
  43. package/dist/elements.js +1 -1
  44. package/dist/elements.mjs +23 -22
  45. package/dist/elements.node.js +1 -1
  46. package/dist/elements.node.mjs +1 -1
  47. package/dist/index.d.ts +2 -0
  48. package/dist/index.js +1 -1
  49. package/dist/index.mjs +50 -28
  50. package/dist/loadSvgMaskUrl-B6kHUyof.js +1 -0
  51. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +39 -0
  52. package/dist/sources.js +1 -1
  53. package/dist/sources.mjs +1 -1
  54. package/dist/types/SchemaV1.d.ts +3 -0
  55. package/package.json +1 -1
  56. package/dist/SvgImage-B5mR9y6q.mjs +0 -51
  57. package/dist/SvgImage-DFlmxAoL.js +0 -1
  58. package/dist/components-f82884Bk.js +0 -1
  59. package/dist/loadSvgMaskUrl-DfF7ay6h.js +0 -1
  60. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +0 -20
@@ -0,0 +1,176 @@
1
+ export type PopupMenuBlockType = 'text' | 'image' | 'listA' | 'listB';
2
+ /** The editor's layout grid, in fractions of the layout width like the grid itself is stored. */
3
+ export type PopupMenuGrid = {
4
+ columns: number;
5
+ columnWidth: number;
6
+ gutter: number;
7
+ /** The least room kept between two blocks one above the other in a column; none is the gutter. */
8
+ rowGap?: number;
9
+ /** The vertical rhythm's step, which blocks' tops snap to; none, or 0, leaves them free. */
10
+ beat?: number;
11
+ };
12
+ /**
13
+ * A block's place in the popup: `column` skipped from the left edge, `span` columns wide, and `top` down from
14
+ * the popup's top, in fractions of the layout width like the popup's other sizes. A block is always drawn at
15
+ * its top; one reaching below the popup's bottom is scrolled to, the popup scrolling down as far as it reaches.
16
+ * `height`, set once an image block was resized by its top or bottom edge, holds it to that many beats of the
17
+ * rhythm, the image cut to fill it. Without it, the block is as tall as its content, as text and lists always are.
18
+ */
19
+ export type PopupMenuPlacement = {
20
+ column: number;
21
+ span: number;
22
+ top: number;
23
+ height?: number;
24
+ };
25
+ /** The popup's height when none is set, as a percentage of the screen's height. */
26
+ export declare const DEFAULT_POPUP_MENU_HEIGHT = 60;
27
+ /** The screen's height as a fraction of the layout width, where it is not known: a 1440 × 900 desktop. */
28
+ export declare const DEFAULT_POPUP_MENU_VIEWPORT_RATIO: number;
29
+ /** Where the popup sits across the screen, as a structured block, Catalogue's say, is aligned in the article. */
30
+ export declare const POPUP_MENU_ALIGNS: readonly ["left", "center", "right"];
31
+ export type PopupMenuAlign = (typeof POPUP_MENU_ALIGNS)[number];
32
+ /** The popup's grid when none is set, the desktop default: 12 columns of 99 with gutters of 20. */
33
+ export declare const DEFAULT_POPUP_MENU_GRID: PopupMenuGrid;
34
+ /**
35
+ * The popup's columns as the editor's grid-layout control sets them, as Catalogue's are: `columnsCount` columns
36
+ * `entryWidth` wide with `horizontalGap` between them, within `wrapperWidth`, which is at least as wide as they
37
+ * are and keeps them centred. `lockedParam` is the size the control holds while the others are changed.
38
+ */
39
+ export type PopupMenuGridLayout = {
40
+ columnsCount?: number;
41
+ wrapperWidth?: number;
42
+ entryWidth?: number;
43
+ horizontalGap?: number;
44
+ lockedParam?: 'wrapperWidth' | 'entryWidth' | 'horizontalGap' | null;
45
+ };
46
+ /** The popup's own grid as it is set, sizes in fractions of the layout width like the popup's other sizes. */
47
+ export type PopupMenuGridSettings = {
48
+ gridLayout?: PopupMenuGridLayout | null;
49
+ verticalGap?: number;
50
+ /** @deprecated a column count, width and gutter of their own, as a menu saved before `gridLayout` has them */
51
+ gridColumns?: number;
52
+ /** @deprecated see gridColumns */
53
+ gridColumnWidth?: number;
54
+ /** @deprecated see gridColumns */
55
+ gridGutter?: number;
56
+ };
57
+ /**
58
+ * The grid the popup's blocks are placed on, from its settings: whole columns, at least one, of the entry width
59
+ * set, with the gutter set between them and the vertical gap between blocks one above the other. Blocks' tops and
60
+ * heights are free, with no rhythm to snap to: the vertical gap alone keeps them apart, and a row height a menu
61
+ * was saved with is left behind. A menu saved before `gridLayout` keeps its own columns, width and gutter; what is
62
+ * not set at all, as in a menu saved before the popup had a grid of its own, is `fallback`'s, and a vertical gap
63
+ * never set is the gutter, the room blocks kept one above the other before it could be set apart.
64
+ */
65
+ export declare function getPopupMenuGrid(settings: PopupMenuGridSettings, fallback?: PopupMenuGrid): PopupMenuGrid;
66
+ /** The least room kept between two blocks one above the other: the vertical gap, or, none set, the gutter. */
67
+ export declare function getPopupMenuRowGap(grid: PopupMenuGrid): number;
68
+ /** The popup's height as set: a percentage of the screen's height, from 0 to 100. */
69
+ export declare function getPopupMenuHeightPercent(settings: {
70
+ popupHeight?: number;
71
+ }): number;
72
+ /**
73
+ * The room the popup's blocks are placed in: its whole height, as it has no padding, in fractions of the layout
74
+ * width. `viewportRatio` is the screen's height as a fraction of the layout width, a desktop's where not known;
75
+ * the popup is measured as drawn once open, so this only places blocks before it is.
76
+ */
77
+ export declare function getPopupMenuHeight(settings: {
78
+ popupHeight?: number;
79
+ }, viewportRatio?: number): number;
80
+ /** Where the popup is aligned across the screen; none set, as in a menu saved before it could be, is the centre. */
81
+ export declare function getPopupMenuAlign(settings: {
82
+ popupAlign?: unknown;
83
+ }): PopupMenuAlign;
84
+ /**
85
+ * The popup's width, in fractions of the layout width: its grid's Width, as a structured block, Catalogue's say,
86
+ * is as wide as its grid's. A menu saved before its grid had a Width is as wide as its columns and gutters.
87
+ */
88
+ export declare function getPopupMenuWidth(settings: PopupMenuGridSettings, grid: PopupMenuGrid): number;
89
+ export type PopupMenuSides = {
90
+ top: number;
91
+ right: number;
92
+ bottom: number;
93
+ left: number;
94
+ };
95
+ /** A margin or padding as set: a side each, or, saved before it had four, one for every side. */
96
+ export type PopupMenuSidesSetting = number | Partial<PopupMenuSides> | null;
97
+ /** A margin or padding on every side, in fractions of the layout width; a side not set is none. */
98
+ export declare function getPopupMenuSides(sides: PopupMenuSidesSetting | undefined): PopupMenuSides;
99
+ export type PopupMenuLayout = {
100
+ seed: number;
101
+ grid: PopupMenuGrid;
102
+ placements: PopupMenuPlacement[];
103
+ /** Set once a block was moved by hand, after which the seed no longer gives this layout. */
104
+ edited?: boolean;
105
+ };
106
+ /** How wide each block type may be, as fractions of the grid's columns, and how often a row is left with empty cells. */
107
+ export type PopupMenuLayoutRules = {
108
+ span: Record<PopupMenuBlockType, {
109
+ min: number;
110
+ max: number;
111
+ }>;
112
+ /** Chance that a block starts a new row even though the current one has room left. */
113
+ breakChance: number;
114
+ };
115
+ export declare const defaultPopupMenuLayoutRules: PopupMenuLayoutRules;
116
+ /**
117
+ * Scatters the blocks over the grid row by row, in their content order so that reading and tab order
118
+ * stay as the user wrote them. Every block of a type takes the one whole-column span picked for that
119
+ * type, and lands at a random free column of the current row; a block that no longer fits, or one the
120
+ * dice break, opens the next row. The rows are spread evenly down the popup's `height`, each on a beat
121
+ * of the grid's rhythm, their blocks' tops level, which reads the same whatever the blocks' heights turn
122
+ * out to be. The same seed on the same grid always gives the same layout.
123
+ */
124
+ export declare function generatePopupMenuLayout(blocks: readonly PopupMenuBlockType[], grid: PopupMenuGrid, seed: number, height: number, rules?: PopupMenuLayoutRules): PopupMenuLayout;
125
+ export declare function randomPopupMenuSeed(): number;
126
+ /**
127
+ * The top nearest to `top` on the grid's rhythm, within `room`, the most a top may be for the block to end
128
+ * inside the popup: past it, the last beat the block still ends above.
129
+ */
130
+ export declare function snapPopupMenuTop(grid: PopupMenuGrid, top: number, room?: number): number;
131
+ /** The least a block may be resized to: a beat of the rhythm, or, where there is none, about 8px of a desktop layout. */
132
+ export declare function getPopupMenuMinHeight(grid: PopupMenuGrid): number;
133
+ /**
134
+ * The height nearest to `height` in whole beats of the grid's rhythm, at least one, and no more than `room`,
135
+ * the most the block may be for it to end inside the popup: past it, the most beats that still fit.
136
+ */
137
+ export declare function snapPopupMenuHeight(grid: PopupMenuGrid, height: number, room?: number): number;
138
+ /** Whether two grids place blocks alike: the same columns, column width, gutter, vertical gap and rhythm. */
139
+ export declare function isSamePopupMenuGrid(a: PopupMenuGrid, b: PopupMenuGrid): boolean;
140
+ /**
141
+ * The layout on another grid, the layout grid as it is now rather than as it was when the layout was saved.
142
+ * On as many columns, every block keeps its own; on more or fewer, each keeps its share of the width, at least a
143
+ * column. Tops and set heights snap to the new rhythm. A layout already on `grid` comes back as it is.
144
+ */
145
+ export declare function fitPopupMenuLayoutToGrid(layout: PopupMenuLayout, grid: PopupMenuGrid): PopupMenuLayout;
146
+ /**
147
+ * The room blocks are placed in and every block's height, in fractions of the layout width, as drawn. Blocks are
148
+ * moved within the room; settled, they are kept within it where they can be.
149
+ */
150
+ export type PopupMenuMeasure = {
151
+ height: number;
152
+ heights: readonly number[];
153
+ };
154
+ /**
155
+ * The layout with one block moved to another column and top, keeping its span, its top snapped to the
156
+ * grid's rhythm and, given the popup measured, held where the block still ends inside it. Null when the
157
+ * column is off the grid, or, measured, when the block would cover part of another or come within a
158
+ * vertical gap of one above or below it.
159
+ */
160
+ export declare function movePopupMenuBlock(layout: PopupMenuLayout, index: number, column: number, top: number, measure?: PopupMenuMeasure): PopupMenuLayout | null;
161
+ /**
162
+ * The layout with one block resized to `next`, its columns and its top and height on the grid: the span at least
163
+ * one column, the height (when set) in whole beats, at least one, and both within the popup. Null on the same
164
+ * terms as movePopupMenuBlock. A block without a height keeps the one it was measured at.
165
+ */
166
+ export declare function resizePopupMenuBlock(layout: PopupMenuLayout, index: number, next: PopupMenuPlacement, measure?: PopupMenuMeasure): PopupMenuLayout | null;
167
+ /**
168
+ * The layout with every block that comes within the vertical gap of one above it, in a column they share, pushed down
169
+ * below it onto the next beat. A generated layout spreads its rows without knowing how tall the blocks turn
170
+ * out, so a tall image or list can reach into the next row. Blocks are taken from the top down, each below
171
+ * every one already settled, so a pushed block pushes the ones under it in turn. A block pushed so low that it
172
+ * would reach below the popup's bottom, `measure.height`, moves instead to the columns nearest it where it is
173
+ * pushed least and still ends inside the popup, and stays where it was pushed, the popup scrolling to it, only
174
+ * where none does. A layout that crowds nowhere comes back as it is.
175
+ */
176
+ export declare function settlePopupMenuLayout(layout: PopupMenuLayout, measure: PopupMenuMeasure): PopupMenuLayout;
@@ -1,2 +1,9 @@
1
1
  export declare function isInlineMaskUrl(url: string): boolean;
2
+ /** A data: URL holds an SVG only when its media type says so. */
3
+ export declare function isSvgDataUrl(url: string): boolean;
4
+ /**
5
+ * Whether a data: or blob: URL holds an SVG. A blob: URL, as an image is shown by in the
6
+ * editor while it uploads, says nothing of its type, so its blob is looked at.
7
+ */
8
+ export declare function isInlineSvgUrl(url: string): Promise<boolean>;
2
9
  export declare function loadSvgMaskUrl(url: string): Promise<string>;
@@ -5,7 +5,7 @@ import { S as q, a as K } from "./react-splide.esm-DQqds4PL.mjs";
5
5
  import c from "classnames";
6
6
  import { R as Q } from "./RichTextRenderer-D52Xto59.mjs";
7
7
  import { s } from "./scalingValue-C9JH5L6O.mjs";
8
- import { S as N } from "./SvgImage-B5mR9y6q.mjs";
8
+ import { S as N } from "./SvgImage-CwRq9-ec.mjs";
9
9
  import { n as Z } from "./textStylesToCss-05Mn6I_2.mjs";
10
10
  const G = "ControlSlider-module__wrapper___sHEkd", J = "ControlSlider-module__hoverArrow___A-dOH", X = "ControlSlider-module__sliderItem___QQSkR", E = "ControlSlider-module__sliderImage___9hRl-", oo = "ControlSlider-module__arrow___05ghY", to = "ControlSlider-module__arrowVertical___tBfVN", eo = "ControlSlider-module__nextArrow___-30Yc", no = "ControlSlider-module__arrowInner___aEra3", io = "ControlSlider-module__arrowIcon___S4ztF", ro = "ControlSlider-module__arrowImg___2dwJW", lo = "ControlSlider-module__mirror___brd6U", ao = "ControlSlider-module__pagination___bicLF", so = "ControlSlider-module__paginationInner___bT-P-", co = "ControlSlider-module__paginationVertical___zYqKw", mo = "ControlSlider-module__paginationItem___nTRbk", _o = "ControlSlider-module__dot___p1Qun", go = "ControlSlider-module__activeDot___LHFaj", po = "ControlSlider-module__paginationInsideBottom___R3FWn", ho = "ControlSlider-module__paginationInsideTop___V-qb-", uo = "ControlSlider-module__paginationOutsideBottom___14w8D", fo = "ControlSlider-module__paginationOutsideTop___SCLqB", Co = "ControlSlider-module__paginationInsideLeft___yOBRZ", wo = "ControlSlider-module__paginationInsideRight___Rtt3o", vo = "ControlSlider-module__paginationOutsideLeft___lahaw", So = "ControlSlider-module__paginationOutsideRight___EtuQa", Io = "ControlSlider-module__imgWrapper___UjEgB", Ao = "ControlSlider-module__captionBlock___dJ6-j", yo = "ControlSlider-module__captionTextWrapper___HFlpf", Ro = "ControlSlider-module__captionText___uGBVc", bo = "ControlSlider-module__active___WZK4G", Lo = "ControlSlider-module__withPointerEvents___t-18M", ko = "ControlSlider-module__topLeftAlignment___zjnGM", xo = "ControlSlider-module__topCenterAlignment___gD1xW", Oo = "ControlSlider-module__topRightAlignment___NMapS", No = "ControlSlider-module__middleLeftAlignment___OnUrY", To = "ControlSlider-module__middleCenterAlignment___Tdkl0", zo = "ControlSlider-module__middleRightAlignment___wEbfX", Bo = "ControlSlider-module__bottomLeftAlignment___cTP2-", Vo = "ControlSlider-module__bottomCenterAlignment___c54fB", Wo = "ControlSlider-module__bottomRightAlignment___kEwrz", Fo = "ControlSlider-module__clickOverlay___DZA28", Do = "ControlSlider-module__contain___pLyq7", $o = "ControlSlider-module__cover___KdDat", o = {
11
11
  wrapper: G,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-DEFXh5o6.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-DFlmxAoL.js"),U=require("./textStylesToCss-CNN3zZTV.js"),H="ControlSlider-module__wrapper___sHEkd",Y="ControlSlider-module__hoverArrow___A-dOH",K="ControlSlider-module__sliderItem___QQSkR",Q="ControlSlider-module__sliderImage___9hRl-",Z="ControlSlider-module__arrow___05ghY",G="ControlSlider-module__arrowVertical___tBfVN",J="ControlSlider-module__nextArrow___-30Yc",X="ControlSlider-module__arrowInner___aEra3",E="ControlSlider-module__arrowIcon___S4ztF",ee="ControlSlider-module__arrowImg___2dwJW",te="ControlSlider-module__mirror___brd6U",oe="ControlSlider-module__pagination___bicLF",ne="ControlSlider-module__paginationInner___bT-P-",ie="ControlSlider-module__paginationVertical___zYqKw",re="ControlSlider-module__paginationItem___nTRbk",le="ControlSlider-module__dot___p1Qun",ae="ControlSlider-module__activeDot___LHFaj",se="ControlSlider-module__paginationInsideBottom___R3FWn",ce="ControlSlider-module__paginationInsideTop___V-qb-",de="ControlSlider-module__paginationOutsideBottom___14w8D",_e="ControlSlider-module__paginationOutsideTop___SCLqB",me="ControlSlider-module__paginationInsideLeft___yOBRZ",ge="ControlSlider-module__paginationInsideRight___Rtt3o",pe="ControlSlider-module__paginationOutsideLeft___lahaw",ue="ControlSlider-module__paginationOutsideRight___EtuQa",he="ControlSlider-module__imgWrapper___UjEgB",fe="ControlSlider-module__captionBlock___dJ6-j",Ce="ControlSlider-module__captionTextWrapper___HFlpf",Se="ControlSlider-module__captionText___uGBVc",ve="ControlSlider-module__active___WZK4G",we="ControlSlider-module__withPointerEvents___t-18M",Ie="ControlSlider-module__topLeftAlignment___zjnGM",xe="ControlSlider-module__topCenterAlignment___gD1xW",Ae="ControlSlider-module__topRightAlignment___NMapS",ye="ControlSlider-module__middleLeftAlignment___OnUrY",Re="ControlSlider-module__middleCenterAlignment___Tdkl0",be="ControlSlider-module__middleRightAlignment___wEbfX",je="ControlSlider-module__bottomLeftAlignment___cTP2-",Le="ControlSlider-module__bottomCenterAlignment___c54fB",ke="ControlSlider-module__bottomRightAlignment___kEwrz",Ve="ControlSlider-module__clickOverlay___DZA28",Te="ControlSlider-module__contain___pLyq7",Oe="ControlSlider-module__cover___KdDat",e={wrapper:H,hoverArrow:Y,sliderItem:K,sliderImage:Q,arrow:Z,arrowVertical:G,nextArrow:J,arrowInner:X,arrowIcon:E,arrowImg:ee,mirror:te,pagination:oe,paginationInner:ne,paginationVertical:ie,paginationItem:re,dot:le,activeDot:ae,paginationInsideBottom:se,paginationInsideTop:ce,paginationOutsideBottom:de,paginationOutsideTop:_e,paginationInsideLeft:me,paginationInsideRight:ge,paginationOutsideLeft:pe,paginationOutsideRight:ue,imgWrapper:he,captionBlock:fe,captionTextWrapper:Ce,captionText:Se,active:ve,withPointerEvents:we,topLeftAlignment:Ie,topCenterAlignment:xe,topRightAlignment:Ae,middleLeftAlignment:ye,middleCenterAlignment:Re,middleRightAlignment:be,bottomLeftAlignment:je,bottomCenterAlignment:Le,bottomRightAlignment:ke,clickOverlay:Ve,contain:Te,cover:Oe},Ne={"top-left":e.topLeftAlignment,"top-center":e.topCenterAlignment,"top-right":e.topRightAlignment,"middle-left":e.middleLeftAlignment,"middle-center":e.middleCenterAlignment,"middle-right":e.middleRightAlignment,"bottom-left":e.bottomLeftAlignment,"bottom-center":e.bottomCenterAlignment,"bottom-right":e.bottomRightAlignment};function ze({settings:p,content:u,styles:T,isEditor:l}){const[_,O]=g.useState(null),{widthSettings:I,fontSettings:v,letterSpacing:N,textAlign:z,wordSpacing:B,fontSizeLineHeight:x,textAppearance:w,color:W}=T.imageCaption??{},[m,F]=g.useState(void 0),[C,q]=g.useState(null),[S,D]=g.useState(0),[$,P]=g.useState(0),{direction:n,transition:a,controls:o,pagination:i,imageCaption:h,triggers:f}=p,A=g.useRef(a.type),{x:y,y:R}=p.controls.offset,b=r=>{_&&_.go(r)};return g.useEffect(()=>{if(!C)return;const r=new ResizeObserver(c=>{if(!_)return;const[j]=c;F({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return r.observe(C),()=>r.unobserve(C)},[C]),g.useEffect(()=>{!_||A.current===a.type||(P(r=>r+1),A.current=a.type)},[a.type]),t.jsx("div",{className:d(e.wrapper,{[e.editor]:l}),ref:q,children:t.jsxs("div",{className:e.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:a.backgroundColor&&a.type==="fade in"?a.backgroundColor:"transparent"},children:[p.imageCaption.isActive&&t.jsx("div",{className:d(e.captionBlock),children:t.jsx("div",{className:e.captionTextWrapper,children:u.map((r,c)=>t.jsx("div",{className:d(e.captionText,Ne[h.alignment],{[e.withPointerEvents]:c===S&&l,[e.active]:c===S}),style:{fontFamily:U.normalizeFontFamilyCssValue(v.fontFamily),fontWeight:v.fontWeight,fontStyle:v.fontStyle,width:I.sizing==="auto"?"max-content":s.scalingValue(I.width,l),letterSpacing:s.scalingValue(N,l),wordSpacing:s.scalingValue(B,l),textAlign:z,fontSize:s.scalingValue(x.fontSize,l),lineHeight:s.scalingValue(x.lineHeight,l),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:W,transitionDuration:a.duration?`${Math.round(parseInt(a.duration)/2)}ms`:"500ms"},children:t.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:s.scalingValue(h.offset.y,l),left:s.scalingValue(h.offset.x,l)},children:t.jsx(M.RichTextRenderer,{content:r.imageCaption})})},c))})}),t.jsx(L.Splide2,{onMove:r=>{D(r.index)},ref:O,options:{arrows:!1,speed:a.duration?parseInt(a.duration):500,autoplay:f.autoPlay!==null,...f.autoPlay!==null&&{interval:parseInt(f.autoPlay)*1e3},direction:n==="horiz"||a.type==="fade in"?"ltr":"ttb",pagination:!1,drag:f.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:a.type==="fade in"?"fade":"loop",rewind:!0},children:u.map((r,c)=>t.jsx(L.SplideSlide,{children:t.jsx("div",{className:e.sliderItem,children:t.jsx("div",{className:e.imgWrapper,children:t.jsx("img",{className:d(e.sliderImage,{[e.contain]:r.image.objectFit==="contain",[e.cover]:r.image.objectFit==="cover"}),src:r.image.assetId,alt:r.image.name??""})})})},c))},$),o.isActive&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:d(e.arrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{onClick:()=>{b("-1")},className:e.arrowInner,style:{transform:`translate(${s.scalingValue(y,l)}, ${s.scalingValue(R*(n==="horiz"?1:-1),l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:d(e.arrowImg,e.mirror)}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg,e.mirror)})]})}),t.jsx("div",{className:d(e.arrow,e.nextArrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{className:e.arrowInner,onClick:()=>b("+1"),style:{transform:`translate(${s.scalingValue(y*(n==="horiz"?-1:1),l)}, ${s.scalingValue(R,l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:e.arrowImg}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg)})]})})]}),f.triggersList.click&&t.jsx("div",{className:e.clickOverlay,onClick:()=>{_&&_.go("+1")}}),i.isActive&&t.jsx("div",{className:d(e.pagination,{[e.paginationInsideBottom]:i.position==="inside-1"&&n==="horiz",[e.paginationInsideTop]:i.position==="inside-2"&&n==="horiz",[e.paginationOutsideBottom]:i.position==="outside-1"&&n==="horiz",[e.paginationOutsideTop]:i.position==="outside-2"&&n==="horiz",[e.paginationInsideLeft]:i.position==="inside-1"&&n==="vert",[e.paginationInsideRight]:i.position==="inside-2"&&n==="vert",[e.paginationOutsideLeft]:i.position==="outside-1"&&n==="vert",[e.paginationOutsideRight]:i.position==="outside-2"&&n==="vert",[e.paginationVertical]:n==="vert"}),children:t.jsx("div",{className:e.paginationInner,style:{backgroundColor:i.colors[2],transform:`scale(${i.scale/100}) translate(${s.scalingValue(i.offset.x,l)}, ${s.scalingValue(i.offset.y,l)}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:u.map((r,c)=>t.jsx("button",{onClick:()=>{_&&_.go(c)},className:d(e.paginationItem),children:t.jsx("div",{className:d(e.dot,{[e.activeDot]:c===S}),style:{backgroundColor:c===S?i.colors[0]:i.colors[1],"--pagination-hover-color":i.hover}})},c))})})]})})}function V({color:p,className:u}){return t.jsx("svg",{viewBox:"0 0 10 18",className:u,children:t.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:t.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:p,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.ControlSlider=ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),L=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const d=require("classnames"),M=require("./RichTextRenderer-DEFXh5o6.js"),s=require("./scalingValue-CSHYgTZl.js"),k=require("./SvgImage-_QN8ngad.js"),U=require("./textStylesToCss-CNN3zZTV.js"),H="ControlSlider-module__wrapper___sHEkd",Y="ControlSlider-module__hoverArrow___A-dOH",K="ControlSlider-module__sliderItem___QQSkR",Q="ControlSlider-module__sliderImage___9hRl-",Z="ControlSlider-module__arrow___05ghY",G="ControlSlider-module__arrowVertical___tBfVN",J="ControlSlider-module__nextArrow___-30Yc",X="ControlSlider-module__arrowInner___aEra3",E="ControlSlider-module__arrowIcon___S4ztF",ee="ControlSlider-module__arrowImg___2dwJW",te="ControlSlider-module__mirror___brd6U",oe="ControlSlider-module__pagination___bicLF",ne="ControlSlider-module__paginationInner___bT-P-",ie="ControlSlider-module__paginationVertical___zYqKw",re="ControlSlider-module__paginationItem___nTRbk",le="ControlSlider-module__dot___p1Qun",ae="ControlSlider-module__activeDot___LHFaj",se="ControlSlider-module__paginationInsideBottom___R3FWn",ce="ControlSlider-module__paginationInsideTop___V-qb-",de="ControlSlider-module__paginationOutsideBottom___14w8D",_e="ControlSlider-module__paginationOutsideTop___SCLqB",me="ControlSlider-module__paginationInsideLeft___yOBRZ",ge="ControlSlider-module__paginationInsideRight___Rtt3o",pe="ControlSlider-module__paginationOutsideLeft___lahaw",ue="ControlSlider-module__paginationOutsideRight___EtuQa",he="ControlSlider-module__imgWrapper___UjEgB",fe="ControlSlider-module__captionBlock___dJ6-j",Ce="ControlSlider-module__captionTextWrapper___HFlpf",Se="ControlSlider-module__captionText___uGBVc",ve="ControlSlider-module__active___WZK4G",we="ControlSlider-module__withPointerEvents___t-18M",Ie="ControlSlider-module__topLeftAlignment___zjnGM",xe="ControlSlider-module__topCenterAlignment___gD1xW",Ae="ControlSlider-module__topRightAlignment___NMapS",ye="ControlSlider-module__middleLeftAlignment___OnUrY",Re="ControlSlider-module__middleCenterAlignment___Tdkl0",be="ControlSlider-module__middleRightAlignment___wEbfX",je="ControlSlider-module__bottomLeftAlignment___cTP2-",Le="ControlSlider-module__bottomCenterAlignment___c54fB",ke="ControlSlider-module__bottomRightAlignment___kEwrz",Ve="ControlSlider-module__clickOverlay___DZA28",Te="ControlSlider-module__contain___pLyq7",Oe="ControlSlider-module__cover___KdDat",e={wrapper:H,hoverArrow:Y,sliderItem:K,sliderImage:Q,arrow:Z,arrowVertical:G,nextArrow:J,arrowInner:X,arrowIcon:E,arrowImg:ee,mirror:te,pagination:oe,paginationInner:ne,paginationVertical:ie,paginationItem:re,dot:le,activeDot:ae,paginationInsideBottom:se,paginationInsideTop:ce,paginationOutsideBottom:de,paginationOutsideTop:_e,paginationInsideLeft:me,paginationInsideRight:ge,paginationOutsideLeft:pe,paginationOutsideRight:ue,imgWrapper:he,captionBlock:fe,captionTextWrapper:Ce,captionText:Se,active:ve,withPointerEvents:we,topLeftAlignment:Ie,topCenterAlignment:xe,topRightAlignment:Ae,middleLeftAlignment:ye,middleCenterAlignment:Re,middleRightAlignment:be,bottomLeftAlignment:je,bottomCenterAlignment:Le,bottomRightAlignment:ke,clickOverlay:Ve,contain:Te,cover:Oe},Ne={"top-left":e.topLeftAlignment,"top-center":e.topCenterAlignment,"top-right":e.topRightAlignment,"middle-left":e.middleLeftAlignment,"middle-center":e.middleCenterAlignment,"middle-right":e.middleRightAlignment,"bottom-left":e.bottomLeftAlignment,"bottom-center":e.bottomCenterAlignment,"bottom-right":e.bottomRightAlignment};function ze({settings:p,content:u,styles:T,isEditor:l}){const[_,O]=g.useState(null),{widthSettings:I,fontSettings:v,letterSpacing:N,textAlign:z,wordSpacing:B,fontSizeLineHeight:x,textAppearance:w,color:W}=T.imageCaption??{},[m,F]=g.useState(void 0),[C,q]=g.useState(null),[S,D]=g.useState(0),[$,P]=g.useState(0),{direction:n,transition:a,controls:o,pagination:i,imageCaption:h,triggers:f}=p,A=g.useRef(a.type),{x:y,y:R}=p.controls.offset,b=r=>{_&&_.go(r)};return g.useEffect(()=>{if(!C)return;const r=new ResizeObserver(c=>{if(!_)return;const[j]=c;F({width:Math.round(j.contentRect.width),height:Math.round(j.contentRect.height)})});return r.observe(C),()=>r.unobserve(C)},[C]),g.useEffect(()=>{!_||A.current===a.type||(P(r=>r+1),A.current=a.type)},[a.type]),t.jsx("div",{className:d(e.wrapper,{[e.editor]:l}),ref:q,children:t.jsxs("div",{className:e.sliderInner,style:{width:m?m.width:"100%",height:m?m.height:"100%",backgroundColor:a.backgroundColor&&a.type==="fade in"?a.backgroundColor:"transparent"},children:[p.imageCaption.isActive&&t.jsx("div",{className:d(e.captionBlock),children:t.jsx("div",{className:e.captionTextWrapper,children:u.map((r,c)=>t.jsx("div",{className:d(e.captionText,Ne[h.alignment],{[e.withPointerEvents]:c===S&&l,[e.active]:c===S}),style:{fontFamily:U.normalizeFontFamilyCssValue(v.fontFamily),fontWeight:v.fontWeight,fontStyle:v.fontStyle,width:I.sizing==="auto"?"max-content":s.scalingValue(I.width,l),letterSpacing:s.scalingValue(N,l),wordSpacing:s.scalingValue(B,l),textAlign:z,fontSize:s.scalingValue(x.fontSize,l),lineHeight:s.scalingValue(x.lineHeight,l),textTransform:w.textTransform??"none",textDecoration:w.textDecoration??"none",fontVariant:w.fontVariant??"normal",color:W,transitionDuration:a.duration?`${Math.round(parseInt(a.duration)/2)}ms`:"500ms"},children:t.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-hover-color":h.linkHoverColor,"--link-color":h.linkColor,position:"relative",top:s.scalingValue(h.offset.y,l),left:s.scalingValue(h.offset.x,l)},children:t.jsx(M.RichTextRenderer,{content:r.imageCaption})})},c))})}),t.jsx(L.Splide2,{onMove:r=>{D(r.index)},ref:O,options:{arrows:!1,speed:a.duration?parseInt(a.duration):500,autoplay:f.autoPlay!==null,...f.autoPlay!==null&&{interval:parseInt(f.autoPlay)*1e3},direction:n==="horiz"||a.type==="fade in"?"ltr":"ttb",pagination:!1,drag:f.triggersList.drag,perPage:1,width:m?m.width:"100%",height:m?m.height:"100%",type:a.type==="fade in"?"fade":"loop",rewind:!0},children:u.map((r,c)=>t.jsx(L.SplideSlide,{children:t.jsx("div",{className:e.sliderItem,children:t.jsx("div",{className:e.imgWrapper,children:t.jsx("img",{className:d(e.sliderImage,{[e.contain]:r.image.objectFit==="contain",[e.cover]:r.image.objectFit==="cover"}),src:r.image.assetId,alt:r.image.name??""})})})},c))},$),o.isActive&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:d(e.arrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{onClick:()=>{b("-1")},className:e.arrowInner,style:{transform:`translate(${s.scalingValue(y,l)}, ${s.scalingValue(R*(n==="horiz"?1:-1),l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:d(e.arrowImg,e.mirror)}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg,e.mirror)})]})}),t.jsx("div",{className:d(e.arrow,e.nextArrow,{[e.arrowVertical]:n==="vert",[e.hoverArrow]:o.show==="on hover"}),style:{color:o.color,"--arrow-hover-color":o.hover},children:t.jsxs("button",{className:e.arrowInner,onClick:()=>b("+1"),style:{transform:`translate(${s.scalingValue(y*(n==="horiz"?-1:1),l)}, ${s.scalingValue(R,l)}) scale(${p.controls.scale/100}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:[o.arrowsImgUrl&&t.jsx(k.SvgImage,{url:o.arrowsImgUrl,fill:o.color,hoverFill:o.hover,className:e.arrowImg}),!o.arrowsImgUrl&&t.jsx(V,{color:o.color,className:d(e.arrowIcon,e.arrowImg)})]})})]}),f.triggersList.click&&t.jsx("div",{className:e.clickOverlay,onClick:()=>{_&&_.go("+1")}}),i.isActive&&t.jsx("div",{className:d(e.pagination,{[e.paginationInsideBottom]:i.position==="inside-1"&&n==="horiz",[e.paginationInsideTop]:i.position==="inside-2"&&n==="horiz",[e.paginationOutsideBottom]:i.position==="outside-1"&&n==="horiz",[e.paginationOutsideTop]:i.position==="outside-2"&&n==="horiz",[e.paginationInsideLeft]:i.position==="inside-1"&&n==="vert",[e.paginationInsideRight]:i.position==="inside-2"&&n==="vert",[e.paginationOutsideLeft]:i.position==="outside-1"&&n==="vert",[e.paginationOutsideRight]:i.position==="outside-2"&&n==="vert",[e.paginationVertical]:n==="vert"}),children:t.jsx("div",{className:e.paginationInner,style:{backgroundColor:i.colors[2],transform:`scale(${i.scale/100}) translate(${s.scalingValue(i.offset.x,l)}, ${s.scalingValue(i.offset.y,l)}) rotate(${n==="horiz"?"0deg":"90deg"})`},children:u.map((r,c)=>t.jsx("button",{onClick:()=>{_&&_.go(c)},className:d(e.paginationItem),children:t.jsx("div",{className:d(e.dot,{[e.activeDot]:c===S}),style:{backgroundColor:c===S?i.colors[0]:i.colors[1],"--pagination-hover-color":i.hover}})},c))})})]})})}function V({color:p,className:u}){return t.jsx("svg",{viewBox:"0 0 10 18",className:u,children:t.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:t.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:p,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.ControlSlider=ze;
@@ -5,7 +5,7 @@ import { s as $ } from "./scalingValue-C9JH5L6O.mjs";
5
5
  import { b as Et } from "./buildColorVars-CLyWQm5K.mjs";
6
6
  import { u as Pt } from "./useScopedStyles-DhBG3557.mjs";
7
7
  import { o as J, t as U } from "./textStylesToCss-05Mn6I_2.mjs";
8
- import { S as to } from "./SvgImage-B5mR9y6q.mjs";
8
+ import { S as to } from "./SvgImage-CwRq9-ec.mjs";
9
9
  import { R as oo } from "./RichTextRenderer-D52Xto59.mjs";
10
10
  const X = 300, m = 4e-3, eo = {
11
11
  questionColor: "question-color",
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),G=require("classnames"),p=require("./scalingValue-CSHYgTZl.js"),Kt=require("./buildColorVars-CE2D5cQV.js"),Yt=require("./useScopedStyles-Bf6yohVQ.js"),w=require("./textStylesToCss-CNN3zZTV.js"),Zt=require("./SvgImage-DFlmxAoL.js"),Jt=require("./RichTextRenderer-DEFXh5o6.js"),K=300,h=.004,Ut={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Xt=["hover","focus","filled","success","error"];function Et(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Y(t,r,n,s){return r!==void 0&&r<(t??.01)?`${n} ${s}`:n}function Z(t,r,n,s){const l=t??.01;return r===void 0||r>=l?{}:{[`--${n}-text-leading-gap`]:p.scalingValue((l-r)/2,s)}}function Pt(t){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),m=require("react"),G=require("classnames"),p=require("./scalingValue-CSHYgTZl.js"),Kt=require("./buildColorVars-CE2D5cQV.js"),Yt=require("./useScopedStyles-Bf6yohVQ.js"),w=require("./textStylesToCss-CNN3zZTV.js"),Zt=require("./SvgImage-_QN8ngad.js"),Jt=require("./RichTextRenderer-DEFXh5o6.js"),K=300,h=.004,Ut={questionColor:"question-color",answerColor:"answer-color",dividerColor:"divider-color",iconColor:"icon-color",questionHoverColor:"question-hover-color",iconHoverColor:"icon-hover-color",iconActiveColor:"icon-active-color",dividerHoverColor:"divider-hover-color"},Xt=["hover","focus","filled","success","error"];function Et(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function Y(t,r,n,s){return r!==void 0&&r<(t??.01)?`${n} ${s}`:n}function Z(t,r,n,s){const l=t??.01;return r===void 0||r>=l?{}:{[`--${n}-text-leading-gap`]:p.scalingValue((l-r)/2,s)}}function Pt(t){return`
2
2
  .${t}-wrapper {
3
3
  box-sizing: border-box;
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Ft=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const p=require("./scalingValue-CSHYgTZl.js"),Jt=require("./buildColorVars-CE2D5cQV.js"),Qt=require("./useScopedStyles-Bf6yohVQ.js"),Mt=require("./useLazyVideos-CdCbc2j0.js"),ot=require("./LinkWrapper-CTqM1ucO.js"),q=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),Zt=require("react-dom"),_e=require("./textStylesToCss-CNN3zZTV.js"),Pt=require("./SvgImage-DFlmxAoL.js"),At=require("./LazyVideo-imbU18js.js");function ei(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zt(e){return((e==null?void 0:e.trim().length)??0)>0}function wt(e,i,n,a){return i!==void 0&&i<(e??.01)?`${n} ${a}`:n}function bt(e,i,n,a){const l=e??.01;return i===void 0||i>=l?{}:{[`--${n}-title-leading-gap`]:p.scalingValue((l-i)/2,a)}}function ti(e){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),Ft=require("./react-splide.esm-CabaEmHi.js");;/* empty css */const p=require("./scalingValue-CSHYgTZl.js"),Jt=require("./buildColorVars-CE2D5cQV.js"),Qt=require("./useScopedStyles-Bf6yohVQ.js"),Mt=require("./useLazyVideos-CdCbc2j0.js"),ot=require("./LinkWrapper-CTqM1ucO.js"),q=require("./EmbedMediaFrame-DsOTKE4i.js"),r=require("react"),Zt=require("react-dom"),_e=require("./textStylesToCss-CNN3zZTV.js"),Pt=require("./SvgImage-_QN8ngad.js"),At=require("./LazyVideo-imbU18js.js");function ei(e){return`calc(var(--cntrl-article-width, 100vw) * ${e/1440})`}function zt(e){return((e==null?void 0:e.trim().length)??0)>0}function wt(e,i,n,a){return i!==void 0&&i<(e??.01)?`${n} ${a}`:n}function bt(e,i,n,a){const l=e??.01;return i===void 0||i>=l?{}:{[`--${n}-title-leading-gap`]:p.scalingValue((l-i)/2,a)}}function ti(e){return`
2
2
  .${e}-wrapper {
3
3
  display: grid;
4
4
  align-items: start;
@@ -10,7 +10,7 @@ import { i as Oe, g as Et, E as qt, a as ci } from "./EmbedMediaFrame-DwHeOAy5.m
10
10
  import { useMemo as Rt, useState as k, useRef as $, useEffect as H, useCallback as re, useLayoutEffect as jt } from "react";
11
11
  import { createPortal as di } from "react-dom";
12
12
  import { o as It, t as Ct } from "./textStylesToCss-05Mn6I_2.mjs";
13
- import { S as ui } from "./SvgImage-B5mR9y6q.mjs";
13
+ import { S as ui } from "./SvgImage-CwRq9-ec.mjs";
14
14
  import { L as Xt } from "./LazyVideo-CdAWymKO.mjs";
15
15
  function mi(e) {
16
16
  return `calc(var(--cntrl-article-width, 100vw) * ${e / 1440})`;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DlyptAaK.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),Wt=require("./scalingValue-CSHYgTZl.js"),on=require("./useScopedStyles-Bf6yohVQ.js"),sn=require("./useLazyVideos-CdCbc2j0.js"),st=require("./EmbedMediaFrame-DsOTKE4i.js"),ln=require("./LazyVideo-imbU18js.js"),r=require("react"),an=require("react-dom"),cn=require("./HiveLightboxTitles-DEeyQGcf.js"),un=require("./getImageRect-BQhQXvT8.js"),fn=require("./textStylesToCss-CNN3zZTV.js");function dn(t){return`calc(var(--cntrl-article-width, 100vw) * ${t/1440})`}function hn(t){return`
2
2
  .${t}-wrapper {
3
3
  display: grid;
4
4
  align-items: start;
@@ -6,7 +6,7 @@ import { i as Mt, E as Ke, g as pn } from "./EmbedMediaFrame-DwHeOAy5.mjs";
6
6
  import { L as mn } from "./LazyVideo-CdAWymKO.mjs";
7
7
  import { useMemo as de, useRef as y, useState as $, useCallback as v, useEffect as _, useLayoutEffect as fe } from "react";
8
8
  import { createPortal as wn } from "react-dom";
9
- import { H as vn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
9
+ import { H as vn } from "./HiveLightboxTitles-BCoL46-V.mjs";
10
10
  import { g as yn } from "./getImageRect-CBMhFNHM.mjs";
11
11
  import { t as xn } from "./textStylesToCss-05Mn6I_2.mjs";
12
12
  function $n(t) {
@@ -1,7 +1,7 @@
1
1
  import { jsxs as x, jsx as r, Fragment as J } from "react/jsx-runtime";
2
2
  import { useMemo as w } from "react";
3
3
  import { s } from "./scalingValue-C9JH5L6O.mjs";
4
- import { S as Ft } from "./SvgImage-B5mR9y6q.mjs";
4
+ import { S as Ft } from "./SvgImage-CwRq9-ec.mjs";
5
5
  import { j as Z, r as q, D as Q, b as _, a as pt, g as wt, c as F, T as K, d as jt, e as b, f as R, h as At } from "./utils-FxC9rcxw.mjs";
6
6
  function Qt({
7
7
  prefix: i,
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-DFlmxAoL.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;
1
+ "use strict";const e=require("react/jsx-runtime"),T=require("react"),c=require("./scalingValue-CSHYgTZl.js"),Ht=require("./SvgImage-_QN8ngad.js"),i=require("./utils-033j3qNL.js");function Rt({prefix:a,entry:w,settings:R,isEditor:r,isEditMode:m,isPreviewMode:st,onClose:J}){const{title1Width:E,title2Width:F,title3Width:O,title1MarginLeft:y=0,title2MarginLeft:k=0,title3MarginLeft:U=0,titleRowMarginBottom:_=0,titleHeaderLayout:rt="desktop",contentMarginTop:Z=0,iconMarginRight:ct=0,closeIcon:q=null,closeIconMaxWidth:G=0,closeIconColor:z="#000000",closeIconHoverColor:Q="#cccccc"}=R,dt=c.scalingValue(Z,r),ht=c.scalingValue(Math.max(Z,i.TITLE_PADDING_HANDLE_WIDTH),r),X=c.scalingValue(ct,r),ft=c.scalingValue(_,r),g=rt==="mobile",S=i.journalTextFieldsToCss("title1",i.resolveJournalTextFields(R,"title1"),r),M=i.journalTextFieldsToCss("title2",i.resolveJournalTextFields(R,"title2"),r),N=i.journalTextFieldsToCss("title3",i.resolveJournalTextFields(R,"title3"),r),u=T.useMemo(()=>({title1Width:E??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title1Width,title2Width:F??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title2Width,title3Width:O??i.DEFAULT_JOURNAL_TITLE_WIDTHS.title3Width}),[E,F,O]),W=T.useMemo(()=>({title2MarginLeft:k,title3MarginLeft:U}),[k,U]),d=T.useMemo(()=>i.buildJournalTitleSlots(a,w,S,M,N),[a,w,S,M,N]),b=T.useMemo(()=>d.map(t=>u[t.widthKey]),[d,u]),p=T.useMemo(()=>i.resolveJournalTitleWidths(d.length,b),[d.length,b]),gt=T.useMemo(()=>i.getEffectiveJournalTitleWidths(d.length,b),[d.length,b]),K=T.useMemo(()=>d.filter(t=>t.prefix==="title1"),[d]),L=T.useMemo(()=>d.filter(t=>t.prefix==="title2"||t.prefix==="title3"),[d]),B=T.useMemo(()=>i.getRowScopedJournalTitleWidths(K,u),[K,u]),j=T.useMemo(()=>i.getRowScopedJournalTitleWidths(L,u),[L,u]),D=!!(w.title1||w.title2||w.title3),$=q!==null;if(!(D||$))return null;const Y=(y??0)>0||m,A=(t,n)=>{const s=d.findIndex(l=>l.prefix===t.prefix);if(!g||n==="single-row")return{effectiveWidth:gt[s]??0,resolvedWidth:p[s]??0,maxWidth:i.getJournalTitleMaxWidth(s,p)};if(n==="two-row-top"){const l=K.findIndex(f=>f.prefix===t.prefix);return{effectiveWidth:B.effective[l]??0,resolvedWidth:B.resolved[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,B.resolved)}}const o=L.findIndex(l=>l.prefix===t.prefix);return{effectiveWidth:j.effective[o]??0,resolvedWidth:j.resolved[o]??0,maxWidth:i.getJournalTitleMaxWidth(o,j.resolved)}},C=(t,n,s)=>{if(!g||s==="single-row"){const h=t.findIndex(I=>I.prefix===n.prefix),v=t.map(I=>u[I.widthKey]),H=i.resolveJournalTitleWidths(t.length,v);return{effectiveWidth:i.getEffectiveJournalTitleWidths(t.length,v)[h]??0,resolvedWidth:H[h]??0,maxWidth:i.getJournalTitleMaxWidth(h,H)}}if(s==="two-row-top"){const h=t.filter(I=>I.prefix==="title1"),v=h.findIndex(I=>I.prefix===n.prefix),{resolved:H,effective:at}=i.getRowScopedJournalTitleWidths(h,u);return{effectiveWidth:at[v]??0,resolvedWidth:H[v]??0,maxWidth:i.getJournalTitleMaxWidth(v,H)}}const o=t.filter(h=>h.prefix==="title2"||h.prefix==="title3"),l=o.findIndex(h=>h.prefix===n.prefix),{resolved:f,effective:x}=i.getRowScopedJournalTitleWidths(o,u);return{effectiveWidth:x[l]??0,resolvedWidth:f[l]??0,maxWidth:i.getJournalTitleMaxWidth(l,f)}},ut=t=>i.getJournalTitleBoundaryOffset(d,p,W,t)+(g?0:y??0),xt=()=>g?0:y??0,P=t=>L.slice(0,t).reduce((n,s,o)=>n+(s.marginLeftKey?W[s.marginLeftKey]??0:0)+(j.resolved[o]??0),0),mt=t=>{const n=L[t];return P(t)+(n.marginLeftKey?W[n.marginLeftKey]??0:0)+(j.resolved[t]??0)},V=(t,n,s)=>{const o=t.marginLeftKey?W[t.marginLeftKey]??0:0,{effectiveWidth:l,resolvedWidth:f,maxWidth:x}=s??A(t,n),h=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH),v=m&&n==="two-row-top";return e.jsxs("div",{className:`${a}-title-cell`,"data-title":t.prefix,style:{width:c.scalingValue(l,r),...o>0?{marginLeft:c.scalingValue(o,r)}:{}},children:[e.jsx("p",{className:t.className,style:t.style,children:t.text}),v&&t.marginLeftKey?e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(-o,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}}):null,v?e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(x),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,right:c.scalingValue(-i.TITLE_RESIZE_HANDLE_WIDTH/2,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}}):null]},t.className)},tt=(t="two-row")=>{const n=d.findIndex(l=>l.prefix==="title1"),s=n>=0?p[n]:u.title1Width,o=t==="two-row"&&m;return e.jsx("div",{...o?{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(s)}:{},style:{width:c.scalingValue(y??0,r),flexShrink:0,alignSelf:"stretch",...o?{pointerEvents:"auto"}:{}}})},et=()=>e.jsx("span",{className:`${a}-titles-baseline-strut`,style:S,"aria-hidden":"true",children:" "}),Tt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N);return e.jsx(e.Fragment,{children:n.map(s=>V(s,"single-row",C(n,s,"single-row")))})},wt=t=>{const n=i.buildJournalTitleSlots(a,t,S,M,N),s=n.find(o=>o.prefix==="title1");return s?V(s,"two-row-top",C(n,s,"two-row-top")):null},vt=(t,n=!1)=>{const s=i.buildJournalTitleSlots(a,t,S,M,N),o=s.filter(x=>x.prefix==="title2"||x.prefix==="title3"),l=m&&n;return o.length>0||l||(_??0)>0?e.jsxs("div",{className:`${a}-titles-row-bottom-wrap`,children:[o.length>0?e.jsxs("div",{className:`${a}-titles-row-bottom`,children:[e.jsx("div",{className:`${a}-titles-stack`,children:o.map(x=>V(x,"two-row-bottom",C(s,x,"two-row-bottom")))}),n&&m?e.jsxs(e.Fragment,{children:[St(),Mt()]}):null]}):null,(_??0)>0||l?e.jsx("div",{"data-controls":l?"titleRowMarginBottom":void 0,"data-controls-axis":l?"y":void 0,"data-controls-reverse":l?"":void 0,className:l?`${a}-control`:void 0,style:{height:ft,width:"100%",flexShrink:0,pointerEvents:l?"auto":"none"}}):null]}):null},pt=()=>e.jsxs("div",{className:`${a}-close-icon`,style:{width:c.scalingValue(G??0,r),height:c.scalingValue(G??0,r),marginRight:X,"--close-icon-hover-color":Q},children:[e.jsx("button",{type:"button",className:`${a}-close-icon-inner`,onClick:t=>{t.stopPropagation(),J==null||J()},"aria-label":"Close",children:e.jsx(Ht.SvgImage,{url:q??"",fill:z,hoverFill:r&&!st?z:Q,className:`${a}-close-icon-img`})}),m&&e.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${a}-control`,style:{position:"absolute",top:0,left:"100%",width:X,height:"100%",pointerEvents:"auto"}})]}),it=()=>$?e.jsx("div",{className:`${a}-titles-row-header-controls`,children:pt()}):null,nt=t=>e.jsx("div",{className:`${a}-titles-row-titles`,children:e.jsx("div",{className:`${a}-titles-stack`,children:t})}),Wt=t=>e.jsxs("div",{className:`${a}-titles-row-top`,children:[$||D?et():null,Y?tt("two-row"):null,nt(t),it()]}),Lt=(t,n=!1)=>e.jsxs(e.Fragment,{children:[Wt(wt(t)),vt(t,n)]}),It=()=>{const t=g?-1:d.findIndex(o=>o.prefix==="title1"),n=!g&&(m||(y??0)>0)?(()=>{const o=y??0,l=t>=0?p[t]:u.title1Width,f=Math.max(o,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":"title1MarginLeft","data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(l),style:{position:"absolute",top:0,left:0,width:c.scalingValue(f,r),height:"100%",pointerEvents:"auto"}},"title1MarginLeft")})():null,s=d.flatMap((o,l)=>{if(!o.marginLeftKey)return[];const f=W[o.marginLeftKey]??0,x=i.getJournalTitleOffsetBeforeSlot(d,p,W,l)+xt(),h=Math.max(f,i.TITLE_PADDING_HANDLE_WIDTH);return e.jsx("div",{"data-controls":o.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(p[l]),style:{position:"absolute",top:0,left:c.scalingValue(x,r),width:c.scalingValue(h,r),height:"100%",pointerEvents:"auto"}},o.marginLeftKey)});return n?[n,...s]:s},yt=()=>d.map((t,n)=>{const s=i.getJournalTitleMaxWidth(n,p),l=ut(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),St=()=>L.flatMap((t,n)=>{if(!t.marginLeftKey)return[];const s=W[t.marginLeftKey]??0,o=P(n),l=Math.max(s,i.TITLE_PADDING_HANDLE_WIDTH),{resolvedWidth:f}=A(t,"two-row-bottom");return e.jsx("div",{"data-controls":t.marginLeftKey,"data-controls-axis":"x","data-controls-min":"0","data-controls-max-fraction":String(f),style:{position:"absolute",top:0,left:c.scalingValue(o,r),width:c.scalingValue(l,r),height:"100%",pointerEvents:"auto"}},t.marginLeftKey)}),Mt=()=>L.map((t,n)=>{const{maxWidth:s}=A(t,"two-row-bottom"),l=mt(n)-i.TITLE_RESIZE_HANDLE_WIDTH/2;return e.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:e.jsx("div",{"data-controls":t.widthKey,"data-controls-axis":"x","data-controls-max-fraction":String(s),"data-controls-variant":"column-width",className:`${a}-title-resize-handle`,style:{position:"absolute",top:0,left:c.scalingValue(l,r),width:c.scalingValue(i.TITLE_RESIZE_HANDLE_WIDTH,r),height:"100%",pointerEvents:"auto"}})},`${t.widthKey}-junction`)}),ot=()=>!m||g?null:e.jsxs(e.Fragment,{children:[It(),yt()]}),lt=!!(w.title2||w.title3||(_??0)>0||m),Nt=()=>e.jsxs("div",{className:`${a}-titles-row ${a}-titles-row-header`,style:{width:"100%",position:"relative"},children:[$||D?et():null,Y?tt("single-row"):null,D?nt(Tt(w)):e.jsx("div",{className:`${a}-titles-row-titles`,"aria-hidden":"true"}),it(),ot()]}),jt=()=>e.jsxs("div",{style:{position:"relative",width:"100%",alignSelf:"stretch",display:"flex",flexDirection:"column",minHeight:0,...lt?{flex:1,height:"100%"}:{}},children:[e.jsx("div",{className:`${a}-titles-row-two-row`,style:lt?void 0:{flex:"0 0 auto",height:"auto"},children:Lt(w,!0)}),ot()]});return e.jsxs("div",{className:`${a}-lightbox-overlay-content`,children:[e.jsx("div",{style:{position:"relative",width:"100%",height:dt,flexShrink:0},children:m&&e.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${a}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:ht,pointerEvents:"auto"}})}),e.jsx("div",{style:{display:"flex",flexDirection:"row",width:"100%",...g?{flex:1,minHeight:0}:{}},children:e.jsx("div",{className:`${a}-lightbox-content-area${g?` ${a}-lightbox-content-area-stacked`:""}`,children:e.jsx("div",{className:`${a}-text-bar-cell${g?` ${a}-text-bar-cell-stacked`:""}`,style:g?void 0:{flex:1,minWidth:0,width:"100%"},children:g?jt():Nt()})})})]})}exports.HiveLightboxTitles=Rt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),Ae=require("react-dom"),h=require("./scalingValue-CSHYgTZl.js"),ae=require("./SvgImage-DFlmxAoL.js"),$=require("classnames"),fe=require("./react-splide.esm-CabaEmHi.js"),Te=require("./RichTextRenderer-DEFXh5o6.js"),Z=require("./getImageRect-BQhQXvT8.js"),pe=require("./getColorAlpha-CoSseoCn.js"),je=require("./textStylesToCss-CNN3zZTV.js"),$e="LightBox-module__hidden___9s-9x",ze="LightBox-module__heroImage___sTxNF",Fe="LightBox-module__background___rm9ml",Ne="LightBox-module__editor___4ACaY",Oe="LightBox-module__contentStyle___Bgnsq",We="LightBox-module__imageStyle___tLIlB",Ee="LightBox-module__imgWrapper___LuFUp",De="LightBox-module__contain___8-yaS",Me="LightBox-module__cover___hNvOG",Pe="LightBox-module__caption___b6L2I",Xe="LightBox-module__captionTextInner___rCGNH",He="LightBox-module__lightboxSplide___XFuWC",Ye="LightBox-module__arrow___iz38X",Ue="LightBox-module__arrowVertical___Zfz81",qe="LightBox-module__nextArrow___zkAQN",Ge="LightBox-module__arrowInner___p48sW",Ke="LightBox-module__arrowIcon___3VaFf",Ze="LightBox-module__arrowImg___pNV88",Je="LightBox-module__mirror___pjeXc",Qe="LightBox-module__thumbsWrapper___GB-nU",et="LightBox-module__thumbsContainerVertical___wttk5",tt="LightBox-module__thumbsContainer___osSma",nt="LightBox-module__thumbsAlignStart___MO6tY",rt="LightBox-module__thumbsAlignCenter___Q4sUx",ot="LightBox-module__thumbsAlignEnd___p4y9R",it="LightBox-module__thumbItem___HvnF3",st="LightBox-module__closeButton___g2khP",at="LightBox-module__fadeIn___0m5GW",lt="LightBox-module__slideInLeft___gPYwC",ct="LightBox-module__slideInRight___S-pPp",ut="LightBox-module__slideInTop___DFdAj",dt="LightBox-module__slideInBottom___m27kZ",ht="LightBox-module__fadeOut___55qBR",mt="LightBox-module__slideOutLeft___NvU7P",gt="LightBox-module__slideOutRight___SK7eC",ft="LightBox-module__slideOutTop___Vgg0z",pt="LightBox-module__slideOutBottom___nJ0Ef",_t="LightBox-module__scaleSlide___vZriG",e={hidden:$e,heroImage:ze,background:Fe,editor:Ne,contentStyle:Oe,imageStyle:We,imgWrapper:Ee,contain:De,cover:Me,caption:Pe,captionTextInner:Xe,lightboxSplide:He,arrow:Ye,arrowVertical:Ue,nextArrow:qe,arrowInner:Ge,arrowIcon:Ke,arrowImg:Ze,mirror:Je,thumbsWrapper:Qe,thumbsContainerVertical:et,thumbsContainer:tt,thumbsAlignStart:nt,thumbsAlignCenter:rt,thumbsAlignEnd:ot,thumbItem:it,closeButton:st,fadeIn:at,slideInLeft:lt,slideInRight:ct,slideInTop:ut,slideInBottom:dt,fadeOut:ht,slideOutLeft:mt,slideOutRight:gt,slideOutTop:ft,slideOutBottom:pt,scaleSlide:_t},J=(l,L,f)=>{const p={},[V,R]=l.split("-");return V==="top"?(p.top="0",p.bottom="auto"):V==="middle"?(p.top="50%",p.bottom="auto"):V==="bottom"&&(p.top="auto",p.bottom="0"),R==="left"?(p.left="0",p.right="auto"):R==="center"?(p.left="50%",p.right="auto"):R==="right"&&(p.left="auto",p.right="0"),V==="middle"&&R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), calc(-50% + ${h.scalingValue(L.y,f)}))`:V==="middle"?p.transform=`translate(${h.scalingValue(L.x,f)}, calc(-50% + ${h.scalingValue(L.y,f)}))`:R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), ${h.scalingValue(L.y,f)})`:p.transform=`translate(${h.scalingValue(L.x,f)}, ${h.scalingValue(L.y,f)})`,p};function vt(l,L){const f=(()=>{if(l==="fade in")return e.fadeIn;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),p=(()=>{if(l==="fade in"||l==="mix")return e.fadeIn;if(l==="slide in")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),V=(()=>{if(l==="fade in"||l==="mix")return e.fadeOut;if(l==="slide in")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})(),R=(()=>{if(l==="fade in")return e.fadeOut;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})();return{appearClass:f,backdropAppearClass:p,backdropDisappearClass:V,disappearClass:R}}const xt=({settings:l,content:L,styles:f,portalId:p,activeEvent:V,isEditor:R,isPreviewMode:r})=>{const[X,O]=g.useState(!1),{assetId:H}=l.thumbnailBlock.cover;return g.useEffect(()=>{V==="close"&&O(!1),V==="open"&&O(!0)},[V]),u.jsxs(u.Fragment,{children:[u.jsx("img",{src:H,alt:"Cover",className:e.heroImage,onClick:()=>O(!0)}),u.jsx(bt,{isOpen:X,onClose:()=>O(!1),content:L,settings:l,lightboxStyles:f,portalId:p,isEditor:R})]})},bt=({isOpen:l,onClose:L,content:f,lightboxStyles:p,settings:V,portalId:R,isEditor:r,metadata:X})=>{var ge;const{widthSettings:O,fontSettings:H,letterSpacing:ve,textAlign:xe,wordSpacing:be,fontSizeLineHeight:le,textAppearance:Q,color:we}=p.imageCaption??{},[z,Y]=g.useState(0),[ce,ee]=g.useState(0),[te,ne]=g.useState(!1),[Le,U]=g.useState(!1),[ue,de]=g.useState({}),I=g.useRef(null),re=g.useRef(null),A=g.useRef(null),W=g.useRef(!1),C=g.useRef(null),E=g.useRef(null),D=g.useRef(null),S=g.useRef(null),F=g.useRef(!1),he=g.useRef(null),[ye,oe]=g.useState(!1),{appear:q,triggers:T,slider:s,thumbnail:_,controls:v,area:B,caption:M,layout:P}=V.lightboxBlock,{appearClass:Ie,backdropAppearClass:Ce,backdropDisappearClass:Se,disappearClass:Be}=vt(q.type,q.direction),ie=(X==null?void 0:X.itemId)??null;g.useEffect(()=>{const t=()=>{setTimeout(()=>{var o,c;(c=(o=I.current)==null?void 0:o.splide)==null||c.refresh()},16)},n=()=>{ee(o=>o+1)};return window.addEventListener("ArticleEditor.Layout:change",t),window.addEventListener("ArticleEditor.ComponentContent:change",n),()=>{window.removeEventListener("ArticleEditor.Layout:change",t),window.removeEventListener("ArticleEditor.ComponentContent:change",n)}},[]),g.useEffect(()=>{if(!l||!_.isActive){oe(!1);return}const t=he.current;if(!t)return;const n=()=>{s.direction==="horiz"?oe(t.scrollWidth>t.clientWidth):oe(t.scrollHeight>t.clientHeight)};n();const o=new ResizeObserver(n);return o.observe(t),()=>o.disconnect()},[l,_.isActive,f.length,ue,s.direction]);const N=g.useCallback(()=>{const t=window.matchMedia("(max-width: 768px)").matches,n=pe.getColorAlpha(B.color);t&&!r&&n>.9&&(document.body.style.backgroundColor=""),ne(!0),W.current=!0;const o=c=>{c.target===C.current&&c.animationName&&(C.current&&E.current&&C.current.removeEventListener("animationend",E.current),E.current=null,W.current&&(W.current=!1,L()),ne(!1))};C.current&&(E.current=o,C.current.addEventListener("animationend",o))},[L,B.color,r]),Ve=(t,n,o)=>{var c,m;if(t){if(T.type==="click"&&T.switch==="image")T.repeat==="close"&&z===f.length-1?N():(c=I.current)==null||c.go("+1");else if(T.type==="click"&&T.switch==="50/50"){const d=t.getBoundingClientRect(),i=n-d.left,x=o-d.top,k=d.width,b=d.height;let y;s.direction==="horiz"?y=i<k/2?"-1":"+1":y=x<b/2?"-1":"+1",(m=I.current)==null||m.go(y)}}},me=t=>{if(F.current){F.current=!1;return}const n=f[z],o=(n==null?void 0:n.image.objectFit)==="cover";let c,m;if("changedTouches"in t&&t.changedTouches.length>0)c=t.changedTouches[0].clientX,m=t.changedTouches[0].clientY;else if("clientX"in t)c=t.clientX,m=t.clientY;else return;let d;if(o&&A.current){const i=Z.getPaddedContainerBounds(A.current);d=c>=i.left&&c<=i.right&&m>=i.top&&m<=i.bottom}else{const i=A.current?Z.getDisplayedImageRect(A.current):null;if(!i){t.target===t.currentTarget&&N();return}d=c>=i.x&&c<=i.x+i.width&&m>=i.y&&m<=i.y+i.height}d?Ve(A.current,c,m):N()},Re=t=>{const n=t.target;(n.classList.contains(e.thumbsWrapper)||n.classList.contains(e.thumbsContainer))&&me(t)};g.useEffect(()=>{if(!l)return;const t=n=>{var o,c;if(n.key==="Escape"){N();return}if(n.key==="ArrowRight"){Y(m=>(m+1)%Math.max(f.length,1)),(o=I.current)==null||o.go("+1");return}n.key==="ArrowLeft"&&(Y(m=>(m-1+Math.max(f.length,1))%Math.max(f.length,1)),(c=I.current)==null||c.go("-1"))};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[l,N,f.length]),g.useEffect(()=>{if(l){if(Y(0),ee(n=>n+1),W.current=!1,ne(!1),U(!1),de({}),!ie)return;const t=new CustomEvent("page-overlay",{detail:{itemId:ie}});window.dispatchEvent(t)}return()=>{C.current&&E.current&&(C.current.removeEventListener("animationend",E.current),E.current=null),U(!1)}},[l,ie]),g.useEffect(()=>{re.current!==null&&re.current!==s.type&&ee(t=>t+1),re.current=s.type},[s.type]),g.useEffect(()=>{if(!l)return;const t=document.body.style.overflow,n=window.matchMedia("(max-width: 768px)").matches,o=pe.getColorAlpha(B.color);document.body.style.overflow="hidden",U(!1);const c=d=>{d.target===C.current&&!W.current&&d.animationName&&(n&&!r&&o>.9&&(document.body.style.backgroundColor=B.color),U(!0),C.current&&D.current&&C.current.removeEventListener("animationend",D.current),D.current=null)};C.current&&(D.current=c,C.current.addEventListener("animationend",c));const m=d=>{const i=d.target;i&&(i.closest(`.${e.thumbsWrapper}`)||i.closest(`.${e.thumbsContainer}`))||s.type!=="slide"&&d.preventDefault()};return document.addEventListener("touchmove",m,{passive:!1}),()=>{document.body.style.overflow=t,document.removeEventListener("touchmove",m),C.current&&D.current&&(C.current.removeEventListener("animationend",D.current),D.current=null),U(!1)}},[l,r,B.color,s.type]),g.useEffect(()=>{if(!l)return;const t=n=>{var c,m;if(W.current){n.stopPropagation();return}if(F.current){F.current=!1;return}const o=n.target;if(!(o&&(o.closest(`.${e.thumbsContainer}`)||o.closest(`.${e.thumbItem}`)||o.closest(`.${e.arrow}`)||o.closest(`.${e.closeButton}`)||o.closest(`.${e.caption}`)))){if(s.type==="slide"&&T.type==="drag"&&((m=(c=I.current)==null?void 0:c.splide)!=null&&m.root)){const d=I.current.splide.root;if(o&&(d.contains(o)||d===o))return}if(n.touches.length===0&&n.changedTouches.length>0){const d=f[z],i=(d==null?void 0:d.image.objectFit)==="cover",x=n.changedTouches[0];let k;if(i&&A.current){const b=Z.getPaddedContainerBounds(A.current);k=x.clientX>=b.left&&x.clientX<=b.right&&x.clientY>=b.top&&x.clientY<=b.bottom}else{const b=A.current?Z.getDisplayedImageRect(A.current):null;if(!b)return;k=x.clientX>=b.x&&x.clientX<=b.x+b.width&&x.clientY>=b.y&&x.clientY<=b.y+b.height}if(!k){n.stopPropagation(),W.current=!0;const b=y=>{y.stopPropagation(),y.preventDefault(),document.removeEventListener("click",b,!0)};document.addEventListener("click",b,!0),N()}}}};return document.addEventListener("touchend",t,{passive:!0}),()=>{document.removeEventListener("touchend",t)}},[l,N,z,f]);const se=(s.type==="scale"||s.type==="fade")&&s.direction==="vert"&&T.type==="drag";g.useEffect(()=>{var y,G;if(!l||!se||!((G=(y=I.current)==null?void 0:y.splide)!=null&&G.root))return;const t=I.current.splide.root,n=30,o=(a,w)=>{if(S.current){const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);(j>0||K>0)&&(F.current=!0)}},c=a=>{S.current&&(a.preventDefault(),o(a.clientX,a.clientY))},m=a=>{S.current&&a.touches.length>0&&(a.preventDefault(),o(a.touches[0].clientX,a.touches[0].clientY))},d=(a,w)=>{if(!S.current||!I.current){S.current=null;return}const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);K>n&&K>j&&I.current.go(w<S.current.y?"+1":"-1"),S.current=null},i=a=>{S.current&&d(a.clientX,a.clientY),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("pointermove",c)},x=a=>{if(S.current){if(a.changedTouches.length>0){const w=a.changedTouches[0];d(w.clientX,w.clientY)}document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),document.removeEventListener("touchmove",m)}},k=a=>{S.current={x:a.clientX,y:a.clientY},F.current=!1,document.addEventListener("pointermove",c,{passive:!1}),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i)},b=a=>{a.touches.length>0&&(S.current={x:a.touches[0].clientX,y:a.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",x),document.addEventListener("touchcancel",x))};return t.addEventListener("pointerdown",k),t.addEventListener("touchstart",b),()=>{t.removeEventListener("pointerdown",k),t.removeEventListener("touchstart",b),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),S.current=null,F.current=!1}},[l,se,ce]);const ke={backgroundColor:B.color,backdropFilter:`blur(${B.blur}px)`,animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(R)?null:Ae.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:r?null:C,className:$(e.background,te?Se:Ce,{[e.editor]:r},{[e.hidden]:!l}),style:{...ke,...Le&&!r&&!te?{position:"absolute"}:{}}}),u.jsxs("div",{ref:r?C:null,className:$(e.contentStyle,te?Be:Ie,{[e.editor]:r},{[e.hidden]:!l}),style:{animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[u.jsx(fe.Splide2,{onMove:t=>Y(t.index),ref:I,className:e.lightboxSplide,options:{arrows:!1,speed:s.duration?parseInt(s.duration):500,direction:s.direction==="horiz"||s.type==="fade"||s.type==="scale"?"ltr":"ttb",pagination:!1,drag:T.type==="drag"&&!se,perPage:1,width:"100%",height:"100%",type:s.type==="fade"||s.type==="scale"?"fade":"loop",padding:0,rewind:T.repeat!=="close",start:0},style:{"--splide-speed":s.duration},children:f.map((t,n)=>{const o=J(P.position,P.offset,r),c=`${h.scalingValue(P.padding.top,r)} ${h.scalingValue(P.padding.right,r)} ${h.scalingValue(P.padding.bottom,r)} ${h.scalingValue(P.padding.left,r)}`,m=s.type==="scale"?(()=>{const{transform:d,...i}=o;return{...i,position:"absolute",padding:c,boxSizing:"border-box","--position-transform":d||"none"}})():{...o,position:"absolute",padding:c,boxSizing:"border-box"};return u.jsx(fe.SplideSlide,{children:u.jsx("div",{className:e.imgWrapper,onClick:me,children:u.jsx("img",{ref:n===z?A:null,className:$(e.imageStyle,{[e.contain]:t.image.objectFit==="contain",[e.cover]:t.image.objectFit==="cover",[e.scaleSlide]:s.type==="scale"}),src:t.image.assetId,alt:t.image.name??"",style:{...m,pointerEvents:t.image.objectFit==="contain"?"none":"auto"}})})},n)})},ce),v.isActive&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:$(e.arrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x,r)}, ${h.scalingValue(v.offset.y*(s.direction==="horiz"?1:-1),r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:$(e.arrowImg,e.mirror)}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg,e.mirror)})]})}),u.jsx("div",{className:$(e.arrow,e.nextArrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x*(s.direction==="horiz"?-1:1),r)}, ${h.scalingValue(v.offset.y,r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:e.arrowImg}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg)})]})})]}),B.closeIconUrl&&(()=>{const t=J(B.closeIconAlign,B.closeIconOffset,r),n=`scale(${B.closeIconScale})`,o=t.transform?`${t.transform} ${n}`:n;return u.jsx("button",{className:e.closeButton,style:{...t,transform:o},onClick:N,"aria-label":"Close lightbox",children:u.jsx(ae.SvgImage,{url:B.closeIconUrl,fill:B.closeIconColor??"#000000",hoverFill:B.closeIconHover??"#cccccc"})})})(),M&&M.isActive&&p.imageCaption&&((ge=f[z])==null?void 0:ge.imageCaption)&&u.jsx("div",{className:e.caption,style:{...J(M.alignment,M.offset,r),fontFamily:je.normalizeFontFamilyCssValue(H.fontFamily),fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:O.sizing==="auto"?"max-content":h.scalingValue(O.width,r),letterSpacing:h.scalingValue(ve,r),wordSpacing:h.scalingValue(be,r),textAlign:xe,fontSize:h.scalingValue(le.fontSize,r),lineHeight:h.scalingValue(le.lineHeight,r),textTransform:Q.textTransform??"none",textDecoration:Q.textDecoration??"none",fontVariant:Q.fontVariant??"normal",color:we},onClick:t=>t.stopPropagation(),children:u.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-color":M.linkColor,"--link-hover-color":M.linkHoverColor},children:u.jsx(Te.RichTextRenderer,{content:f[z].imageCaption})})}),_.isActive&&(()=>{const[t,n]=_.position.split("-"),o=s.direction==="horiz"?`${t}-left`:_.position,c=J(o,_.offset,r),m=()=>{if(s.direction==="horiz"){if(n==="left")return"flex-start";if(n==="center")return"center";if(n==="right")return"flex-end"}else{if(t==="top")return"flex-start";if(t==="middle")return"center";if(t==="bottom")return"flex-end"}return"flex-start"};return u.jsx("div",{ref:he,className:e.thumbsWrapper,onClick:d=>Re(d),style:{position:r?"absolute":"fixed",...c,...s.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:u.jsx("div",{className:$(e.thumbsContainer,{[e.thumbsContainerVertical]:s.direction==="vert",[e.thumbsAlignStart]:_.align==="start",[e.thumbsAlignCenter]:_.align==="center",[e.thumbsAlignEnd]:_.align==="end"}),style:{gap:h.scalingValue(_.grid.gap,r),justifyContent:ye?"flex-start":m()},children:f.map((d,i)=>{const x=i===z,k=ue[i],y=_.grid.size*(x?_.activeState.scale:1),G=()=>{if(_.fit!=="fit")return{};if(!k)return s.direction==="horiz"?{height:h.scalingValue(y,r)}:{width:h.scalingValue(y,r)};const a=k.width/k.height;if(s.direction==="horiz"){const w=y,j=w*a;return{width:h.scalingValue(j,r),height:h.scalingValue(w,r)}}else{const w=y,j=w/a;return{width:h.scalingValue(w,r),height:h.scalingValue(j,r)}}};return u.jsx("button",{className:e.thumbItem,style:{...s.direction==="horiz"&&_.fit!=="fit"?{height:h.scalingValue(y,r)}:{},...s.direction==="vert"&&_.fit!=="fit"?{width:h.scalingValue(y,r)}:{},..._.fit==="cover"?{width:h.scalingValue(y,r),height:h.scalingValue(y,r)}:{},...G(),transition:x?"all 0.25s ease-out":"none",opacity:x?_.activeState.opacity/100:_.opacity/100,"--thumb-hover":_.activeState.opacity/100},onClick:a=>{var w;a.stopPropagation(),Y(i),(w=I.current)==null||w.go(i)},onMouseEnter:()=>{var a;_.triggers==="hov"&&((a=I.current)==null||a.go(i))},children:u.jsx("img",{src:d.image.assetId,alt:d.image.name??"",onLoad:a=>{const w=a.currentTarget;w.naturalWidth&&w.naturalHeight&&de(j=>({...j,[i]:{width:w.naturalWidth,height:w.naturalHeight}}))},style:{objectFit:_.fit==="cover"?"cover":"contain",..._.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},..._.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${d.image.name}-${i}`)})})})})()]})]}),document.getElementById(R))};function _e({color:l,className:L}){return u.jsx("svg",{viewBox:"0 0 10 18",className:L,children:u.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:u.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:l,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.LightboxGallery=xt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),Ae=require("react-dom"),h=require("./scalingValue-CSHYgTZl.js"),ae=require("./SvgImage-_QN8ngad.js"),$=require("classnames"),fe=require("./react-splide.esm-CabaEmHi.js"),Te=require("./RichTextRenderer-DEFXh5o6.js"),Z=require("./getImageRect-BQhQXvT8.js"),pe=require("./getColorAlpha-CoSseoCn.js"),je=require("./textStylesToCss-CNN3zZTV.js"),$e="LightBox-module__hidden___9s-9x",ze="LightBox-module__heroImage___sTxNF",Fe="LightBox-module__background___rm9ml",Ne="LightBox-module__editor___4ACaY",Oe="LightBox-module__contentStyle___Bgnsq",We="LightBox-module__imageStyle___tLIlB",Ee="LightBox-module__imgWrapper___LuFUp",De="LightBox-module__contain___8-yaS",Me="LightBox-module__cover___hNvOG",Pe="LightBox-module__caption___b6L2I",Xe="LightBox-module__captionTextInner___rCGNH",He="LightBox-module__lightboxSplide___XFuWC",Ye="LightBox-module__arrow___iz38X",Ue="LightBox-module__arrowVertical___Zfz81",qe="LightBox-module__nextArrow___zkAQN",Ge="LightBox-module__arrowInner___p48sW",Ke="LightBox-module__arrowIcon___3VaFf",Ze="LightBox-module__arrowImg___pNV88",Je="LightBox-module__mirror___pjeXc",Qe="LightBox-module__thumbsWrapper___GB-nU",et="LightBox-module__thumbsContainerVertical___wttk5",tt="LightBox-module__thumbsContainer___osSma",nt="LightBox-module__thumbsAlignStart___MO6tY",rt="LightBox-module__thumbsAlignCenter___Q4sUx",ot="LightBox-module__thumbsAlignEnd___p4y9R",it="LightBox-module__thumbItem___HvnF3",st="LightBox-module__closeButton___g2khP",at="LightBox-module__fadeIn___0m5GW",lt="LightBox-module__slideInLeft___gPYwC",ct="LightBox-module__slideInRight___S-pPp",ut="LightBox-module__slideInTop___DFdAj",dt="LightBox-module__slideInBottom___m27kZ",ht="LightBox-module__fadeOut___55qBR",mt="LightBox-module__slideOutLeft___NvU7P",gt="LightBox-module__slideOutRight___SK7eC",ft="LightBox-module__slideOutTop___Vgg0z",pt="LightBox-module__slideOutBottom___nJ0Ef",_t="LightBox-module__scaleSlide___vZriG",e={hidden:$e,heroImage:ze,background:Fe,editor:Ne,contentStyle:Oe,imageStyle:We,imgWrapper:Ee,contain:De,cover:Me,caption:Pe,captionTextInner:Xe,lightboxSplide:He,arrow:Ye,arrowVertical:Ue,nextArrow:qe,arrowInner:Ge,arrowIcon:Ke,arrowImg:Ze,mirror:Je,thumbsWrapper:Qe,thumbsContainerVertical:et,thumbsContainer:tt,thumbsAlignStart:nt,thumbsAlignCenter:rt,thumbsAlignEnd:ot,thumbItem:it,closeButton:st,fadeIn:at,slideInLeft:lt,slideInRight:ct,slideInTop:ut,slideInBottom:dt,fadeOut:ht,slideOutLeft:mt,slideOutRight:gt,slideOutTop:ft,slideOutBottom:pt,scaleSlide:_t},J=(l,L,f)=>{const p={},[V,R]=l.split("-");return V==="top"?(p.top="0",p.bottom="auto"):V==="middle"?(p.top="50%",p.bottom="auto"):V==="bottom"&&(p.top="auto",p.bottom="0"),R==="left"?(p.left="0",p.right="auto"):R==="center"?(p.left="50%",p.right="auto"):R==="right"&&(p.left="auto",p.right="0"),V==="middle"&&R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), calc(-50% + ${h.scalingValue(L.y,f)}))`:V==="middle"?p.transform=`translate(${h.scalingValue(L.x,f)}, calc(-50% + ${h.scalingValue(L.y,f)}))`:R==="center"?p.transform=`translate(calc(-50% + ${h.scalingValue(L.x,f)}), ${h.scalingValue(L.y,f)})`:p.transform=`translate(${h.scalingValue(L.x,f)}, ${h.scalingValue(L.y,f)})`,p};function vt(l,L){const f=(()=>{if(l==="fade in")return e.fadeIn;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),p=(()=>{if(l==="fade in"||l==="mix")return e.fadeIn;if(l==="slide in")switch(L){case"left":return e.slideInLeft;case"right":return e.slideInRight;case"top":return e.slideInTop;case"bottom":return e.slideInBottom;default:return e.slideInRight}return e.fadeIn})(),V=(()=>{if(l==="fade in"||l==="mix")return e.fadeOut;if(l==="slide in")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})(),R=(()=>{if(l==="fade in")return e.fadeOut;if(l==="slide in"||l==="mix")switch(L){case"left":return e.slideOutLeft;case"right":return e.slideOutRight;case"top":return e.slideOutTop;case"bottom":return e.slideOutBottom;default:return e.slideOutRight}return e.fadeOut})();return{appearClass:f,backdropAppearClass:p,backdropDisappearClass:V,disappearClass:R}}const xt=({settings:l,content:L,styles:f,portalId:p,activeEvent:V,isEditor:R,isPreviewMode:r})=>{const[X,O]=g.useState(!1),{assetId:H}=l.thumbnailBlock.cover;return g.useEffect(()=>{V==="close"&&O(!1),V==="open"&&O(!0)},[V]),u.jsxs(u.Fragment,{children:[u.jsx("img",{src:H,alt:"Cover",className:e.heroImage,onClick:()=>O(!0)}),u.jsx(bt,{isOpen:X,onClose:()=>O(!1),content:L,settings:l,lightboxStyles:f,portalId:p,isEditor:R})]})},bt=({isOpen:l,onClose:L,content:f,lightboxStyles:p,settings:V,portalId:R,isEditor:r,metadata:X})=>{var ge;const{widthSettings:O,fontSettings:H,letterSpacing:ve,textAlign:xe,wordSpacing:be,fontSizeLineHeight:le,textAppearance:Q,color:we}=p.imageCaption??{},[z,Y]=g.useState(0),[ce,ee]=g.useState(0),[te,ne]=g.useState(!1),[Le,U]=g.useState(!1),[ue,de]=g.useState({}),I=g.useRef(null),re=g.useRef(null),A=g.useRef(null),W=g.useRef(!1),C=g.useRef(null),E=g.useRef(null),D=g.useRef(null),S=g.useRef(null),F=g.useRef(!1),he=g.useRef(null),[ye,oe]=g.useState(!1),{appear:q,triggers:T,slider:s,thumbnail:_,controls:v,area:B,caption:M,layout:P}=V.lightboxBlock,{appearClass:Ie,backdropAppearClass:Ce,backdropDisappearClass:Se,disappearClass:Be}=vt(q.type,q.direction),ie=(X==null?void 0:X.itemId)??null;g.useEffect(()=>{const t=()=>{setTimeout(()=>{var o,c;(c=(o=I.current)==null?void 0:o.splide)==null||c.refresh()},16)},n=()=>{ee(o=>o+1)};return window.addEventListener("ArticleEditor.Layout:change",t),window.addEventListener("ArticleEditor.ComponentContent:change",n),()=>{window.removeEventListener("ArticleEditor.Layout:change",t),window.removeEventListener("ArticleEditor.ComponentContent:change",n)}},[]),g.useEffect(()=>{if(!l||!_.isActive){oe(!1);return}const t=he.current;if(!t)return;const n=()=>{s.direction==="horiz"?oe(t.scrollWidth>t.clientWidth):oe(t.scrollHeight>t.clientHeight)};n();const o=new ResizeObserver(n);return o.observe(t),()=>o.disconnect()},[l,_.isActive,f.length,ue,s.direction]);const N=g.useCallback(()=>{const t=window.matchMedia("(max-width: 768px)").matches,n=pe.getColorAlpha(B.color);t&&!r&&n>.9&&(document.body.style.backgroundColor=""),ne(!0),W.current=!0;const o=c=>{c.target===C.current&&c.animationName&&(C.current&&E.current&&C.current.removeEventListener("animationend",E.current),E.current=null,W.current&&(W.current=!1,L()),ne(!1))};C.current&&(E.current=o,C.current.addEventListener("animationend",o))},[L,B.color,r]),Ve=(t,n,o)=>{var c,m;if(t){if(T.type==="click"&&T.switch==="image")T.repeat==="close"&&z===f.length-1?N():(c=I.current)==null||c.go("+1");else if(T.type==="click"&&T.switch==="50/50"){const d=t.getBoundingClientRect(),i=n-d.left,x=o-d.top,k=d.width,b=d.height;let y;s.direction==="horiz"?y=i<k/2?"-1":"+1":y=x<b/2?"-1":"+1",(m=I.current)==null||m.go(y)}}},me=t=>{if(F.current){F.current=!1;return}const n=f[z],o=(n==null?void 0:n.image.objectFit)==="cover";let c,m;if("changedTouches"in t&&t.changedTouches.length>0)c=t.changedTouches[0].clientX,m=t.changedTouches[0].clientY;else if("clientX"in t)c=t.clientX,m=t.clientY;else return;let d;if(o&&A.current){const i=Z.getPaddedContainerBounds(A.current);d=c>=i.left&&c<=i.right&&m>=i.top&&m<=i.bottom}else{const i=A.current?Z.getDisplayedImageRect(A.current):null;if(!i){t.target===t.currentTarget&&N();return}d=c>=i.x&&c<=i.x+i.width&&m>=i.y&&m<=i.y+i.height}d?Ve(A.current,c,m):N()},Re=t=>{const n=t.target;(n.classList.contains(e.thumbsWrapper)||n.classList.contains(e.thumbsContainer))&&me(t)};g.useEffect(()=>{if(!l)return;const t=n=>{var o,c;if(n.key==="Escape"){N();return}if(n.key==="ArrowRight"){Y(m=>(m+1)%Math.max(f.length,1)),(o=I.current)==null||o.go("+1");return}n.key==="ArrowLeft"&&(Y(m=>(m-1+Math.max(f.length,1))%Math.max(f.length,1)),(c=I.current)==null||c.go("-1"))};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[l,N,f.length]),g.useEffect(()=>{if(l){if(Y(0),ee(n=>n+1),W.current=!1,ne(!1),U(!1),de({}),!ie)return;const t=new CustomEvent("page-overlay",{detail:{itemId:ie}});window.dispatchEvent(t)}return()=>{C.current&&E.current&&(C.current.removeEventListener("animationend",E.current),E.current=null),U(!1)}},[l,ie]),g.useEffect(()=>{re.current!==null&&re.current!==s.type&&ee(t=>t+1),re.current=s.type},[s.type]),g.useEffect(()=>{if(!l)return;const t=document.body.style.overflow,n=window.matchMedia("(max-width: 768px)").matches,o=pe.getColorAlpha(B.color);document.body.style.overflow="hidden",U(!1);const c=d=>{d.target===C.current&&!W.current&&d.animationName&&(n&&!r&&o>.9&&(document.body.style.backgroundColor=B.color),U(!0),C.current&&D.current&&C.current.removeEventListener("animationend",D.current),D.current=null)};C.current&&(D.current=c,C.current.addEventListener("animationend",c));const m=d=>{const i=d.target;i&&(i.closest(`.${e.thumbsWrapper}`)||i.closest(`.${e.thumbsContainer}`))||s.type!=="slide"&&d.preventDefault()};return document.addEventListener("touchmove",m,{passive:!1}),()=>{document.body.style.overflow=t,document.removeEventListener("touchmove",m),C.current&&D.current&&(C.current.removeEventListener("animationend",D.current),D.current=null),U(!1)}},[l,r,B.color,s.type]),g.useEffect(()=>{if(!l)return;const t=n=>{var c,m;if(W.current){n.stopPropagation();return}if(F.current){F.current=!1;return}const o=n.target;if(!(o&&(o.closest(`.${e.thumbsContainer}`)||o.closest(`.${e.thumbItem}`)||o.closest(`.${e.arrow}`)||o.closest(`.${e.closeButton}`)||o.closest(`.${e.caption}`)))){if(s.type==="slide"&&T.type==="drag"&&((m=(c=I.current)==null?void 0:c.splide)!=null&&m.root)){const d=I.current.splide.root;if(o&&(d.contains(o)||d===o))return}if(n.touches.length===0&&n.changedTouches.length>0){const d=f[z],i=(d==null?void 0:d.image.objectFit)==="cover",x=n.changedTouches[0];let k;if(i&&A.current){const b=Z.getPaddedContainerBounds(A.current);k=x.clientX>=b.left&&x.clientX<=b.right&&x.clientY>=b.top&&x.clientY<=b.bottom}else{const b=A.current?Z.getDisplayedImageRect(A.current):null;if(!b)return;k=x.clientX>=b.x&&x.clientX<=b.x+b.width&&x.clientY>=b.y&&x.clientY<=b.y+b.height}if(!k){n.stopPropagation(),W.current=!0;const b=y=>{y.stopPropagation(),y.preventDefault(),document.removeEventListener("click",b,!0)};document.addEventListener("click",b,!0),N()}}}};return document.addEventListener("touchend",t,{passive:!0}),()=>{document.removeEventListener("touchend",t)}},[l,N,z,f]);const se=(s.type==="scale"||s.type==="fade")&&s.direction==="vert"&&T.type==="drag";g.useEffect(()=>{var y,G;if(!l||!se||!((G=(y=I.current)==null?void 0:y.splide)!=null&&G.root))return;const t=I.current.splide.root,n=30,o=(a,w)=>{if(S.current){const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);(j>0||K>0)&&(F.current=!0)}},c=a=>{S.current&&(a.preventDefault(),o(a.clientX,a.clientY))},m=a=>{S.current&&a.touches.length>0&&(a.preventDefault(),o(a.touches[0].clientX,a.touches[0].clientY))},d=(a,w)=>{if(!S.current||!I.current){S.current=null;return}const j=Math.abs(a-S.current.x),K=Math.abs(w-S.current.y);K>n&&K>j&&I.current.go(w<S.current.y?"+1":"-1"),S.current=null},i=a=>{S.current&&d(a.clientX,a.clientY),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("pointermove",c)},x=a=>{if(S.current){if(a.changedTouches.length>0){const w=a.changedTouches[0];d(w.clientX,w.clientY)}document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),document.removeEventListener("touchmove",m)}},k=a=>{S.current={x:a.clientX,y:a.clientY},F.current=!1,document.addEventListener("pointermove",c,{passive:!1}),document.addEventListener("pointerup",i),document.addEventListener("pointercancel",i)},b=a=>{a.touches.length>0&&(S.current={x:a.touches[0].clientX,y:a.touches[0].clientY},F.current=!1,document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",x),document.addEventListener("touchcancel",x))};return t.addEventListener("pointerdown",k),t.addEventListener("touchstart",b),()=>{t.removeEventListener("pointerdown",k),t.removeEventListener("touchstart",b),document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",i),document.removeEventListener("pointercancel",i),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x),S.current=null,F.current=!1}},[l,se,ce]);const ke={backgroundColor:B.color,backdropFilter:`blur(${B.blur}px)`,animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"};return typeof document>"u"||!document.getElementById(R)?null:Ae.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:r?null:C,className:$(e.background,te?Se:Ce,{[e.editor]:r},{[e.hidden]:!l}),style:{...ke,...Le&&!r&&!te?{position:"absolute"}:{}}}),u.jsxs("div",{ref:r?C:null,className:$(e.contentStyle,te?Be:Ie,{[e.editor]:r},{[e.hidden]:!l}),style:{animationDuration:`${parseInt(q.duration)}ms`,animationTimingFunction:"ease",animationFillMode:"both"},children:[u.jsx(fe.Splide2,{onMove:t=>Y(t.index),ref:I,className:e.lightboxSplide,options:{arrows:!1,speed:s.duration?parseInt(s.duration):500,direction:s.direction==="horiz"||s.type==="fade"||s.type==="scale"?"ltr":"ttb",pagination:!1,drag:T.type==="drag"&&!se,perPage:1,width:"100%",height:"100%",type:s.type==="fade"||s.type==="scale"?"fade":"loop",padding:0,rewind:T.repeat!=="close",start:0},style:{"--splide-speed":s.duration},children:f.map((t,n)=>{const o=J(P.position,P.offset,r),c=`${h.scalingValue(P.padding.top,r)} ${h.scalingValue(P.padding.right,r)} ${h.scalingValue(P.padding.bottom,r)} ${h.scalingValue(P.padding.left,r)}`,m=s.type==="scale"?(()=>{const{transform:d,...i}=o;return{...i,position:"absolute",padding:c,boxSizing:"border-box","--position-transform":d||"none"}})():{...o,position:"absolute",padding:c,boxSizing:"border-box"};return u.jsx(fe.SplideSlide,{children:u.jsx("div",{className:e.imgWrapper,onClick:me,children:u.jsx("img",{ref:n===z?A:null,className:$(e.imageStyle,{[e.contain]:t.image.objectFit==="contain",[e.cover]:t.image.objectFit==="cover",[e.scaleSlide]:s.type==="scale"}),src:t.image.assetId,alt:t.image.name??"",style:{...m,pointerEvents:t.image.objectFit==="contain"?"none":"auto"}})})},n)})},ce),v.isActive&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:$(e.arrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x,r)}, ${h.scalingValue(v.offset.y*(s.direction==="horiz"?1:-1),r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("-1")},"aria-label":"Previous",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:$(e.arrowImg,e.mirror)}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg,e.mirror)})]})}),u.jsx("div",{className:$(e.arrow,e.nextArrow,{[e.arrowVertical]:s.direction==="vert"}),style:{color:v.color,"--arrow-hover-color":v.hover},children:u.jsxs("button",{className:e.arrowInner,style:{transform:`translate(${h.scalingValue(v.offset.x*(s.direction==="horiz"?-1:1),r)}, ${h.scalingValue(v.offset.y,r)}) scale(${v.scale}) rotate(${s.direction==="horiz"?"0deg":"90deg"})`},onClick:()=>{var t;return(t=I.current)==null?void 0:t.go("+1")},"aria-label":"Next",children:[v.arrowsImgUrl&&u.jsx(ae.SvgImage,{url:v.arrowsImgUrl,fill:v.color,hoverFill:v.hover,className:e.arrowImg}),!v.arrowsImgUrl&&u.jsx(_e,{color:v.color,className:$(e.arrowIcon,e.arrowImg)})]})})]}),B.closeIconUrl&&(()=>{const t=J(B.closeIconAlign,B.closeIconOffset,r),n=`scale(${B.closeIconScale})`,o=t.transform?`${t.transform} ${n}`:n;return u.jsx("button",{className:e.closeButton,style:{...t,transform:o},onClick:N,"aria-label":"Close lightbox",children:u.jsx(ae.SvgImage,{url:B.closeIconUrl,fill:B.closeIconColor??"#000000",hoverFill:B.closeIconHover??"#cccccc"})})})(),M&&M.isActive&&p.imageCaption&&((ge=f[z])==null?void 0:ge.imageCaption)&&u.jsx("div",{className:e.caption,style:{...J(M.alignment,M.offset,r),fontFamily:je.normalizeFontFamilyCssValue(H.fontFamily),fontWeight:H.fontWeight,fontStyle:H.fontStyle,width:O.sizing==="auto"?"max-content":h.scalingValue(O.width,r),letterSpacing:h.scalingValue(ve,r),wordSpacing:h.scalingValue(be,r),textAlign:xe,fontSize:h.scalingValue(le.fontSize,r),lineHeight:h.scalingValue(le.lineHeight,r),textTransform:Q.textTransform??"none",textDecoration:Q.textDecoration??"none",fontVariant:Q.fontVariant??"normal",color:we},onClick:t=>t.stopPropagation(),children:u.jsx("div",{"data-styles":"imageCaption",className:e.captionTextInner,style:{"--link-color":M.linkColor,"--link-hover-color":M.linkHoverColor},children:u.jsx(Te.RichTextRenderer,{content:f[z].imageCaption})})}),_.isActive&&(()=>{const[t,n]=_.position.split("-"),o=s.direction==="horiz"?`${t}-left`:_.position,c=J(o,_.offset,r),m=()=>{if(s.direction==="horiz"){if(n==="left")return"flex-start";if(n==="center")return"center";if(n==="right")return"flex-end"}else{if(t==="top")return"flex-start";if(t==="middle")return"center";if(t==="bottom")return"flex-end"}return"flex-start"};return u.jsx("div",{ref:he,className:e.thumbsWrapper,onClick:d=>Re(d),style:{position:r?"absolute":"fixed",...c,...s.direction==="horiz"?{maxWidth:"100vw",width:"100%",overflowX:"auto",overflowY:"hidden"}:{maxHeight:"100vh",overflowY:"auto",overflowX:"hidden"}},children:u.jsx("div",{className:$(e.thumbsContainer,{[e.thumbsContainerVertical]:s.direction==="vert",[e.thumbsAlignStart]:_.align==="start",[e.thumbsAlignCenter]:_.align==="center",[e.thumbsAlignEnd]:_.align==="end"}),style:{gap:h.scalingValue(_.grid.gap,r),justifyContent:ye?"flex-start":m()},children:f.map((d,i)=>{const x=i===z,k=ue[i],y=_.grid.size*(x?_.activeState.scale:1),G=()=>{if(_.fit!=="fit")return{};if(!k)return s.direction==="horiz"?{height:h.scalingValue(y,r)}:{width:h.scalingValue(y,r)};const a=k.width/k.height;if(s.direction==="horiz"){const w=y,j=w*a;return{width:h.scalingValue(j,r),height:h.scalingValue(w,r)}}else{const w=y,j=w/a;return{width:h.scalingValue(w,r),height:h.scalingValue(j,r)}}};return u.jsx("button",{className:e.thumbItem,style:{...s.direction==="horiz"&&_.fit!=="fit"?{height:h.scalingValue(y,r)}:{},...s.direction==="vert"&&_.fit!=="fit"?{width:h.scalingValue(y,r)}:{},..._.fit==="cover"?{width:h.scalingValue(y,r),height:h.scalingValue(y,r)}:{},...G(),transition:x?"all 0.25s ease-out":"none",opacity:x?_.activeState.opacity/100:_.opacity/100,"--thumb-hover":_.activeState.opacity/100},onClick:a=>{var w;a.stopPropagation(),Y(i),(w=I.current)==null||w.go(i)},onMouseEnter:()=>{var a;_.triggers==="hov"&&((a=I.current)==null||a.go(i))},children:u.jsx("img",{src:d.image.assetId,alt:d.image.name??"",onLoad:a=>{const w=a.currentTarget;w.naturalWidth&&w.naturalHeight&&de(j=>({...j,[i]:{width:w.naturalWidth,height:w.naturalHeight}}))},style:{objectFit:_.fit==="cover"?"cover":"contain",..._.fit==="fit"?{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}:{},..._.fit==="cover"?{width:"100%",height:"100%"}:{}}})},`${d.image.name}-${i}`)})})})})()]})]}),document.getElementById(R))};function _e({color:l,className:L}){return u.jsx("svg",{viewBox:"0 0 10 18",className:L,children:u.jsx("g",{id:"Symbols",stroke:"none",strokeWidth:"1",fillRule:"evenodd",children:u.jsx("path",{d:"M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z",id:"Shape-Copy",fill:l,transform:"translate(5, 9) rotate(-90) translate(-5, -9)"})})})}exports.LightboxGallery=xt;
@@ -2,7 +2,7 @@ import { jsxs as U, Fragment as ue, jsx as g } from "react/jsx-runtime";
2
2
  import { useState as P, useEffect as F, useRef as R, useCallback as Fe } from "react";
3
3
  import { createPortal as Oe } from "react-dom";
4
4
  import { s as d } from "./scalingValue-C9JH5L6O.mjs";
5
- import { S as se } from "./SvgImage-B5mR9y6q.mjs";
5
+ import { S as se } from "./SvgImage-CwRq9-ec.mjs";
6
6
  import N from "classnames";
7
7
  import { S as We, a as Ve } from "./react-splide.esm-DQqds4PL.mjs";
8
8
  import { R as De } from "./RichTextRenderer-D52Xto59.mjs";