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