@cntrl-site/components 1.0.115-alpha.1 → 1.0.115

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 (65) hide show
  1. package/dist/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
  2. package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
  3. package/dist/{ChroniclesComponent-DRf1Xd9_.mjs → ChroniclesComponent-D-yEbs9w.mjs} +26 -12
  4. package/dist/ChroniclesComponent-Os_r2IYg.js +1 -0
  5. package/dist/Components/Chronicles/ChroniclesComponent.d.ts +4 -0
  6. package/dist/Components/Grid/Grid.d.ts +1 -0
  7. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
  8. package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
  9. package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
  10. package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
  11. package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
  12. package/dist/Grid-OvzWvUW9.js +403 -0
  13. package/dist/{Grid-Dn44dvgx.mjs → Grid-t07NDMzY.mjs} +555 -528
  14. package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
  15. package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
  16. package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
  17. package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
  18. package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
  19. package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
  20. package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-D59ex6wH.mjs} +1 -1
  21. package/dist/{LightboxJournal-BFF5aKRz.js → LightboxJournal-DAEZOPDi.js} +1 -1
  22. package/dist/{LightboxStrip-CC2e0_9A.js → LightboxStrip-BDjI1jyH.js} +1 -1
  23. package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-YspzBP8N.mjs} +1 -1
  24. package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
  25. package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
  26. package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
  27. package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
  28. package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
  29. package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
  30. package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
  31. package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
  32. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  33. package/dist/SvgImage-DFlmxAoL.js +1 -0
  34. package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
  35. package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
  36. package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
  37. package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
  38. package/dist/components-D4ZrIo2M.js +1 -0
  39. package/dist/{components-DH803b-9.mjs → components-Ds6rhj3U.mjs} +29 -655
  40. package/dist/elements.js +1 -1
  41. package/dist/elements.mjs +22 -23
  42. package/dist/elements.node.js +1 -1
  43. package/dist/elements.node.mjs +1 -1
  44. package/dist/index.d.ts +1 -3
  45. package/dist/index.js +1 -1
  46. package/dist/index.mjs +27 -48
  47. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  48. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  49. package/dist/sources.js +42 -5
  50. package/dist/sources.mjs +45 -8
  51. package/dist/types/Component.d.ts +0 -7
  52. package/dist/types/SchemaV1.d.ts +0 -3
  53. package/package.json +1 -1
  54. package/dist/ChroniclesComponent-BHZu7BbK.js +0 -1
  55. package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -72
  56. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -598
  57. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -176
  58. package/dist/Grid-BXUT_Hn6.js +0 -378
  59. package/dist/PopupMenu-Ct6PbiJq.js +0 -369
  60. package/dist/PopupMenu-DGVvx5AW.mjs +0 -1067
  61. package/dist/SvgImage-CwRq9-ec.mjs +0 -56
  62. package/dist/SvgImage-_QN8ngad.js +0 -1
  63. package/dist/components-DCG0h7Jb.js +0 -1
  64. package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
  65. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
