uikit 3.21.13 → 3.21.14-dev.2e8a07c7e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/css/uikit-core-rtl.css +233 -85
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +233 -85
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +237 -81
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +237 -81
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +2 -11
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +432 -127
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +449 -132
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +2 -2
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +2 -2
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +20 -28
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +2 -2
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +25 -34
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +4 -2
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +8 -12
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +242 -241
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +20 -17
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +668 -549
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +3 -3
  43. package/src/images/icons/arrow-down-arrow-up.svg +6 -0
  44. package/src/images/icons/arrow-down.svg +3 -3
  45. package/src/images/icons/arrow-left.svg +3 -3
  46. package/src/images/icons/arrow-right.svg +3 -3
  47. package/src/images/icons/arrow-up-right.svg +3 -3
  48. package/src/images/icons/arrow-up.svg +3 -3
  49. package/src/images/icons/close-circle.svg +5 -0
  50. package/src/images/icons/cloud-download.svg +4 -4
  51. package/src/images/icons/cloud-upload.svg +4 -4
  52. package/src/images/icons/download.svg +4 -4
  53. package/src/images/icons/expand.svg +5 -5
  54. package/src/images/icons/link-external.svg +4 -4
  55. package/src/images/icons/pull.svg +4 -4
  56. package/src/images/icons/push.svg +3 -3
  57. package/src/images/icons/shrink.svg +5 -5
  58. package/src/images/icons/sign-in.svg +4 -3
  59. package/src/images/icons/sign-out.svg +4 -3
  60. package/src/images/icons/sorting.svg +6 -0
  61. package/src/images/icons/upload.svg +4 -4
  62. package/src/js/api/boot.js +16 -20
  63. package/src/js/api/events.js +12 -13
  64. package/src/js/api/instance.js +1 -1
  65. package/src/js/components/internal/lightbox-animations.js +2 -1
  66. package/src/js/components/internal/slideshow-animations.js +5 -5
  67. package/src/js/components/lightbox-panel.js +184 -45
  68. package/src/js/components/lightbox.js +59 -6
  69. package/src/js/components/slideshow.js +1 -2
  70. package/src/js/components/sortable.js +3 -1
  71. package/src/js/core/drop.js +3 -1
  72. package/src/js/core/grid.js +1 -1
  73. package/src/js/core/icon.js +2 -2
  74. package/src/js/core/img.js +3 -5
  75. package/src/js/core/navbar.js +6 -2
  76. package/src/js/core/scrollspy-nav.js +1 -1
  77. package/src/js/core/svg.js +8 -10
  78. package/src/js/core/video.js +4 -3
  79. package/src/js/mixin/internal/slideshow-animations.js +1 -6
  80. package/src/js/mixin/modal.js +1 -4
  81. package/src/js/mixin/slider-drag.js +5 -6
  82. package/src/js/mixin/slider-nav.js +4 -2
  83. package/src/js/mixin/slider.js +11 -13
  84. package/src/js/mixin/slideshow.js +1 -1
  85. package/src/js/mixin/togglable.js +7 -2
  86. package/src/js/util/dom.js +3 -1
  87. package/src/js/util/filter.js +3 -1
  88. package/src/js/util/player.js +0 -4
  89. package/src/less/components/background.less +1 -9
  90. package/src/less/components/breadcrumb.less +6 -2
  91. package/src/less/components/button.less +1 -1
  92. package/src/less/components/form-range.less +52 -0
  93. package/src/less/components/form.less +1 -1
  94. package/src/less/components/lightbox.less +57 -89
  95. package/src/less/components/margin.less +14 -0
  96. package/src/less/components/search.less +49 -23
  97. package/src/less/components/sticky.less +1 -10
  98. package/src/less/components/totop.less +1 -1
  99. package/src/less/components/transition.less +4 -4
  100. package/src/less/components/visibility.less +3 -2
  101. package/src/less/theme/form-range.less +12 -0
  102. package/src/less/theme/lightbox.less +2 -20
  103. package/src/less/theme/search.less +24 -10
  104. package/src/scss/components/background.scss +1 -9
  105. package/src/scss/components/breadcrumb.scss +6 -2
  106. package/src/scss/components/button.scss +1 -1
  107. package/src/scss/components/form-range.scss +12 -0
  108. package/src/scss/components/form.scss +1 -1
  109. package/src/scss/components/lightbox.scss +50 -77
  110. package/src/scss/components/margin.scss +13 -0
  111. package/src/scss/components/search.scss +30 -12
  112. package/src/scss/components/sticky.scss +1 -10
  113. package/src/scss/components/totop.scss +1 -1
  114. package/src/scss/components/transition.scss +4 -4
  115. package/src/scss/components/visibility.scss +3 -2
  116. package/src/scss/mixins-theme.scss +51 -12
  117. package/src/scss/mixins.scss +45 -6
  118. package/src/scss/theme/form-range.scss +10 -0
  119. package/src/scss/theme/lightbox.scss +2 -20
  120. package/src/scss/theme/search.scss +10 -6
  121. package/src/scss/variables-theme.scss +32 -20
  122. package/src/scss/variables.scss +29 -24
  123. package/tests/badge.html +2 -2
  124. package/tests/base.html +1 -1
  125. package/tests/breadcrumb.html +23 -5
  126. package/tests/card.html +24 -24
  127. package/tests/dropbar.html +15 -15
  128. package/tests/dropdown.html +6 -6
  129. package/tests/dropnav.html +100 -100
  130. package/tests/icon.html +8 -0
  131. package/tests/index.html +15 -15
  132. package/tests/lightbox.html +379 -28
  133. package/tests/margin.html +19 -0
  134. package/tests/nav.html +21 -21
  135. package/tests/navbar.html +292 -292
  136. package/tests/offcanvas.html +27 -27
  137. package/tests/placeholder.html +2 -2
  138. package/tests/slider.html +0 -1
  139. package/tests/slideshow.html +1 -1
  140. package/tests/sortable.html +5 -5
  141. package/tests/sticky-navbar.html +114 -114
  142. package/tests/transition.html +2 -1
