@pixelmatters/markup 1.7.0 → 1.9.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.
package/dist/widget.js CHANGED
@@ -65,7 +65,7 @@ function O() {
65
65
  }
66
66
  function k(e, t, n, r, i, a, o, s, c, l, u) {
67
67
  var d, f, p, g, _, v, y, b = r && r.__k || h, x = t.length;
68
- for (c = A(n, t, b, c, x), d = 0; d < x; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && b[p.__i] || m, p.__i = d, v = ne(e, p, f, i, a, o, s, c, l, u), g = p.__e, p.ref && f.ref != p.ref && (f.ref && oe(f.ref, null, p), u.push(p.ref, p.__c || g, p)), _ == null && g != null && (_ = g), (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 : g && (c = g.nextSibling), p.__u &= -7);
68
+ for (c = A(n, t, b, c, x), d = 0; d < x; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && b[p.__i] || m, p.__i = d, v = ne(e, p, f, i, a, o, s, c, l, u), g = p.__e, p.ref && f.ref != p.ref && (f.ref && P(f.ref, null, p), u.push(p.ref, p.__c || g, p)), _ == null && g != null && (_ = g), (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 : g && (c = g.nextSibling), p.__u &= -7);
69
69
  return n.__e = _, c;
70
70
  }
71
71
  function A(e, t, n, r, i) {
@@ -145,7 +145,7 @@ function ne(e, n, r, i, a, o, s, c, l, u) {
145
145
  else do
146
146
  f.__d = !1, O && O(n), d = f.render(f.props, f.state, f.context), f.state = f.__s;
147
147
  while (f.__d && ++A < 25);
148
- f.state = f.__s, f.getChildContext != null && (i = v(v({}, i), f.getChildContext())), T && !p && f.getSnapshotBeforeUpdate != null && (b = f.getSnapshotBeforeUpdate(m, g)), j = d != null && d.type === S && d.key == null ? P(d.props.children) : d, c = k(e, _(j) ? j : [j], n, r, i, a, o, s, c, l, u), f.base = n.__e, n.__u &= -161, f.__h.length && s.push(f), x && (f.__E = f.__ = null);
148
+ f.state = f.__s, f.getChildContext != null && (i = v(v({}, i), f.getChildContext())), T && !p && f.getSnapshotBeforeUpdate != null && (b = f.getSnapshotBeforeUpdate(m, g)), j = d != null && d.type === S && d.key == null ? ae(d.props.children) : d, c = k(e, _(j) ? j : [j], n, r, i, a, o, s, c, l, u), f.base = n.__e, n.__u &= -161, f.__h.length && s.push(f), x && (f.__E = f.__ = null);
149
149
  } catch (e) {
150
150
  if (n.__v = null, l || o != null) if (e.then) {
151
151
  for (n.__u |= l ? 160 : 128; c && c.nodeType == 8 && c.nextSibling;) c = c.nextSibling;
@@ -157,14 +157,14 @@ function ne(e, n, r, i, a, o, s, c, l, u) {
157
157
  else n.__e = r.__e, n.__k = r.__k, e.then || re(n);
158
158
  t.__e(e, n, r);
159
159
  }
160
- else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : c = n.__e = ae(r.__e, n, r, i, a, o, s, l, u);
160
+ else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : c = n.__e = oe(r.__e, n, r, i, a, o, s, l, u);
161
161
  return (d = t.diffed) && d(n), 128 & n.__u ? void 0 : c;
162
162
  }
163
163
  function re(e) {
164
164
  e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(re));
165
165
  }
166
166
  function ie(e, n, r) {
167
- for (var i = 0; i < r.length; i++) oe(r[i], r[++i], r[++i]);
167
+ for (var i = 0; i < r.length; i++) P(r[i], r[++i], r[++i]);
168
168
  t.__c && t.__c(n, e), e.some(function(n) {
169
169
  try {
170
170
  e = n.__h, n.__h = [], e.some(function(e) {
@@ -175,10 +175,10 @@ function ie(e, n, r) {
175
175
  }
176
176
  });
177
177
  }
178
- function P(e) {
179
- return typeof e != "object" || !e || e.__b > 0 ? e : _(e) ? e.map(P) : v({}, e);
178
+ function ae(e) {
179
+ return typeof e != "object" || !e || e.__b > 0 ? e : _(e) ? e.map(ae) : v({}, e);
180
180
  }
181
- function ae(n, r, i, a, o, s, c, l, u) {
181
+ function oe(n, r, i, a, o, s, c, l, u) {
182
182
  var d, f, p, h, g, v, b, x = i.props || m, S = r.props, C = r.type;
183
183
  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) {
184
184
  for (d = 0; d < s.length; d++) if ((g = s[d]) && "setAttribute" in g == !!C && (C ? g.localName == C : g.nodeType == 3)) {
@@ -201,7 +201,7 @@ function ae(n, r, i, a, o, s, c, l, u) {
201
201
  }
202
202
  return n;
203
203
  }
204
- function oe(e, n, r) {
204
+ function P(e, n, r) {
205
205
  try {
206
206
  if (typeof e == "function") {
207
207
  var i = typeof e.__u == "function";
@@ -213,7 +213,7 @@ function oe(e, n, r) {
213
213
  }
214
214
  function se(e, n, r) {
215
215
  var i, a;
216
- if (t.unmount && t.unmount(e), (i = e.ref) && (i.current && i.current != e.__e || oe(i, null, n)), (i = e.__c) != null) {
216
+ if (t.unmount && t.unmount(e), (i = e.ref) && (i.current && i.current != e.__e || P(i, null, n)), (i = e.__c) != null) {
217
217
  if (i.componentWillUnmount) try {
218
218
  i.componentWillUnmount();
219
219
  } catch (e) {
@@ -248,9 +248,65 @@ e = h.slice, t = { __e: function(e, t, n, r) {
248
248
  }, O.__r = 0, s = Math.random().toString(8), c = "__d" + s, l = "__a" + s, u = /(PointerCapture)$|Capture$/i, d = 0, f = te(!1), p = te(!0);
249
249
  //#endregion
250
250
  //#region src/styles.css?inline
251
- var ue = ":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-center{width:max-content;margin-inline:auto;left:0;right:0}.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-fab.is-icon-only{gap:0;padding:9px}.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-hud-hidden-toast-center{width:max-content;margin-inline:auto;left:0;right:0}.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,opacity .15s,top .2s,left .2s;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.is-unresolved{opacity:.5}.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}}.markup-popover.is-hud-hidden{display: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)}.markup-comment-menu.is-side .markup-thread-menu-list{animation-name:markup-menu-in-side;top:-4px;right:calc(100% + 2px)}@keyframes markup-menu-in-side{0%{opacity:0;transform:translate(4px)}to{opacity:1;transform:translate(0)}}@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-wrap.is-side .markup-reaction-picker{animation-name:markup-menu-in-side;top:-4px;right:calc(100% + 2px)}.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-author-status{color:var(--markup-muted);margin:0;font-size:12px}.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-screenshot-redacted{font-family:var(--markup-font-mono);color:var(--markup-muted);margin-top:4px;font-size:10px}.markup-screenshot-redacted-chip{cursor:pointer;color:var(--markup-muted);font:inherit;background:0 0;border:none;align-items:center;gap:3px;padding:0;display:inline-flex}.markup-screenshot-redacted-chip:hover{color:var(--markup-ink)}.markup-screenshot-redacted-arrow{font-style:normal}.markup-screenshot-redacted-list{margin-top:3px;padding-left:10px}.markup-screenshot-redacted-selector{font-family:var(--markup-font-mono);color:var(--markup-muted);font-size:9px;display:block}.markup-screenshot-help{font-family:var(--markup-font-mono);color:var(--markup-muted);margin:5px 0 0;font-size:10px;line-height:1.5}.markup-screenshot-help-code{font-family:var(--markup-font-mono);color:var(--markup-ink)}.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}}", de, F, fe, pe, me = 0, he = [], I = t, ge = I.__b, _e = I.__r, ve = I.diffed, ye = I.__c, be = I.unmount, L = I.__;
252
- function xe(e, t) {
253
- I.__h && I.__h(F, e, me || t), me = 0;
251
+ var ue = ":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-center{width:max-content;margin-inline:auto;left:0;right:0}.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-fab.is-icon-only{gap:0;padding:9px}.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-hud-hidden-toast-center{width:max-content;margin-inline:auto;left:0;right:0}.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,opacity .15s,top .2s,left .2s;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.is-unresolved{opacity:.5}.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}}.markup-popover.is-hud-hidden{display: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)}.markup-comment-menu.is-side .markup-thread-menu-list{animation-name:markup-menu-in-side;top:-4px;right:calc(100% + 2px)}@keyframes markup-menu-in-side{0%{opacity:0;transform:translate(4px)}to{opacity:1;transform:translate(0)}}@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-wrap.is-side .markup-reaction-picker{animation-name:markup-menu-in-side;top:-4px;right:calc(100% + 2px)}.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-author-status{color:var(--markup-muted);margin:0;font-size:12px}.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-screenshot-redacted{font-family:var(--markup-font-mono);color:var(--markup-muted);margin-top:4px;font-size:10px}.markup-screenshot-redacted-chip{cursor:pointer;color:var(--markup-muted);font:inherit;background:0 0;border:none;align-items:center;gap:3px;padding:0;display:inline-flex}.markup-screenshot-redacted-chip:hover{color:var(--markup-ink)}.markup-screenshot-redacted-arrow{font-style:normal}.markup-screenshot-redacted-list{margin-top:3px;padding-left:10px}.markup-screenshot-redacted-selector{font-family:var(--markup-font-mono);color:var(--markup-muted);font-size:9px;display:block}.markup-screenshot-help{font-family:var(--markup-font-mono);color:var(--markup-muted);margin:5px 0 0;font-size:10px;line-height:1.5}.markup-screenshot-help-code{font-family:var(--markup-font-mono);color:var(--markup-ink)}.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}}", de = class extends C {
252
+ state = { hasError: !1 };
253
+ static getDerivedStateFromError() {
254
+ return { hasError: !0 };
255
+ }
256
+ componentDidCatch(e) {
257
+ try {
258
+ this.props.onError(e);
259
+ } catch {}
260
+ }
261
+ render() {
262
+ return this.state.hasError ? null : this.props.children;
263
+ }
264
+ }, fe = 1e3;
265
+ function pe(e) {
266
+ let t = !1, n = 0;
267
+ return (r) => {
268
+ let i = Date.now();
269
+ t || i - n < fe || (t = !0, n = i, fetch(`${e.apiUrl.replace(/\/+$/, "")}/widget/error`, {
270
+ method: "POST",
271
+ headers: {
272
+ "content-type": "application/json",
273
+ "x-markup-api-key": e.apiKey
274
+ },
275
+ body: JSON.stringify({
276
+ ...r,
277
+ widgetVersion: e.widgetVersion
278
+ }),
279
+ keepalive: !0
280
+ }).catch(() => {}).finally(() => {
281
+ t = !1;
282
+ }));
283
+ };
284
+ }
285
+ function me() {
286
+ return typeof window < "u" ? window.location.href : void 0;
287
+ }
288
+ function he() {
289
+ return typeof navigator < "u" ? navigator.userAgent : void 0;
290
+ }
291
+ var ge = /* @__PURE__ */ new WeakMap();
292
+ function _e(e, t, n) {
293
+ let r = ge.get(e);
294
+ r || (r = pe(e), ge.set(e, r));
295
+ let i = t instanceof Error ? t : Error(String(t));
296
+ r({
297
+ message: i.message,
298
+ name: i.name,
299
+ stack: i.stack,
300
+ url: me(),
301
+ userAgent: he(),
302
+ context: n?.context
303
+ });
304
+ }
305
+ //#endregion
306
+ //#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/hooks/dist/hooks.module.js
307
+ var ve, F, ye, be, xe = 0, Se = [], I = t, L = I.__b, Ce = I.__r, we = I.diffed, Te = I.__c, Ee = I.unmount, De = I.__;
308
+ function Oe(e, t) {
309
+ I.__h && I.__h(F, e, xe || t), xe = 0;
254
310
  var n = F.__H ||= {
255
311
  __: [],
256
312
  __h: []
@@ -258,11 +314,11 @@ function xe(e, t) {
258
314
  return e >= n.__.length && n.__.push({}), n.__[e];
259
315
  }
260
316
  function R(e) {
261
- return me = 1, Se(Ae, e);
317
+ return xe = 1, ke(Le, e);
262
318
  }
263
- function Se(e, t, n) {
264
- var r = xe(de++, 2);
265
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ae(void 0, t), function(e) {
319
+ function ke(e, t, n) {
320
+ var r = Oe(ve++, 2);
321
+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Le(void 0, t), function(e) {
266
322
  var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
267
323
  t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
268
324
  }], r.__c = F, !F.__f)) {
@@ -295,98 +351,98 @@ function Se(e, t, n) {
295
351
  return r.__N || r.__;
296
352
  }
297
353
  function z(e, t) {
298
- var n = xe(de++, 3);
299
- !I.__s && ke(n.__H, t) && (n.__ = e, n.u = t, F.__H.__h.push(n));
354
+ var n = Oe(ve++, 3);
355
+ !I.__s && Ie(n.__H, t) && (n.__ = e, n.u = t, F.__H.__h.push(n));
300
356
  }
301
357
  function B(e) {
302
- return me = 5, Ce(function() {
358
+ return xe = 5, Ae(function() {
303
359
  return { current: e };
304
360
  }, []);
305
361
  }
306
- function Ce(e, t) {
307
- var n = xe(de++, 7);
308
- return ke(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
362
+ function Ae(e, t) {
363
+ var n = Oe(ve++, 7);
364
+ return Ie(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
309
365
  }
310
366
  function V(e, t) {
311
- return me = 8, Ce(function() {
367
+ return xe = 8, Ae(function() {
312
368
  return e;
313
369
  }, t);
314
370
  }
315
- function we() {
316
- for (var e; e = he.shift();) {
371
+ function je() {
372
+ for (var e; e = Se.shift();) {
317
373
  var t = e.__H;
318
374
  if (e.__P && t) try {
319
- t.__h.some(De), t.__h.some(Oe), t.__h = [];
375
+ t.__h.some(Pe), t.__h.some(Fe), t.__h = [];
320
376
  } catch (n) {
321
377
  t.__h = [], I.__e(n, e.__v);
322
378
  }
323
379
  }
324
380
  }
325
381
  I.__b = function(e) {
326
- F = null, ge && ge(e);
382
+ F = null, L && L(e);
327
383
  }, I.__ = function(e, t) {
328
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), L && L(e, t);
384
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), De && De(e, t);
329
385
  }, I.__r = function(e) {
330
- _e && _e(e), de = 0;
386
+ Ce && Ce(e), ve = 0;
331
387
  var t = (F = e.__c).__H;
332
- t && (fe === F ? (t.__h = [], F.__h = [], t.__.some(function(e) {
388
+ t && (ye === F ? (t.__h = [], F.__h = [], t.__.some(function(e) {
333
389
  e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
334
- })) : (t.__h.some(De), t.__h.some(Oe), t.__h = [], de = 0)), fe = F;
390
+ })) : (t.__h.some(Pe), t.__h.some(Fe), t.__h = [], ve = 0)), ye = F;
335
391
  }, I.diffed = function(e) {
336
- ve && ve(e);
392
+ we && we(e);
337
393
  var t = e.__c;
338
- t && t.__H && (t.__H.__h.length && (he.push(t) !== 1 && pe === I.requestAnimationFrame || ((pe = I.requestAnimationFrame) || Ee)(we)), t.__H.__.some(function(e) {
394
+ t && t.__H && (t.__H.__h.length && (Se.push(t) !== 1 && be === I.requestAnimationFrame || ((be = I.requestAnimationFrame) || Ne)(je)), t.__H.__.some(function(e) {
339
395
  e.u && (e.__H = e.u), e.u = void 0;
340
- })), fe = F = null;
396
+ })), ye = F = null;
341
397
  }, I.__c = function(e, t) {
342
398
  t.some(function(e) {
343
399
  try {
344
- e.__h.some(De), e.__h = e.__h.filter(function(e) {
345
- return !e.__ || Oe(e);
400
+ e.__h.some(Pe), e.__h = e.__h.filter(function(e) {
401
+ return !e.__ || Fe(e);
346
402
  });
347
403
  } catch (n) {
348
404
  t.some(function(e) {
349
405
  e.__h &&= [];
350
406
  }), t = [], I.__e(n, e.__v);
351
407
  }
352
- }), ye && ye(e, t);
408
+ }), Te && Te(e, t);
353
409
  }, I.unmount = function(e) {
354
- be && be(e);
410
+ Ee && Ee(e);
355
411
  var t, n = e.__c;
356
412
  n && n.__H && (n.__H.__.some(function(e) {
357
413
  try {
358
- De(e);
414
+ Pe(e);
359
415
  } catch (e) {
360
416
  t = e;
361
417
  }
362
418
  }), n.__H = void 0, t && I.__e(t, n.__v));
363
419
  };
364
- var Te = typeof requestAnimationFrame == "function";
365
- function Ee(e) {
420
+ var Me = typeof requestAnimationFrame == "function";
421
+ function Ne(e) {
366
422
  var t, n = function() {
367
- clearTimeout(r), Te && cancelAnimationFrame(t), setTimeout(e);
423
+ clearTimeout(r), Me && cancelAnimationFrame(t), setTimeout(e);
368
424
  }, r = setTimeout(n, 35);
369
- Te && (t = requestAnimationFrame(n));
425
+ Me && (t = requestAnimationFrame(n));
370
426
  }
371
- function De(e) {
427
+ function Pe(e) {
372
428
  var t = F, n = e.__c;
373
429
  typeof n == "function" && (e.__c = void 0, n()), F = t;
374
430
  }
375
- function Oe(e) {
431
+ function Fe(e) {
376
432
  var t = F;
377
433
  e.__c = e.__(), F = t;
378
434
  }
379
- function ke(e, t) {
435
+ function Ie(e, t) {
380
436
  return !e || e.length !== t.length || t.some(function(t, n) {
381
437
  return t !== e[n];
382
438
  });
383
439
  }
384
- function Ae(e, t) {
440
+ function Le(e, t) {
385
441
  return typeof t == "function" ? t(e) : t;
386
442
  }
387
- for (var je = "1.38.0", H = [], U = [], Me = Uint8Array, Ne = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Pe = 0, Fe = Ne.length; Pe < Fe; ++Pe) H[Pe] = Ne[Pe], U[Ne.charCodeAt(Pe)] = Pe;
443
+ for (var Re = "1.38.0", H = [], U = [], ze = Uint8Array, Be = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ve = 0, He = Be.length; Ve < He; ++Ve) H[Ve] = Be[Ve], U[Be.charCodeAt(Ve)] = Ve;
388
444
  U[45] = 62, U[95] = 63;
389
- function Ie(e) {
445
+ function Ue(e) {
390
446
  var t = e.length;
391
447
  if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
392
448
  var n = e.indexOf("=");
@@ -394,33 +450,33 @@ function Ie(e) {
394
450
  var r = n === t ? 0 : 4 - n % 4;
395
451
  return [n, r];
396
452
  }
397
- function Le(e, t, n) {
453
+ function We(e, t, n) {
398
454
  return (t + n) * 3 / 4 - n;
399
455
  }
400
- function Re(e) {
401
- var t, n = Ie(e), r = n[0], i = n[1], a = new Me(Le(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
456
+ function Ge(e) {
457
+ var t, n = Ue(e), r = n[0], i = n[1], a = new ze(We(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
402
458
  for (c = 0; c < s; c += 4) t = U[e.charCodeAt(c)] << 18 | U[e.charCodeAt(c + 1)] << 12 | U[e.charCodeAt(c + 2)] << 6 | U[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
403
459
  return i === 2 && (t = U[e.charCodeAt(c)] << 2 | U[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = U[e.charCodeAt(c)] << 10 | U[e.charCodeAt(c + 1)] << 4 | U[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
404
460
  }
405
- function ze(e) {
461
+ function Ke(e) {
406
462
  return H[e >> 18 & 63] + H[e >> 12 & 63] + H[e >> 6 & 63] + H[e & 63];
407
463
  }
408
- function Be(e, t, n) {
409
- for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(ze(r));
464
+ function qe(e, t, n) {
465
+ for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(Ke(r));
410
466
  return i.join("");
411
467
  }
412
- function Ve(e) {
413
- for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(Be(e, o, o + a > s ? s : o + a));
468
+ function Je(e) {
469
+ for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(qe(e, o, o + a > s ? s : o + a));
414
470
  return r === 1 ? (t = e[n - 1], i.push(H[t >> 2] + H[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(H[t >> 10] + H[t >> 4 & 63] + H[t << 2 & 63] + "=")), i.join("");
415
471
  }
416
472
  //#endregion
417
473
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/common/index.js
418
- function He(e) {
474
+ function W(e) {
419
475
  if (e === void 0) return {};
420
- if (!We(e)) throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);
476
+ if (!Xe(e)) throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);
421
477
  return e;
422
478
  }
423
- function Ue(e) {
479
+ function Ye(e) {
424
480
  if (e === void 0) throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");
425
481
  if (typeof e != "string") throw Error(`Invalid deployment address: found ${e}".`);
426
482
  if (!(e.startsWith("http:") || e.startsWith("https:"))) throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);
@@ -431,146 +487,146 @@ function Ue(e) {
431
487
  }
432
488
  if (e.endsWith(".convex.site")) throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`);
433
489
  }
434
- function We(e) {
490
+ function Xe(e) {
435
491
  let t = typeof e == "object", n = Object.getPrototypeOf(e), r = n === null || n === Object.prototype || n?.constructor?.name === "Object";
436
492
  return t && r;
437
493
  }
438
494
  //#endregion
439
495
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/values/value.js
440
- var Ge = !0, Ke = BigInt("-9223372036854775808"), qe = BigInt("9223372036854775807"), Je = BigInt("0"), Ye = BigInt("8"), Xe = BigInt("256");
441
- function Ze(e) {
496
+ var Ze = !0, Qe = BigInt("-9223372036854775808"), $e = BigInt("9223372036854775807"), et = BigInt("0"), tt = BigInt("8"), nt = BigInt("256");
497
+ function rt(e) {
442
498
  return Number.isNaN(e) || !Number.isFinite(e) || Object.is(e, -0);
443
499
  }
444
- function Qe(e) {
445
- e < Je && (e -= Ke + Ke);
500
+ function it(e) {
501
+ e < et && (e -= Qe + Qe);
446
502
  let t = e.toString(16);
447
503
  t.length % 2 == 1 && (t = "0" + t);
448
504
  let n = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(8)), r = 0;
449
- for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>= Ye;
450
- return Ve(n);
505
+ for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>= tt;
506
+ return Je(n);
451
507
  }
452
- function $e(e) {
453
- let t = Re(e);
508
+ function at(e) {
509
+ let t = Ge(e);
454
510
  if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
455
- let n = Je, r = Je;
456
- for (let e of t) n += BigInt(e) * Xe ** r, r++;
457
- return n > qe && (n += Ke + Ke), n;
511
+ let n = et, r = et;
512
+ for (let e of t) n += BigInt(e) * nt ** r, r++;
513
+ return n > $e && (n += Qe + Qe), n;
458
514
  }
459
- function et(e) {
460
- if (e < Ke || qe < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
515
+ function ot(e) {
516
+ if (e < Qe || $e < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
461
517
  let t = /* @__PURE__ */ new ArrayBuffer(8);
462
- return new DataView(t).setBigInt64(0, e, !0), Ve(new Uint8Array(t));
518
+ return new DataView(t).setBigInt64(0, e, !0), Je(new Uint8Array(t));
463
519
  }
464
- function tt(e) {
465
- let t = Re(e);
520
+ function st(e) {
521
+ let t = Ge(e);
466
522
  if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
467
523
  return new DataView(t.buffer).getBigInt64(0, !0);
468
524
  }
469
- var nt = DataView.prototype.setBigInt64 ? et : Qe, rt = DataView.prototype.getBigInt64 ? tt : $e, it = 1024;
470
- function at(e) {
471
- if (e.length > it) throw Error(`Field name ${e} exceeds maximum field name length ${it}.`);
525
+ var ct = DataView.prototype.setBigInt64 ? ot : it, lt = DataView.prototype.getBigInt64 ? st : at, ut = 1024;
526
+ function dt(e) {
527
+ if (e.length > ut) throw Error(`Field name ${e} exceeds maximum field name length ${ut}.`);
472
528
  if (e.startsWith("$")) throw Error(`Field name ${e} starts with a '$', which is reserved.`);
473
529
  for (let t = 0; t < e.length; t += 1) {
474
530
  let n = e.charCodeAt(t);
475
531
  if (n < 32 || n >= 127) throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`);
476
532
  }
477
533
  }
478
- function ot(e) {
534
+ function ft(e) {
479
535
  if (e === null || typeof e == "boolean" || typeof e == "number" || typeof e == "string") return e;
480
- if (Array.isArray(e)) return e.map((e) => ot(e));
536
+ if (Array.isArray(e)) return e.map((e) => ft(e));
481
537
  if (typeof e != "object") throw Error(`Unexpected type of ${e}`);
482
538
  let t = Object.entries(e);
483
539
  if (t.length === 1) {
484
540
  let n = t[0][0];
485
541
  if (n === "$bytes") {
486
542
  if (typeof e.$bytes != "string") throw Error(`Malformed $bytes field on ${e}`);
487
- return Re(e.$bytes).buffer;
543
+ return Ge(e.$bytes).buffer;
488
544
  }
489
545
  if (n === "$integer") {
490
546
  if (typeof e.$integer != "string") throw Error(`Malformed $integer field on ${e}`);
491
- return rt(e.$integer);
547
+ return lt(e.$integer);
492
548
  }
493
549
  if (n === "$float") {
494
550
  if (typeof e.$float != "string") throw Error(`Malformed $float field on ${e}`);
495
- let t = Re(e.$float);
551
+ let t = Ge(e.$float);
496
552
  if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);
497
- let n = new DataView(t.buffer).getFloat64(0, Ge);
498
- if (!Ze(n)) throw Error(`Float ${n} should be encoded as a number`);
553
+ let n = new DataView(t.buffer).getFloat64(0, Ze);
554
+ if (!rt(n)) throw Error(`Float ${n} should be encoded as a number`);
499
555
  return n;
500
556
  }
501
557
  if (n === "$set") throw Error("Received a Set which is no longer supported as a Convex type.");
502
558
  if (n === "$map") throw Error("Received a Map which is no longer supported as a Convex type.");
503
559
  }
504
560
  let n = {};
505
- for (let [t, r] of Object.entries(e)) at(t), n[t] = ot(r);
561
+ for (let [t, r] of Object.entries(e)) dt(t), n[t] = ft(r);
506
562
  return n;
507
563
  }
508
- var st = 16384;
509
- function ct(e) {
564
+ var pt = 16384;
565
+ function mt(e) {
510
566
  let t = JSON.stringify(e, (e, t) => t === void 0 ? "undefined" : typeof t == "bigint" ? `${t.toString()}n` : t);
511
- if (t.length > st) {
512
- let e = st - 14, n = t.codePointAt(e - 1);
567
+ if (t.length > pt) {
568
+ let e = pt - 14, n = t.codePointAt(e - 1);
513
569
  return n !== void 0 && n > 65535 && --e, t.substring(0, e) + "[...truncated]";
514
570
  }
515
571
  return t;
516
572
  }
517
- function lt(e, t, n, r) {
573
+ function ht(e, t, n, r) {
518
574
  if (e === void 0) {
519
- let e = n && ` (present at path ${n} in original object ${ct(t)})`;
575
+ let e = n && ` (present at path ${n} in original object ${mt(t)})`;
520
576
  throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`);
521
577
  }
522
578
  if (e === null) return e;
523
579
  if (typeof e == "bigint") {
524
- if (e < Ke || qe < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
525
- return { $integer: nt(e) };
580
+ if (e < Qe || $e < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
581
+ return { $integer: ct(e) };
526
582
  }
527
- if (typeof e == "number") if (Ze(e)) {
583
+ if (typeof e == "number") if (rt(e)) {
528
584
  let t = /* @__PURE__ */ new ArrayBuffer(8);
529
- return new DataView(t).setFloat64(0, e, Ge), { $float: Ve(new Uint8Array(t)) };
585
+ return new DataView(t).setFloat64(0, e, Ze), { $float: Je(new Uint8Array(t)) };
530
586
  } else return e;
531
587
  if (typeof e == "boolean" || typeof e == "string") return e;
532
- if (e instanceof ArrayBuffer) return { $bytes: Ve(new Uint8Array(e)) };
533
- if (Array.isArray(e)) return e.map((e, r) => lt(e, t, n + `[${r}]`, !1));
534
- if (e instanceof Set) throw Error(ut(n, "Set", [...e], t));
535
- if (e instanceof Map) throw Error(ut(n, "Map", [...e], t));
536
- if (!We(e)) {
588
+ if (e instanceof ArrayBuffer) return { $bytes: Je(new Uint8Array(e)) };
589
+ if (Array.isArray(e)) return e.map((e, r) => ht(e, t, n + `[${r}]`, !1));
590
+ if (e instanceof Set) throw Error(gt(n, "Set", [...e], t));
591
+ if (e instanceof Map) throw Error(gt(n, "Map", [...e], t));
592
+ if (!Xe(e)) {
537
593
  let r = e?.constructor?.name, i = r ? `${r} ` : "";
538
- throw Error(ut(n, i, e, t));
594
+ throw Error(gt(n, i, e, t));
539
595
  }
540
596
  let i = {}, a = Object.entries(e);
541
597
  a.sort(([e, t], [n, r]) => e === n ? 0 : e < n ? -1 : 1);
542
- for (let [e, o] of a) o === void 0 ? r && (at(e), i[e] = dt(o, t, n + `.${e}`)) : (at(e), i[e] = lt(o, t, n + `.${e}`, !1));
598
+ for (let [e, o] of a) o === void 0 ? r && (dt(e), i[e] = _t(o, t, n + `.${e}`)) : (dt(e), i[e] = ht(o, t, n + `.${e}`, !1));
543
599
  return i;
544
600
  }
545
- function ut(e, t, n, r) {
546
- return e ? `${t}${ct(n)} is not a supported Convex type (present at path ${e} in original object ${ct(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${t}${ct(n)} is not a supported Convex type.`;
601
+ function gt(e, t, n, r) {
602
+ return e ? `${t}${mt(n)} is not a supported Convex type (present at path ${e} in original object ${mt(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${t}${mt(n)} is not a supported Convex type.`;
547
603
  }
548
- function dt(e, t, n) {
604
+ function _t(e, t, n) {
549
605
  if (e === void 0) return { $undefined: null };
550
- if (t === void 0) throw Error(`Programming error. Current value is ${ct(e)} but original value is undefined`);
551
- return lt(e, t, n, !1);
606
+ if (t === void 0) throw Error(`Programming error. Current value is ${mt(e)} but original value is undefined`);
607
+ return ht(e, t, n, !1);
552
608
  }
553
- function ft(e) {
554
- return lt(e, e, "", !1);
609
+ function vt(e) {
610
+ return ht(e, e, "", !1);
555
611
  }
556
612
  //#endregion
557
613
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/values/errors.js
558
- var pt = Object.defineProperty, mt = (e, t, n) => t in e ? pt(e, t, {
614
+ var yt = Object.defineProperty, bt = (e, t, n) => t in e ? yt(e, t, {
559
615
  enumerable: !0,
560
616
  configurable: !0,
561
617
  writable: !0,
562
618
  value: n
563
- }) : e[t] = n, ht = (e, t, n) => mt(e, typeof t == "symbol" ? t : t + "", n), gt, _t, vt = Symbol.for("ConvexError"), yt = class extends (_t = Error, gt = vt, _t) {
619
+ }) : e[t] = n, xt = (e, t, n) => bt(e, typeof t == "symbol" ? t : t + "", n), St, Ct, wt = Symbol.for("ConvexError"), Tt = class extends (Ct = Error, St = wt, Ct) {
564
620
  constructor(e) {
565
- super(typeof e == "string" ? e : ct(e)), ht(this, "name", "ConvexError"), ht(this, "data"), ht(this, gt, !0), this.data = e;
621
+ super(typeof e == "string" ? e : mt(e)), xt(this, "name", "ConvexError"), xt(this, "data"), xt(this, St, !0), this.data = e;
566
622
  }
567
- }, bt = Object.defineProperty, xt = (e, t, n) => t in e ? bt(e, t, {
623
+ }, Et = Object.defineProperty, Dt = (e, t, n) => t in e ? Et(e, t, {
568
624
  enumerable: !0,
569
625
  configurable: !0,
570
626
  writable: !0,
571
627
  value: n
572
- }) : e[t] = n, St = (e, t, n) => xt(e, typeof t == "symbol" ? t : t + "", n), Ct = "color:rgb(0, 145, 255)";
573
- function wt(e) {
628
+ }) : e[t] = n, Ot = (e, t, n) => Dt(e, typeof t == "symbol" ? t : t + "", n), kt = "color:rgb(0, 145, 255)";
629
+ function At(e) {
574
630
  switch (e) {
575
631
  case "query": return "Q";
576
632
  case "mutation": return "M";
@@ -578,9 +634,9 @@ function wt(e) {
578
634
  case "any": return "?";
579
635
  }
580
636
  }
581
- var Tt = class {
637
+ var jt = class {
582
638
  constructor(e) {
583
- St(this, "_onLogLineFuncs"), St(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
639
+ Ot(this, "_onLogLineFuncs"), Ot(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
584
640
  }
585
641
  addLogLineListener(e) {
586
642
  let t = Math.random().toString(36).substring(2, 15);
@@ -602,8 +658,8 @@ var Tt = class {
602
658
  for (let t of Object.values(this._onLogLineFuncs)) t("error", ...e);
603
659
  }
604
660
  };
605
- function Et(e) {
606
- let t = new Tt(e);
661
+ function Mt(e) {
662
+ let t = new jt(e);
607
663
  return t.addLogLineListener((e, ...t) => {
608
664
  switch (e) {
609
665
  case "debug":
@@ -622,11 +678,11 @@ function Et(e) {
622
678
  }
623
679
  }), t;
624
680
  }
625
- function Dt(e) {
626
- return new Tt(e);
681
+ function Nt(e) {
682
+ return new jt(e);
627
683
  }
628
- function Ot(e, t, n, r, i) {
629
- let a = wt(n);
684
+ function Pt(e, t, n, r, i) {
685
+ let a = At(n);
630
686
  if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), t === "info") {
631
687
  let t = i.match(/^\[.*?\] /);
632
688
  if (t === null) {
@@ -634,57 +690,57 @@ function Ot(e, t, n, r, i) {
634
690
  return;
635
691
  }
636
692
  let n = i.slice(1, t[0].length - 2), o = i.slice(t[0].length);
637
- e.log(`%c[CONVEX ${a}(${r})] [${n}]`, Ct, o);
693
+ e.log(`%c[CONVEX ${a}(${r})] [${n}]`, kt, o);
638
694
  } else e.error(`[CONVEX ${a}(${r})] ${i}`);
639
695
  }
640
- function kt(e, t) {
696
+ function Ft(e, t) {
641
697
  let n = `[CONVEX FATAL ERROR] ${t}`;
642
698
  return e.error(n), Error(n);
643
699
  }
644
- function At(e, t, n) {
645
- return `[CONVEX ${wt(e)}(${t})] ${n.errorMessage}
700
+ function It(e, t, n) {
701
+ return `[CONVEX ${At(e)}(${t})] ${n.errorMessage}
646
702
  Called by client`;
647
703
  }
648
- function jt(e, t) {
704
+ function Lt(e, t) {
649
705
  return t.data = e.errorData, t;
650
706
  }
651
707
  //#endregion
652
708
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/udf_path_utils.js
653
- function Mt(e) {
709
+ function Rt(e) {
654
710
  let t = e.split(":"), n, r;
655
711
  return t.length === 1 ? (n = t[0], r = "default") : (n = t.slice(0, t.length - 1).join(":"), r = t[t.length - 1]), n.endsWith(".js") && (n = n.slice(0, -3)), `${n}:${r}`;
656
712
  }
657
- function Nt(e, t) {
713
+ function zt(e, t) {
658
714
  return JSON.stringify({
659
- udfPath: Mt(e),
660
- args: ft(t)
715
+ udfPath: Rt(e),
716
+ args: vt(t)
661
717
  });
662
718
  }
663
- function Pt(e, t, n) {
719
+ function Bt(e, t, n) {
664
720
  let { initialNumItems: r, id: i } = n;
665
721
  return JSON.stringify({
666
722
  type: "paginated",
667
- udfPath: Mt(e),
668
- args: ft(t),
669
- options: ft({
723
+ udfPath: Rt(e),
724
+ args: vt(t),
725
+ options: vt({
670
726
  initialNumItems: r,
671
727
  id: i
672
728
  })
673
729
  });
674
730
  }
675
- function Ft(e) {
731
+ function Vt(e) {
676
732
  return JSON.parse(e).type === "paginated";
677
733
  }
678
734
  //#endregion
679
735
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/local_state.js
680
- var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
736
+ var Ht = Object.defineProperty, Ut = (e, t, n) => t in e ? Ht(e, t, {
681
737
  enumerable: !0,
682
738
  configurable: !0,
683
739
  writable: !0,
684
740
  value: n
685
- }) : e[t] = n, W = (e, t, n) => Lt(e, typeof t == "symbol" ? t : t + "", n), Rt = class {
741
+ }) : e[t] = n, G = (e, t, n) => Ut(e, typeof t == "symbol" ? t : t + "", n), Wt = class {
686
742
  constructor() {
687
- W(this, "nextQueryId"), W(this, "querySetVersion"), W(this, "querySet"), W(this, "queryIdToToken"), W(this, "identityVersion"), W(this, "auth"), W(this, "outstandingQueriesOlderThanRestart"), W(this, "outstandingAuthOlderThanRestart"), W(this, "paused"), W(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
743
+ G(this, "nextQueryId"), G(this, "querySetVersion"), G(this, "querySet"), G(this, "queryIdToToken"), G(this, "identityVersion"), G(this, "auth"), G(this, "outstandingQueriesOlderThanRestart"), G(this, "outstandingAuthOlderThanRestart"), G(this, "paused"), G(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
688
744
  }
689
745
  hasSyncedPastLastReconnect() {
690
746
  return this.outstandingQueriesOlderThanRestart.size === 0 && !this.outstandingAuthOlderThanRestart;
@@ -693,7 +749,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
693
749
  this.outstandingAuthOlderThanRestart = !1;
694
750
  }
695
751
  subscribe(e, t, n, r) {
696
- let i = Mt(e), a = Nt(i, t), o = this.querySet.get(a);
752
+ let i = Rt(e), a = zt(i, t), o = this.querySet.get(a);
697
753
  if (o !== void 0) return o.numSubscribers += 1, {
698
754
  queryToken: a,
699
755
  modification: null,
@@ -713,7 +769,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
713
769
  type: "Add",
714
770
  queryId: e,
715
771
  udfPath: i,
716
- args: [ft(t)],
772
+ args: [vt(t)],
717
773
  journal: n,
718
774
  componentPath: r
719
775
  };
@@ -748,7 +804,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
748
804
  }
749
805
  }
750
806
  queryId(e, t) {
751
- let n = Nt(Mt(e), t), r = this.querySet.get(n);
807
+ let n = zt(Rt(e), t), r = this.querySet.get(n);
752
808
  return r === void 0 ? null : r.id;
753
809
  }
754
810
  isCurrentOrNewerAuthVersion(e) {
@@ -820,7 +876,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
820
876
  type: "Add",
821
877
  queryId: t.id,
822
878
  udfPath: t.canonicalizedUdfPath,
823
- args: [ft(t.args)],
879
+ args: [vt(t.args)],
824
880
  journal: t.journal,
825
881
  componentPath: t.componentPath
826
882
  };
@@ -878,14 +934,14 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
878
934
  };
879
935
  }
880
936
  }
881
- }, zt = Object.defineProperty, Bt = (e, t, n) => t in e ? zt(e, t, {
937
+ }, Gt = Object.defineProperty, Kt = (e, t, n) => t in e ? Gt(e, t, {
882
938
  enumerable: !0,
883
939
  configurable: !0,
884
940
  writable: !0,
885
941
  value: n
886
- }) : e[t] = n, Vt = (e, t, n) => Bt(e, typeof t == "symbol" ? t : t + "", n), Ht = class {
942
+ }) : e[t] = n, qt = (e, t, n) => Kt(e, typeof t == "symbol" ? t : t + "", n), Jt = class {
887
943
  constructor(e, t) {
888
- this.logger = e, this.markConnectionStateDirty = t, Vt(this, "inflightRequests"), Vt(this, "requestsOlderThanRestart"), Vt(this, "inflightMutationsCount", 0), Vt(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
944
+ this.logger = e, this.markConnectionStateDirty = t, qt(this, "inflightRequests"), qt(this, "requestsOlderThanRestart"), qt(this, "inflightMutationsCount", 0), qt(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
889
945
  }
890
946
  request(e, t) {
891
947
  let n = new Promise((n) => {
@@ -905,19 +961,19 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
905
961
  let t = this.inflightRequests.get(e.requestId);
906
962
  if (t === void 0 || t.status.status === "Completed") return null;
907
963
  let n = t.message.type === "Mutation" ? "mutation" : "action", r = t.message.udfPath;
908
- for (let t of e.logLines) Ot(this.logger, "info", n, r, t);
964
+ for (let t of e.logLines) Pt(this.logger, "info", n, r, t);
909
965
  let i = t.status, a, o;
910
966
  if (e.success) a = {
911
967
  success: !0,
912
968
  logLines: e.logLines,
913
- value: ot(e.result)
969
+ value: ft(e.result)
914
970
  }, o = () => i.onResult(a);
915
971
  else {
916
972
  let t = e.result, { errorData: s } = e;
917
- Ot(this.logger, "error", n, r, t), a = {
973
+ Pt(this.logger, "error", n, r, t), a = {
918
974
  success: !1,
919
975
  errorMessage: t,
920
- errorData: s === void 0 ? void 0 : ot(s),
976
+ errorData: s === void 0 ? void 0 : ft(s),
921
977
  logLines: e.logLines
922
978
  }, o = () => i.onResult(a);
923
979
  }
@@ -989,19 +1045,19 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
989
1045
  inflightActions() {
990
1046
  return this.inflightActionsCount;
991
1047
  }
992
- }, Ut = Symbol.for("functionName"), Wt = Symbol.for("toReferencePath");
993
- function Gt(e) {
994
- return e[Wt] ?? null;
1048
+ }, Yt = Symbol.for("functionName"), Xt = Symbol.for("toReferencePath");
1049
+ function Zt(e) {
1050
+ return e[Xt] ?? null;
995
1051
  }
996
- function Kt(e) {
1052
+ function Qt(e) {
997
1053
  return e.startsWith("function://");
998
1054
  }
999
- function qt(e) {
1055
+ function $t(e) {
1000
1056
  let t;
1001
- if (typeof e == "string") t = Kt(e) ? { functionHandle: e } : { name: e };
1002
- else if (e[Ut]) t = { name: e[Ut] };
1057
+ if (typeof e == "string") t = Qt(e) ? { functionHandle: e } : { name: e };
1058
+ else if (e[Yt]) t = { name: e[Yt] };
1003
1059
  else {
1004
- let n = Gt(e);
1060
+ let n = Zt(e);
1005
1061
  if (!n) throw Error(`${e} is not a functionReference`);
1006
1062
  t = { reference: n };
1007
1063
  }
@@ -1009,21 +1065,21 @@ function qt(e) {
1009
1065
  }
1010
1066
  //#endregion
1011
1067
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/server/api.js
1012
- function G(e) {
1013
- let t = qt(e);
1068
+ function K(e) {
1069
+ let t = $t(e);
1014
1070
  if (t.name === void 0) throw t.functionHandle === void 0 ? t.reference === void 0 ? Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`) : Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`) : Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);
1015
1071
  if (typeof e == "string") return e;
1016
- let n = e[Ut];
1072
+ let n = e[Yt];
1017
1073
  if (!n) throw Error(`${e} is not a functionReference`);
1018
1074
  return n;
1019
1075
  }
1020
- function Jt(e) {
1021
- return { [Ut]: e };
1076
+ function en(e) {
1077
+ return { [Yt]: e };
1022
1078
  }
1023
- function Yt(e = []) {
1079
+ function tn(e = []) {
1024
1080
  return new Proxy({}, { get(t, n) {
1025
- if (typeof n == "string") return Yt([...e, n]);
1026
- if (n === Ut) {
1081
+ if (typeof n == "string") return tn([...e, n]);
1082
+ if (n === Yt) {
1027
1083
  if (e.length < 2) {
1028
1084
  let t = ["api", ...e].join(".");
1029
1085
  throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``);
@@ -1034,32 +1090,32 @@ function Yt(e = []) {
1034
1090
  else return;
1035
1091
  } });
1036
1092
  }
1037
- Yt();
1093
+ tn();
1038
1094
  //#endregion
1039
1095
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/optimistic_updates_impl.js
1040
- var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1096
+ var nn = Object.defineProperty, rn = (e, t, n) => t in e ? nn(e, t, {
1041
1097
  enumerable: !0,
1042
1098
  configurable: !0,
1043
1099
  writable: !0,
1044
1100
  value: n
1045
- }) : e[t] = n, Qt = (e, t, n) => Zt(e, typeof t == "symbol" ? t : t + "", n), $t = class e {
1101
+ }) : e[t] = n, an = (e, t, n) => rn(e, typeof t == "symbol" ? t : t + "", n), on = class e {
1046
1102
  constructor(e) {
1047
- Qt(this, "queryResults"), Qt(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
1103
+ an(this, "queryResults"), an(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
1048
1104
  }
1049
1105
  getQuery(t, ...n) {
1050
- let r = He(n[0]), i = G(t), a = this.queryResults.get(Nt(i, r));
1106
+ let r = W(n[0]), i = K(t), a = this.queryResults.get(zt(i, r));
1051
1107
  if (a !== void 0) return e.queryValue(a.result);
1052
1108
  }
1053
1109
  getAllQueries(t) {
1054
- let n = [], r = G(t);
1055
- for (let t of this.queryResults.values()) t.udfPath === Mt(r) && n.push({
1110
+ let n = [], r = K(t);
1111
+ for (let t of this.queryResults.values()) t.udfPath === Rt(r) && n.push({
1056
1112
  args: t.args,
1057
1113
  value: e.queryValue(t.result)
1058
1114
  });
1059
1115
  return n;
1060
1116
  }
1061
1117
  setQuery(e, t, n) {
1062
- let r = He(t), i = G(e), a = Nt(i, r), o;
1118
+ let r = W(t), i = K(e), a = zt(i, r), o;
1063
1119
  o = n === void 0 ? void 0 : {
1064
1120
  success: !0,
1065
1121
  value: n,
@@ -1075,15 +1131,15 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1075
1131
  static queryValue(e) {
1076
1132
  if (e !== void 0 && e.success) return e.value;
1077
1133
  }
1078
- }, en = class {
1134
+ }, sn = class {
1079
1135
  constructor() {
1080
- Qt(this, "queryResults"), Qt(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
1136
+ an(this, "queryResults"), an(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
1081
1137
  }
1082
1138
  ingestQueryResultsFromServer(e, t) {
1083
1139
  this.optimisticUpdates = this.optimisticUpdates.filter((e) => !t.has(e.mutationId));
1084
1140
  let n = this.queryResults;
1085
1141
  this.queryResults = new Map(e);
1086
- let r = new $t(this.queryResults);
1142
+ let r = new on(this.queryResults);
1087
1143
  for (let e of this.optimisticUpdates) e.update(r);
1088
1144
  let i = [];
1089
1145
  for (let [e, t] of this.queryResults) {
@@ -1097,7 +1153,7 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1097
1153
  update: e,
1098
1154
  mutationId: t
1099
1155
  });
1100
- let n = new $t(this.queryResults);
1156
+ let n = new on(this.queryResults);
1101
1157
  return e(n), n.modifiedQueries;
1102
1158
  }
1103
1159
  rawQueryResult(e) {
@@ -1110,7 +1166,7 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1110
1166
  let n = t.result;
1111
1167
  if (n !== void 0) {
1112
1168
  if (n.success) return n.value;
1113
- throw n.errorData === void 0 ? Error(At("query", t.udfPath, n)) : jt(n, new yt(At("query", t.udfPath, n)));
1169
+ throw n.errorData === void 0 ? Error(It("query", t.udfPath, n)) : Lt(n, new Tt(It("query", t.udfPath, n)));
1114
1170
  }
1115
1171
  }
1116
1172
  hasQueryResult(e) {
@@ -1119,14 +1175,14 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1119
1175
  queryLogs(e) {
1120
1176
  return this.queryResults.get(e)?.result?.logLines;
1121
1177
  }
1122
- }, tn = Object.defineProperty, nn = (e, t, n) => t in e ? tn(e, t, {
1178
+ }, cn = Object.defineProperty, ln = (e, t, n) => t in e ? cn(e, t, {
1123
1179
  enumerable: !0,
1124
1180
  configurable: !0,
1125
1181
  writable: !0,
1126
1182
  value: n
1127
- }) : e[t] = n, rn = (e, t, n) => nn(e, typeof t == "symbol" ? t : t + "", n), an = class e {
1183
+ }) : e[t] = n, un = (e, t, n) => ln(e, typeof t == "symbol" ? t : t + "", n), dn = class e {
1128
1184
  constructor(e, t) {
1129
- rn(this, "low"), rn(this, "high"), rn(this, "__isUnsignedLong__"), this.low = e | 0, this.high = t | 0, this.__isUnsignedLong__ = !0;
1185
+ un(this, "low"), un(this, "high"), un(this, "__isUnsignedLong__"), this.low = e | 0, this.high = t | 0, this.__isUnsignedLong__ = !0;
1130
1186
  }
1131
1187
  static isLong(e) {
1132
1188
  return (e && e.__isUnsignedLong__) === !0;
@@ -1148,10 +1204,10 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1148
1204
  ];
1149
1205
  }
1150
1206
  static fromNumber(t) {
1151
- return isNaN(t) || t < 0 ? on : t >= ln ? un : new e(t % cn | 0, t / cn | 0);
1207
+ return isNaN(t) || t < 0 ? fn : t >= hn ? gn : new e(t % mn | 0, t / mn | 0);
1152
1208
  }
1153
1209
  toString() {
1154
- return (BigInt(this.high) * BigInt(cn) + BigInt(this.low)).toString();
1210
+ return (BigInt(this.high) * BigInt(mn) + BigInt(this.low)).toString();
1155
1211
  }
1156
1212
  equals(t) {
1157
1213
  return e.isLong(t) || (t = e.fromValue(t)), this.high >>> 31 == 1 && t.high >>> 31 == 1 ? !1 : this.high === t.high && this.low === t.low;
@@ -1168,16 +1224,16 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1168
1224
  static fromValue(t) {
1169
1225
  return typeof t == "number" ? e.fromNumber(t) : new e(t.low, t.high);
1170
1226
  }
1171
- }, on = new an(0, 0), sn = 65536, cn = sn * sn, ln = cn * cn, un = new an(-1, -1), dn = Object.defineProperty, fn = (e, t, n) => t in e ? dn(e, t, {
1227
+ }, fn = new dn(0, 0), pn = 65536, mn = pn * pn, hn = mn * mn, gn = new dn(-1, -1), _n = Object.defineProperty, vn = (e, t, n) => t in e ? _n(e, t, {
1172
1228
  enumerable: !0,
1173
1229
  configurable: !0,
1174
1230
  writable: !0,
1175
1231
  value: n
1176
- }) : e[t] = n, pn = (e, t, n) => fn(e, typeof t == "symbol" ? t : t + "", n), mn = class {
1232
+ }) : e[t] = n, yn = (e, t, n) => vn(e, typeof t == "symbol" ? t : t + "", n), bn = class {
1177
1233
  constructor(e, t) {
1178
- pn(this, "version"), pn(this, "remoteQuerySet"), pn(this, "queryPath"), pn(this, "logger"), this.version = {
1234
+ yn(this, "version"), yn(this, "remoteQuerySet"), yn(this, "queryPath"), yn(this, "logger"), this.version = {
1179
1235
  querySet: 0,
1180
- ts: an.fromNumber(0),
1236
+ ts: dn.fromNumber(0),
1181
1237
  identity: 0
1182
1238
  }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = t;
1183
1239
  }
@@ -1187,8 +1243,8 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1187
1243
  for (let t of e.modifications) switch (t.type) {
1188
1244
  case "QueryUpdated": {
1189
1245
  let e = this.queryPath(t.queryId);
1190
- if (e) for (let n of t.logLines) Ot(this.logger, "info", "query", e, n);
1191
- let n = ot(t.value ?? null);
1246
+ if (e) for (let n of t.logLines) Pt(this.logger, "info", "query", e, n);
1247
+ let n = ft(t.value ?? null);
1192
1248
  this.remoteQuerySet.set(t.queryId, {
1193
1249
  success: !0,
1194
1250
  value: n,
@@ -1198,12 +1254,12 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1198
1254
  }
1199
1255
  case "QueryFailed": {
1200
1256
  let e = this.queryPath(t.queryId);
1201
- if (e) for (let n of t.logLines) Ot(this.logger, "info", "query", e, n);
1257
+ if (e) for (let n of t.logLines) Pt(this.logger, "info", "query", e, n);
1202
1258
  let { errorData: n } = t;
1203
1259
  this.remoteQuerySet.set(t.queryId, {
1204
1260
  success: !1,
1205
1261
  errorMessage: t.errorMessage,
1206
- errorData: n === void 0 ? void 0 : ot(n),
1262
+ errorData: n === void 0 ? void 0 : ft(n),
1207
1263
  logLines: t.logLines
1208
1264
  });
1209
1265
  break;
@@ -1224,14 +1280,14 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1224
1280
  };
1225
1281
  //#endregion
1226
1282
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/protocol.js
1227
- function hn(e) {
1228
- let t = Re(e);
1229
- return an.fromBytesLE(Array.from(t));
1283
+ function xn(e) {
1284
+ let t = Ge(e);
1285
+ return dn.fromBytesLE(Array.from(t));
1230
1286
  }
1231
- function gn(e) {
1232
- return Ve(new Uint8Array(e.toBytesLE()));
1287
+ function Sn(e) {
1288
+ return Je(new Uint8Array(e.toBytesLE()));
1233
1289
  }
1234
- function _n(e) {
1290
+ function Cn(e) {
1235
1291
  switch (e.type) {
1236
1292
  case "FatalError":
1237
1293
  case "AuthError":
@@ -1240,23 +1296,23 @@ function _n(e) {
1240
1296
  case "Ping": return { ...e };
1241
1297
  case "MutationResponse": return e.success ? {
1242
1298
  ...e,
1243
- ts: hn(e.ts)
1299
+ ts: xn(e.ts)
1244
1300
  } : { ...e };
1245
1301
  case "Transition": return {
1246
1302
  ...e,
1247
1303
  startVersion: {
1248
1304
  ...e.startVersion,
1249
- ts: hn(e.startVersion.ts)
1305
+ ts: xn(e.startVersion.ts)
1250
1306
  },
1251
1307
  endVersion: {
1252
1308
  ...e.endVersion,
1253
- ts: hn(e.endVersion.ts)
1309
+ ts: xn(e.endVersion.ts)
1254
1310
  }
1255
1311
  };
1256
1312
  default:
1257
1313
  }
1258
1314
  }
1259
- function vn(e) {
1315
+ function wn(e) {
1260
1316
  switch (e.type) {
1261
1317
  case "Authenticate":
1262
1318
  case "ModifyQuerySet":
@@ -1268,26 +1324,26 @@ function vn(e) {
1268
1324
  maxObservedTimestamp: void 0
1269
1325
  } : {
1270
1326
  ...e,
1271
- maxObservedTimestamp: gn(e.maxObservedTimestamp)
1327
+ maxObservedTimestamp: Sn(e.maxObservedTimestamp)
1272
1328
  };
1273
1329
  default:
1274
1330
  }
1275
1331
  }
1276
1332
  //#endregion
1277
1333
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/web_socket_manager.js
1278
- var yn = Object.defineProperty, bn = (e, t, n) => t in e ? yn(e, t, {
1334
+ var Tn = Object.defineProperty, En = (e, t, n) => t in e ? Tn(e, t, {
1279
1335
  enumerable: !0,
1280
1336
  configurable: !0,
1281
1337
  writable: !0,
1282
1338
  value: n
1283
- }) : e[t] = n, K = (e, t, n) => bn(e, typeof t == "symbol" ? t : t + "", n), xn = 1e3, Sn = 1001, Cn = 1005, wn = 4040, Tn;
1284
- function En() {
1285
- return Tn === void 0 && (Tn = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(Tn + performance.now());
1339
+ }) : e[t] = n, q = (e, t, n) => En(e, typeof t == "symbol" ? t : t + "", n), Dn = 1e3, On = 1001, kn = 1005, An = 4040, jn;
1340
+ function Mn() {
1341
+ return jn === void 0 && (jn = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(jn + performance.now());
1286
1342
  }
1287
- function Dn() {
1288
- return `t=${Math.round((En() - Tn) / 100) / 10}s`;
1343
+ function Nn() {
1344
+ return `t=${Math.round((Mn() - jn) / 100) / 10}s`;
1289
1345
  }
1290
- var On = {
1346
+ var Pn = {
1291
1347
  InternalServerError: { timeout: 1e3 },
1292
1348
  SubscriptionsWorkerFullError: { timeout: 3e3 },
1293
1349
  TooManyConcurrentRequests: { timeout: 3e3 },
@@ -1303,14 +1359,14 @@ var On = {
1303
1359
  SearchIndexTooLarge: { timeout: 3e3 },
1304
1360
  TooManyWritesInTimePeriod: { timeout: 3e3 }
1305
1361
  };
1306
- function kn(e) {
1362
+ function Fn(e) {
1307
1363
  if (e === void 0) return "Unknown";
1308
- for (let t of Object.keys(On)) if (e.startsWith(t)) return t;
1364
+ for (let t of Object.keys(Pn)) if (e.startsWith(t)) return t;
1309
1365
  return "Unknown";
1310
1366
  }
1311
- var An = class {
1367
+ var In = class {
1312
1368
  constructor(e, t, n, r, i, a) {
1313
- this.markConnectionStateDirty = i, this.debug = a, K(this, "socket"), K(this, "connectionCount"), K(this, "_hasEverConnected", !1), K(this, "lastCloseReason"), K(this, "transitionChunkBuffer", null), K(this, "defaultInitialBackoff"), K(this, "maxBackoff"), K(this, "retries"), K(this, "serverInactivityThreshold"), K(this, "reconnectDueToServerInactivityTimeout"), K(this, "scheduledReconnect", null), K(this, "networkOnlineHandler", null), K(this, "pendingNetworkRecoveryInfo", null), K(this, "uri"), K(this, "onOpen"), K(this, "onResume"), K(this, "onMessage"), K(this, "webSocketConstructor"), K(this, "logger"), K(this, "onServerDisconnectError"), this.webSocketConstructor = n, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = t.onOpen, this.onResume = t.onResume, this.onMessage = t.onMessage, this.onServerDisconnectError = t.onServerDisconnectError, this.logger = r, this.setupNetworkListener(), this.connect();
1369
+ this.markConnectionStateDirty = i, this.debug = a, q(this, "socket"), q(this, "connectionCount"), q(this, "_hasEverConnected", !1), q(this, "lastCloseReason"), q(this, "transitionChunkBuffer", null), q(this, "defaultInitialBackoff"), q(this, "maxBackoff"), q(this, "retries"), q(this, "serverInactivityThreshold"), q(this, "reconnectDueToServerInactivityTimeout"), q(this, "scheduledReconnect", null), q(this, "networkOnlineHandler", null), q(this, "pendingNetworkRecoveryInfo", null), q(this, "uri"), q(this, "onOpen"), q(this, "onResume"), q(this, "onMessage"), q(this, "webSocketConstructor"), q(this, "logger"), q(this, "onServerDisconnectError"), this.webSocketConstructor = n, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = t.onOpen, this.onResume = t.onResume, this.onMessage = t.onMessage, this.onServerDisconnectError = t.onServerDisconnectError, this.logger = r, this.setupNetworkListener(), this.connect();
1314
1370
  }
1315
1371
  setSocketState(e) {
1316
1372
  this.socket = e, this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused" in this.socket ? this.socket.paused : void 0}`), this.markConnectionStateDirty();
@@ -1336,7 +1392,7 @@ var An = class {
1336
1392
  if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
1337
1393
  let e = this.transitionChunkBuffer.chunks.join("");
1338
1394
  this.transitionChunkBuffer = null;
1339
- let t = _n(JSON.parse(e));
1395
+ let t = Cn(JSON.parse(e));
1340
1396
  if (t.type !== "Transition") throw Error(`Expected Transition, got ${t.type} after assembling chunks`);
1341
1397
  return t;
1342
1398
  }
@@ -1359,8 +1415,8 @@ var An = class {
1359
1415
  }), this.resetServerInactivityTimeout(), this.socket.paused === "no" && (this._hasEverConnected = !0, this.onOpen({
1360
1416
  connectionCount: this.connectionCount,
1361
1417
  lastCloseReason: this.lastCloseReason,
1362
- clientTs: En()
1363
- })), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at", Dn(), "after disconnect due to", this.lastCloseReason) : this.logger.log("WebSocket reconnected at", Dn())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
1418
+ clientTs: Mn()
1419
+ })), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at", Nn(), "after disconnect due to", this.lastCloseReason) : this.logger.log("WebSocket reconnected at", Nn())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
1364
1420
  let { timeSavedMs: e } = this.pendingNetworkRecoveryInfo;
1365
1421
  this.pendingNetworkRecoveryInfo = null, this.sendMessage({
1366
1422
  type: "Event",
@@ -1374,7 +1430,7 @@ var An = class {
1374
1430
  t && this.logger.log(`WebSocket error message: ${t}`);
1375
1431
  }, e.onmessage = (e) => {
1376
1432
  this.resetServerInactivityTimeout();
1377
- let t = e.data.length, n = _n(JSON.parse(e.data));
1433
+ let t = e.data.length, n = Cn(JSON.parse(e.data));
1378
1434
  if (this._logVerbose(`received ws message with type ${n.type}`), n.type !== "Ping") {
1379
1435
  if (n.type === "TransitionChunk") {
1380
1436
  let e = this.assembleTransition(n);
@@ -1387,11 +1443,11 @@ var An = class {
1387
1443
  }), this.onMessage(n).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
1388
1444
  }
1389
1445
  }, e.onclose = (e) => {
1390
- if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !== xn && e.code !== Sn && e.code !== Cn && e.code !== wn) {
1446
+ if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !== Dn && e.code !== On && e.code !== kn && e.code !== An) {
1391
1447
  let t = `WebSocket closed with code ${e.code}`;
1392
1448
  e.reason && (t += `: ${e.reason}`), this.logger.log(t), this.onServerDisconnectError && e.reason && this.onServerDisconnectError(t);
1393
1449
  }
1394
- let t = kn(e.reason);
1450
+ let t = Fn(e.reason);
1395
1451
  this.scheduleReconnect(t);
1396
1452
  };
1397
1453
  }
@@ -1404,7 +1460,7 @@ var An = class {
1404
1460
  ...e.type === "Authenticate" && e.tokenType === "User" ? { value: `...${e.value.slice(-7)}` } : {}
1405
1461
  };
1406
1462
  if (this.socket.state === "ready" && this.socket.paused === "no") {
1407
- let n = vn(e), r = JSON.stringify(n), i = !1;
1463
+ let n = wn(e), r = JSON.stringify(n), i = !1;
1408
1464
  try {
1409
1465
  this.socket.ws.send(r), i = !0;
1410
1466
  } catch (e) {
@@ -1423,7 +1479,7 @@ var An = class {
1423
1479
  this.scheduledReconnect &&= (clearTimeout(this.scheduledReconnect.timeout), null), this.socket = { state: "disconnected" };
1424
1480
  let t = this.nextBackoff(e);
1425
1481
  this.markConnectionStateDirty(), this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);
1426
- let n = En(), r = setTimeout(() => {
1482
+ let n = Mn(), r = setTimeout(() => {
1427
1483
  this.scheduledReconnect?.timeout === r && (this.scheduledReconnect = null, this.connect());
1428
1484
  }, t);
1429
1485
  this.scheduledReconnect = {
@@ -1541,7 +1597,7 @@ var An = class {
1541
1597
  }
1542
1598
  let e = null;
1543
1599
  if (this.scheduledReconnect) {
1544
- let t = En() - this.scheduledReconnect.scheduledAt;
1600
+ let t = Mn() - this.scheduledReconnect.scheduledAt;
1545
1601
  e = Math.max(0, this.scheduledReconnect.backoffMs - t), this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`), clearTimeout(this.scheduledReconnect.timeout), this.scheduledReconnect = null, this._logVerbose("canceled scheduled reconnect");
1546
1602
  }
1547
1603
  this.logger.log("Network recovery detected, reconnecting immediately"), this.pendingNetworkRecoveryInfo = e === null ? null : { timeSavedMs: e }, this.connect();
@@ -1561,7 +1617,7 @@ var An = class {
1561
1617
  }, this._hasEverConnected = !0, this.onOpen({
1562
1618
  connectionCount: this.connectionCount,
1563
1619
  lastCloseReason: this.lastCloseReason,
1564
- clientTs: En()
1620
+ clientTs: Mn()
1565
1621
  })) : this.socket.paused === "yes" && (this.socket = {
1566
1622
  ...this.socket,
1567
1623
  paused: "no"
@@ -1586,14 +1642,14 @@ var An = class {
1586
1642
  this.logger.logVerbose(e);
1587
1643
  }
1588
1644
  nextBackoff(e) {
1589
- let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : On[e].timeout) * 2 ** this.retries;
1645
+ let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : Pn[e].timeout) * 2 ** this.retries;
1590
1646
  this.retries += 1;
1591
1647
  let n = Math.min(t, this.maxBackoff);
1592
1648
  return n + n * (Math.random() - .5);
1593
1649
  }
1594
1650
  reportLargeTransition({ transition: e, messageLength: t }) {
1595
1651
  if (e.clientClockSkew === void 0 || e.serverTs === void 0) return;
1596
- let n = En() - e.clientClockSkew - e.serverTs / 1e6, r = `${Math.round(n)}ms`, i = `${Math.round(t / 1e4) / 100}MB`, a = t / (n / 1e3), o = `${Math.round(a / 1e4) / 100}MB per second`;
1652
+ let n = Mn() - e.clientClockSkew - e.serverTs / 1e6, r = `${Math.round(n)}ms`, i = `${Math.round(t / 1e4) / 100}MB`, a = t / (n / 1e3), o = `${Math.round(a / 1e4) / 100}MB per second`;
1597
1653
  this._logVerbose(`received ${i} transition in ${r} at ${o}`), t > 2e7 ? this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`) : n > 2e4 && this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`), this.debug && this.sendMessage({
1598
1654
  type: "Event",
1599
1655
  eventType: "ClientReceivedTransition",
@@ -1606,10 +1662,10 @@ var An = class {
1606
1662
  };
1607
1663
  //#endregion
1608
1664
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/session.js
1609
- function jn() {
1610
- return Mn();
1665
+ function Ln() {
1666
+ return Rn();
1611
1667
  }
1612
- function Mn() {
1668
+ function Rn() {
1613
1669
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
1614
1670
  let t = Math.random() * 16 | 0;
1615
1671
  return (e === "x" ? t : t & 3 | 8).toString(16);
@@ -1617,15 +1673,15 @@ function Mn() {
1617
1673
  }
1618
1674
  //#endregion
1619
1675
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/vendor/jwt-decode/index.js
1620
- var Nn = class extends Error {};
1621
- Nn.prototype.name = "InvalidTokenError";
1622
- function Pn(e) {
1676
+ var zn = class extends Error {};
1677
+ zn.prototype.name = "InvalidTokenError";
1678
+ function Bn(e) {
1623
1679
  return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
1624
1680
  let n = t.charCodeAt(0).toString(16).toUpperCase();
1625
1681
  return n.length < 2 && (n = "0" + n), "%" + n;
1626
1682
  }));
1627
1683
  }
1628
- function Fn(e) {
1684
+ function Vn(e) {
1629
1685
  let t = e.replace(/-/g, "+").replace(/_/g, "/");
1630
1686
  switch (t.length % 4) {
1631
1687
  case 0: break;
@@ -1638,38 +1694,38 @@ function Fn(e) {
1638
1694
  default: throw Error("base64 string is not of the correct length");
1639
1695
  }
1640
1696
  try {
1641
- return Pn(t);
1697
+ return Bn(t);
1642
1698
  } catch {
1643
1699
  return atob(t);
1644
1700
  }
1645
1701
  }
1646
- function In(e, t) {
1647
- if (typeof e != "string") throw new Nn("Invalid token specified: must be a string");
1702
+ function Hn(e, t) {
1703
+ if (typeof e != "string") throw new zn("Invalid token specified: must be a string");
1648
1704
  t ||= {};
1649
1705
  let n = t.header === !0 ? 0 : 1, r = e.split(".")[n];
1650
- if (typeof r != "string") throw new Nn(`Invalid token specified: missing part #${n + 1}`);
1706
+ if (typeof r != "string") throw new zn(`Invalid token specified: missing part #${n + 1}`);
1651
1707
  let i;
1652
1708
  try {
1653
- i = Fn(r);
1709
+ i = Vn(r);
1654
1710
  } catch (e) {
1655
- throw new Nn(`Invalid token specified: invalid base64 for part #${n + 1} (${e.message})`);
1711
+ throw new zn(`Invalid token specified: invalid base64 for part #${n + 1} (${e.message})`);
1656
1712
  }
1657
1713
  try {
1658
1714
  return JSON.parse(i);
1659
1715
  } catch (e) {
1660
- throw new Nn(`Invalid token specified: invalid json for part #${n + 1} (${e.message})`);
1716
+ throw new zn(`Invalid token specified: invalid json for part #${n + 1} (${e.message})`);
1661
1717
  }
1662
1718
  }
1663
1719
  //#endregion
1664
1720
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/authentication_manager.js
1665
- var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1721
+ var Un = Object.defineProperty, Wn = (e, t, n) => t in e ? Un(e, t, {
1666
1722
  enumerable: !0,
1667
1723
  configurable: !0,
1668
1724
  writable: !0,
1669
1725
  value: n
1670
- }) : e[t] = n, q = (e, t, n) => Rn(e, typeof t == "symbol" ? t : t + "", n), zn = 480 * 60 * 60 * 1e3, Bn = 2, Vn = class {
1726
+ }) : e[t] = n, J = (e, t, n) => Wn(e, typeof t == "symbol" ? t : t + "", n), Gn = 480 * 60 * 60 * 1e3, Kn = 2, qn = class {
1671
1727
  constructor(e, t, n) {
1672
- q(this, "authState", { state: "noAuth" }), q(this, "configVersion", 0), q(this, "syncState"), q(this, "authenticate"), q(this, "stopSocket"), q(this, "tryRestartSocket"), q(this, "pauseSocket"), q(this, "resumeSocket"), q(this, "clearAuth"), q(this, "logger"), q(this, "refreshTokenLeewaySeconds"), q(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = t.authenticate, this.stopSocket = t.stopSocket, this.tryRestartSocket = t.tryRestartSocket, this.pauseSocket = t.pauseSocket, this.resumeSocket = t.resumeSocket, this.clearAuth = t.clearAuth, this.logger = n.logger, this.refreshTokenLeewaySeconds = n.refreshTokenLeewaySeconds;
1728
+ J(this, "authState", { state: "noAuth" }), J(this, "configVersion", 0), J(this, "syncState"), J(this, "authenticate"), J(this, "stopSocket"), J(this, "tryRestartSocket"), J(this, "pauseSocket"), J(this, "resumeSocket"), J(this, "clearAuth"), J(this, "logger"), J(this, "refreshTokenLeewaySeconds"), J(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = t.authenticate, this.stopSocket = t.stopSocket, this.tryRestartSocket = t.tryRestartSocket, this.pauseSocket = t.pauseSocket, this.resumeSocket = t.resumeSocket, this.clearAuth = t.clearAuth, this.logger = n.logger, this.refreshTokenLeewaySeconds = n.refreshTokenLeewaySeconds;
1673
1729
  }
1674
1730
  async setConfig(e, t) {
1675
1731
  this.resetAuthState(), this._logVerbose("pausing WS for auth token fetch"), this.pauseSocket();
@@ -1711,11 +1767,11 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1711
1767
  this.tryToReauthenticate(e);
1712
1768
  }
1713
1769
  async tryToReauthenticate(e) {
1714
- if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= Bn) {
1770
+ if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= Kn) {
1715
1771
  this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`), this.syncState.hasAuth() && this.syncState.clearAuth(), this.authState.state !== "noAuth" && this.setAndReportAuthFailed(this.authState.config.onAuthChange);
1716
1772
  return;
1717
1773
  }
1718
- this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${Bn - this.tokenConfirmationAttempts} attempts remaining`)), await this.stopSocket();
1774
+ this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${Kn - this.tokenConfirmationAttempts} attempts remaining`)), await this.stopSocket();
1719
1775
  let t = await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken, { forceRefreshToken: !0 });
1720
1776
  t.isFromOutdatedConfig || (t.value && this.syncState.isNewAuth(t.value) ? (this.authenticate(t.value), this.setAuthState({
1721
1777
  state: "waitingForServerConfirmationOfFreshToken",
@@ -1755,7 +1811,7 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1755
1811
  this.logger.error("Auth token does not live long enough, cannot refetch the token");
1756
1812
  return;
1757
1813
  }
1758
- let a = Math.min(zn, (i - this.refreshTokenLeewaySeconds) * 1e3);
1814
+ let a = Math.min(Gn, (i - this.refreshTokenLeewaySeconds) * 1e3);
1759
1815
  a <= 0 && (this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`), a = 0);
1760
1816
  let o = setTimeout(() => {
1761
1817
  this._logVerbose("running scheduled token refetch"), this.refetchToken();
@@ -1805,7 +1861,7 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1805
1861
  }
1806
1862
  decodeToken(e) {
1807
1863
  try {
1808
- return In(e);
1864
+ return Hn(e);
1809
1865
  } catch (e) {
1810
1866
  return this._logVerbose(`Error decoding token: ${e instanceof Error ? e.message : "Unknown error"}`), null;
1811
1867
  }
@@ -1813,41 +1869,41 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1813
1869
  _logVerbose(e) {
1814
1870
  this.logger.logVerbose(`${e} [v${this.configVersion}]`);
1815
1871
  }
1816
- }, Hn = [
1872
+ }, Jn = [
1817
1873
  "convexClientConstructed",
1818
1874
  "convexWebSocketOpen",
1819
1875
  "convexFirstMessageReceived"
1820
1876
  ];
1821
- function Un(e, t) {
1877
+ function Yn(e, t) {
1822
1878
  let n = { sessionId: t };
1823
1879
  typeof performance > "u" || !performance.mark || performance.mark(e, { detail: n });
1824
1880
  }
1825
- function Wn(e) {
1881
+ function Xn(e) {
1826
1882
  let t = e.name.slice(6);
1827
1883
  return t = t.charAt(0).toLowerCase() + t.slice(1), {
1828
1884
  name: t,
1829
1885
  startTime: e.startTime
1830
1886
  };
1831
1887
  }
1832
- function Gn(e) {
1888
+ function Zn(e) {
1833
1889
  if (typeof performance > "u" || !performance.getEntriesByName) return [];
1834
1890
  let t = [];
1835
- for (let n of Hn) {
1891
+ for (let n of Jn) {
1836
1892
  let r = performance.getEntriesByName(n).filter((e) => e.entryType === "mark").filter((t) => t.detail.sessionId === e);
1837
1893
  t.push(...r);
1838
1894
  }
1839
- return t.map(Wn);
1895
+ return t.map(Xn);
1840
1896
  }
1841
1897
  //#endregion
1842
1898
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/client.js
1843
- var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1899
+ var Qn = Object.defineProperty, $n = (e, t, n) => t in e ? Qn(e, t, {
1844
1900
  enumerable: !0,
1845
1901
  configurable: !0,
1846
1902
  writable: !0,
1847
1903
  value: n
1848
- }) : e[t] = n, J = (e, t, n) => qn(e, typeof t == "symbol" ? t : t + "", n), Jn = class {
1904
+ }) : e[t] = n, Y = (e, t, n) => $n(e, typeof t == "symbol" ? t : t + "", n), er = class {
1849
1905
  constructor(e, t, n) {
1850
- if (J(this, "address"), J(this, "state"), J(this, "requestManager"), J(this, "webSocketManager"), J(this, "authenticationManager"), J(this, "remoteQuerySet"), J(this, "optimisticQueryResults"), J(this, "_transitionHandlerCounter", 0), J(this, "_nextRequestId"), J(this, "_onTransitionFns", /* @__PURE__ */ new Map()), J(this, "_sessionId"), J(this, "firstMessageReceived", !1), J(this, "debug"), J(this, "logger"), J(this, "maxObservedTimestamp"), J(this, "connectionStateSubscribers", /* @__PURE__ */ new Map()), J(this, "nextConnectionStateSubscriberId", 0), J(this, "_lastPublishedConnectionState"), J(this, "markConnectionStateDirty", () => {
1906
+ if (Y(this, "address"), Y(this, "state"), Y(this, "requestManager"), Y(this, "webSocketManager"), Y(this, "authenticationManager"), Y(this, "remoteQuerySet"), Y(this, "optimisticQueryResults"), Y(this, "_transitionHandlerCounter", 0), Y(this, "_nextRequestId"), Y(this, "_onTransitionFns", /* @__PURE__ */ new Map()), Y(this, "_sessionId"), Y(this, "firstMessageReceived", !1), Y(this, "debug"), Y(this, "logger"), Y(this, "maxObservedTimestamp"), Y(this, "connectionStateSubscribers", /* @__PURE__ */ new Map()), Y(this, "nextConnectionStateSubscriberId", 0), Y(this, "_lastPublishedConnectionState"), Y(this, "markConnectionStateDirty", () => {
1851
1907
  Promise.resolve().then(() => {
1852
1908
  let e = this.connectionState();
1853
1909
  if (JSON.stringify(e) !== JSON.stringify(this._lastPublishedConnectionState)) {
@@ -1855,25 +1911,25 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1855
1911
  for (let t of this.connectionStateSubscribers.values()) t(e);
1856
1912
  }
1857
1913
  });
1858
- }), J(this, "mark", (e) => {
1859
- this.debug && Un(e, this.sessionId);
1914
+ }), Y(this, "mark", (e) => {
1915
+ this.debug && Yn(e, this.sessionId);
1860
1916
  }), typeof e == "object") throw Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");
1861
- n?.skipConvexDeploymentUrlCheck !== !0 && Ue(e), n = { ...n };
1917
+ n?.skipConvexDeploymentUrlCheck !== !0 && Ye(e), n = { ...n };
1862
1918
  let r = n.authRefreshTokenLeewaySeconds ?? 10, i = n.webSocketConstructor;
1863
1919
  if (!i && typeof WebSocket > "u") throw Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");
1864
- i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ? Dt({ verbose: n.verbose ?? !1 }) : n.logger !== !0 && n.logger ? n.logger : Et({ verbose: n.verbose ?? !1 });
1920
+ i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ? Nt({ verbose: n.verbose ?? !1 }) : n.logger !== !0 && n.logger ? n.logger : Mt({ verbose: n.verbose ?? !1 });
1865
1921
  let a = e.search("://");
1866
1922
  if (a === -1) throw Error("Provided address was not an absolute URL.");
1867
1923
  let o = e.substring(a + 3), s = e.substring(0, a), c;
1868
1924
  if (s === "http") c = "ws";
1869
1925
  else if (s === "https") c = "wss";
1870
1926
  else throw Error(`Unknown parent protocol ${s}`);
1871
- let l = `${c}://${o}/api/${je}/sync`;
1872
- this.state = new Rt(), this.remoteQuerySet = new mn((e) => this.state.queryPath(e), this.logger), this.requestManager = new Ht(this.logger, this.markConnectionStateDirty);
1927
+ let l = `${c}://${o}/api/${Re}/sync`;
1928
+ this.state = new Wt(), this.remoteQuerySet = new bn((e) => this.state.queryPath(e), this.logger), this.requestManager = new Jt(this.logger, this.markConnectionStateDirty);
1873
1929
  let u = () => {
1874
1930
  this.webSocketManager.pause(), this.state.pause();
1875
1931
  };
1876
- this.authenticationManager = new Vn(this.state, {
1932
+ this.authenticationManager = new qn(this.state, {
1877
1933
  authenticate: (e) => {
1878
1934
  let t = this.state.setAuth(e);
1879
1935
  return this.webSocketManager.sendMessage(t), t.baseVersion;
@@ -1888,9 +1944,9 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1888
1944
  }, {
1889
1945
  logger: this.logger,
1890
1946
  refreshTokenLeewaySeconds: r
1891
- }), this.optimisticQueryResults = new en(), this.addOnTransitionHandler((e) => {
1947
+ }), this.optimisticQueryResults = new sn(), this.addOnTransitionHandler((e) => {
1892
1948
  t(e.queries.map((e) => e.token));
1893
- }), this._nextRequestId = 0, this._sessionId = jn();
1949
+ }), this._nextRequestId = 0, this._sessionId = Ln();
1894
1950
  let { unsavedChangesWarning: d } = n;
1895
1951
  if (typeof window > "u" || window.addEventListener === void 0) {
1896
1952
  if (d === !0) throw Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.");
@@ -1901,14 +1957,14 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1901
1957
  return (e || window.event).returnValue = t, t;
1902
1958
  }
1903
1959
  });
1904
- this.webSocketManager = new An(l, {
1960
+ this.webSocketManager = new In(l, {
1905
1961
  onOpen: (e) => {
1906
1962
  this.mark("convexWebSocketOpen"), this.webSocketManager.sendMessage({
1907
1963
  ...e,
1908
1964
  type: "Connect",
1909
1965
  sessionId: this._sessionId,
1910
1966
  maxObservedTimestamp: this.maxObservedTimestamp
1911
- }), this.remoteQuerySet = new mn((e) => this.state.queryPath(e), this.logger);
1967
+ }), this.remoteQuerySet = new bn((e) => this.state.queryPath(e), this.logger);
1912
1968
  let [t, n] = this.state.restart();
1913
1969
  n && this.webSocketManager.sendMessage(n), this.webSocketManager.sendMessage(t);
1914
1970
  for (let e of this.requestManager.restart()) this.webSocketManager.sendMessage(e);
@@ -1939,7 +1995,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1939
1995
  this.authenticationManager.onAuthError(e);
1940
1996
  break;
1941
1997
  case "FatalError": {
1942
- let t = kt(this.logger, e.error);
1998
+ let t = Ft(this.logger, e.error);
1943
1999
  throw this.webSocketManager.terminate(), t;
1944
2000
  }
1945
2001
  default:
@@ -1997,7 +2053,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1997
2053
  getCurrentAuthClaims() {
1998
2054
  let e = this.state.getAuth(), t = {};
1999
2055
  if (e && e.tokenType === "User") try {
2000
- t = e ? In(e.value) : {};
2056
+ t = e ? Hn(e.value) : {};
2001
2057
  } catch {
2002
2058
  t = {};
2003
2059
  }
@@ -2022,7 +2078,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2022
2078
  this.webSocketManager.sendMessage(e);
2023
2079
  }
2024
2080
  subscribe(e, t, n) {
2025
- let r = He(t), { modification: i, queryToken: a, unsubscribe: o } = this.state.subscribe(e, r, n?.journal, n?.componentPath);
2081
+ let r = W(t), { modification: i, queryToken: a, unsubscribe: o } = this.state.subscribe(e, r, n?.journal, n?.componentPath);
2026
2082
  return i !== null && this.webSocketManager.sendMessage(i), {
2027
2083
  queryToken: a,
2028
2084
  unsubscribe: () => {
@@ -2032,7 +2088,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2032
2088
  };
2033
2089
  }
2034
2090
  localQueryResult(e, t) {
2035
- let n = Nt(e, He(t));
2091
+ let n = zt(e, W(t));
2036
2092
  return this.optimisticQueryResults.queryResult(n);
2037
2093
  }
2038
2094
  localQueryResultByToken(e) {
@@ -2042,11 +2098,11 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2042
2098
  return this.optimisticQueryResults.hasQueryResult(e);
2043
2099
  }
2044
2100
  localQueryLogs(e, t) {
2045
- let n = Nt(e, He(t));
2101
+ let n = zt(e, W(t));
2046
2102
  return this.optimisticQueryResults.queryLogs(n);
2047
2103
  }
2048
2104
  queryJournal(e, t) {
2049
- let n = Nt(e, He(t));
2105
+ let n = zt(e, W(t));
2050
2106
  return this.state.queryJournal(n);
2051
2107
  }
2052
2108
  connectionState() {
@@ -2070,7 +2126,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2070
2126
  }
2071
2127
  async mutation(e, t, n) {
2072
2128
  let r = await this.mutationInternal(e, t, n);
2073
- if (!r.success) throw r.errorData === void 0 ? Error(At("mutation", e, r)) : jt(r, new yt(At("mutation", e, r)));
2129
+ if (!r.success) throw r.errorData === void 0 ? Error(It("mutation", e, r)) : Lt(r, new Tt(It("mutation", e, r)));
2074
2130
  return r.value;
2075
2131
  }
2076
2132
  async mutationInternal(e, t, n, r) {
@@ -2078,7 +2134,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2078
2134
  return i;
2079
2135
  }
2080
2136
  enqueueMutation(e, t, n, r) {
2081
- let i = He(t);
2137
+ let i = W(t);
2082
2138
  this.tryReportLongDisconnect();
2083
2139
  let a = this.nextRequestId;
2084
2140
  if (this._nextRequestId++, n !== void 0) {
@@ -2112,7 +2168,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2112
2168
  requestId: a,
2113
2169
  udfPath: e,
2114
2170
  componentPath: r,
2115
- args: [ft(i)]
2171
+ args: [vt(i)]
2116
2172
  }, s = this.webSocketManager.sendMessage(o);
2117
2173
  return {
2118
2174
  requestId: a,
@@ -2121,18 +2177,18 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2121
2177
  }
2122
2178
  async action(e, t) {
2123
2179
  let n = await this.actionInternal(e, t);
2124
- if (!n.success) throw n.errorData === void 0 ? Error(At("action", e, n)) : jt(n, new yt(At("action", e, n)));
2180
+ if (!n.success) throw n.errorData === void 0 ? Error(It("action", e, n)) : Lt(n, new Tt(It("action", e, n)));
2125
2181
  return n.value;
2126
2182
  }
2127
2183
  async actionInternal(e, t, n) {
2128
- let r = He(t), i = this.nextRequestId;
2184
+ let r = W(t), i = this.nextRequestId;
2129
2185
  this._nextRequestId++, this.tryReportLongDisconnect();
2130
2186
  let a = {
2131
2187
  type: "Action",
2132
2188
  requestId: i,
2133
2189
  udfPath: e,
2134
2190
  componentPath: n,
2135
- args: [ft(r)]
2191
+ args: [vt(r)]
2136
2192
  }, o = this.webSocketManager.sendMessage(a);
2137
2193
  return this.requestManager.request(a, o);
2138
2194
  }
@@ -2150,7 +2206,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2150
2206
  }
2151
2207
  reportMarks() {
2152
2208
  if (this.debug) {
2153
- let e = Gn(this.sessionId);
2209
+ let e = Zn(this.sessionId);
2154
2210
  this.webSocketManager.sendMessage({
2155
2211
  type: "Event",
2156
2212
  eventType: "ClientConnect",
@@ -2167,7 +2223,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2167
2223
  method: "POST",
2168
2224
  headers: {
2169
2225
  "Content-Type": "application/json",
2170
- "Convex-Client": `npm-${je}`
2226
+ "Convex-Client": `npm-${Re}`
2171
2227
  },
2172
2228
  body: JSON.stringify({ event: "LongWebsocketDisconnect" })
2173
2229
  }).then((e) => {
@@ -2179,23 +2235,23 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2179
2235
  };
2180
2236
  //#endregion
2181
2237
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/pagination.js
2182
- function Yn(e) {
2238
+ function tr(e) {
2183
2239
  if (typeof e != "object" || !e || !Array.isArray(e.page) || typeof e.isDone != "boolean" || typeof e.continueCursor != "string") throw Error(`Not a valid paginated query result: ${e?.toString()}`);
2184
2240
  return e;
2185
2241
  }
2186
2242
  //#endregion
2187
2243
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/paginated_query_client.js
2188
- var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2244
+ var nr = Object.defineProperty, rr = (e, t, n) => t in e ? nr(e, t, {
2189
2245
  enumerable: !0,
2190
2246
  configurable: !0,
2191
2247
  writable: !0,
2192
2248
  value: n
2193
- }) : e[t] = n, Qn = (e, t, n) => Zn(e, typeof t == "symbol" ? t : t + "", n), $n = class {
2249
+ }) : e[t] = n, ir = (e, t, n) => rr(e, typeof t == "symbol" ? t : t + "", n), ar = class {
2194
2250
  constructor(e, t) {
2195
- this.client = e, this.onTransition = t, Qn(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), Qn(this, "lastTransitionTs"), this.lastTransitionTs = an.fromNumber(0), this.client.addOnTransitionHandler((e) => this.onBaseTransition(e));
2251
+ this.client = e, this.onTransition = t, ir(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), ir(this, "lastTransitionTs"), this.lastTransitionTs = dn.fromNumber(0), this.client.addOnTransitionHandler((e) => this.onBaseTransition(e));
2196
2252
  }
2197
2253
  subscribe(e, t, n) {
2198
- let r = Mt(e), i = Pt(r, t, n), a = () => this.removePaginatedQuerySubscriber(i), o = this.paginatedQuerySet.get(i);
2254
+ let r = Rt(e), i = Bt(r, t, n), a = () => this.removePaginatedQuerySubscriber(i), o = this.paginatedQuerySet.get(i);
2199
2255
  return o ? (o.numSubscribers += 1, {
2200
2256
  paginatedQueryToken: i,
2201
2257
  unsubscribe: a
@@ -2217,7 +2273,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2217
2273
  });
2218
2274
  }
2219
2275
  localQueryResult(e, t, n) {
2220
- let r = Pt(Mt(e), t, n);
2276
+ let r = Bt(Rt(e), t, n);
2221
2277
  return this.localQueryResultByToken(r);
2222
2278
  }
2223
2279
  localQueryResultByToken(e) {
@@ -2236,7 +2292,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2236
2292
  i = !0, a = !1;
2237
2293
  continue;
2238
2294
  }
2239
- let n = Yn(t);
2295
+ let n = tr(t);
2240
2296
  r = r.concat(n.page), a = !!n.isDone;
2241
2297
  }
2242
2298
  let o;
@@ -2265,7 +2321,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2265
2321
  this.mustGetPaginatedQuery(e);
2266
2322
  let n = this.queryTokenForLastPageOfPaginatedQuery(e), r = this.client.localQueryResultByToken(n);
2267
2323
  if (!r) return !1;
2268
- let i = Yn(r);
2324
+ let i = tr(r);
2269
2325
  if (i.isDone) return !1;
2270
2326
  this.addPageToPaginatedQuery(e, i.continueCursor, t);
2271
2327
  let a = {
@@ -2299,7 +2355,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2299
2355
  if (r.has(n)) continue;
2300
2356
  let a = i.get(n).queryToken, o = t(a);
2301
2357
  if (!o) continue;
2302
- let s = Yn(o);
2358
+ let s = tr(o);
2303
2359
  s.splitCursor && (s.pageStatus === "SplitRecommended" || s.pageStatus === "SplitRequired" || s.page.length > e.options.initialNumItems * 2) && this.splitPaginatedQueryPage(e, n, s.splitCursor, s.continueCursor);
2304
2360
  }
2305
2361
  }
@@ -2368,16 +2424,16 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2368
2424
  if (!t) throw Error("paginated query no longer exists for token " + e);
2369
2425
  return t;
2370
2426
  }
2371
- }, er = Object.defineProperty, tr = (e, t, n) => t in e ? er(e, t, {
2427
+ }, or = Object.defineProperty, sr = (e, t, n) => t in e ? or(e, t, {
2372
2428
  enumerable: !0,
2373
2429
  configurable: !0,
2374
2430
  writable: !0,
2375
2431
  value: n
2376
- }) : e[t] = n, nr = (e, t, n) => tr(e, typeof t == "symbol" ? t : t + "", n), rr, ir = class {
2432
+ }) : e[t] = n, cr = (e, t, n) => sr(e, typeof t == "symbol" ? t : t + "", n), lr, ur = class {
2377
2433
  constructor(e, t = {}) {
2378
- nr(this, "listeners"), nr(this, "_client"), nr(this, "_paginatedClient"), nr(this, "callNewListenersWithCurrentValuesTimer"), nr(this, "_closed"), nr(this, "_disabled"), t.skipConvexDeploymentUrlCheck !== !0 && Ue(e);
2434
+ cr(this, "listeners"), cr(this, "_client"), cr(this, "_paginatedClient"), cr(this, "callNewListenersWithCurrentValuesTimer"), cr(this, "_closed"), cr(this, "_disabled"), t.skipConvexDeploymentUrlCheck !== !0 && Ye(e);
2379
2435
  let { disabled: n, ...r } = t;
2380
- this._closed = !1, this._disabled = !!n, rr && !("webSocketConstructor" in r) && typeof WebSocket > "u" && (r.webSocketConstructor = rr), typeof window > "u" && !("unsavedChangesWarning" in r) && (r.unsavedChangesWarning = !1), this.disabled || (this._client = new Jn(e, () => {}, r), this._paginatedClient = new $n(this._client, (e) => this._transition(e))), this.listeners = /* @__PURE__ */ new Set();
2436
+ this._closed = !1, this._disabled = !!n, lr && !("webSocketConstructor" in r) && typeof WebSocket > "u" && (r.webSocketConstructor = lr), typeof window > "u" && !("unsavedChangesWarning" in r) && (r.unsavedChangesWarning = !1), this.disabled || (this._client = new er(e, () => {}, r), this._paginatedClient = new ar(this._client, (e) => this._transition(e))), this.listeners = /* @__PURE__ */ new Set();
2381
2437
  }
2382
2438
  get closed() {
2383
2439
  return this._closed;
@@ -2395,7 +2451,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2395
2451
  }
2396
2452
  onUpdate(e, t, n, r) {
2397
2453
  if (this.disabled) return this.createDisabledUnsubscribe();
2398
- let { queryToken: i, unsubscribe: a } = this.client.subscribe(G(e), t), o = {
2454
+ let { queryToken: i, unsubscribe: a } = this.client.subscribe(K(e), t), o = {
2399
2455
  queryToken: i,
2400
2456
  callback: n,
2401
2457
  onError: r,
@@ -2420,7 +2476,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2420
2476
  let a = {
2421
2477
  initialNumItems: n.initialNumItems,
2422
2478
  id: -1
2423
- }, { paginatedQueryToken: o, unsubscribe: s } = this.paginatedClient.subscribe(G(e), t, a), c = {
2479
+ }, { paginatedQueryToken: o, unsubscribe: s } = this.paginatedClient.subscribe(K(e), t, a), c = {
2424
2480
  queryToken: o,
2425
2481
  callback: r,
2426
2482
  onError: i,
@@ -2435,7 +2491,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2435
2491
  unsubscribe: () => {
2436
2492
  this.closed || (this.listeners.delete(c), s());
2437
2493
  },
2438
- getCurrentValue: () => this.paginatedClient.localQueryResult(G(e), t, a),
2494
+ getCurrentValue: () => this.paginatedClient.localQueryResult(K(e), t, a),
2439
2495
  getQueryLogs: () => []
2440
2496
  }, u = l.unsubscribe;
2441
2497
  return Object.assign(u, l), u;
@@ -2473,7 +2529,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2473
2529
  _transition({ queries: e, paginatedQueries: t }, n = !1) {
2474
2530
  let r = [...e.map((e) => e.token), ...t.map((e) => e.token)];
2475
2531
  for (let e of this.listeners) {
2476
- let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s = Ft(i), c = s ? !!this.paginatedClient.localQueryResultByToken(i) : this.client.hasLocalQueryResultByToken(i);
2532
+ let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s = Vt(i), c = s ? !!this.paginatedClient.localQueryResultByToken(i) : this.client.hasLocalQueryResultByToken(i);
2477
2533
  if (r.includes(i) || n && !o && c) {
2478
2534
  e.hasEverRun = !0;
2479
2535
  let n;
@@ -2490,15 +2546,15 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2490
2546
  }
2491
2547
  async mutation(e, t, n) {
2492
2548
  if (this.disabled) throw Error("ConvexClient is disabled");
2493
- return await this.client.mutation(G(e), t, n);
2549
+ return await this.client.mutation(K(e), t, n);
2494
2550
  }
2495
2551
  async action(e, t) {
2496
2552
  if (this.disabled) throw Error("ConvexClient is disabled");
2497
- return await this.client.action(G(e), t);
2553
+ return await this.client.action(K(e), t);
2498
2554
  }
2499
2555
  async query(e, t) {
2500
2556
  if (this.disabled) throw Error("ConvexClient is disabled");
2501
- let n = this.client.localQueryResult(G(e), t);
2557
+ let n = this.client.localQueryResult(K(e), t);
2502
2558
  return n === void 0 ? new Promise((n, r) => {
2503
2559
  let { unsubscribe: i } = this.onUpdate(e, t, (e) => {
2504
2560
  i(), n(e);
@@ -2517,10 +2573,10 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2517
2573
  };
2518
2574
  //#endregion
2519
2575
  //#region src/lib/machine.ts
2520
- function ar(e) {
2576
+ function dr(e) {
2521
2577
  return e;
2522
2578
  }
2523
- function or(e, t) {
2579
+ function fr(e, t) {
2524
2580
  let n = B(e);
2525
2581
  n.current = e;
2526
2582
  let [r, i] = R(() => typeof t == "function" ? t() : t);
@@ -2533,7 +2589,7 @@ function or(e, t) {
2533
2589
  }
2534
2590
  //#endregion
2535
2591
  //#region src/lib/use-async-action.ts
2536
- var sr = ar({
2592
+ var pr = dr({
2537
2593
  idle: { start: () => ({ kind: "pending" }) },
2538
2594
  pending: {
2539
2595
  success: (e, t) => ({
@@ -2554,8 +2610,8 @@ var sr = ar({
2554
2610
  reset: () => ({ kind: "idle" })
2555
2611
  }
2556
2612
  });
2557
- function cr() {
2558
- let [e, t] = or(sr, { kind: "idle" }), n = e, r = B(n);
2613
+ function mr() {
2614
+ let [e, t] = fr(pr, { kind: "idle" }), n = e, r = B(n);
2559
2615
  r.current = n;
2560
2616
  let i = V(async (e, n) => {
2561
2617
  if (r.current.kind !== "pending") {
@@ -2590,37 +2646,37 @@ function cr() {
2590
2646
  }
2591
2647
  //#endregion
2592
2648
  //#region ../../node_modules/.pnpm/@medv+finder@4.0.2/node_modules/@medv/finder/finder.js
2593
- var lr = new Set([
2649
+ var hr = new Set([
2594
2650
  "role",
2595
2651
  "name",
2596
2652
  "aria-label",
2597
2653
  "rel",
2598
2654
  "href"
2599
2655
  ]);
2600
- function ur(e, t) {
2601
- let n = lr.has(e);
2602
- n ||= e.startsWith("data-") && gr(e);
2603
- let r = gr(t) && t.length < 100;
2604
- return r ||= t.startsWith("#") && gr(t.slice(1)), n && r;
2656
+ function gr(e, t) {
2657
+ let n = hr.has(e);
2658
+ n ||= e.startsWith("data-") && Sr(e);
2659
+ let r = Sr(t) && t.length < 100;
2660
+ return r ||= t.startsWith("#") && Sr(t.slice(1)), n && r;
2605
2661
  }
2606
- function dr(e) {
2607
- return gr(e);
2662
+ function _r(e) {
2663
+ return Sr(e);
2608
2664
  }
2609
- function fr(e) {
2610
- return gr(e);
2665
+ function vr(e) {
2666
+ return Sr(e);
2611
2667
  }
2612
- function pr(e) {
2668
+ function yr(e) {
2613
2669
  return !0;
2614
2670
  }
2615
- function mr(e, t) {
2671
+ function br(e, t) {
2616
2672
  if (e.nodeType !== Node.ELEMENT_NODE) throw Error("Can't generate CSS selector for non-element node type.");
2617
2673
  if (e.tagName.toLowerCase() === "html") return "html";
2618
2674
  let n = {
2619
2675
  root: document.body,
2620
- idName: dr,
2621
- className: fr,
2622
- tagName: pr,
2623
- attr: ur,
2676
+ idName: _r,
2677
+ className: vr,
2678
+ tagName: yr,
2679
+ attr: gr,
2624
2680
  timeoutMs: 1e3,
2625
2681
  seedMinLength: 3,
2626
2682
  optimizedMinLength: 2,
@@ -2628,37 +2684,37 @@ function mr(e, t) {
2628
2684
  }, r = /* @__PURE__ */ new Date(), i = {
2629
2685
  ...n,
2630
2686
  ...t
2631
- }, a = Er(i.root, n), o, s = 0;
2632
- for (let t of hr(e, i, a)) {
2687
+ }, a = Mr(i.root, n), o, s = 0;
2688
+ for (let t of xr(e, i, a)) {
2633
2689
  if ((/* @__PURE__ */ new Date()).getTime() - r.getTime() > i.timeoutMs || s >= i.maxNumberOfPathChecks) {
2634
- let t = Sr(e, a);
2690
+ let t = Or(e, a);
2635
2691
  if (!t) throw Error(`Timeout: Can't find a unique selector after ${i.timeoutMs}ms`);
2636
- return vr(t);
2692
+ return wr(t);
2637
2693
  }
2638
- if (s++, Dr(t, a)) {
2694
+ if (s++, Nr(t, a)) {
2639
2695
  o = t;
2640
2696
  break;
2641
2697
  }
2642
2698
  }
2643
2699
  if (!o) throw Error("Selector was not found.");
2644
- let c = [...Or(o, e, i, a, r)];
2645
- return c.sort(br), c.length > 0 ? vr(c[0]) : vr(o);
2700
+ let c = [...Pr(o, e, i, a, r)];
2701
+ return c.sort(Er), c.length > 0 ? wr(c[0]) : wr(o);
2646
2702
  }
2647
- function* hr(e, t, n) {
2703
+ function* xr(e, t, n) {
2648
2704
  let r = [], i = [], a = e, o = 0;
2649
2705
  for (; a && a !== n;) {
2650
- let e = _r(a, t);
2706
+ let e = Cr(a, t);
2651
2707
  for (let t of e) t.level = o;
2652
- if (r.push(e), a = a.parentElement, o++, i.push(...Tr(r)), o >= t.seedMinLength) {
2653
- i.sort(br);
2708
+ if (r.push(e), a = a.parentElement, o++, i.push(...jr(r)), o >= t.seedMinLength) {
2709
+ i.sort(Er);
2654
2710
  for (let e of i) yield e;
2655
2711
  i = [];
2656
2712
  }
2657
2713
  }
2658
- i.sort(br);
2714
+ i.sort(Er);
2659
2715
  for (let e of i) yield e;
2660
2716
  }
2661
- function gr(e) {
2717
+ function Sr(e) {
2662
2718
  if (/^[a-z\-]{3,}$/i.test(e)) {
2663
2719
  let t = e.split(/-|[A-Z]/);
2664
2720
  for (let e of t) if (e.length <= 2 || /[^aeiou]{4,}/i.test(e)) return !1;
@@ -2666,7 +2722,7 @@ function gr(e) {
2666
2722
  }
2667
2723
  return !1;
2668
2724
  }
2669
- function _r(e, t) {
2725
+ function Cr(e, t) {
2670
2726
  let n = [], r = e.getAttribute("id");
2671
2727
  r && t.idName(r) && n.push({
2672
2728
  name: "#" + CSS.escape(r),
@@ -2692,19 +2748,19 @@ function _r(e, t) {
2692
2748
  name: i,
2693
2749
  penalty: 5
2694
2750
  });
2695
- let t = xr(e, i);
2751
+ let t = Dr(e, i);
2696
2752
  t !== void 0 && n.push({
2697
- name: wr(i, t),
2753
+ name: Ar(i, t),
2698
2754
  penalty: 10
2699
2755
  });
2700
2756
  }
2701
- let a = xr(e);
2757
+ let a = Dr(e);
2702
2758
  return a !== void 0 && n.push({
2703
- name: Cr(i, a),
2759
+ name: kr(i, a),
2704
2760
  penalty: 50
2705
2761
  }), n;
2706
2762
  }
2707
- function vr(e) {
2763
+ function wr(e) {
2708
2764
  let t = e[0], n = t.name;
2709
2765
  for (let r = 1; r < e.length; r++) {
2710
2766
  let i = e[r].level || 0;
@@ -2712,13 +2768,13 @@ function vr(e) {
2712
2768
  }
2713
2769
  return n;
2714
2770
  }
2715
- function yr(e) {
2771
+ function Tr(e) {
2716
2772
  return e.map((e) => e.penalty).reduce((e, t) => e + t, 0);
2717
2773
  }
2718
- function br(e, t) {
2719
- return yr(e) - yr(t);
2774
+ function Er(e, t) {
2775
+ return Tr(e) - Tr(t);
2720
2776
  }
2721
- function xr(e, t) {
2777
+ function Dr(e, t) {
2722
2778
  let n = e.parentNode;
2723
2779
  if (!n) return;
2724
2780
  let r = n.firstChild;
@@ -2727,51 +2783,51 @@ function xr(e, t) {
2727
2783
  for (; r && (r.nodeType === Node.ELEMENT_NODE && (t === void 0 || r.tagName.toLowerCase() === t) && i++, r !== e);) r = r.nextSibling;
2728
2784
  return i;
2729
2785
  }
2730
- function Sr(e, t) {
2786
+ function Or(e, t) {
2731
2787
  let n = 0, r = e, i = [];
2732
2788
  for (; r && r !== t;) {
2733
- let e = r.tagName.toLowerCase(), t = xr(r, e);
2789
+ let e = r.tagName.toLowerCase(), t = Dr(r, e);
2734
2790
  if (t === void 0) return;
2735
2791
  i.push({
2736
- name: wr(e, t),
2792
+ name: Ar(e, t),
2737
2793
  penalty: NaN,
2738
2794
  level: n
2739
2795
  }), r = r.parentElement, n++;
2740
2796
  }
2741
- if (Dr(i, t)) return i;
2797
+ if (Nr(i, t)) return i;
2742
2798
  }
2743
- function Cr(e, t) {
2799
+ function kr(e, t) {
2744
2800
  return e === "html" ? "html" : `${e}:nth-child(${t})`;
2745
2801
  }
2746
- function wr(e, t) {
2802
+ function Ar(e, t) {
2747
2803
  return e === "html" ? "html" : `${e}:nth-of-type(${t})`;
2748
2804
  }
2749
- function* Tr(e, t = []) {
2750
- if (e.length > 0) for (let n of e[0]) yield* Tr(e.slice(1, e.length), t.concat(n));
2805
+ function* jr(e, t = []) {
2806
+ if (e.length > 0) for (let n of e[0]) yield* jr(e.slice(1, e.length), t.concat(n));
2751
2807
  else yield t;
2752
2808
  }
2753
- function Er(e, t) {
2809
+ function Mr(e, t) {
2754
2810
  return e.nodeType === Node.DOCUMENT_NODE ? e : e === t.root ? e.ownerDocument : e;
2755
2811
  }
2756
- function Dr(e, t) {
2757
- let n = vr(e);
2812
+ function Nr(e, t) {
2813
+ let n = wr(e);
2758
2814
  switch (t.querySelectorAll(n).length) {
2759
2815
  case 0: throw Error(`Can't select any node with this selector: ${n}`);
2760
2816
  case 1: return !0;
2761
2817
  default: return !1;
2762
2818
  }
2763
2819
  }
2764
- function* Or(e, t, n, r, i) {
2820
+ function* Pr(e, t, n, r, i) {
2765
2821
  if (e.length > 2 && e.length > n.optimizedMinLength) for (let a = 1; a < e.length - 1; a++) {
2766
2822
  if ((/* @__PURE__ */ new Date()).getTime() - i.getTime() > n.timeoutMs) return;
2767
2823
  let o = [...e];
2768
- o.splice(a, 1), Dr(o, r) && r.querySelector(vr(o)) === t && (yield o, yield* Or(o, t, n, r, i));
2824
+ o.splice(a, 1), Nr(o, r) && r.querySelector(wr(o)) === t && (yield o, yield* Pr(o, t, n, r, i));
2769
2825
  }
2770
2826
  }
2771
2827
  //#endregion
2772
2828
  //#region src/runtime/anchor.ts
2773
- function kr(e, t) {
2774
- let n = document.documentElement, r = Math.max(n.scrollWidth, n.clientWidth), i = Math.max(n.scrollHeight, n.clientHeight), a = e.clientX + window.scrollX, o = e.clientY + window.scrollY, s = t === void 0 ? e.target instanceof Element ? e.target : null : t, c = s ? jr(s) : void 0, l, u;
2829
+ function Fr(e, t) {
2830
+ let n = document.documentElement, r = Math.max(n.scrollWidth, n.clientWidth), i = Math.max(n.scrollHeight, n.clientHeight), a = e.clientX + window.scrollX, o = e.clientY + window.scrollY, s = t === void 0 ? e.target instanceof Element ? e.target : null : t, c = s ? Lr(s) : void 0, l, u;
2775
2831
  if (s) {
2776
2832
  let t = s.getBoundingClientRect();
2777
2833
  t.width > 0 && t.height > 0 && (l = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)), u = Math.max(0, Math.min(1, (e.clientY - t.top) / t.height)));
@@ -2786,7 +2842,7 @@ function kr(e, t) {
2786
2842
  anchorOffsetY: u
2787
2843
  };
2788
2844
  }
2789
- function Ar(e) {
2845
+ function Ir(e) {
2790
2846
  if (e.anchorSelector) try {
2791
2847
  let t = document.querySelector(e.anchorSelector);
2792
2848
  if (t) {
@@ -2805,22 +2861,22 @@ function Ar(e) {
2805
2861
  resolved: !1
2806
2862
  };
2807
2863
  }
2808
- function jr(e) {
2864
+ function Lr(e) {
2809
2865
  try {
2810
- return mr(e, { timeoutMs: 1e3 });
2866
+ return br(e, { timeoutMs: 1e3 });
2811
2867
  } catch {
2812
2868
  return;
2813
2869
  }
2814
2870
  }
2815
2871
  //#endregion
2816
2872
  //#region src/runtime/api.ts
2817
- var Mr = class extends Error {
2873
+ var Rr = class extends Error {
2818
2874
  status;
2819
2875
  constructor(e, t) {
2820
2876
  super(e), this.name = "WidgetApiError", this.status = t;
2821
2877
  }
2822
2878
  };
2823
- function Nr(e) {
2879
+ function zr(e) {
2824
2880
  let t = e.apiUrl.replace(/\/+$/, "");
2825
2881
  async function n(n, r = {}) {
2826
2882
  let i = {
@@ -2831,12 +2887,14 @@ function Nr(e) {
2831
2887
  o && a && (i.authorization = `Bearer ${a.token}`);
2832
2888
  let s = e.getAnonToken?.() ?? null;
2833
2889
  s && (i["x-markup-anon-token"] = s);
2834
- let c = await fetch(`${t}${n}`, {
2890
+ let c = e.getStorageMode?.() === "cookies", l = {
2835
2891
  ...r,
2836
2892
  headers: i
2837
- }), l = await c.text(), u = l ? Pr(l) : null;
2838
- if (!c.ok) throw c.status === 401 && o && e.onUnauthorized?.(), new Mr((u && typeof u == "object" && "error" in u && typeof u.error == "string" ? u.error : null) ?? `Request failed with ${c.status}`, c.status);
2839
- return u;
2893
+ };
2894
+ c && (l.credentials = "include");
2895
+ let u = await fetch(`${t}${n}`, l), d = await u.text(), f = d ? Br(d) : null;
2896
+ if (!u.ok) throw u.status === 401 && (o || c) && e.onUnauthorized?.(), new Rr((f && typeof f == "object" && "error" in f && typeof f.error == "string" ? f.error : null) ?? `Request failed with ${u.status}`, u.status);
2897
+ return f;
2840
2898
  }
2841
2899
  return {
2842
2900
  mintAnonIdentity() {
@@ -2889,7 +2947,7 @@ function Nr(e) {
2889
2947
  }
2890
2948
  };
2891
2949
  }
2892
- function Pr(e) {
2950
+ function Br(e) {
2893
2951
  try {
2894
2952
  return JSON.parse(e);
2895
2953
  } catch {
@@ -2897,49 +2955,80 @@ function Pr(e) {
2897
2955
  }
2898
2956
  }
2899
2957
  //#endregion
2958
+ //#region src/runtime/cookie-probe.ts
2959
+ var Vr = "markup.cookieProbe";
2960
+ async function Hr(e, t) {
2961
+ try {
2962
+ let e = sessionStorage.getItem(Vr);
2963
+ if (e === "supported") return !0;
2964
+ if (e === "unsupported") return !1;
2965
+ } catch {}
2966
+ let n = e.replace(/\/+$/, ""), r = { "x-markup-api-key": t };
2967
+ try {
2968
+ if (!(await fetch(`${n}/widget/auth/probe-set`, {
2969
+ method: "POST",
2970
+ credentials: "include",
2971
+ headers: r
2972
+ })).ok) return !1;
2973
+ let e = await fetch(`${n}/widget/auth/probe-check`, {
2974
+ method: "POST",
2975
+ credentials: "include",
2976
+ headers: r
2977
+ });
2978
+ if (!e.ok) return !1;
2979
+ let { supported: t } = await e.json(), i = t === !0;
2980
+ try {
2981
+ sessionStorage.setItem(Vr, i ? "supported" : "unsupported");
2982
+ } catch {}
2983
+ return i;
2984
+ } catch {
2985
+ return !1;
2986
+ }
2987
+ }
2988
+ //#endregion
2900
2989
  //#region src/runtime/history-observer.ts
2901
- var Fr = "__markup_history_observer__", Ir = "__markup_history_listeners__";
2902
- function Lr(e) {
2990
+ var Ur = "__markup_history_observer__", Wr = "__markup_history_listeners__";
2991
+ function Gr(e) {
2903
2992
  e.forEach((e) => e());
2904
2993
  }
2905
- function Rr() {
2994
+ function Kr() {
2906
2995
  let e = history.pushState;
2907
- if (e[Fr]) return e[Ir];
2996
+ if (e[Ur]) return e[Wr];
2908
2997
  let t = /* @__PURE__ */ new Set(), n = history.pushState, r = history.replaceState;
2909
2998
  function i(...e) {
2910
- n.apply(this, e), Lr(t);
2999
+ n.apply(this, e), Gr(t);
2911
3000
  }
2912
3001
  function a(...e) {
2913
- r.apply(this, e), Lr(t);
3002
+ r.apply(this, e), Gr(t);
2914
3003
  }
2915
- return Object.defineProperty(i, Fr, { value: 1 }), Object.defineProperty(i, Ir, { value: t }), Object.defineProperty(a, Fr, { value: 1 }), history.pushState = i, history.replaceState = a, window.addEventListener("popstate", () => Lr(t)), t;
3004
+ return Object.defineProperty(i, Ur, { value: 1 }), Object.defineProperty(i, Wr, { value: t }), Object.defineProperty(a, Ur, { value: 1 }), history.pushState = i, history.replaceState = a, window.addEventListener("popstate", () => Gr(t)), t;
2916
3005
  }
2917
- var zr = null;
2918
- function Br(e) {
2919
- return zr ||= Rr(), zr.add(e), () => zr.delete(e);
3006
+ var qr = null;
3007
+ function Jr(e) {
3008
+ return qr ||= Kr(), qr.add(e), () => qr.delete(e);
2920
3009
  }
2921
3010
  //#endregion
2922
3011
  //#region src/runtime/identity-store.ts
2923
- var Vr = "markup.identity";
2924
- function Hr() {
3012
+ var Yr = "markup.identity";
3013
+ function Xr() {
2925
3014
  try {
2926
- let e = localStorage.getItem(Vr);
3015
+ let e = localStorage.getItem(Yr);
2927
3016
  return e ? JSON.parse(e) : null;
2928
3017
  } catch {
2929
3018
  return null;
2930
3019
  }
2931
3020
  }
2932
- function Ur(e) {
3021
+ function Zr(e) {
2933
3022
  try {
2934
3023
  if (e == null) {
2935
- localStorage.removeItem(Vr);
3024
+ localStorage.removeItem(Yr);
2936
3025
  return;
2937
3026
  }
2938
- localStorage.setItem(Vr, JSON.stringify(e));
3027
+ localStorage.setItem(Yr, JSON.stringify(e));
2939
3028
  } catch {}
2940
3029
  }
2941
- function Wr() {
2942
- let e = Hr(), t = {
3030
+ function Qr() {
3031
+ let e = Xr(), t = {
2943
3032
  name: e?.name,
2944
3033
  email: e?.email
2945
3034
  };
@@ -2947,12 +3036,28 @@ function Wr() {
2947
3036
  state: { kind: "unresolved" },
2948
3037
  preserved: t
2949
3038
  };
2950
- if (e.isVerified && typeof e.clientId == "string" && typeof e.token == "string" && typeof e.tokenExpiresAt == "number" && typeof e.name == "string") {
3039
+ let n = e.storage ?? "localStorage";
3040
+ if (n === "cookies" && e.isVerified && typeof e.clientId == "string" && typeof e.tokenExpiresAt == "number" && typeof e.refreshTokenExpiresAt == "number" && typeof e.name == "string" && e.refreshTokenExpiresAt > Date.now()) return {
3041
+ state: {
3042
+ kind: "verified",
3043
+ identity: {
3044
+ storage: "cookies",
3045
+ clientId: e.clientId,
3046
+ tokenExpiresAt: e.tokenExpiresAt,
3047
+ refreshTokenExpiresAt: e.refreshTokenExpiresAt,
3048
+ name: e.name,
3049
+ email: e.email
3050
+ }
3051
+ },
3052
+ preserved: t
3053
+ };
3054
+ if (n === "localStorage" && e.isVerified && typeof e.clientId == "string" && typeof e.token == "string" && typeof e.tokenExpiresAt == "number" && typeof e.name == "string") {
2951
3055
  let n = e.tokenExpiresAt > Date.now(), r = typeof e.refreshToken == "string" && typeof e.refreshTokenExpiresAt == "number" && e.refreshTokenExpiresAt > Date.now();
2952
3056
  if (n || r) return {
2953
3057
  state: {
2954
3058
  kind: "verified",
2955
3059
  identity: {
3060
+ storage: "localStorage",
2956
3061
  clientId: e.clientId,
2957
3062
  token: e.token,
2958
3063
  tokenExpiresAt: e.tokenExpiresAt,
@@ -2983,14 +3088,15 @@ function Wr() {
2983
3088
  preserved: t
2984
3089
  };
2985
3090
  }
2986
- function Gr(e) {
3091
+ function $r(e) {
2987
3092
  switch (e.kind) {
2988
3093
  case "verified":
2989
- Ur({
3094
+ Zr({
2990
3095
  clientId: e.identity.clientId,
2991
- token: e.identity.token,
3096
+ storage: e.identity.storage,
3097
+ token: e.identity.storage === "cookies" ? void 0 : e.identity.token,
2992
3098
  tokenExpiresAt: e.identity.tokenExpiresAt,
2993
- refreshToken: e.identity.refreshToken,
3099
+ refreshToken: e.identity.storage === "cookies" ? void 0 : e.identity.refreshToken,
2994
3100
  refreshTokenExpiresAt: e.identity.refreshTokenExpiresAt,
2995
3101
  isVerified: !0,
2996
3102
  name: e.identity.name,
@@ -2998,7 +3104,7 @@ function Gr(e) {
2998
3104
  });
2999
3105
  return;
3000
3106
  case "anon":
3001
- Ur({
3107
+ Zr({
3002
3108
  clientId: e.identity.clientId,
3003
3109
  anonToken: e.identity.anonToken,
3004
3110
  name: e.identity.name,
@@ -3006,23 +3112,23 @@ function Gr(e) {
3006
3112
  });
3007
3113
  return;
3008
3114
  case "recovering":
3009
- Ur({
3115
+ Zr({
3010
3116
  name: e.preserved.name,
3011
3117
  email: e.preserved.email
3012
3118
  });
3013
3119
  return;
3014
3120
  case "unresolved":
3015
- Ur(null);
3121
+ Zr(null);
3016
3122
  return;
3017
3123
  }
3018
3124
  }
3019
- function Kr(e) {
3125
+ function ei(e) {
3020
3126
  if (e.kind === "anon" || e.kind === "verified") return e.identity.clientId;
3021
3127
  }
3022
- function qr(e) {
3128
+ function ti(e) {
3023
3129
  return e.kind === "anon" ? e.identity.name ?? null : e.kind === "verified" ? e.identity.name : null;
3024
3130
  }
3025
- function Jr(e) {
3131
+ function ni(e) {
3026
3132
  if (e.kind === "anon") {
3027
3133
  let t = e.identity.name;
3028
3134
  return t ? {
@@ -3037,32 +3143,36 @@ function Jr(e) {
3037
3143
  }
3038
3144
  //#endregion
3039
3145
  //#region src/runtime/popup-auth.ts
3040
- async function Yr(e, t) {
3041
- let n = new URL(e).origin, r;
3146
+ async function ri(e) {
3147
+ let { apiUrl: t, apiKey: n, useCookies: r } = e, i = new URL(t).origin, a;
3042
3148
  try {
3043
- let n = await fetch(`${e.replace(/\/+$/, "")}/widget/popup-exchange`, {
3149
+ let e = await fetch(`${t.replace(/\/+$/, "")}/widget/popup-exchange`, {
3044
3150
  method: "POST",
3045
3151
  headers: {
3046
3152
  "content-type": "application/json",
3047
- "x-markup-api-key": t
3153
+ "x-markup-api-key": n
3048
3154
  },
3049
3155
  body: "{}"
3050
3156
  });
3051
- if (!n.ok) throw Error(`popup-exchange responded with ${n.status}`);
3052
- let { code: i } = await n.json(), a = new URL("/widget/auth", e);
3053
- a.searchParams.set("code", i), a.searchParams.set("capabilities", "refresh"), r = a.toString();
3157
+ if (!e.ok) throw Error(`popup-exchange responded with ${e.status}`);
3158
+ let { code: i } = await e.json(), o = new URL("/widget/auth", t);
3159
+ o.searchParams.set("code", i);
3160
+ let s = r ? "refresh,cookies" : "refresh";
3161
+ o.searchParams.set("capabilities", s), a = o.toString();
3054
3162
  } catch (e) {
3055
3163
  return Promise.reject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to start popup exchange"));
3056
3164
  }
3057
- let i = Math.max(0, window.screenX + (window.outerWidth - 420) / 2), a = Math.max(0, window.screenY + (window.outerHeight - 560) / 2), o = window.open(r, "markup-auth", `width=420,height=560,left=${i},top=${a}`);
3058
- return o ? new Promise((e, t) => {
3059
- function r() {
3060
- window.removeEventListener("message", i), clearInterval(a), clearTimeout(s);
3165
+ let o = Math.max(0, window.screenX + (window.outerWidth - 420) / 2), s = Math.max(0, window.screenY + (window.outerHeight - 560) / 2), c = window.open(a, "markup-auth", `width=420,height=560,left=${o},top=${s}`);
3166
+ if (!c) return Promise.reject(/* @__PURE__ */ Error("Popup blocked allow popups for this site to sign in"));
3167
+ let l = await new Promise((e, t) => {
3168
+ function n() {
3169
+ window.removeEventListener("message", r), clearInterval(a), clearTimeout(o);
3061
3170
  }
3062
- function i(i) {
3063
- if (i.origin !== n || i.source !== o) return;
3064
- let a = i.data;
3065
- a?.type === "MARKUP_AUTH_RESULT" && (r(), a.identity?.id && a.identity?.name ? e({
3171
+ function r(r) {
3172
+ if (r.origin !== i || r.source !== c) return;
3173
+ let a = r.data;
3174
+ a?.type === "MARKUP_AUTH_RESULT" && (n(), a.identity?.id && a.identity?.name ? e({
3175
+ mode: a.mode === "cookies" ? "cookies" : "localStorage",
3066
3176
  identity: a.identity,
3067
3177
  token: typeof a.token == "string" ? a.token : null,
3068
3178
  tokenExpiresAt: typeof a.tokenExpiresAt == "number" ? a.tokenExpiresAt : null,
@@ -3071,54 +3181,75 @@ async function Yr(e, t) {
3071
3181
  }) : t(/* @__PURE__ */ Error("Sign-in cancelled")));
3072
3182
  }
3073
3183
  let a = window.setInterval(() => {
3074
- o.closed && (r(), t(/* @__PURE__ */ Error("Sign-in cancelled")));
3075
- }, 500), s = window.setTimeout(() => {
3076
- r(), t(/* @__PURE__ */ Error("Sign-in timed out"));
3184
+ c.closed && (n(), t(/* @__PURE__ */ Error("Sign-in cancelled")));
3185
+ }, 500), o = window.setTimeout(() => {
3186
+ n(), t(/* @__PURE__ */ Error("Sign-in timed out"));
3077
3187
  }, 3e5);
3078
- window.addEventListener("message", i);
3079
- }) : Promise.reject(/* @__PURE__ */ Error("Popup blocked — allow popups for this site to sign in"));
3188
+ window.addEventListener("message", r);
3189
+ });
3190
+ if (l.mode === "cookies" && l.token && l.refreshToken) {
3191
+ let e = await fetch(`${t.replace(/\/+$/, "")}/widget/auth/install-cookies`, {
3192
+ method: "POST",
3193
+ credentials: "include",
3194
+ headers: {
3195
+ "content-type": "application/json",
3196
+ "x-markup-api-key": n
3197
+ },
3198
+ body: JSON.stringify({
3199
+ accessToken: l.token,
3200
+ refreshToken: l.refreshToken
3201
+ })
3202
+ });
3203
+ if (!e.ok) throw Error(`Failed to install widget cookies (${e.status})`);
3204
+ return {
3205
+ ...l,
3206
+ token: null,
3207
+ refreshToken: null
3208
+ };
3209
+ }
3210
+ return l;
3080
3211
  }
3081
3212
  //#endregion
3082
3213
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js
3083
- function Xr(e, t) {
3214
+ function ii(e, t) {
3084
3215
  if (e.match(/^[a-z]+:\/\//i)) return e;
3085
3216
  if (e.match(/^\/\//)) return window.location.protocol + e;
3086
3217
  if (e.match(/^[a-z]+:/i)) return e;
3087
3218
  let n = document.implementation.createHTMLDocument(), r = n.createElement("base"), i = n.createElement("a");
3088
3219
  return n.head.appendChild(r), n.body.appendChild(i), t && (r.href = t), i.href = e, i.href;
3089
3220
  }
3090
- var Zr = (() => {
3221
+ var ai = (() => {
3091
3222
  let e = 0, t = () => `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4);
3092
3223
  return () => (e += 1, `u${t()}${e}`);
3093
3224
  })();
3094
- function Qr(e) {
3225
+ function oi(e) {
3095
3226
  let t = [];
3096
3227
  for (let n = 0, r = e.length; n < r; n++) t.push(e[n]);
3097
3228
  return t;
3098
3229
  }
3099
- var $r = null;
3100
- function ei(e = {}) {
3101
- return $r || (e.includeStyleProperties ? ($r = e.includeStyleProperties, $r) : ($r = Qr(window.getComputedStyle(document.documentElement)), $r));
3230
+ var si = null;
3231
+ function ci(e = {}) {
3232
+ return si || (e.includeStyleProperties ? (si = e.includeStyleProperties, si) : (si = oi(window.getComputedStyle(document.documentElement)), si));
3102
3233
  }
3103
- function ti(e, t) {
3234
+ function li(e, t) {
3104
3235
  let n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
3105
3236
  return n ? parseFloat(n.replace("px", "")) : 0;
3106
3237
  }
3107
- function ni(e) {
3108
- let t = ti(e, "border-left-width"), n = ti(e, "border-right-width");
3238
+ function ui(e) {
3239
+ let t = li(e, "border-left-width"), n = li(e, "border-right-width");
3109
3240
  return e.clientWidth + t + n;
3110
3241
  }
3111
- function ri(e) {
3112
- let t = ti(e, "border-top-width"), n = ti(e, "border-bottom-width");
3242
+ function di(e) {
3243
+ let t = li(e, "border-top-width"), n = li(e, "border-bottom-width");
3113
3244
  return e.clientHeight + t + n;
3114
3245
  }
3115
- function ii(e, t = {}) {
3246
+ function fi(e, t = {}) {
3116
3247
  return {
3117
- width: t.width || ni(e),
3118
- height: t.height || ri(e)
3248
+ width: t.width || ui(e),
3249
+ height: t.height || di(e)
3119
3250
  };
3120
3251
  }
3121
- function ai() {
3252
+ function pi() {
3122
3253
  let e, t;
3123
3254
  try {
3124
3255
  t = process;
@@ -3126,11 +3257,11 @@ function ai() {
3126
3257
  let n = t && t.env ? t.env.devicePixelRatio : null;
3127
3258
  return n && (e = parseInt(n, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
3128
3259
  }
3129
- var Y = 16384;
3130
- function oi(e) {
3131
- (e.width > Y || e.height > Y) && (e.width > Y && e.height > Y ? e.width > e.height ? (e.height *= Y / e.width, e.width = Y) : (e.width *= Y / e.height, e.height = Y) : e.width > Y ? (e.height *= Y / e.width, e.width = Y) : (e.width *= Y / e.height, e.height = Y));
3260
+ var X = 16384;
3261
+ function mi(e) {
3262
+ (e.width > X || e.height > X) && (e.width > X && e.height > X ? e.width > e.height ? (e.height *= X / e.width, e.width = X) : (e.width *= X / e.height, e.height = X) : e.width > X ? (e.height *= X / e.width, e.width = X) : (e.width *= X / e.height, e.height = X));
3132
3263
  }
3133
- function si(e) {
3264
+ function hi(e) {
3134
3265
  return new Promise((t, n) => {
3135
3266
  let r = new Image();
3136
3267
  r.onload = () => {
@@ -3140,80 +3271,80 @@ function si(e) {
3140
3271
  }, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = e;
3141
3272
  });
3142
3273
  }
3143
- async function ci(e) {
3274
+ async function gi(e) {
3144
3275
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
3145
3276
  }
3146
- async function li(e, t, n) {
3277
+ async function _i(e, t, n) {
3147
3278
  let r = "http://www.w3.org/2000/svg", i = document.createElementNS(r, "svg"), a = document.createElementNS(r, "foreignObject");
3148
- return i.setAttribute("width", `${t}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${t} ${n}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(e), ci(i);
3279
+ return i.setAttribute("width", `${t}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${t} ${n}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(e), gi(i);
3149
3280
  }
3150
- var X = (e, t) => {
3281
+ var Z = (e, t) => {
3151
3282
  if (e instanceof t) return !0;
3152
3283
  let n = Object.getPrototypeOf(e);
3153
- return n === null ? !1 : n.constructor.name === t.name || X(n, t);
3284
+ return n === null ? !1 : n.constructor.name === t.name || Z(n, t);
3154
3285
  };
3155
3286
  //#endregion
3156
3287
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js
3157
- function ui(e) {
3288
+ function vi(e) {
3158
3289
  let t = e.getPropertyValue("content");
3159
3290
  return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
3160
3291
  }
3161
- function di(e, t) {
3162
- return ei(t).map((t) => `${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t) ? " !important" : ""};`).join(" ");
3292
+ function yi(e, t) {
3293
+ return ci(t).map((t) => `${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t) ? " !important" : ""};`).join(" ");
3163
3294
  }
3164
- function fi(e, t, n, r) {
3165
- let i = `.${e}:${t}`, a = n.cssText ? ui(n) : di(n, r);
3295
+ function bi(e, t, n, r) {
3296
+ let i = `.${e}:${t}`, a = n.cssText ? vi(n) : yi(n, r);
3166
3297
  return document.createTextNode(`${i}{${a}}`);
3167
3298
  }
3168
- function pi(e, t, n, r) {
3299
+ function xi(e, t, n, r) {
3169
3300
  let i = window.getComputedStyle(e, n), a = i.getPropertyValue("content");
3170
3301
  if (a === "" || a === "none") return;
3171
- let o = Zr();
3302
+ let o = ai();
3172
3303
  try {
3173
3304
  t.className = `${t.className} ${o}`;
3174
3305
  } catch {
3175
3306
  return;
3176
3307
  }
3177
3308
  let s = document.createElement("style");
3178
- s.appendChild(fi(o, n, i, r)), t.appendChild(s);
3309
+ s.appendChild(bi(o, n, i, r)), t.appendChild(s);
3179
3310
  }
3180
- function mi(e, t, n) {
3181
- pi(e, t, ":before", n), pi(e, t, ":after", n);
3311
+ function Si(e, t, n) {
3312
+ xi(e, t, ":before", n), xi(e, t, ":after", n);
3182
3313
  }
3183
3314
  //#endregion
3184
3315
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js
3185
- var hi = "application/font-woff", gi = "image/jpeg", _i = {
3186
- woff: hi,
3187
- woff2: hi,
3316
+ var Ci = "application/font-woff", wi = "image/jpeg", Ti = {
3317
+ woff: Ci,
3318
+ woff2: Ci,
3188
3319
  ttf: "application/font-truetype",
3189
3320
  eot: "application/vnd.ms-fontobject",
3190
3321
  png: "image/png",
3191
- jpg: gi,
3192
- jpeg: gi,
3322
+ jpg: wi,
3323
+ jpeg: wi,
3193
3324
  gif: "image/gif",
3194
3325
  tiff: "image/tiff",
3195
3326
  svg: "image/svg+xml",
3196
3327
  webp: "image/webp"
3197
3328
  };
3198
- function vi(e) {
3329
+ function Ei(e) {
3199
3330
  let t = /\.([^./]*?)$/g.exec(e);
3200
3331
  return t ? t[1] : "";
3201
3332
  }
3202
- function yi(e) {
3203
- return _i[vi(e).toLowerCase()] || "";
3333
+ function Di(e) {
3334
+ return Ti[Ei(e).toLowerCase()] || "";
3204
3335
  }
3205
3336
  //#endregion
3206
3337
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js
3207
- function bi(e) {
3338
+ function Oi(e) {
3208
3339
  return e.split(/,/)[1];
3209
3340
  }
3210
- function xi(e) {
3341
+ function ki(e) {
3211
3342
  return e.search(/^(data:)/) !== -1;
3212
3343
  }
3213
- function Si(e, t) {
3344
+ function Ai(e, t) {
3214
3345
  return `data:${t};base64,${e}`;
3215
3346
  }
3216
- async function Ci(e, t, n) {
3347
+ async function ji(e, t, n) {
3217
3348
  let r = await fetch(e, t);
3218
3349
  if (r.status === 404) throw Error(`Resource "${r.url}" not found`);
3219
3350
  let i = await r.blob();
@@ -3231,78 +3362,78 @@ async function Ci(e, t, n) {
3231
3362
  }, a.readAsDataURL(i);
3232
3363
  });
3233
3364
  }
3234
- var wi = {};
3235
- function Ti(e, t, n) {
3365
+ var Mi = {};
3366
+ function Ni(e, t, n) {
3236
3367
  let r = e.replace(/\?.*/, "");
3237
3368
  return n && (r = e), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
3238
3369
  }
3239
- async function Ei(e, t, n) {
3240
- let r = Ti(e, t, n.includeQueryParams);
3241
- if (wi[r] != null) return wi[r];
3370
+ async function Pi(e, t, n) {
3371
+ let r = Ni(e, t, n.includeQueryParams);
3372
+ if (Mi[r] != null) return Mi[r];
3242
3373
  n.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
3243
3374
  let i;
3244
3375
  try {
3245
- i = Si(await Ci(e, n.fetchRequestInit, ({ res: e, result: n }) => (t ||= e.headers.get("Content-Type") || "", bi(n))), t);
3376
+ i = Ai(await ji(e, n.fetchRequestInit, ({ res: e, result: n }) => (t ||= e.headers.get("Content-Type") || "", Oi(n))), t);
3246
3377
  } catch (t) {
3247
3378
  i = n.imagePlaceholder || "";
3248
3379
  let r = `Failed to fetch resource: ${e}`;
3249
3380
  t && (r = typeof t == "string" ? t : t.message), r && console.warn(r);
3250
3381
  }
3251
- return wi[r] = i, i;
3382
+ return Mi[r] = i, i;
3252
3383
  }
3253
3384
  //#endregion
3254
3385
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js
3255
- async function Di(e) {
3386
+ async function Fi(e) {
3256
3387
  let t = e.toDataURL();
3257
- return t === "data:," ? e.cloneNode(!1) : si(t);
3388
+ return t === "data:," ? e.cloneNode(!1) : hi(t);
3258
3389
  }
3259
- async function Oi(e, t) {
3390
+ async function Ii(e, t) {
3260
3391
  if (e.currentSrc) {
3261
3392
  let t = document.createElement("canvas"), n = t.getContext("2d");
3262
- return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height), si(t.toDataURL());
3393
+ return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height), hi(t.toDataURL());
3263
3394
  }
3264
3395
  let n = e.poster;
3265
- return si(await Ei(n, yi(n), t));
3396
+ return hi(await Pi(n, Di(n), t));
3266
3397
  }
3267
- async function ki(e, t) {
3398
+ async function Li(e, t) {
3268
3399
  try {
3269
- if (e?.contentDocument?.body) return await zi(e.contentDocument.body, t, !0);
3400
+ if (e?.contentDocument?.body) return await qi(e.contentDocument.body, t, !0);
3270
3401
  } catch {}
3271
3402
  return e.cloneNode(!1);
3272
3403
  }
3273
- async function Ai(e, t) {
3274
- return X(e, HTMLCanvasElement) ? Di(e) : X(e, HTMLVideoElement) ? Oi(e, t) : X(e, HTMLIFrameElement) ? ki(e, t) : e.cloneNode(Mi(e));
3404
+ async function Ri(e, t) {
3405
+ return Z(e, HTMLCanvasElement) ? Fi(e) : Z(e, HTMLVideoElement) ? Ii(e, t) : Z(e, HTMLIFrameElement) ? Li(e, t) : e.cloneNode(Bi(e));
3275
3406
  }
3276
- var ji = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Mi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
3277
- async function Ni(e, t, n) {
3278
- if (Mi(t)) return t;
3407
+ var zi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Bi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
3408
+ async function Vi(e, t, n) {
3409
+ if (Bi(t)) return t;
3279
3410
  let r = [];
3280
- return r = ji(e) && e.assignedNodes ? Qr(e.assignedNodes()) : X(e, HTMLIFrameElement) && e.contentDocument?.body ? Qr(e.contentDocument.body.childNodes) : Qr((e.shadowRoot ?? e).childNodes), r.length === 0 || X(e, HTMLVideoElement) || await r.reduce((e, r) => e.then(() => zi(r, n)).then((e) => {
3411
+ return r = zi(e) && e.assignedNodes ? oi(e.assignedNodes()) : Z(e, HTMLIFrameElement) && e.contentDocument?.body ? oi(e.contentDocument.body.childNodes) : oi((e.shadowRoot ?? e).childNodes), r.length === 0 || Z(e, HTMLVideoElement) || await r.reduce((e, r) => e.then(() => qi(r, n)).then((e) => {
3281
3412
  e && t.appendChild(e);
3282
3413
  }), Promise.resolve()), t;
3283
3414
  }
3284
- function Pi(e, t, n) {
3415
+ function Hi(e, t, n) {
3285
3416
  let r = t.style;
3286
3417
  if (!r) return;
3287
3418
  let i = window.getComputedStyle(e);
3288
- i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) : ei(n).forEach((n) => {
3419
+ i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) : ci(n).forEach((n) => {
3289
3420
  let a = i.getPropertyValue(n);
3290
- n === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - .1}px`), X(e, HTMLIFrameElement) && n === "display" && a === "inline" && (a = "block"), n === "d" && t.getAttribute("d") && (a = `path(${t.getAttribute("d")})`), r.setProperty(n, a, i.getPropertyPriority(n));
3421
+ n === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - .1}px`), Z(e, HTMLIFrameElement) && n === "display" && a === "inline" && (a = "block"), n === "d" && t.getAttribute("d") && (a = `path(${t.getAttribute("d")})`), r.setProperty(n, a, i.getPropertyPriority(n));
3291
3422
  });
3292
3423
  }
3293
- function Fi(e, t) {
3294
- X(e, HTMLTextAreaElement) && (t.innerHTML = e.value), X(e, HTMLInputElement) && t.setAttribute("value", e.value);
3424
+ function Ui(e, t) {
3425
+ Z(e, HTMLTextAreaElement) && (t.innerHTML = e.value), Z(e, HTMLInputElement) && t.setAttribute("value", e.value);
3295
3426
  }
3296
- function Ii(e, t) {
3297
- if (X(e, HTMLSelectElement)) {
3427
+ function Wi(e, t) {
3428
+ if (Z(e, HTMLSelectElement)) {
3298
3429
  let n = t, r = Array.from(n.children).find((t) => e.value === t.getAttribute("value"));
3299
3430
  r && r.setAttribute("selected", "");
3300
3431
  }
3301
3432
  }
3302
- function Li(e, t, n) {
3303
- return X(t, Element) && (Pi(e, t, n), mi(e, t, n), Fi(e, t), Ii(e, t)), t;
3433
+ function Gi(e, t, n) {
3434
+ return Z(t, Element) && (Hi(e, t, n), Si(e, t, n), Ui(e, t), Wi(e, t)), t;
3304
3435
  }
3305
- async function Ri(e, t) {
3436
+ async function Ki(e, t) {
3306
3437
  let n = e.querySelectorAll ? e.querySelectorAll("use") : [];
3307
3438
  if (n.length === 0) return e;
3308
3439
  let r = {};
@@ -3310,7 +3441,7 @@ async function Ri(e, t) {
3310
3441
  let a = n[i].getAttribute("xlink:href");
3311
3442
  if (a) {
3312
3443
  let n = e.querySelector(a), i = document.querySelector(a);
3313
- !n && i && !r[a] && (r[a] = await zi(i, t, !0));
3444
+ !n && i && !r[a] && (r[a] = await qi(i, t, !0));
3314
3445
  }
3315
3446
  }
3316
3447
  let i = Object.values(r);
@@ -3324,61 +3455,61 @@ async function Ri(e, t) {
3324
3455
  }
3325
3456
  return e;
3326
3457
  }
3327
- async function zi(e, t, n) {
3328
- return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) => Ai(e, t)).then((n) => Ni(e, n, t)).then((n) => Li(e, n, t)).then((e) => Ri(e, t));
3458
+ async function qi(e, t, n) {
3459
+ return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) => Ri(e, t)).then((n) => Vi(e, n, t)).then((n) => Gi(e, n, t)).then((e) => Ki(e, t));
3329
3460
  }
3330
3461
  //#endregion
3331
3462
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js
3332
- var Bi = /url\((['"]?)([^'"]+?)\1\)/g, Vi = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Hi = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
3333
- function Ui(e) {
3463
+ var Ji = /url\((['"]?)([^'"]+?)\1\)/g, Yi = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Xi = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
3464
+ function Zi(e) {
3334
3465
  let t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
3335
3466
  return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
3336
3467
  }
3337
- function Wi(e) {
3468
+ function Qi(e) {
3338
3469
  let t = [];
3339
- return e.replace(Bi, (e, n, r) => (t.push(r), e)), t.filter((e) => !xi(e));
3470
+ return e.replace(Ji, (e, n, r) => (t.push(r), e)), t.filter((e) => !ki(e));
3340
3471
  }
3341
- async function Gi(e, t, n, r, i) {
3472
+ async function $i(e, t, n, r, i) {
3342
3473
  try {
3343
- let a = n ? Xr(t, n) : t, o = yi(t), s;
3344
- return s = i ? Si(await i(a), o) : await Ei(a, o, r), e.replace(Ui(t), `$1${s}$3`);
3474
+ let a = n ? ii(t, n) : t, o = Di(t), s;
3475
+ return s = i ? Ai(await i(a), o) : await Pi(a, o, r), e.replace(Zi(t), `$1${s}$3`);
3345
3476
  } catch {}
3346
3477
  return e;
3347
3478
  }
3348
- function Ki(e, { preferredFontFormat: t }) {
3349
- return t ? e.replace(Hi, (e) => {
3479
+ function ea(e, { preferredFontFormat: t }) {
3480
+ return t ? e.replace(Xi, (e) => {
3350
3481
  for (;;) {
3351
- let [n, , r] = Vi.exec(e) || [];
3482
+ let [n, , r] = Yi.exec(e) || [];
3352
3483
  if (!r) return "";
3353
3484
  if (r === t) return `src: ${n};`;
3354
3485
  }
3355
3486
  }) : e;
3356
3487
  }
3357
- function qi(e) {
3358
- return e.search(Bi) !== -1;
3488
+ function ta(e) {
3489
+ return e.search(Ji) !== -1;
3359
3490
  }
3360
- async function Ji(e, t, n) {
3361
- if (!qi(e)) return e;
3362
- let r = Ki(e, n);
3363
- return Wi(r).reduce((e, r) => e.then((e) => Gi(e, r, t, n)), Promise.resolve(r));
3491
+ async function na(e, t, n) {
3492
+ if (!ta(e)) return e;
3493
+ let r = ea(e, n);
3494
+ return Qi(r).reduce((e, r) => e.then((e) => $i(e, r, t, n)), Promise.resolve(r));
3364
3495
  }
3365
3496
  //#endregion
3366
3497
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js
3367
- async function Yi(e, t, n) {
3498
+ async function ra(e, t, n) {
3368
3499
  let r = t.style?.getPropertyValue(e);
3369
3500
  if (r) {
3370
- let i = await Ji(r, null, n);
3501
+ let i = await na(r, null, n);
3371
3502
  return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
3372
3503
  }
3373
3504
  return !1;
3374
3505
  }
3375
- async function Xi(e, t) {
3376
- await Yi("background", e, t) || await Yi("background-image", e, t), await Yi("mask", e, t) || await Yi("-webkit-mask", e, t) || await Yi("mask-image", e, t) || await Yi("-webkit-mask-image", e, t);
3506
+ async function ia(e, t) {
3507
+ await ra("background", e, t) || await ra("background-image", e, t), await ra("mask", e, t) || await ra("-webkit-mask", e, t) || await ra("mask-image", e, t) || await ra("-webkit-mask-image", e, t);
3377
3508
  }
3378
- async function Zi(e, t) {
3379
- let n = X(e, HTMLImageElement);
3380
- if (!(n && !xi(e.src)) && !(X(e, SVGImageElement) && !xi(e.href.baseVal))) return;
3381
- let r = n ? e.src : e.href.baseVal, i = await Ei(r, yi(r), t);
3509
+ async function aa(e, t) {
3510
+ let n = Z(e, HTMLImageElement);
3511
+ if (!(n && !ki(e.src)) && !(Z(e, SVGImageElement) && !ki(e.href.baseVal))) return;
3512
+ let r = n ? e.src : e.href.baseVal, i = await Pi(r, Di(r), t);
3382
3513
  await new Promise((r, a) => {
3383
3514
  e.onload = r, e.onerror = t.onImageErrorHandler ? (...e) => {
3384
3515
  try {
@@ -3391,16 +3522,16 @@ async function Zi(e, t) {
3391
3522
  o.decode &&= r, o.loading === "lazy" && (o.loading = "eager"), n ? (e.srcset = "", e.src = i) : e.href.baseVal = i;
3392
3523
  });
3393
3524
  }
3394
- async function Qi(e, t) {
3395
- let n = Qr(e.childNodes).map((e) => $i(e, t));
3525
+ async function oa(e, t) {
3526
+ let n = oi(e.childNodes).map((e) => sa(e, t));
3396
3527
  await Promise.all(n).then(() => e);
3397
3528
  }
3398
- async function $i(e, t) {
3399
- X(e, Element) && (await Xi(e, t), await Zi(e, t), await Qi(e, t));
3529
+ async function sa(e, t) {
3530
+ Z(e, Element) && (await ia(e, t), await aa(e, t), await oa(e, t));
3400
3531
  }
3401
3532
  //#endregion
3402
3533
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js
3403
- function ea(e, t) {
3534
+ function ca(e, t) {
3404
3535
  let { style: n } = e;
3405
3536
  t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.width && (n.width = `${t.width}px`), t.height && (n.height = `${t.height}px`);
3406
3537
  let r = t.style;
@@ -3410,22 +3541,22 @@ function ea(e, t) {
3410
3541
  }
3411
3542
  //#endregion
3412
3543
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js
3413
- var ta = {};
3414
- async function na(e) {
3415
- let t = ta[e];
3544
+ var la = {};
3545
+ async function ua(e) {
3546
+ let t = la[e];
3416
3547
  return t ?? (t = {
3417
3548
  url: e,
3418
3549
  cssText: await (await fetch(e)).text()
3419
- }, ta[e] = t, t);
3550
+ }, la[e] = t, t);
3420
3551
  }
3421
- async function ra(e, t) {
3552
+ async function da(e, t) {
3422
3553
  let n = e.cssText, r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (i) => {
3423
3554
  let a = i.replace(r, "$1");
3424
- return a.startsWith("https://") || (a = new URL(a, e.url).href), Ci(a, t.fetchRequestInit, ({ result: e }) => (n = n.replace(i, `url(${e})`), [i, e]));
3555
+ return a.startsWith("https://") || (a = new URL(a, e.url).href), ji(a, t.fetchRequestInit, ({ result: e }) => (n = n.replace(i, `url(${e})`), [i, e]));
3425
3556
  });
3426
3557
  return Promise.all(i).then(() => n);
3427
3558
  }
3428
- function ia(e) {
3559
+ function fa(e) {
3429
3560
  if (e == null) return [];
3430
3561
  let t = [], n = e.replace(/(\/\*[\s\S]*?\*\/)/gi, ""), r = /* @__PURE__ */ RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
3431
3562
  for (;;) {
@@ -3445,13 +3576,13 @@ function ia(e) {
3445
3576
  }
3446
3577
  return t;
3447
3578
  }
3448
- async function aa(e, t) {
3579
+ async function pa(e, t) {
3449
3580
  let n = [], r = [];
3450
3581
  return e.forEach((n) => {
3451
3582
  if ("cssRules" in n) try {
3452
- Qr(n.cssRules || []).forEach((e, i) => {
3583
+ oi(n.cssRules || []).forEach((e, i) => {
3453
3584
  if (e.type === CSSRule.IMPORT_RULE) {
3454
- let a = i + 1, o = e.href, s = na(o).then((e) => ra(e, t)).then((e) => ia(e).forEach((e) => {
3585
+ let a = i + 1, o = e.href, s = ua(o).then((e) => da(e, t)).then((e) => fa(e).forEach((e) => {
3455
3586
  try {
3456
3587
  n.insertRule(e, e.startsWith("@import") ? a += 1 : n.cssRules.length);
3457
3588
  } catch (t) {
@@ -3468,7 +3599,7 @@ async function aa(e, t) {
3468
3599
  });
3469
3600
  } catch (i) {
3470
3601
  let a = e.find((e) => e.href == null) || document.styleSheets[0];
3471
- n.href != null && r.push(na(n.href).then((e) => ra(e, t)).then((e) => ia(e).forEach((e) => {
3602
+ n.href != null && r.push(ua(n.href).then((e) => da(e, t)).then((e) => fa(e).forEach((e) => {
3472
3603
  a.insertRule(e, a.cssRules.length);
3473
3604
  })).catch((e) => {
3474
3605
  console.error("Error loading remote stylesheet", e);
@@ -3476,7 +3607,7 @@ async function aa(e, t) {
3476
3607
  }
3477
3608
  }), Promise.all(r).then(() => (e.forEach((e) => {
3478
3609
  if ("cssRules" in e) try {
3479
- Qr(e.cssRules || []).forEach((e) => {
3610
+ oi(e.cssRules || []).forEach((e) => {
3480
3611
  n.push(e);
3481
3612
  });
3482
3613
  } catch (t) {
@@ -3484,36 +3615,36 @@ async function aa(e, t) {
3484
3615
  }
3485
3616
  }), n));
3486
3617
  }
3487
- function oa(e) {
3488
- return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => qi(e.style.getPropertyValue("src")));
3618
+ function ma(e) {
3619
+ return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => ta(e.style.getPropertyValue("src")));
3489
3620
  }
3490
- async function sa(e, t) {
3621
+ async function ha(e, t) {
3491
3622
  if (e.ownerDocument == null) throw Error("Provided element is not within a Document");
3492
- return oa(await aa(Qr(e.ownerDocument.styleSheets), t));
3623
+ return ma(await pa(oi(e.ownerDocument.styleSheets), t));
3493
3624
  }
3494
- function ca(e) {
3625
+ function ga(e) {
3495
3626
  return e.trim().replace(/["']/g, "");
3496
3627
  }
3497
- function la(e) {
3628
+ function _a(e) {
3498
3629
  let t = /* @__PURE__ */ new Set();
3499
3630
  function n(e) {
3500
3631
  (e.style.fontFamily || getComputedStyle(e).fontFamily).split(",").forEach((e) => {
3501
- t.add(ca(e));
3632
+ t.add(ga(e));
3502
3633
  }), Array.from(e.children).forEach((e) => {
3503
3634
  e instanceof HTMLElement && n(e);
3504
3635
  });
3505
3636
  }
3506
3637
  return n(e), t;
3507
3638
  }
3508
- async function ua(e, t) {
3509
- let n = await sa(e, t), r = la(e);
3510
- return (await Promise.all(n.filter((e) => r.has(ca(e.style.fontFamily))).map((e) => {
3639
+ async function va(e, t) {
3640
+ let n = await ha(e, t), r = _a(e);
3641
+ return (await Promise.all(n.filter((e) => r.has(ga(e.style.fontFamily))).map((e) => {
3511
3642
  let n = e.parentStyleSheet ? e.parentStyleSheet.href : null;
3512
- return Ji(e.cssText, n, t);
3643
+ return na(e.cssText, n, t);
3513
3644
  }))).join("\n");
3514
3645
  }
3515
- async function da(e, t) {
3516
- let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await ua(e, t) : t.fontEmbedCSS;
3646
+ async function ya(e, t) {
3647
+ let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await va(e, t) : t.fontEmbedCSS;
3517
3648
  if (n) {
3518
3649
  let t = document.createElement("style"), r = document.createTextNode(n);
3519
3650
  t.appendChild(r), e.firstChild ? e.insertBefore(t, e.firstChild) : e.appendChild(t);
@@ -3521,18 +3652,18 @@ async function da(e, t) {
3521
3652
  }
3522
3653
  //#endregion
3523
3654
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js
3524
- async function fa(e, t = {}) {
3525
- let { width: n, height: r } = ii(e, t), i = await zi(e, t, !0);
3526
- return await da(i, t), await $i(i, t), ea(i, t), await li(i, n, r);
3655
+ async function ba(e, t = {}) {
3656
+ let { width: n, height: r } = fi(e, t), i = await qi(e, t, !0);
3657
+ return await ya(i, t), await sa(i, t), ca(i, t), await _i(i, n, r);
3527
3658
  }
3528
- async function pa(e, t = {}) {
3529
- let { width: n, height: r } = ii(e, t), i = await si(await fa(e, t)), a = document.createElement("canvas"), o = a.getContext("2d"), s = t.pixelRatio || ai(), c = t.canvasWidth || n, l = t.canvasHeight || r;
3530
- return a.width = c * s, a.height = l * s, t.skipAutoScale || oi(a), a.style.width = `${c}`, a.style.height = `${l}`, t.backgroundColor && (o.fillStyle = t.backgroundColor, o.fillRect(0, 0, a.width, a.height)), o.drawImage(i, 0, 0, a.width, a.height), a;
3659
+ async function xa(e, t = {}) {
3660
+ let { width: n, height: r } = fi(e, t), i = await hi(await ba(e, t)), a = document.createElement("canvas"), o = a.getContext("2d"), s = t.pixelRatio || pi(), c = t.canvasWidth || n, l = t.canvasHeight || r;
3661
+ return a.width = c * s, a.height = l * s, t.skipAutoScale || mi(a), a.style.width = `${c}`, a.style.height = `${l}`, t.backgroundColor && (o.fillStyle = t.backgroundColor, o.fillRect(0, 0, a.width, a.height)), o.drawImage(i, 0, 0, a.width, a.height), a;
3531
3662
  }
3532
3663
  //#endregion
3533
3664
  //#region src/runtime/screenshot.ts
3534
- var ma = 2 * 1024 * 1024, ha = "background:currentColor!important;color:transparent!important;text-shadow:none!important;-webkit-text-fill-color:transparent!important", ga = "input[type=\"password\"],input[autocomplete~=\"cc-number\"],input[autocomplete~=\"cc-csc\"],input[autocomplete~=\"cc-exp\"],input[autocomplete~=\"cc-name\"],input[autocomplete~=\"cc-type\"],input[autocomplete~=\"current-password\"],input[autocomplete~=\"new-password\"],input[autocomplete~=\"one-time-code\"]";
3535
- function _a(e) {
3665
+ var Sa = 2 * 1024 * 1024, Ca = "background:currentColor!important;color:transparent!important;text-shadow:none!important;-webkit-text-fill-color:transparent!important", wa = "input[type=\"password\"],input[autocomplete~=\"cc-number\"],input[autocomplete~=\"cc-csc\"],input[autocomplete~=\"cc-exp\"],input[autocomplete~=\"cc-name\"],input[autocomplete~=\"cc-type\"],input[autocomplete~=\"current-password\"],input[autocomplete~=\"new-password\"],input[autocomplete~=\"one-time-code\"]";
3666
+ function Ta(e) {
3536
3667
  let t = e.parentElement;
3537
3668
  for (; t;) {
3538
3669
  if (t.hasAttribute("data-markup-safe")) return !0;
@@ -3540,35 +3671,35 @@ function _a(e) {
3540
3671
  }
3541
3672
  return !1;
3542
3673
  }
3543
- function va(e) {
3674
+ function Ea(e) {
3544
3675
  let t = /* @__PURE__ */ new Set(), n = [];
3545
3676
  function r(e) {
3546
3677
  t.has(e) || (t.add(e), n.push(e));
3547
3678
  }
3548
3679
  for (let e of document.querySelectorAll("[data-markup-private],[data-markup-redact]")) r(e);
3549
- for (let e of document.querySelectorAll(ga)) _a(e) || r(e);
3680
+ for (let e of document.querySelectorAll(wa)) Ta(e) || r(e);
3550
3681
  if (e.redactSelector) try {
3551
- for (let t of document.querySelectorAll(e.redactSelector)) _a(t) || r(t);
3682
+ for (let t of document.querySelectorAll(e.redactSelector)) Ta(t) || r(t);
3552
3683
  } catch {}
3553
- if (e.strictScrub) for (let e of document.querySelectorAll("input,select,textarea")) _a(e) || r(e);
3684
+ if (e.strictScrub) for (let e of document.querySelectorAll("input,select,textarea")) Ta(e) || r(e);
3554
3685
  return n;
3555
3686
  }
3556
- function ya(e) {
3687
+ function Da(e) {
3557
3688
  let t = e.getAttribute("style");
3558
- return e.setAttribute("style", t ? `${t};${ha}` : ha), () => {
3689
+ return e.setAttribute("style", t ? `${t};${Ca}` : Ca), () => {
3559
3690
  t === null ? e.removeAttribute("style") : e.setAttribute("style", t);
3560
3691
  };
3561
3692
  }
3562
- function ba(e) {
3693
+ function Oa(e) {
3563
3694
  if (e.id) return `#${CSS.escape(e.id)}`;
3564
3695
  let t = e.tagName.toLowerCase(), n = e.getAttribute("type"), r = e.getAttribute("name");
3565
3696
  return n && r ? `${t}[type="${n}"][name="${r}"]` : n ? `${t}[type="${n}"]` : r ? `${t}[name="${r}"]` : t;
3566
3697
  }
3567
- async function xa(e, t, n) {
3698
+ async function ka(e, t, n) {
3568
3699
  try {
3569
- let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = n ? va(n) : [], s = o.map(ba), c = o.map(ya), l;
3700
+ let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = n ? Ea(n) : [], s = o.map(Oa), c = o.map(Da), l;
3570
3701
  try {
3571
- l = await pa(document.documentElement, {
3702
+ l = await xa(document.documentElement, {
3572
3703
  width: r,
3573
3704
  height: i,
3574
3705
  cacheBust: !0,
@@ -3587,17 +3718,17 @@ async function xa(e, t, n) {
3587
3718
  }
3588
3719
  if (t) {
3589
3720
  let e = l.getContext("2d");
3590
- e && Ca(e, t.x, t.y, a);
3721
+ e && ja(e, t.x, t.y, a);
3591
3722
  }
3592
- let u = await Sa(l, .85);
3723
+ let u = await Aa(l, .85);
3593
3724
  if (!u) return null;
3594
- if (u.size <= ma) return {
3725
+ if (u.size <= Sa) return {
3595
3726
  blob: u,
3596
3727
  redactedCount: s.length,
3597
3728
  redactedSelectors: s
3598
3729
  };
3599
- let d = await Sa(l, .5);
3600
- return !d || d.size > ma ? null : {
3730
+ let d = await Aa(l, .5);
3731
+ return !d || d.size > Sa ? null : {
3601
3732
  blob: d,
3602
3733
  redactedCount: s.length,
3603
3734
  redactedSelectors: s
@@ -3606,10 +3737,10 @@ async function xa(e, t, n) {
3606
3737
  return null;
3607
3738
  }
3608
3739
  }
3609
- function Sa(e, t) {
3740
+ function Aa(e, t) {
3610
3741
  return new Promise((n) => e.toBlob(n, "image/jpeg", t));
3611
3742
  }
3612
- function Ca(e, t, n, r) {
3743
+ function ja(e, t, n, r) {
3613
3744
  let i = r, a = 28 * i, o = a / 2, s = t * i, c = n * i;
3614
3745
  e.save();
3615
3746
  let l = 2 * i;
@@ -3627,7 +3758,7 @@ function Ca(e, t, n, r) {
3627
3758
  }
3628
3759
  //#endregion
3629
3760
  //#region src/runtime/use-subscription-token.ts
3630
- var wa = ar({
3761
+ var Ma = dr({
3631
3762
  idle: { issued: (e, t) => ({
3632
3763
  kind: "active",
3633
3764
  token: t.token,
@@ -3638,9 +3769,9 @@ var wa = ar({
3638
3769
  token: t.token,
3639
3770
  expiresAt: t.expiresAt
3640
3771
  }) }
3641
- }), Ta = 30 * 6e4, Ea = 6e4, Da = 6e4;
3642
- function Oa(e) {
3643
- let [t, n] = or(wa, { kind: "idle" });
3772
+ }), Na = 30 * 6e4, Pa = 6e4, Fa = 6e4;
3773
+ function Ia(e) {
3774
+ let [t, n] = fr(Ma, { kind: "idle" });
3644
3775
  return z(() => {
3645
3776
  let t = !1, r = null;
3646
3777
  async function i() {
@@ -3652,11 +3783,11 @@ function Oa(e) {
3652
3783
  token: a.token,
3653
3784
  expiresAt: a.expiresAt
3654
3785
  });
3655
- let o = Math.max(Ea, a.expiresAt - Date.now() - Ta);
3786
+ let o = Math.max(Pa, a.expiresAt - Date.now() - Na);
3656
3787
  r = setTimeout(i, o);
3657
3788
  } catch {
3658
3789
  if (t) return;
3659
- r = setTimeout(i, Da);
3790
+ r = setTimeout(i, Fa);
3660
3791
  }
3661
3792
  }
3662
3793
  return i(), () => {
@@ -3666,24 +3797,34 @@ function Oa(e) {
3666
3797
  }
3667
3798
  //#endregion
3668
3799
  //#region src/runtime/refresh-token.ts
3669
- async function ka(e) {
3800
+ async function La(e) {
3670
3801
  try {
3671
- let t = await fetch(`${e.apiUrl.replace(/\/+$/, "")}/widget/refresh`, {
3802
+ let t = {
3672
3803
  method: "POST",
3673
3804
  headers: {
3674
3805
  "content-type": "application/json",
3675
3806
  "x-markup-api-key": e.apiKey
3676
3807
  },
3677
- body: JSON.stringify({ refreshToken: e.refreshToken }),
3678
3808
  signal: e.signal
3679
- });
3680
- if (!t.ok) return null;
3681
- let n = await t.json();
3682
- return typeof n.accessToken != "string" || typeof n.accessTokenExpiresAt != "number" || typeof n.refreshToken != "string" || typeof n.refreshTokenExpiresAt != "number" ? null : {
3683
- accessToken: n.accessToken,
3684
- accessTokenExpiresAt: n.accessTokenExpiresAt,
3685
- refreshToken: n.refreshToken,
3686
- refreshTokenExpiresAt: n.refreshTokenExpiresAt
3809
+ };
3810
+ if (e.mode === "cookies") t.credentials = "include", t.body = "{}";
3811
+ else {
3812
+ if (!e.refreshToken) return null;
3813
+ t.body = JSON.stringify({ refreshToken: e.refreshToken });
3814
+ }
3815
+ let n = await fetch(`${e.apiUrl.replace(/\/+$/, "")}/widget/refresh`, t);
3816
+ if (!n.ok) return null;
3817
+ let r = await n.json();
3818
+ return r.mode === "cookies" ? typeof r.accessTokenExpiresAt != "number" || typeof r.refreshTokenExpiresAt != "number" ? null : {
3819
+ mode: "cookies",
3820
+ accessTokenExpiresAt: r.accessTokenExpiresAt,
3821
+ refreshTokenExpiresAt: r.refreshTokenExpiresAt
3822
+ } : typeof r.accessToken != "string" || typeof r.accessTokenExpiresAt != "number" || typeof r.refreshToken != "string" || typeof r.refreshTokenExpiresAt != "number" ? null : {
3823
+ mode: "localStorage",
3824
+ accessToken: r.accessToken,
3825
+ accessTokenExpiresAt: r.accessTokenExpiresAt,
3826
+ refreshToken: r.refreshToken,
3827
+ refreshTokenExpiresAt: r.refreshTokenExpiresAt
3687
3828
  };
3688
3829
  } catch {
3689
3830
  return null;
@@ -3691,57 +3832,63 @@ async function ka(e) {
3691
3832
  }
3692
3833
  //#endregion
3693
3834
  //#region src/runtime/use-token-refresh.ts
3694
- var Aa = 6e4, ja = 500;
3695
- function Ma(e, t, n, r, i) {
3696
- let a = e.kind === "verified", o = a ? e.identity.refreshToken : void 0, s = a ? e.identity.refreshTokenExpiresAt : void 0, c = a ? e.identity.tokenExpiresAt : void 0;
3835
+ var Ra = 6e4, za = 500;
3836
+ function Ba(e, t, n, r, i) {
3837
+ let a = e.kind === "verified", o = a ? e.identity.storage : void 0, s = a ? e.identity.refreshToken : void 0, c = a ? e.identity.refreshTokenExpiresAt : void 0, l = a ? e.identity.tokenExpiresAt : void 0;
3697
3838
  z(() => {
3698
- if (!a || o == null || s == null || c == null) return;
3699
- let l = Date.now();
3700
- if (s <= l) {
3839
+ if (!a || c == null || l == null || o === "localStorage" && s == null || o !== "cookies" && o !== "localStorage") return;
3840
+ let u = Date.now();
3841
+ if (c <= u) {
3701
3842
  i();
3702
3843
  return;
3703
3844
  }
3704
- let u = Math.max(ja, c - Aa - l), d = new AbortController(), f = window.setTimeout(async () => {
3705
- let a = await ka({
3845
+ let d = Math.max(za, l - Ra - u), f = new AbortController(), p = window.setTimeout(async () => {
3846
+ let a = await La({
3706
3847
  apiUrl: t,
3707
3848
  apiKey: n,
3708
- refreshToken: o,
3709
- signal: d.signal
3849
+ mode: o,
3850
+ refreshToken: s,
3851
+ signal: f.signal
3710
3852
  });
3711
- if (!d.signal.aborted) {
3853
+ if (!f.signal.aborted) {
3712
3854
  if (!a) {
3713
3855
  i();
3714
3856
  return;
3715
3857
  }
3716
- e.kind === "verified" && r({
3858
+ e.kind === "verified" && (a.mode === "cookies" ? r({
3859
+ ...e.identity,
3860
+ tokenExpiresAt: a.accessTokenExpiresAt,
3861
+ refreshTokenExpiresAt: a.refreshTokenExpiresAt
3862
+ }) : r({
3717
3863
  ...e.identity,
3718
3864
  token: a.accessToken,
3719
3865
  tokenExpiresAt: a.accessTokenExpiresAt,
3720
3866
  refreshToken: a.refreshToken,
3721
3867
  refreshTokenExpiresAt: a.refreshTokenExpiresAt
3722
- });
3868
+ }));
3723
3869
  }
3724
- }, u);
3870
+ }, d);
3725
3871
  return () => {
3726
- window.clearTimeout(f), d.abort();
3872
+ window.clearTimeout(p), f.abort();
3727
3873
  };
3728
3874
  }, [
3729
3875
  a,
3730
3876
  o,
3731
3877
  s,
3732
3878
  c,
3879
+ l,
3733
3880
  t,
3734
3881
  n
3735
3882
  ]);
3736
3883
  }
3737
3884
  //#endregion
3738
3885
  //#region src/runtime/utils.ts
3739
- function Z(...e) {
3886
+ function Q(...e) {
3740
3887
  return e.filter(Boolean).join(" ");
3741
3888
  }
3742
3889
  //#endregion
3743
3890
  //#region src/runtime/use-drag.ts
3744
- function Na(e) {
3891
+ function Va(e) {
3745
3892
  let t = B(e);
3746
3893
  t.current = e;
3747
3894
  let [n, r] = R(!1), i = B(!1);
@@ -3770,8 +3917,8 @@ function Na(e) {
3770
3917
  g = !0, i.current = !0, r(!0), t.current.onStart?.();
3771
3918
  }
3772
3919
  let o = Math.max(m, window.innerWidth - d - m), v = Math.max(m, window.innerHeight - f - m), y = {
3773
- left: Pa(l + n, m, o),
3774
- top: Pa(u + a, m, v)
3920
+ left: Ha(l + n, m, o),
3921
+ top: Ha(u + a, m, v)
3775
3922
  };
3776
3923
  _ = y, t.current.onMove(y);
3777
3924
  }
@@ -3787,14 +3934,14 @@ function Na(e) {
3787
3934
  consumeClickIfDragged: V(() => i.current ? (i.current = !1, !0) : !1, [])
3788
3935
  };
3789
3936
  }
3790
- function Pa(e, t, n) {
3937
+ function Ha(e, t, n) {
3791
3938
  return Math.max(t, Math.min(n, e));
3792
3939
  }
3793
3940
  //#endregion
3794
3941
  //#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
3795
- var Fa = 0;
3942
+ var Ua = 0;
3796
3943
  Array.isArray;
3797
- function Q(e, n, r, i, a, o) {
3944
+ function $(e, n, r, i, a, o) {
3798
3945
  n ||= {};
3799
3946
  var s, c, l = n;
3800
3947
  if ("ref" in l) for (c in l = {}, n) c == "ref" ? s = n[c] : l[c] = n[c];
@@ -3809,7 +3956,7 @@ function Q(e, n, r, i, a, o) {
3809
3956
  __e: null,
3810
3957
  __c: null,
3811
3958
  constructor: void 0,
3812
- __v: --Fa,
3959
+ __v: --Ua,
3813
3960
  __i: -1,
3814
3961
  __u: 0,
3815
3962
  __source: a,
@@ -3820,84 +3967,84 @@ function Q(e, n, r, i, a, o) {
3820
3967
  }
3821
3968
  //#endregion
3822
3969
  //#region src/runtime/ui/icons.tsx
3823
- function Ia({ size: e = 16 }) {
3824
- return /* @__PURE__ */ Q("svg", {
3970
+ function Wa({ size: e = 16 }) {
3971
+ return /* @__PURE__ */ $("svg", {
3825
3972
  width: e,
3826
3973
  height: e,
3827
3974
  viewBox: "0 0 126 126",
3828
3975
  fill: "currentColor",
3829
3976
  "aria-hidden": !0,
3830
- children: /* @__PURE__ */ Q("path", { d: "M63.4561 0.00557731C70.6277 -0.0175584 76.9025 1.04088 83.5898 3.71066C97.7952 9.43043 109.186 20.5001 115.311 34.5359C119.708 44.8002 120.746 54.7869 119.156 65.8171C116.857 82.7956 105.129 98.8382 90.0566 106.846C83.4394 110.362 74.7336 113.029 67.2051 113.271C62.4204 113.425 61.1274 113.32 56.6807 115.204C50.2035 117.858 43.6874 120.417 37.1348 122.879C34.8442 123.763 32.3203 124.902 29.9404 125.51C29.4023 125.648 28.1978 125.009 27.7598 124.646C26.9046 123.951 27.0582 122.505 27.0264 121.484C26.8123 114.646 27.3302 107.458 26.8604 100.656C25.1578 98.6714 22.4026 96.603 20.3086 94.1989C12.1853 84.8731 7.05334 73.9949 6.18164 61.6101C4.95583 46.292 9.97176 31.1285 20.0908 19.5632C29.989 8.13202 44.0369 1.11921 59.1221 0.0788195C60.2694 -0.0356049 62.2637 0.00944821 63.4561 0.00557731ZM92.2676 55.7497C91.5754 39.5314 77.8207 26.9725 61.6064 27.7536C45.5175 28.5287 33.0758 42.1537 33.7627 58.2468C34.4496 74.3398 48.007 86.8553 64.1035 86.2566C80.3254 85.6533 92.9599 71.968 92.2676 55.7497Z" })
3977
+ children: /* @__PURE__ */ $("path", { d: "M63.4561 0.00557731C70.6277 -0.0175584 76.9025 1.04088 83.5898 3.71066C97.7952 9.43043 109.186 20.5001 115.311 34.5359C119.708 44.8002 120.746 54.7869 119.156 65.8171C116.857 82.7956 105.129 98.8382 90.0566 106.846C83.4394 110.362 74.7336 113.029 67.2051 113.271C62.4204 113.425 61.1274 113.32 56.6807 115.204C50.2035 117.858 43.6874 120.417 37.1348 122.879C34.8442 123.763 32.3203 124.902 29.9404 125.51C29.4023 125.648 28.1978 125.009 27.7598 124.646C26.9046 123.951 27.0582 122.505 27.0264 121.484C26.8123 114.646 27.3302 107.458 26.8604 100.656C25.1578 98.6714 22.4026 96.603 20.3086 94.1989C12.1853 84.8731 7.05334 73.9949 6.18164 61.6101C4.95583 46.292 9.97176 31.1285 20.0908 19.5632C29.989 8.13202 44.0369 1.11921 59.1221 0.0788195C60.2694 -0.0356049 62.2637 0.00944821 63.4561 0.00557731ZM92.2676 55.7497C91.5754 39.5314 77.8207 26.9725 61.6064 27.7536C45.5175 28.5287 33.0758 42.1537 33.7627 58.2468C34.4496 74.3398 48.007 86.8553 64.1035 86.2566C80.3254 85.6533 92.9599 71.968 92.2676 55.7497Z" })
3831
3978
  });
3832
3979
  }
3833
- function La({ size: e = 16 }) {
3834
- return /* @__PURE__ */ Q("svg", {
3980
+ function Ga({ size: e = 16 }) {
3981
+ return /* @__PURE__ */ $("svg", {
3835
3982
  width: e,
3836
3983
  height: e,
3837
3984
  viewBox: "0 0 20 20",
3838
3985
  fill: "currentColor",
3839
- children: /* @__PURE__ */ Q("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
3986
+ children: /* @__PURE__ */ $("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
3840
3987
  });
3841
3988
  }
3842
- function Ra({ size: e = 16 }) {
3843
- return /* @__PURE__ */ Q("svg", {
3989
+ function Ka({ size: e = 16 }) {
3990
+ return /* @__PURE__ */ $("svg", {
3844
3991
  width: e,
3845
3992
  height: e,
3846
3993
  viewBox: "0 0 20 20",
3847
3994
  fill: "currentColor",
3848
- children: /* @__PURE__ */ Q("path", { d: "M3 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM8.5 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM15.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" })
3995
+ children: /* @__PURE__ */ $("path", { d: "M3 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM8.5 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM15.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" })
3849
3996
  });
3850
3997
  }
3851
- function za({ size: e = 16 }) {
3852
- return /* @__PURE__ */ Q("svg", {
3998
+ function qa({ size: e = 16 }) {
3999
+ return /* @__PURE__ */ $("svg", {
3853
4000
  width: e,
3854
4001
  height: e,
3855
4002
  viewBox: "0 0 16 16",
3856
4003
  fill: "currentColor",
3857
- children: /* @__PURE__ */ Q("path", {
4004
+ children: /* @__PURE__ */ $("path", {
3858
4005
  fillRule: "evenodd",
3859
4006
  d: "M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z",
3860
4007
  clipRule: "evenodd"
3861
4008
  })
3862
4009
  });
3863
4010
  }
3864
- function Ba({ size: e = 16 }) {
3865
- return /* @__PURE__ */ Q("svg", {
4011
+ function Ja({ size: e = 16 }) {
4012
+ return /* @__PURE__ */ $("svg", {
3866
4013
  width: e,
3867
4014
  height: e,
3868
4015
  viewBox: "0 0 20 20",
3869
4016
  fill: "currentColor",
3870
4017
  "aria-hidden": !0,
3871
- children: /* @__PURE__ */ Q("path", {
4018
+ children: /* @__PURE__ */ $("path", {
3872
4019
  "fill-rule": "evenodd",
3873
4020
  d: "M1 8a2 2 0 0 1 2-2h.93a2 2 0 0 0 1.664-.89l.812-1.22A2 2 0 0 1 8.07 3h3.86a2 2 0 0 1 1.664.89l.812 1.22A2 2 0 0 0 16.07 6H17a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8Zm13.5 3a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM10 14a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",
3874
4021
  "clip-rule": "evenodd"
3875
4022
  })
3876
4023
  });
3877
4024
  }
3878
- function Va({ size: e = 16 }) {
3879
- return /* @__PURE__ */ Q("svg", {
4025
+ function Ya({ size: e = 16 }) {
4026
+ return /* @__PURE__ */ $("svg", {
3880
4027
  width: e,
3881
4028
  height: e,
3882
4029
  viewBox: "0 0 16 16",
3883
4030
  fill: "currentColor",
3884
- children: /* @__PURE__ */ Q("path", { d: "M2.87 2.298a.75.75 0 0 0-.812 1.021L3.39 6.624a1 1 0 0 0 .928.626H8.25a.75.75 0 0 1 0 1.5H4.318a1 1 0 0 0-.927.626l-1.333 3.305a.75.75 0 0 0 .811 1.022 24.89 24.89 0 0 0 11.668-5.115.75.75 0 0 0 0-1.175A24.89 24.89 0 0 0 2.869 2.298Z" })
4031
+ children: /* @__PURE__ */ $("path", { d: "M2.87 2.298a.75.75 0 0 0-.812 1.021L3.39 6.624a1 1 0 0 0 .928.626H8.25a.75.75 0 0 1 0 1.5H4.318a1 1 0 0 0-.927.626l-1.333 3.305a.75.75 0 0 0 .811 1.022 24.89 24.89 0 0 0 11.668-5.115.75.75 0 0 0 0-1.175A24.89 24.89 0 0 0 2.869 2.298Z" })
3885
4032
  });
3886
4033
  }
3887
- function Ha({ size: e = 16 }) {
3888
- return /* @__PURE__ */ Q("svg", {
4034
+ function Xa({ size: e = 16 }) {
4035
+ return /* @__PURE__ */ $("svg", {
3889
4036
  width: e,
3890
4037
  height: e,
3891
4038
  viewBox: "0 0 256 256",
3892
4039
  fill: "currentColor",
3893
4040
  "aria-hidden": !0,
3894
- children: /* @__PURE__ */ Q("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM80,108a12,12,0,1,1,12,12A12,12,0,0,1,80,108Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,176,108Zm-1.07,48c-10.29,17.79-27.4,28-46.93,28s-36.63-10.2-46.92-28a8,8,0,1,1,13.84-8c7.47,12.91,19.21,20,33.08,20s25.61-7.1,33.07-20a8,8,0,0,1,13.86,8Z" })
4041
+ children: /* @__PURE__ */ $("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM80,108a12,12,0,1,1,12,12A12,12,0,0,1,80,108Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,176,108Zm-1.07,48c-10.29,17.79-27.4,28-46.93,28s-36.63-10.2-46.92-28a8,8,0,1,1,13.84-8c7.47,12.91,19.21,20,33.08,20s25.61-7.1,33.07-20a8,8,0,0,1,13.86,8Z" })
3895
4042
  });
3896
4043
  }
3897
4044
  //#endregion
3898
4045
  //#region src/runtime/ui/fab.tsx
3899
- function Ua({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i, variant: a = "default" }) {
3900
- let o = a === "icon-only", s = r === "bottom-left" ? "markup-fab-left" : r === "bottom-center" ? "markup-fab-center" : "markup-fab-right", [c, l] = R(null), { onPointerDown: u, isDragging: d, consumeClickIfDragged: f } = Na({
4046
+ function Za({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i, variant: a = "default" }) {
4047
+ let o = a === "icon-only", s = r === "bottom-left" ? "markup-fab-left" : r === "bottom-center" ? "markup-fab-center" : "markup-fab-right", [c, l] = R(null), { onPointerDown: u, isDragging: d, consumeClickIfDragged: f } = Va({
3901
4048
  preventDefault: !0,
3902
4049
  stopPropagation: !0,
3903
4050
  onMove: l,
@@ -3916,9 +4063,9 @@ function Ua({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
3916
4063
  t();
3917
4064
  }
3918
4065
  }
3919
- return /* @__PURE__ */ Q("button", {
4066
+ return /* @__PURE__ */ $("button", {
3920
4067
  type: "button",
3921
- class: Z("markup-fab", !c && s, c && "is-floating", d && "is-dragging", e && "is-active", o && "is-icon-only"),
4068
+ class: Q("markup-fab", !c && s, c && "is-floating", d && "is-dragging", e && "is-active", o && "is-icon-only"),
3922
4069
  style: c ? {
3923
4070
  left: `${c.left}px`,
3924
4071
  top: `${c.top}px`
@@ -3927,10 +4074,10 @@ function Ua({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
3927
4074
  onPointerDown: u,
3928
4075
  "aria-label": e ? "Cancel placing markup" : "Leave a markup",
3929
4076
  "aria-pressed": e,
3930
- children: [/* @__PURE__ */ Q("span", {
4077
+ children: [/* @__PURE__ */ $("span", {
3931
4078
  class: "markup-fab-icon",
3932
- children: Q(e ? La : Ia, { size: 16 })
3933
- }), o ? null : /* @__PURE__ */ Q("span", {
4079
+ children: $(e ? Ga : Wa, { size: 16 })
4080
+ }), o ? null : /* @__PURE__ */ $("span", {
3934
4081
  class: "markup-fab-label",
3935
4082
  children: e ? "Cancel" : "Markup"
3936
4083
  })]
@@ -3938,7 +4085,7 @@ function Ua({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
3938
4085
  }
3939
4086
  //#endregion
3940
4087
  //#region src/runtime/use-focus-trap.ts
3941
- var Wa = [
4088
+ var Qa = [
3942
4089
  "a[href]",
3943
4090
  "button:not([disabled])",
3944
4091
  "input:not([disabled])",
@@ -3946,14 +4093,14 @@ var Wa = [
3946
4093
  "textarea:not([disabled])",
3947
4094
  "[tabindex]:not([tabindex=\"-1\"])"
3948
4095
  ].join(",");
3949
- function Ga(e, t) {
4096
+ function $a(e, t) {
3950
4097
  z(() => {
3951
4098
  if (!t) return;
3952
4099
  let n = e.current;
3953
4100
  if (!n) return;
3954
4101
  function r(e) {
3955
4102
  if (e.key !== "Tab") return;
3956
- let t = Array.from(n.querySelectorAll(Wa)), r = t[0], i = t[t.length - 1];
4103
+ let t = Array.from(n.querySelectorAll(Qa)), r = t[0], i = t[t.length - 1];
3957
4104
  if (!r || !i) return;
3958
4105
  let a = n.getRootNode(), o = a instanceof ShadowRoot ? a.activeElement : document.activeElement;
3959
4106
  (e.shiftKey ? o === r : o === i) && (e.preventDefault(), (e.shiftKey ? i : r).focus());
@@ -3963,7 +4110,7 @@ function Ga(e, t) {
3963
4110
  }
3964
4111
  //#endregion
3965
4112
  //#region src/runtime/use-object-url.ts
3966
- function Ka(e) {
4113
+ function eo(e) {
3967
4114
  let [t, n] = R(null);
3968
4115
  return z(() => {
3969
4116
  if (!e) {
@@ -3976,7 +4123,7 @@ function Ka(e) {
3976
4123
  }
3977
4124
  //#endregion
3978
4125
  //#region src/runtime/ui/author-prompt.tsx
3979
- function qa({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit: r, onCancel: i, onSignIn: a }) {
4126
+ function to({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit: r, onCancel: i, onSignIn: a }) {
3980
4127
  let [o, s] = R(""), [c, l] = R(""), u = B(null);
3981
4128
  z(() => {
3982
4129
  u.current?.focus();
@@ -3987,24 +4134,24 @@ function qa({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit:
3987
4134
  !i || e || t || r(i, c.trim() || void 0);
3988
4135
  }
3989
4136
  let f = e || t;
3990
- return /* @__PURE__ */ Q("form", {
4137
+ return /* @__PURE__ */ $("form", {
3991
4138
  class: "markup-author-prompt",
3992
4139
  onSubmit: d,
3993
4140
  children: [
3994
- a ? /* @__PURE__ */ Q(S, { children: [/* @__PURE__ */ Q("button", {
4141
+ a ? /* @__PURE__ */ $(S, { children: [/* @__PURE__ */ $("button", {
3995
4142
  type: "button",
3996
4143
  class: "markup-btn markup-btn-primary",
3997
4144
  onClick: a,
3998
4145
  disabled: e || n,
3999
4146
  children: n ? "Signing in…" : "Sign in with Markup"
4000
- }), /* @__PURE__ */ Q("p", {
4147
+ }), /* @__PURE__ */ $("p", {
4001
4148
  class: "markup-author-divider",
4002
4149
  children: "or continue as a guest"
4003
- })] }) : /* @__PURE__ */ Q("p", {
4150
+ })] }) : /* @__PURE__ */ $("p", {
4004
4151
  class: "markup-eyebrow",
4005
4152
  children: "who's leaving feedback?"
4006
4153
  }),
4007
- /* @__PURE__ */ Q("input", {
4154
+ /* @__PURE__ */ $("input", {
4008
4155
  ref: u,
4009
4156
  class: "markup-input",
4010
4157
  type: "text",
@@ -4017,7 +4164,7 @@ function qa({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit:
4017
4164
  disabled: f,
4018
4165
  "data-1p-ignore": !0
4019
4166
  }),
4020
- /* @__PURE__ */ Q("input", {
4167
+ /* @__PURE__ */ $("input", {
4021
4168
  class: "markup-input",
4022
4169
  type: "email",
4023
4170
  name: "email",
@@ -4029,21 +4176,21 @@ function qa({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit:
4029
4176
  disabled: f,
4030
4177
  "data-1p-ignore": !0
4031
4178
  }),
4032
- t ? /* @__PURE__ */ Q("p", {
4179
+ t ? /* @__PURE__ */ $("p", {
4033
4180
  class: "markup-author-status",
4034
4181
  role: "status",
4035
4182
  "aria-live": "polite",
4036
4183
  children: "Connecting…"
4037
4184
  }) : null,
4038
- /* @__PURE__ */ Q("div", {
4185
+ /* @__PURE__ */ $("div", {
4039
4186
  class: "markup-composer-actions",
4040
- children: [/* @__PURE__ */ Q("button", {
4187
+ children: [/* @__PURE__ */ $("button", {
4041
4188
  type: "button",
4042
4189
  class: "markup-btn markup-btn-ghost",
4043
4190
  onClick: i,
4044
4191
  disabled: e,
4045
4192
  children: "Cancel"
4046
- }), /* @__PURE__ */ Q("button", {
4193
+ }), /* @__PURE__ */ $("button", {
4047
4194
  type: "submit",
4048
4195
  class: "markup-btn markup-btn-primary",
4049
4196
  disabled: !o.trim() || f,
@@ -4055,8 +4202,8 @@ function qa({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit:
4055
4202
  }
4056
4203
  //#endregion
4057
4204
  //#region src/runtime/ui/composer.tsx
4058
- var Ja = 4e3;
4059
- function Ya({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o }) {
4205
+ var no = 4e3;
4206
+ function ro({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o }) {
4060
4207
  let [s, c] = R(""), l = B(null), u = B(!1);
4061
4208
  z(() => {
4062
4209
  r && l.current?.focus();
@@ -4066,7 +4213,7 @@ function Ya({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
4066
4213
  }, [s]), z(() => {
4067
4214
  u.current && !i && !a && (c(""), l.current?.focus()), u.current = i;
4068
4215
  }, [i, a]);
4069
- let d = Ja - s.length, f = d < 0;
4216
+ let d = no - s.length, f = d < 0;
4070
4217
  function p(e) {
4071
4218
  e?.preventDefault();
4072
4219
  let t = s.trim();
@@ -4077,53 +4224,53 @@ function Ya({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
4077
4224
  }
4078
4225
  let h = s.length > 0;
4079
4226
  function g(e) {
4080
- return /* @__PURE__ */ Q("button", {
4227
+ return /* @__PURE__ */ $("button", {
4081
4228
  type: "submit",
4082
4229
  class: "markup-btn markup-btn-primary",
4083
4230
  disabled: i || !s.trim() || f,
4084
4231
  "aria-label": i ? "Sending…" : n,
4085
4232
  title: i ? "Sending…" : n,
4086
4233
  tabIndex: e,
4087
- children: /* @__PURE__ */ Q(Va, { size: 14 })
4234
+ children: /* @__PURE__ */ $(Ya, { size: 14 })
4088
4235
  });
4089
4236
  }
4090
- return /* @__PURE__ */ Q("form", {
4091
- class: Z("markup-composer", h && "is-filled"),
4237
+ return /* @__PURE__ */ $("form", {
4238
+ class: Q("markup-composer", h && "is-filled"),
4092
4239
  onSubmit: p,
4093
4240
  children: [
4094
- /* @__PURE__ */ Q("textarea", {
4241
+ /* @__PURE__ */ $("textarea", {
4095
4242
  ref: l,
4096
4243
  name: "reply",
4097
4244
  class: "markup-composer-input",
4098
4245
  placeholder: t,
4099
4246
  rows: h ? 2 : 1,
4100
- maxLength: Ja + 100,
4247
+ maxLength: no + 100,
4101
4248
  value: s,
4102
4249
  onInput: (e) => c(e.currentTarget.value),
4103
4250
  onKeyDown: m,
4104
4251
  disabled: i,
4105
4252
  "aria-label": e
4106
4253
  }),
4107
- /* @__PURE__ */ Q("div", {
4254
+ /* @__PURE__ */ $("div", {
4108
4255
  class: "markup-composer-footer-wrap",
4109
- children: /* @__PURE__ */ Q("div", {
4256
+ children: /* @__PURE__ */ $("div", {
4110
4257
  class: "markup-composer-footer",
4111
- children: [/* @__PURE__ */ Q("span", {
4258
+ children: [/* @__PURE__ */ $("span", {
4112
4259
  class: "markup-composer-hint",
4113
- children: a ? /* @__PURE__ */ Q("span", {
4260
+ children: a ? /* @__PURE__ */ $("span", {
4114
4261
  class: "markup-composer-error",
4115
4262
  children: a
4116
- }) : f ? /* @__PURE__ */ Q("span", {
4263
+ }) : f ? /* @__PURE__ */ $("span", {
4117
4264
  class: "markup-composer-error",
4118
4265
  children: [Math.abs(d), " too long"]
4119
- }) : /* @__PURE__ */ Q("span", { children: "⌘↵ to send" })
4120
- }), /* @__PURE__ */ Q("div", {
4266
+ }) : /* @__PURE__ */ $("span", { children: "⌘↵ to send" })
4267
+ }), /* @__PURE__ */ $("div", {
4121
4268
  class: "markup-composer-actions",
4122
4269
  children: g(h ? void 0 : -1)
4123
4270
  })]
4124
4271
  })
4125
4272
  }),
4126
- /* @__PURE__ */ Q("span", {
4273
+ /* @__PURE__ */ $("span", {
4127
4274
  class: "markup-composer-actions-empty",
4128
4275
  "aria-hidden": h || void 0,
4129
4276
  children: g(h ? -1 : void 0)
@@ -4133,10 +4280,10 @@ function Ya({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
4133
4280
  }
4134
4281
  //#endregion
4135
4282
  //#region src/runtime/ui/new-thread-popover.tsx
4136
- function Xa({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolving: i, isSigningIn: a, isPending: o, error: s, screenshot: c, isScreenshotCapturing: l, screenshotRedactedCount: u, screenshotRedactedSelectors: d, onAuthor: f, onSignIn: p, onSubmit: m, onClose: h }) {
4283
+ function io({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolving: i, isSigningIn: a, isPending: o, error: s, screenshot: c, isScreenshotCapturing: l, screenshotRedactedCount: u, screenshotRedactedSelectors: d, onAuthor: f, onSignIn: p, onSubmit: m, onClose: h }) {
4137
4284
  let g = B(null);
4138
- Ga(g, !0);
4139
- let [_, v] = R(!1), [y, b] = R(!1), x = Ka(c), [C, w] = R(null), { onPointerDown: T, isDragging: E } = Na({
4285
+ $a(g, !0);
4286
+ let [_, v] = R(!1), [y, b] = R(!1), x = eo(c), [C, w] = R(null), { onPointerDown: T, isDragging: E } = Va({
4140
4287
  targetRef: g,
4141
4288
  shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
4142
4289
  onMove: w
@@ -4152,10 +4299,10 @@ function Xa({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4152
4299
  }
4153
4300
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
4154
4301
  }, [h]);
4155
- let D = Za(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), O = Za(t - window.scrollY - 16, 12, window.innerHeight - 220), k = c != null, A = l || k;
4156
- return /* @__PURE__ */ Q("div", {
4302
+ let D = ao(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), O = ao(t - window.scrollY - 16, 12, window.innerHeight - 220), k = c != null, A = l || k;
4303
+ return /* @__PURE__ */ $("div", {
4157
4304
  ref: g,
4158
- class: Z("markup-popover", C && "is-floating", E && "is-dragging"),
4305
+ class: Q("markup-popover", C && "is-floating", E && "is-dragging"),
4159
4306
  popover: "auto",
4160
4307
  style: {
4161
4308
  "--markup-pop-x": `${C?.left ?? D}px`,
@@ -4163,44 +4310,44 @@ function Xa({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4163
4310
  },
4164
4311
  role: "dialog",
4165
4312
  "aria-label": "New markup",
4166
- children: [/* @__PURE__ */ Q("header", {
4313
+ children: [/* @__PURE__ */ $("header", {
4167
4314
  class: "markup-popover-header",
4168
4315
  onPointerDown: T,
4169
- children: [/* @__PURE__ */ Q("span", {
4316
+ children: [/* @__PURE__ */ $("span", {
4170
4317
  class: "markup-eyebrow",
4171
4318
  children: "new · markup"
4172
- }), /* @__PURE__ */ Q("button", {
4319
+ }), /* @__PURE__ */ $("button", {
4173
4320
  type: "button",
4174
4321
  class: "markup-icon-btn",
4175
4322
  "aria-label": "Discard pin",
4176
4323
  onClick: h,
4177
- children: /* @__PURE__ */ Q(La, { size: 16 })
4324
+ children: /* @__PURE__ */ $(Ga, { size: 16 })
4178
4325
  })]
4179
- }), n == null ? /* @__PURE__ */ Q(qa, {
4326
+ }), n == null ? /* @__PURE__ */ $(to, {
4180
4327
  isPending: o,
4181
4328
  isConnecting: i,
4182
4329
  isSigningIn: a,
4183
4330
  onSubmit: f,
4184
4331
  onCancel: h,
4185
4332
  onSignIn: p
4186
- }) : /* @__PURE__ */ Q("div", {
4333
+ }) : /* @__PURE__ */ $("div", {
4187
4334
  class: "markup-popover-body",
4188
4335
  children: [
4189
- /* @__PURE__ */ Q("p", {
4336
+ /* @__PURE__ */ $("p", {
4190
4337
  class: "markup-popover-byline",
4191
4338
  children: [
4192
4339
  "posting as ",
4193
- /* @__PURE__ */ Q("span", {
4340
+ /* @__PURE__ */ $("span", {
4194
4341
  class: "markup-popover-name",
4195
4342
  children: n
4196
4343
  }),
4197
- r ? /* @__PURE__ */ Q("span", {
4344
+ r ? /* @__PURE__ */ $("span", {
4198
4345
  class: "markup-comment-badge",
4199
4346
  children: "team"
4200
4347
  }) : null
4201
4348
  ]
4202
4349
  }),
4203
- /* @__PURE__ */ Q(Ya, {
4350
+ /* @__PURE__ */ $(ro, {
4204
4351
  label: "Feedback",
4205
4352
  placeholder: "What's wrong, missing, or worth noting?",
4206
4353
  submitLabel: "Post markup",
@@ -4208,44 +4355,44 @@ function Xa({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4208
4355
  error: s,
4209
4356
  onSubmit: (e) => m(e, _ && k)
4210
4357
  }),
4211
- A ? /* @__PURE__ */ Q("div", {
4358
+ A ? /* @__PURE__ */ $("div", {
4212
4359
  class: "markup-screenshot-row",
4213
- children: [l ? /* @__PURE__ */ Q("span", {
4360
+ children: [l ? /* @__PURE__ */ $("span", {
4214
4361
  class: "markup-screenshot-status",
4215
4362
  children: [
4216
- /* @__PURE__ */ Q("input", {
4363
+ /* @__PURE__ */ $("input", {
4217
4364
  type: "checkbox",
4218
4365
  class: "markup-screenshot-checkbox",
4219
4366
  disabled: !0
4220
4367
  }),
4221
- /* @__PURE__ */ Q(Ba, { size: 12 }),
4222
- /* @__PURE__ */ Q("span", { children: "Capturing…" })
4368
+ /* @__PURE__ */ $(Ja, { size: 12 }),
4369
+ /* @__PURE__ */ $("span", { children: "Capturing…" })
4223
4370
  ]
4224
- }) : /* @__PURE__ */ Q("label", {
4371
+ }) : /* @__PURE__ */ $("label", {
4225
4372
  class: "markup-screenshot-toggle",
4226
4373
  children: [
4227
- /* @__PURE__ */ Q("input", {
4374
+ /* @__PURE__ */ $("input", {
4228
4375
  type: "checkbox",
4229
4376
  class: "markup-screenshot-checkbox",
4230
4377
  checked: _,
4231
4378
  onChange: (e) => v(e.currentTarget.checked)
4232
4379
  }),
4233
- /* @__PURE__ */ Q(Ba, { size: 12 }),
4234
- /* @__PURE__ */ Q("span", { children: "Attach screenshot" }),
4235
- x && _ ? /* @__PURE__ */ Q("img", {
4380
+ /* @__PURE__ */ $(Ja, { size: 12 }),
4381
+ /* @__PURE__ */ $("span", { children: "Attach screenshot" }),
4382
+ x && _ ? /* @__PURE__ */ $("img", {
4236
4383
  class: "markup-screenshot-thumb",
4237
4384
  src: x,
4238
4385
  alt: "Screenshot preview"
4239
4386
  }) : null
4240
4387
  ]
4241
- }), _ && k ? /* @__PURE__ */ Q(S, { children: [u > 0 ? /* @__PURE__ */ Q("div", {
4388
+ }), _ && k ? /* @__PURE__ */ $(S, { children: [u > 0 ? /* @__PURE__ */ $("div", {
4242
4389
  class: "markup-screenshot-redacted",
4243
- children: [/* @__PURE__ */ Q("button", {
4390
+ children: [/* @__PURE__ */ $("button", {
4244
4391
  type: "button",
4245
4392
  class: "markup-screenshot-redacted-chip",
4246
4393
  onClick: () => b((e) => !e),
4247
4394
  children: [
4248
- /* @__PURE__ */ Q("em", {
4395
+ /* @__PURE__ */ $("em", {
4249
4396
  class: "markup-screenshot-redacted-arrow",
4250
4397
  children: y ? "▾" : "▸"
4251
4398
  }),
@@ -4254,19 +4401,19 @@ function Xa({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4254
4401
  u === 1 ? "field" : "fields",
4255
4402
  " redacted"
4256
4403
  ]
4257
- }), y ? /* @__PURE__ */ Q("div", {
4404
+ }), y ? /* @__PURE__ */ $("div", {
4258
4405
  class: "markup-screenshot-redacted-list",
4259
- children: d.map((e) => /* @__PURE__ */ Q("code", {
4406
+ children: d.map((e) => /* @__PURE__ */ $("code", {
4260
4407
  class: "markup-screenshot-redacted-selector",
4261
4408
  children: e
4262
4409
  }, e))
4263
4410
  }) : null]
4264
- }) : null, /* @__PURE__ */ Q("p", {
4411
+ }) : null, /* @__PURE__ */ $("p", {
4265
4412
  class: "markup-screenshot-help",
4266
4413
  children: [
4267
4414
  "Password and credit-card fields are blacked out automatically. Add",
4268
4415
  " ",
4269
- /* @__PURE__ */ Q("code", {
4416
+ /* @__PURE__ */ $("code", {
4270
4417
  class: "markup-screenshot-help-code",
4271
4418
  children: "data-markup-private"
4272
4419
  }),
@@ -4278,16 +4425,16 @@ function Xa({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4278
4425
  })]
4279
4426
  });
4280
4427
  }
4281
- function Za(e, t, n) {
4428
+ function ao(e, t, n) {
4282
4429
  return Math.max(t, Math.min(n, e));
4283
4430
  }
4284
4431
  //#endregion
4285
4432
  //#region src/runtime/ui/pin.tsx
4286
- function Qa({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClick: a }) {
4433
+ function oo({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClick: a }) {
4287
4434
  let o = t - window.scrollY, s = e - window.scrollX;
4288
- return /* @__PURE__ */ Q("button", {
4435
+ return /* @__PURE__ */ $("button", {
4289
4436
  type: "button",
4290
- class: Z("markup-pin", r && "is-active is-anchor", i && "is-unresolved"),
4437
+ class: Q("markup-pin", r && "is-active is-anchor", i && "is-unresolved"),
4291
4438
  style: {
4292
4439
  top: `${o}px`,
4293
4440
  left: `${s}px`
@@ -4297,24 +4444,24 @@ function Qa({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClic
4297
4444
  onClick: a,
4298
4445
  "aria-label": `Open feedback thread (${n} comment${n === 1 ? "" : "s"})`,
4299
4446
  title: `Open feedback thread (${n} comment${n === 1 ? "" : "s"})`,
4300
- children: [/* @__PURE__ */ Q("span", {
4447
+ children: [/* @__PURE__ */ $("span", {
4301
4448
  class: "markup-pin-dot",
4302
4449
  "aria-hidden": !0
4303
- }), n > 1 ? /* @__PURE__ */ Q("span", {
4450
+ }), n > 1 ? /* @__PURE__ */ $("span", {
4304
4451
  class: "markup-pin-count",
4305
4452
  children: n
4306
4453
  }) : null]
4307
4454
  });
4308
4455
  }
4309
- function $a({ pageX: e, pageY: t }) {
4456
+ function so({ pageX: e, pageY: t }) {
4310
4457
  let n = t - window.scrollY, r = e - window.scrollX;
4311
- return /* @__PURE__ */ Q("div", {
4458
+ return /* @__PURE__ */ $("div", {
4312
4459
  class: "markup-pin markup-pin-ghost is-anchor",
4313
4460
  style: {
4314
4461
  top: `${n}px`,
4315
4462
  left: `${r}px`
4316
4463
  },
4317
- children: /* @__PURE__ */ Q("span", {
4464
+ children: /* @__PURE__ */ $("span", {
4318
4465
  class: "markup-pin-dot",
4319
4466
  "aria-hidden": !0
4320
4467
  })
@@ -4322,7 +4469,7 @@ function $a({ pageX: e, pageY: t }) {
4322
4469
  }
4323
4470
  //#endregion
4324
4471
  //#region src/runtime/ui/placement-overlay.tsx
4325
- function eo({ onPlace: e, onCancel: t }) {
4472
+ function co({ onPlace: e, onCancel: t }) {
4326
4473
  z(() => {
4327
4474
  function e(e) {
4328
4475
  e.key === "Escape" && t();
@@ -4330,32 +4477,32 @@ function eo({ onPlace: e, onCancel: t }) {
4330
4477
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
4331
4478
  }, [t]);
4332
4479
  function n(t) {
4333
- t.stopPropagation(), t.preventDefault(), e(kr(t, document.elementsFromPoint(t.clientX, t.clientY).find((e) => !e.shadowRoot) ?? null), t.clientX, t.clientY);
4480
+ t.stopPropagation(), t.preventDefault(), e(Fr(t, document.elementsFromPoint(t.clientX, t.clientY).find((e) => !e.shadowRoot) ?? null), t.clientX, t.clientY);
4334
4481
  }
4335
4482
  function r(e) {
4336
4483
  e.preventDefault(), e.stopPropagation();
4337
4484
  }
4338
- return /* @__PURE__ */ Q("div", {
4485
+ return /* @__PURE__ */ $("div", {
4339
4486
  class: "markup-placement-overlay",
4340
4487
  onPointerDown: r,
4341
4488
  onClick: n,
4342
4489
  role: "presentation",
4343
- children: /* @__PURE__ */ Q("div", {
4490
+ children: /* @__PURE__ */ $("div", {
4344
4491
  class: "markup-placement-cursor-help",
4345
- children: /* @__PURE__ */ Q("span", { children: "Click anywhere to drop a pin · ESC to cancel" })
4492
+ children: /* @__PURE__ */ $("span", { children: "Click anywhere to drop a pin · ESC to cancel" })
4346
4493
  })
4347
4494
  });
4348
4495
  }
4349
4496
  //#endregion
4350
4497
  //#region src/runtime/ui/thread-popover.tsx
4351
- var to = [
4498
+ var lo = [
4352
4499
  "👍",
4353
4500
  "❤️",
4354
4501
  "🎉",
4355
4502
  "😮",
4356
4503
  "😄",
4357
4504
  "❓"
4358
- ], no = ar({
4505
+ ], uo = dr({
4359
4506
  none: {
4360
4507
  "toggle-thread-menu": () => ({
4361
4508
  kind: "thread-menu",
@@ -4411,14 +4558,14 @@ var to = [
4411
4558
  dismiss: () => ({ kind: "none" })
4412
4559
  }
4413
4560
  });
4414
- function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIdentityResolving: i, isSigningIn: a, canDelete: o, isPending: s, error: c, isHidden: l = !1, onAuthor: u, onSignIn: d, onClose: f, onReply: p, onEditComment: m, onDeleteComment: h, onToggleReaction: g, onResolve: _, onDelete: v }) {
4415
- let y = B(null), b = B(null), x = B(null), S = B(null), [C, w] = or(no, { kind: "none" }), [T, E] = R(null), { onPointerDown: D, isDragging: O } = Na({
4561
+ function fo({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIdentityResolving: i, isSigningIn: a, canDelete: o, isPending: s, error: c, isHidden: l = !1, onAuthor: u, onSignIn: d, onClose: f, onReply: p, onEditComment: m, onDeleteComment: h, onToggleReaction: g, onResolve: _, onDelete: v }) {
4562
+ let y = B(null), b = B(null), x = B(null), S = B(null), [C, w] = fr(uo, { kind: "none" }), [T, E] = R(null), { onPointerDown: D, isDragging: O } = Va({
4416
4563
  targetRef: y,
4417
4564
  shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
4418
4565
  onMove: E
4419
4566
  });
4420
- Ga(y, !0);
4421
- let k = e.resolvedAt != null, A = Ce(() => e.comments.filter((e) => !e.deleted), [e.comments]);
4567
+ $a(y, !0);
4568
+ let k = e.resolvedAt != null, A = Ae(() => e.comments.filter((e) => !e.deleted), [e.comments]);
4422
4569
  z(() => {
4423
4570
  if (C.kind === "none" || C.kind === "editing") return;
4424
4571
  function e(e) {
@@ -4456,25 +4603,25 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4456
4603
  }
4457
4604
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
4458
4605
  }, [f]);
4459
- let M = Ce(() => {
4460
- let t = Ar({
4606
+ let M = Ae(() => {
4607
+ let t = Ir({
4461
4608
  anchorX: e.anchorX,
4462
4609
  anchorY: e.anchorY,
4463
4610
  anchorSelector: e.anchorSelector
4464
4611
  });
4465
4612
  return {
4466
- left: so(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
4467
- top: so(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
4613
+ left: go(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
4614
+ top: go(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
4468
4615
  };
4469
4616
  }, [
4470
4617
  e.anchorX,
4471
4618
  e.anchorY,
4472
4619
  e.anchorSelector
4473
4620
  ]);
4474
- return /* @__PURE__ */ Q("div", {
4621
+ return /* @__PURE__ */ $("div", {
4475
4622
  ref: y,
4476
4623
  id: "markup-thread-popover",
4477
- class: Z("markup-popover", T && "is-floating", O && "is-dragging", l && "is-hud-hidden"),
4624
+ class: Q("markup-popover", T && "is-floating", O && "is-dragging", l && "is-hud-hidden"),
4478
4625
  popover: "auto",
4479
4626
  style: {
4480
4627
  "--markup-pop-x": `${T?.left ?? M.left}px`,
@@ -4484,10 +4631,10 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4484
4631
  "aria-label": "Markup thread",
4485
4632
  "aria-hidden": l || void 0,
4486
4633
  children: [
4487
- /* @__PURE__ */ Q("header", {
4634
+ /* @__PURE__ */ $("header", {
4488
4635
  class: "markup-popover-header",
4489
4636
  onPointerDown: D,
4490
- children: [/* @__PURE__ */ Q("span", {
4637
+ children: [/* @__PURE__ */ $("span", {
4491
4638
  class: "markup-eyebrow",
4492
4639
  children: [
4493
4640
  "thread · ",
@@ -4495,23 +4642,23 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4495
4642
  " ",
4496
4643
  A.length === 1 ? "comment" : "comments"
4497
4644
  ]
4498
- }), /* @__PURE__ */ Q("div", {
4645
+ }), /* @__PURE__ */ $("div", {
4499
4646
  class: "markup-popover-header-actions",
4500
4647
  children: [
4501
- /* @__PURE__ */ Q("div", {
4648
+ /* @__PURE__ */ $("div", {
4502
4649
  class: "markup-thread-menu",
4503
4650
  ref: (e) => {
4504
4651
  C.kind === "thread-menu" && (S.current = e);
4505
4652
  },
4506
- children: [/* @__PURE__ */ Q("button", {
4653
+ children: [/* @__PURE__ */ $("button", {
4507
4654
  type: "button",
4508
- class: Z("markup-icon-btn", C.kind === "thread-menu" && "is-open"),
4655
+ class: Q("markup-icon-btn", C.kind === "thread-menu" && "is-open"),
4509
4656
  title: "More options",
4510
4657
  onClick: () => w({ type: "toggle-thread-menu" }),
4511
- children: /* @__PURE__ */ Q(Ra, { size: 16 })
4512
- }), C.kind === "thread-menu" ? /* @__PURE__ */ Q("div", {
4658
+ children: /* @__PURE__ */ $(Ka, { size: 16 })
4659
+ }), C.kind === "thread-menu" ? /* @__PURE__ */ $("div", {
4513
4660
  class: "markup-thread-menu-list",
4514
- children: [/* @__PURE__ */ Q("button", {
4661
+ children: [/* @__PURE__ */ $("button", {
4515
4662
  type: "button",
4516
4663
  class: "markup-thread-menu-item",
4517
4664
  onClick: () => {
@@ -4519,9 +4666,9 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4519
4666
  t.hash = `markup-thread=${e._id}`, navigator.clipboard.writeText(t.toString()).catch(() => {}), w({ type: "dismiss" });
4520
4667
  },
4521
4668
  children: "Copy link"
4522
- }), o ? /* @__PURE__ */ Q("button", {
4669
+ }), o ? /* @__PURE__ */ $("button", {
4523
4670
  type: "button",
4524
- class: Z("markup-thread-menu-item", C.confirmDelete && "is-danger"),
4671
+ class: Q("markup-thread-menu-item", C.confirmDelete && "is-danger"),
4525
4672
  disabled: s,
4526
4673
  onClick: () => {
4527
4674
  C.kind === "thread-menu" && (C.confirmDelete ? (w({ type: "dismiss" }), v()) : w({ type: "arm-thread-delete" }));
@@ -4530,52 +4677,52 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4530
4677
  }) : null]
4531
4678
  }) : null]
4532
4679
  }),
4533
- r ? /* @__PURE__ */ Q("button", {
4680
+ r ? /* @__PURE__ */ $("button", {
4534
4681
  type: "button",
4535
4682
  class: "markup-icon-btn",
4536
4683
  title: "Mark as resolved",
4537
4684
  disabled: s,
4538
4685
  onClick: _,
4539
- children: /* @__PURE__ */ Q(za, { size: 16 })
4686
+ children: /* @__PURE__ */ $(qa, { size: 16 })
4540
4687
  }) : null,
4541
- /* @__PURE__ */ Q("button", {
4688
+ /* @__PURE__ */ $("button", {
4542
4689
  type: "button",
4543
4690
  class: "markup-icon-btn",
4544
4691
  title: "Close thread",
4545
4692
  onClick: f,
4546
- children: /* @__PURE__ */ Q(La, { size: 16 })
4693
+ children: /* @__PURE__ */ $(Ga, { size: 16 })
4547
4694
  })
4548
4695
  ]
4549
4696
  })]
4550
4697
  }),
4551
- /* @__PURE__ */ Q("ol", {
4698
+ /* @__PURE__ */ $("ol", {
4552
4699
  ref: b,
4553
4700
  class: "markup-comments",
4554
4701
  children: A.map((t, r) => {
4555
4702
  let i = !t.fromDashboard && n != null && t.authorClientId === n, a = r === 0, o = i && !k && !t.deleted, c = i && !k && !t.deleted && !a, l = C.kind === "editing" && C.commentId === t._id, u = (o || c) && !l && !t.deleted, d = C.kind === "comment-menu" && C.commentId === t._id, f = d && C.confirmDelete, p = C.kind === "reaction-picker" && C.commentId === t._id, _ = p ? C.direction : "down", v = d ? C.direction : "down";
4556
- return /* @__PURE__ */ Q("li", {
4557
- class: Z("markup-comment", t.fromDashboard && "is-team"),
4703
+ return /* @__PURE__ */ $("li", {
4704
+ class: Q("markup-comment", t.fromDashboard && "is-team"),
4558
4705
  children: [
4559
- /* @__PURE__ */ Q("div", {
4706
+ /* @__PURE__ */ $("div", {
4560
4707
  class: "markup-comment-meta",
4561
4708
  children: [
4562
- /* @__PURE__ */ Q("span", {
4709
+ /* @__PURE__ */ $("span", {
4563
4710
  class: "markup-comment-author",
4564
4711
  children: t.authorName
4565
4712
  }),
4566
- t.fromDashboard ? /* @__PURE__ */ Q("span", {
4713
+ t.fromDashboard ? /* @__PURE__ */ $("span", {
4567
4714
  class: "markup-comment-badge",
4568
4715
  children: "team"
4569
4716
  }) : null,
4570
- /* @__PURE__ */ Q("time", {
4717
+ /* @__PURE__ */ $("time", {
4571
4718
  class: "markup-comment-time",
4572
4719
  datetime: new Date(t.createdAt).toISOString(),
4573
- title: lo(t.createdAt),
4574
- children: co(t.createdAt)
4720
+ title: vo(t.createdAt),
4721
+ children: _o(t.createdAt)
4575
4722
  }),
4576
- /* @__PURE__ */ Q("div", {
4723
+ /* @__PURE__ */ $("div", {
4577
4724
  class: "markup-thread-actions",
4578
- children: [!k && !l ? /* @__PURE__ */ Q(io, {
4725
+ children: [!k && !l ? /* @__PURE__ */ $(po, {
4579
4726
  comment: t,
4580
4727
  pickerOpen: p,
4581
4728
  pickerDirection: _,
@@ -4610,14 +4757,14 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4610
4757
  onPickerSelect: (e) => {
4611
4758
  w({ type: "dismiss" }), g(t._id, e);
4612
4759
  }
4613
- }) : null, u ? /* @__PURE__ */ Q("div", {
4614
- class: Z("markup-thread-menu markup-comment-menu", d && "is-open", d && v === "up" && "is-up", A.length === 1 && "is-side"),
4760
+ }) : null, u ? /* @__PURE__ */ $("div", {
4761
+ class: Q("markup-thread-menu markup-comment-menu", d && "is-open", d && v === "up" && "is-up", A.length === 1 && "is-side"),
4615
4762
  ref: (e) => {
4616
4763
  d && (S.current = e);
4617
4764
  },
4618
- children: [/* @__PURE__ */ Q("button", {
4765
+ children: [/* @__PURE__ */ $("button", {
4619
4766
  type: "button",
4620
- class: Z("markup-icon-btn", d && "is-open"),
4767
+ class: Q("markup-icon-btn", d && "is-open"),
4621
4768
  title: "More options",
4622
4769
  onClick: (e) => {
4623
4770
  if (d) {
@@ -4643,10 +4790,10 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4643
4790
  direction: a < i ? "up" : "down"
4644
4791
  });
4645
4792
  },
4646
- children: /* @__PURE__ */ Q(Ra, { size: 16 })
4647
- }), d ? /* @__PURE__ */ Q("div", {
4793
+ children: /* @__PURE__ */ $(Ka, { size: 16 })
4794
+ }), d ? /* @__PURE__ */ $("div", {
4648
4795
  class: "markup-thread-menu-list",
4649
- children: [o ? /* @__PURE__ */ Q("button", {
4796
+ children: [o ? /* @__PURE__ */ $("button", {
4650
4797
  type: "button",
4651
4798
  class: "markup-thread-menu-item",
4652
4799
  onClick: () => {
@@ -4657,9 +4804,9 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4657
4804
  });
4658
4805
  },
4659
4806
  children: "Edit"
4660
- }) : null, c ? /* @__PURE__ */ Q("button", {
4807
+ }) : null, c ? /* @__PURE__ */ $("button", {
4661
4808
  type: "button",
4662
- class: Z("markup-thread-menu-item", f && "is-danger"),
4809
+ class: Q("markup-thread-menu-item", f && "is-danger"),
4663
4810
  onClick: () => {
4664
4811
  C.kind === "comment-menu" && (C.confirmDelete ? (w({ type: "dismiss" }), h(t._id)) : w({ type: "arm-comment-delete" }));
4665
4812
  },
@@ -4670,7 +4817,7 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4670
4817
  })
4671
4818
  ]
4672
4819
  }),
4673
- l && C.kind === "editing" ? /* @__PURE__ */ Q("form", {
4820
+ l && C.kind === "editing" ? /* @__PURE__ */ $("form", {
4674
4821
  class: "markup-comment-edit-form",
4675
4822
  onSubmit: async (e) => {
4676
4823
  if (e.preventDefault(), C.kind !== "editing") return;
@@ -4683,7 +4830,7 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4683
4830
  await m(t._id, n), w({ type: "dismiss" });
4684
4831
  } catch {}
4685
4832
  },
4686
- children: [/* @__PURE__ */ Q("textarea", {
4833
+ children: [/* @__PURE__ */ $("textarea", {
4687
4834
  class: "markup-textarea",
4688
4835
  value: C.draft,
4689
4836
  onInput: (e) => {
@@ -4695,40 +4842,40 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4695
4842
  rows: 3,
4696
4843
  autoFocus: !0,
4697
4844
  disabled: s
4698
- }), /* @__PURE__ */ Q("div", {
4845
+ }), /* @__PURE__ */ $("div", {
4699
4846
  class: "markup-comment-edit-actions",
4700
- children: [/* @__PURE__ */ Q("button", {
4847
+ children: [/* @__PURE__ */ $("button", {
4701
4848
  type: "button",
4702
4849
  class: "markup-btn markup-btn-ghost",
4703
4850
  onClick: () => w({ type: "dismiss" }),
4704
4851
  disabled: s,
4705
4852
  children: "Cancel"
4706
- }), /* @__PURE__ */ Q("button", {
4853
+ }), /* @__PURE__ */ $("button", {
4707
4854
  type: "submit",
4708
4855
  class: "markup-btn markup-btn-primary",
4709
4856
  disabled: s || C.draft.trim().length === 0,
4710
4857
  children: "Save"
4711
4858
  })]
4712
4859
  })]
4713
- }) : /* @__PURE__ */ Q("p", {
4860
+ }) : /* @__PURE__ */ $("p", {
4714
4861
  class: "markup-comment-body",
4715
- children: [t.body, t.editedAt == null ? null : /* @__PURE__ */ Q("time", {
4862
+ children: [t.body, t.editedAt == null ? null : /* @__PURE__ */ $("time", {
4716
4863
  class: "markup-comment-edited",
4717
4864
  datetime: new Date(t.editedAt).toISOString(),
4718
- title: lo(t.editedAt),
4865
+ title: vo(t.editedAt),
4719
4866
  children: [" ", "(edited)"]
4720
4867
  })]
4721
4868
  }),
4722
- r === 0 && e.screenshotUrl ? /* @__PURE__ */ Q("button", {
4869
+ r === 0 && e.screenshotUrl ? /* @__PURE__ */ $("button", {
4723
4870
  type: "button",
4724
4871
  class: "markup-comment-screenshot",
4725
4872
  onClick: () => x.current?.showModal(),
4726
- children: /* @__PURE__ */ Q("img", {
4873
+ children: /* @__PURE__ */ $("img", {
4727
4874
  src: e.screenshotUrl,
4728
4875
  alt: "Screenshot"
4729
4876
  })
4730
4877
  }) : null,
4731
- !l && t.reactions.length > 0 ? /* @__PURE__ */ Q(ao, {
4878
+ !l && t.reactions.length > 0 ? /* @__PURE__ */ $(mo, {
4732
4879
  comment: t,
4733
4880
  isResolved: k,
4734
4881
  onToggle: (e) => g(t._id, e)
@@ -4737,48 +4884,48 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4737
4884
  }, t._id);
4738
4885
  })
4739
4886
  }),
4740
- e.screenshotUrl ? /* @__PURE__ */ Q("dialog", {
4887
+ e.screenshotUrl ? /* @__PURE__ */ $("dialog", {
4741
4888
  ref: x,
4742
4889
  class: "markup-lightbox",
4743
4890
  onClick: () => x.current?.close(),
4744
- children: [/* @__PURE__ */ Q("button", {
4891
+ children: [/* @__PURE__ */ $("button", {
4745
4892
  type: "button",
4746
4893
  class: "markup-lightbox-close markup-icon-btn",
4747
4894
  "aria-label": "Close screenshot",
4748
4895
  onClick: (e) => {
4749
4896
  e.stopPropagation(), x.current?.close();
4750
4897
  },
4751
- children: /* @__PURE__ */ Q(La, { size: 16 })
4752
- }), /* @__PURE__ */ Q("img", {
4898
+ children: /* @__PURE__ */ $(Ga, { size: 16 })
4899
+ }), /* @__PURE__ */ $("img", {
4753
4900
  class: "markup-lightbox-img",
4754
4901
  src: e.screenshotUrl,
4755
4902
  alt: "Screenshot",
4756
4903
  onClick: (e) => e.stopPropagation()
4757
4904
  })]
4758
4905
  }) : null,
4759
- t == null ? /* @__PURE__ */ Q(qa, {
4906
+ t == null ? /* @__PURE__ */ $(to, {
4760
4907
  isPending: s,
4761
4908
  isConnecting: i,
4762
4909
  isSigningIn: a,
4763
4910
  onSubmit: u,
4764
4911
  onCancel: f,
4765
4912
  onSignIn: d
4766
- }) : /* @__PURE__ */ Q("div", {
4913
+ }) : /* @__PURE__ */ $("div", {
4767
4914
  class: "markup-popover-body",
4768
- children: [/* @__PURE__ */ Q("p", {
4915
+ children: [/* @__PURE__ */ $("p", {
4769
4916
  class: "markup-popover-byline",
4770
4917
  children: [
4771
4918
  "replying as ",
4772
- /* @__PURE__ */ Q("span", {
4919
+ /* @__PURE__ */ $("span", {
4773
4920
  class: "markup-popover-name",
4774
4921
  children: t
4775
4922
  }),
4776
- r ? /* @__PURE__ */ Q("span", {
4923
+ r ? /* @__PURE__ */ $("span", {
4777
4924
  class: "markup-comment-badge",
4778
4925
  children: "team"
4779
4926
  }) : null
4780
4927
  ]
4781
- }), /* @__PURE__ */ Q(Ya, {
4928
+ }), /* @__PURE__ */ $(ro, {
4782
4929
  label: "Reply",
4783
4930
  placeholder: "Write a reply…",
4784
4931
  submitLabel: "Reply",
@@ -4791,48 +4938,48 @@ function ro({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4791
4938
  ]
4792
4939
  });
4793
4940
  }
4794
- function io({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pickerRef: i, onPickerClick: a, onPickerSelect: o }) {
4795
- return /* @__PURE__ */ Q("div", {
4796
- class: Z("markup-reaction-picker-wrap", t && "is-open", t && n === "up" && "is-up", r && "is-side"),
4941
+ function po({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pickerRef: i, onPickerClick: a, onPickerSelect: o }) {
4942
+ return /* @__PURE__ */ $("div", {
4943
+ class: Q("markup-reaction-picker-wrap", t && "is-open", t && n === "up" && "is-up", r && "is-side"),
4797
4944
  ref: i,
4798
- children: [/* @__PURE__ */ Q("button", {
4945
+ children: [/* @__PURE__ */ $("button", {
4799
4946
  type: "button",
4800
- class: Z("markup-icon-btn", t && "is-open"),
4947
+ class: Q("markup-icon-btn", t && "is-open"),
4801
4948
  title: "Add reaction",
4802
4949
  "aria-label": "Add reaction",
4803
4950
  onClick: a,
4804
- children: /* @__PURE__ */ Q(Ha, { size: 16 })
4805
- }), t ? /* @__PURE__ */ Q("div", {
4951
+ children: /* @__PURE__ */ $(Xa, { size: 16 })
4952
+ }), t ? /* @__PURE__ */ $("div", {
4806
4953
  class: "markup-reaction-picker",
4807
4954
  role: "menu",
4808
- children: to.map((t) => /* @__PURE__ */ Q("button", {
4955
+ children: lo.map((t) => /* @__PURE__ */ $("button", {
4809
4956
  type: "button",
4810
4957
  role: "menuitem",
4811
- class: Z("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
4958
+ class: Q("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
4812
4959
  onClick: () => o(t),
4813
4960
  children: t
4814
4961
  }, t))
4815
4962
  }) : null]
4816
4963
  });
4817
4964
  }
4818
- function ao({ comment: e, isResolved: t, onToggle: n }) {
4819
- return /* @__PURE__ */ Q("div", {
4965
+ function mo({ comment: e, isResolved: t, onToggle: n }) {
4966
+ return /* @__PURE__ */ $("div", {
4820
4967
  class: "markup-reactions",
4821
4968
  children: e.reactions.map((e) => {
4822
- let r = oo(e.reactors, e.mine, e.count, e.emoji);
4823
- return /* @__PURE__ */ Q("button", {
4969
+ let r = ho(e.reactors, e.mine, e.count, e.emoji);
4970
+ return /* @__PURE__ */ $("button", {
4824
4971
  type: "button",
4825
- class: Z("markup-reaction-chip", e.mine && "is-mine"),
4972
+ class: Q("markup-reaction-chip", e.mine && "is-mine"),
4826
4973
  disabled: t,
4827
4974
  onClick: () => n(e.emoji),
4828
4975
  "aria-pressed": e.mine,
4829
4976
  "aria-label": r,
4830
4977
  title: r,
4831
- children: [/* @__PURE__ */ Q("span", {
4978
+ children: [/* @__PURE__ */ $("span", {
4832
4979
  class: "markup-reaction-emoji",
4833
4980
  "aria-hidden": !0,
4834
4981
  children: e.emoji
4835
- }), /* @__PURE__ */ Q("span", {
4982
+ }), /* @__PURE__ */ $("span", {
4836
4983
  class: "markup-reaction-count",
4837
4984
  children: e.count
4838
4985
  })]
@@ -4840,14 +4987,14 @@ function ao({ comment: e, isResolved: t, onToggle: n }) {
4840
4987
  })
4841
4988
  });
4842
4989
  }
4843
- function oo(e, t, n, r) {
4990
+ function ho(e, t, n, r) {
4844
4991
  let i = e.slice(), a = i.length + +!!t, o = Math.max(0, n - a);
4845
4992
  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}`;
4846
4993
  }
4847
- function so(e, t, n) {
4994
+ function go(e, t, n) {
4848
4995
  return Math.max(t, Math.min(n, e));
4849
4996
  }
4850
- function co(e) {
4997
+ function _o(e) {
4851
4998
  let t = Date.now() - e, n = Math.floor(t / 1e3);
4852
4999
  if (n < 60) return "just now";
4853
5000
  let r = Math.floor(n / 60);
@@ -4864,7 +5011,7 @@ function co(e) {
4864
5011
  year: "numeric"
4865
5012
  });
4866
5013
  }
4867
- function lo(e) {
5014
+ function vo(e) {
4868
5015
  return new Date(e).toLocaleDateString([], {
4869
5016
  month: "long",
4870
5017
  day: "numeric",
@@ -4875,25 +5022,35 @@ function lo(e) {
4875
5022
  }
4876
5023
  //#endregion
4877
5024
  //#region src/runtime/ui/app.tsx
4878
- function uo(e) {
5025
+ function yo(e) {
5026
+ let t = {
5027
+ clientId: `markup_user_${e.identity.id}`,
5028
+ name: e.identity.name,
5029
+ email: e.identity.email
5030
+ };
5031
+ if (e.mode === "cookies") return e.tokenExpiresAt == null || e.refreshTokenExpiresAt == null ? null : {
5032
+ storage: "cookies",
5033
+ ...t,
5034
+ tokenExpiresAt: e.tokenExpiresAt,
5035
+ refreshTokenExpiresAt: e.refreshTokenExpiresAt
5036
+ };
4879
5037
  if (!e.token || e.tokenExpiresAt == null) return null;
4880
- let t = typeof e.refreshToken == "string" && typeof e.refreshTokenExpiresAt == "number";
5038
+ let n = typeof e.refreshToken == "string" && typeof e.refreshTokenExpiresAt == "number";
4881
5039
  return {
4882
- clientId: `markup_user_${e.identity.id}`,
5040
+ storage: "localStorage",
5041
+ ...t,
4883
5042
  token: e.token,
4884
5043
  tokenExpiresAt: e.tokenExpiresAt,
4885
- ...t ? {
5044
+ ...n ? {
4886
5045
  refreshToken: e.refreshToken,
4887
5046
  refreshTokenExpiresAt: e.refreshTokenExpiresAt
4888
- } : {},
4889
- name: e.identity.name,
4890
- email: e.identity.email
5047
+ } : {}
4891
5048
  };
4892
5049
  }
4893
- function fo() {
5050
+ function bo() {
4894
5051
  return window.location.host + window.location.pathname;
4895
5052
  }
4896
- var po = ar({
5053
+ var xo = dr({
4897
5054
  visible: {
4898
5055
  "hide-with-toast": () => ({ kind: "hidden-with-toast" }),
4899
5056
  toggle: () => ({ kind: "hidden" })
@@ -4904,26 +5061,26 @@ var po = ar({
4904
5061
  },
4905
5062
  hidden: { toggle: () => ({ kind: "visible" }) }
4906
5063
  });
4907
- function $(e) {
4908
- return Gr(e), e;
5064
+ function So(e) {
5065
+ return $r(e), e;
4909
5066
  }
4910
- var mo = ar({
5067
+ var Co = dr({
4911
5068
  unresolved: {
4912
- "mint-success": (e, t) => $({
5069
+ "mint-success": (e, t) => So({
4913
5070
  kind: "anon",
4914
5071
  identity: t.identity
4915
5072
  }),
4916
- "signed-in": (e, t) => $({
5073
+ "signed-in": (e, t) => So({
4917
5074
  kind: "verified",
4918
5075
  identity: t.identity
4919
5076
  })
4920
5077
  },
4921
5078
  anon: {
4922
- "signed-in": (e, t) => $({
5079
+ "signed-in": (e, t) => So({
4923
5080
  kind: "verified",
4924
5081
  identity: t.identity
4925
5082
  }),
4926
- "author-set": (e, t) => $({
5083
+ "author-set": (e, t) => So({
4927
5084
  kind: "anon",
4928
5085
  identity: {
4929
5086
  ...e.identity,
@@ -4933,11 +5090,11 @@ var mo = ar({
4933
5090
  })
4934
5091
  },
4935
5092
  verified: {
4936
- "signed-in": (e, t) => $({
5093
+ "signed-in": (e, t) => So({
4937
5094
  kind: "verified",
4938
5095
  identity: t.identity
4939
5096
  }),
4940
- unauthorized: (e) => $({
5097
+ unauthorized: (e) => So({
4941
5098
  kind: "recovering",
4942
5099
  preserved: {
4943
5100
  name: e.identity.name,
@@ -4946,34 +5103,47 @@ var mo = ar({
4946
5103
  })
4947
5104
  },
4948
5105
  recovering: {
4949
- "mint-success": (e, t) => $({
5106
+ "mint-success": (e, t) => So({
4950
5107
  kind: "anon",
4951
5108
  identity: t.identity
4952
5109
  }),
4953
- "signed-in": (e, t) => $({
5110
+ "signed-in": (e, t) => So({
4954
5111
  kind: "verified",
4955
5112
  identity: t.identity
4956
5113
  })
4957
5114
  }
4958
5115
  });
4959
- function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "default", screenshots: i }) {
4960
- let [a, o] = R(fo), [s, c] = R([]), [l, u] = R(!1), d = Ce(() => Wr(), []), [f, p] = or(mo, d.state), [m, h] = R(n), g = B(f);
4961
- g.current = f, Ma(f, e, t, (e) => p({
5116
+ function wo({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "default", screenshots: i }) {
5117
+ let [a, o] = R(bo), [s, c] = R([]), [l, u] = R(!1), d = Ae(() => Qr(), []), [f, p] = fr(Co, d.state), [m, h] = R(null);
5118
+ z(() => {
5119
+ let n = !1;
5120
+ return Hr(e, t).then((e) => {
5121
+ n || h(e);
5122
+ }), () => {
5123
+ n = !0;
5124
+ };
5125
+ }, [e, t]);
5126
+ let [g, _] = R(n), v = B(f);
5127
+ v.current = f, Ba(f, e, t, (e) => p({
4962
5128
  type: "signed-in",
4963
5129
  identity: e
4964
5130
  }), () => p({ type: "unauthorized" }));
4965
- let _ = Ce(() => Nr({
5131
+ let y = Ae(() => zr({
4966
5132
  apiUrl: e,
4967
5133
  apiKey: t,
4968
5134
  getToken: () => {
4969
- let e = g.current;
4970
- return e.kind === "verified" ? {
5135
+ let e = v.current;
5136
+ return e.kind !== "verified" || e.identity.token == null ? null : {
4971
5137
  token: e.identity.token,
4972
5138
  expiresAt: e.identity.tokenExpiresAt
4973
- } : null;
5139
+ };
5140
+ },
5141
+ getStorageMode: () => {
5142
+ let e = v.current;
5143
+ return e.kind === "verified" ? e.identity.storage : null;
4974
5144
  },
4975
5145
  getAnonToken: () => {
4976
- let e = g.current;
5146
+ let e = v.current;
4977
5147
  return e.kind === "anon" ? e.identity.anonToken : null;
4978
5148
  },
4979
5149
  onUnauthorized: () => {
@@ -4983,12 +5153,12 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
4983
5153
  e,
4984
5154
  t,
4985
5155
  p
4986
- ]), [v, y] = R({ kind: "idle" }), b = cr(), x = cr(), S = cr(), { run: C, reset: w } = b, { run: T } = x, { run: E, reset: D } = S, O = b.isPending, k = b.error ?? x.error ?? S.error, [A, j] = or(po, { kind: "visible" }), M = A.kind !== "visible", [N, ee] = R(0), te = B(null), ne = qr(f), re = f.kind === "verified", ie = f.kind === "unresolved" || f.kind === "recovering", P = Kr(f);
5156
+ ]), [b, x] = R({ kind: "idle" }), S = mr(), C = mr(), w = mr(), { run: T, reset: E } = S, { run: D } = C, { run: O, reset: k } = w, A = S.isPending, j = S.error ?? C.error ?? w.error, [M, N] = fr(xo, { kind: "visible" }), ee = M.kind !== "visible", [te, ne] = R(0), re = B(null), ie = ti(f), ae = f.kind === "verified", oe = f.kind === "unresolved" || f.kind === "recovering", P = ei(f);
4987
5157
  z(() => {
4988
5158
  if (f.kind !== "unresolved" && f.kind !== "recovering") return;
4989
5159
  let e = f.kind === "recovering" ? f.preserved : d.preserved, t = !1, n = null, r = 1e3;
4990
5160
  function i() {
4991
- _.mintAnonIdentity().then(({ clientId: n, token: r }) => {
5161
+ y.mintAnonIdentity().then(({ clientId: n, token: r }) => {
4992
5162
  t || p({
4993
5163
  type: "mint-success",
4994
5164
  identity: {
@@ -5006,59 +5176,59 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5006
5176
  t = !0, n && clearTimeout(n);
5007
5177
  };
5008
5178
  }, [
5009
- _,
5179
+ y,
5010
5180
  f,
5011
5181
  p,
5012
5182
  d
5013
5183
  ]);
5014
- let ae = Oa(_), [oe, se] = R(null);
5184
+ let se = Ia(y), [ce, le] = R(null);
5015
5185
  z(() => {
5016
- let t = new ir(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
5017
- return se(t), () => {
5018
- t.close(), se((e) => e === t ? null : e);
5186
+ let t = new ur(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
5187
+ return le(t), () => {
5188
+ t.close(), le((e) => e === t ? null : e);
5019
5189
  };
5020
5190
  }, [e]);
5021
- let ce = B(!1);
5191
+ let ue = B(!1);
5022
5192
  z(() => {
5023
- if (!(!oe || !ae)) return w(), D(), oe.onUpdate(Jt("widget/queries:subscribeThreadsForRoute"), {
5024
- subscriptionToken: ae,
5193
+ if (!(!ce || !se)) return E(), k(), ce.onUpdate(en("widget/queries:subscribeThreadsForRoute"), {
5194
+ subscriptionToken: se,
5025
5195
  route: a,
5026
5196
  viewerClientId: P
5027
5197
  }, (e) => {
5028
5198
  e !== void 0 && (c(e), u(!0));
5029
5199
  });
5030
5200
  }, [
5031
- oe,
5032
- ae,
5201
+ ce,
5202
+ se,
5033
5203
  a,
5034
5204
  P,
5035
- w,
5036
- D
5205
+ E,
5206
+ k
5037
5207
  ]), z(() => {
5038
- if (ce.current || !l) return;
5208
+ if (ue.current || !l) return;
5039
5209
  let e = window.location.hash.match(/^#markup-thread=(.+)$/);
5040
5210
  if (e) {
5041
5211
  let t = decodeURIComponent(e[1] ?? "");
5042
- s.find((e) => e._id === t) && y({
5212
+ s.find((e) => e._id === t) && x({
5043
5213
  kind: "thread",
5044
5214
  threadId: t
5045
5215
  }), history.replaceState(null, "", window.location.pathname + window.location.search);
5046
5216
  }
5047
- ce.current = !0;
5048
- }, [s, l]), z(() => Br(() => o(fo())), []), z(() => {
5217
+ ue.current = !0;
5218
+ }, [s, l]), z(() => Jr(() => o(bo())), []), z(() => {
5049
5219
  function e(e) {
5050
- e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), j({ type: "toggle" })));
5220
+ e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), N({ type: "toggle" })));
5051
5221
  }
5052
5222
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
5053
- }, [j]), z(() => {
5054
- if (A.kind !== "hidden-with-toast") return;
5055
- let e = window.setTimeout(() => j({ type: "dismiss-toast" }), 5e3);
5223
+ }, [N]), z(() => {
5224
+ if (M.kind !== "hidden-with-toast") return;
5225
+ let e = window.setTimeout(() => N({ type: "dismiss-toast" }), 5e3);
5056
5226
  return () => window.clearTimeout(e);
5057
- }, [A.kind, j]), z(() => {
5227
+ }, [M.kind, N]), z(() => {
5058
5228
  let e = null;
5059
5229
  function t() {
5060
5230
  e ??= requestAnimationFrame(() => {
5061
- e = null, ee((e) => e + 1);
5231
+ e = null, ne((e) => e + 1);
5062
5232
  });
5063
5233
  }
5064
5234
  window.addEventListener("scroll", t, { passive: !0 }), window.addEventListener("resize", t);
@@ -5067,14 +5237,14 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5067
5237
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n.disconnect(), e != null && cancelAnimationFrame(e);
5068
5238
  };
5069
5239
  }, []);
5070
- let le = V(() => {
5071
- w(), D(), y({ kind: "placing" });
5072
- }, [w, D]), ue = V(() => {
5073
- y({ kind: "idle" }), w(), D();
5074
- }, [w, D]), de = B(0), F = V((e, t, n) => {
5075
- let r = t + window.scrollX, a = n + window.scrollY, o = ++de.current;
5240
+ let de = V(() => {
5241
+ E(), k(), x({ kind: "placing" });
5242
+ }, [E, k]), fe = V(() => {
5243
+ x({ kind: "idle" }), E(), k();
5244
+ }, [E, k]), pe = B(0), me = V((e, t, n) => {
5245
+ let r = t + window.scrollX, a = n + window.scrollY, o = ++pe.current;
5076
5246
  if (i?.enabled === !1) {
5077
- y({
5247
+ x({
5078
5248
  kind: "composing-new",
5079
5249
  coords: e,
5080
5250
  pageX: r,
@@ -5087,7 +5257,7 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5087
5257
  });
5088
5258
  return;
5089
5259
  }
5090
- y({
5260
+ x({
5091
5261
  kind: "composing-new",
5092
5262
  coords: e,
5093
5263
  pageX: r,
@@ -5098,15 +5268,15 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5098
5268
  screenshotRedactedSelectors: [],
5099
5269
  captureToken: o
5100
5270
  });
5101
- let s = te.current != null && te.current.getRootNode() instanceof ShadowRoot ? te.current.getRootNode().host : null, c = {
5271
+ let s = re.current != null && re.current.getRootNode() instanceof ShadowRoot ? re.current.getRootNode().host : null, c = {
5102
5272
  strictScrub: i?.strictScrub,
5103
5273
  redactSelector: i?.redactSelector
5104
5274
  };
5105
- xa(s, {
5275
+ ka(s, {
5106
5276
  x: t,
5107
5277
  y: n
5108
5278
  }, c).then((e) => {
5109
- y((t) => t.kind !== "composing-new" || t.captureToken !== o ? t : {
5279
+ x((t) => t.kind !== "composing-new" || t.captureToken !== o ? t : {
5110
5280
  ...t,
5111
5281
  screenshot: e?.blob ?? null,
5112
5282
  isScreenshotCapturing: !1,
@@ -5114,15 +5284,19 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5114
5284
  screenshotRedactedSelectors: e?.redactedSelectors ?? []
5115
5285
  });
5116
5286
  });
5117
- }, [i]), fe = V((e, t) => {
5287
+ }, [i]), he = V((e, t) => {
5118
5288
  p({
5119
5289
  type: "author-set",
5120
5290
  name: e,
5121
5291
  email: t
5122
5292
  });
5123
- }, [p]), pe = x.isPending, me = V(async () => {
5124
- await T(async () => {
5125
- let n = uo(await Yr(e, t));
5293
+ }, [p]), ge = C.isPending, _e = V(async () => {
5294
+ await D(async () => {
5295
+ let n = yo(await ri({
5296
+ apiUrl: e,
5297
+ apiKey: t,
5298
+ useCookies: m === !0
5299
+ }));
5126
5300
  if (!n) throw Error("Sign-in did not return a verified token");
5127
5301
  p({
5128
5302
  type: "signed-in",
@@ -5132,78 +5306,79 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5132
5306
  }, [
5133
5307
  e,
5134
5308
  t,
5135
- T,
5309
+ m,
5310
+ D,
5136
5311
  p
5137
- ]), he = V(async (e, t) => {
5138
- if (v.kind !== "composing-new") return;
5139
- let n = Jr(f);
5140
- n && await C(async () => {
5312
+ ]), ve = V(async (e, t) => {
5313
+ if (b.kind !== "composing-new") return;
5314
+ let n = ni(f);
5315
+ n && await T(async () => {
5141
5316
  let r;
5142
- if (t && v.screenshot) {
5143
- let { uploadUrl: e } = await _.getScreenshotUploadUrl(), t = await fetch(e, {
5317
+ if (t && b.screenshot) {
5318
+ let { uploadUrl: e } = await y.getScreenshotUploadUrl(), t = await fetch(e, {
5144
5319
  method: "POST",
5145
- headers: { "Content-Type": v.screenshot.type || "image/png" },
5146
- body: v.screenshot
5320
+ headers: { "Content-Type": b.screenshot.type || "image/png" },
5321
+ body: b.screenshot
5147
5322
  });
5148
5323
  if (!t.ok) throw Error(`Screenshot upload failed (${t.status})`);
5149
5324
  let { storageId: n } = await t.json();
5150
5325
  r = n;
5151
5326
  }
5152
- let i = await _.createThread({
5327
+ let i = await y.createThread({
5153
5328
  url: window.location.href,
5154
5329
  route: a,
5155
- anchorSelector: v.coords.anchorSelector,
5156
- anchorX: v.coords.anchorX,
5157
- anchorY: v.coords.anchorY,
5158
- anchorOffsetX: v.coords.anchorOffsetX,
5159
- anchorOffsetY: v.coords.anchorOffsetY,
5160
- viewportW: v.coords.viewportW,
5161
- viewportY: v.coords.viewportY,
5330
+ anchorSelector: b.coords.anchorSelector,
5331
+ anchorX: b.coords.anchorX,
5332
+ anchorY: b.coords.anchorY,
5333
+ anchorOffsetX: b.coords.anchorOffsetX,
5334
+ anchorOffsetY: b.coords.anchorOffsetY,
5335
+ viewportW: b.coords.viewportW,
5336
+ viewportY: b.coords.viewportY,
5162
5337
  userAgent: navigator.userAgent,
5163
5338
  authorName: n.name,
5164
5339
  authorEmail: n.email,
5165
5340
  body: e,
5166
5341
  screenshotStorageId: r
5167
5342
  });
5168
- c((e) => [...e, i.thread]), y({
5343
+ c((e) => [...e, i.thread]), x({
5169
5344
  kind: "thread",
5170
5345
  threadId: i.thread._id
5171
5346
  });
5172
5347
  });
5173
5348
  }, [
5174
- _,
5349
+ y,
5175
5350
  f,
5176
- v,
5351
+ b,
5177
5352
  a,
5178
- C
5179
- ]), I = V(async () => {
5180
- if (v.kind !== "thread") return;
5181
- let e = v.threadId;
5182
- await C(async () => {
5183
- await _.deleteThread(e), c((t) => t.filter((t) => t._id !== e)), y({ kind: "idle" });
5353
+ T
5354
+ ]), F = V(async () => {
5355
+ if (b.kind !== "thread") return;
5356
+ let e = b.threadId;
5357
+ await T(async () => {
5358
+ await y.deleteThread(e), c((t) => t.filter((t) => t._id !== e)), x({ kind: "idle" });
5184
5359
  });
5185
5360
  }, [
5186
- _,
5187
- v,
5188
- C
5189
- ]), ge = V(async () => {
5190
- if (v.kind !== "thread") return;
5191
- let e = v.threadId;
5192
- await C(async () => {
5193
- await _.resolveThread(e, P), c((t) => t.filter((t) => t._id !== e)), y({ kind: "idle" });
5361
+ y,
5362
+ b,
5363
+ T
5364
+ ]), ye = V(async () => {
5365
+ if (b.kind !== "thread") return;
5366
+ let e = b.threadId;
5367
+ await T(async () => {
5368
+ await y.resolveThread(e, P), c((t) => t.filter((t) => t._id !== e)), x({ kind: "idle" });
5194
5369
  });
5195
5370
  }, [
5196
- _,
5197
- v,
5371
+ y,
5372
+ b,
5198
5373
  P,
5199
- C
5200
- ]), _e = V(async (e) => {
5201
- if (v.kind !== "thread") return;
5202
- let t = Jr(f);
5374
+ T
5375
+ ]), be = V(async (e) => {
5376
+ if (b.kind !== "thread") return;
5377
+ let t = ni(f);
5203
5378
  if (!t) return;
5204
- let n = v.threadId;
5205
- await C(async () => {
5206
- let r = await _.addComment(n, {
5379
+ let n = b.threadId;
5380
+ await T(async () => {
5381
+ let r = await y.addComment(n, {
5207
5382
  body: e,
5208
5383
  authorName: t.name,
5209
5384
  authorEmail: t.email
@@ -5211,67 +5386,67 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5211
5386
  c((e) => e.map((e) => e._id === n ? r.thread : e));
5212
5387
  });
5213
5388
  }, [
5214
- _,
5389
+ y,
5215
5390
  f,
5216
- v,
5217
- C
5218
- ]), ve = V(async (e, t) => {
5219
- if (v.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
5220
- let n = v.threadId;
5221
- await C(async () => {
5222
- let r = await _.editComment(n, e, { body: t });
5391
+ b,
5392
+ T
5393
+ ]), xe = V(async (e, t) => {
5394
+ if (b.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
5395
+ let n = b.threadId;
5396
+ await T(async () => {
5397
+ let r = await y.editComment(n, e, { body: t });
5223
5398
  c((e) => e.map((e) => e._id === n ? r.thread : e));
5224
5399
  }, { rethrow: !0 });
5225
5400
  }, [
5226
- _,
5401
+ y,
5227
5402
  f,
5228
- v,
5229
- C
5230
- ]), ye = V(async (e) => {
5231
- if (v.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
5232
- let t = v.threadId;
5233
- await C(async () => {
5234
- let n = await _.deleteComment(t, e);
5403
+ b,
5404
+ T
5405
+ ]), Se = V(async (e) => {
5406
+ if (b.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
5407
+ let t = b.threadId;
5408
+ await T(async () => {
5409
+ let n = await y.deleteComment(t, e);
5235
5410
  c((e) => e.map((e) => e._id === t ? n.thread : e));
5236
5411
  });
5237
5412
  }, [
5238
- _,
5413
+ y,
5239
5414
  f,
5240
- v,
5241
- C
5242
- ]), be = V(async (e, t) => {
5243
- if (v.kind !== "thread") return;
5244
- let n = Jr(f);
5415
+ b,
5416
+ T
5417
+ ]), I = V(async (e, t) => {
5418
+ if (b.kind !== "thread") return;
5419
+ let n = ni(f);
5245
5420
  if (!n) return;
5246
- let r = v.threadId;
5247
- await E(async () => {
5248
- let i = await _.toggleReaction(e, {
5421
+ let r = b.threadId;
5422
+ await O(async () => {
5423
+ let i = await y.toggleReaction(e, {
5249
5424
  emoji: t,
5250
5425
  authorName: n.name
5251
5426
  });
5252
5427
  c((e) => e.map((e) => e._id === r ? i.thread : e));
5253
5428
  });
5254
5429
  }, [
5255
- _,
5430
+ y,
5256
5431
  f,
5257
- v,
5258
- E
5259
- ]), L = v.kind === "thread" ? s.find((e) => e._id === v.threadId) ?? null : null, xe = re || P != null && P === L?.authorClientId, Se = Ce(() => s.map((e) => ({
5432
+ b,
5433
+ O
5434
+ ]), L = b.kind === "thread" ? s.find((e) => e._id === b.threadId) ?? null : null, Ce = ae || P != null && P === L?.authorClientId, we = Ae(() => s.map((e) => ({
5260
5435
  thread: e,
5261
- point: Ar({
5436
+ point: Ir({
5262
5437
  anchorX: e.anchorX,
5263
5438
  anchorY: e.anchorY,
5264
5439
  anchorSelector: e.anchorSelector,
5265
5440
  anchorOffsetX: e.anchorOffsetX,
5266
5441
  anchorOffsetY: e.anchorOffsetY
5267
5442
  })
5268
- })), [s, N]), we = Se.some((e) => !e.point.resolved);
5443
+ })), [s, te]), Te = we.some((e) => !e.point.resolved);
5269
5444
  return z(() => {
5270
- if (!we) return;
5445
+ if (!Te) return;
5271
5446
  let e = null;
5272
5447
  function t() {
5273
5448
  e ??= requestAnimationFrame(() => {
5274
- e = null, ee((e) => e + 1);
5449
+ e = null, ne((e) => e + 1);
5275
5450
  });
5276
5451
  }
5277
5452
  let n = new MutationObserver(t);
@@ -5281,104 +5456,104 @@ function ho({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5281
5456
  }), () => {
5282
5457
  n.disconnect(), e != null && cancelAnimationFrame(e);
5283
5458
  };
5284
- }, [we]), z(() => {
5285
- v.kind === "thread" && L == null && ue();
5459
+ }, [Te]), z(() => {
5460
+ b.kind === "thread" && L == null && fe();
5286
5461
  }, [
5287
- v,
5462
+ b,
5288
5463
  L,
5289
- ue
5290
- ]), /* @__PURE__ */ Q("div", {
5464
+ fe
5465
+ ]), /* @__PURE__ */ $("div", {
5291
5466
  class: "markup-root",
5292
- ref: te,
5467
+ ref: re,
5293
5468
  children: [
5294
- v.kind === "placing" ? null : /* @__PURE__ */ Q("div", {
5469
+ b.kind === "placing" ? null : /* @__PURE__ */ $("div", {
5295
5470
  class: "markup-pins-layer",
5296
- children: [M ? null : Se.map(({ thread: e, point: t }) => {
5297
- let n = v.kind === "thread" && v.threadId === e._id, r = e.comments.reduce((e, t) => e + +!t.deleted, 0);
5298
- return /* @__PURE__ */ Q(Qa, {
5471
+ children: [ee ? null : we.map(({ thread: e, point: t }) => {
5472
+ let n = b.kind === "thread" && b.threadId === e._id, r = e.comments.reduce((e, t) => e + +!t.deleted, 0);
5473
+ return /* @__PURE__ */ $(oo, {
5299
5474
  pageX: t.pageX,
5300
5475
  pageY: t.pageY,
5301
5476
  count: r,
5302
5477
  isActive: n,
5303
5478
  isUnresolved: !t.resolved,
5304
- onClick: () => y({
5479
+ onClick: () => x({
5305
5480
  kind: "thread",
5306
5481
  threadId: e._id
5307
5482
  })
5308
5483
  }, e._id);
5309
- }), v.kind === "composing-new" ? /* @__PURE__ */ Q($a, {
5310
- pageX: v.pageX,
5311
- pageY: v.pageY
5484
+ }), b.kind === "composing-new" ? /* @__PURE__ */ $(so, {
5485
+ pageX: b.pageX,
5486
+ pageY: b.pageY
5312
5487
  }) : null]
5313
5488
  }),
5314
- v.kind === "placing" ? /* @__PURE__ */ Q(eo, {
5315
- onPlace: F,
5316
- onCancel: ue
5489
+ b.kind === "placing" ? /* @__PURE__ */ $(co, {
5490
+ onPlace: me,
5491
+ onCancel: fe
5317
5492
  }) : null,
5318
- v.kind === "thread" && L ? /* @__PURE__ */ Q(ro, {
5493
+ b.kind === "thread" && L ? /* @__PURE__ */ $(fo, {
5319
5494
  thread: L,
5320
- authorName: ne,
5495
+ authorName: ie,
5321
5496
  currentClientId: P ?? null,
5322
- isVerified: re,
5323
- isIdentityResolving: ie,
5324
- isSigningIn: pe,
5325
- canDelete: xe,
5326
- isPending: O,
5327
- error: k,
5328
- isHidden: M,
5329
- onAuthor: fe,
5330
- onSignIn: me,
5331
- onClose: ue,
5332
- onReply: _e,
5333
- onEditComment: ve,
5334
- onDeleteComment: ye,
5335
- onToggleReaction: be,
5336
- onDelete: I,
5337
- onResolve: ge
5497
+ isVerified: ae,
5498
+ isIdentityResolving: oe,
5499
+ isSigningIn: ge,
5500
+ canDelete: Ce,
5501
+ isPending: A,
5502
+ error: j,
5503
+ isHidden: ee,
5504
+ onAuthor: he,
5505
+ onSignIn: _e,
5506
+ onClose: fe,
5507
+ onReply: be,
5508
+ onEditComment: xe,
5509
+ onDeleteComment: Se,
5510
+ onToggleReaction: I,
5511
+ onDelete: F,
5512
+ onResolve: ye
5338
5513
  }, L._id) : null,
5339
- v.kind === "composing-new" ? /* @__PURE__ */ Q(Xa, {
5340
- pageX: v.pageX,
5341
- pageY: v.pageY,
5342
- authorName: ne,
5343
- isVerified: re,
5344
- isIdentityResolving: ie,
5345
- isSigningIn: pe,
5346
- isPending: O,
5347
- error: k,
5348
- screenshot: v.screenshot,
5349
- isScreenshotCapturing: v.isScreenshotCapturing,
5350
- screenshotRedactedCount: v.screenshotRedactedCount,
5351
- screenshotRedactedSelectors: v.screenshotRedactedSelectors,
5352
- onAuthor: fe,
5353
- onSignIn: me,
5354
- onSubmit: he,
5355
- onClose: ue
5514
+ b.kind === "composing-new" ? /* @__PURE__ */ $(io, {
5515
+ pageX: b.pageX,
5516
+ pageY: b.pageY,
5517
+ authorName: ie,
5518
+ isVerified: ae,
5519
+ isIdentityResolving: oe,
5520
+ isSigningIn: ge,
5521
+ isPending: A,
5522
+ error: j,
5523
+ screenshot: b.screenshot,
5524
+ isScreenshotCapturing: b.isScreenshotCapturing,
5525
+ screenshotRedactedCount: b.screenshotRedactedCount,
5526
+ screenshotRedactedSelectors: b.screenshotRedactedSelectors,
5527
+ onAuthor: he,
5528
+ onSignIn: _e,
5529
+ onSubmit: ve,
5530
+ onClose: fe
5356
5531
  }) : null,
5357
- !M || v.kind === "placing" || v.kind === "composing-new" ? /* @__PURE__ */ Q(Ua, {
5358
- isActive: v.kind === "placing",
5359
- onToggle: () => v.kind === "placing" ? ue() : le(),
5360
- onHide: () => j({ type: "hide-with-toast" }),
5361
- position: m,
5362
- onPositionChange: h,
5532
+ !ee || b.kind === "placing" || b.kind === "composing-new" ? /* @__PURE__ */ $(Za, {
5533
+ isActive: b.kind === "placing",
5534
+ onToggle: () => b.kind === "placing" ? fe() : de(),
5535
+ onHide: () => N({ type: "hide-with-toast" }),
5536
+ position: g,
5537
+ onPositionChange: _,
5363
5538
  variant: r
5364
5539
  }) : null,
5365
- A.kind === "hidden-with-toast" ? /* @__PURE__ */ Q(go, { position: m }) : null
5540
+ M.kind === "hidden-with-toast" ? /* @__PURE__ */ $(To, { position: g }) : null
5366
5541
  ]
5367
5542
  });
5368
5543
  }
5369
- function go({ position: e }) {
5544
+ function To({ position: e }) {
5370
5545
  let t = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "⌘" : "Ctrl";
5371
- return /* @__PURE__ */ Q("div", {
5372
- class: Z("markup-hud-hidden-toast", e === "bottom-left" ? "markup-hud-hidden-toast-left" : e === "bottom-center" ? "markup-hud-hidden-toast-center" : "markup-hud-hidden-toast-right"),
5546
+ return /* @__PURE__ */ $("div", {
5547
+ class: Q("markup-hud-hidden-toast", e === "bottom-left" ? "markup-hud-hidden-toast-left" : e === "bottom-center" ? "markup-hud-hidden-toast-center" : "markup-hud-hidden-toast-right"),
5373
5548
  role: "status",
5374
5549
  "aria-live": "polite",
5375
5550
  children: [
5376
5551
  "Markup hidden — press ",
5377
- /* @__PURE__ */ Q("kbd", {
5552
+ /* @__PURE__ */ $("kbd", {
5378
5553
  class: "markup-kbd",
5379
5554
  children: t
5380
5555
  }),
5381
- /* @__PURE__ */ Q("kbd", {
5556
+ /* @__PURE__ */ $("kbd", {
5382
5557
  class: "markup-kbd",
5383
5558
  children: "."
5384
5559
  }),
@@ -5388,7 +5563,7 @@ function go({ position: e }) {
5388
5563
  }
5389
5564
  //#endregion
5390
5565
  //#region src/runtime/mount.tsx
5391
- function _o(e, t) {
5566
+ function Eo(e, t) {
5392
5567
  e.style.position = "fixed", e.style.inset = "0", e.style.zIndex = "2147483647", e.style.pointerEvents = "none";
5393
5568
  let n = t.theme ?? "auto";
5394
5569
  n !== "auto" && (e.dataset.theme = n);
@@ -5396,33 +5571,39 @@ function _o(e, t) {
5396
5571
  i.textContent = ue, r.appendChild(i);
5397
5572
  let a = document.createElement("div");
5398
5573
  a.className = "markup-shadow-root", r.appendChild(a);
5399
- let { theme: o, ...s } = t;
5400
- return le(/* @__PURE__ */ Q(ho, { ...s }), a), () => le(null, a);
5574
+ let o = {
5575
+ apiUrl: t.apiUrl,
5576
+ apiKey: t.apiKey
5577
+ }, { theme: s, ...c } = t;
5578
+ return le(/* @__PURE__ */ $(de, {
5579
+ onError: (e) => _e(o, e, { context: "render" }),
5580
+ children: /* @__PURE__ */ $(wo, { ...c })
5581
+ }), a), () => le(null, a);
5401
5582
  }
5402
5583
  //#endregion
5403
5584
  //#region src/widget.ts
5404
- var vo = null, yo = null, bo = null;
5405
- function xo(e) {
5585
+ var Do = null, Oo = null, ko = null;
5586
+ function Ao(e) {
5406
5587
  if (!e.apiUrl || !e.apiKey) return console.warn("[markup] init() requires both apiUrl and apiKey — widget not mounted"), () => {};
5407
- So();
5588
+ jo();
5408
5589
  let t = () => {
5409
- if (bo = null, !document.body) return;
5590
+ if (ko = null, !document.body) return;
5410
5591
  let t = document.createElement("div");
5411
- t.id = "markup-widget", document.body.appendChild(t), yo = t, vo = _o(t, e);
5592
+ t.id = "markup-widget", document.body.appendChild(t), Oo = t, Do = Eo(t, e);
5412
5593
  };
5413
5594
  if (document.readyState === "loading" || !document.body) {
5414
5595
  let e = () => t();
5415
- bo = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
5596
+ ko = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
5416
5597
  } else t();
5417
- return So;
5598
+ return jo;
5418
5599
  }
5419
- function So() {
5420
- bo &&= (bo(), null), vo &&= (vo(), null), yo?.parentNode && yo.parentNode.removeChild(yo), yo = null;
5600
+ function jo() {
5601
+ ko &&= (ko(), null), Do &&= (Do(), null), Oo?.parentNode && Oo.parentNode.removeChild(Oo), Oo = null;
5421
5602
  }
5422
5603
  if (typeof document < "u") {
5423
5604
  let e = document.currentScript ?? document.querySelector("script[data-markup-widget=\"true\"]"), t = e?.dataset.apiUrl, n = e?.dataset.apiKey;
5424
5605
  if (t && n) {
5425
- let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = () => xo({
5606
+ let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = () => Ao({
5426
5607
  apiUrl: t,
5427
5608
  apiKey: n,
5428
5609
  position: r,
@@ -5433,6 +5614,6 @@ if (typeof document < "u") {
5433
5614
  }
5434
5615
  }
5435
5616
  //#endregion
5436
- export { So as destroy, xo as init };
5617
+ export { jo as destroy, Ao as init };
5437
5618
 
5438
5619
  //# sourceMappingURL=widget.js.map