@pixelmatters/markup 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +13 -11
  2. package/dist/react.js +380 -276
  3. package/dist/widget.js +850 -746
  4. package/package.json +1 -1
package/dist/react.js CHANGED
@@ -66,13 +66,13 @@ function k() {
66
66
  }
67
67
  function A(e, t, n, r, i, a, o, s, c, l, u) {
68
68
  var d, f, p, m, _, v, y, b = r && r.__k || g, x = t.length;
69
- for (c = ee(n, t, b, c, x), d = 0; d < x; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && b[p.__i] || h, p.__i = d, v = re(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && se(f.ref, null, p), u.push(p.ref, p.__c || m, p)), _ == null && m != null && (_ = m), (y = !!(4 & p.__u)) || f.__k === p.__k ? (c = j(p, c, e, y), y && f.__e && (f.__e = null)) : typeof p.type == "function" && v !== void 0 ? c = v : m && (c = m.nextSibling), p.__u &= -7);
69
+ for (c = ee(n, t, b, c, x), d = 0; d < x; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && b[p.__i] || h, p.__i = d, v = re(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && ce(f.ref, null, p), u.push(p.ref, p.__c || m, p)), _ == null && m != null && (_ = m), (y = !!(4 & p.__u)) || f.__k === p.__k ? (c = j(p, c, e, y), y && f.__e && (f.__e = null)) : typeof p.type == "function" && v !== void 0 ? c = v : m && (c = m.nextSibling), p.__u &= -7);
70
70
  return n.__e = _, c;
71
71
  }
72
72
  function ee(e, t, n, r, i) {
73
73
  var a, o, s, c, l, u = n.length, d = u, f = 0;
74
74
  for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = S(null, o, null, null, null) : v(o) ? o = e.__k[a] = S(C, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = S(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = M(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
75
- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = T(s)), ce(s, s));
75
+ if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = T(s)), le(s, s));
76
76
  return r;
77
77
  }
