@frybynite/image-cloud 0.2.5 → 0.2.6

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.
@@ -1,4 +1,4 @@
1
- const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary: #1a1a2e;--fbn-ic-bg-glass: rgba(255, 255, 255, .05);--fbn-ic-border-glass: rgba(255, 255, 255, .1);--fbn-ic-text-primary: #ffffff;--fbn-ic-text-secondary: #b8b8d1;--fbn-ic-text-muted: #6b6b8f;--fbn-ic-accent-primary: #6366f1;--fbn-ic-accent-secondary: #8b5cf6;--fbn-ic-accent-glow: rgba(99, 102, 241, .4);--fbn-ic-transition-smooth: cubic-bezier(.4, 0, .2, 1);--fbn-ic-transition-bounce: cubic-bezier(.68, -.55, .265, 1.55);--fbn-ic-shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);--fbn-ic-shadow-md: 0 4px 16px rgba(0, 0, 0, .4);--fbn-ic-shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);--fbn-ic-shadow-glow: 0 0 20px var(--fbn-ic-accent-glow)}.fbn-ic-gallery{position:relative;width:100%;height:100%;overflow:hidden;perspective:1000px}.fbn-ic-image{position:absolute;border-radius:8px;box-shadow:var(--fbn-ic-shadow-md);cursor:pointer;transition:transform .6s var(--fbn-ic-transition-smooth),box-shadow .6s var(--fbn-ic-transition-smooth),filter .3s var(--fbn-ic-transition-smooth),opacity .3s var(--fbn-ic-transition-smooth),border .3s var(--fbn-ic-transition-smooth),outline .3s var(--fbn-ic-transition-smooth),z-index 0s .6s;will-change:transform;-webkit-user-select:none;user-select:none;backface-visibility:hidden;-webkit-backface-visibility:hidden}.fbn-ic-image:hover{box-shadow:var(--fbn-ic-shadow-lg)}.fbn-ic-image.fbn-ic-focused{z-index:1000;box-shadow:0 20px 60px #000000b3,var(--fbn-ic-shadow-glow);transition:transform .6s var(--fbn-ic-transition-smooth),box-shadow .6s var(--fbn-ic-transition-smooth),filter .3s var(--fbn-ic-transition-smooth),opacity .3s var(--fbn-ic-transition-smooth),border .3s var(--fbn-ic-transition-smooth),outline .3s var(--fbn-ic-transition-smooth),z-index 0s 0s;will-change:auto}.fbn-ic-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;color:var(--fbn-ic-text-secondary);z-index:100;pointer-events:none}.fbn-ic-spinner{width:50px;height:50px;margin:0 auto 1rem;border:4px solid var(--fbn-ic-border-glass);border-top:4px solid var(--fbn-ic-accent-primary);border-radius:50%;animation:fbn-ic-spin 1s linear infinite}@keyframes fbn-ic-spin{to{transform:rotate(360deg)}}.fbn-ic-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:600px;padding:1.5rem;background:#ef44441a;border:1px solid rgba(239,68,68,.3);border-radius:12px;color:#fca5a5;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:100}.fbn-ic-hidden{display:none!important}", St = Object.freeze({
1
+ const kt = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary: #1a1a2e;--fbn-ic-bg-glass: rgba(255, 255, 255, .05);--fbn-ic-border-glass: rgba(255, 255, 255, .1);--fbn-ic-text-primary: #ffffff;--fbn-ic-text-secondary: #b8b8d1;--fbn-ic-text-muted: #6b6b8f;--fbn-ic-accent-primary: #6366f1;--fbn-ic-accent-secondary: #8b5cf6;--fbn-ic-accent-glow: rgba(99, 102, 241, .4);--fbn-ic-transition-smooth: cubic-bezier(.4, 0, .2, 1);--fbn-ic-transition-bounce: cubic-bezier(.68, -.55, .265, 1.55);--fbn-ic-shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);--fbn-ic-shadow-md: 0 4px 16px rgba(0, 0, 0, .4);--fbn-ic-shadow-lg: 0 8px 32px rgba(0, 0, 0, .5);--fbn-ic-shadow-glow: 0 0 20px var(--fbn-ic-accent-glow)}.fbn-ic-gallery{position:relative;width:100%;height:100%;overflow:hidden;perspective:1000px}.fbn-ic-image{position:absolute;border-radius:8px;box-shadow:var(--fbn-ic-shadow-md);cursor:pointer;transition:transform .6s var(--fbn-ic-transition-smooth),box-shadow .6s var(--fbn-ic-transition-smooth),filter .3s var(--fbn-ic-transition-smooth),opacity .3s var(--fbn-ic-transition-smooth),border .3s var(--fbn-ic-transition-smooth),outline .3s var(--fbn-ic-transition-smooth),z-index 0s .6s;will-change:transform;-webkit-user-select:none;user-select:none;backface-visibility:hidden;-webkit-backface-visibility:hidden}.fbn-ic-image:hover{box-shadow:var(--fbn-ic-shadow-lg)}.fbn-ic-image.fbn-ic-focused{z-index:1000;box-shadow:0 20px 60px #000000b3,var(--fbn-ic-shadow-glow);transition:transform .6s var(--fbn-ic-transition-smooth),box-shadow .6s var(--fbn-ic-transition-smooth),filter .3s var(--fbn-ic-transition-smooth),opacity .3s var(--fbn-ic-transition-smooth),border .3s var(--fbn-ic-transition-smooth),outline .3s var(--fbn-ic-transition-smooth),z-index 0s 0s;will-change:auto}.fbn-ic-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;color:var(--fbn-ic-text-secondary);z-index:100;pointer-events:none}.fbn-ic-spinner{width:50px;height:50px;margin:0 auto 1rem;border:4px solid var(--fbn-ic-border-glass);border-top:4px solid var(--fbn-ic-accent-primary);border-radius:50%;animation:fbn-ic-spin 1s linear infinite}@keyframes fbn-ic-spin{to{transform:rotate(360deg)}}.fbn-ic-error{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:600px;padding:1.5rem;background:#ef44441a;border:1px solid rgba(239,68,68,.3);border-radius:12px;color:#fca5a5;text-align:center;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:100}.fbn-ic-hidden{display:none!important}", It = Object.freeze({
2
2
  none: "none",
3
3
  sm: "0 2px 4px rgba(0,0,0,0.1)",
4
4
  md: "0 4px 16px rgba(0,0,0,0.4)",
@@ -8,23 +8,23 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
8
8
  energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
9
9
  playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
10
10
  subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
11
- }), Mt = Object.freeze({
11
+ }), Ct = Object.freeze({
12
12
  gentle: Object.freeze({ stiffness: 150, damping: 30, mass: 1, oscillations: 2 }),
13
13
  bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
14
14
  wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
15
15
  snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
16
- }), Tt = Object.freeze({
16
+ }), Ft = Object.freeze({
17
17
  gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
18
18
  playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
19
19
  serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
20
20
  flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
21
- }), It = Object.freeze({
21
+ }), Tt = Object.freeze({
22
22
  type: "linear"
23
- }), Et = Object.freeze({
24
- mode: "none"
25
23
  }), Rt = Object.freeze({
26
24
  mode: "none"
27
- }), Lt = Object.freeze({
25
+ }), At = Object.freeze({
26
+ mode: "none"
27
+ }), $t = Object.freeze({
28
28
  default: Object.freeze({
29
29
  border: Object.freeze({
30
30
  width: 0,
@@ -49,17 +49,17 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
49
49
  focused: Object.freeze({
50
50
  shadow: "none"
51
51
  })
52
- }), _t = Object.freeze({
52
+ }), jt = Object.freeze({
53
53
  rows: 1,
54
54
  amplitude: 100,
55
55
  frequency: 2,
56
56
  phaseShift: 0,
57
57
  synchronization: "offset"
58
58
  // Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
59
- }), jt = Object.freeze({
59
+ }), Nt = Object.freeze({
60
60
  mobile: Object.freeze({ maxWidth: 767 }),
61
61
  tablet: Object.freeze({ maxWidth: 1199 })
62
- }), kt = Object.freeze({
62
+ }), Gt = Object.freeze({
63
63
  mode: "adaptive",
64
64
  // Default to adaptive sizing
65
65
  minSize: 50,
@@ -71,15 +71,15 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
71
71
  // No variance by default
72
72
  max: 1
73
73
  })
74
- }), Gt = Object.freeze({
74
+ }), Wt = Object.freeze({
75
75
  mode: "none",
76
76
  range: Object.freeze({
77
77
  min: -15,
78
78
  max: 15
79
79
  })
80
- }), $t = Object.freeze({
81
- sizing: kt,
82
- rotation: Gt
80
+ }), Dt = Object.freeze({
81
+ sizing: Gt,
82
+ rotation: Wt
83
83
  }), y = Object.freeze({
84
84
  // Unified loader configuration
85
85
  loader: Object.freeze({
@@ -105,13 +105,13 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
105
105
  })
106
106
  }),
107
107
  // Image sizing and rotation configuration
108
- image: $t,
108
+ image: Dt,
109
109
  // Pattern-based layout configuration
110
110
  layout: Object.freeze({
111
111
  algorithm: "radial",
112
112
  scaleDecay: 0,
113
113
  // No decay by default (0-1 for radial/spiral)
114
- responsive: jt,
114
+ responsive: Nt,
115
115
  targetCoverage: 0.6,
116
116
  // Target 60% of container area
117
117
  densityFactor: 1,
@@ -171,9 +171,9 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
171
171
  }),
172
172
  easing: "cubic-bezier(0.25, 1, 0.5, 1)",
173
173
  // smooth deceleration
174
- path: It,
175
- rotation: Et,
176
- scale: Rt
174
+ path: Tt,
175
+ rotation: Rt,
176
+ scale: At
177
177
  })
178
178
  }),
179
179
  // Pattern-based interaction configuration
@@ -231,54 +231,54 @@ const Ht = ".fbn-ic-gallery{--fbn-ic-bg-primary: #05060F;--fbn-ic-bg-secondary:
231
231
  })
232
232
  }),
233
233
  // Image styling
234
- styling: Lt,
234
+ styling: $t,
235
235
  // Debug mode
236
236
  debug: !1
237
237
  });
