@luna-park/plugin-nuxt-ui 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,373 +0,0 @@
1
- function _() {
2
- return _ = Object.assign || function(t) {
3
- for (var n = 1; n < arguments.length; n++) {
4
- var a = arguments[n];
5
- for (var u in a)
6
- Object.prototype.hasOwnProperty.call(a, u) && (t[u] = a[u]);
7
- }
8
- return t;
9
- }, _.apply(this, arguments);
10
- }
11
- var se = 0.996, ue = function(n, a) {
12
- return a === void 0 && (a = se), n * a / (1 - a);
13
- };
14
- function le(t) {
15
- return t[t.length - 1];
16
- }
17
- function ce(t) {
18
- return t.reduce(function(n, a) {
19
- return n + a;
20
- }) / t.length;
21
- }
22
- var ve = function(n, a, u) {
23
- return Math.min(Math.max(a, n), u);
24
- };
25
- function k(t, n) {
26
- if (t.length !== n.length)
27
- throw new Error("vectors must be same length");
28
- return t.map(function(a, u) {
29
- return a + n[u];
30
- });
31
- }
32
- function ee(t) {
33
- return Math.max.apply(Math, t.map(Math.abs));
34
- }
35
- function O(t) {
36
- return Object.freeze(t), Object.values(t).forEach(function(n) {
37
- n !== null && typeof n == "object" && !Object.isFrozen(n) && O(n);
38
- }), t;
39
- }
40
- function fe() {
41
- var t = {};
42
- function n(d, s) {
43
- return t[d] = (t[d] || []).concat(s), function() {
44
- return a(d, s);
45
- };
46
- }
47
- function a(d, s) {
48
- t[d] = (t[d] || []).filter(function(e) {
49
- return e !== s;
50
- });
51
- }
52
- function u(d, s) {
53
- d in t && t[d].forEach(function(e) {
54
- return e(s);
55
- });
56
- }
57
- return O({
58
- on: n,
59
- off: a,
60
- dispatch: u
61
- });
62
- }
63
- function de(t) {
64
- var n = [], a = function(e) {
65
- return e.addEventListener("wheel", t, {
66
- passive: !1
67
- }), n.push(e), function() {
68
- return u(e);
69
- };
70
- }, u = function(e) {
71
- e.removeEventListener("wheel", t), n = n.filter(function(D) {
72
- return D !== e;
73
- });
74
- }, d = function() {
75
- n.forEach(u);
76
- };
77
- return O({
78
- observe: a,
79
- unobserve: u,
80
- disconnect: d
81
- });
82
- }
83
- var me = 16 * 1.125, pe = typeof window < "u" && window.innerHeight || 800, $ = [1, me, pe];
84
- function he(t) {
85
- var n = t.deltaX * $[t.deltaMode], a = t.deltaY * $[t.deltaMode], u = (t.deltaZ || 0) * $[t.deltaMode];
86
- return {
87
- timeStamp: t.timeStamp,
88
- axisDelta: [n, a, u]
89
- };
90
- }
91
- var ge = [-1, -1, -1];
92
- function Ee(t, n) {
93
- if (!n)
94
- return t;
95
- var a = n === !0 ? ge : n.map(function(u) {
96
- return u ? -1 : 1;
97
- });
98
- return _({}, t, {
99
- axisDelta: t.axisDelta.map(function(u, d) {
100
- return u * a[d];
101
- })
102
- });
103
- }
104
- var te = 700, Me = function(n) {
105
- return _({}, n, {
106
- axisDelta: n.axisDelta.map(function(a) {
107
- return ve(a, -te, te);
108
- })
109
- });
110
- }, q = process.env.NODE_ENV !== "production", xe = 0.6, De = 0.96, Ae = 2, ne = 5, re = /* @__PURE__ */ O({
111
- preventWheelAction: !0,
112
- reverseSign: [!0, !0, !1]
113
- }), be = 400;
114
- function ie() {
115
- return {
116
- isStarted: !1,
117
- isStartPublished: !1,
118
- isMomentum: !1,
119
- startTime: 0,
120
- lastAbsDelta: 1 / 0,
121
- axisMovement: [0, 0, 0],
122
- axisVelocity: [0, 0, 0],
123
- accelerationFactors: [],
124
- scrollPoints: [],
125
- scrollPointsToMerge: [],
126
- willEndTimeout: be
127
- };
128
- }
129
- function Se(t) {
130
- t === void 0 && (t = {});
131
- var n = fe(), a = n.on, u = n.off, d = n.dispatch, s = re, e = ie(), D, A = !1, w, C = function(r) {
132
- Array.isArray(r) ? r.forEach(function(o) {
133
- return W(o);
134
- }) : W(r);
135
- }, X = function(r) {
136
- return r === void 0 && (r = {}), Object.values(r).some(function(o) {
137
- return o == null;
138
- }) ? (q && console.error("updateOptions ignored! undefined & null options not allowed"), s) : s = O(_({}, re, s, r));
139
- }, V = function(r) {
140
- var o = _({
141
- event: D,
142
- isStart: !1,
143
- isEnding: !1,
144
- isMomentumCancel: !1,
145
- isMomentum: e.isMomentum,
146
- axisDelta: [0, 0, 0],
147
- axisVelocity: e.axisVelocity,
148
- axisMovement: e.axisMovement,
149
- get axisMovementProjection() {
150
- return k(o.axisMovement, o.axisVelocity.map(function(f) {
151
- return ue(f);
152
- }));
153
- }
154
- }, r);
155
- d("wheel", _({}, o, {
156
- previous: w
157
- })), w = o;
158
- }, g = function(r, o) {
159
- var f = s, p = f.preventWheelAction, h = o[0], i = o[1], c = o[2];
160
- if (typeof p == "boolean") return p;
161
- switch (p) {
162
- case "x":
163
- return Math.abs(h) >= r;
164
- case "y":
165
- return Math.abs(i) >= r;
166
- case "z":
167
- return Math.abs(c) >= r;
168
- default:
169
- return q && console.warn("unsupported preventWheelAction value: " + p, "warn"), !1;
170
- }
171
- }, W = function(r) {
172
- var o = Me(Ee(he(r), s.reverseSign)), f = o.axisDelta, p = o.timeStamp, h = ee(f);
173
- if (r.preventDefault && g(h, f) && r.preventDefault(), e.isStarted ? e.isMomentum && h > Math.max(2, e.lastAbsDelta * 2) && (S(!0), M()) : M(), h === 0 && Object.is && Object.is(r.deltaX, -0)) {
174
- A = !0;
175
- return;
176
- }
177
- D = r, e.axisMovement = k(e.axisMovement, f), e.lastAbsDelta = h, e.scrollPointsToMerge.push({
178
- axisDelta: f,
179
- timeStamp: p
180
- }), x(), V({
181
- axisDelta: f,
182
- isStart: !e.isStartPublished
183
- }), e.isStartPublished = !0, N();
184
- }, x = function() {
185
- e.scrollPointsToMerge.length === Ae ? (e.scrollPoints.unshift({
186
- axisDeltaSum: e.scrollPointsToMerge.map(function(r) {
187
- return r.axisDelta;
188
- }).reduce(k),
189
- timeStamp: ce(e.scrollPointsToMerge.map(function(r) {
190
- return r.timeStamp;
191
- }))
192
- }), L(), e.scrollPointsToMerge.length = 0, e.scrollPoints.length = 1, e.isMomentum || b()) : e.isStartPublished || j();
193
- }, j = function() {
194
- e.axisVelocity = le(e.scrollPointsToMerge).axisDelta.map(function(r) {
195
- return r / e.willEndTimeout;
196
- });
197
- }, L = function() {
198
- var r = e.scrollPoints, o = r[0], f = r[1];
199
- if (!(!f || !o)) {
200
- var p = o.timeStamp - f.timeStamp;
201
- if (p <= 0) {
202
- q && console.warn("invalid deltaTime");
203
- return;
204
- }
205
- var h = o.axisDeltaSum.map(function(c) {
206
- return c / p;
207
- }), i = h.map(function(c, v) {
208
- return c / (e.axisVelocity[v] || 1);
209
- });
210
- e.axisVelocity = h, e.accelerationFactors.push(i), Y(p);
211
- }
212
- }, Y = function(r) {
213
- var o = Math.ceil(r / 10) * 10 * 1.2;
214
- e.isMomentum || (o = Math.max(100, o * 2)), e.willEndTimeout = Math.min(1e3, Math.round(o));
215
- }, z = function(r) {
216
- return r === 0 ? !0 : r <= De && r >= xe;
217
- }, b = function() {
218
- if (e.accelerationFactors.length >= ne) {
219
- if (A && (A = !1, ee(e.axisVelocity) >= 0.2)) {
220
- E();
221
- return;
222
- }
223
- var r = e.accelerationFactors.slice(ne * -1), o = r.every(function(f) {
224
- var p = !!f.reduce(function(i, c) {
225
- return i && i < 1 && i === c ? 1 : 0;
226
- }), h = f.filter(z).length === f.length;
227
- return p || h;
228
- });
229
- o && E(), e.accelerationFactors = r;
230
- }
231
- }, E = function() {
232
- e.isMomentum = !0;
233
- }, M = function() {
234
- e = ie(), e.isStarted = !0, e.startTime = Date.now(), w = void 0, A = !1;
235
- }, N = /* @__PURE__ */ (function() {
236
- var l;
237
- return function() {
238
- clearTimeout(l), l = setTimeout(S, e.willEndTimeout);
239
- };
240
- })(), S = function(r) {
241
- r === void 0 && (r = !1), e.isStarted && (e.isMomentum && r ? V({
242
- isEnding: !0,
243
- isMomentumCancel: !0
244
- }) : V({
245
- isEnding: !0
246
- }), e.isMomentum = !1, e.isStarted = !1);
247
- }, I = de(C), G = I.observe, H = I.unobserve, F = I.disconnect;
248
- return X(t), O({
249
- on: a,
250
- off: u,
251
- observe: G,
252
- unobserve: H,
253
- disconnect: F,
254
- feedWheel: C,
255
- updateOptions: X
256
- });
257
- }
258
- var ye = {
259
- active: !0,
260
- breakpoints: {},
261
- wheelDraggingClass: "is-wheel-dragging",
262
- forceWheelAxis: void 0,
263
- target: void 0
264
- };
265
- ae.globalOptions = void 0;
266
- var Te = process.env.NODE_ENV !== "production";
267
- function ae(t) {
268
- t === void 0 && (t = {});
269
- var n, a = function() {
270
- };
271
- function u(s, e) {
272
- var D, A, w = e.mergeOptions, C = e.optionsAtMedia, X = w(ye, ae.globalOptions), V = w(X, t);
273
- n = C(V);
274
- var g = s.internalEngine(), W = (D = n.target) != null ? D : s.containerNode().parentNode, x = (A = n.forceWheelAxis) != null ? A : g.options.axis, j = Se({
275
- preventWheelAction: x,
276
- reverseSign: [!0, !0, !1]
277
- });
278
- function L() {
279
- N = (x === "x" ? g.containerRect.width : g.containerRect.height) / 2;
280
- }
281
- var Y = j.observe(W), z = j.on("wheel", h), b = !1, E, M = 0, N = 0, S = !1;
282
- L(), s.on("resize", L);
283
- function I(i) {
284
- try {
285
- E = new MouseEvent("mousedown", i.event), o(E);
286
- } catch {
287
- return Te && console.warn("Legacy browser requires events-polyfill (https://github.com/xiel/embla-carousel-wheel-gestures#legacy-browsers)"), a();
288
- }
289
- b = !0, M = 0, H(), n.wheelDraggingClass && W.classList.add(n.wheelDraggingClass);
290
- }
291
- function G(i) {
292
- b = !1, o(r("mouseup", i)), F(), n.wheelDraggingClass && W.classList.remove(n.wheelDraggingClass);
293
- }
294
- function H() {
295
- document.documentElement.addEventListener("mousemove", l, !0), document.documentElement.addEventListener("mouseup", l, !0), document.documentElement.addEventListener("mousedown", l, !0);
296
- }
297
- function F() {
298
- document.documentElement.removeEventListener("mousemove", l, !0), document.documentElement.removeEventListener("mouseup", l, !0), document.documentElement.removeEventListener("mousedown", l, !0);
299
- }
300
- function l(i) {
301
- b && i.isTrusted && i.stopImmediatePropagation();
302
- }
303
- function r(i, c) {
304
- var v, m;
305
- if (x === g.options.axis) {
306
- var y = c.axisMovement;
307
- v = y[0], m = y[1];
308
- } else {
309
- var P = c.axisMovement;
310
- m = P[0], v = P[1];
311
- }
312
- var B = f(c), T = B.isAtBoundary;
313
- if (T) {
314
- var R = Math.min(M / N, 1), Z = 0.25 + R * 0.5, U = v > 0 ? -1 : 1, oe = M * U, J = oe * Z;
315
- v += J, m += J;
316
- }
317
- if (!g.options.skipSnaps && !g.options.dragFree) {
318
- var K = g.containerRect.width, Q = g.containerRect.height;
319
- v = v < 0 ? Math.max(v, -K) : Math.min(v, K), m = m < 0 ? Math.max(m, -Q) : Math.min(m, Q);
320
- }
321
- return new MouseEvent(i, {
322
- clientX: E.clientX + v,
323
- clientY: E.clientY + m,
324
- screenX: E.screenX + v,
325
- screenY: E.screenY + m,
326
- movementX: v,
327
- movementY: m,
328
- button: 0,
329
- bubbles: !0,
330
- cancelable: !0,
331
- composed: !0
332
- });
333
- }
334
- function o(i) {
335
- s.containerNode().dispatchEvent(i);
336
- }
337
- function f(i) {
338
- var c = i.axisDelta, v = c[0], m = c[1], y = s.scrollProgress(), P = y < 1, B = y > 0, T = x === "x" ? v : m, R = T < 0, Z = T > 0, U = R && !P || Z && !B;
339
- return {
340
- isAtBoundary: U,
341
- primaryAxisDelta: T
342
- };
343
- }
344
- function p(i) {
345
- var c = f(i), v = c.isAtBoundary, m = c.primaryAxisDelta;
346
- if (v && !i.isMomentum) {
347
- if (M += Math.abs(m), M > N)
348
- return S = !0, G(i), !0;
349
- } else
350
- M = 0;
351
- return !1;
352
- }
353
- function h(i) {
354
- var c = i.axisDelta, v = c[0], m = c[1], y = x === "x" ? v : m, P = x === "x" ? m : v, B = i.isMomentum && i.previous && !i.previous.isMomentum, T = i.isEnding && !i.isMomentum || B, R = Math.abs(y) > Math.abs(P);
355
- R && !b && !i.isMomentum && !S && I(i), S && i.isEnding && (S = !1), b && (p(i) || (T ? G(i) : o(r("mousemove", i))));
356
- }
357
- a = function() {
358
- Y(), z(), s.off("resize", L), F();
359
- };
360
- }
361
- var d = {
362
- name: "wheelGestures",
363
- options: t,
364
- init: u,
365
- destroy: function() {
366
- return a();
367
- }
368
- };
369
- return d;
370
- }
371
- export {
372
- ae as WheelGesturesPlugin
373
- };