package/dist/js/uikit.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.21.13 | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
1
+ /*! UIkit 3.21.14-dev.2e8a07c7e | https://www.getuikit.com | (c) 2014 - 2024 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
@@ -350,7 +350,7 @@
350
350
  if (isSameSiteAnchor(el)) {
351
351
  const { hash, ownerDocument } = toNode(el);
352
352
  const id = decodeURIComponent(hash).slice(1);
353
- return ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0];
353
+ return id ? ownerDocument.getElementById(id) || ownerDocument.getElementsByName(id)[0] : ownerDocument;
354
354
  }
355
355
  }
356
356
 
@@ -746,7 +746,9 @@
746
746
  }
747
747
  function empty(element) {
748
748
  element = $(element);
749
- element.innerHTML = "";
749
+ if (element) {
750
+ element.innerHTML = "";
751
+ }
750
752
  return element;
751
753
  }
752
754
  function html(parent2, html2) {
@@ -1138,9 +1140,6 @@
1138
1140
  el.muted = true;
1139
1141
  }
1140
1142
  }
1141
- function isVideo(el) {
1142
- return isHTML5(el) || isIFrame(el);
1143
- }
1144
1143
  function isHTML5(el) {
1145
1144
  return isTag(el, "video");
1146
1145
  }
@@ -1606,7 +1605,6 @@
1606
1605
  isTag: isTag,
1607
1606
  isTouch: isTouch,
1608
1607
  isUndefined: isUndefined,
1609
- isVideo: isVideo,
1610
1608
  isVisible: isVisible,
1611
1609
  isVoidElement: isVoidElement,
1612
1610
  isWindow: isWindow,
@@ -2446,6 +2444,121 @@
2446
2444
  return $("a,button", el) || el;
2447
2445
  }
2448
2446
 
2447
+ var img = {
2448
+ args: "dataSrc",
2449
+ props: {
2450
+ dataSrc: String,
2451
+ sources: String,
2452
+ margin: String,
2453
+ target: String,
2454
+ loading: String
2455
+ },
2456
+ data: {
2457
+ dataSrc: "",
2458
+ sources: false,
2459
+ margin: "50%",
2460
+ target: false,
2461
+ loading: "lazy"
2462
+ },
2463
+ connected() {
2464
+ if (this.loading !== "lazy") {
2465
+ this.load();
2466
+ } else if (isImg(this.$el)) {
2467
+ this.$el.loading = "lazy";
2468
+ setSrcAttrs(this.$el);
2469
+ }
2470
+ },
2471
+ disconnected() {
2472
+ if (this.img) {
2473
+ this.img.onload = "";
2474
+ }
2475
+ delete this.img;
2476
+ },
2477
+ observe: intersection({
2478
+ handler(entries, observer) {
2479
+ this.load();
2480
+ observer.disconnect();
2481
+ },
2482
+ options: ({ margin }) => ({ rootMargin: margin }),
2483
+ filter: ({ loading }) => loading === "lazy",
2484
+ target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
2485
+ }),
2486
+ methods: {
2487
+ load() {
2488
+ if (this.img) {
2489
+ return this.img;
2490
+ }
2491
+ const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
2492
+ removeAttr(image, "loading");
2493
+ setSrcAttrs(this.$el, image.currentSrc);
2494
+ return this.img = image;
2495
+ }
2496
+ }
2497
+ };
2498
+ function setSrcAttrs(el, src) {
2499
+ if (isImg(el)) {
2500
+ const parentNode = parent(el);
2501
+ const elements = isTag(parentNode, "picture") ? children(parentNode) : [el];
2502
+ elements.forEach((el2) => setSourceProps(el2, el2));
2503
+ } else if (src) {
2504
+ const change = !includes(el.style.backgroundImage, src);
2505
+ if (change) {
2506
+ css(el, "backgroundImage", `url(${escape(src)})`);
2507
+ trigger(el, createEvent("load", false));
2508
+ }
2509
+ }
2510
+ }
2511
+ const srcProps = ["data-src", "data-srcset", "sizes"];
2512
+ function setSourceProps(sourceEl, targetEl) {
2513
+ for (const prop of srcProps) {
2514
+ const value = data(sourceEl, prop);
2515
+ if (value) {
2516
+ attr(targetEl, prop.replace(/data-/g, ""), value);
2517
+ }
2518
+ }
2519
+ }
2520
+ function getImageFromElement(el, src, sources) {
2521
+ const img = new Image();
2522
+ wrapInPicture(img, sources);
2523
+ setSourceProps(el, img);
2524
+ img.onload = () => setSrcAttrs(el, img.currentSrc);
2525
+ attr(img, "src", src);
2526
+ return img;
2527
+ }
2528
+ function wrapInPicture(img, sources) {
2529
+ sources = parseSources(sources);
2530
+ if (sources.length) {
2531
+ const picture = fragment("<picture>");
2532
+ for (const attrs of sources) {
2533
+ const source = fragment("<source>");
2534
+ attr(source, attrs);
2535
+ append(picture, source);
2536
+ }
2537
+ append(picture, img);
2538
+ }
2539
+ }
2540
+ function parseSources(sources) {
2541
+ if (!sources) {
2542
+ return [];
2543
+ }
2544
+ if (startsWith(sources, "[")) {
2545
+ try {
2546
+ sources = JSON.parse(sources);
2547
+ } catch (e) {
2548
+ sources = [];
2549
+ }
2550
+ } else {
2551
+ sources = parseOptions(sources);
2552
+ }
2553
+ if (!isArray(sources)) {
2554
+ sources = [sources];
2555
+ }
2556
+ return sources.filter((source) => !isEmpty(source));
2557
+ }
2558
+ function isImg(el) {
2559
+ return isTag(el, "img");
2560
+ }
2561
+
2449
2562
  let prevented;
2450
2563
  function preventBackgroundScroll(el) {
2451
2564
  const off = on(
@@ -2512,6 +2625,82 @@
2512
2625
  }
2513
2626
  };
2514
2627
 
2628
+ var Position = {
2629
+ props: {
2630
+ pos: String,
2631
+ offset: Boolean,
2632
+ flip: Boolean,
2633
+ shift: Boolean,
2634
+ inset: Boolean
2635
+ },
2636
+ data: {
2637
+ pos: `bottom-${isRtl ? "right" : "left"}`,
2638
+ offset: false,
2639
+ flip: true,
2640
+ shift: true,
2641
+ inset: false
2642
+ },
2643
+ connected() {
2644
+ this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
2645
+ [this.dir, this.align] = this.pos;
2646
+ this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
2647
+ },
2648
+ methods: {
2649
+ positionAt(element, target, boundary) {
2650
+ let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
2651
+ const placement = [this.flip && "flip", this.shift && "shift"];
2652
+ const attach = {
2653
+ element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
2654
+ target: [this.dir, this.align]
2655
+ };
2656
+ if (this.axis === "y") {
2657
+ for (const prop in attach) {
2658
+ attach[prop].reverse();
2659
+ }
2660
+ offset.reverse();
2661
+ placement.reverse();
2662
+ }
2663
+ const restoreScrollPosition = storeScrollPosition(element);
2664
+ const elDim = dimensions$1(element);
2665
+ css(element, { top: -elDim.height, left: -elDim.width });
2666
+ positionAt(element, target, {
2667
+ attach,
2668
+ offset,
2669
+ boundary,
2670
+ placement,
2671
+ viewportOffset: this.getViewportOffset(element)
2672
+ });
2673
+ restoreScrollPosition();
2674
+ },
2675
+ getPositionOffset(element = this.$el) {
2676
+ return toPx(
2677
+ this.offset === false ? css(element, "--uk-position-offset") : this.offset,
2678
+ this.axis === "x" ? "width" : "height",
2679
+ element
2680
+ ) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
2681
+ },
2682
+ getShiftOffset(element = this.$el) {
2683
+ return this.align === "center" ? 0 : toPx(
2684
+ css(element, "--uk-position-shift-offset"),
2685
+ this.axis === "y" ? "width" : "height",
2686
+ element
2687
+ ) * (includes(["left", "top"], this.align) ? 1 : -1);
2688
+ },
2689
+ getViewportOffset(element) {
2690
+ return toPx(css(element, "--uk-position-viewport-offset"));
2691
+ }
2692
+ }
2693
+ };
2694
+ function storeScrollPosition(element) {
2695
+ const scrollElement = scrollParent(element);
2696
+ const { scrollTop } = scrollElement;
2697
+ return () => {
2698
+ if (scrollTop !== scrollElement.scrollTop) {
2699
+ scrollElement.scrollTop = scrollTop;
2700
+ }
2701
+ };
2702
+ }
2703
+
2515
2704
  var Togglable = {
2516
2705
  props: {
2517
2706
  cls: Boolean,
@@ -2549,8 +2738,14 @@
2549
2738
  addClass(el, cls);
2550
2739
  trigger(el, show ? "show" : "hide", [this]);
2551
2740
  const done = () => {
2741
+ var _a;
2552
2742
  removeClass(el, cls);
2553
2743
  trigger(el, show ? "shown" : "hidden", [this]);
2744
+ if (show) {
2745
+ const restoreScrollPosition = storeScrollPosition(el);
2746
+ (_a = $$("[autofocus]", el).find(isVisible)) == null ? void 0 : _a.focus();
2747
+ restoreScrollPosition();
2748
+ }
2554
2749
  };
2555
2750
  return promise ? promise.then(done, () => {
2556
2751
  removeClass(el, cls);
@@ -2583,7 +2778,6 @@
2583
2778
  if (changed) {
2584
2779
  trigger(el, "toggled", [toggled, this]);
2585
2780
  }
2586
- $$("[autofocus]", el).some((el2) => isVisible(el2) ? el2.focus() || true : el2.blur());
2587
2781
  }
2588
2782
  }
2589
2783
  };
@@ -2714,9 +2908,6 @@
2714
2908
  panel: ({ selPanel }, $el) => $(selPanel, $el),
2715
2909
  transitionElement() {
2716
2910
  return this.panel;
2717
- },
2718
- bgClose({ bgClose }) {
2719
- return bgClose && this.panel;
2720
2911
  }
2721
2912
  },
2722
2913
  connected() {
@@ -2879,7 +3070,7 @@
2879
3070
  }
2880
3071
  function listenForBackgroundClose$1(modal) {
2881
3072
  return on(document, pointerDown$1, ({ target }) => {
2882
- if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || modal.panel.contains(target)) {
3073
+ if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
2883
3074
  return;
2884
3075
  }
2885
3076
  once(
@@ -2922,11 +3113,7 @@
2922
3113
  return Math.abs(new DOMMatrix(css(el, "transform")).m41 / el.offsetWidth);
2923
3114
  }
2924
3115
  function translate(value = 0, unit = "%") {
2925
- value += value ? unit : "";
2926
- return `translate3d(${value}, 0, 0)`;
2927
- }
2928
- function scale3d(value) {
2929
- return `scale3d(${value}, ${value}, 1)`;
3116
+ return value ? `translate3d(${value + unit}, 0, 0)` : "";
2930
3117
  }
2931
3118
 
2932
3119
  function Transitioner$1(prev, next, dir, { animation, easing }) {
@@ -3060,7 +3247,6 @@
3060
3247
  const pointerDown = "touchstart mousedown";
3061
3248
  const pointerMove = "touchmove mousemove";
3062
3249
  const pointerUp = "touchend touchcancel mouseup click input scroll";
3063
- const preventClick = (e) => e.preventDefault();
3064
3250
  var SliderDrag = {
3065
3251
  props: {
3066
3252
  draggable: Boolean
@@ -3128,9 +3314,6 @@
3128
3314
  if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
3129
3315
  return;
3130
3316
  }
3131
- if (!this.dragging) {
3132
- on(this.list, "click", preventClick, pointerOptions);
3133
- }
3134
3317
  e.cancelable && e.preventDefault();
3135
3318
  this.dragging = true;
3136
3319
  this.dir = distance < 0 ? 1 : -1;
@@ -3179,6 +3362,7 @@
3179
3362
  off(document, pointerMove, this.move, pointerOptions);
3180
3363
  off(document, pointerUp, this.end, pointerUpOptions);
3181
3364
  if (this.dragging) {
3365
+ setTimeout(on(this.list, "click", (e) => e.preventDefault(), pointerOptions));
3182
3366
  this.dragging = null;
3183
3367
  if (this.index === this.prevIndex) {
3184
3368
  this.percent = 1 - this.percent;
@@ -3189,6 +3373,8 @@
3189
3373
  const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;
3190
3374
  this.index = dirChange ? this.index : this.prevIndex;
3191
3375
  if (dirChange) {
3376
+ trigger(this.slides[this.prevIndex], "itemhidden", [this]);
3377
+ trigger(this.slides[this.index], "itemshown", [this]);
3192
3378
  this.percent = 1 - this.percent;
3193
3379
  }
3194
3380
  this.show(
@@ -3197,7 +3383,6 @@
3197
3383
  );
3198
3384
  }
3199
3385
  }
3200
- setTimeout(() => off(this.list, "click", preventClick, pointerOptions));
3201
3386
  css(this.list, { userSelect: "" });
3202
3387
  this.drag = this.percent = null;
3203
3388
  }
@@ -3302,24 +3487,26 @@
3302
3487
  registerEvent(instance, event);
3303
3488
  } else {
3304
3489
  for (const key in event) {
3305
- registerEvent(instance, event[key], key);
3490
+ registerEvent(instance, { name: key, handler: event[key] });
3306
3491
  }
3307
3492
  }
3308
3493
  }
3309
3494
  }
3310
- function registerEvent(instance, event, key) {
3311
- let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };
3312
- el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;
3313
- if (!el || isArray(el) && !el.length || filter && !filter.call(instance, instance)) {
3495
+ function registerEvent(instance, { name, el, handler, capture, passive, delegate, filter, self }) {
3496
+ if (filter && !filter.call(instance, instance)) {
3314
3497
  return;
3315
3498
  }
3316
3499
  instance._disconnect.push(
3317
3500
  on(
3318
- el,
3501
+ el ? el.call(instance, instance) : instance.$el,
3319
3502
  name,
3320
- delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,
3321
- isString(handler) ? instance[handler] : handler.bind(instance),
3322
- { passive, capture, self }
3503
+ delegate == null ? void 0 : delegate.call(instance, instance),
3504
+ handler.bind(instance),
3505
+ {
3506
+ passive,
3507
+ capture,
3508
+ self
3509
+ }
3323
3510
  )
3324
3511
  );
3325
3512
  }
@@ -3529,7 +3716,7 @@
3529
3716
  };
3530
3717
  App.util = util;
3531
3718
  App.options = {};
3532
- App.version = "3.21.13";
3719
+ App.version = "3.21.14-dev.2e8a07c7e";
3533
3720
 
3534
3721
  const PREFIX = "uk-";
3535
3722
  const DATA = "__uikit__";
@@ -3648,7 +3835,7 @@
3648
3835
  const instance = this;
3649
3836
  attachToElement(el, instance);
3650
3837
  instance.$options.el = el;
3651
- if (document.contains(el)) {
3838
+ if (el.isConnected) {
3652
3839
  callConnected(instance);
3653
3840
  }
3654
3841
  };
@@ -3802,7 +3989,9 @@
3802
3989
  },
3803
3990
  {
3804
3991
  name: "itemshow",
3805
- handler: "updateNav"
3992
+ handler() {
3993
+ this.updateNav();
3994
+ }
3806
3995
  },
3807
3996
  {
3808
3997
  name: "keydown",
@@ -3832,7 +4021,7 @@
3832
4021
  const item = toNumber(cmd);
3833
4022
  const active = item === index;
3834
4023
  toggleClass(el, this.clsActive, active);
3835
- toggleClass(button, "uk-disabled", this.parallax);
4024
+ toggleClass(button, "uk-disabled", !!this.parallax);
3836
4025
  attr(button, {
3837
4026
  "aria-selected": active,
3838
4027
  tabindex: active && !this.parallax ? null : -1
@@ -3935,7 +4124,7 @@
3935
4124
  }
3936
4125
  },
3937
4126
  methods: {
3938
- show(index, force = false) {
4127
+ async show(index, force = false) {
3939
4128
  var _a;
3940
4129
  if (this.dragging || !this.length || this.parallax) {
3941
4130
  return;
@@ -3971,18 +4160,16 @@
3971
4160
  reset();
3972
4161
  return;
3973
4162
  }
3974
- const promise = this._show(prev, next, force).then(() => {
3975
- prev && trigger(prev, "itemhidden", [this]);
3976
- trigger(next, "itemshown", [this]);
3977
- stack.shift();
3978
- this._transitioner = null;
3979
- if (stack.length) {
3980
- requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
3981
- }
3982
- });
3983
4163
  prev && trigger(prev, "itemhide", [this]);
3984
4164
  trigger(next, "itemshow", [this]);
3985
- return promise;
4165
+ await this._show(prev, next, force);
4166
+ prev && trigger(prev, "itemhidden", [this]);
4167
+ trigger(next, "itemshown", [this]);
4168
+ stack.shift();
4169
+ this._transitioner = null;
4170
+ if (stack.length) {
4171
+ requestAnimationFrame(() => stack.length && this.show(stack.shift(), true));
4172
+ }
3986
4173
  },
3987
4174
  getIndex(index = this.index, prev = this.index) {
3988
4175
  return clamp(
@@ -4052,7 +4239,7 @@
4052
4239
  },
4053
4240
  observe: resize(),
4054
4241
  events: {
4055
- beforeitemshow({ target }) {
4242
+ itemshow({ target }) {
4056
4243
  addClass(target, this.clsActive);
4057
4244
  },
4058
4245
  itemshown({ target }) {
@@ -4068,78 +4255,186 @@
4068
4255
  ...Animations$2,
4069
4256
  fade: {
4070
4257
  show() {
4071
- return [{ opacity: 0 }, { opacity: 1 }];
4258
+ return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
4072
4259
  },
4073
4260
  percent(current) {
4074
4261
  return 1 - css(current, "opacity");
4075
4262
  },
4076
4263
  translate(percent) {
4077
- return [{ opacity: 1 - percent }, { opacity: percent }];
4264
+ return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];
4078
4265
  }
4079
4266
  },
4080
4267
  scale: {
4081
4268
  show() {
4082
- return [
4083
- { opacity: 0, transform: scale3d(1 - 0.2) },
4084
- { opacity: 1, transform: scale3d(1) }
4085
- ];
4269
+ return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];
4086
4270
  },
4087
4271
  percent(current) {
4088
4272
  return 1 - css(current, "opacity");
4089
4273
  },
4090
4274
  translate(percent) {
4091
4275
  return [
4092
- { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
4093
- { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }
4276
+ { opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },
4277
+ { zIndex: -1 }
4094
4278
  ];
4095
4279
  }
4096
- }
4097
- };
4098
-
4099
- var LightboxPanel = {
4100
- mixins: [Modal, Slideshow],
4101
- functional: true,
4102
- props: {
4103
- delayControls: Number,
4104
- preload: Number,
4105
- videoAutoplay: Boolean,
4106
- template: String
4107
4280
  },
4108
- data: () => ({
4109
- preload: 1,
4110
- videoAutoplay: false,
4111
- delayControls: 3e3,
4112
- items: [],
4113
- cls: "uk-open",
4114
- clsPage: "uk-lightbox-page",
4115
- selList: ".uk-lightbox-items",
4116
- attrItem: "uk-lightbox-item",
4117
- selClose: ".uk-close-large",
4118
- selCaption: ".uk-lightbox-caption",
4119
- pauseOnHover: false,
4120
- velocity: 2,
4121
- Animations: Animations$1,
4122
- template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-lightbox-toolbar uk-position-top uk-text-right uk-transition-slide-top uk-transition-opaque"> <button class="uk-lightbox-toolbar-icon uk-close-large" type="button" uk-close></button> </div> <a class="uk-lightbox-button uk-position-center-left uk-position-medium uk-transition-fade" href uk-slidenav-previous uk-lightbox-item="previous"></a> <a class="uk-lightbox-button uk-position-center-right uk-position-medium uk-transition-fade" href uk-slidenav-next uk-lightbox-item="next"></a> <div class="uk-lightbox-toolbar uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>`
4123
- }),
4124
- created() {
4125
- const $el = $(this.template);
4126
- const list = $(this.selList, $el);
4127
- this.items.forEach(() => append(list, "<div>"));
4128
- const close = $("[uk-close]", $el);
4129
- const closeLabel = this.t("close");
4130
- if (close && closeLabel) {
4131
- close.dataset.i18n = JSON.stringify({ label: closeLabel });
4132
- }
4133
- this.$mount(append(this.container, $el));
4281
+ pull: {
4282
+ show(dir) {
4283
+ return dir < 0 ? [
4284
+ { transform: translate(30), zIndex: -1 },
4285
+ { transform: translate(), zIndex: 0 }
4286
+ ] : [
4287
+ { transform: translate(-100), zIndex: 0 },
4288
+ { transform: translate(), zIndex: -1 }
4289
+ ];
4290
+ },
4291
+ percent(current, next, dir) {
4292
+ return dir < 0 ? 1 - translated(next) : translated(current);
4293
+ },
4294
+ translate(percent, dir) {
4295
+ return dir < 0 ? [
4296
+ { transform: translate(30 * percent), zIndex: -1 },
4297
+ { transform: translate(-100 * (1 - percent)), zIndex: 0 }
4298
+ ] : [
4299
+ { transform: translate(-percent * 100), zIndex: 0 },
4300
+ { transform: translate(30 * (1 - percent)), zIndex: -1 }
4301
+ ];
4302
+ }
4134
4303
  },
4135
- events: [
4136
- {
4137
- name: `${pointerMove$1} ${pointerDown$1} keydown`,
4138
- handler: "showControls"
4304
+ push: {
4305
+ show(dir) {
4306
+ return dir < 0 ? [
4307
+ { transform: translate(100), zIndex: 0 },
4308
+ { transform: translate(), zIndex: -1 }
4309
+ ] : [
4310
+ { transform: translate(-30), zIndex: -1 },
4311
+ { transform: translate(), zIndex: 0 }
4312
+ ];
4313
+ },
4314
+ percent(current, next, dir) {
4315
+ return dir > 0 ? 1 - translated(next) : translated(current);
4316
+ },
4317
+ translate(percent, dir) {
4318
+ return dir < 0 ? [
4319
+ { transform: translate(percent * 100), zIndex: 0 },
4320
+ { transform: translate(-30 * (1 - percent)), zIndex: -1 }
4321
+ ] : [
4322
+ { transform: translate(-30 * percent), zIndex: -1 },
4323
+ { transform: translate(100 * (1 - percent)), zIndex: 0 }
4324
+ ];
4325
+ }
4326
+ }
4327
+ };
4328
+ function scale3d(value) {
4329
+ return `scale3d(${value}, ${value}, 1)`;
4330
+ }
4331
+
4332
+ var Animations = {
4333
+ ...Animations$2,
4334
+ fade: {
4335
+ show() {
4336
+ return [{ opacity: 0 }, { opacity: 1 }];
4337
+ },
4338
+ percent(current) {
4339
+ return 1 - css(current, "opacity");
4340
+ },
4341
+ translate(percent) {
4342
+ return [{ opacity: 1 - percent }, { opacity: percent }];
4343
+ }
4344
+ },
4345
+ scale: {
4346
+ show() {
4347
+ return [
4348
+ { opacity: 0, transform: scale3d(1 - 0.2) },
4349
+ { opacity: 1, transform: scale3d(1) }
4350
+ ];
4139
4351
  },
4352
+ percent(current) {
4353
+ return 1 - css(current, "opacity");
4354
+ },
4355
+ translate(percent) {
4356
+ return [
4357
+ { opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
4358
+ { opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }
4359
+ ];
4360
+ }
4361
+ }
4362
+ };
4363
+
4364
+ var LightboxPanel = {
4365
+ i18n: {
4366
+ counter: "%s / %s"
4367
+ },
4368
+ mixins: [Modal, Slideshow],
4369
+ functional: true,
4370
+ props: {
4371
+ counter: Boolean,
4372
+ preload: Number,
4373
+ nav: Boolean,
4374
+ slidenav: Boolean,
4375
+ delayControls: Number,
4376
+ videoAutoplay: Boolean,
4377
+ template: String
4378
+ },
4379
+ data: () => ({
4380
+ counter: false,
4381
+ preload: 1,
4382
+ nav: false,
4383
+ slidenav: true,
4384
+ delayControls: 3e3,
4385
+ videoAutoplay: false,
4386
+ items: [],
4387
+ cls: "uk-open",
4388
+ clsPage: "uk-lightbox-page",
4389
+ clsFit: "uk-lightbox-items-fit",
4390
+ clsZoom: "uk-lightbox-zoom",
4391
+ attrItem: "uk-lightbox-item",
4392
+ selList: ".uk-lightbox-items",
4393
+ selClose: ".uk-close-large",
4394
+ selNav: ".uk-lightbox-thumbnav, .uk-lightbox-dotnav",
4395
+ selCaption: ".uk-lightbox-caption",
4396
+ selCounter: ".uk-lightbox-counter",
4397
+ pauseOnHover: false,
4398
+ velocity: 2,
4399
+ Animations,
4400
+ template: `<div class="uk-lightbox uk-overflow-hidden"> <div class="uk-lightbox-items"></div> <div class="uk-position-top-right uk-position-small uk-transition-fade" uk-inverse> <button class="uk-lightbox-close uk-close-large" type="button" uk-close></button> </div> <div class="uk-lightbox-slidenav uk-position-center-left uk-position-medium uk-transition-fade" uk-inverse> <a href uk-slidenav-previous uk-lightbox-item="previous"></a> </div> <div class="uk-lightbox-slidenav uk-position-center-right uk-position-medium uk-transition-fade" uk-inverse> <a href uk-slidenav-next uk-lightbox-item="next"></a> </div> <div class="uk-position-center-right uk-position-medium uk-transition-fade" uk-inverse style="max-height: 90vh; overflow: auto;"> <ul class="uk-lightbox-thumbnav uk-lightbox-thumbnav-vertical uk-thumbnav uk-thumbnav-vertical"></ul> <ul class="uk-lightbox-dotnav uk-dotnav uk-dotnav-vertical"></ul> </div> <div class="uk-lightbox-counter uk-text-large uk-position-top-left uk-position-small uk-transition-fade" uk-inverse></div> <div class="uk-lightbox-caption uk-position-bottom uk-text-center uk-transition-slide-bottom uk-transition-opaque"></div> </div>`
4401
+ }),
4402
+ created() {
4403
+ let $el = $(this.template);
4404
+ if (isTag($el, "template")) {
4405
+ $el = fragment(html($el));
4406
+ }
4407
+ const list = $(this.selList, $el);
4408
+ const navType = this.$props.nav;
4409
+ remove$1($$(this.selNav, $el).filter((el) => !matches(el, `.uk-${navType}`)));
4410
+ for (const [i, item] of this.items.entries()) {
4411
+ append(list, "<div>");
4412
+ if (navType === "thumbnav") {
4413
+ wrapAll(
4414
+ toThumbnavItem(item, this.videoAutoplay),
4415
+ append($(this.selNav, $el), `<li uk-lightbox-item="${i}"><a href></a></li>`)
4416
+ );
4417
+ }
4418
+ }
4419
+ if (!this.slidenav) {
4420
+ remove$1($$(".uk-lightbox-slidenav", $el));
4421
+ }
4422
+ if (!this.counter) {
4423
+ remove$1($(this.selCounter, $el));
4424
+ }
4425
+ addClass(list, this.clsFit);
4426
+ const close = $("[uk-close]", $el);
4427
+ const closeLabel = this.t("close");
4428
+ if (close && closeLabel) {
4429
+ close.dataset.i18n = JSON.stringify({ label: closeLabel });
4430
+ }
4431
+ this.$mount(append(this.container, $el));
4432
+ },
4433
+ events: [
4140
4434
  {
4141
4435
  name: "click",
4142
4436
  self: true,
4437
+ filter: ({ bgClose }) => bgClose,
4143
4438
  delegate: ({ selList }) => `${selList} > *`,
4144
4439
  handler(e) {
4145
4440
  if (!e.defaultPrevented) {
@@ -4147,10 +4442,29 @@
4147
4442
  }
4148
4443
  }
4149
4444
  },
4445
+ {
4446
+ name: "click",
4447
+ self: true,
4448
+ delegate: ({ clsZoom }) => `.${clsZoom}`,
4449
+ handler(e) {
4450
+ if (!e.defaultPrevented) {
4451
+ toggleClass(this.list, this.clsFit);
4452
+ }
4453
+ }
4454
+ },
4455
+ {
4456
+ name: `${pointerMove$1} ${pointerDown$1} keydown`,
4457
+ filter: ({ delayControls }) => delayControls,
4458
+ handler() {
4459
+ this.showControls();
4460
+ }
4461
+ },
4150
4462
  {
4151
4463
  name: "shown",
4152
4464
  self: true,
4153
- handler: "showControls"
4465
+ handler() {
4466
+ this.showControls();
4467
+ }
4154
4468
  },
4155
4469
  {
4156
4470
  name: "hide",
@@ -4193,26 +4507,25 @@
4193
4507
  {
4194
4508
  name: "beforeitemshow",
4195
4509
  handler(e) {
4510
+ html($(this.selCaption, this.$el), this.getItem().caption || "");
4511
+ html(
4512
+ $(this.selCounter, this.$el),
4513
+ this.t("counter", this.index + 1, this.slides.length)
4514
+ );
4515
+ for (let j = -this.preload; j <= this.preload; j++) {
4516
+ this.loadItem(this.index + j);
4517
+ }
4196
4518
  if (this.isToggled()) {
4197
4519
  return;
4198
4520
  }
4199
4521
  this.draggable = false;
4200
4522
  e.preventDefault();
4201
4523
  this.toggleElement(this.$el, true, false);
4202
- this.animation = Animations$1["scale"];
4524
+ this.animation = Animations.scale;
4203
4525
  removeClass(e.target, this.clsActive);
4204
4526
  this.stack.splice(1, 0, this.index);
4205
4527
  }
4206
4528
  },
4207
- {
4208
- name: "itemshow",
4209
- handler() {
4210
- html($(this.selCaption, this.$el), this.getItem().caption || "");
4211
- for (let j = -this.preload; j <= this.preload; j++) {
4212
- this.loadItem(this.index + j);
4213
- }
4214
- }
4215
- },
4216
4529
  {
4217
4530
  name: "itemshown",
4218
4531
  handler() {
@@ -4222,29 +4535,36 @@
4222
4535
  {
4223
4536
  name: "itemload",
4224
4537
  async handler(_, item) {
4225
- const { source: src, type, alt = "", poster, attrs = {} } = item;
4226
- this.setItem(item, "<span uk-spinner></span>");
4538
+ const { source: src, type, attrs = {} } = item;
4539
+ this.setItem(item, "<span uk-spinner uk-inverse></span>");
4227
4540
  if (!src) {
4228
4541
  return;
4229
4542
  }
4230
- let matches;
4543
+ let matches2;
4231
4544
  const iframeAttrs = {
4232
4545
  allowfullscreen: "",
4233
4546
  style: "max-width: 100%; box-sizing: border-box;",
4234
4547
  "uk-responsive": "",
4235
- "uk-video": `${this.videoAutoplay}`
4548
+ "uk-video": `${Boolean(this.videoAutoplay)}`
4236
4549
  };
4237
- if (type === "image" || src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i)) {
4238
- const img = createEl("img", { src, alt, ...attrs });
4239
- on(img, "load", () => this.setItem(item, img));
4550
+ if (type === "image" || isImage(src)) {
4551
+ const img = createEl("img");
4552
+ wrapInPicture(img, item.sources);
4553
+ attr(img, {
4554
+ src,
4555
+ ...pick(item, ["alt", "srcset", "sizes"]),
4556
+ ...attrs
4557
+ });
4558
+ on(img, "load", () => this.setItem(item, parent(img) || img));
4240
4559
  on(img, "error", () => this.setError(item));
4241
- } else if (type === "video" || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
4560
+ } else if (type === "video" || isVideo(src)) {
4561
+ const inline = this.videoAutoplay === "inline";
4242
4562
  const video = createEl("video", {
4243
4563
  src,
4244
- poster,
4245
- controls: "",
4246
4564
  playsinline: "",
4247
- "uk-video": `${this.videoAutoplay}`,
4565
+ controls: inline ? null : "",
4566
+ poster: this.videoAutoplay ? null : item.poster,
4567
+ "uk-video": inline ? "automute: true" : Boolean(this.videoAutoplay),
4248
4568
  ...attrs
4249
4569
  });
4250
4570
  on(video, "loadedmetadata", () => this.setItem(item, video));
@@ -4259,20 +4579,20 @@
4259
4579
  ...attrs
4260
4580
  })
4261
4581
  );
4262
- } else if (matches = src.match(
4582
+ } else if (matches2 = src.match(
4263
4583
  /\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/
4264
4584
  )) {
4265
4585
  this.setItem(
4266
4586
  item,
4267
4587
  createEl("iframe", {
4268
- src: `https://www.youtube${matches[1] || ""}.com/embed/${matches[2]}${matches[3] ? `?${matches[3]}` : ""}`,
4588
+ src: `https://www.youtube${matches2[1] || ""}.com/embed/${matches2[2]}${matches2[3] ? `?${matches2[3]}` : ""}`,
4269
4589
  width: 1920,
4270
4590
  height: 1080,
4271
4591
  ...iframeAttrs,
4272
4592
  ...attrs
4273
4593
  })
4274
4594
  );
4275
- } else if (matches = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
4595
+ } else if (matches2 = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
4276
4596
  try {
4277
4597
  const { height, width } = await (await fetch(
4278
4598
  `https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
@@ -4283,7 +4603,7 @@
4283
4603
  this.setItem(
4284
4604
  item,
4285
4605
  createEl("iframe", {
4286
- src: `https://player.vimeo.com/video/${matches[1]}${matches[2] ? `?${matches[2]}` : ""}`,
4606
+ src: `https://player.vimeo.com/video/${matches2[1]}${matches2[2] ? `?${matches2[2]}` : ""}`,
4287
4607
  width,
4288
4608
  height,
4289
4609
  ...iframeAttrs,
@@ -4295,8 +4615,29 @@
4295
4615
  }
4296
4616
  }
4297
4617
  }
4618
+ },
4619
+ {
4620
+ name: "itemloaded",
4621
+ handler() {
4622
+ this.$emit("resize");
4623
+ }
4298
4624
  }
4299
4625
  ],
4626
+ update: {
4627
+ read() {
4628
+ for (const media of $$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
4629
+ toggleClass(
4630
+ media,
4631
+ this.clsZoom,
4632
+ (media.naturalHeight || media.videoHeight) - this.$el.offsetHeight > Math.max(
4633
+ 0,
4634
+ (media.naturalWidth || media.videoWidth) - this.$el.offsetWidth
4635
+ )
4636
+ );
4637
+ }
4638
+ },
4639
+ events: ["resize"]
4640
+ },
4300
4641
  methods: {
4301
4642
  loadItem(index = this.index) {
4302
4643
  const item = this.getItem(index);
@@ -4314,11 +4655,11 @@
4314
4655
  return this.slides[this.items.indexOf(item)];
4315
4656
  },
4316
4657
  setError(item) {
4317
- this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2"></span>');
4658
+ this.setItem(item, '<span uk-icon="icon: bolt; ratio: 2" uk-inverse></span>');
4318
4659
  },
4319
4660
  showControls() {
4320
4661
  clearTimeout(this.controlsTimer);
4321
- this.controlsTimer = setTimeout(this.hideControls, this.delayControls);
4662
+ this.controlsTimer = this.delayControls && setTimeout(this.hideControls, this.delayControls);
4322
4663
  addClass(this.$el, "uk-active", "uk-transition-active");
4323
4664
  },
4324
4665
  hideControls() {
@@ -4331,7 +4672,26 @@
4331
4672
  attr(el, attrs);
4332
4673
  return el;
4333
4674
  }
4675
+ function toThumbnavItem(item, videoAutoplay) {
4676
+ const el = item.poster || item.thumb && (item.type === "image" || isImage(item.thumb)) ? createEl("img", { src: item.poster || item.thumb, alt: "" }) : item.thumb && (item.type === "video" || isVideo(item.thumb)) ? createEl("video", {
4677
+ src: item.thumb,
4678
+ loop: "",
4679
+ playsinline: "",
4680
+ "uk-video": `autoplay: ${Boolean(videoAutoplay)}; automute: true`
4681
+ }) : createEl("canvas");
4682
+ if (item.thumbRatio) {
4683
+ el.style.aspectRatio = item.thumbRatio;
4684
+ }
4685
+ return el;
4686
+ }
4687
+ function isImage(src) {
4688
+ return src == null ? void 0 : src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
4689
+ }
4690
+ function isVideo(src) {
4691
+ return src == null ? void 0 : src.match(/\.(mp4|webm|ogv)($|\?)/i);
4692
+ }
4334
4693
 
4694
+ const selDisabled$1 = ".uk-disabled *, .uk-disabled, [disabled]";
4335
4695
  var lightbox = {
4336
4696
  install: install$3,
4337
4697
  props: { toggle: String },
@@ -4354,17 +4714,23 @@
4354
4714
  },
4355
4715
  events: {
4356
4716
  name: "click",
4357
- delegate: ({ toggle }) => `${toggle}:not(.uk-disabled)`,
4717
+ delegate: ({ toggle }) => toggle,
4358
4718
  handler(e) {
4359
4719
  if (!e.defaultPrevented) {
4360
4720
  e.preventDefault();
4361
- this.show(e.current);
4721
+ if (!matches(e.current, selDisabled$1)) {
4722
+ this.show(e.current);
4723
+ }
4362
4724
  }
4363
4725
  }
4364
4726
  },
4365
4727
  methods: {
4366
4728
  show(index) {
4367
- const items = uniqueBy(this.toggles.map(toItem), "source");
4729
+ let items = this.toggles.map(toItem);
4730
+ if (this.nav === "thumbnav") {
4731
+ ensureThumb.call(this, this.toggles, items);
4732
+ }
4733
+ items = uniqueBy(items, "source");
4368
4734
  if (isElement(index)) {
4369
4735
  const { source } = toItem(index);
4370
4736
  index = findIndex(items, ({ source: src }) => source === src);
@@ -4385,10 +4751,29 @@
4385
4751
  }
4386
4752
  assign(Lightbox.props, UIkit.component("lightboxPanel").options.props);
4387
4753
  }
4754
+ function ensureThumb(toggles, items) {
4755
+ for (const [i, toggle] of Object.entries(toggles)) {
4756
+ if (items[i].thumb) {
4757
+ continue;
4758
+ }
4759
+ const parent = parents(toggle).reverse().concat(toggle).find(
4760
+ (parent2) => this.$el.contains(parent2) && (parent2 === toggle || $$(this.toggle, parent2).length === 1)
4761
+ );
4762
+ if (!parent) {
4763
+ continue;
4764
+ }
4765
+ const media = $("img,video", parent);
4766
+ if (media) {
4767
+ items[i].thumb = media.currentSrc || media.poster || media.src;
4768
+ items[i].thumbRatio = (media.naturalWidth || media.videoWidth) / (media.naturalHeight || media.videoHeight);
4769
+ }
4770
+ }
4771
+ }
4388
4772
  function toItem(el) {
4389
4773
  const item = {};
4390
- for (const attr2 of ["href", "caption", "type", "poster", "alt", "attrs"]) {
4391
- item[attr2 === "href" ? "source" : attr2] = data(el, attr2);
4774
+ for (const attribute of el.getAttributeNames()) {
4775
+ const key = attribute.replace(/^data-/, "");
4776
+ item[key === "href" ? "source" : key] = el.getAttribute(attribute);
4392
4777
  }
4393
4778
  item.attrs = parseOptions(item.attrs);
4394
4779
  return item;
@@ -5496,106 +5881,30 @@
5496
5881
  return isIn(type) ^ dir < 0 ? percent : 1 - percent;
5497
5882
  }
5498
5883
 
5499
- var Animations = {
5500
- ...Animations$2,
5501
- fade: {
5502
- show() {
5503
- return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
5504
- },
5505
- percent(current) {
5506
- return 1 - css(current, "opacity");
5507
- },
5508
- translate(percent) {
5509
- return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];
5510
- }
5884
+ var slideshow = {
5885
+ mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],
5886
+ props: {
5887
+ ratio: String,
5888
+ minHeight: String,
5889
+ maxHeight: String
5511
5890
  },
5512
- scale: {
5513
- show() {
5514
- return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];
5515
- },
5516
- percent(current) {
5517
- return 1 - css(current, "opacity");
5518
- },
5519
- translate(percent) {
5520
- return [
5521
- { opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },
5522
- { zIndex: -1 }
5523
- ];
5524
- }
5891
+ data: {
5892
+ ratio: "16:9",
5893
+ minHeight: void 0,
5894
+ maxHeight: void 0,
5895
+ selList: ".uk-slideshow-items",
5896
+ attrItem: "uk-slideshow-item",
5897
+ selNav: ".uk-slideshow-nav",
5898
+ Animations: Animations$1
5525
5899
  },
5526
- pull: {
5527
- show(dir) {
5528
- return dir < 0 ? [
5529
- { transform: translate(30), zIndex: -1 },
5530
- { transform: translate(), zIndex: 0 }
5531
- ] : [
5532
- { transform: translate(-100), zIndex: 0 },
5533
- { transform: translate(), zIndex: -1 }
5534
- ];
5535
- },
5536
- percent(current, next, dir) {
5537
- return dir < 0 ? 1 - translated(next) : translated(current);
5538
- },
5539
- translate(percent, dir) {
5540
- return dir < 0 ? [
5541
- { transform: translate(30 * percent), zIndex: -1 },
5542
- { transform: translate(-100 * (1 - percent)), zIndex: 0 }
5543
- ] : [
5544
- { transform: translate(-percent * 100), zIndex: 0 },
5545
- { transform: translate(30 * (1 - percent)), zIndex: -1 }
5546
- ];
5547
- }
5548
- },
5549
- push: {
5550
- show(dir) {
5551
- return dir < 0 ? [
5552
- { transform: translate(100), zIndex: 0 },
5553
- { transform: translate(), zIndex: -1 }
5554
- ] : [
5555
- { transform: translate(-30), zIndex: -1 },
5556
- { transform: translate(), zIndex: 0 }
5557
- ];
5558
- },
5559
- percent(current, next, dir) {
5560
- return dir > 0 ? 1 - translated(next) : translated(current);
5561
- },
5562
- translate(percent, dir) {
5563
- return dir < 0 ? [
5564
- { transform: translate(percent * 100), zIndex: 0 },
5565
- { transform: translate(-30 * (1 - percent)), zIndex: -1 }
5566
- ] : [
5567
- { transform: translate(-30 * percent), zIndex: -1 },
5568
- { transform: translate(100 * (1 - percent)), zIndex: 0 }
5569
- ];
5570
- }
5571
- }
5572
- };
5573
-
5574
- var slideshow = {
5575
- mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],
5576
- props: {
5577
- ratio: String,
5578
- minHeight: String,
5579
- maxHeight: String
5580
- },
5581
- data: {
5582
- ratio: "16:9",
5583
- minHeight: void 0,
5584
- maxHeight: void 0,
5585
- selList: ".uk-slideshow-items",
5586
- attrItem: "uk-slideshow-item",
5587
- selNav: ".uk-slideshow-nav",
5588
- Animations
5589
- },
5590
- watch: {
5591
- list(list) {
5592
- css(list, {
5593
- aspectRatio: this.ratio ? this.ratio.replace(":", "/") : void 0,
5594
- minHeight: this.minHeight,
5595
- maxHeight: this.maxHeight,
5596
- minWidth: "100%",
5597
- maxWidth: "100%"
5598
- });
5900
+ watch: {
5901
+ list(list) {
5902
+ css(list, {
5903
+ aspectRatio: this.ratio ? this.ratio.replace(":", "/") : void 0,
5904
+ minHeight: this.minHeight,
5905
+ maxHeight: this.maxHeight,
5906
+ width: "100%"
5907
+ });
5599
5908
  }
5600
5909
  },
5601
5910
  methods: {
@@ -5637,7 +5946,9 @@
5637
5946
  events: {
5638
5947
  name: pointerDown$1,
5639
5948
  passive: false,
5640
- handler: "init"
5949
+ handler(e) {
5950
+ this.init(e);
5951
+ }
5641
5952
  },
5642
5953
  computed: {
5643
5954
  target: (_, $el) => ($el.tBodies || [$el])[0],
@@ -5913,82 +6224,6 @@
5913
6224
  };
5914
6225
  }
5915
6226
 
5916
- var Position = {
5917
- props: {
5918
- pos: String,
5919
- offset: Boolean,
5920
- flip: Boolean,
5921
- shift: Boolean,
5922
- inset: Boolean
5923
- },
5924
- data: {
5925
- pos: `bottom-${isRtl ? "right" : "left"}`,
5926
- offset: false,
5927
- flip: true,
5928
- shift: true,
5929
- inset: false
5930
- },
5931
- connected() {
5932
- this.pos = this.$props.pos.split("-").concat("center").slice(0, 2);
5933
- [this.dir, this.align] = this.pos;
5934
- this.axis = includes(["top", "bottom"], this.dir) ? "y" : "x";
5935
- },
5936
- methods: {
5937
- positionAt(element, target, boundary) {
5938
- let offset = [this.getPositionOffset(element), this.getShiftOffset(element)];
5939
- const placement = [this.flip && "flip", this.shift && "shift"];
5940
- const attach = {
5941
- element: [this.inset ? this.dir : flipPosition(this.dir), this.align],
5942
- target: [this.dir, this.align]
5943
- };
5944
- if (this.axis === "y") {
5945
- for (const prop in attach) {
5946
- attach[prop].reverse();
5947
- }
5948
- offset.reverse();
5949
- placement.reverse();
5950
- }
5951
- const restoreScrollPosition = storeScrollPosition(element);
5952
- const elDim = dimensions$1(element);
5953
- css(element, { top: -elDim.height, left: -elDim.width });
5954
- positionAt(element, target, {
5955
- attach,
5956
- offset,
5957
- boundary,
5958
- placement,
5959
- viewportOffset: this.getViewportOffset(element)
5960
- });
5961
- restoreScrollPosition();
5962
- },
5963
- getPositionOffset(element = this.$el) {
5964
- return toPx(
5965
- this.offset === false ? css(element, "--uk-position-offset") : this.offset,
5966
- this.axis === "x" ? "width" : "height",
5967
- element
5968
- ) * (includes(["left", "top"], this.dir) ? -1 : 1) * (this.inset ? -1 : 1);
5969
- },
5970
- getShiftOffset(element = this.$el) {
5971
- return this.align === "center" ? 0 : toPx(
5972
- css(element, "--uk-position-shift-offset"),
5973
- this.axis === "y" ? "width" : "height",
5974
- element
5975
- ) * (includes(["left", "top"], this.align) ? 1 : -1);
5976
- },
5977
- getViewportOffset(element) {
5978
- return toPx(css(element, "--uk-position-viewport-offset"));
5979
- }
5980
- }
5981
- };
5982
- function storeScrollPosition(element) {
5983
- const scrollElement = scrollParent(element);
5984
- const { scrollTop } = scrollElement;
5985
- return () => {
5986
- if (scrollTop !== scrollElement.scrollTop) {
5987
- scrollElement.scrollTop = scrollTop;
5988
- }
5989
- };
5990
- }
5991
-
5992
6227
  var tooltip = {
5993
6228
  mixins: [Container, Togglable, Position],
5994
6229
  data: {
@@ -6351,32 +6586,29 @@
6351
6586
  if (document.body) {
6352
6587
  apply(document.body, connect);
6353
6588
  }
6354
- new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(document, {
6355
- subtree: true,
6356
- childList: true
6357
- });
6358
- new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(document, {
6589
+ new MutationObserver(handleMutation).observe(document, {
6359
6590
  subtree: true,
6591
+ childList: true,
6360
6592
  attributes: true
6361
6593
  });
6362
6594
  App._initialized = true;
6363
6595
  }
6364
- function applyChildListMutation({ addedNodes, removedNodes }) {
6365
- for (const node of addedNodes) {
6366
- apply(node, connect);
6367
- }
6368
- for (const node of removedNodes) {
6369
- apply(node, disconnect);
6370
- }
6371
- }
6372
- function applyAttributeMutation({ target, attributeName }) {
6596
+ function handleMutation(records) {
6373
6597
  var _a;
6374
- const name = getComponentName(attributeName);
6375
- if (name) {
6376
- if (hasAttr(target, attributeName)) {
6377
- createComponent(name, target);
6378
- } else {
6379
- (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6598
+ for (const { addedNodes, removedNodes, target, attributeName } of records) {
6599
+ for (const node of addedNodes) {
6600
+ apply(node, connect);
6601
+ }
6602
+ for (const node of removedNodes) {
6603
+ apply(node, disconnect);
6604
+ }
6605
+ const name = attributeName && getComponentName(attributeName);
6606
+ if (name) {
6607
+ if (hasAttr(target, attributeName)) {
6608
+ createComponent(name, target);
6609
+ } else {
6610
+ (_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
6611
+ }
6380
6612
  }
6381
6613
  }
6382
6614
  }
@@ -6680,7 +6912,7 @@
6680
6912
  ],
6681
6913
  observe: [
6682
6914
  intersection({
6683
- filter: ({ $el, autoplay }) => autoplay !== "hover" && isVideo($el),
6915
+ filter: ({ autoplay }) => autoplay !== "hover",
6684
6916
  handler([{ isIntersecting }]) {
6685
6917
  if (!document.fullscreenElement) {
6686
6918
  if (isIntersecting) {
@@ -6693,7 +6925,9 @@
6693
6925
  }
6694
6926
  },
6695
6927
  args: { intersecting: false },
6696
- options: ({ $el, autoplay }) => ({ root: autoplay === "inview" ? null : parent($el) })
6928
+ options: ({ $el, autoplay }) => ({
6929
+ root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
6930
+ })
6697
6931
  })
6698
6932
  ]
6699
6933
  };
@@ -6946,7 +7180,9 @@
6946
7180
  {
6947
7181
  name: "beforehide",
6948
7182
  self: true,
6949
- handler: "clearTimers"
7183
+ handler() {
7184
+ this.clearTimers();
7185
+ }
6950
7186
  },
6951
7187
  {
6952
7188
  name: "hide",
@@ -7591,7 +7827,7 @@
7591
7827
  let rowHeights = 0;
7592
7828
  for (let row of rows) {
7593
7829
  if (isRtl) {
7594
- row = row.reverse();
7830
+ row.reverse();
7595
7831
  }
7596
7832
  let height = 0;
7597
7833
  for (const j in row) {
@@ -7886,107 +8122,6 @@
7886
8122
  dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
7887
8123
  }
7888
8124
 
7889
- var svg = {
7890
- mixins: [Svg],
7891
- args: "src",
7892
- props: {
7893
- src: String,
7894
- icon: String,
7895
- attributes: "list",
7896
- strokeAnimation: Boolean
7897
- },
7898
- data: {
7899
- strokeAnimation: false
7900
- },
7901
- observe: [
7902
- mutation({
7903
- async handler() {
7904
- const svg = await this.svg;
7905
- if (svg) {
7906
- applyAttributes.call(this, svg);
7907
- }
7908
- },
7909
- options: {
7910
- attributes: true,
7911
- attributeFilter: ["id", "class", "style"]
7912
- }
7913
- })
7914
- ],
7915
- async connected() {
7916
- if (includes(this.src, "#")) {
7917
- [this.src, this.icon] = this.src.split("#");
7918
- }
7919
- const svg = await this.svg;
7920
- if (svg) {
7921
- applyAttributes.call(this, svg);
7922
- if (this.strokeAnimation) {
7923
- applyAnimation(svg);
7924
- }
7925
- }
7926
- },
7927
- methods: {
7928
- async getSvg() {
7929
- if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
7930
- await new Promise((resolve) => once(this.$el, "load", resolve));
7931
- }
7932
- return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
7933
- }
7934
- }
7935
- };
7936
- function applyAttributes(el) {
7937
- const { $el } = this;
7938
- addClass(el, attr($el, "class"), "uk-svg");
7939
- for (let i = 0; i < $el.style.length; i++) {
7940
- const prop = $el.style[i];
7941
- css(el, prop, css($el, prop));
7942
- }
7943
- for (const attribute in this.attributes) {
7944
- const [prop, value] = this.attributes[attribute].split(":", 2);
7945
- attr(el, prop, value);
7946
- }
7947
- if (!this.$el.id) {
7948
- removeAttr(el, "id");
7949
- }
7950
- }
7951
- const loadSVG = memoize(async (src) => {
7952
- if (src) {
7953
- if (startsWith(src, "data:")) {
7954
- return decodeURIComponent(src.split(",")[1]);
7955
- } else {
7956
- return (await fetch(src)).text();
7957
- }
7958
- } else {
7959
- return Promise.reject();
7960
- }
7961
- });
7962
- function parseSVG(svg, icon) {
7963
- if (icon && includes(svg, "<symbol")) {
7964
- svg = parseSymbols(svg)[icon] || svg;
7965
- }
7966
- return stringToSvg(svg);
7967
- }
7968
- const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
7969
- const parseSymbols = memoize(function(svg) {
7970
- const symbols = {};
7971
- symbolRe.lastIndex = 0;
7972
- let match;
7973
- while (match = symbolRe.exec(svg)) {
7974
- symbols[match[3]] = `<svg ${match[1]}svg>`;
7975
- }
7976
- return symbols;
7977
- });
7978
- function applyAnimation(el) {
7979
- const length = getMaxPathLength(el);
7980
- if (length) {
7981
- css(el, "--uk-animation-stroke", length);
7982
- }
7983
- }
7984
- function stringToSvg(string) {
7985
- const container = document.createElement("template");
7986
- container.innerHTML = string;
7987
- return container.content.firstElementChild;
7988
- }
7989
-
7990
8125
  const icons = {
7991
8126
  spinner,
7992
8127
  totop,
@@ -8157,7 +8292,7 @@
8157
8292
  return null;
8158
8293
  }
8159
8294
  if (!parsed[icon]) {
8160
- parsed[icon] = stringToSvg(icons[applyRtl(icon)] || icons[icon]);
8295
+ parsed[icon] = fragment(icons[applyRtl(icon)] || icons[icon]);
8161
8296
  }
8162
8297
  return parsed[icon].cloneNode(true);
8163
8298
  }
@@ -8165,123 +8300,6 @@
8165
8300
  return isRtl ? swap(swap(icon, "left", "right"), "previous", "next") : icon;
8166
8301
  }
8167
8302
 
8168
- var img = {
8169
- args: "dataSrc",
8170
- props: {
8171
- dataSrc: String,
8172
- sources: String,
8173
- margin: String,
8174
- target: String,
8175
- loading: String
8176
- },
8177
- data: {
8178
- dataSrc: "",
8179
- sources: false,
8180
- margin: "50%",
8181
- target: false,
8182
- loading: "lazy"
8183
- },
8184
- connected() {
8185
- if (this.loading !== "lazy") {
8186
- this.load();
8187
- } else if (isImg(this.$el)) {
8188
- this.$el.loading = "lazy";
8189
- setSrcAttrs(this.$el);
8190
- }
8191
- },
8192
- disconnected() {
8193
- if (this.img) {
8194
- this.img.onload = "";
8195
- }
8196
- delete this.img;
8197
- },
8198
- observe: intersection({
8199
- handler(entries, observer) {
8200
- this.load();
8201
- observer.disconnect();
8202
- },
8203
- options: ({ margin }) => ({ rootMargin: margin }),
8204
- filter: ({ loading }) => loading === "lazy",
8205
- target: ({ $el, $props }) => $props.target ? [$el, ...queryAll($props.target, $el)] : $el
8206
- }),
8207
- methods: {
8208
- load() {
8209
- if (this.img) {
8210
- return this.img;
8211
- }
8212
- const image = isImg(this.$el) ? this.$el : getImageFromElement(this.$el, this.dataSrc, this.sources);
8213
- removeAttr(image, "loading");
8214
- setSrcAttrs(this.$el, image.currentSrc);
8215
- return this.img = image;
8216
- }
8217
- }
8218
- };
8219
- function setSrcAttrs(el, src) {
8220
- if (isImg(el)) {
8221
- const parentNode = parent(el);
8222
- const elements = isTag(parentNode, "picture") ? children(parentNode) : [el];
8223
- elements.forEach((el2) => setSourceProps(el2, el2));
8224
- } else if (src) {
8225
- const change = !includes(el.style.backgroundImage, src);
8226
- if (change) {
8227
- css(el, "backgroundImage", `url(${escape(src)})`);
8228
- trigger(el, createEvent("load", false));
8229
- }
8230
- }
8231
- }
8232
- const srcProps = ["data-src", "data-srcset", "sizes"];
8233
- function setSourceProps(sourceEl, targetEl) {
8234
- for (const prop of srcProps) {
8235
- const value = data(sourceEl, prop);
8236
- if (value) {
8237
- attr(targetEl, prop.replace(/^(data-)+/, ""), value);
8238
- }
8239
- }
8240
- }
8241
- function getImageFromElement(el, src, sources) {
8242
- const img = new Image();
8243
- wrapInPicture(img, sources);
8244
- setSourceProps(el, img);
8245
- img.onload = () => {
8246
- setSrcAttrs(el, img.currentSrc);
8247
- };
8248
- attr(img, "src", src);
8249
- return img;
8250
- }
8251
- function wrapInPicture(img, sources) {
8252
- sources = parseSources(sources);
8253
- if (sources.length) {
8254
- const picture = fragment("<picture>");
8255
- for (const attrs of sources) {
8256
- const source = fragment("<source>");
8257
- attr(source, attrs);
8258
- append(picture, source);
8259
- }
8260
- append(picture, img);
8261
- }
8262
- }
8263
- function parseSources(sources) {
8264
- if (!sources) {
8265
- return [];
8266
- }
8267
- if (startsWith(sources, "[")) {
8268
- try {
8269
- sources = JSON.parse(sources);
8270
- } catch (e) {
8271
- sources = [];
8272
- }
8273
- } else {
8274
- sources = parseOptions(sources);
8275
- }
8276
- if (!isArray(sources)) {
8277
- sources = [sources];
8278
- }
8279
- return sources.filter((source) => !isEmpty(source));
8280
- }
8281
- function isImg(el) {
8282
- return isTag(el, "img");
8283
- }
8284
-
8285
8303
  var inverse = {
8286
8304
  props: {
8287
8305
  target: String,
@@ -8596,7 +8614,10 @@
8596
8614
  {
8597
8615
  name: "hide",
8598
8616
  el: ({ dropContainer }) => dropContainer,
8599
- async handler() {
8617
+ async handler(e) {
8618
+ if (parent(e.target) !== this.dropContainer) {
8619
+ return;
8620
+ }
8600
8621
  await awaitMacroTask();
8601
8622
  if (!this.getActive() && this._transparent) {
8602
8623
  addClass(this.navbarContainer, clsNavbarTransparent);
@@ -8985,7 +9006,7 @@
8985
9006
  update: [
8986
9007
  {
8987
9008
  read() {
8988
- const targets = this.links.map((el) => getTargetedElement(el) || el.ownerDocument);
9009
+ const targets = this.links.map((el) => getTargetedElement(el)).filter(Boolean);
8989
9010
  const { length } = targets;
8990
9011
  if (!length || !isVisible(this.$el)) {
8991
9012
  return false;
@@ -9384,6 +9405,104 @@
9384
9405
  }
9385
9406
  }
9386
9407
 
9408
+ var svg = {
9409
+ mixins: [Svg],
9410
+ args: "src",
9411
+ props: {
9412
+ src: String,
9413
+ icon: String,
9414
+ attributes: "list",
9415
+ strokeAnimation: Boolean
9416
+ },
9417
+ data: {
9418
+ strokeAnimation: false
9419
+ },
9420
+ observe: [
9421
+ mutation({
9422
+ async handler() {
9423
+ const svg = await this.svg;
9424
+ if (svg) {
9425
+ applyAttributes.call(this, svg);
9426
+ }
9427
+ },
9428
+ options: {
9429
+ attributes: true,
9430
+ attributeFilter: ["id", "class", "style"]
9431
+ }
9432
+ })
9433
+ ],
9434
+ async connected() {
9435
+ if (includes(this.src, "#")) {
9436
+ [this.src, this.icon] = this.src.split("#");
9437
+ }
9438
+ const svg = await this.svg;
9439
+ if (svg) {
9440
+ applyAttributes.call(this, svg);
9441
+ if (this.strokeAnimation) {
9442
+ applyAnimation(svg);
9443
+ }
9444
+ }
9445
+ },
9446
+ methods: {
9447
+ async getSvg() {
9448
+ if (isTag(this.$el, "img") && !this.$el.complete && this.$el.loading === "lazy") {
9449
+ await new Promise((resolve) => once(this.$el, "load", resolve));
9450
+ }
9451
+ return parseSVG(await loadSVG(this.src), this.icon) || Promise.reject("SVG not found.");
9452
+ }
9453
+ }
9454
+ };
9455
+ function applyAttributes(el) {
9456
+ const { $el } = this;
9457
+ addClass(el, attr($el, "class"), "uk-svg");
9458
+ for (let i = 0; i < $el.style.length; i++) {
9459
+ const prop = $el.style[i];
9460
+ css(el, prop, css($el, prop));
9461
+ }
9462
+ for (const attribute in this.attributes) {
9463
+ const [prop, value] = this.attributes[attribute].split(":", 2);
9464
+ attr(el, prop, value);
9465
+ }
9466
+ if (!this.$el.id) {
9467
+ removeAttr(el, "id");
9468
+ }
9469
+ }
9470
+ const loadSVG = memoize(async (src) => {
9471
+ if (src) {
9472
+ if (startsWith(src, "data:")) {
9473
+ return decodeURIComponent(src.split(",")[1]);
9474
+ } else {
9475
+ const response = await fetch(src);
9476
+ if (response.headers.get("Content-Type") === "image/svg+xml") {
9477
+ return response.text();
9478
+ }
9479
+ }
9480
+ }
9481
+ return Promise.reject();
9482
+ });
9483
+ function parseSVG(svg, icon) {
9484
+ if (icon && includes(svg, "<symbol")) {
9485
+ svg = parseSymbols(svg)[icon] || svg;
9486
+ }
9487
+ return fragment(svg);
9488
+ }
9489
+ const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
9490
+ const parseSymbols = memoize(function(svg) {
9491
+ const symbols = {};
9492
+ symbolRe.lastIndex = 0;
9493
+ let match;
9494
+ while (match = symbolRe.exec(svg)) {
9495
+ symbols[match[3]] = `<svg ${match[1]}svg>`;
9496
+ }
9497
+ return symbols;
9498
+ });
9499
+ function applyAnimation(el) {
9500
+ const length = getMaxPathLength(el);
9501
+ if (length) {
9502
+ css(el, "--uk-animation-stroke", length);
9503
+ }
9504
+ }
9505
+
9387
9506
  const selDisabled = ".uk-disabled *, .uk-disabled, [disabled]";
9388
9507
  var Switcher = {
9389
9508
  mixins: [Togglable],