uikit 3.16.4-dev.fd2458e3b → 3.16.5-dev.dda1f1b31

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 (120) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +9 -1
  3. package/build/build.js +5 -4
  4. package/build/icons.js +2 -1
  5. package/build/less.js +2 -11
  6. package/build/prefix.js +2 -1
  7. package/build/release.js +4 -3
  8. package/build/scope.js +2 -1
  9. package/build/scss.js +2 -1
  10. package/build/util.js +3 -3
  11. package/dist/css/uikit-core-rtl.css +1 -1
  12. package/dist/css/uikit-core-rtl.min.css +1 -1
  13. package/dist/css/uikit-core.css +1 -1
  14. package/dist/css/uikit-core.min.css +1 -1
  15. package/dist/css/uikit-rtl.css +1 -1
  16. package/dist/css/uikit-rtl.min.css +1 -1
  17. package/dist/css/uikit.css +1 -1
  18. package/dist/css/uikit.min.css +1 -1
  19. package/dist/js/components/countdown.js +12 -14
  20. package/dist/js/components/countdown.min.js +1 -1
  21. package/dist/js/components/filter.js +506 -22
  22. package/dist/js/components/filter.min.js +1 -1
  23. package/dist/js/components/lightbox-panel.js +2601 -310
  24. package/dist/js/components/lightbox-panel.min.js +1 -1
  25. package/dist/js/components/lightbox.js +2612 -323
  26. package/dist/js/components/lightbox.min.js +1 -1
  27. package/dist/js/components/notification.js +1 -1
  28. package/dist/js/components/notification.min.js +1 -1
  29. package/dist/js/components/parallax.js +466 -43
  30. package/dist/js/components/parallax.min.js +1 -1
  31. package/dist/js/components/slider-parallax.js +184 -2
  32. package/dist/js/components/slider-parallax.min.js +1 -1
  33. package/dist/js/components/slider.js +2345 -49
  34. package/dist/js/components/slider.min.js +1 -1
  35. package/dist/js/components/slideshow-parallax.js +184 -2
  36. package/dist/js/components/slideshow-parallax.min.js +1 -1
  37. package/dist/js/components/slideshow.js +2339 -49
  38. package/dist/js/components/slideshow.min.js +1 -1
  39. package/dist/js/components/sortable.js +472 -1
  40. package/dist/js/components/sortable.min.js +1 -1
  41. package/dist/js/components/tooltip.js +2298 -11
  42. package/dist/js/components/tooltip.min.js +1 -1
  43. package/dist/js/components/upload.js +1 -1
  44. package/dist/js/components/upload.min.js +1 -1
  45. package/dist/js/uikit-core.js +951 -931
  46. package/dist/js/uikit-core.min.js +1 -1
  47. package/dist/js/uikit-icons.js +153 -152
  48. package/dist/js/uikit-icons.min.js +1 -1
  49. package/dist/js/uikit.js +979 -954
  50. package/dist/js/uikit.min.js +1 -1
  51. package/package.json +2 -2
  52. package/src/images/icons/mastodon.svg +3 -0
  53. package/src/js/api/app.js +12 -0
  54. package/src/js/api/boot.js +64 -43
  55. package/src/js/api/component.js +60 -61
  56. package/src/js/api/computed.js +39 -0
  57. package/src/js/api/events.js +45 -0
  58. package/src/js/api/global.js +58 -56
  59. package/src/js/api/hooks.js +35 -114
  60. package/src/js/api/index.js +8 -24
  61. package/src/js/api/instance.js +55 -55
  62. package/src/js/api/log.js +10 -0
  63. package/src/js/api/observables.js +125 -0
  64. package/src/js/api/observer.js +76 -0
  65. package/src/js/{util → api}/options.js +38 -1
  66. package/src/js/api/props.js +102 -0
  67. package/src/js/api/state.js +26 -280
  68. package/src/js/api/update.js +77 -0
  69. package/src/js/api/watch.js +34 -0
  70. package/src/js/components/countdown.js +14 -16
  71. package/src/js/components/filter.js +18 -24
  72. package/src/js/components/internal/slider-preload.js +5 -6
  73. package/src/js/components/lightbox-panel.js +1 -1
  74. package/src/js/components/lightbox.js +11 -23
  75. package/src/js/components/parallax.js +8 -6
  76. package/src/js/components/slider.js +10 -0
  77. package/src/js/components/tooltip.js +2 -1
  78. package/src/js/core/accordion.js +5 -6
  79. package/src/js/core/cover.js +9 -9
  80. package/src/js/core/drop.js +13 -6
  81. package/src/js/core/dropnav.js +1 -1
  82. package/src/js/core/grid.js +2 -5
  83. package/src/js/core/height-match.js +9 -16
  84. package/src/js/core/height-viewport.js +5 -7
  85. package/src/js/core/img.js +12 -19
  86. package/src/js/core/leader.js +4 -2
  87. package/src/js/core/margin.js +11 -21
  88. package/src/js/core/modal.js +1 -1
  89. package/src/js/core/offcanvas.js +6 -2
  90. package/src/js/core/overflow-auto.js +5 -5
  91. package/src/js/core/responsive.js +5 -7
  92. package/src/js/core/scroll.js +19 -10
  93. package/src/js/core/scrollspy-nav.js +6 -5
  94. package/src/js/core/scrollspy.js +27 -36
  95. package/src/js/core/sticky.js +12 -10
  96. package/src/js/core/svg.js +4 -2
  97. package/src/js/core/switcher.js +11 -9
  98. package/src/js/core/toggle.js +4 -4
  99. package/src/js/core/video.js +6 -14
  100. package/src/js/mixin/modal.js +2 -1
  101. package/src/js/mixin/parallax.js +1 -1
  102. package/src/js/mixin/slider-nav.js +2 -1
  103. package/src/js/mixin/slider.js +9 -3
  104. package/src/js/util/filter.js +13 -0
  105. package/src/js/util/index.js +0 -1
  106. package/src/js/util/keys.js +11 -0
  107. package/src/js/util/lang.js +7 -7
  108. package/src/js/util/observer.js +4 -2
  109. package/src/js/util/scroll.js +42 -0
  110. package/src/js/util/svg.js +16 -0
  111. package/src/js/util/viewport.js +1 -1
  112. package/src/scss/mixins-theme.scss +1640 -1596
  113. package/src/scss/mixins.scss +1370 -1370
  114. package/src/scss/variables-theme.scss +1255 -1255
  115. package/src/scss/variables.scss +1113 -1113
  116. package/src/js/mixin/lazyload.js +0 -27
  117. package/src/js/mixin/resize.js +0 -11
  118. package/src/js/mixin/scroll.js +0 -32
  119. package/src/js/mixin/swipe.js +0 -72
  120. package/src/js/mixin/utils.js +0 -91
@@ -1,4 +1,4 @@
1
- /*! UIkit 3.16.4-dev.fd2458e3b | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
1
+ /*! UIkit 3.16.5-dev.dda1f1b31 | https://www.getuikit.com | (c) 2014 - 2023 YOOtheme | MIT License */
2
2
 
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
@@ -12,6 +12,1696 @@
12
12
  }
13
13
  };
14
14
 
