@figurosity/consumer-pose-generator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,4998 @@
|
|
|
1
|
+
import { ref as j, computed as y, watch as Ne, onBeforeMount as To, defineComponent as T, h, openBlock as O, createBlock as _t, unref as A, createElementBlock as $, Fragment as Xe, renderList as Ze, createVNode as B, normalizeClass as mt, createElementVNode as De, toDisplayString as Co, onMounted as bt, onBeforeUnmount as Jt, Transition as qt, withDirectives as vt, vShow as yt, normalizeStyle as nn, TransitionGroup as _o, withCtx as jt, inject as bo } from "vue";
|
|
2
|
+
import { useRoute as Io } from "vue-router";
|
|
3
|
+
import { defineStore as ie, getActivePinia as Po, storeToRefs as S } from "pinia";
|
|
4
|
+
import { useDynamicImages as xo, DEFAULT as Me, SKINS as Gt, DURATION as Yt, NOTHING as wo, EFFECTS as St, CAMERA_ANGLE as Ps, LIGHT_DIRECTION as xs, GENDER as Tt, GRID as ws, POSE_DIRECTION as Ds, ADJUSTMENTS as Ms, slugify as Do, useEventBus as on, useFilterStyle as Mo, FlipAnimation as Ao, useWakeLock as No } from "@figurosity/toolbox";
|
|
5
|
+
import rn from "lodash-es/debounce";
|
|
6
|
+
import { useQuasar as It, QSlider as Oo, QSeparator as J, QCard as ko, QItem as Lo, QItemSection as As, QIcon as Vo, QItemLabel as Ns, QCardSection as Uo, QBtn as Oe, QPageSticky as Ro, QCircularProgress as Bo } from "quasar";
|
|
7
|
+
import { CExpansion as me, CBaseButton as Qe, CBaseButtons as an, CNewGridTool as $o, CBasicTool as es, CAnimatedNumber as zo, CGridOverlay as Ho, CFloatingModal as Fo, CDraggableDrawer as ln, CDraggableDrawers as qo } from "@figurosity/consumer-controls";
|
|
8
|
+
import { historyCircle as cn, contrast as un, brightness as dn, shirt as jo, cameraAngle as Go, bulbLight as Yo, venus as Wo, cameraOrientation as Xo, grid as Zo, refresh as Qo, pause as Ko, play as Jo } from "@figurosity/icons";
|
|
9
|
+
function er(e, t) {
|
|
10
|
+
for (var s = 0; s < t.length; s++) {
|
|
11
|
+
const n = t[s];
|
|
12
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
13
|
+
for (const r in n)
|
|
14
|
+
if (r !== "default" && !(r in e)) {
|
|
15
|
+
const a = Object.getOwnPropertyDescriptor(n, r);
|
|
16
|
+
a && Object.defineProperty(e, r, a.get ? a : {
|
|
17
|
+
enumerable: !0,
|
|
18
|
+
get: () => n[r]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
24
|
+
}
|
|
25
|
+
const tr = {
|
|
26
|
+
models: {},
|
|
27
|
+
collection: [],
|
|
28
|
+
slugs: {},
|
|
29
|
+
selected: [],
|
|
30
|
+
playSelected: 1
|
|
31
|
+
}, hn = {
|
|
32
|
+
random(e) {
|
|
33
|
+
var s;
|
|
34
|
+
if (!e.selected) return 1;
|
|
35
|
+
const t = ((s = e.selected) == null ? void 0 : s.length) || 1;
|
|
36
|
+
return e.selected[Math.floor(Math.random() * t)];
|
|
37
|
+
},
|
|
38
|
+
collectedModels(e) {
|
|
39
|
+
return e.collection.length > 0 ? e.collection.map((t) => e.models[t]) : [];
|
|
40
|
+
},
|
|
41
|
+
propertyById: (e) => (t, s, n = null) => e.models[t] && s in e.models[t] ? e.models[t][s] : n
|
|
42
|
+
}, pn = {
|
|
43
|
+
getRandom(e) {
|
|
44
|
+
if (!this.selected) return;
|
|
45
|
+
const t = new Set(e), s = [...new Set(this.selected.filter((n) => t.has(n)))];
|
|
46
|
+
if (s.length !== 0)
|
|
47
|
+
return s[Math.floor(Math.random() * s.length)];
|
|
48
|
+
},
|
|
49
|
+
setPropertyById(e, t, s) {
|
|
50
|
+
this.models[e] || this.initModel(e), this.$patch({
|
|
51
|
+
models: {
|
|
52
|
+
[e]: {
|
|
53
|
+
...this.models[e],
|
|
54
|
+
// Spread existing properties
|
|
55
|
+
[t]: s
|
|
56
|
+
// Update the specific property
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Set the state models and collection
|
|
63
|
+
* @param {*} entities
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
setState(e) {
|
|
67
|
+
if (!e || !e) return;
|
|
68
|
+
this.collection && (this.collection = Object.keys(e).sort((s, n) => e[s].order - e[n].order).map((s) => parseInt(s, 10)));
|
|
69
|
+
const t = {};
|
|
70
|
+
Object.keys(e).forEach((s) => {
|
|
71
|
+
const n = e[s];
|
|
72
|
+
n.slug && (t[n.slug] = n.id);
|
|
73
|
+
}), this.$patch((s) => {
|
|
74
|
+
s.models = Object.assign({}, s.models, e), s.slugs = Object.assign({}, s.slugs, t);
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
toggleSelected(e) {
|
|
78
|
+
const t = [...this.selected];
|
|
79
|
+
if (t.includes(e)) {
|
|
80
|
+
if (t.length <= 1) return;
|
|
81
|
+
this.$patch({ selected: t.filter((s) => s !== e).sort() });
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
t.push(e), this.$patch({ selected: t.sort() });
|
|
85
|
+
},
|
|
86
|
+
setSelected(e) {
|
|
87
|
+
this.$patch((t) => {
|
|
88
|
+
t.selected = e;
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
customReset() {
|
|
92
|
+
const e = [...Object.keys(this.models).map((t) => this.models[t].id)];
|
|
93
|
+
this.$patch({
|
|
94
|
+
selected: e
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}, ke = ({
|
|
98
|
+
storeId: e,
|
|
99
|
+
state: t = {},
|
|
100
|
+
getters: s = {},
|
|
101
|
+
actions: n = {}
|
|
102
|
+
}) => ie(e, {
|
|
103
|
+
state: () => ({
|
|
104
|
+
...tr,
|
|
105
|
+
...t
|
|
106
|
+
}),
|
|
107
|
+
getters: {
|
|
108
|
+
...hn,
|
|
109
|
+
...s
|
|
110
|
+
},
|
|
111
|
+
actions: {
|
|
112
|
+
...pn,
|
|
113
|
+
...n
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
function Le(e) {
|
|
117
|
+
return e.length ? typeof Intl < "u" && Intl.ListFormat ? new Intl.ListFormat("en-GB", {
|
|
118
|
+
style: "long",
|
|
119
|
+
type: "conjunction"
|
|
120
|
+
}).format(e) : e.length === 1 ? e[0] : e.length === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}` : "";
|
|
121
|
+
}
|
|
122
|
+
const sr = {}, nr = {
|
|
123
|
+
src(e) {
|
|
124
|
+
return (t) => {
|
|
125
|
+
const s = this.propertyById(t, "slug");
|
|
126
|
+
if (s)
|
|
127
|
+
return `undefined/pose-generator/camera-angles/camera-${s}.webp`;
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
caption(e) {
|
|
131
|
+
return Le(e.selected.map((t) => e.models[t].name));
|
|
132
|
+
}
|
|
133
|
+
}, or = {}, pe = ke({
|
|
134
|
+
storeId: "pg-cameras",
|
|
135
|
+
state: sr,
|
|
136
|
+
getters: nr,
|
|
137
|
+
actions: or
|
|
138
|
+
}), je = 100, Ge = 100, Ye = 100, ge = ie("pg-adjustments", {
|
|
139
|
+
state: () => ({
|
|
140
|
+
brightness: je,
|
|
141
|
+
contrast: Ge,
|
|
142
|
+
saturate: Ye
|
|
143
|
+
}),
|
|
144
|
+
getters: {
|
|
145
|
+
brightnessChanged: (e) => e.brightness !== je,
|
|
146
|
+
contrastChanged: (e) => e.contrast !== Ge,
|
|
147
|
+
saturateChanged: (e) => e.saturate !== Ye,
|
|
148
|
+
changed(e) {
|
|
149
|
+
return this.brightnessChanged || this.contrastChanged || this.saturateChanged;
|
|
150
|
+
},
|
|
151
|
+
caption(e) {
|
|
152
|
+
const t = [];
|
|
153
|
+
return e.brightness !== je && t.push("Brightness"), e.contrast !== Ge && t.push("Contrast"), e.saturate !== Ye && t.push("Saturation"), t.length === 0 && t.push("None"), Le(t);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
actions: {
|
|
157
|
+
setValues(e) {
|
|
158
|
+
if (!e)
|
|
159
|
+
throw new Error(this.$id + " result must not be null");
|
|
160
|
+
this.$patch({
|
|
161
|
+
brightness: e.brightness || je,
|
|
162
|
+
contrast: e.contrast || Ge,
|
|
163
|
+
saturate: e.saturate || Ye
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
setBrightness(e) {
|
|
167
|
+
this.$patch({ brightness: e });
|
|
168
|
+
},
|
|
169
|
+
setContrast(e) {
|
|
170
|
+
this.$patch({ contrast: e });
|
|
171
|
+
},
|
|
172
|
+
setSaturate(e) {
|
|
173
|
+
this.$patch({ saturate: e });
|
|
174
|
+
},
|
|
175
|
+
resetBrightness() {
|
|
176
|
+
this.$patch({ brightness: je });
|
|
177
|
+
},
|
|
178
|
+
resetContrast() {
|
|
179
|
+
this.$patch({ contrast: Ge });
|
|
180
|
+
},
|
|
181
|
+
resetSaturate() {
|
|
182
|
+
this.$patch({ saturate: Ye });
|
|
183
|
+
},
|
|
184
|
+
customReset() {
|
|
185
|
+
this.$reset();
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}), { setSelected: rr } = pn;
|
|
189
|
+
function Os(e, t = !0) {
|
|
190
|
+
if (!e) return t ? "0s" : "0 seconds";
|
|
191
|
+
const s = e === 1 ? "second" : "seconds";
|
|
192
|
+
if (e < 60)
|
|
193
|
+
return t ? `${e}s` : `${e} ${s}`;
|
|
194
|
+
const n = e / 60;
|
|
195
|
+
return t ? `${n}m` : `${n} ${n === 1 ? "minute" : "minutes"}`;
|
|
196
|
+
}
|
|
197
|
+
const Z = ie("pg-durations", {
|
|
198
|
+
state: () => ({
|
|
199
|
+
models: {},
|
|
200
|
+
collection: [],
|
|
201
|
+
slugs: {},
|
|
202
|
+
selected: 0
|
|
203
|
+
}),
|
|
204
|
+
getters: {
|
|
205
|
+
changed: (e) => e.selected !== 2,
|
|
206
|
+
seconds: (e) => {
|
|
207
|
+
const t = e.models[e.selected];
|
|
208
|
+
return t ? t.seconds : 0;
|
|
209
|
+
},
|
|
210
|
+
duration: (e) => {
|
|
211
|
+
const t = e.models[e.selected];
|
|
212
|
+
return t ? t.seconds : 0;
|
|
213
|
+
},
|
|
214
|
+
index(e) {
|
|
215
|
+
const t = e.selected;
|
|
216
|
+
return e.collection.findIndex((s) => String(s) === String(t));
|
|
217
|
+
},
|
|
218
|
+
title(e) {
|
|
219
|
+
return Os(e.duration, !1);
|
|
220
|
+
},
|
|
221
|
+
values(e) {
|
|
222
|
+
const t = e.models;
|
|
223
|
+
return e.collection.map((n, r) => ({
|
|
224
|
+
value: r,
|
|
225
|
+
label: Os(t[n].seconds)
|
|
226
|
+
})) || [];
|
|
227
|
+
},
|
|
228
|
+
...hn
|
|
229
|
+
},
|
|
230
|
+
actions: {
|
|
231
|
+
customReset() {
|
|
232
|
+
this.$patch({
|
|
233
|
+
selected: 2
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
setSelectedByIndex(e) {
|
|
237
|
+
const t = this.models[this.collection[e]];
|
|
238
|
+
this.$patch((s) => {
|
|
239
|
+
s.selected = t.id;
|
|
240
|
+
});
|
|
241
|
+
},
|
|
242
|
+
setSelected: rr,
|
|
243
|
+
setState(e) {
|
|
244
|
+
if (!e)
|
|
245
|
+
throw new Error(this.$id + " entities must not be null");
|
|
246
|
+
this.collection && (this.collection = Object.entries(e).sort(([, s], [, n]) => Number(s.seconds) - Number(n.seconds)).map(([s]) => Number(s)));
|
|
247
|
+
const t = {};
|
|
248
|
+
Object.keys(e).forEach((s) => {
|
|
249
|
+
const n = e[s];
|
|
250
|
+
n.slug && (t[n.slug] = n.id);
|
|
251
|
+
}), this.$patch((s) => {
|
|
252
|
+
s.models = Object.assign({}, s.models, e), s.slugs = Object.assign({}, s.slugs, t);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}), ir = void 0, ar = void 0;
|
|
257
|
+
function Ke() {
|
|
258
|
+
return xo({ freeServer: ir, paidServer: ar });
|
|
259
|
+
}
|
|
260
|
+
const lr = {
|
|
261
|
+
uuid: void 0,
|
|
262
|
+
playSelected: 1
|
|
263
|
+
}, cr = {
|
|
264
|
+
src(e) {
|
|
265
|
+
return (t) => {
|
|
266
|
+
const { getThumbnail: s } = Ke();
|
|
267
|
+
return s({ uuid: e.uuid, image: t });
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
caption(e) {
|
|
271
|
+
return Le(e.selected.map((t) => e.models[t].name));
|
|
272
|
+
},
|
|
273
|
+
playCaption(e) {
|
|
274
|
+
var t, s;
|
|
275
|
+
return ((s = (t = e.models) == null ? void 0 : t[e.playSelected]) == null ? void 0 : s.name) || "Normal";
|
|
276
|
+
}
|
|
277
|
+
}, ur = {
|
|
278
|
+
getSrc(e, t) {
|
|
279
|
+
const { getThumbnail: s } = Ke();
|
|
280
|
+
return t = t || this.uuid, s({ uuid: t, image: e });
|
|
281
|
+
},
|
|
282
|
+
getModelsByIds(e = []) {
|
|
283
|
+
return e.map((t) => this.models[t]) || [];
|
|
284
|
+
},
|
|
285
|
+
getAccessKey(e) {
|
|
286
|
+
return this.appSkinsStore.accessKeys[e];
|
|
287
|
+
},
|
|
288
|
+
getSlugById(e) {
|
|
289
|
+
return this.propertyById(e, "slug", "normal");
|
|
290
|
+
},
|
|
291
|
+
customReset() {
|
|
292
|
+
const e = this.appAuthStore, t = k();
|
|
293
|
+
if (e && e.authenticated) {
|
|
294
|
+
const s = this.collection.filter(
|
|
295
|
+
(n) => !t.censored.includes(n)
|
|
296
|
+
);
|
|
297
|
+
this.$patch({
|
|
298
|
+
selected: s
|
|
299
|
+
});
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
this.$patch({
|
|
303
|
+
selected: [1]
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}, V = ke({
|
|
307
|
+
storeId: "pg-skins",
|
|
308
|
+
state: lr,
|
|
309
|
+
getters: cr,
|
|
310
|
+
actions: ur
|
|
311
|
+
}), dr = {
|
|
312
|
+
selected: 1,
|
|
313
|
+
playSelected: 1
|
|
314
|
+
}, hr = {
|
|
315
|
+
src(e) {
|
|
316
|
+
return (t = "none") => {
|
|
317
|
+
const { getThumbnail: s } = Ke(), n = t === "negative" ? "000000" : "ffffff", r = V();
|
|
318
|
+
return s({
|
|
319
|
+
uuid: r.uuid,
|
|
320
|
+
image: "nude",
|
|
321
|
+
effect: t,
|
|
322
|
+
color: n
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
srcById(e) {
|
|
327
|
+
return (t) => {
|
|
328
|
+
const s = e.models[t];
|
|
329
|
+
if (s)
|
|
330
|
+
return this.src(s.slug);
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
slug(e) {
|
|
334
|
+
return (t) => {
|
|
335
|
+
const s = e.models[t];
|
|
336
|
+
if (s)
|
|
337
|
+
return s.slug;
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
caption(e) {
|
|
341
|
+
var t, s;
|
|
342
|
+
return ((s = (t = e.models) == null ? void 0 : t[e.selected]) == null ? void 0 : s.name) || "None";
|
|
343
|
+
},
|
|
344
|
+
playCaption(e) {
|
|
345
|
+
var t, s;
|
|
346
|
+
return ((s = (t = e.models) == null ? void 0 : t[e.playSelected]) == null ? void 0 : s.name) || "None";
|
|
347
|
+
},
|
|
348
|
+
name(e) {
|
|
349
|
+
return (t) => {
|
|
350
|
+
const s = e.models[t];
|
|
351
|
+
if (s)
|
|
352
|
+
return s.name;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}, pr = {
|
|
356
|
+
setSelected(e, t = !1) {
|
|
357
|
+
if (t) {
|
|
358
|
+
this.$patch((s) => {
|
|
359
|
+
s.playSelected = e;
|
|
360
|
+
});
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
this.$patch((s) => {
|
|
364
|
+
s.selected = e, s.playSelected = e;
|
|
365
|
+
});
|
|
366
|
+
},
|
|
367
|
+
getSlugById(e) {
|
|
368
|
+
return this.propertyById(e, "slug", "normal");
|
|
369
|
+
},
|
|
370
|
+
customReset() {
|
|
371
|
+
this.$patch({
|
|
372
|
+
selected: 1
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}, R = ke({
|
|
376
|
+
storeId: "pg-effects",
|
|
377
|
+
state: dr,
|
|
378
|
+
getters: hr,
|
|
379
|
+
actions: pr
|
|
380
|
+
}), fr = {}, gr = {
|
|
381
|
+
caption(e) {
|
|
382
|
+
return Le(e.selected.map((t) => e.models[t].name));
|
|
383
|
+
}
|
|
384
|
+
}, mr = {}, re = ke({
|
|
385
|
+
storeId: "pg-genders",
|
|
386
|
+
state: fr,
|
|
387
|
+
getters: gr,
|
|
388
|
+
actions: mr
|
|
389
|
+
}), ks = 0, Ls = 20, Vs = 0, vr = !1, Ie = ie("pg-grid", {
|
|
390
|
+
state: () => ({
|
|
391
|
+
visible: vr,
|
|
392
|
+
spacing: Ls,
|
|
393
|
+
horizontal: ks,
|
|
394
|
+
vertical: Vs
|
|
395
|
+
}),
|
|
396
|
+
getters: {
|
|
397
|
+
changed: (e) => e.visible === !0,
|
|
398
|
+
caption(e) {
|
|
399
|
+
return e.visible ? "On" : "Off";
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
actions: {
|
|
403
|
+
setValues(e) {
|
|
404
|
+
if (!e)
|
|
405
|
+
throw new Error(this.$id + " result must not be null");
|
|
406
|
+
this.$patch({
|
|
407
|
+
visible: e.visible === 1,
|
|
408
|
+
spacing: e.spacing || Ls,
|
|
409
|
+
horizontal: e.horizontal || ks,
|
|
410
|
+
vertical: e.vertical || Vs
|
|
411
|
+
});
|
|
412
|
+
},
|
|
413
|
+
customReset() {
|
|
414
|
+
this.$reset();
|
|
415
|
+
},
|
|
416
|
+
hide() {
|
|
417
|
+
this.$patch({
|
|
418
|
+
visible: !1
|
|
419
|
+
});
|
|
420
|
+
},
|
|
421
|
+
show() {
|
|
422
|
+
this.$patch({
|
|
423
|
+
visible: !0
|
|
424
|
+
});
|
|
425
|
+
},
|
|
426
|
+
setSpacing(e) {
|
|
427
|
+
this.$patch({
|
|
428
|
+
spacing: e
|
|
429
|
+
});
|
|
430
|
+
},
|
|
431
|
+
setHorizontal(e) {
|
|
432
|
+
this.$patch({
|
|
433
|
+
horizontal: e
|
|
434
|
+
});
|
|
435
|
+
},
|
|
436
|
+
setVertical(e) {
|
|
437
|
+
this.$patch({
|
|
438
|
+
vertical: e
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}), yr = {}, Er = {
|
|
443
|
+
src(e) {
|
|
444
|
+
return (t) => {
|
|
445
|
+
const s = this.propertyById(t, "slug");
|
|
446
|
+
return s ? `undefined/pose-generator/light-direction/from-${s}.webp` : void 0;
|
|
447
|
+
};
|
|
448
|
+
},
|
|
449
|
+
caption(e) {
|
|
450
|
+
return Le(e.selected.map((t) => e.models[t].name));
|
|
451
|
+
}
|
|
452
|
+
}, Sr = {}, ee = ke({
|
|
453
|
+
storeId: "pg-lights",
|
|
454
|
+
state: yr,
|
|
455
|
+
getters: Er,
|
|
456
|
+
actions: Sr
|
|
457
|
+
});
|
|
458
|
+
function Tr(e) {
|
|
459
|
+
return function() {
|
|
460
|
+
e = e + 1831565813 >>> 0;
|
|
461
|
+
let t = Math.imul(e ^ e >>> 15, e | 1);
|
|
462
|
+
return t ^= t + Math.imul(t ^ t >>> 7, t | 61), ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
function Cr(e, t) {
|
|
466
|
+
const s = e.slice(), n = Tr(t ?? Date.now() & 4294967295);
|
|
467
|
+
for (let r = s.length - 1; r > 0; r--) {
|
|
468
|
+
const a = Math.floor(n() * (r + 1));
|
|
469
|
+
[s[r], s[a]] = [s[a], s[r]];
|
|
470
|
+
}
|
|
471
|
+
return s;
|
|
472
|
+
}
|
|
473
|
+
const Pe = ie("pg-poses", {
|
|
474
|
+
state: () => ({
|
|
475
|
+
models: /* @__PURE__ */ Object.create(null),
|
|
476
|
+
// { [id]: poseRow }
|
|
477
|
+
collection: [],
|
|
478
|
+
// sorted list of collection in the pool
|
|
479
|
+
seen: /* @__PURE__ */ new Set(),
|
|
480
|
+
// collection already shown
|
|
481
|
+
seed: Date.now() & 4294967295,
|
|
482
|
+
count: 0,
|
|
483
|
+
loading: !1
|
|
484
|
+
// guard concurrent fetches
|
|
485
|
+
}),
|
|
486
|
+
getters: {
|
|
487
|
+
// convenience getter
|
|
488
|
+
unseenIds(e) {
|
|
489
|
+
const s = k().filterData;
|
|
490
|
+
return e.collection.filter((n) => !e.seen.has(n)).filter((n) => this.candidates(s).includes(n));
|
|
491
|
+
},
|
|
492
|
+
unseenCount() {
|
|
493
|
+
return this.unseenIds.length;
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
actions: {
|
|
497
|
+
getModelById(e) {
|
|
498
|
+
return this.models[e] || null;
|
|
499
|
+
},
|
|
500
|
+
setCount(e) {
|
|
501
|
+
this.$patch({ count: e });
|
|
502
|
+
},
|
|
503
|
+
// payload shape: { entities: { poses: { [id]: {...} } } }
|
|
504
|
+
ingestNormalized(e) {
|
|
505
|
+
e = e || {}, this.models = { ...e, ...this.models };
|
|
506
|
+
for (const s of Object.keys(e)) {
|
|
507
|
+
const n = this.models[s];
|
|
508
|
+
n.skin_ids = Array.isArray(n.skin_ids) ? n.skin_ids : [], n.camera_id = n.camera_id || Number(n.camera_id), n.gender_ids = Array.isArray(n.gender_ids) ? n.gender_ids : [], n._skinSet = new Set(n.skin_ids), n._gendSet = new Set(n.gender_ids);
|
|
509
|
+
}
|
|
510
|
+
const t = new Set(this.collection);
|
|
511
|
+
for (const s of Object.keys(e)) t.add(+s);
|
|
512
|
+
this.collection = Array.from(t).sort((s, n) => s - n);
|
|
513
|
+
},
|
|
514
|
+
// build candidate collection: OR within a facet, AND across facets
|
|
515
|
+
candidates(e = {}) {
|
|
516
|
+
const t = new Set(e.skins || []), s = new Set(e.cameras || []), n = new Set(e.genders || []), r = [];
|
|
517
|
+
for (let a = 0; a < this.collection.length; a++) {
|
|
518
|
+
const c = this.collection[a], d = this.models[c];
|
|
519
|
+
if (!d) continue;
|
|
520
|
+
const u = !t.size || [...t].some((v) => d._skinSet.has(v)), f = !s.size || d.camera_id != null && s.has(d.camera_id), g = !n.size || [...n].some((v) => d._gendSet.has(v));
|
|
521
|
+
u && f && g && r.push(c);
|
|
522
|
+
}
|
|
523
|
+
return r;
|
|
524
|
+
},
|
|
525
|
+
// get n random collection that haven’t been shown yet
|
|
526
|
+
randomTake(e, t = {}) {
|
|
527
|
+
var a;
|
|
528
|
+
const n = ((a = this.candidates) == null ? void 0 : a.call(this, t)).filter((c) => !this.seen.has(c));
|
|
529
|
+
return n.length ? Cr(n, this.seed).slice(0, e) : [];
|
|
530
|
+
},
|
|
531
|
+
async addToSeen(e) {
|
|
532
|
+
this.seen.add(parseInt(e)), await this.ensureUnseen({ minUnseen: 25 });
|
|
533
|
+
},
|
|
534
|
+
rowsFromIds(e) {
|
|
535
|
+
return e.map((t) => this.models[t]).filter(Boolean);
|
|
536
|
+
},
|
|
537
|
+
resetSeen() {
|
|
538
|
+
this.seen.clear();
|
|
539
|
+
},
|
|
540
|
+
reseed(e) {
|
|
541
|
+
this.seed = e ?? Date.now() & 4294967295;
|
|
542
|
+
},
|
|
543
|
+
async ensureUnseen({ minUnseen: e = 50, batch: t = 200 } = {}) {
|
|
544
|
+
const s = k();
|
|
545
|
+
if (s.filterData, this.unseenCount >= e || this.loading) return;
|
|
546
|
+
await (async () => {
|
|
547
|
+
try {
|
|
548
|
+
this.loading = !0, this.seen.size >= Math.floor(s.totalCount / 100) * 100 && (console.log("resetting seed"), this.reseed(), this.resetSeen()), this.appPoseGeneratorStore.fetch({}).then((r) => {
|
|
549
|
+
var a;
|
|
550
|
+
this.ingestNormalized((a = r == null ? void 0 : r.entities) == null ? void 0 : a.poses);
|
|
551
|
+
}).catch((r) => {
|
|
552
|
+
console.log(r);
|
|
553
|
+
});
|
|
554
|
+
} catch (r) {
|
|
555
|
+
console.error("ensureUnseen fetch failed", r);
|
|
556
|
+
} finally {
|
|
557
|
+
this.loading = !1;
|
|
558
|
+
}
|
|
559
|
+
})();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}), _r = {}, br = {
|
|
563
|
+
caption(e) {
|
|
564
|
+
return Le(e.selected.map((t) => e.models[t].name));
|
|
565
|
+
}
|
|
566
|
+
}, Ir = {
|
|
567
|
+
getRandom(e) {
|
|
568
|
+
const s = (c) => (c % 36 + 36) % 36, n = {
|
|
569
|
+
1: [[-4, 4]],
|
|
570
|
+
// front
|
|
571
|
+
2: [[5, 13]],
|
|
572
|
+
// right
|
|
573
|
+
3: [[14, 22]],
|
|
574
|
+
// back
|
|
575
|
+
4: [[23, 31]]
|
|
576
|
+
// left
|
|
577
|
+
}, r = [];
|
|
578
|
+
for (const c of this.selected) {
|
|
579
|
+
const d = n[c];
|
|
580
|
+
if (d)
|
|
581
|
+
for (const [u, f] of d)
|
|
582
|
+
for (let g = u; g <= f; g++)
|
|
583
|
+
r.push(s(e + g));
|
|
584
|
+
}
|
|
585
|
+
if (r.length === 0)
|
|
586
|
+
throw new Error("No valid frames for given positions.");
|
|
587
|
+
const a = Math.floor(Math.random() * r.length);
|
|
588
|
+
return r[a];
|
|
589
|
+
}
|
|
590
|
+
}, fe = ke({
|
|
591
|
+
storeId: "pg-positions",
|
|
592
|
+
state: _r,
|
|
593
|
+
getters: br,
|
|
594
|
+
actions: Ir
|
|
595
|
+
}), Us = {
|
|
596
|
+
entities: {
|
|
597
|
+
cameras: {
|
|
598
|
+
1: {
|
|
599
|
+
id: 1,
|
|
600
|
+
name: "Street Level",
|
|
601
|
+
slug: "default",
|
|
602
|
+
order: 1
|
|
603
|
+
},
|
|
604
|
+
2: {
|
|
605
|
+
id: 2,
|
|
606
|
+
name: "Bird's Eye",
|
|
607
|
+
slug: "down",
|
|
608
|
+
order: 2
|
|
609
|
+
},
|
|
610
|
+
3: {
|
|
611
|
+
id: 3,
|
|
612
|
+
name: "Worm's Eye",
|
|
613
|
+
slug: "up",
|
|
614
|
+
order: 3
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
durations: {
|
|
618
|
+
2: {
|
|
619
|
+
id: 2,
|
|
620
|
+
slug: "15-sec",
|
|
621
|
+
number: 15,
|
|
622
|
+
name: "sec",
|
|
623
|
+
seconds: 15,
|
|
624
|
+
title: "15 second poses"
|
|
625
|
+
},
|
|
626
|
+
3: {
|
|
627
|
+
id: 3,
|
|
628
|
+
slug: "30-sec",
|
|
629
|
+
number: 30,
|
|
630
|
+
name: "sec",
|
|
631
|
+
seconds: 30,
|
|
632
|
+
title: "30 second poses"
|
|
633
|
+
},
|
|
634
|
+
4: {
|
|
635
|
+
id: 4,
|
|
636
|
+
slug: "1-min",
|
|
637
|
+
number: 1,
|
|
638
|
+
name: "min",
|
|
639
|
+
seconds: 60,
|
|
640
|
+
title: "1 minute poses"
|
|
641
|
+
},
|
|
642
|
+
5: {
|
|
643
|
+
id: 5,
|
|
644
|
+
slug: "2-min",
|
|
645
|
+
number: 2,
|
|
646
|
+
name: "min",
|
|
647
|
+
seconds: 120,
|
|
648
|
+
title: "2 minute poses"
|
|
649
|
+
},
|
|
650
|
+
6: {
|
|
651
|
+
id: 6,
|
|
652
|
+
slug: "5-min",
|
|
653
|
+
number: 5,
|
|
654
|
+
name: "min",
|
|
655
|
+
seconds: 300,
|
|
656
|
+
title: "5 minute poses"
|
|
657
|
+
},
|
|
658
|
+
7: {
|
|
659
|
+
id: 7,
|
|
660
|
+
slug: "45-sec",
|
|
661
|
+
number: 45,
|
|
662
|
+
name: "sec",
|
|
663
|
+
seconds: 45,
|
|
664
|
+
title: "45 second poses"
|
|
665
|
+
}
|
|
666
|
+
},
|
|
667
|
+
effects: {
|
|
668
|
+
1: {
|
|
669
|
+
id: 1,
|
|
670
|
+
name: "None",
|
|
671
|
+
slug: "none"
|
|
672
|
+
},
|
|
673
|
+
2: {
|
|
674
|
+
id: 2,
|
|
675
|
+
name: "Silhouette",
|
|
676
|
+
slug: "silhouette"
|
|
677
|
+
},
|
|
678
|
+
3: {
|
|
679
|
+
id: 3,
|
|
680
|
+
name: "Negative",
|
|
681
|
+
slug: "negative"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
lights: {
|
|
685
|
+
1: {
|
|
686
|
+
id: 1,
|
|
687
|
+
name: "Left",
|
|
688
|
+
slug: "left",
|
|
689
|
+
order: 1,
|
|
690
|
+
src: null
|
|
691
|
+
},
|
|
692
|
+
2: {
|
|
693
|
+
id: 2,
|
|
694
|
+
name: "Right",
|
|
695
|
+
slug: "right",
|
|
696
|
+
order: 2,
|
|
697
|
+
src: null
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
positions: {
|
|
701
|
+
1: {
|
|
702
|
+
id: 1,
|
|
703
|
+
name: "Front",
|
|
704
|
+
slug: "front",
|
|
705
|
+
order: 1,
|
|
706
|
+
src: null
|
|
707
|
+
},
|
|
708
|
+
2: {
|
|
709
|
+
id: 2,
|
|
710
|
+
name: "Right",
|
|
711
|
+
slug: "right",
|
|
712
|
+
order: 2,
|
|
713
|
+
src: null
|
|
714
|
+
},
|
|
715
|
+
3: {
|
|
716
|
+
id: 3,
|
|
717
|
+
name: "Back",
|
|
718
|
+
slug: "back",
|
|
719
|
+
order: 3,
|
|
720
|
+
src: null
|
|
721
|
+
},
|
|
722
|
+
4: {
|
|
723
|
+
id: 4,
|
|
724
|
+
name: "Left",
|
|
725
|
+
slug: "left",
|
|
726
|
+
order: 4,
|
|
727
|
+
src: null
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
sets: {
|
|
731
|
+
125: {
|
|
732
|
+
id: 125,
|
|
733
|
+
uuid: "adf56880-0380-497c-9966-c64e951af4ef",
|
|
734
|
+
name: "Why aren't there more Indian Superheros?",
|
|
735
|
+
slug: "why-arent-there-more-indian-superheros",
|
|
736
|
+
description: "There just aren't enough Indian super heros these days. ",
|
|
737
|
+
favoriteCount: 50,
|
|
738
|
+
genderIds: [110],
|
|
739
|
+
speciesIds: [1],
|
|
740
|
+
subjectIds: [50]
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
genders: {
|
|
744
|
+
110: {
|
|
745
|
+
id: 110,
|
|
746
|
+
name: "Male",
|
|
747
|
+
slug: "male",
|
|
748
|
+
parentId: 101
|
|
749
|
+
},
|
|
750
|
+
111: {
|
|
751
|
+
id: 111,
|
|
752
|
+
name: "Female",
|
|
753
|
+
slug: "female",
|
|
754
|
+
parentId: 101
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
skins: {
|
|
758
|
+
1: {
|
|
759
|
+
id: 1,
|
|
760
|
+
name: "Dressed",
|
|
761
|
+
slug: "normal",
|
|
762
|
+
order: 1
|
|
763
|
+
},
|
|
764
|
+
2: {
|
|
765
|
+
id: 2,
|
|
766
|
+
name: "Nude",
|
|
767
|
+
slug: "nude",
|
|
768
|
+
order: 2
|
|
769
|
+
},
|
|
770
|
+
3: {
|
|
771
|
+
id: 3,
|
|
772
|
+
name: "Muscle",
|
|
773
|
+
slug: "muscle",
|
|
774
|
+
order: 3
|
|
775
|
+
},
|
|
776
|
+
4: {
|
|
777
|
+
id: 4,
|
|
778
|
+
name: "Smooth",
|
|
779
|
+
slug: "smooth",
|
|
780
|
+
order: 4
|
|
781
|
+
},
|
|
782
|
+
5: {
|
|
783
|
+
id: 5,
|
|
784
|
+
name: "Loomis",
|
|
785
|
+
slug: "loomis",
|
|
786
|
+
order: 5
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
result: {
|
|
791
|
+
setUuid: "b22658f7-e757-4a7f-9071-89ccb7df966e"
|
|
792
|
+
}
|
|
793
|
+
}, k = ie("pg", {
|
|
794
|
+
/**
|
|
795
|
+
*
|
|
796
|
+
* @property {number} active The filter or drawer that is currently active.
|
|
797
|
+
* @property {boolean} animate This property is a number.
|
|
798
|
+
* @property {Array} censored An array of censored state ids
|
|
799
|
+
* @property {boolean} loading
|
|
800
|
+
* @property {number} possibilities The number of possible poses with current filters.
|
|
801
|
+
* @property {boolean} show Is the tool being shown.
|
|
802
|
+
* @property {number} status The const values for OFF = 0, PLAYING = 1 and CLOSED = 2.
|
|
803
|
+
*/
|
|
804
|
+
state: () => ({
|
|
805
|
+
animate: !1,
|
|
806
|
+
active: Yt,
|
|
807
|
+
playActive: Gt,
|
|
808
|
+
mobileActive: Me,
|
|
809
|
+
censored: [],
|
|
810
|
+
disable: !0,
|
|
811
|
+
filtering: !1,
|
|
812
|
+
loading: !1,
|
|
813
|
+
possibilities: 0,
|
|
814
|
+
totalCount: 0,
|
|
815
|
+
loadingSettings: !1,
|
|
816
|
+
firstLoad: !1
|
|
817
|
+
}),
|
|
818
|
+
getters: {
|
|
819
|
+
filterData(e) {
|
|
820
|
+
const t = ge(), s = pe(), n = Z(), r = R(), a = re(), c = Ie(), d = ee(), u = fe(), f = V(), g = c.visible === !0 ? 1 : 0;
|
|
821
|
+
return {
|
|
822
|
+
cameras: s.selected,
|
|
823
|
+
durations: n.selected,
|
|
824
|
+
genders: a.selected,
|
|
825
|
+
lights: d.selected,
|
|
826
|
+
effects: r.selected,
|
|
827
|
+
positions: u.selected,
|
|
828
|
+
skins: f.selected,
|
|
829
|
+
grid: [
|
|
830
|
+
g,
|
|
831
|
+
c.spacing,
|
|
832
|
+
c.horizontal,
|
|
833
|
+
c.vertical
|
|
834
|
+
],
|
|
835
|
+
adjustments: [
|
|
836
|
+
t.brightness,
|
|
837
|
+
t.contrast,
|
|
838
|
+
t.saturate
|
|
839
|
+
]
|
|
840
|
+
};
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
actions: {
|
|
844
|
+
init() {
|
|
845
|
+
const e = Us.entities, t = Us.result;
|
|
846
|
+
this.updateStatesFromEntities(e);
|
|
847
|
+
const s = V();
|
|
848
|
+
s.uuid = t.setUuid;
|
|
849
|
+
},
|
|
850
|
+
updateStatesFromEntities(e) {
|
|
851
|
+
const t = e, s = pe(), n = Z(), r = R(), a = re(), c = ee(), d = fe(), u = V();
|
|
852
|
+
s.setState(t.cameras), n.setState(t.durations), r.setState(t.effects), a.setState(t.genders), c.setState(t.lights), d.setState(t.positions), u.setState(t.skins);
|
|
853
|
+
},
|
|
854
|
+
updateSelectedFromResult(e) {
|
|
855
|
+
const t = e, s = ge(), n = pe(), r = Z(), a = R(), c = re(), d = Ie(), u = ee(), f = fe(), g = V();
|
|
856
|
+
s.setValues(t.adjustments), d.setValues(t.grid), r.setSelected(t.durations), a.setSelected(t.effects), n.setSelected(t.cameras), c.setSelected(t.genders), u.setSelected(t.lights), f.setSelected(t.positions), g.setSelected(t.skins), g.uuid = t.setUuid;
|
|
857
|
+
},
|
|
858
|
+
hasAccess(e) {
|
|
859
|
+
return this.appAccessStore.hasAccess(e);
|
|
860
|
+
},
|
|
861
|
+
block(e) {
|
|
862
|
+
return this.appPaywallStore.block(e);
|
|
863
|
+
},
|
|
864
|
+
fetch(e = {}) {
|
|
865
|
+
return this.disable = !0, this.loading = !0, new Promise((t, s) => {
|
|
866
|
+
this.appPoseGeneratorStore.fetch(e).then((n) => {
|
|
867
|
+
var a;
|
|
868
|
+
this.updateStatesFromEntities(n.entities), this.updateSelectedFromResult(n.result), this.totalCount = n.result.total_count, Pe().ingestNormalized((a = n == null ? void 0 : n.entities) == null ? void 0 : a.poses), this.firstLoad = !0, t(n);
|
|
869
|
+
}).catch((n) => {
|
|
870
|
+
s(n), console.log(n);
|
|
871
|
+
}).finally(() => {
|
|
872
|
+
this.disable = !1, this.loading = !1;
|
|
873
|
+
});
|
|
874
|
+
});
|
|
875
|
+
},
|
|
876
|
+
getMorePoses(e) {
|
|
877
|
+
this.loading = !0, this.appPoseGeneratorStore.getMorePoses(e).then((t) => {
|
|
878
|
+
this.loading = !1;
|
|
879
|
+
}).catch((t) => {
|
|
880
|
+
});
|
|
881
|
+
},
|
|
882
|
+
setSettings: rn(
|
|
883
|
+
function() {
|
|
884
|
+
console.log("setSettings"), this.internalSettings();
|
|
885
|
+
},
|
|
886
|
+
1500,
|
|
887
|
+
{ trailing: !0, leading: !1 }
|
|
888
|
+
),
|
|
889
|
+
internalSettings() {
|
|
890
|
+
this.loadingSettings || (console.log("internalSettings"), this.appPoseGeneratorStore.setSettings(this.filterData));
|
|
891
|
+
},
|
|
892
|
+
getSettings() {
|
|
893
|
+
this.loadingSettings = !0, this.appPoseGeneratorStore.getSettings().then((e) => {
|
|
894
|
+
this.loadingSettings = !1, this.updateSelectedFromResult(e.result);
|
|
895
|
+
}).catch((e) => {
|
|
896
|
+
this.loadingSettings = !1, console.error(e);
|
|
897
|
+
});
|
|
898
|
+
},
|
|
899
|
+
store(e) {
|
|
900
|
+
this.appPoseGeneratorStore.store(e);
|
|
901
|
+
},
|
|
902
|
+
isExpanded(e = [], t = !1) {
|
|
903
|
+
const s = t ? this.playActive : this.active;
|
|
904
|
+
return e = Array.isArray(e) ? e : [e], e.includes(s);
|
|
905
|
+
},
|
|
906
|
+
setActive(e, t = !1) {
|
|
907
|
+
if (t) {
|
|
908
|
+
if (this.playActive === e) return;
|
|
909
|
+
this.playActive = e;
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
this.active !== e && (this.active = e);
|
|
913
|
+
},
|
|
914
|
+
customReset() {
|
|
915
|
+
const e = ge(), t = pe(), s = Z(), n = R(), r = re(), a = Ie(), c = ee(), d = fe(), u = V();
|
|
916
|
+
e.customReset(), t.customReset(), s.customReset(), n.customReset(), r.customReset(), a.customReset(), c.customReset(), d.customReset(), u.customReset();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
});
|
|
920
|
+
function ht(e) {
|
|
921
|
+
if (!Array.isArray(e)) return [];
|
|
922
|
+
const t = /* @__PURE__ */ new Set();
|
|
923
|
+
for (let s = 0; s < e.length; s++) {
|
|
924
|
+
const n = Number(e[s]);
|
|
925
|
+
Number.isFinite(n) && t.add(n);
|
|
926
|
+
}
|
|
927
|
+
return Array.from(t).sort((s, n) => s - n);
|
|
928
|
+
}
|
|
929
|
+
function pt(e = {}) {
|
|
930
|
+
return {
|
|
931
|
+
cameras: ht(e.cameras),
|
|
932
|
+
genders: ht(e.genders),
|
|
933
|
+
skins: ht(e.skins),
|
|
934
|
+
species: ht(e.species),
|
|
935
|
+
// subjects intentionally NOT part of cache key; pass-through if you need to display it
|
|
936
|
+
subjects: e.subjects == null ? null : Number(e.subjects)
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
function ft(e) {
|
|
940
|
+
return JSON.stringify([e.cameras, e.genders, e.skins, e.species]);
|
|
941
|
+
}
|
|
942
|
+
const Pt = ie("pg-count", {
|
|
943
|
+
state: () => ({
|
|
944
|
+
// --- CACHE ---
|
|
945
|
+
// entries[key] = { count:number, ts:number }
|
|
946
|
+
entries: /* @__PURE__ */ Object.create(null),
|
|
947
|
+
order: [],
|
|
948
|
+
// insertion order for simple LRU eviction
|
|
949
|
+
ttlMs: 3600 * 1e3,
|
|
950
|
+
// 1 hour (set 0/false to disable)
|
|
951
|
+
maxEntries: 2e3,
|
|
952
|
+
// optional cap
|
|
953
|
+
// in-flight de-dup per key: key -> Promise<{count, key}>
|
|
954
|
+
inFlight: /* @__PURE__ */ Object.create(null),
|
|
955
|
+
// --- UI FACING / LAST REQUEST ---
|
|
956
|
+
count: null,
|
|
957
|
+
// latest displayed count (reactive)
|
|
958
|
+
loading: !1,
|
|
959
|
+
error: null,
|
|
960
|
+
// used to gate UI updates so stale responses don't overwrite newer ones
|
|
961
|
+
_lastKey: null,
|
|
962
|
+
_reqId: 0
|
|
963
|
+
}),
|
|
964
|
+
getters: {
|
|
965
|
+
// Fresh cached count for given filters (or null)
|
|
966
|
+
cachedCount: (e) => (t) => {
|
|
967
|
+
const s = ft(pt(t)), n = e.entries[s];
|
|
968
|
+
return !n || e.ttlMs && Date.now() - n.ts > e.ttlMs ? null : n.count;
|
|
969
|
+
},
|
|
970
|
+
filters() {
|
|
971
|
+
return this.getFilters();
|
|
972
|
+
},
|
|
973
|
+
adjustedCount(e) {
|
|
974
|
+
const t = ee(), s = fe(), n = t.selected.length, a = s.selected.length / 4;
|
|
975
|
+
return this.count * n * 36 * a;
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
actions: {
|
|
979
|
+
/* ----------------------- internal helpers ----------------------- */
|
|
980
|
+
_touchKey(e) {
|
|
981
|
+
const t = this.order.indexOf(e);
|
|
982
|
+
for (t !== -1 && this.order.splice(t, 1), this.order.push(e); this.order.length > this.maxEntries; ) {
|
|
983
|
+
const s = this.order.shift();
|
|
984
|
+
s && delete this.entries[s];
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
_upsert(e, t) {
|
|
988
|
+
this.entries[e] = { count: t, ts: Date.now() }, this._touchKey(e);
|
|
989
|
+
},
|
|
990
|
+
getFilters() {
|
|
991
|
+
const e = pe(), t = re(), s = V(), n = R(), r = ee();
|
|
992
|
+
return {
|
|
993
|
+
cameras: e.selected,
|
|
994
|
+
genders: t.selected,
|
|
995
|
+
skins: s.selected,
|
|
996
|
+
effects: n.selected,
|
|
997
|
+
lights: r.selected,
|
|
998
|
+
species: [1],
|
|
999
|
+
subjects: 1
|
|
1000
|
+
};
|
|
1001
|
+
},
|
|
1002
|
+
/* ------------------- public cache-only API ---------------------- */
|
|
1003
|
+
// Prime the cache for these filters (no UI updates). Returns the count.
|
|
1004
|
+
async prefetch() {
|
|
1005
|
+
const e = this.getFilters(), t = pt(e), s = ft(t), n = this.cachedCount(e);
|
|
1006
|
+
return n ?? (this.inFlight[s] || (this.inFlight[s] = this.appPoseGeneratorStore.count(t).then((a) => {
|
|
1007
|
+
const c = (a == null ? void 0 : a.result) ?? a;
|
|
1008
|
+
if (typeof (c == null ? void 0 : c.count) != "number")
|
|
1009
|
+
throw new Error("Server response missing numeric count");
|
|
1010
|
+
return this._upsert(s, c.count), { key: s, count: c.count };
|
|
1011
|
+
}).finally(() => {
|
|
1012
|
+
delete this.inFlight[s];
|
|
1013
|
+
})), (await this.inFlight[s]).count);
|
|
1014
|
+
},
|
|
1015
|
+
// Fetch for display: updates reactive `count/loading/error`,
|
|
1016
|
+
// but uses a version gate so stale responses don't overwrite newer ones.
|
|
1017
|
+
// Also caches every response.
|
|
1018
|
+
async fetchForDisplay() {
|
|
1019
|
+
const e = this.getFilters(), t = pt(e), s = ft(t);
|
|
1020
|
+
this._lastKey = s;
|
|
1021
|
+
const n = ++this._reqId;
|
|
1022
|
+
this.loading = !0, this.error = null;
|
|
1023
|
+
const r = this.entries[s] && (!this.ttlMs || Date.now() - this.entries[s].ts <= this.ttlMs) ? this.entries[s].count : null;
|
|
1024
|
+
r !== null && (this.count = r);
|
|
1025
|
+
try {
|
|
1026
|
+
const a = await this.prefetch(e);
|
|
1027
|
+
n === this._reqId && s === this._lastKey && (this.count = a);
|
|
1028
|
+
} catch (a) {
|
|
1029
|
+
n === this._reqId && s === this._lastKey && (this.error = (a == null ? void 0 : a.message) || String(a));
|
|
1030
|
+
} finally {
|
|
1031
|
+
n === this._reqId && s === this._lastKey && (this.loading = !1);
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
// Convenience: get a number right away. Returns cache if fresh, else hits server and returns fresh.
|
|
1035
|
+
// Does NOT touch display state (no loading/error/count changes).
|
|
1036
|
+
async get() {
|
|
1037
|
+
const e = this.getFilters(), t = this.cachedCount(e);
|
|
1038
|
+
return t ?? this.prefetch(e);
|
|
1039
|
+
},
|
|
1040
|
+
// cache maintenance
|
|
1041
|
+
invalidate(e) {
|
|
1042
|
+
const t = ft(pt(e));
|
|
1043
|
+
if (this.entries[t]) {
|
|
1044
|
+
delete this.entries[t];
|
|
1045
|
+
const s = this.order.indexOf(t);
|
|
1046
|
+
s !== -1 && this.order.splice(s, 1);
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
clearAll() {
|
|
1050
|
+
this.entries = /* @__PURE__ */ Object.create(null), this.order = [], this.inFlight = /* @__PURE__ */ Object.create(null), this.count = null, this.error = null, this.loading = !1, this._lastKey = null, this._reqId = 0;
|
|
1051
|
+
},
|
|
1052
|
+
configure({ ttlMs: e, maxEntries: t } = {}) {
|
|
1053
|
+
typeof e == "number" && (this.ttlMs = e), typeof t == "number" && (this.maxEntries = t);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
}), Et = 0, Wt = 1, Pr = 2, fn = 3, Xt = 4, gn = 5, xr = {
|
|
1057
|
+
/**
|
|
1058
|
+
* Load the image and update the status of the
|
|
1059
|
+
* @param context
|
|
1060
|
+
* @param { String } url The url of the image
|
|
1061
|
+
* @param { Function } success On load callback
|
|
1062
|
+
* @param { Function } fail On fail callback
|
|
1063
|
+
*/
|
|
1064
|
+
loadImage({ url: e, callback: t = null }) {
|
|
1065
|
+
if (typeof Image > "u")
|
|
1066
|
+
throw t && typeof t == "function" && t(e, Wt), new Error("Image() constructor does not exist.");
|
|
1067
|
+
t && typeof t == "function" && t(e, Pr);
|
|
1068
|
+
let s = new Image();
|
|
1069
|
+
s.onabort = function(n) {
|
|
1070
|
+
t && typeof t == "function" && t(e, fn), this.onerror = this.onabort = this.onload = null;
|
|
1071
|
+
}, s.onerror = function(n) {
|
|
1072
|
+
t && typeof t == "function" && t(e, Wt), this.onerror = this.onabort = this.onload = null;
|
|
1073
|
+
}, s.onload = function(n) {
|
|
1074
|
+
t && typeof t == "function" && t(e, gn), this.onerror = this.onabort = this.onload = null;
|
|
1075
|
+
}, s.src = e, t && typeof t == "function" && t(e, Xt);
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
function wr(e, t) {
|
|
1079
|
+
return Object.values(e).find((s) => s.src === t);
|
|
1080
|
+
}
|
|
1081
|
+
function Dr({
|
|
1082
|
+
poseId: e,
|
|
1083
|
+
index: t,
|
|
1084
|
+
skinId: s,
|
|
1085
|
+
effectId: n,
|
|
1086
|
+
lightDirection: r
|
|
1087
|
+
}) {
|
|
1088
|
+
const a = R(), d = V().getSlugById(s), u = a.getSlugById(n);
|
|
1089
|
+
return `/figure-drawing-poses/${e}/${d}/${u}/${t}/${r === 1 ? 1 : 0}`;
|
|
1090
|
+
}
|
|
1091
|
+
function mn(e, t = "lg") {
|
|
1092
|
+
if (!e) return;
|
|
1093
|
+
const { getPoseSmall: s, getPoseLarge: n } = Ke(), r = We(e);
|
|
1094
|
+
return r.size = t, vn(r);
|
|
1095
|
+
}
|
|
1096
|
+
function vn({
|
|
1097
|
+
poseId: e,
|
|
1098
|
+
index: t,
|
|
1099
|
+
skinId: s,
|
|
1100
|
+
effectId: n,
|
|
1101
|
+
size: r = "lg"
|
|
1102
|
+
}) {
|
|
1103
|
+
const { getPoseSmall: a, getPoseLarge: c } = Ke(), d = Pe(), u = R(), f = V(), g = d.getModelById(e), v = f.getSlugById(s), C = u.getSlugById(n), _ = n === 3 ? "000000" : "ffffff";
|
|
1104
|
+
return r === "lg" ? c({
|
|
1105
|
+
uuid: g.uuid,
|
|
1106
|
+
skin: v,
|
|
1107
|
+
effect: C,
|
|
1108
|
+
color: _,
|
|
1109
|
+
index: t
|
|
1110
|
+
}) : a({
|
|
1111
|
+
uuid: g.uuid,
|
|
1112
|
+
skin: v,
|
|
1113
|
+
effect: C,
|
|
1114
|
+
color: _,
|
|
1115
|
+
index: t
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
function $t(e) {
|
|
1119
|
+
const t = e.split(".");
|
|
1120
|
+
return {
|
|
1121
|
+
id: e,
|
|
1122
|
+
src: mn(e),
|
|
1123
|
+
status: Et,
|
|
1124
|
+
flipped: t[2] === 1
|
|
1125
|
+
};
|
|
1126
|
+
}
|
|
1127
|
+
function Mr(e) {
|
|
1128
|
+
const t = Pe(), s = ee(), n = R(), r = V(), a = fe(), c = t.models[e];
|
|
1129
|
+
return [
|
|
1130
|
+
e,
|
|
1131
|
+
a.getRandom(c.index),
|
|
1132
|
+
s.random,
|
|
1133
|
+
r.getRandom(c.skin_ids),
|
|
1134
|
+
n.selected
|
|
1135
|
+
].join(".");
|
|
1136
|
+
}
|
|
1137
|
+
function We(e) {
|
|
1138
|
+
if (!e) return;
|
|
1139
|
+
const t = e.split(".").map((s) => parseInt(s));
|
|
1140
|
+
return {
|
|
1141
|
+
poseId: t[0],
|
|
1142
|
+
index: t[1],
|
|
1143
|
+
lightDirection: t[2],
|
|
1144
|
+
skinId: t[3],
|
|
1145
|
+
effectId: t[4]
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
const X = ie("pg-history", {
|
|
1149
|
+
state: () => ({
|
|
1150
|
+
failed: 0,
|
|
1151
|
+
history: [],
|
|
1152
|
+
index: 0,
|
|
1153
|
+
models: {},
|
|
1154
|
+
queue: [],
|
|
1155
|
+
successful: 0,
|
|
1156
|
+
urls: {}
|
|
1157
|
+
}),
|
|
1158
|
+
getters: {
|
|
1159
|
+
playSrc(e) {
|
|
1160
|
+
const t = R(), s = V(), n = this.history[this.index];
|
|
1161
|
+
if (!n) return;
|
|
1162
|
+
const r = We(n);
|
|
1163
|
+
return r.effectId = t.playSelected, r.skinId = s.playSelected, vn(r);
|
|
1164
|
+
},
|
|
1165
|
+
previewSrc(e) {
|
|
1166
|
+
return mn(e.queue[0], "sm");
|
|
1167
|
+
},
|
|
1168
|
+
view360Path(e) {
|
|
1169
|
+
const t = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0;
|
|
1170
|
+
if (!t) return;
|
|
1171
|
+
const s = R(), n = V(), r = We(t);
|
|
1172
|
+
return r.effectId = s.playSelected, r.skinId = n.playSelected, Dr(r);
|
|
1173
|
+
},
|
|
1174
|
+
previewFlipped(e) {
|
|
1175
|
+
const t = e.queue[0];
|
|
1176
|
+
if (!t) return;
|
|
1177
|
+
const s = t.split(".").map((n) => parseInt(n));
|
|
1178
|
+
return s[2] && s[2] === 1;
|
|
1179
|
+
},
|
|
1180
|
+
previousDisabled(e) {
|
|
1181
|
+
return e.index === 0;
|
|
1182
|
+
},
|
|
1183
|
+
nextDisabled(e) {
|
|
1184
|
+
return e.index >= e.history.length + e.queue.length - 2;
|
|
1185
|
+
},
|
|
1186
|
+
current(e) {
|
|
1187
|
+
var s;
|
|
1188
|
+
const t = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0;
|
|
1189
|
+
return t != null ? (s = e.models) == null ? void 0 : s[t] : void 0;
|
|
1190
|
+
},
|
|
1191
|
+
currentEffect(e) {
|
|
1192
|
+
const t = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0;
|
|
1193
|
+
if (!t) return 1;
|
|
1194
|
+
const s = t.split(".");
|
|
1195
|
+
return t ? parseInt(s[4]) : 1;
|
|
1196
|
+
},
|
|
1197
|
+
currentId(e) {
|
|
1198
|
+
const t = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0;
|
|
1199
|
+
if (!t) return;
|
|
1200
|
+
const s = t.split(".");
|
|
1201
|
+
return t ? parseInt(s[0]) : void 0;
|
|
1202
|
+
},
|
|
1203
|
+
currentSrc(e) {
|
|
1204
|
+
var s, n;
|
|
1205
|
+
const t = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0;
|
|
1206
|
+
return t != null ? (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.src : void 0;
|
|
1207
|
+
},
|
|
1208
|
+
currentFlipped(e) {
|
|
1209
|
+
var s, n;
|
|
1210
|
+
const t = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0;
|
|
1211
|
+
return t != null ? (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.flipped : !1;
|
|
1212
|
+
},
|
|
1213
|
+
prevSrc(e) {
|
|
1214
|
+
var s, n;
|
|
1215
|
+
const t = e.index > 0 ? e.history[e.index - 1] : void 0;
|
|
1216
|
+
return t != null ? (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.src : void 0;
|
|
1217
|
+
},
|
|
1218
|
+
nextSrc(e) {
|
|
1219
|
+
var s, n;
|
|
1220
|
+
const t = e.index < e.history.length - 1 ? e.history[e.index + 1] : e.queue[0];
|
|
1221
|
+
return t != null ? (n = (s = e.models) == null ? void 0 : s[t]) == null ? void 0 : n.src : void 0;
|
|
1222
|
+
},
|
|
1223
|
+
// optional: return both ids and srcs at once
|
|
1224
|
+
neighbors(e) {
|
|
1225
|
+
const t = e.index > 0 ? e.history[e.index - 1] : void 0, s = e.index >= 0 && e.index < e.history.length ? e.history[e.index] : void 0, n = e.index < e.history.length - 1 ? e.history[e.index + 1] : e.queue[0], r = (a) => {
|
|
1226
|
+
var c, d;
|
|
1227
|
+
return a != null ? (d = (c = e.models) == null ? void 0 : c[a]) == null ? void 0 : d.src : void 0;
|
|
1228
|
+
};
|
|
1229
|
+
return {
|
|
1230
|
+
prev: { id: t, src: r(t) },
|
|
1231
|
+
current: { id: s, src: r(s) },
|
|
1232
|
+
next: { id: n, src: r(n) }
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1235
|
+
},
|
|
1236
|
+
actions: {
|
|
1237
|
+
...xr,
|
|
1238
|
+
init() {
|
|
1239
|
+
},
|
|
1240
|
+
resetQueue() {
|
|
1241
|
+
this.queue = [];
|
|
1242
|
+
},
|
|
1243
|
+
loadQueue() {
|
|
1244
|
+
const e = Pt(), t = Pe(), s = e.filters, n = t.randomTake(20, s), r = [];
|
|
1245
|
+
if (n.forEach((d) => {
|
|
1246
|
+
try {
|
|
1247
|
+
const u = Mr(d);
|
|
1248
|
+
r.push(u);
|
|
1249
|
+
} catch (u) {
|
|
1250
|
+
console.error("error", u);
|
|
1251
|
+
}
|
|
1252
|
+
}), this.queue = [...r], r.length === 0) return;
|
|
1253
|
+
const a = r[0];
|
|
1254
|
+
this.models[a] || (this.models[a] = $t(a));
|
|
1255
|
+
const c = this.models[a];
|
|
1256
|
+
c.status === Et && this.loadImage({
|
|
1257
|
+
url: c.src,
|
|
1258
|
+
callback: this.updateStatus
|
|
1259
|
+
});
|
|
1260
|
+
},
|
|
1261
|
+
updateQueue() {
|
|
1262
|
+
this.resetQueue(), this.loadQueue();
|
|
1263
|
+
},
|
|
1264
|
+
next() {
|
|
1265
|
+
if (this.queue.length < 5 && this.loadQueue(), this._preloadQueue(5), this.index < this.history.length - 1) {
|
|
1266
|
+
this.index++;
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
const e = R(), t = Pe(), s = V(), n = k(), r = Z(), a = this.queue.shift();
|
|
1270
|
+
if (a == null) return;
|
|
1271
|
+
this.models[a] || (this.models[a] = $t(a));
|
|
1272
|
+
const c = this.models[a];
|
|
1273
|
+
(c.status === Et || c.status === Xt) && this.loadImage({
|
|
1274
|
+
url: c.src,
|
|
1275
|
+
callback: this.updateStatus
|
|
1276
|
+
});
|
|
1277
|
+
const { poseId: d, index: u, lightDirection: f, skinId: g, effectId: v } = We(a);
|
|
1278
|
+
a.split("."), t.addToSeen(d), this.history.push(a), this.queue.shift(), this.index = this.history.length - 1, n.store({
|
|
1279
|
+
poseId: d,
|
|
1280
|
+
index: u,
|
|
1281
|
+
lightDirection: f,
|
|
1282
|
+
skinId: g,
|
|
1283
|
+
effectId: v,
|
|
1284
|
+
seconds: r.seconds
|
|
1285
|
+
}), s.playSelected = g, e.playSelected = v, this.queue.length < 5 && this.loadQueue(), this._preloadQueue(5);
|
|
1286
|
+
},
|
|
1287
|
+
reset() {
|
|
1288
|
+
this.$patch({
|
|
1289
|
+
index: 0,
|
|
1290
|
+
history: []
|
|
1291
|
+
});
|
|
1292
|
+
},
|
|
1293
|
+
// next2() {
|
|
1294
|
+
// // keep queue filled & preloaded
|
|
1295
|
+
// if (this.queue.length < 5) this.loadQueue()
|
|
1296
|
+
// this._preloadQueue(5)
|
|
1297
|
+
// const current = this.queue.shift()
|
|
1298
|
+
// if (current != null) this.history.push(current)
|
|
1299
|
+
// },
|
|
1300
|
+
previous() {
|
|
1301
|
+
if (this.index === 0) return;
|
|
1302
|
+
const e = V(), t = R(), s = this.index - 1;
|
|
1303
|
+
this.index = s;
|
|
1304
|
+
const n = this.history[s], { skinId: r, effectId: a } = We(n);
|
|
1305
|
+
t.playSelected = a, e.playSelected = r;
|
|
1306
|
+
},
|
|
1307
|
+
updateStatus(e, t) {
|
|
1308
|
+
const s = wr(this.models, e);
|
|
1309
|
+
s && (this.models[s.id].status = t);
|
|
1310
|
+
},
|
|
1311
|
+
_preloadQueue(e = 5) {
|
|
1312
|
+
const t = this.queue.slice(0, e);
|
|
1313
|
+
for (const s of t) {
|
|
1314
|
+
this.models[s] || (this.models[s] = $t(s));
|
|
1315
|
+
const n = this.models[s], r = n.status;
|
|
1316
|
+
if ((r === Et || r === Xt) && this.loadImage({
|
|
1317
|
+
url: n.src,
|
|
1318
|
+
callback: this.updateStatus
|
|
1319
|
+
}), r === Wt || r === fn) {
|
|
1320
|
+
delete this.models[s];
|
|
1321
|
+
const a = this.queue.indexOf(s);
|
|
1322
|
+
a !== -1 && this.queue.splice(a, 1);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
this.queue.length < 5 && this.loadQueue();
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}), Rs = 0, Ct = 1, zt = 2, he = ie("pg-timer", {
|
|
1329
|
+
state: () => ({
|
|
1330
|
+
status: Ct,
|
|
1331
|
+
interval: 0,
|
|
1332
|
+
intervalDelay: 25,
|
|
1333
|
+
seconds: 0,
|
|
1334
|
+
milliseconds: 0
|
|
1335
|
+
}),
|
|
1336
|
+
getters: {
|
|
1337
|
+
formatted(e) {
|
|
1338
|
+
const s = Z().duration, n = s - e.seconds;
|
|
1339
|
+
let r = Math.floor(n / 60), a = n - r * 60;
|
|
1340
|
+
return a = a >= 0 ? a : 59, r === 1 && a === 0 && s === 60 && (r = 0, a = 60), a = "0" + a, (s > 61 ? r + ":" : "") + a.substr(-2);
|
|
1341
|
+
},
|
|
1342
|
+
playing(e) {
|
|
1343
|
+
return e.status === zt;
|
|
1344
|
+
},
|
|
1345
|
+
paused(e) {
|
|
1346
|
+
return e.status === Rs;
|
|
1347
|
+
}
|
|
1348
|
+
},
|
|
1349
|
+
actions: {
|
|
1350
|
+
/**
|
|
1351
|
+
* Pause the timer - stop the interval without resetting seconds and milliseconds
|
|
1352
|
+
* @param context
|
|
1353
|
+
*/
|
|
1354
|
+
pause() {
|
|
1355
|
+
clearInterval(this.interval), this.$patch({
|
|
1356
|
+
interval: 0,
|
|
1357
|
+
status: Rs
|
|
1358
|
+
});
|
|
1359
|
+
},
|
|
1360
|
+
restart() {
|
|
1361
|
+
this.resetTimer(), this.start();
|
|
1362
|
+
},
|
|
1363
|
+
/**
|
|
1364
|
+
* Reset the timer - stop the interval and set seconds and milliseconds to 0
|
|
1365
|
+
* @param context
|
|
1366
|
+
*/
|
|
1367
|
+
resetTimer() {
|
|
1368
|
+
this.$patch({
|
|
1369
|
+
seconds: 0,
|
|
1370
|
+
milliseconds: 0
|
|
1371
|
+
});
|
|
1372
|
+
},
|
|
1373
|
+
/**
|
|
1374
|
+
* Stop the timer - Clear interval and reset time
|
|
1375
|
+
* @param context
|
|
1376
|
+
*/
|
|
1377
|
+
stop() {
|
|
1378
|
+
clearInterval(this.interval), this.resetTimer(), this.$patch({
|
|
1379
|
+
interval: 0,
|
|
1380
|
+
status: Ct
|
|
1381
|
+
});
|
|
1382
|
+
},
|
|
1383
|
+
/**
|
|
1384
|
+
* Start the timer if it isn't already running
|
|
1385
|
+
* @param context
|
|
1386
|
+
*/
|
|
1387
|
+
start() {
|
|
1388
|
+
if (this.status !== zt) {
|
|
1389
|
+
clearInterval(this.interval), this.$patch({
|
|
1390
|
+
interval: 0
|
|
1391
|
+
});
|
|
1392
|
+
const e = setInterval(this._tick, this.intervalDelay);
|
|
1393
|
+
this.$patch({
|
|
1394
|
+
interval: e,
|
|
1395
|
+
status: zt
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
/**
|
|
1400
|
+
* Timer interval callback
|
|
1401
|
+
* @param context
|
|
1402
|
+
*/
|
|
1403
|
+
_tick() {
|
|
1404
|
+
const e = Z(), t = Te(), s = e.duration, n = this.milliseconds + this.intervalDelay, r = Math.round(n / 1e3);
|
|
1405
|
+
if (n === s * 1e3) {
|
|
1406
|
+
this.resetTimer(), t.next();
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
this.$patch({
|
|
1410
|
+
seconds: r,
|
|
1411
|
+
milliseconds: n
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
}), Bs = 0, gt = 1, Ar = 2, Te = ie("pg-controls", {
|
|
1416
|
+
state: () => ({
|
|
1417
|
+
timer: !0,
|
|
1418
|
+
next: !0,
|
|
1419
|
+
show: !1,
|
|
1420
|
+
status: Bs
|
|
1421
|
+
}),
|
|
1422
|
+
getters: {
|
|
1423
|
+
/**
|
|
1424
|
+
* Is next disabled.
|
|
1425
|
+
* If we are at the end of history and the next item in the queue is not loaded
|
|
1426
|
+
* @param state
|
|
1427
|
+
* @param getters
|
|
1428
|
+
*/
|
|
1429
|
+
nextDisabled(e) {
|
|
1430
|
+
return X().nextDisabled;
|
|
1431
|
+
},
|
|
1432
|
+
/**
|
|
1433
|
+
* Is the the previous button disabled.
|
|
1434
|
+
* If we are at the beginning of history then yes
|
|
1435
|
+
* @param state
|
|
1436
|
+
* @returns {boolean}
|
|
1437
|
+
*/
|
|
1438
|
+
previousDisabled(e) {
|
|
1439
|
+
return X().previousDisabled;
|
|
1440
|
+
}
|
|
1441
|
+
},
|
|
1442
|
+
actions: {
|
|
1443
|
+
/**
|
|
1444
|
+
* Open the pose generator tool, reset history and start playing from queue
|
|
1445
|
+
*/
|
|
1446
|
+
open() {
|
|
1447
|
+
const e = he(), t = X(), s = k();
|
|
1448
|
+
e.resetTimer(), t.next(), e.start(), this.$patch({ show: !0, status: gt }), s.$patch({ active: Me, playActive: Me });
|
|
1449
|
+
},
|
|
1450
|
+
/**
|
|
1451
|
+
* Close the pose generator tool
|
|
1452
|
+
*/
|
|
1453
|
+
close() {
|
|
1454
|
+
const e = he(), t = X(), s = k();
|
|
1455
|
+
e.stop(), this.show = !1, this.status = Bs, t.reset(), s.$patch({ active: Me, playActive: Me });
|
|
1456
|
+
},
|
|
1457
|
+
/**
|
|
1458
|
+
* Check if currently inside of history, if so increment history index
|
|
1459
|
+
* if not load from the queue
|
|
1460
|
+
*/
|
|
1461
|
+
next: rn(
|
|
1462
|
+
function() {
|
|
1463
|
+
X().next(), this.resetOrRestartTimer();
|
|
1464
|
+
},
|
|
1465
|
+
250,
|
|
1466
|
+
{ leading: !0, maxWait: 500 }
|
|
1467
|
+
),
|
|
1468
|
+
/**
|
|
1469
|
+
* Move to the previous pose in history if it exists
|
|
1470
|
+
*/
|
|
1471
|
+
previous() {
|
|
1472
|
+
const e = X();
|
|
1473
|
+
e.index > 0 && (e.previous(), this.resetOrRestartTimer());
|
|
1474
|
+
},
|
|
1475
|
+
/**
|
|
1476
|
+
*
|
|
1477
|
+
*/
|
|
1478
|
+
pause() {
|
|
1479
|
+
const e = he();
|
|
1480
|
+
this.status = Ar, e.pause();
|
|
1481
|
+
},
|
|
1482
|
+
/**
|
|
1483
|
+
*
|
|
1484
|
+
*/
|
|
1485
|
+
play() {
|
|
1486
|
+
const e = he();
|
|
1487
|
+
this.status = gt, e.start();
|
|
1488
|
+
},
|
|
1489
|
+
/**
|
|
1490
|
+
* Reset or restart the time based on the current play status
|
|
1491
|
+
* @param getters
|
|
1492
|
+
* @param dispatch
|
|
1493
|
+
*/
|
|
1494
|
+
resetOrRestartTimer() {
|
|
1495
|
+
const e = he();
|
|
1496
|
+
if (e.playing === !0) {
|
|
1497
|
+
e.restart();
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
e.resetTimer();
|
|
1501
|
+
},
|
|
1502
|
+
startTimer() {
|
|
1503
|
+
const e = he();
|
|
1504
|
+
if (
|
|
1505
|
+
// p !== null &&
|
|
1506
|
+
e.status === Ct && this.show === !0 && this.status === gt
|
|
1507
|
+
) {
|
|
1508
|
+
e.start();
|
|
1509
|
+
return;
|
|
1510
|
+
}
|
|
1511
|
+
e.status === Ct && this.show === !0 && this.status === gt && this.startTimerLoop();
|
|
1512
|
+
},
|
|
1513
|
+
startTimerLoop() {
|
|
1514
|
+
setTimeout(() => {
|
|
1515
|
+
this.startTimer();
|
|
1516
|
+
}, 250);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
}), $s = /* @__PURE__ */ Object.assign({ "../i18n/en-US/index.js": () => import("./index-BMl4y9AI.js") }), M = (e = "../i18n") => {
|
|
1520
|
+
const t = It(), s = j({}), n = y(() => t.lang.isoName || "en-US"), r = async () => {
|
|
1521
|
+
const a = `${e}/${n.value}/index.js`;
|
|
1522
|
+
if ($s[a])
|
|
1523
|
+
try {
|
|
1524
|
+
const c = await $s[a]();
|
|
1525
|
+
c.default && Object.assign(s.value, c.default);
|
|
1526
|
+
} catch (c) {
|
|
1527
|
+
console.error(`Error loading i18n for ${n.value}`, c);
|
|
1528
|
+
}
|
|
1529
|
+
else
|
|
1530
|
+
console.error(`Module not found: ${a}`);
|
|
1531
|
+
};
|
|
1532
|
+
return Ne(
|
|
1533
|
+
() => n.value,
|
|
1534
|
+
() => {
|
|
1535
|
+
r();
|
|
1536
|
+
},
|
|
1537
|
+
{ immediate: !0 }
|
|
1538
|
+
), To(() => {
|
|
1539
|
+
r();
|
|
1540
|
+
}), { lang: s };
|
|
1541
|
+
}, ae = ({
|
|
1542
|
+
tab: e = wo,
|
|
1543
|
+
store: t,
|
|
1544
|
+
options: s = [],
|
|
1545
|
+
playMode: n = !1
|
|
1546
|
+
}) => {
|
|
1547
|
+
const r = Po(), a = k(r), c = y({
|
|
1548
|
+
get: () => a.isExpanded(s, n),
|
|
1549
|
+
set: (f) => {
|
|
1550
|
+
f && a.setActive(e, n);
|
|
1551
|
+
}
|
|
1552
|
+
}), d = y(() => t && t.changed);
|
|
1553
|
+
return { click: () => a.setActive(e, n), expanded: c, selected: d };
|
|
1554
|
+
}, yn = T({
|
|
1555
|
+
name: "PgDurationsTool",
|
|
1556
|
+
setup(e, { slots: t, emit: s }) {
|
|
1557
|
+
const n = k(), r = Z(), { loading: a } = S(n), { collectedModels: c, values: d } = S(r), u = y({
|
|
1558
|
+
get: () => r.index,
|
|
1559
|
+
set: (g) => r.setSelectedByIndex(g)
|
|
1560
|
+
});
|
|
1561
|
+
function f() {
|
|
1562
|
+
const g = {
|
|
1563
|
+
class: "pg-durations-tool col full-width",
|
|
1564
|
+
color: "lt-grey",
|
|
1565
|
+
disable: a.value,
|
|
1566
|
+
modelValue: u.value,
|
|
1567
|
+
"onUpdate:modelValue": (v) => u.value = v,
|
|
1568
|
+
markers: !0,
|
|
1569
|
+
markerLabels: d.value,
|
|
1570
|
+
min: 0,
|
|
1571
|
+
max: d.value.length - 1,
|
|
1572
|
+
noTrack: !0
|
|
1573
|
+
};
|
|
1574
|
+
return [
|
|
1575
|
+
h("div", { class: "q-mx-lg q-mt-sm q-mb-lg" }, [
|
|
1576
|
+
h(Oo, g, {
|
|
1577
|
+
// single label slot, Quasar passes { index, label }
|
|
1578
|
+
"marker-label": ({ marker: v }) => {
|
|
1579
|
+
const C = { ...v.style, cursor: "default" };
|
|
1580
|
+
return h(
|
|
1581
|
+
"div",
|
|
1582
|
+
{
|
|
1583
|
+
class: [
|
|
1584
|
+
v.classes,
|
|
1585
|
+
{
|
|
1586
|
+
"pg-durations-tool__is-active": v.value === u.value
|
|
1587
|
+
}
|
|
1588
|
+
// add class for current selection
|
|
1589
|
+
],
|
|
1590
|
+
onClick: () => u.value = v.value,
|
|
1591
|
+
style: C
|
|
1592
|
+
},
|
|
1593
|
+
v.label
|
|
1594
|
+
);
|
|
1595
|
+
}
|
|
1596
|
+
})
|
|
1597
|
+
])
|
|
1598
|
+
];
|
|
1599
|
+
}
|
|
1600
|
+
return () => f();
|
|
1601
|
+
}
|
|
1602
|
+
}), Nr = T({
|
|
1603
|
+
name: "PgDurationsExpansion",
|
|
1604
|
+
setup(e, { slots: t, emit: s }) {
|
|
1605
|
+
const { lang: n } = M(), r = Z(), { title: a } = S(r), { expanded: c } = ae({
|
|
1606
|
+
options: Yt,
|
|
1607
|
+
tab: Yt
|
|
1608
|
+
}), d = y(() => {
|
|
1609
|
+
var f;
|
|
1610
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.duration;
|
|
1611
|
+
});
|
|
1612
|
+
function u() {
|
|
1613
|
+
const f = {
|
|
1614
|
+
class: "pg-durations-expansion",
|
|
1615
|
+
modelValue: c.value,
|
|
1616
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
1617
|
+
label: d.value,
|
|
1618
|
+
caption: a.value,
|
|
1619
|
+
icon: cn
|
|
1620
|
+
};
|
|
1621
|
+
return h(me, f, () => h(yn));
|
|
1622
|
+
}
|
|
1623
|
+
return () => u();
|
|
1624
|
+
}
|
|
1625
|
+
}), Or = T({
|
|
1626
|
+
name: "PgSkinsToolButton",
|
|
1627
|
+
props: {
|
|
1628
|
+
id: Number,
|
|
1629
|
+
slug: String,
|
|
1630
|
+
playMode: Boolean,
|
|
1631
|
+
uuid: String
|
|
1632
|
+
},
|
|
1633
|
+
emits: ["click", "update:modelValue"],
|
|
1634
|
+
setup(e, { slots: t, emit: s }) {
|
|
1635
|
+
const n = V(), r = k(), { selected: a, playSelected: c } = S(n), { loading: d } = S(r), u = y(() => n.getSrc(e.slug, e.uuid)), f = y(() => n.getAccessKey(e.slug)), g = y(() => n.propertyById(e.id, "name")), v = (I) => {
|
|
1636
|
+
if (e.playMode) {
|
|
1637
|
+
n.playSelected = I;
|
|
1638
|
+
return;
|
|
1639
|
+
}
|
|
1640
|
+
n.toggleSelected(I);
|
|
1641
|
+
}, C = y(
|
|
1642
|
+
() => e.playMode ? c.value === e.id : a.value.includes(e.id)
|
|
1643
|
+
), _ = (I) => r.block(I), D = y(() => r.hasAccess(f.value));
|
|
1644
|
+
function P() {
|
|
1645
|
+
const I = {
|
|
1646
|
+
circle: !0,
|
|
1647
|
+
size: e.playMode ? "sm" : "lg",
|
|
1648
|
+
type: e.playMode ? "radio" : "checkbox",
|
|
1649
|
+
label: g.value,
|
|
1650
|
+
access: f.value,
|
|
1651
|
+
image: u.value,
|
|
1652
|
+
onClick: () => v(e.id),
|
|
1653
|
+
disable: d.value,
|
|
1654
|
+
selected: C.value,
|
|
1655
|
+
hasAccess: D.value,
|
|
1656
|
+
onBlockAccess: _
|
|
1657
|
+
};
|
|
1658
|
+
return h(Qe, I);
|
|
1659
|
+
}
|
|
1660
|
+
return () => P();
|
|
1661
|
+
}
|
|
1662
|
+
}), ts = T({
|
|
1663
|
+
name: "PgSkinsTool",
|
|
1664
|
+
props: {
|
|
1665
|
+
noWrap: Boolean,
|
|
1666
|
+
length: Number,
|
|
1667
|
+
playMode: Boolean,
|
|
1668
|
+
desktop: Boolean
|
|
1669
|
+
},
|
|
1670
|
+
emits: ["click", "update:modelValue"],
|
|
1671
|
+
setup(e, { slots: t, emit: s }) {
|
|
1672
|
+
const n = V(), r = Pe(), a = X(), { currentId: c } = S(a), d = y(() => {
|
|
1673
|
+
if (e.playMode) {
|
|
1674
|
+
const g = r.getModelById(c.value);
|
|
1675
|
+
return n.getModelsByIds(g == null ? void 0 : g.skin_ids);
|
|
1676
|
+
}
|
|
1677
|
+
return n.collectedModels;
|
|
1678
|
+
}), u = y(() => {
|
|
1679
|
+
if (e.playMode) {
|
|
1680
|
+
const g = r.getModelById(c.value);
|
|
1681
|
+
return g == null ? void 0 : g.set_uuid;
|
|
1682
|
+
}
|
|
1683
|
+
});
|
|
1684
|
+
y(() => e.playMode ? "col-6" : (e.desktop, ""));
|
|
1685
|
+
function f() {
|
|
1686
|
+
y(() => ({
|
|
1687
|
+
"pg-skins-tool row flex justify-center": !0,
|
|
1688
|
+
"q-pa-xs": e.playMode
|
|
1689
|
+
})).value, d.value.length;
|
|
1690
|
+
const v = [];
|
|
1691
|
+
return d.value.forEach((C) => {
|
|
1692
|
+
const _ = {
|
|
1693
|
+
id: C.id,
|
|
1694
|
+
key: C.id,
|
|
1695
|
+
playMode: e.playMode,
|
|
1696
|
+
slug: C.slug,
|
|
1697
|
+
class: "q-ma-xs"
|
|
1698
|
+
};
|
|
1699
|
+
u.value && (_.uuid = u.value), v.push(h(Or, _));
|
|
1700
|
+
}), h(an, {}, () => v);
|
|
1701
|
+
}
|
|
1702
|
+
return () => f();
|
|
1703
|
+
}
|
|
1704
|
+
}), kr = "M9.49816 16.125C8.73787 16.125 8.11581 16.7437 8.11581 17.5V39.5C8.11581 40.2563 8.73787 40.875 9.49816 40.875H31.6158C32.3761 40.875 32.9982 40.2563 32.9982 39.5V17.5C32.9982 16.7437 32.3761 16.125 31.6158 16.125H9.49816ZM3.96875 17.5C3.96875 14.4664 6.44835 12 9.49816 12H31.6158C34.6656 12 37.1452 14.4664 37.1452 17.5V39.5C37.1452 42.5336 34.6656 45 31.6158 45H9.49816C6.44835 45 3.96875 42.5336 3.96875 39.5V17.5ZM47.6511 16.5375C48.014 16.2711 48.446 16.125 48.8952 16.125C50.0443 16.125 50.9688 17.0445 50.9688 18.1875V38.8125C50.9688 39.9555 50.0443 40.875 48.8952 40.875C48.446 40.875 48.014 40.7289 47.6511 40.4625L41.2923 35.7188V30.5625L46.8217 34.6875V22.3125L41.2923 26.4375V21.2812L47.6511 16.5375zM21.6892 29.2971C20.618 29.3471 19.7271 29.4371 19.0165 29.567C18.3059 29.687 17.7384 29.8469 17.3142 30.0469C16.9006 30.2468 16.6036 30.4767 16.4233 30.7366C16.2536 30.9866 16.1688 31.2615 16.1688 31.5614C16.1688 32.1612 16.3438 32.5861 16.6937 32.836C17.0544 33.0859 17.5528 33.2109 18.1892 33.2109C18.921 33.2109 19.5521 33.0909 20.0824 32.851C20.6233 32.6011 21.1589 32.2162 21.6892 31.6963V29.2971ZM12.7483 22.4442C13.7134 21.6245 14.7794 21.0147 15.946 20.6148C17.1127 20.2049 18.3748 20 19.7324 20C20.7081 20 21.5778 20.15 22.3415 20.4499C23.1157 20.7498 23.768 21.1696 24.2983 21.7095C24.8392 22.2393 25.2528 22.8741 25.5392 23.6139C25.8256 24.3536 25.9687 25.1634 25.9687 26.0431V35.7601H23.9642C23.5506 35.7601 23.2324 35.7051 23.0097 35.5951C22.7975 35.4852 22.6225 35.2552 22.4847 34.9053L22.1347 33.9157C21.721 34.2555 21.318 34.5555 20.9256 34.8154C20.5437 35.0753 20.146 35.2952 19.7324 35.4752C19.3188 35.6451 18.8733 35.7751 18.396 35.865C17.9294 35.955 17.4044 36 16.821 36C16.0998 36 15.4422 35.91 14.8483 35.7301C14.2544 35.5501 13.74 35.2852 13.3051 34.9353C12.8809 34.5754 12.5521 34.1306 12.3187 33.6007C12.0854 33.0709 11.9688 32.4611 11.9688 31.7713C11.9688 31.2015 12.1225 30.6317 12.4301 30.0619C12.7377 29.492 13.2627 28.9772 14.0051 28.5173C14.7581 28.0475 15.7551 27.6626 16.996 27.3627C18.2475 27.0528 19.8119 26.8778 21.6892 26.8379V26.0431C21.6892 25.0734 21.4718 24.3636 21.0369 23.9138C20.6021 23.4539 19.9763 23.224 19.1597 23.224C18.5551 23.224 18.0513 23.294 17.6483 23.4339C17.2453 23.5639 16.89 23.7088 16.5824 23.8688C16.2854 24.0187 16.0044 24.1637 15.7392 24.3037C15.4741 24.4336 15.1665 24.4986 14.8165 24.4986C14.5089 24.4986 14.2491 24.4286 14.0369 24.2887C13.8354 24.1387 13.6657 23.9638 13.5278 23.7638L12.7483 22.4442Z|0 0 56 56", Lr = "M40.3077 8.63218C39.2846 8.63218 38.4615 7.8225 38.4615 6.81609C38.4615 5.80967 39.2846 5 40.3077 5H50.1538C51.1769 5 52 5.80967 52 6.81609V16.5019C52 17.5083 51.1769 18.318 50.1538 18.318C49.1308 18.318 48.3077 17.5083 48.3077 16.5019V11.1974L42.5462 16.8651C44.6 19.2033 45.8462 22.2453 45.8462 25.5823C45.8462 32.9375 39.7846 38.9003 32.3077 38.9003C29.5846 38.9003 27.0462 38.1058 24.9231 36.7437C23.2846 37.7955 21.4077 38.5068 19.3769 38.7717C19.3769 38.8095 19.3846 38.8549 19.3846 38.8927V42.5249H23.0769C24.1 42.5249 24.9231 43.3346 24.9231 44.341C24.9231 45.3474 24.1 46.1571 23.0769 46.1571H19.3846V49.1839C19.3846 50.1903 18.5615 51 17.5385 51C16.5154 51 15.6923 50.1903 15.6923 49.1839V46.1571H12C10.9769 46.1571 10.1538 45.3474 10.1538 44.341C10.1538 43.3346 10.9769 42.5249 12 42.5249H15.6923V38.8927C15.6923 38.8549 15.6923 38.8095 15.7 38.7717C9.09231 37.8863 4 32.317 4 25.5748C4 18.2196 10.0615 12.2568 17.5385 12.2568C20.2615 12.2568 22.8 13.0513 24.9231 14.4134C27.0462 13.0513 29.5846 12.2568 32.3077 12.2568C35.0615 12.2568 37.6308 13.0665 39.7692 14.4588L45.7 8.63218H40.3077ZM22 16.9483C20.6615 16.2749 19.1462 15.8965 17.5385 15.8965C12.1 15.8965 7.69231 20.2324 7.69231 25.5823C7.69231 30.9322 12.1 35.2681 17.5385 35.2681C19.1462 35.2681 20.6615 34.8898 22 34.2163C19.9846 31.8932 18.7692 28.874 18.7692 25.5823C18.7692 22.2907 19.9846 19.2714 22 16.9483ZM24.9231 31.9916C26.4538 30.2815 27.3846 28.0416 27.3846 25.5823C27.3846 23.123 26.4538 20.8832 24.9231 19.1731C23.3923 20.8832 22.4615 23.123 22.4615 25.5823C22.4615 28.0416 23.3923 30.2815 24.9231 31.9916ZM27.8462 34.2239C29.1846 34.8974 30.7 35.2757 32.3077 35.2757C37.7462 35.2757 42.1538 30.9398 42.1538 25.5899C42.1538 20.24 37.7462 15.8965 32.3077 15.8965C30.7 15.8965 29.1846 16.2749 27.8462 16.9483C29.8615 19.2714 31.0769 22.2907 31.0769 25.5823C31.0769 28.874 29.8615 31.8932 27.8462 34.2163V34.2239Z|0 0 56 56", Vr = "M38.35 22.875C38.35 25.65 37.2719 28.1648 35.5109 30.0365C33.98 31.6553 32.2838 33.9389 31.68 36.75H24.32C23.7162 33.9316 22.02 31.6553 20.4891 30.0365C18.7281 28.1648 17.65 25.65 17.65 22.875C17.65 17.1299 22.2859 12.4688 28 12.4688C33.7141 12.4688 38.35 17.1299 38.35 22.875ZM34.9 38.8963C34.9 36.4176 36.3159 34.2207 38.0122 32.4213C40.3625 29.9354 41.8 26.575 41.8 22.875C41.8 15.2148 35.6187 9 28 9C20.3812 9 14.2 15.2148 14.2 22.875C14.2 26.575 15.6375 29.9354 17.9878 32.4213C19.6841 34.2207 21.1 36.4176 21.1 38.8963V40.2188C21.1 43.4129 23.6731 46 26.85 46H29.15C32.3269 46 34.9 43.4129 34.9 40.2188V38.8963ZM27.425 19.4062C28.3809 19.4062 29.15 18.633 29.15 17.6719C29.15 16.7107 28.3809 15.9375 27.425 15.9375C23.9319 15.9375 21.1 18.7848 21.1 22.2969C21.1 23.258 21.8691 24.0312 22.825 24.0312C23.7809 24.0312 24.55 23.258 24.55 22.2969C24.55 20.6998 25.8366 19.4062 27.425 19.4062ZM9.21906 10.915C8.36375 10.4887 7.32875 10.8355 6.90469 11.6883C6.48062 12.541 6.82562 13.5889 7.68094 14.0225L9.98094 15.1787C10.8363 15.6051 11.8712 15.2582 12.2953 14.4055C12.7194 13.5527 12.3744 12.5049 11.5262 12.0785L9.22625 10.9223L9.21906 10.915ZM48.3191 14.0152C49.1744 13.5889 49.5194 12.5482 49.0881 11.6883C48.6569 10.8283 47.6291 10.4814 46.7738 10.915L44.4738 12.0713C43.6184 12.4977 43.2734 13.5383 43.7047 14.3982C44.1359 15.2582 45.1637 15.6051 46.0191 15.1715L48.3191 14.0152ZM6.725 21.1406C5.76906 21.1406 5 21.9139 5 22.875C5 23.8361 5.76906 24.6094 6.725 24.6094H9.025C9.98094 24.6094 10.75 23.8361 10.75 22.875C10.75 21.9139 9.98094 21.1406 9.025 21.1406H6.725ZM46.975 21.1406C46.0191 21.1406 45.25 21.9139 45.25 22.875C45.25 23.8361 46.0191 24.6094 46.975 24.6094H49.275C50.2309 24.6094 51 23.8361 51 22.875C51 21.9139 50.2309 21.1406 49.275 21.1406H46.975ZM11.5191 33.6787C12.3744 33.2523 12.7194 32.2117 12.2881 31.3518C11.8569 30.4918 10.8291 30.1449 9.97375 30.5785L7.67375 31.7348C6.81844 32.1611 6.47344 33.2018 6.90469 34.0617C7.33594 34.9217 8.36375 35.2686 9.21906 34.835L11.5191 33.6787ZM46.0191 30.5785C45.1637 30.1521 44.1287 30.499 43.7047 31.3518C43.2806 32.2045 43.6256 33.2523 44.4738 33.6787L46.7738 34.835C47.6291 35.2613 48.6641 34.9145 49.0881 34.0617C49.5122 33.209 49.1672 32.1611 48.3191 31.7348L46.0191 30.5785Z|0 0 56 56", Ur = "M9.49816 16.125C8.73787 16.125 8.11581 16.7437 8.11581 17.5V39.5C8.11581 40.2563 8.73787 40.875 9.49816 40.875H31.6158C32.3761 40.875 32.9982 40.2563 32.9982 39.5V17.5C32.9982 16.7437 32.3761 16.125 31.6158 16.125H9.49816ZM3.96875 17.5C3.96875 14.4664 6.44835 12 9.49816 12H31.6158C34.6656 12 37.1452 14.4664 37.1452 17.5V39.5C37.1452 42.5336 34.6656 45 31.6158 45H9.49816C6.44835 45 3.96875 42.5336 3.96875 39.5V17.5ZM47.6511 16.5375C48.014 16.2711 48.446 16.125 48.8952 16.125C50.0443 16.125 50.9688 17.0445 50.9688 18.1875V38.8125C50.9688 39.9555 50.0443 40.875 48.8952 40.875C48.446 40.875 48.014 40.7289 47.6511 40.4625L41.2923 35.7188V30.5625L46.8217 34.6875V22.3125L41.2923 26.4375V21.2812L47.6511 16.5375zM20.9919 20C22.1874 20 23.2747 20.1858 24.2538 20.5574C25.2328 20.9291 26.0728 21.4614 26.7736 22.1544C27.4744 22.8374 28.0155 23.6711 28.3968 24.6554C28.7781 25.6397 28.9688 26.7495 28.9688 27.9849C28.9688 29.2203 28.7781 30.3352 28.3968 31.3296C28.0155 32.3139 27.4744 33.1525 26.7736 33.8456C26.0728 34.5386 25.2328 35.0709 24.2538 35.4426C23.2747 35.8142 22.1874 36 20.9919 36C19.7861 36 18.6886 35.8142 17.6992 35.4426C16.7201 35.0709 15.8802 34.5386 15.1794 33.8456C14.4786 33.1525 13.9324 32.3139 13.5407 31.3296C13.1594 30.3352 12.9688 29.2203 12.9688 27.9849C12.9688 26.7495 13.1594 25.6397 13.5407 24.6554C13.9324 23.6711 14.4786 22.8374 15.1794 22.1544C15.8802 21.4614 16.7201 20.9291 17.6992 20.5574C18.6886 20.1858 19.7861 20 20.9919 20ZM20.9919 32.8814C22.208 32.8814 23.1098 32.4746 23.6973 31.661C24.2847 30.8374 24.5784 29.6171 24.5784 28C24.5784 26.393 24.2847 25.1827 23.6973 24.3691C23.1098 23.5455 22.208 23.1337 20.9919 23.1337C19.7449 23.1337 18.8277 23.5455 18.2402 24.3691C17.6528 25.1827 17.3591 26.393 17.3591 28C17.3591 29.6171 17.6528 30.8374 18.2402 31.661C18.8277 32.4746 19.7449 32.8814 20.9919 32.8814Z|0 0 56 56", Rr = "M17.2632 11.643C17.8471 11.1836 18.5626 10.9375 19.3028 10.9375H19.6811C20.5694 14.7027 23.9578 17.5 28.0041 17.5C32.0505 17.5 35.4389 14.7027 36.3271 10.9375H36.7054C37.4456 10.9375 38.1611 11.1836 38.745 11.643L48.4003 19.2473L44.4527 25.3832L40.1514 22.9961C39.5428 22.6598 38.7944 22.668 38.194 23.0207C37.5936 23.3734 37.2153 24.0215 37.2153 24.7188V44.4062C37.2153 44.7672 36.9192 45.0625 36.5574 45.0625H19.4509C19.089 45.0625 18.7929 44.7672 18.7929 44.4062V24.7188C18.7929 24.0215 18.4228 23.3734 17.8224 23.0207C17.2221 22.668 16.4737 22.6598 15.8651 22.9961L11.5555 25.3832L7.60788 19.2473L17.2632 11.643ZM19.3028 7C17.6744 7 16.0953 7.54961 14.8206 8.55039L3.75069 17.2703C2.95294 17.902 2.76378 19.0258 3.3148 19.8789L9.23629 29.0664C9.79554 29.9359 10.9469 30.223 11.8516 29.7227L14.8453 28.0656V44.4062C14.8453 46.941 16.9096 49 19.4509 49H36.5574C39.0987 49 41.163 46.941 41.163 44.4062V28.0656L44.1484 29.7227C45.0613 30.223 46.2045 29.9359 46.7637 29.0664L52.6852 19.8789C53.2362 19.0258 53.0471 17.8938 52.2493 17.2703L41.1876 8.55039C39.9129 7.54961 38.3338 7 36.7054 7H19.3028ZM23.8426 10.9375H32.1656C31.4254 12.4879 29.8381 13.5625 28.0041 13.5625C26.1701 13.5625 24.5828 12.4879 23.8426 10.9375Z|0 0 56 56", Br = "M14.0004 46C12.8959 45.9999 12.0004 45.1045 12.0004 44L12.0004 12C12.0004 10.8955 12.8959 10.0001 14.0004 10C15.105 10 16.0004 10.8954 16.0004 12L16.0004 44C16.0004 45.1046 15.105 46 14.0004 46zM43.4145 44.9707C42.6334 45.7515 41.3673 45.7517 40.5863 44.9707L23.6156 28L40.5863 11.0293C41.3673 10.2486 42.6334 10.2487 43.4145 11.0293C44.1955 11.8103 44.1955 13.0774 43.4145 13.8584L29.2738 28.001L43.4145 42.1426C44.1955 42.9236 44.1955 44.1897 43.4145 44.9707Z|0 0 56 56", $r = "M41.9998 10C43.1043 10.0001 43.9998 10.8955 43.9998 12V44C43.9998 45.1045 43.1043 45.9999 41.9998 46C40.8953 46 39.9998 45.1046 39.9998 44V12C39.9998 10.8954 40.8953 10 41.9998 10zM12.5858 11.0293C13.3668 10.2485 14.6329 10.2483 15.4139 11.0293L32.3846 28L15.4139 44.9707C14.633 45.7514 13.3668 45.7513 12.5858 44.9707C11.8047 44.1897 11.8047 42.9226 12.5858 42.1416L26.7264 27.999L12.5858 13.8574C11.8047 13.0764 11.8047 11.8103 12.5858 11.0293Z|0 0 56 56", En = T({
|
|
1705
|
+
name: "PgSkinsExpansion",
|
|
1706
|
+
props: { playMode: Boolean },
|
|
1707
|
+
setup(e, { slots: t, emit: s }) {
|
|
1708
|
+
const { lang: n } = M(), r = V(), { expanded: a } = ae({
|
|
1709
|
+
options: Gt,
|
|
1710
|
+
tab: Gt,
|
|
1711
|
+
playMode: e.playMode
|
|
1712
|
+
}), c = y(() => {
|
|
1713
|
+
var u;
|
|
1714
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.skins;
|
|
1715
|
+
});
|
|
1716
|
+
function d() {
|
|
1717
|
+
const u = y(
|
|
1718
|
+
() => e.playMode ? r.playCaption : r.caption
|
|
1719
|
+
), f = {
|
|
1720
|
+
class: "pg-skins-expansion",
|
|
1721
|
+
modelValue: a.value,
|
|
1722
|
+
"onUpdate:modelValue": (v) => a.value = v,
|
|
1723
|
+
label: c.value,
|
|
1724
|
+
caption: u.value,
|
|
1725
|
+
icon: Rr
|
|
1726
|
+
}, g = {
|
|
1727
|
+
playMode: e.playMode
|
|
1728
|
+
};
|
|
1729
|
+
return h(me, f, () => h(ts, g));
|
|
1730
|
+
}
|
|
1731
|
+
return () => d();
|
|
1732
|
+
}
|
|
1733
|
+
}), zr = T({
|
|
1734
|
+
name: "PgEffectsToolButton",
|
|
1735
|
+
props: {
|
|
1736
|
+
id: { type: Number, required: !0 },
|
|
1737
|
+
playMode: Boolean
|
|
1738
|
+
},
|
|
1739
|
+
setup(e, { slots: t, emit: s }) {
|
|
1740
|
+
const n = R(), r = k(), { loading: a } = S(r), c = () => n.setSelected(e.id, e.playMode), d = y(() => e.playMode ? n.playSelected : n.selected);
|
|
1741
|
+
function u() {
|
|
1742
|
+
const f = {
|
|
1743
|
+
class: "pg-effects-tool-button",
|
|
1744
|
+
label: n.name(e.id),
|
|
1745
|
+
image: n.srcById(e.id),
|
|
1746
|
+
selected: d.value === e.id,
|
|
1747
|
+
circle: !0,
|
|
1748
|
+
size: e.playMode ? "sm" : "lg",
|
|
1749
|
+
type: "radio",
|
|
1750
|
+
onClick: c
|
|
1751
|
+
};
|
|
1752
|
+
return h(Qe, f);
|
|
1753
|
+
}
|
|
1754
|
+
return () => u();
|
|
1755
|
+
}
|
|
1756
|
+
}), Sn = T({
|
|
1757
|
+
name: "PgEffectsTool",
|
|
1758
|
+
props: {
|
|
1759
|
+
modelValue: { type: Number, default: 0 },
|
|
1760
|
+
"onUpdate:modelValue": [Function, Array],
|
|
1761
|
+
label: { type: String, required: !1 },
|
|
1762
|
+
playMode: Boolean
|
|
1763
|
+
},
|
|
1764
|
+
emits: ["click", "update:modelValue"],
|
|
1765
|
+
setup(e, { slots: t, emit: s }) {
|
|
1766
|
+
const n = R(), { collection: r } = S(n);
|
|
1767
|
+
function a() {
|
|
1768
|
+
const d = {
|
|
1769
|
+
class: y(() => ({
|
|
1770
|
+
"pg-effects-tool": !0
|
|
1771
|
+
})).value
|
|
1772
|
+
}, u = [];
|
|
1773
|
+
return r.value.forEach((f) => {
|
|
1774
|
+
u.push(
|
|
1775
|
+
h(zr, {
|
|
1776
|
+
id: f,
|
|
1777
|
+
playMode: e.playMode,
|
|
1778
|
+
class: "q-ma-xs"
|
|
1779
|
+
})
|
|
1780
|
+
);
|
|
1781
|
+
}), h(an, d, u);
|
|
1782
|
+
}
|
|
1783
|
+
return () => a();
|
|
1784
|
+
}
|
|
1785
|
+
}), Tn = T({
|
|
1786
|
+
name: "PgEffectsExpansion",
|
|
1787
|
+
props: { playMode: Boolean },
|
|
1788
|
+
setup(e, { slots: t, emit: s }) {
|
|
1789
|
+
const { lang: n } = M(), r = R(), { expanded: a } = ae({
|
|
1790
|
+
options: St,
|
|
1791
|
+
tab: St,
|
|
1792
|
+
playMode: e.playMode
|
|
1793
|
+
}), c = y(() => {
|
|
1794
|
+
var u;
|
|
1795
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.effects;
|
|
1796
|
+
});
|
|
1797
|
+
function d() {
|
|
1798
|
+
const u = y(
|
|
1799
|
+
() => e.playMode ? r.playCaption : r.caption
|
|
1800
|
+
), f = {
|
|
1801
|
+
class: "pg-effects-expansion",
|
|
1802
|
+
modelValue: a.value,
|
|
1803
|
+
"onUpdate:modelValue": (v) => a.value = v,
|
|
1804
|
+
label: c.value,
|
|
1805
|
+
caption: u.value,
|
|
1806
|
+
icon: un
|
|
1807
|
+
}, g = {
|
|
1808
|
+
playMode: e.playMode
|
|
1809
|
+
};
|
|
1810
|
+
return h(me, f, () => h(Sn, g));
|
|
1811
|
+
}
|
|
1812
|
+
return () => d();
|
|
1813
|
+
}
|
|
1814
|
+
}), Hr = {
|
|
1815
|
+
__name: "PgCameraAnglesToolButton",
|
|
1816
|
+
props: {
|
|
1817
|
+
id: Number
|
|
1818
|
+
},
|
|
1819
|
+
setup(e) {
|
|
1820
|
+
const t = e, s = pe(), n = k(), { selected: r } = S(s), { loading: a } = S(n), c = y(() => r.value.includes(t.id)), d = y(() => s.propertyById(t.id, "name")), u = y(() => s.src(t.id)), f = y(() => {
|
|
1821
|
+
switch (t.id) {
|
|
1822
|
+
case 2:
|
|
1823
|
+
return "cad";
|
|
1824
|
+
case 3:
|
|
1825
|
+
return "cau";
|
|
1826
|
+
default:
|
|
1827
|
+
return "can";
|
|
1828
|
+
}
|
|
1829
|
+
}), g = (_) => n.block(_), v = y(() => n.hasAccess(f.value)), C = (_) => s.toggleSelected(_);
|
|
1830
|
+
return (_, D) => (O(), _t(A(Qe), {
|
|
1831
|
+
size: "lg",
|
|
1832
|
+
type: "checkbox",
|
|
1833
|
+
access: f.value,
|
|
1834
|
+
onClick: D[0] || (D[0] = (P) => C(e.id)),
|
|
1835
|
+
image: u.value,
|
|
1836
|
+
label: d.value,
|
|
1837
|
+
selected: c.value,
|
|
1838
|
+
disable: A(a),
|
|
1839
|
+
"has-access": v.value,
|
|
1840
|
+
onBlockAccess: g
|
|
1841
|
+
}, null, 8, ["access", "image", "label", "selected", "disable", "has-access"]));
|
|
1842
|
+
}
|
|
1843
|
+
}, Fr = { class: "pg-cameras-tool row q-col-gutter-sm flex justify-center" }, Cn = {
|
|
1844
|
+
__name: "PgCameraAnglesTool",
|
|
1845
|
+
setup(e) {
|
|
1846
|
+
const t = pe(), { collection: s } = S(t);
|
|
1847
|
+
return (n, r) => (O(), $("div", Fr, [
|
|
1848
|
+
(O(!0), $(Xe, null, Ze(A(s), (a) => (O(), $("div", {
|
|
1849
|
+
class: "",
|
|
1850
|
+
key: a
|
|
1851
|
+
}, [
|
|
1852
|
+
B(Hr, { id: a }, null, 8, ["id"])
|
|
1853
|
+
]))), 128))
|
|
1854
|
+
]));
|
|
1855
|
+
}
|
|
1856
|
+
}, qr = T({
|
|
1857
|
+
name: "PgCamerasExpansion",
|
|
1858
|
+
setup(e, { slots: t, emit: s }) {
|
|
1859
|
+
const { lang: n } = M(), r = pe(), { caption: a } = S(r), { expanded: c } = ae({
|
|
1860
|
+
options: Ps,
|
|
1861
|
+
tab: Ps
|
|
1862
|
+
}), d = y(() => {
|
|
1863
|
+
var f;
|
|
1864
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.angle;
|
|
1865
|
+
});
|
|
1866
|
+
function u() {
|
|
1867
|
+
const f = {
|
|
1868
|
+
class: "pg-cameras-expansion",
|
|
1869
|
+
modelValue: c.value,
|
|
1870
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
1871
|
+
label: d.value,
|
|
1872
|
+
caption: a.value,
|
|
1873
|
+
icon: kr
|
|
1874
|
+
};
|
|
1875
|
+
return h(me, f, () => h(Cn));
|
|
1876
|
+
}
|
|
1877
|
+
return () => u();
|
|
1878
|
+
}
|
|
1879
|
+
}), jr = {
|
|
1880
|
+
__name: "PgLightsToolButton",
|
|
1881
|
+
props: { id: Number },
|
|
1882
|
+
setup(e) {
|
|
1883
|
+
const t = e, s = ee(), n = k(), { selected: r } = S(s), { loading: a } = S(n), c = y(() => r.value.includes(t.id)), d = y(() => s.propertyById(t.id, "name")), u = y(() => s.src(t.id)), f = y(() => t.id === 1 ? "ldl" : "ldr"), g = y(() => n.hasAccess(f.value)), v = (_) => n.block(_), C = (_) => s.toggleSelected(_);
|
|
1884
|
+
return (_, D) => (O(), _t(A(Qe), {
|
|
1885
|
+
size: "lg",
|
|
1886
|
+
type: "checkbox",
|
|
1887
|
+
onClick: D[0] || (D[0] = (P) => C(e.id)),
|
|
1888
|
+
image: u.value,
|
|
1889
|
+
label: d.value,
|
|
1890
|
+
selected: c.value,
|
|
1891
|
+
access: f.value,
|
|
1892
|
+
disable: A(a),
|
|
1893
|
+
"has-access": g.value,
|
|
1894
|
+
onBlockAccess: v
|
|
1895
|
+
}, null, 8, ["image", "label", "selected", "access", "disable", "has-access"]));
|
|
1896
|
+
}
|
|
1897
|
+
}, Gr = { class: "pg-lights-tool row q-col-gutter-sm flex justify-center" }, _n = {
|
|
1898
|
+
__name: "PgLightsTool",
|
|
1899
|
+
setup(e) {
|
|
1900
|
+
const t = ee(), { collection: s } = S(t);
|
|
1901
|
+
return (n, r) => (O(), $("div", Gr, [
|
|
1902
|
+
(O(!0), $(Xe, null, Ze(A(s), (a) => (O(), $("div", {
|
|
1903
|
+
class: "",
|
|
1904
|
+
key: a
|
|
1905
|
+
}, [
|
|
1906
|
+
B(jr, { id: a }, null, 8, ["id"])
|
|
1907
|
+
]))), 128))
|
|
1908
|
+
]));
|
|
1909
|
+
}
|
|
1910
|
+
}, Yr = T({
|
|
1911
|
+
name: "PgLightsExpansion",
|
|
1912
|
+
setup(e, { slots: t, emit: s }) {
|
|
1913
|
+
const { lang: n } = M(), r = ee(), { caption: a } = S(r), { expanded: c } = ae({
|
|
1914
|
+
options: xs,
|
|
1915
|
+
tab: xs
|
|
1916
|
+
}), d = y(() => {
|
|
1917
|
+
var f;
|
|
1918
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.light;
|
|
1919
|
+
});
|
|
1920
|
+
function u() {
|
|
1921
|
+
const f = {
|
|
1922
|
+
class: "pg-lights-expansion",
|
|
1923
|
+
modelValue: c.value,
|
|
1924
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
1925
|
+
label: d.value,
|
|
1926
|
+
caption: a.value,
|
|
1927
|
+
icon: Vr
|
|
1928
|
+
};
|
|
1929
|
+
return h(me, f, () => h(_n));
|
|
1930
|
+
}
|
|
1931
|
+
return () => u();
|
|
1932
|
+
}
|
|
1933
|
+
}), Wr = T({
|
|
1934
|
+
name: "PgGendersToolButton",
|
|
1935
|
+
props: {
|
|
1936
|
+
id: Number,
|
|
1937
|
+
compact: Boolean
|
|
1938
|
+
},
|
|
1939
|
+
setup(e, { slots: t, emit: s }) {
|
|
1940
|
+
const n = re(), r = k(), { selected: a } = S(n), { loading: c } = S(r), d = y(() => e.id === 111 ? "lmf" : "lmm"), u = y(() => n.propertyById(e.id, "name")), f = y(() => n.propertyById(e.id, "slug")), g = y(() => a.value.includes(e.id)), v = y(() => r.hasAccess(d.value));
|
|
1941
|
+
function C() {
|
|
1942
|
+
const _ = {
|
|
1943
|
+
size: e.compact ? "sm" : "lg",
|
|
1944
|
+
type: "checkbox",
|
|
1945
|
+
access: d.value,
|
|
1946
|
+
onClick: () => n.toggleSelected(e.id),
|
|
1947
|
+
icon: `f_${f.value}`,
|
|
1948
|
+
label: u.value,
|
|
1949
|
+
selected: g.value,
|
|
1950
|
+
disable: c.value,
|
|
1951
|
+
hasAccess: v.value,
|
|
1952
|
+
onBlockAccess: (D) => r.block(D)
|
|
1953
|
+
};
|
|
1954
|
+
return h(Qe, _);
|
|
1955
|
+
}
|
|
1956
|
+
return () => C();
|
|
1957
|
+
}
|
|
1958
|
+
}), bn = T({
|
|
1959
|
+
name: "PgGendersTool",
|
|
1960
|
+
props: {
|
|
1961
|
+
compact: Boolean
|
|
1962
|
+
},
|
|
1963
|
+
emits: ["click", "update:modelValue"],
|
|
1964
|
+
setup(e, { slots: t, emit: s }) {
|
|
1965
|
+
const n = re(), { collection: r } = S(n);
|
|
1966
|
+
function a() {
|
|
1967
|
+
const c = {
|
|
1968
|
+
class: "pg-genders-tool row q-col-gutter-sm flex justify-center"
|
|
1969
|
+
}, d = [];
|
|
1970
|
+
return r.value.forEach((u) => {
|
|
1971
|
+
const f = {
|
|
1972
|
+
key: u,
|
|
1973
|
+
id: u,
|
|
1974
|
+
compact: e.compact
|
|
1975
|
+
};
|
|
1976
|
+
d.push(
|
|
1977
|
+
h("div", { class: "" }, [h(Wr, f)])
|
|
1978
|
+
);
|
|
1979
|
+
}), h("div", c, d);
|
|
1980
|
+
}
|
|
1981
|
+
return () => a();
|
|
1982
|
+
}
|
|
1983
|
+
}), Xr = T({
|
|
1984
|
+
name: "PgEffectsExpansion",
|
|
1985
|
+
setup(e, { slots: t, emit: s }) {
|
|
1986
|
+
const { lang: n } = M(), r = re(), { caption: a } = S(r), { expanded: c } = ae({
|
|
1987
|
+
options: Tt,
|
|
1988
|
+
tab: Tt
|
|
1989
|
+
}), d = y(() => {
|
|
1990
|
+
var f;
|
|
1991
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.gender;
|
|
1992
|
+
});
|
|
1993
|
+
function u() {
|
|
1994
|
+
const f = {
|
|
1995
|
+
class: "pg-effects-expansion",
|
|
1996
|
+
modelValue: c.value,
|
|
1997
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
1998
|
+
label: d.value,
|
|
1999
|
+
caption: a.value,
|
|
2000
|
+
icon: Lr
|
|
2001
|
+
};
|
|
2002
|
+
return h(me, f, () => h(bn, { desktop: !1 }));
|
|
2003
|
+
}
|
|
2004
|
+
return () => u();
|
|
2005
|
+
}
|
|
2006
|
+
}), In = T({
|
|
2007
|
+
name: "PgGridTool",
|
|
2008
|
+
setup(e, { slots: t, emit: s }) {
|
|
2009
|
+
const n = Ie(), { visible: r } = S(n), a = y({
|
|
2010
|
+
get: () => n.spacing,
|
|
2011
|
+
set: (g) => n.setSpacing(g)
|
|
2012
|
+
}), c = y({
|
|
2013
|
+
get: () => n.horizontal,
|
|
2014
|
+
set: (g) => n.setHorizontal(g)
|
|
2015
|
+
}), d = y({
|
|
2016
|
+
get: () => n.vertical,
|
|
2017
|
+
set: (g) => n.setVertical(g)
|
|
2018
|
+
}), u = (g) => g ? n.show() : n.hide();
|
|
2019
|
+
function f() {
|
|
2020
|
+
const g = {
|
|
2021
|
+
class: "pg-grid-tool",
|
|
2022
|
+
lines: a.value,
|
|
2023
|
+
"onUpdate:lines": (v) => a.value = v,
|
|
2024
|
+
visible: r.value,
|
|
2025
|
+
"onUpdate:visible": (v) => r.value = v,
|
|
2026
|
+
horizontal: c.value,
|
|
2027
|
+
"onUpdate:horizontal": (v) => c.value = v,
|
|
2028
|
+
vertical: d.value,
|
|
2029
|
+
"onUpdate:vertical": (v) => d.value = v,
|
|
2030
|
+
onToggle: u
|
|
2031
|
+
};
|
|
2032
|
+
return h($o, g);
|
|
2033
|
+
}
|
|
2034
|
+
return () => f();
|
|
2035
|
+
}
|
|
2036
|
+
}), Pn = T({
|
|
2037
|
+
name: "PgLightsExpansion",
|
|
2038
|
+
props: {
|
|
2039
|
+
playMode: Boolean
|
|
2040
|
+
},
|
|
2041
|
+
setup(e, { slots: t, emit: s }) {
|
|
2042
|
+
const { lang: n } = M(), r = Ie(), { caption: a } = S(r), { expanded: c } = ae({
|
|
2043
|
+
options: ws,
|
|
2044
|
+
tab: ws,
|
|
2045
|
+
playMode: e.playMode
|
|
2046
|
+
}), d = y(() => {
|
|
2047
|
+
var f;
|
|
2048
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.grid;
|
|
2049
|
+
});
|
|
2050
|
+
function u() {
|
|
2051
|
+
const f = {
|
|
2052
|
+
class: "pg-grid-expansion",
|
|
2053
|
+
modelValue: c.value,
|
|
2054
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
2055
|
+
label: d.value,
|
|
2056
|
+
caption: a.value,
|
|
2057
|
+
icon: "f_grid"
|
|
2058
|
+
};
|
|
2059
|
+
return h(me, f, () => h(In));
|
|
2060
|
+
}
|
|
2061
|
+
return () => u();
|
|
2062
|
+
}
|
|
2063
|
+
}), Zr = { class: "quarters overlay" }, Qr = ["onClick", "onMouseover", "onMouseleave"], Kr = { class: "quarters borders" }, Jr = { class: "quickpose-angle" }, ei = ["src"], zs = "cps", xn = {
|
|
2064
|
+
__name: "PgPosePositionTool",
|
|
2065
|
+
setup(e) {
|
|
2066
|
+
const t = fe(), s = re(), n = k(), { selected: r, collectedModels: a } = S(t), { collectedModels: c } = S(s), { loading: d } = S(n), u = j(null), f = y(() => {
|
|
2067
|
+
const P = c.value;
|
|
2068
|
+
return P.length === 2 ? Math.floor(Math.random() * 2) === 1 ? v("male") : v("female") : P.includes(110) ? v("male") : v("female");
|
|
2069
|
+
}), g = y(() => n.hasAccess(zs)), v = (P) => `https://static.figurosity.com/pose-generator/position/model-${P}.webp`, C = (P) => u.value = P, _ = (P) => u.value = null, D = (P) => {
|
|
2070
|
+
if (!d.value) {
|
|
2071
|
+
if (g.value) {
|
|
2072
|
+
t.toggleSelected(P);
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
n.block(zs);
|
|
2076
|
+
}
|
|
2077
|
+
};
|
|
2078
|
+
return (P, I) => (O(), $("div", {
|
|
2079
|
+
class: mt(["c-pose-position", { disabled: A(d) }])
|
|
2080
|
+
}, [
|
|
2081
|
+
De("div", Zr, [
|
|
2082
|
+
(O(!0), $(Xe, null, Ze(A(a), (b) => (O(), $("div", {
|
|
2083
|
+
class: mt(["quarter", b.slug]),
|
|
2084
|
+
key: b.id,
|
|
2085
|
+
onClick: (x) => D(b.id),
|
|
2086
|
+
onMouseover: (x) => C(b.slug),
|
|
2087
|
+
onMouseleave: (x) => _(b.slug)
|
|
2088
|
+
}, null, 42, Qr))), 128))
|
|
2089
|
+
]),
|
|
2090
|
+
De("div", Kr, [
|
|
2091
|
+
(O(!0), $(Xe, null, Ze(A(a), (b) => (O(), $("div", {
|
|
2092
|
+
class: mt([
|
|
2093
|
+
"quarter",
|
|
2094
|
+
b.slug + (A(r).includes(b.id) ? " active" : "") + (u.value === b.slug ? " hover" : "")
|
|
2095
|
+
]),
|
|
2096
|
+
key: b.id,
|
|
2097
|
+
ref_for: !0,
|
|
2098
|
+
ref: b.slug
|
|
2099
|
+
}, [
|
|
2100
|
+
De("span", null, Co(b.name), 1)
|
|
2101
|
+
], 2))), 128))
|
|
2102
|
+
]),
|
|
2103
|
+
De("div", Jr, [
|
|
2104
|
+
De("img", {
|
|
2105
|
+
src: f.value,
|
|
2106
|
+
class: ""
|
|
2107
|
+
}, null, 8, ei)
|
|
2108
|
+
])
|
|
2109
|
+
], 2));
|
|
2110
|
+
}
|
|
2111
|
+
}, ti = T({
|
|
2112
|
+
name: "PgEffectsExpansion",
|
|
2113
|
+
setup(e, { slots: t, emit: s }) {
|
|
2114
|
+
const { lang: n } = M(), r = fe(), { caption: a } = S(r), { expanded: c } = ae({
|
|
2115
|
+
options: Ds,
|
|
2116
|
+
tab: Ds
|
|
2117
|
+
}), d = y(() => {
|
|
2118
|
+
var f;
|
|
2119
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.position;
|
|
2120
|
+
});
|
|
2121
|
+
function u() {
|
|
2122
|
+
const f = {
|
|
2123
|
+
class: "pg-position-expansion",
|
|
2124
|
+
modelValue: c.value,
|
|
2125
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
2126
|
+
label: d.value,
|
|
2127
|
+
caption: a.value,
|
|
2128
|
+
icon: Ur
|
|
2129
|
+
};
|
|
2130
|
+
return h(me, f, () => h(xn));
|
|
2131
|
+
}
|
|
2132
|
+
return () => u();
|
|
2133
|
+
}
|
|
2134
|
+
}), wn = T({
|
|
2135
|
+
name: "PgBrightnessTool",
|
|
2136
|
+
props: {
|
|
2137
|
+
noIcons: Boolean
|
|
2138
|
+
},
|
|
2139
|
+
emits: ["update:modelValue"],
|
|
2140
|
+
setup(e, { slots: t, emit: s }) {
|
|
2141
|
+
const n = ge(), r = y({
|
|
2142
|
+
get: () => n.brightness,
|
|
2143
|
+
set: (c) => n.setBrightness(c)
|
|
2144
|
+
});
|
|
2145
|
+
function a() {
|
|
2146
|
+
const c = {
|
|
2147
|
+
class: "pg-brightness-tool",
|
|
2148
|
+
modelValue: r.value,
|
|
2149
|
+
"onUpdate:modelValue": (d) => r.value = d,
|
|
2150
|
+
noicons: !1,
|
|
2151
|
+
dark: !1
|
|
2152
|
+
};
|
|
2153
|
+
return h(es, c);
|
|
2154
|
+
}
|
|
2155
|
+
return () => a();
|
|
2156
|
+
}
|
|
2157
|
+
}), Dn = T({
|
|
2158
|
+
name: "PgBrightnessTool",
|
|
2159
|
+
emits: ["update:modelValue"],
|
|
2160
|
+
setup(e, { slots: t, emit: s }) {
|
|
2161
|
+
const n = ge(), r = y({
|
|
2162
|
+
get: () => n.contrast,
|
|
2163
|
+
set: (c) => n.setContrast(c)
|
|
2164
|
+
});
|
|
2165
|
+
function a() {
|
|
2166
|
+
const c = {
|
|
2167
|
+
class: "pg-contrast-tool",
|
|
2168
|
+
modelValue: r.value,
|
|
2169
|
+
"onUpdate:modelValue": (d) => r.value = d,
|
|
2170
|
+
type: "contrast"
|
|
2171
|
+
};
|
|
2172
|
+
return h(es, c);
|
|
2173
|
+
}
|
|
2174
|
+
return () => a();
|
|
2175
|
+
}
|
|
2176
|
+
}), Mn = T({
|
|
2177
|
+
name: "PgBrightnessTool",
|
|
2178
|
+
emits: ["update:modelValue"],
|
|
2179
|
+
setup(e, { slots: t, emit: s }) {
|
|
2180
|
+
const n = ge(), r = y({
|
|
2181
|
+
get: () => n.saturate,
|
|
2182
|
+
set: (c) => n.setSaturate(c)
|
|
2183
|
+
});
|
|
2184
|
+
function a() {
|
|
2185
|
+
const c = {
|
|
2186
|
+
class: "pg-saturate-tool",
|
|
2187
|
+
modelValue: r.value,
|
|
2188
|
+
"onUpdate:modelValue": (d) => r.value = d,
|
|
2189
|
+
type: "saturate"
|
|
2190
|
+
};
|
|
2191
|
+
return h(es, c);
|
|
2192
|
+
}
|
|
2193
|
+
return () => a();
|
|
2194
|
+
}
|
|
2195
|
+
}), An = T({
|
|
2196
|
+
name: "PgEffectsExpansion",
|
|
2197
|
+
props: {
|
|
2198
|
+
playMode: Boolean
|
|
2199
|
+
},
|
|
2200
|
+
setup(e, { slots: t, emit: s }) {
|
|
2201
|
+
const { lang: n } = M(), r = ge(), { caption: a } = S(r), { expanded: c } = ae({
|
|
2202
|
+
options: Ms,
|
|
2203
|
+
tab: Ms,
|
|
2204
|
+
playMode: e.playMode
|
|
2205
|
+
}), d = y(() => {
|
|
2206
|
+
var f;
|
|
2207
|
+
return (f = n.value.pg) == null ? void 0 : f.tools.adjustment;
|
|
2208
|
+
});
|
|
2209
|
+
function u() {
|
|
2210
|
+
const f = {
|
|
2211
|
+
class: "pg-adjustments-expansion",
|
|
2212
|
+
modelValue: c.value,
|
|
2213
|
+
"onUpdate:modelValue": (g) => c.value = g,
|
|
2214
|
+
label: d.value,
|
|
2215
|
+
caption: a.value,
|
|
2216
|
+
icon: dn
|
|
2217
|
+
};
|
|
2218
|
+
return h(me, f, () => [
|
|
2219
|
+
h(wn),
|
|
2220
|
+
h(Dn),
|
|
2221
|
+
h(Mn)
|
|
2222
|
+
]);
|
|
2223
|
+
}
|
|
2224
|
+
return () => u();
|
|
2225
|
+
}
|
|
2226
|
+
}), si = T({
|
|
2227
|
+
name: "PgExpansions",
|
|
2228
|
+
setup(e, { slots: t, emit: s }) {
|
|
2229
|
+
function n() {
|
|
2230
|
+
return h("div", {
|
|
2231
|
+
class: "pg-expansions"
|
|
2232
|
+
}, [
|
|
2233
|
+
h(Nr),
|
|
2234
|
+
h(J),
|
|
2235
|
+
h(En),
|
|
2236
|
+
h(J),
|
|
2237
|
+
h(Tn),
|
|
2238
|
+
h(J),
|
|
2239
|
+
h(qr),
|
|
2240
|
+
h(J),
|
|
2241
|
+
h(Xr),
|
|
2242
|
+
h(J),
|
|
2243
|
+
h(ti),
|
|
2244
|
+
h(J),
|
|
2245
|
+
h(Pn),
|
|
2246
|
+
h(J),
|
|
2247
|
+
h(Yr),
|
|
2248
|
+
h(J),
|
|
2249
|
+
h(An)
|
|
2250
|
+
]);
|
|
2251
|
+
}
|
|
2252
|
+
return () => n();
|
|
2253
|
+
}
|
|
2254
|
+
}), ve = T({
|
|
2255
|
+
name: "PgCard",
|
|
2256
|
+
props: {
|
|
2257
|
+
label: String,
|
|
2258
|
+
caption: String,
|
|
2259
|
+
icon: String,
|
|
2260
|
+
count: Number
|
|
2261
|
+
},
|
|
2262
|
+
setup(e, { slots: t, emit: s }) {
|
|
2263
|
+
y(() => e.count ? {
|
|
2264
|
+
width: e.count * 110 + "px",
|
|
2265
|
+
maxWidth: e.count * 110 + "px"
|
|
2266
|
+
} : {
|
|
2267
|
+
width: "100%"
|
|
2268
|
+
});
|
|
2269
|
+
function n() {
|
|
2270
|
+
const r = {
|
|
2271
|
+
class: "pg-card",
|
|
2272
|
+
"data-cy": "pg-card-" + Do(e.label)
|
|
2273
|
+
// style: style.value,
|
|
2274
|
+
};
|
|
2275
|
+
return h("div", r, [
|
|
2276
|
+
h(
|
|
2277
|
+
ko,
|
|
2278
|
+
{ flat: !0, bordered: !0 },
|
|
2279
|
+
{
|
|
2280
|
+
default: () => [
|
|
2281
|
+
h(Lo, {}, () => [
|
|
2282
|
+
h(As, { avatar: !0 }, () => [
|
|
2283
|
+
h(Vo, { name: e.icon, size: "36px" })
|
|
2284
|
+
]),
|
|
2285
|
+
h(As, {}, () => [
|
|
2286
|
+
h(Ns, { class: "pg-card-label" }, () => e.label),
|
|
2287
|
+
h(
|
|
2288
|
+
Ns,
|
|
2289
|
+
{ class: "pg-card-caption", caption: !0 },
|
|
2290
|
+
() => e.caption
|
|
2291
|
+
)
|
|
2292
|
+
])
|
|
2293
|
+
]),
|
|
2294
|
+
h(Uo, null, {
|
|
2295
|
+
default: () => t.default ? t.default() : []
|
|
2296
|
+
})
|
|
2297
|
+
]
|
|
2298
|
+
}
|
|
2299
|
+
)
|
|
2300
|
+
]);
|
|
2301
|
+
}
|
|
2302
|
+
return () => n();
|
|
2303
|
+
}
|
|
2304
|
+
}), ni = T({
|
|
2305
|
+
name: "PgDurationCard",
|
|
2306
|
+
setup(e, { slots: t, emit: s }) {
|
|
2307
|
+
const { lang: n } = M(), r = Z(), { title: a } = S(r), c = y(() => {
|
|
2308
|
+
var u;
|
|
2309
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.duration;
|
|
2310
|
+
});
|
|
2311
|
+
function d() {
|
|
2312
|
+
const u = {
|
|
2313
|
+
class: "pg-duration-card",
|
|
2314
|
+
label: c.value,
|
|
2315
|
+
caption: a.value,
|
|
2316
|
+
icon: cn
|
|
2317
|
+
};
|
|
2318
|
+
return h(ve, u, () => h(yn, {}));
|
|
2319
|
+
}
|
|
2320
|
+
return () => d();
|
|
2321
|
+
}
|
|
2322
|
+
}), oi = T({
|
|
2323
|
+
name: "PgSkinsCard",
|
|
2324
|
+
setup(e, { slots: t, emit: s }) {
|
|
2325
|
+
const { lang: n } = M(), r = V(), a = y(() => {
|
|
2326
|
+
var u;
|
|
2327
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.skins;
|
|
2328
|
+
}), c = y(() => r.caption);
|
|
2329
|
+
function d() {
|
|
2330
|
+
const u = {
|
|
2331
|
+
class: "pg-skins-card",
|
|
2332
|
+
label: a.value,
|
|
2333
|
+
caption: c.value,
|
|
2334
|
+
icon: jo
|
|
2335
|
+
};
|
|
2336
|
+
return h(ve, u, {
|
|
2337
|
+
default: () => h(ts, { desktop: !0 })
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
return () => d();
|
|
2341
|
+
}
|
|
2342
|
+
}), ri = T({
|
|
2343
|
+
name: "PgEffectsCard",
|
|
2344
|
+
setup(e, { slots: t, emit: s }) {
|
|
2345
|
+
const { lang: n } = M(), r = R(), a = y(() => {
|
|
2346
|
+
var u;
|
|
2347
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.effects;
|
|
2348
|
+
}), c = y(() => r.caption);
|
|
2349
|
+
function d() {
|
|
2350
|
+
const u = {
|
|
2351
|
+
class: "pg-skins-card",
|
|
2352
|
+
label: a.value,
|
|
2353
|
+
caption: c.value,
|
|
2354
|
+
icon: un
|
|
2355
|
+
};
|
|
2356
|
+
return h(ve, u, () => [h(Sn, { desktop: !0 })]);
|
|
2357
|
+
}
|
|
2358
|
+
return () => d();
|
|
2359
|
+
}
|
|
2360
|
+
}), ii = T({
|
|
2361
|
+
name: "PgCameraAnglesCard",
|
|
2362
|
+
emits: ["click", "update:modelValue"],
|
|
2363
|
+
setup(e, { slots: t, emit: s }) {
|
|
2364
|
+
const { lang: n } = M(), r = pe(), { caption: a } = S(r), c = y(() => {
|
|
2365
|
+
var u;
|
|
2366
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.angle;
|
|
2367
|
+
});
|
|
2368
|
+
function d() {
|
|
2369
|
+
const u = {
|
|
2370
|
+
class: "pg-cameras-card",
|
|
2371
|
+
label: c.value,
|
|
2372
|
+
caption: a.value,
|
|
2373
|
+
icon: Go
|
|
2374
|
+
};
|
|
2375
|
+
return h(ve, u, () => [h(Cn)]);
|
|
2376
|
+
}
|
|
2377
|
+
return () => d();
|
|
2378
|
+
}
|
|
2379
|
+
}), ai = T({
|
|
2380
|
+
name: "PgLightsCard",
|
|
2381
|
+
setup(e, { slots: t, emit: s }) {
|
|
2382
|
+
const { lang: n } = M(), r = ee(), { caption: a } = S(r), c = y(() => {
|
|
2383
|
+
var u;
|
|
2384
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.light;
|
|
2385
|
+
});
|
|
2386
|
+
function d() {
|
|
2387
|
+
const u = {
|
|
2388
|
+
class: "pg-lights-card",
|
|
2389
|
+
label: c.value,
|
|
2390
|
+
caption: a.value,
|
|
2391
|
+
icon: Yo
|
|
2392
|
+
};
|
|
2393
|
+
return h(ve, u, {
|
|
2394
|
+
default: () => h(_n, { desktop: !0 })
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
return () => d();
|
|
2398
|
+
}
|
|
2399
|
+
}), li = T({
|
|
2400
|
+
name: "PgGendersCard",
|
|
2401
|
+
setup(e, { slots: t, emit: s }) {
|
|
2402
|
+
const { lang: n } = M(), r = re(), { caption: a } = S(r);
|
|
2403
|
+
ae({
|
|
2404
|
+
options: Tt,
|
|
2405
|
+
tab: Tt
|
|
2406
|
+
});
|
|
2407
|
+
const c = y(() => {
|
|
2408
|
+
var u;
|
|
2409
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.gender;
|
|
2410
|
+
});
|
|
2411
|
+
function d() {
|
|
2412
|
+
const u = {
|
|
2413
|
+
class: "pg-genders-card",
|
|
2414
|
+
label: c.value,
|
|
2415
|
+
caption: a.value,
|
|
2416
|
+
icon: Wo
|
|
2417
|
+
};
|
|
2418
|
+
return h(ve, u, () => [h(bn)]);
|
|
2419
|
+
}
|
|
2420
|
+
return () => d();
|
|
2421
|
+
}
|
|
2422
|
+
}), ci = T({
|
|
2423
|
+
name: "PgPosePositionCard",
|
|
2424
|
+
setup(e, { slots: t, emit: s }) {
|
|
2425
|
+
const { lang: n } = M(), r = fe(), { caption: a } = S(r), c = y(() => {
|
|
2426
|
+
var u;
|
|
2427
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.position;
|
|
2428
|
+
});
|
|
2429
|
+
function d() {
|
|
2430
|
+
const u = {
|
|
2431
|
+
class: "pg-pose-position-card",
|
|
2432
|
+
label: c.value,
|
|
2433
|
+
caption: a.value,
|
|
2434
|
+
icon: Xo
|
|
2435
|
+
};
|
|
2436
|
+
return h(ve, u, {
|
|
2437
|
+
default: () => h(xn)
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
return () => d();
|
|
2441
|
+
}
|
|
2442
|
+
}), ui = T({
|
|
2443
|
+
name: "PgGridCard",
|
|
2444
|
+
props: {
|
|
2445
|
+
modelValue: { type: Number, default: 0 },
|
|
2446
|
+
"onUpdate:modelValue": [Function, Array],
|
|
2447
|
+
label: { type: String, required: !1 }
|
|
2448
|
+
},
|
|
2449
|
+
emits: ["click", "update:modelValue"],
|
|
2450
|
+
setup(e, { slots: t, emit: s }) {
|
|
2451
|
+
const { lang: n } = M(), r = Ie(), { caption: a } = S(r), c = y(() => {
|
|
2452
|
+
var u;
|
|
2453
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.grid;
|
|
2454
|
+
});
|
|
2455
|
+
function d() {
|
|
2456
|
+
const u = {
|
|
2457
|
+
class: "pg-grid-card",
|
|
2458
|
+
label: c.value,
|
|
2459
|
+
caption: a.value,
|
|
2460
|
+
icon: Zo
|
|
2461
|
+
};
|
|
2462
|
+
return h(ve, u, { default: () => h(In) });
|
|
2463
|
+
}
|
|
2464
|
+
return () => d();
|
|
2465
|
+
}
|
|
2466
|
+
}), di = T({
|
|
2467
|
+
name: "PgAdjustmentsTool",
|
|
2468
|
+
setup(e, { slots: t, emit: s }) {
|
|
2469
|
+
function n() {
|
|
2470
|
+
return h("div", {
|
|
2471
|
+
class: "pg-adjustments-tool"
|
|
2472
|
+
}, [
|
|
2473
|
+
h(wn),
|
|
2474
|
+
h(Dn),
|
|
2475
|
+
h(Mn)
|
|
2476
|
+
]);
|
|
2477
|
+
}
|
|
2478
|
+
return () => n();
|
|
2479
|
+
}
|
|
2480
|
+
}), hi = T({
|
|
2481
|
+
name: "PgAdjustmentsCard",
|
|
2482
|
+
setup(e, { slots: t, emit: s }) {
|
|
2483
|
+
const { lang: n } = M(), r = ge(), { caption: a } = S(r), c = y(() => {
|
|
2484
|
+
var u;
|
|
2485
|
+
return (u = n.value.pg) == null ? void 0 : u.tools.adjustment;
|
|
2486
|
+
});
|
|
2487
|
+
function d() {
|
|
2488
|
+
const u = {
|
|
2489
|
+
class: "pg-adjustments-card",
|
|
2490
|
+
label: c.value,
|
|
2491
|
+
caption: a.value,
|
|
2492
|
+
icon: dn
|
|
2493
|
+
};
|
|
2494
|
+
return h(ve, u, () => [h(di)]);
|
|
2495
|
+
}
|
|
2496
|
+
return () => d();
|
|
2497
|
+
}
|
|
2498
|
+
}), Nn = T({
|
|
2499
|
+
name: "PgOverviewContent",
|
|
2500
|
+
props: {
|
|
2501
|
+
size: { default: "lg", type: String }
|
|
2502
|
+
},
|
|
2503
|
+
setup(e, { slots: t, emit: s }) {
|
|
2504
|
+
const { lang: n } = M(), r = y(
|
|
2505
|
+
() => n.value && n.value.pg ? n.value.pg.overview.title : "s"
|
|
2506
|
+
), a = y(
|
|
2507
|
+
() => n.value && n.value.pg ? n.value.pg.overview.heading : ""
|
|
2508
|
+
);
|
|
2509
|
+
function c() {
|
|
2510
|
+
const u = {
|
|
2511
|
+
class: y(() => ({
|
|
2512
|
+
"pg-overview-content": !0
|
|
2513
|
+
})).value
|
|
2514
|
+
}, f = {}, g = { class: "text-subheading" };
|
|
2515
|
+
return h("div", u, [
|
|
2516
|
+
h("h1", f, r.value),
|
|
2517
|
+
h("div", g, a.value)
|
|
2518
|
+
]);
|
|
2519
|
+
}
|
|
2520
|
+
return () => c();
|
|
2521
|
+
}
|
|
2522
|
+
}), pi = T({
|
|
2523
|
+
name: "PgCards",
|
|
2524
|
+
setup(e, { slots: t, emit: s }) {
|
|
2525
|
+
function n() {
|
|
2526
|
+
return h("div", {
|
|
2527
|
+
class: "pg-cards col q-col-gutter-md q-pa-md",
|
|
2528
|
+
style: "max-width: 1024px;width: 100%;margin: auto;"
|
|
2529
|
+
}, [
|
|
2530
|
+
h("div", { class: "row q-col-gutter-md" }, [
|
|
2531
|
+
h("div", { class: "col-7" }, h(Nn)),
|
|
2532
|
+
h("div", { class: "col-5" }, [h(ni)])
|
|
2533
|
+
]),
|
|
2534
|
+
h("div", { class: "row q-col-gutter-md" }, [
|
|
2535
|
+
h(oi, { class: "col-7" }),
|
|
2536
|
+
h(ri, { class: "col-5" })
|
|
2537
|
+
]),
|
|
2538
|
+
h("div", { class: "row q-col-gutter-md" }, [
|
|
2539
|
+
h(ii, { class: "col-6" }),
|
|
2540
|
+
h(ai, { class: "col-3" }),
|
|
2541
|
+
h(li, { class: "col-3" })
|
|
2542
|
+
]),
|
|
2543
|
+
h("div", { class: "row q-col-gutter-md" }, [
|
|
2544
|
+
h(ci, { class: "col-4" }),
|
|
2545
|
+
h(ui, { class: "col-4" }),
|
|
2546
|
+
h(hi, { class: "col-4" })
|
|
2547
|
+
])
|
|
2548
|
+
]);
|
|
2549
|
+
}
|
|
2550
|
+
return () => n();
|
|
2551
|
+
}
|
|
2552
|
+
}), fi = T({
|
|
2553
|
+
name: "PgAnimatedCount",
|
|
2554
|
+
emits: ["click", "update:modelValue"],
|
|
2555
|
+
setup(e, { slots: t, emit: s }) {
|
|
2556
|
+
const n = Pt(), r = k(), { filtering: a } = S(r), { lang: c } = M(), d = y(() => {
|
|
2557
|
+
var g;
|
|
2558
|
+
return (g = c.value.pg) == null ? void 0 : g.possibilities.title;
|
|
2559
|
+
}), { adjustedCount: u } = S(n);
|
|
2560
|
+
function f() {
|
|
2561
|
+
const g = {
|
|
2562
|
+
class: "pg-animated-count q-pa-sm",
|
|
2563
|
+
style: "font-weight: 900;color: #979797;font-size: 18px;"
|
|
2564
|
+
}, v = {
|
|
2565
|
+
total: u.value,
|
|
2566
|
+
loading: a.value,
|
|
2567
|
+
class: ""
|
|
2568
|
+
};
|
|
2569
|
+
return h("div", g, [
|
|
2570
|
+
h(zo, v),
|
|
2571
|
+
h("span", {}, " " + d.value)
|
|
2572
|
+
]);
|
|
2573
|
+
}
|
|
2574
|
+
return () => f();
|
|
2575
|
+
}
|
|
2576
|
+
}), gi = T({
|
|
2577
|
+
name: "PgBottomButtons",
|
|
2578
|
+
setup(e, { slots: t, emit: s }) {
|
|
2579
|
+
const n = Te(), r = Pt(), a = k(), c = (I) => a.customReset(), d = (I) => n.open(), {
|
|
2580
|
+
filters: u,
|
|
2581
|
+
adjustedCount: f,
|
|
2582
|
+
loading: g,
|
|
2583
|
+
error: v
|
|
2584
|
+
} = S(r), { lang: C } = M(), _ = y(() => {
|
|
2585
|
+
var I;
|
|
2586
|
+
return (I = C.value.pg) == null ? void 0 : I.overview.startLabel;
|
|
2587
|
+
}), D = y(() => {
|
|
2588
|
+
var I;
|
|
2589
|
+
return (I = C.value.pg) == null ? void 0 : I.overview.resetLabel;
|
|
2590
|
+
});
|
|
2591
|
+
Ne(
|
|
2592
|
+
() => u.value,
|
|
2593
|
+
() => {
|
|
2594
|
+
r.fetchForDisplay();
|
|
2595
|
+
},
|
|
2596
|
+
{ immediate: !0 }
|
|
2597
|
+
);
|
|
2598
|
+
function P() {
|
|
2599
|
+
const I = {
|
|
2600
|
+
class: "pg-buttons q-col-gutter-sm q-pa-md row"
|
|
2601
|
+
}, b = {
|
|
2602
|
+
class: "q-px-lg",
|
|
2603
|
+
size: "md",
|
|
2604
|
+
color: "primary",
|
|
2605
|
+
rounded: !0,
|
|
2606
|
+
unelevated: !0
|
|
2607
|
+
}, x = {
|
|
2608
|
+
...b,
|
|
2609
|
+
label: _.value,
|
|
2610
|
+
onClick: d,
|
|
2611
|
+
disabled: g.value,
|
|
2612
|
+
"data-cy": "pg-button-start"
|
|
2613
|
+
}, F = {
|
|
2614
|
+
...b,
|
|
2615
|
+
label: D.value,
|
|
2616
|
+
outline: !0,
|
|
2617
|
+
onClick: c,
|
|
2618
|
+
disabled: g.value,
|
|
2619
|
+
"data-cy": "pg-button-reset"
|
|
2620
|
+
};
|
|
2621
|
+
return h("div", I, [
|
|
2622
|
+
h("div", { class: "col col-sm-auto text-center" }, [
|
|
2623
|
+
h(Oe, F)
|
|
2624
|
+
]),
|
|
2625
|
+
h("div", { class: "col col-sm-auto text-center" }, [
|
|
2626
|
+
h(Oe, x)
|
|
2627
|
+
])
|
|
2628
|
+
]);
|
|
2629
|
+
}
|
|
2630
|
+
return () => P();
|
|
2631
|
+
}
|
|
2632
|
+
}), On = T({
|
|
2633
|
+
name: "PgGridOverlay",
|
|
2634
|
+
setup(e, { slots: t, emit: s }) {
|
|
2635
|
+
const n = It(), r = on(), a = Ie(), {
|
|
2636
|
+
visible: c,
|
|
2637
|
+
spacing: d,
|
|
2638
|
+
horizontal: u,
|
|
2639
|
+
vertical: f
|
|
2640
|
+
} = S(a), g = j({
|
|
2641
|
+
width: 0,
|
|
2642
|
+
height: 0
|
|
2643
|
+
}), v = y(() => {
|
|
2644
|
+
const I = g.value;
|
|
2645
|
+
return I.width < I.height ? I.width : I.height;
|
|
2646
|
+
}), C = y(() => {
|
|
2647
|
+
const I = v.value;
|
|
2648
|
+
return { width: I, height: I };
|
|
2649
|
+
}), _ = y(() => {
|
|
2650
|
+
const I = g.value, b = I.width, x = I.height;
|
|
2651
|
+
let F = 0, le = 0;
|
|
2652
|
+
return b > x && (le = (b - x) / 2), x > b && (F = (x - b) / 2), { top: F, left: le };
|
|
2653
|
+
}), D = (I) => {
|
|
2654
|
+
g.value = I;
|
|
2655
|
+
};
|
|
2656
|
+
bt(() => {
|
|
2657
|
+
console.log("Ext bus exists?", !!r, "id:", r && r.__bus_id), r.$on("resize", D), r.$emit("resize", {
|
|
2658
|
+
width: window.innerWidth,
|
|
2659
|
+
height: window.innerHeight
|
|
2660
|
+
}), g.value = { width: n.screen.width, height: n.screen.height };
|
|
2661
|
+
}), Jt(() => r.$off("resize"));
|
|
2662
|
+
function P() {
|
|
2663
|
+
const I = {
|
|
2664
|
+
class: "pg-grid-overlay",
|
|
2665
|
+
style: "z-index: 8",
|
|
2666
|
+
visible: c.value,
|
|
2667
|
+
lines: d.value,
|
|
2668
|
+
offsetX: u.value / 100,
|
|
2669
|
+
offsetY: f.value / 100,
|
|
2670
|
+
imagePoint: _.value,
|
|
2671
|
+
imageSize: C.value,
|
|
2672
|
+
viewportSize: g.value
|
|
2673
|
+
};
|
|
2674
|
+
return h(Ho, I);
|
|
2675
|
+
}
|
|
2676
|
+
return () => P();
|
|
2677
|
+
}
|
|
2678
|
+
}), mi = T({
|
|
2679
|
+
name: "PgOverviewButtons",
|
|
2680
|
+
setup(e, { slots: t, emit: s }) {
|
|
2681
|
+
function n() {
|
|
2682
|
+
const r = {
|
|
2683
|
+
class: "pg-overview-buttons col-auto bg-white"
|
|
2684
|
+
}, a = {
|
|
2685
|
+
class: "col-sm-6 col-12 column justify-center"
|
|
2686
|
+
}, c = {
|
|
2687
|
+
class: "col-sm-6 col-12"
|
|
2688
|
+
};
|
|
2689
|
+
return h(
|
|
2690
|
+
"div",
|
|
2691
|
+
r,
|
|
2692
|
+
h(
|
|
2693
|
+
"div",
|
|
2694
|
+
{
|
|
2695
|
+
class: "row",
|
|
2696
|
+
style: "max-width: 1024px; margin: auto;"
|
|
2697
|
+
},
|
|
2698
|
+
[
|
|
2699
|
+
h("div", a, h(fi)),
|
|
2700
|
+
h("div", c, h(gi))
|
|
2701
|
+
]
|
|
2702
|
+
)
|
|
2703
|
+
);
|
|
2704
|
+
}
|
|
2705
|
+
return () => n();
|
|
2706
|
+
}
|
|
2707
|
+
}), vi = { class: "column pg-overview full-width q-pt-lg" }, yi = {
|
|
2708
|
+
__name: "PgOverview",
|
|
2709
|
+
setup(e) {
|
|
2710
|
+
return (t, s) => (O(), $("div", vi, [
|
|
2711
|
+
B(A(On)),
|
|
2712
|
+
B(A(pi), { class: "col full-height gt-sm" }),
|
|
2713
|
+
B(A(Nn), {
|
|
2714
|
+
class: "lt-md",
|
|
2715
|
+
style: { height: "200px" }
|
|
2716
|
+
}),
|
|
2717
|
+
B(A(si), {
|
|
2718
|
+
class: "lt-md",
|
|
2719
|
+
style: { "z-index": "9" }
|
|
2720
|
+
}),
|
|
2721
|
+
B(A(mi))
|
|
2722
|
+
]));
|
|
2723
|
+
}
|
|
2724
|
+
}, Ei = T({
|
|
2725
|
+
name: "PgExitButton",
|
|
2726
|
+
props: {
|
|
2727
|
+
show: {
|
|
2728
|
+
type: Boolean,
|
|
2729
|
+
default: !0
|
|
2730
|
+
}
|
|
2731
|
+
},
|
|
2732
|
+
setup(e, { slots: t, emit: s }) {
|
|
2733
|
+
const n = Te(), { lang: r } = M(), a = y(() => {
|
|
2734
|
+
var u;
|
|
2735
|
+
return (u = r.value.pg) == null ? void 0 : u.buttons.exit.title;
|
|
2736
|
+
}), c = (u) => u.preventDefault();
|
|
2737
|
+
function d() {
|
|
2738
|
+
const u = {
|
|
2739
|
+
style: "z-index: 1800; transform: translate(0, 0)",
|
|
2740
|
+
position: "top-right",
|
|
2741
|
+
offset: [18, 18]
|
|
2742
|
+
}, f = {
|
|
2743
|
+
class: "pg-button-exit",
|
|
2744
|
+
"data-cy": "pg-button-exit",
|
|
2745
|
+
label: a.value,
|
|
2746
|
+
icon: Qo,
|
|
2747
|
+
onClick: n.close,
|
|
2748
|
+
color: "primary",
|
|
2749
|
+
onKeyup: c,
|
|
2750
|
+
rounded: !0,
|
|
2751
|
+
unelevated: !0,
|
|
2752
|
+
outline: !0,
|
|
2753
|
+
style: "background-color: #fff!important"
|
|
2754
|
+
};
|
|
2755
|
+
return h(
|
|
2756
|
+
qt,
|
|
2757
|
+
{ name: "fade" },
|
|
2758
|
+
() => vt(
|
|
2759
|
+
h(Ro, u, () => [h(Oe, f)]),
|
|
2760
|
+
[[yt, e.show]]
|
|
2761
|
+
)
|
|
2762
|
+
);
|
|
2763
|
+
}
|
|
2764
|
+
return () => d();
|
|
2765
|
+
}
|
|
2766
|
+
}), ss = T({
|
|
2767
|
+
name: "PgBaseButton",
|
|
2768
|
+
props: {
|
|
2769
|
+
type: String,
|
|
2770
|
+
disable: Boolean,
|
|
2771
|
+
icon: String,
|
|
2772
|
+
outline: Boolean
|
|
2773
|
+
},
|
|
2774
|
+
emits: ["click"],
|
|
2775
|
+
setup(e, { slots: t, emit: s }) {
|
|
2776
|
+
function n() {
|
|
2777
|
+
const r = {
|
|
2778
|
+
class: `pg-base-button pg-${e.type}-button`,
|
|
2779
|
+
onClick: () => s("click"),
|
|
2780
|
+
disabled: e.disable,
|
|
2781
|
+
icon: e.icon,
|
|
2782
|
+
outline: e.outline,
|
|
2783
|
+
unelevated: !0,
|
|
2784
|
+
flat: !e.outline,
|
|
2785
|
+
round: !0
|
|
2786
|
+
};
|
|
2787
|
+
return h("div", {}, [
|
|
2788
|
+
h(Oe, r, { default: () => {
|
|
2789
|
+
var a;
|
|
2790
|
+
return (a = t.default) == null ? void 0 : a.call(t);
|
|
2791
|
+
} })
|
|
2792
|
+
]);
|
|
2793
|
+
}
|
|
2794
|
+
return () => n();
|
|
2795
|
+
}
|
|
2796
|
+
}), Si = T({
|
|
2797
|
+
name: "PgNextButton",
|
|
2798
|
+
setup(e, { slots: t, emit: s }) {
|
|
2799
|
+
const n = Te(), { nextDisabled: r } = S(n);
|
|
2800
|
+
function a() {
|
|
2801
|
+
const c = {
|
|
2802
|
+
type: "next",
|
|
2803
|
+
icon: $r,
|
|
2804
|
+
onClick: n.next,
|
|
2805
|
+
disable: r.value
|
|
2806
|
+
};
|
|
2807
|
+
return h(ss, c);
|
|
2808
|
+
}
|
|
2809
|
+
return () => a();
|
|
2810
|
+
}
|
|
2811
|
+
}), Ti = T({
|
|
2812
|
+
name: "PgNextButton",
|
|
2813
|
+
setup(e, { slots: t, emit: s }) {
|
|
2814
|
+
const n = he(), r = Z(), { milliseconds: a } = S(n), { duration: c } = S(r), d = Te(), { playing: u } = S(n), f = y(() => u.value ? Ko : Jo), g = () => u.value ? d.pause() : d.play();
|
|
2815
|
+
function v() {
|
|
2816
|
+
const C = {
|
|
2817
|
+
type: "play",
|
|
2818
|
+
icon: f.value,
|
|
2819
|
+
outline: !0,
|
|
2820
|
+
onClick: g
|
|
2821
|
+
}, _ = {
|
|
2822
|
+
class: "pg-timer-progress",
|
|
2823
|
+
min: 0,
|
|
2824
|
+
max: (c.value - 1) * 1e3,
|
|
2825
|
+
value: a.value,
|
|
2826
|
+
size: "42px",
|
|
2827
|
+
color: "primary",
|
|
2828
|
+
thickness: 0.2,
|
|
2829
|
+
instantFeedback: !0
|
|
2830
|
+
};
|
|
2831
|
+
return h(ss, C, () => [h(Bo, _)]);
|
|
2832
|
+
}
|
|
2833
|
+
return () => v();
|
|
2834
|
+
}
|
|
2835
|
+
}), Ci = T({
|
|
2836
|
+
name: "PgPreviousButton",
|
|
2837
|
+
setup(e, { slots: t, emit: s }) {
|
|
2838
|
+
const n = Te(), { previousDisabled: r } = S(n);
|
|
2839
|
+
function a() {
|
|
2840
|
+
const c = {
|
|
2841
|
+
type: "previous",
|
|
2842
|
+
icon: Br,
|
|
2843
|
+
onClick: n.previous,
|
|
2844
|
+
disable: r.value
|
|
2845
|
+
};
|
|
2846
|
+
return h(ss, c);
|
|
2847
|
+
}
|
|
2848
|
+
return () => a();
|
|
2849
|
+
}
|
|
2850
|
+
}), _i = T({
|
|
2851
|
+
name: "PgTimer",
|
|
2852
|
+
setup(e, { slots: t, emit: s }) {
|
|
2853
|
+
const n = he(), r = Z(), { formatted: a, milliseconds: c } = S(n), { duration: d } = S(r), u = y(() => {
|
|
2854
|
+
let C = d.value * 1e3 - 300, _ = d.value * 1e3 - 600;
|
|
2855
|
+
return c.value < C && c.value > _;
|
|
2856
|
+
}), f = y(() => {
|
|
2857
|
+
let C = 40;
|
|
2858
|
+
return d.value > 60 && (C = 65), d.value >= 600 && (C = 85), { width: `${C}px` };
|
|
2859
|
+
}), g = y(() => ({
|
|
2860
|
+
"pg-timer-seconds": !0,
|
|
2861
|
+
flash: u.value
|
|
2862
|
+
}));
|
|
2863
|
+
function v() {
|
|
2864
|
+
const C = {
|
|
2865
|
+
class: g.value,
|
|
2866
|
+
style: f.value
|
|
2867
|
+
};
|
|
2868
|
+
return h("div", C, a.value);
|
|
2869
|
+
}
|
|
2870
|
+
return () => v();
|
|
2871
|
+
}
|
|
2872
|
+
}), kn = T({
|
|
2873
|
+
name: "PgControls",
|
|
2874
|
+
props: { center: Boolean },
|
|
2875
|
+
setup(e, { slots: t, emit: s }) {
|
|
2876
|
+
function n() {
|
|
2877
|
+
const r = {
|
|
2878
|
+
class: "pg-controls row q-gutter-xs position-relative"
|
|
2879
|
+
};
|
|
2880
|
+
e.center && (r.class = r.class + " justify-center");
|
|
2881
|
+
const a = [];
|
|
2882
|
+
return a.push(h(Ci)), a.push(h(Ti)), a.push(h(Si)), a.push(h(_i)), h("div", r, a);
|
|
2883
|
+
}
|
|
2884
|
+
return () => n();
|
|
2885
|
+
}
|
|
2886
|
+
}), Ln = T({
|
|
2887
|
+
name: "PgView360",
|
|
2888
|
+
setup(e, { slots: t, emit: s }) {
|
|
2889
|
+
const n = X(), { lang: r } = M(), a = y(() => {
|
|
2890
|
+
var d;
|
|
2891
|
+
return (d = r.value.pg) == null ? void 0 : d.buttons.view360.title;
|
|
2892
|
+
});
|
|
2893
|
+
function c() {
|
|
2894
|
+
const { view360Path: d } = S(n), u = {
|
|
2895
|
+
class: "pg-view360",
|
|
2896
|
+
"data-cy": "pg-button-view360",
|
|
2897
|
+
label: a.value,
|
|
2898
|
+
to: d.value,
|
|
2899
|
+
rounded: !0,
|
|
2900
|
+
outline: !0,
|
|
2901
|
+
color: "primary"
|
|
2902
|
+
};
|
|
2903
|
+
return h(Oe, u);
|
|
2904
|
+
}
|
|
2905
|
+
return () => c();
|
|
2906
|
+
}
|
|
2907
|
+
}), Vn = T({
|
|
2908
|
+
name: "PgPlayExpansions",
|
|
2909
|
+
setup(e, { slots: t, emit: s }) {
|
|
2910
|
+
const n = It();
|
|
2911
|
+
function r() {
|
|
2912
|
+
const a = j(n.platform.is.desktop), c = {
|
|
2913
|
+
class: "pg-play-expansions"
|
|
2914
|
+
}, d = [];
|
|
2915
|
+
return a.value && (d.push(h(En, { playMode: !0 })), d.push(h(J))), d.push(h(Tn, { playMode: !0 })), d.push(h(J)), d.push(h(Pn, { playMode: !0 })), d.push(h(J)), d.push(h(An, { playMode: !0 })), a.value && d.push(h("div", { class: "q-pa-lg" }, [h(Ln)])), h("div", c, d);
|
|
2916
|
+
}
|
|
2917
|
+
return () => r();
|
|
2918
|
+
}
|
|
2919
|
+
}), bi = T({
|
|
2920
|
+
name: "PgModalControls",
|
|
2921
|
+
props: {
|
|
2922
|
+
modelValue: Boolean,
|
|
2923
|
+
"onUpdate:modelValue": [Function, Array]
|
|
2924
|
+
},
|
|
2925
|
+
emits: ["update:modelValue"],
|
|
2926
|
+
setup(e, { slots: t, emit: s }) {
|
|
2927
|
+
const n = y({
|
|
2928
|
+
get: () => e.modelValue,
|
|
2929
|
+
set: (a) => s("update:modelValue", a)
|
|
2930
|
+
});
|
|
2931
|
+
function r() {
|
|
2932
|
+
const a = {
|
|
2933
|
+
class: "pg-modal-controls",
|
|
2934
|
+
modelValue: n.value,
|
|
2935
|
+
topOffset: 80,
|
|
2936
|
+
"onUpdate:modelValue": (c) => n.value = c
|
|
2937
|
+
};
|
|
2938
|
+
return h(Fo, a, {
|
|
2939
|
+
default: () => h(kn),
|
|
2940
|
+
expanded: () => h(Vn)
|
|
2941
|
+
});
|
|
2942
|
+
}
|
|
2943
|
+
return () => r();
|
|
2944
|
+
}
|
|
2945
|
+
}), Ii = ["src"], Pi = {
|
|
2946
|
+
__name: "PgDisplayImage",
|
|
2947
|
+
props: {
|
|
2948
|
+
flipped: Boolean,
|
|
2949
|
+
zIndex: Number
|
|
2950
|
+
},
|
|
2951
|
+
setup(e) {
|
|
2952
|
+
const t = X(), s = on(), n = e, r = y(() => t.playSrc), a = j(null), c = y(() => {
|
|
2953
|
+
const f = {
|
|
2954
|
+
// ...filterStyle.value,
|
|
2955
|
+
zIndex: n.zIndex + 2
|
|
2956
|
+
};
|
|
2957
|
+
if (a.value === null)
|
|
2958
|
+
return f;
|
|
2959
|
+
const g = a.value ? "auto" : "100%", v = a.value ? "100%" : "auto";
|
|
2960
|
+
return {
|
|
2961
|
+
...f,
|
|
2962
|
+
width: g,
|
|
2963
|
+
height: v
|
|
2964
|
+
};
|
|
2965
|
+
}), d = (f) => {
|
|
2966
|
+
a.value = f.width > f.height;
|
|
2967
|
+
};
|
|
2968
|
+
function u() {
|
|
2969
|
+
const f = window, g = document, v = g.documentElement, C = g.getElementsByTagName("body")[0], _ = f.innerWidth || v.clientWidth || C.clientWidth, D = f.innerHeight || v.clientHeight || C.clientHeight;
|
|
2970
|
+
d({ width: _, height: D });
|
|
2971
|
+
}
|
|
2972
|
+
return bt(() => {
|
|
2973
|
+
u(), s.$on("resize", d);
|
|
2974
|
+
}), Jt(() => s.$off("resize")), (f, g) => (O(), $("img", {
|
|
2975
|
+
src: r.value,
|
|
2976
|
+
class: mt(["pg-display-image", { "flip-horizontal": e.flipped }]),
|
|
2977
|
+
style: nn(c.value)
|
|
2978
|
+
}, null, 14, Ii));
|
|
2979
|
+
}
|
|
2980
|
+
}, xi = {
|
|
2981
|
+
__name: "PgDisplay",
|
|
2982
|
+
setup(e) {
|
|
2983
|
+
const t = ge(), s = X();
|
|
2984
|
+
Pe();
|
|
2985
|
+
const n = R(), { playSelected: r } = S(n), { brightness: a, contrast: c, saturate: d } = S(t), { filterStyle: u } = Mo({
|
|
2986
|
+
brightness: a,
|
|
2987
|
+
contrast: c,
|
|
2988
|
+
saturate: d,
|
|
2989
|
+
noTranslate: !0
|
|
2990
|
+
}), f = y(() => ({
|
|
2991
|
+
...u.value,
|
|
2992
|
+
backgroundColor: r.value === 3 ? "#000000" : "#ffffff"
|
|
2993
|
+
})), { current: g } = S(s), v = j([]), C = j(1);
|
|
2994
|
+
return Ne(
|
|
2995
|
+
() => {
|
|
2996
|
+
var _, D, P;
|
|
2997
|
+
return [(_ = g.value) == null ? void 0 : _.id, (D = g.value) == null ? void 0 : D.src, (P = g.value) == null ? void 0 : P.status];
|
|
2998
|
+
},
|
|
2999
|
+
([_, D, P], I, b) => {
|
|
3000
|
+
if (!(P === gn && D)) return;
|
|
3001
|
+
const x = _.split("."), F = _ ?? `${D}#${Date.now()}`;
|
|
3002
|
+
v.value = [
|
|
3003
|
+
...v.value,
|
|
3004
|
+
{ key: F, src: D, zIndex: C.value, flipped: x[2] === "1" }
|
|
3005
|
+
], C.value++, v.value.length > 1 && (v.value = v.value.slice(-1));
|
|
3006
|
+
},
|
|
3007
|
+
{ immediate: !0 }
|
|
3008
|
+
), (_, D) => (O(), $("div", {
|
|
3009
|
+
class: "pg-display",
|
|
3010
|
+
style: nn(f.value)
|
|
3011
|
+
}, [
|
|
3012
|
+
B(_o, { name: "pgfade" }, {
|
|
3013
|
+
default: jt(() => [
|
|
3014
|
+
(O(!0), $(Xe, null, Ze(v.value, (P, I) => (O(), _t(Pi, {
|
|
3015
|
+
key: P.key,
|
|
3016
|
+
zIndex: parseInt(P.zIndex),
|
|
3017
|
+
flipped: P.flipped
|
|
3018
|
+
}, null, 8, ["zIndex", "flipped"]))), 128))
|
|
3019
|
+
]),
|
|
3020
|
+
_: 1
|
|
3021
|
+
})
|
|
3022
|
+
], 4));
|
|
3023
|
+
}
|
|
3024
|
+
};
|
|
3025
|
+
var Ht = { exports: {} };
|
|
3026
|
+
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
3027
|
+
* http://hammerjs.github.io/
|
|
3028
|
+
*
|
|
3029
|
+
* Copyright (c) 2016 Jorik Tangelder;
|
|
3030
|
+
* Licensed under the MIT license */
|
|
3031
|
+
var Hs;
|
|
3032
|
+
function wi() {
|
|
3033
|
+
return Hs || (Hs = 1, (function(e) {
|
|
3034
|
+
(function(t, s, n, r) {
|
|
3035
|
+
var a = ["", "webkit", "Moz", "MS", "ms", "o"], c = s.createElement("div"), d = "function", u = Math.round, f = Math.abs, g = Date.now;
|
|
3036
|
+
function v(o, i, l) {
|
|
3037
|
+
return setTimeout(F(o, l), i);
|
|
3038
|
+
}
|
|
3039
|
+
function C(o, i, l) {
|
|
3040
|
+
return Array.isArray(o) ? (_(o, l[i], l), !0) : !1;
|
|
3041
|
+
}
|
|
3042
|
+
function _(o, i, l) {
|
|
3043
|
+
var p;
|
|
3044
|
+
if (o)
|
|
3045
|
+
if (o.forEach)
|
|
3046
|
+
o.forEach(i, l);
|
|
3047
|
+
else if (o.length !== r)
|
|
3048
|
+
for (p = 0; p < o.length; )
|
|
3049
|
+
i.call(l, o[p], p, o), p++;
|
|
3050
|
+
else
|
|
3051
|
+
for (p in o)
|
|
3052
|
+
o.hasOwnProperty(p) && i.call(l, o[p], p, o);
|
|
3053
|
+
}
|
|
3054
|
+
function D(o, i, l) {
|
|
3055
|
+
var p = "DEPRECATED METHOD: " + i + `
|
|
3056
|
+
` + l + ` AT
|
|
3057
|
+
`;
|
|
3058
|
+
return function() {
|
|
3059
|
+
var m = new Error("get-stack-trace"), E = m && m.stack ? m.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", w = t.console && (t.console.warn || t.console.log);
|
|
3060
|
+
return w && w.call(t.console, p, E), o.apply(this, arguments);
|
|
3061
|
+
};
|
|
3062
|
+
}
|
|
3063
|
+
var P;
|
|
3064
|
+
typeof Object.assign != "function" ? P = function(i) {
|
|
3065
|
+
if (i === r || i === null)
|
|
3066
|
+
throw new TypeError("Cannot convert undefined or null to object");
|
|
3067
|
+
for (var l = Object(i), p = 1; p < arguments.length; p++) {
|
|
3068
|
+
var m = arguments[p];
|
|
3069
|
+
if (m !== r && m !== null)
|
|
3070
|
+
for (var E in m)
|
|
3071
|
+
m.hasOwnProperty(E) && (l[E] = m[E]);
|
|
3072
|
+
}
|
|
3073
|
+
return l;
|
|
3074
|
+
} : P = Object.assign;
|
|
3075
|
+
var I = D(function(i, l, p) {
|
|
3076
|
+
for (var m = Object.keys(l), E = 0; E < m.length; )
|
|
3077
|
+
(!p || p && i[m[E]] === r) && (i[m[E]] = l[m[E]]), E++;
|
|
3078
|
+
return i;
|
|
3079
|
+
}, "extend", "Use `assign`."), b = D(function(i, l) {
|
|
3080
|
+
return I(i, l, !0);
|
|
3081
|
+
}, "merge", "Use `assign`.");
|
|
3082
|
+
function x(o, i, l) {
|
|
3083
|
+
var p = i.prototype, m;
|
|
3084
|
+
m = o.prototype = Object.create(p), m.constructor = o, m._super = p, l && P(m, l);
|
|
3085
|
+
}
|
|
3086
|
+
function F(o, i) {
|
|
3087
|
+
return function() {
|
|
3088
|
+
return o.apply(i, arguments);
|
|
3089
|
+
};
|
|
3090
|
+
}
|
|
3091
|
+
function le(o, i) {
|
|
3092
|
+
return typeof o == d ? o.apply(i && i[0] || r, i) : o;
|
|
3093
|
+
}
|
|
3094
|
+
function Ve(o, i) {
|
|
3095
|
+
return o === r ? i : o;
|
|
3096
|
+
}
|
|
3097
|
+
function ye(o, i, l) {
|
|
3098
|
+
_(Je(i), function(p) {
|
|
3099
|
+
o.addEventListener(p, l, !1);
|
|
3100
|
+
});
|
|
3101
|
+
}
|
|
3102
|
+
function Q(o, i, l) {
|
|
3103
|
+
_(Je(i), function(p) {
|
|
3104
|
+
o.removeEventListener(p, l, !1);
|
|
3105
|
+
});
|
|
3106
|
+
}
|
|
3107
|
+
function ce(o, i) {
|
|
3108
|
+
for (; o; ) {
|
|
3109
|
+
if (o == i)
|
|
3110
|
+
return !0;
|
|
3111
|
+
o = o.parentNode;
|
|
3112
|
+
}
|
|
3113
|
+
return !1;
|
|
3114
|
+
}
|
|
3115
|
+
function G(o, i) {
|
|
3116
|
+
return o.indexOf(i) > -1;
|
|
3117
|
+
}
|
|
3118
|
+
function Je(o) {
|
|
3119
|
+
return o.trim().split(/\s+/g);
|
|
3120
|
+
}
|
|
3121
|
+
function xe(o, i, l) {
|
|
3122
|
+
if (o.indexOf && !l)
|
|
3123
|
+
return o.indexOf(i);
|
|
3124
|
+
for (var p = 0; p < o.length; ) {
|
|
3125
|
+
if (l && o[p][l] == i || !l && o[p] === i)
|
|
3126
|
+
return p;
|
|
3127
|
+
p++;
|
|
3128
|
+
}
|
|
3129
|
+
return -1;
|
|
3130
|
+
}
|
|
3131
|
+
function et(o) {
|
|
3132
|
+
return Array.prototype.slice.call(o, 0);
|
|
3133
|
+
}
|
|
3134
|
+
function os(o, i, l) {
|
|
3135
|
+
for (var p = [], m = [], E = 0; E < o.length; ) {
|
|
3136
|
+
var w = o[E][i];
|
|
3137
|
+
xe(m, w) < 0 && p.push(o[E]), m[E] = w, E++;
|
|
3138
|
+
}
|
|
3139
|
+
return p = p.sort(function(U, H) {
|
|
3140
|
+
return U[i] > H[i];
|
|
3141
|
+
}), p;
|
|
3142
|
+
}
|
|
3143
|
+
function tt(o, i) {
|
|
3144
|
+
for (var l, p, m = i[0].toUpperCase() + i.slice(1), E = 0; E < a.length; ) {
|
|
3145
|
+
if (l = a[E], p = l ? l + m : i, p in o)
|
|
3146
|
+
return p;
|
|
3147
|
+
E++;
|
|
3148
|
+
}
|
|
3149
|
+
return r;
|
|
3150
|
+
}
|
|
3151
|
+
var Bn = 1;
|
|
3152
|
+
function $n() {
|
|
3153
|
+
return Bn++;
|
|
3154
|
+
}
|
|
3155
|
+
function rs(o) {
|
|
3156
|
+
var i = o.ownerDocument || o;
|
|
3157
|
+
return i.defaultView || i.parentWindow || t;
|
|
3158
|
+
}
|
|
3159
|
+
var zn = /mobile|tablet|ip(ad|hone|od)|android/i, is = "ontouchstart" in t, Hn = tt(t, "PointerEvent") !== r, Fn = is && zn.test(navigator.userAgent), Ue = "touch", qn = "pen", Dt = "mouse", jn = "kinect", Gn = 25, z = 1, Ce = 2, N = 4, q = 8, st = 1, Re = 2, Be = 4, $e = 8, ze = 16, te = Re | Be, _e = $e | ze, as = te | _e, ls = ["x", "y"], nt = ["clientX", "clientY"];
|
|
3160
|
+
function Y(o, i) {
|
|
3161
|
+
var l = this;
|
|
3162
|
+
this.manager = o, this.callback = i, this.element = o.element, this.target = o.options.inputTarget, this.domHandler = function(p) {
|
|
3163
|
+
le(o.options.enable, [o]) && l.handler(p);
|
|
3164
|
+
}, this.init();
|
|
3165
|
+
}
|
|
3166
|
+
Y.prototype = {
|
|
3167
|
+
/**
|
|
3168
|
+
* should handle the inputEvent data and trigger the callback
|
|
3169
|
+
* @virtual
|
|
3170
|
+
*/
|
|
3171
|
+
handler: function() {
|
|
3172
|
+
},
|
|
3173
|
+
/**
|
|
3174
|
+
* bind the events
|
|
3175
|
+
*/
|
|
3176
|
+
init: function() {
|
|
3177
|
+
this.evEl && ye(this.element, this.evEl, this.domHandler), this.evTarget && ye(this.target, this.evTarget, this.domHandler), this.evWin && ye(rs(this.element), this.evWin, this.domHandler);
|
|
3178
|
+
},
|
|
3179
|
+
/**
|
|
3180
|
+
* unbind the events
|
|
3181
|
+
*/
|
|
3182
|
+
destroy: function() {
|
|
3183
|
+
this.evEl && Q(this.element, this.evEl, this.domHandler), this.evTarget && Q(this.target, this.evTarget, this.domHandler), this.evWin && Q(rs(this.element), this.evWin, this.domHandler);
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
function Yn(o) {
|
|
3187
|
+
var i, l = o.options.inputClass;
|
|
3188
|
+
return l ? i = l : Hn ? i = At : Fn ? i = it : is ? i = Nt : i = rt, new i(o, Wn);
|
|
3189
|
+
}
|
|
3190
|
+
function Wn(o, i, l) {
|
|
3191
|
+
var p = l.pointers.length, m = l.changedPointers.length, E = i & z && p - m === 0, w = i & (N | q) && p - m === 0;
|
|
3192
|
+
l.isFirst = !!E, l.isFinal = !!w, E && (o.session = {}), l.eventType = i, Xn(o, l), o.emit("hammer.input", l), o.recognize(l), o.session.prevInput = l;
|
|
3193
|
+
}
|
|
3194
|
+
function Xn(o, i) {
|
|
3195
|
+
var l = o.session, p = i.pointers, m = p.length;
|
|
3196
|
+
l.firstInput || (l.firstInput = cs(i)), m > 1 && !l.firstMultiple ? l.firstMultiple = cs(i) : m === 1 && (l.firstMultiple = !1);
|
|
3197
|
+
var E = l.firstInput, w = l.firstMultiple, L = w ? w.center : E.center, U = i.center = us(p);
|
|
3198
|
+
i.timeStamp = g(), i.deltaTime = i.timeStamp - E.timeStamp, i.angle = Mt(L, U), i.distance = ot(L, U), Zn(l, i), i.offsetDirection = hs(i.deltaX, i.deltaY);
|
|
3199
|
+
var H = ds(i.deltaTime, i.deltaX, i.deltaY);
|
|
3200
|
+
i.overallVelocityX = H.x, i.overallVelocityY = H.y, i.overallVelocity = f(H.x) > f(H.y) ? H.x : H.y, i.scale = w ? Jn(w.pointers, p) : 1, i.rotation = w ? Kn(w.pointers, p) : 0, i.maxPointers = l.prevInput ? i.pointers.length > l.prevInput.maxPointers ? i.pointers.length : l.prevInput.maxPointers : i.pointers.length, Qn(l, i);
|
|
3201
|
+
var ne = o.element;
|
|
3202
|
+
ce(i.srcEvent.target, ne) && (ne = i.srcEvent.target), i.target = ne;
|
|
3203
|
+
}
|
|
3204
|
+
function Zn(o, i) {
|
|
3205
|
+
var l = i.center, p = o.offsetDelta || {}, m = o.prevDelta || {}, E = o.prevInput || {};
|
|
3206
|
+
(i.eventType === z || E.eventType === N) && (m = o.prevDelta = {
|
|
3207
|
+
x: E.deltaX || 0,
|
|
3208
|
+
y: E.deltaY || 0
|
|
3209
|
+
}, p = o.offsetDelta = {
|
|
3210
|
+
x: l.x,
|
|
3211
|
+
y: l.y
|
|
3212
|
+
}), i.deltaX = m.x + (l.x - p.x), i.deltaY = m.y + (l.y - p.y);
|
|
3213
|
+
}
|
|
3214
|
+
function Qn(o, i) {
|
|
3215
|
+
var l = o.lastInterval || i, p = i.timeStamp - l.timeStamp, m, E, w, L;
|
|
3216
|
+
if (i.eventType != q && (p > Gn || l.velocity === r)) {
|
|
3217
|
+
var U = i.deltaX - l.deltaX, H = i.deltaY - l.deltaY, ne = ds(p, U, H);
|
|
3218
|
+
E = ne.x, w = ne.y, m = f(ne.x) > f(ne.y) ? ne.x : ne.y, L = hs(U, H), o.lastInterval = i;
|
|
3219
|
+
} else
|
|
3220
|
+
m = l.velocity, E = l.velocityX, w = l.velocityY, L = l.direction;
|
|
3221
|
+
i.velocity = m, i.velocityX = E, i.velocityY = w, i.direction = L;
|
|
3222
|
+
}
|
|
3223
|
+
function cs(o) {
|
|
3224
|
+
for (var i = [], l = 0; l < o.pointers.length; )
|
|
3225
|
+
i[l] = {
|
|
3226
|
+
clientX: u(o.pointers[l].clientX),
|
|
3227
|
+
clientY: u(o.pointers[l].clientY)
|
|
3228
|
+
}, l++;
|
|
3229
|
+
return {
|
|
3230
|
+
timeStamp: g(),
|
|
3231
|
+
pointers: i,
|
|
3232
|
+
center: us(i),
|
|
3233
|
+
deltaX: o.deltaX,
|
|
3234
|
+
deltaY: o.deltaY
|
|
3235
|
+
};
|
|
3236
|
+
}
|
|
3237
|
+
function us(o) {
|
|
3238
|
+
var i = o.length;
|
|
3239
|
+
if (i === 1)
|
|
3240
|
+
return {
|
|
3241
|
+
x: u(o[0].clientX),
|
|
3242
|
+
y: u(o[0].clientY)
|
|
3243
|
+
};
|
|
3244
|
+
for (var l = 0, p = 0, m = 0; m < i; )
|
|
3245
|
+
l += o[m].clientX, p += o[m].clientY, m++;
|
|
3246
|
+
return {
|
|
3247
|
+
x: u(l / i),
|
|
3248
|
+
y: u(p / i)
|
|
3249
|
+
};
|
|
3250
|
+
}
|
|
3251
|
+
function ds(o, i, l) {
|
|
3252
|
+
return {
|
|
3253
|
+
x: i / o || 0,
|
|
3254
|
+
y: l / o || 0
|
|
3255
|
+
};
|
|
3256
|
+
}
|
|
3257
|
+
function hs(o, i) {
|
|
3258
|
+
return o === i ? st : f(o) >= f(i) ? o < 0 ? Re : Be : i < 0 ? $e : ze;
|
|
3259
|
+
}
|
|
3260
|
+
function ot(o, i, l) {
|
|
3261
|
+
l || (l = ls);
|
|
3262
|
+
var p = i[l[0]] - o[l[0]], m = i[l[1]] - o[l[1]];
|
|
3263
|
+
return Math.sqrt(p * p + m * m);
|
|
3264
|
+
}
|
|
3265
|
+
function Mt(o, i, l) {
|
|
3266
|
+
l || (l = ls);
|
|
3267
|
+
var p = i[l[0]] - o[l[0]], m = i[l[1]] - o[l[1]];
|
|
3268
|
+
return Math.atan2(m, p) * 180 / Math.PI;
|
|
3269
|
+
}
|
|
3270
|
+
function Kn(o, i) {
|
|
3271
|
+
return Mt(i[1], i[0], nt) + Mt(o[1], o[0], nt);
|
|
3272
|
+
}
|
|
3273
|
+
function Jn(o, i) {
|
|
3274
|
+
return ot(i[0], i[1], nt) / ot(o[0], o[1], nt);
|
|
3275
|
+
}
|
|
3276
|
+
var eo = {
|
|
3277
|
+
mousedown: z,
|
|
3278
|
+
mousemove: Ce,
|
|
3279
|
+
mouseup: N
|
|
3280
|
+
}, to = "mousedown", so = "mousemove mouseup";
|
|
3281
|
+
function rt() {
|
|
3282
|
+
this.evEl = to, this.evWin = so, this.pressed = !1, Y.apply(this, arguments);
|
|
3283
|
+
}
|
|
3284
|
+
x(rt, Y, {
|
|
3285
|
+
/**
|
|
3286
|
+
* handle mouse events
|
|
3287
|
+
* @param {Object} ev
|
|
3288
|
+
*/
|
|
3289
|
+
handler: function(i) {
|
|
3290
|
+
var l = eo[i.type];
|
|
3291
|
+
l & z && i.button === 0 && (this.pressed = !0), l & Ce && i.which !== 1 && (l = N), this.pressed && (l & N && (this.pressed = !1), this.callback(this.manager, l, {
|
|
3292
|
+
pointers: [i],
|
|
3293
|
+
changedPointers: [i],
|
|
3294
|
+
pointerType: Dt,
|
|
3295
|
+
srcEvent: i
|
|
3296
|
+
}));
|
|
3297
|
+
}
|
|
3298
|
+
});
|
|
3299
|
+
var no = {
|
|
3300
|
+
pointerdown: z,
|
|
3301
|
+
pointermove: Ce,
|
|
3302
|
+
pointerup: N,
|
|
3303
|
+
pointercancel: q,
|
|
3304
|
+
pointerout: q
|
|
3305
|
+
}, oo = {
|
|
3306
|
+
2: Ue,
|
|
3307
|
+
3: qn,
|
|
3308
|
+
4: Dt,
|
|
3309
|
+
5: jn
|
|
3310
|
+
// see https://twitter.com/jacobrossi/status/480596438489890816
|
|
3311
|
+
}, ps = "pointerdown", fs = "pointermove pointerup pointercancel";
|
|
3312
|
+
t.MSPointerEvent && !t.PointerEvent && (ps = "MSPointerDown", fs = "MSPointerMove MSPointerUp MSPointerCancel");
|
|
3313
|
+
function At() {
|
|
3314
|
+
this.evEl = ps, this.evWin = fs, Y.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
|
|
3315
|
+
}
|
|
3316
|
+
x(At, Y, {
|
|
3317
|
+
/**
|
|
3318
|
+
* handle mouse events
|
|
3319
|
+
* @param {Object} ev
|
|
3320
|
+
*/
|
|
3321
|
+
handler: function(i) {
|
|
3322
|
+
var l = this.store, p = !1, m = i.type.toLowerCase().replace("ms", ""), E = no[m], w = oo[i.pointerType] || i.pointerType, L = w == Ue, U = xe(l, i.pointerId, "pointerId");
|
|
3323
|
+
E & z && (i.button === 0 || L) ? U < 0 && (l.push(i), U = l.length - 1) : E & (N | q) && (p = !0), !(U < 0) && (l[U] = i, this.callback(this.manager, E, {
|
|
3324
|
+
pointers: l,
|
|
3325
|
+
changedPointers: [i],
|
|
3326
|
+
pointerType: w,
|
|
3327
|
+
srcEvent: i
|
|
3328
|
+
}), p && l.splice(U, 1));
|
|
3329
|
+
}
|
|
3330
|
+
});
|
|
3331
|
+
var ro = {
|
|
3332
|
+
touchstart: z,
|
|
3333
|
+
touchmove: Ce,
|
|
3334
|
+
touchend: N,
|
|
3335
|
+
touchcancel: q
|
|
3336
|
+
}, io = "touchstart", ao = "touchstart touchmove touchend touchcancel";
|
|
3337
|
+
function gs() {
|
|
3338
|
+
this.evTarget = io, this.evWin = ao, this.started = !1, Y.apply(this, arguments);
|
|
3339
|
+
}
|
|
3340
|
+
x(gs, Y, {
|
|
3341
|
+
handler: function(i) {
|
|
3342
|
+
var l = ro[i.type];
|
|
3343
|
+
if (l === z && (this.started = !0), !!this.started) {
|
|
3344
|
+
var p = lo.call(this, i, l);
|
|
3345
|
+
l & (N | q) && p[0].length - p[1].length === 0 && (this.started = !1), this.callback(this.manager, l, {
|
|
3346
|
+
pointers: p[0],
|
|
3347
|
+
changedPointers: p[1],
|
|
3348
|
+
pointerType: Ue,
|
|
3349
|
+
srcEvent: i
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
function lo(o, i) {
|
|
3355
|
+
var l = et(o.touches), p = et(o.changedTouches);
|
|
3356
|
+
return i & (N | q) && (l = os(l.concat(p), "identifier")), [l, p];
|
|
3357
|
+
}
|
|
3358
|
+
var co = {
|
|
3359
|
+
touchstart: z,
|
|
3360
|
+
touchmove: Ce,
|
|
3361
|
+
touchend: N,
|
|
3362
|
+
touchcancel: q
|
|
3363
|
+
}, uo = "touchstart touchmove touchend touchcancel";
|
|
3364
|
+
function it() {
|
|
3365
|
+
this.evTarget = uo, this.targetIds = {}, Y.apply(this, arguments);
|
|
3366
|
+
}
|
|
3367
|
+
x(it, Y, {
|
|
3368
|
+
handler: function(i) {
|
|
3369
|
+
var l = co[i.type], p = ho.call(this, i, l);
|
|
3370
|
+
p && this.callback(this.manager, l, {
|
|
3371
|
+
pointers: p[0],
|
|
3372
|
+
changedPointers: p[1],
|
|
3373
|
+
pointerType: Ue,
|
|
3374
|
+
srcEvent: i
|
|
3375
|
+
});
|
|
3376
|
+
}
|
|
3377
|
+
});
|
|
3378
|
+
function ho(o, i) {
|
|
3379
|
+
var l = et(o.touches), p = this.targetIds;
|
|
3380
|
+
if (i & (z | Ce) && l.length === 1)
|
|
3381
|
+
return p[l[0].identifier] = !0, [l, l];
|
|
3382
|
+
var m, E, w = et(o.changedTouches), L = [], U = this.target;
|
|
3383
|
+
if (E = l.filter(function(H) {
|
|
3384
|
+
return ce(H.target, U);
|
|
3385
|
+
}), i === z)
|
|
3386
|
+
for (m = 0; m < E.length; )
|
|
3387
|
+
p[E[m].identifier] = !0, m++;
|
|
3388
|
+
for (m = 0; m < w.length; )
|
|
3389
|
+
p[w[m].identifier] && L.push(w[m]), i & (N | q) && delete p[w[m].identifier], m++;
|
|
3390
|
+
if (L.length)
|
|
3391
|
+
return [
|
|
3392
|
+
// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
|
|
3393
|
+
os(E.concat(L), "identifier"),
|
|
3394
|
+
L
|
|
3395
|
+
];
|
|
3396
|
+
}
|
|
3397
|
+
var po = 2500, ms = 25;
|
|
3398
|
+
function Nt() {
|
|
3399
|
+
Y.apply(this, arguments);
|
|
3400
|
+
var o = F(this.handler, this);
|
|
3401
|
+
this.touch = new it(this.manager, o), this.mouse = new rt(this.manager, o), this.primaryTouch = null, this.lastTouches = [];
|
|
3402
|
+
}
|
|
3403
|
+
x(Nt, Y, {
|
|
3404
|
+
/**
|
|
3405
|
+
* handle mouse and touch events
|
|
3406
|
+
* @param {Hammer} manager
|
|
3407
|
+
* @param {String} inputEvent
|
|
3408
|
+
* @param {Object} inputData
|
|
3409
|
+
*/
|
|
3410
|
+
handler: function(i, l, p) {
|
|
3411
|
+
var m = p.pointerType == Ue, E = p.pointerType == Dt;
|
|
3412
|
+
if (!(E && p.sourceCapabilities && p.sourceCapabilities.firesTouchEvents)) {
|
|
3413
|
+
if (m)
|
|
3414
|
+
fo.call(this, l, p);
|
|
3415
|
+
else if (E && go.call(this, p))
|
|
3416
|
+
return;
|
|
3417
|
+
this.callback(i, l, p);
|
|
3418
|
+
}
|
|
3419
|
+
},
|
|
3420
|
+
/**
|
|
3421
|
+
* remove the event listeners
|
|
3422
|
+
*/
|
|
3423
|
+
destroy: function() {
|
|
3424
|
+
this.touch.destroy(), this.mouse.destroy();
|
|
3425
|
+
}
|
|
3426
|
+
});
|
|
3427
|
+
function fo(o, i) {
|
|
3428
|
+
o & z ? (this.primaryTouch = i.changedPointers[0].identifier, vs.call(this, i)) : o & (N | q) && vs.call(this, i);
|
|
3429
|
+
}
|
|
3430
|
+
function vs(o) {
|
|
3431
|
+
var i = o.changedPointers[0];
|
|
3432
|
+
if (i.identifier === this.primaryTouch) {
|
|
3433
|
+
var l = { x: i.clientX, y: i.clientY };
|
|
3434
|
+
this.lastTouches.push(l);
|
|
3435
|
+
var p = this.lastTouches, m = function() {
|
|
3436
|
+
var E = p.indexOf(l);
|
|
3437
|
+
E > -1 && p.splice(E, 1);
|
|
3438
|
+
};
|
|
3439
|
+
setTimeout(m, po);
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
function go(o) {
|
|
3443
|
+
for (var i = o.srcEvent.clientX, l = o.srcEvent.clientY, p = 0; p < this.lastTouches.length; p++) {
|
|
3444
|
+
var m = this.lastTouches[p], E = Math.abs(i - m.x), w = Math.abs(l - m.y);
|
|
3445
|
+
if (E <= ms && w <= ms)
|
|
3446
|
+
return !0;
|
|
3447
|
+
}
|
|
3448
|
+
return !1;
|
|
3449
|
+
}
|
|
3450
|
+
var ys = tt(c.style, "touchAction"), Es = ys !== r, Ss = "compute", Ts = "auto", Ot = "manipulation", be = "none", He = "pan-x", Fe = "pan-y", at = vo();
|
|
3451
|
+
function kt(o, i) {
|
|
3452
|
+
this.manager = o, this.set(i);
|
|
3453
|
+
}
|
|
3454
|
+
kt.prototype = {
|
|
3455
|
+
/**
|
|
3456
|
+
* set the touchAction value on the element or enable the polyfill
|
|
3457
|
+
* @param {String} value
|
|
3458
|
+
*/
|
|
3459
|
+
set: function(o) {
|
|
3460
|
+
o == Ss && (o = this.compute()), Es && this.manager.element.style && at[o] && (this.manager.element.style[ys] = o), this.actions = o.toLowerCase().trim();
|
|
3461
|
+
},
|
|
3462
|
+
/**
|
|
3463
|
+
* just re-set the touchAction value
|
|
3464
|
+
*/
|
|
3465
|
+
update: function() {
|
|
3466
|
+
this.set(this.manager.options.touchAction);
|
|
3467
|
+
},
|
|
3468
|
+
/**
|
|
3469
|
+
* compute the value for the touchAction property based on the recognizer's settings
|
|
3470
|
+
* @returns {String} value
|
|
3471
|
+
*/
|
|
3472
|
+
compute: function() {
|
|
3473
|
+
var o = [];
|
|
3474
|
+
return _(this.manager.recognizers, function(i) {
|
|
3475
|
+
le(i.options.enable, [i]) && (o = o.concat(i.getTouchAction()));
|
|
3476
|
+
}), mo(o.join(" "));
|
|
3477
|
+
},
|
|
3478
|
+
/**
|
|
3479
|
+
* this method is called on each input cycle and provides the preventing of the browser behavior
|
|
3480
|
+
* @param {Object} input
|
|
3481
|
+
*/
|
|
3482
|
+
preventDefaults: function(o) {
|
|
3483
|
+
var i = o.srcEvent, l = o.offsetDirection;
|
|
3484
|
+
if (this.manager.session.prevented) {
|
|
3485
|
+
i.preventDefault();
|
|
3486
|
+
return;
|
|
3487
|
+
}
|
|
3488
|
+
var p = this.actions, m = G(p, be) && !at[be], E = G(p, Fe) && !at[Fe], w = G(p, He) && !at[He];
|
|
3489
|
+
if (m) {
|
|
3490
|
+
var L = o.pointers.length === 1, U = o.distance < 2, H = o.deltaTime < 250;
|
|
3491
|
+
if (L && U && H)
|
|
3492
|
+
return;
|
|
3493
|
+
}
|
|
3494
|
+
if (!(w && E) && (m || E && l & te || w && l & _e))
|
|
3495
|
+
return this.preventSrc(i);
|
|
3496
|
+
},
|
|
3497
|
+
/**
|
|
3498
|
+
* call preventDefault to prevent the browser's default behavior (scrolling in most cases)
|
|
3499
|
+
* @param {Object} srcEvent
|
|
3500
|
+
*/
|
|
3501
|
+
preventSrc: function(o) {
|
|
3502
|
+
this.manager.session.prevented = !0, o.preventDefault();
|
|
3503
|
+
}
|
|
3504
|
+
};
|
|
3505
|
+
function mo(o) {
|
|
3506
|
+
if (G(o, be))
|
|
3507
|
+
return be;
|
|
3508
|
+
var i = G(o, He), l = G(o, Fe);
|
|
3509
|
+
return i && l ? be : i || l ? i ? He : Fe : G(o, Ot) ? Ot : Ts;
|
|
3510
|
+
}
|
|
3511
|
+
function vo() {
|
|
3512
|
+
if (!Es)
|
|
3513
|
+
return !1;
|
|
3514
|
+
var o = {}, i = t.CSS && t.CSS.supports;
|
|
3515
|
+
return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(l) {
|
|
3516
|
+
o[l] = i ? t.CSS.supports("touch-action", l) : !0;
|
|
3517
|
+
}), o;
|
|
3518
|
+
}
|
|
3519
|
+
var lt = 1, W = 2, we = 4, Ee = 8, ue = Ee, qe = 16, se = 32;
|
|
3520
|
+
function de(o) {
|
|
3521
|
+
this.options = P({}, this.defaults, o || {}), this.id = $n(), this.manager = null, this.options.enable = Ve(this.options.enable, !0), this.state = lt, this.simultaneous = {}, this.requireFail = [];
|
|
3522
|
+
}
|
|
3523
|
+
de.prototype = {
|
|
3524
|
+
/**
|
|
3525
|
+
* @virtual
|
|
3526
|
+
* @type {Object}
|
|
3527
|
+
*/
|
|
3528
|
+
defaults: {},
|
|
3529
|
+
/**
|
|
3530
|
+
* set options
|
|
3531
|
+
* @param {Object} options
|
|
3532
|
+
* @return {Recognizer}
|
|
3533
|
+
*/
|
|
3534
|
+
set: function(o) {
|
|
3535
|
+
return P(this.options, o), this.manager && this.manager.touchAction.update(), this;
|
|
3536
|
+
},
|
|
3537
|
+
/**
|
|
3538
|
+
* recognize simultaneous with an other recognizer.
|
|
3539
|
+
* @param {Recognizer} otherRecognizer
|
|
3540
|
+
* @returns {Recognizer} this
|
|
3541
|
+
*/
|
|
3542
|
+
recognizeWith: function(o) {
|
|
3543
|
+
if (C(o, "recognizeWith", this))
|
|
3544
|
+
return this;
|
|
3545
|
+
var i = this.simultaneous;
|
|
3546
|
+
return o = ct(o, this), i[o.id] || (i[o.id] = o, o.recognizeWith(this)), this;
|
|
3547
|
+
},
|
|
3548
|
+
/**
|
|
3549
|
+
* drop the simultaneous link. it doesnt remove the link on the other recognizer.
|
|
3550
|
+
* @param {Recognizer} otherRecognizer
|
|
3551
|
+
* @returns {Recognizer} this
|
|
3552
|
+
*/
|
|
3553
|
+
dropRecognizeWith: function(o) {
|
|
3554
|
+
return C(o, "dropRecognizeWith", this) ? this : (o = ct(o, this), delete this.simultaneous[o.id], this);
|
|
3555
|
+
},
|
|
3556
|
+
/**
|
|
3557
|
+
* recognizer can only run when an other is failing
|
|
3558
|
+
* @param {Recognizer} otherRecognizer
|
|
3559
|
+
* @returns {Recognizer} this
|
|
3560
|
+
*/
|
|
3561
|
+
requireFailure: function(o) {
|
|
3562
|
+
if (C(o, "requireFailure", this))
|
|
3563
|
+
return this;
|
|
3564
|
+
var i = this.requireFail;
|
|
3565
|
+
return o = ct(o, this), xe(i, o) === -1 && (i.push(o), o.requireFailure(this)), this;
|
|
3566
|
+
},
|
|
3567
|
+
/**
|
|
3568
|
+
* drop the requireFailure link. it does not remove the link on the other recognizer.
|
|
3569
|
+
* @param {Recognizer} otherRecognizer
|
|
3570
|
+
* @returns {Recognizer} this
|
|
3571
|
+
*/
|
|
3572
|
+
dropRequireFailure: function(o) {
|
|
3573
|
+
if (C(o, "dropRequireFailure", this))
|
|
3574
|
+
return this;
|
|
3575
|
+
o = ct(o, this);
|
|
3576
|
+
var i = xe(this.requireFail, o);
|
|
3577
|
+
return i > -1 && this.requireFail.splice(i, 1), this;
|
|
3578
|
+
},
|
|
3579
|
+
/**
|
|
3580
|
+
* has require failures boolean
|
|
3581
|
+
* @returns {boolean}
|
|
3582
|
+
*/
|
|
3583
|
+
hasRequireFailures: function() {
|
|
3584
|
+
return this.requireFail.length > 0;
|
|
3585
|
+
},
|
|
3586
|
+
/**
|
|
3587
|
+
* if the recognizer can recognize simultaneous with an other recognizer
|
|
3588
|
+
* @param {Recognizer} otherRecognizer
|
|
3589
|
+
* @returns {Boolean}
|
|
3590
|
+
*/
|
|
3591
|
+
canRecognizeWith: function(o) {
|
|
3592
|
+
return !!this.simultaneous[o.id];
|
|
3593
|
+
},
|
|
3594
|
+
/**
|
|
3595
|
+
* You should use `tryEmit` instead of `emit` directly to check
|
|
3596
|
+
* that all the needed recognizers has failed before emitting.
|
|
3597
|
+
* @param {Object} input
|
|
3598
|
+
*/
|
|
3599
|
+
emit: function(o) {
|
|
3600
|
+
var i = this, l = this.state;
|
|
3601
|
+
function p(m) {
|
|
3602
|
+
i.manager.emit(m, o);
|
|
3603
|
+
}
|
|
3604
|
+
l < Ee && p(i.options.event + Cs(l)), p(i.options.event), o.additionalEvent && p(o.additionalEvent), l >= Ee && p(i.options.event + Cs(l));
|
|
3605
|
+
},
|
|
3606
|
+
/**
|
|
3607
|
+
* Check that all the require failure recognizers has failed,
|
|
3608
|
+
* if true, it emits a gesture event,
|
|
3609
|
+
* otherwise, setup the state to FAILED.
|
|
3610
|
+
* @param {Object} input
|
|
3611
|
+
*/
|
|
3612
|
+
tryEmit: function(o) {
|
|
3613
|
+
if (this.canEmit())
|
|
3614
|
+
return this.emit(o);
|
|
3615
|
+
this.state = se;
|
|
3616
|
+
},
|
|
3617
|
+
/**
|
|
3618
|
+
* can we emit?
|
|
3619
|
+
* @returns {boolean}
|
|
3620
|
+
*/
|
|
3621
|
+
canEmit: function() {
|
|
3622
|
+
for (var o = 0; o < this.requireFail.length; ) {
|
|
3623
|
+
if (!(this.requireFail[o].state & (se | lt)))
|
|
3624
|
+
return !1;
|
|
3625
|
+
o++;
|
|
3626
|
+
}
|
|
3627
|
+
return !0;
|
|
3628
|
+
},
|
|
3629
|
+
/**
|
|
3630
|
+
* update the recognizer
|
|
3631
|
+
* @param {Object} inputData
|
|
3632
|
+
*/
|
|
3633
|
+
recognize: function(o) {
|
|
3634
|
+
var i = P({}, o);
|
|
3635
|
+
if (!le(this.options.enable, [this, i])) {
|
|
3636
|
+
this.reset(), this.state = se;
|
|
3637
|
+
return;
|
|
3638
|
+
}
|
|
3639
|
+
this.state & (ue | qe | se) && (this.state = lt), this.state = this.process(i), this.state & (W | we | Ee | qe) && this.tryEmit(i);
|
|
3640
|
+
},
|
|
3641
|
+
/**
|
|
3642
|
+
* return the state of the recognizer
|
|
3643
|
+
* the actual recognizing happens in this method
|
|
3644
|
+
* @virtual
|
|
3645
|
+
* @param {Object} inputData
|
|
3646
|
+
* @returns {Const} STATE
|
|
3647
|
+
*/
|
|
3648
|
+
process: function(o) {
|
|
3649
|
+
},
|
|
3650
|
+
// jshint ignore:line
|
|
3651
|
+
/**
|
|
3652
|
+
* return the preferred touch-action
|
|
3653
|
+
* @virtual
|
|
3654
|
+
* @returns {Array}
|
|
3655
|
+
*/
|
|
3656
|
+
getTouchAction: function() {
|
|
3657
|
+
},
|
|
3658
|
+
/**
|
|
3659
|
+
* called when the gesture isn't allowed to recognize
|
|
3660
|
+
* like when another is being recognized or it is disabled
|
|
3661
|
+
* @virtual
|
|
3662
|
+
*/
|
|
3663
|
+
reset: function() {
|
|
3664
|
+
}
|
|
3665
|
+
};
|
|
3666
|
+
function Cs(o) {
|
|
3667
|
+
return o & qe ? "cancel" : o & Ee ? "end" : o & we ? "move" : o & W ? "start" : "";
|
|
3668
|
+
}
|
|
3669
|
+
function _s(o) {
|
|
3670
|
+
return o == ze ? "down" : o == $e ? "up" : o == Re ? "left" : o == Be ? "right" : "";
|
|
3671
|
+
}
|
|
3672
|
+
function ct(o, i) {
|
|
3673
|
+
var l = i.manager;
|
|
3674
|
+
return l ? l.get(o) : o;
|
|
3675
|
+
}
|
|
3676
|
+
function K() {
|
|
3677
|
+
de.apply(this, arguments);
|
|
3678
|
+
}
|
|
3679
|
+
x(K, de, {
|
|
3680
|
+
/**
|
|
3681
|
+
* @namespace
|
|
3682
|
+
* @memberof AttrRecognizer
|
|
3683
|
+
*/
|
|
3684
|
+
defaults: {
|
|
3685
|
+
/**
|
|
3686
|
+
* @type {Number}
|
|
3687
|
+
* @default 1
|
|
3688
|
+
*/
|
|
3689
|
+
pointers: 1
|
|
3690
|
+
},
|
|
3691
|
+
/**
|
|
3692
|
+
* Used to check if it the recognizer receives valid input, like input.distance > 10.
|
|
3693
|
+
* @memberof AttrRecognizer
|
|
3694
|
+
* @param {Object} input
|
|
3695
|
+
* @returns {Boolean} recognized
|
|
3696
|
+
*/
|
|
3697
|
+
attrTest: function(o) {
|
|
3698
|
+
var i = this.options.pointers;
|
|
3699
|
+
return i === 0 || o.pointers.length === i;
|
|
3700
|
+
},
|
|
3701
|
+
/**
|
|
3702
|
+
* Process the input and return the state for the recognizer
|
|
3703
|
+
* @memberof AttrRecognizer
|
|
3704
|
+
* @param {Object} input
|
|
3705
|
+
* @returns {*} State
|
|
3706
|
+
*/
|
|
3707
|
+
process: function(o) {
|
|
3708
|
+
var i = this.state, l = o.eventType, p = i & (W | we), m = this.attrTest(o);
|
|
3709
|
+
return p && (l & q || !m) ? i | qe : p || m ? l & N ? i | Ee : i & W ? i | we : W : se;
|
|
3710
|
+
}
|
|
3711
|
+
});
|
|
3712
|
+
function ut() {
|
|
3713
|
+
K.apply(this, arguments), this.pX = null, this.pY = null;
|
|
3714
|
+
}
|
|
3715
|
+
x(ut, K, {
|
|
3716
|
+
/**
|
|
3717
|
+
* @namespace
|
|
3718
|
+
* @memberof PanRecognizer
|
|
3719
|
+
*/
|
|
3720
|
+
defaults: {
|
|
3721
|
+
event: "pan",
|
|
3722
|
+
threshold: 10,
|
|
3723
|
+
pointers: 1,
|
|
3724
|
+
direction: as
|
|
3725
|
+
},
|
|
3726
|
+
getTouchAction: function() {
|
|
3727
|
+
var o = this.options.direction, i = [];
|
|
3728
|
+
return o & te && i.push(Fe), o & _e && i.push(He), i;
|
|
3729
|
+
},
|
|
3730
|
+
directionTest: function(o) {
|
|
3731
|
+
var i = this.options, l = !0, p = o.distance, m = o.direction, E = o.deltaX, w = o.deltaY;
|
|
3732
|
+
return m & i.direction || (i.direction & te ? (m = E === 0 ? st : E < 0 ? Re : Be, l = E != this.pX, p = Math.abs(o.deltaX)) : (m = w === 0 ? st : w < 0 ? $e : ze, l = w != this.pY, p = Math.abs(o.deltaY))), o.direction = m, l && p > i.threshold && m & i.direction;
|
|
3733
|
+
},
|
|
3734
|
+
attrTest: function(o) {
|
|
3735
|
+
return K.prototype.attrTest.call(this, o) && (this.state & W || !(this.state & W) && this.directionTest(o));
|
|
3736
|
+
},
|
|
3737
|
+
emit: function(o) {
|
|
3738
|
+
this.pX = o.deltaX, this.pY = o.deltaY;
|
|
3739
|
+
var i = _s(o.direction);
|
|
3740
|
+
i && (o.additionalEvent = this.options.event + i), this._super.emit.call(this, o);
|
|
3741
|
+
}
|
|
3742
|
+
});
|
|
3743
|
+
function Lt() {
|
|
3744
|
+
K.apply(this, arguments);
|
|
3745
|
+
}
|
|
3746
|
+
x(Lt, K, {
|
|
3747
|
+
/**
|
|
3748
|
+
* @namespace
|
|
3749
|
+
* @memberof PinchRecognizer
|
|
3750
|
+
*/
|
|
3751
|
+
defaults: {
|
|
3752
|
+
event: "pinch",
|
|
3753
|
+
threshold: 0,
|
|
3754
|
+
pointers: 2
|
|
3755
|
+
},
|
|
3756
|
+
getTouchAction: function() {
|
|
3757
|
+
return [be];
|
|
3758
|
+
},
|
|
3759
|
+
attrTest: function(o) {
|
|
3760
|
+
return this._super.attrTest.call(this, o) && (Math.abs(o.scale - 1) > this.options.threshold || this.state & W);
|
|
3761
|
+
},
|
|
3762
|
+
emit: function(o) {
|
|
3763
|
+
if (o.scale !== 1) {
|
|
3764
|
+
var i = o.scale < 1 ? "in" : "out";
|
|
3765
|
+
o.additionalEvent = this.options.event + i;
|
|
3766
|
+
}
|
|
3767
|
+
this._super.emit.call(this, o);
|
|
3768
|
+
}
|
|
3769
|
+
});
|
|
3770
|
+
function Vt() {
|
|
3771
|
+
de.apply(this, arguments), this._timer = null, this._input = null;
|
|
3772
|
+
}
|
|
3773
|
+
x(Vt, de, {
|
|
3774
|
+
/**
|
|
3775
|
+
* @namespace
|
|
3776
|
+
* @memberof PressRecognizer
|
|
3777
|
+
*/
|
|
3778
|
+
defaults: {
|
|
3779
|
+
event: "press",
|
|
3780
|
+
pointers: 1,
|
|
3781
|
+
time: 251,
|
|
3782
|
+
// minimal time of the pointer to be pressed
|
|
3783
|
+
threshold: 9
|
|
3784
|
+
// a minimal movement is ok, but keep it low
|
|
3785
|
+
},
|
|
3786
|
+
getTouchAction: function() {
|
|
3787
|
+
return [Ts];
|
|
3788
|
+
},
|
|
3789
|
+
process: function(o) {
|
|
3790
|
+
var i = this.options, l = o.pointers.length === i.pointers, p = o.distance < i.threshold, m = o.deltaTime > i.time;
|
|
3791
|
+
if (this._input = o, !p || !l || o.eventType & (N | q) && !m)
|
|
3792
|
+
this.reset();
|
|
3793
|
+
else if (o.eventType & z)
|
|
3794
|
+
this.reset(), this._timer = v(function() {
|
|
3795
|
+
this.state = ue, this.tryEmit();
|
|
3796
|
+
}, i.time, this);
|
|
3797
|
+
else if (o.eventType & N)
|
|
3798
|
+
return ue;
|
|
3799
|
+
return se;
|
|
3800
|
+
},
|
|
3801
|
+
reset: function() {
|
|
3802
|
+
clearTimeout(this._timer);
|
|
3803
|
+
},
|
|
3804
|
+
emit: function(o) {
|
|
3805
|
+
this.state === ue && (o && o.eventType & N ? this.manager.emit(this.options.event + "up", o) : (this._input.timeStamp = g(), this.manager.emit(this.options.event, this._input)));
|
|
3806
|
+
}
|
|
3807
|
+
});
|
|
3808
|
+
function Ut() {
|
|
3809
|
+
K.apply(this, arguments);
|
|
3810
|
+
}
|
|
3811
|
+
x(Ut, K, {
|
|
3812
|
+
/**
|
|
3813
|
+
* @namespace
|
|
3814
|
+
* @memberof RotateRecognizer
|
|
3815
|
+
*/
|
|
3816
|
+
defaults: {
|
|
3817
|
+
event: "rotate",
|
|
3818
|
+
threshold: 0,
|
|
3819
|
+
pointers: 2
|
|
3820
|
+
},
|
|
3821
|
+
getTouchAction: function() {
|
|
3822
|
+
return [be];
|
|
3823
|
+
},
|
|
3824
|
+
attrTest: function(o) {
|
|
3825
|
+
return this._super.attrTest.call(this, o) && (Math.abs(o.rotation) > this.options.threshold || this.state & W);
|
|
3826
|
+
}
|
|
3827
|
+
});
|
|
3828
|
+
function Rt() {
|
|
3829
|
+
K.apply(this, arguments);
|
|
3830
|
+
}
|
|
3831
|
+
x(Rt, K, {
|
|
3832
|
+
/**
|
|
3833
|
+
* @namespace
|
|
3834
|
+
* @memberof SwipeRecognizer
|
|
3835
|
+
*/
|
|
3836
|
+
defaults: {
|
|
3837
|
+
event: "swipe",
|
|
3838
|
+
threshold: 10,
|
|
3839
|
+
velocity: 0.3,
|
|
3840
|
+
direction: te | _e,
|
|
3841
|
+
pointers: 1
|
|
3842
|
+
},
|
|
3843
|
+
getTouchAction: function() {
|
|
3844
|
+
return ut.prototype.getTouchAction.call(this);
|
|
3845
|
+
},
|
|
3846
|
+
attrTest: function(o) {
|
|
3847
|
+
var i = this.options.direction, l;
|
|
3848
|
+
return i & (te | _e) ? l = o.overallVelocity : i & te ? l = o.overallVelocityX : i & _e && (l = o.overallVelocityY), this._super.attrTest.call(this, o) && i & o.offsetDirection && o.distance > this.options.threshold && o.maxPointers == this.options.pointers && f(l) > this.options.velocity && o.eventType & N;
|
|
3849
|
+
},
|
|
3850
|
+
emit: function(o) {
|
|
3851
|
+
var i = _s(o.offsetDirection);
|
|
3852
|
+
i && this.manager.emit(this.options.event + i, o), this.manager.emit(this.options.event, o);
|
|
3853
|
+
}
|
|
3854
|
+
});
|
|
3855
|
+
function dt() {
|
|
3856
|
+
de.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;
|
|
3857
|
+
}
|
|
3858
|
+
x(dt, de, {
|
|
3859
|
+
/**
|
|
3860
|
+
* @namespace
|
|
3861
|
+
* @memberof PinchRecognizer
|
|
3862
|
+
*/
|
|
3863
|
+
defaults: {
|
|
3864
|
+
event: "tap",
|
|
3865
|
+
pointers: 1,
|
|
3866
|
+
taps: 1,
|
|
3867
|
+
interval: 300,
|
|
3868
|
+
// max time between the multi-tap taps
|
|
3869
|
+
time: 250,
|
|
3870
|
+
// max time of the pointer to be down (like finger on the screen)
|
|
3871
|
+
threshold: 9,
|
|
3872
|
+
// a minimal movement is ok, but keep it low
|
|
3873
|
+
posThreshold: 10
|
|
3874
|
+
// a multi-tap can be a bit off the initial position
|
|
3875
|
+
},
|
|
3876
|
+
getTouchAction: function() {
|
|
3877
|
+
return [Ot];
|
|
3878
|
+
},
|
|
3879
|
+
process: function(o) {
|
|
3880
|
+
var i = this.options, l = o.pointers.length === i.pointers, p = o.distance < i.threshold, m = o.deltaTime < i.time;
|
|
3881
|
+
if (this.reset(), o.eventType & z && this.count === 0)
|
|
3882
|
+
return this.failTimeout();
|
|
3883
|
+
if (p && m && l) {
|
|
3884
|
+
if (o.eventType != N)
|
|
3885
|
+
return this.failTimeout();
|
|
3886
|
+
var E = this.pTime ? o.timeStamp - this.pTime < i.interval : !0, w = !this.pCenter || ot(this.pCenter, o.center) < i.posThreshold;
|
|
3887
|
+
this.pTime = o.timeStamp, this.pCenter = o.center, !w || !E ? this.count = 1 : this.count += 1, this._input = o;
|
|
3888
|
+
var L = this.count % i.taps;
|
|
3889
|
+
if (L === 0)
|
|
3890
|
+
return this.hasRequireFailures() ? (this._timer = v(function() {
|
|
3891
|
+
this.state = ue, this.tryEmit();
|
|
3892
|
+
}, i.interval, this), W) : ue;
|
|
3893
|
+
}
|
|
3894
|
+
return se;
|
|
3895
|
+
},
|
|
3896
|
+
failTimeout: function() {
|
|
3897
|
+
return this._timer = v(function() {
|
|
3898
|
+
this.state = se;
|
|
3899
|
+
}, this.options.interval, this), se;
|
|
3900
|
+
},
|
|
3901
|
+
reset: function() {
|
|
3902
|
+
clearTimeout(this._timer);
|
|
3903
|
+
},
|
|
3904
|
+
emit: function() {
|
|
3905
|
+
this.state == ue && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
|
|
3906
|
+
}
|
|
3907
|
+
});
|
|
3908
|
+
function Se(o, i) {
|
|
3909
|
+
return i = i || {}, i.recognizers = Ve(i.recognizers, Se.defaults.preset), new Bt(o, i);
|
|
3910
|
+
}
|
|
3911
|
+
Se.VERSION = "2.0.7", Se.defaults = {
|
|
3912
|
+
/**
|
|
3913
|
+
* set if DOM events are being triggered.
|
|
3914
|
+
* But this is slower and unused by simple implementations, so disabled by default.
|
|
3915
|
+
* @type {Boolean}
|
|
3916
|
+
* @default false
|
|
3917
|
+
*/
|
|
3918
|
+
domEvents: !1,
|
|
3919
|
+
/**
|
|
3920
|
+
* The value for the touchAction property/fallback.
|
|
3921
|
+
* When set to `compute` it will magically set the correct value based on the added recognizers.
|
|
3922
|
+
* @type {String}
|
|
3923
|
+
* @default compute
|
|
3924
|
+
*/
|
|
3925
|
+
touchAction: Ss,
|
|
3926
|
+
/**
|
|
3927
|
+
* @type {Boolean}
|
|
3928
|
+
* @default true
|
|
3929
|
+
*/
|
|
3930
|
+
enable: !0,
|
|
3931
|
+
/**
|
|
3932
|
+
* EXPERIMENTAL FEATURE -- can be removed/changed
|
|
3933
|
+
* Change the parent input target element.
|
|
3934
|
+
* If Null, then it is being set the to main element.
|
|
3935
|
+
* @type {Null|EventTarget}
|
|
3936
|
+
* @default null
|
|
3937
|
+
*/
|
|
3938
|
+
inputTarget: null,
|
|
3939
|
+
/**
|
|
3940
|
+
* force an input class
|
|
3941
|
+
* @type {Null|Function}
|
|
3942
|
+
* @default null
|
|
3943
|
+
*/
|
|
3944
|
+
inputClass: null,
|
|
3945
|
+
/**
|
|
3946
|
+
* Default recognizer setup when calling `Hammer()`
|
|
3947
|
+
* When creating a new Manager these will be skipped.
|
|
3948
|
+
* @type {Array}
|
|
3949
|
+
*/
|
|
3950
|
+
preset: [
|
|
3951
|
+
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
|
|
3952
|
+
[Ut, { enable: !1 }],
|
|
3953
|
+
[Lt, { enable: !1 }, ["rotate"]],
|
|
3954
|
+
[Rt, { direction: te }],
|
|
3955
|
+
[ut, { direction: te }, ["swipe"]],
|
|
3956
|
+
[dt],
|
|
3957
|
+
[dt, { event: "doubletap", taps: 2 }, ["tap"]],
|
|
3958
|
+
[Vt]
|
|
3959
|
+
],
|
|
3960
|
+
/**
|
|
3961
|
+
* Some CSS properties can be used to improve the working of Hammer.
|
|
3962
|
+
* Add them to this method and they will be set when creating a new Manager.
|
|
3963
|
+
* @namespace
|
|
3964
|
+
*/
|
|
3965
|
+
cssProps: {
|
|
3966
|
+
/**
|
|
3967
|
+
* Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
|
|
3968
|
+
* @type {String}
|
|
3969
|
+
* @default 'none'
|
|
3970
|
+
*/
|
|
3971
|
+
userSelect: "none",
|
|
3972
|
+
/**
|
|
3973
|
+
* Disable the Windows Phone grippers when pressing an element.
|
|
3974
|
+
* @type {String}
|
|
3975
|
+
* @default 'none'
|
|
3976
|
+
*/
|
|
3977
|
+
touchSelect: "none",
|
|
3978
|
+
/**
|
|
3979
|
+
* Disables the default callout shown when you touch and hold a touch target.
|
|
3980
|
+
* On iOS, when you touch and hold a touch target such as a link, Safari displays
|
|
3981
|
+
* a callout containing information about the link. This property allows you to disable that callout.
|
|
3982
|
+
* @type {String}
|
|
3983
|
+
* @default 'none'
|
|
3984
|
+
*/
|
|
3985
|
+
touchCallout: "none",
|
|
3986
|
+
/**
|
|
3987
|
+
* Specifies whether zooming is enabled. Used by IE10>
|
|
3988
|
+
* @type {String}
|
|
3989
|
+
* @default 'none'
|
|
3990
|
+
*/
|
|
3991
|
+
contentZooming: "none",
|
|
3992
|
+
/**
|
|
3993
|
+
* Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
|
|
3994
|
+
* @type {String}
|
|
3995
|
+
* @default 'none'
|
|
3996
|
+
*/
|
|
3997
|
+
userDrag: "none",
|
|
3998
|
+
/**
|
|
3999
|
+
* Overrides the highlight color shown when the user taps a link or a JavaScript
|
|
4000
|
+
* clickable element in iOS. This property obeys the alpha value, if specified.
|
|
4001
|
+
* @type {String}
|
|
4002
|
+
* @default 'rgba(0,0,0,0)'
|
|
4003
|
+
*/
|
|
4004
|
+
tapHighlightColor: "rgba(0,0,0,0)"
|
|
4005
|
+
}
|
|
4006
|
+
};
|
|
4007
|
+
var yo = 1, bs = 2;
|
|
4008
|
+
function Bt(o, i) {
|
|
4009
|
+
this.options = P({}, Se.defaults, i || {}), this.options.inputTarget = this.options.inputTarget || o, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = o, this.input = Yn(this), this.touchAction = new kt(this, this.options.touchAction), Is(this, !0), _(this.options.recognizers, function(l) {
|
|
4010
|
+
var p = this.add(new l[0](l[1]));
|
|
4011
|
+
l[2] && p.recognizeWith(l[2]), l[3] && p.requireFailure(l[3]);
|
|
4012
|
+
}, this);
|
|
4013
|
+
}
|
|
4014
|
+
Bt.prototype = {
|
|
4015
|
+
/**
|
|
4016
|
+
* set options
|
|
4017
|
+
* @param {Object} options
|
|
4018
|
+
* @returns {Manager}
|
|
4019
|
+
*/
|
|
4020
|
+
set: function(o) {
|
|
4021
|
+
return P(this.options, o), o.touchAction && this.touchAction.update(), o.inputTarget && (this.input.destroy(), this.input.target = o.inputTarget, this.input.init()), this;
|
|
4022
|
+
},
|
|
4023
|
+
/**
|
|
4024
|
+
* stop recognizing for this session.
|
|
4025
|
+
* This session will be discarded, when a new [input]start event is fired.
|
|
4026
|
+
* When forced, the recognizer cycle is stopped immediately.
|
|
4027
|
+
* @param {Boolean} [force]
|
|
4028
|
+
*/
|
|
4029
|
+
stop: function(o) {
|
|
4030
|
+
this.session.stopped = o ? bs : yo;
|
|
4031
|
+
},
|
|
4032
|
+
/**
|
|
4033
|
+
* run the recognizers!
|
|
4034
|
+
* called by the inputHandler function on every movement of the pointers (touches)
|
|
4035
|
+
* it walks through all the recognizers and tries to detect the gesture that is being made
|
|
4036
|
+
* @param {Object} inputData
|
|
4037
|
+
*/
|
|
4038
|
+
recognize: function(o) {
|
|
4039
|
+
var i = this.session;
|
|
4040
|
+
if (!i.stopped) {
|
|
4041
|
+
this.touchAction.preventDefaults(o);
|
|
4042
|
+
var l, p = this.recognizers, m = i.curRecognizer;
|
|
4043
|
+
(!m || m && m.state & ue) && (m = i.curRecognizer = null);
|
|
4044
|
+
for (var E = 0; E < p.length; )
|
|
4045
|
+
l = p[E], i.stopped !== bs && // 1
|
|
4046
|
+
(!m || l == m || // 2
|
|
4047
|
+
l.canRecognizeWith(m)) ? l.recognize(o) : l.reset(), !m && l.state & (W | we | Ee) && (m = i.curRecognizer = l), E++;
|
|
4048
|
+
}
|
|
4049
|
+
},
|
|
4050
|
+
/**
|
|
4051
|
+
* get a recognizer by its event name.
|
|
4052
|
+
* @param {Recognizer|String} recognizer
|
|
4053
|
+
* @returns {Recognizer|Null}
|
|
4054
|
+
*/
|
|
4055
|
+
get: function(o) {
|
|
4056
|
+
if (o instanceof de)
|
|
4057
|
+
return o;
|
|
4058
|
+
for (var i = this.recognizers, l = 0; l < i.length; l++)
|
|
4059
|
+
if (i[l].options.event == o)
|
|
4060
|
+
return i[l];
|
|
4061
|
+
return null;
|
|
4062
|
+
},
|
|
4063
|
+
/**
|
|
4064
|
+
* add a recognizer to the manager
|
|
4065
|
+
* existing recognizers with the same event name will be removed
|
|
4066
|
+
* @param {Recognizer} recognizer
|
|
4067
|
+
* @returns {Recognizer|Manager}
|
|
4068
|
+
*/
|
|
4069
|
+
add: function(o) {
|
|
4070
|
+
if (C(o, "add", this))
|
|
4071
|
+
return this;
|
|
4072
|
+
var i = this.get(o.options.event);
|
|
4073
|
+
return i && this.remove(i), this.recognizers.push(o), o.manager = this, this.touchAction.update(), o;
|
|
4074
|
+
},
|
|
4075
|
+
/**
|
|
4076
|
+
* remove a recognizer by name or instance
|
|
4077
|
+
* @param {Recognizer|String} recognizer
|
|
4078
|
+
* @returns {Manager}
|
|
4079
|
+
*/
|
|
4080
|
+
remove: function(o) {
|
|
4081
|
+
if (C(o, "remove", this))
|
|
4082
|
+
return this;
|
|
4083
|
+
if (o = this.get(o), o) {
|
|
4084
|
+
var i = this.recognizers, l = xe(i, o);
|
|
4085
|
+
l !== -1 && (i.splice(l, 1), this.touchAction.update());
|
|
4086
|
+
}
|
|
4087
|
+
return this;
|
|
4088
|
+
},
|
|
4089
|
+
/**
|
|
4090
|
+
* bind event
|
|
4091
|
+
* @param {String} events
|
|
4092
|
+
* @param {Function} handler
|
|
4093
|
+
* @returns {EventEmitter} this
|
|
4094
|
+
*/
|
|
4095
|
+
on: function(o, i) {
|
|
4096
|
+
if (o !== r && i !== r) {
|
|
4097
|
+
var l = this.handlers;
|
|
4098
|
+
return _(Je(o), function(p) {
|
|
4099
|
+
l[p] = l[p] || [], l[p].push(i);
|
|
4100
|
+
}), this;
|
|
4101
|
+
}
|
|
4102
|
+
},
|
|
4103
|
+
/**
|
|
4104
|
+
* unbind event, leave emit blank to remove all handlers
|
|
4105
|
+
* @param {String} events
|
|
4106
|
+
* @param {Function} [handler]
|
|
4107
|
+
* @returns {EventEmitter} this
|
|
4108
|
+
*/
|
|
4109
|
+
off: function(o, i) {
|
|
4110
|
+
if (o !== r) {
|
|
4111
|
+
var l = this.handlers;
|
|
4112
|
+
return _(Je(o), function(p) {
|
|
4113
|
+
i ? l[p] && l[p].splice(xe(l[p], i), 1) : delete l[p];
|
|
4114
|
+
}), this;
|
|
4115
|
+
}
|
|
4116
|
+
},
|
|
4117
|
+
/**
|
|
4118
|
+
* emit event to the listeners
|
|
4119
|
+
* @param {String} event
|
|
4120
|
+
* @param {Object} data
|
|
4121
|
+
*/
|
|
4122
|
+
emit: function(o, i) {
|
|
4123
|
+
this.options.domEvents && Eo(o, i);
|
|
4124
|
+
var l = this.handlers[o] && this.handlers[o].slice();
|
|
4125
|
+
if (!(!l || !l.length)) {
|
|
4126
|
+
i.type = o, i.preventDefault = function() {
|
|
4127
|
+
i.srcEvent.preventDefault();
|
|
4128
|
+
};
|
|
4129
|
+
for (var p = 0; p < l.length; )
|
|
4130
|
+
l[p](i), p++;
|
|
4131
|
+
}
|
|
4132
|
+
},
|
|
4133
|
+
/**
|
|
4134
|
+
* destroy the manager and unbinds all events
|
|
4135
|
+
* it doesn't unbind dom events, that is the user own responsibility
|
|
4136
|
+
*/
|
|
4137
|
+
destroy: function() {
|
|
4138
|
+
this.element && Is(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
|
|
4139
|
+
}
|
|
4140
|
+
};
|
|
4141
|
+
function Is(o, i) {
|
|
4142
|
+
var l = o.element;
|
|
4143
|
+
if (l.style) {
|
|
4144
|
+
var p;
|
|
4145
|
+
_(o.options.cssProps, function(m, E) {
|
|
4146
|
+
p = tt(l.style, E), i ? (o.oldCssProps[p] = l.style[p], l.style[p] = m) : l.style[p] = o.oldCssProps[p] || "";
|
|
4147
|
+
}), i || (o.oldCssProps = {});
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
function Eo(o, i) {
|
|
4151
|
+
var l = s.createEvent("Event");
|
|
4152
|
+
l.initEvent(o, !0, !0), l.gesture = i, i.target.dispatchEvent(l);
|
|
4153
|
+
}
|
|
4154
|
+
P(Se, {
|
|
4155
|
+
INPUT_START: z,
|
|
4156
|
+
INPUT_MOVE: Ce,
|
|
4157
|
+
INPUT_END: N,
|
|
4158
|
+
INPUT_CANCEL: q,
|
|
4159
|
+
STATE_POSSIBLE: lt,
|
|
4160
|
+
STATE_BEGAN: W,
|
|
4161
|
+
STATE_CHANGED: we,
|
|
4162
|
+
STATE_ENDED: Ee,
|
|
4163
|
+
STATE_RECOGNIZED: ue,
|
|
4164
|
+
STATE_CANCELLED: qe,
|
|
4165
|
+
STATE_FAILED: se,
|
|
4166
|
+
DIRECTION_NONE: st,
|
|
4167
|
+
DIRECTION_LEFT: Re,
|
|
4168
|
+
DIRECTION_RIGHT: Be,
|
|
4169
|
+
DIRECTION_UP: $e,
|
|
4170
|
+
DIRECTION_DOWN: ze,
|
|
4171
|
+
DIRECTION_HORIZONTAL: te,
|
|
4172
|
+
DIRECTION_VERTICAL: _e,
|
|
4173
|
+
DIRECTION_ALL: as,
|
|
4174
|
+
Manager: Bt,
|
|
4175
|
+
Input: Y,
|
|
4176
|
+
TouchAction: kt,
|
|
4177
|
+
TouchInput: it,
|
|
4178
|
+
MouseInput: rt,
|
|
4179
|
+
PointerEventInput: At,
|
|
4180
|
+
TouchMouseInput: Nt,
|
|
4181
|
+
SingleTouchInput: gs,
|
|
4182
|
+
Recognizer: de,
|
|
4183
|
+
AttrRecognizer: K,
|
|
4184
|
+
Tap: dt,
|
|
4185
|
+
Pan: ut,
|
|
4186
|
+
Swipe: Rt,
|
|
4187
|
+
Pinch: Lt,
|
|
4188
|
+
Rotate: Ut,
|
|
4189
|
+
Press: Vt,
|
|
4190
|
+
on: ye,
|
|
4191
|
+
off: Q,
|
|
4192
|
+
each: _,
|
|
4193
|
+
merge: b,
|
|
4194
|
+
extend: I,
|
|
4195
|
+
assign: P,
|
|
4196
|
+
inherit: x,
|
|
4197
|
+
bindFn: F,
|
|
4198
|
+
prefixed: tt
|
|
4199
|
+
});
|
|
4200
|
+
var So = typeof t < "u" ? t : typeof self < "u" ? self : {};
|
|
4201
|
+
So.Hammer = Se, e.exports ? e.exports = Se : t[n] = Se;
|
|
4202
|
+
})(window, document, "Hammer");
|
|
4203
|
+
})(Ht)), Ht.exports;
|
|
4204
|
+
}
|
|
4205
|
+
var xt = wi();
|
|
4206
|
+
const oe = /* @__PURE__ */ er({
|
|
4207
|
+
__proto__: null
|
|
4208
|
+
}, [xt]), Un = 1, Rn = 2, Zt = 4, Di = {
|
|
4209
|
+
mousedown: Un,
|
|
4210
|
+
mousemove: Rn,
|
|
4211
|
+
mouseup: Zt
|
|
4212
|
+
};
|
|
4213
|
+
function Mi(e, t) {
|
|
4214
|
+
for (let s = 0; s < e.length; s++)
|
|
4215
|
+
if (t(e[s]))
|
|
4216
|
+
return !0;
|
|
4217
|
+
return !1;
|
|
4218
|
+
}
|
|
4219
|
+
function Ai(e) {
|
|
4220
|
+
const t = e.prototype.handler;
|
|
4221
|
+
e.prototype.handler = function(n) {
|
|
4222
|
+
const r = this.store;
|
|
4223
|
+
n.button > 0 && n.type === "pointerdown" && (Mi(r, (a) => a.pointerId === n.pointerId) || r.push(n)), t.call(this, n);
|
|
4224
|
+
};
|
|
4225
|
+
}
|
|
4226
|
+
function Ni(e) {
|
|
4227
|
+
e.prototype.handler = function(s) {
|
|
4228
|
+
let n = Di[s.type];
|
|
4229
|
+
n & Un && s.button >= 0 && (this.pressed = !0), n & Rn && s.buttons === 0 && (n = Zt), this.pressed && (n & Zt && (this.pressed = !1), this.callback(this.manager, n, {
|
|
4230
|
+
pointers: [s],
|
|
4231
|
+
changedPointers: [s],
|
|
4232
|
+
pointerType: "mouse",
|
|
4233
|
+
srcEvent: s
|
|
4234
|
+
}));
|
|
4235
|
+
};
|
|
4236
|
+
}
|
|
4237
|
+
Ai(xt.PointerEventInput);
|
|
4238
|
+
Ni(xt.MouseInput);
|
|
4239
|
+
const Oi = xt.Manager;
|
|
4240
|
+
class wt {
|
|
4241
|
+
constructor(t, s, n) {
|
|
4242
|
+
this.element = t, this.callback = s, this.options = { enable: !0, ...n };
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
const ki = oe ? [
|
|
4246
|
+
[oe.Pan, { event: "tripan", pointers: 3, threshold: 0, enable: !1 }],
|
|
4247
|
+
[oe.Rotate, { enable: !1 }],
|
|
4248
|
+
[oe.Pinch, { enable: !1 }],
|
|
4249
|
+
[oe.Swipe, { enable: !1 }],
|
|
4250
|
+
[oe.Pan, { threshold: 0, enable: !1 }],
|
|
4251
|
+
[oe.Press, { enable: !1 }],
|
|
4252
|
+
[oe.Tap, { event: "doubletap", taps: 2, enable: !1 }],
|
|
4253
|
+
// TODO - rename to 'tap' and 'singletap' in the next major release
|
|
4254
|
+
[oe.Tap, { event: "anytap", enable: !1 }],
|
|
4255
|
+
[oe.Tap, { enable: !1 }]
|
|
4256
|
+
] : null, Fs = {
|
|
4257
|
+
tripan: ["rotate", "pinch", "pan"],
|
|
4258
|
+
rotate: ["pinch"],
|
|
4259
|
+
pinch: ["pan"],
|
|
4260
|
+
pan: ["press", "doubletap", "anytap", "tap"],
|
|
4261
|
+
doubletap: ["anytap"],
|
|
4262
|
+
anytap: ["tap"]
|
|
4263
|
+
}, Li = {
|
|
4264
|
+
doubletap: ["tap"]
|
|
4265
|
+
}, Vi = {
|
|
4266
|
+
pointerdown: "pointerdown",
|
|
4267
|
+
pointermove: "pointermove",
|
|
4268
|
+
pointerup: "pointerup",
|
|
4269
|
+
touchstart: "pointerdown",
|
|
4270
|
+
touchmove: "pointermove",
|
|
4271
|
+
touchend: "pointerup",
|
|
4272
|
+
mousedown: "pointerdown",
|
|
4273
|
+
mousemove: "pointermove",
|
|
4274
|
+
mouseup: "pointerup"
|
|
4275
|
+
}, ns = {
|
|
4276
|
+
KEY_EVENTS: ["keydown", "keyup"],
|
|
4277
|
+
MOUSE_EVENTS: ["mousedown", "mousemove", "mouseup", "mouseover", "mouseout", "mouseleave"],
|
|
4278
|
+
WHEEL_EVENTS: [
|
|
4279
|
+
// Chrome, Safari
|
|
4280
|
+
"wheel",
|
|
4281
|
+
// IE
|
|
4282
|
+
"mousewheel"
|
|
4283
|
+
]
|
|
4284
|
+
}, Ui = {
|
|
4285
|
+
tap: "tap",
|
|
4286
|
+
anytap: "anytap",
|
|
4287
|
+
doubletap: "doubletap",
|
|
4288
|
+
press: "press",
|
|
4289
|
+
pinch: "pinch",
|
|
4290
|
+
pinchin: "pinch",
|
|
4291
|
+
pinchout: "pinch",
|
|
4292
|
+
pinchstart: "pinch",
|
|
4293
|
+
pinchmove: "pinch",
|
|
4294
|
+
pinchend: "pinch",
|
|
4295
|
+
pinchcancel: "pinch",
|
|
4296
|
+
rotate: "rotate",
|
|
4297
|
+
rotatestart: "rotate",
|
|
4298
|
+
rotatemove: "rotate",
|
|
4299
|
+
rotateend: "rotate",
|
|
4300
|
+
rotatecancel: "rotate",
|
|
4301
|
+
tripan: "tripan",
|
|
4302
|
+
tripanstart: "tripan",
|
|
4303
|
+
tripanmove: "tripan",
|
|
4304
|
+
tripanup: "tripan",
|
|
4305
|
+
tripandown: "tripan",
|
|
4306
|
+
tripanleft: "tripan",
|
|
4307
|
+
tripanright: "tripan",
|
|
4308
|
+
tripanend: "tripan",
|
|
4309
|
+
tripancancel: "tripan",
|
|
4310
|
+
pan: "pan",
|
|
4311
|
+
panstart: "pan",
|
|
4312
|
+
panmove: "pan",
|
|
4313
|
+
panup: "pan",
|
|
4314
|
+
pandown: "pan",
|
|
4315
|
+
panleft: "pan",
|
|
4316
|
+
panright: "pan",
|
|
4317
|
+
panend: "pan",
|
|
4318
|
+
pancancel: "pan",
|
|
4319
|
+
swipe: "swipe",
|
|
4320
|
+
swipeleft: "swipe",
|
|
4321
|
+
swiperight: "swipe",
|
|
4322
|
+
swipeup: "swipe",
|
|
4323
|
+
swipedown: "swipe"
|
|
4324
|
+
}, qs = {
|
|
4325
|
+
click: "tap",
|
|
4326
|
+
anyclick: "anytap",
|
|
4327
|
+
dblclick: "doubletap",
|
|
4328
|
+
mousedown: "pointerdown",
|
|
4329
|
+
mousemove: "pointermove",
|
|
4330
|
+
mouseup: "pointerup",
|
|
4331
|
+
mouseover: "pointerover",
|
|
4332
|
+
mouseout: "pointerout",
|
|
4333
|
+
mouseleave: "pointerleave"
|
|
4334
|
+
}, Ri = typeof navigator < "u" && navigator.userAgent ? navigator.userAgent.toLowerCase() : "", Ae = typeof window < "u" ? window : global;
|
|
4335
|
+
let Qt = !1;
|
|
4336
|
+
try {
|
|
4337
|
+
const e = {
|
|
4338
|
+
// This function will be called when the browser
|
|
4339
|
+
// attempts to access the passive property.
|
|
4340
|
+
get passive() {
|
|
4341
|
+
return Qt = !0, !0;
|
|
4342
|
+
}
|
|
4343
|
+
};
|
|
4344
|
+
Ae.addEventListener("test", null, e), Ae.removeEventListener("test", null);
|
|
4345
|
+
} catch {
|
|
4346
|
+
Qt = !1;
|
|
4347
|
+
}
|
|
4348
|
+
const Bi = Ri.indexOf("firefox") !== -1, { WHEEL_EVENTS: $i } = ns, js = "wheel", Gs = 4.000244140625, zi = 40, Hi = 0.25;
|
|
4349
|
+
class Fi extends wt {
|
|
4350
|
+
constructor(t, s, n) {
|
|
4351
|
+
super(t, s, n), this.handleEvent = (r) => {
|
|
4352
|
+
if (!this.options.enable)
|
|
4353
|
+
return;
|
|
4354
|
+
let a = r.deltaY;
|
|
4355
|
+
Ae.WheelEvent && (Bi && r.deltaMode === Ae.WheelEvent.DOM_DELTA_PIXEL && (a /= Ae.devicePixelRatio), r.deltaMode === Ae.WheelEvent.DOM_DELTA_LINE && (a *= zi)), a !== 0 && a % Gs === 0 && (a = Math.floor(a / Gs)), r.shiftKey && a && (a = a * Hi), this.callback({
|
|
4356
|
+
type: js,
|
|
4357
|
+
center: {
|
|
4358
|
+
x: r.clientX,
|
|
4359
|
+
y: r.clientY
|
|
4360
|
+
},
|
|
4361
|
+
delta: -a,
|
|
4362
|
+
srcEvent: r,
|
|
4363
|
+
pointerType: "mouse",
|
|
4364
|
+
target: r.target
|
|
4365
|
+
});
|
|
4366
|
+
}, this.events = (this.options.events || []).concat($i), this.events.forEach((r) => t.addEventListener(r, this.handleEvent, Qt ? { passive: !1 } : !1));
|
|
4367
|
+
}
|
|
4368
|
+
destroy() {
|
|
4369
|
+
this.events.forEach((t) => this.element.removeEventListener(t, this.handleEvent));
|
|
4370
|
+
}
|
|
4371
|
+
/**
|
|
4372
|
+
* Enable this input (begin processing events)
|
|
4373
|
+
* if the specified event type is among those handled by this input.
|
|
4374
|
+
*/
|
|
4375
|
+
enableEventType(t, s) {
|
|
4376
|
+
t === js && (this.options.enable = s);
|
|
4377
|
+
}
|
|
4378
|
+
}
|
|
4379
|
+
const { MOUSE_EVENTS: qi } = ns, Ys = "pointermove", Ws = "pointerover", Xs = "pointerout", Zs = "pointerenter", Qs = "pointerleave";
|
|
4380
|
+
class ji extends wt {
|
|
4381
|
+
constructor(t, s, n) {
|
|
4382
|
+
super(t, s, n), this.handleEvent = (a) => {
|
|
4383
|
+
this.handleOverEvent(a), this.handleOutEvent(a), this.handleEnterEvent(a), this.handleLeaveEvent(a), this.handleMoveEvent(a);
|
|
4384
|
+
}, this.pressed = !1;
|
|
4385
|
+
const { enable: r } = this.options;
|
|
4386
|
+
this.enableMoveEvent = r, this.enableLeaveEvent = r, this.enableEnterEvent = r, this.enableOutEvent = r, this.enableOverEvent = r, this.events = (this.options.events || []).concat(qi), this.events.forEach((a) => t.addEventListener(a, this.handleEvent));
|
|
4387
|
+
}
|
|
4388
|
+
destroy() {
|
|
4389
|
+
this.events.forEach((t) => this.element.removeEventListener(t, this.handleEvent));
|
|
4390
|
+
}
|
|
4391
|
+
/**
|
|
4392
|
+
* Enable this input (begin processing events)
|
|
4393
|
+
* if the specified event type is among those handled by this input.
|
|
4394
|
+
*/
|
|
4395
|
+
enableEventType(t, s) {
|
|
4396
|
+
t === Ys && (this.enableMoveEvent = s), t === Ws && (this.enableOverEvent = s), t === Xs && (this.enableOutEvent = s), t === Zs && (this.enableEnterEvent = s), t === Qs && (this.enableLeaveEvent = s);
|
|
4397
|
+
}
|
|
4398
|
+
handleOverEvent(t) {
|
|
4399
|
+
this.enableOverEvent && t.type === "mouseover" && this._emit(Ws, t);
|
|
4400
|
+
}
|
|
4401
|
+
handleOutEvent(t) {
|
|
4402
|
+
this.enableOutEvent && t.type === "mouseout" && this._emit(Xs, t);
|
|
4403
|
+
}
|
|
4404
|
+
handleEnterEvent(t) {
|
|
4405
|
+
this.enableEnterEvent && t.type === "mouseenter" && this._emit(Zs, t);
|
|
4406
|
+
}
|
|
4407
|
+
handleLeaveEvent(t) {
|
|
4408
|
+
this.enableLeaveEvent && t.type === "mouseleave" && this._emit(Qs, t);
|
|
4409
|
+
}
|
|
4410
|
+
handleMoveEvent(t) {
|
|
4411
|
+
if (this.enableMoveEvent)
|
|
4412
|
+
switch (t.type) {
|
|
4413
|
+
case "mousedown":
|
|
4414
|
+
t.button >= 0 && (this.pressed = !0);
|
|
4415
|
+
break;
|
|
4416
|
+
case "mousemove":
|
|
4417
|
+
t.buttons === 0 && (this.pressed = !1), this.pressed || this._emit(Ys, t);
|
|
4418
|
+
break;
|
|
4419
|
+
case "mouseup":
|
|
4420
|
+
this.pressed = !1;
|
|
4421
|
+
break;
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
_emit(t, s) {
|
|
4425
|
+
this.callback({
|
|
4426
|
+
type: t,
|
|
4427
|
+
center: {
|
|
4428
|
+
x: s.clientX,
|
|
4429
|
+
y: s.clientY
|
|
4430
|
+
},
|
|
4431
|
+
srcEvent: s,
|
|
4432
|
+
pointerType: "mouse",
|
|
4433
|
+
target: s.target
|
|
4434
|
+
});
|
|
4435
|
+
}
|
|
4436
|
+
}
|
|
4437
|
+
const { KEY_EVENTS: Gi } = ns, Ks = "keydown", Js = "keyup";
|
|
4438
|
+
class Yi extends wt {
|
|
4439
|
+
constructor(t, s, n) {
|
|
4440
|
+
super(t, s, n), this.handleEvent = (r) => {
|
|
4441
|
+
const a = r.target || r.srcElement;
|
|
4442
|
+
a.tagName === "INPUT" && a.type === "text" || a.tagName === "TEXTAREA" || (this.enableDownEvent && r.type === "keydown" && this.callback({
|
|
4443
|
+
type: Ks,
|
|
4444
|
+
srcEvent: r,
|
|
4445
|
+
key: r.key,
|
|
4446
|
+
target: r.target
|
|
4447
|
+
}), this.enableUpEvent && r.type === "keyup" && this.callback({
|
|
4448
|
+
type: Js,
|
|
4449
|
+
srcEvent: r,
|
|
4450
|
+
key: r.key,
|
|
4451
|
+
target: r.target
|
|
4452
|
+
}));
|
|
4453
|
+
}, this.enableDownEvent = this.options.enable, this.enableUpEvent = this.options.enable, this.events = (this.options.events || []).concat(Gi), t.tabIndex = this.options.tabIndex || 0, t.style.outline = "none", this.events.forEach((r) => t.addEventListener(r, this.handleEvent));
|
|
4454
|
+
}
|
|
4455
|
+
destroy() {
|
|
4456
|
+
this.events.forEach((t) => this.element.removeEventListener(t, this.handleEvent));
|
|
4457
|
+
}
|
|
4458
|
+
/**
|
|
4459
|
+
* Enable this input (begin processing events)
|
|
4460
|
+
* if the specified event type is among those handled by this input.
|
|
4461
|
+
*/
|
|
4462
|
+
enableEventType(t, s) {
|
|
4463
|
+
t === Ks && (this.enableDownEvent = s), t === Js && (this.enableUpEvent = s);
|
|
4464
|
+
}
|
|
4465
|
+
}
|
|
4466
|
+
const en = "contextmenu";
|
|
4467
|
+
class Wi extends wt {
|
|
4468
|
+
constructor(t, s, n) {
|
|
4469
|
+
super(t, s, n), this.handleEvent = (r) => {
|
|
4470
|
+
this.options.enable && this.callback({
|
|
4471
|
+
type: en,
|
|
4472
|
+
center: {
|
|
4473
|
+
x: r.clientX,
|
|
4474
|
+
y: r.clientY
|
|
4475
|
+
},
|
|
4476
|
+
srcEvent: r,
|
|
4477
|
+
pointerType: "mouse",
|
|
4478
|
+
target: r.target
|
|
4479
|
+
});
|
|
4480
|
+
}, t.addEventListener("contextmenu", this.handleEvent);
|
|
4481
|
+
}
|
|
4482
|
+
destroy() {
|
|
4483
|
+
this.element.removeEventListener("contextmenu", this.handleEvent);
|
|
4484
|
+
}
|
|
4485
|
+
/**
|
|
4486
|
+
* Enable this input (begin processing events)
|
|
4487
|
+
* if the specified event type is among those handled by this input.
|
|
4488
|
+
*/
|
|
4489
|
+
enableEventType(t, s) {
|
|
4490
|
+
t === en && (this.options.enable = s);
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
const tn = 1, Kt = 2, sn = 4, Xi = {
|
|
4494
|
+
pointerdown: tn,
|
|
4495
|
+
pointermove: Kt,
|
|
4496
|
+
pointerup: sn,
|
|
4497
|
+
mousedown: tn,
|
|
4498
|
+
mousemove: Kt,
|
|
4499
|
+
mouseup: sn
|
|
4500
|
+
}, Zi = 0, Qi = 1, Ki = 2, Ji = 1, ea = 2, ta = 4;
|
|
4501
|
+
function sa(e) {
|
|
4502
|
+
const t = Xi[e.srcEvent.type];
|
|
4503
|
+
if (!t)
|
|
4504
|
+
return null;
|
|
4505
|
+
const { buttons: s, button: n } = e.srcEvent;
|
|
4506
|
+
let r = !1, a = !1, c = !1;
|
|
4507
|
+
return t === Kt ? (r = !!(s & Ji), a = !!(s & ta), c = !!(s & ea)) : (r = n === Zi, a = n === Qi, c = n === Ki), { leftButton: r, middleButton: a, rightButton: c };
|
|
4508
|
+
}
|
|
4509
|
+
function na(e, t) {
|
|
4510
|
+
const s = e.center;
|
|
4511
|
+
if (!s)
|
|
4512
|
+
return null;
|
|
4513
|
+
const n = t.getBoundingClientRect(), r = n.width / t.offsetWidth || 1, a = n.height / t.offsetHeight || 1, c = {
|
|
4514
|
+
x: (s.x - n.left - t.clientLeft) / r,
|
|
4515
|
+
y: (s.y - n.top - t.clientTop) / a
|
|
4516
|
+
};
|
|
4517
|
+
return { center: s, offsetCenter: c };
|
|
4518
|
+
}
|
|
4519
|
+
const Ft = {
|
|
4520
|
+
srcElement: "root",
|
|
4521
|
+
priority: 0
|
|
4522
|
+
};
|
|
4523
|
+
class oa {
|
|
4524
|
+
constructor(t) {
|
|
4525
|
+
this.handleEvent = (s) => {
|
|
4526
|
+
if (this.isEmpty())
|
|
4527
|
+
return;
|
|
4528
|
+
const n = this._normalizeEvent(s);
|
|
4529
|
+
let r = s.srcEvent.target;
|
|
4530
|
+
for (; r && r !== n.rootElement; ) {
|
|
4531
|
+
if (this._emit(n, r), n.handled)
|
|
4532
|
+
return;
|
|
4533
|
+
r = r.parentNode;
|
|
4534
|
+
}
|
|
4535
|
+
this._emit(n, "root");
|
|
4536
|
+
}, this.eventManager = t, this.handlers = [], this.handlersByElement = /* @__PURE__ */ new Map(), this._active = !1;
|
|
4537
|
+
}
|
|
4538
|
+
// Returns true if there are no non-passive handlers
|
|
4539
|
+
isEmpty() {
|
|
4540
|
+
return !this._active;
|
|
4541
|
+
}
|
|
4542
|
+
add(t, s, n, r = !1, a = !1) {
|
|
4543
|
+
const { handlers: c, handlersByElement: d } = this;
|
|
4544
|
+
let u = Ft;
|
|
4545
|
+
typeof n == "string" || n && n.addEventListener ? u = { ...Ft, srcElement: n } : n && (u = { ...Ft, ...n });
|
|
4546
|
+
let f = d.get(u.srcElement);
|
|
4547
|
+
f || (f = [], d.set(u.srcElement, f));
|
|
4548
|
+
const g = {
|
|
4549
|
+
type: t,
|
|
4550
|
+
handler: s,
|
|
4551
|
+
srcElement: u.srcElement,
|
|
4552
|
+
priority: u.priority
|
|
4553
|
+
};
|
|
4554
|
+
r && (g.once = !0), a && (g.passive = !0), c.push(g), this._active = this._active || !g.passive;
|
|
4555
|
+
let v = f.length - 1;
|
|
4556
|
+
for (; v >= 0 && !(f[v].priority >= g.priority); )
|
|
4557
|
+
v--;
|
|
4558
|
+
f.splice(v + 1, 0, g);
|
|
4559
|
+
}
|
|
4560
|
+
remove(t, s) {
|
|
4561
|
+
const { handlers: n, handlersByElement: r } = this;
|
|
4562
|
+
for (let a = n.length - 1; a >= 0; a--) {
|
|
4563
|
+
const c = n[a];
|
|
4564
|
+
if (c.type === t && c.handler === s) {
|
|
4565
|
+
n.splice(a, 1);
|
|
4566
|
+
const d = r.get(c.srcElement);
|
|
4567
|
+
d.splice(d.indexOf(c), 1), d.length === 0 && r.delete(c.srcElement);
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4570
|
+
this._active = n.some((a) => !a.passive);
|
|
4571
|
+
}
|
|
4572
|
+
/**
|
|
4573
|
+
* Invoke handlers on a particular element
|
|
4574
|
+
*/
|
|
4575
|
+
_emit(t, s) {
|
|
4576
|
+
const n = this.handlersByElement.get(s);
|
|
4577
|
+
if (n) {
|
|
4578
|
+
let r = !1;
|
|
4579
|
+
const a = () => {
|
|
4580
|
+
t.handled = !0;
|
|
4581
|
+
}, c = () => {
|
|
4582
|
+
t.handled = !0, r = !0;
|
|
4583
|
+
}, d = [];
|
|
4584
|
+
for (let u = 0; u < n.length; u++) {
|
|
4585
|
+
const { type: f, handler: g, once: v } = n[u];
|
|
4586
|
+
if (g({
|
|
4587
|
+
...t,
|
|
4588
|
+
// @ts-ignore
|
|
4589
|
+
type: f,
|
|
4590
|
+
stopPropagation: a,
|
|
4591
|
+
stopImmediatePropagation: c
|
|
4592
|
+
}), v && d.push(n[u]), r)
|
|
4593
|
+
break;
|
|
4594
|
+
}
|
|
4595
|
+
for (let u = 0; u < d.length; u++) {
|
|
4596
|
+
const { type: f, handler: g } = d[u];
|
|
4597
|
+
this.remove(f, g);
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
}
|
|
4601
|
+
/**
|
|
4602
|
+
* Normalizes hammerjs and custom events to have predictable fields.
|
|
4603
|
+
*/
|
|
4604
|
+
_normalizeEvent(t) {
|
|
4605
|
+
const s = this.eventManager.getElement();
|
|
4606
|
+
return {
|
|
4607
|
+
...t,
|
|
4608
|
+
...sa(t),
|
|
4609
|
+
...na(t, s),
|
|
4610
|
+
preventDefault: () => {
|
|
4611
|
+
t.srcEvent.preventDefault();
|
|
4612
|
+
},
|
|
4613
|
+
stopImmediatePropagation: null,
|
|
4614
|
+
stopPropagation: null,
|
|
4615
|
+
handled: !1,
|
|
4616
|
+
rootElement: s
|
|
4617
|
+
};
|
|
4618
|
+
}
|
|
4619
|
+
}
|
|
4620
|
+
const ra = {
|
|
4621
|
+
// event handlers
|
|
4622
|
+
events: null,
|
|
4623
|
+
// custom recognizers
|
|
4624
|
+
recognizers: null,
|
|
4625
|
+
recognizerOptions: {},
|
|
4626
|
+
// Manager class
|
|
4627
|
+
Manager: Oi,
|
|
4628
|
+
// allow browser default touch action
|
|
4629
|
+
// https://github.com/uber/react-map-gl/issues/506
|
|
4630
|
+
touchAction: "none",
|
|
4631
|
+
tabIndex: 0
|
|
4632
|
+
};
|
|
4633
|
+
class ia {
|
|
4634
|
+
constructor(t = null, s) {
|
|
4635
|
+
this._onBasicInput = (r) => {
|
|
4636
|
+
const { srcEvent: a } = r, c = Vi[a.type];
|
|
4637
|
+
c && this.manager.emit(c, r);
|
|
4638
|
+
}, this._onOtherEvent = (r) => {
|
|
4639
|
+
this.manager.emit(r.type, r);
|
|
4640
|
+
}, this.options = { ...ra, ...s }, this.events = /* @__PURE__ */ new Map(), this.setElement(t);
|
|
4641
|
+
const { events: n } = this.options;
|
|
4642
|
+
n && this.on(n);
|
|
4643
|
+
}
|
|
4644
|
+
getElement() {
|
|
4645
|
+
return this.element;
|
|
4646
|
+
}
|
|
4647
|
+
setElement(t) {
|
|
4648
|
+
if (this.element && this.destroy(), this.element = t, !t)
|
|
4649
|
+
return;
|
|
4650
|
+
const { options: s } = this, n = s.Manager;
|
|
4651
|
+
this.manager = new n(t, {
|
|
4652
|
+
touchAction: s.touchAction,
|
|
4653
|
+
recognizers: s.recognizers || ki
|
|
4654
|
+
}).on("hammer.input", this._onBasicInput), s.recognizers || Object.keys(Fs).forEach((r) => {
|
|
4655
|
+
const a = this.manager.get(r);
|
|
4656
|
+
a && Fs[r].forEach((c) => {
|
|
4657
|
+
a.recognizeWith(c);
|
|
4658
|
+
});
|
|
4659
|
+
});
|
|
4660
|
+
for (const r in s.recognizerOptions) {
|
|
4661
|
+
const a = this.manager.get(r);
|
|
4662
|
+
if (a) {
|
|
4663
|
+
const c = s.recognizerOptions[r];
|
|
4664
|
+
delete c.enable, a.set(c);
|
|
4665
|
+
}
|
|
4666
|
+
}
|
|
4667
|
+
this.wheelInput = new Fi(t, this._onOtherEvent, {
|
|
4668
|
+
enable: !1
|
|
4669
|
+
}), this.moveInput = new ji(t, this._onOtherEvent, {
|
|
4670
|
+
enable: !1
|
|
4671
|
+
}), this.keyInput = new Yi(t, this._onOtherEvent, {
|
|
4672
|
+
enable: !1,
|
|
4673
|
+
tabIndex: s.tabIndex
|
|
4674
|
+
}), this.contextmenuInput = new Wi(t, this._onOtherEvent, {
|
|
4675
|
+
enable: !1
|
|
4676
|
+
});
|
|
4677
|
+
for (const [r, a] of this.events)
|
|
4678
|
+
a.isEmpty() || (this._toggleRecognizer(a.recognizerName, !0), this.manager.on(r, a.handleEvent));
|
|
4679
|
+
}
|
|
4680
|
+
// Tear down internal event management implementations.
|
|
4681
|
+
destroy() {
|
|
4682
|
+
this.element && (this.wheelInput.destroy(), this.moveInput.destroy(), this.keyInput.destroy(), this.contextmenuInput.destroy(), this.manager.destroy(), this.wheelInput = null, this.moveInput = null, this.keyInput = null, this.contextmenuInput = null, this.manager = null, this.element = null);
|
|
4683
|
+
}
|
|
4684
|
+
/** Register an event handler function to be called on `event` */
|
|
4685
|
+
on(t, s, n) {
|
|
4686
|
+
this._addEventHandler(t, s, n, !1);
|
|
4687
|
+
}
|
|
4688
|
+
once(t, s, n) {
|
|
4689
|
+
this._addEventHandler(t, s, n, !0);
|
|
4690
|
+
}
|
|
4691
|
+
watch(t, s, n) {
|
|
4692
|
+
this._addEventHandler(t, s, n, !1, !0);
|
|
4693
|
+
}
|
|
4694
|
+
off(t, s) {
|
|
4695
|
+
this._removeEventHandler(t, s);
|
|
4696
|
+
}
|
|
4697
|
+
/*
|
|
4698
|
+
* Enable/disable recognizer for the given event
|
|
4699
|
+
*/
|
|
4700
|
+
_toggleRecognizer(t, s) {
|
|
4701
|
+
const { manager: n } = this;
|
|
4702
|
+
if (!n)
|
|
4703
|
+
return;
|
|
4704
|
+
const r = n.get(t);
|
|
4705
|
+
if (r && r.options.enable !== s) {
|
|
4706
|
+
r.set({ enable: s });
|
|
4707
|
+
const a = Li[t];
|
|
4708
|
+
a && !this.options.recognizers && a.forEach((c) => {
|
|
4709
|
+
const d = n.get(c);
|
|
4710
|
+
s ? (d.requireFailure(t), r.dropRequireFailure(c)) : d.dropRequireFailure(t);
|
|
4711
|
+
});
|
|
4712
|
+
}
|
|
4713
|
+
this.wheelInput.enableEventType(t, s), this.moveInput.enableEventType(t, s), this.keyInput.enableEventType(t, s), this.contextmenuInput.enableEventType(t, s);
|
|
4714
|
+
}
|
|
4715
|
+
/**
|
|
4716
|
+
* Process the event registration for a single event + handler.
|
|
4717
|
+
*/
|
|
4718
|
+
_addEventHandler(t, s, n, r, a) {
|
|
4719
|
+
if (typeof t != "string") {
|
|
4720
|
+
n = s;
|
|
4721
|
+
for (const g in t)
|
|
4722
|
+
this._addEventHandler(g, t[g], n, r, a);
|
|
4723
|
+
return;
|
|
4724
|
+
}
|
|
4725
|
+
const { manager: c, events: d } = this, u = qs[t] || t;
|
|
4726
|
+
let f = d.get(u);
|
|
4727
|
+
f || (f = new oa(this), d.set(u, f), f.recognizerName = Ui[u] || u, c && c.on(u, f.handleEvent)), f.add(t, s, n, r, a), f.isEmpty() || this._toggleRecognizer(f.recognizerName, !0);
|
|
4728
|
+
}
|
|
4729
|
+
/**
|
|
4730
|
+
* Process the event deregistration for a single event + handler.
|
|
4731
|
+
*/
|
|
4732
|
+
_removeEventHandler(t, s) {
|
|
4733
|
+
if (typeof t != "string") {
|
|
4734
|
+
for (const c in t)
|
|
4735
|
+
this._removeEventHandler(c, t[c]);
|
|
4736
|
+
return;
|
|
4737
|
+
}
|
|
4738
|
+
const { events: n } = this, r = qs[t] || t, a = n.get(r);
|
|
4739
|
+
if (a && (a.remove(t, s), a.isEmpty())) {
|
|
4740
|
+
const { recognizerName: c } = a;
|
|
4741
|
+
let d = !1;
|
|
4742
|
+
for (const u of n.values())
|
|
4743
|
+
if (u.recognizerName === c && !u.isEmpty()) {
|
|
4744
|
+
d = !0;
|
|
4745
|
+
break;
|
|
4746
|
+
}
|
|
4747
|
+
d || this._toggleRecognizer(c, !1);
|
|
4748
|
+
}
|
|
4749
|
+
}
|
|
4750
|
+
}
|
|
4751
|
+
const aa = {
|
|
4752
|
+
__name: "PgInteractionDetector",
|
|
4753
|
+
setup(e) {
|
|
4754
|
+
const t = he(), s = Te(), n = j(null), r = j([]), a = j("ended"), c = j(0);
|
|
4755
|
+
let d;
|
|
4756
|
+
const { playing: u } = S(t), f = () => s.previous(), g = () => s.next(), v = () => s.close(), C = () => u.value ? s.pause() : s.play(), _ = (b) => b.reduce((x, F) => x + F, 0) / b.length, D = (b) => Math.abs(_(b)), P = (b) => {
|
|
4757
|
+
const x = b.srcEvent.keyCode;
|
|
4758
|
+
if (x === 27 || (b.ctrlKey || b.altKey) && x === 87) {
|
|
4759
|
+
v();
|
|
4760
|
+
return;
|
|
4761
|
+
}
|
|
4762
|
+
if (x === 32) {
|
|
4763
|
+
C();
|
|
4764
|
+
return;
|
|
4765
|
+
}
|
|
4766
|
+
if (x === 13 || x === 9 || x === 39) {
|
|
4767
|
+
g();
|
|
4768
|
+
return;
|
|
4769
|
+
}
|
|
4770
|
+
if (x === 37) {
|
|
4771
|
+
f();
|
|
4772
|
+
return;
|
|
4773
|
+
}
|
|
4774
|
+
}, I = (b) => {
|
|
4775
|
+
if (!(b && (b.wheelDelta || b.deltaX))) return;
|
|
4776
|
+
const F = b.deltaX, le = b.deltaY, Ve = 2;
|
|
4777
|
+
if ((le > Ve || le < -Ve) && F === 0 || b.ctrlKey)
|
|
4778
|
+
return;
|
|
4779
|
+
b.preventDefault();
|
|
4780
|
+
const ye = b.wheelDeltaX, Q = Q.value, ce = D(r.value);
|
|
4781
|
+
if (Q.value = ce, r.value.push(ye), r.value.length > 6 && r.value.shift(), Math.abs(ye) < 80)
|
|
4782
|
+
return;
|
|
4783
|
+
const G = D(r.value);
|
|
4784
|
+
if (a.value === "ended" && ce < G && Q < G && Q < ce) {
|
|
4785
|
+
if (a.value = "started", c.value = Date.now(), ye > 0) {
|
|
4786
|
+
ce();
|
|
4787
|
+
return;
|
|
4788
|
+
}
|
|
4789
|
+
g();
|
|
4790
|
+
return;
|
|
4791
|
+
}
|
|
4792
|
+
a.value === "started" && G < ce && G < Q && ce < Q && (a.value = "ended");
|
|
4793
|
+
};
|
|
4794
|
+
return bt(() => {
|
|
4795
|
+
d = new ia(n.value, {
|
|
4796
|
+
recognizers: [
|
|
4797
|
+
// RecognizerClass, [options], [recognizeWith, ...], [requireFailure, ...]
|
|
4798
|
+
[Hammer.Pinch],
|
|
4799
|
+
// [Hammer.DoubleTab],
|
|
4800
|
+
[Hammer.Tap],
|
|
4801
|
+
// [Hammer.Pan, { pointers: 0 }],
|
|
4802
|
+
[Hammer.Swipe, { direction: Hammer.DIRECTION_HORIZONTAL }]
|
|
4803
|
+
]
|
|
4804
|
+
}), d.on({
|
|
4805
|
+
swipeleft: g,
|
|
4806
|
+
swiperight: f,
|
|
4807
|
+
// pinchmove: onPinchMove,
|
|
4808
|
+
// pinchin: onPinchIn,
|
|
4809
|
+
pinchout: v,
|
|
4810
|
+
wheel: I,
|
|
4811
|
+
// keyup: onKeyUp,
|
|
4812
|
+
keydown: P,
|
|
4813
|
+
doubletap: v,
|
|
4814
|
+
tap: C
|
|
4815
|
+
// pointerdown: togglePlay,
|
|
4816
|
+
});
|
|
4817
|
+
}), Jt(() => {
|
|
4818
|
+
d && d.destroy();
|
|
4819
|
+
}), (b, x) => (O(), $("div", {
|
|
4820
|
+
class: "pg-interaction-detector",
|
|
4821
|
+
ref_key: "detector",
|
|
4822
|
+
ref: n
|
|
4823
|
+
}, null, 512));
|
|
4824
|
+
}
|
|
4825
|
+
}, la = T({
|
|
4826
|
+
name: "PgAdvancedButton",
|
|
4827
|
+
setup(e, { slots: t, emit: s }) {
|
|
4828
|
+
const n = k(), { lang: r } = M(), a = y(() => {
|
|
4829
|
+
var u;
|
|
4830
|
+
return (u = r.value.pg) == null ? void 0 : u.buttons.advanced.title;
|
|
4831
|
+
}), c = () => n.mobileActive = St;
|
|
4832
|
+
function d() {
|
|
4833
|
+
const u = {
|
|
4834
|
+
class: "pg-button-advanced",
|
|
4835
|
+
"data-cy": "pg-button-advanced",
|
|
4836
|
+
label: a.value,
|
|
4837
|
+
onClick: c,
|
|
4838
|
+
rounded: !0,
|
|
4839
|
+
outline: !0,
|
|
4840
|
+
color: "primary"
|
|
4841
|
+
};
|
|
4842
|
+
return h(Oe, u);
|
|
4843
|
+
}
|
|
4844
|
+
return () => d();
|
|
4845
|
+
}
|
|
4846
|
+
}), ca = T({
|
|
4847
|
+
name: "PgDefaultButtonRow",
|
|
4848
|
+
setup(e, { slots: t, emit: s }) {
|
|
4849
|
+
function n() {
|
|
4850
|
+
return h("div", {
|
|
4851
|
+
class: "pg-drawer-button-row q-pt-md q-pb-sm row"
|
|
4852
|
+
}, [
|
|
4853
|
+
h("div", { class: "col text-center" }, [h(Ln)]),
|
|
4854
|
+
h("div", { class: "col text-center" }, [h(la)])
|
|
4855
|
+
]);
|
|
4856
|
+
}
|
|
4857
|
+
return () => n();
|
|
4858
|
+
}
|
|
4859
|
+
}), ua = T({
|
|
4860
|
+
name: "PgDefaultDrawer",
|
|
4861
|
+
props: {},
|
|
4862
|
+
emits: ["click"],
|
|
4863
|
+
setup(e, { slots: t, emit: s }) {
|
|
4864
|
+
return () => h(
|
|
4865
|
+
ln,
|
|
4866
|
+
{ name: Me },
|
|
4867
|
+
{
|
|
4868
|
+
default: () => h(kn, { center: !0 }),
|
|
4869
|
+
secondary: () => [
|
|
4870
|
+
h(ts, { playMode: !0 }),
|
|
4871
|
+
h(ca)
|
|
4872
|
+
]
|
|
4873
|
+
}
|
|
4874
|
+
);
|
|
4875
|
+
}
|
|
4876
|
+
}), da = T({
|
|
4877
|
+
name: "PgAdvancedDrawer",
|
|
4878
|
+
props: {},
|
|
4879
|
+
emits: ["click"],
|
|
4880
|
+
setup(e, { slots: t, emit: s }) {
|
|
4881
|
+
const { lang: n } = M(), r = y(() => {
|
|
4882
|
+
var a;
|
|
4883
|
+
return (a = n.value.pg) == null ? void 0 : a.buttons.advanced.title;
|
|
4884
|
+
});
|
|
4885
|
+
return () => h(
|
|
4886
|
+
ln,
|
|
4887
|
+
{ class: "pg-effects-drawer", name: St, label: r.value },
|
|
4888
|
+
{
|
|
4889
|
+
default: () => h(Vn, { center: !0, playMode: !0 })
|
|
4890
|
+
}
|
|
4891
|
+
);
|
|
4892
|
+
}
|
|
4893
|
+
}), ha = T({
|
|
4894
|
+
name: "TsDrawers",
|
|
4895
|
+
setup(e, { slots: t, emit: s }) {
|
|
4896
|
+
const n = k(), { mobileActive: r } = S(n);
|
|
4897
|
+
function a() {
|
|
4898
|
+
return h(
|
|
4899
|
+
qo,
|
|
4900
|
+
{
|
|
4901
|
+
modelValue: r.value,
|
|
4902
|
+
"onUpdate:modelValue": (c) => r.value = c
|
|
4903
|
+
},
|
|
4904
|
+
() => [h(ua), h(da)]
|
|
4905
|
+
);
|
|
4906
|
+
}
|
|
4907
|
+
return () => a();
|
|
4908
|
+
}
|
|
4909
|
+
}), pa = { class: "pg-viewport full-height" }, fa = {
|
|
4910
|
+
__name: "PgViewport",
|
|
4911
|
+
props: {
|
|
4912
|
+
modelValue: Boolean
|
|
4913
|
+
},
|
|
4914
|
+
emits: ["update:modelValue"],
|
|
4915
|
+
setup(e, { emit: t }) {
|
|
4916
|
+
const s = It(), n = j(s.platform.is.desktop), r = j(s.platform.is.mobile), a = k();
|
|
4917
|
+
X();
|
|
4918
|
+
const { loading: c } = S(a), d = e, u = t;
|
|
4919
|
+
j(!0);
|
|
4920
|
+
const f = y({
|
|
4921
|
+
get() {
|
|
4922
|
+
return d.modelValue;
|
|
4923
|
+
},
|
|
4924
|
+
set(g) {
|
|
4925
|
+
u("update:modelValue", g);
|
|
4926
|
+
}
|
|
4927
|
+
});
|
|
4928
|
+
return (g, v) => (O(), _t(qt, { name: "fade" }, {
|
|
4929
|
+
default: jt(() => [
|
|
4930
|
+
vt(De("div", pa, [
|
|
4931
|
+
B(aa),
|
|
4932
|
+
B(A(On)),
|
|
4933
|
+
B(xi),
|
|
4934
|
+
B(qt, { name: "fade" }, {
|
|
4935
|
+
default: jt(() => [
|
|
4936
|
+
vt(B(A(Ao), { class: "loading-graphic" }, null, 512), [
|
|
4937
|
+
[yt, A(c)]
|
|
4938
|
+
])
|
|
4939
|
+
]),
|
|
4940
|
+
_: 1
|
|
4941
|
+
}),
|
|
4942
|
+
B(A(Ei)),
|
|
4943
|
+
B(A(bi), {
|
|
4944
|
+
class: "desktop-only",
|
|
4945
|
+
modelValue: n.value,
|
|
4946
|
+
"onUpdate:modelValue": v[0] || (v[0] = (C) => n.value = C)
|
|
4947
|
+
}, null, 8, ["modelValue"]),
|
|
4948
|
+
vt(B(A(ha), { class: "mobile-only" }, null, 512), [
|
|
4949
|
+
[yt, r.value]
|
|
4950
|
+
])
|
|
4951
|
+
], 512), [
|
|
4952
|
+
[yt, f.value]
|
|
4953
|
+
])
|
|
4954
|
+
]),
|
|
4955
|
+
_: 1
|
|
4956
|
+
}));
|
|
4957
|
+
}
|
|
4958
|
+
}, _a = T({
|
|
4959
|
+
name: "PoseGenerator",
|
|
4960
|
+
options: { slug: "pose-generator" },
|
|
4961
|
+
setup(e, { slots: t, emit: s }) {
|
|
4962
|
+
const n = Io(), r = Symbol.for("user-auth"), a = bo(r), c = Pt(), d = Te(), u = X(), f = k(), { show: g } = S(d), { authenticated: v } = S(a), { filters: C } = S(c), { filterData: _ } = S(f);
|
|
4963
|
+
let D = 0;
|
|
4964
|
+
Ne(v, (I, b) => {
|
|
4965
|
+
I === !1 && f.customReset(), I === !0 && b !== !0 && f.getSettings();
|
|
4966
|
+
}), Ne(_, () => {
|
|
4967
|
+
D++, u.updateQueue(), !(D < 3) && (console.log("watch filterData pgStore.setSettings()"), f.setSettings());
|
|
4968
|
+
}), Ne(
|
|
4969
|
+
() => n.fullPath,
|
|
4970
|
+
() => {
|
|
4971
|
+
d.pause();
|
|
4972
|
+
},
|
|
4973
|
+
{ immediate: !0 }
|
|
4974
|
+
), No(), bt(() => {
|
|
4975
|
+
f.init(), f.fetch().then(() => {
|
|
4976
|
+
u.loadQueue();
|
|
4977
|
+
}).catch(() => {
|
|
4978
|
+
});
|
|
4979
|
+
});
|
|
4980
|
+
function P() {
|
|
4981
|
+
const I = {
|
|
4982
|
+
modelValue: g.value,
|
|
4983
|
+
"onUpdate:show": (b) => g.value = b
|
|
4984
|
+
};
|
|
4985
|
+
return [
|
|
4986
|
+
// overlay can now be absolutely positioned within the wrapper
|
|
4987
|
+
// h(GridOverlay, { style: 'z-index: 5;' }),
|
|
4988
|
+
h(yi),
|
|
4989
|
+
h(fa, I)
|
|
4990
|
+
];
|
|
4991
|
+
}
|
|
4992
|
+
return () => P();
|
|
4993
|
+
}
|
|
4994
|
+
});
|
|
4995
|
+
export {
|
|
4996
|
+
_a as PoseGenerator,
|
|
4997
|
+
k as usePgStore
|
|
4998
|
+
};
|