aptechka 0.20.0 → 0.21.0

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,32 +1,31 @@
1
- import { a as k, p as v } from "../attributes-69we3byR.js";
1
+ import { a as W, p as j } from "../attributes-69we3byR.js";
2
2
  import { i as f } from "../browser-0zX67oeU.js";
3
- import { g as W, n as j, s as N } from "../coordinates-CgdGoSYs.js";
4
- import { f as U, b as F, a as K, g as q } from "../dom-0S_WDL4g.js";
5
- import { c as J, n as Y, f as Z, p as X, b as _, i as H, m as L, e as tt, g as et, j as st, d as at, o as nt, a as ot, h as rt, k as it, l as ut } from "../easings-BKi40vHz.js";
6
- import { b as lt, f as pt, c as ft, a as mt, d as dt, g as ht, e as gt, i as xt, m as yt, h as St, o as Ct, p as wt } from "../object-DOa0yKM9.js";
7
- import { d as Et, t as Ot } from "../function-C10DGppn.js";
8
- import { s as It } from "../gestures-D2Fdra_G.js";
9
- import { c as m } from "../string-f0Dnk0L1.js";
10
- import { a as Rt, g as At, i as Dt, k as Mt, s as Qt, t as $t, u as Tt } from "../string-f0Dnk0L1.js";
11
- import { g as vt, a as zt, b as Wt } from "../layout-HoBT_Da2.js";
12
- import { e as Nt, f as Vt, c as Ut, d as Ft, l as Kt, m as qt, n as Gt, p as Jt, r as Yt, g as Zt, b as Xt, a as _t, s as Ht, t as Lt } from "../polyfills-AItxku8u.js";
13
- import { g as ee, a as se } from "../style-j2TwriJ_.js";
14
- function g(t, e, ...s) {
15
- return [...t.slice(0, e), ...s, ...t.slice(e)];
16
- }
17
- function x(t, e) {
18
- const s = t.length;
19
- e = e % s;
20
- const a = new Array(s);
21
- for (let n = 0; n < s; n++) {
22
- const o = (n + e) % s;
23
- a[o] = t[n];
3
+ import { f as V, b as U, a as F, g as K } from "../dom-0S_WDL4g.js";
4
+ import { c as G, n as J, f as Y, p as Z, b as X, i as _, m as H, e as L, g as tt, j as et, d as st, o as nt, a as at, h as ot, k as it, l as rt } from "../easings-BKi40vHz.js";
5
+ import { b as lt, f as ct, c as ht, a as ft, d as pt, g as dt, e as mt, i as gt, m as xt, h as yt, o as St, p as wt } from "../object-DOa0yKM9.js";
6
+ import { d as Bt, t as Et } from "../function-C10DGppn.js";
7
+ import { s as bt } from "../gestures-D2Fdra_G.js";
8
+ import { c as p } from "../string-f0Dnk0L1.js";
9
+ import { a as Pt, g as Rt, i as At, k as Dt, s as Mt, t as Qt, u as $t } from "../string-f0Dnk0L1.js";
10
+ import { g as kt, a as vt, b as zt } from "../layout-HoBT_Da2.js";
11
+ import { e as jt, f as Nt, c as Vt, d as Ut, l as Ft, m as Kt, n as qt, p as Gt, r as Jt, g as Yt, b as Zt, a as Xt, s as _t, t as Ht } from "../polyfills-AItxku8u.js";
12
+ import { g as te, a as ee } from "../style-j2TwriJ_.js";
13
+ function g(e, t, ...s) {
14
+ return [...e.slice(0, t), ...s, ...e.slice(t)];
15
+ }
16
+ function x(e, t) {
17
+ const s = e.length;
18
+ t = t % s;
19
+ const n = new Array(s);
20
+ for (let a = 0; a < s; a++) {
21
+ const o = (a + t) % s;
22
+ n[o] = e[a];
24
23
  }
25
- return a;
24
+ return n;
26
25
  }
27
- function y(t, e = 2) {
28
- if (!+t) return "0 Bytes";
29
- const s = 1024, a = e < 0 ? 0 : e, n = [
26
+ function y(e, t = 2) {
27
+ if (!+e) return "0 Bytes";
28
+ const s = 1024, n = t < 0 ? 0 : t, a = [
30
29
  "Bytes",
31
30
  "KiB",
32
31
  "MiB",
@@ -36,195 +35,214 @@ function y(t, e = 2) {
36
35
  "EiB",
37
36
  "ZiB",
38
37
  "YiB"
39
- ], o = Math.floor(Math.log(t) / Math.log(s));
40
- return `${parseFloat((t / Math.pow(s, o)).toFixed(a))} ${n[o]}`;
38
+ ], o = Math.floor(Math.log(e) / Math.log(s));
39
+ return `${parseFloat((e / Math.pow(s, o)).toFixed(n))} ${a[o]}`;
41
40
  }
42
- function S(t, e) {
43
- const s = t.measureText(e), a = s.actualBoundingBoxAscent + s.actualBoundingBoxDescent, n = s.width;
41
+ function S(e, t) {
42
+ const s = e.measureText(t), n = s.actualBoundingBoxAscent + s.actualBoundingBoxDescent, a = s.width;
44
43
  return {
45
- height: a,
46
- width: n
44
+ height: n,
45
+ width: a
47
46
  };
48
47
  }
49
- function C(t) {
50
- return Math.floor(t) + 0.5;
48
+ function w(e) {
49
+ return Math.floor(e) + 0.5;
51
50
  }
52
- function w(t, e, s, a, n, o) {
53
- let r = t / e, c = s / a, i = 0, u = 0;
54
- return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > c ? (i = a, u = a * r) : (u = s, i = s / r), [
55
- (s - u) * n,
56
- (a - i) * o,
51
+ function C(e, t, s, n, a, o) {
52
+ let i = e / t, l = s / n, r = 0, u = 0;
53
+ return a = typeof a == "undefined" ? 0.5 : a, o = typeof o == "undefined" ? 0.5 : o, i > l ? (r = n, u = n * i) : (u = s, r = s / i), [
54
+ (s - u) * a,
55
+ (n - r) * o,
57
56
  u,
58
- i
57
+ r
59
58
  ];
60
59
  }
61
- function B(t, e, s, a, n, o) {
62
- let r = t / e, c = s / a, i = 0, u = 0;
63
- return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > c ? (u = s, i = s / r) : (i = a, u = a * r), [
64
- (s - u) * n,
65
- (a - i) * o,
60
+ function B(e, t, s, n, a, o) {
61
+ let i = e / t, l = s / n, r = 0, u = 0;
62
+ return a = typeof a == "undefined" ? 0.5 : a, o = typeof o == "undefined" ? 0.5 : o, i > l ? (u = s, r = s / i) : (r = n, u = n * i), [
63
+ (s - u) * a,
64
+ (n - r) * o,
66
65
  u,
67
- i
66
+ r
68
67
  ];
69
68
  }
70
- function E(t, e) {
71
- return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
72
- }
73
- function O(t, e) {
74
- return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
69
+ function E(e, t) {
70
+ return e.x < t.x + t.width && e.x > t.x && e.y < t.y + t.height && e.y > t.y;
71
+ }
72
+ function O(e, t) {
73
+ return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2) < t.radius;
74
+ }
75
+ function b(e, t, s = !1) {
76
+ let n = e.x - t.width / 2, a = t.height / 2 - e.y;
77
+ return s && (n = n / (t.width / 2), a = a / (t.height / 2)), { x: n, y: a };
78
+ }
79
+ function I(e, t) {
80
+ const s = e.x / t.width, n = e.y / t.height;
81
+ return { x: s, y: n };
82
+ }
83
+ function P(e, t) {
84
+ return t = t || {
85
+ x: 0,
86
+ y: 0,
87
+ width: document.documentElement.offsetWidth,
88
+ height: innerHeight
89
+ }, {
90
+ x: (e.x - t.x) / t.width * t.width,
91
+ y: (e.y - t.y) / t.height * t.height
92
+ };
75
93
  }
76
- function l(t, e) {
77
- const s = t.styleMap.get(e);
94
+ function c(e, t) {
95
+ const s = e.styleMap.get(t);
78
96
  if (s) {
79
- const a = s.toString();
80
- return a.startsWith("var") ? l(t, a.slice(4, -1)) : a;
97
+ const n = s.toString();
98
+ return n.startsWith("var") ? c(e, n.slice(4, -1)) : n;
81
99
  }
82
100
  }
83
- function b(...t) {
84
- const e = {};
101
+ function R(...e) {
102
+ const t = {};
85
103
  return Array.from(document.styleSheets).forEach((s) => {
86
- Array.from(s.cssRules).forEach((a) => {
87
- a instanceof CSSStyleRule && a.selectorText === ":root" && t.forEach((n) => {
88
- const o = l(a, n);
89
- o && (e[n] = o);
104
+ Array.from(s.cssRules).forEach((n) => {
105
+ n instanceof CSSStyleRule && n.selectorText === ":root" && e.forEach((a) => {
106
+ const o = c(n, a);
107
+ o && (t[a] = o);
90
108
  });
91
109
  });
92
- }), t.forEach((s) => {
93
- e[s] || console.warn(`variable named ${s} not found`);
94
- }), e;
95
- }
96
- function I(t) {
97
- const e = window.atob(t);
98
- return decodeURIComponent(window.escape(e));
99
- }
100
- function P(t) {
101
- const e = window.unescape(encodeURIComponent(t));
102
- return window.btoa(e);
103
- }
104
- function p(t) {
105
- let e = "";
106
- for (const s in t) {
107
- const a = t[s];
108
- typeof a == "object" ? (e += `${s} {`, e += p(a), e += "}") : e += `${m(s)}: ${a};`;
110
+ }), e.forEach((s) => {
111
+ t[s] || console.warn(`variable named ${s} not found`);
112
+ }), t;
113
+ }
114
+ function A(e) {
115
+ const t = window.atob(e);
116
+ return decodeURIComponent(window.escape(t));
117
+ }
118
+ function D(e) {
119
+ const t = window.unescape(encodeURIComponent(e));
120
+ return window.btoa(t);
121
+ }
122
+ function h(e) {
123
+ let t = "";
124
+ for (const s in e) {
125
+ const n = e[s];
126
+ typeof n == "object" ? (t += `${s} {`, t += h(n), t += "}") : t += `${p(s)}: ${n};`;
109
127
  }
110
- return e;
128
+ return t;
111
129
  }
112
- function R(t) {
130
+ function M(e) {
113
131
  if (f) {
114
- const e = new CSSStyleSheet();
115
- return e.replaceSync(p(t)), e;
132
+ const t = new CSSStyleSheet();
133
+ return t.replaceSync(h(e)), t;
116
134
  }
117
135
  return null;
118
136
  }
119
- function A(t) {
120
- return new Promise((e) => {
137
+ function Q(e) {
138
+ return new Promise((t) => {
121
139
  setTimeout(() => {
122
- e();
123
- }, t);
140
+ t();
141
+ }, e);
124
142
  });
125
143
  }
126
- function D(t, e = "") {
127
- e = e.endsWith("/") ? e.slice(0, -1) : e, t = t.replace(e, ""), t.startsWith("/") && (t = t.slice(1));
128
- const s = t.split("#"), a = s[0].split("?"), n = a[0].startsWith("/") ? a[0] : "/" + a[0], o = e + n, r = a == null ? void 0 : a[1], c = s == null ? void 0 : s[1];
144
+ function $(e, t = "") {
145
+ t = t.endsWith("/") ? t.slice(0, -1) : t, e = e.replace(t, ""), e.startsWith("/") && (e = e.slice(1));
146
+ const s = e.split("#"), n = s[0].split("?"), a = n[0].startsWith("/") ? n[0] : "/" + n[0], o = t + a, i = n == null ? void 0 : n[1], l = s == null ? void 0 : s[1];
129
147
  return {
130
- leaf: n,
148
+ leaf: a,
131
149
  pathname: o,
132
- parameters: r,
133
- hash: c
150
+ parameters: i,
151
+ hash: l
134
152
  };
135
153
  }
136
- function M(t = "/") {
137
- return t.endsWith("/") || (t += "/"), t.startsWith("/") || (t += "/"), t;
154
+ function T(e = "/") {
155
+ return e.endsWith("/") || (e += "/"), e.startsWith("/") || (e += "/"), e;
138
156
  }
139
- function Q(t, e, s, a) {
140
- const n = s || location.search, o = a ? a.startsWith("#") ? a : "#" + a : "", r = n ? n.startsWith("?") ? n : "?" + n : "", c = `${e}${o}${r}`;
141
- t === "push" ? history.pushState(null, "", c) : t === "replace" && history.replaceState(null, "", c);
157
+ function k(e, t, s, n) {
158
+ const a = s || location.search, o = n ? n.startsWith("#") ? n : "#" + n : "", i = a ? a.startsWith("?") ? a : "?" + a : "", l = `${t}${o}${i}`;
159
+ e === "push" ? history.pushState(null, "", l) : e === "replace" && history.replaceState(null, "", l);
142
160
  }
143
161
  export {
144
- Nt as calculateDistance,
145
- Vt as calculateDistanceWithRadius,
146
- m as camelToKebab,
147
- Rt as capitalize,
148
- Q as changeHistory,
149
- Ut as clamp,
162
+ jt as calculateDistance,
163
+ Nt as calculateDistanceWithRadius,
164
+ p as camelToKebab,
165
+ Pt as capitalize,
166
+ k as changeHistory,
167
+ Vt as clamp,
150
168
  lt as cloneDeep,
151
- pt as compareObjects,
169
+ ct as compareObjects,
152
170
  B as contain,
153
- w as cover,
154
- ft as createJSONAndSave,
155
- R as createStylesheet,
156
- Ft as damp,
157
- Et as debounce,
158
- P as decode,
159
- mt as dispatchBeforeSizeChangeEvent,
160
- dt as dispatchSizeChangeEvent,
171
+ C as cover,
172
+ ht as createJSONAndSave,
173
+ M as createStylesheet,
174
+ Ut as damp,
175
+ Bt as debounce,
176
+ D as decode,
177
+ ft as dispatchBeforeSizeChangeEvent,
178
+ pt as dispatchSizeChangeEvent,
161
179
  O as dotCircleCollision,
162
180
  E as dotRectCollision,
163
- J as easeInCubic,
164
- Y as easeInExpo,
165
- Z as easeInOutCubic,
166
- X as easeInOutExpo,
167
- _ as easeInOutQuad,
168
- H as easeInOutQuart,
169
- L as easeInOutQuint,
170
- tt as easeInQuad,
171
- et as easeInQuart,
172
- st as easeInQuint,
173
- at as easeOutCubic,
181
+ G as easeInCubic,
182
+ J as easeInExpo,
183
+ Y as easeInOutCubic,
184
+ Z as easeInOutExpo,
185
+ X as easeInOutQuad,
186
+ _ as easeInOutQuart,
187
+ H as easeInOutQuint,
188
+ L as easeInQuad,
189
+ tt as easeInQuart,
190
+ et as easeInQuint,
191
+ st as easeOutCubic,
174
192
  nt as easeOutExpo,
175
- ot as easeOutQuad,
176
- rt as easeOutQuart,
193
+ at as easeOutQuad,
194
+ ot as easeOutQuart,
177
195
  it as easeOutQuint,
178
- I as encode,
179
- U as findParentElement,
180
- F as findScrollParentElement,
181
- C as fixPosition,
196
+ A as encode,
197
+ V as findParentElement,
198
+ U as findScrollParentElement,
199
+ w as fixPosition,
182
200
  y as formatBytes,
183
- At as generateId,
184
- K as getAllParentElements,
185
- vt as getCumulativeOffsetLeft,
186
- zt as getCumulativeOffsetTop,
187
- Wt as getCumulativePosition,
188
- q as getElement,
189
- ee as getElementTransitionDurationMS,
190
- se as getElementTransitionDurationS,
191
- W as getPointerPosition,
192
- b as getRootVariables,
201
+ Rt as generateId,
202
+ F as getAllParentElements,
203
+ kt as getCumulativeOffsetLeft,
204
+ vt as getCumulativeOffsetTop,
205
+ zt as getCumulativePosition,
206
+ K as getElement,
207
+ te as getElementTransitionDurationMS,
208
+ ee as getElementTransitionDurationS,
209
+ P as getPointerPosition,
210
+ R as getRootVariables,
193
211
  g as insert,
194
212
  f as isBrowser,
195
- ht as isESClass,
196
- gt as isNullish,
197
- xt as isObject,
198
- Dt as isUppercase,
199
- Mt as kebabToCamel,
200
- Kt as lerp,
201
- ut as linear,
202
- qt as mapRange,
213
+ dt as isESClass,
214
+ mt as isNullish,
215
+ gt as isObject,
216
+ At as isUppercase,
217
+ Dt as kebabToCamel,
218
+ Ft as lerp,
219
+ rt as linear,
220
+ Kt as mapRange,
203
221
  S as measureText,
204
- yt as mergeDeep,
205
- St as mixin,
206
- j as normalize,
207
- M as normalizeBase,
208
- Gt as nullishCoalescing,
209
- Ct as omit,
210
- k as parseAttribute,
211
- v as parseAttributeValue,
222
+ xt as mergeDeep,
223
+ yt as mixin,
224
+ I as normalize,
225
+ T as normalizeBase,
226
+ qt as nullishCoalescing,
227
+ St as omit,
228
+ W as parseAttribute,
229
+ j as parseAttributeValue,
212
230
  wt as pick,
213
- Jt as preciseNumber,
214
- Yt as round,
215
- Zt as roundNumberTo,
216
- N as screenToCartesian,
217
- It as setupDrag,
231
+ Gt as preciseNumber,
232
+ Jt as round,
233
+ Yt as roundNumberTo,
234
+ b as screenToCartesian,
235
+ bt as setupDrag,
218
236
  x as shiftArray,
219
- Xt as smootherstep,
220
- _t as smoothstep,
221
- Qt as snakeToDotted,
222
- D as splitPath,
223
- Ht as step,
224
- p as styleToString,
225
- Ot as throttle,
226
- $t as toPascalCase,
227
- Lt as toStep,
228
- Tt as uncapitalize,
229
- A as wait
237
+ Zt as smootherstep,
238
+ Xt as smoothstep,
239
+ Mt as snakeToDotted,
240
+ $ as splitPath,
241
+ _t as step,
242
+ h as styleToString,
243
+ Et as throttle,
244
+ Qt as toPascalCase,
245
+ Ht as toStep,
246
+ $t as uncapitalize,
247
+ Q as wait
230
248
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -108,11 +108,6 @@
108
108
  "default": "./lib/order/index.js",
109
109
  "types": "./lib/order/index.d.ts"
110
110
  },
111
- "./pointer": {
112
- "require": "./lib/pointer/index.cjs",
113
- "default": "./lib/pointer/index.js",
114
- "types": "./lib/pointer/index.d.ts"
115
- },
116
111
  "./popover": {
117
112
  "require": "./lib/popover/index.cjs",
118
113
  "default": "./lib/popover/index.js",
@@ -218,9 +213,6 @@
218
213
  "order": [
219
214
  "lib/order/index.d.ts"
220
215
  ],
221
- "pointer": [
222
- "lib/pointer/index.d.ts"
223
- ],
224
216
  "popover": [
225
217
  "lib/popover/index.d.ts"
226
218
  ],
@@ -1,104 +0,0 @@
1
- var I = (i) => {
2
- throw TypeError(i);
3
- };
4
- var S = (i, r, t) => r.has(i) || I("Cannot " + t);
5
- var e = (i, r, t) => (S(i, r, "read from private field"), t ? t.call(i) : r.get(i)), a = (i, r, t) => r.has(i) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, t), h = (i, r, t, u) => (S(i, r, "write to private field"), u ? u.call(i, t) : r.set(i, t), t), P = (i, r, t) => (S(i, r, "access private method"), t);
6
- import { S as q } from "./Store-OTdcl6SX.js";
7
- import { p as z, n as F, c as y } from "./polyfills-AItxku8u.js";
8
- import { ticker as O } from "./ticker/index.js";
9
- import { TICK_ORDER as N } from "./order/index.js";
10
- var f, d, A, l, b, s, n, m, c, g, M, R, x;
11
- class E extends q {
12
- constructor(t, u) {
13
- super(t || 0, u);
14
- a(this, M);
15
- a(this, f);
16
- a(this, d, N.ANIMATION);
17
- a(this, A);
18
- a(this, l, new q(!1));
19
- a(this, b, 0);
20
- a(this, s, 0);
21
- a(this, n, -1 / 0);
22
- a(this, m, 1 / 0);
23
- a(this, c, 0);
24
- a(this, g, null);
25
- a(this, x, (t) => {
26
- this.handleAnimationFrame(t);
27
- });
28
- h(this, s, this.current);
29
- }
30
- get direction() {
31
- return e(this, b);
32
- }
33
- get target() {
34
- return e(this, s);
35
- }
36
- get min() {
37
- return e(this, n);
38
- }
39
- set min(t) {
40
- h(this, n, t), this.set(e(this, s), {
41
- equalize: !0
42
- });
43
- }
44
- get max() {
45
- return e(this, m);
46
- }
47
- set max(t) {
48
- h(this, m, t), this.set(e(this, s), {
49
- equalize: !0
50
- });
51
- }
52
- get from() {
53
- return e(this, c);
54
- }
55
- get isRunning() {
56
- return e(this, l);
57
- }
58
- get delta() {
59
- return Math.abs(e(this, s) - e(this, c));
60
- }
61
- get deltaProgress() {
62
- return this.delta ? z(Math.abs(this.current - e(this, c)) / this.delta, 6) : 0;
63
- }
64
- get distance() {
65
- return Math.abs(e(this, m) - e(this, n));
66
- }
67
- get distanceProgress() {
68
- return this.distance ? z(Math.abs(this.current - e(this, n)) / this.distance, 6) : 0;
69
- }
70
- set(t, u) {
71
- (e(this, s) !== t || u != null && u.restart) && (h(this, g, t), this.updateOptions(u), h(this, g, null), e(this, s) !== this.current && this.start());
72
- }
73
- shift(t, u) {
74
- this.set(e(this, s) + t, u);
75
- }
76
- reset() {
77
- super.reset(), this.set(this.initial, { equalize: !0 });
78
- }
79
- close() {
80
- super.close(), this.reset(), this.unlistenAnimationFrame();
81
- }
82
- listenAnimationFrame() {
83
- e(this, l).current || (e(this, l).current = !0, O.subscribe(e(this, x), {
84
- maxFPS: e(this, f),
85
- order: e(this, d),
86
- culling: e(this, A)
87
- }));
88
- }
89
- unlistenAnimationFrame() {
90
- e(this, l).current && (e(this, l).current = !1, O.unsubscribe(e(this, x)));
91
- }
92
- updateOptions(t) {
93
- h(this, f, F(t == null ? void 0 : t.maxFPS, e(this, f))), h(this, d, F(t == null ? void 0 : t.order, e(this, d))), h(this, A, F(t == null ? void 0 : t.culling, e(this, A))), h(this, n, F(t == null ? void 0 : t.min, e(this, n))), h(this, m, F(t == null ? void 0 : t.max, e(this, m))), P(this, M, R).call(this, typeof e(this, g) == "number" ? e(this, g) : e(this, s)), t != null && t.equalize && (this.unlistenAnimationFrame(), this.current = e(this, s)), t != null && t.restart && (this.unlistenAnimationFrame(), this.current = this.initial);
94
- }
95
- start() {
96
- this.listenAnimationFrame();
97
- }
98
- }
99
- f = new WeakMap(), d = new WeakMap(), A = new WeakMap(), l = new WeakMap(), b = new WeakMap(), s = new WeakMap(), n = new WeakMap(), m = new WeakMap(), c = new WeakMap(), g = new WeakMap(), M = new WeakSet(), R = function(t) {
100
- h(this, b, Math.sign(t - e(this, s))), h(this, s, y(t, e(this, n), e(this, m))), h(this, c, this.current);
101
- }, x = new WeakMap();
102
- export {
103
- E as A
104
- };
@@ -1 +0,0 @@
1
- "use strict";var C=i=>{throw TypeError(i)};var S=(i,s,t)=>s.has(i)||C("Cannot "+t);var e=(i,s,t)=>(S(i,s,"read from private field"),t?t.call(i):s.get(i)),a=(i,s,t)=>s.has(i)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),h=(i,s,t,n)=>(S(i,s,"write to private field"),n?n.call(i,t):s.set(i,t),t),M=(i,s,t)=>(S(i,s,"access private method"),t);const I=require("./Store-CDb6RMce.cjs"),c=require("./polyfills-Caa6z-Ay.cjs"),P=require("./ticker/index.cjs"),z=require("./order/index.cjs");var f,b,A,m,F,r,u,l,g,d,q,y,x;class N extends I.Store{constructor(t,n){super(t||0,n);a(this,q);a(this,f);a(this,b,z.TICK_ORDER.ANIMATION);a(this,A);a(this,m,new I.Store(!1));a(this,F,0);a(this,r,0);a(this,u,-1/0);a(this,l,1/0);a(this,g,0);a(this,d,null);a(this,x,t=>{this.handleAnimationFrame(t)});h(this,r,this.current)}get direction(){return e(this,F)}get target(){return e(this,r)}get min(){return e(this,u)}set min(t){h(this,u,t),this.set(e(this,r),{equalize:!0})}get max(){return e(this,l)}set max(t){h(this,l,t),this.set(e(this,r),{equalize:!0})}get from(){return e(this,g)}get isRunning(){return e(this,m)}get delta(){return Math.abs(e(this,r)-e(this,g))}get deltaProgress(){return this.delta?c.preciseNumber(Math.abs(this.current-e(this,g))/this.delta,6):0}get distance(){return Math.abs(e(this,l)-e(this,u))}get distanceProgress(){return this.distance?c.preciseNumber(Math.abs(this.current-e(this,u))/this.distance,6):0}set(t,n){(e(this,r)!==t||n!=null&&n.restart)&&(h(this,d,t),this.updateOptions(n),h(this,d,null),e(this,r)!==this.current&&this.start())}shift(t,n){this.set(e(this,r)+t,n)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,m).current||(e(this,m).current=!0,P.ticker.subscribe(e(this,x),{maxFPS:e(this,f),order:e(this,b),culling:e(this,A)}))}unlistenAnimationFrame(){e(this,m).current&&(e(this,m).current=!1,P.ticker.unsubscribe(e(this,x)))}updateOptions(t){h(this,f,c.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,f))),h(this,b,c.nullishCoalescing(t==null?void 0:t.order,e(this,b))),h(this,A,c.nullishCoalescing(t==null?void 0:t.culling,e(this,A))),h(this,u,c.nullishCoalescing(t==null?void 0:t.min,e(this,u))),h(this,l,c.nullishCoalescing(t==null?void 0:t.max,e(this,l))),M(this,q,y).call(this,typeof e(this,d)=="number"?e(this,d):e(this,r)),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=e(this,r)),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=this.initial)}start(){this.listenAnimationFrame()}}f=new WeakMap,b=new WeakMap,A=new WeakMap,m=new WeakMap,F=new WeakMap,r=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakSet,y=function(t){h(this,F,Math.sign(t-e(this,r))),h(this,r,c.clamp(t,e(this,u),e(this,l))),h(this,g,this.current)},x=new WeakMap;exports.Animation=N;
@@ -1 +0,0 @@
1
- "use strict";var q=Object.defineProperty,y=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))O.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))v.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>y(t,C(e));var A=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(A(t,e,"read from private field"),s?s.call(t):e.get(t)),u=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),c=(t,e,s,r)=>(A(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const h=require("./polyfills-Caa6z-Ay.cjs"),w=require("./Animation-Dt4Kc5VA.cjs");var i,n;class B extends w.Animation{constructor(s,r){super(s,r);u(this,i);u(this,n);this.damping=20,this.stiffness=0,this.mass=0,c(this,i,0),c(this,n,0),this.updateOptions(p(f({},r),{equalize:!0}))}get velocity(){return a(this,i)}get speed(){return a(this,n)}updateOptions(s){this.damping=h.nullishCoalescing(s==null?void 0:s.damping,this.damping),this.mass=h.nullishCoalescing(s==null?void 0:s.mass,this.mass),this.stiffness=h.nullishCoalescing(s==null?void 0:s.stiffness,this.stiffness),super.updateOptions(s)}handleAnimationFrame(s){h.preciseNumber(this.current,6)===h.preciseNumber(this.target,6)&&(this.unlistenAnimationFrame(),this.current=this.target);const r=this.current,F=Math.abs(r-this.target);c(this,n,F/s.timeBetweenFrames);const m=s.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const b=(this.target-this.current)*this.stiffness-a(this,i)*this.damping;c(this,i,a(this,i)+b/this.mass*m),this.current+=a(this,i)*m}else this.current=h.damp(this.current,this.target,this.damping,m)}}i=new WeakMap,n=new WeakMap;exports.Damped=B;
@@ -1,52 +0,0 @@
1
- var v = Object.defineProperty, w = Object.defineProperties;
2
- var x = Object.getOwnPropertyDescriptors;
3
- var d = Object.getOwnPropertySymbols;
4
- var y = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
5
- var g = (s) => {
6
- throw TypeError(s);
7
- };
8
- var f = (s, e, t) => e in s ? v(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, l = (s, e) => {
9
- for (var t in e || (e = {}))
10
- y.call(e, t) && f(s, t, e[t]);
11
- if (d)
12
- for (var t of d(e))
13
- B.call(e, t) && f(s, t, e[t]);
14
- return s;
15
- }, p = (s, e) => w(s, x(e));
16
- var A = (s, e, t) => e.has(s) || g("Cannot " + t);
17
- var r = (s, e, t) => (A(s, e, "read from private field"), t ? t.call(s) : e.get(s)), c = (s, e, t) => e.has(s) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), n = (s, e, t, a) => (A(s, e, "write to private field"), a ? a.call(s, t) : e.set(s, t), t);
18
- import { n as u, p as F, d as D } from "./polyfills-AItxku8u.js";
19
- import { A as q } from "./Animation-CuR3fbKl.js";
20
- var i, h;
21
- class N extends q {
22
- constructor(t, a) {
23
- super(t, a);
24
- c(this, i);
25
- c(this, h);
26
- this.damping = 20, this.stiffness = 0, this.mass = 0, n(this, i, 0), n(this, h, 0), this.updateOptions(p(l({}, a), { equalize: !0 }));
27
- }
28
- get velocity() {
29
- return r(this, i);
30
- }
31
- get speed() {
32
- return r(this, h);
33
- }
34
- updateOptions(t) {
35
- this.damping = u(t == null ? void 0 : t.damping, this.damping), this.mass = u(t == null ? void 0 : t.mass, this.mass), this.stiffness = u(t == null ? void 0 : t.stiffness, this.stiffness), super.updateOptions(t);
36
- }
37
- handleAnimationFrame(t) {
38
- F(this.current, 6) === F(this.target, 6) && (this.unlistenAnimationFrame(), this.current = this.target);
39
- const a = this.current, O = Math.abs(a - this.target);
40
- n(this, h, O / t.timeBetweenFrames);
41
- const m = t.timeBetweenFrames / 1e3;
42
- if (this.mass || this.stiffness) {
43
- const b = (this.target - this.current) * this.stiffness - r(this, i) * this.damping;
44
- n(this, i, r(this, i) + b / this.mass * m), this.current += r(this, i) * m;
45
- } else
46
- this.current = D(this.current, this.target, this.damping, m);
47
- }
48
- }
49
- i = new WeakMap(), h = new WeakMap();
50
- export {
51
- N as D
52
- };
@@ -1 +0,0 @@
1
- "use strict";var F=Object.defineProperty,O=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var o=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,t,e)=>t in i?F(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,g=(i,t)=>{for(var e in t||(t={}))o.call(t,e)&&m(i,e,t[e]);if(c)for(var e of c(t))p.call(t,e)&&m(i,e,t[e]);return i},A=(i,t)=>O(i,b(t));var f=(i,t,e)=>t.has(i)||d("Cannot "+e);var r=(i,t,e)=>(f(i,t,"read from private field"),e?e.call(i):t.get(i)),l=(i,t,e)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),h=(i,t,e,s)=>(f(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);const w=require("./easings-DsS5-Kqc.cjs"),u=require("./polyfills-Caa6z-Ay.cjs"),C=require("./Animation-Dt4Kc5VA.cjs");var n,a;class S extends C.Animation{constructor(e,s){super(e||0,s);l(this,n,w.linear);l(this,a,1e3);this.updateOptions(A(g({},s),{equalize:!0}))}updateOptions(e){super.updateOptions(e),h(this,n,u.nullishCoalescing(e==null?void 0:e.easing,r(this,n))),h(this,a,u.nullishCoalescing(e==null?void 0:e.duration,r(this,a)))}handleAnimationFrame(e){const s=e.timeElapsedSinceSubscription/1e3/(r(this,a)/1e3),q=r(this,n).call(this,u.clamp(s,0,1));this.current=u.preciseNumber(this.from+(this.target-this.from)*q,6),s>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,a=new WeakMap;exports.Tweened=S;