15
+ const { hasOwnProperty, toString } = Object.prototype;
16
+ function hasOwn(obj, key) {
17
+ return hasOwnProperty.call(obj, key);
18
+ }
19
+ const hyphenateRe = /\B([A-Z])/g;
20
+ const hyphenate = memoize((str) => str.replace(hyphenateRe, "-$1").toLowerCase());
21
+ const camelizeRe = /-(\w)/g;
22
+ const camelize = memoize(
23
+ (str) => (str.charAt(0).toLowerCase() + str.slice(1)).replace(camelizeRe, (_, c) => c.toUpperCase())
24
+ );
25
+ const ucfirst = memoize((str) => str.charAt(0).toUpperCase() + str.slice(1));
26
+ function startsWith(str, search) {
27
+ var _a;
28
+ return (_a = str == null ? void 0 : str.startsWith) == null ? void 0 : _a.call(str, search);
29
+ }
30
+ function endsWith(str, search) {
31
+ var _a;
32
+ return (_a = str == null ? void 0 : str.endsWith) == null ? void 0 : _a.call(str, search);
33
+ }
34
+ function includes(obj, search) {
35
+ var _a;
36
+ return (_a = obj == null ? void 0 : obj.includes) == null ? void 0 : _a.call(obj, search);
37
+ }
38
+ function findIndex(array, predicate) {
39
+ var _a;
40
+ return (_a = array == null ? void 0 : array.findIndex) == null ? void 0 : _a.call(array, predicate);
41
+ }
42
+ const { isArray, from: toArray } = Array;
43
+ const { assign } = Object;
44
+ function isFunction(obj) {
45
+ return typeof obj === "function";
46
+ }
47
+ function isObject(obj) {
48
+ return obj !== null && typeof obj === "object";
49
+ }
50
+ function isPlainObject(obj) {
51
+ return toString.call(obj) === "[object Object]";
52
+ }
53
+ function isWindow(obj) {
54
+ return isObject(obj) && obj === obj.window;
55
+ }
56
+ function isDocument(obj) {
57
+ return nodeType(obj) === 9;
58
+ }
59
+ function isNode(obj) {
60
+ return nodeType(obj) >= 1;
61
+ }
62
+ function isElement(obj) {
63
+ return nodeType(obj) === 1;
64
+ }
65
+ function nodeType(obj) {
66
+ return !isWindow(obj) && isObject(obj) && obj.nodeType;
67
+ }
68
+ function isBoolean(value) {
69
+ return typeof value === "boolean";
70
+ }
71
+ function isString(value) {
72
+ return typeof value === "string";
73
+ }
74
+ function isNumber(value) {
75
+ return typeof value === "number";
76
+ }
77
+ function isNumeric(value) {
78
+ return isNumber(value) || isString(value) && !isNaN(value - parseFloat(value));
79
+ }
80
+ function isEmpty(obj) {
81
+ return !(isArray(obj) ? obj.length : isObject(obj) ? Object.keys(obj).length : false);
82
+ }
83
+ function isUndefined(value) {
84
+ return value === void 0;
85
+ }
86
+ function toBoolean(value) {
87
+ return isBoolean(value) ? value : value === "true" || value === "1" || value === "" ? true : value === "false" || value === "0" ? false : value;
88
+ }
89
+ function toNumber(value) {
90
+ const number = Number(value);
91
+ return isNaN(number) ? false : number;
92
+ }
93
+ function toFloat(value) {
94
+ return parseFloat(value) || 0;
95
+ }
96
+ function toNode(element) {
97
+ return toNodes(element)[0];
98
+ }
99
+ function toNodes(element) {
100
+ return isNode(element) ? [element] : Array.from(element || []).filter(isNode);
101
+ }
102
+ function toWindow(element) {
103
+ if (isWindow(element)) {
104
+ return element;
105
+ }
106
+ element = toNode(element);
107
+ const document = isDocument(element) ? element : element == null ? void 0 : element.ownerDocument;
108
+ return (document == null ? void 0 : document.defaultView) || window;
109
+ }
110
+ function isEqual(value, other) {
111
+ return value === other || isObject(value) && isObject(other) && Object.keys(value).length === Object.keys(other).length && each(value, (val, key) => val === other[key]);
112
+ }
113
+ function swap(value, a, b) {
114
+ return value.replace(new RegExp(`${a}|${b}`, "g"), (match) => match === a ? b : a);
115
+ }
116
+ function last(array) {
117
+ return array[array.length - 1];
118
+ }
119
+ function each(obj, cb) {
120
+ for (const key in obj) {
121
+ if (false === cb(obj[key], key)) {
122
+ return false;
123
+ }
124
+ }
125
+ return true;
126
+ }
127
+ function sortBy(array, prop) {
128
+ return array.slice().sort(
129
+ ({ [prop]: propA = 0 }, { [prop]: propB = 0 }) => propA > propB ? 1 : propB > propA ? -1 : 0
130
+ );
131
+ }
132
+ function sumBy(array, iteratee) {
133
+ return array.reduce(
134
+ (sum, item) => sum + toFloat(isFunction(iteratee) ? iteratee(item) : item[iteratee]),
135
+ 0
136
+ );
137
+ }
138
+ function uniqueBy(array, prop) {
139
+ const seen = /* @__PURE__ */ new Set();
140
+ return array.filter(({ [prop]: check }) => seen.has(check) ? false : seen.add(check));
141
+ }
142
+ function pick(obj, props) {
143
+ return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});
144
+ }
145
+ function clamp(number, min = 0, max = 1) {
146
+ return Math.min(Math.max(toNumber(number) || 0, min), max);
147
+ }
148
+ function noop() {
149
+ }
150
+ function intersectRect(...rects) {
151
+ return [
152
+ ["bottom", "top"],
153
+ ["right", "left"]
154
+ ].every(
155
+ ([minProp, maxProp]) => Math.min(...rects.map(({ [minProp]: min }) => min)) - Math.max(...rects.map(({ [maxProp]: max }) => max)) > 0
156
+ );
157
+ }
158
+ function pointInRect(point, rect) {
159
+ return point.x <= rect.right && point.x >= rect.left && point.y <= rect.bottom && point.y >= rect.top;
160
+ }
161
+ function ratio(dimensions, prop, value) {
162
+ const aProp = prop === "width" ? "height" : "width";
163
+ return {
164
+ [aProp]: dimensions[prop] ? Math.round(value * dimensions[aProp] / dimensions[prop]) : dimensions[aProp],
165
+ [prop]: value
166
+ };
167
+ }
168
+ function contain(dimensions, maxDimensions) {
169
+ dimensions = { ...dimensions };
170
+ for (const prop in dimensions) {
171
+ dimensions = dimensions[prop] > maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;
172
+ }
173
+ return dimensions;
174
+ }
175
+ function cover(dimensions, maxDimensions) {
176
+ dimensions = contain(dimensions, maxDimensions);
177
+ for (const prop in dimensions) {
178
+ dimensions = dimensions[prop] < maxDimensions[prop] ? ratio(dimensions, prop, maxDimensions[prop]) : dimensions;
179
+ }
180
+ return dimensions;
181
+ }
182
+ const Dimensions = { ratio, contain, cover };
183
+ function getIndex(i, elements, current = 0, finite = false) {
184
+ elements = toNodes(elements);
185
+ const { length } = elements;
186
+ if (!length) {
187
+ return -1;
188
+ }
189
+ i = isNumeric(i) ? toNumber(i) : i === "next" ? current + 1 : i === "previous" ? current - 1 : i === "last" ? length - 1 : elements.indexOf(toNode(i));
190
+ if (finite) {
191
+ return clamp(i, 0, length - 1);
192
+ }
193
+ i %= length;
194
+ return i < 0 ? i + length : i;
195
+ }
196
+ function memoize(fn) {
197
+ const cache = /* @__PURE__ */ Object.create(null);
198
+ return (key) => cache[key] || (cache[key] = fn(key));
199
+ }
200
+ class Deferred {
201
+ constructor() {
202
+ this.promise = new Promise((resolve, reject) => {
203
+ this.reject = reject;
204
+ this.resolve = resolve;
205
+ });
206
+ }
207
+ }
208
+
209
+ function attr(element, name, value) {
210
+ var _a;
211
+ if (isObject(name)) {
212
+ for (const key in name) {
213
+ attr(element, key, name[key]);
214
+ }
215
+ return;
216
+ }
217
+ if (isUndefined(value)) {
218
+ return (_a = toNode(element)) == null ? void 0 : _a.getAttribute(name);
219
+ } else {
220
+ for (const el of toNodes(element)) {
221
+ if (isFunction(value)) {
222
+ value = value.call(el, attr(el, name));
223
+ }
224
+ if (value === null) {
225
+ removeAttr(el, name);
226
+ } else {
227
+ el.setAttribute(name, value);
228
+ }
229
+ }
230
+ }
231
+ }
232
+ function hasAttr(element, name) {
233
+ return toNodes(element).some((element2) => element2.hasAttribute(name));
234
+ }
235
+ function removeAttr(element, name) {
236
+ toNodes(element).forEach((element2) => element2.removeAttribute(name));
237
+ }
238
+ function data(element, attribute) {
239
+ for (const name of [attribute, `data-${attribute}`]) {
240
+ if (hasAttr(element, name)) {
241
+ return attr(element, name);
242
+ }
243
+ }
244
+ }
245
+
246
+ const voidElements = {
247
+ area: true,
248
+ base: true,
249
+ br: true,
250
+ col: true,
251
+ embed: true,
252
+ hr: true,
253
+ img: true,
254
+ input: true,
255
+ keygen: true,
256
+ link: true,
257
+ meta: true,
258
+ param: true,
259
+ source: true,
260
+ track: true,
261
+ wbr: true
262
+ };
263
+ function isVoidElement(element) {
264
+ return toNodes(element).some((element2) => voidElements[element2.tagName.toLowerCase()]);
265
+ }
266
+ function isVisible(element) {
267
+ return toNodes(element).some(
268
+ (element2) => element2.offsetWidth || element2.offsetHeight || element2.getClientRects().length
269
+ );
270
+ }
271
+ const selInput = "input,select,textarea,button";
272
+ function isInput(element) {
273
+ return toNodes(element).some((element2) => matches(element2, selInput));
274
+ }
275
+ const selFocusable = `${selInput},a[href],[tabindex]`;
276
+ function isFocusable(element) {
277
+ return matches(element, selFocusable);
278
+ }
279
+ function parent(element) {
280
+ var _a;
281
+ return (_a = toNode(element)) == null ? void 0 : _a.parentElement;
282
+ }
283
+ function filter(element, selector) {
284
+ return toNodes(element).filter((element2) => matches(element2, selector));
285
+ }
286
+ function matches(element, selector) {
287
+ return toNodes(element).some((element2) => element2.matches(selector));
288
+ }
289
+ function closest(element, selector) {
290
+ return isElement(element) ? element.closest(startsWith(selector, ">") ? selector.slice(1) : selector) : toNodes(element).map((element2) => closest(element2, selector)).filter(Boolean);
291
+ }
292
+ function within(element, selector) {
293
+ return isString(selector) ? !!closest(element, selector) : toNode(selector).contains(toNode(element));
294
+ }
295
+ function parents(element, selector) {
296
+ const elements = [];
297
+ while (element = parent(element)) {
298
+ if (!selector || matches(element, selector)) {
299
+ elements.push(element);
300
+ }
301
+ }
302
+ return elements;
303
+ }
304
+ function children(element, selector) {
305
+ element = toNode(element);
306
+ const children2 = element ? toNodes(element.children) : [];
307
+ return selector ? filter(children2, selector) : children2;
308
+ }
309
+ function index(element, ref) {
310
+ return ref ? toNodes(element).indexOf(toNode(ref)) : children(parent(element)).indexOf(element);
311
+ }
312
+ function isSameSiteAnchor(el) {
313
+ el = toNode(el);
314
+ return el && ["origin", "pathname", "search"].every((part) => el[part] === location[part]);
315
+ }
316
+ function getTargetedElement(el) {
317
+ if (isSameSiteAnchor(el)) {
318
+ el = toNode(el);
319
+ const id = decodeURIComponent(el.hash).substring(1);
320
+ return document.getElementById(id) || document.getElementsByName(id)[0];
321
+ }
322
+ }
323
+
324
+ function query(selector, context) {
325
+ return find(selector, getContext(selector, context));
326
+ }
327
+ function queryAll(selector, context) {
328
+ return findAll(selector, getContext(selector, context));
329
+ }
330
+ function find(selector, context) {
331
+ return toNode(_query(selector, toNode(context), "querySelector"));
332
+ }
333
+ function findAll(selector, context) {
334
+ return toNodes(_query(selector, toNode(context), "querySelectorAll"));
335
+ }
336
+ const contextSelectorRe = /(^|[^\\],)\s*[!>+~-]/;
337
+ const isContextSelector = memoize((selector) => selector.match(contextSelectorRe));
338
+ function getContext(selector, context = document) {
339
+ return isString(selector) && isContextSelector(selector) || isDocument(context) ? context : context.ownerDocument;
340
+ }
341
+ const contextSanitizeRe = /([!>+~-])(?=\s+[!>+~-]|\s*$)/g;
342
+ const sanatize = memoize((selector) => selector.replace(contextSanitizeRe, "$1 *"));
343
+ function _query(selector, context = document, queryFn) {
344
+ if (!selector || !isString(selector)) {
345
+ return selector;
346
+ }
347
+ selector = sanatize(selector);
348
+ if (isContextSelector(selector)) {
349
+ const split = splitSelector(selector);
350
+ selector = "";
351
+ for (let sel of split) {
352
+ let ctx = context;
353
+ if (sel[0] === "!") {
354
+ const selectors = sel.substr(1).trim().split(" ");
355
+ ctx = closest(parent(context), selectors[0]);
356
+ sel = selectors.slice(1).join(" ").trim();
357
+ if (!sel.length && split.length === 1) {
358
+ return ctx;
359
+ }
360
+ }
361
+ if (sel[0] === "-") {
362
+ const selectors = sel.substr(1).trim().split(" ");
363
+ const prev = (ctx || context).previousElementSibling;
364
+ ctx = matches(prev, sel.substr(1)) ? prev : null;
365
+ sel = selectors.slice(1).join(" ");
366
+ }
367
+ if (ctx) {
368
+ selector += `${selector ? "," : ""}${domPath(ctx)} ${sel}`;
369
+ }
370
+ }
371
+ context = document;
372
+ }
373
+ try {
374
+ return context[queryFn](selector);
375
+ } catch (e) {
376
+ return null;
377
+ }
378
+ }
379
+ const selectorRe = /.*?[^\\](?:,|$)/g;
380
+ const splitSelector = memoize(
381
+ (selector) => selector.match(selectorRe).map((selector2) => selector2.replace(/,$/, "").trim())
382
+ );
383
+ function domPath(element) {
384
+ const names = [];
385
+ while (element.parentNode) {
386
+ const id = attr(element, "id");
387
+ if (id) {
388
+ names.unshift(`#${escape(id)}`);
389
+ break;
390
+ } else {
391
+ let { tagName } = element;
392
+ if (tagName !== "HTML") {
393
+ tagName += `:nth-child(${index(element) + 1})`;
394
+ }
395
+ names.unshift(tagName);
396
+ element = element.parentNode;
397
+ }
398
+ }
399
+ return names.join(" > ");
400
+ }
401
+ function escape(css) {
402
+ return isString(css) ? CSS.escape(css) : "";
403
+ }
404
+
405
+ function on(...args) {
406
+ let [targets, types, selector, listener, useCapture = false] = getArgs(args);
407
+ if (listener.length > 1) {
408
+ listener = detail(listener);
409
+ }
410
+ if (useCapture == null ? void 0 : useCapture.self) {
411
+ listener = selfFilter(listener);
412
+ }
413
+ if (selector) {
414
+ listener = delegate(selector, listener);
415
+ }
416
+ for (const type of types) {
417
+ for (const target of targets) {
418
+ target.addEventListener(type, listener, useCapture);
419
+ }
420
+ }
421
+ return () => off(targets, types, listener, useCapture);
422
+ }
423
+ function off(...args) {
424
+ let [targets, types, , listener, useCapture = false] = getArgs(args);
425
+ for (const type of types) {
426
+ for (const target of targets) {
427
+ target.removeEventListener(type, listener, useCapture);
428
+ }
429
+ }
430
+ }
431
+ function once(...args) {
432
+ const [element, types, selector, listener, useCapture = false, condition] = getArgs(args);
433
+ const off2 = on(
434
+ element,
435
+ types,
436
+ selector,
437
+ (e) => {
438
+ const result = !condition || condition(e);
439
+ if (result) {
440
+ off2();
441
+ listener(e, result);
442
+ }
443
+ },
444
+ useCapture
445
+ );
446
+ return off2;
447
+ }
448
+ function trigger(targets, event, detail2) {
449
+ return toEventTargets(targets).every(
450
+ (target) => target.dispatchEvent(createEvent(event, true, true, detail2))
451
+ );
452
+ }
453
+ function createEvent(e, bubbles = true, cancelable = false, detail2) {
454
+ if (isString(e)) {
455
+ e = new CustomEvent(e, { bubbles, cancelable, detail: detail2 });
456
+ }
457
+ return e;
458
+ }
459
+ function getArgs(args) {
460
+ args[0] = toEventTargets(args[0]);
461
+ if (isString(args[1])) {
462
+ args[1] = args[1].split(" ");
463
+ }
464
+ if (isFunction(args[2])) {
465
+ args.splice(2, 0, false);
466
+ }
467
+ return args;
468
+ }
469
+ function delegate(selector, listener) {
470
+ return (e) => {
471
+ const current = selector[0] === ">" ? findAll(selector, e.currentTarget).reverse().filter((element) => within(e.target, element))[0] : closest(e.target, selector);
472
+ if (current) {
473
+ e.current = current;
474
+ listener.call(this, e);
475
+ delete e.current;
476
+ }
477
+ };
478
+ }
479
+ function detail(listener) {
480
+ return (e) => isArray(e.detail) ? listener(e, ...e.detail) : listener(e);
481
+ }
482
+ function selfFilter(listener) {
483
+ return function(e) {
484
+ if (e.target === e.currentTarget || e.target === e.current) {
485
+ return listener.call(null, e);
486
+ }
487
+ };
488
+ }
489
+ function isEventTarget(target) {
490
+ return target && "addEventListener" in target;
491
+ }
492
+ function toEventTarget(target) {
493
+ return isEventTarget(target) ? target : toNode(target);
494
+ }
495
+ function toEventTargets(target) {
496
+ return isArray(target) ? target.map(toEventTarget).filter(Boolean) : isString(target) ? findAll(target) : isEventTarget(target) ? [target] : toNodes(target);
497
+ }
498
+ function isTouch(e) {
499
+ return e.pointerType === "touch" || !!e.touches;
500
+ }
501
+ function getEventPos(e) {
502
+ var _a, _b;
503
+ const { clientX: x, clientY: y } = ((_a = e.touches) == null ? void 0 : _a[0]) || ((_b = e.changedTouches) == null ? void 0 : _b[0]) || e;
504
+ return { x, y };
505
+ }
506
+
507
+ const cssNumber = {
508
+ "animation-iteration-count": true,
509
+ "column-count": true,
510
+ "fill-opacity": true,
511
+ "flex-grow": true,
512
+ "flex-shrink": true,
513
+ "font-weight": true,
514
+ "line-height": true,
515
+ opacity: true,
516
+ order: true,
517
+ orphans: true,
518
+ "stroke-dasharray": true,
519
+ "stroke-dashoffset": true,
520
+ widows: true,
521
+ "z-index": true,
522
+ zoom: true
523
+ };
524
+ function css(element, property, value, priority) {
525
+ const elements = toNodes(element);
526
+ for (const element2 of elements) {
527
+ if (isString(property)) {
528
+ property = propName(property);
529
+ if (isUndefined(value)) {
530
+ return getComputedStyle(element2).getPropertyValue(property);
531
+ } else {
532
+ element2.style.setProperty(
533
+ property,
534
+ isNumeric(value) && !cssNumber[property] ? `${value}px` : value || isNumber(value) ? value : "",
535
+ priority
536
+ );
537
+ }
538
+ } else if (isArray(property)) {
539
+ const props = {};
540
+ for (const prop of property) {
541
+ props[prop] = css(element2, prop);
542
+ }
543
+ return props;
544
+ } else if (isObject(property)) {
545
+ priority = value;
546
+ each(property, (value2, property2) => css(element2, property2, value2, priority));
547
+ }
548
+ }
549
+ return elements[0];
550
+ }
551
+ const propName = memoize((name) => vendorPropName(name));
552
+ function vendorPropName(name) {
553
+ if (startsWith(name, "--")) {
554
+ return name;
555
+ }
556
+ name = hyphenate(name);
557
+ const { style } = document.documentElement;
558
+ if (name in style) {
559
+ return name;
560
+ }
561
+ for (const prefix of ["webkit", "moz"]) {
562
+ const prefixedName = `-${prefix}-${name}`;
563
+ if (prefixedName in style) {
564
+ return prefixedName;
565
+ }
566
+ }
567
+ }
568
+
569
+ function addClass(element, ...args) {
570
+ apply$1(element, args, "add");
571
+ }
572
+ function removeClass(element, ...args) {
573
+ apply$1(element, args, "remove");
574
+ }
575
+ function removeClasses(element, cls) {
576
+ attr(
577
+ element,
578
+ "class",
579
+ (value) => (value || "").replace(new RegExp(`\\b${cls}\\b\\s?`, "g"), "")
580
+ );
581
+ }
582
+ function replaceClass(element, ...args) {
583
+ args[0] && removeClass(element, args[0]);
584
+ args[1] && addClass(element, args[1]);
585
+ }
586
+ function hasClass(element, cls) {
587
+ [cls] = getClasses(cls);
588
+ return !!cls && toNodes(element).some((node) => node.classList.contains(cls));
589
+ }
590
+ function toggleClass(element, cls, force) {
591
+ const classes = getClasses(cls);
592
+ if (!isUndefined(force)) {
593
+ force = !!force;
594
+ }
595
+ for (const node of toNodes(element)) {
596
+ for (const cls2 of classes) {
597
+ node.classList.toggle(cls2, force);
598
+ }
599
+ }
600
+ }
601
+ function apply$1(element, args, fn) {
602
+ args = args.reduce((args2, arg) => args2.concat(getClasses(arg)), []);
603
+ for (const node of toNodes(element)) {
604
+ node.classList[fn](...args);
605
+ }
606
+ }
607
+ function getClasses(str) {
608
+ return String(str).split(/[ ,]/).filter(Boolean);
609
+ }
610
+
611
+ function transition(element, props, duration = 400, timing = "linear") {
612
+ duration = Math.round(duration);
613
+ return Promise.all(
614
+ toNodes(element).map(
615
+ (element2) => new Promise((resolve, reject) => {
616
+ for (const name in props) {
617
+ const value = css(element2, name);
618
+ if (value === "") {
619
+ css(element2, name, value);
620
+ }
621
+ }
622
+ const timer = setTimeout(() => trigger(element2, "transitionend"), duration);
623
+ once(
624
+ element2,
625
+ "transitionend transitioncanceled",
626
+ ({ type }) => {
627
+ clearTimeout(timer);
628
+ removeClass(element2, "uk-transition");
629
+ css(element2, {
630
+ transitionProperty: "",
631
+ transitionDuration: "",
632
+ transitionTimingFunction: ""
633
+ });
634
+ type === "transitioncanceled" ? reject() : resolve(element2);
635
+ },
636
+ { self: true }
637
+ );
638
+ addClass(element2, "uk-transition");
639
+ css(element2, {
640
+ transitionProperty: Object.keys(props).map(propName).join(","),
641
+ transitionDuration: `${duration}ms`,
642
+ transitionTimingFunction: timing,
643
+ ...props
644
+ });
645
+ })
646
+ )
647
+ );
648
+ }
649
+ const Transition = {
650
+ start: transition,
651
+ async stop(element) {
652
+ trigger(element, "transitionend");
653
+ await Promise.resolve();
654
+ },
655
+ async cancel(element) {
656
+ trigger(element, "transitioncanceled");
657
+ await Promise.resolve();
658
+ },
659
+ inProgress(element) {
660
+ return hasClass(element, "uk-transition");
661
+ }
662
+ };
663
+ const animationPrefix = "uk-animation-";
664
+ function animate(element, animation, duration = 200, origin, out) {
665
+ return Promise.all(
666
+ toNodes(element).map(
667
+ (element2) => new Promise((resolve, reject) => {
668
+ trigger(element2, "animationcanceled");
669
+ const timer = setTimeout(() => trigger(element2, "animationend"), duration);
670
+ once(
671
+ element2,
672
+ "animationend animationcanceled",
673
+ ({ type }) => {
674
+ clearTimeout(timer);
675
+ type === "animationcanceled" ? reject() : resolve(element2);
676
+ css(element2, "animationDuration", "");
677
+ removeClasses(element2, `${animationPrefix}\\S*`);
678
+ },
679
+ { self: true }
680
+ );
681
+ css(element2, "animationDuration", `${duration}ms`);
682
+ addClass(element2, animation, animationPrefix + (out ? "leave" : "enter"));
683
+ if (startsWith(animation, animationPrefix)) {
684
+ origin && addClass(element2, `uk-transform-origin-${origin}`);
685
+ out && addClass(element2, `${animationPrefix}reverse`);
686
+ }
687
+ })
688
+ )
689
+ );
690
+ }
691
+ const inProgressRe = new RegExp(`${animationPrefix}(enter|leave)`);
692
+ const Animation = {
693
+ in: animate,
694
+ out(element, animation, duration, origin) {
695
+ return animate(element, animation, duration, origin, true);
696
+ },
697
+ inProgress(element) {
698
+ return inProgressRe.test(attr(element, "class"));
699
+ },
700
+ cancel(element) {
701
+ trigger(element, "animationcanceled");
702
+ }
703
+ };
704
+
705
+ function ready(fn) {
706
+ if (document.readyState !== "loading") {
707
+ fn();
708
+ return;
709
+ }
710
+ once(document, "DOMContentLoaded", fn);
711
+ }
712
+ function isTag(element, ...tagNames) {
713
+ return tagNames.some((tagName) => {
714
+ var _a;
715
+ return ((_a = element == null ? void 0 : element.tagName) == null ? void 0 : _a.toLowerCase()) === tagName.toLowerCase();
716
+ });
717
+ }
718
+ function empty(element) {
719
+ element = $(element);
720
+ element.innerHTML = "";
721
+ return element;
722
+ }
723
+ function html(parent2, html2) {
724
+ return isUndefined(html2) ? $(parent2).innerHTML : append(empty(parent2), html2);
725
+ }
726
+ const prepend = applyFn("prepend");
727
+ const append = applyFn("append");
728
+ const before = applyFn("before");
729
+ const after = applyFn("after");
730
+ function applyFn(fn) {
731
+ return function(ref, element) {
732
+ var _a;
733
+ const nodes = toNodes(isString(element) ? fragment(element) : element);
734
+ (_a = $(ref)) == null ? void 0 : _a[fn](...nodes);
735
+ return unwrapSingle(nodes);
736
+ };
737
+ }
738
+ function remove$1(element) {
739
+ toNodes(element).forEach((element2) => element2.remove());
740
+ }
741
+ function wrapAll(element, structure) {
742
+ structure = toNode(before(element, structure));
743
+ while (structure.firstChild) {
744
+ structure = structure.firstChild;
745
+ }
746
+ append(structure, element);
747
+ return structure;
748
+ }
749
+ function wrapInner(element, structure) {
750
+ return toNodes(
751
+ toNodes(element).map(
752
+ (element2) => element2.hasChildNodes() ? wrapAll(toNodes(element2.childNodes), structure) : append(element2, structure)
753
+ )
754
+ );
755
+ }
756
+ function unwrap(element) {
757
+ toNodes(element).map(parent).filter((value, index, self) => self.indexOf(value) === index).forEach((parent2) => parent2.replaceWith(...parent2.childNodes));
758
+ }
759
+ const fragmentRe = /^\s*<(\w+|!)[^>]*>/;
760
+ const singleTagRe = /^<(\w+)\s*\/?>(?:<\/\1>)?$/;
761
+ function fragment(html2) {
762
+ const matches = singleTagRe.exec(html2);
763
+ if (matches) {
764
+ return document.createElement(matches[1]);
765
+ }
766
+ const container = document.createElement("div");
767
+ if (fragmentRe.test(html2)) {
768
+ container.insertAdjacentHTML("beforeend", html2.trim());
769
+ } else {
770
+ container.textContent = html2;
771
+ }
772
+ return unwrapSingle(container.childNodes);
773
+ }
774
+ function unwrapSingle(nodes) {
775
+ return nodes.length > 1 ? nodes : nodes[0];
776
+ }
777
+ function apply(node, fn) {
778
+ if (!isElement(node)) {
779
+ return;
780
+ }
781
+ fn(node);
782
+ node = node.firstElementChild;
783
+ while (node) {
784
+ const next = node.nextElementSibling;
785
+ apply(node, fn);
786
+ node = next;
787
+ }
788
+ }
789
+ function $(selector, context) {
790
+ return isHtml(selector) ? toNode(fragment(selector)) : find(selector, context);
791
+ }
792
+ function $$(selector, context) {
793
+ return isHtml(selector) ? toNodes(fragment(selector)) : findAll(selector, context);
794
+ }
795
+ function isHtml(str) {
796
+ return isString(str) && startsWith(str.trim(), "<");
797
+ }
798
+
799
+ const dirs$1 = {
800
+ width: ["left", "right"],
801
+ height: ["top", "bottom"]
802
+ };
803
+ function dimensions(element) {
804
+ const rect = isElement(element) ? toNode(element).getBoundingClientRect() : { height: height(element), width: width(element), top: 0, left: 0 };
805
+ return {
806
+ height: rect.height,
807
+ width: rect.width,
808
+ top: rect.top,
809
+ left: rect.left,
810
+ bottom: rect.top + rect.height,
811
+ right: rect.left + rect.width
812
+ };
813
+ }
814
+ function offset(element, coordinates) {
815
+ const currentOffset = dimensions(element);
816
+ if (element) {
817
+ const { scrollY, scrollX } = toWindow(element);
818
+ const offsetBy = { height: scrollY, width: scrollX };
819
+ for (const dir in dirs$1) {
820
+ for (const prop of dirs$1[dir]) {
821
+ currentOffset[prop] += offsetBy[dir];
822
+ }
823
+ }
824
+ }
825
+ if (!coordinates) {
826
+ return currentOffset;
827
+ }
828
+ const pos = css(element, "position");
829
+ each(
830
+ css(element, ["left", "top"]),
831
+ (value, prop) => css(
832
+ element,
833
+ prop,
834
+ coordinates[prop] - currentOffset[prop] + toFloat(pos === "absolute" && value === "auto" ? position(element)[prop] : value)
835
+ )
836
+ );
837
+ }
838
+ function position(element) {
839
+ let { top, left } = offset(element);
840
+ const {
841
+ ownerDocument: { body, documentElement },
842
+ offsetParent
843
+ } = toNode(element);
844
+ let parent = offsetParent || documentElement;
845
+ while (parent && (parent === body || parent === documentElement) && css(parent, "position") === "static") {
846
+ parent = parent.parentNode;
847
+ }
848
+ if (isElement(parent)) {
849
+ const parentOffset = offset(parent);
850
+ top -= parentOffset.top + toFloat(css(parent, "borderTopWidth"));
851
+ left -= parentOffset.left + toFloat(css(parent, "borderLeftWidth"));
852
+ }
853
+ return {
854
+ top: top - toFloat(css(element, "marginTop")),
855
+ left: left - toFloat(css(element, "marginLeft"))
856
+ };
857
+ }
858
+ function offsetPosition(element) {
859
+ element = toNode(element);
860
+ const offset2 = [element.offsetTop, element.offsetLeft];
861
+ while (element = element.offsetParent) {
862
+ offset2[0] += element.offsetTop + toFloat(css(element, `borderTopWidth`));
863
+ offset2[1] += element.offsetLeft + toFloat(css(element, `borderLeftWidth`));
864
+ if (css(element, "position") === "fixed") {
865
+ const win = toWindow(element);
866
+ offset2[0] += win.scrollY;
867
+ offset2[1] += win.scrollX;
868
+ return offset2;
869
+ }
870
+ }
871
+ return offset2;
872
+ }
873
+ const height = dimension("height");
874
+ const width = dimension("width");
875
+ function dimension(prop) {
876
+ const propName = ucfirst(prop);
877
+ return (element, value) => {
878
+ if (isUndefined(value)) {
879
+ if (isWindow(element)) {
880
+ return element[`inner${propName}`];
881
+ }
882
+ if (isDocument(element)) {
883
+ const doc = element.documentElement;
884
+ return Math.max(doc[`offset${propName}`], doc[`scroll${propName}`]);
885
+ }
886
+ element = toNode(element);
887
+ value = css(element, prop);
888
+ value = value === "auto" ? element[`offset${propName}`] : toFloat(value) || 0;
889
+ return value - boxModelAdjust(element, prop);
890
+ } else {
891
+ return css(
892
+ element,
893
+ prop,
894
+ !value && value !== 0 ? "" : +value + boxModelAdjust(element, prop) + "px"
895
+ );
896
+ }
897
+ };
898
+ }
899
+ function boxModelAdjust(element, prop, sizing = "border-box") {
900
+ return css(element, "boxSizing") === sizing ? sumBy(
901
+ dirs$1[prop].map(ucfirst),
902
+ (prop2) => toFloat(css(element, `padding${prop2}`)) + toFloat(css(element, `border${prop2}Width`))
903
+ ) : 0;
904
+ }
905
+ function flipPosition(pos) {
906
+ for (const dir in dirs$1) {
907
+ for (const i in dirs$1[dir]) {
908
+ if (dirs$1[dir][i] === pos) {
909
+ return dirs$1[dir][1 - i];
910
+ }
911
+ }
912
+ }
913
+ return pos;
914
+ }
915
+ function toPx(value, property = "width", element = window, offsetDim = false) {
916
+ if (!isString(value)) {
917
+ return toFloat(value);
918
+ }
919
+ return sumBy(parseCalc(value), (value2) => {
920
+ const unit = parseUnit(value2);
921
+ return unit ? percent(
922
+ unit === "vh" ? getViewportHeight() : unit === "vw" ? width(toWindow(element)) : offsetDim ? element[`offset${ucfirst(property)}`] : dimensions(element)[property],
923
+ value2
924
+ ) : value2;
925
+ });
926
+ }
927
+ const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
928
+ const parseCalc = memoize((calc) => calc.toString().replace(/\s/g, "").match(calcRe) || []);
929
+ const unitRe = /(?:v[hw]|%)$/;
930
+ const parseUnit = memoize((str) => (str.match(unitRe) || [])[0]);
931
+ function percent(base, value) {
932
+ return base * toFloat(value) / 100;
933
+ }
934
+ let vh;
935
+ let vhEl;
936
+ function getViewportHeight() {
937
+ if (vh) {
938
+ return vh;
939
+ }
940
+ if (!vhEl) {
941
+ vhEl = $("<div>");
942
+ css(vhEl, {
943
+ height: "100vh",
944
+ position: "fixed"
945
+ });
946
+ on(window, "resize", () => vh = null);
947
+ }
948
+ append(document.body, vhEl);
949
+ vh = vhEl.clientHeight;
950
+ remove$1(vhEl);
951
+ return vh;
952
+ }
953
+
954
+ const inBrowser = typeof window !== "undefined";
955
+ const isRtl = inBrowser && document.dir === "rtl";
956
+ const hasTouch = inBrowser && "ontouchstart" in window;
957
+ const hasPointerEvents = inBrowser && window.PointerEvent;
958
+ const pointerDown$1 = hasPointerEvents ? "pointerdown" : hasTouch ? "touchstart" : "mousedown";
959
+ const pointerMove$1 = hasPointerEvents ? "pointermove" : hasTouch ? "touchmove" : "mousemove";
960
+ const pointerUp$1 = hasPointerEvents ? "pointerup" : hasTouch ? "touchend" : "mouseup";
961
+ const pointerEnter = hasPointerEvents ? "pointerenter" : hasTouch ? "" : "mouseenter";
962
+ const pointerLeave = hasPointerEvents ? "pointerleave" : hasTouch ? "" : "mouseleave";
963
+ const pointerCancel = hasPointerEvents ? "pointercancel" : "touchcancel";
964
+
965
+ const fastdom = {
966
+ reads: [],
967
+ writes: [],
968
+ read(task) {
969
+ this.reads.push(task);
970
+ scheduleFlush();
971
+ return task;
972
+ },
973
+ write(task) {
974
+ this.writes.push(task);
975
+ scheduleFlush();
976
+ return task;
977
+ },
978
+ clear(task) {
979
+ remove(this.reads, task);
980
+ remove(this.writes, task);
981
+ },
982
+ flush
983
+ };
984
+ function flush(recursion) {
985
+ runTasks(fastdom.reads);
986
+ runTasks(fastdom.writes.splice(0));
987
+ fastdom.scheduled = false;
988
+ if (fastdom.reads.length || fastdom.writes.length) {
989
+ scheduleFlush(recursion + 1);
990
+ }
991
+ }
992
+ const RECURSION_LIMIT = 4;
993
+ function scheduleFlush(recursion) {
994
+ if (fastdom.scheduled) {
995
+ return;
996
+ }
997
+ fastdom.scheduled = true;
998
+ if (recursion && recursion < RECURSION_LIMIT) {
999
+ Promise.resolve().then(() => flush(recursion));
1000
+ } else {
1001
+ requestAnimationFrame(() => flush(1));
1002
+ }
1003
+ }
1004
+ function runTasks(tasks) {
1005
+ let task;
1006
+ while (task = tasks.shift()) {
1007
+ try {
1008
+ task();
1009
+ } catch (e) {
1010
+ console.error(e);
1011
+ }
1012
+ }
1013
+ }
1014
+ function remove(array, item) {
1015
+ const index = array.indexOf(item);
1016
+ return ~index && array.splice(index, 1);
1017
+ }
1018
+
1019
+ function MouseTracker() {
1020
+ }
1021
+ MouseTracker.prototype = {
1022
+ positions: [],
1023
+ init() {
1024
+ this.positions = [];
1025
+ let position;
1026
+ this.unbind = on(document, "mousemove", (e) => position = getEventPos(e));
1027
+ this.interval = setInterval(() => {
1028
+ if (!position) {
1029
+ return;
1030
+ }
1031
+ this.positions.push(position);
1032
+ if (this.positions.length > 5) {
1033
+ this.positions.shift();
1034
+ }
1035
+ }, 50);
1036
+ },
1037
+ cancel() {
1038
+ var _a;
1039
+ (_a = this.unbind) == null ? void 0 : _a.call(this);
1040
+ clearInterval(this.interval);
1041
+ },
1042
+ movesTo(target) {
1043
+ if (this.positions.length < 2) {
1044
+ return false;
1045
+ }
1046
+ const p = target.getBoundingClientRect();
1047
+ const { left, right, top, bottom } = p;
1048
+ const [prevPosition] = this.positions;
1049
+ const position = last(this.positions);
1050
+ const path = [prevPosition, position];
1051
+ if (pointInRect(position, p)) {
1052
+ return false;
1053
+ }
1054
+ const diagonals = [
1055
+ [
1056
+ { x: left, y: top },
1057
+ { x: right, y: bottom }
1058
+ ],
1059
+ [
1060
+ { x: left, y: bottom },
1061
+ { x: right, y: top }
1062
+ ]
1063
+ ];
1064
+ return diagonals.some((diagonal) => {
1065
+ const intersection = intersect(path, diagonal);
1066
+ return intersection && pointInRect(intersection, p);
1067
+ });
1068
+ }
1069
+ };
1070
+ function intersect([{ x: x1, y: y1 }, { x: x2, y: y2 }], [{ x: x3, y: y3 }, { x: x4, y: y4 }]) {
1071
+ const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
1072
+ if (denominator === 0) {
1073
+ return false;
1074
+ }
1075
+ const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;
1076
+ if (ua < 0) {
1077
+ return false;
1078
+ }
1079
+ return { x: x1 + ua * (x2 - x1), y: y1 + ua * (y2 - y1) };
1080
+ }
1081
+
1082
+ function observeIntersection(targets, cb, options = {}, intersecting = true) {
1083
+ const observer = new IntersectionObserver(
1084
+ intersecting ? (entries, observer2) => {
1085
+ if (entries.some((entry) => entry.isIntersecting)) {
1086
+ cb(entries, observer2);
1087
+ }
1088
+ } : cb,
1089
+ options
1090
+ );
1091
+ for (const el of toNodes(targets)) {
1092
+ observer.observe(el);
1093
+ }
1094
+ return observer;
1095
+ }
1096
+ const hasResizeObserver = inBrowser && window.ResizeObserver;
1097
+ function observeResize(targets, cb, options = { box: "border-box" }) {
1098
+ if (hasResizeObserver) {
1099
+ return observe$1(ResizeObserver, targets, cb, options);
1100
+ }
1101
+ initResizeListener();
1102
+ listeners.add(cb);
1103
+ return {
1104
+ observe: noop,
1105
+ unobserve: noop,
1106
+ disconnect() {
1107
+ listeners.delete(cb);
1108
+ }
1109
+ };
1110
+ }
1111
+ let listeners;
1112
+ function initResizeListener() {
1113
+ if (listeners) {
1114
+ return;
1115
+ }
1116
+ listeners = /* @__PURE__ */ new Set();
1117
+ let pendingResize;
1118
+ const handleResize = () => {
1119
+ if (pendingResize) {
1120
+ return;
1121
+ }
1122
+ pendingResize = true;
1123
+ requestAnimationFrame(() => pendingResize = false);
1124
+ for (const listener of listeners) {
1125
+ listener();
1126
+ }
1127
+ };
1128
+ on(window, "load resize", handleResize);
1129
+ on(document, "loadedmetadata load", handleResize, true);
1130
+ }
1131
+ function observeMutation(targets, cb, options) {
1132
+ return observe$1(MutationObserver, targets, cb, options);
1133
+ }
1134
+ function observe$1(Observer, targets, cb, options) {
1135
+ const observer = new Observer(cb);
1136
+ for (const el of toNodes(targets)) {
1137
+ observer.observe(el, options);
1138
+ }
1139
+ return observer;
1140
+ }
1141
+
1142
+ function play(el) {
1143
+ if (isIFrame(el)) {
1144
+ call(el, { func: "playVideo", method: "play" });
1145
+ }
1146
+ if (isHTML5(el)) {
1147
+ try {
1148
+ el.play().catch(noop);
1149
+ } catch (e) {
1150
+ }
1151
+ }
1152
+ }
1153
+ function pause(el) {
1154
+ if (isIFrame(el)) {
1155
+ call(el, { func: "pauseVideo", method: "pause" });
1156
+ }
1157
+ if (isHTML5(el)) {
1158
+ el.pause();
1159
+ }
1160
+ }
1161
+ function mute(el) {
1162
+ if (isIFrame(el)) {
1163
+ call(el, { func: "mute", method: "setVolume", value: 0 });
1164
+ }
1165
+ if (isHTML5(el)) {
1166
+ el.muted = true;
1167
+ }
1168
+ }
1169
+ function isVideo(el) {
1170
+ return isHTML5(el) || isIFrame(el);
1171
+ }
1172
+ function isHTML5(el) {
1173
+ return isTag(el, "video");
1174
+ }
1175
+ function isIFrame(el) {
1176
+ return isTag(el, "iframe") && (isYoutube(el) || isVimeo(el));
1177
+ }
1178
+ function isYoutube(el) {
1179
+ return !!el.src.match(
1180
+ /\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/
1181
+ );
1182
+ }
1183
+ function isVimeo(el) {
1184
+ return !!el.src.match(/vimeo\.com\/video\/.*/);
1185
+ }
1186
+ async function call(el, cmd) {
1187
+ await enableApi(el);
1188
+ post(el, cmd);
1189
+ }
1190
+ function post(el, cmd) {
1191
+ try {
1192
+ el.contentWindow.postMessage(JSON.stringify({ event: "command", ...cmd }), "*");
1193
+ } catch (e) {
1194
+ }
1195
+ }
1196
+ const stateKey = "_ukPlayer";
1197
+ let counter = 0;
1198
+ function enableApi(el) {
1199
+ if (el[stateKey]) {
1200
+ return el[stateKey];
1201
+ }
1202
+ const youtube = isYoutube(el);
1203
+ const vimeo = isVimeo(el);
1204
+ const id = ++counter;
1205
+ let poller;
1206
+ return el[stateKey] = new Promise((resolve) => {
1207
+ youtube && once(el, "load", () => {
1208
+ const listener = () => post(el, { event: "listening", id });
1209
+ poller = setInterval(listener, 100);
1210
+ listener();
1211
+ });
1212
+ once(window, "message", resolve, false, ({ data }) => {
1213
+ try {
1214
+ data = JSON.parse(data);
1215
+ return youtube && (data == null ? void 0 : data.id) === id && data.event === "onReady" || vimeo && Number(data == null ? void 0 : data.player_id) === id;
1216
+ } catch (e) {
1217
+ }
1218
+ });
1219
+ el.src = `${el.src}${includes(el.src, "?") ? "&" : "?"}${youtube ? "enablejsapi=1" : `api=1&player_id=${id}`}`;
1220
+ }).then(() => clearInterval(poller));
1221
+ }
1222
+
1223
+ function isInView(element, offsetTop = 0, offsetLeft = 0) {
1224
+ if (!isVisible(element)) {
1225
+ return false;
1226
+ }
1227
+ return intersectRect(
1228
+ ...overflowParents(element).map((parent) => {
1229
+ const { top, left, bottom, right } = offsetViewport(parent);
1230
+ return {
1231
+ top: top - offsetTop,
1232
+ left: left - offsetLeft,
1233
+ bottom: bottom + offsetTop,
1234
+ right: right + offsetLeft
1235
+ };
1236
+ }).concat(offset(element))
1237
+ );
1238
+ }
1239
+ function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
1240
+ const parents2 = isVisible(element) ? scrollParents(element, false, ["hidden"]) : [];
1241
+ return parents2.reduce(
1242
+ (fn, scrollElement, i) => {
1243
+ const { scrollTop, scrollHeight, offsetHeight } = scrollElement;
1244
+ const viewport = offsetViewport(scrollElement);
1245
+ const maxScroll = scrollHeight - viewport.height;
1246
+ const { height: elHeight, top: elTop } = parents2[i - 1] ? offsetViewport(parents2[i - 1]) : offset(element);
1247
+ let top = Math.ceil(elTop - viewport.top - offsetBy + scrollTop);
1248
+ if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {
1249
+ top += offsetBy;
1250
+ } else {
1251
+ offsetBy = 0;
1252
+ }
1253
+ if (top > maxScroll) {
1254
+ offsetBy -= top - maxScroll;
1255
+ top = maxScroll;
1256
+ } else if (top < 0) {
1257
+ offsetBy -= top;
1258
+ top = 0;
1259
+ }
1260
+ return () => scrollTo(scrollElement, top - scrollTop).then(fn);
1261
+ },
1262
+ () => Promise.resolve()
1263
+ )();
1264
+ function scrollTo(element2, top) {
1265
+ return new Promise((resolve) => {
1266
+ const scroll = element2.scrollTop;
1267
+ const duration = getDuration(Math.abs(top));
1268
+ const start = Date.now();
1269
+ (function step() {
1270
+ const percent = ease(clamp((Date.now() - start) / duration));
1271
+ element2.scrollTop = scroll + top * percent;
1272
+ if (percent === 1) {
1273
+ resolve();
1274
+ } else {
1275
+ requestAnimationFrame(step);
1276
+ }
1277
+ })();
1278
+ });
1279
+ }
1280
+ function getDuration(dist) {
1281
+ return 40 * Math.pow(dist, 0.375);
1282
+ }
1283
+ function ease(k) {
1284
+ return 0.5 * (1 - Math.cos(Math.PI * k));
1285
+ }
1286
+ }
1287
+ function scrolledOver(element, startOffset = 0, endOffset = 0) {
1288
+ if (!isVisible(element)) {
1289
+ return 0;
1290
+ }
1291
+ const [scrollElement] = scrollParents(element, true);
1292
+ const { scrollHeight, scrollTop } = scrollElement;
1293
+ const { height: viewportHeight } = offsetViewport(scrollElement);
1294
+ const maxScroll = scrollHeight - viewportHeight;
1295
+ const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];
1296
+ const start = Math.max(0, elementOffsetTop - viewportHeight + startOffset);
1297
+ const end = Math.min(maxScroll, elementOffsetTop + element.offsetHeight - endOffset);
1298
+ return clamp((scrollTop - start) / (end - start));
1299
+ }
1300
+ function scrollParents(element, scrollable = false, props = []) {
1301
+ const scrollEl = scrollingElement(element);
1302
+ let ancestors = parents(element).reverse();
1303
+ ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);
1304
+ const fixedIndex = findIndex(ancestors, (el) => css(el, "position") === "fixed");
1305
+ if (~fixedIndex) {
1306
+ ancestors = ancestors.slice(fixedIndex);
1307
+ }
1308
+ return [scrollEl].concat(
1309
+ ancestors.filter(
1310
+ (parent) => css(parent, "overflow").split(" ").some((prop) => includes(["auto", "scroll", ...props], prop)) && (!scrollable || parent.scrollHeight > offsetViewport(parent).height)
1311
+ )
1312
+ ).reverse();
1313
+ }
1314
+ function overflowParents(element) {
1315
+ return scrollParents(element, false, ["hidden", "clip"]);
1316
+ }
1317
+ function offsetViewport(scrollElement) {
1318
+ const window = toWindow(scrollElement);
1319
+ const {
1320
+ visualViewport,
1321
+ document: { documentElement }
1322
+ } = window;
1323
+ let viewportElement = scrollElement === scrollingElement(scrollElement) ? window : scrollElement;
1324
+ if (isWindow(viewportElement) && visualViewport) {
1325
+ let { height, width, scale, pageTop: top, pageLeft: left } = visualViewport;
1326
+ height = Math.round(height * scale);
1327
+ width = Math.round(width * scale);
1328
+ return { height, width, top, left, bottom: top + height, right: left + width };
1329
+ }
1330
+ let rect = offset(viewportElement);
1331
+ if (css(viewportElement, "display") === "inline") {
1332
+ return rect;
1333
+ }
1334
+ for (let [prop, dir, start, end] of [
1335
+ ["width", "x", "left", "right"],
1336
+ ["height", "y", "top", "bottom"]
1337
+ ]) {
1338
+ if (isWindow(viewportElement)) {
1339
+ viewportElement = documentElement;
1340
+ } else {
1341
+ rect[start] += toFloat(css(viewportElement, `border-${start}-width`));
1342
+ }
1343
+ rect[prop] = rect[dir] = viewportElement[`client${ucfirst(prop)}`];
1344
+ rect[end] = rect[prop] + rect[start];
1345
+ }
1346
+ return rect;
1347
+ }
1348
+ function scrollingElement(element) {
1349
+ return toWindow(element).document.scrollingElement;
1350
+ }
1351
+
1352
+ const dirs = [
1353
+ ["width", "x", "left", "right"],
1354
+ ["height", "y", "top", "bottom"]
1355
+ ];
1356
+ function positionAt(element, target, options) {
1357
+ options = {
1358
+ attach: {
1359
+ element: ["left", "top"],
1360
+ target: ["left", "top"],
1361
+ ...options.attach
1362
+ },
1363
+ offset: [0, 0],
1364
+ placement: [],
1365
+ ...options
1366
+ };
1367
+ if (!isArray(target)) {
1368
+ target = [target, target];
1369
+ }
1370
+ offset(element, getPosition(element, target, options));
1371
+ }
1372
+ function getPosition(element, target, options) {
1373
+ const position = attachTo(element, target, options);
1374
+ const { boundary, viewportOffset = 0, placement } = options;
1375
+ let offsetPosition = position;
1376
+ for (const [i, [prop, , start, end]] of Object.entries(dirs)) {
1377
+ const viewport = getViewport(element, target[i], viewportOffset, boundary, i);
1378
+ if (isWithin(position, viewport, i)) {
1379
+ continue;
1380
+ }
1381
+ let offsetBy = 0;
1382
+ if (placement[i] === "flip") {
1383
+ const attach = options.attach.target[i];
1384
+ if (attach === end && position[end] <= viewport[end] || attach === start && position[start] >= viewport[start]) {
1385
+ continue;
1386
+ }
1387
+ offsetBy = flip(element, target, options, i)[start] - position[start];
1388
+ const scrollArea = getScrollArea(element, target[i], viewportOffset, i);
1389
+ if (!isWithin(applyOffset(position, offsetBy, i), scrollArea, i)) {
1390
+ if (isWithin(position, scrollArea, i)) {
1391
+ continue;
1392
+ }
1393
+ if (options.recursion) {
1394
+ return false;
1395
+ }
1396
+ const newPos = flipAxis(element, target, options);
1397
+ if (newPos && isWithin(newPos, scrollArea, 1 - i)) {
1398
+ return newPos;
1399
+ }
1400
+ continue;
1401
+ }
1402
+ } else if (placement[i] === "shift") {
1403
+ const targetDim = offset(target[i]);
1404
+ const { offset: elOffset } = options;
1405
+ offsetBy = clamp(
1406
+ clamp(position[start], viewport[start], viewport[end] - position[prop]),
1407
+ targetDim[start] - position[prop] + elOffset[i],
1408
+ targetDim[end] - elOffset[i]
1409
+ ) - position[start];
1410
+ }
1411
+ offsetPosition = applyOffset(offsetPosition, offsetBy, i);
1412
+ }
1413
+ return offsetPosition;
1414
+ }
1415
+ function attachTo(element, target, options) {
1416
+ let { attach, offset: offsetBy } = {
1417
+ attach: {
1418
+ element: ["left", "top"],
1419
+ target: ["left", "top"],
1420
+ ...options.attach
1421
+ },
1422
+ offset: [0, 0],
1423
+ ...options
1424
+ };
1425
+ let elOffset = offset(element);
1426
+ for (const [i, [prop, , start, end]] of Object.entries(dirs)) {
1427
+ const targetOffset = attach.target[i] === attach.element[i] ? offsetViewport(target[i]) : offset(target[i]);
1428
+ elOffset = applyOffset(
1429
+ elOffset,
1430
+ targetOffset[start] - elOffset[start] + moveBy(attach.target[i], end, targetOffset[prop]) - moveBy(attach.element[i], end, elOffset[prop]) + +offsetBy[i],
1431
+ i
1432
+ );
1433
+ }
1434
+ return elOffset;
1435
+ }
1436
+ function applyOffset(position, offset2, i) {
1437
+ const [, dir, start, end] = dirs[i];
1438
+ const newPos = { ...position };
1439
+ newPos[start] = position[dir] = position[start] + offset2;
1440
+ newPos[end] += offset2;
1441
+ return newPos;
1442
+ }
1443
+ function moveBy(attach, end, dim) {
1444
+ return attach === "center" ? dim / 2 : attach === end ? dim : 0;
1445
+ }
1446
+ function getViewport(element, target, viewportOffset, boundary, i) {
1447
+ let viewport = getIntersectionArea(...commonScrollParents(element, target).map(offsetViewport));
1448
+ if (viewportOffset) {
1449
+ viewport[dirs[i][2]] += viewportOffset;
1450
+ viewport[dirs[i][3]] -= viewportOffset;
1451
+ }
1452
+ if (boundary) {
1453
+ viewport = getIntersectionArea(
1454
+ viewport,
1455
+ offset(isArray(boundary) ? boundary[i] : boundary)
1456
+ );
1457
+ }
1458
+ return viewport;
1459
+ }
1460
+ function getScrollArea(element, target, viewportOffset, i) {
1461
+ const [prop, axis, start, end] = dirs[i];
1462
+ const [scrollElement] = commonScrollParents(element, target);
1463
+ const viewport = offsetViewport(scrollElement);
1464
+ if (["auto", "scroll"].includes(css(scrollElement, `overflow-${axis}`))) {
1465
+ viewport[start] -= scrollElement[`scroll${ucfirst(start)}`];
1466
+ viewport[end] = viewport[start] + scrollElement[`scroll${ucfirst(prop)}`];
1467
+ }
1468
+ viewport[start] += viewportOffset;
1469
+ viewport[end] -= viewportOffset;
1470
+ return viewport;
1471
+ }
1472
+ function commonScrollParents(element, target) {
1473
+ return overflowParents(target).filter((parent) => within(element, parent));
1474
+ }
1475
+ function getIntersectionArea(...rects) {
1476
+ let area = {};
1477
+ for (const rect of rects) {
1478
+ for (const [, , start, end] of dirs) {
1479
+ area[start] = Math.max(area[start] || 0, rect[start]);
1480
+ area[end] = Math.min(...[area[end], rect[end]].filter(Boolean));
1481
+ }
1482
+ }
1483
+ return area;
1484
+ }
1485
+ function isWithin(positionA, positionB, i) {
1486
+ const [, , start, end] = dirs[i];
1487
+ return positionA[start] >= positionB[start] && positionA[end] <= positionB[end];
1488
+ }
1489
+ function flip(element, target, { offset: offset2, attach }, i) {
1490
+ return attachTo(element, target, {
1491
+ attach: {
1492
+ element: flipAttach(attach.element, i),
1493
+ target: flipAttach(attach.target, i)
1494
+ },
1495
+ offset: flipOffset(offset2, i)
1496
+ });
1497
+ }
1498
+ function flipAxis(element, target, options) {
1499
+ return getPosition(element, target, {
1500
+ ...options,
1501
+ attach: {
1502
+ element: options.attach.element.map(flipAttachAxis).reverse(),
1503
+ target: options.attach.target.map(flipAttachAxis).reverse()
1504
+ },
1505
+ offset: options.offset.reverse(),
1506
+ placement: options.placement.reverse(),
1507
+ recursion: true
1508
+ });
1509
+ }
1510
+ function flipAttach(attach, i) {
1511
+ const newAttach = [...attach];
1512
+ const index = dirs[i].indexOf(attach[i]);
1513
+ if (~index) {
1514
+ newAttach[i] = dirs[i][1 - index % 2 + 2];
1515
+ }
1516
+ return newAttach;
1517
+ }
1518
+ function flipAttachAxis(prop) {
1519
+ for (let i = 0; i < dirs.length; i++) {
1520
+ const index = dirs[i].indexOf(prop);
1521
+ if (~index) {
1522
+ return dirs[1 - i][index % 2 + 2];
1523
+ }
1524
+ }
1525
+ }
1526
+ function flipOffset(offset2, i) {
1527
+ offset2 = [...offset2];
1528
+ offset2[i] *= -1;
1529
+ return offset2;
1530
+ }
1531
+
1532
+ var util = /*#__PURE__*/Object.freeze({
1533
+ __proto__: null,
1534
+ $: $,
1535
+ $$: $$,
1536
+ Animation: Animation,
1537
+ Deferred: Deferred,
1538
+ Dimensions: Dimensions,
1539
+ MouseTracker: MouseTracker,
1540
+ Transition: Transition,
1541
+ addClass: addClass,
1542
+ after: after,
1543
+ append: append,
1544
+ apply: apply,
1545
+ assign: assign,
1546
+ attr: attr,
1547
+ before: before,
1548
+ boxModelAdjust: boxModelAdjust,
1549
+ camelize: camelize,
1550
+ children: children,
1551
+ clamp: clamp,
1552
+ closest: closest,
1553
+ createEvent: createEvent,
1554
+ css: css,
1555
+ data: data,
1556
+ dimensions: dimensions,
1557
+ each: each,
1558
+ empty: empty,
1559
+ endsWith: endsWith,
1560
+ escape: escape,
1561
+ fastdom: fastdom,
1562
+ filter: filter,
1563
+ find: find,
1564
+ findAll: findAll,
1565
+ findIndex: findIndex,
1566
+ flipPosition: flipPosition,
1567
+ fragment: fragment,
1568
+ getEventPos: getEventPos,
1569
+ getIndex: getIndex,
1570
+ getTargetedElement: getTargetedElement,
1571
+ hasAttr: hasAttr,
1572
+ hasClass: hasClass,
1573
+ hasOwn: hasOwn,
1574
+ hasTouch: hasTouch,
1575
+ height: height,
1576
+ html: html,
1577
+ hyphenate: hyphenate,
1578
+ inBrowser: inBrowser,
1579
+ includes: includes,
1580
+ index: index,
1581
+ intersectRect: intersectRect,
1582
+ isArray: isArray,
1583
+ isBoolean: isBoolean,
1584
+ isDocument: isDocument,
1585
+ isElement: isElement,
1586
+ isEmpty: isEmpty,
1587
+ isEqual: isEqual,
1588
+ isFocusable: isFocusable,
1589
+ isFunction: isFunction,
1590
+ isInView: isInView,
1591
+ isInput: isInput,
1592
+ isNode: isNode,
1593
+ isNumber: isNumber,
1594
+ isNumeric: isNumeric,
1595
+ isObject: isObject,
1596
+ isPlainObject: isPlainObject,
1597
+ isRtl: isRtl,
1598
+ isSameSiteAnchor: isSameSiteAnchor,
1599
+ isString: isString,
1600
+ isTag: isTag,
1601
+ isTouch: isTouch,
1602
+ isUndefined: isUndefined,
1603
+ isVideo: isVideo,
1604
+ isVisible: isVisible,
1605
+ isVoidElement: isVoidElement,
1606
+ isWindow: isWindow,
1607
+ last: last,
1608
+ matches: matches,
1609
+ memoize: memoize,
1610
+ mute: mute,
1611
+ noop: noop,
1612
+ observeIntersection: observeIntersection,
1613
+ observeMutation: observeMutation,
1614
+ observeResize: observeResize,
1615
+ off: off,
1616
+ offset: offset,
1617
+ offsetPosition: offsetPosition,
1618
+ offsetViewport: offsetViewport,
1619
+ on: on,
1620
+ once: once,
1621
+ overflowParents: overflowParents,
1622
+ parent: parent,
1623
+ parents: parents,
1624
+ pause: pause,
1625
+ pick: pick,
1626
+ play: play,
1627
+ pointInRect: pointInRect,
1628
+ pointerCancel: pointerCancel,
1629
+ pointerDown: pointerDown$1,
1630
+ pointerEnter: pointerEnter,
1631
+ pointerLeave: pointerLeave,
1632
+ pointerMove: pointerMove$1,
1633
+ pointerUp: pointerUp$1,
1634
+ position: position,
1635
+ positionAt: positionAt,
1636
+ prepend: prepend,
1637
+ propName: propName,
1638
+ query: query,
1639
+ queryAll: queryAll,
1640
+ ready: ready,
1641
+ remove: remove$1,
1642
+ removeAttr: removeAttr,
1643
+ removeClass: removeClass,
1644
+ removeClasses: removeClasses,
1645
+ replaceClass: replaceClass,
1646
+ scrollIntoView: scrollIntoView,
1647
+ scrollParents: scrollParents,
1648
+ scrolledOver: scrolledOver,
1649
+ selFocusable: selFocusable,
1650
+ selInput: selInput,
1651
+ sortBy: sortBy,
1652
+ startsWith: startsWith,
1653
+ sumBy: sumBy,
1654
+ swap: swap,
1655
+ toArray: toArray,
1656
+ toBoolean: toBoolean,
1657
+ toEventTargets: toEventTargets,
1658
+ toFloat: toFloat,
1659
+ toNode: toNode,
1660
+ toNodes: toNodes,
1661
+ toNumber: toNumber,
1662
+ toPx: toPx,
1663
+ toWindow: toWindow,
1664
+ toggleClass: toggleClass,
1665
+ trigger: trigger,
1666
+ ucfirst: ucfirst,
1667
+ uniqueBy: uniqueBy,
1668
+ unwrap: unwrap,
1669
+ width: width,
1670
+ within: within,
1671
+ wrapAll: wrapAll,
1672
+ wrapInner: wrapInner
1673
+ });
1674
+
1675
+ function resize(options) {
1676
+ return observe(observeResize, options, "resize");
1677
+ }
1678
+ function intersection(options) {
1679
+ return observe(observeIntersection, options);
1680
+ }
1681
+ function lazyload(options = {}) {
1682
+ return intersection({
1683
+ handler: function(entries, observer) {
1684
+ const { targets = this.$el, preload = 5 } = options;
1685
+ for (const el of toNodes(isFunction(targets) ? targets(this) : targets)) {
1686
+ $$('[loading="lazy"]', el).slice(0, preload - 1).forEach((el2) => removeAttr(el2, "loading"));
1687
+ }
1688
+ for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {
1689
+ observer.unobserve(el);
1690
+ }
1691
+ },
1692
+ ...options
1693
+ });
1694
+ }
1695
+ function observe(observe2, options, emit) {
1696
+ return {
1697
+ observe: observe2,
1698
+ handler() {
1699
+ this.$emit(emit);
1700
+ },
1701
+ ...options
1702
+ };
1703
+ }
1704
+
15
1705
  var I18n = {
16
1706
  props: {
17
1707
  i18n: Object
@@ -31,28 +1721,6 @@
31
1721
  }
32
1722
  };
