@pixelmatters/markup 1.8.0 → 1.10.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
@@ -248,24 +248,87 @@ 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, xe = I.__;
252
- function Se(e, t) {
253
- I.__h && I.__h(F, e, me || t), me = 0;
254
- var n = F.__H ||= {
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
+ var ve = null;
306
+ function ye(e) {
307
+ ve = e;
308
+ }
309
+ function F(e, t) {
310
+ ve && _e(ve, e, t);
311
+ }
312
+ //#endregion
313
+ //#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/hooks/dist/hooks.module.js
314
+ var be, I, xe, Se, L = 0, Ce = [], R = t, we = R.__b, Te = R.__r, Ee = R.diffed, De = R.__c, Oe = R.unmount, ke = R.__;
315
+ function Ae(e, t) {
316
+ R.__h && R.__h(I, e, L || t), L = 0;
317
+ var n = I.__H ||= {
255
318
  __: [],
256
319
  __h: []
257
320
  };
258
321
  return e >= n.__.length && n.__.push({}), n.__[e];
259
322
  }
260
- function L(e) {
261
- return me = 1, Ce(je, e);
323
+ function z(e) {
324
+ return L = 1, je(ze, e);
262
325
  }
263
- function Ce(e, t, n) {
264
- var r = Se(de++, 2);
265
- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : je(void 0, t), function(e) {
326
+ function je(e, t, n) {
327
+ var r = Ae(be++, 2);
328
+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : ze(void 0, t), function(e) {
266
329
  var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
267
330
  t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
268
- }], r.__c = F, !F.__f)) {
331
+ }], r.__c = I, !I.__f)) {
269
332
  var i = function(e, t, n) {
270
333
  if (!r.__c.__H) return !0;
271
334
  var i = r.__c.__H.__.filter(function(e) {
@@ -282,111 +345,111 @@ function Ce(e, t, n) {
282
345
  }
283
346
  }), a && a.call(this, e, t, n) || o;
284
347
  };
285
- F.__f = !0;
286
- var a = F.shouldComponentUpdate, o = F.componentWillUpdate;
287
- F.componentWillUpdate = function(e, t, n) {
348
+ I.__f = !0;
349
+ var a = I.shouldComponentUpdate, o = I.componentWillUpdate;
350
+ I.componentWillUpdate = function(e, t, n) {
288
351
  if (this.__e) {
289
352
  var r = a;
290
353
  a = void 0, i(e, t, n), a = r;
291
354
  }
292
355
  o && o.call(this, e, t, n);
293
- }, F.shouldComponentUpdate = i;
356
+ }, I.shouldComponentUpdate = i;
294
357
  }
295
358
  return r.__N || r.__;
296
359
  }