78
78
  function j(e, t, n, r) {
@@ -130,7 +130,7 @@ function re(e, t, r, i, a, o, s, c, l, u) {
130
130
  if (t.constructor !== void 0) return null;
131
131
  128 & r.__u && (l = !!(32 & r.__u), o = [c = t.__e = r.__e]), (d = n.__b) && d(t);
132
132
  n: if (typeof M == "function") try {
133
- if (S = t.props, T = M.prototype && M.prototype.render, E = (d = M.contextType) && i[d.__c], D = d ? E ? E.props.value : d.__ : i, r.__c ? x = (f = t.__c = r.__c).__ = f.__E : (T ? t.__c = f = new M(S, D) : (t.__c = f = new w(S, D), f.constructor = M, f.render = le), E && E.sub(f), f.state ||= {}, f.__n = i, p = f.__d = !0, f.__h = [], f._sb = []), T && f.__s == null && (f.__s = f.state), T && M.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = y({}, f.__s)), y(f.__s, M.getDerivedStateFromProps(S, f.__s))), m = f.props, h = f.state, f.__v = t, p) T && M.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), T && f.componentDidMount != null && f.__h.push(f.componentDidMount);
133
+ if (S = t.props, T = M.prototype && M.prototype.render, E = (d = M.contextType) && i[d.__c], D = d ? E ? E.props.value : d.__ : i, r.__c ? x = (f = t.__c = r.__c).__ = f.__E : (T ? t.__c = f = new M(S, D) : (t.__c = f = new w(S, D), f.constructor = M, f.render = ue), E && E.sub(f), f.state ||= {}, f.__n = i, p = f.__d = !0, f.__h = [], f._sb = []), T && f.__s == null && (f.__s = f.state), T && M.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = y({}, f.__s)), y(f.__s, M.getDerivedStateFromProps(S, f.__s))), m = f.props, h = f.state, f.__v = t, p) T && M.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), T && f.componentDidMount != null && f.__h.push(f.componentDidMount);
134
134
  else {
135
135
  if (T && M.getDerivedStateFromProps == null && S !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(S, D), t.__v == r.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(S, f.__s, D)) {
136
136
  t.__v != r.__v && (f.props = S, f.state = f.__s, f.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(e) {
@@ -158,14 +158,14 @@ function re(e, t, r, i, a, o, s, c, l, u) {
158
158
  else t.__e = r.__e, t.__k = r.__k, e.then || ie(t);
159
159
  n.__e(e, t, r);
160
160
  }
161
- else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e = P(r.__e, t, r, i, a, o, s, l, u);
161
+ else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e = se(r.__e, t, r, i, a, o, s, l, u);
162
162
  return (d = n.diffed) && d(t), 128 & t.__u ? void 0 : c;
163
163
  }
164
164
  function ie(e) {
165
165
  e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(ie));
166
166
  }
167
167
  function ae(e, t, r) {
168
- for (var i = 0; i < r.length; i++) se(r[i], r[++i], r[++i]);
168
+ for (var i = 0; i < r.length; i++) ce(r[i], r[++i], r[++i]);
169
169
  n.__c && n.__c(t, e), e.some(function(t) {
170
170
  try {
171
171
  e = t.__h, t.__h = [], e.some(function(e) {
@@ -179,7 +179,7 @@ function ae(e, t, r) {
179
179
  function oe(e) {
180
180
  return typeof e != "object" || !e || e.__b > 0 ? e : v(e) ? e.map(oe) : y({}, e);
181
181
  }
182
- function P(e, r, i, a, o, s, c, l, u) {
182
+ function se(e, r, i, a, o, s, c, l, u) {
183
183
  var d, f, p, m, g, _, y, x = i.props || h, S = r.props, C = r.type;
184
184
  if (C == "svg" ? o = "http://www.w3.org/2000/svg" : C == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o ||= "http://www.w3.org/1999/xhtml", s != null) {
185
185
  for (d = 0; d < s.length; d++) if ((g = s[d]) && "setAttribute" in g == !!C && (C ? g.localName == C : g.nodeType == 3)) {
@@ -202,7 +202,7 @@ function P(e, r, i, a, o, s, c, l, u) {
202
202
  }
203
203
  return e;
204
204
  }
205
- function se(e, t, r) {
205
+ function ce(e, t, r) {
206
206
  try {
207
207
  if (typeof e == "function") {
208
208
  var i = typeof e.__u == "function";
@@ -212,9 +212,9 @@ function se(e, t, r) {
212
212
  n.__e(e, r);
213
213
  }
214
214
  }
215
- function ce(e, t, r) {
215
+ function le(e, t, r) {
216
216
  var i, a;
217
- if (n.unmount && n.unmount(e), (i = e.ref) && (i.current && i.current != e.__e || se(i, null, t)), (i = e.__c) != null) {
217
+ if (n.unmount && n.unmount(e), (i = e.ref) && (i.current && i.current != e.__e || ce(i, null, t)), (i = e.__c) != null) {
218
218
  if (i.componentWillUnmount) try {
219
219
  i.componentWillUnmount();
220
220
  } catch (e) {
@@ -222,13 +222,13 @@ function ce(e, t, r) {
222
222
  }
223
223
  i.base = i.__P = null;
224
224
  }
225
- if (i = e.__k) for (a = 0; a < i.length; a++) i[a] && ce(i[a], t, r || typeof e.type != "function");
225
+ if (i = e.__k) for (a = 0; a < i.length; a++) i[a] && le(i[a], t, r || typeof e.type != "function");
226
226
  r || b(e.__e), e.__c = e.__ = e.__e = void 0;
227
227
  }
228
- function le(e, t, n) {
228
+ function ue(e, t, n) {
229
229
  return this.constructor(e, n);
230
230
  }
231
- function ue(e, r, i) {
231
+ function de(e, r, i) {
232
232
  var a, o, s, c;
233
233
  r == document && (r = document.documentElement), n.__ && n.__(e, r), o = (a = typeof i == "function") ? null : i && i.__k || r.__k, s = [], c = [], re(r, e = (!a && i || r).__k = x(C, null, [e]), o || h, h, r.namespaceURI, !a && i ? [i] : o ? null : r.firstChild ? t.call(r.childNodes) : null, s, !a && i ? i : o ? o.__e : r.firstChild, a, c), ae(s, e, c);
234
234
  }
@@ -249,7 +249,7 @@ t = g.slice, n = { __e: function(e, t, n, r) {
249
249
  }, k.__r = 0, c = Math.random().toString(8), l = "__d" + c, u = "__a" + c, d = /(PointerCapture)$|Capture$/i, f = 0, p = ne(!1), m = ne(!0);
250
250
  //#endregion
251
251
  //#region src/styles.css?inline
252
- var de = ":host{--markup-paper:#fdfcfa;--markup-ink:#1a1614;--markup-muted:#6b6661;--markup-border:#1a16141a;--markup-border-strong:#1a16142e;--markup-brand:#e35d2a;--markup-brand-hover:#c84d20;--markup-team:#2a4ac8;--markup-shadow:0 1px 2px #1a16140f, 0 8px 28px #1a16141f;--markup-overlay-tint:#1a16140a;--markup-danger:#dc2626;--markup-radius:6px;--markup-radius-sm:4px;--markup-font:\"Geist Variable\", \"Geist\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif;--markup-font-mono:\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;all:initial;font-family:var(--markup-font);color:var(--markup-ink);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px;line-height:1.5}:host([data-theme=dark]){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}}.markup-shadow-root{font-family:var(--markup-font)}.markup-shadow-root *,.markup-shadow-root :before,.markup-shadow-root :after{box-sizing:border-box}:where(.markup-shadow-root button,.markup-shadow-root input,.markup-shadow-root textarea){font:inherit;color:inherit}.markup-eyebrow{font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--markup-muted);font-size:10px;font-weight:500}.markup-fab{z-index:10;background:var(--markup-ink);color:var(--markup-paper);cursor:pointer;letter-spacing:-.01em;pointer-events:auto;box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:999px;align-items:center;gap:8px;padding:9px 14px;font-size:13px;font-weight:500;transition:background .15s,box-shadow .15s,transform .15s;display:inline-flex;position:fixed;bottom:24px}.markup-fab:hover{background:var(--markup-brand);box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 0%, transparent), var(--markup-shadow)}.markup-fab:active{transform:translateY(1px)}.markup-fab.is-active{background:var(--markup-brand);box-shadow:var(--markup-shadow)}.markup-fab.is-active:hover{background:var(--markup-brand-hover)}.markup-fab .markup-fab-icon{color:var(--markup-brand);transition:color .15s}.markup-fab:hover .markup-fab-icon,.markup-fab.is-active .markup-fab-icon{color:var(--markup-paper)}.markup-fab-right{right:24px}.markup-fab-left{left:24px}.markup-fab-icon{align-items:center;display:inline-flex}.markup-fab-label{font-family:var(--markup-font)}.markup-hud-hidden-toast{z-index:10;background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;align-items:center;gap:6px;padding:8px 14px;font-size:12px;font-weight:500;animation:.22s ease-out markup-hud-hidden-in,.32s ease-in 4.6s forwards markup-hud-hidden-out;display:inline-flex;position:fixed;bottom:24px}.markup-hud-hidden-toast-right{right:24px}.markup-hud-hidden-toast-left{left:24px}.markup-kbd{background:color-mix(in srgb, var(--markup-paper) 14%, transparent);min-width:18px;height:18px;color:var(--markup-paper);font-family:var(--markup-font);border-radius:4px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}@keyframes markup-hud-hidden-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes markup-hud-hidden-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.markup-pins-layer{pointer-events:none;position:fixed;inset:0}.markup-pin{background:var(--markup-ink);width:28px;height:28px;color:var(--markup-brand);cursor:pointer;pointer-events:auto;box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 3px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:50% 50% 50% 4px;justify-content:center;align-items:center;margin-top:-28px;padding:0;transition:transform .15s,background .15s,color .15s;display:inline-flex;position:absolute}.markup-pin:hover,.markup-pin.is-active{background:var(--markup-brand);color:var(--markup-paper)}.markup-pin.is-anchor{anchor-name:--markup-active-anchor}.markup-pin-ghost{background:var(--markup-brand);color:var(--markup-paper);cursor:default;pointer-events:none;animation:1.2s ease-in-out infinite markup-ghost-pulse}.markup-pin-dot{background:currentColor;border-radius:50%;width:6px;height:6px;display:inline-block}.markup-pin-count{background:var(--markup-brand);min-width:16px;height:16px;color:var(--markup-paper);font-family:var(--markup-font-mono);text-align:center;box-shadow:0 0 0 2px var(--markup-paper);border-radius:999px;padding:0 4px;font-size:9px;font-weight:600;line-height:16px;position:absolute;top:-4px;left:50%;transform:translate(-50%,-50%)}@keyframes markup-ghost-pulse{0%,to{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 0 #e35d2a66}50%{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 10px #e35d2a00}}.markup-placement-overlay{background:var(--markup-overlay-tint);cursor:crosshair;pointer-events:auto;z-index:1;animation:.18s ease-out markup-overlay-in;position:fixed;inset:0}.markup-placement-cursor-help{background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;padding:10px 16px;font-size:12px;font-weight:500;animation:.22s ease-out 60ms backwards markup-help-in;position:fixed;top:24px;left:50%;transform:translate(-50%)}@keyframes markup-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes markup-help-in{0%{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%)}}.markup-popover{width:320px;max-width:calc(100vw - 24px);height:auto;max-height:calc(100dvh - 24px);inset:auto;left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);background:var(--markup-paper);color:var(--markup-ink);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);box-shadow:var(--markup-shadow);pointer-events:auto;flex-direction:column;gap:0;margin:0;padding:0;animation:.16s ease-out markup-popover-in;display:flex;position:fixed;overflow:hidden}@supports (anchor-name:--x){.markup-popover{position-anchor:--markup-active-anchor;left:calc(anchor(right) + 8px);top:calc(anchor(top) - 9px);position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;position-try-order:most-block-size}}@keyframes markup-popover-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}.markup-popover-header{border-bottom:1px solid var(--markup-border);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.markup-popover-header-actions{align-items:center;gap:4px;display:flex}.markup-thread-menu{display:flex;position:relative}.markup-thread-menu-list{z-index:10;background:var(--markup-paper);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);min-width:160px;box-shadow:var(--markup-shadow);padding:4px;animation:.12s ease-out markup-menu-in;position:absolute;top:calc(100% + 6px);right:0}.markup-thread-menu-item{border-radius:var(--markup-radius-sm);width:100%;color:var(--markup-ink);text-align:left;cursor:pointer;background:0 0;border:none;padding:7px 10px;font-size:13px;transition:background .1s,color .1s;display:block}.markup-thread-menu-item:hover{background:var(--markup-border)}.markup-thread-menu-item.is-danger{color:var(--markup-danger,#dc2626)}.markup-thread-menu-item.is-danger:hover{background:color-mix(in srgb, var(--markup-danger,#dc2626) 10%, transparent)}.markup-thread-menu-item:disabled{opacity:.5;cursor:default}@keyframes markup-menu-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.markup-popover-body{padding:12px}.markup-popover-byline{color:var(--markup-muted);align-items:center;gap:4px;margin:0 0 8px;font-size:12px;display:flex}.markup-popover-name{color:var(--markup-ink);font-weight:500}.markup-icon-btn{border-radius:var(--markup-radius-sm);width:24px;height:24px;color:var(--markup-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.markup-icon-btn:hover,.markup-icon-btn.is-open{background:var(--markup-border);color:var(--markup-ink)}.markup-comments{border-bottom:1px solid var(--markup-border);background:linear-gradient(var(--markup-paper), transparent) top / 100% 20px no-repeat local, linear-gradient(transparent, var(--markup-paper)) bottom / 100% 20px no-repeat local, radial-gradient(farthest-side at 50% 0%, #1a16141a, transparent) top / 100% 10px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, #1a16141a, transparent) bottom / 100% 10px no-repeat scroll;flex-direction:column;gap:12px;max-height:280px;margin:0;padding:8px 12px 4px;list-style:none;display:flex;overflow-y:auto}.markup-comment{flex-direction:column;gap:4px;display:flex}.markup-comment-meta{align-items:center;gap:6px;font-size:11px;display:flex}.markup-comment-author{color:var(--markup-ink);font-weight:600}.markup-comment.is-team .markup-comment-author{color:var(--markup-team)}.markup-comment-badge{background:color-mix(in srgb, var(--markup-team) 12%, transparent);height:14px;color:var(--markup-team);font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;border-radius:999px;align-items:center;padding:0 5px;font-size:9px;font-weight:500;line-height:1;display:inline-flex}.markup-comment-time{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.04em;font-size:10px}.markup-comment-body{white-space:pre-wrap;word-break:break-word;margin:0;font-size:13px;line-height:1.5}.markup-comment-edited{color:var(--markup-muted);font-size:11px}.markup-thread-actions{align-items:center;gap:4px;display:flex}.markup-comment-meta .markup-reaction-picker-wrap,.markup-thread-actions{margin-left:auto}.markup-comment-meta .markup-reaction-add{width:22px;height:22px;margin-top:-4px;margin-bottom:-4px}.markup-reaction-picker-wrap>.markup-icon-btn,.markup-comment-menu>.markup-icon-btn{margin-top:-4px;margin-bottom:-4px}.markup-comment-menu.is-up .markup-thread-menu-list{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}@keyframes markup-menu-in-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.markup-comment{position:relative}.markup-reactions{flex-wrap:wrap;align-items:center;gap:4px;margin-top:2px;display:flex}.markup-reaction-chip{border:1px solid var(--markup-border);height:22px;color:var(--markup-ink);font:inherit;cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:4px;padding:0 7px 0 6px;font-size:11px;line-height:1;transition:background .12s,border-color .12s;display:inline-flex}.markup-reaction-chip:hover:not(:disabled){background:color-mix(in srgb, var(--markup-ink) 5%, transparent)}.markup-reaction-chip.is-mine{border-color:color-mix(in srgb, var(--markup-brand) 45%, transparent);background:color-mix(in srgb, var(--markup-brand) 10%, transparent)}.markup-reaction-chip.is-mine:hover:not(:disabled){background:color-mix(in srgb, var(--markup-brand) 16%, transparent)}.markup-reaction-chip:disabled{cursor:default;opacity:.6}.markup-reaction-emoji{font-size:13px;line-height:1}.markup-reaction-count{font-family:var(--markup-font-mono);letter-spacing:.04em;color:var(--markup-muted);font-size:10px}.markup-reaction-chip.is-mine .markup-reaction-count{color:var(--markup-brand)}.markup-reaction-picker-wrap{opacity:0;flex:none;transition:opacity .12s;display:inline-flex;position:relative}.markup-comment:hover .markup-reaction-picker-wrap,.markup-comment:focus-within .markup-reaction-picker-wrap,.markup-reaction-picker-wrap.is-open{opacity:1}.markup-reaction-add{border:1px dashed var(--markup-border-strong);width:22px;height:22px;color:var(--markup-muted);font:inherit;cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;font-size:13px;line-height:1;transition:background .12s,color .12s,border-color .12s;display:inline-flex}.markup-reaction-add:hover,.markup-reaction-add.is-open{background:color-mix(in srgb, var(--markup-ink) 5%, transparent);color:var(--markup-ink);border-style:solid}.markup-reaction-picker{z-index:1;border:1px solid var(--markup-border-strong);background:var(--markup-paper);border-radius:8px;gap:2px;padding:4px;animation:.12s markup-menu-in;display:flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 1px 2px #1a16140f,0 8px 28px #1a16141a}.markup-reaction-picker-wrap.is-up .markup-reaction-picker{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}.markup-reaction-picker-item{cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;width:28px;height:28px;font-size:16px;line-height:1;transition:background .12s;display:inline-flex}.markup-reaction-picker-item:hover{background:color-mix(in srgb, var(--markup-ink) 8%, transparent)}.markup-reaction-picker-item.is-mine{background:color-mix(in srgb, var(--markup-brand) 14%, transparent)}.markup-comment-edit-form{flex-direction:column;gap:6px;display:flex}.markup-comment-edit-form .markup-textarea{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;color:var(--markup-ink);resize:vertical;font:inherit;outline:none;padding:8px 10px;font-size:13px;line-height:1.5}.markup-comment-edit-form .markup-textarea:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-comment-edit-actions{justify-content:flex-end;gap:6px;display:flex}.markup-composer{flex-direction:column;display:flex;position:relative}.markup-composer-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;min-height:36px;max-height:96px;color:var(--markup-ink);resize:none;font-family:var(--markup-font);outline:none;padding:8px 10px;font-size:13px;line-height:1.5;transition:border-color .12s,box-shadow .12s,border-bottom-left-radius .15s,border-bottom-right-radius .15s}.markup-composer-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-composer-input:disabled{opacity:.6}.markup-composer-input::placeholder{color:var(--markup-muted)}.markup-composer.is-filled .markup-composer-input{border-bottom-right-radius:0;border-bottom-left-radius:0}.markup-composer-footer-wrap{grid-template-rows:0fr;transition:grid-template-rows .15s;display:grid}.markup-composer.is-filled .markup-composer-footer-wrap{grid-template-rows:1fr}.markup-composer-footer{border:1px solid var(--markup-border-strong);border-radius:0 0 var(--markup-radius-sm) var(--markup-radius-sm);opacity:0;border-top:none;justify-content:space-between;align-items:center;gap:8px;padding:2px 2px 2px 10px;transition:opacity .1s;display:flex;overflow:hidden}.markup-composer.is-filled .markup-composer-footer{opacity:1;transition-delay:60ms}.markup-composer-hint{font-family:var(--markup-font-mono);letter-spacing:.06em;color:var(--markup-muted);font-size:10px}.markup-composer-error{color:var(--markup-brand)}.markup-composer-actions{align-items:center;gap:6px;display:flex}.markup-composer-actions-empty{transition:opacity .12s;position:absolute;top:3px;right:3px}.markup-composer.is-filled .markup-composer-actions-empty{opacity:0;pointer-events:none}.markup-author-prompt{flex-direction:column;gap:10px;padding:12px;display:flex}.markup-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;height:36px;color:var(--markup-ink);outline:none;padding:0 10px;font-size:14px;transition:border-color .12s,box-shadow .12s}.markup-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-btn{border-radius:var(--markup-radius-sm);height:30px;color:var(--markup-ink);cursor:pointer;letter-spacing:-.01em;white-space:nowrap;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:6px;padding:0 8px;font-size:12px;font-weight:500;transition:background .12s,border-color .12s,color .12s,opacity .12s;display:inline-flex}.markup-btn:disabled{opacity:.5;cursor:not-allowed}.markup-btn-primary{background:var(--markup-ink);color:var(--markup-paper)}.markup-btn-primary:hover:not(:disabled){background:var(--markup-brand)}.markup-btn-ghost{color:var(--markup-muted)}.markup-btn-ghost:hover:not(:disabled){background:var(--markup-border);color:var(--markup-ink)}.markup-screenshot-row{border-top:1px solid var(--markup-border);margin-top:8px;padding-top:8px}.markup-screenshot-status{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;display:flex}.markup-screenshot-toggle{cursor:pointer;color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;transition:color .12s;display:flex}.markup-screenshot-toggle:hover{color:var(--markup-ink)}.markup-screenshot-checkbox{width:12px;height:12px;accent-color:var(--markup-brand);cursor:pointer;margin:0}.markup-screenshot-thumb{border:1px solid var(--markup-border-strong);object-fit:cover;border-radius:3px;flex-shrink:0;width:auto;height:25px;margin:-5px 0 -5px auto;display:block}.markup-comment-screenshot{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);cursor:pointer;background:0 0;margin-top:8px;padding:0;transition:border-color .12s,opacity .12s;display:block;overflow:hidden}.markup-comment-screenshot:hover{border-color:var(--markup-brand);opacity:.9}.markup-comment-screenshot img{object-fit:cover;object-position:top;width:100%;height:auto;max-height:120px;display:block}.markup-lightbox{background:#1a1614e0;border:none;width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:24px;position:fixed;inset:0}.markup-lightbox[open]{justify-content:center;align-items:center;display:flex}.markup-lightbox::backdrop{display:none}.markup-lightbox-img{border-radius:var(--markup-radius);object-fit:contain;max-width:100%;max-height:100%;box-shadow:var(--markup-shadow);animation:.16s ease-out markup-lightbox-in}.markup-lightbox-close{color:#fdfcfa;background:#1a161499;position:absolute;top:16px;right:16px}.markup-lightbox-close:hover{color:#fdfcfa;background:#1a1614d9}@keyframes markup-lightbox-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){.markup-fab,.markup-pin,.markup-icon-btn,.markup-btn,.markup-popover,.markup-pin-ghost,.markup-placement-overlay,.markup-placement-cursor-help,.markup-lightbox-img{transition:none;animation:none}}", fe, F, pe, me, he = 0, ge = [], I = n, _e = I.__b, ve = I.__r, ye = I.diffed, be = I.__c, xe = I.unmount, Se = I.__;
252
+ var fe = ":host{--markup-paper:#fdfcfa;--markup-ink:#1a1614;--markup-muted:#6b6661;--markup-border:#1a16141a;--markup-border-strong:#1a16142e;--markup-brand:#e35d2a;--markup-brand-hover:#c84d20;--markup-team:#2a4ac8;--markup-shadow:0 1px 2px #1a16140f, 0 8px 28px #1a16141f;--markup-overlay-tint:#1a16140a;--markup-danger:#dc2626;--markup-radius:6px;--markup-radius-sm:4px;--markup-font:\"Geist Variable\", \"Geist\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif;--markup-font-mono:\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;all:initial;font-family:var(--markup-font);color:var(--markup-ink);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px;line-height:1.5}:host([data-theme=dark]){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}}.markup-shadow-root{font-family:var(--markup-font)}.markup-shadow-root *,.markup-shadow-root :before,.markup-shadow-root :after{box-sizing:border-box}:where(.markup-shadow-root button,.markup-shadow-root input,.markup-shadow-root textarea){font:inherit;color:inherit}.markup-eyebrow{font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--markup-muted);font-size:10px;font-weight:500}.markup-fab{z-index:10;background:var(--markup-ink);color:var(--markup-paper);cursor:pointer;touch-action:none;letter-spacing:-.01em;pointer-events:auto;box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:999px;align-items:center;gap:8px;padding:9px 14px;font-size:13px;font-weight:500;transition:background .15s,box-shadow .15s,transform .15s;display:inline-flex;position:fixed;bottom:24px}.markup-fab:hover{background:var(--markup-brand);box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 0%, transparent), var(--markup-shadow)}.markup-fab:active{transform:translateY(1px)}.markup-fab.is-active{background:var(--markup-brand);box-shadow:var(--markup-shadow)}.markup-fab.is-active:hover{background:var(--markup-brand-hover)}.markup-fab .markup-fab-icon{color:var(--markup-brand);transition:color .15s}.markup-fab:hover .markup-fab-icon,.markup-fab.is-active .markup-fab-icon{color:var(--markup-paper)}.markup-fab-right{right:24px}.markup-fab-left{left:24px}.markup-fab.is-floating{inset:0 auto auto 0}.markup-fab.is-dragging{cursor:grabbing;transition:none}.markup-fab-icon{align-items:center;display:inline-flex}.markup-fab-label{font-family:var(--markup-font)}.markup-hud-hidden-toast{z-index:10;background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;align-items:center;gap:6px;padding:8px 14px;font-size:12px;font-weight:500;animation:.22s ease-out markup-hud-hidden-in,.32s ease-in 4.6s forwards markup-hud-hidden-out;display:inline-flex;position:fixed;bottom:24px}.markup-hud-hidden-toast-right{right:24px}.markup-hud-hidden-toast-left{left:24px}.markup-kbd{background:color-mix(in srgb, var(--markup-paper) 14%, transparent);min-width:18px;height:18px;color:var(--markup-paper);font-family:var(--markup-font);border-radius:4px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}@keyframes markup-hud-hidden-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes markup-hud-hidden-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.markup-pins-layer{pointer-events:none;position:fixed;inset:0}.markup-pin{background:var(--markup-ink);width:28px;height:28px;color:var(--markup-brand);cursor:pointer;pointer-events:auto;box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 3px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:50% 50% 50% 4px;justify-content:center;align-items:center;margin-top:-28px;padding:0;transition:transform .15s,background .15s,color .15s;display:inline-flex;position:absolute}.markup-pin:hover,.markup-pin.is-active{background:var(--markup-brand);color:var(--markup-paper)}.markup-pin.is-anchor{anchor-name:--markup-active-anchor}.markup-pin-ghost{background:var(--markup-brand);color:var(--markup-paper);cursor:default;pointer-events:none;animation:1.2s ease-in-out infinite markup-ghost-pulse}.markup-pin-dot{background:currentColor;border-radius:50%;width:6px;height:6px;display:inline-block}.markup-pin-count{background:var(--markup-brand);min-width:16px;height:16px;color:var(--markup-paper);font-family:var(--markup-font-mono);text-align:center;box-shadow:0 0 0 2px var(--markup-paper);border-radius:999px;padding:0 4px;font-size:9px;font-weight:600;line-height:16px;position:absolute;top:-4px;left:50%;transform:translate(-50%,-50%)}@keyframes markup-ghost-pulse{0%,to{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 0 #e35d2a66}50%{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 10px #e35d2a00}}.markup-placement-overlay{background:var(--markup-overlay-tint);cursor:crosshair;pointer-events:auto;z-index:1;animation:.18s ease-out markup-overlay-in;position:fixed;inset:0}.markup-placement-cursor-help{background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;padding:10px 16px;font-size:12px;font-weight:500;animation:.22s ease-out 60ms backwards markup-help-in;position:fixed;top:24px;left:50%;transform:translate(-50%)}@keyframes markup-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes markup-help-in{0%{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%)}}.markup-popover{width:320px;max-width:calc(100vw - 24px);height:auto;max-height:calc(100dvh - 24px);inset:auto;left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);background:var(--markup-paper);color:var(--markup-ink);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);box-shadow:var(--markup-shadow);pointer-events:auto;flex-direction:column;gap:0;margin:0;padding:0;animation:.16s ease-out markup-popover-in;display:flex;position:fixed;overflow:hidden}@supports (anchor-name:--x){.markup-popover{position-anchor:--markup-active-anchor;left:calc(anchor(right) + 8px);top:calc(anchor(top) - 9px);position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;position-try-order:most-block-size}.markup-popover.is-floating{left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);position-try-fallbacks:none}}@keyframes markup-popover-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}.markup-popover-header{border-bottom:1px solid var(--markup-border);cursor:grab;-webkit-user-select:none;user-select:none;touch-action:none;justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.markup-popover.is-dragging .markup-popover-header{cursor:grabbing}.markup-popover-header-actions{align-items:center;gap:4px;display:flex}.markup-thread-menu{display:flex;position:relative}.markup-thread-menu-list{z-index:10;background:var(--markup-paper);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);min-width:160px;box-shadow:var(--markup-shadow);padding:4px;animation:.12s ease-out markup-menu-in;position:absolute;top:calc(100% + 6px);right:0}.markup-thread-menu-item{border-radius:var(--markup-radius-sm);width:100%;color:var(--markup-ink);text-align:left;cursor:pointer;background:0 0;border:none;padding:7px 10px;font-size:13px;transition:background .1s,color .1s;display:block}.markup-thread-menu-item:hover{background:var(--markup-border)}.markup-thread-menu-item.is-danger{color:var(--markup-danger,#dc2626)}.markup-thread-menu-item.is-danger:hover{background:color-mix(in srgb, var(--markup-danger,#dc2626) 10%, transparent)}.markup-thread-menu-item:disabled{opacity:.5;cursor:default}@keyframes markup-menu-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.markup-popover-body{padding:12px}.markup-popover-byline{color:var(--markup-muted);align-items:center;gap:4px;margin:0 0 8px;font-size:12px;display:flex}.markup-popover-name{color:var(--markup-ink);font-weight:500}.markup-icon-btn{border-radius:var(--markup-radius-sm);width:24px;height:24px;color:var(--markup-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.markup-icon-btn:hover,.markup-icon-btn.is-open{background:var(--markup-border);color:var(--markup-ink)}.markup-comments{border-bottom:1px solid var(--markup-border);background:linear-gradient(var(--markup-paper), transparent) top / 100% 20px no-repeat local, linear-gradient(transparent, var(--markup-paper)) bottom / 100% 20px no-repeat local, radial-gradient(farthest-side at 50% 0%, #1a16141a, transparent) top / 100% 10px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, #1a16141a, transparent) bottom / 100% 10px no-repeat scroll;flex-direction:column;gap:12px;max-height:280px;margin:0;padding:8px 12px 4px;list-style:none;display:flex;overflow-y:auto}.markup-comment{flex-direction:column;gap:4px;display:flex}.markup-comment-meta{align-items:center;gap:6px;font-size:11px;display:flex}.markup-comment-author{color:var(--markup-ink);font-weight:600}.markup-comment.is-team .markup-comment-author{color:var(--markup-team)}.markup-comment-badge{background:color-mix(in srgb, var(--markup-team) 12%, transparent);height:14px;color:var(--markup-team);font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;border-radius:999px;align-items:center;padding:0 5px;font-size:9px;font-weight:500;line-height:1;display:inline-flex}.markup-comment-time{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.04em;font-size:10px}.markup-comment-body{white-space:pre-wrap;word-break:break-word;margin:0;font-size:13px;line-height:1.5}.markup-comment-edited{color:var(--markup-muted);font-size:11px}.markup-thread-actions{align-items:center;gap:4px;display:flex}.markup-comment-meta .markup-reaction-picker-wrap,.markup-thread-actions{margin-left:auto}.markup-comment-meta .markup-reaction-add{width:22px;height:22px;margin-top:-4px;margin-bottom:-4px}.markup-reaction-picker-wrap>.markup-icon-btn,.markup-comment-menu>.markup-icon-btn{margin-top:-4px;margin-bottom:-4px}.markup-comment-menu.is-up .markup-thread-menu-list{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}@keyframes markup-menu-in-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.markup-comment{position:relative}.markup-reactions{flex-wrap:wrap;align-items:center;gap:4px;margin-top:2px;display:flex}.markup-reaction-chip{border:1px solid var(--markup-border);height:22px;color:var(--markup-ink);font:inherit;cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:4px;padding:0 7px 0 6px;font-size:11px;line-height:1;transition:background .12s,border-color .12s;display:inline-flex}.markup-reaction-chip:hover:not(:disabled){background:color-mix(in srgb, var(--markup-ink) 5%, transparent)}.markup-reaction-chip.is-mine{border-color:color-mix(in srgb, var(--markup-brand) 45%, transparent);background:color-mix(in srgb, var(--markup-brand) 10%, transparent)}.markup-reaction-chip.is-mine:hover:not(:disabled){background:color-mix(in srgb, var(--markup-brand) 16%, transparent)}.markup-reaction-chip:disabled{cursor:default;opacity:.6}.markup-reaction-emoji{font-size:13px;line-height:1}.markup-reaction-count{font-family:var(--markup-font-mono);letter-spacing:.04em;color:var(--markup-muted);font-size:10px}.markup-reaction-chip.is-mine .markup-reaction-count{color:var(--markup-brand)}.markup-reaction-picker-wrap{opacity:0;flex:none;transition:opacity .12s;display:inline-flex;position:relative}.markup-comment:hover .markup-reaction-picker-wrap,.markup-comment:focus-within .markup-reaction-picker-wrap,.markup-reaction-picker-wrap.is-open{opacity:1}.markup-reaction-add{border:1px dashed var(--markup-border-strong);width:22px;height:22px;color:var(--markup-muted);font:inherit;cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;font-size:13px;line-height:1;transition:background .12s,color .12s,border-color .12s;display:inline-flex}.markup-reaction-add:hover,.markup-reaction-add.is-open{background:color-mix(in srgb, var(--markup-ink) 5%, transparent);color:var(--markup-ink);border-style:solid}.markup-reaction-picker{z-index:1;border:1px solid var(--markup-border-strong);background:var(--markup-paper);border-radius:8px;gap:2px;padding:4px;animation:.12s markup-menu-in;display:flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 1px 2px #1a16140f,0 8px 28px #1a16141a}.markup-reaction-picker-wrap.is-up .markup-reaction-picker{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}.markup-reaction-picker-item{cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;width:28px;height:28px;font-size:16px;line-height:1;transition:background .12s;display:inline-flex}.markup-reaction-picker-item:hover{background:color-mix(in srgb, var(--markup-ink) 8%, transparent)}.markup-reaction-picker-item.is-mine{background:color-mix(in srgb, var(--markup-brand) 14%, transparent)}.markup-comment-edit-form{flex-direction:column;gap:6px;display:flex}.markup-comment-edit-form .markup-textarea{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;color:var(--markup-ink);resize:vertical;font:inherit;outline:none;padding:8px 10px;font-size:13px;line-height:1.5}.markup-comment-edit-form .markup-textarea:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-comment-edit-actions{justify-content:flex-end;gap:6px;display:flex}.markup-composer{flex-direction:column;display:flex;position:relative}.markup-composer-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;min-height:36px;max-height:96px;color:var(--markup-ink);resize:none;font-family:var(--markup-font);outline:none;padding:8px 10px;font-size:13px;line-height:1.5;transition:border-color .12s,box-shadow .12s,border-bottom-left-radius .15s,border-bottom-right-radius .15s}.markup-composer-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-composer-input:disabled{opacity:.6}.markup-composer-input::placeholder{color:var(--markup-muted)}.markup-composer.is-filled .markup-composer-input{border-bottom-right-radius:0;border-bottom-left-radius:0}.markup-composer-footer-wrap{grid-template-rows:0fr;transition:grid-template-rows .15s;display:grid}.markup-composer.is-filled .markup-composer-footer-wrap{grid-template-rows:1fr}.markup-composer-footer{border:1px solid var(--markup-border-strong);border-radius:0 0 var(--markup-radius-sm) var(--markup-radius-sm);opacity:0;border-top:none;justify-content:space-between;align-items:center;gap:8px;padding:2px 2px 2px 10px;transition:opacity .1s;display:flex;overflow:hidden}.markup-composer.is-filled .markup-composer-footer{opacity:1;transition-delay:60ms}.markup-composer-hint{font-family:var(--markup-font-mono);letter-spacing:.06em;color:var(--markup-muted);font-size:10px}.markup-composer-error{color:var(--markup-brand)}.markup-composer-actions{align-items:center;gap:6px;display:flex}.markup-composer-actions-empty{transition:opacity .12s;position:absolute;top:3px;right:3px}.markup-composer.is-filled .markup-composer-actions-empty{opacity:0;pointer-events:none}.markup-author-prompt{flex-direction:column;gap:10px;padding:12px;display:flex}.markup-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;height:36px;color:var(--markup-ink);outline:none;padding:0 10px;font-size:14px;transition:border-color .12s,box-shadow .12s}.markup-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-btn{border-radius:var(--markup-radius-sm);height:30px;color:var(--markup-ink);cursor:pointer;letter-spacing:-.01em;white-space:nowrap;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:6px;padding:0 8px;font-size:12px;font-weight:500;transition:background .12s,border-color .12s,color .12s,opacity .12s;display:inline-flex}.markup-btn:disabled{opacity:.5;cursor:not-allowed}.markup-btn-primary{background:var(--markup-ink);color:var(--markup-paper)}.markup-btn-primary:hover:not(:disabled){background:var(--markup-brand)}.markup-btn-ghost{color:var(--markup-muted)}.markup-btn-ghost:hover:not(:disabled){background:var(--markup-border);color:var(--markup-ink)}.markup-screenshot-row{border-top:1px solid var(--markup-border);margin-top:8px;padding-top:8px}.markup-screenshot-status{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;display:flex}.markup-screenshot-toggle{cursor:pointer;color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;transition:color .12s;display:flex}.markup-screenshot-toggle:hover{color:var(--markup-ink)}.markup-screenshot-checkbox{width:12px;height:12px;accent-color:var(--markup-brand);cursor:pointer;margin:0}.markup-screenshot-thumb{border:1px solid var(--markup-border-strong);object-fit:cover;border-radius:3px;flex-shrink:0;width:auto;height:25px;margin:-5px 0 -5px auto;display:block}.markup-comment-screenshot{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);cursor:pointer;background:0 0;margin-top:8px;padding:0;transition:border-color .12s,opacity .12s;display:block;overflow:hidden}.markup-comment-screenshot:hover{border-color:var(--markup-brand);opacity:.9}.markup-comment-screenshot img{object-fit:cover;object-position:top;width:100%;height:auto;max-height:120px;display:block}.markup-lightbox{background:#1a1614e0;border:none;width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:24px;position:fixed;inset:0}.markup-lightbox[open]{justify-content:center;align-items:center;display:flex}.markup-lightbox::backdrop{display:none}.markup-lightbox-img{border-radius:var(--markup-radius);object-fit:contain;max-width:100%;max-height:100%;box-shadow:var(--markup-shadow);animation:.16s ease-out markup-lightbox-in}.markup-lightbox-close{color:#fdfcfa;background:#1a161499;position:absolute;top:16px;right:16px}.markup-lightbox-close:hover{color:#fdfcfa;background:#1a1614d9}@keyframes markup-lightbox-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){.markup-fab,.markup-pin,.markup-icon-btn,.markup-btn,.markup-popover,.markup-pin-ghost,.markup-placement-overlay,.markup-placement-cursor-help,.markup-lightbox-img{transition:none;animation:none}}", P, F, pe, me, he = 0, ge = [], I = n, _e = I.__b, ve = I.__r, ye = I.diffed, be = I.__c, xe = I.unmount, Se = I.__;
253
253
  function Ce(e, t) {
254
254
  I.__h && I.__h(F, e, he || t), he = 0;
255
255
  var n = F.__H ||= {
@@ -262,7 +262,7 @@ function L(e) {
262
262
  return he = 1, we(Me, e);
263
263
  }
264
264
  function we(e, t, n) {
265
- var r = Ce(fe++, 2);
265
+ var r = Ce(P++, 2);
266
266
  if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Me(void 0, t), function(e) {
267
267
  var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
268
268
  t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
@@ -296,7 +296,7 @@ function we(e, t, n) {
296
296
  return r.__N || r.__;
297
297
  }
298
298
  function R(e, t) {
299
- var n = Ce(fe++, 3);
299
+ var n = Ce(P++, 3);
300
300
  !I.__s && je(n.__H, t) && (n.__ = e, n.u = t, F.__H.__h.push(n));
301
301
  }
302
302
  function z(e) {
@@ -305,7 +305,7 @@ function z(e) {
305
305
  }, []);
306
306
  }
307
307
  function Te(e, t) {
308
- var n = Ce(fe++, 7);
308
+ var n = Ce(P++, 7);
309
309
  return je(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
310
310
  }
311
311
  function B(e, t) {
@@ -328,11 +328,11 @@ I.__b = function(e) {
328
328
  }, I.__ = function(e, t) {
329
329
  e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Se && Se(e, t);
330
330
  }, I.__r = function(e) {
331
- ve && ve(e), fe = 0;
331
+ ve && ve(e), P = 0;
332
332
  var t = (F = e.__c).__H;
333
333
  t && (pe === F ? (t.__h = [], F.__h = [], t.__.some(function(e) {
334
334
  e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
335
- })) : (t.__h.some(ke), t.__h.some(Ae), t.__h = [], fe = 0)), pe = F;
335
+ })) : (t.__h.some(ke), t.__h.some(Ae), t.__h = [], P = 0)), pe = F;
336
336
  }, I.diffed = function(e) {
337
337
  ye && ye(e);
338
338
  var t = e.__c;
@@ -3490,20 +3490,62 @@ function ua({ size: e = 16 }) {
3490
3490
  }
3491
3491
  //#endregion
3492
3492
  //#region src/runtime/ui/fab.tsx
3493
- function da({ active: e, onToggle: t, onHide: n, position: r = "bottom-right" }) {
3493
+ function da({ active: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i }) {
3494
+ let a = r === "bottom-left" ? "markup-fab-left" : "markup-fab-right", o = z(null), [s, c] = L(null), [l, u] = L(!1), d = z(!1);
3495
+ function f(e) {
3496
+ if (e.stopPropagation(), e.button !== 0) return;
3497
+ let t = o.current;
3498
+ if (!t) return;
3499
+ let n = t, a = n.getBoundingClientRect(), s = e.clientX, l = e.clientY, f = a.left, p = a.top, m = a.width, h = a.height, g = !1;
3500
+ d.current = !1;
3501
+ try {
3502
+ n.setPointerCapture(e.pointerId);
3503
+ } catch {}
3504
+ function _(e) {
3505
+ let t = e.clientX - s, n = e.clientY - l;
3506
+ if (!g) {
3507
+ if (Math.abs(t) + Math.abs(n) < 4) return;
3508
+ g = !0, d.current = !0, u(!0);
3509
+ }
3510
+ let r = Math.max(8, window.innerWidth - m - 8), i = Math.max(8, window.innerHeight - h - 8);
3511
+ c({
3512
+ left: fa(f + t, 8, r),
3513
+ top: fa(p + n, 8, i)
3514
+ });
3515
+ }
3516
+ function v(e) {
3517
+ try {
3518
+ n.releasePointerCapture(e.pointerId);
3519
+ } catch {}
3520
+ if (n.removeEventListener("pointermove", _), n.removeEventListener("pointerup", v), n.removeEventListener("pointercancel", v), g) {
3521
+ let t = e.clientX < window.innerWidth / 2 ? "bottom-left" : "bottom-right";
3522
+ t !== r && i?.(t);
3523
+ }
3524
+ c(null), u(!1);
3525
+ }
3526
+ n.addEventListener("pointermove", _), n.addEventListener("pointerup", v), n.addEventListener("pointercancel", v);
3527
+ }
3528
+ function p(e) {
3529
+ if (e.preventDefault(), e.stopPropagation(), d.current) {
3530
+ d.current = !1;
3531
+ return;
3532
+ }
3533
+ if ((e.metaKey || e.ctrlKey) && n) {
3534
+ n();
3535
+ return;
3536
+ }
3537
+ t();
3538
+ }
3494
3539
  return /* @__PURE__ */ $("button", {
3540
+ ref: o,
3495
3541
  type: "button",
3496
- class: Q("markup-fab", r === "bottom-left" ? "markup-fab-left" : "markup-fab-right", e && "is-active"),
3497
- onClick: (e) => {
3498
- if (e.preventDefault(), e.stopPropagation(), (e.metaKey || e.ctrlKey) && n) {
3499
- n();
3500
- return;
3501
- }
3502
- t();
3503
- },
3504
- onPointerDown: (e) => {
3505
- e.preventDefault(), e.stopPropagation();
3506
- },
3542
+ class: Q("markup-fab", !s && a, s && "is-floating", l && "is-dragging", e && "is-active"),
3543
+ style: s ? {
3544
+ left: `${s.left}px`,
3545
+ top: `${s.top}px`
3546
+ } : void 0,
3547
+ onClick: p,
3548
+ onPointerDown: f,
3507
3549
  "aria-label": e ? "Cancel placing markup" : "Leave a markup",
3508
3550
  "aria-pressed": e,
3509
3551
  children: [/* @__PURE__ */ $("span", {
@@ -3515,9 +3557,12 @@ function da({ active: e, onToggle: t, onHide: n, position: r = "bottom-right" })
3515
3557
  })]
3516
3558
  });
3517
3559
  }
3560
+ function fa(e, t, n) {
3561
+ return Math.max(t, Math.min(n, e));
3562
+ }
3518
3563
  //#endregion
3519
3564
  //#region src/runtime/use-focus-trap.ts
3520
- var fa = [
3565
+ var pa = [
3521
3566
  "a[href]",
3522
3567
  "button:not([disabled])",
3523
3568
  "input:not([disabled])",
@@ -3525,14 +3570,14 @@ var fa = [
3525
3570
  "textarea:not([disabled])",
3526
3571
  "[tabindex]:not([tabindex=\"-1\"])"
3527
3572
  ].join(",");
3528
- function pa(e, t) {
3573
+ function ma(e, t) {
3529
3574
  R(() => {
3530
3575
  if (!t) return;
3531
3576
  let n = e.current;
3532
3577
  if (!n) return;
3533
3578
  function r(e) {
3534
3579
  if (e.key !== "Tab") return;
3535
- let t = Array.from(n.querySelectorAll(fa)), r = t[0], i = t[t.length - 1];
3580
+ let t = Array.from(n.querySelectorAll(pa)), r = t[0], i = t[t.length - 1];
3536
3581
  if (!r || !i) return;
3537
3582
  let a = n.getRootNode(), o = a instanceof ShadowRoot ? a.activeElement : document.activeElement;
3538
3583
  (e.shiftKey ? o === r : o === i) && (e.preventDefault(), (e.shiftKey ? i : r).focus());
@@ -3542,7 +3587,7 @@ function pa(e, t) {
3542
3587
  }
3543
3588
  //#endregion
3544
3589
  //#region src/runtime/ui/author-prompt.tsx
3545
- function ma({ pending: e, onSubmit: t, onCancel: n, onSignIn: r }) {
3590
+ function ha({ pending: e, onSubmit: t, onCancel: n, onSignIn: r }) {
3546
3591
  let [i, a] = L(""), [o, s] = L(""), c = z(null);
3547
3592
  R(() => {
3548
3593
  c.current?.focus();
@@ -3614,8 +3659,8 @@ function ma({ pending: e, onSubmit: t, onCancel: n, onSignIn: r }) {
3614
3659
  }
3615
3660
  //#endregion
3616
3661
  //#region src/runtime/ui/composer.tsx
3617
- var ha = 4e3;
3618
- function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, pending: i, error: a, onSubmit: o }) {
3662
+ var ga = 4e3;
3663
+ function _a({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, pending: i, error: a, onSubmit: o }) {
3619
3664
  let [s, c] = L(""), l = z(null), u = z(!1);
3620
3665
  R(() => {
3621
3666
  r && l.current?.focus();
@@ -3633,7 +3678,7 @@ function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
3633
3678
  function f(e) {
3634
3679
  (e.metaKey || e.ctrlKey) && e.key === "Enter" && d(e);
3635
3680
  }
3636
- let p = ha - s.length, m = p < 0, h = s.length > 0;
3681
+ let p = ga - s.length, m = p < 0, h = s.length > 0;
3637
3682
  function g(e) {
3638
3683
  return /* @__PURE__ */ $("button", {
3639
3684
  type: "submit",
@@ -3655,7 +3700,7 @@ function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
3655
3700
  class: "markup-composer-input",
3656
3701
  placeholder: t,
3657
3702
  rows: h ? 2 : 1,
3658
- maxLength: ha + 100,
3703
+ maxLength: ga + 100,
3659
3704
  value: s,
3660
3705
  onInput: (e) => c(e.currentTarget.value),
3661
3706
  onKeyDown: f,
@@ -3691,10 +3736,10 @@ function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
3691
3736
  }
3692
3737
  //#endregion
3693
3738
  //#region src/runtime/ui/new-thread-popover.tsx
3694
- function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, pending: i, error: a, screenshot: o, screenshotCapturing: s, onAuthor: c, onSignIn: l, onSubmit: u, onClose: d }) {
3739
+ function va({ pageX: e, pageY: t, authorName: n, isVerified: r, pending: i, error: a, screenshot: o, screenshotCapturing: s, onAuthor: c, onSignIn: l, onSubmit: u, onClose: d }) {
3695
3740
  let f = z(null);
3696
- pa(f, !0);
3697
- let [p, m] = L(!1), [h, g] = L(null);
3741
+ ma(f, !0);
3742
+ let [p, m] = L(!1), [h, g] = L(null), [_, v] = L(null), [y, b] = L(!1);
3698
3743
  R(() => {
3699
3744
  if (!o) return;
3700
3745
  let e = URL.createObjectURL(o);
@@ -3710,19 +3755,48 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, pending: i, erro
3710
3755
  }
3711
3756
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
3712
3757
  }, [d]);
3713
- let _ = va(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), v = va(t - window.scrollY - 16, 12, window.innerHeight - 220), y = o != null, b = s || y;
3758
+ let x = ya(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), S = ya(t - window.scrollY - 16, 12, window.innerHeight - 220), C = o != null, w = s || C;
3759
+ function T(e) {
3760
+ if (e.button !== 0 || e.target?.closest("button, a, input, textarea, select")) return;
3761
+ let t = f.current;
3762
+ if (!t) return;
3763
+ let n = t.getBoundingClientRect(), r = e.clientX, i = e.clientY, a = n.left, o = n.top, s = n.width, c = n.height, l = e.currentTarget, u = !1;
3764
+ try {
3765
+ l.setPointerCapture(e.pointerId);
3766
+ } catch {}
3767
+ function d(e) {
3768
+ let t = e.clientX - r, n = e.clientY - i;
3769
+ if (!u) {
3770
+ if (Math.abs(t) + Math.abs(n) < 4) return;
3771
+ u = !0, b(!0);
3772
+ }
3773
+ let l = Math.max(8, window.innerWidth - s - 8), d = Math.max(8, window.innerHeight - c - 8);
3774
+ v({
3775
+ left: ya(a + t, 8, l),
3776
+ top: ya(o + n, 8, d)
3777
+ });
3778
+ }
3779
+ function p(e) {
3780
+ try {
3781
+ l.releasePointerCapture(e.pointerId);
3782
+ } catch {}
3783
+ l.removeEventListener("pointermove", d), l.removeEventListener("pointerup", p), l.removeEventListener("pointercancel", p), b(!1);
3784
+ }
3785
+ l.addEventListener("pointermove", d), l.addEventListener("pointerup", p), l.addEventListener("pointercancel", p);
3786
+ }
3714
3787
  return /* @__PURE__ */ $("div", {
3715
3788
  ref: f,
3716
- class: "markup-popover",
3789
+ class: Q("markup-popover", _ && "is-floating", y && "is-dragging"),
3717
3790
  popover: "auto",
3718
3791
  style: {
3719
- "--markup-pop-x": `${_}px`,
3720
- "--markup-pop-y": `${v}px`
3792
+ "--markup-pop-x": `${_?.left ?? x}px`,
3793
+ "--markup-pop-y": `${_?.top ?? S}px`
3721
3794
  },
3722
3795
  role: "dialog",
3723
3796
  "aria-label": "New markup",
3724
3797
  children: [/* @__PURE__ */ $("header", {
3725
3798
  class: "markup-popover-header",
3799
+ onPointerDown: T,
3726
3800
  children: [/* @__PURE__ */ $("span", {
3727
3801
  class: "markup-eyebrow",
3728
3802
  children: "new · markup"
@@ -3733,7 +3807,7 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, pending: i, erro
3733
3807
  onClick: d,
3734
3808
  children: /* @__PURE__ */ $(aa, { size: 16 })
3735
3809
  })]
3736
- }), n == null ? /* @__PURE__ */ $(ma, {
3810
+ }), n == null ? /* @__PURE__ */ $(ha, {
3737
3811
  pending: i,
3738
3812
  onSubmit: c,
3739
3813
  onCancel: d,
@@ -3755,15 +3829,15 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, pending: i, erro
3755
3829
  }) : null
3756
3830
  ]
3757
3831
  }),
3758
- /* @__PURE__ */ $(ga, {
3832
+ /* @__PURE__ */ $(_a, {
3759
3833
  label: "Feedback",
3760
3834
  placeholder: "What's wrong, missing, or worth noting?",
3761
3835
  submitLabel: "Post markup",
3762
3836
  pending: i,
3763
3837
  error: a,
3764
- onSubmit: (e) => u(e, p && y)
3838
+ onSubmit: (e) => u(e, p && C)
3765
3839
  }),
3766
- b ? /* @__PURE__ */ $("div", {
3840
+ w ? /* @__PURE__ */ $("div", {
3767
3841
  class: "markup-screenshot-row",
3768
3842
  children: s ? /* @__PURE__ */ $("span", {
3769
3843
  class: "markup-screenshot-status",
@@ -3799,12 +3873,12 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, pending: i, erro
3799
3873
  })]
3800
3874
  });
3801
3875
  }
3802
- function va(e, t, n) {
3876
+ function ya(e, t, n) {
3803
3877
  return Math.max(t, Math.min(n, e));
3804
3878
  }
3805
3879
  //#endregion
3806
3880
  //#region src/runtime/ui/pin.tsx
3807
- function ya({ pageX: e, pageY: t, count: n, active: r, onClick: i }) {
3881
+ function ba({ pageX: e, pageY: t, count: n, active: r, onClick: i }) {
3808
3882
  let a = t - window.scrollY, o = e - window.scrollX;
3809
3883
  return /* @__PURE__ */ $("button", {
3810
3884
  type: "button",
@@ -3827,7 +3901,7 @@ function ya({ pageX: e, pageY: t, count: n, active: r, onClick: i }) {
3827
3901
  }) : null]
3828
3902
  });
3829
3903
  }
3830
- function ba({ pageX: e, pageY: t }) {
3904
+ function xa({ pageX: e, pageY: t }) {
3831
3905
  let n = t - window.scrollY, r = e - window.scrollX;
3832
3906
  return /* @__PURE__ */ $("div", {
3833
3907
  class: "markup-pin markup-pin-ghost is-anchor",
@@ -3843,7 +3917,7 @@ function ba({ pageX: e, pageY: t }) {
3843
3917
  }
3844
3918
  //#endregion
3845
3919
  //#region src/runtime/ui/placement-overlay.tsx
3846
- function xa({ onPlace: e, onCancel: t }) {
3920
+ function Sa({ onPlace: e, onCancel: t }) {
3847
3921
  R(() => {
3848
3922
  function e(e) {
3849
3923
  e.key === "Escape" && t();
@@ -3869,7 +3943,7 @@ function xa({ onPlace: e, onCancel: t }) {
3869
3943
  }
3870
3944
  //#endregion
3871
3945
  //#region src/runtime/ui/thread-popover.tsx
3872
- var Sa = [
3946
+ var Ca = [
3873
3947
  "👍",
3874
3948
  "❤️",
3875
3949
  "🎉",
@@ -3877,32 +3951,32 @@ var Sa = [
3877
3951
  "😄",
3878
3952
  "❓"
3879
3953
  ];
3880
- function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDelete: i, pending: a, error: o, onAuthor: s, onSignIn: c, onClose: l, onReply: u, onEditComment: d, onDeleteComment: f, onToggleReaction: p, onResolve: m, onDelete: h }) {
3881
- let g = z(null), _ = z(null), v = z(null), y = z(null), b = z(null), [x, S] = L(!1), [C, w] = L(!1), [T, E] = L(null), [D, O] = L(""), [k, A] = L(null), [ee, j] = L("down"), [M, te] = L(null), [N, ne] = L(null), [re, ie] = L("down"), ae = z(null);
3882
- pa(g, !0);
3883
- let oe = e.resolvedAt != null, P = Te(() => e.comments.filter((e) => !e.deleted), [e.comments]);
3884
- function se(e, t) {
3954
+ function wa({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDelete: i, pending: a, error: o, onAuthor: s, onSignIn: c, onClose: l, onReply: u, onEditComment: d, onDeleteComment: f, onToggleReaction: p, onResolve: m, onDelete: h }) {
3955
+ let g = z(null), _ = z(null), v = z(null), y = z(null), b = z(null), [x, S] = L(!1), [C, w] = L(!1), [T, E] = L(null), [D, O] = L(""), [k, A] = L(null), [ee, j] = L("down"), [M, te] = L(null), [N, ne] = L(null), [re, ie] = L("down"), ae = z(null), [oe, se] = L(null), [ce, le] = L(!1);
3956
+ ma(g, !0);
3957
+ let ue = e.resolvedAt != null, de = Te(() => e.comments.filter((e) => !e.deleted), [e.comments]);
3958
+ function fe(e, t) {
3885
3959
  E(e), O(t);
3886
3960
  }
3887
- function ce() {
3961
+ function P() {
3888
3962
  E(null), O("");
3889
3963
  }
3890
3964
  R(() => {
3891
3965
  if (!T) return;
3892
3966
  let t = e.comments.find((e) => e._id === T);
3893
- (!t || t.deleted) && ce();
3967
+ (!t || t.deleted) && P();
3894
3968
  }, [e.comments, T]);
3895
- let le = z(!0);
3969
+ let F = z(!0);
3896
3970
  R(() => {
3897
3971
  let e = y.current;
3898
3972
  if (e) {
3899
- if (le.current) {
3900
- le.current = !1, e.scrollTop = e.scrollHeight;
3973
+ if (F.current) {
3974
+ F.current = !1, e.scrollTop = e.scrollHeight;
3901
3975
  return;
3902
3976
  }
3903
3977
  e.scrollHeight - e.scrollTop - e.clientHeight < 80 && (e.scrollTop = e.scrollHeight);
3904
3978
  }
3905
- }, [P.length]), R(() => {
3979
+ }, [de.length]), R(() => {
3906
3980
  if (!x) {
3907
3981
  w(!1);
3908
3982
  return;
@@ -3937,15 +4011,43 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
3937
4011
  }
3938
4012
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
3939
4013
  }, [l]);
3940
- let ue = Te(() => {
4014
+ function pe(e) {
4015
+ if (e.button !== 0 || e.target?.closest("button, a, input, textarea, select")) return;
4016
+ let t = g.current;
4017
+ if (!t) return;
4018
+ let n = t.getBoundingClientRect(), r = e.clientX, i = e.clientY, a = n.left, o = n.top, s = n.width, c = n.height, l = e.currentTarget, u = !1;
4019
+ try {
4020
+ l.setPointerCapture(e.pointerId);
4021
+ } catch {}
4022
+ function d(e) {
4023
+ let t = e.clientX - r, n = e.clientY - i;
4024
+ if (!u) {
4025
+ if (Math.abs(t) + Math.abs(n) < 4) return;
4026
+ u = !0, le(!0);
4027
+ }
4028
+ let l = Math.max(8, window.innerWidth - s - 8), d = Math.max(8, window.innerHeight - c - 8);
4029
+ se({
4030
+ left: Oa(a + t, 8, l),
4031
+ top: Oa(o + n, 8, d)
4032
+ });
4033
+ }
4034
+ function f(e) {
4035
+ try {
4036
+ l.releasePointerCapture(e.pointerId);
4037
+ } catch {}
4038
+ l.removeEventListener("pointermove", d), l.removeEventListener("pointerup", f), l.removeEventListener("pointercancel", f), le(!1);
4039
+ }
4040
+ l.addEventListener("pointermove", d), l.addEventListener("pointerup", f), l.addEventListener("pointercancel", f);
4041
+ }
4042
+ let me = Te(() => {
3941
4043
  let t = Dr({
3942
4044
  anchorX: e.anchorX,
3943
4045
  anchorY: e.anchorY,
3944
4046
  anchorSelector: e.anchorSelector
3945
4047
  });
3946
4048
  return {
3947
- left: Da(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
3948
- top: Da(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
4049
+ left: Oa(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
4050
+ top: Oa(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
3949
4051
  };
3950
4052
  }, [
3951
4053
  e.anchorX,
@@ -3955,24 +4057,25 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
3955
4057
  return /* @__PURE__ */ $("div", {
3956
4058
  ref: g,
3957
4059
  id: "markup-thread-popover",
3958
- class: "markup-popover",
4060
+ class: Q("markup-popover", oe && "is-floating", ce && "is-dragging"),
3959
4061
  popover: "auto",
3960
4062
  style: {
3961
- "--markup-pop-x": `${ue.left}px`,
3962
- "--markup-pop-y": `${ue.top}px`
4063
+ "--markup-pop-x": `${oe?.left ?? me.left}px`,
4064
+ "--markup-pop-y": `${oe?.top ?? me.top}px`
3963
4065
  },
3964
4066
  role: "dialog",
3965
4067
  "aria-label": "Markup thread",
3966
4068
  children: [
3967
4069
  /* @__PURE__ */ $("header", {
3968
4070
  class: "markup-popover-header",
4071
+ onPointerDown: pe,
3969
4072
  children: [/* @__PURE__ */ $("span", {
3970
4073
  class: "markup-eyebrow",
3971
4074
  children: [
3972
4075
  "thread · ",
3973
- P.length,
4076
+ de.length,
3974
4077
  " ",
3975
- P.length === 1 ? "comment" : "comments"
4078
+ de.length === 1 ? "comment" : "comments"
3976
4079
  ]
3977
4080
  }), /* @__PURE__ */ $("div", {
3978
4081
  class: "markup-popover-header-actions",
@@ -4028,8 +4131,8 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4028
4131
  /* @__PURE__ */ $("ol", {
4029
4132
  ref: y,
4030
4133
  class: "markup-comments",
4031
- children: P.map((t, r) => {
4032
- let i = !t.fromDashboard && n != null && t.authorClientId === n, o = r === 0, s = i && !oe && !t.deleted, c = i && !oe && !t.deleted && !o, l = T === t._id, u = (s || c) && !l && !t.deleted, m = k === t._id, h = M === t._id;
4134
+ children: de.map((t, r) => {
4135
+ let i = !t.fromDashboard && n != null && t.authorClientId === n, o = r === 0, s = i && !ue && !t.deleted, c = i && !ue && !t.deleted && !o, l = T === t._id, u = (s || c) && !l && !t.deleted, m = k === t._id, h = M === t._id;
4033
4136
  return /* @__PURE__ */ $("li", {
4034
4137
  class: Q("markup-comment", t.fromDashboard && "is-team"),
4035
4138
  children: [
@@ -4047,12 +4150,12 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4047
4150
  /* @__PURE__ */ $("time", {
4048
4151
  class: "markup-comment-time",
4049
4152
  datetime: new Date(t.createdAt).toISOString(),
4050
- title: ka(t.createdAt),
4051
- children: Oa(t.createdAt)
4153
+ title: Aa(t.createdAt),
4154
+ children: ka(t.createdAt)
4052
4155
  }),
4053
4156
  /* @__PURE__ */ $("div", {
4054
4157
  class: "markup-thread-actions",
4055
- children: [!oe && !l ? /* @__PURE__ */ $(wa, {
4158
+ children: [!ue && !l ? /* @__PURE__ */ $(Ta, {
4056
4159
  comment: t,
4057
4160
  pickerOpen: N === t._id,
4058
4161
  pickerDirection: re,
@@ -4094,7 +4197,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4094
4197
  type: "button",
4095
4198
  class: "markup-thread-menu-item",
4096
4199
  onClick: () => {
4097
- A(null), se(t._id, t.body);
4200
+ A(null), fe(t._id, t.body);
4098
4201
  },
4099
4202
  children: "Edit"
4100
4203
  }) : null, c ? /* @__PURE__ */ $("button", {
@@ -4116,11 +4219,11 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4116
4219
  e.preventDefault();
4117
4220
  let n = D.trim();
4118
4221
  if (!n || n === t.body) {
4119
- ce();
4222
+ P();
4120
4223
  return;
4121
4224
  }
4122
4225
  try {
4123
- await d(t._id, n), ce();
4226
+ await d(t._id, n), P();
4124
4227
  } catch {}
4125
4228
  },
4126
4229
  children: [/* @__PURE__ */ $("textarea", {
@@ -4135,7 +4238,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4135
4238
  children: [/* @__PURE__ */ $("button", {
4136
4239
  type: "button",
4137
4240
  class: "markup-btn markup-btn-ghost",
4138
- onClick: ce,
4241
+ onClick: P,
4139
4242
  disabled: a,
4140
4243
  children: "Cancel"
4141
4244
  }), /* @__PURE__ */ $("button", {
@@ -4150,13 +4253,13 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4150
4253
  children: [t.body, t.editedAt == null ? null : /* @__PURE__ */ $("time", {
4151
4254
  class: "markup-comment-edited",
4152
4255
  datetime: new Date(t.editedAt).toISOString(),
4153
- title: ka(t.editedAt),
4256
+ title: Aa(t.editedAt),
4154
4257
  children: [" ", "(edited)"]
4155
4258
  })]
4156
4259
  }),
4157
- !l && t.reactions.length > 0 ? /* @__PURE__ */ $(Ta, {
4260
+ !l && t.reactions.length > 0 ? /* @__PURE__ */ $(Ea, {
4158
4261
  comment: t,
4159
- isResolved: oe,
4262
+ isResolved: ue,
4160
4263
  onToggle: (e) => p(t._id, e)
4161
4264
  }) : null,
4162
4265
  r === 0 && e.screenshotUrl ? /* @__PURE__ */ $("button", {
@@ -4191,7 +4294,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4191
4294
  onClick: (e) => e.stopPropagation()
4192
4295
  })]
4193
4296
  }) : null,
4194
- t == null ? /* @__PURE__ */ $(ma, {
4297
+ t == null ? /* @__PURE__ */ $(ha, {
4195
4298
  pending: a,
4196
4299
  onSubmit: s,
4197
4300
  onCancel: l,
@@ -4211,7 +4314,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4211
4314
  children: "team"
4212
4315
  }) : null
4213
4316
  ]
4214
- }), /* @__PURE__ */ $(ga, {
4317
+ }), /* @__PURE__ */ $(_a, {
4215
4318
  label: "Reply",
4216
4319
  placeholder: "Write a reply…",
4217
4320
  submitLabel: "Reply",
@@ -4224,7 +4327,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, canDe
4224
4327
  ]
4225
4328
  });
4226
4329
  }
4227
- function wa({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPickerClick: i, onPickerSelect: a }) {
4330
+ function Ta({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPickerClick: i, onPickerSelect: a }) {
4228
4331
  return /* @__PURE__ */ $("div", {
4229
4332
  class: Q("markup-reaction-picker-wrap", t && "is-open", t && n === "up" && "is-up"),
4230
4333
  ref: r,
@@ -4238,7 +4341,7 @@ function wa({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPic
4238
4341
  }), t ? /* @__PURE__ */ $("div", {
4239
4342
  class: "markup-reaction-picker",
4240
4343
  role: "menu",
4241
- children: Sa.map((t) => /* @__PURE__ */ $("button", {
4344
+ children: Ca.map((t) => /* @__PURE__ */ $("button", {
4242
4345
  type: "button",
4243
4346
  role: "menuitem",
4244
4347
  class: Q("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
@@ -4248,11 +4351,11 @@ function wa({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPic
4248
4351
  }) : null]
4249
4352
  });
4250
4353
  }
4251
- function Ta({ comment: e, isResolved: t, onToggle: n }) {
4354
+ function Ea({ comment: e, isResolved: t, onToggle: n }) {
4252
4355
  return /* @__PURE__ */ $("div", {
4253
4356
  class: "markup-reactions",
4254
4357
  children: e.reactions.map((e) => {
4255
- let r = Ea(e.reactors, e.mine, e.count, e.emoji);
4358
+ let r = Da(e.reactors, e.mine, e.count, e.emoji);
4256
4359
  return /* @__PURE__ */ $("button", {
4257
4360
  type: "button",
4258
4361
  class: Q("markup-reaction-chip", e.mine && "is-mine"),
@@ -4273,14 +4376,14 @@ function Ta({ comment: e, isResolved: t, onToggle: n }) {
4273
4376
  })
4274
4377
  });
4275
4378
  }
4276
- function Ea(e, t, n, r) {
4379
+ function Da(e, t, n, r) {
4277
4380
  let i = e.slice(), a = i.length + +!!t, o = Math.max(0, n - a);
4278
4381
  return o > 0 && i.push(`${o} other${o === 1 ? "" : "s"}`), t && i.push("you"), i.length === 0 ? `${n} reacted with ${r}` : `${i.length === 1 ? i[0] : `${i.slice(0, -1).join(", ")} and ${i[i.length - 1]}`} reacted with ${r}`;
4279
4382
  }
4280
- function Da(e, t, n) {
4383
+ function Oa(e, t, n) {
4281
4384
  return Math.max(t, Math.min(n, e));
4282
4385
  }
4283
- function Oa(e) {
4386
+ function ka(e) {
4284
4387
  let t = Date.now() - e, n = Math.floor(t / 1e3);
4285
4388
  if (n < 60) return "just now";
4286
4389
  let r = Math.floor(n / 60);
@@ -4297,7 +4400,7 @@ function Oa(e) {
4297
4400
  year: "numeric"
4298
4401
  });
4299
4402
  }
4300
- function ka(e) {
4403
+ function Aa(e) {
4301
4404
  return new Date(e).toLocaleDateString([], {
4302
4405
  month: "long",
4303
4406
  day: "numeric",
@@ -4308,7 +4411,7 @@ function ka(e) {
4308
4411
  }
4309
4412
  //#endregion
4310
4413
  //#region src/runtime/ui/app.tsx
4311
- function Aa(e) {
4414
+ function ja(e) {
4312
4415
  return {
4313
4416
  clientId: `markup_user_${e.identity.id}`,
4314
4417
  name: e.identity.name,
@@ -4318,25 +4421,25 @@ function Aa(e) {
4318
4421
  tokenExpiresAt: e.tokenExpiresAt ?? void 0
4319
4422
  };
4320
4423
  }
4321
- function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4322
- let [r, i] = L(() => window.location.pathname), [a, o] = L([]), [s, c] = L(null), l = z(null);
4323
- l.current = s;
4324
- let u = Te(() => Ar({
4424
+ function Ma({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4425
+ let [r, i] = L(() => window.location.pathname), [a, o] = L([]), [s, c] = L(null), [l, u] = L(n), d = z(null);
4426
+ d.current = s;
4427
+ let f = Te(() => Ar({
4325
4428
  apiUrl: e,
4326
4429
  apiKey: t,
4327
4430
  getToken: () => {
4328
- let e = l.current;
4431
+ let e = d.current;
4329
4432
  return e?.token && e.tokenExpiresAt ? {
4330
4433
  token: e.token,
4331
4434
  expiresAt: e.tokenExpiresAt
4332
4435
  } : null;
4333
4436
  },
4334
4437
  getAnonToken: () => {
4335
- let e = l.current;
4438
+ let e = d.current;
4336
4439
  return e?.token && e.tokenExpiresAt ? null : e?.anonToken ?? null;
4337
4440
  },
4338
4441
  onUnauthorized: () => {
4339
- let e = l.current;
4442
+ let e = d.current;
4340
4443
  if (!e) return;
4341
4444
  let t = {
4342
4445
  clientId: e.clientId,
@@ -4344,9 +4447,9 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4344
4447
  email: e.email,
4345
4448
  anonToken: e.anonToken
4346
4449
  };
4347
- l.current = t, c(t), Pr(t);
4450
+ d.current = t, c(t), Pr(t);
4348
4451
  }
4349
- }), [e, t]), [d, f] = L({ kind: "idle" }), [p, m] = L(!1), [h, g] = L(null), [_, v] = L(!1), [y, b] = L(!1), [, x] = L(0), S = z(null), C = s?.name ?? null, w = s?.isVerified ?? !1;
4452
+ }), [e, t]), [p, m] = L({ kind: "idle" }), [h, g] = L(!1), [_, v] = L(null), [y, b] = L(!1), [x, S] = L(!1), [, C] = L(0), w = z(null), T = s?.name ?? null, E = s?.isVerified ?? !1;
4350
4453
  R(() => {
4351
4454
  let e = Nr();
4352
4455
  if (e?.anonToken || e?.isVerified) {
@@ -4355,7 +4458,7 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4355
4458
  }
4356
4459
  let t = !1, n = null, r = 1e3;
4357
4460
  function i() {
4358
- u.mintAnonIdentity().then(({ clientId: n, token: r }) => {
4461
+ f.mintAnonIdentity().then(({ clientId: n, token: r }) => {
4359
4462
  if (t) return;
4360
4463
  let i = {
4361
4464
  ...e ?? {},
@@ -4370,15 +4473,15 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4370
4473
  return i(), () => {
4371
4474
  t = !0, n && clearTimeout(n);
4372
4475
  };
4373
- }, [u]);
4374
- let [T, E] = L(null);
4476
+ }, [f]);
4477
+ let [D, O] = L(null);
4375
4478
  R(() => {
4376
4479
  let e = !1, t = null;
4377
4480
  async function n() {
4378
4481
  try {
4379
- let r = await u.getSubscriptionToken();
4482
+ let r = await f.getSubscriptionToken();
4380
4483
  if (e) return;
4381
- E(r.token);
4484
+ O(r.token);
4382
4485
  let i = Math.max(6e4, r.expiresAt - Date.now() - 30 * 6e4);
4383
4486
  t = setTimeout(n, i);
4384
4487
  } catch {
@@ -4389,37 +4492,37 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4389
4492
  return n(), () => {
4390
4493
  e = !0, t && clearTimeout(t);
4391
4494
  };
4392
- }, [u]);
4393
- let D = z(null);
4495
+ }, [f]);
4496
+ let k = z(null);
4394
4497
  R(() => {
4395
4498
  let t = new ar(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
4396
- return D.current = t, () => {
4397
- t.close(), D.current = null;
4499
+ return k.current = t, () => {
4500
+ t.close(), k.current = null;
4398
4501
  };
4399
4502
  }, [e]);
4400
- let O = z(!1);
4503
+ let A = z(!1);
4401
4504
  R(() => {
4402
- let e = D.current;
4403
- if (!(!e || !T)) return O.current = !1, g(null), e.onUpdate(Yt("widget/queries:subscribeThreadsForRoute"), {
4404
- subscriptionToken: T,
4505
+ let e = k.current;
4506
+ if (!(!e || !D)) return A.current = !1, v(null), e.onUpdate(Yt("widget/queries:subscribeThreadsForRoute"), {
4507
+ subscriptionToken: D,
4405
4508
  route: r,
4406
4509
  viewerClientId: s?.clientId ?? void 0
4407
4510
  }, (e) => {
4408
4511
  e !== void 0 && o(e);
4409
4512
  });
4410
4513
  }, [
4411
- T,
4514
+ D,
4412
4515
  r,
4413
4516
  s?.clientId
4414
4517
  ]), R(() => {
4415
- if (O.current) return;
4518
+ if (A.current) return;
4416
4519
  let e = window.location.hash.match(/^#markup-thread=(.+)$/);
4417
4520
  if (!e) {
4418
- O.current = !0;
4521
+ A.current = !0;
4419
4522
  return;
4420
4523
  }
4421
4524
  let t = decodeURIComponent(e[1] ?? "");
4422
- a.find((e) => e._id === t) && (O.current = !0, f({
4525
+ a.find((e) => e._id === t) && (A.current = !0, m({
4423
4526
  kind: "thread",
4424
4527
  threadId: t
4425
4528
  }), history.replaceState(null, "", window.location.pathname + window.location.search));
@@ -4438,20 +4541,20 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4438
4541
  };
4439
4542
  }, []), R(() => {
4440
4543
  function e(e) {
4441
- e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), v((e) => !e)));
4544
+ e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), b((e) => !e)));
4442
4545
  }
4443
4546
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
4444
4547
  }, []), R(() => {
4445
- if (!y) return;
4446
- if (!_) {
4447
- b(!1);
4548
+ if (!x) return;
4549
+ if (!y) {
4550
+ S(!1);
4448
4551
  return;
4449
4552
  }
4450
- let e = window.setTimeout(() => b(!1), 5e3);
4553
+ let e = window.setTimeout(() => S(!1), 5e3);
4451
4554
  return () => window.clearTimeout(e);
4452
- }, [y, _]), R(() => {
4555
+ }, [x, y]), R(() => {
4453
4556
  function e() {
4454
- x((e) => e + 1);
4557
+ C((e) => e + 1);
4455
4558
  }
4456
4559
  window.addEventListener("scroll", e, { passive: !0 }), window.addEventListener("resize", e);
4457
4560
  let t = new ResizeObserver(e);
@@ -4459,29 +4562,29 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4459
4562
  window.removeEventListener("scroll", e), window.removeEventListener("resize", e), t.disconnect();
4460
4563
  };
4461
4564
  }, []);
4462
- let k = B(() => {
4463
- g(null), f({ kind: "placing" });
4464
- }, []), A = B(() => {
4465
- f({ kind: "idle" }), g(null);
4466
- }, []), ee = B((e, t, n) => {
4467
- f({
4565
+ let ee = B(() => {
4566
+ v(null), m({ kind: "placing" });
4567
+ }, []), j = B(() => {
4568
+ m({ kind: "idle" }), v(null);
4569
+ }, []), M = B((e, t, n) => {
4570
+ m({
4468
4571
  kind: "composing-new",
4469
4572
  coords: e,
4470
4573
  pageX: t + window.scrollX,
4471
4574
  pageY: n + window.scrollY,
4472
4575
  screenshot: null,
4473
4576
  screenshotCapturing: !0
4474
- }), ea(S.current != null && S.current.getRootNode() instanceof ShadowRoot ? S.current.getRootNode().host : null, {
4577
+ }), ea(w.current != null && w.current.getRootNode() instanceof ShadowRoot ? w.current.getRootNode().host : null, {
4475
4578
  x: t,
4476
4579
  y: n
4477
4580
  }).then((e) => {
4478
- f((t) => t.kind === "composing-new" ? {
4581
+ m((t) => t.kind === "composing-new" ? {
4479
4582
  ...t,
4480
4583
  screenshot: e,
4481
4584
  screenshotCapturing: !1
4482
4585
  } : t);
4483
4586
  });
4484
- }, []), j = B((e, t) => {
4587
+ }, []), te = B((e, t) => {
4485
4588
  if (!s) return;
4486
4589
  let n = {
4487
4590
  ...s,
@@ -4489,235 +4592,236 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
4489
4592
  email: t
4490
4593
  };
4491
4594
  Pr(n), c(n);
4492
- }, [s]), M = B(async () => {
4493
- g(null);
4595
+ }, [s]), N = B(async () => {
4596
+ v(null);
4494
4597
  try {
4495
- let n = Aa(await Fr(e, t));
4598
+ let n = ja(await Fr(e, t));
4496
4599
  Pr(n), c(n);
4497
4600
  } catch (e) {
4498
- g(e instanceof Error ? e.message : "Sign-in failed");
4601
+ v(e instanceof Error ? e.message : "Sign-in failed");
4499
4602
  }
4500
- }, [e, t]), te = B(async (e, t) => {
4501
- if (!(d.kind !== "composing-new" || !s?.name)) {
4502
- m(!0), g(null);
4603
+ }, [e, t]), ne = B(async (e, t) => {
4604
+ if (!(p.kind !== "composing-new" || !s?.name)) {
4605
+ g(!0), v(null);
4503
4606
  try {
4504
4607
  let n;
4505
- if (t && d.screenshot) {
4506
- let { uploadUrl: e } = await u.getScreenshotUploadUrl(), t = await fetch(e, {
4608
+ if (t && p.screenshot) {
4609
+ let { uploadUrl: e } = await f.getScreenshotUploadUrl(), t = await fetch(e, {
4507
4610
  method: "POST",
4508
- headers: { "Content-Type": d.screenshot.type || "image/png" },
4509
- body: d.screenshot
4611
+ headers: { "Content-Type": p.screenshot.type || "image/png" },
4612
+ body: p.screenshot
4510
4613
  });
4511
4614
  if (t.ok) {
4512
4615
  let { storageId: e } = await t.json();
4513
4616
  n = e;
4514
4617
  }
4515
4618
  }
4516
- let i = await u.createThread({
4619
+ let i = await f.createThread({
4517
4620
  url: window.location.href,
4518
4621
  route: r,
4519
- anchorSelector: d.coords.anchorSelector,
4520
- anchorX: d.coords.anchorX,
4521
- anchorY: d.coords.anchorY,
4522
- anchorOffsetX: d.coords.anchorOffsetX,
4523
- anchorOffsetY: d.coords.anchorOffsetY,
4524
- viewportW: d.coords.viewportW,
4525
- viewportY: d.coords.viewportY,
4622
+ anchorSelector: p.coords.anchorSelector,
4623
+ anchorX: p.coords.anchorX,
4624
+ anchorY: p.coords.anchorY,
4625
+ anchorOffsetX: p.coords.anchorOffsetX,
4626
+ anchorOffsetY: p.coords.anchorOffsetY,
4627
+ viewportW: p.coords.viewportW,
4628
+ viewportY: p.coords.viewportY,
4526
4629
  userAgent: navigator.userAgent,
4527
4630
  authorName: s.name,
4528
4631
  authorEmail: s.email,
4529
4632
  body: e,
4530
4633
  screenshotStorageId: n
4531
4634
  });
4532
- o((e) => [...e, i.thread]), f({
4635
+ o((e) => [...e, i.thread]), m({
4533
4636
  kind: "thread",
4534
4637
  threadId: i.thread._id
4535
4638
  });
4536
4639
  } catch (e) {
4537
- g(e instanceof Error ? e.message : "Failed to post");
4640
+ v(e instanceof Error ? e.message : "Failed to post");
4538
4641
  } finally {
4539
- m(!1);
4642
+ g(!1);
4540
4643
  }
4541
4644
  }
4542
4645
  }, [
4543
- u,
4646
+ f,
4544
4647
  s,
4545
- d,
4648
+ p,
4546
4649
  r
4547
- ]), N = B(async () => {
4548
- if (d.kind !== "thread") return;
4549
- let e = d.threadId;
4550
- m(!0), g(null);
4650
+ ]), re = B(async () => {
4651
+ if (p.kind !== "thread") return;
4652
+ let e = p.threadId;
4653
+ g(!0), v(null);
4551
4654
  try {
4552
- await u.deleteThread(e), o((t) => t.filter((t) => t._id !== e)), f({ kind: "idle" });
4655
+ await f.deleteThread(e), o((t) => t.filter((t) => t._id !== e)), m({ kind: "idle" });
4553
4656
  } catch (e) {
4554
- g(e instanceof Error ? e.message : "Failed to delete");
4657
+ v(e instanceof Error ? e.message : "Failed to delete");
4555
4658
  } finally {
4556
- m(!1);
4659
+ g(!1);
4557
4660
  }
4558
- }, [u, d]), ne = B(async () => {
4559
- if (d.kind !== "thread") return;
4560
- let e = d.threadId;
4561
- m(!0), g(null);
4661
+ }, [f, p]), ie = B(async () => {
4662
+ if (p.kind !== "thread") return;
4663
+ let e = p.threadId;
4664
+ g(!0), v(null);
4562
4665
  try {
4563
- await u.resolveThread(e, s?.clientId), o((t) => t.filter((t) => t._id !== e)), f({ kind: "idle" });
4666
+ await f.resolveThread(e, s?.clientId), o((t) => t.filter((t) => t._id !== e)), m({ kind: "idle" });
4564
4667
  } catch (e) {
4565
- g(e instanceof Error ? e.message : "Failed to resolve");
4668
+ v(e instanceof Error ? e.message : "Failed to resolve");
4566
4669
  } finally {
4567
- m(!1);
4670
+ g(!1);
4568
4671
  }
4569
4672
  }, [
4570
- u,
4571
- d,
4673
+ f,
4674
+ p,
4572
4675
  s?.clientId
4573
- ]), re = B(async (e) => {
4574
- if (d.kind !== "thread" || !s?.name) return;
4575
- let t = d.threadId;
4576
- m(!0), g(null);
4676
+ ]), ae = B(async (e) => {
4677
+ if (p.kind !== "thread" || !s?.name) return;
4678
+ let t = p.threadId;
4679
+ g(!0), v(null);
4577
4680
  try {
4578
- let n = await u.addComment(t, {
4681
+ let n = await f.addComment(t, {
4579
4682
  body: e,
4580
4683
  authorName: s.name,
4581
4684
  authorEmail: s.email
4582
4685
  });
4583
4686
  o((e) => e.map((e) => e._id === t ? n.thread : e));
4584
4687
  } catch (e) {
4585
- g(e instanceof Error ? e.message : "Failed to reply");
4688
+ v(e instanceof Error ? e.message : "Failed to reply");
4586
4689
  } finally {
4587
- m(!1);
4690
+ g(!1);
4588
4691
  }
4589
4692
  }, [
4590
- u,
4693
+ f,
4591
4694
  s,
4592
- d
4593
- ]), ie = B(async (e, t) => {
4594
- if (d.kind !== "thread" || !s) return;
4595
- let n = d.threadId;
4596
- m(!0), g(null);
4695
+ p
4696
+ ]), oe = B(async (e, t) => {
4697
+ if (p.kind !== "thread" || !s) return;
4698
+ let n = p.threadId;
4699
+ g(!0), v(null);
4597
4700
  try {
4598
- let r = await u.editComment(n, e, { body: t });
4701
+ let r = await f.editComment(n, e, { body: t });
4599
4702
  o((e) => e.map((e) => e._id === n ? r.thread : e));
4600
4703
  } catch (e) {
4601
- throw g(e instanceof Error ? e.message : "Failed to edit"), e;
4704
+ throw v(e instanceof Error ? e.message : "Failed to edit"), e;
4602
4705
  } finally {
4603
- m(!1);
4706
+ g(!1);
4604
4707
  }
4605
4708
  }, [
4606
- u,
4709
+ f,
4607
4710
  s,
4608
- d
4609
- ]), ae = B(async (e) => {
4610
- if (d.kind !== "thread" || !s) return;
4611
- let t = d.threadId;
4612
- m(!0), g(null);
4711
+ p
4712
+ ]), se = B(async (e) => {
4713
+ if (p.kind !== "thread" || !s) return;
4714
+ let t = p.threadId;
4715
+ g(!0), v(null);
4613
4716
  try {
4614
- let n = await u.deleteComment(t, e);
4717
+ let n = await f.deleteComment(t, e);
4615
4718
  o((e) => e.map((e) => e._id === t ? n.thread : e));
4616
4719
  } catch (e) {
4617
- g(e instanceof Error ? e.message : "Failed to delete");
4720
+ v(e instanceof Error ? e.message : "Failed to delete");
4618
4721
  } finally {
4619
- m(!1);
4722
+ g(!1);
4620
4723
  }
4621
4724
  }, [
4622
- u,
4725
+ f,
4623
4726
  s,
4624
- d
4625
- ]), oe = B(async (e, t) => {
4626
- if (d.kind !== "thread" || !s) return;
4627
- let n = d.threadId;
4628
- g(null);
4727
+ p
4728
+ ]), ce = B(async (e, t) => {
4729
+ if (p.kind !== "thread" || !s) return;
4730
+ let n = p.threadId;
4731
+ v(null);
4629
4732
  try {
4630
- let r = await u.toggleReaction(e, {
4733
+ let r = await f.toggleReaction(e, {
4631
4734
  emoji: t,
4632
4735
  authorName: s.name
4633
4736
  });
4634
4737
  o((e) => e.map((e) => e._id === n ? r.thread : e));
4635
4738
  } catch (e) {
4636
- g(e instanceof Error ? e.message : "Failed to react");
4739
+ v(e instanceof Error ? e.message : "Failed to react");
4637
4740
  }
4638
4741
  }, [
4639
- u,
4742
+ f,
4640
4743
  s,
4641
- d
4642
- ]), P = d.kind === "thread" ? a.find((e) => e._id === d.threadId) ?? null : null, se = w || s?.clientId != null && s.clientId === P?.authorClientId;
4744
+ p
4745
+ ]), le = p.kind === "thread" ? a.find((e) => e._id === p.threadId) ?? null : null, ue = E || s?.clientId != null && s.clientId === le?.authorClientId;
4643
4746
  return /* @__PURE__ */ $("div", {
4644
4747
  class: "markup-root",
4645
- ref: S,
4748
+ ref: w,
4646
4749
  children: [
4647
- d.kind === "placing" ? null : /* @__PURE__ */ $("div", {
4750
+ p.kind === "placing" ? null : /* @__PURE__ */ $("div", {
4648
4751
  class: "markup-pins-layer",
4649
- children: [_ ? null : a.map((e) => {
4650
- let t = d.kind === "thread" && d.threadId === e._id, n = Dr({
4752
+ children: [y ? null : a.map((e) => {
4753
+ let t = p.kind === "thread" && p.threadId === e._id, n = Dr({
4651
4754
  anchorX: e.anchorX,
4652
4755
  anchorY: e.anchorY,
4653
4756
  anchorSelector: e.anchorSelector,
4654
4757
  anchorOffsetX: e.anchorOffsetX,
4655
4758
  anchorOffsetY: e.anchorOffsetY
4656
4759
  }), r = e.comments.reduce((e, t) => e + +!t.deleted, 0);
4657
- return /* @__PURE__ */ $(ya, {
4760
+ return /* @__PURE__ */ $(ba, {
4658
4761
  pageX: n.pageX,
4659
4762
  pageY: n.pageY,
4660
4763
  count: r,
4661
4764
  active: t,
4662
- onClick: () => f({
4765
+ onClick: () => m({
4663
4766
  kind: "thread",
4664
4767
  threadId: e._id
4665
4768
  })
4666
4769
  }, e._id);
4667
- }), d.kind === "composing-new" ? /* @__PURE__ */ $(ba, {
4668
- pageX: d.pageX,
4669
- pageY: d.pageY
4770
+ }), p.kind === "composing-new" ? /* @__PURE__ */ $(xa, {
4771
+ pageX: p.pageX,
4772
+ pageY: p.pageY
4670
4773
  }) : null]
4671
4774
  }),
4672
- d.kind === "placing" ? /* @__PURE__ */ $(xa, {
4673
- onPlace: ee,
4674
- onCancel: A
4775
+ p.kind === "placing" ? /* @__PURE__ */ $(Sa, {
4776
+ onPlace: M,
4777
+ onCancel: j
4675
4778
  }) : null,
4676
- d.kind === "thread" && P && !_ ? /* @__PURE__ */ $(Ca, {
4677
- thread: P,
4678
- authorName: C,
4779
+ p.kind === "thread" && le && !y ? /* @__PURE__ */ $(wa, {
4780
+ thread: le,
4781
+ authorName: T,
4679
4782
  currentClientId: s?.clientId ?? null,
4680
- isVerified: w,
4681
- canDelete: se,
4682
- pending: p,
4683
- error: h,
4684
- onAuthor: j,
4685
- onSignIn: M,
4686
- onClose: A,
4687
- onReply: re,
4688
- onEditComment: ie,
4689
- onDeleteComment: ae,
4690
- onToggleReaction: oe,
4691
- onDelete: N,
4692
- onResolve: ne
4783
+ isVerified: E,
4784
+ canDelete: ue,
4785
+ pending: h,
4786
+ error: _,
4787
+ onAuthor: te,
4788
+ onSignIn: N,
4789
+ onClose: j,
4790
+ onReply: ae,
4791
+ onEditComment: oe,
4792
+ onDeleteComment: se,
4793
+ onToggleReaction: ce,
4794
+ onDelete: re,
4795
+ onResolve: ie
4693
4796
  }) : null,
4694
- d.kind === "composing-new" ? /* @__PURE__ */ $(_a, {
4695
- pageX: d.pageX,
4696
- pageY: d.pageY,
4697
- authorName: C,
4698
- isVerified: w,
4699
- pending: p,
4700
- error: h,
4701
- screenshot: d.screenshot,
4702
- screenshotCapturing: d.screenshotCapturing,
4703
- onAuthor: j,
4704
- onSignIn: M,
4705
- onSubmit: te,
4706
- onClose: A
4797
+ p.kind === "composing-new" ? /* @__PURE__ */ $(va, {
4798
+ pageX: p.pageX,
4799
+ pageY: p.pageY,
4800
+ authorName: T,
4801
+ isVerified: E,
4802
+ pending: h,
4803
+ error: _,
4804
+ screenshot: p.screenshot,
4805
+ screenshotCapturing: p.screenshotCapturing,
4806
+ onAuthor: te,
4807
+ onSignIn: N,
4808
+ onSubmit: ne,
4809
+ onClose: j
4707
4810
  }) : null,
4708
- !_ || d.kind === "placing" || d.kind === "composing-new" ? /* @__PURE__ */ $(da, {
4709
- active: d.kind === "placing",
4710
- onToggle: () => d.kind === "placing" ? A() : k(),
4811
+ !y || p.kind === "placing" || p.kind === "composing-new" ? /* @__PURE__ */ $(da, {
4812
+ active: p.kind === "placing",
4813
+ onToggle: () => p.kind === "placing" ? j() : ee(),
4711
4814
  onHide: () => {
4712
- v(!0), b(!0);
4815
+ b(!0), S(!0);
4713
4816
  },
4714
- position: n
4817
+ position: l,
4818
+ onPositionChange: u
4715
4819
  }) : null,
4716
- _ && y ? /* @__PURE__ */ $(Ma, { position: n }) : null
4820
+ y && x ? /* @__PURE__ */ $(Na, { position: l }) : null
4717
4821
  ]
4718
4822
  });
4719
4823
  }
4720
- function Ma({ position: e }) {
4824
+ function Na({ position: e }) {
4721
4825
  let t = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "⌘" : "Ctrl";
4722
4826
  return /* @__PURE__ */ $("div", {
4723
4827
  class: Q("markup-hud-hidden-toast", e === "bottom-left" ? "markup-hud-hidden-toast-left" : "markup-hud-hidden-toast-right"),
@@ -4739,32 +4843,32 @@ function Ma({ position: e }) {
4739
4843
  }
4740
4844
  //#endregion
4741
4845
  //#region src/runtime/mount.tsx
4742
- function Na(e, t) {
4846
+ function Pa(e, t) {
4743
4847
  e.style.position = "fixed", e.style.inset = "0", e.style.zIndex = "2147483647", e.style.pointerEvents = "none";
4744
4848
  let n = t.theme ?? "auto";
4745
4849
  n !== "auto" && (e.dataset.theme = n);
4746
4850
  let r = e.attachShadow({ mode: "open" }), i = document.createElement("style");
4747
- i.textContent = de, r.appendChild(i);
4851
+ i.textContent = fe, r.appendChild(i);
4748
4852
  let a = document.createElement("div");
4749
4853
  a.className = "markup-shadow-root", r.appendChild(a);
4750
4854
  let { theme: o, ...s } = t;
4751
- return ue(/* @__PURE__ */ $(ja, { ...s }), a), () => ue(null, a);
4855
+ return de(/* @__PURE__ */ $(Ma, { ...s }), a), () => de(null, a);
4752
4856
  }
4753
4857
  //#endregion
4754
4858
  //#region src/widget.ts
4755
- var Pa = null, Fa = null;
4756
- function Ia(e) {
4757
- La();
4859
+ var Fa = null, Ia = null;
4860
+ function La(e) {
4861
+ Ra();
4758
4862
  let t = document.createElement("div");
4759
- return t.id = "markup-widget", document.body.appendChild(t), Fa = t, Pa = Na(t, e), La;
4863
+ return t.id = "markup-widget", document.body.appendChild(t), Ia = t, Fa = Pa(t, e), Ra;
4760
4864
  }
4761
- function La() {
4762
- Pa &&= (Pa(), null), Fa?.parentNode && Fa.parentNode.removeChild(Fa), Fa = null;
4865
+ function Ra() {
4866
+ Fa &&= (Fa(), null), Ia?.parentNode && Ia.parentNode.removeChild(Ia), Ia = null;
4763
4867
  }
4764
4868
  if (typeof document < "u") {
4765
4869
  let e = document.currentScript ?? document.querySelector("script[data-markup-widget=\"true\"]"), t = e?.dataset.apiUrl, n = e?.dataset.apiKey;
4766
4870
  if (t && n) {
4767
- let r = e?.dataset.position, i = e?.dataset.theme, a = () => Ia({
4871
+ let r = e?.dataset.position, i = e?.dataset.theme, a = () => La({
4768
4872
  apiUrl: t,
4769
4873
  apiKey: n,
4770
4874
  position: r,
@@ -4775,13 +4879,13 @@ if (typeof document < "u") {
4775
4879
  }
4776
4880
  //#endregion
4777
4881
  //#region src/react.tsx
4778
- function Ra(t) {
4779
- return e(() => (Ia({
4882
+ function za(t) {
4883
+ return e(() => (La({
4780
4884
  apiUrl: t.apiUrl,
4781
4885
  apiKey: t.apiKey,
4782
4886
  position: t.position,
4783
4887
  theme: t.theme
4784
- }), () => La()), [
4888
+ }), () => Ra()), [
4785
4889
  t.apiUrl,
4786
4890
  t.apiKey,
4787
4891
  t.position,
@@ -4789,4 +4893,4 @@ function Ra(t) {
4789
4893
  ]), null;
4790
4894
  }
4791
4895
  //#endregion
4792
- export { Ra as MarkupWidget };
4896
+ export { za as MarkupWidget };