33
1723
 
34
- var Resize = {
35
- connected() {
36
- var _a;
37
- this.registerObserver(
38
- uikitUtil.observeResize(
39
- ((_a = this.$options.resizeTargets) == null ? void 0 : _a.call(this)) || this.$el,
40
- () => this.$emit("resize")
41
- )
42
- );
43
- }
44
- };
45
-
46
- function generateId(component, el = component.$el, postfix = "") {
47
- if (el.id) {
48
- return el.id;
49
- }
50
- let id = `${component.$options.id}-${component._uid}${postfix}`;
51
- if (uikitUtil.$(`#${id}`)) {
52
- id = generateId(component, el, `${postfix}-2`);
53
- }
54
- return id;
55
- }
56
1724
  const keyMap = {
57
1725
  TAB: 9,
58
1726
  ESC: 27,
@@ -65,6 +1733,643 @@
65
1733
  DOWN: 40
66
1734
  };
67
1735
 
1736
+ function initObservers(instance) {
1737
+ instance._observers = [];
1738
+ instance._observerUpdates = /* @__PURE__ */ new Map();
1739
+ for (const observer of instance.$options.observe || []) {
1740
+ if (hasOwn(observer, "handler")) {
1741
+ registerObservable(instance, observer);
1742
+ } else {
1743
+ for (const key in observer) {
1744
+ registerObservable(instance, observer[key], key);
1745
+ }
1746
+ }
1747
+ }
1748
+ }
1749
+ function registerObserver(instance, ...observer) {
1750
+ instance._observers.push(...observer);
1751
+ }
1752
+ function disconnectObservers(instance) {
1753
+ for (const observer of instance._observers) {
1754
+ observer == null ? void 0 : observer.disconnect();
1755
+ instance._observerUpdates.delete(observer);
1756
+ }
1757
+ }
1758
+ function callObserverUpdates(instance) {
1759
+ for (const [observer, update] of instance._observerUpdates) {
1760
+ update(observer);
1761
+ }
1762
+ }
1763
+ function registerObservable(instance, observable, key) {
1764
+ let {
1765
+ observe,
1766
+ target = instance.$el,
1767
+ handler,
1768
+ options,
1769
+ filter,
1770
+ args
1771
+ } = isPlainObject(observable) ? observable : { type: key, handler: observable };
1772
+ if (filter && !filter.call(instance, instance)) {
1773
+ return;
1774
+ }
1775
+ const targets = isFunction(target) ? target.call(instance, instance) : target;
1776
+ handler = isString(handler) ? instance[handler] : handler.bind(instance);
1777
+ if (isFunction(options)) {
1778
+ options = options.call(instance, instance);
1779
+ }
1780
+ const observer = observe(targets, handler, options, args);
1781
+ if (isFunction(target) && isArray(targets) && observer.unobserve) {
1782
+ instance._observerUpdates.set(observer, watchChange(instance, target, targets));
1783
+ }
1784
+ registerObserver(instance, observer);
1785
+ }
1786
+ function watchChange(instance, targetFn, targets) {
1787
+ return (observer) => {
1788
+ const newTargets = targetFn.call(instance, instance);
1789
+ if (isEqual(targets, newTargets)) {
1790
+ return;
1791
+ }
1792
+ targets.forEach((target) => !includes(newTargets, target) && observer.unobserve(target));
1793
+ newTargets.forEach((target) => !includes(targets, target) && observer.observe(target));
1794
+ targets.splice(0, targets.length, ...newTargets);
1795
+ };
1796
+ }
1797
+
1798
+ function callWatches(instance) {
1799
+ if (instance._watch) {
1800
+ return;
1801
+ }
1802
+ const initial = !hasOwn(instance, "_watch");
1803
+ instance._watch = fastdom.read(() => {
1804
+ if (instance._connected) {
1805
+ runWatches(instance, initial);
1806
+ }
1807
+ instance._watch = null;
1808
+ });
1809
+ }
1810
+ function runWatches(instance, initial) {
1811
+ const values = { ...instance._computed };
1812
+ instance._computed = {};
1813
+ for (const [key, { watch, immediate }] of Object.entries(instance.$options.computed || {})) {
1814
+ if (watch && (initial && immediate || hasOwn(values, key) && !isEqual(values[key], instance[key]))) {
1815
+ watch.call(instance, instance[key], initial ? void 0 : values[key]);
1816
+ }
1817
+ }
1818
+ callObserverUpdates(instance);
1819
+ }
1820
+
1821
+ function callUpdate(instance, e = "update") {
1822
+ if (!instance._connected) {
1823
+ return;
1824
+ }
1825
+ if (e === "update" || e === "resize") {
1826
+ callWatches(instance);
1827
+ }
1828
+ if (!instance.$options.update) {
1829
+ return;
1830
+ }
1831
+ if (!instance._updates) {
1832
+ instance._updates = /* @__PURE__ */ new Set();
1833
+ fastdom.read(() => {
1834
+ if (instance._connected) {
1835
+ runUpdates(instance, instance._updates);
1836
+ }
1837
+ delete instance._updates;
1838
+ });
1839
+ }
1840
+ instance._updates.add(e.type || e);
1841
+ }
1842
+ function runUpdates(instance, types) {
1843
+ for (const { read, write, events = [] } of instance.$options.update) {
1844
+ if (!types.has("update") && !events.some((type) => types.has(type))) {
1845
+ continue;
1846
+ }
1847
+ let result;
1848
+ if (read) {
1849
+ result = read.call(instance, instance._data, types);
1850
+ if (result && isPlainObject(result)) {
1851
+ assign(instance._data, result);
1852
+ }
1853
+ }
1854
+ if (write && result !== false) {
1855
+ fastdom.write(() => {
1856
+ if (instance._connected) {
1857
+ write.call(instance, instance._data, types);
1858
+ }
1859
+ });
1860
+ }
1861
+ }
1862
+ }
1863
+ function initUpdateObserver(instance) {
1864
+ let { el, computed, observe } = instance.$options;
1865
+ if (!computed && !(observe == null ? void 0 : observe.some((options) => isFunction(options.target)))) {
1866
+ return;
1867
+ }
1868
+ for (const key in computed || {}) {
1869
+ if (computed[key].document) {
1870
+ el = el.ownerDocument;
1871
+ break;
1872
+ }
1873
+ }
1874
+ const observer = new MutationObserver(() => callWatches(instance));
1875
+ observer.observe(el, {
1876
+ childList: true,
1877
+ subtree: true
1878
+ });
1879
+ registerObserver(instance, observer);
1880
+ }
1881
+
1882
+ function initEvents(instance) {
1883
+ instance._events = [];
1884
+ for (const event of instance.$options.events || []) {
1885
+ if (hasOwn(event, "handler")) {
1886
+ registerEvent(instance, event);
1887
+ } else {
1888
+ for (const key in event) {
1889
+ registerEvent(instance, event[key], key);
1890
+ }
1891
+ }
1892
+ }
1893
+ }
1894
+ function unbindEvents(instance) {
1895
+ instance._events.forEach((unbind) => unbind());
1896
+ delete instance._events;
1897
+ }
1898
+ function registerEvent(instance, event, key) {
1899
+ let { name, el, handler, capture, passive, delegate, filter, self } = isPlainObject(event) ? event : { name: key, handler: event };
1900
+ el = isFunction(el) ? el.call(instance, instance) : el || instance.$el;
1901
+ if (isArray(el)) {
1902
+ el.forEach((el2) => registerEvent(instance, { ...event, el: el2 }, key));
1903
+ return;
1904
+ }
1905
+ if (!el || filter && !filter.call(instance)) {
1906
+ return;
1907
+ }
1908
+ instance._events.push(
1909
+ on(
1910
+ el,
1911
+ name,
1912
+ delegate ? isString(delegate) ? delegate : delegate.call(instance, instance) : null,
1913
+ isString(handler) ? instance[handler] : handler.bind(instance),
1914
+ { passive, capture, self }
1915
+ )
1916
+ );
1917
+ }
1918
+
1919
+ const strats = {};
1920
+ strats.events = strats.observe = strats.created = strats.beforeConnect = strats.connected = strats.beforeDisconnect = strats.disconnected = strats.destroy = concatStrat;
1921
+ strats.args = function(parentVal, childVal) {
1922
+ return childVal !== false && concatStrat(childVal || parentVal);
1923
+ };
1924
+ strats.update = function(parentVal, childVal) {
1925
+ return sortBy(
1926
+ concatStrat(parentVal, isFunction(childVal) ? { read: childVal } : childVal),
1927
+ "order"
1928
+ );
1929
+ };
1930
+ strats.props = function(parentVal, childVal) {
1931
+ if (isArray(childVal)) {
1932
+ const value = {};
1933
+ for (const key of childVal) {
1934
+ value[key] = String;
1935
+ }
1936
+ childVal = value;
1937
+ }
1938
+ return strats.methods(parentVal, childVal);
1939
+ };
1940
+ strats.computed = strats.methods = function(parentVal, childVal) {
1941
+ return childVal ? parentVal ? { ...parentVal, ...childVal } : childVal : parentVal;
1942
+ };
1943
+ strats.i18n = strats.data = function(parentVal, childVal, vm) {
1944
+ if (!vm) {
1945
+ if (!childVal) {
1946
+ return parentVal;
1947
+ }
1948
+ if (!parentVal) {
1949
+ return childVal;
1950
+ }
1951
+ return function(vm2) {
1952
+ return mergeFnData(parentVal, childVal, vm2);
1953
+ };
1954
+ }
1955
+ return mergeFnData(parentVal, childVal, vm);
1956
+ };
1957
+ function mergeFnData(parentVal, childVal, vm) {
1958
+ return strats.computed(
1959
+ isFunction(parentVal) ? parentVal.call(vm, vm) : parentVal,
1960
+ isFunction(childVal) ? childVal.call(vm, vm) : childVal
1961
+ );
1962
+ }
1963
+ function concatStrat(parentVal, childVal) {
1964
+ parentVal = parentVal && !isArray(parentVal) ? [parentVal] : parentVal;
1965
+ return childVal ? parentVal ? parentVal.concat(childVal) : isArray(childVal) ? childVal : [childVal] : parentVal;
1966
+ }
1967
+ function defaultStrat(parentVal, childVal) {
1968
+ return isUndefined(childVal) ? parentVal : childVal;
1969
+ }
1970
+ function mergeOptions(parent, child, vm) {
1971
+ const options = {};
1972
+ if (isFunction(child)) {
1973
+ child = child.options;
1974
+ }
1975
+ if (child.extends) {
1976
+ parent = mergeOptions(parent, child.extends, vm);
1977
+ }
1978
+ if (child.mixins) {
1979
+ for (const mixin of child.mixins) {
1980
+ parent = mergeOptions(parent, mixin, vm);
1981
+ }
1982
+ }
1983
+ for (const key in parent) {
1984
+ mergeKey(key);
1985
+ }
1986
+ for (const key in child) {
1987
+ if (!hasOwn(parent, key)) {
1988
+ mergeKey(key);
1989
+ }
1990
+ }
1991
+ function mergeKey(key) {
1992
+ options[key] = (strats[key] || defaultStrat)(parent[key], child[key], vm);
1993
+ }
1994
+ return options;
1995
+ }
1996
+ function parseOptions(options, args = []) {
1997
+ try {
1998
+ return options ? startsWith(options, "{") ? JSON.parse(options) : args.length && !includes(options, ":") ? { [args[0]]: options } : options.split(";").reduce((options2, option) => {
1999
+ const [key, value] = option.split(/:(.*)/);
2000
+ if (key && !isUndefined(value)) {
2001
+ options2[key.trim()] = value.trim();
2002
+ }
2003
+ return options2;
2004
+ }, {}) : {};
2005
+ } catch (e) {
2006
+ return {};
2007
+ }
2008
+ }
2009
+ function coerce(type, value) {
2010
+ if (type === Boolean) {
2011
+ return toBoolean(value);
2012
+ } else if (type === Number) {
2013
+ return toNumber(value);
2014
+ } else if (type === "list") {
2015
+ return toList(value);
2016
+ } else if (type === Object && isString(value)) {
2017
+ return parseOptions(value);
2018
+ }
2019
+ return type ? type(value) : value;
2020
+ }
2021
+ function toList(value) {
2022
+ return isArray(value) ? value : isString(value) ? value.split(/,(?![^(]*\))/).map((value2) => isNumeric(value2) ? toNumber(value2) : toBoolean(value2.trim())) : [value];
2023
+ }
2024
+
2025
+ function initProps(instance) {
2026
+ const props = getProps(instance.$options);
2027
+ for (let key in props) {
2028
+ if (!isUndefined(props[key])) {
2029
+ instance.$props[key] = props[key];
2030
+ }
2031
+ }
2032
+ const exclude = [instance.$options.computed, instance.$options.methods];
2033
+ for (let key in instance.$props) {
2034
+ if (key in props && notIn(exclude, key)) {
2035
+ instance[key] = instance.$props[key];
2036
+ }
2037
+ }
2038
+ }
2039
+ function getProps(opts) {
2040
+ const data$1 = {};
2041
+ const { args = [], props = {}, el, id } = opts;
2042
+ if (!props) {
2043
+ return data$1;
2044
+ }
2045
+ for (const key in props) {
2046
+ const prop = hyphenate(key);
2047
+ let value = data(el, prop);
2048
+ if (isUndefined(value)) {
2049
+ continue;
2050
+ }
2051
+ value = props[key] === Boolean && value === "" ? true : coerce(props[key], value);
2052
+ if (prop === "target" && startsWith(value, "_")) {
2053
+ continue;
2054
+ }
2055
+ data$1[key] = value;
2056
+ }
2057
+ const options = parseOptions(data(el, id), args);
2058
+ for (const key in options) {
2059
+ const prop = camelize(key);
2060
+ if (!isUndefined(props[prop])) {
2061
+ data$1[prop] = coerce(props[prop], options[key]);
2062
+ }
2063
+ }
2064
+ return data$1;
2065
+ }
2066
+ function notIn(options, key) {
2067
+ return options.every((arr) => !arr || !hasOwn(arr, key));
2068
+ }
2069
+ function initPropsObserver(instance) {
2070
+ const { $options, $props } = instance;
2071
+ const { id, attrs, props, el } = $options;
2072
+ if (!props || attrs === false) {
2073
+ return;
2074
+ }
2075
+ const attributes = isArray(attrs) ? attrs : Object.keys(props);
2076
+ const filter = attributes.map((key) => hyphenate(key)).concat(id);
2077
+ const observer = new MutationObserver((records) => {
2078
+ const data = getProps($options);
2079
+ if (records.some(({ attributeName }) => {
2080
+ const prop = attributeName.replace("data-", "");
2081
+ return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(
2082
+ (prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]
2083
+ );
2084
+ })) {
2085
+ instance.$reset();
2086
+ }
2087
+ });
2088
+ observer.observe(el, {
2089
+ attributes: true,
2090
+ attributeFilter: filter.concat(filter.map((key) => `data-${key}`))
2091
+ });
2092
+ registerObserver(instance, observer);
2093
+ }
2094
+
2095
+ function callHook(instance, hook) {
2096
+ var _a;
2097
+ (_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));
2098
+ }
2099
+ function callConnected(instance) {
2100
+ if (instance._connected) {
2101
+ return;
2102
+ }
2103
+ instance._data = {};
2104
+ instance._computed = {};
2105
+ initProps(instance);
2106
+ callHook(instance, "beforeConnect");
2107
+ instance._connected = true;
2108
+ initEvents(instance);
2109
+ initObservers(instance);
2110
+ initPropsObserver(instance);
2111
+ initUpdateObserver(instance);
2112
+ callHook(instance, "connected");
2113
+ callUpdate(instance);
2114
+ }
2115
+ function callDisconnected(instance) {
2116
+ if (!instance._connected) {
2117
+ return;
2118
+ }
2119
+ callHook(instance, "beforeDisconnect");
2120
+ disconnectObservers(instance);
2121
+ unbindEvents(instance);
2122
+ callHook(instance, "disconnected");
2123
+ instance._connected = false;
2124
+ delete instance._watch;
2125
+ }
2126
+
2127
+ function initComputed(instance) {
2128
+ const { computed } = instance.$options;
2129
+ instance._computed = {};
2130
+ if (computed) {
2131
+ for (const key in computed) {
2132
+ registerComputed(instance, key, computed[key]);
2133
+ }
2134
+ }
2135
+ }
2136
+ function registerComputed(instance, key, cb) {
2137
+ Object.defineProperty(instance, key, {
2138
+ enumerable: true,
2139
+ get() {
2140
+ const { _computed, $props, $el } = instance;
2141
+ if (!hasOwn(_computed, key)) {
2142
+ _computed[key] = (cb.get || cb).call(instance, $props, $el);
2143
+ }
2144
+ return _computed[key];
2145
+ },
2146
+ set(value) {
2147
+ const { _computed } = instance;
2148
+ _computed[key] = cb.set ? cb.set.call(instance, value) : value;
2149
+ if (isUndefined(_computed[key])) {
2150
+ delete _computed[key];
2151
+ }
2152
+ }
2153
+ });
2154
+ }
2155
+
2156
+ let uid = 0;
2157
+ function init(instance, options = {}) {
2158
+ options.data = normalizeData(options, instance.constructor.options);
2159
+ instance.$options = mergeOptions(instance.constructor.options, options, instance);
2160
+ instance.$props = {};
2161
+ instance._uid = uid++;
2162
+ initData(instance);
2163
+ initMethods(instance);
2164
+ initComputed(instance);
2165
+ callHook(instance, "created");
2166
+ if (options.el) {
2167
+ instance.$mount(options.el);
2168
+ }
2169
+ }
2170
+ function initData(instance) {
2171
+ const { data = {} } = instance.$options;
2172
+ for (const key in data) {
2173
+ instance.$props[key] = instance[key] = data[key];
2174
+ }
2175
+ }
2176
+ function initMethods(instance) {
2177
+ const { methods } = instance.$options;
2178
+ if (methods) {
2179
+ for (const key in methods) {
2180
+ instance[key] = methods[key].bind(instance);
2181
+ }
2182
+ }
2183
+ }
2184
+ function normalizeData({ data = {} }, { args = [], props = {} }) {
2185
+ if (isArray(data)) {
2186
+ data = data.slice(0, args.length).reduce((data2, value, index) => {
2187
+ if (isPlainObject(value)) {
2188
+ assign(data2, value);
2189
+ } else {
2190
+ data2[args[index]] = value;
2191
+ }
2192
+ return data2;
2193
+ }, {});
2194
+ }
2195
+ for (const key in data) {
2196
+ if (isUndefined(data[key])) {
2197
+ delete data[key];
2198
+ } else if (props[key]) {
2199
+ data[key] = coerce(props[key], data[key]);
2200
+ }
2201
+ }
2202
+ return data;
2203
+ }
2204
+
2205
+ const App = function(options) {
2206
+ init(this, options);
2207
+ };
2208
+ App.util = util;
2209
+ App.options = {};
2210
+ App.version = "3.16.5-dev.dda1f1b31";
2211
+
2212
+ const PREFIX = "uk-";
2213
+ const DATA = "__uikit__";
2214
+ const components = {};
2215
+ function component(name, options) {
2216
+ var _a;
2217
+ const id = PREFIX + hyphenate(name);
2218
+ if (!options) {
2219
+ if (isPlainObject(components[id])) {
2220
+ components[id] = App.extend(components[id]);
2221
+ }
2222
+ return components[id];
2223
+ }
2224
+ name = camelize(name);
2225
+ App[name] = (element, data) => createComponent(name, element, data);
2226
+ const opt = isPlainObject(options) ? { ...options } : options.options;
2227
+ opt.id = id;
2228
+ opt.name = name;
2229
+ (_a = opt.install) == null ? void 0 : _a.call(opt, App, opt, name);
2230
+ if (App._initialized && !opt.functional) {
2231
+ requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
2232
+ }
2233
+ return components[id] = opt;
2234
+ }
2235
+ function createComponent(name, element, data) {
2236
+ const Component = component(name);
2237
+ return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [...arguments] }) : element ? $$(element).map(init)[0] : init();
2238
+ function init(element2) {
2239
+ const instance = getComponent(element2, name);
2240
+ if (instance) {
2241
+ if (data) {
2242
+ instance.$destroy();
2243
+ } else {
2244
+ return instance;
2245
+ }
2246
+ }
2247
+ return new Component({ el: element2, data });
2248
+ }
2249
+ }
2250
+ function getComponents(element) {
2251
+ return element[DATA] || {};
2252
+ }
2253
+ function getComponent(element, name) {
2254
+ return getComponents(element)[name];
2255
+ }
2256
+ function attachToElement(element, instance) {
2257
+ if (!element[DATA]) {
2258
+ element[DATA] = {};
2259
+ }
2260
+ element[DATA][instance.$options.name] = instance;
2261
+ }
2262
+ function detachFromElement(element, instance) {
2263
+ var _a;
2264
+ (_a = element[DATA]) == null ? true : delete _a[instance.$options.name];
2265
+ if (!isEmpty(element[DATA])) {
2266
+ delete element[DATA];
2267
+ }
2268
+ }
2269
+
2270
+ App.component = component;
2271
+ App.getComponents = getComponents;
2272
+ App.getComponent = getComponent;
2273
+ App.use = function(plugin) {
2274
+ if (plugin.installed) {
2275
+ return;
2276
+ }
2277
+ plugin.call(null, this);
2278
+ plugin.installed = true;
2279
+ return this;
2280
+ };
2281
+ App.mixin = function(mixin, component2) {
2282
+ component2 = (isString(component2) ? this.component(component2) : component2) || this;
2283
+ component2.options = mergeOptions(component2.options, mixin);
2284
+ };
2285
+ App.extend = function(options) {
2286
+ options = options || {};
2287
+ const Super = this;
2288
+ const Sub = function UIkitComponent(options2) {
2289
+ init(this, options2);
2290
+ };
2291
+ Sub.prototype = Object.create(Super.prototype);
2292
+ Sub.prototype.constructor = Sub;
2293
+ Sub.options = mergeOptions(Super.options, options);
2294
+ Sub.super = Super;
2295
+ Sub.extend = Super.extend;
2296
+ return Sub;
2297
+ };
2298
+ function update(element, e) {
2299
+ element = element ? toNode(element) : document.body;
2300
+ for (const parentEl of parents(element).reverse()) {
2301
+ updateElement(parentEl, e);
2302
+ }
2303
+ apply(element, (element2) => updateElement(element2, e));
2304
+ }
2305
+ App.update = update;
2306
+ function updateElement(element, e) {
2307
+ const components = getComponents(element);
2308
+ for (const name in components) {
2309
+ callUpdate(components[name], e);
2310
+ }
2311
+ }
2312
+ let container;
2313
+ Object.defineProperty(App, "container", {
2314
+ get() {
2315
+ return container || document.body;
2316
+ },
2317
+ set(element) {
2318
+ container = $(element);
2319
+ }
2320
+ });
2321
+
2322
+ App.prototype.$mount = function(el) {
2323
+ const instance = this;
2324
+ attachToElement(el, instance);
2325
+ instance.$options.el = el;
2326
+ if (within(el, document)) {
2327
+ callConnected(instance);
2328
+ }
2329
+ };
2330
+ App.prototype.$destroy = function(removeEl = false) {
2331
+ const instance = this;
2332
+ const { el } = instance.$options;
2333
+ if (el) {
2334
+ callDisconnected(instance);
2335
+ }
2336
+ callHook(instance, "destroy");
2337
+ detachFromElement(el, instance);
2338
+ if (removeEl) {
2339
+ remove$1(instance.$el);
2340
+ }
2341
+ };
2342
+ App.prototype.$create = createComponent;
2343
+ App.prototype.$emit = function(e) {
2344
+ callUpdate(this, e);
2345
+ };
2346
+ App.prototype.$update = function(element = this.$el, e) {
2347
+ update(element, e);
2348
+ };
2349
+ App.prototype.$reset = function() {
2350
+ callDisconnected(this);
2351
+ callConnected(this);
2352
+ };
2353
+ App.prototype.$getComponent = getComponent;
2354
+ Object.defineProperties(App.prototype, {
2355
+ $el: {
2356
+ get() {
2357
+ return this.$options.el;
2358
+ }
2359
+ },
2360
+ $container: Object.getOwnPropertyDescriptor(App, "container")
2361
+ });
2362
+ function generateId(instance, el = instance.$el, postfix = "") {
2363
+ if (el.id) {
2364
+ return el.id;
2365
+ }
2366
+ let id = `${instance.$options.id}-${instance._uid}${postfix}`;
2367
+ if ($(`#${id}`)) {
2368
+ id = generateId(instance, el, `${postfix}-2`);
2369
+ }
2370
+ return id;
2371
+ }
2372
+
68
2373
  var SliderNav = {
69
2374
  i18n: {
70
2375
  next: "Next slide",
@@ -455,7 +2760,7 @@
455
2760
  };
456
2761
 
457
2762
  var Slider = {
458
- mixins: [SliderAutoplay, SliderDrag, SliderNav, Resize, I18n],
2763
+ mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],
459
2764
  props: {
460
2765
  clsActivated: Boolean,
461
2766
  easing: String,
@@ -506,6 +2811,7 @@
506
2811
  return this.slides.length;
507
2812
  }
508
2813
  },
