@limrun/ui 0.22.1 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -7
- package/dist/{BufferGeometryUtils-B2-bJqFj.js → BufferGeometryUtils-CMbyl1DL.js} +1 -1
- package/dist/{BufferGeometryUtils-BcXIkYhS.mjs → BufferGeometryUtils-DEy5W2hb.mjs} +1 -1
- package/dist/{GLTFLoader-BQvr_TBF.mjs → GLTFLoader-B3xbM8m1.mjs} +2 -2
- package/dist/{GLTFLoader-CsxjkQ8a.js → GLTFLoader-CfPNHfJQ.js} +1 -1
- package/dist/components/macbook-geometry.d.ts +5 -5
- package/dist/components/model-source.d.ts +4 -1
- package/dist/components/remote-control.d.ts +3 -2
- package/dist/{duo-frame-CyoWZakh.mjs → duo-frame-BCmB9_5p.mjs} +4 -4
- package/dist/{duo-frame-B04_gIge.js → duo-frame-Bm0hprn9.js} +2 -2
- package/dist/{duo-view-DJEQ3Q74.mjs → duo-view-C07GD_5E.mjs} +2 -2
- package/dist/{duo-view-BHwnQmx_.js → duo-view-tUJbbWoS.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +2 -2
- package/dist/lite.cjs +1 -1
- package/dist/lite.js +1 -1
- package/dist/macbook-frame-BxJfxUcU.js +2 -0
- package/dist/macbook-frame-Dm6ko0j9.mjs +340 -0
- package/dist/macbook-model-B4t8BSHX.js +1 -0
- package/dist/macbook-model-BYrio_FY.mjs +4 -0
- package/dist/{model-source-BAZAKTcr.mjs → model-source-CN_i4mVy.mjs} +57 -47
- package/dist/{model-source-DbYJQWkh.js → model-source-D3_k9qRK.js} +1 -1
- package/dist/{remote-control-PGtDEDgm.mjs → remote-control-BX6dzHtt.mjs} +686 -720
- package/dist/remote-control-CEVcOPQZ.js +1 -0
- package/package.json +1 -1
- package/dist/macbook-frame-Be0dCliH.js +0 -3
- package/dist/macbook-frame-DzwIHHCA.mjs +0 -344
- package/dist/macbook-model-BiMxLpmf.mjs +0 -4
- package/dist/macbook-model-BpUdvtlU.js +0 -1
- package/dist/remote-control-Db6ssV0S.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as ee, jsx as w, Fragment as
|
|
2
|
-
import { M as Q, o as
|
|
3
|
-
import { useReducer as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import './index.css';const
|
|
1
|
+
import { jsxs as ee, jsx as w, Fragment as Co } from "react/jsx-runtime";
|
|
2
|
+
import { M as Q, o as ln, q as dn, f as un, c as Ro, d as hn, b as fn, r as mn, s as pn, t as wo, u as Qe, v as gn, e as yn, w as G, x as Bt, y as vn, z as bn, B as Ct, C as B, E as Rt, a as wn, F as Mn, G as x, I as An } from "./core-nbvkIrvp.mjs";
|
|
3
|
+
import { useReducer as Tn, useRef as H, useCallback as kt, memo as zt, useState as D, useEffect as J, useMemo as Xe, lazy as Oo, forwardRef as Cn, useImperativeHandle as Rn, Suspense as Mo } from "react";
|
|
4
|
+
import { createPortal as On } from "react-dom";
|
|
5
|
+
import './index.css';const ce = {
|
|
6
6
|
sideBezel: 1.7,
|
|
7
7
|
topBezel: 2.4,
|
|
8
8
|
chin: 2.4,
|
|
@@ -10,9 +10,9 @@ import './index.css';const se = {
|
|
|
10
10
|
baseOverhang: 4,
|
|
11
11
|
screenRadius: 0.9,
|
|
12
12
|
lidThickness: 0.7
|
|
13
|
-
},
|
|
14
|
-
function
|
|
15
|
-
const t = 100 / a, r = t +
|
|
13
|
+
}, Ut = 100 + 2 * ce.sideBezel, at = Ut + 2 * ce.baseOverhang, Kt = ce.topBezel + ce.chin + ce.baseHeight, En = (Kt - 2 * ce.topBezel) / 2, oi = 8;
|
|
14
|
+
function Nn(a) {
|
|
15
|
+
const t = 100 / a, r = t + ce.topBezel + ce.chin;
|
|
16
16
|
return {
|
|
17
17
|
screenHeight: t,
|
|
18
18
|
lidHeight: r,
|
|
@@ -20,148 +20,148 @@ function Hn(a) {
|
|
|
20
20
|
depth: r
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
return
|
|
23
|
+
const kn = Math.PI / 2, ni = 135, ii = 100, ri = 2400;
|
|
24
|
+
function ci(a) {
|
|
25
|
+
return kn - a * Math.PI / 180;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function si(a) {
|
|
28
28
|
const t = Math.max(0, Math.min(1, a));
|
|
29
29
|
return 1 - Math.pow(1 - t, 3);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ye(a, t, r, l = 6) {
|
|
32
32
|
const p = [], v = [
|
|
33
33
|
[a / 2 - r.top, t / 2 - r.top, r.top, 0],
|
|
34
34
|
[-a / 2 + r.top, t / 2 - r.top, r.top, Math.PI / 2],
|
|
35
35
|
[-a / 2 + r.bottom, -t / 2 + r.bottom, r.bottom, Math.PI],
|
|
36
36
|
[a / 2 - r.bottom, -t / 2 + r.bottom, r.bottom, Math.PI * 1.5]
|
|
37
37
|
];
|
|
38
|
-
for (const [
|
|
39
|
-
for (let
|
|
40
|
-
const E =
|
|
41
|
-
p.push({ x:
|
|
38
|
+
for (const [m, b, T, k] of v)
|
|
39
|
+
for (let I = 0; I <= l; I++) {
|
|
40
|
+
const E = k + I * Math.PI / 2 / l;
|
|
41
|
+
p.push({ x: m + T * Math.cos(E), y: b + T * Math.sin(E), nx: Math.cos(E), ny: Math.sin(E) });
|
|
42
42
|
}
|
|
43
43
|
return p;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const { screenHeight: t, lidHeight: r, depth: l } =
|
|
47
|
-
const Y = M.map((ne) => ne.x),
|
|
48
|
-
...
|
|
49
|
-
...
|
|
50
|
-
(ne -
|
|
51
|
-
(
|
|
52
|
-
],
|
|
45
|
+
function ai(a) {
|
|
46
|
+
const { screenHeight: t, lidHeight: r, depth: l } = Nn(a), p = [], v = (u, y, M) => p.push({ part: u, kind: y, vertices: new Float32Array(M) }), m = (u, y, M, W, P) => {
|
|
47
|
+
const Y = M.map((ne) => ne.x), j = M.map((ne) => ne.y), [le, te, ye, q] = [Math.min(...Y), Math.max(...Y), Math.min(...j), Math.max(...j)], oe = (le + te) / 2, R = (ye + q) / 2, Ae = (ne, K) => [
|
|
48
|
+
...W(ne, K),
|
|
49
|
+
...P,
|
|
50
|
+
(ne - le) / (te - le || 1),
|
|
51
|
+
(K - ye) / (q - ye || 1)
|
|
52
|
+
], lt = [];
|
|
53
53
|
for (let ne = 0; ne < M.length; ne++) {
|
|
54
|
-
const
|
|
55
|
-
for (const
|
|
54
|
+
const K = M[ne], Re = M[(ne + 1) % M.length];
|
|
55
|
+
for (const $e of [Ae(oe, R), Ae(K.x, K.y), Ae(Re.x, Re.y)]) lt.push(...$e);
|
|
56
56
|
}
|
|
57
|
-
v(
|
|
58
|
-
}, b = (
|
|
59
|
-
const
|
|
57
|
+
v(u, y, lt);
|
|
58
|
+
}, b = (u, y, M, W, P, Y, j) => {
|
|
59
|
+
const le = [];
|
|
60
60
|
for (let te = 0; te < M.length; te++) {
|
|
61
|
-
const ye = M[te],
|
|
62
|
-
for (const
|
|
61
|
+
const ye = M[te], q = M[(te + 1) % M.length], oe = (R, Ae) => [...W(R.x, R.y, Ae), ...P(R.nx, R.ny), 0, 0];
|
|
62
|
+
for (const R of [
|
|
63
63
|
oe(ye, Y),
|
|
64
|
-
oe(
|
|
65
|
-
oe(
|
|
64
|
+
oe(q, Y),
|
|
65
|
+
oe(q, j),
|
|
66
66
|
oe(ye, Y),
|
|
67
|
-
oe(
|
|
68
|
-
oe(ye,
|
|
67
|
+
oe(q, j),
|
|
68
|
+
oe(ye, j)
|
|
69
69
|
])
|
|
70
|
-
|
|
70
|
+
le.push(...R);
|
|
71
71
|
}
|
|
72
|
-
v(
|
|
73
|
-
},
|
|
72
|
+
v(u, y, le);
|
|
73
|
+
}, T = Ye(Ut, r, { top: 2.2, bottom: 0.4 }), k = (u) => u + r / 2, I = ce.lidThickness;
|
|
74
74
|
b(
|
|
75
75
|
"lid",
|
|
76
76
|
"shell",
|
|
77
|
-
|
|
78
|
-
(
|
|
79
|
-
(
|
|
80
|
-
-
|
|
77
|
+
T,
|
|
78
|
+
(u, y, M) => [u, k(y), M],
|
|
79
|
+
(u, y) => [u, y, 0],
|
|
80
|
+
-I,
|
|
81
81
|
0
|
|
82
|
-
),
|
|
82
|
+
), m("lid", "shell", T, (u, y) => [u, k(y), -I], [0, 0, -1]), m(
|
|
83
83
|
"lid",
|
|
84
84
|
"glass",
|
|
85
|
-
|
|
86
|
-
(
|
|
85
|
+
Ye(Ut - 0.5, r - 0.5, { top: 1.95, bottom: 0.2 }),
|
|
86
|
+
(u, y) => [u, k(y), 0.01],
|
|
87
87
|
[0, 0, 1]
|
|
88
88
|
);
|
|
89
|
-
const E =
|
|
90
|
-
|
|
89
|
+
const E = ce.chin;
|
|
90
|
+
m(
|
|
91
91
|
"lid",
|
|
92
92
|
"screen",
|
|
93
|
-
|
|
94
|
-
(
|
|
93
|
+
Ye(100, t, { top: ce.screenRadius, bottom: 0 }),
|
|
94
|
+
(u, y) => [u, E + t / 2 + y, 0.02],
|
|
95
95
|
[0, 0, 1]
|
|
96
|
-
),
|
|
96
|
+
), m(
|
|
97
97
|
"lid",
|
|
98
98
|
"camera",
|
|
99
|
-
|
|
100
|
-
(
|
|
99
|
+
Ye(0.5, 0.5, { top: 0.25, bottom: 0.25 }, 4),
|
|
100
|
+
(u, y) => [u, r - ce.topBezel / 2 + y, 0.02],
|
|
101
101
|
[0, 0, 1]
|
|
102
102
|
);
|
|
103
|
-
const L =
|
|
103
|
+
const L = Ye(at, l + I, { top: 3, bottom: 3 }), U = (u) => (l - I) / 2 - u;
|
|
104
104
|
b(
|
|
105
105
|
"base",
|
|
106
106
|
"shell",
|
|
107
107
|
L,
|
|
108
|
-
(
|
|
109
|
-
(
|
|
108
|
+
(u, y, M) => [u, M, U(y)],
|
|
109
|
+
(u, y) => [u, 0, -y],
|
|
110
110
|
-2.2,
|
|
111
111
|
0
|
|
112
|
-
),
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
let
|
|
116
|
-
for (const [
|
|
117
|
-
const M = y *
|
|
118
|
-
for (let
|
|
119
|
-
if (
|
|
120
|
-
const Y =
|
|
121
|
-
|
|
112
|
+
), m("base", "shell", L, (u, y) => [u, 0, U(y)], [0, 1, 0]), m("base", "shell", L, (u, y) => [u, -2.2, U(y)], [0, -1, 0]);
|
|
113
|
+
const se = (u, y, M, W, P, Y, j) => m("base", u, Ye(W, P, { top: j, bottom: j }, 3), (le, te) => [y + le, Y, M - te], [0, 1, 0]), Me = at * 0.72, me = l * 0.08, C = [0.55, 1, 1, 1, 1, 1], ae = l * 0.4 / C.reduce((u, y) => u + y, 0);
|
|
114
|
+
se("well", 0, me + l * 0.4 / 2, Me + 1.4, l * 0.4 + 1.4, 0.01, 0.8);
|
|
115
|
+
let V = me;
|
|
116
|
+
for (const [u, y] of C.entries()) {
|
|
117
|
+
const M = y * ae, W = Me / 14;
|
|
118
|
+
for (let P = 0; P < 14; P++) {
|
|
119
|
+
if (u === 5 && P > 4 && P < 9) continue;
|
|
120
|
+
const Y = u === 5 && P === 4 ? 5 : 1;
|
|
121
|
+
se(
|
|
122
122
|
"keys",
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
-Me / 2 + W * (P + Y / 2),
|
|
124
|
+
V + M / 2,
|
|
125
|
+
W * Y - 0.5,
|
|
126
126
|
M - 0.5,
|
|
127
127
|
0.03,
|
|
128
128
|
0.3
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
V += M;
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
se("trackpad", 0, l * 0.72, at * 0.4, l * 0.36, 0.01, 1.2), m(
|
|
134
134
|
"base",
|
|
135
135
|
"scoop",
|
|
136
|
-
|
|
137
|
-
(
|
|
136
|
+
Ye(14, 0.9, { top: 0, bottom: 0.45 }, 3),
|
|
137
|
+
(u, y) => [u, -0.45 + y, l + 0.01],
|
|
138
138
|
[0, 0, 1]
|
|
139
139
|
);
|
|
140
140
|
const S = /* @__PURE__ */ new Map();
|
|
141
|
-
for (const
|
|
142
|
-
const y = `${
|
|
143
|
-
S.set(y, [...S.get(y) ?? [],
|
|
141
|
+
for (const u of p) {
|
|
142
|
+
const y = `${u.part}:${u.kind}`;
|
|
143
|
+
S.set(y, [...S.get(y) ?? [], u]);
|
|
144
144
|
}
|
|
145
|
-
return [...S.values()].map((
|
|
146
|
-
const y = new Float32Array(
|
|
145
|
+
return [...S.values()].map((u) => {
|
|
146
|
+
const y = new Float32Array(u.reduce((W, P) => W + P.vertices.length, 0));
|
|
147
147
|
let M = 0;
|
|
148
|
-
for (const
|
|
149
|
-
y.set(
|
|
150
|
-
return { part:
|
|
148
|
+
for (const W of u)
|
|
149
|
+
y.set(W.vertices, M), M += W.vertices.length;
|
|
150
|
+
return { part: u[0].part, kind: u[0].kind, vertices: y };
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const l =
|
|
155
|
-
return { repeat: [1 /
|
|
153
|
+
function li(a, t, r = 0) {
|
|
154
|
+
const l = a >= t ? 1 : a / t, p = a >= t ? t / a : 1, v = (1 - l) / 2, m = r > 0 ? 1 - p : (1 - p) / 2;
|
|
155
|
+
return { repeat: [1 / l, 1 / p], offset: [(0 - v) / l, (0 - m) / p] };
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function di(a, t, r) {
|
|
158
158
|
const l = a * r.repeat[0] + r.offset[0], p = t * r.repeat[1] + r.offset[1], v = 1e-9;
|
|
159
159
|
if (l < -v || l > 1 + v || p < -v || p > 1 + v) return;
|
|
160
|
-
const
|
|
161
|
-
return { x:
|
|
160
|
+
const m = (b) => Math.max(0, Math.min(1, b));
|
|
161
|
+
return { x: m(l), y: m(1 - p) };
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
class
|
|
163
|
+
const _n = 150, In = 8;
|
|
164
|
+
class Sn {
|
|
165
165
|
constructor(t, r = () => !1) {
|
|
166
166
|
this.send = t, this.blocked = r;
|
|
167
167
|
}
|
|
@@ -173,10 +173,10 @@ class Yn {
|
|
|
173
173
|
screen;
|
|
174
174
|
pointer(t, r, l) {
|
|
175
175
|
const p = t === Q.UP && !!this.last?.buttons;
|
|
176
|
-
this.blocked() && !p || (this.last = { ...r, buttons: l }, this.send(
|
|
176
|
+
this.blocked() && !p || (this.last = { ...r, buttons: l }, this.send(ln(t, r.width, r.height, r.x, r.y, l)));
|
|
177
177
|
}
|
|
178
178
|
scroll(t, r, l) {
|
|
179
|
-
this.blocked() || this.send(
|
|
179
|
+
this.blocked() || this.send(dn(t.width, t.height, t.x, t.y, r, l));
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
182
182
|
* A touch event, its fingers in client coordinates. Returns true when a finger lands on the screen
|
|
@@ -185,15 +185,15 @@ class Yn {
|
|
|
185
185
|
touch(t, r, l) {
|
|
186
186
|
const p = this.gesture;
|
|
187
187
|
if (r.length >= 2) {
|
|
188
|
-
const
|
|
189
|
-
x: r.reduce((b,
|
|
190
|
-
y: r.reduce((b,
|
|
188
|
+
const m = {
|
|
189
|
+
x: r.reduce((b, T) => b + T.x, 0) / r.length,
|
|
190
|
+
y: r.reduce((b, T) => b + T.y, 0) / r.length
|
|
191
191
|
};
|
|
192
192
|
if (p?.mode === "scroll") {
|
|
193
|
-
const b = l.map(
|
|
194
|
-
b && t === "touchmove" && this.scroll(b, (p.x -
|
|
193
|
+
const b = l.map(m.x, m.y);
|
|
194
|
+
b && t === "touchmove" && this.scroll(b, (p.x - m.x) * l.scale, (p.y - m.y) * l.scale);
|
|
195
195
|
} else p?.mode === "press" ? this.lift(p, l) : p?.mode === "pending" && clearTimeout(p.timer);
|
|
196
|
-
return this.gesture = { mode: "scroll", ...
|
|
196
|
+
return this.gesture = { mode: "scroll", ...m }, !1;
|
|
197
197
|
}
|
|
198
198
|
const v = r[0];
|
|
199
199
|
if (v && t === "touchstart" && !p)
|
|
@@ -201,21 +201,21 @@ class Yn {
|
|
|
201
201
|
mode: "pending",
|
|
202
202
|
x: v.x,
|
|
203
203
|
y: v.y,
|
|
204
|
-
timer: setTimeout(() => this.press(),
|
|
204
|
+
timer: setTimeout(() => this.press(), _n)
|
|
205
205
|
}, !0);
|
|
206
206
|
if (v && p?.mode === "pending") {
|
|
207
|
-
if (Math.hypot(v.x - p.x, v.y - p.y) <
|
|
207
|
+
if (Math.hypot(v.x - p.x, v.y - p.y) < In) return !1;
|
|
208
208
|
this.press();
|
|
209
209
|
}
|
|
210
210
|
if (v && this.gesture?.mode === "press") {
|
|
211
211
|
this.gesture = { mode: "press", x: v.x, y: v.y };
|
|
212
|
-
const
|
|
213
|
-
return
|
|
212
|
+
const m = l.map(v.x, v.y);
|
|
213
|
+
return m && this.pointer(Q.MOVE, m, 1), !1;
|
|
214
214
|
}
|
|
215
215
|
if (r.length === 0) {
|
|
216
216
|
p?.mode === "pending" && (t === "touchcancel" ? clearTimeout(p.timer) : this.press());
|
|
217
|
-
const
|
|
218
|
-
|
|
217
|
+
const m = this.gesture;
|
|
218
|
+
m?.mode === "press" && this.lift(m, l), this.gesture = void 0;
|
|
219
219
|
}
|
|
220
220
|
return !1;
|
|
221
221
|
}
|
|
@@ -238,21 +238,21 @@ class Yn {
|
|
|
238
238
|
l && this.pointer(Q.UP, l, 0);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function xn(a, t) {
|
|
242
242
|
return t.type === "choose" ? t.mode === a.mode ? a : t.mode === "3d" ? { ...a, mode: "3d", selection: a.selection + 1 } : { ...a, mode: "2d" } : a.mode !== "3d" || t.selection !== a.selection || a.ready === t.selection ? a : { ...a, ready: t.selection };
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const [t, r] =
|
|
244
|
+
function Pn(a) {
|
|
245
|
+
const [t, r] = Tn(xn, { mode: "2d", selection: 0, ready: 0 }), l = H(t);
|
|
246
246
|
l.current = t;
|
|
247
|
-
const p =
|
|
247
|
+
const p = H(a);
|
|
248
248
|
p.current = a;
|
|
249
|
-
const { mode: v, selection:
|
|
249
|
+
const { mode: v, selection: m, ready: b } = t, T = kt((E) => r({ type: "choose", mode: E }), []), k = kt(() => {
|
|
250
250
|
const E = l.current;
|
|
251
|
-
E.mode !== "3d" || E.selection !==
|
|
252
|
-
}, [
|
|
253
|
-
return { mode: v, shown: v === "3d" && !
|
|
251
|
+
E.mode !== "3d" || E.selection !== m || E.ready === m || (p.current?.(), r({ type: "ready", selection: m }));
|
|
252
|
+
}, [m]), I = v === "3d" && b !== m;
|
|
253
|
+
return { mode: v, shown: v === "3d" && !I ? "3d" : "2d", loading: I, choose: T, onReady: k };
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Hn({ view: a, label: t }) {
|
|
256
256
|
return /* @__PURE__ */ ee("div", { className: "rc-duo-mode", role: "group", "aria-label": t, children: [
|
|
257
257
|
/* @__PURE__ */ w("button", { type: "button", "aria-pressed": a.mode === "2d", onClick: () => a.choose("2d"), children: "2D" }),
|
|
258
258
|
/* @__PURE__ */ w(
|
|
@@ -268,7 +268,7 @@ function Bn({ view: a, label: t }) {
|
|
|
268
268
|
)
|
|
269
269
|
] });
|
|
270
270
|
}
|
|
271
|
-
const
|
|
271
|
+
const Dn = async (a) => {
|
|
272
272
|
if (!a) return !1;
|
|
273
273
|
try {
|
|
274
274
|
if (typeof navigator < "u" && navigator.clipboard?.writeText)
|
|
@@ -283,11 +283,11 @@ const Un = async (a) => {
|
|
|
283
283
|
} catch {
|
|
284
284
|
return !1;
|
|
285
285
|
}
|
|
286
|
-
},
|
|
287
|
-
function({ element: t, screen: r, highlighted: l, selected: p, selectable: v, onClick:
|
|
288
|
-
const b =
|
|
286
|
+
}, Wn = zt(
|
|
287
|
+
function({ element: t, screen: r, highlighted: l, selected: p, selectable: v, onClick: m }) {
|
|
288
|
+
const b = un(t.frame, r);
|
|
289
289
|
if (!b) return null;
|
|
290
|
-
const
|
|
290
|
+
const T = Ro(t);
|
|
291
291
|
return /* @__PURE__ */ w(
|
|
292
292
|
"button",
|
|
293
293
|
{
|
|
@@ -299,9 +299,9 @@ const Un = async (a) => {
|
|
|
299
299
|
"data-ax-role": t.role || void 0,
|
|
300
300
|
"data-highlighted": l ? "true" : "false",
|
|
301
301
|
"data-selected": p ? "true" : "false",
|
|
302
|
-
"aria-label":
|
|
303
|
-
onClick: (
|
|
304
|
-
v && (
|
|
302
|
+
"aria-label": T,
|
|
303
|
+
onClick: (k) => {
|
|
304
|
+
v && (k.preventDefault(), k.stopPropagation(), m(t, { x: k.clientX, y: k.clientY }));
|
|
305
305
|
},
|
|
306
306
|
style: {
|
|
307
307
|
left: `${b.x / r.width * 100}%`,
|
|
@@ -312,47 +312,47 @@ const Un = async (a) => {
|
|
|
312
312
|
}
|
|
313
313
|
);
|
|
314
314
|
},
|
|
315
|
-
(a, t) => a.highlighted === t.highlighted && a.selected === t.selected && a.selectable === t.selectable && a.screen.width === t.screen.width && a.screen.height === t.screen.height && a.onClick === t.onClick &&
|
|
316
|
-
),
|
|
315
|
+
(a, t) => a.highlighted === t.highlighted && a.selected === t.selected && a.selectable === t.selectable && a.screen.width === t.screen.width && a.screen.height === t.screen.height && a.onClick === t.onClick && hn(a.element, t.element)
|
|
316
|
+
), Ln = 260, Yn = 220, Xn = 6, $n = 8, Bn = zt(function({
|
|
317
317
|
element: t,
|
|
318
318
|
platform: r,
|
|
319
319
|
anchor: l,
|
|
320
320
|
cursorAnchored: p,
|
|
321
321
|
showActions: v,
|
|
322
|
-
onTap:
|
|
322
|
+
onTap: m
|
|
323
323
|
}) {
|
|
324
|
-
const [b,
|
|
325
|
-
|
|
324
|
+
const [b, T] = D(null);
|
|
325
|
+
J(() => {
|
|
326
326
|
if (!b) return;
|
|
327
|
-
const
|
|
328
|
-
return () => window.clearTimeout(
|
|
327
|
+
const C = window.setTimeout(() => T(null), 1100);
|
|
328
|
+
return () => window.clearTimeout(C);
|
|
329
329
|
}, [b]);
|
|
330
|
-
const
|
|
331
|
-
const
|
|
332
|
-
let
|
|
333
|
-
const te = `translate(${M ? "0" : "-100%"}, ${
|
|
334
|
-
return
|
|
335
|
-
}, [l.x, l.y]),
|
|
336
|
-
if (!
|
|
337
|
-
await
|
|
338
|
-
}, []),
|
|
339
|
-
return
|
|
330
|
+
const k = Xe(() => {
|
|
331
|
+
const C = Ln, ae = Yn, V = Xn, S = $n, u = typeof window < "u" ? window.innerWidth : 1024, y = typeof window < "u" ? window.innerHeight : 768, M = l.x + V + C <= u - S, W = l.y - V - ae >= S;
|
|
332
|
+
let P = M ? l.x + V : l.x - V, Y = W ? l.y - V : l.y + V;
|
|
333
|
+
const te = `translate(${M ? "0" : "-100%"}, ${W ? "-100%" : "0"})`;
|
|
334
|
+
return P = Math.max(S + (M ? 0 : C), Math.min(u - S - (M ? C : 0), P)), Y = Math.max(S + (W ? ae : 0), Math.min(y - S - (W ? 0 : ae), Y)), { left: `${P}px`, top: `${Y}px`, transform: te };
|
|
335
|
+
}, [l.x, l.y]), I = Xe(() => fn(t, r), [t, r]), E = r === "ios" ? t.selectors.AXUniqueId : t.selectors.resourceId, L = r === "ios" ? "AXUniqueId" : "resourceId", U = kt(async (C, ae) => {
|
|
336
|
+
if (!C) return;
|
|
337
|
+
await Dn(C) && T(ae);
|
|
338
|
+
}, []), se = mn(t), Me = t.label || t.value || se, me = Ro(t);
|
|
339
|
+
return On(
|
|
340
340
|
/* @__PURE__ */ ee(
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
className: "rc-inspect-card",
|
|
344
344
|
"data-cursor-anchored": p ? "true" : "false",
|
|
345
|
-
style:
|
|
346
|
-
onClick: (
|
|
347
|
-
onMouseDown: (
|
|
348
|
-
onMouseMove: (
|
|
345
|
+
style: k,
|
|
346
|
+
onClick: (C) => C.stopPropagation(),
|
|
347
|
+
onMouseDown: (C) => C.stopPropagation(),
|
|
348
|
+
onMouseMove: (C) => C.stopPropagation(),
|
|
349
349
|
children: [
|
|
350
350
|
/* @__PURE__ */ ee("div", { className: "rc-inspect-card-header", children: [
|
|
351
|
-
/* @__PURE__ */ w("span", { className: "rc-inspect-card-role", children:
|
|
351
|
+
/* @__PURE__ */ w("span", { className: "rc-inspect-card-role", children: se }),
|
|
352
352
|
!t.enabled && /* @__PURE__ */ w("span", { className: "rc-inspect-card-tag", children: "disabled" }),
|
|
353
353
|
t.focused && /* @__PURE__ */ w("span", { className: "rc-inspect-card-tag rc-inspect-card-tag-blue", children: "focused" })
|
|
354
354
|
] }),
|
|
355
|
-
/* @__PURE__ */ w("p", { className: "rc-inspect-card-title", title: me, children:
|
|
355
|
+
/* @__PURE__ */ w("p", { className: "rc-inspect-card-title", title: me, children: Me }),
|
|
356
356
|
E && /* @__PURE__ */ ee("div", { className: "rc-inspect-card-row", children: [
|
|
357
357
|
/* @__PURE__ */ ee("span", { className: "rc-inspect-card-row-label", children: [
|
|
358
358
|
L,
|
|
@@ -382,8 +382,8 @@ const Un = async (a) => {
|
|
|
382
382
|
{
|
|
383
383
|
type: "button",
|
|
384
384
|
className: "rc-inspect-card-btn rc-inspect-card-btn-primary",
|
|
385
|
-
disabled: !
|
|
386
|
-
onClick: () =>
|
|
385
|
+
disabled: !m,
|
|
386
|
+
onClick: () => m?.(t, l),
|
|
387
387
|
children: "Tap"
|
|
388
388
|
}
|
|
389
389
|
),
|
|
@@ -392,9 +392,9 @@ const Un = async (a) => {
|
|
|
392
392
|
{
|
|
393
393
|
type: "button",
|
|
394
394
|
className: b === "selector" ? "rc-inspect-card-btn rc-inspect-card-btn-copied" : "rc-inspect-card-btn",
|
|
395
|
-
disabled: !
|
|
396
|
-
title:
|
|
397
|
-
onClick: () => U(
|
|
395
|
+
disabled: !I,
|
|
396
|
+
title: I ?? "No usable selector for this element",
|
|
397
|
+
onClick: () => U(I ?? void 0, "selector"),
|
|
398
398
|
children: b === "selector" ? "Copied!" : "Copy selector"
|
|
399
399
|
}
|
|
400
400
|
),
|
|
@@ -415,95 +415,95 @@ const Un = async (a) => {
|
|
|
415
415
|
),
|
|
416
416
|
document.body
|
|
417
417
|
);
|
|
418
|
-
}),
|
|
418
|
+
}), Un = zt(function({
|
|
419
419
|
snapshot: t,
|
|
420
420
|
geometry: r,
|
|
421
421
|
highlightedId: l,
|
|
422
422
|
selectedId: p,
|
|
423
423
|
mode: v,
|
|
424
|
-
cursorPosition:
|
|
424
|
+
cursorPosition: m,
|
|
425
425
|
frozenCursorPosition: b,
|
|
426
|
-
onSelectChange:
|
|
427
|
-
onTapElement:
|
|
426
|
+
onSelectChange: T,
|
|
427
|
+
onTapElement: k
|
|
428
428
|
}) {
|
|
429
|
-
const
|
|
429
|
+
const I = v === "select", E = I ? l !== null && l !== p : l !== null, L = I ? l ?? p : l, U = Xe(() => {
|
|
430
430
|
const S = /* @__PURE__ */ new Map();
|
|
431
431
|
if (!t) return S;
|
|
432
|
-
for (const
|
|
432
|
+
for (const u of t.elements) S.set(u.id, u);
|
|
433
433
|
return S;
|
|
434
|
-
}, [t]),
|
|
434
|
+
}, [t]), se = Xe(() => L ? U.get(L) ?? null : null, [L, U]);
|
|
435
435
|
if (!(!!t && !!r && t.screen.width > 0 && t.screen.height > 0 && t.elements.length > 0)) return null;
|
|
436
|
-
const me = E ?
|
|
437
|
-
|
|
436
|
+
const me = E ? m : b ?? m, C = E, ae = I && !E && p !== null, V = (S) => {
|
|
437
|
+
I && S.target === S.currentTarget && T(null, null);
|
|
438
438
|
};
|
|
439
|
-
return /* @__PURE__ */ ee(
|
|
439
|
+
return /* @__PURE__ */ ee(Co, { children: [
|
|
440
440
|
/* @__PURE__ */ w(
|
|
441
441
|
"div",
|
|
442
442
|
{
|
|
443
|
-
className:
|
|
443
|
+
className: I ? "rc-inspect-overlay rc-inspect-overlay-select" : "rc-inspect-overlay",
|
|
444
444
|
style: {
|
|
445
445
|
left: `${r.left}px`,
|
|
446
446
|
top: `${r.top}px`,
|
|
447
447
|
width: `${r.width}px`,
|
|
448
448
|
height: `${r.height}px`
|
|
449
449
|
},
|
|
450
|
-
onClick:
|
|
450
|
+
onClick: V,
|
|
451
451
|
children: t.elements.map((S) => /* @__PURE__ */ w(
|
|
452
|
-
|
|
452
|
+
Wn,
|
|
453
453
|
{
|
|
454
454
|
element: S,
|
|
455
455
|
screen: t.screen,
|
|
456
456
|
highlighted: S.id === l,
|
|
457
457
|
selected: S.id === p,
|
|
458
|
-
selectable:
|
|
459
|
-
onClick:
|
|
458
|
+
selectable: I,
|
|
459
|
+
onClick: T
|
|
460
460
|
},
|
|
461
461
|
S.id
|
|
462
462
|
))
|
|
463
463
|
}
|
|
464
464
|
),
|
|
465
|
-
|
|
466
|
-
|
|
465
|
+
se && me && /* @__PURE__ */ w(
|
|
466
|
+
Bn,
|
|
467
467
|
{
|
|
468
|
-
element:
|
|
468
|
+
element: se,
|
|
469
469
|
platform: t.platform,
|
|
470
470
|
anchor: me,
|
|
471
|
-
cursorAnchored:
|
|
472
|
-
showActions:
|
|
473
|
-
onTap:
|
|
471
|
+
cursorAnchored: C,
|
|
472
|
+
showActions: ae,
|
|
473
|
+
onTap: k
|
|
474
474
|
}
|
|
475
475
|
)
|
|
476
476
|
] });
|
|
477
477
|
});
|
|
478
|
-
function
|
|
478
|
+
function Kn(a, t) {
|
|
479
479
|
if (!t.startsWith("lim_st_")) return !1;
|
|
480
480
|
try {
|
|
481
|
-
const r = new URL(a).pathname.split("/").map(decodeURIComponent).find((
|
|
481
|
+
const r = new URL(a).pathname.split("/").map(decodeURIComponent).find((k) => /^(ios|android)_[a-z0-9_]+$/.test(k));
|
|
482
482
|
if (!r) return !1;
|
|
483
483
|
const l = r.split("_")[0], p = t.slice(7).split(".");
|
|
484
|
-
if (p.length !== 3 || p.some((
|
|
485
|
-
const v = atob(p[1].replace(/-/g, "+").replace(/_/g, "/")),
|
|
486
|
-
new TextDecoder().decode(Uint8Array.from(v, (
|
|
484
|
+
if (p.length !== 3 || p.some((k) => !k)) return !1;
|
|
485
|
+
const v = atob(p[1].replace(/-/g, "+").replace(/_/g, "/")), m = JSON.parse(
|
|
486
|
+
new TextDecoder().decode(Uint8Array.from(v, (k) => k.charCodeAt(0)))
|
|
487
487
|
);
|
|
488
|
-
if (!
|
|
489
|
-
const b =
|
|
490
|
-
if (!Array.isArray(b) || !b.every((
|
|
491
|
-
let
|
|
492
|
-
for (const
|
|
493
|
-
const [
|
|
494
|
-
if (!(U !== void 0 ||
|
|
488
|
+
if (!m || typeof m != "object" || !("scopes" in m)) return !1;
|
|
489
|
+
const b = m.scopes;
|
|
490
|
+
if (!Array.isArray(b) || !b.every((k) => typeof k == "string")) return !1;
|
|
491
|
+
let T = !1;
|
|
492
|
+
for (const k of b) {
|
|
493
|
+
const [I, E, L, U] = k.split(":");
|
|
494
|
+
if (!(U !== void 0 || I !== l && I !== "*") && !(E !== r && E !== "*")) {
|
|
495
495
|
if (L === "stream" || L === "all") return !1;
|
|
496
|
-
L === "watch" && (
|
|
496
|
+
L === "watch" && (T = !0);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
return
|
|
499
|
+
return T;
|
|
500
500
|
} catch {
|
|
501
501
|
return !1;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
|
-
const
|
|
504
|
+
const zn = Oo(() => import("./duo-view-C07GD_5E.mjs").then((a) => a.d)), Fn = Oo(() => import("./macbook-frame-Dm6ko0j9.mjs")), Ot = (a) => Object.entries(x).find(
|
|
505
505
|
([r, l]) => r.startsWith("ACTION_") && l === a
|
|
506
|
-
)?.[0] ?? String(a),
|
|
506
|
+
)?.[0] ?? String(a), Ao = 1920, To = 1200, Vn = (a, t) => a === Ao && t === To || a === To && t === Ao, Gn = {
|
|
507
507
|
ios: {
|
|
508
508
|
videoBorderRadiusMultiplier: 0.15,
|
|
509
509
|
loadingLogoSize: "20%",
|
|
@@ -532,7 +532,7 @@ const Jn = Po(() => import("./duo-view-DJEQ3Q74.mjs").then((a) => a.d)), Qn = Po
|
|
|
532
532
|
landscape: { widthMultiplier: 1 }
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
},
|
|
535
|
+
}, jn = {
|
|
536
536
|
"iphone-se": {
|
|
537
537
|
videoBorderRadiusMultiplier: 0,
|
|
538
538
|
loadingLogoSize: "20%",
|
|
@@ -552,7 +552,7 @@ const Jn = Po(() => import("./duo-view-DJEQ3Q74.mjs").then((a) => a.d)), Qn = Po
|
|
|
552
552
|
landscape: { widthMultiplier: 844 / 888 }
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
},
|
|
555
|
+
}, $t = 16 / 10, Et = 44, qn = {
|
|
556
556
|
videoBorderRadiusMultiplier: 32 / 1837,
|
|
557
557
|
loadingLogoSize: "40%",
|
|
558
558
|
videoPosition: {
|
|
@@ -560,20 +560,20 @@ const Jn = Po(() => import("./duo-view-DJEQ3Q74.mjs").then((a) => a.d)), Qn = Po
|
|
|
560
560
|
landscape: { widthMultiplier: 2560 / 2798 }
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
|
-
function
|
|
564
|
-
const t = a.code, r =
|
|
563
|
+
function Zn(a) {
|
|
564
|
+
const t = a.code, r = Mn[t];
|
|
565
565
|
if (!r)
|
|
566
|
-
return
|
|
566
|
+
return Bt(`Unknown event.code: ${t}, key: ${a.key}`), null;
|
|
567
567
|
let l = B.META_NONE;
|
|
568
|
-
const p = t >= "KeyA" && t <= "KeyZ", v = a.getModifierState("CapsLock"),
|
|
569
|
-
let b =
|
|
570
|
-
return p && (b =
|
|
568
|
+
const p = t >= "KeyA" && t <= "KeyZ", v = a.getModifierState("CapsLock"), m = a.shiftKey;
|
|
569
|
+
let b = m;
|
|
570
|
+
return p && (b = m !== v), b && (l |= B.META_SHIFT_ON), a.ctrlKey && (l |= B.META_CTRL_ON), a.altKey && (l |= B.META_ALT_ON), a.metaKey && (l |= B.META_META_ON), { keycode: r, metaState: l };
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function Nt(a, t) {
|
|
573
573
|
const r = Object.keys(a);
|
|
574
574
|
return r.length === Object.keys(t).length && r.every((l) => a[l] === t[l]);
|
|
575
575
|
}
|
|
576
|
-
const
|
|
576
|
+
const ui = Cn(
|
|
577
577
|
({
|
|
578
578
|
className: a,
|
|
579
579
|
url: t,
|
|
@@ -581,124 +581,103 @@ const vi = _n(
|
|
|
581
581
|
sessionId: l,
|
|
582
582
|
openUrl: p,
|
|
583
583
|
watchOnly: v = !1,
|
|
584
|
-
showFrame:
|
|
584
|
+
showFrame: m = !0,
|
|
585
585
|
animateLid: b = !0,
|
|
586
|
-
deviceModel:
|
|
587
|
-
duoModelUrl:
|
|
588
|
-
macbookModelUrl:
|
|
586
|
+
deviceModel: T,
|
|
587
|
+
duoModelUrl: k,
|
|
588
|
+
macbookModelUrl: I,
|
|
589
589
|
autoReconnect: E,
|
|
590
590
|
jitterBufferTargetMs: L,
|
|
591
591
|
onPlaybackStats: U,
|
|
592
|
-
onTerminated:
|
|
593
|
-
assets:
|
|
592
|
+
onTerminated: se,
|
|
593
|
+
assets: Me,
|
|
594
594
|
onConnectionStateChange: me,
|
|
595
|
-
inspectMode:
|
|
596
|
-
onAxSnapshotChange:
|
|
597
|
-
onInspectSelectionChange:
|
|
595
|
+
inspectMode: C,
|
|
596
|
+
onAxSnapshotChange: ae,
|
|
597
|
+
onInspectSelectionChange: V,
|
|
598
598
|
onAxStatusChange: S,
|
|
599
|
-
axPollIntervalMs:
|
|
599
|
+
axPollIntervalMs: u,
|
|
600
600
|
axMaxBackoffMs: y,
|
|
601
601
|
androidElementTreeOptions: M,
|
|
602
|
-
onCameraDemandChange:
|
|
603
|
-
onCameraStats:
|
|
602
|
+
onCameraDemandChange: W,
|
|
603
|
+
onCameraStats: P,
|
|
604
604
|
onTrace: Y,
|
|
605
|
-
microphoneEnabled:
|
|
606
|
-
onMicrophoneStateChange:
|
|
605
|
+
microphoneEnabled: j = !1,
|
|
606
|
+
onMicrophoneStateChange: le
|
|
607
607
|
}, te) => {
|
|
608
|
-
const ye =
|
|
608
|
+
const ye = Xe(() => Kn(t, r), [t, r]), q = v || ye, oe = H(null), R = H(null), Ae = H(null), [lt, ne] = D(!1), K = T === "iphone-duo" || lt, Re = T === "iphone-duo" ? T : void 0, $e = H(null), [Ft, Eo] = D(null), [Vt, No] = D(), [ko, _o] = D(!1), [Io, So] = D(!1), [xo, Po] = D(!1), [_t, Gt] = D(!1), [jt, qt] = D(!1), [Ho, Zt] = D({}), [Jt, Qt] = D(null), [It, Do] = D(null), [eo, Wo] = D(null), [to, oo] = D(null), et = Pn(() => pt.current?.release()), dt = H(!1), St = H(null), F = H(/* @__PURE__ */ new Map()), Oe = H(!1), [Lo, Yo] = D(!1), X = H(null), Be = H(null), tt = H({
|
|
609
609
|
handle: () => {
|
|
610
610
|
},
|
|
611
611
|
end: () => {
|
|
612
612
|
}
|
|
613
|
-
}), [
|
|
614
|
-
|
|
615
|
-
ve.current = void 0,
|
|
613
|
+
}), [Ee, ut] = D(null), [no, xt] = D(null), [Pt, ot] = D(null), [Ht, ht] = D(null), [Xo, io] = D(null), [$o, ro] = D(null), ft = H(null), ve = H(void 0), co = (e) => {
|
|
614
|
+
ft.current = e, ve.current === void 0 && (ve.current = window.requestAnimationFrame(() => {
|
|
615
|
+
ve.current = void 0, ro(ft.current);
|
|
616
616
|
}));
|
|
617
|
-
}, [
|
|
618
|
-
|
|
619
|
-
const
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
const
|
|
617
|
+
}, [Bo, Ue] = D(null), Ne = H(null);
|
|
618
|
+
Ne.current = no;
|
|
619
|
+
const Ke = H(V);
|
|
620
|
+
Ke.current = V;
|
|
621
|
+
const ke = C === !0 || C === "hover-only", so = H(ke);
|
|
622
|
+
so.current = ke;
|
|
623
|
+
const Uo = C === "hover-only" ? "hover-only" : "select", z = Xe(() => pn(t), [t]), Ko = Xe(
|
|
624
624
|
() => l || Array.from(crypto.getRandomValues(new Uint32Array(4)), (e) => e.toString(36)).join(""),
|
|
625
625
|
[l]
|
|
626
|
-
),
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
pe ||
|
|
631
|
-
}, [pe,
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
n.width !== e.videoWidth && (n.width = e.videoWidth);
|
|
639
|
-
try {
|
|
640
|
-
i.drawImage(e, 0, 0, e.videoWidth, 1, 0, 0, n.width, 1);
|
|
641
|
-
} catch {
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
};
|
|
645
|
-
let c = !1, d;
|
|
646
|
-
const s = () => {
|
|
647
|
-
c || (o(), d = e.requestVideoFrameCallback(s));
|
|
648
|
-
}, u = "requestVideoFrameCallback" in e ? void 0 : window.setInterval(o, 1e3 / 30);
|
|
649
|
-
return u === void 0 && (d = e.requestVideoFrameCallback(s)), o(), () => {
|
|
650
|
-
c = !0, d !== void 0 && e.cancelVideoFrameCallback(d), window.clearInterval(u);
|
|
651
|
-
};
|
|
652
|
-
}, [go]);
|
|
653
|
-
const k = P(null), fe = (e) => k.current?.sendControl(e), vt = P(/* @__PURE__ */ new Set()), yo = P(!1);
|
|
654
|
-
yo.current = R === !0;
|
|
655
|
-
const bt = P(null);
|
|
656
|
-
bt.current || (bt.current = new Yn(
|
|
657
|
-
(e) => k.current?.sendControl(e),
|
|
658
|
-
() => yo.current
|
|
626
|
+
), nt = z === "ios" && T && T !== "iphone-duo" ? T : void 0, _e = z === "android" && jt ? qn : nt ? jn[nt] : Gn[z], de = Me?.[z], ao = nt && de?.modelFrames?.[nt], lo = z === "android" && jt ? _t ? de?.tabletFrameLandscape : de?.tabletFrame : nt ? _t ? ao?.frameLandscape : ao?.frame : _t ? de?.frameLandscape : de?.frame, uo = de?.loadingLogo, it = !K && z !== "macos" && m && !!lo, pe = z === "macos" && m, Ie = pe && de?.frame && de.screen ? { src: de.frame, screen: de.screen } : void 0, Dt = H(null), zo = pe && et.mode === "3d", Se = pe && et.shown === "3d";
|
|
627
|
+
dt.current = Se;
|
|
628
|
+
const ho = et.choose;
|
|
629
|
+
J(() => {
|
|
630
|
+
pe || ho("2d");
|
|
631
|
+
}, [pe, ho]);
|
|
632
|
+
const N = H(null), he = (e) => N.current?.sendControl(e), mt = H(/* @__PURE__ */ new Set()), fo = H(!1);
|
|
633
|
+
fo.current = C === !0;
|
|
634
|
+
const pt = H(null);
|
|
635
|
+
pt.current || (pt.current = new Sn(
|
|
636
|
+
(e) => N.current?.sendControl(e),
|
|
637
|
+
() => fo.current
|
|
659
638
|
));
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
const
|
|
663
|
-
for (const e of
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}, []),
|
|
667
|
-
const i =
|
|
639
|
+
const xe = pt.current;
|
|
640
|
+
J(() => () => xe.release(), [xe]);
|
|
641
|
+
const rt = kt(() => {
|
|
642
|
+
for (const e of mt.current)
|
|
643
|
+
N.current?.sendControl(wo(Q.UP, e));
|
|
644
|
+
mt.current.clear();
|
|
645
|
+
}, []), Wt = (e, n) => N.current?.sendDuoControl(e, n) ?? Promise.reject(new Error("Simulator disconnected")), mo = -10, po = (e, n) => {
|
|
646
|
+
const i = Fe();
|
|
668
647
|
if (!i) return;
|
|
669
|
-
const o =
|
|
648
|
+
const o = be(i, e, n);
|
|
670
649
|
if (!o) return;
|
|
671
|
-
const { videoX: c, videoY: d, videoWidth: s, videoHeight:
|
|
650
|
+
const { videoX: c, videoY: d, videoWidth: s, videoHeight: h } = o, f = Rt(
|
|
672
651
|
x.ACTION_DOWN,
|
|
673
|
-
|
|
652
|
+
mo,
|
|
674
653
|
s,
|
|
675
|
-
|
|
654
|
+
h,
|
|
676
655
|
c,
|
|
677
656
|
d,
|
|
678
657
|
1,
|
|
679
658
|
x.BUTTON_PRIMARY,
|
|
680
659
|
x.BUTTON_PRIMARY
|
|
681
660
|
);
|
|
682
|
-
|
|
683
|
-
const
|
|
661
|
+
f && he(f), window.setTimeout(() => {
|
|
662
|
+
const A = Rt(
|
|
684
663
|
x.ACTION_UP,
|
|
685
|
-
|
|
664
|
+
mo,
|
|
686
665
|
s,
|
|
687
|
-
|
|
666
|
+
h,
|
|
688
667
|
c,
|
|
689
668
|
d,
|
|
690
669
|
0,
|
|
691
670
|
x.BUTTON_PRIMARY,
|
|
692
671
|
x.BUTTON_PRIMARY
|
|
693
672
|
);
|
|
694
|
-
|
|
673
|
+
A && he(A);
|
|
695
674
|
}, 60);
|
|
696
|
-
},
|
|
697
|
-
const i =
|
|
675
|
+
}, Fo = (e, n) => {
|
|
676
|
+
const i = Fe();
|
|
698
677
|
if (!i || n.screen.width <= 0 || n.screen.height <= 0) return;
|
|
699
|
-
const o = e.frame.x + e.frame.width / 2, c = e.frame.y + e.frame.height / 2, d = o / n.screen.width * i.actualWidth, s = c / n.screen.height * i.actualHeight,
|
|
700
|
-
|
|
701
|
-
},
|
|
678
|
+
const o = e.frame.x + e.frame.width / 2, c = e.frame.y + e.frame.height / 2, d = o / n.screen.width * i.actualWidth, s = c / n.screen.height * i.actualHeight, h = i.videoRect.left + i.offsetX + d, f = i.videoRect.top + i.offsetY + s;
|
|
679
|
+
po(h, f);
|
|
680
|
+
}, gt = -1, yt = -2, Pe = -3, ze = (e, n, i, o, c, d) => {
|
|
702
681
|
const s = Rt(
|
|
703
682
|
e,
|
|
704
683
|
n,
|
|
@@ -718,62 +697,62 @@ const vi = _n(
|
|
|
718
697
|
x: c,
|
|
719
698
|
y: d,
|
|
720
699
|
video: { width: i, height: o }
|
|
721
|
-
}),
|
|
722
|
-
},
|
|
700
|
+
}), he(s));
|
|
701
|
+
}, He = (e, n, i) => {
|
|
723
702
|
if (!i) return;
|
|
724
703
|
const { videoX: o, videoY: c, videoWidth: d, videoHeight: s } = i;
|
|
725
|
-
let
|
|
726
|
-
const
|
|
704
|
+
let h = null, f = null, A = 1;
|
|
705
|
+
const _ = x.BUTTON_PRIMARY;
|
|
727
706
|
switch (n) {
|
|
728
707
|
case "down":
|
|
729
|
-
e !==
|
|
708
|
+
e !== Pe && tt.current.end(), h = F.current.size === 0 ? x.ACTION_DOWN : x.ACTION_POINTER_DOWN, f = { x: o, y: c }, F.current.set(e, f), e === -1 && R.current?.focus();
|
|
730
709
|
break;
|
|
731
710
|
case "move":
|
|
732
|
-
|
|
711
|
+
F.current.has(e) && (h = x.ACTION_MOVE, f = { x: o, y: c }, F.current.set(e, f));
|
|
733
712
|
break;
|
|
734
713
|
case "up":
|
|
735
714
|
case "cancel":
|
|
736
|
-
|
|
715
|
+
F.current.has(e) && (f = F.current.get(e), F.current.delete(e), n === "cancel" ? h = x.ACTION_CANCEL : h = F.current.size === 0 ? x.ACTION_UP : x.ACTION_POINTER_UP);
|
|
737
716
|
break;
|
|
738
717
|
}
|
|
739
|
-
if (
|
|
718
|
+
if (h !== null && f !== null) {
|
|
740
719
|
G("[rc-touch][mouse->touch] sending", {
|
|
741
720
|
pointerId: e,
|
|
742
721
|
eventType: n,
|
|
743
|
-
action:
|
|
744
|
-
actionName: Ot(
|
|
745
|
-
positionToSend:
|
|
722
|
+
action: h,
|
|
723
|
+
actionName: Ot(h),
|
|
724
|
+
positionToSend: f,
|
|
746
725
|
video: { width: d, height: s },
|
|
747
|
-
altHeld:
|
|
748
|
-
activePointersAfter: Array.from(
|
|
726
|
+
altHeld: Oe.current,
|
|
727
|
+
activePointersAfter: Array.from(F.current.entries()).map(([re, $]) => ({
|
|
749
728
|
id: re,
|
|
750
729
|
x: $.x,
|
|
751
730
|
y: $.y
|
|
752
731
|
}))
|
|
753
732
|
});
|
|
754
733
|
const g = Rt(
|
|
755
|
-
|
|
734
|
+
h,
|
|
756
735
|
e,
|
|
757
736
|
d,
|
|
758
737
|
s,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
738
|
+
f.x,
|
|
739
|
+
f.y,
|
|
740
|
+
A,
|
|
741
|
+
_,
|
|
742
|
+
_
|
|
764
743
|
);
|
|
765
744
|
g && (G("[rc-touch][mouse->touch] buffer", {
|
|
766
745
|
pointerId: e,
|
|
767
|
-
actionName: Ot(
|
|
746
|
+
actionName: Ot(h),
|
|
768
747
|
byteLength: g.byteLength
|
|
769
|
-
}),
|
|
770
|
-
} else (n === "up" || n === "cancel") &&
|
|
748
|
+
}), he(g));
|
|
749
|
+
} else (n === "up" || n === "cancel") && F.current.delete(e);
|
|
771
750
|
}, Lt = (e) => {
|
|
772
|
-
if (
|
|
751
|
+
if (Oe.current !== e && (Oe.current = e, Yo(e), e || ut(null), G("[rc-touch][alt] updateAltHeld", {
|
|
773
752
|
nextHeld: e,
|
|
774
|
-
activePointerIds: Array.from(
|
|
775
|
-
}),
|
|
776
|
-
const n = e ? B.ACTION_DOWN : B.ACTION_UP, i =
|
|
753
|
+
activePointerIds: Array.from(F.current.keys())
|
|
754
|
+
}), z === "ios" && N.current?.getState().controlReady)) {
|
|
755
|
+
const n = e ? B.ACTION_DOWN : B.ACTION_UP, i = Ct(
|
|
777
756
|
n,
|
|
778
757
|
B.KEYCODE_ALT_LEFT,
|
|
779
758
|
0,
|
|
@@ -782,99 +761,99 @@ const vi = _n(
|
|
|
782
761
|
G("[rc-touch][alt] sending Indigo modifier keycode", {
|
|
783
762
|
action: n,
|
|
784
763
|
keycode: B.KEYCODE_ALT_LEFT
|
|
785
|
-
}), i &&
|
|
764
|
+
}), i && he(i);
|
|
786
765
|
}
|
|
787
|
-
},
|
|
788
|
-
const e =
|
|
766
|
+
}, Fe = () => {
|
|
767
|
+
const e = R.current, n = oe.current;
|
|
789
768
|
if (!e || !n) return null;
|
|
790
769
|
const i = e.videoWidth, o = e.videoHeight;
|
|
791
770
|
if (!i || !o) return null;
|
|
792
|
-
const c = e.getBoundingClientRect(), d = n.getBoundingClientRect(), s = c.width,
|
|
793
|
-
let
|
|
794
|
-
|
|
795
|
-
const re = (s -
|
|
771
|
+
const c = e.getBoundingClientRect(), d = n.getBoundingClientRect(), s = c.width, h = c.height, f = i / o, A = s / h;
|
|
772
|
+
let _ = s, g = h;
|
|
773
|
+
f > A ? g = s / f : _ = h * f;
|
|
774
|
+
const re = (s - _) / 2, $ = (h - g) / 2;
|
|
796
775
|
return {
|
|
797
776
|
videoWidth: i,
|
|
798
777
|
videoHeight: o,
|
|
799
778
|
videoRect: c,
|
|
800
779
|
containerRect: d,
|
|
801
|
-
actualWidth:
|
|
780
|
+
actualWidth: _,
|
|
802
781
|
actualHeight: g,
|
|
803
782
|
offsetX: re,
|
|
804
783
|
offsetY: $
|
|
805
784
|
};
|
|
806
|
-
},
|
|
807
|
-
const o = n - e.videoRect.left - e.offsetX, c = i - e.videoRect.top - e.offsetY, d = Math.max(0, Math.min(e.actualWidth, o)), s = Math.max(0, Math.min(e.actualHeight, c)),
|
|
785
|
+
}, be = (e, n, i) => {
|
|
786
|
+
const o = n - e.videoRect.left - e.offsetX, c = i - e.videoRect.top - e.offsetY, d = Math.max(0, Math.min(e.actualWidth, o)), s = Math.max(0, Math.min(e.actualHeight, c)), h = Math.max(
|
|
808
787
|
0,
|
|
809
788
|
Math.min(e.videoWidth, d / e.actualWidth * e.videoWidth)
|
|
810
|
-
),
|
|
789
|
+
), f = Math.max(
|
|
811
790
|
0,
|
|
812
791
|
Math.min(e.videoHeight, s / e.actualHeight * e.videoHeight)
|
|
813
792
|
);
|
|
814
793
|
return {
|
|
815
|
-
videoX:
|
|
816
|
-
videoY:
|
|
794
|
+
videoX: h,
|
|
795
|
+
videoY: f,
|
|
817
796
|
videoWidth: e.videoWidth,
|
|
818
797
|
videoHeight: e.videoHeight
|
|
819
798
|
};
|
|
820
|
-
},
|
|
821
|
-
const o = n - e.videoRect.left - e.offsetX, c = i - e.videoRect.top - e.offsetY, d = Math.max(0, Math.min(e.actualWidth, o)), s = Math.max(0, Math.min(e.actualHeight, c)),
|
|
799
|
+
}, Vo = (e, n, i) => {
|
|
800
|
+
const o = n - e.videoRect.left - e.offsetX, c = i - e.videoRect.top - e.offsetY, d = Math.max(0, Math.min(e.actualWidth, o)), s = Math.max(0, Math.min(e.actualHeight, c)), h = Math.max(
|
|
822
801
|
0,
|
|
823
802
|
Math.min(e.videoWidth, d / e.actualWidth * e.videoWidth)
|
|
824
|
-
),
|
|
803
|
+
), f = Math.max(
|
|
825
804
|
0,
|
|
826
805
|
Math.min(e.videoHeight, s / e.actualHeight * e.videoHeight)
|
|
827
|
-
),
|
|
806
|
+
), A = e.videoWidth - h, _ = e.videoHeight - f, g = e.videoRect.left + e.offsetX, re = e.videoRect.top + e.offsetY, $ = g - e.containerRect.left + d, Z = re - e.containerRect.top + s, ue = g - e.containerRect.left + (e.actualWidth - d), O = re - e.containerRect.top + (e.actualHeight - s);
|
|
828
807
|
return {
|
|
829
808
|
containerX: $,
|
|
830
|
-
containerY:
|
|
831
|
-
mirrorContainerX:
|
|
809
|
+
containerY: Z,
|
|
810
|
+
mirrorContainerX: ue,
|
|
832
811
|
mirrorContainerY: O,
|
|
833
|
-
videoX:
|
|
834
|
-
videoY:
|
|
835
|
-
mirrorVideoX:
|
|
836
|
-
mirrorVideoY:
|
|
812
|
+
videoX: h,
|
|
813
|
+
videoY: f,
|
|
814
|
+
mirrorVideoX: A,
|
|
815
|
+
mirrorVideoY: _,
|
|
837
816
|
videoWidth: e.videoWidth,
|
|
838
817
|
videoHeight: e.videoHeight
|
|
839
818
|
};
|
|
840
|
-
},
|
|
841
|
-
const
|
|
819
|
+
}, Go = (e, n, i, o, c, d, s) => {
|
|
820
|
+
const h = An(e, n, i, o, c, d, s);
|
|
842
821
|
G("[rc-touch2] sendTwoFingerMessage (iOS)", {
|
|
843
822
|
actionName: Ot(e),
|
|
844
823
|
video: { width: n, height: i },
|
|
845
824
|
p0: { x: o, y: c },
|
|
846
825
|
p1: { x: d, y: s },
|
|
847
|
-
byteLength:
|
|
848
|
-
}),
|
|
849
|
-
},
|
|
826
|
+
byteLength: h.byteLength
|
|
827
|
+
}), he(h);
|
|
828
|
+
}, Ve = (e, n, i, o, c, d, s, h, f) => {
|
|
850
829
|
if (G("[rc-touch2] applyTwoFingerEvent", {
|
|
851
|
-
platform:
|
|
830
|
+
platform: z,
|
|
852
831
|
eventType: e,
|
|
853
832
|
video: { width: n, height: i },
|
|
854
|
-
p0: { x: o, y: c, id:
|
|
855
|
-
p1: { x: d, y: s, id:
|
|
856
|
-
}), e === "down" &&
|
|
857
|
-
const
|
|
858
|
-
|
|
833
|
+
p0: { x: o, y: c, id: h },
|
|
834
|
+
p1: { x: d, y: s, id: f }
|
|
835
|
+
}), e === "down" && tt.current.end(), z === "ios") {
|
|
836
|
+
const A = e === "down" ? x.ACTION_DOWN : e === "move" ? x.ACTION_MOVE : x.ACTION_UP;
|
|
837
|
+
Go(A, n, i, o, c, d, s);
|
|
859
838
|
} else
|
|
860
|
-
e === "down" ? (
|
|
861
|
-
},
|
|
862
|
-
if (!
|
|
863
|
-
|
|
839
|
+
e === "down" ? (ze(x.ACTION_DOWN, h, n, i, o, c), ze(x.ACTION_POINTER_DOWN, f, n, i, d, s)) : e === "move" ? (ze(x.ACTION_MOVE, h, n, i, o, c), ze(x.ACTION_MOVE, f, n, i, d, s)) : (ze(x.ACTION_POINTER_UP, f, n, i, d, s), ze(x.ACTION_UP, h, n, i, o, c));
|
|
840
|
+
}, jo = (e, n, i) => {
|
|
841
|
+
if (!Oe.current) {
|
|
842
|
+
Ee !== null && ut(null);
|
|
864
843
|
return;
|
|
865
844
|
}
|
|
866
|
-
const o =
|
|
867
|
-
|
|
868
|
-
},
|
|
869
|
-
const o =
|
|
845
|
+
const o = Vo(e, n, i);
|
|
846
|
+
ut(o);
|
|
847
|
+
}, qo = (e, n, i) => {
|
|
848
|
+
const o = Ne.current;
|
|
870
849
|
if (!o || o.screen.width <= 0 || o.screen.height <= 0) return null;
|
|
871
850
|
const c = n - e.videoRect.left - e.offsetX, d = i - e.videoRect.top - e.offsetY;
|
|
872
851
|
if (c < 0 || d < 0 || c > e.actualWidth || d > e.actualHeight) return null;
|
|
873
|
-
const s = c / e.actualWidth * o.screen.width,
|
|
874
|
-
return
|
|
875
|
-
},
|
|
852
|
+
const s = c / e.actualWidth * o.screen.width, h = d / e.actualHeight * o.screen.height;
|
|
853
|
+
return wn(o, s, h);
|
|
854
|
+
}, Zo = (e) => ({
|
|
876
855
|
map: (n, i) => {
|
|
877
|
-
const o =
|
|
856
|
+
const o = be(e, n, i);
|
|
878
857
|
if (o)
|
|
879
858
|
return {
|
|
880
859
|
x: o.videoX,
|
|
@@ -889,29 +868,29 @@ const vi = _n(
|
|
|
889
868
|
return o >= 0 && o <= e.actualWidth && c >= 0 && c <= e.actualHeight;
|
|
890
869
|
},
|
|
891
870
|
scale: e.actualWidth > 0 ? e.videoWidth / e.actualWidth : 1
|
|
892
|
-
}),
|
|
893
|
-
if (
|
|
871
|
+
}), Te = (e) => {
|
|
872
|
+
if (K || dt.current) return;
|
|
894
873
|
e.preventDefault(), e.stopPropagation();
|
|
895
|
-
const n =
|
|
896
|
-
if ((
|
|
874
|
+
const n = Fe();
|
|
875
|
+
if ((C === !0 || C === "hover-only") && !("touches" in e))
|
|
897
876
|
if (e.type === "mousemove") {
|
|
898
|
-
if (
|
|
899
|
-
const o =
|
|
900
|
-
|
|
877
|
+
if (co({ x: e.clientX, y: e.clientY }), n) {
|
|
878
|
+
const o = qo(n, e.clientX, e.clientY);
|
|
879
|
+
ot(o?.id ?? null);
|
|
901
880
|
}
|
|
902
|
-
} else e.type === "mouseleave" && (
|
|
903
|
-
if (
|
|
904
|
-
if (
|
|
905
|
-
if (!n || !
|
|
881
|
+
} else e.type === "mouseleave" && (co(null), ot(null));
|
|
882
|
+
if (C !== !0) {
|
|
883
|
+
if (z === "macos") {
|
|
884
|
+
if (!n || !N.current?.getState().controlReady) return;
|
|
906
885
|
if ("touches" in e) {
|
|
907
|
-
const s = Array.from(e.touches, (
|
|
908
|
-
|
|
886
|
+
const s = Array.from(e.touches, (h) => ({ x: h.clientX, y: h.clientY }));
|
|
887
|
+
xe.touch(e.type, s, Zo(n)) && R.current?.focus();
|
|
909
888
|
return;
|
|
910
889
|
}
|
|
911
|
-
const o =
|
|
890
|
+
const o = be(n, e.clientX, e.clientY);
|
|
912
891
|
if (!o) return;
|
|
913
892
|
const c = e.type === "mousedown" ? Q.DOWN : e.type === "mouseup" ? Q.UP : Q.MOVE, d = e.type === "mouseleave" ? 0 : e.buttons;
|
|
914
|
-
e.type === "mousedown" &&
|
|
893
|
+
e.type === "mousedown" && R.current?.focus(), xe.pointer(
|
|
915
894
|
c,
|
|
916
895
|
{
|
|
917
896
|
x: o.videoX,
|
|
@@ -923,7 +902,7 @@ const vi = _n(
|
|
|
923
902
|
);
|
|
924
903
|
return;
|
|
925
904
|
}
|
|
926
|
-
if (!("touches" in e) && n && (e.type === "mousemove" ?
|
|
905
|
+
if (!("touches" in e) && n && (e.type === "mousemove" ? jo(n, e.clientX, e.clientY) : e.type === "mouseleave" && ut(null)), !(!N.current?.getState().controlReady || !R.current || !n))
|
|
927
906
|
if ("touches" in e) {
|
|
928
907
|
const o = e.touches, c = e.changedTouches;
|
|
929
908
|
let d;
|
|
@@ -944,39 +923,39 @@ const vi = _n(
|
|
|
944
923
|
return;
|
|
945
924
|
}
|
|
946
925
|
if (o.length === 2) {
|
|
947
|
-
const s = o[0],
|
|
948
|
-
if (!
|
|
949
|
-
X.current ? X.current.source === "real-touch" && (X.current.finger0 = { x:
|
|
926
|
+
const s = o[0], h = o[1], f = be(n, s.clientX, s.clientY), A = be(n, h.clientX, h.clientY);
|
|
927
|
+
if (!f || !A) return;
|
|
928
|
+
X.current ? X.current.source === "real-touch" && (X.current.finger0 = { x: f.videoX, y: f.videoY }, X.current.finger1 = { x: A.videoX, y: A.videoY }, Ve(
|
|
950
929
|
"move",
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
930
|
+
f.videoWidth,
|
|
931
|
+
f.videoHeight,
|
|
932
|
+
f.videoX,
|
|
933
|
+
f.videoY,
|
|
934
|
+
A.videoX,
|
|
935
|
+
A.videoY,
|
|
957
936
|
X.current.pointerId0,
|
|
958
937
|
X.current.pointerId1
|
|
959
938
|
)) : (X.current = {
|
|
960
|
-
finger0: { x:
|
|
961
|
-
finger1: { x:
|
|
962
|
-
videoSize: { width:
|
|
939
|
+
finger0: { x: f.videoX, y: f.videoY },
|
|
940
|
+
finger1: { x: A.videoX, y: A.videoY },
|
|
941
|
+
videoSize: { width: f.videoWidth, height: f.videoHeight },
|
|
963
942
|
source: "real-touch",
|
|
964
943
|
pointerId0: s.identifier,
|
|
965
|
-
pointerId1:
|
|
966
|
-
},
|
|
944
|
+
pointerId1: h.identifier
|
|
945
|
+
}, Ve(
|
|
967
946
|
"down",
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
947
|
+
f.videoWidth,
|
|
948
|
+
f.videoHeight,
|
|
949
|
+
f.videoX,
|
|
950
|
+
f.videoY,
|
|
951
|
+
A.videoX,
|
|
952
|
+
A.videoY,
|
|
974
953
|
s.identifier,
|
|
975
|
-
|
|
954
|
+
h.identifier
|
|
976
955
|
));
|
|
977
956
|
} else if (o.length < 2 && X.current?.source === "real-touch") {
|
|
978
957
|
const s = X.current;
|
|
979
|
-
|
|
958
|
+
Ve(
|
|
980
959
|
"up",
|
|
981
960
|
s.videoSize.width,
|
|
982
961
|
s.videoSize.height,
|
|
@@ -994,8 +973,8 @@ const vi = _n(
|
|
|
994
973
|
{
|
|
995
974
|
const s = c[0];
|
|
996
975
|
if (s) {
|
|
997
|
-
const
|
|
998
|
-
|
|
976
|
+
const h = be(n, s.clientX, s.clientY);
|
|
977
|
+
He(s.identifier, d, h);
|
|
999
978
|
}
|
|
1000
979
|
}
|
|
1001
980
|
}
|
|
@@ -1007,17 +986,17 @@ const vi = _n(
|
|
|
1007
986
|
e.button === 0 && (c = "down");
|
|
1008
987
|
break;
|
|
1009
988
|
case "mousemove":
|
|
1010
|
-
(d ||
|
|
989
|
+
(d || F.current.has(-1)) && (c = "move");
|
|
1011
990
|
break;
|
|
1012
991
|
case "mouseup":
|
|
1013
992
|
e.button === 0 && (c = "up");
|
|
1014
993
|
break;
|
|
1015
994
|
case "mouseleave":
|
|
1016
|
-
(d ||
|
|
995
|
+
(d || F.current.has(-1)) && (c = "up");
|
|
1017
996
|
break;
|
|
1018
997
|
}
|
|
1019
998
|
if (c) {
|
|
1020
|
-
const s =
|
|
999
|
+
const s = be(n, e.clientX, e.clientY);
|
|
1021
1000
|
if (!s)
|
|
1022
1001
|
return;
|
|
1023
1002
|
G("[rc-touch][mouse] event", {
|
|
@@ -1026,7 +1005,7 @@ const vi = _n(
|
|
|
1026
1005
|
button: e.button,
|
|
1027
1006
|
buttons: e.buttons,
|
|
1028
1007
|
client: { x: e.clientX, y: e.clientY },
|
|
1029
|
-
altHeldRef:
|
|
1008
|
+
altHeldRef: Oe.current,
|
|
1030
1009
|
inTwoFingerMode: d,
|
|
1031
1010
|
geometry: {
|
|
1032
1011
|
videoX: s.videoX,
|
|
@@ -1034,153 +1013,153 @@ const vi = _n(
|
|
|
1034
1013
|
videoWidth: s.videoWidth,
|
|
1035
1014
|
videoHeight: s.videoHeight
|
|
1036
1015
|
},
|
|
1037
|
-
activePointerIds: Array.from(
|
|
1038
|
-
}),
|
|
1016
|
+
activePointerIds: Array.from(F.current.keys())
|
|
1017
|
+
}), Oe.current || d ? Jo(c, s) : He(-1, c, s);
|
|
1039
1018
|
}
|
|
1040
1019
|
}
|
|
1041
1020
|
}
|
|
1042
|
-
},
|
|
1043
|
-
const { videoX: i, videoY: o, videoWidth: c, videoHeight: d } = n, s = c - i,
|
|
1021
|
+
}, Jo = (e, n) => {
|
|
1022
|
+
const { videoX: i, videoY: o, videoWidth: c, videoHeight: d } = n, s = c - i, h = d - o;
|
|
1044
1023
|
if (e === "down") {
|
|
1045
1024
|
X.current = {
|
|
1046
1025
|
finger0: { x: i, y: o },
|
|
1047
|
-
finger1: { x: s, y:
|
|
1026
|
+
finger1: { x: s, y: h },
|
|
1048
1027
|
videoSize: { width: c, height: d },
|
|
1049
1028
|
source: "alt-mouse",
|
|
1050
|
-
pointerId0:
|
|
1051
|
-
pointerId1:
|
|
1052
|
-
},
|
|
1029
|
+
pointerId0: gt,
|
|
1030
|
+
pointerId1: yt
|
|
1031
|
+
}, R.current?.focus(), Ve(
|
|
1053
1032
|
"down",
|
|
1054
1033
|
c,
|
|
1055
1034
|
d,
|
|
1056
1035
|
i,
|
|
1057
1036
|
o,
|
|
1058
1037
|
s,
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1038
|
+
h,
|
|
1039
|
+
gt,
|
|
1040
|
+
yt
|
|
1062
1041
|
);
|
|
1063
1042
|
return;
|
|
1064
1043
|
}
|
|
1065
1044
|
if (e === "move") {
|
|
1066
|
-
X.current?.source === "alt-mouse" && (X.current.finger0 = { x: i, y: o }, X.current.finger1 = { x: s, y:
|
|
1045
|
+
X.current?.source === "alt-mouse" && (X.current.finger0 = { x: i, y: o }, X.current.finger1 = { x: s, y: h }, Ve(
|
|
1067
1046
|
"move",
|
|
1068
1047
|
c,
|
|
1069
1048
|
d,
|
|
1070
1049
|
i,
|
|
1071
1050
|
o,
|
|
1072
1051
|
s,
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1052
|
+
h,
|
|
1053
|
+
gt,
|
|
1054
|
+
yt
|
|
1076
1055
|
));
|
|
1077
1056
|
return;
|
|
1078
1057
|
}
|
|
1079
1058
|
if (e === "up" || e === "cancel") {
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1082
|
-
const { finger0:
|
|
1083
|
-
|
|
1059
|
+
const f = X.current;
|
|
1060
|
+
if (f?.source === "alt-mouse") {
|
|
1061
|
+
const { finger0: A, finger1: _, videoSize: g } = f;
|
|
1062
|
+
Ve(
|
|
1084
1063
|
"up",
|
|
1085
1064
|
g.width,
|
|
1086
1065
|
g.height,
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1066
|
+
A.x,
|
|
1067
|
+
A.y,
|
|
1068
|
+
_.x,
|
|
1069
|
+
_.y,
|
|
1070
|
+
gt,
|
|
1071
|
+
yt
|
|
1093
1072
|
), X.current = null;
|
|
1094
1073
|
}
|
|
1095
1074
|
return;
|
|
1096
1075
|
}
|
|
1097
|
-
},
|
|
1098
|
-
const e =
|
|
1099
|
-
e && (window.clearTimeout(e.endTimer),
|
|
1100
|
-
},
|
|
1101
|
-
if (!
|
|
1102
|
-
if (
|
|
1103
|
-
if (
|
|
1104
|
-
const O =
|
|
1076
|
+
}, Qo = 150, go = () => {
|
|
1077
|
+
const e = Be.current;
|
|
1078
|
+
e && (window.clearTimeout(e.endTimer), He(Pe, "up", e.pos), Be.current = null);
|
|
1079
|
+
}, en = (e) => {
|
|
1080
|
+
if (!N.current?.getState().controlReady || e.ctrlKey) return;
|
|
1081
|
+
if (z === "macos") {
|
|
1082
|
+
if (dt.current) return;
|
|
1083
|
+
const O = Fe();
|
|
1105
1084
|
if (!O) return;
|
|
1106
|
-
const
|
|
1107
|
-
if (
|
|
1085
|
+
const De = e.clientX - O.videoRect.left - O.offsetX, we = e.clientY - O.videoRect.top - O.offsetY;
|
|
1086
|
+
if (De < 0 || De > O.actualWidth || we < 0 || we > O.actualHeight)
|
|
1108
1087
|
return;
|
|
1109
|
-
const ge =
|
|
1088
|
+
const ge = be(O, e.clientX, e.clientY);
|
|
1110
1089
|
if (!ge) return;
|
|
1111
1090
|
e.preventDefault();
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1091
|
+
const je = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? 16 : e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? O.actualHeight : 1;
|
|
1092
|
+
xe.scroll(
|
|
1114
1093
|
{ x: ge.videoX, y: ge.videoY, width: ge.videoWidth, height: ge.videoHeight },
|
|
1115
|
-
e.deltaX *
|
|
1116
|
-
e.deltaY *
|
|
1094
|
+
e.deltaX * je,
|
|
1095
|
+
e.deltaY * je
|
|
1117
1096
|
);
|
|
1118
1097
|
return;
|
|
1119
1098
|
}
|
|
1120
|
-
if (
|
|
1121
|
-
const n =
|
|
1122
|
-
if (n > 1 || n === 1 && !
|
|
1123
|
-
const i =
|
|
1099
|
+
if (Oe.current || X.current) return;
|
|
1100
|
+
const n = F.current.size;
|
|
1101
|
+
if (n > 1 || n === 1 && !F.current.has(Pe)) return;
|
|
1102
|
+
const i = Fe();
|
|
1124
1103
|
if (!i) return;
|
|
1125
1104
|
const o = e.clientX - i.videoRect.left - i.offsetX, c = e.clientY - i.videoRect.top - i.offsetY;
|
|
1126
1105
|
if (o < 0 || o > i.actualWidth || c < 0 || c > i.actualHeight)
|
|
1127
1106
|
return;
|
|
1128
|
-
const d =
|
|
1107
|
+
const d = be(i, e.clientX, e.clientY);
|
|
1129
1108
|
if (!d) return;
|
|
1130
1109
|
e.preventDefault();
|
|
1131
|
-
const s = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? i.actualWidth : 1) * (i.videoWidth / i.actualWidth),
|
|
1132
|
-
window.clearTimeout(O.endTimer), O.endTimer = window.setTimeout(
|
|
1110
|
+
const s = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? i.actualWidth : 1) * (i.videoWidth / i.actualWidth), h = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? i.actualHeight : 1) * (i.videoHeight / i.actualHeight), f = -e.deltaX * s, A = -e.deltaY * h, _ = (O) => {
|
|
1111
|
+
window.clearTimeout(O.endTimer), O.endTimer = window.setTimeout(go, Qo);
|
|
1133
1112
|
};
|
|
1134
|
-
if (
|
|
1135
|
-
|
|
1113
|
+
if (f === 0 && A === 0) {
|
|
1114
|
+
Be.current && _(Be.current);
|
|
1136
1115
|
return;
|
|
1137
1116
|
}
|
|
1138
1117
|
const g = () => ({
|
|
1139
1118
|
videoWidth: d.videoWidth,
|
|
1140
1119
|
videoHeight: d.videoHeight,
|
|
1141
|
-
videoX: Math.abs(
|
|
1142
|
-
videoY: Math.abs(
|
|
1120
|
+
videoX: Math.abs(f) > Math.abs(A) ? Math.min(Math.max(d.videoX, d.videoWidth * 0.2), d.videoWidth * 0.8) : d.videoX,
|
|
1121
|
+
videoY: Math.abs(A) >= Math.abs(f) ? Math.min(Math.max(d.videoY, d.videoHeight * 0.2), d.videoHeight * 0.8) : d.videoY
|
|
1143
1122
|
}), re = (O) => ({
|
|
1144
1123
|
...O,
|
|
1145
|
-
videoX: Math.min(Math.max(O.videoX +
|
|
1146
|
-
videoY: Math.min(Math.max(O.videoY +
|
|
1124
|
+
videoX: Math.min(Math.max(O.videoX + f, 0), O.videoWidth),
|
|
1125
|
+
videoY: Math.min(Math.max(O.videoY + A, 0), O.videoHeight)
|
|
1147
1126
|
});
|
|
1148
|
-
let $ =
|
|
1127
|
+
let $ = Be.current;
|
|
1149
1128
|
if ($)
|
|
1150
1129
|
window.clearTimeout($.endTimer);
|
|
1151
1130
|
else {
|
|
1152
1131
|
const O = g();
|
|
1153
|
-
|
|
1132
|
+
He(Pe, "down", O), $ = { pos: O, endTimer: 0 }, Be.current = $;
|
|
1154
1133
|
}
|
|
1155
|
-
let
|
|
1156
|
-
|
|
1134
|
+
let Z = $.pos, ue = re(Z);
|
|
1135
|
+
ue.videoX === Z.videoX && ue.videoY === Z.videoY && (He(Pe, "up", Z), Z = g(), He(Pe, "down", Z), ue = re(Z)), He(Pe, "move", ue), $.pos = ue, _($);
|
|
1157
1136
|
};
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
}),
|
|
1137
|
+
J(() => {
|
|
1138
|
+
tt.current = { handle: en, end: go };
|
|
1139
|
+
}), J(() => {
|
|
1161
1140
|
const e = oe.current;
|
|
1162
1141
|
if (!e) return;
|
|
1163
|
-
const n = (i) =>
|
|
1142
|
+
const n = (i) => tt.current.handle(i);
|
|
1164
1143
|
return e.addEventListener("wheel", n, { passive: !1 }), () => {
|
|
1165
|
-
|
|
1144
|
+
tt.current.end(), e.removeEventListener("wheel", n);
|
|
1166
1145
|
};
|
|
1167
|
-
}, []),
|
|
1146
|
+
}, []), J(() => {
|
|
1168
1147
|
const e = (c) => {
|
|
1169
1148
|
c.key === "Alt" && Lt(!0);
|
|
1170
1149
|
}, n = (c) => {
|
|
1171
1150
|
c.key === "Alt" && Lt(!1);
|
|
1172
1151
|
}, i = () => {
|
|
1173
|
-
Lt(!1),
|
|
1152
|
+
Lt(!1), rt();
|
|
1174
1153
|
}, o = () => {
|
|
1175
|
-
document.hidden &&
|
|
1154
|
+
document.hidden && rt();
|
|
1176
1155
|
};
|
|
1177
1156
|
return window.addEventListener("keydown", e, !0), window.addEventListener("keyup", n, !0), window.addEventListener("blur", i), document.addEventListener("visibilitychange", o), () => {
|
|
1178
1157
|
window.removeEventListener("keydown", e, !0), window.removeEventListener("keyup", n, !0), window.removeEventListener("blur", i), document.removeEventListener("visibilitychange", o);
|
|
1179
1158
|
};
|
|
1180
|
-
}, [
|
|
1181
|
-
const
|
|
1159
|
+
}, [rt]);
|
|
1160
|
+
const Ge = (e) => {
|
|
1182
1161
|
e.preventDefault(), e.stopPropagation();
|
|
1183
|
-
const n = document.activeElement ===
|
|
1162
|
+
const n = document.activeElement === R.current || (K || dt.current) && document.activeElement === e.currentTarget;
|
|
1184
1163
|
if (G("Keyboard event:", {
|
|
1185
1164
|
type: e.type,
|
|
1186
1165
|
key: e.key,
|
|
@@ -1189,22 +1168,22 @@ const vi = _n(
|
|
|
1189
1168
|
target: e.target.tagName,
|
|
1190
1169
|
focused: n
|
|
1191
1170
|
}), !n) {
|
|
1192
|
-
|
|
1171
|
+
Bt("Simulator input not focused, skipping keyboard event");
|
|
1193
1172
|
return;
|
|
1194
1173
|
}
|
|
1195
|
-
if (!
|
|
1196
|
-
|
|
1174
|
+
if (!N.current?.getState().controlReady) {
|
|
1175
|
+
Bt("Data channel not ready for keyboard event:", N.current?.getState().connection);
|
|
1197
1176
|
return;
|
|
1198
1177
|
}
|
|
1199
|
-
if (
|
|
1178
|
+
if (z === "macos") {
|
|
1200
1179
|
if (e.type === "keydown" && e.repeat) return;
|
|
1201
|
-
const o =
|
|
1180
|
+
const o = vn(e.code);
|
|
1202
1181
|
if (o === void 0) {
|
|
1203
1182
|
G(`Ignoring unmapped key for macOS: code=${e.code}`);
|
|
1204
1183
|
return;
|
|
1205
1184
|
}
|
|
1206
|
-
e.type === "keydown" ?
|
|
1207
|
-
|
|
1185
|
+
e.type === "keydown" ? mt.current.add(o) : mt.current.delete(o), he(
|
|
1186
|
+
wo(
|
|
1208
1187
|
e.type === "keydown" ? Q.DOWN : Q.UP,
|
|
1209
1188
|
o
|
|
1210
1189
|
)
|
|
@@ -1219,8 +1198,8 @@ const vi = _n(
|
|
|
1219
1198
|
"Pasting text via SET_CLIPBOARD:",
|
|
1220
1199
|
o.substring(0, 20) + (o.length > 20 ? "..." : "")
|
|
1221
1200
|
);
|
|
1222
|
-
const c =
|
|
1223
|
-
|
|
1201
|
+
const c = bn(o, !0);
|
|
1202
|
+
he(c);
|
|
1224
1203
|
}
|
|
1225
1204
|
}).catch((o) => {
|
|
1226
1205
|
console.error("Failed to read clipboard contents: ", o);
|
|
@@ -1229,137 +1208,137 @@ const vi = _n(
|
|
|
1229
1208
|
}
|
|
1230
1209
|
if (e.key.toLowerCase() === "m" && (e.metaKey || e.ctrlKey)) {
|
|
1231
1210
|
G("Menu shortcut detected");
|
|
1232
|
-
const o =
|
|
1211
|
+
const o = Ct(
|
|
1233
1212
|
B.ACTION_DOWN,
|
|
1234
1213
|
B.MENU,
|
|
1235
1214
|
0,
|
|
1236
1215
|
B.META_NONE
|
|
1237
1216
|
// Modifiers are handled by the shortcut check, not passed down
|
|
1238
1217
|
);
|
|
1239
|
-
|
|
1240
|
-
const c =
|
|
1218
|
+
he(o);
|
|
1219
|
+
const c = Ct(
|
|
1241
1220
|
B.ACTION_UP,
|
|
1242
1221
|
B.MENU,
|
|
1243
1222
|
0,
|
|
1244
1223
|
B.META_NONE
|
|
1245
1224
|
);
|
|
1246
|
-
|
|
1225
|
+
he(c);
|
|
1247
1226
|
return;
|
|
1248
1227
|
}
|
|
1249
1228
|
}
|
|
1250
|
-
const i =
|
|
1229
|
+
const i = Zn(e);
|
|
1251
1230
|
if (i) {
|
|
1252
1231
|
const { keycode: o, metaState: c } = i, d = e.type === "keydown" ? B.ACTION_DOWN : B.ACTION_UP;
|
|
1253
1232
|
G(`Sending Keycode: key=${e.key}, code=${o}, action=${d}, meta=${c}`);
|
|
1254
|
-
const s =
|
|
1233
|
+
const s = Ct(
|
|
1255
1234
|
d,
|
|
1256
1235
|
o,
|
|
1257
1236
|
0,
|
|
1258
1237
|
// repeat count, typically 0 for single presses
|
|
1259
1238
|
c
|
|
1260
1239
|
);
|
|
1261
|
-
|
|
1240
|
+
he(s);
|
|
1262
1241
|
} else
|
|
1263
1242
|
G(`Ignoring unhandled key event: type=${e.type}, key=${e.key}`);
|
|
1264
|
-
},
|
|
1265
|
-
e.stopPropagation(),
|
|
1266
|
-
}, ie =
|
|
1267
|
-
onAxSnapshotChange:
|
|
1243
|
+
}, tn = (e) => {
|
|
1244
|
+
e.stopPropagation(), N.current?.reconnect();
|
|
1245
|
+
}, ie = H({
|
|
1246
|
+
onAxSnapshotChange: ae,
|
|
1268
1247
|
onAxStatusChange: S,
|
|
1269
|
-
onCameraDemandChange:
|
|
1270
|
-
onCameraStats:
|
|
1271
|
-
onMicrophoneStateChange:
|
|
1248
|
+
onCameraDemandChange: W,
|
|
1249
|
+
onCameraStats: P,
|
|
1250
|
+
onMicrophoneStateChange: le,
|
|
1272
1251
|
onTrace: Y,
|
|
1273
|
-
onTerminated:
|
|
1252
|
+
onTerminated: se,
|
|
1274
1253
|
onConnectionStateChange: me,
|
|
1275
1254
|
onPlaybackStats: U
|
|
1276
1255
|
});
|
|
1277
1256
|
ie.current = {
|
|
1278
|
-
onAxSnapshotChange:
|
|
1257
|
+
onAxSnapshotChange: ae,
|
|
1279
1258
|
onAxStatusChange: S,
|
|
1280
|
-
onCameraDemandChange:
|
|
1281
|
-
onCameraStats:
|
|
1282
|
-
onMicrophoneStateChange:
|
|
1259
|
+
onCameraDemandChange: W,
|
|
1260
|
+
onCameraStats: P,
|
|
1261
|
+
onMicrophoneStateChange: le,
|
|
1283
1262
|
onTrace: Y,
|
|
1284
|
-
onTerminated:
|
|
1263
|
+
onTerminated: se,
|
|
1285
1264
|
onConnectionStateChange: me,
|
|
1286
1265
|
onPlaybackStats: U
|
|
1287
1266
|
};
|
|
1288
1267
|
const Yt = !!Y;
|
|
1289
|
-
|
|
1290
|
-
St.current = null,
|
|
1291
|
-
}, [t,
|
|
1268
|
+
J(() => {
|
|
1269
|
+
St.current = null, Gt(!1), qt(!1), Zt({}), Qt(null);
|
|
1270
|
+
}, [t, Re]), J(() => {
|
|
1292
1271
|
let e = !0;
|
|
1293
|
-
|
|
1294
|
-
const n =
|
|
1272
|
+
Ne.current !== null && (Ne.current = null, xt(null), Qe("onAxSnapshotChange", ie.current.onAxSnapshotChange, null));
|
|
1273
|
+
const n = gn({
|
|
1295
1274
|
url: t,
|
|
1296
1275
|
token: r,
|
|
1297
|
-
sessionId:
|
|
1298
|
-
watchOnly:
|
|
1299
|
-
deviceModel:
|
|
1276
|
+
sessionId: Ko,
|
|
1277
|
+
watchOnly: q,
|
|
1278
|
+
deviceModel: Re,
|
|
1300
1279
|
autoReconnect: E,
|
|
1301
1280
|
jitterBufferTargetMs: L,
|
|
1302
1281
|
openUrl: p,
|
|
1303
|
-
inspectMode:
|
|
1304
|
-
axPollIntervalMs:
|
|
1282
|
+
inspectMode: C,
|
|
1283
|
+
axPollIntervalMs: u,
|
|
1305
1284
|
axMaxBackoffMs: y,
|
|
1306
1285
|
androidElementTreeOptions: M,
|
|
1307
|
-
microphoneEnabled:
|
|
1286
|
+
microphoneEnabled: j,
|
|
1308
1287
|
onStateChange: (o) => {
|
|
1309
|
-
(o.videoReady || o.connection === "idle" || o.connection === "connecting" || o.connection === "reconnecting") &&
|
|
1288
|
+
(o.videoReady || o.connection === "idle" || o.connection === "connecting" || o.connection === "reconnecting") && _o(o.videoReady), So(o.connection === "failed"), Po(o.connection === "terminated"), ne(o.duo), Eo(o.duoState), No(o.duoError);
|
|
1310
1289
|
},
|
|
1311
1290
|
onAxSnapshotChange: (o) => {
|
|
1312
|
-
e && (xt((c) =>
|
|
1291
|
+
e && (xt((c) => yn(c, o) ? c : o), ie.current.onAxSnapshotChange?.(o));
|
|
1313
1292
|
},
|
|
1314
1293
|
onAxStatusChange: (...o) => ie.current.onAxStatusChange?.(...o),
|
|
1315
1294
|
onCameraDemandChange: (...o) => ie.current.onCameraDemandChange?.(...o),
|
|
1316
|
-
onCameraStats:
|
|
1295
|
+
onCameraStats: P ? (...o) => ie.current.onCameraStats?.(...o) : void 0,
|
|
1317
1296
|
onMicrophoneStateChange: (...o) => ie.current.onMicrophoneStateChange?.(...o),
|
|
1318
1297
|
onTrace: Yt ? (...o) => ie.current.onTrace?.(...o) : void 0,
|
|
1319
1298
|
onTerminated: () => ie.current.onTerminated?.(),
|
|
1320
1299
|
onConnectionStateChange: (...o) => ie.current.onConnectionStateChange?.(...o),
|
|
1321
1300
|
onPlaybackStats: U ? (...o) => ie.current.onPlaybackStats?.(...o) : void 0
|
|
1322
1301
|
});
|
|
1323
|
-
|
|
1324
|
-
const i =
|
|
1302
|
+
N.current = n;
|
|
1303
|
+
const i = R.current ? n.attachVideo(R.current) : void 0;
|
|
1325
1304
|
return n.start(), () => {
|
|
1326
|
-
e = !1, n.dispose(), i?.(),
|
|
1305
|
+
e = !1, n.dispose(), i?.(), N.current = null;
|
|
1327
1306
|
};
|
|
1328
|
-
}, [t, l,
|
|
1329
|
-
if (
|
|
1330
|
-
return
|
|
1331
|
-
}, [
|
|
1332
|
-
|
|
1307
|
+
}, [t, l, Re, Yt, q]), J(() => {
|
|
1308
|
+
if (K && $e.current)
|
|
1309
|
+
return N.current?.attachVideo($e.current, "inner");
|
|
1310
|
+
}, [K, t, l, Re, Yt, q]), J(() => {
|
|
1311
|
+
N.current?.updateOptions({
|
|
1333
1312
|
token: r,
|
|
1334
1313
|
openUrl: p,
|
|
1335
|
-
axPollIntervalMs:
|
|
1314
|
+
axPollIntervalMs: u,
|
|
1336
1315
|
axMaxBackoffMs: y,
|
|
1337
1316
|
androidElementTreeOptions: M,
|
|
1338
1317
|
autoReconnect: E,
|
|
1339
1318
|
jitterBufferTargetMs: L,
|
|
1340
|
-
microphoneEnabled:
|
|
1341
|
-
inspectMode:
|
|
1319
|
+
microphoneEnabled: j,
|
|
1320
|
+
inspectMode: C,
|
|
1342
1321
|
onPlaybackStats: U ? (...e) => ie.current.onPlaybackStats?.(...e) : void 0,
|
|
1343
|
-
onCameraStats:
|
|
1322
|
+
onCameraStats: P ? (...e) => ie.current.onCameraStats?.(...e) : void 0
|
|
1344
1323
|
});
|
|
1345
1324
|
}, [
|
|
1346
1325
|
r,
|
|
1347
1326
|
E,
|
|
1348
1327
|
L,
|
|
1349
|
-
|
|
1350
|
-
|
|
1328
|
+
j,
|
|
1329
|
+
C,
|
|
1351
1330
|
!!U,
|
|
1352
|
-
!!
|
|
1331
|
+
!!P,
|
|
1353
1332
|
p,
|
|
1354
|
-
|
|
1333
|
+
u,
|
|
1355
1334
|
y,
|
|
1356
1335
|
M
|
|
1357
1336
|
]);
|
|
1358
|
-
const
|
|
1359
|
-
if (!
|
|
1360
|
-
const e =
|
|
1337
|
+
const ct = () => {
|
|
1338
|
+
if (!so.current) return;
|
|
1339
|
+
const e = Fe();
|
|
1361
1340
|
if (!e) {
|
|
1362
|
-
|
|
1341
|
+
io(null);
|
|
1363
1342
|
return;
|
|
1364
1343
|
}
|
|
1365
1344
|
const n = {
|
|
@@ -1368,165 +1347,153 @@ const vi = _n(
|
|
|
1368
1347
|
width: e.actualWidth,
|
|
1369
1348
|
height: e.actualHeight
|
|
1370
1349
|
};
|
|
1371
|
-
|
|
1350
|
+
io(
|
|
1372
1351
|
(i) => i && i.left === n.left && i.top === n.top && i.width === n.width && i.height === n.height ? i : n
|
|
1373
1352
|
);
|
|
1374
1353
|
};
|
|
1375
|
-
|
|
1376
|
-
const e =
|
|
1354
|
+
J(() => {
|
|
1355
|
+
const e = R.current, n = Ae.current, i = oe.current;
|
|
1377
1356
|
if (!e) return;
|
|
1378
|
-
const o = (
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1381
|
-
const g = St.current, re = g ? `${g.width} / ${g.height}` : void 0, $ =
|
|
1382
|
-
if (
|
|
1383
|
-
if (
|
|
1384
|
-
const
|
|
1385
|
-
if (
|
|
1386
|
-
const
|
|
1357
|
+
const o = (_) => Zt((g) => Nt(g, _) ? g : _), c = (_) => Qt((g) => g && _ && Nt(g, _) ? g : _), d = (_) => Do((g) => g && _ && Nt(g, _) ? g : _), s = () => {
|
|
1358
|
+
const _ = e.videoWidth > 0 && e.videoHeight > 0;
|
|
1359
|
+
_ && (St.current = { width: e.videoWidth, height: e.videoHeight });
|
|
1360
|
+
const g = St.current, re = g ? `${g.width} / ${g.height}` : void 0, $ = Dt.current;
|
|
1361
|
+
if (Ie && i) {
|
|
1362
|
+
if (oo(g ? g.width / g.height : $t), !$?.naturalWidth) return;
|
|
1363
|
+
const We = $.naturalWidth / $.naturalHeight, vt = i.clientHeight - Et, Le = i.clientHeight > 0 ? Math.min(i.clientWidth, vt * We) : i.clientWidth;
|
|
1364
|
+
if (Le <= 0) return;
|
|
1365
|
+
const qe = Le / We, Ce = i.clientHeight > 0 ? Et / 2 : 0, { screen: fe } = Ie, bt = fe.notch ?? 0, Ze = fe.left * Le, Je = fe.top * qe, wt = fe.width * Le, Mt = fe.height * qe, vo = g ? g.width / g.height : $t, At = Math.min(wt, Mt * vo), Xt = At / vo, rn = Ze + (wt - At) / 2, cn = bt > 0 ? Je : Je + (Mt - Xt) / 2, bo = (st, Tt, sn, an) => `translate(calc(-50% + ${st + sn / 2 - Le / 2}px), calc(-50% + ${Tt + an / 2 - qe / 2 + Ce}px))`;
|
|
1387
1366
|
o({
|
|
1388
|
-
width: `${
|
|
1367
|
+
width: `${At}px`,
|
|
1389
1368
|
height: `${Xt}px`,
|
|
1390
|
-
transform:
|
|
1391
|
-
})
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
// A pixel under the stream's edge, so no seam shows between them.
|
|
1397
|
-
height: `${Bt + 1}px`,
|
|
1398
|
-
transform: $t(Ro, Ue, ot, Bt + 1)
|
|
1399
|
-
} : null;
|
|
1400
|
-
return Ce && Ne && ut(Ce, Ne) ? Ce : Ne;
|
|
1401
|
-
});
|
|
1402
|
-
const Eo = ce.height * Ee;
|
|
1403
|
-
Vo((Ce) => {
|
|
1404
|
-
const Ne = {
|
|
1405
|
-
width: `${Ct}px`,
|
|
1406
|
-
height: `${Eo}px`,
|
|
1407
|
-
transform: $t(tt, Ue, Ct, Eo)
|
|
1369
|
+
transform: bo(rn, cn, At, Xt)
|
|
1370
|
+
}), Wo((st) => {
|
|
1371
|
+
const Tt = {
|
|
1372
|
+
width: `${wt}px`,
|
|
1373
|
+
height: `${Mt}px`,
|
|
1374
|
+
transform: bo(Ze, Je, wt, Mt)
|
|
1408
1375
|
};
|
|
1409
|
-
return
|
|
1376
|
+
return st && Nt(st, Tt) ? st : Tt;
|
|
1410
1377
|
}), d({
|
|
1411
|
-
width: `${
|
|
1412
|
-
height: `${
|
|
1413
|
-
transform:
|
|
1414
|
-
}), c(null),
|
|
1378
|
+
width: `${Le}px`,
|
|
1379
|
+
height: `${qe}px`,
|
|
1380
|
+
transform: Ce ? `translateY(${Ce}px)` : void 0
|
|
1381
|
+
}), c(null), ct();
|
|
1415
1382
|
return;
|
|
1416
1383
|
}
|
|
1417
1384
|
if (pe && i) {
|
|
1418
|
-
const
|
|
1419
|
-
if (
|
|
1420
|
-
const
|
|
1385
|
+
const We = g ? g.width / g.height : $t, vt = i.clientWidth * 100 / at, qe = (i.clientHeight - Et) / (1 / We + Kt / 100), Ce = i.clientHeight > 0 ? Math.min(vt, qe) : vt;
|
|
1386
|
+
if (Ce <= 0) return;
|
|
1387
|
+
const fe = Ce / 100, bt = Ce / We, Ze = i.clientHeight > 0 ? Et / 2 : 0, Je = `${fe * ce.screenRadius}px`;
|
|
1421
1388
|
o({
|
|
1422
|
-
aspectRatio: `${
|
|
1423
|
-
width: `${
|
|
1424
|
-
height: `${
|
|
1425
|
-
borderRadius: `${
|
|
1426
|
-
transform: `translate(-50%, calc(-50% - ${
|
|
1389
|
+
aspectRatio: `${We}`,
|
|
1390
|
+
width: `${Ce}px`,
|
|
1391
|
+
height: `${bt}px`,
|
|
1392
|
+
borderRadius: `${Je} ${Je} 0 0`,
|
|
1393
|
+
transform: `translate(-50%, calc(-50% - ${fe * En - Ze}px))`
|
|
1427
1394
|
}), d({
|
|
1428
|
-
width: `${
|
|
1429
|
-
height: `${
|
|
1430
|
-
transform:
|
|
1431
|
-
"--rc-macbook-unit": `${
|
|
1432
|
-
}),
|
|
1395
|
+
width: `${fe * at}px`,
|
|
1396
|
+
height: `${bt + fe * Kt}px`,
|
|
1397
|
+
transform: Ze ? `translateY(${Ze}px)` : void 0,
|
|
1398
|
+
"--rc-macbook-unit": `${fe}px`
|
|
1399
|
+
}), oo(We), c(null), ct();
|
|
1433
1400
|
return;
|
|
1434
1401
|
}
|
|
1435
|
-
if (d(null), !
|
|
1402
|
+
if (d(null), !it || !n) {
|
|
1436
1403
|
o(
|
|
1437
|
-
!
|
|
1404
|
+
!_ && g ? {
|
|
1438
1405
|
aspectRatio: re,
|
|
1439
1406
|
contain: "size",
|
|
1440
1407
|
containIntrinsicSize: `${g.width}px ${g.height}px`
|
|
1441
1408
|
} : {}
|
|
1442
|
-
), c(null),
|
|
1409
|
+
), c(null), ct();
|
|
1443
1410
|
return;
|
|
1444
1411
|
}
|
|
1445
|
-
const
|
|
1446
|
-
if (
|
|
1412
|
+
const Z = n.clientWidth, ue = n.clientHeight;
|
|
1413
|
+
if (Z === 0 || ue === 0) return;
|
|
1447
1414
|
const O = g ? g.width > g.height : !1;
|
|
1448
|
-
|
|
1449
|
-
|
|
1415
|
+
Gt(O), qt(
|
|
1416
|
+
z === "android" && !!g && Vn(g.width, g.height)
|
|
1450
1417
|
);
|
|
1451
|
-
const
|
|
1452
|
-
let
|
|
1453
|
-
|
|
1454
|
-
const ge =
|
|
1418
|
+
const De = O ? _e.videoPosition.landscape : _e.videoPosition.portrait;
|
|
1419
|
+
let we = { aspectRatio: re };
|
|
1420
|
+
De.heightMultiplier ? (we.height = `${ue * De.heightMultiplier}px`, we.width = "auto") : De.widthMultiplier && (we.width = `${Z * De.widthMultiplier}px`, we.height = "auto"), we.borderRadius = `${O ? ue * _e.videoBorderRadiusMultiplier : Z * _e.videoBorderRadiusMultiplier}px`, o(we);
|
|
1421
|
+
const ge = _e.homeButton, je = O ? Z : ue, yo = `calc(50% + ${je * (ge?.offset ?? 0)}px)`;
|
|
1455
1422
|
c(
|
|
1456
1423
|
ge ? {
|
|
1457
|
-
width: `${
|
|
1458
|
-
height: `${
|
|
1459
|
-
left: O ?
|
|
1460
|
-
top: O ? "50%" :
|
|
1424
|
+
width: `${je * ge.diameter}px`,
|
|
1425
|
+
height: `${je * ge.diameter}px`,
|
|
1426
|
+
left: O ? yo : "50%",
|
|
1427
|
+
top: O ? "50%" : yo
|
|
1461
1428
|
} : null
|
|
1462
|
-
),
|
|
1463
|
-
},
|
|
1429
|
+
), ct();
|
|
1430
|
+
}, h = new ResizeObserver(() => {
|
|
1464
1431
|
s();
|
|
1465
1432
|
});
|
|
1466
|
-
n &&
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1469
|
-
const
|
|
1470
|
-
return e.addEventListener("resize",
|
|
1471
|
-
|
|
1433
|
+
n && h.observe(n), h.observe(e), i && h.observe(i), n && n.addEventListener("load", s);
|
|
1434
|
+
const f = Dt.current;
|
|
1435
|
+
f?.addEventListener("load", s), e.addEventListener("loadedmetadata", s), e.addEventListener("resize", s);
|
|
1436
|
+
const A = () => N.current?.bumpActivity();
|
|
1437
|
+
return e.addEventListener("resize", A), s(), () => {
|
|
1438
|
+
h.disconnect(), e.removeEventListener("loadedmetadata", s), e.removeEventListener("resize", s), e.removeEventListener("resize", A), n && n.removeEventListener("load", s), f?.removeEventListener("load", s);
|
|
1472
1439
|
};
|
|
1473
|
-
}, [
|
|
1474
|
-
|
|
1475
|
-
}, [
|
|
1440
|
+
}, [_e, it, pe, Ie?.src, Se, t, T]), J(() => {
|
|
1441
|
+
ke ? ct() : (xt(null), ot(null), ht(null), ro(null), Ue(null), ft.current = null, ve.current !== void 0 && (window.cancelAnimationFrame(ve.current), ve.current = void 0));
|
|
1442
|
+
}, [ke]), J(() => () => {
|
|
1476
1443
|
ve.current !== void 0 && (window.cancelAnimationFrame(ve.current), ve.current = void 0);
|
|
1477
|
-
}, []),
|
|
1478
|
-
if (!
|
|
1444
|
+
}, []), J(() => {
|
|
1445
|
+
if (!ke) return;
|
|
1479
1446
|
const e = (n) => {
|
|
1480
|
-
n.key === "Escape" && (Ht || Pt) && (
|
|
1447
|
+
n.key === "Escape" && (Ht || Pt) && (ht(null), ot(null), Ue(null), Qe("onInspectSelectionChange", Ke.current, null));
|
|
1481
1448
|
};
|
|
1482
1449
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1483
|
-
}, [
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1450
|
+
}, [ke, Ht, Pt]);
|
|
1451
|
+
const on = () => {
|
|
1452
|
+
R.current && R.current.focus();
|
|
1486
1453
|
};
|
|
1487
|
-
|
|
1488
|
-
openUrl: (e) =>
|
|
1489
|
-
sendKeyEvent: (e) =>
|
|
1490
|
-
screenshot: (e) =>
|
|
1491
|
-
terminateApp: (e) =>
|
|
1492
|
-
reconnect: () =>
|
|
1493
|
-
refreshAxTree: () =>
|
|
1494
|
-
getAxSnapshot: () =>
|
|
1454
|
+
Rn(te, () => ({
|
|
1455
|
+
openUrl: (e) => N.current?.openUrl(e),
|
|
1456
|
+
sendKeyEvent: (e) => N.current?.sendKeyEvent(e),
|
|
1457
|
+
screenshot: (e) => N.current?.screenshot(e) ?? Promise.reject(new Error("Simulator disconnected")),
|
|
1458
|
+
terminateApp: (e) => N.current?.terminateApp(e) ?? Promise.reject(new Error("Simulator disconnected")),
|
|
1459
|
+
reconnect: () => N.current?.reconnect(),
|
|
1460
|
+
refreshAxTree: () => N.current?.refreshAxTree() ?? Promise.reject(new Error("Simulator disconnected")),
|
|
1461
|
+
getAxSnapshot: () => N.current?.getAxSnapshot() ?? null,
|
|
1495
1462
|
setInspectHighlight: (e) => {
|
|
1496
|
-
|
|
1463
|
+
ot(e?.id ?? null);
|
|
1497
1464
|
},
|
|
1498
1465
|
setInspectSelection: (e) => {
|
|
1499
|
-
|
|
1500
|
-
const n =
|
|
1501
|
-
e && n ?
|
|
1466
|
+
ht(e?.id ?? null), Ue(e ? ft.current : null);
|
|
1467
|
+
const n = Ne.current;
|
|
1468
|
+
e && n ? Qe("onInspectSelectionChange", Ke.current, { element: e, snapshot: n }) : Qe("onInspectSelectionChange", Ke.current, null);
|
|
1502
1469
|
},
|
|
1503
|
-
getAxStatus: () =>
|
|
1470
|
+
getAxStatus: () => N.current?.getAxStatus() ?? "idle"
|
|
1504
1471
|
}));
|
|
1505
|
-
const
|
|
1472
|
+
const nn = Lo && Ee !== null;
|
|
1506
1473
|
return /* @__PURE__ */ ee(
|
|
1507
1474
|
"div",
|
|
1508
1475
|
{
|
|
1509
1476
|
ref: oe,
|
|
1510
1477
|
className: ["rc-container", a].filter(Boolean).join(" "),
|
|
1511
1478
|
style: { touchAction: "none" },
|
|
1512
|
-
onMouseDown:
|
|
1513
|
-
onMouseMove:
|
|
1514
|
-
onMouseUp:
|
|
1515
|
-
onMouseLeave:
|
|
1516
|
-
onTouchStart:
|
|
1517
|
-
onTouchMove:
|
|
1518
|
-
onTouchEnd:
|
|
1519
|
-
onTouchCancel:
|
|
1520
|
-
onContextMenu:
|
|
1479
|
+
onMouseDown: Te,
|
|
1480
|
+
onMouseMove: Te,
|
|
1481
|
+
onMouseUp: Te,
|
|
1482
|
+
onMouseLeave: Te,
|
|
1483
|
+
onTouchStart: Te,
|
|
1484
|
+
onTouchMove: Te,
|
|
1485
|
+
onTouchEnd: Te,
|
|
1486
|
+
onTouchCancel: Te,
|
|
1487
|
+
onContextMenu: z === "macos" ? (e) => e.preventDefault() : void 0,
|
|
1521
1488
|
children: [
|
|
1522
|
-
|
|
1489
|
+
nn && Ee && /* @__PURE__ */ ee(Co, { children: [
|
|
1523
1490
|
/* @__PURE__ */ w(
|
|
1524
1491
|
"div",
|
|
1525
1492
|
{
|
|
1526
1493
|
className: "rc-touch-indicator",
|
|
1527
1494
|
style: {
|
|
1528
|
-
left: `${
|
|
1529
|
-
top: `${
|
|
1495
|
+
left: `${Ee.containerX}px`,
|
|
1496
|
+
top: `${Ee.containerY}px`
|
|
1530
1497
|
}
|
|
1531
1498
|
}
|
|
1532
1499
|
),
|
|
@@ -1535,103 +1502,102 @@ const vi = _n(
|
|
|
1535
1502
|
{
|
|
1536
1503
|
className: "rc-touch-indicator",
|
|
1537
1504
|
style: {
|
|
1538
|
-
left: `${
|
|
1539
|
-
top: `${
|
|
1505
|
+
left: `${Ee.mirrorContainerX}px`,
|
|
1506
|
+
top: `${Ee.mirrorContainerY}px`
|
|
1540
1507
|
}
|
|
1541
1508
|
}
|
|
1542
1509
|
)
|
|
1543
1510
|
] }),
|
|
1544
|
-
|
|
1511
|
+
it && /* @__PURE__ */ w(
|
|
1545
1512
|
"img",
|
|
1546
1513
|
{
|
|
1547
|
-
ref:
|
|
1548
|
-
src:
|
|
1514
|
+
ref: Ae,
|
|
1515
|
+
src: lo,
|
|
1549
1516
|
alt: "",
|
|
1550
|
-
className:
|
|
1517
|
+
className: z === "ios" ? "rc-phone-frame rc-phone-frame-ios" : "rc-phone-frame",
|
|
1551
1518
|
draggable: !1
|
|
1552
1519
|
}
|
|
1553
1520
|
),
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
be && !we && /* @__PURE__ */ w(
|
|
1521
|
+
Ie && !Se && eo && /* @__PURE__ */ w("div", { className: "rc-macbook-screen", style: eo, "aria-hidden": "true" }),
|
|
1522
|
+
Ie && !Se && /* @__PURE__ */ w(
|
|
1557
1523
|
"img",
|
|
1558
1524
|
{
|
|
1559
|
-
ref:
|
|
1560
|
-
src:
|
|
1525
|
+
ref: Dt,
|
|
1526
|
+
src: Ie.src,
|
|
1561
1527
|
alt: "",
|
|
1562
1528
|
className: "rc-macbook-image",
|
|
1563
1529
|
style: It ?? { visibility: "hidden" },
|
|
1564
1530
|
draggable: !1
|
|
1565
1531
|
}
|
|
1566
1532
|
),
|
|
1567
|
-
pe && !
|
|
1533
|
+
pe && !Ie && It && !Se && /* @__PURE__ */ ee("div", { className: "rc-macbook", style: It, "aria-hidden": "true", children: [
|
|
1568
1534
|
/* @__PURE__ */ w("div", { className: "rc-macbook-lid", children: /* @__PURE__ */ w("div", { className: "rc-macbook-camera" }) }),
|
|
1569
1535
|
/* @__PURE__ */ w("div", { className: "rc-macbook-base" })
|
|
1570
1536
|
] }),
|
|
1571
|
-
|
|
1537
|
+
it && Jt && !q && /* @__PURE__ */ w(
|
|
1572
1538
|
"button",
|
|
1573
1539
|
{
|
|
1574
1540
|
type: "button",
|
|
1575
1541
|
className: "rc-home-button",
|
|
1576
1542
|
"aria-label": "Home",
|
|
1577
1543
|
title: "Home",
|
|
1578
|
-
style:
|
|
1544
|
+
style: Jt,
|
|
1579
1545
|
onMouseDown: (e) => e.stopPropagation(),
|
|
1580
1546
|
onTouchStart: (e) => e.stopPropagation(),
|
|
1581
1547
|
onTouchEnd: (e) => {
|
|
1582
|
-
e.stopPropagation(), e.preventDefault(),
|
|
1548
|
+
e.stopPropagation(), e.preventDefault(), N.current?.pressButton("home");
|
|
1583
1549
|
},
|
|
1584
1550
|
onClick: (e) => {
|
|
1585
|
-
e.stopPropagation(),
|
|
1551
|
+
e.stopPropagation(), N.current?.pressButton("home");
|
|
1586
1552
|
}
|
|
1587
1553
|
}
|
|
1588
1554
|
),
|
|
1589
1555
|
/* @__PURE__ */ w(
|
|
1590
1556
|
"video",
|
|
1591
1557
|
{
|
|
1592
|
-
ref:
|
|
1558
|
+
ref: R,
|
|
1593
1559
|
className: [
|
|
1594
1560
|
"rc-video",
|
|
1595
|
-
!
|
|
1596
|
-
!
|
|
1561
|
+
!it && !pe && "rc-video-frameless",
|
|
1562
|
+
!ko && (z === "macos" ? "rc-video-loading-desktop" : "rc-video-loading")
|
|
1597
1563
|
].filter(Boolean).join(" "),
|
|
1598
1564
|
style: {
|
|
1599
|
-
...
|
|
1600
|
-
...
|
|
1601
|
-
...
|
|
1602
|
-
backgroundImage: `url("${
|
|
1565
|
+
...Ho,
|
|
1566
|
+
...K || Se ? { opacity: 0, width: 1, height: 1, pointerEvents: "none" } : {},
|
|
1567
|
+
...uo ? {
|
|
1568
|
+
backgroundImage: `url("${uo}")`,
|
|
1603
1569
|
backgroundRepeat: "no-repeat",
|
|
1604
1570
|
backgroundPosition: "center",
|
|
1605
|
-
backgroundSize:
|
|
1571
|
+
backgroundSize: _e.loadingLogoSize
|
|
1606
1572
|
} : {}
|
|
1607
1573
|
},
|
|
1608
1574
|
autoPlay: !0,
|
|
1609
1575
|
playsInline: !0,
|
|
1610
1576
|
muted: !0,
|
|
1611
|
-
tabIndex:
|
|
1612
|
-
onKeyDown:
|
|
1613
|
-
onKeyUp:
|
|
1614
|
-
onClick:
|
|
1577
|
+
tabIndex: K || Se ? -1 : 0,
|
|
1578
|
+
onKeyDown: Ge,
|
|
1579
|
+
onKeyUp: Ge,
|
|
1580
|
+
onClick: on,
|
|
1615
1581
|
onFocus: () => {
|
|
1616
|
-
|
|
1582
|
+
R.current && (R.current.style.outline = "none");
|
|
1617
1583
|
},
|
|
1618
1584
|
onBlur: () => {
|
|
1619
|
-
|
|
1585
|
+
R.current && (R.current.style.outline = "none"), rt();
|
|
1620
1586
|
}
|
|
1621
1587
|
}
|
|
1622
1588
|
),
|
|
1623
|
-
|
|
1624
|
-
|
|
1589
|
+
zo && to && /* @__PURE__ */ w(Mo, { fallback: null, children: /* @__PURE__ */ w(
|
|
1590
|
+
Fn,
|
|
1625
1591
|
{
|
|
1626
|
-
video:
|
|
1627
|
-
aspect:
|
|
1628
|
-
model:
|
|
1592
|
+
video: R.current,
|
|
1593
|
+
aspect: to,
|
|
1594
|
+
model: I ?? de?.model,
|
|
1629
1595
|
animateLid: b,
|
|
1630
|
-
watchOnly:
|
|
1631
|
-
onReady:
|
|
1596
|
+
watchOnly: q,
|
|
1597
|
+
onReady: et.onReady,
|
|
1632
1598
|
pointer: (e, n, i, o) => {
|
|
1633
|
-
const c =
|
|
1634
|
-
!c?.videoWidth || !
|
|
1599
|
+
const c = R.current;
|
|
1600
|
+
!c?.videoWidth || !N.current?.getState().controlReady || xe.pointer(
|
|
1635
1601
|
e === "down" ? Q.DOWN : e === "up" ? Q.UP : Q.MOVE,
|
|
1636
1602
|
{
|
|
1637
1603
|
x: n * c.videoWidth,
|
|
@@ -1643,8 +1609,8 @@ const vi = _n(
|
|
|
1643
1609
|
);
|
|
1644
1610
|
},
|
|
1645
1611
|
scroll: (e, n, i, o) => {
|
|
1646
|
-
const c =
|
|
1647
|
-
!c?.videoWidth || !
|
|
1612
|
+
const c = R.current;
|
|
1613
|
+
!c?.videoWidth || !N.current?.getState().controlReady || xe.scroll(
|
|
1648
1614
|
{
|
|
1649
1615
|
x: e * c.videoWidth,
|
|
1650
1616
|
y: n * c.videoHeight,
|
|
@@ -1655,92 +1621,92 @@ const vi = _n(
|
|
|
1655
1621
|
o
|
|
1656
1622
|
);
|
|
1657
1623
|
},
|
|
1658
|
-
onKeyDown:
|
|
1659
|
-
onKeyUp:
|
|
1660
|
-
onBlur:
|
|
1624
|
+
onKeyDown: Ge,
|
|
1625
|
+
onKeyUp: Ge,
|
|
1626
|
+
onBlur: rt
|
|
1661
1627
|
}
|
|
1662
1628
|
) }),
|
|
1663
|
-
pe && /* @__PURE__ */ w(
|
|
1664
|
-
|
|
1629
|
+
pe && /* @__PURE__ */ w(Hn, { view: et, label: "MacBook rendering" }),
|
|
1630
|
+
K && /* @__PURE__ */ w(
|
|
1665
1631
|
"video",
|
|
1666
1632
|
{
|
|
1667
|
-
ref:
|
|
1633
|
+
ref: $e,
|
|
1668
1634
|
autoPlay: !0,
|
|
1669
1635
|
playsInline: !0,
|
|
1670
1636
|
muted: !0,
|
|
1671
1637
|
style: { position: "absolute", width: 1, height: 1, opacity: 0, pointerEvents: "none" }
|
|
1672
1638
|
}
|
|
1673
1639
|
),
|
|
1674
|
-
|
|
1675
|
-
|
|
1640
|
+
K && Ft && /* @__PURE__ */ w(Mo, { fallback: /* @__PURE__ */ w("div", { children: "Loading iPhone Duo…" }), children: /* @__PURE__ */ w(
|
|
1641
|
+
zn,
|
|
1676
1642
|
{
|
|
1677
|
-
watchOnly:
|
|
1678
|
-
showFrame:
|
|
1679
|
-
model:
|
|
1680
|
-
outer:
|
|
1681
|
-
inner:
|
|
1682
|
-
state:
|
|
1683
|
-
setAngle: (e) =>
|
|
1684
|
-
setOrientation: (e) =>
|
|
1685
|
-
button: (e, n) =>
|
|
1643
|
+
watchOnly: q,
|
|
1644
|
+
showFrame: m,
|
|
1645
|
+
model: k ?? de?.model,
|
|
1646
|
+
outer: R.current,
|
|
1647
|
+
inner: $e.current,
|
|
1648
|
+
state: Ft,
|
|
1649
|
+
setAngle: (e) => Wt("setHingeAngle", { angleDegrees: e }),
|
|
1650
|
+
setOrientation: (e) => Wt("setDuoOrientation", { orientation: e }),
|
|
1651
|
+
button: (e, n) => Wt("performActions", {
|
|
1686
1652
|
actions: [{ type: n ? "buttonDown" : "buttonUp", button: e }]
|
|
1687
1653
|
}),
|
|
1688
1654
|
touch: (e, n, i, o) => {
|
|
1689
|
-
|
|
1655
|
+
N.current?.sendDisplayTouch(e, n, i, o);
|
|
1690
1656
|
},
|
|
1691
|
-
onKeyDown:
|
|
1692
|
-
onKeyUp:
|
|
1657
|
+
onKeyDown: Ge,
|
|
1658
|
+
onKeyUp: Ge
|
|
1693
1659
|
}
|
|
1694
1660
|
) }),
|
|
1695
|
-
|
|
1696
|
-
!
|
|
1697
|
-
|
|
1661
|
+
K && Vt && /* @__PURE__ */ w("div", { role: "alert", className: "rc-duo-error", children: Vt }),
|
|
1662
|
+
!K && ke && /* @__PURE__ */ w(
|
|
1663
|
+
Un,
|
|
1698
1664
|
{
|
|
1699
|
-
snapshot:
|
|
1700
|
-
geometry:
|
|
1665
|
+
snapshot: no,
|
|
1666
|
+
geometry: Xo,
|
|
1701
1667
|
highlightedId: Pt,
|
|
1702
1668
|
selectedId: Ht,
|
|
1703
|
-
mode:
|
|
1704
|
-
cursorPosition:
|
|
1705
|
-
frozenCursorPosition:
|
|
1669
|
+
mode: Uo,
|
|
1670
|
+
cursorPosition: $o,
|
|
1671
|
+
frozenCursorPosition: Bo,
|
|
1706
1672
|
onSelectChange: (e, n) => {
|
|
1707
|
-
|
|
1708
|
-
const i =
|
|
1709
|
-
e && i ?
|
|
1673
|
+
ht(e?.id ?? null), e && n ? Ue(n) : e || Ue(null);
|
|
1674
|
+
const i = Ne.current;
|
|
1675
|
+
e && i ? Qe("onInspectSelectionChange", Ke.current, {
|
|
1710
1676
|
element: e,
|
|
1711
1677
|
snapshot: i
|
|
1712
|
-
}) :
|
|
1678
|
+
}) : Qe("onInspectSelectionChange", Ke.current, null);
|
|
1713
1679
|
},
|
|
1714
|
-
onTapElement:
|
|
1680
|
+
onTapElement: q ? void 0 : ((e, n) => {
|
|
1715
1681
|
if (n) {
|
|
1716
|
-
|
|
1682
|
+
po(n.x, n.y);
|
|
1717
1683
|
return;
|
|
1718
1684
|
}
|
|
1719
|
-
const i =
|
|
1720
|
-
i &&
|
|
1685
|
+
const i = Ne.current;
|
|
1686
|
+
i && Fo(e, i);
|
|
1721
1687
|
})
|
|
1722
1688
|
}
|
|
1723
1689
|
),
|
|
1724
|
-
|
|
1690
|
+
xo ? /* @__PURE__ */ ee("div", { className: "rc-terminated", role: "status", children: [
|
|
1725
1691
|
/* @__PURE__ */ w("div", { className: "rc-terminated-title", children: "Instance terminated" }),
|
|
1726
1692
|
/* @__PURE__ */ w("div", { className: "rc-terminated-message", children: "This instance no longer exists and can't be reconnected." })
|
|
1727
|
-
] }) :
|
|
1693
|
+
] }) : Io && /* @__PURE__ */ w("button", { type: "button", className: "rc-retry-button", onClick: tn, children: "Retry" })
|
|
1728
1694
|
]
|
|
1729
1695
|
}
|
|
1730
1696
|
);
|
|
1731
1697
|
}
|
|
1732
1698
|
);
|
|
1733
1699
|
export {
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1700
|
+
Hn as D,
|
|
1701
|
+
ii as M,
|
|
1702
|
+
ui as R,
|
|
1703
|
+
oi as a,
|
|
1704
|
+
ni as b,
|
|
1705
|
+
ri as c,
|
|
1706
|
+
si as d,
|
|
1707
|
+
li as e,
|
|
1708
|
+
ci as l,
|
|
1709
|
+
ai as m,
|
|
1710
|
+
di as s,
|
|
1711
|
+
Pn as u
|
|
1746
1712
|
};
|