aptechka 0.44.0 → 0.44.1
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.
- package/lib/Animation-D1lL_XhF.cjs +1 -0
- package/lib/Animation-Je56LXXj.js +106 -0
- package/lib/{Damped-DxylD27S.js → Damped-BMmEn7PH.js} +4 -3
- package/lib/Damped-BbJjFOLH.cjs +1 -0
- package/lib/{Store-Cm3LPXlx.js → Store-D2xCXENW.js} +1 -1
- package/lib/Store-DRp_K37w.cjs +1 -0
- package/lib/{Tweened-p5hYr6lL.js → Tweened-BNCj14Jz.js} +4 -3
- package/lib/Tweened-Dk1UNPSH.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +2 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +2 -2
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +11 -11
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +12 -11
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +3 -3
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +7 -6
- package/lib/custom-scrollbar/index.cjs +1 -1
- package/lib/custom-scrollbar/index.js +13 -12
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +7 -6
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +2 -2
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +1 -1
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +9 -8
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +6 -5
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +5 -4
- package/lib/index-Cqw2NKev.cjs +1 -0
- package/lib/index-euf5anj6.js +64 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +4 -61
- package/lib/{jss-CjccJC-K.js → jss-BQSxj7Ls.js} +1 -1
- package/lib/jss-B_mh4mIw.cjs +1 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +35 -34
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +1 -1
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +10 -9
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +17 -16
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +7 -6
- package/lib/morph/MorphAnnouncer.d.ts +0 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +57 -57
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +260 -260
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +34 -33
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +25 -25
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +3 -3
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +278 -278
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +57 -56
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +6 -6
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +12 -11
- package/lib/slicer/SlicerElement.d.ts +2 -2
- package/lib/slicer/index.cjs +2 -2
- package/lib/slicer/index.js +10 -9
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +2 -2
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +13 -12
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +1 -1
- package/lib/url-CLvdjbII.cjs +1 -0
- package/lib/{url-D0bFvcuq.js → url-CfcHdBT6.js} +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +163 -148
- package/lib/utils/timeouts.d.ts +5 -0
- package/lib/utils/url.d.ts +5 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +7 -6
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +1 -1
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +13 -12
- package/package.json +1 -1
- package/lib/Animation-CMiBKrwE.cjs +0 -1
- package/lib/Animation-DPRlQfW2.js +0 -105
- package/lib/Damped-CHZ314Rn.cjs +0 -1
- package/lib/Store-C2J4Q87x.cjs +0 -1
- package/lib/Tweened-Dn6CMA-p.cjs +0 -1
- package/lib/browser-0zX67oeU.js +0 -4
- package/lib/browser-CpzFX2xg.cjs +0 -1
- package/lib/jss-GJLvaNfT.cjs +0 -1
- package/lib/url-Bn9ZrvT3.cjs +0 -1
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var
|
|
1
|
+
"use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var M=i=>{throw TypeError(i)};var _=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,T=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&_(i,t,s[t]);if(D)for(var t of D(s))G.call(s,t)&&_(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||M("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?M("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,m)=>(k(i,s,"write to private field"),m?m.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-DRp_K37w.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),B=require("../math-GDWEqu7y.cjs"),J=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const R=require("../Damped-BbJjFOLH.cjs"),H=require("../element-resizer/index.cjs"),j=require("../window-resizer/index.cjs"),P=require("../css-property/index.cjs");var o,a,u,p,y,l,b,x,f,w,C,d;class O{constructor(s){n(this,o);n(this,a);n(this,u);n(this,p);n(this,y);n(this,l);n(this,b,0);n(this,x,0);n(this,f,s=>{e(this,p).set(1)});n(this,w,s=>{e(this,p).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),m={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,y)){const z=q.screenToCartesian(h,m);h.x=z.x,h.y=z.y}if(e(this,l)){const z=q.normalize(h,m);h.x=B.clamp(z.x*2,-1,1),h.y=B.clamp(z.y*2,-1,1)}e(this,a).set(h.x),e(this,u).set(h.y)});n(this,d,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,m=0,h=0;e(this,y)?e(this,l)?(s=-1,t=1,m=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,m=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,l)?(s=0,t=1,m=0,h=1):(s=0,t=e(this,b),m=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,u).min=m,e(this,u).max=h});c(this,o,I.getElement(s.element)),c(this,a,new R.Damped(0,s.damped)),c(this,u,new R.Damped(0,s.damped)),c(this,p,new R.Damped(0,T({min:0,max:1},s.damped))),c(this,y,s.cartesian||!1),c(this,l,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,a)}get y(){return e(this,u)}get z(){return e(this,p)}get cartesian(){return e(this,y)}set cartesian(s){c(this,y,s),e(this,d).call(this)}get normalize(){return e(this,l)}set normalize(s){c(this,l,s),e(this,d).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),H.elementResizer.subscribe(e(this,o),e(this,d)),j.windowResizer.subscribe(e(this,d))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),H.elementResizer.unsubscribe(e(this,d)),j.windowResizer.unsubscribe(e(this,d)),e(this,a).reset(),e(this,u).reset(),e(this,p).reset()}}o=new WeakMap,a=new WeakMap,u=new WeakMap,p=new WeakMap,y=new WeakMap,l=new WeakMap,b=new WeakMap,x=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,d=new WeakMap;var r,g,v,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,g,new P.CSSProperty(this,"--damping",20));n(this,v,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,g).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,v).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,g).observe(),e(this,v).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,g=new WeakMap,v=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;J.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
|
package/lib/pointer/index.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
var q = Object.defineProperty;
|
|
2
2
|
var k = Object.getOwnPropertySymbols;
|
|
3
3
|
var A = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var
|
|
4
|
+
var D = (i) => {
|
|
5
5
|
throw TypeError(i);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var B = (i, s, e) => s in i ? q(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, H = (i, s) => {
|
|
8
8
|
for (var e in s || (s = {}))
|
|
9
|
-
A.call(s, e) &&
|
|
9
|
+
A.call(s, e) && B(i, e, s[e]);
|
|
10
10
|
if (k)
|
|
11
11
|
for (var e of k(s))
|
|
12
|
-
F.call(s, e) &&
|
|
12
|
+
F.call(s, e) && B(i, e, s[e]);
|
|
13
13
|
return i;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (i, s, e) => (
|
|
17
|
-
import "../Store-
|
|
15
|
+
var M = (i, s, e) => s.has(i) || D("Cannot " + e);
|
|
16
|
+
var t = (i, s, e) => (M(i, s, "read from private field"), e ? e.call(i) : s.get(i)), n = (i, s, e) => s.has(i) ? D("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), m = (i, s, e, c) => (M(i, s, "write to private field"), c ? c.call(i, e) : s.set(i, e), e);
|
|
17
|
+
import "../Store-D2xCXENW.js";
|
|
18
18
|
import { g as G, s as I, n as J } from "../coordinates-CgdGoSYs.js";
|
|
19
19
|
import { g as K } from "../dom-CVWzyXPH.js";
|
|
20
|
-
import { c as
|
|
20
|
+
import { c as T } from "../math-BOBiC4TN.js";
|
|
21
|
+
import { i as N } from "../index-euf5anj6.js";
|
|
21
22
|
import "../ticker/index.js";
|
|
22
|
-
import { D as R } from "../Damped-
|
|
23
|
+
import { D as R } from "../Damped-BMmEn7PH.js";
|
|
23
24
|
import { elementResizer as W } from "../element-resizer/index.js";
|
|
24
25
|
import { windowResizer as j } from "../window-resizer/index.js";
|
|
25
26
|
import { CSSProperty as P } from "../css-property/index.js";
|
|
26
|
-
var o, a, l, y, b,
|
|
27
|
-
class
|
|
27
|
+
var o, a, l, y, b, p, d, f, S, w, E, u;
|
|
28
|
+
class O {
|
|
28
29
|
constructor(s) {
|
|
29
30
|
n(this, o);
|
|
30
31
|
n(this, a);
|
|
31
32
|
n(this, l);
|
|
32
33
|
n(this, y);
|
|
33
34
|
n(this, b);
|
|
34
|
-
n(this,
|
|
35
|
+
n(this, p);
|
|
35
36
|
n(this, d, 0);
|
|
36
37
|
n(this, f, 0);
|
|
37
38
|
n(this, S, (s) => {
|
|
@@ -41,7 +42,7 @@ class N {
|
|
|
41
42
|
t(this, y).set(0);
|
|
42
43
|
});
|
|
43
44
|
n(this, E, (s) => {
|
|
44
|
-
const e = G(s, t(this, o).getBoundingClientRect()),
|
|
45
|
+
const e = G(s, t(this, o).getBoundingClientRect()), c = {
|
|
45
46
|
width: t(this, d),
|
|
46
47
|
height: t(this, f)
|
|
47
48
|
}, h = {
|
|
@@ -49,21 +50,21 @@ class N {
|
|
|
49
50
|
y: e.y
|
|
50
51
|
};
|
|
51
52
|
if (t(this, b)) {
|
|
52
|
-
const z = I(h,
|
|
53
|
+
const z = I(h, c);
|
|
53
54
|
h.x = z.x, h.y = z.y;
|
|
54
55
|
}
|
|
55
|
-
if (t(this,
|
|
56
|
-
const z = J(h,
|
|
57
|
-
h.x =
|
|
56
|
+
if (t(this, p)) {
|
|
57
|
+
const z = J(h, c);
|
|
58
|
+
h.x = T(z.x * 2, -1, 1), h.y = T(z.y * 2, -1, 1);
|
|
58
59
|
}
|
|
59
60
|
t(this, a).set(h.x), t(this, l).set(h.y);
|
|
60
61
|
});
|
|
61
|
-
n(this,
|
|
62
|
-
|
|
63
|
-
let s = 0, e = 0,
|
|
64
|
-
t(this, b) ? t(this,
|
|
62
|
+
n(this, u, () => {
|
|
63
|
+
m(this, d, this.element.clientWidth), m(this, f, this.element.clientHeight);
|
|
64
|
+
let s = 0, e = 0, c = 0, h = 0;
|
|
65
|
+
t(this, b) ? t(this, p) ? (s = -1, e = 1, c = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, c = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, p) ? (s = 0, e = 1, c = 0, h = 1) : (s = 0, e = t(this, d), c = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = c, t(this, l).max = h;
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
m(this, o, K(s.element)), m(this, a, new R(0, s.damped)), m(this, l, new R(0, s.damped)), m(this, y, new R(0, H({ min: 0, max: 1 }, s.damped))), m(this, b, s.cartesian || !1), m(this, p, s.normalize || !1);
|
|
67
68
|
}
|
|
68
69
|
get element() {
|
|
69
70
|
return t(this, o);
|
|
@@ -81,16 +82,16 @@ class N {
|
|
|
81
82
|
return t(this, b);
|
|
82
83
|
}
|
|
83
84
|
set cartesian(s) {
|
|
84
|
-
|
|
85
|
+
m(this, b, s), t(this, u).call(this);
|
|
85
86
|
}
|
|
86
87
|
get normalize() {
|
|
87
|
-
return t(this,
|
|
88
|
+
return t(this, p);
|
|
88
89
|
}
|
|
89
90
|
set normalize(s) {
|
|
90
|
-
|
|
91
|
+
m(this, p, s), t(this, u).call(this);
|
|
91
92
|
}
|
|
92
93
|
connect() {
|
|
93
|
-
t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), W.subscribe(t(this, o), t(this,
|
|
94
|
+
t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), W.subscribe(t(this, o), t(this, u)), j.subscribe(t(this, u));
|
|
94
95
|
}
|
|
95
96
|
disconnect() {
|
|
96
97
|
t(this, o).removeEventListener(
|
|
@@ -99,12 +100,12 @@ class N {
|
|
|
99
100
|
), t(this, o).removeEventListener(
|
|
100
101
|
"pointerleave",
|
|
101
102
|
t(this, w)
|
|
102
|
-
), t(this, o).removeEventListener("pointermove", t(this, E)), W.unsubscribe(t(this,
|
|
103
|
+
), t(this, o).removeEventListener("pointermove", t(this, E)), W.unsubscribe(t(this, u)), j.unsubscribe(t(this, u)), t(this, a).reset(), t(this, l).reset(), t(this, y).reset();
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
|
-
o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), y = new WeakMap(), b = new WeakMap(),
|
|
106
|
+
o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), y = new WeakMap(), b = new WeakMap(), p = new WeakMap(), d = new WeakMap(), f = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), u = new WeakMap();
|
|
106
107
|
var r, g, v, x, L, C;
|
|
107
|
-
class
|
|
108
|
+
class Q extends HTMLElement {
|
|
108
109
|
constructor() {
|
|
109
110
|
super();
|
|
110
111
|
n(this, r);
|
|
@@ -113,7 +114,7 @@ class O extends HTMLElement {
|
|
|
113
114
|
n(this, x, new P(this, "--stiffness", 0));
|
|
114
115
|
n(this, L, new P(this, "--cartesian", !1));
|
|
115
116
|
n(this, C, new P(this, "--normalize", !1));
|
|
116
|
-
|
|
117
|
+
m(this, r, new O({
|
|
117
118
|
element: this
|
|
118
119
|
})), t(this, g).subscribe((e) => {
|
|
119
120
|
t(this, r).x.damping = e.current, t(this, r).y.damping = e.current, t(this, r).z.damping = e.current;
|
|
@@ -144,8 +145,8 @@ class O extends HTMLElement {
|
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
147
|
r = new WeakMap(), g = new WeakMap(), v = new WeakMap(), x = new WeakMap(), L = new WeakMap(), C = new WeakMap();
|
|
147
|
-
customElements.get("e-pointer")
|
|
148
|
+
N && !customElements.get("e-pointer") && customElements.define("e-pointer", Q);
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
O as Pointer,
|
|
151
|
+
Q as PointerElement
|
|
151
152
|
};
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var G=n=>{throw TypeError(n)};var N=(n,c,t)=>c.has(n)||G("Cannot "+t);var e=(n,c,t)=>(N(n,c,"read from private field"),t?t.call(n):c.get(n)),s=(n,c,t)=>c.has(n)?G("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(n):c.set(n,t),i=(n,c,t,h)=>(N(n,c,"write to private field"),h?h.call(n,t):c.set(n,t),t),v=(n,c,t)=>(N(n,c,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../css-property/index.cjs"),Y=require("../Store-DRp_K37w.cjs"),U=require("../index-Cqw2NKev.cjs"),B=require("../events-KVanG9sR.cjs"),Z=require("../function-MthRj-GJ.cjs"),ee=require("../style-At6aDoqG.cjs"),J=require("../url-CLvdjbII.cjs"),K=require("../window-resizer/index.cjs");var C,d,O,w,u,m,p,g,f,y,b,S,l,Q,T,I,A,W,k,_,R,x,D;const a=class a extends HTMLElement{constructor(){super(...arguments);s(this,l);s(this,C);s(this,d);s(this,O);s(this,w);s(this,u);s(this,m);s(this,p);s(this,g);s(this,f);s(this,y);s(this,b);s(this,S);s(this,T);s(this,A);s(this,k);s(this,_);s(this,R);s(this,x);this.urlValue="",i(this,C,-1),i(this,d,new Y.Store(!1)),i(this,u,new E.CSSProperty(this,"--history",!1)),i(this,m,new E.CSSProperty(this,"--restore",!1)),i(this,p,new E.CSSProperty(this,"--dominance",0)),i(this,g,new E.CSSProperty(this,"--group","")),i(this,f,new E.CSSProperty(this,"--click-outside",!1)),i(this,y,new E.CSSProperty(this,"--escape",!1)),i(this,b,!1),this.open=t=>{if(e(this,d).current)return;i(this,S,t==null?void 0:t.trigger),e(this,p).current&&(a.__opened=a.__opened.filter(o=>o!==this&&v(this,l,D).call(this,this,o)?(o.close(),!1):!0)),a.__opened.push(this),i(this,C,a.__opened.length-1),clearTimeout(e(this,O)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",B.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,S)}}),e(this,u).current&&e(this,b)&&history.pushState(history.state,"",e(this,l,Q)),e(this,d).current=!0;const h=()=>{addEventListener("click",e(this,T)),addEventListener("keydown",e(this,A)),e(this,x).call(this),this.style.opacity="1",this.classList.add("opened"),B.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,S)}}),i(this,w,void 0),this.setAttribute("aria-hidden","false")};t!=null&&t.skipTransition?h():i(this,w,setTimeout(h,10))},this.close=()=>{e(this,d).current&&(removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),e(this,d).current=!1,a.__opened=a.__opened.filter(t=>t===this?!1:!e(t,w)&&v(this,l,D).call(this,this,t)?(t.close(),!1):!0),v(this,l,I).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.setAttribute("aria-hidden","true"),this.style.opacity="0",B.dispatchEvent(this,"popoverClosing",{custom:!0}),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",B.dispatchEvent(this,"popoverClosed",{custom:!0})},ee.getElementTransitionDurationMS(this)+10))},i(this,T,t=>{e(this,f).current&&v(this,l,W).call(this,()=>{var j;const h=t.composedPath();if(h.find(F=>F instanceof HTMLElement&&F.hasAttribute("data-popover-content")))return;const o=h[0],z=o instanceof Node&&(this.contains(o)||((j=this.shadowRoot)==null?void 0:j.contains(o))),P=o instanceof HTMLElement&&o.hasAttribute("data-outside");(!z||P)&&this.close()})}),i(this,A,t=>{e(this,y).current&&v(this,l,W).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,k,()=>{i(this,b,!1),e(this,d).current&&e(this,u).current&&!location.search.includes(this.id)?this.close():!e(this,d).current&&e(this,u).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),i(this,b,!0)}),i(this,_,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,R).call(this)}),i(this,R,Z.debounce(()=>{e(this,x).call(this)},10)),i(this,x,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,u)}get restore(){return e(this,m)}get dominance(){return e(this,p)}get group(){return e(this,g)}get clickOutside(){return e(this,f)}get escape(){return e(this,y)}get opened(){return e(this,d)}get lastTrigger(){return e(this,S)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,d).current&&J.updateSearchParameter(this.id,t)}connectedCallback(){e(this,u).observe(),e(this,m).observe(),e(this,p).observe(),e(this,g).observe(),e(this,f).observe(),e(this,y).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("role","dialog"),this.setAttribute("aria-hidden","true"),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,k)),setTimeout(()=>{e(this,m).current?(this.urlValue=J.parseSearchParameters(location.search)[this.id],e(this,k).call(this)):(v(this,l,I).call(this),i(this,b,!0))},0),K.windowResizer.subscribe(e(this,_))}disconnectedCallback(){K.windowResizer.unsubscribe(e(this,_)),e(this,u).close(),e(this,m).close(),e(this,p).close(),e(this,g).close(),e(this,f).close(),e(this,y).close(),this.style.opacity="",this.style.display="",this.removeAttribute("role"),this.removeAttribute("aria-hidden"),a.__opened=a.__opened.filter(t=>t!==this),clearTimeout(e(this,O)),clearTimeout(e(this,w)),removeEventListener("popstate",e(this,k)),removeEventListener("click",e(this,T)),removeEventListener("keydown",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),v(this,l,I).call(this)}};C=new WeakMap,d=new WeakMap,O=new WeakMap,w=new WeakMap,u=new WeakMap,m=new WeakMap,p=new WeakMap,g=new WeakMap,f=new WeakMap,y=new WeakMap,b=new WeakMap,S=new WeakMap,l=new WeakSet,Q=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},T=new WeakMap,I=function(){if(e(this,u).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},A=new WeakMap,W=function(t){(a.__opened[e(this,C)-1]||a.__opened.length===1||a.__opened.filter(h=>h!==this).every(h=>e(this,p).current>h.dominance.current))&&t()},k=new WeakMap,_=new WeakMap,R=new WeakMap,x=new WeakMap,D=function(t,h){if(e(t,g).current===e(h,g).current&&t.dominance.current>=h.dominance.current)return!0},a.__opened=[];let q=a;U.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",q);var r,L,V,M,$,H;class X extends HTMLElement{constructor(){super();s(this,r);s(this,L,new E.CSSProperty(this,"--type","open"));s(this,V,()=>{this.classList.add("triggered")});s(this,M,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});s(this,$,()=>{this.classList.remove("opened")});s(this,H,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});U.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=e(this,L).current;t==="open"||t==="toggle"&&!e(this,r).opened.current?e(this,r).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,r).opened.current)&&e(this,r).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,L)}get popoverElement(){return e(this,r)}connectedCallback(){var h;e(this,L).subscribe(o=>{e(this,r)instanceof q&&(o.current!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,r).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,r).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let o=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)o=z;else{const P=this.getRootNode();P instanceof ShadowRoot?o=P.host.closest("[popover-target]"):P instanceof HTMLElement&&(o=P.closest("[popover-target]"))}}else t==="sibling"?o=(h=this.parentElement)==null?void 0:h.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(i(this,r,o),e(this,r).addEventListener("popoverTriggered",e(this,V)),e(this,r).addEventListener("popoverOpened",e(this,M)),e(this,r).addEventListener("popoverClosing",e(this,$)),e(this,r).addEventListener("popoverClosed",e(this,H))):console.warn(this,`target ${t} not found`)}this.isConnected&&e(this,L).observe()}disconnectedCallback(){e(this,L).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,V)),e(this,r).removeEventListener("popoverOpened",e(this,M)),e(this,r).removeEventListener("popoverClosing",e(this,$)),e(this,r).removeEventListener("popoverClosed",e(this,H)))}}r=new WeakMap,L=new WeakMap,V=new WeakMap,M=new WeakMap,$=new WeakMap,H=new WeakMap;U.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",X);exports.PopoverButtonElement=X;exports.PopoverElement=q;
|
package/lib/popover/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
1
|
+
var G = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var q = (n, a, t) => a.has(n) ||
|
|
5
|
-
var e = (n, a, t) => (q(n, a, "read from private field"), t ? t.call(n) : a.get(n)), s = (n, a, t) => a.has(n) ?
|
|
4
|
+
var q = (n, a, t) => a.has(n) || G("Cannot " + t);
|
|
5
|
+
var e = (n, a, t) => (q(n, a, "read from private field"), t ? t.call(n) : a.get(n)), s = (n, a, t) => a.has(n) ? G("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(n) : a.set(n, t), i = (n, a, t, h) => (q(n, a, "write to private field"), h ? h.call(n, t) : a.set(n, t), t), m = (n, a, t) => (q(n, a, "access private method"), t);
|
|
6
6
|
import { CSSProperty as E } from "../css-property/index.js";
|
|
7
|
-
import { S as
|
|
7
|
+
import { S as Q } from "../Store-D2xCXENW.js";
|
|
8
|
+
import { i as U } from "../index-euf5anj6.js";
|
|
8
9
|
import { d as z } from "../events-CsVF98U6.js";
|
|
9
|
-
import { d as
|
|
10
|
-
import { g as
|
|
11
|
-
import { u as
|
|
12
|
-
import { windowResizer as
|
|
13
|
-
|
|
14
|
-
var x, d, V, T, p, v, u, g, f, y, L, w, l, J, A, N, k, B, S, _, O, P, D;
|
|
10
|
+
import { d as X } from "../function-C10DGppn.js";
|
|
11
|
+
import { g as Y } from "../style-j2TwriJ_.js";
|
|
12
|
+
import { u as Z, p as ee } from "../url-CfcHdBT6.js";
|
|
13
|
+
import { windowResizer as J } from "../window-resizer/index.js";
|
|
14
|
+
var x, d, V, T, p, v, u, g, f, y, L, w, l, K, A, N, k, B, S, _, O, P, D;
|
|
15
15
|
const c = class c extends HTMLElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
@@ -34,7 +34,7 @@ const c = class c extends HTMLElement {
|
|
|
34
34
|
s(this, _);
|
|
35
35
|
s(this, O);
|
|
36
36
|
s(this, P);
|
|
37
|
-
this.urlValue = "", i(this, x, -1), i(this, d, new
|
|
37
|
+
this.urlValue = "", i(this, x, -1), i(this, d, new Q(!1)), i(this, p, new E(this, "--history", !1)), i(this, v, new E(this, "--restore", !1)), i(this, u, new E(this, "--dominance", 0)), i(this, g, new E(this, "--group", "")), i(this, f, new E(this, "--click-outside", !1)), i(this, y, new E(this, "--escape", !1)), i(this, L, !1), this.open = (t) => {
|
|
38
38
|
if (e(this, d).current)
|
|
39
39
|
return;
|
|
40
40
|
i(this, w, t == null ? void 0 : t.trigger), e(this, u).current && (c.__opened = c.__opened.filter((o) => o !== this && m(this, l, D).call(this, this, o) ? (o.close(), !1) : !0)), c.__opened.push(this), i(this, x, c.__opened.length - 1), clearTimeout(e(this, V)), this.classList.remove("closing"), this.classList.add("triggered"), this.style.display = "block", z(this, "popoverTriggered", {
|
|
@@ -42,7 +42,7 @@ const c = class c extends HTMLElement {
|
|
|
42
42
|
detail: {
|
|
43
43
|
trigger: e(this, w)
|
|
44
44
|
}
|
|
45
|
-
}), e(this, p).current && e(this, L) && history.pushState(history.state, "", e(this, l,
|
|
45
|
+
}), e(this, p).current && e(this, L) && history.pushState(history.state, "", e(this, l, K)), e(this, d).current = !0;
|
|
46
46
|
const h = () => {
|
|
47
47
|
addEventListener("click", e(this, A)), addEventListener("keydown", e(this, k)), e(this, P).call(this), this.style.opacity = "1", this.classList.add("opened"), z(this, "popoverOpened", {
|
|
48
48
|
custom: !0,
|
|
@@ -59,16 +59,16 @@ const c = class c extends HTMLElement {
|
|
|
59
59
|
this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", z(this, "popoverClosed", {
|
|
60
60
|
custom: !0
|
|
61
61
|
});
|
|
62
|
-
},
|
|
62
|
+
}, Y(this) + 10));
|
|
63
63
|
}, i(this, A, (t) => {
|
|
64
64
|
e(this, f).current && m(this, l, B).call(this, () => {
|
|
65
|
-
var
|
|
65
|
+
var j;
|
|
66
66
|
const h = t.composedPath();
|
|
67
67
|
if (h.find(
|
|
68
|
-
(
|
|
68
|
+
(F) => F instanceof HTMLElement && F.hasAttribute("data-popover-content")
|
|
69
69
|
))
|
|
70
70
|
return;
|
|
71
|
-
const o = h[0], I = o instanceof Node && (this.contains(o) || ((
|
|
71
|
+
const o = h[0], I = o instanceof Node && (this.contains(o) || ((j = this.shadowRoot) == null ? void 0 : j.contains(o))), C = o instanceof HTMLElement && o.hasAttribute("data-outside");
|
|
72
72
|
(!I || C) && this.close();
|
|
73
73
|
});
|
|
74
74
|
}), i(this, k, (t) => {
|
|
@@ -79,7 +79,7 @@ const c = class c extends HTMLElement {
|
|
|
79
79
|
i(this, L, !1), e(this, d).current && e(this, p).current && !location.search.includes(this.id) ? this.close() : !e(this, d).current && e(this, p).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), i(this, L, !0);
|
|
80
80
|
}), i(this, _, () => {
|
|
81
81
|
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, O).call(this);
|
|
82
|
-
}), i(this, O,
|
|
82
|
+
}), i(this, O, X(() => {
|
|
83
83
|
e(this, P).call(this);
|
|
84
84
|
}, 10)), i(this, P, () => {
|
|
85
85
|
this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px");
|
|
@@ -113,18 +113,18 @@ const c = class c extends HTMLElement {
|
|
|
113
113
|
return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
|
|
114
114
|
}
|
|
115
115
|
updateUrlValue(t) {
|
|
116
|
-
this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, d).current &&
|
|
116
|
+
this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, d).current && Z(this.id, t);
|
|
117
117
|
}
|
|
118
118
|
connectedCallback() {
|
|
119
119
|
e(this, p).observe(), e(this, v).observe(), e(this, u).observe(), e(this, g).observe(), e(this, f).observe(), e(this, y).observe(), this.style.opacity = "0", this.style.display = "none", this.setAttribute("role", "dialog"), this.setAttribute("aria-hidden", "true"), this.classList.remove("closing"), this.classList.remove("closed"), this.classList.remove("triggered"), this.classList.remove("opened"), addEventListener("popstate", e(this, S)), setTimeout(() => {
|
|
120
|
-
e(this, v).current ? (this.urlValue =
|
|
121
|
-
}, 0),
|
|
120
|
+
e(this, v).current ? (this.urlValue = ee(location.search)[this.id], e(this, S).call(this)) : (m(this, l, N).call(this), i(this, L, !0));
|
|
121
|
+
}, 0), J.subscribe(e(this, _));
|
|
122
122
|
}
|
|
123
123
|
disconnectedCallback() {
|
|
124
|
-
|
|
124
|
+
J.unsubscribe(e(this, _)), e(this, p).close(), e(this, v).close(), e(this, u).close(), e(this, g).close(), e(this, f).close(), e(this, y).close(), this.style.opacity = "", this.style.display = "", this.removeAttribute("role"), this.removeAttribute("aria-hidden"), c.__opened = c.__opened.filter((t) => t !== this), clearTimeout(e(this, V)), clearTimeout(e(this, T)), removeEventListener("popstate", e(this, S)), removeEventListener("click", e(this, A)), removeEventListener("keydown", e(this, k)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), m(this, l, N).call(this);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
x = new WeakMap(), d = new WeakMap(), V = new WeakMap(), T = new WeakMap(), p = new WeakMap(), v = new WeakMap(), u = new WeakMap(), g = new WeakMap(), f = new WeakMap(), y = new WeakMap(), L = new WeakMap(), w = new WeakMap(), l = new WeakSet(),
|
|
127
|
+
x = new WeakMap(), d = new WeakMap(), V = new WeakMap(), T = new WeakMap(), p = new WeakMap(), v = new WeakMap(), u = new WeakMap(), g = new WeakMap(), f = new WeakMap(), y = new WeakMap(), L = new WeakMap(), w = new WeakMap(), l = new WeakSet(), K = function() {
|
|
128
128
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
|
|
129
129
|
}, A = new WeakMap(), N = function() {
|
|
130
130
|
if (e(this, p).current) {
|
|
@@ -138,7 +138,7 @@ x = new WeakMap(), d = new WeakMap(), V = new WeakMap(), T = new WeakMap(), p =
|
|
|
138
138
|
return !0;
|
|
139
139
|
}, c.__opened = [];
|
|
140
140
|
let W = c;
|
|
141
|
-
customElements.get("e-popover")
|
|
141
|
+
U && !customElements.get("e-popover") && customElements.define("e-popover", W);
|
|
142
142
|
var r, b, $, H, M, R;
|
|
143
143
|
class te extends HTMLElement {
|
|
144
144
|
constructor() {
|
|
@@ -157,7 +157,7 @@ class te extends HTMLElement {
|
|
|
157
157
|
s(this, R, () => {
|
|
158
158
|
this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false");
|
|
159
159
|
});
|
|
160
|
-
|
|
160
|
+
U && (this.addEventListener("click", () => {
|
|
161
161
|
if (e(this, r)) {
|
|
162
162
|
const t = e(this, b).current;
|
|
163
163
|
t === "open" || t === "toggle" && !e(this, r).opened.current ? e(this, r).open({ trigger: this }) : (t === "close" || t === "toggle" && e(this, r).opened.current) && e(this, r).close();
|
|
@@ -225,7 +225,7 @@ class te extends HTMLElement {
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
r = new WeakMap(), b = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), M = new WeakMap(), R = new WeakMap();
|
|
228
|
-
customElements.get("e-popover-button")
|
|
228
|
+
U && !customElements.get("e-popover-button") && customElements.define("e-popover-button", te);
|
|
229
229
|
export {
|
|
230
230
|
te as PopoverButtonElement,
|
|
231
231
|
W as PopoverElement
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var
|
|
1
|
+
"use strict";var Z=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n),$=n=>{throw TypeError(n)};var K=(n,e,s)=>e.has(n)||$("Cannot "+s);var t=(n,e,s)=>(K(n,e,"read from private field"),s?s.call(n):e.get(n)),r=(n,e,s)=>e.has(n)?$("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,s),a=(n,e,s,i)=>(K(n,e,"write to private field"),i?i.call(n,s):e.set(n,s),s),W=(n,e,s)=>(K(n,e,"access private method"),s);var B=(n,e,s)=>new Promise((i,h)=>{var o=d=>{try{f(s.next(d))}catch(w){h(w)}},c=d=>{try{f(s.throw(d))}catch(w){h(w)}},f=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,c);f((s=s.apply(n,e)).next())});var Y=(n,e,s)=>(e=n[Z("asyncIterator")])?e.call(n):(n=n[Z("iterator")](),e={},s=(i,h)=>(h=n[i])&&(e[i]=o=>new Promise((c,f,d)=>(o=h.call(n,o),d=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:d}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../index-Cqw2NKev.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-CLvdjbII.cjs"),ot=require("../object-CCiXnER2.cjs");var R,O,A,p,m,v,k,L,b,E,M,et;class ct{constructor(e,s){r(this,M);r(this,R);r(this,O);r(this,A);r(this,p);r(this,m);r(this,v);r(this,k);r(this,L,null);r(this,b,[]);r(this,E,[]);a(this,R,e),a(this,O,s),a(this,A,new URLPattern({pathname:t(this,R)})),a(this,p,null),a(this,m,null),a(this,v,!1),a(this,k,null),tt.isBrowser&&a(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,m)}get nest(){return t(this,k)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return B(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(a(this,E,[...t(this,b)]),typeof o.default=="function"&&(a(this,p,o.default),ot.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,M,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),d={pathnameParams:c,searchParams:f};a(this,m,new(t(this,p))(d)),e.appendChild(t(this,m)),a(this,k,t(this,m).querySelector("[data-nest]")||((h=t(this,m).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,m).shadowRoot||t(this,m)),a(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,m))==null||e.remove(),a(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),a(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,m)&&(e=[...t(this,m).querySelectorAll("a")]),(s=t(this,m))!=null&&s.shadowRoot&&(e=[...e,...t(this,m).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,m=new WeakMap,v=new WeakMap,k=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,M=new WeakSet,et=function(){return B(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var S,u,P,U,q,j;class lt{constructor(e,s){r(this,S);r(this,u);r(this,P);r(this,U);r(this,q);r(this,j,e=>{e.preventDefault(),t(this,S).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,u).classList.add("clicked"):t(s,u).classList.remove("clicked")}),t(this,S).navigate(t(this,P),t(this,U))});var o,c;a(this,S,e),a(this,u,s),a(this,P,t(this,u).getAttribute("href")||"/"),a(this,U,t(this,u).getAttribute("data-history-action")||"push"),t(this,u).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);a(this,q,(o=t(this,u).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,u).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,u).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,u).classList.add("current"),t(this,u).classList.add("clicked")):t(this,u).classList.remove("clicked")}destroy(){t(this,u).removeEventListener("click",t(this,j)),t(this,u).classList.remove("current")}}S=new WeakMap,u=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var N,C,g,z,T,y,H,x,_,I,st,D;class ut{constructor(e){r(this,I);r(this,N,null);r(this,C,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y);r(this,H,null);r(this,x,new rt.Notifier);r(this,_,ht.debounce(()=>{const e=s=>s.split("/").length;a(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{var s;(s=e.state)!=null&&s.path&&this.navigate(e.state.path,"none")});tt.isBrowser&&(e!=null&&e.base?a(this,C,F.normalizeBase(e.base)):a(this,C,"/"),a(this,N,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,x).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,_).call(this)}navigate(e,s="push"){return B(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;a(this,y,h);const d=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!d.includes(l)&&l.testPathname(f)),it=d.filter(l=>!l.testPathname(f)),G=d.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){a(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),a(this,H,h),F.changeHistory({action:s,pathname:h,searchParameters:c,hash:o});try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,N),h),a(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,I,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,x).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,{base:t(this,C)})}}N=new WeakMap,C=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,x=new WeakMap,_=new WeakMap,I=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,N).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),a(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
|
package/lib/router/index.js
CHANGED
|
@@ -22,9 +22,9 @@ var I = (a, e, s) => new Promise((i, r) => {
|
|
|
22
22
|
var $ = (a, e, s) => (e = a[X("asyncIterator")]) ? e.call(a) : (a = a[X("iterator")](), e = {}, s = (i, r) => (r = a[i]) && (e[i] = (o) => new Promise((c, f, m) => (o = r.call(a, o), m = o.done, Promise.resolve(o.value).then((w) => c({ value: w, done: m }), f)))), s("next"), s("return"), e);
|
|
23
23
|
import { URLPattern as at } from "urlpattern-polyfill";
|
|
24
24
|
import { Notifier as nt } from "../notifier/index.js";
|
|
25
|
-
import { i as _ } from "../
|
|
25
|
+
import { i as _ } from "../index-euf5anj6.js";
|
|
26
26
|
import { d as ht } from "../function-C10DGppn.js";
|
|
27
|
-
import { n as rt, c as ot, s as ct } from "../url-
|
|
27
|
+
import { n as rt, c as ot, s as ct } from "../url-CfcHdBT6.js";
|
|
28
28
|
import { i as lt } from "../object-D6MVWB4l.js";
|
|
29
29
|
var y, U, A, p, d, L, k, v, E, R, M, tt;
|
|
30
30
|
class ut {
|
|
@@ -243,7 +243,7 @@ class vt {
|
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
normalizePath(e) {
|
|
246
|
-
return ct(e, t(this, z));
|
|
246
|
+
return ct(e, { base: t(this, z) });
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
C = new WeakMap(), z = new WeakMap(), g = new WeakMap(), q = new WeakMap(), H = new WeakMap(), b = new WeakMap(), T = new WeakMap(), B = new WeakMap(), j = new WeakMap(), D = new WeakSet(), et = function() {
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Be=Object.defineProperty;var Pe=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var we=(u,h,e)=>h in u?Be(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&we(u,e,h[e]);if(Pe)for(var e of Pe(h))He.call(h,e)&&we(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),r=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../Store-C2J4Q87x.cjs"),Se=require("../browser-CpzFX2xg.cjs"),Fe=require("../easings-GegIwET5.cjs"),le=require("../events-KVanG9sR.cjs"),ze=require("../jss-GJLvaNfT.cjs"),zt=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../polyfills-BANSrI_m.cjs");require("../ticker/index.cjs");const ce=require("../order/index.cjs"),Ne=require("../Damped-CHZ314Rn.cjs"),Ue=require("../Tweened-Dn6CMA-p.cjs"),oe=require("../controls/index.cjs"),kt=require("../window-resizer/index.cjs"),ft=require("../scroll-entries/index.cjs"),Le=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ge=require("../device/index.cjs"),Jt=require("../element-resizer/index.cjs"),Ze=require("../gestures-DHLrn6Q8.cjs"),Re=require("../dom-JBOkFLTh.cjs"),je=require("../function-MthRj-GJ.cjs"),Ke=require("../scroll-segment/index.cjs");var f,Qt,g,mt,V,J;class Je{constructor(h,e,i){s(this,f);s(this,Qt);s(this,g);s(this,mt,0);s(this,V,0);s(this,J,null);r(this,f,h),r(this,Qt,e),r(this,g,i),ft.scrollEntries.register(t(this,f))}get index(){return t(this,Qt)}get size(){return t(this,mt)}get position(){return t(this,V)}destroy(){ft.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){r(this,mt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?zt.getCumulativeOffsetTop(t(this,f)):zt.getCumulativeOffsetLeft(t(this,f))),r(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,mt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),ft.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,mt)+e,b=ke.clamp(i,n,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,J)!==h&&(t(this,J)&&t(this,f).classList.remove(t(this,J)),h&&t(this,f).classList.add(h),r(this,J,h),le.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,J)},custom:!0}))}}f=new WeakMap,Qt=new WeakMap,g=new WeakMap,mt=new WeakMap,V=new WeakMap,J=new WeakMap;const Qe=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,gt,x,Q,B,_,H,T,X,Y,W,tt,yt,q,v,vt,Ct,Pt,wt,Rt,I,Et,et,D,st,F,it,xt,rt,nt,ht,p,It,l,Xt,Yt,y,m,z,A,ot,M,P,w,Tt,lt,$,N,ct,qt,ut,U,Dt,O,E,o,fe,Kt,Lt,ue,ae,me,ge,k,At,Ie,Mt,te,ye,ve,bt,de,ee;class Zt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,gt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,Q,new S.CSSProperty(this,"--reverse",!1));s(this,B,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,H,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,X,new S.CSSProperty(this,"--tween-easing",!1));s(this,Y,new S.CSSProperty(this,"--tween-duration",!1));s(this,W,new S.CSSProperty(this,"--auto-size",!1));s(this,tt,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,yt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,vt,new S.CSSProperty(this,"--damping",20));s(this,Ct,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,wt,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Rt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,Et,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,et,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,st,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,F,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,it,new S.CSSProperty(this,"--focus-delay",0));s(this,xt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,rt,new S.CSSProperty(this,"--disabled",!1));s(this,nt,new S.CSSProperty(this,"--hibernate",!1));s(this,ht,null);s(this,p,null);s(this,It,null);s(this,l,[]);s(this,Xt,0);s(this,Yt,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,ot,null);s(this,M,null);s(this,P,null);s(this,w,new We.Store(0));s(this,Tt,0);s(this,lt,0);s(this,$,!1);s(this,N,!0);s(this,ct,!0);s(this,qt);s(this,ut);s(this,U,new Ue.Tweened);s(this,Dt,!1);s(this,O,null);s(this,E,!1);s(this,k,()=>{if(t(this,nt).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,w).current;if(r(this,Xt,this.vertical?zt.getCumulativeOffsetTop(this):zt.getCumulativeOffsetLeft(this)),r(this,Yt,this.vertical?zt.getCumulativeOffsetTop(t(this,p)):zt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,W).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,_).current){r(this,m,t(this,y)*t(this,_).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,lt,n.position+n.size+b)}else r(this,lt,t(this,m));if(t(this,T).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});r(this,$,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,$)),t(this,$)?t(this,rt).current||c(this,o,ae).call(this):c(this,o,ue).call(this),t(this,At).call(this)});s(this,At,()=>{if(!t(this,$)||t(this,ct)||t(this,N))return;const e=this.currentScrollValue;if(r(this,Tt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,w).current=c(this,o,de).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;ft.scrollEntries.update(this,t(this,x).current,e)});s(this,Mt,(e,i)=>{t(this,gt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,te).call(this,e,i))});s(this,te,(e,i)=>{if(t(this,B).current){if(t(this,B).current<0&&i>0)return;if(t(this,B).current>0&&i<0)return}if(t(this,ut)||t(this,U).unlistenAnimationFrame(),!t(this,I).current&&t(this,it).current&&(clearInterval(t(this,qt)),r(this,qt,setTimeout(()=>{const n=t(this,l)[c(this,o,de).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,xt).current,easing:Fe.easeInOutExpo}})},t(this,it).current))),!(e.includes("drag")&&!Ge.device.isTouch&&!t(this,wt).current)){if(t(this,T).current&&e!=="drag"){const n=Math.sign(i);if(t(this,l).length){const d={tween:t(this,X).current||t(this,Y).current?{easing:t(this,X).current||"easeInOutCubic",duration:t(this,Y).current||500}:void 0};t(this,Dt)?this.scrollToSection(t(this,w).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,Dt,e==="drag")}});s(this,ee,()=>{r(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Qe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),r(this,ht,document.createElement("div")),t(this,ht).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,It,document.createElement("slot")),t(this,p).appendChild(t(this,It)),t(this,ht).appendChild(t(this,p)),e.appendChild(t(this,ht))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,gt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,Q)}get directionCSSProperty(){return t(this,B)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,H)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,X)}get durationCSSProperty(){return t(this,Y)}get autoSizeCSSProperty(){return t(this,W)}get wheelMaxDeltaCSSProperty(){return t(this,tt)}get dragInertionCSSProperty(){return t(this,yt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,vt)}get massCSSProperty(){return t(this,Ct)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,wt)}get sectionDistanceScaleCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,Et)}get autoplayUserDirectionCSSProperty(){return t(this,et)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,st)}get currentIndexEndOffsetCSSProperty(){return t(this,F)}get focusDelayCSSProperty(){return t(this,it)}get focusDurationCSSProperty(){return t(this,xt)}get disabledCSSProperty(){return t(this,rt)}get hibernatedCSSProperty(){return t(this,nt)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,ht)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Xt)}get contentPosition(){return t(this,Yt)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,z)}get counter(){return t(this,w)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,lt)}get loopDistance(){return t(this,v).current?t(this,lt)+t(this,z):t(this,lt)}get hasOverflow(){return t(this,$)}get overscroll(){return t(this,Tt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,w).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=0;const pe=c(this,o,de).call(this),jt=t(this,l)[pe],Ve=jt?this.targetScrollValue-jt.position:0;t(this,v).current?d===0&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Ve,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,w).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,ut)||(t(this,U).set(t(this,a).current,{equalize:!0}),t(this,U).set(e,xe({},i.tween)),r(this,ut,setTimeout(()=>{r(this,ut,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){ft.scrollEntries.register(this),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ce.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new oe.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,ot,new oe.KeyboardControls({element:this})),t(this,ot).changeEvent.subscribe(t(this,Mt)),r(this,M,new oe.DragControls({element:t(this,p)})),t(this,M).changeEvent.subscribe(t(this,Mt)),r(this,P,new oe.AutoplayControls({culling:this})),t(this,P).changeEvent.subscribe(t(this,te)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,Q).subscribe(()=>{c(this,o,fe).call(this)}),t(this,tt).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,yt).subscribe(e=>{t(this,M).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,H).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Kt).call(this):c(this,o,Lt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,M).swipe=e.current,t(this,P).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,W).subscribe(e=>{t(this,E)&&(t(this,k).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Kt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,Lt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,k).call(this),c(this,o,bt).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,H).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(r(this,Tt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,vt).subscribe(e=>{t(this,a).damping=e.current}),t(this,Ct).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,P).speed=e.current,!t(this,N)&&e.current&&!e.previous?t(this,P).connect():!e.current&&e.previous&&t(this,P).disconnect()}),t(this,et).subscribe(e=>{e.current||(t(this,P).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,bt).call(this)}),t(this,st).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,bt).call(this)}),t(this,F).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,bt).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,w).subscribe(e=>{t(this,l).length&&c(this,o,bt).call(this)}),t(this,U).subscribe(e=>{t(this,U).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,rt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ue).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,ae).call(this))}),t(this,nt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,gt).observe(),t(this,x).observe(),t(this,Q).observe(),t(this,B).observe(),t(this,_).observe(),t(this,H).observe(),t(this,T).observe(),t(this,X).observe(),t(this,Y).observe(),t(this,W).observe(),t(this,tt).observe(),t(this,yt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,vt).observe(),t(this,Ct).observe(),t(this,Pt).observe(),t(this,wt).observe(),t(this,Rt).observe(),t(this,I).observe(),t(this,I).observe(),t(this,Et).observe(),t(this,et).observe(),t(this,D).observe(),t(this,st).observe(),t(this,F).observe(),t(this,it).observe(),t(this,xt).observe(),t(this,rt).observe(),t(this,nt).observe(),kt.windowResizer.subscribe(t(this,ee),ce.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,gt).unobserve(),t(this,x).unobserve(),t(this,Q).unobserve(),t(this,B).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,T).unobserve(),t(this,X).unobserve(),t(this,Y).unobserve(),t(this,W).unobserve(),t(this,tt).unobserve(),t(this,yt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,vt).unobserve(),t(this,Ct).unobserve(),t(this,Pt).unobserve(),t(this,wt).unobserve(),t(this,Rt).unobserve(),t(this,I).unobserve(),t(this,Et).unobserve(),t(this,et).unobserve(),t(this,D).unobserve(),t(this,st).unobserve(),t(this,F).unobserve(),t(this,it).unobserve(),t(this,xt).unobserve(),t(this,rt).unobserve(),t(this,nt).unobserve(),kt.windowResizer.unsubscribe(t(this,ee)),c(this,o,me).call(this)}}a=new WeakMap,gt=new WeakMap,x=new WeakMap,Q=new WeakMap,B=new WeakMap,_=new WeakMap,H=new WeakMap,T=new WeakMap,X=new WeakMap,Y=new WeakMap,W=new WeakMap,tt=new WeakMap,yt=new WeakMap,q=new WeakMap,v=new WeakMap,vt=new WeakMap,Ct=new WeakMap,Pt=new WeakMap,wt=new WeakMap,Rt=new WeakMap,I=new WeakMap,Et=new WeakMap,et=new WeakMap,D=new WeakMap,st=new WeakMap,F=new WeakMap,it=new WeakMap,xt=new WeakMap,rt=new WeakMap,nt=new WeakMap,ht=new WeakMap,p=new WeakMap,It=new WeakMap,l=new WeakMap,Xt=new WeakMap,Yt=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,ot=new WeakMap,M=new WeakMap,P=new WeakMap,w=new WeakMap,Tt=new WeakMap,lt=new WeakMap,$=new WeakMap,N=new WeakMap,ct=new WeakMap,qt=new WeakMap,ut=new WeakMap,U=new WeakMap,Dt=new WeakMap,O=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,Q).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,tt).current?"max":e,t(this,ot).dimension=e==="x"?"width":"height",t(this,M).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Kt=function(){c(this,o,Lt).call(this),t(this,It).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Je(e,i,this))}),t(this,p).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,k).call(this),c(this,o,bt).call(this)},Lt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,w).reset(),t(this,a).reset(),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ue=function(){t(this,N)||(r(this,N,!0),t(this,a).unsubscribe(t(this,At)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,qt)),clearInterval(t(this,ut)),t(this,U).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,ot).disconnect(),t(this,M).disconnect(),t(this,P).disconnect(),t(this,$)||this.sections.forEach(e=>{e.unsetTransform()}))},ae=function(){t(this,N)&&(r(this,N,!1),t(this,a).subscribe(t(this,At)),t(this,A).connect(),t(this,ot).connect(),t(this,M).connect(),t(this,I).current&&t(this,P).connect())},me=function(){t(this,ct)||(r(this,ct,!0),kt.windowResizer.unsubscribe(t(this,k)),Jt.elementResizer.unsubscribe(t(this,k)),c(this,o,ue).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,Lt).call(this):(t(this,w).reset(),t(this,a).reset()),ft.scrollEntries.unregister(this))},ge=function(){t(this,ct)&&(r(this,ct,!1),ft.scrollEntries.register(this),(t(this,v).current||t(this,H).current||t(this,v).current||t(this,W).current||t(this,T).current)&&c(this,o,Kt).call(this),c(this,o,ae).call(this),kt.windowResizer.subscribe(t(this,k),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,At=new WeakMap,Ie=function(e){let i=t(this,w).current;return t(this,v).current?i=$e.loopNumber(e,t(this,l).length):i=ke.clamp(e,0,this.limit),i},Mt=new WeakMap,te=new WeakMap,ye=function(e=1){t(this,et).current&&(t(this,P).direction=e),t(this,I).current&&t(this,P).pauseAndContinue(t(this,Et).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):i}else return t(this,a)[e]},bt=function(){if(t(this,l).length){const e=t(this,w).current+t(this,st).current;if(e===0?r(this,O,"start"):e===this.limit?r(this,O,"end"):r(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,D).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,q).current+t(this,F).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,F).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},de=function(){let e=this.targetScrollValue,i=1/0,n=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,Dt)?C.size*d*-1*.4:0,pe=C.position;const jt=Math.abs(pe+R-e);jt<i&&(i=jt,n=b)}return n},ee=new WeakMap;customElements.get("e-scroll")||customElements.define("e-scroll",Zt);var se;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,se,null)}get scrollElement(){return t(this,se)}connectedCallback(){const e=Re.findParentElement(this,Zt);e instanceof Zt?r(this,se,e):console.error(this,"e-scroll not found")}}se=new WeakMap;var at,L,G,Z,Ot,Vt,dt,Bt,ie,re;class Te extends Ce{constructor(){super();s(this,at,null);s(this,L,null);s(this,G,!1);s(this,Z,0);s(this,Ot,0);s(this,Vt,0);s(this,dt,()=>{r(this,G,this.offsetWidth>this.offsetHeight);const e=t(this,G)?this.offsetWidth:this.offsetHeight;r(this,Z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,Z,Math.max(t(this,Z),30)),t(this,G)?(t(this,L).style.width=t(this,Z)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,Z)+"px"),r(this,Ot,e-t(this,Z)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Bt).call(this)});s(this,Bt,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,G)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}px, 0px)`});s(this,ie,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,re,e=>{document.documentElement.classList.add("grabbing"),Ze.setupDrag(d=>{const b=t(this,G)?d.x:d.y,C=this.scrollElement.distance/t(this,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,G)?e.x:e.y});if(Se.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],r(this,at,document.createElement("slot")),t(this,at).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,at))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,at).assignedElements()[0]||t(this,at).firstElementChild;r(this,L,e),t(this,L).addEventListener("pointerdown",t(this,re)),kt.windowResizer.subscribe(t(this,dt),ce.RESIZE_ORDER.SCROLL),Jt.elementResizer.subscribe(this,t(this,dt)),Jt.elementResizer.subscribe(this.scrollElement,t(this,dt)),this.scrollElement.onScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.subscribe(t(this,ie))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,re)),kt.windowResizer.unsubscribe(t(this,dt)),Jt.elementResizer.unsubscribe(t(this,dt)),this.scrollElement.offScroll(t(this,Bt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,ie))}}at=new WeakMap,L=new WeakMap,G=new WeakMap,Z=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,dt=new WeakMap,Bt=new WeakMap,ie=new WeakMap,re=new WeakMap;customElements.get("e-scrollbar")||customElements.define("e-scrollbar",Te);var _t,Ht,Wt;class qe extends Ce{constructor(){super();s(this,_t,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Ht,new S.CSSProperty(this,"--tween-easing",!1));s(this,Wt,new S.CSSProperty(this,"--tween-duration",0));Se.isBrowser&&this.addEventListener("click",()=>{const e=t(this,_t).current,i=t(this,Ht).current,n=t(this,Wt).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,_t).observe(),t(this,Ht).observe(),t(this,Wt).observe()}disconnectedCallback(){t(this,_t).close(),t(this,Ht).close(),t(this,Wt).close()}}_t=new WeakMap,Ht=new WeakMap,Wt=new WeakMap;var Ft;class De extends qe{constructor(){super(...arguments);s(this,Ft,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,Ft).current,e)}connectedCallback(){super.connectedCallback(),t(this,Ft).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,Ft).close()}}Ft=new WeakMap;customElements.get("e-scroll-set-button")||customElements.define("e-scroll-set-button",De);var j,$t;class Ae extends qe{constructor(){super(...arguments);s(this,j,new S.CSSProperty(this,"--step",1));s(this,$t,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,j).current>0&&this.scrollElement.scrollLine==="end"||t(this,j).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,j).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,j).subscribe(()=>{t(this,$t).call(this)}),t(this,j).observe(),this.scrollElement.addEventListener("scrollLine",t(this,$t)),t(this,$t).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,j).close(),this.removeAttribute("disabled")}}j=new WeakMap,$t=new WeakMap;customElements.get("e-scroll-step-button")||customElements.define("e-scroll-step-button",Ae);var K,St,Nt,ne,he,Ut;class Xe{constructor(h,e,i){s(this,K,null);s(this,St,null);s(this,Nt,null);s(this,ne,null);s(this,he,()=>{t(this,St).scrollToSection(t(this,Nt),{behaviour:t(this,ne)})});s(this,Ut,()=>{t(this,K).classList.toggle("current",t(this,St).counter.current===t(this,Nt))});Se.isBrowser&&(r(this,K,document.createElement("button")),r(this,St,h),r(this,ne,i),r(this,Nt,e),t(this,K).addEventListener("click",t(this,he)),t(this,St).counter.subscribe(t(this,Ut)),t(this,Ut).call(this))}get element(){return t(this,K)}destroy(){t(this,K).removeEventListener("click",t(this,he)),t(this,St).counter.unsubscribe(t(this,Ut)),t(this,K).remove()}}K=new WeakMap,St=new WeakMap,Nt=new WeakMap,ne=new WeakMap,he=new WeakMap,Ut=new WeakMap;var pt,Gt;class Me extends Ce{constructor(){super(...arguments);s(this,pt,[]);s(this,Gt,je.debounce(()=>{t(this,pt).forEach(e=>e.destroy()),r(this,pt,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,pt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Gt)),t(this,Gt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Gt)),t(this,pt).forEach(e=>e.destroy()),r(this,pt,[])}}pt=new WeakMap,Gt=new WeakMap;customElements.get("e-scroll-bullet-buttons")||customElements.define("e-scroll-bullet-buttons",Me);class Oe extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.findParentElement(this,Zt);h instanceof Zt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}customElements.get("e-scroll-segment")||customElements.define("e-scroll-segment",Oe);exports.ScrollBulletButtonsElement=Me;exports.ScrollElement=Zt;exports.ScrollSegmentElement=Oe;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|
|
1
|
+
"use strict";var Ve=Object.defineProperty;var we=Object.getOwnPropertySymbols;var _e=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var Ee=u=>{throw TypeError(u)};var Pe=(u,h,e)=>h in u?Ve(u,h,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[h]=e,xe=(u,h)=>{for(var e in h||(h={}))_e.call(h,e)&&Pe(u,e,h[e]);if(we)for(var e of we(h))He.call(h,e)&&Pe(u,e,h[e]);return u};var be=(u,h,e)=>h.has(u)||Ee("Cannot "+e);var t=(u,h,e)=>(be(u,h,"read from private field"),e?e.call(u):h.get(u)),s=(u,h,e)=>h.has(u)?Ee("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(u):h.set(u,e),r=(u,h,e,i)=>(be(u,h,"write to private field"),i?i.call(u,e):h.set(u,e),e),c=(u,h,e)=>(be(u,h,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const We=require("../Store-DRp_K37w.cjs"),O=require("../index-Cqw2NKev.cjs"),Fe=require("../easings-GegIwET5.cjs"),ce=require("../events-KVanG9sR.cjs"),ze=require("../jss-B_mh4mIw.cjs"),kt=require("../layout-Ctc2p3uz.cjs"),ke=require("../math-GDWEqu7y.cjs"),$e=require("../polyfills-BANSrI_m.cjs");require("../ticker/index.cjs");const ue=require("../order/index.cjs"),Ne=require("../Damped-BbJjFOLH.cjs"),Ue=require("../Tweened-Dk1UNPSH.cjs"),le=require("../controls/index.cjs"),Rt=require("../window-resizer/index.cjs"),mt=require("../scroll-entries/index.cjs"),Le=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),Ge=require("../device/index.cjs"),Qt=require("../element-resizer/index.cjs"),Ze=require("../gestures-DHLrn6Q8.cjs"),Re=require("../dom-JBOkFLTh.cjs"),je=require("../function-MthRj-GJ.cjs"),Ke=require("../scroll-segment/index.cjs");var f,Xt,g,gt,V,Q;class Je{constructor(h,e,i){s(this,f);s(this,Xt);s(this,g);s(this,gt,0);s(this,V,0);s(this,Q,null);r(this,f,h),r(this,Xt,e),r(this,g,i),mt.scrollEntries.register(t(this,f))}get index(){return t(this,Xt)}get size(){return t(this,gt)}get position(){return t(this,V)}destroy(){mt.scrollEntries.unregister(t(this,f)),this.unsetTransform()}unsetTransform(){t(this,f).style.transform="",this.mark(null),this.setSize()}setSize(h){h?(t(this,f).style.setProperty("--size",h+"px"),t(this,g).axisCSSProperty.current==="x"?(t(this,f).style.width=h+"px",t(this,f).style.height=""):(t(this,f).style.height=h+"px",t(this,f).style.width="")):(t(this,f).style.width="",t(this,f).style.height="",t(this,f).style.removeProperty("--size"))}resize(){r(this,gt,t(this,g).vertical?t(this,f).offsetHeight:t(this,f).offsetWidth),r(this,V,t(this,g).vertical?kt.getCumulativeOffsetTop(t(this,f)):kt.getCumulativeOffsetLeft(t(this,f))),r(this,V,t(this,V)-t(this,g).contentPosition)}transform(){let h=0;const e=t(this,g).viewportSize*t(this,g).sectionDistanceScaleCSSProperty.current;t(this,g).loopCSSProperty.current&&t(this,g).overscroll&&t(this,V)+t(this,gt)<t(this,g).currentScrollValue&&(h=t(this,g).distance*-1-t(this,g).gap),mt.scrollEntries.update(t(this,f),t(this,g).axisCSSProperty.current,h);const i=t(this,g).currentScrollValue+h,n=t(this,V)-t(this,g).viewportSize-e,d=t(this,V)+t(this,gt)+e,b=ke.clamp(i,n,d);t(this,g).vertical?t(this,f).style.transform=`translate3d(0px, ${b*-1}px, 0px)`:t(this,f).style.transform=`translate3d(${b*-1}px, 0px, 0px)`}mark(h){t(this,Q)!==h&&(t(this,Q)&&t(this,f).classList.remove(t(this,Q)),h&&t(this,f).classList.add(h),r(this,Q,h),ce.dispatchEvent(t(this,f),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,Q)},custom:!0}))}}f=new WeakMap,Xt=new WeakMap,g=new WeakMap,gt=new WeakMap,V=new WeakMap,Q=new WeakMap;const Qe=ze.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"100%",height:"100%",overflow:"var(--overflow, initial)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var a,yt,x,X,_,H,W,T,Y,tt,F,et,vt,q,v,Ct,wt,Pt,Et,It,I,xt,st,D,it,$,rt,Lt,nt,ht,ot,p,Tt,l,Yt,te,y,m,z,A,lt,B,w,P,qt,ct,N,U,ut,Dt,at,G,At,M,E,o,fe,Jt,zt,ae,de,me,ge,k,Bt,Ie,Mt,ee,ye,ve,ft,Se,se;class jt extends HTMLElement{constructor(){super();s(this,o);s(this,a,null);s(this,yt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,X,new S.CSSProperty(this,"--reverse",!1));s(this,_,new S.CSSProperty(this,"--direction",0));s(this,H,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,W,new S.CSSProperty(this,"--split",!1));s(this,T,new S.CSSProperty(this,"--sectional",!1));s(this,Y,new S.CSSProperty(this,"--tween-easing",!1));s(this,tt,new S.CSSProperty(this,"--tween-duration",!1));s(this,F,new S.CSSProperty(this,"--auto-size",!1));s(this,et,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,vt,new S.CSSProperty(this,"--drag-inertion",1));s(this,q,new S.CSSProperty(this,"--sections-in-view",1));s(this,v,new S.CSSProperty(this,"--loop",!1));s(this,Ct,new S.CSSProperty(this,"--damping",20));s(this,wt,new S.CSSProperty(this,"--mass",0));s(this,Pt,new S.CSSProperty(this,"--stiffness",0));s(this,Et,new S.CSSProperty(this,"--mouse-drag",!1));s(this,It,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,I,new S.CSSProperty(this,"--autoplay",0));s(this,xt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,st,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,D,new S.CSSProperty(this,"--classes",!1));s(this,it,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,$,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,rt,new S.CSSProperty(this,"--focus-delay",0));s(this,Lt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,nt,new S.CSSProperty(this,"--disabled",!1));s(this,ht,new S.CSSProperty(this,"--hibernate",!1));s(this,ot,null);s(this,p,null);s(this,Tt,null);s(this,l,[]);s(this,Yt,0);s(this,te,0);s(this,y,0);s(this,m,0);s(this,z,0);s(this,A,null);s(this,lt,null);s(this,B,null);s(this,w,null);s(this,P,new We.Store(0));s(this,qt,0);s(this,ct,0);s(this,N,!1);s(this,U,!0);s(this,ut,!0);s(this,Dt);s(this,at);s(this,G,new Ue.Tweened);s(this,At,!1);s(this,M,null);s(this,E,!1);s(this,k,()=>{if(t(this,ht).current)return;t(this,a).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,m)||0,i=t(this,P).current;if(r(this,Yt,this.vertical?kt.getCumulativeOffsetTop(this):kt.getCumulativeOffsetLeft(this)),r(this,te,this.vertical?kt.getCumulativeOffsetTop(t(this,p)):kt.getCumulativeOffsetLeft(t(this,p))),r(this,y,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).rowGap)):r(this,z,Le.cssUnitParser.parse(getComputedStyle(t(this,p)).columnGap)),t(this,F).current&&t(this,l).length){const n=t(this,q).current,d=(t(this,y)-t(this,z)*(n-1))/n;t(this,l).forEach(b=>{b.setSize(d)})}else t(this,l).forEach(n=>{n.setSize()});if(t(this,l).forEach(n=>{n.resize()}),t(this,H).current){r(this,m,t(this,y)*t(this,H).current);const n=t(this,m)+t(this,y);this.vertical?(t(this,p).style.width=n+"px",t(this,p).style.height="100%"):(t(this,p).style.height=n+"px",t(this,p).style.width="100%")}else this.vertical?(t(this,p).style.width="100%",t(this,p).style.height="max-content",r(this,m,t(this,p).offsetHeight-t(this,y))):(t(this,p).style.width="max-content",t(this,p).style.height="100%",r(this,m,t(this,p).offsetWidth-t(this,y)));if(!t(this,v).current){const n=getComputedStyle(this),d=this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd);r(this,m,t(this,m)+d),t(this,a).max=t(this,m)}if(t(this,v).current&&t(this,l).length){const n=t(this,l)[t(this,l).length-1],d=n.position+n.size-t(this,y),b=t(this,m)-d;r(this,ct,n.position+n.size+b)}else r(this,ct,t(this,m));if(t(this,T).current&&t(this,l).length){const n=t(this,l)[i];t(this,a).set(n.position,{equalize:!0})}else t(this,a).set(e*t(this,m),{equalize:!0});r(this,N,(this.vertical?t(this,p).offsetHeight:t(this,p).offsetWidth)>t(this,y)),this.classList.toggle("has-overflow",t(this,N)),t(this,N)?t(this,nt).current||c(this,o,de).call(this):c(this,o,ae).call(this),t(this,Bt).call(this)});s(this,Bt,()=>{if(!t(this,N)||t(this,ut)||t(this,U))return;const e=this.currentScrollValue;if(r(this,qt,Math.max(0,e-t(this,m))),t(this,l).length){for(let i=0;i<t(this,l).length;i++)t(this,l)[i].transform();t(this,P).current=c(this,o,Se).call(this)}else this.vertical?t(this,p).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,p).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;mt.scrollEntries.update(this,t(this,x).current,e)});s(this,Mt,(e,i)=>{t(this,yt).current&&(c(this,o,ye).call(this,Math.sign(i)||1),t(this,ee).call(this,e,i))});s(this,ee,(e,i)=>{if(t(this,_).current){if(t(this,_).current<0&&i>0)return;if(t(this,_).current>0&&i<0)return}if(t(this,at)||t(this,G).unlistenAnimationFrame(),!t(this,I).current&&t(this,rt).current&&(clearInterval(t(this,Dt)),r(this,Dt,setTimeout(()=>{const n=t(this,l)[c(this,o,Se).call(this)];n&&this.scrollToSection(n.index,{tween:{duration:t(this,Lt).current,easing:Fe.easeInOutExpo}})},t(this,rt).current))),!(e.includes("drag")&&!Ge.device.isTouch&&!t(this,Et).current)){if(t(this,T).current&&e!=="drag"){const n=Math.sign(i);if(t(this,l).length){const d={tween:t(this,Y).current||t(this,tt).current?{easing:t(this,Y).current||"easeInOutCubic",duration:t(this,tt).current||500}:void 0};t(this,At)?this.scrollToSection(t(this,P).current,d):this.shiftSections(n,d)}else t(this,a).shift(n*t(this,y))}else t(this,a).shift(i);r(this,At,e==="drag")}});s(this,se,()=>{r(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,ge).call(this)});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Qe];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),r(this,ot,document.createElement("div")),t(this,ot).className="content-wrapper",r(this,p,document.createElement("div")),t(this,p).className="content",r(this,Tt,document.createElement("slot")),t(this,p).appendChild(t(this,Tt)),t(this,ot).appendChild(t(this,p)),e.appendChild(t(this,ot))}}get damped(){return t(this,a)}get controlsCSSProperty(){return t(this,yt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,X)}get directionCSSProperty(){return t(this,_)}get pagesCSSProperty(){return t(this,H)}get splitCSSProperty(){return t(this,W)}get sectionalCSSProperty(){return t(this,T)}get easingCSSProperty(){return t(this,Y)}get durationCSSProperty(){return t(this,tt)}get autoSizeCSSProperty(){return t(this,F)}get wheelMaxDeltaCSSProperty(){return t(this,et)}get dragInertionCSSProperty(){return t(this,vt)}get sectionsInViewCSSProperty(){return t(this,q)}get loopCSSProperty(){return t(this,v)}get dampingCSSProperty(){return t(this,Ct)}get massCSSProperty(){return t(this,wt)}get stiffnessCSSProperty(){return t(this,Pt)}get mouseDragCSSProperty(){return t(this,Et)}get sectionDistanceScaleCSSProperty(){return t(this,It)}get autoplayCSSProperty(){return t(this,I)}get autoplayPauseDurationCSSProperty(){return t(this,xt)}get autoplayUserDirectionCSSProperty(){return t(this,st)}get classesCSSProperty(){return t(this,D)}get currentIndexStartOffsetCSSProperty(){return t(this,it)}get currentIndexEndOffsetCSSProperty(){return t(this,$)}get focusDelayCSSProperty(){return t(this,rt)}get focusDurationCSSProperty(){return t(this,Lt)}get disabledCSSProperty(){return t(this,nt)}get hibernatedCSSProperty(){return t(this,ht)}get currentScrollValue(){return c(this,o,ve).call(this,"current")}get targetScrollValue(){return c(this,o,ve).call(this,"target")}get contentWrapperElement(){return t(this,ot)}get contentElement(){return t(this,p)}get sections(){return t(this,l)}get position(){return t(this,Yt)}get contentPosition(){return t(this,te)}get viewportSize(){return t(this,y)}get scrollSize(){return t(this,m)}get gap(){return t(this,z)}get counter(){return t(this,P)}get limit(){return Math.ceil(t(this,l).length-t(this,q).current)}get distance(){return t(this,ct)}get loopDistance(){return t(this,v).current?t(this,ct)+t(this,z):t(this,ct)}get hasOverflow(){return t(this,N)}get overscroll(){return t(this,qt)}get scrollLine(){return t(this,M)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,a).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,a).distance}onScroll(...e){return t(this,a).subscribe(...e)}offScroll(...e){t(this,a).unsubscribe(...e)}range(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress<d?0:this.currentProgress>b?1:(this.currentProgress-d)/(b-d)}curve(e,i,n=0){return Math.sin(this.range(e,i,n)*Math.PI)}visible(e,i,n=0){const d=e-n,b=d+i+n*2;return this.currentProgress>=d&&this.currentProgress<=b}scrollToSection(e,i){if(!t(this,l).length)return;const n=t(this,P).current,d=c(this,o,Ie).call(this,e),b=t(this,l)[n],C=t(this,l)[d];if(b&&C){let R=0;const pe=c(this,o,Se).call(this),Kt=t(this,l)[pe],Oe=Kt?this.targetScrollValue-Kt.position:0;t(this,v).current?d===0&&n===t(this,l).length-1?R=t(this,m)+t(this,y)-b.position+t(this,z):d===t(this,l).length-1&&n===0?R=C.position-(t(this,m)+t(this,y)+t(this,z)):R=C.position-b.position:R=C.position-b.position,this.shiftPosition(R-Oe,i)}}shiftSections(e,i){t(this,l).length&&this.scrollToSection(t(this,P).current+e,i)}setPosition(e,i){c(this,o,ye).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,at)||(t(this,G).set(t(this,a).current,{equalize:!0}),t(this,G).set(e,xe({},i.tween)),r(this,at,setTimeout(()=>{r(this,at,void 0)},i.tween.duration||0))):t(this,a).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,a).target+e,i)}connectedCallback(){mt.scrollEntries.register(this),r(this,a,new Ne.Damped(0,{damping:.01,min:0,order:ue.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),r(this,A,new le.WheelControls({element:t(this,p)})),t(this,A).changeEvent.subscribe(t(this,Mt)),r(this,lt,new le.KeyboardControls({element:this})),t(this,lt).changeEvent.subscribe(t(this,Mt)),r(this,B,new le.DragControls({element:t(this,p)})),t(this,B).changeEvent.subscribe(t(this,Mt)),r(this,w,new le.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,ee)),t(this,x).subscribe(()=>{c(this,o,fe).call(this)}),t(this,X).subscribe(()=>{c(this,o,fe).call(this)}),t(this,et).subscribe(e=>{t(this,A).axis=e.current?"max":t(this,x).current}),t(this,vt).subscribe(e=>{t(this,B).inertion=typeof e.current=="number"?e.current:1}),t(this,H).subscribe(()=>{t(this,E)&&t(this,k).call(this)}),t(this,W).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,Jt).call(this):c(this,o,zt).call(this))}),t(this,T).subscribe(e=>{t(this,A).debounce=e.current,t(this,B).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,zt).call(this))}),t(this,F).subscribe(e=>{t(this,E)&&(t(this,k).call(this),e.current&&!e.previous&&!t(this,l).length?c(this,o,Jt).call(this):!e.current&&e.previous&&t(this,l).length&&c(this,o,zt).call(this))}),t(this,q).subscribe(e=>{t(this,E)&&(t(this,k).call(this),c(this,o,ft).call(this))}),t(this,v).subscribe(e=>{e.current?(t(this,E)&&(t(this,l).length||(t(this,W).current=!0)),t(this,a).max=1/0,t(this,a).min=-1/0):(r(this,qt,0),t(this,a).max=t(this,m),t(this,a).min=0)}),t(this,Ct).subscribe(e=>{t(this,a).damping=e.current}),t(this,wt).subscribe(e=>{t(this,a).mass=e.current}),t(this,Pt).subscribe(e=>{t(this,a).stiffness=e.current}),t(this,I).subscribe(e=>{t(this,w).speed=e.current,!t(this,U)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,st).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,D).subscribe(e=>{t(this,E)&&c(this,o,ft).call(this)}),t(this,it).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,$).subscribe(e=>{t(this,E)&&t(this,D).current&&c(this,o,ft).call(this)}),t(this,a).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,P).subscribe(e=>{t(this,l).length&&c(this,o,ft).call(this)}),t(this,G).subscribe(e=>{t(this,G).isRunning.current&&t(this,a).set(e.current,{equalize:!0})}),t(this,nt).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ae).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,de).call(this))}),t(this,ht).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,me).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,ge).call(this))}),t(this,yt).observe(),t(this,x).observe(),t(this,X).observe(),t(this,_).observe(),t(this,H).observe(),t(this,W).observe(),t(this,T).observe(),t(this,Y).observe(),t(this,tt).observe(),t(this,F).observe(),t(this,et).observe(),t(this,vt).observe(),t(this,q).observe(),t(this,v).observe(),t(this,Ct).observe(),t(this,wt).observe(),t(this,Pt).observe(),t(this,Et).observe(),t(this,It).observe(),t(this,I).observe(),t(this,I).observe(),t(this,xt).observe(),t(this,st).observe(),t(this,D).observe(),t(this,it).observe(),t(this,$).observe(),t(this,rt).observe(),t(this,Lt).observe(),t(this,nt).observe(),t(this,ht).observe(),Rt.windowResizer.subscribe(t(this,se),ue.RESIZE_ORDER.LAST)}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,yt).unobserve(),t(this,x).unobserve(),t(this,X).unobserve(),t(this,_).unobserve(),t(this,H).unobserve(),t(this,W).unobserve(),t(this,T).unobserve(),t(this,Y).unobserve(),t(this,tt).unobserve(),t(this,F).unobserve(),t(this,et).unobserve(),t(this,vt).unobserve(),t(this,q).unobserve(),t(this,v).unobserve(),t(this,Ct).unobserve(),t(this,wt).unobserve(),t(this,Pt).unobserve(),t(this,Et).unobserve(),t(this,It).unobserve(),t(this,I).unobserve(),t(this,xt).unobserve(),t(this,st).unobserve(),t(this,D).unobserve(),t(this,it).unobserve(),t(this,$).unobserve(),t(this,rt).unobserve(),t(this,Lt).unobserve(),t(this,nt).unobserve(),t(this,ht).unobserve(),Rt.windowResizer.unsubscribe(t(this,se)),c(this,o,me).call(this)}}a=new WeakMap,yt=new WeakMap,x=new WeakMap,X=new WeakMap,_=new WeakMap,H=new WeakMap,W=new WeakMap,T=new WeakMap,Y=new WeakMap,tt=new WeakMap,F=new WeakMap,et=new WeakMap,vt=new WeakMap,q=new WeakMap,v=new WeakMap,Ct=new WeakMap,wt=new WeakMap,Pt=new WeakMap,Et=new WeakMap,It=new WeakMap,I=new WeakMap,xt=new WeakMap,st=new WeakMap,D=new WeakMap,it=new WeakMap,$=new WeakMap,rt=new WeakMap,Lt=new WeakMap,nt=new WeakMap,ht=new WeakMap,ot=new WeakMap,p=new WeakMap,Tt=new WeakMap,l=new WeakMap,Yt=new WeakMap,te=new WeakMap,y=new WeakMap,m=new WeakMap,z=new WeakMap,A=new WeakMap,lt=new WeakMap,B=new WeakMap,w=new WeakMap,P=new WeakMap,qt=new WeakMap,ct=new WeakMap,N=new WeakMap,U=new WeakMap,ut=new WeakMap,Dt=new WeakMap,at=new WeakMap,G=new WeakMap,At=new WeakMap,M=new WeakMap,E=new WeakMap,o=new WeakSet,fe=function(){const e=t(this,x).current,i=t(this,X).current?"-reverse":"";t(this,p).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,A).axis=t(this,et).current?"max":e,t(this,lt).dimension=e==="x"?"width":"height",t(this,B).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,k).call(this)},Jt=function(){c(this,o,zt).call(this),t(this,Tt).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&t(this,l).push(new Je(e,i,this))}),t(this,p).style.transform="",ce.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,k).call(this),c(this,o,ft).call(this)},zt=function(){t(this,l).forEach(e=>{e.destroy()}),r(this,l,[]),t(this,P).reset(),t(this,a).reset(),ce.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ae=function(){t(this,U)||(r(this,U,!0),t(this,a).unsubscribe(t(this,Bt)),t(this,a).unlistenAnimationFrame(),clearInterval(t(this,Dt)),clearInterval(t(this,at)),t(this,G).unlistenAnimationFrame(),t(this,A).disconnect(),t(this,lt).disconnect(),t(this,B).disconnect(),t(this,w).disconnect(),t(this,N)||this.sections.forEach(e=>{e.unsetTransform()}))},de=function(){t(this,U)&&(r(this,U,!1),t(this,a).subscribe(t(this,Bt)),t(this,A).connect(),t(this,lt).connect(),t(this,B).connect(),t(this,I).current&&t(this,w).connect())},me=function(){t(this,ut)||(r(this,ut,!0),Rt.windowResizer.unsubscribe(t(this,k)),Qt.elementResizer.unsubscribe(t(this,k)),c(this,o,ae).call(this),t(this,p).style.transform="",t(this,p).style.height="",t(this,p).style.width="",this.classList.remove("has-overflow","start","end"),t(this,l).length?c(this,o,zt).call(this):(t(this,P).reset(),t(this,a).reset()),mt.scrollEntries.unregister(this))},ge=function(){t(this,ut)&&(r(this,ut,!1),mt.scrollEntries.register(this),(t(this,v).current||t(this,W).current||t(this,v).current||t(this,F).current||t(this,T).current)&&c(this,o,Jt).call(this),c(this,o,de).call(this),Rt.windowResizer.subscribe(t(this,k),ue.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,k)))},k=new WeakMap,Bt=new WeakMap,Ie=function(e){let i=t(this,P).current;return t(this,v).current?i=$e.loopNumber(e,t(this,l).length):i=ke.clamp(e,0,this.limit),i},Mt=new WeakMap,ee=new WeakMap,ye=function(e=1){t(this,st).current&&(t(this,w).direction=e),t(this,I).current&&t(this,w).pauseAndContinue(t(this,xt).current,this.sectionalCSSProperty.current)},ve=function(e="current"){if(t(this,v).current&&t(this,l).length){const i=t(this,a)[e]%(t(this,m)+t(this,y)+t(this,z));return i<0?t(this,m)+i+t(this,y)+t(this,z):i}else return t(this,a)[e]},ft=function(){if(t(this,l).length){const e=t(this,P).current+t(this,it).current;if(e===0?r(this,M,"start"):e===this.limit?r(this,M,"end"):r(this,M,null),ce.dispatchEvent(this,"scrollLine",{detail:{line:t(this,M)}}),t(this,D).current){this.classList.remove("end","start"),t(this,M)&&this.classList.add(t(this,M));const i=t(this,q).current+t(this,$).current;t(this,l).forEach((n,d)=>{const b=e-this.limit-1+t(this,$).current,C=e+i,R=this.sections.length-C;d>=e&&d<C||d<=b?n.mark("current"):d>=C&&d<C+R/2||d<=b+i?n.mark("next"):n.mark("previous")})}}},Se=function(){let e=this.targetScrollValue,i=1/0,n=0;const d=t(this,a).direction;for(let b=0;b<t(this,l).length;b++){const C=t(this,l)[b];let R=t(this,At)?C.size*d*-1*.4:0,pe=C.position;const Kt=Math.abs(pe+R-e);Kt<i&&(i=Kt,n=b)}return n},se=new WeakMap;O.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",jt);var ie;class Ce extends HTMLElement{constructor(){super(...arguments);s(this,ie,null)}get scrollElement(){return t(this,ie)}connectedCallback(){const e=Re.findParentElement(this,jt);e instanceof jt?r(this,ie,e):console.error(this,"e-scroll not found")}}ie=new WeakMap;var dt,L,Z,j,Ot,Vt,St,_t,re,ne;class Te extends Ce{constructor(){super();s(this,dt,null);s(this,L,null);s(this,Z,!1);s(this,j,0);s(this,Ot,0);s(this,Vt,0);s(this,St,()=>{r(this,Z,this.offsetWidth>this.offsetHeight);const e=t(this,Z)?this.offsetWidth:this.offsetHeight;r(this,j,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),r(this,j,Math.max(t(this,j),30)),t(this,Z)?(t(this,L).style.width=t(this,j)+"px",t(this,L).style.height="100%"):(t(this,L).style.width="100%",t(this,L).style.height=t(this,j)+"px"),r(this,Ot,e-t(this,j)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,_t).call(this)});s(this,_t,()=>{r(this,Vt,this.scrollElement.currentProgress*t(this,Ot)),t(this,Z)?t(this,L).style.transform=`translate3d(${t(this,Vt)}px, 0px, 0px)`:t(this,L).style.transform=`translate3d(0px, ${t(this,Vt)}px, 0px)`});s(this,re,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,ne,e=>{document.documentElement.classList.add("grabbing"),Ze.setupDrag(d=>{const b=t(this,Z)?d.x:d.y,C=this.scrollElement.distance/t(this,Ot),R=(b-n)*C;this.scrollElement.setPosition(i+R)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,n=t(this,Z)?e.x:e.y});if(O.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[ze.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],r(this,dt,document.createElement("slot")),t(this,dt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,dt))}}get thumbElement(){return t(this,L)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,dt).assignedElements()[0]||t(this,dt).firstElementChild;r(this,L,e),t(this,L).addEventListener("pointerdown",t(this,ne)),Rt.windowResizer.subscribe(t(this,St),ue.RESIZE_ORDER.SCROLL),Qt.elementResizer.subscribe(this,t(this,St)),Qt.elementResizer.subscribe(this.scrollElement,t(this,St)),this.scrollElement.onScroll(t(this,_t)),this.scrollElement.axisCSSProperty.subscribe(t(this,re))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,L).removeEventListener("pointerdown",t(this,ne)),Rt.windowResizer.unsubscribe(t(this,St)),Qt.elementResizer.unsubscribe(t(this,St)),this.scrollElement.offScroll(t(this,_t)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,re))}}dt=new WeakMap,L=new WeakMap,Z=new WeakMap,j=new WeakMap,Ot=new WeakMap,Vt=new WeakMap,St=new WeakMap,_t=new WeakMap,re=new WeakMap,ne=new WeakMap;O.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",Te);var Ht,Wt,Ft;class qe extends Ce{constructor(){super();s(this,Ht,new S.CSSProperty(this,"--behaviour","smooth"));s(this,Wt,new S.CSSProperty(this,"--tween-easing",!1));s(this,Ft,new S.CSSProperty(this,"--tween-duration",0));O.isBrowser&&this.addEventListener("click",()=>{const e=t(this,Ht).current,i=t(this,Wt).current,n=t(this,Ft).current;this.handleClick({behaviour:e,tween:i||n?{easing:i,duration:n}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,Ht).observe(),t(this,Wt).observe(),t(this,Ft).observe()}disconnectedCallback(){t(this,Ht).close(),t(this,Wt).close(),t(this,Ft).close()}}Ht=new WeakMap,Wt=new WeakMap,Ft=new WeakMap;var $t;class De extends qe{constructor(){super(...arguments);s(this,$t,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,$t).current,e)}connectedCallback(){super.connectedCallback(),t(this,$t).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,$t).close()}}$t=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",De);var K,Nt;class Ae extends qe{constructor(){super(...arguments);s(this,K,new S.CSSProperty(this,"--step",1));s(this,Nt,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,K).current>0&&this.scrollElement.scrollLine==="end"||t(this,K).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,K).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,K).subscribe(()=>{t(this,Nt).call(this)}),t(this,K).observe(),this.scrollElement.addEventListener("scrollLine",t(this,Nt)),t(this,Nt).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,K).close(),this.removeAttribute("disabled")}}K=new WeakMap,Nt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",Ae);var J,pt,Ut,he,oe,Gt;class Xe{constructor(h,e,i){s(this,J,null);s(this,pt,null);s(this,Ut,null);s(this,he,null);s(this,oe,()=>{t(this,pt).scrollToSection(t(this,Ut),{behaviour:t(this,he)})});s(this,Gt,()=>{t(this,J).classList.toggle("current",t(this,pt).counter.current===t(this,Ut))});O.isBrowser&&(r(this,J,document.createElement("button")),r(this,pt,h),r(this,he,i),r(this,Ut,e),t(this,J).addEventListener("click",t(this,oe)),t(this,pt).counter.subscribe(t(this,Gt)),t(this,Gt).call(this))}get element(){return t(this,J)}destroy(){t(this,J).removeEventListener("click",t(this,oe)),t(this,pt).counter.unsubscribe(t(this,Gt)),t(this,J).remove()}}J=new WeakMap,pt=new WeakMap,Ut=new WeakMap,he=new WeakMap,oe=new WeakMap,Gt=new WeakMap;var bt,Zt;class Be extends Ce{constructor(){super(...arguments);s(this,bt,[]);s(this,Zt,je.debounce(()=>{t(this,bt).forEach(e=>e.destroy()),r(this,bt,[]);for(let e=0;e<this.scrollElement.sections.length;e++){const i=new Xe(this.scrollElement,e,this.getAttribute("behaviour")||"smooth");this.appendChild(i.element),t(this,bt).push(i)}},0))}connectedCallback(){super.connectedCallback(),this.scrollElement.addEventListener("sectionsChange",t(this,Zt)),t(this,Zt).call(this)}disconnectedCallback(){this.scrollElement.removeEventListener("sectionsChange",t(this,Zt)),t(this,bt).forEach(e=>e.destroy()),r(this,bt,[])}}bt=new WeakMap,Zt=new WeakMap;O.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",Be);class Me extends Ke.ScrollSegmentElement{connectedCallback(){const h=Re.findParentElement(this,jt);h instanceof jt?(this.scrollContainer=h,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries)):console.error(this,"e-scroll not found")}}O.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",Me);exports.ScrollBulletButtonsElement=Be;exports.ScrollElement=jt;exports.ScrollSegmentElement=Me;exports.ScrollSetButtonElement=De;exports.ScrollStepButtonElement=Ae;exports.ScrollbarElement=Te;
|