238
- function rt(n, t) {
239
- if (!n) return t || {};
240
- if (!t) return { ...n };
241
- const e = { ...n };
242
- return t.border !== void 0 && (e.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (e.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (e.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (e.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (e.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (e.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (e.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (e.shadow = t.shadow), t.opacity !== void 0 && (e.opacity = t.opacity), t.cursor !== void 0 && (e.cursor = t.cursor), t.className !== void 0 && (e.className = t.className), t.objectFit !== void 0 && (e.objectFit = t.objectFit), t.aspectRatio !== void 0 && (e.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (e.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (e.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (e.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (e.borderRadiusBottomLeft = t.borderRadiusBottomLeft), e;
238
+ function rt(o, t) {
239
+ if (!o) return t || {};
240
+ if (!t) return { ...o };
241
+ const e = { ...o };
242
+ return t.border !== void 0 && (e.border = { ...o.border, ...t.border }), t.borderTop !== void 0 && (e.borderTop = { ...o.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (e.borderRight = { ...o.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (e.borderBottom = { ...o.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (e.borderLeft = { ...o.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (e.filter = { ...o.filter, ...t.filter }), t.outline !== void 0 && (e.outline = { ...o.outline, ...t.outline }), t.shadow !== void 0 && (e.shadow = t.shadow), t.opacity !== void 0 && (e.opacity = t.opacity), t.cursor !== void 0 && (e.cursor = t.cursor), t.className !== void 0 && (e.className = t.className), t.objectFit !== void 0 && (e.objectFit = t.objectFit), t.aspectRatio !== void 0 && (e.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (e.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (e.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (e.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (e.borderRadiusBottomLeft = t.borderRadiusBottomLeft), e;
243
243
  }
244
- function Wt(n, t) {
245
- if (!t) return { ...n };
246
- const e = rt(n.default, t.default), i = rt(
247
- rt(e, n.hover),
244
+ function qt(o, t) {
245
+ if (!t) return { ...o };
246
+ const e = rt(o.default, t.default), i = rt(
247
+ rt(e, o.hover),
248
248
  t.hover
249
- ), o = rt(
250
- rt(e, n.focused),
249
+ ), n = rt(
250
+ rt(e, o.focused),
251
251
  t.focused
252
252
  );
253
253
  return {
254
254
  default: e,
255
255
  hover: i,
256
- focused: o
256
+ focused: n
257
257
  };
258
258
  }
259
- function Nt(n, t) {
260
- var i, o, a, c, s, h, l, u;
261
- if (!t) return { ...n };
262
- const e = { ...n };
259
+ function Yt(o, t) {
260
+ var i, n, s, r, a, h, l, u;
261
+ if (!t) return { ...o };
262
+ const e = { ...o };
263
263
  if (t.sizing !== void 0 && (e.sizing = {
264
- ...n.sizing,
264
+ ...o.sizing,
265
265
  ...t.sizing
266
266
  }, t.sizing.variance)) {
267
- const r = t.sizing.variance, d = r.min !== void 0 && r.min >= 0.25 && r.min <= 1 ? r.min : ((o = (i = n.sizing) == null ? void 0 : i.variance) == null ? void 0 : o.min) ?? 1, m = r.max !== void 0 && r.max >= 1 && r.max <= 1.75 ? r.max : ((c = (a = n.sizing) == null ? void 0 : a.variance) == null ? void 0 : c.max) ?? 1;
267
+ const c = t.sizing.variance, d = c.min !== void 0 && c.min >= 0.25 && c.min <= 1 ? c.min : ((n = (i = o.sizing) == null ? void 0 : i.variance) == null ? void 0 : n.min) ?? 1, m = c.max !== void 0 && c.max >= 1 && c.max <= 1.75 ? c.max : ((r = (s = o.sizing) == null ? void 0 : s.variance) == null ? void 0 : r.max) ?? 1;
268
268
  e.sizing.variance = { min: d, max: m };
269
269
  }
270
270
  if (t.rotation !== void 0 && (e.rotation = {
271
- ...n.rotation,
271
+ ...o.rotation,
272
272
  ...t.rotation
273
273
  }, t.rotation.range)) {
274
- const r = t.rotation.range, d = r.min !== void 0 && r.min >= -180 && r.min <= 0 ? r.min : ((h = (s = n.rotation) == null ? void 0 : s.range) == null ? void 0 : h.min) ?? -15, m = r.max !== void 0 && r.max >= 0 && r.max <= 180 ? r.max : ((u = (l = n.rotation) == null ? void 0 : l.range) == null ? void 0 : u.max) ?? 15;
274
+ const c = t.rotation.range, d = c.min !== void 0 && c.min >= -180 && c.min <= 0 ? c.min : ((h = (a = o.rotation) == null ? void 0 : a.range) == null ? void 0 : h.min) ?? -15, m = c.max !== void 0 && c.max >= 0 && c.max <= 180 ? c.max : ((u = (l = o.rotation) == null ? void 0 : l.range) == null ? void 0 : u.max) ?? 15;
275
275
  e.rotation.range = { min: d, max: m };
276
276
  }
277
277
  return e;
278
278
  }
279
- function qt(n) {
279
+ function Xt(o) {
280
280
  var e;
281
- const t = (e = n.layout) == null ? void 0 : e.rotation;
281
+ const t = (e = o.layout) == null ? void 0 : e.rotation;
282
282
  if (t && "enabled" in t)
283
283
  return {
284
284
  rotation: {
@@ -287,9 +287,9 @@ function qt(n) {
287
287
  }
288
288
  };
289
289
  }
290
- function Yt(n) {
290
+ function Bt(o) {
291
291
  var e, i;
292
- const t = (i = (e = n.layout) == null ? void 0 : e.sizing) == null ? void 0 : i.variance;
292
+ const t = (i = (e = o.layout) == null ? void 0 : e.sizing) == null ? void 0 : i.variance;
293
293
  if (t)
294
294
  return {
295
295
  sizing: {
@@ -299,113 +299,113 @@ function Yt(n) {
299
299
  }
300
300
  };
301
301
  }
302
- function Bt(n = {}) {
303
- var a;
304
- const t = qt(n), e = Yt(n);
305
- let i = n.image;
302
+ function Vt(o = {}) {
303
+ var s;
304
+ const t = Xt(o), e = Bt(o);
305
+ let i = o.image;
306
306
  (t || e) && (i = {
307
307
  ...e || {},
308
308
  ...t || {},
309
309
  ...i
310
- }, i.rotation && (t != null && t.rotation) && ((a = n.image) != null && a.rotation) && (i.rotation = {
310
+ }, i.rotation && (t != null && t.rotation) && ((s = o.image) != null && s.rotation) && (i.rotation = {
311
311
  ...t.rotation,
312
- ...n.image.rotation
312
+ ...o.image.rotation
313
313
  }));
314
- const o = {
314
+ const n = {
315
315
  loader: { ...y.loader },
316
- image: Nt($t, i),
316
+ image: Yt(Dt, i),
317
317
  layout: { ...y.layout },
318
318
  animation: { ...y.animation },
319
319
  interaction: { ...y.interaction },
320
320
  rendering: { ...y.rendering },
321
- styling: Wt(Lt, n.styling),
321
+ styling: qt($t, o.styling),
322
322
  debug: y.debug
323
323
  };
324
- return n.loader && (o.loader = {
324
+ return o.loader && (n.loader = {
325
325
  ...y.loader,
326
- ...n.loader
327
- }, n.loader.googleDrive && (o.loader.googleDrive = {
326
+ ...o.loader
327
+ }, o.loader.googleDrive && (n.loader.googleDrive = {
328
328
  ...y.loader.googleDrive,
329
- ...n.loader.googleDrive,
330
- sources: n.loader.googleDrive.sources || y.loader.googleDrive.sources,
331
- allowedExtensions: n.loader.googleDrive.allowedExtensions || y.loader.googleDrive.allowedExtensions
332
- }), n.loader.static && (o.loader.static = {
329
+ ...o.loader.googleDrive,
330
+ sources: o.loader.googleDrive.sources || y.loader.googleDrive.sources,
331
+ allowedExtensions: o.loader.googleDrive.allowedExtensions || y.loader.googleDrive.allowedExtensions
332
+ }), o.loader.static && (n.loader.static = {
333
333
  ...y.loader.static,
334
- ...n.loader.static,
335
- sources: n.loader.static.sources || y.loader.static.sources,
336
- allowedExtensions: n.loader.static.allowedExtensions || y.loader.static.allowedExtensions
337
- })), n.layout && (o.layout = {
334
+ ...o.loader.static,
335
+ sources: o.loader.static.sources || y.loader.static.sources,
336
+ allowedExtensions: o.loader.static.allowedExtensions || y.loader.static.allowedExtensions
337
+ })), o.layout && (n.layout = {
338
338
  ...y.layout,
339
- ...n.layout
340
- }, n.layout.responsive && (o.layout.responsive = {
339
+ ...o.layout
340
+ }, o.layout.responsive && (n.layout.responsive = {
341
341
  ...y.layout.responsive,
342
- mobile: n.layout.responsive.mobile ? { ...y.layout.responsive.mobile, ...n.layout.responsive.mobile } : y.layout.responsive.mobile,
343
- tablet: n.layout.responsive.tablet ? { ...y.layout.responsive.tablet, ...n.layout.responsive.tablet } : y.layout.responsive.tablet
344
- }), n.layout.spacing && (o.layout.spacing = {
342
+ mobile: o.layout.responsive.mobile ? { ...y.layout.responsive.mobile, ...o.layout.responsive.mobile } : y.layout.responsive.mobile,
343
+ tablet: o.layout.responsive.tablet ? { ...y.layout.responsive.tablet, ...o.layout.responsive.tablet } : y.layout.responsive.tablet
344
+ }), o.layout.spacing && (n.layout.spacing = {
345
345
  ...y.layout.spacing,
346
- ...n.layout.spacing
347
- })), n.animation && (o.animation = {
346
+ ...o.layout.spacing
347
+ })), o.animation && (n.animation = {
348
348
  ...y.animation,
349
- ...n.animation
350
- }, n.animation.easing && (o.animation.easing = {
349
+ ...o.animation
350
+ }, o.animation.easing && (n.animation.easing = {
351
351
  ...y.animation.easing,
352
- ...n.animation.easing
353
- }), n.animation.queue && (o.animation.queue = {
352
+ ...o.animation.easing
353
+ }), o.animation.queue && (n.animation.queue = {
354
354
  ...y.animation.queue,
355
- ...n.animation.queue
356
- }), n.animation.performance && (o.animation.performance = {
355
+ ...o.animation.queue
356
+ }), o.animation.performance && (n.animation.performance = {
357
357
  ...y.animation.performance,
358
- ...n.animation.performance
359
- }), n.animation.entry && (o.animation.entry = {
358
+ ...o.animation.performance
359
+ }), o.animation.entry && (n.animation.entry = {
360
360
  ...y.animation.entry,
361
- ...n.animation.entry,
362
- start: n.animation.entry.start ? {
361
+ ...o.animation.entry,
362
+ start: o.animation.entry.start ? {
363
363
  ...y.animation.entry.start,
364
- ...n.animation.entry.start,
365
- circular: n.animation.entry.start.circular ? { ...y.animation.entry.start.circular, ...n.animation.entry.start.circular } : y.animation.entry.start.circular
364
+ ...o.animation.entry.start,
365
+ circular: o.animation.entry.start.circular ? { ...y.animation.entry.start.circular, ...o.animation.entry.start.circular } : y.animation.entry.start.circular
366
366
  } : y.animation.entry.start,
367
- timing: n.animation.entry.timing ? { ...y.animation.entry.timing, ...n.animation.entry.timing } : y.animation.entry.timing,
368
- path: n.animation.entry.path ? { ...It, ...n.animation.entry.path } : y.animation.entry.path,
369
- rotation: n.animation.entry.rotation ? { ...Et, ...n.animation.entry.rotation } : y.animation.entry.rotation,
370
- scale: n.animation.entry.scale ? { ...Rt, ...n.animation.entry.scale } : y.animation.entry.scale
371
- })), n.interaction && (o.interaction = {
367
+ timing: o.animation.entry.timing ? { ...y.animation.entry.timing, ...o.animation.entry.timing } : y.animation.entry.timing,
368
+ path: o.animation.entry.path ? { ...Tt, ...o.animation.entry.path } : y.animation.entry.path,
369
+ rotation: o.animation.entry.rotation ? { ...Rt, ...o.animation.entry.rotation } : y.animation.entry.rotation,
370
+ scale: o.animation.entry.scale ? { ...At, ...o.animation.entry.scale } : y.animation.entry.scale
371
+ })), o.interaction && (n.interaction = {
372
372
  ...y.interaction,
373
- ...n.interaction
374
- }, n.interaction.focus && (o.interaction.focus = {
373
+ ...o.interaction
374
+ }, o.interaction.focus && (n.interaction.focus = {
375
375
  ...y.interaction.focus,
376
- ...n.interaction.focus
377
- }), n.interaction.navigation && (o.interaction.navigation = {
376
+ ...o.interaction.focus
377
+ }), o.interaction.navigation && (n.interaction.navigation = {
378
378
  ...y.interaction.navigation,
379
- ...n.interaction.navigation
380
- }), n.interaction.gestures && (o.interaction.gestures = {
379
+ ...o.interaction.navigation
380
+ }), o.interaction.gestures && (n.interaction.gestures = {
381
381
  ...y.interaction.gestures,
382
- ...n.interaction.gestures
383
- })), n.rendering && (o.rendering = {
382
+ ...o.interaction.gestures
383
+ })), o.rendering && (n.rendering = {
384
384
  ...y.rendering,
385
- ...n.rendering
386
- }, n.rendering.responsive && (o.rendering.responsive = {
385
+ ...o.rendering
386
+ }, o.rendering.responsive && (n.rendering.responsive = {
387
387
  ...y.rendering.responsive,
388
- ...n.rendering.responsive,
389
- breakpoints: n.rendering.responsive.breakpoints ? { ...y.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : y.rendering.responsive.breakpoints,
390
- mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : y.rendering.responsive.mobileDetection
391
- }), n.rendering.ui && (o.rendering.ui = {
388
+ ...o.rendering.responsive,
389
+ breakpoints: o.rendering.responsive.breakpoints ? { ...y.rendering.responsive.breakpoints, ...o.rendering.responsive.breakpoints } : y.rendering.responsive.breakpoints,
390
+ mobileDetection: o.rendering.responsive.mobileDetection ? o.rendering.responsive.mobileDetection : y.rendering.responsive.mobileDetection
391
+ }), o.rendering.ui && (n.rendering.ui = {
392
392
  ...y.rendering.ui,
393
- ...n.rendering.ui
394
- }), n.rendering.performance && (o.rendering.performance = {
393
+ ...o.rendering.ui
394
+ }), o.rendering.performance && (n.rendering.performance = {
395
395
  ...y.rendering.performance,
396
- ...n.rendering.performance
397
- })), n.debug !== void 0 && (o.debug = n.debug), o;
396
+ ...o.rendering.performance
397
+ })), o.debug !== void 0 && (n.debug = o.debug), n;
398
398
  }
399
- function Xt(n, t) {
400
- return { ...n ? zt[n] : zt.playful, ...t };
399
+ function Jt(o, t) {
400
+ return { ...o ? zt[o] : zt.playful, ...t };
401
401
  }
402
- function Vt(n, t) {
403
- return { ...n ? Mt[n] : Mt.gentle, ...t };
402
+ function Kt(o, t) {
403
+ return { ...o ? Ct[o] : Ct.gentle, ...t };
404
404
  }
405
- function Jt(n, t) {
406
- return { ...n ? Tt[n] : Tt.gentle, ...t };
405
+ function Zt(o, t) {
406
+ return { ...o ? Ft[o] : Ft.gentle, ...t };
407
407
  }
408
- class Zt {
408
+ class Qt {
409
409
  constructor(t) {
410
410
  this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
411
411
  }
@@ -416,8 +416,8 @@ class Zt {
416
416
  buildTransformString(t) {
417
417
  const e = ["translate(-50%, -50%)"];
418
418
  if (t.x !== void 0 || t.y !== void 0) {
419
- const i = t.x ?? 0, o = t.y ?? 0;
420
- e.push(`translate(${i}px, ${o}px)`);
419
+ const i = t.x ?? 0, n = t.y ?? 0;
420
+ e.push(`translate(${i}px, ${n}px)`);
421
421
  }
422
422
  return t.rotation !== void 0 && e.push(`rotate(${t.rotation}deg)`), t.scale !== void 0 && e.push(`scale(${t.scale})`), e.join(" ");
423
423
  }
@@ -430,9 +430,9 @@ class Zt {
430
430
  * @param easing - CSS easing function (optional)
431
431
  * @returns AnimationHandle that can be used to cancel or query the animation
432
432
  */
433
- animateTransformCancellable(t, e, i, o = null, a = null) {
433
+ animateTransformCancellable(t, e, i, n = null, s = null) {
434
434
  this.cancelAllAnimations(t);
435
- const c = o ?? this.config.duration, s = a ?? this.config.easing.default, h = this.buildTransformString(e), l = this.buildTransformString(i);
435
+ const r = n ?? this.config.duration, a = s ?? this.config.easing.default, h = this.buildTransformString(e), l = this.buildTransformString(i);
436
436
  t.style.transition = "none";
437
437
  const u = t.animate(
438
438
  [
@@ -440,25 +440,25 @@ class Zt {
440
440
  { transform: l }
441
441
  ],
442
442
  {
443
- duration: c,
444
- easing: s,
443
+ duration: r,
444
+ easing: a,
445
445
  fill: "forwards"
446
446
  // Keep final state after animation
447
447
  }
448
- ), r = {
448
+ ), c = {
449
449
  id: `anim-${++this.animationIdCounter}`,
450
450
  element: t,
451
451
  animation: u,
452
452
  fromState: e,
453
453
  toState: i,
454
454
  startTime: performance.now(),
455
- duration: c
455
+ duration: r
456
456
  };
457
- return this.activeAnimations.set(t, r), u.finished.then(() => {
457
+ return this.activeAnimations.set(t, c), u.finished.then(() => {
458
458
  t.style.transform = l, this.activeAnimations.delete(t);
459
459
  }).catch(() => {
460
460
  this.activeAnimations.delete(t);
461
- }), r;
461
+ }), c;
462
462
  }
463
463
  /**
464
464
  * Cancel an active animation
@@ -469,13 +469,13 @@ class Zt {
469
469
  cancelAnimation(t, e = !0) {
470
470
  const i = this.getCurrentTransform(t.element);
471
471
  if (t.animation.cancel(), e) {
472
- const o = this.buildTransformString({
472
+ const n = this.buildTransformString({
473
473
  x: i.x,
474
474
  y: i.y,
475
475
  rotation: i.rotation,
476
476
  scale: i.scale
477
477
  });
478
- t.element.style.transform = o;
478
+ t.element.style.transform = n;
479
479
  }
480
480
  return this.activeAnimations.delete(t.element), i;
481
481
  }
@@ -488,8 +488,8 @@ class Zt {
488
488
  const e = this.activeAnimations.get(t);
489
489
  e && this.cancelAnimation(e, !1);
490
490
  const i = t.getAnimations();
491
- for (const o of i)
492
- o.cancel();
491
+ for (const n of i)
492
+ n.cancel();
493
493
  }
494
494
  /**
495
495
  * Get current transform state of an element (works mid-animation)
@@ -501,8 +501,8 @@ class Zt {
501
501
  const i = getComputedStyle(t).transform;
502
502
  if (i === "none" || !i)
503
503
  return { x: 0, y: 0, rotation: 0, scale: 1 };
504
- const o = new DOMMatrix(i), a = Math.sqrt(o.a * o.a + o.b * o.b), c = Math.atan2(o.b, o.a) * (180 / Math.PI), s = o.e, h = o.f;
505
- return { x: s, y: h, rotation: c, scale: a };
504
+ const n = new DOMMatrix(i), s = Math.sqrt(n.a * n.a + n.b * n.b), r = Math.atan2(n.b, n.a) * (180 / Math.PI), a = n.e, h = n.f;
505
+ return { x: a, y: h, rotation: r, scale: s };
506
506
  }
507
507
  /**
508
508
  * Check if an element has an active animation
@@ -528,12 +528,12 @@ class Zt {
528
528
  * @param easing - CSS easing function (optional)
529
529
  * @returns Promise that resolves when animation completes
530
530
  */
531
- animateTransform(t, e, i = null, o = null) {
532
- return new Promise((a) => {
533
- const c = i ?? this.config.duration, s = o ?? this.config.easing.default;
534
- t.style.transition = `transform ${c}ms ${s}, box-shadow ${c}ms ${s}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
535
- a();
536
- }, c);
531
+ animateTransform(t, e, i = null, n = null) {
532
+ return new Promise((s) => {
533
+ const r = i ?? this.config.duration, a = n ?? this.config.easing.default;
534
+ t.style.transition = `transform ${r}ms ${a}, box-shadow ${r}ms ${a}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
535
+ s();
536
+ }, r);
537
537
  });
538
538
  }
539
539
  /**
@@ -561,161 +561,161 @@ class Zt {
561
561
  return new Promise((e) => setTimeout(e, t));
562
562
  }
563
563
  }
564
- function st(n, t, e) {
565
- return n + (t - n) * e;
564
+ function st(o, t, e) {
565
+ return o + (t - o) * e;
566
566
  }
567
- function Kt(n, t, e, i) {
568
- const { overshoot: o, bounces: a, decayRatio: c } = i, s = e.x - t.x, h = e.y - t.y, l = Qt(a, c);
569
- let u = 0, r = 0, d = 1, m = o, b = !1;
567
+ function te(o, t, e, i) {
568
+ const { overshoot: n, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, l = ee(s, r);
569
+ let u = 0, c = 0, d = 1, m = n, b = !1;
570
570
  for (let g = 0; g < l.length; g++)
571
- if (n <= l[g].time) {
572
- r = g === 0 ? 0 : l[g - 1].time, d = l[g].time, m = l[g].overshoot, b = l[g].isOvershoot;
571
+ if (o <= l[g].time) {
572
+ c = g === 0 ? 0 : l[g - 1].time, d = l[g].time, m = l[g].overshoot, b = l[g].isOvershoot;
573
573
  break;
574
574
  }
575
- const p = (n - r) / (d - r);
575
+ const p = (o - c) / (d - c);
576
576
  if (b)
577
577
  u = 1 + m * gt(p);
578
- else if (r === 0)
578
+ else if (c === 0)
579
579
  u = gt(p);
580
580
  else {
581
581
  const g = l.find(
582
- (v, w) => v.time > r && w > 0 && l[w - 1].isOvershoot
582
+ (v, w) => v.time > c && w > 0 && l[w - 1].isOvershoot
583
583
  ), f = 1 + ((g == null ? void 0 : g.overshoot) || m);
584
584
  u = st(f, 1, gt(p));
585
585
  }
586
586
  return {
587
- x: t.x + s * u,
587
+ x: t.x + a * u,
588
588
  y: t.y + h * u
589
589
  };
590
590
  }
591
- function Qt(n, t) {
591
+ function ee(o, t) {
592
592
  const e = [];
593
593
  let i = 0.6;
594
594
  e.push({ time: i, overshoot: 0, isOvershoot: !1 });
595
- let o = 0.15;
596
- const c = 0.4 / (n * 2);
597
- for (let s = 0; s < n; s++)
598
- i += c, e.push({ time: i, overshoot: o, isOvershoot: !0 }), i += c, e.push({ time: i, overshoot: o * t, isOvershoot: !1 }), o *= t;
595
+ let n = 0.15;
596
+ const r = 0.4 / (o * 2);
597
+ for (let a = 0; a < o; a++)
598
+ i += r, e.push({ time: i, overshoot: n, isOvershoot: !0 }), i += r, e.push({ time: i, overshoot: n * t, isOvershoot: !1 }), n *= t;
599
599
  return e.push({ time: 1, overshoot: 0, isOvershoot: !1 }), e;
600
600
  }
601
- function te(n, t, e, i) {
602
- const { stiffness: o, damping: a, mass: c, oscillations: s } = i, h = e.x - t.x, l = e.y - t.y, u = Math.sqrt(o / c), r = a / (2 * Math.sqrt(o * c));
601
+ function ie(o, t, e, i) {
602
+ const { stiffness: n, damping: s, mass: r, oscillations: a } = i, h = e.x - t.x, l = e.y - t.y, u = Math.sqrt(n / r), c = s / (2 * Math.sqrt(n * r));
603
603
  let d;
604
- if (r < 1) {
605
- const m = u * Math.sqrt(1 - r * r), b = Math.exp(-r * u * n * 3), p = Math.cos(m * n * s * Math.PI);
604
+ if (c < 1) {
605
+ const m = u * Math.sqrt(1 - c * c), b = Math.exp(-c * u * o * 3), p = Math.cos(m * o * a * Math.PI);
606
606
  d = 1 - b * p;
607
607
  } else
608
- d = 1 - Math.exp(-u * n * 3);
608
+ d = 1 - Math.exp(-u * o * 3);
609
609
  return d = Math.max(0, Math.min(d, 1.3)), {
610
610
  x: t.x + h * d,
611
611
  y: t.y + l * d
612
612
  };
613
613
  }
614
- function ee(n, t, e, i) {
615
- const { amplitude: o, frequency: a, decay: c, decayRate: s, phase: h } = i, l = e.x - t.x, u = e.y - t.y, r = Math.sqrt(l * l + u * u), d = r > 0 ? -u / r : 0, m = r > 0 ? l / r : 1, b = a * Math.PI * 2 * n + h, p = c ? Math.pow(1 - n, s) : 1, g = o * Math.sin(b) * p, f = ie(n);
614
+ function ne(o, t, e, i) {
615
+ const { amplitude: n, frequency: s, decay: r, decayRate: a, phase: h } = i, l = e.x - t.x, u = e.y - t.y, c = Math.sqrt(l * l + u * u), d = c > 0 ? -u / c : 0, m = c > 0 ? l / c : 1, b = s * Math.PI * 2 * o + h, p = r ? Math.pow(1 - o, a) : 1, g = n * Math.sin(b) * p, f = oe(o);
616
616
  return {
617
617
  x: st(t.x, e.x, f) + g * d,
618
618
  y: st(t.y, e.y, f) + g * m
619
619
  };
620
620
  }
621
- function gt(n) {
622
- return 1 - (1 - n) * (1 - n);
621
+ function gt(o) {
622
+ return 1 - (1 - o) * (1 - o);
623
623
  }
624
- function ie(n) {
625
- return 1 - Math.pow(1 - n, 3);
624
+ function oe(o) {
625
+ return 1 - Math.pow(1 - o, 3);
626
626
  }
627
- function ne(n, t, e) {
628
- const { amplitude: i, frequency: o, decay: a } = e, c = Math.sin(n * o * Math.PI * 2), s = a ? Math.pow(1 - n, 2) : 1, h = i * c * s;
627
+ function se(o, t, e) {
628
+ const { amplitude: i, frequency: n, decay: s } = e, r = Math.sin(o * n * Math.PI * 2), a = s ? Math.pow(1 - o, 2) : 1, h = i * r * a;
629
629
  return t + h;
630
630
  }
631
- function oe(n, t, e) {
632
- const { overshoot: i, bounces: o } = e, a = [];
633
- a.push({ time: 0.5, scale: i });
634
- let c = i;
635
- const s = 0.5, l = 0.5 / (o * 2);
631
+ function ae(o, t, e) {
632
+ const { overshoot: i, bounces: n } = e, s = [];
633
+ s.push({ time: 0.5, scale: i });
634
+ let r = i;
635
+ const a = 0.5, l = 0.5 / (n * 2);
636
636
  let u = 0.5;
637
- for (let d = 0; d < o; d++) {
638
- const m = 1 - (c - 1) * s;
639
- u += l, a.push({ time: u, scale: m }), c = 1 + (c - 1) * s * s, u += l, d < o - 1 && a.push({ time: u, scale: c });
640
- }
641
- a.push({ time: 1, scale: 1 });
642
- let r = 1;
643
- for (let d = 0; d < a.length; d++)
644
- if (n <= a[d].time) {
645
- const m = d === 0 ? 0 : a[d - 1].time, b = d === 0 ? 1 : a[d - 1].scale, p = (n - m) / (a[d].time - m), g = gt(p);
646
- r = b + (a[d].scale - b) * g;
637
+ for (let d = 0; d < n; d++) {
638
+ const m = 1 - (r - 1) * a;
639
+ u += l, s.push({ time: u, scale: m }), r = 1 + (r - 1) * a * a, u += l, d < n - 1 && s.push({ time: u, scale: r });
640
+ }
641
+ s.push({ time: 1, scale: 1 });
642
+ let c = 1;
643
+ for (let d = 0; d < s.length; d++)
644
+ if (o <= s[d].time) {
645
+ const m = d === 0 ? 0 : s[d - 1].time, b = d === 0 ? 1 : s[d - 1].scale, p = (o - m) / (s[d].time - m), g = gt(p);
646
+ c = b + (s[d].scale - b) * g;
647
647
  break;
648
648
  }
649
- return r * t;
649
+ return c * t;
650
650
  }
651
- function se(n) {
651
+ function re(o) {
652
652
  const {
653
653
  element: t,
654
654
  startPosition: e,
655
655
  endPosition: i,
656
- pathConfig: o,
657
- duration: a,
658
- imageWidth: c,
659
- imageHeight: s,
656
+ pathConfig: n,
657
+ duration: s,
658
+ imageWidth: r,
659
+ imageHeight: a,
660
660
  rotation: h,
661
661
  scale: l,
662
662
  onComplete: u,
663
- rotationConfig: r,
663
+ rotationConfig: c,
664
664
  startRotation: d,
665
665
  scaleConfig: m,
666
666
  startScale: b
667
- } = n, p = o.type, g = d !== void 0 && d !== h, f = (r == null ? void 0 : r.mode) === "wobble", v = (r == null ? void 0 : r.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, w = g || f, E = b !== void 0 && b !== l, A = (m == null ? void 0 : m.mode) === "pop", x = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
668
- if ((p === "linear" || p === "arc") && !w && !(E || A)) {
667
+ } = o, p = n.type, g = d !== void 0 && d !== h, f = (c == null ? void 0 : c.mode) === "wobble", v = (c == null ? void 0 : c.wobble) || { amplitude: 15, frequency: 3, decay: !0 }, w = g || f, E = b !== void 0 && b !== l, R = (m == null ? void 0 : m.mode) === "pop", x = (m == null ? void 0 : m.pop) || { overshoot: 1.2, bounces: 1 };
668
+ if ((p === "linear" || p === "arc") && !w && !(E || R)) {
669
669
  u && u();
670
670
  return;
671
671
  }
672
- const j = performance.now(), P = -c / 2, D = -s / 2;
673
- function U(k) {
674
- const F = k - j, S = Math.min(F / a, 1);
675
- let z;
672
+ const k = performance.now(), U = -r / 2, D = -a / 2;
673
+ function P(j) {
674
+ const C = j - k, S = Math.min(C / s, 1);
675
+ let A;
676
676
  switch (p) {
677
677
  case "bounce": {
678
- const _ = Xt(
679
- o.bouncePreset,
680
- o.bounce
678
+ const _ = Jt(
679
+ n.bouncePreset,
680
+ n.bounce
681
681
  );
682
- z = Kt(S, e, i, _);
682
+ A = te(S, e, i, _);
683
683
  break;
684
684
  }
685
685
  case "elastic": {
686
- const _ = Vt(
687
- o.elasticPreset,
688
- o.elastic
686
+ const _ = Kt(
687
+ n.elasticPreset,
688
+ n.elastic
689
689
  );
690
- z = te(S, e, i, _);
690
+ A = ie(S, e, i, _);
691
691
  break;
692
692
  }
693
693
  case "wave": {
694
- const _ = Jt(
695
- o.wavePreset,
696
- o.wave
694
+ const _ = Zt(
695
+ n.wavePreset,
696
+ n.wave
697
697
  );
698
- z = ee(S, e, i, _);
698
+ A = ne(S, e, i, _);
699
699
  break;
700
700
  }
701
701
  default:
702
- z = {
702
+ A = {
703
703
  x: st(e.x, i.x, S),
704
704
  y: st(e.y, i.y, S)
705
705
  };
706
706
  }
707
- const $ = z.x - i.x, T = z.y - i.y;
708
- let R;
709
- f ? R = ne(S, h, v) : g ? R = st(d, h, S) : R = h;
707
+ const O = A.x - i.x, z = A.y - i.y;
708
+ let T;
709
+ f ? T = se(S, h, v) : g ? T = st(d, h, S) : T = h;
710
710
  let M;
711
- A ? M = oe(S, l, x) : E ? M = st(b, l, S) : M = l, t.style.transform = `translate(${P}px, ${D}px) translate(${$}px, ${T}px) rotate(${R}deg) scale(${M})`, S < 1 ? requestAnimationFrame(U) : (t.style.transform = `translate(${P}px, ${D}px) rotate(${h}deg) scale(${l})`, u && u());
711
+ R ? M = ae(S, l, x) : E ? M = st(b, l, S) : M = l, t.style.transform = `translate(${U}px, ${D}px) translate(${O}px, ${z}px) rotate(${T}deg) scale(${M})`, S < 1 ? requestAnimationFrame(P) : (t.style.transform = `translate(${U}px, ${D}px) rotate(${h}deg) scale(${l})`, u && u());
712
712
  }
713
- requestAnimationFrame(U);
713
+ requestAnimationFrame(P);
714
714
  }
715
- function ae(n) {
716
- return n === "bounce" || n === "elastic" || n === "wave";
715
+ function ce(o) {
716
+ return o === "bounce" || o === "elastic" || o === "wave";
717
717
  }
718
- const re = {
718
+ const le = {
719
719
  radial: "center",
720
720
  spiral: "center",
721
721
  grid: "top",
@@ -723,85 +723,85 @@ const re = {
723
723
  random: "nearest-edge",
724
724
  wave: "left"
725
725
  };
726
- class ce {
726
+ class he {
727
727
  constructor(t, e) {
728
- this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || It, this.rotationConfig = t.rotation || Et, this.scaleConfig = t.scale || Rt;
728
+ this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || Tt, this.rotationConfig = t.rotation || Rt, this.scaleConfig = t.scale || At;
729
729
  }
730
730
  /**
731
731
  * Get the effective start position, considering layout-aware defaults
732
732
  */
733
733
  resolveStartPosition() {
734
- return this.config.start.position ? this.config.start.position : re[this.layoutAlgorithm] || "nearest-edge";
734
+ return this.config.start.position ? this.config.start.position : le[this.layoutAlgorithm] || "nearest-edge";
735
735
  }
736
736
  /**
737
737
  * Calculate the starting position for an image's entry animation
738
738
  */
739
- calculateStartPosition(t, e, i, o, a) {
740
- const c = this.resolvedStartPosition, s = this.config.start.offset ?? 100;
741
- switch (c) {
739
+ calculateStartPosition(t, e, i, n, s) {
740
+ const r = this.resolvedStartPosition, a = this.config.start.offset ?? 100;
741
+ switch (r) {
742
742
  case "nearest-edge":
743
- return this.calculateNearestEdge(t, e, i, s);
743
+ return this.calculateNearestEdge(t, e, i, a);
744
744
  case "top":
745
- return this.calculateEdgePosition("top", t, e, i, s);
745
+ return this.calculateEdgePosition("top", t, e, i, a);
746
746
  case "bottom":
747
- return this.calculateEdgePosition("bottom", t, e, i, s);
747
+ return this.calculateEdgePosition("bottom", t, e, i, a);
748
748
  case "left":
749
- return this.calculateEdgePosition("left", t, e, i, s);
749
+ return this.calculateEdgePosition("left", t, e, i, a);
750
750
  case "right":
751
- return this.calculateEdgePosition("right", t, e, i, s);
751
+ return this.calculateEdgePosition("right", t, e, i, a);
752
752
  case "center":
753
753
  return this.calculateCenterPosition(i, t, e);
754
754
  case "random-edge":
755
- return this.calculateRandomEdge(t, e, i, s);
755
+ return this.calculateRandomEdge(t, e, i, a);
756
756
  case "circular":
757
757
  return this.calculateCircularPosition(
758
758
  t,
759
759
  e,
760
760
  i,
761
- o,
762
- a
761
+ n,
762
+ s
763
763
  );
764
764
  default:
765
- return this.calculateNearestEdge(t, e, i, s);
765
+ return this.calculateNearestEdge(t, e, i, a);
766
766
  }
767
767
  }
768
768
  /**
769
769
  * Calculate start position from the nearest edge (current default behavior)
770
770
  */
771
- calculateNearestEdge(t, e, i, o) {
772
- const a = t.x, c = t.y, s = a, h = i.width - a, l = c, u = i.height - c, r = Math.min(s, h, l, u);
771
+ calculateNearestEdge(t, e, i, n) {
772
+ const s = t.x, r = t.y, a = s, h = i.width - s, l = r, u = i.height - r, c = Math.min(a, h, l, u);
773
773
  let d = t.x, m = t.y;
774
- return r === s ? d = -(e.width + o) : r === h ? d = i.width + o : r === l ? m = -(e.height + o) : m = i.height + o, { x: d, y: m };
774
+ return c === a ? d = -(e.width + n) : c === h ? d = i.width + n : c === l ? m = -(e.height + n) : m = i.height + n, { x: d, y: m };
775
775
  }
776
776
  /**
777
777
  * Calculate start position from a specific edge
778
778
  */
779
- calculateEdgePosition(t, e, i, o, a) {
780
- let c = e.x, s = e.y;
779
+ calculateEdgePosition(t, e, i, n, s) {
780
+ let r = e.x, a = e.y;
781
781
  switch (t) {
782
782
  case "top":
783
- s = -(i.height + a);
783
+ a = -(i.height + s);
784
784
  break;
785
785
  case "bottom":
786
- s = o.height + a;
786
+ a = n.height + s;
787
787
  break;
788
788
  case "left":
789
- c = -(i.width + a);
789
+ r = -(i.width + s);
790
790
  break;
791
791
  case "right":
792
- c = o.width + a;
792
+ r = n.width + s;
793
793
  break;
794
794
  }
795
- return { x: c, y: s };
795
+ return { x: r, y: a };
796
796
  }
797
797
  /**
798
798
  * Calculate start position from center with scale animation
799
799
  */
800
800
  calculateCenterPosition(t, e, i) {
801
- const o = t.width / 2, a = t.height / 2;
801
+ const n = t.width / 2, s = t.height / 2;
802
802
  return {
803
- x: o,
804
- y: a,
803
+ x: n,
804
+ y: s,
805
805
  useScale: !0
806
806
  // Signal to use scale animation from 0
807
807
  };
@@ -809,17 +809,17 @@ class ce {
809
809
  /**
810
810
  * Calculate start position from a random edge
811
811
  */
812
- calculateRandomEdge(t, e, i, o) {
813
- const a = ["top", "bottom", "left", "right"], c = a[Math.floor(Math.random() * a.length)];
814
- return this.calculateEdgePosition(c, t, e, i, o);
812
+ calculateRandomEdge(t, e, i, n) {
813
+ const s = ["top", "bottom", "left", "right"], r = s[Math.floor(Math.random() * s.length)];
814
+ return this.calculateEdgePosition(r, t, e, i, n);
815
815
  }
816
816
  /**
817
817
  * Calculate start position on a circle around the container
818
818
  */
819
- calculateCircularPosition(t, e, i, o, a) {
820
- const c = this.config.start.circular || {}, s = c.distribution || "even";
819
+ calculateCircularPosition(t, e, i, n, s) {
820
+ const r = this.config.start.circular || {}, a = r.distribution || "even";
821
821
  let h;
822
- const l = c.radius || "120%";
822
+ const l = r.radius || "120%";
823
823
  if (typeof l == "string" && l.endsWith("%")) {
824
824
  const p = parseFloat(l) / 100;
825
825
  h = Math.sqrt(
@@ -828,39 +828,39 @@ class ce {
828
828
  } else
829
829
  h = typeof l == "number" ? l : 500;
830
830
  let u;
831
- s === "even" ? u = o / a * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
832
- const r = i.width / 2, d = i.height / 2, m = r + Math.cos(u) * h, b = d + Math.sin(u) * h;
831
+ a === "even" ? u = n / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
832
+ const c = i.width / 2, d = i.height / 2, m = c + Math.cos(u) * h, b = d + Math.sin(u) * h;
833
833
  return { x: m, y: b };
834
834
  }
835
835
  /**
836
836
  * Get animation parameters for an image
837
837
  */
838
838
  getAnimationParams(t) {
839
- const e = this.config.timing.duration, i = this.config.timing.stagger, o = this.config.easing;
839
+ const e = this.config.timing.duration, i = this.config.timing.stagger, n = this.config.easing;
840
840
  return {
841
841
  startTransform: "",
842
842
  // Will be computed by caller based on start position
843
843
  duration: e,
844
844
  delay: t * i,
845
- easing: o
845
+ easing: n
846
846
  };
847
847
  }
848
848
  /**
849
849
  * Build a CSS transform string for the start position
850
850
  * Uses pixel-based centering offset for reliable cross-browser behavior
851
851
  */
852
- buildStartTransform(t, e, i, o, a, c, s, h) {
853
- const l = t.x - e.x, u = t.y - e.y, r = s !== void 0 ? s : i, d = h !== void 0 ? h : o, m = a !== void 0 ? -a / 2 : 0, b = c !== void 0 ? -c / 2 : 0, p = a !== void 0 ? `translate(${m}px, ${b}px)` : "translate(-50%, -50%)";
854
- return t.useScale ? `${p} translate(${l}px, ${u}px) rotate(${r}deg) scale(0)` : `${p} translate(${l}px, ${u}px) rotate(${r}deg) scale(${d})`;
852
+ buildStartTransform(t, e, i, n, s, r, a, h) {
853
+ const l = t.x - e.x, u = t.y - e.y, c = a !== void 0 ? a : i, d = h !== void 0 ? h : n, m = s !== void 0 ? -s / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = s !== void 0 ? `translate(${m}px, ${b}px)` : "translate(-50%, -50%)";
854
+ return t.useScale ? `${p} translate(${l}px, ${u}px) rotate(${c}deg) scale(0)` : `${p} translate(${l}px, ${u}px) rotate(${c}deg) scale(${d})`;
855
855
  }
856
856
  /**
857
857
  * Build the final CSS transform string
858
858
  * Uses pixel-based centering offset for reliable cross-browser behavior
859
859
  */
860
- buildFinalTransform(t, e, i, o) {
861
- if (i !== void 0 && o !== void 0) {
862
- const a = -i / 2, c = -o / 2;
863
- return `translate(${a}px, ${c}px) rotate(${t}deg) scale(${e})`;
860
+ buildFinalTransform(t, e, i, n) {
861
+ if (i !== void 0 && n !== void 0) {
862
+ const s = -i / 2, r = -n / 2;
863
+ return `translate(${s}px, ${r}px) rotate(${t}deg) scale(${e})`;
864
864
  }
865
865
  return `translate(-50%, -50%) rotate(${t}deg) scale(${e})`;
866
866
  }
@@ -876,7 +876,7 @@ class ce {
876
876
  * Check if the current path type requires JavaScript animation
877
877
  */
878
878
  requiresJSAnimation() {
879
- return ae(this.pathConfig.type);
879
+ return ce(this.pathConfig.type);
880
880
  }
881
881
  /**
882
882
  * Get the path configuration
@@ -926,12 +926,12 @@ class ce {
926
926
  return t + (Math.random() - 0.5) * 60;
927
927
  if (typeof i == "number")
928
928
  return i;
929
- const o = i.max - i.min;
930
- return i.min + Math.random() * o;
929
+ const n = i.max - i.min;
930
+ return i.min + Math.random() * n;
931
931
  }
932
932
  case "spin": {
933
- const i = this.rotationConfig.spinCount ?? 1, o = this.resolveSpinDirection(t);
934
- return t + i * 360 * o;
933
+ const i = this.rotationConfig.spinCount ?? 1, n = this.resolveSpinDirection(t);
934
+ return t + i * 360 * n;
935
935
  }
936
936
  case "random":
937
937
  return t + (Math.random() - 0.5) * 60;
@@ -978,7 +978,7 @@ class ce {
978
978
  amplitude: 15,
979
979
  frequency: 3,
980
980
  decay: !0
981
- }, { amplitude: o, frequency: a, decay: c } = i, s = Math.sin(t * a * Math.PI * 2), h = c ? Math.pow(1 - t, 2) : 1, l = o * s * h;
981
+ }, { amplitude: n, frequency: s, decay: r } = i, a = Math.sin(t * s * Math.PI * 2), h = r ? Math.pow(1 - t, 2) : 1, l = n * a * h;
982
982
  return e + l;
983
983
  }
984
984
  /**
@@ -1035,15 +1035,15 @@ class ce {
1035
1035
  const i = this.scaleConfig.pop || {
1036
1036
  overshoot: 1.2,
1037
1037
  bounces: 1
1038
- }, { overshoot: o, bounces: a } = i, c = this.generateScaleBounceKeyframes(a, o);
1039
- let s = e;
1040
- for (let h = 0; h < c.length; h++)
1041
- if (t <= c[h].time) {
1042
- const l = h === 0 ? 0 : c[h - 1].time, u = h === 0 ? e : c[h - 1].scale, r = (t - l) / (c[h].time - l), d = this.easeOutQuad(r);
1043
- s = u + (c[h].scale - u) * d;
1038
+ }, { overshoot: n, bounces: s } = i, r = this.generateScaleBounceKeyframes(s, n);
1039
+ let a = e;
1040
+ for (let h = 0; h < r.length; h++)
1041
+ if (t <= r[h].time) {
1042
+ const l = h === 0 ? 0 : r[h - 1].time, u = h === 0 ? e : r[h - 1].scale, c = (t - l) / (r[h].time - l), d = this.easeOutQuad(c);
1043
+ a = u + (r[h].scale - u) * d;
1044
1044
  break;
1045
1045
  }
1046
- return s * e;
1046
+ return a * e;
1047
1047
  }
1048
1048
  /**
1049
1049
  * Generate keyframes for scale bounce animation
@@ -1051,12 +1051,12 @@ class ce {
1051
1051
  generateScaleBounceKeyframes(t, e) {
1052
1052
  const i = [];
1053
1053
  i.push({ time: 0.5, scale: e });
1054
- let o = e;
1055
- const a = 0.5, s = 0.5 / (t * 2);
1054
+ let n = e;
1055
+ const s = 0.5, a = 0.5 / (t * 2);
1056
1056
  let h = 0.5;
1057
1057
  for (let l = 0; l < t; l++) {
1058
- const u = 1 - (o - 1) * a;
1059
- h += s, i.push({ time: h, scale: u }), o = 1 + (o - 1) * a * a, h += s, l < t - 1 && i.push({ time: h, scale: o });
1058
+ const u = 1 - (n - 1) * s;
1059
+ h += a, i.push({ time: h, scale: u }), n = 1 + (n - 1) * s * s, h += a, l < t - 1 && i.push({ time: h, scale: n });
1060
1060
  }
1061
1061
  return i.push({ time: 1, scale: 1 }), i;
1062
1062
  }
@@ -1067,7 +1067,7 @@ class ce {
1067
1067
  return 1 - (1 - t) * (1 - t);
1068
1068
  }
1069
1069
  }
1070
- class le {
1070
+ class de {
1071
1071
  constructor(t, e = {}) {
1072
1072
  this.config = t, this.imageConfig = e;
1073
1073
  }
@@ -1079,20 +1079,20 @@ class le {
1079
1079
  * @returns Array of layout objects with position, rotation, scale
1080
1080
  */
1081
1081
  generate(t, e, i = {}) {
1082
- var x, L, j, P, D, U, k, F, S;
1083
- const o = [], { width: a, height: c } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? 200, l = ((x = this.imageConfig.rotation) == null ? void 0 : x.mode) ?? "none", u = ((j = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : j.min) ?? -15, r = ((D = (P = this.imageConfig.rotation) == null ? void 0 : P.range) == null ? void 0 : D.max) ?? 15, d = ((k = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : k.min) ?? 1, m = ((S = (F = this.imageConfig.sizing) == null ? void 0 : F.variance) == null ? void 0 : S.max) ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, v = a - s - g, w = c - s - f, E = s + g, A = s + f;
1084
- for (let z = 0; z < t; z++) {
1085
- const $ = this.random(E, v), T = this.random(A, w), R = l === "random" ? this.random(u, r) : 0, M = b ? this.random(d, m) : 1, _ = h * M, Z = {
1086
- id: z,
1087
- x: $,
1088
- y: T,
1089
- rotation: R,
1082
+ var x, L, k, U, D, P, j, C, S;
1083
+ const n = [], { width: s, height: r } = e, a = this.config.spacing.padding, h = i.fixedHeight ?? 200, l = ((x = this.imageConfig.rotation) == null ? void 0 : x.mode) ?? "none", u = ((k = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : k.min) ?? -15, c = ((D = (U = this.imageConfig.rotation) == null ? void 0 : U.range) == null ? void 0 : D.max) ?? 15, d = ((j = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : j.min) ?? 1, m = ((S = (C = this.imageConfig.sizing) == null ? void 0 : C.variance) == null ? void 0 : S.max) ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, v = s - a - g, w = r - a - f, E = a + g, R = a + f;
1084
+ for (let A = 0; A < t; A++) {
1085
+ const O = this.random(E, v), z = this.random(R, w), T = l === "random" ? this.random(u, c) : 0, M = b ? this.random(d, m) : 1, _ = h * M, K = {
1086
+ id: A,
1087
+ x: O,
1088
+ y: z,
1089
+ rotation: T,
1090
1090
  scale: M,
1091
1091
  baseSize: _
1092
1092
  };
1093
- o.push(Z);
1093
+ n.push(K);
1094
1094
  }
1095
- return o;
1095
+ return n;
1096
1096
  }
1097
1097
  /**
1098
1098
  * Utility: Generate random number between min and max
@@ -1104,7 +1104,7 @@ class le {
1104
1104
  return Math.random() * (e - t) + t;
1105
1105
  }
1106
1106
  }
1107
- class he {
1107
+ class ue {
1108
1108
  constructor(t, e = {}) {
1109
1109
  this.config = t, this.imageConfig = e;
1110
1110
  }
@@ -1116,52 +1116,52 @@ class he {
1116
1116
  * @returns Array of layout objects with position, rotation, scale
1117
1117
  */
1118
1118
  generate(t, e, i = {}) {
1119
- var L, j, P, D, U, k, F, S, z;
1120
- const o = [], { width: a, height: c } = e, { debugRadials: s } = this.config, h = i.fixedHeight ?? 200, l = ((L = this.imageConfig.rotation) == null ? void 0 : L.mode) ?? "none", u = ((P = (j = this.imageConfig.rotation) == null ? void 0 : j.range) == null ? void 0 : P.min) ?? -15, r = ((U = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : U.max) ?? 15, d = ((F = (k = this.imageConfig.sizing) == null ? void 0 : k.variance) == null ? void 0 : F.min) ?? 1, m = ((z = (S = this.imageConfig.sizing) == null ? void 0 : S.variance) == null ? void 0 : z.max) ?? 1, b = d !== 1 || m !== 1, p = this.config.scaleDecay ?? 0, g = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, v = a / 2, w = c / 2, E = Math.ceil(Math.sqrt(t));
1119
+ var L, k, U, D, P, j, C, S, A;
1120
+ const n = [], { width: s, height: r } = e, { debugRadials: a } = this.config, h = i.fixedHeight ?? 200, l = ((L = this.imageConfig.rotation) == null ? void 0 : L.mode) ?? "none", u = ((U = (k = this.imageConfig.rotation) == null ? void 0 : k.range) == null ? void 0 : U.min) ?? -15, c = ((P = (D = this.imageConfig.rotation) == null ? void 0 : D.range) == null ? void 0 : P.max) ?? 15, d = ((C = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : C.min) ?? 1, m = ((A = (S = this.imageConfig.sizing) == null ? void 0 : S.variance) == null ? void 0 : A.max) ?? 1, b = d !== 1 || m !== 1, p = this.config.scaleDecay ?? 0, g = ["green", "blue", "red", "yellow", "orange", "purple"], f = i.fixedHeight ?? h, v = s / 2, w = r / 2, E = Math.ceil(Math.sqrt(t));
1121
1121
  if (t > 0) {
1122
- const $ = b ? this.random(d, m) : 1, T = f * $;
1123
- o.push({
1122
+ const O = b ? this.random(d, m) : 1, z = f * O;
1123
+ n.push({
1124
1124
  id: 0,
1125
1125
  x: v,
1126
1126
  y: w,
1127
- rotation: l === "random" ? this.random(u * 0.33, r * 0.33) : 0,
1127
+ rotation: l === "random" ? this.random(u * 0.33, c * 0.33) : 0,
1128
1128
  // Less rotation for center
1129
- scale: $,
1130
- baseSize: T,
1129
+ scale: O,
1130
+ baseSize: z,
1131
1131
  zIndex: 100,
1132
1132
  // Center image is highest
1133
- borderColor: s ? "cyan" : void 0
1133
+ borderColor: a ? "cyan" : void 0
1134
1134
  });
1135
1135
  }
1136
- let A = 1, x = 1;
1137
- for (; A < t; ) {
1138
- const $ = x / E, T = p > 0 ? 1 - $ * p * 0.5 : 1, R = x * (f * 0.8), M = R * 1.5, _ = Math.PI * (3 * (M + R) - Math.sqrt((3 * M + R) * (M + 3 * R))), Z = this.estimateWidth(f), B = Math.floor(_ / (Z * 0.7));
1139
- if (B === 0) {
1136
+ let R = 1, x = 1;
1137
+ for (; R < t; ) {
1138
+ const O = x / E, z = p > 0 ? 1 - O * p * 0.5 : 1, T = x * (f * 0.8), M = T * 1.5, _ = Math.PI * (3 * (M + T) - Math.sqrt((3 * M + T) * (M + 3 * T))), K = this.estimateWidth(f), X = Math.floor(_ / (K * 0.7));
1139
+ if (X === 0) {
1140
1140
  x++;
1141
1141
  continue;
1142
1142
  }
1143
- const X = 2 * Math.PI / B, K = x * (20 * Math.PI / 180);
1144
- for (let N = 0; N < B && A < t; N++) {
1145
- const Q = N * X + K, tt = b ? this.random(d, m) : 1, q = T * tt, et = f * q;
1146
- let Y = v + Math.cos(Q) * M, C = w + Math.sin(Q) * R;
1147
- const O = this.config.spacing.padding ?? 50, W = et * 1.5 / 2, H = et / 2;
1148
- Y - W < O ? Y = O + W : Y + W > a - O && (Y = a - O - W), C - H < O ? C = O + H : C + H > c - O && (C = c - O - H);
1149
- const it = l === "random" ? this.random(u, r) : 0;
1150
- o.push({
1151
- id: A,
1143
+ const B = 2 * Math.PI / X, Z = x * (20 * Math.PI / 180);
1144
+ for (let W = 0; W < X && R < t; W++) {
1145
+ const Q = W * B + Z, tt = b ? this.random(d, m) : 1, q = z * tt, et = f * q;
1146
+ let Y = v + Math.cos(Q) * M, F = w + Math.sin(Q) * T;
1147
+ const $ = this.config.spacing.padding ?? 50, G = et * 1.5 / 2, H = et / 2;
1148
+ Y - G < $ ? Y = $ + G : Y + G > s - $ && (Y = s - $ - G), F - H < $ ? F = $ + H : F + H > r - $ && (F = r - $ - H);
1149
+ const it = l === "random" ? this.random(u, c) : 0;
1150
+ n.push({
1151
+ id: R,
1152
1152
  x: Y,
1153
- y: C,
1153
+ y: F,
1154
1154
  rotation: it,
1155
1155
  scale: q,
1156
1156
  baseSize: et,
1157
1157
  zIndex: Math.max(1, 100 - x),
1158
1158
  // Outer rings have lower z-index
1159
- borderColor: s ? g[(x - 1) % g.length] : void 0
1160
- }), A++;
1159
+ borderColor: a ? g[(x - 1) % g.length] : void 0
1160
+ }), R++;
1161
1161
  }
1162
1162
  x++;
1163
1163
  }
1164
- return o;
1164
+ return n;
1165
1165
  }
1166
1166
  /**
1167
1167
  * Estimate image width based on height
@@ -1182,7 +1182,7 @@ class he {
1182
1182
  return Math.random() * (e - t) + t;
1183
1183
  }
1184
1184
  }
1185
- const de = {
1185
+ const ge = {
1186
1186
  columns: "auto",
1187
1187
  rows: "auto",
1188
1188
  stagger: "none",
@@ -1192,7 +1192,7 @@ const de = {
1192
1192
  alignment: "center",
1193
1193
  gap: 10,
1194
1194
  overflowOffset: 0.25
1195
- }, Ft = [
1195
+ }, Lt = [
1196
1196
  { x: 1, y: 1 },
1197
1197
  // bottom-right
1198
1198
  { x: -1, y: -1 },
@@ -1210,7 +1210,7 @@ const de = {
1210
1210
  { x: 0, y: 1 }
1211
1211
  // down
1212
1212
  ];
1213
- class ue {
1213
+ class fe {
1214
1214
  constructor(t, e = {}) {
1215
1215
  this.config = t, this.imageConfig = e;
1216
1216
  }
@@ -1222,87 +1222,87 @@ class ue {
1222
1222
  * @returns Array of layout objects with position, rotation, scale
1223
1223
  */
1224
1224
  generate(t, e, i = {}) {
1225
- var B, X, K, N, Q, tt, q, et, Y;
1226
- const o = [], { width: a, height: c } = e, s = { ...de, ...this.config.grid }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((B = this.imageConfig.rotation) == null ? void 0 : B.mode) ?? "none", r = ((K = (X = this.imageConfig.sizing) == null ? void 0 : X.variance) == null ? void 0 : K.min) ?? 1, d = ((Q = (N = this.imageConfig.sizing) == null ? void 0 : N.variance) == null ? void 0 : Q.max) ?? 1, m = r !== 1 || d !== 1, b = a - 2 * h, p = c - 2 * h, { columns: g, rows: f } = this.calculateGridDimensions(
1225
+ var X, B, Z, W, Q, tt, q, et, Y;
1226
+ const n = [], { width: s, height: r } = e, a = { ...ge, ...this.config.grid }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((X = this.imageConfig.rotation) == null ? void 0 : X.mode) ?? "none", c = ((Z = (B = this.imageConfig.sizing) == null ? void 0 : B.variance) == null ? void 0 : Z.min) ?? 1, d = ((Q = (W = this.imageConfig.sizing) == null ? void 0 : W.variance) == null ? void 0 : Q.max) ?? 1, m = c !== 1 || d !== 1, b = s - 2 * h, p = r - 2 * h, { columns: g, rows: f } = this.calculateGridDimensions(
1227
1227
  t,
1228
1228
  b,
1229
1229
  p,
1230
1230
  l,
1231
- s
1232
- ), v = s.stagger === "row", w = s.stagger === "column", E = v ? g + 0.5 : g, A = w ? f + 0.5 : f, x = (b - s.gap * (g - 1)) / E, L = (p - s.gap * (f - 1)) / A, j = v ? x / 2 : 0, P = w ? L / 2 : 0, D = 1 + s.overlap, U = Math.min(x, L) * D, k = i.fixedHeight ? Math.min(i.fixedHeight, U) : U, F = g * x + (g - 1) * s.gap + j, S = f * L + (f - 1) * s.gap + P, z = h + (b - F) / 2, $ = h + (p - S) / 2, T = g * f, R = s.columns !== "auto" && s.rows !== "auto", M = R && t > T;
1231
+ a
1232
+ ), v = a.stagger === "row", w = a.stagger === "column", E = v ? g + 0.5 : g, R = w ? f + 0.5 : f, x = (b - a.gap * (g - 1)) / E, L = (p - a.gap * (f - 1)) / R, k = v ? x / 2 : 0, U = w ? L / 2 : 0, D = 1 + a.overlap, P = Math.min(x, L) * D, j = i.fixedHeight ? Math.min(i.fixedHeight, P) : P, C = g * x + (g - 1) * a.gap + k, S = f * L + (f - 1) * a.gap + U, A = h + (b - C) / 2, O = h + (p - S) / 2, z = g * f, T = a.columns !== "auto" && a.rows !== "auto", M = T && t > z;
1233
1233
  typeof window < "u" && (window.__gridOverflowDebug = {
1234
- gridConfigColumns: s.columns,
1235
- gridConfigRows: s.rows,
1234
+ gridConfigColumns: a.columns,
1235
+ gridConfigRows: a.rows,
1236
1236
  columns: g,
1237
1237
  rows: f,
1238
- cellCount: T,
1239
- hasFixedGrid: R,
1238
+ cellCount: z,
1239
+ hasFixedGrid: T,
1240
1240
  imageCount: t,
1241
1241
  isOverflowMode: M
1242
1242
  });
1243
- const _ = M ? new Array(T).fill(0) : [], Z = Math.min(x, L) * s.overflowOffset;
1244
- for (let C = 0; C < t; C++) {
1245
- let O, G, W = 0;
1246
- if (M && C >= T) {
1247
- const J = C - T, V = J % T;
1248
- W = Math.floor(J / T) + 1, _[V]++, s.fillDirection === "row" ? (O = V % g, G = Math.floor(V / g)) : (G = V % f, O = Math.floor(V / f));
1243
+ const _ = M ? new Array(z).fill(0) : [], K = Math.min(x, L) * a.overflowOffset;
1244
+ for (let F = 0; F < t; F++) {
1245
+ let $, N, G = 0;
1246
+ if (M && F >= z) {
1247
+ const J = F - z, V = J % z;
1248
+ G = Math.floor(J / z) + 1, _[V]++, a.fillDirection === "row" ? ($ = V % g, N = Math.floor(V / g)) : (N = V % f, $ = Math.floor(V / f));
1249
1249
  } else
1250
- s.fillDirection === "row" ? (O = C % g, G = Math.floor(C / g)) : (G = C % f, O = Math.floor(C / f));
1251
- let H = z + O * (x + s.gap) + x / 2, it = $ + G * (L + s.gap) + L / 2;
1252
- if (s.stagger === "row" && G % 2 === 1 ? H += x / 2 : s.stagger === "column" && O % 2 === 1 && (it += L / 2), W > 0) {
1253
- const J = (W - 1) % Ft.length, V = Ft[J];
1254
- H += V.x * Z, it += V.y * Z;
1250
+ a.fillDirection === "row" ? ($ = F % g, N = Math.floor(F / g)) : (N = F % f, $ = Math.floor(F / f));
1251
+ let H = A + $ * (x + a.gap) + x / 2, it = O + N * (L + a.gap) + L / 2;
1252
+ if (a.stagger === "row" && N % 2 === 1 ? H += x / 2 : a.stagger === "column" && $ % 2 === 1 && (it += L / 2), G > 0) {
1253
+ const J = (G - 1) % Lt.length, V = Lt[J];
1254
+ H += V.x * K, it += V.y * K;
1255
1255
  }
1256
- if (s.jitter > 0) {
1257
- const J = x / 2 * s.jitter, V = L / 2 * s.jitter;
1256
+ if (a.jitter > 0) {
1257
+ const J = x / 2 * a.jitter, V = L / 2 * a.jitter;
1258
1258
  H += this.random(-J, J), it += this.random(-V, V);
1259
1259
  }
1260
1260
  let nt = H, ot = it;
1261
- if (!M && s.fillDirection === "row") {
1261
+ if (!M && a.fillDirection === "row") {
1262
1262
  const J = t % g || g;
1263
- if (G === Math.floor((t - 1) / g) && J < g) {
1264
- const At = J * x + (J - 1) * s.gap;
1265
- let xt = 0;
1266
- s.alignment === "center" ? xt = (F - At) / 2 : s.alignment === "end" && (xt = F - At), nt += xt;
1263
+ if (N === Math.floor((t - 1) / g) && J < g) {
1264
+ const Mt = J * x + (J - 1) * a.gap;
1265
+ let St = 0;
1266
+ a.alignment === "center" ? St = (C - Mt) / 2 : a.alignment === "end" && (St = C - Mt), nt += St;
1267
1267
  }
1268
1268
  }
1269
- const mt = m ? this.random(r, d) : 1, at = k * mt, dt = at * 1.5 / 2, ut = at / 2, bt = h + dt, yt = a - h - dt, Ut = h + ut, Pt = c - h - ut;
1270
- nt = Math.max(bt, Math.min(nt, yt)), ot = Math.max(Ut, Math.min(ot, Pt));
1271
- let vt = 0;
1269
+ const pt = m ? this.random(c, d) : 1, at = j * pt, dt = at * 1.5 / 2, ut = at / 2, yt = h + dt, vt = s - h - dt, Ht = h + ut, _t = r - h - ut;
1270
+ nt = Math.max(yt, Math.min(nt, vt)), ot = Math.max(Ht, Math.min(ot, _t));
1271
+ let wt = 0;
1272
1272
  if (u === "random") {
1273
1273
  const J = ((q = (tt = this.imageConfig.rotation) == null ? void 0 : tt.range) == null ? void 0 : q.min) ?? -15, V = ((Y = (et = this.imageConfig.rotation) == null ? void 0 : et.range) == null ? void 0 : Y.max) ?? 15;
1274
- s.jitter > 0 ? vt = this.random(J * s.jitter, V * s.jitter) : vt = this.random(J, V);
1274
+ a.jitter > 0 ? wt = this.random(J * a.jitter, V * a.jitter) : wt = this.random(J, V);
1275
1275
  }
1276
- let wt;
1277
- M && W > 0 ? wt = 50 - W : wt = M ? 100 + C : C + 1, o.push({
1278
- id: C,
1276
+ let xt;
1277
+ M && G > 0 ? xt = 50 - G : xt = M ? 100 + F : F + 1, n.push({
1278
+ id: F,
1279
1279
  x: nt,
1280
1280
  y: ot,
1281
- rotation: vt,
1282
- scale: mt,
1281
+ rotation: wt,
1282
+ scale: pt,
1283
1283
  baseSize: at,
1284
- zIndex: wt
1284
+ zIndex: xt
1285
1285
  });
1286
1286
  }
1287
- return o;
1287
+ return n;
1288
1288
  }
1289
1289
  /**
1290
1290
  * Calculate optimal grid dimensions based on image count and container
1291
1291
  */
1292
- calculateGridDimensions(t, e, i, o, a) {
1293
- let c, s;
1294
- if (a.columns !== "auto" && a.rows !== "auto")
1295
- c = a.columns, s = a.rows;
1296
- else if (a.columns !== "auto")
1297
- c = a.columns, s = Math.ceil(t / c);
1298
- else if (a.rows !== "auto")
1299
- s = a.rows, c = Math.ceil(t / s);
1292
+ calculateGridDimensions(t, e, i, n, s) {
1293
+ let r, a;
1294
+ if (s.columns !== "auto" && s.rows !== "auto")
1295
+ r = s.columns, a = s.rows;
1296
+ else if (s.columns !== "auto")
1297
+ r = s.columns, a = Math.ceil(t / r);
1298
+ else if (s.rows !== "auto")
1299
+ a = s.rows, r = Math.ceil(t / a);
1300
1300
  else {
1301
1301
  const h = e / i;
1302
- for (c = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), s = Math.ceil(t / c); c > 1 && (c - 1) * s >= t; )
1303
- c--;
1302
+ for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), a = Math.ceil(t / r); r > 1 && (r - 1) * a >= t; )
1303
+ r--;
1304
1304
  }
1305
- return { columns: Math.max(1, c), rows: Math.max(1, s) };
1305
+ return { columns: Math.max(1, r), rows: Math.max(1, a) };
1306
1306
  }
1307
1307
  /**
1308
1308
  * Utility: Generate random number between min and max
@@ -1311,14 +1311,14 @@ class ue {
1311
1311
  return Math.random() * (e - t) + t;
1312
1312
  }
1313
1313
  }
1314
- const ge = Math.PI * (3 - Math.sqrt(5)), fe = {
1314
+ const me = Math.PI * (3 - Math.sqrt(5)), pe = {
1315
1315
  spiralType: "golden",
1316
1316
  direction: "counterclockwise",
1317
1317
  tightness: 1,
1318
1318
  scaleDecay: 0,
1319
1319
  startAngle: 0
1320
1320
  };
1321
- class me {
1321
+ class be {
1322
1322
  constructor(t, e = {}) {
1323
1323
  this.config = t, this.imageConfig = e;
1324
1324
  }
@@ -1330,81 +1330,81 @@ class me {
1330
1330
  * @returns Array of layout objects with position, rotation, scale
1331
1331
  */
1332
1332
  generate(t, e, i = {}) {
1333
- var A, x, L, j, P, D, U, k, F;
1334
- const o = [], { width: a, height: c } = e, s = { ...fe, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((A = this.imageConfig.rotation) == null ? void 0 : A.mode) ?? "none", r = ((L = (x = this.imageConfig.rotation) == null ? void 0 : x.range) == null ? void 0 : L.min) ?? -15, d = ((P = (j = this.imageConfig.rotation) == null ? void 0 : j.range) == null ? void 0 : P.max) ?? 15, m = ((U = (D = this.imageConfig.sizing) == null ? void 0 : D.variance) == null ? void 0 : U.min) ?? 1, b = ((F = (k = this.imageConfig.sizing) == null ? void 0 : k.variance) == null ? void 0 : F.max) ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? s.scaleDecay, f = a / 2, v = c / 2, w = Math.min(
1333
+ var R, x, L, k, U, D, P, j, C;
1334
+ const n = [], { width: s, height: r } = e, a = { ...pe, ...this.config.spiral }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((R = this.imageConfig.rotation) == null ? void 0 : R.mode) ?? "none", c = ((L = (x = this.imageConfig.rotation) == null ? void 0 : x.range) == null ? void 0 : L.min) ?? -15, d = ((U = (k = this.imageConfig.rotation) == null ? void 0 : k.range) == null ? void 0 : U.max) ?? 15, m = ((P = (D = this.imageConfig.sizing) == null ? void 0 : D.variance) == null ? void 0 : P.min) ?? 1, b = ((C = (j = this.imageConfig.sizing) == null ? void 0 : j.variance) == null ? void 0 : C.max) ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? a.scaleDecay, f = s / 2, v = r / 2, w = Math.min(
1335
1335
  f - h - l / 2,
1336
1336
  v - h - l / 2
1337
- ), E = s.direction === "clockwise" ? -1 : 1;
1337
+ ), E = a.direction === "clockwise" ? -1 : 1;
1338
1338
  for (let S = 0; S < t; S++) {
1339
- let z, $;
1340
- if (s.spiralType === "golden")
1341
- z = S * ge * E + s.startAngle, $ = this.calculateGoldenRadius(S, t, w, s.tightness);
1342
- else if (s.spiralType === "archimedean") {
1343
- const H = S * 0.5 * s.tightness;
1344
- z = H * E + s.startAngle, $ = this.calculateArchimedeanRadius(H, t, w, s.tightness);
1339
+ let A, O;
1340
+ if (a.spiralType === "golden")
1341
+ A = S * me * E + a.startAngle, O = this.calculateGoldenRadius(S, t, w, a.tightness);
1342
+ else if (a.spiralType === "archimedean") {
1343
+ const H = S * 0.5 * a.tightness;
1344
+ A = H * E + a.startAngle, O = this.calculateArchimedeanRadius(H, t, w, a.tightness);
1345
1345
  } else {
1346
- const H = S * 0.3 * s.tightness;
1347
- z = H * E + s.startAngle, $ = this.calculateLogarithmicRadius(H, t, w, s.tightness);
1346
+ const H = S * 0.3 * a.tightness;
1347
+ A = H * E + a.startAngle, O = this.calculateLogarithmicRadius(H, t, w, a.tightness);
1348
1348
  }
1349
- const T = f + Math.cos(z) * $, R = v + Math.sin(z) * $, M = $ / w, _ = g > 0 ? 1 - M * g * 0.5 : 1, Z = p ? this.random(m, b) : 1, B = _ * Z, X = l * B, N = X * 1.5 / 2, Q = X / 2, tt = h + N, q = a - h - N, et = h + Q, Y = c - h - Q, C = Math.max(tt, Math.min(T, q)), O = Math.max(et, Math.min(R, Y));
1350
- let G = 0;
1349
+ const z = f + Math.cos(A) * O, T = v + Math.sin(A) * O, M = O / w, _ = g > 0 ? 1 - M * g * 0.5 : 1, K = p ? this.random(m, b) : 1, X = _ * K, B = l * X, W = B * 1.5 / 2, Q = B / 2, tt = h + W, q = s - h - W, et = h + Q, Y = r - h - Q, F = Math.max(tt, Math.min(z, q)), $ = Math.max(et, Math.min(T, Y));
1350
+ let N = 0;
1351
1351
  if (u === "random") {
1352
- const H = z * 180 / Math.PI % 360, it = this.random(r, d);
1353
- G = s.spiralType === "golden" ? it : H * 0.1 + it * 0.9;
1354
- } else u === "tangent" && (G = this.calculateSpiralTangent(z, $, s));
1355
- const W = t - S;
1356
- o.push({
1352
+ const H = A * 180 / Math.PI % 360, it = this.random(c, d);
1353
+ N = a.spiralType === "golden" ? it : H * 0.1 + it * 0.9;
1354
+ } else u === "tangent" && (N = this.calculateSpiralTangent(A, O, a));
1355
+ const G = t - S;
1356
+ n.push({
1357
1357
  id: S,
1358
- x: C,
1359
- y: O,
1360
- rotation: G,
1361
- scale: B,
1362
- baseSize: X,
1363
- zIndex: W
1358
+ x: F,
1359
+ y: $,
1360
+ rotation: N,
1361
+ scale: X,
1362
+ baseSize: B,
1363
+ zIndex: G
1364
1364
  });
1365
1365
  }
1366
- return o;
1366
+ return n;
1367
1367
  }
1368
1368
  /**
1369
1369
  * Calculate tangent angle for spiral curve at given position
1370
1370
  * This aligns the image along the spiral's direction of travel
1371
1371
  */
1372
1372
  calculateSpiralTangent(t, e, i) {
1373
- let o;
1373
+ let n;
1374
1374
  if (i.spiralType === "golden")
1375
- o = t + Math.PI / 2;
1375
+ n = t + Math.PI / 2;
1376
1376
  else if (i.spiralType === "archimedean") {
1377
- const c = 1 / i.tightness, s = Math.atan(e / c);
1378
- o = t + s;
1377
+ const r = 1 / i.tightness, a = Math.atan(e / r);
1378
+ n = t + a;
1379
1379
  } else {
1380
- const c = 0.15 / i.tightness, s = Math.atan(1 / c);
1381
- o = t + s;
1380
+ const r = 0.15 / i.tightness, a = Math.atan(1 / r);
1381
+ n = t + a;
1382
1382
  }
1383
- return o * 180 / Math.PI % 360 - 90;
1383
+ return n * 180 / Math.PI % 360 - 90;
1384
1384
  }
1385
1385
  /**
1386
1386
  * Calculate radius for golden spiral (Vogel's model)
1387
1387
  * Creates even distribution like sunflower seeds
1388
1388
  */
1389
- calculateGoldenRadius(t, e, i, o) {
1390
- const c = i / Math.sqrt(e) * Math.sqrt(t) / o;
1391
- return Math.min(c, i);
1389
+ calculateGoldenRadius(t, e, i, n) {
1390
+ const r = i / Math.sqrt(e) * Math.sqrt(t) / n;
1391
+ return Math.min(r, i);
1392
1392
  }
1393
1393
  /**
1394
1394
  * Calculate radius for Archimedean spiral
1395
1395
  * r = a + b*θ (constant spacing between arms)
1396
1396
  */
1397
- calculateArchimedeanRadius(t, e, i, o) {
1398
- const a = e * 0.5 * o;
1399
- return t / a * i;
1397
+ calculateArchimedeanRadius(t, e, i, n) {
1398
+ const s = e * 0.5 * n;
1399
+ return t / s * i;
1400
1400
  }
1401
1401
  /**
1402
1402
  * Calculate radius for logarithmic (equiangular) spiral
1403
1403
  * r = a * e^(b*θ)
1404
1404
  */
1405
- calculateLogarithmicRadius(t, e, i, o) {
1406
- const a = i * 0.05, c = 0.15 / o, s = a * Math.exp(c * t), h = e * 0.3 * o, l = a * Math.exp(c * h);
1407
- return s / l * i;
1405
+ calculateLogarithmicRadius(t, e, i, n) {
1406
+ const s = i * 0.05, r = 0.15 / n, a = s * Math.exp(r * t), h = e * 0.3 * n, l = s * Math.exp(r * h);
1407
+ return a / l * i;
1408
1408
  }
1409
1409
  /**
1410
1410
  * Utility: Generate random number between min and max
@@ -1413,7 +1413,7 @@ class me {
1413
1413
  return Math.random() * (e - t) + t;
1414
1414
  }
1415
1415
  }
1416
- const pe = {
1416
+ const ye = {
1417
1417
  clusterCount: "auto",
1418
1418
  clusterSpread: 150,
1419
1419
  clusterSpacing: 200,
@@ -1421,7 +1421,7 @@ const pe = {
1421
1421
  overlap: 0.3,
1422
1422
  distribution: "gaussian"
1423
1423
  };
1424
- class be {
1424
+ class ve {
1425
1425
  constructor(t, e = {}) {
1426
1426
  this.config = t, this.imageConfig = e;
1427
1427
  }
@@ -1433,88 +1433,88 @@ class be {
1433
1433
  * @returns Array of layout objects with position, rotation, scale
1434
1434
  */
1435
1435
  generate(t, e, i = {}) {
1436
- var E, A, x, L, j, P, D, U, k;
1437
- const o = [], { width: a, height: c } = e, s = { ...pe, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((E = this.imageConfig.rotation) == null ? void 0 : E.mode) ?? "none", r = ((x = (A = this.imageConfig.rotation) == null ? void 0 : A.range) == null ? void 0 : x.min) ?? -15, d = ((j = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : j.max) ?? 15, m = ((D = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : D.min) ?? 1, b = ((k = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : k.max) ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
1436
+ var E, R, x, L, k, U, D, P, j;
1437
+ const n = [], { width: s, height: r } = e, a = { ...ye, ...this.config.cluster }, h = this.config.spacing.padding, l = i.fixedHeight ?? 200, u = ((E = this.imageConfig.rotation) == null ? void 0 : E.mode) ?? "none", c = ((x = (R = this.imageConfig.rotation) == null ? void 0 : R.range) == null ? void 0 : x.min) ?? -15, d = ((k = (L = this.imageConfig.rotation) == null ? void 0 : L.range) == null ? void 0 : k.max) ?? 15, m = ((D = (U = this.imageConfig.sizing) == null ? void 0 : U.variance) == null ? void 0 : D.min) ?? 1, b = ((j = (P = this.imageConfig.sizing) == null ? void 0 : P.variance) == null ? void 0 : j.max) ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
1438
1438
  t,
1439
- s.clusterCount,
1440
- a,
1441
- c,
1442
- s.clusterSpacing
1439
+ a.clusterCount,
1440
+ s,
1441
+ r,
1442
+ a.clusterSpacing
1443
1443
  ), f = this.generateClusterCenters(
1444
1444
  g,
1445
- a,
1446
- c,
1445
+ s,
1446
+ r,
1447
1447
  h,
1448
- s
1448
+ a
1449
1449
  ), v = new Array(g).fill(0);
1450
- for (let F = 0; F < t; F++)
1451
- v[F % g]++;
1450
+ for (let C = 0; C < t; C++)
1451
+ v[C % g]++;
1452
1452
  let w = 0;
1453
- for (let F = 0; F < g; F++) {
1454
- const S = f[F], z = v[F];
1455
- for (let $ = 0; $ < z; $++) {
1456
- let T, R;
1457
- if (s.distribution === "gaussian")
1458
- T = this.gaussianRandom() * S.spread, R = this.gaussianRandom() * S.spread;
1453
+ for (let C = 0; C < g; C++) {
1454
+ const S = f[C], A = v[C];
1455
+ for (let O = 0; O < A; O++) {
1456
+ let z, T;
1457
+ if (a.distribution === "gaussian")
1458
+ z = this.gaussianRandom() * S.spread, T = this.gaussianRandom() * S.spread;
1459
1459
  else {
1460
- const G = this.random(0, Math.PI * 2), W = this.random(0, S.spread);
1461
- T = Math.cos(G) * W, R = Math.sin(G) * W;
1460
+ const N = this.random(0, Math.PI * 2), G = this.random(0, S.spread);
1461
+ z = Math.cos(N) * G, T = Math.sin(N) * G;
1462
1462
  }
1463
- const M = 1 + s.overlap * 0.5, _ = 1 + s.overlap * 0.3;
1464
- T /= M, R /= M;
1465
- const Z = p ? this.random(m, b) : 1, B = _ * Z, X = l * B;
1466
- let K = S.x + T, N = S.y + R;
1467
- const tt = X * 1.5 / 2, q = X / 2;
1468
- K = Math.max(h + tt, Math.min(K, a - h - tt)), N = Math.max(h + q, Math.min(N, c - h - q));
1469
- const et = u === "random" ? this.random(r, d) : 0, C = Math.sqrt(T * T + R * R) / S.spread, O = Math.round((1 - C) * 50) + 1;
1470
- o.push({
1463
+ const M = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
1464
+ z /= M, T /= M;
1465
+ const K = p ? this.random(m, b) : 1, X = _ * K, B = l * X;
1466
+ let Z = S.x + z, W = S.y + T;
1467
+ const tt = B * 1.5 / 2, q = B / 2;
1468
+ Z = Math.max(h + tt, Math.min(Z, s - h - tt)), W = Math.max(h + q, Math.min(W, r - h - q));
1469
+ const et = u === "random" ? this.random(c, d) : 0, F = Math.sqrt(z * z + T * T) / S.spread, $ = Math.round((1 - F) * 50) + 1;
1470
+ n.push({
1471
1471
  id: w,
1472
- x: K,
1473
- y: N,
1472
+ x: Z,
1473
+ y: W,
1474
1474
  rotation: et,
1475
- scale: B,
1476
- baseSize: X,
1477
- zIndex: O
1475
+ scale: X,
1476
+ baseSize: B,
1477
+ zIndex: $
1478
1478
  }), w++;
1479
1479
  }
1480
1480
  }
1481
- return o;
1481
+ return n;
1482
1482
  }
1483
1483
  /**
1484
1484
  * Calculate optimal number of clusters based on image count and container
1485
1485
  */
1486
- calculateClusterCount(t, e, i, o, a) {
1486
+ calculateClusterCount(t, e, i, n, s) {
1487
1487
  if (e !== "auto")
1488
1488
  return Math.max(1, Math.min(e, t));
1489
- const s = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1490
- i / a * (o / a) * 0.6
1489
+ const a = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1490
+ i / s * (n / s) * 0.6
1491
1491
  );
1492
- return Math.max(1, Math.min(s, h, 10));
1492
+ return Math.max(1, Math.min(a, h, 10));
1493
1493
  }
1494
1494
  /**
1495
1495
  * Generate cluster center positions with spacing constraints
1496
1496
  */
1497
- generateClusterCenters(t, e, i, o, a) {
1498
- const c = [], h = o + a.clusterSpread, l = e - o - a.clusterSpread, u = o + a.clusterSpread, r = i - o - a.clusterSpread;
1497
+ generateClusterCenters(t, e, i, n, s) {
1498
+ const r = [], h = n + s.clusterSpread, l = e - n - s.clusterSpread, u = n + s.clusterSpread, c = i - n - s.clusterSpread;
1499
1499
  for (let d = 0; d < t; d++) {
1500
1500
  let m = null, b = -1;
1501
1501
  for (let p = 0; p < 100; p++) {
1502
1502
  const g = {
1503
1503
  x: this.random(h, l),
1504
- y: this.random(u, r),
1505
- spread: this.calculateClusterSpread(a)
1504
+ y: this.random(u, c),
1505
+ spread: this.calculateClusterSpread(s)
1506
1506
  };
1507
1507
  let f = 1 / 0;
1508
- for (const v of c) {
1509
- const w = g.x - v.x, E = g.y - v.y, A = Math.sqrt(w * w + E * E);
1510
- f = Math.min(f, A);
1508
+ for (const v of r) {
1509
+ const w = g.x - v.x, E = g.y - v.y, R = Math.sqrt(w * w + E * E);
1510
+ f = Math.min(f, R);
1511
1511
  }
1512
- if ((c.length === 0 || f > b) && (m = g, b = f), f >= a.clusterSpacing)
1512
+ if ((r.length === 0 || f > b) && (m = g, b = f), f >= s.clusterSpacing)
1513
1513
  break;
1514
1514
  }
1515
- m && c.push(m);
1515
+ m && r.push(m);
1516
1516
  }
1517
- return c;
1517
+ return r;
1518
1518
  }
1519
1519
  /**
1520
1520
  * Calculate spread for a cluster (may vary if density='varied')
@@ -1540,7 +1540,7 @@ class be {
1540
1540
  return Math.random() * (e - t) + t;
1541
1541
  }
1542
1542
  }
1543
- class ye {
1543
+ class we {
1544
1544
  constructor(t, e = {}) {
1545
1545
  this.config = t, this.imageConfig = e;
1546
1546
  }
@@ -1552,33 +1552,33 @@ class ye {
1552
1552
  * @returns Array of layout objects with position, rotation, scale
1553
1553
  */
1554
1554
  generate(t, e, i = {}) {
1555
- var M, _, Z, B, X, K, N, Q, tt;
1556
- const o = [], { width: a, height: c } = e, s = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, l = ((M = this.imageConfig.rotation) == null ? void 0 : M.mode) ?? "none", u = ((Z = (_ = this.imageConfig.rotation) == null ? void 0 : _.range) == null ? void 0 : Z.min) ?? -15, r = ((X = (B = this.imageConfig.rotation) == null ? void 0 : B.range) == null ? void 0 : X.max) ?? 15, d = ((N = (K = this.imageConfig.sizing) == null ? void 0 : K.variance) == null ? void 0 : N.min) ?? 1, m = ((tt = (Q = this.imageConfig.sizing) == null ? void 0 : Q.variance) == null ? void 0 : tt.max) ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? s, g = {
1557
- ..._t,
1555
+ var M, _, K, X, B, Z, W, Q, tt;
1556
+ const n = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, l = ((M = this.imageConfig.rotation) == null ? void 0 : M.mode) ?? "none", u = ((K = (_ = this.imageConfig.rotation) == null ? void 0 : _.range) == null ? void 0 : K.min) ?? -15, c = ((B = (X = this.imageConfig.rotation) == null ? void 0 : X.range) == null ? void 0 : B.max) ?? 15, d = ((W = (Z = this.imageConfig.sizing) == null ? void 0 : Z.variance) == null ? void 0 : W.min) ?? 1, m = ((tt = (Q = this.imageConfig.sizing) == null ? void 0 : Q.variance) == null ? void 0 : tt.max) ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? a, g = {
1557
+ ...jt,
1558
1558
  ...this.config.wave
1559
- }, { rows: f, amplitude: v, frequency: w, phaseShift: E, synchronization: A } = g, x = Math.ceil(t / f), P = p * 1.5 / 2, D = h + P, U = a - h - P, k = U - D, F = x > 1 ? k / (x - 1) : 0, S = h + v + p / 2, z = c - h - v - p / 2, $ = z - S, T = f > 1 ? $ / (f - 1) : 0;
1560
- let R = 0;
1561
- for (let q = 0; q < f && R < t; q++) {
1562
- const et = f === 1 ? (S + z) / 2 : S + q * T;
1559
+ }, { rows: f, amplitude: v, frequency: w, phaseShift: E, synchronization: R } = g, x = Math.ceil(t / f), U = p * 1.5 / 2, D = h + U, P = s - h - U, j = P - D, C = x > 1 ? j / (x - 1) : 0, S = h + v + p / 2, A = r - h - v - p / 2, O = A - S, z = f > 1 ? O / (f - 1) : 0;
1560
+ let T = 0;
1561
+ for (let q = 0; q < f && T < t; q++) {
1562
+ const et = f === 1 ? (S + A) / 2 : S + q * z;
1563
1563
  let Y = 0;
1564
- A === "offset" ? Y = q * E : A === "alternating" && (Y = q * Math.PI);
1565
- for (let C = 0; C < x && R < t; C++) {
1566
- const O = x === 1 ? (D + U) / 2 : D + C * F, G = this.calculateWaveY(O, a, v, w, Y), W = O, H = et + G, it = b ? this.random(d, m) : 1, nt = p * it;
1564
+ R === "offset" ? Y = q * E : R === "alternating" && (Y = q * Math.PI);
1565
+ for (let F = 0; F < x && T < t; F++) {
1566
+ const $ = x === 1 ? (D + P) / 2 : D + F * C, N = this.calculateWaveY($, s, v, w, Y), G = $, H = et + N, it = b ? this.random(d, m) : 1, nt = p * it;
1567
1567
  let ot = 0;
1568
- l === "tangent" ? ot = this.calculateRotation(O, a, v, w, Y) : l === "random" && (ot = this.random(u, r));
1569
- const at = nt * 1.5 / 2, pt = nt / 2, dt = h + at, ut = a - h - at, bt = h + pt, yt = c - h - pt;
1570
- o.push({
1571
- id: R,
1572
- x: Math.max(dt, Math.min(W, ut)),
1573
- y: Math.max(bt, Math.min(H, yt)),
1568
+ l === "tangent" ? ot = this.calculateRotation($, s, v, w, Y) : l === "random" && (ot = this.random(u, c));
1569
+ const at = nt * 1.5 / 2, bt = nt / 2, dt = h + at, ut = s - h - at, yt = h + bt, vt = r - h - bt;
1570
+ n.push({
1571
+ id: T,
1572
+ x: Math.max(dt, Math.min(G, ut)),
1573
+ y: Math.max(yt, Math.min(H, vt)),
1574
1574
  rotation: ot,
1575
1575
  scale: it,
1576
1576
  baseSize: nt,
1577
- zIndex: R + 1
1578
- }), R++;
1577
+ zIndex: T + 1
1578
+ }), T++;
1579
1579
  }
1580
1580
  }
1581
- return o;
1581
+ return n;
1582
1582
  }
1583
1583
  /**
1584
1584
  * Calculate Y position displacement on wave curve
@@ -1589,9 +1589,9 @@ class ye {
1589
1589
  * @param phase - Phase offset
1590
1590
  * @returns Y displacement from baseline
1591
1591
  */
1592
- calculateWaveY(t, e, i, o, a) {
1593
- const c = t / e;
1594
- return i * Math.sin(o * c * 2 * Math.PI + a);
1592
+ calculateWaveY(t, e, i, n, s) {
1593
+ const r = t / e;
1594
+ return i * Math.sin(n * r * 2 * Math.PI + s);
1595
1595
  }
1596
1596
  /**
1597
1597
  * Calculate rotation based on wave tangent
@@ -1602,9 +1602,9 @@ class ye {
1602
1602
  * @param phase - Phase offset
1603
1603
  * @returns Rotation angle in degrees
1604
1604
  */
1605
- calculateRotation(t, e, i, o, a) {
1606
- const c = t / e, s = i * o * 2 * Math.PI * Math.cos(o * c * 2 * Math.PI + a) / e;
1607
- return Math.atan(s) * (180 / Math.PI);
1605
+ calculateRotation(t, e, i, n, s) {
1606
+ const r = t / e, a = i * n * 2 * Math.PI * Math.cos(n * r * 2 * Math.PI + s) / e;
1607
+ return Math.atan(a) * (180 / Math.PI);
1608
1608
  }
1609
1609
  /**
1610
1610
  * Estimate image width based on height
@@ -1618,7 +1618,7 @@ class ye {
1618
1618
  return Math.random() * (e - t) + t;
1619
1619
  }
1620
1620
  }
1621
- class ve {
1621
+ class xe {
1622
1622
  constructor(t) {
1623
1623
  this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.generator = this.initGenerator();
1624
1624
  }
@@ -1629,18 +1629,18 @@ class ve {
1629
1629
  initGenerator() {
1630
1630
  switch (this.config.algorithm) {
1631
1631
  case "radial":
1632
- return new he(this.config, this.imageConfig);
1633
- case "grid":
1634
1632
  return new ue(this.config, this.imageConfig);
1633
+ case "grid":
1634
+ return new fe(this.config, this.imageConfig);
1635
1635
  case "spiral":
1636
- return new me(this.config, this.imageConfig);
1637
- case "cluster":
1638
1636
  return new be(this.config, this.imageConfig);
1637
+ case "cluster":
1638
+ return new ve(this.config, this.imageConfig);
1639
1639
  case "wave":
1640
- return new ye(this.config, this.imageConfig);
1640
+ return new we(this.config, this.imageConfig);
1641
1641
  case "random":
1642
1642
  default:
1643
- return new le(this.config, this.imageConfig);
1643
+ return new de(this.config, this.imageConfig);
1644
1644
  }
1645
1645
  }
1646
1646
  /**
@@ -1651,10 +1651,10 @@ class ve {
1651
1651
  * @returns Array of layout objects with position, rotation, scale
1652
1652
  */
1653
1653
  generateLayout(t, e, i = {}) {
1654
- const o = this.generator.generate(t, e, i);
1655
- return o.forEach((a) => {
1656
- this.layouts.set(a.id, a);
1657
- }), o;
1654
+ const n = this.generator.generate(t, e, i);
1655
+ return n.forEach((s) => {
1656
+ this.layouts.set(s.id, s);
1657
+ }), n;
1658
1658
  }
1659
1659
  /**
1660
1660
  * Get the original layout state for an image
@@ -1707,8 +1707,8 @@ class ve {
1707
1707
  return;
1708
1708
  if (typeof i == "number")
1709
1709
  return i;
1710
- const o = i, a = this.resolveBreakpoint(t);
1711
- return a === "mobile" ? o.mobile ?? o.tablet ?? o.screen : a === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1710
+ const n = i, s = this.resolveBreakpoint(t);
1711
+ return s === "mobile" ? n.mobile ?? n.tablet ?? n.screen : s === "tablet" ? n.tablet ?? n.screen ?? n.mobile : n.screen ?? n.tablet ?? n.mobile;
1712
1712
  }
1713
1713
  /**
1714
1714
  * Calculate adaptive image size based on container dimensions and image count
@@ -1718,16 +1718,16 @@ class ve {
1718
1718
  * @param viewportWidth - Current viewport width for baseHeight resolution
1719
1719
  * @returns Calculated sizing result with height
1720
1720
  */
1721
- calculateAdaptiveSize(t, e, i, o) {
1722
- const a = this.imageConfig.sizing, c = this.resolveBaseHeight(o);
1723
- if (c !== void 0)
1724
- return { height: c };
1725
- const s = (a == null ? void 0 : a.minSize) ?? 50, h = (a == null ? void 0 : a.maxSize) ?? 400, l = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: r, height: d } = t, p = r * d * l / e;
1721
+ calculateAdaptiveSize(t, e, i, n) {
1722
+ const s = this.imageConfig.sizing, r = this.resolveBaseHeight(n);
1723
+ if (r !== void 0)
1724
+ return { height: r };
1725
+ const a = (s == null ? void 0 : s.minSize) ?? 50, h = (s == null ? void 0 : s.maxSize) ?? 400, l = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: c, height: d } = t, p = c * d * l / e;
1726
1726
  let f = Math.sqrt(p / 1.4);
1727
1727
  f *= u, f = Math.min(f, i);
1728
- let v = this.clamp(f, s, h);
1729
- if (v === s && f < s) {
1730
- const w = Math.max(s * 0.05, 20);
1728
+ let v = this.clamp(f, a, h);
1729
+ if (v === a && f < a) {
1730
+ const w = Math.max(a * 0.05, 20);
1731
1731
  v = Math.max(w, f);
1732
1732
  }
1733
1733
  return { height: v };
@@ -1739,77 +1739,77 @@ class ve {
1739
1739
  return Math.max(e, Math.min(i, t));
1740
1740
  }
1741
1741
  }
1742
- var I = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(I || {});
1743
- function we(n) {
1744
- return n in St;
1742
+ var I = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(I || {});
1743
+ function Se(o) {
1744
+ return o in It;
1745
1745
  }
1746
- function xe(n) {
1747
- return n ? we(n) ? St[n] : n : St.md;
1746
+ function Ie(o) {
1747
+ return o ? Se(o) ? It[o] : o : It.md;
1748
1748
  }
1749
- function Se(n) {
1750
- if (!n) return "";
1749
+ function Ee(o) {
1750
+ if (!o) return "";
1751
1751
  const t = [];
1752
- if (n.grayscale !== void 0 && t.push(`grayscale(${n.grayscale})`), n.blur !== void 0 && t.push(`blur(${n.blur}px)`), n.brightness !== void 0 && t.push(`brightness(${n.brightness})`), n.contrast !== void 0 && t.push(`contrast(${n.contrast})`), n.saturate !== void 0 && t.push(`saturate(${n.saturate})`), n.opacity !== void 0 && t.push(`opacity(${n.opacity})`), n.sepia !== void 0 && t.push(`sepia(${n.sepia})`), n.hueRotate !== void 0 && t.push(`hue-rotate(${n.hueRotate}deg)`), n.invert !== void 0 && t.push(`invert(${n.invert})`), n.dropShadow !== void 0)
1753
- if (typeof n.dropShadow == "string")
1754
- t.push(`drop-shadow(${n.dropShadow})`);
1752
+ if (o.grayscale !== void 0 && t.push(`grayscale(${o.grayscale})`), o.blur !== void 0 && t.push(`blur(${o.blur}px)`), o.brightness !== void 0 && t.push(`brightness(${o.brightness})`), o.contrast !== void 0 && t.push(`contrast(${o.contrast})`), o.saturate !== void 0 && t.push(`saturate(${o.saturate})`), o.opacity !== void 0 && t.push(`opacity(${o.opacity})`), o.sepia !== void 0 && t.push(`sepia(${o.sepia})`), o.hueRotate !== void 0 && t.push(`hue-rotate(${o.hueRotate}deg)`), o.invert !== void 0 && t.push(`invert(${o.invert})`), o.dropShadow !== void 0)
1753
+ if (typeof o.dropShadow == "string")
1754
+ t.push(`drop-shadow(${o.dropShadow})`);
1755
1755
  else {
1756
- const e = n.dropShadow;
1756
+ const e = o.dropShadow;
1757
1757
  t.push(`drop-shadow(${e.x}px ${e.y}px ${e.blur}px ${e.color})`);
1758
1758
  }
1759
1759
  return t.join(" ");
1760
1760
  }
1761
- function ct(n) {
1762
- if (!n || n.style === "none" || n.width === 0)
1761
+ function ct(o) {
1762
+ if (!o || o.style === "none" || o.width === 0)
1763
1763
  return "none";
1764
- const t = n.width ?? 0, e = n.style ?? "solid", i = n.color ?? "#000000";
1764
+ const t = o.width ?? 0, e = o.style ?? "solid", i = o.color ?? "#000000";
1765
1765
  return `${t}px ${e} ${i}`;
1766
1766
  }
1767
- function ft(n) {
1768
- var a, c;
1769
- if (!n) return {};
1767
+ function ft(o) {
1768
+ var s, r;
1769
+ if (!o) return {};
1770
1770
  const t = {};
1771
- if (n.borderRadiusTopLeft !== void 0 || n.borderRadiusTopRight !== void 0 || n.borderRadiusBottomRight !== void 0 || n.borderRadiusBottomLeft !== void 0) {
1772
- const s = ((a = n.border) == null ? void 0 : a.radius) ?? 0;
1773
- n.borderRadiusTopLeft !== void 0 ? t.borderTopLeftRadius = `${n.borderRadiusTopLeft}px` : s && (t.borderTopLeftRadius = `${s}px`), n.borderRadiusTopRight !== void 0 ? t.borderTopRightRadius = `${n.borderRadiusTopRight}px` : s && (t.borderTopRightRadius = `${s}px`), n.borderRadiusBottomRight !== void 0 ? t.borderBottomRightRadius = `${n.borderRadiusBottomRight}px` : s && (t.borderBottomRightRadius = `${s}px`), n.borderRadiusBottomLeft !== void 0 ? t.borderBottomLeftRadius = `${n.borderRadiusBottomLeft}px` : s && (t.borderBottomLeftRadius = `${s}px`);
1774
- } else ((c = n.border) == null ? void 0 : c.radius) !== void 0 && (t.borderRadius = `${n.border.radius}px`);
1775
- if (n.borderTop || n.borderRight || n.borderBottom || n.borderLeft) {
1776
- const s = n.border || {}, h = { ...s, ...n.borderTop }, l = { ...s, ...n.borderRight }, u = { ...s, ...n.borderBottom }, r = { ...s, ...n.borderLeft };
1777
- t.borderTop = ct(h), t.borderRight = ct(l), t.borderBottom = ct(u), t.borderLeft = ct(r);
1778
- } else n.border && (t.border = ct(n.border));
1779
- n.shadow !== void 0 && (t.boxShadow = xe(n.shadow));
1780
- const o = Se(n.filter);
1781
- if (t.filter = o || "none", n.opacity !== void 0 && (t.opacity = String(n.opacity)), n.cursor !== void 0 && (t.cursor = n.cursor), n.outline && n.outline.style !== "none" && (n.outline.width ?? 0) > 0) {
1782
- const s = n.outline.width ?? 0, h = n.outline.style ?? "solid", l = n.outline.color ?? "#000000";
1783
- t.outline = `${s}px ${h} ${l}`, n.outline.offset !== void 0 && (t.outlineOffset = `${n.outline.offset}px`);
1784
- }
1785
- return n.objectFit !== void 0 && (t.objectFit = n.objectFit), n.aspectRatio !== void 0 && (t.aspectRatio = n.aspectRatio), t;
1771
+ if (o.borderRadiusTopLeft !== void 0 || o.borderRadiusTopRight !== void 0 || o.borderRadiusBottomRight !== void 0 || o.borderRadiusBottomLeft !== void 0) {
1772
+ const a = ((s = o.border) == null ? void 0 : s.radius) ?? 0;
1773
+ o.borderRadiusTopLeft !== void 0 ? t.borderTopLeftRadius = `${o.borderRadiusTopLeft}px` : a && (t.borderTopLeftRadius = `${a}px`), o.borderRadiusTopRight !== void 0 ? t.borderTopRightRadius = `${o.borderRadiusTopRight}px` : a && (t.borderTopRightRadius = `${a}px`), o.borderRadiusBottomRight !== void 0 ? t.borderBottomRightRadius = `${o.borderRadiusBottomRight}px` : a && (t.borderBottomRightRadius = `${a}px`), o.borderRadiusBottomLeft !== void 0 ? t.borderBottomLeftRadius = `${o.borderRadiusBottomLeft}px` : a && (t.borderBottomLeftRadius = `${a}px`);
1774
+ } else ((r = o.border) == null ? void 0 : r.radius) !== void 0 && (t.borderRadius = `${o.border.radius}px`);
1775
+ if (o.borderTop || o.borderRight || o.borderBottom || o.borderLeft) {
1776
+ const a = o.border || {}, h = { ...a, ...o.borderTop }, l = { ...a, ...o.borderRight }, u = { ...a, ...o.borderBottom }, c = { ...a, ...o.borderLeft };
1777
+ t.borderTop = ct(h), t.borderRight = ct(l), t.borderBottom = ct(u), t.borderLeft = ct(c);
1778
+ } else o.border && (t.border = ct(o.border));
1779
+ o.shadow !== void 0 && (t.boxShadow = Ie(o.shadow));
1780
+ const n = Ee(o.filter);
1781
+ if (t.filter = n || "none", o.opacity !== void 0 && (t.opacity = String(o.opacity)), o.cursor !== void 0 && (t.cursor = o.cursor), o.outline && o.outline.style !== "none" && (o.outline.width ?? 0) > 0) {
1782
+ const a = o.outline.width ?? 0, h = o.outline.style ?? "solid", l = o.outline.color ?? "#000000";
1783
+ t.outline = `${a}px ${h} ${l}`, o.outline.offset !== void 0 && (t.outlineOffset = `${o.outline.offset}px`);
1784
+ }
1785
+ return o.objectFit !== void 0 && (t.objectFit = o.objectFit), o.aspectRatio !== void 0 && (t.aspectRatio = o.aspectRatio), t;
1786
1786
  }
1787
- function lt(n, t) {
1788
- t.borderRadius !== void 0 && (n.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (n.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (n.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (n.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (n.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (n.style.border = t.border), t.borderTop !== void 0 && (n.style.borderTop = t.borderTop), t.borderRight !== void 0 && (n.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (n.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (n.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (n.style.boxShadow = t.boxShadow), t.filter !== void 0 && (n.style.filter = t.filter), t.opacity !== void 0 && (n.style.opacity = t.opacity), t.cursor !== void 0 && (n.style.cursor = t.cursor), t.outline !== void 0 && (n.style.outline = t.outline), t.outlineOffset !== void 0 && (n.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (n.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (n.style.aspectRatio = t.aspectRatio);
1787
+ function lt(o, t) {
1788
+ t.borderRadius !== void 0 && (o.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (o.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (o.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (o.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (o.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (o.style.border = t.border), t.borderTop !== void 0 && (o.style.borderTop = t.borderTop), t.borderRight !== void 0 && (o.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (o.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (o.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (o.style.boxShadow = t.boxShadow), t.filter !== void 0 && (o.style.filter = t.filter), t.opacity !== void 0 && (o.style.opacity = t.opacity), t.cursor !== void 0 && (o.style.cursor = t.cursor), t.outline !== void 0 && (o.style.outline = t.outline), t.outlineOffset !== void 0 && (o.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (o.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (o.style.aspectRatio = t.aspectRatio);
1789
1789
  }
1790
- function Ot(n) {
1791
- return n ? Array.isArray(n) ? n.join(" ") : n : "";
1790
+ function Pt(o) {
1791
+ return o ? Array.isArray(o) ? o.join(" ") : o : "";
1792
1792
  }
1793
- function ht(n, t) {
1794
- const e = Ot(t);
1793
+ function ht(o, t) {
1794
+ const e = Pt(t);
1795
1795
  e && e.split(" ").forEach((i) => {
1796
- i.trim() && n.classList.add(i.trim());
1796
+ i.trim() && o.classList.add(i.trim());
1797
1797
  });
1798
1798
  }
1799
- function Dt(n, t) {
1800
- const e = Ot(t);
1799
+ function Ut(o, t) {
1800
+ const e = Pt(t);
1801
1801
  e && e.split(" ").forEach((i) => {
1802
- i.trim() && n.classList.remove(i.trim());
1802
+ i.trim() && o.classList.remove(i.trim());
1803
1803
  });
1804
1804
  }
1805
- const Ct = {
1805
+ const Ot = {
1806
1806
  UNFOCUSING: 999,
1807
1807
  FOCUSING: 1e3
1808
1808
  };
1809
- class Ie {
1809
+ class Te {
1810
1810
  constructor(t, e, i) {
1811
- var o, a;
1812
- this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = ft(i == null ? void 0 : i.default), this.focusedStyles = ft(i == null ? void 0 : i.focused), this.defaultClassName = (o = i == null ? void 0 : i.default) == null ? void 0 : o.className, this.focusedClassName = (a = i == null ? void 0 : i.focused) == null ? void 0 : a.className;
1811
+ var n, s;
1812
+ this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = ft(i == null ? void 0 : i.default), this.focusedStyles = ft(i == null ? void 0 : i.focused), this.defaultClassName = (n = i == null ? void 0 : i.default) == null ? void 0 : n.className, this.focusedClassName = (s = i == null ? void 0 : i.focused) == null ? void 0 : s.className;
1813
1813
  }
1814
1814
  /**
1815
1815
  * Get current state machine state
@@ -1834,20 +1834,20 @@ class Ie {
1834
1834
  * Returns actual pixel dimensions instead of scale factor for sharper rendering
1835
1835
  */
1836
1836
  calculateFocusDimensions(t, e, i) {
1837
- const o = this.normalizeScalePercent(this.config.scalePercent), a = i.height * o, c = t / e;
1838
- let s = a, h = s * c;
1839
- const l = i.width * o;
1840
- return h > l && (h = l, s = h / c), { width: h, height: s };
1837
+ const n = this.normalizeScalePercent(this.config.scalePercent), s = i.height * n, r = t / e;
1838
+ let a = s, h = a * r;
1839
+ const l = i.width * n;
1840
+ return h > l && (h = l, a = h / r), { width: h, height: a };
1841
1841
  }
1842
1842
  /**
1843
1843
  * Calculate the transform needed to center an image (position only, no scale)
1844
1844
  * Scale is handled by animating actual dimensions for sharper rendering
1845
1845
  */
1846
1846
  calculateFocusTransform(t, e) {
1847
- const i = t.width / 2, o = t.height / 2, a = i - e.x, c = o - e.y;
1847
+ const i = t.width / 2, n = t.height / 2, s = i - e.x, r = n - e.y;
1848
1848
  return {
1849
- x: a,
1850
- y: c,
1849
+ x: s,
1850
+ y: r,
1851
1851
  rotation: 0,
1852
1852
  scale: 1
1853
1853
  // No scale transform - dimensions are animated instead
@@ -1859,8 +1859,8 @@ class Ie {
1859
1859
  buildDimensionZoomTransform(t) {
1860
1860
  const e = ["translate(-50%, -50%)"];
1861
1861
  if (t.x !== void 0 || t.y !== void 0) {
1862
- const i = t.x ?? 0, o = t.y ?? 0;
1863
- e.push(`translate(${i}px, ${o}px)`);
1862
+ const i = t.x ?? 0, n = t.y ?? 0;
1863
+ e.push(`translate(${i}px, ${n}px)`);
1864
1864
  }
1865
1865
  return t.rotation !== void 0 && e.push(`rotate(${t.rotation}deg)`), e.join(" ");
1866
1866
  }
@@ -1868,19 +1868,19 @@ class Ie {
1868
1868
  * Create a Web Animation that animates both transform (position) and dimensions
1869
1869
  * This provides sharper zoom by re-rendering at target size instead of scaling pixels
1870
1870
  */
1871
- animateWithDimensions(t, e, i, o, a, c, s, h) {
1871
+ animateWithDimensions(t, e, i, n, s, r, a, h) {
1872
1872
  const l = this.buildDimensionZoomTransform(e), u = this.buildDimensionZoomTransform(i);
1873
1873
  return t.style.transition = "none", t.animate(
1874
1874
  [
1875
1875
  {
1876
1876
  transform: l,
1877
- width: `${o}px`,
1878
- height: `${a}px`
1877
+ width: `${n}px`,
1878
+ height: `${s}px`
1879
1879
  },
1880
1880
  {
1881
1881
  transform: u,
1882
- width: `${c}px`,
1883
- height: `${s}px`
1882
+ width: `${r}px`,
1883
+ height: `${a}px`
1884
1884
  }
1885
1885
  ],
1886
1886
  {
@@ -1900,7 +1900,7 @@ class Ie {
1900
1900
  * Remove focused styling from an element
1901
1901
  */
1902
1902
  removeFocusedStyling(t, e) {
1903
- t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), Dt(t, this.focusedClassName), lt(t, this.defaultStyles), ht(t, this.defaultClassName);
1903
+ t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), Ut(t, this.focusedClassName), lt(t, this.defaultStyles), ht(t, this.defaultClassName);
1904
1904
  }
1905
1905
  /**
1906
1906
  * Start focus animation for an image using dimension-based zoom
@@ -1908,18 +1908,18 @@ class Ie {
1908
1908
  * @param fromTransform - Optional starting transform (for mid-animation reversals)
1909
1909
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1910
1910
  */
1911
- startFocusAnimation(t, e, i, o, a) {
1912
- const c = t.style.zIndex || "", s = t.offsetWidth, h = t.offsetHeight, l = this.calculateFocusDimensions(s, h, e), u = this.calculateFocusTransform(e, i);
1913
- this.applyFocusedStyling(t, Ct.FOCUSING), this.animationEngine.cancelAllAnimations(t);
1914
- const r = o ?? {
1911
+ startFocusAnimation(t, e, i, n, s) {
1912
+ const r = t.style.zIndex || "", a = t.offsetWidth, h = t.offsetHeight, l = this.calculateFocusDimensions(a, h, e), u = this.calculateFocusTransform(e, i);
1913
+ this.applyFocusedStyling(t, Ot.FOCUSING), this.animationEngine.cancelAllAnimations(t);
1914
+ const c = n ?? {
1915
1915
  x: 0,
1916
1916
  y: 0,
1917
1917
  rotation: i.rotation,
1918
1918
  scale: 1
1919
1919
  // No scale - using dimensions
1920
- }, d = (a == null ? void 0 : a.width) ?? s, m = (a == null ? void 0 : a.height) ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
1920
+ }, d = (s == null ? void 0 : s.width) ?? a, m = (s == null ? void 0 : s.height) ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
1921
1921
  t,
1922
- r,
1922
+ c,
1923
1923
  u,
1924
1924
  d,
1925
1925
  m,
@@ -1930,7 +1930,7 @@ class Ie {
1930
1930
  id: `focus-${Date.now()}`,
1931
1931
  element: t,
1932
1932
  animation: p,
1933
- fromState: r,
1933
+ fromState: c,
1934
1934
  toState: u,
1935
1935
  startTime: performance.now(),
1936
1936
  duration: b
@@ -1939,8 +1939,8 @@ class Ie {
1939
1939
  element: t,
1940
1940
  originalState: i,
1941
1941
  focusTransform: u,
1942
- originalZIndex: c,
1943
- originalWidth: s,
1942
+ originalZIndex: r,
1943
+ originalWidth: a,
1944
1944
  originalHeight: h,
1945
1945
  focusWidth: l.width,
1946
1946
  focusHeight: l.height
@@ -1949,7 +1949,7 @@ class Ie {
1949
1949
  originalState: i,
1950
1950
  animationHandle: g,
1951
1951
  direction: "in",
1952
- originalWidth: s,
1952
+ originalWidth: a,
1953
1953
  originalHeight: h
1954
1954
  };
1955
1955
  }
@@ -1958,32 +1958,32 @@ class Ie {
1958
1958
  * Animates back to original dimensions for consistent behavior
1959
1959
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1960
1960
  */
1961
- startUnfocusAnimation(t, e, i, o) {
1961
+ startUnfocusAnimation(t, e, i, n) {
1962
1962
  var b, p, g, f, v;
1963
- t.style.zIndex = String(Ct.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
1964
- const a = i ?? ((b = this.focusData) == null ? void 0 : b.focusTransform) ?? { x: 0, y: 0, rotation: 0, scale: 1 }, c = (o == null ? void 0 : o.width) ?? ((p = this.focusData) == null ? void 0 : p.focusWidth) ?? t.offsetWidth, s = (o == null ? void 0 : o.height) ?? ((g = this.focusData) == null ? void 0 : g.focusHeight) ?? t.offsetHeight, h = {
1963
+ t.style.zIndex = String(Ot.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
1964
+ const s = i ?? ((b = this.focusData) == null ? void 0 : b.focusTransform) ?? { x: 0, y: 0, rotation: 0, scale: 1 }, r = (n == null ? void 0 : n.width) ?? ((p = this.focusData) == null ? void 0 : p.focusWidth) ?? t.offsetWidth, a = (n == null ? void 0 : n.height) ?? ((g = this.focusData) == null ? void 0 : g.focusHeight) ?? t.offsetHeight, h = {
1965
1965
  x: 0,
1966
1966
  y: 0,
1967
1967
  rotation: e.rotation,
1968
1968
  scale: 1
1969
1969
  // No scale - using dimensions
1970
- }, l = ((f = this.focusData) == null ? void 0 : f.originalWidth) ?? t.offsetWidth, u = ((v = this.focusData) == null ? void 0 : v.originalHeight) ?? t.offsetHeight, r = this.config.animationDuration ?? 600, d = this.animateWithDimensions(
1970
+ }, l = ((f = this.focusData) == null ? void 0 : f.originalWidth) ?? t.offsetWidth, u = ((v = this.focusData) == null ? void 0 : v.originalHeight) ?? t.offsetHeight, c = this.config.animationDuration ?? 600, d = this.animateWithDimensions(
1971
1971
  t,
1972
- a,
1973
- h,
1974
- c,
1975
1972
  s,
1973
+ h,
1974
+ r,
1975
+ a,
1976
1976
  l,
1977
1977
  u,
1978
- r
1978
+ c
1979
1979
  ), m = {
1980
1980
  id: `unfocus-${Date.now()}`,
1981
1981
  element: t,
1982
1982
  animation: d,
1983
- fromState: a,
1983
+ fromState: s,
1984
1984
  toState: h,
1985
1985
  startTime: performance.now(),
1986
- duration: r
1986
+ duration: c
1987
1987
  };
1988
1988
  return {
1989
1989
  element: t,
@@ -2006,20 +2006,20 @@ class Ie {
2006
2006
  /**
2007
2007
  * Reset an element instantly to its original position and dimensions (no animation)
2008
2008
  */
2009
- resetElementInstantly(t, e, i, o, a) {
2009
+ resetElementInstantly(t, e, i, n, s) {
2010
2010
  this.animationEngine.cancelAllAnimations(t);
2011
- const c = ["translate(-50%, -50%)"];
2012
- c.push("translate(0px, 0px)"), c.push(`rotate(${e.rotation}deg)`), t.style.transition = "none", t.style.transform = c.join(" "), o !== void 0 && a !== void 0 && (t.style.width = `${o}px`, t.style.height = `${a}px`), this.removeFocusedStyling(t, i);
2011
+ const r = ["translate(-50%, -50%)"];
2012
+ r.push("translate(0px, 0px)"), r.push(`rotate(${e.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), n !== void 0 && s !== void 0 && (t.style.width = `${n}px`, t.style.height = `${s}px`), this.removeFocusedStyling(t, i);
2013
2013
  }
2014
2014
  /**
2015
2015
  * Focus (zoom) an image to center of container
2016
2016
  * Implements cross-animation when swapping focus
2017
2017
  */
2018
2018
  async focusImage(t, e, i) {
2019
- var a, c, s, h, l, u, r, d, m, b, p, g;
2019
+ var s, r, a, h, l, u, c, d, m, b, p, g;
2020
2020
  if (this.currentFocus === t && this.state === I.FOCUSED)
2021
2021
  return this.unfocusImage();
2022
- if (((a = this.incoming) == null ? void 0 : a.element) === t && this.state === I.FOCUSING) {
2022
+ if (((s = this.incoming) == null ? void 0 : s.element) === t && this.state === I.FOCUSING) {
2023
2023
  const f = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), v = {
2024
2024
  x: f.x,
2025
2025
  y: f.y,
@@ -2035,13 +2035,13 @@ class Ie {
2035
2035
  this.incoming.originalState,
2036
2036
  v,
2037
2037
  w
2038
- ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, ((c = this.focusData) == null ? void 0 : c.originalZIndex) || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2038
+ ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, ((r = this.focusData) == null ? void 0 : r.originalZIndex) || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2039
2039
  return;
2040
2040
  }
2041
- const o = ++this.focusGeneration;
2041
+ const n = ++this.focusGeneration;
2042
2042
  switch (this.state) {
2043
2043
  case I.IDLE:
2044
- if (this.state = I.FOCUSING, this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2044
+ if (this.state = I.FOCUSING, this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2045
2045
  this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2046
2046
  break;
2047
2047
  case I.FOCUSED:
@@ -2051,9 +2051,9 @@ class Ie {
2051
2051
  )), this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2052
2052
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2053
2053
  this.waitForAnimation(this.incoming.animationHandle)
2054
- ]), this.focusGeneration !== o)
2054
+ ]), this.focusGeneration !== n)
2055
2055
  return;
2056
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((s = this.outgoing.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2056
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((a = this.outgoing.originalState.zIndex) == null ? void 0 : a.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2057
2057
  break;
2058
2058
  case I.FOCUSING:
2059
2059
  if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
@@ -2062,15 +2062,15 @@ class Ie {
2062
2062
  ((h = this.focusData) == null ? void 0 : h.originalZIndex) || "",
2063
2063
  (l = this.focusData) == null ? void 0 : l.originalWidth,
2064
2064
  (u = this.focusData) == null ? void 0 : u.originalHeight
2065
- ), this.incoming = null), this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2065
+ ), this.incoming = null), this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2066
2066
  this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2067
2067
  break;
2068
2068
  case I.UNFOCUSING:
2069
2069
  if (this.state = I.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2070
2070
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2071
2071
  this.waitForAnimation(this.incoming.animationHandle)
2072
- ]), this.focusGeneration !== o) return;
2073
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((r = this.outgoing.originalState.zIndex) == null ? void 0 : r.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2072
+ ]), this.focusGeneration !== n) return;
2073
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((c = this.outgoing.originalState.zIndex) == null ? void 0 : c.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2074
2074
  break;
2075
2075
  case I.CROSS_ANIMATING:
2076
2076
  if (((d = this.incoming) == null ? void 0 : d.element) === t)
@@ -2087,7 +2087,7 @@ class Ie {
2087
2087
  height: t.offsetHeight
2088
2088
  };
2089
2089
  if (this.incoming) {
2090
- const E = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), A = {
2090
+ const E = this.animationEngine.cancelAnimation(this.incoming.animationHandle, !0), R = {
2091
2091
  x: E.x,
2092
2092
  y: E.y,
2093
2093
  rotation: E.rotation,
@@ -2100,7 +2100,7 @@ class Ie {
2100
2100
  this.outgoing = this.startUnfocusAnimation(
2101
2101
  this.incoming.element,
2102
2102
  this.incoming.originalState,
2103
- A,
2103
+ R,
2104
2104
  x
2105
2105
  );
2106
2106
  } else
@@ -2108,7 +2108,7 @@ class Ie {
2108
2108
  if (this.incoming = this.startFocusAnimation(t, e, i, v, w), await Promise.all([
2109
2109
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2110
2110
  this.waitForAnimation(this.incoming.animationHandle)
2111
- ]), this.focusGeneration !== o) return;
2111
+ ]), this.focusGeneration !== n) return;
2112
2112
  this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((b = this.outgoing.originalState.zIndex) == null ? void 0 : b.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2113
2113
  return;
2114
2114
  }
@@ -2139,7 +2139,7 @@ class Ie {
2139
2139
  if (this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2140
2140
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2141
2141
  this.waitForAnimation(this.incoming.animationHandle)
2142
- ]), this.focusGeneration !== o) return;
2142
+ ]), this.focusGeneration !== n) return;
2143
2143
  this.outgoing && (this.removeFocusedStyling(this.outgoing.element, ((g = this.outgoing.originalState.zIndex) == null ? void 0 : g.toString()) || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2144
2144
  break;
2145
2145
  }
@@ -2148,7 +2148,7 @@ class Ie {
2148
2148
  * Unfocus current image, returning it to original position
2149
2149
  */
2150
2150
  async unfocusImage() {
2151
- var a, c, s;
2151
+ var s, r, a;
2152
2152
  const t = ++this.focusGeneration;
2153
2153
  if (!this.currentFocus || !this.focusData) {
2154
2154
  if (this.incoming && this.state === I.FOCUSING) {
@@ -2168,7 +2168,7 @@ class Ie {
2168
2168
  l,
2169
2169
  u
2170
2170
  ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2171
- this.removeFocusedStyling(this.outgoing.element, ((a = this.focusData) == null ? void 0 : a.originalZIndex) || ""), this.outgoing = null, this.focusData = null, this.state = I.IDLE;
2171
+ this.removeFocusedStyling(this.outgoing.element, ((s = this.focusData) == null ? void 0 : s.originalZIndex) || ""), this.outgoing = null, this.focusData = null, this.state = I.IDLE;
2172
2172
  }
2173
2173
  return;
2174
2174
  }
@@ -2182,7 +2182,7 @@ class Ie {
2182
2182
  }, u = {
2183
2183
  width: this.incoming.element.offsetWidth,
2184
2184
  height: this.incoming.element.offsetHeight
2185
- }, r = this.startUnfocusAnimation(
2185
+ }, c = this.startUnfocusAnimation(
2186
2186
  this.incoming.element,
2187
2187
  this.incoming.originalState,
2188
2188
  l,
@@ -2190,14 +2190,14 @@ class Ie {
2190
2190
  );
2191
2191
  if (await Promise.all([
2192
2192
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2193
- this.waitForAnimation(r.animationHandle)
2193
+ this.waitForAnimation(c.animationHandle)
2194
2194
  ]), this.focusGeneration !== t) return;
2195
- this.outgoing && this.removeFocusedStyling(this.outgoing.element, ((c = this.outgoing.originalState.zIndex) == null ? void 0 : c.toString()) || ""), this.removeFocusedStyling(r.element, ((s = this.incoming.originalState.zIndex) == null ? void 0 : s.toString()) || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2195
+ this.outgoing && this.removeFocusedStyling(this.outgoing.element, ((r = this.outgoing.originalState.zIndex) == null ? void 0 : r.toString()) || ""), this.removeFocusedStyling(c.element, ((a = this.incoming.originalState.zIndex) == null ? void 0 : a.toString()) || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2196
2196
  return;
2197
2197
  }
2198
2198
  this.state = I.UNFOCUSING;
2199
- const e = this.currentFocus, i = this.focusData.originalState, o = this.focusData.originalZIndex;
2200
- this.outgoing = this.startUnfocusAnimation(e, i), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(e, o), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE);
2199
+ const e = this.currentFocus, i = this.focusData.originalState, n = this.focusData.originalZIndex;
2200
+ this.outgoing = this.startUnfocusAnimation(e, i), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(e, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE);
2201
2201
  }
2202
2202
  /**
2203
2203
  * Swap focus from current image to a new one (alias for focusImage with cross-animation)
@@ -2233,11 +2233,34 @@ class Ie {
2233
2233
  var e, i;
2234
2234
  return this.currentFocus === t || ((e = this.incoming) == null ? void 0 : e.element) === t || ((i = this.outgoing) == null ? void 0 : i.element) === t;
2235
2235
  }
2236
+ /**
2237
+ * Apply a temporary horizontal drag offset to the focused image
2238
+ * Used during swipe gestures for visual feedback
2239
+ */
2240
+ setDragOffset(t) {
2241
+ if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2242
+ const e = this.currentFocus, i = this.focusData.focusTransform, n = ["translate(-50%, -50%)"], s = (i.x ?? 0) + t, r = i.y ?? 0;
2243
+ n.push(`translate(${s}px, ${r}px)`), i.rotation !== void 0 && n.push(`rotate(${i.rotation}deg)`), e.style.transition = "none", e.style.transform = n.join(" ");
2244
+ }
2245
+ /**
2246
+ * Clear the drag offset, optionally animating back to center
2247
+ * @param animate - If true, animate back to center; if false, snap instantly
2248
+ * @param duration - Animation duration in ms (default 150)
2249
+ */
2250
+ clearDragOffset(t, e = 150) {
2251
+ if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2252
+ const i = this.currentFocus, n = this.focusData.focusTransform, s = ["translate(-50%, -50%)"], r = n.x ?? 0, a = n.y ?? 0;
2253
+ s.push(`translate(${r}px, ${a}px)`), n.rotation !== void 0 && s.push(`rotate(${n.rotation}deg)`);
2254
+ const h = s.join(" ");
2255
+ t ? (i.style.transition = `transform ${e}ms ease-out`, i.style.transform = h, setTimeout(() => {
2256
+ this.currentFocus === i && (i.style.transition = "none");
2257
+ }, e)) : (i.style.transition = "none", i.style.transform = h);
2258
+ }
2236
2259
  /**
2237
2260
  * Reset zoom state (cancels all animations)
2238
2261
  */
2239
2262
  reset() {
2240
- var t, e, i, o;
2263
+ var t, e, i, n;
2241
2264
  this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
2242
2265
  this.outgoing.element,
2243
2266
  this.outgoing.originalState,
@@ -2249,7 +2272,7 @@ class Ie {
2249
2272
  this.incoming.originalState,
2250
2273
  ((e = this.focusData) == null ? void 0 : e.originalZIndex) || "",
2251
2274
  (i = this.focusData) == null ? void 0 : i.originalWidth,
2252
- (o = this.focusData) == null ? void 0 : o.originalHeight
2275
+ (n = this.focusData) == null ? void 0 : n.originalHeight
2253
2276
  )), this.currentFocus && this.focusData && this.resetElementInstantly(
2254
2277
  this.currentFocus,
2255
2278
  this.focusData.originalState,
@@ -2259,7 +2282,77 @@ class Ie {
2259
2282
  ), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2260
2283
  }
2261
2284
  }
2262
- class Ee {
2285
+ const Re = 50, Ae = 0.5, Me = 20, ze = 0.3, Ce = 150, Fe = 30, mt = class mt {
2286
+ constructor(t, e) {
2287
+ this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = e, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
2288
+ }
2289
+ /**
2290
+ * Start listening for touch events
2291
+ */
2292
+ enable() {
2293
+ this.enabled || (this.enabled = !0, this.container.addEventListener("touchstart", this.boundTouchStart, { passive: !1 }), this.container.addEventListener("touchmove", this.boundTouchMove, { passive: !1 }), this.container.addEventListener("touchend", this.boundTouchEnd, { passive: !0 }), this.container.addEventListener("touchcancel", this.boundTouchCancel, { passive: !0 }));
2294
+ }
2295
+ /**
2296
+ * Stop listening for touch events
2297
+ */
2298
+ disable() {
2299
+ var t;
2300
+ this.enabled && (this.enabled = !1, this.container.removeEventListener("touchstart", this.boundTouchStart), this.container.removeEventListener("touchmove", this.boundTouchMove), this.container.removeEventListener("touchend", this.boundTouchEnd), this.container.removeEventListener("touchcancel", this.boundTouchCancel), (t = this.touchState) != null && t.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null);
2301
+ }
2302
+ /**
2303
+ * Clean up all event listeners
2304
+ */
2305
+ destroy() {
2306
+ this.disable();
2307
+ }
2308
+ /**
2309
+ * Check if a touch interaction happened recently
2310
+ * Used to prevent click-outside from unfocusing immediately after touch
2311
+ */
2312
+ hadRecentTouch() {
2313
+ return Date.now() - this.recentTouchTimestamp < mt.TOUCH_CLICK_DELAY;
2314
+ }
2315
+ handleTouchStart(t) {
2316
+ if (t.touches.length !== 1) return;
2317
+ this.recentTouchTimestamp = Date.now();
2318
+ const e = t.touches[0];
2319
+ this.touchState = {
2320
+ startX: e.clientX,
2321
+ startY: e.clientY,
2322
+ startTime: performance.now(),
2323
+ currentX: e.clientX,
2324
+ isDragging: !1,
2325
+ isHorizontalSwipe: null
2326
+ };
2327
+ }
2328
+ handleTouchMove(t) {
2329
+ if (!this.touchState || t.touches.length !== 1) return;
2330
+ const e = t.touches[0], i = e.clientX - this.touchState.startX, n = e.clientY - this.touchState.startY;
2331
+ if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + n * n) > 10) {
2332
+ const a = Math.atan2(Math.abs(n), Math.abs(i)) * (180 / Math.PI);
2333
+ this.touchState.isHorizontalSwipe = a <= Fe;
2334
+ }
2335
+ if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2336
+ t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
2337
+ const s = i * ze;
2338
+ this.callbacks.onDragOffset(s);
2339
+ }
2340
+ }
2341
+ handleTouchEnd(t) {
2342
+ if (!this.touchState) return;
2343
+ this.recentTouchTimestamp = Date.now();
2344
+ const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, n = Math.abs(e) / i, s = Math.abs(e);
2345
+ let r = !1;
2346
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Re || n >= Ae && s >= Me) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2347
+ }
2348
+ handleTouchCancel(t) {
2349
+ var e;
2350
+ (e = this.touchState) != null && e.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
2351
+ }
2352
+ };
2353
+ mt.TOUCH_CLICK_DELAY = 300;
2354
+ let Et = mt;
2355
+ class Le {
2263
2356
  constructor(t = {}) {
2264
2357
  if (this._prepared = !1, this._discoveredUrls = [], this.apiKey = t.apiKey ?? "", this.apiEndpoint = t.apiEndpoint ?? "https://www.googleapis.com/drive/v3/files", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
2265
2358
  throw new Error("GoogleDriveLoader requires at least one source to be configured");
@@ -2273,8 +2366,8 @@ class Ee {
2273
2366
  for (const e of this.sources)
2274
2367
  if (e.type === "folder")
2275
2368
  for (const i of e.folders) {
2276
- const o = e.recursive !== void 0 ? e.recursive : !0, a = await this.loadFromFolder(i, t, o);
2277
- this._discoveredUrls.push(...a);
2369
+ const n = e.recursive !== void 0 ? e.recursive : !0, s = await this.loadFromFolder(i, t, n);
2370
+ this._discoveredUrls.push(...s);
2278
2371
  }
2279
2372
  else if (e.type === "files") {
2280
2373
  const i = await this.loadFiles(e.files, t);
@@ -2319,9 +2412,9 @@ class Ee {
2319
2412
  // Alternative format
2320
2413
  ];
2321
2414
  for (const i of e) {
2322
- const o = t.match(i);
2323
- if (o && o[1])
2324
- return o[1];
2415
+ const n = t.match(i);
2416
+ if (n && n[1])
2417
+ return n[1];
2325
2418
  }
2326
2419
  return null;
2327
2420
  }
@@ -2333,15 +2426,15 @@ class Ee {
2333
2426
  * @returns Promise resolving to array of image URLs
2334
2427
  */
2335
2428
  async loadFromFolder(t, e, i = !0) {
2336
- const o = this.extractFolderId(t);
2337
- if (!o)
2429
+ const n = this.extractFolderId(t);
2430
+ if (!n)
2338
2431
  throw new Error("Invalid Google Drive folder URL. Please check the URL format.");
2339
2432
  if (!this.apiKey || this.apiKey === "YOUR_API_KEY_HERE")
2340
- return this.loadImagesDirectly(o, e);
2433
+ return this.loadImagesDirectly(n, e);
2341
2434
  try {
2342
- return i ? await this.loadImagesRecursively(o, e) : await this.loadImagesFromSingleFolder(o, e);
2343
- } catch (a) {
2344
- return console.error("Error loading from Google Drive API:", a), this.loadImagesDirectly(o, e);
2435
+ return i ? await this.loadImagesRecursively(n, e) : await this.loadImagesFromSingleFolder(n, e);
2436
+ } catch (s) {
2437
+ return console.error("Error loading from Google Drive API:", s), this.loadImagesDirectly(n, e);
2345
2438
  }
2346
2439
  }
2347
2440
  /**
@@ -2351,10 +2444,10 @@ class Ee {
2351
2444
  * @returns Promise resolving to array of image URLs
2352
2445
  */
2353
2446
  async loadImagesFromSingleFolder(t, e) {
2354
- const i = [], o = `'${t}' in parents and trashed=false`, c = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(c);
2355
- if (!s.ok)
2356
- throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2357
- const l = (await s.json()).files.filter(
2447
+ const i = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2448
+ if (!a.ok)
2449
+ throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2450
+ const l = (await a.json()).files.filter(
2358
2451
  (u) => u.mimeType.startsWith("image/") && e.isAllowed(u.name)
2359
2452
  );
2360
2453
  return this.log(`Found ${l.length} images in folder ${t} (non-recursive)`), l.forEach((u) => {
@@ -2369,25 +2462,25 @@ class Ee {
2369
2462
  */
2370
2463
  async loadFiles(t, e) {
2371
2464
  const i = [];
2372
- for (const o of t) {
2373
- const a = this.extractFileId(o);
2374
- if (!a) {
2375
- this.log(`Skipping invalid file URL: ${o}`);
2465
+ for (const n of t) {
2466
+ const s = this.extractFileId(n);
2467
+ if (!s) {
2468
+ this.log(`Skipping invalid file URL: ${n}`);
2376
2469
  continue;
2377
2470
  }
2378
2471
  if (this.apiKey && this.apiKey !== "YOUR_API_KEY_HERE")
2379
2472
  try {
2380
- const c = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(c);
2381
- if (s.ok) {
2382
- const h = await s.json();
2383
- h.mimeType.startsWith("image/") && e.isAllowed(h.name) ? (i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`), this.log(`Added file: ${h.name}`)) : this.log(`Skipping non-image file: ${h.name} (${h.mimeType})`);
2473
+ const r = `${this.apiEndpoint}/${s}?fields=name,mimeType&key=${this.apiKey}`, a = await fetch(r);
2474
+ if (a.ok) {
2475
+ const h = await a.json();
2476
+ h.mimeType.startsWith("image/") && e.isAllowed(h.name) ? (i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`), this.log(`Added file: ${h.name}`)) : this.log(`Skipping non-image file: ${h.name} (${h.mimeType})`);
2384
2477
  } else
2385
- this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
2386
- } catch (c) {
2387
- this.log(`Error fetching metadata for file ${a}:`, c);
2478
+ this.log(`Failed to fetch metadata for file ${s}: ${a.status}`);
2479
+ } catch (r) {
2480
+ this.log(`Error fetching metadata for file ${s}:`, r);
2388
2481
  }
2389
2482
  else
2390
- i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`);
2483
+ i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`);
2391
2484
  }
2392
2485
  return i;
2393
2486
  }
@@ -2408,9 +2501,9 @@ class Ee {
2408
2501
  // Generic id parameter
2409
2502
  ];
2410
2503
  for (const i of e) {
2411
- const o = t.match(i);
2412
- if (o && o[1])
2413
- return o[1];
2504
+ const n = t.match(i);
2505
+ if (n && n[1])
2506
+ return n[1];
2414
2507
  }
2415
2508
  return null;
2416
2509
  }
@@ -2421,20 +2514,20 @@ class Ee {
2421
2514
  * @returns Promise resolving to array of image URLs
2422
2515
  */
2423
2516
  async loadImagesRecursively(t, e) {
2424
- const i = [], o = `'${t}' in parents and trashed=false`, c = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(c);
2425
- if (!s.ok)
2426
- throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2427
- const h = await s.json(), l = h.files.filter(
2428
- (r) => r.mimeType.startsWith("image/") && e.isAllowed(r.name)
2517
+ const i = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2518
+ if (!a.ok)
2519
+ throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2520
+ const h = await a.json(), l = h.files.filter(
2521
+ (c) => c.mimeType.startsWith("image/") && e.isAllowed(c.name)
2429
2522
  ), u = h.files.filter(
2430
- (r) => r.mimeType === "application/vnd.google-apps.folder"
2523
+ (c) => c.mimeType === "application/vnd.google-apps.folder"
2431
2524
  );
2432
- this.log(`Found ${h.files.length} total items in folder ${t}`), h.files.forEach((r) => this.log(` - File: ${r.name} (${r.mimeType})`)), this.log(`- ${l.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), l.forEach((r) => {
2433
- i.push(`https://lh3.googleusercontent.com/d/${r.id}=s1600`), this.log(`Added file: ${r.name}`);
2525
+ this.log(`Found ${h.files.length} total items in folder ${t}`), h.files.forEach((c) => this.log(` - File: ${c.name} (${c.mimeType})`)), this.log(`- ${l.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), l.forEach((c) => {
2526
+ i.push(`https://lh3.googleusercontent.com/d/${c.id}=s1600`), this.log(`Added file: ${c.name}`);
2434
2527
  });
2435
- for (const r of u) {
2436
- this.log(`Loading images from subfolder: ${r.name}`);
2437
- const d = await this.loadImagesRecursively(r.id, e);
2528
+ for (const c of u) {
2529
+ this.log(`Loading images from subfolder: ${c.name}`);
2530
+ const d = await this.loadImagesRecursively(c.id, e);
2438
2531
  i.push(...d);
2439
2532
  }
2440
2533
  return i;
@@ -2448,11 +2541,11 @@ class Ee {
2448
2541
  */
2449
2542
  async loadImagesDirectly(t, e) {
2450
2543
  try {
2451
- const i = `https://drive.google.com/embeddedfolderview?id=${t}`, o = await fetch(i, { mode: "cors" });
2452
- if (!o.ok)
2544
+ const i = `https://drive.google.com/embeddedfolderview?id=${t}`, n = await fetch(i, { mode: "cors" });
2545
+ if (!n.ok)
2453
2546
  throw new Error("Cannot access folder directly (CORS or permissions issue)");
2454
- const a = await o.text(), c = /\/file\/d\/([a-zA-Z0-9_-]+)/g, s = [...a.matchAll(c)];
2455
- return [...new Set(s.map((u) => u[1]))].map(
2547
+ const s = await n.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...s.matchAll(r)];
2548
+ return [...new Set(a.map((u) => u[1]))].map(
2456
2549
  (u) => `https://drive.google.com/uc?export=view&id=${u}`
2457
2550
  );
2458
2551
  } catch (i) {
@@ -2480,7 +2573,7 @@ class Ee {
2480
2573
  this.debugLogging && typeof console < "u" && console.log(...t);
2481
2574
  }
2482
2575
  }
2483
- class Re {
2576
+ class Oe {
2484
2577
  constructor(t = {}) {
2485
2578
  if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = t.validateUrls !== !1, this.validationTimeout = t.validationTimeout ?? 5e3, this.validationMethod = t.validationMethod ?? "head", this.sources = t.sources ?? [], this.debugLogging = t.debugLogging ?? !1, !this.sources || this.sources.length === 0)
2486
2579
  throw new Error("StaticImageLoader requires at least one source to be configured");
@@ -2544,13 +2637,13 @@ class Re {
2544
2637
  if (!Array.isArray(t))
2545
2638
  return console.warn("URLs must be an array:", t), [];
2546
2639
  const i = [];
2547
- for (const o of t) {
2548
- const a = o.split("/").pop() || o;
2549
- if (!e.isAllowed(a)) {
2550
- this.log(`Skipping filtered URL: ${o}`);
2640
+ for (const n of t) {
2641
+ const s = n.split("/").pop() || n;
2642
+ if (!e.isAllowed(s)) {
2643
+ this.log(`Skipping filtered URL: ${n}`);
2551
2644
  continue;
2552
2645
  }
2553
- this.validateUrls ? await this.validateUrl(o) ? i.push(o) : console.warn(`Skipping invalid/missing URL: ${o}`) : i.push(o);
2646
+ this.validateUrls ? await this.validateUrl(n) ? i.push(n) : console.warn(`Skipping invalid/missing URL: ${n}`) : i.push(n);
2554
2647
  }
2555
2648
  return i;
2556
2649
  }
@@ -2566,16 +2659,16 @@ class Re {
2566
2659
  return console.warn("basePath is required for path-type sources"), [];
2567
2660
  if (!Array.isArray(e))
2568
2661
  return console.warn("files must be an array:", e), [];
2569
- const o = [];
2570
- for (const a of e) {
2571
- if (!i.isAllowed(a)) {
2572
- this.log(`Skipping filtered file: ${a}`);
2662
+ const n = [];
2663
+ for (const s of e) {
2664
+ if (!i.isAllowed(s)) {
2665
+ this.log(`Skipping filtered file: ${s}`);
2573
2666
  continue;
2574
2667
  }
2575
- const c = this.constructUrl(t, a);
2576
- this.validateUrls ? await this.validateUrl(c) ? o.push(c) : console.warn(`Skipping invalid/missing file: ${c}`) : o.push(c);
2668
+ const r = this.constructUrl(t, s);
2669
+ this.validateUrls ? await this.validateUrl(r) ? n.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : n.push(r);
2577
2670
  }
2578
- return o;
2671
+ return n;
2579
2672
  }
2580
2673
  /**
2581
2674
  * Validate a single URL using HEAD request
@@ -2596,11 +2689,11 @@ class Re {
2596
2689
  if (!(t.startsWith(window.location.origin) || t.startsWith("/")))
2597
2690
  return this.log(`Skipping validation for cross-origin URL: ${t}`), !0;
2598
2691
  try {
2599
- const i = new AbortController(), o = setTimeout(() => i.abort(), this.validationTimeout), a = await fetch(t, {
2692
+ const i = new AbortController(), n = setTimeout(() => i.abort(), this.validationTimeout), s = await fetch(t, {
2600
2693
  method: "HEAD",
2601
2694
  signal: i.signal
2602
2695
  });
2603
- return clearTimeout(o), a.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${a.status}`), !1);
2696
+ return clearTimeout(n), s.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${s.status}`), !1);
2604
2697
  } catch (i) {
2605
2698
  return i instanceof Error && (i.name === "AbortError" ? this.log(`Validation timeout for ${t}`) : this.log(`Validation failed for ${t}:`, i.message)), !1;
2606
2699
  }
@@ -2617,8 +2710,8 @@ class Re {
2617
2710
  return `${i}/${e}`;
2618
2711
  if (typeof window > "u")
2619
2712
  return `${i}/${e}`;
2620
- const o = window.location.origin, c = (t.startsWith("/") ? t : "/" + t).replace(/\/$/, "");
2621
- return `${o}${c}/${e}`;
2713
+ const n = window.location.origin, r = (t.startsWith("/") ? t : "/" + t).replace(/\/$/, "");
2714
+ return `${n}${r}/${e}`;
2622
2715
  }
2623
2716
  /**
2624
2717
  * Check if URL is absolute (contains protocol)
@@ -2640,7 +2733,7 @@ class Re {
2640
2733
  this.debugLogging && typeof console < "u" && console.log(...t);
2641
2734
  }
2642
2735
  }
2643
- class Ae {
2736
+ class $e {
2644
2737
  constructor(t) {
2645
2738
  if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
2646
2739
  throw new Error("CompositeLoader requires at least one loader to be configured");
@@ -2652,16 +2745,16 @@ class Ae {
2652
2745
  */
2653
2746
  async prepare(t) {
2654
2747
  this._discoveredUrls = [], this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);
2655
- const e = this.loaders.map((i, o) => i.prepare(t).then(() => {
2656
- this.log(`Loader ${o} prepared with ${i.imagesLength()} images`);
2657
- }).catch((a) => {
2658
- console.warn(`Loader ${o} failed to prepare:`, a);
2748
+ const e = this.loaders.map((i, n) => i.prepare(t).then(() => {
2749
+ this.log(`Loader ${n} prepared with ${i.imagesLength()} images`);
2750
+ }).catch((s) => {
2751
+ console.warn(`Loader ${n} failed to prepare:`, s);
2659
2752
  }));
2660
2753
  await Promise.all(e);
2661
2754
  for (const i of this.loaders)
2662
2755
  if (i.isPrepared()) {
2663
- const o = i.imageURLs();
2664
- this._discoveredUrls.push(...o);
2756
+ const n = i.imageURLs();
2757
+ this._discoveredUrls.push(...n);
2665
2758
  }
2666
2759
  this._prepared = !0, this.log(`CompositeLoader prepared with ${this._discoveredUrls.length} total images`);
2667
2760
  }
@@ -2697,7 +2790,7 @@ class Ae {
2697
2790
  this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
2698
2791
  }
2699
2792
  }
2700
- class ze {
2793
+ class De {
2701
2794
  /**
2702
2795
  * Create a new ImageFilter
2703
2796
  * @param extensions - Array of allowed file extensions (without dots)
@@ -2719,8 +2812,8 @@ class ze {
2719
2812
  * @returns True if the file extension is allowed
2720
2813
  */
2721
2814
  isAllowed(t) {
2722
- var o;
2723
- const i = (o = t.split("?")[0].split(".").pop()) == null ? void 0 : o.toLowerCase();
2815
+ var n;
2816
+ const i = (n = t.split("?")[0].split(".").pop()) == null ? void 0 : n.toLowerCase();
2724
2817
  return i ? this.allowedExtensions.includes(i) : !1;
2725
2818
  }
2726
2819
  /**
@@ -2735,7 +2828,7 @@ class ze {
2735
2828
  // isAllowedDate(date: Date): boolean
2736
2829
  // isAllowedDimensions(width: number, height: number): boolean
2737
2830
  }
2738
- const Me = `
2831
+ const Pe = `
2739
2832
  .fbn-ic-gallery {
2740
2833
  position: relative;
2741
2834
  width: 100%;
@@ -2776,34 +2869,34 @@ const Me = `
2776
2869
  display: none !important;
2777
2870
  }
2778
2871
  `;
2779
- function Te() {
2872
+ function Ue() {
2780
2873
  if (typeof document > "u") return;
2781
- const n = "fbn-ic-functional-styles";
2782
- if (document.getElementById(n)) return;
2874
+ const o = "fbn-ic-functional-styles";
2875
+ if (document.getElementById(o)) return;
2783
2876
  const t = document.createElement("style");
2784
- t.id = n, t.textContent = Me, document.head.appendChild(t);
2877
+ t.id = o, t.textContent = Pe, document.head.appendChild(t);
2785
2878
  }
2786
- class Fe {
2879
+ class He {
2787
2880
  constructor(t = {}) {
2788
- var i, o, a, c, s, h;
2789
- this.fullConfig = Bt(t), t.container instanceof HTMLElement ? (this.containerRef = t.container, this.containerId = null) : (this.containerRef = null, this.containerId = t.container || "imageCloud"), this.imagesLoaded = !1, this.imageElements = [], this.imageLayouts = [], this.currentImageHeight = 225, this.currentFocusIndex = null, this.hoveredImage = null, this.resizeTimeout = null, this.displayQueue = [], this.queueInterval = null, this.loadGeneration = 0, this.animationEngine = new Zt(this.fullConfig.animation), this.layoutEngine = new ve({
2881
+ var i, n, s, r, a, h;
2882
+ this.fullConfig = Vt(t), t.container instanceof HTMLElement ? (this.containerRef = t.container, this.containerId = null) : (this.containerRef = null, this.containerId = t.container || "imageCloud"), this.imagesLoaded = !1, this.imageElements = [], this.imageLayouts = [], this.currentImageHeight = 225, this.currentFocusIndex = null, this.hoveredImage = null, this.resizeTimeout = null, this.displayQueue = [], this.queueInterval = null, this.loadGeneration = 0, this.animationEngine = new Qt(this.fullConfig.animation), this.layoutEngine = new xe({
2790
2883
  layout: this.fullConfig.layout,
2791
2884
  image: this.fullConfig.image
2792
- }), this.zoomEngine = new Ie(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = ft((i = this.fullConfig.styling) == null ? void 0 : i.default), this.hoverStyles = ft((o = this.fullConfig.styling) == null ? void 0 : o.hover), this.defaultClassName = (c = (a = this.fullConfig.styling) == null ? void 0 : a.default) == null ? void 0 : c.className, this.hoverClassName = (h = (s = this.fullConfig.styling) == null ? void 0 : s.hover) == null ? void 0 : h.className;
2885
+ }), this.zoomEngine = new Te(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = ft((i = this.fullConfig.styling) == null ? void 0 : i.default), this.hoverStyles = ft((n = this.fullConfig.styling) == null ? void 0 : n.hover), this.defaultClassName = (r = (s = this.fullConfig.styling) == null ? void 0 : s.default) == null ? void 0 : r.className, this.hoverClassName = (h = (a = this.fullConfig.styling) == null ? void 0 : a.hover) == null ? void 0 : h.className;
2793
2886
  const e = this.fullConfig.animation.entry || y.animation.entry;
2794
- this.entryAnimationEngine = new ce(
2887
+ this.entryAnimationEngine = new he(
2795
2888
  e,
2796
2889
  this.fullConfig.layout.algorithm
2797
- ), this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
2890
+ ), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
2798
2891
  }
2799
2892
  /**
2800
2893
  * Create image filter based on config
2801
2894
  */
2802
2895
  createImageFilter() {
2803
- var i, o;
2896
+ var i, n;
2804
2897
  const t = this.fullConfig.loader.type;
2805
2898
  let e;
2806
- return t === "googleDrive" ? e = (i = this.fullConfig.loader.googleDrive) == null ? void 0 : i.allowedExtensions : e = (o = this.fullConfig.loader.static) == null ? void 0 : o.allowedExtensions, new ze(e);
2899
+ return t === "googleDrive" ? e = (i = this.fullConfig.loader.googleDrive) == null ? void 0 : i.allowedExtensions : e = (n = this.fullConfig.loader.static) == null ? void 0 : n.allowedExtensions, new De(e);
2807
2900
  }
2808
2901
  /**
2809
2902
  * Create appropriate image loader based on config
@@ -2818,18 +2911,18 @@ class Fe {
2818
2911
  const e = t.type;
2819
2912
  if (e === "static") {
2820
2913
  const i = t.static;
2821
- return new Re(i);
2914
+ return new Oe(i);
2822
2915
  } else if (e === "composite") {
2823
- const i = t.composite, o = i.loaders.map(
2824
- (a) => this.createLoaderFromConfig(a)
2916
+ const i = t.composite, n = i.loaders.map(
2917
+ (s) => this.createLoaderFromConfig(s)
2825
2918
  );
2826
- return new Ae({
2827
- loaders: o,
2919
+ return new $e({
2920
+ loaders: n,
2828
2921
  debugLogging: i.debugLogging
2829
2922
  });
2830
2923
  } else {
2831
2924
  const i = t.googleDrive;
2832
- return new Ee(i);
2925
+ return new Le(i);
2833
2926
  }
2834
2927
  }
2835
2928
  /**
@@ -2837,11 +2930,18 @@ class Fe {
2837
2930
  */
2838
2931
  async init() {
2839
2932
  try {
2840
- if (Te(), this.containerRef)
2933
+ if (Ue(), this.containerRef)
2841
2934
  this.containerEl = this.containerRef;
2842
2935
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
2843
2936
  throw new Error(`Container #${this.containerId} not found`);
2844
- this.containerEl.classList.add("fbn-ic-gallery"), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
2937
+ this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new Et(this.containerEl, {
2938
+ onNext: () => this.navigateToNextImage(),
2939
+ onPrev: () => this.navigateToPreviousImage(),
2940
+ onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
2941
+ onDragEnd: (t) => {
2942
+ t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Ce);
2943
+ }
2944
+ }), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
2845
2945
  } catch (t) {
2846
2946
  console.error("Gallery initialization failed:", t), this.errorEl && t instanceof Error && this.showError("Gallery failed to initialize: " + t.message);
2847
2947
  }
@@ -2851,9 +2951,11 @@ class Fe {
2851
2951
  }
2852
2952
  setupEventListeners() {
2853
2953
  document.addEventListener("keydown", (t) => {
2854
- t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
2954
+ var e;
2955
+ t.key === "Escape" ? (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (e = this.swipeEngine) == null || e.disable()) : t.key === "ArrowRight" ? this.navigateToNextImage() : t.key === "ArrowLeft" ? this.navigateToPreviousImage() : (t.key === "Enter" || t.key === " ") && this.hoveredImage && (this.handleImageClick(this.hoveredImage.element, this.hoveredImage.layout), t.preventDefault());
2855
2956
  }), document.addEventListener("click", (t) => {
2856
- t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null);
2957
+ var e, i;
2958
+ (e = this.swipeEngine) != null && e.hadRecentTouch() || t.target.closest(".fbn-ic-image") || (this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (i = this.swipeEngine) == null || i.disable());
2857
2959
  }), window.addEventListener("resize", () => this.handleResize());
2858
2960
  }
2859
2961
  /**
@@ -2887,8 +2989,8 @@ class Fe {
2887
2989
  }, 500));
2888
2990
  }
2889
2991
  getImageHeight() {
2890
- const t = window.innerWidth, e = this.fullConfig.layout.responsive, i = this.fullConfig.image.sizing, o = (i == null ? void 0 : i.maxSize) ?? 400;
2891
- return e ? t <= e.mobile.maxWidth ? Math.min(100, o) : t <= e.tablet.maxWidth ? Math.min(180, o) : Math.min(225, o) : t <= 767 ? Math.min(100, o) : t <= 1199 ? Math.min(180, o) : Math.min(225, o);
2992
+ const t = window.innerWidth, e = this.fullConfig.layout.responsive, i = this.fullConfig.image.sizing, n = (i == null ? void 0 : i.maxSize) ?? 400;
2993
+ return e ? t <= e.mobile.maxWidth ? Math.min(100, n) : t <= e.tablet.maxWidth ? Math.min(180, n) : Math.min(225, n) : t <= 767 ? Math.min(100, n) : t <= 1199 ? Math.min(180, n) : Math.min(225, n);
2892
2994
  }
2893
2995
  /**
2894
2996
  * Get container bounds for layout calculations
@@ -2911,15 +3013,15 @@ class Fe {
2911
3013
  this.showError("No images found."), this.showLoading(!1);
2912
3014
  return;
2913
3015
  }
2914
- const i = this.getContainerBounds(), o = this.getImageHeight(), a = window.innerWidth;
2915
- this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${o}px`);
2916
- const c = this.layoutEngine.calculateAdaptiveSize(
3016
+ const i = this.getContainerBounds(), n = this.getImageHeight(), s = window.innerWidth;
3017
+ this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${n}px`);
3018
+ const r = this.layoutEngine.calculateAdaptiveSize(
2917
3019
  i,
2918
3020
  t,
2919
- o,
2920
- a
3021
+ n,
3022
+ s
2921
3023
  );
2922
- this.logDebug(`Adaptive sizing result: height=${c.height}px`), await this.createImageCloud(e, c.height), this.showLoading(!1), this.imagesLoaded = !0;
3024
+ this.logDebug(`Adaptive sizing result: height=${r.height}px`), await this.createImageCloud(e, r.height), this.showLoading(!1), this.imagesLoaded = !0;
2923
3025
  } catch (t) {
2924
3026
  console.error("Error loading images:", t), t instanceof Error && this.showError(t.message || "Failed to load images."), this.showLoading(!1);
2925
3027
  }
@@ -2934,10 +3036,10 @@ class Fe {
2934
3036
  if (!this.containerEl) return;
2935
3037
  const i = this.getContainerBounds();
2936
3038
  this.currentImageHeight = e;
2937
- const o = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
2938
- this.imageLayouts = a, this.displayQueue = [];
2939
- let c = 0;
2940
- const s = (l) => {
3039
+ const n = this.loadGeneration, s = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
3040
+ this.imageLayouts = s, this.displayQueue = [];
3041
+ let r = 0;
3042
+ const a = (l) => {
2941
3043
  this.containerEl && (this.containerEl.appendChild(l), this.imageElements.push(l), requestAnimationFrame(() => {
2942
3044
  if (l.offsetWidth, l.style.opacity = this.defaultStyles.opacity ?? "1", l.dataset.startX && (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || l.dataset.startRotation !== l.dataset.rotation || l.dataset.startScale !== l.dataset.scale)) {
2943
3045
  const d = {
@@ -2947,7 +3049,7 @@ class Fe {
2947
3049
  x: parseFloat(l.dataset.endX),
2948
3050
  y: parseFloat(l.dataset.endY)
2949
3051
  }, b = parseFloat(l.dataset.imageWidth), p = parseFloat(l.dataset.imageHeight), g = parseFloat(l.dataset.rotation), f = parseFloat(l.dataset.scale), v = l.dataset.startRotation ? parseFloat(l.dataset.startRotation) : g, w = l.dataset.startScale ? parseFloat(l.dataset.startScale) : f, E = this.entryAnimationEngine.getTiming();
2950
- se({
3052
+ re({
2951
3053
  element: l,
2952
3054
  startPosition: d,
2953
3055
  endPosition: m,
@@ -2966,10 +3068,10 @@ class Fe {
2966
3068
  const d = l.dataset.finalTransform || "";
2967
3069
  l.style.transform = d;
2968
3070
  }
2969
- const r = parseInt(l.dataset.imageId || "0");
2970
- if (this.fullConfig.debug && r < 3) {
3071
+ const c = parseInt(l.dataset.imageId || "0");
3072
+ if (this.fullConfig.debug && c < 3) {
2971
3073
  const d = l.dataset.finalTransform || "";
2972
- console.log(`Image ${r} final state:`, {
3074
+ console.log(`Image ${c} final state:`, {
2973
3075
  left: l.style.left,
2974
3076
  top: l.style.top,
2975
3077
  width: l.style.width,
@@ -2980,64 +3082,64 @@ class Fe {
2980
3082
  pathType: this.entryAnimationEngine.getPathType()
2981
3083
  });
2982
3084
  }
2983
- }), c++);
3085
+ }), r++);
2984
3086
  }, h = () => {
2985
3087
  if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
2986
3088
  for (; this.displayQueue.length > 0; ) {
2987
3089
  const l = this.displayQueue.shift();
2988
- l && s(l);
3090
+ l && a(l);
2989
3091
  }
2990
3092
  return;
2991
3093
  }
2992
3094
  this.queueInterval !== null && clearInterval(this.queueInterval), this.queueInterval = window.setInterval(() => {
2993
- if (o !== this.loadGeneration) {
3095
+ if (n !== this.loadGeneration) {
2994
3096
  this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
2995
3097
  return;
2996
3098
  }
2997
3099
  if (this.displayQueue.length > 0) {
2998
3100
  const l = this.displayQueue.shift();
2999
- l && s(l);
3101
+ l && a(l);
3000
3102
  }
3001
- c >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3103
+ r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3002
3104
  }, this.fullConfig.animation.queue.interval);
3003
3105
  };
3004
3106
  if ("IntersectionObserver" in window && this.containerEl) {
3005
3107
  const l = new IntersectionObserver((u) => {
3006
- u.forEach((r) => {
3007
- r.isIntersecting && (h(), l.disconnect());
3108
+ u.forEach((c) => {
3109
+ c.isIntersecting && (h(), l.disconnect());
3008
3110
  });
3009
3111
  }, { threshold: 0.1, rootMargin: "50px" });
3010
3112
  l.observe(this.containerEl);
3011
3113
  } else
3012
3114
  h();
3013
- this.fullConfig.layout.debugCenters && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), a.forEach((l, u) => {
3014
- const r = document.createElement("div");
3015
- r.className = "fbn-ic-debug-center", r.style.position = "absolute", r.style.width = "12px", r.style.height = "12px", r.style.borderRadius = "50%", r.style.backgroundColor = "red", r.style.border = "2px solid yellow", r.style.zIndex = "9999", r.style.pointerEvents = "none";
3115
+ this.fullConfig.layout.debugCenters && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((l) => l.remove()), s.forEach((l, u) => {
3116
+ const c = document.createElement("div");
3117
+ c.className = "fbn-ic-debug-center", c.style.position = "absolute", c.style.width = "12px", c.style.height = "12px", c.style.borderRadius = "50%", c.style.backgroundColor = "red", c.style.border = "2px solid yellow", c.style.zIndex = "9999", c.style.pointerEvents = "none";
3016
3118
  const d = l.x, m = l.y;
3017
- r.style.left = `${d - 6}px`, r.style.top = `${m - 6}px`, r.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(m)})`, this.containerEl.appendChild(r);
3119
+ c.style.left = `${d - 6}px`, c.style.top = `${m - 6}px`, c.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(m)})`, this.containerEl.appendChild(c);
3018
3120
  })), t.forEach((l, u) => {
3019
3121
  var m, b;
3020
- const r = document.createElement("img");
3021
- r.referrerPolicy = "no-referrer", r.classList.add("fbn-ic-image"), r.dataset.imageId = String(u);
3022
- const d = a[u];
3023
- r.style.position = "absolute", r.style.width = "auto", r.style.height = `${e}px`, r.style.left = `${d.x}px`, r.style.top = `${d.y}px`, d.borderColor && !((b = (m = this.fullConfig.styling) == null ? void 0 : m.default) != null && b.border) && (r.style.border = `5px solid ${d.borderColor}`, r.style.boxSizing = "border-box"), d.zIndex && (r.style.zIndex = String(d.zIndex)), lt(r, this.defaultStyles), ht(r, this.defaultClassName), r.addEventListener("mouseenter", () => {
3024
- this.hoveredImage = { element: r, layout: d }, this.zoomEngine.isInvolved(r) || (lt(r, this.hoverStyles), ht(r, this.hoverClassName));
3025
- }), r.addEventListener("mouseleave", () => {
3026
- this.hoveredImage = null, this.zoomEngine.isInvolved(r) || (lt(r, this.defaultStyles), Dt(r, this.hoverClassName), ht(r, this.defaultClassName));
3027
- }), r.addEventListener("click", (p) => {
3028
- p.stopPropagation(), this.handleImageClick(r, d);
3029
- }), r.style.opacity = "0", r.style.transition = this.entryAnimationEngine.getTransitionCSS(), r.onload = () => {
3030
- if (o !== this.loadGeneration)
3122
+ const c = document.createElement("img");
3123
+ c.referrerPolicy = "no-referrer", c.classList.add("fbn-ic-image"), c.dataset.imageId = String(u);
3124
+ const d = s[u];
3125
+ c.style.position = "absolute", c.style.width = "auto", c.style.height = `${e}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, d.borderColor && !((b = (m = this.fullConfig.styling) == null ? void 0 : m.default) != null && b.border) && (c.style.border = `5px solid ${d.borderColor}`, c.style.boxSizing = "border-box"), d.zIndex && (c.style.zIndex = String(d.zIndex)), lt(c, this.defaultStyles), ht(c, this.defaultClassName), c.addEventListener("mouseenter", () => {
3126
+ this.hoveredImage = { element: c, layout: d }, this.zoomEngine.isInvolved(c) || (lt(c, this.hoverStyles), ht(c, this.hoverClassName));
3127
+ }), c.addEventListener("mouseleave", () => {
3128
+ this.hoveredImage = null, this.zoomEngine.isInvolved(c) || (lt(c, this.defaultStyles), Ut(c, this.hoverClassName), ht(c, this.defaultClassName));
3129
+ }), c.addEventListener("click", (p) => {
3130
+ p.stopPropagation(), this.handleImageClick(c, d);
3131
+ }), c.style.opacity = "0", c.style.transition = this.entryAnimationEngine.getTransitionCSS(), c.onload = () => {
3132
+ if (n !== this.loadGeneration)
3031
3133
  return;
3032
- const p = r.naturalWidth / r.naturalHeight, g = e * p;
3033
- r.style.width = `${g}px`;
3134
+ const p = c.naturalWidth / c.naturalHeight, g = e * p;
3135
+ c.style.width = `${g}px`;
3034
3136
  const f = { x: d.x, y: d.y }, v = { width: g, height: e }, w = this.entryAnimationEngine.calculateStartPosition(
3035
3137
  f,
3036
3138
  v,
3037
3139
  i,
3038
3140
  u,
3039
3141
  t.length
3040
- ), E = this.entryAnimationEngine.calculateStartRotation(d.rotation), A = this.entryAnimationEngine.calculateStartScale(d.scale), x = this.entryAnimationEngine.buildFinalTransform(
3142
+ ), E = this.entryAnimationEngine.calculateStartRotation(d.rotation), R = this.entryAnimationEngine.calculateStartScale(d.scale), x = this.entryAnimationEngine.buildFinalTransform(
3041
3143
  d.rotation,
3042
3144
  d.scale,
3043
3145
  g,
@@ -3050,7 +3152,7 @@ class Fe {
3050
3152
  g,
3051
3153
  e,
3052
3154
  E,
3053
- A
3155
+ R
3054
3156
  );
3055
3157
  this.fullConfig.debug && u < 3 && console.log(`Image ${u}:`, {
3056
3158
  finalPosition: f,
@@ -3060,21 +3162,22 @@ class Fe {
3060
3162
  finalTransform: x,
3061
3163
  renderedWidth: g,
3062
3164
  renderedHeight: e
3063
- }), r.style.transform = L, r.dataset.finalTransform = x, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || E !== d.rotation || A !== d.scale) && (r.dataset.startX = String(w.x), r.dataset.startY = String(w.y), r.dataset.endX = String(f.x), r.dataset.endY = String(f.y), r.dataset.imageWidth = String(g), r.dataset.imageHeight = String(e), r.dataset.rotation = String(d.rotation), r.dataset.scale = String(d.scale), r.dataset.startRotation = String(E), r.dataset.startScale = String(A)), this.displayQueue.push(r);
3064
- }, r.onerror = () => c++, r.src = l;
3165
+ }), c.style.transform = L, c.dataset.finalTransform = x, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || E !== d.rotation || R !== d.scale) && (c.dataset.startX = String(w.x), c.dataset.startY = String(w.y), c.dataset.endX = String(f.x), c.dataset.endY = String(f.y), c.dataset.imageWidth = String(g), c.dataset.imageHeight = String(e), c.dataset.rotation = String(d.rotation), c.dataset.scale = String(d.scale), c.dataset.startRotation = String(E), c.dataset.startScale = String(R)), this.displayQueue.push(c);
3166
+ }, c.onerror = () => r++, c.src = l;
3065
3167
  });
3066
3168
  }
3067
3169
  async handleImageClick(t, e) {
3170
+ var s, r;
3068
3171
  if (!this.containerEl) return;
3069
- const i = this.zoomEngine.isFocused(t), o = {
3172
+ const i = this.zoomEngine.isFocused(t), n = {
3070
3173
  width: this.containerEl.offsetWidth,
3071
3174
  height: this.containerEl.offsetHeight
3072
3175
  };
3073
3176
  if (i)
3074
- await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null;
3177
+ await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, (s = this.swipeEngine) == null || s.disable();
3075
3178
  else {
3076
3179
  const a = t.dataset.imageId;
3077
- this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, await this.zoomEngine.focusImage(t, o, e);
3180
+ this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, (r = this.swipeEngine) == null || r.enable(), await this.zoomEngine.focusImage(t, n, e);
3078
3181
  }
3079
3182
  }
3080
3183
  /**
@@ -3096,23 +3199,24 @@ class Fe {
3096
3199
  * Destroy the gallery and clean up resources
3097
3200
  */
3098
3201
  destroy() {
3099
- this.clearImageCloud(), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout);
3202
+ var t;
3203
+ this.clearImageCloud(), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), (t = this.swipeEngine) == null || t.destroy();
3100
3204
  }
3101
3205
  }
3102
- function Ce() {
3206
+ function _e() {
3103
3207
  if (typeof document > "u") return;
3104
- const n = "fbn-ic-styles";
3105
- if (document.getElementById(n)) return;
3208
+ const o = "fbn-ic-styles";
3209
+ if (document.getElementById(o)) return;
3106
3210
  const t = document.createElement("style");
3107
- t.id = n, t.textContent = Ht, document.head.appendChild(t);
3211
+ t.id = o, t.textContent = kt, document.head.appendChild(t);
3108
3212
  }
3109
- Ce();
3110
- function Le() {
3213
+ _e();
3214
+ function ke() {
3111
3215
  if (typeof document > "u") {
3112
3216
  console.warn("ImageCloud: Document not available (not in browser environment)");
3113
3217
  return;
3114
3218
  }
3115
- const n = () => {
3219
+ const o = () => {
3116
3220
  const t = document.querySelectorAll("[data-image-cloud], [data-image-gallery]");
3117
3221
  t.length !== 0 && t.forEach((e) => {
3118
3222
  const i = e;
@@ -3120,34 +3224,34 @@ function Le() {
3120
3224
  console.error("ImageCloud: Container with data-image-cloud must have an id attribute");
3121
3225
  return;
3122
3226
  }
3123
- const o = i.dataset.config || i.dataset.galleryConfig;
3124
- let a;
3125
- if (o)
3227
+ const n = i.dataset.config || i.dataset.galleryConfig;
3228
+ let s;
3229
+ if (n)
3126
3230
  try {
3127
- const s = JSON.parse(o);
3128
- a = {
3231
+ const a = JSON.parse(n);
3232
+ s = {
3129
3233
  container: i.id,
3130
- ...s
3234
+ ...a
3131
3235
  };
3132
- } catch (s) {
3133
- console.error(`ImageCloud: Failed to parse configuration JSON for #${i.id}:`, s);
3236
+ } catch (a) {
3237
+ console.error(`ImageCloud: Failed to parse configuration JSON for #${i.id}:`, a);
3134
3238
  return;
3135
3239
  }
3136
3240
  else {
3137
3241
  console.error(`ImageCloud: Missing configuration for #${i.id}. Add data-config='{...}' attribute.`);
3138
3242
  return;
3139
3243
  }
3140
- new Fe(a).init().catch((s) => {
3141
- console.error("ImageCloud initialization failed:", s);
3244
+ new He(s).init().catch((a) => {
3245
+ console.error("ImageCloud initialization failed:", a);
3142
3246
  });
3143
3247
  });
3144
3248
  };
3145
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", n) : n();
3249
+ document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", o) : o();
3146
3250
  }
3147
- Le();
3251
+ ke();
3148
3252
  export {
3149
- Fe as ImageCloud,
3150
- Fe as ImageGallery,
3151
- Le as autoInitialize
3253
+ He as ImageCloud,
3254
+ He as ImageGallery,
3255
+ ke as autoInitialize
3152
3256
  };
3153
3257
  //# sourceMappingURL=image-cloud-auto-init.js.map