@limrun/ui 0.20.0 → 0.20.2
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lite.cjs +1 -1
- package/dist/lite.js +1 -1
- package/dist/{remote-control-BBgt4TkM.mjs → remote-control-5bvo9qDc.mjs} +388 -405
- package/dist/remote-control-DiIQYNng.js +1 -0
- package/package.json +1 -3
- package/dist/remote-control-GLVdY8Xa.js +0 -1
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f as
|
|
3
|
-
import { memo as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import './index.css';
|
|
6
|
-
var r, h, u = "";
|
|
7
|
-
if (typeof d == "string" || typeof d == "number") u += d;
|
|
8
|
-
else if (typeof d == "object") if (Array.isArray(d)) {
|
|
9
|
-
var b = d.length;
|
|
10
|
-
for (r = 0; r < b; r++) d[r] && (h = gt(d[r])) && (u && (u += " "), u += h);
|
|
11
|
-
} else for (h in d) d[h] && (u && (u += " "), u += h);
|
|
12
|
-
return u;
|
|
13
|
-
}
|
|
14
|
-
function de() {
|
|
15
|
-
for (var d, r, h = 0, u = "", b = arguments.length; h < b; h++) (d = arguments[h]) && (r = gt(d)) && (u && (u += " "), u += r);
|
|
16
|
-
return u;
|
|
17
|
-
}
|
|
18
|
-
const un = async (d) => {
|
|
1
|
+
import { jsx as f, jsxs as $, Fragment as ft } from "react/jsx-runtime";
|
|
2
|
+
import { f as Kt, c as pt, d as Vt, b as Bt, h as jt, i as Gt, s as ye, j as qt, e as Qt, k as Y, l as je, m as Zt, o as Le, p as R, q as He, a as Jt, r as en, t as m, u as tn } from "./core-BhHpU_lr.mjs";
|
|
3
|
+
import { memo as Ge, useState as N, useEffect as x, useMemo as we, useCallback as nn, lazy as on, forwardRef as rn, useRef as _, useImperativeHandle as cn, Suspense as sn } from "react";
|
|
4
|
+
import { createPortal as an } from "react-dom";
|
|
5
|
+
import './index.css';const ln = async (d) => {
|
|
19
6
|
if (!d) return !1;
|
|
20
7
|
try {
|
|
21
8
|
if (typeof navigator < "u" && navigator.clipboard?.writeText)
|
|
@@ -25,94 +12,94 @@ const un = async (d) => {
|
|
|
25
12
|
try {
|
|
26
13
|
const r = document.createElement("textarea");
|
|
27
14
|
r.value = d, r.style.position = "fixed", r.style.opacity = "0", document.body.appendChild(r), r.select();
|
|
28
|
-
const
|
|
29
|
-
return document.body.removeChild(r),
|
|
15
|
+
const p = document.execCommand("copy");
|
|
16
|
+
return document.body.removeChild(r), p;
|
|
30
17
|
} catch {
|
|
31
18
|
return !1;
|
|
32
19
|
}
|
|
33
|
-
},
|
|
34
|
-
function({ element: r, screen:
|
|
35
|
-
const T =
|
|
20
|
+
}, dn = Ge(
|
|
21
|
+
function({ element: r, screen: p, highlighted: h, selected: k, selectable: K, onClick: I }) {
|
|
22
|
+
const T = Kt(r.frame, p);
|
|
36
23
|
if (!T) return null;
|
|
37
24
|
const U = pt(r);
|
|
38
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ f(
|
|
39
26
|
"button",
|
|
40
27
|
{
|
|
41
28
|
type: "button",
|
|
42
|
-
className:
|
|
29
|
+
className: r.enabled ? "rc-inspect-box" : "rc-inspect-box rc-inspect-box-disabled",
|
|
43
30
|
"data-ax-id": r.id,
|
|
44
31
|
"data-ax-path": r.path,
|
|
45
32
|
"data-ax-label": r.label || void 0,
|
|
46
33
|
"data-ax-role": r.role || void 0,
|
|
47
|
-
"data-highlighted":
|
|
48
|
-
"data-selected":
|
|
34
|
+
"data-highlighted": h ? "true" : "false",
|
|
35
|
+
"data-selected": k ? "true" : "false",
|
|
49
36
|
"aria-label": U,
|
|
50
37
|
onClick: (H) => {
|
|
51
|
-
K && (H.preventDefault(), H.stopPropagation(),
|
|
38
|
+
K && (H.preventDefault(), H.stopPropagation(), I(r, { x: H.clientX, y: H.clientY }));
|
|
52
39
|
},
|
|
53
40
|
style: {
|
|
54
|
-
left: `${T.x /
|
|
55
|
-
top: `${T.y /
|
|
56
|
-
width: `${T.width /
|
|
57
|
-
height: `${T.height /
|
|
41
|
+
left: `${T.x / p.width * 100}%`,
|
|
42
|
+
top: `${T.y / p.height * 100}%`,
|
|
43
|
+
width: `${T.width / p.width * 100}%`,
|
|
44
|
+
height: `${T.height / p.height * 100}%`
|
|
58
45
|
}
|
|
59
46
|
}
|
|
60
47
|
);
|
|
61
48
|
},
|
|
62
|
-
(d, r) => d.highlighted === r.highlighted && d.selected === r.selected && d.selectable === r.selectable && d.screen.width === r.screen.width && d.screen.height === r.screen.height && d.onClick === r.onClick &&
|
|
63
|
-
),
|
|
49
|
+
(d, r) => d.highlighted === r.highlighted && d.selected === r.selected && d.selectable === r.selectable && d.screen.width === r.screen.width && d.screen.height === r.screen.height && d.onClick === r.onClick && Vt(d.element, r.element)
|
|
50
|
+
), un = 260, hn = 220, fn = 6, pn = 8, mn = Ge(function({
|
|
64
51
|
element: r,
|
|
65
|
-
platform:
|
|
66
|
-
anchor:
|
|
67
|
-
cursorAnchored:
|
|
52
|
+
platform: p,
|
|
53
|
+
anchor: h,
|
|
54
|
+
cursorAnchored: k,
|
|
68
55
|
showActions: K,
|
|
69
|
-
onTap:
|
|
56
|
+
onTap: I
|
|
70
57
|
}) {
|
|
71
|
-
const [T, U] =
|
|
58
|
+
const [T, U] = N(null);
|
|
72
59
|
x(() => {
|
|
73
60
|
if (!T) return;
|
|
74
61
|
const A = window.setTimeout(() => U(null), 1100);
|
|
75
62
|
return () => window.clearTimeout(A);
|
|
76
63
|
}, [T]);
|
|
77
|
-
const H =
|
|
78
|
-
const A =
|
|
79
|
-
let
|
|
80
|
-
const
|
|
81
|
-
return
|
|
82
|
-
}, [
|
|
64
|
+
const H = we(() => {
|
|
65
|
+
const A = un, F = hn, X = fn, g = pn, Q = typeof window < "u" ? window.innerWidth : 1024, oe = typeof window < "u" ? window.innerHeight : 768, Z = h.x + X + A <= Q - g, J = h.y - X - F >= g;
|
|
66
|
+
let de = Z ? h.x + X : h.x - X, Ae = J ? h.y - X : h.y + X;
|
|
67
|
+
const Me = `translate(${Z ? "0" : "-100%"}, ${J ? "-100%" : "0"})`;
|
|
68
|
+
return de = Math.max(g + (Z ? 0 : A), Math.min(Q - g - (Z ? A : 0), de)), Ae = Math.max(g + (J ? F : 0), Math.min(oe - g - (J ? 0 : F), Ae)), { left: `${de}px`, top: `${Ae}px`, transform: Me };
|
|
69
|
+
}, [h.x, h.y]), M = we(() => Bt(r, p), [r, p]), W = p === "ios" ? r.selectors.AXUniqueId : r.selectors.resourceId, B = p === "ios" ? "AXUniqueId" : "resourceId", q = nn(async (A, F) => {
|
|
83
70
|
if (!A) return;
|
|
84
|
-
await
|
|
85
|
-
}, []),
|
|
86
|
-
return
|
|
71
|
+
await ln(A) && U(F);
|
|
72
|
+
}, []), S = jt(r), Te = r.label || r.value || S, ne = pt(r);
|
|
73
|
+
return an(
|
|
87
74
|
/* @__PURE__ */ $(
|
|
88
75
|
"div",
|
|
89
76
|
{
|
|
90
77
|
className: "rc-inspect-card",
|
|
91
|
-
"data-cursor-anchored":
|
|
78
|
+
"data-cursor-anchored": k ? "true" : "false",
|
|
92
79
|
style: H,
|
|
93
80
|
onClick: (A) => A.stopPropagation(),
|
|
94
81
|
onMouseDown: (A) => A.stopPropagation(),
|
|
95
82
|
onMouseMove: (A) => A.stopPropagation(),
|
|
96
83
|
children: [
|
|
97
84
|
/* @__PURE__ */ $("div", { className: "rc-inspect-card-header", children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
!r.enabled && /* @__PURE__ */
|
|
100
|
-
r.focused && /* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ f("span", { className: "rc-inspect-card-role", children: S }),
|
|
86
|
+
!r.enabled && /* @__PURE__ */ f("span", { className: "rc-inspect-card-tag", children: "disabled" }),
|
|
87
|
+
r.focused && /* @__PURE__ */ f("span", { className: "rc-inspect-card-tag rc-inspect-card-tag-blue", children: "focused" })
|
|
101
88
|
] }),
|
|
102
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ f("p", { className: "rc-inspect-card-title", title: ne, children: Te }),
|
|
103
90
|
W && /* @__PURE__ */ $("div", { className: "rc-inspect-card-row", children: [
|
|
104
91
|
/* @__PURE__ */ $("span", { className: "rc-inspect-card-row-label", children: [
|
|
105
92
|
B,
|
|
106
93
|
":"
|
|
107
94
|
] }),
|
|
108
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ f("span", { className: "rc-inspect-card-row-value", children: W })
|
|
109
96
|
] }),
|
|
110
97
|
r.value && r.value !== r.label && /* @__PURE__ */ $("div", { className: "rc-inspect-card-row", children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ f("span", { className: "rc-inspect-card-row-label", children: "value:" }),
|
|
99
|
+
/* @__PURE__ */ f("span", { className: "rc-inspect-card-row-value", children: r.value })
|
|
113
100
|
] }),
|
|
114
101
|
/* @__PURE__ */ $("div", { className: "rc-inspect-card-row", children: [
|
|
115
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ f("span", { className: "rc-inspect-card-row-label", children: "frame:" }),
|
|
116
103
|
/* @__PURE__ */ $("span", { className: "rc-inspect-card-row-value", children: [
|
|
117
104
|
Math.round(r.frame.width),
|
|
118
105
|
"×",
|
|
@@ -124,31 +111,31 @@ const un = async (d) => {
|
|
|
124
111
|
] })
|
|
125
112
|
] }),
|
|
126
113
|
K && /* @__PURE__ */ $("div", { className: "rc-inspect-card-actions", children: [
|
|
127
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ f(
|
|
128
115
|
"button",
|
|
129
116
|
{
|
|
130
117
|
type: "button",
|
|
131
118
|
className: "rc-inspect-card-btn rc-inspect-card-btn-primary",
|
|
132
|
-
onClick: () =>
|
|
119
|
+
onClick: () => I(r, h),
|
|
133
120
|
children: "Tap"
|
|
134
121
|
}
|
|
135
122
|
),
|
|
136
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ f(
|
|
137
124
|
"button",
|
|
138
125
|
{
|
|
139
126
|
type: "button",
|
|
140
|
-
className:
|
|
141
|
-
disabled: !
|
|
142
|
-
title:
|
|
143
|
-
onClick: () => q(
|
|
127
|
+
className: T === "selector" ? "rc-inspect-card-btn rc-inspect-card-btn-copied" : "rc-inspect-card-btn",
|
|
128
|
+
disabled: !M,
|
|
129
|
+
title: M ?? "No usable selector for this element",
|
|
130
|
+
onClick: () => q(M ?? void 0, "selector"),
|
|
144
131
|
children: T === "selector" ? "Copied!" : "Copy selector"
|
|
145
132
|
}
|
|
146
133
|
),
|
|
147
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ f(
|
|
148
135
|
"button",
|
|
149
136
|
{
|
|
150
137
|
type: "button",
|
|
151
|
-
className:
|
|
138
|
+
className: T === "id" ? "rc-inspect-card-btn rc-inspect-card-btn-copied" : "rc-inspect-card-btn",
|
|
152
139
|
disabled: !W,
|
|
153
140
|
title: W ?? `No ${B}`,
|
|
154
141
|
onClick: () => q(W, "id"),
|
|
@@ -161,57 +148,57 @@ const un = async (d) => {
|
|
|
161
148
|
),
|
|
162
149
|
document.body
|
|
163
150
|
);
|
|
164
|
-
}),
|
|
151
|
+
}), gn = Ge(function({
|
|
165
152
|
snapshot: r,
|
|
166
|
-
geometry:
|
|
167
|
-
highlightedId:
|
|
168
|
-
selectedId:
|
|
153
|
+
geometry: p,
|
|
154
|
+
highlightedId: h,
|
|
155
|
+
selectedId: k,
|
|
169
156
|
mode: K,
|
|
170
|
-
cursorPosition:
|
|
157
|
+
cursorPosition: I,
|
|
171
158
|
frozenCursorPosition: T,
|
|
172
159
|
onSelectChange: U,
|
|
173
160
|
onTapElement: H
|
|
174
161
|
}) {
|
|
175
|
-
const
|
|
162
|
+
const M = K === "select", W = M ? h !== null && h !== k : h !== null, B = M ? h ?? k : h, q = we(() => {
|
|
176
163
|
const g = /* @__PURE__ */ new Map();
|
|
177
164
|
if (!r) return g;
|
|
178
165
|
for (const Q of r.elements) g.set(Q.id, Q);
|
|
179
166
|
return g;
|
|
180
|
-
}, [r]),
|
|
181
|
-
if (!(!!r && !!
|
|
182
|
-
const ne = W ?
|
|
183
|
-
|
|
167
|
+
}, [r]), S = we(() => B ? q.get(B) ?? null : null, [B, q]);
|
|
168
|
+
if (!(!!r && !!p && r.screen.width > 0 && r.screen.height > 0 && r.elements.length > 0)) return null;
|
|
169
|
+
const ne = W ? I : T ?? I, A = W, F = M && !W && k !== null, X = (g) => {
|
|
170
|
+
M && g.target === g.currentTarget && U(null, null);
|
|
184
171
|
};
|
|
185
|
-
return /* @__PURE__ */ $(
|
|
186
|
-
/* @__PURE__ */
|
|
172
|
+
return /* @__PURE__ */ $(ft, { children: [
|
|
173
|
+
/* @__PURE__ */ f(
|
|
187
174
|
"div",
|
|
188
175
|
{
|
|
189
|
-
className:
|
|
176
|
+
className: M ? "rc-inspect-overlay rc-inspect-overlay-select" : "rc-inspect-overlay",
|
|
190
177
|
style: {
|
|
191
|
-
left: `${
|
|
192
|
-
top: `${
|
|
193
|
-
width: `${
|
|
194
|
-
height: `${
|
|
178
|
+
left: `${p.left}px`,
|
|
179
|
+
top: `${p.top}px`,
|
|
180
|
+
width: `${p.width}px`,
|
|
181
|
+
height: `${p.height}px`
|
|
195
182
|
},
|
|
196
183
|
onClick: X,
|
|
197
|
-
children: r.elements.map((g) => /* @__PURE__ */
|
|
198
|
-
|
|
184
|
+
children: r.elements.map((g) => /* @__PURE__ */ f(
|
|
185
|
+
dn,
|
|
199
186
|
{
|
|
200
187
|
element: g,
|
|
201
188
|
screen: r.screen,
|
|
202
|
-
highlighted: g.id ===
|
|
203
|
-
selected: g.id ===
|
|
204
|
-
selectable:
|
|
189
|
+
highlighted: g.id === h,
|
|
190
|
+
selected: g.id === k,
|
|
191
|
+
selectable: M,
|
|
205
192
|
onClick: U
|
|
206
193
|
},
|
|
207
194
|
g.id
|
|
208
195
|
))
|
|
209
196
|
}
|
|
210
197
|
),
|
|
211
|
-
|
|
212
|
-
|
|
198
|
+
S && ne && /* @__PURE__ */ f(
|
|
199
|
+
mn,
|
|
213
200
|
{
|
|
214
|
-
element:
|
|
201
|
+
element: S,
|
|
215
202
|
platform: r.platform,
|
|
216
203
|
anchor: ne,
|
|
217
204
|
cursorAnchored: A,
|
|
@@ -220,9 +207,9 @@ const un = async (d) => {
|
|
|
220
207
|
}
|
|
221
208
|
)
|
|
222
209
|
] });
|
|
223
|
-
}),
|
|
224
|
-
([
|
|
225
|
-
)?.[0] ?? String(d),
|
|
210
|
+
}), vn = on(() => import("./duo-view-tndcvbIi.mjs").then((d) => d.d)), We = (d) => Object.entries(m).find(
|
|
211
|
+
([p, h]) => p.startsWith("ACTION_") && h === d
|
|
212
|
+
)?.[0] ?? String(d), ut = 1920, ht = 1200, yn = (d, r) => d === ut && r === ht || d === ht && r === ut, wn = {
|
|
226
213
|
ios: {
|
|
227
214
|
videoBorderRadiusMultiplier: 0.15,
|
|
228
215
|
loadingLogoSize: "20%",
|
|
@@ -242,33 +229,33 @@ const un = async (d) => {
|
|
|
242
229
|
}
|
|
243
230
|
}
|
|
244
231
|
};
|
|
245
|
-
function
|
|
246
|
-
const r = d.code,
|
|
247
|
-
if (!
|
|
248
|
-
return
|
|
249
|
-
let
|
|
250
|
-
const
|
|
251
|
-
let T =
|
|
252
|
-
return
|
|
232
|
+
function Tn(d) {
|
|
233
|
+
const r = d.code, p = en[r];
|
|
234
|
+
if (!p)
|
|
235
|
+
return je(`Unknown event.code: ${r}, key: ${d.key}`), null;
|
|
236
|
+
let h = R.META_NONE;
|
|
237
|
+
const k = r >= "KeyA" && r <= "KeyZ", K = d.getModifierState("CapsLock"), I = d.shiftKey;
|
|
238
|
+
let T = I;
|
|
239
|
+
return k && (T = I !== K), T && (h |= R.META_SHIFT_ON), d.ctrlKey && (h |= R.META_CTRL_ON), d.altKey && (h |= R.META_ALT_ON), d.metaKey && (h |= R.META_META_ON), { keycode: p, metaState: h };
|
|
253
240
|
}
|
|
254
|
-
const
|
|
241
|
+
const Rn = rn(
|
|
255
242
|
({
|
|
256
243
|
className: d,
|
|
257
244
|
url: r,
|
|
258
|
-
token:
|
|
259
|
-
sessionId:
|
|
260
|
-
openUrl:
|
|
245
|
+
token: p,
|
|
246
|
+
sessionId: h,
|
|
247
|
+
openUrl: k,
|
|
261
248
|
showFrame: K = !0,
|
|
262
|
-
deviceModel:
|
|
249
|
+
deviceModel: I,
|
|
263
250
|
duoModelUrl: T,
|
|
264
251
|
autoReconnect: U = !1,
|
|
265
252
|
jitterBufferTargetMs: H,
|
|
266
|
-
onPlaybackStats:
|
|
253
|
+
onPlaybackStats: M,
|
|
267
254
|
onTerminated: W,
|
|
268
255
|
assets: B,
|
|
269
256
|
onConnectionStateChange: q,
|
|
270
|
-
inspectMode:
|
|
271
|
-
onAxSnapshotChange:
|
|
257
|
+
inspectMode: S,
|
|
258
|
+
onAxSnapshotChange: Te,
|
|
272
259
|
onInspectSelectionChange: ne,
|
|
273
260
|
onAxStatusChange: A,
|
|
274
261
|
axPollIntervalMs: F,
|
|
@@ -278,61 +265,61 @@ const In = sn(
|
|
|
278
265
|
onCameraStats: oe,
|
|
279
266
|
onTrace: Z,
|
|
280
267
|
microphoneEnabled: J = !1,
|
|
281
|
-
onMicrophoneStateChange:
|
|
282
|
-
},
|
|
283
|
-
const
|
|
268
|
+
onMicrophoneStateChange: de
|
|
269
|
+
}, Ae) => {
|
|
270
|
+
const be = _(null), E = _(null), Me = _(null), [mt, gt] = N(!1), z = I === "iphone-duo" || mt, Oe = _(null), [qe, vt] = N(null), [Qe, yt] = N(), [wt, Tt] = N(!1), [At, bt] = N(!1), [Ct, Nt] = N(!1), [Ze, Je] = N(!1), [Rt, et] = N(!1), [Et, xe] = N({}), $e = _(null), O = _(/* @__PURE__ */ new Map()), re = _(!1), [It, Mt] = N(!1), b = _(null), ue = _(null), Ce = _({
|
|
284
271
|
handle: () => {
|
|
285
272
|
},
|
|
286
273
|
end: () => {
|
|
287
274
|
}
|
|
288
|
-
}), [ie,
|
|
289
|
-
|
|
290
|
-
j.current = void 0,
|
|
275
|
+
}), [ie, _e] = N(null), [tt, Ue] = N(null), [Fe, Ne] = N(null), [ze, Se] = N(null), [Ot, nt] = N(null), [_t, ot] = N(null), Pe = _(null), j = _(void 0), rt = (e) => {
|
|
276
|
+
Pe.current = e, j.current === void 0 && (j.current = window.requestAnimationFrame(() => {
|
|
277
|
+
j.current = void 0, ot(Pe.current);
|
|
291
278
|
}));
|
|
292
|
-
}, [
|
|
293
|
-
ce.current =
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
() =>
|
|
298
|
-
[
|
|
299
|
-
), pe =
|
|
300
|
-
const o =
|
|
279
|
+
}, [St, he] = N(null), ce = _(null);
|
|
280
|
+
ce.current = tt;
|
|
281
|
+
const fe = _(ne);
|
|
282
|
+
fe.current = ne;
|
|
283
|
+
const Re = S === !0 || S === "hover-only", Pt = S === "hover-only" ? "hover-only" : "select", ee = we(() => Gt(r), [r]), kt = we(
|
|
284
|
+
() => h || Array.from(crypto.getRandomValues(new Uint32Array(4)), (e) => e.toString(36)).join(""),
|
|
285
|
+
[h]
|
|
286
|
+
), pe = wn[ee], Ee = B?.[ee], it = ee === "android" && Rt ? Ze ? Ee?.tabletFrameLandscape : Ee?.tabletFrame : Ze ? Ee?.frameLandscape : Ee?.frame, ct = Ee?.loadingLogo, ke = !z && K && !!it, v = _(null), V = (e) => v.current?.sendControl(e), Ke = (e, n) => v.current?.sendDuoControl(e, n) ?? Promise.reject(new Error("Simulator disconnected")), st = -10, at = (e, n) => {
|
|
287
|
+
const o = Ie();
|
|
301
288
|
if (!o) return;
|
|
302
|
-
const t =
|
|
289
|
+
const t = ge(o, e, n);
|
|
303
290
|
if (!t) return;
|
|
304
|
-
const { videoX: c, videoY: s, videoWidth: i, videoHeight: a } = t, l =
|
|
305
|
-
|
|
306
|
-
|
|
291
|
+
const { videoX: c, videoY: s, videoWidth: i, videoHeight: a } = t, l = He(
|
|
292
|
+
m.ACTION_DOWN,
|
|
293
|
+
st,
|
|
307
294
|
i,
|
|
308
295
|
a,
|
|
309
296
|
c,
|
|
310
297
|
s,
|
|
311
298
|
1,
|
|
312
|
-
|
|
313
|
-
|
|
299
|
+
m.BUTTON_PRIMARY,
|
|
300
|
+
m.BUTTON_PRIMARY
|
|
314
301
|
);
|
|
315
302
|
l && V(l), window.setTimeout(() => {
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
303
|
+
const u = He(
|
|
304
|
+
m.ACTION_UP,
|
|
305
|
+
st,
|
|
319
306
|
i,
|
|
320
307
|
a,
|
|
321
308
|
c,
|
|
322
309
|
s,
|
|
323
310
|
0,
|
|
324
|
-
|
|
325
|
-
|
|
311
|
+
m.BUTTON_PRIMARY,
|
|
312
|
+
m.BUTTON_PRIMARY
|
|
326
313
|
);
|
|
327
|
-
|
|
314
|
+
u && V(u);
|
|
328
315
|
}, 60);
|
|
329
|
-
},
|
|
330
|
-
const o =
|
|
316
|
+
}, Yt = (e, n) => {
|
|
317
|
+
const o = Ie();
|
|
331
318
|
if (!o || n.screen.width <= 0 || n.screen.height <= 0) return;
|
|
332
319
|
const t = e.frame.x + e.frame.width / 2, c = e.frame.y + e.frame.height / 2, s = t / n.screen.width * o.actualWidth, i = c / n.screen.height * o.actualHeight, a = o.videoRect.left + o.offsetX + s, l = o.videoRect.top + o.offsetY + i;
|
|
333
|
-
|
|
334
|
-
},
|
|
335
|
-
const i =
|
|
320
|
+
at(a, l);
|
|
321
|
+
}, Ye = -1, Xe = -2, se = -3, me = (e, n, o, t, c, s) => {
|
|
322
|
+
const i = He(
|
|
336
323
|
e,
|
|
337
324
|
n,
|
|
338
325
|
o,
|
|
@@ -341,12 +328,12 @@ const In = sn(
|
|
|
341
328
|
s,
|
|
342
329
|
1,
|
|
343
330
|
// pressure
|
|
344
|
-
|
|
345
|
-
|
|
331
|
+
m.BUTTON_PRIMARY,
|
|
332
|
+
m.BUTTON_PRIMARY
|
|
346
333
|
);
|
|
347
334
|
i && (Y("[rc-touch] sendSingleTouch", {
|
|
348
335
|
action: e,
|
|
349
|
-
actionName:
|
|
336
|
+
actionName: We(e),
|
|
350
337
|
pointerId: n,
|
|
351
338
|
x: c,
|
|
352
339
|
y: s,
|
|
@@ -355,18 +342,18 @@ const In = sn(
|
|
|
355
342
|
}, ae = (e, n, o) => {
|
|
356
343
|
if (!o) return;
|
|
357
344
|
const { videoX: t, videoY: c, videoWidth: s, videoHeight: i } = o;
|
|
358
|
-
let a = null, l = null,
|
|
359
|
-
const
|
|
345
|
+
let a = null, l = null, u = 1;
|
|
346
|
+
const C = m.BUTTON_PRIMARY;
|
|
360
347
|
switch (n) {
|
|
361
348
|
case "down":
|
|
362
|
-
e !== se &&
|
|
349
|
+
e !== se && Ce.current.end(), a = O.current.size === 0 ? m.ACTION_DOWN : m.ACTION_POINTER_DOWN, l = { x: t, y: c }, O.current.set(e, l), e === -1 && E.current?.focus();
|
|
363
350
|
break;
|
|
364
351
|
case "move":
|
|
365
|
-
|
|
352
|
+
O.current.has(e) && (a = m.ACTION_MOVE, l = { x: t, y: c }, O.current.set(e, l));
|
|
366
353
|
break;
|
|
367
354
|
case "up":
|
|
368
355
|
case "cancel":
|
|
369
|
-
|
|
356
|
+
O.current.has(e) && (l = O.current.get(e), O.current.delete(e), n === "cancel" ? a = m.ACTION_CANCEL : a = O.current.size === 0 ? m.ACTION_UP : m.ACTION_POINTER_UP);
|
|
370
357
|
break;
|
|
371
358
|
}
|
|
372
359
|
if (a !== null && l !== null) {
|
|
@@ -374,69 +361,69 @@ const In = sn(
|
|
|
374
361
|
pointerId: e,
|
|
375
362
|
eventType: n,
|
|
376
363
|
action: a,
|
|
377
|
-
actionName:
|
|
364
|
+
actionName: We(a),
|
|
378
365
|
positionToSend: l,
|
|
379
366
|
video: { width: s, height: i },
|
|
380
367
|
altHeld: re.current,
|
|
381
|
-
activePointersAfter: Array.from(
|
|
382
|
-
id:
|
|
368
|
+
activePointersAfter: Array.from(O.current.entries()).map(([P, w]) => ({
|
|
369
|
+
id: P,
|
|
383
370
|
x: w.x,
|
|
384
371
|
y: w.y
|
|
385
372
|
}))
|
|
386
373
|
});
|
|
387
|
-
const y =
|
|
374
|
+
const y = He(
|
|
388
375
|
a,
|
|
389
376
|
e,
|
|
390
377
|
s,
|
|
391
378
|
i,
|
|
392
379
|
l.x,
|
|
393
380
|
l.y,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
381
|
+
u,
|
|
382
|
+
C,
|
|
383
|
+
C
|
|
397
384
|
);
|
|
398
385
|
y && (Y("[rc-touch][mouse->touch] buffer", {
|
|
399
386
|
pointerId: e,
|
|
400
|
-
actionName:
|
|
387
|
+
actionName: We(a),
|
|
401
388
|
byteLength: y.byteLength
|
|
402
389
|
}), V(y));
|
|
403
|
-
} else (n === "up" || n === "cancel") &&
|
|
404
|
-
},
|
|
405
|
-
if (re.current !== e && (re.current = e,
|
|
390
|
+
} else (n === "up" || n === "cancel") && O.current.delete(e);
|
|
391
|
+
}, Ve = (e) => {
|
|
392
|
+
if (re.current !== e && (re.current = e, Mt(e), e || _e(null), Y("[rc-touch][alt] updateAltHeld", {
|
|
406
393
|
nextHeld: e,
|
|
407
|
-
activePointerIds: Array.from(
|
|
394
|
+
activePointerIds: Array.from(O.current.keys())
|
|
408
395
|
}), ee === "ios" && v.current?.getState().controlReady)) {
|
|
409
|
-
const n = e ?
|
|
396
|
+
const n = e ? R.ACTION_DOWN : R.ACTION_UP, o = Le(
|
|
410
397
|
n,
|
|
411
|
-
|
|
398
|
+
R.KEYCODE_ALT_LEFT,
|
|
412
399
|
0,
|
|
413
|
-
|
|
400
|
+
R.META_NONE
|
|
414
401
|
);
|
|
415
402
|
Y("[rc-touch][alt] sending Indigo modifier keycode", {
|
|
416
403
|
action: n,
|
|
417
|
-
keycode:
|
|
404
|
+
keycode: R.KEYCODE_ALT_LEFT
|
|
418
405
|
}), o && V(o);
|
|
419
406
|
}
|
|
420
|
-
},
|
|
421
|
-
const e =
|
|
407
|
+
}, Ie = () => {
|
|
408
|
+
const e = E.current, n = be.current;
|
|
422
409
|
if (!e || !n) return null;
|
|
423
410
|
const o = e.videoWidth, t = e.videoHeight;
|
|
424
411
|
if (!o || !t) return null;
|
|
425
|
-
const c = e.getBoundingClientRect(), s = n.getBoundingClientRect(), i = c.width, a = c.height, l = o / t,
|
|
426
|
-
let
|
|
427
|
-
l >
|
|
428
|
-
const
|
|
412
|
+
const c = e.getBoundingClientRect(), s = n.getBoundingClientRect(), i = c.width, a = c.height, l = o / t, u = i / a;
|
|
413
|
+
let C = i, y = a;
|
|
414
|
+
l > u ? y = i / l : C = a * l;
|
|
415
|
+
const P = (i - C) / 2, w = (a - y) / 2;
|
|
429
416
|
return {
|
|
430
417
|
videoWidth: o,
|
|
431
418
|
videoHeight: t,
|
|
432
419
|
videoRect: c,
|
|
433
420
|
containerRect: s,
|
|
434
|
-
actualWidth:
|
|
421
|
+
actualWidth: C,
|
|
435
422
|
actualHeight: y,
|
|
436
|
-
offsetX:
|
|
423
|
+
offsetX: P,
|
|
437
424
|
offsetY: w
|
|
438
425
|
};
|
|
439
|
-
},
|
|
426
|
+
}, ge = (e, n, o) => {
|
|
440
427
|
const t = n - e.videoRect.left - e.offsetX, c = o - e.videoRect.top - e.offsetY, s = Math.max(0, Math.min(e.actualWidth, t)), i = Math.max(0, Math.min(e.actualHeight, c)), a = Math.max(
|
|
441
428
|
0,
|
|
442
429
|
Math.min(e.videoWidth, s / e.actualWidth * e.videoWidth)
|
|
@@ -450,14 +437,14 @@ const In = sn(
|
|
|
450
437
|
videoWidth: e.videoWidth,
|
|
451
438
|
videoHeight: e.videoHeight
|
|
452
439
|
};
|
|
453
|
-
},
|
|
440
|
+
}, Xt = (e, n, o) => {
|
|
454
441
|
const t = n - e.videoRect.left - e.offsetX, c = o - e.videoRect.top - e.offsetY, s = Math.max(0, Math.min(e.actualWidth, t)), i = Math.max(0, Math.min(e.actualHeight, c)), a = Math.max(
|
|
455
442
|
0,
|
|
456
443
|
Math.min(e.videoWidth, s / e.actualWidth * e.videoWidth)
|
|
457
444
|
), l = Math.max(
|
|
458
445
|
0,
|
|
459
446
|
Math.min(e.videoHeight, i / e.actualHeight * e.videoHeight)
|
|
460
|
-
),
|
|
447
|
+
), u = e.videoWidth - a, C = e.videoHeight - l, y = e.videoRect.left + e.offsetX, P = e.videoRect.top + e.offsetY, w = y - e.containerRect.left + s, G = P - e.containerRect.top + i, le = y - e.containerRect.left + (e.actualWidth - s), L = P - e.containerRect.top + (e.actualHeight - i);
|
|
461
448
|
return {
|
|
462
449
|
containerX: w,
|
|
463
450
|
containerY: G,
|
|
@@ -465,58 +452,58 @@ const In = sn(
|
|
|
465
452
|
mirrorContainerY: L,
|
|
466
453
|
videoX: a,
|
|
467
454
|
videoY: l,
|
|
468
|
-
mirrorVideoX:
|
|
469
|
-
mirrorVideoY:
|
|
455
|
+
mirrorVideoX: u,
|
|
456
|
+
mirrorVideoY: C,
|
|
470
457
|
videoWidth: e.videoWidth,
|
|
471
458
|
videoHeight: e.videoHeight
|
|
472
459
|
};
|
|
473
|
-
},
|
|
474
|
-
const a =
|
|
460
|
+
}, Dt = (e, n, o, t, c, s, i) => {
|
|
461
|
+
const a = tn(e, n, o, t, c, s, i);
|
|
475
462
|
Y("[rc-touch2] sendTwoFingerMessage (iOS)", {
|
|
476
|
-
actionName:
|
|
463
|
+
actionName: We(e),
|
|
477
464
|
video: { width: n, height: o },
|
|
478
465
|
p0: { x: t, y: c },
|
|
479
466
|
p1: { x: s, y: i },
|
|
480
467
|
byteLength: a.byteLength
|
|
481
468
|
}), V(a);
|
|
482
|
-
},
|
|
469
|
+
}, ve = (e, n, o, t, c, s, i, a, l) => {
|
|
483
470
|
if (Y("[rc-touch2] applyTwoFingerEvent", {
|
|
484
471
|
platform: ee,
|
|
485
472
|
eventType: e,
|
|
486
473
|
video: { width: n, height: o },
|
|
487
474
|
p0: { x: t, y: c, id: a },
|
|
488
475
|
p1: { x: s, y: i, id: l }
|
|
489
|
-
}), e === "down" &&
|
|
490
|
-
const
|
|
491
|
-
|
|
476
|
+
}), e === "down" && Ce.current.end(), ee === "ios") {
|
|
477
|
+
const u = e === "down" ? m.ACTION_DOWN : e === "move" ? m.ACTION_MOVE : m.ACTION_UP;
|
|
478
|
+
Dt(u, n, o, t, c, s, i);
|
|
492
479
|
} else
|
|
493
|
-
e === "down" ? (
|
|
494
|
-
},
|
|
480
|
+
e === "down" ? (me(m.ACTION_DOWN, a, n, o, t, c), me(m.ACTION_POINTER_DOWN, l, n, o, s, i)) : e === "move" ? (me(m.ACTION_MOVE, a, n, o, t, c), me(m.ACTION_MOVE, l, n, o, s, i)) : (me(m.ACTION_POINTER_UP, l, n, o, s, i), me(m.ACTION_UP, a, n, o, t, c));
|
|
481
|
+
}, Lt = (e, n, o) => {
|
|
495
482
|
if (!re.current) {
|
|
496
|
-
ie !== null &&
|
|
483
|
+
ie !== null && _e(null);
|
|
497
484
|
return;
|
|
498
485
|
}
|
|
499
|
-
const t =
|
|
500
|
-
|
|
501
|
-
},
|
|
486
|
+
const t = Xt(e, n, o);
|
|
487
|
+
_e(t);
|
|
488
|
+
}, Ht = (e, n, o) => {
|
|
502
489
|
const t = ce.current;
|
|
503
490
|
if (!t || t.screen.width <= 0 || t.screen.height <= 0) return null;
|
|
504
491
|
const c = n - e.videoRect.left - e.offsetX, s = o - e.videoRect.top - e.offsetY;
|
|
505
492
|
if (c < 0 || s < 0 || c > e.actualWidth || s > e.actualHeight) return null;
|
|
506
493
|
const i = c / e.actualWidth * t.screen.width, a = s / e.actualHeight * t.screen.height;
|
|
507
|
-
return
|
|
494
|
+
return Jt(t, i, a);
|
|
508
495
|
}, te = (e) => {
|
|
509
496
|
if (z) return;
|
|
510
497
|
e.preventDefault(), e.stopPropagation();
|
|
511
|
-
const n =
|
|
512
|
-
if ((
|
|
498
|
+
const n = Ie();
|
|
499
|
+
if ((S === !0 || S === "hover-only") && !("touches" in e))
|
|
513
500
|
if (e.type === "mousemove") {
|
|
514
|
-
if (
|
|
515
|
-
const t =
|
|
516
|
-
|
|
501
|
+
if (rt({ x: e.clientX, y: e.clientY }), n) {
|
|
502
|
+
const t = Ht(n, e.clientX, e.clientY);
|
|
503
|
+
Ne(t?.id ?? null);
|
|
517
504
|
}
|
|
518
|
-
} else e.type === "mouseleave" && (
|
|
519
|
-
if (
|
|
505
|
+
} else e.type === "mouseleave" && (rt(null), Ne(null));
|
|
506
|
+
if (S !== !0 && (!("touches" in e) && n && (e.type === "mousemove" ? Lt(n, e.clientX, e.clientY) : e.type === "mouseleave" && _e(null)), !(!v.current?.getState().controlReady || !E.current || !n)))
|
|
520
507
|
if ("touches" in e) {
|
|
521
508
|
const t = e.touches, c = e.changedTouches;
|
|
522
509
|
let s;
|
|
@@ -537,39 +524,39 @@ const In = sn(
|
|
|
537
524
|
return;
|
|
538
525
|
}
|
|
539
526
|
if (t.length === 2) {
|
|
540
|
-
const i = t[0], a = t[1], l =
|
|
541
|
-
if (!l || !
|
|
542
|
-
|
|
527
|
+
const i = t[0], a = t[1], l = ge(n, i.clientX, i.clientY), u = ge(n, a.clientX, a.clientY);
|
|
528
|
+
if (!l || !u) return;
|
|
529
|
+
b.current ? b.current.source === "real-touch" && (b.current.finger0 = { x: l.videoX, y: l.videoY }, b.current.finger1 = { x: u.videoX, y: u.videoY }, ve(
|
|
543
530
|
"move",
|
|
544
531
|
l.videoWidth,
|
|
545
532
|
l.videoHeight,
|
|
546
533
|
l.videoX,
|
|
547
534
|
l.videoY,
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
)) : (
|
|
535
|
+
u.videoX,
|
|
536
|
+
u.videoY,
|
|
537
|
+
b.current.pointerId0,
|
|
538
|
+
b.current.pointerId1
|
|
539
|
+
)) : (b.current = {
|
|
553
540
|
finger0: { x: l.videoX, y: l.videoY },
|
|
554
|
-
finger1: { x:
|
|
541
|
+
finger1: { x: u.videoX, y: u.videoY },
|
|
555
542
|
videoSize: { width: l.videoWidth, height: l.videoHeight },
|
|
556
543
|
source: "real-touch",
|
|
557
544
|
pointerId0: i.identifier,
|
|
558
545
|
pointerId1: a.identifier
|
|
559
|
-
},
|
|
546
|
+
}, ve(
|
|
560
547
|
"down",
|
|
561
548
|
l.videoWidth,
|
|
562
549
|
l.videoHeight,
|
|
563
550
|
l.videoX,
|
|
564
551
|
l.videoY,
|
|
565
|
-
|
|
566
|
-
|
|
552
|
+
u.videoX,
|
|
553
|
+
u.videoY,
|
|
567
554
|
i.identifier,
|
|
568
555
|
a.identifier
|
|
569
556
|
));
|
|
570
|
-
} else if (t.length < 2 &&
|
|
571
|
-
const i =
|
|
572
|
-
|
|
557
|
+
} else if (t.length < 2 && b.current?.source === "real-touch") {
|
|
558
|
+
const i = b.current;
|
|
559
|
+
ve(
|
|
573
560
|
"up",
|
|
574
561
|
i.videoSize.width,
|
|
575
562
|
i.videoSize.height,
|
|
@@ -579,7 +566,7 @@ const In = sn(
|
|
|
579
566
|
i.finger1.y,
|
|
580
567
|
i.pointerId0,
|
|
581
568
|
i.pointerId1
|
|
582
|
-
),
|
|
569
|
+
), b.current = null;
|
|
583
570
|
return;
|
|
584
571
|
} else {
|
|
585
572
|
if (t.length > 2)
|
|
@@ -587,30 +574,30 @@ const In = sn(
|
|
|
587
574
|
{
|
|
588
575
|
const i = c[0];
|
|
589
576
|
if (i) {
|
|
590
|
-
const a =
|
|
577
|
+
const a = ge(n, i.clientX, i.clientY);
|
|
591
578
|
ae(i.identifier, s, a);
|
|
592
579
|
}
|
|
593
580
|
}
|
|
594
581
|
}
|
|
595
582
|
} else {
|
|
596
583
|
let c = null;
|
|
597
|
-
const s =
|
|
584
|
+
const s = b.current?.source === "alt-mouse";
|
|
598
585
|
switch (e.type) {
|
|
599
586
|
case "mousedown":
|
|
600
587
|
e.button === 0 && (c = "down");
|
|
601
588
|
break;
|
|
602
589
|
case "mousemove":
|
|
603
|
-
(s ||
|
|
590
|
+
(s || O.current.has(-1)) && (c = "move");
|
|
604
591
|
break;
|
|
605
592
|
case "mouseup":
|
|
606
593
|
e.button === 0 && (c = "up");
|
|
607
594
|
break;
|
|
608
595
|
case "mouseleave":
|
|
609
|
-
(s ||
|
|
596
|
+
(s || O.current.has(-1)) && (c = "up");
|
|
610
597
|
break;
|
|
611
598
|
}
|
|
612
599
|
if (c) {
|
|
613
|
-
const i =
|
|
600
|
+
const i = ge(n, e.clientX, e.clientY);
|
|
614
601
|
if (!i)
|
|
615
602
|
return;
|
|
616
603
|
Y("[rc-touch][mouse] event", {
|
|
@@ -627,21 +614,21 @@ const In = sn(
|
|
|
627
614
|
videoWidth: i.videoWidth,
|
|
628
615
|
videoHeight: i.videoHeight
|
|
629
616
|
},
|
|
630
|
-
activePointerIds: Array.from(
|
|
631
|
-
}), re.current || s ?
|
|
617
|
+
activePointerIds: Array.from(O.current.keys())
|
|
618
|
+
}), re.current || s ? Wt(c, i) : ae(-1, c, i);
|
|
632
619
|
}
|
|
633
620
|
}
|
|
634
|
-
},
|
|
621
|
+
}, Wt = (e, n) => {
|
|
635
622
|
const { videoX: o, videoY: t, videoWidth: c, videoHeight: s } = n, i = c - o, a = s - t;
|
|
636
623
|
if (e === "down") {
|
|
637
|
-
|
|
624
|
+
b.current = {
|
|
638
625
|
finger0: { x: o, y: t },
|
|
639
626
|
finger1: { x: i, y: a },
|
|
640
627
|
videoSize: { width: c, height: s },
|
|
641
628
|
source: "alt-mouse",
|
|
642
|
-
pointerId0:
|
|
643
|
-
pointerId1:
|
|
644
|
-
},
|
|
629
|
+
pointerId0: Ye,
|
|
630
|
+
pointerId1: Xe
|
|
631
|
+
}, E.current?.focus(), ve(
|
|
645
632
|
"down",
|
|
646
633
|
c,
|
|
647
634
|
s,
|
|
@@ -649,13 +636,13 @@ const In = sn(
|
|
|
649
636
|
t,
|
|
650
637
|
i,
|
|
651
638
|
a,
|
|
652
|
-
|
|
653
|
-
|
|
639
|
+
Ye,
|
|
640
|
+
Xe
|
|
654
641
|
);
|
|
655
642
|
return;
|
|
656
643
|
}
|
|
657
644
|
if (e === "move") {
|
|
658
|
-
|
|
645
|
+
b.current?.source === "alt-mouse" && (b.current.finger0 = { x: o, y: t }, b.current.finger1 = { x: i, y: a }, ve(
|
|
659
646
|
"move",
|
|
660
647
|
c,
|
|
661
648
|
s,
|
|
@@ -663,95 +650,95 @@ const In = sn(
|
|
|
663
650
|
t,
|
|
664
651
|
i,
|
|
665
652
|
a,
|
|
666
|
-
|
|
667
|
-
|
|
653
|
+
Ye,
|
|
654
|
+
Xe
|
|
668
655
|
));
|
|
669
656
|
return;
|
|
670
657
|
}
|
|
671
658
|
if (e === "up" || e === "cancel") {
|
|
672
|
-
const l =
|
|
659
|
+
const l = b.current;
|
|
673
660
|
if (l?.source === "alt-mouse") {
|
|
674
|
-
const { finger0:
|
|
675
|
-
|
|
661
|
+
const { finger0: u, finger1: C, videoSize: y } = l;
|
|
662
|
+
ve(
|
|
676
663
|
"up",
|
|
677
664
|
y.width,
|
|
678
665
|
y.height,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
),
|
|
666
|
+
u.x,
|
|
667
|
+
u.y,
|
|
668
|
+
C.x,
|
|
669
|
+
C.y,
|
|
670
|
+
Ye,
|
|
671
|
+
Xe
|
|
672
|
+
), b.current = null;
|
|
686
673
|
}
|
|
687
674
|
return;
|
|
688
675
|
}
|
|
689
|
-
},
|
|
690
|
-
const e =
|
|
691
|
-
e && (window.clearTimeout(e.endTimer), ae(se, "up", e.pos),
|
|
692
|
-
},
|
|
693
|
-
if (e.ctrlKey || re.current ||
|
|
694
|
-
const n =
|
|
695
|
-
if (n > 1 || n === 1 && !
|
|
696
|
-
const o =
|
|
676
|
+
}, xt = 150, lt = () => {
|
|
677
|
+
const e = ue.current;
|
|
678
|
+
e && (window.clearTimeout(e.endTimer), ae(se, "up", e.pos), ue.current = null);
|
|
679
|
+
}, $t = (e) => {
|
|
680
|
+
if (e.ctrlKey || re.current || b.current) return;
|
|
681
|
+
const n = O.current.size;
|
|
682
|
+
if (n > 1 || n === 1 && !O.current.has(se)) return;
|
|
683
|
+
const o = Ie();
|
|
697
684
|
if (!o) return;
|
|
698
685
|
const t = e.clientX - o.videoRect.left - o.offsetX, c = e.clientY - o.videoRect.top - o.offsetY;
|
|
699
686
|
if (t < 0 || t > o.actualWidth || c < 0 || c > o.actualHeight)
|
|
700
687
|
return;
|
|
701
|
-
const s =
|
|
688
|
+
const s = ge(o, e.clientX, e.clientY);
|
|
702
689
|
if (!s) return;
|
|
703
690
|
e.preventDefault();
|
|
704
|
-
const i = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualWidth : 1) * (o.videoWidth / o.actualWidth), a = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualHeight : 1) * (o.videoHeight / o.actualHeight), l = -e.deltaX * i,
|
|
705
|
-
window.clearTimeout(L.endTimer), L.endTimer = window.setTimeout(
|
|
691
|
+
const i = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualWidth : 1) * (o.videoWidth / o.actualWidth), a = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? o.actualHeight : 1) * (o.videoHeight / o.actualHeight), l = -e.deltaX * i, u = -e.deltaY * a, C = (L) => {
|
|
692
|
+
window.clearTimeout(L.endTimer), L.endTimer = window.setTimeout(lt, xt);
|
|
706
693
|
};
|
|
707
|
-
if (l === 0 &&
|
|
708
|
-
|
|
694
|
+
if (l === 0 && u === 0) {
|
|
695
|
+
ue.current && C(ue.current);
|
|
709
696
|
return;
|
|
710
697
|
}
|
|
711
698
|
const y = () => ({
|
|
712
699
|
videoWidth: s.videoWidth,
|
|
713
700
|
videoHeight: s.videoHeight,
|
|
714
|
-
videoX: Math.abs(l) > Math.abs(
|
|
715
|
-
videoY: Math.abs(
|
|
716
|
-
}),
|
|
701
|
+
videoX: Math.abs(l) > Math.abs(u) ? Math.min(Math.max(s.videoX, s.videoWidth * 0.2), s.videoWidth * 0.8) : s.videoX,
|
|
702
|
+
videoY: Math.abs(u) >= Math.abs(l) ? Math.min(Math.max(s.videoY, s.videoHeight * 0.2), s.videoHeight * 0.8) : s.videoY
|
|
703
|
+
}), P = (L) => ({
|
|
717
704
|
...L,
|
|
718
705
|
videoX: Math.min(Math.max(L.videoX + l, 0), L.videoWidth),
|
|
719
|
-
videoY: Math.min(Math.max(L.videoY +
|
|
706
|
+
videoY: Math.min(Math.max(L.videoY + u, 0), L.videoHeight)
|
|
720
707
|
});
|
|
721
|
-
let w =
|
|
708
|
+
let w = ue.current;
|
|
722
709
|
if (w)
|
|
723
710
|
window.clearTimeout(w.endTimer);
|
|
724
711
|
else {
|
|
725
712
|
const L = y();
|
|
726
|
-
ae(se, "down", L), w = { pos: L, endTimer: 0 },
|
|
713
|
+
ae(se, "down", L), w = { pos: L, endTimer: 0 }, ue.current = w;
|
|
727
714
|
}
|
|
728
|
-
let G = w.pos, le =
|
|
729
|
-
le.videoX === G.videoX && le.videoY === G.videoY && (ae(se, "up", G), G = y(), ae(se, "down", G), le =
|
|
715
|
+
let G = w.pos, le = P(G);
|
|
716
|
+
le.videoX === G.videoX && le.videoY === G.videoY && (ae(se, "up", G), G = y(), ae(se, "down", G), le = P(G)), ae(se, "move", le), w.pos = le, C(w);
|
|
730
717
|
};
|
|
731
718
|
x(() => {
|
|
732
|
-
|
|
719
|
+
Ce.current = { handle: $t, end: lt };
|
|
733
720
|
}), x(() => {
|
|
734
|
-
const e =
|
|
721
|
+
const e = be.current;
|
|
735
722
|
if (!e) return;
|
|
736
|
-
const n = (o) =>
|
|
723
|
+
const n = (o) => Ce.current.handle(o);
|
|
737
724
|
return e.addEventListener("wheel", n, { passive: !1 }), () => {
|
|
738
|
-
|
|
725
|
+
Ce.current.end(), e.removeEventListener("wheel", n);
|
|
739
726
|
};
|
|
740
727
|
}, []), x(() => {
|
|
741
728
|
const e = (t) => {
|
|
742
|
-
t.key === "Alt" &&
|
|
729
|
+
t.key === "Alt" && Ve(!0);
|
|
743
730
|
}, n = (t) => {
|
|
744
|
-
t.key === "Alt" &&
|
|
731
|
+
t.key === "Alt" && Ve(!1);
|
|
745
732
|
}, o = () => {
|
|
746
|
-
|
|
733
|
+
Ve(!1);
|
|
747
734
|
};
|
|
748
735
|
return window.addEventListener("keydown", e, !0), window.addEventListener("keyup", n, !0), window.addEventListener("blur", o), () => {
|
|
749
736
|
window.removeEventListener("keydown", e, !0), window.removeEventListener("keyup", n, !0), window.removeEventListener("blur", o);
|
|
750
737
|
};
|
|
751
738
|
}, []);
|
|
752
|
-
const
|
|
739
|
+
const De = (e) => {
|
|
753
740
|
e.preventDefault(), e.stopPropagation();
|
|
754
|
-
const n = document.activeElement ===
|
|
741
|
+
const n = document.activeElement === E.current || z && document.activeElement === e.currentTarget;
|
|
755
742
|
if (Y("Keyboard event:", {
|
|
756
743
|
type: e.type,
|
|
757
744
|
key: e.key,
|
|
@@ -760,11 +747,11 @@ const In = sn(
|
|
|
760
747
|
target: e.target.tagName,
|
|
761
748
|
focused: n
|
|
762
749
|
}), !n) {
|
|
763
|
-
|
|
750
|
+
je("Simulator input not focused, skipping keyboard event");
|
|
764
751
|
return;
|
|
765
752
|
}
|
|
766
753
|
if (!v.current?.getState().controlReady) {
|
|
767
|
-
|
|
754
|
+
je("Data channel not ready for keyboard event:", v.current?.getState().connection);
|
|
768
755
|
return;
|
|
769
756
|
}
|
|
770
757
|
if (e.type === "keydown") {
|
|
@@ -775,7 +762,7 @@ const In = sn(
|
|
|
775
762
|
"Pasting text via SET_CLIPBOARD:",
|
|
776
763
|
t.substring(0, 20) + (t.length > 20 ? "..." : "")
|
|
777
764
|
);
|
|
778
|
-
const c =
|
|
765
|
+
const c = Zt(t, !0);
|
|
779
766
|
V(c);
|
|
780
767
|
}
|
|
781
768
|
}).catch((t) => {
|
|
@@ -785,29 +772,29 @@ const In = sn(
|
|
|
785
772
|
}
|
|
786
773
|
if (e.key.toLowerCase() === "m" && (e.metaKey || e.ctrlKey)) {
|
|
787
774
|
Y("Menu shortcut detected");
|
|
788
|
-
const t =
|
|
789
|
-
|
|
790
|
-
|
|
775
|
+
const t = Le(
|
|
776
|
+
R.ACTION_DOWN,
|
|
777
|
+
R.MENU,
|
|
791
778
|
0,
|
|
792
|
-
|
|
779
|
+
R.META_NONE
|
|
793
780
|
// Modifiers are handled by the shortcut check, not passed down
|
|
794
781
|
);
|
|
795
782
|
V(t);
|
|
796
|
-
const c =
|
|
797
|
-
|
|
798
|
-
|
|
783
|
+
const c = Le(
|
|
784
|
+
R.ACTION_UP,
|
|
785
|
+
R.MENU,
|
|
799
786
|
0,
|
|
800
|
-
|
|
787
|
+
R.META_NONE
|
|
801
788
|
);
|
|
802
789
|
V(c);
|
|
803
790
|
return;
|
|
804
791
|
}
|
|
805
792
|
}
|
|
806
|
-
const o =
|
|
793
|
+
const o = Tn(e);
|
|
807
794
|
if (o) {
|
|
808
|
-
const { keycode: t, metaState: c } = o, s = e.type === "keydown" ?
|
|
795
|
+
const { keycode: t, metaState: c } = o, s = e.type === "keydown" ? R.ACTION_DOWN : R.ACTION_UP;
|
|
809
796
|
Y(`Sending Keycode: key=${e.key}, code=${t}, action=${s}, meta=${c}`);
|
|
810
|
-
const i =
|
|
797
|
+
const i = Le(
|
|
811
798
|
s,
|
|
812
799
|
t,
|
|
813
800
|
0,
|
|
@@ -817,101 +804,101 @@ const In = sn(
|
|
|
817
804
|
V(i);
|
|
818
805
|
} else
|
|
819
806
|
Y(`Ignoring unhandled key event: type=${e.type}, key=${e.key}`);
|
|
820
|
-
},
|
|
807
|
+
}, Ut = (e) => {
|
|
821
808
|
e.stopPropagation(), v.current?.reconnect();
|
|
822
|
-
}, D =
|
|
823
|
-
onAxSnapshotChange:
|
|
809
|
+
}, D = _({
|
|
810
|
+
onAxSnapshotChange: Te,
|
|
824
811
|
onAxStatusChange: A,
|
|
825
812
|
onCameraDemandChange: Q,
|
|
826
813
|
onCameraStats: oe,
|
|
827
|
-
onMicrophoneStateChange:
|
|
814
|
+
onMicrophoneStateChange: de,
|
|
828
815
|
onTrace: Z,
|
|
829
816
|
onTerminated: W,
|
|
830
817
|
onConnectionStateChange: q,
|
|
831
|
-
onPlaybackStats:
|
|
818
|
+
onPlaybackStats: M
|
|
832
819
|
});
|
|
833
820
|
D.current = {
|
|
834
|
-
onAxSnapshotChange:
|
|
821
|
+
onAxSnapshotChange: Te,
|
|
835
822
|
onAxStatusChange: A,
|
|
836
823
|
onCameraDemandChange: Q,
|
|
837
824
|
onCameraStats: oe,
|
|
838
|
-
onMicrophoneStateChange:
|
|
825
|
+
onMicrophoneStateChange: de,
|
|
839
826
|
onTrace: Z,
|
|
840
827
|
onTerminated: W,
|
|
841
828
|
onConnectionStateChange: q,
|
|
842
|
-
onPlaybackStats:
|
|
829
|
+
onPlaybackStats: M
|
|
843
830
|
};
|
|
844
|
-
const
|
|
831
|
+
const Be = !!Z;
|
|
845
832
|
x(() => {
|
|
846
|
-
|
|
847
|
-
}, [r,
|
|
833
|
+
$e.current = null, Je(!1), et(!1), xe({});
|
|
834
|
+
}, [r, I]), x(() => {
|
|
848
835
|
let e = !0;
|
|
849
|
-
ce.current !== null && (ce.current = null,
|
|
850
|
-
const n =
|
|
836
|
+
ce.current !== null && (ce.current = null, Ue(null), ye("onAxSnapshotChange", D.current.onAxSnapshotChange, null));
|
|
837
|
+
const n = qt({
|
|
851
838
|
url: r,
|
|
852
|
-
token:
|
|
853
|
-
sessionId:
|
|
854
|
-
deviceModel:
|
|
839
|
+
token: p,
|
|
840
|
+
sessionId: kt,
|
|
841
|
+
deviceModel: I,
|
|
855
842
|
autoReconnect: U,
|
|
856
843
|
jitterBufferTargetMs: H,
|
|
857
|
-
openUrl:
|
|
858
|
-
inspectMode:
|
|
844
|
+
openUrl: k,
|
|
845
|
+
inspectMode: S,
|
|
859
846
|
axPollIntervalMs: F,
|
|
860
847
|
axMaxBackoffMs: X,
|
|
861
848
|
androidElementTreeOptions: g,
|
|
862
849
|
microphoneEnabled: J,
|
|
863
850
|
onStateChange: (t) => {
|
|
864
|
-
(t.videoReady || t.connection === "idle" || t.connection === "connecting" || t.connection === "reconnecting") &&
|
|
851
|
+
(t.videoReady || t.connection === "idle" || t.connection === "connecting" || t.connection === "reconnecting") && Tt(t.videoReady), bt(t.connection === "failed"), Nt(t.connection === "terminated"), gt(t.duo), vt(t.duoState), yt(t.duoError);
|
|
865
852
|
},
|
|
866
853
|
onAxSnapshotChange: (t) => {
|
|
867
|
-
e && (
|
|
854
|
+
e && (Ue((c) => Qt(c, t) ? c : t), D.current.onAxSnapshotChange?.(t));
|
|
868
855
|
},
|
|
869
856
|
onAxStatusChange: (...t) => D.current.onAxStatusChange?.(...t),
|
|
870
857
|
onCameraDemandChange: (...t) => D.current.onCameraDemandChange?.(...t),
|
|
871
858
|
onCameraStats: oe ? (...t) => D.current.onCameraStats?.(...t) : void 0,
|
|
872
859
|
onMicrophoneStateChange: (...t) => D.current.onMicrophoneStateChange?.(...t),
|
|
873
|
-
onTrace:
|
|
860
|
+
onTrace: Be ? (...t) => D.current.onTrace?.(...t) : void 0,
|
|
874
861
|
onTerminated: () => D.current.onTerminated?.(),
|
|
875
862
|
onConnectionStateChange: (...t) => D.current.onConnectionStateChange?.(...t),
|
|
876
|
-
onPlaybackStats:
|
|
863
|
+
onPlaybackStats: M ? (...t) => D.current.onPlaybackStats?.(...t) : void 0
|
|
877
864
|
});
|
|
878
865
|
v.current = n;
|
|
879
|
-
const o =
|
|
866
|
+
const o = E.current ? n.attachVideo(E.current) : void 0;
|
|
880
867
|
return n.start(), () => {
|
|
881
868
|
e = !1, n.dispose(), o?.(), v.current = null;
|
|
882
869
|
};
|
|
883
|
-
}, [r,
|
|
884
|
-
if (z &&
|
|
885
|
-
return v.current?.attachVideo(
|
|
886
|
-
}, [z, r,
|
|
870
|
+
}, [r, p, h, I, Be]), x(() => {
|
|
871
|
+
if (z && Oe.current)
|
|
872
|
+
return v.current?.attachVideo(Oe.current, "inner");
|
|
873
|
+
}, [z, r, p, h, I, Be]), x(() => {
|
|
887
874
|
v.current?.updateOptions({
|
|
888
|
-
openUrl:
|
|
875
|
+
openUrl: k,
|
|
889
876
|
axPollIntervalMs: F,
|
|
890
877
|
axMaxBackoffMs: X,
|
|
891
878
|
androidElementTreeOptions: g,
|
|
892
879
|
autoReconnect: U,
|
|
893
880
|
jitterBufferTargetMs: H,
|
|
894
881
|
microphoneEnabled: J,
|
|
895
|
-
inspectMode:
|
|
896
|
-
onPlaybackStats:
|
|
882
|
+
inspectMode: S,
|
|
883
|
+
onPlaybackStats: M ? (...e) => D.current.onPlaybackStats?.(...e) : void 0,
|
|
897
884
|
onCameraStats: oe ? (...e) => D.current.onCameraStats?.(...e) : void 0
|
|
898
885
|
});
|
|
899
886
|
}, [
|
|
900
887
|
U,
|
|
901
888
|
H,
|
|
902
889
|
J,
|
|
903
|
-
|
|
904
|
-
!!
|
|
890
|
+
S,
|
|
891
|
+
!!M,
|
|
905
892
|
!!oe,
|
|
906
|
-
|
|
893
|
+
k,
|
|
907
894
|
F,
|
|
908
895
|
X,
|
|
909
896
|
g
|
|
910
897
|
]);
|
|
911
|
-
const
|
|
912
|
-
const e =
|
|
898
|
+
const dt = () => {
|
|
899
|
+
const e = Ie();
|
|
913
900
|
if (!e) {
|
|
914
|
-
|
|
901
|
+
nt(null);
|
|
915
902
|
return;
|
|
916
903
|
}
|
|
917
904
|
const n = {
|
|
@@ -920,36 +907,36 @@ const In = sn(
|
|
|
920
907
|
width: e.actualWidth,
|
|
921
908
|
height: e.actualHeight
|
|
922
909
|
};
|
|
923
|
-
|
|
910
|
+
nt(
|
|
924
911
|
(o) => o && o.left === n.left && o.top === n.top && o.width === n.width && o.height === n.height ? o : n
|
|
925
912
|
);
|
|
926
913
|
};
|
|
927
914
|
x(() => {
|
|
928
|
-
const e =
|
|
915
|
+
const e = E.current, n = Me.current, o = be.current;
|
|
929
916
|
if (!e) return;
|
|
930
917
|
const t = () => {
|
|
931
918
|
const i = e.videoWidth > 0 && e.videoHeight > 0;
|
|
932
|
-
i && (
|
|
933
|
-
const a =
|
|
934
|
-
if (!
|
|
935
|
-
|
|
919
|
+
i && ($e.current = { width: e.videoWidth, height: e.videoHeight });
|
|
920
|
+
const a = $e.current, l = a ? `${a.width} / ${a.height}` : void 0;
|
|
921
|
+
if (!ke || !n) {
|
|
922
|
+
xe(
|
|
936
923
|
!i && a ? {
|
|
937
924
|
aspectRatio: l,
|
|
938
925
|
contain: "size",
|
|
939
926
|
containIntrinsicSize: `${a.width}px ${a.height}px`
|
|
940
927
|
} : {}
|
|
941
|
-
),
|
|
928
|
+
), dt();
|
|
942
929
|
return;
|
|
943
930
|
}
|
|
944
|
-
const
|
|
945
|
-
if (
|
|
931
|
+
const u = n.clientWidth, C = n.clientHeight;
|
|
932
|
+
if (u === 0 || C === 0) return;
|
|
946
933
|
const y = a ? a.width > a.height : !1;
|
|
947
|
-
|
|
948
|
-
ee === "android" && !!a &&
|
|
934
|
+
Je(y), et(
|
|
935
|
+
ee === "android" && !!a && yn(a.width, a.height)
|
|
949
936
|
);
|
|
950
|
-
const
|
|
937
|
+
const P = y ? pe.videoPosition.landscape : pe.videoPosition.portrait;
|
|
951
938
|
let w = { aspectRatio: l };
|
|
952
|
-
|
|
939
|
+
P.heightMultiplier ? (w.height = `${C * P.heightMultiplier}px`, w.width = "auto") : P.widthMultiplier && (w.width = `${u * P.widthMultiplier}px`, w.height = "auto"), w.borderRadius = `${y ? C * pe.videoBorderRadiusMultiplier : u * pe.videoBorderRadiusMultiplier}px`, xe(w), dt();
|
|
953
940
|
}, c = new ResizeObserver(() => {
|
|
954
941
|
t();
|
|
955
942
|
});
|
|
@@ -958,21 +945,21 @@ const In = sn(
|
|
|
958
945
|
return e.addEventListener("resize", s), t(), () => {
|
|
959
946
|
c.disconnect(), e.removeEventListener("loadedmetadata", t), e.removeEventListener("resize", t), e.removeEventListener("resize", s), n && n.removeEventListener("load", t);
|
|
960
947
|
};
|
|
961
|
-
}, [pe,
|
|
962
|
-
|
|
963
|
-
}, [
|
|
948
|
+
}, [pe, ke, r, I]), x(() => {
|
|
949
|
+
Re || (Ue(null), Ne(null), Se(null), ot(null), he(null), Pe.current = null, j.current !== void 0 && (window.cancelAnimationFrame(j.current), j.current = void 0));
|
|
950
|
+
}, [Re]), x(() => () => {
|
|
964
951
|
j.current !== void 0 && (window.cancelAnimationFrame(j.current), j.current = void 0);
|
|
965
952
|
}, []), x(() => {
|
|
966
|
-
if (!
|
|
953
|
+
if (!Re) return;
|
|
967
954
|
const e = (n) => {
|
|
968
|
-
n.key === "Escape" && (
|
|
955
|
+
n.key === "Escape" && (ze || Fe) && (Se(null), Ne(null), he(null), ye("onInspectSelectionChange", fe.current, null));
|
|
969
956
|
};
|
|
970
957
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
971
|
-
}, [
|
|
972
|
-
const
|
|
973
|
-
|
|
958
|
+
}, [Re, ze, Fe]);
|
|
959
|
+
const Ft = () => {
|
|
960
|
+
E.current && E.current.focus();
|
|
974
961
|
};
|
|
975
|
-
|
|
962
|
+
cn(Ae, () => ({
|
|
976
963
|
openUrl: (e) => v.current?.openUrl(e),
|
|
977
964
|
sendKeyEvent: (e) => v.current?.sendKeyEvent(e),
|
|
978
965
|
screenshot: (e) => v.current?.screenshot(e) ?? Promise.reject(new Error("Simulator disconnected")),
|
|
@@ -981,21 +968,21 @@ const In = sn(
|
|
|
981
968
|
refreshAxTree: () => v.current?.refreshAxTree() ?? Promise.reject(new Error("Simulator disconnected")),
|
|
982
969
|
getAxSnapshot: () => v.current?.getAxSnapshot() ?? null,
|
|
983
970
|
setInspectHighlight: (e) => {
|
|
984
|
-
|
|
971
|
+
Ne(e?.id ?? null);
|
|
985
972
|
},
|
|
986
973
|
setInspectSelection: (e) => {
|
|
987
|
-
|
|
974
|
+
Se(e?.id ?? null), he(e ? Pe.current : null);
|
|
988
975
|
const n = ce.current;
|
|
989
|
-
e && n ?
|
|
976
|
+
e && n ? ye("onInspectSelectionChange", fe.current, { element: e, snapshot: n }) : ye("onInspectSelectionChange", fe.current, null);
|
|
990
977
|
},
|
|
991
978
|
getAxStatus: () => v.current?.getAxStatus() ?? "idle"
|
|
992
979
|
}));
|
|
993
|
-
const
|
|
980
|
+
const zt = It && ie !== null;
|
|
994
981
|
return /* @__PURE__ */ $(
|
|
995
982
|
"div",
|
|
996
983
|
{
|
|
997
|
-
ref:
|
|
998
|
-
className:
|
|
984
|
+
ref: be,
|
|
985
|
+
className: ["rc-container", d].filter(Boolean).join(" "),
|
|
999
986
|
style: { touchAction: "none" },
|
|
1000
987
|
onMouseDown: te,
|
|
1001
988
|
onMouseMove: te,
|
|
@@ -1006,8 +993,8 @@ const In = sn(
|
|
|
1006
993
|
onTouchEnd: te,
|
|
1007
994
|
onTouchCancel: te,
|
|
1008
995
|
children: [
|
|
1009
|
-
|
|
1010
|
-
/* @__PURE__ */
|
|
996
|
+
zt && ie && /* @__PURE__ */ $(ft, { children: [
|
|
997
|
+
/* @__PURE__ */ f(
|
|
1011
998
|
"div",
|
|
1012
999
|
{
|
|
1013
1000
|
className: "rc-touch-indicator",
|
|
@@ -1017,7 +1004,7 @@ const In = sn(
|
|
|
1017
1004
|
}
|
|
1018
1005
|
}
|
|
1019
1006
|
),
|
|
1020
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ f(
|
|
1021
1008
|
"div",
|
|
1022
1009
|
{
|
|
1023
1010
|
className: "rc-touch-indicator",
|
|
@@ -1028,30 +1015,26 @@ const In = sn(
|
|
|
1028
1015
|
}
|
|
1029
1016
|
)
|
|
1030
1017
|
] }),
|
|
1031
|
-
|
|
1018
|
+
ke && /* @__PURE__ */ f(
|
|
1032
1019
|
"img",
|
|
1033
1020
|
{
|
|
1034
|
-
ref:
|
|
1035
|
-
src:
|
|
1021
|
+
ref: Me,
|
|
1022
|
+
src: it,
|
|
1036
1023
|
alt: "",
|
|
1037
|
-
className: ee === "ios" ?
|
|
1024
|
+
className: ee === "ios" ? "rc-phone-frame rc-phone-frame-ios" : "rc-phone-frame",
|
|
1038
1025
|
draggable: !1
|
|
1039
1026
|
}
|
|
1040
1027
|
),
|
|
1041
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ f(
|
|
1042
1029
|
"video",
|
|
1043
1030
|
{
|
|
1044
|
-
ref:
|
|
1045
|
-
className:
|
|
1046
|
-
"rc-video",
|
|
1047
|
-
!Ye && "rc-video-frameless",
|
|
1048
|
-
!At && "rc-video-loading"
|
|
1049
|
-
),
|
|
1031
|
+
ref: E,
|
|
1032
|
+
className: ["rc-video", !ke && "rc-video-frameless", !wt && "rc-video-loading"].filter(Boolean).join(" "),
|
|
1050
1033
|
style: {
|
|
1051
|
-
...
|
|
1034
|
+
...Et,
|
|
1052
1035
|
...z ? { opacity: 0, width: 1, height: 1, pointerEvents: "none" } : {},
|
|
1053
|
-
...
|
|
1054
|
-
backgroundImage: `url("${
|
|
1036
|
+
...ct ? {
|
|
1037
|
+
backgroundImage: `url("${ct}")`,
|
|
1055
1038
|
backgroundRepeat: "no-repeat",
|
|
1056
1039
|
backgroundPosition: "center",
|
|
1057
1040
|
backgroundSize: pe.loadingLogoSize
|
|
@@ -1061,85 +1044,85 @@ const In = sn(
|
|
|
1061
1044
|
playsInline: !0,
|
|
1062
1045
|
muted: !0,
|
|
1063
1046
|
tabIndex: z ? -1 : 0,
|
|
1064
|
-
onKeyDown:
|
|
1065
|
-
onKeyUp:
|
|
1066
|
-
onClick:
|
|
1047
|
+
onKeyDown: De,
|
|
1048
|
+
onKeyUp: De,
|
|
1049
|
+
onClick: Ft,
|
|
1067
1050
|
onFocus: () => {
|
|
1068
|
-
|
|
1051
|
+
E.current && (E.current.style.outline = "none");
|
|
1069
1052
|
},
|
|
1070
1053
|
onBlur: () => {
|
|
1071
|
-
|
|
1054
|
+
E.current && (E.current.style.outline = "none");
|
|
1072
1055
|
}
|
|
1073
1056
|
}
|
|
1074
1057
|
),
|
|
1075
|
-
z && /* @__PURE__ */
|
|
1058
|
+
z && /* @__PURE__ */ f(
|
|
1076
1059
|
"video",
|
|
1077
1060
|
{
|
|
1078
|
-
ref:
|
|
1061
|
+
ref: Oe,
|
|
1079
1062
|
autoPlay: !0,
|
|
1080
1063
|
playsInline: !0,
|
|
1081
1064
|
muted: !0,
|
|
1082
1065
|
style: { position: "absolute", width: 1, height: 1, opacity: 0, pointerEvents: "none" }
|
|
1083
1066
|
}
|
|
1084
1067
|
),
|
|
1085
|
-
z &&
|
|
1086
|
-
|
|
1068
|
+
z && qe && /* @__PURE__ */ f(sn, { fallback: /* @__PURE__ */ f("div", { children: "Loading iPhone Duo…" }), children: /* @__PURE__ */ f(
|
|
1069
|
+
vn,
|
|
1087
1070
|
{
|
|
1088
1071
|
showFrame: K,
|
|
1089
1072
|
modelUrl: T,
|
|
1090
|
-
outer:
|
|
1091
|
-
inner:
|
|
1092
|
-
state:
|
|
1093
|
-
setAngle: (e) =>
|
|
1094
|
-
setOrientation: (e) =>
|
|
1095
|
-
button: (e, n) =>
|
|
1073
|
+
outer: E.current,
|
|
1074
|
+
inner: Oe.current,
|
|
1075
|
+
state: qe,
|
|
1076
|
+
setAngle: (e) => Ke("setHingeAngle", { angleDegrees: e }),
|
|
1077
|
+
setOrientation: (e) => Ke("setDuoOrientation", { orientation: e }),
|
|
1078
|
+
button: (e, n) => Ke("performActions", {
|
|
1096
1079
|
actions: [{ type: n ? "buttonDown" : "buttonUp", button: e }]
|
|
1097
1080
|
}),
|
|
1098
1081
|
touch: (e, n, o, t) => {
|
|
1099
1082
|
v.current?.sendDisplayTouch(e, n, o, t);
|
|
1100
1083
|
},
|
|
1101
|
-
onKeyDown:
|
|
1102
|
-
onKeyUp:
|
|
1084
|
+
onKeyDown: De,
|
|
1085
|
+
onKeyUp: De
|
|
1103
1086
|
}
|
|
1104
1087
|
) }),
|
|
1105
|
-
z &&
|
|
1106
|
-
!z &&
|
|
1107
|
-
|
|
1088
|
+
z && Qe && /* @__PURE__ */ f("div", { role: "alert", className: "rc-duo-error", children: Qe }),
|
|
1089
|
+
!z && Re && /* @__PURE__ */ f(
|
|
1090
|
+
gn,
|
|
1108
1091
|
{
|
|
1109
|
-
snapshot:
|
|
1110
|
-
geometry:
|
|
1111
|
-
highlightedId:
|
|
1112
|
-
selectedId:
|
|
1113
|
-
mode:
|
|
1114
|
-
cursorPosition:
|
|
1115
|
-
frozenCursorPosition:
|
|
1092
|
+
snapshot: tt,
|
|
1093
|
+
geometry: Ot,
|
|
1094
|
+
highlightedId: Fe,
|
|
1095
|
+
selectedId: ze,
|
|
1096
|
+
mode: Pt,
|
|
1097
|
+
cursorPosition: _t,
|
|
1098
|
+
frozenCursorPosition: St,
|
|
1116
1099
|
onSelectChange: (e, n) => {
|
|
1117
|
-
|
|
1100
|
+
Se(e?.id ?? null), e && n ? he(n) : e || he(null);
|
|
1118
1101
|
const o = ce.current;
|
|
1119
|
-
e && o ?
|
|
1102
|
+
e && o ? ye("onInspectSelectionChange", fe.current, {
|
|
1120
1103
|
element: e,
|
|
1121
1104
|
snapshot: o
|
|
1122
|
-
}) :
|
|
1105
|
+
}) : ye("onInspectSelectionChange", fe.current, null);
|
|
1123
1106
|
},
|
|
1124
1107
|
onTapElement: (e, n) => {
|
|
1125
1108
|
if (n) {
|
|
1126
|
-
|
|
1109
|
+
at(n.x, n.y);
|
|
1127
1110
|
return;
|
|
1128
1111
|
}
|
|
1129
1112
|
const o = ce.current;
|
|
1130
|
-
o &&
|
|
1113
|
+
o && Yt(e, o);
|
|
1131
1114
|
}
|
|
1132
1115
|
}
|
|
1133
1116
|
),
|
|
1134
|
-
|
|
1135
|
-
/* @__PURE__ */
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
] }) :
|
|
1117
|
+
Ct ? /* @__PURE__ */ $("div", { className: "rc-terminated", role: "status", children: [
|
|
1118
|
+
/* @__PURE__ */ f("div", { className: "rc-terminated-title", children: "Instance terminated" }),
|
|
1119
|
+
/* @__PURE__ */ f("div", { className: "rc-terminated-message", children: "This instance no longer exists and can't be reconnected." })
|
|
1120
|
+
] }) : At && /* @__PURE__ */ f("button", { type: "button", className: "rc-retry-button", onClick: Ut, children: "Retry" })
|
|
1138
1121
|
]
|
|
1139
1122
|
}
|
|
1140
1123
|
);
|
|
1141
1124
|
}
|
|
1142
1125
|
);
|
|
1143
1126
|
export {
|
|
1144
|
-
|
|
1127
|
+
Rn as R
|
|
1145
1128
|
};
|