aptechka 0.5.27 → 0.5.28

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 +1 @@
1
- "use strict";var S=(r,a,e)=>{if(!a.has(r))throw TypeError("Cannot "+e)};var t=(r,a,e)=>(S(r,a,"read from private field"),e?e.call(r):a.get(r)),i=(r,a,e)=>{if(a.has(r))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(r):a.set(r,e)},s=(r,a,e,n)=>(S(r,a,"write to private field"),n?n.call(r,e):a.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../notifier/index.cjs"),f=require("../browser-CpzFX2xg.cjs"),R=require("../dom-JBOkFLTh.cjs"),x=require("../ticker/index.cjs"),F=require("../gestures-DHLrn6Q8.cjs"),N=require("../number-yVpzMdbQ.cjs"),U=require("../order/index.cjs");var W;class P{constructor(){i(this,W,new O.Notifier)}get changeEvent(){return t(this,W)}}W=new WeakMap;var m,c,d,A;class j extends P{constructor(e){super();i(this,m,null);i(this,c,null);i(this,d,"offsetHeight");i(this,A,e=>{const n=e.shiftKey?-1:1;let h;e.code==="Space"?h=n*t(this,c)[t(this,d)]*.4:e.code==="ArrowLeft"?h=-1*t(this,c)[t(this,d)]*.2:e.code==="ArrowRight"?h=1*t(this,c)[t(this,d)]*.2:e.code==="ArrowUp"?h=-1*t(this,c)[t(this,d)]*.2:e.code==="ArrowDown"?h=1*t(this,c)[t(this,d)]*.2:e.code==="PageUp"?h=-1*t(this,c)[t(this,d)]:e.code==="PageDown"?h=1*t(this,c)[t(this,d)]:e.code==="Home"?h=0:e.code==="End"&&(h=t(this,d)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),h&&(e.stopPropagation(),this.changeEvent.notify("keyboard",h))});f.isBrowser&&(s(this,m,e!=null&&e.element&&R.getElement(e.element)||window),s(this,c,t(this,m)instanceof HTMLElement?t(this,m):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){s(this,d,e==="width"?"offsetWidth":"offsetHeight")}connect(){f.isBrowser&&t(this,m).addEventListener("keydown",t(this,A))}disconnect(){f.isBrowser&&t(this,m).removeEventListener("keydown",t(this,A))}}m=new WeakMap,c=new WeakMap,d=new WeakMap,A=new WeakMap;var o,v,I,T,u,M,L,q;class z extends P{constructor(e){super();i(this,o,void 0);i(this,v,void 0);i(this,I,void 0);i(this,T,void 0);i(this,u,void 0);i(this,M,void 0);i(this,L,void 0);i(this,q,void 0);this.direction=1,s(this,u,!1),s(this,L,n=>{t(this,u)||this.changeEvent.notify("autoplay",n.timeBetweenFrames*t(this,o)*this.direction)}),s(this,q,()=>{t(this,u)||this.changeEvent.notify("autoplay",Math.sign(t(this,o))*this.direction)}),s(this,o,(e==null?void 0:e.speed)||1),s(this,v,(e==null?void 0:e.interval)||!1),s(this,I,e)}set interval(e){s(this,v,e),this.connect()}set speed(e){s(this,o,e),this.connect()}connect(){this.disconnect(),t(this,v)?s(this,T,setInterval(t(this,q),Math.abs(t(this,o)))):x.ticker.subscribe(t(this,L),t(this,I))}disconnect(){clearInterval(t(this,T)),x.ticker.unsubscribe(t(this,L)),clearInterval(t(this,M)),s(this,u,!1)}pauseAndContinue(e){e&&!t(this,u)&&(clearInterval(t(this,M)),s(this,u,!0),s(this,M,setTimeout(()=>{s(this,u,!1)},3e3)))}}o=new WeakMap,v=new WeakMap,I=new WeakMap,T=new WeakMap,u=new WeakMap,M=new WeakMap,L=new WeakMap,q=new WeakMap;var k,g,C,D;class G extends P{constructor(e){super();i(this,k,null);i(this,g,void 0);i(this,C,void 0);i(this,D,e=>{let n=0;if(e.preventDefault(),!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*.5||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*.5))if(n=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const h=Date.now();if(h-t(this,C)>40&&(n=100*Math.sign(n)),s(this,C,h),Math.abs(n)<100||t(this,g))return;this.changeEvent.notify("wheel",n),s(this,g,setTimeout(()=>{s(this,g,void 0)},80))}else this.changeEvent.notify("wheel",n)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,s(this,C,Date.now()),f.isBrowser&&s(this,k,e!=null&&e.element&&R.getElement(e.element)||window)}connect(){f.isBrowser&&t(this,k).addEventListener("wheel",t(this,D),{passive:!1})}disconnect(){f.isBrowser&&(t(this,k).removeEventListener("wheel",t(this,D)),clearTimeout(t(this,g)))}}k=new WeakMap,g=new WeakMap,C=new WeakMap,D=new WeakMap;var y,w,B,l,H,E;const b=class b extends P{constructor(e){super();i(this,w,null);i(this,B,!1);i(this,l,0);i(this,H,e=>{if(e.composedPath().find(h=>h instanceof HTMLElement&&h.hasAttribute("drag-dead-zone")))return;this.swipe||x.ticker.unsubscribe(t(this,E));let n=e;s(this,l,0),document.documentElement.classList.add("grabbing"),F.setupDrag(h=>{if(t(this,B)||t(b,y)&&t(b,y)!==t(this,w))return;this.swipe&&s(this,B,!0);const X=n.x-h.x,Y=n.y-h.y;this.axis==="x"?s(this,l,X):s(this,l,Y),n=h,(this.axis==="x"&&Math.abs(X)>Math.abs(Y)||this.axis==="y"&&Math.abs(Y)>Math.abs(X))&&(s(b,y,t(this,w)),this.changeEvent.notify("drag",t(this,l)))},()=>{s(b,y,null),this.swipe||(s(this,l,t(this,l)*3),x.ticker.subscribe(t(this,E),{order:U.TICK_ORDER.SCROLL-1})),document.documentElement.classList.remove("grabbing"),s(this,B,!1)})});i(this,E,()=>{Math.floor(t(this,l))||x.ticker.unsubscribe(t(this,E)),s(this,l,t(this,l)*.95),s(this,l,N.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l))});this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,f.isBrowser&&s(this,w,e!=null&&e.element&&R.getElement(e.element)||document.documentElement)}connect(){f.isBrowser&&t(this,w).addEventListener("pointerdown",t(this,H))}disconnect(){f.isBrowser&&(t(this,w).removeEventListener("pointerdown",t(this,H)),x.ticker.unsubscribe(t(this,E)))}};y=new WeakMap,w=new WeakMap,B=new WeakMap,l=new WeakMap,H=new WeakMap,E=new WeakMap,i(b,y,null);let K=b;exports.AutoplayControls=z;exports.Controls=P;exports.DragControls=K;exports.KeyboardControls=j;exports.WheelControls=G;
1
+ "use strict";var O=(r,a,e)=>{if(!a.has(r))throw TypeError("Cannot "+e)};var t=(r,a,e)=>(O(r,a,"read from private field"),e?e.call(r):a.get(r)),s=(r,a,e)=>{if(a.has(r))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(r):a.set(r,e)},i=(r,a,e,n)=>(O(r,a,"write to private field"),n?n.call(r,e):a.set(r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("../notifier/index.cjs"),f=require("../browser-CpzFX2xg.cjs"),S=require("../dom-JBOkFLTh.cjs"),v=require("../ticker/index.cjs"),N=require("../gestures-DHLrn6Q8.cjs"),U=require("../number-yVpzMdbQ.cjs"),j=require("../order/index.cjs");var X;class W{constructor(){s(this,X,new F.Notifier)}get changeEvent(){return t(this,X)}}X=new WeakMap;var m,c,d,I;class z extends W{constructor(e){super();s(this,m,null);s(this,c,null);s(this,d,"offsetHeight");s(this,I,e=>{const n=e.shiftKey?-1:1;let h;e.code==="Space"?h=n*t(this,c)[t(this,d)]*.4:e.code==="ArrowLeft"?h=-1*t(this,c)[t(this,d)]*.2:e.code==="ArrowRight"?h=1*t(this,c)[t(this,d)]*.2:e.code==="ArrowUp"?h=-1*t(this,c)[t(this,d)]*.2:e.code==="ArrowDown"?h=1*t(this,c)[t(this,d)]*.2:e.code==="PageUp"?h=-1*t(this,c)[t(this,d)]:e.code==="PageDown"?h=1*t(this,c)[t(this,d)]:e.code==="Home"?h=0:e.code==="End"&&(h=t(this,d)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),h&&(e.stopPropagation(),this.changeEvent.notify("keyboard",h))});f.isBrowser&&(i(this,m,e!=null&&e.element&&S.getElement(e.element)||window),i(this,c,t(this,m)instanceof HTMLElement?t(this,m):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,d,e==="width"?"offsetWidth":"offsetHeight")}connect(){f.isBrowser&&t(this,m).addEventListener("keydown",t(this,I))}disconnect(){f.isBrowser&&t(this,m).removeEventListener("keydown",t(this,I))}}m=new WeakMap,c=new WeakMap,d=new WeakMap,I=new WeakMap;var o,g,T,q,u,L,M,D,k;class V extends W{constructor(e){super();s(this,o,void 0);s(this,g,void 0);s(this,T,void 0);s(this,q,void 0);s(this,u,void 0);s(this,L,void 0);s(this,M,void 0);s(this,D,void 0);s(this,k,void 0);this.direction=1,i(this,u,!1),i(this,M,n=>{t(this,u)||this.changeEvent.notify("autoplay",n.timeBetweenFrames*t(this,o)*this.direction)}),i(this,D,()=>{t(this,u)||this.changeEvent.notify("autoplay",Math.sign(t(this,o))*this.direction)}),i(this,k,()=>{t(this,g)&&(document.hidden?i(this,u,!0):i(this,u,!1))}),i(this,o,(e==null?void 0:e.speed)||1),i(this,g,(e==null?void 0:e.interval)||!1),i(this,T,e)}set interval(e){i(this,g,e),this.connect()}set speed(e){i(this,o,e),this.connect()}connect(){this.disconnect(),t(this,g)?i(this,q,setInterval(t(this,D),Math.abs(t(this,o)))):v.ticker.subscribe(t(this,M),t(this,T)),document.addEventListener("visibilitychange",t(this,k))}disconnect(){clearInterval(t(this,q)),v.ticker.unsubscribe(t(this,M)),clearInterval(t(this,L)),i(this,u,!1),document.removeEventListener("visibilitychange",t(this,k))}pauseAndContinue(e){e&&!t(this,u)&&(clearInterval(t(this,L)),i(this,u,!0),i(this,L,setTimeout(()=>{i(this,u,!1)},3e3)))}}o=new WeakMap,g=new WeakMap,T=new WeakMap,q=new WeakMap,u=new WeakMap,L=new WeakMap,M=new WeakMap,D=new WeakMap,k=new WeakMap;var C,y,B,H;class G extends W{constructor(e){super();s(this,C,null);s(this,y,void 0);s(this,B,void 0);s(this,H,e=>{let n=0;if(e.preventDefault(),!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*.5||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*.5))if(n=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const h=Date.now();if(h-t(this,B)>40&&(n=100*Math.sign(n)),i(this,B,h),Math.abs(n)<100||t(this,y))return;this.changeEvent.notify("wheel",n),i(this,y,setTimeout(()=>{i(this,y,void 0)},80))}else this.changeEvent.notify("wheel",n)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,B,Date.now()),f.isBrowser&&i(this,C,e!=null&&e.element&&S.getElement(e.element)||window)}connect(){f.isBrowser&&t(this,C).addEventListener("wheel",t(this,H),{passive:!1})}disconnect(){f.isBrowser&&(t(this,C).removeEventListener("wheel",t(this,H)),clearTimeout(t(this,y)))}}C=new WeakMap,y=new WeakMap,B=new WeakMap,H=new WeakMap;var E,w,A,l,P,x;const b=class b extends W{constructor(e){super();s(this,w,null);s(this,A,!1);s(this,l,0);s(this,P,e=>{if(e.composedPath().find(h=>h instanceof HTMLElement&&h.hasAttribute("drag-dead-zone")))return;this.swipe||v.ticker.unsubscribe(t(this,x));let n=e;i(this,l,0),document.documentElement.classList.add("grabbing"),N.setupDrag(h=>{if(t(this,A)||t(b,E)&&t(b,E)!==t(this,w))return;this.swipe&&i(this,A,!0);const Y=n.x-h.x,K=n.y-h.y;this.axis==="x"?i(this,l,Y):i(this,l,K),n=h,(this.axis==="x"&&Math.abs(Y)>Math.abs(K)||this.axis==="y"&&Math.abs(K)>Math.abs(Y))&&(i(b,E,t(this,w)),this.changeEvent.notify("drag",t(this,l)))},()=>{i(b,E,null),this.swipe||(i(this,l,t(this,l)*3),v.ticker.subscribe(t(this,x),{order:j.TICK_ORDER.SCROLL-1})),document.documentElement.classList.remove("grabbing"),i(this,A,!1)})});s(this,x,()=>{Math.floor(t(this,l))||v.ticker.unsubscribe(t(this,x)),i(this,l,t(this,l)*.95),i(this,l,U.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l))});this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,f.isBrowser&&i(this,w,e!=null&&e.element&&S.getElement(e.element)||document.documentElement)}connect(){f.isBrowser&&t(this,w).addEventListener("pointerdown",t(this,P))}disconnect(){f.isBrowser&&(t(this,w).removeEventListener("pointerdown",t(this,P)),v.ticker.unsubscribe(t(this,x)))}};E=new WeakMap,w=new WeakMap,A=new WeakMap,l=new WeakMap,P=new WeakMap,x=new WeakMap,s(b,E,null);let R=b;exports.AutoplayControls=V;exports.Controls=W;exports.DragControls=R;exports.KeyboardControls=z;exports.WheelControls=G;
@@ -1,193 +1,202 @@
1
- var F = (a, r, e) => {
1
+ var N = (a, r, e) => {
2
2
  if (!r.has(a))
3
3
  throw TypeError("Cannot " + e);
4
4
  };
5
- var t = (a, r, e) => (F(a, r, "read from private field"), e ? e.call(a) : r.get(a)), i = (a, r, e) => {
5
+ var t = (a, r, e) => (N(a, r, "read from private field"), e ? e.call(a) : r.get(a)), s = (a, r, e) => {
6
6
  if (r.has(a))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
8
  r instanceof WeakSet ? r.add(a) : r.set(a, e);
9
- }, s = (a, r, e, n) => (F(a, r, "write to private field"), n ? n.call(a, e) : r.set(a, e), e);
10
- import { Notifier as O } from "../notifier/index.js";
9
+ }, i = (a, r, e, n) => (N(a, r, "write to private field"), n ? n.call(a, e) : r.set(a, e), e);
10
+ import { Notifier as S } from "../notifier/index.js";
11
11
  import { i as m } from "../browser-0zX67oeU.js";
12
- import { g as B } from "../dom-0S_WDL4g.js";
13
- import { ticker as y } from "../ticker/index.js";
14
- import { s as S } from "../gestures-D2Fdra_G.js";
15
- import { p as U } from "../number-Bo5RdrA1.js";
16
- import { TICK_ORDER as z } from "../order/index.js";
17
- var Y;
18
- class R {
12
+ import { g as F } from "../dom-0S_WDL4g.js";
13
+ import { ticker as x } from "../ticker/index.js";
14
+ import { s as U } from "../gestures-D2Fdra_G.js";
15
+ import { p as z } from "../number-Bo5RdrA1.js";
16
+ import { TICK_ORDER as V } from "../order/index.js";
17
+ var R;
18
+ class W {
19
19
  constructor() {
20
- i(this, Y, new O());
20
+ s(this, R, new S());
21
21
  }
22
22
  get changeEvent() {
23
- return t(this, Y);
23
+ return t(this, R);
24
24
  }
25
25
  }
26
- Y = new WeakMap();
27
- var u, d, c, C;
28
- class _ extends R {
26
+ R = new WeakMap();
27
+ var u, d, c, T;
28
+ class p extends W {
29
29
  constructor(e) {
30
30
  super();
31
- i(this, u, null);
32
- i(this, d, null);
33
- i(this, c, "offsetHeight");
34
- i(this, C, (e) => {
31
+ s(this, u, null);
32
+ s(this, d, null);
33
+ s(this, c, "offsetHeight");
34
+ s(this, T, (e) => {
35
35
  const n = e.shiftKey ? -1 : 1;
36
36
  let h;
37
37
  e.code === "Space" ? h = n * t(this, d)[t(this, c)] * 0.4 : e.code === "ArrowLeft" ? h = -1 * t(this, d)[t(this, c)] * 0.2 : e.code === "ArrowRight" ? h = 1 * t(this, d)[t(this, c)] * 0.2 : e.code === "ArrowUp" ? h = -1 * t(this, d)[t(this, c)] * 0.2 : e.code === "ArrowDown" ? h = 1 * t(this, d)[t(this, c)] * 0.2 : e.code === "PageUp" ? h = -1 * t(this, d)[t(this, c)] : e.code === "PageDown" ? h = 1 * t(this, d)[t(this, c)] : e.code === "Home" ? h = 0 : e.code === "End" && (h = t(this, c) === "offsetWidth" ? t(this, d).scrollWidth : t(this, d).scrollHeight), h && (e.stopPropagation(), this.changeEvent.notify("keyboard", h));
38
38
  });
39
- m && (s(this, u, e != null && e.element && B(e.element) || window), s(this, d, t(this, u) instanceof HTMLElement ? t(this, u) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
39
+ m && (i(this, u, e != null && e.element && F(e.element) || window), i(this, d, t(this, u) instanceof HTMLElement ? t(this, u) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
40
40
  }
41
41
  set dimension(e) {
42
- s(this, c, e === "width" ? "offsetWidth" : "offsetHeight");
42
+ i(this, c, e === "width" ? "offsetWidth" : "offsetHeight");
43
43
  }
44
44
  connect() {
45
45
  m && t(this, u).addEventListener(
46
46
  "keydown",
47
- t(this, C)
47
+ t(this, T)
48
48
  );
49
49
  }
50
50
  disconnect() {
51
51
  m && t(this, u).removeEventListener(
52
52
  "keydown",
53
- t(this, C)
53
+ t(this, T)
54
54
  );
55
55
  }
56
56
  }
57
- u = new WeakMap(), d = new WeakMap(), c = new WeakMap(), C = new WeakMap();
58
- var w, v, T, D, f, L, M, H;
59
- class p extends R {
57
+ u = new WeakMap(), d = new WeakMap(), c = new WeakMap(), T = new WeakMap();
58
+ var b, g, D, H, f, L, M, P, k;
59
+ class ee extends W {
60
60
  constructor(e) {
61
61
  super();
62
- i(this, w, void 0);
63
- i(this, v, void 0);
64
- i(this, T, void 0);
65
- i(this, D, void 0);
66
- i(this, f, void 0);
67
- i(this, L, void 0);
68
- i(this, M, void 0);
69
- i(this, H, void 0);
70
- this.direction = 1, s(this, f, !1), s(this, M, (n) => {
62
+ s(this, b, void 0);
63
+ s(this, g, void 0);
64
+ s(this, D, void 0);
65
+ s(this, H, void 0);
66
+ s(this, f, void 0);
67
+ s(this, L, void 0);
68
+ s(this, M, void 0);
69
+ s(this, P, void 0);
70
+ s(this, k, void 0);
71
+ this.direction = 1, i(this, f, !1), i(this, M, (n) => {
71
72
  t(this, f) || this.changeEvent.notify(
72
73
  "autoplay",
73
- n.timeBetweenFrames * t(this, w) * this.direction
74
+ n.timeBetweenFrames * t(this, b) * this.direction
74
75
  );
75
- }), s(this, H, () => {
76
+ }), i(this, P, () => {
76
77
  t(this, f) || this.changeEvent.notify(
77
78
  "autoplay",
78
- Math.sign(t(this, w)) * this.direction
79
+ Math.sign(t(this, b)) * this.direction
79
80
  );
80
- }), s(this, w, (e == null ? void 0 : e.speed) || 1), s(this, v, (e == null ? void 0 : e.interval) || !1), s(this, T, e);
81
+ }), i(this, k, () => {
82
+ t(this, g) && (document.hidden ? i(this, f, !0) : i(this, f, !1));
83
+ }), i(this, b, (e == null ? void 0 : e.speed) || 1), i(this, g, (e == null ? void 0 : e.interval) || !1), i(this, D, e);
81
84
  }
82
85
  set interval(e) {
83
- s(this, v, e), this.connect();
86
+ i(this, g, e), this.connect();
84
87
  }
85
88
  set speed(e) {
86
- s(this, w, e), this.connect();
89
+ i(this, b, e), this.connect();
87
90
  }
88
91
  connect() {
89
- this.disconnect(), t(this, v) ? s(this, D, setInterval(
90
- t(this, H),
91
- Math.abs(t(this, w))
92
- )) : y.subscribe(t(this, M), t(this, T));
92
+ this.disconnect(), t(this, g) ? i(this, H, setInterval(
93
+ t(this, P),
94
+ Math.abs(t(this, b))
95
+ )) : x.subscribe(t(this, M), t(this, D)), document.addEventListener(
96
+ "visibilitychange",
97
+ t(this, k)
98
+ );
93
99
  }
94
100
  disconnect() {
95
- clearInterval(t(this, D)), y.unsubscribe(t(this, M)), clearInterval(t(this, L)), s(this, f, !1);
101
+ clearInterval(t(this, H)), x.unsubscribe(t(this, M)), clearInterval(t(this, L)), i(this, f, !1), document.removeEventListener(
102
+ "visibilitychange",
103
+ t(this, k)
104
+ );
96
105
  }
97
106
  pauseAndContinue(e) {
98
- e && !t(this, f) && (clearInterval(t(this, L)), s(this, f, !0), s(this, L, setTimeout(() => {
99
- s(this, f, !1);
107
+ e && !t(this, f) && (clearInterval(t(this, L)), i(this, f, !0), i(this, L, setTimeout(() => {
108
+ i(this, f, !1);
100
109
  }, 3e3)));
101
110
  }
102
111
  }
103
- w = new WeakMap(), v = new WeakMap(), T = new WeakMap(), D = new WeakMap(), f = new WeakMap(), L = new WeakMap(), M = new WeakMap(), H = new WeakMap();
104
- var k, g, I, P;
105
- class ee extends R {
112
+ b = new WeakMap(), g = new WeakMap(), D = new WeakMap(), H = new WeakMap(), f = new WeakMap(), L = new WeakMap(), M = new WeakMap(), P = new WeakMap(), k = new WeakMap();
113
+ var C, E, I, X;
114
+ class te extends W {
106
115
  constructor(e) {
107
116
  super();
108
- i(this, k, null);
109
- i(this, g, void 0);
110
- i(this, I, void 0);
111
- i(this, P, (e) => {
117
+ s(this, C, null);
118
+ s(this, E, void 0);
119
+ s(this, I, void 0);
120
+ s(this, X, (e) => {
112
121
  let n = 0;
113
122
  if (e.preventDefault(), !(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) * 0.5 || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY) * 0.5))
114
123
  if (n = (this.axis === "max" ? Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
115
124
  const h = Date.now();
116
- if (h - t(this, I) > 40 && (n = 100 * Math.sign(n)), s(this, I, h), Math.abs(n) < 100 || t(this, g))
125
+ if (h - t(this, I) > 40 && (n = 100 * Math.sign(n)), i(this, I, h), Math.abs(n) < 100 || t(this, E))
117
126
  return;
118
- this.changeEvent.notify("wheel", n), s(this, g, setTimeout(() => {
119
- s(this, g, void 0);
127
+ this.changeEvent.notify("wheel", n), i(this, E, setTimeout(() => {
128
+ i(this, E, void 0);
120
129
  }, 80));
121
130
  } else
122
131
  this.changeEvent.notify("wheel", n);
123
132
  });
124
- this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, s(this, I, Date.now()), m && s(this, k, e != null && e.element && B(e.element) || window);
133
+ this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, I, Date.now()), m && i(this, C, e != null && e.element && F(e.element) || window);
125
134
  }
126
135
  connect() {
127
- m && t(this, k).addEventListener(
136
+ m && t(this, C).addEventListener(
128
137
  "wheel",
129
- t(this, P),
138
+ t(this, X),
130
139
  {
131
140
  passive: !1
132
141
  }
133
142
  );
134
143
  }
135
144
  disconnect() {
136
- m && (t(this, k).removeEventListener(
145
+ m && (t(this, C).removeEventListener(
137
146
  "wheel",
138
- t(this, P)
139
- ), clearTimeout(t(this, g)));
147
+ t(this, X)
148
+ ), clearTimeout(t(this, E)));
140
149
  }
141
150
  }
142
- k = new WeakMap(), g = new WeakMap(), I = new WeakMap(), P = new WeakMap();
143
- var E, b, A, l, X, x;
144
- const o = class o extends R {
151
+ C = new WeakMap(), E = new WeakMap(), I = new WeakMap(), X = new WeakMap();
152
+ var y, w, A, l, Y, v;
153
+ const o = class o extends W {
145
154
  constructor(e) {
146
155
  super();
147
- i(this, b, null);
148
- i(this, A, !1);
149
- i(this, l, 0);
150
- i(this, X, (e) => {
156
+ s(this, w, null);
157
+ s(this, A, !1);
158
+ s(this, l, 0);
159
+ s(this, Y, (e) => {
151
160
  if (e.composedPath().find(
152
161
  (h) => h instanceof HTMLElement && h.hasAttribute("drag-dead-zone")
153
162
  ))
154
163
  return;
155
- this.swipe || y.unsubscribe(t(this, x));
164
+ this.swipe || x.unsubscribe(t(this, v));
156
165
  let n = e;
157
- s(this, l, 0), document.documentElement.classList.add("grabbing"), S(
166
+ i(this, l, 0), document.documentElement.classList.add("grabbing"), U(
158
167
  (h) => {
159
- if (t(this, A) || t(o, E) && t(o, E) !== t(this, b))
168
+ if (t(this, A) || t(o, y) && t(o, y) !== t(this, w))
160
169
  return;
161
- this.swipe && s(this, A, !0);
162
- const W = n.x - h.x, K = n.y - h.y;
163
- this.axis === "x" ? s(this, l, W) : s(this, l, K), n = h, (this.axis === "x" && Math.abs(W) > Math.abs(K) || this.axis === "y" && Math.abs(K) > Math.abs(W)) && (s(o, E, t(this, b)), this.changeEvent.notify("drag", t(this, l)));
170
+ this.swipe && i(this, A, !0);
171
+ const K = n.x - h.x, B = n.y - h.y;
172
+ this.axis === "x" ? i(this, l, K) : i(this, l, B), n = h, (this.axis === "x" && Math.abs(K) > Math.abs(B) || this.axis === "y" && Math.abs(B) > Math.abs(K)) && (i(o, y, t(this, w)), this.changeEvent.notify("drag", t(this, l)));
164
173
  },
165
174
  () => {
166
- s(o, E, null), this.swipe || (s(this, l, t(this, l) * 3), y.subscribe(t(this, x), { order: z.SCROLL - 1 })), document.documentElement.classList.remove("grabbing"), s(this, A, !1);
175
+ i(o, y, null), this.swipe || (i(this, l, t(this, l) * 3), x.subscribe(t(this, v), { order: V.SCROLL - 1 })), document.documentElement.classList.remove("grabbing"), i(this, A, !1);
167
176
  }
168
177
  );
169
178
  });
170
- i(this, x, () => {
171
- Math.floor(t(this, l)) || y.unsubscribe(t(this, x)), s(this, l, t(this, l) * 0.95), s(this, l, U(t(this, l), 3)), this.changeEvent.notify("drag", t(this, l));
179
+ s(this, v, () => {
180
+ Math.floor(t(this, l)) || x.unsubscribe(t(this, v)), i(this, l, t(this, l) * 0.95), i(this, l, z(t(this, l), 3)), this.changeEvent.notify("drag", t(this, l));
172
181
  });
173
- this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, m && s(this, b, e != null && e.element && B(e.element) || document.documentElement);
182
+ this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, m && i(this, w, e != null && e.element && F(e.element) || document.documentElement);
174
183
  }
175
184
  connect() {
176
- m && t(this, b).addEventListener("pointerdown", t(this, X));
185
+ m && t(this, w).addEventListener("pointerdown", t(this, Y));
177
186
  }
178
187
  disconnect() {
179
- m && (t(this, b).removeEventListener(
188
+ m && (t(this, w).removeEventListener(
180
189
  "pointerdown",
181
- t(this, X)
182
- ), y.unsubscribe(t(this, x)));
190
+ t(this, Y)
191
+ ), x.unsubscribe(t(this, v)));
183
192
  }
184
193
  };
185
- E = new WeakMap(), b = new WeakMap(), A = new WeakMap(), l = new WeakMap(), X = new WeakMap(), x = new WeakMap(), i(o, E, null);
186
- let N = o;
194
+ y = new WeakMap(), w = new WeakMap(), A = new WeakMap(), l = new WeakMap(), Y = new WeakMap(), v = new WeakMap(), s(o, y, null);
195
+ let O = o;
187
196
  export {
188
- p as AutoplayControls,
189
- R as Controls,
190
- N as DragControls,
191
- _ as KeyboardControls,
192
- ee as WheelControls
197
+ ee as AutoplayControls,
198
+ W as Controls,
199
+ O as DragControls,
200
+ p as KeyboardControls,
201
+ te as WheelControls
193
202
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.5.27",
3
+ "version": "0.5.28",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"