@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.
Files changed (31) hide show
  1. package/README.md +13 -7
  2. package/dist/{BufferGeometryUtils-B2-bJqFj.js → BufferGeometryUtils-CMbyl1DL.js} +1 -1
  3. package/dist/{BufferGeometryUtils-BcXIkYhS.mjs → BufferGeometryUtils-DEy5W2hb.mjs} +1 -1
  4. package/dist/{GLTFLoader-BQvr_TBF.mjs → GLTFLoader-B3xbM8m1.mjs} +2 -2
  5. package/dist/{GLTFLoader-CsxjkQ8a.js → GLTFLoader-CfPNHfJQ.js} +1 -1
  6. package/dist/components/macbook-geometry.d.ts +5 -5
  7. package/dist/components/model-source.d.ts +4 -1
  8. package/dist/components/remote-control.d.ts +3 -2
  9. package/dist/{duo-frame-CyoWZakh.mjs → duo-frame-BCmB9_5p.mjs} +4 -4
  10. package/dist/{duo-frame-B04_gIge.js → duo-frame-Bm0hprn9.js} +2 -2
  11. package/dist/{duo-view-DJEQ3Q74.mjs → duo-view-C07GD_5E.mjs} +2 -2
  12. package/dist/{duo-view-BHwnQmx_.js → duo-view-tUJbbWoS.js} +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.css +1 -1
  15. package/dist/index.js +2 -2
  16. package/dist/lite.cjs +1 -1
  17. package/dist/lite.js +1 -1
  18. package/dist/macbook-frame-BxJfxUcU.js +2 -0
  19. package/dist/macbook-frame-Dm6ko0j9.mjs +340 -0
  20. package/dist/macbook-model-B4t8BSHX.js +1 -0
  21. package/dist/macbook-model-BYrio_FY.mjs +4 -0
  22. package/dist/{model-source-BAZAKTcr.mjs → model-source-CN_i4mVy.mjs} +57 -47
  23. package/dist/{model-source-DbYJQWkh.js → model-source-D3_k9qRK.js} +1 -1
  24. package/dist/{remote-control-PGtDEDgm.mjs → remote-control-BX6dzHtt.mjs} +686 -720
  25. package/dist/remote-control-CEVcOPQZ.js +1 -0
  26. package/package.json +1 -1
  27. package/dist/macbook-frame-Be0dCliH.js +0 -3
  28. package/dist/macbook-frame-DzwIHHCA.mjs +0 -344
  29. package/dist/macbook-model-BiMxLpmf.mjs +0 -4
  30. package/dist/macbook-model-BpUdvtlU.js +0 -1
  31. package/dist/remote-control-Db6ssV0S.js +0 -1