@@ -1,176 +0,0 @@
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,378 +0,0 @@
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
- .${e}-wrapper {
3
- display: grid;
4
- align-items: start;
5
- justify-content: center;
6
- min-height: ${ei(48)};
7
- }
8
- .${e}-item {
9
- display: flex;
10
- flex-direction: column;
11
- justify-content: center;
12
- align-items: center;
13
- }
14
- .${e}-item-inner {
15
- display: flex;
16
- flex-direction: column;
17
- align-items: center;
18
- outline: 1px solid #FF5C02;
19
- }
20
- .${e}-item-inner-hidden {
21
- display: flex;
22
- flex-direction: column;
23
- align-items: center;
24
- }
25
- .${e}-item-image-wrapper {
26
- display: flex;
27
- justify-content: center;
28
- align-items: center;
29
- align-self: center;
30
- }
31
- .${e}-item-image-wrapper-fit-slider {
32
- display: grid;
33
- overflow: hidden;
34
- position: relative;
35
- }
36
- .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer {
37
- grid-area: 1 / 1;
38
- width: 100%;
39
- display: grid;
40
- visibility: hidden;
41
- pointer-events: none;
42
- }
43
- .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer img {
44
- grid-area: 1 / 1;
45
- width: auto;
46
- height: auto;
47
- max-width: 100%;
48
- object-fit: contain;
49
- }
50
- .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer video {
51
- grid-area: 1 / 1;
52
- width: auto;
53
- height: auto;
54
- max-width: 100%;
55
- object-fit: contain;
56
- }
57
- .${e}-item-image-wrapper-fit-slider > .${e}-item-image-wrapper-sizer div {
58
- grid-area: 1 / 1;
59
- width: 100%;
60
- }
61
- .${e}-item-image-wrapper-fit-slider > .${e}-item-slider {
62
- position: absolute;
63
- inset: 0;
64
- width: 100%;
65
- overflow: hidden;
66
- }
67
- .${e}-item-slider .splide__track {
68
- overflow: hidden;
69
- }
70
- .${e}-item-image-link {
71
- width: 100%;
72
- display: flex;
73
- flex-direction: column;
74
- align-items: center;
75
- }
76
- .${e}-item-text-link {
77
- display: flex;
78
- flex-direction: column;
79
- align-items: center;
80
- width: 100%;
81
- color: inherit;
82
- text-decoration: none;
83
- }
84
- .${e}-item-image {
85
- width: 100%;
86
- height: 100%;
87
- display: block;
88
- max-width: 100%;
89
- }
90
- .${e}-item-video {
91
- width: 100%;
92
- height: 100%;
93
- display: block;
94
- max-width: 100%;
95
- }
96
- .${e}-item-slider,
97
- .${e}-item-slider .splide__track,
98
- .${e}-item-slider .splide__list,
99
- .${e}-item-slider .splide__slide {
100
- width: 100%;
101
- height: 100%;
102
- }
103
- .${e}-item-slider .splide__slide {
104
- display: flex;
105
- justify-content: center;
106
- align-items: center;
107
- }
108
- .${e}-item-title {
109
- white-space: normal;
110
- overflow-wrap: anywhere;
111
- word-break: break-word;
112
- text-align: center;
113
- margin-bottom: 0px;
114
- margin-top: 0px;
115
- color: var(--${e}-title-color);
116
- }
117
- .${e}-item-subtitle {
118
- white-space: normal;
119
- overflow-wrap: anywhere;
120
- word-break: break-word;
121
- text-align: center;
122
- margin-bottom: 0px;
123
- margin-top: 0px;
124
- color: var(--${e}-subtitle-color);
125
- }
126
- .${e}-text-tight-leading {
127
- display: block;
128
- flex-shrink: 0;
129
- padding-top: var(--${e}-title-leading-gap, 0);
130
- padding-bottom: var(--${e}-title-leading-gap, 0);
131
- }
132
- .${e}-show-text-hover .${e}-item-title,
133
- .${e}-show-text-hover .${e}-item-subtitle {
134
- opacity: 0;
135
- transition: opacity 250ms;
136
- }
137
- .${e}-show-text-hover .${e}-item-inner:hover .${e}-item-title,
138
- .${e}-show-text-hover .${e}-item-inner:hover .${e}-item-subtitle,
139
- .${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-title,
140
- .${e}-show-text-hover .${e}-item-inner-hidden:hover .${e}-item-subtitle {
141
- opacity: 1;
142
- }
143
- .${e}-type-a .${e}-item-inner,
144
- .${e}-type-a .${e}-item-inner-hidden,
145
- .${e}-type-d .${e}-item-inner,
146
- .${e}-type-d .${e}-item-inner-hidden {
147
- align-items: flex-start;
148
- }
149
- .${e}-type-b .${e}-item-inner,
150
- .${e}-type-b .${e}-item-inner-hidden,
151
- .${e}-type-e .${e}-item-inner,
152
- .${e}-type-e .${e}-item-inner-hidden {
153
- align-items: center;
154
- }
155
- .${e}-type-c .${e}-item-inner,
156
- .${e}-type-c .${e}-item-inner-hidden,
157
- .${e}-type-f .${e}-item-inner,
158
- .${e}-type-f .${e}-item-inner-hidden {
159
- align-items: flex-end;
160
- }
161
- .${e}-type-a .${e}-item-image-link,
162
- .${e}-type-b .${e}-item-image-link,
163
- .${e}-type-c .${e}-item-image-link,
164
- .${e}-type-d .${e}-item-image-link,
165
- .${e}-type-e .${e}-item-image-link,
166
- .${e}-type-f .${e}-item-image-link {
167
- align-items: center;
168
- }
169
- .${e}-type-a .${e}-item-title,
170
- .${e}-type-a .${e}-item-subtitle,
171
- .${e}-type-d .${e}-item-title,
172
- .${e}-type-d .${e}-item-subtitle {
173
- text-align: left;
174
- }
175
- .${e}-type-b .${e}-item-title,
176
- .${e}-type-b .${e}-item-subtitle,
177
- .${e}-type-e .${e}-item-title,
178
- .${e}-type-e .${e}-item-subtitle {
179
- text-align: center;
180
- }
181
- .${e}-type-c .${e}-item-title,
182
- .${e}-type-c .${e}-item-subtitle,
183
- .${e}-type-f .${e}-item-title,
184
- .${e}-type-f .${e}-item-subtitle {
185
- text-align: right;
186
- }
187
- .${e}-item-text-block {
188
- display: flex;
189
- flex-direction: column;
190
- align-items: flex-start;
191
- width: 100%;
192
- flex-shrink: 0;
193
- }
194
- .${e}-type-d .${e}-item-text-block {
195
- align-items: flex-start;
196
- }
197
- .${e}-type-e .${e}-item-text-block {
198
- align-items: center;
199
- }
200
- .${e}-type-f .${e}-item-text-block {
201
- align-items: flex-end;
202
- }
203
- .${e}-type-a .${e}-item-text-link,
204
- .${e}-type-d .${e}-item-text-link {
205
- align-items: flex-start;
206
- }
207
- .${e}-type-b .${e}-item-text-link,
208
- .${e}-type-e .${e}-item-text-link {
209
- align-items: center;
210
- }
211
- .${e}-type-c .${e}-item-text-link,
212
- .${e}-type-f .${e}-item-text-link {
213
- align-items: flex-end;
214
- }
215
- .${e}-image-align-top .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
216
- align-items: flex-start;
217
- }
218
- .${e}-image-align-center .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
219
- align-items: center;
220
- }
221
- .${e}-image-align-bottom .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
222
- align-items: flex-end;
223
- }
224
- .${e}-image-align-top .${e}-item-slider .splide__slide {
225
- align-items: flex-start;
226
- }
227
- .${e}-image-align-center .${e}-item-slider .splide__slide {
228
- align-items: center;
229
- }
230
- .${e}-image-align-bottom .${e}-item-slider .splide__slide {
231
- align-items: flex-end;
232
- }
233
- .${e}-align-entries .${e}-item {
234
- display: contents;
235
- }
236
- .${e}-align-entries .${e}-item-inner,
237
- .${e}-align-entries .${e}-item-inner-hidden {
238
- display: grid;
239
- grid-template-rows: subgrid;
240
- grid-row: span 3;
241
- justify-self: center;
242
- margin-bottom: var(--${e}-align-entries-row-gap, 0);
243
- }
244
- .${e}-align-entries .${e}-item-inner-last-row {
245
- margin-bottom: 0;
246
- }
247
- .${e}-align-entries .${e}-item-text-link {
248
- display: contents;
249
- }
250
- .${e}-align-entries .${e}-item-title-row,
251
- .${e}-align-entries .${e}-item-subtitle-row {
252
- display: flex;
253
- flex-direction: column;
254
- align-items: flex-start;
255
- width: 100%;
256
- min-height: 100%;
257
- }
258
- .${e}-type-a.${e}-align-entries .${e}-item-title-row,
259
- .${e}-type-a.${e}-align-entries .${e}-item-subtitle-row,
260
- .${e}-type-d.${e}-align-entries .${e}-item-title-row,
261
- .${e}-type-d.${e}-align-entries .${e}-item-subtitle-row {
262
- align-items: flex-start;
263
- }
264
- .${e}-type-b.${e}-align-entries .${e}-item-title-row,
265
- .${e}-type-b.${e}-align-entries .${e}-item-subtitle-row,
266
- .${e}-type-e.${e}-align-entries .${e}-item-title-row,
267
- .${e}-type-e.${e}-align-entries .${e}-item-subtitle-row {
268
- align-items: center;
269
- }
270
- .${e}-type-c.${e}-align-entries .${e}-item-title-row,
271
- .${e}-type-c.${e}-align-entries .${e}-item-subtitle-row,
272
- .${e}-type-f.${e}-align-entries .${e}-item-title-row,
273
- .${e}-type-f.${e}-align-entries .${e}-item-subtitle-row {
274
- align-items: flex-end;
275
- }
276
- .${e}-align-entries .${e}-item-image-link {
277
- width: 100%;
278
- height: 100%;
279
- min-height: 100%;
280
- display: flex;
281
- flex-direction: column;
282
- align-items: center;
283
- justify-content: flex-start;
284
- }
285
- .${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
286
- flex-shrink: 0;
287
- height: auto;
288
- align-self: auto;
289
- }
290
- .${e}-image-align-top.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
291
- margin-top: 0;
292
- margin-bottom: auto;
293
- }
294
- .${e}-image-align-center.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
295
- margin-top: auto;
296
- margin-bottom: auto;
297
- }
298
- .${e}-image-align-bottom.${e}-align-entries .${e}-item-image-link > .${e}-item-image-wrapper {
299
- margin-top: auto;
300
- margin-bottom: 0;
301
- }
302
- .${e}-image-align-top.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
303
- align-items: flex-start;
304
- }
305
- .${e}-image-align-center.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
306
- align-items: center;
307
- }
308
- .${e}-image-align-bottom.${e}-align-entries .${e}-item-image-wrapper:not(.${e}-item-image-wrapper-fit-slider) {
309
- align-items: flex-end;
310
- }
311
- .${e}-image-align-top.${e}-align-entries .${e}-item-slider .splide__slide {
312
- align-items: flex-start;
313
- }
314
- .${e}-image-align-center.${e}-align-entries .${e}-item-slider .splide__slide {
315
- align-items: center;
316
- }
317
- .${e}-image-align-bottom.${e}-align-entries .${e}-item-slider .splide__slide {
318
- align-items: flex-end;
319
- }
320
- .${e}-image-align-top.${e}-align-entries .${e}-item-image-link {
321
- justify-content: flex-start;
322
- }
323
- .${e}-image-align-center.${e}-align-entries .${e}-item-image-link {
324
- justify-content: center;
325
- }
326
- .${e}-image-align-bottom.${e}-align-entries .${e}-item-image-link {
327
- justify-content: flex-end;
328
- }
329
- .${e}-lightbox-counter {
330
- margin: 0;
331
- color: var(--${e}-lightbox-counter-color);
332
- }
333
- .${e}-lightbox {
334
- position: fixed;
335
- inset: 0;
336
- z-index: 9997;
337
- overscroll-behavior: none;
338
- overflow: hidden;
339
- }
340
- .${e}-lightbox-editor {
341
- inset: auto;
342
- top: var(--cntrl-article-top, 0);
343
- left: var(--cntrl-article-left, 0);
344
- width: var(--cntrl-article-width, 100vw) !important;
345
- height: var(--cntrl-viewport-height, 100vh) !important;
346
- }
347
- .${e}-control {
348
- position: relative;
349
- z-index: 2;
350
- width: 100%;
351
- }
352
- .${e}-close-icon {
353
- position: relative;
354
- flex-shrink: 0;
355
- pointer-events: auto;
356
- z-index: 2;
357
- display: flex;
358
- align-items: center;
359
- justify-content: center;
360
- border: none;
361
- background-color: transparent;
362
- padding: 0;
363
- }
364
- .${e}-close-icon-inner {
365
- all: unset;
366
- position: relative;
367
- cursor: pointer;
368
- width: 100%;
369
- height: 100%;
370
- pointer-events: auto;
371
- }
372
- .${e}-close-icon-img {
373
- position: absolute;
374
- top: 50%;
375
- left: 50%;
376
- transform: translate(-50%, -50%);
377
- }
378
- `}function ii(){return Math.random()<.5?"ltr":"ttb"}function ni(e){const i=e.Components.Autoplay;i&&(i.pause(!1),i.play())}function ri(e){const i=ii();e.options.direction!==i&&(e.options={...e.options,direction:i}),requestAnimationFrame(()=>{requestAnimationFrame(()=>{ni(e)})})}const H=500,si=750,le="cubic-bezier(0.22, 1, 0.36, 1)",li=72,oi=50;function ai(e){if(!Array.isArray(e)||e.length===0)return!1;const i=e[0];return i!==null&&typeof i=="object"&&"media"in i&&Array.isArray(i.media)}function ci(e){const[i,n]=e.media;return n!=null&&n.assetId?n:i!=null&&i.assetId?i:null}function di(e){const[i]=e.media;return i!=null&&i.assetId?i:null}function Wt(e){return!Array.isArray(e)||e.length===0?[]:ai(e)?e.flatMap(i=>{const n=ci(i);if(!n)return[];const a=di(i);return[{displayMedia:n,lightboxMedia:a!=null&&a.assetId?a:null}]}):e.filter(i=>i==null?void 0:i.assetId).map(i=>({displayMedia:i,lightboxMedia:i}))}function ye(e){return!q.isEmbedMedia(e)&&e.type==="video"}function ui(e){const i=new Set,n=[];for(const a of e){const l=Wt(a.gallery);for(const b of l){const y=b.lightboxMedia;y!=null&&y.assetId&&!i.has(y.assetId)&&(i.add(y.assetId),n.push(y))}}return n}function gi({mediaList:e}){const[i,n]=r.useState(null);Mt.useLazyVideos(i,{preload:"metadata"});const a=e.filter(l=>!q.isEmbedMedia(l));return a.length===0?null:t.jsx("div",{ref:n,"aria-hidden":!0,style:{position:"absolute",width:0,height:0,overflow:"hidden",opacity:0,pointerEvents:"none"},children:a.map(l=>ye(l)?t.jsx("video",{src:l.assetId,preload:"none",muted:!0,playsInline:!0},l.assetId):t.jsx("img",{src:l.assetId,alt:""},l.assetId))})}function mi(e){e.pause(),e.removeAttribute("src"),e.load()}const hi=".splide__slide video";function pi(e){var l;if(e.closest(".splide--fade, .splide__slide.is-active:not(.splide__slide--clone), .splide__slide.is-next"))return!0;const i=e.closest(".splide__slide");if(!i||i.classList.contains("splide__slide--clone"))return!1;const n=i.dataset.slideIndex,a=(l=i.parentElement)==null?void 0:l.querySelector(".splide__slide.is-next");return n!==void 0&&(a==null?void 0:a.dataset.slideIndex)===n}function Rt({media:e,className:i,style:n,hasLightbox:a,isSplideSlide:l=!1,onMediaClick:b}){if(q.isEmbedMedia(e))return t.jsx(q.EmbedMediaFrame,{media:e,fit:n.objectFit==="contain"?"contain":"cover",silentLoop:a,className:i,style:{...n,cursor:b?"pointer":"default"},onClick:b});if(ye(e)){const y={src:e.assetId,className:i,style:{...n,cursor:b?"pointer":"default"},muted:!0,loop:!0,playsInline:!0,onClick:b};return l?t.jsx("video",{...y,preload:"none"}):t.jsx(At.LazyVideo,{...y,autoPlay:!0})}return t.jsx("img",{src:e.assetId,alt:e.name,className:i,style:{...n,cursor:b?"pointer":"default"},onClick:b})}function fi({className:e,style:i,children:n}){const[a,l]=r.useState(null);return Mt.useLazyVideos(a,{autoPlay:!0,selector:hi,shouldPlay:pi}),t.jsx("div",{ref:l,className:e,style:i,children:n})}function Vt(e){const i=e.getBoundingClientRect();return{width:i.width,height:i.height,left:i.left,top:i.top}}function $i(e,i){if(!i||!i.width||!i.height||!e.width||!e.height)return e;const n=i.width/i.height,a=e.width/e.height;if(n>a){const b=e.width/n;return{width:e.width,height:b,left:e.left,top:e.top+(e.height-b)/2}}const l=e.height*n;return{width:l,height:e.height,left:e.left+(e.width-l)/2,top:e.top}}function xi({src:e,mediaRef:i,mediaStyle:n,onLoadedMetadata:a}){return r.useEffect(()=>{const l=i.current;if(l)return()=>{mi(l)}},[e,i]),t.jsx("video",{ref:i,src:e,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",onLoadedMetadata:a,style:n})}const yi="https://cdn.cntrl.site/component-assets/defaultCloseIcon.svg",wi=.004;function bi({prefix:e,closeIcon:i=yi,closeIconMaxWidth:n=.0125,closeIconColor:a="#FFFFFF",closeIconHoverColor:l="#999999",iconMarginRight:b=.01,contentMarginTop:y=.01,isEditor:B,isPreviewMode:oe,isEditMode:s,visible:R,onClose:K}){if(!i)return null;const J=p.scalingValue(n,B),ae=p.scalingValue(b,B),we=p.scalingValue(y,B),C=p.scalingValue(Math.max(y,wi),B);return t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,zIndex:1e4,display:"flex",flexDirection:"column",alignItems:"flex-end",pointerEvents:"none",opacity:R?1:0,transition:"opacity 500ms cubic-bezier(0.22, 1, 0.36, 1)"},children:[t.jsx("div",{style:{position:"relative",width:"100%",height:we,flexShrink:0},children:s&&t.jsx("div",{"data-controls":"contentMarginTop","data-controls-axis":"y","data-controls-min":"0",className:`${e}-control`,style:{position:"absolute",top:0,left:0,width:"100%",height:C,pointerEvents:R?"auto":"none"}})}),t.jsxs("div",{className:`${e}-close-icon`,style:{width:J,height:J,marginRight:ae,pointerEvents:R?"auto":"none"},onClick:I=>I.stopPropagation(),children:[t.jsx("button",{type:"button",className:`${e}-close-icon-inner`,"aria-label":"Close",onClick:I=>{I.stopPropagation(),K()},children:t.jsx(Pt.SvgImage,{url:i,fill:a,hoverFill:B&&!oe?a:l,className:`${e}-close-icon-img`})}),s&&t.jsx("div",{"data-controls":"iconMarginRight","data-controls-axis":"x","data-controls-reverse":"",className:`${e}-control`,style:{position:"absolute",top:0,left:"100%",width:ae,height:"100%",pointerEvents:R?"auto":"none"}})]})]})}function vi({prefix:e,items:i,index:n,imageDisplay:a,isEditor:l,isPreviewMode:b,isEditMode:y,onClose:B,onPrev:oe,onNext:s,counterClassName:R,counterStyle:K,closeIcon:J,closeIconMaxWidth:ae,closeIconColor:we,closeIconHoverColor:C,iconMarginRight:I,contentMarginTop:He}){const be=a==="cover",Ne=r.useRef(null),ce=r.useRef(null),de=r.useRef(null),_=r.useRef(null),G=r.useRef(0),N=r.useRef(0),F=r.useRef("none"),X=r.useRef(!1),Q=r.useRef(!1),qe=r.useRef(null),L=r.useRef(0),W=r.useRef(null),z=r.useRef(!1),te=r.useRef(null),Y=r.useRef(null),Fe=r.useRef(null),Be=r.useRef(()=>{}),[m,ze]=r.useState(null),[c,at]=r.useState(null),[S,ve]=r.useState("opening"),[Z,O]=r.useState(0),[ue,D]=r.useState(0),[Re,ie]=r.useState(null),[Ve,ge]=r.useState(!1),[Se,me]=r.useState(!1),[ct,Ge]=r.useState(!1),[dt,Xe]=r.useState(null),Ye=r.useRef(n),Ue=r.useRef(void 0),d=i[n],vt=d?ye(d):!1,he=d?q.isEmbedMedia(d):!1,Ke=Re!==null,ut=r.useCallback(o=>{const g=o.currentTarget,k=g instanceof HTMLVideoElement?{width:g.videoWidth,height:g.videoHeight}:{width:g.naturalWidth,height:g.naturalHeight};!k.width||!k.height||Xe(k)},[]);r.useEffect(()=>{qe.current=c},[c]),r.useEffect(()=>{const o=Ne.current;if(!o)return;const g=()=>at(Vt(o));g();const k=new ResizeObserver(g);return k.observe(o),()=>k.disconnect()},[]);const w=r.useCallback(()=>{te.current!==null&&(window.clearTimeout(te.current),te.current=null)},[]),ne=r.useCallback(()=>{const o=Y.current;Y.current=null,w(),W.current=null,z.current=!1,ie(null),ge(!1),D(0),L.current=0,me(!1),X.current=!1,N.current=0,F.current="none",o===1?s():o===-1&&oe()},[w,s,oe]),Me=r.useCallback(()=>{w(),Y.current=null,W.current=null,z.current=!1,ie(null),ge(!1),D(0),L.current=0},[w]),Je=r.useCallback(()=>{w(),te.current=window.setTimeout(()=>{Y.current!==null&&ne()},H+32)},[w,ne]),P=r.useCallback((o,g)=>{var se;const k=((se=qe.current)==null?void 0:se.width)??0;if(w(),W.current=o,ie(o),z.current=!0,ge(!0),g){Y.current=o;const xe=-o*k;L.current=xe,D(xe),Je();return}L.current=0,D(0),te.current=window.setTimeout(()=>{te.current=null,Me()},H+32)},[w,Me,Je]),pe=r.useCallback(o=>{if(!(i.length<=1)){if(z.current){if(Y.current===o){Fe.current=o,ne();return}Me()}w(),W.current=o,ie(o),z.current=!1,ge(!1),L.current=0,D(0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{P(o,!0)})})}},[i.length,P,ne,Me,w]);Be.current=pe;const je=r.useCallback(o=>{o.propertyName!=="transform"||!z.current||Y.current!==null&&ne()},[ne]),fe=r.useCallback(()=>{const o=ce.current;if(!o)return;const g=Vt(o);!g.width||!g.height||ze(g)},[]);r.useEffect(()=>{fe();const o=ce.current;if(!o)return;const g=new ResizeObserver(()=>fe());return g.observe(o),()=>g.disconnect()},[fe]),r.useEffect(()=>{S==="opening"&&m&&ve("open")},[S,m]),r.useEffect(()=>{if(S!=="closing")return;const o=setTimeout(()=>B(),H);return()=>clearTimeout(o)},[S,B]),r.useEffect(()=>()=>{w()},[w]),r.useLayoutEffect(()=>{Ye.current===n&&Ue.current===(d==null?void 0:d.assetId)||(w(),Y.current=null,ie(null),O(0),D(0),ge(!1),Ge(!1),me(!1),Xe(null),G.current=0,N.current=0,F.current="none",X.current=!1,z.current=!1,L.current=0,W.current=null,_.current=null,Q.current=!1,Ye.current=n,Ue.current=d==null?void 0:d.assetId)},[n,d==null?void 0:d.assetId,w]),r.useLayoutEffect(()=>{const o=Fe.current;o!==null&&(Fe.current=null,requestAnimationFrame(()=>{Be.current(o)}))},[n,d==null?void 0:d.assetId]),r.useEffect(()=>{if(S!=="open")return;let o=null;const g=()=>{o&&(document.removeEventListener("click",o,!0),o=null)},k=()=>{g(),o=x=>{x.stopPropagation(),x.preventDefault(),g()},document.addEventListener("click",o,!0)},se=x=>{const f=x<0?1:-1;if(Math.abs(x)>oi&&i.length>1){P(f,!0);return}P(f,!1)},xe=x=>{if(x.touches.length!==1||z.current)return;const f=x.touches[0];Q.current=!0,_.current={x:f.clientX,y:f.clientY},F.current="none",N.current=0,X.current=!1},ee=x=>{if(!_.current||x.touches.length!==1||z.current)return;const f=x.touches[0],v=f.clientX-_.current.x,T=f.clientY-_.current.y;if(F.current==="none"){if(Math.abs(v)<10&&Math.abs(T)<10)return;if(Math.abs(v)>Math.abs(T)){if(i.length<=1)return;F.current="horizontal"}else if(T>0)F.current="vertical";else return}if(F.current==="horizontal"){X.current=!0,me(!0),N.current=v;const M=v<0?1:-1;W.current!==M&&(W.current=M,ie(M)),L.current=v,D(v),x.preventDefault();return}F.current==="vertical"&&(X.current=!0,me(!0),G.current=T,O(T),x.preventDefault())},Te=()=>{if(!_.current)return;const x=F.current,f=X.current;if(f&&x==="horizontal")se(N.current),k();else if(f&&x==="vertical")if(G.current>li){const T=window.innerHeight;G.current=T,Ge(!0),O(T),ve("closing")}else G.current=0,O(0),k();else x==="horizontal"&&Math.abs(N.current)>0&&(se(N.current),k());_.current=null,F.current="none",N.current=0,X.current=!1,me(!1)};return document.addEventListener("touchstart",xe,{passive:!0}),document.addEventListener("touchmove",ee,{passive:!1}),document.addEventListener("touchend",Te),document.addEventListener("touchcancel",Te),()=>{document.removeEventListener("touchstart",xe),document.removeEventListener("touchmove",ee),document.removeEventListener("touchend",Te),document.removeEventListener("touchcancel",Te),g()}},[S,i.length,P]),r.useEffect(()=>{const o=g=>{g.key==="Escape"&&(g.preventDefault(),g.stopPropagation(),S!=="closing"&&ve("closing"))};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[S]);const Qe=()=>{S!=="closing"&&ve("closing")},re=S==="open",gt=S==="closing",St=Z>0?Math.max(0,1-Z/500):1,mt=Z>0?Math.max(.35,1-Z/500):1,ht=he&&d?{width:q.getEmbedAspect(d),height:1}:dt,u=m?be?m:$i(m,ht):null,Ze={position:"fixed",top:c==null?void 0:c.top,left:c==null?void 0:c.left,width:c==null?void 0:c.width,height:c==null?void 0:c.height,zIndex:9998},$e=be?"cover":"contain",Ae=ue!==0||Z>0?`translate(${ue}px, ${Z}px)`:void 0,pt=Se&&!Ve?"none":Ve?`transform ${H}ms ${le}`:ct?`transform ${H}ms ${le}, opacity ${H}ms ${le}`:S==="opening"||gt?`opacity ${H}ms ${le}`:"none",Pe={...Ze,transform:Ae,opacity:Z>0?mt:S==="opening"||gt?0:1,transition:pt,pointerEvents:"none"},Ce={position:"absolute",top:((u==null?void 0:u.top)??0)-((c==null?void 0:c.top)??0),left:((u==null?void 0:u.left)??0)-((c==null?void 0:c.left)??0),width:u==null?void 0:u.width,height:u==null?void 0:u.height,objectFit:$e,pointerEvents:"none"},et=(c==null?void 0:c.width)??0,Ie=Ke?(n+Re+i.length)%i.length:null,V=Ie!==null?i[Ie]:null,ft={...Ze,transform:Ke?`translateX(${Re*et+ue}px)`:void 0,opacity:1,transition:Ve?`transform ${H}ms ${le}`:"none",pointerEvents:"none"},E={position:"absolute",top:((m==null?void 0:m.top)??0)-((c==null?void 0:c.top)??0),left:((m==null?void 0:m.left)??0)-((c==null?void 0:c.left)??0),width:m==null?void 0:m.width,height:m==null?void 0:m.height,objectFit:$e,pointerEvents:"none"},ke=he&&d&&q.getEmbedPlayback(d).controls&&u?Math.min(52,u.height*.2):0,We=u?{position:"fixed",top:u.top,height:u.height-ke,width:u.width/2,zIndex:9999}:null;return t.jsxs("div",{ref:Ne,className:[`${e}-lightbox`,l?`${e}-lightbox-editor`:""].filter(Boolean).join(" "),style:{touchAction:S==="open"?"none":void 0},onClick:Qe,children:[t.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(28,31,34,0.9)",opacity:re?St:0,transition:Se?"none":`opacity ${H}ms ${le}`,pointerEvents:"none"}}),t.jsx("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:be?t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:ce,style:{position:"absolute",inset:0}}),t.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:re?1:0,transition:`opacity ${H}ms ${le}`,pointerEvents:"none",zIndex:9999},children:i.length>1&&t.jsxs("p",{className:R,style:K,children:[n+1," / ",i.length]})})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:"10%"}}),t.jsx("div",{style:{width:"70%",height:"80%",display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx("div",{ref:ce,style:{width:"100%",height:"100%"}})}),t.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",height:"10%",opacity:re?1:0,transition:`opacity ${H}ms ${le}`},children:i.length>1&&t.jsxs("p",{className:R,style:K,children:[n+1," / ",i.length]})})]})}),m&&c&&V&&t.jsx("div",{style:ft,onTransitionEnd:je,children:q.isEmbedMedia(V)?t.jsx("img",{src:V.thumbnail,alt:V.name,style:E},`neighbor-${Ie}-${V.assetId}`):ye(V)?t.jsx("video",{src:V.assetId,muted:!0,autoPlay:!0,loop:!0,playsInline:!0,preload:"auto",style:E},`neighbor-${Ie}-${V.assetId}`):t.jsx("img",{src:V.assetId,alt:V.name,style:E},`neighbor-${Ie}-${V.assetId}`)}),m&&c&&d&&t.jsx("div",{style:Pe,onTransitionEnd:je,children:he?t.jsx(q.EmbedMediaFrame,{media:d,fit:be?"cover":"contain",lazy:!1,startsAtOnce:!0,style:Ce},`${n}-${d.assetId}`):vt?t.jsx(xi,{src:d.assetId,mediaRef:de,mediaStyle:Ce,onLoadedMetadata:ut},`${n}-${d.assetId}`):t.jsx("img",{ref:de,src:d.assetId,alt:d.name,onLoad:ut,style:Ce},`${n}-${d.assetId}`)}),re&&We&&i.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{...We,left:u.left,cursor:"w-resize",pointerEvents:Se?"none":"auto"},onClick:o=>{if(Q.current){Q.current=!1;return}o.stopPropagation(),pe(-1)}}),t.jsx("div",{style:{...We,left:u.left+u.width/2,cursor:"e-resize",pointerEvents:Se?"none":"auto"},onClick:o=>{if(Q.current){Q.current=!1;return}o.stopPropagation(),pe(1)}})]}),t.jsx(bi,{prefix:e,closeIcon:J,closeIconMaxWidth:ae,closeIconColor:we,closeIconHoverColor:C,iconMarginRight:I,contentMarginTop:He,isEditor:l,isPreviewMode:b,isEditMode:y,visible:re,onClose:Qe})]})}function Si(e){return typeof e=="string"?e==="cover"?"cover":"fit":(e==null?void 0:e.display)==="cover"?"cover":"fit"}function ji({settings:e,content:i,isEditor:n,isPreviewMode:a,isEditMode:l,metadata:b,activeEvent:y,layoutId:B,portalId:oe}){const{prefix:s}=Qt.useScopedStyles(),{type:R="a",gridLayout:K,textBoxWidth:J=100,verticalGap:ae,entriesCount:we,lightbox:C,imageDisplay:I,imageCorners:He,lightboxImageDisplay:be,slider:Ne,sliderTiming:ce,direction:de,transition:_,titleMarginTop:G,subtitleMarginTop:N,titleColor:F,subtitleColor:X,lightboxCounterColor:Q,titleFontFamily:qe,titleFontSettings:L,titleFontSize:W,titleLineHeight:z,titleLetterSpacing:te,titleWordSpacing:Y,titleTextAppearance:Fe,subtitleFontFamily:Be,subtitleFontSettings:m,subtitleFontSize:ze,subtitleLineHeight:c,subtitleLetterSpacing:at,subtitleWordSpacing:S,subtitleTextAppearance:ve,lightboxCounterFontFamily:Z,lightboxCounterFontSettings:O,lightboxCounterFontSize:ue,lightboxCounterLineHeight:D,lightboxCounterLetterSpacing:Re,lightboxCounterWordSpacing:ie,lightboxCounterTextAppearance:Ve,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:me,closeIconHoverColor:ct,iconMarginRight:Ge,contentMarginTop:dt,showText:Xe="always",alignEntries:Ye="off",align:Ue="top"}=e,d={fontSettings:{fontFamily:qe,fontWeight:(L==null?void 0:L.fontWeight)??400,fontStyle:(L==null?void 0:L.fontStyle)??"normal"},fontSize:W??.01,lineHeight:z,letterSpacing:te??0,wordSpacing:Y??0,textAppearance:Fe,color:F},he={..._e.omitTextColors(_e.textStylesToCss(d,n))},Ke={fontSettings:{fontFamily:Be,fontWeight:(m==null?void 0:m.fontWeight)??400,fontStyle:(m==null?void 0:m.fontStyle)??"normal"},fontSize:ze??.01,lineHeight:c,letterSpacing:at??0,wordSpacing:S??0,textAppearance:ve,color:X},w={..._e.omitTextColors(_e.textStylesToCss(Ke,n))},ne={fontSettings:{fontFamily:Z,fontWeight:(O==null?void 0:O.fontWeight)??400,fontStyle:(O==null?void 0:O.fontStyle)??"normal"},fontSize:ue??.01,lineHeight:D,letterSpacing:Re??0,wordSpacing:ie??0,textAppearance:Ve,color:Q},Je={..._e.omitTextColors(_e.textStylesToCss(ne,n)),...bt(ue,D,s,n)},P=wt(W,z,`${s}-item-title`,`${s}-text-tight-leading`),pe=wt(ze,c,`${s}-item-subtitle`,`${s}-text-tight-leading`),je=bt(W,z,s,n),fe=bt(ze,c,s,n),Qe=wt(ue,D,`${s}-lightbox-counter`,`${s}-text-tight-leading`),re=Jt.buildColorVars(s,{titleColor:F,subtitleColor:X,lightboxCounterColor:Q},Ci,Ii),mt=`${y&&y!=="default"?`${s}-state-${y}`:""}${Xe==="on hover"&&(!n||a)?` ${s}-show-text-hover`:""}`.trim(),ht=we===0?1/0:we,u=(i??[]).slice(0,ht),Ze=r.useMemo(()=>C==="on"?ui(u):[],[u,C]),$e=K.entryWidth??.2,Ae=(I==null?void 0:I.display)==="cover",pt=(I==null?void 0:I.ratioValue)??"1:1",Pe=(I==null?void 0:I.reversed)??!1,[Ce,et]=pt.split(":").map(Number),ft=`${Pe?et:Ce} / ${Pe?Ce:et}`,E=K.columnsCount,ke=p.scalingValue($e??0,n),We=ke,o=!Ae&&Ne!=="off",g=u.length%E||E,k=g<E&&u.length>0,se=u.length-g,xe=k?Math.floor((E-g)/2)+1:1,ee=He?p.scalingValue(He,n):void 0,Te={width:We,...Ae?{aspectRatio:ft,height:"auto",overflow:"hidden"}:{height:"auto"},...ee?{borderRadius:ee,overflow:"hidden"}:{}},x=`${s}-item-image-wrapper${o?` ${s}-item-image-wrapper-fit-slider`:""}`.trim(),f=R==="d"||R==="e"||R==="f",v=Ye==="on",T=`calc(${p.scalingValue($e??0,n)} * (${J} / 100))`,M=p.scalingValue($e*J/100,n),jt=Ae?{objectFit:"cover",pointerEvents:"auto",width:"100%",height:"100%",maxWidth:"100%",...ee?{borderRadius:ee}:{}}:{objectFit:"contain",pointerEvents:"auto",width:"auto",height:"auto",maxWidth:"100%",...ee?{borderRadius:ee}:{}},[Ot,Dt]=r.useState(0),tt=r.useRef(null),Et=_==="fade"||de==="horizontal"?"ltr":de==="vertical"?"ttb":"ltr";r.useEffect(()=>{const h=tt.current;if(!h)return;const j=new ResizeObserver(A=>{Dt(Math.round(A[0].contentRect.width))});return j.observe(h),()=>j.disconnect()},[]);const Ht=(()=>{const h={...re},j=tt.current?getComputedStyle(tt.current).getPropertyValue("--cntrl-article-width").trim():"";return j&&(h["--cntrl-article-width"]=j),h})(),[$t,xt]=r.useState(!1),[it,qt]=r.useState([]),[Bt,yt]=r.useState(0),Ct=C==="on"&&(!n||a),It=(h,j)=>{n&&!a||C!=="off"&&(qt(h),yt(j),xt(!0))};r.useEffect(()=>{if(!$t||C!=="on"||typeof document>"u")return;const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}},[$t,C]),r.useEffect(()=>{!n||a||xt(!1)},[n,a]);const Gt=r.useMemo(()=>ti(s),[s]);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:Gt}}),C==="on"&&t.jsx(gi,{mediaList:Ze}),t.jsx("div",{style:re,children:t.jsx("div",{ref:tt,className:`${s}-wrapper ${s}-type-${R}${v?` ${s}-align-entries`:""} ${s}-image-align-${Ue} ${mt}`.trim(),style:{gridTemplateColumns:`repeat(${E}, ${ke})`,rowGap:v?0:p.scalingValue(ae??0,n),columnGap:p.scalingValue(K.horizontalGap??0,n),width:p.scalingValue(K.wrapperWidth??0,n),...v?{[`--${s}-align-entries-row-gap`]:p.scalingValue(ae??0,n)}:{}},children:u.map((h,j)=>{var Nt;const A=zt(h.title),U=zt(h.subtitle),Le=C==="off"&&((Nt=h.link)!=null&&Nt.value)?h.link:void 0,Xt=Math.floor(j/E)===Math.ceil(u.length/E)-1,nt=k&&j>=se?`${xe+(j-se)}`:void 0,kt=f?t.jsxs("div",{className:`${s}-item-text-block`,children:[A&&t.jsx("p",{className:P,style:{width:T,...he,...je},children:h.title}),A&&t.jsx("div",{"data-controls":l?"titleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:p.scalingValue(G??0,n),width:M}}),U&&t.jsx("p",{className:pe,style:{width:T,...w,...fe},children:h.subtitle}),U&&t.jsx("div",{"data-controls":l?"subtitleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:p.scalingValue(N??0,n),width:M}})]}):null,Yt=v?t.jsxs("div",{className:`${s}-item-title-row`,children:[!f&&t.jsx("div",{"data-controls":l&&A?"titleMarginTop":void 0,className:l&&A?`${s}-control`:void 0,style:{height:A?p.scalingValue(G??0,n):0,width:M}}),A&&t.jsx("p",{className:P,style:{width:T,...he,...je},children:h.title}),f&&A&&t.jsx("div",{"data-controls":l?"titleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:p.scalingValue(G??0,n),width:M}})]}):null,Ut=v?t.jsxs("div",{className:`${s}-item-subtitle-row`,children:[!f&&t.jsx("div",{"data-controls":l&&U?"subtitleMarginTop":void 0,className:l&&U?`${s}-control`:void 0,style:{height:U?p.scalingValue(N??0,n):0,width:M}}),U&&t.jsx("p",{className:pe,style:{width:T,...w,...fe},children:h.subtitle}),f&&U&&t.jsx("div",{"data-controls":l?"subtitleMarginTop":void 0,className:l?`${s}-control`:void 0,style:{height:p.scalingValue(N??0,n),width:M}})]}):null,Tt=t.jsxs(ot.LinkWrapper,{link:Le,className:`${s}-item-text-link`,children:[Yt,Ut]}),Oe=Wt(h.gallery),rt=Oe.filter($=>$.lightboxMedia).map($=>$.lightboxMedia),st=t.jsx(fi,{className:x,style:Te,children:Oe.length===0?null:Ne==="off"?(()=>{const{displayMedia:$,lightboxMedia:De}=Oe[0],Ee=De?rt.findIndex(lt=>lt.assetId===De.assetId):-1;return t.jsx(Rt,{media:$,className:`${s}-item-${ye($)?"video":"image"}`.trim(),style:jt,hasLightbox:C==="on",onMediaClick:Ct&&Ee>=0?()=>It(rt,Ee):void 0})})():t.jsxs(t.Fragment,{children:[o&&t.jsx("div",{className:`${s}-item-image-wrapper-sizer`,"aria-hidden":"true",children:Oe.map(({displayMedia:$})=>q.isEmbedMedia($)?t.jsx("div",{style:{aspectRatio:`${q.getEmbedAspect($)}`}},`sizer-${$.assetId}`):ye($)?t.jsx(At.LazyVideo,{src:$.assetId,nearPreload:"metadata",muted:!0,playsInline:!0},`sizer-${$.assetId}`):t.jsx("img",{src:$.assetId,alt:""},`sizer-${$.assetId}`))}),t.jsx(Ft.Splide2,{className:`${s}-item-slider`,options:{arrows:!1,pagination:!1,drag:!1,perPage:1,autoplay:!0,interval:ce*1e3,width:"100%",height:"100%",speed:si,type:_==="fade"?"fade":"loop",rewind:_==="fade",pauseOnHover:!1,pauseOnFocus:!1,direction:Et},onMoved:$=>{de!=="random"||_==="fade"||ri($)},children:Oe.map(({displayMedia:$,lightboxMedia:De},Ee)=>{const lt=De?rt.findIndex(Kt=>Kt.assetId===De.assetId):-1;return t.jsx(Ft.SplideSlide,{"data-slide-index":Ee,children:t.jsx(Rt,{media:$,className:`${s}-item-${ye($)?"video":"image"}`.trim(),style:jt,hasLightbox:C==="on",isSplideSlide:!0,onMediaClick:Ct&&lt>=0?()=>It(rt,lt):void 0})},Ee)})},`${_}-${$e}-${de}-${ce}-${Ot}-${B}`)]})}),Lt=f?null:t.jsxs(t.Fragment,{children:[t.jsx("div",{"data-controls":l&&A?"titleMarginTop":void 0,className:l&&A?`${s}-control`:void 0,style:{height:A?p.scalingValue(G??0,n):0,width:M}}),t.jsx("p",{className:P,style:{width:T,...he,...je},children:h.title}),t.jsx("div",{"data-controls":l&&U?"subtitleMarginTop":void 0,className:l&&U?`${s}-control`:void 0,style:{height:U?p.scalingValue(N??0,n):0,width:M}}),t.jsx("p",{className:pe,style:{width:T,...w,...fe},children:h.subtitle})]}),_t=Le?t.jsx(ot.LinkWrapper,{link:Le,className:`${s}-item-image-link`,children:st}):t.jsx("a",{className:`${s}-item-image-link`,children:st});return t.jsx("div",{className:`${s}-item`.trim(),style:nt&&!v?{gridColumn:nt}:void 0,children:t.jsx("div",{className:`${l?`${s}-item-inner`:`${s}-item-inner-hidden`}${v&&Xt?` ${s}-item-inner-last-row`:""}`.trim(),style:{width:(J??0)>100?`calc(${ke} * (${J} / 100))`:ke,...nt&&v?{gridColumn:nt}:{}},children:v?t.jsx(t.Fragment,{children:f?t.jsxs(t.Fragment,{children:[Tt,_t]}):t.jsxs(t.Fragment,{children:[_t,Tt]})}):Le?t.jsxs(t.Fragment,{children:[t.jsxs(ot.LinkWrapper,{link:Le,className:`${s}-item-image-link`,children:[kt,st]}),!f&&t.jsx(ot.LinkWrapper,{link:Le,className:`${s}-item-text-link`,children:Lt})]}):t.jsxs(t.Fragment,{children:[kt,st,Lt]})})},j)})})}),(!n||a)&&$t&&typeof document<"u"&&C==="on"&&(()=>{const h=(oe?document.getElementById(oe):null)??document.body;return Zt.createPortal(t.jsx("div",{style:Ht,"data-selection":"none",children:t.jsx(vi,{prefix:s,items:it,index:Bt,imageDisplay:Si(be),isEditor:n,isPreviewMode:a,isEditMode:l,closeIcon:ge,closeIconMaxWidth:Se,closeIconColor:me,closeIconHoverColor:ct,iconMarginRight:Ge,contentMarginTop:dt,onClose:()=>xt(!1),onPrev:()=>yt(j=>(j-1+it.length)%it.length),onNext:()=>yt(j=>(j+1)%it.length),counterClassName:Qe,counterStyle:Je})}),h)})()]})}const Ci={titleColor:"title-color",subtitleColor:"subtitle-color",lightboxCounterColor:"lightbox-counter-color"},Ii=["hover","focus","filled","success","error"];exports.Grid=ji;