@snagset/server 0.1.15 → 0.1.18
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/LICENSE +661 -0
- package/README.md +9 -10
- package/dist/app.js +52 -48
- package/dist/app.js.map +1 -1
- package/dist/bin.js +31 -32
- package/dist/bin.js.map +1 -1
- package/dist/boot.js +21 -21
- package/dist/boot.js.map +1 -1
- package/dist/config.generated.js +6 -8
- package/dist/config.generated.js.map +1 -1
- package/dist/config.js +14 -14
- package/dist/config.js.map +1 -1
- package/dist/crypto.js +1 -1
- package/dist/crypto.js.map +1 -1
- package/dist/db/connect.js +1 -1
- package/dist/db/migrate.js +11 -11
- package/dist/db/rls.js +3 -3
- package/dist/db/rls.js.map +1 -1
- package/dist/domain.js +73 -5
- package/dist/domain.js.map +1 -1
- package/dist/explain.js +1 -1
- package/dist/instance/address.js +3 -3
- package/dist/instance/address.js.map +1 -1
- package/dist/instance/settings.js +1 -1
- package/dist/integrations/github.js +3 -3
- package/dist/integrations/github.js.map +1 -1
- package/dist/integrations/inbound.js +3 -3
- package/dist/integrations/inbound.js.map +1 -1
- package/dist/integrations/linear.js +1 -1
- package/dist/integrations/linear.js.map +1 -1
- package/dist/integrations/outbox.js +4 -4
- package/dist/integrations/outbox.js.map +1 -1
- package/dist/integrations/slack.js +2 -2
- package/dist/integrations/slack.js.map +1 -1
- package/dist/jobs/index.js +3 -3
- package/dist/jobs/reaper.js +11 -11
- package/dist/jobs/reaper.js.map +1 -1
- package/dist/jobs/set.js +3 -3
- package/dist/jobs/set.js.map +1 -1
- package/dist/jobs/soon.js +3 -3
- package/dist/keys.js +3 -3
- package/dist/keys.js.map +1 -1
- package/dist/listen.js +3 -3
- package/dist/listen.js.map +1 -1
- package/dist/mail/assigned.js +328 -0
- package/dist/mail/assigned.js.map +1 -0
- package/dist/mail/digest.js +3 -3
- package/dist/mail/digest.js.map +1 -1
- package/dist/mail/index.js +2 -2
- package/dist/mail/links.js +5 -5
- package/dist/mail/mailer.js +2 -2
- package/dist/mail/notify.js +85 -20
- package/dist/mail/notify.js.map +1 -1
- package/dist/mail/resend.js +1 -1
- package/dist/mail/resolve.js +1 -1
- package/dist/mail/resolve.js.map +1 -1
- package/dist/mail/smtp.js +1 -1
- package/dist/mail/unsubscribe.js +1 -1
- package/dist/net/publicFetch.js +1 -1
- package/dist/orgs.js +5 -5
- package/dist/orgs.js.map +1 -1
- package/dist/plan.js +1 -1
- package/dist/projects.js +4 -4
- package/dist/projects.js.map +1 -1
- package/dist/routes/account.js +1 -1
- package/dist/routes/account.js.map +1 -1
- package/dist/routes/activity.js +1 -1
- package/dist/routes/anchorReports.js +9 -9
- package/dist/routes/anchorReports.js.map +1 -1
- package/dist/routes/assignees.js +4 -4
- package/dist/routes/assignees.js.map +1 -1
- package/dist/routes/attachments.js +6 -6
- package/dist/routes/attachments.js.map +1 -1
- package/dist/routes/auth.js +4 -4
- package/dist/routes/bodyLimit.js +5 -5
- package/dist/routes/bodyLimit.js.map +1 -1
- package/dist/routes/commentEdit.js +5 -5
- package/dist/routes/commentEdit.js.map +1 -1
- package/dist/routes/comments.js +24 -24
- package/dist/routes/comments.js.map +1 -1
- package/dist/routes/cors.js +33 -15
- package/dist/routes/cors.js.map +1 -1
- package/dist/routes/instance.js +3 -3
- package/dist/routes/instance.js.map +1 -1
- package/dist/routes/integrations.js +14 -11
- package/dist/routes/integrations.js.map +1 -1
- package/dist/routes/invites.js +7 -7
- package/dist/routes/invites.js.map +1 -1
- package/dist/routes/mcpAuth.js +13 -13
- package/dist/routes/mcpAuth.js.map +1 -1
- package/dist/routes/mcpToken.js +4 -4
- package/dist/routes/mcpToken.js.map +1 -1
- package/dist/routes/mcpTokens.js +27 -14
- package/dist/routes/mcpTokens.js.map +1 -1
- package/dist/routes/members.js +9 -5
- package/dist/routes/members.js.map +1 -1
- package/dist/routes/owner.js +13 -13
- package/dist/routes/owner.js.map +1 -1
- package/dist/routes/reviewLinks.js +4 -4
- package/dist/routes/reviewLinks.js.map +1 -1
- package/dist/routes/rounds.js +3 -3
- package/dist/routes/rounds.js.map +1 -1
- package/dist/routes/sessions.js +186 -71
- package/dist/routes/sessions.js.map +1 -1
- package/dist/routes/sites.js +9 -9
- package/dist/routes/sites.js.map +1 -1
- package/dist/routes/threads.js +144 -90
- package/dist/routes/threads.js.map +1 -1
- package/dist/routes/widget.js +5 -5
- package/dist/routes/widget.js.map +1 -1
- package/dist/serverless.js +4 -4
- package/dist/serverless.js.map +1 -1
- package/dist/session.js +8 -8
- package/dist/session.js.map +1 -1
- package/dist/storage/bucket.js +4 -4
- package/dist/storage/bucket.js.map +1 -1
- package/dist/storage/settings.js +4 -4
- package/dist/storage/settings.js.map +1 -1
- package/dist/studioReviewers.js +4 -4
- package/dist/vendor/adapters/outbound/fence.js +2 -2
- package/dist/vendor/adapters/outbound/sanitise.js +14 -14
- package/dist/vendor/mcp/bin.js +4 -4
- package/dist/vendor/mcp/client.js +3 -3
- package/dist/vendor/mcp/server.js +3 -3
- package/dist/vendor/mcp/source.js +13 -13
- package/dist/vendor/mcp/view.js +15 -15
- package/dist/vendor/types/brief.js +2 -2
- package/dist/vendor/types/index.js +1 -1
- package/dist/vendor/types/names.js +20 -18
- package/dist/vendor/widget/object.js +3 -3
- package/dist/vendor/widget/predicates.js +38 -39
- package/package.json +1 -5
- package/static/dashboard/assets/{CompositeItem-DcTtfhMj.js → CompositeItem-D1SCvKo_.js} +1 -1
- package/static/dashboard/assets/{ConfirmDialog-C7IpllNH.js → ConfirmDialog-DdUOWt96.js} +1 -1
- package/static/dashboard/assets/{CopyButton-C0gZH7mu.js → CopyButton-DX7vax3M.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-D0qd3DQv.js → FieldItemContext-CMpCHNX8.js} +1 -1
- package/static/dashboard/assets/{InstallTag-DTw-EtuD.js → InstallTag-DkYPsEI0.js} +1 -1
- package/static/dashboard/assets/{SaveState-Bk30DUJ3.js → SaveState-D0Hl8cny.js} +1 -1
- package/static/dashboard/assets/{_app-CAmVh6lR.js → _app-CcUZ9WT2.js} +1 -1
- package/static/dashboard/assets/{_app-gSqPuozu.js → _app-CnG-wKIX.js} +1 -1
- package/static/dashboard/assets/{activity-zmYVgnQm.js → activity-DnvsedIb.js} +1 -1
- package/static/dashboard/assets/{arrow-left-CqsX1hoI.js → arrow-left-4jbTF1bA.js} +1 -1
- package/static/dashboard/assets/{avatar-08tu7BM9.js → avatar-BKSc7tnv.js} +1 -1
- package/static/dashboard/assets/{badge-CgsMqJa4.js → badge-aWVtPffe.js} +1 -1
- package/static/dashboard/assets/{card-CPsX9FTO.js → card-Bz0VdsxC.js} +1 -1
- package/static/dashboard/assets/{check-CJRIq1X0.js → check-Ti2IOlgc.js} +1 -1
- package/static/dashboard/assets/{chevron-right-BEmxTSY1.js → chevron-right-g-zbIopD.js} +1 -1
- package/static/dashboard/assets/{copy-xpnXaoOA.js → copy-BwBuD0FO.js} +1 -1
- package/static/dashboard/assets/{dialog-CxlCupuA.js → dialog-DdpHZobU.js} +2 -2
- package/static/dashboard/assets/{dropdown-menu-CGMdCM3V.js → dropdown-menu-CB2L3nig.js} +1 -1
- package/static/dashboard/assets/{image-off-XJf-5RS9.js → image-off-w_ej9pIJ.js} +1 -1
- package/static/dashboard/assets/index-DAgnfv_E.css +1 -0
- package/static/dashboard/assets/{index-CR63M02l.js → index-DtF8YHqn.js} +3 -3
- package/static/dashboard/assets/{invite-CcYboRQr.js → invite-Dy3iQjzf.js} +1 -1
- package/static/dashboard/assets/{label-Ds2N_0qv.js → label-Dj8L94iS.js} +1 -1
- package/static/dashboard/assets/{layout-grid-Dw9tiVXr.js → layout-grid-DuweH0Vl.js} +1 -1
- package/static/dashboard/assets/me-7-r9OeMR.js +1 -0
- package/static/dashboard/assets/{parts-BYKOSeUb.js → parts-CA4cbfy3.js} +1 -1
- package/static/dashboard/assets/{plus-DvfThULG.js → plus-CEWgXDLj.js} +1 -1
- package/static/dashboard/assets/s._site-D69M50OI.js +1 -0
- package/static/dashboard/assets/{s._site.comments-DTMz620W.js → s._site.comments-DNJ2SE5c.js} +1 -1
- package/static/dashboard/assets/{s._site.reviewers-CDhFQ_du.js → s._site.reviewers-B07NzSWj.js} +1 -1
- package/static/dashboard/assets/{s._site.settings-BWE3eC3w.js → s._site.settings-B577G5iG.js} +1 -1
- package/static/dashboard/assets/{setup-BP-kGzjw.js → setup-DcjjtB3g.js} +1 -1
- package/static/dashboard/assets/{sign-in-Brn6kGrC.js → sign-in-gfvOs6Jw.js} +1 -1
- package/static/dashboard/assets/{sign-up-DxeJ0RND.js → sign-up-CFJt7ibH.js} +1 -1
- package/static/dashboard/assets/{sites-BSP6CMHL.js → sites-DbB5cjz5.js} +1 -1
- package/static/dashboard/assets/studio-BO-MHFqc.js +1 -0
- package/static/dashboard/assets/{studio-BqA_XZwz.js → studio-D9GxJaSF.js} +1 -1
- package/static/dashboard/assets/{studio.index-CjkyAcKF.js → studio.index-DktAxIPT.js} +1 -1
- package/static/dashboard/assets/studio.integrations-CbLyqPLX.js +1 -0
- package/static/dashboard/assets/{studio.members-CECLI69a.js → studio.members-DFtIL3JS.js} +1 -1
- package/static/dashboard/assets/{sun-B5BhapBo.js → sun-Bg7U-6Y0.js} +1 -1
- package/static/dashboard/assets/{switch-C4RnvllL.js → switch-CTN6hIca.js} +1 -1
- package/static/dashboard/assets/{table-DOCWCO9W.js → table-zQ3pj50_.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-C6VUMzW5.js → useAriaLabelledBy-BsNncGbx.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-ldF9uyzz.js → useBaseQuery-DSqwWD_O.js} +1 -1
- package/static/dashboard/assets/useQuery-OgrKuHbc.js +1 -0
- package/static/dashboard/assets/useRender-DOFVvGfR.js +1 -0
- package/static/dashboard/assets/{useValueChanged-BVjcYor6.js → useValueChanged-B9k7l-mp.js} +1 -1
- package/static/dashboard/assets/{users-Ji1BLjAt.js → users-CRiOyD0f.js} +1 -1
- package/static/dashboard/assets/{welcome-DzAUdMme.js → welcome-DT2DB4jN.js} +1 -1
- package/static/dashboard/assets/{widget-signin-CKUvfq3K.js → widget-signin-CC9owVvs.js} +1 -1
- package/static/dashboard/assets/{you-2QsQK86v.js → you-CtcXklc_.js} +1 -1
- package/static/dashboard/assets/{zod-D-eI47yt.js → zod-CLxHj89d.js} +1 -1
- package/static/dashboard/index.html +2 -2
- package/static/widget/snag.capture.js +1 -1
- package/static/widget/snag.dock.js +5 -5
- package/static/widget/snag.runtime.js +2 -2
- package/static/widget/snag.screenshot.js +1 -1
- package/static/dashboard/assets/index-Ddi7bl87.css +0 -1
- package/static/dashboard/assets/me-BbIUR0d4.js +0 -1
- package/static/dashboard/assets/s._site-D7IqF1qB.js +0 -1
- package/static/dashboard/assets/studio-BW7OdRP1.js +0 -1
- package/static/dashboard/assets/studio.integrations-NDAXAPKG.js +0 -1
- package/static/dashboard/assets/useQuery-VzaemGSO.js +0 -1
- package/static/dashboard/assets/useRender-CRLtPZ-q.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const
|
|
2
|
-
`),Fo=` :host{all:initial}[hidden]{display:none!important}:host{display:block;font:400 14px/1.45 ${k.font};color:${k.fg};${P.font}:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;${P.accent}:#2a51b8;${P.bg}:#fefdfc;${P.fg}:#181716;${P.muted}:#666564;${P.border}:#e4e3e0;${P.radius}:8px;${P.shadow}:0 6px 24px -4px rgb(0 0 0 / .18);${P.z}:2147483647;${P.motion}:160ms;${P.surface}:color-mix(in srgb,${k.fg} 6%,${k.bg});${P.sunken}:color-mix(in srgb,${k.fg} 3%,${k.bg});${P.hover}:color-mix(in srgb,${k.fg} 8%,${k.bg});${P.onAccent}:#fff;${P.focus}:color-mix(in srgb,${k.accent} 62%,${k.fg});${P.disabled}:color-mix(in srgb,${k.muted} 52%,${k.bg});${Wo} ${P.anchorOrphan}:#DC2626;}:host([${mn}="dark"]){${P.accent}:#8aafff;${P.onAccent}:#1d1c1a;${P.bg}:#1d1c1a;${P.fg}:#f0eeec;${P.muted}:#9a9997;${P.border}:#2d2c2b;${P.shadow}:0 6px 24px -4px rgb(0 0 0 / .6);}@media (prefers-reduced-motion:reduce){:host{${P.motion}:0ms}}@media (forced-colors:active){:host{${P.bg}:Canvas;${P.fg}:CanvasText;${P.muted}:CanvasText;${P.border}:CanvasText;${P.accent}:Highlight;${P.onAccent}:HighlightText;${P.surface}:Canvas;${P.sunken}:Canvas;${P.hover}:Canvas;${P.focus}:Highlight;${P.disabled}:GrayText;${P.shadow}:none;${P.anchorOrphan}:CanvasText;}.snag-pin{border-color:CanvasText!important;color:CanvasText!important;forced-color-adjust:none}}`,Ve={shield:1,pins:3,dock:5,notice:6,toolbar:7},Tn=new WeakMap;function nt(e,t,n){let o=Tn.get(e);if(o||Tn.set(e,o=new Set),o.has(t))return;o.add(t);try{const u=new CSSStyleSheet;u.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,u];return}catch{}const c=(e.ownerDocument??document).createElement("style");c.setAttribute(`data-snag-${t}`,""),c.textContent=n,e.appendChild(c)}function Bo(e){return e==="light"||e==="dark"?e:"auto"}function jo(e,t){const n=mn;if(t!=="auto")return e.setAttribute(n,t),()=>e.removeAttribute(n);const o=e.ownerDocument?.defaultView?.matchMedia?.("(prefers-color-scheme: dark)");if(!o)return e.setAttribute(n,"light"),()=>e.removeAttribute(n);const r=()=>e.setAttribute(n,o.matches?"dark":"light");return r(),o.addEventListener("change",r),()=>{o.removeEventListener("change",r),e.removeAttribute(n)}}function Nt(e){return e.getBoundingClientRect()}function wt(e){if(e.closest('[inert],[aria-hidden="true"]'))return!1;const t=e.checkVisibility;if(typeof t=="function")return t.call(e,{contentVisibilityAuto:!0,opacityProperty:!1,visibilityProperty:!0});const n=Nt(e);if(!(n.width>0||n.height>0||e.getClientRects().length>0))return!1;const r=e.ownerDocument?.defaultView;return r?r.getComputedStyle(e).visibility!=="hidden":!0}const Uo="button,a[href],[role=button],[role=link],[role=tab],[role=menuitem],label,input,select,textarea,summary",Zo=3,Rn=8,Vo=new Set(["img","picture","canvas","video","audio","iframe","embed","object","svg","math","input","select","textarea","button","progress","meter"]);function Yo(e,t){return Vo.has(e.tagName.toLowerCase())?!1:t.getComputedStyle(e).display==="inline"}function _n(e){const t=e.ownerDocument?.defaultView;if(!t)return e;let n=e;for(let r=e;r;r=r.parentElement){const c=Nt(r);if(c.width>=Rn&&c.height>=Rn&&!Yo(r,t)){n=r;break}n=r}let o=0;for(let r=n;r&&o<=Zo;r=r.parentElement){if(r.matches(Uo))return r;o++}return n}const Xo=10,Ht=[["click",!1],["auxclick",!1],["dblclick",!1],["pointerdown",!1],["pointerup",!1],["mousedown",!1],["mouseup",!1],["contextmenu",!1],["dragstart",!1],["wheel",!1],["touchstart",!0],["touchmove",!0],["touchend",!0],["selectstart",!0],["keydown",!1],["keyup",!1]];function Ko(e,t,n){let o=e;for(;o&&o!==o.ownerDocument.documentElement&&o!==o.ownerDocument.body;){const r=getComputedStyle(o),c=(r.overflowY==="auto"||r.overflowY==="scroll")&&o.scrollHeight>o.clientHeight&&(t>0&&o.scrollTop+o.clientHeight<o.scrollHeight-1||t<0&&o.scrollTop>0),u=(r.overflowX==="auto"||r.overflowX==="scroll")&&o.scrollWidth>o.clientWidth&&(n>0&&o.scrollLeft+o.clientWidth<o.scrollWidth-1||n<0&&o.scrollLeft>0);if(c||u)return o;o=o.parentElement}return null}function In(e,t){const n=t==="y"?e.deltaY:e.deltaX;return e.deltaMode===1?n*16:e.deltaMode===2?n*(t==="y"?innerHeight:innerWidth):n}const Jo=["position:fixed","inset:0",`z-index:${Ve.shield}`,"touch-action:pan-x pan-y pinch-zoom","background:transparent"].join(";");function qo(e,t={}){const n=t.doc??e.ownerDocument??document,o=n.defaultView??window;let r=t.coarsePointer??o.matchMedia?.("(pointer: coarse)").matches??!1;const c=l=>{const _=l.pointerType,S=_==="touch"?!0:_==="mouse"||_==="pen"?!1:r;S!==r&&(r=S,d())},u=n.createElement("div");u.className="snag-shield",u.style.cssText=Jo;let s="browse";const d=()=>{u.style.pointerEvents=r?"none":"auto",u.style.cursor="crosshair"};d();const y=l=>{const _=l;return!_||typeof _.closest!="function"?!1:e.contains(_)?!0:!!_.closest(`[${Mt("root")}]`)};function w(l,_,S){let I=S,M=0;for(;I.shadowRoot&&M++<Xo;){const N=C(I.shadowRoot,l,_);if(!N||N===I)break;I=N}return I}function C(l,_,S){const I=l.elementsFromPoint;if(typeof I=="function"){for(const N of I.call(l,_,S))if(N.getRootNode()===l)return N;return null}const M=l.elementFromPoint(_,S);return M&&M.getRootNode()===l?M:null}function m(l,_){const S=[];for(const I of n.elementsFromPoint(l,_)){if(y(I))continue;if(I===n.documentElement||I===n.body){S.push(I);continue}const M=w(l,_,I);S.push(y(M)?I:M)}return S}let f=null;const g=(l,_)=>{const[S]=m(l,_);S&&t.onPick?.(_n(S),{x:l,y:_})};let p=!1;const E=()=>{const l=n.getSelection?.();if(!l||l.isCollapsed||l.rangeCount===0||!l.toString().trim())return!1;const _=l.anchorNode;if(!_||e.contains(_))return!1;const S=_.nodeType===1?_:_.parentElement;return!y(S)},D=l=>{const _=l.composedPath()[0];if(_&&y(_)){p=!1;return}if(l.type==="selectstart"){t.onSelectStart?.();return}const S=l.type;if(S.endsWith("down")||S.endsWith("start")){p=!1;return}if(S.endsWith("up")||S.endsWith("end")){p=E();return}if(S==="click"||S==="auxclick"){if(!p)return;p=!1,l.preventDefault(),l.stopImmediatePropagation()}},O=l=>{if(l.type==="pointerdown"&&c(l),s==="comments"){D(l);return}if(s!=="add")return;if(l.type==="keydown"||l.type==="keyup"){Ee(l);return}const _=l.composedPath()[0];if(_&&_!==u&&y(_))return;const S=Ht.find(([I])=>I===l.type)?.[1]??!1;if(l.stopImmediatePropagation(),!S){if(r&&l.type==="pointerdown"){const I=l;f={x:I.clientX,y:I.clientY,t:performance.now()},pe(I.clientX,I.clientY)}if(r&&l.type==="pointerup"&&f){const I=l,M=f;f=null,Math.hypot(I.clientX-M.x,I.clientY-M.y)<=8&&performance.now()-M.t<=700&&g(I.clientX,I.clientY);return}if(l.type==="click"||l.type==="auxclick"||l.type==="dblclick"){l.preventDefault();const I=l;g(I.clientX,I.clientY);return}if(l.type==="wheel"){const I=l,M=In(I,"y"),N=In(I,"x"),[U]=m(I.clientX,I.clientY),G=Ko(U??null,M,N);G&&(G.scrollTop+=M,G.scrollLeft+=N,l.preventDefault());return}if(l.type==="dragstart"||l.type==="contextmenu"){l.preventDefault();return}(l.type==="pointerdown"||l.type==="mousedown")&&!r&&l.preventDefault()}},V=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," ","Spacebar","PageUp","PageDown","Home","End"]),re=/^[a-z0-9/?]$/;function Y(l){for(const _ of l.composedPath()){const S=_;if(!(!S||S.nodeType!==1||typeof S.matches!="function")&&S.matches('input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),textarea,select,[contenteditable=""],[contenteditable=true],[role=textbox],[role=searchbox],[role=combobox]'))return!0}return!1}function Ee(l){V.has(l.key)||l.metaKey||l.ctrlKey||l.altKey||/^F\d{1,2}$/.test(l.key)||l.key!=="Escape"&&l.key.length===1&&re.test(l.key.toLowerCase())&&!Y(l)&&(l.preventDefault(),l.stopImmediatePropagation())}for(const[l,_]of Ht)o.addEventListener(l,O,{capture:!0,passive:_});let ee=0,te=null;function Pe(){if(ee=0,s!=="add"||!te)return;const[l]=m(te.x,te.y);t.onHover?.(l?_n(l):null)}function pe(l,_){s==="add"&&(te={x:l,y:_},!ee&&(ee=o.requestAnimationFrame(Pe)))}return u.addEventListener("pointermove",l=>pe(l.clientX,l.clientY)),u.addEventListener("pointerleave",()=>{te=null,t.onHover?.(null)}),{shield:u,getMode:()=>s,setMode(l){s=l,p=!1,d(),l==="add"?e.appendChild(u):u.remove(),l!=="add"&&(te=null,t.onHover?.(null))},hitTest:m,destroy(){ee&&o.cancelAnimationFrame(ee);for(const[l]of Ht)o.removeEventListener(l,O,{capture:!0});u.remove()}}}const Qo=/[\u200B-\u200D\u2060\uFEFF]/gu,Go=/[\s\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+/gu,er=[[/[\u2018\u2019\u201A\u201B]/gu,"'"],[/[\u201C\u201D\u201E\u201F]/gu,'"'],[/[\u2010-\u2015\u2212]/gu,"-"],[/\u2026/gu,"..."],[/\u2044/gu,"/"]];function tr(e){let t=e.normalize("NFC").replace(Qo,"");for(const[n,o]of er)t=t.replace(n,o);return t.replace(Go," ").trim()}const nr={testid:1,domid:1,css:.9,aria:.75,"text-exact":.8,"text-fuzzy":.78,"path-rect":.35,none:0,manual:1},Pn={anchored:.75,approximate:.35};function or(e,t){const n=nr[e];return t===1?n:n/(1+Math.log2(t))}function Mn(e){return e>=Pn.anchored?"anchored":e>=Pn.approximate?"approximate":"orphaned"}const rr=[Ro("anchor"),"data-testid","data-test-id","data-test","data-cy","data-qa","data-pw","data-automation-id"],zn=e=>typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&"),ar=[{strategy:"testid",applicable:e=>!!e.testid,find:(e,t)=>Wt(t,rr.map(n=>`[${n}="${zn(e.testid)}"]`).join(","))},{strategy:"domid",applicable:e=>!!e.domid,find:(e,t)=>Wt(t,`#${zn(e.domid)}`)},{strategy:"css",applicable:e=>!!e.css,find:(e,t)=>{try{return Wt(t,e.css)}catch{return[]}}}];function Wt(e,t){return[...e.querySelectorAll(t)].filter(sr)}function sr(e){return!e.closest(`[${Mt("root")}]`)}function ir(e,t){const n=t.text?.exact;if(!n)return!0;const o=tr(e.textContent??"");return o?o===n||o.includes(n)||n.includes(o):!0}function On(e,t,n,o){wt(e)||o.push("hidden"),t.hostPath?.length&&o.push("shadow-boundary");const r=!ir(e,t);r&&o.push("text-drift");let c=o.includes("hidden")?Math.min(n,.7):n;return r&&(c=Math.min(c,.5)),c}const cr={element:null,strategy:"none",score:0,state:"orphaned",reasons:["not-found"],candidates:0};function Ft(e,t=document,n={}){const o=[];for(const r of ar){if(!r.applicable(e))continue;const c=r.find(e,t);if(c.length===0)continue;const u=or(r.strategy,c.length),s=c[0];c.length>1&&o.push("ambiguous");const d=On(s,e,u,o),y={element:s,strategy:r.strategy,score:d,state:Mn(d),reasons:o.length?o:["exact"],candidates:c.length};if(y.reasons.includes("text-drift")&&n.extended){const w=n.extended(e,t,{...n.viewportWidth===void 0?{}:{viewportWidth:n.viewportWidth},...n.passCaches?{caches:n.passCaches}:{}});if(w&&w.score>y.score)return w}return y}return n.extended?.(e,t,{...n.viewportWidth===void 0?{}:{viewportWidth:n.viewportWidth},...n.passCaches?{caches:n.passCaches}:{}})??cr}const lr={"toolbar.aria":"{product} review toolbar","toolbar.group":"What you see","toolbar.browse":"Browse","toolbar.comments":"Comment","toolbar.comments.unresolved":"Comment, {n} unresolved","toolbar.add":"Add a comment","toolbar.add.draft":"Add a comment \u2014 one is unfinished","toolbar.panel":"All comments","pin.aria":"Comment {key} on {target}. {status}, {replies} replies. Press Enter.","pin.aria.one":"Comment {key} on {target}. {status}, 1 reply. Press Enter.","pin.aria.none":"Comment {key} on {target}. {status}. Press Enter.","pin.aria.moved":"Comment {key} on {target}. {status}. {where}. Press Enter.","pin.target":"{role} \u201C{name}\u201D","cluster.aria":"{n} comments here: {list}","nav.announce":"Comment {n} on {label}, {i} of {total}","action.retry":"Retry","action.dismiss":"Dismiss","action.export":"Export","action.exportclear":"Export & clear","error.quota":"Storage is full \u2014 this {item} is on screen but not saved. Export to keep them.","error.nostorage":"Comments won't be saved in this browser. Export before you leave to keep them.","error.linkrevoked":"This review link was turned off. Ask whoever sent it for a new one.","error.sessionended":"This review session has ended. Open your review link again to carry on.","error.sendfailed":"That {item} couldn't be sent, so it wasn't kept. Check your connection and try again.","error.origin":"{product} is not enabled for {origin}. Add that address to the site's allowed origins.","error.panels":"{product} loaded, but its comment UI didn't. You can still see the comments on the page.","error.panels.add":"Adding comments is unavailable until the comment UI loads.","error.capture":"{product} can't take new comments \u2014 the part that records the page didn't load. Everything already here still works.","paused.dialog":"Review paused \u2014 a dialog is open on this page. Close it to carry on commenting. Commenting inside a native dialog isn't supported yet.","paused.close":"Close","announce.created":"Comment {key} added.","permalink.unknown":"That comment isn't on this page any more"},dr={...Sn,...lr},B=xn(dr);function ur(e,t){const n=new Array(e.length),o=[],r=new Map,c=[];let u=0;for(let s=0;s<e.length;s++){u++;const d=e[s],y=Math.floor(d.x/t),w=Math.floor(d.y/t);let C=-1;e:for(let m=-1;m<=1;m++)for(let f=-1;f<=1;f++)for(const g of r.get(`${y+m},${w+f}`)??[]){const p=c[g],E=d.x-p.x,D=d.y-p.y;if(E*E+D*D<=t*t){C=g;break e}}if(C===-1){C=o.length,o.push([]),c.push(d);const m=`${y},${w}`,f=r.get(m);f?f.push(C):r.set(m,[C])}n[s]=C,o[C].push(s)}return{group:n,members:o,visits:u}}const fr=`position:absolute;top:0;left:0;width:0;height:0;pointer-events:none;z-index:${Ve.pins}`,hr=' .snag-pp{animation:snag-pp .5s ease-out 2}@keyframes snag-pp{50%{transform:scale(1.45)}}@media (prefers-reduced-motion: reduce){.snag-pp{animation:none}}.snag-pin{width:28px;height:28px;margin:-14px 0 0 -14px}.snag-pin::after{content:"";position:absolute;inset:-8px}@media (pointer:coarse){.snag-pin{width:34px;height:34px;margin:-17px 0 0 -17px}}',pr=`position:fixed;inset:0;width:0;height:0;pointer-events:none;z-index:${Ve.pins}`,ot=["position:absolute",`color:${k.onAccent}`,`font:600 12px/1 ${k.font}`,"display:flex","align-items:center","justify-content:center","box-shadow:0 1px 4px rgb(0 0 0 / .35)","pointer-events:auto","cursor:pointer","box-sizing:border-box"].join(";"),xt="border-radius:50% 50% 50% 2px",Ln=e=>k[`status${e[0].toUpperCase()}${e.slice(1)}`]??k.muted;function Dn(e,t){const n=$n(t.status),o=`background:${Ln(t.status)};color:${n}`,r="0 1px 4px rgb(0 0 0 / .35)";return e==="anchored"?`${ot};${xt};${o};border:2px solid ${n};box-shadow:${r}`:e==="approximate"?`${ot};${xt};${o};border:2px dashed ${n};box-shadow:${r}`:`${ot};${xt};${o};border:2px solid ${n};box-shadow:inset 0 0 0 2px ${n},${r}`}function mr(e,t){const n=[];let o="static",r=!1;for(let c=e;c&&c!==e.ownerDocument.documentElement;c=c.parentElement){const u=t.getComputedStyle(c),s=c!==e.ownerDocument.body&&/auto|scroll|hidden|overlay/.test(u.overflowY+u.overflowX);s&&!r&&n.push(c),u.position==="fixed"?(o="dynamic",r=!0):u.transform!=="none"||u.filter!=="none"||u.perspective!=="none"?(o="dynamic",r=!1):(u.position==="sticky"||u.willChange.includes("transform")||u.contain.includes("layout")||s&&(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth))&&(o="dynamic")}return{tier:o,clips:n}}function gr(e,t,n,o){const r=e.ownerDocument??document,c=r.defaultView??window;nt(e,"pins",hr);const u=r.createElement("div");u.className="snag-pins",u.style.cssText=fr,e.appendChild(u);const s=r.createElement("div");s.className="snag-pins-dyn",s.style.cssText=pr,e.appendChild(s);let d=[],y=[];const w=new Map;let C=new Map,m=null;const f=new Map;let g=new Map;const p=c.matchMedia?.("(pointer: coarse)").matches??!1,E=p?32:24,D=p?34:28;let O=[],V=null,re=null,Y={x:0,y:0};function Ee(){const A=r.defaultView,$=u.getBoundingClientRect();Y={x:$.left+(A?.scrollX??0),y:$.top+(A?.scrollY??0)}}let ee=[];const te=new Map,Pe=1e4,pe=5,l=new Map,_=new Set(["testid","domid"]);function S(A){const $=l.get(A.id),b=$?.ref.deref();if(!b||!b.isConnected)return null;if(_.has($.strategy))return b;if(A.anchor.css)try{if(!b.matches(A.anchor.css))return null}catch{return null}return b}function I(A,$){const b=[],H=On($,A.anchor,1,b);return{element:$,strategy:l.get(A.id).strategy,score:H,state:Mn(H),reasons:b.length?b:["exact"],candidates:1}}function M(A,$="authoritative"){w.clear(),ee=[];const b=Date.now(),H=n?.newPass?.();return A.map(v=>{const z=S(v),T=n?.get();let x=z?I(v,z):Ft(v.anchor,r,{viewportWidth:r.defaultView?.innerWidth??0,...T?{extended:T}:{},...H?{passCaches:H}:{}});if(z&&x.reasons.includes("text-drift")){const W=Ft(v.anchor,r,{viewportWidth:r.defaultView?.innerWidth??0,...T?{extended:T}:{},...H?{passCaches:H}:{}});W.score>x.score&&(x=W)}if(n&&(!x.element||x.reasons.includes("text-drift"))&&n.want(v.anchor),!x.element&&n){const W=n.fuzzyHit?.(v.id);W?x=W:n.wantFuzzy?.(v.id,v.anchor)}const ne=x.element&&v.anchor.text?.exact&&(x.reasons.includes("text-drift")||x.strategy==="path-rect"&&x.score<.5);if(n&&ne){const W=n.fuzzyHit?.(v.id);W&&W.score>x.score?x=W:W||n.wantFuzzy?.(v.id,v.anchor)}x.element?l.set(v.id,{ref:new WeakRef(x.element),strategy:x.strategy}):l.delete(v.id),x.element&&w.set(v.id,x.element);let X=!1;if(x.state==="orphaned"){const W=te.get(v.id)??{firstSeenAt:b,tries:0,best:x};W.tries++,x.score>=W.best.score&&(W.best=x),te.set(v.id,W);const K=n?.unavailable?.()??!1,J=K?2:pe,ce=b-W.firstSeenAt<Pe;$==="optimistic"||ce&&($==="navigating"||W.tries<J)?X=!0:(x=W.best,K&&!x.reasons.includes("budget-exceeded")&&(x={...x,reasons:[...x.reasons,"budget-exceeded"]}),te.delete(v.id))}else te.delete(v.id);X||ee.push({id:v.id,state:x.state,strategy:x.strategy,confidence:x.score});const L=x.element?Nt(x.element):void 0;if(L&&(L.width>0||L.height>0)){const W=r.defaultView;v.anchor.rect={x:L.left+(W?.scrollX??0),y:L.top+(W?.scrollY??0),w:L.width,h:L.height}}return{...v,anchorState:X?v.anchorState:x.state,anchorPending:X,anchorReasons:x.reasons}})}function N(){const A=r.documentElement;return{w:A.scrollWidth,h:A.scrollHeight}}function U(A,$,b){return{x:Math.min(Math.max(A,14),Math.max(b.w,28)-14),y:Math.min(Math.max($,14),Math.max(b.h,28)-14)}}function G(A,$){Ee(),u.textContent="",s.textContent="",d=[],y=[],C=new Map,g=new Map,f.clear(),O=[],re=null,A.forEach((b,H)=>{const v=b.anchor.rect;if(!v)return;const z=b.anchor.offset??{fx:.5,fy:.5},T=r.createElement("div");T.className="snag-pin",T.setAttribute("data-state",b.anchorPending?"pending":b.anchorState),T.setAttribute("data-key",b.key),T.style.cssText=b.anchorPending?`${Dn("approximate",b)};opacity:.55`:Dn(b.anchorState,b);const x=w.get(b.id),{tier:ne,clips:X}=x?mr(x,c):{tier:"static",clips:[]};if(ne==="dynamic"&&x){const q=x.getBoundingClientRect(),me=Fe();T.style.left=`${q.left-me.left+q.width*z.fx}px`,T.style.top=`${q.top-me.top+q.height*z.fy}px`,f.set(T,{x:q.left+q.width*z.fx+c.scrollX-Y.x,y:q.top+q.height*z.fy+c.scrollY-Y.y});const Oe={node:T,el:x,fx:z.fx,fy:z.fy,clips:X};d.push(Oe),T.hidden=!wt(x),T.hidden||Be(Oe,q,new Map(X.map(lt=>[lt,lt.getBoundingClientRect()])))}else{const q=U(v.x+v.w*z.fx-Y.x,v.y+v.h*z.fy-Y.y,N());T.style.left=`${q.x}px`,T.style.top=`${q.y}px`,f.set(T,q),x&&(y.push({node:T,el:x,fx:z.fx,fy:z.fy,clips:[]}),T.hidden=!wt(x))}T.textContent=String(H+1);const L=Ho(b),W=b.anchor.role?B("pin.target",{role:b.anchor.role,name:b.anchor.accessibleName??b.anchor.label}):b.anchor.label,K=b.comments.length-1,J=b.anchorState==="approximate"?`~ ${b.key}`:b.key;T.setAttribute("role","button"),T.setAttribute("tabindex","0");const ce=b.anchorState==="anchored"?B(K===0?"pin.aria.none":K===1?"pin.aria.one":"pin.aria",{key:J,target:W,status:En(b.status),replies:K}):B("pin.aria.moved",{key:J,target:W,status:En(b.status),where:L});T.title=ce,T.setAttribute("aria-label",ce),t&&xe(T,()=>t(b)),$?.has(b.id)&&(T.hidden=!0,T.setAttribute("data-fo","")),C.set(b.id,T),g.set(T,{snag:b,ordinal:H+1}),(ne==="dynamic"?s:u).appendChild(T)}),Ke(),m&&je(m),ze(),ie="",ue(r.visibilityState==="visible"&&C.size>0)}const Fe=()=>s.getBoundingClientRect();let we=!1;function Be(A,$,b){for(const H of A.clips){const v=b.get(H);if(v&&($.right<=v.left||$.left>=v.right||$.bottom<=v.top||$.top>=v.bottom)){A.node.hidden=!0;return}}A.node.hidden=!1}function $t(A){const $=new Map;for(const b of A)for(const H of b.clips)$.has(H)||$.set(H,H.getBoundingClientRect());return $}const Ce=["open","progress","review","resolved"];function xe(A,$){A.addEventListener("click",$),A.addEventListener("keydown",b=>{b.key!=="Enter"&&b.key!==" "||(b.preventDefault(),$())})}function Me(A,$,b,H,v){const z=Ce.find(x=>A.some(ne=>ne.snag.status===x))??"open",T=r.createElement("div");T.className="snag-pin snag-cluster",T.style.cssText=`${ot};border-radius:50%;background:${Ln(z)};color:${$n(z)};border:2px solid ${k.onAccent}`,T.style.left=`${$}px`,T.style.top=`${b}px`,T.textContent=String(A.length),T.setAttribute("data-count",String(A.length)),T.setAttribute("data-state",z),T.setAttribute("role","button"),T.setAttribute("tabindex","0"),v&&T.setAttribute("aria-expanded","true"),T.setAttribute("aria-label",B("cluster.aria",{n:A.length,list:A.map(x=>x.ordinal).join(", ")})),xe(T,()=>{if(v)V=null;else if(A.length<=6)V=H;else{o?.(A.map(x=>x.snag.id));return}Ke()}),u.appendChild(T),O.push(T)}function de(A,$,b,H){Me(A,$,b,H,!0),A.forEach((v,z)=>{const T=$,x=b+(z+1)*(D+12),ne=v.x-T,X=v.y-x,L=Math.hypot(ne,X);if(L>4){const K=r.createElement("div");K.className="snag-leader",K.setAttribute("aria-hidden","true"),K.style.cssText=`position:absolute;left:${T}px;top:${x}px;width:${L}px;height:0;border-top:1px solid ${k.onAccent};transform-origin:0 0;transform:rotate(${Math.atan2(X,ne)}rad)`,u.appendChild(K),O.push(K)}const W=v.dot.cloneNode(!0);W.style.visibility="",W.style.left=`${T}px`,W.style.top=`${x}px`,xe(W,()=>t?.(v.snag)),u.appendChild(W),O.push(W)})}function Ke(){for(const v of O)v.remove();O=[];const A=[];for(const[v,z]of g){if(v.hidden){v.style.visibility="";continue}const T=f.get(v);T&&A.push({dot:v,snag:z.snag,ordinal:z.ordinal,x:T.x,y:T.y})}const{members:$,visits:b}=ur(A,E);u.setAttribute("data-cv",String(b)),u.setAttribute("data-cp",String(A.length));let H=!1;for(const v of $){if(v.length<2){A[v[0]].dot.style.visibility="";continue}const z=v.map(X=>A[X]),T=z.map(X=>X.snag.id).sort().join("|");for(const X of z)X.dot.style.visibility="hidden";const x=z.reduce((X,L)=>X+L.x,0)/z.length,ne=z.reduce((X,L)=>X+L.y,0)/z.length;V===T&&z.length<=6?(H=!0,de(z,x,ne,T)):Me(z,x,ne,T,!1)}V&&!H&&(V=null)}function Je(A){re?.remove(),re=null;const $=A.anchor.rect;if(!$)return;const b=A.anchor.offset??{fx:.5,fy:.5},H=r.createElement("div");H.className="snag-pin snag-ghost",H.style.cssText=`${ot};${xt};background:transparent;border:2px dashed ${k.anchorOrphan};color:${k.anchorOrphan};box-shadow:none;pointer-events:none`;const v=U($.x+$.w*b.fx-Y.x,$.y+$.h*b.fy-Y.y,N());H.style.left=`${v.x}px`,H.style.top=`${v.y}px`,H.setAttribute("aria-hidden","true"),u.appendChild(H),re=H}function ze(A=!1){const $=A?[...d,...y]:d;we||$.length===0||(we=!0,c.requestAnimationFrame(()=>{we=!1;const b=performance.now(),H=c.scrollX,v=c.scrollY,z=Fe(),T=$.map(L=>L.el.isConnected?L.el.getBoundingClientRect():null),x=$.map(L=>L.el.isConnected&&wt(L.el)),ne=$t($),X=N();$.forEach((L,W)=>{const K=T[W];if(!K)return;if(L.node.hasAttribute("data-fo")){L.node.hidden=!0;return}if(!x[W]){L.node.hidden=!0;return}L.node.hidden=!1;const J=K.left+K.width*L.fx,ce=K.top+K.height*L.fy;if(L.node.parentElement===s)L.node.style.left=`${J-z.left}px`,L.node.style.top=`${ce-z.top}px`,Be(L,K,ne),f.set(L.node,{x:J+H-Y.x,y:ce+v-Y.y});else{const q=U(J+H-Y.x,ce+v-Y.y,X);L.node.style.left=`${q.x}px`,L.node.style.top=`${q.y}px`,f.set(L.node,q)}}),Ke(),u.setAttribute("data-ms",(performance.now()-b).toFixed(2))}))}const Se=()=>ze();r.addEventListener("scroll",Se,{capture:!0,passive:!0});const it=typeof c.ResizeObserver=="function"?new c.ResizeObserver(()=>ze(!0)):null;it?.observe(r.documentElement);let Ae=null,ie="";function Et(){let A="";for(const $ of[...y,...d]){if(!$.el.isConnected)continue;const b=$.el.getBoundingClientRect();A+=`${Math.round(b.left)},${Math.round(b.top)},${Math.round(b.width)};`}!A||A===ie||(ie=A,ze(!0))}function ue(A){if(Ae&&clearTimeout(Ae),Ae=null,!A)return;const $=()=>{Et(),Ae=setTimeout($,500)};Ae=setTimeout($,500)}const ct=()=>ue(r.visibilityState==="visible"&&C.size>0);r.addEventListener("visibilitychange",ct);function ae(A){const $=C.get(A);$&&($.classList.remove("snag-pp"),c.requestAnimationFrame(()=>$.classList.add("snag-pp")),c.setTimeout(()=>$.classList.remove("snag-pp"),1400))}function je(A){const $=m?C.get(m):void 0;$&&($.style.transform="",$.style.zIndex=""),m=A;const b=A?C.get(A):void 0;b&&(b.style.transform="scale(1.4)",b.style.zIndex="1")}return{el:u,render:G,showGhost:Je,pulse:ae,reanchor:M,settled:()=>ee,hasPending:()=>te.size>0,highlight:je,destroy(){r.removeEventListener("scroll",Se,{capture:!0}),r.removeEventListener("visibilitychange",ct),it?.disconnect(),ue(!1),u.remove(),s.remove()}}}const yr=` .snag-notice{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(24px + var(${P.tbH},56px));z-index:${Ve.notice};max-width:min(420px,calc(100vw - 24px));background:${k.bg};color:${k.fg};border:1px solid ${k.border};border-inline-start:3px solid ${k.anchorOrphan};border-radius:${k.radius};box-shadow:${k.shadow};padding:12px 14px;pointer-events:auto;font:400 13px/1.45 ${k.font};display:flex;flex-direction:column;gap:10px}@media (pointer:coarse){.snag-notice{bottom:calc(12px + var(${P.tbH},64px))}}.snag-notice p{margin:0}.snag-notice-actions{display:flex;gap:6px;justify-content:flex-end}.snag-notice button{appearance:none;font:inherit;cursor:pointer;border-radius:calc(${k.radius} - 2px);padding:6px 12px;min-height:30px;border:0;transition:background ${k.motion}}.snag-notice-retry{background:${k.accent};color:${k.onAccent};font-weight:600}.snag-notice-dismiss{background:transparent;color:${k.muted}}.snag-notice-dismiss:hover{background:${k.hover};color:inherit}.snag-notice button:focus-visible{outline:2px solid ${k.focus};outline-offset:2px}`;function br(e,t){const n=e.ownerDocument??document,o=n.defaultView??window;nt(e,"notice",yr);const r=n.createElement("div");r.className="snag-notice",r.setAttribute("role","alert"),r.hidden=!0;const c=n.createElement("p"),u=n.createElement("div");u.className="snag-notice-actions";const s=n.createElement("button");s.type="button",s.className="snag-notice-dismiss",s.textContent=B("action.dismiss"),s.addEventListener("click",()=>C());const d=n.createElement("button");d.type="button",d.className="snag-notice-retry",u.append(s,d),r.append(c,u);let y;d.addEventListener("click",()=>{C(),y?.run()});let w=0;function C(){w&&o.cancelAnimationFrame(w),w=0,r.hidden=!0,r.remove()}return{show(m,f,g){y=f,d.hidden=!f,f&&(d.textContent=B(f.label)),r.hidden=!1,c.textContent="",(t??e).appendChild(r);const p=B(m,g);w&&o.cancelAnimationFrame(w),w=o.requestAnimationFrame(()=>{w=0,c.textContent=p})},hide:C,visible:()=>r.isConnected&&!r.hidden,destroy(){r.remove()}}}const vr=` .snag-paused{border:0;padding:0;background:transparent;pointer-events:auto;max-width:min(420px,calc(100vw - 32px))}.snag-paused::backdrop{background:rgb(0 0 0 / .28)}.snag-paused-box{background:${k.bg};color:${k.fg};border:1px solid ${k.border};border-inline-start:3px solid ${k.accent};border-radius:${k.radius};box-shadow:${k.shadow};padding:14px 16px;font:400 13px/1.45 ${k.font};display:flex;flex-direction:column;gap:12px}.snag-paused p{margin:0}.snag-paused-actions{display:flex;justify-content:flex-end}.snag-paused button{appearance:none;font:inherit;cursor:pointer;border:0;font-weight:600;border-radius:calc(${k.radius} - 2px);padding:6px 14px;min-height:30px;background:${k.accent};color:${k.onAccent}}.snag-paused button:focus-visible{outline:2px solid ${k.focus};outline-offset:2px}`;function wr(e,t){const n=e.ownerDocument??document;nt(e,"paused",vr);const o=n.createElement("dialog");o.className="snag-paused",o.setAttribute("aria-label",B("paused.dialog"));const r=n.createElement("div");r.className="snag-paused-box",r.setAttribute("role","status");const c=n.createElement("p");c.textContent=B("paused.dialog");const u=n.createElement("div");u.className="snag-paused-actions";const s=n.createElement("button");s.type="button",s.textContent=B("paused.close"),s.addEventListener("click",()=>w()),u.append(s),r.append(c,u),o.append(r);let d=!1;function y(){if(!d){(t??e).appendChild(o);try{o.showModal(),d=!0}catch{o.setAttribute("open",""),d=!0}}}function w(){if(d){d=!1;try{o.close()}catch{o.removeAttribute("open")}o.remove()}}return o.addEventListener("close",()=>{d=!1,o.remove()}),{show:y,hide:w,destroy(){w(),o.remove()}}}const xr=Symbol.for(gn.original),Nn=Symbol.for(gn.wrapped),rt=()=>{};function Sr(e,t,n){let o;try{o=e[t]}catch{return rt}if(typeof o!="function"||o[Nn])return rt;const r=o,c=n(r);let u=!1;const s=function(...d){return u?r.apply(this,d):c.apply(this,d)};try{const d=s;d[Nn]=!0,d[xr]=r,Object.defineProperty(s,"name",{value:r.name,configurable:!0}),Object.defineProperty(s,"length",{value:r.length,configurable:!0})}catch{}try{e[t]=s}catch{return rt}return e[t]!==s?rt:()=>{let d;try{d=e[t]}catch{d=void 0}if(d===s)try{e[t]=r;return}catch{}u=!0}}function Ar(e,t){const n=[];let o=0;const r=()=>{o||(o=e.requestAnimationFrame(()=>{o=0,t.onResize()}))};e.addEventListener("resize",r),n.push(()=>{o&&e.cancelAnimationFrame(o),e.removeEventListener("resize",r)}),e.visualViewport?.addEventListener("resize",r),n.push(()=>e.visualViewport?.removeEventListener("resize",r));const c=()=>void e.setTimeout(t.onResize,250);e.addEventListener("orientationchange",c),n.push(()=>e.removeEventListener("orientationchange",c));let u=e.location.pathname;const s=()=>{const E=e.location.pathname;E!==u&&(u=E,t.onRoute())},d=e.navigation;if(d){const E=()=>void e.setTimeout(s,0);d.addEventListener("navigatesuccess",E),n.push(()=>d.removeEventListener("navigatesuccess",E))}else for(const E of["pushState","replaceState"])n.push(Sr(e.history,E,D=>function(...O){const V=D.apply(this,O);return e.setTimeout(s,0),V}));const y=e.document;let w=!0;try{y.documentElement.matches(":modal")}catch{w=!1}const C=()=>{const E=y.querySelectorAll("dialog[open]");if(!w)return E.length>0;for(const D of E)if(D.matches(":modal"))return!0;return!1};let m=!1;const f=()=>{const E=C();E!==m&&(m=E,t.onModal(E))};y.addEventListener("toggle",f,!0),n.push(()=>y.removeEventListener("toggle",f,!0));const g=new MutationObserver(f);g.observe(y.documentElement,{subtree:!0,attributes:!0,attributeFilter:["open"]}),n.push(()=>g.disconnect());const p=()=>void e.setTimeout(s,0);return e.addEventListener("popstate",p),n.push(()=>e.removeEventListener("popstate",p)),{destroy(){for(const E of n)E();n.length=0}}}function kr(e,t){try{e.sessionStorage.setItem(le.handoff,JSON.stringify({openThreadId:t}))}catch{}}function $r(e){try{const t=e.sessionStorage.getItem(le.handoff);if(t===null)return null;e.sessionStorage.removeItem(le.handoff);const n=JSON.parse(t);return typeof n.openThreadId=="string"?n.openThreadId:null}catch{return null}}function Er(){return{statuses:[],read:"all",pageOnly:!1,newOnly:!1,sort:"page"}}const Cr=["open","progress","review","resolved"];function Tr(e,t,n){if(t.statuses.length>0&&Cr.includes(e.status)&&!t.statuses.includes(e.status)||t.by&&e.createdBy.id!==t.by||t.page&&e.route!==t.page)return!1;if(t.read!=="all"&&n){const o=Rr(e,n);if(t.read==="unread"&&!o||t.read==="read"&&o)return!1}return!0}function Rr(e,t){const n=t.get(e.id)??0;return Date.parse(e.updatedAt)>n}function _r(e,t,n){const o=e.visualViewport;let r=0;const c=()=>{if(r=0,!o)return;const s=o.offsetLeft,d=o.offsetTop;t.style.translate=s||d?`${s}px ${d}px`:"",t.style.width=`${o.width}px`,t.style.height=`${o.height}px`,n?.(o.scale)},u=()=>{r||(r=e.requestAnimationFrame(c))};return o?.addEventListener("resize",u,{passive:!0}),o?.addEventListener("scroll",u,{passive:!0}),u(),()=>{r&&e.cancelAnimationFrame(r),o?.removeEventListener("resize",u),o?.removeEventListener("scroll",u)}}const Ir=/^eyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}/,Pr=/^[a-f0-9]{32,}$/i,Mr=/^(?=[A-Za-z0-9_-]{24,}$)(?=.*[A-Za-z])(?=.*\d)[A-Za-z0-9_-]+$/,zr="[redacted]";function Hn(e){return e.includes("/")?e.split("/").map(t=>Ir.test(t)||Pr.test(t)||Mr.test(t)?zr:t).join("/"):e}const Or=/\/index\.(html?|php)$/i;function Lr(e){if(!e.startsWith("/"))return e;let t=e.replace(Or,"/");return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t.toLowerCase()}function Dr(e){try{const t=e.querySelector(`meta[name="${Mo.route}"]`)?.getAttribute("content")?.trim();return!t||t.length>512||!t.startsWith("/")?null:t}catch{return null}}function Nr(e,t){const n=t??Dr(e);return Lr(n??Hn(e.location.pathname))}const Hr=[/^utm_/,/^(gclid|gbraid|wbraid|fbclid|msclkid|ttclid|twclid|igshid|yclid|li_fat_id)$/,/^(mc_cid|mc_eid|_hsenc|_hsmi|vero_id|oly_enc_id|oly_anon_id)$/,/^_vercel_/,/^__vercel_/,/^_rsc$/],Wr=[...bt.query,...bt.fragment];function Fr(e,t=[]){return Wr.includes(e)||t.includes(e)?!0:Hr.some(n=>n.test(e))}function Br(e,t={}){const n=t.significantQueryParams??[];if(n!=="*"&&n.length===0)return;let o;try{o=new URLSearchParams(e)}catch{return}const r={};for(const[c,u]of o)Fr(c,t.ignoredQueryParams??[])||n!=="*"&&!n.includes(c)||(r[c]=u);return Object.keys(r).length>0?r:void 0}function jr(e,t,n={}){const o=n.significantQueryParams??[];if(o==="*"){const r=e??{},c=t??{},u=new Set([...Object.keys(r),...Object.keys(c)]);for(const s of u)if(r[s]!==c[s])return!1;return!0}for(const r of o)if((e?.[r]??void 0)!==(t?.[r]??void 0))return!1;return!0}const Ur=120,Zr=1e3,Vr=200,Yr=1e4;function Xr(e,t,n){const o=t.MutationObserver;if(typeof o!="function")return{destroy:()=>{}};let r=!1,c=null,u=!1,s=!1,d=0,y=C(),w=0;function C(){return t.performance?.now?.()??0}const m=new o(()=>{r=!0,d++,g()});function f(){const E=C();return E-y>=1e3&&(d>Vr&&(w=E+Yr),d=0,y=E),E<w?Zr:Ur}function g(){c||(c=setTimeout(p,f()))}function p(){if(c=null,!!r){if(u){s=!0;return}r=!1,u=!0;try{n()}finally{u=!1,s&&(s=!1,r=!0,g())}}}return m.observe(e.documentElement,{childList:!0,subtree:!0}),{destroy(){m.disconnect(),c&&clearTimeout(c),c=null}}}const Kr="0.0.0",Jr={capture:Re.capture,"anchor-ext":Re.anchorExt,"anchor-fuzzy":Re.anchorFuzzy,crumbs:Re.crumbs,screenshot:Re.screenshot,dock:Re.dock,text:Re.text},Wn=new Map,Bt=new Map,Fn=new Map;function qr(e,t,n){const o=new URL(t,n.location.href).href,r=new URL(Jr[e],o);r.searchParams.set("cv",Kr);const c=Fn.get(e)??0;return c>0&&r.searchParams.set("r",String(c)),Fn.set(e,c+1),r.href}async function _e(e,t,n=document){const o=Wn.get(e);if(o)return{ok:!0,mod:o};const r=Bt.get(e);if(r)return r;const c=(async()=>{for(let u=0;u<2;u++)try{const s=await import(qr(e,t,n));return Wn.set(e,s),{ok:!0,mod:s}}catch{}return{ok:!1,reason:"unavailable"}})();Bt.set(e,c);try{return await c}finally{Bt.delete(e)}}const Qr="composer",jt=e=>le.draft(e,Qr),Gr=le.draft("\0","").split("\0")[0];function ea(e){try{return e.body.trim()?(localStorage.setItem(jt(e.route),JSON.stringify(e)),!0):(Bn(e.route),!0)}catch{return!1}}function ta(e){try{const t=localStorage.getItem(jt(e));if(!t)return null;const n=JSON.parse(t);return!n||typeof n.body!="string"||!n.anchor||n.route!==e?null:n}catch{return null}}function Bn(e){try{localStorage.removeItem(jt(e))}catch{}}function Ut(){try{for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);if(t&&t.startsWith(Gr))return!0}return!1}catch{return!1}}const na="http://www.w3.org/2000/svg";function Ie(e,t,n,o=[]){const r=e.createElementNS(na,t);for(const c in n)r.setAttribute(c,n[c]);for(const c of o)r.appendChild(c);return r}const Zt=(e,t="16",n="16",o="0 0 16 16")=>({width:t,height:n,viewBox:o,fill:"none","aria-hidden":"true"}),oa=e=>Ie(e,"svg",Zt(),[Ie(e,"path",{d:"M8 3v10M3 8h10",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round"})]),ra=e=>Ie(e,"svg",Zt(),[Ie(e,"rect",{x:"2.25",y:"3.25",width:"11.5",height:"9.5",rx:"1.75",stroke:"currentColor","stroke-width":"1.5"}),Ie(e,"path",{d:"M9.5 3.5v9",stroke:"currentColor","stroke-width":"1.5"})]),aa=e=>Ie(e,"svg",{...Zt(e,"10","16","0 0 10 16"),fill:"currentColor"},[Ie(e,"g",{fill:"currentColor"},[4,8,12].flatMap(t=>[3,7].map(n=>Ie(e,"circle",{cx:String(n),cy:String(t),r:"1"}))))]),sa=` .snag-tb{position:fixed;z-index:${Ve.toolbar};display:flex;align-items:center;gap:2px;padding:4px;border-radius:calc(${k.radius} + 4px);background:${k.bg};color:${k.fg};box-shadow:${k.shadow};font:500 13px/1 ${k.font};pointer-events:auto;user-select:none;border:1px solid ${k.border}}.snag-tb{transition:inset-inline-end ${k.motion}}.snag-tb--fine{inset-inline-end:calc(20px + env(safe-area-inset-right) + var(${P.dockW},0px));inset-block-end:calc(20px + env(safe-area-inset-bottom));transition:inset-inline-end ${k.motion}}.snag-tb--coarse{inset-inline:0;inset-block-end:0;border-radius:14px 14px 0 0;padding:6px 10px calc(6px + env(safe-area-inset-bottom));justify-content:center;gap:4px;flex-direction:column}.snag-grabber{width:36px;height:4px;border-radius:2px;background:${k.muted};margin:2px auto 6px}.snag-row{display:flex;align-items:center;gap:2px}.snag-grip{display:flex;align-items:center;padding:0 4px;color:${k.muted};cursor:grab;touch-action:none}.snag-grip:active{cursor:grabbing}.snag-seg{display:flex;background:${k.surface};border-radius:${k.radius};padding:2px;position:relative}.snag-seg::before{content:"";position:absolute;inset-block:2px;inset-inline-start:var(${P.thumbX},0);width:var(${P.thumbW},0);background:${k.accent};border-radius:calc(${k.radius} - 2px);pointer-events:none;transition:inset-inline-start ${k.motion},width ${k.motion}}.snag-seg>.snag-b[aria-pressed="true"]{background:transparent;color:${k.onAccent}}.snag-seg>.snag-b{z-index:1}.snag-b{appearance:none;border:0;background:transparent;color:inherit;font:inherit;padding:6px 11px;border-radius:calc(${k.radius} - 2px);cursor:pointer;display:flex;align-items:center;gap:6px;position:relative;min-height:32px;transition:background ${k.motion}}.snag-b:hover:not(:disabled){background:color-mix(in srgb,currentColor 12%,transparent)}.snag-b:disabled{opacity:.4;cursor:not-allowed}.snag-b[aria-pressed="true"]{background:${k.accent};color:${k.onAccent}}.snag-b:focus-visible{outline:2px solid ${k.focus};outline-offset:2px}.snag-icon{padding:6px 9px}@media (pointer:coarse){.snag-b{min-height:44px;min-width:44px;padding:6px 14px}.snag-icon{padding:6px 14px}}.snag-puck .snag-row>:not([aria-expanded]){display:none}.snag-puck{padding:4px;border-radius:50%}.snag-puck [aria-expanded]{min-width:44px;min-height:44px;border-radius:50%}`;function ia(e,t){const n=e.ownerDocument??document,o=t.coarsePointer??n.defaultView?.matchMedia?.("(pointer: coarse)").matches??!1;nt(e,"toolbar",sa);const r=n.createElement("div");r.className=`snag-tb ${o?"snag-tb--coarse":"snag-tb--fine"}`,r.setAttribute("role","toolbar"),r.setAttribute("aria-label",B("toolbar.aria"));const c=n.createElement("div");c.className="snag-grabber",c.setAttribute("aria-hidden","true");const u=n.createElement("div");u.className="snag-row";const s=n.createElement("span");s.className="snag-grip",s.setAttribute("aria-hidden","true"),s.appendChild(aa(n));const d=n.createElement("div");d.className="snag-seg",d.setAttribute("role","group"),d.setAttribute("aria-label",B("toolbar.group"));const y=(l,_,S)=>{const I=n.createElement("button");return I.type="button",I.className=`snag-b ${l}`,I.setAttribute("aria-label",_),typeof S=="string"?I.textContent=S:I.appendChild(S),I},w=y("",B("toolbar.browse"),B("toolbar.browse")),C=y("",B("toolbar.comments"),B("toolbar.comments")),m=y("snag-icon",B("toolbar.add"),oa(n)),f=y("snag-icon",B("toolbar.panel"),ra(n));f.setAttribute("aria-expanded","false"),d.append(w,C),o||u.appendChild(s),u.append(d,m,f),o&&r.appendChild(c),r.appendChild(u),(t.parent??e).appendChild(r);const g=()=>{e.host.style.setProperty(P.tbH,`${r.offsetHeight}px`)};g();let p=null;function E(l,_){const S=n.defaultView,I=r.offsetWidth,M=r.offsetHeight,N=jn(l,8,Math.max(8,S.innerWidth-I-8)),U=jn(_,8,Math.max(8,S.innerHeight-M-8));p={left:N,top:U},r.style.left=`${N}px`,r.style.top=`${U}px`,r.style.right="auto",r.style.bottom="auto"}const D=()=>{g(),p&&E(p.left,p.top)},O=n.defaultView;if(O?.addEventListener("resize",D),w.addEventListener("click",()=>t.onState("browse")),C.addEventListener("click",()=>t.onState("comments")),m.addEventListener("click",()=>t.onState(V==="add"?"comments":"add")),f.addEventListener("click",()=>t.onPanel()),!o){let l=null;s.addEventListener("pointerdown",S=>{l={x:S.clientX,y:S.clientY,r:r.getBoundingClientRect()},s.setPointerCapture(S.pointerId),S.preventDefault()}),s.addEventListener("pointermove",S=>{l&&E(l.r.left+(S.clientX-l.x),l.r.top+(S.clientY-l.y))});const _=S=>{l=null,s.hasPointerCapture(S.pointerId)&&s.releasePointerCapture(S.pointerId)};s.addEventListener("pointerup",_),s.addEventListener("pointercancel",_)}let V="browse";function re(l){V=l,w.setAttribute("aria-pressed",String(l==="browse")),C.setAttribute("aria-pressed",String(l!=="browse")),m.setAttribute("aria-pressed",String(l==="add")),Y()}function Y(){const l=d.querySelector('.snag-b[aria-pressed="true"]'),_=d.getBoundingClientRect(),S=l?.getBoundingClientRect();if(!l||!S?.width){d.style.setProperty(P.thumbW,"0px");return}const I=n.defaultView?.getComputedStyle(d),M=I?.direction==="rtl",N=parseFloat((M?I?.paddingRight:I?.paddingLeft)??"0")||0,U=(M?_.right-S.right:S.left-_.left)-N;d.style.setProperty(P.thumbW,`${Math.round(S.width)}px`),d.style.setProperty(P.thumbX,`${Math.max(0,Math.round(U))}px`)}function Ee(l){m.disabled=l,l?m.title=B("error.panels.add"):m.removeAttribute("title")}function ee(l){m.setAttribute("aria-label",B(l?"toolbar.add.draft":"toolbar.add"))}function te(l){C.setAttribute("aria-label",l!==null&&l>0?B("toolbar.comments.unresolved",{n:No(l)}):B("toolbar.comments"))}re("browse"),te(0);function Pe(l){r.classList.toggle("snag-puck",l),l||Y()}function pe(l){r.hidden=l,l||Y(),g()}return{el:r,setState:re,setCount:te,setDegraded:Ee,setDraft:ee,setPuck:Pe,setConcealed:pe,destroy(){O?.removeEventListener("resize",D),e.host.style.removeProperty(P.tbH),r.remove()}}}const jn=(e,t,n)=>e<t?t:e>n?n:e,Un=24;function ca(e,t){const n=e.innerHeight,o=t.querySelector(".snag-dk");if(!o)return{top:0,bottom:n};const r=o.getBoundingClientRect();return r.height>=n-1?{top:0,bottom:n}:{top:0,bottom:Math.max(0,r.top)}}function la(e,t,n){const o=n.anchor.rect;if(!o)return;const r=n.anchor.offset??{fy:.5},c=o.y+o.h*r.fy,u=ca(e,t),s=c-e.scrollY;if(s>=u.top+Un&&s<=u.bottom-Un)return;const d=e.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;e.scrollTo({top:Math.max(0,c-(u.top+u.bottom)/2),behavior:d?"auto":"smooth"})}function Vt(){const e=new Uint8Array(16);crypto.getRandomValues(e);const t=Date.now();e[0]=Math.floor(t/2**40)&255,e[1]=Math.floor(t/2**32)&255,e[2]=Math.floor(t/2**24)&255,e[3]=Math.floor(t/2**16)&255,e[4]=Math.floor(t/2**8)&255,e[5]=t&255,e[6]=e[6]&15|112,e[8]=e[8]&63|128;const n=Array.from(e,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}const da=()=>vt.thread+Vt(),Zn=()=>vt.comment+Vt(),ua=()=>vt.attachment+Vt(),fa={attachments:"direct",realtime:"none",anchorReports:!1,identity:["guest"],export:["json","md"],serverSideSearch:!1,privateThreads:!1,assignees:!1};function ha(){const e=le.threads("probe","probe");try{return localStorage.setItem(e,"1"),localStorage.removeItem(e),!0}catch(t){return Vn(t)}}function pa(e,t,n){const o=le.threads(e,t);function r(){let s=null;try{s=localStorage.getItem(o)}catch{return[]}if(!s)return[];try{const d=JSON.parse(s);return Array.isArray(d)?d.filter(ga):[]}catch{return[]}}function c(s){try{localStorage.setItem(o,JSON.stringify(s))}catch(d){if(!Vn(d))return;throw new Dt("local_quota_exceeded")}}const u=s=>({...s,updatedAt:new Date().toISOString()});return{kind:"local",capabilities:fa,async init(s){return{uid:s.uid,env:s.env,features:{screenshots:!0,uploads:!1}}},async listThreads(s={}){let d=r();return s.route!==void 0&&(d=d.filter(y=>y.route===s.route)),s.status?.length&&(d=d.filter(y=>s.status.includes(y.status))),{data:d,serverTime:new Date().toISOString()}},async getThread(s){return r().find(d=>d.id===s)??null},async createThread(s){const d=Cn(s);return c([...r(),d]),d},async patchThread(s,d){const y=r(),w=y.findIndex(m=>m.id===s);if(w<0)return null;const C=u({...y[w],...ma(d)});return y[w]=C,c(y),C},async deleteThread(s){const d=r(),y=d.find(C=>C.id===s),w=d.filter(C=>C.id!==s);w.length!==d.length&&c(w);for(const C of y?.attachments??[])n?.del(C.id).catch(()=>{})},async uploadAttachment(s,d){if(!n)throw new Dt("attachments_unsupported");const y=ua();return await n.put(y,{blob:s,uid:e,env:t,kind:d.kind,...d.width!==void 0?{width:d.width}:{},...d.height!==void 0?{height:d.height}:{},createdAt:Date.now()}),{id:y,kind:d.kind,url:"",...d.width!==void 0?{width:d.width}:{},...d.height!==void 0?{height:d.height}:{},bytes:s.size,contentType:s.type}},async createComment(s,d){const y=r(),w=y.findIndex(m=>m.id===s);if(w<0)return null;const C={id:d.id,snagId:s,body:d.body,author:d.author,createdAt:new Date().toISOString()};return y[w]=u({...y[w],comments:[...y[w].comments,C]}),c(y),C},async patchComment(s,d){const y=r();for(let w=0;w<y.length;w++){const C=y[w].comments.find(f=>f.id===s);if(!C)continue;const m={...C,body:d};return y[w]=u({...y[w],comments:y[w].comments.map(f=>f.id===s?m:f)}),c(y),m}return null},async deleteComment(s){const d=r(),y=d.findIndex(w=>w.comments.some(C=>C.id===s));y<0||(d[y]=u({...d[y],comments:d[y].comments.filter(w=>w.id!==s)}),c(d))}}}function ma(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function Vn(e){return e instanceof Error?e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED"||e.code===22||e.code===1014:!1}function ga(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.key=="string"&&typeof t.route=="string"&&typeof t.anchor=="object"&&t.anchor!==null&&typeof t.anchor.label=="string"&&Array.isArray(t.comments)}function ya(e,t,n=()=>Date.now()){const o=le.seen(e,t);let r=null;function c(){if(r)return r;try{const s=localStorage.getItem(o),d=s?JSON.parse(s):{};return r=typeof d=="object"&&d!==null&&!Array.isArray(d)?d:{}}catch{return r={}}}function u(s){r=s;try{localStorage.setItem(o,JSON.stringify(s))}catch{}}return{map:()=>new Map(Object.entries(c())),mark(s){u({...c(),[s]:n()})},markAll(s){const d=n(),y={...c()};for(const w of s)y[w.id]=d;u(y)}}}function at(){let e=null;try{e=localStorage.getItem(zt)}catch{return{}}if(!e)return{};if(e[0]!=="{")return{name:e};try{const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function Yn(e){try{localStorage.setItem(zt,JSON.stringify(e))}catch{}}function Yt(){const e=at();return{name:typeof e.name=="string"?e.name:"",...e.email?{email:e.email}:{}}}function Xn(e){return at().projects?.[e]?.holderId}function ba(e){const t=at().projects?.[e]?.holderSecret;return t&&/^[\w-]{43}$/.test(t)?t:void 0}function va(e,t,n){const o=at();Yn({...o,projects:{...o.projects,[e]:{holderId:t,holderSecret:n}}})}function wa(e,t){const n=at(),o=n.projects?.[e];o&&Yn({...n,projects:{...n.projects,[e]:{...o,holderId:t}}})}const We=e=>le.session(e);function Kn(e){if(!e)return null;const t=JSON.parse(e);return typeof t?.token=="string"&&typeof t?.refreshableUntil=="number"?t:null}function Ye(e){try{const t=Kn(sessionStorage.getItem(We(e)));if(t)return t;const n=Kn(localStorage.getItem(We(e)));return n?.member?n:null}catch{return null}}function Xt(e,t){try{t.member?(localStorage.setItem(We(e),JSON.stringify(t)),sessionStorage.removeItem(We(e))):sessionStorage.setItem(We(e),JSON.stringify(t))}catch{}}function st(e){try{sessionStorage.removeItem(We(e)),localStorage.removeItem(We(e))}catch{}}const xa=(e,t=Date.now())=>t>e.expiresAt-3e4,Kt=(e,t=Date.now())=>t>=e.refreshableUntil;class Xe extends Error{code;status;constructor(t,n,o){super(o),this.name="HttpAdapterError",this.status=t,this.code=n}}function Sa(e){const{offset:t,testId:n,domId:o,page:r,schemaVersion:c,...u}=e;return{...u,...n?{testid:n}:{},...o?{domid:o}:{},...t?{offset:{fx:t.x,fy:t.y}}:{}}}function Aa(e,t){const n=e.url??"",o=/^https?:/i.test(n)?n:n?`${t}${n.startsWith("/")?"":"/"}${n}`:`${t}/api/v1/attachments/${encodeURIComponent(e.id)}/blob`;return{...e,url:o}}function St(e,t,n){return{id:e.id,route:e.anchor?.page?.route??"",key:e.key,status:e.status,anchor:Sa(e.anchor),anchorState:e.anchorState,context:e.context,comments:e.comments??[],createdBy:e.createdBy,createdAt:e.createdAt,updatedAt:e.updatedAt,...e.resolvedAt?{resolvedAt:e.resolvedAt}:{},...e.attachments?.length?{attachments:e.attachments.map(o=>Aa(o,n))}:{},...t?{scope:{environment:t}}:{}}}function ka(e,t){const{offset:n,testid:o,domid:r,...c}=e;return{...c,schemaVersion:pn,...o?{testId:o}:{},...r?{domId:r}:{},offset:n?{x:n.fx,y:n.fy}:{x:.5,y:.5},page:{route:t,pathname:location.pathname,origin:location.origin}}}function $a(e,t,n,o={}){const r=e.replace(/\/+$/,""),c=`${r}/api/v1/projects/${encodeURIComponent(t)}`;let u=o.reviewToken,s=Ye(t);async function d(f=!1){const g=s&&!Kt(s)?s.token:null,p=!!g&&!u&&!f,E=p?void 0:u?{kind:"link",token:u,name:Yt().name||void 0}:{kind:"guest",name:Yt().name||"Anonymous",holderId:Xn(t),holderSecret:ba(t)};let D;try{D=await fetch(`${c}/sessions`,{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...g?{Authorization:`Bearer ${g}`}:{}},body:JSON.stringify({...n?{environment:n}:{},...E?{identity:E}:{},client:{widget:Ao,schema:pn}})})}catch(re){throw new Xe(0,"network_error",re.message)}finally{u=void 0}if(!D.ok){const Y=(await D.json().catch(()=>null))?.error?.code??"unauthorized";throw st(t),s=null,Y==="session_revoked"||Y==="token_revoked"?o.onSessionEnded?.("revoked"):D.status===401&&o.onSessionEnded?.("expired"),new Xe(D.status,Y,"This review session is not valid.")}const O=await D.json();O.holderSecret&&O.reviewer?va(t,O.reviewer.id,O.holderSecret):O.reviewer&&wa(t,O.reviewer.id);const V=O.round?.number??(p?s?.round:void 0);return s={token:O.sessionToken,expiresAt:Date.parse(O.expiresAt),refreshableUntil:Date.parse(O.refreshableUntil),reviewerId:O.reviewer?.id??s?.reviewerId??"",permissions:O.permissions??s?.permissions??[],...V!==void 0?{round:V}:{},...p&&s?.member?{member:s.member}:{},...p&&s?.member&&s.moderator?{moderator:!0}:{}},Xt(t,s),E&&(w=E.name??null),o.onSessionStarted?.(),s}async function y(){if(s){if(Kt(s)){st(t),s=null,o.onSessionEnded?.("expired");return}await d().catch(()=>{})}}let w=null;async function C(){if(s&&Kt(s))return st(t),s=null,w=null,o.onSessionEnded?.("expired"),null;const f=Yt().name||null,g=s!==null&&!s.member&&f!==null&&f!==w;if(!s||xa(s)||u||g)try{await d(g)}catch(p){if(!(p instanceof Xe)||p.status===0)throw p;return null}return s?.token??null}async function m(f,g,p=!1){const E=await C();let D;try{D=await fetch(c+f,{...g,headers:{"content-type":"application/json",...E?{Authorization:`Bearer ${E}`}:{},...g?.headers??{}},credentials:"omit"})}catch(O){throw new Xe(0,"network_error",O.message)}if(!D.ok){const O=await D.json().catch(()=>null),V=O?.error?.code??"http_error";if(D.status===401&&!p&&V!=="session_revoked")return st(t),s=null,m(f,g,!0);throw new Xe(D.status,V,O?.error?.message??`The server answered ${D.status}.`)}return await D.json()}return{kind:"http",capabilities:{attachments:"none",realtime:"none",anchorReports:!0,identity:["guest"],export:[],serverSideSearch:!1,privateThreads:!1,assignees:!1},async init(f){const g=await m("/config");return this.capabilities.attachments=g.features.screenshots?"direct":"none",{uid:f.uid,env:f.env,features:g.features,...g.rounds?{rounds:g.rounds}:{},...g.writable===void 0?{}:{writable:g.writable},...g.reason===void 0?{}:{reason:g.reason}}},async reportAnchors(f){if(f.length!==0)for(let g=0;g<f.length;g+=50)try{await m("/anchor-reports",{method:"POST",body:JSON.stringify({reports:f.slice(g,g+50)})})}catch{return}},revalidate:y,member:()=>s?.member??null,adoptSession(f){s={token:f.sessionToken,expiresAt:Date.parse(f.expiresAt),refreshableUntil:Date.parse(f.refreshableUntil),reviewerId:f.reviewer.id,permissions:f.permissions,member:f.reviewer.name,...f.moderator?{moderator:!0}:{}},Xt(t,s),o.onSessionStarted?.()},signOut(){st(t),s=null,w=null},getRound(){return s?.round??Ye(t)?.round??null},setRound(f){s&&(s={...s,round:f});const g=Ye(t);g&&Xt(t,{...g,round:f})},async fetchForeignImage(f){try{const g=await C(),p=await fetch(`${c}/image?src=${encodeURIComponent(f)}`,{credentials:"omit",...g?{headers:{Authorization:`Bearer ${g}`}}:{}});if(!p.ok)return null;const E=await p.blob();return E.type.startsWith("image/")?E:null}catch{return null}},async uploadAttachment(f,g){const p=await C(),E=await fetch(`${c}/attachments`,{method:"POST",credentials:"omit",headers:{"content-type":f.type||"image/webp",[Ot.attachmentKind]:g.kind,...g.width?{[Ot.attachmentWidth]:String(g.width)}:{},...g.height?{[Ot.attachmentHeight]:String(g.height)}:{},...p?{Authorization:`Bearer ${p}`}:{}},body:f});if(!E.ok){const O=await E.json().catch(()=>null);throw new Xe(E.status,O?.error?.code??"upload_failed",O?.error?.message??"Upload failed.")}const D=await E.json();return{id:D.id,kind:g.kind,contentType:D.contentType,byteSize:D.byteSize,...g.width?{width:g.width}:{},...g.height?{height:g.height}:{},url:`${r}/api/v1/attachments/${D.id}/blob`}},async listThreads(f){await C();const g=new URLSearchParams;n&&g.set("env",n),f?.route&&g.set("route",f.route),s?.round&&g.set("round",String(s.round));const p=await m(`/threads?${g}`);return{data:p.data.map(E=>St(E,n,r)),...p.nextCursor?{nextCursor:p.nextCursor}:{},deleted:[],serverTime:p.serverTime}},async getThread(f){return(await this.listThreads()).data.find(p=>p.id===f)??null},async getThreadByKey(f){const g=new URLSearchParams({key:f});n&&g.set("env",n);const E=(await m(`/threads?${g}`)).data[0];return E?St(E,n,r):null},async createThread(f){const g=await m("/threads",{method:"POST",body:JSON.stringify({id:f.id,anchor:ka(f.anchor,f.route),anchorState:f.anchorState,context:f.context,...n?{scope:{environment:n}}:{},createdBy:{name:f.createdBy.name},...f.comment?{comment:{id:f.comment.id,body:f.comment.body}}:{},...f.attachments?.length?{attachments:f.attachments.map(p=>p.id)}:{}})});return St(g,n,r)},async patchThread(f,g){if(!g.status)return null;const p=await m(`/threads/${encodeURIComponent(f)}`,{method:"PATCH",body:JSON.stringify({status:g.status})});return St(p,n,r)},async deleteThread(f){await m(`/threads/${encodeURIComponent(f)}`,{method:"DELETE"})},isMine(f){return f.id?f.id===(s??Ye(t))?.reviewerId||f.id===Xn(t):!1},canModerate(){const f=s??Ye(t);return!!f?.member&&!!f.moderator},can(f){return(s??Ye(t))?.permissions.includes(f)??!1},async createComment(f,g){const p=await m(`/threads/${encodeURIComponent(f)}/comments`,{method:"POST",body:JSON.stringify({id:g.id,body:g.body})});return{id:p.id,snagId:f,body:p.body,author:p.author,createdAt:p.createdAt}},async patchComment(f,g){return await m(`/comments/${encodeURIComponent(f)}`,{method:"PATCH",body:JSON.stringify({body:g})}),null},async deleteComment(f){await m(`/comments/${encodeURIComponent(f)}`,{method:"DELETE"})}}}async function Ea(e,t){if(e.url&&/^https?:/i.test(e.url))try{const n=await fetch(e.url,{credentials:"omit"});if(!n.ok)return null;const o=await n.blob();return o.type&&!o.type.startsWith("image/")?null:o}catch{return null}return t(e.id)}const Ca=64,Ta=4096,Ra=e=>le.counts(e),_a=e=>e.filter(t=>t.status!=="resolved").length;function Ia(e,t,n){const o=new Map;for(const s of t){const d=o.get(s.route)??{n:0,seen:""};s.status!=="resolved"&&d.n++,s.updatedAt>d.seen&&(d.seen=s.updatedAt),o.set(s.route,d)}o.has(n)||o.set(n,{n:0,seen:new Date().toISOString()});const c=[...o.entries()].sort((s,d)=>d[1].seen.localeCompare(s[1].seen)).slice(0,Ca);c.some(([s])=>s===n)||(c[c.length-1]=[n,o.get(n)]);let u={v:1,p:_a(t),r:Object.fromEntries(c.map(([s,d])=>[s,d.n])),t:new Date().toISOString()};JSON.stringify(u).length>Ta&&(u={...u,r:{}});try{localStorage.setItem(Ra(e),JSON.stringify(u))}catch{return null}return u}function Pa(e,t){return e?.r[t]??0}const Ma="pass(?:word|wd)?|pwd|secret|token|api[_-]?key|apikey|auth(?:orization)?|credential|session|sid|cookie|jwt|bearer|otp|mfa|totp|cvv|cvc|ssn|nino|iban|card(?:[_-]?number)?|account[_-]?number|private[_-]?key|signature|client[_-]?secret|refresh[_-]?token|access[_-]?token",za=new RegExp(`(["'\`]?)(?<![A-Za-z0-9])(?:${Ma})[\\w-]*\\b\\1?\\s*[:=]\\s*(?:(["'\`])((?:\\\\.|(?!\\2)[^\\\\])*)\\2|([^\\s,;&}\\])]{3,}))`,"gi"),Oa=/^(?:Bearer|Basic|Digest|Negotiate|Token)$/i,La=(e,t,n,o,r,c,u)=>{if(!n&&Oa.test(r)&&u.slice(c+e.length).startsWith(" [redacted]")||(n?o:r).startsWith("[redacted"))return e;const s=n?`${n}${o}${n}`:r;return e.slice(0,e.length-s.length)+(n?`${n}[redacted]${n}`:"[redacted]")},Jn=/data:[a-z0-9.+-]*\/?[a-z0-9.+-]*;base64,[A-Za-z0-9+/=]{16,}/gi,qn=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{0,}/g,Qn=/\b(sk-[A-Za-z0-9]+-[A-Za-z0-9_-]{20,}|sk-ant-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{20,}|(sk|pk|rk)_(live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|glpat-[A-Za-z0-9_-]{16,}|xox[baprs]-[A-Za-z0-9-]{10,}|xapp-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|ASIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{35}|ya29\.[A-Za-z0-9_-]{20,}|SG\.[A-Za-z0-9_-]{20,}|npm_[A-Za-z0-9]{30,}|dop_v1_[a-f0-9]{40,}|shpat_[a-f0-9]{30,}|sbp_[a-f0-9]{30,}|hf_[A-Za-z0-9]{30,}|nvapi-[A-Za-z0-9_-]{20,})\b/g,Da=/\b(Bearer|Basic|Digest|Negotiate|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,Gn=/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z]{2,24})+\b/g,Jt=/\b(?:\d[ -]?){12,18}\d\b/g,eo=/\b(?=[A-Za-z0-9+/]*[a-z])(?=[A-Za-z0-9+/]*[A-Z])(?=[A-Za-z0-9+/]*\d)[A-Za-z0-9+/]{40,}={0,2}\b/g,to=/\b[0-9a-f]{32,}\b/gi,no=/\b(?=[A-Za-z0-9_-]*[a-z])(?=[A-Za-z0-9_-]*[A-Z])(?=[A-Za-z0-9_-]*\d)[A-Za-z0-9_-]{40,}\b/g,oo=/\b[a-z][a-z0-9]{1,15}(?:_[a-z0-9]{1,15}){0,2}_(?=[A-Za-z0-9_-]*[A-Z])(?=[A-Za-z0-9_-]*\d)[A-Za-z0-9_-]{24,}\b/g,ro=/\b[a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:[^\s/@]+@/gi,Na=/^(?=[A-Za-z0-9_~.+/=-]*[a-z])(?=[A-Za-z0-9_~.+/=-]*[A-Z])(?=[A-Za-z0-9_~.+/=-]*\d)[A-Za-z0-9_~.+/=-]{24,}$/;function $e(e,t){e.lastIndex=0;const n=e.test(t);return e.lastIndex=0,n}function ao(e){const t=e.replace(/[ -]/g,"");if(t.length<13||t.length>19)return!1;let n=0,o=!1;for(let r=t.length-1;r>=0;r--){let c=t.charCodeAt(r)-48;o&&(c*=2,c>9&&(c-=9)),n+=c,o=!o}return n%10===0}function Ha(e){Jt.lastIndex=0;for(const t of e.matchAll(Jt))if(ao(t[0]))return!0;return!1}function At(e){let t=e;return t=t.replace(Jn,"data:[redacted]"),t=t.replace(Da,"$1 [redacted]"),t=t.replace(za,La),t=t.replace(qn,"[redacted:jwt]"),t=t.replace(Qn,"[redacted:key]"),t=t.replace(oo,"[redacted:key]"),t=t.replace(ro,"[redacted:url-cred]@"),t=t.replace(Gn,"[redacted:email]"),t=t.replace(Jt,n=>ao(n)?"[redacted:card]":n),t=t.replace(no,n=>`[redacted:b64:${n.length}]`),t=t.replace(eo,n=>`[redacted:b64:${n.length}]`),t=t.replace(to,n=>`[redacted:hex:${n.length}]`),t}const Wa=bt.query,Fa=bt.fragment;function Ba(e,t=[]){let n;try{const o=globalThis.location?.href;n=new URL(e,o)}catch{return At(e)}n.username="",n.password="";for(const o of[...n.searchParams.keys()]){if(Fa.includes(o)){n.searchParams.set(o,"[redacted]");continue}if(Wa.includes(o))continue;if(!t.includes(o)){n.searchParams.set(o,"[redacted]");continue}const r=n.searchParams.get(o)??"";At(r)!==r&&n.searchParams.set(o,"[redacted]")}return n.hash&&n.hash.length>1&&(n.hash=t.includes("#")?n.hash:"#[redacted]"),At(n.toString().replace(/%5Bredacted%5D/gi,"[redacted]"))}function ja(e){return e.length>120?!0:$e(Gn,e)||$e(qn,e)||$e(Qn,e)||$e(to,e)||$e(eo,e)||$e(Jn,e)||$e(no,e)||$e(oo,e)||$e(ro,e)||Na.test(e)||Ha(e)}const kt={id:"rev_local",name:B("author.unknown"),kind:"guest"},Ua="0.0.0";function so(e,t){if(e)return{...kt,name:e,...t?{email:t}:{}};try{const n=localStorage.getItem(le.identity);if(n)return{...kt,name:n[0]==="{"?JSON.parse(n).name??kt.name:n}}catch{}return kt}function Za(e){return`SN-${e.reduce((n,o)=>{const r=Number(o.key.split("-")[1]??0);return Number.isFinite(r)&&r>n?r:n},0)+1}`}let qt=null;const ve=e=>Nr(e,qt);function Va(e,t){const n=vn(),o=n.ownerDocument??document,r=o.defaultView??window,c=t?.config?.site??"local",u=t?.emit??(()=>{}),s=t?.assetBase??"./",d=t?.config?.env??"default";nt(n,"tokens",Fo);const y=jo(n.host,Bo(t?.config?.theme)),w={},C=t?.config?.storage==="local"?void 0:t?.config?.host,m=C&&c!=="local"?$a(C,c,t?.config?.env,{reviewToken:t?.reviewToken,onSessionEnded:a=>{ae.show(a==="revoked"?"error.linkrevoked":"error.sessionended")},onSessionStarted:()=>ae.hide()}):pa(c,d,{put:(a,i)=>w.put(a,i),del:a=>w.del(a)}),f=ya(c,d);let g=null;m.init({uid:c,env:d}).then(a=>{g=a.rounds??null,U?.update(x()),a.writable===!1&&a.reason==="origin_not_allowed"&&ae.show("error.origin",void 0,{origin:location.origin})}).catch(()=>{});let p=[],E=[];const D=ha();let O=null,V=null,re=!1,Y=!1,Ee=!1,ee=null,te=!1;const Pe={get:()=>O,unavailable:()=>Y||Ee,newPass:()=>V?.createPassCaches(),fuzzyHit:a=>ee?.hit(a)??null,wantFuzzy:(a,i)=>{if(ee){ee.enqueue(a,i,()=>Q());return}te||!V||!i.text?.exact||i.text.exact.length<8||(te=!0,_e("anchor-fuzzy",s,o).then(h=>{if(!h.ok||!V){Ee=!0,Q();return}ee=h.mod.createFuzzyEngine(o,V.fuzzyDeps),Te()}))},want:a=>{re||!(a.role&&a.accessibleName)&&!a.text?.exact&&!a.path?.length||(re=!0,_e("anchor-ext",s,o).then(i=>{if(!i.ok){Y=!0,Q();return}V=i.mod,O=i.mod.resolveExtended,Te()}))}};let pe=null,l=Er();const _=()=>l.statuses.length>0||!!l.by||!!l.page||l.read!=="all",S=gr(n,a=>{if(M==="add"){if(N?.hasText()){N.pulse();return}N?.close(),N=null,fe("comments")}v(a.id)},Pe,a=>{pe=a,U?U.update(x()):v()});let M=(()=>{try{return sessionStorage.getItem(le.mode)==="comments"?"comments":"browse"}catch{return"browse"}})(),N=null,U=null,G=null,Fe=!1,we=null,Be=!1,$t=null,Ce=null,xe=null,Me=!1;function de(){return xe?Promise.resolve(xe):Me?Promise.resolve(null):_e("capture",s,o).then(i=>i.ok?(w.put=i.mod.putBlob,w.del=i.mod.deleteBlob,xe=i.mod):(Ke(new Error("chunk unavailable")),null))}function Ke(a){Me||(Me=!0,M==="add"&&fe("comments"),J.setDegraded(!0),ae.show("error.capture",{label:"action.retry",run:()=>{Me=!1,J.setDegraded(!1),de()}}),console.warn(`[${be}] the capture chunk failed to load`,a))}let Je=0;function ze(){const a=new URL(s,o.location.href).href,i=new URL(Re.panels,a);return i.searchParams.set("cv",Ua),Je>0&&i.searchParams.set("r",String(Je)),Je++,import(i.href)}async function Se(){if(Be)return null;if(we)return we.catch(()=>null);we=ze().catch(async()=>(await new Promise(a=>setTimeout(a,1e3)),ze()));try{return $t=await we}catch(a){return we=null,it(a),null}}function it(a){Be=!0,M==="add"&&fe("comments"),J.setDegraded(!0),ae.show("error.panels",{label:"action.retry",run:()=>{Be=!1,J.setDegraded(!1),v(G)}}),console.warn(`[${be}] the panels chunk failed to load`,a)}const Ae=o.defaultView?.matchMedia?.("(pointer: coarse)").matches??!1;let ie=null;async function Et(){if(ie)return;const a=await de();!a||ie||(ie=a.createAddChrome(n,Ae,{pick:(i,h)=>void $(i,h),announce:Qe}),ie.setActive(M==="add"))}const ue=o.createElement("div");ue.style.cssText=`position:fixed;left:0;top:0;pointer-events:none;z-index:${Ve.dock}`,n.appendChild(ue);const ct=_r(r,ue,a=>J.setPuck(a>1.2)),ae=br(n,ue),je=wr(n,ue),A=qo(n,{onPick:(a,i)=>void $(a,i),onHover:a=>a?ie?.show(a):ie?.clear(),onSelectStart:()=>{Ae||nn()}});async function $(a,i){if(N?.hasText()){N.pulse();return}N?.close();const[h,R]=await Promise.all([Se(),de()]);if(!h||!R)return;const F=R.captureContext({page:R.derivePageRef(o.location,ht()),...mt()});hn(a);const Z=R.deriveAnchorLabel(a);b(h,a,i,F,Z,R)}function b(a,i,h,R,F,Z,j,He){let ge=i;pt=!1;const he=ve(o);_t=!1;const gt=()=>{N=null,Bn(he),J.setDraft(Ut()),fe("comments")},tt=()=>{et?.abort(),Ne=et=null,gt()},ye={at:h,label:F,...j?{initialBody:j.body,initialName:j.author,...j.email?{initialEmail:j.email}:{}}:{},onDraft:(oe,se,yt)=>{const So=ea({route:he,body:oe,author:se,...yt?{email:yt}:{},label:F,anchor:He??Z.createElementAnchor(i,{point:h,viewportWidth:r.innerWidth,label:F,...Z.describeElement(i)}),at:{x:h.x+r.scrollX,y:h.y+r.scrollY},savedAt:new Date().toISOString()});J.setDraft(Ut()),!So&&!_t&&(_t=!0,sn())},onSend:(oe,se,yt)=>{gt(),cn(ge,h,R,oe,se,yt,He)},onRetarget:oe=>{const se=oe==="up"?Z.widen(ge):Z.narrow(ge);se&&(ge=se,ie?.show(se),N?.setLabel(Z.deriveAnchorLabel(se)))},...ce&&Ge!==!1?{onShotOptIn:oe=>pt=oe}:{},onCancel:tt,crumbsOn:fn!==!1,shotsOn:Ge!==!1,...C&&c!=="local"?{serverHost:new URL(C).host}:{},...C&&m.adoptSession?{studio:{host:C,uid:c,env:t?.config?.env,member:m.member(),adopt:oe=>m.adoptSession(oe),signOut:()=>m.signOut()}}:{},...He?.text?.exact?{quote:He.text.exact}:{}};N=a.openComposer(n,ye,ue),q()}async function H(){const a=ve(o),i=ta(a);if(J.setDraft(Ut()),!i||N)return;const[h,R]=await Promise.all([Se(),de()]);if(!h||!R)return;const F=Ft(i.anchor,o,{viewportWidth:r.innerWidth,...O?{extended:O}:{}});if(!F.element)return;const Z=F.element.getBoundingClientRect();if(Z.width===0&&Z.height===0)return;const j={x:i.at.x-r.scrollX,y:i.at.y-r.scrollY};fe("add"),b(h,F.element,j,R.captureContext({page:R.derivePageRef(o.location,ht()),...mt()}),i.label,R,{body:i.body,author:i.author,...i.email?{email:i.email}:{}})}async function v(a=null){if(a&&a!==G&&u("thread:open",{threadId:a}),a&&f.mark(a),G=a,Fe=!0,M==="browse"&&fe("comments"),U){U.update(x());return}if(!await Se())return;const h=await _e("dock",s,o);if(!h.ok){ae.show("error.panels",{label:"action.retry",run:()=>void v(G)});return}!Fe||U||(Ce=h.mod,U=h.mod.openDock(n,x(),ue),q())}function z(){f.markAll(p),l.newOnly&&(l={...l,newOnly:!1}),Fe=!1,U?.close(),U=null,G=null,S.highlight(null),q(),_()&&Q()}function T(a){const i=a?p.find(h=>h.id===a):void 0;if(i&&i.route!==ve(o)){kr(r,i.id),r.location.assign(i.route);return}a&&f.mark(a),G=a,S.highlight(null),_()?Q():U?.update(x()),i&&Ce?.scrollToSnag(r,n,i)}function x(){return{snags:p,route:ve(o),openId:G,seenAt:f.map(),onOpen:T,onStatus:(a,i)=>void uo(a,i),onReply:(a,i,h)=>void fo(a,i,h),onEdit:(a,i)=>void X(a,i),onDeleteComment:a=>void L(a),onDeleteThread:a=>void W(a),...m.isMine?{isMine:a=>m.isMine(a)}:{},...C&&m.adoptSession?{studio:{host:C,uid:c,env:t?.config?.env,member:m.member(),adopt:a=>m.adoptSession(a),signOut:()=>m.signOut()}}:{},canDeleteOwnThread:m.can?m.can("thread:delete:own"):!0,canModerate:m.canModerate?.()??!1,onClearAll:()=>void K(),onClose:z,onExport:Rt,onHover:a=>S.highlight(a),...g&&g.length>1&&m.setRound?{rounds:g,activeRound:m.getRound?.()??g.find(a=>!a.closed)?.number??g[0].number,onRound:a=>{m.setRound(a),Te()}}:{},onAnnounce:Qe,loadShot:a=>Ea(a,async i=>{const h=await de();return h?(await h.getBlob(i))?.blob??null:null}),filter:l,onFilter:a=>{const i=a.statuses.join()!==l.statuses.join()||a.by!==l.by||a.page!==l.page||a.read!==l.read;l=a,i?Q():U?.update(x())},...pe?{clusterFilter:pe}:{},onClusterClear:()=>{pe=null,U?.update(x())},onShowAnyway:a=>{S.showGhost(a),Ce?.scrollToSnag(r,n,a)}}}async function ne(a,i){const h=p;p=a,Q();try{await Le(i)}catch{p=h,Q(),ae.show("error.sendfailed",void 0,{item:"change"})}}async function X(a,i){await ne(p.map(h=>({...h,comments:h.comments.map(R=>R.id===a?{...R,body:i}:R)})),()=>m.patchComment(a,i))}async function L(a){await ne(p.map(i=>({...i,comments:i.comments.filter(h=>h.id!==a)})),()=>m.deleteComment(a))}async function W(a){const i=G;G===a&&(G=null),await ne(p.filter(h=>h.id!==a),()=>m.deleteThread(a)),p.some(h=>h.id===a)&&(G=i)}async function K(){const a=p.map(i=>i.id);p=[],G=null,Q(),await Promise.all(a.map(i=>Le(()=>m.deleteThread(i))))}const J=ia(n,{onState:a=>fe(a),onPanel:()=>U?z():void v(),onNav:a=>en(a),parent:ue}),ce=r.matchMedia?.("(pointer: coarse)").matches??!1,q=()=>{ce&&J.setConcealed(!!N||!!U)};let me=null,Oe=[];function lt(a){let i=!1;const h=()=>{i||(i=!0,r.removeEventListener("scrollend",h),a())};r.addEventListener("scrollend",h,{once:!0}),r.setTimeout(h,600)}const qe=o.createElement("div");qe.setAttribute("aria-live","polite"),qe.setAttribute("role","status");const Qt="position:absolute;width:1px;height:1px;overflow:hidden";qe.style.cssText=Qt;const Ct=o.createElement("div");Ct.setAttribute("aria-live","assertive"),Ct.style.cssText=Qt,n.append(qe,Ct);let Gt=0;function Qe(a){r.clearTimeout(Gt),Gt=r.setTimeout(()=>{qe.textContent=a},400)}function en(a){const i=Oe.length;if(i===0)return;me=me===null?a===1?0:i-1:(me+a+i)%i;const h=Oe[me];la(r,n,h);const R=me+1;lt(()=>{S.pulse(h.id),Qe(B("nav.announce",{n:R,label:h.anchor.label,i:R,total:i}))})}function tn(){if(M!=="comments"||Ae){ke?.disarm();return}nn().then(a=>{a&&M==="comments"&&a.arm()})}let ke=null,Tt=null;async function nn(){if(ke)return ke;const a=await _e("text",s,o);return!a.ok||ke||(Tt=a.mod,ke=a.mod.createSelectionWatcher(n,{onQuote:(i,h)=>void io(i,h)})),ke}async function io(a,i){const h=xe??await de();if(!h||!Tt)return;const R=Tt.createTextAnchor(a,h,{viewportWidth:r.innerWidth,ourRoot:n});if(R.kind==="refused-form-control"){$(R.el,i);return}if(R.kind!=="text")return;const F=await Se();if(!F)return;const Z=h.captureContext({page:h.derivePageRef(o.location,ht()),...mt()});try{a.removeAllRanges()}catch{}b(F,R.el,R.point,Z,R.label,h,void 0,R.record)}function fe(a,i=!1){const h=M;M=a,a!=="add"&&N&&!i&&(N.close(),N=null),a==="add"&&U&&z(),a==="add"&&(Se(),de());try{sessionStorage.setItem(le.mode,a==="add"?"comments":a)}catch{}A.setMode(a),a!==h&&Qe(B(`toolbar.${a}`)),q(),a==="add"&&Et(),tn(),ie?.setActive(a==="add"),J.setState(a),Q(),a!==h&&u("modechange",{mode:a,previous:h})}let Ue=0,on=0;const rn=[300,800,1600,3200];function co(){if(Ue||!S.hasPending()){S.hasPending()||(on=0);return}const a=rn[Math.min(on++,rn.length-1)];Ue=r.setTimeout(()=>{Ue=0,Q()},a)}const lo=3e3;let an=0;function Q(a){const i=a??(Date.now()<an?"navigating":"authoritative");E=S.reanchor(p.filter(vo()),i),bo(),co();const h=new Map(E.map(j=>[j.id,j]));p=p.map(j=>h.get(j.id)??j);const R=_()?new Set(E.filter(j=>!Tr(j,l,f.map())&&j.id!==G).map(j=>j.id)):void 0;Oe=R?E.filter(j=>!R.has(j.id)):E,S.render(M==="browse"?[]:E,R);const F=ve(o),Z=D?Ia(o.location.origin,p,F):null;J.setCount(Z?Pa(Z,F):D?E.filter(j=>j.status!=="resolved").length:null),me!==null&&me>=Oe.length&&(me=null),U?.update(x())}async function Te(){const{data:a}=await m.listThreads();p=a,Q();const i=S.settled();for(const h of i)u("anchor:settled",{threadId:h.id,state:h.state,strategy:h.strategy,confidence:h.confidence});return m.capabilities.anchorReports&&m.reportAnchors&&i.length&&Le(()=>m.reportAnchors(i.map(h=>({threadId:h.id,state:h.state,confidence:h.confidence,strategy:h.strategy})))),m.capabilities.anchorReports||await Promise.all(a.flatMap(h=>{const R=p.find(F=>F.id===h.id);return!R||R.anchorState===h.anchorState?[]:[Le(()=>m.patchThread(R.id,{anchor:R.anchor,anchorState:R.anchorState}))]})),E}async function uo(a,i){p=p.map(h=>h.id===a?{...h,status:i}:h),Q(),u("thread:resolve",{threadId:a,status:i}),await Le(()=>m.patchThread(a,{status:i}))}async function fo(a,i,h){const R={id:Zn(),body:i,author:so(h)};p=p.map(F=>F.id===a?{...F,comments:[...F.comments,{...R,snagId:a,createdAt:new Date().toISOString()}]}:F),f.mark(a),Q(),u("comment:create",{threadId:a,comment:R}),await Le(()=>m.createComment(a,R))}function sn(){ae.show("error.quota",{label:"action.exportclear",run:()=>{Rt("json"),K()}}),console.warn(`[${be}] ${B("error.quota")}`)}async function Le(a){try{return await a()}catch(i){if(i instanceof Dt&&i.code==="local_quota_exceeded")return sn(),null;throw i}}function Rt(a){de().then(async i=>{if(!i)return;const h=await i.resolveAttachmentUris(p).catch(()=>new Map);i.download(n,i.buildExport(a,p,{origin:o.location.origin,exportedAt:new Date().toISOString()},h),r)})}async function cn(a,i,h,R,F,Z,j){const He=so(F,Z),ge=xe??await de();if(!ge)throw new Error(`[${be}] add() needs the capture chunk`);Ne||hn(a);const he=Ne?await Ne:null;Ne=et=null,ge.applyShotOutcome(h,he,Ge===!1,ce&&!pt);const gt=he?.blob&&m.uploadAttachment?m.uploadAttachment(he.blob,{kind:"screenshot",...he.width!==void 0?{width:he.width}:{},...he.height!==void 0?{height:he.height}:{}}).catch(()=>null):Promise.resolve(null),tt={id:da(),key:Za(p),route:ve(o),anchor:j??ge.createElementAnchor(a,{point:i,viewportWidth:r.innerWidth,label:ge.deriveAnchorLabel(a),...ge.describeElement(a)}),anchorState:"anchored",scope:go(),context:h,createdBy:He,createdAt:new Date().toISOString(),...R?{comment:{id:Zn(),body:R,author:He}}:{}},ye=Cn(tt);he?.blob&&(ye.screenshotBlob=he.blob),p=[...p,ye],f.mark(ye.id),Qe(B("announce.created",{key:ye.key})),u("thread:create",{thread:ye}),M==="browse"?fe("comments"):Q();try{const oe=await gt;oe&&(tt.attachments=[oe],p=p.map(se=>se.id===ye.id?{...se,attachments:[oe]}:se),Q()),await Le(()=>m.createThread(tt))}catch(oe){throw p=p.filter(se=>se.id!==ye.id),Q(),ae.show("error.sendfailed",void 0,{item:Pt.toLowerCase()}),console.warn(`[${be}] ${B("error.sendfailed",{item:Pt.toLowerCase()})}`,oe),oe}return ye}function ln(a){if((a.key==="n"||a.key==="p")&&M==="comments"&&!N){if(a.metaKey||a.ctrlKey||a.altKey)return;const i=a.composedPath()[0]??a.target;if(i&&(i.closest?.("input,textarea,select,[contenteditable]")||i.isContentEditable))return;a.preventDefault(),a.stopPropagation(),en(a.key==="n"?1:-1);return}M==="add"&&a.key==="Escape"&&(N||(a.stopPropagation(),fe("comments")))}o.addEventListener("keydown",ln,!0);let dn=0;const un=()=>{if(o.hidden||!m.revalidate)return;const a=Date.now();a-dn<3e4||(dn=a,m.revalidate())};o.addEventListener("visibilitychange",un);const ho=Oo(n),po=Lo(n,a=>{console.warn(`[${be}] the host page hid the widget from assistive technology ${a} times; leaving it alone.`)}),mo=zo(n,a=>{console.warn(`[${be}] the host page removed the widget ${a} times; leaving it alone. Reload to comment again.`)});function go(){return{environment:d,...t?.config?.branch?{branch:t.config.branch}:{}}}let dt={route:ve(o),url:o.location.href},_t=!1,ut=null;function yo(a){if(a){if(M==="browse")return;ut=M,fe("browse",!0),je.show(),u("paused",{reason:"modal-dialog"})}else if(ut){const i=ut;ut=null,je.hide(),fe(i),u("resumed",{mode:i})}}Se();function bo(){E.length>0&&_e("dock",s,o)}{const a=o.createElement("div");a.style.cssText="position:fixed;inset:0;pointer-events:none;visibility:hidden",n.appendChild(a);const i=a.getBoundingClientRect(),h=Math.abs(i.left)>1||Math.abs(i.top)>1||Math.abs(i.width-r.innerWidth)>1||Math.abs(i.height-r.innerHeight)>1;a.remove(),h&&(console.warn(`[${be}] fixed-trapped: <html> has transform/filter/contain, so our fixed layer follows it, not the viewport. Remove it, or expect drift.`),u("error",{code:"fixed-trapped"}))}let Ze=null;const ft=new Set,De=(()=>{const a=r[Eo.config];return a&&typeof a=="object"?a:void 0})(),fn=De?.breadcrumbs,It=(()=>{const a=De?.significantQueryParams,i=De?.ignoredQueryParams,h={};return a==="*"?h.significantQueryParams="*":Array.isArray(a)&&(h.significantQueryParams=a.map(String)),Array.isArray(i)&&(h.ignoredQueryParams=i.map(String)),h})(),ht=()=>({routeOverride:qt,query:It,doc:o}),Ge=De?.screenshot===!1?!1:De?.screenshot&&typeof De.screenshot=="object"?De.screenshot:{};let pt=!1,Ne=null,et=null;function hn(a){if(Ge===!1||Ne||ce&&!pt)return;et=new AbortController;const i=et.signal;Ne=_e("screenshot",s,o).then(h=>h.ok?h.mod.captureScreenshot({doc:o,target:a,signal:i,...Ge,...m.fetchForeignImage?{fetchForeignImage:R=>m.fetchForeignImage(R)}:{}}):{situation:"engine-load-failed",blindSpots:[],maskedCount:0})}function vo(){const a=ve(o),i=Hn(o.location.pathname),h=Br(o.location.search,It);return R=>(R.route===a||R.context?.page?.pathname===i)&&jr(R.context?.page?.query,h,It)}{const a=fn;a!==!1&&_e("crumbs",s,o).then(i=>{i.ok&&(Ze=i.mod.installTierC({win:r,...t?.early?{early:t.early}:{},...a&&typeof a=="object"?{config:a}:{},subscribeNav:h=>(ft.add(h),()=>ft.delete(h))}))})}const mt=()=>Ze?{breadcrumbs:{records:Ze.drain(),status:Ze.status()}}:{},wo=Xr(o,r,()=>{M!=="browse"&&E.length>0&&Q()}),xo=Ar(r,{onResize:()=>Q(),onRoute:()=>{const a={route:ve(o),url:o.location.href},i=a.route!==dt.route;if(i){u("navigate",{from:dt,to:a});for(const h of ft)h(dt.url,a.url)}if(dt=a,!i){Te();return}an=Date.now()+lo,r.setTimeout(()=>{m.listThreads().then(({data:h})=>{p=h,Q("optimistic")})},100),r.setTimeout(()=>void Te(),600)},onModal:yo});return J.setState(M),A.setMode(M),tn(),D||ae.show("error.nostorage",{label:"action.export",run:()=>Rt("md")}),Te().then(async a=>{const i=$r(r);if(!i){const R=new URLSearchParams(o.location.search).get(Io("t"));if(R){let F=a.find(Z=>Z.key===R);if(!F&&m.getThreadByKey){const Z=await m.getThreadByKey(R).catch(()=>null);Z&&(p=[...p.filter(j=>j.id!==Z.id),Z],Q(),F=p.find(j=>j.id===Z.id))}F?(await v(F.id),Ce?.scrollToSnag(r,n,F)):(ae.show("permalink.unknown"),await v(null));return}await H();return}const h=a.find(R=>R.id===i);await v(h?i:null),h&&Ce?.scrollToSnag(r,n,h)}),{root:n,assetBase:t?.assetBase??"",snags:()=>E,async add(a,i,h,R){const F=R?null:await de(),Z=R??(F?F.captureContext({page:F.derivePageRef(o.location,ht()),...mt()}):void 0);if(!Z)throw new Error(`[${be}] add() needs the capture chunk, or an explicit context`);return cn(a,i,Z,h)},refresh:Te,setRoute(a){qt=a&&a.startsWith("/")?a:null,Te()},setState:fe,getState:()=>M,openPanel:v,async open(a){const i=a.startsWith(vt.thread)?p.find(h=>h.id===a):p.find(h=>h.key===a);return i?i.route!==ve(o)?{ok:!1,reason:"wrong-page",url:i.context?.url??i.route,route:i.route}:(await v(i.id),Ce?.scrollToSnag(r,n,i),{ok:!0,anchorState:i.anchorState}):{ok:!1,reason:"not-found"}},closePanel:z,hitTest:(a,i)=>A.hitTest(a,i),destroy(){N?.close(),z(),ie?.destroy(),ae.destroy(),je.destroy(),ct(),mo(),po(),ho(),xo.destroy(),wo.destroy(),Ze?.destroy(),Ze=null,ft.clear(),ke?.destroy(),ke=null,ee?.destroy(),ee=null,Ue&&r.clearTimeout(Ue),Ue=0,o.removeEventListener("keydown",ln,!0),o.removeEventListener("visibilitychange",un),y(),A.destroy(),S.destroy(),J.destroy(),n.host.remove()}}}export{yn as HOST_CSS,vn as createHost,ja as isSensitiveValue,Va as mount,At as redactText,Ba as redactUrl};
|
|
1
|
+
const we="Snagset",$o="snagset",pn="snagset.v1",Eo="Snagset",Pt="Snag",Co="Snags",To={config:"SnagsetConfig"},Ro={root:"data-snag-root"},Mt=e=>Ro[e],_o={anchor:"data-snag-anchor",ignore:"data-snag-ignore",mask:"data-snag-mask",nomask:"data-snag-nomask",src:"data-snag-src",component:"data-snag-component"},Io=e=>_o[e],P={font:"--snag-font",accent:"--snag-accent",onAccent:"--snag-onAccent",bg:"--snag-bg",fg:"--snag-fg",muted:"--snag-muted",border:"--snag-border",radius:"--snag-radius",shadow:"--snag-shadow",z:"--snag-z",motion:"--snag-motion",surface:"--snag-surface",sunken:"--snag-sunken",hover:"--snag-hover",focus:"--snag-focus",disabled:"--snag-disabled",statusOpen:"--snag-status-open",statusProgress:"--snag-status-progress",statusReview:"--snag-status-review",statusResolved:"--snag-status-resolved",anchorOrphan:"--snag-anchor-orphan",tbH:"--snag-tb-h",dockW:"--snag-dock-w",kb:"--snag-kb",thumbX:"--snag-thumb-x",thumbW:"--snag-thumb-w"},Po=e=>`var(${P[e]})`,Mo=e=>"snag_"+e,bt={query:["snag_t","snag_off","snag_debug","snag_theme"],fragment:["snag_k"]},zo="snag:disclosure:v1",zt="snag:identity",mn="data-snag-theme",de={session:e=>`snag:session:${e}`,silent:e=>`snag:silent:${e}`,identity:zt,threads:(e,t)=>`snag:threads:${e}:${t}`,seen:(e,t)=>`snag:seen:${e}:${t}`,counts:e=>`snag:counts:${e}`,draft:(e,t)=>`snag:draft:${e}:${t}`,outbox:e=>`snag:outbox:${e}`,mode:"snag:mode",handoff:"snag:handoff",seenCoach:"snag:seen-coach",disclosure:zo},Ie={panels:"snag.panels.js",crumbs:"snag.crumbs.js",capture:"snag.capture.js",screenshot:"snag.screenshot.js",anchorExt:"snag.anchor-ext.js",anchorFuzzy:"snag.anchor-fuzzy.js",dock:"snag.dock.js",text:"snag.text.js"},vt={thread:"thr_",comment:"cmt_",attachment:"att_"},Ot={attachmentKind:"x-snagset-attachment-kind",attachmentWidth:"x-snagset-attachment-width",attachmentHeight:"x-snagset-attachment-height"},Oo={route:"snagset:route"},gn={original:"snagset.original",wrapped:"snagset.wrapped"},yn="position:absolute!important;top:0!important;left:0!important;width:0!important;height:0!important;margin:0!important;padding:0!important;border:0!important;pointer-events:none!important;z-index:2147483647;isolation:isolate;color-scheme:light dark;";function bn(e){const t=e.ownerDocument.defaultView?.getComputedStyle(e);return t?t.transform!=="none"&&t.transform!==""||t.filter!=="none"&&t.filter!==""||t.perspective!=="none"&&t.perspective!==""||/transform|filter|perspective|contain/.test(t.willChange)||/paint|layout|strict|content/.test(t.contain)||t.containerType!==void 0&&t.containerType!=="normal"&&t.containerType!=="":!1}function Dt(e){const t=e.documentElement,n=e.body;return t&&bn(t)?{parent:n??t,trapped:!0}:n&&bn(n)?{parent:t??n,trapped:!1}:{parent:n??t,trapped:!1}}function vn(e=document){const t=Mt("root"),n=e.querySelector(`[${t}]`);if(n?.shadowRoot)return n.shadowRoot;const o=e.createElement("div");return o.setAttribute(t,""),o.style.cssText=yn,Dt(e).parent.appendChild(o),o.attachShadow({mode:"open"})}function Do(e,t,n=5){const o=e.ownerDocument??document,r=e.host,l=Dt(o).parent;if(typeof MutationObserver!="function"||!l)return()=>{};let u=0;const a=new MutationObserver(()=>{if(!r.isConnected){if(u++,u>n){a.disconnect(),t(u);return}Dt(o).parent.appendChild(r)}});return a.observe(l,{childList:!0}),()=>a.disconnect()}const wn=[["pointerdown",!0],["mousedown",!0],["touchstart",!0],["pointerup",!0],["mouseup",!0],["touchend",!0],["click",!0],["dblclick",!0],["focusin",!0],["focusout",!0]];function Lo(e){const t=e.host,n=o=>o.stopPropagation();for(const[o,r]of wn)t.addEventListener(o,n,{passive:r});return()=>{for(const[o]of wn)t.removeEventListener(o,n)}}function No(e,t,n=20){const o=e.host;if(typeof MutationObserver!="function")return()=>{};let r=0;const l=()=>{let a=!1;return o.getAttribute("aria-hidden")==="true"&&(o.removeAttribute("aria-hidden"),a=!0),o.hasAttribute("inert")&&(o.removeAttribute("inert"),a=!0),a},u=new MutationObserver(()=>{l()&&++r>n&&(u.disconnect(),t(r))});return l(),u.observe(o,{attributes:!0,attributeFilter:["aria-hidden","inert"]}),()=>u.disconnect()}const Ho={product:we,set:Eo,item:Pt,items:Co};function xn(e){return(t,n)=>(e[t]??"").replace(/\{(\w+)\}/g,(o,r)=>{const l=n?.[r]??Ho[r];return l===void 0?o:String(l)})}const Wo=e=>new Intl.NumberFormat().format(e),Sn={"where.anchored":"{label}","where.approximate":"position approximate \u2014 the page changed","where.orphaned":"moved \u2014 the element is gone","status.open":"Active","status.progress":"In progress","status.review":"In review","status.resolved":"Resolved","author.unknown":"Someone","label.image":"an image","label.link":"a link","label.button":"a button","label.tag":"the {tag}"},An=xn(Sn),kn={open:{colour:"#4f6ef7"},progress:{colour:"#f59e0b"},review:{colour:"#8b5cf6"},resolved:{colour:"#10b981"}},$n=e=>e==="open"||e==="review"?"#fff":"#16161a",En=e=>e in kn?An(`status.${e}`):e,Uo=e=>An(`where.${e.anchorState}`,{label:e.anchor.label});class Lt extends Error{code;constructor(t,n){super(n??t),this.name="AdapterError",this.code=t}}function Cn(e){return{id:e.id,key:e.key,route:e.route,...e.scope?{scope:e.scope}:{},...e.attachments?.length?{attachments:e.attachments}:{},anchor:e.anchor,anchorState:e.anchorState,context:e.context,status:"open",comments:e.comment?[{id:e.comment.id,snagId:e.id,body:e.comment.body,author:e.comment.author,createdAt:e.createdAt}]:[],createdBy:e.createdBy,createdAt:e.createdAt,updatedAt:e.createdAt}}const k=Object.fromEntries(Object.keys(P).map(e=>[e,Po(e)])),jo=Object.entries(kn).map(([e,t])=>` ${P[`status${e[0].toUpperCase()}${e.slice(1)}`]}:${t.colour};`).join(`
|
|
2
|
+
`),Fo=` :host{all:initial}[hidden]{display:none!important}:host{display:block;font:400 14px/1.45 ${k.font};color:${k.fg};${P.font}:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;${P.accent}:#2a51b8;${P.bg}:#fefdfc;${P.fg}:#181716;${P.muted}:#666564;${P.border}:#e4e3e0;${P.radius}:8px;${P.shadow}:0 6px 24px -4px rgb(0 0 0 / .18);${P.z}:2147483647;${P.motion}:160ms;${P.surface}:color-mix(in srgb,${k.fg} 6%,${k.bg});${P.sunken}:color-mix(in srgb,${k.fg} 3%,${k.bg});${P.hover}:color-mix(in srgb,${k.fg} 8%,${k.bg});${P.onAccent}:#fff;${P.focus}:color-mix(in srgb,${k.accent} 62%,${k.fg});${P.disabled}:color-mix(in srgb,${k.muted} 52%,${k.bg});${jo} ${P.anchorOrphan}:#DC2626;}:host([${mn}="dark"]){${P.accent}:#8aafff;${P.onAccent}:#1d1c1a;${P.bg}:#1d1c1a;${P.fg}:#f0eeec;${P.muted}:#9a9997;${P.border}:#2d2c2b;${P.shadow}:0 6px 24px -4px rgb(0 0 0 / .6);}@media (prefers-reduced-motion:reduce){:host{${P.motion}:0ms}}@media (forced-colors:active){:host{${P.bg}:Canvas;${P.fg}:CanvasText;${P.muted}:CanvasText;${P.border}:CanvasText;${P.accent}:Highlight;${P.onAccent}:HighlightText;${P.surface}:Canvas;${P.sunken}:Canvas;${P.hover}:Canvas;${P.focus}:Highlight;${P.disabled}:GrayText;${P.shadow}:none;${P.anchorOrphan}:CanvasText;}.snag-pin{border-color:CanvasText!important;color:CanvasText!important;forced-color-adjust:none}}`,Ve={shield:1,pins:3,dock:5,notice:6,toolbar:7},Tn=new WeakMap;function nt(e,t,n){let o=Tn.get(e);if(o||Tn.set(e,o=new Set),o.has(t))return;o.add(t);try{const u=new CSSStyleSheet;u.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,u];return}catch{}const l=(e.ownerDocument??document).createElement("style");l.setAttribute(`data-snag-${t}`,""),l.textContent=n,e.appendChild(l)}function Bo(e){return e==="light"||e==="dark"?e:"auto"}function Zo(e,t){const n=mn;if(t!=="auto")return e.setAttribute(n,t),()=>e.removeAttribute(n);const o=e.ownerDocument?.defaultView?.matchMedia?.("(prefers-color-scheme: dark)");if(!o)return e.setAttribute(n,"light"),()=>e.removeAttribute(n);const r=()=>e.setAttribute(n,o.matches?"dark":"light");return r(),o.addEventListener("change",r),()=>{o.removeEventListener("change",r),e.removeAttribute(n)}}function Nt(e){return e.getBoundingClientRect()}function wt(e){if(e.closest('[inert],[aria-hidden="true"]'))return!1;const t=e.checkVisibility;if(typeof t=="function")return t.call(e,{contentVisibilityAuto:!0,opacityProperty:!1,visibilityProperty:!0});const n=Nt(e);if(!(n.width>0||n.height>0||e.getClientRects().length>0))return!1;const r=e.ownerDocument?.defaultView;return r?r.getComputedStyle(e).visibility!=="hidden":!0}const Vo="button,a[href],[role=button],[role=link],[role=tab],[role=menuitem],label,input,select,textarea,summary",Yo=3,Rn=8,Xo=new Set(["img","picture","canvas","video","audio","iframe","embed","object","svg","math","input","select","textarea","button","progress","meter"]);function Ko(e,t){return Xo.has(e.tagName.toLowerCase())?!1:t.getComputedStyle(e).display==="inline"}function _n(e){const t=e.ownerDocument?.defaultView;if(!t)return e;let n=e;for(let r=e;r;r=r.parentElement){const l=Nt(r);if(l.width>=Rn&&l.height>=Rn&&!Ko(r,t)){n=r;break}n=r}let o=0;for(let r=n;r&&o<=Yo;r=r.parentElement){if(r.matches(Vo))return r;o++}return n}const Jo=10,Ht=[["click",!1],["auxclick",!1],["dblclick",!1],["pointerdown",!1],["pointerup",!1],["mousedown",!1],["mouseup",!1],["contextmenu",!1],["dragstart",!1],["wheel",!1],["touchstart",!0],["touchmove",!0],["touchend",!0],["selectstart",!0],["keydown",!1],["keyup",!1]];function qo(e,t,n){let o=e;for(;o&&o!==o.ownerDocument.documentElement&&o!==o.ownerDocument.body;){const r=getComputedStyle(o),l=(r.overflowY==="auto"||r.overflowY==="scroll")&&o.scrollHeight>o.clientHeight&&(t>0&&o.scrollTop+o.clientHeight<o.scrollHeight-1||t<0&&o.scrollTop>0),u=(r.overflowX==="auto"||r.overflowX==="scroll")&&o.scrollWidth>o.clientWidth&&(n>0&&o.scrollLeft+o.clientWidth<o.scrollWidth-1||n<0&&o.scrollLeft>0);if(l||u)return o;o=o.parentElement}return null}function In(e,t){const n=t==="y"?e.deltaY:e.deltaX;return e.deltaMode===1?n*16:e.deltaMode===2?n*(t==="y"?innerHeight:innerWidth):n}const Qo=["position:fixed","inset:0",`z-index:${Ve.shield}`,"touch-action:pan-x pan-y pinch-zoom","background:transparent"].join(";");function Go(e,t={}){const n=t.doc??e.ownerDocument??document,o=n.defaultView??window;let r=t.coarsePointer??o.matchMedia?.("(pointer: coarse)").matches??!1;const l=c=>{const R=c.pointerType,w=R==="touch"?!0:R==="mouse"||R==="pen"?!1:r;w!==r&&(r=w,d())},u=n.createElement("div");u.className="snag-shield",u.style.cssText=Qo;let a="browse";const d=()=>{u.style.pointerEvents=r?"none":"auto",u.style.cursor="crosshair"};d();const g=c=>{const R=c;return!R||typeof R.closest!="function"?!1:e.contains(R)?!0:!!R.closest(`[${Mt("root")}]`)};function v(c,R,w){let I=w,O=0;for(;I.shadowRoot&&O++<Jo;){const W=C(I.shadowRoot,c,R);if(!W||W===I)break;I=W}return I}function C(c,R,w){const I=c.elementsFromPoint;if(typeof I=="function"){for(const W of I.call(c,R,w))if(W.getRootNode()===c)return W;return null}const O=c.elementFromPoint(R,w);return O&&O.getRootNode()===c?O:null}function p(c,R){const w=[];for(const I of n.elementsFromPoint(c,R)){if(g(I))continue;if(I===n.documentElement||I===n.body){w.push(I);continue}const O=v(c,R,I);w.push(g(O)?I:O)}return w}let _=null;const B=(c,R)=>{const[w]=p(c,R);w&&t.onPick?.(_n(w),{x:c,y:R})};let S=!1;const M=()=>{const c=n.getSelection?.();if(!c||c.isCollapsed||c.rangeCount===0||!c.toString().trim())return!1;const R=c.anchorNode;if(!R||e.contains(R))return!1;const w=R.nodeType===1?R:R.parentElement;return!g(w)},G=c=>{const R=c.composedPath()[0];if(R&&g(R)){S=!1;return}if(c.type==="selectstart"){t.onSelectStart?.();return}const w=c.type;if(w.endsWith("down")||w.endsWith("start")){S=!1;return}if(w.endsWith("up")||w.endsWith("end")){S=M();return}if(w==="click"||w==="auxclick"){if(!S)return;S=!1,c.preventDefault(),c.stopImmediatePropagation()}},q=c=>{if(c.type==="pointerdown"&&l(c),a==="comments"){G(c);return}if(a!=="add")return;if(c.type==="keydown"||c.type==="keyup"){z(c);return}const R=c.composedPath()[0];if(R&&R!==u&&g(R))return;const w=Ht.find(([I])=>I===c.type)?.[1]??!1;if(c.stopImmediatePropagation(),!w){if(r&&c.type==="pointerdown"){const I=c;_={x:I.clientX,y:I.clientY,t:performance.now()},ae(I.clientX,I.clientY)}if(r&&c.type==="pointerup"&&_){const I=c,O=_;_=null,Math.hypot(I.clientX-O.x,I.clientY-O.y)<=8&&performance.now()-O.t<=700&&B(I.clientX,I.clientY);return}if(c.type==="click"||c.type==="auxclick"||c.type==="dblclick"){c.preventDefault();const I=c;B(I.clientX,I.clientY);return}if(c.type==="wheel"){const I=c,O=In(I,"y"),W=In(I,"x"),[K]=p(I.clientX,I.clientY),re=qo(K??null,O,W);re&&(re.scrollTop+=O,re.scrollLeft+=W,c.preventDefault());return}if(c.type==="dragstart"||c.type==="contextmenu"){c.preventDefault();return}(c.type==="pointerdown"||c.type==="mousedown")&&!r&&c.preventDefault()}},Z=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," ","Spacebar","PageUp","PageDown","Home","End"]),h=/^[a-z0-9/?]$/;function m(c){for(const R of c.composedPath()){const w=R;if(!(!w||w.nodeType!==1||typeof w.matches!="function")&&w.matches('input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]),textarea,select,[contenteditable=""],[contenteditable=true],[role=textbox],[role=searchbox],[role=combobox]'))return!0}return!1}function z(c){Z.has(c.key)||c.metaKey||c.ctrlKey||c.altKey||/^F\d{1,2}$/.test(c.key)||c.key!=="Escape"&&c.key.length===1&&h.test(c.key.toLowerCase())&&!m(c)&&(c.preventDefault(),c.stopImmediatePropagation())}for(const[c,R]of Ht)o.addEventListener(c,q,{capture:!0,passive:R});let L=0,N=null;function Y(){if(L=0,a!=="add"||!N)return;const[c]=p(N.x,N.y);t.onHover?.(c?_n(c):null)}function ae(c,R){a==="add"&&(N={x:c,y:R},!L&&(L=o.requestAnimationFrame(Y)))}return u.addEventListener("pointermove",c=>ae(c.clientX,c.clientY)),u.addEventListener("pointerleave",()=>{N=null,t.onHover?.(null)}),{shield:u,getMode:()=>a,setMode(c){a=c,S=!1,d(),c==="add"?e.appendChild(u):u.remove(),c!=="add"&&(N=null,t.onHover?.(null))},hitTest:p,destroy(){L&&o.cancelAnimationFrame(L);for(const[c]of Ht)o.removeEventListener(c,q,{capture:!0});u.remove()}}}const er=/[\u200B-\u200D\u2060\uFEFF]/gu,tr=/[\s\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+/gu,nr=[[/[\u2018\u2019\u201A\u201B]/gu,"'"],[/[\u201C\u201D\u201E\u201F]/gu,'"'],[/[\u2010-\u2015\u2212]/gu,"-"],[/\u2026/gu,"..."],[/\u2044/gu,"/"]];function or(e){let t=e.normalize("NFC").replace(er,"");for(const[n,o]of nr)t=t.replace(n,o);return t.replace(tr," ").trim()}const rr={testid:1,domid:1,css:.9,aria:.75,"text-exact":.8,"text-fuzzy":.78,"path-rect":.35,none:0,manual:1},Pn={anchored:.75,approximate:.35};function sr(e,t){const n=rr[e];return t===1?n:n/(1+Math.log2(t))}function Mn(e){return e>=Pn.anchored?"anchored":e>=Pn.approximate?"approximate":"orphaned"}const ar=[Io("anchor"),"data-testid","data-test-id","data-test","data-cy","data-qa","data-pw","data-automation-id"],zn=e=>typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&"),ir=[{strategy:"testid",applicable:e=>!!e.testid,find:(e,t)=>Wt(t,ar.map(n=>`[${n}="${zn(e.testid)}"]`).join(","))},{strategy:"domid",applicable:e=>!!e.domid,find:(e,t)=>Wt(t,`#${zn(e.domid)}`)},{strategy:"css",applicable:e=>!!e.css,find:(e,t)=>{try{return Wt(t,e.css)}catch{return[]}}}];function Wt(e,t){return[...e.querySelectorAll(t)].filter(cr)}function cr(e){return!e.closest(`[${Mt("root")}]`)}function lr(e,t){const n=t.text?.exact;if(!n)return!0;const o=or(e.textContent??"");return o?o===n||o.includes(n)||n.includes(o):!0}function On(e,t,n,o){wt(e)||o.push("hidden"),t.hostPath?.length&&o.push("shadow-boundary");const r=!lr(e,t);r&&o.push("text-drift");let l=o.includes("hidden")?Math.min(n,.7):n;return r&&(l=Math.min(l,.5)),l}const dr={element:null,strategy:"none",score:0,state:"orphaned",reasons:["not-found"],candidates:0};function Ut(e,t=document,n={}){const o=[];for(const r of ir){if(!r.applicable(e))continue;const l=r.find(e,t);if(l.length===0)continue;const u=sr(r.strategy,l.length),a=l[0];l.length>1&&o.push("ambiguous");const d=On(a,e,u,o),g={element:a,strategy:r.strategy,score:d,state:Mn(d),reasons:o.length?o:["exact"],candidates:l.length};if(g.reasons.includes("text-drift")&&n.extended){const v=n.extended(e,t,{...n.viewportWidth===void 0?{}:{viewportWidth:n.viewportWidth},...n.passCaches?{caches:n.passCaches}:{}});if(v&&v.score>g.score)return v}return g}return n.extended?.(e,t,{...n.viewportWidth===void 0?{}:{viewportWidth:n.viewportWidth},...n.passCaches?{caches:n.passCaches}:{}})??dr}const ur={"toolbar.aria":"{product} review toolbar","toolbar.group":"What you see","toolbar.browse":"Browse","toolbar.comments":"Comment","toolbar.comments.unresolved":"Comment, {n} unresolved","toolbar.add":"Add a comment","toolbar.add.draft":"Add a comment \u2014 one is unfinished","toolbar.panel":"All comments","pin.aria":"Comment {key} on {target}. {status}, {replies} replies. Press Enter.","pin.aria.one":"Comment {key} on {target}. {status}, 1 reply. Press Enter.","pin.aria.none":"Comment {key} on {target}. {status}. Press Enter.","pin.aria.moved":"Comment {key} on {target}. {status}. {where}. Press Enter.","pin.target":"{role} \u201C{name}\u201D","cluster.aria":"{n} comments here: {list}","nav.announce":"Comment {n} on {label}, {i} of {total}","action.retry":"Retry","action.dismiss":"Dismiss","action.export":"Export","action.exportclear":"Export & clear","error.quota":"Storage is full \u2014 this {item} is on screen but not saved. Export to keep them.","error.nostorage":"Comments won't be saved in this browser. Export before you leave to keep them.","error.linkrevoked":"This review link was turned off. Ask whoever sent it for a new one.","error.sessionended":"This review session has ended. Open your review link again to carry on.","error.sendfailed":"That {item} couldn't be sent, so it wasn't kept. Check your connection and try again.","error.origin":"{product} is not enabled for {origin}. Add that address to the site's allowed origins.","error.panels":"{product} loaded, but its comment UI didn't. You can still see the comments on the page.","error.panels.add":"Adding comments is unavailable until the comment UI loads.","error.capture":"{product} can't take new comments \u2014 the part that records the page didn't load. Everything already here still works.","paused.dialog":"Review paused \u2014 a dialog is open on this page. Close it to carry on commenting. Commenting inside a native dialog isn't supported yet.","paused.close":"Close","announce.created":"Comment {key} added.","permalink.unknown":"That comment isn't on this page any more"},fr={...Sn,...ur},V=xn(fr);function hr(e,t){const n=new Array(e.length),o=[],r=new Map,l=[];let u=0;for(let a=0;a<e.length;a++){u++;const d=e[a],g=Math.floor(d.x/t),v=Math.floor(d.y/t);let C=-1;e:for(let p=-1;p<=1;p++)for(let _=-1;_<=1;_++)for(const B of r.get(`${g+p},${v+_}`)??[]){const S=l[B],M=d.x-S.x,G=d.y-S.y;if(M*M+G*G<=t*t){C=B;break e}}if(C===-1){C=o.length,o.push([]),l.push(d);const p=`${g},${v}`,_=r.get(p);_?_.push(C):r.set(p,[C])}n[a]=C,o[C].push(a)}return{group:n,members:o,visits:u}}const pr=`position:absolute;top:0;left:0;width:0;height:0;pointer-events:none;z-index:${Ve.pins}`,mr=' .snag-pp{animation:snag-pp .5s ease-out 2}@keyframes snag-pp{50%{transform:scale(1.45)}}@media (prefers-reduced-motion: reduce){.snag-pp{animation:none}}.snag-pin{width:28px;height:28px;margin:-14px 0 0 -14px}.snag-pin::after{content:"";position:absolute;inset:-8px}@media (pointer:coarse){.snag-pin{width:34px;height:34px;margin:-17px 0 0 -17px}}',gr=`position:fixed;inset:0;width:0;height:0;pointer-events:none;z-index:${Ve.pins}`,ot=["position:absolute",`color:${k.onAccent}`,`font:600 12px/1 ${k.font}`,"display:flex","align-items:center","justify-content:center","box-shadow:0 1px 4px rgb(0 0 0 / .35)","pointer-events:auto","cursor:pointer","box-sizing:border-box"].join(";"),xt="border-radius:50% 50% 50% 2px",Dn=e=>k[`status${e[0].toUpperCase()}${e.slice(1)}`]??k.muted;function Ln(e,t){const n=$n(t.status),o=`background:${Dn(t.status)};color:${n}`,r="0 1px 4px rgb(0 0 0 / .35)";return e==="anchored"?`${ot};${xt};${o};border:2px solid ${n};box-shadow:${r}`:e==="approximate"?`${ot};${xt};${o};border:2px dashed ${n};box-shadow:${r}`:`${ot};${xt};${o};border:2px solid ${n};box-shadow:inset 0 0 0 2px ${n},${r}`}function yr(e,t){const n=[];let o="static",r=!1;for(let l=e;l&&l!==e.ownerDocument.documentElement;l=l.parentElement){const u=t.getComputedStyle(l),a=l!==e.ownerDocument.body&&/auto|scroll|hidden|overlay/.test(u.overflowY+u.overflowX);a&&!r&&n.push(l),u.position==="fixed"?(o="dynamic",r=!0):u.transform!=="none"||u.filter!=="none"||u.perspective!=="none"?(o="dynamic",r=!1):(u.position==="sticky"||u.willChange.includes("transform")||u.contain.includes("layout")||a&&(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth))&&(o="dynamic")}return{tier:o,clips:n}}function br(e,t,n,o){const r=e.ownerDocument??document,l=r.defaultView??window;nt(e,"pins",mr);const u=r.createElement("div");u.className="snag-pins",u.style.cssText=pr,e.appendChild(u);const a=r.createElement("div");a.className="snag-pins-dyn",a.style.cssText=gr,e.appendChild(a);let d=[],g=[];const v=new Map;let C=new Map,p=null;const _=new Map;let B=new Map;const S=l.matchMedia?.("(pointer: coarse)").matches??!1,M=S?32:24,G=S?34:28;let q=[],Z=null,h=null,m={x:0,y:0};function z(){const A=r.defaultView,$=u.getBoundingClientRect();m={x:$.left+(A?.scrollX??0),y:$.top+(A?.scrollY??0)}}let L=[];const N=new Map,Y=1e4,ae=5,c=new Map,R=new Set(["testid","domid"]);function w(A){const $=c.get(A.id),y=$?.ref.deref();if(!y||!y.isConnected)return null;if(R.has($.strategy))return y;if(A.anchor.css)try{if(!y.matches(A.anchor.css))return null}catch{return null}return y}function I(A,$){const y=[],U=On($,A.anchor,1,y);return{element:$,strategy:c.get(A.id).strategy,score:U,state:Mn(U),reasons:y.length?y:["exact"],candidates:1}}function O(A,$="authoritative"){v.clear(),L=[];const y=Date.now(),U=n?.newPass?.();return A.map(b=>{const D=w(b),E=n?.get();let x=D?I(b,D):Ut(b.anchor,r,{viewportWidth:r.defaultView?.innerWidth??0,...E?{extended:E}:{},...U?{passCaches:U}:{}});if(D&&x.reasons.includes("text-drift")){const j=Ut(b.anchor,r,{viewportWidth:r.defaultView?.innerWidth??0,...E?{extended:E}:{},...U?{passCaches:U}:{}});j.score>x.score&&(x=j)}if(n&&(!x.element||x.reasons.includes("text-drift"))&&n.want(b.anchor),!x.element&&n){const j=n.fuzzyHit?.(b.id);j?x=j:n.wantFuzzy?.(b.id,b.anchor)}const se=x.element&&b.anchor.text?.exact&&(x.reasons.includes("text-drift")||x.strategy==="path-rect"&&x.score<.5);if(n&&se){const j=n.fuzzyHit?.(b.id);j&&j.score>x.score?x=j:j||n.wantFuzzy?.(b.id,b.anchor)}x.element?c.set(b.id,{ref:new WeakRef(x.element),strategy:x.strategy}):c.delete(b.id),x.element&&v.set(b.id,x.element);let Q=!1;if(x.state==="orphaned"){const j=N.get(b.id)??{firstSeenAt:y,tries:0,best:x};j.tries++,x.score>=j.best.score&&(j.best=x),N.set(b.id,j);const ee=n?.unavailable?.()??!1,te=ee?2:ae,fe=y-j.firstSeenAt<Y;$==="optimistic"||fe&&($==="navigating"||j.tries<te)?Q=!0:(x=j.best,ee&&!x.reasons.includes("budget-exceeded")&&(x={...x,reasons:[...x.reasons,"budget-exceeded"]}),N.delete(b.id))}else N.delete(b.id);Q||L.push({id:b.id,state:x.state,strategy:x.strategy,confidence:x.score});const H=x.element?Nt(x.element):void 0;if(H&&(H.width>0||H.height>0)){const j=r.defaultView;b.anchor.rect={x:H.left+(j?.scrollX??0),y:H.top+(j?.scrollY??0),w:H.width,h:H.height}}return{...b,anchorState:Q?b.anchorState:x.state,anchorPending:Q,anchorReasons:x.reasons}})}function W(){const A=r.documentElement;return{w:A.scrollWidth,h:A.scrollHeight}}function K(A,$,y){return{x:Math.min(Math.max(A,14),Math.max(y.w,28)-14),y:Math.min(Math.max($,14),Math.max(y.h,28)-14)}}function re(A,$){z(),u.textContent="",a.textContent="",d=[],g=[],C=new Map,B=new Map,_.clear(),q=[],h=null,A.forEach((y,U)=>{const b=y.anchor.rect;if(!b)return;const D=y.anchor.offset??{fx:.5,fy:.5},E=r.createElement("div");E.className="snag-pin",E.setAttribute("data-state",y.anchorPending?"pending":y.anchorState),E.setAttribute("data-key",y.key),E.style.cssText=y.anchorPending?`${Ln("approximate",y)};opacity:.55`:Ln(y.anchorState,y);const x=v.get(y.id),{tier:se,clips:Q}=x?yr(x,l):{tier:"static",clips:[]};if(se==="dynamic"&&x){const ne=x.getBoundingClientRect(),ye=Ue();E.style.left=`${ne.left-ye.left+ne.width*D.fx}px`,E.style.top=`${ne.top-ye.top+ne.height*D.fy}px`,_.set(E,{x:ne.left+ne.width*D.fx+l.scrollX-m.x,y:ne.top+ne.height*D.fy+l.scrollY-m.y});const De={node:E,el:x,fx:D.fx,fy:D.fy,clips:Q};d.push(De),E.hidden=!wt(x),E.hidden||je(De,ne,new Map(Q.map(lt=>[lt,lt.getBoundingClientRect()])))}else{const ne=K(b.x+b.w*D.fx-m.x,b.y+b.h*D.fy-m.y,W());E.style.left=`${ne.x}px`,E.style.top=`${ne.y}px`,_.set(E,ne),x&&(g.push({node:E,el:x,fx:D.fx,fy:D.fy,clips:[]}),E.hidden=!wt(x))}E.textContent=String(U+1);const H=Uo(y),j=y.anchor.role?V("pin.target",{role:y.anchor.role,name:y.anchor.accessibleName??y.anchor.label}):y.anchor.label,ee=y.comments.length-1,te=y.anchorState==="approximate"?`~ ${y.key}`:y.key;E.setAttribute("role","button"),E.setAttribute("tabindex","0");const fe=y.anchorState==="anchored"?V(ee===0?"pin.aria.none":ee===1?"pin.aria.one":"pin.aria",{key:te,target:j,status:En(y.status),replies:ee}):V("pin.aria.moved",{key:te,target:j,status:En(y.status),where:H});E.title=fe,E.setAttribute("aria-label",fe),t&&Ae(E,()=>t(y)),$?.has(y.id)&&(E.hidden=!0,E.setAttribute("data-fo","")),C.set(y.id,E),B.set(E,{snag:y,ordinal:U+1}),(se==="dynamic"?a:u).appendChild(E)}),Ke(),p&&Fe(p),Oe(),ue="",pe(r.visibilityState==="visible"&&C.size>0)}const Ue=()=>a.getBoundingClientRect();let Se=!1;function je(A,$,y){for(const U of A.clips){const b=y.get(U);if(b&&($.right<=b.left||$.left>=b.right||$.bottom<=b.top||$.top>=b.bottom)){A.node.hidden=!0;return}}A.node.hidden=!1}function $t(A){const $=new Map;for(const y of A)for(const U of y.clips)$.has(U)||$.set(U,U.getBoundingClientRect());return $}const Te=["open","progress","review","resolved"];function Ae(A,$){A.addEventListener("click",$),A.addEventListener("keydown",y=>{y.key!=="Enter"&&y.key!==" "||(y.preventDefault(),$())})}function ze(A,$,y,U,b){const D=Te.find(x=>A.some(se=>se.snag.status===x))??"open",E=r.createElement("div");E.className="snag-pin snag-cluster",E.style.cssText=`${ot};border-radius:50%;background:${Dn(D)};color:${$n(D)};border:2px solid ${k.onAccent}`,E.style.left=`${$}px`,E.style.top=`${y}px`,E.textContent=String(A.length),E.setAttribute("data-count",String(A.length)),E.setAttribute("data-state",D),E.setAttribute("role","button"),E.setAttribute("tabindex","0"),b&&E.setAttribute("aria-expanded","true"),E.setAttribute("aria-label",V("cluster.aria",{n:A.length,list:A.map(x=>x.ordinal).join(", ")})),Ae(E,()=>{if(b)Z=null;else if(A.length<=6)Z=U;else{o?.(A.map(x=>x.snag.id));return}Ke()}),u.appendChild(E),q.push(E)}function he(A,$,y,U){ze(A,$,y,U,!0),A.forEach((b,D)=>{const E=$,x=y+(D+1)*(G+12),se=b.x-E,Q=b.y-x,H=Math.hypot(se,Q);if(H>4){const ee=r.createElement("div");ee.className="snag-leader",ee.setAttribute("aria-hidden","true"),ee.style.cssText=`position:absolute;left:${E}px;top:${x}px;width:${H}px;height:0;border-top:1px solid ${k.onAccent};transform-origin:0 0;transform:rotate(${Math.atan2(Q,se)}rad)`,u.appendChild(ee),q.push(ee)}const j=b.dot.cloneNode(!0);j.style.visibility="",j.style.left=`${E}px`,j.style.top=`${x}px`,Ae(j,()=>t?.(b.snag)),u.appendChild(j),q.push(j)})}function Ke(){for(const b of q)b.remove();q=[];const A=[];for(const[b,D]of B){if(b.hidden){b.style.visibility="";continue}const E=_.get(b);E&&A.push({dot:b,snag:D.snag,ordinal:D.ordinal,x:E.x,y:E.y})}const{members:$,visits:y}=hr(A,M);u.setAttribute("data-cv",String(y)),u.setAttribute("data-cp",String(A.length));let U=!1;for(const b of $){if(b.length<2){A[b[0]].dot.style.visibility="";continue}const D=b.map(Q=>A[Q]),E=D.map(Q=>Q.snag.id).sort().join("|");for(const Q of D)Q.dot.style.visibility="hidden";const x=D.reduce((Q,H)=>Q+H.x,0)/D.length,se=D.reduce((Q,H)=>Q+H.y,0)/D.length;Z===E&&D.length<=6?(U=!0,he(D,x,se,E)):ze(D,x,se,E,!1)}Z&&!U&&(Z=null)}function Je(A){h?.remove(),h=null;const $=A.anchor.rect;if(!$)return;const y=A.anchor.offset??{fx:.5,fy:.5},U=r.createElement("div");U.className="snag-pin snag-ghost",U.style.cssText=`${ot};${xt};background:transparent;border:2px dashed ${k.anchorOrphan};color:${k.anchorOrphan};box-shadow:none;pointer-events:none`;const b=K($.x+$.w*y.fx-m.x,$.y+$.h*y.fy-m.y,W());U.style.left=`${b.x}px`,U.style.top=`${b.y}px`,U.setAttribute("aria-hidden","true"),u.appendChild(U),h=U}function Oe(A=!1){const $=A?[...d,...g]:d;Se||$.length===0||(Se=!0,l.requestAnimationFrame(()=>{Se=!1;const y=performance.now(),U=l.scrollX,b=l.scrollY,D=Ue(),E=$.map(H=>H.el.isConnected?H.el.getBoundingClientRect():null),x=$.map(H=>H.el.isConnected&&wt(H.el)),se=$t($),Q=W();$.forEach((H,j)=>{const ee=E[j];if(!ee)return;if(H.node.hasAttribute("data-fo")){H.node.hidden=!0;return}if(!x[j]){H.node.hidden=!0;return}H.node.hidden=!1;const te=ee.left+ee.width*H.fx,fe=ee.top+ee.height*H.fy;if(H.node.parentElement===a)H.node.style.left=`${te-D.left}px`,H.node.style.top=`${fe-D.top}px`,je(H,ee,se),_.set(H.node,{x:te+U-m.x,y:fe+b-m.y});else{const ne=K(te+U-m.x,fe+b-m.y,Q);H.node.style.left=`${ne.x}px`,H.node.style.top=`${ne.y}px`,_.set(H.node,ne)}}),Ke(),u.setAttribute("data-ms",(performance.now()-y).toFixed(2))}))}const ke=()=>Oe();r.addEventListener("scroll",ke,{capture:!0,passive:!0});const it=typeof l.ResizeObserver=="function"?new l.ResizeObserver(()=>Oe(!0)):null;it?.observe(r.documentElement);let $e=null,ue="";function Et(){let A="";for(const $ of[...g,...d]){if(!$.el.isConnected)continue;const y=$.el.getBoundingClientRect();A+=`${Math.round(y.left)},${Math.round(y.top)},${Math.round(y.width)};`}!A||A===ue||(ue=A,Oe(!0))}function pe(A){if($e&&clearTimeout($e),$e=null,!A)return;const $=()=>{Et(),$e=setTimeout($,500)};$e=setTimeout($,500)}const ct=()=>pe(r.visibilityState==="visible"&&C.size>0);r.addEventListener("visibilitychange",ct);function ce(A){const $=C.get(A);$&&($.classList.remove("snag-pp"),l.requestAnimationFrame(()=>$.classList.add("snag-pp")),l.setTimeout(()=>$.classList.remove("snag-pp"),1400))}function Fe(A){const $=p?C.get(p):void 0;$&&($.style.transform="",$.style.zIndex=""),p=A;const y=A?C.get(A):void 0;y&&(y.style.transform="scale(1.4)",y.style.zIndex="1")}return{el:u,render:re,showGhost:Je,pulse:ce,reanchor:O,settled:()=>L,hasPending:()=>N.size>0,highlight:Fe,destroy(){r.removeEventListener("scroll",ke,{capture:!0}),r.removeEventListener("visibilitychange",ct),it?.disconnect(),pe(!1),u.remove(),a.remove()}}}const vr=` .snag-notice{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(24px + var(${P.tbH},56px));z-index:${Ve.notice};max-width:min(420px,calc(100vw - 24px));background:${k.bg};color:${k.fg};border:1px solid ${k.border};border-inline-start:3px solid ${k.anchorOrphan};border-radius:${k.radius};box-shadow:${k.shadow};padding:12px 14px;pointer-events:auto;font:400 13px/1.45 ${k.font};display:flex;flex-direction:column;gap:10px}@media (pointer:coarse){.snag-notice{bottom:calc(12px + var(${P.tbH},64px))}}.snag-notice p{margin:0}.snag-notice-actions{display:flex;gap:6px;justify-content:flex-end}.snag-notice button{appearance:none;font:inherit;cursor:pointer;border-radius:calc(${k.radius} - 2px);padding:6px 12px;min-height:30px;border:0;transition:background ${k.motion}}.snag-notice-retry{background:${k.accent};color:${k.onAccent};font-weight:600}.snag-notice-dismiss{background:transparent;color:${k.muted}}.snag-notice-dismiss:hover{background:${k.hover};color:inherit}.snag-notice button:focus-visible{outline:2px solid ${k.focus};outline-offset:2px}`;function wr(e,t){const n=e.ownerDocument??document,o=n.defaultView??window;nt(e,"notice",vr);const r=n.createElement("div");r.className="snag-notice",r.setAttribute("role","alert"),r.hidden=!0;const l=n.createElement("p"),u=n.createElement("div");u.className="snag-notice-actions";const a=n.createElement("button");a.type="button",a.className="snag-notice-dismiss",a.textContent=V("action.dismiss"),a.addEventListener("click",()=>C());const d=n.createElement("button");d.type="button",d.className="snag-notice-retry",u.append(a,d),r.append(l,u);let g;d.addEventListener("click",()=>{C(),g?.run()});let v=0;function C(){v&&o.cancelAnimationFrame(v),v=0,r.hidden=!0,r.remove()}return{show(p,_,B){g=_,d.hidden=!_,_&&(d.textContent=V(_.label)),r.hidden=!1,l.textContent="",(t??e).appendChild(r);const S=V(p,B);v&&o.cancelAnimationFrame(v),v=o.requestAnimationFrame(()=>{v=0,l.textContent=S})},hide:C,visible:()=>r.isConnected&&!r.hidden,destroy(){r.remove()}}}const xr=` .snag-paused{border:0;padding:0;background:transparent;pointer-events:auto;max-width:min(420px,calc(100vw - 32px))}.snag-paused::backdrop{background:rgb(0 0 0 / .28)}.snag-paused-box{background:${k.bg};color:${k.fg};border:1px solid ${k.border};border-inline-start:3px solid ${k.accent};border-radius:${k.radius};box-shadow:${k.shadow};padding:14px 16px;font:400 13px/1.45 ${k.font};display:flex;flex-direction:column;gap:12px}.snag-paused p{margin:0}.snag-paused-actions{display:flex;justify-content:flex-end}.snag-paused button{appearance:none;font:inherit;cursor:pointer;border:0;font-weight:600;border-radius:calc(${k.radius} - 2px);padding:6px 14px;min-height:30px;background:${k.accent};color:${k.onAccent}}.snag-paused button:focus-visible{outline:2px solid ${k.focus};outline-offset:2px}`;function Sr(e,t){const n=e.ownerDocument??document;nt(e,"paused",xr);const o=n.createElement("dialog");o.className="snag-paused",o.setAttribute("aria-label",V("paused.dialog"));const r=n.createElement("div");r.className="snag-paused-box",r.setAttribute("role","status");const l=n.createElement("p");l.textContent=V("paused.dialog");const u=n.createElement("div");u.className="snag-paused-actions";const a=n.createElement("button");a.type="button",a.textContent=V("paused.close"),a.addEventListener("click",()=>v()),u.append(a),r.append(l,u),o.append(r);let d=!1;function g(){if(!d){(t??e).appendChild(o);try{o.showModal(),d=!0}catch{o.setAttribute("open",""),d=!0}}}function v(){if(d){d=!1;try{o.close()}catch{o.removeAttribute("open")}o.remove()}}return o.addEventListener("close",()=>{d=!1,o.remove()}),{show:g,hide:v,destroy(){v(),o.remove()}}}const Ar=Symbol.for(gn.original),Nn=Symbol.for(gn.wrapped),rt=()=>{};function kr(e,t,n){let o;try{o=e[t]}catch{return rt}if(typeof o!="function"||o[Nn])return rt;const r=o,l=n(r);let u=!1;const a=function(...d){return u?r.apply(this,d):l.apply(this,d)};try{const d=a;d[Nn]=!0,d[Ar]=r,Object.defineProperty(a,"name",{value:r.name,configurable:!0}),Object.defineProperty(a,"length",{value:r.length,configurable:!0})}catch{}try{e[t]=a}catch{return rt}return e[t]!==a?rt:()=>{let d;try{d=e[t]}catch{d=void 0}if(d===a)try{e[t]=r;return}catch{}u=!0}}function $r(e,t){const n=[];let o=0;const r=()=>{o||(o=e.requestAnimationFrame(()=>{o=0,t.onResize()}))};e.addEventListener("resize",r),n.push(()=>{o&&e.cancelAnimationFrame(o),e.removeEventListener("resize",r)}),e.visualViewport?.addEventListener("resize",r),n.push(()=>e.visualViewport?.removeEventListener("resize",r));const l=()=>void e.setTimeout(t.onResize,250);e.addEventListener("orientationchange",l),n.push(()=>e.removeEventListener("orientationchange",l));let u=e.location.pathname;const a=()=>{const M=e.location.pathname;M!==u&&(u=M,t.onRoute())},d=e.navigation;if(d){const M=()=>void e.setTimeout(a,0);d.addEventListener("navigatesuccess",M),n.push(()=>d.removeEventListener("navigatesuccess",M))}else for(const M of["pushState","replaceState"])n.push(kr(e.history,M,G=>function(...q){const Z=G.apply(this,q);return e.setTimeout(a,0),Z}));const g=e.document;let v=!0;try{g.documentElement.matches(":modal")}catch{v=!1}const C=()=>{const M=g.querySelectorAll("dialog[open]");if(!v)return M.length>0;for(const G of M)if(G.matches(":modal"))return!0;return!1};let p=!1;const _=()=>{const M=C();M!==p&&(p=M,t.onModal(M))};g.addEventListener("toggle",_,!0),n.push(()=>g.removeEventListener("toggle",_,!0));const B=new MutationObserver(_);B.observe(g.documentElement,{subtree:!0,attributes:!0,attributeFilter:["open"]}),n.push(()=>B.disconnect());const S=()=>void e.setTimeout(a,0);return e.addEventListener("popstate",S),n.push(()=>e.removeEventListener("popstate",S)),{destroy(){for(const M of n)M();n.length=0}}}function Er(e,t){try{e.sessionStorage.setItem(de.handoff,JSON.stringify({openThreadId:t}))}catch{}}function Cr(e){try{const t=e.sessionStorage.getItem(de.handoff);if(t===null)return null;e.sessionStorage.removeItem(de.handoff);const n=JSON.parse(t);return typeof n.openThreadId=="string"?n.openThreadId:null}catch{return null}}function Tr(){return{statuses:[],read:"all",pageOnly:!1,newOnly:!1,sort:"page"}}const Rr=["open","progress","review","resolved"];function _r(e,t,n){if(t.statuses.length>0&&Rr.includes(e.status)&&!t.statuses.includes(e.status)||t.by&&e.createdBy.id!==t.by||t.page&&e.route!==t.page)return!1;if(t.read!=="all"&&n){const o=Ir(e,n);if(t.read==="unread"&&!o||t.read==="read"&&o)return!1}return!0}function Ir(e,t){const n=t.get(e.id)??0;return Date.parse(e.updatedAt)>n}function Pr(e,t,n){const o=e.visualViewport;let r=0;const l=()=>{if(r=0,!o)return;const a=o.offsetLeft,d=o.offsetTop;t.style.translate=a||d?`${a}px ${d}px`:"",t.style.width=`${o.width}px`,t.style.height=`${o.height}px`,n?.(o.scale)},u=()=>{r||(r=e.requestAnimationFrame(l))};return o?.addEventListener("resize",u,{passive:!0}),o?.addEventListener("scroll",u,{passive:!0}),u(),()=>{r&&e.cancelAnimationFrame(r),o?.removeEventListener("resize",u),o?.removeEventListener("scroll",u)}}const Mr=/^eyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}/,zr=/^[a-f0-9]{32,}$/i,Or=/^(?=[A-Za-z0-9_-]{24,}$)(?=.*[A-Za-z])(?=.*\d)[A-Za-z0-9_-]+$/,Dr="[redacted]";function Hn(e){return e.includes("/")?e.split("/").map(t=>Mr.test(t)||zr.test(t)||Or.test(t)?Dr:t).join("/"):e}const Lr=/\/index\.(html?|php)$/i;function Nr(e){if(!e.startsWith("/"))return e;let t=e.replace(Lr,"/");return t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t.toLowerCase()}function Hr(e){try{const t=e.querySelector(`meta[name="${Oo.route}"]`)?.getAttribute("content")?.trim();return!t||t.length>512||!t.startsWith("/")?null:t}catch{return null}}function Wr(e,t){const n=t??Hr(e);return Nr(n??Hn(e.location.pathname))}const Ur=[/^utm_/,/^(gclid|gbraid|wbraid|fbclid|msclkid|ttclid|twclid|igshid|yclid|li_fat_id)$/,/^(mc_cid|mc_eid|_hsenc|_hsmi|vero_id|oly_enc_id|oly_anon_id)$/,/^_vercel_/,/^__vercel_/,/^_rsc$/],jr=[...bt.query,...bt.fragment];function Fr(e,t=[]){return jr.includes(e)||t.includes(e)?!0:Ur.some(n=>n.test(e))}function Br(e,t={}){const n=t.significantQueryParams??[];if(n!=="*"&&n.length===0)return;let o;try{o=new URLSearchParams(e)}catch{return}const r={};for(const[l,u]of o)Fr(l,t.ignoredQueryParams??[])||n!=="*"&&!n.includes(l)||(r[l]=u);return Object.keys(r).length>0?r:void 0}function Zr(e,t,n={}){const o=n.significantQueryParams??[];if(o==="*"){const r=e??{},l=t??{},u=new Set([...Object.keys(r),...Object.keys(l)]);for(const a of u)if(r[a]!==l[a])return!1;return!0}for(const r of o)if((e?.[r]??void 0)!==(t?.[r]??void 0))return!1;return!0}const Vr=120,Yr=1e3,Xr=200,Kr=1e4;function Jr(e,t,n){const o=t.MutationObserver;if(typeof o!="function")return{destroy:()=>{}};let r=!1,l=null,u=!1,a=!1,d=0,g=C(),v=0;function C(){return t.performance?.now?.()??0}const p=new o(()=>{r=!0,d++,B()});function _(){const M=C();return M-g>=1e3&&(d>Xr&&(v=M+Kr),d=0,g=M),M<v?Yr:Vr}function B(){l||(l=setTimeout(S,_()))}function S(){if(l=null,!!r){if(u){a=!0;return}r=!1,u=!0;try{n()}finally{u=!1,a&&(a=!1,r=!0,B())}}}return p.observe(e.documentElement,{childList:!0,subtree:!0}),{destroy(){p.disconnect(),l&&clearTimeout(l),l=null}}}const qr="0.0.0",Qr={capture:Ie.capture,"anchor-ext":Ie.anchorExt,"anchor-fuzzy":Ie.anchorFuzzy,crumbs:Ie.crumbs,screenshot:Ie.screenshot,dock:Ie.dock,text:Ie.text},Wn=new Map,jt=new Map,Un=new Map;function Gr(e,t,n){const o=new URL(t,n.location.href).href,r=new URL(Qr[e],o);r.searchParams.set("cv",qr);const l=Un.get(e)??0;return l>0&&r.searchParams.set("r",String(l)),Un.set(e,l+1),r.href}async function Pe(e,t,n=document){const o=Wn.get(e);if(o)return{ok:!0,mod:o};const r=jt.get(e);if(r)return r;const l=(async()=>{for(let u=0;u<2;u++)try{const a=await import(Gr(e,t,n));return Wn.set(e,a),{ok:!0,mod:a}}catch{}return{ok:!1,reason:"unavailable"}})();jt.set(e,l);try{return await l}finally{jt.delete(e)}}const es="composer",Ft=e=>de.draft(e,es),ts=de.draft("\0","").split("\0")[0];function ns(e){try{return e.body.trim()?(localStorage.setItem(Ft(e.route),JSON.stringify(e)),!0):(jn(e.route),!0)}catch{return!1}}function os(e){try{const t=localStorage.getItem(Ft(e));if(!t)return null;const n=JSON.parse(t);return!n||typeof n.body!="string"||!n.anchor||n.route!==e?null:n}catch{return null}}function jn(e){try{localStorage.removeItem(Ft(e))}catch{}}function Bt(){try{for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);if(t&&t.startsWith(ts))return!0}return!1}catch{return!1}}const rs="http://www.w3.org/2000/svg";function Me(e,t,n,o=[]){const r=e.createElementNS(rs,t);for(const l in n)r.setAttribute(l,n[l]);for(const l of o)r.appendChild(l);return r}const Zt=(e,t="16",n="16",o="0 0 16 16")=>({width:t,height:n,viewBox:o,fill:"none","aria-hidden":"true"}),ss=e=>Me(e,"svg",Zt(),[Me(e,"path",{d:"M8 3v10M3 8h10",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round"})]),as=e=>Me(e,"svg",Zt(),[Me(e,"rect",{x:"2.25",y:"3.25",width:"11.5",height:"9.5",rx:"1.75",stroke:"currentColor","stroke-width":"1.5"}),Me(e,"path",{d:"M9.5 3.5v9",stroke:"currentColor","stroke-width":"1.5"})]),is=e=>Me(e,"svg",{...Zt(e,"10","16","0 0 10 16"),fill:"currentColor"},[Me(e,"g",{fill:"currentColor"},[4,8,12].flatMap(t=>[3,7].map(n=>Me(e,"circle",{cx:String(n),cy:String(t),r:"1"}))))]),cs=` .snag-tb{position:fixed;z-index:${Ve.toolbar};display:flex;align-items:center;gap:2px;padding:4px;border-radius:calc(${k.radius} + 4px);background:${k.bg};color:${k.fg};box-shadow:${k.shadow};font:500 13px/1 ${k.font};pointer-events:auto;user-select:none;border:1px solid ${k.border}}.snag-tb{transition:inset-inline-end ${k.motion}}.snag-tb--fine{inset-inline-end:calc(20px + env(safe-area-inset-right) + var(${P.dockW},0px));inset-block-end:calc(20px + env(safe-area-inset-bottom));transition:inset-inline-end ${k.motion}}.snag-tb--coarse{inset-inline:0;inset-block-end:0;border-radius:14px 14px 0 0;padding:6px 10px calc(6px + env(safe-area-inset-bottom));justify-content:center;gap:4px;flex-direction:column}.snag-grabber{width:36px;height:4px;border-radius:2px;background:${k.muted};margin:2px auto 6px}.snag-row{display:flex;align-items:center;gap:2px}.snag-grip{display:flex;align-items:center;padding:0 4px;color:${k.muted};cursor:grab;touch-action:none}.snag-grip:active{cursor:grabbing}.snag-seg{display:flex;background:${k.surface};border-radius:${k.radius};padding:2px;position:relative}.snag-seg::before{content:"";position:absolute;inset-block:2px;inset-inline-start:var(${P.thumbX},0);width:var(${P.thumbW},0);background:${k.accent};border-radius:calc(${k.radius} - 2px);pointer-events:none;transition:inset-inline-start ${k.motion},width ${k.motion}}.snag-seg>.snag-b[aria-pressed="true"]{background:transparent;color:${k.onAccent}}.snag-seg>.snag-b{z-index:1}.snag-b{appearance:none;border:0;background:transparent;color:inherit;font:inherit;padding:6px 11px;border-radius:calc(${k.radius} - 2px);cursor:pointer;display:flex;align-items:center;gap:6px;position:relative;min-height:32px;transition:background ${k.motion}}.snag-b:hover:not(:disabled){background:color-mix(in srgb,currentColor 12%,transparent)}.snag-b:disabled{opacity:.4;cursor:not-allowed}.snag-b[aria-pressed="true"]{background:${k.accent};color:${k.onAccent}}.snag-b:focus-visible{outline:2px solid ${k.focus};outline-offset:2px}.snag-icon{padding:6px 9px}@media (pointer:coarse){.snag-b{min-height:44px;min-width:44px;padding:6px 14px}.snag-icon{padding:6px 14px}}.snag-puck .snag-row>:not([aria-expanded]){display:none}.snag-puck{padding:4px;border-radius:50%}.snag-puck [aria-expanded]{min-width:44px;min-height:44px;border-radius:50%}`;function ls(e,t){const n=e.ownerDocument??document,o=t.coarsePointer??n.defaultView?.matchMedia?.("(pointer: coarse)").matches??!1;nt(e,"toolbar",cs);const r=n.createElement("div");r.className=`snag-tb ${o?"snag-tb--coarse":"snag-tb--fine"}`,r.setAttribute("role","toolbar"),r.setAttribute("aria-label",V("toolbar.aria"));const l=n.createElement("div");l.className="snag-grabber",l.setAttribute("aria-hidden","true");const u=n.createElement("div");u.className="snag-row";const a=n.createElement("span");a.className="snag-grip",a.setAttribute("aria-hidden","true"),a.appendChild(is(n));const d=n.createElement("div");d.className="snag-seg",d.setAttribute("role","group"),d.setAttribute("aria-label",V("toolbar.group"));const g=(c,R,w)=>{const I=n.createElement("button");return I.type="button",I.className=`snag-b ${c}`,I.setAttribute("aria-label",R),typeof w=="string"?I.textContent=w:I.appendChild(w),I},v=g("",V("toolbar.browse"),V("toolbar.browse")),C=g("",V("toolbar.comments"),V("toolbar.comments")),p=g("snag-icon",V("toolbar.add"),ss(n)),_=g("snag-icon",V("toolbar.panel"),as(n));_.setAttribute("aria-expanded","false"),d.append(v,C),o||u.appendChild(a),u.append(d,p,_),o&&r.appendChild(l),r.appendChild(u),(t.parent??e).appendChild(r);const B=()=>{e.host.style.setProperty(P.tbH,`${r.offsetHeight}px`)};B();let S=null;function M(c,R){const w=n.defaultView,I=r.offsetWidth,O=r.offsetHeight,W=Fn(c,8,Math.max(8,w.innerWidth-I-8)),K=Fn(R,8,Math.max(8,w.innerHeight-O-8));S={left:W,top:K},r.style.left=`${W}px`,r.style.top=`${K}px`,r.style.right="auto",r.style.bottom="auto"}const G=()=>{B(),S&&M(S.left,S.top)},q=n.defaultView;if(q?.addEventListener("resize",G),v.addEventListener("click",()=>t.onState("browse")),C.addEventListener("click",()=>t.onState("comments")),p.addEventListener("click",()=>t.onState(Z==="add"?"comments":"add")),_.addEventListener("click",()=>t.onPanel()),!o){let c=null;a.addEventListener("pointerdown",w=>{c={x:w.clientX,y:w.clientY,r:r.getBoundingClientRect()},a.setPointerCapture(w.pointerId),w.preventDefault()}),a.addEventListener("pointermove",w=>{c&&M(c.r.left+(w.clientX-c.x),c.r.top+(w.clientY-c.y))});const R=w=>{c=null,a.hasPointerCapture(w.pointerId)&&a.releasePointerCapture(w.pointerId)};a.addEventListener("pointerup",R),a.addEventListener("pointercancel",R)}let Z="browse";function h(c){Z=c,v.setAttribute("aria-pressed",String(c==="browse")),C.setAttribute("aria-pressed",String(c!=="browse")),p.setAttribute("aria-pressed",String(c==="add")),m()}function m(){const c=d.querySelector('.snag-b[aria-pressed="true"]'),R=d.getBoundingClientRect(),w=c?.getBoundingClientRect();if(!c||!w?.width){d.style.setProperty(P.thumbW,"0px");return}const I=n.defaultView?.getComputedStyle(d),O=I?.direction==="rtl",W=parseFloat((O?I?.paddingRight:I?.paddingLeft)??"0")||0,K=(O?R.right-w.right:w.left-R.left)-W;d.style.setProperty(P.thumbW,`${Math.round(w.width)}px`),d.style.setProperty(P.thumbX,`${Math.max(0,Math.round(K))}px`)}function z(c){p.disabled=c,c?p.title=V("error.panels.add"):p.removeAttribute("title")}function L(c){p.setAttribute("aria-label",V(c?"toolbar.add.draft":"toolbar.add"))}function N(c){C.setAttribute("aria-label",c!==null&&c>0?V("toolbar.comments.unresolved",{n:Wo(c)}):V("toolbar.comments"))}h("browse"),N(0);function Y(c){r.classList.toggle("snag-puck",c),c||m()}function ae(c){r.hidden=c,c||m(),B()}return{el:r,setState:h,setCount:N,setDegraded:z,setDraft:L,setPuck:Y,setConcealed:ae,destroy(){q?.removeEventListener("resize",G),e.host.style.removeProperty(P.tbH),r.remove()}}}const Fn=(e,t,n)=>e<t?t:e>n?n:e,Bn=24;function ds(e,t){const n=e.innerHeight,o=t.querySelector(".snag-dk");if(!o)return{top:0,bottom:n};const r=o.getBoundingClientRect();return r.height>=n-1?{top:0,bottom:n}:{top:0,bottom:Math.max(0,r.top)}}function us(e,t,n){const o=n.anchor.rect;if(!o)return;const r=n.anchor.offset??{fy:.5},l=o.y+o.h*r.fy,u=ds(e,t),a=l-e.scrollY;if(a>=u.top+Bn&&a<=u.bottom-Bn)return;const d=e.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;e.scrollTo({top:Math.max(0,l-(u.top+u.bottom)/2),behavior:d?"auto":"smooth"})}function Vt(){const e=new Uint8Array(16);crypto.getRandomValues(e);const t=Date.now();e[0]=Math.floor(t/2**40)&255,e[1]=Math.floor(t/2**32)&255,e[2]=Math.floor(t/2**24)&255,e[3]=Math.floor(t/2**16)&255,e[4]=Math.floor(t/2**8)&255,e[5]=t&255,e[6]=e[6]&15|112,e[8]=e[8]&63|128;const n=Array.from(e,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}const fs=()=>vt.thread+Vt(),Zn=()=>vt.comment+Vt(),hs=()=>vt.attachment+Vt(),ps={attachments:"direct",realtime:"none",anchorReports:!1,identity:["guest"],export:["json","md"],serverSideSearch:!1,privateThreads:!1,assignees:!1};function ms(){const e=de.threads("probe","probe");try{return localStorage.setItem(e,"1"),localStorage.removeItem(e),!0}catch(t){return Vn(t)}}function gs(e,t,n){const o=de.threads(e,t);function r(){let a=null;try{a=localStorage.getItem(o)}catch{return[]}if(!a)return[];try{const d=JSON.parse(a);return Array.isArray(d)?d.filter(bs):[]}catch{return[]}}function l(a){try{localStorage.setItem(o,JSON.stringify(a))}catch(d){if(!Vn(d))return;throw new Lt("local_quota_exceeded")}}const u=a=>({...a,updatedAt:new Date().toISOString()});return{kind:"local",capabilities:ps,async init(a){return{uid:a.uid,env:a.env,features:{screenshots:!0,uploads:!1}}},async listThreads(a={}){let d=r();return a.route!==void 0&&(d=d.filter(g=>g.route===a.route)),a.status?.length&&(d=d.filter(g=>a.status.includes(g.status))),{data:d,serverTime:new Date().toISOString()}},async getThread(a){return r().find(d=>d.id===a)??null},async createThread(a){const d=Cn(a);return l([...r(),d]),d},async patchThread(a,d){const g=r(),v=g.findIndex(B=>B.id===a);if(v<0)return null;const{assignee:C,...p}=d,_=u({...g[v],...ys(p)});return g[v]=_,l(g),_},async deleteThread(a){const d=r(),g=d.find(C=>C.id===a),v=d.filter(C=>C.id!==a);v.length!==d.length&&l(v);for(const C of g?.attachments??[])n?.del(C.id).catch(()=>{})},async uploadAttachment(a,d){if(!n)throw new Lt("attachments_unsupported");const g=hs();return await n.put(g,{blob:a,uid:e,env:t,kind:d.kind,...d.width!==void 0?{width:d.width}:{},...d.height!==void 0?{height:d.height}:{},createdAt:Date.now()}),{id:g,kind:d.kind,url:"",...d.width!==void 0?{width:d.width}:{},...d.height!==void 0?{height:d.height}:{},bytes:a.size,contentType:a.type}},async createComment(a,d){const g=r(),v=g.findIndex(p=>p.id===a);if(v<0)return null;const C={id:d.id,snagId:a,body:d.body,author:d.author,createdAt:new Date().toISOString()};return g[v]=u({...g[v],comments:[...g[v].comments,C]}),l(g),C},async patchComment(a,d){const g=r();for(let v=0;v<g.length;v++){const C=g[v].comments.find(_=>_.id===a);if(!C)continue;const p={...C,body:d};return g[v]=u({...g[v],comments:g[v].comments.map(_=>_.id===a?p:_)}),l(g),p}return null},async deleteComment(a){const d=r(),g=d.findIndex(v=>v.comments.some(C=>C.id===a));g<0||(d[g]=u({...d[g],comments:d[g].comments.filter(v=>v.id!==a)}),l(d))}}}function ys(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function Vn(e){return e instanceof Error?e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED"||e.code===22||e.code===1014:!1}function bs(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&typeof t.key=="string"&&typeof t.route=="string"&&typeof t.anchor=="object"&&t.anchor!==null&&typeof t.anchor.label=="string"&&Array.isArray(t.comments)}function vs(e,t,n=()=>Date.now()){const o=de.seen(e,t);let r=null;function l(){if(r)return r;try{const a=localStorage.getItem(o),d=a?JSON.parse(a):{};return r=typeof d=="object"&&d!==null&&!Array.isArray(d)?d:{}}catch{return r={}}}function u(a){r=a;try{localStorage.setItem(o,JSON.stringify(a))}catch{}}return{map:()=>new Map(Object.entries(l())),mark(a){u({...l(),[a]:n()})},markAll(a){const d=n(),g={...l()};for(const v of a)g[v.id]=d;u(g)}}}function st(){let e=null;try{e=localStorage.getItem(zt)}catch{return{}}if(!e)return{};if(e[0]!=="{")return{name:e};try{const t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function Yn(e){try{localStorage.setItem(zt,JSON.stringify(e))}catch{}}function Yt(){const e=st();return{name:typeof e.name=="string"?e.name:"",...e.email?{email:e.email}:{}}}function Xn(e){return st().projects?.[e]?.holderId}function ws(e){const t=st().projects?.[e]?.holderSecret;return t&&/^[\w-]{43}$/.test(t)?t:void 0}function xs(e,t,n){const o=st();Yn({...o,projects:{...o.projects,[e]:{holderId:t,holderSecret:n}}})}function Ss(e,t){const n=st(),o=n.projects?.[e];o&&Yn({...n,projects:{...n.projects,[e]:{...o,holderId:t}}})}const We=e=>de.session(e);function Kn(e){if(!e)return null;const t=JSON.parse(e);return typeof t?.token=="string"&&typeof t?.refreshableUntil=="number"?t:null}function Ye(e){try{const t=Kn(sessionStorage.getItem(We(e)));if(t)return t;const n=Kn(localStorage.getItem(We(e)));return n?.member?n:null}catch{return null}}function Xt(e,t){try{t.member?(localStorage.setItem(We(e),JSON.stringify(t)),sessionStorage.removeItem(We(e))):sessionStorage.setItem(We(e),JSON.stringify(t))}catch{}}function at(e){try{sessionStorage.removeItem(We(e)),localStorage.removeItem(We(e))}catch{}}const As=(e,t=Date.now())=>t>e.expiresAt-3e4,Kt=(e,t=Date.now())=>t>=e.refreshableUntil;class Xe extends Error{code;status;constructor(t,n,o){super(o),this.name="HttpAdapterError",this.status=t,this.code=n}}function ks(e){const{offset:t,testId:n,domId:o,page:r,schemaVersion:l,...u}=e;return{...u,...n?{testid:n}:{},...o?{domid:o}:{},...t?{offset:{fx:t.x,fy:t.y}}:{}}}function $s(e,t){const n=e.url??"",o=/^https?:/i.test(n)?n:n?`${t}${n.startsWith("/")?"":"/"}${n}`:`${t}/api/v1/attachments/${encodeURIComponent(e.id)}/blob`;return{...e,url:o}}function St(e,t,n){return{id:e.id,route:e.anchor?.page?.route??"",key:e.key,status:e.status,anchor:ks(e.anchor),anchorState:e.anchorState,context:e.context,comments:e.comments??[],createdBy:e.createdBy,assignee:e.assignee??null,createdAt:e.createdAt,updatedAt:e.updatedAt,...e.resolvedAt?{resolvedAt:e.resolvedAt}:{},...e.attachments?.length?{attachments:e.attachments.map(o=>$s(o,n))}:{},...t?{scope:{environment:t}}:{}}}function Es(e,t){const{offset:n,testid:o,domid:r,...l}=e;return{...l,schemaVersion:pn,...o?{testId:o}:{},...r?{domId:r}:{},offset:n?{x:n.fx,y:n.fy}:{x:.5,y:.5},page:{route:t,pathname:location.pathname,origin:location.origin}}}function Cs(e,t){const n=o=>/^[\d.]+$|:/.test(o)?o:o.split(".").slice(-2).join(".");return n(e)===n(t)}const Jn=10*6e4;function Ts(e,t,n,o={}){const r=e.replace(/\/+$/,""),l=`${r}/api/v1/projects/${encodeURIComponent(t)}`;let u=o.reviewToken,a=Ye(t);const d=de.silent(t);let g=0,v=Promise.resolve(!1);function C(){if(u||Date.now()-g<Jn)return v;try{if(!Cs(location.hostname,new URL(r).hostname)||localStorage.getItem(d)||Date.now()-Number(sessionStorage.getItem(d))<Jn)return v}catch{}return g=Date.now(),v=(async()=>{try{const h=await fetch(`${l}/sessions/member/silent`,{method:"POST",credentials:"include",...n?{body:JSON.stringify({environment:n})}:{}});if(h.status===201)return _(await h.json()),g=0,!0}catch{}try{sessionStorage.setItem(d,String(Date.now()))}catch{}return!1})()}let p=null;function _(h){a={token:h.sessionToken,expiresAt:Date.parse(h.expiresAt),refreshableUntil:Date.parse(h.refreshableUntil),reviewerId:h.reviewer.id,permissions:h.permissions,member:h.reviewer.name,...h.moderator?{moderator:!0}:{}},Xt(t,a),o.onSessionStarted?.()}const B=()=>a;async function S(h=!1){const m=a&&!Kt(a)?a.token:null,z=!!m&&!u&&!h,L=z?void 0:u?{kind:"link",token:u,name:Yt().name||void 0}:{kind:"guest",name:Yt().name||"Anonymous",holderId:Xn(t),holderSecret:ws(t)};let N;try{N=await fetch(`${l}/sessions`,{method:"POST",credentials:"omit",headers:{"content-type":"application/json",...m?{Authorization:`Bearer ${m}`}:{}},body:JSON.stringify({...n?{environment:n}:{},...L?{identity:L}:{},client:{widget:$o,schema:pn}})})}catch(c){throw new Xe(0,"network_error",c.message)}finally{u=void 0}if(!N.ok){const R=(await N.json().catch(()=>null))?.error?.code??"unauthorized",w=z&&!!a?.member;if(at(t),a=null,w&&N.status===401&&await C())return B();throw R==="session_revoked"||R==="token_revoked"?o.onSessionEnded?.("revoked"):N.status===401&&o.onSessionEnded?.("expired"),new Xe(N.status,R,"This review session is not valid.")}const Y=await N.json();Y.holderSecret&&Y.reviewer?xs(t,Y.reviewer.id,Y.holderSecret):Y.reviewer&&Ss(t,Y.reviewer.id);const ae=Y.round?.number??(z?a?.round:void 0);return a={token:Y.sessionToken,expiresAt:Date.parse(Y.expiresAt),refreshableUntil:Date.parse(Y.refreshableUntil),reviewerId:Y.reviewer?.id??a?.reviewerId??"",permissions:Y.permissions??a?.permissions??[],...ae!==void 0?{round:ae}:{},...z&&a?.member?{member:a.member}:{},...z&&a?.member&&a.moderator?{moderator:!0}:{}},Xt(t,a),L&&(G=L.name??null),o.onSessionStarted?.(),a}async function M(){if(a){if(Kt(a)){at(t),a=null,await C()||o.onSessionEnded?.("expired");return}await S().catch(()=>{})}}let G=null;async function q(){if(await(p??=a?.member?Promise.resolve():C()),a&&Kt(a)&&(at(t),a=null,G=null,!await C()))return o.onSessionEnded?.("expired"),null;const h=Yt().name||null,m=a!==null&&!a.member&&h!==null&&h!==G;if(!a||As(a)||u||m)try{await S(m)}catch(z){if(!(z instanceof Xe)||z.status===0)throw z;return null}return a?.token??null}async function Z(h,m,z=!1){const L=await q();let N;try{N=await fetch(l+h,{...m,headers:{"content-type":"application/json",...L?{Authorization:`Bearer ${L}`}:{},...m?.headers??{}},credentials:"omit"})}catch(Y){throw new Xe(0,"network_error",Y.message)}if(!N.ok){const Y=await N.json().catch(()=>null),ae=Y?.error?.code??"http_error";if(N.status===401&&!z&&ae!=="session_revoked"){const c=!!a?.member;return at(t),a=null,c&&await C(),Z(h,m,!0)}throw new Xe(N.status,ae,Y?.error?.message??`The server answered ${N.status}.`)}return await N.json()}return{kind:"http",capabilities:{attachments:"none",realtime:"none",anchorReports:!0,identity:["guest"],export:[],serverSideSearch:!1,privateThreads:!1,assignees:!0},async init(h){const m=await Z("/config");return this.capabilities.attachments=m.features.screenshots?"direct":"none",{uid:h.uid,env:h.env,features:m.features,...m.rounds?{rounds:m.rounds}:{},...m.writable===void 0?{}:{writable:m.writable},...m.reason===void 0?{}:{reason:m.reason}}},async reportAnchors(h){if(h.length!==0)for(let m=0;m<h.length;m+=50)try{await Z("/anchor-reports",{method:"POST",body:JSON.stringify({reports:h.slice(m,m+50)})})}catch{return}},revalidate:M,member:()=>a?.member??null,adoptSession(h){try{localStorage.removeItem(d)}catch{}_(h)},signOut(){at(t),a=null,G=null;try{localStorage.setItem(d,"out")}catch{}},getRound(){return a?.round??Ye(t)?.round??null},setRound(h){a&&(a={...a,round:h});const m=Ye(t);m&&Xt(t,{...m,round:h})},async fetchForeignImage(h){try{const m=await q(),z=await fetch(`${l}/image?src=${encodeURIComponent(h)}`,{credentials:"omit",...m?{headers:{Authorization:`Bearer ${m}`}}:{}});if(!z.ok)return null;const L=await z.blob();return L.type.startsWith("image/")?L:null}catch{return null}},async uploadAttachment(h,m){const z=await q(),L=await fetch(`${l}/attachments`,{method:"POST",credentials:"omit",headers:{"content-type":h.type||"image/webp",[Ot.attachmentKind]:m.kind,...m.width?{[Ot.attachmentWidth]:String(m.width)}:{},...m.height?{[Ot.attachmentHeight]:String(m.height)}:{},...z?{Authorization:`Bearer ${z}`}:{}},body:h});if(!L.ok){const Y=await L.json().catch(()=>null);throw new Xe(L.status,Y?.error?.code??"upload_failed",Y?.error?.message??"Upload failed.")}const N=await L.json();return{id:N.id,kind:m.kind,contentType:N.contentType,byteSize:N.byteSize,...m.width?{width:m.width}:{},...m.height?{height:m.height}:{},url:`${r}/api/v1/attachments/${N.id}/blob`}},async listThreads(h){await q();const m=new URLSearchParams;n&&m.set("env",n),h?.route&&m.set("route",h.route),a?.round&&m.set("round",String(a.round));const z=await Z(`/threads?${m}`);return{data:z.data.map(L=>St(L,n,r)),...z.nextCursor?{nextCursor:z.nextCursor}:{},deleted:[],serverTime:z.serverTime}},async getThread(h){return(await this.listThreads()).data.find(z=>z.id===h)??null},async getThreadByKey(h){const m=new URLSearchParams({key:h});n&&m.set("env",n);const L=(await Z(`/threads?${m}`)).data[0];return L?St(L,n,r):null},async createThread(h){const m=await Z("/threads",{method:"POST",body:JSON.stringify({id:h.id,anchor:Es(h.anchor,h.route),anchorState:h.anchorState,context:h.context,...n?{scope:{environment:n}}:{},createdBy:{name:h.createdBy.name},...h.comment?{comment:{id:h.comment.id,body:h.comment.body}}:{},...h.attachments?.length?{attachments:h.attachments.map(z=>z.id)}:{}})});return St(m,n,r)},async patchThread(h,m){const z="assignee"in m;if(!m.status&&!z)return null;const L=await Z(`/threads/${encodeURIComponent(h)}`,{method:"PATCH",body:JSON.stringify({...m.status?{status:m.status}:{},...z?{assignee:m.assignee??null}:{}})});return St(L,n,r)},async listAssignees(h){return(await Z(`/assignees${h?`?q=${encodeURIComponent(h)}`:""}`)).data??[]},async deleteThread(h){await Z(`/threads/${encodeURIComponent(h)}`,{method:"DELETE"})},isMine(h){return h.id?h.id===(a??Ye(t))?.reviewerId||h.id===Xn(t):!1},canModerate(){const h=a??Ye(t);return!!h?.member&&!!h.moderator},can(h){return(a??Ye(t))?.permissions.includes(h)??!1},async createComment(h,m){const z=await Z(`/threads/${encodeURIComponent(h)}/comments`,{method:"POST",body:JSON.stringify({id:m.id,body:m.body})});return{id:z.id,snagId:h,body:z.body,author:z.author,createdAt:z.createdAt}},async patchComment(h,m){return await Z(`/comments/${encodeURIComponent(h)}`,{method:"PATCH",body:JSON.stringify({body:m})}),null},async deleteComment(h){await Z(`/comments/${encodeURIComponent(h)}`,{method:"DELETE"})}}}async function Rs(e,t){if(e.url&&/^https?:/i.test(e.url))try{const n=await fetch(e.url,{credentials:"omit"});if(!n.ok)return null;const o=await n.blob();return o.type&&!o.type.startsWith("image/")?null:o}catch{return null}return t(e.id)}const _s=64,Is=4096,Ps=e=>de.counts(e),Ms=e=>e.filter(t=>t.status!=="resolved").length;function zs(e,t,n){const o=new Map;for(const a of t){const d=o.get(a.route)??{n:0,seen:""};a.status!=="resolved"&&d.n++,a.updatedAt>d.seen&&(d.seen=a.updatedAt),o.set(a.route,d)}o.has(n)||o.set(n,{n:0,seen:new Date().toISOString()});const l=[...o.entries()].sort((a,d)=>d[1].seen.localeCompare(a[1].seen)).slice(0,_s);l.some(([a])=>a===n)||(l[l.length-1]=[n,o.get(n)]);let u={v:1,p:Ms(t),r:Object.fromEntries(l.map(([a,d])=>[a,d.n])),t:new Date().toISOString()};JSON.stringify(u).length>Is&&(u={...u,r:{}});try{localStorage.setItem(Ps(e),JSON.stringify(u))}catch{return null}return u}function Os(e,t){return e?.r[t]??0}const Ds="pass(?:word|wd)?|pwd|secret|token|api[_-]?key|apikey|auth(?:orization)?|credential|session|sid|cookie|jwt|bearer|otp|mfa|totp|cvv|cvc|ssn|nino|iban|card(?:[_-]?number)?|account[_-]?number|private[_-]?key|signature|client[_-]?secret|refresh[_-]?token|access[_-]?token",Ls=new RegExp(`(["'\`]?)(?<![A-Za-z0-9])(?:${Ds})[\\w-]*\\b\\1?\\s*[:=]\\s*(?:(["'\`])((?:\\\\.|(?!\\2)[^\\\\])*)\\2|([^\\s,;&}\\])]{3,}))`,"gi"),Ns=/^(?:Bearer|Basic|Digest|Negotiate|Token)$/i,Hs=(e,t,n,o,r,l,u)=>{if(!n&&Ns.test(r)&&u.slice(l+e.length).startsWith(" [redacted]")||(n?o:r).startsWith("[redacted"))return e;const a=n?`${n}${o}${n}`:r;return e.slice(0,e.length-a.length)+(n?`${n}[redacted]${n}`:"[redacted]")},qn=/data:[a-z0-9.+-]*\/?[a-z0-9.+-]*;base64,[A-Za-z0-9+/=]{16,}/gi,Qn=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{0,}/g,Gn=/\b(sk-[A-Za-z0-9]+-[A-Za-z0-9_-]{20,}|sk-ant-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{20,}|(sk|pk|rk)_(live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|glpat-[A-Za-z0-9_-]{16,}|xox[baprs]-[A-Za-z0-9-]{10,}|xapp-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|ASIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{35}|ya29\.[A-Za-z0-9_-]{20,}|SG\.[A-Za-z0-9_-]{20,}|npm_[A-Za-z0-9]{30,}|dop_v1_[a-f0-9]{40,}|shpat_[a-f0-9]{30,}|sbp_[a-f0-9]{30,}|hf_[A-Za-z0-9]{30,}|nvapi-[A-Za-z0-9_-]{20,})\b/g,Ws=/\b(Bearer|Basic|Digest|Negotiate|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,eo=/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\.[A-Za-z]{2,24})+\b/g,Jt=/\b(?:\d[ -]?){12,18}\d\b/g,to=/\b(?=[A-Za-z0-9+/]*[a-z])(?=[A-Za-z0-9+/]*[A-Z])(?=[A-Za-z0-9+/]*\d)[A-Za-z0-9+/]{40,}={0,2}\b/g,no=/\b[0-9a-f]{32,}\b/gi,oo=/\b(?=[A-Za-z0-9_-]*[a-z])(?=[A-Za-z0-9_-]*[A-Z])(?=[A-Za-z0-9_-]*\d)[A-Za-z0-9_-]{40,}\b/g,ro=/\b[a-z][a-z0-9]{1,15}(?:_[a-z0-9]{1,15}){0,2}_(?=[A-Za-z0-9_-]*[A-Z])(?=[A-Za-z0-9_-]*\d)[A-Za-z0-9_-]{24,}\b/g,so=/\b[a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:[^\s/@]+@/gi,Us=/^(?=[A-Za-z0-9_~.+/=-]*[a-z])(?=[A-Za-z0-9_~.+/=-]*[A-Z])(?=[A-Za-z0-9_~.+/=-]*\d)[A-Za-z0-9_~.+/=-]{24,}$/;function Ce(e,t){e.lastIndex=0;const n=e.test(t);return e.lastIndex=0,n}function ao(e){const t=e.replace(/[ -]/g,"");if(t.length<13||t.length>19)return!1;let n=0,o=!1;for(let r=t.length-1;r>=0;r--){let l=t.charCodeAt(r)-48;o&&(l*=2,l>9&&(l-=9)),n+=l,o=!o}return n%10===0}function js(e){Jt.lastIndex=0;for(const t of e.matchAll(Jt))if(ao(t[0]))return!0;return!1}function At(e){let t=e;return t=t.replace(qn,"data:[redacted]"),t=t.replace(Ws,"$1 [redacted]"),t=t.replace(Ls,Hs),t=t.replace(Qn,"[redacted:jwt]"),t=t.replace(Gn,"[redacted:key]"),t=t.replace(ro,"[redacted:key]"),t=t.replace(so,"[redacted:url-cred]@"),t=t.replace(eo,"[redacted:email]"),t=t.replace(Jt,n=>ao(n)?"[redacted:card]":n),t=t.replace(oo,n=>`[redacted:b64:${n.length}]`),t=t.replace(to,n=>`[redacted:b64:${n.length}]`),t=t.replace(no,n=>`[redacted:hex:${n.length}]`),t}const Fs=bt.query,Bs=bt.fragment;function Zs(e,t=[]){let n;try{const o=globalThis.location?.href;n=new URL(e,o)}catch{return At(e)}n.username="",n.password="";for(const o of[...n.searchParams.keys()]){if(Bs.includes(o)){n.searchParams.set(o,"[redacted]");continue}if(Fs.includes(o))continue;if(!t.includes(o)){n.searchParams.set(o,"[redacted]");continue}const r=n.searchParams.get(o)??"";At(r)!==r&&n.searchParams.set(o,"[redacted]")}return n.hash&&n.hash.length>1&&(n.hash=t.includes("#")?n.hash:"#[redacted]"),At(n.toString().replace(/%5Bredacted%5D/gi,"[redacted]"))}function Vs(e){return e.length>120?!0:Ce(eo,e)||Ce(Qn,e)||Ce(Gn,e)||Ce(no,e)||Ce(to,e)||Ce(qn,e)||Ce(oo,e)||Ce(ro,e)||Ce(so,e)||Us.test(e)||js(e)}const kt={id:"rev_local",name:V("author.unknown"),kind:"guest"},Ys="0.0.0";function io(e,t){if(e)return{...kt,name:e,...t?{email:t}:{}};try{const n=localStorage.getItem(de.identity);if(n)return{...kt,name:n[0]==="{"?JSON.parse(n).name??kt.name:n}}catch{}return kt}function Xs(e){return`SN-${e.reduce((n,o)=>{const r=Number(o.key.split("-")[1]??0);return Number.isFinite(r)&&r>n?r:n},0)+1}`}let qt=null;const xe=e=>Wr(e,qt);function Ks(e,t){const n=vn(),o=n.ownerDocument??document,r=o.defaultView??window,l=t?.config?.site??"local",u=t?.emit??(()=>{}),a=t?.assetBase??"./",d=t?.config?.env??"default";nt(n,"tokens",Fo);const g=Zo(n.host,Bo(t?.config?.theme)),v={},C=t?.config?.storage==="local"?void 0:t?.config?.host,p=C&&l!=="local"?Ts(C,l,t?.config?.env,{reviewToken:t?.reviewToken,onSessionEnded:s=>{ce.show(s==="revoked"?"error.linkrevoked":"error.sessionended")},onSessionStarted:()=>ce.hide()}):gs(l,d,{put:(s,i)=>v.put(s,i),del:s=>v.del(s)}),_=vs(l,d);let B=null;p.init({uid:l,env:d}).then(s=>{B=s.rounds??null,K?.update(x()),s.writable===!1&&s.reason==="origin_not_allowed"&&ce.show("error.origin",void 0,{origin:location.origin})}).catch(()=>{});let S=[],M=[];const G=ms();let q=null,Z=null,h=!1,m=!1,z=!1,L=null,N=!1;const Y={get:()=>q,unavailable:()=>m||z,newPass:()=>Z?.createPassCaches(),fuzzyHit:s=>L?.hit(s)??null,wantFuzzy:(s,i)=>{if(L){L.enqueue(s,i,()=>oe());return}N||!Z||!i.text?.exact||i.text.exact.length<8||(N=!0,Pe("anchor-fuzzy",a,o).then(f=>{if(!f.ok||!Z){z=!0,oe();return}L=f.mod.createFuzzyEngine(o,Z.fuzzyDeps),Re()}))},want:s=>{h||!(s.role&&s.accessibleName)&&!s.text?.exact&&!s.path?.length||(h=!0,Pe("anchor-ext",a,o).then(i=>{if(!i.ok){m=!0,oe();return}Z=i.mod,q=i.mod.resolveExtended,Re()}))}};let ae=null,c=Tr();const R=()=>c.statuses.length>0||!!c.by||!!c.page||c.read!=="all",w=br(n,s=>{if(O==="add"){if(W?.hasText()){W.pulse();return}W?.close(),W=null,me("comments")}b(s.id)},Y,s=>{ae=s,K?K.update(x()):b()});let O=(()=>{try{return sessionStorage.getItem(de.mode)==="comments"?"comments":"browse"}catch{return"browse"}})(),W=null,K=null,re=null,Ue=!1,Se=null,je=!1,$t=null,Te=null,Ae=null,ze=!1;function he(){return Ae?Promise.resolve(Ae):ze?Promise.resolve(null):Pe("capture",a,o).then(i=>i.ok?(v.put=i.mod.putBlob,v.del=i.mod.deleteBlob,Ae=i.mod):(Ke(new Error("chunk unavailable")),null))}function Ke(s){ze||(ze=!0,O==="add"&&me("comments"),te.setDegraded(!0),ce.show("error.capture",{label:"action.retry",run:()=>{ze=!1,te.setDegraded(!1),he()}}),console.warn(`[${we}] the capture chunk failed to load`,s))}let Je=0;function Oe(){const s=new URL(a,o.location.href).href,i=new URL(Ie.panels,s);return i.searchParams.set("cv",Ys),Je>0&&i.searchParams.set("r",String(Je)),Je++,import(i.href)}async function ke(){if(je)return null;if(Se)return Se.catch(()=>null);Se=Oe().catch(async()=>(await new Promise(s=>setTimeout(s,1e3)),Oe()));try{return $t=await Se}catch(s){return Se=null,it(s),null}}function it(s){je=!0,O==="add"&&me("comments"),te.setDegraded(!0),ce.show("error.panels",{label:"action.retry",run:()=>{je=!1,te.setDegraded(!1),b(re)}}),console.warn(`[${we}] the panels chunk failed to load`,s)}const $e=o.defaultView?.matchMedia?.("(pointer: coarse)").matches??!1;let ue=null;async function Et(){if(ue)return;const s=await he();!s||ue||(ue=s.createAddChrome(n,$e,{pick:(i,f)=>void $(i,f),announce:Qe}),ue.setActive(O==="add"))}const pe=o.createElement("div");pe.style.cssText=`position:fixed;left:0;top:0;pointer-events:none;z-index:${Ve.dock}`,n.appendChild(pe);const ct=Pr(r,pe,s=>te.setPuck(s>1.2)),ce=wr(n,pe),Fe=Sr(n,pe),A=Go(n,{onPick:(s,i)=>void $(s,i),onHover:s=>s?ue?.show(s):ue?.clear(),onSelectStart:()=>{$e||nn()}});async function $(s,i){if(W?.hasText()){W.pulse();return}W?.close();const[f,T]=await Promise.all([ke(),he()]);if(!f||!T)return;const F=T.captureContext({page:T.derivePageRef(o.location,ht()),...mt()});hn(s);const J=T.deriveAnchorLabel(s);y(f,s,i,F,J,T)}function y(s,i,f,T,F,J,X,He){let be=i;pt=!1;const ge=xe(o);_t=!1;const gt=()=>{W=null,jn(ge),te.setDraft(Bt()),me("comments")},tt=()=>{et?.abort(),Ne=et=null,gt()},ve={at:f,label:F,...X?{initialBody:X.body,initialName:X.author,...X.email?{initialEmail:X.email}:{}}:{},onDraft:(ie,le,yt)=>{const ko=ns({route:ge,body:ie,author:le,...yt?{email:yt}:{},label:F,anchor:He??J.createElementAnchor(i,{point:f,viewportWidth:r.innerWidth,label:F,...J.describeElement(i)}),at:{x:f.x+r.scrollX,y:f.y+r.scrollY},savedAt:new Date().toISOString()});te.setDraft(Bt()),!ko&&!_t&&(_t=!0,an())},onSend:(ie,le,yt)=>{gt(),cn(be,f,T,ie,le,yt,He)},onRetarget:ie=>{const le=ie==="up"?J.widen(be):J.narrow(be);le&&(be=le,ue?.show(le),W?.setLabel(J.deriveAnchorLabel(le)))},...fe&&Ge!==!1?{onShotOptIn:ie=>pt=ie}:{},onCancel:tt,crumbsOn:fn!==!1,shotsOn:Ge!==!1,...C&&l!=="local"?{serverHost:new URL(C).host}:{},...C&&p.adoptSession?{studio:{host:C,uid:l,env:t?.config?.env,member:p.member(),adopt:ie=>p.adoptSession(ie),signOut:()=>p.signOut()}}:{},...He?.text?.exact?{quote:He.text.exact}:{}};W=s.openComposer(n,ve,pe),ne()}async function U(){const s=xe(o),i=os(s);if(te.setDraft(Bt()),!i||W)return;const[f,T]=await Promise.all([ke(),he()]);if(!f||!T)return;const F=Ut(i.anchor,o,{viewportWidth:r.innerWidth,...q?{extended:q}:{}});if(!F.element)return;const J=F.element.getBoundingClientRect();if(J.width===0&&J.height===0)return;const X={x:i.at.x-r.scrollX,y:i.at.y-r.scrollY};me("add"),y(f,F.element,X,T.captureContext({page:T.derivePageRef(o.location,ht()),...mt()}),i.label,T,{body:i.body,author:i.author,...i.email?{email:i.email}:{}})}async function b(s=null){if(s&&s!==re&&u("thread:open",{threadId:s}),s&&_.mark(s),re=s,Ue=!0,O==="browse"&&me("comments"),K){K.update(x());return}if(!await ke())return;const f=await Pe("dock",a,o);if(!f.ok){ce.show("error.panels",{label:"action.retry",run:()=>void b(re)});return}!Ue||K||(Te=f.mod,K=f.mod.openDock(n,x(),pe),ne())}function D(){_.markAll(S),c.newOnly&&(c={...c,newOnly:!1}),Ue=!1,K?.close(),K=null,re=null,w.highlight(null),ne(),R()&&oe()}function E(s){const i=s?S.find(f=>f.id===s):void 0;if(i&&i.route!==xe(o)){Er(r,i.id),r.location.assign(i.route);return}s&&_.mark(s),re=s,w.highlight(null),R()?oe():K?.update(x()),i&&Te?.scrollToSnag(r,n,i)}function x(){return{snags:S,route:xe(o),openId:re,seenAt:_.map(),onOpen:E,onStatus:(s,i)=>void fo(s,i),onReply:(s,i,f)=>void po(s,i,f),onEdit:(s,i)=>void Q(s,i),onDeleteComment:s=>void H(s),onDeleteThread:s=>void j(s),...p.isMine?{isMine:s=>p.isMine(s)}:{},...C&&p.adoptSession?{studio:{host:C,uid:l,env:t?.config?.env,member:p.member(),adopt:s=>p.adoptSession(s),signOut:()=>p.signOut()}}:{},canDeleteOwnThread:p.can?p.can("thread:delete:own"):!0,canModerate:p.canModerate?.()??!1,...p.listAssignees&&p.can?.("thread:assign")?{assignees:()=>p.listAssignees(),onAssign:(s,i)=>void ho(s,i)}:{},onClearAll:()=>void ee(),onClose:D,onExport:Rt,onHover:s=>w.highlight(s),...B&&B.length>1&&p.setRound?{rounds:B,activeRound:p.getRound?.()??B.find(s=>!s.closed)?.number??B[0].number,onRound:s=>{p.setRound(s),Re()}}:{},onAnnounce:Qe,loadShot:s=>Rs(s,async i=>{const f=await he();return f?(await f.getBlob(i))?.blob??null:null}),filter:c,onFilter:s=>{const i=s.statuses.join()!==c.statuses.join()||s.by!==c.by||s.page!==c.page||s.read!==c.read;c=s,i?oe():K?.update(x())},...ae?{clusterFilter:ae}:{},onClusterClear:()=>{ae=null,K?.update(x())},onShowAnyway:s=>{w.showGhost(s),Te?.scrollToSnag(r,n,s)}}}async function se(s,i){const f=S;S=s,oe();try{await _e(i)}catch{S=f,oe(),ce.show("error.sendfailed",void 0,{item:"change"})}}async function Q(s,i){await se(S.map(f=>({...f,comments:f.comments.map(T=>T.id===s?{...T,body:i}:T)})),()=>p.patchComment(s,i))}async function H(s){await se(S.map(i=>({...i,comments:i.comments.filter(f=>f.id!==s)})),()=>p.deleteComment(s))}async function j(s){const i=re;re===s&&(re=null),await se(S.filter(f=>f.id!==s),()=>p.deleteThread(s)),S.some(f=>f.id===s)&&(re=i)}async function ee(){const s=S.map(i=>i.id);S=[],re=null,oe(),await Promise.all(s.map(i=>_e(()=>p.deleteThread(i))))}const te=ls(n,{onState:s=>me(s),onPanel:()=>K?D():void b(),onNav:s=>en(s),parent:pe}),fe=r.matchMedia?.("(pointer: coarse)").matches??!1,ne=()=>{fe&&te.setConcealed(!!W||!!K)};let ye=null,De=[];function lt(s){let i=!1;const f=()=>{i||(i=!0,r.removeEventListener("scrollend",f),s())};r.addEventListener("scrollend",f,{once:!0}),r.setTimeout(f,600)}const qe=o.createElement("div");qe.setAttribute("aria-live","polite"),qe.setAttribute("role","status");const Qt="position:absolute;width:1px;height:1px;overflow:hidden";qe.style.cssText=Qt;const Ct=o.createElement("div");Ct.setAttribute("aria-live","assertive"),Ct.style.cssText=Qt,n.append(qe,Ct);let Gt=0;function Qe(s){r.clearTimeout(Gt),Gt=r.setTimeout(()=>{qe.textContent=s},400)}function en(s){const i=De.length;if(i===0)return;ye=ye===null?s===1?0:i-1:(ye+s+i)%i;const f=De[ye];us(r,n,f);const T=ye+1;lt(()=>{w.pulse(f.id),Qe(V("nav.announce",{n:T,label:f.anchor.label,i:T,total:i}))})}function tn(){if(O!=="comments"||$e){Ee?.disarm();return}nn().then(s=>{s&&O==="comments"&&s.arm()})}let Ee=null,Tt=null;async function nn(){if(Ee)return Ee;const s=await Pe("text",a,o);return!s.ok||Ee||(Tt=s.mod,Ee=s.mod.createSelectionWatcher(n,{onQuote:(i,f)=>void co(i,f)})),Ee}async function co(s,i){const f=Ae??await he();if(!f||!Tt)return;const T=Tt.createTextAnchor(s,f,{viewportWidth:r.innerWidth,ourRoot:n});if(T.kind==="refused-form-control"){$(T.el,i);return}if(T.kind!=="text")return;const F=await ke();if(!F)return;const J=f.captureContext({page:f.derivePageRef(o.location,ht()),...mt()});try{s.removeAllRanges()}catch{}y(F,T.el,T.point,J,T.label,f,void 0,T.record)}function me(s,i=!1){const f=O;O=s,s!=="add"&&W&&!i&&(W.close(),W=null),s==="add"&&K&&D(),s==="add"&&(ke(),he());try{sessionStorage.setItem(de.mode,s==="add"?"comments":s)}catch{}A.setMode(s),s!==f&&Qe(V(`toolbar.${s}`)),ne(),s==="add"&&Et(),tn(),ue?.setActive(s==="add"),te.setState(s),oe(),s!==f&&u("modechange",{mode:s,previous:f})}let Be=0,on=0;const rn=[300,800,1600,3200];function lo(){if(Be||!w.hasPending()){w.hasPending()||(on=0);return}const s=rn[Math.min(on++,rn.length-1)];Be=r.setTimeout(()=>{Be=0,oe()},s)}const uo=3e3;let sn=0;function oe(s){const i=s??(Date.now()<sn?"navigating":"authoritative");M=w.reanchor(S.filter(xo()),i),wo(),lo();const f=new Map(M.map(X=>[X.id,X]));S=S.map(X=>f.get(X.id)??X);const T=R()?new Set(M.filter(X=>!_r(X,c,_.map())&&X.id!==re).map(X=>X.id)):void 0;De=T?M.filter(X=>!T.has(X.id)):M,w.render(O==="browse"?[]:M,T);const F=xe(o),J=G?zs(o.location.origin,S,F):null;te.setCount(J?Os(J,F):G?M.filter(X=>X.status!=="resolved").length:null),ye!==null&&ye>=De.length&&(ye=null),K?.update(x())}async function Re(){const{data:s}=await p.listThreads();S=s,oe();const i=w.settled();for(const f of i)u("anchor:settled",{threadId:f.id,state:f.state,strategy:f.strategy,confidence:f.confidence});return p.capabilities.anchorReports&&p.reportAnchors&&i.length&&_e(()=>p.reportAnchors(i.map(f=>({threadId:f.id,state:f.state,confidence:f.confidence,strategy:f.strategy})))),p.capabilities.anchorReports||await Promise.all(s.flatMap(f=>{const T=S.find(F=>F.id===f.id);return!T||T.anchorState===f.anchorState?[]:[_e(()=>p.patchThread(T.id,{anchor:T.anchor,anchorState:T.anchorState}))]})),M}async function fo(s,i){S=S.map(f=>f.id===s?{...f,status:i}:f),oe(),u("thread:resolve",{threadId:s,status:i}),await _e(()=>p.patchThread(s,{status:i}))}async function ho(s,i){S=S.map(f=>f.id===s?{...f,assignee:i}:f),oe(),await _e(()=>p.patchThread(s,{assignee:i&&i.id}))}async function po(s,i,f){const T={id:Zn(),body:i,author:io(f)};S=S.map(F=>F.id===s?{...F,comments:[...F.comments,{...T,snagId:s,createdAt:new Date().toISOString()}]}:F),_.mark(s),oe(),u("comment:create",{threadId:s,comment:T}),await _e(()=>p.createComment(s,T))}function an(){ce.show("error.quota",{label:"action.exportclear",run:()=>{Rt("json"),ee()}}),console.warn(`[${we}] ${V("error.quota")}`)}async function _e(s){try{return await s()}catch(i){if(i instanceof Lt&&i.code==="local_quota_exceeded")return an(),null;throw i}}function Rt(s){he().then(async i=>{if(!i)return;const f=await i.resolveAttachmentUris(S).catch(()=>new Map);i.download(n,i.buildExport(s,S,{origin:o.location.origin,exportedAt:new Date().toISOString()},f),r)})}async function cn(s,i,f,T,F,J,X){const He=io(F,J),be=Ae??await he();if(!be)throw new Error(`[${we}] add() needs the capture chunk`);Ne||hn(s);const ge=Ne?await Ne:null;Ne=et=null,be.applyShotOutcome(f,ge,Ge===!1,fe&&!pt);const gt=ge?.blob&&p.uploadAttachment?p.uploadAttachment(ge.blob,{kind:"screenshot",...ge.width!==void 0?{width:ge.width}:{},...ge.height!==void 0?{height:ge.height}:{}}).catch(()=>null):Promise.resolve(null),tt={id:fs(),key:Xs(S),route:xe(o),anchor:X??be.createElementAnchor(s,{point:i,viewportWidth:r.innerWidth,label:be.deriveAnchorLabel(s),...be.describeElement(s)}),anchorState:"anchored",scope:bo(),context:f,createdBy:He,createdAt:new Date().toISOString(),...T?{comment:{id:Zn(),body:T,author:He}}:{}},ve=Cn(tt);ge?.blob&&(ve.screenshotBlob=ge.blob),S=[...S,ve],_.mark(ve.id),Qe(V("announce.created",{key:ve.key})),u("thread:create",{thread:ve}),O==="browse"?me("comments"):oe();try{const ie=await gt;ie&&(tt.attachments=[ie],S=S.map(le=>le.id===ve.id?{...le,attachments:[ie]}:le),oe()),await _e(()=>p.createThread(tt))}catch(ie){throw S=S.filter(le=>le.id!==ve.id),oe(),ce.show("error.sendfailed",void 0,{item:Pt.toLowerCase()}),console.warn(`[${we}] ${V("error.sendfailed",{item:Pt.toLowerCase()})}`,ie),ie}return ve}function ln(s){if((s.key==="n"||s.key==="p")&&O==="comments"&&!W){if(s.metaKey||s.ctrlKey||s.altKey)return;const i=s.composedPath()[0]??s.target;if(i&&(i.closest?.("input,textarea,select,[contenteditable]")||i.isContentEditable))return;s.preventDefault(),s.stopPropagation(),en(s.key==="n"?1:-1);return}O==="add"&&s.key==="Escape"&&(W||(s.stopPropagation(),me("comments")))}o.addEventListener("keydown",ln,!0);let dn=0;const un=()=>{if(o.hidden||!p.revalidate)return;const s=Date.now();s-dn<3e4||(dn=s,p.revalidate())};o.addEventListener("visibilitychange",un);const mo=Lo(n),go=No(n,s=>{console.warn(`[${we}] the host page hid the widget from assistive technology ${s} times; leaving it alone.`)}),yo=Do(n,s=>{console.warn(`[${we}] the host page removed the widget ${s} times; leaving it alone. Reload to comment again.`)});function bo(){return{environment:d,...t?.config?.branch?{branch:t.config.branch}:{}}}let dt={route:xe(o),url:o.location.href},_t=!1,ut=null;function vo(s){if(s){if(O==="browse")return;ut=O,me("browse",!0),Fe.show(),u("paused",{reason:"modal-dialog"})}else if(ut){const i=ut;ut=null,Fe.hide(),me(i),u("resumed",{mode:i})}}ke();function wo(){M.length>0&&Pe("dock",a,o)}{const s=o.createElement("div");s.style.cssText="position:fixed;inset:0;pointer-events:none;visibility:hidden",n.appendChild(s);const i=s.getBoundingClientRect(),f=Math.abs(i.left)>1||Math.abs(i.top)>1||Math.abs(i.width-r.innerWidth)>1||Math.abs(i.height-r.innerHeight)>1;s.remove(),f&&(console.warn(`[${we}] fixed-trapped: <html> has transform/filter/contain, so our fixed layer follows it, not the viewport. Remove it, or expect drift.`),u("error",{code:"fixed-trapped"}))}let Ze=null;const ft=new Set,Le=(()=>{const s=r[To.config];return s&&typeof s=="object"?s:void 0})(),fn=Le?.breadcrumbs,It=(()=>{const s=Le?.significantQueryParams,i=Le?.ignoredQueryParams,f={};return s==="*"?f.significantQueryParams="*":Array.isArray(s)&&(f.significantQueryParams=s.map(String)),Array.isArray(i)&&(f.ignoredQueryParams=i.map(String)),f})(),ht=()=>({routeOverride:qt,query:It,doc:o}),Ge=Le?.screenshot===!1?!1:Le?.screenshot&&typeof Le.screenshot=="object"?Le.screenshot:{};let pt=!1,Ne=null,et=null;function hn(s){if(Ge===!1||Ne||fe&&!pt)return;et=new AbortController;const i=et.signal;Ne=Pe("screenshot",a,o).then(f=>f.ok?f.mod.captureScreenshot({doc:o,target:s,signal:i,...Ge,...p.fetchForeignImage?{fetchForeignImage:T=>p.fetchForeignImage(T)}:{}}):{situation:"engine-load-failed",blindSpots:[],maskedCount:0})}function xo(){const s=xe(o),i=Hn(o.location.pathname),f=Br(o.location.search,It);return T=>(T.route===s||T.context?.page?.pathname===i)&&Zr(T.context?.page?.query,f,It)}{const s=fn;s!==!1&&Pe("crumbs",a,o).then(i=>{i.ok&&(Ze=i.mod.installTierC({win:r,...t?.early?{early:t.early}:{},...s&&typeof s=="object"?{config:s}:{},subscribeNav:f=>(ft.add(f),()=>ft.delete(f))}))})}const mt=()=>Ze?{breadcrumbs:{records:Ze.drain(),status:Ze.status()}}:{},So=Jr(o,r,()=>{O!=="browse"&&M.length>0&&oe()}),Ao=$r(r,{onResize:()=>oe(),onRoute:()=>{const s={route:xe(o),url:o.location.href},i=s.route!==dt.route;if(i){u("navigate",{from:dt,to:s});for(const f of ft)f(dt.url,s.url)}if(dt=s,!i){Re();return}sn=Date.now()+uo,r.setTimeout(()=>{p.listThreads().then(({data:f})=>{S=f,oe("optimistic")})},100),r.setTimeout(()=>void Re(),600)},onModal:vo});return te.setState(O),A.setMode(O),tn(),G||ce.show("error.nostorage",{label:"action.export",run:()=>Rt("md")}),Re().then(async s=>{const i=Cr(r);if(!i){const T=new URLSearchParams(o.location.search).get(Mo("t"));if(T){let F=s.find(J=>J.key===T);if(!F&&p.getThreadByKey){const J=await p.getThreadByKey(T).catch(()=>null);J&&(S=[...S.filter(X=>X.id!==J.id),J],oe(),F=S.find(X=>X.id===J.id))}F?(await b(F.id),Te?.scrollToSnag(r,n,F)):(ce.show("permalink.unknown"),await b(null));return}await U();return}const f=s.find(T=>T.id===i);await b(f?i:null),f&&Te?.scrollToSnag(r,n,f)}),{root:n,assetBase:t?.assetBase??"",snags:()=>M,async add(s,i,f,T){const F=T?null:await he(),J=T??(F?F.captureContext({page:F.derivePageRef(o.location,ht()),...mt()}):void 0);if(!J)throw new Error(`[${we}] add() needs the capture chunk, or an explicit context`);return cn(s,i,J,f)},refresh:Re,setRoute(s){qt=s&&s.startsWith("/")?s:null,Re()},setState:me,getState:()=>O,openPanel:b,async open(s){const i=s.startsWith(vt.thread)?S.find(f=>f.id===s):S.find(f=>f.key===s);return i?i.route!==xe(o)?{ok:!1,reason:"wrong-page",url:i.context?.url??i.route,route:i.route}:(await b(i.id),Te?.scrollToSnag(r,n,i),{ok:!0,anchorState:i.anchorState}):{ok:!1,reason:"not-found"}},closePanel:D,hitTest:(s,i)=>A.hitTest(s,i),destroy(){W?.close(),D(),ue?.destroy(),ce.destroy(),Fe.destroy(),ct(),yo(),go(),mo(),Ao.destroy(),So.destroy(),Ze?.destroy(),Ze=null,ft.clear(),Ee?.destroy(),Ee=null,L?.destroy(),L=null,Be&&r.clearTimeout(Be),Be=0,o.removeEventListener("keydown",ln,!0),o.removeEventListener("visibilitychange",un),g(),A.destroy(),w.destroy(),te.destroy(),n.host.remove()}}}export{yn as HOST_CSS,vn as createHost,Vs as isSensitiveValue,Ks as mount,At as redactText,Zs as redactUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const dt={root:"data-snag-root"},V=t=>dt[t],ut={anchor:"data-snag-anchor",ignore:"data-snag-ignore",mask:"data-snag-mask",nomask:"data-snag-nomask",src:"data-snag-src",component:"data-snag-component"},ht=t=>ut[t],ft={mask:"snag-mask",block:"snag-block"},nt=t=>ft[t],L=(t,e,n)=>t===1?e:n;function z(t){const e=[],n=t.corsImages??0;n>0&&e.push(`${n} ${L(n,"image may appear as a placeholder","images may appear as placeholders")} (served without CORS headers)`);const i=t.failedImages??0;i>0&&e.push(`${i} ${L(i,"image","images")} could not be included in the screenshot`);const o=t.shadowRoots??0;o>0&&e.push(o===1?"1 web component could not be captured (its contents are in a shadow root)":`${o} web components could not be captured (their contents are in shadow roots)`);const s=t.iframeHosts??[];if(s.length>0){const w=[...new Set(s.filter(Boolean))].join(", ");e.push(`${s.length} cross-origin ${L(s.length,"iframe","iframes")} not captured${w?`: ${w}`:""}`)}const c=t.taintedCanvases??0;c>0&&e.push(c===1?"1 canvas could not be read (tainted by a cross-origin image)":`${c} canvases could not be read (tainted by cross-origin images)`);const u=t.blankCanvases??0;u>0&&e.push(`${u} ${L(u,"canvas","canvases")} may appear blank`),(t.videos??0)>0&&e.push("Video frames are not captured");const f=t.failedOverlays??0;return f>0&&e.push(`${f} overlay ${L(f,"element","elements")} could not be captured`),e}const gt=["display","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","gap","align-items","align-content","align-self","justify-content","justify-items","justify-self","grid-template-columns","grid-template-rows","grid-column","grid-row","box-sizing","width","height","margin","padding","border","border-radius","position","top","right","bottom","left","z-index","isolation","transform","transform-origin","object-fit","object-position","vertical-align","text-transform","background-color","background","color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-decoration","text-align","white-space","text-wrap","overflow","opacity","box-shadow","max-width","list-style"],mt=6e3;function it(t,e){try{return new URL(t,e.baseURI).origin===e.location.origin}catch{return!1}}function G(t){return new Promise(e=>{const n=new FileReader;n.onload=()=>e(typeof n.result=="string"?n.result:null),n.onerror=()=>e(null),n.readAsDataURL(t)})}async function wt(t,e){try{const n=await fetch(new URL(t,e.baseURI).href,{credentials:"same-origin"});return n.ok?await G(await n.blob()):null}catch{return null}}async function pt(t,e,n){const i=new URL(t,e.baseURI).href;try{const s=await fetch(i,{mode:"cors",credentials:"omit"});if(s.ok)return await G(await s.blob())}catch{}if(!n)return null;const o=await n(i).catch(()=>null);return o?await G(o):null}function bt(t,e){try{return/^https?:$/.test(new URL(t,e.baseURI).protocol)}catch{return!1}}const X="data:image/gif;base64,R0lGODlhAQABAIAAALu7uwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",At="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";async function Y(t,e){const n=t.ownerDocument,i=n.defaultView??window,o=t.getBoundingClientRect();if(o.width<4||o.height<4)throw new Error("raster:too-small");const s=t.cloneNode(!0);let c=0,u=0,f=0;const w=[],g=[],m=i.innerWidth,h=i.innerHeight,k=l=>{const d=l.getBoundingClientRect();return d.width>0&&d.height>0&&d.right>0&&d.bottom>0&&d.left<m&&d.top<h},M=l=>{const d=i.getComputedStyle(l),C=l.getBoundingClientRect();return`display:${d.display==="inline"?"inline-block":d.display};box-sizing:border-box;width:${C.width}px;height:${C.height}px;margin:${d.margin};border:${d.border};padding:${d.padding};vertical-align:${d.verticalAlign}`},p="img, canvas, iframe, video",R=[...t.querySelectorAll(p)],A=[...s.querySelectorAll(p)];for(let l=0;l<Math.min(R.length,A.length);l++){const d=R[l],C=A[l];if(e.drop?.(d))continue;if(d.tagName!=="IMG"){let a="";if(d.tagName==="CANVAS"&&e.inlineSameOriginAssets&&k(d))try{a=d.toDataURL()}catch{}const r=n.createElement(a?"img":"span");a&&r.setAttribute("src",a);const b=d.getAttribute("class");b&&r.setAttribute("class",b),r.setAttribute("style",M(d)),C.replaceWith(r);continue}const y=C;y.removeAttribute("srcset"),y.removeAttribute("sizes"),y.removeAttribute("loading");const S=d.currentSrc||d.getAttribute("src")||"";S&&(k(d)?e.inlineSameOriginAssets&&it(S,n)?w.push(wt(S,n).then(a=>{a?y.setAttribute("src",a):(y.setAttribute("src",X),f++)})):e.inlineSameOriginAssets&&bt(S,n)?(y.setAttribute("src",X),w.push(pt(S,n,e.fetchForeignImage).then(a=>{a?y.setAttribute("src",a):u++}))):S.startsWith("data:")||(y.setAttribute("src",X),it(S,n)||u++):y.setAttribute("src",At))}for(const l of s.querySelectorAll("picture > source"))l.remove();const E=64,P=l=>l.bottom<-E||l.top>h+E||l.right<-E||l.left>m+E,T=/^(?:SCRIPT|NOSCRIPT)$/,x=/^(?:IFRAME|VIDEO|CANVAS)$/;let B=0;const I=[[t,s]];for(;I.length>0&&B<mt;){const[l,d]=I.pop();if(T.test(l.tagName)||e.drop?.(l)){g.push(d);continue}if(x.test(l.tagName))continue;B++;const C=i.getComputedStyle(l);let y=gt.map(r=>`${r}:${C.getPropertyValue(r)}`).join(";");if(e.hide?.(l)&&(y+=";visibility:hidden"),d.setAttribute("style",y),l.shadowRoot){const r=l.getBoundingClientRect();r.width>=1&&r.height>=1&&C.visibility!=="hidden"&&(c++,d.setAttribute("style",y+";background:repeating-linear-gradient(45deg,#eee,#eee 6px,#ddd 6px,#ddd 12px)"))}if(C.display==="none")continue;if(l!==t&&C.position!=="fixed"&&P(l.getBoundingClientRect())){const r=[...d.querySelectorAll("style")];d.replaceChildren(...r);continue}const S=l.children,a=d.children;for(let r=Math.min(S.length,a.length)-1;r>=0;r--)I.push([S[r],a[r]])}for(const l of g)l.remove();for(const l of s.querySelectorAll("script, iframe, video, canvas, noscript"))l.remove();await Promise.all(w);const D=z({corsImages:u,failedImages:f,shadowRoots:c}),_=`<svg xmlns="http://www.w3.org/2000/svg" width="${Math.ceil(o.width)}" height="${Math.ceil(o.height)}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">`+new XMLSerializer().serializeToString(s)+"</div></foreignObject></svg>",O=new i.Image,v=new Promise((l,d)=>{O.onload=()=>l(),O.onerror=()=>d(new Error("raster:img-error"))});return O.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(_),await v,{image:O,width:o.width,height:o.height,blindSpots:D}}let F=null;function ot(t){return F||(F=new Promise(e=>{const n=new(t.defaultView??window).Image,i=setTimeout(()=>e(!1),1e3);n.onload=()=>{clearTimeout(i),e(!0)},n.onerror=()=>{clearTimeout(i),e(!1)},n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"/>')}),F)}const Q=256e3,J=1600,yt=2048,at=.82,vt=5e5;let U=null;function st(t){if(U!==null)return U;try{const e=t.createElement("canvas");e.width=1,e.height=1,U=e.toDataURL("image/webp").startsWith("data:image/webp")}catch{U=!1}return U}function H(t,e,n){return new Promise((i,o)=>{try{t.toBlob(s=>i(s),e,n)}catch(s){s.name==="SecurityError"?o(s):i(null)}})}async function rt(t,e,n){const i=st(e)?await H(t,"image/webp",n):await H(t,"image/jpeg",Math.max(n,.85));return i&&(i.type==="image/webp"||i.type==="image/jpeg")?i:H(t,"image/png")}async function lt(t,e,n=J){const i=Math.min(Math.max(1,n),yt);let o=t;const s=Math.max(o.width,o.height);s>i&&(o=ct(t,e,i/s));let c=at,u=!1;for(let w=0;w<4;w++){let g=await rt(o,e,c);if(!g)return null;if(o.width*o.height<=vt){const m=await H(o,"image/png");m&&m.size<g.size&&(g=m)}if(g.size<=Q)return{blob:g,quality:c,rescaled:u};c>.55?c-=.12:(o=ct(o,e,.75),c=at,u=!0)}const f=await rt(o,e,c);return f&&f.size<=Q?{blob:f,quality:c,rescaled:u}:null}function ct(t,e,n){const i=e.createElement("canvas");return i.width=Math.max(1,Math.round(t.width*n)),i.height=Math.max(1,Math.round(t.height*n)),i.getContext("2d").drawImage(t,0,0,i.width,i.height),i}function kt(t){const e=[`[${ht("mask")}]`,`.${nt("mask")}`,`.${nt("block")}`,'input[type="password"]','input[autocomplete*="password" i]','[autocomplete*="cc-" i]','[autocomplete="one-time-code"]','input[type="email"]','input[type="tel"]'];return t.maskAllInputs&&e.push("input","textarea","select","[contenteditable]"),[...e,...t.maskSelectors??[]]}function St(t,e){const n=t.defaultView??window,i=performance.now(),o=[],s=[],c=`[${V("root")}]`,u=t.querySelectorAll("body *"),f=u.length>5e3,w=f?t.querySelectorAll("body > *, [class*=fixed], [class*=sticky], header, nav, dialog, [popover], [role=dialog], [role=tooltip], [role=menu]"):u;f&&o.push("Overlay scan was reduced on this very large page; some fixed elements may be missing.");for(const h of w){if(performance.now()-i>8)return o.push("Overlay scan ran out of time; fixed and sticky elements are not composited."),{overlays:[],notes:o};if(h.closest(c))continue;let k=!1,M=!1;try{h.matches(":popover-open")&&(k=!0)}catch{}if(h instanceof n.HTMLDialogElement&&h.open){k=!0;try{M=h.matches(":modal")}catch{M=!1}}if(!k){const A=n.getComputedStyle(h).position;(A==="fixed"||A==="sticky")&&(k=!0)}if(!k)continue;const p=A=>A.width>=1&&A.height>=1&&A.bottom>=0&&A.right>=0&&A.top<=n.innerHeight&&A.left<=n.innerWidth,R=h.getBoundingClientRect();if(R.width<1||R.height<1){for(const A of h.children){const E=A.getBoundingClientRect();p(E)&&s.push({el:A,rect:E,modal:M})}continue}p(R)&&s.push({el:h,rect:R,modal:M})}const g=s.filter(h=>!s.some(k=>k!==h&&k.el.contains(h.el))),m=(h,k,M)=>h===1?k:M;if(g.length>e){const h=g.length-e;o.push(`${h} overlay ${m(h,"element","elements")} (fixed/sticky/menus) ${m(h,"was","were")} not captured`)}if(g.length>0){const h=Math.min(g.length,e);o.push(`${h} overlay ${m(h,"element","elements")} ${m(h,"was","were")} re-composited; ${m(h,"its","their")} stacking order is approximate`)}return{overlays:g.slice(0,e),notes:o}}function Rt(t,e){if(t.width===0||t.height===0)return!1;try{const n=e.createElement("canvas");n.width=n.height=16;const i=n.getContext("2d",{willReadFrequently:!0});if(!i)return!1;i.drawImage(t,0,0,16,16);const o=i.getImageData(0,0,16,16).data;for(let s=3;s<o.length;s+=4)if(o[s]>0)return!0;return!1}catch{return!1}}function Ct(t,e,n){const i=performance.now(),o=[],s=t.querySelectorAll("iframe, canvas, video");if(s.length>5e3)return e.push("Blind-spot scan skipped on this very large page."),o;const c={iframeHosts:[],taintedCanvases:0,blankCanvases:0,videos:0};for(const u of s){if(performance.now()-i>5)break;if(u.closest(`[${V("root")}]`))continue;const f=u.getBoundingClientRect();if(!(f.width<2||f.height<2))if(u.tagName==="IFRAME"){const w=u;let g=!1;try{w.contentDocument||(g=!0)}catch{g=!0}if(g){let m="";try{m=new URL(w.src,t.baseURI).host}catch{}c.iframeHosts.push(m),o.push({el:u,rect:f,label:"iframe not captured"})}}else if(u.tagName==="CANVAS"){const w=u;let g=!1;try{w.toDataURL()}catch(m){g=m.name==="SecurityError"}if(!g&&n&&Rt(w,t))continue;g?c.taintedCanvases++:c.blankCanvases++,o.push({el:u,rect:f,label:"canvas not captured"})}else c.videos++,o.push({el:u,rect:f,label:"video not captured"})}return e.push(...z(c)),o}function xt(t,e,n,i,o,s){t.save(),t.beginPath(),t.rect(e,n,i,o),t.clip(),t.fillStyle="#f3f3f3",t.fillRect(e,n,i,o),t.strokeStyle="#d0d0d0",t.lineWidth=1,t.beginPath();for(let c=-o;c<i;c+=12)t.moveTo(e+c,n+o),t.lineTo(e+c+o,n);t.stroke(),t.strokeRect(e+.5,n+.5,i-1,o-1),i>=120&&o>=20&&(t.fillStyle="#8a8f98",t.font="11px system-ui, sans-serif",t.textAlign="center",t.fillText(s,e+i/2,n+o/2+4)),t.restore()}function Mt(t,e,n,i,o){t.save(),t.fillStyle="#5b5f66",t.fillRect(e,n,i,o),t.strokeStyle="#8a8f98",t.lineWidth=1,t.strokeRect(e+.5,n+.5,i-1,o-1),i>=80&&o>=24&&(t.fillStyle="#c9cdd3",t.font="11px system-ui, sans-serif",t.textAlign="center",t.fillText("masked",e+i/2,n+o/2+4)),t.restore()}function Et(t){const e=t.defaultView??window;for(const n of[t.documentElement,t.body]){if(!n)continue;const i=e.getComputedStyle(n).backgroundColor;if(i&&i!=="rgba(0, 0, 0, 0)"&&i!=="transparent")return i}return"#ffffff"}async function W(t,e,n,i,o){const s=t.doc,c=s.defaultView??window,u=`[${V("root")}]`,f=[];if(await Promise.race([new Promise(a=>c.requestAnimationFrame(()=>c.requestAnimationFrame(a))),new Promise(a=>c.setTimeout(a,50))]),s.hidden&&await new Promise(a=>{const r=c.setTimeout(a,500);s.addEventListener("visibilitychange",()=>{c.clearTimeout(r),a()},{once:!0})}),t.signal?.aborted)throw new Error("navigated");let w,g;try{const a=kt(t).join(", "),r=[...s.querySelectorAll(a)].filter(b=>!b.closest(u));g=new Set(r),w=r.map(b=>b.getBoundingClientRect()).filter(b=>b.width>0&&b.height>0)}catch(a){throw Object.assign(new Error("masking-failed"),{cause:a})}const{overlays:m,notes:h}=i?St(s,t.maxOverlays??8):{overlays:[],notes:[]};f.push(...h);const k=Ct(s,f,n),M=new Set([...m.map(a=>a.el),...g]);let p=Math.min(c.devicePixelRatio||1,t.maxDpr??2);const R=s.documentElement,A=e==="viewport"?R.scrollWidth:0,E=e==="viewport"?R.scrollHeight:0,P=t.maxRasterPixels??4e7;if(e==="viewport"){const a=A*E*p*p;if(a>P&&(p=Math.max(1,p*Math.sqrt(P/a))),A*E>P)return W(t,"element",n,i,!0)}let T=R,x,B={x:0,y:0};if(e==="viewport")x={x:0,y:0,w:c.innerWidth,h:c.innerHeight};else{const a=t.target&&t.target.isConnected?t.target:R,r=a.getBoundingClientRect(),b=200,N=Math.max(0,r.left-b),q=Math.max(0,r.top-b),Z=Math.min(c.innerWidth,r.right+b),tt=Math.min(c.innerHeight,r.bottom+b);let $=a;for(;$.parentElement&&$!==R;){const j=$.getBoundingClientRect();if(j.left<=N&&j.top<=q&&j.right>=Z&&j.bottom>=tt)break;$=$.parentElement}T=$;const et=$.getBoundingClientRect();x={x:N-et.left,y:q-et.top,w:Z-N,h:tt-q},B={x:N,y:q}}const I=await Y(T,{drop:a=>a.closest?.(u)!=null,hide:a=>M.has(a),inlineSameOriginAssets:n,...t.fetchForeignImage?{fetchForeignImage:t.fetchForeignImage}:{}});if(f.push(...I.blindSpots),t.signal?.aborted)throw I.image.src="",new Error("navigated");const D=T.getBoundingClientRect(),_=e==="viewport"?-D.left:x.x,O=e==="viewport"?-D.top:x.y,v=s.createElement("canvas");v.width=Math.max(1,Math.round(x.w*p)),v.height=Math.max(1,Math.round(x.h*p));const l=v.getContext("2d");l.fillStyle=Et(s),l.fillRect(0,0,v.width,v.height),l.drawImage(I.image,_,O,x.w,x.h,0,0,v.width,v.height),I.image.src="",m.some(a=>a.modal)&&(l.fillStyle="rgba(0,0,0,0.35)",l.fillRect(0,0,v.width,v.height));let d=0;for(const a of m)try{const r=await Y(a.el,{drop:b=>b.closest?.(u)!=null,hide:b=>g.has(b),inlineSameOriginAssets:n,...t.fetchForeignImage?{fetchForeignImage:t.fetchForeignImage}:{}});l.drawImage(r.image,Math.round(a.rect.left*p),Math.round(a.rect.top*p),Math.round(a.rect.width*p),Math.round(a.rect.height*p)),r.image.src=""}catch{d++}f.push(...z({failedOverlays:d}));const C=a=>({x:Math.round((a.left-B.x)*p),y:Math.round((a.top-B.y)*p),w:Math.round(a.width*p),h:Math.round(a.height*p)});for(const a of k){const r=C(a.rect);r.w>0&&r.h>0&&xt(l,r.x,r.y,r.w,r.h,a.label)}let y=0;try{for(const a of w){const r=C(a);r.w<=0||r.h<=0||(Mt(l,r.x,r.y,r.w,r.h),y++)}}catch(a){throw Object.assign(new Error("masking-failed"),{cause:a})}if(t.signal?.aborted)throw new Error("navigated");let S;try{S=await lt(v,s,t.maxLongestSide??J)}catch(a){throw v.width=v.height=0,a.name==="SecurityError"?new Error("tainted"):a}return v.width=v.height=0,S?{situation:o?"scope-forced":"ok",blob:S.blob,quality:S.quality,width:Math.round(x.w),height:Math.round(x.h),blindSpots:f,maskedCount:y}:{situation:"engine-failed",blindSpots:f,maskedCount:y}}function K(t,e){return Promise.race([t.catch(n=>n.message==="masking-failed"?{situation:"masking-failed",blindSpots:[],maskedCount:0}:n.message==="navigated"?{situation:"navigated",blindSpots:[],maskedCount:0}:n.message==="tainted"?{situation:"tainted",blindSpots:[],maskedCount:0}:{situation:"engine-failed",blindSpots:[],maskedCount:0}),new Promise(n=>setTimeout(()=>n({situation:"timeout",blindSpots:[],maskedCount:0}),e))])}async function It(t){if(!await ot(t.doc))return{situation:"csp-blocked",blindSpots:[],maskedCount:0};const e=t.scope??"viewport",n=[t.timeoutMs??3e3,1500,1500];let i=await K(W(t,e,!0,!0,!1),Math.min(n[0],1e4));if(i.situation==="ok"||i.situation==="scope-forced"||i.situation==="masking-failed"||i.situation==="navigated"||i.situation==="tainted"||(i=await K(W(t,e,!1,!1,!1),n[1]),i.situation==="ok"||i.situation==="scope-forced"||i.situation==="masking-failed"||i.situation==="navigated"||i.situation==="tainted"))return i;const o=await K(W(t,"element",!1,!1,!0),n[2]);return o.situation==="ok"||o.situation==="scope-forced"?o:o.situation==="engine-failed"&&i.situation==="timeout"?i:o}const $t="screenshot";export{$t as CHUNK,J as MAX_LONGEST_SIDE,Q as TARGET_BYTES,st as canEncodeWebp,It as captureScreenshot,lt as encodeToBudget,ot as probeDataImages,Y as rasterise};
|
|
1
|
+
const dt={root:"data-snag-root"},V=t=>dt[t],ut={anchor:"data-snag-anchor",ignore:"data-snag-ignore",mask:"data-snag-mask",nomask:"data-snag-nomask",src:"data-snag-src",component:"data-snag-component"},ht=t=>ut[t],gt={mask:"snag-mask",block:"snag-block"},nt=t=>gt[t],L=(t,e,n)=>t===1?e:n;function z(t){const e=[],n=t.corsImages??0;n>0&&e.push(`${n} ${L(n,"image may appear as a placeholder","images may appear as placeholders")} (served without CORS headers)`);const i=t.failedImages??0;i>0&&e.push(`${i} ${L(i,"image","images")} could not be included in the screenshot`);const o=t.shadowRoots??0;o>0&&e.push(o===1?"1 web component could not be captured (its contents are in a shadow root)":`${o} web components could not be captured (their contents are in shadow roots)`);const s=t.iframeHosts??[];if(s.length>0){const v=[...new Set(s.filter(Boolean))].join(", ");e.push(`${s.length} cross-origin ${L(s.length,"iframe","iframes")} not captured${v?`: ${v}`:""}`)}const c=t.taintedCanvases??0;c>0&&e.push(c===1?"1 canvas could not be read (tainted by a cross-origin image)":`${c} canvases could not be read (tainted by cross-origin images)`);const m=t.blankCanvases??0;m>0&&e.push(`${m} ${L(m,"canvas","canvases")} may appear blank`),(t.videos??0)>0&&e.push("Video frames are not captured");const h=t.failedOverlays??0;return h>0&&e.push(`${h} overlay ${L(h,"element","elements")} could not be captured`),e}const ft=["display","flex-direction","flex-wrap","flex-grow","flex-shrink","flex-basis","order","gap","align-items","align-content","align-self","justify-content","justify-items","justify-self","grid-template-columns","grid-template-rows","grid-column","grid-row","box-sizing","width","height","margin","padding","border","border-radius","position","top","right","bottom","left","z-index","isolation","transform","transform-origin","object-fit","object-position","vertical-align","text-transform","background-color","background","color","font-family","font-size","font-weight","font-style","line-height","letter-spacing","text-decoration","text-align","white-space","text-wrap","overflow","opacity","box-shadow","max-width","list-style"],mt=6e3;function it(t,e){try{return new URL(t,e.baseURI).origin===e.location.origin}catch{return!1}}function G(t){return new Promise(e=>{const n=new FileReader;n.onload=()=>e(typeof n.result=="string"?n.result:null),n.onerror=()=>e(null),n.readAsDataURL(t)})}async function wt(t,e){try{const n=await fetch(new URL(t,e.baseURI).href,{credentials:"same-origin"});return n.ok?await G(await n.blob()):null}catch{return null}}async function pt(t,e,n){const i=new URL(t,e.baseURI).href;try{const s=await fetch(i,{mode:"cors",credentials:"omit"});if(s.ok)return await G(await s.blob())}catch{}if(!n)return null;const o=await n(i).catch(()=>null);return o?await G(o):null}function bt(t,e){try{return/^https?:$/.test(new URL(t,e.baseURI).protocol)}catch{return!1}}const X="data:image/gif;base64,R0lGODlhAQABAIAAALu7uwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",At="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";async function Y(t,e){const n=t.ownerDocument,i=n.defaultView??window,o=t.getBoundingClientRect();if(o.width<4||o.height<4)throw new Error("raster:too-small");const s=t.cloneNode(!0);let c=0,m=0,h=0;const v=[],g=[],f=i.innerWidth,u=i.innerHeight,b=l=>{const d=l.getBoundingClientRect();return d.width>0&&d.height>0&&d.right>0&&d.bottom>0&&d.left<f&&d.top<u},E=l=>{const d=i.getComputedStyle(l),C=l.getBoundingClientRect();return`display:${d.display==="inline"?"inline-block":d.display};box-sizing:border-box;width:${C.width}px;height:${C.height}px;margin:${d.margin};border:${d.border};padding:${d.padding};vertical-align:${d.verticalAlign}`},w="img, canvas, iframe, video",R=[...t.querySelectorAll(w)],A=[...s.querySelectorAll(w)];for(let l=0;l<Math.min(R.length,A.length);l++){const d=R[l],C=A[l];if(e.drop?.(d))continue;if(d.tagName!=="IMG"){let a="";if(d.tagName==="CANVAS"&&e.inlineSameOriginAssets&&b(d))try{a=d.toDataURL()}catch{}const r=n.createElement(a?"img":"span");a&&r.setAttribute("src",a);const p=d.getAttribute("class");p&&r.setAttribute("class",p),r.setAttribute("style",E(d)),C.replaceWith(r);continue}const y=C;y.removeAttribute("srcset"),y.removeAttribute("sizes"),y.removeAttribute("loading");const S=d.currentSrc||d.getAttribute("src")||"";S&&(b(d)?e.inlineSameOriginAssets&&it(S,n)?v.push(wt(S,n).then(a=>{a?y.setAttribute("src",a):(y.setAttribute("src",X),h++)})):e.inlineSameOriginAssets&&bt(S,n)?(y.setAttribute("src",X),v.push(pt(S,n,e.fetchForeignImage).then(a=>{a?y.setAttribute("src",a):m++}))):S.startsWith("data:")||(y.setAttribute("src",X),it(S,n)||m++):y.setAttribute("src",At))}for(const l of s.querySelectorAll("picture > source"))l.remove();const M=64,P=l=>l.bottom<-M||l.top>u+M||l.right<-M||l.left>f+M,T=/^(?:SCRIPT|NOSCRIPT)$/,x=/^(?:IFRAME|VIDEO|CANVAS)$/;let B=0;const I=[[t,s]];for(;I.length>0&&B<mt;){const[l,d]=I.pop();if(T.test(l.tagName)||e.drop?.(l)){g.push(d);continue}if(x.test(l.tagName))continue;B++;const C=i.getComputedStyle(l);let y=ft.map(r=>`${r}:${C.getPropertyValue(r)}`).join(";");if(e.hide?.(l)&&(y+=";visibility:hidden"),d.setAttribute("style",y),l.shadowRoot){const r=l.getBoundingClientRect();r.width>=1&&r.height>=1&&C.visibility!=="hidden"&&(c++,d.setAttribute("style",y+";background:repeating-linear-gradient(45deg,#eee,#eee 6px,#ddd 6px,#ddd 12px)"))}if(C.display==="none")continue;if(l!==t&&C.position!=="fixed"&&P(l.getBoundingClientRect())){const r=[...d.querySelectorAll("style")];d.replaceChildren(...r);continue}const S=l.children,a=d.children;for(let r=Math.min(S.length,a.length)-1;r>=0;r--)I.push([S[r],a[r]])}for(const l of g)l.remove();for(const l of s.querySelectorAll("script, iframe, video, canvas, noscript"))l.remove();await Promise.all(v);const D=z({corsImages:m,failedImages:h,shadowRoots:c}),W=`<svg xmlns="http://www.w3.org/2000/svg" width="${Math.ceil(o.width)}" height="${Math.ceil(o.height)}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">`+new XMLSerializer().serializeToString(s)+"</div></foreignObject></svg>",O=new i.Image,k=new Promise((l,d)=>{O.onload=()=>l(),O.onerror=()=>d(new Error("raster:img-error"))});return O.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(W),await k,{image:O,width:o.width,height:o.height,blindSpots:D}}let _=null;function ot(t){return _||(_=new Promise(e=>{const n=new(t.defaultView??window).Image,i=setTimeout(()=>e(!1),1e3);n.onload=()=>{clearTimeout(i),e(!0)},n.onerror=()=>{clearTimeout(i),e(!1)},n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="1" height="1"/>')}),_)}const Q=256e3,J=1600,yt=2048,at=.82,vt=5e5;let U=null;function st(t){if(U!==null)return U;try{const e=t.createElement("canvas");e.width=1,e.height=1,U=e.toDataURL("image/webp").startsWith("data:image/webp")}catch{U=!1}return U}function j(t,e,n){return new Promise((i,o)=>{try{t.toBlob(s=>i(s),e,n)}catch(s){s.name==="SecurityError"?o(s):i(null)}})}async function rt(t,e,n){const i=st(e)?await j(t,"image/webp",n):await j(t,"image/jpeg",Math.max(n,.85));return i&&(i.type==="image/webp"||i.type==="image/jpeg")?i:j(t,"image/png")}async function lt(t,e,n=J){const i=Math.min(Math.max(1,n),yt);let o=t;const s=Math.max(o.width,o.height);s>i&&(o=ct(t,e,i/s));let c=at,m=!1;for(let v=0;v<4;v++){let g=await rt(o,e,c);if(!g)return null;if(o.width*o.height<=vt){const f=await j(o,"image/png");f&&f.size<g.size&&(g=f)}if(g.size<=Q)return{blob:g,quality:c,rescaled:m};c>.55?c-=.12:(o=ct(o,e,.75),c=at,m=!0)}const h=await rt(o,e,c);return h&&h.size<=Q?{blob:h,quality:c,rescaled:m}:null}function ct(t,e,n){const i=e.createElement("canvas");return i.width=Math.max(1,Math.round(t.width*n)),i.height=Math.max(1,Math.round(t.height*n)),i.getContext("2d").drawImage(t,0,0,i.width,i.height),i}function kt(t){const e=[`[${ht("mask")}]`,`.${nt("mask")}`,`.${nt("block")}`,'input[type="password"]','input[autocomplete*="password" i]','[autocomplete*="cc-" i]','[autocomplete="one-time-code"]','input[type="email"]','input[type="tel"]'];return t.maskAllInputs&&e.push("input","textarea","select","[contenteditable]"),[...e,...t.maskSelectors??[]]}function St(t,e){const n=t.defaultView??window,i=performance.now(),o=[],s=[],c=`[${V("root")}]`,m=t.querySelectorAll("body *"),h=m.length>5e3,v=h?t.querySelectorAll("body > *, [class*=fixed], [class*=sticky], header, nav, dialog, [popover], [role=dialog], [role=tooltip], [role=menu]"):m;h&&o.push("Overlay scan was reduced on this very large page; some fixed elements may be missing.");for(const u of v){if(performance.now()-i>8)return o.push("Overlay scan ran out of time; fixed and sticky elements are not composited."),{overlays:[],notes:o};if(u.closest(c))continue;let b=!1,E=!1;try{u.matches(":popover-open")&&(b=!0)}catch{}if(u instanceof n.HTMLDialogElement&&u.open){b=!0;try{E=u.matches(":modal")}catch{E=!1}}if(!b){const A=n.getComputedStyle(u).position;(A==="fixed"||A==="sticky")&&(b=!0)}if(!b)continue;const w=A=>A.width>=1&&A.height>=1&&A.bottom>=0&&A.right>=0&&A.top<=n.innerHeight&&A.left<=n.innerWidth,R=u.getBoundingClientRect();if(R.width<1||R.height<1){for(const A of u.children){const M=A.getBoundingClientRect();w(M)&&s.push({el:A,rect:M,modal:E})}continue}w(R)&&s.push({el:u,rect:R,modal:E})}const g=s.filter(u=>!s.some(b=>b!==u&&b.el.contains(u.el))),f=(u,b,E)=>u===1?b:E;if(g.length>e){const u=g.length-e;o.push(`${u} overlay ${f(u,"element","elements")} (fixed/sticky/menus) ${f(u,"was","were")} not captured`)}if(g.length>0){const u=Math.min(g.length,e);o.push(`${u} overlay ${f(u,"element","elements")} ${f(u,"was","were")} re-composited; ${f(u,"its","their")} stacking order is approximate`)}return{overlays:g.slice(0,e),notes:o}}const Rt=32;function Ct(t,e){if(t.width===0||t.height===0)return"blank";try{const n=e.createElement("canvas");n.width=n.height=16;const i=n.getContext("2d",{willReadFrequently:!0});if(!i)return"blank";i.drawImage(t,0,0,16,16);const o=i.getImageData(0,0,16,16).data;for(let s=3;s<o.length;s+=4)if(o[s]>0)return"pixels";return"blank"}catch(n){return n.name==="SecurityError"?"tainted":"blank"}}function xt(t,e,n){t.documentElement.getBoundingClientRect();const i=performance.now(),o=[],s=t.querySelectorAll("iframe, canvas, video");if(s.length>5e3)return e.push("Blind-spot scan skipped on this very large page."),o;const c={iframeHosts:[],taintedCanvases:0,blankCanvases:0,videos:0};let m=0;for(const h of s){const v=m>=Rt&&performance.now()-i>5;if(h.closest(`[${V("root")}]`))continue;const g=h.getBoundingClientRect();if(!(g.width<2||g.height<2))if(h.tagName==="IFRAME"){const f=h;let u=!1;try{f.contentDocument||(u=!0)}catch{u=!0}if(u){let b="";try{b=new URL(f.src,t.baseURI).host}catch{}c.iframeHosts.push(b),o.push({el:h,rect:g,label:"iframe not captured"})}}else if(h.tagName==="CANVAS"){if(v){c.blankCanvases++,o.push({el:h,rect:g,label:"canvas not captured"});continue}m++;const f=Ct(h,t),u=f==="tainted";if(f==="pixels"&&n)continue;u?c.taintedCanvases++:c.blankCanvases++,o.push({el:h,rect:g,label:"canvas not captured"})}else c.videos++,o.push({el:h,rect:g,label:"video not captured"})}return e.push(...z(c)),o}function Et(t,e,n,i,o,s){t.save(),t.beginPath(),t.rect(e,n,i,o),t.clip(),t.fillStyle="#f3f3f3",t.fillRect(e,n,i,o),t.strokeStyle="#d0d0d0",t.lineWidth=1,t.beginPath();for(let c=-o;c<i;c+=12)t.moveTo(e+c,n+o),t.lineTo(e+c+o,n);t.stroke(),t.strokeRect(e+.5,n+.5,i-1,o-1),i>=120&&o>=20&&(t.fillStyle="#8a8f98",t.font="11px system-ui, sans-serif",t.textAlign="center",t.fillText(s,e+i/2,n+o/2+4)),t.restore()}function Mt(t,e,n,i,o){t.save(),t.fillStyle="#5b5f66",t.fillRect(e,n,i,o),t.strokeStyle="#8a8f98",t.lineWidth=1,t.strokeRect(e+.5,n+.5,i-1,o-1),i>=80&&o>=24&&(t.fillStyle="#c9cdd3",t.font="11px system-ui, sans-serif",t.textAlign="center",t.fillText("masked",e+i/2,n+o/2+4)),t.restore()}function It(t){const e=t.defaultView??window;for(const n of[t.documentElement,t.body]){if(!n)continue;const i=e.getComputedStyle(n).backgroundColor;if(i&&i!=="rgba(0, 0, 0, 0)"&&i!=="transparent")return i}return"#ffffff"}async function H(t,e,n,i,o){const s=t.doc,c=s.defaultView??window,m=`[${V("root")}]`,h=[];if(await Promise.race([new Promise(a=>c.requestAnimationFrame(()=>c.requestAnimationFrame(a))),new Promise(a=>c.setTimeout(a,50))]),s.hidden&&await new Promise(a=>{const r=c.setTimeout(a,500);s.addEventListener("visibilitychange",()=>{c.clearTimeout(r),a()},{once:!0})}),t.signal?.aborted)throw new Error("navigated");let v,g;try{const a=kt(t).join(", "),r=[...s.querySelectorAll(a)].filter(p=>!p.closest(m));g=new Set(r),v=r.map(p=>p.getBoundingClientRect()).filter(p=>p.width>0&&p.height>0)}catch(a){throw Object.assign(new Error("masking-failed"),{cause:a})}const{overlays:f,notes:u}=i?St(s,t.maxOverlays??8):{overlays:[],notes:[]};h.push(...u);const b=xt(s,h,n),E=new Set([...f.map(a=>a.el),...g]);let w=Math.min(c.devicePixelRatio||1,t.maxDpr??2);const R=s.documentElement,A=e==="viewport"?R.scrollWidth:0,M=e==="viewport"?R.scrollHeight:0,P=t.maxRasterPixels??4e7;if(e==="viewport"){const a=A*M*w*w;if(a>P&&(w=Math.max(1,w*Math.sqrt(P/a))),A*M>P)return H(t,"element",n,i,!0)}let T=R,x,B={x:0,y:0};if(e==="viewport")x={x:0,y:0,w:c.innerWidth,h:c.innerHeight};else{const a=t.target&&t.target.isConnected?t.target:R,r=a.getBoundingClientRect(),p=200,N=Math.max(0,r.left-p),q=Math.max(0,r.top-p),Z=Math.min(c.innerWidth,r.right+p),tt=Math.min(c.innerHeight,r.bottom+p);let $=a;for(;$.parentElement&&$!==R;){const F=$.getBoundingClientRect();if(F.left<=N&&F.top<=q&&F.right>=Z&&F.bottom>=tt)break;$=$.parentElement}T=$;const et=$.getBoundingClientRect();x={x:N-et.left,y:q-et.top,w:Z-N,h:tt-q},B={x:N,y:q}}const I=await Y(T,{drop:a=>a.closest?.(m)!=null,hide:a=>E.has(a),inlineSameOriginAssets:n,...t.fetchForeignImage?{fetchForeignImage:t.fetchForeignImage}:{}});if(h.push(...I.blindSpots),t.signal?.aborted)throw I.image.src="",new Error("navigated");const D=T.getBoundingClientRect(),W=e==="viewport"?-D.left:x.x,O=e==="viewport"?-D.top:x.y,k=s.createElement("canvas");k.width=Math.max(1,Math.round(x.w*w)),k.height=Math.max(1,Math.round(x.h*w));const l=k.getContext("2d");l.fillStyle=It(s),l.fillRect(0,0,k.width,k.height),l.drawImage(I.image,W,O,x.w,x.h,0,0,k.width,k.height),I.image.src="",f.some(a=>a.modal)&&(l.fillStyle="rgba(0,0,0,0.35)",l.fillRect(0,0,k.width,k.height));let d=0;for(const a of f)try{const r=await Y(a.el,{drop:p=>p.closest?.(m)!=null,hide:p=>g.has(p),inlineSameOriginAssets:n,...t.fetchForeignImage?{fetchForeignImage:t.fetchForeignImage}:{}});l.drawImage(r.image,Math.round(a.rect.left*w),Math.round(a.rect.top*w),Math.round(a.rect.width*w),Math.round(a.rect.height*w)),r.image.src=""}catch{d++}h.push(...z({failedOverlays:d}));const C=a=>({x:Math.round((a.left-B.x)*w),y:Math.round((a.top-B.y)*w),w:Math.round(a.width*w),h:Math.round(a.height*w)});for(const a of b){const r=C(a.rect);r.w>0&&r.h>0&&Et(l,r.x,r.y,r.w,r.h,a.label)}let y=0;try{for(const a of v){const r=C(a);r.w<=0||r.h<=0||(Mt(l,r.x,r.y,r.w,r.h),y++)}}catch(a){throw Object.assign(new Error("masking-failed"),{cause:a})}if(t.signal?.aborted)throw new Error("navigated");let S;try{S=await lt(k,s,t.maxLongestSide??J)}catch(a){throw k.width=k.height=0,a.name==="SecurityError"?new Error("tainted"):a}return k.width=k.height=0,S?{situation:o?"scope-forced":"ok",blob:S.blob,quality:S.quality,width:Math.round(x.w),height:Math.round(x.h),blindSpots:h,maskedCount:y}:{situation:"engine-failed",blindSpots:h,maskedCount:y}}function K(t,e){return Promise.race([t.catch(n=>n.message==="masking-failed"?{situation:"masking-failed",blindSpots:[],maskedCount:0}:n.message==="navigated"?{situation:"navigated",blindSpots:[],maskedCount:0}:n.message==="tainted"?{situation:"tainted",blindSpots:[],maskedCount:0}:{situation:"engine-failed",blindSpots:[],maskedCount:0}),new Promise(n=>setTimeout(()=>n({situation:"timeout",blindSpots:[],maskedCount:0}),e))])}async function $t(t){if(!await ot(t.doc))return{situation:"csp-blocked",blindSpots:[],maskedCount:0};const e=t.scope??"viewport",n=[t.timeoutMs??3e3,1500,1500];let i=await K(H(t,e,!0,!0,!1),Math.min(n[0],1e4));if(i.situation==="ok"||i.situation==="scope-forced"||i.situation==="masking-failed"||i.situation==="navigated"||i.situation==="tainted"||(i=await K(H(t,e,!1,!1,!1),n[1]),i.situation==="ok"||i.situation==="scope-forced"||i.situation==="masking-failed"||i.situation==="navigated"||i.situation==="tainted"))return i;const o=await K(H(t,"element",!1,!1,!0),n[2]);return o.situation==="ok"||o.situation==="scope-forced"?o:o.situation==="engine-failed"&&i.situation==="timeout"?i:o}const Bt="screenshot";export{Bt as CHUNK,J as MAX_LONGEST_SIDE,Q as TARGET_BYTES,st as canEncodeWebp,$t as captureScreenshot,lt as encodeToBudget,ot as probeDataImages,Y as rasterise};
|