review-lens-react 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,132 +1,184 @@
1
- import { jsx as r, jsxs as o, Fragment as re } from "react/jsx-runtime";
2
- import { createContext as st, useMemo as ie, useState as k, useCallback as W, useEffect as _, useContext as ot, useRef as We, useLayoutEffect as lt } from "react";
3
- const ct = [
1
+ import { jsx as i, jsxs as s, Fragment as ae } from "react/jsx-runtime";
2
+ import { createContext as gt, useMemo as oe, useState as x, useCallback as D, useEffect as P, useContext as ft, useRef as re, useLayoutEffect as wt } from "react";
3
+ const Be = [
4
4
  "https://www.googleapis.com/auth/spreadsheets",
5
5
  "https://www.googleapis.com/auth/userinfo.email"
6
- ].join(" "), dt = "https://www.googleapis.com/oauth2/v3/userinfo";
7
- function ht(e) {
8
- const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", i = e.usersSheetName ?? "Users";
9
- let s, c;
6
+ ], vt = "https://www.googleapis.com/auth/gmail.send", Pe = "https://www.googleapis.com/oauth2/v3/userinfo", bt = "https://gmail.googleapis.com/gmail/v1/users/me/messages/send", yt = "review-lens-google-token", kt = 6e4;
7
+ function St(e) {
8
+ const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users", o = e.enableEmailNotifications ? [...Be, vt].join(" ") : Be.join(" "), c = $t(e.googleClientId, o);
9
+ let u, w;
10
10
  async function g() {
11
- return s ?? (s = St(e.googleClientId)), s;
11
+ const p = Mt(c);
12
+ if (p)
13
+ return p.accessToken;
14
+ u ?? (u = Tt(e.googleClientId, o).then((h) => (Bt(c, h), h)));
15
+ const v = await u;
16
+ return Date.now() >= v.expiresAt ? (u = void 0, g()) : v.accessToken;
12
17
  }
13
- async function f(d, v, h) {
14
- const b = await g(), C = await fetch(
15
- `https://sheets.googleapis.com/v4/spreadsheets/${d}${v}`,
18
+ async function b(p, v, h) {
19
+ const k = await g(), l = await fetch(
20
+ `https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
16
21
  {
17
22
  ...h,
18
23
  headers: {
19
- Authorization: `Bearer ${b}`,
24
+ Authorization: `Bearer ${k}`,
20
25
  "Content-Type": "application/json",
21
26
  ...h == null ? void 0 : h.headers
22
27
  }
23
28
  }
24
29
  );
25
- if (!C.ok)
26
- throw new Error(`Google Sheets request failed with ${C.status}`);
27
- return C.json();
30
+ if (l.status === 401) {
31
+ De(c), u = void 0;
32
+ const C = await g(), f = await fetch(
33
+ `https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
34
+ {
35
+ ...h,
36
+ headers: {
37
+ Authorization: `Bearer ${C}`,
38
+ "Content-Type": "application/json",
39
+ ...h == null ? void 0 : h.headers
40
+ }
41
+ }
42
+ );
43
+ if (!f.ok)
44
+ throw new Error(`Google Sheets request failed with ${f.status}`);
45
+ return f.json();
46
+ }
47
+ if (!l.ok)
48
+ throw new Error(`Google Sheets request failed with ${l.status}`);
49
+ return l.json();
28
50
  }
29
- async function p(d, v) {
30
- return (await f(
31
- d,
51
+ async function A(p, v) {
52
+ return (await b(
53
+ p,
32
54
  `/values/${encodeURIComponent(v)}`
33
55
  )).values ?? [];
34
56
  }
35
57
  return {
36
58
  async getCurrentUser() {
37
- if (!c) {
38
- const d = await g(), v = await fetch(dt, {
39
- headers: { Authorization: `Bearer ${d}` }
40
- });
41
- if (!v.ok)
42
- throw new Error(`Google userinfo request failed with ${v.status}`);
43
- c = (await v.json()).email;
44
- }
45
- if (!c)
59
+ if (w || (w = await L()), !w)
46
60
  throw new Error("Google account did not return an email address");
47
- return { email: c };
61
+ return { email: w };
48
62
  },
49
- async getPermissions(d) {
63
+ async getPermissions(p) {
50
64
  const [{ email: v }, h] = await Promise.all([
51
65
  this.getCurrentUser(),
52
- p(e.usersSpreadsheetId, i)
53
- ]), b = ce(h), C = v.toLowerCase(), E = b.find(
54
- (A) => {
55
- var u;
56
- return ((u = A.email) == null ? void 0 : u.toLowerCase()) === C && A.active !== "false" && (!A.projectKey || A.projectKey === d);
66
+ A(e.usersSpreadsheetId, r)
67
+ ]), k = ue(h), l = v.toLowerCase(), C = k.find(
68
+ (f) => {
69
+ var y;
70
+ return ((y = f.email) == null ? void 0 : y.toLowerCase()) === l && f.active !== "false" && (!f.projectKey || f.projectKey === p);
57
71
  }
58
72
  );
59
- return gt((E == null ? void 0 : E.role) ?? "designer");
73
+ return Et((C == null ? void 0 : C.role) ?? "designer");
60
74
  },
61
- async listFeedback(d) {
62
- return ce(await p(e.contentSpreadsheetId, t)).map(Re).filter((h) => h !== null).filter(
63
- (h) => h.projectKey === d.projectKey && h.contentId === d.contentId && h.normalizedPath === d.normalizedPath
64
- ).sort((h, b) => b.createdAt.localeCompare(h.createdAt));
75
+ async listFeedback(p) {
76
+ return ue(await A(e.contentSpreadsheetId, t)).map(Ue).filter((h) => h !== null).filter(
77
+ (h) => h.projectKey === p.projectKey && h.contentId === p.contentId && h.normalizedPath === p.normalizedPath
78
+ ).sort((h, k) => k.createdAt.localeCompare(h.createdAt));
65
79
  },
66
- async createFeedback(d) {
80
+ async createFeedback(p) {
67
81
  const v = (/* @__PURE__ */ new Date()).toISOString(), h = {
68
- ...d,
82
+ ...p,
69
83
  id: crypto.randomUUID(),
70
84
  attachments: [],
71
85
  createdAt: v,
72
86
  updatedAt: v
73
87
  };
74
- return await f(
88
+ return await b(
75
89
  e.contentSpreadsheetId,
76
90
  `/values/${encodeURIComponent(t)}:append?valueInputOption=RAW`,
77
91
  {
78
92
  method: "POST",
79
- body: JSON.stringify({ values: [Te(h)] })
93
+ body: JSON.stringify({ values: [je(h)] })
80
94
  }
81
95
  ), h;
82
96
  },
83
- async updateFeedback(d, v) {
84
- const h = await p(e.contentSpreadsheetId, t), b = h[0] ?? Me, C = b.indexOf("id");
85
- if (C === -1)
97
+ async updateFeedback(p, v) {
98
+ const h = await A(e.contentSpreadsheetId, t), k = h[0] ?? _e, l = k.indexOf("id");
99
+ if (l === -1)
86
100
  throw new Error(`Sheet ${t} is missing an id column`);
87
- const E = h.findIndex((w, N) => N > 0 && w[C] === d);
88
- if (E < 1)
89
- throw new Error(`Feedback ${d} was not found`);
90
- const A = (/* @__PURE__ */ new Date()).toISOString(), u = Re(De(b, h[E]));
91
- if (!u)
92
- throw new Error(`Feedback ${d} could not be parsed before updating`);
93
- const R = {
94
- ...u,
101
+ const C = h.findIndex((M, j) => j > 0 && M[l] === p);
102
+ if (C < 1)
103
+ throw new Error(`Feedback ${p} was not found`);
104
+ const f = (/* @__PURE__ */ new Date()).toISOString(), y = Ue(Oe(k, h[C]));
105
+ if (!y)
106
+ throw new Error(`Feedback ${p} could not be parsed before updating`);
107
+ const N = {
108
+ ...y,
95
109
  ...v,
96
- updatedAt: A
97
- }, y = Te(R);
98
- return await f(
110
+ updatedAt: f
111
+ }, F = je(N);
112
+ return await b(
99
113
  e.contentSpreadsheetId,
100
- `/values/${encodeURIComponent(t)}!A${E + 1}:${yt(
101
- Me.length
102
- )}${E + 1}?valueInputOption=RAW`,
114
+ `/values/${encodeURIComponent(t)}!A${C + 1}:${It(
115
+ _e.length
116
+ )}${C + 1}?valueInputOption=RAW`,
103
117
  {
104
118
  method: "PUT",
105
- body: JSON.stringify({ values: [y] })
119
+ body: JSON.stringify({ values: [F] })
106
120
  }
107
- ), R;
121
+ ), N;
108
122
  },
109
- async listMessages(d) {
110
- return ce(await p(e.contentSpreadsheetId, n)).map(mt).filter((h) => h !== null).filter((h) => h.feedbackId === d).sort((h, b) => h.createdAt.localeCompare(b.createdAt));
123
+ async listMessages(p) {
124
+ return ue(await A(e.contentSpreadsheetId, n)).map(Ct).filter((h) => h !== null).filter((h) => h.feedbackId === p).sort((h, k) => h.createdAt.localeCompare(k.createdAt));
111
125
  },
112
- async createMessage(d) {
126
+ async createMessage(p) {
113
127
  const v = {
114
- ...d,
128
+ ...p,
115
129
  id: crypto.randomUUID(),
116
130
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
117
131
  };
118
- return await f(
132
+ return await b(
119
133
  e.contentSpreadsheetId,
120
134
  `/values/${encodeURIComponent(n)}:append?valueInputOption=RAW`,
121
135
  {
122
136
  method: "POST",
123
- body: JSON.stringify({ values: [pt(v)] })
137
+ body: JSON.stringify({ values: [Nt(v)] })
124
138
  }
125
139
  ), v;
140
+ },
141
+ async sendEmail(p) {
142
+ if (!e.enableEmailNotifications || p.to.length === 0)
143
+ return;
144
+ const v = await g(), h = await this.getCurrentUser(), k = await fetch(bt, {
145
+ method: "POST",
146
+ headers: {
147
+ Authorization: `Bearer ${v}`,
148
+ "Content-Type": "application/json"
149
+ },
150
+ body: JSON.stringify({
151
+ raw: _t({
152
+ from: h.email,
153
+ to: p.to,
154
+ subject: p.subject,
155
+ text: p.text
156
+ })
157
+ })
158
+ });
159
+ if (!k.ok)
160
+ throw new Error(`Gmail send request failed with ${k.status}`);
126
161
  }
127
162
  };
163
+ async function L() {
164
+ const p = await fetch(Pe, {
165
+ headers: { Authorization: `Bearer ${await g()}` }
166
+ });
167
+ if (p.status === 401) {
168
+ De(c), u = void 0;
169
+ const h = await fetch(Pe, {
170
+ headers: { Authorization: `Bearer ${await g()}` }
171
+ });
172
+ if (!h.ok)
173
+ throw new Error(`Google userinfo request failed with ${h.status}`);
174
+ return (await h.json()).email;
175
+ }
176
+ if (!p.ok)
177
+ throw new Error(`Google userinfo request failed with ${p.status}`);
178
+ return (await p.json()).email;
179
+ }
128
180
  }
129
- const Me = [
181
+ const _e = [
130
182
  "id",
131
183
  "projectKey",
132
184
  "contentId",
@@ -155,8 +207,8 @@ const Me = [
155
207
  "fixedBy",
156
208
  "resolvedAt",
157
209
  "resolvedBy"
158
- ], ut = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
159
- function Te(e) {
210
+ ], xt = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
211
+ function je(e) {
160
212
  return [
161
213
  e.id,
162
214
  e.projectKey,
@@ -188,17 +240,17 @@ function Te(e) {
188
240
  e.resolvedBy ?? ""
189
241
  ];
190
242
  }
191
- function pt(e) {
192
- return ut.map((t) => e[t]);
243
+ function Nt(e) {
244
+ return xt.map((t) => e[t]);
193
245
  }
194
- function ce(e) {
246
+ function ue(e) {
195
247
  const [t, ...n] = e;
196
- return t ? n.map((i) => De(t, i)) : [];
248
+ return t ? n.map((r) => Oe(t, r)) : [];
197
249
  }
198
- function De(e, t) {
199
- return Object.fromEntries(e.map((n, i) => [n, t[i] ?? ""]));
250
+ function Oe(e, t) {
251
+ return Object.fromEntries(e.map((n, r) => [n, t[r] ?? ""]));
200
252
  }
201
- function Re(e) {
253
+ function Ue(e) {
202
254
  return e.id ? {
203
255
  id: e.id,
204
256
  projectKey: e.projectKey,
@@ -207,24 +259,24 @@ function Re(e) {
207
259
  originalUrl: e.originalUrl,
208
260
  selector: e.selector,
209
261
  selectorStrategy: e.selectorStrategy === "stable-attribute" ? "stable-attribute" : "css-path",
210
- elementFingerprint: ue(e.elementFingerprintJson, {
262
+ elementFingerprint: fe(e.elementFingerprintJson, {
211
263
  tagName: "",
212
264
  width: 0,
213
265
  height: 0
214
266
  }),
215
- createdCssSnapshot: Be(e.createdCssSnapshotJson),
216
- fixedCssSnapshot: e.fixedCssSnapshotJson ? Be(e.fixedCssSnapshotJson) : void 0,
267
+ createdCssSnapshot: We(e.createdCssSnapshotJson),
268
+ fixedCssSnapshot: e.fixedCssSnapshotJson ? We(e.fixedCssSnapshotJson) : void 0,
217
269
  comment: e.comment,
218
- status: ft(e.status),
219
- severity: bt(e.severity),
220
- category: vt(e.category),
270
+ status: Lt(e.status),
271
+ severity: At(e.severity),
272
+ category: Ft(e.category),
221
273
  assigneeEmail: e.assigneeEmail || void 0,
222
274
  viewportWidth: Number(e.viewportWidth) || 0,
223
275
  viewportHeight: Number(e.viewportHeight) || 0,
224
- viewportPreset: wt(e.viewportPreset),
276
+ viewportPreset: Rt(e.viewportPreset),
225
277
  screenshotUrl: e.screenshotUrl || void 0,
226
278
  screenshotThumbnailUrl: e.screenshotThumbnailUrl || void 0,
227
- attachments: ue(e.attachmentJson, []),
279
+ attachments: fe(e.attachmentJson, []),
228
280
  authorEmail: e.authorEmail,
229
281
  createdAt: e.createdAt,
230
282
  updatedAt: e.updatedAt,
@@ -234,7 +286,7 @@ function Re(e) {
234
286
  resolvedBy: e.resolvedBy || void 0
235
287
  } : null;
236
288
  }
237
- function mt(e) {
289
+ function Ct(e) {
238
290
  return !e.id || !e.feedbackId ? null : {
239
291
  id: e.id,
240
292
  feedbackId: e.feedbackId,
@@ -243,15 +295,15 @@ function mt(e) {
243
295
  createdAt: e.createdAt
244
296
  };
245
297
  }
246
- function ue(e, t) {
298
+ function fe(e, t) {
247
299
  try {
248
300
  return e ? JSON.parse(e) : t;
249
301
  } catch {
250
302
  return t;
251
303
  }
252
304
  }
253
- function Be(e) {
254
- const t = ue(e, {});
305
+ function We(e) {
306
+ const t = fe(e, {});
255
307
  return {
256
308
  margin: t.margin ?? "",
257
309
  marginTop: t.marginTop ?? "",
@@ -278,215 +330,351 @@ function Be(e) {
278
330
  height: t.height ?? 0
279
331
  };
280
332
  }
281
- function gt(e) {
333
+ function Et(e) {
282
334
  return e === "admin" ? ["create", "read", "reply", "update", "assign"] : e === "developer" ? ["read", "reply", "update", "assign"] : ["create", "read", "reply"];
283
335
  }
284
- function ft(e) {
336
+ function Lt(e) {
285
337
  return e === "in_progress" || e === "needs_clarification" || e === "fixed" || e === "wontfix" || e === "resolved" ? e : "open";
286
338
  }
287
- function bt(e) {
339
+ function At(e) {
288
340
  return e === "low" || e === "high" ? e : "medium";
289
341
  }
290
- function vt(e) {
342
+ function Ft(e) {
291
343
  return e === "visual" || e === "copy" || e === "accessibility" || e === "responsive" ? e : "bug";
292
344
  }
293
- function wt(e) {
345
+ function Rt(e) {
294
346
  return e === "mobile" || e === "tablet" || e === "desktop" ? e : "custom";
295
347
  }
296
- function yt(e) {
348
+ function It(e) {
297
349
  let t = e, n = "";
298
350
  for (; t > 0; ) {
299
- const i = (t - 1) % 26;
300
- n = String.fromCharCode(65 + i) + n, t = Math.floor((t - i) / 26);
351
+ const r = (t - 1) % 26;
352
+ n = String.fromCharCode(65 + r) + n, t = Math.floor((t - r) / 26);
301
353
  }
302
354
  return n;
303
355
  }
304
- async function St(e) {
305
- return await kt(), new Promise((t, n) => {
306
- var s;
307
- const i = (s = window.google) == null ? void 0 : s.accounts.oauth2.initTokenClient({
356
+ async function Tt(e, t) {
357
+ return await Pt(), new Promise((n, r) => {
358
+ var c;
359
+ const o = (c = window.google) == null ? void 0 : c.accounts.oauth2.initTokenClient({
308
360
  client_id: e,
309
- scope: ct,
310
- callback: (c) => {
311
- if (c.error || !c.access_token) {
312
- n(new Error(c.error ?? "Google OAuth did not return an access token"));
361
+ scope: t,
362
+ callback: (u) => {
363
+ if (u.error || !u.access_token) {
364
+ r(new Error(u.error ?? "Google OAuth did not return an access token"));
313
365
  return;
314
366
  }
315
- t(c.access_token);
367
+ const w = u.expires_in ?? 3600;
368
+ n({
369
+ accessToken: u.access_token,
370
+ expiresAt: Date.now() + w * 1e3
371
+ });
316
372
  }
317
373
  });
318
- i == null || i.requestAccessToken({ prompt: "" });
374
+ o == null || o.requestAccessToken({ prompt: "" });
319
375
  });
320
376
  }
321
- function kt() {
377
+ function $t(e, t) {
378
+ return `${yt}:${e}:${t}`;
379
+ }
380
+ function Mt(e) {
381
+ try {
382
+ const t = window.localStorage.getItem(e);
383
+ if (!t)
384
+ return;
385
+ const n = JSON.parse(t);
386
+ if (typeof n.accessToken != "string" || typeof n.expiresAt != "number" || Date.now() >= n.expiresAt - kt) {
387
+ window.localStorage.removeItem(e);
388
+ return;
389
+ }
390
+ return n;
391
+ } catch {
392
+ return;
393
+ }
394
+ }
395
+ function Bt(e, t) {
396
+ try {
397
+ window.localStorage.setItem(e, JSON.stringify(t));
398
+ } catch {
399
+ }
400
+ }
401
+ function De(e) {
402
+ try {
403
+ window.localStorage.removeItem(e);
404
+ } catch {
405
+ }
406
+ }
407
+ function Pt() {
322
408
  var e;
323
409
  return (e = window.google) != null && e.accounts.oauth2 ? Promise.resolve() : new Promise((t, n) => {
324
- const i = document.querySelector(
410
+ const r = document.querySelector(
325
411
  'script[src="https://accounts.google.com/gsi/client"]'
326
412
  );
327
- if (i) {
328
- i.addEventListener("load", () => t(), { once: !0 }), i.addEventListener("error", () => n(new Error("Google Identity failed to load")), {
413
+ if (r) {
414
+ r.addEventListener("load", () => t(), { once: !0 }), r.addEventListener("error", () => n(new Error("Google Identity failed to load")), {
329
415
  once: !0
330
416
  });
331
417
  return;
332
418
  }
333
- const s = document.createElement("script");
334
- s.src = "https://accounts.google.com/gsi/client", s.async = !0, s.defer = !0, s.onload = () => t(), s.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(s);
419
+ const o = document.createElement("script");
420
+ o.src = "https://accounts.google.com/gsi/client", o.async = !0, o.defer = !0, o.onload = () => t(), o.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(o);
335
421
  });
336
422
  }
337
- function Ct(e) {
423
+ function _t(e) {
424
+ const t = [
425
+ `From: ${e.from}`,
426
+ `To: ${e.to.join(", ")}`,
427
+ `Subject: ${e.subject}`,
428
+ "Content-Type: text/plain; charset=UTF-8",
429
+ "",
430
+ e.text
431
+ ].join(`\r
432
+ `);
433
+ return jt(t);
434
+ }
435
+ function jt(e) {
436
+ const t = new TextEncoder().encode(e);
437
+ let n = "";
438
+ return t.forEach((r) => {
439
+ n += String.fromCharCode(r);
440
+ }), btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
441
+ }
442
+ function Ut(e) {
338
443
  return new URL(e, window.location.href).pathname.replace(/\/+$/, "") || "/";
339
444
  }
340
- const ze = st(null);
341
- function Qt({ config: e, children: t }) {
342
- const n = ie(() => e.adapter ? e.adapter : ht({
343
- googleClientId: de(e.googleClientId, "googleClientId"),
344
- contentSpreadsheetId: de(e.contentSpreadsheetId, "contentSpreadsheetId"),
345
- usersSpreadsheetId: de(e.usersSpreadsheetId, "usersSpreadsheetId"),
346
- feedbackSheetName: e.sheetName ?? "Feedback"
445
+ const Ge = gt(null);
446
+ function xn({ config: e, children: t }) {
447
+ const n = oe(() => e.adapter ? e.adapter : St({
448
+ googleClientId: me(e.googleClientId, "googleClientId"),
449
+ contentSpreadsheetId: me(e.contentSpreadsheetId, "contentSpreadsheetId"),
450
+ usersSpreadsheetId: me(e.usersSpreadsheetId, "usersSpreadsheetId"),
451
+ feedbackSheetName: e.sheetName ?? "Feedback",
452
+ enableEmailNotifications: qe(e)
347
453
  }), [
348
454
  e.adapter,
349
455
  e.contentSpreadsheetId,
456
+ e.emailNotifications,
350
457
  e.googleClientId,
351
458
  e.sheetName,
352
459
  e.usersSpreadsheetId
353
- ]), i = e.currentUrl ?? window.location.href, s = (e.normalizeUrl ?? Ct)(i), [c, g] = k(), [f, p] = k([]), [d, v] = k([]), h = W(async () => {
354
- const y = await n.listFeedback({
460
+ ]), r = e.currentUrl ?? window.location.href, o = (e.normalizeUrl ?? Ut)(r), [c, u] = x(), [w, g] = x([]), [b, A] = x([]), L = D(async () => {
461
+ const f = await n.listFeedback({
355
462
  projectKey: e.projectKey,
356
463
  contentId: e.contentId,
357
- normalizedPath: s
464
+ normalizedPath: o
358
465
  });
359
- v(y);
360
- }, [n, e.contentId, e.projectKey, s]);
361
- _(() => {
362
- let y = !0;
363
- async function w() {
364
- const [N, B] = await Promise.all([
466
+ A(f);
467
+ }, [n, e.contentId, e.projectKey, o]);
468
+ P(() => {
469
+ let f = !0;
470
+ async function y() {
471
+ const [N, F] = await Promise.all([
365
472
  n.getCurrentUser(),
366
473
  n.getPermissions(e.projectKey)
367
474
  ]);
368
- y && (g(N), p(B), await h());
475
+ f && (u(N), g(F), await L());
369
476
  }
370
- return w(), () => {
371
- y = !1;
477
+ return y(), () => {
478
+ f = !1;
372
479
  };
373
- }, [n, e.projectKey, h]);
374
- const b = W(
375
- async (y) => {
376
- const w = await n.createFeedback(y);
377
- return v((N) => [w, ...N]), w;
480
+ }, [n, e.projectKey, L]);
481
+ const p = D(
482
+ async (f) => {
483
+ const y = await n.createFeedback(f);
484
+ return A((N) => [y, ...N]), pe(e, n, {
485
+ actorEmail: (c == null ? void 0 : c.email) ?? f.authorEmail,
486
+ item: y,
487
+ kind: "created"
488
+ }), y;
378
489
  },
379
- [n]
380
- ), C = W(
381
- async (y, w) => {
382
- const N = await n.updateFeedback(y, w);
383
- return v(
384
- (B) => B.map((D) => D.id === y ? N : D)
385
- ), N;
490
+ [n, e, c == null ? void 0 : c.email]
491
+ ), v = D(
492
+ async (f, y) => {
493
+ const N = b.find((M) => M.id === f), F = await n.updateFeedback(f, y);
494
+ return A(
495
+ (M) => M.map((j) => j.id === f ? F : j)
496
+ ), pe(e, n, {
497
+ actorEmail: c == null ? void 0 : c.email,
498
+ item: F,
499
+ kind: Dt(y),
500
+ previousItem: N
501
+ }), F;
386
502
  },
503
+ [n, e, c == null ? void 0 : c.email, b]
504
+ ), h = D(
505
+ (f) => n.listMessages(f),
387
506
  [n]
388
- ), E = W(
389
- (y) => n.listMessages(y),
390
- [n]
391
- ), A = W(
392
- (y) => n.createMessage(y),
393
- [n]
394
- ), u = W(
395
- async (y, w) => {
507
+ ), k = D(
508
+ async (f) => {
509
+ const y = await n.createMessage(f), N = b.find((F) => F.id === f.feedbackId);
510
+ return N && pe(e, n, {
511
+ actorEmail: f.authorEmail,
512
+ item: N,
513
+ kind: "reply",
514
+ replyBody: f.body
515
+ }), y;
516
+ },
517
+ [n, e, b]
518
+ ), l = D(
519
+ async (f, y) => {
396
520
  const N = e.uploadAttachment ?? n.uploadAttachment;
397
521
  if (!N)
398
522
  throw new Error("Review Lens attachment upload is not configured");
399
- return N(y, w);
523
+ return N(f, y);
400
524
  },
401
525
  [n, e]
402
- ), R = ie(
526
+ ), C = oe(
403
527
  () => ({
404
528
  config: e,
405
529
  adapter: n,
406
530
  currentUser: c,
407
- permissions: f,
408
- feedback: d,
409
- normalizedPath: s,
410
- refreshFeedback: h,
411
- createFeedback: b,
412
- updateFeedback: C,
413
- listMessages: E,
414
- createMessage: A,
415
- uploadAttachment: u
531
+ permissions: w,
532
+ feedback: b,
533
+ normalizedPath: o,
534
+ refreshFeedback: L,
535
+ createFeedback: p,
536
+ updateFeedback: v,
537
+ listMessages: h,
538
+ createMessage: k,
539
+ uploadAttachment: l
416
540
  }),
417
541
  [
418
542
  n,
419
543
  e,
420
- b,
544
+ p,
421
545
  c,
422
- d,
423
- s,
424
- f,
546
+ b,
547
+ o,
548
+ w,
549
+ L,
550
+ v,
425
551
  h,
426
- C,
427
- E,
428
- A,
429
- u
552
+ k,
553
+ l
430
554
  ]
431
555
  );
432
- return /* @__PURE__ */ r(ze.Provider, { value: R, children: t });
556
+ return /* @__PURE__ */ i(Ge.Provider, { value: C, children: t });
433
557
  }
434
- function Nt() {
435
- const e = ot(ze);
558
+ function Wt() {
559
+ const e = ft(Ge);
436
560
  if (!e)
437
561
  throw new Error("useReviewLens must be used inside ReviewLensProvider");
438
562
  return e;
439
563
  }
440
- function de(e, t) {
564
+ function me(e, t) {
441
565
  if (!e)
442
566
  throw new Error(`review-lens-react requires config.${t} when no adapter is provided`);
443
567
  return e;
444
568
  }
445
- const xt = [
569
+ function qe(e) {
570
+ return typeof e.emailNotifications == "object" ? e.emailNotifications.enabled !== !1 : !!e.emailNotifications;
571
+ }
572
+ function Dt(e) {
573
+ return e.status === "resolved" ? "resolved" : e.status === "fixed" || e.fixedAt || e.fixedBy ? "fixed" : e.status ? "status" : "assigneeEmail" in e ? "assigned" : "updated";
574
+ }
575
+ async function pe(e, t, n) {
576
+ if (!qe(e) || !t.sendEmail)
577
+ return;
578
+ const r = zt(n);
579
+ if (r.length !== 0)
580
+ try {
581
+ await t.sendEmail({
582
+ to: r,
583
+ subject: Ht(e, n),
584
+ text: Kt(n)
585
+ });
586
+ } catch (o) {
587
+ console.warn("Review Lens email notification failed", o);
588
+ }
589
+ }
590
+ function zt(e) {
591
+ var n;
592
+ const t = /* @__PURE__ */ new Set();
593
+ return t.add(e.item.authorEmail), (n = e.previousItem) != null && n.assigneeEmail && t.add(e.previousItem.assigneeEmail), e.item.assigneeEmail && t.add(e.item.assigneeEmail), [...t].filter((r) => {
594
+ var o;
595
+ return r ? r.toLowerCase() !== ((o = e.actorEmail) == null ? void 0 : o.toLowerCase()) : !1;
596
+ });
597
+ }
598
+ function Ht(e, t) {
599
+ return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${Ve(t)}`;
600
+ }
601
+ function Kt(e) {
602
+ const t = [
603
+ "[Review Lens]",
604
+ Ve(e),
605
+ Jt(e),
606
+ "",
607
+ `Review: ${e.item.comment}`,
608
+ `Status: ${Ye(e.item.status)}`,
609
+ `Author: ${e.item.authorEmail}`,
610
+ `Assignee: ${e.item.assigneeEmail ?? "Unassigned"}`,
611
+ `Link: ${Ot(e.item)}`
612
+ ];
613
+ return e.replyBody && t.splice(2, 0, `Reply: ${e.replyBody}`, ""), t.join(`
614
+ `);
615
+ }
616
+ function Jt(e) {
617
+ return e.actorEmail ? `Sent by Review Lens on behalf of ${e.actorEmail}.` : "Sent by Review Lens on behalf of the signed-in Google user.";
618
+ }
619
+ function Ve(e) {
620
+ return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${Ye(e.item.status)}` : e.kind === "fixed" ? "Review marked fixed" : e.kind === "resolved" ? "Review resolved" : e.kind === "reply" ? "New review reply" : "Review updated";
621
+ }
622
+ function Ot(e) {
623
+ try {
624
+ const t = new URL(e.originalUrl);
625
+ return t.searchParams.set("reviewLensFeedback", e.id), t.toString();
626
+ } catch {
627
+ return e.originalUrl;
628
+ }
629
+ }
630
+ function Ye(e) {
631
+ return e.replace(/_/g, " ");
632
+ }
633
+ const Gt = [
446
634
  "data-review-id",
447
635
  "data-testid",
448
636
  "data-test-id",
449
637
  "aria-label",
450
638
  "name"
451
639
  ];
452
- function X(e) {
453
- const t = e.getBoundingClientRect(), n = Et(e);
640
+ function Q(e) {
641
+ const t = e.getBoundingClientRect(), n = qt(e);
454
642
  return {
455
643
  selector: n.selector,
456
644
  selectorStrategy: n.strategy,
457
- fingerprint: It(e, t),
458
- cssSnapshot: Lt(e, t),
645
+ fingerprint: Yt(e, t),
646
+ cssSnapshot: Xt(e, t),
459
647
  rect: t
460
648
  };
461
649
  }
462
- function Et(e) {
463
- for (const t of xt) {
650
+ function qt(e) {
651
+ for (const t of Gt) {
464
652
  const n = e.getAttribute(t);
465
653
  if (n)
466
654
  return {
467
- selector: `[${t}="${$e(n)}"]`,
655
+ selector: `[${t}="${ze(n)}"]`,
468
656
  strategy: "stable-attribute"
469
657
  };
470
658
  }
471
- return e.id ? { selector: `#${$e(e.id)}`, strategy: "stable-attribute" } : { selector: At(e), strategy: "css-path" };
659
+ return e.id ? { selector: `#${ze(e.id)}`, strategy: "stable-attribute" } : { selector: Vt(e), strategy: "css-path" };
472
660
  }
473
- function At(e) {
661
+ function Vt(e) {
474
662
  const t = [];
475
663
  let n = e;
476
664
  for (; n && n.nodeType === Node.ELEMENT_NODE && n !== document.body; ) {
477
- const i = n.parentElement, s = n.tagName.toLowerCase();
478
- if (!i) {
479
- t.unshift(s);
665
+ const r = n.parentElement, o = n.tagName.toLowerCase();
666
+ if (!r) {
667
+ t.unshift(o);
480
668
  break;
481
669
  }
482
- const c = n.tagName, g = Array.from(i.children).filter(
483
- (p) => p.tagName === c
484
- ), f = g.indexOf(n) + 1;
485
- t.unshift(g.length > 1 ? `${s}:nth-of-type(${f})` : s), n = i;
670
+ const c = n.tagName, u = Array.from(r.children).filter(
671
+ (g) => g.tagName === c
672
+ ), w = u.indexOf(n) + 1;
673
+ t.unshift(u.length > 1 ? `${o}:nth-of-type(${w})` : o), n = r;
486
674
  }
487
675
  return t.join(" > ");
488
676
  }
489
- function It(e, t) {
677
+ function Yt(e, t) {
490
678
  var n;
491
679
  return {
492
680
  tagName: e.tagName.toLowerCase(),
@@ -498,15 +686,15 @@ function It(e, t) {
498
686
  height: Math.round(t.height)
499
687
  };
500
688
  }
501
- function Lt(e, t) {
689
+ function Xt(e, t) {
502
690
  const n = window.getComputedStyle(e);
503
691
  return {
504
- margin: he(n.marginTop, n.marginRight, n.marginBottom, n.marginLeft),
692
+ margin: ge(n.marginTop, n.marginRight, n.marginBottom, n.marginLeft),
505
693
  marginTop: n.marginTop,
506
694
  marginRight: n.marginRight,
507
695
  marginBottom: n.marginBottom,
508
696
  marginLeft: n.marginLeft,
509
- padding: he(
697
+ padding: ge(
510
698
  n.paddingTop,
511
699
  n.paddingRight,
512
700
  n.paddingBottom,
@@ -516,7 +704,7 @@ function Lt(e, t) {
516
704
  paddingRight: n.paddingRight,
517
705
  paddingBottom: n.paddingBottom,
518
706
  paddingLeft: n.paddingLeft,
519
- border: he(
707
+ border: ge(
520
708
  n.borderTopWidth,
521
709
  n.borderRightWidth,
522
710
  n.borderBottomWidth,
@@ -536,577 +724,635 @@ function Lt(e, t) {
536
724
  height: Math.round(t.height)
537
725
  };
538
726
  }
539
- function he(e, t, n, i) {
540
- return e === t && t === n && n === i ? e : `${e} ${t} ${n} ${i}`;
727
+ function ge(e, t, n, r) {
728
+ return e === t && t === n && n === r ? e : `${e} ${t} ${n} ${r}`;
541
729
  }
542
- function $e(e) {
730
+ function ze(e) {
543
731
  return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&");
544
732
  }
545
- const Ft = [
733
+ function Qt({ className: e, title: t = "Review Lens logo" }) {
734
+ return /* @__PURE__ */ s(
735
+ "svg",
736
+ {
737
+ className: e,
738
+ role: "img",
739
+ "aria-label": t,
740
+ viewBox: "0 0 40 40",
741
+ fill: "none",
742
+ xmlns: "http://www.w3.org/2000/svg",
743
+ children: [
744
+ /* @__PURE__ */ i("rect", { x: "4", y: "6", width: "28", height: "28", rx: "8", fill: "#171717" }),
745
+ /* @__PURE__ */ i(
746
+ "path",
747
+ {
748
+ d: "M13 15.5C14.5 13.4 17.1 12 20 12C23.9 12 27.3 14.5 28.7 18C27.3 21.5 23.9 24 20 24C17.1 24 14.5 22.6 13 20.5",
749
+ stroke: "#FFFFFF",
750
+ strokeWidth: "2.2",
751
+ strokeLinecap: "round",
752
+ strokeLinejoin: "round"
753
+ }
754
+ ),
755
+ /* @__PURE__ */ i("circle", { cx: "20", cy: "18", r: "3.4", fill: "#F97316" }),
756
+ /* @__PURE__ */ i(
757
+ "path",
758
+ {
759
+ d: "M28.5 26.5L34.5 32.5",
760
+ stroke: "#2563EB",
761
+ strokeWidth: "4",
762
+ strokeLinecap: "round"
763
+ }
764
+ ),
765
+ /* @__PURE__ */ i("circle", { cx: "31.8", cy: "29.8", r: "2.1", fill: "#FACC15", stroke: "#171717", strokeWidth: "1.4" })
766
+ ]
767
+ }
768
+ );
769
+ }
770
+ const Zt = [
546
771
  { label: "Desktop", value: "desktop" },
547
772
  { label: "Tablet", value: "tablet" },
548
773
  { label: "Mobile", value: "mobile" }
549
- ], He = [
774
+ ], Xe = [
550
775
  "open",
551
776
  "in_progress",
552
777
  "needs_clarification",
553
778
  "fixed",
554
779
  "wontfix",
555
780
  "resolved"
556
- ], je = ["low", "medium", "high"], Oe = ["bug", "visual", "copy", "accessibility", "responsive"], ae = {
781
+ ], Qe = ["low", "medium", "high"], Ze = ["bug", "visual", "copy", "accessibility", "responsive"], se = {
557
782
  open: "Open",
558
783
  in_progress: "In progress",
559
784
  needs_clarification: "Needs clarification",
560
785
  fixed: "Fixed",
561
786
  wontfix: "Won't fix",
562
787
  resolved: "Resolved"
563
- }, Q = {
788
+ }, Z = {
564
789
  low: "Low",
565
790
  medium: "Medium",
566
791
  high: "High"
567
- }, Z = {
792
+ }, ee = {
568
793
  bug: "Bug",
569
794
  visual: "Visual",
570
795
  copy: "Copy",
571
796
  accessibility: "Accessibility",
572
797
  responsive: "Responsive"
573
798
  };
574
- function Zt({
799
+ function Nn({
575
800
  open: e,
576
801
  onOpenChange: t,
577
802
  placement: n = "top-right",
578
- showResolved: i = !1,
579
- syncSelectionToUrl: s = !1,
580
- responsivePresets: c = Ft
803
+ showResolved: r = !1,
804
+ syncSelectionToUrl: o = !1,
805
+ responsivePresets: c = Zt
581
806
  }) {
582
- var Fe;
807
+ var Me;
583
808
  const {
584
- adapter: g,
585
- config: f,
586
- currentUser: p,
587
- feedback: d,
588
- normalizedPath: v,
589
- permissions: h,
590
- createFeedback: b,
591
- updateFeedback: C,
592
- listMessages: E,
593
- createMessage: A,
594
- uploadAttachment: u
595
- } = Nt(), [R, y] = k(), [w, N] = k(), [B, D] = k(""), [pe, Je] = k("medium"), [me, Ve] = k("visual"), [ge, fe] = k(""), [be, qe] = k(
596
- ((Fe = c[0]) == null ? void 0 : Fe.value) ?? "desktop"
597
- ), [S, H] = k(), [F, $] = k("review"), [Ge, ve] = k(!1), [j, we] = k("all"), [O, ye] = k("all"), [K, Se] = k("all"), [J, ke] = k("all"), [V, Ce] = k("all"), [Ye, Xe] = k(!1), [Qe, Ne] = k({}), [se, oe] = k(""), ee = We(null), M = !!p, T = h.includes("create"), xe = h.includes("reply"), Ee = h.includes("update"), Ze = h.includes("assign"), P = R ?? w, et = !!w, tt = !!(f.captureScreenshot && (f.uploadAttachment || g.uploadAttachment)), nt = ie(() => {
598
- const a = d.map((m) => m.assigneeEmail).filter((m) => !!m);
599
- return p != null && p.email && a.push(p.email), Array.from(new Set(a)).sort((m, l) => m.localeCompare(l));
600
- }, [p == null ? void 0 : p.email, d]), I = ie(
601
- () => d.filter((a) => i || a.status !== "resolved").filter((a) => j === "all" || a.status === j).filter((a) => O === "all" || a.severity === O).filter((a) => K === "all" || a.category === K).filter((a) => J === "all" || a.assigneeEmail === J).filter((a) => V === "all" || a.viewportPreset === V),
809
+ adapter: u,
810
+ config: w,
811
+ currentUser: g,
812
+ feedback: b,
813
+ normalizedPath: A,
814
+ permissions: L,
815
+ createFeedback: p,
816
+ updateFeedback: v,
817
+ listMessages: h,
818
+ createMessage: k,
819
+ uploadAttachment: l
820
+ } = Wt(), [C, f] = x(), [y, N] = x(), [F, M] = x(""), [j, tt] = x("medium"), [we, nt] = x("visual"), [ve, be] = x(""), [ye, it] = x(
821
+ ((Me = c[0]) == null ? void 0 : Me.value) ?? "desktop"
822
+ ), [S, K] = x(), [T, _] = x("review"), [rt, ke] = x(!1), [J, Se] = x("all"), [O, xe] = x("all"), [G, Ne] = x("all"), [q, Ce] = x("all"), [V, Ee] = x("all"), [at, ot] = x(!1), [st, Le] = x({}), [le, ce] = x(""), te = re(null), Ae = re(e), de = re(
823
+ o ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
824
+ ), $ = !!g, B = L.includes("create"), Fe = L.includes("reply"), Re = L.includes("update"), lt = L.includes("assign"), U = C ?? y, ct = !!y, dt = !!(w.captureScreenshot && (w.uploadAttachment || u.uploadAttachment)), ht = oe(() => {
825
+ const a = b.map((m) => m.assigneeEmail).filter((m) => !!m);
826
+ return g != null && g.email && a.push(g.email), Array.from(new Set(a)).sort((m, d) => m.localeCompare(d));
827
+ }, [g == null ? void 0 : g.email, b]), R = oe(
828
+ () => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) => G === "all" || a.category === G).filter((a) => q === "all" || a.assigneeEmail === q).filter((a) => V === "all" || a.viewportPreset === V),
602
829
  [
603
- J,
604
- K,
605
- d,
830
+ q,
831
+ G,
832
+ b,
606
833
  O,
607
- i,
608
- j,
834
+ r,
835
+ J,
609
836
  V
610
837
  ]
611
- ), rt = [
612
- j,
613
- O,
614
- K,
838
+ ), ut = [
615
839
  J,
840
+ O,
841
+ G,
842
+ q,
616
843
  V
617
844
  ].filter((a) => a !== "all").length;
618
- _(() => {
619
- e || (y(void 0), N(void 0), D(""), oe(""), $("review"));
620
- }, [e]), _(() => {
621
- M || (y(void 0), N(void 0));
622
- }, [M]), _(() => {
623
- !w || F !== "review" || window.requestAnimationFrame(() => {
624
- var a, m, l;
625
- (m = (a = ee.current) == null ? void 0 : a.scrollIntoView) == null || m.call(a, { block: "nearest" }), (l = ee.current) == null || l.focus();
845
+ P(() => {
846
+ if (e) {
847
+ Ae.current = !0;
848
+ return;
849
+ }
850
+ if (f(void 0), N(void 0), M(""), ce(""), _("review"), o && Ae.current) {
851
+ const a = new URL(window.location.href);
852
+ a.searchParams.has("reviewLensFeedback") && (a.searchParams.delete("reviewLensFeedback"), window.history.replaceState({}, "", a));
853
+ }
854
+ }, [e, o]), P(() => {
855
+ $ || (f(void 0), N(void 0));
856
+ }, [$]), P(() => {
857
+ !y || T !== "review" || window.requestAnimationFrame(() => {
858
+ var a, m, d;
859
+ (m = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || m.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
626
860
  });
627
- }, [w, F]), _(() => {
861
+ }, [y, T]), P(() => {
628
862
  if (!S)
629
863
  return;
630
864
  let a = !0;
631
- return E(S.id).then((m) => {
632
- a && Ne((l) => ({ ...l, [S.id]: m }));
865
+ return h(S.id).then((m) => {
866
+ a && Le((d) => ({ ...d, [S.id]: m }));
633
867
  }), () => {
634
868
  a = !1;
635
869
  };
636
- }, [E, S]), _(() => {
637
- if (!e || !s || S || d.length === 0)
870
+ }, [h, S]), P(() => {
871
+ if (!o || !de.current || b.length === 0)
638
872
  return;
639
- const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), m = d.find((l) => l.id === a);
640
- m && q(m, { syncUrl: !1 });
641
- }, [d, e, S, s]), _(() => {
873
+ const a = b.find((m) => m.id === de.current);
874
+ a && (de.current = null, t == null || t(!0), z(a, { syncUrl: !1 }));
875
+ }, [b, o]), P(() => {
876
+ if (!e || !o || S || b.length === 0)
877
+ return;
878
+ const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), m = b.find((d) => d.id === a);
879
+ m && z(m, { syncUrl: !1 });
880
+ }, [b, e, S, o]), P(() => {
642
881
  if (!e)
643
882
  return;
644
- function a(l) {
645
- var x;
646
- if (l.key === "Shift" && ve(!0), l.key === "Escape") {
647
- l.preventDefault(), t == null || t(!1);
883
+ function a(d) {
884
+ var E;
885
+ if (d.key === "Shift" && ke(!0), d.key === "Escape") {
886
+ d.preventDefault(), t == null || t(!1);
648
887
  return;
649
888
  }
650
- Jt(l.target) || ((l.key === "n" || l.key === "ArrowDown") && (l.preventDefault(), Ae(1)), (l.key === "p" || l.key === "ArrowUp") && (l.preventDefault(), Ae(-1)), l.key === "c" && (l.preventDefault(), $("review"), (x = ee.current) == null || x.focus()), l.key === "f" && S && Ee && (l.preventDefault(), Le(S)));
889
+ wn(d.target) || ((d.key === "n" || d.key === "ArrowDown") && (d.preventDefault(), Ie(1)), (d.key === "p" || d.key === "ArrowUp") && (d.preventDefault(), Ie(-1)), d.key === "c" && (d.preventDefault(), _("review"), (E = te.current) == null || E.focus()), d.key === "f" && S && Re && (d.preventDefault(), $e(S)));
651
890
  }
652
- function m(l) {
653
- l.key === "Shift" && ve(!1);
891
+ function m(d) {
892
+ d.key === "Shift" && ke(!1);
654
893
  }
655
894
  return window.addEventListener("keydown", a), window.addEventListener("keyup", m), () => {
656
895
  window.removeEventListener("keydown", a), window.removeEventListener("keyup", m);
657
896
  };
658
897
  });
659
- const le = W((a) => {
898
+ const he = D((a) => {
660
899
  const m = a.target instanceof Element ? a.target : null;
661
900
  if (m)
662
901
  return m.closest("[data-review-lens-ui]") ? null : m;
663
- const l = document.elementFromPoint(a.clientX, a.clientY);
664
- return !l || l.closest("[data-review-lens-ui]") ? null : l;
902
+ const d = document.elementFromPoint(a.clientX, a.clientY);
903
+ return !d || d.closest("[data-review-lens-ui]") ? null : d;
665
904
  }, []);
666
- if (_(() => {
667
- if (!e || !M)
905
+ if (P(() => {
906
+ if (!e || !$)
668
907
  return;
669
- function a(l) {
670
- const x = le(l);
671
- y(x ? X(x) : void 0);
908
+ function a(d) {
909
+ const E = he(d);
910
+ f(E ? Q(E) : void 0);
672
911
  }
673
- function m(l) {
674
- const x = le(l);
675
- x && (l.preventDefault(), l.stopPropagation(), N(X(x)), $("review"));
912
+ function m(d) {
913
+ const E = he(d);
914
+ E && (d.preventDefault(), d.stopPropagation(), N(Q(E)), _("review"));
676
915
  }
677
916
  return window.addEventListener("mousemove", a, !0), window.addEventListener("click", m, !0), () => {
678
917
  window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", m, !0);
679
918
  };
680
- }, [M, le, e]), !e)
919
+ }, [$, he, e]), !e)
681
920
  return null;
682
- function q(a, m = { syncUrl: !0 }) {
683
- var x;
684
- if (H(a), N(void 0), $("feedback"), s && m.syncUrl !== !1) {
685
- const te = new URL(window.location.href);
686
- te.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", te);
921
+ function z(a, m = { syncUrl: !0 }) {
922
+ var E;
923
+ if (K(a), N(void 0), _("feedback"), o && m.syncUrl !== !1) {
924
+ const ne = new URL(window.location.href);
925
+ ne.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", ne);
687
926
  }
688
- const l = z(a.selector);
689
- if (!l) {
690
- y(void 0);
927
+ const d = H(a.selector);
928
+ if (!d) {
929
+ f(void 0);
691
930
  return;
692
931
  }
693
- (x = l.scrollIntoView) == null || x.call(l, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
694
- y(X(l));
932
+ (E = d.scrollIntoView) == null || E.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
933
+ f(Q(d));
695
934
  });
696
935
  }
697
- function Ae(a) {
698
- if (I.length === 0)
936
+ function Ie(a) {
937
+ if (R.length === 0)
699
938
  return;
700
- const m = S ? I.findIndex((x) => x.id === S.id) : -1, l = m < 0 ? a > 0 ? 0 : I.length - 1 : (m + a + I.length) % I.length;
701
- q(I[l]);
939
+ const m = S ? R.findIndex((E) => E.id === S.id) : -1, d = m < 0 ? a > 0 ? 0 : R.length - 1 : (m + a + R.length) % R.length;
940
+ z(R[d]);
702
941
  }
703
- async function Ie() {
704
- if (!w || !B.trim() || !p || !T)
942
+ async function Te() {
943
+ if (!y || !F.trim() || !g || !B)
705
944
  return;
706
- let a = await b({
707
- projectKey: f.projectKey,
708
- contentId: f.contentId,
709
- normalizedPath: v,
710
- originalUrl: f.currentUrl ?? window.location.href,
711
- selector: w.selector,
712
- selectorStrategy: w.selectorStrategy,
713
- elementFingerprint: w.fingerprint,
714
- createdCssSnapshot: w.cssSnapshot,
715
- comment: B.trim(),
945
+ let a = await p({
946
+ projectKey: w.projectKey,
947
+ contentId: w.contentId,
948
+ normalizedPath: A,
949
+ originalUrl: w.currentUrl ?? window.location.href,
950
+ selector: y.selector,
951
+ selectorStrategy: y.selectorStrategy,
952
+ elementFingerprint: y.fingerprint,
953
+ createdCssSnapshot: y.cssSnapshot,
954
+ comment: F.trim(),
716
955
  status: "open",
717
- severity: pe,
718
- category: me,
719
- assigneeEmail: ge.trim() || void 0,
956
+ severity: j,
957
+ category: we,
958
+ assigneeEmail: ve.trim() || void 0,
720
959
  viewportWidth: window.innerWidth,
721
960
  viewportHeight: window.innerHeight,
722
- viewportPreset: be,
961
+ viewportPreset: ye,
723
962
  screenshotUrl: void 0,
724
963
  screenshotThumbnailUrl: void 0,
725
- authorEmail: p.email
964
+ authorEmail: g.email
726
965
  });
727
- if (f.captureScreenshot)
966
+ if (w.captureScreenshot)
728
967
  try {
729
- const m = await f.captureScreenshot(w), l = await u(a.id, {
968
+ const m = await w.captureScreenshot(y), d = await l(a.id, {
730
969
  type: "screenshot",
731
970
  data: m,
732
- createdBy: p.email
971
+ createdBy: g.email
733
972
  });
734
- a = await C(a.id, {
735
- attachments: [l],
736
- screenshotUrl: l.url,
737
- screenshotThumbnailUrl: l.thumbnailUrl
973
+ a = await v(a.id, {
974
+ attachments: [d],
975
+ screenshotUrl: d.url,
976
+ screenshotThumbnailUrl: d.thumbnailUrl
738
977
  });
739
978
  } catch {
740
979
  }
741
- D(""), fe(""), N(void 0), y(void 0), $("feedback"), H(a);
980
+ if (M(""), be(""), N(void 0), f(void 0), _("feedback"), K(a), o) {
981
+ const m = new URL(window.location.href);
982
+ m.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", m);
983
+ }
742
984
  }
743
- async function it(a, m) {
744
- const l = (/* @__PURE__ */ new Date()).toISOString(), x = m === "resolved" ? { status: m, resolvedAt: l, resolvedBy: p == null ? void 0 : p.email } : { status: m }, te = await C(a.id, x);
745
- H(te);
985
+ async function mt(a, m) {
986
+ const d = (/* @__PURE__ */ new Date()).toISOString(), E = m === "resolved" ? { status: m, resolvedAt: d, resolvedBy: g == null ? void 0 : g.email } : { status: m }, ne = await v(a.id, E);
987
+ K(ne);
746
988
  }
747
- async function Le(a) {
748
- const m = z(a.selector);
749
- if (!m || !p)
989
+ async function $e(a) {
990
+ const m = H(a.selector);
991
+ if (!m || !g)
750
992
  return;
751
- const l = X(m), x = await C(a.id, {
993
+ const d = Q(m), E = await v(a.id, {
752
994
  status: "fixed",
753
- fixedCssSnapshot: l.cssSnapshot,
995
+ fixedCssSnapshot: d.cssSnapshot,
754
996
  fixedAt: (/* @__PURE__ */ new Date()).toISOString(),
755
- fixedBy: p.email
997
+ fixedBy: g.email
756
998
  });
757
- H(x);
999
+ K(E);
758
1000
  }
759
- async function at(a) {
760
- if (!se.trim() || !p || !xe)
1001
+ async function pt(a) {
1002
+ if (!le.trim() || !g || !Fe)
761
1003
  return;
762
- const m = await A({
1004
+ const m = await k({
763
1005
  feedbackId: a.id,
764
- body: se.trim(),
765
- authorEmail: p.email
1006
+ body: le.trim(),
1007
+ authorEmail: g.email
766
1008
  });
767
- Ne((l) => ({
768
- ...l,
769
- [a.id]: [...l[a.id] ?? [], m]
770
- })), oe("");
1009
+ Le((d) => ({
1010
+ ...d,
1011
+ [a.id]: [...d[a.id] ?? [], m]
1012
+ })), ce("");
771
1013
  }
772
- return /* @__PURE__ */ o("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
773
- M && P ? /* @__PURE__ */ r($t, { target: P, locked: !!w }) : null,
774
- M && w && R && Ge ? /* @__PURE__ */ r(_t, { from: w, to: R }) : null,
775
- M ? /* @__PURE__ */ o(re, { children: [
776
- /* @__PURE__ */ r(
777
- Pt,
1014
+ return /* @__PURE__ */ s("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
1015
+ $ && U ? /* @__PURE__ */ i(on, { target: U, locked: !!y }) : null,
1016
+ $ && y && C && rt ? /* @__PURE__ */ i(sn, { from: y, to: C }) : null,
1017
+ $ ? /* @__PURE__ */ s(ae, { children: [
1018
+ /* @__PURE__ */ i(
1019
+ ln,
778
1020
  {
779
- feedback: I,
1021
+ feedback: R,
780
1022
  selectedFeedback: S,
781
- onSelect: q
1023
+ onSelect: z
782
1024
  }
783
1025
  ),
784
- /* @__PURE__ */ r(
785
- Wt,
1026
+ /* @__PURE__ */ i(
1027
+ dn,
786
1028
  {
787
- feedback: I,
1029
+ feedback: R,
788
1030
  selectedFeedback: S,
789
- onSelect: q
1031
+ onSelect: z
790
1032
  }
791
1033
  )
792
1034
  ] }) : null,
793
- /* @__PURE__ */ o("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
794
- /* @__PURE__ */ o("header", { className: "review-lens-panel__header", children: [
795
- /* @__PURE__ */ o("div", { children: [
796
- /* @__PURE__ */ r("p", { className: "review-lens-kicker", children: "Review Lens" }),
797
- /* @__PURE__ */ r("h2", { children: F === "summary" ? "Summary" : F === "feedback" ? "Feedback" : w ? "Element locked" : "Inspecting" })
1035
+ /* @__PURE__ */ s("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
1036
+ /* @__PURE__ */ s("header", { className: "review-lens-panel__header", children: [
1037
+ /* @__PURE__ */ s("div", { className: "review-lens-brand", children: [
1038
+ /* @__PURE__ */ i(Qt, { className: "review-lens-brand__mark" }),
1039
+ /* @__PURE__ */ s("div", { children: [
1040
+ /* @__PURE__ */ i("p", { className: "review-lens-kicker", children: "Review Lens" }),
1041
+ /* @__PURE__ */ i("h2", { children: T === "summary" ? "Summary" : T === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
1042
+ ] })
798
1043
  ] }),
799
- /* @__PURE__ */ r("button", { type: "button", onClick: () => t == null ? void 0 : t(!1), children: "Close" })
1044
+ /* @__PURE__ */ i("button", { type: "button", onClick: () => t == null ? void 0 : t(!1), children: "Close" })
800
1045
  ] }),
801
- /* @__PURE__ */ o("div", { className: "review-lens-panel__body", children: [
802
- /* @__PURE__ */ o("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
803
- /* @__PURE__ */ r(
1046
+ /* @__PURE__ */ s("div", { className: "review-lens-panel__body", children: [
1047
+ /* @__PURE__ */ s("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
1048
+ /* @__PURE__ */ i(
804
1049
  "button",
805
1050
  {
806
1051
  type: "button",
807
1052
  role: "tab",
808
- "aria-selected": F === "review",
809
- onClick: () => $("review"),
1053
+ "aria-selected": T === "review",
1054
+ onClick: () => _("review"),
810
1055
  children: "Review"
811
1056
  }
812
1057
  ),
813
- /* @__PURE__ */ o(
1058
+ /* @__PURE__ */ s(
814
1059
  "button",
815
1060
  {
816
1061
  type: "button",
817
1062
  role: "tab",
818
- "aria-selected": F === "feedback",
819
- onClick: () => $("feedback"),
1063
+ "aria-selected": T === "feedback",
1064
+ onClick: () => _("feedback"),
820
1065
  children: [
821
1066
  "Feedback ",
822
- /* @__PURE__ */ r("span", { children: I.length })
1067
+ /* @__PURE__ */ i("span", { children: R.length })
823
1068
  ]
824
1069
  }
825
1070
  ),
826
- /* @__PURE__ */ r(
1071
+ /* @__PURE__ */ i(
827
1072
  "button",
828
1073
  {
829
1074
  type: "button",
830
1075
  role: "tab",
831
- "aria-selected": F === "summary",
832
- onClick: () => $("summary"),
1076
+ "aria-selected": T === "summary",
1077
+ onClick: () => _("summary"),
833
1078
  children: "Summary"
834
1079
  }
835
1080
  )
836
1081
  ] }),
837
- F === "review" ? /* @__PURE__ */ o("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
838
- /* @__PURE__ */ o("div", { className: "review-lens-inspection", children: [
839
- M ? null : /* @__PURE__ */ r("p", { children: "Authenticate with Google to inspect this page." }),
840
- M && P ? /* @__PURE__ */ o(re, { children: [
841
- /* @__PURE__ */ r(Dt, { target: P }),
842
- /* @__PURE__ */ r(_e, { title: "Accessibility", items: zt(P) }),
843
- /* @__PURE__ */ r(
844
- _e,
1082
+ T === "review" ? /* @__PURE__ */ s("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
1083
+ /* @__PURE__ */ s("div", { className: "review-lens-inspection", children: [
1084
+ $ ? null : /* @__PURE__ */ i("p", { children: "Authenticate with Google to inspect this page." }),
1085
+ $ && U ? /* @__PURE__ */ s(ae, { children: [
1086
+ /* @__PURE__ */ i(hn, { target: U }),
1087
+ /* @__PURE__ */ i(He, { title: "Accessibility", items: un(U) }),
1088
+ /* @__PURE__ */ i(
1089
+ He,
845
1090
  {
846
1091
  title: "Design tokens",
847
- items: Ht(P.cssSnapshot, f.designTokens)
1092
+ items: mn(U.cssSnapshot, w.designTokens)
848
1093
  }
849
1094
  )
850
1095
  ] }) : null,
851
- M && !P ? /* @__PURE__ */ r("p", { children: "Move over the app to inspect." }) : null
1096
+ $ && !U ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
852
1097
  ] }),
853
- et ? /* @__PURE__ */ r("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ o(
1098
+ ct ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ s(
854
1099
  "form",
855
1100
  {
856
1101
  className: "review-lens-feedback-form",
857
1102
  onSubmit: (a) => {
858
- a.preventDefault(), Ie();
1103
+ a.preventDefault(), Te();
859
1104
  },
860
1105
  children: [
861
- /* @__PURE__ */ r("label", { htmlFor: "review-lens-comment", children: "New feedback" }),
862
- /* @__PURE__ */ r(
1106
+ /* @__PURE__ */ i("label", { htmlFor: "review-lens-comment", children: "New feedback" }),
1107
+ /* @__PURE__ */ i(
863
1108
  "textarea",
864
1109
  {
865
- ref: ee,
1110
+ ref: te,
866
1111
  id: "review-lens-comment",
867
- value: B,
868
- disabled: !T,
869
- onChange: (a) => D(a.target.value),
1112
+ value: F,
1113
+ disabled: !B,
1114
+ onChange: (a) => M(a.target.value),
870
1115
  onKeyDown: (a) => {
871
- a.key === "Enter" && a.metaKey && (a.preventDefault(), Ie());
1116
+ a.key === "Enter" && a.metaKey && (a.preventDefault(), Te());
872
1117
  },
873
- placeholder: T ? "Describe the UX issue..." : "You do not have permission to comment."
1118
+ placeholder: B ? "Describe the UX issue..." : "You do not have permission to comment."
874
1119
  }
875
1120
  ),
876
- /* @__PURE__ */ o("div", { className: "review-lens-form-grid", children: [
877
- /* @__PURE__ */ o("label", { children: [
1121
+ /* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
1122
+ /* @__PURE__ */ s("label", { children: [
878
1123
  "Severity",
879
- /* @__PURE__ */ r(
1124
+ /* @__PURE__ */ i(
880
1125
  "select",
881
1126
  {
882
- value: pe,
883
- onChange: (a) => Je(a.target.value),
884
- disabled: !T,
885
- children: je.map((a) => /* @__PURE__ */ r("option", { value: a, children: Q[a] }, a))
1127
+ value: j,
1128
+ onChange: (a) => tt(a.target.value),
1129
+ disabled: !B,
1130
+ children: Qe.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
886
1131
  }
887
1132
  )
888
1133
  ] }),
889
- /* @__PURE__ */ o("label", { children: [
1134
+ /* @__PURE__ */ s("label", { children: [
890
1135
  "Type",
891
- /* @__PURE__ */ r(
1136
+ /* @__PURE__ */ i(
892
1137
  "select",
893
1138
  {
894
- value: me,
895
- onChange: (a) => Ve(a.target.value),
896
- disabled: !T,
897
- children: Oe.map((a) => /* @__PURE__ */ r("option", { value: a, children: Z[a] }, a))
1139
+ value: we,
1140
+ onChange: (a) => nt(a.target.value),
1141
+ disabled: !B,
1142
+ children: Ze.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
898
1143
  }
899
1144
  )
900
1145
  ] }),
901
- /* @__PURE__ */ o("label", { children: [
1146
+ /* @__PURE__ */ s("label", { children: [
902
1147
  "Assignee",
903
- /* @__PURE__ */ r(
1148
+ /* @__PURE__ */ i(
904
1149
  "input",
905
1150
  {
906
- value: ge,
907
- onChange: (a) => fe(a.target.value),
908
- disabled: !T,
1151
+ value: ve,
1152
+ onChange: (a) => be(a.target.value),
1153
+ disabled: !B,
909
1154
  placeholder: "optional@email.com"
910
1155
  }
911
1156
  )
912
1157
  ] }),
913
- /* @__PURE__ */ o("label", { children: [
1158
+ /* @__PURE__ */ s("label", { children: [
914
1159
  "Viewport",
915
- /* @__PURE__ */ r(
1160
+ /* @__PURE__ */ i(
916
1161
  "select",
917
1162
  {
918
- value: be,
919
- onChange: (a) => qe(a.target.value),
920
- disabled: !T,
921
- children: c.map((a) => /* @__PURE__ */ r("option", { value: a.value, children: a.label }, a.value))
1163
+ value: ye,
1164
+ onChange: (a) => it(a.target.value),
1165
+ disabled: !B,
1166
+ children: c.map((a) => /* @__PURE__ */ i("option", { value: a.value, children: a.label }, a.value))
922
1167
  }
923
1168
  )
924
1169
  ] })
925
1170
  ] }),
926
- T ? /* @__PURE__ */ o("p", { className: "review-lens-feedback-form__hint", children: [
1171
+ B ? /* @__PURE__ */ s("p", { className: "review-lens-feedback-form__hint", children: [
927
1172
  "Press ",
928
- /* @__PURE__ */ r("kbd", { children: "Command" }),
1173
+ /* @__PURE__ */ i("kbd", { children: "Command" }),
929
1174
  " + ",
930
- /* @__PURE__ */ r("kbd", { children: "Enter" }),
1175
+ /* @__PURE__ */ i("kbd", { children: "Enter" }),
931
1176
  " to submit.",
932
- tt ? " Screenshot capture runs after save." : ""
1177
+ dt ? " Screenshot capture runs after save." : ""
933
1178
  ] }) : null,
934
- /* @__PURE__ */ r("div", { className: "review-lens-actions", children: /* @__PURE__ */ r("button", { type: "submit", disabled: !B.trim() || !T, children: "Save feedback" }) })
1179
+ /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !B, children: "Save feedback" }) })
935
1180
  ]
936
1181
  }
937
1182
  ) }) : null
938
1183
  ] }) : null,
939
- F === "feedback" ? /* @__PURE__ */ o("div", { className: "review-lens-comments", children: [
940
- /* @__PURE__ */ r(
941
- Mt,
1184
+ T === "feedback" ? /* @__PURE__ */ s("div", { className: "review-lens-comments", children: [
1185
+ /* @__PURE__ */ i(
1186
+ en,
942
1187
  {
943
- open: Ye,
944
- activeCount: rt,
945
- statusFilter: j,
1188
+ open: at,
1189
+ activeCount: ut,
1190
+ statusFilter: J,
946
1191
  severityFilter: O,
947
- categoryFilter: K,
948
- assigneeFilter: J,
1192
+ categoryFilter: G,
1193
+ assigneeFilter: q,
949
1194
  viewportFilter: V,
950
- assignees: nt,
1195
+ assignees: ht,
951
1196
  responsivePresets: c,
952
- onStatusChange: we,
953
- onSeverityChange: ye,
954
- onCategoryChange: Se,
955
- onAssigneeChange: ke,
956
- onViewportChange: Ce,
957
- onToggle: () => Xe((a) => !a),
1197
+ onStatusChange: Se,
1198
+ onSeverityChange: xe,
1199
+ onCategoryChange: Ne,
1200
+ onAssigneeChange: Ce,
1201
+ onViewportChange: Ee,
1202
+ onToggle: () => ot((a) => !a),
958
1203
  onClear: () => {
959
- we("all"), ye("all"), Se("all"), ke("all"), Ce("all");
1204
+ Se("all"), xe("all"), Ne("all"), Ce("all"), Ee("all");
960
1205
  }
961
1206
  }
962
1207
  ),
963
- /* @__PURE__ */ o("div", { className: "review-lens-list-panel", children: [
964
- /* @__PURE__ */ o("div", { className: "review-lens-comments__header", children: [
965
- /* @__PURE__ */ r("h3", { children: "All feedback" }),
966
- /* @__PURE__ */ r("span", { children: I.length })
1208
+ /* @__PURE__ */ s("div", { className: "review-lens-list-panel", children: [
1209
+ /* @__PURE__ */ s("div", { className: "review-lens-comments__header", children: [
1210
+ /* @__PURE__ */ i("h3", { children: "All feedback" }),
1211
+ /* @__PURE__ */ i("span", { children: R.length })
967
1212
  ] }),
968
- /* @__PURE__ */ o("div", { className: "review-lens-comments__list", children: [
969
- I.length === 0 ? /* @__PURE__ */ r("p", { children: "No feedback for this view." }) : null,
970
- I.map((a) => /* @__PURE__ */ r(
971
- Tt,
1213
+ /* @__PURE__ */ s("div", { className: "review-lens-comments__list", children: [
1214
+ R.length === 0 ? /* @__PURE__ */ i("p", { children: "No feedback for this view." }) : null,
1215
+ R.map((a) => /* @__PURE__ */ i(
1216
+ tn,
972
1217
  {
973
1218
  item: a,
974
1219
  selected: (S == null ? void 0 : S.id) === a.id,
975
- onSelect: q
1220
+ onSelect: z
976
1221
  },
977
1222
  a.id
978
1223
  ))
979
1224
  ] })
980
1225
  ] }),
981
- S ? /* @__PURE__ */ o("div", { className: "review-lens-selected-panel", children: [
982
- /* @__PURE__ */ r("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
983
- /* @__PURE__ */ r(
984
- Rt,
1226
+ S ? /* @__PURE__ */ s("div", { className: "review-lens-selected-panel", children: [
1227
+ /* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1228
+ /* @__PURE__ */ i(
1229
+ nn,
985
1230
  {
986
1231
  item: S,
987
- messages: Qe[S.id] ?? [],
988
- messageDraft: se,
989
- canReply: xe,
990
- canUpdate: Ee,
991
- canAssign: Ze,
992
- onMessageDraftChange: oe,
993
- onSubmitMessage: () => void at(S),
994
- onStatusChange: (a) => void it(S, a),
995
- onAssigneeChange: (a) => void C(S.id, {
1232
+ messages: st[S.id] ?? [],
1233
+ messageDraft: le,
1234
+ canReply: Fe,
1235
+ canUpdate: Re,
1236
+ canAssign: lt,
1237
+ syncSelectionToUrl: o,
1238
+ onMessageDraftChange: ce,
1239
+ onSubmitMessage: () => void pt(S),
1240
+ onStatusChange: (a) => void mt(S, a),
1241
+ onAssigneeChange: (a) => void v(S.id, {
996
1242
  assigneeEmail: a.trim() || void 0
997
- }).then(H),
998
- onMarkFixed: () => void Le(S)
1243
+ }).then(K),
1244
+ onMarkFixed: () => void $e(S)
999
1245
  },
1000
1246
  S.id
1001
1247
  )
1002
- ] }) : /* @__PURE__ */ o("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
1003
- /* @__PURE__ */ r("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1004
- /* @__PURE__ */ r("p", { children: "Select a feedback item above to review status, assignment, drift, and replies." })
1248
+ ] }) : /* @__PURE__ */ s("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
1249
+ /* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
1250
+ /* @__PURE__ */ i("p", { children: "Select a feedback item above to review status, assignment, drift, and replies." })
1005
1251
  ] })
1006
1252
  ] }) : null,
1007
- F === "summary" ? /* @__PURE__ */ r(Bt, { feedback: d }) : null
1253
+ T === "summary" ? /* @__PURE__ */ i(an, { feedback: b }) : null
1008
1254
  ] })
1009
1255
  ] })
1010
1256
  ] });
1011
1257
  }
1012
- function Mt({
1258
+ function en({
1013
1259
  open: e,
1014
1260
  activeCount: t,
1015
1261
  statusFilter: n,
1016
- severityFilter: i,
1017
- categoryFilter: s,
1262
+ severityFilter: r,
1263
+ categoryFilter: o,
1018
1264
  assigneeFilter: c,
1019
- viewportFilter: g,
1020
- assignees: f,
1021
- responsivePresets: p,
1022
- onStatusChange: d,
1023
- onSeverityChange: v,
1024
- onCategoryChange: h,
1025
- onAssigneeChange: b,
1026
- onViewportChange: C,
1027
- onToggle: E,
1028
- onClear: A
1265
+ viewportFilter: u,
1266
+ assignees: w,
1267
+ responsivePresets: g,
1268
+ onStatusChange: b,
1269
+ onSeverityChange: A,
1270
+ onCategoryChange: L,
1271
+ onAssigneeChange: p,
1272
+ onViewportChange: v,
1273
+ onToggle: h,
1274
+ onClear: k
1029
1275
  }) {
1030
- return /* @__PURE__ */ o("div", { className: "review-lens-filter-shell", children: [
1031
- /* @__PURE__ */ o("div", { className: "review-lens-filter-bar", children: [
1032
- /* @__PURE__ */ o("button", { type: "button", "aria-expanded": e, onClick: E, children: [
1276
+ return /* @__PURE__ */ s("div", { className: "review-lens-filter-shell", children: [
1277
+ /* @__PURE__ */ s("div", { className: "review-lens-filter-bar", children: [
1278
+ /* @__PURE__ */ s("button", { type: "button", "aria-expanded": e, onClick: h, children: [
1033
1279
  "Filters",
1034
- t > 0 ? /* @__PURE__ */ r("span", { children: t }) : null
1280
+ t > 0 ? /* @__PURE__ */ i("span", { children: t }) : null
1035
1281
  ] }),
1036
- t > 0 ? /* @__PURE__ */ r("button", { type: "button", onClick: A, children: "Clear" }) : null
1282
+ t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: k, children: "Clear" }) : null
1037
1283
  ] }),
1038
- e ? /* @__PURE__ */ o("div", { className: "review-lens-filters", children: [
1039
- /* @__PURE__ */ o("label", { children: [
1284
+ e ? /* @__PURE__ */ s("div", { className: "review-lens-filters", children: [
1285
+ /* @__PURE__ */ s("label", { children: [
1040
1286
  "Status",
1041
- /* @__PURE__ */ o(
1287
+ /* @__PURE__ */ s(
1042
1288
  "select",
1043
1289
  {
1044
1290
  "aria-label": "Filter status",
1045
1291
  value: n,
1046
- onChange: (u) => d(u.target.value),
1292
+ onChange: (l) => b(l.target.value),
1047
1293
  children: [
1048
- /* @__PURE__ */ r("option", { value: "all", children: "All statuses" }),
1049
- He.map((u) => /* @__PURE__ */ r("option", { value: u, children: ae[u] }, u))
1294
+ /* @__PURE__ */ i("option", { value: "all", children: "All statuses" }),
1295
+ Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
1050
1296
  ]
1051
1297
  }
1052
1298
  )
1053
1299
  ] }),
1054
- /* @__PURE__ */ o("label", { children: [
1300
+ /* @__PURE__ */ s("label", { children: [
1055
1301
  "Priority",
1056
- /* @__PURE__ */ o(
1302
+ /* @__PURE__ */ s(
1057
1303
  "select",
1058
1304
  {
1059
1305
  "aria-label": "Filter severity",
1060
- value: i,
1061
- onChange: (u) => v(u.target.value),
1306
+ value: r,
1307
+ onChange: (l) => A(l.target.value),
1062
1308
  children: [
1063
- /* @__PURE__ */ r("option", { value: "all", children: "All priorities" }),
1064
- je.map((u) => /* @__PURE__ */ r("option", { value: u, children: Q[u] }, u))
1309
+ /* @__PURE__ */ i("option", { value: "all", children: "All priorities" }),
1310
+ Qe.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
1065
1311
  ]
1066
1312
  }
1067
1313
  )
1068
1314
  ] }),
1069
- /* @__PURE__ */ o("label", { children: [
1315
+ /* @__PURE__ */ s("label", { children: [
1070
1316
  "Type",
1071
- /* @__PURE__ */ o(
1317
+ /* @__PURE__ */ s(
1072
1318
  "select",
1073
1319
  {
1074
1320
  "aria-label": "Filter type",
1075
- value: s,
1076
- onChange: (u) => h(u.target.value),
1321
+ value: o,
1322
+ onChange: (l) => L(l.target.value),
1077
1323
  children: [
1078
- /* @__PURE__ */ r("option", { value: "all", children: "All types" }),
1079
- Oe.map((u) => /* @__PURE__ */ r("option", { value: u, children: Z[u] }, u))
1324
+ /* @__PURE__ */ i("option", { value: "all", children: "All types" }),
1325
+ Ze.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
1080
1326
  ]
1081
1327
  }
1082
1328
  )
1083
1329
  ] }),
1084
- /* @__PURE__ */ o("label", { children: [
1330
+ /* @__PURE__ */ s("label", { children: [
1085
1331
  "Assignee",
1086
- /* @__PURE__ */ o(
1332
+ /* @__PURE__ */ s(
1087
1333
  "select",
1088
1334
  {
1089
1335
  "aria-label": "Filter assignee",
1090
1336
  value: c,
1091
- onChange: (u) => b(u.target.value),
1337
+ onChange: (l) => p(l.target.value),
1092
1338
  children: [
1093
- /* @__PURE__ */ r("option", { value: "all", children: "All assignees" }),
1094
- f.map((u) => /* @__PURE__ */ r("option", { value: u, children: u }, u))
1339
+ /* @__PURE__ */ i("option", { value: "all", children: "All assignees" }),
1340
+ w.map((l) => /* @__PURE__ */ i("option", { value: l, children: l }, l))
1095
1341
  ]
1096
1342
  }
1097
1343
  )
1098
1344
  ] }),
1099
- /* @__PURE__ */ o("label", { children: [
1345
+ /* @__PURE__ */ s("label", { children: [
1100
1346
  "Viewport",
1101
- /* @__PURE__ */ o(
1347
+ /* @__PURE__ */ s(
1102
1348
  "select",
1103
1349
  {
1104
1350
  "aria-label": "Filter viewport",
1105
- value: g,
1106
- onChange: (u) => C(u.target.value),
1351
+ value: u,
1352
+ onChange: (l) => v(l.target.value),
1107
1353
  children: [
1108
- /* @__PURE__ */ r("option", { value: "all", children: "All viewports" }),
1109
- p.map((u) => /* @__PURE__ */ r("option", { value: u.value, children: u.label }, u.value))
1354
+ /* @__PURE__ */ i("option", { value: "all", children: "All viewports" }),
1355
+ g.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
1110
1356
  ]
1111
1357
  }
1112
1358
  )
@@ -1114,13 +1360,13 @@ function Mt({
1114
1360
  ] }) : null
1115
1361
  ] });
1116
1362
  }
1117
- function Tt({
1363
+ function tn({
1118
1364
  item: e,
1119
1365
  selected: t,
1120
1366
  onSelect: n
1121
1367
  }) {
1122
- const i = Ke(e);
1123
- return /* @__PURE__ */ o(
1368
+ const r = et(e);
1369
+ return /* @__PURE__ */ s(
1124
1370
  "article",
1125
1371
  {
1126
1372
  tabIndex: 0,
@@ -1130,160 +1376,191 @@ function Tt({
1130
1376
  t ? "review-lens-comment--selected" : ""
1131
1377
  ].filter(Boolean).join(" "),
1132
1378
  onClick: () => n(e),
1133
- onKeyDown: (s) => {
1134
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), n(e));
1379
+ onKeyDown: (o) => {
1380
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), n(e));
1135
1381
  },
1136
1382
  children: [
1137
- /* @__PURE__ */ o("div", { className: "review-lens-comment__header", children: [
1138
- /* @__PURE__ */ r("span", { children: ae[e.status] }),
1139
- /* @__PURE__ */ r("strong", { children: Q[e.severity] })
1383
+ /* @__PURE__ */ s("div", { className: "review-lens-comment__header", children: [
1384
+ /* @__PURE__ */ i("span", { children: se[e.status] }),
1385
+ /* @__PURE__ */ i("strong", { children: Z[e.severity] })
1140
1386
  ] }),
1141
- /* @__PURE__ */ o("div", { className: "review-lens-comment__content", children: [
1142
- /* @__PURE__ */ r("p", { children: e.comment }),
1143
- /* @__PURE__ */ o("span", { children: [
1387
+ /* @__PURE__ */ s("div", { className: "review-lens-comment__content", children: [
1388
+ /* @__PURE__ */ i("p", { children: e.comment }),
1389
+ /* @__PURE__ */ s("span", { children: [
1144
1390
  e.authorEmail,
1145
1391
  e.assigneeEmail ? ` -> ${e.assigneeEmail}` : ""
1146
1392
  ] })
1147
1393
  ] }),
1148
- /* @__PURE__ */ o("div", { className: "review-lens-tags", children: [
1149
- /* @__PURE__ */ r("span", { children: Z[e.category] }),
1150
- /* @__PURE__ */ r("span", { children: e.viewportPreset }),
1151
- /* @__PURE__ */ r("span", { children: i.label })
1394
+ /* @__PURE__ */ s("div", { className: "review-lens-tags", children: [
1395
+ /* @__PURE__ */ i("span", { children: ee[e.category] }),
1396
+ /* @__PURE__ */ i("span", { children: e.viewportPreset }),
1397
+ /* @__PURE__ */ i("span", { children: r.label })
1152
1398
  ] })
1153
1399
  ]
1154
1400
  }
1155
1401
  );
1156
1402
  }
1157
- function Rt({
1403
+ function nn({
1158
1404
  item: e,
1159
1405
  messages: t,
1160
1406
  messageDraft: n,
1161
- canReply: i,
1162
- canUpdate: s,
1407
+ canReply: r,
1408
+ canUpdate: o,
1163
1409
  canAssign: c,
1164
- onMessageDraftChange: g,
1165
- onSubmitMessage: f,
1166
- onStatusChange: p,
1167
- onAssigneeChange: d,
1168
- onMarkFixed: v
1410
+ syncSelectionToUrl: u,
1411
+ onMessageDraftChange: w,
1412
+ onSubmitMessage: g,
1413
+ onStatusChange: b,
1414
+ onAssigneeChange: A,
1415
+ onMarkFixed: L
1169
1416
  }) {
1170
- const h = Ke(e);
1171
- return /* @__PURE__ */ o("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
1172
- /* @__PURE__ */ o("div", { className: "review-lens-detail__header", children: [
1173
- /* @__PURE__ */ o("h3", { children: [
1174
- Z[e.category],
1417
+ const [p, v] = x(!1), h = et(e);
1418
+ function k() {
1419
+ const l = new URL(window.location.href);
1420
+ l.searchParams.set("reviewLensFeedback", e.id), rn(l.toString()).then((C) => {
1421
+ C && (v(!0), setTimeout(() => v(!1), 2e3));
1422
+ });
1423
+ }
1424
+ return /* @__PURE__ */ s("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
1425
+ /* @__PURE__ */ s("div", { className: "review-lens-detail__header", children: [
1426
+ /* @__PURE__ */ s("h3", { children: [
1427
+ ee[e.category],
1175
1428
  " feedback"
1176
1429
  ] }),
1177
- /* @__PURE__ */ r("strong", { children: Q[e.severity] })
1430
+ /* @__PURE__ */ s("div", { className: "review-lens-detail__header-actions", children: [
1431
+ u ? /* @__PURE__ */ i(
1432
+ "button",
1433
+ {
1434
+ type: "button",
1435
+ className: "review-lens-copy-link",
1436
+ onClick: k,
1437
+ "aria-label": "Copy link to this feedback",
1438
+ children: p ? "Copied!" : "Copy link"
1439
+ }
1440
+ ) : null,
1441
+ /* @__PURE__ */ i("strong", { children: Z[e.severity] })
1442
+ ] })
1178
1443
  ] }),
1179
- /* @__PURE__ */ r("blockquote", { children: e.comment }),
1180
- /* @__PURE__ */ o("dl", { className: "review-lens-detail-meta", children: [
1181
- /* @__PURE__ */ o("div", { children: [
1182
- /* @__PURE__ */ r("dt", { children: "Target" }),
1183
- /* @__PURE__ */ r("dd", { children: h.label })
1444
+ /* @__PURE__ */ i("blockquote", { children: e.comment }),
1445
+ /* @__PURE__ */ s("dl", { className: "review-lens-detail-meta", children: [
1446
+ /* @__PURE__ */ s("div", { children: [
1447
+ /* @__PURE__ */ i("dt", { children: "Target" }),
1448
+ /* @__PURE__ */ i("dd", { children: h.label })
1184
1449
  ] }),
1185
- /* @__PURE__ */ o("div", { children: [
1186
- /* @__PURE__ */ r("dt", { children: "Viewport" }),
1187
- /* @__PURE__ */ r("dd", { children: e.viewportPreset })
1450
+ /* @__PURE__ */ s("div", { children: [
1451
+ /* @__PURE__ */ i("dt", { children: "Viewport" }),
1452
+ /* @__PURE__ */ i("dd", { children: e.viewportPreset })
1188
1453
  ] }),
1189
- e.screenshotUrl ? /* @__PURE__ */ o("div", { children: [
1190
- /* @__PURE__ */ r("dt", { children: "Evidence" }),
1191
- /* @__PURE__ */ r("dd", { children: /* @__PURE__ */ r("a", { href: e.screenshotUrl, target: "_blank", rel: "noreferrer", children: "Screenshot" }) })
1454
+ e.screenshotUrl ? /* @__PURE__ */ s("div", { children: [
1455
+ /* @__PURE__ */ i("dt", { children: "Evidence" }),
1456
+ /* @__PURE__ */ i("dd", { children: /* @__PURE__ */ i("a", { href: e.screenshotUrl, target: "_blank", rel: "noreferrer", children: "Screenshot" }) })
1192
1457
  ] }) : null
1193
1458
  ] }),
1194
- /* @__PURE__ */ o("div", { className: "review-lens-form-grid", children: [
1195
- /* @__PURE__ */ o("label", { children: [
1459
+ /* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
1460
+ /* @__PURE__ */ s("label", { children: [
1196
1461
  "Status",
1197
- /* @__PURE__ */ r(
1462
+ /* @__PURE__ */ i(
1198
1463
  "select",
1199
1464
  {
1200
1465
  value: e.status,
1201
- disabled: !s,
1202
- onChange: (b) => p(b.target.value),
1203
- children: He.map((b) => /* @__PURE__ */ r("option", { value: b, children: ae[b] }, b))
1466
+ disabled: !o,
1467
+ onChange: (l) => b(l.target.value),
1468
+ children: Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
1204
1469
  }
1205
1470
  )
1206
1471
  ] }),
1207
- /* @__PURE__ */ o("label", { children: [
1472
+ /* @__PURE__ */ s("label", { children: [
1208
1473
  "Assignee",
1209
- /* @__PURE__ */ r(
1474
+ /* @__PURE__ */ i(
1210
1475
  "input",
1211
1476
  {
1212
1477
  defaultValue: e.assigneeEmail ?? "",
1213
1478
  disabled: !c,
1214
- onBlur: (b) => d(b.target.value),
1479
+ onBlur: (l) => A(l.target.value),
1215
1480
  placeholder: "optional@email.com"
1216
1481
  }
1217
1482
  )
1218
1483
  ] })
1219
1484
  ] }),
1220
- /* @__PURE__ */ o("div", { className: "review-lens-status-actions", children: [
1221
- /* @__PURE__ */ r(
1485
+ /* @__PURE__ */ s("div", { className: "review-lens-status-actions", children: [
1486
+ /* @__PURE__ */ i(
1222
1487
  "button",
1223
1488
  {
1224
1489
  type: "button",
1225
1490
  className: "review-lens-button-secondary",
1226
- disabled: !s,
1227
- onClick: v,
1491
+ disabled: !o,
1492
+ onClick: L,
1228
1493
  children: "Mark fixed"
1229
1494
  }
1230
1495
  ),
1231
- /* @__PURE__ */ r(
1496
+ /* @__PURE__ */ i(
1232
1497
  "button",
1233
1498
  {
1234
1499
  type: "button",
1235
1500
  className: "review-lens-button-primary",
1236
- disabled: !s,
1237
- onClick: () => p("resolved"),
1501
+ disabled: !o,
1502
+ onClick: () => b("resolved"),
1238
1503
  children: "Resolve"
1239
1504
  }
1240
1505
  )
1241
1506
  ] }),
1242
- /* @__PURE__ */ o("div", { className: "review-lens-thread", children: [
1243
- /* @__PURE__ */ o("div", { className: "review-lens-thread__header", children: [
1244
- /* @__PURE__ */ r("h3", { children: "Thread" }),
1245
- /* @__PURE__ */ r("span", { children: t.length })
1507
+ /* @__PURE__ */ s("div", { className: "review-lens-thread", children: [
1508
+ /* @__PURE__ */ s("div", { className: "review-lens-thread__header", children: [
1509
+ /* @__PURE__ */ i("h3", { children: "Thread" }),
1510
+ /* @__PURE__ */ i("span", { children: t.length })
1246
1511
  ] }),
1247
- t.length === 0 ? /* @__PURE__ */ r("p", { children: "No replies yet." }) : null,
1248
- t.map((b) => /* @__PURE__ */ o("div", { className: "review-lens-thread__message", children: [
1249
- /* @__PURE__ */ r("p", { children: b.body }),
1250
- /* @__PURE__ */ r("span", { children: b.authorEmail })
1251
- ] }, b.id)),
1252
- /* @__PURE__ */ r(
1512
+ t.length === 0 ? /* @__PURE__ */ i("p", { children: "No replies yet." }) : null,
1513
+ t.map((l) => /* @__PURE__ */ s("div", { className: "review-lens-thread__message", children: [
1514
+ /* @__PURE__ */ i("p", { children: l.body }),
1515
+ /* @__PURE__ */ i("span", { children: l.authorEmail })
1516
+ ] }, l.id)),
1517
+ /* @__PURE__ */ i(
1253
1518
  "textarea",
1254
1519
  {
1255
1520
  "aria-label": "Reply",
1256
1521
  value: n,
1257
- disabled: !i,
1258
- onChange: (b) => g(b.target.value),
1259
- placeholder: i ? "Reply..." : "You do not have permission to reply."
1522
+ disabled: !r,
1523
+ onChange: (l) => w(l.target.value),
1524
+ placeholder: r ? "Reply..." : "You do not have permission to reply."
1260
1525
  }
1261
1526
  ),
1262
- /* @__PURE__ */ r("div", { className: "review-lens-actions", children: /* @__PURE__ */ r("button", { type: "button", disabled: !n.trim() || !i, onClick: f, children: "Reply" }) })
1527
+ /* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: g, children: "Reply" }) })
1263
1528
  ] })
1264
1529
  ] });
1265
1530
  }
1266
- function Bt({ feedback: e }) {
1267
- return /* @__PURE__ */ o("div", { className: "review-lens-summary", role: "tabpanel", children: [
1268
- /* @__PURE__ */ r(G, { title: "Status", values: Y(e, (t) => ae[t.status]) }),
1269
- /* @__PURE__ */ r(G, { title: "Severity", values: Y(e, (t) => Q[t.severity]) }),
1270
- /* @__PURE__ */ r(G, { title: "Type", values: Y(e, (t) => Z[t.category]) }),
1271
- /* @__PURE__ */ r(G, { title: "Assignee", values: Y(e, (t) => t.assigneeEmail ?? "Unassigned") }),
1272
- /* @__PURE__ */ r(G, { title: "Viewport", values: Y(e, (t) => t.viewportPreset) })
1531
+ async function rn(e) {
1532
+ var n;
1533
+ if ((n = navigator.clipboard) != null && n.writeText)
1534
+ return await navigator.clipboard.writeText(e), !0;
1535
+ const t = document.createElement("textarea");
1536
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.opacity = "0", document.body.append(t), t.select();
1537
+ try {
1538
+ return document.execCommand("copy");
1539
+ } finally {
1540
+ t.remove();
1541
+ }
1542
+ }
1543
+ function an({ feedback: e }) {
1544
+ return /* @__PURE__ */ s("div", { className: "review-lens-summary", role: "tabpanel", children: [
1545
+ /* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => se[t.status]) }),
1546
+ /* @__PURE__ */ i(Y, { title: "Severity", values: X(e, (t) => Z[t.severity]) }),
1547
+ /* @__PURE__ */ i(Y, { title: "Type", values: X(e, (t) => ee[t.category]) }),
1548
+ /* @__PURE__ */ i(Y, { title: "Assignee", values: X(e, (t) => t.assigneeEmail ?? "Unassigned") }),
1549
+ /* @__PURE__ */ i(Y, { title: "Viewport", values: X(e, (t) => t.viewportPreset) })
1273
1550
  ] });
1274
1551
  }
1275
- function G({ title: e, values: t }) {
1276
- return /* @__PURE__ */ o("section", { children: [
1277
- /* @__PURE__ */ r("h3", { children: e }),
1278
- /* @__PURE__ */ r("dl", { children: t.map(([n, i]) => /* @__PURE__ */ o("div", { children: [
1279
- /* @__PURE__ */ r("dt", { children: n }),
1280
- /* @__PURE__ */ r("dd", { children: i })
1552
+ function Y({ title: e, values: t }) {
1553
+ return /* @__PURE__ */ s("section", { children: [
1554
+ /* @__PURE__ */ i("h3", { children: e }),
1555
+ /* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
1556
+ /* @__PURE__ */ i("dt", { children: n }),
1557
+ /* @__PURE__ */ i("dd", { children: r })
1281
1558
  ] }, n)) })
1282
1559
  ] });
1283
1560
  }
1284
- function $t({ target: e, locked: t }) {
1285
- const n = Gt(e), i = Ot(e.fingerprint);
1286
- return /* @__PURE__ */ o(
1561
+ function on({ target: e, locked: t }) {
1562
+ const n = yn(e), r = gn(e.fingerprint);
1563
+ return /* @__PURE__ */ s(
1287
1564
  "div",
1288
1565
  {
1289
1566
  className: t ? "review-lens-highlight review-lens-highlight--locked" : "review-lens-highlight",
@@ -1294,7 +1571,7 @@ function $t({ target: e, locked: t }) {
1294
1571
  height: n.margin.height
1295
1572
  },
1296
1573
  children: [
1297
- /* @__PURE__ */ r(
1574
+ /* @__PURE__ */ i(
1298
1575
  "div",
1299
1576
  {
1300
1577
  className: "review-lens-highlight__border",
@@ -1306,7 +1583,7 @@ function $t({ target: e, locked: t }) {
1306
1583
  }
1307
1584
  }
1308
1585
  ),
1309
- /* @__PURE__ */ r(
1586
+ /* @__PURE__ */ i(
1310
1587
  "div",
1311
1588
  {
1312
1589
  className: "review-lens-highlight__padding",
@@ -1318,7 +1595,7 @@ function $t({ target: e, locked: t }) {
1318
1595
  }
1319
1596
  }
1320
1597
  ),
1321
- /* @__PURE__ */ r(
1598
+ /* @__PURE__ */ i(
1322
1599
  "div",
1323
1600
  {
1324
1601
  className: "review-lens-highlight__content",
@@ -1330,9 +1607,9 @@ function $t({ target: e, locked: t }) {
1330
1607
  }
1331
1608
  }
1332
1609
  ),
1333
- /* @__PURE__ */ o("div", { className: "review-lens-highlight__label", children: [
1334
- /* @__PURE__ */ r("strong", { children: i }),
1335
- /* @__PURE__ */ o("span", { children: [
1610
+ /* @__PURE__ */ s("div", { className: "review-lens-highlight__label", children: [
1611
+ /* @__PURE__ */ i("strong", { children: r }),
1612
+ /* @__PURE__ */ s("span", { children: [
1336
1613
  Math.round(e.rect.width),
1337
1614
  " x ",
1338
1615
  Math.round(e.rect.height)
@@ -1342,60 +1619,60 @@ function $t({ target: e, locked: t }) {
1342
1619
  }
1343
1620
  );
1344
1621
  }
1345
- function _t({ from: e, to: t }) {
1346
- const n = Kt(e.rect, t.rect);
1347
- return n.length === 0 ? null : /* @__PURE__ */ r(re, { children: n.map((i) => /* @__PURE__ */ r(
1622
+ function sn({ from: e, to: t }) {
1623
+ const n = fn(e.rect, t.rect);
1624
+ return n.length === 0 ? null : /* @__PURE__ */ i(ae, { children: n.map((r) => /* @__PURE__ */ i(
1348
1625
  "div",
1349
1626
  {
1350
- className: `review-lens-distance review-lens-distance--${i.axis}`,
1627
+ className: `review-lens-distance review-lens-distance--${r.axis}`,
1351
1628
  style: {
1352
- top: i.top,
1353
- left: i.left,
1354
- width: i.width,
1355
- height: i.height
1629
+ top: r.top,
1630
+ left: r.left,
1631
+ width: r.width,
1632
+ height: r.height
1356
1633
  },
1357
- children: /* @__PURE__ */ r("span", { children: i.label })
1634
+ children: /* @__PURE__ */ i("span", { children: r.label })
1358
1635
  },
1359
- i.key
1636
+ r.key
1360
1637
  )) });
1361
1638
  }
1362
- function Pt({
1639
+ function ln({
1363
1640
  feedback: e,
1364
1641
  selectedFeedback: t,
1365
1642
  onSelect: n
1366
1643
  }) {
1367
- return /* @__PURE__ */ r(re, { children: e.map((i) => /* @__PURE__ */ r(
1368
- Ut,
1644
+ return /* @__PURE__ */ i(ae, { children: e.map((r) => /* @__PURE__ */ i(
1645
+ cn,
1369
1646
  {
1370
- feedback: i,
1371
- selected: (t == null ? void 0 : t.id) === i.id,
1647
+ feedback: r,
1648
+ selected: (t == null ? void 0 : t.id) === r.id,
1372
1649
  onSelect: n
1373
1650
  },
1374
- i.id
1651
+ r.id
1375
1652
  )) });
1376
1653
  }
1377
- function Ut({
1654
+ function cn({
1378
1655
  feedback: e,
1379
1656
  selected: t,
1380
1657
  onSelect: n
1381
1658
  }) {
1382
- const i = We(null);
1383
- return lt(() => {
1384
- let s = 0;
1659
+ const r = re(null);
1660
+ return wt(() => {
1661
+ let o = 0;
1385
1662
  const c = () => {
1386
- s = 0;
1387
- const f = i.current, p = z(e.selector), d = p == null ? void 0 : p.getBoundingClientRect();
1388
- !f || !d || (f.style.top = `${d.top}px`, f.style.left = `${d.right}px`, f.hidden = d.bottom < 0 || d.top > window.innerHeight);
1389
- }, g = () => {
1390
- s || (s = window.requestAnimationFrame(c));
1663
+ o = 0;
1664
+ const w = r.current, g = H(e.selector), b = g == null ? void 0 : g.getBoundingClientRect();
1665
+ !w || !b || (w.style.top = `${b.top}px`, w.style.left = `${b.right}px`, w.hidden = b.bottom < 0 || b.top > window.innerHeight);
1666
+ }, u = () => {
1667
+ o || (o = window.requestAnimationFrame(c));
1391
1668
  };
1392
- return c(), window.addEventListener("scroll", g, !0), window.addEventListener("resize", g), () => {
1393
- s && window.cancelAnimationFrame(s), window.removeEventListener("scroll", g, !0), window.removeEventListener("resize", g);
1669
+ return c(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
1670
+ o && window.cancelAnimationFrame(o), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
1394
1671
  };
1395
- }, [e.selector]), /* @__PURE__ */ r(
1672
+ }, [e.selector]), /* @__PURE__ */ i(
1396
1673
  "button",
1397
1674
  {
1398
- ref: i,
1675
+ ref: r,
1399
1676
  type: "button",
1400
1677
  className: t ? "review-lens-marker review-lens-marker--selected" : "review-lens-marker",
1401
1678
  onClick: () => n(e),
@@ -1403,35 +1680,35 @@ function Ut({
1403
1680
  }
1404
1681
  );
1405
1682
  }
1406
- function Wt({
1683
+ function dn({
1407
1684
  feedback: e,
1408
1685
  selectedFeedback: t,
1409
1686
  onSelect: n
1410
1687
  }) {
1411
- const i = e.map((s) => {
1412
- const c = z(s.selector), g = c == null ? void 0 : c.getBoundingClientRect(), f = Math.max(
1688
+ const r = e.map((o) => {
1689
+ const c = H(o.selector), u = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
1413
1690
  document.documentElement.scrollHeight,
1414
1691
  document.body.scrollHeight,
1415
1692
  window.innerHeight
1416
1693
  );
1417
- return !g || f <= 0 ? null : {
1418
- item: s,
1419
- top: Math.min(100, Math.max(0, (g.top + window.scrollY) / f * 100))
1694
+ return !u || w <= 0 ? null : {
1695
+ item: o,
1696
+ top: Math.min(100, Math.max(0, (u.top + window.scrollY) / w * 100))
1420
1697
  };
1421
- }).filter((s) => s !== null);
1422
- return i.length === 0 ? null : /* @__PURE__ */ r("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: i.map((s) => /* @__PURE__ */ r(
1698
+ }).filter((o) => o !== null);
1699
+ return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((o) => /* @__PURE__ */ i(
1423
1700
  "button",
1424
1701
  {
1425
1702
  type: "button",
1426
- className: (t == null ? void 0 : t.id) === s.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
1427
- style: { top: `${s.top}%` },
1428
- onClick: () => n(s.item),
1429
- "aria-label": `Jump to feedback from ${s.item.authorEmail}`
1703
+ className: (t == null ? void 0 : t.id) === o.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
1704
+ style: { top: `${o.top}%` },
1705
+ onClick: () => n(o.item),
1706
+ "aria-label": `Jump to feedback from ${o.item.authorEmail}`
1430
1707
  },
1431
- s.item.id
1708
+ o.item.id
1432
1709
  )) });
1433
1710
  }
1434
- function Dt({ target: e }) {
1711
+ function hn({ target: e }) {
1435
1712
  const t = [
1436
1713
  ["Selector", e.selector],
1437
1714
  ["Size", `${e.cssSnapshot.width} x ${e.cssSnapshot.height}`],
@@ -1444,183 +1721,184 @@ function Dt({ target: e }) {
1444
1721
  ["Color", e.cssSnapshot.color],
1445
1722
  ["Background", e.cssSnapshot.backgroundColor]
1446
1723
  ];
1447
- return /* @__PURE__ */ r("dl", { className: "review-lens-metrics", children: t.map(([n, i]) => /* @__PURE__ */ o("div", { children: [
1448
- /* @__PURE__ */ r("dt", { children: n }),
1449
- /* @__PURE__ */ r("dd", { children: i })
1724
+ return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
1725
+ /* @__PURE__ */ i("dt", { children: n }),
1726
+ /* @__PURE__ */ i("dd", { children: r })
1450
1727
  ] }, n)) });
1451
1728
  }
1452
- function _e({ title: e, items: t }) {
1453
- return /* @__PURE__ */ o("section", { className: "review-lens-insights", children: [
1454
- /* @__PURE__ */ r("h3", { children: e }),
1455
- t.length === 0 ? /* @__PURE__ */ r("p", { children: "No issues detected." }) : null,
1456
- t.length > 0 ? /* @__PURE__ */ r("ul", { children: t.map((n) => /* @__PURE__ */ r("li", { children: n }, n)) }) : null
1729
+ function He({ title: e, items: t }) {
1730
+ return /* @__PURE__ */ s("section", { className: "review-lens-insights", children: [
1731
+ /* @__PURE__ */ i("h3", { children: e }),
1732
+ t.length === 0 ? /* @__PURE__ */ i("p", { children: "No issues detected." }) : null,
1733
+ t.length > 0 ? /* @__PURE__ */ i("ul", { children: t.map((n) => /* @__PURE__ */ i("li", { children: n }, n)) }) : null
1457
1734
  ] });
1458
1735
  }
1459
- function z(e) {
1736
+ function H(e) {
1460
1737
  try {
1461
1738
  return document.querySelector(e);
1462
1739
  } catch {
1463
1740
  return null;
1464
1741
  }
1465
1742
  }
1466
- function Ke(e) {
1467
- const t = z(e.selector);
1743
+ function et(e) {
1744
+ const t = H(e.selector);
1468
1745
  if (!t)
1469
1746
  return { label: "Target missing", level: "warning" };
1470
- const n = X(t);
1747
+ const n = Q(t);
1471
1748
  return n.fingerprint.tagName !== e.elementFingerprint.tagName ? { label: "Element changed", level: "warning" } : Math.abs(n.fingerprint.width - e.elementFingerprint.width) > 2 || Math.abs(n.fingerprint.height - e.elementFingerprint.height) > 2 ? { label: "Size changed", level: "warning" } : n.cssSnapshot.fontSize !== e.createdCssSnapshot.fontSize || n.cssSnapshot.color !== e.createdCssSnapshot.color || n.cssSnapshot.padding !== e.createdCssSnapshot.padding ? { label: "Style changed", level: "warning" } : { label: "Target unchanged", level: "ok" };
1472
1749
  }
1473
- function zt(e) {
1474
- var p;
1475
- const t = z(e.selector);
1750
+ function un(e) {
1751
+ var g;
1752
+ const t = H(e.selector);
1476
1753
  if (!t)
1477
1754
  return ["Selected element is no longer available."];
1478
- const n = [], i = t.tagName.toLowerCase(), s = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(i) || s === "button" || s === "link", g = t.getAttribute("aria-label") || t.getAttribute("title") || ((p = t.textContent) == null ? void 0 : p.trim());
1479
- c && !g && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), i === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
1480
- const f = /^h[1-6]$/.test(i) ? Number(i.slice(1)) : 0;
1481
- return f > 1 && !document.querySelector(`h${f - 1}`) && n.push("Heading may skip the previous level."), Vt(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
1755
+ const n = [], r = t.tagName.toLowerCase(), o = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(r) || o === "button" || o === "link", u = t.getAttribute("aria-label") || t.getAttribute("title") || ((g = t.textContent) == null ? void 0 : g.trim());
1756
+ c && !u && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), r === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
1757
+ const w = /^h[1-6]$/.test(r) ? Number(r.slice(1)) : 0;
1758
+ return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."), vn(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
1482
1759
  }
1483
- function Ht(e, t = {}) {
1760
+ function mn(e, t = {}) {
1484
1761
  const n = [];
1485
- return U("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), U("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), U("Font size", e.fontSize, t.fontSize, n), U("Line height", e.lineHeight, t.lineHeight, n), U("Text color", e.color, t.color, n), U("Background", e.backgroundColor, t.color, n), U("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
1762
+ return W("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), W("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), W("Font size", e.fontSize, t.fontSize, n), W("Line height", e.lineHeight, t.lineHeight, n), W("Text color", e.color, t.color, n), W("Background", e.backgroundColor, t.color, n), W("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
1486
1763
  }
1487
- function U(e, t, n, i, s = {}) {
1488
- !n || n.length === 0 || !t || jt(t, n, s) || i.push(`${e} ${t} is outside configured tokens.`);
1764
+ function W(e, t, n, r, o = {}) {
1765
+ !n || n.length === 0 || !t || pn(t, n, o) || r.push(`${e} ${t} is outside configured tokens.`);
1489
1766
  }
1490
- function jt(e, t, n = {}) {
1767
+ function pn(e, t, n = {}) {
1491
1768
  if (t.includes(e))
1492
1769
  return !0;
1493
1770
  if (!n.allowComposite)
1494
1771
  return !1;
1495
- const i = e.trim().split(/\s+/);
1496
- return i.length > 1 && i.every((s) => t.includes(s));
1772
+ const r = e.trim().split(/\s+/);
1773
+ return r.length > 1 && r.every((o) => t.includes(o));
1497
1774
  }
1498
- function Ot(e) {
1499
- const t = e.id ? `#${e.id}` : "", n = e.className ? `.${e.className.split(/\s+/).filter(Boolean).slice(0, 2).join(".")}` : "", i = e.ariaLabel ? `[aria-label="${e.ariaLabel}"]` : "";
1500
- return `${e.tagName}${t}${n}${i}` || e.tagName;
1775
+ function gn(e) {
1776
+ const t = e.id ? `#${e.id}` : "", n = e.className ? `.${e.className.split(/\s+/).filter(Boolean).slice(0, 2).join(".")}` : "", r = e.ariaLabel ? `[aria-label="${e.ariaLabel}"]` : "";
1777
+ return `${e.tagName}${t}${n}${r}` || e.tagName;
1501
1778
  }
1502
- function Kt(e, t) {
1503
- const n = [], i = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, s = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
1779
+ function fn(e, t) {
1780
+ const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, o = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
1504
1781
  if (e.right <= t.left || t.right <= e.left) {
1505
- const c = e.right <= t.left ? e.right : t.right, g = e.right <= t.left ? t.left : e.left;
1782
+ const c = e.right <= t.left ? e.right : t.right, u = e.right <= t.left ? t.left : e.left;
1506
1783
  n.push({
1507
1784
  key: "horizontal",
1508
1785
  axis: "horizontal",
1509
- top: Pe(s, 0, window.innerHeight),
1786
+ top: Ke(o, 0, window.innerHeight),
1510
1787
  left: c,
1511
- width: Math.max(g - c, 1),
1788
+ width: Math.max(u - c, 1),
1512
1789
  height: 1,
1513
- label: `${Math.round(g - c)}px`
1790
+ label: `${Math.round(u - c)}px`
1514
1791
  });
1515
1792
  }
1516
1793
  if (e.bottom <= t.top || t.bottom <= e.top) {
1517
- const c = e.bottom <= t.top ? e.bottom : t.bottom, g = e.bottom <= t.top ? t.top : e.top;
1794
+ const c = e.bottom <= t.top ? e.bottom : t.bottom, u = e.bottom <= t.top ? t.top : e.top;
1518
1795
  n.push({
1519
1796
  key: "vertical",
1520
1797
  axis: "vertical",
1521
1798
  top: c,
1522
- left: Pe(i, 0, window.innerWidth),
1799
+ left: Ke(r, 0, window.innerWidth),
1523
1800
  width: 1,
1524
- height: Math.max(g - c, 1),
1525
- label: `${Math.round(g - c)}px`
1801
+ height: Math.max(u - c, 1),
1802
+ label: `${Math.round(u - c)}px`
1526
1803
  });
1527
1804
  }
1528
1805
  return n;
1529
1806
  }
1530
- function Pe(e, t, n) {
1807
+ function Ke(e, t, n) {
1531
1808
  return Math.min(Math.max(e, t), n);
1532
1809
  }
1533
- function Y(e, t) {
1810
+ function X(e, t) {
1534
1811
  const n = /* @__PURE__ */ new Map();
1535
- for (const i of e) {
1536
- const s = t(i);
1537
- n.set(s, (n.get(s) ?? 0) + 1);
1812
+ for (const r of e) {
1813
+ const o = t(r);
1814
+ n.set(o, (n.get(o) ?? 0) + 1);
1538
1815
  }
1539
- return Array.from(n.entries()).sort((i, s) => s[1] - i[1] || i[0].localeCompare(s[0]));
1816
+ return Array.from(n.entries()).sort((r, o) => o[1] - r[1] || r[0].localeCompare(o[0]));
1540
1817
  }
1541
- function Jt(e) {
1818
+ function wn(e) {
1542
1819
  return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e instanceof HTMLElement && e.isContentEditable;
1543
1820
  }
1544
- function Vt(e, t) {
1545
- const n = Ue(e), i = Ue(t);
1546
- return !n || !i || i.alpha === 0 ? !1 : qt(n, i) < 4.5;
1821
+ function vn(e, t) {
1822
+ const n = Je(e), r = Je(t);
1823
+ return !n || !r || r.alpha === 0 ? !1 : bn(n, r) < 4.5;
1547
1824
  }
1548
- function Ue(e) {
1825
+ function Je(e) {
1549
1826
  const t = e.match(/rgba?\(([^)]+)\)/);
1550
1827
  if (!t)
1551
1828
  return null;
1552
- const [n, i, s, c = "1"] = t[1].split(",").map((g) => g.trim());
1829
+ const [n, r, o, c = "1"] = t[1].split(",").map((u) => u.trim());
1553
1830
  return {
1554
1831
  red: Number(n),
1555
- green: Number(i),
1556
- blue: Number(s),
1832
+ green: Number(r),
1833
+ blue: Number(o),
1557
1834
  alpha: Number(c)
1558
1835
  };
1559
1836
  }
1560
- function qt(e, t) {
1561
- const n = Math.max(ne(e), ne(t)), i = Math.min(ne(e), ne(t));
1562
- return (n + 0.05) / (i + 0.05);
1837
+ function bn(e, t) {
1838
+ const n = Math.max(ie(e), ie(t)), r = Math.min(ie(e), ie(t));
1839
+ return (n + 0.05) / (r + 0.05);
1563
1840
  }
1564
- function ne(e) {
1841
+ function ie(e) {
1565
1842
  const t = [e.red, e.green, e.blue].map((n) => {
1566
- const i = n / 255;
1567
- return i <= 0.03928 ? i / 12.92 : ((i + 0.055) / 1.055) ** 2.4;
1843
+ const r = n / 255;
1844
+ return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
1568
1845
  });
1569
1846
  return t[0] * 0.2126 + t[1] * 0.7152 + t[2] * 0.0722;
1570
1847
  }
1571
- function Gt(e) {
1848
+ function yn(e) {
1572
1849
  const t = {
1573
- top: L(e.cssSnapshot.marginTop),
1574
- right: L(e.cssSnapshot.marginRight),
1575
- bottom: L(e.cssSnapshot.marginBottom),
1576
- left: L(e.cssSnapshot.marginLeft)
1850
+ top: I(e.cssSnapshot.marginTop),
1851
+ right: I(e.cssSnapshot.marginRight),
1852
+ bottom: I(e.cssSnapshot.marginBottom),
1853
+ left: I(e.cssSnapshot.marginLeft)
1577
1854
  }, n = {
1578
- top: L(e.cssSnapshot.borderTopWidth),
1579
- right: L(e.cssSnapshot.borderRightWidth),
1580
- bottom: L(e.cssSnapshot.borderBottomWidth),
1581
- left: L(e.cssSnapshot.borderLeftWidth)
1582
- }, i = {
1583
- top: L(e.cssSnapshot.paddingTop),
1584
- right: L(e.cssSnapshot.paddingRight),
1585
- bottom: L(e.cssSnapshot.paddingBottom),
1586
- left: L(e.cssSnapshot.paddingLeft)
1587
- }, s = {
1855
+ top: I(e.cssSnapshot.borderTopWidth),
1856
+ right: I(e.cssSnapshot.borderRightWidth),
1857
+ bottom: I(e.cssSnapshot.borderBottomWidth),
1858
+ left: I(e.cssSnapshot.borderLeftWidth)
1859
+ }, r = {
1860
+ top: I(e.cssSnapshot.paddingTop),
1861
+ right: I(e.cssSnapshot.paddingRight),
1862
+ bottom: I(e.cssSnapshot.paddingBottom),
1863
+ left: I(e.cssSnapshot.paddingLeft)
1864
+ }, o = {
1588
1865
  top: e.rect.top,
1589
1866
  left: e.rect.left,
1590
1867
  width: Math.max(e.rect.width, 0),
1591
1868
  height: Math.max(e.rect.height, 0)
1592
1869
  }, c = {
1593
- top: s.top - t.top,
1594
- left: s.left - t.left,
1595
- width: s.width + t.left + t.right,
1596
- height: s.height + t.top + t.bottom
1597
- }, g = {
1598
- top: s.top + n.top,
1599
- left: s.left + n.left,
1600
- width: Math.max(s.width - n.left - n.right, 0),
1601
- height: Math.max(s.height - n.top - n.bottom, 0)
1602
- }, f = {
1603
- top: g.top + i.top,
1604
- left: g.left + i.left,
1605
- width: Math.max(g.width - i.left - i.right, 0),
1606
- height: Math.max(g.height - i.top - i.bottom, 0)
1870
+ top: o.top - t.top,
1871
+ left: o.left - t.left,
1872
+ width: o.width + t.left + t.right,
1873
+ height: o.height + t.top + t.bottom
1874
+ }, u = {
1875
+ top: o.top + n.top,
1876
+ left: o.left + n.left,
1877
+ width: Math.max(o.width - n.left - n.right, 0),
1878
+ height: Math.max(o.height - n.top - n.bottom, 0)
1879
+ }, w = {
1880
+ top: u.top + r.top,
1881
+ left: u.left + r.left,
1882
+ width: Math.max(u.width - r.left - r.right, 0),
1883
+ height: Math.max(u.height - r.top - r.bottom, 0)
1607
1884
  };
1608
1885
  return {
1609
1886
  margin: c,
1610
- border: s,
1611
- padding: g,
1612
- content: f
1887
+ border: o,
1888
+ padding: u,
1889
+ content: w
1613
1890
  };
1614
1891
  }
1615
- function L(e) {
1892
+ function I(e) {
1616
1893
  const t = Number.parseFloat(e);
1617
1894
  return Number.isFinite(t) ? t : 0;
1618
1895
  }
1619
1896
  export {
1620
- Zt as ReviewLensOverlay,
1621
- Qt as ReviewLensProvider,
1622
- X as buildElementTarget,
1623
- ht as createGoogleSheetsAdapter,
1624
- Ct as normalizeReviewUrl,
1625
- Nt as useReviewLens
1897
+ Qt as ReviewLensLogo,
1898
+ Nn as ReviewLensOverlay,
1899
+ xn as ReviewLensProvider,
1900
+ Q as buildElementTarget,
1901
+ St as createGoogleSheetsAdapter,
1902
+ Ut as normalizeReviewUrl,
1903
+ Wt as useReviewLens
1626
1904
  };