@@ -1,8 +1,8 @@
1
- import { jsxs as ee, jsx as w, Fragment as So } from "react/jsx-runtime";
2
- import { M as Q, o as gn, q as yn, f as vn, c as xo, d as bn, b as wn, r as Mn, s as An, t as ko, u as nt, v as Cn, e as Tn, w as G, x as Ft, y as Rn, z as On, B as Tt, C as B, E as Rt, a as En, F as kn, G as x, I as Nn } from "./core-nbvkIrvp.mjs";
3
- import { useReducer as In, useRef as P, useCallback as kt, memo as zt, useState as W, useEffect as j, useMemo as Ke, lazy as Po, forwardRef as _n, useImperativeHandle as Sn, Suspense as No } from "react";
4
- import { createPortal as xn } from "react-dom";
5
- import './index.css';const se = {
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
- }, Kt = 100 + 2 * se.sideBezel, ht = Kt + 2 * se.baseOverhang, Vt = se.topBezel + se.chin + se.baseHeight, Pn = (Vt - 2 * se.topBezel) / 2, li = 8;
14
- function Hn(a) {
15
- const t = 100 / a, r = t + se.topBezel + se.chin;
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 Wn = Math.PI / 2, di = 135, ui = 100, hi = 2400;
24
- function fi(a) {
25
- return Wn - a * Math.PI / 180;
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 mi(a) {
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 Fe(a, t, r, l = 6) {
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 [f, b, A, N] of v)
39
- for (let _ = 0; _ <= l; _++) {
40
- const E = N + _ * Math.PI / 2 / l;
41
- p.push({ x: f + A * Math.cos(E), y: b + A * Math.sin(E), nx: Math.cos(E), ny: Math.sin(E) });
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 pi(a) {
46
- const { screenHeight: t, lidHeight: r, depth: l } = Hn(a), p = [], v = (h, y, M) => p.push({ part: h, kind: y, vertices: new Float32Array(M) }), f = (h, y, M, D, H) => {
47
- const Y = M.map((ne) => ne.x), q = M.map((ne) => ne.y), [de, te, ye, Z] = [Math.min(...Y), Math.max(...Y), Math.min(...q), Math.max(...q)], oe = (de + te) / 2, C = (ye + Z) / 2, Re = (ne, F) => [
48
- ...D(ne, F),
49
- ...H,
50
- (ne - de) / (te - de || 1),
51
- (F - ye) / (Z - ye || 1)
52
- ], ft = [];
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 F = M[ne], Ie = M[(ne + 1) % M.length];
55
- for (const Ve of [Re(oe, C), Re(F.x, F.y), Re(Ie.x, Ie.y)]) ft.push(...Ve);
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(h, y, ft);
58
- }, b = (h, y, M, D, H, Y, q) => {
59
- const de = [];
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], Z = M[(te + 1) % M.length], oe = (C, Re) => [...D(C.x, C.y, Re), ...H(C.nx, C.ny), 0, 0];
62
- for (const C of [
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(Z, Y),
65
- oe(Z, q),
64
+ oe(q, Y),
65
+ oe(q, j),
66
66
  oe(ye, Y),
67
- oe(Z, q),
68
- oe(ye, q)
67
+ oe(q, j),
68
+ oe(ye, j)
69
69
  ])
70
- de.push(...C);
70
+ le.push(...R);
71
71
  }
72
- v(h, y, de);
73
- }, A = Fe(Kt, r, { top: 2.2, bottom: 0.4 }), N = (h) => h + r / 2, _ = se.lidThickness;
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
- A,
78
- (h, y, M) => [h, N(y), M],
79
- (h, y) => [h, y, 0],
80
- -_,
77
+ T,
78
+ (u, y, M) => [u, k(y), M],
79
+ (u, y) => [u, y, 0],
80
+ -I,
81
81
  0
82
- ), f("lid", "shell", A, (h, y) => [h, N(y), -_], [0, 0, -1]), f(
82
+ ), m("lid", "shell", T, (u, y) => [u, k(y), -I], [0, 0, -1]), m(
83
83
  "lid",
84
84
  "glass",
85
- Fe(Kt - 0.5, r - 0.5, { top: 1.95, bottom: 0.2 }),
86
- (h, y) => [h, N(y), 0.01],
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 = se.chin;
90
- f(
89
+ const E = ce.chin;
90
+ m(
91
91
  "lid",
92
92
  "screen",
93
- Fe(100, t, { top: se.screenRadius, bottom: 0 }),
94
- (h, y) => [h, E + t / 2 + y, 0.02],
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
- ), f(
96
+ ), m(
97
97
  "lid",
98
98
  "camera",
99
- Fe(0.5, 0.5, { top: 0.25, bottom: 0.25 }, 4),
100
- (h, y) => [h, r - se.topBezel / 2 + y, 0.02],
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 = Fe(ht, l + _, { top: 3, bottom: 3 }), U = (h) => (l - _) / 2 - h;
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
- (h, y, M) => [h, M, U(y)],
109
- (h, y) => [h, 0, -y],
108
+ (u, y, M) => [u, M, U(y)],
109
+ (u, y) => [u, 0, -y],
110
110
  -2.2,
111
111
  0
112
- ), f("base", "shell", L, (h, y) => [h, 0, U(y)], [0, 1, 0]), f("base", "shell", L, (h, y) => [h, -2.2, U(y)], [0, -1, 0]);
113
- const ae = (h, y, M, D, H, Y, q) => f("base", h, Fe(D, H, { top: q, bottom: q }, 3), (de, te) => [y + de, Y, M - te], [0, 1, 0]), Te = ht * 0.72, me = l * 0.08, R = [0.55, 1, 1, 1, 1, 1], le = l * 0.4 / R.reduce((h, y) => h + y, 0);
114
- ae("well", 0, me + l * 0.4 / 2, Te + 1.4, l * 0.4 + 1.4, 0.01, 0.8);
115
- let z = me;
116
- for (const [h, y] of R.entries()) {
117
- const M = y * le, D = Te / 14;
118
- for (let H = 0; H < 14; H++) {
119
- if (h === 5 && H > 4 && H < 9) continue;
120
- const Y = h === 5 && H === 4 ? 5 : 1;
121
- ae(
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
- -Te / 2 + D * (H + Y / 2),
124
- z + M / 2,
125
- D * Y - 0.5,
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
- z += M;
131
+ V += M;
132
132
  }
133
- ae("trackpad", 0, l * 0.72, ht * 0.4, l * 0.36, 0.01, 1.2), f(
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
- Fe(14, 0.9, { top: 0, bottom: 0.45 }, 3),
137
- (h, y) => [h, -0.45 + y, l + 0.01],
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 h of p) {
142
- const y = `${h.part}:${h.kind}`;
143
- S.set(y, [...S.get(y) ?? [], h]);
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((h) => {
146
- const y = new Float32Array(h.reduce((D, H) => D + H.vertices.length, 0));
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 D of h)
149
- y.set(D.vertices, M), M += D.vertices.length;
150
- return { part: h[0].part, kind: h[0].kind, vertices: y };
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 gi(a, t, r = 0) {
154
- const l = 1 - r, p = t / l, v = a >= p ? 1 : a / p, f = (a >= p ? p / a : 1) * l, b = (1 - v) / 2, A = r > 0 ? l - f : (l - f) / 2;
155
- return { repeat: [1 / v, 1 / f], offset: [(0 - b) / v, (0 - A) / f] };
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 yi(a, t, r) {
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 f = (b) => Math.max(0, Math.min(1, b));
161
- return { x: f(l), y: f(1 - p) };
160
+ const m = (b) => Math.max(0, Math.min(1, b));
161
+ return { x: m(l), y: m(1 - p) };
162
162
  }
163
- const Dn = 150, Ln = 8;
164
- class Yn {
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(gn(t, r.width, r.height, r.x, r.y, l)));
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(yn(t.width, t.height, t.x, t.y, r, l));
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 f = {
189
- x: r.reduce((b, A) => b + A.x, 0) / r.length,
190
- y: r.reduce((b, A) => b + A.y, 0) / r.length
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(f.x, f.y);
194
- b && t === "touchmove" && this.scroll(b, (p.x - f.x) * l.scale, (p.y - f.y) * l.scale);
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", ...f }, !1;
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(), Dn)
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) < Ln) return !1;
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 f = l.map(v.x, v.y);
213
- return f && this.pointer(Q.MOVE, f, 1), !1;
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 f = this.gesture;
218
- f?.mode === "press" && this.lift(f, l), this.gesture = void 0;
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 Xn(a, t) {
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 $n(a) {
245
- const [t, r] = In(Xn, { mode: "2d", selection: 0, ready: 0 }), l = P(t);
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 = P(a);
247
+ const p = H(a);
248
248
  p.current = a;
249
- const { mode: v, selection: f, ready: b } = t, A = kt((E) => r({ type: "choose", mode: E }), []), N = kt(() => {
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 !== f || E.ready === f || (p.current?.(), r({ type: "ready", selection: f }));
252
- }, [f]), _ = v === "3d" && b !== f;
253
- return { mode: v, shown: v === "3d" && !_ ? "3d" : "2d", loading: _, choose: A, onReady: N };
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 Bn({ view: a, label: t }) {
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 Un = async (a) => {
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
- }, Fn = zt(
287
- function({ element: t, screen: r, highlighted: l, selected: p, selectable: v, onClick: f }) {
288
- const b = vn(t.frame, r);
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 A = xo(t);
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": A,
303
- onClick: (N) => {
304
- v && (N.preventDefault(), N.stopPropagation(), f(t, { x: N.clientX, y: N.clientY }));
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 && bn(a.element, t.element)
316
- ), Kn = 260, Vn = 220, zn = 6, Gn = 8, jn = zt(function({
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: f
322
+ onTap: m
323
323
  }) {
324
- const [b, A] = W(null);
325
- j(() => {
324
+ const [b, T] = D(null);
325
+ J(() => {
326
326
  if (!b) return;
327
- const R = window.setTimeout(() => A(null), 1100);
328
- return () => window.clearTimeout(R);
327
+ const C = window.setTimeout(() => T(null), 1100);
328
+ return () => window.clearTimeout(C);
329
329
  }, [b]);
330
- const N = Ke(() => {
331
- const R = Kn, le = Vn, z = zn, S = Gn, h = typeof window < "u" ? window.innerWidth : 1024, y = typeof window < "u" ? window.innerHeight : 768, M = l.x + z + R <= h - S, D = l.y - z - le >= S;
332
- let H = M ? l.x + z : l.x - z, Y = D ? l.y - z : l.y + z;
333
- const te = `translate(${M ? "0" : "-100%"}, ${D ? "-100%" : "0"})`;
334
- return H = Math.max(S + (M ? 0 : R), Math.min(h - S - (M ? R : 0), H)), Y = Math.max(S + (D ? le : 0), Math.min(y - S - (D ? 0 : le), Y)), { left: `${H}px`, top: `${Y}px`, transform: te };
335
- }, [l.x, l.y]), _ = Ke(() => wn(t, r), [t, r]), E = r === "ios" ? t.selectors.AXUniqueId : t.selectors.resourceId, L = r === "ios" ? "AXUniqueId" : "resourceId", U = kt(async (R, le) => {
336
- if (!R) return;
337
- await Un(R) && A(le);
338
- }, []), ae = Mn(t), Te = t.label || t.value || ae, me = xo(t);
339
- return xn(
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: N,
346
- onClick: (R) => R.stopPropagation(),
347
- onMouseDown: (R) => R.stopPropagation(),
348
- onMouseMove: (R) => R.stopPropagation(),
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: ae }),
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: Te }),
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: !f,
386
- onClick: () => f?.(t, l),
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: _ ?? "No usable selector for this element",
397
- onClick: () => U(_ ?? void 0, "selector"),
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
- }), qn = zt(function({
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: f,
424
+ cursorPosition: m,
425
425
  frozenCursorPosition: b,
426
- onSelectChange: A,
427
- onTapElement: N
426
+ onSelectChange: T,
427
+ onTapElement: k
428
428
  }) {
429
- const _ = v === "select", E = _ ? l !== null && l !== p : l !== null, L = _ ? l ?? p : l, U = Ke(() => {
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 h of t.elements) S.set(h.id, h);
432
+ for (const u of t.elements) S.set(u.id, u);
433
433
  return S;
434
- }, [t]), ae = Ke(() => L ? U.get(L) ?? null : null, [L, U]);
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 ? f : b ?? f, R = E, le = _ && !E && p !== null, z = (S) => {
437
- _ && S.target === S.currentTarget && A(null, null);
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(So, { children: [
439
+ return /* @__PURE__ */ ee(Co, { children: [
440
440
  /* @__PURE__ */ w(
441
441
  "div",
442
442
  {
443
- className: _ ? "rc-inspect-overlay rc-inspect-overlay-select" : "rc-inspect-overlay",
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: z,
450
+ onClick: V,
451
451
  children: t.elements.map((S) => /* @__PURE__ */ w(
452
- Fn,
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: A
458
+ selectable: I,
459
+ onClick: T
460
460
  },
461
461
  S.id
462
462
  ))
463
463
  }
464
464
  ),
465
- ae && me && /* @__PURE__ */ w(
466
- jn,
465
+ se && me && /* @__PURE__ */ w(
466
+ Bn,
467
467
  {
468
- element: ae,
468
+ element: se,
469
469
  platform: t.platform,
470
470
  anchor: me,
471
- cursorAnchored: R,
472
- showActions: le,
473
- onTap: N
471
+ cursorAnchored: C,
472
+ showActions: ae,
473
+ onTap: k
474
474
  }
475
475
  )
476
476
  ] });
477
477
  });
478
- function Zn(a, t) {
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((N) => /^(ios|android)_[a-z0-9_]+$/.test(N));
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((N) => !N)) return !1;
485
- const v = atob(p[1].replace(/-/g, "+").replace(/_/g, "/")), f = JSON.parse(
486
- new TextDecoder().decode(Uint8Array.from(v, (N) => N.charCodeAt(0)))
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 (!f || typeof f != "object" || !("scopes" in f)) return !1;
489
- const b = f.scopes;
490
- if (!Array.isArray(b) || !b.every((N) => typeof N == "string")) return !1;
491
- let A = !1;
492
- for (const N of b) {
493
- const [_, E, L, U] = N.split(":");
494
- if (!(U !== void 0 || _ !== l && _ !== "*") && !(E !== r && E !== "*")) {
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" && (A = !0);
496
+ L === "watch" && (T = !0);
497
497
  }
498
498
  }
499
- return A;
499
+ return T;
500
500
  } catch {
501
501
  return !1;
502
502
  }
503
503
  }
504
- const Jn = Po(() => import("./duo-view-DJEQ3Q74.mjs").then((a) => a.d)), Qn = Po(() => import("./macbook-frame-DzwIHHCA.mjs")), Ot = (a) => Object.entries(x).find(
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), Io = 1920, _o = 1200, ei = (a, t) => a === Io && t === _o || a === _o && t === Io, ti = {
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
- }, oi = {
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
- }, Ut = 16 / 10, Et = 44, ni = {
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 ii(a) {
564
- const t = a.code, r = kn[t];
563
+ function Zn(a) {
564
+ const t = a.code, r = Mn[t];
565
565
  if (!r)
566
- return Ft(`Unknown event.code: ${t}, key: ${a.key}`), null;
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"), f = a.shiftKey;
569
- let b = f;
570
- return p && (b = f !== 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 };
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 ut(a, t) {
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 vi = _n(
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: f = !0,
584
+ showFrame: m = !0,
585
585
  animateLid: b = !0,
586
- deviceModel: A,
587
- duoModelUrl: N,
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: ae,
593
- assets: Te,
592
+ onTerminated: se,
593
+ assets: Me,
594
594
  onConnectionStateChange: me,
595
- inspectMode: R,
596
- onAxSnapshotChange: le,
597
- onInspectSelectionChange: z,
595
+ inspectMode: C,
596
+ onAxSnapshotChange: ae,
597
+ onInspectSelectionChange: V,
598
598
  onAxStatusChange: S,
599
- axPollIntervalMs: h,
599
+ axPollIntervalMs: u,
600
600
  axMaxBackoffMs: y,
601
601
  androidElementTreeOptions: M,
602
- onCameraDemandChange: D,
603
- onCameraStats: H,
602
+ onCameraDemandChange: W,
603
+ onCameraStats: P,
604
604
  onTrace: Y,
605
- microphoneEnabled: q = !1,
606
- onMicrophoneStateChange: de
605
+ microphoneEnabled: j = !1,
606
+ onMicrophoneStateChange: le
607
607
  }, te) => {
608
- const ye = Ke(() => Zn(t, r), [t, r]), Z = v || ye, oe = P(null), C = P(null), Re = P(null), [ft, ne] = W(!1), F = A === "iphone-duo" || ft, Ie = A === "iphone-duo" ? A : void 0, Ve = P(null), [Gt, Ho] = W(null), [jt, Wo] = W(), [Do, Lo] = W(!1), [Yo, Xo] = W(!1), [$o, Bo] = W(!1), [Nt, qt] = W(!1), [Zt, Jt] = W(!1), [Uo, Qt] = W({}), [eo, to] = W(null), [It, Fo] = W(null), [_t, Ko] = W(null), oo = P(null), [no, Vo] = W(null), [io, ro] = W(null), it = $n(() => bt.current?.release()), mt = P(!1), St = P(null), V = P(/* @__PURE__ */ new Map()), _e = P(!1), [zo, Go] = W(!1), X = P(null), ze = P(null), rt = P({
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
- }), [Se, pt] = W(null), [co, xt] = W(null), [Pt, ct] = W(null), [Ht, gt] = W(null), [jo, so] = W(null), [qo, ao] = W(null), yt = P(null), ve = P(void 0), lo = (e) => {
614
- yt.current = e, ve.current === void 0 && (ve.current = window.requestAnimationFrame(() => {
615
- ve.current = void 0, ao(yt.current);
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
- }, [Zo, Ge] = W(null), xe = P(null);
618
- xe.current = co;
619
- const je = P(z);
620
- je.current = z;
621
- const Pe = R === !0 || R === "hover-only", uo = P(Pe);
622
- uo.current = Pe;
623
- const Jo = R === "hover-only" ? "hover-only" : "select", K = Ke(() => An(t), [t]), Qo = Ke(
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
- ), st = K === "ios" && A && A !== "iphone-duo" ? A : void 0, He = K === "android" && Zt ? ni : st ? oi[st] : ti[K], ue = Te?.[K], ho = st && ue?.modelFrames?.[st], fo = K === "android" && Zt ? Nt ? ue?.tabletFrameLandscape : ue?.tabletFrame : st ? Nt ? ho?.frameLandscape : ho?.frame : Nt ? ue?.frameLandscape : ue?.frame, mo = ue?.loadingLogo, at = !F && K !== "macos" && f && !!fo, pe = K === "macos" && f, be = pe && ue?.frame && ue.screen ? { src: ue.frame, screen: ue.screen } : void 0, Wt = P(null), en = pe && it.mode === "3d", we = pe && it.shown === "3d";
627
- mt.current = we;
628
- const po = it.choose;
629
- j(() => {
630
- pe || po("2d");
631
- }, [pe, po]);
632
- const go = !!be && !we && !!_t;
633
- j(() => {
634
- const e = C.current, n = oo.current, i = n?.getContext("2d");
635
- if (!go || !e || !n || !i) return;
636
- const o = () => {
637
- if (e.videoWidth) {
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 We = bt.current;
661
- j(() => () => We.release(), [We]);
662
- const lt = kt(() => {
663
- for (const e of vt.current)
664
- k.current?.sendControl(ko(Q.UP, e));
665
- vt.current.clear();
666
- }, []), Dt = (e, n) => k.current?.sendDuoControl(e, n) ?? Promise.reject(new Error("Simulator disconnected")), vo = -10, bo = (e, n) => {
667
- const i = Ze();
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 = Me(i, e, n);
648
+ const o = be(i, e, n);
670
649
  if (!o) return;
671
- const { videoX: c, videoY: d, videoWidth: s, videoHeight: u } = o, m = Rt(
650
+ const { videoX: c, videoY: d, videoWidth: s, videoHeight: h } = o, f = Rt(
672
651
  x.ACTION_DOWN,
673
- vo,
652
+ mo,
674
653
  s,
675
- u,
654
+ h,
676
655
  c,
677
656
  d,
678
657
  1,
679
658
  x.BUTTON_PRIMARY,
680
659
  x.BUTTON_PRIMARY
681
660
  );
682
- m && fe(m), window.setTimeout(() => {
683
- const T = Rt(
661
+ f && he(f), window.setTimeout(() => {
662
+ const A = Rt(
684
663
  x.ACTION_UP,
685
- vo,
664
+ mo,
686
665
  s,
687
- u,
666
+ h,
688
667
  c,
689
668
  d,
690
669
  0,
691
670
  x.BUTTON_PRIMARY,
692
671
  x.BUTTON_PRIMARY
693
672
  );
694
- T && fe(T);
673
+ A && he(A);
695
674
  }, 60);
696
- }, tn = (e, n) => {
697
- const i = Ze();
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, u = i.videoRect.left + i.offsetX + d, m = i.videoRect.top + i.offsetY + s;
700
- bo(u, m);
701
- }, wt = -1, Mt = -2, De = -3, qe = (e, n, i, o, c, d) => {
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
- }), fe(s));
722
- }, Le = (e, n, i) => {
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 u = null, m = null, T = 1;
726
- const I = x.BUTTON_PRIMARY;
704
+ let h = null, f = null, A = 1;
705
+ const _ = x.BUTTON_PRIMARY;
727
706
  switch (n) {
728
707
  case "down":
729
- e !== De && rt.current.end(), u = V.current.size === 0 ? x.ACTION_DOWN : x.ACTION_POINTER_DOWN, m = { x: o, y: c }, V.current.set(e, m), e === -1 && C.current?.focus();
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
- V.current.has(e) && (u = x.ACTION_MOVE, m = { x: o, y: c }, V.current.set(e, m));
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
- V.current.has(e) && (m = V.current.get(e), V.current.delete(e), n === "cancel" ? u = x.ACTION_CANCEL : u = V.current.size === 0 ? x.ACTION_UP : x.ACTION_POINTER_UP);
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 (u !== null && m !== null) {
718
+ if (h !== null && f !== null) {
740
719
  G("[rc-touch][mouse->touch] sending", {
741
720
  pointerId: e,
742
721
  eventType: n,
743
- action: u,
744
- actionName: Ot(u),
745
- positionToSend: m,
722
+ action: h,
723
+ actionName: Ot(h),
724
+ positionToSend: f,
746
725
  video: { width: d, height: s },
747
- altHeld: _e.current,
748
- activePointersAfter: Array.from(V.current.entries()).map(([re, $]) => ({
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
- u,
734
+ h,
756
735
  e,
757
736
  d,
758
737
  s,
759
- m.x,
760
- m.y,
761
- T,
762
- I,
763
- I
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(u),
746
+ actionName: Ot(h),
768
747
  byteLength: g.byteLength
769
- }), fe(g));
770
- } else (n === "up" || n === "cancel") && V.current.delete(e);
748
+ }), he(g));
749
+ } else (n === "up" || n === "cancel") && F.current.delete(e);
771
750
  }, Lt = (e) => {
772
- if (_e.current !== e && (_e.current = e, Go(e), e || pt(null), G("[rc-touch][alt] updateAltHeld", {
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(V.current.keys())
775
- }), K === "ios" && k.current?.getState().controlReady)) {
776
- const n = e ? B.ACTION_DOWN : B.ACTION_UP, i = Tt(
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 && fe(i);
764
+ }), i && he(i);
786
765
  }
787
- }, Ze = () => {
788
- const e = C.current, n = oe.current;
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, u = c.height, m = i / o, T = s / u;
793
- let I = s, g = u;
794
- m > T ? g = s / m : I = u * m;
795
- const re = (s - I) / 2, $ = (u - g) / 2;
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: I,
780
+ actualWidth: _,
802
781
  actualHeight: g,
803
782
  offsetX: re,
804
783
  offsetY: $
805
784
  };
806
- }, Me = (e, n, i) => {
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)), u = Math.max(
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
- ), m = Math.max(
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: u,
816
- videoY: m,
794
+ videoX: h,
795
+ videoY: f,
817
796
  videoWidth: e.videoWidth,
818
797
  videoHeight: e.videoHeight
819
798
  };
820
- }, on = (e, n, i) => {
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)), u = Math.max(
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
- ), m = Math.max(
803
+ ), f = Math.max(
825
804
  0,
826
805
  Math.min(e.videoHeight, s / e.actualHeight * e.videoHeight)
827
- ), T = e.videoWidth - u, I = e.videoHeight - m, g = e.videoRect.left + e.offsetX, re = e.videoRect.top + e.offsetY, $ = g - e.containerRect.left + d, J = re - e.containerRect.top + s, he = g - e.containerRect.left + (e.actualWidth - d), O = re - e.containerRect.top + (e.actualHeight - s);
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: J,
831
- mirrorContainerX: he,
809
+ containerY: Z,
810
+ mirrorContainerX: ue,
832
811
  mirrorContainerY: O,
833
- videoX: u,
834
- videoY: m,
835
- mirrorVideoX: T,
836
- mirrorVideoY: I,
812
+ videoX: h,
813
+ videoY: f,
814
+ mirrorVideoX: A,
815
+ mirrorVideoY: _,
837
816
  videoWidth: e.videoWidth,
838
817
  videoHeight: e.videoHeight
839
818
  };
840
- }, nn = (e, n, i, o, c, d, s) => {
841
- const u = Nn(e, n, i, o, c, d, s);
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: u.byteLength
848
- }), fe(u);
849
- }, Je = (e, n, i, o, c, d, s, u, m) => {
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: K,
830
+ platform: z,
852
831
  eventType: e,
853
832
  video: { width: n, height: i },
854
- p0: { x: o, y: c, id: u },
855
- p1: { x: d, y: s, id: m }
856
- }), e === "down" && rt.current.end(), K === "ios") {
857
- const T = e === "down" ? x.ACTION_DOWN : e === "move" ? x.ACTION_MOVE : x.ACTION_UP;
858
- nn(T, n, i, o, c, d, s);
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" ? (qe(x.ACTION_DOWN, u, n, i, o, c), qe(x.ACTION_POINTER_DOWN, m, n, i, d, s)) : e === "move" ? (qe(x.ACTION_MOVE, u, n, i, o, c), qe(x.ACTION_MOVE, m, n, i, d, s)) : (qe(x.ACTION_POINTER_UP, m, n, i, d, s), qe(x.ACTION_UP, u, n, i, o, c));
861
- }, rn = (e, n, i) => {
862
- if (!_e.current) {
863
- Se !== null && pt(null);
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 = on(e, n, i);
867
- pt(o);
868
- }, cn = (e, n, i) => {
869
- const o = xe.current;
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, u = d / e.actualHeight * o.screen.height;
874
- return En(o, s, u);
875
- }, sn = (e) => ({
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 = Me(e, n, i);
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
- }), Oe = (e) => {
893
- if (F || mt.current) return;
871
+ }), Te = (e) => {
872
+ if (K || dt.current) return;
894
873
  e.preventDefault(), e.stopPropagation();
895
- const n = Ze();
896
- if ((R === !0 || R === "hover-only") && !("touches" in e))
874
+ const n = Fe();
875
+ if ((C === !0 || C === "hover-only") && !("touches" in e))
897
876
  if (e.type === "mousemove") {
898
- if (lo({ x: e.clientX, y: e.clientY }), n) {
899
- const o = cn(n, e.clientX, e.clientY);
900
- ct(o?.id ?? null);
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" && (lo(null), ct(null));
903
- if (R !== !0) {
904
- if (K === "macos") {
905
- if (!n || !k.current?.getState().controlReady) return;
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, (u) => ({ x: u.clientX, y: u.clientY }));
908
- We.touch(e.type, s, sn(n)) && C.current?.focus();
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 = Me(n, e.clientX, e.clientY);
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" && C.current?.focus(), We.pointer(
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" ? rn(n, e.clientX, e.clientY) : e.type === "mouseleave" && pt(null)), !(!k.current?.getState().controlReady || !C.current || !n))
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], u = o[1], m = Me(n, s.clientX, s.clientY), T = Me(n, u.clientX, u.clientY);
948
- if (!m || !T) return;
949
- X.current ? X.current.source === "real-touch" && (X.current.finger0 = { x: m.videoX, y: m.videoY }, X.current.finger1 = { x: T.videoX, y: T.videoY }, Je(
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
- m.videoWidth,
952
- m.videoHeight,
953
- m.videoX,
954
- m.videoY,
955
- T.videoX,
956
- T.videoY,
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: m.videoX, y: m.videoY },
961
- finger1: { x: T.videoX, y: T.videoY },
962
- videoSize: { width: m.videoWidth, height: m.videoHeight },
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: u.identifier
966
- }, Je(
944
+ pointerId1: h.identifier
945
+ }, Ve(
967
946
  "down",
968
- m.videoWidth,
969
- m.videoHeight,
970
- m.videoX,
971
- m.videoY,
972
- T.videoX,
973
- T.videoY,
947
+ f.videoWidth,
948
+ f.videoHeight,
949
+ f.videoX,
950
+ f.videoY,
951
+ A.videoX,
952
+ A.videoY,
974
953
  s.identifier,
975
- u.identifier
954
+ h.identifier
976
955
  ));
977
956
  } else if (o.length < 2 && X.current?.source === "real-touch") {
978
957
  const s = X.current;
979
- Je(
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 u = Me(n, s.clientX, s.clientY);
998
- Le(s.identifier, d, u);
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 || V.current.has(-1)) && (c = "move");
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 || V.current.has(-1)) && (c = "up");
995
+ (d || F.current.has(-1)) && (c = "up");
1017
996
  break;
1018
997
  }
1019
998
  if (c) {
1020
- const s = Me(n, e.clientX, e.clientY);
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: _e.current,
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(V.current.keys())
1038
- }), _e.current || d ? an(c, s) : Le(-1, c, s);
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
- }, an = (e, n) => {
1043
- const { videoX: i, videoY: o, videoWidth: c, videoHeight: d } = n, s = c - i, u = d - o;
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: u },
1026
+ finger1: { x: s, y: h },
1048
1027
  videoSize: { width: c, height: d },
1049
1028
  source: "alt-mouse",
1050
- pointerId0: wt,
1051
- pointerId1: Mt
1052
- }, C.current?.focus(), Je(
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
- u,
1060
- wt,
1061
- Mt
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: u }, Je(
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
- u,
1074
- wt,
1075
- Mt
1052
+ h,
1053
+ gt,
1054
+ yt
1076
1055
  ));
1077
1056
  return;
1078
1057
  }
1079
1058
  if (e === "up" || e === "cancel") {
1080
- const m = X.current;
1081
- if (m?.source === "alt-mouse") {
1082
- const { finger0: T, finger1: I, videoSize: g } = m;
1083
- Je(
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
- T.x,
1088
- T.y,
1089
- I.x,
1090
- I.y,
1091
- wt,
1092
- Mt
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
- }, ln = 150, wo = () => {
1098
- const e = ze.current;
1099
- e && (window.clearTimeout(e.endTimer), Le(De, "up", e.pos), ze.current = null);
1100
- }, dn = (e) => {
1101
- if (!k.current?.getState().controlReady || e.ctrlKey) return;
1102
- if (K === "macos") {
1103
- if (mt.current) return;
1104
- const O = Ze();
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 Ye = e.clientX - O.videoRect.left - O.offsetX, Ae = e.clientY - O.videoRect.top - O.offsetY;
1107
- if (Ye < 0 || Ye > O.actualWidth || Ae < 0 || Ae > O.actualHeight)
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 = Me(O, e.clientX, e.clientY);
1088
+ const ge = be(O, e.clientX, e.clientY);
1110
1089
  if (!ge) return;
1111
1090
  e.preventDefault();
1112
- const et = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? 16 : e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? O.actualHeight : 1;
1113
- We.scroll(
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 * et,
1116
- e.deltaY * et
1094
+ e.deltaX * je,
1095
+ e.deltaY * je
1117
1096
  );
1118
1097
  return;
1119
1098
  }
1120
- if (_e.current || X.current) return;
1121
- const n = V.current.size;
1122
- if (n > 1 || n === 1 && !V.current.has(De)) return;
1123
- const i = Ze();
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 = Me(i, e.clientX, e.clientY);
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), u = (e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? i.actualHeight : 1) * (i.videoHeight / i.actualHeight), m = -e.deltaX * s, T = -e.deltaY * u, I = (O) => {
1132
- window.clearTimeout(O.endTimer), O.endTimer = window.setTimeout(wo, ln);
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 (m === 0 && T === 0) {
1135
- ze.current && I(ze.current);
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(m) > Math.abs(T) ? Math.min(Math.max(d.videoX, d.videoWidth * 0.2), d.videoWidth * 0.8) : d.videoX,
1142
- videoY: Math.abs(T) >= Math.abs(m) ? Math.min(Math.max(d.videoY, d.videoHeight * 0.2), d.videoHeight * 0.8) : d.videoY
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 + m, 0), O.videoWidth),
1146
- videoY: Math.min(Math.max(O.videoY + T, 0), O.videoHeight)
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 $ = ze.current;
1127
+ let $ = Be.current;
1149
1128
  if ($)
1150
1129
  window.clearTimeout($.endTimer);
1151
1130
  else {
1152
1131
  const O = g();
1153
- Le(De, "down", O), $ = { pos: O, endTimer: 0 }, ze.current = $;
1132
+ He(Pe, "down", O), $ = { pos: O, endTimer: 0 }, Be.current = $;
1154
1133
  }
1155
- let J = $.pos, he = re(J);
1156
- he.videoX === J.videoX && he.videoY === J.videoY && (Le(De, "up", J), J = g(), Le(De, "down", J), he = re(J)), Le(De, "move", he), $.pos = he, I($);
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
- j(() => {
1159
- rt.current = { handle: dn, end: wo };
1160
- }), j(() => {
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) => rt.current.handle(i);
1142
+ const n = (i) => tt.current.handle(i);
1164
1143
  return e.addEventListener("wheel", n, { passive: !1 }), () => {
1165
- rt.current.end(), e.removeEventListener("wheel", n);
1144
+ tt.current.end(), e.removeEventListener("wheel", n);
1166
1145
  };
1167
- }, []), j(() => {
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), lt();
1152
+ Lt(!1), rt();
1174
1153
  }, o = () => {
1175
- document.hidden && lt();
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
- }, [lt]);
1181
- const Qe = (e) => {
1159
+ }, [rt]);
1160
+ const Ge = (e) => {
1182
1161
  e.preventDefault(), e.stopPropagation();
1183
- const n = document.activeElement === C.current || (F || mt.current) && document.activeElement === e.currentTarget;
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
- Ft("Simulator input not focused, skipping keyboard event");
1171
+ Bt("Simulator input not focused, skipping keyboard event");
1193
1172
  return;
1194
1173
  }
1195
- if (!k.current?.getState().controlReady) {
1196
- Ft("Data channel not ready for keyboard event:", k.current?.getState().connection);
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 (K === "macos") {
1178
+ if (z === "macos") {
1200
1179
  if (e.type === "keydown" && e.repeat) return;
1201
- const o = Rn(e.code);
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" ? vt.current.add(o) : vt.current.delete(o), fe(
1207
- ko(
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 = On(o, !0);
1223
- fe(c);
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 = Tt(
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
- fe(o);
1240
- const c = Tt(
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
- fe(c);
1225
+ he(c);
1247
1226
  return;
1248
1227
  }
1249
1228
  }
1250
- const i = ii(e);
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 = Tt(
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
- fe(s);
1240
+ he(s);
1262
1241
  } else
1263
1242
  G(`Ignoring unhandled key event: type=${e.type}, key=${e.key}`);
1264
- }, un = (e) => {
1265
- e.stopPropagation(), k.current?.reconnect();
1266
- }, ie = P({
1267
- onAxSnapshotChange: le,
1243
+ }, tn = (e) => {
1244
+ e.stopPropagation(), N.current?.reconnect();
1245
+ }, ie = H({
1246
+ onAxSnapshotChange: ae,
1268
1247
  onAxStatusChange: S,
1269
- onCameraDemandChange: D,
1270
- onCameraStats: H,
1271
- onMicrophoneStateChange: de,
1248
+ onCameraDemandChange: W,
1249
+ onCameraStats: P,
1250
+ onMicrophoneStateChange: le,
1272
1251
  onTrace: Y,
1273
- onTerminated: ae,
1252
+ onTerminated: se,
1274
1253
  onConnectionStateChange: me,
1275
1254
  onPlaybackStats: U
1276
1255
  });
1277
1256
  ie.current = {
1278
- onAxSnapshotChange: le,
1257
+ onAxSnapshotChange: ae,
1279
1258
  onAxStatusChange: S,
1280
- onCameraDemandChange: D,
1281
- onCameraStats: H,
1282
- onMicrophoneStateChange: de,
1259
+ onCameraDemandChange: W,
1260
+ onCameraStats: P,
1261
+ onMicrophoneStateChange: le,
1283
1262
  onTrace: Y,
1284
- onTerminated: ae,
1263
+ onTerminated: se,
1285
1264
  onConnectionStateChange: me,
1286
1265
  onPlaybackStats: U
1287
1266
  };
1288
1267
  const Yt = !!Y;
1289
- j(() => {
1290
- St.current = null, qt(!1), Jt(!1), Qt({}), to(null);
1291
- }, [t, Ie]), j(() => {
1268
+ J(() => {
1269
+ St.current = null, Gt(!1), qt(!1), Zt({}), Qt(null);
1270
+ }, [t, Re]), J(() => {
1292
1271
  let e = !0;
1293
- xe.current !== null && (xe.current = null, xt(null), nt("onAxSnapshotChange", ie.current.onAxSnapshotChange, null));
1294
- const n = Cn({
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: Qo,
1298
- watchOnly: Z,
1299
- deviceModel: Ie,
1276
+ sessionId: Ko,
1277
+ watchOnly: q,
1278
+ deviceModel: Re,
1300
1279
  autoReconnect: E,
1301
1280
  jitterBufferTargetMs: L,
1302
1281
  openUrl: p,
1303
- inspectMode: R,
1304
- axPollIntervalMs: h,
1282
+ inspectMode: C,
1283
+ axPollIntervalMs: u,
1305
1284
  axMaxBackoffMs: y,
1306
1285
  androidElementTreeOptions: M,
1307
- microphoneEnabled: q,
1286
+ microphoneEnabled: j,
1308
1287
  onStateChange: (o) => {
1309
- (o.videoReady || o.connection === "idle" || o.connection === "connecting" || o.connection === "reconnecting") && Lo(o.videoReady), Xo(o.connection === "failed"), Bo(o.connection === "terminated"), ne(o.duo), Ho(o.duoState), Wo(o.duoError);
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) => Tn(c, o) ? c : o), ie.current.onAxSnapshotChange?.(o));
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: H ? (...o) => ie.current.onCameraStats?.(...o) : void 0,
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
- k.current = n;
1324
- const i = C.current ? n.attachVideo(C.current) : void 0;
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?.(), k.current = null;
1305
+ e = !1, n.dispose(), i?.(), N.current = null;
1327
1306
  };
1328
- }, [t, l, Ie, Yt, Z]), j(() => {
1329
- if (F && Ve.current)
1330
- return k.current?.attachVideo(Ve.current, "inner");
1331
- }, [F, t, l, Ie, Yt, Z]), j(() => {
1332
- k.current?.updateOptions({
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: h,
1314
+ axPollIntervalMs: u,
1336
1315
  axMaxBackoffMs: y,
1337
1316
  androidElementTreeOptions: M,
1338
1317
  autoReconnect: E,
1339
1318
  jitterBufferTargetMs: L,
1340
- microphoneEnabled: q,
1341
- inspectMode: R,
1319
+ microphoneEnabled: j,
1320
+ inspectMode: C,
1342
1321
  onPlaybackStats: U ? (...e) => ie.current.onPlaybackStats?.(...e) : void 0,
1343
- onCameraStats: H ? (...e) => ie.current.onCameraStats?.(...e) : void 0
1322
+ onCameraStats: P ? (...e) => ie.current.onCameraStats?.(...e) : void 0
1344
1323
  });
1345
1324
  }, [
1346
1325
  r,
1347
1326
  E,
1348
1327
  L,
1349
- q,
1350
- R,
1328
+ j,
1329
+ C,
1351
1330
  !!U,
1352
- !!H,
1331
+ !!P,
1353
1332
  p,
1354
- h,
1333
+ u,
1355
1334
  y,
1356
1335
  M
1357
1336
  ]);
1358
- const dt = () => {
1359
- if (!uo.current) return;
1360
- const e = Ze();
1337
+ const ct = () => {
1338
+ if (!so.current) return;
1339
+ const e = Fe();
1361
1340
  if (!e) {
1362
- so(null);
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
- so(
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
- j(() => {
1376
- const e = C.current, n = Re.current, i = oe.current;
1354
+ J(() => {
1355
+ const e = R.current, n = Ae.current, i = oe.current;
1377
1356
  if (!e) return;
1378
- const o = (I) => Qt((g) => ut(g, I) ? g : I), c = (I) => to((g) => g && I && ut(g, I) ? g : I), d = (I) => Fo((g) => g && I && ut(g, I) ? g : I), s = () => {
1379
- const I = e.videoWidth > 0 && e.videoHeight > 0;
1380
- I && (St.current = { width: e.videoWidth, height: e.videoHeight });
1381
- const g = St.current, re = g ? `${g.width} / ${g.height}` : void 0, $ = Wt.current;
1382
- if (be && i) {
1383
- if (ro(g ? g.width / g.height : Ut), !$?.naturalWidth) return;
1384
- const Xe = $.naturalWidth / $.naturalHeight, At = i.clientHeight - Et, $e = i.clientHeight > 0 ? Math.min(i.clientWidth, At * Xe) : i.clientWidth;
1385
- if ($e <= 0) return;
1386
- const Ee = $e / Xe, ke = i.clientHeight > 0 ? Et / 2 : 0, { screen: ce } = be, Be = ce.notch ?? 0, tt = ce.left * $e, Ue = ce.top * Ee, Ct = ce.width * $e, Ao = Ue + Be * ce.height * Ee, Co = (1 - Be) * ce.height * Ee, To = g ? g.width / g.height : Ut, ot = Math.min(Ct, Co * To), Xt = ot / To, Ro = tt + (Ct - ot) / 2, Oo = Be > 0 ? Ao : Ao + (Co - Xt) / 2, $t = (Ce, Ne, mn, pn) => `translate(calc(-50% + ${Ce + mn / 2 - $e / 2}px), calc(-50% + ${Ne + pn / 2 - Ee / 2 + ke}px))`;
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: `${ot}px`,
1367
+ width: `${At}px`,
1389
1368
  height: `${Xt}px`,
1390
- transform: $t(Ro, Oo, ot, Xt)
1391
- });
1392
- const Bt = Oo - Ue;
1393
- Ko((Ce) => {
1394
- const Ne = Be > 0 && Bt > 0 ? {
1395
- width: `${ot}px`,
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 Ce && ut(Ce, Ne) ? Ce : Ne;
1376
+ return st && Nt(st, Tt) ? st : Tt;
1410
1377
  }), d({
1411
- width: `${$e}px`,
1412
- height: `${Ee}px`,
1413
- transform: ke ? `translateY(${ke}px)` : void 0
1414
- }), c(null), dt();
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 Xe = g ? g.width / g.height : Ut, At = i.clientWidth * 100 / ht, Ee = (i.clientHeight - Et) / (1 / Xe + Vt / 100), ke = i.clientHeight > 0 ? Math.min(At, Ee) : At;
1419
- if (ke <= 0) return;
1420
- const ce = ke / 100, Be = ke / Xe, tt = i.clientHeight > 0 ? Et / 2 : 0, Ue = `${ce * se.screenRadius}px`;
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: `${Xe}`,
1423
- width: `${ke}px`,
1424
- height: `${Be}px`,
1425
- borderRadius: `${Ue} ${Ue} 0 0`,
1426
- transform: `translate(-50%, calc(-50% - ${ce * Pn - tt}px))`
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: `${ce * ht}px`,
1429
- height: `${Be + ce * Vt}px`,
1430
- transform: tt ? `translateY(${tt}px)` : void 0,
1431
- "--rc-macbook-unit": `${ce}px`
1432
- }), ro(Xe), c(null), dt();
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), !at || !n) {
1402
+ if (d(null), !it || !n) {
1436
1403
  o(
1437
- !I && g ? {
1404
+ !_ && g ? {
1438
1405
  aspectRatio: re,
1439
1406
  contain: "size",
1440
1407
  containIntrinsicSize: `${g.width}px ${g.height}px`
1441
1408
  } : {}
1442
- ), c(null), dt();
1409
+ ), c(null), ct();
1443
1410
  return;
1444
1411
  }
1445
- const J = n.clientWidth, he = n.clientHeight;
1446
- if (J === 0 || he === 0) return;
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
- qt(O), Jt(
1449
- K === "android" && !!g && ei(g.width, g.height)
1415
+ Gt(O), qt(
1416
+ z === "android" && !!g && Vn(g.width, g.height)
1450
1417
  );
1451
- const Ye = O ? He.videoPosition.landscape : He.videoPosition.portrait;
1452
- let Ae = { aspectRatio: re };
1453
- Ye.heightMultiplier ? (Ae.height = `${he * Ye.heightMultiplier}px`, Ae.width = "auto") : Ye.widthMultiplier && (Ae.width = `${J * Ye.widthMultiplier}px`, Ae.height = "auto"), Ae.borderRadius = `${O ? he * He.videoBorderRadiusMultiplier : J * He.videoBorderRadiusMultiplier}px`, o(Ae);
1454
- const ge = He.homeButton, et = O ? J : he, Mo = `calc(50% + ${et * (ge?.offset ?? 0)}px)`;
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: `${et * ge.diameter}px`,
1458
- height: `${et * ge.diameter}px`,
1459
- left: O ? Mo : "50%",
1460
- top: O ? "50%" : Mo
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
- ), dt();
1463
- }, u = new ResizeObserver(() => {
1429
+ ), ct();
1430
+ }, h = new ResizeObserver(() => {
1464
1431
  s();
1465
1432
  });
1466
- n && u.observe(n), u.observe(e), i && u.observe(i), n && n.addEventListener("load", s);
1467
- const m = Wt.current;
1468
- m?.addEventListener("load", s), e.addEventListener("loadedmetadata", s), e.addEventListener("resize", s);
1469
- const T = () => k.current?.bumpActivity();
1470
- return e.addEventListener("resize", T), s(), () => {
1471
- u.disconnect(), e.removeEventListener("loadedmetadata", s), e.removeEventListener("resize", s), e.removeEventListener("resize", T), n && n.removeEventListener("load", s), m?.removeEventListener("load", s);
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
- }, [He, at, pe, be?.src, we, t, A]), j(() => {
1474
- Pe ? dt() : (xt(null), ct(null), gt(null), ao(null), Ge(null), yt.current = null, ve.current !== void 0 && (window.cancelAnimationFrame(ve.current), ve.current = void 0));
1475
- }, [Pe]), j(() => () => {
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
- }, []), j(() => {
1478
- if (!Pe) return;
1444
+ }, []), J(() => {
1445
+ if (!ke) return;
1479
1446
  const e = (n) => {
1480
- n.key === "Escape" && (Ht || Pt) && (gt(null), ct(null), Ge(null), nt("onInspectSelectionChange", je.current, null));
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
- }, [Pe, Ht, Pt]);
1484
- const hn = () => {
1485
- C.current && C.current.focus();
1450
+ }, [ke, Ht, Pt]);
1451
+ const on = () => {
1452
+ R.current && R.current.focus();
1486
1453
  };
1487
- Sn(te, () => ({
1488
- openUrl: (e) => k.current?.openUrl(e),
1489
- sendKeyEvent: (e) => k.current?.sendKeyEvent(e),
1490
- screenshot: (e) => k.current?.screenshot(e) ?? Promise.reject(new Error("Simulator disconnected")),
1491
- terminateApp: (e) => k.current?.terminateApp(e) ?? Promise.reject(new Error("Simulator disconnected")),
1492
- reconnect: () => k.current?.reconnect(),
1493
- refreshAxTree: () => k.current?.refreshAxTree() ?? Promise.reject(new Error("Simulator disconnected")),
1494
- getAxSnapshot: () => k.current?.getAxSnapshot() ?? null,
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
- ct(e?.id ?? null);
1463
+ ot(e?.id ?? null);
1497
1464
  },
1498
1465
  setInspectSelection: (e) => {
1499
- gt(e?.id ?? null), Ge(e ? yt.current : null);
1500
- const n = xe.current;
1501
- e && n ? nt("onInspectSelectionChange", je.current, { element: e, snapshot: n }) : nt("onInspectSelectionChange", je.current, null);
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: () => k.current?.getAxStatus() ?? "idle"
1470
+ getAxStatus: () => N.current?.getAxStatus() ?? "idle"
1504
1471
  }));
1505
- const fn = zo && Se !== null;
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: Oe,
1513
- onMouseMove: Oe,
1514
- onMouseUp: Oe,
1515
- onMouseLeave: Oe,
1516
- onTouchStart: Oe,
1517
- onTouchMove: Oe,
1518
- onTouchEnd: Oe,
1519
- onTouchCancel: Oe,
1520
- onContextMenu: K === "macos" ? (e) => e.preventDefault() : void 0,
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
- fn && Se && /* @__PURE__ */ ee(So, { children: [
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: `${Se.containerX}px`,
1529
- top: `${Se.containerY}px`
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: `${Se.mirrorContainerX}px`,
1539
- top: `${Se.mirrorContainerY}px`
1505
+ left: `${Ee.mirrorContainerX}px`,
1506
+ top: `${Ee.mirrorContainerY}px`
1540
1507
  }
1541
1508
  }
1542
1509
  )
1543
1510
  ] }),
1544
- at && /* @__PURE__ */ w(
1511
+ it && /* @__PURE__ */ w(
1545
1512
  "img",
1546
1513
  {
1547
- ref: Re,
1548
- src: fo,
1514
+ ref: Ae,
1515
+ src: lo,
1549
1516
  alt: "",
1550
- className: K === "ios" ? "rc-phone-frame rc-phone-frame-ios" : "rc-phone-frame",
1517
+ className: z === "ios" ? "rc-phone-frame rc-phone-frame-ios" : "rc-phone-frame",
1551
1518
  draggable: !1
1552
1519
  }
1553
1520
  ),
1554
- be && !we && no && /* @__PURE__ */ w("div", { className: "rc-macbook-screen", style: no, "aria-hidden": "true" }),
1555
- be && !we && _t && /* @__PURE__ */ w("canvas", { ref: oo, className: "rc-macbook-band", style: _t, height: 1 }),
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: Wt,
1560
- src: be.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 && !be && It && !we && /* @__PURE__ */ ee("div", { className: "rc-macbook", style: It, "aria-hidden": "true", children: [
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
- at && eo && !Z && /* @__PURE__ */ w(
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: eo,
1544
+ style: Jt,
1579
1545
  onMouseDown: (e) => e.stopPropagation(),
1580
1546
  onTouchStart: (e) => e.stopPropagation(),
1581
1547
  onTouchEnd: (e) => {
1582
- e.stopPropagation(), e.preventDefault(), k.current?.pressButton("home");
1548
+ e.stopPropagation(), e.preventDefault(), N.current?.pressButton("home");
1583
1549
  },
1584
1550
  onClick: (e) => {
1585
- e.stopPropagation(), k.current?.pressButton("home");
1551
+ e.stopPropagation(), N.current?.pressButton("home");
1586
1552
  }
1587
1553
  }
1588
1554
  ),
1589
1555
  /* @__PURE__ */ w(
1590
1556
  "video",
1591
1557
  {
1592
- ref: C,
1558
+ ref: R,
1593
1559
  className: [
1594
1560
  "rc-video",
1595
- !at && !pe && "rc-video-frameless",
1596
- !Do && (K === "macos" ? "rc-video-loading-desktop" : "rc-video-loading")
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
- ...Uo,
1600
- ...F || we ? { opacity: 0, width: 1, height: 1, pointerEvents: "none" } : {},
1601
- ...mo ? {
1602
- backgroundImage: `url("${mo}")`,
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: He.loadingLogoSize
1571
+ backgroundSize: _e.loadingLogoSize
1606
1572
  } : {}
1607
1573
  },
1608
1574
  autoPlay: !0,
1609
1575
  playsInline: !0,
1610
1576
  muted: !0,
1611
- tabIndex: F || we ? -1 : 0,
1612
- onKeyDown: Qe,
1613
- onKeyUp: Qe,
1614
- onClick: hn,
1577
+ tabIndex: K || Se ? -1 : 0,
1578
+ onKeyDown: Ge,
1579
+ onKeyUp: Ge,
1580
+ onClick: on,
1615
1581
  onFocus: () => {
1616
- C.current && (C.current.style.outline = "none");
1582
+ R.current && (R.current.style.outline = "none");
1617
1583
  },
1618
1584
  onBlur: () => {
1619
- C.current && (C.current.style.outline = "none"), lt();
1585
+ R.current && (R.current.style.outline = "none"), rt();
1620
1586
  }
1621
1587
  }
1622
1588
  ),
1623
- en && io && /* @__PURE__ */ w(No, { fallback: null, children: /* @__PURE__ */ w(
1624
- Qn,
1589
+ zo && to && /* @__PURE__ */ w(Mo, { fallback: null, children: /* @__PURE__ */ w(
1590
+ Fn,
1625
1591
  {
1626
- video: C.current,
1627
- aspect: io,
1628
- model: _ ?? ue?.model,
1592
+ video: R.current,
1593
+ aspect: to,
1594
+ model: I ?? de?.model,
1629
1595
  animateLid: b,
1630
- watchOnly: Z,
1631
- onReady: it.onReady,
1596
+ watchOnly: q,
1597
+ onReady: et.onReady,
1632
1598
  pointer: (e, n, i, o) => {
1633
- const c = C.current;
1634
- !c?.videoWidth || !k.current?.getState().controlReady || We.pointer(
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 = C.current;
1647
- !c?.videoWidth || !k.current?.getState().controlReady || We.scroll(
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: Qe,
1659
- onKeyUp: Qe,
1660
- onBlur: lt
1624
+ onKeyDown: Ge,
1625
+ onKeyUp: Ge,
1626
+ onBlur: rt
1661
1627
  }
1662
1628
  ) }),
1663
- pe && /* @__PURE__ */ w(Bn, { view: it, label: "MacBook rendering" }),
1664
- F && /* @__PURE__ */ w(
1629
+ pe && /* @__PURE__ */ w(Hn, { view: et, label: "MacBook rendering" }),
1630
+ K && /* @__PURE__ */ w(
1665
1631
  "video",
1666
1632
  {
1667
- ref: Ve,
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
- F && Gt && /* @__PURE__ */ w(No, { fallback: /* @__PURE__ */ w("div", { children: "Loading iPhone Duo…" }), children: /* @__PURE__ */ w(
1675
- Jn,
1640
+ K && Ft && /* @__PURE__ */ w(Mo, { fallback: /* @__PURE__ */ w("div", { children: "Loading iPhone Duo…" }), children: /* @__PURE__ */ w(
1641
+ zn,
1676
1642
  {
1677
- watchOnly: Z,
1678
- showFrame: f,
1679
- model: N ?? ue?.model,
1680
- outer: C.current,
1681
- inner: Ve.current,
1682
- state: Gt,
1683
- setAngle: (e) => Dt("setHingeAngle", { angleDegrees: e }),
1684
- setOrientation: (e) => Dt("setDuoOrientation", { orientation: e }),
1685
- button: (e, n) => Dt("performActions", {
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
- k.current?.sendDisplayTouch(e, n, i, o);
1655
+ N.current?.sendDisplayTouch(e, n, i, o);
1690
1656
  },
1691
- onKeyDown: Qe,
1692
- onKeyUp: Qe
1657
+ onKeyDown: Ge,
1658
+ onKeyUp: Ge
1693
1659
  }
1694
1660
  ) }),
1695
- F && jt && /* @__PURE__ */ w("div", { role: "alert", className: "rc-duo-error", children: jt }),
1696
- !F && Pe && /* @__PURE__ */ w(
1697
- qn,
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: co,
1700
- geometry: jo,
1665
+ snapshot: no,
1666
+ geometry: Xo,
1701
1667
  highlightedId: Pt,
1702
1668
  selectedId: Ht,
1703
- mode: Jo,
1704
- cursorPosition: qo,
1705
- frozenCursorPosition: Zo,
1669
+ mode: Uo,
1670
+ cursorPosition: $o,
1671
+ frozenCursorPosition: Bo,
1706
1672
  onSelectChange: (e, n) => {
1707
- gt(e?.id ?? null), e && n ? Ge(n) : e || Ge(null);
1708
- const i = xe.current;
1709
- e && i ? nt("onInspectSelectionChange", je.current, {
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
- }) : nt("onInspectSelectionChange", je.current, null);
1678
+ }) : Qe("onInspectSelectionChange", Ke.current, null);
1713
1679
  },
1714
- onTapElement: Z ? void 0 : ((e, n) => {
1680
+ onTapElement: q ? void 0 : ((e, n) => {
1715
1681
  if (n) {
1716
- bo(n.x, n.y);
1682
+ po(n.x, n.y);
1717
1683
  return;
1718
1684
  }
1719
- const i = xe.current;
1720
- i && tn(e, i);
1685
+ const i = Ne.current;
1686
+ i && Fo(e, i);
1721
1687
  })
1722
1688
  }
1723
1689
  ),
1724
- $o ? /* @__PURE__ */ ee("div", { className: "rc-terminated", role: "status", children: [
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
- ] }) : Yo && /* @__PURE__ */ w("button", { type: "button", className: "rc-retry-button", onClick: un, children: "Retry" })
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
- Bn as D,
1735
- ui as M,
1736
- vi as R,
1737
- li as a,
1738
- di as b,
1739
- hi as c,
1740
- mi as d,
1741
- gi as e,
1742
- fi as l,
1743
- pi as m,
1744
- yi as s,
1745
- $n as u
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
  };