2814
+ observe: resize(),
509
2815
  methods: {
510
2816
  show(index, force = false) {
511
2817
  var _a;
@@ -555,7 +2861,11 @@
555
2861
  return promise;
556
2862
  },
557
2863
  getIndex(index = this.index, prev = this.index) {
558
- return uikitUtil.clamp(uikitUtil.getIndex(index, this.slides, prev, this.finite), 0, this.maxIndex);
2864
+ return uikitUtil.clamp(
2865
+ uikitUtil.getIndex(index, this.slides, prev, this.finite),
2866
+ 0,
2867
+ Math.max(0, this.maxIndex)
2868
+ );
559
2869
  },
560
2870
  getValidIndex(index = this.index, prevIndex = this.prevIndex) {
561
2871
  return this.getIndex(index, prevIndex);
@@ -617,31 +2927,11 @@
617
2927
  }
618
2928
  };
619
2929
 
620
- var Lazyload = {
621
- data: {
622
- preload: 5
623
- },
624
- methods: {
625
- lazyload(observeTargets = this.$el, targets = this.$el) {
626
- this.registerObserver(
627
- uikitUtil.observeIntersection(observeTargets, (entries, observer) => {
628
- for (const el of uikitUtil.toNodes(uikitUtil.isFunction(targets) ? targets() : targets)) {
629
- uikitUtil.$$('[loading="lazy"]', el).slice(0, this.preload - 1).forEach((el2) => uikitUtil.removeAttr(el2, "loading"));
630
- }
631
- for (const el of entries.filter(({ isIntersecting }) => isIntersecting).map(({ target }) => target)) {
632
- observer.unobserve(el);
633
- }
634
- })
635
- );
636
- }
637
- }
638
- };
639
-
640
2930
  var SliderPreload = {
641
- mixins: [Lazyload],
642
- connected() {
643
- this.lazyload(this.slides, this.getAdjacentSlides);
644
- }
2931
+ observe: lazyload({
2932
+ target: ({ slides }) => slides,
2933
+ targets: (instance) => instance.getAdjacentSlides()
2934
+ })
645
2935
  };
646
2936
 
647
2937
  function translate(value = 0, unit = "%") {
@@ -837,11 +3127,17 @@
837
3127
  center: this.center,
838
3128
  list: this.list
839
3129
  };
3130
+ },
3131
+ slides() {
3132
+ return uikitUtil.children(this.list).filter(uikitUtil.isVisible);
840
3133
  }
841
3134
  },
842
3135
  connected() {
843
3136
  uikitUtil.toggleClass(this.$el, this.clsContainer, !uikitUtil.$(`.${this.clsContainer}`, this.$el));
844
3137
  },
3138
+ observe: resize({
3139
+ target: ({ slides }) => slides
3140
+ }),
845
3141
  update: {
846
3142
  write() {
847
3143
  for (const el of this.navItems) {