react-motion-gallery 2.0.37 → 2.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -5
- package/dist/{GridSkeleton-B5wWBN9L.d.mts → GridSkeleton-Dpsi5tXc.d.mts} +1 -1
- package/dist/{MasonrySkeleton-D8aZRUiv.d.mts → MasonrySkeleton-Cs0x-4yL.d.mts} +1 -1
- package/dist/chunk-45TZO7MN.mjs +2 -0
- package/dist/chunk-4URHXPTV.mjs +4 -0
- package/dist/{chunk-7PF7OJT2.mjs → chunk-5HGFS3S2.mjs} +1 -1
- package/dist/{chunk-MFTASEWB.mjs → chunk-AHMXEVKY.mjs} +1 -1
- package/dist/chunk-AOQIL2HW.mjs +1 -0
- package/dist/chunk-AU4O4KU4.mjs +1 -0
- package/dist/chunk-CXH7XALE.mjs +1 -0
- package/dist/chunk-CXV4KHLX.mjs +3 -0
- package/dist/{chunk-J3UHEYNG.mjs → chunk-MJAHN7TG.mjs} +1 -1
- package/dist/chunk-QJ2YFMAT.mjs +2 -0
- package/dist/chunk-S356JN3V.mjs +4 -0
- package/dist/{chunk-3RVITFUD.mjs → chunk-YU2WS3GJ.mjs} +1 -1
- package/dist/core.d.mts +2 -1
- package/dist/entries.d.mts +8 -7
- package/dist/entries.mjs +1 -1
- package/dist/fullscreen-captions.d.mts +2 -1
- package/dist/fullscreen-controls.d.mts +2 -1
- package/dist/fullscreen-crossfade.d.mts +2 -1
- package/dist/fullscreen-lazy-load.d.mts +2 -1
- package/dist/fullscreen-slider.d.mts +2 -1
- package/dist/fullscreen-thumbnails.d.mts +2 -1
- package/dist/fullscreen-video.d.mts +2 -1
- package/dist/fullscreen-zoom-pan.d.mts +2 -1
- package/dist/fullscreen.d.mts +3 -2
- package/dist/grid.d.mts +2 -2
- package/dist/grid.mjs +1 -1
- package/dist/{index-QEgABhod.d.mts → index-C9XZ3Lr3.d.mts} +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +1 -1
- package/dist/{layout-DoYnPD0I.d.mts → layout-BOy4geKv.d.mts} +1 -0
- package/dist/masonry.mjs +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/{responsive-BnHorKhC.d.mts → responsive-Cwty6be5.d.mts} +3 -0
- package/dist/responsive.d.mts +2 -1
- package/dist/skeleton-base.d.mts +8 -5
- package/dist/skeleton-base.mjs +1 -1
- package/dist/skeleton-cache-provider.d.mts +7 -0
- package/dist/skeleton-cache-provider.mjs +1 -0
- package/dist/skeleton-cache.d.mts +70 -0
- package/dist/skeleton-cache.mjs +1 -0
- package/dist/skeleton-grid.d.mts +7 -5
- package/dist/skeleton-grid.mjs +1 -1
- package/dist/skeleton-masonry.d.mts +8 -6
- package/dist/skeleton-masonry.mjs +1 -1
- package/dist/skeleton-slider.d.mts +5 -2
- package/dist/skeleton-slider.mjs +7 -7
- package/package.json +9 -1
- package/dist/chunk-4BTS6IIA.mjs +0 -2
- package/dist/chunk-4ZOW533S.mjs +0 -1
- package/dist/chunk-63CVVCOL.mjs +0 -2
- package/dist/chunk-LSHR3FZM.mjs +0 -4
- package/dist/chunk-RGS2QTPJ.mjs +0 -3
- package/dist/chunk-X3W6JPNH.mjs +0 -4
|
@@ -6,6 +6,7 @@ import { P as PlyrSourceBuilder, a as PlyrOptionsBuilder } from './plyrTypes-Dhz
|
|
|
6
6
|
import { a as ZoomPanOptions } from './types-Dhh8xfHo.mjs';
|
|
7
7
|
import { L as LoadingForceOptions } from './force-C5m1QpdF.mjs';
|
|
8
8
|
import { R as ResponsiveTextBarHeight, a as ResponsiveTextBarWidth, b as ResponsiveTextLineHeight, c as ResponsiveTextLineCount, d as ResponsiveTextLastBarWidth, T as TextSkeletonResponsiveBy } from './text-BBcRGVzn.mjs';
|
|
9
|
+
import { SkeletonCacheOptions } from './skeleton-cache.mjs';
|
|
9
10
|
import { APITypes } from 'plyr-react';
|
|
10
11
|
import { c as FullscreenThumbnailSlotLayout } from './types-DNd5jSkS.mjs';
|
|
11
12
|
import { Root } from 'react-dom/client';
|
|
@@ -71,6 +72,7 @@ type SkeletonNode = {
|
|
|
71
72
|
};
|
|
72
73
|
} | {
|
|
73
74
|
kind: "text";
|
|
75
|
+
textId?: string;
|
|
74
76
|
barHeight: ResponsiveTextBarHeight;
|
|
75
77
|
barWidth?: ResponsiveTextBarWidth;
|
|
76
78
|
lineHeight: ResponsiveTextLineHeight;
|
|
@@ -152,6 +154,7 @@ type EntriesLoadingOptions = {
|
|
|
152
154
|
waitForDecode?: boolean;
|
|
153
155
|
decodeTimeoutMs?: number;
|
|
154
156
|
skeletonWrap?: ElementStyle;
|
|
157
|
+
cache?: SkeletonCacheOptions;
|
|
155
158
|
};
|
|
156
159
|
type IntroOptions = {
|
|
157
160
|
renderIntro?: (args: {
|
package/dist/responsive.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as ResponsiveCaptionPlacement, q as ResponsiveLength, r as ResponsiveLengthValue, J as ResponsivePosition } from './responsive-
|
|
1
|
+
export { R as ResponsiveCaptionPlacement, q as ResponsiveLength, r as ResponsiveLengthValue, J as ResponsivePosition } from './responsive-Cwty6be5.mjs';
|
|
2
2
|
export { a as BREAKPOINT_MAP, B as BreakpointMap, R as ResponsiveNumber } from './responsiveNumber-CouEMJ9O.mjs';
|
|
3
3
|
import './types-DXFoG8LC.mjs';
|
|
4
4
|
import 'react';
|
|
@@ -10,6 +10,7 @@ import './plyrTypes-DhzgHNfX.mjs';
|
|
|
10
10
|
import 'plyr';
|
|
11
11
|
import './types-Dhh8xfHo.mjs';
|
|
12
12
|
import './text-BBcRGVzn.mjs';
|
|
13
|
+
import './skeleton-cache.mjs';
|
|
13
14
|
import 'plyr-react';
|
|
14
15
|
import './types-DNd5jSkS.mjs';
|
|
15
16
|
import 'react-dom/client';
|
package/dist/skeleton-base.d.mts
CHANGED
|
@@ -3,8 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { B as BreakpointMap } from './responsiveNumber-CouEMJ9O.mjs';
|
|
4
4
|
import { L as LoadingForceOptions } from './force-C5m1QpdF.mjs';
|
|
5
5
|
import { L as LoadingTimingOptions } from './transitions-DU3ftmIq.mjs';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import { SkeletonCacheOptions } from './skeleton-cache.mjs';
|
|
7
|
+
import { S as SkeletonNode, a as SkeletonLength, b as SkeletonShimmer } from './layout-BOy4geKv.mjs';
|
|
8
|
+
export { e as SkeletonBaseStyle, f as SkeletonBaseStyleResponsive, g as SkeletonContainerStyle, h as SkeletonContainerStyleResponsive } from './layout-BOy4geKv.mjs';
|
|
8
9
|
export { R as ResponsiveTextBarHeight, a as ResponsiveTextBarWidth, d as ResponsiveTextLastBarWidth, c as ResponsiveTextLineCount, b as ResponsiveTextLineHeight, T as TextSkeletonResponsiveBy } from './text-BBcRGVzn.mjs';
|
|
9
10
|
|
|
10
11
|
type SkeletonForceOptions = LoadingForceOptions;
|
|
@@ -25,6 +26,7 @@ type SkeletonFrameProps = {
|
|
|
25
26
|
loadingLayerFirst?: boolean;
|
|
26
27
|
contentWrapper?: (children: React.ReactNode) => React.ReactNode;
|
|
27
28
|
shellDataAttributes?: Record<string, string | boolean | undefined>;
|
|
29
|
+
shellRef?: React.Ref<HTMLDivElement>;
|
|
28
30
|
};
|
|
29
31
|
type SkeletonProps = {
|
|
30
32
|
layout: SkeletonNode;
|
|
@@ -45,8 +47,9 @@ type SkeletonProps = {
|
|
|
45
47
|
enabled?: boolean;
|
|
46
48
|
force?: SkeletonForceOptions;
|
|
47
49
|
timing?: SkeletonTimingOptions;
|
|
50
|
+
cache?: SkeletonCacheOptions;
|
|
48
51
|
};
|
|
49
|
-
declare function SkeletonFrame({ skeletonNode, children, ready, enabled, force, timing, shellClassName, shellStyle, loadingShellStyle, contentClassName, contentStyle, contentOwnsWrapperLayout, loadingLayerFirst, contentWrapper, shellDataAttributes, }: SkeletonFrameProps): react_jsx_runtime.JSX.Element;
|
|
50
|
-
declare function Skeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function SkeletonFrame({ skeletonNode, children, ready, enabled, force, timing, shellClassName, shellStyle, loadingShellStyle, contentClassName, contentStyle, contentOwnsWrapperLayout, loadingLayerFirst, contentWrapper, shellDataAttributes, shellRef, }: SkeletonFrameProps): react_jsx_runtime.JSX.Element;
|
|
53
|
+
declare function Skeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, cache, }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
51
54
|
|
|
52
|
-
export { Skeleton, type SkeletonForceOptions, SkeletonFrame, type SkeletonFrameProps, SkeletonLength, SkeletonNode, type SkeletonProps, SkeletonShimmer, type SkeletonTimingOptions, Skeleton as default };
|
|
55
|
+
export { Skeleton, SkeletonCacheOptions, type SkeletonForceOptions, SkeletonFrame, type SkeletonFrameProps, SkeletonLength, SkeletonNode, type SkeletonProps, SkeletonShimmer, type SkeletonTimingOptions, Skeleton as default };
|
package/dist/skeleton-base.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{c as Skeleton,b as SkeletonFrame,c as default}from'./chunk-CXH7XALE.mjs';import'./chunk-45TZO7MN.mjs';import'./chunk-AU4O4KU4.mjs';import'./chunk-AOQIL2HW.mjs';import'./chunk-Z34PSRMG.mjs';import'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import'./chunk-HK2DPKES.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { SkeletonCacheProviderProps } from './skeleton-cache.mjs';
|
|
3
|
+
import 'react';
|
|
4
|
+
|
|
5
|
+
declare function SkeletonCacheProvider({ children, options, snapshot, snapshots, }: SkeletonCacheProviderProps): react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { SkeletonCacheProvider, SkeletonCacheProviderProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as SkeletonCacheProvider}from'./chunk-AU4O4KU4.mjs';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const SKELETON_CACHE_VERSION = 1;
|
|
4
|
+
declare const DEFAULT_SKELETON_CACHE_TTL_MS: number;
|
|
5
|
+
declare const DEFAULT_SKELETON_CACHE_DEBOUNCE_MS = 250;
|
|
6
|
+
type SkeletonCacheKind = "skeleton" | "slider" | "grid" | "masonry" | "entries";
|
|
7
|
+
type SkeletonCacheTextRecord = {
|
|
8
|
+
lines: number;
|
|
9
|
+
barWidths?: string[];
|
|
10
|
+
lineWidthsPx?: number[];
|
|
11
|
+
barHeight?: number;
|
|
12
|
+
lineHeight?: number;
|
|
13
|
+
containerWidthPx?: number;
|
|
14
|
+
};
|
|
15
|
+
type SkeletonCacheMasonrySnapshot = {
|
|
16
|
+
variantKey: string;
|
|
17
|
+
shellHeightPx?: number;
|
|
18
|
+
itemHeightsPx?: number[];
|
|
19
|
+
};
|
|
20
|
+
type SkeletonCacheSnapshot = {
|
|
21
|
+
version: 1;
|
|
22
|
+
key: string;
|
|
23
|
+
scopeId: string;
|
|
24
|
+
kind: SkeletonCacheKind;
|
|
25
|
+
routeKey?: string;
|
|
26
|
+
createdAt: number;
|
|
27
|
+
widthBucketMin: number;
|
|
28
|
+
viewportWidth: number;
|
|
29
|
+
layoutWidthPx?: number;
|
|
30
|
+
masonry?: SkeletonCacheMasonrySnapshot;
|
|
31
|
+
text: Record<string, SkeletonCacheTextRecord>;
|
|
32
|
+
};
|
|
33
|
+
type SkeletonCacheCookieOptions = {
|
|
34
|
+
path?: string;
|
|
35
|
+
sameSite?: "lax" | "strict" | "none";
|
|
36
|
+
secure?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type SkeletonCacheOptions = {
|
|
39
|
+
key: string;
|
|
40
|
+
snapshot?: SkeletonCacheSnapshot | null;
|
|
41
|
+
ttlMs?: number;
|
|
42
|
+
debounceMs?: number;
|
|
43
|
+
routeKey?: string;
|
|
44
|
+
cookie?: SkeletonCacheCookieOptions;
|
|
45
|
+
};
|
|
46
|
+
type SkeletonCacheProviderProps = {
|
|
47
|
+
children?: React.ReactNode;
|
|
48
|
+
options?: Omit<SkeletonCacheOptions, "snapshot">;
|
|
49
|
+
snapshot?: SkeletonCacheSnapshot | null;
|
|
50
|
+
snapshots?: Record<string, SkeletonCacheSnapshot | null | undefined>;
|
|
51
|
+
};
|
|
52
|
+
type SkeletonCacheParseOptions = {
|
|
53
|
+
key?: string;
|
|
54
|
+
scopeId?: string;
|
|
55
|
+
kind?: SkeletonCacheKind;
|
|
56
|
+
routeKey?: string;
|
|
57
|
+
ttlMs?: number;
|
|
58
|
+
now?: number;
|
|
59
|
+
textIds?: readonly string[];
|
|
60
|
+
itemCount?: number;
|
|
61
|
+
variantKeys?: readonly string[];
|
|
62
|
+
widthBucketMin?: number;
|
|
63
|
+
};
|
|
64
|
+
declare function getSkeletonCacheCookieName(key: string): string;
|
|
65
|
+
declare function serializeSkeletonCacheSnapshot(snapshot: SkeletonCacheSnapshot): string;
|
|
66
|
+
declare function validateSkeletonCacheSnapshot(snapshot: SkeletonCacheSnapshot | null | undefined, options?: SkeletonCacheParseOptions): SkeletonCacheSnapshot | null;
|
|
67
|
+
declare function parseSkeletonCacheCookie(raw: string | null | undefined, options?: SkeletonCacheParseOptions): SkeletonCacheSnapshot | null;
|
|
68
|
+
declare function getSkeletonCacheRouteKey(loc?: Pick<Location, "pathname" | "search"> | undefined): string;
|
|
69
|
+
|
|
70
|
+
export { DEFAULT_SKELETON_CACHE_DEBOUNCE_MS, DEFAULT_SKELETON_CACHE_TTL_MS, SKELETON_CACHE_VERSION, type SkeletonCacheCookieOptions, type SkeletonCacheKind, type SkeletonCacheMasonrySnapshot, type SkeletonCacheOptions, type SkeletonCacheProviderProps, type SkeletonCacheSnapshot, type SkeletonCacheTextRecord, getSkeletonCacheCookieName, getSkeletonCacheRouteKey, parseSkeletonCacheCookie, serializeSkeletonCacheSnapshot, validateSkeletonCacheSnapshot };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{c as DEFAULT_SKELETON_CACHE_DEBOUNCE_MS,b as DEFAULT_SKELETON_CACHE_TTL_MS,a as SKELETON_CACHE_VERSION,d as getSkeletonCacheCookieName,h as getSkeletonCacheRouteKey,g as parseSkeletonCacheCookie,e as serializeSkeletonCacheSnapshot,f as validateSkeletonCacheSnapshot}from'./chunk-AOQIL2HW.mjs';
|
package/dist/skeleton-grid.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { R as ResponsiveNumber, B as BreakpointMap } from './responsiveNumber-CouEMJ9O.mjs';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { SkeletonCacheOptions } from './skeleton-cache.mjs';
|
|
5
|
+
import { a as SkeletonLength, b as SkeletonShimmer } from './layout-BOy4geKv.mjs';
|
|
6
|
+
export { S as SkeletonNode } from './layout-BOy4geKv.mjs';
|
|
6
7
|
import { f as ResponsiveGridTemplate, R as ResponsiveGridSpan } from './types-Do4Pq-Td.mjs';
|
|
7
|
-
import { c as GridSkeletonLayoutNode, b as GridSkeletonSpec } from './GridSkeleton-
|
|
8
|
-
export { G as GridSkeletonNode, a as GridSkeletonSlot } from './GridSkeleton-
|
|
8
|
+
import { c as GridSkeletonLayoutNode, b as GridSkeletonSpec } from './GridSkeleton-Dpsi5tXc.mjs';
|
|
9
|
+
export { G as GridSkeletonNode, a as GridSkeletonSlot } from './GridSkeleton-Dpsi5tXc.mjs';
|
|
9
10
|
import { SkeletonForceOptions, SkeletonTimingOptions } from './skeleton-base.mjs';
|
|
10
11
|
import './text-BBcRGVzn.mjs';
|
|
11
12
|
import './force-C5m1QpdF.mjs';
|
|
@@ -57,7 +58,8 @@ type GridSkeletonProps = {
|
|
|
57
58
|
force?: SkeletonForceOptions;
|
|
58
59
|
timing?: SkeletonTimingOptions;
|
|
59
60
|
grid?: SkeletonGridOptions;
|
|
61
|
+
cache?: SkeletonCacheOptions;
|
|
60
62
|
};
|
|
61
|
-
declare function GridSkeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, grid, }: GridSkeletonProps): react_jsx_runtime.JSX.Element | null;
|
|
63
|
+
declare function GridSkeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, grid, cache, }: GridSkeletonProps): react_jsx_runtime.JSX.Element | null;
|
|
62
64
|
|
|
63
65
|
export { GridSkeleton, type GridSkeletonProps, GridSkeletonSpec, GridSkeleton as Skeleton, SkeletonForceOptions, type SkeletonGridLayout, type SkeletonGridOptions, SkeletonTimingOptions, GridSkeleton as default };
|
package/dist/skeleton-grid.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as GridSkeleton,a as Skeleton,a as default}from'./chunk-
|
|
1
|
+
export{a as GridSkeleton,a as Skeleton,a as default}from'./chunk-S356JN3V.mjs';import'./chunk-CXH7XALE.mjs';import'./chunk-45TZO7MN.mjs';import'./chunk-AU4O4KU4.mjs';import'./chunk-AOQIL2HW.mjs';import'./chunk-Z34PSRMG.mjs';import'./chunk-Y7NUGXTR.mjs';import'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import'./chunk-HK2DPKES.mjs';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { R as ResponsiveNumber, B as BreakpointMap } from './responsiveNumber-CouEMJ9O.mjs';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { SkeletonCacheOptions } from './skeleton-cache.mjs';
|
|
5
|
+
import { a as SkeletonLength, b as SkeletonShimmer } from './layout-BOy4geKv.mjs';
|
|
6
|
+
export { S as SkeletonNode } from './layout-BOy4geKv.mjs';
|
|
6
7
|
import { R as ResponsiveMasonrySpan } from './types-Br27DWP7.mjs';
|
|
7
|
-
import { M as MasonrySkeletonLayoutNode, a as MasonryPlacement, b as MasonrySkeletonSpec } from './MasonrySkeleton-
|
|
8
|
-
export { c as MasonrySkeletonNode, d as MasonrySkeletonSlot } from './MasonrySkeleton-
|
|
8
|
+
import { M as MasonrySkeletonLayoutNode, a as MasonryPlacement, b as MasonrySkeletonSpec } from './MasonrySkeleton-Cs0x-4yL.mjs';
|
|
9
|
+
export { c as MasonrySkeletonNode, d as MasonrySkeletonSlot } from './MasonrySkeleton-Cs0x-4yL.mjs';
|
|
9
10
|
import { SkeletonForceOptions, SkeletonTimingOptions } from './skeleton-base.mjs';
|
|
10
11
|
import './text-BBcRGVzn.mjs';
|
|
11
12
|
import './force-C5m1QpdF.mjs';
|
|
@@ -56,7 +57,8 @@ type MasonrySkeletonProps = {
|
|
|
56
57
|
force?: SkeletonForceOptions;
|
|
57
58
|
timing?: SkeletonTimingOptions;
|
|
58
59
|
masonry?: SkeletonMasonryOptions;
|
|
60
|
+
cache?: SkeletonCacheOptions;
|
|
59
61
|
};
|
|
60
|
-
declare function MasonrySkeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, masonry, }: MasonrySkeletonProps): react_jsx_runtime.JSX.Element | null;
|
|
62
|
+
declare function MasonrySkeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, masonry, cache, }: MasonrySkeletonProps): react_jsx_runtime.JSX.Element | null;
|
|
61
63
|
|
|
62
|
-
export { MasonryPlacement, MasonrySkeleton, type MasonrySkeletonProps, MasonrySkeletonSpec, MasonrySkeleton as Skeleton, SkeletonForceOptions, type SkeletonMasonryLayout, type SkeletonMasonryOptions, SkeletonTimingOptions, MasonrySkeleton as default };
|
|
64
|
+
export { MasonryPlacement, MasonrySkeleton, type MasonrySkeletonProps, MasonrySkeletonSpec, MasonrySkeleton as Skeleton, SkeletonCacheOptions, SkeletonForceOptions, type SkeletonMasonryLayout, type SkeletonMasonryOptions, SkeletonTimingOptions, MasonrySkeleton as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as MasonrySkeleton,a as Skeleton,a as default}from'./chunk-
|
|
1
|
+
export{a as MasonrySkeleton,a as Skeleton,a as default}from'./chunk-CXV4KHLX.mjs';import'./chunk-4URHXPTV.mjs';import'./chunk-CXH7XALE.mjs';import'./chunk-45TZO7MN.mjs';import'./chunk-AU4O4KU4.mjs';import'./chunk-AOQIL2HW.mjs';import'./chunk-Z34PSRMG.mjs';import'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import'./chunk-HK2DPKES.mjs';
|
|
@@ -2,7 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { R as ResponsiveNumber, B as BreakpointMap } from './responsiveNumber-CouEMJ9O.mjs';
|
|
4
4
|
import { j as SliderHandle } from './types-BiXSaEk7.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { SkeletonCacheOptions } from './skeleton-cache.mjs';
|
|
6
|
+
import { a as SkeletonLength$1, b as SkeletonShimmer$1 } from './layout-BOy4geKv.mjs';
|
|
6
7
|
import { R as ResponsiveTextBarHeight, a as ResponsiveTextBarWidth, b as ResponsiveTextLineHeight, c as ResponsiveTextLineCount, d as ResponsiveTextLastBarWidth } from './text-BBcRGVzn.mjs';
|
|
7
8
|
import { SkeletonForceOptions, SkeletonTimingOptions } from './skeleton-base.mjs';
|
|
8
9
|
import './force-C5m1QpdF.mjs';
|
|
@@ -131,6 +132,7 @@ type SkeletonNode = {
|
|
|
131
132
|
shimmer?: SkeletonShimmer;
|
|
132
133
|
} | {
|
|
133
134
|
kind: "text";
|
|
135
|
+
textId?: string;
|
|
134
136
|
barHeight: ResponsiveTextBarHeight;
|
|
135
137
|
barWidth?: ResponsiveTextBarWidth;
|
|
136
138
|
lineHeight: ResponsiveTextLineHeight;
|
|
@@ -194,6 +196,7 @@ type SliderSkeletonProps = {
|
|
|
194
196
|
force?: SkeletonForceOptions;
|
|
195
197
|
timing?: SkeletonTimingOptions;
|
|
196
198
|
restore?: SkeletonSliderRestoreOptions;
|
|
199
|
+
cache?: SkeletonCacheOptions;
|
|
197
200
|
};
|
|
198
201
|
declare function buildScopedInitialHeightCss(args: {
|
|
199
202
|
scopeId: string;
|
|
@@ -203,6 +206,6 @@ declare function buildScopedInitialHeightCss(args: {
|
|
|
203
206
|
breakpointMap: BreakpointMap;
|
|
204
207
|
centerFirstSpacer?: boolean;
|
|
205
208
|
}): string;
|
|
206
|
-
declare function SliderSkeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, restore, }: SliderSkeletonProps): react_jsx_runtime.JSX.Element | null;
|
|
209
|
+
declare function SliderSkeleton({ layout, children, breakpoints, className, style, shellClassName, shellStyle, contentClassName, contentStyle, backgroundColor, radius, shimmer, disableShimmer, ariaLabel, ready, enabled, force, timing, restore, cache, }: SliderSkeletonProps): react_jsx_runtime.JSX.Element | null;
|
|
207
210
|
|
|
208
211
|
export { SliderSkeleton as Skeleton, SkeletonForceOptions, type SkeletonNode, type SkeletonSliderLayout, type SkeletonSliderReadyHandle, type SkeletonSliderRestoreOptions, SkeletonTimingOptions, SliderSkeleton, type SliderSkeletonNode, type SliderSkeletonProps, type SliderSkeletonSlot, type SliderSkeletonSpec, buildScopedInitialHeightCss, SliderSkeleton as default };
|
package/dist/skeleton-slider.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {a as a$
|
|
2
|
-
var cfg=${
|
|
1
|
+
import {a as a$3}from'./chunk-R6EGYRTJ.mjs';import {a as a$4}from'./chunk-KJZTKXTM.mjs';import {a as a$2,b as b$1}from'./chunk-CXH7XALE.mjs';import {n,l,g,h,t,i as i$1,u,w,x as x$1,b as b$2,k,y as y$1,s,q,d as d$1,f as f$2,r,j}from'./chunk-45TZO7MN.mjs';import {b,c}from'./chunk-AU4O4KU4.mjs';import {f as f$1}from'./chunk-AOQIL2HW.mjs';import'./chunk-Z34PSRMG.mjs';import {a as a$1}from'./chunk-UUAWLGWO.mjs';import'./chunk-LVYED5ZM.mjs';import'./chunk-B4CC5AGE.mjs';import {i,a,d,e}from'./chunk-HK2DPKES.mjs';import*as x from'react';import {jsxs,jsx}from'react/jsx-runtime';var bt=300*1e3,Rt=2,Ct="rmg:slider-restore",un=new Set(["reload","back_forward"]);function cn(e,t){return (e%t+t)%t}function dn(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function wt(){return Date.now()}function Nt(e,t=typeof window<"u"?window.location:void 0){let n=t?`${t.pathname}${t.search}`:"";return `${Ct}:${e}:${n}`}function Sn(e=window){let n=(e.performance?.getEntriesByType?.("navigation")??[])[0];if(n?.type)return n.type;let r=e.performance?.navigation;return r?r.type===r.TYPE_RELOAD?"reload":r.type===r.TYPE_BACK_FORWARD?"back_forward":null:null}function mn(e=window){let t=Sn(e);return !!t&&un.has(t)}function fn(e){if(!e)return null;let t;try{t=JSON.parse(e);}catch{return null}if(!dn(t)||t.version!==1)return null;let n=Number(t.index),r=Number(t.viewportWidth),i=Number(t.slideCount),o=Number(t.skeletonSlotCount),l=Number(t.timestamp),a=Number(t.scrollY),c=Number(t.scrollMax),u=t.heightPx==null?void 0:Number(t.heightPx);return !Number.isInteger(n)||n<0||!Number.isFinite(r)||r<=0||!Number.isInteger(i)||i<=0||!Number.isInteger(o)||o<=0||!Number.isFinite(l)||l<=0||u!=null&&(!Number.isFinite(u)||u<=0)?null:{version:1,index:n,heightPx:u,viewportWidth:r,slideCount:i,skeletonSlotCount:o,timestamp:l,scrollY:Number.isFinite(a)?Math.max(0,a):0,scrollMax:Number.isFinite(c)?Math.max(0,c):0,wasAtBottom:t.wasAtBottom===true}}function pn(e,t){if(!e)return null;let n=Math.max(0,t.ttlMs),r=(t.now??wt())-e.timestamp;if(n>0&&(r<0||r>n)||e.slideCount!==t.slideCount||e.skeletonSlotCount!==t.skeletonSlotCount||e.index<0||e.index>=t.slideCount)return null;let i=t.viewportTolerancePx??Rt;return Math.abs(e.viewportWidth-t.viewportWidth)>i?null:e}function Bt(e,t=window,n={}){if(!e?.enabled||e.controlled||n.requireNavigationRestore!==false&&!mn(t))return null;try{let r=t.sessionStorage.getItem(Nt(e.storageKeyId,t.location));return pn(fn(r),{ttlMs:e.ttlMs,viewportWidth:t.innerWidth||t.document.documentElement.clientWidth||0,slideCount:e.slideCount,skeletonSlotCount:e.skeletonSlotCount})}catch{return null}}function Ht(e,t,n=window){if(!(!e?.enabled||e.controlled))try{let r=n.document.documentElement,i=n.document.body,o=Math.max(r?.scrollHeight??0,i?.scrollHeight??0),l=n.innerHeight||r?.clientHeight||0,a=Math.max(0,o-l),c=Math.max(0,n.scrollY||n.pageYOffset||0),u=a>0&&a-c<=4,s={version:1,index:Math.max(0,Math.floor(t.index)),heightPx:t.heightPx,viewportWidth:n.innerWidth||r?.clientWidth||0,slideCount:t.slideCount,skeletonSlotCount:t.skeletonSlotCount,timestamp:wt(),scrollY:c,scrollMax:a,wasAtBottom:u};n.sessionStorage.setItem(Nt(e.storageKeyId,n.location),JSON.stringify(s));}catch{}}function Et(e){let t=Math.max(0,Math.floor(e.slotCount)),n=Math.min(t,Math.max(0,Math.floor(e.visibleCount)));if(t<=0||n<=0)return [];let r=Math.min(Math.max(0,Math.floor(e.activeIndex)),Math.max(0,t-1)),i=Math.min(Math.max(0,Math.floor(e.activeSlotOffset)),Math.max(0,n-1)),o=e.loop?r:Math.min(Math.max(0,r-i),Math.max(0,t-n)),l=[],a=new Set;for(let c=0;c<n;c+=1){let u=o+c,s=e.loop?cn(u,t):u;s<0||s>=t||a.has(s)||(a.add(s),l.push({slot:s+1,order:c}));}return l}function hn(e){return JSON.stringify(e).replace(/</g,"\\u003c")}function gn(e){return `(function(){try{
|
|
2
|
+
var cfg=${hn(e)};
|
|
3
3
|
var nav=(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||{}).type;
|
|
4
4
|
if(!nav&&performance.navigation){nav=performance.navigation.type===performance.navigation.TYPE_RELOAD?"reload":performance.navigation.type===performance.navigation.TYPE_BACK_FORWARD?"back_forward":"";}
|
|
5
5
|
if(nav!=="reload"&&nav!=="back_forward")return;
|
|
6
|
-
var key="${
|
|
6
|
+
var key="${Ct}:"+cfg.storageKeyId+":"+location.pathname+location.search;
|
|
7
7
|
var raw=sessionStorage.getItem(key);
|
|
8
8
|
if(!raw)return;
|
|
9
9
|
var state=JSON.parse(raw);
|
|
@@ -34,7 +34,7 @@ style.setAttribute("data-rmg-slider-restore-style",cfg.scopeId);
|
|
|
34
34
|
style.textContent=css;
|
|
35
35
|
document.head.appendChild(style);
|
|
36
36
|
if(state.wasAtBottom){var keep=function(){var doc=document.documentElement;var body=document.body;var max=Math.max(0,Math.max(doc.scrollHeight,body?body.scrollHeight:0)-(innerHeight||doc.clientHeight||0));scrollTo(scrollX||0,max);};requestAnimationFrame(keep);setTimeout(keep,50);addEventListener("load",function(){requestAnimationFrame(keep);setTimeout(keep,120);},{once:true});}
|
|
37
|
-
}catch(e){}})();`}function
|
|
38
|
-
`)}function kt(e){let{kind:t,style:n,shimmer:r,breakpointMap:i,mediaTile:o}=e,l={},a=s(n,i),c=e.__rmgNodeId;return t==="circle"&&(l.borderRadius="9999px"),t==="square"&&a?.aspectRatio==null&&(l.aspectRatio="1"),a?.aspectRatio!=null&&a?.height==null&&(l.height="auto"),jsx("div",{"data-rmg-skel-node":c,"data-rmg-skel-media-tile":o?"true":void 0,className:a$4.sliderSkeleton,style:{...We(a,r),...He(a),...l}})}function cn({node:e,breakpointMap:t}){let n=j({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:t}),r=s(e.style,t),i=n.states.some(({state:s})=>s.lineCount!==n.baseState.lineCount||s.metrics.totalHeight!==n.baseState.metrics.totalHeight||s.metrics.barHeight!==n.baseState.metrics.barHeight||s.metrics.paddingBlock!==n.baseState.metrics.paddingBlock||s.metrics.rowGap!==n.baseState.metrics.rowGap),o=n.states.some(({state:s})=>s.lineCount!==n.baseState.lineCount||s.barWidths.length!==n.baseState.barWidths.length||s.barWidths.some((p,S)=>p!==n.baseState.barWidths[S])),l=e.__rmgNodeId,a=on(r,i?void 0:n.metrics.totalHeight),c={height:n.metrics.barHeight,backgroundColor:r?.backgroundColor,borderRadius:r?.borderRadius},u=$e(r?.width);return jsx("div",{"data-rmg-skel-node":l,"data-rmg-skel-text":"true",className:a$4.sliderSkeletonText,style:{...a,...He(r),...i?null:{paddingBlock:`${n.metrics.paddingBlock}px`,rowGap:`${n.metrics.rowGap}px`}},children:Array.from({length:n.maxLines}).map((s,p)=>jsx("div",{"data-rmg-skel-text-line":"true",className:[a$4.sliderSkeleton,a$4.sliderSkeletonTextLine].join(" "),style:{...We(c,e.shimmer),...o?null:{display:p>=n.baseLines?"none":void 0,width:u?n.baseState.barWidths[p]??"100%":"100%",maxWidth:n.baseState.barWidths[p]??"100%"}}},p))})}function Le({node:e,breakpointMap:t$1,activeDotIndex:n$1}){switch(e.kind){case "rect":case "square":case "circle":return jsx(kt,{...e,breakpointMap:t$1});case "media":{let r=Math.max(0,e.count|0),i=e.direction??"row",o=e.tile?.shape??"rect",l=e.__rmgNodeId,a=Be(t(e.style,t$1));return jsx("div",{"data-rmg-skel-node":l,className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:i==="row"?"row":"column",...a||{}},children:Array.from({length:r}).map((c,u)=>jsx(kt,{kind:o,style:e.tile?.style,shimmer:e.tile?.shimmer,breakpointMap:t$1,mediaTile:true},u))})}case "sliderDots":{let r=Math.max(0,e.count|0),i=e.__rmgNodeId,o=Be(t(e.style,t$1)),l=Ae(s(e.dotStyle,t$1)),a=Ae(s(e.activeStyle,t$1)),c=Ae(s(e.inactiveStyle,t$1)),u=typeof n$1=="number"&&Number.isFinite(n$1)?Math.max(0,Math.min(r-1,Math.floor(n$1))):0;return jsx("div",{"data-rmg-skel-node":i,"data-rmg-skel-slider-dots":"true","data-rmg-skel-dot-active-style":JSON.stringify(a),"data-rmg-skel-dot-inactive-style":JSON.stringify(c),className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:"row",...o||{}},children:Array.from({length:r}).map((s,p)=>{let S=p===u;return jsx("div",{"data-rmg-skel-slider-dot":p,"data-rmg-skel-dot-active":S?"true":"false",className:a$4.sliderSkeleton,style:{...n(e.shimmer),...l,...S?a:c}},p)})})}case "stack":case "row":case "col":{let r=e.kind==="row"?"row":"column",i=e.__rmgNodeId,o=Be(t(e.style,t$1));return jsx("div",{"data-rmg-skel-node":i,className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:r,...o||{}},children:e.children.map((l,a)=>jsx(Le,{node:l,breakpointMap:t$1,activeDotIndex:n$1},a))})}case "text":return jsx(cn,{node:e,breakpointMap:t$1});default:return null}}function yt(){return {layout:{kind:"slider",direction:"row",item:{kind:"rect",style:{width:"100%",height:"100%",borderRadius:2}},itemWrapStyle:void 0},radius:12}}function Ee(e){return /%$/.test(e.trim())}function Rt(e){let t=e.trim();if(!t.length)return null;if(t==="0")return {value:0,unit:"px"};let n=t.match(/^(\d+(?:\.\d+)?|\.\d+)([a-zA-Z]+)$/);if(!n)return null;let r=Number(n[1]);return !Number.isFinite(r)||r<0?null:{value:r,unit:n[2]}}function Ct(e){let t=[],n="",r=0;for(let i of e.trim()){if(/\s/.test(i)&&r===0){n&&(t.push(n),n="");continue}n+=i,i==="("?r+=1:i===")"&&(r=Math.max(0,r-1));}return n&&t.push(n),t}function dn(e){let t=e.trim();return t.length?t==="0"?"0px":/^(?:var|calc|min|max|clamp)\(.+\)$/i.test(t)||Rt(t)?t:null:null}function Sn(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)&&e>=0?e===0?"0px":`${e}px`:null;for(let t of Ct(String(e))){let n=dn(t);if(n)return n}return null}function _(e){return e==null?null:typeof e=="number"?`${e}px`:String(e)}function Me(e,t){if(!e)return null;if(t===0)return "0px";if(e==="0px")return e;let n=Rt(e);return n?`${n.value*t}${n.unit}`:`calc(${e} * ${t})`}function wt(e){if(e==null)return null;if(typeof e=="number")return e>0?e:null;let t=String(e).trim(),n=t.match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(n){let i=Number(n[1]),o=Number(n[2]);return i>0&&o>0?i/o:null}let r=Number(t);return Number.isFinite(r)&&r>0?r:null}function k(e){let t=e.filter(r=>!!r&&r.trim().length>0);if(!t.length)return null;let n=t.filter(r=>{let i=r.trim();return i!=="0"&&i!=="0px"});return n.length?n.length===1?n[0]:`calc(${n.join(" + ")})`:"0px"}function ve(e){let t=e.filter(n=>!!n&&n.trim().length>0);return t.length?t.length===1?t[0]:`max(${t.join(", ")})`:null}function mn(e){let t=e.filter(n=>!!n&&n.trim().length>0);return t.length?t.length===1?t[0]:`min(${t.join(", ")})`:null}function ae(e,t){if(e.trim()==="0"||e.trim()==="0px"||t.trim()==="0"||t.trim()==="0px")return "0px";if(t.trim()==="1")return e;let n=Number(t);return Number.isFinite(n)?Me(e,n)??`calc(${e} * ${t})`:`calc(${e} * ${t})`}function Fe(e,t){return t.trim()==="1"?e:`calc(${e} / ${t})`}function Nt(e,t){return t.trim()==="0"||t.trim()==="0px"?e:`calc(${e} - ${t})`}function Bt(e,t){let n=_(t);return !e||!n?e:mn([e,n])}function re(e){let t=_(e?.margin),n=_(e?.marginTop),r=_(e?.marginBottom);return t&&!n&&!r?Me(t,2):!t&&!n&&!r?null:k([n??t??"0px",r??t??"0px"])}function Lt(e){if(e==null)return null;let t=typeof e=="number"?`${e}px`:String(e).trim();if(!t.length)return null;let n=Ct(t);if(!n.length||n.length>4)return null;let[r,i,o,l]=n;return n.length===1?{top:r,right:r,bottom:r,left:r}:n.length===2?{top:r,right:i,bottom:r,left:i}:n.length===3?{top:r,right:i,bottom:o,left:i}:{top:r,right:i,bottom:o,left:l}}function Et(e){return Sn(e?.border)}function fn(e){return Me(Et(e),2)}function pn(e){return Me(Et(e),2)}function V(e){let t=Lt(e?.padding);return t?k([t.top,t.bottom]):null}function Ht(e){let t=Lt(e?.padding);return t?k([t.left,t.right]):null}function be(e){return _(e?.gap)}function xt(e,t){let n=Ht(t);return !n||n==="0px"?e:Nt(e,n)}function ue(e,t=0,n=a){return r(e,t,n)}function De(e,t,n,r,i=0,o=a){let l=ue(e.style,i,o),a=be(l)??"0px",c=Ht(l)??"0px",u=Math.max(1,t|0),s=u>1?ae(a,String(u-1)):"0px",p=`calc(100cqw - ${c} - ${s})`,{itemWrapStyle:S}=Ie(e,n),g=S?.width?_(S.width):null,v;return r==="peek"&&g&&!Ee(g)?v=g:v=Fe(p,String(u)),Bt(v,S?.maxWidth)??v}function gn(e,t,n,r,i=0,o=a){let l=De(e,t,n,r,i,o),{itemWrapStyle:a}=Ie(e,n),c=fn(a);return !c||c==="0px"?l:Nt(l,c)}function hn(e$1,t=0,n=a){let r=e(d(e$1.rowHeightCompensation,n),t);return r==null||!Number.isFinite(r)||r<=0?null:`${r}px`}function It(e,t,n,r=0,i=a){let o=ue(e.style,r,i),l=be(o)??"0px",a=V(o)??"0px",c=hn(e,r,i),u=Math.max(1,t|0),s=e.direction??"row",p=Array.from({length:u},(g,v)=>{let{item:M,itemWrapStyle:W}=Ie(e,v),O=De(e,u,v,n,r,i),N=gn(e,u,v,n,r,i),b=ce(M,N,r,i),y=pn(W),B=re(W),f=k([y,B]),d=null,H=null;if(b&&!Ee(b)&&(H=k([b,y,B])),W){let q=_(W.height);if(q)d=k([q,B]);else {let P=wt(W.aspectRatio);P?d=k([Fe(O,String(P)),B]):d=f;}}return b?d?Ee(b)?d:ve([d,H??b]):b:d}),S=s==="row"?(()=>{let g=e.initialHeightSlot;if(g==null)return ve(p);let v=Math.min(Math.max(0,Math.trunc(g)),Math.max(0,u-1));return p[v]??ve(p)})():k([k(p),u>1?ae(l,String(u-1)):"0px"]);return k([S,a,c])}function Wt(e,t=0,n=a){return k((e.children??[]).map(r=>ce(r,"100cqw",t,n)))}function ce(e,t,n=0,r=a){if(e.kind==="rect"||e.kind==="square"||e.kind==="circle"){let i=q(e.style,n,r),o=_(i?.height),l=wt(i?.aspectRatio);if(o)return k([o,re(i)]);if(l){let a=_(i?.width),c=a&&!Ee(a)?a:t,u=Bt(c,i?.maxWidth)??c,s=String(l),p=Fe(u,s);return k([p,re(i)])}return re(i)??null}if(e.kind==="media"){let i=e.direction??"row",o=ue(e.style,n,r),l=be(o)??"0px",a=Math.max(0,e.count|0),c=xt(t,o),u=e.tile?{kind:e.tile.shape??"rect",style:e.tile.style,shimmer:e.tile.shimmer}:{kind:"rect",style:{width:"100%",height:"100%"}},s=ce(u,c,n,r);return s?i==="row"?k([s,V(o)]):a<=1?k([s,V(o)]):k([ae(s,String(a)),ae(l,String(a-1)),V(o)]):null}if(e.kind==="sliderDots"){let i=ue(e.style,n,r),o=q(e.dotStyle,n,r),l=q(e.activeStyle,n,r),a=q(e.inactiveStyle,n,r),c=[o,l,a].map(s=>k([_(s?.height),re(s)])).filter(s=>!!s),u=ve(c);return u?k([u,V(i)]):V(i)}if(e.kind==="row"||e.kind==="col"||e.kind==="stack"){let i=e.kind==="row"?"row":"col",o=ue(e.style,n,r),l=be(o)??"0px",a=V(o)??"0px",c=xt(t,o),u=e.children.map(s=>ce(s,c,n,r));if(i==="row"){let s=ve(u);return s?k([s,a]):null}else {let s=u.filter(S=>!!S);if(!s.length)return a;let p=s.length>1?ae(l,String(s.length-1)):"0px";return k([k(s)??null,p,a])}}if(e.kind==="text"){let i=q(e.style,n,r),o=d$1({barHeight:g(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,n,r),lineHeight:h(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,n,r),lines:f(e.lines,1,n,r)});return k([`${o.totalHeight}px`,re(i)])}return null}function Mt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;if(!o)return ce(e,"100cqw",r,i);let l=It(o,t,n,r,i),a=Wt(o,r,i);return k([l,a])}function Pt(e,t=0,n=a){let r=e.kind==="slider"?e:null;return r?Wt(r,t,n):null}function Tt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;if(!o||n!=="peek")return null;let l=Math.max(1,t|0);if(l<=1)return null;let a=ue(o.style,r,i),c=be(a)??"0px",u=Array.from({length:l-1},(p,S)=>De(o,l,S+1,n,r,i)),s=l>2?ae(c,String(l-2)):null;return k([...u,s])}function _t(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;return o?It(o,t,n,r,i):ce(e,"100cqw",r,i)}function ie(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "media":case "sliderDots":return;case "text":for(let r of i$1({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:n}))t.add(r);return;case "stack":case "row":case "col":for(let r of e.children)ie(r,t,n);return;case "slider":ie(e.item,t,n);for(let r of e.children??[])ie(r,t,n);for(let r of e.overlays??[])ie(r,t,n);for(let r of e.slots??[])r.item&&ie(r.item,t,n);return;default:return e}}function oe(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":u(e.style,t,n);return;case "media":u(e.tile?.style,t,n);return;case "sliderDots":u(e.dotStyle,t,n),u(e.activeStyle,t,n),u(e.inactiveStyle,t,n);return;case "text":u(e.style,t,n);return;case "stack":case "row":case "col":for(let r of e.children)oe(r,t,n);return;case "slider":oe(e.item,t,n);for(let r of e.children??[])oe(r,t,n);for(let r of e.overlays??[])oe(r,t,n);for(let r of e.slots??[])r.item&&oe(r.item,t,n);return;default:return e}}function Ne(e,t,n=a){u(e,t,n);}function le(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "text":return;case "media":Ne(e.style,t,n);return;case "sliderDots":Ne(e.style,t,n);return;case "stack":case "row":case "col":Ne(e.style,t,n);for(let r of e.children)le(r,t,n);return;case "slider":Ne(e.style,t,n),le(e.item,t,n);for(let r of e.children??[])le(r,t,n);for(let r of e.overlays??[])le(r,t,n);for(let r of e.slots??[])r.item&&le(r.item,t,n);return;default:return e}}function se(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "media":case "sliderDots":case "text":return;case "stack":case "row":case "col":for(let r of e.children)se(r,t,n);return;case "slider":for(let r of d(e.rowHeightCompensation,n))t.add(r.minWidth);se(e.item,t,n);for(let r of e.children??[])se(r,t,n);for(let r of e.overlays??[])se(r,t,n);for(let r of e.slots??[])r.item&&se(r.item,t,n);return;default:return e}}function Ot(e,t=a){let n=new Set;return ie(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function At(e,t=a){let n=new Set;return le(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function $t(e,t=a){let n=new Set;return oe(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Ft(e,t=a){let n=new Set;return se(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Dt({count:e,maxSlots:t$1,activeDotIndex:n$1,rowStyle:r,spec:i,breakpoints:o,centerFirst:l=false,hasLeadingSpacer:a$2=false,responsiveCssScopeSelector:c}){let u=i??yt(),s=C.useMemo(()=>({...a,...o??{}}),[o]),p=u.layout??yt().layout,S=C.useMemo(()=>a$1("ssk_",{breakpoints:s,centerFirst:l,count:e,hasLeadingSpacer:a$2,maxSlots:t$1,rowStyle:r,spec:u}),[l,e,s,a$2,t$1,r,u]),g=C.useMemo(()=>`[data-rmg-slider-skel-scope="${bt(S)}"]`,[S]),v=c??g,M={...r||{},...n(u.shimmer)};u.backgroundColor&&(M["--rmg-skel-bg"]=u.backgroundColor),u.radius!=null&&(M["--rmg-skel-radius"]=m(u.radius));let{layout:W,responsiveCss:O}=C.useMemo(()=>{let T=0,I=()=>`n${++T}`,A=[],Se=ne(p,I,A,s),z=un(v,A);return {layout:Se,responsiveCss:z}},[p,v,s]),N=W,b=N.__rmgNodeId,y=Be(t(N.style,s)),B=N.count!=null?Math.max(0,N.count|0):Math.max(0,e|0),f=N.direction??"row",d=N.children??[],H=N.overlays??[],q=l&&f==="row",P=a$2&&f==="row",Re=N.itemStretch??true,J=Math.max(0,t$1|0),U=u.mode??"fit";return jsxs("div",{"data-rmg-slider-skel-scope":c?void 0:S,"data-rmg-skel-mode":U,"data-rmg-skel-has-extras":d.length?"true":void 0,className:[a$4.sliderSkeletonOverlay,u.className].filter(Boolean).join(" "),style:u.style,"data-rmg-skel-part":"overlay",children:[O?jsx("style",{dangerouslySetInnerHTML:{__html:O}}):null,jsxs("div",{className:a$4.sliderSkeletonLayout,"data-rmg-skel-part":"layout","data-rmg-skel-has-extras":d.length?"true":void 0,children:[jsx("div",{"data-rmg-skel-node":b,className:a$4.sliderSkeletonRow,"data-rmg-skel-part":"row",style:{...M,...y||{},display:"flex",flexDirection:f==="row"?"row":"column",...q?{justifyContent:"center"}:null},children:Array.from({length:J}).map((T,I)=>{let A=P&&I===0,Se=P?I-1:I,z=A?{item:{kind:"rect",style:{width:"100%",height:"100%",backgroundColor:"transparent"},shimmer:{enabled:false}},itemWrapStyle:{width:"var(--rmg-slider-center-first-spacer-width, 0px)",height:0}}:Ie(N,Se),E=z.itemWrapStyle,{outerStyle:$,innerStyle:Ce}=an(E);return jsx("div",{className:a$4.sliderSkeletonItem,"data-rmg-skel-slot":I+1,"data-rmg-skel-visible-count":B,"data-rmg-skel-center-first-spacer":A?"true":void 0,style:{boxSizing:"border-box",...E?He(E):null,...$??null,...f==="col"?{flex:"0 0 auto",height:"auto"}:Re?{height:"100%"}:{alignSelf:"flex-start",height:"auto"},minWidth:0,minHeight:0},children:jsx("div",{className:a$4.sliderSkeletonItemInner,style:{...Ce??null,...f==="row"&&!Re?{height:"auto"}:null},children:jsx(Le,{node:z.item,breakpointMap:s,activeDotIndex:n$1})})},`rmg-slider-skel-${I}`)})}),d.length?jsx("div",{className:a$4.sliderSkeletonExtras,"data-rmg-skel-part":"extras",children:d.map((T,I)=>jsx(Le,{node:T,breakpointMap:s,activeDotIndex:n$1},`rmg-slider-skel-extra-${I}`))}):null]}),H.length?jsx("div",{className:a$4.sliderSkeletonOverlays,"data-rmg-skel-part":"overlays",children:H.map((T,I)=>jsx(Le,{node:T,breakpointMap:s,activeDotIndex:n$1},`rmg-slider-skel-overlay-${I}`))}):null]})}function ze(e){return !!e&&typeof e=="object"&&!("kind"in e)&&"layout"in e&&e.layout?.kind==="slider"}function jt(e){return !!e&&typeof e=="object"&&"kind"in e&&e.kind==="slider"}function kn(e){if(ze(e))return e;let{mode:t,centering:n,className:r,visibleCount:i,backgroundColor:o,radius:l,shimmer:a,...c}=e;return {mode:t,centering:n,className:r,visibleCount:i,backgroundColor:o,radius:l,shimmer:a,layout:c}}function qt(e){if(!e||typeof e!="object"||Array.isArray(e))return {};let t={};for(let[n,r]of Object.entries(e))r!=null&&(typeof r=="string"||typeof r=="number"||typeof r=="boolean")&&(t[n]=r);return t}function de(e,t=[]){return !e||typeof e!="object"?t:e.kind==="sliderDots"?(t.push({activeStyle:qt(e.activeStyle),inactiveStyle:qt(e.inactiveStyle)}),t):e.kind==="slider"?(de(e.item,t),e.children?.forEach?.(n=>de(n,t)),e.overlays?.forEach?.(n=>de(n,t)),e.slots?.forEach?.(n=>de(n.item,t)),t):(e.children?.forEach?.(n=>de(n,t)),t)}function je(e,t,n){return i(e,t,n).reduce((r,i)=>Math.max(r,i.count),0)}function yn(e,t){let n=Math.max(0,Math.floor(e));return n<=0?[]:n===1?t>=2?[2]:[]:Array.from({length:Math.min(t,n+1)},(r,i)=>i+1)}function zt(e){return `[data-rmg-scope="${e}"] > [data-rmg-scope-shell="true"]`}function qe(e){typeof document>"u"||document.querySelectorAll("style[data-rmg-slider-restore-style]").forEach(t=>{t.getAttribute("data-rmg-slider-restore-style")===e&&t.remove();});}function xn(e,t){if(t==null||!Number.isFinite(t)||t<=0)return "";let n=Math.round((t+Number.EPSILON)*1e3)/1e3;return `${zt(e)}{--rmg-slider-initial-height:${n}px!important;--rmg-slider-row-height:${n}px!important;}`}function Kt(e){let t=e.skeletonSpec.layout;if(!t)return "";let n=e.skeletonSpec.mode??"fit",r=zt(e.scopeId),i$1=i(e.responsiveCount,e.fallbackCount,e.breakpointMap),o=Ot(t,e.breakpointMap),l=At(t,e.breakpointMap),a=$t(t,e.breakpointMap),c=Ft(t,e.breakpointMap),u=S=>{let g=e.fallbackCount;for(let v of i$1)S>=v.minWidth&&(g=v.count);return Math.max(1,g|0)},s=(S,g)=>{let v=Mt(t,S,n,g,e.breakpointMap),M=_t(t,S,n,g,e.breakpointMap),W=Pt(t,g,e.breakpointMap),O=e.centerFirstSpacer?Tt(t,S,n,g,e.breakpointMap):null;if(!v&&!M&&!W&&!O)return "";let N=[v?`--rmg-slider-initial-height:${v};`:"",M?`--rmg-slider-row-height:${M};`:"",W?`--rmg-slider-extras-height:${W};`:"",e.centerFirstSpacer?`--rmg-slider-center-first-spacer-width:${O??"0px"};`:""].join("");return `${r}{${N}}`};return Array.from(new Set([...i$1.map(S=>S.minWidth),...a,...l,...o,...c])).sort((S,g)=>S-g).map(S=>{let g=s(u(S),S);return g?S<=0?g:`@media (min-width:${S}px){${g}}`:""}).filter(Boolean).join(`
|
|
39
|
-
`)}function
|
|
40
|
-
`)}}):null,jsx(
|
|
37
|
+
}catch(e){}})();`}function Lt(e){if(e.slideCount<=0||e.skeletonSlotCount<=0)return "";let t=i(e.responsiveCount,e.fallbackCount,e.breakpointMap),n={scopeId:e.scopeId,storageKeyId:e.storageKeyId,ttlMs:e.ttlMs,slideCount:e.slideCount,skeletonSlotCount:e.skeletonSlotCount,maxSlots:e.maxSlots,loop:e.loop,activeSlotOffset:e.activeSlotOffset,countRules:t,dotStyles:e.dotStyles??[],viewportTolerancePx:Rt};return gn(n)}function f(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function Pe(e){if(!e)return {};let t=f(e.margin),n=f(e.marginTop),r=f(e.marginRight),i=f(e.marginBottom),o=f(e.marginLeft),l={};return t!=null&&(l.margin=t),n!=null&&(l.marginTop=n),r!=null&&(l.marginRight=r),i!=null&&(l.marginBottom=i),o!=null&&(l.marginLeft=o),l}function kn(e,t){if(!(!e&&!t))return {...e||{},...t||{}}}function _e(e,t){let n=e.slots?.[t];return {item:n?.item??e.item,itemWrapStyle:kn(e.itemWrapStyle,n?.itemWrapStyle)}}function Oe(e,t){let n$1={};e?.aspectRatio!=null&&(n$1.aspectRatio=e.aspectRatio);let r=f(e?.width),i=f(e?.maxWidth),o=f(e?.height),l=f(e?.maxHeight);return r!=null&&(n$1.inlineSize=r,n$1.width=r),i!=null&&(n$1.maxInlineSize=i,n$1.maxWidth=i),o!=null&&(n$1.height=o),l!=null&&(n$1.maxHeight=l),e?.aspectRatio!=null&&e?.height==null&&(n$1.height="auto"),e?.aspectRatio!=null&&e?.width==null&&e?.height==null&&(n$1.inlineSize="100%",n$1.width="100%",n$1.height="auto"),e?.backgroundColor&&(n$1["--rmg-skel-bg"]=e.backgroundColor),e?.borderRadius!=null&&(n$1["--rmg-skel-radius"]=f(e.borderRadius)),e?.overflow!=null&&(n$1.overflow=e.overflow),e?.alignSelf&&(n$1.alignSelf=e.alignSelf),e?.scale!=null&&(n$1.transform=`scale(${e.scale})`),Object.assign(n$1,n(t)),n$1}function yn(e,t){let n={};t!=null&&(n.height=`${t}px`);let r=f(e?.width),i=f(e?.maxWidth);return r!=null&&(n.inlineSize=r,n.width=r),i!=null&&(n.maxInlineSize=i,n.maxWidth=i),e?.alignSelf&&(n.alignSelf=e.alignSelf),e?.scale!=null&&(n.transform=`scale(${e.scale})`),n}function Ye(e){return typeof e=="string"&&e.trim()==="max-content"}function xn(e){return !e||typeof e!="object"?false:Ye(e.width)?true:Object.values(e).some(n=>!!n&&typeof n=="object"&&Ye(n.width))}function vn(e){let t=Oe(e,void 0);return delete t["--rmg-skel-bg"],e?.backgroundColor!=null&&(t.backgroundColor=e.backgroundColor),e?.border!=null&&(t.border=e.border),e?.boxShadow!=null&&(t.boxShadow=e.boxShadow),e?.borderRadius!=null?(t.borderRadius=f(e.borderRadius),t.overflow=e?.overflow??"hidden"):e?.overflow!=null&&(t.overflow=e.overflow),t.boxSizing="border-box",t}function bn(e){if(!e)return {outerStyle:void 0,innerStyle:void 0};let t=vn(e),n={};return t.boxShadow!=null&&(n["--rmg-slider-skel-wrap-shadow"]=t.boxShadow,delete t.boxShadow),t.borderRadius!=null&&(n["--rmg-slider-skel-wrap-shadow-radius"]=t.borderRadius),{outerStyle:Object.keys(n).length?n:void 0,innerStyle:t}}function We(e){let t={};return e&&(e.position!=null&&(t.position=e.position),e.inset!=null&&(t.inset=f(e.inset)),e.insetBlock!=null&&(t.insetBlock=f(e.insetBlock)),e.insetInline!=null&&(t.insetInline=f(e.insetInline)),e.top!=null&&(t.top=f(e.top)),e.right!=null&&(t.right=f(e.right)),e.bottom!=null&&(t.bottom=f(e.bottom)),e.left!=null&&(t.left=f(e.left)),e.zIndex!=null&&(t.zIndex=e.zIndex),e.gap!=null&&(t.gap=f(e.gap)),e.padding!=null&&(t.padding=f(e.padding)),e.align&&(t.alignItems=e.align),e.justify&&(t.justifyContent=e.justify),e.wrap&&(t.flexWrap="wrap"),e.width!=null&&(t.width=f(e.width)),e.maxWidth!=null&&(t.maxWidth=f(e.maxWidth)),e.height!=null&&(t.height=f(e.height)),e.minHeight!=null&&(t.minHeight=f(e.minHeight)),e.maxHeight!=null&&(t.maxHeight=f(e.maxHeight)),e.backgroundColor!=null&&(t.backgroundColor=e.backgroundColor),e.borderRadius!=null&&(t.borderRadius=f(e.borderRadius)),e.border!=null&&(t.border=e.border),e.boxShadow!=null&&(t.boxShadow=e.boxShadow),e.margin!=null&&(t.margin=f(e.margin)),e.marginTop!=null&&(t.marginTop=f(e.marginTop)),e.marginRight!=null&&(t.marginRight=f(e.marginRight)),e.marginBottom!=null&&(t.marginBottom=f(e.marginBottom)),e.marginLeft!=null&&(t.marginLeft=f(e.marginLeft)),e.flex!=null&&(t.flex=e.flex),e.flexGrow!=null&&(t.flexGrow=e.flexGrow),e.flexShrink!=null&&(t.flexShrink=e.flexShrink),e.flexBasis!=null&&(t.flexBasis=f(e.flexBasis)),e.order!=null&&(t.order=e.order),e.alignSelf!=null&&(t.alignSelf=e.alignSelf),e.overflow!=null&&(t.overflow=e.overflow),e.transform!=null&&(t.transform=e.transform),e.pointerEvents!=null&&(t.pointerEvents=e.pointerEvents),e.opacity!=null&&(t.opacity=e.opacity)),t}function Ge(e){let t=Oe(e,void 0);return delete t["--rmg-skel-bg"],e?.backgroundColor!=null&&(t.backgroundColor=e.backgroundColor),e?.borderRadius!=null&&(t.borderRadius=f(e.borderRadius)),e?.overflow!=null&&(t.overflow=e.overflow),{...t,...Pe(e)}}function Pt(e){return e.replace(/"/g,'\\"')}function ae(e,t,n,r=a){switch(e.kind){case "rect":case "square":case "circle":{let i=x$1({style:e.style,breakpointMap:r});if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "text":{let i=[...k({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,fitContent:xn(e.style),breakpointMap:r}).map(l=>({...l,raw:true})),...y$1({style:e.style,breakpointMap:r})];if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "media":{let i=[...w({style:e.style,breakpointMap:r}),...x$1({style:e.tile?.style,breakpointMap:r,selector:`${b$2} [data-rmg-skel-media-tile="true"]`})];if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "sliderDots":{let i=[...w({style:e.style,breakpointMap:r}),...x$1({style:e.dotStyle,breakpointMap:r,selector:`${b$2} [data-rmg-skel-slider-dot]`}),...x$1({style:e.activeStyle,breakpointMap:r,selector:`${b$2} [data-rmg-skel-dot-active="true"]`}),...x$1({style:e.inactiveStyle,breakpointMap:r,selector:`${b$2} [data-rmg-skel-dot-active="false"]`})];if(!i.length)return e;let o=t();return n.push({nodeId:o,rules:i}),{...e,__rmgNodeId:o}}case "stack":case "row":case "col":{let i=w({style:e.style,breakpointMap:r}),o=i.length?t():void 0;o&&i.length&&n.push({nodeId:o,rules:i});let l=e.children.map(a=>ae(a,t,n,r));return {...e,...o?{__rmgNodeId:o}:null,children:l}}case "slider":{let i=w({style:e.style,breakpointMap:r}),o=i.length?t():void 0;o&&i.length&&n.push({nodeId:o,rules:i});let l=ae(e.item,t,n,r),a=e.children?.map(s=>ae(s,t,n,r)),c=e.overlays?.map(s=>ae(s,t,n,r)),u=e.slots?.map(s=>({...s,item:s.item?ae(s.item,t,n,r):void 0}));return {...e,...o?{__rmgNodeId:o}:null,item:l,children:a,overlays:c,slots:u}}default:return e}}function Rn(e,t){if(!t.length)return "";let n=[];for(let r of t){let i=`${e} [data-rmg-skel-node="${Pt(r.nodeId)}"]`;for(let o of r.rules){let l=o.raw?o.css.split("__NODE_SEL__").join(i):`${i}{${o.css}}`;o.minWidth<=0?n.push(l):n.push(`@media (min-width:${o.minWidth}px){${l}}`);}}return n.join(`
|
|
38
|
+
`)}function Cn(e){if(e.barWidths?.length)return e.barWidths;if(e.lineWidthsPx?.length)return e.lineWidthsPx.map(t=>`${Math.max(0,t)}px`)}function wn(e){return Math.max(1,Math.min(64,Math.trunc(e)))}function Y(e,t,n=a){if(!t)return e;if(e.kind==="text"){let r=e.textId?t[e.textId]:void 0;if(!r)return e;let i=wn(r.lines),o=Cn(r),l=typeof r.barHeight=="number"&&Number.isFinite(r.barHeight)?r.barHeight:typeof e.barHeight=="number"?e.barHeight:g(e.barHeight,0,0,n),a=typeof r.lineHeight=="number"&&Number.isFinite(r.lineHeight)?r.lineHeight:typeof e.lineHeight=="number"?e.lineHeight:h(e.lineHeight,1,0,n);return {...e,barHeight:l,lineHeight:a,lines:i,...o?.length?{barWidth:o}:null,lastBarWidth:o?.[Math.min(i,o.length)-1]??e.lastBarWidth}}return e.kind==="media"||e.kind==="sliderDots"?e:e.kind==="slider"?{...e,item:Y(e.item,t,n),children:e.children?.map(r=>Y(r,t,n)),overlays:e.overlays?.map(r=>Y(r,t,n)),slots:e.slots?.map(r=>({...r,item:r.item?Y(r.item,t,n):r.item}))}:e.kind==="stack"||e.kind==="row"||e.kind==="col"?{...e,children:e.children.map(r=>Y(r,t,n))}:e}function Q(e,t=new Set){return e?e.kind==="text"?(e.textId&&t.add(e.textId),t):e.kind==="media"||e.kind==="sliderDots"?t:e.kind==="slider"?(Q(e.item,t),e.children?.forEach(n=>Q(n,t)),e.overlays?.forEach(n=>Q(n,t)),e.slots?.forEach(n=>Q(n.item,t)),t):((e.kind==="stack"||e.kind==="row"||e.kind==="col")&&e.children.forEach(n=>Q(n,t)),t):t}function It(e){let{kind:t,style:n,shimmer:r,breakpointMap:i,mediaTile:o}=e,l={},a=s(n,i),c=e.__rmgNodeId;return t==="circle"&&(l.borderRadius="9999px"),t==="square"&&a?.aspectRatio==null&&(l.aspectRatio="1"),a?.aspectRatio!=null&&a?.height==null&&(l.height="auto"),jsx("div",{"data-rmg-skel-node":c,"data-rmg-skel-media-tile":o?"true":void 0,className:a$4.sliderSkeleton,style:{...Oe(a,r),...Pe(a),...l}})}function Nn({node:e,breakpointMap:t}){let n=j({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:t}),r=s(e.style,t),i=n.states.some(({state:s})=>s.lineCount!==n.baseState.lineCount||s.metrics.totalHeight!==n.baseState.metrics.totalHeight||s.metrics.barHeight!==n.baseState.metrics.barHeight||s.metrics.paddingBlock!==n.baseState.metrics.paddingBlock||s.metrics.rowGap!==n.baseState.metrics.rowGap),o=n.states.some(({state:s})=>s.lineCount!==n.baseState.lineCount||s.barWidths.length!==n.baseState.barWidths.length||s.barWidths.some((S,m)=>S!==n.baseState.barWidths[m])),l=e.__rmgNodeId,a=yn(r,i?void 0:n.metrics.totalHeight),c={height:n.metrics.barHeight,backgroundColor:r?.backgroundColor,borderRadius:r?.borderRadius},u=Ye(r?.width);return jsx("div",{"data-rmg-skel-node":l,"data-rmg-skel-text":"true","data-rmg-skel-text-id":e.textId,className:a$4.sliderSkeletonText,style:{...a,...Pe(r),...i?null:{paddingBlock:`${n.metrics.paddingBlock}px`,rowGap:`${n.metrics.rowGap}px`}},children:Array.from({length:n.maxLines}).map((s,S)=>jsx("div",{"data-rmg-skel-text-line":"true",className:[a$4.sliderSkeleton,a$4.sliderSkeletonTextLine].join(" "),style:{...Oe(c,e.shimmer),...o?null:{display:S>=n.baseLines?"none":void 0,width:u?n.baseState.barWidths[S]??"100%":"100%",maxWidth:n.baseState.barWidths[S]??"100%"}}},S))})}function Me({node:e,breakpointMap:t$1,activeDotIndex:n$1}){switch(e.kind){case "rect":case "square":case "circle":return jsx(It,{...e,breakpointMap:t$1});case "media":{let r=Math.max(0,e.count|0),i=e.direction??"row",o=e.tile?.shape??"rect",l=e.__rmgNodeId,a=We(t(e.style,t$1));return jsx("div",{"data-rmg-skel-node":l,className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:i==="row"?"row":"column",...a||{}},children:Array.from({length:r}).map((c,u)=>jsx(It,{kind:o,style:e.tile?.style,shimmer:e.tile?.shimmer,breakpointMap:t$1,mediaTile:true},u))})}case "sliderDots":{let r=Math.max(0,e.count|0),i=e.__rmgNodeId,o=We(t(e.style,t$1)),l=Ge(s(e.dotStyle,t$1)),a=Ge(s(e.activeStyle,t$1)),c=Ge(s(e.inactiveStyle,t$1)),u=typeof n$1=="number"&&Number.isFinite(n$1)?Math.max(0,Math.min(r-1,Math.floor(n$1))):0;return jsx("div",{"data-rmg-skel-node":i,"data-rmg-skel-slider-dots":"true","data-rmg-skel-dot-active-style":JSON.stringify(a),"data-rmg-skel-dot-inactive-style":JSON.stringify(c),className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:"row",...o||{}},children:Array.from({length:r}).map((s,S)=>{let m=S===u;return jsx("div",{"data-rmg-skel-slider-dot":S,"data-rmg-skel-dot-active":m?"true":"false",className:a$4.sliderSkeleton,style:{...n(e.shimmer),...l,...m?a:c}},S)})})}case "stack":case "row":case "col":{let r=e.kind==="row"?"row":"column",i=e.__rmgNodeId,o=We(t(e.style,t$1));return jsx("div",{"data-rmg-skel-node":i,className:a$4.sliderSkeletonGroup,style:{display:"flex",flexDirection:r,...o||{}},children:e.children.map((l,a)=>jsx(Me,{node:l,breakpointMap:t$1,activeDotIndex:n$1},a))})}case "text":return jsx(Nn,{node:e,breakpointMap:t$1});default:return null}}function Wt(){return {layout:{kind:"slider",direction:"row",item:{kind:"rect",style:{width:"100%",height:"100%",borderRadius:2}},itemWrapStyle:void 0},radius:12}}function Te(e){return /%$/.test(e.trim())}function _t(e){let t=e.trim();if(!t.length)return null;if(t==="0")return {value:0,unit:"px"};let n=t.match(/^(\d+(?:\.\d+)?|\.\d+)([a-zA-Z]+)$/);if(!n)return null;let r=Number(n[1]);return !Number.isFinite(r)||r<0?null:{value:r,unit:n[2]}}function Ot(e){let t=[],n="",r=0;for(let i of e.trim()){if(/\s/.test(i)&&r===0){n&&(t.push(n),n="");continue}n+=i,i==="("?r+=1:i===")"&&(r=Math.max(0,r-1));}return n&&t.push(n),t}function Bn(e){let t=e.trim();return t.length?t==="0"?"0px":/^(?:var|calc|min|max|clamp)\(.+\)$/i.test(t)||_t(t)?t:null:null}function Hn(e){if(e==null)return null;if(typeof e=="number")return Number.isFinite(e)&&e>=0?e===0?"0px":`${e}px`:null;for(let t of Ot(String(e))){let n=Bn(t);if(n)return n}return null}function _(e){return e==null?null:typeof e=="number"?`${e}px`:String(e)}function Ae(e,t){if(!e)return null;if(t===0)return "0px";if(e==="0px")return e;let n=_t(e);return n?`${n.value*t}${n.unit}`:`calc(${e} * ${t})`}function At(e){if(e==null)return null;if(typeof e=="number")return e>0?e:null;let t=String(e).trim(),n=t.match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(n){let i=Number(n[1]),o=Number(n[2]);return i>0&&o>0?i/o:null}let r=Number(t);return Number.isFinite(r)&&r>0?r:null}function y(e){let t=e.filter(r=>!!r&&r.trim().length>0);if(!t.length)return null;let n=t.filter(r=>{let i=r.trim();return i!=="0"&&i!=="0px"});return n.length?n.length===1?n[0]:`calc(${n.join(" + ")})`:"0px"}function Ne(e){let t=e.filter(n=>!!n&&n.trim().length>0);return t.length?t.length===1?t[0]:`max(${t.join(", ")})`:null}function En(e){let t=e.filter(n=>!!n&&n.trim().length>0);return t.length?t.length===1?t[0]:`min(${t.join(", ")})`:null}function fe(e,t){if(e.trim()==="0"||e.trim()==="0px"||t.trim()==="0"||t.trim()==="0px")return "0px";if(t.trim()==="1")return e;let n=Number(t);return Number.isFinite(n)?Ae(e,n)??`calc(${e} * ${t})`:`calc(${e} * ${t})`}function Ve(e,t){return t.trim()==="1"?e:`calc(${e} / ${t})`}function $t(e,t){return t.trim()==="0"||t.trim()==="0px"?e:`calc(${e} - ${t})`}function Ft(e,t){let n=_(t);return !e||!n?e:En([e,n])}function ue(e){let t=_(e?.margin),n=_(e?.marginTop),r=_(e?.marginBottom);return t&&!n&&!r?Ae(t,2):!t&&!n&&!r?null:y([n??t??"0px",r??t??"0px"])}function Dt(e){if(e==null)return null;let t=typeof e=="number"?`${e}px`:String(e).trim();if(!t.length)return null;let n=Ot(t);if(!n.length||n.length>4)return null;let[r,i,o,l]=n;return n.length===1?{top:r,right:r,bottom:r,left:r}:n.length===2?{top:r,right:i,bottom:r,left:i}:n.length===3?{top:r,right:i,bottom:o,left:i}:{top:r,right:i,bottom:o,left:l}}function jt(e){return Hn(e?.border)}function Ln(e){return Ae(jt(e),2)}function In(e){return Ae(jt(e),2)}function Z(e){let t=Dt(e?.padding);return t?y([t.top,t.bottom]):null}function qt(e){let t=Dt(e?.padding);return t?y([t.left,t.right]):null}function Be(e){return _(e?.gap)}function Mt(e,t){let n=qt(t);return !n||n==="0px"?e:$t(e,n)}function pe(e,t=0,n=a){return r(e,t,n)}function Xe(e,t,n,r,i=0,o=a){let l=pe(e.style,i,o),a=Be(l)??"0px",c=qt(l)??"0px",u=Math.max(1,t|0),s=u>1?fe(a,String(u-1)):"0px",S=`calc(100cqw - ${c} - ${s})`,{itemWrapStyle:m}=_e(e,n),p=m?.width?_(m.width):null,b;return r==="peek"&&p&&!Te(p)?b=p:b=Ve(S,String(u)),Ft(b,m?.maxWidth)??b}function Wn(e,t,n,r,i=0,o=a){let l=Xe(e,t,n,r,i,o),{itemWrapStyle:a}=_e(e,n),c=Ln(a);return !c||c==="0px"?l:$t(l,c)}function Mn(e$1,t=0,n=a){let r=e(d(e$1.rowHeightCompensation,n),t);return r==null||!Number.isFinite(r)||r<=0?null:`${r}px`}function Kt(e,t,n,r=0,i=a){let o=pe(e.style,r,i),l=Be(o)??"0px",a=Z(o)??"0px",c=Mn(e,r,i),u=Math.max(1,t|0),s=e.direction??"row",S=Array.from({length:u},(p,b)=>{let{item:P,itemWrapStyle:E}=_e(e,b),F=Xe(e,u,b,n,r,i),O=Wn(e,u,b,n,r,i),w=he(P,O,r,i),N=In(E),g=ue(E),M=y([N,g]),L=null,I=null;if(w&&!Te(w)&&(I=y([w,N,g])),E){let D=_(E.height);if(D)L=y([D,g]);else {let A=At(E.aspectRatio);A?L=y([Ve(F,String(A)),g]):L=M;}}return w?L?Te(w)?L:Ne([L,I??w]):w:L}),m=s==="row"?(()=>{let p=e.initialHeightSlot;if(p==null)return Ne(S);let b=Math.min(Math.max(0,Math.trunc(p)),Math.max(0,u-1));return S[b]??Ne(S)})():y([y(S),u>1?fe(l,String(u-1)):"0px"]);return y([m,a,c])}function zt(e,t=0,n=a){return y((e.children??[]).map(r=>he(r,"100cqw",t,n)))}function he(e,t,n=0,r=a){if(e.kind==="rect"||e.kind==="square"||e.kind==="circle"){let i=q(e.style,n,r),o=_(i?.height),l=At(i?.aspectRatio);if(o)return y([o,ue(i)]);if(l){let a=_(i?.width),c=a&&!Te(a)?a:t,u=Ft(c,i?.maxWidth)??c,s=String(l),S=Ve(u,s);return y([S,ue(i)])}return ue(i)??null}if(e.kind==="media"){let i=e.direction??"row",o=pe(e.style,n,r),l=Be(o)??"0px",a=Math.max(0,e.count|0),c=Mt(t,o),u=e.tile?{kind:e.tile.shape??"rect",style:e.tile.style,shimmer:e.tile.shimmer}:{kind:"rect",style:{width:"100%",height:"100%"}},s=he(u,c,n,r);return s?i==="row"?y([s,Z(o)]):a<=1?y([s,Z(o)]):y([fe(s,String(a)),fe(l,String(a-1)),Z(o)]):null}if(e.kind==="sliderDots"){let i=pe(e.style,n,r),o=q(e.dotStyle,n,r),l=q(e.activeStyle,n,r),a=q(e.inactiveStyle,n,r),c=[o,l,a].map(s=>y([_(s?.height),ue(s)])).filter(s=>!!s),u=Ne(c);return u?y([u,Z(i)]):Z(i)}if(e.kind==="row"||e.kind==="col"||e.kind==="stack"){let i=e.kind==="row"?"row":"col",o=pe(e.style,n,r),l=Be(o)??"0px",a=Z(o)??"0px",c=Mt(t,o),u=e.children.map(s=>he(s,c,n,r));if(i==="row"){let s=Ne(u);return s?y([s,a]):null}else {let s=u.filter(m=>!!m);if(!s.length)return a;let S=s.length>1?fe(l,String(s.length-1)):"0px";return y([y(s)??null,S,a])}}if(e.kind==="text"){let i=q(e.style,n,r),o=d$1({barHeight:g(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,n,r),lineHeight:h(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,n,r),lines:f$2(e.lines,1,n,r)});return y([`${o.totalHeight}px`,ue(i)])}return null}function Gt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;if(!o)return he(e,"100cqw",r,i);let l=Kt(o,t,n,r,i),a=zt(o,r,i);return y([l,a])}function Yt(e,t=0,n=a){let r=e.kind==="slider"?e:null;return r?zt(r,t,n):null}function Vt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;if(!o||n!=="peek")return null;let l=Math.max(1,t|0);if(l<=1)return null;let a=pe(o.style,r,i),c=Be(a)??"0px",u=Array.from({length:l-1},(S,m)=>Xe(o,l,m+1,n,r,i)),s=l>2?fe(c,String(l-2)):null;return y([...u,s])}function Xt(e,t,n,r=0,i=a){let o=e.kind==="slider"?e:null;return o?Kt(o,t,n,r,i):he(e,"100cqw",r,i)}function ce(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "media":case "sliderDots":return;case "text":for(let r of i$1({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:n}))t.add(r);return;case "stack":case "row":case "col":for(let r of e.children)ce(r,t,n);return;case "slider":ce(e.item,t,n);for(let r of e.children??[])ce(r,t,n);for(let r of e.overlays??[])ce(r,t,n);for(let r of e.slots??[])r.item&&ce(r.item,t,n);return;default:return e}}function de(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":u(e.style,t,n);return;case "media":u(e.tile?.style,t,n);return;case "sliderDots":u(e.dotStyle,t,n),u(e.activeStyle,t,n),u(e.inactiveStyle,t,n);return;case "text":u(e.style,t,n);return;case "stack":case "row":case "col":for(let r of e.children)de(r,t,n);return;case "slider":de(e.item,t,n);for(let r of e.children??[])de(r,t,n);for(let r of e.overlays??[])de(r,t,n);for(let r of e.slots??[])r.item&&de(r.item,t,n);return;default:return e}}function Ie(e,t,n=a){u(e,t,n);}function Se(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "text":return;case "media":Ie(e.style,t,n);return;case "sliderDots":Ie(e.style,t,n);return;case "stack":case "row":case "col":Ie(e.style,t,n);for(let r of e.children)Se(r,t,n);return;case "slider":Ie(e.style,t,n),Se(e.item,t,n);for(let r of e.children??[])Se(r,t,n);for(let r of e.overlays??[])Se(r,t,n);for(let r of e.slots??[])r.item&&Se(r.item,t,n);return;default:return e}}function me(e,t,n=a){switch(e.kind){case "rect":case "square":case "circle":case "media":case "sliderDots":case "text":return;case "stack":case "row":case "col":for(let r of e.children)me(r,t,n);return;case "slider":for(let r of d(e.rowHeightCompensation,n))t.add(r.minWidth);me(e.item,t,n);for(let r of e.children??[])me(r,t,n);for(let r of e.overlays??[])me(r,t,n);for(let r of e.slots??[])r.item&&me(r.item,t,n);return;default:return e}}function Jt(e,t=a){let n=new Set;return ce(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Ut(e,t=a){let n=new Set;return Se(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Zt(e,t=a){let n=new Set;return de(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function Qt(e,t=a){let n=new Set;return me(e,n,t),Array.from(n).filter(r=>r>0).sort((r,i)=>r-i)}function en({count:e,maxSlots:t$1,activeDotIndex:n$1,rowStyle:r,spec:i,breakpoints:o,centerFirst:l=false,hasLeadingSpacer:a$2=false,responsiveCssScopeSelector:c,cacheSnapshot:u}){let s=i??Wt(),S=x.useMemo(()=>({...a,...o??{}}),[o]),m=x.useMemo(()=>{let d=s.layout??Wt().layout;return u?.text?Y(d,u.text,S):d},[u,S,s.layout]),p=x.useMemo(()=>a$1("ssk_",{breakpoints:S,centerFirst:l,count:e,hasLeadingSpacer:a$2,maxSlots:t$1,rowStyle:r,spec:s}),[l,e,S,a$2,t$1,r,s]),b=x.useMemo(()=>`[data-rmg-slider-skel-scope="${Pt(p)}"]`,[p]),P=c??b,E={...r||{},...n(s.shimmer)};s.backgroundColor&&(E["--rmg-skel-bg"]=s.backgroundColor),s.radius!=null&&(E["--rmg-skel-radius"]=f(s.radius));let{layout:F,responsiveCss:O}=x.useMemo(()=>{let d=0,R=()=>`n${++d}`,j=[],q=ae(m,R,j,S),te=Rn(P,j);return {layout:q,responsiveCss:te}},[m,P,S]),w=F,N=w.__rmgNodeId,g=We(t(w.style,S)),M=w.count!=null?Math.max(0,w.count|0):Math.max(0,e|0),L=w.direction??"row",I=w.children??[],D=w.overlays??[],A=l&&L==="row",W=a$2&&L==="row",h=w.itemStretch??true,He=Math.max(0,t$1|0),Ee=s.mode??"fit";return jsxs("div",{"data-rmg-slider-skel-scope":c?void 0:p,"data-rmg-skel-mode":Ee,"data-rmg-skel-has-extras":I.length?"true":void 0,className:[a$4.sliderSkeletonOverlay,s.className].filter(Boolean).join(" "),style:s.style,"data-rmg-skel-part":"overlay",children:[O?jsx("style",{dangerouslySetInnerHTML:{__html:O}}):null,jsxs("div",{className:a$4.sliderSkeletonLayout,"data-rmg-skel-part":"layout","data-rmg-skel-has-extras":I.length?"true":void 0,children:[jsx("div",{"data-rmg-skel-node":N,className:a$4.sliderSkeletonRow,"data-rmg-skel-part":"row",style:{...E,...g||{},display:"flex",flexDirection:L==="row"?"row":"column",...A?{justifyContent:"center"}:null},children:Array.from({length:He}).map((d,R)=>{let j=W&&R===0,q=W?R-1:R,te=j?{item:{kind:"rect",style:{width:"100%",height:"100%",backgroundColor:"transparent"},shimmer:{enabled:false}},itemWrapStyle:{width:"var(--rmg-slider-center-first-spacer-width, 0px)",height:0}}:_e(w,q),K=te.itemWrapStyle,{outerStyle:ne,innerStyle:ke}=bn(K);return jsx("div",{className:a$4.sliderSkeletonItem,"data-rmg-skel-slot":R+1,"data-rmg-skel-visible-count":M,"data-rmg-skel-center-first-spacer":j?"true":void 0,style:{boxSizing:"border-box",...K?Pe(K):null,...ne??null,...L==="col"?{flex:"0 0 auto",height:"auto"}:h?{height:"100%"}:{alignSelf:"flex-start",height:"auto"},minWidth:0,minHeight:0},children:jsx("div",{className:a$4.sliderSkeletonItemInner,style:{...ke??null,...L==="row"&&!h?{height:"auto"}:null},children:jsx(Me,{node:te.item,breakpointMap:S,activeDotIndex:n$1})})},`rmg-slider-skel-${R}`)})}),I.length?jsx("div",{className:a$4.sliderSkeletonExtras,"data-rmg-skel-part":"extras",children:I.map((d,R)=>jsx(Me,{node:d,breakpointMap:S,activeDotIndex:n$1},`rmg-slider-skel-extra-${R}`))}):null]}),D.length?jsx("div",{className:a$4.sliderSkeletonOverlays,"data-rmg-skel-part":"overlays",children:D.map((d,R)=>jsx(Me,{node:d,breakpointMap:S,activeDotIndex:n$1},`rmg-slider-skel-overlay-${R}`))}):null]})}function Ze(e){return !!e&&typeof e=="object"&&!("kind"in e)&&"layout"in e&&e.layout?.kind==="slider"}function tn(e){return !!e&&typeof e=="object"&&"kind"in e&&e.kind==="slider"}function Tn(e){if(Ze(e))return e;let{mode:t,centering:n,className:r,visibleCount:i,backgroundColor:o,radius:l,shimmer:a,...c}=e;return {mode:t,centering:n,className:r,visibleCount:i,backgroundColor:o,radius:l,shimmer:a,layout:c}}function nn(e){if(!e||typeof e!="object"||Array.isArray(e))return {};let t={};for(let[n,r]of Object.entries(e))r!=null&&(typeof r=="string"||typeof r=="number"||typeof r=="boolean")&&(t[n]=r);return t}function ge(e,t=[]){return !e||typeof e!="object"?t:e.kind==="sliderDots"?(t.push({activeStyle:nn(e.activeStyle),inactiveStyle:nn(e.inactiveStyle)}),t):e.kind==="slider"?(ge(e.item,t),e.children?.forEach?.(n=>ge(n,t)),e.overlays?.forEach?.(n=>ge(n,t)),e.slots?.forEach?.(n=>ge(n.item,t)),t):(e.children?.forEach?.(n=>ge(n,t)),t)}function Je(e,t,n){return i(e,t,n).reduce((r,i)=>Math.max(r,i.count),0)}function Pn(e,t){let n=Math.max(0,Math.floor(e));return n<=0?[]:n===1?t>=2?[2]:[]:Array.from({length:Math.min(t,n+1)},(r,i)=>i+1)}function rn(e){return `[data-rmg-scope="${e}"] > [data-rmg-scope-shell="true"]`}function Ue(e){typeof document>"u"||document.querySelectorAll("style[data-rmg-slider-restore-style]").forEach(t=>{t.getAttribute("data-rmg-slider-restore-style")===e&&t.remove();});}function _n(e,t){if(t==null||!Number.isFinite(t)||t<=0)return "";let n=Math.round((t+Number.EPSILON)*1e3)/1e3;return `${rn(e)}{--rmg-slider-initial-height:${n}px!important;--rmg-slider-row-height:${n}px!important;}`}function on(e){let t=e.skeletonSpec.layout;if(!t)return "";let n=e.skeletonSpec.mode??"fit",r=rn(e.scopeId),i$1=i(e.responsiveCount,e.fallbackCount,e.breakpointMap),o=Jt(t,e.breakpointMap),l=Ut(t,e.breakpointMap),a=Zt(t,e.breakpointMap),c=Qt(t,e.breakpointMap),u=m=>{let p=e.fallbackCount;for(let b of i$1)m>=b.minWidth&&(p=b.count);return Math.max(1,p|0)},s=(m,p)=>{let b=Gt(t,m,n,p,e.breakpointMap),P=Xt(t,m,n,p,e.breakpointMap),E=Yt(t,p,e.breakpointMap),F=e.centerFirstSpacer?Vt(t,m,n,p,e.breakpointMap):null;if(!b&&!P&&!E&&!F)return "";let O=[b?`--rmg-slider-initial-height:${b};`:"",P?`--rmg-slider-row-height:${P};`:"",E?`--rmg-slider-extras-height:${E};`:"",e.centerFirstSpacer?`--rmg-slider-center-first-spacer-width:${F??"0px"};`:""].join("");return `${r}{${O}}`};return Array.from(new Set([...i$1.map(m=>m.minWidth),...a,...l,...o,...c])).sort((m,p)=>m-p).map(m=>{let p=s(u(m),m);return p?m<=0?p:`@media (min-width:${m}px){${p}}`:""}).filter(Boolean).join(`
|
|
39
|
+
`)}function Qe({layout:e,children:t,breakpoints:n$1,className:r,style:i,shellClassName:o,shellStyle:l$1,contentClassName:a$4,contentStyle:c$1,backgroundColor:u,radius:s,shimmer:S,disableShimmer:m,ariaLabel:p,ready:b$2,enabled:P,force:E,timing:F,restore:O,cache:w}){let N=x.useMemo(()=>({...a,...n$1??{}}),[n$1]),g=x.useMemo(()=>a$1("skel_",{layout:e,breakpoints:N,backgroundColor:u,radius:s,shimmer:S,disableShimmer:m}),[e,N,u,s,S,m]),M=x.useMemo(()=>tn(e)||Ze(e)?Tn(e):null,[e]),L=b(),I=c(w,L),D=x.useMemo(()=>Array.from(Q(M?.layout)),[M]),A=f$1(I?.snapshot,{key:I?.key,scopeId:g,kind:"slider",routeKey:I?.routeKey,ttlMs:I?.ttlMs,textIds:D}),W=x.useMemo(()=>!A?.text||!M?.layout?M:{...M,layout:Y(M.layout,A.text,N)},[N,M,A]),h=W?.layout?.kind==="slider"?W.layout:null,He=x.useRef(null),Ee=x.useRef(null);a$2({cache:I,kind:"slider",scopeId:g,textIds:D,skeletonRootRef:He,shellRef:Ee});let d=O?.kind==="slider"?O:null,R=d?.slider?.handleRef??null,j=d&&d.enabled!==false&&d.slider?.handleRef?[d.key??"",d.itemCount,JSON.stringify(d.visibleCount??null),d.loop===true?"loop":"no-loop",d.activeSlotOffset??""].join(":"):"",q=j!=="",[te,K]=x.useState(()=>!q),[ne,ke]=x.useState(null),[et,$e]=x.useState(null),ln=b$2===true&&(!q||te),tt=!!h,T=d?.visibleCount??(tn(e)?e.visibleCount:void 0)??(Ze(e)?e.visibleCount:void 0)??(typeof h?.count=="number"?h.count:void 0),V=typeof T=="number"?Math.max(1,T|0):typeof h?.count=="number"?Math.max(1,h.count|0):1,nt=!!h&&W?.centering==="first"&&(W?.mode??"fit")==="peek",X=nt&&Je(T,V,N)>1,ye=Array.isArray(h?.slots)&&h.slots.length>0?h.slots.length:Math.max(d?.itemCount??0,typeof h?.count=="number"?h.count:0,V),xe=h?Math.max(12,X?ye+1:ye,X?Je(T,V,N)+1:Je(T,V,N)):0,B=x.useMemo(()=>{if(!d||d.enabled===false||!tt)return null;let v=Math.max(0,Math.floor(d.itemCount));return v<=0||ye<=0?null:{enabled:true,storageKeyId:typeof d.key=="string"&&d.key.trim()?d.key.trim():g,ttlMs:typeof d.ttlMs=="number"&&Number.isFinite(d.ttlMs)?Math.max(0,d.ttlMs):bt,slideCount:v,skeletonSlotCount:Math.max(v,ye)}},[tt,g,d?.enabled,d?.itemCount,d?.key,d?.ttlMs,ye]),J=x.useMemo(()=>h?a$3({scopeId:g,responsiveCount:T,fallbackCount:V,breakpointMap:N,maxSlots:xe,visibleSlotsForCount:X?Pn:void 0,slotOrderForCount:ne==null||!B?.enabled||!d?void 0:v=>Et({activeIndex:ne,visibleCount:v,slotCount:B.skeletonSlotCount,loop:d.loop===true,activeSlotOffset:d.activeSlotOffset??(typeof h.initialHeightSlot=="number"?h.initialHeightSlot:0)})}):{cssText:"",ssrBaseCount:V},[N,g,X,V,h,xe,d,ne,B,T]),rt=x.useMemo(()=>!h||!W?"":on({scopeId:g,skeletonSpec:W,responsiveCount:T,fallbackCount:J.ssrBaseCount,breakpointMap:N,centerFirstSpacer:X}),[N,g,X,J.ssrBaseCount,h,W,T]),it=x.useMemo(()=>!B?.enabled||!d||!h?"":Lt({scopeId:g,storageKeyId:B.storageKeyId,ttlMs:B.ttlMs,slideCount:B.slideCount,skeletonSlotCount:B.skeletonSlotCount,maxSlots:xe,loop:d.loop===true,activeSlotOffset:d.activeSlotOffset??(typeof h.initialHeightSlot=="number"?h.initialHeightSlot:0),responsiveCount:T,fallbackCount:J.ssrBaseCount,breakpointMap:N,dotStyles:ge(h)}),[N,g,J.ssrBaseCount,h,xe,d?.activeSlotOffset,d?.enabled,d?.loop,B,T]),ot=x.useMemo(()=>_n(g,et),[g,et]),Fe=x.useRef(null);x.useLayoutEffect(()=>{K(!q),ke(null),$e(null);},[q,j]),x.useLayoutEffect(()=>{if(!B?.enabled||!R||typeof window>"u")return;let v=null,$=false,ve=()=>{if($)return;let U=R.current;if(!U){v=window.requestAnimationFrame(ve);return}let z=Bt(B,window,{requireNavigationRestore:false});if(!z){Ue(g),ke(null),$e(null),K(true);return}ke(z.index),$e(z.heightPx??null),Ue(g);let je=[B.storageKeyId,z.timestamp,z.index,z.heightPx??""].join(":");if(Fe.current!==je&&U.setIndex(z.index,"instant"),Fe.current===je){K(true);return}if(!U.isReady()){v=window.requestAnimationFrame(ve);return}if(!R.current?.isReady()){v=window.requestAnimationFrame(ve);return}Fe.current=je,v=window.requestAnimationFrame(()=>{v=null,!$&&(R.current?.setIndex(z.index,"instant"),v=window.requestAnimationFrame(()=>{v=null,!$&&(v=window.requestAnimationFrame(()=>{v=null,$||K(true);}));}));});};return ve(),()=>{$=true,v!=null&&window.cancelAnimationFrame(v),Ue(g);}},[g,R,B]),x.useEffect(()=>{if(!B?.enabled||!R||typeof window>"u")return;let v=()=>{let $=R.current;if(!$)return;let U=$.getViewportNode()?.getBoundingClientRect().height;Ht(B,{index:$.getIndex(),slideCount:B.slideCount,skeletonSlotCount:B.skeletonSlotCount,heightPx:U&&U>0?U:void 0});};return window.addEventListener("pagehide",v),window.addEventListener("beforeunload",v),()=>{v(),window.removeEventListener("pagehide",v),window.removeEventListener("beforeunload",v);}},[R,B]);let sn={position:"relative",width:"100%",minWidth:0,minHeight:"var(--rmg-slider-initial-height, var(--rmg-slider-height, 320px))",overflow:"hidden",...i,...u?{"--rmg-skel-bg":u}:null,...s!=null?{"--rmg-skel-radius":l(s)}:null,...m?null:n(S)},De=h&&W?jsxs("div",{"data-rmg-skeleton-scope":g,ref:He,className:r,style:sn,"aria-hidden":p?void 0:true,"aria-label":p,role:p?"status":void 0,"aria-live":p?"polite":void 0,children:[J.cssText||rt||ot?jsx("style",{dangerouslySetInnerHTML:{__html:[J.cssText,rt,ot].filter(Boolean).join(`
|
|
40
|
+
`)}}):null,jsx(en,{count:J.ssrBaseCount,maxSlots:xe,activeDotIndex:ne??void 0,spec:W,breakpoints:N,centerFirst:nt,hasLeadingSpacer:X,responsiveCssScopeSelector:`[data-rmg-scope="${g}"]`,cacheSnapshot:A}),it?jsx("script",{dangerouslySetInnerHTML:{__html:it}}):null]}):null,lt={containerType:"inline-size",width:"100%"},an=h?{minHeight:"var(--rmg-slider-initial-height, var(--rmg-slider-height, 320px))"}:null;return De?t===void 0?jsx("div",{"data-rmg-scope":g,style:lt,children:jsx("div",{"data-rmg-scope-shell":"true",style:{minHeight:"var(--rmg-slider-initial-height, var(--rmg-slider-height, 320px))"},children:De})}):jsx("div",{"data-rmg-scope":g,style:lt,children:jsx(b$1,{skeletonNode:De,ready:ln,enabled:P,force:E,timing:F,shellClassName:o,shellStyle:l$1,loadingShellStyle:an,contentClassName:a$4,contentStyle:c$1,contentOwnsWrapperLayout:true,shellDataAttributes:{"data-rmg-scope-shell":"true"},shellRef:Ee,children:t})}):null}export{Qe as Skeleton,Qe as SliderSkeleton,on as buildScopedInitialHeightCss,Qe as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-motion-gallery",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.39",
|
|
4
4
|
"description": "Composable React media gallery primitives for sliders, grids, masonry, fullscreen, video, zoom/pan, and stable skeleton loading",
|
|
5
5
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
6
6
|
"author": "React Motion Gallery",
|
|
@@ -142,6 +142,14 @@
|
|
|
142
142
|
"types": "./dist/skeleton-base.d.mts",
|
|
143
143
|
"import": "./dist/skeleton-base.mjs"
|
|
144
144
|
},
|
|
145
|
+
"./skeleton/cache": {
|
|
146
|
+
"types": "./dist/skeleton-cache.d.mts",
|
|
147
|
+
"import": "./dist/skeleton-cache.mjs"
|
|
148
|
+
},
|
|
149
|
+
"./skeleton/cache/provider": {
|
|
150
|
+
"types": "./dist/skeleton-cache-provider.d.mts",
|
|
151
|
+
"import": "./dist/skeleton-cache-provider.mjs"
|
|
152
|
+
},
|
|
145
153
|
"./skeleton/slider": {
|
|
146
154
|
"types": "./dist/skeleton-slider.d.mts",
|
|
147
155
|
"import": "./dist/skeleton-slider.mjs"
|
package/dist/chunk-4BTS6IIA.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-HK2DPKES.mjs';import {jsx}from'react/jsx-runtime';var h={skelRect:"ge",skelSquare:"ce",skelCircle:"pe",skelGroup:"he",skelRow:"fe",skelCol:"be",skelStack:"ve",skelText:"B",skelTextLine:"ue",skelTile:"ye",skelCardShimmer:"p",rmgSharedSkeletonShimmer:"h",skelShimmer:"C"};var R="68%",W="__NODE_SEL__",se="(font: -apple-system-body) and (-webkit-hyphens: none)";function ae(e){let n=Math.max(1,Math.trunc(e.lines??1)),t=Math.max(0,e.barHeight*e.lineHeight),o=Math.min(Math.max(0,e.barHeight),t),r=Math.max(t-o,0);return {lines:n,lineBoxHeight:t,barHeight:o,leading:r,paddingBlock:r/2,rowGap:r,totalHeight:t*n}}function L(e){let n=Math.max(e.barHeight,Math.floor(e.lineBoxHeight)),t=Math.max(n-e.barHeight,0);return {...e,lineBoxHeight:n,leading:t,paddingBlock:t/2,rowGap:t,totalHeight:n*e.lines}}function v(e,n=a$1){return !e||typeof e!="object"||Array.isArray(e)?false:Object.keys(e).some(t=>S(t,n)!=null)}function k(e,n){let t=Number.isFinite(e)?Math.trunc(e):n;return Math.max(1,t)}function C(e,n){let t=Number.isFinite(e)?Number(e):n;return Math.max(0,t)}function w(e,n){let t=Number.isFinite(e)?Number(e):n;return Math.max(0,t)}function S(e,n=a$1){let t=n[e];if(Number.isFinite(t))return Math.max(0,t);let o=Number(e);return Number.isFinite(o)?Math.max(0,o):null}function c(e){return typeof e=="number"?`${e}px`:e}function b(e){return Array.isArray(e)?e.map(c):c(e)}function le(e){let{barWidths:n,lineCount:t,finalBarWidthFallback:o}=e;return t<=0?[o]:n.length>=t?n.slice(0,t):Array.from({length:t},(r,i)=>i<n.length?n[i]:i===t-1?o:"100%")}function z(e){let n=ce(e.lines,1,e.minWidth,e.breakpointMap),t=ge(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,e.minWidth,e.breakpointMap),o=Se(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,e.minWidth,e.breakpointMap),r=ke(e.lastBarWidth,R,e.minWidth,e.breakpointMap),i=xe(e.barWidth,"100%",e.minWidth,e.breakpointMap),s=e.barWidth==null?Array.from({length:n},(l,u)=>u===n-1?r:"100%"):Array.isArray(i)?i:Array.from({length:n},()=>i);return {lineCount:n,barWidths:le({barWidths:s,lineCount:n,finalBarWidthFallback:e.barWidth==null?r:"100%"}),metrics:ae({barHeight:t,lineHeight:o,lines:n})}}function ue(e,n){return e.lineCount===n.lineCount&&e.metrics.totalHeight===n.metrics.totalHeight&&e.metrics.barHeight===n.metrics.barHeight&&e.metrics.paddingBlock===n.metrics.paddingBlock&&e.metrics.rowGap===n.metrics.rowGap&&e.barWidths.length===n.barWidths.length&&e.barWidths.every((t,o)=>t===n.barWidths[o])}function de(e,n=a$1){return v(e,n)}function pe(e,n=a$1){return v(e,n)}function he(e,n=a$1){return v(e,n)}function me(e,n=a$1){return v(e,n)}function fe(e,n=a$1){return v(e,n)}function A(e,n=1,t=a$1){if(!de(e,t))return [{minWidth:0,lines:k(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,lines:k(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lines=i.lines:r.push(i),r},[]);return o.length===0?[{minWidth:0,lines:k(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lines:k(void 0,n)}),o)}function E(e,n=0,t=a$1){if(!pe(e,t))return [{minWidth:0,barHeight:C(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,barHeight:C(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.barHeight=i.barHeight:r.push(i),r},[]);return o.length===0?[{minWidth:0,barHeight:C(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,barHeight:o[0].barHeight}),o)}function G(e,n=1,t=a$1){if(!he(e,t))return [{minWidth:0,lineHeight:w(typeof e=="number"?e:void 0,n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null?null:{minWidth:s,lineHeight:w(typeof i=="number"?i:Number(i),n)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lineHeight=i.lineHeight:r.push(i),r},[]);return o.length===0?[{minWidth:0,lineHeight:w(void 0,n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lineHeight:o[0].lineHeight}),o)}function ce(e,n=1,t=0,o=a$1){let r=A(e,n,o),i=r[0]?.lines??k(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.lines);return i}function ge(e,n=0,t=0,o=a$1){let r=E(e,n,o),i=r[0]?.barHeight??C(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.barHeight);return i}function Se(e,n=1,t=0,o=a$1){let r=G(e,n,o),i=r[0]?.lineHeight??w(void 0,n);for(let s of r)t>=s.minWidth&&(i=s.lineHeight);return i}function xe(e,n="100%",t=0,o=a$1){let r=O(e,n,o),i=r[0]?.barWidth??b(n);for(let s of r)t>=s.minWidth&&(i=s.barWidth);return i}function O(e,n="100%",t=a$1){if(!me(e,t))return [{minWidth:0,barWidth:b(e??n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null||i==null?null:{minWidth:s,barWidth:b(i)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.barWidth=i.barWidth:r.push(i),r},[]);return o.length===0?[{minWidth:0,barWidth:b(n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,barWidth:b(n)}),o)}function D(e,n=R,t=a$1){if(!fe(e,t))return [{minWidth:0,lastBarWidth:c(e??n)}];let o=Object.entries(e).map(([r,i])=>{let s=S(r,t);return s==null||i==null?null:{minWidth:s,lastBarWidth:c(i)}}).filter(r=>!!r).sort((r,i)=>r.minWidth-i.minWidth).reduce((r,i)=>{let s=r[r.length-1];return s&&s.minWidth===i.minWidth?s.lastBarWidth=i.lastBarWidth:r.push(i),r},[]);return o.length===0?[{minWidth:0,lastBarWidth:c(n)}]:(o[0].minWidth>0&&o.unshift({minWidth:0,lastBarWidth:c(n)}),o)}function ke(e,n=R,t=0,o=a$1){let r=D(e,n,o),i=r[0]?.lastBarWidth??c(n);for(let s of r)t>=s.minWidth&&(i=s.lastBarWidth);return i}function be(e){let n=new Set,t=e.breakpointMap??a$1;for(let r of E(e.barHeight,typeof e.barHeight=="number"?e.barHeight:0,t))n.add(r.minWidth);for(let r of A(e.lines,1,t))n.add(r.minWidth);for(let r of G(e.lineHeight,typeof e.lineHeight=="number"?e.lineHeight:1,t))n.add(r.minWidth);let o=e.barWidth!=null?O(e.barWidth,"100%",t):D(e.lastBarWidth,R,t);for(let r of o)n.add(r.minWidth);return Array.from(n).sort((r,i)=>r-i)}function H(e){let n=e.breakpointMap??a$1,t=e.responsiveBy??"viewport",r=be({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,breakpointMap:n}).reduce((l,u)=>{let p=z({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,minWidth:u,breakpointMap:n}),m=l[l.length-1];return m&&ue(m.state,p)||l.push({minWidth:u,state:p}),l},[]),i=r[0]?.state??z({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,minWidth:0,breakpointMap:n}),s=r.reduce((l,u)=>Math.max(l,u.state.lineCount),i.lineCount);return {baseState:i,states:r.length?r:[{minWidth:0,state:i}],maxLines:s,usesResponsiveBarCss:r.length>1,baseLines:i.lineCount,baseLastBarWidth:i.barWidths[i.lineCount-1]??R,metrics:i.metrics,responsiveBy:t}}function F(e){let n="renderState"in e?e.renderState:H({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,responsiveBy:e.responsiveBy,breakpointMap:e.breakpointMap});if(!n.usesResponsiveBarCss)return [];let t=e.selectorPlaceholder??W,o=e.fitContent===true;return n.states.map(({minWidth:r,state:i})=>{let s=`${t} [data-rmg-skel-text-line="true"]`,l=`${s}:nth-child(-n+${i.lineCount})`,u=i.lineCount<n.maxLines?`${s}:nth-child(n+${i.lineCount+1})`:null,p=i.barWidths.map((g,y)=>o?`${s}:nth-child(${y+1}){width:${g} !important;max-width:${g} !important;}`:`${s}:nth-child(${y+1}){max-width:${g} !important;}`),m=o?`${l}{display:block !important;max-width:100% !important;}`:`${l}{display:block !important;width:100% !important;max-width:100% !important;}`,x=L(i.metrics);return {minWidth:r,query:n.responsiveBy,css:[`${t}{height:${i.metrics.totalHeight}px !important;padding-block:${i.metrics.paddingBlock}px !important;row-gap:${i.metrics.rowGap}px !important;}`,`@supports ${se}{${t}{height:${x.totalHeight}px !important;padding-block:${x.paddingBlock}px !important;row-gap:${x.rowGap}px !important;}}`,`${s}{display:none !important;height:${i.metrics.barHeight}px !important;}`,m,...u?[`${u}{display:none !important;}`]:[],...p].join("")}})}function V(e){return !!e&&typeof e=="object"&&!Array.isArray(e)}function Re(e,n=a$1){let t=n[e];if(Number.isFinite(t))return Math.max(0,t);let o=Number(e);return Number.isFinite(o)?Math.max(0,o):null}function B(e,n=a$1){if(!V(e))return {baseStyle:e,rules:[]};let t={},o=new Map;for(let[r,i]of Object.entries(e)){let s=Re(r,n);if(s!=null&&V(i)){o.set(s,{...o.get(s)??{},...i});continue}t[r]=i;}return {baseStyle:Object.keys(t).length?t:void 0,rules:Array.from(o.entries()).sort((r,i)=>r[0]-i[0]).map(([r,i])=>({minWidth:r,style:i}))}}function P(e,n,t=a$1){let{baseStyle:o,rules:r}=B(e,t),i={...o??{}};for(let s of r){if(s.minWidth>n)break;Object.assign(i,s.style);}return Object.keys(i).length?i:void 0}function J(e,n=a$1){let{baseStyle:t,rules:o}=B(e,n);if(!t)return;if(!o.length)return t;let r=new Set;for(let s of o)for(let l of Object.keys(s.style))r.add(l);let i={};for(let[s,l]of Object.entries(t))r.has(s)||(i[s]=l);return Object.keys(i).length?i:void 0}function Y(e,n,t=a$1){let{rules:o}=B(e,t);for(let r of o)r.minWidth>0&&n.add(r.minWidth);}function ee(e){let n=e.breakpointMap??a$1,t=e.selector??W,o=[],{rules:r}=B(e.value,n);if(!r.length)return [];let i=new Set([0]);for(let s of r)i.add(s.minWidth);for(let s of Array.from(i).sort((l,u)=>l-u)){let l=P(e.value,s,n),u=l?e.serialize(l):"";u&&o.push({minWidth:s,css:`${t}{${u}}`,raw:true});}return o}function a(e){if(e!=null)return typeof e=="number"?`${e}px`:e}function ne(e){if(!e)return {};let n=a(e.margin),t=a(e.marginTop),o=a(e.marginRight),r=a(e.marginBottom),i=a(e.marginLeft),s={};return n!=null&&(s.margin=n),t!=null&&(s.marginTop=t),o!=null&&(s.marginRight=o),r!=null&&(s.marginBottom=r),i!=null&&(s.marginLeft=i),s}function _(e,n){n&&(n.flex!=null&&(e.flex=n.flex),n.flexGrow!=null&&(e.flexGrow=n.flexGrow),n.flexShrink!=null&&(e.flexShrink=n.flexShrink),n.flexBasis!=null&&(e.flexBasis=a(n.flexBasis)),n.order!=null&&(e.order=n.order),n.alignSelf&&(e.alignSelf=n.alignSelf),n.boxSizing!=null&&(e.boxSizing=n.boxSizing));}function j(e,n){n&&(n.flex!=null&&e.push(`flex:${n.flex};`),n.flexGrow!=null&&e.push(`flex-grow:${n.flexGrow};`),n.flexShrink!=null&&e.push(`flex-shrink:${n.flexShrink};`),n.flexBasis!=null&&e.push(`flex-basis:${a(n.flexBasis)};`),n.order!=null&&e.push(`order:${n.order};`),n.alignSelf&&e.push(`align-self:${n.alignSelf};`),n.boxSizing!=null&&e.push(`box-sizing:${n.boxSizing};`));}function te(e,n){let t={};e?.aspectRatio!=null&&(t.aspectRatio=e.aspectRatio);let o=a(e?.width),r=a(e?.minWidth),i=a(e?.maxWidth),s=a(e?.height),l=a(e?.minHeight),u=a(e?.maxHeight);return o!=null&&(t.inlineSize=o,t.width=o),r!=null&&(t.minInlineSize=r,t.minWidth=r),i!=null&&(t.maxInlineSize=i,t.maxWidth=i),s!=null&&(t.height=s),l!=null&&(t.minHeight=l),u!=null&&(t.maxHeight=u),e?.aspectRatio!=null&&e?.height==null&&(t.height="auto"),e?.aspectRatio!=null&&e?.width==null&&e?.height==null&&(t.inlineSize="100%",t.width="100%",t.height="auto"),e?.backgroundColor&&(t["--rmg-skel-bg"]=e.backgroundColor),e?.borderRadius!=null&&(t["--rmg-skel-radius"]=a(e.borderRadius)),e?.overflow!=null&&(t.overflow=e.overflow),_(t,e),e?.scale!=null&&(t.transform=`scale(${e.scale})`),Object.assign(t,Te(n)),t}function I(e,n){let t=a(n?.margin),o=a(n?.marginTop),r=a(n?.marginRight),i=a(n?.marginBottom),s=a(n?.marginLeft);t!=null&&e.push(`margin:${t};`),o!=null&&e.push(`margin-top:${o};`),r!=null&&e.push(`margin-right:${r};`),i!=null&&e.push(`margin-bottom:${i};`),s!=null&&e.push(`margin-left:${s};`);}function We(e){if(!e)return "";let n=[],t=a(e.width),o=a(e.minWidth),r=a(e.maxWidth),i=a(e.height),s=a(e.minHeight),l=a(e.maxHeight);return e.aspectRatio!=null&&n.push(`aspect-ratio:${String(e.aspectRatio)};`),t!=null&&(n.push(`inline-size:${t};`),n.push(`width:${t};`)),o!=null&&(n.push(`min-inline-size:${o};`),n.push(`min-width:${o};`)),r!=null&&(n.push(`max-inline-size:${r};`),n.push(`max-width:${r};`)),i!=null&&n.push(`height:${i};`),s!=null&&n.push(`min-height:${s};`),l!=null&&n.push(`max-height:${l};`),e.aspectRatio!=null&&e.height==null&&n.push("height:auto;"),e.aspectRatio!=null&&e.width==null&&e.height==null&&(n.push("inline-size:100%;"),n.push("width:100%;"),n.push("height:auto;")),e.backgroundColor&&n.push(`--rmg-skel-bg:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`--rmg-skel-radius:${a(e.borderRadius)};`),e.overflow!=null&&n.push(`overflow:${e.overflow};`),j(n,e),e.scale!=null&&n.push(`transform:scale(${e.scale});`),I(n,e),n.join("")}function ve(e){if(!e)return "";let n=[],t=a(e.width),o=a(e.minWidth),r=a(e.maxWidth);return t!=null&&(n.push(`inline-size:${t};`),n.push(`width:${t};`)),o!=null&&(n.push(`min-inline-size:${o};`),n.push(`min-width:${o};`)),r!=null&&(n.push(`max-inline-size:${r};`),n.push(`max-width:${r};`)),j(n,e),e.scale!=null&&n.push(`transform:scale(${e.scale});`),I(n,e),n.join("")}function Be(e){if(!e)return "";let n=[];return e.backgroundColor&&n.push(`--rmg-skel-bg:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`--rmg-skel-radius:${a(e.borderRadius)};`),n.join("")}function Te(e,n){let t={},o=n?.enabledVarName??"--rmg-skel-shimmer-enabled";return e?.enabled===false&&(t[o]="0"),e?.durationMs!=null&&(t["--rmg-skel-shimmer-duration"]=`${e.durationMs}ms`),e?.angleDeg!=null&&(t["--rmg-skel-shimmer-angle"]=`${e.angleDeg}deg`),e?.opacity!=null&&(t["--rmg-skel-shimmer-opacity"]=String(e.opacity)),e?.blurPx!=null&&(t["--rmg-skel-shimmer-blur"]=`${e.blurPx}px`,t["--rmg-skel-shimmer-filter"]=e.blurPx>0?`blur(${e.blurPx}px)`:"none"),e?.timing&&(t["--rmg-skel-shimmer-timing"]=e.timing),e?.c1&&(t["--rmg-skel-shimmer-c1"]=e.c1),e?.c2&&(t["--rmg-skel-shimmer-c2"]=e.c2),e?.c3&&(t["--rmg-skel-shimmer-c3"]=e.c3),t}function q(e,n){let t={};n!=null&&(t.height=`${n}px`);let o=a(e?.width),r=a(e?.minWidth),i=a(e?.maxWidth);return o!=null&&(t.inlineSize=o,t.width=o),r!=null&&(t.minInlineSize=r,t.minWidth=r),i!=null&&(t.maxInlineSize=i,t.maxWidth=i),_(t,e),e?.scale!=null&&(t.transform=`scale(${e.scale})`),t}function N(e){return typeof e=="string"&&e.trim()==="max-content"}function Ce(e){return !e||typeof e!="object"?false:N(e.width)?true:Object.values(e).some(t=>!!t&&typeof t=="object"&&N(t.width))}function Ae(e){let n=te(e,void 0);return delete n["--rmg-skel-bg"],e?.backgroundColor!=null&&(n.backgroundColor=e.backgroundColor),e?.padding!=null&&(n.padding=a(e.padding)),e?.border!=null&&(n.border=e.border),e?.boxShadow!=null&&(n.boxShadow=e.boxShadow),e?.borderRadius!=null?(n.borderRadius=a(e.borderRadius),n.overflow=e?.overflow??"hidden"):e?.overflow!=null&&(n.overflow=e.overflow),n.boxSizing="border-box",n}function K(e){let n={};return e&&(e.position!=null&&(n.position=e.position),e.inset!=null&&(n.inset=a(e.inset)),e.insetBlock!=null&&(n.insetBlock=a(e.insetBlock)),e.insetInline!=null&&(n.insetInline=a(e.insetInline)),e.top!=null&&(n.top=a(e.top)),e.right!=null&&(n.right=a(e.right)),e.bottom!=null&&(n.bottom=a(e.bottom)),e.left!=null&&(n.left=a(e.left)),e.zIndex!=null&&(n.zIndex=e.zIndex),e.display!=null&&(n.display=e.display),e.flexDirection!=null&&(n.flexDirection=e.flexDirection),e.gap!=null&&(n.gap=a(e.gap)),e.rowGap!=null&&(n.rowGap=a(e.rowGap)),e.columnGap!=null&&(n.columnGap=a(e.columnGap)),e.padding!=null&&(n.padding=a(e.padding)),(e.align??e.alignItems)&&(n.alignItems=e.alignItems??e.align),e.alignContent!=null&&(n.alignContent=e.alignContent),(e.justify??e.justifyContent)&&(n.justifyContent=e.justifyContent??e.justify),e.aspectRatio!=null&&(n.aspectRatio=e.aspectRatio),e.flexWrap!=null?n.flexWrap=e.flexWrap:e.wrap&&(n.flexWrap="wrap"),e.width!=null&&(n.width=a(e.width)),e.minWidth!=null&&(n.minWidth=a(e.minWidth)),e.maxWidth!=null&&(n.maxWidth=a(e.maxWidth)),e.height!=null&&(n.height=a(e.height)),e.minHeight!=null&&(n.minHeight=a(e.minHeight)),e.maxHeight!=null&&(n.maxHeight=a(e.maxHeight)),e.aspectRatio!=null&&e.height==null&&(n.height="auto"),e.backgroundColor!=null&&(n.backgroundColor=e.backgroundColor),e.borderRadius!=null&&(n.borderRadius=a(e.borderRadius)),e.border!=null&&(n.border=e.border),e.boxShadow!=null&&(n.boxShadow=e.boxShadow),e.margin!=null&&(n.margin=a(e.margin)),e.marginTop!=null&&(n.marginTop=a(e.marginTop)),e.marginRight!=null&&(n.marginRight=a(e.marginRight)),e.marginBottom!=null&&(n.marginBottom=a(e.marginBottom)),e.marginLeft!=null&&(n.marginLeft=a(e.marginLeft)),_(n,e),e.overflow!=null&&(n.overflow=e.overflow),e.transform!=null&&(n.transform=e.transform),e.pointerEvents!=null&&(n.pointerEvents=e.pointerEvents),e.opacity!=null&&(n.opacity=e.opacity)),n}function we(e,n=a$1){return B(e,n).rules.length>0}function He(e,n=0,t=a$1){return P(e,n,t)}function Ee(e,n=0,t=a$1){return P(e,n,t)}function ie(e,n=a$1){return J(e,n)}function X(e,n=a$1){return J(e,n)}function Ge(e,n,t=a$1){Y(e,n,t);}function U(e){return e.replace(/"/g,'\\"')}function ye(e){let n=[];return e.position!=null&&n.push(`position:${e.position};`),e.inset!=null&&n.push(`inset:${a(e.inset)};`),e.insetBlock!=null&&n.push(`inset-block:${a(e.insetBlock)};`),e.insetInline!=null&&n.push(`inset-inline:${a(e.insetInline)};`),e.top!=null&&n.push(`top:${a(e.top)};`),e.right!=null&&n.push(`right:${a(e.right)};`),e.bottom!=null&&n.push(`bottom:${a(e.bottom)};`),e.left!=null&&n.push(`left:${a(e.left)};`),e.zIndex!=null&&n.push(`z-index:${e.zIndex};`),e.display!=null&&n.push(`display:${e.display};`),e.flexDirection!=null&&n.push(`flex-direction:${e.flexDirection};`),e.gap!=null&&n.push(`gap:${a(e.gap)};`),e.rowGap!=null&&n.push(`row-gap:${a(e.rowGap)};`),e.columnGap!=null&&n.push(`column-gap:${a(e.columnGap)};`),e.padding!=null&&n.push(`padding:${a(e.padding)};`),(e.align??e.alignItems)&&n.push(`align-items:${e.alignItems??e.align};`),e.alignContent!=null&&n.push(`align-content:${e.alignContent};`),(e.justify??e.justifyContent)&&n.push(`justify-content:${e.justifyContent??e.justify};`),e.aspectRatio!=null&&n.push(`aspect-ratio:${String(e.aspectRatio)};`),e.flexWrap!=null?n.push(`flex-wrap:${e.flexWrap};`):e.wrap&&n.push("flex-wrap:wrap;"),e.width!=null&&n.push(`width:${a(e.width)};`),e.minWidth!=null&&n.push(`min-width:${a(e.minWidth)};`),e.maxWidth!=null&&n.push(`max-width:${a(e.maxWidth)};`),e.height!=null&&n.push(`height:${a(e.height)};`),e.minHeight!=null&&n.push(`min-height:${a(e.minHeight)};`),e.maxHeight!=null&&n.push(`max-height:${a(e.maxHeight)};`),e.aspectRatio!=null&&e.height==null&&n.push("height:auto;"),e.backgroundColor!=null&&n.push(`background-color:${e.backgroundColor};`),e.borderRadius!=null&&n.push(`border-radius:${a(e.borderRadius)};`),e.border!=null&&n.push(`border:${e.border};`),e.boxShadow!=null&&n.push(`box-shadow:${e.boxShadow};`),I(n,e),j(n,e),e.overflow!=null&&n.push(`overflow:${e.overflow};`),e.transform!=null&&n.push(`transform:${e.transform};`),e.pointerEvents!=null&&n.push(`pointer-events:${e.pointerEvents};`),e.opacity!=null&&n.push(`opacity:${e.opacity};`),n.join("")}function $(e){return ee({value:e.style,breakpointMap:e.breakpointMap,selector:e.selector,serialize:ye})}function Q(e){return ee({value:e.style,breakpointMap:e.breakpointMap,selector:e.selector,serialize:We})}function Le(e){let n=e.breakpointMap??a$1;if(!we(e.style,n))return [];let t=e.selector??W,o=[],r=new Set([0]);Y(e.style,r,n);for(let i of Array.from(r).sort((s,l)=>s-l)){let s=He(e.style,i,n),l=ve(s),u=Be(s),p=[l?`${t}{${l}}`:"",u?`${t} [data-rmg-skel-text-line="true"]{${u}}`:""].filter(Boolean).join("");p&&o.push({minWidth:i,css:p,raw:true});}return o}function M(e,n,t,o,r=a$1){if(e.kind===o){let i=e,s=$({style:i.style,breakpointMap:r}),l=s.length?n():void 0;l&&s.length&&t.push({nodeId:l,rules:s});let u=M(i.item,n,t,o,r),p=Array.isArray(i.slots)?i.slots.map(m=>({...m,item:m?.item?M(m.item,n,t,o,r):m?.item})):void 0;return {...i,...l?{__rmgNodeId:l}:null,item:u,...p?{slots:p}:null}}switch(e.kind){case "rect":case "square":case "circle":{let i=e,s=Q({style:i.style,breakpointMap:r});if(!s.length)return e;let l=n();return t.push({nodeId:l,rules:s}),{...i,__rmgNodeId:l}}case "text":{let i=e,s=i.__rmgTextRenderState??H({barHeight:i.barHeight,barWidth:i.barWidth,lineHeight:i.lineHeight,lines:i.lines,lastBarWidth:i.lastBarWidth,responsiveBy:i.responsiveBy,breakpointMap:r}),l=[...F({renderState:s,fitContent:Ce(i.style)}).map(p=>({...p,raw:true})),...Le({style:i.style,breakpointMap:r})];if(!l.length&&!i.__rmgTextRenderState)return e;let u=l.length?n():void 0;return u&&l.length&&t.push({nodeId:u,rules:l}),{...i,...u?{__rmgNodeId:u}:null,__rmgTextRenderState:s}}case "media":{let i=e,s=[...$({style:i.style,breakpointMap:r}),...Q({style:i.tile?.style,breakpointMap:r,selector:`${W} [data-rmg-skel-media-tile="true"]`})];if(!s.length)return e;let l=n();return t.push({nodeId:l,rules:s}),{...e,__rmgNodeId:l}}case "stack":case "row":case "col":{let i=e,s=$({style:i.style,breakpointMap:r}),l=s.length?n():void 0;l&&s.length&&t.push({nodeId:l,rules:s});let u=i.children.map(p=>M(p,n,t,o,r));return {...i,...l?{__rmgNodeId:l}:null,children:u}}default:return e}}function Oe(e){if(!e.rules.length)return "";let n=`[${e.scopeAttr}="${U(e.scopeId)}"]`,t=[];for(let o of e.rules){let r=`${n} [data-rmg-skel-node="${U(o.nodeId)}"]`;for(let i of o.rules){let s=i.raw?i.css.split("__NODE_SEL__").join(r):`${r}{${i.css}}`;i.minWidth<=0?t.push(s):i.query==="container"?t.push(`@container (min-width:${i.minWidth}px){${s}}`):t.push(`@media (min-width:${i.minWidth}px){${s}}`);}}return t.join(`
|
|
2
|
-
`)}function re(e,n,t){return te(e,t?void 0:n)}function Z(e){let{kind:n,style:t,shimmer:o,disableShimmer:r,breakpointMap:i,mediaTile:s}=e,l=n==="circle"?h.skelCircle:n==="square"?h.skelSquare:h.skelRect,u=ie(t,i),p=e.__rmgNodeId;return jsx("div",{"data-rmg-skel-node":p,"data-rmg-skel-media-tile":s?"true":void 0,className:[h.skelTile,l,r?null:h.skelShimmer].filter(Boolean).join(" "),style:{...re(u,o,r),...ne(u)}})}function $e({node:e,disableShimmer:n,breakpointMap:t}){let o=e.__rmgTextRenderState??H({barHeight:e.barHeight,barWidth:e.barWidth,lineHeight:e.lineHeight,lines:e.lines,lastBarWidth:e.lastBarWidth,responsiveBy:e.responsiveBy,breakpointMap:t}),r=ie(e.style,t),i=e.__rmgNodeId,s=o.responsiveBy==="container"&&o.usesResponsiveBarCss,l=L(o.baseState.metrics),u=q(s?void 0:r,o.baseState.metrics.totalHeight),p=ne(r),m={height:o.baseState.metrics.barHeight,backgroundColor:r?.backgroundColor,borderRadius:r?.borderRadius},x=N(r?.width),g=jsx("div",{"data-rmg-skel-node":i,"data-rmg-skel-text":"true",className:h.skelText,style:{...u,...s?null:p,paddingBlock:`${o.baseState.metrics.paddingBlock}px`,rowGap:`${o.baseState.metrics.rowGap}px`,"--rmg-skel-text-safari-height":`${l.totalHeight}px`,"--rmg-skel-text-safari-padding-block":`${l.paddingBlock}px`,"--rmg-skel-text-safari-row-gap":`${l.rowGap}px`},children:Array.from({length:o.maxLines}).map((y,T)=>jsx("div",{"data-rmg-skel-text-line":"true",className:[h.skelTile,n?null:h.skelShimmer,h.skelTextLine].filter(Boolean).join(" "),style:{...re(m,e.shimmer,n),display:T>=o.baseState.lineCount?"none":void 0,width:x?o.baseState.barWidths[T]??"100%":"100%",maxWidth:o.baseState.barWidths[T]??"100%"}},T))});return s?jsx("div",{"data-rmg-skel-text-container":"true",style:{...q(r),...p,containerType:"inline-size"},children:g}):g}function Me({node:e,disableShimmer:n,breakpointMap:t}){let o=t??a$1;switch(e.kind){case "rect":case "square":case "circle":return jsx(Z,{...e,disableShimmer:n,breakpointMap:o});case "media":{let r=Math.max(0,e.count|0),i=e.direction??"row",s=e.tile?.shape??"rect",l=e.__rmgNodeId,u=K(X(e.style,o));return jsx("div",{"data-rmg-skel-node":l,className:[h.skelGroup,i==="row"?h.skelRow:h.skelCol].join(" "),style:u,children:Array.from({length:r}).map((p,m)=>jsx(Z,{kind:s,style:e.tile?.style,shimmer:e.tile?.shimmer,disableShimmer:n,breakpointMap:o,mediaTile:true},m))})}case "stack":case "row":case "col":{let r=e.kind==="row"?h.skelRow:e.kind==="col"?h.skelCol:h.skelStack,i=e.__rmgNodeId,s=K(X(e.style,o));return jsx("div",{"data-rmg-skel-node":i,className:[h.skelGroup,r].join(" "),style:s,children:e.children.map((l,u)=>jsx(Me,{node:l,disableShimmer:n,breakpointMap:o},u))})}case "text":return jsx($e,{node:e,disableShimmer:n,breakpointMap:o});default:return null}}export{Oe as A,Me as B,h as a,W as b,se as c,ae as d,L as e,ce as f,ge as g,Se as h,be as i,H as j,F as k,a as l,ne as m,Te as n,Ae as o,K as p,He as q,Ee as r,ie as s,X as t,Ge as u,U as v,$ as w,Q as x,Le as y,M as z};
|
package/dist/chunk-4ZOW533S.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {A,z,n,l,B}from'./chunk-4BTS6IIA.mjs';import {a as a$1,d as d$1,e,b,c}from'./chunk-Z34PSRMG.mjs';import {a as a$3}from'./chunk-UUAWLGWO.mjs';import {a}from'./chunk-LVYED5ZM.mjs';import {a as a$2}from'./chunk-HK2DPKES.mjs';import*as d from'react';import {jsx,Fragment,jsxs}from'react/jsx-runtime';var o={shell:"Ue",contentLayer:"y",loadingLayer:"x",contentLayerVisible:"Ve",contentLayerBlocked:"We",loadingLayerOverlay:"er",loadingLayerCompare:"rr",loadingLayerExit:"ir"};function O(...e){return e.filter(Boolean).join(" ")}function Q({skeletonNode:e$1,children:S,ready:v,enabled:c$1=true,force:u,timing:R,shellClassName:M,shellStyle:N,loadingShellStyle:b$1,contentClassName:p,contentStyle:y,contentOwnsWrapperLayout:a$2,loadingLayerFirst:s,contentWrapper:i,shellDataAttributes:w}){let f=S!==void 0,x=a(),m=v===true,r=a$1(u),n=f&&c$1&&(r.enabled||!m),l=d.useMemo(()=>d$1({prefersReducedMotion:x,timing:R}),[x,R]),{showLoadingLayer:C,loadingExiting:k}=e({loadingActive:n,exitMs:l.exitMs,minVisibleMs:l.minVisibleMs}),t=d.useMemo(()=>b({loadingActive:n,loadingForced:u,contentReady:m}),[m,u,n]),P=d.useMemo(()=>c({exitMs:l.exitMs,compareMode:t.compareMode,loadingLayerOpacity:t.loadingLayerOpacity,opacityVarName:"--rmg-standalone-skeleton-opacity"}),[l.exitMs,t.compareMode,t.loadingLayerOpacity]);if(!f)return jsx(Fragment,{children:e$1});let L=c$1&&C,h=!c$1||t.compareMode||k||!L,T=c$1&&t.contentBlocked&&!k&&!a$2,G=i?i(S):S,B=L?jsx("div",{className:O(o.loadingLayer,a$2&&o.loadingLayerOverlay,t.compareMode&&o.loadingLayerCompare,k&&o.loadingLayerExit),style:P,"data-rmg-skeleton-loading-layer":"true",children:e$1}):null;return jsxs("div",{className:O(o.shell,M),style:{...L?b$1:null,...N},"aria-busy":n?true:void 0,"data-rmg-skeleton-wrapper":"true","data-rmg-skeleton-ready":m?"true":"false","data-rmg-skeleton-compare":t.compareMode?"true":"false","data-rmg-skeleton-layout-owner":a$2?"content":"skeleton",...w,children:[s?B:null,jsx("div",{className:O(o.contentLayer,h&&o.contentLayerVisible,T&&o.contentLayerBlocked,p),style:{"--rmg-loading-fade-duration":`${l.exitMs}ms`,...y},"aria-hidden":h?void 0:true,"data-rmg-skeleton-content-layer":"true",children:G}),s?null:B]})}function ie({layout:e,children:S,breakpoints:v,className:c,style:u,shellClassName:R,shellStyle:M,contentClassName:N,contentStyle:b,backgroundColor:p,radius:y,shimmer:a,disableShimmer:s,ariaLabel:i,ready:w,enabled:f,force:x,timing:m}){let r=d.useMemo(()=>({...a$2,...v??{}}),[v]),n$1=d.useMemo(()=>a$3("skel_",{layout:e,breakpoints:r,backgroundColor:p,radius:y,shimmer:a,disableShimmer:s}),[e,r,p,y,a,s]),{layout:l$1,responsiveCss:C}=d.useMemo(()=>{let P=0,L=()=>`n${++P}`,h=[];return {layout:z(e,L,h,"__standalone__",r),responsiveCss:A({scopeAttr:"data-rmg-skeleton-scope",scopeId:n$1,rules:h})}},[e,n$1,r]),k={...u,...p?{"--rmg-skel-bg":p}:null,...y!=null?{"--rmg-skel-radius":l(y)}:null,...s?null:n(a)};return jsx(Q,{skeletonNode:jsxs("div",{"data-rmg-skeleton-scope":n$1,className:c,style:k,"aria-hidden":i?void 0:true,"aria-label":i,role:i?"status":void 0,"aria-live":i?"polite":void 0,children:[C?jsx("style",{dangerouslySetInnerHTML:{__html:C}}):null,jsx(B,{node:l$1,disableShimmer:s,breakpointMap:r})]}),ready:w,enabled:f,force:x,timing:m,shellClassName:R,shellStyle:M,contentClassName:N,contentStyle:b,children:S})}export{Q as a,ie as b};
|