st-comp 0.0.166 → 0.0.168
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/es/KlinePlus.cjs +3 -3
- package/es/KlinePlus.js +440 -397
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +2906 -163
- package/es/VarietySearch.cjs +1 -3
- package/es/VarietySearch.js +895 -1152
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +202 -204
- package/lib/{index-80531492.js → index-89cc73f4.js} +24051 -24262
- package/lib/{python-20a1a5fc.js → python-dcf91e91.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlinePlus/index.vue +40 -6
- package/packages/KlinePlus/utils.js +24 -1
- package/packages/VarietySearch/components/FactorScreen/index.vue +4 -5
- package/src/pages/KlinePlus/index.vue +25 -6
- package/es/el-autocomplete-5064d466.js +0 -2759
- package/es/el-autocomplete-814993af.cjs +0 -1
- package/packages/VarietySearch/components/FactorScreen/ScriptSelect.vue +0 -303
- package/packages/VarietySearch/components/FactorScreen/VarietySelect.vue +0 -78
package/es/VarSelectDialog.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import "./base-4bcd2756.js";
|
|
1
|
+
import { k as gi, m as Wn, N as mi, a as Ht, c as yi, u as bi, _ as xi, o as Gt, t as wi, w as _i } from "./base-4bcd2756.js";
|
|
2
2
|
import "./el-tooltip-4ed993c7.js";
|
|
3
|
-
import { E as
|
|
4
|
-
import { E as
|
|
5
|
-
import { E as
|
|
3
|
+
import { b as Ei, u as Si, E as Un, a as Ti } from "./el-popper-85365d5b.js";
|
|
4
|
+
import { E as ki } from "./el-button-d39472d3.js";
|
|
5
|
+
import { u as Pi, E as Hn } from "./el-input-42315ac4.js";
|
|
6
6
|
import "./el-tag-6036f51c.js";
|
|
7
|
-
import { E as
|
|
8
|
-
import "./el-scrollbar-bcf29780.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { V as
|
|
13
|
-
import { _ as
|
|
14
|
-
import {
|
|
15
|
-
import "./
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
7
|
+
import { E as Oi, a as Ii } from "./el-select-d3bce4d1.js";
|
|
8
|
+
import { o as Di } from "./el-scrollbar-bcf29780.js";
|
|
9
|
+
import { defineComponent as Gn, useAttrs as Mi, ref as H, computed as it, onBeforeUnmount as zi, onMounted as Kn, openBlock as V, createBlock as ot, unref as M, withCtx as ae, createElementVNode as ve, normalizeClass as Et, normalizeStyle as Kt, createVNode as pe, createElementBlock as Z, renderSlot as We, Fragment as Fe, renderList as at, createTextVNode as Jn, toDisplayString as Xe, mergeProps as Ai, withKeys as rt, withModifiers as Xn, createSlots as Ci, inject as Qn, createCommentVNode as Te, withDirectives as Ri, vShow as ji, pushScopeId as Fi, popScopeId as Vi } from "vue";
|
|
10
|
+
import { g as $i, c as Ni } from "./_commonjsHelpers-10dfc225.js";
|
|
11
|
+
import { E as Zn, l as Bi, c as Li, i as Wi } from "./index-3425f2f0.js";
|
|
12
|
+
import { V as Xi } from "./index-7ed0999e.js";
|
|
13
|
+
import { _ as er } from "./_plugin-vue_export-helper-dad06003.js";
|
|
14
|
+
import { U as St, I as Jt, C as tr } from "./index-21fb27eb.js";
|
|
15
|
+
import { d as Yi } from "./use-form-common-props-54c31983.js";
|
|
16
|
+
import { u as qi } from "./index-ef7c4392.js";
|
|
17
|
+
import { d as Ui } from "./debounce-51046b06.js";
|
|
18
|
+
import { E as Yn } from "./el-message-bd1d2c82.js";
|
|
18
19
|
import "./index-c45ac024.js";
|
|
19
20
|
import "./use-global-config-946f61a4.js";
|
|
20
21
|
import "./index-657047bb.js";
|
|
@@ -23,10 +24,2752 @@ import "./index-fbe85773.js";
|
|
|
23
24
|
import "./index-d3c37134.js";
|
|
24
25
|
import "./castArray-681d750b.js";
|
|
25
26
|
import "./scroll-0277d145.js";
|
|
26
|
-
import "./debounce-51046b06.js";
|
|
27
|
-
import "./_commonjsHelpers-10dfc225.js";
|
|
28
27
|
import "./config-provider-93846ae3.js";
|
|
29
|
-
const
|
|
28
|
+
const Hi = gi({
|
|
29
|
+
valueKey: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "value"
|
|
32
|
+
},
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: [String, Number],
|
|
35
|
+
default: ""
|
|
36
|
+
},
|
|
37
|
+
debounce: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 300
|
|
40
|
+
},
|
|
41
|
+
placement: {
|
|
42
|
+
type: Wn(String),
|
|
43
|
+
values: [
|
|
44
|
+
"top",
|
|
45
|
+
"top-start",
|
|
46
|
+
"top-end",
|
|
47
|
+
"bottom",
|
|
48
|
+
"bottom-start",
|
|
49
|
+
"bottom-end"
|
|
50
|
+
],
|
|
51
|
+
default: "bottom-start"
|
|
52
|
+
},
|
|
53
|
+
fetchSuggestions: {
|
|
54
|
+
type: Wn([Function, Array]),
|
|
55
|
+
default: mi
|
|
56
|
+
},
|
|
57
|
+
popperClass: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ""
|
|
60
|
+
},
|
|
61
|
+
triggerOnFocus: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
},
|
|
65
|
+
selectWhenUnmatched: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !1
|
|
68
|
+
},
|
|
69
|
+
hideLoading: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: !1
|
|
72
|
+
},
|
|
73
|
+
teleported: Ei.teleported,
|
|
74
|
+
highlightFirstItem: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !1
|
|
77
|
+
},
|
|
78
|
+
fitInputWidth: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: !1
|
|
81
|
+
},
|
|
82
|
+
clearable: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: !1
|
|
85
|
+
},
|
|
86
|
+
disabled: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !1
|
|
89
|
+
},
|
|
90
|
+
name: String,
|
|
91
|
+
...Si(["ariaLabel"])
|
|
92
|
+
}), Gi = {
|
|
93
|
+
[St]: (I) => Ht(I),
|
|
94
|
+
[Jt]: (I) => Ht(I),
|
|
95
|
+
[tr]: (I) => Ht(I),
|
|
96
|
+
focus: (I) => I instanceof FocusEvent,
|
|
97
|
+
blur: (I) => I instanceof FocusEvent,
|
|
98
|
+
clear: () => !0,
|
|
99
|
+
select: (I) => yi(I)
|
|
100
|
+
}, nr = "ElAutocomplete", Ki = Gn({
|
|
101
|
+
name: nr,
|
|
102
|
+
inheritAttrs: !1
|
|
103
|
+
}), Ji = /* @__PURE__ */ Gn({
|
|
104
|
+
...Ki,
|
|
105
|
+
props: Hi,
|
|
106
|
+
emits: Gi,
|
|
107
|
+
setup(I, { expose: Ve, emit: Y }) {
|
|
108
|
+
const z = I, ne = Pi(), A = Mi(), he = Yi(), P = bi("autocomplete"), F = H(), W = H(), C = H(), ee = H();
|
|
109
|
+
let J = !1, le = !1;
|
|
110
|
+
const $ = H([]), O = H(-1), q = H(""), N = H(!1), R = H(!1), B = H(!1), X = qi(), re = it(() => A.style), U = it(() => ($.value.length > 0 || B.value) && N.value), d = it(() => !z.hideLoading && B.value), G = it(() => F.value ? Array.from(F.value.$el.querySelectorAll("input")) : []), D = () => {
|
|
111
|
+
U.value && (q.value = `${F.value.$el.offsetWidth}px`);
|
|
112
|
+
}, ge = () => {
|
|
113
|
+
O.value = -1;
|
|
114
|
+
}, te = async (x) => {
|
|
115
|
+
if (R.value)
|
|
116
|
+
return;
|
|
117
|
+
const L = (y) => {
|
|
118
|
+
B.value = !1, !R.value && (Gt(y) ? ($.value = y, O.value = z.highlightFirstItem ? 0 : -1) : wi(nr, "autocomplete suggestions must be an array"));
|
|
119
|
+
};
|
|
120
|
+
if (B.value = !0, Gt(z.fetchSuggestions))
|
|
121
|
+
L(z.fetchSuggestions);
|
|
122
|
+
else {
|
|
123
|
+
const y = await z.fetchSuggestions(x, L);
|
|
124
|
+
Gt(y) && L(y);
|
|
125
|
+
}
|
|
126
|
+
}, Q = Ui(te, z.debounce), ke = (x) => {
|
|
127
|
+
const L = !!x;
|
|
128
|
+
if (Y(Jt, x), Y(St, x), R.value = !1, N.value || (N.value = L), !z.triggerOnFocus && !x) {
|
|
129
|
+
R.value = !0, $.value = [];
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
Q(x);
|
|
133
|
+
}, K = (x) => {
|
|
134
|
+
var L;
|
|
135
|
+
he.value || (((L = x.target) == null ? void 0 : L.tagName) !== "INPUT" || G.value.includes(document.activeElement)) && (N.value = !0);
|
|
136
|
+
}, se = (x) => {
|
|
137
|
+
Y(tr, x);
|
|
138
|
+
}, ce = (x) => {
|
|
139
|
+
le ? le = !1 : (N.value = !0, Y("focus", x), z.triggerOnFocus && !J && Q(String(z.modelValue)));
|
|
140
|
+
}, ye = (x) => {
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
var L;
|
|
143
|
+
if ((L = C.value) != null && L.isFocusInsideContent()) {
|
|
144
|
+
le = !0;
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
N.value && be(), Y("blur", x);
|
|
148
|
+
});
|
|
149
|
+
}, st = () => {
|
|
150
|
+
N.value = !1, Y(St, ""), Y("clear");
|
|
151
|
+
}, de = async () => {
|
|
152
|
+
U.value && O.value >= 0 && O.value < $.value.length ? $e($.value[O.value]) : z.selectWhenUnmatched && (Y("select", { value: z.modelValue }), $.value = [], O.value = -1);
|
|
153
|
+
}, me = (x) => {
|
|
154
|
+
U.value && (x.preventDefault(), x.stopPropagation(), be());
|
|
155
|
+
}, be = () => {
|
|
156
|
+
N.value = !1;
|
|
157
|
+
}, lt = () => {
|
|
158
|
+
var x;
|
|
159
|
+
(x = F.value) == null || x.focus();
|
|
160
|
+
}, Ye = () => {
|
|
161
|
+
var x;
|
|
162
|
+
(x = F.value) == null || x.blur();
|
|
163
|
+
}, $e = async (x) => {
|
|
164
|
+
Y(Jt, x[z.valueKey]), Y(St, x[z.valueKey]), Y("select", x), $.value = [], O.value = -1;
|
|
165
|
+
}, Me = (x) => {
|
|
166
|
+
if (!U.value || B.value)
|
|
167
|
+
return;
|
|
168
|
+
if (x < 0) {
|
|
169
|
+
O.value = -1;
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
x >= $.value.length && (x = $.value.length - 1);
|
|
173
|
+
const L = W.value.querySelector(`.${P.be("suggestion", "wrap")}`), xe = L.querySelectorAll(`.${P.be("suggestion", "list")} li`)[x], we = L.scrollTop, { offsetTop: ze, scrollHeight: Ae } = xe;
|
|
174
|
+
ze + Ae > we + L.clientHeight && (L.scrollTop += Ae), ze < we && (L.scrollTop -= Ae), O.value = x, F.value.ref.setAttribute("aria-activedescendant", `${X.value}-item-${O.value}`);
|
|
175
|
+
}, Ne = Di(ee, () => {
|
|
176
|
+
var x;
|
|
177
|
+
(x = C.value) != null && x.isFocusInsideContent() || U.value && be();
|
|
178
|
+
});
|
|
179
|
+
return zi(() => {
|
|
180
|
+
Ne == null || Ne();
|
|
181
|
+
}), Kn(() => {
|
|
182
|
+
F.value.ref.setAttribute("role", "textbox"), F.value.ref.setAttribute("aria-autocomplete", "list"), F.value.ref.setAttribute("aria-controls", "id"), F.value.ref.setAttribute("aria-activedescendant", `${X.value}-item-${O.value}`), J = F.value.ref.hasAttribute("readonly");
|
|
183
|
+
}), Ve({
|
|
184
|
+
highlightedIndex: O,
|
|
185
|
+
activated: N,
|
|
186
|
+
loading: B,
|
|
187
|
+
inputRef: F,
|
|
188
|
+
popperRef: C,
|
|
189
|
+
suggestions: $,
|
|
190
|
+
handleSelect: $e,
|
|
191
|
+
handleKeyEnter: de,
|
|
192
|
+
focus: lt,
|
|
193
|
+
blur: Ye,
|
|
194
|
+
close: be,
|
|
195
|
+
highlight: Me,
|
|
196
|
+
getData: te
|
|
197
|
+
}), (x, L) => (V(), ot(M(Un), {
|
|
198
|
+
ref_key: "popperRef",
|
|
199
|
+
ref: C,
|
|
200
|
+
visible: M(U),
|
|
201
|
+
placement: x.placement,
|
|
202
|
+
"fallback-placements": ["bottom-start", "top-start"],
|
|
203
|
+
"popper-class": [M(P).e("popper"), x.popperClass],
|
|
204
|
+
teleported: x.teleported,
|
|
205
|
+
"gpu-acceleration": !1,
|
|
206
|
+
pure: "",
|
|
207
|
+
"manual-mode": "",
|
|
208
|
+
effect: "light",
|
|
209
|
+
trigger: "click",
|
|
210
|
+
transition: `${M(P).namespace.value}-zoom-in-top`,
|
|
211
|
+
persistent: "",
|
|
212
|
+
role: "listbox",
|
|
213
|
+
onBeforeShow: D,
|
|
214
|
+
onHide: ge
|
|
215
|
+
}, {
|
|
216
|
+
content: ae(() => [
|
|
217
|
+
ve("div", {
|
|
218
|
+
ref_key: "regionRef",
|
|
219
|
+
ref: W,
|
|
220
|
+
class: Et([M(P).b("suggestion"), M(P).is("loading", M(d))]),
|
|
221
|
+
style: Kt({
|
|
222
|
+
[x.fitInputWidth ? "width" : "minWidth"]: q.value,
|
|
223
|
+
outline: "none"
|
|
224
|
+
}),
|
|
225
|
+
role: "region"
|
|
226
|
+
}, [
|
|
227
|
+
pe(M(Ti), {
|
|
228
|
+
id: M(X),
|
|
229
|
+
tag: "ul",
|
|
230
|
+
"wrap-class": M(P).be("suggestion", "wrap"),
|
|
231
|
+
"view-class": M(P).be("suggestion", "list"),
|
|
232
|
+
role: "listbox"
|
|
233
|
+
}, {
|
|
234
|
+
default: ae(() => [
|
|
235
|
+
M(d) ? (V(), Z("li", { key: 0 }, [
|
|
236
|
+
We(x.$slots, "loading", {}, () => [
|
|
237
|
+
pe(M(Zn), {
|
|
238
|
+
class: Et(M(P).is("loading"))
|
|
239
|
+
}, {
|
|
240
|
+
default: ae(() => [
|
|
241
|
+
pe(M(Bi))
|
|
242
|
+
]),
|
|
243
|
+
_: 1
|
|
244
|
+
}, 8, ["class"])
|
|
245
|
+
])
|
|
246
|
+
])) : (V(!0), Z(Fe, { key: 1 }, at($.value, (y, xe) => (V(), Z("li", {
|
|
247
|
+
id: `${M(X)}-item-${xe}`,
|
|
248
|
+
key: xe,
|
|
249
|
+
class: Et({ highlighted: O.value === xe }),
|
|
250
|
+
role: "option",
|
|
251
|
+
"aria-selected": O.value === xe,
|
|
252
|
+
onClick: (we) => $e(y)
|
|
253
|
+
}, [
|
|
254
|
+
We(x.$slots, "default", { item: y }, () => [
|
|
255
|
+
Jn(Xe(y[x.valueKey]), 1)
|
|
256
|
+
])
|
|
257
|
+
], 10, ["id", "aria-selected", "onClick"]))), 128))
|
|
258
|
+
]),
|
|
259
|
+
_: 3
|
|
260
|
+
}, 8, ["id", "wrap-class", "view-class"])
|
|
261
|
+
], 6)
|
|
262
|
+
]),
|
|
263
|
+
default: ae(() => [
|
|
264
|
+
ve("div", {
|
|
265
|
+
ref_key: "listboxRef",
|
|
266
|
+
ref: ee,
|
|
267
|
+
class: Et([M(P).b(), x.$attrs.class]),
|
|
268
|
+
style: Kt(M(re)),
|
|
269
|
+
role: "combobox",
|
|
270
|
+
"aria-haspopup": "listbox",
|
|
271
|
+
"aria-expanded": M(U),
|
|
272
|
+
"aria-owns": M(X)
|
|
273
|
+
}, [
|
|
274
|
+
pe(M(Hn), Ai({
|
|
275
|
+
ref_key: "inputRef",
|
|
276
|
+
ref: F
|
|
277
|
+
}, M(ne), {
|
|
278
|
+
clearable: x.clearable,
|
|
279
|
+
disabled: M(he),
|
|
280
|
+
name: x.name,
|
|
281
|
+
"model-value": x.modelValue,
|
|
282
|
+
"aria-label": x.ariaLabel,
|
|
283
|
+
onInput: ke,
|
|
284
|
+
onChange: se,
|
|
285
|
+
onFocus: ce,
|
|
286
|
+
onBlur: ye,
|
|
287
|
+
onClear: st,
|
|
288
|
+
onKeydown: [
|
|
289
|
+
rt(Xn((y) => Me(O.value - 1), ["prevent"]), ["up"]),
|
|
290
|
+
rt(Xn((y) => Me(O.value + 1), ["prevent"]), ["down"]),
|
|
291
|
+
rt(de, ["enter"]),
|
|
292
|
+
rt(be, ["tab"]),
|
|
293
|
+
rt(me, ["esc"])
|
|
294
|
+
],
|
|
295
|
+
onMousedown: K
|
|
296
|
+
}), Ci({
|
|
297
|
+
_: 2
|
|
298
|
+
}, [
|
|
299
|
+
x.$slots.prepend ? {
|
|
300
|
+
name: "prepend",
|
|
301
|
+
fn: ae(() => [
|
|
302
|
+
We(x.$slots, "prepend")
|
|
303
|
+
])
|
|
304
|
+
} : void 0,
|
|
305
|
+
x.$slots.append ? {
|
|
306
|
+
name: "append",
|
|
307
|
+
fn: ae(() => [
|
|
308
|
+
We(x.$slots, "append")
|
|
309
|
+
])
|
|
310
|
+
} : void 0,
|
|
311
|
+
x.$slots.prefix ? {
|
|
312
|
+
name: "prefix",
|
|
313
|
+
fn: ae(() => [
|
|
314
|
+
We(x.$slots, "prefix")
|
|
315
|
+
])
|
|
316
|
+
} : void 0,
|
|
317
|
+
x.$slots.suffix ? {
|
|
318
|
+
name: "suffix",
|
|
319
|
+
fn: ae(() => [
|
|
320
|
+
We(x.$slots, "suffix")
|
|
321
|
+
])
|
|
322
|
+
} : void 0
|
|
323
|
+
]), 1040, ["clearable", "disabled", "name", "model-value", "aria-label", "onKeydown"])
|
|
324
|
+
], 14, ["aria-expanded", "aria-owns"])
|
|
325
|
+
]),
|
|
326
|
+
_: 3
|
|
327
|
+
}, 8, ["visible", "placement", "popper-class", "teleported", "transition"]));
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
var Qi = /* @__PURE__ */ xi(Ji, [["__file", "autocomplete.vue"]]);
|
|
331
|
+
const Zi = _i(Qi);
|
|
332
|
+
var Tt = { exports: {} };
|
|
333
|
+
Tt.exports;
|
|
334
|
+
(function(I, Ve) {
|
|
335
|
+
(function(Y, z) {
|
|
336
|
+
I.exports = z();
|
|
337
|
+
})(Ni, function() {
|
|
338
|
+
function Y(t, e) {
|
|
339
|
+
var n = Object.keys(t);
|
|
340
|
+
if (Object.getOwnPropertySymbols) {
|
|
341
|
+
var r = Object.getOwnPropertySymbols(t);
|
|
342
|
+
e && (r = r.filter(function(i) {
|
|
343
|
+
return Object.getOwnPropertyDescriptor(t, i).enumerable;
|
|
344
|
+
})), n.push.apply(n, r);
|
|
345
|
+
}
|
|
346
|
+
return n;
|
|
347
|
+
}
|
|
348
|
+
function z(t) {
|
|
349
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
350
|
+
var n = arguments[e] != null ? arguments[e] : {};
|
|
351
|
+
e % 2 ? Y(Object(n), !0).forEach(function(r) {
|
|
352
|
+
F(t, r, n[r]);
|
|
353
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Y(Object(n)).forEach(function(r) {
|
|
354
|
+
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return t;
|
|
358
|
+
}
|
|
359
|
+
function ne(t) {
|
|
360
|
+
return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
361
|
+
return typeof e;
|
|
362
|
+
} : function(e) {
|
|
363
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
364
|
+
}, ne(t);
|
|
365
|
+
}
|
|
366
|
+
function A(t, e) {
|
|
367
|
+
if (!(t instanceof e))
|
|
368
|
+
throw new TypeError("Cannot call a class as a function");
|
|
369
|
+
}
|
|
370
|
+
function he(t, e) {
|
|
371
|
+
for (var n = 0; n < e.length; n++) {
|
|
372
|
+
var r = e[n];
|
|
373
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, O(r.key), r);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
function P(t, e, n) {
|
|
377
|
+
return e && he(t.prototype, e), n && he(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
378
|
+
}
|
|
379
|
+
function F(t, e, n) {
|
|
380
|
+
return (e = O(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
381
|
+
}
|
|
382
|
+
function W(t, e) {
|
|
383
|
+
if (typeof e != "function" && e !== null)
|
|
384
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
385
|
+
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && ee(t, e);
|
|
386
|
+
}
|
|
387
|
+
function C(t) {
|
|
388
|
+
return C = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
389
|
+
return e.__proto__ || Object.getPrototypeOf(e);
|
|
390
|
+
}, C(t);
|
|
391
|
+
}
|
|
392
|
+
function ee(t, e) {
|
|
393
|
+
return ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
394
|
+
return n.__proto__ = r, n;
|
|
395
|
+
}, ee(t, e);
|
|
396
|
+
}
|
|
397
|
+
function J(t) {
|
|
398
|
+
if (t === void 0)
|
|
399
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
400
|
+
return t;
|
|
401
|
+
}
|
|
402
|
+
function le(t) {
|
|
403
|
+
var e = function() {
|
|
404
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
405
|
+
return !1;
|
|
406
|
+
if (typeof Proxy == "function")
|
|
407
|
+
return !0;
|
|
408
|
+
try {
|
|
409
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
410
|
+
})), !0;
|
|
411
|
+
} catch {
|
|
412
|
+
return !1;
|
|
413
|
+
}
|
|
414
|
+
}();
|
|
415
|
+
return function() {
|
|
416
|
+
var n, r = C(t);
|
|
417
|
+
if (e) {
|
|
418
|
+
var i = C(this).constructor;
|
|
419
|
+
n = Reflect.construct(r, arguments, i);
|
|
420
|
+
} else
|
|
421
|
+
n = r.apply(this, arguments);
|
|
422
|
+
return function(o, a) {
|
|
423
|
+
if (a && (typeof a == "object" || typeof a == "function"))
|
|
424
|
+
return a;
|
|
425
|
+
if (a !== void 0)
|
|
426
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
427
|
+
return J(o);
|
|
428
|
+
}(this, n);
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
function $() {
|
|
432
|
+
return $ = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
|
|
433
|
+
var r = function(o, a) {
|
|
434
|
+
for (; !Object.prototype.hasOwnProperty.call(o, a) && (o = C(o)) !== null; )
|
|
435
|
+
;
|
|
436
|
+
return o;
|
|
437
|
+
}(t, e);
|
|
438
|
+
if (r) {
|
|
439
|
+
var i = Object.getOwnPropertyDescriptor(r, e);
|
|
440
|
+
return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value;
|
|
441
|
+
}
|
|
442
|
+
}, $.apply(this, arguments);
|
|
443
|
+
}
|
|
444
|
+
function O(t) {
|
|
445
|
+
var e = function(n, r) {
|
|
446
|
+
if (typeof n != "object" || n === null)
|
|
447
|
+
return n;
|
|
448
|
+
var i = n[Symbol.toPrimitive];
|
|
449
|
+
if (i !== void 0) {
|
|
450
|
+
var o = i.call(n, r || "default");
|
|
451
|
+
if (typeof o != "object")
|
|
452
|
+
return o;
|
|
453
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
454
|
+
}
|
|
455
|
+
return (r === "string" ? String : Number)(n);
|
|
456
|
+
}(t, "string");
|
|
457
|
+
return typeof e == "symbol" ? e : e + "";
|
|
458
|
+
}
|
|
459
|
+
var q = function(t) {
|
|
460
|
+
return !(!t || !t.Window) && t instanceof t.Window;
|
|
461
|
+
}, N = void 0, R = void 0;
|
|
462
|
+
function B(t) {
|
|
463
|
+
N = t;
|
|
464
|
+
var e = t.document.createTextNode("");
|
|
465
|
+
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), R = t;
|
|
466
|
+
}
|
|
467
|
+
function X(t) {
|
|
468
|
+
return q(t) ? t : (t.ownerDocument || t).defaultView || R.window;
|
|
469
|
+
}
|
|
470
|
+
typeof window < "u" && window && B(window);
|
|
471
|
+
var re = function(t) {
|
|
472
|
+
return !!t && ne(t) === "object";
|
|
473
|
+
}, U = function(t) {
|
|
474
|
+
return typeof t == "function";
|
|
475
|
+
}, d = { window: function(t) {
|
|
476
|
+
return t === R || q(t);
|
|
477
|
+
}, docFrag: function(t) {
|
|
478
|
+
return re(t) && t.nodeType === 11;
|
|
479
|
+
}, object: re, func: U, number: function(t) {
|
|
480
|
+
return typeof t == "number";
|
|
481
|
+
}, bool: function(t) {
|
|
482
|
+
return typeof t == "boolean";
|
|
483
|
+
}, string: function(t) {
|
|
484
|
+
return typeof t == "string";
|
|
485
|
+
}, element: function(t) {
|
|
486
|
+
if (!t || ne(t) !== "object")
|
|
487
|
+
return !1;
|
|
488
|
+
var e = X(t) || R;
|
|
489
|
+
return /object|function/.test(typeof Element > "u" ? "undefined" : ne(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
|
|
490
|
+
}, plainObject: function(t) {
|
|
491
|
+
return re(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
|
|
492
|
+
}, array: function(t) {
|
|
493
|
+
return re(t) && t.length !== void 0 && U(t.splice);
|
|
494
|
+
} };
|
|
495
|
+
function G(t) {
|
|
496
|
+
var e = t.interaction;
|
|
497
|
+
if (e.prepared.name === "drag") {
|
|
498
|
+
var n = e.prepared.axis;
|
|
499
|
+
n === "x" ? (e.coords.cur.page.y = e.coords.start.page.y, e.coords.cur.client.y = e.coords.start.client.y, e.coords.velocity.client.y = 0, e.coords.velocity.page.y = 0) : n === "y" && (e.coords.cur.page.x = e.coords.start.page.x, e.coords.cur.client.x = e.coords.start.client.x, e.coords.velocity.client.x = 0, e.coords.velocity.page.x = 0);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function D(t) {
|
|
503
|
+
var e = t.iEvent, n = t.interaction;
|
|
504
|
+
if (n.prepared.name === "drag") {
|
|
505
|
+
var r = n.prepared.axis;
|
|
506
|
+
if (r === "x" || r === "y") {
|
|
507
|
+
var i = r === "x" ? "y" : "x";
|
|
508
|
+
e.page[i] = n.coords.start.page[i], e.client[i] = n.coords.start.client[i], e.delta[i] = 0;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
var ge = { id: "actions/drag", install: function(t) {
|
|
513
|
+
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
514
|
+
n.prototype.draggable = ge.draggable, e.map.drag = ge, e.methodDict.drag = "draggable", r.actions.drag = ge.defaults;
|
|
515
|
+
}, listeners: { "interactions:before-action-move": G, "interactions:action-resume": G, "interactions:action-move": D, "auto-start:check": function(t) {
|
|
516
|
+
var e = t.interaction, n = t.interactable, r = t.buttons, i = n.options.drag;
|
|
517
|
+
if (i && i.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || r & n.options.drag.mouseButtons))
|
|
518
|
+
return t.action = { name: "drag", axis: i.lockAxis === "start" ? i.startAxis : i.lockAxis }, !1;
|
|
519
|
+
} }, draggable: function(t) {
|
|
520
|
+
return d.object(t) ? (this.options.drag.enabled = t.enabled !== !1, this.setPerAction("drag", t), this.setOnEvents("drag", t), /^(xy|x|y|start)$/.test(t.lockAxis) && (this.options.drag.lockAxis = t.lockAxis), /^(xy|x|y)$/.test(t.startAxis) && (this.options.drag.startAxis = t.startAxis), this) : d.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
|
|
521
|
+
}, beforeMove: G, move: D, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
|
522
|
+
return "move";
|
|
523
|
+
}, filterEventType: function(t) {
|
|
524
|
+
return t.search("drag") === 0;
|
|
525
|
+
} }, te = ge, Q = { init: function(t) {
|
|
526
|
+
var e = t;
|
|
527
|
+
Q.document = e.document, Q.DocumentFragment = e.DocumentFragment || ke, Q.SVGElement = e.SVGElement || ke, Q.SVGSVGElement = e.SVGSVGElement || ke, Q.SVGElementInstance = e.SVGElementInstance || ke, Q.Element = e.Element || ke, Q.HTMLElement = e.HTMLElement || Q.Element, Q.Event = e.Event, Q.Touch = e.Touch || ke, Q.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
528
|
+
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
529
|
+
function ke() {
|
|
530
|
+
}
|
|
531
|
+
var K = Q, se = { init: function(t) {
|
|
532
|
+
var e = K.Element, n = t.navigator || {};
|
|
533
|
+
se.supportsTouch = "ontouchstart" in t || d.func(t.DocumentTouch) && K.document instanceof t.DocumentTouch, se.supportsPointerEvent = n.pointerEnabled !== !1 && !!K.PointerEvent, se.isIOS = /iP(hone|od|ad)/.test(n.platform), se.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), se.isIe9 = /MSIE 9/.test(n.userAgent), se.isOperaMobile = n.appName === "Opera" && se.supportsTouch && /Presto/.test(n.userAgent), se.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", se.pEventTypes = se.supportsPointerEvent ? K.PointerEvent === t.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, se.wheelEvent = K.document && "onmousewheel" in K.document ? "mousewheel" : "wheel";
|
|
534
|
+
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, ce = se;
|
|
535
|
+
function ye(t, e) {
|
|
536
|
+
if (t.contains)
|
|
537
|
+
return t.contains(e);
|
|
538
|
+
for (; e; ) {
|
|
539
|
+
if (e === t)
|
|
540
|
+
return !0;
|
|
541
|
+
e = e.parentNode;
|
|
542
|
+
}
|
|
543
|
+
return !1;
|
|
544
|
+
}
|
|
545
|
+
function st(t, e) {
|
|
546
|
+
for (; d.element(t); ) {
|
|
547
|
+
if (me(t, e))
|
|
548
|
+
return t;
|
|
549
|
+
t = de(t);
|
|
550
|
+
}
|
|
551
|
+
return null;
|
|
552
|
+
}
|
|
553
|
+
function de(t) {
|
|
554
|
+
var e = t.parentNode;
|
|
555
|
+
if (d.docFrag(e)) {
|
|
556
|
+
for (; (e = e.host) && d.docFrag(e); )
|
|
557
|
+
;
|
|
558
|
+
return e;
|
|
559
|
+
}
|
|
560
|
+
return e;
|
|
561
|
+
}
|
|
562
|
+
function me(t, e) {
|
|
563
|
+
return R !== N && (e = e.replace(/\/deep\//g, " ")), t[ce.prefixedMatchesSelector](e);
|
|
564
|
+
}
|
|
565
|
+
var be = function(t) {
|
|
566
|
+
return t.parentNode || t.host;
|
|
567
|
+
};
|
|
568
|
+
function lt(t, e) {
|
|
569
|
+
for (var n, r = [], i = t; (n = be(i)) && i !== e && n !== i.ownerDocument; )
|
|
570
|
+
r.unshift(i), i = n;
|
|
571
|
+
return r;
|
|
572
|
+
}
|
|
573
|
+
function Ye(t, e, n) {
|
|
574
|
+
for (; d.element(t); ) {
|
|
575
|
+
if (me(t, e))
|
|
576
|
+
return !0;
|
|
577
|
+
if ((t = de(t)) === n)
|
|
578
|
+
return me(t, e);
|
|
579
|
+
}
|
|
580
|
+
return !1;
|
|
581
|
+
}
|
|
582
|
+
function $e(t) {
|
|
583
|
+
return t.correspondingUseElement || t;
|
|
584
|
+
}
|
|
585
|
+
function Me(t) {
|
|
586
|
+
var e = t instanceof K.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
|
|
587
|
+
return e && { left: e.left, right: e.right, top: e.top, bottom: e.bottom, width: e.width || e.right - e.left, height: e.height || e.bottom - e.top };
|
|
588
|
+
}
|
|
589
|
+
function Ne(t) {
|
|
590
|
+
var e, n = Me(t);
|
|
591
|
+
if (!ce.isIOS7 && n) {
|
|
592
|
+
var r = { x: (e = (e = X(t)) || R).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
|
|
593
|
+
n.left += r.x, n.right += r.x, n.top += r.y, n.bottom += r.y;
|
|
594
|
+
}
|
|
595
|
+
return n;
|
|
596
|
+
}
|
|
597
|
+
function x(t) {
|
|
598
|
+
for (var e = []; t; )
|
|
599
|
+
e.push(t), t = de(t);
|
|
600
|
+
return e;
|
|
601
|
+
}
|
|
602
|
+
function L(t) {
|
|
603
|
+
return !!d.string(t) && (K.document.querySelector(t), !0);
|
|
604
|
+
}
|
|
605
|
+
function y(t, e) {
|
|
606
|
+
for (var n in e)
|
|
607
|
+
t[n] = e[n];
|
|
608
|
+
return t;
|
|
609
|
+
}
|
|
610
|
+
function xe(t, e, n) {
|
|
611
|
+
return t === "parent" ? de(n) : t === "self" ? e.getRect(n) : st(n, t);
|
|
612
|
+
}
|
|
613
|
+
function we(t, e, n, r) {
|
|
614
|
+
var i = t;
|
|
615
|
+
return d.string(i) ? i = xe(i, e, n) : d.func(i) && (i = i.apply(void 0, r)), d.element(i) && (i = Ne(i)), i;
|
|
616
|
+
}
|
|
617
|
+
function ze(t) {
|
|
618
|
+
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
619
|
+
}
|
|
620
|
+
function Ae(t) {
|
|
621
|
+
return !t || "x" in t && "y" in t || ((t = y({}, t)).x = t.left || 0, t.y = t.top || 0, t.width = t.width || (t.right || 0) - t.x, t.height = t.height || (t.bottom || 0) - t.y), t;
|
|
622
|
+
}
|
|
623
|
+
function ct(t, e, n) {
|
|
624
|
+
t.left && (e.left += n.x), t.right && (e.right += n.x), t.top && (e.top += n.y), t.bottom && (e.bottom += n.y), e.width = e.right - e.left, e.height = e.bottom - e.top;
|
|
625
|
+
}
|
|
626
|
+
function qe(t, e, n) {
|
|
627
|
+
var r = n && t.options[n];
|
|
628
|
+
return ze(we(r && r.origin || t.options.origin, t, e, [t && e])) || { x: 0, y: 0 };
|
|
629
|
+
}
|
|
630
|
+
function Ce(t, e) {
|
|
631
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(l) {
|
|
632
|
+
return !0;
|
|
633
|
+
}, r = arguments.length > 3 ? arguments[3] : void 0;
|
|
634
|
+
if (r = r || {}, d.string(t) && t.search(" ") !== -1 && (t = Qt(t)), d.array(t))
|
|
635
|
+
return t.forEach(function(l) {
|
|
636
|
+
return Ce(l, e, n, r);
|
|
637
|
+
}), r;
|
|
638
|
+
if (d.object(t) && (e = t, t = ""), d.func(e) && n(t))
|
|
639
|
+
r[t] = r[t] || [], r[t].push(e);
|
|
640
|
+
else if (d.array(e))
|
|
641
|
+
for (var i = 0, o = e; i < o.length; i++) {
|
|
642
|
+
var a = o[i];
|
|
643
|
+
Ce(t, a, n, r);
|
|
644
|
+
}
|
|
645
|
+
else if (d.object(e))
|
|
646
|
+
for (var s in e)
|
|
647
|
+
Ce(Qt(s).map(function(l) {
|
|
648
|
+
return "".concat(t).concat(l);
|
|
649
|
+
}), e[s], n, r);
|
|
650
|
+
return r;
|
|
651
|
+
}
|
|
652
|
+
function Qt(t) {
|
|
653
|
+
return t.trim().split(/ +/);
|
|
654
|
+
}
|
|
655
|
+
var Ue = function(t, e) {
|
|
656
|
+
return Math.sqrt(t * t + e * e);
|
|
657
|
+
}, rr = ["webkit", "moz"];
|
|
658
|
+
function ut(t, e) {
|
|
659
|
+
t.__set || (t.__set = {});
|
|
660
|
+
var n = function(i) {
|
|
661
|
+
if (rr.some(function(o) {
|
|
662
|
+
return i.indexOf(o) === 0;
|
|
663
|
+
}))
|
|
664
|
+
return 1;
|
|
665
|
+
typeof t[i] != "function" && i !== "__set" && Object.defineProperty(t, i, { get: function() {
|
|
666
|
+
return i in t.__set ? t.__set[i] : t.__set[i] = e[i];
|
|
667
|
+
}, set: function(o) {
|
|
668
|
+
t.__set[i] = o;
|
|
669
|
+
}, configurable: !0 });
|
|
670
|
+
};
|
|
671
|
+
for (var r in e)
|
|
672
|
+
n(r);
|
|
673
|
+
return t;
|
|
674
|
+
}
|
|
675
|
+
function pt(t, e) {
|
|
676
|
+
t.page = t.page || {}, t.page.x = e.page.x, t.page.y = e.page.y, t.client = t.client || {}, t.client.x = e.client.x, t.client.y = e.client.y, t.timeStamp = e.timeStamp;
|
|
677
|
+
}
|
|
678
|
+
function Zt(t) {
|
|
679
|
+
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
|
|
680
|
+
}
|
|
681
|
+
function en(t) {
|
|
682
|
+
return t instanceof K.Event || t instanceof K.Touch;
|
|
683
|
+
}
|
|
684
|
+
function dt(t, e, n) {
|
|
685
|
+
return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
|
|
686
|
+
}
|
|
687
|
+
function tn(t, e) {
|
|
688
|
+
return e = e || { x: 0, y: 0 }, ce.isOperaMobile && en(t) ? (dt("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : dt("page", t, e), e;
|
|
689
|
+
}
|
|
690
|
+
function He(t) {
|
|
691
|
+
return d.number(t.pointerId) ? t.pointerId : t.identifier;
|
|
692
|
+
}
|
|
693
|
+
function ir(t, e, n) {
|
|
694
|
+
var r = e.length > 1 ? nn(e) : e[0];
|
|
695
|
+
tn(r, t.page), function(i, o) {
|
|
696
|
+
o = o || {}, ce.isOperaMobile && en(i) ? dt("screen", i, o) : dt("client", i, o);
|
|
697
|
+
}(r, t.client), t.timeStamp = n;
|
|
698
|
+
}
|
|
699
|
+
function kt(t) {
|
|
700
|
+
var e = [];
|
|
701
|
+
return d.array(t) ? (e[0] = t[0], e[1] = t[1]) : t.type === "touchend" ? t.touches.length === 1 ? (e[0] = t.touches[0], e[1] = t.changedTouches[0]) : t.touches.length === 0 && (e[0] = t.changedTouches[0], e[1] = t.changedTouches[1]) : (e[0] = t.touches[0], e[1] = t.touches[1]), e;
|
|
702
|
+
}
|
|
703
|
+
function nn(t) {
|
|
704
|
+
for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n = 0; n < t.length; n++) {
|
|
705
|
+
var r = t[n];
|
|
706
|
+
for (var i in e)
|
|
707
|
+
e[i] += r[i];
|
|
708
|
+
}
|
|
709
|
+
for (var o in e)
|
|
710
|
+
e[o] /= t.length;
|
|
711
|
+
return e;
|
|
712
|
+
}
|
|
713
|
+
function Pt(t) {
|
|
714
|
+
if (!t.length)
|
|
715
|
+
return null;
|
|
716
|
+
var e = kt(t), n = Math.min(e[0].pageX, e[1].pageX), r = Math.min(e[0].pageY, e[1].pageY), i = Math.max(e[0].pageX, e[1].pageX), o = Math.max(e[0].pageY, e[1].pageY);
|
|
717
|
+
return { x: n, y: r, left: n, top: r, right: i, bottom: o, width: i - n, height: o - r };
|
|
718
|
+
}
|
|
719
|
+
function Ot(t, e) {
|
|
720
|
+
var n = e + "X", r = e + "Y", i = kt(t), o = i[0][n] - i[1][n], a = i[0][r] - i[1][r];
|
|
721
|
+
return Ue(o, a);
|
|
722
|
+
}
|
|
723
|
+
function It(t, e) {
|
|
724
|
+
var n = e + "X", r = e + "Y", i = kt(t), o = i[1][n] - i[0][n], a = i[1][r] - i[0][r];
|
|
725
|
+
return 180 * Math.atan2(a, o) / Math.PI;
|
|
726
|
+
}
|
|
727
|
+
function rn(t) {
|
|
728
|
+
return d.string(t.pointerType) ? t.pointerType : d.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof K.Touch ? "touch" : "mouse";
|
|
729
|
+
}
|
|
730
|
+
function on(t) {
|
|
731
|
+
var e = d.func(t.composedPath) ? t.composedPath() : t.path;
|
|
732
|
+
return [$e(e ? e[0] : t.target), $e(t.currentTarget)];
|
|
733
|
+
}
|
|
734
|
+
var ft = function() {
|
|
735
|
+
function t(e) {
|
|
736
|
+
A(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
|
|
737
|
+
}
|
|
738
|
+
return P(t, [{ key: "preventDefault", value: function() {
|
|
739
|
+
} }, { key: "stopPropagation", value: function() {
|
|
740
|
+
this.propagationStopped = !0;
|
|
741
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
|
742
|
+
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
743
|
+
} }]), t;
|
|
744
|
+
}();
|
|
745
|
+
Object.defineProperty(ft.prototype, "interaction", { get: function() {
|
|
746
|
+
return this._interaction._proxy;
|
|
747
|
+
}, set: function() {
|
|
748
|
+
} });
|
|
749
|
+
var an = function(t, e) {
|
|
750
|
+
for (var n = 0; n < e.length; n++) {
|
|
751
|
+
var r = e[n];
|
|
752
|
+
t.push(r);
|
|
753
|
+
}
|
|
754
|
+
return t;
|
|
755
|
+
}, sn = function(t) {
|
|
756
|
+
return an([], t);
|
|
757
|
+
}, Ge = function(t, e) {
|
|
758
|
+
for (var n = 0; n < t.length; n++)
|
|
759
|
+
if (e(t[n], n, t))
|
|
760
|
+
return n;
|
|
761
|
+
return -1;
|
|
762
|
+
}, Ke = function(t, e) {
|
|
763
|
+
return t[Ge(t, e)];
|
|
764
|
+
}, Be = function(t) {
|
|
765
|
+
W(n, t);
|
|
766
|
+
var e = le(n);
|
|
767
|
+
function n(r, i, o) {
|
|
768
|
+
var a;
|
|
769
|
+
A(this, n), (a = e.call(this, i._interaction)).dropzone = void 0, a.dragEvent = void 0, a.relatedTarget = void 0, a.draggable = void 0, a.propagationStopped = !1, a.immediatePropagationStopped = !1;
|
|
770
|
+
var s = o === "dragleave" ? r.prev : r.cur, l = s.element, u = s.dropzone;
|
|
771
|
+
return a.type = o, a.target = l, a.currentTarget = l, a.dropzone = u, a.dragEvent = i, a.relatedTarget = i.target, a.draggable = i.interactable, a.timeStamp = i.timeStamp, a;
|
|
772
|
+
}
|
|
773
|
+
return P(n, [{ key: "reject", value: function() {
|
|
774
|
+
var r = this, i = this._interaction.dropState;
|
|
775
|
+
if (this.type === "dropactivate" || this.dropzone && i.cur.dropzone === this.dropzone && i.cur.element === this.target)
|
|
776
|
+
if (i.prev.dropzone = this.dropzone, i.prev.element = this.target, i.rejected = !0, i.events.enter = null, this.stopImmediatePropagation(), this.type === "dropactivate") {
|
|
777
|
+
var o = i.activeDrops, a = Ge(o, function(l) {
|
|
778
|
+
var u = l.dropzone, c = l.element;
|
|
779
|
+
return u === r.dropzone && c === r.target;
|
|
780
|
+
});
|
|
781
|
+
i.activeDrops.splice(a, 1);
|
|
782
|
+
var s = new n(i, this.dragEvent, "dropdeactivate");
|
|
783
|
+
s.dropzone = this.dropzone, s.target = this.target, this.dropzone.fire(s);
|
|
784
|
+
} else
|
|
785
|
+
this.dropzone.fire(new n(i, this.dragEvent, "dragleave"));
|
|
786
|
+
} }, { key: "preventDefault", value: function() {
|
|
787
|
+
} }, { key: "stopPropagation", value: function() {
|
|
788
|
+
this.propagationStopped = !0;
|
|
789
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
|
790
|
+
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
791
|
+
} }]), n;
|
|
792
|
+
}(ft);
|
|
793
|
+
function ln(t, e) {
|
|
794
|
+
for (var n = 0, r = t.slice(); n < r.length; n++) {
|
|
795
|
+
var i = r[n], o = i.dropzone, a = i.element;
|
|
796
|
+
e.dropzone = o, e.target = a, o.fire(e), e.propagationStopped = e.immediatePropagationStopped = !1;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function Dt(t, e) {
|
|
800
|
+
for (var n = function(o, a) {
|
|
801
|
+
for (var s = [], l = 0, u = o.interactables.list; l < u.length; l++) {
|
|
802
|
+
var c = u[l];
|
|
803
|
+
if (c.options.drop.enabled) {
|
|
804
|
+
var p = c.options.drop.accept;
|
|
805
|
+
if (!(d.element(p) && p !== a || d.string(p) && !me(a, p) || d.func(p) && !p({ dropzone: c, draggableElement: a })))
|
|
806
|
+
for (var f = 0, h = c.getAllElements(); f < h.length; f++) {
|
|
807
|
+
var v = h[f];
|
|
808
|
+
v !== a && s.push({ dropzone: c, element: v, rect: c.getRect(v) });
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
return s;
|
|
813
|
+
}(t, e), r = 0; r < n.length; r++) {
|
|
814
|
+
var i = n[r];
|
|
815
|
+
i.rect = i.dropzone.getRect(i.element);
|
|
816
|
+
}
|
|
817
|
+
return n;
|
|
818
|
+
}
|
|
819
|
+
function cn(t, e, n) {
|
|
820
|
+
for (var r = t.dropState, i = t.interactable, o = t.element, a = [], s = 0, l = r.activeDrops; s < l.length; s++) {
|
|
821
|
+
var u = l[s], c = u.dropzone, p = u.element, f = u.rect, h = c.dropCheck(e, n, i, o, p, f);
|
|
822
|
+
a.push(h ? p : null);
|
|
823
|
+
}
|
|
824
|
+
var v = function(g) {
|
|
825
|
+
for (var b, m, w, S = [], k = 0; k < g.length; k++) {
|
|
826
|
+
var _ = g[k], T = g[b];
|
|
827
|
+
if (_ && k !== b)
|
|
828
|
+
if (T) {
|
|
829
|
+
var oe = be(_), j = be(T);
|
|
830
|
+
if (oe !== _.ownerDocument)
|
|
831
|
+
if (j !== _.ownerDocument)
|
|
832
|
+
if (oe !== j) {
|
|
833
|
+
S = S.length ? S : lt(T);
|
|
834
|
+
var ue = void 0;
|
|
835
|
+
if (T instanceof K.HTMLElement && _ instanceof K.SVGElement && !(_ instanceof K.SVGSVGElement)) {
|
|
836
|
+
if (_ === j)
|
|
837
|
+
continue;
|
|
838
|
+
ue = _.ownerSVGElement;
|
|
839
|
+
} else
|
|
840
|
+
ue = _;
|
|
841
|
+
for (var fe = lt(ue, T.ownerDocument), Se = 0; fe[Se] && fe[Se] === S[Se]; )
|
|
842
|
+
Se++;
|
|
843
|
+
var _t = [fe[Se - 1], fe[Se], S[Se]];
|
|
844
|
+
if (_t[0])
|
|
845
|
+
for (var nt = _t[0].lastChild; nt; ) {
|
|
846
|
+
if (nt === _t[1]) {
|
|
847
|
+
b = k, S = fe;
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
if (nt === _t[2])
|
|
851
|
+
break;
|
|
852
|
+
nt = nt.previousSibling;
|
|
853
|
+
}
|
|
854
|
+
} else
|
|
855
|
+
w = T, (parseInt(X(m = _).getComputedStyle(m).zIndex, 10) || 0) >= (parseInt(X(w).getComputedStyle(w).zIndex, 10) || 0) && (b = k);
|
|
856
|
+
else
|
|
857
|
+
b = k;
|
|
858
|
+
} else
|
|
859
|
+
b = k;
|
|
860
|
+
}
|
|
861
|
+
return b;
|
|
862
|
+
}(a);
|
|
863
|
+
return r.activeDrops[v] || null;
|
|
864
|
+
}
|
|
865
|
+
function Mt(t, e, n) {
|
|
866
|
+
var r = t.dropState, i = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
|
|
867
|
+
return n.type === "dragstart" && (i.activate = new Be(r, n, "dropactivate"), i.activate.target = null, i.activate.dropzone = null), n.type === "dragend" && (i.deactivate = new Be(r, n, "dropdeactivate"), i.deactivate.target = null, i.deactivate.dropzone = null), r.rejected || (r.cur.element !== r.prev.element && (r.prev.dropzone && (i.leave = new Be(r, n, "dragleave"), n.dragLeave = i.leave.target = r.prev.element, n.prevDropzone = i.leave.dropzone = r.prev.dropzone), r.cur.dropzone && (i.enter = new Be(r, n, "dragenter"), n.dragEnter = r.cur.element, n.dropzone = r.cur.dropzone)), n.type === "dragend" && r.cur.dropzone && (i.drop = new Be(r, n, "drop"), n.dropzone = r.cur.dropzone, n.relatedTarget = r.cur.element), n.type === "dragmove" && r.cur.dropzone && (i.move = new Be(r, n, "dropmove"), n.dropzone = r.cur.dropzone)), i;
|
|
868
|
+
}
|
|
869
|
+
function zt(t, e) {
|
|
870
|
+
var n = t.dropState, r = n.activeDrops, i = n.cur, o = n.prev;
|
|
871
|
+
e.leave && o.dropzone.fire(e.leave), e.enter && i.dropzone.fire(e.enter), e.move && i.dropzone.fire(e.move), e.drop && i.dropzone.fire(e.drop), e.deactivate && ln(r, e.deactivate), n.prev.dropzone = i.dropzone, n.prev.element = i.element;
|
|
872
|
+
}
|
|
873
|
+
function un(t, e) {
|
|
874
|
+
var n = t.interaction, r = t.iEvent, i = t.event;
|
|
875
|
+
if (r.type === "dragmove" || r.type === "dragend") {
|
|
876
|
+
var o = n.dropState;
|
|
877
|
+
e.dynamicDrop && (o.activeDrops = Dt(e, n.element));
|
|
878
|
+
var a = r, s = cn(n, a, i);
|
|
879
|
+
o.rejected = o.rejected && !!s && s.dropzone === o.cur.dropzone && s.element === o.cur.element, o.cur.dropzone = s && s.dropzone, o.cur.element = s && s.element, o.events = Mt(n, 0, a);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
var pn = { id: "actions/drop", install: function(t) {
|
|
883
|
+
var e = t.actions, n = t.interactStatic, r = t.Interactable, i = t.defaults;
|
|
884
|
+
t.usePlugin(te), r.prototype.dropzone = function(o) {
|
|
885
|
+
return function(a, s) {
|
|
886
|
+
if (d.object(s)) {
|
|
887
|
+
if (a.options.drop.enabled = s.enabled !== !1, s.listeners) {
|
|
888
|
+
var l = Ce(s.listeners), u = Object.keys(l).reduce(function(p, f) {
|
|
889
|
+
return p[/^(enter|leave)/.test(f) ? "drag".concat(f) : /^(activate|deactivate|move)/.test(f) ? "drop".concat(f) : f] = l[f], p;
|
|
890
|
+
}, {}), c = a.options.drop.listeners;
|
|
891
|
+
c && a.off(c), a.on(u), a.options.drop.listeners = u;
|
|
892
|
+
}
|
|
893
|
+
return d.func(s.ondrop) && a.on("drop", s.ondrop), d.func(s.ondropactivate) && a.on("dropactivate", s.ondropactivate), d.func(s.ondropdeactivate) && a.on("dropdeactivate", s.ondropdeactivate), d.func(s.ondragenter) && a.on("dragenter", s.ondragenter), d.func(s.ondragleave) && a.on("dragleave", s.ondragleave), d.func(s.ondropmove) && a.on("dropmove", s.ondropmove), /^(pointer|center)$/.test(s.overlap) ? a.options.drop.overlap = s.overlap : d.number(s.overlap) && (a.options.drop.overlap = Math.max(Math.min(1, s.overlap), 0)), "accept" in s && (a.options.drop.accept = s.accept), "checker" in s && (a.options.drop.checker = s.checker), a;
|
|
894
|
+
}
|
|
895
|
+
return d.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
896
|
+
}(this, o);
|
|
897
|
+
}, r.prototype.dropCheck = function(o, a, s, l, u, c) {
|
|
898
|
+
return function(p, f, h, v, g, b, m) {
|
|
899
|
+
var w = !1;
|
|
900
|
+
if (!(m = m || p.getRect(b)))
|
|
901
|
+
return !!p.options.drop.checker && p.options.drop.checker(f, h, w, p, b, v, g);
|
|
902
|
+
var S = p.options.drop.overlap;
|
|
903
|
+
if (S === "pointer") {
|
|
904
|
+
var k = qe(v, g, "drag"), _ = tn(f);
|
|
905
|
+
_.x += k.x, _.y += k.y;
|
|
906
|
+
var T = _.x > m.left && _.x < m.right, oe = _.y > m.top && _.y < m.bottom;
|
|
907
|
+
w = T && oe;
|
|
908
|
+
}
|
|
909
|
+
var j = v.getRect(g);
|
|
910
|
+
if (j && S === "center") {
|
|
911
|
+
var ue = j.left + j.width / 2, fe = j.top + j.height / 2;
|
|
912
|
+
w = ue >= m.left && ue <= m.right && fe >= m.top && fe <= m.bottom;
|
|
913
|
+
}
|
|
914
|
+
return j && d.number(S) && (w = Math.max(0, Math.min(m.right, j.right) - Math.max(m.left, j.left)) * Math.max(0, Math.min(m.bottom, j.bottom) - Math.max(m.top, j.top)) / (j.width * j.height) >= S), p.options.drop.checker && (w = p.options.drop.checker(f, h, w, p, b, v, g)), w;
|
|
915
|
+
}(this, o, a, s, l, u, c);
|
|
916
|
+
}, n.dynamicDrop = function(o) {
|
|
917
|
+
return d.bool(o) ? (t.dynamicDrop = o, n) : t.dynamicDrop;
|
|
918
|
+
}, y(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, i.actions.drop = pn.defaults;
|
|
919
|
+
}, listeners: { "interactions:before-action-start": function(t) {
|
|
920
|
+
var e = t.interaction;
|
|
921
|
+
e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
|
|
922
|
+
}, "interactions:after-action-start": function(t, e) {
|
|
923
|
+
var n = t.interaction, r = (t.event, t.iEvent);
|
|
924
|
+
if (n.prepared.name === "drag") {
|
|
925
|
+
var i = n.dropState;
|
|
926
|
+
i.activeDrops = [], i.events = {}, i.activeDrops = Dt(e, n.element), i.events = Mt(n, 0, r), i.events.activate && (ln(i.activeDrops, i.events.activate), e.fire("actions/drop:start", { interaction: n, dragEvent: r }));
|
|
927
|
+
}
|
|
928
|
+
}, "interactions:action-move": un, "interactions:after-action-move": function(t, e) {
|
|
929
|
+
var n = t.interaction, r = t.iEvent;
|
|
930
|
+
if (n.prepared.name === "drag") {
|
|
931
|
+
var i = n.dropState;
|
|
932
|
+
zt(n, i.events), e.fire("actions/drop:move", { interaction: n, dragEvent: r }), i.events = {};
|
|
933
|
+
}
|
|
934
|
+
}, "interactions:action-end": function(t, e) {
|
|
935
|
+
if (t.interaction.prepared.name === "drag") {
|
|
936
|
+
var n = t.interaction, r = t.iEvent;
|
|
937
|
+
un(t, e), zt(n, n.dropState.events), e.fire("actions/drop:end", { interaction: n, dragEvent: r });
|
|
938
|
+
}
|
|
939
|
+
}, "interactions:stop": function(t) {
|
|
940
|
+
var e = t.interaction;
|
|
941
|
+
if (e.prepared.name === "drag") {
|
|
942
|
+
var n = e.dropState;
|
|
943
|
+
n && (n.activeDrops = null, n.events = null, n.cur.dropzone = null, n.cur.element = null, n.prev.dropzone = null, n.prev.element = null, n.rejected = !1);
|
|
944
|
+
}
|
|
945
|
+
} }, getActiveDrops: Dt, getDrop: cn, getDropEvents: Mt, fireDropEvents: zt, filterEventType: function(t) {
|
|
946
|
+
return t.search("drag") === 0 || t.search("drop") === 0;
|
|
947
|
+
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, or = pn;
|
|
948
|
+
function At(t) {
|
|
949
|
+
var e = t.interaction, n = t.iEvent, r = t.phase;
|
|
950
|
+
if (e.prepared.name === "gesture") {
|
|
951
|
+
var i = e.pointers.map(function(u) {
|
|
952
|
+
return u.pointer;
|
|
953
|
+
}), o = r === "start", a = r === "end", s = e.interactable.options.deltaSource;
|
|
954
|
+
if (n.touches = [i[0], i[1]], o)
|
|
955
|
+
n.distance = Ot(i, s), n.box = Pt(i), n.scale = 1, n.ds = 0, n.angle = It(i, s), n.da = 0, e.gesture.startDistance = n.distance, e.gesture.startAngle = n.angle;
|
|
956
|
+
else if (a || e.pointers.length < 2) {
|
|
957
|
+
var l = e.prevEvent;
|
|
958
|
+
n.distance = l.distance, n.box = l.box, n.scale = l.scale, n.ds = 0, n.angle = l.angle, n.da = 0;
|
|
959
|
+
} else
|
|
960
|
+
n.distance = Ot(i, s), n.box = Pt(i), n.scale = n.distance / e.gesture.startDistance, n.angle = It(i, s), n.ds = n.scale - e.gesture.scale, n.da = n.angle - e.gesture.angle;
|
|
961
|
+
e.gesture.distance = n.distance, e.gesture.angle = n.angle, d.number(n.scale) && n.scale !== 1 / 0 && !isNaN(n.scale) && (e.gesture.scale = n.scale);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
var Ct = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
|
|
965
|
+
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
966
|
+
n.prototype.gesturable = function(i) {
|
|
967
|
+
return d.object(i) ? (this.options.gesture.enabled = i.enabled !== !1, this.setPerAction("gesture", i), this.setOnEvents("gesture", i), this) : d.bool(i) ? (this.options.gesture.enabled = i, this) : this.options.gesture;
|
|
968
|
+
}, e.map.gesture = Ct, e.methodDict.gesture = "gesturable", r.actions.gesture = Ct.defaults;
|
|
969
|
+
}, listeners: { "interactions:action-start": At, "interactions:action-move": At, "interactions:action-end": At, "interactions:new": function(t) {
|
|
970
|
+
t.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
|
|
971
|
+
}, "auto-start:check": function(t) {
|
|
972
|
+
if (!(t.interaction.pointers.length < 2)) {
|
|
973
|
+
var e = t.interactable.options.gesture;
|
|
974
|
+
if (e && e.enabled)
|
|
975
|
+
return t.action = { name: "gesture" }, !1;
|
|
976
|
+
}
|
|
977
|
+
} }, defaults: {}, getCursor: function() {
|
|
978
|
+
return "";
|
|
979
|
+
}, filterEventType: function(t) {
|
|
980
|
+
return t.search("gesture") === 0;
|
|
981
|
+
} }, ar = Ct;
|
|
982
|
+
function sr(t, e, n, r, i, o, a) {
|
|
983
|
+
if (!e)
|
|
984
|
+
return !1;
|
|
985
|
+
if (e === !0) {
|
|
986
|
+
var s = d.number(o.width) ? o.width : o.right - o.left, l = d.number(o.height) ? o.height : o.bottom - o.top;
|
|
987
|
+
if (a = Math.min(a, Math.abs((t === "left" || t === "right" ? s : l) / 2)), s < 0 && (t === "left" ? t = "right" : t === "right" && (t = "left")), l < 0 && (t === "top" ? t = "bottom" : t === "bottom" && (t = "top")), t === "left") {
|
|
988
|
+
var u = s >= 0 ? o.left : o.right;
|
|
989
|
+
return n.x < u + a;
|
|
990
|
+
}
|
|
991
|
+
if (t === "top") {
|
|
992
|
+
var c = l >= 0 ? o.top : o.bottom;
|
|
993
|
+
return n.y < c + a;
|
|
994
|
+
}
|
|
995
|
+
if (t === "right")
|
|
996
|
+
return n.x > (s >= 0 ? o.right : o.left) - a;
|
|
997
|
+
if (t === "bottom")
|
|
998
|
+
return n.y > (l >= 0 ? o.bottom : o.top) - a;
|
|
999
|
+
}
|
|
1000
|
+
return !!d.element(r) && (d.element(e) ? e === r : Ye(r, e, i));
|
|
1001
|
+
}
|
|
1002
|
+
function dn(t) {
|
|
1003
|
+
var e = t.iEvent, n = t.interaction;
|
|
1004
|
+
if (n.prepared.name === "resize" && n.resizeAxes) {
|
|
1005
|
+
var r = e;
|
|
1006
|
+
n.interactable.options.resize.square ? (n.resizeAxes === "y" ? r.delta.x = r.delta.y : r.delta.y = r.delta.x, r.axes = "xy") : (r.axes = n.resizeAxes, n.resizeAxes === "x" ? r.delta.y = 0 : n.resizeAxes === "y" && (r.delta.x = 0));
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
var _e, Re, Ee = { id: "actions/resize", before: ["actions/drag"], install: function(t) {
|
|
1010
|
+
var e = t.actions, n = t.browser, r = t.Interactable, i = t.defaults;
|
|
1011
|
+
Ee.cursors = function(o) {
|
|
1012
|
+
return o.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
|
|
1013
|
+
}(n), Ee.defaultMargin = n.supportsTouch || n.supportsPointerEvent ? 20 : 10, r.prototype.resizable = function(o) {
|
|
1014
|
+
return function(a, s, l) {
|
|
1015
|
+
return d.object(s) ? (a.options.resize.enabled = s.enabled !== !1, a.setPerAction("resize", s), a.setOnEvents("resize", s), d.string(s.axis) && /^x$|^y$|^xy$/.test(s.axis) ? a.options.resize.axis = s.axis : s.axis === null && (a.options.resize.axis = l.defaults.actions.resize.axis), d.bool(s.preserveAspectRatio) ? a.options.resize.preserveAspectRatio = s.preserveAspectRatio : d.bool(s.square) && (a.options.resize.square = s.square), a) : d.bool(s) ? (a.options.resize.enabled = s, a) : a.options.resize;
|
|
1016
|
+
}(this, o, t);
|
|
1017
|
+
}, e.map.resize = Ee, e.methodDict.resize = "resizable", i.actions.resize = Ee.defaults;
|
|
1018
|
+
}, listeners: { "interactions:new": function(t) {
|
|
1019
|
+
t.interaction.resizeAxes = "xy";
|
|
1020
|
+
}, "interactions:action-start": function(t) {
|
|
1021
|
+
(function(e) {
|
|
1022
|
+
var n = e.iEvent, r = e.interaction;
|
|
1023
|
+
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1024
|
+
var i = n, o = r.rect;
|
|
1025
|
+
r._rects = { start: y({}, o), corrected: y({}, o), previous: y({}, o), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, i.edges = r.prepared.edges, i.rect = r._rects.corrected, i.deltaRect = r._rects.delta;
|
|
1026
|
+
}
|
|
1027
|
+
})(t), dn(t);
|
|
1028
|
+
}, "interactions:action-move": function(t) {
|
|
1029
|
+
(function(e) {
|
|
1030
|
+
var n = e.iEvent, r = e.interaction;
|
|
1031
|
+
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1032
|
+
var i = n, o = r.interactable.options.resize.invert, a = o === "reposition" || o === "negate", s = r.rect, l = r._rects, u = l.start, c = l.corrected, p = l.delta, f = l.previous;
|
|
1033
|
+
if (y(f, c), a) {
|
|
1034
|
+
if (y(c, s), o === "reposition") {
|
|
1035
|
+
if (c.top > c.bottom) {
|
|
1036
|
+
var h = c.top;
|
|
1037
|
+
c.top = c.bottom, c.bottom = h;
|
|
1038
|
+
}
|
|
1039
|
+
if (c.left > c.right) {
|
|
1040
|
+
var v = c.left;
|
|
1041
|
+
c.left = c.right, c.right = v;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
} else
|
|
1045
|
+
c.top = Math.min(s.top, u.bottom), c.bottom = Math.max(s.bottom, u.top), c.left = Math.min(s.left, u.right), c.right = Math.max(s.right, u.left);
|
|
1046
|
+
for (var g in c.width = c.right - c.left, c.height = c.bottom - c.top, c)
|
|
1047
|
+
p[g] = c[g] - f[g];
|
|
1048
|
+
i.edges = r.prepared.edges, i.rect = c, i.deltaRect = p;
|
|
1049
|
+
}
|
|
1050
|
+
})(t), dn(t);
|
|
1051
|
+
}, "interactions:action-end": function(t) {
|
|
1052
|
+
var e = t.iEvent, n = t.interaction;
|
|
1053
|
+
if (n.prepared.name === "resize" && n.prepared.edges) {
|
|
1054
|
+
var r = e;
|
|
1055
|
+
r.edges = n.prepared.edges, r.rect = n._rects.corrected, r.deltaRect = n._rects.delta;
|
|
1056
|
+
}
|
|
1057
|
+
}, "auto-start:check": function(t) {
|
|
1058
|
+
var e = t.interaction, n = t.interactable, r = t.element, i = t.rect, o = t.buttons;
|
|
1059
|
+
if (i) {
|
|
1060
|
+
var a = y({}, e.coords.cur.page), s = n.options.resize;
|
|
1061
|
+
if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || o & s.mouseButtons)) {
|
|
1062
|
+
if (d.object(s.edges)) {
|
|
1063
|
+
var l = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1064
|
+
for (var u in l)
|
|
1065
|
+
l[u] = sr(u, s.edges[u], a, e._latestPointer.eventTarget, r, i, s.margin || Ee.defaultMargin);
|
|
1066
|
+
l.left = l.left && !l.right, l.top = l.top && !l.bottom, (l.left || l.right || l.top || l.bottom) && (t.action = { name: "resize", edges: l });
|
|
1067
|
+
} else {
|
|
1068
|
+
var c = s.axis !== "y" && a.x > i.right - Ee.defaultMargin, p = s.axis !== "x" && a.y > i.bottom - Ee.defaultMargin;
|
|
1069
|
+
(c || p) && (t.action = { name: "resize", axes: (c ? "x" : "") + (p ? "y" : "") });
|
|
1070
|
+
}
|
|
1071
|
+
return !t.action && void 0;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
} }, defaults: { square: !1, preserveAspectRatio: !1, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(t) {
|
|
1075
|
+
var e = t.edges, n = t.axis, r = t.name, i = Ee.cursors, o = null;
|
|
1076
|
+
if (n)
|
|
1077
|
+
o = i[r + n];
|
|
1078
|
+
else if (e) {
|
|
1079
|
+
for (var a = "", s = 0, l = ["top", "bottom", "left", "right"]; s < l.length; s++) {
|
|
1080
|
+
var u = l[s];
|
|
1081
|
+
e[u] && (a += u);
|
|
1082
|
+
}
|
|
1083
|
+
o = i[a];
|
|
1084
|
+
}
|
|
1085
|
+
return o;
|
|
1086
|
+
}, filterEventType: function(t) {
|
|
1087
|
+
return t.search("resize") === 0;
|
|
1088
|
+
}, defaultMargin: null }, lr = Ee, cr = { id: "actions", install: function(t) {
|
|
1089
|
+
t.usePlugin(ar), t.usePlugin(lr), t.usePlugin(te), t.usePlugin(or);
|
|
1090
|
+
} }, fn = 0, Pe = { request: function(t) {
|
|
1091
|
+
return _e(t);
|
|
1092
|
+
}, cancel: function(t) {
|
|
1093
|
+
return Re(t);
|
|
1094
|
+
}, init: function(t) {
|
|
1095
|
+
if (_e = t.requestAnimationFrame, Re = t.cancelAnimationFrame, !_e)
|
|
1096
|
+
for (var e = ["ms", "moz", "webkit", "o"], n = 0; n < e.length; n++) {
|
|
1097
|
+
var r = e[n];
|
|
1098
|
+
_e = t["".concat(r, "RequestAnimationFrame")], Re = t["".concat(r, "CancelAnimationFrame")] || t["".concat(r, "CancelRequestAnimationFrame")];
|
|
1099
|
+
}
|
|
1100
|
+
_e = _e && _e.bind(t), Re = Re && Re.bind(t), _e || (_e = function(i) {
|
|
1101
|
+
var o = Date.now(), a = Math.max(0, 16 - (o - fn)), s = t.setTimeout(function() {
|
|
1102
|
+
i(o + a);
|
|
1103
|
+
}, a);
|
|
1104
|
+
return fn = o + a, s;
|
|
1105
|
+
}, Re = function(i) {
|
|
1106
|
+
return clearTimeout(i);
|
|
1107
|
+
});
|
|
1108
|
+
} }, E = { defaults: { enabled: !1, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: !1, prevTime: 0, margin: 0, speed: 0, start: function(t) {
|
|
1109
|
+
E.isScrolling = !0, Pe.cancel(E.i), t.autoScroll = E, E.interaction = t, E.prevTime = E.now(), E.i = Pe.request(E.scroll);
|
|
1110
|
+
}, stop: function() {
|
|
1111
|
+
E.isScrolling = !1, E.interaction && (E.interaction.autoScroll = null), Pe.cancel(E.i);
|
|
1112
|
+
}, scroll: function() {
|
|
1113
|
+
var t = E.interaction, e = t.interactable, n = t.element, r = t.prepared.name, i = e.options[r].autoScroll, o = vn(i.container, e, n), a = E.now(), s = (a - E.prevTime) / 1e3, l = i.speed * s;
|
|
1114
|
+
if (l >= 1) {
|
|
1115
|
+
var u = { x: E.x * l, y: E.y * l };
|
|
1116
|
+
if (u.x || u.y) {
|
|
1117
|
+
var c = hn(o);
|
|
1118
|
+
d.window(o) ? o.scrollBy(u.x, u.y) : o && (o.scrollLeft += u.x, o.scrollTop += u.y);
|
|
1119
|
+
var p = hn(o), f = { x: p.x - c.x, y: p.y - c.y };
|
|
1120
|
+
(f.x || f.y) && e.fire({ type: "autoscroll", target: n, interactable: e, delta: f, interaction: t, container: o });
|
|
1121
|
+
}
|
|
1122
|
+
E.prevTime = a;
|
|
1123
|
+
}
|
|
1124
|
+
E.isScrolling && (Pe.cancel(E.i), E.i = Pe.request(E.scroll));
|
|
1125
|
+
}, check: function(t, e) {
|
|
1126
|
+
var n;
|
|
1127
|
+
return (n = t.options[e].autoScroll) == null ? void 0 : n.enabled;
|
|
1128
|
+
}, onInteractionMove: function(t) {
|
|
1129
|
+
var e = t.interaction, n = t.pointer;
|
|
1130
|
+
if (e.interacting() && E.check(e.interactable, e.prepared.name))
|
|
1131
|
+
if (e.simulation)
|
|
1132
|
+
E.x = E.y = 0;
|
|
1133
|
+
else {
|
|
1134
|
+
var r, i, o, a, s = e.interactable, l = e.element, u = e.prepared.name, c = s.options[u].autoScroll, p = vn(c.container, s, l);
|
|
1135
|
+
if (d.window(p))
|
|
1136
|
+
a = n.clientX < E.margin, r = n.clientY < E.margin, i = n.clientX > p.innerWidth - E.margin, o = n.clientY > p.innerHeight - E.margin;
|
|
1137
|
+
else {
|
|
1138
|
+
var f = Me(p);
|
|
1139
|
+
a = n.clientX < f.left + E.margin, r = n.clientY < f.top + E.margin, i = n.clientX > f.right - E.margin, o = n.clientY > f.bottom - E.margin;
|
|
1140
|
+
}
|
|
1141
|
+
E.x = i ? 1 : a ? -1 : 0, E.y = o ? 1 : r ? -1 : 0, E.isScrolling || (E.margin = c.margin, E.speed = c.speed, E.start(e));
|
|
1142
|
+
}
|
|
1143
|
+
} };
|
|
1144
|
+
function vn(t, e, n) {
|
|
1145
|
+
return (d.string(t) ? xe(t, e, n) : t) || X(n);
|
|
1146
|
+
}
|
|
1147
|
+
function hn(t) {
|
|
1148
|
+
return d.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
|
|
1149
|
+
}
|
|
1150
|
+
var ur = { id: "auto-scroll", install: function(t) {
|
|
1151
|
+
var e = t.defaults, n = t.actions;
|
|
1152
|
+
t.autoScroll = E, E.now = function() {
|
|
1153
|
+
return t.now();
|
|
1154
|
+
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll = E.defaults;
|
|
1155
|
+
}, listeners: { "interactions:new": function(t) {
|
|
1156
|
+
t.interaction.autoScroll = null;
|
|
1157
|
+
}, "interactions:destroy": function(t) {
|
|
1158
|
+
t.interaction.autoScroll = null, E.stop(), E.interaction && (E.interaction = null);
|
|
1159
|
+
}, "interactions:stop": E.stop, "interactions:action-move": function(t) {
|
|
1160
|
+
return E.onInteractionMove(t);
|
|
1161
|
+
} } }, pr = ur;
|
|
1162
|
+
function Je(t, e) {
|
|
1163
|
+
var n = !1;
|
|
1164
|
+
return function() {
|
|
1165
|
+
return n || (R.console.warn(e), n = !0), t.apply(this, arguments);
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
function Rt(t, e) {
|
|
1169
|
+
return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t;
|
|
1170
|
+
}
|
|
1171
|
+
function dr(t) {
|
|
1172
|
+
return d.bool(t) ? (this.options.styleCursor = t, this) : t === null ? (delete this.options.styleCursor, this) : this.options.styleCursor;
|
|
1173
|
+
}
|
|
1174
|
+
function fr(t) {
|
|
1175
|
+
return d.func(t) ? (this.options.actionChecker = t, this) : t === null ? (delete this.options.actionChecker, this) : this.options.actionChecker;
|
|
1176
|
+
}
|
|
1177
|
+
var vr = { id: "auto-start/interactableMethods", install: function(t) {
|
|
1178
|
+
var e = t.Interactable;
|
|
1179
|
+
e.prototype.getAction = function(n, r, i, o) {
|
|
1180
|
+
var a = function(s, l, u, c, p) {
|
|
1181
|
+
var f = s.getRect(c), h = l.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[l.button], v = { action: null, interactable: s, interaction: u, element: c, rect: f, buttons: h };
|
|
1182
|
+
return p.fire("auto-start:check", v), v.action;
|
|
1183
|
+
}(this, r, i, o, t);
|
|
1184
|
+
return this.options.actionChecker ? this.options.actionChecker(n, r, a, this, o, i) : a;
|
|
1185
|
+
}, e.prototype.ignoreFrom = Je(function(n) {
|
|
1186
|
+
return this._backCompatOption("ignoreFrom", n);
|
|
1187
|
+
}, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e.prototype.allowFrom = Je(function(n) {
|
|
1188
|
+
return this._backCompatOption("allowFrom", n);
|
|
1189
|
+
}, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e.prototype.actionChecker = fr, e.prototype.styleCursor = dr;
|
|
1190
|
+
} };
|
|
1191
|
+
function gn(t, e, n, r, i) {
|
|
1192
|
+
return e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled && vt(e, n, t, i) ? t : null;
|
|
1193
|
+
}
|
|
1194
|
+
function hr(t, e, n, r, i, o, a) {
|
|
1195
|
+
for (var s = 0, l = r.length; s < l; s++) {
|
|
1196
|
+
var u = r[s], c = i[s], p = u.getAction(e, n, t, c);
|
|
1197
|
+
if (p) {
|
|
1198
|
+
var f = gn(p, u, c, o, a);
|
|
1199
|
+
if (f)
|
|
1200
|
+
return { action: f, interactable: u, element: c };
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
return { action: null, interactable: null, element: null };
|
|
1204
|
+
}
|
|
1205
|
+
function mn(t, e, n, r, i) {
|
|
1206
|
+
var o = [], a = [], s = r;
|
|
1207
|
+
function l(c) {
|
|
1208
|
+
o.push(c), a.push(s);
|
|
1209
|
+
}
|
|
1210
|
+
for (; d.element(s); ) {
|
|
1211
|
+
o = [], a = [], i.interactables.forEachMatch(s, l);
|
|
1212
|
+
var u = hr(t, e, n, o, a, r, i);
|
|
1213
|
+
if (u.action && !u.interactable.options[u.action.name].manualStart)
|
|
1214
|
+
return u;
|
|
1215
|
+
s = de(s);
|
|
1216
|
+
}
|
|
1217
|
+
return { action: null, interactable: null, element: null };
|
|
1218
|
+
}
|
|
1219
|
+
function yn(t, e, n) {
|
|
1220
|
+
var r = e.action, i = e.interactable, o = e.element;
|
|
1221
|
+
r = r || { name: null }, t.interactable = i, t.element = o, Rt(t.prepared, r), t.rect = i && r.name ? i.getRect(o) : null, xn(t, n), n.fire("autoStart:prepared", { interaction: t });
|
|
1222
|
+
}
|
|
1223
|
+
function vt(t, e, n, r) {
|
|
1224
|
+
var i = t.options, o = i[n.name].max, a = i[n.name].maxPerElement, s = r.autoStart.maxInteractions, l = 0, u = 0, c = 0;
|
|
1225
|
+
if (!(o && a && s))
|
|
1226
|
+
return !1;
|
|
1227
|
+
for (var p = 0, f = r.interactions.list; p < f.length; p++) {
|
|
1228
|
+
var h = f[p], v = h.prepared.name;
|
|
1229
|
+
if (h.interacting() && (++l >= s || h.interactable === t && ((u += v === n.name ? 1 : 0) >= o || h.element === e && (c++, v === n.name && c >= a))))
|
|
1230
|
+
return !1;
|
|
1231
|
+
}
|
|
1232
|
+
return s > 0;
|
|
1233
|
+
}
|
|
1234
|
+
function bn(t, e) {
|
|
1235
|
+
return d.number(t) ? (e.autoStart.maxInteractions = t, this) : e.autoStart.maxInteractions;
|
|
1236
|
+
}
|
|
1237
|
+
function jt(t, e, n) {
|
|
1238
|
+
var r = n.autoStart.cursorElement;
|
|
1239
|
+
r && r !== t && (r.style.cursor = ""), t.ownerDocument.documentElement.style.cursor = e, t.style.cursor = e, n.autoStart.cursorElement = e ? t : null;
|
|
1240
|
+
}
|
|
1241
|
+
function xn(t, e) {
|
|
1242
|
+
var n = t.interactable, r = t.element, i = t.prepared;
|
|
1243
|
+
if (t.pointerType === "mouse" && n && n.options.styleCursor) {
|
|
1244
|
+
var o = "";
|
|
1245
|
+
if (i.name) {
|
|
1246
|
+
var a = n.options[i.name].cursorChecker;
|
|
1247
|
+
o = d.func(a) ? a(i, n, r, t._interacting) : e.actions.map[i.name].getCursor(i);
|
|
1248
|
+
}
|
|
1249
|
+
jt(t.element, o || "", e);
|
|
1250
|
+
} else
|
|
1251
|
+
e.autoStart.cursorElement && jt(e.autoStart.cursorElement, "", e);
|
|
1252
|
+
}
|
|
1253
|
+
var gr = { id: "auto-start/base", before: ["actions"], install: function(t) {
|
|
1254
|
+
var e = t.interactStatic, n = t.defaults;
|
|
1255
|
+
t.usePlugin(vr), n.base.actionChecker = null, n.base.styleCursor = !0, y(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
|
|
1256
|
+
return bn(r, t);
|
|
1257
|
+
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: vt, cursorElement: null };
|
|
1258
|
+
}, listeners: { "interactions:down": function(t, e) {
|
|
1259
|
+
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget;
|
|
1260
|
+
n.interacting() || yn(n, mn(n, r, i, o, e), e);
|
|
1261
|
+
}, "interactions:move": function(t, e) {
|
|
1262
|
+
(function(n, r) {
|
|
1263
|
+
var i = n.interaction, o = n.pointer, a = n.event, s = n.eventTarget;
|
|
1264
|
+
i.pointerType !== "mouse" || i.pointerIsDown || i.interacting() || yn(i, mn(i, o, a, s, r), r);
|
|
1265
|
+
})(t, e), function(n, r) {
|
|
1266
|
+
var i = n.interaction;
|
|
1267
|
+
if (i.pointerIsDown && !i.interacting() && i.pointerWasMoved && i.prepared.name) {
|
|
1268
|
+
r.fire("autoStart:before-start", n);
|
|
1269
|
+
var o = i.interactable, a = i.prepared.name;
|
|
1270
|
+
a && o && (o.options[a].manualStart || !vt(o, i.element, i.prepared, r) ? i.stop() : (i.start(i.prepared, o, i.element), xn(i, r)));
|
|
1271
|
+
}
|
|
1272
|
+
}(t, e);
|
|
1273
|
+
}, "interactions:stop": function(t, e) {
|
|
1274
|
+
var n = t.interaction, r = n.interactable;
|
|
1275
|
+
r && r.options.styleCursor && jt(n.element, "", e);
|
|
1276
|
+
} }, maxInteractions: bn, withinInteractionLimit: vt, validateAction: gn }, Ft = gr, mr = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
|
|
1277
|
+
var n = t.interaction, r = t.eventTarget, i = t.dx, o = t.dy;
|
|
1278
|
+
if (n.prepared.name === "drag") {
|
|
1279
|
+
var a = Math.abs(i), s = Math.abs(o), l = n.interactable.options.drag, u = l.startAxis, c = a > s ? "x" : a < s ? "y" : "xy";
|
|
1280
|
+
if (n.prepared.axis = l.lockAxis === "start" ? c[0] : l.lockAxis, c !== "xy" && u !== "xy" && u !== c) {
|
|
1281
|
+
n.prepared.name = null;
|
|
1282
|
+
for (var p = r, f = function(v) {
|
|
1283
|
+
if (v !== n.interactable) {
|
|
1284
|
+
var g = n.interactable.options.drag;
|
|
1285
|
+
if (!g.manualStart && v.testIgnoreAllow(g, p, r)) {
|
|
1286
|
+
var b = v.getAction(n.downPointer, n.downEvent, n, p);
|
|
1287
|
+
if (b && b.name === "drag" && function(m, w) {
|
|
1288
|
+
if (!w)
|
|
1289
|
+
return !1;
|
|
1290
|
+
var S = w.options.drag.startAxis;
|
|
1291
|
+
return m === "xy" || S === "xy" || S === m;
|
|
1292
|
+
}(c, v) && Ft.validateAction(b, v, p, r, e))
|
|
1293
|
+
return v;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
}; d.element(p); ) {
|
|
1297
|
+
var h = e.interactables.forEachMatch(p, f);
|
|
1298
|
+
if (h) {
|
|
1299
|
+
n.prepared.name = "drag", n.interactable = h, n.element = p;
|
|
1300
|
+
break;
|
|
1301
|
+
}
|
|
1302
|
+
p = de(p);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
} } };
|
|
1307
|
+
function Vt(t) {
|
|
1308
|
+
var e = t.prepared && t.prepared.name;
|
|
1309
|
+
if (!e)
|
|
1310
|
+
return null;
|
|
1311
|
+
var n = t.interactable.options;
|
|
1312
|
+
return n[e].hold || n[e].delay;
|
|
1313
|
+
}
|
|
1314
|
+
var yr = { id: "auto-start/hold", install: function(t) {
|
|
1315
|
+
var e = t.defaults;
|
|
1316
|
+
t.usePlugin(Ft), e.perAction.hold = 0, e.perAction.delay = 0;
|
|
1317
|
+
}, listeners: { "interactions:new": function(t) {
|
|
1318
|
+
t.interaction.autoStartHoldTimer = null;
|
|
1319
|
+
}, "autoStart:prepared": function(t) {
|
|
1320
|
+
var e = t.interaction, n = Vt(e);
|
|
1321
|
+
n > 0 && (e.autoStartHoldTimer = setTimeout(function() {
|
|
1322
|
+
e.start(e.prepared, e.interactable, e.element);
|
|
1323
|
+
}, n));
|
|
1324
|
+
}, "interactions:move": function(t) {
|
|
1325
|
+
var e = t.interaction, n = t.duplicate;
|
|
1326
|
+
e.autoStartHoldTimer && e.pointerWasMoved && !n && (clearTimeout(e.autoStartHoldTimer), e.autoStartHoldTimer = null);
|
|
1327
|
+
}, "autoStart:before-start": function(t) {
|
|
1328
|
+
var e = t.interaction;
|
|
1329
|
+
Vt(e) > 0 && (e.prepared.name = null);
|
|
1330
|
+
} }, getHoldDuration: Vt }, br = yr, xr = { id: "auto-start", install: function(t) {
|
|
1331
|
+
t.usePlugin(Ft), t.usePlugin(br), t.usePlugin(mr);
|
|
1332
|
+
} }, wr = function(t) {
|
|
1333
|
+
return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) : d.bool(t) ? (this.options.preventDefault = t ? "always" : "never", this) : this.options.preventDefault;
|
|
1334
|
+
};
|
|
1335
|
+
function _r(t) {
|
|
1336
|
+
var e = t.interaction, n = t.event;
|
|
1337
|
+
e.interactable && e.interactable.checkAndPreventDefault(n);
|
|
1338
|
+
}
|
|
1339
|
+
var wn = { id: "core/interactablePreventDefault", install: function(t) {
|
|
1340
|
+
var e = t.Interactable;
|
|
1341
|
+
e.prototype.preventDefault = wr, e.prototype.checkAndPreventDefault = function(n) {
|
|
1342
|
+
return function(r, i, o) {
|
|
1343
|
+
var a = r.options.preventDefault;
|
|
1344
|
+
if (a !== "never")
|
|
1345
|
+
if (a !== "always") {
|
|
1346
|
+
if (i.events.supportsPassive && /^touch(start|move)$/.test(o.type)) {
|
|
1347
|
+
var s = X(o.target).document, l = i.getDocOptions(s);
|
|
1348
|
+
if (!l || !l.events || l.events.passive !== !1)
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
/^(mouse|pointer|touch)*(down|start)/i.test(o.type) || d.element(o.target) && me(o.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || o.preventDefault();
|
|
1352
|
+
} else
|
|
1353
|
+
o.preventDefault();
|
|
1354
|
+
}(this, t, n);
|
|
1355
|
+
}, t.interactions.docEvents.push({ type: "dragstart", listener: function(n) {
|
|
1356
|
+
for (var r = 0, i = t.interactions.list; r < i.length; r++) {
|
|
1357
|
+
var o = i[r];
|
|
1358
|
+
if (o.element && (o.element === n.target || ye(o.element, n.target)))
|
|
1359
|
+
return void o.interactable.checkAndPreventDefault(n);
|
|
1360
|
+
}
|
|
1361
|
+
} });
|
|
1362
|
+
}, listeners: ["down", "move", "up", "cancel"].reduce(function(t, e) {
|
|
1363
|
+
return t["interactions:".concat(e)] = _r, t;
|
|
1364
|
+
}, {}) };
|
|
1365
|
+
function ht(t, e) {
|
|
1366
|
+
if (e.phaselessTypes[t])
|
|
1367
|
+
return !0;
|
|
1368
|
+
for (var n in e.map)
|
|
1369
|
+
if (t.indexOf(n) === 0 && t.substr(n.length) in e.phases)
|
|
1370
|
+
return !0;
|
|
1371
|
+
return !1;
|
|
1372
|
+
}
|
|
1373
|
+
function Le(t) {
|
|
1374
|
+
var e = {};
|
|
1375
|
+
for (var n in t) {
|
|
1376
|
+
var r = t[n];
|
|
1377
|
+
d.plainObject(r) ? e[n] = Le(r) : d.array(r) ? e[n] = sn(r) : e[n] = r;
|
|
1378
|
+
}
|
|
1379
|
+
return e;
|
|
1380
|
+
}
|
|
1381
|
+
var $t = function() {
|
|
1382
|
+
function t(e) {
|
|
1383
|
+
A(this, t), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e, this.result = gt(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1384
|
+
}
|
|
1385
|
+
return P(t, [{ key: "start", value: function(e, n) {
|
|
1386
|
+
var r, i, o = e.phase, a = this.interaction, s = function(u) {
|
|
1387
|
+
var c = u.interactable.options[u.prepared.name], p = c.modifiers;
|
|
1388
|
+
return p && p.length ? p : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map(function(f) {
|
|
1389
|
+
var h = c[f];
|
|
1390
|
+
return h && h.enabled && { options: h, methods: h._methods };
|
|
1391
|
+
}).filter(function(f) {
|
|
1392
|
+
return !!f;
|
|
1393
|
+
});
|
|
1394
|
+
}(a);
|
|
1395
|
+
this.prepareStates(s), this.startEdges = y({}, a.edges), this.edges = y({}, this.startEdges), this.startOffset = (r = a.rect, i = n, r ? { left: i.x - r.left, top: i.y - r.top, right: r.right - i.x, bottom: r.bottom - i.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
|
|
1396
|
+
var l = this.fillArg({ phase: o, pageCoords: n, preEnd: !1 });
|
|
1397
|
+
return this.result = gt(), this.startAll(l), this.result = this.setAll(l);
|
|
1398
|
+
} }, { key: "fillArg", value: function(e) {
|
|
1399
|
+
var n = this.interaction;
|
|
1400
|
+
return e.interaction = n, e.interactable = n.interactable, e.element = n.element, e.rect || (e.rect = n.rect), e.edges || (e.edges = this.startEdges), e.startOffset = this.startOffset, e;
|
|
1401
|
+
} }, { key: "startAll", value: function(e) {
|
|
1402
|
+
for (var n = 0, r = this.states; n < r.length; n++) {
|
|
1403
|
+
var i = r[n];
|
|
1404
|
+
i.methods.start && (e.state = i, i.methods.start(e));
|
|
1405
|
+
}
|
|
1406
|
+
} }, { key: "setAll", value: function(e) {
|
|
1407
|
+
var n = e.phase, r = e.preEnd, i = e.skipModifiers, o = e.rect, a = e.edges;
|
|
1408
|
+
e.coords = y({}, e.pageCoords), e.rect = y({}, o), e.edges = y({}, a);
|
|
1409
|
+
for (var s = i ? this.states.slice(i) : this.states, l = gt(e.coords, e.rect), u = 0; u < s.length; u++) {
|
|
1410
|
+
var c, p = s[u], f = p.options, h = y({}, e.coords), v = null;
|
|
1411
|
+
(c = p.methods) != null && c.set && this.shouldDo(f, r, n) && (e.state = p, v = p.methods.set(e), ct(e.edges, e.rect, { x: e.coords.x - h.x, y: e.coords.y - h.y })), l.eventProps.push(v);
|
|
1412
|
+
}
|
|
1413
|
+
y(this.edges, e.edges), l.delta.x = e.coords.x - e.pageCoords.x, l.delta.y = e.coords.y - e.pageCoords.y, l.rectDelta.left = e.rect.left - o.left, l.rectDelta.right = e.rect.right - o.right, l.rectDelta.top = e.rect.top - o.top, l.rectDelta.bottom = e.rect.bottom - o.bottom;
|
|
1414
|
+
var g = this.result.coords, b = this.result.rect;
|
|
1415
|
+
if (g && b) {
|
|
1416
|
+
var m = l.rect.left !== b.left || l.rect.right !== b.right || l.rect.top !== b.top || l.rect.bottom !== b.bottom;
|
|
1417
|
+
l.changed = m || g.x !== l.coords.x || g.y !== l.coords.y;
|
|
1418
|
+
}
|
|
1419
|
+
return l;
|
|
1420
|
+
} }, { key: "applyToInteraction", value: function(e) {
|
|
1421
|
+
var n = this.interaction, r = e.phase, i = n.coords.cur, o = n.coords.start, a = this.result, s = this.startDelta, l = a.delta;
|
|
1422
|
+
r === "start" && y(this.startDelta, a.delta);
|
|
1423
|
+
for (var u = 0, c = [[o, s], [i, l]]; u < c.length; u++) {
|
|
1424
|
+
var p = c[u], f = p[0], h = p[1];
|
|
1425
|
+
f.page.x += h.x, f.page.y += h.y, f.client.x += h.x, f.client.y += h.y;
|
|
1426
|
+
}
|
|
1427
|
+
var v = this.result.rectDelta, g = e.rect || n.rect;
|
|
1428
|
+
g.left += v.left, g.right += v.right, g.top += v.top, g.bottom += v.bottom, g.width = g.right - g.left, g.height = g.bottom - g.top;
|
|
1429
|
+
} }, { key: "setAndApply", value: function(e) {
|
|
1430
|
+
var n = this.interaction, r = e.phase, i = e.preEnd, o = e.skipModifiers, a = this.setAll(this.fillArg({ preEnd: i, phase: r, pageCoords: e.modifiedCoords || n.coords.cur.page }));
|
|
1431
|
+
if (this.result = a, !a.changed && (!o || o < this.states.length) && n.interacting())
|
|
1432
|
+
return !1;
|
|
1433
|
+
if (e.modifiedCoords) {
|
|
1434
|
+
var s = n.coords.cur.page, l = { x: e.modifiedCoords.x - s.x, y: e.modifiedCoords.y - s.y };
|
|
1435
|
+
a.coords.x += l.x, a.coords.y += l.y, a.delta.x += l.x, a.delta.y += l.y;
|
|
1436
|
+
}
|
|
1437
|
+
this.applyToInteraction(e);
|
|
1438
|
+
} }, { key: "beforeEnd", value: function(e) {
|
|
1439
|
+
var n = e.interaction, r = e.event, i = this.states;
|
|
1440
|
+
if (i && i.length) {
|
|
1441
|
+
for (var o = !1, a = 0; a < i.length; a++) {
|
|
1442
|
+
var s = i[a];
|
|
1443
|
+
e.state = s;
|
|
1444
|
+
var l = s.options, u = s.methods, c = u.beforeEnd && u.beforeEnd(e);
|
|
1445
|
+
if (c)
|
|
1446
|
+
return this.endResult = c, !1;
|
|
1447
|
+
o = o || !o && this.shouldDo(l, !0, e.phase, !0);
|
|
1448
|
+
}
|
|
1449
|
+
o && n.move({ event: r, preEnd: !0 });
|
|
1450
|
+
}
|
|
1451
|
+
} }, { key: "stop", value: function(e) {
|
|
1452
|
+
var n = e.interaction;
|
|
1453
|
+
if (this.states && this.states.length) {
|
|
1454
|
+
var r = y({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
|
|
1455
|
+
this.fillArg(r);
|
|
1456
|
+
for (var i = 0, o = this.states; i < o.length; i++) {
|
|
1457
|
+
var a = o[i];
|
|
1458
|
+
r.state = a, a.methods.stop && a.methods.stop(r);
|
|
1459
|
+
}
|
|
1460
|
+
this.states = null, this.endResult = null;
|
|
1461
|
+
}
|
|
1462
|
+
} }, { key: "prepareStates", value: function(e) {
|
|
1463
|
+
this.states = [];
|
|
1464
|
+
for (var n = 0; n < e.length; n++) {
|
|
1465
|
+
var r = e[n], i = r.options, o = r.methods, a = r.name;
|
|
1466
|
+
this.states.push({ options: i, methods: o, index: n, name: a });
|
|
1467
|
+
}
|
|
1468
|
+
return this.states;
|
|
1469
|
+
} }, { key: "restoreInteractionCoords", value: function(e) {
|
|
1470
|
+
var n = e.interaction, r = n.coords, i = n.rect, o = n.modification;
|
|
1471
|
+
if (o.result) {
|
|
1472
|
+
for (var a = o.startDelta, s = o.result, l = s.delta, u = s.rectDelta, c = 0, p = [[r.start, a], [r.cur, l]]; c < p.length; c++) {
|
|
1473
|
+
var f = p[c], h = f[0], v = f[1];
|
|
1474
|
+
h.page.x -= v.x, h.page.y -= v.y, h.client.x -= v.x, h.client.y -= v.y;
|
|
1475
|
+
}
|
|
1476
|
+
i.left -= u.left, i.right -= u.right, i.top -= u.top, i.bottom -= u.bottom;
|
|
1477
|
+
}
|
|
1478
|
+
} }, { key: "shouldDo", value: function(e, n, r, i) {
|
|
1479
|
+
return !(!e || e.enabled === !1 || i && !e.endOnly || e.endOnly && !n || r === "start" && !e.setStart);
|
|
1480
|
+
} }, { key: "copyFrom", value: function(e) {
|
|
1481
|
+
this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map(function(n) {
|
|
1482
|
+
return Le(n);
|
|
1483
|
+
}), this.result = gt(y({}, e.result.coords), y({}, e.result.rect));
|
|
1484
|
+
} }, { key: "destroy", value: function() {
|
|
1485
|
+
for (var e in this)
|
|
1486
|
+
this[e] = null;
|
|
1487
|
+
} }]), t;
|
|
1488
|
+
}();
|
|
1489
|
+
function gt(t, e) {
|
|
1490
|
+
return { rect: e, coords: t, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: !0 };
|
|
1491
|
+
}
|
|
1492
|
+
function Oe(t, e) {
|
|
1493
|
+
var n = t.defaults, r = { start: t.start, set: t.set, beforeEnd: t.beforeEnd, stop: t.stop }, i = function(o) {
|
|
1494
|
+
var a = o || {};
|
|
1495
|
+
for (var s in a.enabled = a.enabled !== !1, n)
|
|
1496
|
+
s in a || (a[s] = n[s]);
|
|
1497
|
+
var l = { options: a, methods: r, name: e, enable: function() {
|
|
1498
|
+
return a.enabled = !0, l;
|
|
1499
|
+
}, disable: function() {
|
|
1500
|
+
return a.enabled = !1, l;
|
|
1501
|
+
} };
|
|
1502
|
+
return l;
|
|
1503
|
+
};
|
|
1504
|
+
return e && typeof e == "string" && (i._defaults = n, i._methods = r), i;
|
|
1505
|
+
}
|
|
1506
|
+
function Qe(t) {
|
|
1507
|
+
var e = t.iEvent, n = t.interaction.modification.result;
|
|
1508
|
+
n && (e.modifiers = n.eventProps);
|
|
1509
|
+
}
|
|
1510
|
+
var Er = { id: "modifiers/base", before: ["actions"], install: function(t) {
|
|
1511
|
+
t.defaults.perAction.modifiers = [];
|
|
1512
|
+
}, listeners: { "interactions:new": function(t) {
|
|
1513
|
+
var e = t.interaction;
|
|
1514
|
+
e.modification = new $t(e);
|
|
1515
|
+
}, "interactions:before-action-start": function(t) {
|
|
1516
|
+
var e = t.interaction, n = t.interaction.modification;
|
|
1517
|
+
n.start(t, e.coords.start.page), e.edges = n.edges, n.applyToInteraction(t);
|
|
1518
|
+
}, "interactions:before-action-move": function(t) {
|
|
1519
|
+
var e = t.interaction, n = e.modification, r = n.setAndApply(t);
|
|
1520
|
+
return e.edges = n.edges, r;
|
|
1521
|
+
}, "interactions:before-action-end": function(t) {
|
|
1522
|
+
var e = t.interaction, n = e.modification, r = n.beforeEnd(t);
|
|
1523
|
+
return e.edges = n.startEdges, r;
|
|
1524
|
+
}, "interactions:action-start": Qe, "interactions:action-move": Qe, "interactions:action-end": Qe, "interactions:after-action-start": function(t) {
|
|
1525
|
+
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1526
|
+
}, "interactions:after-action-move": function(t) {
|
|
1527
|
+
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1528
|
+
}, "interactions:stop": function(t) {
|
|
1529
|
+
return t.interaction.modification.stop(t);
|
|
1530
|
+
} } }, _n = Er, En = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, Nt = function(t) {
|
|
1531
|
+
W(n, t);
|
|
1532
|
+
var e = le(n);
|
|
1533
|
+
function n(r, i, o, a, s, l, u) {
|
|
1534
|
+
var c;
|
|
1535
|
+
A(this, n), (c = e.call(this, r)).relatedTarget = null, c.screenX = void 0, c.screenY = void 0, c.button = void 0, c.buttons = void 0, c.ctrlKey = void 0, c.shiftKey = void 0, c.altKey = void 0, c.metaKey = void 0, c.page = void 0, c.client = void 0, c.delta = void 0, c.rect = void 0, c.x0 = void 0, c.y0 = void 0, c.t0 = void 0, c.dt = void 0, c.duration = void 0, c.clientX0 = void 0, c.clientY0 = void 0, c.velocity = void 0, c.speed = void 0, c.swipe = void 0, c.axes = void 0, c.preEnd = void 0, s = s || r.element;
|
|
1536
|
+
var p = r.interactable, f = (p && p.options || En).deltaSource, h = qe(p, s, o), v = a === "start", g = a === "end", b = v ? J(c) : r.prevEvent, m = v ? r.coords.start : g ? { page: b.page, client: b.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
1537
|
+
return c.page = y({}, m.page), c.client = y({}, m.client), c.rect = y({}, r.rect), c.timeStamp = m.timeStamp, g || (c.page.x -= h.x, c.page.y -= h.y, c.client.x -= h.x, c.client.y -= h.y), c.ctrlKey = i.ctrlKey, c.altKey = i.altKey, c.shiftKey = i.shiftKey, c.metaKey = i.metaKey, c.button = i.button, c.buttons = i.buttons, c.target = s, c.currentTarget = s, c.preEnd = l, c.type = u || o + (a || ""), c.interactable = p, c.t0 = v ? r.pointers[r.pointers.length - 1].downTime : b.t0, c.x0 = r.coords.start.page.x - h.x, c.y0 = r.coords.start.page.y - h.y, c.clientX0 = r.coords.start.client.x - h.x, c.clientY0 = r.coords.start.client.y - h.y, c.delta = v || g ? { x: 0, y: 0 } : { x: c[f].x - b[f].x, y: c[f].y - b[f].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = y({}, r.coords.velocity[f]), c.speed = Ue(c.velocity.x, c.velocity.y), c.swipe = g || a === "inertiastart" ? c.getSwipe() : null, c;
|
|
1538
|
+
}
|
|
1539
|
+
return P(n, [{ key: "getSwipe", value: function() {
|
|
1540
|
+
var r = this._interaction;
|
|
1541
|
+
if (r.prevEvent.speed < 600 || this.timeStamp - r.prevEvent.timeStamp > 150)
|
|
1542
|
+
return null;
|
|
1543
|
+
var i = 180 * Math.atan2(r.prevEvent.velocityY, r.prevEvent.velocityX) / Math.PI;
|
|
1544
|
+
i < 0 && (i += 360);
|
|
1545
|
+
var o = 112.5 <= i && i < 247.5, a = 202.5 <= i && i < 337.5;
|
|
1546
|
+
return { up: a, down: !a && 22.5 <= i && i < 157.5, left: o, right: !o && (292.5 <= i || i < 67.5), angle: i, speed: r.prevEvent.speed, velocity: { x: r.prevEvent.velocityX, y: r.prevEvent.velocityY } };
|
|
1547
|
+
} }, { key: "preventDefault", value: function() {
|
|
1548
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
|
1549
|
+
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
1550
|
+
} }, { key: "stopPropagation", value: function() {
|
|
1551
|
+
this.propagationStopped = !0;
|
|
1552
|
+
} }]), n;
|
|
1553
|
+
}(ft);
|
|
1554
|
+
Object.defineProperties(Nt.prototype, { pageX: { get: function() {
|
|
1555
|
+
return this.page.x;
|
|
1556
|
+
}, set: function(t) {
|
|
1557
|
+
this.page.x = t;
|
|
1558
|
+
} }, pageY: { get: function() {
|
|
1559
|
+
return this.page.y;
|
|
1560
|
+
}, set: function(t) {
|
|
1561
|
+
this.page.y = t;
|
|
1562
|
+
} }, clientX: { get: function() {
|
|
1563
|
+
return this.client.x;
|
|
1564
|
+
}, set: function(t) {
|
|
1565
|
+
this.client.x = t;
|
|
1566
|
+
} }, clientY: { get: function() {
|
|
1567
|
+
return this.client.y;
|
|
1568
|
+
}, set: function(t) {
|
|
1569
|
+
this.client.y = t;
|
|
1570
|
+
} }, dx: { get: function() {
|
|
1571
|
+
return this.delta.x;
|
|
1572
|
+
}, set: function(t) {
|
|
1573
|
+
this.delta.x = t;
|
|
1574
|
+
} }, dy: { get: function() {
|
|
1575
|
+
return this.delta.y;
|
|
1576
|
+
}, set: function(t) {
|
|
1577
|
+
this.delta.y = t;
|
|
1578
|
+
} }, velocityX: { get: function() {
|
|
1579
|
+
return this.velocity.x;
|
|
1580
|
+
}, set: function(t) {
|
|
1581
|
+
this.velocity.x = t;
|
|
1582
|
+
} }, velocityY: { get: function() {
|
|
1583
|
+
return this.velocity.y;
|
|
1584
|
+
}, set: function(t) {
|
|
1585
|
+
this.velocity.y = t;
|
|
1586
|
+
} } });
|
|
1587
|
+
var Sr = P(function t(e, n, r, i, o) {
|
|
1588
|
+
A(this, t), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e, this.pointer = n, this.event = r, this.downTime = i, this.downTarget = o;
|
|
1589
|
+
}), Tr = function(t) {
|
|
1590
|
+
return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
|
|
1591
|
+
}({}), Sn = function(t) {
|
|
1592
|
+
return t.start = "", t.move = "", t.end = "", t.stop = "", t.interacting = "", t;
|
|
1593
|
+
}({}), kr = 0, Pr = function() {
|
|
1594
|
+
function t(e) {
|
|
1595
|
+
var n = this, r = e.pointerType, i = e.scopeFire;
|
|
1596
|
+
A(this, t), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove = Je(function(c) {
|
|
1597
|
+
this.move(c);
|
|
1598
|
+
}, "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = kr++, this._scopeFire = i, this.pointerType = r;
|
|
1599
|
+
var o = this;
|
|
1600
|
+
this._proxy = {};
|
|
1601
|
+
var a = function(c) {
|
|
1602
|
+
Object.defineProperty(n._proxy, c, { get: function() {
|
|
1603
|
+
return o[c];
|
|
1604
|
+
} });
|
|
1605
|
+
};
|
|
1606
|
+
for (var s in Tr)
|
|
1607
|
+
a(s);
|
|
1608
|
+
var l = function(c) {
|
|
1609
|
+
Object.defineProperty(n._proxy, c, { value: function() {
|
|
1610
|
+
return o[c].apply(o, arguments);
|
|
1611
|
+
} });
|
|
1612
|
+
};
|
|
1613
|
+
for (var u in Sn)
|
|
1614
|
+
l(u);
|
|
1615
|
+
this._scopeFire("interactions:new", { interaction: this });
|
|
1616
|
+
}
|
|
1617
|
+
return P(t, [{ key: "pointerMoveTolerance", get: function() {
|
|
1618
|
+
return 1;
|
|
1619
|
+
} }, { key: "pointerDown", value: function(e, n, r) {
|
|
1620
|
+
var i = this.updatePointer(e, n, r, !0), o = this.pointers[i];
|
|
1621
|
+
this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: i, pointerInfo: o, type: "down", interaction: this });
|
|
1622
|
+
} }, { key: "start", value: function(e, n, r) {
|
|
1623
|
+
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (Rt(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? y({}, this.prepared.edges) : { left: !0, right: !0, top: !0, bottom: !0 }, this._stopped = !1, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
|
|
1624
|
+
} }, { key: "pointerMove", value: function(e, n, r) {
|
|
1625
|
+
this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
|
|
1626
|
+
var i, o, a = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
|
|
1627
|
+
this.pointerIsDown && !this.pointerWasMoved && (i = this.coords.cur.client.x - this.coords.start.client.x, o = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = Ue(i, o) > this.pointerMoveTolerance);
|
|
1628
|
+
var s, l, u, c = this.getPointerIndex(e), p = { pointer: e, pointerIndex: c, pointerInfo: this.pointers[c], event: n, type: "move", eventTarget: r, dx: i, dy: o, duplicate: a, interaction: this };
|
|
1629
|
+
a || (s = this.coords.velocity, l = this.coords.delta, u = Math.max(l.timeStamp / 1e3, 1e-3), s.page.x = l.page.x / u, s.page.y = l.page.y / u, s.client.x = l.client.x / u, s.client.y = l.client.y / u, s.timeStamp = u), this._scopeFire("interactions:move", p), a || this.simulation || (this.interacting() && (p.type = null, this.move(p)), this.pointerWasMoved && pt(this.coords.prev, this.coords.cur));
|
|
1630
|
+
} }, { key: "move", value: function(e) {
|
|
1631
|
+
e && e.event || Zt(this.coords.delta), (e = y({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
|
|
1632
|
+
} }, { key: "pointerUp", value: function(e, n, r, i) {
|
|
1633
|
+
var o = this.getPointerIndex(e);
|
|
1634
|
+
o === -1 && (o = this.updatePointer(e, n, r, !1));
|
|
1635
|
+
var a = /cancel$/i.test(n.type) ? "cancel" : "up";
|
|
1636
|
+
this._scopeFire("interactions:".concat(a), { pointer: e, pointerIndex: o, pointerInfo: this.pointers[o], event: n, eventTarget: r, type: a, curEventTarget: i, interaction: this }), this.simulation || this.end(n), this.removePointer(e, n);
|
|
1637
|
+
} }, { key: "documentBlur", value: function(e) {
|
|
1638
|
+
this.end(e), this._scopeFire("interactions:blur", { event: e, type: "blur", interaction: this });
|
|
1639
|
+
} }, { key: "end", value: function(e) {
|
|
1640
|
+
var n;
|
|
1641
|
+
this._ending = !0, e = e || this._latestPointer.event, this.interacting() && (n = this._doPhase({ event: e, interaction: this, phase: "end" })), this._ending = !1, n === !0 && this.stop();
|
|
1642
|
+
} }, { key: "currentAction", value: function() {
|
|
1643
|
+
return this._interacting ? this.prepared.name : null;
|
|
1644
|
+
} }, { key: "interacting", value: function() {
|
|
1645
|
+
return this._interacting;
|
|
1646
|
+
} }, { key: "stop", value: function() {
|
|
1647
|
+
this._scopeFire("interactions:stop", { interaction: this }), this.interactable = this.element = null, this._interacting = !1, this._stopped = !0, this.prepared.name = this.prevEvent = null;
|
|
1648
|
+
} }, { key: "getPointerIndex", value: function(e) {
|
|
1649
|
+
var n = He(e);
|
|
1650
|
+
return this.pointerType === "mouse" || this.pointerType === "pen" ? this.pointers.length - 1 : Ge(this.pointers, function(r) {
|
|
1651
|
+
return r.id === n;
|
|
1652
|
+
});
|
|
1653
|
+
} }, { key: "getPointerInfo", value: function(e) {
|
|
1654
|
+
return this.pointers[this.getPointerIndex(e)];
|
|
1655
|
+
} }, { key: "updatePointer", value: function(e, n, r, i) {
|
|
1656
|
+
var o, a, s, l = He(e), u = this.getPointerIndex(e), c = this.pointers[u];
|
|
1657
|
+
return i = i !== !1 && (i || /(down|start)$/i.test(n.type)), c ? c.pointer = e : (c = new Sr(l, e, n, null, null), u = this.pointers.length, this.pointers.push(c)), ir(this.coords.cur, this.pointers.map(function(p) {
|
|
1658
|
+
return p.pointer;
|
|
1659
|
+
}), this._now()), o = this.coords.delta, a = this.coords.prev, s = this.coords.cur, o.page.x = s.page.x - a.page.x, o.page.y = s.page.y - a.page.y, o.client.x = s.client.x - a.client.x, o.client.y = s.client.y - a.client.y, o.timeStamp = s.timeStamp - a.timeStamp, i && (this.pointerIsDown = !0, c.downTime = this.coords.cur.timeStamp, c.downTarget = r, ut(this.downPointer, e), this.interacting() || (pt(this.coords.start, this.coords.cur), pt(this.coords.prev, this.coords.cur), this.downEvent = n, this.pointerWasMoved = !1)), this._updateLatestPointer(e, n, r), this._scopeFire("interactions:update-pointer", { pointer: e, event: n, eventTarget: r, down: i, pointerInfo: c, pointerIndex: u, interaction: this }), u;
|
|
1660
|
+
} }, { key: "removePointer", value: function(e, n) {
|
|
1661
|
+
var r = this.getPointerIndex(e);
|
|
1662
|
+
if (r !== -1) {
|
|
1663
|
+
var i = this.pointers[r];
|
|
1664
|
+
this._scopeFire("interactions:remove-pointer", { pointer: e, event: n, eventTarget: null, pointerIndex: r, pointerInfo: i, interaction: this }), this.pointers.splice(r, 1), this.pointerIsDown = !1;
|
|
1665
|
+
}
|
|
1666
|
+
} }, { key: "_updateLatestPointer", value: function(e, n, r) {
|
|
1667
|
+
this._latestPointer.pointer = e, this._latestPointer.event = n, this._latestPointer.eventTarget = r;
|
|
1668
|
+
} }, { key: "destroy", value: function() {
|
|
1669
|
+
this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
|
|
1670
|
+
} }, { key: "_createPreparedEvent", value: function(e, n, r, i) {
|
|
1671
|
+
return new Nt(this, e, this.prepared.name, n, this.element, r, i);
|
|
1672
|
+
} }, { key: "_fireEvent", value: function(e) {
|
|
1673
|
+
var n;
|
|
1674
|
+
(n = this.interactable) == null || n.fire(e), (!this.prevEvent || e.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = e);
|
|
1675
|
+
} }, { key: "_doPhase", value: function(e) {
|
|
1676
|
+
var n = e.event, r = e.phase, i = e.preEnd, o = e.type, a = this.rect;
|
|
1677
|
+
if (a && r === "move" && (ct(this.edges, a, this.coords.delta[this.interactable.options.deltaSource]), a.width = a.right - a.left, a.height = a.bottom - a.top), this._scopeFire("interactions:before-action-".concat(r), e) === !1)
|
|
1678
|
+
return !1;
|
|
1679
|
+
var s = e.iEvent = this._createPreparedEvent(n, r, i, o);
|
|
1680
|
+
return this._scopeFire("interactions:action-".concat(r), e), r === "start" && (this.prevEvent = s), this._fireEvent(s), this._scopeFire("interactions:after-action-".concat(r), e), !0;
|
|
1681
|
+
} }, { key: "_now", value: function() {
|
|
1682
|
+
return Date.now();
|
|
1683
|
+
} }]), t;
|
|
1684
|
+
}();
|
|
1685
|
+
function Tn(t) {
|
|
1686
|
+
kn(t.interaction);
|
|
1687
|
+
}
|
|
1688
|
+
function kn(t) {
|
|
1689
|
+
if (!function(n) {
|
|
1690
|
+
return !(!n.offset.pending.x && !n.offset.pending.y);
|
|
1691
|
+
}(t))
|
|
1692
|
+
return !1;
|
|
1693
|
+
var e = t.offset.pending;
|
|
1694
|
+
return Bt(t.coords.cur, e), Bt(t.coords.delta, e), ct(t.edges, t.rect, e), e.x = 0, e.y = 0, !0;
|
|
1695
|
+
}
|
|
1696
|
+
function Or(t) {
|
|
1697
|
+
var e = t.x, n = t.y;
|
|
1698
|
+
this.offset.pending.x += e, this.offset.pending.y += n, this.offset.total.x += e, this.offset.total.y += n;
|
|
1699
|
+
}
|
|
1700
|
+
function Bt(t, e) {
|
|
1701
|
+
var n = t.page, r = t.client, i = e.x, o = e.y;
|
|
1702
|
+
n.x += i, n.y += o, r.x += i, r.y += o;
|
|
1703
|
+
}
|
|
1704
|
+
Sn.offsetBy = "";
|
|
1705
|
+
var Ir = { id: "offset", before: ["modifiers", "pointer-events", "actions", "inertia"], install: function(t) {
|
|
1706
|
+
t.Interaction.prototype.offsetBy = Or;
|
|
1707
|
+
}, listeners: { "interactions:new": function(t) {
|
|
1708
|
+
t.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
|
|
1709
|
+
}, "interactions:update-pointer": function(t) {
|
|
1710
|
+
return function(e) {
|
|
1711
|
+
e.pointerIsDown && (Bt(e.coords.cur, e.offset.total), e.offset.pending.x = 0, e.offset.pending.y = 0);
|
|
1712
|
+
}(t.interaction);
|
|
1713
|
+
}, "interactions:before-action-start": Tn, "interactions:before-action-move": Tn, "interactions:before-action-end": function(t) {
|
|
1714
|
+
var e = t.interaction;
|
|
1715
|
+
if (kn(e))
|
|
1716
|
+
return e.move({ offset: !0 }), e.end(), !1;
|
|
1717
|
+
}, "interactions:stop": function(t) {
|
|
1718
|
+
var e = t.interaction;
|
|
1719
|
+
e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
|
|
1720
|
+
} } }, Pn = Ir, Dr = function() {
|
|
1721
|
+
function t(e) {
|
|
1722
|
+
A(this, t), this.active = !1, this.isModified = !1, this.smoothEnd = !1, this.allowResume = !1, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = e;
|
|
1723
|
+
}
|
|
1724
|
+
return P(t, [{ key: "start", value: function(e) {
|
|
1725
|
+
var n = this.interaction, r = mt(n);
|
|
1726
|
+
if (!r || !r.enabled)
|
|
1727
|
+
return !1;
|
|
1728
|
+
var i = n.coords.velocity.client, o = Ue(i.x, i.y), a = this.modification || (this.modification = new $t(n));
|
|
1729
|
+
if (a.copyFrom(n.modification), this.t0 = n._now(), this.allowResume = r.allowResume, this.v0 = o, this.currentOffset = { x: 0, y: 0 }, this.startCoords = n.coords.cur.page, this.modifierArg = a.fillArg({ pageCoords: this.startCoords, preEnd: !0, phase: "inertiastart" }), this.t0 - n.coords.cur.timeStamp < 50 && o > r.minSpeed && o > r.endSpeed)
|
|
1730
|
+
this.startInertia();
|
|
1731
|
+
else {
|
|
1732
|
+
if (a.result = a.setAll(this.modifierArg), !a.result.changed)
|
|
1733
|
+
return !1;
|
|
1734
|
+
this.startSmoothEnd();
|
|
1735
|
+
}
|
|
1736
|
+
return n.modification.result.rect = null, n.offsetBy(this.targetOffset), n._doPhase({ interaction: n, event: e, phase: "inertiastart" }), n.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), n.modification.result.rect = null, this.active = !0, n.simulation = this, !0;
|
|
1737
|
+
} }, { key: "startInertia", value: function() {
|
|
1738
|
+
var e = this, n = this.interaction.coords.velocity.client, r = mt(this.interaction), i = r.resistance, o = -Math.log(r.endSpeed / this.v0) / i;
|
|
1739
|
+
this.targetOffset = { x: (n.x - o) / i, y: (n.y - o) / i }, this.te = o, this.lambda_v0 = i / this.v0, this.one_ve_v0 = 1 - r.endSpeed / this.v0;
|
|
1740
|
+
var a = this.modification, s = this.modifierArg;
|
|
1741
|
+
s.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, a.result = a.setAll(s), a.result.changed && (this.isModified = !0, this.modifiedOffset = { x: this.targetOffset.x + a.result.delta.x, y: this.targetOffset.y + a.result.delta.y }), this.onNextFrame(function() {
|
|
1742
|
+
return e.inertiaTick();
|
|
1743
|
+
});
|
|
1744
|
+
} }, { key: "startSmoothEnd", value: function() {
|
|
1745
|
+
var e = this;
|
|
1746
|
+
this.smoothEnd = !0, this.isModified = !0, this.targetOffset = { x: this.modification.result.delta.x, y: this.modification.result.delta.y }, this.onNextFrame(function() {
|
|
1747
|
+
return e.smoothEndTick();
|
|
1748
|
+
});
|
|
1749
|
+
} }, { key: "onNextFrame", value: function(e) {
|
|
1750
|
+
var n = this;
|
|
1751
|
+
this.timeout = Pe.request(function() {
|
|
1752
|
+
n.active && e();
|
|
1753
|
+
});
|
|
1754
|
+
} }, { key: "inertiaTick", value: function() {
|
|
1755
|
+
var e, n, r, i, o, a, s, l = this, u = this.interaction, c = mt(u).resistance, p = (u._now() - this.t0) / 1e3;
|
|
1756
|
+
if (p < this.te) {
|
|
1757
|
+
var f, h = 1 - (Math.exp(-c * p) - this.lambda_v0) / this.one_ve_v0;
|
|
1758
|
+
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, i = this.targetOffset.y, o = this.modifiedOffset.x, a = this.modifiedOffset.y, f = { x: On(s = h, e, r, o), y: On(s, n, i, a) }) : f = { x: this.targetOffset.x * h, y: this.targetOffset.y * h };
|
|
1759
|
+
var v = { x: f.x - this.currentOffset.x, y: f.y - this.currentOffset.y };
|
|
1760
|
+
this.currentOffset.x += v.x, this.currentOffset.y += v.y, u.offsetBy(v), u.move(), this.onNextFrame(function() {
|
|
1761
|
+
return l.inertiaTick();
|
|
1762
|
+
});
|
|
1763
|
+
} else
|
|
1764
|
+
u.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
|
|
1765
|
+
} }, { key: "smoothEndTick", value: function() {
|
|
1766
|
+
var e = this, n = this.interaction, r = n._now() - this.t0, i = mt(n).smoothEndDuration;
|
|
1767
|
+
if (r < i) {
|
|
1768
|
+
var o = { x: In(r, 0, this.targetOffset.x, i), y: In(r, 0, this.targetOffset.y, i) }, a = { x: o.x - this.currentOffset.x, y: o.y - this.currentOffset.y };
|
|
1769
|
+
this.currentOffset.x += a.x, this.currentOffset.y += a.y, n.offsetBy(a), n.move({ skipModifiers: this.modifierCount }), this.onNextFrame(function() {
|
|
1770
|
+
return e.smoothEndTick();
|
|
1771
|
+
});
|
|
1772
|
+
} else
|
|
1773
|
+
n.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
|
|
1774
|
+
} }, { key: "resume", value: function(e) {
|
|
1775
|
+
var n = e.pointer, r = e.event, i = e.eventTarget, o = this.interaction;
|
|
1776
|
+
o.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), o.updatePointer(n, r, i, !0), o._doPhase({ interaction: o, event: r, phase: "resume" }), pt(o.coords.prev, o.coords.cur), this.stop();
|
|
1777
|
+
} }, { key: "end", value: function() {
|
|
1778
|
+
this.interaction.move(), this.interaction.end(), this.stop();
|
|
1779
|
+
} }, { key: "stop", value: function() {
|
|
1780
|
+
this.active = this.smoothEnd = !1, this.interaction.simulation = null, Pe.cancel(this.timeout);
|
|
1781
|
+
} }]), t;
|
|
1782
|
+
}();
|
|
1783
|
+
function mt(t) {
|
|
1784
|
+
var e = t.interactable, n = t.prepared;
|
|
1785
|
+
return e && e.options && n.name && e.options[n.name].inertia;
|
|
1786
|
+
}
|
|
1787
|
+
var Mr = { id: "inertia", before: ["modifiers", "actions"], install: function(t) {
|
|
1788
|
+
var e = t.defaults;
|
|
1789
|
+
t.usePlugin(Pn), t.usePlugin(_n), t.actions.phases.inertiastart = !0, t.actions.phases.resume = !0, e.perAction.inertia = { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 };
|
|
1790
|
+
}, listeners: { "interactions:new": function(t) {
|
|
1791
|
+
var e = t.interaction;
|
|
1792
|
+
e.inertia = new Dr(e);
|
|
1793
|
+
}, "interactions:before-action-end": function(t) {
|
|
1794
|
+
var e = t.interaction, n = t.event;
|
|
1795
|
+
return (!e._interacting || e.simulation || !e.inertia.start(n)) && null;
|
|
1796
|
+
}, "interactions:down": function(t) {
|
|
1797
|
+
var e = t.interaction, n = t.eventTarget, r = e.inertia;
|
|
1798
|
+
if (r.active)
|
|
1799
|
+
for (var i = n; d.element(i); ) {
|
|
1800
|
+
if (i === e.element) {
|
|
1801
|
+
r.resume(t);
|
|
1802
|
+
break;
|
|
1803
|
+
}
|
|
1804
|
+
i = de(i);
|
|
1805
|
+
}
|
|
1806
|
+
}, "interactions:stop": function(t) {
|
|
1807
|
+
var e = t.interaction.inertia;
|
|
1808
|
+
e.active && e.stop();
|
|
1809
|
+
}, "interactions:before-action-resume": function(t) {
|
|
1810
|
+
var e = t.interaction.modification;
|
|
1811
|
+
e.stop(t), e.start(t, t.interaction.coords.cur.page), e.applyToInteraction(t);
|
|
1812
|
+
}, "interactions:before-action-inertiastart": function(t) {
|
|
1813
|
+
return t.interaction.modification.setAndApply(t);
|
|
1814
|
+
}, "interactions:action-resume": Qe, "interactions:action-inertiastart": Qe, "interactions:after-action-inertiastart": function(t) {
|
|
1815
|
+
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1816
|
+
}, "interactions:after-action-resume": function(t) {
|
|
1817
|
+
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1818
|
+
} } };
|
|
1819
|
+
function On(t, e, n, r) {
|
|
1820
|
+
var i = 1 - t;
|
|
1821
|
+
return i * i * e + 2 * i * t * n + t * t * r;
|
|
1822
|
+
}
|
|
1823
|
+
function In(t, e, n, r) {
|
|
1824
|
+
return -n * (t /= r) * (t - 2) + e;
|
|
1825
|
+
}
|
|
1826
|
+
var zr = Mr;
|
|
1827
|
+
function Dn(t, e) {
|
|
1828
|
+
for (var n = 0; n < e.length; n++) {
|
|
1829
|
+
var r = e[n];
|
|
1830
|
+
if (t.immediatePropagationStopped)
|
|
1831
|
+
break;
|
|
1832
|
+
r(t);
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
var Mn = function() {
|
|
1836
|
+
function t(e) {
|
|
1837
|
+
A(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = y({}, e || {});
|
|
1838
|
+
}
|
|
1839
|
+
return P(t, [{ key: "fire", value: function(e) {
|
|
1840
|
+
var n, r = this.global;
|
|
1841
|
+
(n = this.types[e.type]) && Dn(e, n), !e.propagationStopped && r && (n = r[e.type]) && Dn(e, n);
|
|
1842
|
+
} }, { key: "on", value: function(e, n) {
|
|
1843
|
+
var r = Ce(e, n);
|
|
1844
|
+
for (e in r)
|
|
1845
|
+
this.types[e] = an(this.types[e] || [], r[e]);
|
|
1846
|
+
} }, { key: "off", value: function(e, n) {
|
|
1847
|
+
var r = Ce(e, n);
|
|
1848
|
+
for (e in r) {
|
|
1849
|
+
var i = this.types[e];
|
|
1850
|
+
if (i && i.length)
|
|
1851
|
+
for (var o = 0, a = r[e]; o < a.length; o++) {
|
|
1852
|
+
var s = a[o], l = i.indexOf(s);
|
|
1853
|
+
l !== -1 && i.splice(l, 1);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
} }, { key: "getRect", value: function(e) {
|
|
1857
|
+
return null;
|
|
1858
|
+
} }]), t;
|
|
1859
|
+
}(), Ar = function() {
|
|
1860
|
+
function t(e) {
|
|
1861
|
+
A(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, ut(this, e);
|
|
1862
|
+
}
|
|
1863
|
+
return P(t, [{ key: "preventOriginalDefault", value: function() {
|
|
1864
|
+
this.originalEvent.preventDefault();
|
|
1865
|
+
} }, { key: "stopPropagation", value: function() {
|
|
1866
|
+
this.originalEvent.stopPropagation();
|
|
1867
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
|
1868
|
+
this.originalEvent.stopImmediatePropagation();
|
|
1869
|
+
} }]), t;
|
|
1870
|
+
}();
|
|
1871
|
+
function Ze(t) {
|
|
1872
|
+
return d.object(t) ? { capture: !!t.capture, passive: !!t.passive } : { capture: !!t, passive: !1 };
|
|
1873
|
+
}
|
|
1874
|
+
function yt(t, e) {
|
|
1875
|
+
return t === e || (typeof t == "boolean" ? !!e.capture === t && !e.passive : !!t.capture == !!e.capture && !!t.passive == !!e.passive);
|
|
1876
|
+
}
|
|
1877
|
+
var Cr = { id: "events", install: function(t) {
|
|
1878
|
+
var e, n = [], r = {}, i = [], o = { add: a, remove: s, addDelegate: function(c, p, f, h, v) {
|
|
1879
|
+
var g = Ze(v);
|
|
1880
|
+
if (!r[f]) {
|
|
1881
|
+
r[f] = [];
|
|
1882
|
+
for (var b = 0; b < i.length; b++) {
|
|
1883
|
+
var m = i[b];
|
|
1884
|
+
a(m, f, l), a(m, f, u, !0);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
var w = r[f], S = Ke(w, function(k) {
|
|
1888
|
+
return k.selector === c && k.context === p;
|
|
1889
|
+
});
|
|
1890
|
+
S || (S = { selector: c, context: p, listeners: [] }, w.push(S)), S.listeners.push({ func: h, options: g });
|
|
1891
|
+
}, removeDelegate: function(c, p, f, h, v) {
|
|
1892
|
+
var g, b = Ze(v), m = r[f], w = !1;
|
|
1893
|
+
if (m)
|
|
1894
|
+
for (g = m.length - 1; g >= 0; g--) {
|
|
1895
|
+
var S = m[g];
|
|
1896
|
+
if (S.selector === c && S.context === p) {
|
|
1897
|
+
for (var k = S.listeners, _ = k.length - 1; _ >= 0; _--) {
|
|
1898
|
+
var T = k[_];
|
|
1899
|
+
if (T.func === h && yt(T.options, b)) {
|
|
1900
|
+
k.splice(_, 1), k.length || (m.splice(g, 1), s(p, f, l), s(p, f, u, !0)), w = !0;
|
|
1901
|
+
break;
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
if (w)
|
|
1905
|
+
break;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
}, delegateListener: l, delegateUseCapture: u, delegatedEvents: r, documents: i, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
1909
|
+
function a(c, p, f, h) {
|
|
1910
|
+
if (c.addEventListener) {
|
|
1911
|
+
var v = Ze(h), g = Ke(n, function(b) {
|
|
1912
|
+
return b.eventTarget === c;
|
|
1913
|
+
});
|
|
1914
|
+
g || (g = { eventTarget: c, events: {} }, n.push(g)), g.events[p] || (g.events[p] = []), Ke(g.events[p], function(b) {
|
|
1915
|
+
return b.func === f && yt(b.options, v);
|
|
1916
|
+
}) || (c.addEventListener(p, f, o.supportsOptions ? v : v.capture), g.events[p].push({ func: f, options: v }));
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
function s(c, p, f, h) {
|
|
1920
|
+
if (c.addEventListener && c.removeEventListener) {
|
|
1921
|
+
var v = Ge(n, function(oe) {
|
|
1922
|
+
return oe.eventTarget === c;
|
|
1923
|
+
}), g = n[v];
|
|
1924
|
+
if (g && g.events)
|
|
1925
|
+
if (p !== "all") {
|
|
1926
|
+
var b = !1, m = g.events[p];
|
|
1927
|
+
if (m) {
|
|
1928
|
+
if (f === "all") {
|
|
1929
|
+
for (var w = m.length - 1; w >= 0; w--) {
|
|
1930
|
+
var S = m[w];
|
|
1931
|
+
s(c, p, S.func, S.options);
|
|
1932
|
+
}
|
|
1933
|
+
return;
|
|
1934
|
+
}
|
|
1935
|
+
for (var k = Ze(h), _ = 0; _ < m.length; _++) {
|
|
1936
|
+
var T = m[_];
|
|
1937
|
+
if (T.func === f && yt(T.options, k)) {
|
|
1938
|
+
c.removeEventListener(p, f, o.supportsOptions ? k : k.capture), m.splice(_, 1), m.length === 0 && (delete g.events[p], b = !0);
|
|
1939
|
+
break;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
b && !Object.keys(g.events).length && n.splice(v, 1);
|
|
1944
|
+
} else
|
|
1945
|
+
for (p in g.events)
|
|
1946
|
+
g.events.hasOwnProperty(p) && s(c, p, "all");
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
function l(c, p) {
|
|
1950
|
+
for (var f = Ze(p), h = new Ar(c), v = r[c.type], g = on(c)[0], b = g; d.element(b); ) {
|
|
1951
|
+
for (var m = 0; m < v.length; m++) {
|
|
1952
|
+
var w = v[m], S = w.selector, k = w.context;
|
|
1953
|
+
if (me(b, S) && ye(k, g) && ye(k, b)) {
|
|
1954
|
+
var _ = w.listeners;
|
|
1955
|
+
h.currentTarget = b;
|
|
1956
|
+
for (var T = 0; T < _.length; T++) {
|
|
1957
|
+
var oe = _[T];
|
|
1958
|
+
yt(oe.options, f) && oe.func(h);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
b = de(b);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
function u(c) {
|
|
1966
|
+
return l(c, !0);
|
|
1967
|
+
}
|
|
1968
|
+
return (e = t.document) == null || e.createElement("div").addEventListener("test", null, { get capture() {
|
|
1969
|
+
return o.supportsOptions = !0;
|
|
1970
|
+
}, get passive() {
|
|
1971
|
+
return o.supportsPassive = !0;
|
|
1972
|
+
} }), t.events = o, o;
|
|
1973
|
+
} }, Lt = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t) {
|
|
1974
|
+
for (var e = 0, n = Lt.methodOrder; e < n.length; e++) {
|
|
1975
|
+
var r = n[e], i = Lt[r](t);
|
|
1976
|
+
if (i)
|
|
1977
|
+
return i;
|
|
1978
|
+
}
|
|
1979
|
+
return null;
|
|
1980
|
+
}, simulationResume: function(t) {
|
|
1981
|
+
var e = t.pointerType, n = t.eventType, r = t.eventTarget, i = t.scope;
|
|
1982
|
+
if (!/down|start/i.test(n))
|
|
1983
|
+
return null;
|
|
1984
|
+
for (var o = 0, a = i.interactions.list; o < a.length; o++) {
|
|
1985
|
+
var s = a[o], l = r;
|
|
1986
|
+
if (s.simulation && s.simulation.allowResume && s.pointerType === e)
|
|
1987
|
+
for (; l; ) {
|
|
1988
|
+
if (l === s.element)
|
|
1989
|
+
return s;
|
|
1990
|
+
l = de(l);
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
return null;
|
|
1994
|
+
}, mouseOrPen: function(t) {
|
|
1995
|
+
var e, n = t.pointerId, r = t.pointerType, i = t.eventType, o = t.scope;
|
|
1996
|
+
if (r !== "mouse" && r !== "pen")
|
|
1997
|
+
return null;
|
|
1998
|
+
for (var a = 0, s = o.interactions.list; a < s.length; a++) {
|
|
1999
|
+
var l = s[a];
|
|
2000
|
+
if (l.pointerType === r) {
|
|
2001
|
+
if (l.simulation && !zn(l, n))
|
|
2002
|
+
continue;
|
|
2003
|
+
if (l.interacting())
|
|
2004
|
+
return l;
|
|
2005
|
+
e || (e = l);
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
if (e)
|
|
2009
|
+
return e;
|
|
2010
|
+
for (var u = 0, c = o.interactions.list; u < c.length; u++) {
|
|
2011
|
+
var p = c[u];
|
|
2012
|
+
if (!(p.pointerType !== r || /down/i.test(i) && p.simulation))
|
|
2013
|
+
return p;
|
|
2014
|
+
}
|
|
2015
|
+
return null;
|
|
2016
|
+
}, hasPointer: function(t) {
|
|
2017
|
+
for (var e = t.pointerId, n = 0, r = t.scope.interactions.list; n < r.length; n++) {
|
|
2018
|
+
var i = r[n];
|
|
2019
|
+
if (zn(i, e))
|
|
2020
|
+
return i;
|
|
2021
|
+
}
|
|
2022
|
+
return null;
|
|
2023
|
+
}, idle: function(t) {
|
|
2024
|
+
for (var e = t.pointerType, n = 0, r = t.scope.interactions.list; n < r.length; n++) {
|
|
2025
|
+
var i = r[n];
|
|
2026
|
+
if (i.pointers.length === 1) {
|
|
2027
|
+
var o = i.interactable;
|
|
2028
|
+
if (o && (!o.options.gesture || !o.options.gesture.enabled))
|
|
2029
|
+
continue;
|
|
2030
|
+
} else if (i.pointers.length >= 2)
|
|
2031
|
+
continue;
|
|
2032
|
+
if (!i.interacting() && e === i.pointerType)
|
|
2033
|
+
return i;
|
|
2034
|
+
}
|
|
2035
|
+
return null;
|
|
2036
|
+
} };
|
|
2037
|
+
function zn(t, e) {
|
|
2038
|
+
return t.pointers.some(function(n) {
|
|
2039
|
+
return n.id === e;
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
var Rr = Lt, Wt = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
|
|
2043
|
+
function An(t, e) {
|
|
2044
|
+
return function(n) {
|
|
2045
|
+
var r = e.interactions.list, i = rn(n), o = on(n), a = o[0], s = o[1], l = [];
|
|
2046
|
+
if (/^touch/.test(n.type)) {
|
|
2047
|
+
e.prevTouchTime = e.now();
|
|
2048
|
+
for (var u = 0, c = n.changedTouches; u < c.length; u++) {
|
|
2049
|
+
var p = c[u], f = { pointer: p, pointerId: He(p), pointerType: i, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, h = Cn(f);
|
|
2050
|
+
l.push([f.pointer, f.eventTarget, f.curEventTarget, h]);
|
|
2051
|
+
}
|
|
2052
|
+
} else {
|
|
2053
|
+
var v = !1;
|
|
2054
|
+
if (!ce.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2055
|
+
for (var g = 0; g < r.length && !v; g++)
|
|
2056
|
+
v = r[g].pointerType !== "mouse" && r[g].pointerIsDown;
|
|
2057
|
+
v = v || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2058
|
+
}
|
|
2059
|
+
if (!v) {
|
|
2060
|
+
var b = { pointer: n, pointerId: He(n), pointerType: i, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, m = Cn(b);
|
|
2061
|
+
l.push([b.pointer, b.eventTarget, b.curEventTarget, m]);
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
for (var w = 0; w < l.length; w++) {
|
|
2065
|
+
var S = l[w], k = S[0], _ = S[1], T = S[2];
|
|
2066
|
+
S[3][t](k, n, _, T);
|
|
2067
|
+
}
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
function Cn(t) {
|
|
2071
|
+
var e = t.pointerType, n = t.scope, r = { interaction: Rr.search(t), searchDetails: t };
|
|
2072
|
+
return n.fire("interactions:find", r), r.interaction || n.interactions.new({ pointerType: e });
|
|
2073
|
+
}
|
|
2074
|
+
function Xt(t, e) {
|
|
2075
|
+
var n = t.doc, r = t.scope, i = t.options, o = r.interactions.docEvents, a = r.events, s = a[e];
|
|
2076
|
+
for (var l in r.browser.isIOS && !i.events && (i.events = { passive: !1 }), a.delegatedEvents)
|
|
2077
|
+
s(n, l, a.delegateListener), s(n, l, a.delegateUseCapture, !0);
|
|
2078
|
+
for (var u = i && i.events, c = 0; c < o.length; c++) {
|
|
2079
|
+
var p = o[c];
|
|
2080
|
+
s(n, p.type, p.listener, u);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
var jr = { id: "core/interactions", install: function(t) {
|
|
2084
|
+
for (var e = {}, n = 0; n < Wt.length; n++) {
|
|
2085
|
+
var r = Wt[n];
|
|
2086
|
+
e[r] = An(r, t);
|
|
2087
|
+
}
|
|
2088
|
+
var i, o = ce.pEventTypes;
|
|
2089
|
+
function a() {
|
|
2090
|
+
for (var s = 0, l = t.interactions.list; s < l.length; s++) {
|
|
2091
|
+
var u = l[s];
|
|
2092
|
+
if (u.pointerIsDown && u.pointerType === "touch" && !u._interacting)
|
|
2093
|
+
for (var c = function() {
|
|
2094
|
+
var h = f[p];
|
|
2095
|
+
t.documents.some(function(v) {
|
|
2096
|
+
return ye(v.doc, h.downTarget);
|
|
2097
|
+
}) || u.removePointer(h.pointer, h.event);
|
|
2098
|
+
}, p = 0, f = u.pointers; p < f.length; p++)
|
|
2099
|
+
c();
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
(i = K.PointerEvent ? [{ type: o.down, listener: a }, { type: o.down, listener: e.pointerDown }, { type: o.move, listener: e.pointerMove }, { type: o.up, listener: e.pointerUp }, { type: o.cancel, listener: e.pointerUp }] : [{ type: "mousedown", listener: e.pointerDown }, { type: "mousemove", listener: e.pointerMove }, { type: "mouseup", listener: e.pointerUp }, { type: "touchstart", listener: a }, { type: "touchstart", listener: e.pointerDown }, { type: "touchmove", listener: e.pointerMove }, { type: "touchend", listener: e.pointerUp }, { type: "touchcancel", listener: e.pointerUp }]).push({ type: "blur", listener: function(s) {
|
|
2103
|
+
for (var l = 0, u = t.interactions.list; l < u.length; l++)
|
|
2104
|
+
u[l].documentBlur(s);
|
|
2105
|
+
} }), t.prevTouchTime = 0, t.Interaction = function(s) {
|
|
2106
|
+
W(u, s);
|
|
2107
|
+
var l = le(u);
|
|
2108
|
+
function u() {
|
|
2109
|
+
return A(this, u), l.apply(this, arguments);
|
|
2110
|
+
}
|
|
2111
|
+
return P(u, [{ key: "pointerMoveTolerance", get: function() {
|
|
2112
|
+
return t.interactions.pointerMoveTolerance;
|
|
2113
|
+
}, set: function(c) {
|
|
2114
|
+
t.interactions.pointerMoveTolerance = c;
|
|
2115
|
+
} }, { key: "_now", value: function() {
|
|
2116
|
+
return t.now();
|
|
2117
|
+
} }]), u;
|
|
2118
|
+
}(Pr), t.interactions = { list: [], new: function(s) {
|
|
2119
|
+
s.scopeFire = function(u, c) {
|
|
2120
|
+
return t.fire(u, c);
|
|
2121
|
+
};
|
|
2122
|
+
var l = new t.Interaction(s);
|
|
2123
|
+
return t.interactions.list.push(l), l;
|
|
2124
|
+
}, listeners: e, docEvents: i, pointerMoveTolerance: 1 }, t.usePlugin(wn);
|
|
2125
|
+
}, listeners: { "scope:add-document": function(t) {
|
|
2126
|
+
return Xt(t, "add");
|
|
2127
|
+
}, "scope:remove-document": function(t) {
|
|
2128
|
+
return Xt(t, "remove");
|
|
2129
|
+
}, "interactable:unset": function(t, e) {
|
|
2130
|
+
for (var n = t.interactable, r = e.interactions.list.length - 1; r >= 0; r--) {
|
|
2131
|
+
var i = e.interactions.list[r];
|
|
2132
|
+
i.interactable === n && (i.stop(), e.fire("interactions:destroy", { interaction: i }), i.destroy(), e.interactions.list.length > 2 && e.interactions.list.splice(r, 1));
|
|
2133
|
+
}
|
|
2134
|
+
} }, onDocSignal: Xt, doOnInteractions: An, methodNames: Wt }, Fr = jr, Ie = function(t) {
|
|
2135
|
+
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2136
|
+
}(Ie || {}), Vr = function() {
|
|
2137
|
+
function t(e, n, r, i) {
|
|
2138
|
+
A(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new Mn(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = e, this._context = n.context || r, this._win = X(L(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = i, this.set(n);
|
|
2139
|
+
}
|
|
2140
|
+
return P(t, [{ key: "_defaults", get: function() {
|
|
2141
|
+
return { base: {}, perAction: {}, actions: {} };
|
|
2142
|
+
} }, { key: "setOnEvents", value: function(e, n) {
|
|
2143
|
+
return d.func(n.onstart) && this.on("".concat(e, "start"), n.onstart), d.func(n.onmove) && this.on("".concat(e, "move"), n.onmove), d.func(n.onend) && this.on("".concat(e, "end"), n.onend), d.func(n.oninertiastart) && this.on("".concat(e, "inertiastart"), n.oninertiastart), this;
|
|
2144
|
+
} }, { key: "updatePerActionListeners", value: function(e, n, r) {
|
|
2145
|
+
var i, o = this, a = (i = this._actions.map[e]) == null ? void 0 : i.filterEventType, s = function(l) {
|
|
2146
|
+
return (a == null || a(l)) && ht(l, o._actions);
|
|
2147
|
+
};
|
|
2148
|
+
(d.array(n) || d.object(n)) && this._onOff(Ie.Off, e, n, void 0, s), (d.array(r) || d.object(r)) && this._onOff(Ie.On, e, r, void 0, s);
|
|
2149
|
+
} }, { key: "setPerAction", value: function(e, n) {
|
|
2150
|
+
var r = this._defaults;
|
|
2151
|
+
for (var i in n) {
|
|
2152
|
+
var o = i, a = this.options[e], s = n[o];
|
|
2153
|
+
o === "listeners" && this.updatePerActionListeners(e, a.listeners, s), d.array(s) ? a[o] = sn(s) : d.plainObject(s) ? (a[o] = y(a[o] || {}, Le(s)), d.object(r.perAction[o]) && "enabled" in r.perAction[o] && (a[o].enabled = s.enabled !== !1)) : d.bool(s) && d.object(r.perAction[o]) ? a[o].enabled = s : a[o] = s;
|
|
2154
|
+
}
|
|
2155
|
+
} }, { key: "getRect", value: function(e) {
|
|
2156
|
+
return e = e || (d.element(this.target) ? this.target : null), d.string(this.target) && (e = e || this._context.querySelector(this.target)), Ne(e);
|
|
2157
|
+
} }, { key: "rectChecker", value: function(e) {
|
|
2158
|
+
var n = this;
|
|
2159
|
+
return d.func(e) ? (this.getRect = function(r) {
|
|
2160
|
+
var i = y({}, e.apply(n, r));
|
|
2161
|
+
return "width" in i || (i.width = i.right - i.left, i.height = i.bottom - i.top), i;
|
|
2162
|
+
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2163
|
+
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
2164
|
+
if (L(n) || d.object(n)) {
|
|
2165
|
+
for (var r in this.options[e] = n, this._actions.map)
|
|
2166
|
+
this.options[r][e] = n;
|
|
2167
|
+
return this;
|
|
2168
|
+
}
|
|
2169
|
+
return this.options[e];
|
|
2170
|
+
} }, { key: "origin", value: function(e) {
|
|
2171
|
+
return this._backCompatOption("origin", e);
|
|
2172
|
+
} }, { key: "deltaSource", value: function(e) {
|
|
2173
|
+
return e === "page" || e === "client" ? (this.options.deltaSource = e, this) : this.options.deltaSource;
|
|
2174
|
+
} }, { key: "getAllElements", value: function() {
|
|
2175
|
+
var e = this.target;
|
|
2176
|
+
return d.string(e) ? Array.from(this._context.querySelectorAll(e)) : d.func(e) && e.getAllElements ? e.getAllElements() : d.element(e) ? [e] : [];
|
|
2177
|
+
} }, { key: "context", value: function() {
|
|
2178
|
+
return this._context;
|
|
2179
|
+
} }, { key: "inContext", value: function(e) {
|
|
2180
|
+
return this._context === e.ownerDocument || ye(this._context, e);
|
|
2181
|
+
} }, { key: "testIgnoreAllow", value: function(e, n, r) {
|
|
2182
|
+
return !this.testIgnore(e.ignoreFrom, n, r) && this.testAllow(e.allowFrom, n, r);
|
|
2183
|
+
} }, { key: "testAllow", value: function(e, n, r) {
|
|
2184
|
+
return !e || !!d.element(r) && (d.string(e) ? Ye(r, e, n) : !!d.element(e) && ye(e, r));
|
|
2185
|
+
} }, { key: "testIgnore", value: function(e, n, r) {
|
|
2186
|
+
return !(!e || !d.element(r)) && (d.string(e) ? Ye(r, e, n) : !!d.element(e) && ye(e, r));
|
|
2187
|
+
} }, { key: "fire", value: function(e) {
|
|
2188
|
+
return this.events.fire(e), this;
|
|
2189
|
+
} }, { key: "_onOff", value: function(e, n, r, i, o) {
|
|
2190
|
+
d.object(n) && !d.array(n) && (i = r, r = null);
|
|
2191
|
+
var a = Ce(n, r, o);
|
|
2192
|
+
for (var s in a) {
|
|
2193
|
+
s === "wheel" && (s = ce.wheelEvent);
|
|
2194
|
+
for (var l = 0, u = a[s]; l < u.length; l++) {
|
|
2195
|
+
var c = u[l];
|
|
2196
|
+
ht(s, this._actions) ? this.events[e === Ie.On ? "on" : "off"](s, c) : d.string(this.target) ? this._scopeEvents[e === Ie.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, c, i) : this._scopeEvents[e === Ie.On ? "add" : "remove"](this.target, s, c, i);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
return this;
|
|
2200
|
+
} }, { key: "on", value: function(e, n, r) {
|
|
2201
|
+
return this._onOff(Ie.On, e, n, r);
|
|
2202
|
+
} }, { key: "off", value: function(e, n, r) {
|
|
2203
|
+
return this._onOff(Ie.Off, e, n, r);
|
|
2204
|
+
} }, { key: "set", value: function(e) {
|
|
2205
|
+
var n = this._defaults;
|
|
2206
|
+
for (var r in d.object(e) || (e = {}), this.options = Le(n.base), this._actions.methodDict) {
|
|
2207
|
+
var i = r, o = this._actions.methodDict[i];
|
|
2208
|
+
this.options[i] = {}, this.setPerAction(i, y(y({}, n.perAction), n.actions[i])), this[o](e[i]);
|
|
2209
|
+
}
|
|
2210
|
+
for (var a in e)
|
|
2211
|
+
a !== "getRect" ? d.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
|
|
2212
|
+
return this;
|
|
2213
|
+
} }, { key: "unset", value: function() {
|
|
2214
|
+
if (d.string(this.target))
|
|
2215
|
+
for (var e in this._scopeEvents.delegatedEvents)
|
|
2216
|
+
for (var n = this._scopeEvents.delegatedEvents[e], r = n.length - 1; r >= 0; r--) {
|
|
2217
|
+
var i = n[r], o = i.selector, a = i.context, s = i.listeners;
|
|
2218
|
+
o === this.target && a === this._context && n.splice(r, 1);
|
|
2219
|
+
for (var l = s.length - 1; l >= 0; l--)
|
|
2220
|
+
this._scopeEvents.removeDelegate(this.target, this._context, e, s[l][0], s[l][1]);
|
|
2221
|
+
}
|
|
2222
|
+
else
|
|
2223
|
+
this._scopeEvents.remove(this.target, "all");
|
|
2224
|
+
} }]), t;
|
|
2225
|
+
}(), $r = function() {
|
|
2226
|
+
function t(e) {
|
|
2227
|
+
var n = this;
|
|
2228
|
+
A(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2229
|
+
var i = r.interactable, o = i.target, a = d.string(o) ? n.selectorMap[o] : o[n.scope.id], s = Ge(a, function(l) {
|
|
2230
|
+
return l === i;
|
|
2231
|
+
});
|
|
2232
|
+
a.splice(s, 1);
|
|
2233
|
+
} });
|
|
2234
|
+
}
|
|
2235
|
+
return P(t, [{ key: "new", value: function(e, n) {
|
|
2236
|
+
n = y(n || {}, { actions: this.scope.actions });
|
|
2237
|
+
var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
|
|
2238
|
+
return this.scope.addDocument(r._doc), this.list.push(r), d.string(e) ? (this.selectorMap[e] || (this.selectorMap[e] = []), this.selectorMap[e].push(r)) : (r.target[this.scope.id] || Object.defineProperty(e, this.scope.id, { value: [], configurable: !0 }), e[this.scope.id].push(r)), this.scope.fire("interactable:new", { target: e, options: n, interactable: r, win: this.scope._win }), r;
|
|
2239
|
+
} }, { key: "getExisting", value: function(e, n) {
|
|
2240
|
+
var r = n && n.context || this.scope.document, i = d.string(e), o = i ? this.selectorMap[e] : e[this.scope.id];
|
|
2241
|
+
if (o)
|
|
2242
|
+
return Ke(o, function(a) {
|
|
2243
|
+
return a._context === r && (i || a.inContext(e));
|
|
2244
|
+
});
|
|
2245
|
+
} }, { key: "forEachMatch", value: function(e, n) {
|
|
2246
|
+
for (var r = 0, i = this.list; r < i.length; r++) {
|
|
2247
|
+
var o = i[r], a = void 0;
|
|
2248
|
+
if ((d.string(o.target) ? d.element(e) && me(e, o.target) : e === o.target) && o.inContext(e) && (a = n(o)), a !== void 0)
|
|
2249
|
+
return a;
|
|
2250
|
+
}
|
|
2251
|
+
} }]), t;
|
|
2252
|
+
}(), Nr = function() {
|
|
2253
|
+
function t() {
|
|
2254
|
+
var e = this;
|
|
2255
|
+
A(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = ce, this.defaults = Le(En), this.Eventable = Mn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = function(r) {
|
|
2256
|
+
var i = function o(a, s) {
|
|
2257
|
+
var l = r.interactables.getExisting(a, s);
|
|
2258
|
+
return l || ((l = r.interactables.new(a, s)).events.global = o.globalEvents), l;
|
|
2259
|
+
};
|
|
2260
|
+
return i.getPointerAverage = nn, i.getTouchBBox = Pt, i.getTouchDistance = Ot, i.getTouchAngle = It, i.getElementRect = Ne, i.getElementClientRect = Me, i.matchesSelector = me, i.closest = st, i.globalEvents = {}, i.version = "1.10.27", i.scope = r, i.use = function(o, a) {
|
|
2261
|
+
return this.scope.usePlugin(o, a), this;
|
|
2262
|
+
}, i.isSet = function(o, a) {
|
|
2263
|
+
return !!this.scope.interactables.get(o, a && a.context);
|
|
2264
|
+
}, i.on = Je(function(o, a, s) {
|
|
2265
|
+
if (d.string(o) && o.search(" ") !== -1 && (o = o.trim().split(/ +/)), d.array(o)) {
|
|
2266
|
+
for (var l = 0, u = o; l < u.length; l++) {
|
|
2267
|
+
var c = u[l];
|
|
2268
|
+
this.on(c, a, s);
|
|
2269
|
+
}
|
|
2270
|
+
return this;
|
|
2271
|
+
}
|
|
2272
|
+
if (d.object(o)) {
|
|
2273
|
+
for (var p in o)
|
|
2274
|
+
this.on(p, o[p], a);
|
|
2275
|
+
return this;
|
|
2276
|
+
}
|
|
2277
|
+
return ht(o, this.scope.actions) ? this.globalEvents[o] ? this.globalEvents[o].push(a) : this.globalEvents[o] = [a] : this.scope.events.add(this.scope.document, o, a, { options: s }), this;
|
|
2278
|
+
}, "The interact.on() method is being deprecated"), i.off = Je(function(o, a, s) {
|
|
2279
|
+
if (d.string(o) && o.search(" ") !== -1 && (o = o.trim().split(/ +/)), d.array(o)) {
|
|
2280
|
+
for (var l = 0, u = o; l < u.length; l++) {
|
|
2281
|
+
var c = u[l];
|
|
2282
|
+
this.off(c, a, s);
|
|
2283
|
+
}
|
|
2284
|
+
return this;
|
|
2285
|
+
}
|
|
2286
|
+
if (d.object(o)) {
|
|
2287
|
+
for (var p in o)
|
|
2288
|
+
this.off(p, o[p], a);
|
|
2289
|
+
return this;
|
|
2290
|
+
}
|
|
2291
|
+
var f;
|
|
2292
|
+
return ht(o, this.scope.actions) ? o in this.globalEvents && (f = this.globalEvents[o].indexOf(a)) !== -1 && this.globalEvents[o].splice(f, 1) : this.scope.events.remove(this.scope.document, o, a, s), this;
|
|
2293
|
+
}, "The interact.off() method is being deprecated"), i.debug = function() {
|
|
2294
|
+
return this.scope;
|
|
2295
|
+
}, i.supportsTouch = function() {
|
|
2296
|
+
return ce.supportsTouch;
|
|
2297
|
+
}, i.supportsPointerEvent = function() {
|
|
2298
|
+
return ce.supportsPointerEvent;
|
|
2299
|
+
}, i.stop = function() {
|
|
2300
|
+
for (var o = 0, a = this.scope.interactions.list; o < a.length; o++)
|
|
2301
|
+
a[o].stop();
|
|
2302
|
+
return this;
|
|
2303
|
+
}, i.pointerMoveTolerance = function(o) {
|
|
2304
|
+
return d.number(o) ? (this.scope.interactions.pointerMoveTolerance = o, this) : this.scope.interactions.pointerMoveTolerance;
|
|
2305
|
+
}, i.addDocument = function(o, a) {
|
|
2306
|
+
this.scope.addDocument(o, a);
|
|
2307
|
+
}, i.removeDocument = function(o) {
|
|
2308
|
+
this.scope.removeDocument(o);
|
|
2309
|
+
}, i;
|
|
2310
|
+
}(this), this.InteractEvent = Nt, this.Interactable = void 0, this.interactables = new $r(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(r) {
|
|
2311
|
+
return e.removeDocument(r.target);
|
|
2312
|
+
};
|
|
2313
|
+
var n = this;
|
|
2314
|
+
this.Interactable = function(r) {
|
|
2315
|
+
W(o, r);
|
|
2316
|
+
var i = le(o);
|
|
2317
|
+
function o() {
|
|
2318
|
+
return A(this, o), i.apply(this, arguments);
|
|
2319
|
+
}
|
|
2320
|
+
return P(o, [{ key: "_defaults", get: function() {
|
|
2321
|
+
return n.defaults;
|
|
2322
|
+
} }, { key: "set", value: function(a) {
|
|
2323
|
+
return $(C(o.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
2324
|
+
} }, { key: "unset", value: function() {
|
|
2325
|
+
$(C(o.prototype), "unset", this).call(this);
|
|
2326
|
+
var a = n.interactables.list.indexOf(this);
|
|
2327
|
+
a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
|
|
2328
|
+
} }]), o;
|
|
2329
|
+
}(Vr);
|
|
2330
|
+
}
|
|
2331
|
+
return P(t, [{ key: "addListeners", value: function(e, n) {
|
|
2332
|
+
this.listenerMaps.push({ id: n, map: e });
|
|
2333
|
+
} }, { key: "fire", value: function(e, n) {
|
|
2334
|
+
for (var r = 0, i = this.listenerMaps; r < i.length; r++) {
|
|
2335
|
+
var o = i[r].map[e];
|
|
2336
|
+
if (o && o(n, this, e) === !1)
|
|
2337
|
+
return !1;
|
|
2338
|
+
}
|
|
2339
|
+
} }, { key: "init", value: function(e) {
|
|
2340
|
+
return this.isInitialized ? this : function(n, r) {
|
|
2341
|
+
return n.isInitialized = !0, d.window(r) && B(r), K.init(r), ce.init(r), Pe.init(r), n.window = r, n.document = r.document, n.usePlugin(Fr), n.usePlugin(Cr), n;
|
|
2342
|
+
}(this, e);
|
|
2343
|
+
} }, { key: "pluginIsInstalled", value: function(e) {
|
|
2344
|
+
var n = e.id;
|
|
2345
|
+
return n ? !!this._plugins.map[n] : this._plugins.list.indexOf(e) !== -1;
|
|
2346
|
+
} }, { key: "usePlugin", value: function(e, n) {
|
|
2347
|
+
if (!this.isInitialized)
|
|
2348
|
+
return this;
|
|
2349
|
+
if (this.pluginIsInstalled(e))
|
|
2350
|
+
return this;
|
|
2351
|
+
if (e.id && (this._plugins.map[e.id] = e), this._plugins.list.push(e), e.install && e.install(this, n), e.listeners && e.before) {
|
|
2352
|
+
for (var r = 0, i = this.listenerMaps.length, o = e.before.reduce(function(s, l) {
|
|
2353
|
+
return s[l] = !0, s[Rn(l)] = !0, s;
|
|
2354
|
+
}, {}); r < i; r++) {
|
|
2355
|
+
var a = this.listenerMaps[r].id;
|
|
2356
|
+
if (a && (o[a] || o[Rn(a)]))
|
|
2357
|
+
break;
|
|
2358
|
+
}
|
|
2359
|
+
this.listenerMaps.splice(r, 0, { id: e.id, map: e.listeners });
|
|
2360
|
+
} else
|
|
2361
|
+
e.listeners && this.listenerMaps.push({ id: e.id, map: e.listeners });
|
|
2362
|
+
return this;
|
|
2363
|
+
} }, { key: "addDocument", value: function(e, n) {
|
|
2364
|
+
if (this.getDocIndex(e) !== -1)
|
|
2365
|
+
return !1;
|
|
2366
|
+
var r = X(e);
|
|
2367
|
+
n = n ? y({}, n) : {}, this.documents.push({ doc: e, options: n }), this.events.documents.push(e), e !== this.document && this.events.add(r, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: e, window: r, scope: this, options: n });
|
|
2368
|
+
} }, { key: "removeDocument", value: function(e) {
|
|
2369
|
+
var n = this.getDocIndex(e), r = X(e), i = this.documents[n].options;
|
|
2370
|
+
this.events.remove(r, "unload", this.onWindowUnload), this.documents.splice(n, 1), this.events.documents.splice(n, 1), this.fire("scope:remove-document", { doc: e, window: r, scope: this, options: i });
|
|
2371
|
+
} }, { key: "getDocIndex", value: function(e) {
|
|
2372
|
+
for (var n = 0; n < this.documents.length; n++)
|
|
2373
|
+
if (this.documents[n].doc === e)
|
|
2374
|
+
return n;
|
|
2375
|
+
return -1;
|
|
2376
|
+
} }, { key: "getDocOptions", value: function(e) {
|
|
2377
|
+
var n = this.getDocIndex(e);
|
|
2378
|
+
return n === -1 ? null : this.documents[n].options;
|
|
2379
|
+
} }, { key: "now", value: function() {
|
|
2380
|
+
return (this.window.Date || Date).now();
|
|
2381
|
+
} }]), t;
|
|
2382
|
+
}();
|
|
2383
|
+
function Rn(t) {
|
|
2384
|
+
return t && t.replace(/\/.*$/, "");
|
|
2385
|
+
}
|
|
2386
|
+
var jn = new Nr(), ie = jn.interactStatic, Br = typeof globalThis < "u" ? globalThis : window;
|
|
2387
|
+
jn.init(Br);
|
|
2388
|
+
var Lr = Object.freeze({ __proto__: null, edgeTarget: function() {
|
|
2389
|
+
}, elements: function() {
|
|
2390
|
+
}, grid: function(t) {
|
|
2391
|
+
var e = [["x", "y"], ["left", "top"], ["right", "bottom"], ["width", "height"]].filter(function(r) {
|
|
2392
|
+
var i = r[0], o = r[1];
|
|
2393
|
+
return i in t || o in t;
|
|
2394
|
+
}), n = function(r, i) {
|
|
2395
|
+
for (var o = t.range, a = t.limits, s = a === void 0 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : a, l = t.offset, u = l === void 0 ? { x: 0, y: 0 } : l, c = { range: o, grid: t, x: null, y: null }, p = 0; p < e.length; p++) {
|
|
2396
|
+
var f = e[p], h = f[0], v = f[1], g = Math.round((r - u.x) / t[h]), b = Math.round((i - u.y) / t[v]);
|
|
2397
|
+
c[h] = Math.max(s.left, Math.min(s.right, g * t[h] + u.x)), c[v] = Math.max(s.top, Math.min(s.bottom, b * t[v] + u.y));
|
|
2398
|
+
}
|
|
2399
|
+
return c;
|
|
2400
|
+
};
|
|
2401
|
+
return n.grid = t, n.coordFields = e, n;
|
|
2402
|
+
} }), Wr = { id: "snappers", install: function(t) {
|
|
2403
|
+
var e = t.interactStatic;
|
|
2404
|
+
e.snappers = y(e.snappers || {}, Lr), e.createSnapGrid = e.snappers.grid;
|
|
2405
|
+
} }, Xr = Wr, Yr = { start: function(t) {
|
|
2406
|
+
var e = t.state, n = t.rect, r = t.edges, i = t.pageCoords, o = e.options, a = o.ratio, s = o.enabled, l = e.options, u = l.equalDelta, c = l.modifiers;
|
|
2407
|
+
a === "preserve" && (a = n.width / n.height), e.startCoords = y({}, i), e.startRect = y({}, n), e.ratio = a, e.equalDelta = u;
|
|
2408
|
+
var p = e.linkedEdges = { top: r.top || r.left && !r.bottom, left: r.left || r.top && !r.right, bottom: r.bottom || r.right && !r.top, right: r.right || r.bottom && !r.left };
|
|
2409
|
+
if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
|
|
2410
|
+
var f = (p.left ? 1 : -1) * (p.top ? 1 : -1);
|
|
2411
|
+
e.edgeSign = { x: f, y: f };
|
|
2412
|
+
} else
|
|
2413
|
+
e.edgeSign = { x: p.left ? -1 : 1, y: p.top ? -1 : 1 };
|
|
2414
|
+
if (s !== !1 && y(r, p), c != null && c.length) {
|
|
2415
|
+
var h = new $t(t.interaction);
|
|
2416
|
+
h.copyFrom(t.interaction.modification), h.prepareStates(c), e.subModification = h, h.startAll(z({}, t));
|
|
2417
|
+
}
|
|
2418
|
+
}, set: function(t) {
|
|
2419
|
+
var e = t.state, n = t.rect, r = t.coords, i = e.linkedEdges, o = y({}, r), a = e.equalDelta ? qr : Ur;
|
|
2420
|
+
if (y(t.edges, i), a(e, e.xIsPrimaryAxis, r, n), !e.subModification)
|
|
2421
|
+
return null;
|
|
2422
|
+
var s = y({}, n);
|
|
2423
|
+
ct(i, s, { x: r.x - o.x, y: r.y - o.y });
|
|
2424
|
+
var l = e.subModification.setAll(z(z({}, t), {}, { rect: s, edges: i, pageCoords: r, prevCoords: r, prevRect: s })), u = l.delta;
|
|
2425
|
+
return l.changed && (a(e, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect), y(r, l.coords)), l.eventProps;
|
|
2426
|
+
}, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
|
|
2427
|
+
function qr(t, e, n) {
|
|
2428
|
+
var r = t.startCoords, i = t.edgeSign;
|
|
2429
|
+
e ? n.y = r.y + (n.x - r.x) * i.y : n.x = r.x + (n.y - r.y) * i.x;
|
|
2430
|
+
}
|
|
2431
|
+
function Ur(t, e, n, r) {
|
|
2432
|
+
var i = t.startRect, o = t.startCoords, a = t.ratio, s = t.edgeSign;
|
|
2433
|
+
if (e) {
|
|
2434
|
+
var l = r.width / a;
|
|
2435
|
+
n.y = o.y + (l - i.height) * s.y;
|
|
2436
|
+
} else {
|
|
2437
|
+
var u = r.height * a;
|
|
2438
|
+
n.x = o.x + (u - i.width) * s.x;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
var Hr = Oe(Yr, "aspectRatio"), Fn = function() {
|
|
2442
|
+
};
|
|
2443
|
+
Fn._defaults = {};
|
|
2444
|
+
var bt = Fn;
|
|
2445
|
+
function je(t, e, n) {
|
|
2446
|
+
return d.func(t) ? we(t, e.interactable, e.element, [n.x, n.y, e]) : we(t, e.interactable, e.element);
|
|
2447
|
+
}
|
|
2448
|
+
var xt = { start: function(t) {
|
|
2449
|
+
var e = t.rect, n = t.startOffset, r = t.state, i = t.interaction, o = t.pageCoords, a = r.options, s = a.elementRect, l = y({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
|
|
2450
|
+
if (e && s) {
|
|
2451
|
+
var u = je(a.restriction, i, o);
|
|
2452
|
+
if (u) {
|
|
2453
|
+
var c = u.right - u.left - e.width, p = u.bottom - u.top - e.height;
|
|
2454
|
+
c < 0 && (l.left += c, l.right += c), p < 0 && (l.top += p, l.bottom += p);
|
|
2455
|
+
}
|
|
2456
|
+
l.left += n.left - e.width * s.left, l.top += n.top - e.height * s.top, l.right += n.right - e.width * (1 - s.right), l.bottom += n.bottom - e.height * (1 - s.bottom);
|
|
2457
|
+
}
|
|
2458
|
+
r.offset = l;
|
|
2459
|
+
}, set: function(t) {
|
|
2460
|
+
var e = t.coords, n = t.interaction, r = t.state, i = r.options, o = r.offset, a = je(i.restriction, n, e);
|
|
2461
|
+
if (a) {
|
|
2462
|
+
var s = function(l) {
|
|
2463
|
+
return !l || "left" in l && "top" in l || ((l = y({}, l)).left = l.x || 0, l.top = l.y || 0, l.right = l.right || l.left + l.width, l.bottom = l.bottom || l.top + l.height), l;
|
|
2464
|
+
}(a);
|
|
2465
|
+
e.x = Math.max(Math.min(s.right - o.right, e.x), s.left + o.left), e.y = Math.max(Math.min(s.bottom - o.bottom, e.y), s.top + o.top);
|
|
2466
|
+
}
|
|
2467
|
+
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Gr = Oe(xt, "restrict"), Vn = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, $n = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
|
|
2468
|
+
function Nn(t, e) {
|
|
2469
|
+
for (var n = 0, r = ["top", "left", "bottom", "right"]; n < r.length; n++) {
|
|
2470
|
+
var i = r[n];
|
|
2471
|
+
i in t || (t[i] = e[i]);
|
|
2472
|
+
}
|
|
2473
|
+
return t;
|
|
2474
|
+
}
|
|
2475
|
+
var et = { noInner: Vn, noOuter: $n, start: function(t) {
|
|
2476
|
+
var e, n = t.interaction, r = t.startOffset, i = t.state, o = i.options;
|
|
2477
|
+
o && (e = ze(je(o.offset, n, n.coords.start.page))), e = e || { x: 0, y: 0 }, i.offset = { top: e.y + r.top, left: e.x + r.left, bottom: e.y - r.bottom, right: e.x - r.right };
|
|
2478
|
+
}, set: function(t) {
|
|
2479
|
+
var e = t.coords, n = t.edges, r = t.interaction, i = t.state, o = i.offset, a = i.options;
|
|
2480
|
+
if (n) {
|
|
2481
|
+
var s = y({}, e), l = je(a.inner, r, s) || {}, u = je(a.outer, r, s) || {};
|
|
2482
|
+
Nn(l, Vn), Nn(u, $n), n.top ? e.y = Math.min(Math.max(u.top + o.top, s.y), l.top + o.top) : n.bottom && (e.y = Math.max(Math.min(u.bottom + o.bottom, s.y), l.bottom + o.bottom)), n.left ? e.x = Math.min(Math.max(u.left + o.left, s.x), l.left + o.left) : n.right && (e.x = Math.max(Math.min(u.right + o.right, s.x), l.right + o.right));
|
|
2483
|
+
}
|
|
2484
|
+
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Kr = Oe(et, "restrictEdges"), Jr = y({ get elementRect() {
|
|
2485
|
+
return { top: 0, left: 0, bottom: 1, right: 1 };
|
|
2486
|
+
}, set elementRect(t) {
|
|
2487
|
+
} }, xt.defaults), Qr = Oe({ start: xt.start, set: xt.set, defaults: Jr }, "restrictRect"), Zr = { width: -1 / 0, height: -1 / 0 }, ei = { width: 1 / 0, height: 1 / 0 }, ti = Oe({ start: function(t) {
|
|
2488
|
+
return et.start(t);
|
|
2489
|
+
}, set: function(t) {
|
|
2490
|
+
var e = t.interaction, n = t.state, r = t.rect, i = t.edges, o = n.options;
|
|
2491
|
+
if (i) {
|
|
2492
|
+
var a = Ae(je(o.min, e, t.coords)) || Zr, s = Ae(je(o.max, e, t.coords)) || ei;
|
|
2493
|
+
n.options = { endOnly: o.endOnly, inner: y({}, et.noInner), outer: y({}, et.noOuter) }, i.top ? (n.options.inner.top = r.bottom - a.height, n.options.outer.top = r.bottom - s.height) : i.bottom && (n.options.inner.bottom = r.top + a.height, n.options.outer.bottom = r.top + s.height), i.left ? (n.options.inner.left = r.right - a.width, n.options.outer.left = r.right - s.width) : i.right && (n.options.inner.right = r.left + a.width, n.options.outer.right = r.left + s.width), et.set(t), n.options = o;
|
|
2494
|
+
}
|
|
2495
|
+
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), Yt = { start: function(t) {
|
|
2496
|
+
var e, n = t.interaction, r = t.interactable, i = t.element, o = t.rect, a = t.state, s = t.startOffset, l = a.options, u = l.offsetWithOrigin ? function(f) {
|
|
2497
|
+
var h = f.interaction.element, v = ze(we(f.state.options.origin, null, null, [h])), g = v || qe(f.interactable, h, f.interaction.prepared.name);
|
|
2498
|
+
return g;
|
|
2499
|
+
}(t) : { x: 0, y: 0 };
|
|
2500
|
+
if (l.offset === "startCoords")
|
|
2501
|
+
e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
2502
|
+
else {
|
|
2503
|
+
var c = we(l.offset, r, i, [n]);
|
|
2504
|
+
(e = ze(c) || { x: 0, y: 0 }).x += u.x, e.y += u.y;
|
|
2505
|
+
}
|
|
2506
|
+
var p = l.relativePoints;
|
|
2507
|
+
a.offsets = o && p && p.length ? p.map(function(f, h) {
|
|
2508
|
+
return { index: h, relativePoint: f, x: s.left - o.width * f.x + e.x, y: s.top - o.height * f.y + e.y };
|
|
2509
|
+
}) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
|
|
2510
|
+
}, set: function(t) {
|
|
2511
|
+
var e = t.interaction, n = t.coords, r = t.state, i = r.options, o = r.offsets, a = qe(e.interactable, e.element, e.prepared.name), s = y({}, n), l = [];
|
|
2512
|
+
i.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
2513
|
+
for (var u = 0, c = o; u < c.length; u++)
|
|
2514
|
+
for (var p = c[u], f = s.x - p.x, h = s.y - p.y, v = 0, g = i.targets.length; v < g; v++) {
|
|
2515
|
+
var b = i.targets[v], m = void 0;
|
|
2516
|
+
(m = d.func(b) ? b(f, h, e._proxy, p, v) : b) && l.push({ x: (d.number(m.x) ? m.x : f) + p.x, y: (d.number(m.y) ? m.y : h) + p.y, range: d.number(m.range) ? m.range : i.range, source: b, index: v, offset: p });
|
|
2517
|
+
}
|
|
2518
|
+
for (var w = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, S = 0; S < l.length; S++) {
|
|
2519
|
+
var k = l[S], _ = k.range, T = k.x - s.x, oe = k.y - s.y, j = Ue(T, oe), ue = j <= _;
|
|
2520
|
+
_ === 1 / 0 && w.inRange && w.range !== 1 / 0 && (ue = !1), w.target && !(ue ? w.inRange && _ !== 1 / 0 ? j / _ < w.distance / w.range : _ === 1 / 0 && w.range !== 1 / 0 || j < w.distance : !w.inRange && j < w.distance) || (w.target = k, w.distance = j, w.range = _, w.inRange = ue, w.delta.x = T, w.delta.y = oe);
|
|
2521
|
+
}
|
|
2522
|
+
return w.inRange && (n.x = w.target.x, n.y = w.target.y), r.closest = w, w;
|
|
2523
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, ni = Oe(Yt, "snap"), wt = { start: function(t) {
|
|
2524
|
+
var e = t.state, n = t.edges, r = e.options;
|
|
2525
|
+
if (!n)
|
|
2526
|
+
return null;
|
|
2527
|
+
t.state = { options: { targets: null, relativePoints: [{ x: n.left ? 0 : 1, y: n.top ? 0 : 1 }], offset: r.offset || "self", origin: { x: 0, y: 0 }, range: r.range } }, e.targetFields = e.targetFields || [["width", "height"], ["x", "y"]], Yt.start(t), e.offsets = t.state.offsets, t.state = e;
|
|
2528
|
+
}, set: function(t) {
|
|
2529
|
+
var e = t.interaction, n = t.state, r = t.coords, i = n.options, o = n.offsets, a = { x: r.x - o[0].x, y: r.y - o[0].y };
|
|
2530
|
+
n.options = y({}, i), n.options.targets = [];
|
|
2531
|
+
for (var s = 0, l = i.targets || []; s < l.length; s++) {
|
|
2532
|
+
var u = l[s], c = void 0;
|
|
2533
|
+
if (c = d.func(u) ? u(a.x, a.y, e) : u) {
|
|
2534
|
+
for (var p = 0, f = n.targetFields; p < f.length; p++) {
|
|
2535
|
+
var h = f[p], v = h[0], g = h[1];
|
|
2536
|
+
if (v in c || g in c) {
|
|
2537
|
+
c.x = c[v], c.y = c[g];
|
|
2538
|
+
break;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
n.options.targets.push(c);
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
var b = Yt.set(t);
|
|
2545
|
+
return n.options = i, b;
|
|
2546
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, ri = Oe(wt, "snapSize"), qt = { aspectRatio: Hr, restrictEdges: Kr, restrict: Gr, restrictRect: Qr, restrictSize: ti, snapEdges: Oe({ start: function(t) {
|
|
2547
|
+
var e = t.edges;
|
|
2548
|
+
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], wt.start(t)) : null;
|
|
2549
|
+
}, set: wt.set, defaults: y(Le(wt.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: ni, snapSize: ri, spring: bt, avoid: bt, transform: bt, rubberband: bt }, ii = { id: "modifiers", install: function(t) {
|
|
2550
|
+
var e = t.interactStatic;
|
|
2551
|
+
for (var n in t.usePlugin(_n), t.usePlugin(Xr), e.modifiers = qt, qt) {
|
|
2552
|
+
var r = qt[n], i = r._defaults, o = r._methods;
|
|
2553
|
+
i._methods = o, t.defaults.perAction[n] = i;
|
|
2554
|
+
}
|
|
2555
|
+
} }, oi = ii, Bn = function(t) {
|
|
2556
|
+
W(n, t);
|
|
2557
|
+
var e = le(n);
|
|
2558
|
+
function n(r, i, o, a, s, l) {
|
|
2559
|
+
var u;
|
|
2560
|
+
if (A(this, n), ut(J(u = e.call(this, s)), o), o !== i && ut(J(u), i), u.timeStamp = l, u.originalEvent = o, u.type = r, u.pointerId = He(i), u.pointerType = rn(i), u.target = a, u.currentTarget = null, r === "tap") {
|
|
2561
|
+
var c = s.getPointerIndex(i);
|
|
2562
|
+
u.dt = u.timeStamp - s.pointers[c].downTime;
|
|
2563
|
+
var p = u.timeStamp - s.tapTime;
|
|
2564
|
+
u.double = !!s.prevTap && s.prevTap.type !== "doubletap" && s.prevTap.target === u.target && p < 500;
|
|
2565
|
+
} else
|
|
2566
|
+
r === "doubletap" && (u.dt = i.timeStamp - s.tapTime, u.double = !0);
|
|
2567
|
+
return u;
|
|
2568
|
+
}
|
|
2569
|
+
return P(n, [{ key: "_subtractOrigin", value: function(r) {
|
|
2570
|
+
var i = r.x, o = r.y;
|
|
2571
|
+
return this.pageX -= i, this.pageY -= o, this.clientX -= i, this.clientY -= o, this;
|
|
2572
|
+
} }, { key: "_addOrigin", value: function(r) {
|
|
2573
|
+
var i = r.x, o = r.y;
|
|
2574
|
+
return this.pageX += i, this.pageY += o, this.clientX += i, this.clientY += o, this;
|
|
2575
|
+
} }, { key: "preventDefault", value: function() {
|
|
2576
|
+
this.originalEvent.preventDefault();
|
|
2577
|
+
} }]), n;
|
|
2578
|
+
}(ft), tt = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
|
|
2579
|
+
t.pointerEvents = tt, t.defaults.actions.pointerEvents = tt.defaults, y(t.actions.phaselessTypes, tt.types);
|
|
2580
|
+
}, listeners: { "interactions:new": function(t) {
|
|
2581
|
+
var e = t.interaction;
|
|
2582
|
+
e.prevTap = null, e.tapTime = 0;
|
|
2583
|
+
}, "interactions:update-pointer": function(t) {
|
|
2584
|
+
var e = t.down, n = t.pointerInfo;
|
|
2585
|
+
!e && n.hold || (n.hold = { duration: 1 / 0, timeout: null });
|
|
2586
|
+
}, "interactions:move": function(t, e) {
|
|
2587
|
+
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget;
|
|
2588
|
+
t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && Ut(t), De({ interaction: n, pointer: r, event: i, eventTarget: o, type: "move" }, e));
|
|
2589
|
+
}, "interactions:down": function(t, e) {
|
|
2590
|
+
(function(n, r) {
|
|
2591
|
+
for (var i = n.interaction, o = n.pointer, a = n.event, s = n.eventTarget, l = n.pointerIndex, u = i.pointers[l].hold, c = x(s), p = { interaction: i, pointer: o, event: a, eventTarget: s, type: "hold", targets: [], path: c, node: null }, f = 0; f < c.length; f++) {
|
|
2592
|
+
var h = c[f];
|
|
2593
|
+
p.node = h, r.fire("pointerEvents:collect-targets", p);
|
|
2594
|
+
}
|
|
2595
|
+
if (p.targets.length) {
|
|
2596
|
+
for (var v = 1 / 0, g = 0, b = p.targets; g < b.length; g++) {
|
|
2597
|
+
var m = b[g].eventable.options.holdDuration;
|
|
2598
|
+
m < v && (v = m);
|
|
2599
|
+
}
|
|
2600
|
+
u.duration = v, u.timeout = setTimeout(function() {
|
|
2601
|
+
De({ interaction: i, eventTarget: s, pointer: o, event: a, type: "hold" }, r);
|
|
2602
|
+
}, v);
|
|
2603
|
+
}
|
|
2604
|
+
})(t, e), De(t, e);
|
|
2605
|
+
}, "interactions:up": function(t, e) {
|
|
2606
|
+
Ut(t), De(t, e), function(n, r) {
|
|
2607
|
+
var i = n.interaction, o = n.pointer, a = n.event, s = n.eventTarget;
|
|
2608
|
+
i.pointerWasMoved || De({ interaction: i, eventTarget: s, pointer: o, event: a, type: "tap" }, r);
|
|
2609
|
+
}(t, e);
|
|
2610
|
+
}, "interactions:cancel": function(t, e) {
|
|
2611
|
+
Ut(t), De(t, e);
|
|
2612
|
+
} }, PointerEvent: Bn, fire: De, collectEventTargets: Ln, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: !0, move: !0, up: !0, cancel: !0, tap: !0, doubletap: !0, hold: !0 } };
|
|
2613
|
+
function De(t, e) {
|
|
2614
|
+
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget, a = t.type, s = t.targets, l = s === void 0 ? Ln(t, e) : s, u = new Bn(a, r, i, o, n, e.now());
|
|
2615
|
+
e.fire("pointerEvents:new", { pointerEvent: u });
|
|
2616
|
+
for (var c = { interaction: n, pointer: r, event: i, eventTarget: o, targets: l, type: a, pointerEvent: u }, p = 0; p < l.length; p++) {
|
|
2617
|
+
var f = l[p];
|
|
2618
|
+
for (var h in f.props || {})
|
|
2619
|
+
u[h] = f.props[h];
|
|
2620
|
+
var v = qe(f.eventable, f.node);
|
|
2621
|
+
if (u._subtractOrigin(v), u.eventable = f.eventable, u.currentTarget = f.node, f.eventable.fire(u), u._addOrigin(v), u.immediatePropagationStopped || u.propagationStopped && p + 1 < l.length && l[p + 1].node !== u.currentTarget)
|
|
2622
|
+
break;
|
|
2623
|
+
}
|
|
2624
|
+
if (e.fire("pointerEvents:fired", c), a === "tap") {
|
|
2625
|
+
var g = u.double ? De({ interaction: n, pointer: r, event: i, eventTarget: o, type: "doubletap" }, e) : u;
|
|
2626
|
+
n.prevTap = g, n.tapTime = g.timeStamp;
|
|
2627
|
+
}
|
|
2628
|
+
return u;
|
|
2629
|
+
}
|
|
2630
|
+
function Ln(t, e) {
|
|
2631
|
+
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget, a = t.type, s = n.getPointerIndex(r), l = n.pointers[s];
|
|
2632
|
+
if (a === "tap" && (n.pointerWasMoved || !l || l.downTarget !== o))
|
|
2633
|
+
return [];
|
|
2634
|
+
for (var u = x(o), c = { interaction: n, pointer: r, event: i, eventTarget: o, type: a, path: u, targets: [], node: null }, p = 0; p < u.length; p++) {
|
|
2635
|
+
var f = u[p];
|
|
2636
|
+
c.node = f, e.fire("pointerEvents:collect-targets", c);
|
|
2637
|
+
}
|
|
2638
|
+
return a === "hold" && (c.targets = c.targets.filter(function(h) {
|
|
2639
|
+
var v, g;
|
|
2640
|
+
return h.eventable.options.holdDuration === ((v = n.pointers[s]) == null || (g = v.hold) == null ? void 0 : g.duration);
|
|
2641
|
+
})), c.targets;
|
|
2642
|
+
}
|
|
2643
|
+
function Ut(t) {
|
|
2644
|
+
var e = t.interaction, n = t.pointerIndex, r = e.pointers[n].hold;
|
|
2645
|
+
r && r.timeout && (clearTimeout(r.timeout), r.timeout = null);
|
|
2646
|
+
}
|
|
2647
|
+
var ai = Object.freeze({ __proto__: null, default: tt });
|
|
2648
|
+
function si(t) {
|
|
2649
|
+
var e = t.interaction;
|
|
2650
|
+
e.holdIntervalHandle && (clearInterval(e.holdIntervalHandle), e.holdIntervalHandle = null);
|
|
2651
|
+
}
|
|
2652
|
+
var li = { id: "pointer-events/holdRepeat", install: function(t) {
|
|
2653
|
+
t.usePlugin(tt);
|
|
2654
|
+
var e = t.pointerEvents;
|
|
2655
|
+
e.defaults.holdRepeatInterval = 0, e.types.holdrepeat = t.actions.phaselessTypes.holdrepeat = !0;
|
|
2656
|
+
}, listeners: ["move", "up", "cancel", "endall"].reduce(function(t, e) {
|
|
2657
|
+
return t["pointerEvents:".concat(e)] = si, t;
|
|
2658
|
+
}, { "pointerEvents:new": function(t) {
|
|
2659
|
+
var e = t.pointerEvent;
|
|
2660
|
+
e.type === "hold" && (e.count = (e.count || 0) + 1);
|
|
2661
|
+
}, "pointerEvents:fired": function(t, e) {
|
|
2662
|
+
var n = t.interaction, r = t.pointerEvent, i = t.eventTarget, o = t.targets;
|
|
2663
|
+
if (r.type === "hold" && o.length) {
|
|
2664
|
+
var a = o[0].eventable.options.holdRepeatInterval;
|
|
2665
|
+
a <= 0 || (n.holdIntervalHandle = setTimeout(function() {
|
|
2666
|
+
e.pointerEvents.fire({ interaction: n, eventTarget: i, type: "hold", pointer: r, event: r }, e);
|
|
2667
|
+
}, a));
|
|
2668
|
+
}
|
|
2669
|
+
} }) }, ci = li, ui = { id: "pointer-events/interactableTargets", install: function(t) {
|
|
2670
|
+
var e = t.Interactable;
|
|
2671
|
+
e.prototype.pointerEvents = function(r) {
|
|
2672
|
+
return y(this.events.options, r), this;
|
|
2673
|
+
};
|
|
2674
|
+
var n = e.prototype._backCompatOption;
|
|
2675
|
+
e.prototype._backCompatOption = function(r, i) {
|
|
2676
|
+
var o = n.call(this, r, i);
|
|
2677
|
+
return o === this && (this.events.options[r] = i), o;
|
|
2678
|
+
};
|
|
2679
|
+
}, listeners: { "pointerEvents:collect-targets": function(t, e) {
|
|
2680
|
+
var n = t.targets, r = t.node, i = t.type, o = t.eventTarget;
|
|
2681
|
+
e.interactables.forEachMatch(r, function(a) {
|
|
2682
|
+
var s = a.events, l = s.options;
|
|
2683
|
+
s.types[i] && s.types[i].length && a.testIgnoreAllow(l, r, o) && n.push({ node: r, eventable: s, props: { interactable: a } });
|
|
2684
|
+
});
|
|
2685
|
+
}, "interactable:new": function(t) {
|
|
2686
|
+
var e = t.interactable;
|
|
2687
|
+
e.events.getRect = function(n) {
|
|
2688
|
+
return e.getRect(n);
|
|
2689
|
+
};
|
|
2690
|
+
}, "interactable:set": function(t, e) {
|
|
2691
|
+
var n = t.interactable, r = t.options;
|
|
2692
|
+
y(n.events.options, e.pointerEvents.defaults), y(n.events.options, r.pointerEvents || {});
|
|
2693
|
+
} } }, pi = ui, di = { id: "pointer-events", install: function(t) {
|
|
2694
|
+
t.usePlugin(ai), t.usePlugin(ci), t.usePlugin(pi);
|
|
2695
|
+
} }, fi = di, vi = { id: "reflow", install: function(t) {
|
|
2696
|
+
var e = t.Interactable;
|
|
2697
|
+
t.actions.phases.reflow = !0, e.prototype.reflow = function(n) {
|
|
2698
|
+
return function(r, i, o) {
|
|
2699
|
+
for (var a = r.getAllElements(), s = o.window.Promise, l = s ? [] : null, u = function() {
|
|
2700
|
+
var p = a[c], f = r.getRect(p);
|
|
2701
|
+
if (!f)
|
|
2702
|
+
return 1;
|
|
2703
|
+
var h, v = Ke(o.interactions.list, function(m) {
|
|
2704
|
+
return m.interacting() && m.interactable === r && m.element === p && m.prepared.name === i.name;
|
|
2705
|
+
});
|
|
2706
|
+
if (v)
|
|
2707
|
+
v.move(), l && (h = v._reflowPromise || new s(function(m) {
|
|
2708
|
+
v._reflowResolve = m;
|
|
2709
|
+
}));
|
|
2710
|
+
else {
|
|
2711
|
+
var g = Ae(f), b = function(m) {
|
|
2712
|
+
return { coords: m, get page() {
|
|
2713
|
+
return this.coords.page;
|
|
2714
|
+
}, get client() {
|
|
2715
|
+
return this.coords.client;
|
|
2716
|
+
}, get timeStamp() {
|
|
2717
|
+
return this.coords.timeStamp;
|
|
2718
|
+
}, get pageX() {
|
|
2719
|
+
return this.coords.page.x;
|
|
2720
|
+
}, get pageY() {
|
|
2721
|
+
return this.coords.page.y;
|
|
2722
|
+
}, get clientX() {
|
|
2723
|
+
return this.coords.client.x;
|
|
2724
|
+
}, get clientY() {
|
|
2725
|
+
return this.coords.client.y;
|
|
2726
|
+
}, get pointerId() {
|
|
2727
|
+
return this.coords.pointerId;
|
|
2728
|
+
}, get target() {
|
|
2729
|
+
return this.coords.target;
|
|
2730
|
+
}, get type() {
|
|
2731
|
+
return this.coords.type;
|
|
2732
|
+
}, get pointerType() {
|
|
2733
|
+
return this.coords.pointerType;
|
|
2734
|
+
}, get buttons() {
|
|
2735
|
+
return this.coords.buttons;
|
|
2736
|
+
}, preventDefault: function() {
|
|
2737
|
+
} };
|
|
2738
|
+
}({ page: { x: g.x, y: g.y }, client: { x: g.x, y: g.y }, timeStamp: o.now() });
|
|
2739
|
+
h = function(m, w, S, k, _) {
|
|
2740
|
+
var T = m.interactions.new({ pointerType: "reflow" }), oe = { interaction: T, event: _, pointer: _, eventTarget: S, phase: "reflow" };
|
|
2741
|
+
T.interactable = w, T.element = S, T.prevEvent = _, T.updatePointer(_, _, S, !0), Zt(T.coords.delta), Rt(T.prepared, k), T._doPhase(oe);
|
|
2742
|
+
var j = m.window, ue = j.Promise, fe = ue ? new ue(function(Se) {
|
|
2743
|
+
T._reflowResolve = Se;
|
|
2744
|
+
}) : void 0;
|
|
2745
|
+
return T._reflowPromise = fe, T.start(k, w, S), T._interacting ? (T.move(oe), T.end(_)) : (T.stop(), T._reflowResolve()), T.removePointer(_, _), fe;
|
|
2746
|
+
}(o, r, p, i, b);
|
|
2747
|
+
}
|
|
2748
|
+
l && l.push(h);
|
|
2749
|
+
}, c = 0; c < a.length && !u(); c++)
|
|
2750
|
+
;
|
|
2751
|
+
return l && s.all(l).then(function() {
|
|
2752
|
+
return r;
|
|
2753
|
+
});
|
|
2754
|
+
}(this, n, t);
|
|
2755
|
+
};
|
|
2756
|
+
}, listeners: { "interactions:stop": function(t, e) {
|
|
2757
|
+
var n = t.interaction;
|
|
2758
|
+
n.pointerType === "reflow" && (n._reflowResolve && n._reflowResolve(), function(r, i) {
|
|
2759
|
+
r.splice(r.indexOf(i), 1);
|
|
2760
|
+
}(e.interactions.list, n));
|
|
2761
|
+
} } }, hi = vi;
|
|
2762
|
+
if (ie.use(wn), ie.use(Pn), ie.use(fi), ie.use(zr), ie.use(oi), ie.use(xr), ie.use(cr), ie.use(pr), ie.use(hi), ie.default = ie, ne(I) === "object" && I)
|
|
2763
|
+
try {
|
|
2764
|
+
I.exports = ie;
|
|
2765
|
+
} catch {
|
|
2766
|
+
}
|
|
2767
|
+
return ie.default = ie, ie;
|
|
2768
|
+
});
|
|
2769
|
+
})(Tt, Tt.exports);
|
|
2770
|
+
var eo = Tt.exports;
|
|
2771
|
+
const qn = /* @__PURE__ */ $i(eo);
|
|
2772
|
+
const to = { class: "variety-auto-complete" }, no = { key: 0 }, ro = { class: "label" }, io = {
|
|
30
2773
|
__name: "VarietySelect",
|
|
31
2774
|
props: {
|
|
32
2775
|
size: { type: String, default: "default" },
|
|
@@ -37,53 +2780,53 @@ const ue = { class: "variety-auto-complete" }, ce = { key: 0 }, de = { class: "l
|
|
|
37
2780
|
// 是否开启选择回调后清除输入框值
|
|
38
2781
|
},
|
|
39
2782
|
emits: ["select", "change"],
|
|
40
|
-
setup(
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
2783
|
+
setup(I, { emit: Ve }) {
|
|
2784
|
+
const Y = Qn("stConfig"), z = Ve, ne = I, A = H(""), he = async (W, C) => {
|
|
2785
|
+
if (W === "" || W === "null")
|
|
2786
|
+
C([]);
|
|
44
2787
|
else {
|
|
45
|
-
const
|
|
46
|
-
keyWord:
|
|
2788
|
+
const ee = {
|
|
2789
|
+
keyWord: W,
|
|
47
2790
|
pageNum: 1,
|
|
48
2791
|
pageSize: 999,
|
|
49
|
-
userId:
|
|
2792
|
+
userId: Xi("id"),
|
|
50
2793
|
hotSearchFlag: 1
|
|
51
|
-
}, { body:
|
|
52
|
-
label: `${
|
|
53
|
-
value:
|
|
2794
|
+
}, { body: J } = await Y.request.post("/common/qt/getFeatureInfosByPage", ee), le = J.list.map(({ code: $, featureName: O }) => ({
|
|
2795
|
+
label: `${$} ${O}`,
|
|
2796
|
+
value: $
|
|
54
2797
|
}));
|
|
55
|
-
|
|
2798
|
+
C(le);
|
|
56
2799
|
}
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
|
|
2800
|
+
}, P = ({ label: W, value: C }) => {
|
|
2801
|
+
const ee = W.split(" ").at(-1);
|
|
2802
|
+
z("select", { name: ee, code: C }), ne.selectClearEnable && (A.value = "");
|
|
2803
|
+
}, F = (W) => {
|
|
2804
|
+
z("change", W);
|
|
62
2805
|
};
|
|
63
|
-
return (
|
|
64
|
-
const
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
modelValue:
|
|
69
|
-
"onUpdate:modelValue":
|
|
2806
|
+
return (W, C) => {
|
|
2807
|
+
const ee = Zi;
|
|
2808
|
+
return V(), Z("div", to, [
|
|
2809
|
+
I.labelShowEnable ? (V(), Z("span", no, "品种搜索:")) : Te("", !0),
|
|
2810
|
+
pe(ee, {
|
|
2811
|
+
modelValue: A.value,
|
|
2812
|
+
"onUpdate:modelValue": C[0] || (C[0] = (J) => A.value = J),
|
|
70
2813
|
clearable: "",
|
|
71
|
-
size:
|
|
72
|
-
placeholder:
|
|
73
|
-
"fetch-suggestions":
|
|
74
|
-
onSelect:
|
|
75
|
-
onChange:
|
|
2814
|
+
size: ne.size,
|
|
2815
|
+
placeholder: ne.placeholder,
|
|
2816
|
+
"fetch-suggestions": he,
|
|
2817
|
+
onSelect: P,
|
|
2818
|
+
onChange: F
|
|
76
2819
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
2820
|
+
default: ae(({ item: J }) => [
|
|
2821
|
+
ve("div", ro, Xe(J.label), 1)
|
|
79
2822
|
]),
|
|
80
2823
|
_: 1
|
|
81
2824
|
}, 8, ["modelValue", "size", "placeholder"])
|
|
82
2825
|
]);
|
|
83
2826
|
};
|
|
84
2827
|
}
|
|
85
|
-
},
|
|
86
|
-
const
|
|
2828
|
+
}, oo = /* @__PURE__ */ er(io, [["__scopeId", "data-v-d433c4b8"]]);
|
|
2829
|
+
const ao = (I) => (Fi("data-v-ab51011c"), I = I(), Vi(), I), so = { class: "custom-header" }, lo = { class: "left" }, co = /* @__PURE__ */ ao(() => /* @__PURE__ */ ve("span", null, " 选择变量 ", -1)), uo = { class: "right" }, po = { class: "custom-body" }, fo = { class: "config-list" }, vo = { class: "config-item" }, ho = { key: 0 }, go = { key: 0 }, mo = { key: 1 }, yo = { key: 0 }, bo = {
|
|
87
2830
|
__name: "index",
|
|
88
2831
|
props: {
|
|
89
2832
|
useCase: {
|
|
@@ -92,214 +2835,214 @@ const _e = (d) => (le("data-v-ab51011c"), d = d(), oe(), d), ve = { class: "cust
|
|
|
92
2835
|
// 1-选股, 2-回测
|
|
93
2836
|
}
|
|
94
2837
|
},
|
|
95
|
-
setup(
|
|
96
|
-
const
|
|
97
|
-
var
|
|
98
|
-
return ((
|
|
99
|
-
}),
|
|
100
|
-
const
|
|
2838
|
+
setup(I, { expose: Ve }) {
|
|
2839
|
+
const Y = Qn("stConfig"), z = I, ne = H(null), A = H((window.innerHeight - 542) / 2 - 220 > 0 ? (window.innerHeight - 542) / 2 - 220 : 0), he = H((window.innerWidth - 1e3) / 2 > 0 ? (window.innerWidth - 1e3) / 2 : 0), P = H(null), F = H(!1), W = H(0), C = H(null), ee = H([]), J = it(() => {
|
|
2840
|
+
var O;
|
|
2841
|
+
return ((O = ee.value.find((q) => q.varName === C.value)) == null ? void 0 : O.formatList) ?? [];
|
|
2842
|
+
}), le = (O) => O.replace(/^\[|\]$/g, "").split("],[").map((R) => {
|
|
2843
|
+
const B = R.replace(/\[|\]/g, ""), [X, re] = B.split(",");
|
|
101
2844
|
return {
|
|
102
|
-
label:
|
|
103
|
-
value:
|
|
2845
|
+
label: X.trim(),
|
|
2846
|
+
value: re.trim()
|
|
104
2847
|
};
|
|
105
|
-
}),
|
|
106
|
-
const
|
|
107
|
-
for (let
|
|
108
|
-
const
|
|
109
|
-
switch (console.log(
|
|
2848
|
+
}), $ = (O) => {
|
|
2849
|
+
const q = [];
|
|
2850
|
+
for (let U = 0; U < O.length; U++) {
|
|
2851
|
+
const d = O[U];
|
|
2852
|
+
switch (console.log(d), d.vtype) {
|
|
110
2853
|
case "text": {
|
|
111
|
-
|
|
2854
|
+
q.push(d.param);
|
|
112
2855
|
break;
|
|
113
2856
|
}
|
|
114
2857
|
default: {
|
|
115
|
-
if (!
|
|
116
|
-
return
|
|
117
|
-
let
|
|
118
|
-
|
|
2858
|
+
if (!d.modelValue)
|
|
2859
|
+
return Yn.error("请检查插入格式内是否填写完整");
|
|
2860
|
+
let G = d.modelValue;
|
|
2861
|
+
d.prefix && (G = `${d.prefix}${G}`), d.suffix && (G = `${G}${d.suffix}`), q.push(G);
|
|
119
2862
|
break;
|
|
120
2863
|
}
|
|
121
2864
|
}
|
|
122
2865
|
}
|
|
123
|
-
if (!
|
|
124
|
-
return
|
|
125
|
-
const
|
|
2866
|
+
if (!P.value)
|
|
2867
|
+
return Yn.error("未检测到编辑器实例");
|
|
2868
|
+
const N = q.join("_"), R = P.value.getInstance(), B = R.getPosition(), re = P.value.getValue().split(`
|
|
126
2869
|
`);
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
const
|
|
2870
|
+
if (B.lineNumber <= re.length) {
|
|
2871
|
+
const U = B.lineNumber - 1, d = re[U], G = d.substring(0, B.column - 1) + N + d.substring(B.column - 1);
|
|
2872
|
+
re[U] = G;
|
|
2873
|
+
const D = re.join(`
|
|
131
2874
|
`);
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
lineNumber:
|
|
136
|
-
column:
|
|
137
|
-
}),
|
|
2875
|
+
P.value.setValue(D);
|
|
2876
|
+
const ge = B.column + N.length;
|
|
2877
|
+
R.setPosition({
|
|
2878
|
+
lineNumber: B.lineNumber,
|
|
2879
|
+
column: ge
|
|
2880
|
+
}), R.focus();
|
|
138
2881
|
}
|
|
139
2882
|
};
|
|
140
|
-
return
|
|
141
|
-
const { body:
|
|
142
|
-
|
|
143
|
-
}),
|
|
2883
|
+
return Kn(async () => {
|
|
2884
|
+
const { body: O } = await Y.request.post("/common/conf/queryAllBackVariables", { useCase: z.useCase });
|
|
2885
|
+
ee.value = O ?? [];
|
|
2886
|
+
}), Ve({
|
|
144
2887
|
/**
|
|
145
2888
|
* @description: 打开变量选择器窗口
|
|
146
2889
|
* @editor 脚本编辑器实例
|
|
147
2890
|
* @newZindex Number 窗口定位层级
|
|
148
2891
|
*/
|
|
149
|
-
open: (
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
2892
|
+
open: (O, q = 1002) => {
|
|
2893
|
+
P.value = O, W.value = q, F.value = !0;
|
|
2894
|
+
const N = document.querySelector("body");
|
|
2895
|
+
qn(ne.value).draggable({
|
|
153
2896
|
allowFrom: ".custom-header",
|
|
154
2897
|
// 只有 .custom-header 元素可以触发拖拽
|
|
155
2898
|
// 限制拖拽范围
|
|
156
2899
|
modifiers: [
|
|
157
|
-
|
|
158
|
-
restriction:
|
|
2900
|
+
qn.modifiers.restrictRect({
|
|
2901
|
+
restriction: N,
|
|
159
2902
|
// 限制在拖拽区域内
|
|
160
2903
|
endOnly: !1
|
|
161
2904
|
// 实时限制
|
|
162
2905
|
})
|
|
163
2906
|
],
|
|
164
2907
|
listeners: {
|
|
165
|
-
move(
|
|
166
|
-
|
|
2908
|
+
move(R) {
|
|
2909
|
+
he.value -= R.dx, A.value += R.dy;
|
|
167
2910
|
}
|
|
168
2911
|
}
|
|
169
2912
|
});
|
|
170
2913
|
},
|
|
171
2914
|
close: () => {
|
|
172
|
-
|
|
2915
|
+
F.value = !1;
|
|
173
2916
|
}
|
|
174
|
-
}), (
|
|
175
|
-
const
|
|
176
|
-
return
|
|
2917
|
+
}), (O, q) => {
|
|
2918
|
+
const N = Oi, R = Ii, B = Zn, X = Hn, re = ki, U = Un;
|
|
2919
|
+
return Ri((V(), Z("div", {
|
|
177
2920
|
class: "var-select-dialog",
|
|
178
2921
|
ref_key: "dialogRef",
|
|
179
|
-
ref:
|
|
180
|
-
style:
|
|
2922
|
+
ref: ne,
|
|
2923
|
+
style: Kt({ right: `${he.value}px`, top: `${A.value}px`, zIndex: W.value })
|
|
181
2924
|
}, [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
modelValue:
|
|
187
|
-
"onUpdate:modelValue":
|
|
2925
|
+
ve("div", so, [
|
|
2926
|
+
ve("div", lo, [
|
|
2927
|
+
co,
|
|
2928
|
+
pe(R, {
|
|
2929
|
+
modelValue: C.value,
|
|
2930
|
+
"onUpdate:modelValue": q[0] || (q[0] = (d) => C.value = d),
|
|
188
2931
|
placeholder: "选择变量",
|
|
189
2932
|
filterable: "",
|
|
190
2933
|
clearable: ""
|
|
191
2934
|
}, {
|
|
192
|
-
default:
|
|
193
|
-
(
|
|
194
|
-
key:
|
|
195
|
-
label:
|
|
196
|
-
value:
|
|
2935
|
+
default: ae(() => [
|
|
2936
|
+
(V(!0), Z(Fe, null, at(ee.value, (d, G) => (V(), ot(N, {
|
|
2937
|
+
key: G,
|
|
2938
|
+
label: d.varName,
|
|
2939
|
+
value: d.varName
|
|
197
2940
|
}, null, 8, ["label", "value"]))), 128))
|
|
198
2941
|
]),
|
|
199
2942
|
_: 1
|
|
200
2943
|
}, 8, ["modelValue"])
|
|
201
2944
|
]),
|
|
202
|
-
|
|
203
|
-
|
|
2945
|
+
ve("div", uo, [
|
|
2946
|
+
pe(B, {
|
|
204
2947
|
class: "el-icon--left",
|
|
205
|
-
onClick:
|
|
2948
|
+
onClick: q[1] || (q[1] = (d) => F.value = !1)
|
|
206
2949
|
}, {
|
|
207
|
-
default:
|
|
208
|
-
|
|
2950
|
+
default: ae(() => [
|
|
2951
|
+
pe(M(Li))
|
|
209
2952
|
]),
|
|
210
2953
|
_: 1
|
|
211
2954
|
})
|
|
212
2955
|
])
|
|
213
2956
|
]),
|
|
214
|
-
|
|
215
|
-
|
|
2957
|
+
ve("div", po, [
|
|
2958
|
+
J.value.length ? (V(!0), Z(Fe, { key: 0 }, at(J.value, (d, G) => (V(), Z("div", {
|
|
216
2959
|
class: "format-item",
|
|
217
|
-
key:
|
|
2960
|
+
key: G
|
|
218
2961
|
}, [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
2962
|
+
ve("span", null, "格式" + Xe(G + 1) + ":", 1),
|
|
2963
|
+
ve("div", fo, [
|
|
2964
|
+
(V(!0), Z(Fe, null, at(d.configList, (D, ge) => (V(), Z(Fe, null, [
|
|
2965
|
+
ve("div", vo, [
|
|
2966
|
+
D.vtype === "text" ? (V(), Z("span", ho, Xe(D.param), 1)) : Te("", !0),
|
|
2967
|
+
D.vtype === "inputVariety" ? (V(), ot(oo, {
|
|
225
2968
|
key: 1,
|
|
226
2969
|
size: "small",
|
|
227
|
-
placeholder:
|
|
2970
|
+
placeholder: D.param,
|
|
228
2971
|
selectClearEnable: !1,
|
|
229
2972
|
labelShowEnable: !1,
|
|
230
|
-
onSelect: ({ name:
|
|
231
|
-
onChange: (
|
|
2973
|
+
onSelect: ({ name: te, code: Q }) => D.modelValue = Q,
|
|
2974
|
+
onChange: (te) => D.modelValue = te,
|
|
232
2975
|
style: { width: "100px" }
|
|
233
|
-
}, null, 8, ["placeholder", "onSelect", "onChange"])) :
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
modelValue:
|
|
238
|
-
"onUpdate:modelValue": (
|
|
239
|
-
placeholder:
|
|
2976
|
+
}, null, 8, ["placeholder", "onSelect", "onChange"])) : Te("", !0),
|
|
2977
|
+
D.vtype === "input" ? (V(), Z(Fe, { key: 2 }, [
|
|
2978
|
+
D.prefix ? (V(), Z("span", go, Xe(D.prefix), 1)) : Te("", !0),
|
|
2979
|
+
pe(X, {
|
|
2980
|
+
modelValue: D.modelValue,
|
|
2981
|
+
"onUpdate:modelValue": (te) => D.modelValue = te,
|
|
2982
|
+
placeholder: D.param,
|
|
240
2983
|
size: "small"
|
|
241
2984
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"]),
|
|
242
|
-
|
|
243
|
-
], 64)) :
|
|
244
|
-
|
|
2985
|
+
D.suffix ? (V(), Z("span", mo, Xe(D.suffix), 1)) : Te("", !0)
|
|
2986
|
+
], 64)) : Te("", !0),
|
|
2987
|
+
D.vtype === "select" ? (V(), ot(R, {
|
|
245
2988
|
key: 3,
|
|
246
|
-
modelValue:
|
|
247
|
-
"onUpdate:modelValue": (
|
|
248
|
-
placeholder:
|
|
2989
|
+
modelValue: D.modelValue,
|
|
2990
|
+
"onUpdate:modelValue": (te) => D.modelValue = te,
|
|
2991
|
+
placeholder: D.param,
|
|
249
2992
|
clearable: "",
|
|
250
2993
|
size: "small"
|
|
251
2994
|
}, {
|
|
252
|
-
default:
|
|
253
|
-
(
|
|
254
|
-
key:
|
|
255
|
-
label:
|
|
256
|
-
value:
|
|
2995
|
+
default: ae(() => [
|
|
2996
|
+
(V(!0), Z(Fe, null, at(le(D.optionsStr), (te) => (V(), ot(N, {
|
|
2997
|
+
key: te.value,
|
|
2998
|
+
label: te.label,
|
|
2999
|
+
value: te.value
|
|
257
3000
|
}, null, 8, ["label", "value"]))), 128))
|
|
258
3001
|
]),
|
|
259
3002
|
_: 2
|
|
260
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])) :
|
|
3003
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])) : Te("", !0)
|
|
261
3004
|
]),
|
|
262
|
-
|
|
3005
|
+
ge !== d.configList.length - 1 ? (V(), Z("span", yo, "_")) : Te("", !0)
|
|
263
3006
|
], 64))), 256))
|
|
264
3007
|
]),
|
|
265
|
-
|
|
3008
|
+
pe(re, {
|
|
266
3009
|
type: "primary",
|
|
267
3010
|
plain: "",
|
|
268
3011
|
size: "small",
|
|
269
|
-
onClick: (
|
|
3012
|
+
onClick: (D) => $(d.configList)
|
|
270
3013
|
}, {
|
|
271
|
-
default:
|
|
272
|
-
|
|
3014
|
+
default: ae(() => [
|
|
3015
|
+
Jn(" 插入变量 ")
|
|
273
3016
|
]),
|
|
274
3017
|
_: 2
|
|
275
3018
|
}, 1032, ["onClick"]),
|
|
276
|
-
|
|
3019
|
+
pe(U, {
|
|
277
3020
|
effect: "dark",
|
|
278
|
-
content:
|
|
3021
|
+
content: d.tip,
|
|
279
3022
|
placement: "top-start"
|
|
280
3023
|
}, {
|
|
281
|
-
default:
|
|
282
|
-
|
|
283
|
-
default:
|
|
284
|
-
|
|
3024
|
+
default: ae(() => [
|
|
3025
|
+
pe(B, null, {
|
|
3026
|
+
default: ae(() => [
|
|
3027
|
+
pe(M(Wi))
|
|
285
3028
|
]),
|
|
286
3029
|
_: 1
|
|
287
3030
|
})
|
|
288
3031
|
]),
|
|
289
3032
|
_: 2
|
|
290
3033
|
}, 1032, ["content"])
|
|
291
|
-
]))), 128)) :
|
|
3034
|
+
]))), 128)) : Te("", !0)
|
|
292
3035
|
])
|
|
293
3036
|
], 4)), [
|
|
294
|
-
[
|
|
3037
|
+
[ji, F.value]
|
|
295
3038
|
]);
|
|
296
3039
|
};
|
|
297
3040
|
}
|
|
298
|
-
},
|
|
299
|
-
install(
|
|
300
|
-
|
|
3041
|
+
}, xo = /* @__PURE__ */ er(bo, [["__scopeId", "data-v-ab51011c"]]), Ho = {
|
|
3042
|
+
install(I) {
|
|
3043
|
+
I.component("st-varSelectDialog", xo);
|
|
301
3044
|
}
|
|
302
3045
|
};
|
|
303
3046
|
export {
|
|
304
|
-
|
|
3047
|
+
Ho as default
|
|
305
3048
|
};
|