297
- function R(e, t) {
298
- var n = Se(de++, 3);
299
- !I.__s && Ae(n.__H, t) && (n.__ = e, n.u = t, F.__H.__h.push(n));
360
+ function B(e, t) {
361
+ var n = Ae(be++, 3);
362
+ !R.__s && Re(n.__H, t) && (n.__ = e, n.u = t, I.__H.__h.push(n));
300
363
  }
301
- function z(e) {
302
- return me = 5, we(function() {
364
+ function V(e) {
365
+ return L = 5, Me(function() {
303
366
  return { current: e };
304
367
  }, []);
305
368
  }
306
- function we(e, t) {
307
- var n = Se(de++, 7);
308
- return Ae(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
369
+ function Me(e, t) {
370
+ var n = Ae(be++, 7);
371
+ return Re(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
309
372
  }
310
- function B(e, t) {
311
- return me = 8, we(function() {
373
+ function H(e, t) {
374
+ return L = 8, Me(function() {
312
375
  return e;
313
376
  }, t);
314
377
  }
315
- function Te() {
316
- for (var e; e = he.shift();) {
378
+ function Ne() {
379
+ for (var e; e = Ce.shift();) {
317
380
  var t = e.__H;
318
381
  if (e.__P && t) try {
319
- t.__h.some(Oe), t.__h.some(ke), t.__h = [];
382
+ t.__h.some(Ie), t.__h.some(Le), t.__h = [];
320
383
  } catch (n) {
321
- t.__h = [], I.__e(n, e.__v);
384
+ t.__h = [], R.__e(n, e.__v);
322
385
  }
323
386
  }
324
387
  }
325
- I.__b = function(e) {
326
- F = null, ge && ge(e);
327
- }, I.__ = function(e, t) {
328
- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), xe && xe(e, t);
329
- }, I.__r = function(e) {
330
- _e && _e(e), de = 0;
331
- var t = (F = e.__c).__H;
332
- t && (fe === F ? (t.__h = [], F.__h = [], t.__.some(function(e) {
388
+ R.__b = function(e) {
389
+ I = null, we && we(e);
390
+ }, R.__ = function(e, t) {
391
+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ke && ke(e, t);
392
+ }, R.__r = function(e) {
393
+ Te && Te(e), be = 0;
394
+ var t = (I = e.__c).__H;
395
+ t && (xe === I ? (t.__h = [], I.__h = [], t.__.some(function(e) {
333
396
  e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
334
- })) : (t.__h.some(Oe), t.__h.some(ke), t.__h = [], de = 0)), fe = F;
335
- }, I.diffed = function(e) {
336
- ve && ve(e);
397
+ })) : (t.__h.some(Ie), t.__h.some(Le), t.__h = [], be = 0)), xe = I;
398
+ }, R.diffed = function(e) {
399
+ Ee && Ee(e);
337
400
  var t = e.__c;
338
- t && t.__H && (t.__H.__h.length && (he.push(t) !== 1 && pe === I.requestAnimationFrame || ((pe = I.requestAnimationFrame) || De)(Te)), t.__H.__.some(function(e) {
401
+ t && t.__H && (t.__H.__h.length && (Ce.push(t) !== 1 && Se === R.requestAnimationFrame || ((Se = R.requestAnimationFrame) || Fe)(Ne)), t.__H.__.some(function(e) {
339
402
  e.u && (e.__H = e.u), e.u = void 0;
340
- })), fe = F = null;
341
- }, I.__c = function(e, t) {
403
+ })), xe = I = null;
404
+ }, R.__c = function(e, t) {
342
405
  t.some(function(e) {
343
406
  try {
344
- e.__h.some(Oe), e.__h = e.__h.filter(function(e) {
345
- return !e.__ || ke(e);
407
+ e.__h.some(Ie), e.__h = e.__h.filter(function(e) {
408
+ return !e.__ || Le(e);
346
409
  });
347
410
  } catch (n) {
348
411
  t.some(function(e) {
349
412
  e.__h &&= [];
350
- }), t = [], I.__e(n, e.__v);
413
+ }), t = [], R.__e(n, e.__v);
351
414
  }
352
- }), ye && ye(e, t);
353
- }, I.unmount = function(e) {
354
- be && be(e);
415
+ }), De && De(e, t);
416
+ }, R.unmount = function(e) {
417
+ Oe && Oe(e);
355
418
  var t, n = e.__c;
356
419
  n && n.__H && (n.__H.__.some(function(e) {
357
420
  try {
358
- Oe(e);
421
+ Ie(e);
359
422
  } catch (e) {
360
423
  t = e;
361
424
  }
362
- }), n.__H = void 0, t && I.__e(t, n.__v));
425
+ }), n.__H = void 0, t && R.__e(t, n.__v));
363
426
  };
364
- var Ee = typeof requestAnimationFrame == "function";
365
- function De(e) {
427
+ var Pe = typeof requestAnimationFrame == "function";
428
+ function Fe(e) {
366
429
  var t, n = function() {
367
- clearTimeout(r), Ee && cancelAnimationFrame(t), setTimeout(e);
430
+ clearTimeout(r), Pe && cancelAnimationFrame(t), setTimeout(e);
368
431
  }, r = setTimeout(n, 35);
369
- Ee && (t = requestAnimationFrame(n));
432
+ Pe && (t = requestAnimationFrame(n));
370
433
  }
371
- function Oe(e) {
372
- var t = F, n = e.__c;
373
- typeof n == "function" && (e.__c = void 0, n()), F = t;
434
+ function Ie(e) {
435
+ var t = I, n = e.__c;
436
+ typeof n == "function" && (e.__c = void 0, n()), I = t;
374
437
  }
375
- function ke(e) {
376
- var t = F;
377
- e.__c = e.__(), F = t;
438
+ function Le(e) {
439
+ var t = I;
440
+ e.__c = e.__(), I = t;
378
441
  }
379
- function Ae(e, t) {
442
+ function Re(e, t) {
380
443
  return !e || e.length !== t.length || t.some(function(t, n) {
381
444
  return t !== e[n];
382
445
  });
383
446
  }
384
- function je(e, t) {
447
+ function ze(e, t) {
385
448
  return typeof t == "function" ? t(e) : t;
386
449
  }
387
- for (var Me = "1.38.0", V = [], H = [], Ne = Uint8Array, Pe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Fe = 0, Ie = Pe.length; Fe < Ie; ++Fe) V[Fe] = Pe[Fe], H[Pe.charCodeAt(Fe)] = Fe;
388
- H[45] = 62, H[95] = 63;
389
- function Le(e) {
450
+ for (var Be = "1.38.0", U = [], W = [], Ve = Uint8Array, He = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Ue = 0, We = He.length; Ue < We; ++Ue) U[Ue] = He[Ue], W[He.charCodeAt(Ue)] = Ue;
451
+ W[45] = 62, W[95] = 63;
452
+ function Ge(e) {
390
453
  var t = e.length;
391
454
  if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
392
455
  var n = e.indexOf("=");
@@ -394,33 +457,33 @@ function Le(e) {
394
457
  var r = n === t ? 0 : 4 - n % 4;
395
458
  return [n, r];
396
459
  }
397
- function Re(e, t, n) {
460
+ function Ke(e, t, n) {
398
461
  return (t + n) * 3 / 4 - n;
399
462
  }
400
- function ze(e) {
401
- var t, n = Le(e), r = n[0], i = n[1], a = new Ne(Re(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
402
- for (c = 0; c < s; c += 4) t = H[e.charCodeAt(c)] << 18 | H[e.charCodeAt(c + 1)] << 12 | H[e.charCodeAt(c + 2)] << 6 | H[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
403
- return i === 2 && (t = H[e.charCodeAt(c)] << 2 | H[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = H[e.charCodeAt(c)] << 10 | H[e.charCodeAt(c + 1)] << 4 | H[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
463
+ function qe(e) {
464
+ var t, n = Ge(e), r = n[0], i = n[1], a = new Ve(Ke(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
465
+ for (c = 0; c < s; c += 4) t = W[e.charCodeAt(c)] << 18 | W[e.charCodeAt(c + 1)] << 12 | W[e.charCodeAt(c + 2)] << 6 | W[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
466
+ return i === 2 && (t = W[e.charCodeAt(c)] << 2 | W[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = W[e.charCodeAt(c)] << 10 | W[e.charCodeAt(c + 1)] << 4 | W[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
404
467
  }
405
- function Be(e) {
406
- return V[e >> 18 & 63] + V[e >> 12 & 63] + V[e >> 6 & 63] + V[e & 63];
468
+ function Je(e) {
469
+ return U[e >> 18 & 63] + U[e >> 12 & 63] + U[e >> 6 & 63] + U[e & 63];
407
470
  }
408
- function Ve(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(Be(r));
471
+ function Ye(e, t, n) {
472
+ 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(Je(r));
410
473
  return i.join("");
411
474
  }
412
- function He(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(Ve(e, o, o + a > s ? s : o + a));
414
- return r === 1 ? (t = e[n - 1], i.push(V[t >> 2] + V[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(V[t >> 10] + V[t >> 4 & 63] + V[t << 2 & 63] + "=")), i.join("");
475
+ function Xe(e) {
476
+ for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(Ye(e, o, o + a > s ? s : o + a));
477
+ return r === 1 ? (t = e[n - 1], i.push(U[t >> 2] + U[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(U[t >> 10] + U[t >> 4 & 63] + U[t << 2 & 63] + "=")), i.join("");
415
478
  }
416
479
  //#endregion
417
480
  //#region ../../node_modules/.pnpm/convex@1.38.0_react@19.2.6/node_modules/convex/dist/esm/common/index.js
418
- function U(e) {
481
+ function Ze(e) {
419
482
  if (e === void 0) return {};
420
- if (!We(e)) throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);
483
+ if (!$e(e)) throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);
421
484
  return e;
422
485
  }
423
- function Ue(e) {
486
+ function Qe(e) {
424
487
  if (e === void 0) throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");
425
488
  if (typeof e != "string") throw Error(`Invalid deployment address: found ${e}".`);
426
489
  if (!(e.startsWith("http:") || e.startsWith("https:"))) throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);
@@ -431,146 +494,146 @@ function Ue(e) {
431
494
  }
432
495
  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
496
  }
434
- function We(e) {
497
+ function $e(e) {
435
498
  let t = typeof e == "object", n = Object.getPrototypeOf(e), r = n === null || n === Object.prototype || n?.constructor?.name === "Object";
436
499
  return t && r;
437
500
  }
438
501
  //#endregion
439
502
  //#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) {
503
+ var et = !0, tt = BigInt("-9223372036854775808"), nt = BigInt("9223372036854775807"), rt = BigInt("0"), it = BigInt("8"), at = BigInt("256");
504
+ function ot(e) {
442
505
  return Number.isNaN(e) || !Number.isFinite(e) || Object.is(e, -0);
443
506
  }
444
- function Qe(e) {
445
- e < Je && (e -= Ke + Ke);
507
+ function st(e) {
508
+ e < rt && (e -= tt + tt);
446
509
  let t = e.toString(16);
447
510
  t.length % 2 == 1 && (t = "0" + t);
448
511
  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 He(n);
512
+ for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>= it;
513
+ return Xe(n);
451
514
  }
452
- function $e(e) {
453
- let t = ze(e);
515
+ function ct(e) {
516
+ let t = qe(e);
454
517
  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;
518
+ let n = rt, r = rt;
519
+ for (let e of t) n += BigInt(e) * at ** r, r++;
520
+ return n > nt && (n += tt + tt), n;
458
521
  }
459
- function et(e) {
460
- if (e < Ke || qe < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
522
+ function lt(e) {
523
+ if (e < tt || nt < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
461
524
  let t = /* @__PURE__ */ new ArrayBuffer(8);
462
- return new DataView(t).setBigInt64(0, e, !0), He(new Uint8Array(t));
525
+ return new DataView(t).setBigInt64(0, e, !0), Xe(new Uint8Array(t));
463
526
  }
464
- function tt(e) {
465
- let t = ze(e);
527
+ function ut(e) {
528
+ let t = qe(e);
466
529
  if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
467
530
  return new DataView(t.buffer).getBigInt64(0, !0);
468
531
  }
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}.`);
532
+ var dt = DataView.prototype.setBigInt64 ? lt : st, ft = DataView.prototype.getBigInt64 ? ut : ct, pt = 1024;
533
+ function mt(e) {
534
+ if (e.length > pt) throw Error(`Field name ${e} exceeds maximum field name length ${pt}.`);
472
535
  if (e.startsWith("$")) throw Error(`Field name ${e} starts with a '$', which is reserved.`);
473
536
  for (let t = 0; t < e.length; t += 1) {
474
537
  let n = e.charCodeAt(t);
475
538
  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
539
  }
477
540
  }
478
- function ot(e) {
541
+ function ht(e) {
479
542
  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));
543
+ if (Array.isArray(e)) return e.map((e) => ht(e));
481
544
  if (typeof e != "object") throw Error(`Unexpected type of ${e}`);
482
545
  let t = Object.entries(e);
483
546
  if (t.length === 1) {
484
547
  let n = t[0][0];
485
548
  if (n === "$bytes") {
486
549
  if (typeof e.$bytes != "string") throw Error(`Malformed $bytes field on ${e}`);
487
- return ze(e.$bytes).buffer;
550
+ return qe(e.$bytes).buffer;
488
551
  }
489
552
  if (n === "$integer") {
490
553
  if (typeof e.$integer != "string") throw Error(`Malformed $integer field on ${e}`);
491
- return rt(e.$integer);
554
+ return ft(e.$integer);
492
555
  }
493
556
  if (n === "$float") {
494
557
  if (typeof e.$float != "string") throw Error(`Malformed $float field on ${e}`);
495
- let t = ze(e.$float);
558
+ let t = qe(e.$float);
496
559
  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`);
560
+ let n = new DataView(t.buffer).getFloat64(0, et);
561
+ if (!ot(n)) throw Error(`Float ${n} should be encoded as a number`);
499
562
  return n;
500
563
  }
501
564
  if (n === "$set") throw Error("Received a Set which is no longer supported as a Convex type.");
502
565
  if (n === "$map") throw Error("Received a Map which is no longer supported as a Convex type.");
503
566
  }
504
567
  let n = {};
505
- for (let [t, r] of Object.entries(e)) at(t), n[t] = ot(r);
568
+ for (let [t, r] of Object.entries(e)) mt(t), n[t] = ht(r);
506
569
  return n;
507
570
  }
508
- var st = 16384;
509
- function ct(e) {
571
+ var gt = 16384;
572
+ function _t(e) {
510
573
  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);
574
+ if (t.length > gt) {
575
+ let e = gt - 14, n = t.codePointAt(e - 1);
513
576
  return n !== void 0 && n > 65535 && --e, t.substring(0, e) + "[...truncated]";
514
577
  }
515
578
  return t;
516
579
  }
517
- function lt(e, t, n, r) {
580
+ function vt(e, t, n, r) {
518
581
  if (e === void 0) {
519
- let e = n && ` (present at path ${n} in original object ${ct(t)})`;
582
+ let e = n && ` (present at path ${n} in original object ${_t(t)})`;
520
583
  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
584
  }
522
585
  if (e === null) return e;
523
586
  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) };
587
+ if (e < tt || nt < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
588
+ return { $integer: dt(e) };
526
589
  }
527
- if (typeof e == "number") if (Ze(e)) {
590
+ if (typeof e == "number") if (ot(e)) {
528
591
  let t = /* @__PURE__ */ new ArrayBuffer(8);
529
- return new DataView(t).setFloat64(0, e, Ge), { $float: He(new Uint8Array(t)) };
592
+ return new DataView(t).setFloat64(0, e, et), { $float: Xe(new Uint8Array(t)) };
530
593
  } else return e;
531
594
  if (typeof e == "boolean" || typeof e == "string") return e;
532
- if (e instanceof ArrayBuffer) return { $bytes: He(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)) {
595
+ if (e instanceof ArrayBuffer) return { $bytes: Xe(new Uint8Array(e)) };
596
+ if (Array.isArray(e)) return e.map((e, r) => vt(e, t, n + `[${r}]`, !1));
597
+ if (e instanceof Set) throw Error(yt(n, "Set", [...e], t));
598
+ if (e instanceof Map) throw Error(yt(n, "Map", [...e], t));
599
+ if (!$e(e)) {
537
600
  let r = e?.constructor?.name, i = r ? `${r} ` : "";
538
- throw Error(ut(n, i, e, t));
601
+ throw Error(yt(n, i, e, t));
539
602
  }
540
603
  let i = {}, a = Object.entries(e);
541
604
  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));
605
+ for (let [e, o] of a) o === void 0 ? r && (mt(e), i[e] = bt(o, t, n + `.${e}`)) : (mt(e), i[e] = vt(o, t, n + `.${e}`, !1));
543
606
  return i;
544
607
  }
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.`;
608
+ function yt(e, t, n, r) {
609
+ return e ? `${t}${_t(n)} is not a supported Convex type (present at path ${e} in original object ${_t(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${t}${_t(n)} is not a supported Convex type.`;
547
610
  }
548
- function dt(e, t, n) {
611
+ function bt(e, t, n) {
549
612
  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);
613
+ if (t === void 0) throw Error(`Programming error. Current value is ${_t(e)} but original value is undefined`);
614
+ return vt(e, t, n, !1);
552
615
  }
553
- function ft(e) {
554
- return lt(e, e, "", !1);
616
+ function xt(e) {
617
+ return vt(e, e, "", !1);
555
618
  }
556
619
  //#endregion
557
620
  //#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, {
621
+ var St = Object.defineProperty, Ct = (e, t, n) => t in e ? St(e, t, {
559
622
  enumerable: !0,
560
623
  configurable: !0,
561
624
  writable: !0,
562
625
  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) {
626
+ }) : e[t] = n, wt = (e, t, n) => Ct(e, typeof t == "symbol" ? t : t + "", n), Tt, Et, Dt = Symbol.for("ConvexError"), Ot = class extends (Et = Error, Tt = Dt, Et) {
564
627
  constructor(e) {
565
- super(typeof e == "string" ? e : ct(e)), ht(this, "name", "ConvexError"), ht(this, "data"), ht(this, gt, !0), this.data = e;
628
+ super(typeof e == "string" ? e : _t(e)), wt(this, "name", "ConvexError"), wt(this, "data"), wt(this, Tt, !0), this.data = e;
566
629
  }
567
- }, bt = Object.defineProperty, xt = (e, t, n) => t in e ? bt(e, t, {
630
+ }, kt = Object.defineProperty, At = (e, t, n) => t in e ? kt(e, t, {
568
631
  enumerable: !0,
569
632
  configurable: !0,
570
633
  writable: !0,
571
634
  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) {
635
+ }) : e[t] = n, jt = (e, t, n) => At(e, typeof t == "symbol" ? t : t + "", n), Mt = "color:rgb(0, 145, 255)";
636
+ function Nt(e) {
574
637
  switch (e) {
575
638
  case "query": return "Q";
576
639
  case "mutation": return "M";
@@ -578,9 +641,9 @@ function wt(e) {
578
641
  case "any": return "?";
579
642
  }
580
643
  }
581
- var Tt = class {
644
+ var Pt = class {
582
645
  constructor(e) {
583
- St(this, "_onLogLineFuncs"), St(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
646
+ jt(this, "_onLogLineFuncs"), jt(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
584
647
  }
585
648
  addLogLineListener(e) {
586
649
  let t = Math.random().toString(36).substring(2, 15);
@@ -602,8 +665,8 @@ var Tt = class {
602
665
  for (let t of Object.values(this._onLogLineFuncs)) t("error", ...e);
603
666
  }
604
667
  };
605
- function Et(e) {
606
- let t = new Tt(e);
668
+ function Ft(e) {
669
+ let t = new Pt(e);
607
670
  return t.addLogLineListener((e, ...t) => {
608
671
  switch (e) {
609
672
  case "debug":
@@ -622,11 +685,11 @@ function Et(e) {
622
685
  }
623
686
  }), t;
624
687
  }
625
- function Dt(e) {
626
- return new Tt(e);
688
+ function It(e) {
689
+ return new Pt(e);
627
690
  }
628
- function Ot(e, t, n, r, i) {
629
- let a = wt(n);
691
+ function Lt(e, t, n, r, i) {
692
+ let a = Nt(n);
630
693
  if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), t === "info") {
631
694
  let t = i.match(/^\[.*?\] /);
632
695
  if (t === null) {
@@ -634,57 +697,57 @@ function Ot(e, t, n, r, i) {
634
697
  return;
635
698
  }
636
699
  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);
700
+ e.log(`%c[CONVEX ${a}(${r})] [${n}]`, Mt, o);
638
701
  } else e.error(`[CONVEX ${a}(${r})] ${i}`);
639
702
  }
640
- function kt(e, t) {
703
+ function Rt(e, t) {
641
704
  let n = `[CONVEX FATAL ERROR] ${t}`;
642
705
  return e.error(n), Error(n);
643
706
  }
644
- function At(e, t, n) {
645
- return `[CONVEX ${wt(e)}(${t})] ${n.errorMessage}
707
+ function zt(e, t, n) {
708
+ return `[CONVEX ${Nt(e)}(${t})] ${n.errorMessage}
646
709
  Called by client`;
647
710
  }
648
- function jt(e, t) {
711
+ function Bt(e, t) {
649
712
  return t.data = e.errorData, t;
650
713
  }
651
714
  //#endregion
652
715
  //#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) {
716
+ function Vt(e) {
654
717
  let t = e.split(":"), n, r;
655
718
  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
719
  }
657
- function Nt(e, t) {
720
+ function Ht(e, t) {
658
721
  return JSON.stringify({
659
- udfPath: Mt(e),
660
- args: ft(t)
722
+ udfPath: Vt(e),
723
+ args: xt(t)
661
724
  });
662
725
  }
663
- function Pt(e, t, n) {
726
+ function Ut(e, t, n) {
664
727
  let { initialNumItems: r, id: i } = n;
665
728
  return JSON.stringify({
666
729
  type: "paginated",
667
- udfPath: Mt(e),
668
- args: ft(t),
669
- options: ft({
730
+ udfPath: Vt(e),
731
+ args: xt(t),
732
+ options: xt({
670
733
  initialNumItems: r,
671
734
  id: i
672
735
  })
673
736
  });
674
737
  }
675
- function Ft(e) {
738
+ function Wt(e) {
676
739
  return JSON.parse(e).type === "paginated";
677
740
  }
678
741
  //#endregion
679
742
  //#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, {
743
+ var Gt = Object.defineProperty, Kt = (e, t, n) => t in e ? Gt(e, t, {
681
744
  enumerable: !0,
682
745
  configurable: !0,
683
746
  writable: !0,
684
747
  value: n
685
- }) : e[t] = n, W = (e, t, n) => Lt(e, typeof t == "symbol" ? t : t + "", n), Rt = class {
748
+ }) : e[t] = n, G = (e, t, n) => Kt(e, typeof t == "symbol" ? t : t + "", n), qt = class {
686
749
  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();
750
+ 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
751
  }
689
752
  hasSyncedPastLastReconnect() {
690
753
  return this.outstandingQueriesOlderThanRestart.size === 0 && !this.outstandingAuthOlderThanRestart;
@@ -693,7 +756,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
693
756
  this.outstandingAuthOlderThanRestart = !1;
694
757
  }
695
758
  subscribe(e, t, n, r) {
696
- let i = Mt(e), a = Nt(i, t), o = this.querySet.get(a);
759
+ let i = Vt(e), a = Ht(i, t), o = this.querySet.get(a);
697
760
  if (o !== void 0) return o.numSubscribers += 1, {
698
761
  queryToken: a,
699
762
  modification: null,
@@ -713,7 +776,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
713
776
  type: "Add",
714
777
  queryId: e,
715
778
  udfPath: i,
716
- args: [ft(t)],
779
+ args: [xt(t)],
717
780
  journal: n,
718
781
  componentPath: r
719
782
  };
@@ -748,7 +811,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
748
811
  }
749
812
  }
750
813
  queryId(e, t) {
751
- let n = Nt(Mt(e), t), r = this.querySet.get(n);
814
+ let n = Ht(Vt(e), t), r = this.querySet.get(n);
752
815
  return r === void 0 ? null : r.id;
753
816
  }
754
817
  isCurrentOrNewerAuthVersion(e) {
@@ -820,7 +883,7 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
820
883
  type: "Add",
821
884
  queryId: t.id,
822
885
  udfPath: t.canonicalizedUdfPath,
823
- args: [ft(t.args)],
886
+ args: [xt(t.args)],
824
887
  journal: t.journal,
825
888
  componentPath: t.componentPath
826
889
  };
@@ -878,14 +941,14 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
878
941
  };
879
942
  }
880
943
  }
881
- }, zt = Object.defineProperty, Bt = (e, t, n) => t in e ? zt(e, t, {
944
+ }, Jt = Object.defineProperty, Yt = (e, t, n) => t in e ? Jt(e, t, {
882
945
  enumerable: !0,
883
946
  configurable: !0,
884
947
  writable: !0,
885
948
  value: n
886
- }) : e[t] = n, Vt = (e, t, n) => Bt(e, typeof t == "symbol" ? t : t + "", n), Ht = class {
949
+ }) : e[t] = n, Xt = (e, t, n) => Yt(e, typeof t == "symbol" ? t : t + "", n), Zt = class {
887
950
  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();
951
+ this.logger = e, this.markConnectionStateDirty = t, Xt(this, "inflightRequests"), Xt(this, "requestsOlderThanRestart"), Xt(this, "inflightMutationsCount", 0), Xt(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
889
952
  }
890
953
  request(e, t) {
891
954
  let n = new Promise((n) => {
@@ -905,19 +968,19 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
905
968
  let t = this.inflightRequests.get(e.requestId);
906
969
  if (t === void 0 || t.status.status === "Completed") return null;
907
970
  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);
971
+ for (let t of e.logLines) Lt(this.logger, "info", n, r, t);
909
972
  let i = t.status, a, o;
910
973
  if (e.success) a = {
911
974
  success: !0,
912
975
  logLines: e.logLines,
913
- value: ot(e.result)
976
+ value: ht(e.result)
914
977
  }, o = () => i.onResult(a);
915
978
  else {
916
979
  let t = e.result, { errorData: s } = e;
917
- Ot(this.logger, "error", n, r, t), a = {
980
+ Lt(this.logger, "error", n, r, t), a = {
918
981
  success: !1,
919
982
  errorMessage: t,
920
- errorData: s === void 0 ? void 0 : ot(s),
983
+ errorData: s === void 0 ? void 0 : ht(s),
921
984
  logLines: e.logLines
922
985
  }, o = () => i.onResult(a);
923
986
  }
@@ -989,19 +1052,19 @@ var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
989
1052
  inflightActions() {
990
1053
  return this.inflightActionsCount;
991
1054
  }
992
- }, Ut = Symbol.for("functionName"), Wt = Symbol.for("toReferencePath");
993
- function Gt(e) {
994
- return e[Wt] ?? null;
1055
+ }, Qt = Symbol.for("functionName"), $t = Symbol.for("toReferencePath");
1056
+ function en(e) {
1057
+ return e[$t] ?? null;
995
1058
  }
996
- function Kt(e) {
1059
+ function tn(e) {
997
1060
  return e.startsWith("function://");
998
1061
  }
999
- function qt(e) {
1062
+ function nn(e) {
1000
1063
  let t;
1001
- if (typeof e == "string") t = Kt(e) ? { functionHandle: e } : { name: e };
1002
- else if (e[Ut]) t = { name: e[Ut] };
1064
+ if (typeof e == "string") t = tn(e) ? { functionHandle: e } : { name: e };
1065
+ else if (e[Qt]) t = { name: e[Qt] };
1003
1066
  else {
1004
- let n = Gt(e);
1067
+ let n = en(e);
1005
1068
  if (!n) throw Error(`${e} is not a functionReference`);
1006
1069
  t = { reference: n };
1007
1070
  }
@@ -1009,21 +1072,21 @@ function qt(e) {
1009
1072
  }
1010
1073
  //#endregion
1011
1074
  //#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);
1075
+ function K(e) {
1076
+ let t = nn(e);
1014
1077
  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
1078
  if (typeof e == "string") return e;
1016
- let n = e[Ut];
1079
+ let n = e[Qt];
1017
1080
  if (!n) throw Error(`${e} is not a functionReference`);
1018
1081
  return n;
1019
1082
  }
1020
- function Jt(e) {
1021
- return { [Ut]: e };
1083
+ function rn(e) {
1084
+ return { [Qt]: e };
1022
1085
  }
1023
- function Yt(e = []) {
1086
+ function an(e = []) {
1024
1087
  return new Proxy({}, { get(t, n) {
1025
- if (typeof n == "string") return Yt([...e, n]);
1026
- if (n === Ut) {
1088
+ if (typeof n == "string") return an([...e, n]);
1089
+ if (n === Qt) {
1027
1090
  if (e.length < 2) {
1028
1091
  let t = ["api", ...e].join(".");
1029
1092
  throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``);
@@ -1034,32 +1097,32 @@ function Yt(e = []) {
1034
1097
  else return;
1035
1098
  } });
1036
1099
  }
1037
- Yt();
1100
+ an();
1038
1101
  //#endregion
1039
1102
  //#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, {
1103
+ var on = Object.defineProperty, sn = (e, t, n) => t in e ? on(e, t, {
1041
1104
  enumerable: !0,
1042
1105
  configurable: !0,
1043
1106
  writable: !0,
1044
1107
  value: n
1045
- }) : e[t] = n, Qt = (e, t, n) => Zt(e, typeof t == "symbol" ? t : t + "", n), $t = class e {
1108
+ }) : e[t] = n, cn = (e, t, n) => sn(e, typeof t == "symbol" ? t : t + "", n), ln = class e {
1046
1109
  constructor(e) {
1047
- Qt(this, "queryResults"), Qt(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
1110
+ cn(this, "queryResults"), cn(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
1048
1111
  }
1049
1112
  getQuery(t, ...n) {
1050
- let r = U(n[0]), i = G(t), a = this.queryResults.get(Nt(i, r));
1113
+ let r = Ze(n[0]), i = K(t), a = this.queryResults.get(Ht(i, r));
1051
1114
  if (a !== void 0) return e.queryValue(a.result);
1052
1115
  }
1053
1116
  getAllQueries(t) {
1054
- let n = [], r = G(t);
1055
- for (let t of this.queryResults.values()) t.udfPath === Mt(r) && n.push({
1117
+ let n = [], r = K(t);
1118
+ for (let t of this.queryResults.values()) t.udfPath === Vt(r) && n.push({
1056
1119
  args: t.args,
1057
1120
  value: e.queryValue(t.result)
1058
1121
  });
1059
1122
  return n;
1060
1123
  }
1061
1124
  setQuery(e, t, n) {
1062
- let r = U(t), i = G(e), a = Nt(i, r), o;
1125
+ let r = Ze(t), i = K(e), a = Ht(i, r), o;
1063
1126
  o = n === void 0 ? void 0 : {
1064
1127
  success: !0,
1065
1128
  value: n,
@@ -1075,15 +1138,15 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1075
1138
  static queryValue(e) {
1076
1139
  if (e !== void 0 && e.success) return e.value;
1077
1140
  }
1078
- }, en = class {
1141
+ }, un = class {
1079
1142
  constructor() {
1080
- Qt(this, "queryResults"), Qt(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
1143
+ cn(this, "queryResults"), cn(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
1081
1144
  }
1082
1145
  ingestQueryResultsFromServer(e, t) {
1083
1146
  this.optimisticUpdates = this.optimisticUpdates.filter((e) => !t.has(e.mutationId));
1084
1147
  let n = this.queryResults;
1085
1148
  this.queryResults = new Map(e);
1086
- let r = new $t(this.queryResults);
1149
+ let r = new ln(this.queryResults);
1087
1150
  for (let e of this.optimisticUpdates) e.update(r);
1088
1151
  let i = [];
1089
1152
  for (let [e, t] of this.queryResults) {
@@ -1097,7 +1160,7 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1097
1160
  update: e,
1098
1161
  mutationId: t
1099
1162
  });
1100
- let n = new $t(this.queryResults);
1163
+ let n = new ln(this.queryResults);
1101
1164
  return e(n), n.modifiedQueries;
1102
1165
  }
1103
1166
  rawQueryResult(e) {
@@ -1110,7 +1173,7 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1110
1173
  let n = t.result;
1111
1174
  if (n !== void 0) {
1112
1175
  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)));
1176
+ throw n.errorData === void 0 ? Error(zt("query", t.udfPath, n)) : Bt(n, new Ot(zt("query", t.udfPath, n)));
1114
1177
  }
1115
1178
  }
1116
1179
  hasQueryResult(e) {
@@ -1119,14 +1182,14 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1119
1182
  queryLogs(e) {
1120
1183
  return this.queryResults.get(e)?.result?.logLines;
1121
1184
  }
1122
- }, tn = Object.defineProperty, nn = (e, t, n) => t in e ? tn(e, t, {
1185
+ }, dn = Object.defineProperty, fn = (e, t, n) => t in e ? dn(e, t, {
1123
1186
  enumerable: !0,
1124
1187
  configurable: !0,
1125
1188
  writable: !0,
1126
1189
  value: n
1127
- }) : e[t] = n, rn = (e, t, n) => nn(e, typeof t == "symbol" ? t : t + "", n), an = class e {
1190
+ }) : e[t] = n, pn = (e, t, n) => fn(e, typeof t == "symbol" ? t : t + "", n), mn = class e {
1128
1191
  constructor(e, t) {
1129
- rn(this, "low"), rn(this, "high"), rn(this, "__isUnsignedLong__"), this.low = e | 0, this.high = t | 0, this.__isUnsignedLong__ = !0;
1192
+ pn(this, "low"), pn(this, "high"), pn(this, "__isUnsignedLong__"), this.low = e | 0, this.high = t | 0, this.__isUnsignedLong__ = !0;
1130
1193
  }
1131
1194
  static isLong(e) {
1132
1195
  return (e && e.__isUnsignedLong__) === !0;
@@ -1148,10 +1211,10 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1148
1211
  ];
1149
1212
  }
1150
1213
  static fromNumber(t) {
1151
- return isNaN(t) || t < 0 ? on : t >= ln ? un : new e(t % cn | 0, t / cn | 0);
1214
+ return isNaN(t) || t < 0 ? hn : t >= vn ? yn : new e(t % _n | 0, t / _n | 0);
1152
1215
  }
1153
1216
  toString() {
1154
- return (BigInt(this.high) * BigInt(cn) + BigInt(this.low)).toString();
1217
+ return (BigInt(this.high) * BigInt(_n) + BigInt(this.low)).toString();
1155
1218
  }
1156
1219
  equals(t) {
1157
1220
  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 +1231,16 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1168
1231
  static fromValue(t) {
1169
1232
  return typeof t == "number" ? e.fromNumber(t) : new e(t.low, t.high);
1170
1233
  }
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, {
1234
+ }, hn = new mn(0, 0), gn = 65536, _n = gn * gn, vn = _n * _n, yn = new mn(-1, -1), bn = Object.defineProperty, xn = (e, t, n) => t in e ? bn(e, t, {
1172
1235
  enumerable: !0,
1173
1236
  configurable: !0,
1174
1237
  writable: !0,
1175
1238
  value: n
1176
- }) : e[t] = n, pn = (e, t, n) => fn(e, typeof t == "symbol" ? t : t + "", n), mn = class {
1239
+ }) : e[t] = n, Sn = (e, t, n) => xn(e, typeof t == "symbol" ? t : t + "", n), Cn = class {
1177
1240
  constructor(e, t) {
1178
- pn(this, "version"), pn(this, "remoteQuerySet"), pn(this, "queryPath"), pn(this, "logger"), this.version = {
1241
+ Sn(this, "version"), Sn(this, "remoteQuerySet"), Sn(this, "queryPath"), Sn(this, "logger"), this.version = {
1179
1242
  querySet: 0,
1180
- ts: an.fromNumber(0),
1243
+ ts: mn.fromNumber(0),
1181
1244
  identity: 0
1182
1245
  }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = t;
1183
1246
  }
@@ -1187,8 +1250,8 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1187
1250
  for (let t of e.modifications) switch (t.type) {
1188
1251
  case "QueryUpdated": {
1189
1252
  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);
1253
+ if (e) for (let n of t.logLines) Lt(this.logger, "info", "query", e, n);
1254
+ let n = ht(t.value ?? null);
1192
1255
  this.remoteQuerySet.set(t.queryId, {
1193
1256
  success: !0,
1194
1257
  value: n,
@@ -1198,12 +1261,12 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1198
1261
  }
1199
1262
  case "QueryFailed": {
1200
1263
  let e = this.queryPath(t.queryId);
1201
- if (e) for (let n of t.logLines) Ot(this.logger, "info", "query", e, n);
1264
+ if (e) for (let n of t.logLines) Lt(this.logger, "info", "query", e, n);
1202
1265
  let { errorData: n } = t;
1203
1266
  this.remoteQuerySet.set(t.queryId, {
1204
1267
  success: !1,
1205
1268
  errorMessage: t.errorMessage,
1206
- errorData: n === void 0 ? void 0 : ot(n),
1269
+ errorData: n === void 0 ? void 0 : ht(n),
1207
1270
  logLines: t.logLines
1208
1271
  });
1209
1272
  break;
@@ -1224,14 +1287,14 @@ var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
1224
1287
  };
1225
1288
  //#endregion
1226
1289
  //#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 = ze(e);
1229
- return an.fromBytesLE(Array.from(t));
1290
+ function wn(e) {
1291
+ let t = qe(e);
1292
+ return mn.fromBytesLE(Array.from(t));
1230
1293
  }
1231
- function gn(e) {
1232
- return He(new Uint8Array(e.toBytesLE()));
1294
+ function Tn(e) {
1295
+ return Xe(new Uint8Array(e.toBytesLE()));
1233
1296
  }
1234
- function _n(e) {
1297
+ function En(e) {
1235
1298
  switch (e.type) {
1236
1299
  case "FatalError":
1237
1300
  case "AuthError":
@@ -1240,23 +1303,23 @@ function _n(e) {
1240
1303
  case "Ping": return { ...e };
1241
1304
  case "MutationResponse": return e.success ? {
1242
1305
  ...e,
1243
- ts: hn(e.ts)
1306
+ ts: wn(e.ts)
1244
1307
  } : { ...e };
1245
1308
  case "Transition": return {
1246
1309
  ...e,
1247
1310
  startVersion: {
1248
1311
  ...e.startVersion,
1249
- ts: hn(e.startVersion.ts)
1312
+ ts: wn(e.startVersion.ts)
1250
1313
  },
1251
1314
  endVersion: {
1252
1315
  ...e.endVersion,
1253
- ts: hn(e.endVersion.ts)
1316
+ ts: wn(e.endVersion.ts)
1254
1317
  }
1255
1318
  };
1256
1319
  default:
1257
1320
  }
1258
1321
  }
1259
- function vn(e) {
1322
+ function Dn(e) {
1260
1323
  switch (e.type) {
1261
1324
  case "Authenticate":
1262
1325
  case "ModifyQuerySet":
@@ -1268,26 +1331,26 @@ function vn(e) {
1268
1331
  maxObservedTimestamp: void 0
1269
1332
  } : {
1270
1333
  ...e,
1271
- maxObservedTimestamp: gn(e.maxObservedTimestamp)
1334
+ maxObservedTimestamp: Tn(e.maxObservedTimestamp)
1272
1335
  };
1273
1336
  default:
1274
1337
  }
1275
1338
  }
1276
1339
  //#endregion
1277
1340
  //#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, {
1341
+ var On = Object.defineProperty, kn = (e, t, n) => t in e ? On(e, t, {
1279
1342
  enumerable: !0,
1280
1343
  configurable: !0,
1281
1344
  writable: !0,
1282
1345
  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());
1346
+ }) : e[t] = n, q = (e, t, n) => kn(e, typeof t == "symbol" ? t : t + "", n), An = 1e3, jn = 1001, Mn = 1005, Nn = 4040, Pn;
1347
+ function Fn() {
1348
+ return Pn === void 0 && (Pn = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(Pn + performance.now());
1286
1349
  }
1287
- function Dn() {
1288
- return `t=${Math.round((En() - Tn) / 100) / 10}s`;
1350
+ function In() {
1351
+ return `t=${Math.round((Fn() - Pn) / 100) / 10}s`;
1289
1352
  }
1290
- var On = {
1353
+ var Ln = {
1291
1354
  InternalServerError: { timeout: 1e3 },
1292
1355
  SubscriptionsWorkerFullError: { timeout: 3e3 },
1293
1356
  TooManyConcurrentRequests: { timeout: 3e3 },
@@ -1303,14 +1366,14 @@ var On = {
1303
1366
  SearchIndexTooLarge: { timeout: 3e3 },
1304
1367
  TooManyWritesInTimePeriod: { timeout: 3e3 }
1305
1368
  };
1306
- function kn(e) {
1369
+ function Rn(e) {
1307
1370
  if (e === void 0) return "Unknown";
1308
- for (let t of Object.keys(On)) if (e.startsWith(t)) return t;
1371
+ for (let t of Object.keys(Ln)) if (e.startsWith(t)) return t;
1309
1372
  return "Unknown";
1310
1373
  }
1311
- var An = class {
1374
+ var zn = class {
1312
1375
  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();
1376
+ 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
1377
  }
1315
1378
  setSocketState(e) {
1316
1379
  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 +1399,7 @@ var An = class {
1336
1399
  if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
1337
1400
  let e = this.transitionChunkBuffer.chunks.join("");
1338
1401
  this.transitionChunkBuffer = null;
1339
- let t = _n(JSON.parse(e));
1402
+ let t = En(JSON.parse(e));
1340
1403
  if (t.type !== "Transition") throw Error(`Expected Transition, got ${t.type} after assembling chunks`);
1341
1404
  return t;
1342
1405
  }
@@ -1359,8 +1422,8 @@ var An = class {
1359
1422
  }), this.resetServerInactivityTimeout(), this.socket.paused === "no" && (this._hasEverConnected = !0, this.onOpen({
1360
1423
  connectionCount: this.connectionCount,
1361
1424
  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) {
1425
+ clientTs: Fn()
1426
+ })), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at", In(), "after disconnect due to", this.lastCloseReason) : this.logger.log("WebSocket reconnected at", In())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
1364
1427
  let { timeSavedMs: e } = this.pendingNetworkRecoveryInfo;
1365
1428
  this.pendingNetworkRecoveryInfo = null, this.sendMessage({
1366
1429
  type: "Event",
@@ -1374,7 +1437,7 @@ var An = class {
1374
1437
  t && this.logger.log(`WebSocket error message: ${t}`);
1375
1438
  }, e.onmessage = (e) => {
1376
1439
  this.resetServerInactivityTimeout();
1377
- let t = e.data.length, n = _n(JSON.parse(e.data));
1440
+ let t = e.data.length, n = En(JSON.parse(e.data));
1378
1441
  if (this._logVerbose(`received ws message with type ${n.type}`), n.type !== "Ping") {
1379
1442
  if (n.type === "TransitionChunk") {
1380
1443
  let e = this.assembleTransition(n);
@@ -1387,11 +1450,11 @@ var An = class {
1387
1450
  }), this.onMessage(n).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
1388
1451
  }
1389
1452
  }, 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) {
1453
+ if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !== An && e.code !== jn && e.code !== Mn && e.code !== Nn) {
1391
1454
  let t = `WebSocket closed with code ${e.code}`;
1392
1455
  e.reason && (t += `: ${e.reason}`), this.logger.log(t), this.onServerDisconnectError && e.reason && this.onServerDisconnectError(t);
1393
1456
  }
1394
- let t = kn(e.reason);
1457
+ let t = Rn(e.reason);
1395
1458
  this.scheduleReconnect(t);
1396
1459
  };
1397
1460
  }
@@ -1404,7 +1467,7 @@ var An = class {
1404
1467
  ...e.type === "Authenticate" && e.tokenType === "User" ? { value: `...${e.value.slice(-7)}` } : {}
1405
1468
  };
1406
1469
  if (this.socket.state === "ready" && this.socket.paused === "no") {
1407
- let n = vn(e), r = JSON.stringify(n), i = !1;
1470
+ let n = Dn(e), r = JSON.stringify(n), i = !1;
1408
1471
  try {
1409
1472
  this.socket.ws.send(r), i = !0;
1410
1473
  } catch (e) {
@@ -1423,7 +1486,7 @@ var An = class {
1423
1486
  this.scheduledReconnect &&= (clearTimeout(this.scheduledReconnect.timeout), null), this.socket = { state: "disconnected" };
1424
1487
  let t = this.nextBackoff(e);
1425
1488
  this.markConnectionStateDirty(), this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);
1426
- let n = En(), r = setTimeout(() => {
1489
+ let n = Fn(), r = setTimeout(() => {
1427
1490
  this.scheduledReconnect?.timeout === r && (this.scheduledReconnect = null, this.connect());
1428
1491
  }, t);
1429
1492
  this.scheduledReconnect = {
@@ -1541,7 +1604,7 @@ var An = class {
1541
1604
  }
1542
1605
  let e = null;
1543
1606
  if (this.scheduledReconnect) {
1544
- let t = En() - this.scheduledReconnect.scheduledAt;
1607
+ let t = Fn() - this.scheduledReconnect.scheduledAt;
1545
1608
  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
1609
  }
1547
1610
  this.logger.log("Network recovery detected, reconnecting immediately"), this.pendingNetworkRecoveryInfo = e === null ? null : { timeSavedMs: e }, this.connect();
@@ -1561,7 +1624,7 @@ var An = class {
1561
1624
  }, this._hasEverConnected = !0, this.onOpen({
1562
1625
  connectionCount: this.connectionCount,
1563
1626
  lastCloseReason: this.lastCloseReason,
1564
- clientTs: En()
1627
+ clientTs: Fn()
1565
1628
  })) : this.socket.paused === "yes" && (this.socket = {
1566
1629
  ...this.socket,
1567
1630
  paused: "no"
@@ -1586,14 +1649,14 @@ var An = class {
1586
1649
  this.logger.logVerbose(e);
1587
1650
  }
1588
1651
  nextBackoff(e) {
1589
- let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : On[e].timeout) * 2 ** this.retries;
1652
+ let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : Ln[e].timeout) * 2 ** this.retries;
1590
1653
  this.retries += 1;
1591
1654
  let n = Math.min(t, this.maxBackoff);
1592
1655
  return n + n * (Math.random() - .5);
1593
1656
  }
1594
1657
  reportLargeTransition({ transition: e, messageLength: t }) {
1595
1658
  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`;
1659
+ let n = Fn() - 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
1660
  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
1661
  type: "Event",
1599
1662
  eventType: "ClientReceivedTransition",
@@ -1606,10 +1669,10 @@ var An = class {
1606
1669
  };
1607
1670
  //#endregion
1608
1671
  //#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();
1672
+ function Bn() {
1673
+ return Vn();
1611
1674
  }
1612
- function Mn() {
1675
+ function Vn() {
1613
1676
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
1614
1677
  let t = Math.random() * 16 | 0;
1615
1678
  return (e === "x" ? t : t & 3 | 8).toString(16);
@@ -1617,15 +1680,15 @@ function Mn() {
1617
1680
  }
1618
1681
  //#endregion
1619
1682
  //#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) {
1683
+ var Hn = class extends Error {};
1684
+ Hn.prototype.name = "InvalidTokenError";
1685
+ function Un(e) {
1623
1686
  return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
1624
1687
  let n = t.charCodeAt(0).toString(16).toUpperCase();
1625
1688
  return n.length < 2 && (n = "0" + n), "%" + n;
1626
1689
  }));
1627
1690
  }
1628
- function Fn(e) {
1691
+ function Wn(e) {
1629
1692
  let t = e.replace(/-/g, "+").replace(/_/g, "/");
1630
1693
  switch (t.length % 4) {
1631
1694
  case 0: break;
@@ -1638,38 +1701,38 @@ function Fn(e) {
1638
1701
  default: throw Error("base64 string is not of the correct length");
1639
1702
  }
1640
1703
  try {
1641
- return Pn(t);
1704
+ return Un(t);
1642
1705
  } catch {
1643
1706
  return atob(t);
1644
1707
  }
1645
1708
  }
1646
- function In(e, t) {
1647
- if (typeof e != "string") throw new Nn("Invalid token specified: must be a string");
1709
+ function Gn(e, t) {
1710
+ if (typeof e != "string") throw new Hn("Invalid token specified: must be a string");
1648
1711
  t ||= {};
1649
1712
  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}`);
1713
+ if (typeof r != "string") throw new Hn(`Invalid token specified: missing part #${n + 1}`);
1651
1714
  let i;
1652
1715
  try {
1653
- i = Fn(r);
1716
+ i = Wn(r);
1654
1717
  } catch (e) {
1655
- throw new Nn(`Invalid token specified: invalid base64 for part #${n + 1} (${e.message})`);
1718
+ throw new Hn(`Invalid token specified: invalid base64 for part #${n + 1} (${e.message})`);
1656
1719
  }
1657
1720
  try {
1658
1721
  return JSON.parse(i);
1659
1722
  } catch (e) {
1660
- throw new Nn(`Invalid token specified: invalid json for part #${n + 1} (${e.message})`);
1723
+ throw new Hn(`Invalid token specified: invalid json for part #${n + 1} (${e.message})`);
1661
1724
  }
1662
1725
  }
1663
1726
  //#endregion
1664
1727
  //#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, {
1728
+ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1666
1729
  enumerable: !0,
1667
1730
  configurable: !0,
1668
1731
  writable: !0,
1669
1732
  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 {
1733
+ }) : e[t] = n, J = (e, t, n) => qn(e, typeof t == "symbol" ? t : t + "", n), Jn = 480 * 60 * 60 * 1e3, Yn = 2, Xn = class {
1671
1734
  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;
1735
+ 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
1736
  }
1674
1737
  async setConfig(e, t) {
1675
1738
  this.resetAuthState(), this._logVerbose("pausing WS for auth token fetch"), this.pauseSocket();
@@ -1711,11 +1774,11 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1711
1774
  this.tryToReauthenticate(e);
1712
1775
  }
1713
1776
  async tryToReauthenticate(e) {
1714
- if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= Bn) {
1777
+ if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= Yn) {
1715
1778
  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
1779
  return;
1717
1780
  }
1718
- this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${Bn - this.tokenConfirmationAttempts} attempts remaining`)), await this.stopSocket();
1781
+ this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${Yn - this.tokenConfirmationAttempts} attempts remaining`)), await this.stopSocket();
1719
1782
  let t = await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken, { forceRefreshToken: !0 });
1720
1783
  t.isFromOutdatedConfig || (t.value && this.syncState.isNewAuth(t.value) ? (this.authenticate(t.value), this.setAuthState({
1721
1784
  state: "waitingForServerConfirmationOfFreshToken",
@@ -1755,7 +1818,7 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1755
1818
  this.logger.error("Auth token does not live long enough, cannot refetch the token");
1756
1819
  return;
1757
1820
  }
1758
- let a = Math.min(zn, (i - this.refreshTokenLeewaySeconds) * 1e3);
1821
+ let a = Math.min(Jn, (i - this.refreshTokenLeewaySeconds) * 1e3);
1759
1822
  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
1823
  let o = setTimeout(() => {
1761
1824
  this._logVerbose("running scheduled token refetch"), this.refetchToken();
@@ -1805,7 +1868,7 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1805
1868
  }
1806
1869
  decodeToken(e) {
1807
1870
  try {
1808
- return In(e);
1871
+ return Gn(e);
1809
1872
  } catch (e) {
1810
1873
  return this._logVerbose(`Error decoding token: ${e instanceof Error ? e.message : "Unknown error"}`), null;
1811
1874
  }
@@ -1813,41 +1876,41 @@ var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
1813
1876
  _logVerbose(e) {
1814
1877
  this.logger.logVerbose(`${e} [v${this.configVersion}]`);
1815
1878
  }
1816
- }, Hn = [
1879
+ }, Zn = [
1817
1880
  "convexClientConstructed",
1818
1881
  "convexWebSocketOpen",
1819
1882
  "convexFirstMessageReceived"
1820
1883
  ];
1821
- function Un(e, t) {
1884
+ function Qn(e, t) {
1822
1885
  let n = { sessionId: t };
1823
1886
  typeof performance > "u" || !performance.mark || performance.mark(e, { detail: n });
1824
1887
  }
1825
- function Wn(e) {
1888
+ function $n(e) {
1826
1889
  let t = e.name.slice(6);
1827
1890
  return t = t.charAt(0).toLowerCase() + t.slice(1), {
1828
1891
  name: t,
1829
1892
  startTime: e.startTime
1830
1893
  };
1831
1894
  }
1832
- function Gn(e) {
1895
+ function er(e) {
1833
1896
  if (typeof performance > "u" || !performance.getEntriesByName) return [];
1834
1897
  let t = [];
1835
- for (let n of Hn) {
1898
+ for (let n of Zn) {
1836
1899
  let r = performance.getEntriesByName(n).filter((e) => e.entryType === "mark").filter((t) => t.detail.sessionId === e);
1837
1900
  t.push(...r);
1838
1901
  }
1839
- return t.map(Wn);
1902
+ return t.map($n);
1840
1903
  }
1841
1904
  //#endregion
1842
1905
  //#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, {
1906
+ var tr = Object.defineProperty, nr = (e, t, n) => t in e ? tr(e, t, {
1844
1907
  enumerable: !0,
1845
1908
  configurable: !0,
1846
1909
  writable: !0,
1847
1910
  value: n
1848
- }) : e[t] = n, J = (e, t, n) => qn(e, typeof t == "symbol" ? t : t + "", n), Jn = class {
1911
+ }) : e[t] = n, Y = (e, t, n) => nr(e, typeof t == "symbol" ? t : t + "", n), rr = class {
1849
1912
  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", () => {
1913
+ 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
1914
  Promise.resolve().then(() => {
1852
1915
  let e = this.connectionState();
1853
1916
  if (JSON.stringify(e) !== JSON.stringify(this._lastPublishedConnectionState)) {
@@ -1855,25 +1918,25 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1855
1918
  for (let t of this.connectionStateSubscribers.values()) t(e);
1856
1919
  }
1857
1920
  });
1858
- }), J(this, "mark", (e) => {
1859
- this.debug && Un(e, this.sessionId);
1921
+ }), Y(this, "mark", (e) => {
1922
+ this.debug && Qn(e, this.sessionId);
1860
1923
  }), 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 };
1924
+ n?.skipConvexDeploymentUrlCheck !== !0 && Qe(e), n = { ...n };
1862
1925
  let r = n.authRefreshTokenLeewaySeconds ?? 10, i = n.webSocketConstructor;
1863
1926
  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 });
1927
+ i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ? It({ verbose: n.verbose ?? !1 }) : n.logger !== !0 && n.logger ? n.logger : Ft({ verbose: n.verbose ?? !1 });
1865
1928
  let a = e.search("://");
1866
1929
  if (a === -1) throw Error("Provided address was not an absolute URL.");
1867
1930
  let o = e.substring(a + 3), s = e.substring(0, a), c;
1868
1931
  if (s === "http") c = "ws";
1869
1932
  else if (s === "https") c = "wss";
1870
1933
  else throw Error(`Unknown parent protocol ${s}`);
1871
- let l = `${c}://${o}/api/${Me}/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);
1934
+ let l = `${c}://${o}/api/${Be}/sync`;
1935
+ this.state = new qt(), this.remoteQuerySet = new Cn((e) => this.state.queryPath(e), this.logger), this.requestManager = new Zt(this.logger, this.markConnectionStateDirty);
1873
1936
  let u = () => {
1874
1937
  this.webSocketManager.pause(), this.state.pause();
1875
1938
  };
1876
- this.authenticationManager = new Vn(this.state, {
1939
+ this.authenticationManager = new Xn(this.state, {
1877
1940
  authenticate: (e) => {
1878
1941
  let t = this.state.setAuth(e);
1879
1942
  return this.webSocketManager.sendMessage(t), t.baseVersion;
@@ -1888,9 +1951,9 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1888
1951
  }, {
1889
1952
  logger: this.logger,
1890
1953
  refreshTokenLeewaySeconds: r
1891
- }), this.optimisticQueryResults = new en(), this.addOnTransitionHandler((e) => {
1954
+ }), this.optimisticQueryResults = new un(), this.addOnTransitionHandler((e) => {
1892
1955
  t(e.queries.map((e) => e.token));
1893
- }), this._nextRequestId = 0, this._sessionId = jn();
1956
+ }), this._nextRequestId = 0, this._sessionId = Bn();
1894
1957
  let { unsavedChangesWarning: d } = n;
1895
1958
  if (typeof window > "u" || window.addEventListener === void 0) {
1896
1959
  if (d === !0) throw Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.");
@@ -1901,14 +1964,14 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1901
1964
  return (e || window.event).returnValue = t, t;
1902
1965
  }
1903
1966
  });
1904
- this.webSocketManager = new An(l, {
1967
+ this.webSocketManager = new zn(l, {
1905
1968
  onOpen: (e) => {
1906
1969
  this.mark("convexWebSocketOpen"), this.webSocketManager.sendMessage({
1907
1970
  ...e,
1908
1971
  type: "Connect",
1909
1972
  sessionId: this._sessionId,
1910
1973
  maxObservedTimestamp: this.maxObservedTimestamp
1911
- }), this.remoteQuerySet = new mn((e) => this.state.queryPath(e), this.logger);
1974
+ }), this.remoteQuerySet = new Cn((e) => this.state.queryPath(e), this.logger);
1912
1975
  let [t, n] = this.state.restart();
1913
1976
  n && this.webSocketManager.sendMessage(n), this.webSocketManager.sendMessage(t);
1914
1977
  for (let e of this.requestManager.restart()) this.webSocketManager.sendMessage(e);
@@ -1939,7 +2002,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1939
2002
  this.authenticationManager.onAuthError(e);
1940
2003
  break;
1941
2004
  case "FatalError": {
1942
- let t = kt(this.logger, e.error);
2005
+ let t = Rt(this.logger, e.error);
1943
2006
  throw this.webSocketManager.terminate(), t;
1944
2007
  }
1945
2008
  default:
@@ -1997,7 +2060,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
1997
2060
  getCurrentAuthClaims() {
1998
2061
  let e = this.state.getAuth(), t = {};
1999
2062
  if (e && e.tokenType === "User") try {
2000
- t = e ? In(e.value) : {};
2063
+ t = e ? Gn(e.value) : {};
2001
2064
  } catch {
2002
2065
  t = {};
2003
2066
  }
@@ -2022,7 +2085,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2022
2085
  this.webSocketManager.sendMessage(e);
2023
2086
  }
2024
2087
  subscribe(e, t, n) {
2025
- let r = U(t), { modification: i, queryToken: a, unsubscribe: o } = this.state.subscribe(e, r, n?.journal, n?.componentPath);
2088
+ let r = Ze(t), { modification: i, queryToken: a, unsubscribe: o } = this.state.subscribe(e, r, n?.journal, n?.componentPath);
2026
2089
  return i !== null && this.webSocketManager.sendMessage(i), {
2027
2090
  queryToken: a,
2028
2091
  unsubscribe: () => {
@@ -2032,7 +2095,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2032
2095
  };
2033
2096
  }
2034
2097
  localQueryResult(e, t) {
2035
- let n = Nt(e, U(t));
2098
+ let n = Ht(e, Ze(t));
2036
2099
  return this.optimisticQueryResults.queryResult(n);
2037
2100
  }
2038
2101
  localQueryResultByToken(e) {
@@ -2042,11 +2105,11 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2042
2105
  return this.optimisticQueryResults.hasQueryResult(e);
2043
2106
  }
2044
2107
  localQueryLogs(e, t) {
2045
- let n = Nt(e, U(t));
2108
+ let n = Ht(e, Ze(t));
2046
2109
  return this.optimisticQueryResults.queryLogs(n);
2047
2110
  }
2048
2111
  queryJournal(e, t) {
2049
- let n = Nt(e, U(t));
2112
+ let n = Ht(e, Ze(t));
2050
2113
  return this.state.queryJournal(n);
2051
2114
  }
2052
2115
  connectionState() {
@@ -2070,7 +2133,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2070
2133
  }
2071
2134
  async mutation(e, t, n) {
2072
2135
  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)));
2136
+ if (!r.success) throw r.errorData === void 0 ? Error(zt("mutation", e, r)) : Bt(r, new Ot(zt("mutation", e, r)));
2074
2137
  return r.value;
2075
2138
  }
2076
2139
  async mutationInternal(e, t, n, r) {
@@ -2078,7 +2141,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2078
2141
  return i;
2079
2142
  }
2080
2143
  enqueueMutation(e, t, n, r) {
2081
- let i = U(t);
2144
+ let i = Ze(t);
2082
2145
  this.tryReportLongDisconnect();
2083
2146
  let a = this.nextRequestId;
2084
2147
  if (this._nextRequestId++, n !== void 0) {
@@ -2112,7 +2175,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2112
2175
  requestId: a,
2113
2176
  udfPath: e,
2114
2177
  componentPath: r,
2115
- args: [ft(i)]
2178
+ args: [xt(i)]
2116
2179
  }, s = this.webSocketManager.sendMessage(o);
2117
2180
  return {
2118
2181
  requestId: a,
@@ -2121,18 +2184,18 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2121
2184
  }
2122
2185
  async action(e, t) {
2123
2186
  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)));
2187
+ if (!n.success) throw n.errorData === void 0 ? Error(zt("action", e, n)) : Bt(n, new Ot(zt("action", e, n)));
2125
2188
  return n.value;
2126
2189
  }
2127
2190
  async actionInternal(e, t, n) {
2128
- let r = U(t), i = this.nextRequestId;
2191
+ let r = Ze(t), i = this.nextRequestId;
2129
2192
  this._nextRequestId++, this.tryReportLongDisconnect();
2130
2193
  let a = {
2131
2194
  type: "Action",
2132
2195
  requestId: i,
2133
2196
  udfPath: e,
2134
2197
  componentPath: n,
2135
- args: [ft(r)]
2198
+ args: [xt(r)]
2136
2199
  }, o = this.webSocketManager.sendMessage(a);
2137
2200
  return this.requestManager.request(a, o);
2138
2201
  }
@@ -2150,7 +2213,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2150
2213
  }
2151
2214
  reportMarks() {
2152
2215
  if (this.debug) {
2153
- let e = Gn(this.sessionId);
2216
+ let e = er(this.sessionId);
2154
2217
  this.webSocketManager.sendMessage({
2155
2218
  type: "Event",
2156
2219
  eventType: "ClientConnect",
@@ -2167,7 +2230,7 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2167
2230
  method: "POST",
2168
2231
  headers: {
2169
2232
  "Content-Type": "application/json",
2170
- "Convex-Client": `npm-${Me}`
2233
+ "Convex-Client": `npm-${Be}`
2171
2234
  },
2172
2235
  body: JSON.stringify({ event: "LongWebsocketDisconnect" })
2173
2236
  }).then((e) => {
@@ -2179,23 +2242,23 @@ var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
2179
2242
  };
2180
2243
  //#endregion
2181
2244
  //#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) {
2245
+ function ir(e) {
2183
2246
  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
2247
  return e;
2185
2248
  }
2186
2249
  //#endregion
2187
2250
  //#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, {
2251
+ var ar = Object.defineProperty, or = (e, t, n) => t in e ? ar(e, t, {
2189
2252
  enumerable: !0,
2190
2253
  configurable: !0,
2191
2254
  writable: !0,
2192
2255
  value: n
2193
- }) : e[t] = n, Qn = (e, t, n) => Zn(e, typeof t == "symbol" ? t : t + "", n), $n = class {
2256
+ }) : e[t] = n, sr = (e, t, n) => or(e, typeof t == "symbol" ? t : t + "", n), cr = class {
2194
2257
  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));
2258
+ this.client = e, this.onTransition = t, sr(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), sr(this, "lastTransitionTs"), this.lastTransitionTs = mn.fromNumber(0), this.client.addOnTransitionHandler((e) => this.onBaseTransition(e));
2196
2259
  }
2197
2260
  subscribe(e, t, n) {
2198
- let r = Mt(e), i = Pt(r, t, n), a = () => this.removePaginatedQuerySubscriber(i), o = this.paginatedQuerySet.get(i);
2261
+ let r = Vt(e), i = Ut(r, t, n), a = () => this.removePaginatedQuerySubscriber(i), o = this.paginatedQuerySet.get(i);
2199
2262
  return o ? (o.numSubscribers += 1, {
2200
2263
  paginatedQueryToken: i,
2201
2264
  unsubscribe: a
@@ -2217,7 +2280,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2217
2280
  });
2218
2281
  }
2219
2282
  localQueryResult(e, t, n) {
2220
- let r = Pt(Mt(e), t, n);
2283
+ let r = Ut(Vt(e), t, n);
2221
2284
  return this.localQueryResultByToken(r);
2222
2285
  }
2223
2286
  localQueryResultByToken(e) {
@@ -2236,7 +2299,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2236
2299
  i = !0, a = !1;
2237
2300
  continue;
2238
2301
  }
2239
- let n = Yn(t);
2302
+ let n = ir(t);
2240
2303
  r = r.concat(n.page), a = !!n.isDone;
2241
2304
  }
2242
2305
  let o;
@@ -2265,7 +2328,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2265
2328
  this.mustGetPaginatedQuery(e);
2266
2329
  let n = this.queryTokenForLastPageOfPaginatedQuery(e), r = this.client.localQueryResultByToken(n);
2267
2330
  if (!r) return !1;
2268
- let i = Yn(r);
2331
+ let i = ir(r);
2269
2332
  if (i.isDone) return !1;
2270
2333
  this.addPageToPaginatedQuery(e, i.continueCursor, t);
2271
2334
  let a = {
@@ -2299,7 +2362,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2299
2362
  if (r.has(n)) continue;
2300
2363
  let a = i.get(n).queryToken, o = t(a);
2301
2364
  if (!o) continue;
2302
- let s = Yn(o);
2365
+ let s = ir(o);
2303
2366
  s.splitCursor && (s.pageStatus === "SplitRecommended" || s.pageStatus === "SplitRequired" || s.page.length > e.options.initialNumItems * 2) && this.splitPaginatedQueryPage(e, n, s.splitCursor, s.continueCursor);
2304
2367
  }
2305
2368
  }
@@ -2368,16 +2431,16 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2368
2431
  if (!t) throw Error("paginated query no longer exists for token " + e);
2369
2432
  return t;
2370
2433
  }
2371
- }, er = Object.defineProperty, tr = (e, t, n) => t in e ? er(e, t, {
2434
+ }, lr = Object.defineProperty, ur = (e, t, n) => t in e ? lr(e, t, {
2372
2435
  enumerable: !0,
2373
2436
  configurable: !0,
2374
2437
  writable: !0,
2375
2438
  value: n
2376
- }) : e[t] = n, nr = (e, t, n) => tr(e, typeof t == "symbol" ? t : t + "", n), rr, ir = class {
2439
+ }) : e[t] = n, dr = (e, t, n) => ur(e, typeof t == "symbol" ? t : t + "", n), fr, pr = class {
2377
2440
  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);
2441
+ dr(this, "listeners"), dr(this, "_client"), dr(this, "_paginatedClient"), dr(this, "callNewListenersWithCurrentValuesTimer"), dr(this, "_closed"), dr(this, "_disabled"), t.skipConvexDeploymentUrlCheck !== !0 && Qe(e);
2379
2442
  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();
2443
+ this._closed = !1, this._disabled = !!n, fr && !("webSocketConstructor" in r) && typeof WebSocket > "u" && (r.webSocketConstructor = fr), typeof window > "u" && !("unsavedChangesWarning" in r) && (r.unsavedChangesWarning = !1), this.disabled || (this._client = new rr(e, () => {}, r), this._paginatedClient = new cr(this._client, (e) => this._transition(e))), this.listeners = /* @__PURE__ */ new Set();
2381
2444
  }
2382
2445
  get closed() {
2383
2446
  return this._closed;
@@ -2395,7 +2458,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2395
2458
  }
2396
2459
  onUpdate(e, t, n, r) {
2397
2460
  if (this.disabled) return this.createDisabledUnsubscribe();
2398
- let { queryToken: i, unsubscribe: a } = this.client.subscribe(G(e), t), o = {
2461
+ let { queryToken: i, unsubscribe: a } = this.client.subscribe(K(e), t), o = {
2399
2462
  queryToken: i,
2400
2463
  callback: n,
2401
2464
  onError: r,
@@ -2420,7 +2483,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2420
2483
  let a = {
2421
2484
  initialNumItems: n.initialNumItems,
2422
2485
  id: -1
2423
- }, { paginatedQueryToken: o, unsubscribe: s } = this.paginatedClient.subscribe(G(e), t, a), c = {
2486
+ }, { paginatedQueryToken: o, unsubscribe: s } = this.paginatedClient.subscribe(K(e), t, a), c = {
2424
2487
  queryToken: o,
2425
2488
  callback: r,
2426
2489
  onError: i,
@@ -2435,7 +2498,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2435
2498
  unsubscribe: () => {
2436
2499
  this.closed || (this.listeners.delete(c), s());
2437
2500
  },
2438
- getCurrentValue: () => this.paginatedClient.localQueryResult(G(e), t, a),
2501
+ getCurrentValue: () => this.paginatedClient.localQueryResult(K(e), t, a),
2439
2502
  getQueryLogs: () => []
2440
2503
  }, u = l.unsubscribe;
2441
2504
  return Object.assign(u, l), u;
@@ -2473,7 +2536,7 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2473
2536
  _transition({ queries: e, paginatedQueries: t }, n = !1) {
2474
2537
  let r = [...e.map((e) => e.token), ...t.map((e) => e.token)];
2475
2538
  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);
2539
+ let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s = Wt(i), c = s ? !!this.paginatedClient.localQueryResultByToken(i) : this.client.hasLocalQueryResultByToken(i);
2477
2540
  if (r.includes(i) || n && !o && c) {
2478
2541
  e.hasEverRun = !0;
2479
2542
  let n;
@@ -2490,15 +2553,15 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2490
2553
  }
2491
2554
  async mutation(e, t, n) {
2492
2555
  if (this.disabled) throw Error("ConvexClient is disabled");
2493
- return await this.client.mutation(G(e), t, n);
2556
+ return await this.client.mutation(K(e), t, n);
2494
2557
  }
2495
2558
  async action(e, t) {
2496
2559
  if (this.disabled) throw Error("ConvexClient is disabled");
2497
- return await this.client.action(G(e), t);
2560
+ return await this.client.action(K(e), t);
2498
2561
  }
2499
2562
  async query(e, t) {
2500
2563
  if (this.disabled) throw Error("ConvexClient is disabled");
2501
- let n = this.client.localQueryResult(G(e), t);
2564
+ let n = this.client.localQueryResult(K(e), t);
2502
2565
  return n === void 0 ? new Promise((n, r) => {
2503
2566
  let { unsubscribe: i } = this.onUpdate(e, t, (e) => {
2504
2567
  i(), n(e);
@@ -2517,14 +2580,14 @@ var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
2517
2580
  };
2518
2581
  //#endregion
2519
2582
  //#region src/lib/machine.ts
2520
- function ar(e) {
2583
+ function mr(e) {
2521
2584
  return e;
2522
2585
  }
2523
- function or(e, t) {
2524
- let n = z(e);
2586
+ function hr(e, t) {
2587
+ let n = V(e);
2525
2588
  n.current = e;
2526
- let [r, i] = L(() => typeof t == "function" ? t() : t);
2527
- return [r, B((e) => {
2589
+ let [r, i] = z(() => typeof t == "function" ? t() : t);
2590
+ return [r, H((e) => {
2528
2591
  i((t) => {
2529
2592
  let r = n.current[t.kind]?.[e.type];
2530
2593
  return r ? r(t, e) : t;
@@ -2533,7 +2596,7 @@ function or(e, t) {
2533
2596
  }
2534
2597
  //#endregion
2535
2598
  //#region src/lib/use-async-action.ts
2536
- var sr = ar({
2599
+ var gr = mr({
2537
2600
  idle: { start: () => ({ kind: "pending" }) },
2538
2601
  pending: {
2539
2602
  success: (e, t) => ({
@@ -2554,10 +2617,10 @@ var sr = ar({
2554
2617
  reset: () => ({ kind: "idle" })
2555
2618
  }
2556
2619
  });
2557
- function cr() {
2558
- let [e, t] = or(sr, { kind: "idle" }), n = e, r = z(n);
2620
+ function _r() {
2621
+ let [e, t] = hr(gr, { kind: "idle" }), n = e, r = V(n);
2559
2622
  r.current = n;
2560
- let i = B(async (e, n) => {
2623
+ let i = H(async (e, n) => {
2561
2624
  if (r.current.kind !== "pending") {
2562
2625
  t({ type: "start" });
2563
2626
  try {
@@ -2575,7 +2638,7 @@ function cr() {
2575
2638
  return;
2576
2639
  }
2577
2640
  }
2578
- }, [t]), a = B(() => t({ type: "reset" }), [t]);
2641
+ }, [t]), a = H(() => t({ type: "reset" }), [t]);
2579
2642
  return {
2580
2643
  state: n,
2581
2644
  isIdle: n.kind === "idle",
@@ -2590,37 +2653,37 @@ function cr() {
2590
2653
  }
2591
2654
  //#endregion
2592
2655
  //#region ../../node_modules/.pnpm/@medv+finder@4.0.2/node_modules/@medv/finder/finder.js
2593
- var lr = new Set([
2656
+ var vr = new Set([
2594
2657
  "role",
2595
2658
  "name",
2596
2659
  "aria-label",
2597
2660
  "rel",
2598
2661
  "href"
2599
2662
  ]);
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;
2663
+ function yr(e, t) {
2664
+ let n = vr.has(e);
2665
+ n ||= e.startsWith("data-") && Tr(e);
2666
+ let r = Tr(t) && t.length < 100;
2667
+ return r ||= t.startsWith("#") && Tr(t.slice(1)), n && r;
2605
2668
  }
2606
- function dr(e) {
2607
- return gr(e);
2669
+ function br(e) {
2670
+ return Tr(e);
2608
2671
  }
2609
- function fr(e) {
2610
- return gr(e);
2672
+ function xr(e) {
2673
+ return Tr(e);
2611
2674
  }
2612
- function pr(e) {
2675
+ function Sr(e) {
2613
2676
  return !0;
2614
2677
  }
2615
- function mr(e, t) {
2678
+ function Cr(e, t) {
2616
2679
  if (e.nodeType !== Node.ELEMENT_NODE) throw Error("Can't generate CSS selector for non-element node type.");
2617
2680
  if (e.tagName.toLowerCase() === "html") return "html";
2618
2681
  let n = {
2619
2682
  root: document.body,
2620
- idName: dr,
2621
- className: fr,
2622
- tagName: pr,
2623
- attr: ur,
2683
+ idName: br,
2684
+ className: xr,
2685
+ tagName: Sr,
2686
+ attr: yr,
2624
2687
  timeoutMs: 1e3,
2625
2688
  seedMinLength: 3,
2626
2689
  optimizedMinLength: 2,
@@ -2628,37 +2691,37 @@ function mr(e, t) {
2628
2691
  }, r = /* @__PURE__ */ new Date(), i = {
2629
2692
  ...n,
2630
2693
  ...t
2631
- }, a = Er(i.root, n), o, s = 0;
2632
- for (let t of hr(e, i, a)) {
2694
+ }, a = Fr(i.root, n), o, s = 0;
2695
+ for (let t of wr(e, i, a)) {
2633
2696
  if ((/* @__PURE__ */ new Date()).getTime() - r.getTime() > i.timeoutMs || s >= i.maxNumberOfPathChecks) {
2634
- let t = Sr(e, a);
2697
+ let t = jr(e, a);
2635
2698
  if (!t) throw Error(`Timeout: Can't find a unique selector after ${i.timeoutMs}ms`);
2636
- return vr(t);
2699
+ return Dr(t);
2637
2700
  }
2638
- if (s++, Dr(t, a)) {
2701
+ if (s++, Ir(t, a)) {
2639
2702
  o = t;
2640
2703
  break;
2641
2704
  }
2642
2705
  }
2643
2706
  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);
2707
+ let c = [...Lr(o, e, i, a, r)];
2708
+ return c.sort(kr), c.length > 0 ? Dr(c[0]) : Dr(o);
2646
2709
  }
2647
- function* hr(e, t, n) {
2710
+ function* wr(e, t, n) {
2648
2711
  let r = [], i = [], a = e, o = 0;
2649
2712
  for (; a && a !== n;) {
2650
- let e = _r(a, t);
2713
+ let e = Er(a, t);
2651
2714
  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);
2715
+ if (r.push(e), a = a.parentElement, o++, i.push(...Pr(r)), o >= t.seedMinLength) {
2716
+ i.sort(kr);
2654
2717
  for (let e of i) yield e;
2655
2718
  i = [];
2656
2719
  }
2657
2720
  }
2658
- i.sort(br);
2721
+ i.sort(kr);
2659
2722
  for (let e of i) yield e;
2660
2723
  }
2661
- function gr(e) {
2724
+ function Tr(e) {
2662
2725
  if (/^[a-z\-]{3,}$/i.test(e)) {
2663
2726
  let t = e.split(/-|[A-Z]/);
2664
2727
  for (let e of t) if (e.length <= 2 || /[^aeiou]{4,}/i.test(e)) return !1;
@@ -2666,7 +2729,7 @@ function gr(e) {
2666
2729
  }
2667
2730
  return !1;
2668
2731
  }
2669
- function _r(e, t) {
2732
+ function Er(e, t) {
2670
2733
  let n = [], r = e.getAttribute("id");
2671
2734
  r && t.idName(r) && n.push({
2672
2735
  name: "#" + CSS.escape(r),
@@ -2692,19 +2755,19 @@ function _r(e, t) {
2692
2755
  name: i,
2693
2756
  penalty: 5
2694
2757
  });
2695
- let t = xr(e, i);
2758
+ let t = Ar(e, i);
2696
2759
  t !== void 0 && n.push({
2697
- name: wr(i, t),
2760
+ name: Nr(i, t),
2698
2761
  penalty: 10
2699
2762
  });
2700
2763
  }
2701
- let a = xr(e);
2764
+ let a = Ar(e);
2702
2765
  return a !== void 0 && n.push({
2703
- name: Cr(i, a),
2766
+ name: Mr(i, a),
2704
2767
  penalty: 50
2705
2768
  }), n;
2706
2769
  }
2707
- function vr(e) {
2770
+ function Dr(e) {
2708
2771
  let t = e[0], n = t.name;
2709
2772
  for (let r = 1; r < e.length; r++) {
2710
2773
  let i = e[r].level || 0;
@@ -2712,13 +2775,13 @@ function vr(e) {
2712
2775
  }
2713
2776
  return n;
2714
2777
  }
2715
- function yr(e) {
2778
+ function Or(e) {
2716
2779
  return e.map((e) => e.penalty).reduce((e, t) => e + t, 0);
2717
2780
  }
2718
- function br(e, t) {
2719
- return yr(e) - yr(t);
2781
+ function kr(e, t) {
2782
+ return Or(e) - Or(t);
2720
2783
  }
2721
- function xr(e, t) {
2784
+ function Ar(e, t) {
2722
2785
  let n = e.parentNode;
2723
2786
  if (!n) return;
2724
2787
  let r = n.firstChild;
@@ -2727,51 +2790,51 @@ function xr(e, t) {
2727
2790
  for (; r && (r.nodeType === Node.ELEMENT_NODE && (t === void 0 || r.tagName.toLowerCase() === t) && i++, r !== e);) r = r.nextSibling;
2728
2791
  return i;
2729
2792
  }
2730
- function Sr(e, t) {
2793
+ function jr(e, t) {
2731
2794
  let n = 0, r = e, i = [];
2732
2795
  for (; r && r !== t;) {
2733
- let e = r.tagName.toLowerCase(), t = xr(r, e);
2796
+ let e = r.tagName.toLowerCase(), t = Ar(r, e);
2734
2797
  if (t === void 0) return;
2735
2798
  i.push({
2736
- name: wr(e, t),
2799
+ name: Nr(e, t),
2737
2800
  penalty: NaN,
2738
2801
  level: n
2739
2802
  }), r = r.parentElement, n++;
2740
2803
  }
2741
- if (Dr(i, t)) return i;
2804
+ if (Ir(i, t)) return i;
2742
2805
  }
2743
- function Cr(e, t) {
2806
+ function Mr(e, t) {
2744
2807
  return e === "html" ? "html" : `${e}:nth-child(${t})`;
2745
2808
  }
2746
- function wr(e, t) {
2809
+ function Nr(e, t) {
2747
2810
  return e === "html" ? "html" : `${e}:nth-of-type(${t})`;
2748
2811
  }
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));
2812
+ function* Pr(e, t = []) {
2813
+ if (e.length > 0) for (let n of e[0]) yield* Pr(e.slice(1, e.length), t.concat(n));
2751
2814
  else yield t;
2752
2815
  }
2753
- function Er(e, t) {
2816
+ function Fr(e, t) {
2754
2817
  return e.nodeType === Node.DOCUMENT_NODE ? e : e === t.root ? e.ownerDocument : e;
2755
2818
  }
2756
- function Dr(e, t) {
2757
- let n = vr(e);
2819
+ function Ir(e, t) {
2820
+ let n = Dr(e);
2758
2821
  switch (t.querySelectorAll(n).length) {
2759
2822
  case 0: throw Error(`Can't select any node with this selector: ${n}`);
2760
2823
  case 1: return !0;
2761
2824
  default: return !1;
2762
2825
  }
2763
2826
  }
2764
- function* Or(e, t, n, r, i) {
2827
+ function* Lr(e, t, n, r, i) {
2765
2828
  if (e.length > 2 && e.length > n.optimizedMinLength) for (let a = 1; a < e.length - 1; a++) {
2766
2829
  if ((/* @__PURE__ */ new Date()).getTime() - i.getTime() > n.timeoutMs) return;
2767
2830
  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));
2831
+ o.splice(a, 1), Ir(o, r) && r.querySelector(Dr(o)) === t && (yield o, yield* Lr(o, t, n, r, i));
2769
2832
  }
2770
2833
  }
2771
2834
  //#endregion
2772
2835
  //#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;
2836
+ function Rr(e, t) {
2837
+ 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 ? Br(s) : void 0, l, u;
2775
2838
  if (s) {
2776
2839
  let t = s.getBoundingClientRect();
2777
2840
  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 +2849,7 @@ function kr(e, t) {
2786
2849
  anchorOffsetY: u
2787
2850
  };
2788
2851
  }
2789
- function Ar(e) {
2852
+ function zr(e) {
2790
2853
  if (e.anchorSelector) try {
2791
2854
  let t = document.querySelector(e.anchorSelector);
2792
2855
  if (t) {
@@ -2805,22 +2868,22 @@ function Ar(e) {
2805
2868
  resolved: !1
2806
2869
  };
2807
2870
  }
2808
- function jr(e) {
2871
+ function Br(e) {
2809
2872
  try {
2810
- return mr(e, { timeoutMs: 1e3 });
2873
+ return Cr(e, { timeoutMs: 1e3 });
2811
2874
  } catch {
2812
2875
  return;
2813
2876
  }
2814
2877
  }
2815
2878
  //#endregion
2816
2879
  //#region src/runtime/api.ts
2817
- var Mr = class extends Error {
2880
+ var Vr = class extends Error {
2818
2881
  status;
2819
2882
  constructor(e, t) {
2820
2883
  super(e), this.name = "WidgetApiError", this.status = t;
2821
2884
  }
2822
2885
  };
2823
- function Nr(e) {
2886
+ function Hr(e) {
2824
2887
  let t = e.apiUrl.replace(/\/+$/, "");
2825
2888
  async function n(n, r = {}) {
2826
2889
  let i = {
@@ -2836,8 +2899,8 @@ function Nr(e) {
2836
2899
  headers: i
2837
2900
  };
2838
2901
  c && (l.credentials = "include");
2839
- let u = await fetch(`${t}${n}`, l), d = await u.text(), f = d ? Pr(d) : null;
2840
- if (!u.ok) throw u.status === 401 && (o || c) && e.onUnauthorized?.(), new Mr((f && typeof f == "object" && "error" in f && typeof f.error == "string" ? f.error : null) ?? `Request failed with ${u.status}`, u.status);
2902
+ let u = await fetch(`${t}${n}`, l), d = await u.text(), f = d ? Ur(d) : null;
2903
+ if (!u.ok) throw u.status === 401 && (o || c) && e.onUnauthorized?.(), new Vr((f && typeof f == "object" && "error" in f && typeof f.error == "string" ? f.error : null) ?? `Request failed with ${u.status}`, u.status);
2841
2904
  return f;
2842
2905
  }
2843
2906
  return {
@@ -2891,7 +2954,7 @@ function Nr(e) {
2891
2954
  }
2892
2955
  };
2893
2956
  }
2894
- function Pr(e) {
2957
+ function Ur(e) {
2895
2958
  try {
2896
2959
  return JSON.parse(e);
2897
2960
  } catch {
@@ -2900,10 +2963,10 @@ function Pr(e) {
2900
2963
  }
2901
2964
  //#endregion
2902
2965
  //#region src/runtime/cookie-probe.ts
2903
- var Fr = "markup.cookieProbe";
2904
- async function Ir(e, t) {
2966
+ var Wr = "markup.cookieProbe";
2967
+ async function Gr(e, t) {
2905
2968
  try {
2906
- let e = sessionStorage.getItem(Fr);
2969
+ let e = sessionStorage.getItem(Wr);
2907
2970
  if (e === "supported") return !0;
2908
2971
  if (e === "unsupported") return !1;
2909
2972
  } catch {}
@@ -2922,57 +2985,63 @@ async function Ir(e, t) {
2922
2985
  if (!e.ok) return !1;
2923
2986
  let { supported: t } = await e.json(), i = t === !0;
2924
2987
  try {
2925
- sessionStorage.setItem(Fr, i ? "supported" : "unsupported");
2988
+ sessionStorage.setItem(Wr, i ? "supported" : "unsupported");
2926
2989
  } catch {}
2927
2990
  return i;
2928
- } catch {
2929
- return !1;
2991
+ } catch (e) {
2992
+ return e?.name !== "TypeError" && F(e, { context: "cookie-probe" }), !1;
2930
2993
  }
2931
2994
  }
2932
2995
  //#endregion
2933
2996
  //#region src/runtime/history-observer.ts
2934
- var Lr = "__markup_history_observer__", Rr = "__markup_history_listeners__";
2935
- function zr(e) {
2936
- e.forEach((e) => e());
2997
+ var Kr = "__markup_history_observer__", qr = "__markup_history_listeners__";
2998
+ function Jr(e) {
2999
+ e.forEach((e) => {
3000
+ try {
3001
+ e();
3002
+ } catch (e) {
3003
+ F(e, { context: "history-observer-listener" });
3004
+ }
3005
+ });
2937
3006
  }
2938
- function Br() {
3007
+ function Yr() {
2939
3008
  let e = history.pushState;
2940
- if (e[Lr]) return e[Rr];
3009
+ if (e[Kr]) return e[qr];
2941
3010
  let t = /* @__PURE__ */ new Set(), n = history.pushState, r = history.replaceState;
2942
3011
  function i(...e) {
2943
- n.apply(this, e), zr(t);
3012
+ n.apply(this, e), Jr(t);
2944
3013
  }
2945
3014
  function a(...e) {
2946
- r.apply(this, e), zr(t);
3015
+ r.apply(this, e), Jr(t);
2947
3016
  }
2948
- return Object.defineProperty(i, Lr, { value: 1 }), Object.defineProperty(i, Rr, { value: t }), Object.defineProperty(a, Lr, { value: 1 }), history.pushState = i, history.replaceState = a, window.addEventListener("popstate", () => zr(t)), t;
3017
+ return Object.defineProperty(i, Kr, { value: 1 }), Object.defineProperty(i, qr, { value: t }), Object.defineProperty(a, Kr, { value: 1 }), history.pushState = i, history.replaceState = a, window.addEventListener("popstate", () => Jr(t)), t;
2949
3018
  }
2950
- var Vr = null;
2951
- function Hr(e) {
2952
- return Vr ||= Br(), Vr.add(e), () => Vr.delete(e);
3019
+ var Xr = null;
3020
+ function Zr(e) {
3021
+ return Xr ||= Yr(), Xr.add(e), () => Xr.delete(e);
2953
3022
  }
2954
3023
  //#endregion
2955
3024
  //#region src/runtime/identity-store.ts
2956
- var Ur = "markup.identity";
2957
- function Wr() {
3025
+ var Qr = "markup.identity";
3026
+ function $r() {
2958
3027
  try {
2959
- let e = localStorage.getItem(Ur);
3028
+ let e = localStorage.getItem(Qr);
2960
3029
  return e ? JSON.parse(e) : null;
2961
3030
  } catch {
2962
3031
  return null;
2963
3032
  }
2964
3033
  }
2965
- function Gr(e) {
3034
+ function ei(e) {
2966
3035
  try {
2967
3036
  if (e == null) {
2968
- localStorage.removeItem(Ur);
3037
+ localStorage.removeItem(Qr);
2969
3038
  return;
2970
3039
  }
2971
- localStorage.setItem(Ur, JSON.stringify(e));
3040
+ localStorage.setItem(Qr, JSON.stringify(e));
2972
3041
  } catch {}
2973
3042
  }
2974
- function Kr() {
2975
- let e = Wr(), t = {
3043
+ function ti() {
3044
+ let e = $r(), t = {
2976
3045
  name: e?.name,
2977
3046
  email: e?.email
2978
3047
  };
@@ -3032,10 +3101,10 @@ function Kr() {
3032
3101
  preserved: t
3033
3102
  };
3034
3103
  }
3035
- function qr(e) {
3104
+ function ni(e) {
3036
3105
  switch (e.kind) {
3037
3106
  case "verified":
3038
- Gr({
3107
+ ei({
3039
3108
  clientId: e.identity.clientId,
3040
3109
  storage: e.identity.storage,
3041
3110
  token: e.identity.storage === "cookies" ? void 0 : e.identity.token,
@@ -3048,7 +3117,7 @@ function qr(e) {
3048
3117
  });
3049
3118
  return;
3050
3119
  case "anon":
3051
- Gr({
3120
+ ei({
3052
3121
  clientId: e.identity.clientId,
3053
3122
  anonToken: e.identity.anonToken,
3054
3123
  name: e.identity.name,
@@ -3056,23 +3125,23 @@ function qr(e) {
3056
3125
  });
3057
3126
  return;
3058
3127
  case "recovering":
3059
- Gr({
3128
+ ei({
3060
3129
  name: e.preserved.name,
3061
3130
  email: e.preserved.email
3062
3131
  });
3063
3132
  return;
3064
3133
  case "unresolved":
3065
- Gr(null);
3134
+ ei(null);
3066
3135
  return;
3067
3136
  }
3068
3137
  }
3069
- function Jr(e) {
3138
+ function ri(e) {
3070
3139
  if (e.kind === "anon" || e.kind === "verified") return e.identity.clientId;
3071
3140
  }
3072
- function Yr(e) {
3141
+ function ii(e) {
3073
3142
  return e.kind === "anon" ? e.identity.name ?? null : e.kind === "verified" ? e.identity.name : null;
3074
3143
  }
3075
- function Xr(e) {
3144
+ function ai(e) {
3076
3145
  if (e.kind === "anon") {
3077
3146
  let t = e.identity.name;
3078
3147
  return t ? {
@@ -3087,7 +3156,7 @@ function Xr(e) {
3087
3156
  }
3088
3157
  //#endregion
3089
3158
  //#region src/runtime/popup-auth.ts
3090
- async function Zr(e) {
3159
+ async function oi(e) {
3091
3160
  let { apiUrl: t, apiKey: n, useCookies: r } = e, i = new URL(t).origin, a;
3092
3161
  try {
3093
3162
  let e = await fetch(`${t.replace(/\/+$/, "")}/widget/popup-exchange`, {
@@ -3104,7 +3173,7 @@ async function Zr(e) {
3104
3173
  let s = r ? "refresh,cookies" : "refresh";
3105
3174
  o.searchParams.set("capabilities", s), a = o.toString();
3106
3175
  } catch (e) {
3107
- return Promise.reject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to start popup exchange"));
3176
+ return e?.name !== "TypeError" && F(e, { context: "popup-exchange" }), Promise.reject(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to start popup exchange"));
3108
3177
  }
3109
3178
  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}`);
3110
3179
  if (!c) return Promise.reject(/* @__PURE__ */ Error("Popup blocked — allow popups for this site to sign in"));
@@ -3144,7 +3213,10 @@ async function Zr(e) {
3144
3213
  refreshToken: l.refreshToken
3145
3214
  })
3146
3215
  });
3147
- if (!e.ok) throw Error(`Failed to install widget cookies (${e.status})`);
3216
+ if (!e.ok) {
3217
+ let t = /* @__PURE__ */ Error(`Failed to install widget cookies (${e.status})`);
3218
+ throw F(t, { context: "install-cookies" }), t;
3219
+ }
3148
3220
  return {
3149
3221
  ...l,
3150
3222
  token: null,
@@ -3155,45 +3227,45 @@ async function Zr(e) {
3155
3227
  }
3156
3228
  //#endregion
3157
3229
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js
3158
- function Qr(e, t) {
3230
+ function si(e, t) {
3159
3231
  if (e.match(/^[a-z]+:\/\//i)) return e;
3160
3232
  if (e.match(/^\/\//)) return window.location.protocol + e;
3161
3233
  if (e.match(/^[a-z]+:/i)) return e;
3162
3234
  let n = document.implementation.createHTMLDocument(), r = n.createElement("base"), i = n.createElement("a");
3163
3235
  return n.head.appendChild(r), n.body.appendChild(i), t && (r.href = t), i.href = e, i.href;
3164
3236
  }
3165
- var $r = (() => {
3237
+ var ci = (() => {
3166
3238
  let e = 0, t = () => `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4);
3167
3239
  return () => (e += 1, `u${t()}${e}`);
3168
3240
  })();
3169
- function Y(e) {
3241
+ function li(e) {
3170
3242
  let t = [];
3171
3243
  for (let n = 0, r = e.length; n < r; n++) t.push(e[n]);
3172
3244
  return t;
3173
3245
  }
3174
- var ei = null;
3175
- function ti(e = {}) {
3176
- return ei || (e.includeStyleProperties ? (ei = e.includeStyleProperties, ei) : (ei = Y(window.getComputedStyle(document.documentElement)), ei));
3246
+ var ui = null;
3247
+ function di(e = {}) {
3248
+ return ui || (e.includeStyleProperties ? (ui = e.includeStyleProperties, ui) : (ui = li(window.getComputedStyle(document.documentElement)), ui));
3177
3249
  }
3178
- function ni(e, t) {
3250
+ function fi(e, t) {
3179
3251
  let n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
3180
3252
  return n ? parseFloat(n.replace("px", "")) : 0;
3181
3253
  }
3182
- function ri(e) {
3183
- let t = ni(e, "border-left-width"), n = ni(e, "border-right-width");
3254
+ function pi(e) {
3255
+ let t = fi(e, "border-left-width"), n = fi(e, "border-right-width");
3184
3256
  return e.clientWidth + t + n;
3185
3257
  }
3186
- function ii(e) {
3187
- let t = ni(e, "border-top-width"), n = ni(e, "border-bottom-width");
3258
+ function mi(e) {
3259
+ let t = fi(e, "border-top-width"), n = fi(e, "border-bottom-width");
3188
3260
  return e.clientHeight + t + n;
3189
3261
  }
3190
- function ai(e, t = {}) {
3262
+ function hi(e, t = {}) {
3191
3263
  return {
3192
- width: t.width || ri(e),
3193
- height: t.height || ii(e)
3264
+ width: t.width || pi(e),
3265
+ height: t.height || mi(e)
3194
3266
  };
3195
3267
  }
3196
- function oi() {
3268
+ function gi() {
3197
3269
  let e, t;
3198
3270
  try {
3199
3271
  t = process;
@@ -3202,10 +3274,10 @@ function oi() {
3202
3274
  return n && (e = parseInt(n, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
3203
3275
  }
3204
3276
  var X = 16384;
3205
- function si(e) {
3277
+ function _i(e) {
3206
3278
  (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));
3207
3279
  }
3208
- function ci(e) {
3280
+ function vi(e) {
3209
3281
  return new Promise((t, n) => {
3210
3282
  let r = new Image();
3211
3283
  r.onload = () => {
@@ -3215,12 +3287,12 @@ function ci(e) {
3215
3287
  }, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = e;
3216
3288
  });
3217
3289
  }
3218
- async function li(e) {
3290
+ async function yi(e) {
3219
3291
  return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
3220
3292
  }
3221
- async function ui(e, t, n) {
3293
+ async function bi(e, t, n) {
3222
3294
  let r = "http://www.w3.org/2000/svg", i = document.createElementNS(r, "svg"), a = document.createElementNS(r, "foreignObject");
3223
- 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), li(i);
3295
+ 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), yi(i);
3224
3296
  }
3225
3297
  var Z = (e, t) => {
3226
3298
  if (e instanceof t) return !0;
@@ -3229,66 +3301,66 @@ var Z = (e, t) => {
3229
3301
  };
3230
3302
  //#endregion
3231
3303
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js
3232
- function di(e) {
3304
+ function xi(e) {
3233
3305
  let t = e.getPropertyValue("content");
3234
3306
  return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
3235
3307
  }
3236
- function fi(e, t) {
3237
- return ti(t).map((t) => `${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t) ? " !important" : ""};`).join(" ");
3308
+ function Si(e, t) {
3309
+ return di(t).map((t) => `${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t) ? " !important" : ""};`).join(" ");
3238
3310
  }
3239
- function pi(e, t, n, r) {
3240
- let i = `.${e}:${t}`, a = n.cssText ? di(n) : fi(n, r);
3311
+ function Ci(e, t, n, r) {
3312
+ let i = `.${e}:${t}`, a = n.cssText ? xi(n) : Si(n, r);
3241
3313
  return document.createTextNode(`${i}{${a}}`);
3242
3314
  }
3243
- function mi(e, t, n, r) {
3315
+ function wi(e, t, n, r) {
3244
3316
  let i = window.getComputedStyle(e, n), a = i.getPropertyValue("content");
3245
3317
  if (a === "" || a === "none") return;
3246
- let o = $r();
3318
+ let o = ci();
3247
3319
  try {
3248
3320
  t.className = `${t.className} ${o}`;
3249
3321
  } catch {
3250
3322
  return;
3251
3323
  }
3252
3324
  let s = document.createElement("style");
3253
- s.appendChild(pi(o, n, i, r)), t.appendChild(s);
3325
+ s.appendChild(Ci(o, n, i, r)), t.appendChild(s);
3254
3326
  }
3255
- function hi(e, t, n) {
3256
- mi(e, t, ":before", n), mi(e, t, ":after", n);
3327
+ function Ti(e, t, n) {
3328
+ wi(e, t, ":before", n), wi(e, t, ":after", n);
3257
3329
  }
3258
3330
  //#endregion
3259
3331
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js
3260
- var gi = "application/font-woff", _i = "image/jpeg", vi = {
3261
- woff: gi,
3262
- woff2: gi,
3332
+ var Ei = "application/font-woff", Di = "image/jpeg", Oi = {
3333
+ woff: Ei,
3334
+ woff2: Ei,
3263
3335
  ttf: "application/font-truetype",
3264
3336
  eot: "application/vnd.ms-fontobject",
3265
3337
  png: "image/png",
3266
- jpg: _i,
3267
- jpeg: _i,
3338
+ jpg: Di,
3339
+ jpeg: Di,
3268
3340
  gif: "image/gif",
3269
3341
  tiff: "image/tiff",
3270
3342
  svg: "image/svg+xml",
3271
3343
  webp: "image/webp"
3272
3344
  };
3273
- function yi(e) {
3345
+ function ki(e) {
3274
3346
  let t = /\.([^./]*?)$/g.exec(e);
3275
3347
  return t ? t[1] : "";
3276
3348
  }
3277
- function bi(e) {
3278
- return vi[yi(e).toLowerCase()] || "";
3349
+ function Ai(e) {
3350
+ return Oi[ki(e).toLowerCase()] || "";
3279
3351
  }
3280
3352
  //#endregion
3281
3353
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js
3282
- function xi(e) {
3354
+ function ji(e) {
3283
3355
  return e.split(/,/)[1];
3284
3356
  }
3285
- function Si(e) {
3357
+ function Mi(e) {
3286
3358
  return e.search(/^(data:)/) !== -1;
3287
3359
  }
3288
- function Ci(e, t) {
3360
+ function Ni(e, t) {
3289
3361
  return `data:${t};base64,${e}`;
3290
3362
  }
3291
- async function wi(e, t, n) {
3363
+ async function Pi(e, t, n) {
3292
3364
  let r = await fetch(e, t);
3293
3365
  if (r.status === 404) throw Error(`Resource "${r.url}" not found`);
3294
3366
  let i = await r.blob();
@@ -3306,78 +3378,78 @@ async function wi(e, t, n) {
3306
3378
  }, a.readAsDataURL(i);
3307
3379
  });
3308
3380
  }
3309
- var Ti = {};
3310
- function Ei(e, t, n) {
3381
+ var Fi = {};
3382
+ function Ii(e, t, n) {
3311
3383
  let r = e.replace(/\?.*/, "");
3312
3384
  return n && (r = e), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
3313
3385
  }
3314
- async function Di(e, t, n) {
3315
- let r = Ei(e, t, n.includeQueryParams);
3316
- if (Ti[r] != null) return Ti[r];
3386
+ async function Li(e, t, n) {
3387
+ let r = Ii(e, t, n.includeQueryParams);
3388
+ if (Fi[r] != null) return Fi[r];
3317
3389
  n.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
3318
3390
  let i;
3319
3391
  try {
3320
- i = Ci(await wi(e, n.fetchRequestInit, ({ res: e, result: n }) => (t ||= e.headers.get("Content-Type") || "", xi(n))), t);
3392
+ i = Ni(await Pi(e, n.fetchRequestInit, ({ res: e, result: n }) => (t ||= e.headers.get("Content-Type") || "", ji(n))), t);
3321
3393
  } catch (t) {
3322
3394
  i = n.imagePlaceholder || "";
3323
3395
  let r = `Failed to fetch resource: ${e}`;
3324
3396
  t && (r = typeof t == "string" ? t : t.message), r && console.warn(r);
3325
3397
  }
3326
- return Ti[r] = i, i;
3398
+ return Fi[r] = i, i;
3327
3399
  }
3328
3400
  //#endregion
3329
3401
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js
3330
- async function Oi(e) {
3402
+ async function Ri(e) {
3331
3403
  let t = e.toDataURL();
3332
- return t === "data:," ? e.cloneNode(!1) : ci(t);
3404
+ return t === "data:," ? e.cloneNode(!1) : vi(t);
3333
3405
  }
3334
- async function ki(e, t) {
3406
+ async function zi(e, t) {
3335
3407
  if (e.currentSrc) {
3336
3408
  let t = document.createElement("canvas"), n = t.getContext("2d");
3337
- return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height), ci(t.toDataURL());
3409
+ return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height), vi(t.toDataURL());
3338
3410
  }
3339
3411
  let n = e.poster;
3340
- return ci(await Di(n, bi(n), t));
3412
+ return vi(await Li(n, Ai(n), t));
3341
3413
  }
3342
- async function Ai(e, t) {
3414
+ async function Bi(e, t) {
3343
3415
  try {
3344
- if (e?.contentDocument?.body) return await Bi(e.contentDocument.body, t, !0);
3416
+ if (e?.contentDocument?.body) return await Xi(e.contentDocument.body, t, !0);
3345
3417
  } catch {}
3346
3418
  return e.cloneNode(!1);
3347
3419
  }
3348
- async function ji(e, t) {
3349
- return Z(e, HTMLCanvasElement) ? Oi(e) : Z(e, HTMLVideoElement) ? ki(e, t) : Z(e, HTMLIFrameElement) ? Ai(e, t) : e.cloneNode(Ni(e));
3420
+ async function Vi(e, t) {
3421
+ return Z(e, HTMLCanvasElement) ? Ri(e) : Z(e, HTMLVideoElement) ? zi(e, t) : Z(e, HTMLIFrameElement) ? Bi(e, t) : e.cloneNode(Ui(e));
3350
3422
  }
3351
- var Mi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Ni = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
3352
- async function Pi(e, t, n) {
3353
- if (Ni(t)) return t;
3423
+ var Hi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", Ui = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
3424
+ async function Wi(e, t, n) {
3425
+ if (Ui(t)) return t;
3354
3426
  let r = [];
3355
- return r = Mi(e) && e.assignedNodes ? Y(e.assignedNodes()) : Z(e, HTMLIFrameElement) && e.contentDocument?.body ? Y(e.contentDocument.body.childNodes) : Y((e.shadowRoot ?? e).childNodes), r.length === 0 || Z(e, HTMLVideoElement) || await r.reduce((e, r) => e.then(() => Bi(r, n)).then((e) => {
3427
+ return r = Hi(e) && e.assignedNodes ? li(e.assignedNodes()) : Z(e, HTMLIFrameElement) && e.contentDocument?.body ? li(e.contentDocument.body.childNodes) : li((e.shadowRoot ?? e).childNodes), r.length === 0 || Z(e, HTMLVideoElement) || await r.reduce((e, r) => e.then(() => Xi(r, n)).then((e) => {
3356
3428
  e && t.appendChild(e);
3357
3429
  }), Promise.resolve()), t;
3358
3430
  }
3359
- function Fi(e, t, n) {
3431
+ function Gi(e, t, n) {
3360
3432
  let r = t.style;
3361
3433
  if (!r) return;
3362
3434
  let i = window.getComputedStyle(e);
3363
- i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) : ti(n).forEach((n) => {
3435
+ i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) : di(n).forEach((n) => {
3364
3436
  let a = i.getPropertyValue(n);
3365
3437
  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));
3366
3438
  });
3367
3439
  }
3368
- function Ii(e, t) {
3440
+ function Ki(e, t) {
3369
3441
  Z(e, HTMLTextAreaElement) && (t.innerHTML = e.value), Z(e, HTMLInputElement) && t.setAttribute("value", e.value);
3370
3442
  }
3371
- function Li(e, t) {
3443
+ function qi(e, t) {
3372
3444
  if (Z(e, HTMLSelectElement)) {
3373
3445
  let n = t, r = Array.from(n.children).find((t) => e.value === t.getAttribute("value"));
3374
3446
  r && r.setAttribute("selected", "");
3375
3447
  }
3376
3448
  }
3377
- function Ri(e, t, n) {
3378
- return Z(t, Element) && (Fi(e, t, n), hi(e, t, n), Ii(e, t), Li(e, t)), t;
3449
+ function Ji(e, t, n) {
3450
+ return Z(t, Element) && (Gi(e, t, n), Ti(e, t, n), Ki(e, t), qi(e, t)), t;
3379
3451
  }
3380
- async function zi(e, t) {
3452
+ async function Yi(e, t) {
3381
3453
  let n = e.querySelectorAll ? e.querySelectorAll("use") : [];
3382
3454
  if (n.length === 0) return e;
3383
3455
  let r = {};
@@ -3385,7 +3457,7 @@ async function zi(e, t) {
3385
3457
  let a = n[i].getAttribute("xlink:href");
3386
3458
  if (a) {
3387
3459
  let n = e.querySelector(a), i = document.querySelector(a);
3388
- !n && i && !r[a] && (r[a] = await Bi(i, t, !0));
3460
+ !n && i && !r[a] && (r[a] = await Xi(i, t, !0));
3389
3461
  }
3390
3462
  }
3391
3463
  let i = Object.values(r);
@@ -3399,61 +3471,61 @@ async function zi(e, t) {
3399
3471
  }
3400
3472
  return e;
3401
3473
  }
3402
- async function Bi(e, t, n) {
3403
- return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) => ji(e, t)).then((n) => Pi(e, n, t)).then((n) => Ri(e, n, t)).then((e) => zi(e, t));
3474
+ async function Xi(e, t, n) {
3475
+ return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) => Vi(e, t)).then((n) => Wi(e, n, t)).then((n) => Ji(e, n, t)).then((e) => Yi(e, t));
3404
3476
  }
3405
3477
  //#endregion
3406
3478
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js
3407
- var Vi = /url\((['"]?)([^'"]+?)\1\)/g, Hi = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, Ui = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
3408
- function Wi(e) {
3479
+ var Zi = /url\((['"]?)([^'"]+?)\1\)/g, Qi = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, $i = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
3480
+ function ea(e) {
3409
3481
  let t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
3410
3482
  return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
3411
3483
  }
3412
- function Gi(e) {
3484
+ function ta(e) {
3413
3485
  let t = [];
3414
- return e.replace(Vi, (e, n, r) => (t.push(r), e)), t.filter((e) => !Si(e));
3486
+ return e.replace(Zi, (e, n, r) => (t.push(r), e)), t.filter((e) => !Mi(e));
3415
3487
  }
3416
- async function Ki(e, t, n, r, i) {
3488
+ async function na(e, t, n, r, i) {
3417
3489
  try {
3418
- let a = n ? Qr(t, n) : t, o = bi(t), s;
3419
- return s = i ? Ci(await i(a), o) : await Di(a, o, r), e.replace(Wi(t), `$1${s}$3`);
3490
+ let a = n ? si(t, n) : t, o = Ai(t), s;
3491
+ return s = i ? Ni(await i(a), o) : await Li(a, o, r), e.replace(ea(t), `$1${s}$3`);
3420
3492
  } catch {}
3421
3493
  return e;
3422
3494
  }
3423
- function qi(e, { preferredFontFormat: t }) {
3424
- return t ? e.replace(Ui, (e) => {
3495
+ function ra(e, { preferredFontFormat: t }) {
3496
+ return t ? e.replace($i, (e) => {
3425
3497
  for (;;) {
3426
- let [n, , r] = Hi.exec(e) || [];
3498
+ let [n, , r] = Qi.exec(e) || [];
3427
3499
  if (!r) return "";
3428
3500
  if (r === t) return `src: ${n};`;
3429
3501
  }
3430
3502
  }) : e;
3431
3503
  }
3432
- function Ji(e) {
3433
- return e.search(Vi) !== -1;
3504
+ function ia(e) {
3505
+ return e.search(Zi) !== -1;
3434
3506
  }
3435
- async function Yi(e, t, n) {
3436
- if (!Ji(e)) return e;
3437
- let r = qi(e, n);
3438
- return Gi(r).reduce((e, r) => e.then((e) => Ki(e, r, t, n)), Promise.resolve(r));
3507
+ async function aa(e, t, n) {
3508
+ if (!ia(e)) return e;
3509
+ let r = ra(e, n);
3510
+ return ta(r).reduce((e, r) => e.then((e) => na(e, r, t, n)), Promise.resolve(r));
3439
3511
  }
3440
3512
  //#endregion
3441
3513
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js
3442
- async function Xi(e, t, n) {
3514
+ async function oa(e, t, n) {
3443
3515
  let r = t.style?.getPropertyValue(e);
3444
3516
  if (r) {
3445
- let i = await Yi(r, null, n);
3517
+ let i = await aa(r, null, n);
3446
3518
  return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
3447
3519
  }
3448
3520
  return !1;
3449
3521
  }
3450
- async function Zi(e, t) {
3451
- await Xi("background", e, t) || await Xi("background-image", e, t), await Xi("mask", e, t) || await Xi("-webkit-mask", e, t) || await Xi("mask-image", e, t) || await Xi("-webkit-mask-image", e, t);
3522
+ async function sa(e, t) {
3523
+ await oa("background", e, t) || await oa("background-image", e, t), await oa("mask", e, t) || await oa("-webkit-mask", e, t) || await oa("mask-image", e, t) || await oa("-webkit-mask-image", e, t);
3452
3524
  }
3453
- async function Qi(e, t) {
3525
+ async function ca(e, t) {
3454
3526
  let n = Z(e, HTMLImageElement);
3455
- if (!(n && !Si(e.src)) && !(Z(e, SVGImageElement) && !Si(e.href.baseVal))) return;
3456
- let r = n ? e.src : e.href.baseVal, i = await Di(r, bi(r), t);
3527
+ if (!(n && !Mi(e.src)) && !(Z(e, SVGImageElement) && !Mi(e.href.baseVal))) return;
3528
+ let r = n ? e.src : e.href.baseVal, i = await Li(r, Ai(r), t);
3457
3529
  await new Promise((r, a) => {
3458
3530
  e.onload = r, e.onerror = t.onImageErrorHandler ? (...e) => {
3459
3531
  try {
@@ -3466,16 +3538,16 @@ async function Qi(e, t) {
3466
3538
  o.decode &&= r, o.loading === "lazy" && (o.loading = "eager"), n ? (e.srcset = "", e.src = i) : e.href.baseVal = i;
3467
3539
  });
3468
3540
  }
3469
- async function $i(e, t) {
3470
- let n = Y(e.childNodes).map((e) => ea(e, t));
3541
+ async function la(e, t) {
3542
+ let n = li(e.childNodes).map((e) => ua(e, t));
3471
3543
  await Promise.all(n).then(() => e);
3472
3544
  }
3473
- async function ea(e, t) {
3474
- Z(e, Element) && (await Zi(e, t), await Qi(e, t), await $i(e, t));
3545
+ async function ua(e, t) {
3546
+ Z(e, Element) && (await sa(e, t), await ca(e, t), await la(e, t));
3475
3547
  }
3476
3548
  //#endregion
3477
3549
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js
3478
- function ta(e, t) {
3550
+ function da(e, t) {
3479
3551
  let { style: n } = e;
3480
3552
  t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.width && (n.width = `${t.width}px`), t.height && (n.height = `${t.height}px`);
3481
3553
  let r = t.style;
@@ -3485,22 +3557,22 @@ function ta(e, t) {
3485
3557
  }
3486
3558
  //#endregion
3487
3559
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js
3488
- var na = {};
3489
- async function ra(e) {
3490
- let t = na[e];
3560
+ var fa = {};
3561
+ async function pa(e) {
3562
+ let t = fa[e];
3491
3563
  return t ?? (t = {
3492
3564
  url: e,
3493
3565
  cssText: await (await fetch(e)).text()
3494
- }, na[e] = t, t);
3566
+ }, fa[e] = t, t);
3495
3567
  }
3496
- async function ia(e, t) {
3568
+ async function ma(e, t) {
3497
3569
  let n = e.cssText, r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (i) => {
3498
3570
  let a = i.replace(r, "$1");
3499
- return a.startsWith("https://") || (a = new URL(a, e.url).href), wi(a, t.fetchRequestInit, ({ result: e }) => (n = n.replace(i, `url(${e})`), [i, e]));
3571
+ return a.startsWith("https://") || (a = new URL(a, e.url).href), Pi(a, t.fetchRequestInit, ({ result: e }) => (n = n.replace(i, `url(${e})`), [i, e]));
3500
3572
  });
3501
3573
  return Promise.all(i).then(() => n);
3502
3574
  }
3503
- function aa(e) {
3575
+ function ha(e) {
3504
3576
  if (e == null) return [];
3505
3577
  let t = [], n = e.replace(/(\/\*[\s\S]*?\*\/)/gi, ""), r = /* @__PURE__ */ RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
3506
3578
  for (;;) {
@@ -3520,13 +3592,13 @@ function aa(e) {
3520
3592
  }
3521
3593
  return t;
3522
3594
  }
3523
- async function oa(e, t) {
3595
+ async function ga(e, t) {
3524
3596
  let n = [], r = [];
3525
3597
  return e.forEach((n) => {
3526
3598
  if ("cssRules" in n) try {
3527
- Y(n.cssRules || []).forEach((e, i) => {
3599
+ li(n.cssRules || []).forEach((e, i) => {
3528
3600
  if (e.type === CSSRule.IMPORT_RULE) {
3529
- let a = i + 1, o = e.href, s = ra(o).then((e) => ia(e, t)).then((e) => aa(e).forEach((e) => {
3601
+ let a = i + 1, o = e.href, s = pa(o).then((e) => ma(e, t)).then((e) => ha(e).forEach((e) => {
3530
3602
  try {
3531
3603
  n.insertRule(e, e.startsWith("@import") ? a += 1 : n.cssRules.length);
3532
3604
  } catch (t) {
@@ -3543,7 +3615,7 @@ async function oa(e, t) {
3543
3615
  });
3544
3616
  } catch (i) {
3545
3617
  let a = e.find((e) => e.href == null) || document.styleSheets[0];
3546
- n.href != null && r.push(ra(n.href).then((e) => ia(e, t)).then((e) => aa(e).forEach((e) => {
3618
+ n.href != null && r.push(pa(n.href).then((e) => ma(e, t)).then((e) => ha(e).forEach((e) => {
3547
3619
  a.insertRule(e, a.cssRules.length);
3548
3620
  })).catch((e) => {
3549
3621
  console.error("Error loading remote stylesheet", e);
@@ -3551,7 +3623,7 @@ async function oa(e, t) {
3551
3623
  }
3552
3624
  }), Promise.all(r).then(() => (e.forEach((e) => {
3553
3625
  if ("cssRules" in e) try {
3554
- Y(e.cssRules || []).forEach((e) => {
3626
+ li(e.cssRules || []).forEach((e) => {
3555
3627
  n.push(e);
3556
3628
  });
3557
3629
  } catch (t) {
@@ -3559,36 +3631,36 @@ async function oa(e, t) {
3559
3631
  }
3560
3632
  }), n));
3561
3633
  }
3562
- function sa(e) {
3563
- return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => Ji(e.style.getPropertyValue("src")));
3634
+ function _a(e) {
3635
+ return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => ia(e.style.getPropertyValue("src")));
3564
3636
  }
3565
- async function ca(e, t) {
3637
+ async function va(e, t) {
3566
3638
  if (e.ownerDocument == null) throw Error("Provided element is not within a Document");
3567
- return sa(await oa(Y(e.ownerDocument.styleSheets), t));
3639
+ return _a(await ga(li(e.ownerDocument.styleSheets), t));
3568
3640
  }
3569
- function la(e) {
3641
+ function ya(e) {
3570
3642
  return e.trim().replace(/["']/g, "");
3571
3643
  }
3572
- function ua(e) {
3644
+ function ba(e) {
3573
3645
  let t = /* @__PURE__ */ new Set();
3574
3646
  function n(e) {
3575
3647
  (e.style.fontFamily || getComputedStyle(e).fontFamily).split(",").forEach((e) => {
3576
- t.add(la(e));
3648
+ t.add(ya(e));
3577
3649
  }), Array.from(e.children).forEach((e) => {
3578
3650
  e instanceof HTMLElement && n(e);
3579
3651
  });
3580
3652
  }
3581
3653
  return n(e), t;
3582
3654
  }
3583
- async function da(e, t) {
3584
- let n = await ca(e, t), r = ua(e);
3585
- return (await Promise.all(n.filter((e) => r.has(la(e.style.fontFamily))).map((e) => {
3655
+ async function xa(e, t) {
3656
+ let n = await va(e, t), r = ba(e);
3657
+ return (await Promise.all(n.filter((e) => r.has(ya(e.style.fontFamily))).map((e) => {
3586
3658
  let n = e.parentStyleSheet ? e.parentStyleSheet.href : null;
3587
- return Yi(e.cssText, n, t);
3659
+ return aa(e.cssText, n, t);
3588
3660
  }))).join("\n");
3589
3661
  }
3590
- async function fa(e, t) {
3591
- let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await da(e, t) : t.fontEmbedCSS;
3662
+ async function Sa(e, t) {
3663
+ let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await xa(e, t) : t.fontEmbedCSS;
3592
3664
  if (n) {
3593
3665
  let t = document.createElement("style"), r = document.createTextNode(n);
3594
3666
  t.appendChild(r), e.firstChild ? e.insertBefore(t, e.firstChild) : e.appendChild(t);
@@ -3596,18 +3668,18 @@ async function fa(e, t) {
3596
3668
  }
3597
3669
  //#endregion
3598
3670
  //#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js
3599
- async function pa(e, t = {}) {
3600
- let { width: n, height: r } = ai(e, t), i = await Bi(e, t, !0);
3601
- return await fa(i, t), await ea(i, t), ta(i, t), await ui(i, n, r);
3671
+ async function Ca(e, t = {}) {
3672
+ let { width: n, height: r } = hi(e, t), i = await Xi(e, t, !0);
3673
+ return await Sa(i, t), await ua(i, t), da(i, t), await bi(i, n, r);
3602
3674
  }
3603
- async function ma(e, t = {}) {
3604
- let { width: n, height: r } = ai(e, t), i = await ci(await pa(e, t)), a = document.createElement("canvas"), o = a.getContext("2d"), s = t.pixelRatio || oi(), c = t.canvasWidth || n, l = t.canvasHeight || r;
3605
- return a.width = c * s, a.height = l * s, t.skipAutoScale || si(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;
3675
+ async function wa(e, t = {}) {
3676
+ let { width: n, height: r } = hi(e, t), i = await vi(await Ca(e, t)), a = document.createElement("canvas"), o = a.getContext("2d"), s = t.pixelRatio || gi(), c = t.canvasWidth || n, l = t.canvasHeight || r;
3677
+ return a.width = c * s, a.height = l * s, t.skipAutoScale || _i(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;
3606
3678
  }
3607
3679
  //#endregion
3608
3680
  //#region src/runtime/screenshot.ts
3609
- var ha = 2 * 1024 * 1024, ga = "background:currentColor!important;color:transparent!important;text-shadow:none!important;-webkit-text-fill-color:transparent!important", _a = "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\"]";
3610
- function va(e) {
3681
+ var Ta = 2 * 1024 * 1024, Ea = "background:currentColor!important;color:transparent!important;text-shadow:none!important;-webkit-text-fill-color:transparent!important", Da = "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\"]";
3682
+ function Oa(e) {
3611
3683
  let t = e.parentElement;
3612
3684
  for (; t;) {
3613
3685
  if (t.hasAttribute("data-markup-safe")) return !0;
@@ -3615,35 +3687,37 @@ function va(e) {
3615
3687
  }
3616
3688
  return !1;
3617
3689
  }
3618
- function ya(e) {
3690
+ function ka(e) {
3619
3691
  let t = /* @__PURE__ */ new Set(), n = [];
3620
3692
  function r(e) {
3621
3693
  t.has(e) || (t.add(e), n.push(e));
3622
3694
  }
3623
3695
  for (let e of document.querySelectorAll("[data-markup-private],[data-markup-redact]")) r(e);
3624
- for (let e of document.querySelectorAll(_a)) va(e) || r(e);
3696
+ for (let e of document.querySelectorAll(Da)) Oa(e) || r(e);
3625
3697
  if (e.redactSelector) try {
3626
- for (let t of document.querySelectorAll(e.redactSelector)) va(t) || r(t);
3627
- } catch {}
3628
- if (e.strictScrub) for (let e of document.querySelectorAll("input,select,textarea")) va(e) || r(e);
3698
+ for (let t of document.querySelectorAll(e.redactSelector)) Oa(t) || r(t);
3699
+ } catch (e) {
3700
+ F(e, { context: "screenshot-redact-selector" });
3701
+ }
3702
+ if (e.strictScrub) for (let e of document.querySelectorAll("input,select,textarea")) Oa(e) || r(e);
3629
3703
  return n;
3630
3704
  }
3631
- function ba(e) {
3705
+ function Aa(e) {
3632
3706
  let t = e.getAttribute("style");
3633
- return e.setAttribute("style", t ? `${t};${ga}` : ga), () => {
3707
+ return e.setAttribute("style", t ? `${t};${Ea}` : Ea), () => {
3634
3708
  t === null ? e.removeAttribute("style") : e.setAttribute("style", t);
3635
3709
  };
3636
3710
  }
3637
- function xa(e) {
3711
+ function ja(e) {
3638
3712
  if (e.id) return `#${CSS.escape(e.id)}`;
3639
3713
  let t = e.tagName.toLowerCase(), n = e.getAttribute("type"), r = e.getAttribute("name");
3640
3714
  return n && r ? `${t}[type="${n}"][name="${r}"]` : n ? `${t}[type="${n}"]` : r ? `${t}[name="${r}"]` : t;
3641
3715
  }
3642
- async function Sa(e, t, n) {
3716
+ async function Ma(e, t, n) {
3643
3717
  try {
3644
- let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = n ? ya(n) : [], s = o.map(xa), c = o.map(ba), l;
3718
+ let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = n ? ka(n) : [], s = o.map(ja), c = o.map(Aa), l;
3645
3719
  try {
3646
- l = await ma(document.documentElement, {
3720
+ l = await wa(document.documentElement, {
3647
3721
  width: r,
3648
3722
  height: i,
3649
3723
  cacheBust: !0,
@@ -3662,29 +3736,29 @@ async function Sa(e, t, n) {
3662
3736
  }
3663
3737
  if (t) {
3664
3738
  let e = l.getContext("2d");
3665
- e && wa(e, t.x, t.y, a);
3739
+ e && Pa(e, t.x, t.y, a);
3666
3740
  }
3667
- let u = await Ca(l, .85);
3741
+ let u = await Na(l, .85);
3668
3742
  if (!u) return null;
3669
- if (u.size <= ha) return {
3743
+ if (u.size <= Ta) return {
3670
3744
  blob: u,
3671
3745
  redactedCount: s.length,
3672
3746
  redactedSelectors: s
3673
3747
  };
3674
- let d = await Ca(l, .5);
3675
- return !d || d.size > ha ? null : {
3748
+ let d = await Na(l, .5);
3749
+ return !d || d.size > Ta ? null : {
3676
3750
  blob: d,
3677
3751
  redactedCount: s.length,
3678
3752
  redactedSelectors: s
3679
3753
  };
3680
- } catch {
3681
- return null;
3754
+ } catch (e) {
3755
+ return F(e, { context: "screenshot-capture" }), null;
3682
3756
  }
3683
3757
  }
3684
- function Ca(e, t) {
3758
+ function Na(e, t) {
3685
3759
  return new Promise((n) => e.toBlob(n, "image/jpeg", t));
3686
3760
  }
3687
- function wa(e, t, n, r) {
3761
+ function Pa(e, t, n, r) {
3688
3762
  let i = r, a = 28 * i, o = a / 2, s = t * i, c = n * i;
3689
3763
  e.save();
3690
3764
  let l = 2 * i;
@@ -3702,7 +3776,7 @@ function wa(e, t, n, r) {
3702
3776
  }
3703
3777
  //#endregion
3704
3778
  //#region src/runtime/use-subscription-token.ts
3705
- var Ta = ar({
3779
+ var Fa = mr({
3706
3780
  idle: { issued: (e, t) => ({
3707
3781
  kind: "active",
3708
3782
  token: t.token,
@@ -3713,10 +3787,10 @@ var Ta = ar({
3713
3787
  token: t.token,
3714
3788
  expiresAt: t.expiresAt
3715
3789
  }) }
3716
- }), Ea = 30 * 6e4, Da = 6e4, Oa = 6e4;
3717
- function ka(e) {
3718
- let [t, n] = or(Ta, { kind: "idle" });
3719
- return R(() => {
3790
+ }), Ia = 30 * 6e4, La = 6e4, Ra = 6e4;
3791
+ function za(e) {
3792
+ let [t, n] = hr(Fa, { kind: "idle" });
3793
+ return B(() => {
3720
3794
  let t = !1, r = null;
3721
3795
  async function i() {
3722
3796
  try {
@@ -3727,11 +3801,11 @@ function ka(e) {
3727
3801
  token: a.token,
3728
3802
  expiresAt: a.expiresAt
3729
3803
  });
3730
- let o = Math.max(Da, a.expiresAt - Date.now() - Ea);
3804
+ let o = Math.max(La, a.expiresAt - Date.now() - Ia);
3731
3805
  r = setTimeout(i, o);
3732
- } catch {
3806
+ } catch (e) {
3733
3807
  if (t) return;
3734
- r = setTimeout(i, Oa);
3808
+ e?.name !== "TypeError" && F(e, { context: "subscription-token-refresh" }), r = setTimeout(i, Ra);
3735
3809
  }
3736
3810
  }
3737
3811
  return i(), () => {
@@ -3741,7 +3815,7 @@ function ka(e) {
3741
3815
  }
3742
3816
  //#endregion
3743
3817
  //#region src/runtime/refresh-token.ts
3744
- async function Aa(e) {
3818
+ async function Ba(e) {
3745
3819
  try {
3746
3820
  let t = {
3747
3821
  method: "POST",
@@ -3770,24 +3844,25 @@ async function Aa(e) {
3770
3844
  refreshToken: r.refreshToken,
3771
3845
  refreshTokenExpiresAt: r.refreshTokenExpiresAt
3772
3846
  };
3773
- } catch {
3774
- return null;
3847
+ } catch (e) {
3848
+ let t = e?.name;
3849
+ return t !== "AbortError" && t !== "TypeError" && F(e, { context: "refresh-token" }), null;
3775
3850
  }
3776
3851
  }
3777
3852
  //#endregion
3778
3853
  //#region src/runtime/use-token-refresh.ts
3779
- var ja = 6e4, Ma = 500;
3780
- function Na(e, t, n, r, i) {
3854
+ var Va = 6e4, Ha = 500;
3855
+ function Ua(e, t, n, r, i) {
3781
3856
  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;
3782
- R(() => {
3857
+ B(() => {
3783
3858
  if (!a || c == null || l == null || o === "localStorage" && s == null || o !== "cookies" && o !== "localStorage") return;
3784
3859
  let u = Date.now();
3785
3860
  if (c <= u) {
3786
3861
  i();
3787
3862
  return;
3788
3863
  }
3789
- let d = Math.max(Ma, l - ja - u), f = new AbortController(), p = window.setTimeout(async () => {
3790
- let a = await Aa({
3864
+ let d = Math.max(Ha, l - Va - u), f = new AbortController(), p = window.setTimeout(async () => {
3865
+ let a = await Ba({
3791
3866
  apiUrl: t,
3792
3867
  apiKey: n,
3793
3868
  mode: o,
@@ -3832,12 +3907,12 @@ function Q(...e) {
3832
3907
  }
3833
3908
  //#endregion
3834
3909
  //#region src/runtime/use-drag.ts
3835
- function Pa(e) {
3836
- let t = z(e);
3910
+ function Wa(e) {
3911
+ let t = V(e);
3837
3912
  t.current = e;
3838
- let [n, r] = L(!1), i = z(!1);
3913
+ let [n, r] = z(!1), i = V(!1);
3839
3914
  return {
3840
- onPointerDown: B((e) => {
3915
+ onPointerDown: H((e) => {
3841
3916
  let n = t.current;
3842
3917
  if (n.preventDefault && e.preventDefault(), n.stopPropagation && e.stopPropagation(), e.button !== 0 || n.shouldStart && !n.shouldStart(e)) return;
3843
3918
  let a = e.currentTarget;
@@ -3861,8 +3936,8 @@ function Pa(e) {
3861
3936
  g = !0, i.current = !0, r(!0), t.current.onStart?.();
3862
3937
  }
3863
3938
  let o = Math.max(m, window.innerWidth - d - m), v = Math.max(m, window.innerHeight - f - m), y = {
3864
- left: Fa(l + n, m, o),
3865
- top: Fa(u + a, m, v)
3939
+ left: Ga(l + n, m, o),
3940
+ top: Ga(u + a, m, v)
3866
3941
  };
3867
3942
  _ = y, t.current.onMove(y);
3868
3943
  }
@@ -3875,15 +3950,15 @@ function Pa(e) {
3875
3950
  a.addEventListener("pointermove", y), a.addEventListener("pointerup", b), a.addEventListener("pointercancel", x);
3876
3951
  }, []),
3877
3952
  isDragging: n,
3878
- consumeClickIfDragged: B(() => i.current ? (i.current = !1, !0) : !1, [])
3953
+ consumeClickIfDragged: H(() => i.current ? (i.current = !1, !0) : !1, [])
3879
3954
  };
3880
3955
  }
3881
- function Fa(e, t, n) {
3956
+ function Ga(e, t, n) {
3882
3957
  return Math.max(t, Math.min(n, e));
3883
3958
  }
3884
3959
  //#endregion
3885
3960
  //#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
3886
- var Ia = 0;
3961
+ var Ka = 0;
3887
3962
  Array.isArray;
3888
3963
  function $(e, n, r, i, a, o) {
3889
3964
  n ||= {};
@@ -3900,7 +3975,7 @@ function $(e, n, r, i, a, o) {
3900
3975
  __e: null,
3901
3976
  __c: null,
3902
3977
  constructor: void 0,
3903
- __v: --Ia,
3978
+ __v: --Ka,
3904
3979
  __i: -1,
3905
3980
  __u: 0,
3906
3981
  __source: a,
@@ -3911,7 +3986,7 @@ function $(e, n, r, i, a, o) {
3911
3986
  }
3912
3987
  //#endregion
3913
3988
  //#region src/runtime/ui/icons.tsx
3914
- function La({ size: e = 16 }) {
3989
+ function qa({ size: e = 16 }) {
3915
3990
  return /* @__PURE__ */ $("svg", {
3916
3991
  width: e,
3917
3992
  height: e,
@@ -3921,7 +3996,7 @@ function La({ size: e = 16 }) {
3921
3996
  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" })
3922
3997
  });
3923
3998
  }
3924
- function Ra({ size: e = 16 }) {
3999
+ function Ja({ size: e = 16 }) {
3925
4000
  return /* @__PURE__ */ $("svg", {
3926
4001
  width: e,
3927
4002
  height: e,
@@ -3930,7 +4005,7 @@ function Ra({ size: e = 16 }) {
3930
4005
  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" })
3931
4006
  });
3932
4007
  }
3933
- function za({ size: e = 16 }) {
4008
+ function Ya({ size: e = 16 }) {
3934
4009
  return /* @__PURE__ */ $("svg", {
3935
4010
  width: e,
3936
4011
  height: e,
@@ -3939,7 +4014,7 @@ function za({ size: e = 16 }) {
3939
4014
  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" })
3940
4015
  });
3941
4016
  }
3942
- function Ba({ size: e = 16 }) {
4017
+ function Xa({ size: e = 16 }) {
3943
4018
  return /* @__PURE__ */ $("svg", {
3944
4019
  width: e,
3945
4020
  height: e,
@@ -3952,7 +4027,7 @@ function Ba({ size: e = 16 }) {
3952
4027
  })
3953
4028
  });
3954
4029
  }
3955
- function Va({ size: e = 16 }) {
4030
+ function Za({ size: e = 16 }) {
3956
4031
  return /* @__PURE__ */ $("svg", {
3957
4032
  width: e,
3958
4033
  height: e,
@@ -3966,7 +4041,7 @@ function Va({ size: e = 16 }) {
3966
4041
  })
3967
4042
  });
3968
4043
  }
3969
- function Ha({ size: e = 16 }) {
4044
+ function Qa({ size: e = 16 }) {
3970
4045
  return /* @__PURE__ */ $("svg", {
3971
4046
  width: e,
3972
4047
  height: e,
@@ -3975,7 +4050,7 @@ function Ha({ size: e = 16 }) {
3975
4050
  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" })
3976
4051
  });
3977
4052
  }
3978
- function Ua({ size: e = 16 }) {
4053
+ function $a({ size: e = 16 }) {
3979
4054
  return /* @__PURE__ */ $("svg", {
3980
4055
  width: e,
3981
4056
  height: e,
@@ -3987,8 +4062,8 @@ function Ua({ size: e = 16 }) {
3987
4062
  }
3988
4063
  //#endregion
3989
4064
  //#region src/runtime/ui/fab.tsx
3990
- function Wa({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i, variant: a = "default" }) {
3991
- let o = a === "icon-only", s = r === "bottom-left" ? "markup-fab-left" : r === "bottom-center" ? "markup-fab-center" : "markup-fab-right", [c, l] = L(null), { onPointerDown: u, isDragging: d, consumeClickIfDragged: f } = Pa({
4065
+ function eo({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i, variant: a = "default" }) {
4066
+ let o = a === "icon-only", s = r === "bottom-left" ? "markup-fab-left" : r === "bottom-center" ? "markup-fab-center" : "markup-fab-right", [c, l] = z(null), { onPointerDown: u, isDragging: d, consumeClickIfDragged: f } = Wa({
3992
4067
  preventDefault: !0,
3993
4068
  stopPropagation: !0,
3994
4069
  onMove: l,
@@ -4020,7 +4095,7 @@ function Wa({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
4020
4095
  "aria-pressed": e,
4021
4096
  children: [/* @__PURE__ */ $("span", {
4022
4097
  class: "markup-fab-icon",
4023
- children: $(e ? Ra : La, { size: 16 })
4098
+ children: $(e ? Ja : qa, { size: 16 })
4024
4099
  }), o ? null : /* @__PURE__ */ $("span", {
4025
4100
  class: "markup-fab-label",
4026
4101
  children: e ? "Cancel" : "Markup"
@@ -4029,7 +4104,7 @@ function Wa({ isActive: e, onToggle: t, onHide: n, position: r = "bottom-right",
4029
4104
  }
4030
4105
  //#endregion
4031
4106
  //#region src/runtime/use-focus-trap.ts
4032
- var Ga = [
4107
+ var to = [
4033
4108
  "a[href]",
4034
4109
  "button:not([disabled])",
4035
4110
  "input:not([disabled])",
@@ -4037,14 +4112,14 @@ var Ga = [
4037
4112
  "textarea:not([disabled])",
4038
4113
  "[tabindex]:not([tabindex=\"-1\"])"
4039
4114
  ].join(",");
4040
- function Ka(e, t) {
4041
- R(() => {
4115
+ function no(e, t) {
4116
+ B(() => {
4042
4117
  if (!t) return;
4043
4118
  let n = e.current;
4044
4119
  if (!n) return;
4045
4120
  function r(e) {
4046
4121
  if (e.key !== "Tab") return;
4047
- let t = Array.from(n.querySelectorAll(Ga)), r = t[0], i = t[t.length - 1];
4122
+ let t = Array.from(n.querySelectorAll(to)), r = t[0], i = t[t.length - 1];
4048
4123
  if (!r || !i) return;
4049
4124
  let a = n.getRootNode(), o = a instanceof ShadowRoot ? a.activeElement : document.activeElement;
4050
4125
  (e.shiftKey ? o === r : o === i) && (e.preventDefault(), (e.shiftKey ? i : r).focus());
@@ -4054,9 +4129,9 @@ function Ka(e, t) {
4054
4129
  }
4055
4130
  //#endregion
4056
4131
  //#region src/runtime/use-object-url.ts
4057
- function qa(e) {
4058
- let [t, n] = L(null);
4059
- return R(() => {
4132
+ function ro(e) {
4133
+ let [t, n] = z(null);
4134
+ return B(() => {
4060
4135
  if (!e) {
4061
4136
  n(null);
4062
4137
  return;
@@ -4067,9 +4142,9 @@ function qa(e) {
4067
4142
  }
4068
4143
  //#endregion
4069
4144
  //#region src/runtime/ui/author-prompt.tsx
4070
- function Ja({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit: r, onCancel: i, onSignIn: a }) {
4071
- let [o, s] = L(""), [c, l] = L(""), u = z(null);
4072
- R(() => {
4145
+ function io({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit: r, onCancel: i, onSignIn: a }) {
4146
+ let [o, s] = z(""), [c, l] = z(""), u = V(null);
4147
+ B(() => {
4073
4148
  u.current?.focus();
4074
4149
  }, []);
4075
4150
  function d(n) {
@@ -4146,18 +4221,18 @@ function Ja({ isPending: e, isConnecting: t = !1, isSigningIn: n = !1, onSubmit:
4146
4221
  }
4147
4222
  //#endregion
4148
4223
  //#region src/runtime/ui/composer.tsx
4149
- var Ya = 4e3;
4150
- function Xa({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o }) {
4151
- let [s, c] = L(""), l = z(null), u = z(!1);
4152
- R(() => {
4224
+ var ao = 4e3;
4225
+ function oo({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, isPending: i, error: a, onSubmit: o }) {
4226
+ let [s, c] = z(""), l = V(null), u = V(!1);
4227
+ B(() => {
4153
4228
  r && l.current?.focus();
4154
- }, [r]), R(() => {
4229
+ }, [r]), B(() => {
4155
4230
  let e = l.current;
4156
4231
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 160)}px`);
4157
- }, [s]), R(() => {
4232
+ }, [s]), B(() => {
4158
4233
  u.current && !i && !a && (c(""), l.current?.focus()), u.current = i;
4159
4234
  }, [i, a]);
4160
- let d = Ya - s.length, f = d < 0;
4235
+ let d = ao - s.length, f = d < 0;
4161
4236
  function p(e) {
4162
4237
  e?.preventDefault();
4163
4238
  let t = s.trim();
@@ -4175,7 +4250,7 @@ function Xa({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
4175
4250
  "aria-label": i ? "Sending…" : n,
4176
4251
  title: i ? "Sending…" : n,
4177
4252
  tabIndex: e,
4178
- children: /* @__PURE__ */ $(Ha, { size: 14 })
4253
+ children: /* @__PURE__ */ $(Qa, { size: 14 })
4179
4254
  });
4180
4255
  }
4181
4256
  return /* @__PURE__ */ $("form", {
@@ -4188,7 +4263,7 @@ function Xa({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
4188
4263
  class: "markup-composer-input",
4189
4264
  placeholder: t,
4190
4265
  rows: h ? 2 : 1,
4191
- maxLength: Ya + 100,
4266
+ maxLength: ao + 100,
4192
4267
  value: s,
4193
4268
  onInput: (e) => c(e.currentTarget.value),
4194
4269
  onKeyDown: m,
@@ -4224,15 +4299,15 @@ function Xa({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
4224
4299
  }
4225
4300
  //#endregion
4226
4301
  //#region src/runtime/ui/new-thread-popover.tsx
4227
- function Za({ 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 }) {
4228
- let g = z(null);
4229
- Ka(g, !0);
4230
- let [_, v] = L(!1), [y, b] = L(!1), x = qa(c), [C, w] = L(null), { onPointerDown: T, isDragging: E } = Pa({
4302
+ function so({ 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 }) {
4303
+ let g = V(null);
4304
+ no(g, !0);
4305
+ let [_, v] = z(!1), [y, b] = z(!1), x = ro(c), [C, w] = z(null), { onPointerDown: T, isDragging: E } = Wa({
4231
4306
  targetRef: g,
4232
4307
  shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
4233
4308
  onMove: w
4234
4309
  });
4235
- R(() => {
4310
+ B(() => {
4236
4311
  let e = g.current;
4237
4312
  if (!e) return;
4238
4313
  if (typeof e.showPopover == "function" && !e.matches(":popover-open")) try {
@@ -4243,7 +4318,7 @@ function Za({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4243
4318
  }
4244
4319
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
4245
4320
  }, [h]);
4246
- let D = Qa(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), O = Qa(t - window.scrollY - 16, 12, window.innerHeight - 220), k = c != null, A = l || k;
4321
+ let D = co(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), O = co(t - window.scrollY - 16, 12, window.innerHeight - 220), k = c != null, A = l || k;
4247
4322
  return /* @__PURE__ */ $("div", {
4248
4323
  ref: g,
4249
4324
  class: Q("markup-popover", C && "is-floating", E && "is-dragging"),
@@ -4265,9 +4340,9 @@ function Za({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4265
4340
  class: "markup-icon-btn",
4266
4341
  "aria-label": "Discard pin",
4267
4342
  onClick: h,
4268
- children: /* @__PURE__ */ $(Ra, { size: 16 })
4343
+ children: /* @__PURE__ */ $(Ja, { size: 16 })
4269
4344
  })]
4270
- }), n == null ? /* @__PURE__ */ $(Ja, {
4345
+ }), n == null ? /* @__PURE__ */ $(io, {
4271
4346
  isPending: o,
4272
4347
  isConnecting: i,
4273
4348
  isSigningIn: a,
@@ -4291,7 +4366,7 @@ function Za({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4291
4366
  }) : null
4292
4367
  ]
4293
4368
  }),
4294
- /* @__PURE__ */ $(Xa, {
4369
+ /* @__PURE__ */ $(oo, {
4295
4370
  label: "Feedback",
4296
4371
  placeholder: "What's wrong, missing, or worth noting?",
4297
4372
  submitLabel: "Post markup",
@@ -4309,7 +4384,7 @@ function Za({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4309
4384
  class: "markup-screenshot-checkbox",
4310
4385
  disabled: !0
4311
4386
  }),
4312
- /* @__PURE__ */ $(Va, { size: 12 }),
4387
+ /* @__PURE__ */ $(Za, { size: 12 }),
4313
4388
  /* @__PURE__ */ $("span", { children: "Capturing…" })
4314
4389
  ]
4315
4390
  }) : /* @__PURE__ */ $("label", {
@@ -4321,7 +4396,7 @@ function Za({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4321
4396
  checked: _,
4322
4397
  onChange: (e) => v(e.currentTarget.checked)
4323
4398
  }),
4324
- /* @__PURE__ */ $(Va, { size: 12 }),
4399
+ /* @__PURE__ */ $(Za, { size: 12 }),
4325
4400
  /* @__PURE__ */ $("span", { children: "Attach screenshot" }),
4326
4401
  x && _ ? /* @__PURE__ */ $("img", {
4327
4402
  class: "markup-screenshot-thumb",
@@ -4369,12 +4444,12 @@ function Za({ pageX: e, pageY: t, authorName: n, isVerified: r, isIdentityResolv
4369
4444
  })]
4370
4445
  });
4371
4446
  }
4372
- function Qa(e, t, n) {
4447
+ function co(e, t, n) {
4373
4448
  return Math.max(t, Math.min(n, e));
4374
4449
  }
4375
4450
  //#endregion
4376
4451
  //#region src/runtime/ui/pin.tsx
4377
- function $a({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClick: a }) {
4452
+ function lo({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClick: a }) {
4378
4453
  let o = t - window.scrollY, s = e - window.scrollX;
4379
4454
  return /* @__PURE__ */ $("button", {
4380
4455
  type: "button",
@@ -4397,7 +4472,7 @@ function $a({ pageX: e, pageY: t, count: n, isActive: r, isUnresolved: i, onClic
4397
4472
  }) : null]
4398
4473
  });
4399
4474
  }
4400
- function eo({ pageX: e, pageY: t }) {
4475
+ function uo({ pageX: e, pageY: t }) {
4401
4476
  let n = t - window.scrollY, r = e - window.scrollX;
4402
4477
  return /* @__PURE__ */ $("div", {
4403
4478
  class: "markup-pin markup-pin-ghost is-anchor",
@@ -4413,15 +4488,15 @@ function eo({ pageX: e, pageY: t }) {
4413
4488
  }
4414
4489
  //#endregion
4415
4490
  //#region src/runtime/ui/placement-overlay.tsx
4416
- function to({ onPlace: e, onCancel: t }) {
4417
- R(() => {
4491
+ function fo({ onPlace: e, onCancel: t }) {
4492
+ B(() => {
4418
4493
  function e(e) {
4419
4494
  e.key === "Escape" && t();
4420
4495
  }
4421
4496
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
4422
4497
  }, [t]);
4423
4498
  function n(t) {
4424
- t.stopPropagation(), t.preventDefault(), e(kr(t, document.elementsFromPoint(t.clientX, t.clientY).find((e) => !e.shadowRoot) ?? null), t.clientX, t.clientY);
4499
+ t.stopPropagation(), t.preventDefault(), e(Rr(t, document.elementsFromPoint(t.clientX, t.clientY).find((e) => !e.shadowRoot) ?? null), t.clientX, t.clientY);
4425
4500
  }
4426
4501
  function r(e) {
4427
4502
  e.preventDefault(), e.stopPropagation();
@@ -4439,14 +4514,14 @@ function to({ onPlace: e, onCancel: t }) {
4439
4514
  }
4440
4515
  //#endregion
4441
4516
  //#region src/runtime/ui/thread-popover.tsx
4442
- var no = [
4517
+ var po = [
4443
4518
  "👍",
4444
4519
  "❤️",
4445
4520
  "🎉",
4446
4521
  "😮",
4447
4522
  "😄",
4448
4523
  "❓"
4449
- ], ro = ar({
4524
+ ], mo = mr({
4450
4525
  none: {
4451
4526
  "toggle-thread-menu": () => ({
4452
4527
  kind: "thread-menu",
@@ -4502,22 +4577,22 @@ var no = [
4502
4577
  dismiss: () => ({ kind: "none" })
4503
4578
  }
4504
4579
  });
4505
- function io({ 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 }) {
4506
- let y = z(null), b = z(null), x = z(null), S = z(null), [C, w] = or(ro, { kind: "none" }), [T, E] = L(null), { onPointerDown: D, isDragging: O } = Pa({
4580
+ function ho({ 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 }) {
4581
+ let y = V(null), b = V(null), x = V(null), S = V(null), [C, w] = hr(mo, { kind: "none" }), [T, E] = z(null), { onPointerDown: D, isDragging: O } = Wa({
4507
4582
  targetRef: y,
4508
4583
  shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
4509
4584
  onMove: E
4510
4585
  });
4511
- Ka(y, !0);
4512
- let k = e.resolvedAt != null, A = we(() => e.comments.filter((e) => !e.deleted), [e.comments]);
4513
- R(() => {
4586
+ no(y, !0);
4587
+ let k = e.resolvedAt != null, A = Me(() => e.comments.filter((e) => !e.deleted), [e.comments]);
4588
+ B(() => {
4514
4589
  if (C.kind === "none" || C.kind === "editing") return;
4515
4590
  function e(e) {
4516
4591
  let t = S.current;
4517
4592
  t && !e.composedPath().includes(t) && w({ type: "dismiss" });
4518
4593
  }
4519
4594
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
4520
- }, [C.kind, w]), R(() => {
4595
+ }, [C.kind, w]), B(() => {
4521
4596
  if (C.kind !== "editing") return;
4522
4597
  let t = e.comments.find((e) => e._id === C.commentId);
4523
4598
  (!t || t.deleted) && w({ type: "dismiss" });
@@ -4526,8 +4601,8 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4526
4601
  C,
4527
4602
  w
4528
4603
  ]);
4529
- let j = z(!0);
4530
- R(() => {
4604
+ let j = V(!0);
4605
+ B(() => {
4531
4606
  let e = b.current;
4532
4607
  if (e) {
4533
4608
  if (j.current) {
@@ -4536,7 +4611,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4536
4611
  }
4537
4612
  e.scrollHeight - e.scrollTop - e.clientHeight < 80 && (e.scrollTop = e.scrollHeight);
4538
4613
  }
4539
- }, [A.length]), R(() => {
4614
+ }, [A.length]), B(() => {
4540
4615
  let e = y.current;
4541
4616
  if (!e) return;
4542
4617
  if (typeof e.showPopover == "function" && !e.matches(":popover-open")) try {
@@ -4547,15 +4622,15 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4547
4622
  }
4548
4623
  return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
4549
4624
  }, [f]);
4550
- let M = we(() => {
4551
- let t = Ar({
4625
+ let M = Me(() => {
4626
+ let t = zr({
4552
4627
  anchorX: e.anchorX,
4553
4628
  anchorY: e.anchorY,
4554
4629
  anchorSelector: e.anchorSelector
4555
4630
  });
4556
4631
  return {
4557
- left: co(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
4558
- top: co(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
4632
+ left: yo(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
4633
+ top: yo(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
4559
4634
  };
4560
4635
  }, [
4561
4636
  e.anchorX,
@@ -4599,7 +4674,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4599
4674
  class: Q("markup-icon-btn", C.kind === "thread-menu" && "is-open"),
4600
4675
  title: "More options",
4601
4676
  onClick: () => w({ type: "toggle-thread-menu" }),
4602
- children: /* @__PURE__ */ $(za, { size: 16 })
4677
+ children: /* @__PURE__ */ $(Ya, { size: 16 })
4603
4678
  }), C.kind === "thread-menu" ? /* @__PURE__ */ $("div", {
4604
4679
  class: "markup-thread-menu-list",
4605
4680
  children: [/* @__PURE__ */ $("button", {
@@ -4627,14 +4702,14 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4627
4702
  title: "Mark as resolved",
4628
4703
  disabled: s,
4629
4704
  onClick: _,
4630
- children: /* @__PURE__ */ $(Ba, { size: 16 })
4705
+ children: /* @__PURE__ */ $(Xa, { size: 16 })
4631
4706
  }) : null,
4632
4707
  /* @__PURE__ */ $("button", {
4633
4708
  type: "button",
4634
4709
  class: "markup-icon-btn",
4635
4710
  title: "Close thread",
4636
4711
  onClick: f,
4637
- children: /* @__PURE__ */ $(Ra, { size: 16 })
4712
+ children: /* @__PURE__ */ $(Ja, { size: 16 })
4638
4713
  })
4639
4714
  ]
4640
4715
  })]
@@ -4661,12 +4736,12 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4661
4736
  /* @__PURE__ */ $("time", {
4662
4737
  class: "markup-comment-time",
4663
4738
  datetime: new Date(t.createdAt).toISOString(),
4664
- title: uo(t.createdAt),
4665
- children: lo(t.createdAt)
4739
+ title: xo(t.createdAt),
4740
+ children: bo(t.createdAt)
4666
4741
  }),
4667
4742
  /* @__PURE__ */ $("div", {
4668
4743
  class: "markup-thread-actions",
4669
- children: [!k && !l ? /* @__PURE__ */ $(ao, {
4744
+ children: [!k && !l ? /* @__PURE__ */ $(go, {
4670
4745
  comment: t,
4671
4746
  pickerOpen: p,
4672
4747
  pickerDirection: _,
@@ -4734,7 +4809,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4734
4809
  direction: a < i ? "up" : "down"
4735
4810
  });
4736
4811
  },
4737
- children: /* @__PURE__ */ $(za, { size: 16 })
4812
+ children: /* @__PURE__ */ $(Ya, { size: 16 })
4738
4813
  }), d ? /* @__PURE__ */ $("div", {
4739
4814
  class: "markup-thread-menu-list",
4740
4815
  children: [o ? /* @__PURE__ */ $("button", {
@@ -4806,7 +4881,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4806
4881
  children: [t.body, t.editedAt == null ? null : /* @__PURE__ */ $("time", {
4807
4882
  class: "markup-comment-edited",
4808
4883
  datetime: new Date(t.editedAt).toISOString(),
4809
- title: uo(t.editedAt),
4884
+ title: xo(t.editedAt),
4810
4885
  children: [" ", "(edited)"]
4811
4886
  })]
4812
4887
  }),
@@ -4819,7 +4894,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4819
4894
  alt: "Screenshot"
4820
4895
  })
4821
4896
  }) : null,
4822
- !l && t.reactions.length > 0 ? /* @__PURE__ */ $(oo, {
4897
+ !l && t.reactions.length > 0 ? /* @__PURE__ */ $(_o, {
4823
4898
  comment: t,
4824
4899
  isResolved: k,
4825
4900
  onToggle: (e) => g(t._id, e)
@@ -4839,7 +4914,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4839
4914
  onClick: (e) => {
4840
4915
  e.stopPropagation(), x.current?.close();
4841
4916
  },
4842
- children: /* @__PURE__ */ $(Ra, { size: 16 })
4917
+ children: /* @__PURE__ */ $(Ja, { size: 16 })
4843
4918
  }), /* @__PURE__ */ $("img", {
4844
4919
  class: "markup-lightbox-img",
4845
4920
  src: e.screenshotUrl,
@@ -4847,7 +4922,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4847
4922
  onClick: (e) => e.stopPropagation()
4848
4923
  })]
4849
4924
  }) : null,
4850
- t == null ? /* @__PURE__ */ $(Ja, {
4925
+ t == null ? /* @__PURE__ */ $(io, {
4851
4926
  isPending: s,
4852
4927
  isConnecting: i,
4853
4928
  isSigningIn: a,
@@ -4869,7 +4944,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4869
4944
  children: "team"
4870
4945
  }) : null
4871
4946
  ]
4872
- }), /* @__PURE__ */ $(Xa, {
4947
+ }), /* @__PURE__ */ $(oo, {
4873
4948
  label: "Reply",
4874
4949
  placeholder: "Write a reply…",
4875
4950
  submitLabel: "Reply",
@@ -4882,7 +4957,7 @@ function io({ thread: e, authorName: t, currentClientId: n, isVerified: r, isIde
4882
4957
  ]
4883
4958
  });
4884
4959
  }
4885
- function ao({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pickerRef: i, onPickerClick: a, onPickerSelect: o }) {
4960
+ function go({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pickerRef: i, onPickerClick: a, onPickerSelect: o }) {
4886
4961
  return /* @__PURE__ */ $("div", {
4887
4962
  class: Q("markup-reaction-picker-wrap", t && "is-open", t && n === "up" && "is-up", r && "is-side"),
4888
4963
  ref: i,
@@ -4892,11 +4967,11 @@ function ao({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pick
4892
4967
  title: "Add reaction",
4893
4968
  "aria-label": "Add reaction",
4894
4969
  onClick: a,
4895
- children: /* @__PURE__ */ $(Ua, { size: 16 })
4970
+ children: /* @__PURE__ */ $($a, { size: 16 })
4896
4971
  }), t ? /* @__PURE__ */ $("div", {
4897
4972
  class: "markup-reaction-picker",
4898
4973
  role: "menu",
4899
- children: no.map((t) => /* @__PURE__ */ $("button", {
4974
+ children: po.map((t) => /* @__PURE__ */ $("button", {
4900
4975
  type: "button",
4901
4976
  role: "menuitem",
4902
4977
  class: Q("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
@@ -4906,11 +4981,11 @@ function ao({ comment: e, pickerOpen: t, pickerDirection: n, pickerSide: r, pick
4906
4981
  }) : null]
4907
4982
  });
4908
4983
  }
4909
- function oo({ comment: e, isResolved: t, onToggle: n }) {
4984
+ function _o({ comment: e, isResolved: t, onToggle: n }) {
4910
4985
  return /* @__PURE__ */ $("div", {
4911
4986
  class: "markup-reactions",
4912
4987
  children: e.reactions.map((e) => {
4913
- let r = so(e.reactors, e.mine, e.count, e.emoji);
4988
+ let r = vo(e.reactors, e.mine, e.count, e.emoji);
4914
4989
  return /* @__PURE__ */ $("button", {
4915
4990
  type: "button",
4916
4991
  class: Q("markup-reaction-chip", e.mine && "is-mine"),
@@ -4931,14 +5006,14 @@ function oo({ comment: e, isResolved: t, onToggle: n }) {
4931
5006
  })
4932
5007
  });
4933
5008
  }
4934
- function so(e, t, n, r) {
5009
+ function vo(e, t, n, r) {
4935
5010
  let i = e.slice(), a = i.length + +!!t, o = Math.max(0, n - a);
4936
5011
  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}`;
4937
5012
  }
4938
- function co(e, t, n) {
5013
+ function yo(e, t, n) {
4939
5014
  return Math.max(t, Math.min(n, e));
4940
5015
  }
4941
- function lo(e) {
5016
+ function bo(e) {
4942
5017
  let t = Date.now() - e, n = Math.floor(t / 1e3);
4943
5018
  if (n < 60) return "just now";
4944
5019
  let r = Math.floor(n / 60);
@@ -4955,7 +5030,7 @@ function lo(e) {
4955
5030
  year: "numeric"
4956
5031
  });
4957
5032
  }
4958
- function uo(e) {
5033
+ function xo(e) {
4959
5034
  return new Date(e).toLocaleDateString([], {
4960
5035
  month: "long",
4961
5036
  day: "numeric",
@@ -4966,7 +5041,7 @@ function uo(e) {
4966
5041
  }
4967
5042
  //#endregion
4968
5043
  //#region src/runtime/ui/app.tsx
4969
- function fo(e) {
5044
+ function So(e) {
4970
5045
  let t = {
4971
5046
  clientId: `markup_user_${e.identity.id}`,
4972
5047
  name: e.identity.name,
@@ -4991,10 +5066,10 @@ function fo(e) {
4991
5066
  } : {}
4992
5067
  };
4993
5068
  }
4994
- function po() {
5069
+ function Co() {
4995
5070
  return window.location.host + window.location.pathname;
4996
5071
  }
4997
- var mo = ar({
5072
+ var wo = mr({
4998
5073
  visible: {
4999
5074
  "hide-with-toast": () => ({ kind: "hidden-with-toast" }),
5000
5075
  toggle: () => ({ kind: "hidden" })
@@ -5005,26 +5080,26 @@ var mo = ar({
5005
5080
  },
5006
5081
  hidden: { toggle: () => ({ kind: "visible" }) }
5007
5082
  });
5008
- function ho(e) {
5009
- return qr(e), e;
5083
+ function To(e) {
5084
+ return ni(e), e;
5010
5085
  }
5011
- var go = ar({
5086
+ var Eo = mr({
5012
5087
  unresolved: {
5013
- "mint-success": (e, t) => ho({
5088
+ "mint-success": (e, t) => To({
5014
5089
  kind: "anon",
5015
5090
  identity: t.identity
5016
5091
  }),
5017
- "signed-in": (e, t) => ho({
5092
+ "signed-in": (e, t) => To({
5018
5093
  kind: "verified",
5019
5094
  identity: t.identity
5020
5095
  })
5021
5096
  },
5022
5097
  anon: {
5023
- "signed-in": (e, t) => ho({
5098
+ "signed-in": (e, t) => To({
5024
5099
  kind: "verified",
5025
5100
  identity: t.identity
5026
5101
  }),
5027
- "author-set": (e, t) => ho({
5102
+ "author-set": (e, t) => To({
5028
5103
  kind: "anon",
5029
5104
  identity: {
5030
5105
  ...e.identity,
@@ -5034,11 +5109,11 @@ var go = ar({
5034
5109
  })
5035
5110
  },
5036
5111
  verified: {
5037
- "signed-in": (e, t) => ho({
5112
+ "signed-in": (e, t) => To({
5038
5113
  kind: "verified",
5039
5114
  identity: t.identity
5040
5115
  }),
5041
- unauthorized: (e) => ho({
5116
+ unauthorized: (e) => To({
5042
5117
  kind: "recovering",
5043
5118
  preserved: {
5044
5119
  name: e.identity.name,
@@ -5047,32 +5122,32 @@ var go = ar({
5047
5122
  })
5048
5123
  },
5049
5124
  recovering: {
5050
- "mint-success": (e, t) => ho({
5125
+ "mint-success": (e, t) => To({
5051
5126
  kind: "anon",
5052
5127
  identity: t.identity
5053
5128
  }),
5054
- "signed-in": (e, t) => ho({
5129
+ "signed-in": (e, t) => To({
5055
5130
  kind: "verified",
5056
5131
  identity: t.identity
5057
5132
  })
5058
5133
  }
5059
5134
  });
5060
- function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "default", screenshots: i }) {
5061
- let [a, o] = L(po), [s, c] = L([]), [l, u] = L(!1), d = we(() => Kr(), []), [f, p] = or(go, d.state), [m, h] = L(null);
5062
- R(() => {
5135
+ function Do({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "default", screenshots: i }) {
5136
+ let [a, o] = z(Co), [s, c] = z([]), [l, u] = z(!1), d = Me(() => ti(), []), [f, p] = hr(Eo, d.state), [m, h] = z(null);
5137
+ B(() => {
5063
5138
  let n = !1;
5064
- return Ir(e, t).then((e) => {
5139
+ return Gr(e, t).then((e) => {
5065
5140
  n || h(e);
5066
5141
  }), () => {
5067
5142
  n = !0;
5068
5143
  };
5069
5144
  }, [e, t]);
5070
- let [g, _] = L(n), v = z(f);
5071
- v.current = f, Na(f, e, t, (e) => p({
5145
+ let [g, _] = z(n), v = V(f);
5146
+ v.current = f, Ua(f, e, t, (e) => p({
5072
5147
  type: "signed-in",
5073
5148
  identity: e
5074
5149
  }), () => p({ type: "unauthorized" }));
5075
- let y = we(() => Nr({
5150
+ let y = Me(() => Hr({
5076
5151
  apiUrl: e,
5077
5152
  apiKey: t,
5078
5153
  getToken: () => {
@@ -5097,8 +5172,8 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5097
5172
  e,
5098
5173
  t,
5099
5174
  p
5100
- ]), [b, x] = L({ kind: "idle" }), S = cr(), C = cr(), w = cr(), { 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] = or(mo, { kind: "visible" }), ee = M.kind !== "visible", [te, ne] = L(0), re = z(null), ie = Yr(f), ae = f.kind === "verified", oe = f.kind === "unresolved" || f.kind === "recovering", P = Jr(f);
5101
- R(() => {
5175
+ ]), [b, x] = z({ kind: "idle" }), S = _r(), C = _r(), w = _r(), { 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] = hr(wo, { kind: "visible" }), ee = M.kind !== "visible", [te, ne] = z(0), re = V(null), ie = ii(f), ae = f.kind === "verified", oe = f.kind === "unresolved" || f.kind === "recovering", P = ri(f);
5176
+ B(() => {
5102
5177
  if (f.kind !== "unresolved" && f.kind !== "recovering") return;
5103
5178
  let e = f.kind === "recovering" ? f.preserved : d.preserved, t = !1, n = null, r = 1e3;
5104
5179
  function i() {
@@ -5125,16 +5200,16 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5125
5200
  p,
5126
5201
  d
5127
5202
  ]);
5128
- let se = ka(y), [ce, le] = L(null);
5129
- R(() => {
5130
- let t = new ir(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
5203
+ let se = za(y), [ce, le] = z(null);
5204
+ B(() => {
5205
+ let t = new pr(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
5131
5206
  return le(t), () => {
5132
5207
  t.close(), le((e) => e === t ? null : e);
5133
5208
  };
5134
5209
  }, [e]);
5135
- let ue = z(!1);
5136
- R(() => {
5137
- if (!(!ce || !se)) return E(), k(), ce.onUpdate(Jt("widget/queries:subscribeThreadsForRoute"), {
5210
+ let ue = V(!1);
5211
+ B(() => {
5212
+ if (!(!ce || !se)) return E(), k(), ce.onUpdate(rn("widget/queries:subscribeThreadsForRoute"), {
5138
5213
  subscriptionToken: se,
5139
5214
  route: a,
5140
5215
  viewerClientId: P
@@ -5148,7 +5223,7 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5148
5223
  P,
5149
5224
  E,
5150
5225
  k
5151
- ]), R(() => {
5226
+ ]), B(() => {
5152
5227
  if (ue.current || !l) return;
5153
5228
  let e = window.location.hash.match(/^#markup-thread=(.+)$/);
5154
5229
  if (e) {
@@ -5159,16 +5234,16 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5159
5234
  }), history.replaceState(null, "", window.location.pathname + window.location.search);
5160
5235
  }
5161
5236
  ue.current = !0;
5162
- }, [s, l]), R(() => Hr(() => o(po())), []), R(() => {
5237
+ }, [s, l]), B(() => Zr(() => o(Co())), []), B(() => {
5163
5238
  function e(e) {
5164
5239
  e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), N({ type: "toggle" })));
5165
5240
  }
5166
5241
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
5167
- }, [N]), R(() => {
5242
+ }, [N]), B(() => {
5168
5243
  if (M.kind !== "hidden-with-toast") return;
5169
5244
  let e = window.setTimeout(() => N({ type: "dismiss-toast" }), 5e3);
5170
5245
  return () => window.clearTimeout(e);
5171
- }, [M.kind, N]), R(() => {
5246
+ }, [M.kind, N]), B(() => {
5172
5247
  let e = null;
5173
5248
  function t() {
5174
5249
  e ??= requestAnimationFrame(() => {
@@ -5181,12 +5256,12 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5181
5256
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n.disconnect(), e != null && cancelAnimationFrame(e);
5182
5257
  };
5183
5258
  }, []);
5184
- let de = B(() => {
5259
+ let de = H(() => {
5185
5260
  E(), k(), x({ kind: "placing" });
5186
- }, [E, k]), F = B(() => {
5261
+ }, [E, k]), fe = H(() => {
5187
5262
  x({ kind: "idle" }), E(), k();
5188
- }, [E, k]), fe = z(0), pe = B((e, t, n) => {
5189
- let r = t + window.scrollX, a = n + window.scrollY, o = ++fe.current;
5263
+ }, [E, k]), pe = V(0), me = H((e, t, n) => {
5264
+ let r = t + window.scrollX, a = n + window.scrollY, o = ++pe.current;
5190
5265
  if (i?.enabled === !1) {
5191
5266
  x({
5192
5267
  kind: "composing-new",
@@ -5216,7 +5291,7 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5216
5291
  strictScrub: i?.strictScrub,
5217
5292
  redactSelector: i?.redactSelector
5218
5293
  };
5219
- Sa(s, {
5294
+ Ma(s, {
5220
5295
  x: t,
5221
5296
  y: n
5222
5297
  }, c).then((e) => {
@@ -5228,15 +5303,15 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5228
5303
  screenshotRedactedSelectors: e?.redactedSelectors ?? []
5229
5304
  });
5230
5305
  });
5231
- }, [i]), me = B((e, t) => {
5306
+ }, [i]), he = H((e, t) => {
5232
5307
  p({
5233
5308
  type: "author-set",
5234
5309
  name: e,
5235
5310
  email: t
5236
5311
  });
5237
- }, [p]), he = C.isPending, I = B(async () => {
5312
+ }, [p]), ge = C.isPending, _e = H(async () => {
5238
5313
  await D(async () => {
5239
- let n = fo(await Zr({
5314
+ let n = So(await oi({
5240
5315
  apiUrl: e,
5241
5316
  apiKey: t,
5242
5317
  useCookies: m === !0
@@ -5253,9 +5328,9 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5253
5328
  m,
5254
5329
  D,
5255
5330
  p
5256
- ]), ge = B(async (e, t) => {
5331
+ ]), ve = H(async (e, t) => {
5257
5332
  if (b.kind !== "composing-new") return;
5258
- let n = Xr(f);
5333
+ let n = ai(f);
5259
5334
  n && await T(async () => {
5260
5335
  let r;
5261
5336
  if (t && b.screenshot) {
@@ -5295,7 +5370,7 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5295
5370
  b,
5296
5371
  a,
5297
5372
  T
5298
- ]), _e = B(async () => {
5373
+ ]), ye = H(async () => {
5299
5374
  if (b.kind !== "thread") return;
5300
5375
  let e = b.threadId;
5301
5376
  await T(async () => {
@@ -5305,7 +5380,7 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5305
5380
  y,
5306
5381
  b,
5307
5382
  T
5308
- ]), ve = B(async () => {
5383
+ ]), F = H(async () => {
5309
5384
  if (b.kind !== "thread") return;
5310
5385
  let e = b.threadId;
5311
5386
  await T(async () => {
@@ -5316,9 +5391,9 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5316
5391
  b,
5317
5392
  P,
5318
5393
  T
5319
- ]), ye = B(async (e) => {
5394
+ ]), be = H(async (e) => {
5320
5395
  if (b.kind !== "thread") return;
5321
- let t = Xr(f);
5396
+ let t = ai(f);
5322
5397
  if (!t) return;
5323
5398
  let n = b.threadId;
5324
5399
  await T(async () => {
@@ -5334,7 +5409,7 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5334
5409
  f,
5335
5410
  b,
5336
5411
  T
5337
- ]), be = B(async (e, t) => {
5412
+ ]), I = H(async (e, t) => {
5338
5413
  if (b.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
5339
5414
  let n = b.threadId;
5340
5415
  await T(async () => {
@@ -5346,7 +5421,7 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5346
5421
  f,
5347
5422
  b,
5348
5423
  T
5349
- ]), xe = B(async (e) => {
5424
+ ]), xe = H(async (e) => {
5350
5425
  if (b.kind !== "thread" || f.kind !== "anon" && f.kind !== "verified") return;
5351
5426
  let t = b.threadId;
5352
5427
  await T(async () => {
@@ -5358,9 +5433,9 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5358
5433
  f,
5359
5434
  b,
5360
5435
  T
5361
- ]), Se = B(async (e, t) => {
5436
+ ]), Se = H(async (e, t) => {
5362
5437
  if (b.kind !== "thread") return;
5363
- let n = Xr(f);
5438
+ let n = ai(f);
5364
5439
  if (!n) return;
5365
5440
  let r = b.threadId;
5366
5441
  await O(async () => {
@@ -5375,18 +5450,18 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5375
5450
  f,
5376
5451
  b,
5377
5452
  O
5378
- ]), Ce = b.kind === "thread" ? s.find((e) => e._id === b.threadId) ?? null : null, Te = ae || P != null && P === Ce?.authorClientId, Ee = we(() => s.map((e) => ({
5453
+ ]), L = b.kind === "thread" ? s.find((e) => e._id === b.threadId) ?? null : null, Ce = ae || P != null && P === L?.authorClientId, R = Me(() => s.map((e) => ({
5379
5454
  thread: e,
5380
- point: Ar({
5455
+ point: zr({
5381
5456
  anchorX: e.anchorX,
5382
5457
  anchorY: e.anchorY,
5383
5458
  anchorSelector: e.anchorSelector,
5384
5459
  anchorOffsetX: e.anchorOffsetX,
5385
5460
  anchorOffsetY: e.anchorOffsetY
5386
5461
  })
5387
- })), [s, te]), De = Ee.some((e) => !e.point.resolved);
5388
- return R(() => {
5389
- if (!De) return;
5462
+ })), [s, te]), we = R.some((e) => !e.point.resolved);
5463
+ return B(() => {
5464
+ if (!we) return;
5390
5465
  let e = null;
5391
5466
  function t() {
5392
5467
  e ??= requestAnimationFrame(() => {
@@ -5400,21 +5475,21 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5400
5475
  }), () => {
5401
5476
  n.disconnect(), e != null && cancelAnimationFrame(e);
5402
5477
  };
5403
- }, [De]), R(() => {
5404
- b.kind === "thread" && Ce == null && F();
5478
+ }, [we]), B(() => {
5479
+ b.kind === "thread" && L == null && fe();
5405
5480
  }, [
5406
5481
  b,
5407
- Ce,
5408
- F
5482
+ L,
5483
+ fe
5409
5484
  ]), /* @__PURE__ */ $("div", {
5410
5485
  class: "markup-root",
5411
5486
  ref: re,
5412
5487
  children: [
5413
5488
  b.kind === "placing" ? null : /* @__PURE__ */ $("div", {
5414
5489
  class: "markup-pins-layer",
5415
- children: [ee ? null : Ee.map(({ thread: e, point: t }) => {
5490
+ children: [ee ? null : R.map(({ thread: e, point: t }) => {
5416
5491
  let n = b.kind === "thread" && b.threadId === e._id, r = e.comments.reduce((e, t) => e + +!t.deleted, 0);
5417
- return /* @__PURE__ */ $($a, {
5492
+ return /* @__PURE__ */ $(lo, {
5418
5493
  pageX: t.pageX,
5419
5494
  pageY: t.pageY,
5420
5495
  count: r,
@@ -5425,67 +5500,67 @@ function _o({ apiUrl: e, apiKey: t, position: n = "bottom-right", fab: r = "defa
5425
5500
  threadId: e._id
5426
5501
  })
5427
5502
  }, e._id);
5428
- }), b.kind === "composing-new" ? /* @__PURE__ */ $(eo, {
5503
+ }), b.kind === "composing-new" ? /* @__PURE__ */ $(uo, {
5429
5504
  pageX: b.pageX,
5430
5505
  pageY: b.pageY
5431
5506
  }) : null]
5432
5507
  }),
5433
- b.kind === "placing" ? /* @__PURE__ */ $(to, {
5434
- onPlace: pe,
5435
- onCancel: F
5508
+ b.kind === "placing" ? /* @__PURE__ */ $(fo, {
5509
+ onPlace: me,
5510
+ onCancel: fe
5436
5511
  }) : null,
5437
- b.kind === "thread" && Ce ? /* @__PURE__ */ $(io, {
5438
- thread: Ce,
5512
+ b.kind === "thread" && L ? /* @__PURE__ */ $(ho, {
5513
+ thread: L,
5439
5514
  authorName: ie,
5440
5515
  currentClientId: P ?? null,
5441
5516
  isVerified: ae,
5442
5517
  isIdentityResolving: oe,
5443
- isSigningIn: he,
5444
- canDelete: Te,
5518
+ isSigningIn: ge,
5519
+ canDelete: Ce,
5445
5520
  isPending: A,
5446
5521
  error: j,
5447
5522
  isHidden: ee,
5448
- onAuthor: me,
5449
- onSignIn: I,
5450
- onClose: F,
5451
- onReply: ye,
5452
- onEditComment: be,
5523
+ onAuthor: he,
5524
+ onSignIn: _e,
5525
+ onClose: fe,
5526
+ onReply: be,
5527
+ onEditComment: I,
5453
5528
  onDeleteComment: xe,
5454
5529
  onToggleReaction: Se,
5455
- onDelete: _e,
5456
- onResolve: ve
5457
- }, Ce._id) : null,
5458
- b.kind === "composing-new" ? /* @__PURE__ */ $(Za, {
5530
+ onDelete: ye,
5531
+ onResolve: F
5532
+ }, L._id) : null,
5533
+ b.kind === "composing-new" ? /* @__PURE__ */ $(so, {
5459
5534
  pageX: b.pageX,
5460
5535
  pageY: b.pageY,
5461
5536
  authorName: ie,
5462
5537
  isVerified: ae,
5463
5538
  isIdentityResolving: oe,
5464
- isSigningIn: he,
5539
+ isSigningIn: ge,
5465
5540
  isPending: A,
5466
5541
  error: j,
5467
5542
  screenshot: b.screenshot,
5468
5543
  isScreenshotCapturing: b.isScreenshotCapturing,
5469
5544
  screenshotRedactedCount: b.screenshotRedactedCount,
5470
5545
  screenshotRedactedSelectors: b.screenshotRedactedSelectors,
5471
- onAuthor: me,
5472
- onSignIn: I,
5473
- onSubmit: ge,
5474
- onClose: F
5546
+ onAuthor: he,
5547
+ onSignIn: _e,
5548
+ onSubmit: ve,
5549
+ onClose: fe
5475
5550
  }) : null,
5476
- !ee || b.kind === "placing" || b.kind === "composing-new" ? /* @__PURE__ */ $(Wa, {
5551
+ !ee || b.kind === "placing" || b.kind === "composing-new" ? /* @__PURE__ */ $(eo, {
5477
5552
  isActive: b.kind === "placing",
5478
- onToggle: () => b.kind === "placing" ? F() : de(),
5553
+ onToggle: () => b.kind === "placing" ? fe() : de(),
5479
5554
  onHide: () => N({ type: "hide-with-toast" }),
5480
5555
  position: g,
5481
5556
  onPositionChange: _,
5482
5557
  variant: r
5483
5558
  }) : null,
5484
- M.kind === "hidden-with-toast" ? /* @__PURE__ */ $(vo, { position: g }) : null
5559
+ M.kind === "hidden-with-toast" ? /* @__PURE__ */ $(Oo, { position: g }) : null
5485
5560
  ]
5486
5561
  });
5487
5562
  }
5488
- function vo({ position: e }) {
5563
+ function Oo({ position: e }) {
5489
5564
  let t = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "⌘" : "Ctrl";
5490
5565
  return /* @__PURE__ */ $("div", {
5491
5566
  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"),
@@ -5507,41 +5582,50 @@ function vo({ position: e }) {
5507
5582
  }
5508
5583
  //#endregion
5509
5584
  //#region src/runtime/mount.tsx
5510
- function yo(e, t) {
5585
+ function ko(e, t) {
5511
5586
  e.style.position = "fixed", e.style.inset = "0", e.style.zIndex = "2147483647", e.style.pointerEvents = "none";
5512
5587
  let n = t.theme ?? "auto";
5513
5588
  n !== "auto" && (e.dataset.theme = n);
5514
5589
  let r = e.attachShadow({ mode: "open" }), i = document.createElement("style");
5515
5590
  i.textContent = ue, r.appendChild(i);
5516
5591
  let a = document.createElement("div");
5517
- a.className = "markup-shadow-root", r.appendChild(a);
5592
+ a.className = "markup-shadow-root", r.appendChild(a), ye({
5593
+ apiUrl: t.apiUrl,
5594
+ apiKey: t.apiKey,
5595
+ widgetVersion: "1.10.0"
5596
+ });
5518
5597
  let { theme: o, ...s } = t;
5519
- return le(/* @__PURE__ */ $(_o, { ...s }), a), () => le(null, a);
5598
+ return le(/* @__PURE__ */ $(de, {
5599
+ onError: (e) => F(e, { context: "render" }),
5600
+ children: /* @__PURE__ */ $(Do, { ...s })
5601
+ }), a), () => {
5602
+ ye(null), le(null, a);
5603
+ };
5520
5604
  }
5521
5605
  //#endregion
5522
5606
  //#region src/widget.ts
5523
- var bo = null, xo = null, So = null;
5524
- function Co(e) {
5607
+ var Ao = null, jo = null, Mo = null;
5608
+ function No(e) {
5525
5609
  if (!e.apiUrl || !e.apiKey) return console.warn("[markup] init() requires both apiUrl and apiKey — widget not mounted"), () => {};
5526
- wo();
5610
+ Po();
5527
5611
  let t = () => {
5528
- if (So = null, !document.body) return;
5612
+ if (Mo = null, !document.body) return;
5529
5613
  let t = document.createElement("div");
5530
- t.id = "markup-widget", document.body.appendChild(t), xo = t, bo = yo(t, e);
5614
+ t.id = "markup-widget", document.body.appendChild(t), jo = t, Ao = ko(t, e);
5531
5615
  };
5532
5616
  if (document.readyState === "loading" || !document.body) {
5533
5617
  let e = () => t();
5534
- So = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
5618
+ Mo = () => document.removeEventListener("DOMContentLoaded", e), document.addEventListener("DOMContentLoaded", e, { once: !0 });
5535
5619
  } else t();
5536
- return wo;
5620
+ return Po;
5537
5621
  }
5538
- function wo() {
5539
- So &&= (So(), null), bo &&= (bo(), null), xo?.parentNode && xo.parentNode.removeChild(xo), xo = null;
5622
+ function Po() {
5623
+ Mo &&= (Mo(), null), Ao &&= (Ao(), null), jo?.parentNode && jo.parentNode.removeChild(jo), jo = null;
5540
5624
  }
5541
5625
  if (typeof document < "u") {
5542
5626
  let e = document.currentScript ?? document.querySelector("script[data-markup-widget=\"true\"]"), t = e?.dataset.apiUrl, n = e?.dataset.apiKey;
5543
5627
  if (t && n) {
5544
- let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = () => Co({
5628
+ let r = e?.dataset.position, i = e?.dataset.theme, a = e?.dataset.fab, o = () => No({
5545
5629
  apiUrl: t,
5546
5630
  apiKey: n,
5547
5631
  position: r,
@@ -5552,6 +5636,6 @@ if (typeof document < "u") {
5552
5636
  }
5553
5637
  }
5554
5638
  //#endregion
5555
- export { wo as destroy, Co as init };
5639
+ export { Po as destroy, No as init };
5556
5640
 
5557
5641
  //# sourceMappingURL=widget.js.map