@orioncactuscorp/ui 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -72
- package/dist/components/ActionArea/ActionArea.css +1 -1
- package/dist/components/ActionArea/ActionArea.js +1 -0
- package/dist/components/Alert/Alert.js +146 -126
- package/dist/components/Badge/Badge.css +1 -1
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/CheckMark/CheckMark.css +1 -1
- package/dist/components/Checkbox/Checkbox.css +1 -1
- package/dist/components/Modal/Modal.css +1 -1
- package/dist/components/Modal/Modal.js +347 -331
- package/dist/components/Modal/useModalDrag.js +604 -673
- package/dist/components/Radio/Radio.css +1 -1
- package/dist/components/Select/Select.css +1 -1
- package/dist/components/TextArea/TextArea.css +1 -1
- package/dist/components/TextInput/TextInput.css +1 -1
- package/dist/foundations/atomic.css +1 -1
- package/dist/foundations.css +1 -1
- package/dist/react/motion.js +1 -0
- package/dist/react/spring.js +1 -0
- package/dist/styles.css +10 -10
- package/dist/ui/src/components/ActionArea/ActionArea.d.ts.map +1 -1
- package/dist/ui/src/components/Alert/Alert.d.ts +1 -1
- package/dist/ui/src/components/Alert/Alert.d.ts.map +1 -1
- package/dist/ui/src/components/Alert/types.d.ts +2 -0
- package/dist/ui/src/components/Alert/types.d.ts.map +1 -1
- package/dist/ui/src/components/Button/Button.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts +1 -1
- package/dist/ui/src/components/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/index.d.ts +1 -1
- package/dist/ui/src/components/Modal/index.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/types.d.ts +2 -0
- package/dist/ui/src/components/Modal/types.d.ts.map +1 -1
- package/dist/ui/src/components/Modal/useModalDrag.d.ts.map +1 -1
- package/dist/ui/src/index.d.ts +1 -1
- package/dist/ui/src/index.d.ts.map +1 -1
- package/dist/vscode/oc-ui-vars.css +7 -0
- package/package.json +3 -6
- package/src/scss/foundations/atomic.scss +9 -0
- package/src/scss/mixins/_element.scss +67 -7
- package/src/scss/mixins/_element.test.ts +94 -7
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { ocSpring as
|
|
3
|
-
import { resolveOcMotion as
|
|
4
|
-
import { resolveModalPopupSnapPositions as
|
|
5
|
-
import { setModalBodyTouchScrollLock as
|
|
6
|
-
import { createSpringAnimator as
|
|
7
|
-
const
|
|
1
|
+
import { useRef as v, useLayoutEffect as lt, useCallback as d, useEffect as At } from "react";
|
|
2
|
+
import { ocSpring as Pe } from "../../utils/spring.js";
|
|
3
|
+
import { resolveOcMotion as It } from "../../utils/motion.js";
|
|
4
|
+
import { resolveModalPopupSnapPositions as we } from "./snapPoints.js";
|
|
5
|
+
import { setModalBodyTouchScrollLock as Ct, shouldLockModalBodyTouchScroll as Xe, shouldIgnoreDragTarget as Lt, getScrollableAncestor as De, getBottomTouchDragDecision as Se, getPopupTouchDragDecision as Ye } from "./modalScrollArbitration.js";
|
|
6
|
+
import { createSpringAnimator as Ot } from "../../utils/spring/animator.js";
|
|
7
|
+
const M = {
|
|
8
8
|
dragStartThresholdPx: {
|
|
9
9
|
touch: 10,
|
|
10
10
|
mouse: 2
|
|
@@ -30,84 +30,84 @@ const E = {
|
|
|
30
30
|
popupDragFollower: {
|
|
31
31
|
settleDurationScale: 1 / 6
|
|
32
32
|
}
|
|
33
|
-
},
|
|
34
|
-
duration:
|
|
35
|
-
}),
|
|
36
|
-
function
|
|
33
|
+
}, ve = Pe.snappy({
|
|
34
|
+
duration: M.settleSpring.durationSeconds * M.popupDragFollower.settleDurationScale
|
|
35
|
+
}), Me = [], be = [];
|
|
36
|
+
function Zt(r) {
|
|
37
37
|
r.cancelable !== !1 && r.preventDefault();
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function b(r, n, l) {
|
|
40
40
|
return Math.min(Math.max(r, n), l);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function te(r) {
|
|
43
43
|
return [...new Set(r)].sort((n, l) => n - l);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Ee(r, n) {
|
|
46
46
|
return r.reduce(
|
|
47
47
|
(l, o) => Math.abs(o - n) < Math.abs(l - n) ? o : l
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function ee({
|
|
51
51
|
deltaX: r,
|
|
52
52
|
deltaY: n,
|
|
53
53
|
placement: l
|
|
54
54
|
}) {
|
|
55
55
|
return l === "bottom" ? Math.abs(n) : Math.hypot(r, n);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Fe(r, n, l) {
|
|
58
58
|
if (l === "down")
|
|
59
|
-
return r.find((
|
|
60
|
-
for (let
|
|
61
|
-
const g = r[
|
|
59
|
+
return r.find((i) => i > n + 1) ?? r[r.length - 1] ?? 0;
|
|
60
|
+
for (let i = r.length - 1; i >= 0; i -= 1) {
|
|
61
|
+
const g = r[i];
|
|
62
62
|
if (g !== void 0 && g < n - 1)
|
|
63
63
|
return g;
|
|
64
64
|
}
|
|
65
65
|
return r[0] ?? 0;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
67
|
+
function ke(r, n, l, o, i = l) {
|
|
68
|
+
const T = Fe(r, n, o), h = o === "down" ? Math.max(l, i) : Math.min(l, i);
|
|
69
69
|
if (o === "down") {
|
|
70
70
|
if (r.filter(
|
|
71
|
-
(
|
|
72
|
-
).length === 0) return
|
|
71
|
+
(F) => F > n + 1 && F <= l + 1
|
|
72
|
+
).length === 0) return T;
|
|
73
73
|
const $ = r.filter(
|
|
74
|
-
(
|
|
74
|
+
(F) => F > n + 1 && F <= h + 1
|
|
75
75
|
);
|
|
76
|
-
return $[$.length - 1] ??
|
|
76
|
+
return $[$.length - 1] ?? T;
|
|
77
77
|
}
|
|
78
78
|
return r.filter(
|
|
79
|
-
(
|
|
80
|
-
).length === 0 ?
|
|
81
|
-
(
|
|
82
|
-
)[0] ??
|
|
79
|
+
(E) => E < n - 1 && E >= l - 1
|
|
80
|
+
).length === 0 ? T : r.filter(
|
|
81
|
+
(E) => E < n - 1 && E >= h - 1
|
|
82
|
+
)[0] ?? T;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const l = Math.max(n, 1), { resistance: o } =
|
|
84
|
+
function re(r, n) {
|
|
85
|
+
const l = Math.max(n, 1), { resistance: o } = M.rubberBand;
|
|
86
86
|
return r * o * l / (l + o * r);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Nt({
|
|
89
89
|
targetTranslate: r,
|
|
90
90
|
minTranslate: n,
|
|
91
91
|
maxTranslate: l,
|
|
92
92
|
dimension: o
|
|
93
93
|
}) {
|
|
94
|
-
return r < n ? n -
|
|
94
|
+
return r < n ? n - re(n - r, o) : r > l ? l + re(r - l, o) : r;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function ne(r) {
|
|
97
97
|
return typeof Element > "u" || !(r instanceof Element) ? !1 : !!r.closest('[data-oc-part="handle"], [data-oc-part="header"]');
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Ae(r, n) {
|
|
100
100
|
return n ? !0 : r.pointerType ? r.pointerType === "touch" : typeof window > "u" ? !1 : window.matchMedia?.("(pointer: coarse)").matches ?? !1;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function ae(r, n) {
|
|
103
103
|
if (!r.length)
|
|
104
104
|
return {
|
|
105
105
|
minTranslate: 0,
|
|
106
106
|
maxTranslate: 0
|
|
107
107
|
};
|
|
108
|
-
const l = r.map((g) => g[n]), o = Math.min(...l),
|
|
109
|
-
if (Math.abs(
|
|
110
|
-
const g = (o +
|
|
108
|
+
const l = r.map((g) => g[n]), o = Math.min(...l), i = Math.max(...l);
|
|
109
|
+
if (Math.abs(i - o) < 0.5) {
|
|
110
|
+
const g = (o + i) / 2;
|
|
111
111
|
return {
|
|
112
112
|
minTranslate: g,
|
|
113
113
|
maxTranslate: g
|
|
@@ -115,227 +115,209 @@ function ie(r, n) {
|
|
|
115
115
|
}
|
|
116
116
|
return {
|
|
117
117
|
minTranslate: o,
|
|
118
|
-
maxTranslate:
|
|
118
|
+
maxTranslate: i
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function oe(r, n) {
|
|
122
122
|
for (let l = 0; l < r.length; l += 1) {
|
|
123
123
|
const o = "item" in r && typeof r.item == "function" ? r.item(l) : r[l];
|
|
124
124
|
if (o?.identifier === n) return o;
|
|
125
125
|
}
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function de(r) {
|
|
129
129
|
if (!r) return { x: 0, y: 0 };
|
|
130
130
|
const n = window.getComputedStyle(r).transform;
|
|
131
131
|
if (!n || n === "none") return { x: 0, y: 0 };
|
|
132
132
|
const l = n.match(/^matrix\((.+)\)$/);
|
|
133
133
|
if (l) {
|
|
134
|
-
const
|
|
134
|
+
const i = l[1].split(",").map((g) => g.trim());
|
|
135
135
|
return {
|
|
136
|
-
x: Number.parseFloat(
|
|
137
|
-
y: Number.parseFloat(
|
|
136
|
+
x: Number.parseFloat(i[4] ?? "0") || 0,
|
|
137
|
+
y: Number.parseFloat(i[5] ?? "0") || 0
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
const o = n.match(/^matrix3d\((.+)\)$/);
|
|
141
141
|
if (o) {
|
|
142
|
-
const
|
|
142
|
+
const i = o[1].split(",").map((g) => g.trim());
|
|
143
143
|
return {
|
|
144
|
-
x: Number.parseFloat(
|
|
145
|
-
y: Number.parseFloat(
|
|
144
|
+
x: Number.parseFloat(i[12] ?? "0") || 0,
|
|
145
|
+
y: Number.parseFloat(i[13] ?? "0") || 0
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
return { x: 0, y: 0 };
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
150
|
+
function se(r) {
|
|
151
|
+
return de(r).y;
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
153
|
+
function le(r) {
|
|
154
|
+
return de(r);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function nt(r) {
|
|
157
157
|
if (!r) return;
|
|
158
158
|
const n = Number.parseFloat(r);
|
|
159
159
|
return Number.isFinite(n) ? n : void 0;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
if (!r) return 0;
|
|
163
|
-
const n = Number.parseFloat(r);
|
|
164
|
-
return Number.isFinite(n) ? r.trim().endsWith("ms") ? n : n * 1e3 : 0;
|
|
165
|
-
}
|
|
166
|
-
function fe(r) {
|
|
167
|
-
if (typeof window > "u")
|
|
168
|
-
return _t;
|
|
169
|
-
const n = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
170
|
-
if (!r) return n ? 0 : _t;
|
|
171
|
-
const l = r.style.transition;
|
|
172
|
-
l === "none" && r.style.removeProperty("transition");
|
|
173
|
-
const o = window.getComputedStyle(r), c = (o.transitionDuration ?? "").split(",").map(pe), g = (o.transitionDelay ?? "").split(",").map(pe), y = c.reduce((h, P, X) => {
|
|
174
|
-
const Y = g[X] ?? g[g.length - 1] ?? 0;
|
|
175
|
-
return Math.max(h, P + Y);
|
|
176
|
-
}, 0);
|
|
177
|
-
return l === "none" && r.style.setProperty("transition", "none"), y > 0 ? y : n ? 0 : _t;
|
|
178
|
-
}
|
|
179
|
-
function dt() {
|
|
161
|
+
function ct() {
|
|
180
162
|
return Date.now();
|
|
181
163
|
}
|
|
182
|
-
function
|
|
183
|
-
const l = n -
|
|
164
|
+
function Ie(r, n) {
|
|
165
|
+
const l = n - M.releaseVelocity.sampleWindowMs;
|
|
184
166
|
for (; r.length > 2 && (r[1]?.time ?? n) < l; )
|
|
185
167
|
r.shift();
|
|
186
168
|
}
|
|
187
|
-
function
|
|
188
|
-
const l = n.time ??
|
|
169
|
+
function it(r, n) {
|
|
170
|
+
const l = n.time ?? ct();
|
|
189
171
|
r.samples.push({
|
|
190
172
|
time: l,
|
|
191
173
|
pageX: n.pageX,
|
|
192
174
|
pageY: n.pageY,
|
|
193
175
|
translateX: n.translateX,
|
|
194
176
|
translateY: n.translateY
|
|
195
|
-
}),
|
|
177
|
+
}), Ie(r.samples, l);
|
|
196
178
|
}
|
|
197
|
-
function
|
|
179
|
+
function Yt(r, n) {
|
|
198
180
|
return {
|
|
199
181
|
x: r.startTranslateX + n.pageX - r.startX,
|
|
200
182
|
y: r.startTranslate + n.pageY - r.startY
|
|
201
183
|
};
|
|
202
184
|
}
|
|
203
|
-
function
|
|
204
|
-
const l =
|
|
205
|
-
|
|
185
|
+
function ce(r, n) {
|
|
186
|
+
const l = Yt(r, n);
|
|
187
|
+
it(r, {
|
|
206
188
|
pageX: n.pageX,
|
|
207
189
|
pageY: n.pageY,
|
|
208
190
|
translateX: l.x,
|
|
209
191
|
translateY: l.y
|
|
210
192
|
});
|
|
211
193
|
}
|
|
212
|
-
function
|
|
194
|
+
function ie({
|
|
213
195
|
session: r,
|
|
214
196
|
fallbackDeltaY: n,
|
|
215
197
|
fallbackElapsed: l
|
|
216
198
|
}) {
|
|
217
|
-
const o = r.samples[r.samples.length - 1], { maxPxPerSecond:
|
|
199
|
+
const o = r.samples[r.samples.length - 1], { maxPxPerSecond: i, sampleWindowMs: g } = M.releaseVelocity;
|
|
218
200
|
if (o) {
|
|
219
|
-
const
|
|
201
|
+
const T = o.time - g, h = r.samples.find((X) => X.time >= T) ?? r.samples[0];
|
|
220
202
|
if (h && h !== o) {
|
|
221
|
-
const
|
|
222
|
-
if (Number.isFinite(
|
|
223
|
-
return
|
|
203
|
+
const X = Math.max(o.time - h.time, 1), D = (o.translateY - h.translateY) / X * 1e3;
|
|
204
|
+
if (Number.isFinite(D))
|
|
205
|
+
return b(D, -i, i);
|
|
224
206
|
}
|
|
225
207
|
}
|
|
226
|
-
return
|
|
208
|
+
return b(
|
|
227
209
|
n / Math.max(l, 1) * 1e3,
|
|
228
|
-
-
|
|
229
|
-
|
|
210
|
+
-i,
|
|
211
|
+
i
|
|
230
212
|
);
|
|
231
213
|
}
|
|
232
|
-
function
|
|
214
|
+
function ue({
|
|
233
215
|
session: r,
|
|
234
216
|
fallbackDelta: n,
|
|
235
217
|
fallbackElapsed: l
|
|
236
218
|
}) {
|
|
237
|
-
const o = r.samples[r.samples.length - 1], { maxPxPerSecond:
|
|
219
|
+
const o = r.samples[r.samples.length - 1], { maxPxPerSecond: i, sampleWindowMs: g } = M.releaseVelocity;
|
|
238
220
|
if (o) {
|
|
239
|
-
const
|
|
221
|
+
const T = o.time - g, h = r.samples.find((X) => X.time >= T) ?? r.samples[0];
|
|
240
222
|
if (h && h !== o) {
|
|
241
|
-
const
|
|
242
|
-
x: (o.translateX - h.translateX) /
|
|
243
|
-
y: (o.translateY - h.translateY) /
|
|
223
|
+
const X = Math.max(o.time - h.time, 1), D = {
|
|
224
|
+
x: (o.translateX - h.translateX) / X * 1e3,
|
|
225
|
+
y: (o.translateY - h.translateY) / X * 1e3
|
|
244
226
|
};
|
|
245
|
-
if (Number.isFinite(
|
|
227
|
+
if (Number.isFinite(D.x) && Number.isFinite(D.y))
|
|
246
228
|
return {
|
|
247
|
-
x:
|
|
248
|
-
y:
|
|
229
|
+
x: b(D.x, -i, i),
|
|
230
|
+
y: b(D.y, -i, i)
|
|
249
231
|
};
|
|
250
232
|
}
|
|
251
233
|
}
|
|
252
234
|
return {
|
|
253
|
-
x:
|
|
235
|
+
x: b(
|
|
254
236
|
n.x / Math.max(l, 1) * 1e3,
|
|
255
|
-
-
|
|
256
|
-
|
|
237
|
+
-i,
|
|
238
|
+
i
|
|
257
239
|
),
|
|
258
|
-
y:
|
|
240
|
+
y: b(
|
|
259
241
|
n.y / Math.max(l, 1) * 1e3,
|
|
260
|
-
-
|
|
261
|
-
|
|
242
|
+
-i,
|
|
243
|
+
i
|
|
262
244
|
)
|
|
263
245
|
};
|
|
264
246
|
}
|
|
265
|
-
function
|
|
247
|
+
function Ce({
|
|
266
248
|
currentTranslate: r,
|
|
267
249
|
releaseVelocity: n
|
|
268
250
|
}) {
|
|
269
|
-
const { lookaheadSeconds: l, maxDistancePx: o } =
|
|
270
|
-
return r +
|
|
251
|
+
const { lookaheadSeconds: l, maxDistancePx: o } = M.snapProjection;
|
|
252
|
+
return r + b(n * l, -o, o);
|
|
271
253
|
}
|
|
272
|
-
function
|
|
254
|
+
function Le({
|
|
273
255
|
currentTranslate: r,
|
|
274
256
|
releaseVelocity: n
|
|
275
257
|
}) {
|
|
276
|
-
const { lookaheadSeconds: l, maxDistancePx: o } =
|
|
258
|
+
const { lookaheadSeconds: l, maxDistancePx: o } = M.snapProjection;
|
|
277
259
|
return {
|
|
278
|
-
x: r.x +
|
|
260
|
+
x: r.x + b(
|
|
279
261
|
n.x * l,
|
|
280
262
|
-o,
|
|
281
263
|
o
|
|
282
264
|
),
|
|
283
|
-
y: r.y +
|
|
265
|
+
y: r.y + b(
|
|
284
266
|
n.y * l,
|
|
285
267
|
-o,
|
|
286
268
|
o
|
|
287
269
|
)
|
|
288
270
|
};
|
|
289
271
|
}
|
|
290
|
-
function
|
|
291
|
-
return Math.abs(r) / 1e3 >
|
|
272
|
+
function Oe(r) {
|
|
273
|
+
return Math.abs(r) / 1e3 > M.releaseVelocity.flickThresholdPxPerMs;
|
|
292
274
|
}
|
|
293
|
-
function
|
|
294
|
-
return Math.hypot(r.x, r.y) / 1e3 >
|
|
275
|
+
function Ne(r) {
|
|
276
|
+
return Math.hypot(r.x, r.y) / 1e3 > M.releaseVelocity.flickThresholdPxPerMs;
|
|
295
277
|
}
|
|
296
|
-
function
|
|
278
|
+
function ut(r, n) {
|
|
297
279
|
return Math.hypot(r.x - n.x, r.y - n.y);
|
|
298
280
|
}
|
|
299
|
-
function
|
|
281
|
+
function pe(r, n) {
|
|
300
282
|
return r.reduce(
|
|
301
|
-
(l, o) =>
|
|
283
|
+
(l, o) => ut(o, n) < ut(l, n) ? o : l
|
|
302
284
|
);
|
|
303
285
|
}
|
|
304
|
-
function
|
|
286
|
+
function Ve({
|
|
305
287
|
currentTranslate: r,
|
|
306
288
|
releaseVelocity: n,
|
|
307
289
|
targets: l
|
|
308
290
|
}) {
|
|
309
|
-
const o =
|
|
291
|
+
const o = Le({
|
|
310
292
|
currentTranslate: r,
|
|
311
293
|
releaseVelocity: n
|
|
312
294
|
});
|
|
313
|
-
if (!
|
|
314
|
-
return
|
|
315
|
-
const
|
|
316
|
-
const
|
|
317
|
-
return
|
|
295
|
+
if (!Ne(n))
|
|
296
|
+
return pe(l, r);
|
|
297
|
+
const i = l.filter((g) => {
|
|
298
|
+
const T = g.x - r.x, h = g.y - r.y;
|
|
299
|
+
return T * n.x + h * n.y > 0;
|
|
318
300
|
});
|
|
319
|
-
return
|
|
320
|
-
|
|
301
|
+
return pe(
|
|
302
|
+
i.length ? i : l,
|
|
321
303
|
o
|
|
322
304
|
);
|
|
323
305
|
}
|
|
324
|
-
function
|
|
306
|
+
function Be({
|
|
325
307
|
presentationState: r,
|
|
326
308
|
releaseTranslate: n,
|
|
327
309
|
visibleTranslate: l
|
|
328
310
|
}) {
|
|
329
311
|
return r !== "visible" || Math.abs(n - l) > 1;
|
|
330
312
|
}
|
|
331
|
-
function
|
|
313
|
+
function je({
|
|
332
314
|
drag: r,
|
|
333
315
|
placement: n,
|
|
334
316
|
snapPositionCount: l
|
|
335
317
|
}) {
|
|
336
318
|
return n === "popup" && r === "content" && l > 0;
|
|
337
319
|
}
|
|
338
|
-
function
|
|
320
|
+
function ze({
|
|
339
321
|
dismissible: r,
|
|
340
322
|
peekTranslate: n,
|
|
341
323
|
sheetHeight: l,
|
|
@@ -346,57 +328,57 @@ function Ge({
|
|
|
346
328
|
minTranslate: 0
|
|
347
329
|
};
|
|
348
330
|
}
|
|
349
|
-
function
|
|
331
|
+
function _e({
|
|
350
332
|
rubberBand: r,
|
|
351
333
|
targetTranslate: n,
|
|
352
334
|
sheetHeight: l,
|
|
353
335
|
peekTranslate: o,
|
|
354
|
-
visibleTranslate:
|
|
336
|
+
visibleTranslate: i,
|
|
355
337
|
dismissible: g
|
|
356
338
|
}) {
|
|
357
|
-
const
|
|
339
|
+
const T = ze({
|
|
358
340
|
dismissible: g,
|
|
359
341
|
peekTranslate: o,
|
|
360
342
|
sheetHeight: l,
|
|
361
|
-
visibleTranslate:
|
|
362
|
-
}), h =
|
|
363
|
-
r ?
|
|
343
|
+
visibleTranslate: i
|
|
344
|
+
}), h = b(
|
|
345
|
+
r ? Nt({
|
|
364
346
|
targetTranslate: n,
|
|
365
347
|
dimension: l,
|
|
366
|
-
...
|
|
348
|
+
...T
|
|
367
349
|
}) : n,
|
|
368
350
|
-l,
|
|
369
|
-
|
|
370
|
-
),
|
|
351
|
+
T.maxTranslate + l
|
|
352
|
+
), X = Math.max(-h, 0), D = Math.max(h, 0), E = o > 0 ? o : l, $ = E > 0 ? 1 - D / Math.max(E, 1) : 0;
|
|
371
353
|
return {
|
|
372
354
|
translate: h,
|
|
373
|
-
overshootFillHeight:
|
|
374
|
-
backdropOpacity:
|
|
355
|
+
overshootFillHeight: X,
|
|
356
|
+
backdropOpacity: b($, 0, 1)
|
|
375
357
|
};
|
|
376
358
|
}
|
|
377
|
-
function
|
|
359
|
+
function Ke({
|
|
378
360
|
enabled: r,
|
|
379
361
|
drag: n,
|
|
380
362
|
open: l,
|
|
381
363
|
placement: o,
|
|
382
|
-
surfaceMotionRef:
|
|
364
|
+
surfaceMotionRef: i,
|
|
383
365
|
backdropRef: g,
|
|
384
|
-
bodyNode:
|
|
385
|
-
snapHeights: h =
|
|
386
|
-
snapPositions:
|
|
387
|
-
defaultSnapPosition:
|
|
388
|
-
peekHeight:
|
|
366
|
+
bodyNode: T,
|
|
367
|
+
snapHeights: h = Me,
|
|
368
|
+
snapPositions: X = be,
|
|
369
|
+
defaultSnapPosition: D,
|
|
370
|
+
peekHeight: E,
|
|
389
371
|
peekFallback: $,
|
|
390
|
-
presentationState:
|
|
391
|
-
setPresentationState:
|
|
392
|
-
requestClose:
|
|
393
|
-
canCloseAttempt:
|
|
394
|
-
dismissible:
|
|
395
|
-
visibleTranslate:
|
|
396
|
-
closeThreshold:
|
|
397
|
-
scrollLockTimeout:
|
|
372
|
+
presentationState: F,
|
|
373
|
+
setPresentationState: vt,
|
|
374
|
+
requestClose: pt,
|
|
375
|
+
canCloseAttempt: Vt,
|
|
376
|
+
dismissible: _ = !0,
|
|
377
|
+
visibleTranslate: N = 0,
|
|
378
|
+
closeThreshold: Mt = 0.35,
|
|
379
|
+
scrollLockTimeout: Bt = 500
|
|
398
380
|
}) {
|
|
399
|
-
const
|
|
381
|
+
const y = v({
|
|
400
382
|
dragging: !1,
|
|
401
383
|
allowed: !1,
|
|
402
384
|
chrome: !1,
|
|
@@ -415,60 +397,60 @@ function er({
|
|
|
415
397
|
samples: [],
|
|
416
398
|
pointerId: null,
|
|
417
399
|
touchId: null
|
|
418
|
-
}), H =
|
|
400
|
+
}), H = v(T), jt = v(!1), dt = v(0), bt = v(!1), U = v(null), V = v(
|
|
419
401
|
null
|
|
420
|
-
),
|
|
402
|
+
), ft = v(null), at = v(null), B = v(null), Et = v(!1), Ft = v(!1), ot = v(!1), P = je({
|
|
421
403
|
drag: n,
|
|
422
404
|
placement: o,
|
|
423
|
-
snapPositionCount:
|
|
424
|
-
}),
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}, [
|
|
405
|
+
snapPositionCount: X.length
|
|
406
|
+
}), zt = `${D ?? ""}:${X.join("|")}`, _t = v(X), gt = v(D);
|
|
407
|
+
lt(() => {
|
|
408
|
+
_t.current = X, gt.current = D;
|
|
409
|
+
}, [D, zt, X]), lt(() => {
|
|
428
410
|
const t = H.current;
|
|
429
|
-
t && t !==
|
|
430
|
-
}, [
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
}, []),
|
|
411
|
+
t && t !== T && Ct(t, !1), H.current = T, jt.current && Ct(T, !0);
|
|
412
|
+
}, [T]);
|
|
413
|
+
const R = d((t) => {
|
|
414
|
+
jt.current = t, Ct(H.current, t);
|
|
415
|
+
}, []), mt = d(
|
|
434
416
|
({ chrome: t, target: e }) => {
|
|
435
|
-
const a =
|
|
417
|
+
const a = Xe({
|
|
436
418
|
target: e,
|
|
437
419
|
chrome: t,
|
|
438
420
|
bodyNode: H.current
|
|
439
421
|
});
|
|
440
|
-
return
|
|
422
|
+
return R(a), a;
|
|
441
423
|
},
|
|
442
|
-
[
|
|
443
|
-
),
|
|
444
|
-
if (
|
|
424
|
+
[R]
|
|
425
|
+
), I = d(() => i.current?.getBoundingClientRect().height ?? window.innerHeight, [i]), Ut = d(() => {
|
|
426
|
+
if (E !== void 0) return E;
|
|
445
427
|
if ($ === "header")
|
|
446
|
-
return
|
|
447
|
-
}, [$,
|
|
448
|
-
const t =
|
|
428
|
+
return i.current?.querySelector('[data-oc-part="header"]')?.getBoundingClientRect().height ?? void 0;
|
|
429
|
+
}, [$, E, i]), k = d(() => {
|
|
430
|
+
const t = Ut();
|
|
449
431
|
if (t === void 0 || t <= 0) return 0;
|
|
450
|
-
const e =
|
|
451
|
-
return
|
|
452
|
-
}, [
|
|
453
|
-
() =>
|
|
454
|
-
[
|
|
455
|
-
),
|
|
456
|
-
const t =
|
|
457
|
-
if (!t) return
|
|
458
|
-
const e =
|
|
432
|
+
const e = I();
|
|
433
|
+
return b(e - t, 0, e);
|
|
434
|
+
}, [Ut, I]), kt = d(
|
|
435
|
+
() => F === "peeked" ? k() : N,
|
|
436
|
+
[k, F, N]
|
|
437
|
+
), ht = d(() => {
|
|
438
|
+
const t = i.current;
|
|
439
|
+
if (!t) return kt();
|
|
440
|
+
const e = nt(
|
|
459
441
|
t.style.getPropertyValue("--oc-modal-translate-y")
|
|
460
442
|
);
|
|
461
443
|
if (e !== void 0) return e;
|
|
462
|
-
const a =
|
|
444
|
+
const a = nt(
|
|
463
445
|
window.getComputedStyle(t).getPropertyValue("--oc-modal-translate-y")
|
|
464
446
|
);
|
|
465
|
-
return a !== void 0 ? a :
|
|
466
|
-
}, [
|
|
467
|
-
const t =
|
|
447
|
+
return a !== void 0 ? a : kt();
|
|
448
|
+
}, [kt, i]), Tt = d(() => {
|
|
449
|
+
const t = i.current;
|
|
468
450
|
if (!t) return { x: 0, y: 0 };
|
|
469
|
-
const e =
|
|
451
|
+
const e = nt(
|
|
470
452
|
t.style.getPropertyValue("--oc-modal-translate-x")
|
|
471
|
-
), a =
|
|
453
|
+
), a = nt(
|
|
472
454
|
t.style.getPropertyValue("--oc-modal-translate-y")
|
|
473
455
|
);
|
|
474
456
|
if (e !== void 0 || a !== void 0)
|
|
@@ -476,71 +458,74 @@ function er({
|
|
|
476
458
|
x: e ?? 0,
|
|
477
459
|
y: a ?? 0
|
|
478
460
|
};
|
|
479
|
-
const
|
|
461
|
+
const c = window.getComputedStyle(t);
|
|
480
462
|
return {
|
|
481
|
-
x:
|
|
482
|
-
y:
|
|
463
|
+
x: nt(c.getPropertyValue("--oc-modal-translate-x")) ?? 0,
|
|
464
|
+
y: nt(c.getPropertyValue("--oc-modal-translate-y")) ?? 0
|
|
483
465
|
};
|
|
484
|
-
}, [
|
|
485
|
-
const t =
|
|
466
|
+
}, [i]), yt = d(() => {
|
|
467
|
+
const t = ht(), e = se(i.current);
|
|
486
468
|
return Math.abs(e - t) > 1 ? e : t;
|
|
487
|
-
}, [
|
|
488
|
-
const t =
|
|
489
|
-
return
|
|
490
|
-
}, [
|
|
469
|
+
}, [ht, i]), K = d(() => {
|
|
470
|
+
const t = Tt(), e = le(i.current);
|
|
471
|
+
return ut(e, t) > 1 ? e : t;
|
|
472
|
+
}, [Tt, i]), j = d(
|
|
491
473
|
(t, {
|
|
492
474
|
active: e,
|
|
493
|
-
nextDismissible: a =
|
|
494
|
-
rubberBand:
|
|
475
|
+
nextDismissible: a = _,
|
|
476
|
+
rubberBand: c = !1
|
|
495
477
|
}) => {
|
|
496
|
-
const s =
|
|
478
|
+
const s = i.current;
|
|
497
479
|
if (!s) return;
|
|
498
|
-
const u =
|
|
499
|
-
rubberBand:
|
|
480
|
+
const u = I(), p = s.parentElement, f = k(), m = _e({
|
|
481
|
+
rubberBand: c,
|
|
500
482
|
targetTranslate: t,
|
|
501
483
|
sheetHeight: u,
|
|
502
484
|
peekTranslate: f,
|
|
503
|
-
visibleTranslate:
|
|
485
|
+
visibleTranslate: N,
|
|
504
486
|
dismissible: a
|
|
505
487
|
});
|
|
506
|
-
|
|
488
|
+
y.current.lastTranslate = m.translate, s.style.setProperty(
|
|
507
489
|
"--oc-modal-translate-y",
|
|
508
490
|
`${m.translate}px`
|
|
509
|
-
), s.
|
|
491
|
+
), s.style.setProperty(
|
|
492
|
+
"--_-modal-elevation-shadow-opacity",
|
|
493
|
+
String(1 - m.backdropOpacity)
|
|
494
|
+
), s.dataset.ocModalDragging = e ? "true" : "false", p?.style.setProperty(
|
|
510
495
|
"--oc-modal-overshoot-fill-height",
|
|
511
496
|
`${m.overshootFillHeight}px`
|
|
512
|
-
),
|
|
497
|
+
), p && (p.dataset.ocModalDragging = e ? "true" : "false"), e ? s.style.setProperty("transition", "none") : s.style.removeProperty("transition"), g.current && (g.current.style.setProperty(
|
|
513
498
|
"--oc-modal-backdrop-opacity",
|
|
514
499
|
String(m.backdropOpacity)
|
|
515
500
|
), g.current.style.transition = e ? "none" : "");
|
|
516
501
|
},
|
|
517
502
|
[
|
|
518
503
|
g,
|
|
519
|
-
|
|
504
|
+
_,
|
|
505
|
+
k,
|
|
520
506
|
I,
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
B
|
|
507
|
+
i,
|
|
508
|
+
N
|
|
524
509
|
]
|
|
525
|
-
),
|
|
526
|
-
const t =
|
|
510
|
+
), q = d(() => {
|
|
511
|
+
const t = i.current, e = _t.current;
|
|
527
512
|
if (!(!t || !e.length))
|
|
528
|
-
return
|
|
529
|
-
defaultSnapPosition:
|
|
513
|
+
return we({
|
|
514
|
+
defaultSnapPosition: gt.current,
|
|
530
515
|
snapPositions: e,
|
|
531
516
|
surfaceMotion: t
|
|
532
517
|
});
|
|
533
|
-
}, [
|
|
518
|
+
}, [i]), J = d(
|
|
534
519
|
({ destroy: t = !0 } = {}) => {
|
|
535
|
-
t && V.current?.destroy(), V.current = null,
|
|
520
|
+
t && V.current?.destroy(), V.current = null, ft.current = null;
|
|
536
521
|
},
|
|
537
522
|
[]
|
|
538
|
-
),
|
|
523
|
+
), S = d(
|
|
539
524
|
(t, { active: e }) => {
|
|
540
|
-
const a =
|
|
525
|
+
const a = i.current;
|
|
541
526
|
if (!a) return;
|
|
542
|
-
const
|
|
543
|
-
x:
|
|
527
|
+
const c = q(), s = c ? a.getBoundingClientRect() : void 0, u = c ? ae(c.targets, "x") : void 0, p = c ? ae(c.targets, "y") : void 0, f = c ? {
|
|
528
|
+
x: Nt({
|
|
544
529
|
targetTranslate: t.x,
|
|
545
530
|
minTranslate: u?.minTranslate ?? 0,
|
|
546
531
|
maxTranslate: u?.maxTranslate ?? 0,
|
|
@@ -548,16 +533,16 @@ function er({
|
|
|
548
533
|
(u?.maxTranslate ?? 0) - (u?.minTranslate ?? 0)
|
|
549
534
|
) || s?.width || 1
|
|
550
535
|
}),
|
|
551
|
-
y:
|
|
536
|
+
y: Nt({
|
|
552
537
|
targetTranslate: t.y,
|
|
553
|
-
minTranslate:
|
|
554
|
-
maxTranslate:
|
|
538
|
+
minTranslate: p?.minTranslate ?? 0,
|
|
539
|
+
maxTranslate: p?.maxTranslate ?? 0,
|
|
555
540
|
dimension: Math.abs(
|
|
556
|
-
(
|
|
541
|
+
(p?.maxTranslate ?? 0) - (p?.minTranslate ?? 0)
|
|
557
542
|
) || s?.height || 1
|
|
558
543
|
})
|
|
559
544
|
} : t;
|
|
560
|
-
|
|
545
|
+
y.current.lastTranslateX = f.x, y.current.lastTranslate = f.y, a.style.setProperty(
|
|
561
546
|
"--oc-modal-translate-x",
|
|
562
547
|
`${f.x}px`
|
|
563
548
|
), a.style.setProperty(
|
|
@@ -565,78 +550,52 @@ function er({
|
|
|
565
550
|
`${f.y}px`
|
|
566
551
|
), a.dataset.ocModalDragging = e ? "true" : "false", a.parentElement && (a.parentElement.dataset.ocModalDragging = e ? "true" : "false"), a.style.transition = e ? "none" : "";
|
|
567
552
|
},
|
|
568
|
-
[
|
|
569
|
-
),
|
|
570
|
-
|
|
571
|
-
}, [
|
|
572
|
-
(t, e =
|
|
573
|
-
|
|
553
|
+
[q, i]
|
|
554
|
+
), Y = d(() => {
|
|
555
|
+
U.current?.destroy(), U.current = null, J();
|
|
556
|
+
}, [J]), Q = d(
|
|
557
|
+
(t, e = _) => {
|
|
558
|
+
Y(), j(t, {
|
|
574
559
|
active: !0,
|
|
575
560
|
nextDismissible: e,
|
|
576
561
|
rubberBand: !0
|
|
577
562
|
});
|
|
578
563
|
},
|
|
579
|
-
[
|
|
580
|
-
),
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
u && (t === null ? (delete u.dataset.ocModalTransition, u.style.removeProperty("--_-modal-transition-duration"), u.style.removeProperty("--_-modal-transition-timing-function")) : (u.dataset.ocModalTransition = t, e.durationMs !== void 0 && u.style.setProperty(
|
|
585
|
-
"--_-modal-transition-duration",
|
|
586
|
-
`${e.durationMs}ms`
|
|
587
|
-
), e.timingFunction !== void 0 && u.style.setProperty(
|
|
588
|
-
"--_-modal-transition-timing-function",
|
|
589
|
-
e.timingFunction
|
|
590
|
-
)));
|
|
591
|
-
},
|
|
592
|
-
[g, c]
|
|
593
|
-
), x = p(() => {
|
|
594
|
-
const t = c.current;
|
|
595
|
-
t && (t.dataset.ocModalDragging = "false", t.style.removeProperty("transition"), t.parentElement && (t.parentElement.dataset.ocModalDragging = "false"), g.current?.style.removeProperty("transition"), et(null));
|
|
596
|
-
}, [g, et, c]), qt = p(
|
|
564
|
+
[j, Y, _]
|
|
565
|
+
), w = d(() => {
|
|
566
|
+
const t = i.current;
|
|
567
|
+
t && (t.dataset.ocModalDragging = "false", t.style.removeProperty("transition"), t.parentElement && (t.parentElement.dataset.ocModalDragging = "false"), g.current?.style.removeProperty("transition"));
|
|
568
|
+
}, [g, i]), Wt = d(
|
|
597
569
|
({ resetY: t = !0 } = {}) => {
|
|
598
|
-
const e =
|
|
599
|
-
e && (
|
|
570
|
+
const e = i.current;
|
|
571
|
+
e && (at.current = null, y.current.lastTranslateX = 0, e.style.removeProperty("--oc-modal-translate-x"), t && (y.current.lastTranslate = 0, e.style.removeProperty("--oc-modal-translate-y")), w());
|
|
600
572
|
},
|
|
601
|
-
[
|
|
602
|
-
),
|
|
573
|
+
[w, i]
|
|
574
|
+
), A = d(
|
|
603
575
|
(t, {
|
|
604
576
|
initialVelocity: e = 0,
|
|
605
577
|
intent: a = "gesture",
|
|
606
|
-
phase:
|
|
578
|
+
phase: c = "settle",
|
|
607
579
|
from: s,
|
|
608
580
|
onComplete: u
|
|
609
581
|
} = {}) => {
|
|
610
|
-
const
|
|
611
|
-
if (!
|
|
612
|
-
|
|
613
|
-
const f = s ??
|
|
582
|
+
const p = i.current;
|
|
583
|
+
if (!p) return;
|
|
584
|
+
Y();
|
|
585
|
+
const f = s ?? se(p);
|
|
614
586
|
if (Math.abs(f - t) < 0.5) {
|
|
615
|
-
|
|
587
|
+
j(t, { active: !1 }), w(), u?.();
|
|
616
588
|
return;
|
|
617
589
|
}
|
|
618
|
-
|
|
619
|
-
const m =
|
|
620
|
-
element:
|
|
590
|
+
j(f, { active: !0 });
|
|
591
|
+
const m = It({
|
|
592
|
+
element: p,
|
|
621
593
|
intent: a,
|
|
622
|
-
phase:
|
|
594
|
+
phase: c,
|
|
623
595
|
reduced: "preserve",
|
|
624
596
|
reducedMotion: !1,
|
|
625
597
|
property: "transform"
|
|
626
|
-
})
|
|
627
|
-
if (!m.springBacked) {
|
|
628
|
-
et("gesture-settle", {
|
|
629
|
-
timingFunction: m.timingFunction
|
|
630
|
-
});
|
|
631
|
-
const b = fe(d);
|
|
632
|
-
G.current = window.requestAnimationFrame(() => {
|
|
633
|
-
G.current = null, C(t, { active: !1 }), b <= 0 && (x(), u?.());
|
|
634
|
-
}), b > 0 && (q.current = window.setTimeout(() => {
|
|
635
|
-
q.current = null, x(), u?.();
|
|
636
|
-
}, b));
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
const T = Vt({
|
|
598
|
+
}), x = Ot({
|
|
640
599
|
value: f,
|
|
641
600
|
target: t,
|
|
642
601
|
velocity: e,
|
|
@@ -644,57 +603,38 @@ function er({
|
|
|
644
603
|
epsilon: 0.5,
|
|
645
604
|
velocityEpsilon: 50,
|
|
646
605
|
stabilityWindow: 0.02,
|
|
647
|
-
onUpdate: (
|
|
648
|
-
C
|
|
606
|
+
onUpdate: (C) => {
|
|
607
|
+
j(C, { active: !0 });
|
|
649
608
|
},
|
|
650
609
|
onComplete: () => {
|
|
651
|
-
|
|
610
|
+
U.current === x && (U.current = null), j(t, { active: !1 }), w(), u?.();
|
|
652
611
|
}
|
|
653
612
|
});
|
|
654
|
-
|
|
613
|
+
U.current = x;
|
|
655
614
|
},
|
|
656
|
-
[
|
|
657
|
-
|
|
658
|
-
M,
|
|
659
|
-
x,
|
|
660
|
-
et,
|
|
661
|
-
c
|
|
662
|
-
]
|
|
663
|
-
), j = p(
|
|
615
|
+
[j, Y, w, i]
|
|
616
|
+
), W = d(
|
|
664
617
|
(t, {
|
|
665
618
|
from: e,
|
|
666
619
|
initialVelocity: a = { x: 0, y: 0 }
|
|
667
620
|
} = {}) => {
|
|
668
|
-
const
|
|
669
|
-
if (!
|
|
670
|
-
|
|
671
|
-
const s = e ??
|
|
672
|
-
if (
|
|
673
|
-
|
|
621
|
+
const c = i.current;
|
|
622
|
+
if (!c) return;
|
|
623
|
+
Y();
|
|
624
|
+
const s = e ?? le(c), u = { x: t.x, y: t.y };
|
|
625
|
+
if (ut(s, u) < 0.5) {
|
|
626
|
+
S(u, { active: !1 }), w();
|
|
674
627
|
return;
|
|
675
628
|
}
|
|
676
|
-
|
|
677
|
-
const f =
|
|
678
|
-
element:
|
|
629
|
+
S(s, { active: !0 });
|
|
630
|
+
const f = It({
|
|
631
|
+
element: c,
|
|
679
632
|
intent: "gesture",
|
|
680
633
|
phase: "settle",
|
|
681
634
|
reduced: "preserve",
|
|
682
635
|
reducedMotion: !1,
|
|
683
636
|
property: "transform"
|
|
684
|
-
})
|
|
685
|
-
if (!f.springBacked) {
|
|
686
|
-
et("gesture-settle", {
|
|
687
|
-
timingFunction: f.timingFunction
|
|
688
|
-
});
|
|
689
|
-
const T = fe(i);
|
|
690
|
-
G.current = window.requestAnimationFrame(() => {
|
|
691
|
-
G.current = null, v(u, { active: !1 }), T <= 0 && x();
|
|
692
|
-
}), T > 0 && (q.current = window.setTimeout(() => {
|
|
693
|
-
q.current = null, x();
|
|
694
|
-
}, T));
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
const m = Vt({
|
|
637
|
+
}), m = Ot({
|
|
698
638
|
value: s,
|
|
699
639
|
target: u,
|
|
700
640
|
velocity: a,
|
|
@@ -702,81 +642,80 @@ function er({
|
|
|
702
642
|
epsilon: 0.5,
|
|
703
643
|
velocityEpsilon: 50,
|
|
704
644
|
stabilityWindow: 0.02,
|
|
705
|
-
onUpdate: (
|
|
706
|
-
|
|
645
|
+
onUpdate: (x) => {
|
|
646
|
+
S(x, { active: !0 });
|
|
707
647
|
},
|
|
708
648
|
onComplete: () => {
|
|
709
|
-
|
|
649
|
+
U.current === m && (U.current = null), S(u, { active: !1 }), w();
|
|
710
650
|
}
|
|
711
651
|
});
|
|
712
|
-
|
|
652
|
+
U.current = m;
|
|
713
653
|
},
|
|
714
654
|
[
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
c
|
|
655
|
+
S,
|
|
656
|
+
Y,
|
|
657
|
+
w,
|
|
658
|
+
i
|
|
720
659
|
]
|
|
721
|
-
),
|
|
660
|
+
), Z = d(() => {
|
|
722
661
|
const t = V.current;
|
|
723
662
|
if (!t) return null;
|
|
724
663
|
const e = t.sample();
|
|
725
|
-
return
|
|
726
|
-
}, [
|
|
664
|
+
return S(e.value, { active: !0 }), e;
|
|
665
|
+
}, [S]), $t = d(
|
|
727
666
|
(t) => {
|
|
728
|
-
if (!
|
|
729
|
-
|
|
730
|
-
const a =
|
|
667
|
+
if (!i.current) return null;
|
|
668
|
+
Y(), S(t, { active: !0 });
|
|
669
|
+
const a = Ot({
|
|
731
670
|
value: t,
|
|
732
671
|
target: t,
|
|
733
|
-
spring:
|
|
672
|
+
spring: ve,
|
|
734
673
|
autoplay: !1,
|
|
735
674
|
epsilon: 0.5,
|
|
736
675
|
velocityEpsilon: 50,
|
|
737
676
|
stabilityWindow: 0.02,
|
|
738
|
-
onUpdate: (
|
|
739
|
-
|
|
677
|
+
onUpdate: (c) => {
|
|
678
|
+
S(c, { active: !0 });
|
|
740
679
|
},
|
|
741
680
|
onComplete: () => {
|
|
742
|
-
const
|
|
743
|
-
!
|
|
681
|
+
const c = ft.current;
|
|
682
|
+
!c || V.current !== a || (J({ destroy: !1 }), S(c, { active: !1 }), w());
|
|
744
683
|
}
|
|
745
684
|
});
|
|
746
685
|
return V.current = a, a;
|
|
747
686
|
},
|
|
748
687
|
[
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
688
|
+
S,
|
|
689
|
+
Y,
|
|
690
|
+
J,
|
|
691
|
+
w,
|
|
692
|
+
i
|
|
754
693
|
]
|
|
755
|
-
),
|
|
694
|
+
), Ht = d(
|
|
756
695
|
(t) => {
|
|
757
|
-
const e = V.current ??
|
|
758
|
-
e && (
|
|
696
|
+
const e = V.current ?? $t(K());
|
|
697
|
+
e && (ft.current = null, e.setTarget(t));
|
|
759
698
|
},
|
|
760
|
-
[
|
|
761
|
-
),
|
|
699
|
+
[K, $t]
|
|
700
|
+
), tt = d(
|
|
762
701
|
(t, e) => {
|
|
763
|
-
const a =
|
|
764
|
-
return
|
|
702
|
+
const a = Yt(t, e);
|
|
703
|
+
return Ht(a), Z(), a;
|
|
765
704
|
},
|
|
766
|
-
[
|
|
767
|
-
),
|
|
705
|
+
[Z, Ht]
|
|
706
|
+
), xt = d(
|
|
768
707
|
(t) => {
|
|
769
|
-
const e =
|
|
708
|
+
const e = i.current, a = V.current;
|
|
770
709
|
if (!e || !a) {
|
|
771
|
-
|
|
710
|
+
W(t);
|
|
772
711
|
return;
|
|
773
712
|
}
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
|
|
713
|
+
const s = Z() ? Tt() : a.value, u = { x: t.x, y: t.y };
|
|
714
|
+
if (ut(s, u) < 0.5) {
|
|
715
|
+
J(), S(u, { active: !1 }), w();
|
|
777
716
|
return;
|
|
778
717
|
}
|
|
779
|
-
const
|
|
718
|
+
const p = It({
|
|
780
719
|
element: e,
|
|
781
720
|
intent: "gesture",
|
|
782
721
|
phase: "settle",
|
|
@@ -784,253 +723,245 @@ function er({
|
|
|
784
723
|
reducedMotion: !1,
|
|
785
724
|
property: "transform"
|
|
786
725
|
});
|
|
787
|
-
|
|
788
|
-
const f = i?.velocity ?? a.velocity;
|
|
789
|
-
K(), j(u, {
|
|
790
|
-
from: s,
|
|
791
|
-
initialVelocity: f
|
|
792
|
-
});
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
ht.current = u, a.setTarget(u, { spring: d.spring });
|
|
726
|
+
ft.current = u, a.setTarget(u, { spring: p.spring });
|
|
796
727
|
},
|
|
797
728
|
[
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
729
|
+
S,
|
|
730
|
+
J,
|
|
731
|
+
w,
|
|
732
|
+
Tt,
|
|
733
|
+
Z,
|
|
734
|
+
W,
|
|
735
|
+
i
|
|
805
736
|
]
|
|
806
|
-
),
|
|
737
|
+
), Pt = d(
|
|
807
738
|
({
|
|
808
739
|
key: t,
|
|
809
740
|
settle: e
|
|
810
741
|
}) => {
|
|
811
|
-
if (
|
|
812
|
-
const a =
|
|
742
|
+
if (y.current.dragging) return !1;
|
|
743
|
+
const a = q();
|
|
813
744
|
if (!a) return !1;
|
|
814
|
-
const
|
|
815
|
-
return
|
|
745
|
+
const c = (t ? a.targets.find((s) => s.key === t) : void 0) ?? a.defaultTarget;
|
|
746
|
+
return at.current = c.key, e ? W(c) : (Y(), S(c, { active: !1 }), w()), !0;
|
|
816
747
|
},
|
|
817
748
|
[
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
749
|
+
S,
|
|
750
|
+
Y,
|
|
751
|
+
w,
|
|
752
|
+
q,
|
|
753
|
+
W
|
|
823
754
|
]
|
|
824
|
-
),
|
|
755
|
+
), Gt = d(
|
|
825
756
|
(t, { from: e, initialVelocity: a = 0 }) => {
|
|
826
|
-
|
|
757
|
+
A(t, {
|
|
827
758
|
from: e,
|
|
828
759
|
initialVelocity: a,
|
|
829
760
|
onComplete: () => {
|
|
830
|
-
|
|
761
|
+
pt({ reason: "drag-dismiss" }, { skipAttempt: !0 });
|
|
831
762
|
}
|
|
832
763
|
});
|
|
833
764
|
},
|
|
834
|
-
[
|
|
765
|
+
[pt, A]
|
|
835
766
|
);
|
|
836
|
-
|
|
767
|
+
At(
|
|
837
768
|
() => () => {
|
|
838
|
-
|
|
769
|
+
Y(), i.current && w();
|
|
839
770
|
},
|
|
840
|
-
[
|
|
841
|
-
),
|
|
771
|
+
[Y, w, i]
|
|
772
|
+
), lt(() => {
|
|
842
773
|
if (!l || !r || o !== "bottom") {
|
|
843
|
-
|
|
774
|
+
Et.current = l;
|
|
844
775
|
return;
|
|
845
776
|
}
|
|
846
|
-
const t =
|
|
847
|
-
|
|
848
|
-
const e =
|
|
777
|
+
const t = Et.current;
|
|
778
|
+
Et.current = !0;
|
|
779
|
+
const e = F === "peeked" ? k() : N;
|
|
849
780
|
if (!t) {
|
|
850
|
-
const a =
|
|
851
|
-
|
|
781
|
+
const a = I();
|
|
782
|
+
j(a, { active: !0 }), A(e, {
|
|
852
783
|
from: a,
|
|
853
784
|
intent: "move",
|
|
854
785
|
phase: "enter"
|
|
855
786
|
});
|
|
856
787
|
return;
|
|
857
788
|
}
|
|
858
|
-
if (
|
|
859
|
-
k(
|
|
789
|
+
if (F === "peeked") {
|
|
790
|
+
A(k());
|
|
860
791
|
return;
|
|
861
792
|
}
|
|
862
|
-
if (
|
|
863
|
-
|
|
793
|
+
if (bt.current) {
|
|
794
|
+
bt.current = !1;
|
|
864
795
|
return;
|
|
865
796
|
}
|
|
866
|
-
|
|
797
|
+
A(N);
|
|
867
798
|
}, [
|
|
868
799
|
r,
|
|
800
|
+
k,
|
|
869
801
|
I,
|
|
870
|
-
L,
|
|
871
802
|
l,
|
|
872
803
|
o,
|
|
804
|
+
F,
|
|
805
|
+
j,
|
|
873
806
|
A,
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
const i = !l && o === "popup" && it.current;
|
|
880
|
-
it.current && !i && (_.current !== null && (window.cancelAnimationFrame(_.current), _.current = null), M(), qt()), it.current && i && (M(), x()), kt.current = l && o === "popup", it.current = !1;
|
|
807
|
+
N
|
|
808
|
+
]), lt(() => {
|
|
809
|
+
if (!l || !r || !P) {
|
|
810
|
+
const c = !l && o === "popup" && ot.current;
|
|
811
|
+
ot.current && !c && (B.current !== null && (window.cancelAnimationFrame(B.current), B.current = null), Y(), Wt()), ot.current && c && (Y(), w()), Ft.current = l && o === "popup", ot.current = !1;
|
|
881
812
|
return;
|
|
882
813
|
}
|
|
883
|
-
const t =
|
|
884
|
-
|
|
814
|
+
const t = Ft.current;
|
|
815
|
+
Ft.current = !0, ot.current = !0;
|
|
885
816
|
let e = null;
|
|
886
|
-
const a = (
|
|
887
|
-
key:
|
|
817
|
+
const a = (c) => Pt({
|
|
818
|
+
key: c,
|
|
888
819
|
settle: t
|
|
889
820
|
});
|
|
890
|
-
return a(
|
|
821
|
+
return a(gt.current) || (e = window.requestAnimationFrame(() => {
|
|
891
822
|
e = null, a(
|
|
892
|
-
|
|
823
|
+
at.current ?? gt.current
|
|
893
824
|
);
|
|
894
825
|
})), () => {
|
|
895
826
|
e !== null && window.cancelAnimationFrame(e);
|
|
896
827
|
};
|
|
897
828
|
}, [
|
|
898
|
-
|
|
829
|
+
Y,
|
|
899
830
|
r,
|
|
900
|
-
|
|
831
|
+
w,
|
|
901
832
|
l,
|
|
902
833
|
o,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
]),
|
|
908
|
-
if (!l || !r || !
|
|
834
|
+
zt,
|
|
835
|
+
P,
|
|
836
|
+
Wt,
|
|
837
|
+
Pt
|
|
838
|
+
]), lt(() => {
|
|
839
|
+
if (!l || !r || !P) return;
|
|
909
840
|
const t = () => {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
key:
|
|
841
|
+
y.current.dragging || B.current === null && (B.current = window.requestAnimationFrame(() => {
|
|
842
|
+
B.current = null, !y.current.dragging && Pt({
|
|
843
|
+
key: at.current,
|
|
913
844
|
settle: !1
|
|
914
845
|
});
|
|
915
846
|
}));
|
|
916
847
|
};
|
|
917
848
|
window.addEventListener("resize", t), window.visualViewport?.addEventListener("resize", t);
|
|
918
|
-
const e =
|
|
919
|
-
return
|
|
920
|
-
window.removeEventListener("resize", t), window.visualViewport?.removeEventListener("resize", t),
|
|
849
|
+
const e = i.current, a = e?.parentElement, c = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
850
|
+
return c && (e && c.observe(e), a && c.observe(a)), () => {
|
|
851
|
+
window.removeEventListener("resize", t), window.visualViewport?.removeEventListener("resize", t), c?.disconnect(), B.current !== null && (window.cancelAnimationFrame(B.current), B.current = null);
|
|
921
852
|
};
|
|
922
853
|
}, [
|
|
923
854
|
r,
|
|
924
855
|
l,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
856
|
+
P,
|
|
857
|
+
i,
|
|
858
|
+
Pt
|
|
928
859
|
]);
|
|
929
|
-
const
|
|
860
|
+
const Rt = d(
|
|
930
861
|
(t, e, a) => {
|
|
931
|
-
if (typeof Element > "u" || !(t instanceof Element) ||
|
|
932
|
-
const
|
|
933
|
-
return !a && u && s && u.scrollTop > 0 || !a &&
|
|
862
|
+
if (typeof Element > "u" || !(t instanceof Element) || Lt(t)) return !1;
|
|
863
|
+
const c = Date.now(), s = e > 0, u = De(t, H.current);
|
|
864
|
+
return !a && u && s && u.scrollTop > 0 || !a && dt.current && c - dt.current < Bt && Math.abs(ht()) <= 1 ? (dt.current = c, !1) : !0;
|
|
934
865
|
},
|
|
935
|
-
[
|
|
936
|
-
),
|
|
866
|
+
[ht, Bt]
|
|
867
|
+
), wt = d(
|
|
937
868
|
({
|
|
938
869
|
chrome: t,
|
|
939
870
|
pointerId: e = null,
|
|
940
871
|
source: a,
|
|
941
|
-
startX:
|
|
872
|
+
startX: c = 0,
|
|
942
873
|
startY: s,
|
|
943
874
|
touchId: u = null
|
|
944
875
|
}) => {
|
|
945
|
-
const
|
|
946
|
-
|
|
876
|
+
const p = yt(), f = K(), m = ct();
|
|
877
|
+
y.current = {
|
|
947
878
|
dragging: !0,
|
|
948
879
|
allowed: !1,
|
|
949
880
|
chrome: t,
|
|
950
881
|
closeAllowed: null,
|
|
951
882
|
started: !1,
|
|
952
883
|
source: a,
|
|
953
|
-
startX:
|
|
884
|
+
startX: c,
|
|
954
885
|
startY: s,
|
|
955
|
-
lastX:
|
|
886
|
+
lastX: c,
|
|
956
887
|
lastY: s,
|
|
957
888
|
startTranslateX: f.x,
|
|
958
|
-
startTranslate:
|
|
889
|
+
startTranslate: p,
|
|
959
890
|
lastTranslateX: f.x,
|
|
960
|
-
lastTranslate:
|
|
891
|
+
lastTranslate: p,
|
|
961
892
|
startTime: m,
|
|
962
893
|
samples: [
|
|
963
894
|
{
|
|
964
895
|
time: m,
|
|
965
|
-
pageX:
|
|
896
|
+
pageX: c,
|
|
966
897
|
pageY: s,
|
|
967
898
|
translateX: f.x,
|
|
968
|
-
translateY:
|
|
899
|
+
translateY: p
|
|
969
900
|
}
|
|
970
901
|
],
|
|
971
902
|
pointerId: e,
|
|
972
903
|
touchId: u
|
|
973
904
|
};
|
|
974
905
|
},
|
|
975
|
-
[
|
|
976
|
-
),
|
|
906
|
+
[yt, K]
|
|
907
|
+
), et = d(
|
|
977
908
|
(t) => {
|
|
978
|
-
t.source === "touch" &&
|
|
909
|
+
t.source === "touch" && R(!1), t.dragging = !1, t.allowed = !1, t.closeAllowed = null, t.started = !1, t.source = null, t.startX = 0, t.startY = 0, t.lastX = 0, t.lastY = 0, t.startTranslateX = 0, t.startTranslate = 0, t.lastTranslateX = 0, t.lastTranslate = 0, t.pointerId = null, t.touchId = null;
|
|
979
910
|
},
|
|
980
|
-
[
|
|
981
|
-
),
|
|
911
|
+
[R]
|
|
912
|
+
), Kt = d(
|
|
982
913
|
(t, e) => {
|
|
983
|
-
const a =
|
|
984
|
-
t.startX = e.x, t.startY = e.y, t.lastX = e.x, t.lastY = e.y, t.startTranslateX =
|
|
914
|
+
const a = yt(), c = K();
|
|
915
|
+
t.startX = e.x, t.startY = e.y, t.lastX = e.x, t.lastY = e.y, t.startTranslateX = c.x, t.startTranslate = a, t.lastTranslateX = c.x, t.lastTranslate = a, t.startTime = ct(), t.samples = [
|
|
985
916
|
{
|
|
986
917
|
time: t.startTime,
|
|
987
918
|
pageX: e.x,
|
|
988
919
|
pageY: e.y,
|
|
989
|
-
translateX:
|
|
920
|
+
translateX: c.x,
|
|
990
921
|
translateY: a
|
|
991
922
|
}
|
|
992
923
|
];
|
|
993
924
|
},
|
|
994
|
-
[
|
|
995
|
-
),
|
|
925
|
+
[yt, K]
|
|
926
|
+
), qt = d(
|
|
996
927
|
({
|
|
997
928
|
currentTranslate: t,
|
|
998
929
|
dismissible: e,
|
|
999
930
|
releaseVelocity: a,
|
|
1000
|
-
deltaY:
|
|
931
|
+
deltaY: c,
|
|
1001
932
|
startTranslate: s
|
|
1002
933
|
}) => {
|
|
1003
|
-
const u =
|
|
1004
|
-
|
|
1005
|
-
(u -
|
|
1006
|
-
),
|
|
1007
|
-
(O) =>
|
|
1008
|
-
), z =
|
|
1009
|
-
|
|
1010
|
-
),
|
|
934
|
+
const u = I(), p = k(), f = p > 0, m = u, x = Math.max(
|
|
935
|
+
M.dismissal.minDistancePx,
|
|
936
|
+
(u - p) * Mt
|
|
937
|
+
), C = h.map(
|
|
938
|
+
(O) => b(u - O, 0, u)
|
|
939
|
+
), z = te(
|
|
940
|
+
C.length ? C : [0]
|
|
941
|
+
), L = Ce({
|
|
1011
942
|
currentTranslate: t,
|
|
1012
943
|
releaseVelocity: a
|
|
1013
944
|
});
|
|
1014
|
-
f && z.push(
|
|
1015
|
-
const
|
|
1016
|
-
return e && !f &&
|
|
1017
|
-
|
|
945
|
+
f && z.push(p);
|
|
946
|
+
const st = te(z);
|
|
947
|
+
return e && !f && c > 0 && t >= p + x ? m : Oe(a) ? st.length > 1 ? ke(
|
|
948
|
+
st,
|
|
1018
949
|
s,
|
|
1019
950
|
t,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
) : 0 : e && t > u *
|
|
951
|
+
c > 0 ? "down" : "up",
|
|
952
|
+
L
|
|
953
|
+
) : 0 : e && t > u * Mt && !f ? m : Ee(st, t);
|
|
1023
954
|
},
|
|
1024
|
-
[
|
|
1025
|
-
),
|
|
955
|
+
[Mt, k, I, h]
|
|
956
|
+
), fe = d(
|
|
1026
957
|
(t) => {
|
|
1027
|
-
if (!r || o !== "bottom" && !
|
|
958
|
+
if (!r || o !== "bottom" && !P || n === !1 || t.pointerType === "touch" || Lt(t.target)) return;
|
|
1028
959
|
let e = !1;
|
|
1029
960
|
if (n === "handle" && t.target instanceof Element && t.target.closest('[data-oc-part="handle"]'))
|
|
1030
961
|
e = !0;
|
|
1031
962
|
else if (n === "handle")
|
|
1032
963
|
return;
|
|
1033
|
-
n === "content" && (e =
|
|
964
|
+
n === "content" && (e = ne(t.target), !Ae(t, e)) || (wt({
|
|
1034
965
|
chrome: e,
|
|
1035
966
|
pointerId: t.pointerId,
|
|
1036
967
|
source: "pointer",
|
|
@@ -1038,98 +969,98 @@ function er({
|
|
|
1038
969
|
startY: t.pageY
|
|
1039
970
|
}), t.currentTarget.setPointerCapture(t.pointerId));
|
|
1040
971
|
},
|
|
1041
|
-
[
|
|
1042
|
-
),
|
|
972
|
+
[wt, n, r, o, P]
|
|
973
|
+
), rt = d(
|
|
1043
974
|
(t, e) => {
|
|
1044
|
-
if (!
|
|
975
|
+
if (!_) return !1;
|
|
1045
976
|
if (e <= 0) return !0;
|
|
1046
977
|
if (t.closeAllowed !== null) return t.closeAllowed;
|
|
1047
|
-
const a =
|
|
978
|
+
const a = Vt({ reason: "drag-dismiss" });
|
|
1048
979
|
return t.closeAllowed = a, a;
|
|
1049
980
|
},
|
|
1050
|
-
[
|
|
1051
|
-
),
|
|
981
|
+
[Vt, _]
|
|
982
|
+
), Xt = d(
|
|
1052
983
|
({
|
|
1053
984
|
closeAllowed: t,
|
|
1054
985
|
currentTranslate: e,
|
|
1055
986
|
deltaY: a,
|
|
1056
|
-
releaseVelocity:
|
|
987
|
+
releaseVelocity: c,
|
|
1057
988
|
startTranslate: s
|
|
1058
989
|
}) => {
|
|
1059
|
-
const
|
|
990
|
+
const p = qt({
|
|
1060
991
|
currentTranslate: e,
|
|
1061
|
-
dismissible:
|
|
1062
|
-
releaseVelocity:
|
|
992
|
+
dismissible: _ && t !== !1,
|
|
993
|
+
releaseVelocity: c,
|
|
1063
994
|
deltaY: a,
|
|
1064
995
|
startTranslate: s
|
|
1065
|
-
}), f =
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
996
|
+
}), f = I(), m = k();
|
|
997
|
+
if (p >= f - 1) {
|
|
998
|
+
pt({ reason: "drag-dismiss" }, { commit: !1 }) ? Gt(p, {
|
|
1068
999
|
from: e,
|
|
1069
|
-
initialVelocity:
|
|
1070
|
-
}) :
|
|
1000
|
+
initialVelocity: c
|
|
1001
|
+
}) : A(s, {
|
|
1071
1002
|
from: e,
|
|
1072
|
-
initialVelocity:
|
|
1003
|
+
initialVelocity: c
|
|
1073
1004
|
});
|
|
1074
1005
|
return;
|
|
1075
1006
|
}
|
|
1076
|
-
m > 0 &&
|
|
1077
|
-
presentationState:
|
|
1078
|
-
releaseTranslate:
|
|
1079
|
-
visibleTranslate:
|
|
1080
|
-
}) && (
|
|
1007
|
+
m > 0 && p >= m - 1 ? vt("peeked") : (Be({
|
|
1008
|
+
presentationState: F,
|
|
1009
|
+
releaseTranslate: p,
|
|
1010
|
+
visibleTranslate: N
|
|
1011
|
+
}) && (bt.current = !0), vt("visible")), A(p, {
|
|
1081
1012
|
from: e,
|
|
1082
|
-
initialVelocity:
|
|
1013
|
+
initialVelocity: c
|
|
1083
1014
|
});
|
|
1084
1015
|
},
|
|
1085
1016
|
[
|
|
1086
|
-
|
|
1087
|
-
|
|
1017
|
+
Gt,
|
|
1018
|
+
_,
|
|
1019
|
+
k,
|
|
1020
|
+
qt,
|
|
1088
1021
|
I,
|
|
1089
|
-
|
|
1090
|
-
|
|
1022
|
+
F,
|
|
1023
|
+
pt,
|
|
1024
|
+
vt,
|
|
1091
1025
|
A,
|
|
1092
|
-
|
|
1093
|
-
Et,
|
|
1094
|
-
k,
|
|
1095
|
-
B
|
|
1026
|
+
N
|
|
1096
1027
|
]
|
|
1097
|
-
),
|
|
1028
|
+
), Dt = d(
|
|
1098
1029
|
({ currentTranslate: t, releaseVelocity: e }) => {
|
|
1099
|
-
const a =
|
|
1030
|
+
const a = q();
|
|
1100
1031
|
if (!a) return;
|
|
1101
|
-
const
|
|
1032
|
+
const c = Ve({
|
|
1102
1033
|
currentTranslate: t,
|
|
1103
1034
|
releaseVelocity: e,
|
|
1104
1035
|
targets: a.targets
|
|
1105
1036
|
});
|
|
1106
|
-
if (
|
|
1107
|
-
|
|
1037
|
+
if (at.current = c.key, V.current) {
|
|
1038
|
+
xt(c);
|
|
1108
1039
|
return;
|
|
1109
1040
|
}
|
|
1110
|
-
|
|
1041
|
+
W(c, {
|
|
1111
1042
|
from: t,
|
|
1112
1043
|
initialVelocity: e
|
|
1113
1044
|
});
|
|
1114
1045
|
},
|
|
1115
|
-
[
|
|
1116
|
-
),
|
|
1046
|
+
[q, xt, W]
|
|
1047
|
+
), ge = d(
|
|
1117
1048
|
(t) => {
|
|
1118
|
-
const e =
|
|
1119
|
-
if (!e.dragging || e.source !== "pointer" || !r || o !== "bottom" && !
|
|
1049
|
+
const e = y.current;
|
|
1050
|
+
if (!e.dragging || e.source !== "pointer" || !r || o !== "bottom" && !P)
|
|
1120
1051
|
return;
|
|
1121
|
-
const a = t.pageX - e.startX,
|
|
1122
|
-
if (!(!e.started &&
|
|
1052
|
+
const a = t.pageX - e.startX, c = t.pageY - e.startY, s = t.pointerType === "touch" ? M.dragStartThresholdPx.touch : M.dragStartThresholdPx.mouse;
|
|
1053
|
+
if (!(!e.started && ee({ deltaX: a, deltaY: c, placement: o }) < s)) {
|
|
1123
1054
|
if (!e.allowed) {
|
|
1124
|
-
if (o === "bottom" && !
|
|
1055
|
+
if (o === "bottom" && !Rt(t.target, c, e.chrome))
|
|
1125
1056
|
return;
|
|
1126
1057
|
e.allowed = !0, e.started = !0;
|
|
1127
1058
|
}
|
|
1128
1059
|
if (t.preventDefault(), e.lastX = t.pageX, e.lastY = t.pageY, o === "popup")
|
|
1129
|
-
|
|
1060
|
+
tt(e, t), ce(e, t);
|
|
1130
1061
|
else {
|
|
1131
|
-
const u = e.startTranslate +
|
|
1132
|
-
|
|
1062
|
+
const u = e.startTranslate + c, p = rt(e, c);
|
|
1063
|
+
Q(u, p), it(e, {
|
|
1133
1064
|
pageX: t.pageX,
|
|
1134
1065
|
pageY: t.pageY,
|
|
1135
1066
|
translateX: e.lastTranslateX,
|
|
@@ -1140,142 +1071,142 @@ function er({
|
|
|
1140
1071
|
},
|
|
1141
1072
|
[
|
|
1142
1073
|
r,
|
|
1143
|
-
nt,
|
|
1144
|
-
ot,
|
|
1145
|
-
o,
|
|
1146
|
-
D,
|
|
1147
1074
|
tt,
|
|
1148
|
-
|
|
1075
|
+
rt,
|
|
1076
|
+
o,
|
|
1077
|
+
P,
|
|
1078
|
+
Q,
|
|
1079
|
+
Rt
|
|
1149
1080
|
]
|
|
1150
|
-
),
|
|
1081
|
+
), G = d(
|
|
1151
1082
|
({
|
|
1152
1083
|
currentTarget: t,
|
|
1153
1084
|
pageX: e,
|
|
1154
1085
|
pageY: a,
|
|
1155
|
-
releaseCapture:
|
|
1086
|
+
releaseCapture: c = !0
|
|
1156
1087
|
}) => {
|
|
1157
|
-
const s =
|
|
1158
|
-
if (!s.dragging || s.source !== "pointer" || !r || o !== "bottom" && !
|
|
1088
|
+
const s = y.current;
|
|
1089
|
+
if (!s.dragging || s.source !== "pointer" || !r || o !== "bottom" && !P)
|
|
1159
1090
|
return;
|
|
1160
|
-
const u = s.started,
|
|
1091
|
+
const u = s.started, p = Number.isFinite(e) ? e : s.lastX, f = Number.isFinite(a) ? a : s.lastY, m = p - s.startX, x = f - s.startY, C = Math.max(ct() - s.startTime, 1);
|
|
1161
1092
|
let z = {
|
|
1162
1093
|
x: s.lastTranslateX,
|
|
1163
1094
|
y: s.lastTranslate
|
|
1164
1095
|
};
|
|
1165
|
-
const
|
|
1096
|
+
const L = s.startTranslate;
|
|
1166
1097
|
if (u)
|
|
1167
1098
|
if (o === "popup")
|
|
1168
|
-
|
|
1169
|
-
pageX:
|
|
1099
|
+
tt(s, {
|
|
1100
|
+
pageX: p,
|
|
1170
1101
|
pageY: f
|
|
1171
1102
|
}), z = {
|
|
1172
1103
|
x: s.lastTranslateX,
|
|
1173
1104
|
y: s.lastTranslate
|
|
1174
1105
|
};
|
|
1175
1106
|
else {
|
|
1176
|
-
const O = s.startTranslate +
|
|
1177
|
-
|
|
1107
|
+
const O = s.startTranslate + x, xe = rt(s, x);
|
|
1108
|
+
Q(O, xe), z = {
|
|
1178
1109
|
x: s.lastTranslateX,
|
|
1179
1110
|
y: s.lastTranslate
|
|
1180
1111
|
};
|
|
1181
1112
|
}
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1184
|
-
const O = o === "popup" ?
|
|
1185
|
-
pageX:
|
|
1113
|
+
const st = s.closeAllowed;
|
|
1114
|
+
if (c && t && s.pointerId !== null && t.hasPointerCapture(s.pointerId) && t.releasePointerCapture(s.pointerId), u) {
|
|
1115
|
+
const O = o === "popup" ? Yt(s, {
|
|
1116
|
+
pageX: p,
|
|
1186
1117
|
pageY: f
|
|
1187
1118
|
}) : {
|
|
1188
1119
|
x: s.lastTranslateX,
|
|
1189
1120
|
y: s.lastTranslate
|
|
1190
1121
|
};
|
|
1191
|
-
|
|
1192
|
-
pageX:
|
|
1122
|
+
it(s, {
|
|
1123
|
+
pageX: p,
|
|
1193
1124
|
pageY: f,
|
|
1194
1125
|
translateX: O.x,
|
|
1195
1126
|
translateY: O.y
|
|
1196
1127
|
});
|
|
1197
1128
|
}
|
|
1198
|
-
if (
|
|
1129
|
+
if (et(s), !!u)
|
|
1199
1130
|
if (o === "popup") {
|
|
1200
|
-
const O =
|
|
1131
|
+
const O = ue({
|
|
1201
1132
|
session: s,
|
|
1202
|
-
fallbackDelta: { x: m, y:
|
|
1203
|
-
fallbackElapsed:
|
|
1133
|
+
fallbackDelta: { x: m, y: x },
|
|
1134
|
+
fallbackElapsed: C
|
|
1204
1135
|
});
|
|
1205
|
-
|
|
1136
|
+
Dt({
|
|
1206
1137
|
currentTranslate: z,
|
|
1207
1138
|
releaseVelocity: O
|
|
1208
1139
|
});
|
|
1209
1140
|
} else {
|
|
1210
|
-
const O =
|
|
1141
|
+
const O = ie({
|
|
1211
1142
|
session: s,
|
|
1212
|
-
fallbackDeltaY:
|
|
1213
|
-
fallbackElapsed:
|
|
1143
|
+
fallbackDeltaY: x,
|
|
1144
|
+
fallbackElapsed: C
|
|
1214
1145
|
});
|
|
1215
|
-
|
|
1216
|
-
closeAllowed:
|
|
1146
|
+
Xt({
|
|
1147
|
+
closeAllowed: st,
|
|
1217
1148
|
currentTranslate: z.y,
|
|
1218
|
-
deltaY:
|
|
1149
|
+
deltaY: x,
|
|
1219
1150
|
releaseVelocity: O,
|
|
1220
|
-
startTranslate:
|
|
1151
|
+
startTranslate: L
|
|
1221
1152
|
});
|
|
1222
1153
|
}
|
|
1223
1154
|
},
|
|
1224
1155
|
[
|
|
1225
|
-
|
|
1226
|
-
|
|
1156
|
+
Xt,
|
|
1157
|
+
Dt,
|
|
1227
1158
|
r,
|
|
1228
|
-
|
|
1229
|
-
|
|
1159
|
+
tt,
|
|
1160
|
+
rt,
|
|
1230
1161
|
o,
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1162
|
+
P,
|
|
1163
|
+
et,
|
|
1164
|
+
Q
|
|
1234
1165
|
]
|
|
1235
|
-
),
|
|
1166
|
+
), Jt = d(
|
|
1236
1167
|
(t) => {
|
|
1237
|
-
|
|
1168
|
+
G({
|
|
1238
1169
|
currentTarget: t.currentTarget,
|
|
1239
1170
|
pageX: t.pageX,
|
|
1240
1171
|
pageY: t.pageY
|
|
1241
1172
|
});
|
|
1242
1173
|
},
|
|
1243
|
-
[
|
|
1244
|
-
),
|
|
1174
|
+
[G]
|
|
1175
|
+
), me = d(
|
|
1245
1176
|
(t) => {
|
|
1246
|
-
const e =
|
|
1247
|
-
e.pointerId !== null && t.pointerId !== e.pointerId ||
|
|
1177
|
+
const e = y.current;
|
|
1178
|
+
e.pointerId !== null && t.pointerId !== e.pointerId || G({
|
|
1248
1179
|
pageX: t.pageX,
|
|
1249
1180
|
pageY: t.pageY,
|
|
1250
1181
|
releaseCapture: !1
|
|
1251
1182
|
});
|
|
1252
1183
|
},
|
|
1253
|
-
[
|
|
1184
|
+
[G]
|
|
1254
1185
|
);
|
|
1255
|
-
|
|
1186
|
+
At(() => {
|
|
1256
1187
|
if (!r) return;
|
|
1257
1188
|
const t = (s) => {
|
|
1258
|
-
const u =
|
|
1259
|
-
!u.dragging || u.source !== "pointer" || "pointerId" in s && u.pointerId !== null && s.pointerId !== u.pointerId ||
|
|
1189
|
+
const u = y.current;
|
|
1190
|
+
!u.dragging || u.source !== "pointer" || "pointerId" in s && u.pointerId !== null && s.pointerId !== u.pointerId || G({
|
|
1260
1191
|
pageX: s.pageX,
|
|
1261
1192
|
pageY: s.pageY,
|
|
1262
1193
|
releaseCapture: !1
|
|
1263
1194
|
});
|
|
1264
1195
|
}, e = () => {
|
|
1265
|
-
const s =
|
|
1266
|
-
!s.dragging || s.source !== "pointer" ||
|
|
1196
|
+
const s = y.current;
|
|
1197
|
+
!s.dragging || s.source !== "pointer" || G({
|
|
1267
1198
|
pageX: s.lastX,
|
|
1268
1199
|
pageY: s.lastY,
|
|
1269
1200
|
releaseCapture: !1
|
|
1270
1201
|
});
|
|
1271
1202
|
}, a = (s) => {
|
|
1272
|
-
const u =
|
|
1203
|
+
const u = y.current;
|
|
1273
1204
|
!u.dragging || u.source !== "pointer" || s.relatedTarget === null && t(s);
|
|
1274
|
-
},
|
|
1275
|
-
const u =
|
|
1205
|
+
}, c = (s) => {
|
|
1206
|
+
const u = y.current;
|
|
1276
1207
|
!u.dragging || u.source !== "pointer" || s.relatedTarget === null && t(s);
|
|
1277
1208
|
};
|
|
1278
|
-
return document.addEventListener("pointerout", a, !0), document.addEventListener("mouseout",
|
|
1209
|
+
return document.addEventListener("pointerout", a, !0), document.addEventListener("mouseout", c, !0), window.addEventListener("pointerup", t, !0), window.addEventListener(
|
|
1279
1210
|
"pointercancel",
|
|
1280
1211
|
t,
|
|
1281
1212
|
!0
|
|
@@ -1284,7 +1215,7 @@ function er({
|
|
|
1284
1215
|
"pointerout",
|
|
1285
1216
|
a,
|
|
1286
1217
|
!0
|
|
1287
|
-
), document.removeEventListener("mouseout",
|
|
1218
|
+
), document.removeEventListener("mouseout", c, !0), window.removeEventListener(
|
|
1288
1219
|
"pointerup",
|
|
1289
1220
|
t,
|
|
1290
1221
|
!0
|
|
@@ -1294,24 +1225,24 @@ function er({
|
|
|
1294
1225
|
!0
|
|
1295
1226
|
), window.removeEventListener("blur", e);
|
|
1296
1227
|
};
|
|
1297
|
-
}, [
|
|
1298
|
-
const
|
|
1299
|
-
const e =
|
|
1300
|
-
return e.touchId !== null ?
|
|
1301
|
-
}, []),
|
|
1228
|
+
}, [G, r]);
|
|
1229
|
+
const St = d((t) => {
|
|
1230
|
+
const e = y.current;
|
|
1231
|
+
return e.touchId !== null ? oe(t.changedTouches, e.touchId) ?? oe(t.touches, e.touchId) : t.touches[0] ?? t.changedTouches[0] ?? null;
|
|
1232
|
+
}, []), he = d(
|
|
1302
1233
|
(t) => {
|
|
1303
|
-
if (!r || o !== "bottom" && !
|
|
1234
|
+
if (!r || o !== "bottom" && !P || n === !1 || t.touches.length !== 1 || Lt(t.target)) return;
|
|
1304
1235
|
let e = !1;
|
|
1305
1236
|
if (n === "handle" && t.target instanceof Element && t.target.closest('[data-oc-part="handle"]'))
|
|
1306
1237
|
e = !0;
|
|
1307
1238
|
else if (n === "handle")
|
|
1308
1239
|
return;
|
|
1309
|
-
n === "content" && (e =
|
|
1240
|
+
n === "content" && (e = ne(t.target));
|
|
1310
1241
|
const a = t.touches[0];
|
|
1311
|
-
o === "bottom" &&
|
|
1242
|
+
o === "bottom" && mt({
|
|
1312
1243
|
target: t.target,
|
|
1313
1244
|
chrome: e
|
|
1314
|
-
}),
|
|
1245
|
+
}), wt({
|
|
1315
1246
|
chrome: e,
|
|
1316
1247
|
source: "touch",
|
|
1317
1248
|
startX: a.pageX,
|
|
@@ -1320,50 +1251,50 @@ function er({
|
|
|
1320
1251
|
});
|
|
1321
1252
|
},
|
|
1322
1253
|
[
|
|
1323
|
-
|
|
1254
|
+
wt,
|
|
1324
1255
|
n,
|
|
1325
1256
|
r,
|
|
1326
1257
|
o,
|
|
1327
|
-
|
|
1328
|
-
|
|
1258
|
+
P,
|
|
1259
|
+
mt
|
|
1329
1260
|
]
|
|
1330
|
-
),
|
|
1261
|
+
), Qt = d(
|
|
1331
1262
|
(t) => {
|
|
1332
|
-
const e =
|
|
1333
|
-
if (!e.dragging || e.source !== "touch" || !r || o !== "bottom" && !
|
|
1263
|
+
const e = y.current;
|
|
1264
|
+
if (!e.dragging || e.source !== "touch" || !r || o !== "bottom" && !P)
|
|
1334
1265
|
return;
|
|
1335
|
-
const a =
|
|
1266
|
+
const a = St(t);
|
|
1336
1267
|
if (!a) return;
|
|
1337
|
-
const
|
|
1338
|
-
deltaX:
|
|
1268
|
+
const c = a.pageX - e.startX, s = a.pageY - e.startY, u = ee({
|
|
1269
|
+
deltaX: c,
|
|
1339
1270
|
deltaY: s,
|
|
1340
1271
|
placement: o
|
|
1341
|
-
}),
|
|
1272
|
+
}), p = M.dragStartThresholdPx.touch, f = o === "bottom" ? Se({
|
|
1342
1273
|
target: t.target,
|
|
1343
1274
|
deltaY: s,
|
|
1344
1275
|
chrome: e.chrome,
|
|
1345
1276
|
bodyNode: H.current
|
|
1346
|
-
}) :
|
|
1277
|
+
}) : Ye({
|
|
1347
1278
|
target: t.target,
|
|
1348
1279
|
bodyNode: H.current
|
|
1349
1280
|
});
|
|
1350
1281
|
if (f.preventDefault) {
|
|
1351
|
-
const
|
|
1352
|
-
!
|
|
1282
|
+
const x = o === "bottom" && Math.abs(c) > Math.abs(s) && Math.abs(s) < p && !e.started && u < p;
|
|
1283
|
+
!x && o === "bottom" && mt({
|
|
1353
1284
|
target: t.target,
|
|
1354
1285
|
chrome: e.chrome
|
|
1355
|
-
}),
|
|
1286
|
+
}), x || Zt(t);
|
|
1356
1287
|
}
|
|
1357
1288
|
if (f.resetAnchor) {
|
|
1358
|
-
|
|
1289
|
+
R(!1), Kt(e, { x: a.pageX, y: a.pageY });
|
|
1359
1290
|
return;
|
|
1360
1291
|
}
|
|
1361
|
-
if (f.allowDrag && !(!e.started && u <
|
|
1362
|
-
if (e.allowed || (e.allowed = !0, e.started = !0), f.preventDefault ||
|
|
1363
|
-
|
|
1292
|
+
if (f.allowDrag && !(!e.started && u < p))
|
|
1293
|
+
if (e.allowed || (e.allowed = !0, e.started = !0), f.preventDefault || Zt(t), e.lastX = a.pageX, e.lastY = a.pageY, o === "popup")
|
|
1294
|
+
tt(e, a), ce(e, a);
|
|
1364
1295
|
else {
|
|
1365
|
-
const m = e.startTranslate + s,
|
|
1366
|
-
|
|
1296
|
+
const m = e.startTranslate + s, x = rt(e, s);
|
|
1297
|
+
Q(m, x), it(e, {
|
|
1367
1298
|
pageX: a.pageX,
|
|
1368
1299
|
pageY: a.pageY,
|
|
1369
1300
|
translateX: e.lastTranslateX,
|
|
@@ -1373,21 +1304,21 @@ function er({
|
|
|
1373
1304
|
},
|
|
1374
1305
|
[
|
|
1375
1306
|
r,
|
|
1376
|
-
nt,
|
|
1377
|
-
ot,
|
|
1378
|
-
Mt,
|
|
1379
|
-
o,
|
|
1380
|
-
D,
|
|
1381
|
-
Zt,
|
|
1382
|
-
J,
|
|
1383
1307
|
tt,
|
|
1384
|
-
|
|
1308
|
+
rt,
|
|
1309
|
+
St,
|
|
1310
|
+
o,
|
|
1311
|
+
P,
|
|
1312
|
+
Kt,
|
|
1313
|
+
R,
|
|
1314
|
+
Q,
|
|
1315
|
+
mt
|
|
1385
1316
|
]
|
|
1386
1317
|
);
|
|
1387
|
-
|
|
1388
|
-
if (!l || !r || o !== "bottom" && !
|
|
1318
|
+
At(() => {
|
|
1319
|
+
if (!l || !r || o !== "bottom" && !P || n === !1 || typeof window > "u") return;
|
|
1389
1320
|
const t = (e) => {
|
|
1390
|
-
|
|
1321
|
+
Qt(e);
|
|
1391
1322
|
};
|
|
1392
1323
|
return window.addEventListener("touchmove", t, {
|
|
1393
1324
|
capture: !0,
|
|
@@ -1395,104 +1326,104 @@ function er({
|
|
|
1395
1326
|
}), () => {
|
|
1396
1327
|
window.removeEventListener("touchmove", t, !0);
|
|
1397
1328
|
};
|
|
1398
|
-
}, [n, r,
|
|
1399
|
-
const
|
|
1329
|
+
}, [n, r, Qt, l, o, P]);
|
|
1330
|
+
const Te = d(
|
|
1400
1331
|
(t) => {
|
|
1401
|
-
const e =
|
|
1402
|
-
if (!e.dragging || e.source !== "touch" || !r || o !== "bottom" && !
|
|
1332
|
+
const e = y.current;
|
|
1333
|
+
if (!e.dragging || e.source !== "touch" || !r || o !== "bottom" && !P)
|
|
1403
1334
|
return;
|
|
1404
|
-
const a =
|
|
1405
|
-
o === "popup" &&
|
|
1406
|
-
const
|
|
1335
|
+
const a = St(t), c = a?.pageX ?? e.lastX, s = a?.pageY ?? e.lastY, u = e.started, p = e.closeAllowed, f = c - e.startX, m = s - e.startY, x = Math.max(ct() - e.startTime, 1);
|
|
1336
|
+
o === "popup" && Z();
|
|
1337
|
+
const C = {
|
|
1407
1338
|
x: e.lastTranslateX,
|
|
1408
1339
|
y: e.lastTranslate
|
|
1409
1340
|
}, z = e.startTranslate;
|
|
1410
1341
|
if (u) {
|
|
1411
|
-
const
|
|
1412
|
-
pageX:
|
|
1342
|
+
const L = o === "popup" ? Yt(e, {
|
|
1343
|
+
pageX: c,
|
|
1413
1344
|
pageY: s
|
|
1414
1345
|
}) : {
|
|
1415
1346
|
x: e.lastTranslateX,
|
|
1416
1347
|
y: e.lastTranslate
|
|
1417
1348
|
};
|
|
1418
|
-
|
|
1419
|
-
pageX:
|
|
1349
|
+
it(e, {
|
|
1350
|
+
pageX: c,
|
|
1420
1351
|
pageY: s,
|
|
1421
|
-
translateX:
|
|
1422
|
-
translateY:
|
|
1352
|
+
translateX: L.x,
|
|
1353
|
+
translateY: L.y
|
|
1423
1354
|
});
|
|
1424
1355
|
}
|
|
1425
|
-
if (
|
|
1356
|
+
if (et(e), !!u)
|
|
1426
1357
|
if (o === "popup") {
|
|
1427
|
-
const
|
|
1358
|
+
const L = ue({
|
|
1428
1359
|
session: e,
|
|
1429
1360
|
fallbackDelta: { x: f, y: m },
|
|
1430
|
-
fallbackElapsed:
|
|
1361
|
+
fallbackElapsed: x
|
|
1431
1362
|
});
|
|
1432
|
-
|
|
1433
|
-
currentTranslate:
|
|
1434
|
-
releaseVelocity:
|
|
1363
|
+
Dt({
|
|
1364
|
+
currentTranslate: C,
|
|
1365
|
+
releaseVelocity: L
|
|
1435
1366
|
});
|
|
1436
1367
|
} else {
|
|
1437
|
-
const
|
|
1368
|
+
const L = ie({
|
|
1438
1369
|
session: e,
|
|
1439
1370
|
fallbackDeltaY: m,
|
|
1440
|
-
fallbackElapsed:
|
|
1371
|
+
fallbackElapsed: x
|
|
1441
1372
|
});
|
|
1442
|
-
|
|
1443
|
-
closeAllowed:
|
|
1444
|
-
currentTranslate:
|
|
1373
|
+
Xt({
|
|
1374
|
+
closeAllowed: p,
|
|
1375
|
+
currentTranslate: C.y,
|
|
1445
1376
|
deltaY: m,
|
|
1446
|
-
releaseVelocity:
|
|
1377
|
+
releaseVelocity: L,
|
|
1447
1378
|
startTranslate: z
|
|
1448
1379
|
});
|
|
1449
1380
|
}
|
|
1450
1381
|
},
|
|
1451
1382
|
[
|
|
1452
|
-
|
|
1453
|
-
|
|
1383
|
+
Xt,
|
|
1384
|
+
Dt,
|
|
1454
1385
|
r,
|
|
1455
|
-
|
|
1386
|
+
St,
|
|
1456
1387
|
o,
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1388
|
+
P,
|
|
1389
|
+
et,
|
|
1390
|
+
Z
|
|
1460
1391
|
]
|
|
1461
|
-
),
|
|
1462
|
-
const t =
|
|
1392
|
+
), ye = d(() => {
|
|
1393
|
+
const t = y.current;
|
|
1463
1394
|
if (!t.dragging || t.source !== "touch") return;
|
|
1464
|
-
const e = t.started, a = t.startTranslate,
|
|
1395
|
+
const e = t.started, a = t.startTranslate, c = t.lastTranslate, s = {
|
|
1465
1396
|
x: t.startTranslateX,
|
|
1466
1397
|
y: t.startTranslate
|
|
1467
1398
|
}, u = {
|
|
1468
1399
|
x: t.lastTranslateX,
|
|
1469
1400
|
y: t.lastTranslate
|
|
1470
|
-
},
|
|
1471
|
-
if (
|
|
1472
|
-
if (
|
|
1473
|
-
V.current ?
|
|
1401
|
+
}, p = o;
|
|
1402
|
+
if (et(t), !!e) {
|
|
1403
|
+
if (p === "popup") {
|
|
1404
|
+
V.current ? xt(s) : W(s, { from: u });
|
|
1474
1405
|
return;
|
|
1475
1406
|
}
|
|
1476
|
-
|
|
1407
|
+
A(a, { from: c });
|
|
1477
1408
|
}
|
|
1478
1409
|
}, [
|
|
1479
1410
|
o,
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1411
|
+
et,
|
|
1412
|
+
xt,
|
|
1413
|
+
W,
|
|
1414
|
+
A
|
|
1484
1415
|
]);
|
|
1485
1416
|
return {
|
|
1486
|
-
onPointerDown:
|
|
1487
|
-
onPointerMove:
|
|
1488
|
-
onPointerUp:
|
|
1489
|
-
onPointerCancel:
|
|
1490
|
-
onLostPointerCapture:
|
|
1491
|
-
onTouchStart:
|
|
1492
|
-
onTouchEnd:
|
|
1493
|
-
onTouchCancel:
|
|
1417
|
+
onPointerDown: fe,
|
|
1418
|
+
onPointerMove: ge,
|
|
1419
|
+
onPointerUp: Jt,
|
|
1420
|
+
onPointerCancel: Jt,
|
|
1421
|
+
onLostPointerCapture: me,
|
|
1422
|
+
onTouchStart: he,
|
|
1423
|
+
onTouchEnd: Te,
|
|
1424
|
+
onTouchCancel: ye
|
|
1494
1425
|
};
|
|
1495
1426
|
}
|
|
1496
1427
|
export {
|
|
1497
|
-
|
|
1428
|
+
Ke as useModalDrag
|
|
1498
1429
|
};
|