aptechka 0.1.12 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/lib/Damped-Fy7tHx4d.js +33 -0
  2. package/lib/Damped-mdFs8WSd.cjs +1 -0
  3. package/lib/{WheelControls-CX9WUbBC.js → WheelControls-BN4XGOpG.js} +29 -34
  4. package/lib/WheelControls-Dc1xcVG6.cjs +1 -0
  5. package/lib/animation/Tweened.d.ts +0 -1
  6. package/lib/animation/index.cjs +1 -1
  7. package/lib/animation/index.js +20 -26
  8. package/lib/component/Component.d.ts +7 -3
  9. package/lib/component/hooks/custom-element.d.ts +2 -0
  10. package/lib/component/index.cjs +1 -1
  11. package/lib/component/index.d.ts +2 -1
  12. package/lib/component/index.js +174 -139
  13. package/lib/controls/index.cjs +1 -1
  14. package/lib/controls/index.js +20 -23
  15. package/lib/en3/{test → core}/En3Raycaster.d.ts +1 -1
  16. package/lib/en3/core/en3.d.ts +2 -0
  17. package/lib/en3/index.cjs +7 -7
  18. package/lib/en3/index.d.ts +1 -1
  19. package/lib/en3/index.js +540 -523
  20. package/lib/index-B-ZmkQyB.cjs +9 -0
  21. package/lib/{index-BWTXnG5n.js → index-Dizn7btU.js} +96 -96
  22. package/lib/layout-box/index.cjs +1 -1
  23. package/lib/layout-box/index.d.ts +15 -0
  24. package/lib/layout-box/index.js +102 -93
  25. package/lib/morph/Morph.d.ts +1 -0
  26. package/lib/morph/index.cjs +1 -1
  27. package/lib/morph/index.js +130 -122
  28. package/lib/object-BZELAoVj.cjs +1 -0
  29. package/lib/object-R34VLqhp.js +85 -0
  30. package/lib/order/index.cjs +1 -1
  31. package/lib/order/index.d.ts +1 -0
  32. package/lib/order/index.js +1 -1
  33. package/lib/popover/index.cjs +1 -1
  34. package/lib/popover/index.js +50 -50
  35. package/lib/resized/index.d.ts +11 -0
  36. package/lib/router/index.cjs +1 -1
  37. package/lib/router/index.js +101 -105
  38. package/lib/scroll/index.cjs +1 -1
  39. package/lib/scroll/index.js +2 -2
  40. package/lib/select/index.cjs +1 -1
  41. package/lib/select/index.js +1 -1
  42. package/lib/studio/index.cjs +1 -1
  43. package/lib/studio/index.js +1 -1
  44. package/lib/utils/index.cjs +1 -1
  45. package/lib/utils/index.d.ts +1 -1
  46. package/lib/utils/index.js +15 -14
  47. package/lib/utils/object.d.ts +1 -0
  48. package/package.json +1 -1
  49. package/lib/Damped-BwpMU9Gi.cjs +0 -1
  50. package/lib/Damped-urvryQLo.js +0 -36
  51. package/lib/WheelControls-CfDeGCOU.cjs +0 -1
  52. package/lib/component/hooks/shadow.d.ts +0 -1
  53. package/lib/index-3G1lTMEf.cjs +0 -9
  54. package/lib/object-C1ph624j.cjs +0 -1
  55. package/lib/object-DIPjdukP.js +0 -73
