@frybynite/image-cloud 0.7.4 → 0.7.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.
package/dist/react.js CHANGED
@@ -1,32 +1,32 @@
1
- import { jsx as $t } from "react/jsx-runtime";
2
- import { forwardRef as Pt, useRef as wt, useImperativeHandle as Ut, useEffect as _t } from "react";
1
+ import { jsx as Dt } from "react/jsx-runtime";
2
+ import { forwardRef as Pt, useRef as xt, useImperativeHandle as Ut, useEffect as _t } from "react";
3
3
  const ft = Object.freeze({
4
4
  none: "none",
5
5
  sm: "0 2px 4px rgba(0,0,0,0.1)",
6
6
  md: "0 4px 16px rgba(0,0,0,0.4)",
7
7
  lg: "0 8px 32px rgba(0,0,0,0.5)",
8
8
  glow: "0 0 30px rgba(255,255,255,0.6)"
9
- }), xt = Object.freeze({
9
+ }), St = Object.freeze({
10
10
  energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
11
11
  playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
12
12
  subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
13
- }), St = Object.freeze({
13
+ }), Et = Object.freeze({
14
14
  gentle: Object.freeze({ stiffness: 150, damping: 30, mass: 1, oscillations: 2 }),
15
15
  bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
16
16
  wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
17
17
  snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
18
- }), Et = Object.freeze({
18
+ }), Rt = Object.freeze({
19
19
  gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
20
20
  playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
21
21
  serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
22
22
  flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
23
- }), pt = Object.freeze({
24
- type: "linear"
25
23
  }), bt = Object.freeze({
26
- mode: "none"
24
+ type: "linear"
27
25
  }), yt = Object.freeze({
28
26
  mode: "none"
29
- }), Ct = Object.freeze({
27
+ }), vt = Object.freeze({
28
+ mode: "none"
29
+ }), At = Object.freeze({
30
30
  default: Object.freeze({
31
31
  border: Object.freeze({
32
32
  width: 0,
@@ -59,10 +59,10 @@ const ft = Object.freeze({
59
59
  phaseShift: 0,
60
60
  synchronization: "offset"
61
61
  // Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
62
- }), Nt = Object.freeze({
62
+ }), jt = Object.freeze({
63
63
  mobile: Object.freeze({ maxWidth: 767 }),
64
64
  tablet: Object.freeze({ maxWidth: 1199 })
65
- }), jt = Object.freeze({
65
+ }), Nt = Object.freeze({
66
66
  mode: "adaptive",
67
67
  // Default to adaptive sizing
68
68
  minSize: 50,
@@ -74,21 +74,21 @@ const ft = Object.freeze({
74
74
  // No variance by default
75
75
  max: 1
76
76
  })
77
- }), kt = Object.freeze({
77
+ }), Wt = Object.freeze({
78
78
  mode: "none",
79
79
  range: Object.freeze({
80
80
  min: -15,
81
81
  max: 15
82
82
  })
83
- }), Rt = Object.freeze({
84
- sizing: jt,
85
- rotation: kt
83
+ }), Lt = Object.freeze({
84
+ sizing: Nt,
85
+ rotation: Wt
86
86
  }), Mt = Object.freeze({
87
87
  validateUrls: !0,
88
88
  validationTimeout: 5e3,
89
89
  validationMethod: "head",
90
90
  allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
91
- }), Lt = Object.freeze({
91
+ }), Ft = Object.freeze({
92
92
  enabled: !1,
93
93
  centers: !1,
94
94
  loaders: !1
@@ -98,16 +98,16 @@ const ft = Object.freeze({
98
98
  // Shared loader settings and debug config
99
99
  config: Object.freeze({
100
100
  loaders: Mt,
101
- debug: Lt
101
+ debug: Ft
102
102
  }),
103
103
  // Image sizing and rotation configuration
104
- image: Rt,
104
+ image: Lt,
105
105
  // Pattern-based layout configuration
106
106
  layout: Object.freeze({
107
107
  algorithm: "radial",
108
108
  scaleDecay: 0,
109
109
  // No decay by default (0-1 for radial/spiral)
110
- responsive: Nt,
110
+ responsive: jt,
111
111
  targetCoverage: 0.6,
112
112
  // Target 60% of container area
113
113
  densityFactor: 1,
@@ -163,9 +163,9 @@ const ft = Object.freeze({
163
163
  }),
164
164
  easing: "cubic-bezier(0.25, 1, 0.5, 1)",
165
165
  // smooth deceleration
166
- path: pt,
167
- rotation: bt,
168
- scale: yt
166
+ path: bt,
167
+ rotation: yt,
168
+ scale: vt
169
169
  })
170
170
  }),
171
171
  // Pattern-based interaction configuration
@@ -218,50 +218,50 @@ const ft = Object.freeze({
218
218
  })
219
219
  }),
220
220
  // Image styling
221
- styling: Ct
221
+ styling: At
222
222
  });
223
- function Z(n, t) {
224
- if (!n) return t || {};
225
- if (!t) return { ...n };
226
- const e = { ...n };
227
- 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.clipPath !== void 0 && (e.clipPath = t.clipPath), 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;
223
+ function Z(o, t) {
224
+ if (!o) return t || {};
225
+ if (!t) return { ...o };
226
+ const i = { ...o };
227
+ return t.border !== void 0 && (i.border = { ...o.border, ...t.border }), t.borderTop !== void 0 && (i.borderTop = { ...o.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (i.borderRight = { ...o.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (i.borderBottom = { ...o.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (i.borderLeft = { ...o.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (i.filter = { ...o.filter, ...t.filter }), t.outline !== void 0 && (i.outline = { ...o.outline, ...t.outline }), t.shadow !== void 0 && (i.shadow = t.shadow), t.clipPath !== void 0 && (i.clipPath = t.clipPath), t.opacity !== void 0 && (i.opacity = t.opacity), t.cursor !== void 0 && (i.cursor = t.cursor), t.className !== void 0 && (i.className = t.className), t.objectFit !== void 0 && (i.objectFit = t.objectFit), t.aspectRatio !== void 0 && (i.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (i.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (i.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (i.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (i.borderRadiusBottomLeft = t.borderRadiusBottomLeft), i;
228
228
  }
229
- function Wt(n, t) {
230
- if (!t) return { ...n };
231
- const e = Z(n.default, t.default), i = Z(
232
- Z(e, n.hover),
229
+ function kt(o, t) {
230
+ if (!t) return { ...o };
231
+ const i = Z(o.default, t.default), e = Z(
232
+ Z(i, o.hover),
233
233
  t.hover
234
- ), o = Z(
235
- Z(e, n.focused),
234
+ ), n = Z(
235
+ Z(i, o.focused),
236
236
  t.focused
237
237
  );
238
238
  return {
239
- default: e,
240
- hover: i,
241
- focused: o
239
+ default: i,
240
+ hover: e,
241
+ focused: n
242
242
  };
243
243
  }
244
- function Gt(n, t) {
245
- if (!t) return { ...n };
246
- const e = { ...n };
247
- if (t.sizing !== void 0 && (e.sizing = {
248
- ...n.sizing,
244
+ function Gt(o, t) {
245
+ if (!t) return { ...o };
246
+ const i = { ...o };
247
+ if (t.sizing !== void 0 && (i.sizing = {
248
+ ...o.sizing,
249
249
  ...t.sizing
250
250
  }, t.sizing.variance)) {
251
- const i = t.sizing.variance, o = i.min !== void 0 && i.min >= 0.25 && i.min <= 1 ? i.min : n.sizing?.variance?.min ?? 1, s = i.max !== void 0 && i.max >= 1 && i.max <= 1.75 ? i.max : n.sizing?.variance?.max ?? 1;
252
- e.sizing.variance = { min: o, max: s };
251
+ const e = t.sizing.variance, n = e.min !== void 0 && e.min >= 0.25 && e.min <= 1 ? e.min : o.sizing?.variance?.min ?? 1, a = e.max !== void 0 && e.max >= 1 && e.max <= 1.75 ? e.max : o.sizing?.variance?.max ?? 1;
252
+ i.sizing.variance = { min: n, max: a };
253
253
  }
254
- if (t.rotation !== void 0 && (e.rotation = {
255
- ...n.rotation,
254
+ if (t.rotation !== void 0 && (i.rotation = {
255
+ ...o.rotation,
256
256
  ...t.rotation
257
257
  }, t.rotation.range)) {
258
- const i = t.rotation.range, o = i.min !== void 0 && i.min >= -180 && i.min <= 0 ? i.min : n.rotation?.range?.min ?? -15, s = i.max !== void 0 && i.max >= 0 && i.max <= 180 ? i.max : n.rotation?.range?.max ?? 15;
259
- e.rotation.range = { min: o, max: s };
258
+ const e = t.rotation.range, n = e.min !== void 0 && e.min >= -180 && e.min <= 0 ? e.min : o.rotation?.range?.min ?? -15, a = e.max !== void 0 && e.max >= 0 && e.max <= 180 ? e.max : o.rotation?.range?.max ?? 15;
259
+ i.rotation.range = { min: n, max: a };
260
260
  }
261
- return e;
261
+ return i;
262
262
  }
263
- function qt(n) {
264
- const t = n.layout?.rotation;
263
+ function qt(o) {
264
+ const t = o.layout?.rotation;
265
265
  if (t && "enabled" in t)
266
266
  return {
267
267
  rotation: {
@@ -270,8 +270,8 @@ function qt(n) {
270
270
  }
271
271
  };
272
272
  }
273
- function Yt(n) {
274
- const t = n.layout?.sizing?.variance;
273
+ function Bt(o) {
274
+ const t = o.layout?.sizing?.variance;
275
275
  if (t)
276
276
  return {
277
277
  sizing: {
@@ -281,111 +281,111 @@ function Yt(n) {
281
281
  }
282
282
  };
283
283
  }
284
- function Xt(n = {}) {
285
- const t = qt(n), e = Yt(n);
286
- let i = n.image;
287
- (t || e) && (i = {
288
- ...e || {},
284
+ function Yt(o = {}) {
285
+ const t = qt(o), i = Bt(o);
286
+ let e = o.image;
287
+ (t || i) && (e = {
288
+ ...i || {},
289
289
  ...t || {},
290
- ...i
291
- }, i.rotation && t?.rotation && n.image?.rotation && (i.rotation = {
290
+ ...e
291
+ }, e.rotation && t?.rotation && o.image?.rotation && (e.rotation = {
292
292
  ...t.rotation,
293
- ...n.image.rotation
293
+ ...o.image.rotation
294
294
  }));
295
- const o = [...n.loaders ?? []];
296
- n.images && n.images.length > 0 && o.unshift({
295
+ const n = [...o.loaders ?? []];
296
+ o.images && o.images.length > 0 && n.unshift({
297
297
  static: {
298
- sources: [{ urls: n.images }]
298
+ sources: [{ urls: o.images }]
299
299
  }
300
300
  });
301
301
  const r = {
302
302
  loaders: {
303
303
  ...Mt,
304
- ...n.config?.loaders ?? {}
304
+ ...o.config?.loaders ?? {}
305
305
  }
306
- }, a = {
307
- loaders: o,
306
+ }, s = {
307
+ loaders: n,
308
308
  config: r,
309
- image: Gt(Rt, i),
309
+ image: Gt(Lt, e),
310
310
  layout: { ...y.layout },
311
311
  animation: { ...y.animation },
312
312
  interaction: { ...y.interaction },
313
313
  rendering: { ...y.rendering },
314
- styling: Wt(Ct, n.styling)
314
+ styling: kt(At, o.styling)
315
315
  };
316
- return n.layout && (a.layout = {
316
+ return o.layout && (s.layout = {
317
317
  ...y.layout,
318
- ...n.layout
319
- }, n.layout.responsive && (a.layout.responsive = {
318
+ ...o.layout
319
+ }, o.layout.responsive && (s.layout.responsive = {
320
320
  ...y.layout.responsive,
321
- mobile: n.layout.responsive.mobile ? { ...y.layout.responsive.mobile, ...n.layout.responsive.mobile } : y.layout.responsive.mobile,
322
- tablet: n.layout.responsive.tablet ? { ...y.layout.responsive.tablet, ...n.layout.responsive.tablet } : y.layout.responsive.tablet
323
- }), n.layout.spacing && (a.layout.spacing = {
321
+ mobile: o.layout.responsive.mobile ? { ...y.layout.responsive.mobile, ...o.layout.responsive.mobile } : y.layout.responsive.mobile,
322
+ tablet: o.layout.responsive.tablet ? { ...y.layout.responsive.tablet, ...o.layout.responsive.tablet } : y.layout.responsive.tablet
323
+ }), o.layout.spacing && (s.layout.spacing = {
324
324
  ...y.layout.spacing,
325
- ...n.layout.spacing
326
- })), n.animation && (a.animation = {
325
+ ...o.layout.spacing
326
+ })), o.animation && (s.animation = {
327
327
  ...y.animation,
328
- ...n.animation
329
- }, n.animation.easing && (a.animation.easing = {
328
+ ...o.animation
329
+ }, o.animation.easing && (s.animation.easing = {
330
330
  ...y.animation.easing,
331
- ...n.animation.easing
332
- }), n.animation.queue && (a.animation.queue = {
331
+ ...o.animation.easing
332
+ }), o.animation.queue && (s.animation.queue = {
333
333
  ...y.animation.queue,
334
- ...n.animation.queue
335
- }), n.animation.performance && (a.animation.performance = {
334
+ ...o.animation.queue
335
+ }), o.animation.performance && (s.animation.performance = {
336
336
  ...y.animation.performance,
337
- ...n.animation.performance
338
- }), n.animation.entry && (a.animation.entry = {
337
+ ...o.animation.performance
338
+ }), o.animation.entry && (s.animation.entry = {
339
339
  ...y.animation.entry,
340
- ...n.animation.entry,
341
- start: n.animation.entry.start ? {
340
+ ...o.animation.entry,
341
+ start: o.animation.entry.start ? {
342
342
  ...y.animation.entry.start,
343
- ...n.animation.entry.start,
344
- circular: n.animation.entry.start.circular ? { ...y.animation.entry.start.circular, ...n.animation.entry.start.circular } : y.animation.entry.start.circular
343
+ ...o.animation.entry.start,
344
+ circular: o.animation.entry.start.circular ? { ...y.animation.entry.start.circular, ...o.animation.entry.start.circular } : y.animation.entry.start.circular
345
345
  } : y.animation.entry.start,
346
- timing: n.animation.entry.timing ? { ...y.animation.entry.timing, ...n.animation.entry.timing } : y.animation.entry.timing,
347
- path: n.animation.entry.path ? { ...pt, ...n.animation.entry.path } : y.animation.entry.path,
348
- rotation: n.animation.entry.rotation ? { ...bt, ...n.animation.entry.rotation } : y.animation.entry.rotation,
349
- scale: n.animation.entry.scale ? { ...yt, ...n.animation.entry.scale } : y.animation.entry.scale
350
- })), n.interaction && (a.interaction = {
346
+ timing: o.animation.entry.timing ? { ...y.animation.entry.timing, ...o.animation.entry.timing } : y.animation.entry.timing,
347
+ path: o.animation.entry.path ? { ...bt, ...o.animation.entry.path } : y.animation.entry.path,
348
+ rotation: o.animation.entry.rotation ? { ...yt, ...o.animation.entry.rotation } : y.animation.entry.rotation,
349
+ scale: o.animation.entry.scale ? { ...vt, ...o.animation.entry.scale } : y.animation.entry.scale
350
+ })), o.interaction && (s.interaction = {
351
351
  ...y.interaction,
352
- ...n.interaction
353
- }, n.interaction.focus && (a.interaction.focus = {
352
+ ...o.interaction
353
+ }, o.interaction.focus && (s.interaction.focus = {
354
354
  ...y.interaction.focus,
355
- ...n.interaction.focus
356
- }), n.interaction.navigation && (a.interaction.navigation = {
355
+ ...o.interaction.focus
356
+ }), o.interaction.navigation && (s.interaction.navigation = {
357
357
  ...y.interaction.navigation,
358
- ...n.interaction.navigation
359
- }), n.interaction.gestures && (a.interaction.gestures = {
358
+ ...o.interaction.navigation
359
+ }), o.interaction.gestures && (s.interaction.gestures = {
360
360
  ...y.interaction.gestures,
361
- ...n.interaction.gestures
362
- })), n.rendering && (a.rendering = {
361
+ ...o.interaction.gestures
362
+ })), o.rendering && (s.rendering = {
363
363
  ...y.rendering,
364
- ...n.rendering
365
- }, n.rendering.responsive && (a.rendering.responsive = {
364
+ ...o.rendering
365
+ }, o.rendering.responsive && (s.rendering.responsive = {
366
366
  ...y.rendering.responsive,
367
- ...n.rendering.responsive,
368
- breakpoints: n.rendering.responsive.breakpoints ? { ...y.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : y.rendering.responsive.breakpoints,
369
- mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : y.rendering.responsive.mobileDetection
370
- }), n.rendering.ui && (a.rendering.ui = {
367
+ ...o.rendering.responsive,
368
+ breakpoints: o.rendering.responsive.breakpoints ? { ...y.rendering.responsive.breakpoints, ...o.rendering.responsive.breakpoints } : y.rendering.responsive.breakpoints,
369
+ mobileDetection: o.rendering.responsive.mobileDetection ? o.rendering.responsive.mobileDetection : y.rendering.responsive.mobileDetection
370
+ }), o.rendering.ui && (s.rendering.ui = {
371
371
  ...y.rendering.ui,
372
- ...n.rendering.ui
373
- }), n.rendering.performance && (a.rendering.performance = {
372
+ ...o.rendering.ui
373
+ }), o.rendering.performance && (s.rendering.performance = {
374
374
  ...y.rendering.performance,
375
- ...n.rendering.performance
376
- })), a.config.debug = {
377
- ...Lt,
378
- ...n.config?.debug ?? {}
379
- }, a;
375
+ ...o.rendering.performance
376
+ })), s.config.debug = {
377
+ ...Ft,
378
+ ...o.config?.debug ?? {}
379
+ }, s;
380
380
  }
381
- function Bt(n, t) {
382
- return { ...n ? xt[n] : xt.playful, ...t };
381
+ function Xt(o, t) {
382
+ return { ...o ? St[o] : St.playful, ...t };
383
383
  }
384
- function Jt(n, t) {
385
- return { ...n ? St[n] : St.gentle, ...t };
384
+ function Jt(o, t) {
385
+ return { ...o ? Et[o] : Et.gentle, ...t };
386
386
  }
387
- function Vt(n, t) {
388
- return { ...n ? Et[n] : Et.gentle, ...t };
387
+ function Vt(o, t) {
388
+ return { ...o ? Rt[o] : Rt.gentle, ...t };
389
389
  }
390
390
  class Kt {
391
391
  constructor(t) {
@@ -396,12 +396,12 @@ class Kt {
396
396
  * Always starts with centering transform to match image positioning system
397
397
  */
398
398
  buildTransformString(t) {
399
- const e = ["translate(-50%, -50%)"];
399
+ const i = ["translate(-50%, -50%)"];
400
400
  if (t.x !== void 0 || t.y !== void 0) {
401
- const i = t.x ?? 0, o = t.y ?? 0;
402
- e.push(`translate(${i}px, ${o}px)`);
401
+ const e = t.x ?? 0, n = t.y ?? 0;
402
+ i.push(`translate(${e}px, ${n}px)`);
403
403
  }
404
- return t.rotation !== void 0 && e.push(`rotate(${t.rotation}deg)`), t.scale !== void 0 && e.push(`scale(${t.scale})`), e.join(" ");
404
+ return t.rotation !== void 0 && i.push(`rotate(${t.rotation}deg)`), t.scale !== void 0 && i.push(`scale(${t.scale})`), i.join(" ");
405
405
  }
406
406
  /**
407
407
  * Start a cancellable transform animation using Web Animations API
@@ -412,31 +412,31 @@ class Kt {
412
412
  * @param easing - CSS easing function (optional)
413
413
  * @returns AnimationHandle that can be used to cancel or query the animation
414
414
  */
415
- animateTransformCancellable(t, e, i, o = null, s = null) {
415
+ animateTransformCancellable(t, i, e, n = null, a = null) {
416
416
  this.cancelAllAnimations(t);
417
- const r = o ?? this.config.duration, a = s ?? this.config.easing.default, h = this.buildTransformString(e), c = this.buildTransformString(i);
417
+ const r = n ?? this.config.duration, s = a ?? this.config.easing.default, h = this.buildTransformString(i), c = this.buildTransformString(e);
418
418
  t.style.transition = "none";
419
- const u = t.animate(
419
+ const d = t.animate(
420
420
  [
421
421
  { transform: h },
422
422
  { transform: c }
423
423
  ],
424
424
  {
425
425
  duration: r,
426
- easing: a,
426
+ easing: s,
427
427
  fill: "forwards"
428
428
  // Keep final state after animation
429
429
  }
430
430
  ), l = {
431
431
  id: `anim-${++this.animationIdCounter}`,
432
432
  element: t,
433
- animation: u,
434
- fromState: e,
435
- toState: i,
433
+ animation: d,
434
+ fromState: i,
435
+ toState: e,
436
436
  startTime: performance.now(),
437
437
  duration: r
438
438
  };
439
- return this.activeAnimations.set(t, l), u.finished.then(() => {
439
+ return this.activeAnimations.set(t, l), d.finished.then(() => {
440
440
  t.style.transform = c, this.activeAnimations.delete(t);
441
441
  }).catch(() => {
442
442
  this.activeAnimations.delete(t);
@@ -448,18 +448,18 @@ class Kt {
448
448
  * @param commitStyle - If true, keeps current position; if false, no style change
449
449
  * @returns Snapshot of where the animation was when cancelled
450
450
  */
451
- cancelAnimation(t, e = !0) {
452
- const i = this.getCurrentTransform(t.element);
453
- if (t.animation.cancel(), e) {
454
- const o = this.buildTransformString({
455
- x: i.x,
456
- y: i.y,
457
- rotation: i.rotation,
458
- scale: i.scale
451
+ cancelAnimation(t, i = !0) {
452
+ const e = this.getCurrentTransform(t.element);
453
+ if (t.animation.cancel(), i) {
454
+ const n = this.buildTransformString({
455
+ x: e.x,
456
+ y: e.y,
457
+ rotation: e.rotation,
458
+ scale: e.scale
459
459
  });
460
- t.element.style.transform = o;
460
+ t.element.style.transform = n;
461
461
  }
462
- return this.activeAnimations.delete(t.element), i;
462
+ return this.activeAnimations.delete(t.element), e;
463
463
  }
464
464
  /**
465
465
  * Cancel all animations on an element
@@ -467,11 +467,11 @@ class Kt {
467
467
  * @param element - The element to cancel animations for
468
468
  */
469
469
  cancelAllAnimations(t) {
470
- const e = this.activeAnimations.get(t);
471
- e && this.cancelAnimation(e, !1);
472
- const i = t.getAnimations();
473
- for (const o of i)
474
- o.cancel();
470
+ const i = this.activeAnimations.get(t);
471
+ i && this.cancelAnimation(i, !1);
472
+ const e = t.getAnimations();
473
+ for (const n of e)
474
+ n.cancel();
475
475
  }
476
476
  /**
477
477
  * Get current transform state of an element (works mid-animation)
@@ -480,11 +480,11 @@ class Kt {
480
480
  * @returns Current transform snapshot
481
481
  */
482
482
  getCurrentTransform(t) {
483
- const i = getComputedStyle(t).transform;
484
- if (i === "none" || !i)
483
+ const e = getComputedStyle(t).transform;
484
+ if (e === "none" || !e)
485
485
  return { x: 0, y: 0, rotation: 0, scale: 1 };
486
- const o = new DOMMatrix(i), s = Math.sqrt(o.a * o.a + o.b * o.b), r = Math.atan2(o.b, o.a) * (180 / Math.PI), a = o.e, h = o.f;
487
- return { x: a, y: h, rotation: r, scale: s };
486
+ const n = new DOMMatrix(e), a = Math.sqrt(n.a * n.a + n.b * n.b), r = Math.atan2(n.b, n.a) * (180 / Math.PI), s = n.e, h = n.f;
487
+ return { x: s, y: h, rotation: r, scale: a };
488
488
  }
489
489
  /**
490
490
  * Check if an element has an active animation
@@ -510,11 +510,11 @@ class Kt {
510
510
  * @param easing - CSS easing function (optional)
511
511
  * @returns Promise that resolves when animation completes
512
512
  */
513
- animateTransform(t, e, i = null, o = null) {
514
- return new Promise((s) => {
515
- const r = i ?? this.config.duration, a = o ?? this.config.easing.default;
516
- t.style.transition = `transform ${r}ms ${a}, box-shadow ${r}ms ${a}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
517
- s();
513
+ animateTransform(t, i, e = null, n = null) {
514
+ return new Promise((a) => {
515
+ const r = e ?? this.config.duration, s = n ?? this.config.easing.default;
516
+ t.style.transition = `transform ${r}ms ${s}, box-shadow ${r}ms ${s}`, t.style.transform = this.buildTransformString(i), setTimeout(() => {
517
+ a();
518
518
  }, r);
519
519
  });
520
520
  }
@@ -524,8 +524,8 @@ class Kt {
524
524
  * @param originalState - Original transform state {x, y, rotation, scale}
525
525
  * @returns Promise that resolves when animation completes
526
526
  */
527
- resetTransform(t, e) {
528
- return this.animateTransform(t, e);
527
+ resetTransform(t, i) {
528
+ return this.animateTransform(t, i);
529
529
  }
530
530
  /**
531
531
  * Remove transition styles from element
@@ -540,162 +540,162 @@ class Kt {
540
540
  * @returns Promise that resolves after the specified duration
541
541
  */
542
542
  wait(t) {
543
- return new Promise((e) => setTimeout(e, t));
543
+ return new Promise((i) => setTimeout(i, t));
544
544
  }
545
545
  }
546
- function V(n, t, e) {
547
- return n + (t - n) * e;
546
+ function V(o, t, i) {
547
+ return o + (t - o) * i;
548
548
  }
549
- function Zt(n, t, e, i) {
550
- const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c = Qt(s, r);
551
- let u = 0, l = 0, d = 1, f = o, b = !1;
552
- for (let g = 0; g < c.length; g++)
553
- if (n <= c[g].time) {
554
- l = g === 0 ? 0 : c[g - 1].time, d = c[g].time, f = c[g].overshoot, b = c[g].isOvershoot;
549
+ function Zt(o, t, i, e) {
550
+ const { overshoot: n, bounces: a, decayRatio: r } = e, s = i.x - t.x, h = i.y - t.y, c = Qt(a, r);
551
+ let d = 0, l = 0, u = 1, g = n, p = !1;
552
+ for (let f = 0; f < c.length; f++)
553
+ if (o <= c[f].time) {
554
+ l = f === 0 ? 0 : c[f - 1].time, u = c[f].time, g = c[f].overshoot, p = c[f].isOvershoot;
555
555
  break;
556
556
  }
557
- const p = (n - l) / (d - l);
558
- if (b)
559
- u = 1 + f * ot(p);
557
+ const b = (o - l) / (u - l);
558
+ if (p)
559
+ d = 1 + g * ot(b);
560
560
  else if (l === 0)
561
- u = ot(p);
561
+ d = ot(b);
562
562
  else {
563
563
  const m = 1 + (c.find(
564
564
  (S, v) => S.time > l && v > 0 && c[v - 1].isOvershoot
565
- )?.overshoot || f);
566
- u = V(m, 1, ot(p));
565
+ )?.overshoot || g);
566
+ d = V(m, 1, ot(b));
567
567
  }
568
568
  return {
569
- x: t.x + a * u,
570
- y: t.y + h * u
569
+ x: t.x + s * d,
570
+ y: t.y + h * d
571
571
  };
572
572
  }
573
- function Qt(n, t) {
574
- const e = [];
575
- let i = 0.6;
576
- e.push({ time: i, overshoot: 0, isOvershoot: !1 });
577
- let o = 0.15;
578
- const r = 0.4 / (n * 2);
579
- for (let a = 0; a < n; a++)
580
- i += r, e.push({ time: i, overshoot: o, isOvershoot: !0 }), i += r, e.push({ time: i, overshoot: o * t, isOvershoot: !1 }), o *= t;
581
- return e.push({ time: 1, overshoot: 0, isOvershoot: !1 }), e;
573
+ function Qt(o, t) {
574
+ const i = [];
575
+ let e = 0.6;
576
+ i.push({ time: e, overshoot: 0, isOvershoot: !1 });
577
+ let n = 0.15;
578
+ const r = 0.4 / (o * 2);
579
+ for (let s = 0; s < o; s++)
580
+ e += r, i.push({ time: e, overshoot: n, isOvershoot: !0 }), e += r, i.push({ time: e, overshoot: n * t, isOvershoot: !1 }), n *= t;
581
+ return i.push({ time: 1, overshoot: 0, isOvershoot: !1 }), i;
582
582
  }
583
- function te(n, t, e, i) {
584
- const { stiffness: o, damping: s, mass: r, oscillations: a } = i, h = e.x - t.x, c = e.y - t.y, u = Math.sqrt(o / r), l = s / (2 * Math.sqrt(o * r));
585
- let d;
583
+ function te(o, t, i, e) {
584
+ const { stiffness: n, damping: a, mass: r, oscillations: s } = e, h = i.x - t.x, c = i.y - t.y, d = Math.sqrt(n / r), l = a / (2 * Math.sqrt(n * r));
585
+ let u;
586
586
  if (l < 1) {
587
- const f = u * Math.sqrt(1 - l * l), b = Math.exp(-l * u * n * 3), p = Math.cos(f * n * a * Math.PI);
588
- d = 1 - b * p;
587
+ const g = d * Math.sqrt(1 - l * l), p = Math.exp(-l * d * o * 3), b = Math.cos(g * o * s * Math.PI);
588
+ u = 1 - p * b;
589
589
  } else
590
- d = 1 - Math.exp(-u * n * 3);
591
- return d = Math.max(0, Math.min(d, 1.3)), {
592
- x: t.x + h * d,
593
- y: t.y + c * d
590
+ u = 1 - Math.exp(-d * o * 3);
591
+ return u = Math.max(0, Math.min(u, 1.3)), {
592
+ x: t.x + h * u,
593
+ y: t.y + c * u
594
594
  };
595
595
  }
596
- function ee(n, t, e, i) {
597
- const { amplitude: o, frequency: s, decay: r, decayRate: a, phase: h } = i, c = e.x - t.x, u = e.y - t.y, l = Math.sqrt(c * c + u * u), d = l > 0 ? -u / l : 0, f = l > 0 ? c / l : 1, b = s * Math.PI * 2 * n + h, p = r ? Math.pow(1 - n, a) : 1, g = o * Math.sin(b) * p, m = ie(n);
596
+ function ee(o, t, i, e) {
597
+ const { amplitude: n, frequency: a, decay: r, decayRate: s, phase: h } = e, c = i.x - t.x, d = i.y - t.y, l = Math.sqrt(c * c + d * d), u = l > 0 ? -d / l : 0, g = l > 0 ? c / l : 1, p = a * Math.PI * 2 * o + h, b = r ? Math.pow(1 - o, s) : 1, f = n * Math.sin(p) * b, m = ie(o);
598
598
  return {
599
- x: V(t.x, e.x, m) + g * d,
600
- y: V(t.y, e.y, m) + g * f
599
+ x: V(t.x, i.x, m) + f * u,
600
+ y: V(t.y, i.y, m) + f * g
601
601
  };
602
602
  }
603
- function ot(n) {
604
- return 1 - (1 - n) * (1 - n);
603
+ function ot(o) {
604
+ return 1 - (1 - o) * (1 - o);
605
605
  }
606
- function ie(n) {
607
- return 1 - Math.pow(1 - n, 3);
606
+ function ie(o) {
607
+ return 1 - Math.pow(1 - o, 3);
608
608
  }
609
- function ne(n, t, e) {
610
- const { amplitude: i, frequency: o, decay: s } = e, r = Math.sin(n * o * Math.PI * 2), a = s ? Math.pow(1 - n, 2) : 1, h = i * r * a;
609
+ function oe(o, t, i) {
610
+ const { amplitude: e, frequency: n, decay: a } = i, r = Math.sin(o * n * Math.PI * 2), s = a ? Math.pow(1 - o, 2) : 1, h = e * r * s;
611
611
  return t + h;
612
612
  }
613
- function oe(n, t, e) {
614
- const { overshoot: i, bounces: o } = e, s = [];
615
- s.push({ time: 0.5, scale: i });
616
- let r = i;
617
- const a = 0.5, c = 0.5 / (o * 2);
618
- let u = 0.5;
619
- for (let d = 0; d < o; d++) {
620
- const f = 1 - (r - 1) * a;
621
- u += c, s.push({ time: u, scale: f }), r = 1 + (r - 1) * a * a, u += c, d < o - 1 && s.push({ time: u, scale: r });
622
- }
623
- s.push({ time: 1, scale: 1 });
613
+ function ne(o, t, i) {
614
+ const { overshoot: e, bounces: n } = i, a = [];
615
+ a.push({ time: 0.5, scale: e });
616
+ let r = e;
617
+ const s = 0.5, c = 0.5 / (n * 2);
618
+ let d = 0.5;
619
+ for (let u = 0; u < n; u++) {
620
+ const g = 1 - (r - 1) * s;
621
+ d += c, a.push({ time: d, scale: g }), r = 1 + (r - 1) * s * s, d += c, u < n - 1 && a.push({ time: d, scale: r });
622
+ }
623
+ a.push({ time: 1, scale: 1 });
624
624
  let l = 1;
625
- for (let d = 0; d < s.length; d++)
626
- if (n <= s[d].time) {
627
- const f = d === 0 ? 0 : s[d - 1].time, b = d === 0 ? 1 : s[d - 1].scale, p = (n - f) / (s[d].time - f), g = ot(p);
628
- l = b + (s[d].scale - b) * g;
625
+ for (let u = 0; u < a.length; u++)
626
+ if (o <= a[u].time) {
627
+ const g = u === 0 ? 0 : a[u - 1].time, p = u === 0 ? 1 : a[u - 1].scale, b = (o - g) / (a[u].time - g), f = ot(b);
628
+ l = p + (a[u].scale - p) * f;
629
629
  break;
630
630
  }
631
631
  return l * t;
632
632
  }
633
- function se(n) {
633
+ function se(o) {
634
634
  const {
635
635
  element: t,
636
- startPosition: e,
637
- endPosition: i,
638
- pathConfig: o,
639
- duration: s,
636
+ startPosition: i,
637
+ endPosition: e,
638
+ pathConfig: n,
639
+ duration: a,
640
640
  imageWidth: r,
641
- imageHeight: a,
641
+ imageHeight: s,
642
642
  rotation: h,
643
643
  scale: c,
644
- onComplete: u,
644
+ onComplete: d,
645
645
  rotationConfig: l,
646
- startRotation: d,
647
- scaleConfig: f,
648
- startScale: b
649
- } = n, p = o.type, g = d !== void 0 && d !== h, m = l?.mode === "wobble", S = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = g || m, w = b !== void 0 && b !== c, E = f?.mode === "pop", x = f?.pop || { overshoot: 1.2, bounces: 1 };
650
- if ((p === "linear" || p === "arc") && !v && !(w || E)) {
651
- u && u();
646
+ startRotation: u,
647
+ scaleConfig: g,
648
+ startScale: p
649
+ } = o, b = n.type, f = u !== void 0 && u !== h, m = l?.mode === "wobble", S = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = f || m, w = p !== void 0 && p !== c, E = g?.mode === "pop", x = g?.pop || { overshoot: 1.2, bounces: 1 };
650
+ if ((b === "linear" || b === "arc") && !v && !(w || E)) {
651
+ d && d();
652
652
  return;
653
653
  }
654
- const L = performance.now(), z = -r / 2, U = -a / 2;
655
- function _(Y) {
656
- const N = Y - L, T = Math.min(N / s, 1);
657
- let D;
658
- switch (p) {
654
+ const M = performance.now(), F = -r / 2, U = -s / 2;
655
+ function _(B) {
656
+ const j = B - M, T = Math.min(j / a, 1);
657
+ let O;
658
+ switch (b) {
659
659
  case "bounce": {
660
- const O = Bt(
661
- o.bouncePreset,
662
- o.bounce
660
+ const $ = Xt(
661
+ n.bouncePreset,
662
+ n.bounce
663
663
  );
664
- D = Zt(T, e, i, O);
664
+ O = Zt(T, i, e, $);
665
665
  break;
666
666
  }
667
667
  case "elastic": {
668
- const O = Jt(
669
- o.elasticPreset,
670
- o.elastic
668
+ const $ = Jt(
669
+ n.elasticPreset,
670
+ n.elastic
671
671
  );
672
- D = te(T, e, i, O);
672
+ O = te(T, i, e, $);
673
673
  break;
674
674
  }
675
675
  case "wave": {
676
- const O = Vt(
677
- o.wavePreset,
678
- o.wave
676
+ const $ = Vt(
677
+ n.wavePreset,
678
+ n.wave
679
679
  );
680
- D = ee(T, e, i, O);
680
+ O = ee(T, i, e, $);
681
681
  break;
682
682
  }
683
683
  default:
684
- D = {
685
- x: V(e.x, i.x, T),
686
- y: V(e.y, i.y, T)
684
+ O = {
685
+ x: V(i.x, e.x, T),
686
+ y: V(i.y, e.y, T)
687
687
  };
688
688
  }
689
- const k = D.x - i.x, H = D.y - i.y;
690
- let R;
691
- m ? R = ne(T, h, S) : g ? R = V(d, h, T) : R = h;
689
+ const W = O.x - e.x, H = O.y - e.y;
690
+ let A;
691
+ m ? A = oe(T, h, S) : f ? A = V(u, h, T) : A = h;
692
692
  let C;
693
- E ? C = oe(T, c, x) : w ? C = V(b, c, T) : C = c, t.style.transform = `translate(${z}px, ${U}px) translate(${k}px, ${H}px) rotate(${R}deg) scale(${C})`, T < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${U}px) rotate(${h}deg) scale(${c})`, u && u());
693
+ E ? C = ne(T, c, x) : w ? C = V(p, c, T) : C = c, t.style.transform = `translate(${F}px, ${U}px) translate(${W}px, ${H}px) rotate(${A}deg) scale(${C})`, T < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${F}px, ${U}px) rotate(${h}deg) scale(${c})`, d && d());
694
694
  }
695
695
  requestAnimationFrame(_);
696
696
  }
697
- function ae(n) {
698
- return n === "bounce" || n === "elastic" || n === "wave";
697
+ function ae(o) {
698
+ return o === "bounce" || o === "elastic" || o === "wave";
699
699
  }
700
700
  const re = {
701
701
  radial: "center",
@@ -706,8 +706,8 @@ const re = {
706
706
  wave: "left"
707
707
  };
708
708
  class ce {
709
- constructor(t, e) {
710
- this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || pt, this.rotationConfig = t.rotation || bt, this.scaleConfig = t.scale || yt;
709
+ constructor(t, i) {
710
+ this.config = t, this.layoutAlgorithm = i, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || bt, this.rotationConfig = t.rotation || yt, this.scaleConfig = t.scale || vt;
711
711
  }
712
712
  /**
713
713
  * Get the effective start position, considering layout-aware defaults
@@ -718,72 +718,72 @@ class ce {
718
718
  /**
719
719
  * Calculate the starting position for an image's entry animation
720
720
  */
721
- calculateStartPosition(t, e, i, o, s) {
722
- const r = this.resolvedStartPosition, a = this.config.start.offset ?? 100;
721
+ calculateStartPosition(t, i, e, n, a) {
722
+ const r = this.resolvedStartPosition, s = this.config.start.offset ?? 100;
723
723
  switch (r) {
724
724
  case "nearest-edge":
725
- return this.calculateNearestEdge(t, e, i, a);
725
+ return this.calculateNearestEdge(t, i, e, s);
726
726
  case "top":
727
- return this.calculateEdgePosition("top", t, e, i, a);
727
+ return this.calculateEdgePosition("top", t, i, e, s);
728
728
  case "bottom":
729
- return this.calculateEdgePosition("bottom", t, e, i, a);
729
+ return this.calculateEdgePosition("bottom", t, i, e, s);
730
730
  case "left":
731
- return this.calculateEdgePosition("left", t, e, i, a);
731
+ return this.calculateEdgePosition("left", t, i, e, s);
732
732
  case "right":
733
- return this.calculateEdgePosition("right", t, e, i, a);
733
+ return this.calculateEdgePosition("right", t, i, e, s);
734
734
  case "center":
735
- return this.calculateCenterPosition(i, t, e);
735
+ return this.calculateCenterPosition(e, t, i);
736
736
  case "random-edge":
737
- return this.calculateRandomEdge(t, e, i, a);
737
+ return this.calculateRandomEdge(t, i, e, s);
738
738
  case "circular":
739
739
  return this.calculateCircularPosition(
740
740
  t,
741
- e,
742
741
  i,
743
- o,
744
- s
742
+ e,
743
+ n,
744
+ a
745
745
  );
746
746
  default:
747
- return this.calculateNearestEdge(t, e, i, a);
747
+ return this.calculateNearestEdge(t, i, e, s);
748
748
  }
749
749
  }
750
750
  /**
751
751
  * Calculate start position from the nearest edge (current default behavior)
752
752
  */
753
- calculateNearestEdge(t, e, i, o) {
754
- const s = t.x, r = t.y, a = s, h = i.width - s, c = r, u = i.height - r, l = Math.min(a, h, c, u);
755
- let d = t.x, f = t.y;
756
- return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ? f = -(e.height + o) : f = i.height + o, { x: d, y: f };
753
+ calculateNearestEdge(t, i, e, n) {
754
+ const a = t.x, r = t.y, s = a, h = e.width - a, c = r, d = e.height - r, l = Math.min(s, h, c, d);
755
+ let u = t.x, g = t.y;
756
+ return l === s ? u = -(i.width + n) : l === h ? u = e.width + n : l === c ? g = -(i.height + n) : g = e.height + n, { x: u, y: g };
757
757
  }
758
758
  /**
759
759
  * Calculate start position from a specific edge
760
760
  */
761
- calculateEdgePosition(t, e, i, o, s) {
762
- let r = e.x, a = e.y;
761
+ calculateEdgePosition(t, i, e, n, a) {
762
+ let r = i.x, s = i.y;
763
763
  switch (t) {
764
764
  case "top":
765
- a = -(i.height + s);
765
+ s = -(e.height + a);
766
766
  break;
767
767
  case "bottom":
768
- a = o.height + s;
768
+ s = n.height + a;
769
769
  break;
770
770
  case "left":
771
- r = -(i.width + s);
771
+ r = -(e.width + a);
772
772
  break;
773
773
  case "right":
774
- r = o.width + s;
774
+ r = n.width + a;
775
775
  break;
776
776
  }
777
- return { x: r, y: a };
777
+ return { x: r, y: s };
778
778
  }
779
779
  /**
780
780
  * Calculate start position from center with scale animation
781
781
  */
782
- calculateCenterPosition(t, e, i) {
783
- const o = t.width / 2, s = t.height / 2;
782
+ calculateCenterPosition(t, i, e) {
783
+ const n = t.width / 2, a = t.height / 2;
784
784
  return {
785
- x: o,
786
- y: s,
785
+ x: n,
786
+ y: a,
787
787
  useScale: !0
788
788
  // Signal to use scale animation from 0
789
789
  };
@@ -791,68 +791,68 @@ class ce {
791
791
  /**
792
792
  * Calculate start position from a random edge
793
793
  */
794
- calculateRandomEdge(t, e, i, o) {
795
- const s = ["top", "bottom", "left", "right"], r = s[Math.floor(Math.random() * s.length)];
796
- return this.calculateEdgePosition(r, t, e, i, o);
794
+ calculateRandomEdge(t, i, e, n) {
795
+ const a = ["top", "bottom", "left", "right"], r = a[Math.floor(Math.random() * a.length)];
796
+ return this.calculateEdgePosition(r, t, i, e, n);
797
797
  }
798
798
  /**
799
799
  * Calculate start position on a circle around the container
800
800
  */
801
- calculateCircularPosition(t, e, i, o, s) {
802
- const r = this.config.start.circular || {}, a = r.distribution || "even";
801
+ calculateCircularPosition(t, i, e, n, a) {
802
+ const r = this.config.start.circular || {}, s = r.distribution || "even";
803
803
  let h;
804
804
  const c = r.radius || "120%";
805
805
  if (typeof c == "string" && c.endsWith("%")) {
806
- const p = parseFloat(c) / 100;
806
+ const b = parseFloat(c) / 100;
807
807
  h = Math.sqrt(
808
- i.width ** 2 + i.height ** 2
809
- ) * p / 2;
808
+ e.width ** 2 + e.height ** 2
809
+ ) * b / 2;
810
810
  } else
811
811
  h = typeof c == "number" ? c : 500;
812
- let u;
813
- a === "even" ? u = o / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
814
- const l = i.width / 2, d = i.height / 2, f = l + Math.cos(u) * h, b = d + Math.sin(u) * h;
815
- return { x: f, y: b };
812
+ let d;
813
+ s === "even" ? d = n / a * 2 * Math.PI : d = Math.random() * 2 * Math.PI;
814
+ const l = e.width / 2, u = e.height / 2, g = l + Math.cos(d) * h, p = u + Math.sin(d) * h;
815
+ return { x: g, y: p };
816
816
  }
817
817
  /**
818
818
  * Get animation parameters for an image
819
819
  */
820
820
  getAnimationParams(t) {
821
- const e = this.config.timing.duration, i = this.config.easing;
821
+ const i = this.config.timing.duration, e = this.config.easing;
822
822
  return {
823
823
  startTransform: "",
824
824
  // Will be computed by caller based on start position
825
- duration: e,
825
+ duration: i,
826
826
  delay: 0,
827
- easing: i
827
+ easing: e
828
828
  };
829
829
  }
830
830
  /**
831
831
  * Build a CSS transform string for the start position
832
832
  * Uses pixel-based centering offset for reliable cross-browser behavior
833
833
  */
834
- buildStartTransform(t, e, i, o, s, r, a, h) {
835
- const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o, f = s !== void 0 ? -s / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = s !== void 0 ? `translate(${f}px, ${b}px)` : "translate(-50%, -50%)";
836
- return t.useScale ? `${p} translate(${c}px, ${u}px) rotate(${l}deg) scale(0)` : `${p} translate(${c}px, ${u}px) rotate(${l}deg) scale(${d})`;
834
+ buildStartTransform(t, i, e, n, a, r, s, h) {
835
+ const c = t.x - i.x, d = t.y - i.y, l = s !== void 0 ? s : e, u = h !== void 0 ? h : n, g = a !== void 0 ? -a / 2 : 0, p = r !== void 0 ? -r / 2 : 0, b = a !== void 0 ? `translate(${g}px, ${p}px)` : "translate(-50%, -50%)";
836
+ return t.useScale ? `${b} translate(${c}px, ${d}px) rotate(${l}deg) scale(0)` : `${b} translate(${c}px, ${d}px) rotate(${l}deg) scale(${u})`;
837
837
  }
838
838
  /**
839
839
  * Build the final CSS transform string
840
840
  * Uses pixel-based centering offset for reliable cross-browser behavior
841
841
  */
842
- buildFinalTransform(t, e, i, o) {
843
- if (i !== void 0 && o !== void 0) {
844
- const s = -i / 2, r = -o / 2;
845
- return `translate(${s}px, ${r}px) rotate(${t}deg) scale(${e})`;
842
+ buildFinalTransform(t, i, e, n) {
843
+ if (e !== void 0 && n !== void 0) {
844
+ const a = -e / 2, r = -n / 2;
845
+ return `translate(${a}px, ${r}px) rotate(${t}deg) scale(${i})`;
846
846
  }
847
- return `translate(-50%, -50%) rotate(${t}deg) scale(${e})`;
847
+ return `translate(-50%, -50%) rotate(${t}deg) scale(${i})`;
848
848
  }
849
849
  /**
850
850
  * Get the transition CSS for entry animation
851
851
  * For JS-animated paths, only animate opacity (transform handled by JS)
852
852
  */
853
853
  getTransitionCSS() {
854
- const t = this.config.timing.duration, e = this.config.easing;
855
- return this.requiresJSAnimation() ? `opacity ${t}ms ease-out` : `opacity ${t}ms ease-out, transform ${t}ms ${e}`;
854
+ const t = this.config.timing.duration, i = this.config.easing;
855
+ return this.requiresJSAnimation() ? `opacity ${t}ms ease-out` : `opacity ${t}ms ease-out, transform ${t}ms ${i}`;
856
856
  }
857
857
  /**
858
858
  * Check if the current path type requires JavaScript animation
@@ -902,17 +902,17 @@ class ce {
902
902
  case "none":
903
903
  return t;
904
904
  case "settle": {
905
- const i = this.rotationConfig.startRotation;
906
- if (i === void 0)
905
+ const e = this.rotationConfig.startRotation;
906
+ if (e === void 0)
907
907
  return t + (Math.random() - 0.5) * 60;
908
- if (typeof i == "number")
909
- return i;
910
- const o = i.max - i.min;
911
- return i.min + Math.random() * o;
908
+ if (typeof e == "number")
909
+ return e;
910
+ const n = e.max - e.min;
911
+ return e.min + Math.random() * n;
912
912
  }
913
913
  case "spin": {
914
- const i = this.rotationConfig.spinCount ?? 1, o = this.resolveSpinDirection(t);
915
- return t + i * 360 * o;
914
+ const e = this.rotationConfig.spinCount ?? 1, n = this.resolveSpinDirection(t);
915
+ return t + e * 360 * n;
916
916
  }
917
917
  case "random":
918
918
  return t + (Math.random() - 0.5) * 60;
@@ -953,15 +953,15 @@ class ce {
953
953
  * @param finalRotation - The final rotation in degrees
954
954
  * @returns The current rotation in degrees
955
955
  */
956
- calculateWobbleRotation(t, e) {
956
+ calculateWobbleRotation(t, i) {
957
957
  if (this.rotationConfig.mode !== "wobble")
958
- return e;
959
- const i = this.rotationConfig.wobble || {
958
+ return i;
959
+ const e = this.rotationConfig.wobble || {
960
960
  amplitude: 15,
961
961
  frequency: 3,
962
962
  decay: !0
963
- }, { amplitude: o, frequency: s, decay: r } = i, a = Math.sin(t * s * Math.PI * 2), h = r ? Math.pow(1 - t, 2) : 1, c = o * a * h;
964
- return e + c;
963
+ }, { amplitude: n, frequency: a, decay: r } = e, s = Math.sin(t * a * Math.PI * 2), h = r ? Math.pow(1 - t, 2) : 1, c = n * s * h;
964
+ return i + c;
965
965
  }
966
966
  /**
967
967
  * Get the scale configuration
@@ -991,8 +991,8 @@ class ce {
991
991
  case "pop":
992
992
  return t;
993
993
  case "random": {
994
- const i = this.scaleConfig.range ?? { min: 0.5, max: 1 };
995
- return (i.min + Math.random() * (i.max - i.min)) * t;
994
+ const e = this.scaleConfig.range ?? { min: 0.5, max: 1 };
995
+ return (e.min + Math.random() * (e.max - e.min)) * t;
996
996
  }
997
997
  default:
998
998
  return t;
@@ -1011,36 +1011,36 @@ class ce {
1011
1011
  * @param finalScale - The final scale value
1012
1012
  * @returns The current scale value with bounce effect
1013
1013
  */
1014
- calculatePopScale(t, e) {
1014
+ calculatePopScale(t, i) {
1015
1015
  if (this.scaleConfig.mode !== "pop")
1016
- return e;
1017
- const i = this.scaleConfig.pop || {
1016
+ return i;
1017
+ const e = this.scaleConfig.pop || {
1018
1018
  overshoot: 1.2,
1019
1019
  bounces: 1
1020
- }, { overshoot: o, bounces: s } = i, r = this.generateScaleBounceKeyframes(s, o);
1021
- let a = e;
1020
+ }, { overshoot: n, bounces: a } = e, r = this.generateScaleBounceKeyframes(a, n);
1021
+ let s = i;
1022
1022
  for (let h = 0; h < r.length; h++)
1023
1023
  if (t <= r[h].time) {
1024
- const c = h === 0 ? 0 : r[h - 1].time, u = h === 0 ? e : r[h - 1].scale, l = (t - c) / (r[h].time - c), d = this.easeOutQuad(l);
1025
- a = u + (r[h].scale - u) * d;
1024
+ const c = h === 0 ? 0 : r[h - 1].time, d = h === 0 ? i : r[h - 1].scale, l = (t - c) / (r[h].time - c), u = this.easeOutQuad(l);
1025
+ s = d + (r[h].scale - d) * u;
1026
1026
  break;
1027
1027
  }
1028
- return a * e;
1028
+ return s * i;
1029
1029
  }
1030
1030
  /**
1031
1031
  * Generate keyframes for scale bounce animation
1032
1032
  */
1033
- generateScaleBounceKeyframes(t, e) {
1034
- const i = [];
1035
- i.push({ time: 0.5, scale: e });
1036
- let o = e;
1037
- const s = 0.5, a = 0.5 / (t * 2);
1033
+ generateScaleBounceKeyframes(t, i) {
1034
+ const e = [];
1035
+ e.push({ time: 0.5, scale: i });
1036
+ let n = i;
1037
+ const a = 0.5, s = 0.5 / (t * 2);
1038
1038
  let h = 0.5;
1039
1039
  for (let c = 0; c < t; c++) {
1040
- const u = 1 - (o - 1) * s;
1041
- h += a, i.push({ time: h, scale: u }), o = 1 + (o - 1) * s * s, h += a, c < t - 1 && i.push({ time: h, scale: o });
1040
+ const d = 1 - (n - 1) * a;
1041
+ h += s, e.push({ time: h, scale: d }), n = 1 + (n - 1) * a * a, h += s, c < t - 1 && e.push({ time: h, scale: n });
1042
1042
  }
1043
- return i.push({ time: 1, scale: 1 }), i;
1043
+ return e.push({ time: 1, scale: 1 }), e;
1044
1044
  }
1045
1045
  /**
1046
1046
  * Easing function for smooth transitions
@@ -1050,8 +1050,8 @@ class ce {
1050
1050
  }
1051
1051
  }
1052
1052
  class le {
1053
- constructor(t, e = {}) {
1054
- this.config = t, this.imageConfig = e;
1053
+ constructor(t, i = {}) {
1054
+ this.config = t, this.imageConfig = i;
1055
1055
  }
1056
1056
  /**
1057
1057
  * Generate random layout positions for images
@@ -1060,20 +1060,20 @@ class le {
1060
1060
  * @param options - Optional overrides (includes fixedHeight)
1061
1061
  * @returns Array of layout objects with position, rotation, scale
1062
1062
  */
1063
- generate(t, e, i = {}) {
1064
- const o = [], { width: s, height: r } = e, a = this.config.spacing.padding, h = i.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, g = h * 1.5 / 2, m = h / 2, S = s - a - g, v = r - a - m, w = a + g, E = a + m;
1063
+ generate(t, i, e = {}) {
1064
+ const n = [], { width: a, height: r } = i, s = this.config.spacing.padding, h = e.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", d = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, u = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, p = u !== 1 || g !== 1, f = h * 1.5 / 2, m = h / 2, S = a - s - f, v = r - s - m, w = s + f, E = s + m;
1065
1065
  for (let x = 0; x < t; x++) {
1066
- const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0, U = b ? this.random(d, f) : 1, _ = h * U, Y = {
1066
+ const I = this.random(w, S), M = this.random(E, v), F = c === "random" ? this.random(d, l) : 0, U = p ? this.random(u, g) : 1, _ = h * U, B = {
1067
1067
  id: x,
1068
- x: A,
1069
- y: L,
1070
- rotation: z,
1068
+ x: I,
1069
+ y: M,
1070
+ rotation: F,
1071
1071
  scale: U,
1072
1072
  baseSize: _
1073
1073
  };
1074
- o.push(Y);
1074
+ n.push(B);
1075
1075
  }
1076
- return o;
1076
+ return n;
1077
1077
  }
1078
1078
  /**
1079
1079
  * Utility: Generate random number between min and max
@@ -1081,13 +1081,13 @@ class le {
1081
1081
  * @param max - Maximum value
1082
1082
  * @returns Random number in range
1083
1083
  */
1084
- random(t, e) {
1085
- return Math.random() * (e - t) + t;
1084
+ random(t, i) {
1085
+ return Math.random() * (i - t) + t;
1086
1086
  }
1087
1087
  }
1088
1088
  class he {
1089
- constructor(t, e = {}) {
1090
- this.config = t, this.imageConfig = e;
1089
+ constructor(t, i = {}) {
1090
+ this.config = t, this.imageConfig = i;
1091
1091
  }
1092
1092
  /**
1093
1093
  * Generate radial layout positions for images
@@ -1096,15 +1096,15 @@ class he {
1096
1096
  * @param options - Optional overrides
1097
1097
  * @returns Array of layout objects with position, rotation, scale
1098
1098
  */
1099
- generate(t, e, i = {}) {
1100
- const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = l !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = i.fixedHeight ?? a, g = s / 2, m = r / 2, S = Math.ceil(Math.sqrt(t));
1099
+ generate(t, i, e = {}) {
1100
+ const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, h = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, l = this.imageConfig.sizing?.variance?.min ?? 1, u = this.imageConfig.sizing?.variance?.max ?? 1, g = l !== 1 || u !== 1, p = this.config.scaleDecay ?? 0, b = e.fixedHeight ?? s, f = a / 2, m = r / 2, S = Math.ceil(Math.sqrt(t));
1101
1101
  if (t > 0) {
1102
- const E = f ? this.random(l, d) : 1, x = p * E;
1103
- o.push({
1102
+ const E = g ? this.random(l, u) : 1, x = b * E;
1103
+ n.push({
1104
1104
  id: 0,
1105
- x: g,
1105
+ x: f,
1106
1106
  y: m,
1107
- rotation: h === "random" ? this.random(c * 0.33, u * 0.33) : 0,
1107
+ rotation: h === "random" ? this.random(c * 0.33, d * 0.33) : 0,
1108
1108
  // Less rotation for center
1109
1109
  scale: E,
1110
1110
  baseSize: x,
@@ -1114,32 +1114,32 @@ class he {
1114
1114
  }
1115
1115
  let v = 1, w = 1;
1116
1116
  for (; v < t; ) {
1117
- const E = w / S, x = b > 0 ? 1 - E * b * 0.5 : 1, A = w * (p * 0.8), L = A * 1.5, z = Math.PI * (3 * (L + A) - Math.sqrt((3 * L + A) * (L + 3 * A))), U = this.estimateWidth(p), _ = Math.floor(z / (U * 0.7));
1117
+ const E = w / S, x = p > 0 ? 1 - E * p * 0.5 : 1, I = w * (b * 0.8), M = I * 1.5, F = Math.PI * (3 * (M + I) - Math.sqrt((3 * M + I) * (M + 3 * I))), U = this.estimateWidth(b), _ = Math.floor(F / (U * 0.7));
1118
1118
  if (_ === 0) {
1119
1119
  w++;
1120
1120
  continue;
1121
1121
  }
1122
- const Y = 2 * Math.PI / _, N = w * (20 * Math.PI / 180);
1122
+ const B = 2 * Math.PI / _, j = w * (20 * Math.PI / 180);
1123
1123
  for (let T = 0; T < _ && v < t; T++) {
1124
- const D = T * Y + N, k = f ? this.random(l, d) : 1, H = x * k, R = p * H;
1125
- let C = g + Math.cos(D) * L, O = m + Math.sin(D) * A;
1126
- const $ = this.config.spacing.padding ?? 50, P = R * 1.5 / 2, M = R / 2;
1127
- C - P < $ ? C = $ + P : C + P > s - $ && (C = s - $ - P), O - M < $ ? O = $ + M : O + M > r - $ && (O = r - $ - M);
1128
- const W = h === "random" ? this.random(c, u) : 0;
1129
- o.push({
1124
+ const O = T * B + j, W = g ? this.random(l, u) : 1, H = x * W, A = b * H;
1125
+ let C = f + Math.cos(O) * M, $ = m + Math.sin(O) * I;
1126
+ const D = this.config.spacing.padding ?? 50, P = A * 1.5 / 2, L = A / 2;
1127
+ C - P < D ? C = D + P : C + P > a - D && (C = a - D - P), $ - L < D ? $ = D + L : $ + L > r - D && ($ = r - D - L);
1128
+ const k = h === "random" ? this.random(c, d) : 0;
1129
+ n.push({
1130
1130
  id: v,
1131
1131
  x: C,
1132
- y: O,
1133
- rotation: W,
1132
+ y: $,
1133
+ rotation: k,
1134
1134
  scale: H,
1135
- baseSize: R,
1135
+ baseSize: A,
1136
1136
  zIndex: Math.max(1, 100 - w)
1137
1137
  // Outer rings have lower z-index
1138
1138
  }), v++;
1139
1139
  }
1140
1140
  w++;
1141
1141
  }
1142
- return o;
1142
+ return n;
1143
1143
  }
1144
1144
  /**
1145
1145
  * Estimate image width based on height
@@ -1156,8 +1156,8 @@ class he {
1156
1156
  * @param max - Maximum value
1157
1157
  * @returns Random number in range
1158
1158
  */
1159
- random(t, e) {
1160
- return Math.random() * (e - t) + t;
1159
+ random(t, i) {
1160
+ return Math.random() * (i - t) + t;
1161
1161
  }
1162
1162
  }
1163
1163
  const de = {
@@ -1189,8 +1189,8 @@ const de = {
1189
1189
  // down
1190
1190
  ];
1191
1191
  class ue {
1192
- constructor(t, e = {}) {
1193
- this.config = t, this.imageConfig = e;
1192
+ constructor(t, i = {}) {
1193
+ this.config = t, this.imageConfig = i;
1194
1194
  }
1195
1195
  /**
1196
1196
  * Generate grid layout positions for images
@@ -1199,93 +1199,93 @@ class ue {
1199
1199
  * @param options - Optional overrides (includes fixedHeight)
1200
1200
  * @returns Array of layout objects with position, rotation, scale
1201
1201
  */
1202
- generate(t, e, i = {}) {
1203
- const o = [], { width: s, height: r } = e, a = { ...de, ...this.config.grid }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = l !== 1 || d !== 1, b = s - 2 * h, p = r - 2 * h, { columns: g, rows: m } = this.calculateGridDimensions(
1202
+ generate(t, i, e = {}) {
1203
+ const n = [], { width: a, height: r } = i, s = { ...de, ...this.config.grid }, h = this.config.spacing.padding, c = e.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.sizing?.variance?.min ?? 1, u = this.imageConfig.sizing?.variance?.max ?? 1, g = l !== 1 || u !== 1, p = a - 2 * h, b = r - 2 * h, { columns: f, rows: m } = this.calculateGridDimensions(
1204
1204
  t,
1205
- b,
1206
1205
  p,
1206
+ b,
1207
1207
  c,
1208
- a
1209
- ), S = a.stagger === "row", v = a.stagger === "column", w = S ? g + 0.5 : g, E = v ? m + 0.5 : m, x = (b - a.gap * (g - 1)) / w, A = (p - a.gap * (m - 1)) / E, L = S ? x / 2 : 0, z = v ? A / 2 : 0, U = 1 + a.overlap, _ = Math.min(x, A) * U, Y = i.fixedHeight ? Math.min(i.fixedHeight, _) : _, N = g * x + (g - 1) * a.gap + L, T = m * A + (m - 1) * a.gap + z, D = h + (b - N) / 2, k = h + (p - T) / 2, H = g * m, R = a.columns !== "auto" && a.rows !== "auto", C = R && t > H;
1208
+ s
1209
+ ), S = s.stagger === "row", v = s.stagger === "column", w = S ? f + 0.5 : f, E = v ? m + 0.5 : m, x = (p - s.gap * (f - 1)) / w, I = (b - s.gap * (m - 1)) / E, M = S ? x / 2 : 0, F = v ? I / 2 : 0, U = 1 + s.overlap, _ = Math.min(x, I) * U, B = e.fixedHeight ? Math.min(e.fixedHeight, _) : _, j = f * x + (f - 1) * s.gap + M, T = m * I + (m - 1) * s.gap + F, O = h + (p - j) / 2, W = h + (b - T) / 2, H = f * m, A = s.columns !== "auto" && s.rows !== "auto", C = A && t > H;
1210
1210
  typeof window < "u" && (window.__gridOverflowDebug = {
1211
- gridConfigColumns: a.columns,
1212
- gridConfigRows: a.rows,
1213
- columns: g,
1211
+ gridConfigColumns: s.columns,
1212
+ gridConfigRows: s.rows,
1213
+ columns: f,
1214
1214
  rows: m,
1215
1215
  cellCount: H,
1216
- hasFixedGrid: R,
1216
+ hasFixedGrid: A,
1217
1217
  imageCount: t,
1218
1218
  isOverflowMode: C
1219
1219
  });
1220
- const O = C ? new Array(H).fill(0) : [], $ = Math.min(x, A) * a.overflowOffset;
1221
- for (let F = 0; F < t; F++) {
1222
- let P, M, W = 0;
1223
- if (C && F >= H) {
1224
- const q = F - H, j = q % H;
1225
- W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (P = j % g, M = Math.floor(j / g)) : (M = j % m, P = Math.floor(j / m));
1220
+ const $ = C ? new Array(H).fill(0) : [], D = Math.min(x, I) * s.overflowOffset;
1221
+ for (let z = 0; z < t; z++) {
1222
+ let P, L, k = 0;
1223
+ if (C && z >= H) {
1224
+ const q = z - H, N = q % H;
1225
+ k = Math.floor(q / H) + 1, $[N]++, s.fillDirection === "row" ? (P = N % f, L = Math.floor(N / f)) : (L = N % m, P = Math.floor(N / m));
1226
1226
  } else
1227
- a.fillDirection === "row" ? (P = F % g, M = Math.floor(F / g)) : (M = F % m, P = Math.floor(F / m));
1228
- let G = D + P * (x + a.gap) + x / 2, X = k + M * (A + a.gap) + A / 2;
1229
- if (a.stagger === "row" && M % 2 === 1 ? G += x / 2 : a.stagger === "column" && P % 2 === 1 && (X += A / 2), W > 0) {
1230
- const q = (W - 1) % It.length, j = It[q];
1231
- G += j.x * $, X += j.y * $;
1227
+ s.fillDirection === "row" ? (P = z % f, L = Math.floor(z / f)) : (L = z % m, P = Math.floor(z / m));
1228
+ let G = O + P * (x + s.gap) + x / 2, Y = W + L * (I + s.gap) + I / 2;
1229
+ if (s.stagger === "row" && L % 2 === 1 ? G += x / 2 : s.stagger === "column" && P % 2 === 1 && (Y += I / 2), k > 0) {
1230
+ const q = (k - 1) % It.length, N = It[q];
1231
+ G += N.x * D, Y += N.y * D;
1232
1232
  }
1233
- if (a.jitter > 0) {
1234
- const q = x / 2 * a.jitter, j = A / 2 * a.jitter;
1235
- G += this.random(-q, q), X += this.random(-j, j);
1233
+ if (s.jitter > 0) {
1234
+ const q = x / 2 * s.jitter, N = I / 2 * s.jitter;
1235
+ G += this.random(-q, q), Y += this.random(-N, N);
1236
1236
  }
1237
- let B = G, J = X;
1238
- if (!C && a.fillDirection === "row") {
1239
- const q = t % g || g;
1240
- if (M === Math.floor((t - 1) / g) && q < g) {
1241
- const vt = q * x + (q - 1) * a.gap;
1242
- let gt = 0;
1243
- a.alignment === "center" ? gt = (N - vt) / 2 : a.alignment === "end" && (gt = N - vt), B += gt;
1237
+ let X = G, J = Y;
1238
+ if (!C && s.fillDirection === "row") {
1239
+ const q = t % f || f;
1240
+ if (L === Math.floor((t - 1) / f) && q < f) {
1241
+ const wt = q * x + (q - 1) * s.gap;
1242
+ let ut = 0;
1243
+ s.alignment === "center" ? ut = (j - wt) / 2 : s.alignment === "end" && (ut = j - wt), X += ut;
1244
1244
  }
1245
1245
  }
1246
- const rt = f ? this.random(l, d) : 1, K = Y * rt, it = K * 1.5 / 2, nt = K / 2, lt = h + it, ht = s - h - it, Dt = h + nt, Ot = r - h - nt;
1247
- B = Math.max(lt, Math.min(B, ht)), J = Math.max(Dt, Math.min(J, Ot));
1248
- let dt = 0;
1249
- if (u === "random") {
1250
- const q = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
1251
- a.jitter > 0 ? dt = this.random(q * a.jitter, j * a.jitter) : dt = this.random(q, j);
1246
+ const at = g ? this.random(l, u) : 1, K = B * at, et = K * 1.5 / 2, it = K / 2, ct = h + et, lt = a - h - et, Ot = h + it, $t = r - h - it;
1247
+ X = Math.max(ct, Math.min(X, lt)), J = Math.max(Ot, Math.min(J, $t));
1248
+ let ht = 0;
1249
+ if (d === "random") {
1250
+ const q = this.imageConfig.rotation?.range?.min ?? -15, N = this.imageConfig.rotation?.range?.max ?? 15;
1251
+ s.jitter > 0 ? ht = this.random(q * s.jitter, N * s.jitter) : ht = this.random(q, N);
1252
1252
  }
1253
- let ut;
1254
- C && W > 0 ? ut = 50 - W : ut = C ? 100 + F : F + 1, o.push({
1255
- id: F,
1256
- x: B,
1253
+ let dt;
1254
+ C && k > 0 ? dt = 50 - k : dt = C ? 100 + z : z + 1, n.push({
1255
+ id: z,
1256
+ x: X,
1257
1257
  y: J,
1258
- rotation: dt,
1259
- scale: rt,
1258
+ rotation: ht,
1259
+ scale: at,
1260
1260
  baseSize: K,
1261
- zIndex: ut
1261
+ zIndex: dt
1262
1262
  });
1263
1263
  }
1264
- return o;
1264
+ return n;
1265
1265
  }
1266
1266
  /**
1267
1267
  * Calculate optimal grid dimensions based on image count and container
1268
1268
  */
1269
- calculateGridDimensions(t, e, i, o, s) {
1270
- let r, a;
1271
- if (s.columns !== "auto" && s.rows !== "auto")
1272
- r = s.columns, a = s.rows;
1273
- else if (s.columns !== "auto")
1274
- r = s.columns, a = Math.ceil(t / r);
1275
- else if (s.rows !== "auto")
1276
- a = s.rows, r = Math.ceil(t / a);
1269
+ calculateGridDimensions(t, i, e, n, a) {
1270
+ let r, s;
1271
+ if (a.columns !== "auto" && a.rows !== "auto")
1272
+ r = a.columns, s = a.rows;
1273
+ else if (a.columns !== "auto")
1274
+ r = a.columns, s = Math.ceil(t / r);
1275
+ else if (a.rows !== "auto")
1276
+ s = a.rows, r = Math.ceil(t / s);
1277
1277
  else {
1278
- const h = e / i;
1279
- for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), a = Math.ceil(t / r); r > 1 && (r - 1) * a >= t; )
1278
+ const h = i / e;
1279
+ for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), s = Math.ceil(t / r); r > 1 && (r - 1) * s >= t; )
1280
1280
  r--;
1281
1281
  }
1282
- return { columns: Math.max(1, r), rows: Math.max(1, a) };
1282
+ return { columns: Math.max(1, r), rows: Math.max(1, s) };
1283
1283
  }
1284
1284
  /**
1285
1285
  * Utility: Generate random number between min and max
1286
1286
  */
1287
- random(t, e) {
1288
- return Math.random() * (e - t) + t;
1287
+ random(t, i) {
1288
+ return Math.random() * (i - t) + t;
1289
1289
  }
1290
1290
  }
1291
1291
  const ge = Math.PI * (3 - Math.sqrt(5)), fe = {
@@ -1296,8 +1296,8 @@ const ge = Math.PI * (3 - Math.sqrt(5)), fe = {
1296
1296
  startAngle: 0
1297
1297
  };
1298
1298
  class me {
1299
- constructor(t, e = {}) {
1300
- this.config = t, this.imageConfig = e;
1299
+ constructor(t, i = {}) {
1300
+ this.config = t, this.imageConfig = i;
1301
1301
  }
1302
1302
  /**
1303
1303
  * Generate spiral layout positions for images
@@ -1306,87 +1306,87 @@ class me {
1306
1306
  * @param options - Optional overrides (includes fixedHeight)
1307
1307
  * @returns Array of layout objects with position, rotation, scale
1308
1308
  */
1309
- generate(t, e, i = {}) {
1310
- const o = [], { width: s, height: r } = e, a = { ...fe, ...this.config.spiral }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.config.scaleDecay ?? a.scaleDecay, m = s / 2, S = r / 2, v = Math.min(
1309
+ generate(t, i, e = {}) {
1310
+ const n = [], { width: a, height: r } = i, s = { ...fe, ...this.config.spiral }, h = this.config.spacing.padding, c = e.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, b = g !== 1 || p !== 1, f = this.config.scaleDecay ?? s.scaleDecay, m = a / 2, S = r / 2, v = Math.min(
1311
1311
  m - h - c / 2,
1312
1312
  S - h - c / 2
1313
- ), w = a.direction === "clockwise" ? -1 : 1;
1313
+ ), w = s.direction === "clockwise" ? -1 : 1;
1314
1314
  for (let E = 0; E < t; E++) {
1315
- let x, A;
1316
- if (a.spiralType === "golden")
1317
- x = E * ge * w + a.startAngle, A = this.calculateGoldenRadius(E, t, v, a.tightness);
1318
- else if (a.spiralType === "archimedean") {
1319
- const G = E * 0.5 * a.tightness;
1320
- x = G * w + a.startAngle, A = this.calculateArchimedeanRadius(G, t, v, a.tightness);
1315
+ let x, I;
1316
+ if (s.spiralType === "golden")
1317
+ x = E * ge * w + s.startAngle, I = this.calculateGoldenRadius(E, t, v, s.tightness);
1318
+ else if (s.spiralType === "archimedean") {
1319
+ const G = E * 0.5 * s.tightness;
1320
+ x = G * w + s.startAngle, I = this.calculateArchimedeanRadius(G, t, v, s.tightness);
1321
1321
  } else {
1322
- const G = E * 0.3 * a.tightness;
1323
- x = G * w + a.startAngle, A = this.calculateLogarithmicRadius(G, t, v, a.tightness);
1322
+ const G = E * 0.3 * s.tightness;
1323
+ x = G * w + s.startAngle, I = this.calculateLogarithmicRadius(G, t, v, s.tightness);
1324
1324
  }
1325
- const L = m + Math.cos(x) * A, z = S + Math.sin(x) * A, U = A / v, _ = g > 0 ? 1 - U * g * 0.5 : 1, Y = p ? this.random(f, b) : 1, N = _ * Y, T = c * N, k = T * 1.5 / 2, H = T / 2, R = h + k, C = s - h - k, O = h + H, $ = r - h - H, F = Math.max(R, Math.min(L, C)), P = Math.max(O, Math.min(z, $));
1326
- let M = 0;
1327
- if (u === "random") {
1328
- const G = x * 180 / Math.PI % 360, X = this.random(l, d);
1329
- M = a.spiralType === "golden" ? X : G * 0.1 + X * 0.9;
1330
- } else u === "tangent" && (M = this.calculateSpiralTangent(x, A, a));
1331
- const W = t - E;
1332
- o.push({
1325
+ const M = m + Math.cos(x) * I, F = S + Math.sin(x) * I, U = I / v, _ = f > 0 ? 1 - U * f * 0.5 : 1, B = b ? this.random(g, p) : 1, j = _ * B, T = c * j, W = T * 1.5 / 2, H = T / 2, A = h + W, C = a - h - W, $ = h + H, D = r - h - H, z = Math.max(A, Math.min(M, C)), P = Math.max($, Math.min(F, D));
1326
+ let L = 0;
1327
+ if (d === "random") {
1328
+ const G = x * 180 / Math.PI % 360, Y = this.random(l, u);
1329
+ L = s.spiralType === "golden" ? Y : G * 0.1 + Y * 0.9;
1330
+ } else d === "tangent" && (L = this.calculateSpiralTangent(x, I, s));
1331
+ const k = t - E;
1332
+ n.push({
1333
1333
  id: E,
1334
- x: F,
1334
+ x: z,
1335
1335
  y: P,
1336
- rotation: M,
1337
- scale: N,
1336
+ rotation: L,
1337
+ scale: j,
1338
1338
  baseSize: T,
1339
- zIndex: W
1339
+ zIndex: k
1340
1340
  });
1341
1341
  }
1342
- return o;
1342
+ return n;
1343
1343
  }
1344
1344
  /**
1345
1345
  * Calculate tangent angle for spiral curve at given position
1346
1346
  * This aligns the image along the spiral's direction of travel
1347
1347
  */
1348
- calculateSpiralTangent(t, e, i) {
1349
- let o;
1350
- if (i.spiralType === "golden")
1351
- o = t + Math.PI / 2;
1352
- else if (i.spiralType === "archimedean") {
1353
- const r = 1 / i.tightness, a = Math.atan(e / r);
1354
- o = t + a;
1348
+ calculateSpiralTangent(t, i, e) {
1349
+ let n;
1350
+ if (e.spiralType === "golden")
1351
+ n = t + Math.PI / 2;
1352
+ else if (e.spiralType === "archimedean") {
1353
+ const r = 1 / e.tightness, s = Math.atan(i / r);
1354
+ n = t + s;
1355
1355
  } else {
1356
- const r = 0.15 / i.tightness, a = Math.atan(1 / r);
1357
- o = t + a;
1356
+ const r = 0.15 / e.tightness, s = Math.atan(1 / r);
1357
+ n = t + s;
1358
1358
  }
1359
- return o * 180 / Math.PI % 360 - 90;
1359
+ return n * 180 / Math.PI % 360 - 90;
1360
1360
  }
1361
1361
  /**
1362
1362
  * Calculate radius for golden spiral (Vogel's model)
1363
1363
  * Creates even distribution like sunflower seeds
1364
1364
  */
1365
- calculateGoldenRadius(t, e, i, o) {
1366
- const r = i / Math.sqrt(e) * Math.sqrt(t) / o;
1367
- return Math.min(r, i);
1365
+ calculateGoldenRadius(t, i, e, n) {
1366
+ const r = e / Math.sqrt(i) * Math.sqrt(t) / n;
1367
+ return Math.min(r, e);
1368
1368
  }
1369
1369
  /**
1370
1370
  * Calculate radius for Archimedean spiral
1371
1371
  * r = a + b*θ (constant spacing between arms)
1372
1372
  */
1373
- calculateArchimedeanRadius(t, e, i, o) {
1374
- const s = e * 0.5 * o;
1375
- return t / s * i;
1373
+ calculateArchimedeanRadius(t, i, e, n) {
1374
+ const a = i * 0.5 * n;
1375
+ return t / a * e;
1376
1376
  }
1377
1377
  /**
1378
1378
  * Calculate radius for logarithmic (equiangular) spiral
1379
1379
  * r = a * e^(b*θ)
1380
1380
  */
1381
- calculateLogarithmicRadius(t, e, i, o) {
1382
- const s = i * 0.05, r = 0.15 / o, a = s * Math.exp(r * t), h = e * 0.3 * o, c = s * Math.exp(r * h);
1383
- return a / c * i;
1381
+ calculateLogarithmicRadius(t, i, e, n) {
1382
+ const a = e * 0.05, r = 0.15 / n, s = a * Math.exp(r * t), h = i * 0.3 * n, c = a * Math.exp(r * h);
1383
+ return s / c * e;
1384
1384
  }
1385
1385
  /**
1386
1386
  * Utility: Generate random number between min and max
1387
1387
  */
1388
- random(t, e) {
1389
- return Math.random() * (e - t) + t;
1388
+ random(t, i) {
1389
+ return Math.random() * (i - t) + t;
1390
1390
  }
1391
1391
  }
1392
1392
  const pe = {
@@ -1398,8 +1398,8 @@ const pe = {
1398
1398
  distribution: "gaussian"
1399
1399
  };
1400
1400
  class be {
1401
- constructor(t, e = {}) {
1402
- this.config = t, this.imageConfig = e;
1401
+ constructor(t, i = {}) {
1402
+ this.config = t, this.imageConfig = i;
1403
1403
  }
1404
1404
  /**
1405
1405
  * Generate cluster layout positions for images
@@ -1408,86 +1408,86 @@ class be {
1408
1408
  * @param options - Optional overrides (includes fixedHeight)
1409
1409
  * @returns Array of layout objects with position, rotation, scale
1410
1410
  */
1411
- generate(t, e, i = {}) {
1412
- const o = [], { width: s, height: r } = e, a = { ...pe, ...this.config.cluster }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.calculateClusterCount(
1411
+ generate(t, i, e = {}) {
1412
+ const n = [], { width: a, height: r } = i, s = { ...pe, ...this.config.cluster }, h = this.config.spacing.padding, c = e.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, b = g !== 1 || p !== 1, f = this.calculateClusterCount(
1413
1413
  t,
1414
- a.clusterCount,
1415
- s,
1414
+ s.clusterCount,
1415
+ a,
1416
1416
  r,
1417
- a.clusterSpacing
1417
+ s.clusterSpacing
1418
1418
  ), m = this.generateClusterCenters(
1419
- g,
1420
- s,
1419
+ f,
1420
+ a,
1421
1421
  r,
1422
1422
  h,
1423
- a
1424
- ), S = new Array(g).fill(0);
1423
+ s
1424
+ ), S = new Array(f).fill(0);
1425
1425
  for (let w = 0; w < t; w++)
1426
- S[w % g]++;
1426
+ S[w % f]++;
1427
1427
  let v = 0;
1428
- for (let w = 0; w < g; w++) {
1428
+ for (let w = 0; w < f; w++) {
1429
1429
  const E = m[w], x = S[w];
1430
- for (let A = 0; A < x; A++) {
1431
- let L, z;
1432
- if (a.distribution === "gaussian")
1433
- L = this.gaussianRandom() * E.spread, z = this.gaussianRandom() * E.spread;
1430
+ for (let I = 0; I < x; I++) {
1431
+ let M, F;
1432
+ if (s.distribution === "gaussian")
1433
+ M = this.gaussianRandom() * E.spread, F = this.gaussianRandom() * E.spread;
1434
1434
  else {
1435
- const M = this.random(0, Math.PI * 2), W = this.random(0, E.spread);
1436
- L = Math.cos(M) * W, z = Math.sin(M) * W;
1435
+ const L = this.random(0, Math.PI * 2), k = this.random(0, E.spread);
1436
+ M = Math.cos(L) * k, F = Math.sin(L) * k;
1437
1437
  }
1438
- const U = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
1439
- L /= U, z /= U;
1440
- const Y = p ? this.random(f, b) : 1, N = _ * Y, T = c * N;
1441
- let D = E.x + L, k = E.y + z;
1442
- const R = T * 1.5 / 2, C = T / 2;
1443
- D = Math.max(h + R, Math.min(D, s - h - R)), k = Math.max(h + C, Math.min(k, r - h - C));
1444
- const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread, P = Math.round((1 - F) * 50) + 1;
1445
- o.push({
1438
+ const U = 1 + s.overlap * 0.5, _ = 1 + s.overlap * 0.3;
1439
+ M /= U, F /= U;
1440
+ const B = b ? this.random(g, p) : 1, j = _ * B, T = c * j;
1441
+ let O = E.x + M, W = E.y + F;
1442
+ const A = T * 1.5 / 2, C = T / 2;
1443
+ O = Math.max(h + A, Math.min(O, a - h - A)), W = Math.max(h + C, Math.min(W, r - h - C));
1444
+ const $ = d === "random" ? this.random(l, u) : 0, z = Math.sqrt(M * M + F * F) / E.spread, P = Math.round((1 - z) * 50) + 1;
1445
+ n.push({
1446
1446
  id: v,
1447
- x: D,
1448
- y: k,
1449
- rotation: O,
1450
- scale: N,
1447
+ x: O,
1448
+ y: W,
1449
+ rotation: $,
1450
+ scale: j,
1451
1451
  baseSize: T,
1452
1452
  zIndex: P
1453
1453
  }), v++;
1454
1454
  }
1455
1455
  }
1456
- return o;
1456
+ return n;
1457
1457
  }
1458
1458
  /**
1459
1459
  * Calculate optimal number of clusters based on image count and container
1460
1460
  */
1461
- calculateClusterCount(t, e, i, o, s) {
1462
- if (e !== "auto")
1463
- return Math.max(1, Math.min(e, t));
1464
- const a = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1465
- i / s * (o / s) * 0.6
1461
+ calculateClusterCount(t, i, e, n, a) {
1462
+ if (i !== "auto")
1463
+ return Math.max(1, Math.min(i, t));
1464
+ const s = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1465
+ e / a * (n / a) * 0.6
1466
1466
  );
1467
- return Math.max(1, Math.min(a, h, 10));
1467
+ return Math.max(1, Math.min(s, h, 10));
1468
1468
  }
1469
1469
  /**
1470
1470
  * Generate cluster center positions with spacing constraints
1471
1471
  */
1472
- generateClusterCenters(t, e, i, o, s) {
1473
- const r = [], h = o + s.clusterSpread, c = e - o - s.clusterSpread, u = o + s.clusterSpread, l = i - o - s.clusterSpread;
1474
- for (let d = 0; d < t; d++) {
1475
- let f = null, b = -1;
1476
- for (let p = 0; p < 100; p++) {
1477
- const g = {
1472
+ generateClusterCenters(t, i, e, n, a) {
1473
+ const r = [], h = n + a.clusterSpread, c = i - n - a.clusterSpread, d = n + a.clusterSpread, l = e - n - a.clusterSpread;
1474
+ for (let u = 0; u < t; u++) {
1475
+ let g = null, p = -1;
1476
+ for (let b = 0; b < 100; b++) {
1477
+ const f = {
1478
1478
  x: this.random(h, c),
1479
- y: this.random(u, l),
1480
- spread: this.calculateClusterSpread(s)
1479
+ y: this.random(d, l),
1480
+ spread: this.calculateClusterSpread(a)
1481
1481
  };
1482
1482
  let m = 1 / 0;
1483
1483
  for (const S of r) {
1484
- const v = g.x - S.x, w = g.y - S.y, E = Math.sqrt(v * v + w * w);
1484
+ const v = f.x - S.x, w = f.y - S.y, E = Math.sqrt(v * v + w * w);
1485
1485
  m = Math.min(m, E);
1486
1486
  }
1487
- if ((r.length === 0 || m > b) && (f = g, b = m), m >= s.clusterSpacing)
1487
+ if ((r.length === 0 || m > p) && (g = f, p = m), m >= a.clusterSpacing)
1488
1488
  break;
1489
1489
  }
1490
- f && r.push(f);
1490
+ g && r.push(g);
1491
1491
  }
1492
1492
  return r;
1493
1493
  }
@@ -1502,22 +1502,22 @@ class be {
1502
1502
  * Using Box-Muller transform
1503
1503
  */
1504
1504
  gaussianRandom() {
1505
- let t = 0, e = 0;
1505
+ let t = 0, i = 0;
1506
1506
  for (; t === 0; ) t = Math.random();
1507
- for (; e === 0; ) e = Math.random();
1508
- const i = Math.sqrt(-2 * Math.log(t)) * Math.cos(2 * Math.PI * e);
1509
- return Math.max(-3, Math.min(3, i)) / 3;
1507
+ for (; i === 0; ) i = Math.random();
1508
+ const e = Math.sqrt(-2 * Math.log(t)) * Math.cos(2 * Math.PI * i);
1509
+ return Math.max(-3, Math.min(3, e)) / 3;
1510
1510
  }
1511
1511
  /**
1512
1512
  * Utility: Generate random number between min and max
1513
1513
  */
1514
- random(t, e) {
1515
- return Math.random() * (e - t) + t;
1514
+ random(t, i) {
1515
+ return Math.random() * (i - t) + t;
1516
1516
  }
1517
1517
  }
1518
1518
  class ye {
1519
- constructor(t, e = {}) {
1520
- this.config = t, this.imageConfig = e;
1519
+ constructor(t, i = {}) {
1520
+ this.config = t, this.imageConfig = i;
1521
1521
  }
1522
1522
  /**
1523
1523
  * Generate wave layout positions for images
@@ -1526,33 +1526,33 @@ class ye {
1526
1526
  * @param options - Optional overrides
1527
1527
  * @returns Array of layout objects with position, rotation, scale
1528
1528
  */
1529
- generate(t, e, i = {}) {
1530
- const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = i.fixedHeight ?? a, g = {
1529
+ generate(t, i, e = {}) {
1530
+ const n = [], { width: a, height: r } = i, s = e.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", d = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, u = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, p = u !== 1 || g !== 1, b = e.fixedHeight ?? s, f = {
1531
1531
  ...Ht,
1532
1532
  ...this.config.wave
1533
- }, { rows: m, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = g, x = Math.ceil(t / m), z = p * 1.5 / 2, U = h + z, _ = s - h - z, Y = _ - U, N = x > 1 ? Y / (x - 1) : 0, T = h + S + p / 2, D = r - h - S - p / 2, k = D - T, H = m > 1 ? k / (m - 1) : 0;
1534
- let R = 0;
1535
- for (let C = 0; C < m && R < t; C++) {
1536
- const O = m === 1 ? (T + D) / 2 : T + C * H;
1537
- let $ = 0;
1538
- E === "offset" ? $ = C * w : E === "alternating" && ($ = C * Math.PI);
1539
- for (let F = 0; F < x && R < t; F++) {
1540
- const P = x === 1 ? (U + _) / 2 : U + F * N, M = this.calculateWaveY(P, s, S, v, $), W = P, G = O + M, X = b ? this.random(d, f) : 1, B = p * X;
1533
+ }, { rows: m, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = f, x = Math.ceil(t / m), F = b * 1.5 / 2, U = h + F, _ = a - h - F, B = _ - U, j = x > 1 ? B / (x - 1) : 0, T = h + S + b / 2, O = r - h - S - b / 2, W = O - T, H = m > 1 ? W / (m - 1) : 0;
1534
+ let A = 0;
1535
+ for (let C = 0; C < m && A < t; C++) {
1536
+ const $ = m === 1 ? (T + O) / 2 : T + C * H;
1537
+ let D = 0;
1538
+ E === "offset" ? D = C * w : E === "alternating" && (D = C * Math.PI);
1539
+ for (let z = 0; z < x && A < t; z++) {
1540
+ const P = x === 1 ? (U + _) / 2 : U + z * j, L = this.calculateWaveY(P, a, S, v, D), k = P, G = $ + L, Y = p ? this.random(u, g) : 1, X = b * Y;
1541
1541
  let J = 0;
1542
- c === "tangent" ? J = this.calculateRotation(P, s, S, v, $) : c === "random" && (J = this.random(u, l));
1543
- const K = B * 1.5 / 2, ct = B / 2, it = h + K, nt = s - h - K, lt = h + ct, ht = r - h - ct;
1544
- o.push({
1545
- id: R,
1546
- x: Math.max(it, Math.min(W, nt)),
1547
- y: Math.max(lt, Math.min(G, ht)),
1542
+ c === "tangent" ? J = this.calculateRotation(P, a, S, v, D) : c === "random" && (J = this.random(d, l));
1543
+ const K = X * 1.5 / 2, rt = X / 2, et = h + K, it = a - h - K, ct = h + rt, lt = r - h - rt;
1544
+ n.push({
1545
+ id: A,
1546
+ x: Math.max(et, Math.min(k, it)),
1547
+ y: Math.max(ct, Math.min(G, lt)),
1548
1548
  rotation: J,
1549
- scale: X,
1550
- baseSize: B,
1551
- zIndex: R + 1
1552
- }), R++;
1549
+ scale: Y,
1550
+ baseSize: X,
1551
+ zIndex: A + 1
1552
+ }), A++;
1553
1553
  }
1554
1554
  }
1555
- return o;
1555
+ return n;
1556
1556
  }
1557
1557
  /**
1558
1558
  * Calculate Y position displacement on wave curve
@@ -1563,9 +1563,9 @@ class ye {
1563
1563
  * @param phase - Phase offset
1564
1564
  * @returns Y displacement from baseline
1565
1565
  */
1566
- calculateWaveY(t, e, i, o, s) {
1567
- const r = t / e;
1568
- return i * Math.sin(o * r * 2 * Math.PI + s);
1566
+ calculateWaveY(t, i, e, n, a) {
1567
+ const r = t / i;
1568
+ return e * Math.sin(n * r * 2 * Math.PI + a);
1569
1569
  }
1570
1570
  /**
1571
1571
  * Calculate rotation based on wave tangent
@@ -1576,9 +1576,9 @@ class ye {
1576
1576
  * @param phase - Phase offset
1577
1577
  * @returns Rotation angle in degrees
1578
1578
  */
1579
- calculateRotation(t, e, i, o, s) {
1580
- const r = t / e, a = i * o * 2 * Math.PI * Math.cos(o * r * 2 * Math.PI + s) / e;
1581
- return Math.atan(a) * (180 / Math.PI);
1579
+ calculateRotation(t, i, e, n, a) {
1580
+ const r = t / i, s = e * n * 2 * Math.PI * Math.cos(n * r * 2 * Math.PI + a) / i;
1581
+ return Math.atan(s) * (180 / Math.PI);
1582
1582
  }
1583
1583
  /**
1584
1584
  * Estimate image width based on height
@@ -1588,8 +1588,8 @@ class ye {
1588
1588
  * @param max - Maximum value
1589
1589
  * @returns Random number in range
1590
1590
  */
1591
- random(t, e) {
1592
- return Math.random() * (e - t) + t;
1591
+ random(t, i) {
1592
+ return Math.random() * (i - t) + t;
1593
1593
  }
1594
1594
  }
1595
1595
  class ve {
@@ -1623,11 +1623,11 @@ class ve {
1623
1623
  * @param options - Optional overrides for configuration (e.g. fixedHeight)
1624
1624
  * @returns Array of layout objects with position, rotation, scale
1625
1625
  */
1626
- generateLayout(t, e, i = {}) {
1627
- const o = this.placementLayout.generate(t, e, i);
1628
- return o.forEach((s) => {
1629
- this.layouts.set(s.id, s);
1630
- }), o;
1626
+ generateLayout(t, i, e = {}) {
1627
+ const n = this.placementLayout.generate(t, i, e);
1628
+ return n.forEach((a) => {
1629
+ this.layouts.set(a.id, a);
1630
+ }), n;
1631
1631
  }
1632
1632
  /**
1633
1633
  * Get the original layout state for an image
@@ -1663,8 +1663,8 @@ class ve {
1663
1663
  * Resolve breakpoint name based on viewport width
1664
1664
  */
1665
1665
  resolveBreakpoint(t) {
1666
- const e = this.getBreakpoints();
1667
- return t <= e.mobile.maxWidth ? "mobile" : t <= e.tablet.maxWidth ? "tablet" : "screen";
1666
+ const i = this.getBreakpoints();
1667
+ return t <= i.mobile.maxWidth ? "mobile" : t <= i.tablet.maxWidth ? "tablet" : "screen";
1668
1668
  }
1669
1669
  /**
1670
1670
  * Resolve the effective base height based on image config and current viewport
@@ -1672,16 +1672,16 @@ class ve {
1672
1672
  * @returns Resolved base height or undefined if should auto-calculate (adaptive mode)
1673
1673
  */
1674
1674
  resolveBaseHeight(t) {
1675
- const e = this.imageConfig.sizing;
1676
- if (!e || e.mode === "adaptive")
1675
+ const i = this.imageConfig.sizing;
1676
+ if (!i || i.mode === "adaptive")
1677
1677
  return;
1678
- const i = e.height;
1679
- if (i === void 0)
1678
+ const e = i.height;
1679
+ if (e === void 0)
1680
1680
  return;
1681
- if (typeof i == "number")
1682
- return i;
1683
- const o = i, s = this.resolveBreakpoint(t);
1684
- return s === "mobile" ? o.mobile ?? o.tablet ?? o.screen : s === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1681
+ if (typeof e == "number")
1682
+ return e;
1683
+ const n = e, a = this.resolveBreakpoint(t);
1684
+ return a === "mobile" ? n.mobile ?? n.tablet ?? n.screen : a === "tablet" ? n.tablet ?? n.screen ?? n.mobile : n.screen ?? n.tablet ?? n.mobile;
1685
1685
  }
1686
1686
  /**
1687
1687
  * Calculate adaptive image size based on container dimensions and image count
@@ -1691,16 +1691,16 @@ class ve {
1691
1691
  * @param viewportWidth - Current viewport width for baseHeight resolution
1692
1692
  * @returns Calculated sizing result with height
1693
1693
  */
1694
- calculateAdaptiveSize(t, e, i, o) {
1695
- const s = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1694
+ calculateAdaptiveSize(t, i, e, n) {
1695
+ const a = this.imageConfig.sizing, r = this.resolveBaseHeight(n);
1696
1696
  if (r !== void 0)
1697
1697
  return { height: r };
1698
- const a = s?.minSize ?? 50, h = s?.maxSize ?? 400, c = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: l, height: d } = t, p = l * d * c / e;
1699
- let m = Math.sqrt(p / 1.4);
1700
- m *= u, m = Math.min(m, i);
1701
- let S = this.clamp(m, a, h);
1702
- if (S === a && m < a) {
1703
- const v = Math.max(a * 0.05, 20);
1698
+ const s = a?.minSize ?? 50, h = a?.maxSize ?? 400, c = this.config.targetCoverage ?? 0.6, d = this.config.densityFactor ?? 1, { width: l, height: u } = t, b = l * u * c / i;
1699
+ let m = Math.sqrt(b / 1.4);
1700
+ m *= d, m = Math.min(m, e);
1701
+ let S = this.clamp(m, s, h);
1702
+ if (S === s && m < s) {
1703
+ const v = Math.max(s * 0.05, 20);
1704
1704
  S = Math.max(v, m);
1705
1705
  }
1706
1706
  return { height: S };
@@ -1708,12 +1708,12 @@ class ve {
1708
1708
  /**
1709
1709
  * Utility: Clamp a value between min and max
1710
1710
  */
1711
- clamp(t, e, i) {
1712
- return Math.max(e, Math.min(i, t));
1711
+ clamp(t, i, e) {
1712
+ return Math.max(i, Math.min(e, t));
1713
1713
  }
1714
1714
  }
1715
- var I = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(I || {});
1716
- const At = {
1715
+ var R = /* @__PURE__ */ ((o) => (o.IDLE = "idle", o.FOCUSING = "focusing", o.FOCUSED = "focused", o.UNFOCUSING = "unfocusing", o.CROSS_ANIMATING = "cross_animating", o))(R || {});
1716
+ const Tt = {
1717
1717
  // Geometric shapes - uses percentages for responsive sizing
1718
1718
  circle: "circle(50%)",
1719
1719
  square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
@@ -1722,83 +1722,143 @@ const At = {
1722
1722
  hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
1723
1723
  octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
1724
1724
  diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
1725
+ }, we = {
1726
+ // Circle - uses radius in pixels (refHeight of 100px = 50px radius)
1727
+ circle: {
1728
+ refHeight: 100,
1729
+ points: []
1730
+ // Special case: handled separately
1731
+ },
1732
+ // Square - maintains perfect aspect ratio (always 1:1)
1733
+ square: {
1734
+ refHeight: 100,
1735
+ points: [[0, 0], [100, 0], [100, 100], [0, 100]]
1736
+ },
1737
+ // Triangle - isosceles triangle
1738
+ triangle: {
1739
+ refHeight: 100,
1740
+ points: [[50, 0], [100, 100], [0, 100]]
1741
+ },
1742
+ // Pentagon - regular pentagon
1743
+ pentagon: {
1744
+ refHeight: 100,
1745
+ points: [[50, 0], [100, 38], [82, 100], [18, 100], [0, 38]]
1746
+ },
1747
+ // Hexagon - regular hexagon
1748
+ hexagon: {
1749
+ refHeight: 100,
1750
+ points: [[25, 0], [75, 0], [100, 50], [75, 100], [25, 100], [0, 50]]
1751
+ },
1752
+ // Octagon - regular octagon
1753
+ octagon: {
1754
+ refHeight: 100,
1755
+ points: [[30, 0], [70, 0], [100, 30], [100, 70], [70, 100], [30, 100], [0, 70], [0, 30]]
1756
+ },
1757
+ // Diamond - 45-degree rotated square
1758
+ diamond: {
1759
+ refHeight: 100,
1760
+ points: [[50, 0], [100, 50], [50, 100], [0, 50]]
1761
+ }
1725
1762
  };
1726
- function we(n) {
1727
- if (n)
1728
- return n in At ? At[n] : n;
1763
+ function xe(o) {
1764
+ if (o)
1765
+ return o in Tt ? Tt[o] : o;
1729
1766
  }
1730
- function xe(n) {
1731
- return n in ft;
1767
+ function Se(o, t, i) {
1768
+ const e = we[o];
1769
+ if (!e) return "";
1770
+ const n = t / e.refHeight;
1771
+ if (o === "circle")
1772
+ return `circle(${Math.round(50 * n * 100) / 100}px)`;
1773
+ const a = e.refHeight * n, r = a / 2, s = a / 2, h = (i ?? a) / 2, c = t / 2, d = h - r, l = c - s;
1774
+ return `polygon(${e.points.map(([g, p]) => {
1775
+ const b = Math.round((g * n + d) * 100) / 100, f = Math.round((p * n + l) * 100) / 100;
1776
+ return `${b}px ${f}px`;
1777
+ }).join(", ")})`;
1732
1778
  }
1733
- function Se(n) {
1734
- return n ? xe(n) ? ft[n] : n : ft.md;
1779
+ function Ee(o) {
1780
+ return o in ft;
1735
1781
  }
1736
- function Ee(n) {
1737
- if (!n) return "";
1782
+ function Re(o) {
1783
+ return o ? Ee(o) ? ft[o] : o : ft.md;
1784
+ }
1785
+ function Ie(o) {
1786
+ if (!o) return "";
1738
1787
  const t = [];
1739
- 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)
1740
- if (typeof n.dropShadow == "string")
1741
- t.push(`drop-shadow(${n.dropShadow})`);
1788
+ 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)
1789
+ if (typeof o.dropShadow == "string")
1790
+ t.push(`drop-shadow(${o.dropShadow})`);
1742
1791
  else {
1743
- const e = n.dropShadow;
1744
- t.push(`drop-shadow(${e.x}px ${e.y}px ${e.blur}px ${e.color})`);
1792
+ const i = o.dropShadow;
1793
+ t.push(`drop-shadow(${i.x}px ${i.y}px ${i.blur}px ${i.color})`);
1745
1794
  }
1746
1795
  return t.join(" ");
1747
1796
  }
1748
- function Q(n) {
1749
- if (!n || n.style === "none" || n.width === 0)
1797
+ function Q(o) {
1798
+ if (!o || o.style === "none" || o.width === 0)
1750
1799
  return "none";
1751
- const t = n.width ?? 0, e = n.style ?? "solid", i = n.color ?? "#000000";
1752
- return `${t}px ${e} ${i}`;
1800
+ const t = o.width ?? 0, i = o.style ?? "solid", e = o.color ?? "#000000";
1801
+ return `${t}px ${i} ${e}`;
1753
1802
  }
1754
- function st(n) {
1755
- if (!n) return {};
1756
- const t = {};
1757
- if (n.borderRadiusTopLeft !== void 0 || n.borderRadiusTopRight !== void 0 || n.borderRadiusBottomRight !== void 0 || n.borderRadiusBottomLeft !== void 0) {
1758
- const s = n.border?.radius ?? 0;
1759
- 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`);
1760
- } else n.border?.radius !== void 0 && (t.borderRadius = `${n.border.radius}px`);
1761
- if (n.borderTop || n.borderRight || n.borderBottom || n.borderLeft) {
1762
- const s = n.border || {}, r = { ...s, ...n.borderTop }, a = { ...s, ...n.borderRight }, h = { ...s, ...n.borderBottom }, c = { ...s, ...n.borderLeft };
1763
- t.borderTop = Q(r), t.borderRight = Q(a), t.borderBottom = Q(h), t.borderLeft = Q(c);
1764
- } else n.border && (t.border = Q(n.border));
1765
- n.shadow !== void 0 && (t.boxShadow = Se(n.shadow));
1766
- const o = Ee(n.filter);
1767
- 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) {
1768
- const s = n.outline.width ?? 0, r = n.outline.style ?? "solid", a = n.outline.color ?? "#000000";
1769
- t.outline = `${s}px ${r} ${a}`, n.outline.offset !== void 0 && (t.outlineOffset = `${n.outline.offset}px`);
1770
- }
1771
- if (n.objectFit !== void 0 && (t.objectFit = n.objectFit), n.aspectRatio !== void 0 && (t.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
1772
- const s = we(n.clipPath);
1773
- s && (s === "none" ? t.clipPath = "unset" : (t.clipPath = s, t.overflow = "hidden"));
1774
- }
1775
- return t;
1803
+ function tt(o, t, i) {
1804
+ if (!o) return {};
1805
+ const e = {};
1806
+ if (o.borderRadiusTopLeft !== void 0 || o.borderRadiusTopRight !== void 0 || o.borderRadiusBottomRight !== void 0 || o.borderRadiusBottomLeft !== void 0) {
1807
+ const s = o.border?.radius ?? 0;
1808
+ o.borderRadiusTopLeft !== void 0 ? e.borderTopLeftRadius = `${o.borderRadiusTopLeft}px` : s && (e.borderTopLeftRadius = `${s}px`), o.borderRadiusTopRight !== void 0 ? e.borderTopRightRadius = `${o.borderRadiusTopRight}px` : s && (e.borderTopRightRadius = `${s}px`), o.borderRadiusBottomRight !== void 0 ? e.borderBottomRightRadius = `${o.borderRadiusBottomRight}px` : s && (e.borderBottomRightRadius = `${s}px`), o.borderRadiusBottomLeft !== void 0 ? e.borderBottomLeftRadius = `${o.borderRadiusBottomLeft}px` : s && (e.borderBottomLeftRadius = `${s}px`);
1809
+ } else o.border?.radius !== void 0 && (e.borderRadius = `${o.border.radius}px`);
1810
+ if (o.borderTop || o.borderRight || o.borderBottom || o.borderLeft) {
1811
+ const s = o.border || {}, h = { ...s, ...o.borderTop }, c = { ...s, ...o.borderRight }, d = { ...s, ...o.borderBottom }, l = { ...s, ...o.borderLeft };
1812
+ e.borderTop = Q(h), e.borderRight = Q(c), e.borderBottom = Q(d), e.borderLeft = Q(l);
1813
+ } else o.border && (e.border = Q(o.border));
1814
+ o.shadow !== void 0 && (e.boxShadow = Re(o.shadow));
1815
+ const r = Ie(o.filter);
1816
+ if (e.filter = r || "none", o.opacity !== void 0 && (e.opacity = String(o.opacity)), o.cursor !== void 0 && (e.cursor = o.cursor), o.outline && o.outline.style !== "none" && (o.outline.width ?? 0) > 0) {
1817
+ const s = o.outline.width ?? 0, h = o.outline.style ?? "solid", c = o.outline.color ?? "#000000";
1818
+ e.outline = `${s}px ${h} ${c}`, o.outline.offset !== void 0 && (e.outlineOffset = `${o.outline.offset}px`);
1819
+ }
1820
+ if (o.objectFit !== void 0 && (e.objectFit = o.objectFit), o.aspectRatio !== void 0 && (e.aspectRatio = o.aspectRatio), o.clipPath !== void 0) {
1821
+ let s;
1822
+ const h = typeof o.clipPath == "object" && o.clipPath !== null && "shape" in o.clipPath, c = h ? o.clipPath : void 0;
1823
+ if (c?.mode === "height-relative" && t)
1824
+ s = Se(c.shape, t, i);
1825
+ else {
1826
+ const d = h && c ? c.shape : o.clipPath;
1827
+ s = xe(d);
1828
+ }
1829
+ s && (s === "none" ? e.clipPath = "unset" : (e.clipPath = s, e.overflow = "hidden"));
1830
+ }
1831
+ return e;
1776
1832
  }
1777
- function tt(n, t) {
1778
- 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), t.clipPath !== void 0 && (n.style.clipPath = t.clipPath), t.overflow !== void 0 && (n.style.overflow = t.overflow);
1833
+ function Te(o, t) {
1834
+ 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), t.clipPath !== void 0 && (o.style.clipPath = t.clipPath), t.overflow !== void 0 && (o.style.overflow = t.overflow);
1779
1835
  }
1780
- function zt(n) {
1781
- return n ? Array.isArray(n) ? n.join(" ") : n : "";
1836
+ function gt(o, t, i, e) {
1837
+ const n = tt(t, i, e);
1838
+ Te(o, n);
1782
1839
  }
1783
- function et(n, t) {
1784
- const e = zt(t);
1785
- e && e.split(" ").forEach((i) => {
1786
- i.trim() && n.classList.add(i.trim());
1840
+ function zt(o) {
1841
+ return o ? Array.isArray(o) ? o.join(" ") : o : "";
1842
+ }
1843
+ function nt(o, t) {
1844
+ const i = zt(t);
1845
+ i && i.split(" ").forEach((e) => {
1846
+ e.trim() && o.classList.add(e.trim());
1787
1847
  });
1788
1848
  }
1789
- function Ft(n, t) {
1790
- const e = zt(t);
1791
- e && e.split(" ").forEach((i) => {
1792
- i.trim() && n.classList.remove(i.trim());
1849
+ function mt(o, t) {
1850
+ const i = zt(t);
1851
+ i && i.split(" ").forEach((e) => {
1852
+ e.trim() && o.classList.remove(e.trim());
1793
1853
  });
1794
1854
  }
1795
- const Tt = {
1855
+ const Ct = {
1796
1856
  UNFOCUSING: 999,
1797
1857
  FOCUSING: 1e3
1798
1858
  };
1799
- class Ie {
1800
- constructor(t, e, i) {
1801
- 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 = st(i?.default), this.focusedStyles = st(i?.focused), this.defaultClassName = i?.default?.className, this.focusedClassName = i?.focused?.className;
1859
+ class Ce {
1860
+ constructor(t, i, e) {
1861
+ this.state = R.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = i, this.styling = e, this.focusedClassName = e?.focused?.className;
1802
1862
  }
1803
1863
  /**
1804
1864
  * Get current state machine state
@@ -1810,7 +1870,7 @@ class Ie {
1810
1870
  * Check if any animation is in progress
1811
1871
  */
1812
1872
  isAnimating() {
1813
- return this.state !== I.IDLE && this.state !== I.FOCUSED;
1873
+ return this.state !== R.IDLE && this.state !== R.FOCUSED;
1814
1874
  }
1815
1875
  /**
1816
1876
  * Normalize scalePercent value
@@ -1822,20 +1882,20 @@ class Ie {
1822
1882
  * Calculate target dimensions for focused image
1823
1883
  * Returns actual pixel dimensions instead of scale factor for sharper rendering
1824
1884
  */
1825
- calculateFocusDimensions(t, e, i) {
1826
- const o = this.normalizeScalePercent(this.config.scalePercent), s = i.height * o, r = t / e;
1827
- let a = s, h = a * r;
1828
- const c = i.width * o;
1829
- return h > c && (h = c, a = h / r), { width: h, height: a };
1885
+ calculateFocusDimensions(t, i, e) {
1886
+ const n = this.normalizeScalePercent(this.config.scalePercent), a = e.height * n, r = t / i;
1887
+ let s = a, h = s * r;
1888
+ const c = e.width * n;
1889
+ return h > c && (h = c, s = h / r), { width: h, height: s };
1830
1890
  }
1831
1891
  /**
1832
1892
  * Calculate the transform needed to center an image (position only, no scale)
1833
1893
  * Scale is handled by animating actual dimensions for sharper rendering
1834
1894
  */
1835
- calculateFocusTransform(t, e) {
1836
- const i = t.width / 2, o = t.height / 2, s = i - e.x, r = o - e.y;
1895
+ calculateFocusTransform(t, i) {
1896
+ const e = t.width / 2, n = t.height / 2, a = e - i.x, r = n - i.y;
1837
1897
  return {
1838
- x: s,
1898
+ x: a,
1839
1899
  y: r,
1840
1900
  rotation: 0,
1841
1901
  scale: 1
@@ -1846,30 +1906,30 @@ class Ie {
1846
1906
  * Build transform string for dimension-based zoom (no scale in transform)
1847
1907
  */
1848
1908
  buildDimensionZoomTransform(t) {
1849
- const e = ["translate(-50%, -50%)"];
1909
+ const i = ["translate(-50%, -50%)"];
1850
1910
  if (t.x !== void 0 || t.y !== void 0) {
1851
- const i = t.x ?? 0, o = t.y ?? 0;
1852
- e.push(`translate(${i}px, ${o}px)`);
1911
+ const e = t.x ?? 0, n = t.y ?? 0;
1912
+ i.push(`translate(${e}px, ${n}px)`);
1853
1913
  }
1854
- return t.rotation !== void 0 && e.push(`rotate(${t.rotation}deg)`), e.join(" ");
1914
+ return t.rotation !== void 0 && i.push(`rotate(${t.rotation}deg)`), i.join(" ");
1855
1915
  }
1856
1916
  /**
1857
1917
  * Create a Web Animation that animates both transform (position) and dimensions
1858
1918
  * This provides sharper zoom by re-rendering at target size instead of scaling pixels
1859
1919
  */
1860
- animateWithDimensions(t, e, i, o, s, r, a, h) {
1861
- const c = this.buildDimensionZoomTransform(e), u = this.buildDimensionZoomTransform(i);
1920
+ animateWithDimensions(t, i, e, n, a, r, s, h) {
1921
+ const c = this.buildDimensionZoomTransform(i), d = this.buildDimensionZoomTransform(e);
1862
1922
  return t.style.transition = "none", t.animate(
1863
1923
  [
1864
1924
  {
1865
1925
  transform: c,
1866
- width: `${o}px`,
1867
- height: `${s}px`
1926
+ width: `${n}px`,
1927
+ height: `${a}px`
1868
1928
  },
1869
1929
  {
1870
- transform: u,
1930
+ transform: d,
1871
1931
  width: `${r}px`,
1872
- height: `${a}px`
1932
+ height: `${s}px`
1873
1933
  }
1874
1934
  ],
1875
1935
  {
@@ -1881,15 +1941,36 @@ class Ie {
1881
1941
  }
1882
1942
  /**
1883
1943
  * Apply focused styling to an element
1944
+ * Applies all focused styling properties, classes, and z-index
1884
1945
  */
1885
- applyFocusedStyling(t, e) {
1886
- t.style.zIndex = String(e), t.classList.add("fbn-ic-focused"), tt(t, this.focusedStyles), et(t, this.focusedClassName);
1946
+ applyFocusedStyling(t, i) {
1947
+ if (t.style.zIndex = String(i), t.classList.add("fbn-ic-focused"), nt(t, this.focusedClassName), this.styling?.focused) {
1948
+ const e = tt(this.styling.focused, t.offsetHeight, t.offsetWidth);
1949
+ e.borderRadius !== void 0 && (t.style.borderRadius = e.borderRadius), e.borderTopLeftRadius !== void 0 && (t.style.borderTopLeftRadius = e.borderTopLeftRadius), e.borderTopRightRadius !== void 0 && (t.style.borderTopRightRadius = e.borderTopRightRadius), e.borderBottomRightRadius !== void 0 && (t.style.borderBottomRightRadius = e.borderBottomRightRadius), e.borderBottomLeftRadius !== void 0 && (t.style.borderBottomLeftRadius = e.borderBottomLeftRadius), e.border !== void 0 && (t.style.border = e.border), e.borderTop !== void 0 && (t.style.borderTop = e.borderTop), e.borderRight !== void 0 && (t.style.borderRight = e.borderRight), e.borderBottom !== void 0 && (t.style.borderBottom = e.borderBottom), e.borderLeft !== void 0 && (t.style.borderLeft = e.borderLeft), e.boxShadow !== void 0 && (t.style.boxShadow = e.boxShadow), e.filter !== void 0 && (t.style.filter = e.filter), e.opacity !== void 0 && (t.style.opacity = e.opacity), e.cursor !== void 0 && (t.style.cursor = e.cursor), e.outline !== void 0 && (t.style.outline = e.outline), e.outlineOffset !== void 0 && (t.style.outlineOffset = e.outlineOffset), e.objectFit !== void 0 && (t.style.objectFit = e.objectFit), e.aspectRatio !== void 0 && (t.style.aspectRatio = e.aspectRatio);
1950
+ }
1887
1951
  }
1888
1952
  /**
1889
1953
  * Remove focused styling from an element
1954
+ * Restores default styling properties, removes classes, and resets z-index
1890
1955
  */
1891
- removeFocusedStyling(t, e) {
1892
- t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), Ft(t, this.focusedClassName), tt(t, this.defaultStyles), et(t, this.defaultClassName);
1956
+ removeFocusedStyling(t, i) {
1957
+ if (t.style.zIndex = i, t.classList.remove("fbn-ic-focused"), mt(t, this.focusedClassName), this.styling?.default) {
1958
+ const e = tt(this.styling.default, t.offsetHeight, t.offsetWidth);
1959
+ e.borderRadius !== void 0 && (t.style.borderRadius = e.borderRadius), e.borderTopLeftRadius !== void 0 && (t.style.borderTopLeftRadius = e.borderTopLeftRadius), e.borderTopRightRadius !== void 0 && (t.style.borderTopRightRadius = e.borderTopRightRadius), e.borderBottomRightRadius !== void 0 && (t.style.borderBottomRightRadius = e.borderBottomRightRadius), e.borderBottomLeftRadius !== void 0 && (t.style.borderBottomLeftRadius = e.borderBottomLeftRadius), e.border !== void 0 && (t.style.border = e.border), e.borderTop !== void 0 && (t.style.borderTop = e.borderTop), e.borderRight !== void 0 && (t.style.borderRight = e.borderRight), e.borderBottom !== void 0 && (t.style.borderBottom = e.borderBottom), e.borderLeft !== void 0 && (t.style.borderLeft = e.borderLeft), e.boxShadow !== void 0 && (t.style.boxShadow = e.boxShadow), e.filter !== void 0 && (t.style.filter = e.filter), e.opacity !== void 0 && (t.style.opacity = e.opacity), e.cursor !== void 0 && (t.style.cursor = e.cursor), e.outline !== void 0 && (t.style.outline = e.outline), e.outlineOffset !== void 0 && (t.style.outlineOffset = e.outlineOffset), e.objectFit !== void 0 && (t.style.objectFit = e.objectFit), e.aspectRatio !== void 0 && (t.style.aspectRatio = e.aspectRatio);
1960
+ }
1961
+ }
1962
+ /**
1963
+ * Continuously update clip-path during animation based on current element dimensions
1964
+ * This ensures clip-path changes smoothly as width/height animate
1965
+ */
1966
+ startClipPathAnimation(t, i, e) {
1967
+ let n = e ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
1968
+ e && this.styling?.focused && this.styling.focused.clipPath === void 0 && (n = { ...n, clipPath: void 0 });
1969
+ const a = () => {
1970
+ const r = t.offsetHeight, s = t.offsetWidth, h = tt(n, r, s);
1971
+ h.clipPath !== void 0 ? t.style.clipPath = h.clipPath : t.style.clipPath = "unset", h.overflow !== void 0 && (t.style.overflow = h.overflow), i.animation.playState === "running" && requestAnimationFrame(a);
1972
+ };
1973
+ requestAnimationFrame(a);
1893
1974
  }
1894
1975
  /**
1895
1976
  * Start focus animation for an image using dimension-based zoom
@@ -1897,48 +1978,50 @@ class Ie {
1897
1978
  * @param fromTransform - Optional starting transform (for mid-animation reversals)
1898
1979
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1899
1980
  */
1900
- startFocusAnimation(t, e, i, o, s) {
1901
- const r = t.style.zIndex || "", a = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(a, h, e), u = this.calculateFocusTransform(e, i);
1902
- this.applyFocusedStyling(t, Tt.FOCUSING), this.animationEngine.cancelAllAnimations(t);
1903
- const l = o ?? {
1981
+ startFocusAnimation(t, i, e, n, a) {
1982
+ const r = t.style.zIndex || "", s = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(s, h, i), d = this.calculateFocusTransform(i, e);
1983
+ this.animationEngine.cancelAllAnimations(t);
1984
+ const l = this.config.animationDuration ?? 600;
1985
+ this.applyFocusedStyling(t, Ct.FOCUSING);
1986
+ const u = n ?? {
1904
1987
  x: 0,
1905
1988
  y: 0,
1906
- rotation: i.rotation,
1989
+ rotation: e.rotation,
1907
1990
  scale: 1
1908
1991
  // No scale - using dimensions
1909
- }, d = s?.width ?? a, f = s?.height ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
1992
+ }, g = a?.width ?? s, p = a?.height ?? h, b = this.animateWithDimensions(
1910
1993
  t,
1911
- l,
1912
1994
  u,
1913
1995
  d,
1914
- f,
1996
+ g,
1997
+ p,
1915
1998
  c.width,
1916
1999
  c.height,
1917
- b
1918
- ), g = {
2000
+ l
2001
+ ), f = {
1919
2002
  id: `focus-${Date.now()}`,
1920
2003
  element: t,
1921
- animation: p,
1922
- fromState: l,
1923
- toState: u,
2004
+ animation: b,
2005
+ fromState: u,
2006
+ toState: d,
1924
2007
  startTime: performance.now(),
1925
- duration: b
2008
+ duration: l
1926
2009
  };
1927
2010
  return this.focusData = {
1928
2011
  element: t,
1929
- originalState: i,
1930
- focusTransform: u,
2012
+ originalState: e,
2013
+ focusTransform: d,
1931
2014
  originalZIndex: r,
1932
- originalWidth: a,
2015
+ originalWidth: s,
1933
2016
  originalHeight: h,
1934
2017
  focusWidth: c.width,
1935
2018
  focusHeight: c.height
1936
- }, {
2019
+ }, this.startClipPathAnimation(t, f, !0), {
1937
2020
  element: t,
1938
- originalState: i,
1939
- animationHandle: g,
2021
+ originalState: e,
2022
+ animationHandle: f,
1940
2023
  direction: "in",
1941
- originalWidth: a,
2024
+ originalWidth: s,
1942
2025
  originalHeight: h
1943
2026
  };
1944
2027
  }
@@ -1947,39 +2030,41 @@ class Ie {
1947
2030
  * Animates back to original dimensions for consistent behavior
1948
2031
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1949
2032
  */
1950
- startUnfocusAnimation(t, e, i, o) {
1951
- t.style.zIndex = String(Tt.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
1952
- const s = i ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, r = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, a = o?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, h = {
2033
+ startUnfocusAnimation(t, i, e, n) {
2034
+ t.style.zIndex = String(Ct.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
2035
+ const a = this.config.animationDuration ?? 600;
2036
+ t.classList.remove("fbn-ic-focused"), mt(t, this.focusedClassName);
2037
+ const r = e ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = n?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, h = n?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, c = {
1953
2038
  x: 0,
1954
2039
  y: 0,
1955
- rotation: e.rotation,
2040
+ rotation: i.rotation,
1956
2041
  scale: 1
1957
2042
  // No scale - using dimensions
1958
- }, c = this.focusData?.originalWidth ?? t.offsetWidth, u = this.focusData?.originalHeight ?? t.offsetHeight, l = this.config.animationDuration ?? 600, d = this.animateWithDimensions(
2043
+ }, d = this.focusData?.originalWidth ?? t.offsetWidth, l = this.focusData?.originalHeight ?? t.offsetHeight, u = this.animateWithDimensions(
1959
2044
  t,
1960
- s,
1961
- h,
1962
2045
  r,
1963
- a,
1964
2046
  c,
1965
- u,
1966
- l
1967
- ), f = {
2047
+ s,
2048
+ h,
2049
+ d,
2050
+ l,
2051
+ a
2052
+ ), g = {
1968
2053
  id: `unfocus-${Date.now()}`,
1969
2054
  element: t,
1970
- animation: d,
1971
- fromState: s,
1972
- toState: h,
2055
+ animation: u,
2056
+ fromState: r,
2057
+ toState: c,
1973
2058
  startTime: performance.now(),
1974
- duration: l
2059
+ duration: a
1975
2060
  };
1976
- return {
2061
+ return this.startClipPathAnimation(t, g, !1), {
1977
2062
  element: t,
1978
- originalState: e,
1979
- animationHandle: f,
2063
+ originalState: i,
2064
+ animationHandle: g,
1980
2065
  direction: "out",
1981
- originalWidth: c,
1982
- originalHeight: u
2066
+ originalWidth: d,
2067
+ originalHeight: l
1983
2068
  };
1984
2069
  }
1985
2070
  /**
@@ -1997,10 +2082,10 @@ class Ie {
1997
2082
  * Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
1998
2083
  */
1999
2084
  captureMidAnimationState(t) {
2000
- const e = getComputedStyle(t), i = new DOMMatrix(e.transform), o = t.offsetWidth, s = t.offsetHeight, r = i.e + o * 0.5, a = i.f + s * 0.5, h = Math.atan2(i.b, i.a) * (180 / Math.PI);
2001
- return t.style.width = `${o}px`, t.style.height = `${s}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${a}px) rotate(${h}deg)`, t.style.transition = "none", {
2002
- transform: { x: r, y: a, rotation: h, scale: 1 },
2003
- dimensions: { width: o, height: s }
2085
+ const i = getComputedStyle(t), e = new DOMMatrix(i.transform), n = t.offsetWidth, a = t.offsetHeight, r = e.e + n * 0.5, s = e.f + a * 0.5, h = Math.atan2(e.b, e.a) * (180 / Math.PI);
2086
+ return t.style.width = `${n}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${h}deg)`, t.style.transition = "none", {
2087
+ transform: { x: r, y: s, rotation: h, scale: 1 },
2088
+ dimensions: { width: n, height: a }
2004
2089
  };
2005
2090
  }
2006
2091
  /**
@@ -2015,82 +2100,82 @@ class Ie {
2015
2100
  /**
2016
2101
  * Reset an element instantly to its original position and dimensions (no animation)
2017
2102
  */
2018
- resetElementInstantly(t, e, i, o, s) {
2103
+ resetElementInstantly(t, i, e, n, a) {
2019
2104
  this.animationEngine.cancelAllAnimations(t);
2020
2105
  const r = ["translate(-50%, -50%)"];
2021
- r.push("translate(0px, 0px)"), r.push(`rotate(${e.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), o !== void 0 && s !== void 0 && (t.style.width = `${o}px`, t.style.height = `${s}px`), this.removeFocusedStyling(t, i);
2106
+ r.push("translate(0px, 0px)"), r.push(`rotate(${i.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), n !== void 0 && a !== void 0 && (t.style.width = `${n}px`, t.style.height = `${a}px`), this.removeFocusedStyling(t, e);
2022
2107
  }
2023
2108
  /**
2024
2109
  * Focus (zoom) an image to center of container
2025
2110
  * Implements cross-animation when swapping focus
2026
2111
  */
2027
- async focusImage(t, e, i) {
2028
- if (this.currentFocus === t && this.state === I.FOCUSED)
2112
+ async focusImage(t, i, e) {
2113
+ if (this.currentFocus === t && this.state === R.FOCUSED)
2029
2114
  return this.unfocusImage();
2030
- if (this.incoming?.element === t && this.state === I.FOCUSING) {
2031
- const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2115
+ if (this.incoming?.element === t && this.state === R.FOCUSING) {
2116
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2032
2117
  this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
2033
2118
  t,
2034
2119
  this.incoming.originalState,
2035
- s,
2120
+ a,
2036
2121
  r
2037
- ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2122
+ ), this.incoming = null, this.state = R.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = R.IDLE;
2038
2123
  return;
2039
2124
  }
2040
- const o = ++this.focusGeneration;
2125
+ const n = ++this.focusGeneration;
2041
2126
  switch (this.state) {
2042
- case I.IDLE:
2043
- if (this.state = I.FOCUSING, this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2044
- this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2127
+ case R.IDLE:
2128
+ if (this.state = R.FOCUSING, this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2129
+ this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2045
2130
  break;
2046
- case I.FOCUSED:
2047
- if (this.state = I.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2131
+ case R.FOCUSED:
2132
+ if (this.state = R.CROSS_ANIMATING, this.currentFocus && this.focusData && (this.outgoing = this.startUnfocusAnimation(
2048
2133
  this.currentFocus,
2049
2134
  this.focusData.originalState
2050
- )), this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2135
+ )), this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2051
2136
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2052
2137
  this.waitForAnimation(this.incoming.animationHandle)
2053
- ]), this.focusGeneration !== o)
2138
+ ]), this.focusGeneration !== n)
2054
2139
  return;
2055
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2140
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2056
2141
  break;
2057
- case I.FOCUSING:
2142
+ case R.FOCUSING:
2058
2143
  if (this.incoming && (this.animationEngine.cancelAnimation(this.incoming.animationHandle, !1), this.resetElementInstantly(
2059
2144
  this.incoming.element,
2060
2145
  this.incoming.originalState,
2061
2146
  this.focusData?.originalZIndex || "",
2062
2147
  this.focusData?.originalWidth,
2063
2148
  this.focusData?.originalHeight
2064
- ), this.incoming = null), this.incoming = this.startFocusAnimation(t, e, i), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== o) return;
2065
- this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2149
+ ), this.incoming = null), this.incoming = this.startFocusAnimation(t, i, e), await this.waitForAnimation(this.incoming.animationHandle), this.focusGeneration !== n) return;
2150
+ this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2066
2151
  break;
2067
- case I.UNFOCUSING:
2068
- if (this.state = I.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2152
+ case R.UNFOCUSING:
2153
+ if (this.state = R.CROSS_ANIMATING, this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2069
2154
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2070
2155
  this.waitForAnimation(this.incoming.animationHandle)
2071
- ]), this.focusGeneration !== o) return;
2072
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2156
+ ]), this.focusGeneration !== n) return;
2157
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2073
2158
  break;
2074
- case I.CROSS_ANIMATING:
2159
+ case R.CROSS_ANIMATING:
2075
2160
  if (this.incoming?.element === t)
2076
2161
  return;
2077
2162
  if (this.outgoing?.element === t) {
2078
- const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2163
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2079
2164
  if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
2080
- const { transform: a, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
2165
+ const { transform: s, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
2081
2166
  this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2082
2167
  this.incoming.element,
2083
2168
  this.incoming.originalState,
2084
- a,
2169
+ s,
2085
2170
  h
2086
2171
  );
2087
2172
  } else
2088
2173
  this.outgoing = null;
2089
- if (this.incoming = this.startFocusAnimation(t, e, i, s, r), await Promise.all([
2174
+ if (this.incoming = this.startFocusAnimation(t, i, e, a, r), await Promise.all([
2090
2175
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2091
2176
  this.waitForAnimation(this.incoming.animationHandle)
2092
- ]), this.focusGeneration !== o) return;
2093
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2177
+ ]), this.focusGeneration !== n) return;
2178
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2094
2179
  return;
2095
2180
  }
2096
2181
  if (this.outgoing && (this.animationEngine.cancelAnimation(this.outgoing.animationHandle, !1), this.resetElementInstantly(
@@ -2100,19 +2185,19 @@ class Ie {
2100
2185
  this.outgoing.originalWidth,
2101
2186
  this.outgoing.originalHeight
2102
2187
  ), this.outgoing = null), this.incoming) {
2103
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2188
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2104
2189
  this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2105
2190
  this.incoming.element,
2106
2191
  this.incoming.originalState,
2107
- s,
2192
+ a,
2108
2193
  r
2109
2194
  );
2110
2195
  }
2111
- if (this.incoming = this.startFocusAnimation(t, e, i), await Promise.all([
2196
+ if (this.incoming = this.startFocusAnimation(t, i, e), await Promise.all([
2112
2197
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2113
2198
  this.waitForAnimation(this.incoming.animationHandle)
2114
- ]), this.focusGeneration !== o) return;
2115
- this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = I.FOCUSED;
2199
+ ]), this.focusGeneration !== n) return;
2200
+ this.outgoing && (this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.outgoing = null), this.currentFocus = t, this.incoming = null, this.state = R.FOCUSED;
2116
2201
  break;
2117
2202
  }
2118
2203
  }
@@ -2120,47 +2205,47 @@ class Ie {
2120
2205
  * Unfocus current image, returning it to original position
2121
2206
  */
2122
2207
  async unfocusImage() {
2123
- if (this.state === I.UNFOCUSING)
2208
+ if (this.state === R.UNFOCUSING)
2124
2209
  return;
2125
2210
  const t = ++this.focusGeneration;
2126
2211
  if (!this.currentFocus || !this.focusData) {
2127
- if (this.incoming && this.state === I.FOCUSING) {
2128
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2212
+ if (this.incoming && this.state === R.FOCUSING) {
2213
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2129
2214
  if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2130
2215
  this.incoming.element,
2131
2216
  this.incoming.originalState,
2132
- s,
2217
+ a,
2133
2218
  r
2134
- ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2135
- this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = I.IDLE;
2219
+ ), this.incoming = null, this.state = R.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2220
+ this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = R.IDLE;
2136
2221
  }
2137
2222
  return;
2138
2223
  }
2139
- if (this.state === I.CROSS_ANIMATING && this.incoming) {
2140
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2224
+ if (this.state === R.CROSS_ANIMATING && this.incoming) {
2225
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2141
2226
  this.animationEngine.cancelAllAnimations(this.incoming.element);
2142
- const a = this.startUnfocusAnimation(
2227
+ const s = this.startUnfocusAnimation(
2143
2228
  this.incoming.element,
2144
2229
  this.incoming.originalState,
2145
- s,
2230
+ a,
2146
2231
  r
2147
2232
  );
2148
2233
  if (await Promise.all([
2149
2234
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2150
- this.waitForAnimation(a.animationHandle)
2235
+ this.waitForAnimation(s.animationHandle)
2151
2236
  ]), this.focusGeneration !== t) return;
2152
- this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(a.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2237
+ this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(s.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = R.IDLE;
2153
2238
  return;
2154
2239
  }
2155
- this.state = I.UNFOCUSING;
2156
- const e = this.currentFocus, i = this.focusData.originalState, o = this.focusData.originalZIndex;
2157
- 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);
2240
+ this.state = R.UNFOCUSING;
2241
+ const i = this.currentFocus, e = this.focusData.originalState, n = this.focusData.originalZIndex;
2242
+ this.outgoing = this.startUnfocusAnimation(i, e), await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration === t && (this.removeFocusedStyling(i, n), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = R.IDLE);
2158
2243
  }
2159
2244
  /**
2160
2245
  * Swap focus from current image to a new one (alias for focusImage with cross-animation)
2161
2246
  */
2162
- async swapFocus(t, e, i) {
2163
- return this.focusImage(t, e, i);
2247
+ async swapFocus(t, i, e) {
2248
+ return this.focusImage(t, i, e);
2164
2249
  }
2165
2250
  /**
2166
2251
  * Get currently focused image element
@@ -2172,7 +2257,7 @@ class Ie {
2172
2257
  * Check if an image is currently focused (stable state)
2173
2258
  */
2174
2259
  isFocused(t) {
2175
- return this.currentFocus === t && this.state === I.FOCUSED;
2260
+ return this.currentFocus === t && this.state === R.FOCUSED;
2176
2261
  }
2177
2262
  /**
2178
2263
  * Check if an image is the target of current focus animation
@@ -2193,23 +2278,23 @@ class Ie {
2193
2278
  * Used during swipe gestures for visual feedback
2194
2279
  */
2195
2280
  setDragOffset(t) {
2196
- if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2197
- const e = this.currentFocus, i = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], s = (i.x ?? 0) + t, r = i.y ?? 0;
2198
- o.push(`translate(${s}px, ${r}px)`), i.rotation !== void 0 && o.push(`rotate(${i.rotation}deg)`), e.style.transition = "none", e.style.transform = o.join(" ");
2281
+ if (!this.currentFocus || !this.focusData || this.state !== R.FOCUSED) return;
2282
+ const i = this.currentFocus, e = this.focusData.focusTransform, n = ["translate(-50%, -50%)"], a = (e.x ?? 0) + t, r = e.y ?? 0;
2283
+ n.push(`translate(${a}px, ${r}px)`), e.rotation !== void 0 && n.push(`rotate(${e.rotation}deg)`), i.style.transition = "none", i.style.transform = n.join(" ");
2199
2284
  }
2200
2285
  /**
2201
2286
  * Clear the drag offset, optionally animating back to center
2202
2287
  * @param animate - If true, animate back to center; if false, snap instantly
2203
2288
  * @param duration - Animation duration in ms (default 150)
2204
2289
  */
2205
- clearDragOffset(t, e = 150) {
2206
- if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2207
- const i = this.currentFocus, o = this.focusData.focusTransform, s = ["translate(-50%, -50%)"], r = o.x ?? 0, a = o.y ?? 0;
2208
- s.push(`translate(${r}px, ${a}px)`), o.rotation !== void 0 && s.push(`rotate(${o.rotation}deg)`);
2209
- const h = s.join(" ");
2210
- t ? (i.style.transition = `transform ${e}ms ease-out`, i.style.transform = h, setTimeout(() => {
2211
- this.currentFocus === i && (i.style.transition = "none");
2212
- }, e)) : (i.style.transition = "none", i.style.transform = h);
2290
+ clearDragOffset(t, i = 150) {
2291
+ if (!this.currentFocus || !this.focusData || this.state !== R.FOCUSED) return;
2292
+ const e = this.currentFocus, n = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = n.x ?? 0, s = n.y ?? 0;
2293
+ a.push(`translate(${r}px, ${s}px)`), n.rotation !== void 0 && a.push(`rotate(${n.rotation}deg)`);
2294
+ const h = a.join(" ");
2295
+ t ? (e.style.transition = `transform ${i}ms ease-out`, e.style.transform = h, setTimeout(() => {
2296
+ this.currentFocus === e && (e.style.transition = "none");
2297
+ }, i)) : (e.style.transition = "none", e.style.transform = h);
2213
2298
  }
2214
2299
  /**
2215
2300
  * Reset zoom state (cancels all animations)
@@ -2233,12 +2318,12 @@ class Ie {
2233
2318
  this.focusData.originalZIndex,
2234
2319
  this.focusData.originalWidth,
2235
2320
  this.focusData.originalHeight
2236
- ), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2321
+ ), this.state = R.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2237
2322
  }
2238
2323
  }
2239
- const Ae = 50, Te = 0.5, Ce = 20, Re = 0.3, Me = 150, Le = 30, at = class at {
2240
- constructor(t, e) {
2241
- 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);
2324
+ const Ae = 50, Le = 0.5, Me = 20, Fe = 0.3, ze = 150, Oe = 30, st = class st {
2325
+ constructor(t, i) {
2326
+ this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = i, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
2242
2327
  }
2243
2328
  /**
2244
2329
  * Start listening for touch events
@@ -2263,48 +2348,48 @@ const Ae = 50, Te = 0.5, Ce = 20, Re = 0.3, Me = 150, Le = 30, at = class at {
2263
2348
  * Used to prevent click-outside from unfocusing immediately after touch
2264
2349
  */
2265
2350
  hadRecentTouch() {
2266
- return Date.now() - this.recentTouchTimestamp < at.TOUCH_CLICK_DELAY;
2351
+ return Date.now() - this.recentTouchTimestamp < st.TOUCH_CLICK_DELAY;
2267
2352
  }
2268
2353
  handleTouchStart(t) {
2269
2354
  if (t.touches.length !== 1) return;
2270
2355
  this.recentTouchTimestamp = Date.now();
2271
- const e = t.touches[0];
2356
+ const i = t.touches[0];
2272
2357
  this.touchState = {
2273
- startX: e.clientX,
2274
- startY: e.clientY,
2358
+ startX: i.clientX,
2359
+ startY: i.clientY,
2275
2360
  startTime: performance.now(),
2276
- currentX: e.clientX,
2361
+ currentX: i.clientX,
2277
2362
  isDragging: !1,
2278
2363
  isHorizontalSwipe: null
2279
2364
  };
2280
2365
  }
2281
2366
  handleTouchMove(t) {
2282
2367
  if (!this.touchState || t.touches.length !== 1) return;
2283
- const e = t.touches[0], i = e.clientX - this.touchState.startX, o = e.clientY - this.touchState.startY;
2284
- if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + o * o) > 10) {
2285
- const a = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
2286
- this.touchState.isHorizontalSwipe = a <= Le;
2368
+ const i = t.touches[0], e = i.clientX - this.touchState.startX, n = i.clientY - this.touchState.startY;
2369
+ if (this.touchState.isHorizontalSwipe === null && Math.sqrt(e * e + n * n) > 10) {
2370
+ const s = Math.atan2(Math.abs(n), Math.abs(e)) * (180 / Math.PI);
2371
+ this.touchState.isHorizontalSwipe = s <= Oe;
2287
2372
  }
2288
2373
  if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2289
- t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
2290
- const s = i * Re;
2291
- this.callbacks.onDragOffset(s);
2374
+ t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = i.clientX;
2375
+ const a = e * Fe;
2376
+ this.callbacks.onDragOffset(a);
2292
2377
  }
2293
2378
  }
2294
2379
  handleTouchEnd(t) {
2295
2380
  if (!this.touchState) return;
2296
2381
  this.recentTouchTimestamp = Date.now();
2297
- const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, s = Math.abs(e);
2382
+ const i = this.touchState.currentX - this.touchState.startX, e = performance.now() - this.touchState.startTime, n = Math.abs(i) / e, a = Math.abs(i);
2298
2383
  let r = !1;
2299
- this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Ae || o >= Te && s >= Ce) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2384
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Ae || n >= Le && a >= Me) && (r = !0, i < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2300
2385
  }
2301
2386
  handleTouchCancel(t) {
2302
2387
  this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
2303
2388
  }
2304
2389
  };
2305
- at.TOUCH_CLICK_DELAY = 300;
2306
- let mt = at;
2307
- class ze {
2390
+ st.TOUCH_CLICK_DELAY = 300;
2391
+ let pt = st;
2392
+ class $e {
2308
2393
  constructor(t) {
2309
2394
  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)
2310
2395
  throw new Error("GoogleDriveLoader requires at least one source to be configured");
@@ -2315,15 +2400,15 @@ class ze {
2315
2400
  */
2316
2401
  async prepare(t) {
2317
2402
  this._discoveredUrls = [];
2318
- for (const e of this.sources)
2319
- if ("folders" in e)
2320
- for (const i of e.folders) {
2321
- const o = e.recursive !== void 0 ? e.recursive : !0, s = await this.loadFromFolder(i, t, o);
2322
- this._discoveredUrls.push(...s);
2403
+ for (const i of this.sources)
2404
+ if ("folders" in i)
2405
+ for (const e of i.folders) {
2406
+ const n = i.recursive !== void 0 ? i.recursive : !0, a = await this.loadFromFolder(e, t, n);
2407
+ this._discoveredUrls.push(...a);
2323
2408
  }
2324
- else if ("files" in e) {
2325
- const i = await this.loadFiles(e.files, t);
2326
- this._discoveredUrls.push(...i);
2409
+ else if ("files" in i) {
2410
+ const e = await this.loadFiles(i.files, t);
2411
+ this._discoveredUrls.push(...e);
2327
2412
  }
2328
2413
  this._prepared = !0;
2329
2414
  }
@@ -2357,16 +2442,16 @@ class ze {
2357
2442
  * @returns Folder ID or null if invalid
2358
2443
  */
2359
2444
  extractFolderId(t) {
2360
- const e = [
2445
+ const i = [
2361
2446
  /\/folders\/([a-zA-Z0-9_-]+)/,
2362
2447
  // Standard format
2363
2448
  /id=([a-zA-Z0-9_-]+)/
2364
2449
  // Alternative format
2365
2450
  ];
2366
- for (const i of e) {
2367
- const o = t.match(i);
2368
- if (o && o[1])
2369
- return o[1];
2451
+ for (const e of i) {
2452
+ const n = t.match(e);
2453
+ if (n && n[1])
2454
+ return n[1];
2370
2455
  }
2371
2456
  return null;
2372
2457
  }
@@ -2377,16 +2462,16 @@ class ze {
2377
2462
  * @param recursive - Whether to include images from subfolders
2378
2463
  * @returns Promise resolving to array of image URLs
2379
2464
  */
2380
- async loadFromFolder(t, e, i = !0) {
2381
- const o = this.extractFolderId(t);
2382
- if (!o)
2465
+ async loadFromFolder(t, i, e = !0) {
2466
+ const n = this.extractFolderId(t);
2467
+ if (!n)
2383
2468
  throw new Error("Invalid Google Drive folder URL. Please check the URL format.");
2384
2469
  if (!this.apiKey || this.apiKey === "YOUR_API_KEY_HERE")
2385
- return this.loadImagesDirectly(o, e);
2470
+ return this.loadImagesDirectly(n, i);
2386
2471
  try {
2387
- return i ? await this.loadImagesRecursively(o, e) : await this.loadImagesFromSingleFolder(o, e);
2388
- } catch (s) {
2389
- return console.error("Error loading from Google Drive API:", s), this.loadImagesDirectly(o, e);
2472
+ return e ? await this.loadImagesRecursively(n, i) : await this.loadImagesFromSingleFolder(n, i);
2473
+ } catch (a) {
2474
+ return console.error("Error loading from Google Drive API:", a), this.loadImagesDirectly(n, i);
2390
2475
  }
2391
2476
  }
2392
2477
  /**
@@ -2395,16 +2480,16 @@ class ze {
2395
2480
  * @param filter - Filter to apply to discovered images
2396
2481
  * @returns Promise resolving to array of image URLs
2397
2482
  */
2398
- async loadImagesFromSingleFolder(t, e) {
2399
- const i = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2400
- if (!a.ok)
2401
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2402
- const c = (await a.json()).files.filter(
2403
- (u) => u.mimeType.startsWith("image/") && e.isAllowed(u.name)
2483
+ async loadImagesFromSingleFolder(t, i) {
2484
+ const e = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
2485
+ if (!s.ok)
2486
+ throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2487
+ const c = (await s.json()).files.filter(
2488
+ (d) => d.mimeType.startsWith("image/") && i.isAllowed(d.name)
2404
2489
  );
2405
- return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((u) => {
2406
- i.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
2407
- }), i;
2490
+ return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((d) => {
2491
+ e.push(`https://lh3.googleusercontent.com/d/${d.id}=s1600`), this.log(`Added file: ${d.name}`);
2492
+ }), e;
2408
2493
  }
2409
2494
  /**
2410
2495
  * Load specific files by their URLs or IDs
@@ -2412,29 +2497,29 @@ class ze {
2412
2497
  * @param filter - Filter to apply to discovered images
2413
2498
  * @returns Promise resolving to array of image URLs
2414
2499
  */
2415
- async loadFiles(t, e) {
2416
- const i = [];
2417
- for (const o of t) {
2418
- const s = this.extractFileId(o);
2419
- if (!s) {
2420
- this.log(`Skipping invalid file URL: ${o}`);
2500
+ async loadFiles(t, i) {
2501
+ const e = [];
2502
+ for (const n of t) {
2503
+ const a = this.extractFileId(n);
2504
+ if (!a) {
2505
+ this.log(`Skipping invalid file URL: ${n}`);
2421
2506
  continue;
2422
2507
  }
2423
2508
  if (this.apiKey && this.apiKey !== "YOUR_API_KEY_HERE")
2424
2509
  try {
2425
- const r = `${this.apiEndpoint}/${s}?fields=name,mimeType&key=${this.apiKey}`, a = await fetch(r);
2426
- if (a.ok) {
2427
- const h = await a.json();
2428
- 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})`);
2510
+ const r = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(r);
2511
+ if (s.ok) {
2512
+ const h = await s.json();
2513
+ h.mimeType.startsWith("image/") && i.isAllowed(h.name) ? (e.push(`https://lh3.googleusercontent.com/d/${a}=s1600`), this.log(`Added file: ${h.name}`)) : this.log(`Skipping non-image file: ${h.name} (${h.mimeType})`);
2429
2514
  } else
2430
- this.log(`Failed to fetch metadata for file ${s}: ${a.status}`);
2515
+ this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
2431
2516
  } catch (r) {
2432
- this.log(`Error fetching metadata for file ${s}:`, r);
2517
+ this.log(`Error fetching metadata for file ${a}:`, r);
2433
2518
  }
2434
2519
  else
2435
- i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`);
2520
+ e.push(`https://lh3.googleusercontent.com/d/${a}=s1600`);
2436
2521
  }
2437
- return i;
2522
+ return e;
2438
2523
  }
2439
2524
  /**
2440
2525
  * Extract file ID from Google Drive file URL
@@ -2444,7 +2529,7 @@ class ze {
2444
2529
  extractFileId(t) {
2445
2530
  if (!/[/:.]/.test(t))
2446
2531
  return t;
2447
- const e = [
2532
+ const i = [
2448
2533
  /\/file\/d\/([a-zA-Z0-9_-]+)/,
2449
2534
  // Standard file format
2450
2535
  /\/open\?id=([a-zA-Z0-9_-]+)/,
@@ -2452,10 +2537,10 @@ class ze {
2452
2537
  /id=([a-zA-Z0-9_-]+)/
2453
2538
  // Generic id parameter
2454
2539
  ];
2455
- for (const i of e) {
2456
- const o = t.match(i);
2457
- if (o && o[1])
2458
- return o[1];
2540
+ for (const e of i) {
2541
+ const n = t.match(e);
2542
+ if (n && n[1])
2543
+ return n[1];
2459
2544
  }
2460
2545
  return null;
2461
2546
  }
@@ -2465,24 +2550,24 @@ class ze {
2465
2550
  * @param filter - Filter to apply to discovered images
2466
2551
  * @returns Promise resolving to array of image URLs
2467
2552
  */
2468
- async loadImagesRecursively(t, e) {
2469
- const i = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2470
- if (!a.ok)
2471
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2472
- const h = await a.json(), c = h.files.filter(
2473
- (l) => l.mimeType.startsWith("image/") && e.isAllowed(l.name)
2474
- ), u = h.files.filter(
2553
+ async loadImagesRecursively(t, i) {
2554
+ const e = [], n = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(n)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
2555
+ if (!s.ok)
2556
+ throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2557
+ const h = await s.json(), c = h.files.filter(
2558
+ (l) => l.mimeType.startsWith("image/") && i.isAllowed(l.name)
2559
+ ), d = h.files.filter(
2475
2560
  (l) => l.mimeType === "application/vnd.google-apps.folder"
2476
2561
  );
2477
- this.log(`Found ${h.files.length} total items in folder ${t}`), h.files.forEach((l) => this.log(` - File: ${l.name} (${l.mimeType})`)), this.log(`- ${c.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), c.forEach((l) => {
2478
- i.push(`https://lh3.googleusercontent.com/d/${l.id}=s1600`), this.log(`Added file: ${l.name}`);
2562
+ this.log(`Found ${h.files.length} total items in folder ${t}`), h.files.forEach((l) => this.log(` - File: ${l.name} (${l.mimeType})`)), this.log(`- ${c.length} valid files (images only)`), this.log(`- ${d.length} subfolders`), c.forEach((l) => {
2563
+ e.push(`https://lh3.googleusercontent.com/d/${l.id}=s1600`), this.log(`Added file: ${l.name}`);
2479
2564
  });
2480
- for (const l of u) {
2565
+ for (const l of d) {
2481
2566
  this.log(`Loading images from subfolder: ${l.name}`);
2482
- const d = await this.loadImagesRecursively(l.id, e);
2483
- i.push(...d);
2567
+ const u = await this.loadImagesRecursively(l.id, i);
2568
+ e.push(...u);
2484
2569
  }
2485
- return i;
2570
+ return e;
2486
2571
  }
2487
2572
  /**
2488
2573
  * Direct loading method (no API key required, but less reliable)
@@ -2491,17 +2576,17 @@ class ze {
2491
2576
  * @param filter - Filter to apply (not used in fallback mode)
2492
2577
  * @returns Promise resolving to array of image URLs
2493
2578
  */
2494
- async loadImagesDirectly(t, e) {
2579
+ async loadImagesDirectly(t, i) {
2495
2580
  try {
2496
- const i = `https://drive.google.com/embeddedfolderview?id=${t}`, o = await fetch(i, { mode: "cors" });
2497
- if (!o.ok)
2581
+ const e = `https://drive.google.com/embeddedfolderview?id=${t}`, n = await fetch(e, { mode: "cors" });
2582
+ if (!n.ok)
2498
2583
  throw new Error("Cannot access folder directly (CORS or permissions issue)");
2499
- const s = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...s.matchAll(r)];
2500
- return [...new Set(a.map((u) => u[1]))].map(
2501
- (u) => `https://drive.google.com/uc?export=view&id=${u}`
2584
+ const a = await n.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, s = [...a.matchAll(r)];
2585
+ return [...new Set(s.map((d) => d[1]))].map(
2586
+ (d) => `https://drive.google.com/uc?export=view&id=${d}`
2502
2587
  );
2503
- } catch (i) {
2504
- throw console.error("Direct loading failed:", i), new Error(
2588
+ } catch (e) {
2589
+ throw console.error("Direct loading failed:", e), new Error(
2505
2590
  `Unable to load images. Please ensure:
2506
2591
  1. The folder is shared publicly (Anyone with the link can view)
2507
2592
  2. The folder contains image files
@@ -2515,7 +2600,7 @@ class ze {
2515
2600
  * @returns Array of direct image URLs
2516
2601
  */
2517
2602
  manualImageUrls(t) {
2518
- return t.map((e) => `https://drive.google.com/uc?export=view&id=${e}`);
2603
+ return t.map((i) => `https://drive.google.com/uc?export=view&id=${i}`);
2519
2604
  }
2520
2605
  /**
2521
2606
  * Debug logging helper
@@ -2525,7 +2610,7 @@ class ze {
2525
2610
  this.debugLogging && typeof console < "u" && console.log(...t);
2526
2611
  }
2527
2612
  }
2528
- class Fe {
2613
+ class De {
2529
2614
  constructor(t) {
2530
2615
  if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = t.validateUrls !== !1, this.validationTimeout = t.validationTimeout ?? 5e3, this.validationMethod = t.validationMethod ?? "head", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
2531
2616
  throw new Error("StaticImageLoader requires at least one source to be configured");
@@ -2537,12 +2622,12 @@ class Fe {
2537
2622
  */
2538
2623
  async prepare(t) {
2539
2624
  this._discoveredUrls = [], this.log(`Processing ${this.sources.length} source(s)`);
2540
- for (const e of this.sources)
2625
+ for (const i of this.sources)
2541
2626
  try {
2542
- const i = await this.processSource(e, t);
2543
- this._discoveredUrls.push(...i);
2544
- } catch (i) {
2545
- console.warn("Failed to process source:", e, i);
2627
+ const e = await this.processSource(i, t);
2628
+ this._discoveredUrls.push(...e);
2629
+ } catch (e) {
2630
+ console.warn("Failed to process source:", i, e);
2546
2631
  }
2547
2632
  this._prepared = !0, this.log(`Successfully loaded ${this._discoveredUrls.length} image(s)`);
2548
2633
  }
@@ -2576,8 +2661,8 @@ class Fe {
2576
2661
  * @param filter - Filter to apply to discovered images
2577
2662
  * @returns Promise resolving to array of valid URLs from this source
2578
2663
  */
2579
- async processSource(t, e) {
2580
- return t ? "urls" in t ? await this.processUrls(t.urls, e) : "path" in t ? await this.processPath(t.path, t.files, e) : "json" in t ? await this.processJson(t.json, e) : (console.warn("Unknown source shape:", t), []) : (console.warn("Invalid source object:", t), []);
2664
+ async processSource(t, i) {
2665
+ return t ? "urls" in t ? await this.processUrls(t.urls, i) : "path" in t ? await this.processPath(t.path, t.files, i) : "json" in t ? await this.processJson(t.json, i) : (console.warn("Unknown source shape:", t), []) : (console.warn("Invalid source object:", t), []);
2581
2666
  }
2582
2667
  /**
2583
2668
  * Process a list of direct URLs
@@ -2585,19 +2670,19 @@ class Fe {
2585
2670
  * @param filter - Filter to apply to discovered images
2586
2671
  * @returns Promise resolving to array of validated URLs
2587
2672
  */
2588
- async processUrls(t, e) {
2673
+ async processUrls(t, i) {
2589
2674
  if (!Array.isArray(t))
2590
2675
  return console.warn("URLs must be an array:", t), [];
2591
- const i = [];
2592
- for (const o of t) {
2593
- const s = o.split("/").pop() || o;
2594
- if (!e.isAllowed(s)) {
2595
- this.log(`Skipping filtered URL: ${o}`);
2676
+ const e = [];
2677
+ for (const n of t) {
2678
+ const a = n.split("/").pop() || n;
2679
+ if (!i.isAllowed(a)) {
2680
+ this.log(`Skipping filtered URL: ${n}`);
2596
2681
  continue;
2597
2682
  }
2598
- this.validateUrls ? await this.validateUrl(o) ? i.push(o) : console.warn(`Skipping invalid/missing URL: ${o}`) : i.push(o);
2683
+ this.validateUrls ? await this.validateUrl(n) ? e.push(n) : console.warn(`Skipping invalid/missing URL: ${n}`) : e.push(n);
2599
2684
  }
2600
- return i;
2685
+ return e;
2601
2686
  }
2602
2687
  /**
2603
2688
  * Process a path-based source
@@ -2606,19 +2691,19 @@ class Fe {
2606
2691
  * @param filter - Filter to apply to discovered images
2607
2692
  * @returns Promise resolving to array of validated URLs
2608
2693
  */
2609
- async processPath(t, e, i) {
2610
- if (!Array.isArray(e))
2611
- return console.warn("files must be an array:", e), [];
2612
- const o = [];
2613
- for (const s of e) {
2614
- if (!i.isAllowed(s)) {
2615
- this.log(`Skipping filtered file: ${s}`);
2694
+ async processPath(t, i, e) {
2695
+ if (!Array.isArray(i))
2696
+ return console.warn("files must be an array:", i), [];
2697
+ const n = [];
2698
+ for (const a of i) {
2699
+ if (!e.isAllowed(a)) {
2700
+ this.log(`Skipping filtered file: ${a}`);
2616
2701
  continue;
2617
2702
  }
2618
- const r = this.constructUrl(t, s);
2619
- this.validateUrls ? await this.validateUrl(r) ? o.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : o.push(r);
2703
+ const r = this.constructUrl(t, a);
2704
+ this.validateUrls ? await this.validateUrl(r) ? n.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : n.push(r);
2620
2705
  }
2621
- return o;
2706
+ return n;
2622
2707
  }
2623
2708
  /**
2624
2709
  * Process a JSON endpoint source
@@ -2627,19 +2712,19 @@ class Fe {
2627
2712
  * @param filter - Filter to apply to discovered images
2628
2713
  * @returns Promise resolving to array of validated URLs
2629
2714
  */
2630
- async processJson(t, e) {
2715
+ async processJson(t, i) {
2631
2716
  this.log(`Fetching JSON endpoint: ${t}`);
2632
- const i = new AbortController(), o = setTimeout(() => i.abort(), 1e4);
2717
+ const e = new AbortController(), n = setTimeout(() => e.abort(), 1e4);
2633
2718
  try {
2634
- const s = await fetch(t, { signal: i.signal });
2635
- if (clearTimeout(o), !s.ok)
2636
- throw new Error(`HTTP ${s.status} fetching ${t}`);
2637
- const r = await s.json();
2719
+ const a = await fetch(t, { signal: e.signal });
2720
+ if (clearTimeout(n), !a.ok)
2721
+ throw new Error(`HTTP ${a.status} fetching ${t}`);
2722
+ const r = await a.json();
2638
2723
  if (!r || !Array.isArray(r.images))
2639
2724
  throw new Error('JSON source must return JSON with shape { "images": ["url1", "url2", ...] }');
2640
- return this.log(`JSON endpoint returned ${r.images.length} image(s)`), await this.processUrls(r.images, e);
2641
- } catch (s) {
2642
- throw clearTimeout(o), s instanceof Error && s.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : s;
2725
+ return this.log(`JSON endpoint returned ${r.images.length} image(s)`), await this.processUrls(r.images, i);
2726
+ } catch (a) {
2727
+ throw clearTimeout(n), a instanceof Error && a.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : a;
2643
2728
  }
2644
2729
  }
2645
2730
  /**
@@ -2661,13 +2746,13 @@ class Fe {
2661
2746
  if (!(t.startsWith(window.location.origin) || t.startsWith("/")))
2662
2747
  return this.log(`Skipping validation for cross-origin URL: ${t}`), !0;
2663
2748
  try {
2664
- const i = new AbortController(), o = setTimeout(() => i.abort(), this.validationTimeout), s = await fetch(t, {
2749
+ const e = new AbortController(), n = setTimeout(() => e.abort(), this.validationTimeout), a = await fetch(t, {
2665
2750
  method: "HEAD",
2666
- signal: i.signal
2751
+ signal: e.signal
2667
2752
  });
2668
- return clearTimeout(o), s.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${s.status}`), !1);
2669
- } catch (i) {
2670
- return i instanceof Error && (i.name === "AbortError" ? this.log(`Validation timeout for ${t}`) : this.log(`Validation failed for ${t}:`, i.message)), !1;
2753
+ return clearTimeout(n), a.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${a.status}`), !1);
2754
+ } catch (e) {
2755
+ return e instanceof Error && (e.name === "AbortError" ? this.log(`Validation timeout for ${t}`) : this.log(`Validation failed for ${t}:`, e.message)), !1;
2671
2756
  }
2672
2757
  }
2673
2758
  /**
@@ -2676,14 +2761,14 @@ class Fe {
2676
2761
  * @param filename - Filename to append
2677
2762
  * @returns Complete URL
2678
2763
  */
2679
- constructUrl(t, e) {
2680
- const i = t.replace(/\/$/, "");
2764
+ constructUrl(t, i) {
2765
+ const e = t.replace(/\/$/, "");
2681
2766
  if (this.isAbsoluteUrl(t))
2682
- return `${i}/${e}`;
2767
+ return `${e}/${i}`;
2683
2768
  if (typeof window > "u")
2684
- return `${i}/${e}`;
2685
- const o = window.location.origin, r = (t.startsWith("/") ? t : "/" + t).replace(/\/$/, "");
2686
- return `${o}${r}/${e}`;
2769
+ return `${e}/${i}`;
2770
+ const n = window.location.origin, r = (t.startsWith("/") ? t : "/" + t).replace(/\/$/, "");
2771
+ return `${n}${r}/${i}`;
2687
2772
  }
2688
2773
  /**
2689
2774
  * Check if URL is absolute (contains protocol)
@@ -2705,7 +2790,7 @@ class Fe {
2705
2790
  this.debugLogging && typeof console < "u" && console.log(...t);
2706
2791
  }
2707
2792
  }
2708
- class De {
2793
+ class Pe {
2709
2794
  constructor(t) {
2710
2795
  if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
2711
2796
  throw new Error("CompositeLoader requires at least one loader to be configured");
@@ -2717,16 +2802,16 @@ class De {
2717
2802
  */
2718
2803
  async prepare(t) {
2719
2804
  this._discoveredUrls = [], this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);
2720
- const e = this.loaders.map((i, o) => i.prepare(t).then(() => {
2721
- this.log(`Loader ${o} prepared with ${i.imagesLength()} images`);
2722
- }).catch((s) => {
2723
- console.warn(`Loader ${o} failed to prepare:`, s);
2805
+ const i = this.loaders.map((e, n) => e.prepare(t).then(() => {
2806
+ this.log(`Loader ${n} prepared with ${e.imagesLength()} images`);
2807
+ }).catch((a) => {
2808
+ console.warn(`Loader ${n} failed to prepare:`, a);
2724
2809
  }));
2725
- await Promise.all(e);
2726
- for (const i of this.loaders)
2727
- if (i.isPrepared()) {
2728
- const o = i.imageURLs();
2729
- this._discoveredUrls.push(...o);
2810
+ await Promise.all(i);
2811
+ for (const e of this.loaders)
2812
+ if (e.isPrepared()) {
2813
+ const n = e.imageURLs();
2814
+ this._discoveredUrls.push(...n);
2730
2815
  }
2731
2816
  this._prepared = !0, this.log(`CompositeLoader prepared with ${this._discoveredUrls.length} total images`);
2732
2817
  }
@@ -2762,7 +2847,7 @@ class De {
2762
2847
  this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
2763
2848
  }
2764
2849
  }
2765
- class Oe {
2850
+ class Ue {
2766
2851
  /**
2767
2852
  * Create a new ImageFilter
2768
2853
  * @param extensions - Array of allowed file extensions (without dots)
@@ -2784,8 +2869,8 @@ class Oe {
2784
2869
  * @returns True if the file extension is allowed
2785
2870
  */
2786
2871
  isAllowed(t) {
2787
- const i = t.split("?")[0].split(".").pop()?.toLowerCase();
2788
- return i ? this.allowedExtensions.includes(i) : !1;
2872
+ const e = t.split("?")[0].split(".").pop()?.toLowerCase();
2873
+ return e ? this.allowedExtensions.includes(e) : !1;
2789
2874
  }
2790
2875
  /**
2791
2876
  * Get the list of allowed extensions
@@ -2799,7 +2884,7 @@ class Oe {
2799
2884
  // isAllowedDate(date: Date): boolean
2800
2885
  // isAllowedDimensions(width: number, height: number): boolean
2801
2886
  }
2802
- const $e = `
2887
+ const _e = `
2803
2888
  .fbn-ic-gallery {
2804
2889
  position: relative;
2805
2890
  width: 100%;
@@ -2849,22 +2934,22 @@ const $e = `
2849
2934
  display: none !important;
2850
2935
  }
2851
2936
  `;
2852
- function Pe() {
2937
+ function He() {
2853
2938
  if (typeof document > "u") return;
2854
- const n = "fbn-ic-functional-styles";
2855
- if (document.getElementById(n)) return;
2939
+ const o = "fbn-ic-functional-styles";
2940
+ if (document.getElementById(o)) return;
2856
2941
  const t = document.createElement("style");
2857
- t.id = n, t.textContent = $e, document.head.appendChild(t);
2942
+ t.id = o, t.textContent = _e, document.head.appendChild(t);
2858
2943
  }
2859
- let Ue = class {
2944
+ let je = class {
2860
2945
  constructor(t = {}) {
2861
- this.fullConfig = Xt(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.loadingElAutoCreated = !1, this.errorElAutoCreated = !1, this.counterEl = null, this.counterElAutoCreated = !1, this.animationEngine = new Kt(this.fullConfig.animation), this.layoutEngine = new ve({
2946
+ this.fullConfig = Yt(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.loadingElAutoCreated = !1, this.errorElAutoCreated = !1, this.counterEl = null, this.counterElAutoCreated = !1, this.animationEngine = new Kt(this.fullConfig.animation), this.layoutEngine = new ve({
2862
2947
  layout: this.fullConfig.layout,
2863
2948
  image: this.fullConfig.image
2864
- }), this.zoomEngine = new Ie(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = st(this.fullConfig.styling?.default), this.hoverStyles = st(this.fullConfig.styling?.hover), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
2865
- const e = this.fullConfig.animation.entry || y.animation.entry;
2949
+ }), this.zoomEngine = new Ce(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = tt(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
2950
+ const i = this.fullConfig.animation.entry || y.animation.entry;
2866
2951
  this.entryAnimationEngine = new ce(
2867
- e,
2952
+ i,
2868
2953
  this.fullConfig.layout.algorithm
2869
2954
  ), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
2870
2955
  }
@@ -2873,43 +2958,43 @@ let Ue = class {
2873
2958
  */
2874
2959
  createImageFilter() {
2875
2960
  const t = this.fullConfig.config.loaders?.allowedExtensions;
2876
- return new Oe(t);
2961
+ return new Ue(t);
2877
2962
  }
2878
2963
  /**
2879
2964
  * Create appropriate image loader based on config
2880
2965
  * Processes loaders array, merges shared config, wraps in CompositeLoader if needed
2881
2966
  */
2882
2967
  createLoader() {
2883
- const t = this.fullConfig.loaders, e = this.fullConfig.config.loaders ?? {};
2968
+ const t = this.fullConfig.loaders, i = this.fullConfig.config.loaders ?? {};
2884
2969
  if (!t || t.length === 0)
2885
2970
  throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
2886
- const i = t.map((o) => this.createLoaderFromEntry(o, e));
2887
- return i.length === 1 ? i[0] : new De({
2888
- loaders: i,
2971
+ const e = t.map((n) => this.createLoaderFromEntry(n, i));
2972
+ return e.length === 1 ? e[0] : new Pe({
2973
+ loaders: e,
2889
2974
  debugLogging: this.fullConfig.config.debug?.loaders
2890
2975
  });
2891
2976
  }
2892
2977
  /**
2893
2978
  * Create a single loader from a LoaderEntry, merging shared config
2894
2979
  */
2895
- createLoaderFromEntry(t, e) {
2980
+ createLoaderFromEntry(t, i) {
2896
2981
  if ("static" in t) {
2897
- const i = t.static, o = {
2898
- ...i,
2899
- validateUrls: i.validateUrls ?? e.validateUrls,
2900
- validationTimeout: i.validationTimeout ?? e.validationTimeout,
2901
- validationMethod: i.validationMethod ?? e.validationMethod,
2902
- allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2903
- debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
2982
+ const e = t.static, n = {
2983
+ ...e,
2984
+ validateUrls: e.validateUrls ?? i.validateUrls,
2985
+ validationTimeout: e.validationTimeout ?? i.validationTimeout,
2986
+ validationMethod: e.validationMethod ?? i.validationMethod,
2987
+ allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
2988
+ debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
2904
2989
  };
2905
- return new Fe(o);
2990
+ return new De(n);
2906
2991
  } else if ("googleDrive" in t) {
2907
- const i = t.googleDrive, o = {
2908
- ...i,
2909
- allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2910
- debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
2992
+ const e = t.googleDrive, n = {
2993
+ ...e,
2994
+ allowedExtensions: e.allowedExtensions ?? i.allowedExtensions,
2995
+ debugLogging: e.debugLogging ?? this.fullConfig.config.debug?.loaders
2911
2996
  };
2912
- return new ze(o);
2997
+ return new $e(n);
2913
2998
  } else
2914
2999
  throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
2915
3000
  }
@@ -2918,16 +3003,16 @@ let Ue = class {
2918
3003
  */
2919
3004
  async init() {
2920
3005
  try {
2921
- if (Pe(), this.containerRef)
3006
+ if (He(), this.containerRef)
2922
3007
  this.containerEl = this.containerRef;
2923
3008
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
2924
3009
  throw new Error(`Container #${this.containerId} not found`);
2925
- this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new mt(this.containerEl, {
3010
+ this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new pt(this.containerEl, {
2926
3011
  onNext: () => this.navigateToNextImage(),
2927
3012
  onPrev: () => this.navigateToPreviousImage(),
2928
3013
  onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
2929
3014
  onDragEnd: (t) => {
2930
- t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Me);
3015
+ t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, ze);
2931
3016
  }
2932
3017
  }), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
2933
3018
  } catch (t) {
@@ -2944,10 +3029,10 @@ let Ue = class {
2944
3029
  createDefaultLoadingElement() {
2945
3030
  const t = document.createElement("div");
2946
3031
  t.className = "fbn-ic-loading fbn-ic-hidden";
2947
- const e = document.createElement("div");
2948
- e.className = "fbn-ic-spinner", t.appendChild(e);
2949
- const i = document.createElement("p");
2950
- return i.textContent = "Loading images...", t.appendChild(i), this.containerEl.appendChild(t), t;
3032
+ const i = document.createElement("div");
3033
+ i.className = "fbn-ic-spinner", t.appendChild(i);
3034
+ const e = document.createElement("p");
3035
+ return e.textContent = "Loading images...", t.appendChild(e), this.containerEl.appendChild(t), t;
2951
3036
  }
2952
3037
  createDefaultErrorElement() {
2953
3038
  const t = document.createElement("div");
@@ -2969,24 +3054,24 @@ let Ue = class {
2969
3054
  */
2970
3055
  navigateToNextImage() {
2971
3056
  if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
2972
- const t = (this.currentFocusIndex + 1) % this.imageLayouts.length, e = this.imageElements.find(
2973
- (o) => o.dataset.imageId === String(t)
3057
+ const t = (this.currentFocusIndex + 1) % this.imageLayouts.length, i = this.imageElements.find(
3058
+ (n) => n.dataset.imageId === String(t)
2974
3059
  );
2975
- if (!e) return;
2976
- const i = this.imageLayouts[t];
2977
- i && (this.currentFocusIndex = t, this.handleImageClick(e, i), this.updateCounter(t));
3060
+ if (!i) return;
3061
+ const e = this.imageLayouts[t];
3062
+ e && (this.currentFocusIndex = t, this.handleImageClick(i, e), this.updateCounter(t));
2978
3063
  }
2979
3064
  /**
2980
3065
  * Navigate to the previous image (Left arrow)
2981
3066
  */
2982
3067
  navigateToPreviousImage() {
2983
3068
  if (this.currentFocusIndex === null || this.imageElements.length === 0) return;
2984
- const t = (this.currentFocusIndex - 1 + this.imageLayouts.length) % this.imageLayouts.length, e = this.imageElements.find(
2985
- (o) => o.dataset.imageId === String(t)
3069
+ const t = (this.currentFocusIndex - 1 + this.imageLayouts.length) % this.imageLayouts.length, i = this.imageElements.find(
3070
+ (n) => n.dataset.imageId === String(t)
2986
3071
  );
2987
- if (!e) return;
2988
- const i = this.imageLayouts[t];
2989
- i && (this.currentFocusIndex = t, this.handleImageClick(e, i), this.updateCounter(t));
3072
+ if (!i) return;
3073
+ const e = this.imageLayouts[t];
3074
+ e && (this.currentFocusIndex = t, this.handleImageClick(i, e), this.updateCounter(t));
2990
3075
  }
2991
3076
  /**
2992
3077
  * Navigate to a specific image by index
@@ -2998,8 +3083,8 @@ let Ue = class {
2998
3083
  }, 500));
2999
3084
  }
3000
3085
  getImageHeight() {
3001
- const t = window.innerWidth, e = this.fullConfig.layout.responsive, o = this.fullConfig.image.sizing?.maxSize ?? 400;
3002
- 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);
3086
+ const t = window.innerWidth, i = this.fullConfig.layout.responsive, n = this.fullConfig.image.sizing?.maxSize ?? 400;
3087
+ return i ? t <= i.mobile.maxWidth ? Math.min(100, n) : t <= i.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);
3003
3088
  }
3004
3089
  /**
3005
3090
  * Get container bounds for layout calculations
@@ -3017,20 +3102,20 @@ let Ue = class {
3017
3102
  try {
3018
3103
  this.showLoading(!0), this.hideError(), this.clearImageCloud(), await this.imageLoader.prepare(this.imageFilter);
3019
3104
  const t = this.imageLoader.imagesLength();
3020
- let e = this.imageLoader.imageURLs();
3105
+ let i = this.imageLoader.imageURLs();
3021
3106
  if (t === 0) {
3022
3107
  this.showError("No images found."), this.showLoading(!1);
3023
3108
  return;
3024
3109
  }
3025
- const i = this.getContainerBounds(), o = this.getImageHeight(), s = window.innerWidth;
3026
- this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${o}px`);
3110
+ const e = this.getContainerBounds(), n = this.getImageHeight(), a = window.innerWidth;
3111
+ this.logDebug(`Adaptive sizing input: container=${e.width}x${e.height}px, images=${t}, responsiveMax=${n}px`);
3027
3112
  const r = this.layoutEngine.calculateAdaptiveSize(
3028
- i,
3113
+ e,
3029
3114
  t,
3030
- o,
3031
- s
3115
+ n,
3116
+ a
3032
3117
  );
3033
- this.logDebug(`Adaptive sizing result: height=${r.height}px`), await this.createImageCloud(e, r.height), this.showLoading(!1), this.imagesLoaded = !0;
3118
+ this.logDebug(`Adaptive sizing result: height=${r.height}px`), await this.createImageCloud(i, r.height), this.showLoading(!1), this.imagesLoaded = !0;
3034
3119
  } catch (t) {
3035
3120
  console.error("Error loading images:", t), t instanceof Error && this.showError(t.message || "Failed to load images."), this.showLoading(!1);
3036
3121
  }
@@ -3041,32 +3126,32 @@ let Ue = class {
3041
3126
  logDebug(...t) {
3042
3127
  this.fullConfig.config.debug?.enabled && typeof console < "u" && console.log(...t);
3043
3128
  }
3044
- async createImageCloud(t, e) {
3129
+ async createImageCloud(t, i) {
3045
3130
  if (!this.containerEl) return;
3046
- const i = this.getContainerBounds();
3047
- this.currentImageHeight = e;
3048
- const o = this.loadGeneration, s = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
3049
- this.imageLayouts = s, this.displayQueue = [];
3131
+ const e = this.getContainerBounds();
3132
+ this.currentImageHeight = i;
3133
+ const n = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, e, { fixedHeight: i });
3134
+ this.imageLayouts = a, this.displayQueue = [];
3050
3135
  let r = 0;
3051
- const a = (c) => {
3136
+ const s = (c) => {
3052
3137
  this.containerEl && (this.containerEl.appendChild(c), this.imageElements.push(c), requestAnimationFrame(() => {
3053
3138
  if (c.offsetWidth, c.style.opacity = this.defaultStyles.opacity ?? "1", c.dataset.startX && (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || c.dataset.startRotation !== c.dataset.rotation || c.dataset.startScale !== c.dataset.scale)) {
3054
- const d = {
3139
+ const u = {
3055
3140
  x: parseFloat(c.dataset.startX),
3056
3141
  y: parseFloat(c.dataset.startY)
3057
- }, f = {
3142
+ }, g = {
3058
3143
  x: parseFloat(c.dataset.endX),
3059
3144
  y: parseFloat(c.dataset.endY)
3060
- }, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation), m = parseFloat(c.dataset.scale), S = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : g, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : m, w = this.entryAnimationEngine.getTiming();
3145
+ }, p = parseFloat(c.dataset.imageWidth), b = parseFloat(c.dataset.imageHeight), f = parseFloat(c.dataset.rotation), m = parseFloat(c.dataset.scale), S = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : f, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : m, w = this.entryAnimationEngine.getTiming();
3061
3146
  se({
3062
3147
  element: c,
3063
- startPosition: d,
3064
- endPosition: f,
3148
+ startPosition: u,
3149
+ endPosition: g,
3065
3150
  pathConfig: this.entryAnimationEngine.getPathConfig(),
3066
3151
  duration: w.duration,
3067
- imageWidth: b,
3068
- imageHeight: p,
3069
- rotation: g,
3152
+ imageWidth: p,
3153
+ imageHeight: b,
3154
+ rotation: f,
3070
3155
  scale: m,
3071
3156
  rotationConfig: this.entryAnimationEngine.getRotationConfig(),
3072
3157
  startRotation: S,
@@ -3074,12 +3159,12 @@ let Ue = class {
3074
3159
  startScale: v
3075
3160
  });
3076
3161
  } else {
3077
- const d = c.dataset.finalTransform || "";
3078
- c.style.transform = d;
3162
+ const u = c.dataset.finalTransform || "";
3163
+ c.style.transform = u;
3079
3164
  }
3080
3165
  const l = parseInt(c.dataset.imageId || "0");
3081
3166
  if (this.fullConfig.config.debug?.enabled && l < 3) {
3082
- const d = c.dataset.finalTransform || "";
3167
+ const u = c.dataset.finalTransform || "";
3083
3168
  console.log(`Image ${l} final state:`, {
3084
3169
  left: c.style.left,
3085
3170
  top: c.style.top,
@@ -3087,7 +3172,7 @@ let Ue = class {
3087
3172
  height: c.style.height,
3088
3173
  computedWidth: c.offsetWidth,
3089
3174
  computedHeight: c.offsetHeight,
3090
- transform: d,
3175
+ transform: u,
3091
3176
  pathType: this.entryAnimationEngine.getPathType()
3092
3177
  });
3093
3178
  }
@@ -3096,95 +3181,101 @@ let Ue = class {
3096
3181
  if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
3097
3182
  for (; this.displayQueue.length > 0; ) {
3098
3183
  const c = this.displayQueue.shift();
3099
- c && a(c);
3184
+ c && s(c);
3100
3185
  }
3101
3186
  return;
3102
3187
  }
3103
3188
  this.queueInterval !== null && clearInterval(this.queueInterval), this.queueInterval = window.setInterval(() => {
3104
- if (o !== this.loadGeneration) {
3189
+ if (n !== this.loadGeneration) {
3105
3190
  this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3106
3191
  return;
3107
3192
  }
3108
3193
  if (this.displayQueue.length > 0) {
3109
3194
  const c = this.displayQueue.shift();
3110
- c && a(c);
3195
+ c && s(c);
3111
3196
  }
3112
3197
  r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3113
3198
  }, this.fullConfig.animation.queue.interval);
3114
3199
  };
3115
3200
  if ("IntersectionObserver" in window && this.containerEl) {
3116
- const c = new IntersectionObserver((u) => {
3117
- u.forEach((l) => {
3201
+ const c = new IntersectionObserver((d) => {
3202
+ d.forEach((l) => {
3118
3203
  l.isIntersecting && (h(), c.disconnect());
3119
3204
  });
3120
3205
  }, { threshold: 0.1, rootMargin: "50px" });
3121
3206
  c.observe(this.containerEl);
3122
3207
  } else
3123
3208
  h();
3124
- this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), s.forEach((c, u) => {
3209
+ this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), a.forEach((c, d) => {
3125
3210
  const l = document.createElement("div");
3126
3211
  l.className = "fbn-ic-debug-center", l.style.position = "absolute", l.style.width = "12px", l.style.height = "12px", l.style.borderRadius = "50%", l.style.backgroundColor = "red", l.style.border = "2px solid yellow", l.style.zIndex = "9999", l.style.pointerEvents = "none";
3127
- const d = c.x, f = c.y;
3128
- l.style.left = `${d - 6}px`, l.style.top = `${f - 6}px`, l.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(l);
3129
- })), t.forEach((c, u) => {
3212
+ const u = c.x, g = c.y;
3213
+ l.style.left = `${u - 6}px`, l.style.top = `${g - 6}px`, l.title = `Image ${d}: center (${Math.round(u)}, ${Math.round(g)})`, this.containerEl.appendChild(l);
3214
+ })), t.forEach((c, d) => {
3130
3215
  const l = document.createElement("img");
3131
- l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(u);
3132
- const d = s[u];
3133
- l.style.position = "absolute", l.style.width = "auto", l.style.height = `${e}px`, l.style.left = `${d.x}px`, l.style.top = `${d.y}px`, d.zIndex && (l.style.zIndex = String(d.zIndex)), tt(l, this.defaultStyles), et(l, this.defaultClassName), l.addEventListener("mouseenter", () => {
3134
- this.hoveredImage = { element: l, layout: d }, this.zoomEngine.isInvolved(l) || (tt(l, this.hoverStyles), et(l, this.hoverClassName));
3216
+ l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(d), l.dataset.createdFlag = "true";
3217
+ const u = a[d];
3218
+ l.style.position = "absolute", l.style.width = "auto", l.style.height = `${i}px`, l.style.left = `${u.x}px`, l.style.top = `${u.y}px`, u.zIndex && (l.style.zIndex = String(u.zIndex)), nt(l, this.defaultClassName), l.addEventListener("mouseenter", () => {
3219
+ if (this.hoveredImage = { element: l, layout: u }, !this.zoomEngine.isInvolved(l)) {
3220
+ const g = l.cachedRenderedWidth;
3221
+ gt(l, this.fullConfig.styling?.hover, i, g), nt(l, this.hoverClassName);
3222
+ }
3135
3223
  }), l.addEventListener("mouseleave", () => {
3136
- this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles), Ft(l, this.hoverClassName), et(l, this.defaultClassName));
3137
- }), l.addEventListener("click", (f) => {
3138
- f.stopPropagation(), this.handleImageClick(l, d);
3224
+ if (this.hoveredImage = null, !this.zoomEngine.isInvolved(l)) {
3225
+ const g = l.cachedRenderedWidth;
3226
+ gt(l, this.fullConfig.styling?.default, i, g), mt(l, this.hoverClassName), nt(l, this.defaultClassName);
3227
+ }
3228
+ }), l.addEventListener("click", (g) => {
3229
+ g.stopPropagation(), this.handleImageClick(l, u);
3139
3230
  }), l.style.opacity = "0", l.style.transition = this.entryAnimationEngine.getTransitionCSS(), l.onload = () => {
3140
- if (o !== this.loadGeneration)
3231
+ if (n !== this.loadGeneration)
3141
3232
  return;
3142
- const f = l.naturalWidth / l.naturalHeight, b = e * f;
3143
- l.style.width = `${b}px`;
3144
- const p = { x: d.x, y: d.y }, g = { width: b, height: e }, m = this.entryAnimationEngine.calculateStartPosition(
3145
- p,
3146
- g,
3147
- i,
3148
- u,
3149
- t.length
3150
- ), S = this.entryAnimationEngine.calculateStartRotation(d.rotation), v = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
3151
- d.rotation,
3152
- d.scale,
3233
+ const g = l.naturalWidth / l.naturalHeight, p = i * g;
3234
+ l.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${d}] Called with imageHeight=${i}, renderedWidth=${p}`), l.style.width = `${p}px`, l.cachedRenderedWidth = p, l.aspectRatio = g, gt(l, this.fullConfig.styling?.default, i, p);
3235
+ const b = { x: u.x, y: u.y }, f = { width: p, height: i }, m = this.entryAnimationEngine.calculateStartPosition(
3153
3236
  b,
3154
- e
3237
+ f,
3238
+ e,
3239
+ d,
3240
+ t.length
3241
+ ), S = this.entryAnimationEngine.calculateStartRotation(u.rotation), v = this.entryAnimationEngine.calculateStartScale(u.scale), w = this.entryAnimationEngine.buildFinalTransform(
3242
+ u.rotation,
3243
+ u.scale,
3244
+ p,
3245
+ i
3155
3246
  ), E = this.entryAnimationEngine.buildStartTransform(
3156
3247
  m,
3157
- p,
3158
- d.rotation,
3159
- d.scale,
3160
3248
  b,
3161
- e,
3249
+ u.rotation,
3250
+ u.scale,
3251
+ p,
3252
+ i,
3162
3253
  S,
3163
3254
  v
3164
3255
  );
3165
- this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
3166
- finalPosition: p,
3167
- imageSize: g,
3168
- left: d.x,
3169
- top: d.y,
3256
+ this.fullConfig.config.debug?.enabled && d < 3 && console.log(`Image ${d}:`, {
3257
+ finalPosition: b,
3258
+ imageSize: f,
3259
+ left: u.x,
3260
+ top: u.y,
3170
3261
  finalTransform: w,
3171
- renderedWidth: b,
3172
- renderedHeight: e
3173
- }), l.style.transform = E, l.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || S !== d.rotation || v !== d.scale) && (l.dataset.startX = String(m.x), l.dataset.startY = String(m.y), l.dataset.endX = String(p.x), l.dataset.endY = String(p.y), l.dataset.imageWidth = String(b), l.dataset.imageHeight = String(e), l.dataset.rotation = String(d.rotation), l.dataset.scale = String(d.scale), l.dataset.startRotation = String(S), l.dataset.startScale = String(v)), this.displayQueue.push(l);
3262
+ renderedWidth: p,
3263
+ renderedHeight: i
3264
+ }), l.style.transform = E, l.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || S !== u.rotation || v !== u.scale) && (l.dataset.startX = String(m.x), l.dataset.startY = String(m.y), l.dataset.endX = String(b.x), l.dataset.endY = String(b.y), l.dataset.imageWidth = String(p), l.dataset.imageHeight = String(i), l.dataset.rotation = String(u.rotation), l.dataset.scale = String(u.scale), l.dataset.startRotation = String(S), l.dataset.startScale = String(v)), this.displayQueue.push(l);
3174
3265
  }, l.onerror = () => r++, l.src = c;
3175
3266
  });
3176
3267
  }
3177
- async handleImageClick(t, e) {
3268
+ async handleImageClick(t, i) {
3178
3269
  if (!this.containerEl) return;
3179
- const i = this.zoomEngine.isFocused(t), o = {
3270
+ const e = this.zoomEngine.isFocused(t), n = {
3180
3271
  width: this.containerEl.offsetWidth,
3181
3272
  height: this.containerEl.offsetHeight
3182
3273
  };
3183
- if (i)
3274
+ if (e)
3184
3275
  await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter();
3185
3276
  else {
3186
- const s = t.dataset.imageId;
3187
- this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, this.swipeEngine?.enable(), await this.zoomEngine.focusImage(t, o, e), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
3277
+ const a = t.dataset.imageId;
3278
+ this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, this.swipeEngine?.enable(), await this.zoomEngine.focusImage(t, n, i), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
3188
3279
  }
3189
3280
  }
3190
3281
  /**
@@ -3215,28 +3306,28 @@ let Ue = class {
3215
3306
  this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy();
3216
3307
  }
3217
3308
  };
3218
- const je = Pt(
3219
- function({ className: t, style: e, ...i }, o) {
3220
- const s = wt(null), r = wt(null);
3221
- return Ut(o, () => ({
3309
+ const Ge = Pt(
3310
+ function({ className: t, style: i, ...e }, n) {
3311
+ const a = xt(null), r = xt(null);
3312
+ return Ut(n, () => ({
3222
3313
  get instance() {
3223
3314
  return r.current;
3224
3315
  }
3225
3316
  })), _t(() => {
3226
- if (!s.current) return;
3227
- const a = new Ue({
3228
- container: s.current,
3229
- ...i
3317
+ if (!a.current) return;
3318
+ const s = new je({
3319
+ container: a.current,
3320
+ ...e
3230
3321
  });
3231
- return r.current = a, a.init().catch((h) => {
3322
+ return r.current = s, s.init().catch((h) => {
3232
3323
  console.error("ImageCloud init failed:", h);
3233
3324
  }), () => {
3234
- a.destroy(), r.current = null;
3325
+ s.destroy(), r.current = null;
3235
3326
  };
3236
- }, [JSON.stringify(i)]), /* @__PURE__ */ $t("div", { ref: s, className: t, style: e });
3327
+ }, [JSON.stringify(e)]), /* @__PURE__ */ Dt("div", { ref: a, className: t, style: i });
3237
3328
  }
3238
3329
  );
3239
3330
  export {
3240
- je as ImageCloud
3331
+ Ge as ImageCloud
3241
3332
  };
3242
3333
  //# sourceMappingURL=react.js.map