@@ -1,62 +1,62 @@
1
- var K = (i, s, e) => {
2
- if (!s.has(i))
3
- throw TypeError("Cannot " + e);
1
+ var k = (i, e, s) => {
2
+ if (!e.has(i))
3
+ throw TypeError("Cannot " + s);
4
4
  };
5
- var t = (i, s, e) => (K(i, s, "read from private field"), e ? e.call(i) : s.get(i)), h = (i, s, e) => {
6
- if (s.has(i))
5
+ var t = (i, e, s) => (k(i, e, "read from private field"), s ? s.call(i) : e.get(i)), h = (i, e, s) => {
6
+ if (e.has(i))
7
7
  throw TypeError("Cannot add the same private member more than once");
8
- s instanceof WeakSet ? s.add(i) : s.set(i, e);
9
- }, n = (i, s, e, l) => (K(i, s, "write to private field"), l ? l.call(i, e) : s.set(i, e), e);
10
- var L = (i, s, e) => (K(i, s, "access private method"), e);
8
+ e instanceof WeakSet ? e.add(i) : e.set(i, s);
9
+ }, n = (i, e, s, o) => (k(i, e, "write to private field"), o ? o.call(i, s) : e.set(i, s), s);
10
+ var L = (i, e, s) => (k(i, e, "access private method"), s);
11
11
  import { cssUnitParser as lt } from "../css-unit-parser/index.js";
12
- import { Ladder as I } from "../ladder/index.js";
12
+ import { Ladder as K } from "../ladder/index.js";
13
13
  import { TICK_ORDER as G } from "../order/index.js";
14
14
  import { windowResizer as J } from "../window-resizer/index.js";
15
15
  import { scrollEntries as ot } from "../scroll-entries/index.js";
16
16
  import { ticker as N } from "../ticker/index.js";
17
17
  import { i as Q } from "../browser-0zX67oeU.js";
18
18
  import { g as j } from "../dom-BY7JhTx5.js";
19
- import { g as V, a as $ } from "../layout-HoBT_Da2.js";
19
+ import { g as I, a as $ } from "../layout-HoBT_Da2.js";
20
20
  function at(i) {
21
- const s = Math.sqrt(
21
+ const e = Math.sqrt(
22
22
  i.m11 * i.m11 + i.m12 * i.m12 + i.m13 * i.m13
23
- ), e = Math.sqrt(
23
+ ), s = Math.sqrt(
24
24
  i.m21 * i.m21 + i.m22 * i.m22 + i.m23 * i.m23
25
- ), l = Math.sqrt(
25
+ ), o = Math.sqrt(
26
26
  i.m31 * i.m31 + i.m32 * i.m32 + i.m33 * i.m33
27
27
  ), E = Math.atan2(i.m32, i.m33), H = Math.atan2(
28
28
  -i.m31,
29
29
  Math.sqrt(i.m32 * i.m32 + i.m33 * i.m33)
30
- ), k = Math.atan2(i.m21, i.m11), u = i.m41, C = i.m42, b = i.m43;
30
+ ), U = Math.atan2(i.m21, i.m11), u = i.m41, C = i.m42, b = i.m43;
31
31
  return {
32
- scaleX: s,
33
- scaleY: e,
34
- scaleZ: l,
32
+ scaleX: e,
33
+ scaleY: s,
34
+ scaleZ: o,
35
35
  rotationX: E,
36
36
  rotationY: H,
37
- rotationZ: k,
37
+ rotationZ: U,
38
38
  translationX: u,
39
39
  translationY: C,
40
40
  translationZ: b
41
41
  };
42
42
  }
43
- var a, f, m, _, R, O, v, x, T, g, M, P, S, d, w, X, Y, Z, p, z, y, c, r, o, A, F, B, tt, D, st, U, et, W, q;
43
+ var a, p, f, _, R, O, v, x, T, y, M, P, S, d, w, X, Y, Z, m, z, g, c, r, l, A, F, B, tt, V, et, D, st, W, q;
44
44
  class Mt {
45
- constructor(s, e) {
45
+ constructor(e, s) {
46
46
  h(this, A);
47
47
  h(this, B);
48
+ h(this, V);
48
49
  h(this, D);
49
- h(this, U);
50
50
  h(this, a, null);
51
- h(this, f, null);
52
- h(this, m, []);
51
+ h(this, p, null);
52
+ h(this, f, []);
53
53
  h(this, _, "auto");
54
54
  h(this, R, "top");
55
55
  h(this, O, !1);
56
56
  h(this, v, !0);
57
57
  h(this, x, !0);
58
58
  h(this, T, !0);
59
- h(this, g, 0);
59
+ h(this, y, 0);
60
60
  h(this, M, 0);
61
61
  h(this, P, 0);
62
62
  h(this, S, 0);
@@ -65,19 +65,19 @@ class Mt {
65
65
  h(this, X, 0);
66
66
  h(this, Y, 0);
67
67
  h(this, Z, 0);
68
- h(this, p, { x: 0, y: 0, z: 0 });
68
+ h(this, m, { x: 0, y: 0, z: 0 });
69
69
  h(this, z, { x: 0, y: 0, z: 0 });
70
- h(this, y, { x: 1, y: 1, z: 1 });
71
- h(this, c, new I({ x: 0, y: 0, z: 0 }));
72
- h(this, r, new I({ x: 0, y: 0, z: 0 }));
73
- h(this, o, new I({ x: 0, y: 0, z: 0 }));
70
+ h(this, g, { x: 1, y: 1, z: 1 });
71
+ h(this, c, new K({ x: 0, y: 0, z: 0 }));
72
+ h(this, r, new K({ x: 0, y: 0, z: 0 }));
73
+ h(this, l, new K({ x: 0, y: 0, z: 0 }));
74
74
  h(this, W, () => {
75
- Q && L(this, D, st).call(this);
75
+ Q && L(this, V, et).call(this);
76
76
  });
77
77
  h(this, q, () => {
78
- L(this, U, et).call(this), L(this, A, F).call(this);
78
+ L(this, D, st).call(this), L(this, A, F).call(this);
79
79
  });
80
- Q && (n(this, a, j(s) || document.body), n(this, f, j(e == null ? void 0 : e.containerElement) || document.body), n(this, _, (e == null ? void 0 : e.scrollAxis) || "auto"), n(this, R, (e == null ? void 0 : e.frontSide) || "top"), n(this, O, (e == null ? void 0 : e.cartesian) || !1), n(this, v, (e == null ? void 0 : e.sizeStep) !== void 0 ? e.sizeStep : !0), n(this, x, (e == null ? void 0 : e.positionStep) !== void 0 ? e.positionStep : !0), n(this, T, (e == null ? void 0 : e.transformStep) !== void 0 ? e.transformStep : !0), t(this, o).setStep("_size", "+", {
80
+ Q && (n(this, a, j(e) || document.body), n(this, p, j(s == null ? void 0 : s.containerElement) || document.body), n(this, _, (s == null ? void 0 : s.scrollAxis) || "auto"), n(this, R, (s == null ? void 0 : s.frontSide) || "top"), n(this, O, (s == null ? void 0 : s.cartesian) || !1), n(this, v, (s == null ? void 0 : s.sizeStep) !== void 0 ? s.sizeStep : !0), n(this, x, (s == null ? void 0 : s.positionStep) !== void 0 ? s.positionStep : !0), n(this, T, (s == null ? void 0 : s.transformStep) !== void 0 ? s.transformStep : !0), t(this, l).setStep("_size", "+", {
81
81
  x: 1,
82
82
  y: 1,
83
83
  z: 1
@@ -85,7 +85,7 @@ class Mt {
85
85
  x: 0,
86
86
  y: 0,
87
87
  z: 0
88
- }), t(this, o).setStep("_scale", "*", {
88
+ }), t(this, l).setStep("_scale", "*", {
89
89
  x: 1,
90
90
  y: 1,
91
91
  z: 1
@@ -98,19 +98,19 @@ class Mt {
98
98
  y: 0,
99
99
  z: 0
100
100
  }), addEventListener("DOMContentLoaded", () => {
101
- ot.getAll(this.element).forEach((l) => {
102
- this.setScrollStep(() => l);
101
+ ot.getAll(this.element).forEach((o) => {
102
+ this.setScrollStep(() => o);
103
103
  });
104
104
  }), N.subscribe(t(this, q), {
105
105
  order: G.LAYOUT_BOX,
106
- culling: e != null && e.culling ? this.element : void 0
106
+ culling: s != null && s.culling ? this.element : void 0
107
107
  }), J.subscribe(t(this, W), G.LAYOUT_BOX));
108
108
  }
109
109
  get element() {
110
110
  return t(this, a);
111
111
  }
112
112
  get containerElement() {
113
- return t(this, f);
113
+ return t(this, p);
114
114
  }
115
115
  get position() {
116
116
  return t(this, r).current;
@@ -119,7 +119,7 @@ class Mt {
119
119
  return t(this, c).current;
120
120
  }
121
121
  get scale() {
122
- return t(this, o).current;
122
+ return t(this, l).current;
123
123
  }
124
124
  get left() {
125
125
  return t(this, d);
@@ -131,7 +131,7 @@ class Mt {
131
131
  return t(this, w);
132
132
  }
133
133
  get width() {
134
- return t(this, g);
134
+ return t(this, y);
135
135
  }
136
136
  get height() {
137
137
  return t(this, M);
@@ -139,68 +139,77 @@ class Mt {
139
139
  get depth() {
140
140
  return t(this, P);
141
141
  }
142
- bindObject(s) {
143
- s.position && t(this, r).bind(s.position), s.rotation && t(this, c).bind(s.rotation), s.scale && t(this, o).bind(s.scale);
142
+ bindObject(e) {
143
+ e.position && t(this, r).bind(e.position), e.rotation && t(this, c).bind(e.rotation), e.scale && t(this, l).bind(e.scale);
144
144
  }
145
- unbindObject(s) {
146
- s.position && t(this, r).unbind(s.position), s.rotation && t(this, c).unbind(s.rotation), s.scale && t(this, o).unbind(s.scale);
145
+ unbindObject(e) {
146
+ e.position && t(this, r).unbind(e.position), e.rotation && t(this, c).unbind(e.rotation), e.scale && t(this, l).unbind(e.scale);
147
147
  }
148
- setScrollStep(s) {
149
- return t(this, m).includes(s) || t(this, m).push(s), () => this.deleteScrollStep(s);
148
+ setScrollStep(e) {
149
+ return t(this, f).includes(e) || t(this, f).push(e), () => this.deleteScrollStep(e);
150
150
  }
151
- deleteScrollStep(s) {
152
- n(this, m, t(this, m).filter(
153
- (e) => e !== s
151
+ deleteScrollStep(e) {
152
+ n(this, f, t(this, f).filter(
153
+ (s) => s !== e
154
154
  ));
155
155
  }
156
156
  destroy() {
157
- N.unsubscribe(t(this, q)), J.unsubscribe(t(this, W)), t(this, r).close(), t(this, c).close(), t(this, o).close();
157
+ N.unsubscribe(t(this, q)), J.unsubscribe(t(this, W)), t(this, r).close(), t(this, c).close(), t(this, l).close();
158
158
  }
159
- setPositionStep(...s) {
160
- t(this, r).setStep(...s);
159
+ setPositionStep(...e) {
160
+ t(this, r).setStep(...e);
161
161
  }
162
- setRotationStep(...s) {
163
- t(this, c).setStep(...s);
162
+ getPositionStep(...e) {
163
+ return t(this, r).getStepValue(...e);
164
164
  }
165
- setScaleStep(...s) {
166
- t(this, o).setStep(...s);
165
+ setRotationStep(...e) {
166
+ t(this, c).setStep(...e);
167
167
  }
168
- deletePositionStep(...s) {
169
- t(this, r).deleteStep(...s);
168
+ getRotationStep(...e) {
169
+ return t(this, c).getStepValue(...e);
170
170
  }
171
- deleteRotationStep(...s) {
172
- t(this, c).deleteStep(...s);
171
+ setScaleStep(...e) {
172
+ t(this, l).setStep(...e);
173
173
  }
174
- deleteScaleStep(...s) {
175
- t(this, o).deleteStep(...s);
174
+ getScaleStep(...e) {
175
+ return t(this, l).getStepValue(...e);
176
+ }
177
+ deletePositionStep(...e) {
178
+ t(this, r).deleteStep(...e);
179
+ }
180
+ deleteRotationStep(...e) {
181
+ t(this, c).deleteStep(...e);
182
+ }
183
+ deleteScaleStep(...e) {
184
+ t(this, l).deleteStep(...e);
176
185
  }
177
186
  }
178
- a = new WeakMap(), f = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), O = new WeakMap(), v = new WeakMap(), x = new WeakMap(), T = new WeakMap(), g = new WeakMap(), M = new WeakMap(), P = new WeakMap(), S = new WeakMap(), d = new WeakMap(), w = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), Z = new WeakMap(), p = new WeakMap(), z = new WeakMap(), y = new WeakMap(), c = new WeakMap(), r = new WeakMap(), o = new WeakMap(), A = new WeakSet(), F = function() {
179
- t(this, o).calculate(), t(this, r).calculate(), t(this, c).calculate();
187
+ a = new WeakMap(), p = new WeakMap(), f = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), O = new WeakMap(), v = new WeakMap(), x = new WeakMap(), T = new WeakMap(), y = new WeakMap(), M = new WeakMap(), P = new WeakMap(), S = new WeakMap(), d = new WeakMap(), w = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), Z = new WeakMap(), m = new WeakMap(), z = new WeakMap(), g = new WeakMap(), c = new WeakMap(), r = new WeakMap(), l = new WeakMap(), A = new WeakSet(), F = function() {
188
+ t(this, l).calculate(), t(this, r).calculate(), t(this, c).calculate();
180
189
  }, B = new WeakSet(), tt = function() {
181
- t(this, o).setStep("_size", "+", {
182
- x: t(this, v) ? t(this, g) : 1,
190
+ t(this, l).setStep("_size", "+", {
191
+ x: t(this, v) ? t(this, y) : 1,
183
192
  y: t(this, v) ? t(this, M) : 1,
184
193
  z: t(this, v) ? t(this, P) : 1
185
194
  });
186
- const s = t(this, x) ? t(this, X) : 0, e = t(this, x) ? t(this, Y) : 0, l = t(this, x) ? t(this, Z) : 0;
195
+ const e = t(this, x) ? t(this, X) : 0, s = t(this, x) ? t(this, Y) : 0, o = t(this, x) ? t(this, Z) : 0;
187
196
  t(this, r).setStep("_position", "+", {
188
- x: s,
189
- y: e,
190
- z: l
191
- }), t(this, T) ? (t(this, o).setStep("_scale", "*", {
192
- x: t(this, y).x,
193
- y: t(this, y).y,
194
- z: t(this, y).z
197
+ x: e,
198
+ y: s,
199
+ z: o
200
+ }), t(this, T) ? (t(this, l).setStep("_scale", "*", {
201
+ x: t(this, g).x,
202
+ y: t(this, g).y,
203
+ z: t(this, g).z
195
204
  }), t(this, r).setStep("_translation", "+", {
196
- x: t(this, p).x,
197
- y: t(this, p).y,
198
- z: t(this, p).z
205
+ x: t(this, m).x,
206
+ y: t(this, m).y,
207
+ z: t(this, m).z
199
208
  }), t(this, c).setStep("_rotation", "+", {
200
209
  x: t(this, z).x,
201
210
  y: t(this, z).y,
202
211
  z: t(this, z).z
203
- })) : (t(this, o).setStep("_scale", "*", {
212
+ })) : (t(this, l).setStep("_scale", "*", {
204
213
  x: 1,
205
214
  y: 1,
206
215
  z: 1
@@ -213,31 +222,31 @@ a = new WeakMap(), f = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R =
213
222
  y: 0,
214
223
  z: 0
215
224
  }));
216
- }, D = new WeakSet(), st = function() {
217
- const s = getComputedStyle(t(this, a));
218
- n(this, g, Math.max(t(this, a).clientWidth, 1)), n(this, M, Math.max(t(this, a).clientHeight, 1)), n(this, P, Math.max(
219
- lt.parse(s.getPropertyValue("--depth") || "0px"),
225
+ }, V = new WeakSet(), et = function() {
226
+ const e = getComputedStyle(t(this, a));
227
+ n(this, y, Math.max(t(this, a).clientWidth, 1)), n(this, M, Math.max(t(this, a).clientHeight, 1)), n(this, P, Math.max(
228
+ lt.parse(e.getPropertyValue("--depth") || "0px"),
220
229
  1
221
230
  ));
222
- const e = V(t(this, f)), l = $(t(this, f)), E = t(this, f).clientWidth, H = t(this, f).clientHeight;
223
- if (n(this, d, V(t(this, a)) - e), n(this, S, $(t(this, a)) - l), t(this, _) === "z") {
231
+ const s = I(t(this, p)), o = $(t(this, p)), E = t(this, p).clientWidth, H = t(this, p).clientHeight;
232
+ if (n(this, d, I(t(this, a)) - s), n(this, S, $(t(this, a)) - o), t(this, _) === "z") {
224
233
  const C = t(this, d) / E, b = t(this, S) / H;
225
- n(this, d, (C - Math.floor(C)) * E), n(this, S, (b - Math.floor(b)) * H), t(this, R) === "left" ? n(this, w, V(t(this, a)) - e - t(this, d)) : n(this, w, $(t(this, a)) - l - t(this, S));
234
+ n(this, d, (C - Math.floor(C)) * E), n(this, S, (b - Math.floor(b)) * H), t(this, R) === "left" ? n(this, w, I(t(this, a)) - s - t(this, d)) : n(this, w, $(t(this, a)) - o - t(this, S));
226
235
  }
227
236
  if (n(this, d, t(this, d) + t(this, a).clientLeft), n(this, S, t(this, S) + t(this, a).clientTop), t(this, O)) {
228
- const C = Math.round(E / 2), b = Math.round(H / 2), it = t(this, g) ? Math.round(t(this, g) / 2) : 0, ht = t(this, M) ? Math.round(t(this, M) / 2) : 0, nt = t(this, d) - C + it, rt = (t(this, S) - b + ht) * -1;
237
+ const C = Math.round(E / 2), b = Math.round(H / 2), it = t(this, y) ? Math.round(t(this, y) / 2) : 0, ht = t(this, M) ? Math.round(t(this, M) / 2) : 0, nt = t(this, d) - C + it, rt = (t(this, S) - b + ht) * -1;
229
238
  n(this, X, nt), n(this, Y, rt);
230
239
  } else
231
240
  n(this, X, t(this, d)), n(this, Y, t(this, S));
232
241
  n(this, Z, t(this, w) * -1);
233
- const k = new WebKitCSSMatrix(s.transform), u = at(k);
234
- t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this, y).x = u.scaleX, t(this, y).y = u.scaleY, t(this, y).z = u.scaleZ, t(this, z).x = u.rotationX, t(this, z).y = u.rotationY, t(this, z).z = u.rotationZ, L(this, B, tt).call(this), L(this, A, F).call(this);
235
- }, U = new WeakSet(), et = function() {
236
- for (let s = 0; s < t(this, m).length; s++) {
237
- const e = t(this, m)[s]();
238
- let l = e.axis;
239
- t(this, _) !== "auto" && (l = t(this, _)), t(this, r).setStep(`_scroll_${s}`, "+", {
240
- [l]: e.value * (l === "x" ? -1 : t(this, O) ? 1 : -1)
242
+ const U = new WebKitCSSMatrix(e.transform), u = at(U);
243
+ t(this, m).x = u.translationX, t(this, m).y = u.translationY, t(this, m).z = u.translationZ, t(this, g).x = u.scaleX, t(this, g).y = u.scaleY, t(this, g).z = u.scaleZ, t(this, z).x = u.rotationX, t(this, z).y = u.rotationY, t(this, z).z = u.rotationZ, L(this, B, tt).call(this), L(this, A, F).call(this);
244
+ }, D = new WeakSet(), st = function() {
245
+ for (let e = 0; e < t(this, f).length; e++) {
246
+ const s = t(this, f)[e]();
247
+ let o = s.axis;
248
+ t(this, _) !== "auto" && (o = t(this, _)), t(this, r).setStep(`_scroll_${e}`, "+", {
249
+ [o]: s.value * (o === "x" ? -1 : t(this, O) ? 1 : -1)
241
250
  });
242
251
  }
243
252
  }, W = new WeakMap(), q = new WeakMap();
@@ -22,5 +22,6 @@ export declare class Morph {
22
22
  constructor(parameters?: MorphParameters);
23
23
  beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
24
24
  afterNavigationEvent(callback: MorphNavigationCallback): () => void;
25
+ prefetch(pathname: string): Promise<Document>;
25
26
  navigate(pathname: string, historyAction?: MorphHistoryAction): Promise<void>;
26
27
  }
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var U=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var ot=(i,t,e)=>t in i?st(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Y=(i,t,e)=>(ot(i,typeof t!="symbol"?t+"":t,e),e),_=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var s=(i,t,e)=>(_(i,t,"read from private field"),e?e.call(i):t.get(i)),o=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},r=(i,t,e,n)=>(_(i,t,"write to private field"),n?n.call(i,e):t.set(i,e),e);var d=(i,t,e)=>(_(i,t,"access private method"),e);var F=(i,t,e)=>new Promise((n,h)=>{var u=l=>{try{g(e.next(l))}catch(w){h(w)}},E=l=>{try{g(e.throw(l))}catch(w){h(w)}},g=l=>l.done?n(l.value):Promise.resolve(l.value).then(u,E);g((e=e.apply(i,t)).next())});var V=(i,t,e)=>(t=i[U("asyncIterator")])?t.call(i):(i=i[U("iterator")](),t={},e=(n,h)=>(h=i[n])&&(t[n]=u=>new Promise((E,g,l)=>(u=h.call(i,u),l=u.done,Promise.resolve(u.value).then(w=>E({value:w,done:l}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("../notifier/index.cjs"),nt=require("../browser-CpzFX2xg.cjs");var H,f,y,T,N;class rt{constructor(t,e){o(this,H,void 0);o(this,f,void 0);o(this,y,void 0);o(this,T,void 0);o(this,N,t=>{t.preventDefault(),s(this,H).navigate(s(this,y),s(this,T))});r(this,H,e),r(this,f,t),r(this,y,s(this,f).getAttribute("href")||"/"),r(this,T,s(this,f).getAttribute("data-history-action")||"push"),s(this,f).addEventListener("click",s(this,N)),s(this,y)===location.pathname&&s(this,f).classList.add("current")}destroy(){s(this,f).removeEventListener("click",s(this,N)),s(this,f).classList.remove("current")}}H=new WeakMap,f=new WeakMap,y=new WeakMap,T=new WeakMap,N=new WeakMap;var a,P,S,k,C,O,b,v,M,A,x,I,Z,j,$,D,z,q,G,m,p,R,J,B;class ct{constructor(t){o(this,I);o(this,j);o(this,D);o(this,q);o(this,m);o(this,R);o(this,a,null);o(this,P,null);o(this,S,null);o(this,k,null);o(this,C,[]);o(this,O,new DOMParser);o(this,b,new Map);o(this,v,void 0);o(this,M,null);Y(this,"preprocessor");Y(this,"postprocessor");o(this,A,new X.Notifier);o(this,x,new X.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});nt.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,s(this,a)+"/")):r(this,a,"/"),r(this,P,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,S,(t==null?void 0:t.cachePages)!==!1),r(this,k,d(this,q,G).call(this,document)),r(this,M,location.pathname),d(this,D,z).call(this),addEventListener("popstate",s(this,B)))}beforeNavigationEvent(t){return s(this,A).subscribe(t)}afterNavigationEvent(t){return s(this,x).subscribe(t)}navigate(t,e="push"){return F(this,null,function*(){var h;if(t=d(this,j,$).call(this,t),s(this,v)===t||s(this,M)===t)return;r(this,v,t);const n=s(this,b).has(t);try{let u=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var W;(W=this.preprocessor)==null||W.call(this,{pathname:t,resolve:c,reject:L,isCached:n})})}catch(c){c?console.error(c):console.log("Route change canceled"),u=!1}if(s(this,A).notify({pathname:t,isCached:n}),!u||s(this,v)!==t)return;const E=yield d(this,I,Z).call(this,t);if(s(this,S)&&s(this,b).set(t,E),s(this,v)!==t)return;const g=Array.from(document.head.children),l=Array.from(E.head.cloneNode(!0).children),w=d(this,m,p).call(this,g,l),tt=d(this,R,J).call(this,g,w),Q=d(this,R,J).call(this,l,w);tt.forEach(c=>c.remove()),Q.forEach(c=>document.head.appendChild(c));const K=Q.filter(c=>c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK");s(this,P)&&K.length&&(yield new Promise(c=>F(this,null,function*(){let L=0;try{for(var W=V(K),ut,dt,ft;ut=!(dt=yield W.next()).done;ut=!1){const it=dt.value;it.onload=()=>{L++,L===K.length&&c()}}}catch(dt){ft=[dt]}finally{try{ut&&(dt=W.return)&&(yield dt.call(W))}finally{if(ft)throw ft[0]}}})));const et=d(this,q,G).call(this,E);s(this,k).forEach((c,L)=>{const W=et[L];c.innerHTML=W.innerHTML}),r(this,M,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),d(this,D,z).call(this),(h=this.postprocessor)==null||h.call(this,{pathname:t,isCached:n}),s(this,x).notify({pathname:t,isCached:n})}catch(u){console.error(u)}r(this,v,void 0)})}}a=new WeakMap,P=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,M=new WeakMap,A=new WeakMap,x=new WeakMap,I=new WeakSet,Z=function(t){return F(this,null,function*(){const e=s(this,b).get(t);if(e)return e;const h=yield(yield fetch(t)).text();return s(this,O).parseFromString(h,"text/html")})},j=new WeakSet,$=function(t){return t=t.replace(s(this,a),""),t.startsWith("/")&&(t=t.slice(1)),s(this,a)+t},D=new WeakSet,z=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var n;return(n=e.getAttribute("href"))==null?void 0:n.startsWith("/")});s(this,C).forEach(e=>e.destroy()),r(this,C,t.map(e=>new rt(e,this)))},q=new WeakSet,G=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},m=new WeakSet,p=function(t,e){return t.filter(n=>e.find(h=>h.outerHTML===n.outerHTML))},R=new WeakSet,J=function(t,e){return t.filter(n=>!e.find(h=>h.outerHTML===n.outerHTML))},B=new WeakMap;exports.Morph=ct;
1
+ "use strict";var V=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s);var m=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var i=(s,t,e)=>(m(s,t,"read from private field"),e?e.call(s):t.get(s)),n=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},r=(s,t,e,o)=>(m(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);var f=(s,t,e)=>(m(s,t,"access private method"),e);var T=(s,t,e)=>new Promise((o,c)=>{var l=u=>{try{g(e.next(u))}catch(v){c(v)}},y=u=>{try{g(e.throw(u))}catch(v){c(v)}},g=u=>u.done?o(u.value):Promise.resolve(u.value).then(l,y);g((e=e.apply(s,t)).next())});var X=(s,t,e)=>(t=s[V("asyncIterator")])?t.call(s):(s=s[V("iterator")](),t={},e=(o,c)=>(c=s[o])&&(t[o]=l=>new Promise((y,g,u)=>(l=c.call(s,l),u=l.done,Promise.resolve(l.value).then(v=>y({value:v,done:u}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("../notifier/index.cjs"),st=require("../browser-CpzFX2xg.cjs");var M,d,w,N,P,S;class nt{constructor(t,e){n(this,M,void 0);n(this,d,void 0);n(this,w,void 0);n(this,N,void 0);n(this,P,t=>{t.preventDefault(),i(this,M).navigate(i(this,w),i(this,N))});n(this,S,()=>{i(this,M).prefetch(i(this,w))});r(this,M,e),r(this,d,t),r(this,w,i(this,d).getAttribute("href")||"/"),r(this,N,i(this,d).getAttribute("data-history-action")||"push"),i(this,d).addEventListener("click",i(this,P)),i(this,w)===location.pathname&&i(this,d).classList.add("current"),i(this,d).hasAttribute("data-prefetch")&&i(this,d).addEventListener("pointerenter",i(this,S))}destroy(){i(this,d).removeEventListener("click",i(this,P)),i(this,d).removeEventListener("pointerenter",i(this,S)),i(this,d).classList.remove("current")}}M=new WeakMap,d=new WeakMap,w=new WeakMap,N=new WeakMap,P=new WeakMap,S=new WeakMap;var a,k,A,C,x,j,E,L,H,D,q,R,z,B,$,W,G,F,J,K,p,O,Q,Y;class ot{constructor(t){n(this,R);n(this,B);n(this,W);n(this,F);n(this,K);n(this,O);n(this,a,null);n(this,k,null);n(this,A,null);n(this,C,null);n(this,x,[]);n(this,j,new DOMParser);n(this,E,new Map);n(this,L,void 0);n(this,H,null);n(this,D,new Z.Notifier);n(this,q,new Z.Notifier);n(this,Y,t=>{t.state&&this.navigate(t.state,"none")});st.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,i(this,a)+"/")):r(this,a,"/"),r(this,k,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,A,(t==null?void 0:t.cachePages)!==!1),r(this,C,f(this,F,J).call(this,document)),r(this,H,location.pathname),f(this,W,G).call(this),addEventListener("popstate",i(this,Y)))}beforeNavigationEvent(t){return i(this,D).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){return f(this,R,z).call(this,t)})}navigate(t,e="push"){return T(this,null,function*(){var c;if(t=f(this,B,$).call(this,t),i(this,L)===t||i(this,H)===t)return;r(this,L,t);const o=i(this,E).has(t);try{let l=!0;if(this.preprocessor)try{yield new Promise((h,b)=>{var I;(I=this.preprocessor)==null||I.call(this,{pathname:t,resolve:h,reject:b,isCached:o})})}catch(h){h?console.error(h):console.log("Route change canceled"),l=!1}if(i(this,D).notify({pathname:t,isCached:o}),!l||i(this,L)!==t)return;const y=i(this,E).get(t)||(yield f(this,R,z).call(this,t));if(i(this,L)!==t)return;const g=Array.from(document.head.children),u=Array.from(y.head.cloneNode(!0).children),v=f(this,K,p).call(this,g,u),tt=f(this,O,Q).call(this,g,v),U=f(this,O,Q).call(this,u,v);tt.forEach(h=>h.remove()),U.forEach(h=>document.head.appendChild(h));const _=U.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,k)&&_.length&&(yield new Promise(h=>T(this,null,function*(){let b=0;try{for(var I=X(_),ct,lt,ut;ct=!(lt=yield I.next()).done;ct=!1){const it=lt.value;it.onload=()=>{b++,b===_.length&&h()}}}catch(lt){ut=[lt]}finally{try{ct&&(lt=I.return)&&(yield lt.call(I))}finally{if(ut)throw ut[0]}}})));const et=f(this,F,J).call(this,y);i(this,C).forEach((h,b)=>{const I=et[b];h.innerHTML=I.innerHTML}),r(this,H,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),f(this,W,G).call(this),(c=this.postprocessor)==null||c.call(this,{pathname:t,isCached:o}),i(this,q).notify({pathname:t,isCached:o})}catch(l){console.error(l)}r(this,L,void 0)})}}a=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,x=new WeakMap,j=new WeakMap,E=new WeakMap,L=new WeakMap,H=new WeakMap,D=new WeakMap,q=new WeakMap,R=new WeakSet,z=function(t){return T(this,null,function*(){const e=i(this,E).get(t);if(e)return e;const c=yield(yield fetch(t)).text(),l=i(this,j).parseFromString(c,"text/html");return i(this,A)&&i(this,E).set(t,l),l})},B=new WeakSet,$=function(t){return t=t.replace(i(this,a),""),t.startsWith("/")&&(t=t.slice(1)),i(this,a)+t},W=new WeakSet,G=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var o;return(o=e.getAttribute("href"))==null?void 0:o.startsWith("/")});i(this,x).forEach(e=>e.destroy()),r(this,x,t.map(e=>new nt(e,this)))},F=new WeakSet,J=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},K=new WeakSet,p=function(t,e){return t.filter(o=>e.find(c=>c.outerHTML===o.outerHTML))},O=new WeakSet,Q=function(t,e){return t.filter(o=>!e.find(c=>c.outerHTML===o.outerHTML))},Y=new WeakMap;exports.Morph=ot;