pipeup 0.4.1-beta.1 → 0.4.1
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/README.md +2 -2
- package/dist/pipeup.core.js +1 -1
- package/dist/pipeup.esm.js +1 -1
- package/dist/pipeup.min.js +1 -1
- package/dist/types/core.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Comments and feedback right on any HTML page: documents, slide decks and whole sites.
|
|
4
4
|
|
|
5
|
-
> **Alpha (0.4.1
|
|
5
|
+
> **Alpha (0.4.1).** The API and the stored comment format may change before 1.0; pin an exact version.
|
|
6
6
|
> Website and Try pages: https://pipeup-ai.github.io/pipeup/ · Source: https://github.com/pipeup-ai/pipeup
|
|
7
7
|
|
|
8
8
|
Pipeup: signed comment operations, threads with one-level replies, anchors that survive page changes,
|
|
@@ -21,7 +21,7 @@ As a classic script (also works from `file://`), it mounts itself on pages that
|
|
|
21
21
|
```html
|
|
22
22
|
<html data-pipeup-doc="<id>:<key>">
|
|
23
23
|
...
|
|
24
|
-
<script src="https://cdn.jsdelivr.net/npm/pipeup@0.4.1
|
|
24
|
+
<script src="https://cdn.jsdelivr.net/npm/pipeup@0.4.1/dist/pipeup.min.js" integrity="sha384-…" crossorigin="anonymous" defer></script>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
Each release's notes on GitHub give the `integrity` value
|
package/dist/pipeup.core.js
CHANGED
|
@@ -6,4 +6,4 @@ function f(t){let e="";for(let n of t)e+=String.fromCharCode(n);return btoa(e).r
|
|
|
6
6
|
`}function Se(t){let{thread:e,location:n}=t,r=[u(n.where)+(n.quote?`, on the text "${u(n.quote)}"`:""),`${u(E(e.root))}: ${R(e.root," ")}`];for(let o of e.root.replies)r.push(` ${u(E(o))}: ${R(o," ")}`);return r.join(`
|
|
7
7
|
`)+`
|
|
8
8
|
`}function R(t,e){return t.deleted?"(deleted)":t.text.replace(/\r\n|\r|\n/g,`
|
|
9
|
-
`+e)+(t.edited?" (edited)":"")}var rr="0.4.1
|
|
9
|
+
`+e)+(t.edited?" (edited)":"")}var rr="0.4.1";export{N as ANIMALS,G as COLOURS,ue as DEFAULT_PROFILE_NAME,j as IndexedDbStore,q as MemoryStore,U as PipeupDocument,v as UnsavedChangeError,rr as VERSION,ve as animalName,mt as copyAll,ft as copyThread,F as createIdentity,ze as describeElement,He as describeRange,$ as formatAgo,Ee as labelOf,Be as loadOrCreateProfile,at as locate,E as nameOf,Re as newDocumentAttribute,Fe as parseDocumentAttribute,Ye as resolveAnchor};
|
package/dist/pipeup.esm.js
CHANGED
|
@@ -6,4 +6,4 @@ function me(e){let t="";for(let o of e)t+=String.fromCharCode(o);return btoa(t).
|
|
|
6
6
|
`}function ao(e){let{thread:t,location:o}=e,n=[ie(o.where)+(o.quote?`, on the text "${ie(o.quote)}"`:""),`${ie(ue(t.root))}: ${It(t.root," ")}`];for(let r of t.root.replies)n.push(` ${ie(ue(r))}: ${It(r," ")}`);return n.join(`
|
|
7
7
|
`)+`
|
|
8
8
|
`}function It(e,t){return e.deleted?"(deleted)":e.text.replace(/\r\n|\r|\n/g,`
|
|
9
|
-
`+t)+(e.edited?" (edited)":"")}var rs="0.4.1-beta.1";function v(e,t={},...o){let n=document.createElement(e);for(let[r,s]of Object.entries(t))s===void 0||s===!1||(r==="class"?n.className=String(s):n.setAttribute(r,s===!0?"":s));for(let r of o)r!=null&&r!==!1&&n.append(r);return n}function ee(e,t){let o=e.getRootNode().activeElement;t&&o instanceof HTMLElement&&e.contains(o)&&o.blur(),e.inert=t}function Rt(e,t,o=null){let n=e.getRootNode().activeElement,r=!1;for(let s=t.length;s--;o=t[s])t[s].nextSibling!==o&&(r=!!e.insertBefore(t[s],o));return r&&n&&t.some(s=>s.contains(n))&&n.focus({preventScroll:!0}),r}function he(e,t){return e.length>t?e.slice(0,t-1)+"\u2026":e}function _e(e,t,o=4){e.style.left=`${t.left-o}px`,e.style.top=`${t.top-o}px`,e.style.width=`${t.width+o*2}px`,e.style.height=`${t.height+o*2}px`}var br=/\bhttps?:\/\/[^\s<>"'`]+/gi,xr=`.,;:!?'"]}`,Er=2048,kr=/[\u202A-\u202E\u2066-\u2069]/;function Tr(e){let t=0,o=0;for(let r of e)r==="("?t++:r===")"&&o++;let n=e.length;for(;n>0;){let r=e[n-1];if(r===")"&&o>t)o--;else if(!xr.includes(r))break;n--}return e.slice(0,n)}function $t(e){let t=[],o=0;for(let n of e.matchAll(br)){if(n[0].length>Er||kr.test(n[0]))continue;let r=Tr(n[0]),s=n.index??0,l;try{let f=new URL(r);if(f.protocol!=="http:"&&f.protocol!=="https:")continue;l=f.href}catch{continue}s>o&&t.push(e.slice(o,s));let a=v("a",{href:l,target:"_blank",rel:"noopener noreferrer"},r);a.addEventListener("click",f=>f.stopPropagation()),t.push(a),o=s+r.length}return o<e.length&&t.push(e.slice(o)),t}var Ie={code:"KeyC",mods:{shift:!0,alt:!0,meta:!1,ctrl:!1},mac:{label:"\u21E7\u2325C",aria:"Shift+Alt+C"},other:{label:"Shift+Alt+C",aria:"Shift+Alt+C"}},lo=typeof navigator<"u"&&/Mac|iP(hone|ad|od)/.test(navigator.platform),ft=(lo?Ie.mac:Ie.other).label,vn=(lo?Ie.mac:Ie.other).aria;function co(e){return e.code===Ie.code&&e.shiftKey===Ie.mods.shift&&e.altKey===Ie.mods.alt&&e.metaKey===Ie.mods.meta&&e.ctrlKey===Ie.mods.ctrl&&!e.repeat&&!e.getModifierState("AltGraph")}var uo="http://www.w3.org/2000/svg",Sr={comment:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z","M12.3 8.2v6.6M9 11.5h6.6"],send:["M21 12L3.5 4.5 6.2 12l-2.7 7.5zM6.2 12H13"],copy:["M10 8h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z","M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"],resolve:["M5 12.5l4.5 4.5L19 7.5"],reopen:["M3 12a9 9 0 1 0 3-6.7","M3 4v5h5"],lines:["M4 7h16M4 12h10M4 17h7"],list:["M3 6.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 12a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 17.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M9 6.5h11M9 12h11M9 17.5h7"],expand:["M14 4h6v6M20 4l-6 6M10 20H4v-6M4 20l6-6M20 14v6h-6M20 20l-6-6M4 10V4h6M4 4l6 6"],pin:["M6 18v-6a6 6 0 1 1 6 6z"],shrink:["M20 10h-6V4M14 10l6-6M4 14h6v6M10 14l-6 6M14 20v-6h6M14 14l6 6M10 4v6H4M10 10L4 4"],bubble:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z"],close:["M6 6l12 12M18 6L6 18"],edit:["M4 20h4L19 9l-4-4L4 16z"]};function te(e,t=15,o){let n=wn(Sr[e],t);return o&&n.setAttribute("stroke-width",String(o)),n}function wn(e,t){let o=document.createElementNS(uo,"svg"),n={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};for(let[r,s]of Object.entries(n))o.setAttribute(r,s);for(let r of e){let s=document.createElementNS(uo,"path");s.setAttribute("d",r),o.append(s)}return o}var Nt=(e,t,o)=>`M${e} ${t}a${o} ${o} 0 1 0 ${2*o} 0a${o} ${o} 0 1 0 -${2*o} 0`,Lr={Otter:"M4 13.2C4 9.2 7.6 6.5 12 6.5s8 2.7 8 6.7-3.6 6.3-8 6.3-8-2.3-8-6.3zM5.6 9.6a1.8 1.8 0 1 1 2.7-2.3M18.4 9.6a1.8 1.8 0 1 0-2.7-2.3M9.2 11.6h.01M14.8 11.6h.01M11 14h2l-1 1zM9.8 15.8l-3.2.4M9.9 17l-2.7 1.1M14.2 15.8l3.2.4M14.1 17l2.7 1.1",Fox:"M3.5 4l5 3.5h7l5-3.5-1.5 8.5L12 20l-7-7.5zM9 12h.01M15 12h.01M12 17h.01",Owl:`M5 4.5l3 2.5h8l3-2.5V14a7 7 0 0 1-14 0z${Nt(7.4,11.5,1.9)}${Nt(12.8,11.5,1.9)}M11.3 14.6l.7 1 .7-1`,Bear:`${Nt(5,13.5,7)}M8.9 7.22A2.8 2.8 0 1 0 5.89 10.09M18.11 10.09A2.8 2.8 0 1 0 15.1 7.22M9.4 12.6h.01M14.6 12.6h.01M10.3 16.4c0-1 .8-1.6 1.7-1.6s1.7.6 1.7 1.6-.8 1.6-1.7 1.6-1.7-.6-1.7-1.6z`,Rabbit:`${Nt(6.5,15.5,5.5)}M9.6 10.5C8.2 6.5 8.4 2.5 9.8 2.5s2.4 3.5 1.6 7.5M14.4 10.5c1.4-4 1.2-8-.2-8s-2.4 3.5-1.6 7.5M10 15h.01M14 15h.01M11.3 17.3l.7.5.7-.5`};function po(e){let t=/[\p{L}\p{N}]/u.exec(e);if(!t)return"";let o=t[0].toUpperCase();return[...o].length===1?o:t[0]}var mt=(e,t)=>po(t)||Oe(e);function Je(e,t){return v("span",{class:`av c${mn(e)}`,"aria-hidden":"true","data-animal":Oe(e)},po(t)||wn([Lr[ot[fn(e)]]],24))}var Ar=320;function Bt(e,t){setTimeout(()=>{e.remove(),t?.()},Ar)}function Ht(e){return requestAnimationFrame(()=>{e.offsetWidth,e.classList.add("in")}),e}function Dt(e){let t=v("textarea",{class:"input",rows:"1","aria-label":e.label}),o=v("button",{class:"send",type:"button","aria-label":"Send",title:"Send",inert:!0},te("send")),n=v("div",{class:"row"},e.before,t,o),r=!1,s=()=>{let a=t.value.trim()!=="";o.classList.toggle("show",a),o.inert=!a,t.style.height="auto",t.style.height=`${Math.max(27,t.scrollHeight)}px`},l=async()=>{let a=t.value.trim();if(!(!a||r)){r=!0;try{await e.$(a),o.matches(":focus")&&t.focus(),t.value="",s()}catch{}finally{r=!1}}};return n.addEventListener("mousedown",a=>{a.target===t||o.contains(a.target)||(a.preventDefault(),t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length))}),t.addEventListener("input",s),t.addEventListener("keydown",a=>{a.stopPropagation(),a.key==="Enter"&&!a.shiftKey&&!a.isComposing?(a.preventDefault(),l()):a.key==="Escape"&&(a.preventDefault(),t.value="",s(),t.blur(),e.N?.())}),o.addEventListener("click",a=>{a.stopPropagation(),l()}),{element:n,input:t,focus:()=>t.focus({preventScroll:!0}),clear:()=>{t.value="",s()}}}function Mr(e){let t=v("button",{class:"me",type:"button",tabindex:"-1","aria-hidden":"true"});t.addEventListener("mousedown",y=>y.preventDefault());let o=Dt({label:"Comment",before:t,$:e.$,N:e.N}),n=v("div",{class:"say"}),r=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"}),s=v("div",{class:"nf"},r),l=v("div",{class:"you"},n,s),a="",f=!1,d=()=>{let y=e.name(),x=y?"change":"add your name";if(t.title=y?"Change your name":"Add your name",!t.lastChild||a!==y){let A=Je(e.me,y),E=t.lastChild;E?(Ht(A),Bt(E)):A.classList.add("in"),t.append(A),a=y}let C=v("button",{type:"button"},x);C.addEventListener("click",T),n.replaceChildren(v("span",{class:"nm"},y||`You're ${Oe(e.me)}`)," \xB7 ",C)},h=y=>{l.classList.toggle("naming",y),ee(n,y),ee(s,!y)};function T(y){y.stopPropagation(),r.value=e.name(),h(!0),r.focus({preventScroll:!0}),r.select()}let M=()=>{h(!1),o.focus()};t.addEventListener("click",T),r.addEventListener("keydown",y=>{if(y.stopPropagation(),y.key==="Escape")y.preventDefault(),M();else if(y.key==="Enter"){y.preventDefault();let x=r.value.trim();if(!x||x===e.name())return M();if(f)return;f=!0,e.rename(x).finally(()=>{f=!1,d(),M()})}}),d(),h(!1);let p=v("div",{class:"ctx"},e.label);return{element:v("div",{class:"draft"},p,o.element,l),G:()=>{let{selectionStart:y,selectionEnd:x}=o.input;return()=>{o.focus(),o.input.setSelectionRange(y,x)}},B:y=>{p.hidden=y},V:y=>{p.textContent=y},focus:()=>o.focus(),se:()=>o.input.value.trim()===""}}function Ft(e,t){let o=Mr({label:t.label,me:e.doc.me,name:()=>e.c.name(),rename:n=>e.c.rename(n),$:n=>e.ae(n),N:()=>e.le()});return e.I(o),o}function Vt(e,t){if(t.state==="orphaned"||!t.element||e.quote)return null;let o=t.element.getBoundingClientRect();if(!o.width&&!o.height)return null;if(e.point)return{x:o.left+e.point.x*o.width,y:o.top+e.point.y*o.height};let n=t.element.ownerDocument.createRange();n.selectNodeContents(t.element);let r=n.getBoundingClientRect();return{x:r.width?Math.min(o.right-8,r.right+6):o.right-8,y:(r.height?r.top:o.top)+8}}function ht(e){return e.range?[...e.range.getClientRects()]:[]}function yn(e,t){let o=ht(t)[0];if(o)return o.top;if(t.state==="orphaned"||!t.element)return null;let n=t.element.getBoundingClientRect();return e.point?n.top+e.point.y*n.height:n.top}function gt(e,t){let o=ht(t).at(-1);if(o)return{x:o.left,y:o.bottom,below:!0};let n=Vt(e,t);return n?{...n,below:!1}:null}function fo(e,t,o){for(let n of o)if(e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom)return!0;return!1}function mo(e,t,o=10){let n=[...e].sort((a,f)=>a.w-f.w),r=new Array(n.length).fill(0),s=n.findIndex(a=>a.id===t),l=a=>n[a];if(s<0)n.forEach((a,f)=>{r[f]=f===0?a.w:Math.max(a.w,(r[f-1]??0)+l(f-1).height+o)});else{r[s]=l(s).w;for(let a=s+1;a<n.length;a++)r[a]=Math.max(l(a).w,(r[a-1]??0)+l(a-1).height+o);for(let a=s-1;a>=0;a--)r[a]=Math.min(l(a).w,(r[a+1]??0)-l(a).height-o)}return new Map(n.map((a,f)=>[a.id,r[f]??0]))}var vt=320,Ze=300,Cr=480,Qe=()=>window.innerWidth<=Cr;function qt(e){let t=window.innerWidth;return{width:e&&!Qe()?t-vt:t,height:window.innerHeight}}function _t(e,t,o,n=12){let r,s;return e.below?(r=Math.min(e.x,o.width-t.width-n),s=e.y+8,s+t.height>o.height-n&&(s=e.y-t.height-40)):(r=e.x+14,r+t.width>o.width-n&&(r=e.x-t.width-28),s=Math.min(e.y-12,o.height-t.height-n)),{left:Math.max(n,r),top:Math.max(n,s)}}function ho(e,t,o,n=12,r=44){let s=e.top-r>=8,l=e.top+e.height+8+(s?0:r),a=e.top-8-(s?r:0)-t.height,f=l+t.height<=o.height-n||a<n,d=f?l:a;return{above:!f,left:Math.max(n,Math.min(e.left,o.width-t.width-n)),top:Math.max(n,d)}}function Kt(e,t,o){let n=e.top-t.height-10;return n<8&&(n=e.top+e.height+10),{left:Math.max(8,Math.min(e.left+e.width/2-t.width/2,o.width-t.width-8)),top:n}}function Ut(e,t){let o=e.resolved.get(t.id);return o?.range?.startContainer??o?.element??null}var Ke=e=>(t,o)=>{let n=Ut(e,t),r=Ut(e,o),s=l=>l.anchor.point??{x:0,y:-1};return n!==r?!r||n&&n.compareDocumentPosition(r)&4?-1:1:s(t).y-s(o).y||s(t).x-s(o).x};var zt=e=>`${e} ${e===1?"reply":"replies"}`;function it(e,t,o){let n={...o},r=e.id,s=v("div",{class:"rbox always"},v("div",{},Dt({label:"Reply",$:x=>t.reply(r,x),N:t.close}).element)),l=v("div",{}),a=v("div",{}),f=null,d=v("div",{},a,v("div",{class:"more"},l)),h=new Map,T=new Map,M=new Map,p=x=>{let C=mt(x.author,x.name),A=h.get(x.id),E=A?.e;if((!E||A.key!==C)&&(E=Ht(Je(x.author,x.name)),A)){let k=A.e;M.set(x.id,k),Bt(k,()=>M.get(x.id)===k&&M.delete(x.id))}E.title=ue(x),T.set(x.id,{key:C,e:E});let P=M.get(x.id);return P?[P,E]:[E]},g=(x,C,A)=>{let E=v("button",{class:"ib",type:"button","aria-label":C,title:C},te(x));return E.addEventListener("click",P=>{P.stopPropagation(),A()}),E};function y(x,C={}){Object.assign(n,C),r=x.id;let A=(n.now??Date.now)(),E=x.root.replies.length,P=j=>v("span",{class:"who"},`${ue(j)} \xB7 ${rt(j.at,A)}`),k=j=>v("div",{class:j.deleted?"tx del":"tx"},...j.deleted?["Deleted"]:[...$t(j.text),j.edited?" (edited)":""]),q=x.resolved?"Resolved"+(E?` \xB7 ${zt(E)}`:""):E?zt(E):"",W=v("div",{class:n.H==="column"&&q?"ft has-rest":"ft"},n.H==="column"&&q?v("span",{class:"rest"},q):null,v("span",{class:"hover"},P(x.root),v("span",{class:"acts"},g("copy","Copy thread",()=>t.copy(x.id)),x.resolved?g("reopen","Reopen",()=>void t.reopen(x.id)):g("resolve","Resolve",()=>void t.resolve(x.id))))),F=n.lost?v("div",{class:"ctx"},`${n.place||"No longer on the page"} \u2014 it read \u201C${he(n.lost,120)}\u201D`):n.quote?v("div",{class:"ctx"},`\u201C${he(n.quote,80)}\u201D`):null;T=new Map;let Y=v("div",{class:"root"},...p(x.root),F,k(x.root),W);a.replaceWith(Y),a=Y,f?.remove(),f=E?v("div",{class:"rps"},...x.root.replies.map(j=>v("div",{class:"it"},...p(j),k(j),v("div",{class:"rft"},P(j))))):null,f&&l.prepend(f),h=T,x.resolved?s.remove():s.parentNode!==l&&l.append(s),d.className=x.resolved?"thread resolved":"thread",d.setAttribute("data-thread",x.id)}return y(e),{element:d,update:y}}var Pr="a,button,input,select,textarea,label,summary,[role=button],[contenteditable]",Or=400;function bn(e,t){let o=new Map,n=v("div",{class:"tip",role:"tooltip"}),r=v("div",{class:"mark"}),s=v("div",{class:"pop",role:"dialog","aria-label":"Comment thread"});n.inert=s.inert=!0,e.n.append(r,n,s);let l=v("div",{class:"bub pin ghost","aria-hidden":"true"}),a=[],f=null,d=null,h=null,T=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,M=0,p=null,g=null,y=null,x=0,C=b=>a.find(O=>O.id===b)??null,A=()=>t.q||e.state.l,E=!1,P=b=>{let O=e.resolved.get(b.id);return O?gt(b.anchor,O):null};function k(b,O,$){let{left:K,top:X}=_t(O,{width:b.offsetWidth||$,height:b.offsetHeight},qt(e.state.l));b.style.left=`${K}px`,b.style.top=`${X}px`}function q(b){let O=b&&A()&&e.state.o!==b?C(b):null,$=O?P(O):null;if(!O||!$){y=null,n.classList.remove("show"),ee(n,!0);return}if(y!==O.id){let K=O.root.replies.length;n.replaceChildren(v("div",{class:"tx clamp"},...O.root.deleted?["Deleted"]:$t(O.root.text)),v("div",{class:"who"},`${ue(O.root)}${K?` \xB7 ${K} ${K===1?"reply":"replies"}`:""}`)),y=O.id}k(n,$,260),n.classList.contains("show")||n.offsetWidth,n.classList.add("show"),n.inert=!1}function W(b){p=b,q(b),e.E(b)}function F(b){if(window.clearTimeout(x),b!==null){W(b);return}x=window.setTimeout(()=>W(null),A()?Or:0)}n.addEventListener("mouseenter",()=>window.clearTimeout(x)),n.addEventListener("mouseleave",()=>F(null)),n.addEventListener("click",b=>{b.stopPropagation();let O=y;O&&(window.clearTimeout(x),W(null),e.open(O))});function Y(b){let O=o.get(b.id);if(O)return O;let $=v("button",{class:"bub",type:"button","data-thread":b.id});return $.addEventListener("mouseenter",()=>F(b.id)),$.addEventListener("mouseleave",()=>F(null)),$.addEventListener("click",K=>{K.stopPropagation(),q(null),e.open(b.id)}),e.n.insertBefore($,r),o.set(b.id,$),$}let j=!1;function B(){let b=e.state.t,O=h&&b&&!b.anchor.quote&&!b.anchor.point?b.resolved.element:null;if(O){let{left:K,top:X,above:V}=ho(O.getBoundingClientRect(),{width:s.offsetWidth||Ze,height:s.offsetHeight},{width:window.innerWidth,height:window.innerHeight}),_=h?.above!==null&&h?.above!==V;if(h&&(h.above=V),_&&ce())return;s.style.left=`${K}px`,s.style.top=`${X}px`;return}let $=h&&b?gt(b.anchor,b.resolved):f?P(f):null;$&&k(s,$,Ze)}let se=b=>e.state.s&&!b.anchor.quote&&!b.anchor.point;function ce(){return window.clearTimeout(M),T?(s.classList.remove("show"),M=window.setTimeout(()=>{B(),s.classList.add("show")},220),!0):(s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450),!1)}function ge(b){if(window.clearTimeout(M),T){s.classList.remove("show"),M=window.setTimeout(()=>{h?.i.V(b),B(),s.classList.add("show")},220);return}h?.i.V(b),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)}function de(){if(!A())return null;let b=e.state.t;return b?b.anchor.quote||b.anchor.point||e.state.s?null:b.resolved.element:!f||f.anchor.quote||f.anchor.point?null:e.resolved.get(f.id)?.element??null}function oe(b){a=b;let O=new Set;for(let V of b){if(!e.R(V)||V.anchor.quote)continue;let _=e.resolved.get(V.id);if(!_||_.state==="orphaned")continue;O.add(V.id);let Q=Y(V);Q.classList.toggle("done",V.resolved),Q.classList.toggle("on",e.state.o===V.id),Q.classList.toggle("pin",V.anchor.point!==void 0);let fe=`Comment on ${qe(_.element)}: ${he(V.root.text,60)}`;Q.getAttribute("aria-label")!==fe&&Q.setAttribute("aria-label",fe)}Rt(e.n,b.filter(V=>O.has(V.id)).sort(Ke(e)).map(V=>o.get(V.id)),r);for(let[V,_]of o)O.has(V)||(_.classList.remove("in"),o.delete(V),window.setTimeout(()=>_.remove(),300));q(p),E!==e.state.l&&s.classList.contains("show")&&!T&&(window.clearTimeout(M),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)),E=e.state.l;let $=t.q?e.state.t:null;if($){let V=$.anchor.point??$.resolved.element;h?.of!==$?(window.clearTimeout(M),s.classList.remove("glide"),h={i:Ft(e,$),of:$,at:V,above:null},h.i.B(se($)),s.replaceChildren(h.i.element),s.inert=!1,h.i.focus(),f=null,d=null,B(),s.classList.add("show")):h&&(h.at!==V&&(h.at=V,h.above=null,ge($.label)),h.i.B(se($)));let _=!e.d.p($.anchor.view);_!==j&&(j=_,s.classList.toggle("show",!_),s.inert=_,_||B());return}h&&(window.clearTimeout(M),s.classList.remove("glide"),h=null,j=!1,e.I(null));let K=A()&&e.state.o?C(e.state.o):null;if(!K||!e.R(K)){f=null,d=null,s.classList.remove("show"),ee(s,!0);return}let X=K.anchor.quote?.exact??null;!f||!d||f.id!==K.id?(d=it(K,e.D,{H:"popover",quote:X}),s.replaceChildren(d.element),f=K,B(),s.classList.add("show"),s.inert=!1):f!==K&&(d.update(K,{quote:X}),f=K)}function pe(){for(let[K,X]of o){let V=C(K),_=e.resolved.get(K),Q=V&&_?Vt(V.anchor,_):null;if(!Q||Q.y<-40||Q.y>window.innerHeight+40){X.style.visibility="hidden";continue}X.style.visibility="",X.style.left=`${Q.x}px`,X.style.top=`${Q.y}px`,X.classList.contains("in")||(X.offsetWidth,X.classList.add("in"))}let b=e.state.t,O=b?.anchor.point&&e.d.p(b.anchor.view)?Vt(b.anchor,b.resolved):null;O?(l.style.left=`${O.x}px`,l.style.top=`${O.y}px`,l.classList.contains("in")||(e.n.insertBefore(l,r),l.offsetWidth,l.classList.add("in"))):l.classList.contains("in")&&(l.classList.remove("in"),window.setTimeout(()=>l.classList.contains("in")||l.remove(),300)),s.classList.contains("show")&&B();let $=de();r.classList.toggle("show",$!==null),$&&_e(r,$.getBoundingClientRect(),4)}let Le=b=>{if(e.f(b)){let $=b.composedPath()[0];g!==null&&!($ instanceof Element&&$.closest(".tip,.bub"))&&F(null),g=null;return}let O=e._(b.clientX,b.clientY)?.id??null;O!==g&&(g=O,F(O))},ve=b=>{if(e.f(b))return;let O=window.getSelection();if(O&&!O.isCollapsed||(e.state.s?b.altKey:b.target instanceof Element&&b.target.closest(Pr)))return;let $=e._(b.clientX,b.clientY);$&&(e.X(b),q(null),e.open($.id))};return window.addEventListener("pointermove",Le,{capture:!0,passive:!0}),window.addEventListener("click",ve,!0),{u:oe,M:pe,destroy(){window.clearTimeout(x),window.clearTimeout(M),window.removeEventListener("pointermove",Le,!0),window.removeEventListener("click",ve,!0),e.I(null);for(let b of o.values())b.remove();l.remove(),n.remove(),r.remove(),s.remove()}}}var Ir={display:"block",position:"static",clips:!1,off:!1},Rr=48,$r="button link img figure region list listitem tab tabpanel article navigation complementary banner contentinfo form search group dialog menu menuitem checkbox switch radio slider textbox combobox option row cell heading table".split(" ").map(e=>`[role=${e}]`),Nr=["button,a,input,select,textarea,label,summary,details,img,svg,canvas,video,picture,figure,figcaption,table,th,td","li,ul,ol,dl,dt,dd,p,h1,h2,h3,h4,h5,h6,blockquote,pre","section,article,aside,nav,header,footer,main,form,fieldset",...$r].join(","),xn="a,button,label,summary,[role=button],[role=link],[role=tab],[role=option],[role=menuitem]",Br=`${xn},input,select,textarea,img,svg,canvas,video,picture,[role=img]`,go=24,Hr=.6,Wt=2,En=(e,t)=>Math.abs(e.left-t.left)<=Wt&&Math.abs(e.top-t.top)<=Wt&&Math.abs(e.width-t.width)<=Wt&&Math.abs(e.height-t.height)<=Wt;function vo(e,t){let o=t.i(e);if(o.width<2||o.height<2)return!1;if(e.hasAttribute("data-pipeup-id"))return!0;let n=t.K();return o.width*o.height<=Hr*n.width*n.height&&(e.matches(Nr)||t.ce(e)||e.childElementCount>1&&!e.parentElement?.closest(xn)&&t.de(e))}function wt(e,t,o){if(e===t||!t.contains(e)||e.closest("[data-pipeup-ignore]"))return null;let n=null;for(let s=e;s&&s!==t&&!n;s=s.parentElement)vo(s,o)&&(n=s);if(!n||n.hasAttribute("data-pipeup-id"))return n;let r=o.i(n);for(let s=n.parentElement;s&&s!==t&&En(o.i(s),r);s=s.parentElement)if(s.hasAttribute("data-pipeup-id"))return s;return n}function kn(e,t,o){let n=o.i(e);for(let r=e.parentElement;r&&r!==t;){let s=wt(r,t,o);if(!s)return null;if(!En(o.i(s),n))return s;r=s.parentElement}return null}function wo(e=window){return{i:t=>t.getBoundingClientRect(),ce:t=>{let o=e.getComputedStyle(t),n=o.backgroundColor!=="transparent"&&!/,\s*0\)$/.test(o.backgroundColor),r=["top","right","bottom","left"].some(s=>parseFloat(o.getPropertyValue(`border-${s}-width`))>0);return n||r||o.backgroundImage!=="none"||o.boxShadow!=="none"},de:t=>/^(inline-)?(flex|grid)$/.test(e.getComputedStyle(t).display),flow:t=>{let o=e.getComputedStyle(t),n=[o.overflowX,o.overflowY];return{display:o.display,position:o.position,clips:n.some(r=>r==="hidden"||r==="clip")&&!n.some(r=>r==="auto"||r==="scroll")&&t!==e.document.documentElement&&t!==e.document.body,off:o.pointerEvents==="none"}},K:()=>({width:e.innerWidth,height:e.innerHeight})}}var Dr=(e,t)=>e.left<t.left+t.width&&t.left<e.left+e.width&&e.top<t.top+t.height&&t.top<e.top+e.height,Fr=(e,t)=>{let o=Math.max(e.left,t.left),n=Math.max(e.top,t.top);return{left:o,top:n,width:Math.max(0,Math.min(e.left+e.width,t.left+t.width)-o),height:Math.max(0,Math.min(e.top+e.height,t.top+t.height)-n)}};function Tn(e,t,o=()=>!0){let n=[],r=(s,l,a,f,d,h)=>{for(let T of s.children){if(T.hasAttribute("data-pipeup-ignore")||T.getAttribute("aria-hidden")==="true"||!o(T))continue;let M=t.flow?.(T)??Ir,p=T.offsetParent,g=M.position==="fixed"||M.position==="absolute"&&!!f&&!(p&&f.contains(p)),y=g?null:a,x=t.i(T),C=x.width>0&&x.height>0;if(y&&C&&!Dr(x,y))continue;let A=T.matches(xn),P=(M.display.startsWith("inline")||h)&&!T.matches(Br)&&(M.display==="inline"||x.height<=Rr),k=x.width<=go&&x.height<=go,q=T.hasAttribute("data-pipeup-id")||!d&&!M.off&&!P&&!(k&&!A),W=l;q&&vo(T,t)&&(l&&En(t.i(l.e),x)?(T.hasAttribute("data-pipeup-id")||!l.e.hasAttribute("data-pipeup-id"))&&(l.e=T):n.push(W={e:T,C:l,m:0}));let F=M.clips&&C;r(T,W,F?y?Fr(y,x):x:y,F?T:g?null:f,d||A,/^inline-(flex|grid)$/.test(M.display)||h&&/(flex|grid)$/.test(M.display))}};r(e,null,null,null,!1,!1);for(let s=n.length-1;s>=0;s--){let l=n[s];l.C&&(l.C.m=Math.max(l.C.m,l.m+1))}return n}var et=(e,t)=>e.filter(o=>o.m<=t&&(!o.C||o.C.m>t)),yo=(e,t)=>e.filter(o=>o.C===t);var Yt="a,button,summary,[role=button],[role=link],[role=switch],[role=tab],[role=checkbox],input[type=checkbox],input[type=radio],input[type=submit],input[type=button],input[type=reset]",Vr=`${Yt},input,select,textarea,[contenteditable]:not([contenteditable=false]),[tabindex]:not([tabindex="-1"])`,bo=["click","dblclick","auxclick","submit","contextmenu","dragstart"],xo=[...["over","out","enter","leave","down","up"].flatMap(e=>[`pointer${e}`,`mouse${e}`]),"mousemove","touchstart","touchmove","touchend","touchcancel"],qr=400,Sn="Tab moves between blocks \xB7 \u2191 \u2193 change level \xB7 Enter comments \xB7 Esc to finish \xB7 F7 selects text",_r=4,Kr=150;function Eo(e,t=wo()){let o=v("span",{hidden:!0},Sn),n=v("div",{class:"pick"},o),r=[0,1].map(()=>{let i=v("div",{class:"km",tabindex:"-1",role:"button"},v("span",{hidden:!0}),v("span",{hidden:!0}));return i.inert=!0,i.addEventListener("keydown",kt),i.addEventListener("click",u=>{u.stopPropagation(),Ye()}),i.addEventListener("focus",()=>n.classList.add("kf")),i.addEventListener("blur",()=>n.classList.remove("kf")),i}),s=v("span",{class:"lbl"}),l=(i,u,w,N)=>{let z=v("button",{class:"nb",type:"button","aria-label":i,title:u},te(w,16));return z.addEventListener("click",J=>{J.stopPropagation(),N()}),z},a=l("Around it","Select the block around it","expand",le),f=l("Inside it","Select a block inside it","shrink",Me),d=l("Pin","Pin its centre","pin",()=>e.J(()=>_(g??k,{x:.5,y:.5}))),h=v("div",{class:"namebar",role:"group","aria-label":"Chosen block"},s,a,f,d);h.inert=!0;let T=e.n.querySelector(".launch");for(let i of[n,...r,h])e.n.insertBefore(i,T);h.addEventListener("mousedown",i=>i.preventDefault());let M=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,p=null,g=null,y=null,x=null,C=0,A=()=>{},E=null,P=()=>{},k=null,q=0,W=0,F=!1,Y=null,j=null,B=null,se=0,ce=-1,ge=!0,de=null,oe=null,pe=i=>!e.f(i)&&!(i.target instanceof Element&&i.target.closest("[data-pipeup-ignore]"));function Le(){x&&(n.classList.toggle("glide",performance.now()<C),_e(n,x.getBoundingClientRect(),4))}function ve(){if(!E)return;h.classList.toggle("glide",performance.now()<C&&h.classList.contains("show"));let i=E.getBoundingClientRect(),{left:u,top:w}=Kt({left:i.left,top:i.top,width:i.width,height:i.height},{width:h.offsetWidth||200,height:h.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});h.style.left=`${u}px`,h.style.top=`${w}px`}function b(i,u){x=i,C=u?performance.now()+qr:0,Le(),n.classList.add("show")}function O(i,u){let w=getComputedStyle(i);if(w.opacity==="0")return u(),()=>{};let N=0,z=()=>{window.clearTimeout(N),i.removeEventListener("transitionend",Te)},J=()=>{z(),u()},Te=ne=>{ne.target===i&&ne.propertyName==="opacity"&&J()},je=Math.max(...w.transitionDuration.split(",").map(ne=>parseFloat(ne)*1e3||0));return N=window.setTimeout(J,je+100),i.addEventListener("transitionend",Te),z}function $(i){if(i!==p){if(p=i,A(),!i){n.classList.remove("show");return}getComputedStyle(n).opacity==="0"?b(i,!1):M?(n.classList.remove("show"),A=O(n,()=>b(i,!1))):b(i,!0)}}function K(i){g=i,n.classList.toggle("on",i!==null),$(i),X(i)}function X(i){P(),h.inert=!i,i?M?(h.classList.remove("show"),P=O(h,()=>V(i))):V(i):(h.classList.remove("show"),E=null)}function V(i){s.textContent=s.title=qe(i),a.hidden=kn(i,e.root,t)===null,f.hidden=(k?D(i).length:Tn(i,t,ze).length)===0;let u=h.classList.contains("show");E=i,ve(),u||(h.offsetWidth,h.classList.add("show"))}function _(i,u){let w;try{w=ln(i,e.root,u,e.d.view(i))}catch(J){e.Z(J);return}let N={anchor:w,label:u?`Pin on ${qe(i).replace(/^[A-Z](?=[a-z])/,J=>J.toLowerCase())}`:qe(i),ranges:[],resolved:{state:"attached",element:i,range:null}},z=e.state.t;k&&(k=i,ce=-1),K(u?null:i),y=z??{...N,ranges:[]},z?e.ue({...N,ranges:[]}):e.Q(y),e.T(u?N.label:`Commenting on ${N.label}`)}function Q(i){e.J(()=>_(i))}function fe(i){let u=(i.target instanceof Element?wt(i.target,e.root,t):null)??e.root;u!==e.root&&(Y=u);let w=u.getBoundingClientRect();w.width&&w.height&&_(u,{x:(i.clientX-w.left)/w.width,y:(i.clientY-w.top)/w.height})}function Re(i){let u=window.getSelection();if(u&&!u.isCollapsed)return;if(e.state.t&&(i.altKey||!e.S())){e.F();return}if(!i.altKey&&e._(i.clientX,i.clientY))return;if(e.state.o&&e.open(null),k&&i.detail&&I(),i.altKey){fe(i);return}let w=i.target instanceof Element?wt(i.target,e.root,t):null;w&&(Y=w),w?_(w):(e.F(),K(null))}let Ue=i=>{if(e.f(i))return;if(!pe(i)){g||$(null);return}if(i.stopPropagation(),g||e.state.t)return;let u=!G()&&i.target instanceof Element?wt(i.target,e.root,t):null;if(k){if(!u||u===k||(se+=Math.abs(i.movementX)+Math.abs(i.movementY),se<=_r))return;I()}u&&(Y=u),$(u)},G=()=>{let i=window.getSelection();return!!i&&!i.isCollapsed&&i.toString().trim()!==""},we=()=>{G()&&(k&&I(),g||$(null))},Ae=i=>{pe(i)&&(i.stopPropagation(),(i.type==="pointerdown"||i.type==="mousedown")&&i.target instanceof Element&&i.target.closest(Vr)&&i.preventDefault())},$e=i=>{if(!pe(i))return;let u=i.target;if((u===oe||u.form&&u.form===oe?.form)&&(i.type==="submit"||i.type==="click"&&!i.detail)){oe=i.type==="click"&&u.type==="submit"?u.form:null;return}i.preventDefault(),i.stopPropagation(),i.type==="click"&&!e.state.c&&!e.pe(i)&&Re(i)},Ne=i=>{if(oe=null,He="",i.key==="Tab"&&ye(i))return i.preventDefault(),i.stopPropagation(),He=i.key,e.state.o&&e.open(null),e.state.c&&(e.state.c=!1,e.u()),U(i.shiftKey?-1:1);if(!(!pe(i)||!(i.target instanceof Element)))if((i.key==="Enter"||i.key===" ")&&i.target.closest(Yt)){if(!k){oe=i.target;return}i.preventDefault(),i.stopPropagation()}else i.key==="Enter"&&!k&&i.target.form&&(oe=i.target)},ye=i=>{if(i.ctrlKey||i.metaKey||i.altKey||i.isComposing)return!1;let u=i.composedPath()[0];return!(u instanceof Element)||r.some(w=>w===u)?!1:e.f(i)?!!u.closest(".launch,.menu")&&!u.closest("input,textarea,select,[contenteditable]"):!i.composedPath().some(w=>w instanceof Element&&w.hasAttribute("data-pipeup-ignore"))},be=()=>e.n.getRootNode().activeElement,re=()=>r.some(i=>i===be()),ze=i=>(i.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1||getComputedStyle(i).display==="contents")&&e.d.p(e.d.view(i)),ae=()=>(de?.some(i=>!i.e.isConnected)&&(de=null),de??=Tn(e.root,t,ze)),Be=i=>ae().find(u=>u.e===i),xe=(i,u=!1)=>{let w=i.getBoundingClientRect();return w.bottom>0&&w.top<window.innerHeight&&(!u||w.top>=0)},Ee=()=>{let i=et(ae(),0);return i.find(u=>xe(u.e,!0))??i.find(u=>xe(u.e))??i[0]},ke=i=>e.doc.threads().filter(u=>e.R(u)&&i.contains(Ut(e,u))).sort(Ke(e));function We(i,u){let[w,N]=i.children,z=et(ae(),q),J=ke(u).length;w.textContent=`${Pt(u)}, ${z.findIndex(ne=>ne.e===u)+1} of ${z.length}${J?`, has ${J} comment${J===1?"":"s"}`:""}`;let Te=(u.innerText??u.textContent??"").length<=Kr;N.textContent=dn(u);let je=ge?[o]:[];ge=!1,i.ariaLabelledByElements!==void 0?(i.ariaLabelledByElements=Te?[w,u]:[w,N],i.ariaDescribedByElements=Te?je:[...je,u]):i.setAttribute("aria-label",`${w.textContent}, ${N.textContent}`)}function m(i,u=!0){se=0;let w=ae(),N=w.find(J=>J.e===i);if(N&&!et(w,q).includes(N)&&(q=N.m),i!==k&&(ce=-1),i!==g&&(g=null),k=i,$(i),X(i),i.scrollIntoView({block:"nearest",inline:"nearest",behavior:M?"auto":"smooth"}),!u)return;e.fe();let z=r[W^=1];We(z,i),_e(z,i.getBoundingClientRect(),4),z.inert=!1,z.focus({preventScroll:!0}),r[W^1].inert=!0}function S(){de=null;let i=document.activeElement;j=be()??i;let u=Be(Y),w=u??(i&&i!==document.body&&e.root.contains(i)&&!i.closest("[data-pipeup-ignore]")?ae().filter(N=>N.e.contains(i)).pop():void 0)??Ee();return w?(u||(q=w.m),F=!0,m(w.e),!0):!1}function I(){let i=re();Y=k,k=null,$(null),X(null);for(let u of r)ee(u,!0);return i}function R(){let i=j;i&&i!==document.body&&i.isConnected&&i.focus?.({preventScroll:!0}),(!i||i===document.body||!i.matches?.(":focus"))&&e.n.querySelector(".launch .mode")?.focus({preventScroll:!0})}function D(i){let u=Be(i);return u?yo(ae(),u):[]}function H(i){let u=et(ae(),q),w=u.findIndex(z=>z.e===k),N=u[w<0?i>0?0:u.length-1:(w+i+u.length)%u.length];N&&m(N.e)}function U(i){if(k)return H(i);de=null;let u=document.activeElement;j=be()??u;let w=Y?.isConnected?Y:null,N=w&&Be(w),z;if(N){q=N.m;let J=et(ae(),q),Te=J.indexOf(N);z=J[(Te+i+J.length)%J.length]}else if(w){q=0;let J=et(ae(),0),Te=ne=>(w.compareDocumentPosition(ne.e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0,je=ne=>ne.e.contains(w);i>0?z=J.find(ne=>Te(ne)&&!je(ne))??J[0]:z=J.filter(ne=>!Te(ne)&&!je(ne)).pop()??J[J.length-1]}else z=Ee(),z&&(q=z.m);if(!z)return e.T("Nothing here to comment on");F=!0,m(z.e)}function le(){let i=g??k,u=i&&kn(i,e.root,t);if(!u)return e.T("Nothing around it");if((!B||!i.contains(B))&&(B=i),g)return Q(u);m(u)}function Me(){let i=g??k,u=i?D(i):[],w=u.find(N=>B&&N.e.contains(B))??u.find(N=>xe(N.e))??u[0];if(!w)return e.T("Nothing inside it");g?Q(w.e):m(w.e)}function Ye(i=!1){if(!k)return;if(e.state.t&&!e.S())return e.he();if(!i)return _(k);let u=ke(k);if(!u.length)return e.T("No comments on this block");ce=(ce+1)%u.length,e.open(u[ce].id),u.length>1&&e.T(`Comment ${ce+1} of ${u.length} on this block`)}function kt(i){if(["Tab","ArrowUp","ArrowDown","Enter"," ","Escape"].includes(i.key)&&!(i.key.startsWith("Arrow")&&(i.metaKey||i.ctrlKey||i.altKey))){if(i.preventDefault(),i.stopPropagation(),He=i.key,i.key==="Escape")return void e.U();if(i.key==="Enter"||i.key===" ")return Ye(i.shiftKey&&i.key==="Enter");e.state.o&&e.open(null),i.key==="Tab"?H(i.shiftKey?-1:1):i.key==="ArrowUp"?le():Me()}}let st=()=>{let i=be();return i?!!i.closest("[inert]"):!document.activeElement||document.activeElement===document.body},He="",c=!1,L=i=>{c&&window.removeEventListener("keyup",L,!0),i.key===He&&(He="",i.preventDefault(),i.stopPropagation())};window.addEventListener("keyup",L,!0),window.addEventListener("pointermove",Ue,!0),document.addEventListener("selectionchange",we);for(let i of xo)window.addEventListener(i,Ae,!0);for(let i of bo)window.addEventListener(i,$e,!0);return window.addEventListener("keydown",Ne,!0),{U(){return g?(K(null),!0):!1},z:()=>k!==null,ge:()=>F&&!k,ee:S,W(){k&&!re()&&m(k)},u(){if(de=null,k&&!(k.isConnected&&ze(k))){let w=Ee();w?m(w.e,re()||st()):I()}let i=e.n.querySelector(".launch");if(i&&h.nextElementSibling!==i&&!re()&&!h.contains(be()))for(let w of[n,...r,h])e.n.insertBefore(w,i);let u=e.state.t;y&&u!==y?(y=null,K(null),k&&m(k,st())):u&&!y&&(p||g)&&K(null)},M(){Le(),ve(),k&&_e(r[W],k.getBoundingClientRect(),4)},destroy(){I()&&R();for(let i of r)i.remove();A(),P(),c=!0,He||window.removeEventListener("keyup",L,!0),window.removeEventListener("pointermove",Ue,!0),document.removeEventListener("selectionchange",we);for(let i of xo)window.removeEventListener(i,Ae,!0);for(let i of bo)window.removeEventListener(i,$e,!0);window.removeEventListener("keydown",Ne,!0),n.classList.remove("show"),h.classList.remove("show"),ee(h,!0),O(n,()=>n.remove()),O(h,()=>h.remove())}}}var Ur=300,zr=32,Ln=220,yt=320,Wr=24,ko=24;function An(e,t=!1){let o=e.ownerDocument.documentElement,n=o.getAttribute("data-pipeup-layout");if(n==="bubbles"||e.querySelector("[data-pipeup-slide]"))return null;let r=e.querySelector("article, main, [role=main]")??(n==="column"?e:null);if(!r)return null;if(o.hasAttribute("data-pipeup-reserve")){let a=o.clientWidth,d=getComputedStyle(r).maxWidth,h;return d.endsWith("px")?h=parseFloat(d):d.endsWith("%")?h=parseFloat(d)/100*a:h=r.getBoundingClientRect().width,n!=="column"&&a<h+yt-(t?Wr:0)?null:{x:a-yt+ko,width:yt-2*ko}}let s=r.getBoundingClientRect().right;if(window.innerWidth-s<Ur&&n!=="column")return null;let l=s+zr;return{x:l,width:Math.max(220,Math.min(300,window.innerWidth-l-16))}}function Mn(e,t){let o=e.resolved.get(t.id);return!o||o.state==="orphaned"&&!e.te.has(t.id)}function To(e){let t=v("div",{class:"col"});e.n.append(t);let o=new Map,n=null,r=new ResizeObserver(()=>a()),s=p=>Mn(e,p);function l(p){let g=e.resolved.get(p.id),y=g?yn(p.anchor,g):null;return y===null?Number.POSITIVE_INFINITY:y+window.scrollY-4}function a(){let p=[],g=[];for(let[E,P]of o){let k=l(P.thread);if(Number.isFinite(k))P.placed=k;else if(e.te.has(E)){if(P.placed===null){P.e.classList.add("wait");continue}k=P.placed}Number.isFinite(k)?p.push({id:E,w:k,height:P.e.offsetHeight}):g.push({id:E,height:P.e.offsetHeight})}let y=e.state.t,x=y?yn(y.anchor,y.resolved):null;n&&x!==null&&p.push({id:"draft",w:x+window.scrollY-4,height:n.e.offsetHeight});let C=mo(p,n?"draft":e.state.o),A=Math.max(0,...p.map(E=>(C.get(E.id)??0)+E.height))+24;for(let E of g)C.set(E.id,A),A+=E.height+10;for(let[E,P]of o){if(P.e.classList.contains("wait")){if(!C.has(E))continue;P.e.style.transition="none",P.e.style.transform=`translateY(${Math.round(C.get(E))}px)`,P.e.offsetWidth,P.e.style.transition="",P.e.classList.remove("wait");continue}P.e.style.transform=`translateY(${Math.round(C.get(E)??0)}px)`}n&&(n.e.style.transform=`translateY(${Math.round(C.get("draft")??0)}px)`)}function f(p,g){p.thread=g,p.lost=s(g),p.view.update(g,{lost:p.lost?g.anchor.snapshot:null})}function d(p){let g=s(p),y=it(p,e.D,{H:"column",lost:g?p.anchor.snapshot:null}),x=v("div",{class:"th","data-thread":p.id},v("button",{class:"opn sr",type:"button","data-thread":p.id}),y.element);return x.style.transition="none",x.addEventListener("mouseenter",()=>e.E(p.id)),x.addEventListener("mouseleave",()=>e.E(null)),x.addEventListener("click",()=>e.open(p.id)),t.append(x),r.observe(x),{e:x,thread:p,lost:g,placed:null,view:y}}function h(){let p=e.state.t;if(n&&p&&n.of!==p){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Ln),n=null}if(p&&n&&(n.i.V(p.label),n.i.B(e.state.s&&!p.anchor.quote&&!p.anchor.point)),p&&!n){let g=Ft(e,p),y=v("div",{class:"th on"},g.element);y.style.transition="none",t.append(y),r.observe(y),n={e:y,i:g,of:p},g.B(e.state.s&&!p.anchor.quote&&!p.anchor.point),g.focus()}else if(!p&&n){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Ln),n=null,e.I(null)}}function T(p){ee(t,e.state.l);let g=new Set,y=[],x=e.state.o!==null||e.state.t!==null;for(let C of p){if(!e.R(C))continue;g.add(C.id);let A=o.get(C.id);A?(A.thread!==C||A.lost!==s(C))&&f(A,C):(A=d(C),o.set(C.id,A),y.push(A.e));let E=A.e,P=e.state.o===C.id;E.classList.toggle("on",P);let k=E.firstElementChild,q=C.root.replies.length;k.setAttribute("aria-label",`Open thread: ${he(C.root.text,60)}, ${zt(q)}`),k.setAttribute("aria-expanded",String(P)),ee(k,P);let W=E.querySelector(".more");W&&ee(W,!P),E.classList.toggle("dim",x&&!P),E.classList.toggle("hot",e.state.E===C.id&&!P),E.classList.toggle("resolved",C.resolved),E.classList.toggle("lost",A.lost)}for(let[C,A]of o)g.has(C)||(o.delete(C),r.unobserve(A.e),A.e.classList.add("out"),window.setTimeout(()=>A.e.remove(),Ln));h(),Rt(t,p.filter(C=>g.has(C.id)).sort(Ke(e)).map(C=>o.get(C.id).e),n?.e??null)&&t.offsetWidth,a(),n&&y.push(n.e);for(let C of y)C.offsetWidth,C.style.transition=""}function M(){let p=An(e.root,!0);p&&(t.style.width=`${p.width}px`,t.style.transform=`translate(${p.x}px, ${-window.scrollY}px)`)}return{u:T,M,destroy(){r.disconnect(),e.I(null),t.remove()}}}var So="[data-pipeup-ignore],input,textarea,select,[contenteditable]:not([contenteditable=false])";function Lo(e){let t=v("button",{type:"button","aria-label":"Comment",title:"Comment"},te("comment",17)),o=v("div",{class:"selbar"},t);o.inert=!0,e.n.append(o);let n=null,r=0,s=!1,l=p=>{let g=p&&(p.nodeType===Node.ELEMENT_NODE?p:p.parentElement);return!!g&&e.root.contains(g)&&!g.closest(So)};function a(){if(!n)return;let p=n.getBoundingClientRect(),{left:g,top:y}=Kt({left:p.left,top:p.top,width:p.width,height:p.height},{width:o.offsetWidth||36,height:o.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});o.style.left=`${g}px`,o.style.top=`${y}px`}function f(){n=null,o.inert=!0,o.classList.remove("show")}function d(p=!1){let g=window.getSelection();if(!e.state.s||!g||g.isCollapsed||g.rangeCount===0||!g.toString().trim()||!l(g.anchorNode)||!l(g.focusNode)){f();return}!n&&!p&&e.T("Enter comments on the selected words"),n=g.getRangeAt(0).cloneRange(),a(),o.inert=!1,o.classList.add("show")}t.addEventListener("mousedown",p=>p.preventDefault()),t.addEventListener("click",p=>{if(p.stopPropagation(),e.state.t&&!e.S())return e.F();let g=n;if(!g)return;let y;try{y=an(g,e.root,e.d.view(g.commonAncestorContainer))}catch(C){e.Z(C),f();return}let x=he(g.toString().replace(/\s+/g," ").trim(),60);window.getSelection()?.removeAllRanges(),f(),e.Q({anchor:y,label:`\u201C${x}\u201D`,ranges:[g],resolved:{state:"attached",element:null,range:g}})});let h=()=>{if(window.clearTimeout(r),r=window.setTimeout(()=>s||d(),250),!n)return;let p=window.getSelection();(!p||p.isCollapsed||!p.toString().trim())&&f()};document.addEventListener("selectionchange",h);let T=p=>{p.type!=="keyup"&&(s=p.type==="mousedown"),!(s||e.f(p))&&window.setTimeout(()=>d(p.type==="mouseup"),0)};window.addEventListener("mousedown",T,!0),window.addEventListener("mouseup",T,!0),window.addEventListener("keyup",T,!0);let M=p=>{p.key!=="Enter"||!n||e.f(p)||p.target instanceof Element&&p.target.closest(`${So},${Yt}`)||(p.preventDefault(),p.stopPropagation(),t.click())};return window.addEventListener("keydown",M,!0),{u(){!e.state.s&&n&&f()},M(){n&&a()},destroy(){window.removeEventListener("mousedown",T,!0),window.removeEventListener("mouseup",T,!0),window.removeEventListener("keyup",T,!0),window.removeEventListener("keydown",M,!0),window.clearTimeout(r),document.removeEventListener("selectionchange",h),o.remove()}}}async function Cn(e,t){try{await navigator.clipboard.writeText(e);return}catch{}let o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.cssText="position:fixed;opacity:0;pointer-events:none",t.append(o),o.select();let n=document.execCommand("copy");if(o.remove(),!n)throw new Error("pipeup: your browser blocked copying")}var Yr=3e3,Ao="Hidden on the page";function Mo(e){let t=[v("span",{class:"n"}),v("span",{class:"n"})],o=te("comment",20,1.4);o.lastElementChild.setAttribute("stroke-width","1.6");let n=v("button",{class:"mode",type:"button","aria-label":"Comment","aria-keyshortcuts":vn,"aria-haspopup":"menu","aria-expanded":"false"},v("span",{class:"plus"},o),v("span",{class:"cnt"},te("bubble",34,1.4),...t),v("span",{class:"dot"})),r=document.createTextNode("Comment"),s=v("span",{class:"ttip","aria-hidden":"true"},r,v("small",{},ft)),l=v("div",{class:"launch"},n,s),a=v("div",{class:"menu",role:"menu","aria-label":"Comments"}),f=v("div",{class:"list",role:"menu","aria-label":"All comments"}),d=v("span",{class:"pn"}),h=v("button",{class:"ib",type:"button","aria-label":"Close"},te("close")),T=v("button",{class:"hs",type:"button",role:"switch","aria-checked":"false"},"Show resolved",v("span",{class:"sw","aria-hidden":"true"}));T.addEventListener("click",m=>{m.stopPropagation(),e.c.ve()});let M=v("div",{class:"all",role:"dialog","aria-label":"All comments"},v("div",{class:"hd"},v("span",{},"All comments"),d,T,h),f),p=v("div",{class:"pop side",role:"dialog","aria-label":"Comment thread"});a.inert=M.inert=p.inert=!0,e.n.append(a,l,M);let g=!1,y=null,x=0,C=[],A=0,E=null,P=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,k=m=>{g=e.state.c=m,window.clearTimeout(x),x=0,m||y?.(!0),a.classList.toggle("show",m),ee(a,!m),n.setAttribute("aria-expanded",String(m))},q=(m,S=!1)=>{e.state.l!==m&&(e.state.l=m,e.u(),m?(W(f)[0]??h).focus({preventScroll:!0}):S&&n.focus({preventScroll:!0}))},W=(m=a)=>[...m.querySelectorAll(".mi")],F=()=>a.getRootNode().activeElement,Y=()=>{k(!1),n.focus({preventScroll:!0})},j=m=>{let S=W(m.currentTarget);if(S.length===0)return;let I=F(),R=S.indexOf(I),D=H=>{m.preventDefault(),S[(H+S.length)%S.length]?.focus({preventScroll:!0})};m.key==="ArrowDown"?D(R+1):m.key==="ArrowUp"?D(R<0?S.length-1:R-1):m.key==="Home"?D(0):m.key==="End"&&D(S.length-1)};a.addEventListener("keydown",j),f.addEventListener("keydown",j),h.addEventListener("click",m=>{m.stopPropagation(),q(!1,!0)});let B=m=>Mn(e,m),se=()=>C.filter(m=>!m.resolved&&!e.O(m)).length,ce=()=>C.filter(m=>!m.resolved&&e.O(m)).length,ge=()=>C.filter(m=>!m.resolved).length,de=m=>{let S=m.anchor.view?.slide,I=e.d.p(m.anchor.view)?"":Ot(m.anchor.view);return S&&e.d.slide()!==null?`On slide ${S}`:I?`In ${I}`:Ao},oe=(m,S,I="")=>v("div",{role:"group","aria-label":I?`${m} \xB7 ${I}`:m},v("div",{class:"sec","aria-hidden":"true"},m,I&&v("b",{},I)),...S);function pe(m,S){let I=e.d.slide(),R=new Map;for(let D of m){let H=D.thread,U=I!==null?H.anchor.view?.slide??I:e.O(H)?e.d.p(H.anchor.view)?"":Ot(H.anchor.view):null;R.set(U,[...R.get(U)??[],D])}if(I===null){let D=R.get(null)??[];return R.delete(null),[...D.map(S),...[...R].map(([H,U])=>oe(H||Ao,U.map(S)))]}return[...R].sort(([D],[H])=>Number(D)-Number(H)||0).map(([D,H])=>oe(`Slide ${D} \xB7 ${H.filter(U=>!U.thread.resolved).length} open`,H.map(S),D===I?"This slide":""))}function Le(){let m=F()?.dataset.thread,S=e.c.all().filter(H=>!H.thread.resolved||e.state.k),I=H=>{let U=H.thread,le=Je(U.root.author,U.root.name);le.classList.add("in");let Me=v("button",{class:U.resolved?"mi done":"mi",type:"button",role:"menuitem","data-thread":U.id},le,v("span",{},v("span",{class:"clamp"},U.root.deleted?"Deleted":U.root.text),v("small",{},B(U)?`\u201C${he(U.anchor.snapshot,80)}\u201D`:H.location.where)));return Me.addEventListener("click",Ye=>{Ye.stopPropagation(),ve(U.id,Me.getBoundingClientRect().top)}),Me},R=S.filter(H=>B(H.thread));d.textContent=String(ge()),T.setAttribute("aria-checked",String(e.state.k)),f.replaceChildren(S.length?"":v("div",{class:"sec",role:"presentation"},"No open comments"),...pe(S.filter(H=>!B(H.thread)),I),R.length?oe("No longer on the page",R.map(I)):"");let D=W(f);m&&D.find(H=>H.dataset.thread===m)?.focus({preventScroll:!0})}function ve(m,S){Qe()&&(e.state.L=!0,q(!1)),O(m,S)}let b="";function O(m,S){let I=C.find(R=>R.id===m);if(I){if(b=m,!e.O(I))return $(I,S);if(e.state.t&&!e.S())return e.F();e.d.Y(I.anchor.view??{}).then(()=>{e.ne();let R=C.find(D=>D.id===m);R&&b===m&&(e.state.l||e.state.L)&&$(R,S)})}}function $(m,S){let I=m.id,R=e.resolved.get(I),D=R&&!B(m)&&!e.O(m)?R.element??R.range?.startContainer.parentElement??null:null;if(D?.scrollIntoView({block:"center",inline:"nearest",behavior:P?"auto":"smooth"}),D&&R&>(m.anchor,R)&&D.checkVisibility?.({visibilityProperty:!0})!==!1){X(),e.open(I);return}e.open(null),Qe()&&(e.state.L=!0,e.u()),K(m,S)}function K(m,S){let I=!B(m)&&e.O(m),R={quote:m.anchor.quote?.exact??null,lost:B(m)||I?m.anchor.snapshot:null,place:I?de(m):null};if(E?.id===m.id?E.view.update(m,R):(E={id:m.id,view:it(m,e.D,{H:"popover",...R})},p.replaceChildren(E.view.element)),S===void 0)return;p.isConnected||(e.n.insertBefore(p,M),p.offsetWidth);let D=qt(e.state.l),{left:H,top:U}=_t({x:D.width,y:S,below:!1},{width:Ze,height:p.offsetHeight},D);p.style.left=`${H}px`,p.style.top=`${U}px`,p.classList.add("show"),p.inert=!1,e.we(m.id)}function X(m=!1){E&&(E=null,p.classList.remove("show"),ee(p,!0),m&&e.state.L&&(e.state.L=!1,e.u()))}function V(m,S,I,R=!1,...D){let H=v("button",{class:"mi",type:"button",role:R?"menuitemcheckbox":"menuitem"},m,v("span",{class:"lb"},S),...D,R&&v("span",{class:"sw","aria-hidden":"true"}),v("span",{class:"tt","aria-hidden":"true"}));return H.addEventListener("click",U=>{U.stopPropagation(),I(U)}),H}let _=(m,S,I,R)=>{let D=m.querySelector(".lb");D.textContent!==S&&(D.textContent=S),m.querySelector(".tt").textContent=I,m.setAttribute("aria-description",I),R!==void 0&&m.setAttribute("aria-checked",String(R))},Q=()=>v("div",{class:"sep",role:"separator"}),fe=v("span",{class:"ma"}),Re=v("span",{class:"kc"}),Ue="",G=V(fe,"",ae,!1,Re);G.dataset.item="name";let we=V(te("copy"),"Copy as Markdown",()=>{Y(),e.c.copyAll("ai")}),Ae=V(te("lines"),"Copy as Text",()=>{Y(),e.c.copyAll("text")}),$e=v("span",{class:"kc"}),Ne=V(te("list"),"All comments",()=>{k(!1),q(!0)},!1,$e),ye=V(te("comment"),"Start commenting",m=>{let S=!e.state.s&&m.detail===0;e.ye(!e.state.s,S),S&&k(!1)},!0,v("span",{class:"kc","aria-hidden":"true"},ft));ye.dataset.item="comment",ye.setAttribute("aria-keyshortcuts",vn);let be=[G,Q(),we,Ae,Ne,Q(),ye];function re(){let m=ge(),S=e.c.name(),I=S||Oe(e.doc.me);if(_(G,I,S?"The name on your comments":"Add a name to show on your comments"),G.setAttribute("aria-label",`${I}, ${S?"edit":"add"} your name`),Re.replaceChildren(S?te("edit",13):"Add name"),mt(e.doc.me,S)!==Ue){Ue=mt(e.doc.me,S);let R=Je(e.doc.me,S);R.classList.add("in"),fe.replaceChildren(R)}_(we,"Copy as Markdown","Markdown, with where each thread is"),_(Ae,"Copy as Text","Just the words"),_(Ne,"All comments","Every thread, and where it is"),$e.textContent=m?String(m):"",_(ye,"Start commenting",e.state.s?"Turn off to hide the comments again":"Shows the comments; choose any part of the page to comment on it",e.state.s)}function ze(){re(),a.firstChild!==G&&a.replaceChildren(...be)}function ae(){let m=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"});m.value=e.c.name();let S=v("div",{class:"ed"},fe.cloneNode(!0),m),I=(R,D=!1)=>{if(y!==I)return;y=null;let H=m.value.trim();R&&H&&H!==e.c.name()&&e.c.rename(H).then(re),S.replaceWith(G),D&&G.focus({preventScroll:!0})};y=I,m.addEventListener("keydown",R=>{R.stopPropagation(),(R.key==="Enter"||R.key==="Escape")&&(R.preventDefault(),I(R.key==="Enter",!0))}),m.addEventListener("blur",()=>I(!0)),G.replaceWith(S),m.focus({preventScroll:!0})}n.addEventListener("click",m=>{if(m.stopPropagation(),g){k(!1);return}ze(),k(!0),m.detail===0&&W().at(-1)?.focus({preventScroll:!0})});let Be=!1,xe=()=>{Be=M.contains(F())},Ee=m=>{let S=m.composedPath();g&&!S.includes(a)&&!S.includes(n)&&(k(!1),e.state.s&&!e.f(m)&&(e.X(m),m.preventDefault(),m.stopPropagation())),e.state.l&&!e.f(m)&&q(!1,Be&&(!document.activeElement||document.activeElement===document.body)),!S.includes(p)&&!S.includes(M)&&X(!0)},ke=m=>{if(!g||m.pointerType==="touch"||m.type==="pointerout"&&m.relatedTarget)return;let S=m.composedPath();m.type==="pointerover"&&(S.includes(a)||S.includes(n))?(window.clearTimeout(x),x=0):x||(x=window.setTimeout(()=>{x=0,y||k(!1)},Yr))};window.addEventListener("pointerdown",xe,!0),window.addEventListener("click",Ee,!0),window.addEventListener("pointerover",ke,!0),window.addEventListener("pointerout",ke,!0);let We=m=>{if(m.key!=="Escape"||y)return;let S=m.composedPath()[0];if(g)Y();else if(e.state.l&&!(S instanceof HTMLTextAreaElement&&!M.contains(S)))q(!1,!0);else if(E)X(!0),e.D.close();else return;m.stopPropagation()};return window.addEventListener("keydown",We,!0),{u(m){C=m;let S=se();if(S!==A){if(S){let[U,le]=t[0].classList.contains("on")?t:[t[1],t[0]];le.textContent=S>99?"99+":String(S),le.classList.toggle("s",S>99),U.classList.remove("on"),le.classList.add("on")}n.classList.toggle("has",S>0),A=S}let I=ce(),R=I?`${S} here \xB7 ${I} ${e.d.slide()!==null?"on other slides":"in other views"}`:"";n.classList.toggle("else",I>0);let D=`Comment${e.state.s?", comment mode on":""}${R?`, ${R}`:S?`, ${S} open`:""}`;n.getAttribute("aria-label")!==D&&n.setAttribute("aria-label",D),r.data!==(R||"Comment")&&(r.data=R||"Comment"),n.classList.toggle("on",e.state.s),g&&!e.state.c&&k(!1),g&&re();let H=e.state.l;if(M.classList.toggle("full",Qe()),M.classList.contains("show")!==H&&(M.classList.toggle("show",H),ee(M,!H)),H&&Le(),E){let U=m.find(le=>le.id===E?.id);!U||e.state.o||U.resolved&&!e.state.k?X():K(U)}},M(){},destroy(){window.removeEventListener("pointerdown",xe,!0),window.removeEventListener("click",Ee,!0),window.removeEventListener("pointerover",ke,!0),window.removeEventListener("pointerout",ke,!0),window.clearTimeout(x),window.removeEventListener("keydown",We,!0),a.remove(),M.remove(),p.remove(),l.remove()}}}var bt="[data-pipeup-slide]",Co=1e3,Po=["scroll","resize","keyup","click","transitionend","slidechanged"],Pn=null,Et=null,jt=new Set,On=new Set,xt=e=>{try{e()}catch(t){globalThis.reportError?.(t)}};function jr(e){let t=null;if(e){t={};let o=0;for(let[n,r]of Object.entries(e))if(!(typeof r!="string"||n==="slide"||n.length>Z.viewKey||r.length>Z.viewValue)){if(++o>=Z.viewEntries)break;t[n]=r}}Pn=t;for(let o of On)o()}function Gr(e){return jt.add(e),()=>void jt.delete(e)}function Gt(e){Et=typeof e?.current=="function"&&typeof e.go=="function"?e:null}function Xr(e,t,o){let n=t.K(),r=null,s=0,l=0;for(let a of e){if(!t.shown(a))continue;let f=t.i(a),d=Math.min(f.left+f.width,n.width)-Math.max(f.left,0),h=Math.min(f.top+f.height,n.height)-Math.max(f.top,0);if(d<=0||h<=0)continue;let T=Math.round(d*h),M=t.opacity(a);(T>s||T===s&&(M>l||M===l&&a===o))&&(r=a,s=T,l=M)}return r}function Jr(e,t,o){return t!==null?e?.slide===void 0||e.slide===t:!e||!o?!0:Object.entries(e).every(([n,r])=>n==="label"||n==="slide"||o[n]===r)}function Zr(){return{i:e=>e.getBoundingClientRect(),shown:e=>e.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1,opacity:e=>parseFloat(getComputedStyle(e).opacity)||0,K:()=>({width:window.innerWidth,height:window.innerHeight})}}var Oo=()=>{let e=window.Reveal;return typeof e?.getIndices=="function"&&typeof e.slide=="function"?e:null};function Io(e,t,o=Zr()){let n=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,r=null,s=null,l=0,a=!1,f=()=>[...e.querySelectorAll(bt)],d=()=>[...e.querySelectorAll(".slides > section")],h=A=>typeof A=="string"&&A.length>0&&A.length<=Z.viewValue?A:null,T=A=>h(A?.getAttribute("data-pipeup-slide"));function M(){if(Et){let E=null;if(xt(()=>{let P=Et.current();Number.isInteger(P)&&P>0&&(E=String(P))}),E!==null)return E}let A=Oo();if(A){let E=null;if(xt(()=>{let P=A.getIndices().h,k=d()[P];E=T(k?.matches(bt)?k:k?.querySelector(bt))??h(String(P+1))}),E!==null)return E}return r&&!r.isConnected&&(r=null),r=Xr(f(),o,r)??r,T(r)}function p(){l=0,s=M(),t()}let g=()=>{!l&&!a&&(l=requestAnimationFrame(p))},y=A=>Jr(A,s,Pn);function x(A){if(y(A))return Promise.resolve(!0);let E=A.slide,P=Oo(),k=f().find(F=>T(F)===E),q=/^[1-9]\d{0,5}$/.test(E??"");if(q&&Et)xt(()=>Et.go(Number(E)));else if(q&&P){let F=k?d().findIndex(Y=>Y===k||Y.contains(k)):-1;xt(()=>P.slide(F>=0?F:Number(E)-1))}else if(jt.size)for(let F of jt)xt(()=>F({...A}));else if(k)k.scrollIntoView({block:"start",behavior:n?"auto":"smooth"});else return Promise.resolve(!1);let W=performance.now();return new Promise(F=>{let Y=se=>{clearTimeout(j),F(se)},j=setTimeout(()=>Y(!1),Co),B=()=>{if(a)return Y(!1);if(s=M(),y(A))return Y(!0);if(performance.now()-W>=Co)return Y(!1);requestAnimationFrame(B)};requestAnimationFrame(B)})}let C=new MutationObserver(A=>{A.some(E=>E.target instanceof Element&&E.target.matches(bt))&&g()});C.observe(e,{subtree:!0,attributes:!0,attributeFilter:["class","style","hidden"]});for(let A of Po)window.addEventListener(A,g,{capture:!0,passive:!0});return On.add(g),s=M(),{slide:()=>s,view(A){let E=A instanceof Element?A:A?.parentElement,P=T(E?.closest(bt))??s,k={...P!==null?{slide:P}:{},...Pn};return Object.keys(k).length?k:void 0},p:y,Y:x,destroy(){a=!0,cancelAnimationFrame(l),C.disconnect();for(let A of Po)window.removeEventListener(A,g,!0);On.delete(g)}}}var $o=["pipeup-quote","pipeup-on","pipeup-done"],Qr={"pipeup-quote":[[250,227,188,.75],[250,200,100,.28]],"pipeup-on":[[247,212,154,.95],[250,200,100,.42]],"pipeup-done":[[180,178,169,.22],[180,178,169,.2]]},ei=(e,t)=>$o.map(o=>{let[n,r,s,l]=Qr[o][e?1:0];return`::highlight(${o}){background-color:rgba(${n},${r},${s},${+(l*t).toFixed(3)})}`}).join("");function No(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}var ti="<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><rect x='7' y='7' width='23' height='23' rx='4' fill='none' stroke='#534AB7' stroke-width='2' stroke-dasharray='4 3'/><path d='M3 2v15l4-3.5 3 6.5 2.5-1.2-3-6.3H15z' fill='#fff' stroke='#2C2C2A' stroke-width='1.2' stroke-linejoin='round'/></svg>",ni=`:not([data-pipeup-ignore],[data-pipeup-ignore] *){cursor:url("data:image/svg+xml,${encodeURIComponent(ti)}") 3 2,crosshair!important}`;function Bo(e=document,t=!1){let o=e.defaultView?.CSSStyleSheet;if(!o||!("replaceSync"in o.prototype)||!("adoptedStyleSheets"in e))return{oe(){},re(){},j(){},ie(){},remove:()=>Ro()};let n=new o,r=null,s=!1,l=1,a=0,f="",d=0,h=()=>n.replaceSync(ei(t,l)+(r===null?"":`:root{--pipeup-gutter:${r}px}`)+(s?ni:"")+(a||f?`html{--pipeup-panel:${a}px;${a?`margin-right:${a}px!important;`:""}${f}}`:""));return h(),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],{oe(T){T!==r&&(r=T,h())},re(T){T!==s&&(s=T,h())},j(T){l=T,h()},ie(T,M){T!==a&&(a=T,f=M?"":"transition:margin-right .34s cubic-bezier(.4,0,.2,1)!important",clearTimeout(d),!T&&f&&(d=window.setTimeout(()=>{f="",h()},400)),h())},remove(){clearTimeout(d),e.adoptedStyleSheets=e.adoptedStyleSheets.filter(T=>T!==n),Ro()}}}function Ho(e){No()&&(CSS.highlights.set("pipeup-quote",new Highlight(...e.quote)),CSS.highlights.set("pipeup-on",new Highlight(...e.on)),CSS.highlights.set("pipeup-done",new Highlight(...e.done)))}function Ro(){if(No())for(let e of $o)CSS.highlights.delete(e)}var In=':host{all:initial}*{box-sizing:border-box}button{-webkit-appearance:none;appearance:none;font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}svg{display:block}.layer{all:initial;display:block;position:fixed;inset:0;pointer-events:none;font:13px/1.5 var(--pu-font,system-ui,sans-serif);color:var(--k);--k:#2C2C2A;--mu:#5F5E5A;--fa:#888780;--ln:#E5E3DA;--ru:#ECEAE2;--so:#FAFAF7;--su:#FFFFFF;--ho:#F1EFE8;--as:color-mix(in srgb,var(--pu-accent,#534AB7) 12%,transparent);--sh:0 8px 28px rgba(44,44,42,.1);--in:.26s;--mv:.34s;--out:.2s;--pl:1.2s;--eo:cubic-bezier(.22,.61,.36,1);--eio:cubic-bezier(.4,0,.2,1);--ei:cubic-bezier(.4,0,1,1)}.layer.dark{--k:#ECEBE6;--mu:#B4B2A9;--fa:#8D8B84;--ln:#3A3936;--ru:#34332F;--so:#22221F;--su:#1B1B19;--ho:#2C2C29;--sh:0 8px 28px rgba(0,0,0,.45)}.layer.hidden .bub,.layer.hidden .col,.layer.hidden .pop,.layer.hidden .tip,.layer.hidden .mark,.layer.hidden .selbar{opacity:0!important;pointer-events:none!important}.tx{font-size:14px;line-height:1.5;color:var(--k);white-space:pre-wrap;overflow-wrap:anywhere}.tx.del,.who,.rest,.ctx{color:var(--fa)}.who,.rest{font-size:12px}.who{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rft>.who{display:block}.ctx[hidden]{display:none}.ctx{font-size:12px;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tx a{color:var(--pu-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.ft,.rft{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--in) var(--eo),opacity var(--in) var(--eo)}.ft>*,.rft>*{overflow:hidden;min-height:0;display:flex;align-items:center}.root:hover>.ft,.root:focus-within>.ft,.it:hover>.rft,.it:focus-within>.rft{grid-template-rows:1fr;opacity:1}.ft.has-rest{grid-template-rows:1fr;opacity:1}.ft.has-rest>*{grid-area:1/1}.ft .hover{opacity:0;transition:opacity var(--in) var(--eo)}.ft .rest{transition:opacity var(--in) var(--eo)}.root:hover>.ft .hover,.root:focus-within>.ft .hover,.ft:not(.has-rest) .hover{opacity:1}.root:hover>.ft .rest,.root:focus-within>.ft .rest{opacity:0}.acts{margin-left:6px;display:flex;flex:none}.ib{width:24px;height:22px;display:grid;place-items:center;border-radius:6px;color:var(--mu);transition:background-color .2s var(--eo),color .2s var(--eo)}.ib:hover,.ib:focus-visible{background:var(--ho);color:var(--k);outline:none}.rps,.rbox{padding-left:14px}.rps .it{padding-top:6px}.more{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--mv) var(--eio)}.more>div{overflow:hidden;min-height:0}.th:not(.on) .more{grid-template-rows:0fr}.row{display:flex;align-items:center;gap:8px;padding:8px 0 2px;cursor:text}.input{flex:1;min-width:0;height:27px;display:block;border:0;border-bottom:1px solid var(--ln);outline:none;resize:none;overflow:hidden;font:inherit;font-size:14px;line-height:1.5;padding:3px 0;color:var(--k);background:transparent;transition:border-color var(--in) var(--eo)}.row:hover .input,.input:hover{border-bottom-color:var(--mu)}.input:focus{border-bottom-color:var(--pu-accent)}.ed{display:flex;gap:10px;align-items:center;min-height:34px;padding:6px 10px}.ed .input{font-size:13px;height:22px}.root,.it{position:relative;padding-right:30px}.av{display:grid;place-items:center;width:22px;height:22px;border-radius:32%;font-size:12px;font-weight:600;line-height:1;opacity:0;transform:scale(.85);transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.av.in{opacity:1;transform:none}.av svg{width:80%;height:80%}.root>.av,.it>.av{position:absolute;top:0;right:0}.it>.av{top:6px}.av{--av-l:92%;--av-d:30%;--s:60%;background:hsl(var(--h) var(--s) var(--av-l));color:hsl(var(--h) var(--s) var(--av-d))}.dark .av{--av-l:20%;--av-d:78%}.c0{--h:0}.c1{--h:25}.c2{--h:50}.c3{--h:130}.c4{--h:175}.c5{--h:215}.c6{--h:270}.c7{--h:330}.c8{--h:28;--s:35%}.c9{--h:220;--s:8%}.me{flex:none;display:grid}.me>.av{grid-area:1/1;width:26px;height:26px;font-size:13px}.you{display:grid;padding:0 34px;min-height:24px;font-size:12px;color:var(--fa)}.you>*{grid-area:1/1;display:flex;align-items:center;min-width:0;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.say{white-space:pre;overflow:hidden}.nm{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.say button{flex:none}.say button{color:var(--mu);text-decoration:underline;text-decoration-color:var(--ln);text-underline-offset:2px;transition:color .2s var(--eo)}.say button:hover,.say button:focus-visible{color:var(--pu-accent);outline:none}.nf{opacity:0;transform:translateY(-4px);pointer-events:none}.nf .input{font-size:13px;height:24px}.you.naming .nf{opacity:1;transform:none;pointer-events:auto}.you.naming .say{opacity:0;pointer-events:none}.send{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;color:var(--pu-accent);flex:none;opacity:0;pointer-events:none;transition:opacity var(--in) var(--eo),background-color .2s var(--eo)}.send.show{opacity:1;pointer-events:auto}.send:hover{background:var(--as)}.bub{position:fixed;left:0;top:0;width:20px;height:20px;margin:-20px 0 0 -2px;border-radius:50% 50% 50% 0;background:var(--pu-accent);border:2px solid var(--su);box-shadow:0 1px 4px #0003;pointer-events:auto;opacity:0;transform:translateY(-6px) scale(.9);transform-origin:2px 20px;transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.bub.in{opacity:1;transform:none;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.bub.in:hover,.bub.on{transform:scale(1.18)}.bub.done{background:var(--fa)}.bub.ghost{pointer-events:none}.tip,.pop,.menu,.all,.toast,.selbar{background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh)}.tip{position:fixed;max-width:260px;border-radius:10px;padding:7px 10px;opacity:0;transform:translateY(3px);transition:opacity .22s var(--eo),transform .26s var(--eo)}.tip.show{opacity:1;transform:none;pointer-events:auto;cursor:pointer;transition:opacity .22s var(--eo),transform .26s var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.pop{position:fixed;width:var(--pu-pop);border-radius:12px;padding:10px 12px 8px;pointer-events:none;opacity:0;transform:translateY(6px) scale(.98);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.pop.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.pop.show.glide{transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.mark{position:fixed;border:2px solid color-mix(in srgb,var(--pu-accent) 50%,transparent);background:var(--as);border-radius:8px;opacity:0;transition:opacity .3s var(--eo)}.mark.show{opacity:1}.pulse{position:fixed;border:2px solid var(--pu-accent);border-radius:8px;background:var(--as);animation:pu-pulse var(--pl) var(--eio) forwards}@keyframes pu-pulse{0%{opacity:0;transform:scale(.985)}35%{opacity:.85;transform:scale(1)}to{opacity:0;transform:scale(1.02)}}.col{position:fixed;left:0;top:0;pointer-events:none;transition:opacity var(--in) var(--eo)}.th{position:absolute;left:0;right:0;top:0;padding:4px 4px 4px 12px;pointer-events:auto;cursor:pointer;box-shadow:inset 2px 0 0 transparent;transition:transform var(--mv) var(--eio),box-shadow var(--in) var(--eo),opacity var(--in) var(--eo)}.th.hot{box-shadow:inset 2px 0 0 var(--ln)}.th.on{box-shadow:inset 2px 0 0 var(--pu-accent);cursor:default}.th.dim{opacity:.45}.th.resolved:not(.on):not(.hot){opacity:.6}.th.lost .ctx{white-space:normal}.th.wait{opacity:0!important;pointer-events:none}.th.out{opacity:0!important;pointer-events:none;transition:opacity var(--out) var(--ei)}.th:has(.opn:focus-visible){box-shadow:inset 2px 0 0 var(--ln);outline:2px solid var(--pu-accent);outline-offset:2px;border-radius:4px}.selbar{position:fixed;display:flex;border-radius:10px;padding:2px;opacity:0;transform:translateY(4px);pointer-events:none;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.selbar.show{opacity:1;transform:none;pointer-events:auto}.selbar button{width:32px;height:30px;display:grid;place-items:center;border-radius:8px;color:var(--pu-accent);transition:background-color .2s var(--eo)}.selbar button:hover,.selbar button:focus-visible{background:var(--as);outline:none}.pick{position:fixed;left:0;top:0;border:2px solid color-mix(in srgb,var(--pu-accent) 70%,transparent);background:color-mix(in srgb,var(--pu-accent) 6%,transparent);border-radius:8px;pointer-events:none;opacity:0;transition:opacity var(--out) var(--ei),border-color var(--out) var(--ei),border-width var(--out) var(--ei),box-shadow var(--out) var(--ei)}.pick.show{opacity:1;transition-duration:var(--in);transition-timing-function:var(--eo)}.pick.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.pick.on{border-color:var(--pu-accent)}.pick.kf{border:3px solid var(--pu-accent);box-shadow:0 0 0 2px var(--su)}.km{position:fixed;left:0;top:0;pointer-events:none;outline:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.namebar{position:fixed;left:0;top:0;display:flex;align-items:center;gap:2px;padding:2px 2px 2px 10px;border-radius:10px;font-size:12px;color:var(--mu);white-space:nowrap;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(4px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.namebar.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.namebar.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.namebar .lbl{margin-right:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis}.namebar .nb{padding:4px;display:grid;place-items:center;border-radius:7px;transition:background-color .2s var(--eo),color .2s var(--eo)}.namebar .nb:hover,.namebar .nb:focus-visible{background:var(--ho);color:var(--k);outline:none}.namebar .nb[hidden]{display:none}.launch{position:fixed;right:20px;bottom:20px;pointer-events:auto}.launch .mode{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);transition:background-color .3s var(--eo),color .3s var(--eo)}.mode>*,.cnt>*{grid-area:1/1}.mode>*{display:grid;place-items:center;transition:opacity var(--in) var(--eo)}.cnt,.has>.plus{opacity:0}.has>.cnt{opacity:1}.n{font-size:12px;font-weight:500;line-height:1;margin:-1.4px 0 0 1.4px;font-variant-numeric:tabular-nums;opacity:0;transition:opacity var(--in) var(--eo)}.n.s{font-size:9.5px;letter-spacing:-.04em}.n.on{opacity:1}.launch .mode:hover,.launch .mode[aria-expanded=true]{background:var(--ho)}.launch .mode.on{background:var(--pu-accent);color:#fff}.mode>.dot{position:absolute;top:3px;right:3px;width:9px;height:9px;border-radius:50%;background:var(--pu-accent);border:2px solid var(--su);opacity:0}.mode.else>.dot{opacity:1}.ttip{position:absolute;right:0;bottom:54px;white-space:nowrap;border-radius:8px;padding:4px 9px;font-size:12px;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.ttip small{margin-left:8px}.ttip small,.mi .kc{font-size:12px;color:var(--fa)}.mode:hover+.ttip,.mode:focus-visible+.ttip{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}.launch .mode[aria-expanded=true]+.ttip{opacity:0;transition:opacity var(--out) var(--ei)}@media(hover:none){.ttip,.tt{display:none}}.menu{position:fixed;right:20px;bottom:76px;width:290px;border-radius:12px;padding:4px;pointer-events:none;opacity:0;transform:translateY(6px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.menu.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.mi{position:relative;display:flex;gap:10px;align-items:center;width:100%;min-height:34px;text-align:left;padding:6px 10px;border-radius:8px;transition:background-color .2s var(--eo)}.mi:hover,.mi:focus-visible{background:var(--so);outline:none}.mi svg{color:var(--mu);flex:none}.mi small{display:block;color:var(--fa);font-size:12px}.lb{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ma{flex:none;display:grid;margin:-2px 0}.ma .av{width:20px;height:20px;font-size:11px}.mi .av svg{color:inherit}.sep{height:1px;margin:4px 10px;background:var(--ru)}.tt{position:absolute;right:calc(100% + 14px);top:50%;translate:0 -50%;width:max-content;max-width:220px;padding:4px 9px;border-radius:8px;font-size:12px;line-height:1.4;color:var(--mu);background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translate(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.mi:hover>.tt,.mi:focus-visible>.tt{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}@media(max-width:600px){.tt{right:8px;top:auto;bottom:100%;translate:none;transform:translateY(3px)}}.sw{position:relative;flex:none;width:26px;height:16px;border-radius:8px;background:var(--ln);transition:background-color var(--mv) var(--eio)}.sw:before,.sw:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000040;transition:transform var(--mv) var(--eio),opacity var(--mv) var(--eio)}.sw:before{opacity:0;transform:translate(10px)}[aria-checked=true]>.sw{background:var(--pu-accent)}[aria-checked=true]>.sw:after{transform:translate(10px)}.all{position:fixed;top:0;right:0;bottom:0;width:var(--pu-panel);display:flex;flex-direction:column;border-width:0 0 0 1px;opacity:0;transform:translate(100%);transition:transform var(--out) var(--ei),opacity var(--out) var(--ei)}.all.show{opacity:1;transform:none;pointer-events:auto;transition:transform var(--mv) var(--eo),opacity var(--in) var(--eo)}.all.full{width:100%}.hd{display:flex;align-items:center;gap:8px;padding:12px 10px 8px 16px;font-weight:600}.pn{font-weight:400;color:var(--fa)}.hs{margin-left:auto;display:flex;align-items:center;gap:6px;padding:3px 4px 3px 6px;border-radius:6px;font-size:12px;font-weight:400;color:var(--mu);transition:background-color .2s var(--eo)}.hs:hover,.hs:focus-visible{background:var(--ho);outline:none}.list{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px}.all .mi{align-items:flex-start}.all .mi>.av{flex:none}.all .mi>span:last-child{flex:1;min-width:0}.all .mi small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.all .mi .av svg{margin:0}.all .mi.done{opacity:.6}.layer.listing .col{opacity:0;transition:opacity var(--out) var(--ei)}.sec{padding:8px 10px 2px;font-size:12px;color:var(--fa)}.sec b{margin-left:6px;font-weight:500;color:var(--pu-accent)}.toast{position:fixed;left:50%;bottom:28px;border-radius:10px;padding:8px 14px;font-size:13px;opacity:0;transform:translate(-50%,6px);transition:opacity .3s var(--eo),transform .36s var(--eo)}.toast.show{opacity:1;transform:translate(-50%)}@media(forced-colors:active){.pick.kf{border:3px solid Highlight}.layer :is(.ib,.mi,.nb,.hs,.selbar button,.say button):focus-visible{outline:2px solid Highlight}}@media(prefers-reduced-motion:reduce){.bub,.bub.in,.bub.in:hover,.bub.on,.tip,.pop,.selbar,.menu,.all,.ttip,.tt,.toast{transform:none!important}.sw:after{transform:none!important;transition-property:opacity}[aria-checked=true]>.sw:after{opacity:0}[aria-checked=true]>.sw:before{opacity:1}.th{transition-property:opacity,box-shadow}.tip.show{transition-property:opacity}.pick,.pick.show{transition:opacity .16s ease-in-out}.all,.all.show{transition-property:opacity}.namebar,.namebar.show{transform:none!important;transition:opacity .16s ease-in-out}.av,.nf{transform:none!important}@keyframes pu-pulse{0%{opacity:0}35%{opacity:.85}to{opacity:0}}}';var Do="#534AB7",oi="rgb(0, 0, 238)";function Fo(e){let t=/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)/.exec(e);if(!t||t[1]===void 0||t[2]===void 0||t[3]===void 0)return null;let o=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3]),a:o}}function ri(e){let t=o=>{let n=o/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Vo(e){let t=e.ownerDocument,o=t.defaultView;if(!o)return{font:"system-ui, sans-serif",accent:Do,dark:!1};let n=t.documentElement,r=o.getComputedStyle(e).fontFamily||"system-ui, sans-serif",s=(o.getComputedStyle(n).getPropertyValue("--pipeup-accent")||n.style.getPropertyValue("--pipeup-accent")).trim(),l=e.querySelector("a[href]"),a=l?o.getComputedStyle(l).color:"",f=s||(a&&a!==oi?a:Do),d=Fo(o.getComputedStyle(t.body).backgroundColor);(!d||d.a===0)&&(d=Fo(o.getComputedStyle(n).backgroundColor));let h=d&&d.a>0?ri(d)<.2:o.matchMedia?.("(prefers-color-scheme: dark)").matches===!0&&/dark/.test(o.getComputedStyle(n).colorScheme||"");return{font:r,accent:f,dark:!!h}}function qo(e,t){e.style.setProperty("--pu-font",t.font),e.style.setProperty("--pu-accent",t.accent),e.classList.toggle("dark",t.dark)}function _o(e,t=document){let o=t.createElement("pipeup-root");o.setAttribute("data-pipeup-ignore",""),o.style.cssText="position:fixed!important;inset:0!important;pointer-events:none!important;z-index:2147483000!important;display:block!important;margin:0!important;visibility:visible!important;opacity:1!important;transform:none!important;filter:none!important;";let n=o.attachShadow({mode:"open"}),r=t.defaultView?.CSSStyleSheet;if(r&&"replaceSync"in r.prototype&&"adoptedStyleSheets"in n){let l=new r;l.replaceSync(In),n.adoptedStyleSheets=[l]}else{let l=t.createElement("style");l.textContent=In,n.append(l)}let s=t.createElement("div");return s.className="layer",s.style.setProperty("--pu-panel",`${vt}px`),s.style.setProperty("--pu-pop",`${Ze}px`),qo(s,e),n.append(s),t.documentElement.append(o),{element:o,shadow:n,n:s,destroy:()=>o.remove()}}var ii=40,si=250,ai=120,li=2400,ci=4e3,di=1e4;function Ko(e,t=!1){return An(e,t)?"column":"bubbles"}function ui(e){return[...e.state.mode==="column"?[To(e),bn(e,{q:!1})]:[bn(e,{q:!0})],Lo(e),Mo(e)]}var pi=1e3,Xt="Shown here, but not saved yet \u2014 it will be saved with your next change",tt=e=>e instanceof Error?e.message.replace(/^pipeup: /,""):"Something went wrong";function Uo(e){let t=Vo(e.root),o=_o(t),n=Bo(document,t.dark);n.j(0);let r=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,s=document.documentElement.hasAttribute("data-pipeup-reserve"),l=new Map,a=new Set,f=new WeakSet,d={o:null,E:null,k:!1,hidden:!0,mode:Ko(e.root),t:null,s:!1,l:!1,L:!1,c:!1},h=v("div",{class:"toast",role:"status","aria-live":"polite"}),T=v("div",{class:"sr","aria-live":"polite"});o.n.append(h,T);let M=null,p=[],g=null,y=!1,x=0,C=0,A=0,E=0,P=0,k=new Set,q="",W=new Map,F=Io(e.root,()=>{!y&&$()&&G()}),Y=!1,j=0;function B(c,L=li,i=!1,u=!1){y||(Y=i,h.textContent=c,u?h.setAttribute("aria-hidden","true"):h.removeAttribute("aria-hidden"),h.classList.add("show"),window.clearTimeout(x),x=window.setTimeout(()=>h.classList.remove("show"),L))}function se(){Y&&(Y=!1,window.clearTimeout(x),h.classList.remove("show"))}function ce(c){T.textContent="",cancelAnimationFrame(j),j=requestAnimationFrame(()=>T.textContent=c)}function ge(c){B(tt(c))}function de(c){throw ge(c),c}let oe=c=>({thread:c,location:un(c.anchor,l.get(c.id)??Ct(c.anchor,e.root),e.root)}),pe=c=>d.o!==c||d.k?!1:(g?.z()?g.W():o.n.querySelector(".launch .mode")?.focus({preventScroll:!0}),!0),Le={reply:async(c,L)=>{try{await e.doc.reply(c,L)}catch(i){i instanceof Se?B(Xt):de(i)}},resolve:async c=>{try{await e.doc.resolve(c),pe(c)&&(d.o=null),B("Resolved \xB7 Show resolved brings it back")}catch(L){L instanceof Se?(pe(c)&&(d.o=null),B(`Resolved \xB7 ${Xt}`)):B(tt(L))}},reopen:async c=>{try{await e.doc.reopen(c),B("Reopened")}catch(L){B(L instanceof Se?`Reopened \xB7 ${Xt}`:tt(L))}},close:()=>{re(null);let c=we&&o.n.querySelector(we);c?c.focus({preventScroll:!0}):g?.W(),we=""},copy:c=>{try{let L=e.doc.threads().find(u=>u.id===c);if(!L)return;let i=hn(oe(L),"ai",location.href,Date.now());Cn(i,o.n).then(()=>B("Thread copied as Markdown for AI"),u=>B(tt(u)))}catch(L){B(tt(L))}}},ve={copyAll:async c=>{let L=ve.all(),i=gn(L,c,{title:document.title,url:location.href,exportedAt:new Date});try{await Cn(i,o.n);let u=L.filter(w=>!w.thread.resolved).length;B(`Copied ${u} thread${u===1?"":"s"}${c==="ai"?" as Markdown for AI":""}`)}catch(u){B(tt(u))}},ve:()=>{d.k=!d.k,G()},rename:async c=>{let L=c.replace(/\s+/g," ").trim();try{await m(L)?B(`New comments will say ${L}, but this browser couldn't remember it`):B(`New comments will say ${L}`)}catch(i){B(tt(i))}},name:()=>e.doc.name,all:()=>[...e.doc.threads()].sort(Ke(b)).map(oe)},b={doc:e.doc,root:e.root,n:o.n,host:o.element,state:d,resolved:l,te:a,D:Le,c:ve,d:F,O:c=>k.has(c.id),ne:()=>{$()&&G()},R:c=>!d.hidden&&(!c.resolved||d.k)&&!k.has(c.id),be:(c,L)=>{for(let i of e.doc.threads()){let u=l.get(i.id);if(i.anchor.quote&&b.R(i)&&u?.range&&fo(c,L,ht(u)))return i}return null},_:(c,L)=>b.S()?b.be(c,L):null,f:c=>c.composedPath().includes(o.element),X:c=>void f.add(c),pe:c=>f.has(c),open:re,we:c=>ye(c),E:ze,Q:ae,ue:Be,S:()=>!M||M.se(),J:c=>{let L=M?.G();c(),L?.()},he:()=>{let c=d.t?.anchor.view,L=M?.G();Promise.resolve(F.p(c)||F.Y(c??{}).then(()=>b.ne())).then(L)},ae:S,le:xe,ye:Ee,F:We,I:c=>{M=c},xe:B,T:ce,fe:se,Z:ge,Ee:I,u:G,U:ke};function O(c){let L=performance.now(),i=e.doc.threads();for(let u of i){if(c&&!c.has(u.id))continue;let w=performance.now()-L<ii,N=Ct(u.anchor,e.root,{fuzzy:w});l.set(u.id,N),!w&&N.state==="orphaned"?a.add(u.id):a.delete(u.id)}for(let u of[...l.keys()])i.some(w=>w.id===u)||l.delete(u);a.size===0?(window.clearTimeout(E),E=0):E===0&&(E=window.setTimeout(()=>{E=0,!y&&(O(new Set(a)),G())},si))}function $(){let c=new Set,L=F.slide()!==null,i=new Set;for(let w of e.doc.threads()){i.add(w.id);let N=l.get(w.id)?.element;(!F.p(w.anchor.view)||!L&&N?.checkVisibility?.({visibilityProperty:!0})===!1)&&c.add(w.id)}k=c;for(let w of W.keys())i.has(w)||W.delete(w);let u=`${F.slide()}|${[...c].join()}`;return u===q?!1:(q=u,!0)}function K(c){let L=[],i=[],u=[];for(let w of c){let N=l.get(w.id);w.resolved&&!d.k||!N?.range||k.has(w.id)||(w.id===d.o||w.id===d.E?i.push(N.range):w.resolved?u.push(N.range):L.push(N.range))}d.t&&F.p(d.t.anchor.view)&&i.push(...d.t.ranges),Ho({quote:L,on:i,done:u})}let X=0,V=0,_=0;function Q(c){if(c===V)return;V=c,cancelAnimationFrame(_);let L=X,i=performance.now(),u=c?260:200,w=N=>{let z=Math.min(1,(N-i)/u);X=L+(c-L)*(c?1-(1-z)**3:z*z),n.j(X),z<1&&(_=requestAnimationFrame(w))};_=requestAnimationFrame(w)}let fe=0,Re=0;function Ue(c){c!==fe&&(fe=c,n.ie(c,r),window.clearTimeout(Re),Re=window.setTimeout(()=>{O(),G()},r?0:400))}function G(){if(y)return;let c=e.doc.threads();if($(),d.o&&k.has(d.o)){let i=o.n.querySelector(`[data-thread="${d.o}"] .rbox textarea`)?.value;i&&W.set(d.o,i),d.o=null}d.hidden=!d.s&&!d.l&&!d.L&&!d.t,d.hidden&&(d.o=null),Q(d.hidden?0:1),o.n.classList.toggle("hidden",d.hidden),o.n.classList.toggle("listing",d.l);let L=d.l&&!Qe();Ue(L?vt:0),n.oe(s?d.mode==="column"&&!d.hidden&&!L?yt:0:null),K(c);for(let i of p)i.u(c);g?.u(c)}let we="",Ae=()=>o.n.getRootNode().activeElement,$e="input,textarea,select,[contenteditable]:not([contenteditable=false])",Ne=()=>{let c=Ae();return c instanceof HTMLTextAreaElement&&c.value!==""||!!document.activeElement?.matches($e)};function ye(c,L=Ne(),i=Ae()){let u=[...o.n.querySelectorAll(`[data-thread="${c}"] .rbox textarea`)].find(N=>!N.closest("[inert]")),w=i?.getAttribute("data-thread");we=w?`.${i.classList[0]}[data-thread="${w}"]`:"",!(L||!u)&&u.focus({preventScroll:!0})}function be(){let c=d.t;return!c||b.S()?!1:(F.p(c.anchor.view)||F.Y(c.anchor.view??{}),!0)}function re(c,L=!1){if(c&&be())return;if(d.o===c&&!d.t)return c?ye(c):void 0;let i=!L&&Ne(),u=Ae();if(c||(d.L=!1),d.o=c,c&&(d.t=null,I(c)),G(),c){let w=W.get(c),N=w&&o.n.querySelector(`[data-thread="${c}"] .rbox textarea`);N&&!N.value&&(N.value=w,N.dispatchEvent(new Event("input",{bubbles:!0}))),W.delete(c),L&&g?.z()?g.W():ye(c,i,u)}}function ze(c){d.E!==c&&(d.E=c,c&&c!==d.o&&I(c),G())}function ae(c){se(),d.l=!1,d.t=c,d.o=null,G()}function Be(c){if(!d.t)return ae(c);Object.assign(d.t,c),G()}function xe(){d.t&&(d.t=null,G())}function Ee(c,L=!1){d.s!==c&&(d.s=c,n.re(c),c?(d.o=null,d.l=!1,g=Eo(b)):(se(),g?.destroy(),g=null,ce("Comment mode off")),G(),g&&(L&&g.ee(),L?g.z()?B(Sn,di,!0,!0):B("Nothing here to comment on"):B(`Click anything to comment, or Tab between blocks \xB7 Option-click (Alt-click) to pin \xB7 ${ft} or Esc to finish`,ci,!0)))}function ke(){d.t&&(F.p(d.t.anchor.view)||b.S())?xe():d.o?re(null):g&&!g.U()&&Ee(!1)}function We(){if(d.t){be()||xe();return}d.o&&re(null)}async function m(c){try{return await e.onName(c),!1}catch(L){if(e.doc.name!==c)throw L;return!0}}async function S(c){let L=d.t;if(L)try{let i=await e.doc.comment(L.anchor,c);d.t=null,O(new Set([i])),re(i,!0)}catch(i){if(i instanceof Se){d.t=null,O(new Set([i.id])),re(i.id,!0),B(Xt);return}de(i)}}function I(c){let L=l.get(c);if(!L||L.state==="orphaned")return;let i=L.range?ht(L):L.element?[L.element.getBoundingClientRect()]:[];for(let u of i.slice(0,6)){let w=v("div",{class:"pulse"});_e(w,u,4),o.n.prepend(w),window.setTimeout(()=>w.remove(),1300)}}function R(){for(let c of p)c.destroy();p=ui(b),G()}let D=()=>{if(!y){for(let c of p)c.M();g?.M(),P=requestAnimationFrame(D)}},H=c=>{let L=c.composedPath()[0];return L instanceof Element&&L.closest($e)!==null},U=c=>{if(c.key==="Escape")return ke();if(co(c)&&!c.isComposing&&!c.defaultPrevented&&!H(c)){if(c.preventDefault(),g?.ge()&&g.ee())return;Ee(!d.s,!0)}},le=c=>{if(b.f(c)||f.has(c))return;let L=window.getSelection();L&&!L.isCollapsed||We()},Me=()=>{let c=Ko(e.root,d.mode==="column");c!==d.mode?(d.mode=c,R()):G()};function Ye(){let c=performance.now();C===0&&(A=c),window.clearTimeout(C);let L=Math.min(ai,Math.max(0,A+pi-c));C=window.setTimeout(()=>{C=0,O(),G()},L)}let kt=new MutationObserver(c=>{c.every(L=>o.element.contains(L.target))||Ye()});window.addEventListener("keydown",U),window.addEventListener("click",le),window.addEventListener("resize",Me),kt.observe(e.root,{subtree:!0,childList:!0,characterData:!0});let st=typeof ResizeObserver>"u"?null:new ResizeObserver(Ye);st?.observe(e.root);let He=e.doc.onChange(()=>{O(),G()});return O(),R(),P=requestAnimationFrame(D),{ctx:b,destroy(){y=!0,cancelAnimationFrame(P),cancelAnimationFrame(_),cancelAnimationFrame(j),F.destroy(),window.clearTimeout(Re),window.clearTimeout(x),window.clearTimeout(C),window.clearTimeout(E),kt.disconnect(),st?.disconnect(),He(),window.removeEventListener("keydown",U),window.removeEventListener("click",le),window.removeEventListener("resize",Me),g?.destroy();for(let c of p)c.destroy();n.remove(),o.destroy()}}}var nt=null,fi=4e3;function mi(e={}){if(nt)return nt;let t=gi(e,()=>t).catch(o=>{throw nt===t&&(nt=null),o});return nt=t,t}function hi(e,t){return new Promise((o,n)=>{let r=setTimeout(()=>n(new Error("timed out")),t);e.then(o,n).finally(()=>clearTimeout(r))})}async function gi(e,t){let o=document.documentElement.getAttribute("data-pipeup-doc"),{id:n,key:r}=o?await nn(o):{id:`page-${Ve(location.origin+location.pathname)}`,key:null},s,l=!1,a;if(e.store)s=e.store,a=await ct(s);else try{let p=dt.open();s=await hi(p,fi).catch(g=>{throw p.then(y=>y.close(),()=>{}),g}),a=await ct(s)}catch{s=new lt,l=!0,a=await ct(s)}let f=e.name?.trim();f&&f!==a.name&&(a={...a,name:f},await s.saveProfile(a));let d=await at.open({doc:n,key:r,store:s,identity:a.identity,name:a.name});Gt(e.slides??null);let h;try{h=Uo({doc:d,root:e.root??document.body,onName:async p=>{d.name=p,a={...a,name:p},await s.saveProfile(a)}})}catch(p){throw Gt(null),p}l&&h.ctx.xe("This browser can't keep comments for this page \u2014 copy the comments (Copy as Markdown) to keep them");let T=()=>void d.flush().catch(p=>globalThis.reportError?.(p)),M=!1;return window.addEventListener("pagehide",T),{document:d,flush:()=>d.flush(),unmount:()=>{M||(M=!0,window.removeEventListener("pagehide",T),h.destroy(),Gt(null),nt===t()&&(nt=null))}}}export{ot as ANIMALS,pn as COLOURS,Xn as DEFAULT_PROFILE_NAME,dt as IndexedDbStore,lt as MemoryStore,at as PipeupDocument,Se as UnsavedChangeError,rs as VERSION,Oe as animalName,gn as copyAll,hn as copyThread,Jt as createIdentity,ln as describeElement,an as describeRange,rt as formatAgo,qe as labelOf,ct as loadOrCreateProfile,un as locate,mi as mount,ue as nameOf,Jo as newDocumentAttribute,Gr as onReveal,nn as parseDocumentAttribute,Ct as resolveAnchor,jr as setViewState};
|
|
9
|
+
`+t)+(e.edited?" (edited)":"")}var rs="0.4.1";function v(e,t={},...o){let n=document.createElement(e);for(let[r,s]of Object.entries(t))s===void 0||s===!1||(r==="class"?n.className=String(s):n.setAttribute(r,s===!0?"":s));for(let r of o)r!=null&&r!==!1&&n.append(r);return n}function ee(e,t){let o=e.getRootNode().activeElement;t&&o instanceof HTMLElement&&e.contains(o)&&o.blur(),e.inert=t}function Rt(e,t,o=null){let n=e.getRootNode().activeElement,r=!1;for(let s=t.length;s--;o=t[s])t[s].nextSibling!==o&&(r=!!e.insertBefore(t[s],o));return r&&n&&t.some(s=>s.contains(n))&&n.focus({preventScroll:!0}),r}function he(e,t){return e.length>t?e.slice(0,t-1)+"\u2026":e}function _e(e,t,o=4){e.style.left=`${t.left-o}px`,e.style.top=`${t.top-o}px`,e.style.width=`${t.width+o*2}px`,e.style.height=`${t.height+o*2}px`}var br=/\bhttps?:\/\/[^\s<>"'`]+/gi,xr=`.,;:!?'"]}`,Er=2048,kr=/[\u202A-\u202E\u2066-\u2069]/;function Tr(e){let t=0,o=0;for(let r of e)r==="("?t++:r===")"&&o++;let n=e.length;for(;n>0;){let r=e[n-1];if(r===")"&&o>t)o--;else if(!xr.includes(r))break;n--}return e.slice(0,n)}function $t(e){let t=[],o=0;for(let n of e.matchAll(br)){if(n[0].length>Er||kr.test(n[0]))continue;let r=Tr(n[0]),s=n.index??0,l;try{let f=new URL(r);if(f.protocol!=="http:"&&f.protocol!=="https:")continue;l=f.href}catch{continue}s>o&&t.push(e.slice(o,s));let a=v("a",{href:l,target:"_blank",rel:"noopener noreferrer"},r);a.addEventListener("click",f=>f.stopPropagation()),t.push(a),o=s+r.length}return o<e.length&&t.push(e.slice(o)),t}var Ie={code:"KeyC",mods:{shift:!0,alt:!0,meta:!1,ctrl:!1},mac:{label:"\u21E7\u2325C",aria:"Shift+Alt+C"},other:{label:"Shift+Alt+C",aria:"Shift+Alt+C"}},lo=typeof navigator<"u"&&/Mac|iP(hone|ad|od)/.test(navigator.platform),ft=(lo?Ie.mac:Ie.other).label,vn=(lo?Ie.mac:Ie.other).aria;function co(e){return e.code===Ie.code&&e.shiftKey===Ie.mods.shift&&e.altKey===Ie.mods.alt&&e.metaKey===Ie.mods.meta&&e.ctrlKey===Ie.mods.ctrl&&!e.repeat&&!e.getModifierState("AltGraph")}var uo="http://www.w3.org/2000/svg",Sr={comment:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z","M12.3 8.2v6.6M9 11.5h6.6"],send:["M21 12L3.5 4.5 6.2 12l-2.7 7.5zM6.2 12H13"],copy:["M10 8h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z","M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"],resolve:["M5 12.5l4.5 4.5L19 7.5"],reopen:["M3 12a9 9 0 1 0 3-6.7","M3 4v5h5"],lines:["M4 7h16M4 12h10M4 17h7"],list:["M3 6.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 12a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 17.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M9 6.5h11M9 12h11M9 17.5h7"],expand:["M14 4h6v6M20 4l-6 6M10 20H4v-6M4 20l6-6M20 14v6h-6M20 20l-6-6M4 10V4h6M4 4l6 6"],pin:["M6 18v-6a6 6 0 1 1 6 6z"],shrink:["M20 10h-6V4M14 10l6-6M4 14h6v6M10 14l-6 6M14 20v-6h6M14 14l6 6M10 4v6H4M10 10L4 4"],bubble:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z"],close:["M6 6l12 12M18 6L6 18"],edit:["M4 20h4L19 9l-4-4L4 16z"]};function te(e,t=15,o){let n=wn(Sr[e],t);return o&&n.setAttribute("stroke-width",String(o)),n}function wn(e,t){let o=document.createElementNS(uo,"svg"),n={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};for(let[r,s]of Object.entries(n))o.setAttribute(r,s);for(let r of e){let s=document.createElementNS(uo,"path");s.setAttribute("d",r),o.append(s)}return o}var Nt=(e,t,o)=>`M${e} ${t}a${o} ${o} 0 1 0 ${2*o} 0a${o} ${o} 0 1 0 -${2*o} 0`,Lr={Otter:"M4 13.2C4 9.2 7.6 6.5 12 6.5s8 2.7 8 6.7-3.6 6.3-8 6.3-8-2.3-8-6.3zM5.6 9.6a1.8 1.8 0 1 1 2.7-2.3M18.4 9.6a1.8 1.8 0 1 0-2.7-2.3M9.2 11.6h.01M14.8 11.6h.01M11 14h2l-1 1zM9.8 15.8l-3.2.4M9.9 17l-2.7 1.1M14.2 15.8l3.2.4M14.1 17l2.7 1.1",Fox:"M3.5 4l5 3.5h7l5-3.5-1.5 8.5L12 20l-7-7.5zM9 12h.01M15 12h.01M12 17h.01",Owl:`M5 4.5l3 2.5h8l3-2.5V14a7 7 0 0 1-14 0z${Nt(7.4,11.5,1.9)}${Nt(12.8,11.5,1.9)}M11.3 14.6l.7 1 .7-1`,Bear:`${Nt(5,13.5,7)}M8.9 7.22A2.8 2.8 0 1 0 5.89 10.09M18.11 10.09A2.8 2.8 0 1 0 15.1 7.22M9.4 12.6h.01M14.6 12.6h.01M10.3 16.4c0-1 .8-1.6 1.7-1.6s1.7.6 1.7 1.6-.8 1.6-1.7 1.6-1.7-.6-1.7-1.6z`,Rabbit:`${Nt(6.5,15.5,5.5)}M9.6 10.5C8.2 6.5 8.4 2.5 9.8 2.5s2.4 3.5 1.6 7.5M14.4 10.5c1.4-4 1.2-8-.2-8s-2.4 3.5-1.6 7.5M10 15h.01M14 15h.01M11.3 17.3l.7.5.7-.5`};function po(e){let t=/[\p{L}\p{N}]/u.exec(e);if(!t)return"";let o=t[0].toUpperCase();return[...o].length===1?o:t[0]}var mt=(e,t)=>po(t)||Oe(e);function Je(e,t){return v("span",{class:`av c${mn(e)}`,"aria-hidden":"true","data-animal":Oe(e)},po(t)||wn([Lr[ot[fn(e)]]],24))}var Ar=320;function Bt(e,t){setTimeout(()=>{e.remove(),t?.()},Ar)}function Ht(e){return requestAnimationFrame(()=>{e.offsetWidth,e.classList.add("in")}),e}function Dt(e){let t=v("textarea",{class:"input",rows:"1","aria-label":e.label}),o=v("button",{class:"send",type:"button","aria-label":"Send",title:"Send",inert:!0},te("send")),n=v("div",{class:"row"},e.before,t,o),r=!1,s=()=>{let a=t.value.trim()!=="";o.classList.toggle("show",a),o.inert=!a,t.style.height="auto",t.style.height=`${Math.max(27,t.scrollHeight)}px`},l=async()=>{let a=t.value.trim();if(!(!a||r)){r=!0;try{await e.$(a),o.matches(":focus")&&t.focus(),t.value="",s()}catch{}finally{r=!1}}};return n.addEventListener("mousedown",a=>{a.target===t||o.contains(a.target)||(a.preventDefault(),t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length))}),t.addEventListener("input",s),t.addEventListener("keydown",a=>{a.stopPropagation(),a.key==="Enter"&&!a.shiftKey&&!a.isComposing?(a.preventDefault(),l()):a.key==="Escape"&&(a.preventDefault(),t.value="",s(),t.blur(),e.N?.())}),o.addEventListener("click",a=>{a.stopPropagation(),l()}),{element:n,input:t,focus:()=>t.focus({preventScroll:!0}),clear:()=>{t.value="",s()}}}function Mr(e){let t=v("button",{class:"me",type:"button",tabindex:"-1","aria-hidden":"true"});t.addEventListener("mousedown",y=>y.preventDefault());let o=Dt({label:"Comment",before:t,$:e.$,N:e.N}),n=v("div",{class:"say"}),r=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"}),s=v("div",{class:"nf"},r),l=v("div",{class:"you"},n,s),a="",f=!1,d=()=>{let y=e.name(),x=y?"change":"add your name";if(t.title=y?"Change your name":"Add your name",!t.lastChild||a!==y){let A=Je(e.me,y),E=t.lastChild;E?(Ht(A),Bt(E)):A.classList.add("in"),t.append(A),a=y}let C=v("button",{type:"button"},x);C.addEventListener("click",T),n.replaceChildren(v("span",{class:"nm"},y||`You're ${Oe(e.me)}`)," \xB7 ",C)},h=y=>{l.classList.toggle("naming",y),ee(n,y),ee(s,!y)};function T(y){y.stopPropagation(),r.value=e.name(),h(!0),r.focus({preventScroll:!0}),r.select()}let M=()=>{h(!1),o.focus()};t.addEventListener("click",T),r.addEventListener("keydown",y=>{if(y.stopPropagation(),y.key==="Escape")y.preventDefault(),M();else if(y.key==="Enter"){y.preventDefault();let x=r.value.trim();if(!x||x===e.name())return M();if(f)return;f=!0,e.rename(x).finally(()=>{f=!1,d(),M()})}}),d(),h(!1);let p=v("div",{class:"ctx"},e.label);return{element:v("div",{class:"draft"},p,o.element,l),G:()=>{let{selectionStart:y,selectionEnd:x}=o.input;return()=>{o.focus(),o.input.setSelectionRange(y,x)}},B:y=>{p.hidden=y},V:y=>{p.textContent=y},focus:()=>o.focus(),se:()=>o.input.value.trim()===""}}function Ft(e,t){let o=Mr({label:t.label,me:e.doc.me,name:()=>e.c.name(),rename:n=>e.c.rename(n),$:n=>e.ae(n),N:()=>e.le()});return e.I(o),o}function Vt(e,t){if(t.state==="orphaned"||!t.element||e.quote)return null;let o=t.element.getBoundingClientRect();if(!o.width&&!o.height)return null;if(e.point)return{x:o.left+e.point.x*o.width,y:o.top+e.point.y*o.height};let n=t.element.ownerDocument.createRange();n.selectNodeContents(t.element);let r=n.getBoundingClientRect();return{x:r.width?Math.min(o.right-8,r.right+6):o.right-8,y:(r.height?r.top:o.top)+8}}function ht(e){return e.range?[...e.range.getClientRects()]:[]}function yn(e,t){let o=ht(t)[0];if(o)return o.top;if(t.state==="orphaned"||!t.element)return null;let n=t.element.getBoundingClientRect();return e.point?n.top+e.point.y*n.height:n.top}function gt(e,t){let o=ht(t).at(-1);if(o)return{x:o.left,y:o.bottom,below:!0};let n=Vt(e,t);return n?{...n,below:!1}:null}function fo(e,t,o){for(let n of o)if(e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom)return!0;return!1}function mo(e,t,o=10){let n=[...e].sort((a,f)=>a.w-f.w),r=new Array(n.length).fill(0),s=n.findIndex(a=>a.id===t),l=a=>n[a];if(s<0)n.forEach((a,f)=>{r[f]=f===0?a.w:Math.max(a.w,(r[f-1]??0)+l(f-1).height+o)});else{r[s]=l(s).w;for(let a=s+1;a<n.length;a++)r[a]=Math.max(l(a).w,(r[a-1]??0)+l(a-1).height+o);for(let a=s-1;a>=0;a--)r[a]=Math.min(l(a).w,(r[a+1]??0)-l(a).height-o)}return new Map(n.map((a,f)=>[a.id,r[f]??0]))}var vt=320,Ze=300,Cr=480,Qe=()=>window.innerWidth<=Cr;function qt(e){let t=window.innerWidth;return{width:e&&!Qe()?t-vt:t,height:window.innerHeight}}function _t(e,t,o,n=12){let r,s;return e.below?(r=Math.min(e.x,o.width-t.width-n),s=e.y+8,s+t.height>o.height-n&&(s=e.y-t.height-40)):(r=e.x+14,r+t.width>o.width-n&&(r=e.x-t.width-28),s=Math.min(e.y-12,o.height-t.height-n)),{left:Math.max(n,r),top:Math.max(n,s)}}function ho(e,t,o,n=12,r=44){let s=e.top-r>=8,l=e.top+e.height+8+(s?0:r),a=e.top-8-(s?r:0)-t.height,f=l+t.height<=o.height-n||a<n,d=f?l:a;return{above:!f,left:Math.max(n,Math.min(e.left,o.width-t.width-n)),top:Math.max(n,d)}}function Kt(e,t,o){let n=e.top-t.height-10;return n<8&&(n=e.top+e.height+10),{left:Math.max(8,Math.min(e.left+e.width/2-t.width/2,o.width-t.width-8)),top:n}}function Ut(e,t){let o=e.resolved.get(t.id);return o?.range?.startContainer??o?.element??null}var Ke=e=>(t,o)=>{let n=Ut(e,t),r=Ut(e,o),s=l=>l.anchor.point??{x:0,y:-1};return n!==r?!r||n&&n.compareDocumentPosition(r)&4?-1:1:s(t).y-s(o).y||s(t).x-s(o).x};var zt=e=>`${e} ${e===1?"reply":"replies"}`;function it(e,t,o){let n={...o},r=e.id,s=v("div",{class:"rbox always"},v("div",{},Dt({label:"Reply",$:x=>t.reply(r,x),N:t.close}).element)),l=v("div",{}),a=v("div",{}),f=null,d=v("div",{},a,v("div",{class:"more"},l)),h=new Map,T=new Map,M=new Map,p=x=>{let C=mt(x.author,x.name),A=h.get(x.id),E=A?.e;if((!E||A.key!==C)&&(E=Ht(Je(x.author,x.name)),A)){let k=A.e;M.set(x.id,k),Bt(k,()=>M.get(x.id)===k&&M.delete(x.id))}E.title=ue(x),T.set(x.id,{key:C,e:E});let P=M.get(x.id);return P?[P,E]:[E]},g=(x,C,A)=>{let E=v("button",{class:"ib",type:"button","aria-label":C,title:C},te(x));return E.addEventListener("click",P=>{P.stopPropagation(),A()}),E};function y(x,C={}){Object.assign(n,C),r=x.id;let A=(n.now??Date.now)(),E=x.root.replies.length,P=j=>v("span",{class:"who"},`${ue(j)} \xB7 ${rt(j.at,A)}`),k=j=>v("div",{class:j.deleted?"tx del":"tx"},...j.deleted?["Deleted"]:[...$t(j.text),j.edited?" (edited)":""]),q=x.resolved?"Resolved"+(E?` \xB7 ${zt(E)}`:""):E?zt(E):"",W=v("div",{class:n.H==="column"&&q?"ft has-rest":"ft"},n.H==="column"&&q?v("span",{class:"rest"},q):null,v("span",{class:"hover"},P(x.root),v("span",{class:"acts"},g("copy","Copy thread",()=>t.copy(x.id)),x.resolved?g("reopen","Reopen",()=>void t.reopen(x.id)):g("resolve","Resolve",()=>void t.resolve(x.id))))),F=n.lost?v("div",{class:"ctx"},`${n.place||"No longer on the page"} \u2014 it read \u201C${he(n.lost,120)}\u201D`):n.quote?v("div",{class:"ctx"},`\u201C${he(n.quote,80)}\u201D`):null;T=new Map;let Y=v("div",{class:"root"},...p(x.root),F,k(x.root),W);a.replaceWith(Y),a=Y,f?.remove(),f=E?v("div",{class:"rps"},...x.root.replies.map(j=>v("div",{class:"it"},...p(j),k(j),v("div",{class:"rft"},P(j))))):null,f&&l.prepend(f),h=T,x.resolved?s.remove():s.parentNode!==l&&l.append(s),d.className=x.resolved?"thread resolved":"thread",d.setAttribute("data-thread",x.id)}return y(e),{element:d,update:y}}var Pr="a,button,input,select,textarea,label,summary,[role=button],[contenteditable]",Or=400;function bn(e,t){let o=new Map,n=v("div",{class:"tip",role:"tooltip"}),r=v("div",{class:"mark"}),s=v("div",{class:"pop",role:"dialog","aria-label":"Comment thread"});n.inert=s.inert=!0,e.n.append(r,n,s);let l=v("div",{class:"bub pin ghost","aria-hidden":"true"}),a=[],f=null,d=null,h=null,T=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,M=0,p=null,g=null,y=null,x=0,C=b=>a.find(O=>O.id===b)??null,A=()=>t.q||e.state.l,E=!1,P=b=>{let O=e.resolved.get(b.id);return O?gt(b.anchor,O):null};function k(b,O,$){let{left:K,top:X}=_t(O,{width:b.offsetWidth||$,height:b.offsetHeight},qt(e.state.l));b.style.left=`${K}px`,b.style.top=`${X}px`}function q(b){let O=b&&A()&&e.state.o!==b?C(b):null,$=O?P(O):null;if(!O||!$){y=null,n.classList.remove("show"),ee(n,!0);return}if(y!==O.id){let K=O.root.replies.length;n.replaceChildren(v("div",{class:"tx clamp"},...O.root.deleted?["Deleted"]:$t(O.root.text)),v("div",{class:"who"},`${ue(O.root)}${K?` \xB7 ${K} ${K===1?"reply":"replies"}`:""}`)),y=O.id}k(n,$,260),n.classList.contains("show")||n.offsetWidth,n.classList.add("show"),n.inert=!1}function W(b){p=b,q(b),e.E(b)}function F(b){if(window.clearTimeout(x),b!==null){W(b);return}x=window.setTimeout(()=>W(null),A()?Or:0)}n.addEventListener("mouseenter",()=>window.clearTimeout(x)),n.addEventListener("mouseleave",()=>F(null)),n.addEventListener("click",b=>{b.stopPropagation();let O=y;O&&(window.clearTimeout(x),W(null),e.open(O))});function Y(b){let O=o.get(b.id);if(O)return O;let $=v("button",{class:"bub",type:"button","data-thread":b.id});return $.addEventListener("mouseenter",()=>F(b.id)),$.addEventListener("mouseleave",()=>F(null)),$.addEventListener("click",K=>{K.stopPropagation(),q(null),e.open(b.id)}),e.n.insertBefore($,r),o.set(b.id,$),$}let j=!1;function B(){let b=e.state.t,O=h&&b&&!b.anchor.quote&&!b.anchor.point?b.resolved.element:null;if(O){let{left:K,top:X,above:V}=ho(O.getBoundingClientRect(),{width:s.offsetWidth||Ze,height:s.offsetHeight},{width:window.innerWidth,height:window.innerHeight}),_=h?.above!==null&&h?.above!==V;if(h&&(h.above=V),_&&ce())return;s.style.left=`${K}px`,s.style.top=`${X}px`;return}let $=h&&b?gt(b.anchor,b.resolved):f?P(f):null;$&&k(s,$,Ze)}let se=b=>e.state.s&&!b.anchor.quote&&!b.anchor.point;function ce(){return window.clearTimeout(M),T?(s.classList.remove("show"),M=window.setTimeout(()=>{B(),s.classList.add("show")},220),!0):(s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450),!1)}function ge(b){if(window.clearTimeout(M),T){s.classList.remove("show"),M=window.setTimeout(()=>{h?.i.V(b),B(),s.classList.add("show")},220);return}h?.i.V(b),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)}function de(){if(!A())return null;let b=e.state.t;return b?b.anchor.quote||b.anchor.point||e.state.s?null:b.resolved.element:!f||f.anchor.quote||f.anchor.point?null:e.resolved.get(f.id)?.element??null}function oe(b){a=b;let O=new Set;for(let V of b){if(!e.R(V)||V.anchor.quote)continue;let _=e.resolved.get(V.id);if(!_||_.state==="orphaned")continue;O.add(V.id);let Q=Y(V);Q.classList.toggle("done",V.resolved),Q.classList.toggle("on",e.state.o===V.id),Q.classList.toggle("pin",V.anchor.point!==void 0);let fe=`Comment on ${qe(_.element)}: ${he(V.root.text,60)}`;Q.getAttribute("aria-label")!==fe&&Q.setAttribute("aria-label",fe)}Rt(e.n,b.filter(V=>O.has(V.id)).sort(Ke(e)).map(V=>o.get(V.id)),r);for(let[V,_]of o)O.has(V)||(_.classList.remove("in"),o.delete(V),window.setTimeout(()=>_.remove(),300));q(p),E!==e.state.l&&s.classList.contains("show")&&!T&&(window.clearTimeout(M),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)),E=e.state.l;let $=t.q?e.state.t:null;if($){let V=$.anchor.point??$.resolved.element;h?.of!==$?(window.clearTimeout(M),s.classList.remove("glide"),h={i:Ft(e,$),of:$,at:V,above:null},h.i.B(se($)),s.replaceChildren(h.i.element),s.inert=!1,h.i.focus(),f=null,d=null,B(),s.classList.add("show")):h&&(h.at!==V&&(h.at=V,h.above=null,ge($.label)),h.i.B(se($)));let _=!e.d.p($.anchor.view);_!==j&&(j=_,s.classList.toggle("show",!_),s.inert=_,_||B());return}h&&(window.clearTimeout(M),s.classList.remove("glide"),h=null,j=!1,e.I(null));let K=A()&&e.state.o?C(e.state.o):null;if(!K||!e.R(K)){f=null,d=null,s.classList.remove("show"),ee(s,!0);return}let X=K.anchor.quote?.exact??null;!f||!d||f.id!==K.id?(d=it(K,e.D,{H:"popover",quote:X}),s.replaceChildren(d.element),f=K,B(),s.classList.add("show"),s.inert=!1):f!==K&&(d.update(K,{quote:X}),f=K)}function pe(){for(let[K,X]of o){let V=C(K),_=e.resolved.get(K),Q=V&&_?Vt(V.anchor,_):null;if(!Q||Q.y<-40||Q.y>window.innerHeight+40){X.style.visibility="hidden";continue}X.style.visibility="",X.style.left=`${Q.x}px`,X.style.top=`${Q.y}px`,X.classList.contains("in")||(X.offsetWidth,X.classList.add("in"))}let b=e.state.t,O=b?.anchor.point&&e.d.p(b.anchor.view)?Vt(b.anchor,b.resolved):null;O?(l.style.left=`${O.x}px`,l.style.top=`${O.y}px`,l.classList.contains("in")||(e.n.insertBefore(l,r),l.offsetWidth,l.classList.add("in"))):l.classList.contains("in")&&(l.classList.remove("in"),window.setTimeout(()=>l.classList.contains("in")||l.remove(),300)),s.classList.contains("show")&&B();let $=de();r.classList.toggle("show",$!==null),$&&_e(r,$.getBoundingClientRect(),4)}let Le=b=>{if(e.f(b)){let $=b.composedPath()[0];g!==null&&!($ instanceof Element&&$.closest(".tip,.bub"))&&F(null),g=null;return}let O=e._(b.clientX,b.clientY)?.id??null;O!==g&&(g=O,F(O))},ve=b=>{if(e.f(b))return;let O=window.getSelection();if(O&&!O.isCollapsed||(e.state.s?b.altKey:b.target instanceof Element&&b.target.closest(Pr)))return;let $=e._(b.clientX,b.clientY);$&&(e.X(b),q(null),e.open($.id))};return window.addEventListener("pointermove",Le,{capture:!0,passive:!0}),window.addEventListener("click",ve,!0),{u:oe,M:pe,destroy(){window.clearTimeout(x),window.clearTimeout(M),window.removeEventListener("pointermove",Le,!0),window.removeEventListener("click",ve,!0),e.I(null);for(let b of o.values())b.remove();l.remove(),n.remove(),r.remove(),s.remove()}}}var Ir={display:"block",position:"static",clips:!1,off:!1},Rr=48,$r="button link img figure region list listitem tab tabpanel article navigation complementary banner contentinfo form search group dialog menu menuitem checkbox switch radio slider textbox combobox option row cell heading table".split(" ").map(e=>`[role=${e}]`),Nr=["button,a,input,select,textarea,label,summary,details,img,svg,canvas,video,picture,figure,figcaption,table,th,td","li,ul,ol,dl,dt,dd,p,h1,h2,h3,h4,h5,h6,blockquote,pre","section,article,aside,nav,header,footer,main,form,fieldset",...$r].join(","),xn="a,button,label,summary,[role=button],[role=link],[role=tab],[role=option],[role=menuitem]",Br=`${xn},input,select,textarea,img,svg,canvas,video,picture,[role=img]`,go=24,Hr=.6,Wt=2,En=(e,t)=>Math.abs(e.left-t.left)<=Wt&&Math.abs(e.top-t.top)<=Wt&&Math.abs(e.width-t.width)<=Wt&&Math.abs(e.height-t.height)<=Wt;function vo(e,t){let o=t.i(e);if(o.width<2||o.height<2)return!1;if(e.hasAttribute("data-pipeup-id"))return!0;let n=t.K();return o.width*o.height<=Hr*n.width*n.height&&(e.matches(Nr)||t.ce(e)||e.childElementCount>1&&!e.parentElement?.closest(xn)&&t.de(e))}function wt(e,t,o){if(e===t||!t.contains(e)||e.closest("[data-pipeup-ignore]"))return null;let n=null;for(let s=e;s&&s!==t&&!n;s=s.parentElement)vo(s,o)&&(n=s);if(!n||n.hasAttribute("data-pipeup-id"))return n;let r=o.i(n);for(let s=n.parentElement;s&&s!==t&&En(o.i(s),r);s=s.parentElement)if(s.hasAttribute("data-pipeup-id"))return s;return n}function kn(e,t,o){let n=o.i(e);for(let r=e.parentElement;r&&r!==t;){let s=wt(r,t,o);if(!s)return null;if(!En(o.i(s),n))return s;r=s.parentElement}return null}function wo(e=window){return{i:t=>t.getBoundingClientRect(),ce:t=>{let o=e.getComputedStyle(t),n=o.backgroundColor!=="transparent"&&!/,\s*0\)$/.test(o.backgroundColor),r=["top","right","bottom","left"].some(s=>parseFloat(o.getPropertyValue(`border-${s}-width`))>0);return n||r||o.backgroundImage!=="none"||o.boxShadow!=="none"},de:t=>/^(inline-)?(flex|grid)$/.test(e.getComputedStyle(t).display),flow:t=>{let o=e.getComputedStyle(t),n=[o.overflowX,o.overflowY];return{display:o.display,position:o.position,clips:n.some(r=>r==="hidden"||r==="clip")&&!n.some(r=>r==="auto"||r==="scroll")&&t!==e.document.documentElement&&t!==e.document.body,off:o.pointerEvents==="none"}},K:()=>({width:e.innerWidth,height:e.innerHeight})}}var Dr=(e,t)=>e.left<t.left+t.width&&t.left<e.left+e.width&&e.top<t.top+t.height&&t.top<e.top+e.height,Fr=(e,t)=>{let o=Math.max(e.left,t.left),n=Math.max(e.top,t.top);return{left:o,top:n,width:Math.max(0,Math.min(e.left+e.width,t.left+t.width)-o),height:Math.max(0,Math.min(e.top+e.height,t.top+t.height)-n)}};function Tn(e,t,o=()=>!0){let n=[],r=(s,l,a,f,d,h)=>{for(let T of s.children){if(T.hasAttribute("data-pipeup-ignore")||T.getAttribute("aria-hidden")==="true"||!o(T))continue;let M=t.flow?.(T)??Ir,p=T.offsetParent,g=M.position==="fixed"||M.position==="absolute"&&!!f&&!(p&&f.contains(p)),y=g?null:a,x=t.i(T),C=x.width>0&&x.height>0;if(y&&C&&!Dr(x,y))continue;let A=T.matches(xn),P=(M.display.startsWith("inline")||h)&&!T.matches(Br)&&(M.display==="inline"||x.height<=Rr),k=x.width<=go&&x.height<=go,q=T.hasAttribute("data-pipeup-id")||!d&&!M.off&&!P&&!(k&&!A),W=l;q&&vo(T,t)&&(l&&En(t.i(l.e),x)?(T.hasAttribute("data-pipeup-id")||!l.e.hasAttribute("data-pipeup-id"))&&(l.e=T):n.push(W={e:T,C:l,m:0}));let F=M.clips&&C;r(T,W,F?y?Fr(y,x):x:y,F?T:g?null:f,d||A,/^inline-(flex|grid)$/.test(M.display)||h&&/(flex|grid)$/.test(M.display))}};r(e,null,null,null,!1,!1);for(let s=n.length-1;s>=0;s--){let l=n[s];l.C&&(l.C.m=Math.max(l.C.m,l.m+1))}return n}var et=(e,t)=>e.filter(o=>o.m<=t&&(!o.C||o.C.m>t)),yo=(e,t)=>e.filter(o=>o.C===t);var Yt="a,button,summary,[role=button],[role=link],[role=switch],[role=tab],[role=checkbox],input[type=checkbox],input[type=radio],input[type=submit],input[type=button],input[type=reset]",Vr=`${Yt},input,select,textarea,[contenteditable]:not([contenteditable=false]),[tabindex]:not([tabindex="-1"])`,bo=["click","dblclick","auxclick","submit","contextmenu","dragstart"],xo=[...["over","out","enter","leave","down","up"].flatMap(e=>[`pointer${e}`,`mouse${e}`]),"mousemove","touchstart","touchmove","touchend","touchcancel"],qr=400,Sn="Tab moves between blocks \xB7 \u2191 \u2193 change level \xB7 Enter comments \xB7 Esc to finish \xB7 F7 selects text",_r=4,Kr=150;function Eo(e,t=wo()){let o=v("span",{hidden:!0},Sn),n=v("div",{class:"pick"},o),r=[0,1].map(()=>{let i=v("div",{class:"km",tabindex:"-1",role:"button"},v("span",{hidden:!0}),v("span",{hidden:!0}));return i.inert=!0,i.addEventListener("keydown",kt),i.addEventListener("click",u=>{u.stopPropagation(),Ye()}),i.addEventListener("focus",()=>n.classList.add("kf")),i.addEventListener("blur",()=>n.classList.remove("kf")),i}),s=v("span",{class:"lbl"}),l=(i,u,w,N)=>{let z=v("button",{class:"nb",type:"button","aria-label":i,title:u},te(w,16));return z.addEventListener("click",J=>{J.stopPropagation(),N()}),z},a=l("Around it","Select the block around it","expand",le),f=l("Inside it","Select a block inside it","shrink",Me),d=l("Pin","Pin its centre","pin",()=>e.J(()=>_(g??k,{x:.5,y:.5}))),h=v("div",{class:"namebar",role:"group","aria-label":"Chosen block"},s,a,f,d);h.inert=!0;let T=e.n.querySelector(".launch");for(let i of[n,...r,h])e.n.insertBefore(i,T);h.addEventListener("mousedown",i=>i.preventDefault());let M=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,p=null,g=null,y=null,x=null,C=0,A=()=>{},E=null,P=()=>{},k=null,q=0,W=0,F=!1,Y=null,j=null,B=null,se=0,ce=-1,ge=!0,de=null,oe=null,pe=i=>!e.f(i)&&!(i.target instanceof Element&&i.target.closest("[data-pipeup-ignore]"));function Le(){x&&(n.classList.toggle("glide",performance.now()<C),_e(n,x.getBoundingClientRect(),4))}function ve(){if(!E)return;h.classList.toggle("glide",performance.now()<C&&h.classList.contains("show"));let i=E.getBoundingClientRect(),{left:u,top:w}=Kt({left:i.left,top:i.top,width:i.width,height:i.height},{width:h.offsetWidth||200,height:h.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});h.style.left=`${u}px`,h.style.top=`${w}px`}function b(i,u){x=i,C=u?performance.now()+qr:0,Le(),n.classList.add("show")}function O(i,u){let w=getComputedStyle(i);if(w.opacity==="0")return u(),()=>{};let N=0,z=()=>{window.clearTimeout(N),i.removeEventListener("transitionend",Te)},J=()=>{z(),u()},Te=ne=>{ne.target===i&&ne.propertyName==="opacity"&&J()},je=Math.max(...w.transitionDuration.split(",").map(ne=>parseFloat(ne)*1e3||0));return N=window.setTimeout(J,je+100),i.addEventListener("transitionend",Te),z}function $(i){if(i!==p){if(p=i,A(),!i){n.classList.remove("show");return}getComputedStyle(n).opacity==="0"?b(i,!1):M?(n.classList.remove("show"),A=O(n,()=>b(i,!1))):b(i,!0)}}function K(i){g=i,n.classList.toggle("on",i!==null),$(i),X(i)}function X(i){P(),h.inert=!i,i?M?(h.classList.remove("show"),P=O(h,()=>V(i))):V(i):(h.classList.remove("show"),E=null)}function V(i){s.textContent=s.title=qe(i),a.hidden=kn(i,e.root,t)===null,f.hidden=(k?D(i).length:Tn(i,t,ze).length)===0;let u=h.classList.contains("show");E=i,ve(),u||(h.offsetWidth,h.classList.add("show"))}function _(i,u){let w;try{w=ln(i,e.root,u,e.d.view(i))}catch(J){e.Z(J);return}let N={anchor:w,label:u?`Pin on ${qe(i).replace(/^[A-Z](?=[a-z])/,J=>J.toLowerCase())}`:qe(i),ranges:[],resolved:{state:"attached",element:i,range:null}},z=e.state.t;k&&(k=i,ce=-1),K(u?null:i),y=z??{...N,ranges:[]},z?e.ue({...N,ranges:[]}):e.Q(y),e.T(u?N.label:`Commenting on ${N.label}`)}function Q(i){e.J(()=>_(i))}function fe(i){let u=(i.target instanceof Element?wt(i.target,e.root,t):null)??e.root;u!==e.root&&(Y=u);let w=u.getBoundingClientRect();w.width&&w.height&&_(u,{x:(i.clientX-w.left)/w.width,y:(i.clientY-w.top)/w.height})}function Re(i){let u=window.getSelection();if(u&&!u.isCollapsed)return;if(e.state.t&&(i.altKey||!e.S())){e.F();return}if(!i.altKey&&e._(i.clientX,i.clientY))return;if(e.state.o&&e.open(null),k&&i.detail&&I(),i.altKey){fe(i);return}let w=i.target instanceof Element?wt(i.target,e.root,t):null;w&&(Y=w),w?_(w):(e.F(),K(null))}let Ue=i=>{if(e.f(i))return;if(!pe(i)){g||$(null);return}if(i.stopPropagation(),g||e.state.t)return;let u=!G()&&i.target instanceof Element?wt(i.target,e.root,t):null;if(k){if(!u||u===k||(se+=Math.abs(i.movementX)+Math.abs(i.movementY),se<=_r))return;I()}u&&(Y=u),$(u)},G=()=>{let i=window.getSelection();return!!i&&!i.isCollapsed&&i.toString().trim()!==""},we=()=>{G()&&(k&&I(),g||$(null))},Ae=i=>{pe(i)&&(i.stopPropagation(),(i.type==="pointerdown"||i.type==="mousedown")&&i.target instanceof Element&&i.target.closest(Vr)&&i.preventDefault())},$e=i=>{if(!pe(i))return;let u=i.target;if((u===oe||u.form&&u.form===oe?.form)&&(i.type==="submit"||i.type==="click"&&!i.detail)){oe=i.type==="click"&&u.type==="submit"?u.form:null;return}i.preventDefault(),i.stopPropagation(),i.type==="click"&&!e.state.c&&!e.pe(i)&&Re(i)},Ne=i=>{if(oe=null,He="",i.key==="Tab"&&ye(i))return i.preventDefault(),i.stopPropagation(),He=i.key,e.state.o&&e.open(null),e.state.c&&(e.state.c=!1,e.u()),U(i.shiftKey?-1:1);if(!(!pe(i)||!(i.target instanceof Element)))if((i.key==="Enter"||i.key===" ")&&i.target.closest(Yt)){if(!k){oe=i.target;return}i.preventDefault(),i.stopPropagation()}else i.key==="Enter"&&!k&&i.target.form&&(oe=i.target)},ye=i=>{if(i.ctrlKey||i.metaKey||i.altKey||i.isComposing)return!1;let u=i.composedPath()[0];return!(u instanceof Element)||r.some(w=>w===u)?!1:e.f(i)?!!u.closest(".launch,.menu")&&!u.closest("input,textarea,select,[contenteditable]"):!i.composedPath().some(w=>w instanceof Element&&w.hasAttribute("data-pipeup-ignore"))},be=()=>e.n.getRootNode().activeElement,re=()=>r.some(i=>i===be()),ze=i=>(i.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1||getComputedStyle(i).display==="contents")&&e.d.p(e.d.view(i)),ae=()=>(de?.some(i=>!i.e.isConnected)&&(de=null),de??=Tn(e.root,t,ze)),Be=i=>ae().find(u=>u.e===i),xe=(i,u=!1)=>{let w=i.getBoundingClientRect();return w.bottom>0&&w.top<window.innerHeight&&(!u||w.top>=0)},Ee=()=>{let i=et(ae(),0);return i.find(u=>xe(u.e,!0))??i.find(u=>xe(u.e))??i[0]},ke=i=>e.doc.threads().filter(u=>e.R(u)&&i.contains(Ut(e,u))).sort(Ke(e));function We(i,u){let[w,N]=i.children,z=et(ae(),q),J=ke(u).length;w.textContent=`${Pt(u)}, ${z.findIndex(ne=>ne.e===u)+1} of ${z.length}${J?`, has ${J} comment${J===1?"":"s"}`:""}`;let Te=(u.innerText??u.textContent??"").length<=Kr;N.textContent=dn(u);let je=ge?[o]:[];ge=!1,i.ariaLabelledByElements!==void 0?(i.ariaLabelledByElements=Te?[w,u]:[w,N],i.ariaDescribedByElements=Te?je:[...je,u]):i.setAttribute("aria-label",`${w.textContent}, ${N.textContent}`)}function m(i,u=!0){se=0;let w=ae(),N=w.find(J=>J.e===i);if(N&&!et(w,q).includes(N)&&(q=N.m),i!==k&&(ce=-1),i!==g&&(g=null),k=i,$(i),X(i),i.scrollIntoView({block:"nearest",inline:"nearest",behavior:M?"auto":"smooth"}),!u)return;e.fe();let z=r[W^=1];We(z,i),_e(z,i.getBoundingClientRect(),4),z.inert=!1,z.focus({preventScroll:!0}),r[W^1].inert=!0}function S(){de=null;let i=document.activeElement;j=be()??i;let u=Be(Y),w=u??(i&&i!==document.body&&e.root.contains(i)&&!i.closest("[data-pipeup-ignore]")?ae().filter(N=>N.e.contains(i)).pop():void 0)??Ee();return w?(u||(q=w.m),F=!0,m(w.e),!0):!1}function I(){let i=re();Y=k,k=null,$(null),X(null);for(let u of r)ee(u,!0);return i}function R(){let i=j;i&&i!==document.body&&i.isConnected&&i.focus?.({preventScroll:!0}),(!i||i===document.body||!i.matches?.(":focus"))&&e.n.querySelector(".launch .mode")?.focus({preventScroll:!0})}function D(i){let u=Be(i);return u?yo(ae(),u):[]}function H(i){let u=et(ae(),q),w=u.findIndex(z=>z.e===k),N=u[w<0?i>0?0:u.length-1:(w+i+u.length)%u.length];N&&m(N.e)}function U(i){if(k)return H(i);de=null;let u=document.activeElement;j=be()??u;let w=Y?.isConnected?Y:null,N=w&&Be(w),z;if(N){q=N.m;let J=et(ae(),q),Te=J.indexOf(N);z=J[(Te+i+J.length)%J.length]}else if(w){q=0;let J=et(ae(),0),Te=ne=>(w.compareDocumentPosition(ne.e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0,je=ne=>ne.e.contains(w);i>0?z=J.find(ne=>Te(ne)&&!je(ne))??J[0]:z=J.filter(ne=>!Te(ne)&&!je(ne)).pop()??J[J.length-1]}else z=Ee(),z&&(q=z.m);if(!z)return e.T("Nothing here to comment on");F=!0,m(z.e)}function le(){let i=g??k,u=i&&kn(i,e.root,t);if(!u)return e.T("Nothing around it");if((!B||!i.contains(B))&&(B=i),g)return Q(u);m(u)}function Me(){let i=g??k,u=i?D(i):[],w=u.find(N=>B&&N.e.contains(B))??u.find(N=>xe(N.e))??u[0];if(!w)return e.T("Nothing inside it");g?Q(w.e):m(w.e)}function Ye(i=!1){if(!k)return;if(e.state.t&&!e.S())return e.he();if(!i)return _(k);let u=ke(k);if(!u.length)return e.T("No comments on this block");ce=(ce+1)%u.length,e.open(u[ce].id),u.length>1&&e.T(`Comment ${ce+1} of ${u.length} on this block`)}function kt(i){if(["Tab","ArrowUp","ArrowDown","Enter"," ","Escape"].includes(i.key)&&!(i.key.startsWith("Arrow")&&(i.metaKey||i.ctrlKey||i.altKey))){if(i.preventDefault(),i.stopPropagation(),He=i.key,i.key==="Escape")return void e.U();if(i.key==="Enter"||i.key===" ")return Ye(i.shiftKey&&i.key==="Enter");e.state.o&&e.open(null),i.key==="Tab"?H(i.shiftKey?-1:1):i.key==="ArrowUp"?le():Me()}}let st=()=>{let i=be();return i?!!i.closest("[inert]"):!document.activeElement||document.activeElement===document.body},He="",c=!1,L=i=>{c&&window.removeEventListener("keyup",L,!0),i.key===He&&(He="",i.preventDefault(),i.stopPropagation())};window.addEventListener("keyup",L,!0),window.addEventListener("pointermove",Ue,!0),document.addEventListener("selectionchange",we);for(let i of xo)window.addEventListener(i,Ae,!0);for(let i of bo)window.addEventListener(i,$e,!0);return window.addEventListener("keydown",Ne,!0),{U(){return g?(K(null),!0):!1},z:()=>k!==null,ge:()=>F&&!k,ee:S,W(){k&&!re()&&m(k)},u(){if(de=null,k&&!(k.isConnected&&ze(k))){let w=Ee();w?m(w.e,re()||st()):I()}let i=e.n.querySelector(".launch");if(i&&h.nextElementSibling!==i&&!re()&&!h.contains(be()))for(let w of[n,...r,h])e.n.insertBefore(w,i);let u=e.state.t;y&&u!==y?(y=null,K(null),k&&m(k,st())):u&&!y&&(p||g)&&K(null)},M(){Le(),ve(),k&&_e(r[W],k.getBoundingClientRect(),4)},destroy(){I()&&R();for(let i of r)i.remove();A(),P(),c=!0,He||window.removeEventListener("keyup",L,!0),window.removeEventListener("pointermove",Ue,!0),document.removeEventListener("selectionchange",we);for(let i of xo)window.removeEventListener(i,Ae,!0);for(let i of bo)window.removeEventListener(i,$e,!0);window.removeEventListener("keydown",Ne,!0),n.classList.remove("show"),h.classList.remove("show"),ee(h,!0),O(n,()=>n.remove()),O(h,()=>h.remove())}}}var Ur=300,zr=32,Ln=220,yt=320,Wr=24,ko=24;function An(e,t=!1){let o=e.ownerDocument.documentElement,n=o.getAttribute("data-pipeup-layout");if(n==="bubbles"||e.querySelector("[data-pipeup-slide]"))return null;let r=e.querySelector("article, main, [role=main]")??(n==="column"?e:null);if(!r)return null;if(o.hasAttribute("data-pipeup-reserve")){let a=o.clientWidth,d=getComputedStyle(r).maxWidth,h;return d.endsWith("px")?h=parseFloat(d):d.endsWith("%")?h=parseFloat(d)/100*a:h=r.getBoundingClientRect().width,n!=="column"&&a<h+yt-(t?Wr:0)?null:{x:a-yt+ko,width:yt-2*ko}}let s=r.getBoundingClientRect().right;if(window.innerWidth-s<Ur&&n!=="column")return null;let l=s+zr;return{x:l,width:Math.max(220,Math.min(300,window.innerWidth-l-16))}}function Mn(e,t){let o=e.resolved.get(t.id);return!o||o.state==="orphaned"&&!e.te.has(t.id)}function To(e){let t=v("div",{class:"col"});e.n.append(t);let o=new Map,n=null,r=new ResizeObserver(()=>a()),s=p=>Mn(e,p);function l(p){let g=e.resolved.get(p.id),y=g?yn(p.anchor,g):null;return y===null?Number.POSITIVE_INFINITY:y+window.scrollY-4}function a(){let p=[],g=[];for(let[E,P]of o){let k=l(P.thread);if(Number.isFinite(k))P.placed=k;else if(e.te.has(E)){if(P.placed===null){P.e.classList.add("wait");continue}k=P.placed}Number.isFinite(k)?p.push({id:E,w:k,height:P.e.offsetHeight}):g.push({id:E,height:P.e.offsetHeight})}let y=e.state.t,x=y?yn(y.anchor,y.resolved):null;n&&x!==null&&p.push({id:"draft",w:x+window.scrollY-4,height:n.e.offsetHeight});let C=mo(p,n?"draft":e.state.o),A=Math.max(0,...p.map(E=>(C.get(E.id)??0)+E.height))+24;for(let E of g)C.set(E.id,A),A+=E.height+10;for(let[E,P]of o){if(P.e.classList.contains("wait")){if(!C.has(E))continue;P.e.style.transition="none",P.e.style.transform=`translateY(${Math.round(C.get(E))}px)`,P.e.offsetWidth,P.e.style.transition="",P.e.classList.remove("wait");continue}P.e.style.transform=`translateY(${Math.round(C.get(E)??0)}px)`}n&&(n.e.style.transform=`translateY(${Math.round(C.get("draft")??0)}px)`)}function f(p,g){p.thread=g,p.lost=s(g),p.view.update(g,{lost:p.lost?g.anchor.snapshot:null})}function d(p){let g=s(p),y=it(p,e.D,{H:"column",lost:g?p.anchor.snapshot:null}),x=v("div",{class:"th","data-thread":p.id},v("button",{class:"opn sr",type:"button","data-thread":p.id}),y.element);return x.style.transition="none",x.addEventListener("mouseenter",()=>e.E(p.id)),x.addEventListener("mouseleave",()=>e.E(null)),x.addEventListener("click",()=>e.open(p.id)),t.append(x),r.observe(x),{e:x,thread:p,lost:g,placed:null,view:y}}function h(){let p=e.state.t;if(n&&p&&n.of!==p){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Ln),n=null}if(p&&n&&(n.i.V(p.label),n.i.B(e.state.s&&!p.anchor.quote&&!p.anchor.point)),p&&!n){let g=Ft(e,p),y=v("div",{class:"th on"},g.element);y.style.transition="none",t.append(y),r.observe(y),n={e:y,i:g,of:p},g.B(e.state.s&&!p.anchor.quote&&!p.anchor.point),g.focus()}else if(!p&&n){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Ln),n=null,e.I(null)}}function T(p){ee(t,e.state.l);let g=new Set,y=[],x=e.state.o!==null||e.state.t!==null;for(let C of p){if(!e.R(C))continue;g.add(C.id);let A=o.get(C.id);A?(A.thread!==C||A.lost!==s(C))&&f(A,C):(A=d(C),o.set(C.id,A),y.push(A.e));let E=A.e,P=e.state.o===C.id;E.classList.toggle("on",P);let k=E.firstElementChild,q=C.root.replies.length;k.setAttribute("aria-label",`Open thread: ${he(C.root.text,60)}, ${zt(q)}`),k.setAttribute("aria-expanded",String(P)),ee(k,P);let W=E.querySelector(".more");W&&ee(W,!P),E.classList.toggle("dim",x&&!P),E.classList.toggle("hot",e.state.E===C.id&&!P),E.classList.toggle("resolved",C.resolved),E.classList.toggle("lost",A.lost)}for(let[C,A]of o)g.has(C)||(o.delete(C),r.unobserve(A.e),A.e.classList.add("out"),window.setTimeout(()=>A.e.remove(),Ln));h(),Rt(t,p.filter(C=>g.has(C.id)).sort(Ke(e)).map(C=>o.get(C.id).e),n?.e??null)&&t.offsetWidth,a(),n&&y.push(n.e);for(let C of y)C.offsetWidth,C.style.transition=""}function M(){let p=An(e.root,!0);p&&(t.style.width=`${p.width}px`,t.style.transform=`translate(${p.x}px, ${-window.scrollY}px)`)}return{u:T,M,destroy(){r.disconnect(),e.I(null),t.remove()}}}var So="[data-pipeup-ignore],input,textarea,select,[contenteditable]:not([contenteditable=false])";function Lo(e){let t=v("button",{type:"button","aria-label":"Comment",title:"Comment"},te("comment",17)),o=v("div",{class:"selbar"},t);o.inert=!0,e.n.append(o);let n=null,r=0,s=!1,l=p=>{let g=p&&(p.nodeType===Node.ELEMENT_NODE?p:p.parentElement);return!!g&&e.root.contains(g)&&!g.closest(So)};function a(){if(!n)return;let p=n.getBoundingClientRect(),{left:g,top:y}=Kt({left:p.left,top:p.top,width:p.width,height:p.height},{width:o.offsetWidth||36,height:o.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});o.style.left=`${g}px`,o.style.top=`${y}px`}function f(){n=null,o.inert=!0,o.classList.remove("show")}function d(p=!1){let g=window.getSelection();if(!e.state.s||!g||g.isCollapsed||g.rangeCount===0||!g.toString().trim()||!l(g.anchorNode)||!l(g.focusNode)){f();return}!n&&!p&&e.T("Enter comments on the selected words"),n=g.getRangeAt(0).cloneRange(),a(),o.inert=!1,o.classList.add("show")}t.addEventListener("mousedown",p=>p.preventDefault()),t.addEventListener("click",p=>{if(p.stopPropagation(),e.state.t&&!e.S())return e.F();let g=n;if(!g)return;let y;try{y=an(g,e.root,e.d.view(g.commonAncestorContainer))}catch(C){e.Z(C),f();return}let x=he(g.toString().replace(/\s+/g," ").trim(),60);window.getSelection()?.removeAllRanges(),f(),e.Q({anchor:y,label:`\u201C${x}\u201D`,ranges:[g],resolved:{state:"attached",element:null,range:g}})});let h=()=>{if(window.clearTimeout(r),r=window.setTimeout(()=>s||d(),250),!n)return;let p=window.getSelection();(!p||p.isCollapsed||!p.toString().trim())&&f()};document.addEventListener("selectionchange",h);let T=p=>{p.type!=="keyup"&&(s=p.type==="mousedown"),!(s||e.f(p))&&window.setTimeout(()=>d(p.type==="mouseup"),0)};window.addEventListener("mousedown",T,!0),window.addEventListener("mouseup",T,!0),window.addEventListener("keyup",T,!0);let M=p=>{p.key!=="Enter"||!n||e.f(p)||p.target instanceof Element&&p.target.closest(`${So},${Yt}`)||(p.preventDefault(),p.stopPropagation(),t.click())};return window.addEventListener("keydown",M,!0),{u(){!e.state.s&&n&&f()},M(){n&&a()},destroy(){window.removeEventListener("mousedown",T,!0),window.removeEventListener("mouseup",T,!0),window.removeEventListener("keyup",T,!0),window.removeEventListener("keydown",M,!0),window.clearTimeout(r),document.removeEventListener("selectionchange",h),o.remove()}}}async function Cn(e,t){try{await navigator.clipboard.writeText(e);return}catch{}let o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.cssText="position:fixed;opacity:0;pointer-events:none",t.append(o),o.select();let n=document.execCommand("copy");if(o.remove(),!n)throw new Error("pipeup: your browser blocked copying")}var Yr=3e3,Ao="Hidden on the page";function Mo(e){let t=[v("span",{class:"n"}),v("span",{class:"n"})],o=te("comment",20,1.4);o.lastElementChild.setAttribute("stroke-width","1.6");let n=v("button",{class:"mode",type:"button","aria-label":"Comment","aria-keyshortcuts":vn,"aria-haspopup":"menu","aria-expanded":"false"},v("span",{class:"plus"},o),v("span",{class:"cnt"},te("bubble",34,1.4),...t),v("span",{class:"dot"})),r=document.createTextNode("Comment"),s=v("span",{class:"ttip","aria-hidden":"true"},r,v("small",{},ft)),l=v("div",{class:"launch"},n,s),a=v("div",{class:"menu",role:"menu","aria-label":"Comments"}),f=v("div",{class:"list",role:"menu","aria-label":"All comments"}),d=v("span",{class:"pn"}),h=v("button",{class:"ib",type:"button","aria-label":"Close"},te("close")),T=v("button",{class:"hs",type:"button",role:"switch","aria-checked":"false"},"Show resolved",v("span",{class:"sw","aria-hidden":"true"}));T.addEventListener("click",m=>{m.stopPropagation(),e.c.ve()});let M=v("div",{class:"all",role:"dialog","aria-label":"All comments"},v("div",{class:"hd"},v("span",{},"All comments"),d,T,h),f),p=v("div",{class:"pop side",role:"dialog","aria-label":"Comment thread"});a.inert=M.inert=p.inert=!0,e.n.append(a,l,M);let g=!1,y=null,x=0,C=[],A=0,E=null,P=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,k=m=>{g=e.state.c=m,window.clearTimeout(x),x=0,m||y?.(!0),a.classList.toggle("show",m),ee(a,!m),n.setAttribute("aria-expanded",String(m))},q=(m,S=!1)=>{e.state.l!==m&&(e.state.l=m,e.u(),m?(W(f)[0]??h).focus({preventScroll:!0}):S&&n.focus({preventScroll:!0}))},W=(m=a)=>[...m.querySelectorAll(".mi")],F=()=>a.getRootNode().activeElement,Y=()=>{k(!1),n.focus({preventScroll:!0})},j=m=>{let S=W(m.currentTarget);if(S.length===0)return;let I=F(),R=S.indexOf(I),D=H=>{m.preventDefault(),S[(H+S.length)%S.length]?.focus({preventScroll:!0})};m.key==="ArrowDown"?D(R+1):m.key==="ArrowUp"?D(R<0?S.length-1:R-1):m.key==="Home"?D(0):m.key==="End"&&D(S.length-1)};a.addEventListener("keydown",j),f.addEventListener("keydown",j),h.addEventListener("click",m=>{m.stopPropagation(),q(!1,!0)});let B=m=>Mn(e,m),se=()=>C.filter(m=>!m.resolved&&!e.O(m)).length,ce=()=>C.filter(m=>!m.resolved&&e.O(m)).length,ge=()=>C.filter(m=>!m.resolved).length,de=m=>{let S=m.anchor.view?.slide,I=e.d.p(m.anchor.view)?"":Ot(m.anchor.view);return S&&e.d.slide()!==null?`On slide ${S}`:I?`In ${I}`:Ao},oe=(m,S,I="")=>v("div",{role:"group","aria-label":I?`${m} \xB7 ${I}`:m},v("div",{class:"sec","aria-hidden":"true"},m,I&&v("b",{},I)),...S);function pe(m,S){let I=e.d.slide(),R=new Map;for(let D of m){let H=D.thread,U=I!==null?H.anchor.view?.slide??I:e.O(H)?e.d.p(H.anchor.view)?"":Ot(H.anchor.view):null;R.set(U,[...R.get(U)??[],D])}if(I===null){let D=R.get(null)??[];return R.delete(null),[...D.map(S),...[...R].map(([H,U])=>oe(H||Ao,U.map(S)))]}return[...R].sort(([D],[H])=>Number(D)-Number(H)||0).map(([D,H])=>oe(`Slide ${D} \xB7 ${H.filter(U=>!U.thread.resolved).length} open`,H.map(S),D===I?"This slide":""))}function Le(){let m=F()?.dataset.thread,S=e.c.all().filter(H=>!H.thread.resolved||e.state.k),I=H=>{let U=H.thread,le=Je(U.root.author,U.root.name);le.classList.add("in");let Me=v("button",{class:U.resolved?"mi done":"mi",type:"button",role:"menuitem","data-thread":U.id},le,v("span",{},v("span",{class:"clamp"},U.root.deleted?"Deleted":U.root.text),v("small",{},B(U)?`\u201C${he(U.anchor.snapshot,80)}\u201D`:H.location.where)));return Me.addEventListener("click",Ye=>{Ye.stopPropagation(),ve(U.id,Me.getBoundingClientRect().top)}),Me},R=S.filter(H=>B(H.thread));d.textContent=String(ge()),T.setAttribute("aria-checked",String(e.state.k)),f.replaceChildren(S.length?"":v("div",{class:"sec",role:"presentation"},"No open comments"),...pe(S.filter(H=>!B(H.thread)),I),R.length?oe("No longer on the page",R.map(I)):"");let D=W(f);m&&D.find(H=>H.dataset.thread===m)?.focus({preventScroll:!0})}function ve(m,S){Qe()&&(e.state.L=!0,q(!1)),O(m,S)}let b="";function O(m,S){let I=C.find(R=>R.id===m);if(I){if(b=m,!e.O(I))return $(I,S);if(e.state.t&&!e.S())return e.F();e.d.Y(I.anchor.view??{}).then(()=>{e.ne();let R=C.find(D=>D.id===m);R&&b===m&&(e.state.l||e.state.L)&&$(R,S)})}}function $(m,S){let I=m.id,R=e.resolved.get(I),D=R&&!B(m)&&!e.O(m)?R.element??R.range?.startContainer.parentElement??null:null;if(D?.scrollIntoView({block:"center",inline:"nearest",behavior:P?"auto":"smooth"}),D&&R&>(m.anchor,R)&&D.checkVisibility?.({visibilityProperty:!0})!==!1){X(),e.open(I);return}e.open(null),Qe()&&(e.state.L=!0,e.u()),K(m,S)}function K(m,S){let I=!B(m)&&e.O(m),R={quote:m.anchor.quote?.exact??null,lost:B(m)||I?m.anchor.snapshot:null,place:I?de(m):null};if(E?.id===m.id?E.view.update(m,R):(E={id:m.id,view:it(m,e.D,{H:"popover",...R})},p.replaceChildren(E.view.element)),S===void 0)return;p.isConnected||(e.n.insertBefore(p,M),p.offsetWidth);let D=qt(e.state.l),{left:H,top:U}=_t({x:D.width,y:S,below:!1},{width:Ze,height:p.offsetHeight},D);p.style.left=`${H}px`,p.style.top=`${U}px`,p.classList.add("show"),p.inert=!1,e.we(m.id)}function X(m=!1){E&&(E=null,p.classList.remove("show"),ee(p,!0),m&&e.state.L&&(e.state.L=!1,e.u()))}function V(m,S,I,R=!1,...D){let H=v("button",{class:"mi",type:"button",role:R?"menuitemcheckbox":"menuitem"},m,v("span",{class:"lb"},S),...D,R&&v("span",{class:"sw","aria-hidden":"true"}),v("span",{class:"tt","aria-hidden":"true"}));return H.addEventListener("click",U=>{U.stopPropagation(),I(U)}),H}let _=(m,S,I,R)=>{let D=m.querySelector(".lb");D.textContent!==S&&(D.textContent=S),m.querySelector(".tt").textContent=I,m.setAttribute("aria-description",I),R!==void 0&&m.setAttribute("aria-checked",String(R))},Q=()=>v("div",{class:"sep",role:"separator"}),fe=v("span",{class:"ma"}),Re=v("span",{class:"kc"}),Ue="",G=V(fe,"",ae,!1,Re);G.dataset.item="name";let we=V(te("copy"),"Copy as Markdown",()=>{Y(),e.c.copyAll("ai")}),Ae=V(te("lines"),"Copy as Text",()=>{Y(),e.c.copyAll("text")}),$e=v("span",{class:"kc"}),Ne=V(te("list"),"All comments",()=>{k(!1),q(!0)},!1,$e),ye=V(te("comment"),"Start commenting",m=>{let S=!e.state.s&&m.detail===0;e.ye(!e.state.s,S),S&&k(!1)},!0,v("span",{class:"kc","aria-hidden":"true"},ft));ye.dataset.item="comment",ye.setAttribute("aria-keyshortcuts",vn);let be=[G,Q(),we,Ae,Ne,Q(),ye];function re(){let m=ge(),S=e.c.name(),I=S||Oe(e.doc.me);if(_(G,I,S?"The name on your comments":"Add a name to show on your comments"),G.setAttribute("aria-label",`${I}, ${S?"edit":"add"} your name`),Re.replaceChildren(S?te("edit",13):"Add name"),mt(e.doc.me,S)!==Ue){Ue=mt(e.doc.me,S);let R=Je(e.doc.me,S);R.classList.add("in"),fe.replaceChildren(R)}_(we,"Copy as Markdown","Markdown, with where each thread is"),_(Ae,"Copy as Text","Just the words"),_(Ne,"All comments","Every thread, and where it is"),$e.textContent=m?String(m):"",_(ye,"Start commenting",e.state.s?"Turn off to hide the comments again":"Shows the comments; choose any part of the page to comment on it",e.state.s)}function ze(){re(),a.firstChild!==G&&a.replaceChildren(...be)}function ae(){let m=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"});m.value=e.c.name();let S=v("div",{class:"ed"},fe.cloneNode(!0),m),I=(R,D=!1)=>{if(y!==I)return;y=null;let H=m.value.trim();R&&H&&H!==e.c.name()&&e.c.rename(H).then(re),S.replaceWith(G),D&&G.focus({preventScroll:!0})};y=I,m.addEventListener("keydown",R=>{R.stopPropagation(),(R.key==="Enter"||R.key==="Escape")&&(R.preventDefault(),I(R.key==="Enter",!0))}),m.addEventListener("blur",()=>I(!0)),G.replaceWith(S),m.focus({preventScroll:!0})}n.addEventListener("click",m=>{if(m.stopPropagation(),g){k(!1);return}ze(),k(!0),m.detail===0&&W().at(-1)?.focus({preventScroll:!0})});let Be=!1,xe=()=>{Be=M.contains(F())},Ee=m=>{let S=m.composedPath();g&&!S.includes(a)&&!S.includes(n)&&(k(!1),e.state.s&&!e.f(m)&&(e.X(m),m.preventDefault(),m.stopPropagation())),e.state.l&&!e.f(m)&&q(!1,Be&&(!document.activeElement||document.activeElement===document.body)),!S.includes(p)&&!S.includes(M)&&X(!0)},ke=m=>{if(!g||m.pointerType==="touch"||m.type==="pointerout"&&m.relatedTarget)return;let S=m.composedPath();m.type==="pointerover"&&(S.includes(a)||S.includes(n))?(window.clearTimeout(x),x=0):x||(x=window.setTimeout(()=>{x=0,y||k(!1)},Yr))};window.addEventListener("pointerdown",xe,!0),window.addEventListener("click",Ee,!0),window.addEventListener("pointerover",ke,!0),window.addEventListener("pointerout",ke,!0);let We=m=>{if(m.key!=="Escape"||y)return;let S=m.composedPath()[0];if(g)Y();else if(e.state.l&&!(S instanceof HTMLTextAreaElement&&!M.contains(S)))q(!1,!0);else if(E)X(!0),e.D.close();else return;m.stopPropagation()};return window.addEventListener("keydown",We,!0),{u(m){C=m;let S=se();if(S!==A){if(S){let[U,le]=t[0].classList.contains("on")?t:[t[1],t[0]];le.textContent=S>99?"99+":String(S),le.classList.toggle("s",S>99),U.classList.remove("on"),le.classList.add("on")}n.classList.toggle("has",S>0),A=S}let I=ce(),R=I?`${S} here \xB7 ${I} ${e.d.slide()!==null?"on other slides":"in other views"}`:"";n.classList.toggle("else",I>0);let D=`Comment${e.state.s?", comment mode on":""}${R?`, ${R}`:S?`, ${S} open`:""}`;n.getAttribute("aria-label")!==D&&n.setAttribute("aria-label",D),r.data!==(R||"Comment")&&(r.data=R||"Comment"),n.classList.toggle("on",e.state.s),g&&!e.state.c&&k(!1),g&&re();let H=e.state.l;if(M.classList.toggle("full",Qe()),M.classList.contains("show")!==H&&(M.classList.toggle("show",H),ee(M,!H)),H&&Le(),E){let U=m.find(le=>le.id===E?.id);!U||e.state.o||U.resolved&&!e.state.k?X():K(U)}},M(){},destroy(){window.removeEventListener("pointerdown",xe,!0),window.removeEventListener("click",Ee,!0),window.removeEventListener("pointerover",ke,!0),window.removeEventListener("pointerout",ke,!0),window.clearTimeout(x),window.removeEventListener("keydown",We,!0),a.remove(),M.remove(),p.remove(),l.remove()}}}var bt="[data-pipeup-slide]",Co=1e3,Po=["scroll","resize","keyup","click","transitionend","slidechanged"],Pn=null,Et=null,jt=new Set,On=new Set,xt=e=>{try{e()}catch(t){globalThis.reportError?.(t)}};function jr(e){let t=null;if(e){t={};let o=0;for(let[n,r]of Object.entries(e))if(!(typeof r!="string"||n==="slide"||n.length>Z.viewKey||r.length>Z.viewValue)){if(++o>=Z.viewEntries)break;t[n]=r}}Pn=t;for(let o of On)o()}function Gr(e){return jt.add(e),()=>void jt.delete(e)}function Gt(e){Et=typeof e?.current=="function"&&typeof e.go=="function"?e:null}function Xr(e,t,o){let n=t.K(),r=null,s=0,l=0;for(let a of e){if(!t.shown(a))continue;let f=t.i(a),d=Math.min(f.left+f.width,n.width)-Math.max(f.left,0),h=Math.min(f.top+f.height,n.height)-Math.max(f.top,0);if(d<=0||h<=0)continue;let T=Math.round(d*h),M=t.opacity(a);(T>s||T===s&&(M>l||M===l&&a===o))&&(r=a,s=T,l=M)}return r}function Jr(e,t,o){return t!==null?e?.slide===void 0||e.slide===t:!e||!o?!0:Object.entries(e).every(([n,r])=>n==="label"||n==="slide"||o[n]===r)}function Zr(){return{i:e=>e.getBoundingClientRect(),shown:e=>e.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1,opacity:e=>parseFloat(getComputedStyle(e).opacity)||0,K:()=>({width:window.innerWidth,height:window.innerHeight})}}var Oo=()=>{let e=window.Reveal;return typeof e?.getIndices=="function"&&typeof e.slide=="function"?e:null};function Io(e,t,o=Zr()){let n=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,r=null,s=null,l=0,a=!1,f=()=>[...e.querySelectorAll(bt)],d=()=>[...e.querySelectorAll(".slides > section")],h=A=>typeof A=="string"&&A.length>0&&A.length<=Z.viewValue?A:null,T=A=>h(A?.getAttribute("data-pipeup-slide"));function M(){if(Et){let E=null;if(xt(()=>{let P=Et.current();Number.isInteger(P)&&P>0&&(E=String(P))}),E!==null)return E}let A=Oo();if(A){let E=null;if(xt(()=>{let P=A.getIndices().h,k=d()[P];E=T(k?.matches(bt)?k:k?.querySelector(bt))??h(String(P+1))}),E!==null)return E}return r&&!r.isConnected&&(r=null),r=Xr(f(),o,r)??r,T(r)}function p(){l=0,s=M(),t()}let g=()=>{!l&&!a&&(l=requestAnimationFrame(p))},y=A=>Jr(A,s,Pn);function x(A){if(y(A))return Promise.resolve(!0);let E=A.slide,P=Oo(),k=f().find(F=>T(F)===E),q=/^[1-9]\d{0,5}$/.test(E??"");if(q&&Et)xt(()=>Et.go(Number(E)));else if(q&&P){let F=k?d().findIndex(Y=>Y===k||Y.contains(k)):-1;xt(()=>P.slide(F>=0?F:Number(E)-1))}else if(jt.size)for(let F of jt)xt(()=>F({...A}));else if(k)k.scrollIntoView({block:"start",behavior:n?"auto":"smooth"});else return Promise.resolve(!1);let W=performance.now();return new Promise(F=>{let Y=se=>{clearTimeout(j),F(se)},j=setTimeout(()=>Y(!1),Co),B=()=>{if(a)return Y(!1);if(s=M(),y(A))return Y(!0);if(performance.now()-W>=Co)return Y(!1);requestAnimationFrame(B)};requestAnimationFrame(B)})}let C=new MutationObserver(A=>{A.some(E=>E.target instanceof Element&&E.target.matches(bt))&&g()});C.observe(e,{subtree:!0,attributes:!0,attributeFilter:["class","style","hidden"]});for(let A of Po)window.addEventListener(A,g,{capture:!0,passive:!0});return On.add(g),s=M(),{slide:()=>s,view(A){let E=A instanceof Element?A:A?.parentElement,P=T(E?.closest(bt))??s,k={...P!==null?{slide:P}:{},...Pn};return Object.keys(k).length?k:void 0},p:y,Y:x,destroy(){a=!0,cancelAnimationFrame(l),C.disconnect();for(let A of Po)window.removeEventListener(A,g,!0);On.delete(g)}}}var $o=["pipeup-quote","pipeup-on","pipeup-done"],Qr={"pipeup-quote":[[250,227,188,.75],[250,200,100,.28]],"pipeup-on":[[247,212,154,.95],[250,200,100,.42]],"pipeup-done":[[180,178,169,.22],[180,178,169,.2]]},ei=(e,t)=>$o.map(o=>{let[n,r,s,l]=Qr[o][e?1:0];return`::highlight(${o}){background-color:rgba(${n},${r},${s},${+(l*t).toFixed(3)})}`}).join("");function No(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}var ti="<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><rect x='7' y='7' width='23' height='23' rx='4' fill='none' stroke='#534AB7' stroke-width='2' stroke-dasharray='4 3'/><path d='M3 2v15l4-3.5 3 6.5 2.5-1.2-3-6.3H15z' fill='#fff' stroke='#2C2C2A' stroke-width='1.2' stroke-linejoin='round'/></svg>",ni=`:not([data-pipeup-ignore],[data-pipeup-ignore] *){cursor:url("data:image/svg+xml,${encodeURIComponent(ti)}") 3 2,crosshair!important}`;function Bo(e=document,t=!1){let o=e.defaultView?.CSSStyleSheet;if(!o||!("replaceSync"in o.prototype)||!("adoptedStyleSheets"in e))return{oe(){},re(){},j(){},ie(){},remove:()=>Ro()};let n=new o,r=null,s=!1,l=1,a=0,f="",d=0,h=()=>n.replaceSync(ei(t,l)+(r===null?"":`:root{--pipeup-gutter:${r}px}`)+(s?ni:"")+(a||f?`html{--pipeup-panel:${a}px;${a?`margin-right:${a}px!important;`:""}${f}}`:""));return h(),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],{oe(T){T!==r&&(r=T,h())},re(T){T!==s&&(s=T,h())},j(T){l=T,h()},ie(T,M){T!==a&&(a=T,f=M?"":"transition:margin-right .34s cubic-bezier(.4,0,.2,1)!important",clearTimeout(d),!T&&f&&(d=window.setTimeout(()=>{f="",h()},400)),h())},remove(){clearTimeout(d),e.adoptedStyleSheets=e.adoptedStyleSheets.filter(T=>T!==n),Ro()}}}function Ho(e){No()&&(CSS.highlights.set("pipeup-quote",new Highlight(...e.quote)),CSS.highlights.set("pipeup-on",new Highlight(...e.on)),CSS.highlights.set("pipeup-done",new Highlight(...e.done)))}function Ro(){if(No())for(let e of $o)CSS.highlights.delete(e)}var In=':host{all:initial}*{box-sizing:border-box}button{-webkit-appearance:none;appearance:none;font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}svg{display:block}.layer{all:initial;display:block;position:fixed;inset:0;pointer-events:none;font:13px/1.5 var(--pu-font,system-ui,sans-serif);color:var(--k);--k:#2C2C2A;--mu:#5F5E5A;--fa:#888780;--ln:#E5E3DA;--ru:#ECEAE2;--so:#FAFAF7;--su:#FFFFFF;--ho:#F1EFE8;--as:color-mix(in srgb,var(--pu-accent,#534AB7) 12%,transparent);--sh:0 8px 28px rgba(44,44,42,.1);--in:.26s;--mv:.34s;--out:.2s;--pl:1.2s;--eo:cubic-bezier(.22,.61,.36,1);--eio:cubic-bezier(.4,0,.2,1);--ei:cubic-bezier(.4,0,1,1)}.layer.dark{--k:#ECEBE6;--mu:#B4B2A9;--fa:#8D8B84;--ln:#3A3936;--ru:#34332F;--so:#22221F;--su:#1B1B19;--ho:#2C2C29;--sh:0 8px 28px rgba(0,0,0,.45)}.layer.hidden .bub,.layer.hidden .col,.layer.hidden .pop,.layer.hidden .tip,.layer.hidden .mark,.layer.hidden .selbar{opacity:0!important;pointer-events:none!important}.tx{font-size:14px;line-height:1.5;color:var(--k);white-space:pre-wrap;overflow-wrap:anywhere}.tx.del,.who,.rest,.ctx{color:var(--fa)}.who,.rest{font-size:12px}.who{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rft>.who{display:block}.ctx[hidden]{display:none}.ctx{font-size:12px;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tx a{color:var(--pu-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.ft,.rft{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--in) var(--eo),opacity var(--in) var(--eo)}.ft>*,.rft>*{overflow:hidden;min-height:0;display:flex;align-items:center}.root:hover>.ft,.root:focus-within>.ft,.it:hover>.rft,.it:focus-within>.rft{grid-template-rows:1fr;opacity:1}.ft.has-rest{grid-template-rows:1fr;opacity:1}.ft.has-rest>*{grid-area:1/1}.ft .hover{opacity:0;transition:opacity var(--in) var(--eo)}.ft .rest{transition:opacity var(--in) var(--eo)}.root:hover>.ft .hover,.root:focus-within>.ft .hover,.ft:not(.has-rest) .hover{opacity:1}.root:hover>.ft .rest,.root:focus-within>.ft .rest{opacity:0}.acts{margin-left:6px;display:flex;flex:none}.ib{width:24px;height:22px;display:grid;place-items:center;border-radius:6px;color:var(--mu);transition:background-color .2s var(--eo),color .2s var(--eo)}.ib:hover,.ib:focus-visible{background:var(--ho);color:var(--k);outline:none}.rps,.rbox{padding-left:14px}.rps .it{padding-top:6px}.more{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--mv) var(--eio)}.more>div{overflow:hidden;min-height:0}.th:not(.on) .more{grid-template-rows:0fr}.row{display:flex;align-items:center;gap:8px;padding:8px 0 2px;cursor:text}.input{flex:1;min-width:0;height:27px;display:block;border:0;border-bottom:1px solid var(--ln);outline:none;resize:none;overflow:hidden;font:inherit;font-size:14px;line-height:1.5;padding:3px 0;color:var(--k);background:transparent;transition:border-color var(--in) var(--eo)}.row:hover .input,.input:hover{border-bottom-color:var(--mu)}.input:focus{border-bottom-color:var(--pu-accent)}.ed{display:flex;gap:10px;align-items:center;min-height:34px;padding:6px 10px}.ed .input{font-size:13px;height:22px}.root,.it{position:relative;padding-right:30px}.av{display:grid;place-items:center;width:22px;height:22px;border-radius:32%;font-size:12px;font-weight:600;line-height:1;opacity:0;transform:scale(.85);transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.av.in{opacity:1;transform:none}.av svg{width:80%;height:80%}.root>.av,.it>.av{position:absolute;top:0;right:0}.it>.av{top:6px}.av{--av-l:92%;--av-d:30%;--s:60%;background:hsl(var(--h) var(--s) var(--av-l));color:hsl(var(--h) var(--s) var(--av-d))}.dark .av{--av-l:20%;--av-d:78%}.c0{--h:0}.c1{--h:25}.c2{--h:50}.c3{--h:130}.c4{--h:175}.c5{--h:215}.c6{--h:270}.c7{--h:330}.c8{--h:28;--s:35%}.c9{--h:220;--s:8%}.me{flex:none;display:grid}.me>.av{grid-area:1/1;width:26px;height:26px;font-size:13px}.you{display:grid;padding:0 34px;min-height:24px;font-size:12px;color:var(--fa)}.you>*{grid-area:1/1;display:flex;align-items:center;min-width:0;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.say{white-space:pre;overflow:hidden}.nm{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.say button{flex:none}.say button{color:var(--mu);text-decoration:underline;text-decoration-color:var(--ln);text-underline-offset:2px;transition:color .2s var(--eo)}.say button:hover,.say button:focus-visible{color:var(--pu-accent);outline:none}.nf{opacity:0;transform:translateY(-4px);pointer-events:none}.nf .input{font-size:13px;height:24px}.you.naming .nf{opacity:1;transform:none;pointer-events:auto}.you.naming .say{opacity:0;pointer-events:none}.send{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;color:var(--pu-accent);flex:none;opacity:0;pointer-events:none;transition:opacity var(--in) var(--eo),background-color .2s var(--eo)}.send.show{opacity:1;pointer-events:auto}.send:hover{background:var(--as)}.bub{position:fixed;left:0;top:0;width:20px;height:20px;margin:-20px 0 0 -2px;border-radius:50% 50% 50% 0;background:var(--pu-accent);border:2px solid var(--su);box-shadow:0 1px 4px #0003;pointer-events:auto;opacity:0;transform:translateY(-6px) scale(.9);transform-origin:2px 20px;transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.bub.in{opacity:1;transform:none;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.bub.in:hover,.bub.on{transform:scale(1.18)}.bub.done{background:var(--fa)}.bub.ghost{pointer-events:none}.tip,.pop,.menu,.all,.toast,.selbar{background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh)}.tip{position:fixed;max-width:260px;border-radius:10px;padding:7px 10px;opacity:0;transform:translateY(3px);transition:opacity .22s var(--eo),transform .26s var(--eo)}.tip.show{opacity:1;transform:none;pointer-events:auto;cursor:pointer;transition:opacity .22s var(--eo),transform .26s var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.pop{position:fixed;width:var(--pu-pop);border-radius:12px;padding:10px 12px 8px;pointer-events:none;opacity:0;transform:translateY(6px) scale(.98);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.pop.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.pop.show.glide{transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.mark{position:fixed;border:2px solid color-mix(in srgb,var(--pu-accent) 50%,transparent);background:var(--as);border-radius:8px;opacity:0;transition:opacity .3s var(--eo)}.mark.show{opacity:1}.pulse{position:fixed;border:2px solid var(--pu-accent);border-radius:8px;background:var(--as);animation:pu-pulse var(--pl) var(--eio) forwards}@keyframes pu-pulse{0%{opacity:0;transform:scale(.985)}35%{opacity:.85;transform:scale(1)}to{opacity:0;transform:scale(1.02)}}.col{position:fixed;left:0;top:0;pointer-events:none;transition:opacity var(--in) var(--eo)}.th{position:absolute;left:0;right:0;top:0;padding:4px 4px 4px 12px;pointer-events:auto;cursor:pointer;box-shadow:inset 2px 0 0 transparent;transition:transform var(--mv) var(--eio),box-shadow var(--in) var(--eo),opacity var(--in) var(--eo)}.th.hot{box-shadow:inset 2px 0 0 var(--ln)}.th.on{box-shadow:inset 2px 0 0 var(--pu-accent);cursor:default}.th.dim{opacity:.45}.th.resolved:not(.on):not(.hot){opacity:.6}.th.lost .ctx{white-space:normal}.th.wait{opacity:0!important;pointer-events:none}.th.out{opacity:0!important;pointer-events:none;transition:opacity var(--out) var(--ei)}.th:has(.opn:focus-visible){box-shadow:inset 2px 0 0 var(--ln);outline:2px solid var(--pu-accent);outline-offset:2px;border-radius:4px}.selbar{position:fixed;display:flex;border-radius:10px;padding:2px;opacity:0;transform:translateY(4px);pointer-events:none;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.selbar.show{opacity:1;transform:none;pointer-events:auto}.selbar button{width:32px;height:30px;display:grid;place-items:center;border-radius:8px;color:var(--pu-accent);transition:background-color .2s var(--eo)}.selbar button:hover,.selbar button:focus-visible{background:var(--as);outline:none}.pick{position:fixed;left:0;top:0;border:2px solid color-mix(in srgb,var(--pu-accent) 70%,transparent);background:color-mix(in srgb,var(--pu-accent) 6%,transparent);border-radius:8px;pointer-events:none;opacity:0;transition:opacity var(--out) var(--ei),border-color var(--out) var(--ei),border-width var(--out) var(--ei),box-shadow var(--out) var(--ei)}.pick.show{opacity:1;transition-duration:var(--in);transition-timing-function:var(--eo)}.pick.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.pick.on{border-color:var(--pu-accent)}.pick.kf{border:3px solid var(--pu-accent);box-shadow:0 0 0 2px var(--su)}.km{position:fixed;left:0;top:0;pointer-events:none;outline:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.namebar{position:fixed;left:0;top:0;display:flex;align-items:center;gap:2px;padding:2px 2px 2px 10px;border-radius:10px;font-size:12px;color:var(--mu);white-space:nowrap;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(4px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.namebar.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.namebar.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.namebar .lbl{margin-right:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis}.namebar .nb{padding:4px;display:grid;place-items:center;border-radius:7px;transition:background-color .2s var(--eo),color .2s var(--eo)}.namebar .nb:hover,.namebar .nb:focus-visible{background:var(--ho);color:var(--k);outline:none}.namebar .nb[hidden]{display:none}.launch{position:fixed;right:20px;bottom:20px;pointer-events:auto}.launch .mode{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);transition:background-color .3s var(--eo),color .3s var(--eo)}.mode>*,.cnt>*{grid-area:1/1}.mode>*{display:grid;place-items:center;transition:opacity var(--in) var(--eo)}.cnt,.has>.plus{opacity:0}.has>.cnt{opacity:1}.n{font-size:12px;font-weight:500;line-height:1;margin:-1.4px 0 0 1.4px;font-variant-numeric:tabular-nums;opacity:0;transition:opacity var(--in) var(--eo)}.n.s{font-size:9.5px;letter-spacing:-.04em}.n.on{opacity:1}.launch .mode:hover,.launch .mode[aria-expanded=true]{background:var(--ho)}.launch .mode.on{background:var(--pu-accent);color:#fff}.mode>.dot{position:absolute;top:3px;right:3px;width:9px;height:9px;border-radius:50%;background:var(--pu-accent);border:2px solid var(--su);opacity:0}.mode.else>.dot{opacity:1}.ttip{position:absolute;right:0;bottom:54px;white-space:nowrap;border-radius:8px;padding:4px 9px;font-size:12px;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.ttip small{margin-left:8px}.ttip small,.mi .kc{font-size:12px;color:var(--fa)}.mode:hover+.ttip,.mode:focus-visible+.ttip{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}.launch .mode[aria-expanded=true]+.ttip{opacity:0;transition:opacity var(--out) var(--ei)}@media(hover:none){.ttip,.tt{display:none}}.menu{position:fixed;right:20px;bottom:76px;width:290px;border-radius:12px;padding:4px;pointer-events:none;opacity:0;transform:translateY(6px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.menu.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.mi{position:relative;display:flex;gap:10px;align-items:center;width:100%;min-height:34px;text-align:left;padding:6px 10px;border-radius:8px;transition:background-color .2s var(--eo)}.mi:hover,.mi:focus-visible{background:var(--so);outline:none}.mi svg{color:var(--mu);flex:none}.mi small{display:block;color:var(--fa);font-size:12px}.lb{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ma{flex:none;display:grid;margin:-2px 0}.ma .av{width:20px;height:20px;font-size:11px}.mi .av svg{color:inherit}.sep{height:1px;margin:4px 10px;background:var(--ru)}.tt{position:absolute;right:calc(100% + 14px);top:50%;translate:0 -50%;width:max-content;max-width:220px;padding:4px 9px;border-radius:8px;font-size:12px;line-height:1.4;color:var(--mu);background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translate(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.mi:hover>.tt,.mi:focus-visible>.tt{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}@media(max-width:600px){.tt{right:8px;top:auto;bottom:100%;translate:none;transform:translateY(3px)}}.sw{position:relative;flex:none;width:26px;height:16px;border-radius:8px;background:var(--ln);transition:background-color var(--mv) var(--eio)}.sw:before,.sw:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000040;transition:transform var(--mv) var(--eio),opacity var(--mv) var(--eio)}.sw:before{opacity:0;transform:translate(10px)}[aria-checked=true]>.sw{background:var(--pu-accent)}[aria-checked=true]>.sw:after{transform:translate(10px)}.all{position:fixed;top:0;right:0;bottom:0;width:var(--pu-panel);display:flex;flex-direction:column;border-width:0 0 0 1px;opacity:0;transform:translate(100%);transition:transform var(--out) var(--ei),opacity var(--out) var(--ei)}.all.show{opacity:1;transform:none;pointer-events:auto;transition:transform var(--mv) var(--eo),opacity var(--in) var(--eo)}.all.full{width:100%}.hd{display:flex;align-items:center;gap:8px;padding:12px 10px 8px 16px;font-weight:600}.pn{font-weight:400;color:var(--fa)}.hs{margin-left:auto;display:flex;align-items:center;gap:6px;padding:3px 4px 3px 6px;border-radius:6px;font-size:12px;font-weight:400;color:var(--mu);transition:background-color .2s var(--eo)}.hs:hover,.hs:focus-visible{background:var(--ho);outline:none}.list{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px}.all .mi{align-items:flex-start}.all .mi>.av{flex:none}.all .mi>span:last-child{flex:1;min-width:0}.all .mi small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.all .mi .av svg{margin:0}.all .mi.done{opacity:.6}.layer.listing .col{opacity:0;transition:opacity var(--out) var(--ei)}.sec{padding:8px 10px 2px;font-size:12px;color:var(--fa)}.sec b{margin-left:6px;font-weight:500;color:var(--pu-accent)}.toast{position:fixed;left:50%;bottom:28px;border-radius:10px;padding:8px 14px;font-size:13px;opacity:0;transform:translate(-50%,6px);transition:opacity .3s var(--eo),transform .36s var(--eo)}.toast.show{opacity:1;transform:translate(-50%)}@media(forced-colors:active){.pick.kf{border:3px solid Highlight}.layer :is(.ib,.mi,.nb,.hs,.selbar button,.say button):focus-visible{outline:2px solid Highlight}}@media(prefers-reduced-motion:reduce){.bub,.bub.in,.bub.in:hover,.bub.on,.tip,.pop,.selbar,.menu,.all,.ttip,.tt,.toast{transform:none!important}.sw:after{transform:none!important;transition-property:opacity}[aria-checked=true]>.sw:after{opacity:0}[aria-checked=true]>.sw:before{opacity:1}.th{transition-property:opacity,box-shadow}.tip.show{transition-property:opacity}.pick,.pick.show{transition:opacity .16s ease-in-out}.all,.all.show{transition-property:opacity}.namebar,.namebar.show{transform:none!important;transition:opacity .16s ease-in-out}.av,.nf{transform:none!important}@keyframes pu-pulse{0%{opacity:0}35%{opacity:.85}to{opacity:0}}}';var Do="#534AB7",oi="rgb(0, 0, 238)";function Fo(e){let t=/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)/.exec(e);if(!t||t[1]===void 0||t[2]===void 0||t[3]===void 0)return null;let o=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3]),a:o}}function ri(e){let t=o=>{let n=o/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Vo(e){let t=e.ownerDocument,o=t.defaultView;if(!o)return{font:"system-ui, sans-serif",accent:Do,dark:!1};let n=t.documentElement,r=o.getComputedStyle(e).fontFamily||"system-ui, sans-serif",s=(o.getComputedStyle(n).getPropertyValue("--pipeup-accent")||n.style.getPropertyValue("--pipeup-accent")).trim(),l=e.querySelector("a[href]"),a=l?o.getComputedStyle(l).color:"",f=s||(a&&a!==oi?a:Do),d=Fo(o.getComputedStyle(t.body).backgroundColor);(!d||d.a===0)&&(d=Fo(o.getComputedStyle(n).backgroundColor));let h=d&&d.a>0?ri(d)<.2:o.matchMedia?.("(prefers-color-scheme: dark)").matches===!0&&/dark/.test(o.getComputedStyle(n).colorScheme||"");return{font:r,accent:f,dark:!!h}}function qo(e,t){e.style.setProperty("--pu-font",t.font),e.style.setProperty("--pu-accent",t.accent),e.classList.toggle("dark",t.dark)}function _o(e,t=document){let o=t.createElement("pipeup-root");o.setAttribute("data-pipeup-ignore",""),o.style.cssText="position:fixed!important;inset:0!important;pointer-events:none!important;z-index:2147483000!important;display:block!important;margin:0!important;visibility:visible!important;opacity:1!important;transform:none!important;filter:none!important;";let n=o.attachShadow({mode:"open"}),r=t.defaultView?.CSSStyleSheet;if(r&&"replaceSync"in r.prototype&&"adoptedStyleSheets"in n){let l=new r;l.replaceSync(In),n.adoptedStyleSheets=[l]}else{let l=t.createElement("style");l.textContent=In,n.append(l)}let s=t.createElement("div");return s.className="layer",s.style.setProperty("--pu-panel",`${vt}px`),s.style.setProperty("--pu-pop",`${Ze}px`),qo(s,e),n.append(s),t.documentElement.append(o),{element:o,shadow:n,n:s,destroy:()=>o.remove()}}var ii=40,si=250,ai=120,li=2400,ci=4e3,di=1e4;function Ko(e,t=!1){return An(e,t)?"column":"bubbles"}function ui(e){return[...e.state.mode==="column"?[To(e),bn(e,{q:!1})]:[bn(e,{q:!0})],Lo(e),Mo(e)]}var pi=1e3,Xt="Shown here, but not saved yet \u2014 it will be saved with your next change",tt=e=>e instanceof Error?e.message.replace(/^pipeup: /,""):"Something went wrong";function Uo(e){let t=Vo(e.root),o=_o(t),n=Bo(document,t.dark);n.j(0);let r=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,s=document.documentElement.hasAttribute("data-pipeup-reserve"),l=new Map,a=new Set,f=new WeakSet,d={o:null,E:null,k:!1,hidden:!0,mode:Ko(e.root),t:null,s:!1,l:!1,L:!1,c:!1},h=v("div",{class:"toast",role:"status","aria-live":"polite"}),T=v("div",{class:"sr","aria-live":"polite"});o.n.append(h,T);let M=null,p=[],g=null,y=!1,x=0,C=0,A=0,E=0,P=0,k=new Set,q="",W=new Map,F=Io(e.root,()=>{!y&&$()&&G()}),Y=!1,j=0;function B(c,L=li,i=!1,u=!1){y||(Y=i,h.textContent=c,u?h.setAttribute("aria-hidden","true"):h.removeAttribute("aria-hidden"),h.classList.add("show"),window.clearTimeout(x),x=window.setTimeout(()=>h.classList.remove("show"),L))}function se(){Y&&(Y=!1,window.clearTimeout(x),h.classList.remove("show"))}function ce(c){T.textContent="",cancelAnimationFrame(j),j=requestAnimationFrame(()=>T.textContent=c)}function ge(c){B(tt(c))}function de(c){throw ge(c),c}let oe=c=>({thread:c,location:un(c.anchor,l.get(c.id)??Ct(c.anchor,e.root),e.root)}),pe=c=>d.o!==c||d.k?!1:(g?.z()?g.W():o.n.querySelector(".launch .mode")?.focus({preventScroll:!0}),!0),Le={reply:async(c,L)=>{try{await e.doc.reply(c,L)}catch(i){i instanceof Se?B(Xt):de(i)}},resolve:async c=>{try{await e.doc.resolve(c),pe(c)&&(d.o=null),B("Resolved \xB7 Show resolved brings it back")}catch(L){L instanceof Se?(pe(c)&&(d.o=null),B(`Resolved \xB7 ${Xt}`)):B(tt(L))}},reopen:async c=>{try{await e.doc.reopen(c),B("Reopened")}catch(L){B(L instanceof Se?`Reopened \xB7 ${Xt}`:tt(L))}},close:()=>{re(null);let c=we&&o.n.querySelector(we);c?c.focus({preventScroll:!0}):g?.W(),we=""},copy:c=>{try{let L=e.doc.threads().find(u=>u.id===c);if(!L)return;let i=hn(oe(L),"ai",location.href,Date.now());Cn(i,o.n).then(()=>B("Thread copied as Markdown for AI"),u=>B(tt(u)))}catch(L){B(tt(L))}}},ve={copyAll:async c=>{let L=ve.all(),i=gn(L,c,{title:document.title,url:location.href,exportedAt:new Date});try{await Cn(i,o.n);let u=L.filter(w=>!w.thread.resolved).length;B(`Copied ${u} thread${u===1?"":"s"}${c==="ai"?" as Markdown for AI":""}`)}catch(u){B(tt(u))}},ve:()=>{d.k=!d.k,G()},rename:async c=>{let L=c.replace(/\s+/g," ").trim();try{await m(L)?B(`New comments will say ${L}, but this browser couldn't remember it`):B(`New comments will say ${L}`)}catch(i){B(tt(i))}},name:()=>e.doc.name,all:()=>[...e.doc.threads()].sort(Ke(b)).map(oe)},b={doc:e.doc,root:e.root,n:o.n,host:o.element,state:d,resolved:l,te:a,D:Le,c:ve,d:F,O:c=>k.has(c.id),ne:()=>{$()&&G()},R:c=>!d.hidden&&(!c.resolved||d.k)&&!k.has(c.id),be:(c,L)=>{for(let i of e.doc.threads()){let u=l.get(i.id);if(i.anchor.quote&&b.R(i)&&u?.range&&fo(c,L,ht(u)))return i}return null},_:(c,L)=>b.S()?b.be(c,L):null,f:c=>c.composedPath().includes(o.element),X:c=>void f.add(c),pe:c=>f.has(c),open:re,we:c=>ye(c),E:ze,Q:ae,ue:Be,S:()=>!M||M.se(),J:c=>{let L=M?.G();c(),L?.()},he:()=>{let c=d.t?.anchor.view,L=M?.G();Promise.resolve(F.p(c)||F.Y(c??{}).then(()=>b.ne())).then(L)},ae:S,le:xe,ye:Ee,F:We,I:c=>{M=c},xe:B,T:ce,fe:se,Z:ge,Ee:I,u:G,U:ke};function O(c){let L=performance.now(),i=e.doc.threads();for(let u of i){if(c&&!c.has(u.id))continue;let w=performance.now()-L<ii,N=Ct(u.anchor,e.root,{fuzzy:w});l.set(u.id,N),!w&&N.state==="orphaned"?a.add(u.id):a.delete(u.id)}for(let u of[...l.keys()])i.some(w=>w.id===u)||l.delete(u);a.size===0?(window.clearTimeout(E),E=0):E===0&&(E=window.setTimeout(()=>{E=0,!y&&(O(new Set(a)),G())},si))}function $(){let c=new Set,L=F.slide()!==null,i=new Set;for(let w of e.doc.threads()){i.add(w.id);let N=l.get(w.id)?.element;(!F.p(w.anchor.view)||!L&&N?.checkVisibility?.({visibilityProperty:!0})===!1)&&c.add(w.id)}k=c;for(let w of W.keys())i.has(w)||W.delete(w);let u=`${F.slide()}|${[...c].join()}`;return u===q?!1:(q=u,!0)}function K(c){let L=[],i=[],u=[];for(let w of c){let N=l.get(w.id);w.resolved&&!d.k||!N?.range||k.has(w.id)||(w.id===d.o||w.id===d.E?i.push(N.range):w.resolved?u.push(N.range):L.push(N.range))}d.t&&F.p(d.t.anchor.view)&&i.push(...d.t.ranges),Ho({quote:L,on:i,done:u})}let X=0,V=0,_=0;function Q(c){if(c===V)return;V=c,cancelAnimationFrame(_);let L=X,i=performance.now(),u=c?260:200,w=N=>{let z=Math.min(1,(N-i)/u);X=L+(c-L)*(c?1-(1-z)**3:z*z),n.j(X),z<1&&(_=requestAnimationFrame(w))};_=requestAnimationFrame(w)}let fe=0,Re=0;function Ue(c){c!==fe&&(fe=c,n.ie(c,r),window.clearTimeout(Re),Re=window.setTimeout(()=>{O(),G()},r?0:400))}function G(){if(y)return;let c=e.doc.threads();if($(),d.o&&k.has(d.o)){let i=o.n.querySelector(`[data-thread="${d.o}"] .rbox textarea`)?.value;i&&W.set(d.o,i),d.o=null}d.hidden=!d.s&&!d.l&&!d.L&&!d.t,d.hidden&&(d.o=null),Q(d.hidden?0:1),o.n.classList.toggle("hidden",d.hidden),o.n.classList.toggle("listing",d.l);let L=d.l&&!Qe();Ue(L?vt:0),n.oe(s?d.mode==="column"&&!d.hidden&&!L?yt:0:null),K(c);for(let i of p)i.u(c);g?.u(c)}let we="",Ae=()=>o.n.getRootNode().activeElement,$e="input,textarea,select,[contenteditable]:not([contenteditable=false])",Ne=()=>{let c=Ae();return c instanceof HTMLTextAreaElement&&c.value!==""||!!document.activeElement?.matches($e)};function ye(c,L=Ne(),i=Ae()){let u=[...o.n.querySelectorAll(`[data-thread="${c}"] .rbox textarea`)].find(N=>!N.closest("[inert]")),w=i?.getAttribute("data-thread");we=w?`.${i.classList[0]}[data-thread="${w}"]`:"",!(L||!u)&&u.focus({preventScroll:!0})}function be(){let c=d.t;return!c||b.S()?!1:(F.p(c.anchor.view)||F.Y(c.anchor.view??{}),!0)}function re(c,L=!1){if(c&&be())return;if(d.o===c&&!d.t)return c?ye(c):void 0;let i=!L&&Ne(),u=Ae();if(c||(d.L=!1),d.o=c,c&&(d.t=null,I(c)),G(),c){let w=W.get(c),N=w&&o.n.querySelector(`[data-thread="${c}"] .rbox textarea`);N&&!N.value&&(N.value=w,N.dispatchEvent(new Event("input",{bubbles:!0}))),W.delete(c),L&&g?.z()?g.W():ye(c,i,u)}}function ze(c){d.E!==c&&(d.E=c,c&&c!==d.o&&I(c),G())}function ae(c){se(),d.l=!1,d.t=c,d.o=null,G()}function Be(c){if(!d.t)return ae(c);Object.assign(d.t,c),G()}function xe(){d.t&&(d.t=null,G())}function Ee(c,L=!1){d.s!==c&&(d.s=c,n.re(c),c?(d.o=null,d.l=!1,g=Eo(b)):(se(),g?.destroy(),g=null,ce("Comment mode off")),G(),g&&(L&&g.ee(),L?g.z()?B(Sn,di,!0,!0):B("Nothing here to comment on"):B(`Click anything to comment, or Tab between blocks \xB7 Option-click (Alt-click) to pin \xB7 ${ft} or Esc to finish`,ci,!0)))}function ke(){d.t&&(F.p(d.t.anchor.view)||b.S())?xe():d.o?re(null):g&&!g.U()&&Ee(!1)}function We(){if(d.t){be()||xe();return}d.o&&re(null)}async function m(c){try{return await e.onName(c),!1}catch(L){if(e.doc.name!==c)throw L;return!0}}async function S(c){let L=d.t;if(L)try{let i=await e.doc.comment(L.anchor,c);d.t=null,O(new Set([i])),re(i,!0)}catch(i){if(i instanceof Se){d.t=null,O(new Set([i.id])),re(i.id,!0),B(Xt);return}de(i)}}function I(c){let L=l.get(c);if(!L||L.state==="orphaned")return;let i=L.range?ht(L):L.element?[L.element.getBoundingClientRect()]:[];for(let u of i.slice(0,6)){let w=v("div",{class:"pulse"});_e(w,u,4),o.n.prepend(w),window.setTimeout(()=>w.remove(),1300)}}function R(){for(let c of p)c.destroy();p=ui(b),G()}let D=()=>{if(!y){for(let c of p)c.M();g?.M(),P=requestAnimationFrame(D)}},H=c=>{let L=c.composedPath()[0];return L instanceof Element&&L.closest($e)!==null},U=c=>{if(c.key==="Escape")return ke();if(co(c)&&!c.isComposing&&!c.defaultPrevented&&!H(c)){if(c.preventDefault(),g?.ge()&&g.ee())return;Ee(!d.s,!0)}},le=c=>{if(b.f(c)||f.has(c))return;let L=window.getSelection();L&&!L.isCollapsed||We()},Me=()=>{let c=Ko(e.root,d.mode==="column");c!==d.mode?(d.mode=c,R()):G()};function Ye(){let c=performance.now();C===0&&(A=c),window.clearTimeout(C);let L=Math.min(ai,Math.max(0,A+pi-c));C=window.setTimeout(()=>{C=0,O(),G()},L)}let kt=new MutationObserver(c=>{c.every(L=>o.element.contains(L.target))||Ye()});window.addEventListener("keydown",U),window.addEventListener("click",le),window.addEventListener("resize",Me),kt.observe(e.root,{subtree:!0,childList:!0,characterData:!0});let st=typeof ResizeObserver>"u"?null:new ResizeObserver(Ye);st?.observe(e.root);let He=e.doc.onChange(()=>{O(),G()});return O(),R(),P=requestAnimationFrame(D),{ctx:b,destroy(){y=!0,cancelAnimationFrame(P),cancelAnimationFrame(_),cancelAnimationFrame(j),F.destroy(),window.clearTimeout(Re),window.clearTimeout(x),window.clearTimeout(C),window.clearTimeout(E),kt.disconnect(),st?.disconnect(),He(),window.removeEventListener("keydown",U),window.removeEventListener("click",le),window.removeEventListener("resize",Me),g?.destroy();for(let c of p)c.destroy();n.remove(),o.destroy()}}}var nt=null,fi=4e3;function mi(e={}){if(nt)return nt;let t=gi(e,()=>t).catch(o=>{throw nt===t&&(nt=null),o});return nt=t,t}function hi(e,t){return new Promise((o,n)=>{let r=setTimeout(()=>n(new Error("timed out")),t);e.then(o,n).finally(()=>clearTimeout(r))})}async function gi(e,t){let o=document.documentElement.getAttribute("data-pipeup-doc"),{id:n,key:r}=o?await nn(o):{id:`page-${Ve(location.origin+location.pathname)}`,key:null},s,l=!1,a;if(e.store)s=e.store,a=await ct(s);else try{let p=dt.open();s=await hi(p,fi).catch(g=>{throw p.then(y=>y.close(),()=>{}),g}),a=await ct(s)}catch{s=new lt,l=!0,a=await ct(s)}let f=e.name?.trim();f&&f!==a.name&&(a={...a,name:f},await s.saveProfile(a));let d=await at.open({doc:n,key:r,store:s,identity:a.identity,name:a.name});Gt(e.slides??null);let h;try{h=Uo({doc:d,root:e.root??document.body,onName:async p=>{d.name=p,a={...a,name:p},await s.saveProfile(a)}})}catch(p){throw Gt(null),p}l&&h.ctx.xe("This browser can't keep comments for this page \u2014 copy the comments (Copy as Markdown) to keep them");let T=()=>void d.flush().catch(p=>globalThis.reportError?.(p)),M=!1;return window.addEventListener("pagehide",T),{document:d,flush:()=>d.flush(),unmount:()=>{M||(M=!0,window.removeEventListener("pagehide",T),h.destroy(),Gt(null),nt===t()&&(nt=null))}}}export{ot as ANIMALS,pn as COLOURS,Xn as DEFAULT_PROFILE_NAME,dt as IndexedDbStore,lt as MemoryStore,at as PipeupDocument,Se as UnsavedChangeError,rs as VERSION,Oe as animalName,gn as copyAll,hn as copyThread,Jt as createIdentity,ln as describeElement,an as describeRange,rt as formatAgo,qe as labelOf,ct as loadOrCreateProfile,un as locate,mi as mount,ue as nameOf,Jo as newDocumentAttribute,Gr as onReveal,nn as parseDocumentAttribute,Ct as resolveAnchor,jr as setViewState};
|
package/dist/pipeup.min.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
`}function uo(e){let{thread:t,location:o}=e,n=[ie(o.where)+(o.quote?`, on the text "${ie(o.quote)}"`:""),`${ie(ue(t.root))}: ${Dt(t.root," ")}`];for(let r of t.root.replies)n.push(` ${ie(ue(r))}: ${Dt(r," ")}`);return n.join(`
|
|
7
7
|
`)+`
|
|
8
8
|
`}function Dt(e,t){return e.deleted?"(deleted)":e.text.replace(/\r\n|\r|\n/g,`
|
|
9
|
-
`+t)+(e.edited?" (edited)":"")}function v(e,t={},...o){let n=document.createElement(e);for(let[r,s]of Object.entries(t))s===void 0||s===!1||(r==="class"?n.className=String(s):n.setAttribute(r,s===!0?"":s));for(let r of o)r!=null&&r!==!1&&n.append(r);return n}function ee(e,t){let o=e.getRootNode().activeElement;t&&o instanceof HTMLElement&&e.contains(o)&&o.blur(),e.inert=t}function qt(e,t,o=null){let n=e.getRootNode().activeElement,r=!1;for(let s=t.length;s--;o=t[s])t[s].nextSibling!==o&&(r=!!e.insertBefore(t[s],o));return r&&n&&t.some(s=>s.contains(n))&&n.focus({preventScroll:!0}),r}function ge(e,t){return e.length>t?e.slice(0,t-1)+"\u2026":e}function _e(e,t,o=4){e.style.left=`${t.left-o}px`,e.style.top=`${t.top-o}px`,e.style.width=`${t.width+o*2}px`,e.style.height=`${t.height+o*2}px`}var Or=/\bhttps?:\/\/[^\s<>"'`]+/gi,Ir=`.,;:!?'"]}`,Rr=2048,$r=/[\u202A-\u202E\u2066-\u2069]/;function Nr(e){let t=0,o=0;for(let r of e)r==="("?t++:r===")"&&o++;let n=e.length;for(;n>0;){let r=e[n-1];if(r===")"&&o>t)o--;else if(!Ir.includes(r))break;n--}return e.slice(0,n)}function _t(e){let t=[],o=0;for(let n of e.matchAll(Or)){if(n[0].length>Rr||$r.test(n[0]))continue;let r=Nr(n[0]),s=n.index??0,l;try{let f=new URL(r);if(f.protocol!=="http:"&&f.protocol!=="https:")continue;l=f.href}catch{continue}s>o&&t.push(e.slice(o,s));let a=v("a",{href:l,target:"_blank",rel:"noopener noreferrer"},r);a.addEventListener("click",f=>f.stopPropagation()),t.push(a),o=s+r.length}return o<e.length&&t.push(e.slice(o)),t}var Re={code:"KeyC",mods:{shift:!0,alt:!0,meta:!1,ctrl:!1},mac:{label:"\u21E7\u2325C",aria:"Shift+Alt+C"},other:{label:"Shift+Alt+C",aria:"Shift+Alt+C"}},po=typeof navigator<"u"&&/Mac|iP(hone|ad|od)/.test(navigator.platform),mt=(po?Re.mac:Re.other).label,yn=(po?Re.mac:Re.other).aria;function fo(e){return e.code===Re.code&&e.shiftKey===Re.mods.shift&&e.altKey===Re.mods.alt&&e.metaKey===Re.mods.meta&&e.ctrlKey===Re.mods.ctrl&&!e.repeat&&!e.getModifierState("AltGraph")}var mo="http://www.w3.org/2000/svg",Br={comment:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z","M12.3 8.2v6.6M9 11.5h6.6"],send:["M21 12L3.5 4.5 6.2 12l-2.7 7.5zM6.2 12H13"],copy:["M10 8h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z","M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"],resolve:["M5 12.5l4.5 4.5L19 7.5"],reopen:["M3 12a9 9 0 1 0 3-6.7","M3 4v5h5"],lines:["M4 7h16M4 12h10M4 17h7"],list:["M3 6.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 12a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 17.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M9 6.5h11M9 12h11M9 17.5h7"],expand:["M14 4h6v6M20 4l-6 6M10 20H4v-6M4 20l6-6M20 14v6h-6M20 20l-6-6M4 10V4h6M4 4l6 6"],pin:["M6 18v-6a6 6 0 1 1 6 6z"],shrink:["M20 10h-6V4M14 10l6-6M4 14h6v6M10 14l-6 6M14 20v-6h6M14 14l6 6M10 4v6H4M10 10L4 4"],bubble:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z"],close:["M6 6l12 12M18 6L6 18"],edit:["M4 20h4L19 9l-4-4L4 16z"]};function te(e,t=15,o){let n=bn(Br[e],t);return o&&n.setAttribute("stroke-width",String(o)),n}function bn(e,t){let o=document.createElementNS(mo,"svg"),n={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};for(let[r,s]of Object.entries(n))o.setAttribute(r,s);for(let r of e){let s=document.createElementNS(mo,"path");s.setAttribute("d",r),o.append(s)}return o}var Kt=(e,t,o)=>`M${e} ${t}a${o} ${o} 0 1 0 ${2*o} 0a${o} ${o} 0 1 0 -${2*o} 0`,Hr={Otter:"M4 13.2C4 9.2 7.6 6.5 12 6.5s8 2.7 8 6.7-3.6 6.3-8 6.3-8-2.3-8-6.3zM5.6 9.6a1.8 1.8 0 1 1 2.7-2.3M18.4 9.6a1.8 1.8 0 1 0-2.7-2.3M9.2 11.6h.01M14.8 11.6h.01M11 14h2l-1 1zM9.8 15.8l-3.2.4M9.9 17l-2.7 1.1M14.2 15.8l3.2.4M14.1 17l2.7 1.1",Fox:"M3.5 4l5 3.5h7l5-3.5-1.5 8.5L12 20l-7-7.5zM9 12h.01M15 12h.01M12 17h.01",Owl:`M5 4.5l3 2.5h8l3-2.5V14a7 7 0 0 1-14 0z${Kt(7.4,11.5,1.9)}${Kt(12.8,11.5,1.9)}M11.3 14.6l.7 1 .7-1`,Bear:`${Kt(5,13.5,7)}M8.9 7.22A2.8 2.8 0 1 0 5.89 10.09M18.11 10.09A2.8 2.8 0 1 0 15.1 7.22M9.4 12.6h.01M14.6 12.6h.01M10.3 16.4c0-1 .8-1.6 1.7-1.6s1.7.6 1.7 1.6-.8 1.6-1.7 1.6-1.7-.6-1.7-1.6z`,Rabbit:`${Kt(6.5,15.5,5.5)}M9.6 10.5C8.2 6.5 8.4 2.5 9.8 2.5s2.4 3.5 1.6 7.5M14.4 10.5c1.4-4 1.2-8-.2-8s-2.4 3.5-1.6 7.5M10 15h.01M14 15h.01M11.3 17.3l.7.5.7-.5`};function ho(e){let t=/[\p{L}\p{N}]/u.exec(e);if(!t)return"";let o=t[0].toUpperCase();return[...o].length===1?o:t[0]}var ht=(e,t)=>ho(t)||Le(e);function Qe(e,t){return v("span",{class:`av c${wn(e)}`,"aria-hidden":"true","data-animal":Le(e)},ho(t)||bn([Hr[Je[vn(e)]]],24))}var Dr=320;function Ut(e,t){setTimeout(()=>{e.remove(),t?.()},Dr)}function zt(e){return requestAnimationFrame(()=>{e.offsetWidth,e.classList.add("in")}),e}function Wt(e){let t=v("textarea",{class:"input",rows:"1","aria-label":e.label}),o=v("button",{class:"send",type:"button","aria-label":"Send",title:"Send",inert:!0},te("send")),n=v("div",{class:"row"},e.before,t,o),r=!1,s=()=>{let a=t.value.trim()!=="";o.classList.toggle("show",a),o.inert=!a,t.style.height="auto",t.style.height=`${Math.max(27,t.scrollHeight)}px`},l=async()=>{let a=t.value.trim();if(!(!a||r)){r=!0;try{await e.$(a),o.matches(":focus")&&t.focus(),t.value="",s()}catch{}finally{r=!1}}};return n.addEventListener("mousedown",a=>{a.target===t||o.contains(a.target)||(a.preventDefault(),t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length))}),t.addEventListener("input",s),t.addEventListener("keydown",a=>{a.stopPropagation(),a.key==="Enter"&&!a.shiftKey&&!a.isComposing?(a.preventDefault(),l()):a.key==="Escape"&&(a.preventDefault(),t.value="",s(),t.blur(),e.N?.())}),o.addEventListener("click",a=>{a.stopPropagation(),l()}),{element:n,input:t,focus:()=>t.focus({preventScroll:!0}),clear:()=>{t.value="",s()}}}function Fr(e){let t=v("button",{class:"me",type:"button",tabindex:"-1","aria-hidden":"true"});t.addEventListener("mousedown",y=>y.preventDefault());let o=Wt({label:"Comment",before:t,$:e.$,N:e.N}),n=v("div",{class:"say"}),r=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"}),s=v("div",{class:"nf"},r),l=v("div",{class:"you"},n,s),a="",f=!1,d=()=>{let y=e.name(),x=y?"change":"add your name";if(t.title=y?"Change your name":"Add your name",!t.lastChild||a!==y){let A=Qe(e.me,y),E=t.lastChild;E?(zt(A),Ut(E)):A.classList.add("in"),t.append(A),a=y}let C=v("button",{type:"button"},x);C.addEventListener("click",T),n.replaceChildren(v("span",{class:"nm"},y||`You're ${Le(e.me)}`)," \xB7 ",C)},h=y=>{l.classList.toggle("naming",y),ee(n,y),ee(s,!y)};function T(y){y.stopPropagation(),r.value=e.name(),h(!0),r.focus({preventScroll:!0}),r.select()}let M=()=>{h(!1),o.focus()};t.addEventListener("click",T),r.addEventListener("keydown",y=>{if(y.stopPropagation(),y.key==="Escape")y.preventDefault(),M();else if(y.key==="Enter"){y.preventDefault();let x=r.value.trim();if(!x||x===e.name())return M();if(f)return;f=!0,e.rename(x).finally(()=>{f=!1,d(),M()})}}),d(),h(!1);let p=v("div",{class:"ctx"},e.label);return{element:v("div",{class:"draft"},p,o.element,l),G:()=>{let{selectionStart:y,selectionEnd:x}=o.input;return()=>{o.focus(),o.input.setSelectionRange(y,x)}},B:y=>{p.hidden=y},V:y=>{p.textContent=y},focus:()=>o.focus(),se:()=>o.input.value.trim()===""}}function Yt(e,t){let o=Fr({label:t.label,me:e.doc.me,name:()=>e.c.name(),rename:n=>e.c.rename(n),$:n=>e.ae(n),N:()=>e.le()});return e.I(o),o}function jt(e,t){if(t.state==="orphaned"||!t.element||e.quote)return null;let o=t.element.getBoundingClientRect();if(!o.width&&!o.height)return null;if(e.point)return{x:o.left+e.point.x*o.width,y:o.top+e.point.y*o.height};let n=t.element.ownerDocument.createRange();n.selectNodeContents(t.element);let r=n.getBoundingClientRect();return{x:r.width?Math.min(o.right-8,r.right+6):o.right-8,y:(r.height?r.top:o.top)+8}}function gt(e){return e.range?[...e.range.getClientRects()]:[]}function xn(e,t){let o=gt(t)[0];if(o)return o.top;if(t.state==="orphaned"||!t.element)return null;let n=t.element.getBoundingClientRect();return e.point?n.top+e.point.y*n.height:n.top}function vt(e,t){let o=gt(t).at(-1);if(o)return{x:o.left,y:o.bottom,below:!0};let n=jt(e,t);return n?{...n,below:!1}:null}function go(e,t,o){for(let n of o)if(e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom)return!0;return!1}function vo(e,t,o=10){let n=[...e].sort((a,f)=>a.w-f.w),r=new Array(n.length).fill(0),s=n.findIndex(a=>a.id===t),l=a=>n[a];if(s<0)n.forEach((a,f)=>{r[f]=f===0?a.w:Math.max(a.w,(r[f-1]??0)+l(f-1).height+o)});else{r[s]=l(s).w;for(let a=s+1;a<n.length;a++)r[a]=Math.max(l(a).w,(r[a-1]??0)+l(a-1).height+o);for(let a=s-1;a>=0;a--)r[a]=Math.min(l(a).w,(r[a+1]??0)-l(a).height-o)}return new Map(n.map((a,f)=>[a.id,r[f]??0]))}var wt=320,et=300,Vr=480,tt=()=>window.innerWidth<=Vr;function Gt(e){let t=window.innerWidth;return{width:e&&!tt()?t-wt:t,height:window.innerHeight}}function Xt(e,t,o,n=12){let r,s;return e.below?(r=Math.min(e.x,o.width-t.width-n),s=e.y+8,s+t.height>o.height-n&&(s=e.y-t.height-40)):(r=e.x+14,r+t.width>o.width-n&&(r=e.x-t.width-28),s=Math.min(e.y-12,o.height-t.height-n)),{left:Math.max(n,r),top:Math.max(n,s)}}function wo(e,t,o,n=12,r=44){let s=e.top-r>=8,l=e.top+e.height+8+(s?0:r),a=e.top-8-(s?r:0)-t.height,f=l+t.height<=o.height-n||a<n,d=f?l:a;return{above:!f,left:Math.max(n,Math.min(e.left,o.width-t.width-n)),top:Math.max(n,d)}}function Jt(e,t,o){let n=e.top-t.height-10;return n<8&&(n=e.top+e.height+10),{left:Math.max(8,Math.min(e.left+e.width/2-t.width/2,o.width-t.width-8)),top:n}}function Zt(e,t){let o=e.resolved.get(t.id);return o?.range?.startContainer??o?.element??null}var Ke=e=>(t,o)=>{let n=Zt(e,t),r=Zt(e,o),s=l=>l.anchor.point??{x:0,y:-1};return n!==r?!r||n&&n.compareDocumentPosition(r)&4?-1:1:s(t).y-s(o).y||s(t).x-s(o).x};var Qt=e=>`${e} ${e===1?"reply":"replies"}`;function ct(e,t,o){let n={...o},r=e.id,s=v("div",{class:"rbox always"},v("div",{},Wt({label:"Reply",$:x=>t.reply(r,x),N:t.close}).element)),l=v("div",{}),a=v("div",{}),f=null,d=v("div",{},a,v("div",{class:"more"},l)),h=new Map,T=new Map,M=new Map,p=x=>{let C=ht(x.author,x.name),A=h.get(x.id),E=A?.e;if((!E||A.key!==C)&&(E=zt(Qe(x.author,x.name)),A)){let k=A.e;M.set(x.id,k),Ut(k,()=>M.get(x.id)===k&&M.delete(x.id))}E.title=ue(x),T.set(x.id,{key:C,e:E});let P=M.get(x.id);return P?[P,E]:[E]},g=(x,C,A)=>{let E=v("button",{class:"ib",type:"button","aria-label":C,title:C},te(x));return E.addEventListener("click",P=>{P.stopPropagation(),A()}),E};function y(x,C={}){Object.assign(n,C),r=x.id;let A=(n.now??Date.now)(),E=x.root.replies.length,P=j=>v("span",{class:"who"},`${ue(j)} \xB7 ${Ze(j.at,A)}`),k=j=>v("div",{class:j.deleted?"tx del":"tx"},...j.deleted?["Deleted"]:[..._t(j.text),j.edited?" (edited)":""]),q=x.resolved?"Resolved"+(E?` \xB7 ${Qt(E)}`:""):E?Qt(E):"",W=v("div",{class:n.H==="column"&&q?"ft has-rest":"ft"},n.H==="column"&&q?v("span",{class:"rest"},q):null,v("span",{class:"hover"},P(x.root),v("span",{class:"acts"},g("copy","Copy thread",()=>t.copy(x.id)),x.resolved?g("reopen","Reopen",()=>void t.reopen(x.id)):g("resolve","Resolve",()=>void t.resolve(x.id))))),F=n.lost?v("div",{class:"ctx"},`${n.place||"No longer on the page"} \u2014 it read \u201C${ge(n.lost,120)}\u201D`):n.quote?v("div",{class:"ctx"},`\u201C${ge(n.quote,80)}\u201D`):null;T=new Map;let Y=v("div",{class:"root"},...p(x.root),F,k(x.root),W);a.replaceWith(Y),a=Y,f?.remove(),f=E?v("div",{class:"rps"},...x.root.replies.map(j=>v("div",{class:"it"},...p(j),k(j),v("div",{class:"rft"},P(j))))):null,f&&l.prepend(f),h=T,x.resolved?s.remove():s.parentNode!==l&&l.append(s),d.className=x.resolved?"thread resolved":"thread",d.setAttribute("data-thread",x.id)}return y(e),{element:d,update:y}}var qr="a,button,input,select,textarea,label,summary,[role=button],[contenteditable]",_r=400;function En(e,t){let o=new Map,n=v("div",{class:"tip",role:"tooltip"}),r=v("div",{class:"mark"}),s=v("div",{class:"pop",role:"dialog","aria-label":"Comment thread"});n.inert=s.inert=!0,e.n.append(r,n,s);let l=v("div",{class:"bub pin ghost","aria-hidden":"true"}),a=[],f=null,d=null,h=null,T=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,M=0,p=null,g=null,y=null,x=0,C=b=>a.find(O=>O.id===b)??null,A=()=>t.q||e.state.l,E=!1,P=b=>{let O=e.resolved.get(b.id);return O?vt(b.anchor,O):null};function k(b,O,$){let{left:K,top:X}=Xt(O,{width:b.offsetWidth||$,height:b.offsetHeight},Gt(e.state.l));b.style.left=`${K}px`,b.style.top=`${X}px`}function q(b){let O=b&&A()&&e.state.o!==b?C(b):null,$=O?P(O):null;if(!O||!$){y=null,n.classList.remove("show"),ee(n,!0);return}if(y!==O.id){let K=O.root.replies.length;n.replaceChildren(v("div",{class:"tx clamp"},...O.root.deleted?["Deleted"]:_t(O.root.text)),v("div",{class:"who"},`${ue(O.root)}${K?` \xB7 ${K} ${K===1?"reply":"replies"}`:""}`)),y=O.id}k(n,$,260),n.classList.contains("show")||n.offsetWidth,n.classList.add("show"),n.inert=!1}function W(b){p=b,q(b),e.E(b)}function F(b){if(window.clearTimeout(x),b!==null){W(b);return}x=window.setTimeout(()=>W(null),A()?_r:0)}n.addEventListener("mouseenter",()=>window.clearTimeout(x)),n.addEventListener("mouseleave",()=>F(null)),n.addEventListener("click",b=>{b.stopPropagation();let O=y;O&&(window.clearTimeout(x),W(null),e.open(O))});function Y(b){let O=o.get(b.id);if(O)return O;let $=v("button",{class:"bub",type:"button","data-thread":b.id});return $.addEventListener("mouseenter",()=>F(b.id)),$.addEventListener("mouseleave",()=>F(null)),$.addEventListener("click",K=>{K.stopPropagation(),q(null),e.open(b.id)}),e.n.insertBefore($,r),o.set(b.id,$),$}let j=!1;function B(){let b=e.state.t,O=h&&b&&!b.anchor.quote&&!b.anchor.point?b.resolved.element:null;if(O){let{left:K,top:X,above:V}=wo(O.getBoundingClientRect(),{width:s.offsetWidth||et,height:s.offsetHeight},{width:window.innerWidth,height:window.innerHeight}),_=h?.above!==null&&h?.above!==V;if(h&&(h.above=V),_&&ce())return;s.style.left=`${K}px`,s.style.top=`${X}px`;return}let $=h&&b?vt(b.anchor,b.resolved):f?P(f):null;$&&k(s,$,et)}let se=b=>e.state.s&&!b.anchor.quote&&!b.anchor.point;function ce(){return window.clearTimeout(M),T?(s.classList.remove("show"),M=window.setTimeout(()=>{B(),s.classList.add("show")},220),!0):(s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450),!1)}function ve(b){if(window.clearTimeout(M),T){s.classList.remove("show"),M=window.setTimeout(()=>{h?.i.V(b),B(),s.classList.add("show")},220);return}h?.i.V(b),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)}function de(){if(!A())return null;let b=e.state.t;return b?b.anchor.quote||b.anchor.point||e.state.s?null:b.resolved.element:!f||f.anchor.quote||f.anchor.point?null:e.resolved.get(f.id)?.element??null}function oe(b){a=b;let O=new Set;for(let V of b){if(!e.R(V)||V.anchor.quote)continue;let _=e.resolved.get(V.id);if(!_||_.state==="orphaned")continue;O.add(V.id);let Q=Y(V);Q.classList.toggle("done",V.resolved),Q.classList.toggle("on",e.state.o===V.id),Q.classList.toggle("pin",V.anchor.point!==void 0);let fe=`Comment on ${Ie(_.element)}: ${ge(V.root.text,60)}`;Q.getAttribute("aria-label")!==fe&&Q.setAttribute("aria-label",fe)}qt(e.n,b.filter(V=>O.has(V.id)).sort(Ke(e)).map(V=>o.get(V.id)),r);for(let[V,_]of o)O.has(V)||(_.classList.remove("in"),o.delete(V),window.setTimeout(()=>_.remove(),300));q(p),E!==e.state.l&&s.classList.contains("show")&&!T&&(window.clearTimeout(M),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)),E=e.state.l;let $=t.q?e.state.t:null;if($){let V=$.anchor.point??$.resolved.element;h?.of!==$?(window.clearTimeout(M),s.classList.remove("glide"),h={i:Yt(e,$),of:$,at:V,above:null},h.i.B(se($)),s.replaceChildren(h.i.element),s.inert=!1,h.i.focus(),f=null,d=null,B(),s.classList.add("show")):h&&(h.at!==V&&(h.at=V,h.above=null,ve($.label)),h.i.B(se($)));let _=!e.d.p($.anchor.view);_!==j&&(j=_,s.classList.toggle("show",!_),s.inert=_,_||B());return}h&&(window.clearTimeout(M),s.classList.remove("glide"),h=null,j=!1,e.I(null));let K=A()&&e.state.o?C(e.state.o):null;if(!K||!e.R(K)){f=null,d=null,s.classList.remove("show"),ee(s,!0);return}let X=K.anchor.quote?.exact??null;!f||!d||f.id!==K.id?(d=ct(K,e.D,{H:"popover",quote:X}),s.replaceChildren(d.element),f=K,B(),s.classList.add("show"),s.inert=!1):f!==K&&(d.update(K,{quote:X}),f=K)}function pe(){for(let[K,X]of o){let V=C(K),_=e.resolved.get(K),Q=V&&_?jt(V.anchor,_):null;if(!Q||Q.y<-40||Q.y>window.innerHeight+40){X.style.visibility="hidden";continue}X.style.visibility="",X.style.left=`${Q.x}px`,X.style.top=`${Q.y}px`,X.classList.contains("in")||(X.offsetWidth,X.classList.add("in"))}let b=e.state.t,O=b?.anchor.point&&e.d.p(b.anchor.view)?jt(b.anchor,b.resolved):null;O?(l.style.left=`${O.x}px`,l.style.top=`${O.y}px`,l.classList.contains("in")||(e.n.insertBefore(l,r),l.offsetWidth,l.classList.add("in"))):l.classList.contains("in")&&(l.classList.remove("in"),window.setTimeout(()=>l.classList.contains("in")||l.remove(),300)),s.classList.contains("show")&&B();let $=de();r.classList.toggle("show",$!==null),$&&_e(r,$.getBoundingClientRect(),4)}let Ae=b=>{if(e.f(b)){let $=b.composedPath()[0];g!==null&&!($ instanceof Element&&$.closest(".tip,.bub"))&&F(null),g=null;return}let O=e._(b.clientX,b.clientY)?.id??null;O!==g&&(g=O,F(O))},we=b=>{if(e.f(b))return;let O=window.getSelection();if(O&&!O.isCollapsed||(e.state.s?b.altKey:b.target instanceof Element&&b.target.closest(qr)))return;let $=e._(b.clientX,b.clientY);$&&(e.X(b),q(null),e.open($.id))};return window.addEventListener("pointermove",Ae,{capture:!0,passive:!0}),window.addEventListener("click",we,!0),{u:oe,M:pe,destroy(){window.clearTimeout(x),window.clearTimeout(M),window.removeEventListener("pointermove",Ae,!0),window.removeEventListener("click",we,!0),e.I(null);for(let b of o.values())b.remove();l.remove(),n.remove(),r.remove(),s.remove()}}}var Kr={display:"block",position:"static",clips:!1,off:!1},Ur=48,zr="button link img figure region list listitem tab tabpanel article navigation complementary banner contentinfo form search group dialog menu menuitem checkbox switch radio slider textbox combobox option row cell heading table".split(" ").map(e=>`[role=${e}]`),Wr=["button,a,input,select,textarea,label,summary,details,img,svg,canvas,video,picture,figure,figcaption,table,th,td","li,ul,ol,dl,dt,dd,p,h1,h2,h3,h4,h5,h6,blockquote,pre","section,article,aside,nav,header,footer,main,form,fieldset",...zr].join(","),kn="a,button,label,summary,[role=button],[role=link],[role=tab],[role=option],[role=menuitem]",Yr=`${kn},input,select,textarea,img,svg,canvas,video,picture,[role=img]`,yo=24,jr=.6,en=2,Tn=(e,t)=>Math.abs(e.left-t.left)<=en&&Math.abs(e.top-t.top)<=en&&Math.abs(e.width-t.width)<=en&&Math.abs(e.height-t.height)<=en;function bo(e,t){let o=t.i(e);if(o.width<2||o.height<2)return!1;if(e.hasAttribute("data-pipeup-id"))return!0;let n=t.K();return o.width*o.height<=jr*n.width*n.height&&(e.matches(Wr)||t.ce(e)||e.childElementCount>1&&!e.parentElement?.closest(kn)&&t.de(e))}function yt(e,t,o){if(e===t||!t.contains(e)||e.closest("[data-pipeup-ignore]"))return null;let n=null;for(let s=e;s&&s!==t&&!n;s=s.parentElement)bo(s,o)&&(n=s);if(!n||n.hasAttribute("data-pipeup-id"))return n;let r=o.i(n);for(let s=n.parentElement;s&&s!==t&&Tn(o.i(s),r);s=s.parentElement)if(s.hasAttribute("data-pipeup-id"))return s;return n}function Sn(e,t,o){let n=o.i(e);for(let r=e.parentElement;r&&r!==t;){let s=yt(r,t,o);if(!s)return null;if(!Tn(o.i(s),n))return s;r=s.parentElement}return null}function xo(e=window){return{i:t=>t.getBoundingClientRect(),ce:t=>{let o=e.getComputedStyle(t),n=o.backgroundColor!=="transparent"&&!/,\s*0\)$/.test(o.backgroundColor),r=["top","right","bottom","left"].some(s=>parseFloat(o.getPropertyValue(`border-${s}-width`))>0);return n||r||o.backgroundImage!=="none"||o.boxShadow!=="none"},de:t=>/^(inline-)?(flex|grid)$/.test(e.getComputedStyle(t).display),flow:t=>{let o=e.getComputedStyle(t),n=[o.overflowX,o.overflowY];return{display:o.display,position:o.position,clips:n.some(r=>r==="hidden"||r==="clip")&&!n.some(r=>r==="auto"||r==="scroll")&&t!==e.document.documentElement&&t!==e.document.body,off:o.pointerEvents==="none"}},K:()=>({width:e.innerWidth,height:e.innerHeight})}}var Gr=(e,t)=>e.left<t.left+t.width&&t.left<e.left+e.width&&e.top<t.top+t.height&&t.top<e.top+e.height,Xr=(e,t)=>{let o=Math.max(e.left,t.left),n=Math.max(e.top,t.top);return{left:o,top:n,width:Math.max(0,Math.min(e.left+e.width,t.left+t.width)-o),height:Math.max(0,Math.min(e.top+e.height,t.top+t.height)-n)}};function Ln(e,t,o=()=>!0){let n=[],r=(s,l,a,f,d,h)=>{for(let T of s.children){if(T.hasAttribute("data-pipeup-ignore")||T.getAttribute("aria-hidden")==="true"||!o(T))continue;let M=t.flow?.(T)??Kr,p=T.offsetParent,g=M.position==="fixed"||M.position==="absolute"&&!!f&&!(p&&f.contains(p)),y=g?null:a,x=t.i(T),C=x.width>0&&x.height>0;if(y&&C&&!Gr(x,y))continue;let A=T.matches(kn),P=(M.display.startsWith("inline")||h)&&!T.matches(Yr)&&(M.display==="inline"||x.height<=Ur),k=x.width<=yo&&x.height<=yo,q=T.hasAttribute("data-pipeup-id")||!d&&!M.off&&!P&&!(k&&!A),W=l;q&&bo(T,t)&&(l&&Tn(t.i(l.e),x)?(T.hasAttribute("data-pipeup-id")||!l.e.hasAttribute("data-pipeup-id"))&&(l.e=T):n.push(W={e:T,C:l,m:0}));let F=M.clips&&C;r(T,W,F?y?Xr(y,x):x:y,F?T:g?null:f,d||A,/^inline-(flex|grid)$/.test(M.display)||h&&/(flex|grid)$/.test(M.display))}};r(e,null,null,null,!1,!1);for(let s=n.length-1;s>=0;s--){let l=n[s];l.C&&(l.C.m=Math.max(l.C.m,l.m+1))}return n}var nt=(e,t)=>e.filter(o=>o.m<=t&&(!o.C||o.C.m>t)),Eo=(e,t)=>e.filter(o=>o.C===t);var tn="a,button,summary,[role=button],[role=link],[role=switch],[role=tab],[role=checkbox],input[type=checkbox],input[type=radio],input[type=submit],input[type=button],input[type=reset]",Jr=`${tn},input,select,textarea,[contenteditable]:not([contenteditable=false]),[tabindex]:not([tabindex="-1"])`,ko=["click","dblclick","auxclick","submit","contextmenu","dragstart"],To=[...["over","out","enter","leave","down","up"].flatMap(e=>[`pointer${e}`,`mouse${e}`]),"mousemove","touchstart","touchmove","touchend","touchcancel"],Zr=400,An="Tab moves between blocks \xB7 \u2191 \u2193 change level \xB7 Enter comments \xB7 Esc to finish \xB7 F7 selects text",Qr=4,ei=150;function So(e,t=xo()){let o=v("span",{hidden:!0},An),n=v("div",{class:"pick"},o),r=[0,1].map(()=>{let i=v("div",{class:"km",tabindex:"-1",role:"button"},v("span",{hidden:!0}),v("span",{hidden:!0}));return i.inert=!0,i.addEventListener("keydown",Tt),i.addEventListener("click",u=>{u.stopPropagation(),Ye()}),i.addEventListener("focus",()=>n.classList.add("kf")),i.addEventListener("blur",()=>n.classList.remove("kf")),i}),s=v("span",{class:"lbl"}),l=(i,u,w,N)=>{let z=v("button",{class:"nb",type:"button","aria-label":i,title:u},te(w,16));return z.addEventListener("click",J=>{J.stopPropagation(),N()}),z},a=l("Around it","Select the block around it","expand",le),f=l("Inside it","Select a block inside it","shrink",Ce),d=l("Pin","Pin its centre","pin",()=>e.J(()=>_(g??k,{x:.5,y:.5}))),h=v("div",{class:"namebar",role:"group","aria-label":"Chosen block"},s,a,f,d);h.inert=!0;let T=e.n.querySelector(".launch");for(let i of[n,...r,h])e.n.insertBefore(i,T);h.addEventListener("mousedown",i=>i.preventDefault());let M=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,p=null,g=null,y=null,x=null,C=0,A=()=>{},E=null,P=()=>{},k=null,q=0,W=0,F=!1,Y=null,j=null,B=null,se=0,ce=-1,ve=!0,de=null,oe=null,pe=i=>!e.f(i)&&!(i.target instanceof Element&&i.target.closest("[data-pipeup-ignore]"));function Ae(){x&&(n.classList.toggle("glide",performance.now()<C),_e(n,x.getBoundingClientRect(),4))}function we(){if(!E)return;h.classList.toggle("glide",performance.now()<C&&h.classList.contains("show"));let i=E.getBoundingClientRect(),{left:u,top:w}=Jt({left:i.left,top:i.top,width:i.width,height:i.height},{width:h.offsetWidth||200,height:h.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});h.style.left=`${u}px`,h.style.top=`${w}px`}function b(i,u){x=i,C=u?performance.now()+Zr:0,Ae(),n.classList.add("show")}function O(i,u){let w=getComputedStyle(i);if(w.opacity==="0")return u(),()=>{};let N=0,z=()=>{window.clearTimeout(N),i.removeEventListener("transitionend",Se)},J=()=>{z(),u()},Se=ne=>{ne.target===i&&ne.propertyName==="opacity"&&J()},je=Math.max(...w.transitionDuration.split(",").map(ne=>parseFloat(ne)*1e3||0));return N=window.setTimeout(J,je+100),i.addEventListener("transitionend",Se),z}function $(i){if(i!==p){if(p=i,A(),!i){n.classList.remove("show");return}getComputedStyle(n).opacity==="0"?b(i,!1):M?(n.classList.remove("show"),A=O(n,()=>b(i,!1))):b(i,!0)}}function K(i){g=i,n.classList.toggle("on",i!==null),$(i),X(i)}function X(i){P(),h.inert=!i,i?M?(h.classList.remove("show"),P=O(h,()=>V(i))):V(i):(h.classList.remove("show"),E=null)}function V(i){s.textContent=s.title=Ie(i),a.hidden=Sn(i,e.root,t)===null,f.hidden=(k?D(i).length:Ln(i,t,ze).length)===0;let u=h.classList.contains("show");E=i,we(),u||(h.offsetWidth,h.classList.add("show"))}function _(i,u){let w;try{w=Bt(i,e.root,u,e.d.view(i))}catch(J){e.Z(J);return}let N={anchor:w,label:u?`Pin on ${Ie(i).replace(/^[A-Z](?=[a-z])/,J=>J.toLowerCase())}`:Ie(i),ranges:[],resolved:{state:"attached",element:i,range:null}},z=e.state.t;k&&(k=i,ce=-1),K(u?null:i),y=z??{...N,ranges:[]},z?e.ue({...N,ranges:[]}):e.Q(y),e.T(u?N.label:`Commenting on ${N.label}`)}function Q(i){e.J(()=>_(i))}function fe(i){let u=(i.target instanceof Element?yt(i.target,e.root,t):null)??e.root;u!==e.root&&(Y=u);let w=u.getBoundingClientRect();w.width&&w.height&&_(u,{x:(i.clientX-w.left)/w.width,y:(i.clientY-w.top)/w.height})}function $e(i){let u=window.getSelection();if(u&&!u.isCollapsed)return;if(e.state.t&&(i.altKey||!e.S())){e.F();return}if(!i.altKey&&e._(i.clientX,i.clientY))return;if(e.state.o&&e.open(null),k&&i.detail&&I(),i.altKey){fe(i);return}let w=i.target instanceof Element?yt(i.target,e.root,t):null;w&&(Y=w),w?_(w):(e.F(),K(null))}let Ue=i=>{if(e.f(i))return;if(!pe(i)){g||$(null);return}if(i.stopPropagation(),g||e.state.t)return;let u=!G()&&i.target instanceof Element?yt(i.target,e.root,t):null;if(k){if(!u||u===k||(se+=Math.abs(i.movementX)+Math.abs(i.movementY),se<=Qr))return;I()}u&&(Y=u),$(u)},G=()=>{let i=window.getSelection();return!!i&&!i.isCollapsed&&i.toString().trim()!==""},ye=()=>{G()&&(k&&I(),g||$(null))},Me=i=>{pe(i)&&(i.stopPropagation(),(i.type==="pointerdown"||i.type==="mousedown")&&i.target instanceof Element&&i.target.closest(Jr)&&i.preventDefault())},Ne=i=>{if(!pe(i))return;let u=i.target;if((u===oe||u.form&&u.form===oe?.form)&&(i.type==="submit"||i.type==="click"&&!i.detail)){oe=i.type==="click"&&u.type==="submit"?u.form:null;return}i.preventDefault(),i.stopPropagation(),i.type==="click"&&!e.state.c&&!e.pe(i)&&$e(i)},Be=i=>{if(oe=null,De="",i.key==="Tab"&&be(i))return i.preventDefault(),i.stopPropagation(),De=i.key,e.state.o&&e.open(null),e.state.c&&(e.state.c=!1,e.u()),U(i.shiftKey?-1:1);if(!(!pe(i)||!(i.target instanceof Element)))if((i.key==="Enter"||i.key===" ")&&i.target.closest(tn)){if(!k){oe=i.target;return}i.preventDefault(),i.stopPropagation()}else i.key==="Enter"&&!k&&i.target.form&&(oe=i.target)},be=i=>{if(i.ctrlKey||i.metaKey||i.altKey||i.isComposing)return!1;let u=i.composedPath()[0];return!(u instanceof Element)||r.some(w=>w===u)?!1:e.f(i)?!!u.closest(".launch,.menu")&&!u.closest("input,textarea,select,[contenteditable]"):!i.composedPath().some(w=>w instanceof Element&&w.hasAttribute("data-pipeup-ignore"))},xe=()=>e.n.getRootNode().activeElement,re=()=>r.some(i=>i===xe()),ze=i=>(i.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1||getComputedStyle(i).display==="contents")&&e.d.p(e.d.view(i)),ae=()=>(de?.some(i=>!i.e.isConnected)&&(de=null),de??=Ln(e.root,t,ze)),He=i=>ae().find(u=>u.e===i),Ee=(i,u=!1)=>{let w=i.getBoundingClientRect();return w.bottom>0&&w.top<window.innerHeight&&(!u||w.top>=0)},ke=()=>{let i=nt(ae(),0);return i.find(u=>Ee(u.e,!0))??i.find(u=>Ee(u.e))??i[0]},Te=i=>e.doc.threads().filter(u=>e.R(u)&&i.contains(Zt(e,u))).sort(Ke(e));function We(i,u){let[w,N]=i.children,z=nt(ae(),q),J=Te(u).length;w.textContent=`${Pt(u)}, ${z.findIndex(ne=>ne.e===u)+1} of ${z.length}${J?`, has ${J} comment${J===1?"":"s"}`:""}`;let Se=(u.innerText??u.textContent??"").length<=ei;N.textContent=mn(u);let je=ve?[o]:[];ve=!1,i.ariaLabelledByElements!==void 0?(i.ariaLabelledByElements=Se?[w,u]:[w,N],i.ariaDescribedByElements=Se?je:[...je,u]):i.setAttribute("aria-label",`${w.textContent}, ${N.textContent}`)}function m(i,u=!0){se=0;let w=ae(),N=w.find(J=>J.e===i);if(N&&!nt(w,q).includes(N)&&(q=N.m),i!==k&&(ce=-1),i!==g&&(g=null),k=i,$(i),X(i),i.scrollIntoView({block:"nearest",inline:"nearest",behavior:M?"auto":"smooth"}),!u)return;e.fe();let z=r[W^=1];We(z,i),_e(z,i.getBoundingClientRect(),4),z.inert=!1,z.focus({preventScroll:!0}),r[W^1].inert=!0}function S(){de=null;let i=document.activeElement;j=xe()??i;let u=He(Y),w=u??(i&&i!==document.body&&e.root.contains(i)&&!i.closest("[data-pipeup-ignore]")?ae().filter(N=>N.e.contains(i)).pop():void 0)??ke();return w?(u||(q=w.m),F=!0,m(w.e),!0):!1}function I(){let i=re();Y=k,k=null,$(null),X(null);for(let u of r)ee(u,!0);return i}function R(){let i=j;i&&i!==document.body&&i.isConnected&&i.focus?.({preventScroll:!0}),(!i||i===document.body||!i.matches?.(":focus"))&&e.n.querySelector(".launch .mode")?.focus({preventScroll:!0})}function D(i){let u=He(i);return u?Eo(ae(),u):[]}function H(i){let u=nt(ae(),q),w=u.findIndex(z=>z.e===k),N=u[w<0?i>0?0:u.length-1:(w+i+u.length)%u.length];N&&m(N.e)}function U(i){if(k)return H(i);de=null;let u=document.activeElement;j=xe()??u;let w=Y?.isConnected?Y:null,N=w&&He(w),z;if(N){q=N.m;let J=nt(ae(),q),Se=J.indexOf(N);z=J[(Se+i+J.length)%J.length]}else if(w){q=0;let J=nt(ae(),0),Se=ne=>(w.compareDocumentPosition(ne.e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0,je=ne=>ne.e.contains(w);i>0?z=J.find(ne=>Se(ne)&&!je(ne))??J[0]:z=J.filter(ne=>!Se(ne)&&!je(ne)).pop()??J[J.length-1]}else z=ke(),z&&(q=z.m);if(!z)return e.T("Nothing here to comment on");F=!0,m(z.e)}function le(){let i=g??k,u=i&&Sn(i,e.root,t);if(!u)return e.T("Nothing around it");if((!B||!i.contains(B))&&(B=i),g)return Q(u);m(u)}function Ce(){let i=g??k,u=i?D(i):[],w=u.find(N=>B&&N.e.contains(B))??u.find(N=>Ee(N.e))??u[0];if(!w)return e.T("Nothing inside it");g?Q(w.e):m(w.e)}function Ye(i=!1){if(!k)return;if(e.state.t&&!e.S())return e.he();if(!i)return _(k);let u=Te(k);if(!u.length)return e.T("No comments on this block");ce=(ce+1)%u.length,e.open(u[ce].id),u.length>1&&e.T(`Comment ${ce+1} of ${u.length} on this block`)}function Tt(i){if(["Tab","ArrowUp","ArrowDown","Enter"," ","Escape"].includes(i.key)&&!(i.key.startsWith("Arrow")&&(i.metaKey||i.ctrlKey||i.altKey))){if(i.preventDefault(),i.stopPropagation(),De=i.key,i.key==="Escape")return void e.U();if(i.key==="Enter"||i.key===" ")return Ye(i.shiftKey&&i.key==="Enter");e.state.o&&e.open(null),i.key==="Tab"?H(i.shiftKey?-1:1):i.key==="ArrowUp"?le():Ce()}}let dt=()=>{let i=xe();return i?!!i.closest("[inert]"):!document.activeElement||document.activeElement===document.body},De="",c=!1,L=i=>{c&&window.removeEventListener("keyup",L,!0),i.key===De&&(De="",i.preventDefault(),i.stopPropagation())};window.addEventListener("keyup",L,!0),window.addEventListener("pointermove",Ue,!0),document.addEventListener("selectionchange",ye);for(let i of To)window.addEventListener(i,Me,!0);for(let i of ko)window.addEventListener(i,Ne,!0);return window.addEventListener("keydown",Be,!0),{U(){return g?(K(null),!0):!1},z:()=>k!==null,ge:()=>F&&!k,ee:S,W(){k&&!re()&&m(k)},u(){if(de=null,k&&!(k.isConnected&&ze(k))){let w=ke();w?m(w.e,re()||dt()):I()}let i=e.n.querySelector(".launch");if(i&&h.nextElementSibling!==i&&!re()&&!h.contains(xe()))for(let w of[n,...r,h])e.n.insertBefore(w,i);let u=e.state.t;y&&u!==y?(y=null,K(null),k&&m(k,dt())):u&&!y&&(p||g)&&K(null)},M(){Ae(),we(),k&&_e(r[W],k.getBoundingClientRect(),4)},destroy(){I()&&R();for(let i of r)i.remove();A(),P(),c=!0,De||window.removeEventListener("keyup",L,!0),window.removeEventListener("pointermove",Ue,!0),document.removeEventListener("selectionchange",ye);for(let i of To)window.removeEventListener(i,Me,!0);for(let i of ko)window.removeEventListener(i,Ne,!0);window.removeEventListener("keydown",Be,!0),n.classList.remove("show"),h.classList.remove("show"),ee(h,!0),O(n,()=>n.remove()),O(h,()=>h.remove())}}}var ti=300,ni=32,Mn=220,bt=320,oi=24,Lo=24;function Cn(e,t=!1){let o=e.ownerDocument.documentElement,n=o.getAttribute("data-pipeup-layout");if(n==="bubbles"||e.querySelector("[data-pipeup-slide]"))return null;let r=e.querySelector("article, main, [role=main]")??(n==="column"?e:null);if(!r)return null;if(o.hasAttribute("data-pipeup-reserve")){let a=o.clientWidth,d=getComputedStyle(r).maxWidth,h;return d.endsWith("px")?h=parseFloat(d):d.endsWith("%")?h=parseFloat(d)/100*a:h=r.getBoundingClientRect().width,n!=="column"&&a<h+bt-(t?oi:0)?null:{x:a-bt+Lo,width:bt-2*Lo}}let s=r.getBoundingClientRect().right;if(window.innerWidth-s<ti&&n!=="column")return null;let l=s+ni;return{x:l,width:Math.max(220,Math.min(300,window.innerWidth-l-16))}}function Pn(e,t){let o=e.resolved.get(t.id);return!o||o.state==="orphaned"&&!e.te.has(t.id)}function Ao(e){let t=v("div",{class:"col"});e.n.append(t);let o=new Map,n=null,r=new ResizeObserver(()=>a()),s=p=>Pn(e,p);function l(p){let g=e.resolved.get(p.id),y=g?xn(p.anchor,g):null;return y===null?Number.POSITIVE_INFINITY:y+window.scrollY-4}function a(){let p=[],g=[];for(let[E,P]of o){let k=l(P.thread);if(Number.isFinite(k))P.placed=k;else if(e.te.has(E)){if(P.placed===null){P.e.classList.add("wait");continue}k=P.placed}Number.isFinite(k)?p.push({id:E,w:k,height:P.e.offsetHeight}):g.push({id:E,height:P.e.offsetHeight})}let y=e.state.t,x=y?xn(y.anchor,y.resolved):null;n&&x!==null&&p.push({id:"draft",w:x+window.scrollY-4,height:n.e.offsetHeight});let C=vo(p,n?"draft":e.state.o),A=Math.max(0,...p.map(E=>(C.get(E.id)??0)+E.height))+24;for(let E of g)C.set(E.id,A),A+=E.height+10;for(let[E,P]of o){if(P.e.classList.contains("wait")){if(!C.has(E))continue;P.e.style.transition="none",P.e.style.transform=`translateY(${Math.round(C.get(E))}px)`,P.e.offsetWidth,P.e.style.transition="",P.e.classList.remove("wait");continue}P.e.style.transform=`translateY(${Math.round(C.get(E)??0)}px)`}n&&(n.e.style.transform=`translateY(${Math.round(C.get("draft")??0)}px)`)}function f(p,g){p.thread=g,p.lost=s(g),p.view.update(g,{lost:p.lost?g.anchor.snapshot:null})}function d(p){let g=s(p),y=ct(p,e.D,{H:"column",lost:g?p.anchor.snapshot:null}),x=v("div",{class:"th","data-thread":p.id},v("button",{class:"opn sr",type:"button","data-thread":p.id}),y.element);return x.style.transition="none",x.addEventListener("mouseenter",()=>e.E(p.id)),x.addEventListener("mouseleave",()=>e.E(null)),x.addEventListener("click",()=>e.open(p.id)),t.append(x),r.observe(x),{e:x,thread:p,lost:g,placed:null,view:y}}function h(){let p=e.state.t;if(n&&p&&n.of!==p){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Mn),n=null}if(p&&n&&(n.i.V(p.label),n.i.B(e.state.s&&!p.anchor.quote&&!p.anchor.point)),p&&!n){let g=Yt(e,p),y=v("div",{class:"th on"},g.element);y.style.transition="none",t.append(y),r.observe(y),n={e:y,i:g,of:p},g.B(e.state.s&&!p.anchor.quote&&!p.anchor.point),g.focus()}else if(!p&&n){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Mn),n=null,e.I(null)}}function T(p){ee(t,e.state.l);let g=new Set,y=[],x=e.state.o!==null||e.state.t!==null;for(let C of p){if(!e.R(C))continue;g.add(C.id);let A=o.get(C.id);A?(A.thread!==C||A.lost!==s(C))&&f(A,C):(A=d(C),o.set(C.id,A),y.push(A.e));let E=A.e,P=e.state.o===C.id;E.classList.toggle("on",P);let k=E.firstElementChild,q=C.root.replies.length;k.setAttribute("aria-label",`Open thread: ${ge(C.root.text,60)}, ${Qt(q)}`),k.setAttribute("aria-expanded",String(P)),ee(k,P);let W=E.querySelector(".more");W&&ee(W,!P),E.classList.toggle("dim",x&&!P),E.classList.toggle("hot",e.state.E===C.id&&!P),E.classList.toggle("resolved",C.resolved),E.classList.toggle("lost",A.lost)}for(let[C,A]of o)g.has(C)||(o.delete(C),r.unobserve(A.e),A.e.classList.add("out"),window.setTimeout(()=>A.e.remove(),Mn));h(),qt(t,p.filter(C=>g.has(C.id)).sort(Ke(e)).map(C=>o.get(C.id).e),n?.e??null)&&t.offsetWidth,a(),n&&y.push(n.e);for(let C of y)C.offsetWidth,C.style.transition=""}function M(){let p=Cn(e.root,!0);p&&(t.style.width=`${p.width}px`,t.style.transform=`translate(${p.x}px, ${-window.scrollY}px)`)}return{u:T,M,destroy(){r.disconnect(),e.I(null),t.remove()}}}var Mo="[data-pipeup-ignore],input,textarea,select,[contenteditable]:not([contenteditable=false])";function Co(e){let t=v("button",{type:"button","aria-label":"Comment",title:"Comment"},te("comment",17)),o=v("div",{class:"selbar"},t);o.inert=!0,e.n.append(o);let n=null,r=0,s=!1,l=p=>{let g=p&&(p.nodeType===Node.ELEMENT_NODE?p:p.parentElement);return!!g&&e.root.contains(g)&&!g.closest(Mo)};function a(){if(!n)return;let p=n.getBoundingClientRect(),{left:g,top:y}=Jt({left:p.left,top:p.top,width:p.width,height:p.height},{width:o.offsetWidth||36,height:o.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});o.style.left=`${g}px`,o.style.top=`${y}px`}function f(){n=null,o.inert=!0,o.classList.remove("show")}function d(p=!1){let g=window.getSelection();if(!e.state.s||!g||g.isCollapsed||g.rangeCount===0||!g.toString().trim()||!l(g.anchorNode)||!l(g.focusNode)){f();return}!n&&!p&&e.T("Enter comments on the selected words"),n=g.getRangeAt(0).cloneRange(),a(),o.inert=!1,o.classList.add("show")}t.addEventListener("mousedown",p=>p.preventDefault()),t.addEventListener("click",p=>{if(p.stopPropagation(),e.state.t&&!e.S())return e.F();let g=n;if(!g)return;let y;try{y=Nt(g,e.root,e.d.view(g.commonAncestorContainer))}catch(C){e.Z(C),f();return}let x=ge(g.toString().replace(/\s+/g," ").trim(),60);window.getSelection()?.removeAllRanges(),f(),e.Q({anchor:y,label:`\u201C${x}\u201D`,ranges:[g],resolved:{state:"attached",element:null,range:g}})});let h=()=>{if(window.clearTimeout(r),r=window.setTimeout(()=>s||d(),250),!n)return;let p=window.getSelection();(!p||p.isCollapsed||!p.toString().trim())&&f()};document.addEventListener("selectionchange",h);let T=p=>{p.type!=="keyup"&&(s=p.type==="mousedown"),!(s||e.f(p))&&window.setTimeout(()=>d(p.type==="mouseup"),0)};window.addEventListener("mousedown",T,!0),window.addEventListener("mouseup",T,!0),window.addEventListener("keyup",T,!0);let M=p=>{p.key!=="Enter"||!n||e.f(p)||p.target instanceof Element&&p.target.closest(`${Mo},${tn}`)||(p.preventDefault(),p.stopPropagation(),t.click())};return window.addEventListener("keydown",M,!0),{u(){!e.state.s&&n&&f()},M(){n&&a()},destroy(){window.removeEventListener("mousedown",T,!0),window.removeEventListener("mouseup",T,!0),window.removeEventListener("keyup",T,!0),window.removeEventListener("keydown",M,!0),window.clearTimeout(r),document.removeEventListener("selectionchange",h),o.remove()}}}async function On(e,t){try{await navigator.clipboard.writeText(e);return}catch{}let o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.cssText="position:fixed;opacity:0;pointer-events:none",t.append(o),o.select();let n=document.execCommand("copy");if(o.remove(),!n)throw new Error("pipeup: your browser blocked copying")}var ri=3e3,Po="Hidden on the page";function Oo(e){let t=[v("span",{class:"n"}),v("span",{class:"n"})],o=te("comment",20,1.4);o.lastElementChild.setAttribute("stroke-width","1.6");let n=v("button",{class:"mode",type:"button","aria-label":"Comment","aria-keyshortcuts":yn,"aria-haspopup":"menu","aria-expanded":"false"},v("span",{class:"plus"},o),v("span",{class:"cnt"},te("bubble",34,1.4),...t),v("span",{class:"dot"})),r=document.createTextNode("Comment"),s=v("span",{class:"ttip","aria-hidden":"true"},r,v("small",{},mt)),l=v("div",{class:"launch"},n,s),a=v("div",{class:"menu",role:"menu","aria-label":"Comments"}),f=v("div",{class:"list",role:"menu","aria-label":"All comments"}),d=v("span",{class:"pn"}),h=v("button",{class:"ib",type:"button","aria-label":"Close"},te("close")),T=v("button",{class:"hs",type:"button",role:"switch","aria-checked":"false"},"Show resolved",v("span",{class:"sw","aria-hidden":"true"}));T.addEventListener("click",m=>{m.stopPropagation(),e.c.ve()});let M=v("div",{class:"all",role:"dialog","aria-label":"All comments"},v("div",{class:"hd"},v("span",{},"All comments"),d,T,h),f),p=v("div",{class:"pop side",role:"dialog","aria-label":"Comment thread"});a.inert=M.inert=p.inert=!0,e.n.append(a,l,M);let g=!1,y=null,x=0,C=[],A=0,E=null,P=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,k=m=>{g=e.state.c=m,window.clearTimeout(x),x=0,m||y?.(!0),a.classList.toggle("show",m),ee(a,!m),n.setAttribute("aria-expanded",String(m))},q=(m,S=!1)=>{e.state.l!==m&&(e.state.l=m,e.u(),m?(W(f)[0]??h).focus({preventScroll:!0}):S&&n.focus({preventScroll:!0}))},W=(m=a)=>[...m.querySelectorAll(".mi")],F=()=>a.getRootNode().activeElement,Y=()=>{k(!1),n.focus({preventScroll:!0})},j=m=>{let S=W(m.currentTarget);if(S.length===0)return;let I=F(),R=S.indexOf(I),D=H=>{m.preventDefault(),S[(H+S.length)%S.length]?.focus({preventScroll:!0})};m.key==="ArrowDown"?D(R+1):m.key==="ArrowUp"?D(R<0?S.length-1:R-1):m.key==="Home"?D(0):m.key==="End"&&D(S.length-1)};a.addEventListener("keydown",j),f.addEventListener("keydown",j),h.addEventListener("click",m=>{m.stopPropagation(),q(!1,!0)});let B=m=>Pn(e,m),se=()=>C.filter(m=>!m.resolved&&!e.O(m)).length,ce=()=>C.filter(m=>!m.resolved&&e.O(m)).length,ve=()=>C.filter(m=>!m.resolved).length,de=m=>{let S=m.anchor.view?.slide,I=e.d.p(m.anchor.view)?"":It(m.anchor.view);return S&&e.d.slide()!==null?`On slide ${S}`:I?`In ${I}`:Po},oe=(m,S,I="")=>v("div",{role:"group","aria-label":I?`${m} \xB7 ${I}`:m},v("div",{class:"sec","aria-hidden":"true"},m,I&&v("b",{},I)),...S);function pe(m,S){let I=e.d.slide(),R=new Map;for(let D of m){let H=D.thread,U=I!==null?H.anchor.view?.slide??I:e.O(H)?e.d.p(H.anchor.view)?"":It(H.anchor.view):null;R.set(U,[...R.get(U)??[],D])}if(I===null){let D=R.get(null)??[];return R.delete(null),[...D.map(S),...[...R].map(([H,U])=>oe(H||Po,U.map(S)))]}return[...R].sort(([D],[H])=>Number(D)-Number(H)||0).map(([D,H])=>oe(`Slide ${D} \xB7 ${H.filter(U=>!U.thread.resolved).length} open`,H.map(S),D===I?"This slide":""))}function Ae(){let m=F()?.dataset.thread,S=e.c.all().filter(H=>!H.thread.resolved||e.state.k),I=H=>{let U=H.thread,le=Qe(U.root.author,U.root.name);le.classList.add("in");let Ce=v("button",{class:U.resolved?"mi done":"mi",type:"button",role:"menuitem","data-thread":U.id},le,v("span",{},v("span",{class:"clamp"},U.root.deleted?"Deleted":U.root.text),v("small",{},B(U)?`\u201C${ge(U.anchor.snapshot,80)}\u201D`:H.location.where)));return Ce.addEventListener("click",Ye=>{Ye.stopPropagation(),we(U.id,Ce.getBoundingClientRect().top)}),Ce},R=S.filter(H=>B(H.thread));d.textContent=String(ve()),T.setAttribute("aria-checked",String(e.state.k)),f.replaceChildren(S.length?"":v("div",{class:"sec",role:"presentation"},"No open comments"),...pe(S.filter(H=>!B(H.thread)),I),R.length?oe("No longer on the page",R.map(I)):"");let D=W(f);m&&D.find(H=>H.dataset.thread===m)?.focus({preventScroll:!0})}function we(m,S){tt()&&(e.state.L=!0,q(!1)),O(m,S)}let b="";function O(m,S){let I=C.find(R=>R.id===m);if(I){if(b=m,!e.O(I))return $(I,S);if(e.state.t&&!e.S())return e.F();e.d.Y(I.anchor.view??{}).then(()=>{e.ne();let R=C.find(D=>D.id===m);R&&b===m&&(e.state.l||e.state.L)&&$(R,S)})}}function $(m,S){let I=m.id,R=e.resolved.get(I),D=R&&!B(m)&&!e.O(m)?R.element??R.range?.startContainer.parentElement??null:null;if(D?.scrollIntoView({block:"center",inline:"nearest",behavior:P?"auto":"smooth"}),D&&R&&vt(m.anchor,R)&&D.checkVisibility?.({visibilityProperty:!0})!==!1){X(),e.open(I);return}e.open(null),tt()&&(e.state.L=!0,e.u()),K(m,S)}function K(m,S){let I=!B(m)&&e.O(m),R={quote:m.anchor.quote?.exact??null,lost:B(m)||I?m.anchor.snapshot:null,place:I?de(m):null};if(E?.id===m.id?E.view.update(m,R):(E={id:m.id,view:ct(m,e.D,{H:"popover",...R})},p.replaceChildren(E.view.element)),S===void 0)return;p.isConnected||(e.n.insertBefore(p,M),p.offsetWidth);let D=Gt(e.state.l),{left:H,top:U}=Xt({x:D.width,y:S,below:!1},{width:et,height:p.offsetHeight},D);p.style.left=`${H}px`,p.style.top=`${U}px`,p.classList.add("show"),p.inert=!1,e.we(m.id)}function X(m=!1){E&&(E=null,p.classList.remove("show"),ee(p,!0),m&&e.state.L&&(e.state.L=!1,e.u()))}function V(m,S,I,R=!1,...D){let H=v("button",{class:"mi",type:"button",role:R?"menuitemcheckbox":"menuitem"},m,v("span",{class:"lb"},S),...D,R&&v("span",{class:"sw","aria-hidden":"true"}),v("span",{class:"tt","aria-hidden":"true"}));return H.addEventListener("click",U=>{U.stopPropagation(),I(U)}),H}let _=(m,S,I,R)=>{let D=m.querySelector(".lb");D.textContent!==S&&(D.textContent=S),m.querySelector(".tt").textContent=I,m.setAttribute("aria-description",I),R!==void 0&&m.setAttribute("aria-checked",String(R))},Q=()=>v("div",{class:"sep",role:"separator"}),fe=v("span",{class:"ma"}),$e=v("span",{class:"kc"}),Ue="",G=V(fe,"",ae,!1,$e);G.dataset.item="name";let ye=V(te("copy"),"Copy as Markdown",()=>{Y(),e.c.copyAll("ai")}),Me=V(te("lines"),"Copy as Text",()=>{Y(),e.c.copyAll("text")}),Ne=v("span",{class:"kc"}),Be=V(te("list"),"All comments",()=>{k(!1),q(!0)},!1,Ne),be=V(te("comment"),"Start commenting",m=>{let S=!e.state.s&&m.detail===0;e.ye(!e.state.s,S),S&&k(!1)},!0,v("span",{class:"kc","aria-hidden":"true"},mt));be.dataset.item="comment",be.setAttribute("aria-keyshortcuts",yn);let xe=[G,Q(),ye,Me,Be,Q(),be];function re(){let m=ve(),S=e.c.name(),I=S||Le(e.doc.me);if(_(G,I,S?"The name on your comments":"Add a name to show on your comments"),G.setAttribute("aria-label",`${I}, ${S?"edit":"add"} your name`),$e.replaceChildren(S?te("edit",13):"Add name"),ht(e.doc.me,S)!==Ue){Ue=ht(e.doc.me,S);let R=Qe(e.doc.me,S);R.classList.add("in"),fe.replaceChildren(R)}_(ye,"Copy as Markdown","Markdown, with where each thread is"),_(Me,"Copy as Text","Just the words"),_(Be,"All comments","Every thread, and where it is"),Ne.textContent=m?String(m):"",_(be,"Start commenting",e.state.s?"Turn off to hide the comments again":"Shows the comments; choose any part of the page to comment on it",e.state.s)}function ze(){re(),a.firstChild!==G&&a.replaceChildren(...xe)}function ae(){let m=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"});m.value=e.c.name();let S=v("div",{class:"ed"},fe.cloneNode(!0),m),I=(R,D=!1)=>{if(y!==I)return;y=null;let H=m.value.trim();R&&H&&H!==e.c.name()&&e.c.rename(H).then(re),S.replaceWith(G),D&&G.focus({preventScroll:!0})};y=I,m.addEventListener("keydown",R=>{R.stopPropagation(),(R.key==="Enter"||R.key==="Escape")&&(R.preventDefault(),I(R.key==="Enter",!0))}),m.addEventListener("blur",()=>I(!0)),G.replaceWith(S),m.focus({preventScroll:!0})}n.addEventListener("click",m=>{if(m.stopPropagation(),g){k(!1);return}ze(),k(!0),m.detail===0&&W().at(-1)?.focus({preventScroll:!0})});let He=!1,Ee=()=>{He=M.contains(F())},ke=m=>{let S=m.composedPath();g&&!S.includes(a)&&!S.includes(n)&&(k(!1),e.state.s&&!e.f(m)&&(e.X(m),m.preventDefault(),m.stopPropagation())),e.state.l&&!e.f(m)&&q(!1,He&&(!document.activeElement||document.activeElement===document.body)),!S.includes(p)&&!S.includes(M)&&X(!0)},Te=m=>{if(!g||m.pointerType==="touch"||m.type==="pointerout"&&m.relatedTarget)return;let S=m.composedPath();m.type==="pointerover"&&(S.includes(a)||S.includes(n))?(window.clearTimeout(x),x=0):x||(x=window.setTimeout(()=>{x=0,y||k(!1)},ri))};window.addEventListener("pointerdown",Ee,!0),window.addEventListener("click",ke,!0),window.addEventListener("pointerover",Te,!0),window.addEventListener("pointerout",Te,!0);let We=m=>{if(m.key!=="Escape"||y)return;let S=m.composedPath()[0];if(g)Y();else if(e.state.l&&!(S instanceof HTMLTextAreaElement&&!M.contains(S)))q(!1,!0);else if(E)X(!0),e.D.close();else return;m.stopPropagation()};return window.addEventListener("keydown",We,!0),{u(m){C=m;let S=se();if(S!==A){if(S){let[U,le]=t[0].classList.contains("on")?t:[t[1],t[0]];le.textContent=S>99?"99+":String(S),le.classList.toggle("s",S>99),U.classList.remove("on"),le.classList.add("on")}n.classList.toggle("has",S>0),A=S}let I=ce(),R=I?`${S} here \xB7 ${I} ${e.d.slide()!==null?"on other slides":"in other views"}`:"";n.classList.toggle("else",I>0);let D=`Comment${e.state.s?", comment mode on":""}${R?`, ${R}`:S?`, ${S} open`:""}`;n.getAttribute("aria-label")!==D&&n.setAttribute("aria-label",D),r.data!==(R||"Comment")&&(r.data=R||"Comment"),n.classList.toggle("on",e.state.s),g&&!e.state.c&&k(!1),g&&re();let H=e.state.l;if(M.classList.toggle("full",tt()),M.classList.contains("show")!==H&&(M.classList.toggle("show",H),ee(M,!H)),H&&Ae(),E){let U=m.find(le=>le.id===E?.id);!U||e.state.o||U.resolved&&!e.state.k?X():K(U)}},M(){},destroy(){window.removeEventListener("pointerdown",Ee,!0),window.removeEventListener("click",ke,!0),window.removeEventListener("pointerover",Te,!0),window.removeEventListener("pointerout",Te,!0),window.clearTimeout(x),window.removeEventListener("keydown",We,!0),a.remove(),M.remove(),p.remove(),l.remove()}}}var xt="[data-pipeup-slide]",Io=1e3,Ro=["scroll","resize","keyup","click","transitionend","slidechanged"],In=null,kt=null,nn=new Set,Rn=new Set,Et=e=>{try{e()}catch(t){globalThis.reportError?.(t)}};function No(e){let t=null;if(e){t={};let o=0;for(let[n,r]of Object.entries(e))if(!(typeof r!="string"||n==="slide"||n.length>Z.viewKey||r.length>Z.viewValue)){if(++o>=Z.viewEntries)break;t[n]=r}}In=t;for(let o of Rn)o()}function Bo(e){return nn.add(e),()=>void nn.delete(e)}function on(e){kt=typeof e?.current=="function"&&typeof e.go=="function"?e:null}function ii(e,t,o){let n=t.K(),r=null,s=0,l=0;for(let a of e){if(!t.shown(a))continue;let f=t.i(a),d=Math.min(f.left+f.width,n.width)-Math.max(f.left,0),h=Math.min(f.top+f.height,n.height)-Math.max(f.top,0);if(d<=0||h<=0)continue;let T=Math.round(d*h),M=t.opacity(a);(T>s||T===s&&(M>l||M===l&&a===o))&&(r=a,s=T,l=M)}return r}function si(e,t,o){return t!==null?e?.slide===void 0||e.slide===t:!e||!o?!0:Object.entries(e).every(([n,r])=>n==="label"||n==="slide"||o[n]===r)}function ai(){return{i:e=>e.getBoundingClientRect(),shown:e=>e.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1,opacity:e=>parseFloat(getComputedStyle(e).opacity)||0,K:()=>({width:window.innerWidth,height:window.innerHeight})}}var $o=()=>{let e=window.Reveal;return typeof e?.getIndices=="function"&&typeof e.slide=="function"?e:null};function Ho(e,t,o=ai()){let n=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,r=null,s=null,l=0,a=!1,f=()=>[...e.querySelectorAll(xt)],d=()=>[...e.querySelectorAll(".slides > section")],h=A=>typeof A=="string"&&A.length>0&&A.length<=Z.viewValue?A:null,T=A=>h(A?.getAttribute("data-pipeup-slide"));function M(){if(kt){let E=null;if(Et(()=>{let P=kt.current();Number.isInteger(P)&&P>0&&(E=String(P))}),E!==null)return E}let A=$o();if(A){let E=null;if(Et(()=>{let P=A.getIndices().h,k=d()[P];E=T(k?.matches(xt)?k:k?.querySelector(xt))??h(String(P+1))}),E!==null)return E}return r&&!r.isConnected&&(r=null),r=ii(f(),o,r)??r,T(r)}function p(){l=0,s=M(),t()}let g=()=>{!l&&!a&&(l=requestAnimationFrame(p))},y=A=>si(A,s,In);function x(A){if(y(A))return Promise.resolve(!0);let E=A.slide,P=$o(),k=f().find(F=>T(F)===E),q=/^[1-9]\d{0,5}$/.test(E??"");if(q&&kt)Et(()=>kt.go(Number(E)));else if(q&&P){let F=k?d().findIndex(Y=>Y===k||Y.contains(k)):-1;Et(()=>P.slide(F>=0?F:Number(E)-1))}else if(nn.size)for(let F of nn)Et(()=>F({...A}));else if(k)k.scrollIntoView({block:"start",behavior:n?"auto":"smooth"});else return Promise.resolve(!1);let W=performance.now();return new Promise(F=>{let Y=se=>{clearTimeout(j),F(se)},j=setTimeout(()=>Y(!1),Io),B=()=>{if(a)return Y(!1);if(s=M(),y(A))return Y(!0);if(performance.now()-W>=Io)return Y(!1);requestAnimationFrame(B)};requestAnimationFrame(B)})}let C=new MutationObserver(A=>{A.some(E=>E.target instanceof Element&&E.target.matches(xt))&&g()});C.observe(e,{subtree:!0,attributes:!0,attributeFilter:["class","style","hidden"]});for(let A of Ro)window.addEventListener(A,g,{capture:!0,passive:!0});return Rn.add(g),s=M(),{slide:()=>s,view(A){let E=A instanceof Element?A:A?.parentElement,P=T(E?.closest(xt))??s,k={...P!==null?{slide:P}:{},...In};return Object.keys(k).length?k:void 0},p:y,Y:x,destroy(){a=!0,cancelAnimationFrame(l),C.disconnect();for(let A of Ro)window.removeEventListener(A,g,!0);Rn.delete(g)}}}var Fo=["pipeup-quote","pipeup-on","pipeup-done"],li={"pipeup-quote":[[250,227,188,.75],[250,200,100,.28]],"pipeup-on":[[247,212,154,.95],[250,200,100,.42]],"pipeup-done":[[180,178,169,.22],[180,178,169,.2]]},ci=(e,t)=>Fo.map(o=>{let[n,r,s,l]=li[o][e?1:0];return`::highlight(${o}){background-color:rgba(${n},${r},${s},${+(l*t).toFixed(3)})}`}).join("");function Vo(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}var di="<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><rect x='7' y='7' width='23' height='23' rx='4' fill='none' stroke='#534AB7' stroke-width='2' stroke-dasharray='4 3'/><path d='M3 2v15l4-3.5 3 6.5 2.5-1.2-3-6.3H15z' fill='#fff' stroke='#2C2C2A' stroke-width='1.2' stroke-linejoin='round'/></svg>",ui=`:not([data-pipeup-ignore],[data-pipeup-ignore] *){cursor:url("data:image/svg+xml,${encodeURIComponent(di)}") 3 2,crosshair!important}`;function qo(e=document,t=!1){let o=e.defaultView?.CSSStyleSheet;if(!o||!("replaceSync"in o.prototype)||!("adoptedStyleSheets"in e))return{oe(){},re(){},j(){},ie(){},remove:()=>Do()};let n=new o,r=null,s=!1,l=1,a=0,f="",d=0,h=()=>n.replaceSync(ci(t,l)+(r===null?"":`:root{--pipeup-gutter:${r}px}`)+(s?ui:"")+(a||f?`html{--pipeup-panel:${a}px;${a?`margin-right:${a}px!important;`:""}${f}}`:""));return h(),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],{oe(T){T!==r&&(r=T,h())},re(T){T!==s&&(s=T,h())},j(T){l=T,h()},ie(T,M){T!==a&&(a=T,f=M?"":"transition:margin-right .34s cubic-bezier(.4,0,.2,1)!important",clearTimeout(d),!T&&f&&(d=window.setTimeout(()=>{f="",h()},400)),h())},remove(){clearTimeout(d),e.adoptedStyleSheets=e.adoptedStyleSheets.filter(T=>T!==n),Do()}}}function _o(e){Vo()&&(CSS.highlights.set("pipeup-quote",new Highlight(...e.quote)),CSS.highlights.set("pipeup-on",new Highlight(...e.on)),CSS.highlights.set("pipeup-done",new Highlight(...e.done)))}function Do(){if(Vo())for(let e of Fo)CSS.highlights.delete(e)}var $n=':host{all:initial}*{box-sizing:border-box}button{-webkit-appearance:none;appearance:none;font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}svg{display:block}.layer{all:initial;display:block;position:fixed;inset:0;pointer-events:none;font:13px/1.5 var(--pu-font,system-ui,sans-serif);color:var(--k);--k:#2C2C2A;--mu:#5F5E5A;--fa:#888780;--ln:#E5E3DA;--ru:#ECEAE2;--so:#FAFAF7;--su:#FFFFFF;--ho:#F1EFE8;--as:color-mix(in srgb,var(--pu-accent,#534AB7) 12%,transparent);--sh:0 8px 28px rgba(44,44,42,.1);--in:.26s;--mv:.34s;--out:.2s;--pl:1.2s;--eo:cubic-bezier(.22,.61,.36,1);--eio:cubic-bezier(.4,0,.2,1);--ei:cubic-bezier(.4,0,1,1)}.layer.dark{--k:#ECEBE6;--mu:#B4B2A9;--fa:#8D8B84;--ln:#3A3936;--ru:#34332F;--so:#22221F;--su:#1B1B19;--ho:#2C2C29;--sh:0 8px 28px rgba(0,0,0,.45)}.layer.hidden .bub,.layer.hidden .col,.layer.hidden .pop,.layer.hidden .tip,.layer.hidden .mark,.layer.hidden .selbar{opacity:0!important;pointer-events:none!important}.tx{font-size:14px;line-height:1.5;color:var(--k);white-space:pre-wrap;overflow-wrap:anywhere}.tx.del,.who,.rest,.ctx{color:var(--fa)}.who,.rest{font-size:12px}.who{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rft>.who{display:block}.ctx[hidden]{display:none}.ctx{font-size:12px;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tx a{color:var(--pu-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.ft,.rft{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--in) var(--eo),opacity var(--in) var(--eo)}.ft>*,.rft>*{overflow:hidden;min-height:0;display:flex;align-items:center}.root:hover>.ft,.root:focus-within>.ft,.it:hover>.rft,.it:focus-within>.rft{grid-template-rows:1fr;opacity:1}.ft.has-rest{grid-template-rows:1fr;opacity:1}.ft.has-rest>*{grid-area:1/1}.ft .hover{opacity:0;transition:opacity var(--in) var(--eo)}.ft .rest{transition:opacity var(--in) var(--eo)}.root:hover>.ft .hover,.root:focus-within>.ft .hover,.ft:not(.has-rest) .hover{opacity:1}.root:hover>.ft .rest,.root:focus-within>.ft .rest{opacity:0}.acts{margin-left:6px;display:flex;flex:none}.ib{width:24px;height:22px;display:grid;place-items:center;border-radius:6px;color:var(--mu);transition:background-color .2s var(--eo),color .2s var(--eo)}.ib:hover,.ib:focus-visible{background:var(--ho);color:var(--k);outline:none}.rps,.rbox{padding-left:14px}.rps .it{padding-top:6px}.more{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--mv) var(--eio)}.more>div{overflow:hidden;min-height:0}.th:not(.on) .more{grid-template-rows:0fr}.row{display:flex;align-items:center;gap:8px;padding:8px 0 2px;cursor:text}.input{flex:1;min-width:0;height:27px;display:block;border:0;border-bottom:1px solid var(--ln);outline:none;resize:none;overflow:hidden;font:inherit;font-size:14px;line-height:1.5;padding:3px 0;color:var(--k);background:transparent;transition:border-color var(--in) var(--eo)}.row:hover .input,.input:hover{border-bottom-color:var(--mu)}.input:focus{border-bottom-color:var(--pu-accent)}.ed{display:flex;gap:10px;align-items:center;min-height:34px;padding:6px 10px}.ed .input{font-size:13px;height:22px}.root,.it{position:relative;padding-right:30px}.av{display:grid;place-items:center;width:22px;height:22px;border-radius:32%;font-size:12px;font-weight:600;line-height:1;opacity:0;transform:scale(.85);transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.av.in{opacity:1;transform:none}.av svg{width:80%;height:80%}.root>.av,.it>.av{position:absolute;top:0;right:0}.it>.av{top:6px}.av{--av-l:92%;--av-d:30%;--s:60%;background:hsl(var(--h) var(--s) var(--av-l));color:hsl(var(--h) var(--s) var(--av-d))}.dark .av{--av-l:20%;--av-d:78%}.c0{--h:0}.c1{--h:25}.c2{--h:50}.c3{--h:130}.c4{--h:175}.c5{--h:215}.c6{--h:270}.c7{--h:330}.c8{--h:28;--s:35%}.c9{--h:220;--s:8%}.me{flex:none;display:grid}.me>.av{grid-area:1/1;width:26px;height:26px;font-size:13px}.you{display:grid;padding:0 34px;min-height:24px;font-size:12px;color:var(--fa)}.you>*{grid-area:1/1;display:flex;align-items:center;min-width:0;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.say{white-space:pre;overflow:hidden}.nm{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.say button{flex:none}.say button{color:var(--mu);text-decoration:underline;text-decoration-color:var(--ln);text-underline-offset:2px;transition:color .2s var(--eo)}.say button:hover,.say button:focus-visible{color:var(--pu-accent);outline:none}.nf{opacity:0;transform:translateY(-4px);pointer-events:none}.nf .input{font-size:13px;height:24px}.you.naming .nf{opacity:1;transform:none;pointer-events:auto}.you.naming .say{opacity:0;pointer-events:none}.send{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;color:var(--pu-accent);flex:none;opacity:0;pointer-events:none;transition:opacity var(--in) var(--eo),background-color .2s var(--eo)}.send.show{opacity:1;pointer-events:auto}.send:hover{background:var(--as)}.bub{position:fixed;left:0;top:0;width:20px;height:20px;margin:-20px 0 0 -2px;border-radius:50% 50% 50% 0;background:var(--pu-accent);border:2px solid var(--su);box-shadow:0 1px 4px #0003;pointer-events:auto;opacity:0;transform:translateY(-6px) scale(.9);transform-origin:2px 20px;transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.bub.in{opacity:1;transform:none;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.bub.in:hover,.bub.on{transform:scale(1.18)}.bub.done{background:var(--fa)}.bub.ghost{pointer-events:none}.tip,.pop,.menu,.all,.toast,.selbar{background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh)}.tip{position:fixed;max-width:260px;border-radius:10px;padding:7px 10px;opacity:0;transform:translateY(3px);transition:opacity .22s var(--eo),transform .26s var(--eo)}.tip.show{opacity:1;transform:none;pointer-events:auto;cursor:pointer;transition:opacity .22s var(--eo),transform .26s var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.pop{position:fixed;width:var(--pu-pop);border-radius:12px;padding:10px 12px 8px;pointer-events:none;opacity:0;transform:translateY(6px) scale(.98);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.pop.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.pop.show.glide{transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.mark{position:fixed;border:2px solid color-mix(in srgb,var(--pu-accent) 50%,transparent);background:var(--as);border-radius:8px;opacity:0;transition:opacity .3s var(--eo)}.mark.show{opacity:1}.pulse{position:fixed;border:2px solid var(--pu-accent);border-radius:8px;background:var(--as);animation:pu-pulse var(--pl) var(--eio) forwards}@keyframes pu-pulse{0%{opacity:0;transform:scale(.985)}35%{opacity:.85;transform:scale(1)}to{opacity:0;transform:scale(1.02)}}.col{position:fixed;left:0;top:0;pointer-events:none;transition:opacity var(--in) var(--eo)}.th{position:absolute;left:0;right:0;top:0;padding:4px 4px 4px 12px;pointer-events:auto;cursor:pointer;box-shadow:inset 2px 0 0 transparent;transition:transform var(--mv) var(--eio),box-shadow var(--in) var(--eo),opacity var(--in) var(--eo)}.th.hot{box-shadow:inset 2px 0 0 var(--ln)}.th.on{box-shadow:inset 2px 0 0 var(--pu-accent);cursor:default}.th.dim{opacity:.45}.th.resolved:not(.on):not(.hot){opacity:.6}.th.lost .ctx{white-space:normal}.th.wait{opacity:0!important;pointer-events:none}.th.out{opacity:0!important;pointer-events:none;transition:opacity var(--out) var(--ei)}.th:has(.opn:focus-visible){box-shadow:inset 2px 0 0 var(--ln);outline:2px solid var(--pu-accent);outline-offset:2px;border-radius:4px}.selbar{position:fixed;display:flex;border-radius:10px;padding:2px;opacity:0;transform:translateY(4px);pointer-events:none;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.selbar.show{opacity:1;transform:none;pointer-events:auto}.selbar button{width:32px;height:30px;display:grid;place-items:center;border-radius:8px;color:var(--pu-accent);transition:background-color .2s var(--eo)}.selbar button:hover,.selbar button:focus-visible{background:var(--as);outline:none}.pick{position:fixed;left:0;top:0;border:2px solid color-mix(in srgb,var(--pu-accent) 70%,transparent);background:color-mix(in srgb,var(--pu-accent) 6%,transparent);border-radius:8px;pointer-events:none;opacity:0;transition:opacity var(--out) var(--ei),border-color var(--out) var(--ei),border-width var(--out) var(--ei),box-shadow var(--out) var(--ei)}.pick.show{opacity:1;transition-duration:var(--in);transition-timing-function:var(--eo)}.pick.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.pick.on{border-color:var(--pu-accent)}.pick.kf{border:3px solid var(--pu-accent);box-shadow:0 0 0 2px var(--su)}.km{position:fixed;left:0;top:0;pointer-events:none;outline:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.namebar{position:fixed;left:0;top:0;display:flex;align-items:center;gap:2px;padding:2px 2px 2px 10px;border-radius:10px;font-size:12px;color:var(--mu);white-space:nowrap;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(4px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.namebar.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.namebar.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.namebar .lbl{margin-right:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis}.namebar .nb{padding:4px;display:grid;place-items:center;border-radius:7px;transition:background-color .2s var(--eo),color .2s var(--eo)}.namebar .nb:hover,.namebar .nb:focus-visible{background:var(--ho);color:var(--k);outline:none}.namebar .nb[hidden]{display:none}.launch{position:fixed;right:20px;bottom:20px;pointer-events:auto}.launch .mode{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);transition:background-color .3s var(--eo),color .3s var(--eo)}.mode>*,.cnt>*{grid-area:1/1}.mode>*{display:grid;place-items:center;transition:opacity var(--in) var(--eo)}.cnt,.has>.plus{opacity:0}.has>.cnt{opacity:1}.n{font-size:12px;font-weight:500;line-height:1;margin:-1.4px 0 0 1.4px;font-variant-numeric:tabular-nums;opacity:0;transition:opacity var(--in) var(--eo)}.n.s{font-size:9.5px;letter-spacing:-.04em}.n.on{opacity:1}.launch .mode:hover,.launch .mode[aria-expanded=true]{background:var(--ho)}.launch .mode.on{background:var(--pu-accent);color:#fff}.mode>.dot{position:absolute;top:3px;right:3px;width:9px;height:9px;border-radius:50%;background:var(--pu-accent);border:2px solid var(--su);opacity:0}.mode.else>.dot{opacity:1}.ttip{position:absolute;right:0;bottom:54px;white-space:nowrap;border-radius:8px;padding:4px 9px;font-size:12px;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.ttip small{margin-left:8px}.ttip small,.mi .kc{font-size:12px;color:var(--fa)}.mode:hover+.ttip,.mode:focus-visible+.ttip{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}.launch .mode[aria-expanded=true]+.ttip{opacity:0;transition:opacity var(--out) var(--ei)}@media(hover:none){.ttip,.tt{display:none}}.menu{position:fixed;right:20px;bottom:76px;width:290px;border-radius:12px;padding:4px;pointer-events:none;opacity:0;transform:translateY(6px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.menu.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.mi{position:relative;display:flex;gap:10px;align-items:center;width:100%;min-height:34px;text-align:left;padding:6px 10px;border-radius:8px;transition:background-color .2s var(--eo)}.mi:hover,.mi:focus-visible{background:var(--so);outline:none}.mi svg{color:var(--mu);flex:none}.mi small{display:block;color:var(--fa);font-size:12px}.lb{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ma{flex:none;display:grid;margin:-2px 0}.ma .av{width:20px;height:20px;font-size:11px}.mi .av svg{color:inherit}.sep{height:1px;margin:4px 10px;background:var(--ru)}.tt{position:absolute;right:calc(100% + 14px);top:50%;translate:0 -50%;width:max-content;max-width:220px;padding:4px 9px;border-radius:8px;font-size:12px;line-height:1.4;color:var(--mu);background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translate(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.mi:hover>.tt,.mi:focus-visible>.tt{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}@media(max-width:600px){.tt{right:8px;top:auto;bottom:100%;translate:none;transform:translateY(3px)}}.sw{position:relative;flex:none;width:26px;height:16px;border-radius:8px;background:var(--ln);transition:background-color var(--mv) var(--eio)}.sw:before,.sw:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000040;transition:transform var(--mv) var(--eio),opacity var(--mv) var(--eio)}.sw:before{opacity:0;transform:translate(10px)}[aria-checked=true]>.sw{background:var(--pu-accent)}[aria-checked=true]>.sw:after{transform:translate(10px)}.all{position:fixed;top:0;right:0;bottom:0;width:var(--pu-panel);display:flex;flex-direction:column;border-width:0 0 0 1px;opacity:0;transform:translate(100%);transition:transform var(--out) var(--ei),opacity var(--out) var(--ei)}.all.show{opacity:1;transform:none;pointer-events:auto;transition:transform var(--mv) var(--eo),opacity var(--in) var(--eo)}.all.full{width:100%}.hd{display:flex;align-items:center;gap:8px;padding:12px 10px 8px 16px;font-weight:600}.pn{font-weight:400;color:var(--fa)}.hs{margin-left:auto;display:flex;align-items:center;gap:6px;padding:3px 4px 3px 6px;border-radius:6px;font-size:12px;font-weight:400;color:var(--mu);transition:background-color .2s var(--eo)}.hs:hover,.hs:focus-visible{background:var(--ho);outline:none}.list{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px}.all .mi{align-items:flex-start}.all .mi>.av{flex:none}.all .mi>span:last-child{flex:1;min-width:0}.all .mi small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.all .mi .av svg{margin:0}.all .mi.done{opacity:.6}.layer.listing .col{opacity:0;transition:opacity var(--out) var(--ei)}.sec{padding:8px 10px 2px;font-size:12px;color:var(--fa)}.sec b{margin-left:6px;font-weight:500;color:var(--pu-accent)}.toast{position:fixed;left:50%;bottom:28px;border-radius:10px;padding:8px 14px;font-size:13px;opacity:0;transform:translate(-50%,6px);transition:opacity .3s var(--eo),transform .36s var(--eo)}.toast.show{opacity:1;transform:translate(-50%)}@media(forced-colors:active){.pick.kf{border:3px solid Highlight}.layer :is(.ib,.mi,.nb,.hs,.selbar button,.say button):focus-visible{outline:2px solid Highlight}}@media(prefers-reduced-motion:reduce){.bub,.bub.in,.bub.in:hover,.bub.on,.tip,.pop,.selbar,.menu,.all,.ttip,.tt,.toast{transform:none!important}.sw:after{transform:none!important;transition-property:opacity}[aria-checked=true]>.sw:after{opacity:0}[aria-checked=true]>.sw:before{opacity:1}.th{transition-property:opacity,box-shadow}.tip.show{transition-property:opacity}.pick,.pick.show{transition:opacity .16s ease-in-out}.all,.all.show{transition-property:opacity}.namebar,.namebar.show{transform:none!important;transition:opacity .16s ease-in-out}.av,.nf{transform:none!important}@keyframes pu-pulse{0%{opacity:0}35%{opacity:.85}to{opacity:0}}}';var Ko="#534AB7",pi="rgb(0, 0, 238)";function Uo(e){let t=/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)/.exec(e);if(!t||t[1]===void 0||t[2]===void 0||t[3]===void 0)return null;let o=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3]),a:o}}function fi(e){let t=o=>{let n=o/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function zo(e){let t=e.ownerDocument,o=t.defaultView;if(!o)return{font:"system-ui, sans-serif",accent:Ko,dark:!1};let n=t.documentElement,r=o.getComputedStyle(e).fontFamily||"system-ui, sans-serif",s=(o.getComputedStyle(n).getPropertyValue("--pipeup-accent")||n.style.getPropertyValue("--pipeup-accent")).trim(),l=e.querySelector("a[href]"),a=l?o.getComputedStyle(l).color:"",f=s||(a&&a!==pi?a:Ko),d=Uo(o.getComputedStyle(t.body).backgroundColor);(!d||d.a===0)&&(d=Uo(o.getComputedStyle(n).backgroundColor));let h=d&&d.a>0?fi(d)<.2:o.matchMedia?.("(prefers-color-scheme: dark)").matches===!0&&/dark/.test(o.getComputedStyle(n).colorScheme||"");return{font:r,accent:f,dark:!!h}}function Wo(e,t){e.style.setProperty("--pu-font",t.font),e.style.setProperty("--pu-accent",t.accent),e.classList.toggle("dark",t.dark)}function Yo(e,t=document){let o=t.createElement("pipeup-root");o.setAttribute("data-pipeup-ignore",""),o.style.cssText="position:fixed!important;inset:0!important;pointer-events:none!important;z-index:2147483000!important;display:block!important;margin:0!important;visibility:visible!important;opacity:1!important;transform:none!important;filter:none!important;";let n=o.attachShadow({mode:"open"}),r=t.defaultView?.CSSStyleSheet;if(r&&"replaceSync"in r.prototype&&"adoptedStyleSheets"in n){let l=new r;l.replaceSync($n),n.adoptedStyleSheets=[l]}else{let l=t.createElement("style");l.textContent=$n,n.append(l)}let s=t.createElement("div");return s.className="layer",s.style.setProperty("--pu-panel",`${wt}px`),s.style.setProperty("--pu-pop",`${et}px`),Wo(s,e),n.append(s),t.documentElement.append(o),{element:o,shadow:n,n:s,destroy:()=>o.remove()}}var mi=40,hi=250,gi=120,vi=2400,wi=4e3,yi=1e4;function jo(e,t=!1){return Cn(e,t)?"column":"bubbles"}function bi(e){return[...e.state.mode==="column"?[Ao(e),En(e,{q:!1})]:[En(e,{q:!0})],Co(e),Oo(e)]}var xi=1e3,rn="Shown here, but not saved yet \u2014 it will be saved with your next change",ot=e=>e instanceof Error?e.message.replace(/^pipeup: /,""):"Something went wrong";function Go(e){let t=zo(e.root),o=Yo(t),n=qo(document,t.dark);n.j(0);let r=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,s=document.documentElement.hasAttribute("data-pipeup-reserve"),l=new Map,a=new Set,f=new WeakSet,d={o:null,E:null,k:!1,hidden:!0,mode:jo(e.root),t:null,s:!1,l:!1,L:!1,c:!1},h=v("div",{class:"toast",role:"status","aria-live":"polite"}),T=v("div",{class:"sr","aria-live":"polite"});o.n.append(h,T);let M=null,p=[],g=null,y=!1,x=0,C=0,A=0,E=0,P=0,k=new Set,q="",W=new Map,F=Ho(e.root,()=>{!y&&$()&&G()}),Y=!1,j=0;function B(c,L=vi,i=!1,u=!1){y||(Y=i,h.textContent=c,u?h.setAttribute("aria-hidden","true"):h.removeAttribute("aria-hidden"),h.classList.add("show"),window.clearTimeout(x),x=window.setTimeout(()=>h.classList.remove("show"),L))}function se(){Y&&(Y=!1,window.clearTimeout(x),h.classList.remove("show"))}function ce(c){T.textContent="",cancelAnimationFrame(j),j=requestAnimationFrame(()=>T.textContent=c)}function ve(c){B(ot(c))}function de(c){throw ve(c),c}let oe=c=>({thread:c,location:Ot(c.anchor,l.get(c.id)??ft(c.anchor,e.root),e.root)}),pe=c=>d.o!==c||d.k?!1:(g?.z()?g.W():o.n.querySelector(".launch .mode")?.focus({preventScroll:!0}),!0),Ae={reply:async(c,L)=>{try{await e.doc.reply(c,L)}catch(i){i instanceof he?B(rn):de(i)}},resolve:async c=>{try{await e.doc.resolve(c),pe(c)&&(d.o=null),B("Resolved \xB7 Show resolved brings it back")}catch(L){L instanceof he?(pe(c)&&(d.o=null),B(`Resolved \xB7 ${rn}`)):B(ot(L))}},reopen:async c=>{try{await e.doc.reopen(c),B("Reopened")}catch(L){B(L instanceof he?`Reopened \xB7 ${rn}`:ot(L))}},close:()=>{re(null);let c=ye&&o.n.querySelector(ye);c?c.focus({preventScroll:!0}):g?.W(),ye=""},copy:c=>{try{let L=e.doc.threads().find(u=>u.id===c);if(!L)return;let i=Ft(oe(L),"ai",location.href,Date.now());On(i,o.n).then(()=>B("Thread copied as Markdown for AI"),u=>B(ot(u)))}catch(L){B(ot(L))}}},we={copyAll:async c=>{let L=we.all(),i=Vt(L,c,{title:document.title,url:location.href,exportedAt:new Date});try{await On(i,o.n);let u=L.filter(w=>!w.thread.resolved).length;B(`Copied ${u} thread${u===1?"":"s"}${c==="ai"?" as Markdown for AI":""}`)}catch(u){B(ot(u))}},ve:()=>{d.k=!d.k,G()},rename:async c=>{let L=c.replace(/\s+/g," ").trim();try{await m(L)?B(`New comments will say ${L}, but this browser couldn't remember it`):B(`New comments will say ${L}`)}catch(i){B(ot(i))}},name:()=>e.doc.name,all:()=>[...e.doc.threads()].sort(Ke(b)).map(oe)},b={doc:e.doc,root:e.root,n:o.n,host:o.element,state:d,resolved:l,te:a,D:Ae,c:we,d:F,O:c=>k.has(c.id),ne:()=>{$()&&G()},R:c=>!d.hidden&&(!c.resolved||d.k)&&!k.has(c.id),be:(c,L)=>{for(let i of e.doc.threads()){let u=l.get(i.id);if(i.anchor.quote&&b.R(i)&&u?.range&&go(c,L,gt(u)))return i}return null},_:(c,L)=>b.S()?b.be(c,L):null,f:c=>c.composedPath().includes(o.element),X:c=>void f.add(c),pe:c=>f.has(c),open:re,we:c=>be(c),E:ze,Q:ae,ue:He,S:()=>!M||M.se(),J:c=>{let L=M?.G();c(),L?.()},he:()=>{let c=d.t?.anchor.view,L=M?.G();Promise.resolve(F.p(c)||F.Y(c??{}).then(()=>b.ne())).then(L)},ae:S,le:Ee,ye:ke,F:We,I:c=>{M=c},xe:B,T:ce,fe:se,Z:ve,Ee:I,u:G,U:Te};function O(c){let L=performance.now(),i=e.doc.threads();for(let u of i){if(c&&!c.has(u.id))continue;let w=performance.now()-L<mi,N=ft(u.anchor,e.root,{fuzzy:w});l.set(u.id,N),!w&&N.state==="orphaned"?a.add(u.id):a.delete(u.id)}for(let u of[...l.keys()])i.some(w=>w.id===u)||l.delete(u);a.size===0?(window.clearTimeout(E),E=0):E===0&&(E=window.setTimeout(()=>{E=0,!y&&(O(new Set(a)),G())},hi))}function $(){let c=new Set,L=F.slide()!==null,i=new Set;for(let w of e.doc.threads()){i.add(w.id);let N=l.get(w.id)?.element;(!F.p(w.anchor.view)||!L&&N?.checkVisibility?.({visibilityProperty:!0})===!1)&&c.add(w.id)}k=c;for(let w of W.keys())i.has(w)||W.delete(w);let u=`${F.slide()}|${[...c].join()}`;return u===q?!1:(q=u,!0)}function K(c){let L=[],i=[],u=[];for(let w of c){let N=l.get(w.id);w.resolved&&!d.k||!N?.range||k.has(w.id)||(w.id===d.o||w.id===d.E?i.push(N.range):w.resolved?u.push(N.range):L.push(N.range))}d.t&&F.p(d.t.anchor.view)&&i.push(...d.t.ranges),_o({quote:L,on:i,done:u})}let X=0,V=0,_=0;function Q(c){if(c===V)return;V=c,cancelAnimationFrame(_);let L=X,i=performance.now(),u=c?260:200,w=N=>{let z=Math.min(1,(N-i)/u);X=L+(c-L)*(c?1-(1-z)**3:z*z),n.j(X),z<1&&(_=requestAnimationFrame(w))};_=requestAnimationFrame(w)}let fe=0,$e=0;function Ue(c){c!==fe&&(fe=c,n.ie(c,r),window.clearTimeout($e),$e=window.setTimeout(()=>{O(),G()},r?0:400))}function G(){if(y)return;let c=e.doc.threads();if($(),d.o&&k.has(d.o)){let i=o.n.querySelector(`[data-thread="${d.o}"] .rbox textarea`)?.value;i&&W.set(d.o,i),d.o=null}d.hidden=!d.s&&!d.l&&!d.L&&!d.t,d.hidden&&(d.o=null),Q(d.hidden?0:1),o.n.classList.toggle("hidden",d.hidden),o.n.classList.toggle("listing",d.l);let L=d.l&&!tt();Ue(L?wt:0),n.oe(s?d.mode==="column"&&!d.hidden&&!L?bt:0:null),K(c);for(let i of p)i.u(c);g?.u(c)}let ye="",Me=()=>o.n.getRootNode().activeElement,Ne="input,textarea,select,[contenteditable]:not([contenteditable=false])",Be=()=>{let c=Me();return c instanceof HTMLTextAreaElement&&c.value!==""||!!document.activeElement?.matches(Ne)};function be(c,L=Be(),i=Me()){let u=[...o.n.querySelectorAll(`[data-thread="${c}"] .rbox textarea`)].find(N=>!N.closest("[inert]")),w=i?.getAttribute("data-thread");ye=w?`.${i.classList[0]}[data-thread="${w}"]`:"",!(L||!u)&&u.focus({preventScroll:!0})}function xe(){let c=d.t;return!c||b.S()?!1:(F.p(c.anchor.view)||F.Y(c.anchor.view??{}),!0)}function re(c,L=!1){if(c&&xe())return;if(d.o===c&&!d.t)return c?be(c):void 0;let i=!L&&Be(),u=Me();if(c||(d.L=!1),d.o=c,c&&(d.t=null,I(c)),G(),c){let w=W.get(c),N=w&&o.n.querySelector(`[data-thread="${c}"] .rbox textarea`);N&&!N.value&&(N.value=w,N.dispatchEvent(new Event("input",{bubbles:!0}))),W.delete(c),L&&g?.z()?g.W():be(c,i,u)}}function ze(c){d.E!==c&&(d.E=c,c&&c!==d.o&&I(c),G())}function ae(c){se(),d.l=!1,d.t=c,d.o=null,G()}function He(c){if(!d.t)return ae(c);Object.assign(d.t,c),G()}function Ee(){d.t&&(d.t=null,G())}function ke(c,L=!1){d.s!==c&&(d.s=c,n.re(c),c?(d.o=null,d.l=!1,g=So(b)):(se(),g?.destroy(),g=null,ce("Comment mode off")),G(),g&&(L&&g.ee(),L?g.z()?B(An,yi,!0,!0):B("Nothing here to comment on"):B(`Click anything to comment, or Tab between blocks \xB7 Option-click (Alt-click) to pin \xB7 ${mt} or Esc to finish`,wi,!0)))}function Te(){d.t&&(F.p(d.t.anchor.view)||b.S())?Ee():d.o?re(null):g&&!g.U()&&ke(!1)}function We(){if(d.t){xe()||Ee();return}d.o&&re(null)}async function m(c){try{return await e.onName(c),!1}catch(L){if(e.doc.name!==c)throw L;return!0}}async function S(c){let L=d.t;if(L)try{let i=await e.doc.comment(L.anchor,c);d.t=null,O(new Set([i])),re(i,!0)}catch(i){if(i instanceof he){d.t=null,O(new Set([i.id])),re(i.id,!0),B(rn);return}de(i)}}function I(c){let L=l.get(c);if(!L||L.state==="orphaned")return;let i=L.range?gt(L):L.element?[L.element.getBoundingClientRect()]:[];for(let u of i.slice(0,6)){let w=v("div",{class:"pulse"});_e(w,u,4),o.n.prepend(w),window.setTimeout(()=>w.remove(),1300)}}function R(){for(let c of p)c.destroy();p=bi(b),G()}let D=()=>{if(!y){for(let c of p)c.M();g?.M(),P=requestAnimationFrame(D)}},H=c=>{let L=c.composedPath()[0];return L instanceof Element&&L.closest(Ne)!==null},U=c=>{if(c.key==="Escape")return Te();if(fo(c)&&!c.isComposing&&!c.defaultPrevented&&!H(c)){if(c.preventDefault(),g?.ge()&&g.ee())return;ke(!d.s,!0)}},le=c=>{if(b.f(c)||f.has(c))return;let L=window.getSelection();L&&!L.isCollapsed||We()},Ce=()=>{let c=jo(e.root,d.mode==="column");c!==d.mode?(d.mode=c,R()):G()};function Ye(){let c=performance.now();C===0&&(A=c),window.clearTimeout(C);let L=Math.min(gi,Math.max(0,A+xi-c));C=window.setTimeout(()=>{C=0,O(),G()},L)}let Tt=new MutationObserver(c=>{c.every(L=>o.element.contains(L.target))||Ye()});window.addEventListener("keydown",U),window.addEventListener("click",le),window.addEventListener("resize",Ce),Tt.observe(e.root,{subtree:!0,childList:!0,characterData:!0});let dt=typeof ResizeObserver>"u"?null:new ResizeObserver(Ye);dt?.observe(e.root);let De=e.doc.onChange(()=>{O(),G()});return O(),R(),P=requestAnimationFrame(D),{ctx:b,destroy(){y=!0,cancelAnimationFrame(P),cancelAnimationFrame(_),cancelAnimationFrame(j),F.destroy(),window.clearTimeout($e),window.clearTimeout(x),window.clearTimeout(C),window.clearTimeout(E),Tt.disconnect(),dt?.disconnect(),De(),window.removeEventListener("keydown",U),window.removeEventListener("click",le),window.removeEventListener("resize",Ce),g?.destroy();for(let c of p)c.destroy();n.remove(),o.destroy()}}}var rt=null,Ei=4e3;function Nn(e={}){if(rt)return rt;let t=Ti(e,()=>t).catch(o=>{throw rt===t&&(rt=null),o});return rt=t,t}function ki(e,t){return new Promise((o,n)=>{let r=setTimeout(()=>n(new Error("timed out")),t);e.then(o,n).finally(()=>clearTimeout(r))})}async function Ti(e,t){let o=document.documentElement.getAttribute("data-pipeup-doc"),{id:n,key:r}=o?await St(o):{id:`page-${qe(location.origin+location.pathname)}`,key:null},s,l=!1,a;if(e.store)s=e.store,a=await lt(s);else try{let p=st.open();s=await ki(p,Ei).catch(g=>{throw p.then(y=>y.close(),()=>{}),g}),a=await lt(s)}catch{s=new at,l=!0,a=await lt(s)}let f=e.name?.trim();f&&f!==a.name&&(a={...a,name:f},await s.saveProfile(a));let d=await it.open({doc:n,key:r,store:s,identity:a.identity,name:a.name});on(e.slides??null);let h;try{h=Go({doc:d,root:e.root??document.body,onName:async p=>{d.name=p,a={...a,name:p},await s.saveProfile(a)}})}catch(p){throw on(null),p}l&&h.ctx.xe("This browser can't keep comments for this page \u2014 copy the comments (Copy as Markdown) to keep them");let T=()=>void d.flush().catch(p=>globalThis.reportError?.(p)),M=!1;return window.addEventListener("pagehide",T),{document:d,flush:()=>d.flush(),unmount:()=>{M||(M=!0,window.removeEventListener("pagehide",T),h.destroy(),on(null),rt===t()&&(rt=null))}}}function Xo(){let e=document.documentElement;if(!e.hasAttribute("data-pipeup-doc")||e.getAttribute("data-pipeup-auto")==="off")return;let t=()=>void Nn().catch(o=>console.error(o));document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}var Si="0.4.1-beta.1";typeof document<"u"&&Xo();return nr(Li);})();
|
|
9
|
+
`+t)+(e.edited?" (edited)":"")}function v(e,t={},...o){let n=document.createElement(e);for(let[r,s]of Object.entries(t))s===void 0||s===!1||(r==="class"?n.className=String(s):n.setAttribute(r,s===!0?"":s));for(let r of o)r!=null&&r!==!1&&n.append(r);return n}function ee(e,t){let o=e.getRootNode().activeElement;t&&o instanceof HTMLElement&&e.contains(o)&&o.blur(),e.inert=t}function qt(e,t,o=null){let n=e.getRootNode().activeElement,r=!1;for(let s=t.length;s--;o=t[s])t[s].nextSibling!==o&&(r=!!e.insertBefore(t[s],o));return r&&n&&t.some(s=>s.contains(n))&&n.focus({preventScroll:!0}),r}function ge(e,t){return e.length>t?e.slice(0,t-1)+"\u2026":e}function _e(e,t,o=4){e.style.left=`${t.left-o}px`,e.style.top=`${t.top-o}px`,e.style.width=`${t.width+o*2}px`,e.style.height=`${t.height+o*2}px`}var Or=/\bhttps?:\/\/[^\s<>"'`]+/gi,Ir=`.,;:!?'"]}`,Rr=2048,$r=/[\u202A-\u202E\u2066-\u2069]/;function Nr(e){let t=0,o=0;for(let r of e)r==="("?t++:r===")"&&o++;let n=e.length;for(;n>0;){let r=e[n-1];if(r===")"&&o>t)o--;else if(!Ir.includes(r))break;n--}return e.slice(0,n)}function _t(e){let t=[],o=0;for(let n of e.matchAll(Or)){if(n[0].length>Rr||$r.test(n[0]))continue;let r=Nr(n[0]),s=n.index??0,l;try{let f=new URL(r);if(f.protocol!=="http:"&&f.protocol!=="https:")continue;l=f.href}catch{continue}s>o&&t.push(e.slice(o,s));let a=v("a",{href:l,target:"_blank",rel:"noopener noreferrer"},r);a.addEventListener("click",f=>f.stopPropagation()),t.push(a),o=s+r.length}return o<e.length&&t.push(e.slice(o)),t}var Re={code:"KeyC",mods:{shift:!0,alt:!0,meta:!1,ctrl:!1},mac:{label:"\u21E7\u2325C",aria:"Shift+Alt+C"},other:{label:"Shift+Alt+C",aria:"Shift+Alt+C"}},po=typeof navigator<"u"&&/Mac|iP(hone|ad|od)/.test(navigator.platform),mt=(po?Re.mac:Re.other).label,yn=(po?Re.mac:Re.other).aria;function fo(e){return e.code===Re.code&&e.shiftKey===Re.mods.shift&&e.altKey===Re.mods.alt&&e.metaKey===Re.mods.meta&&e.ctrlKey===Re.mods.ctrl&&!e.repeat&&!e.getModifierState("AltGraph")}var mo="http://www.w3.org/2000/svg",Br={comment:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z","M12.3 8.2v6.6M9 11.5h6.6"],send:["M21 12L3.5 4.5 6.2 12l-2.7 7.5zM6.2 12H13"],copy:["M10 8h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2z","M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"],resolve:["M5 12.5l4.5 4.5L19 7.5"],reopen:["M3 12a9 9 0 1 0 3-6.7","M3 4v5h5"],lines:["M4 7h16M4 12h10M4 17h7"],list:["M3 6.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 12a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M3 17.5a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0-3 0M9 6.5h11M9 12h11M9 17.5h7"],expand:["M14 4h6v6M20 4l-6 6M10 20H4v-6M4 20l6-6M20 14v6h-6M20 20l-6-6M4 10V4h6M4 4l6 6"],pin:["M6 18v-6a6 6 0 1 1 6 6z"],shrink:["M20 10h-6V4M14 10l6-6M4 14h6v6M10 14l-6 6M14 20v-6h6M14 14l6 6M10 4v6H4M10 10L4 4"],bubble:["M20.5 11.5a8 8 0 0 1-11.7 7.1L4 19.8l1.2-4.4A8 8 0 1 1 20.5 11.5z"],close:["M6 6l12 12M18 6L6 18"],edit:["M4 20h4L19 9l-4-4L4 16z"]};function te(e,t=15,o){let n=bn(Br[e],t);return o&&n.setAttribute("stroke-width",String(o)),n}function bn(e,t){let o=document.createElementNS(mo,"svg"),n={width:String(t),height:String(t),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};for(let[r,s]of Object.entries(n))o.setAttribute(r,s);for(let r of e){let s=document.createElementNS(mo,"path");s.setAttribute("d",r),o.append(s)}return o}var Kt=(e,t,o)=>`M${e} ${t}a${o} ${o} 0 1 0 ${2*o} 0a${o} ${o} 0 1 0 -${2*o} 0`,Hr={Otter:"M4 13.2C4 9.2 7.6 6.5 12 6.5s8 2.7 8 6.7-3.6 6.3-8 6.3-8-2.3-8-6.3zM5.6 9.6a1.8 1.8 0 1 1 2.7-2.3M18.4 9.6a1.8 1.8 0 1 0-2.7-2.3M9.2 11.6h.01M14.8 11.6h.01M11 14h2l-1 1zM9.8 15.8l-3.2.4M9.9 17l-2.7 1.1M14.2 15.8l3.2.4M14.1 17l2.7 1.1",Fox:"M3.5 4l5 3.5h7l5-3.5-1.5 8.5L12 20l-7-7.5zM9 12h.01M15 12h.01M12 17h.01",Owl:`M5 4.5l3 2.5h8l3-2.5V14a7 7 0 0 1-14 0z${Kt(7.4,11.5,1.9)}${Kt(12.8,11.5,1.9)}M11.3 14.6l.7 1 .7-1`,Bear:`${Kt(5,13.5,7)}M8.9 7.22A2.8 2.8 0 1 0 5.89 10.09M18.11 10.09A2.8 2.8 0 1 0 15.1 7.22M9.4 12.6h.01M14.6 12.6h.01M10.3 16.4c0-1 .8-1.6 1.7-1.6s1.7.6 1.7 1.6-.8 1.6-1.7 1.6-1.7-.6-1.7-1.6z`,Rabbit:`${Kt(6.5,15.5,5.5)}M9.6 10.5C8.2 6.5 8.4 2.5 9.8 2.5s2.4 3.5 1.6 7.5M14.4 10.5c1.4-4 1.2-8-.2-8s-2.4 3.5-1.6 7.5M10 15h.01M14 15h.01M11.3 17.3l.7.5.7-.5`};function ho(e){let t=/[\p{L}\p{N}]/u.exec(e);if(!t)return"";let o=t[0].toUpperCase();return[...o].length===1?o:t[0]}var ht=(e,t)=>ho(t)||Le(e);function Qe(e,t){return v("span",{class:`av c${wn(e)}`,"aria-hidden":"true","data-animal":Le(e)},ho(t)||bn([Hr[Je[vn(e)]]],24))}var Dr=320;function Ut(e,t){setTimeout(()=>{e.remove(),t?.()},Dr)}function zt(e){return requestAnimationFrame(()=>{e.offsetWidth,e.classList.add("in")}),e}function Wt(e){let t=v("textarea",{class:"input",rows:"1","aria-label":e.label}),o=v("button",{class:"send",type:"button","aria-label":"Send",title:"Send",inert:!0},te("send")),n=v("div",{class:"row"},e.before,t,o),r=!1,s=()=>{let a=t.value.trim()!=="";o.classList.toggle("show",a),o.inert=!a,t.style.height="auto",t.style.height=`${Math.max(27,t.scrollHeight)}px`},l=async()=>{let a=t.value.trim();if(!(!a||r)){r=!0;try{await e.$(a),o.matches(":focus")&&t.focus(),t.value="",s()}catch{}finally{r=!1}}};return n.addEventListener("mousedown",a=>{a.target===t||o.contains(a.target)||(a.preventDefault(),t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length))}),t.addEventListener("input",s),t.addEventListener("keydown",a=>{a.stopPropagation(),a.key==="Enter"&&!a.shiftKey&&!a.isComposing?(a.preventDefault(),l()):a.key==="Escape"&&(a.preventDefault(),t.value="",s(),t.blur(),e.N?.())}),o.addEventListener("click",a=>{a.stopPropagation(),l()}),{element:n,input:t,focus:()=>t.focus({preventScroll:!0}),clear:()=>{t.value="",s()}}}function Fr(e){let t=v("button",{class:"me",type:"button",tabindex:"-1","aria-hidden":"true"});t.addEventListener("mousedown",y=>y.preventDefault());let o=Wt({label:"Comment",before:t,$:e.$,N:e.N}),n=v("div",{class:"say"}),r=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"}),s=v("div",{class:"nf"},r),l=v("div",{class:"you"},n,s),a="",f=!1,d=()=>{let y=e.name(),x=y?"change":"add your name";if(t.title=y?"Change your name":"Add your name",!t.lastChild||a!==y){let A=Qe(e.me,y),E=t.lastChild;E?(zt(A),Ut(E)):A.classList.add("in"),t.append(A),a=y}let C=v("button",{type:"button"},x);C.addEventListener("click",T),n.replaceChildren(v("span",{class:"nm"},y||`You're ${Le(e.me)}`)," \xB7 ",C)},h=y=>{l.classList.toggle("naming",y),ee(n,y),ee(s,!y)};function T(y){y.stopPropagation(),r.value=e.name(),h(!0),r.focus({preventScroll:!0}),r.select()}let M=()=>{h(!1),o.focus()};t.addEventListener("click",T),r.addEventListener("keydown",y=>{if(y.stopPropagation(),y.key==="Escape")y.preventDefault(),M();else if(y.key==="Enter"){y.preventDefault();let x=r.value.trim();if(!x||x===e.name())return M();if(f)return;f=!0,e.rename(x).finally(()=>{f=!1,d(),M()})}}),d(),h(!1);let p=v("div",{class:"ctx"},e.label);return{element:v("div",{class:"draft"},p,o.element,l),G:()=>{let{selectionStart:y,selectionEnd:x}=o.input;return()=>{o.focus(),o.input.setSelectionRange(y,x)}},B:y=>{p.hidden=y},V:y=>{p.textContent=y},focus:()=>o.focus(),se:()=>o.input.value.trim()===""}}function Yt(e,t){let o=Fr({label:t.label,me:e.doc.me,name:()=>e.c.name(),rename:n=>e.c.rename(n),$:n=>e.ae(n),N:()=>e.le()});return e.I(o),o}function jt(e,t){if(t.state==="orphaned"||!t.element||e.quote)return null;let o=t.element.getBoundingClientRect();if(!o.width&&!o.height)return null;if(e.point)return{x:o.left+e.point.x*o.width,y:o.top+e.point.y*o.height};let n=t.element.ownerDocument.createRange();n.selectNodeContents(t.element);let r=n.getBoundingClientRect();return{x:r.width?Math.min(o.right-8,r.right+6):o.right-8,y:(r.height?r.top:o.top)+8}}function gt(e){return e.range?[...e.range.getClientRects()]:[]}function xn(e,t){let o=gt(t)[0];if(o)return o.top;if(t.state==="orphaned"||!t.element)return null;let n=t.element.getBoundingClientRect();return e.point?n.top+e.point.y*n.height:n.top}function vt(e,t){let o=gt(t).at(-1);if(o)return{x:o.left,y:o.bottom,below:!0};let n=jt(e,t);return n?{...n,below:!1}:null}function go(e,t,o){for(let n of o)if(e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom)return!0;return!1}function vo(e,t,o=10){let n=[...e].sort((a,f)=>a.w-f.w),r=new Array(n.length).fill(0),s=n.findIndex(a=>a.id===t),l=a=>n[a];if(s<0)n.forEach((a,f)=>{r[f]=f===0?a.w:Math.max(a.w,(r[f-1]??0)+l(f-1).height+o)});else{r[s]=l(s).w;for(let a=s+1;a<n.length;a++)r[a]=Math.max(l(a).w,(r[a-1]??0)+l(a-1).height+o);for(let a=s-1;a>=0;a--)r[a]=Math.min(l(a).w,(r[a+1]??0)-l(a).height-o)}return new Map(n.map((a,f)=>[a.id,r[f]??0]))}var wt=320,et=300,Vr=480,tt=()=>window.innerWidth<=Vr;function Gt(e){let t=window.innerWidth;return{width:e&&!tt()?t-wt:t,height:window.innerHeight}}function Xt(e,t,o,n=12){let r,s;return e.below?(r=Math.min(e.x,o.width-t.width-n),s=e.y+8,s+t.height>o.height-n&&(s=e.y-t.height-40)):(r=e.x+14,r+t.width>o.width-n&&(r=e.x-t.width-28),s=Math.min(e.y-12,o.height-t.height-n)),{left:Math.max(n,r),top:Math.max(n,s)}}function wo(e,t,o,n=12,r=44){let s=e.top-r>=8,l=e.top+e.height+8+(s?0:r),a=e.top-8-(s?r:0)-t.height,f=l+t.height<=o.height-n||a<n,d=f?l:a;return{above:!f,left:Math.max(n,Math.min(e.left,o.width-t.width-n)),top:Math.max(n,d)}}function Jt(e,t,o){let n=e.top-t.height-10;return n<8&&(n=e.top+e.height+10),{left:Math.max(8,Math.min(e.left+e.width/2-t.width/2,o.width-t.width-8)),top:n}}function Zt(e,t){let o=e.resolved.get(t.id);return o?.range?.startContainer??o?.element??null}var Ke=e=>(t,o)=>{let n=Zt(e,t),r=Zt(e,o),s=l=>l.anchor.point??{x:0,y:-1};return n!==r?!r||n&&n.compareDocumentPosition(r)&4?-1:1:s(t).y-s(o).y||s(t).x-s(o).x};var Qt=e=>`${e} ${e===1?"reply":"replies"}`;function ct(e,t,o){let n={...o},r=e.id,s=v("div",{class:"rbox always"},v("div",{},Wt({label:"Reply",$:x=>t.reply(r,x),N:t.close}).element)),l=v("div",{}),a=v("div",{}),f=null,d=v("div",{},a,v("div",{class:"more"},l)),h=new Map,T=new Map,M=new Map,p=x=>{let C=ht(x.author,x.name),A=h.get(x.id),E=A?.e;if((!E||A.key!==C)&&(E=zt(Qe(x.author,x.name)),A)){let k=A.e;M.set(x.id,k),Ut(k,()=>M.get(x.id)===k&&M.delete(x.id))}E.title=ue(x),T.set(x.id,{key:C,e:E});let P=M.get(x.id);return P?[P,E]:[E]},g=(x,C,A)=>{let E=v("button",{class:"ib",type:"button","aria-label":C,title:C},te(x));return E.addEventListener("click",P=>{P.stopPropagation(),A()}),E};function y(x,C={}){Object.assign(n,C),r=x.id;let A=(n.now??Date.now)(),E=x.root.replies.length,P=j=>v("span",{class:"who"},`${ue(j)} \xB7 ${Ze(j.at,A)}`),k=j=>v("div",{class:j.deleted?"tx del":"tx"},...j.deleted?["Deleted"]:[..._t(j.text),j.edited?" (edited)":""]),q=x.resolved?"Resolved"+(E?` \xB7 ${Qt(E)}`:""):E?Qt(E):"",W=v("div",{class:n.H==="column"&&q?"ft has-rest":"ft"},n.H==="column"&&q?v("span",{class:"rest"},q):null,v("span",{class:"hover"},P(x.root),v("span",{class:"acts"},g("copy","Copy thread",()=>t.copy(x.id)),x.resolved?g("reopen","Reopen",()=>void t.reopen(x.id)):g("resolve","Resolve",()=>void t.resolve(x.id))))),F=n.lost?v("div",{class:"ctx"},`${n.place||"No longer on the page"} \u2014 it read \u201C${ge(n.lost,120)}\u201D`):n.quote?v("div",{class:"ctx"},`\u201C${ge(n.quote,80)}\u201D`):null;T=new Map;let Y=v("div",{class:"root"},...p(x.root),F,k(x.root),W);a.replaceWith(Y),a=Y,f?.remove(),f=E?v("div",{class:"rps"},...x.root.replies.map(j=>v("div",{class:"it"},...p(j),k(j),v("div",{class:"rft"},P(j))))):null,f&&l.prepend(f),h=T,x.resolved?s.remove():s.parentNode!==l&&l.append(s),d.className=x.resolved?"thread resolved":"thread",d.setAttribute("data-thread",x.id)}return y(e),{element:d,update:y}}var qr="a,button,input,select,textarea,label,summary,[role=button],[contenteditable]",_r=400;function En(e,t){let o=new Map,n=v("div",{class:"tip",role:"tooltip"}),r=v("div",{class:"mark"}),s=v("div",{class:"pop",role:"dialog","aria-label":"Comment thread"});n.inert=s.inert=!0,e.n.append(r,n,s);let l=v("div",{class:"bub pin ghost","aria-hidden":"true"}),a=[],f=null,d=null,h=null,T=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,M=0,p=null,g=null,y=null,x=0,C=b=>a.find(O=>O.id===b)??null,A=()=>t.q||e.state.l,E=!1,P=b=>{let O=e.resolved.get(b.id);return O?vt(b.anchor,O):null};function k(b,O,$){let{left:K,top:X}=Xt(O,{width:b.offsetWidth||$,height:b.offsetHeight},Gt(e.state.l));b.style.left=`${K}px`,b.style.top=`${X}px`}function q(b){let O=b&&A()&&e.state.o!==b?C(b):null,$=O?P(O):null;if(!O||!$){y=null,n.classList.remove("show"),ee(n,!0);return}if(y!==O.id){let K=O.root.replies.length;n.replaceChildren(v("div",{class:"tx clamp"},...O.root.deleted?["Deleted"]:_t(O.root.text)),v("div",{class:"who"},`${ue(O.root)}${K?` \xB7 ${K} ${K===1?"reply":"replies"}`:""}`)),y=O.id}k(n,$,260),n.classList.contains("show")||n.offsetWidth,n.classList.add("show"),n.inert=!1}function W(b){p=b,q(b),e.E(b)}function F(b){if(window.clearTimeout(x),b!==null){W(b);return}x=window.setTimeout(()=>W(null),A()?_r:0)}n.addEventListener("mouseenter",()=>window.clearTimeout(x)),n.addEventListener("mouseleave",()=>F(null)),n.addEventListener("click",b=>{b.stopPropagation();let O=y;O&&(window.clearTimeout(x),W(null),e.open(O))});function Y(b){let O=o.get(b.id);if(O)return O;let $=v("button",{class:"bub",type:"button","data-thread":b.id});return $.addEventListener("mouseenter",()=>F(b.id)),$.addEventListener("mouseleave",()=>F(null)),$.addEventListener("click",K=>{K.stopPropagation(),q(null),e.open(b.id)}),e.n.insertBefore($,r),o.set(b.id,$),$}let j=!1;function B(){let b=e.state.t,O=h&&b&&!b.anchor.quote&&!b.anchor.point?b.resolved.element:null;if(O){let{left:K,top:X,above:V}=wo(O.getBoundingClientRect(),{width:s.offsetWidth||et,height:s.offsetHeight},{width:window.innerWidth,height:window.innerHeight}),_=h?.above!==null&&h?.above!==V;if(h&&(h.above=V),_&&ce())return;s.style.left=`${K}px`,s.style.top=`${X}px`;return}let $=h&&b?vt(b.anchor,b.resolved):f?P(f):null;$&&k(s,$,et)}let se=b=>e.state.s&&!b.anchor.quote&&!b.anchor.point;function ce(){return window.clearTimeout(M),T?(s.classList.remove("show"),M=window.setTimeout(()=>{B(),s.classList.add("show")},220),!0):(s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450),!1)}function ve(b){if(window.clearTimeout(M),T){s.classList.remove("show"),M=window.setTimeout(()=>{h?.i.V(b),B(),s.classList.add("show")},220);return}h?.i.V(b),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)}function de(){if(!A())return null;let b=e.state.t;return b?b.anchor.quote||b.anchor.point||e.state.s?null:b.resolved.element:!f||f.anchor.quote||f.anchor.point?null:e.resolved.get(f.id)?.element??null}function oe(b){a=b;let O=new Set;for(let V of b){if(!e.R(V)||V.anchor.quote)continue;let _=e.resolved.get(V.id);if(!_||_.state==="orphaned")continue;O.add(V.id);let Q=Y(V);Q.classList.toggle("done",V.resolved),Q.classList.toggle("on",e.state.o===V.id),Q.classList.toggle("pin",V.anchor.point!==void 0);let fe=`Comment on ${Ie(_.element)}: ${ge(V.root.text,60)}`;Q.getAttribute("aria-label")!==fe&&Q.setAttribute("aria-label",fe)}qt(e.n,b.filter(V=>O.has(V.id)).sort(Ke(e)).map(V=>o.get(V.id)),r);for(let[V,_]of o)O.has(V)||(_.classList.remove("in"),o.delete(V),window.setTimeout(()=>_.remove(),300));q(p),E!==e.state.l&&s.classList.contains("show")&&!T&&(window.clearTimeout(M),s.classList.add("glide"),M=window.setTimeout(()=>s.classList.remove("glide"),450)),E=e.state.l;let $=t.q?e.state.t:null;if($){let V=$.anchor.point??$.resolved.element;h?.of!==$?(window.clearTimeout(M),s.classList.remove("glide"),h={i:Yt(e,$),of:$,at:V,above:null},h.i.B(se($)),s.replaceChildren(h.i.element),s.inert=!1,h.i.focus(),f=null,d=null,B(),s.classList.add("show")):h&&(h.at!==V&&(h.at=V,h.above=null,ve($.label)),h.i.B(se($)));let _=!e.d.p($.anchor.view);_!==j&&(j=_,s.classList.toggle("show",!_),s.inert=_,_||B());return}h&&(window.clearTimeout(M),s.classList.remove("glide"),h=null,j=!1,e.I(null));let K=A()&&e.state.o?C(e.state.o):null;if(!K||!e.R(K)){f=null,d=null,s.classList.remove("show"),ee(s,!0);return}let X=K.anchor.quote?.exact??null;!f||!d||f.id!==K.id?(d=ct(K,e.D,{H:"popover",quote:X}),s.replaceChildren(d.element),f=K,B(),s.classList.add("show"),s.inert=!1):f!==K&&(d.update(K,{quote:X}),f=K)}function pe(){for(let[K,X]of o){let V=C(K),_=e.resolved.get(K),Q=V&&_?jt(V.anchor,_):null;if(!Q||Q.y<-40||Q.y>window.innerHeight+40){X.style.visibility="hidden";continue}X.style.visibility="",X.style.left=`${Q.x}px`,X.style.top=`${Q.y}px`,X.classList.contains("in")||(X.offsetWidth,X.classList.add("in"))}let b=e.state.t,O=b?.anchor.point&&e.d.p(b.anchor.view)?jt(b.anchor,b.resolved):null;O?(l.style.left=`${O.x}px`,l.style.top=`${O.y}px`,l.classList.contains("in")||(e.n.insertBefore(l,r),l.offsetWidth,l.classList.add("in"))):l.classList.contains("in")&&(l.classList.remove("in"),window.setTimeout(()=>l.classList.contains("in")||l.remove(),300)),s.classList.contains("show")&&B();let $=de();r.classList.toggle("show",$!==null),$&&_e(r,$.getBoundingClientRect(),4)}let Ae=b=>{if(e.f(b)){let $=b.composedPath()[0];g!==null&&!($ instanceof Element&&$.closest(".tip,.bub"))&&F(null),g=null;return}let O=e._(b.clientX,b.clientY)?.id??null;O!==g&&(g=O,F(O))},we=b=>{if(e.f(b))return;let O=window.getSelection();if(O&&!O.isCollapsed||(e.state.s?b.altKey:b.target instanceof Element&&b.target.closest(qr)))return;let $=e._(b.clientX,b.clientY);$&&(e.X(b),q(null),e.open($.id))};return window.addEventListener("pointermove",Ae,{capture:!0,passive:!0}),window.addEventListener("click",we,!0),{u:oe,M:pe,destroy(){window.clearTimeout(x),window.clearTimeout(M),window.removeEventListener("pointermove",Ae,!0),window.removeEventListener("click",we,!0),e.I(null);for(let b of o.values())b.remove();l.remove(),n.remove(),r.remove(),s.remove()}}}var Kr={display:"block",position:"static",clips:!1,off:!1},Ur=48,zr="button link img figure region list listitem tab tabpanel article navigation complementary banner contentinfo form search group dialog menu menuitem checkbox switch radio slider textbox combobox option row cell heading table".split(" ").map(e=>`[role=${e}]`),Wr=["button,a,input,select,textarea,label,summary,details,img,svg,canvas,video,picture,figure,figcaption,table,th,td","li,ul,ol,dl,dt,dd,p,h1,h2,h3,h4,h5,h6,blockquote,pre","section,article,aside,nav,header,footer,main,form,fieldset",...zr].join(","),kn="a,button,label,summary,[role=button],[role=link],[role=tab],[role=option],[role=menuitem]",Yr=`${kn},input,select,textarea,img,svg,canvas,video,picture,[role=img]`,yo=24,jr=.6,en=2,Tn=(e,t)=>Math.abs(e.left-t.left)<=en&&Math.abs(e.top-t.top)<=en&&Math.abs(e.width-t.width)<=en&&Math.abs(e.height-t.height)<=en;function bo(e,t){let o=t.i(e);if(o.width<2||o.height<2)return!1;if(e.hasAttribute("data-pipeup-id"))return!0;let n=t.K();return o.width*o.height<=jr*n.width*n.height&&(e.matches(Wr)||t.ce(e)||e.childElementCount>1&&!e.parentElement?.closest(kn)&&t.de(e))}function yt(e,t,o){if(e===t||!t.contains(e)||e.closest("[data-pipeup-ignore]"))return null;let n=null;for(let s=e;s&&s!==t&&!n;s=s.parentElement)bo(s,o)&&(n=s);if(!n||n.hasAttribute("data-pipeup-id"))return n;let r=o.i(n);for(let s=n.parentElement;s&&s!==t&&Tn(o.i(s),r);s=s.parentElement)if(s.hasAttribute("data-pipeup-id"))return s;return n}function Sn(e,t,o){let n=o.i(e);for(let r=e.parentElement;r&&r!==t;){let s=yt(r,t,o);if(!s)return null;if(!Tn(o.i(s),n))return s;r=s.parentElement}return null}function xo(e=window){return{i:t=>t.getBoundingClientRect(),ce:t=>{let o=e.getComputedStyle(t),n=o.backgroundColor!=="transparent"&&!/,\s*0\)$/.test(o.backgroundColor),r=["top","right","bottom","left"].some(s=>parseFloat(o.getPropertyValue(`border-${s}-width`))>0);return n||r||o.backgroundImage!=="none"||o.boxShadow!=="none"},de:t=>/^(inline-)?(flex|grid)$/.test(e.getComputedStyle(t).display),flow:t=>{let o=e.getComputedStyle(t),n=[o.overflowX,o.overflowY];return{display:o.display,position:o.position,clips:n.some(r=>r==="hidden"||r==="clip")&&!n.some(r=>r==="auto"||r==="scroll")&&t!==e.document.documentElement&&t!==e.document.body,off:o.pointerEvents==="none"}},K:()=>({width:e.innerWidth,height:e.innerHeight})}}var Gr=(e,t)=>e.left<t.left+t.width&&t.left<e.left+e.width&&e.top<t.top+t.height&&t.top<e.top+e.height,Xr=(e,t)=>{let o=Math.max(e.left,t.left),n=Math.max(e.top,t.top);return{left:o,top:n,width:Math.max(0,Math.min(e.left+e.width,t.left+t.width)-o),height:Math.max(0,Math.min(e.top+e.height,t.top+t.height)-n)}};function Ln(e,t,o=()=>!0){let n=[],r=(s,l,a,f,d,h)=>{for(let T of s.children){if(T.hasAttribute("data-pipeup-ignore")||T.getAttribute("aria-hidden")==="true"||!o(T))continue;let M=t.flow?.(T)??Kr,p=T.offsetParent,g=M.position==="fixed"||M.position==="absolute"&&!!f&&!(p&&f.contains(p)),y=g?null:a,x=t.i(T),C=x.width>0&&x.height>0;if(y&&C&&!Gr(x,y))continue;let A=T.matches(kn),P=(M.display.startsWith("inline")||h)&&!T.matches(Yr)&&(M.display==="inline"||x.height<=Ur),k=x.width<=yo&&x.height<=yo,q=T.hasAttribute("data-pipeup-id")||!d&&!M.off&&!P&&!(k&&!A),W=l;q&&bo(T,t)&&(l&&Tn(t.i(l.e),x)?(T.hasAttribute("data-pipeup-id")||!l.e.hasAttribute("data-pipeup-id"))&&(l.e=T):n.push(W={e:T,C:l,m:0}));let F=M.clips&&C;r(T,W,F?y?Xr(y,x):x:y,F?T:g?null:f,d||A,/^inline-(flex|grid)$/.test(M.display)||h&&/(flex|grid)$/.test(M.display))}};r(e,null,null,null,!1,!1);for(let s=n.length-1;s>=0;s--){let l=n[s];l.C&&(l.C.m=Math.max(l.C.m,l.m+1))}return n}var nt=(e,t)=>e.filter(o=>o.m<=t&&(!o.C||o.C.m>t)),Eo=(e,t)=>e.filter(o=>o.C===t);var tn="a,button,summary,[role=button],[role=link],[role=switch],[role=tab],[role=checkbox],input[type=checkbox],input[type=radio],input[type=submit],input[type=button],input[type=reset]",Jr=`${tn},input,select,textarea,[contenteditable]:not([contenteditable=false]),[tabindex]:not([tabindex="-1"])`,ko=["click","dblclick","auxclick","submit","contextmenu","dragstart"],To=[...["over","out","enter","leave","down","up"].flatMap(e=>[`pointer${e}`,`mouse${e}`]),"mousemove","touchstart","touchmove","touchend","touchcancel"],Zr=400,An="Tab moves between blocks \xB7 \u2191 \u2193 change level \xB7 Enter comments \xB7 Esc to finish \xB7 F7 selects text",Qr=4,ei=150;function So(e,t=xo()){let o=v("span",{hidden:!0},An),n=v("div",{class:"pick"},o),r=[0,1].map(()=>{let i=v("div",{class:"km",tabindex:"-1",role:"button"},v("span",{hidden:!0}),v("span",{hidden:!0}));return i.inert=!0,i.addEventListener("keydown",Tt),i.addEventListener("click",u=>{u.stopPropagation(),Ye()}),i.addEventListener("focus",()=>n.classList.add("kf")),i.addEventListener("blur",()=>n.classList.remove("kf")),i}),s=v("span",{class:"lbl"}),l=(i,u,w,N)=>{let z=v("button",{class:"nb",type:"button","aria-label":i,title:u},te(w,16));return z.addEventListener("click",J=>{J.stopPropagation(),N()}),z},a=l("Around it","Select the block around it","expand",le),f=l("Inside it","Select a block inside it","shrink",Ce),d=l("Pin","Pin its centre","pin",()=>e.J(()=>_(g??k,{x:.5,y:.5}))),h=v("div",{class:"namebar",role:"group","aria-label":"Chosen block"},s,a,f,d);h.inert=!0;let T=e.n.querySelector(".launch");for(let i of[n,...r,h])e.n.insertBefore(i,T);h.addEventListener("mousedown",i=>i.preventDefault());let M=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,p=null,g=null,y=null,x=null,C=0,A=()=>{},E=null,P=()=>{},k=null,q=0,W=0,F=!1,Y=null,j=null,B=null,se=0,ce=-1,ve=!0,de=null,oe=null,pe=i=>!e.f(i)&&!(i.target instanceof Element&&i.target.closest("[data-pipeup-ignore]"));function Ae(){x&&(n.classList.toggle("glide",performance.now()<C),_e(n,x.getBoundingClientRect(),4))}function we(){if(!E)return;h.classList.toggle("glide",performance.now()<C&&h.classList.contains("show"));let i=E.getBoundingClientRect(),{left:u,top:w}=Jt({left:i.left,top:i.top,width:i.width,height:i.height},{width:h.offsetWidth||200,height:h.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});h.style.left=`${u}px`,h.style.top=`${w}px`}function b(i,u){x=i,C=u?performance.now()+Zr:0,Ae(),n.classList.add("show")}function O(i,u){let w=getComputedStyle(i);if(w.opacity==="0")return u(),()=>{};let N=0,z=()=>{window.clearTimeout(N),i.removeEventListener("transitionend",Se)},J=()=>{z(),u()},Se=ne=>{ne.target===i&&ne.propertyName==="opacity"&&J()},je=Math.max(...w.transitionDuration.split(",").map(ne=>parseFloat(ne)*1e3||0));return N=window.setTimeout(J,je+100),i.addEventListener("transitionend",Se),z}function $(i){if(i!==p){if(p=i,A(),!i){n.classList.remove("show");return}getComputedStyle(n).opacity==="0"?b(i,!1):M?(n.classList.remove("show"),A=O(n,()=>b(i,!1))):b(i,!0)}}function K(i){g=i,n.classList.toggle("on",i!==null),$(i),X(i)}function X(i){P(),h.inert=!i,i?M?(h.classList.remove("show"),P=O(h,()=>V(i))):V(i):(h.classList.remove("show"),E=null)}function V(i){s.textContent=s.title=Ie(i),a.hidden=Sn(i,e.root,t)===null,f.hidden=(k?D(i).length:Ln(i,t,ze).length)===0;let u=h.classList.contains("show");E=i,we(),u||(h.offsetWidth,h.classList.add("show"))}function _(i,u){let w;try{w=Bt(i,e.root,u,e.d.view(i))}catch(J){e.Z(J);return}let N={anchor:w,label:u?`Pin on ${Ie(i).replace(/^[A-Z](?=[a-z])/,J=>J.toLowerCase())}`:Ie(i),ranges:[],resolved:{state:"attached",element:i,range:null}},z=e.state.t;k&&(k=i,ce=-1),K(u?null:i),y=z??{...N,ranges:[]},z?e.ue({...N,ranges:[]}):e.Q(y),e.T(u?N.label:`Commenting on ${N.label}`)}function Q(i){e.J(()=>_(i))}function fe(i){let u=(i.target instanceof Element?yt(i.target,e.root,t):null)??e.root;u!==e.root&&(Y=u);let w=u.getBoundingClientRect();w.width&&w.height&&_(u,{x:(i.clientX-w.left)/w.width,y:(i.clientY-w.top)/w.height})}function $e(i){let u=window.getSelection();if(u&&!u.isCollapsed)return;if(e.state.t&&(i.altKey||!e.S())){e.F();return}if(!i.altKey&&e._(i.clientX,i.clientY))return;if(e.state.o&&e.open(null),k&&i.detail&&I(),i.altKey){fe(i);return}let w=i.target instanceof Element?yt(i.target,e.root,t):null;w&&(Y=w),w?_(w):(e.F(),K(null))}let Ue=i=>{if(e.f(i))return;if(!pe(i)){g||$(null);return}if(i.stopPropagation(),g||e.state.t)return;let u=!G()&&i.target instanceof Element?yt(i.target,e.root,t):null;if(k){if(!u||u===k||(se+=Math.abs(i.movementX)+Math.abs(i.movementY),se<=Qr))return;I()}u&&(Y=u),$(u)},G=()=>{let i=window.getSelection();return!!i&&!i.isCollapsed&&i.toString().trim()!==""},ye=()=>{G()&&(k&&I(),g||$(null))},Me=i=>{pe(i)&&(i.stopPropagation(),(i.type==="pointerdown"||i.type==="mousedown")&&i.target instanceof Element&&i.target.closest(Jr)&&i.preventDefault())},Ne=i=>{if(!pe(i))return;let u=i.target;if((u===oe||u.form&&u.form===oe?.form)&&(i.type==="submit"||i.type==="click"&&!i.detail)){oe=i.type==="click"&&u.type==="submit"?u.form:null;return}i.preventDefault(),i.stopPropagation(),i.type==="click"&&!e.state.c&&!e.pe(i)&&$e(i)},Be=i=>{if(oe=null,De="",i.key==="Tab"&&be(i))return i.preventDefault(),i.stopPropagation(),De=i.key,e.state.o&&e.open(null),e.state.c&&(e.state.c=!1,e.u()),U(i.shiftKey?-1:1);if(!(!pe(i)||!(i.target instanceof Element)))if((i.key==="Enter"||i.key===" ")&&i.target.closest(tn)){if(!k){oe=i.target;return}i.preventDefault(),i.stopPropagation()}else i.key==="Enter"&&!k&&i.target.form&&(oe=i.target)},be=i=>{if(i.ctrlKey||i.metaKey||i.altKey||i.isComposing)return!1;let u=i.composedPath()[0];return!(u instanceof Element)||r.some(w=>w===u)?!1:e.f(i)?!!u.closest(".launch,.menu")&&!u.closest("input,textarea,select,[contenteditable]"):!i.composedPath().some(w=>w instanceof Element&&w.hasAttribute("data-pipeup-ignore"))},xe=()=>e.n.getRootNode().activeElement,re=()=>r.some(i=>i===xe()),ze=i=>(i.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1||getComputedStyle(i).display==="contents")&&e.d.p(e.d.view(i)),ae=()=>(de?.some(i=>!i.e.isConnected)&&(de=null),de??=Ln(e.root,t,ze)),He=i=>ae().find(u=>u.e===i),Ee=(i,u=!1)=>{let w=i.getBoundingClientRect();return w.bottom>0&&w.top<window.innerHeight&&(!u||w.top>=0)},ke=()=>{let i=nt(ae(),0);return i.find(u=>Ee(u.e,!0))??i.find(u=>Ee(u.e))??i[0]},Te=i=>e.doc.threads().filter(u=>e.R(u)&&i.contains(Zt(e,u))).sort(Ke(e));function We(i,u){let[w,N]=i.children,z=nt(ae(),q),J=Te(u).length;w.textContent=`${Pt(u)}, ${z.findIndex(ne=>ne.e===u)+1} of ${z.length}${J?`, has ${J} comment${J===1?"":"s"}`:""}`;let Se=(u.innerText??u.textContent??"").length<=ei;N.textContent=mn(u);let je=ve?[o]:[];ve=!1,i.ariaLabelledByElements!==void 0?(i.ariaLabelledByElements=Se?[w,u]:[w,N],i.ariaDescribedByElements=Se?je:[...je,u]):i.setAttribute("aria-label",`${w.textContent}, ${N.textContent}`)}function m(i,u=!0){se=0;let w=ae(),N=w.find(J=>J.e===i);if(N&&!nt(w,q).includes(N)&&(q=N.m),i!==k&&(ce=-1),i!==g&&(g=null),k=i,$(i),X(i),i.scrollIntoView({block:"nearest",inline:"nearest",behavior:M?"auto":"smooth"}),!u)return;e.fe();let z=r[W^=1];We(z,i),_e(z,i.getBoundingClientRect(),4),z.inert=!1,z.focus({preventScroll:!0}),r[W^1].inert=!0}function S(){de=null;let i=document.activeElement;j=xe()??i;let u=He(Y),w=u??(i&&i!==document.body&&e.root.contains(i)&&!i.closest("[data-pipeup-ignore]")?ae().filter(N=>N.e.contains(i)).pop():void 0)??ke();return w?(u||(q=w.m),F=!0,m(w.e),!0):!1}function I(){let i=re();Y=k,k=null,$(null),X(null);for(let u of r)ee(u,!0);return i}function R(){let i=j;i&&i!==document.body&&i.isConnected&&i.focus?.({preventScroll:!0}),(!i||i===document.body||!i.matches?.(":focus"))&&e.n.querySelector(".launch .mode")?.focus({preventScroll:!0})}function D(i){let u=He(i);return u?Eo(ae(),u):[]}function H(i){let u=nt(ae(),q),w=u.findIndex(z=>z.e===k),N=u[w<0?i>0?0:u.length-1:(w+i+u.length)%u.length];N&&m(N.e)}function U(i){if(k)return H(i);de=null;let u=document.activeElement;j=xe()??u;let w=Y?.isConnected?Y:null,N=w&&He(w),z;if(N){q=N.m;let J=nt(ae(),q),Se=J.indexOf(N);z=J[(Se+i+J.length)%J.length]}else if(w){q=0;let J=nt(ae(),0),Se=ne=>(w.compareDocumentPosition(ne.e)&Node.DOCUMENT_POSITION_FOLLOWING)!==0,je=ne=>ne.e.contains(w);i>0?z=J.find(ne=>Se(ne)&&!je(ne))??J[0]:z=J.filter(ne=>!Se(ne)&&!je(ne)).pop()??J[J.length-1]}else z=ke(),z&&(q=z.m);if(!z)return e.T("Nothing here to comment on");F=!0,m(z.e)}function le(){let i=g??k,u=i&&Sn(i,e.root,t);if(!u)return e.T("Nothing around it");if((!B||!i.contains(B))&&(B=i),g)return Q(u);m(u)}function Ce(){let i=g??k,u=i?D(i):[],w=u.find(N=>B&&N.e.contains(B))??u.find(N=>Ee(N.e))??u[0];if(!w)return e.T("Nothing inside it");g?Q(w.e):m(w.e)}function Ye(i=!1){if(!k)return;if(e.state.t&&!e.S())return e.he();if(!i)return _(k);let u=Te(k);if(!u.length)return e.T("No comments on this block");ce=(ce+1)%u.length,e.open(u[ce].id),u.length>1&&e.T(`Comment ${ce+1} of ${u.length} on this block`)}function Tt(i){if(["Tab","ArrowUp","ArrowDown","Enter"," ","Escape"].includes(i.key)&&!(i.key.startsWith("Arrow")&&(i.metaKey||i.ctrlKey||i.altKey))){if(i.preventDefault(),i.stopPropagation(),De=i.key,i.key==="Escape")return void e.U();if(i.key==="Enter"||i.key===" ")return Ye(i.shiftKey&&i.key==="Enter");e.state.o&&e.open(null),i.key==="Tab"?H(i.shiftKey?-1:1):i.key==="ArrowUp"?le():Ce()}}let dt=()=>{let i=xe();return i?!!i.closest("[inert]"):!document.activeElement||document.activeElement===document.body},De="",c=!1,L=i=>{c&&window.removeEventListener("keyup",L,!0),i.key===De&&(De="",i.preventDefault(),i.stopPropagation())};window.addEventListener("keyup",L,!0),window.addEventListener("pointermove",Ue,!0),document.addEventListener("selectionchange",ye);for(let i of To)window.addEventListener(i,Me,!0);for(let i of ko)window.addEventListener(i,Ne,!0);return window.addEventListener("keydown",Be,!0),{U(){return g?(K(null),!0):!1},z:()=>k!==null,ge:()=>F&&!k,ee:S,W(){k&&!re()&&m(k)},u(){if(de=null,k&&!(k.isConnected&&ze(k))){let w=ke();w?m(w.e,re()||dt()):I()}let i=e.n.querySelector(".launch");if(i&&h.nextElementSibling!==i&&!re()&&!h.contains(xe()))for(let w of[n,...r,h])e.n.insertBefore(w,i);let u=e.state.t;y&&u!==y?(y=null,K(null),k&&m(k,dt())):u&&!y&&(p||g)&&K(null)},M(){Ae(),we(),k&&_e(r[W],k.getBoundingClientRect(),4)},destroy(){I()&&R();for(let i of r)i.remove();A(),P(),c=!0,De||window.removeEventListener("keyup",L,!0),window.removeEventListener("pointermove",Ue,!0),document.removeEventListener("selectionchange",ye);for(let i of To)window.removeEventListener(i,Me,!0);for(let i of ko)window.removeEventListener(i,Ne,!0);window.removeEventListener("keydown",Be,!0),n.classList.remove("show"),h.classList.remove("show"),ee(h,!0),O(n,()=>n.remove()),O(h,()=>h.remove())}}}var ti=300,ni=32,Mn=220,bt=320,oi=24,Lo=24;function Cn(e,t=!1){let o=e.ownerDocument.documentElement,n=o.getAttribute("data-pipeup-layout");if(n==="bubbles"||e.querySelector("[data-pipeup-slide]"))return null;let r=e.querySelector("article, main, [role=main]")??(n==="column"?e:null);if(!r)return null;if(o.hasAttribute("data-pipeup-reserve")){let a=o.clientWidth,d=getComputedStyle(r).maxWidth,h;return d.endsWith("px")?h=parseFloat(d):d.endsWith("%")?h=parseFloat(d)/100*a:h=r.getBoundingClientRect().width,n!=="column"&&a<h+bt-(t?oi:0)?null:{x:a-bt+Lo,width:bt-2*Lo}}let s=r.getBoundingClientRect().right;if(window.innerWidth-s<ti&&n!=="column")return null;let l=s+ni;return{x:l,width:Math.max(220,Math.min(300,window.innerWidth-l-16))}}function Pn(e,t){let o=e.resolved.get(t.id);return!o||o.state==="orphaned"&&!e.te.has(t.id)}function Ao(e){let t=v("div",{class:"col"});e.n.append(t);let o=new Map,n=null,r=new ResizeObserver(()=>a()),s=p=>Pn(e,p);function l(p){let g=e.resolved.get(p.id),y=g?xn(p.anchor,g):null;return y===null?Number.POSITIVE_INFINITY:y+window.scrollY-4}function a(){let p=[],g=[];for(let[E,P]of o){let k=l(P.thread);if(Number.isFinite(k))P.placed=k;else if(e.te.has(E)){if(P.placed===null){P.e.classList.add("wait");continue}k=P.placed}Number.isFinite(k)?p.push({id:E,w:k,height:P.e.offsetHeight}):g.push({id:E,height:P.e.offsetHeight})}let y=e.state.t,x=y?xn(y.anchor,y.resolved):null;n&&x!==null&&p.push({id:"draft",w:x+window.scrollY-4,height:n.e.offsetHeight});let C=vo(p,n?"draft":e.state.o),A=Math.max(0,...p.map(E=>(C.get(E.id)??0)+E.height))+24;for(let E of g)C.set(E.id,A),A+=E.height+10;for(let[E,P]of o){if(P.e.classList.contains("wait")){if(!C.has(E))continue;P.e.style.transition="none",P.e.style.transform=`translateY(${Math.round(C.get(E))}px)`,P.e.offsetWidth,P.e.style.transition="",P.e.classList.remove("wait");continue}P.e.style.transform=`translateY(${Math.round(C.get(E)??0)}px)`}n&&(n.e.style.transform=`translateY(${Math.round(C.get("draft")??0)}px)`)}function f(p,g){p.thread=g,p.lost=s(g),p.view.update(g,{lost:p.lost?g.anchor.snapshot:null})}function d(p){let g=s(p),y=ct(p,e.D,{H:"column",lost:g?p.anchor.snapshot:null}),x=v("div",{class:"th","data-thread":p.id},v("button",{class:"opn sr",type:"button","data-thread":p.id}),y.element);return x.style.transition="none",x.addEventListener("mouseenter",()=>e.E(p.id)),x.addEventListener("mouseleave",()=>e.E(null)),x.addEventListener("click",()=>e.open(p.id)),t.append(x),r.observe(x),{e:x,thread:p,lost:g,placed:null,view:y}}function h(){let p=e.state.t;if(n&&p&&n.of!==p){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Mn),n=null}if(p&&n&&(n.i.V(p.label),n.i.B(e.state.s&&!p.anchor.quote&&!p.anchor.point)),p&&!n){let g=Yt(e,p),y=v("div",{class:"th on"},g.element);y.style.transition="none",t.append(y),r.observe(y),n={e:y,i:g,of:p},g.B(e.state.s&&!p.anchor.quote&&!p.anchor.point),g.focus()}else if(!p&&n){let g=n.e;r.unobserve(g),g.classList.add("out"),window.setTimeout(()=>g.remove(),Mn),n=null,e.I(null)}}function T(p){ee(t,e.state.l);let g=new Set,y=[],x=e.state.o!==null||e.state.t!==null;for(let C of p){if(!e.R(C))continue;g.add(C.id);let A=o.get(C.id);A?(A.thread!==C||A.lost!==s(C))&&f(A,C):(A=d(C),o.set(C.id,A),y.push(A.e));let E=A.e,P=e.state.o===C.id;E.classList.toggle("on",P);let k=E.firstElementChild,q=C.root.replies.length;k.setAttribute("aria-label",`Open thread: ${ge(C.root.text,60)}, ${Qt(q)}`),k.setAttribute("aria-expanded",String(P)),ee(k,P);let W=E.querySelector(".more");W&&ee(W,!P),E.classList.toggle("dim",x&&!P),E.classList.toggle("hot",e.state.E===C.id&&!P),E.classList.toggle("resolved",C.resolved),E.classList.toggle("lost",A.lost)}for(let[C,A]of o)g.has(C)||(o.delete(C),r.unobserve(A.e),A.e.classList.add("out"),window.setTimeout(()=>A.e.remove(),Mn));h(),qt(t,p.filter(C=>g.has(C.id)).sort(Ke(e)).map(C=>o.get(C.id).e),n?.e??null)&&t.offsetWidth,a(),n&&y.push(n.e);for(let C of y)C.offsetWidth,C.style.transition=""}function M(){let p=Cn(e.root,!0);p&&(t.style.width=`${p.width}px`,t.style.transform=`translate(${p.x}px, ${-window.scrollY}px)`)}return{u:T,M,destroy(){r.disconnect(),e.I(null),t.remove()}}}var Mo="[data-pipeup-ignore],input,textarea,select,[contenteditable]:not([contenteditable=false])";function Co(e){let t=v("button",{type:"button","aria-label":"Comment",title:"Comment"},te("comment",17)),o=v("div",{class:"selbar"},t);o.inert=!0,e.n.append(o);let n=null,r=0,s=!1,l=p=>{let g=p&&(p.nodeType===Node.ELEMENT_NODE?p:p.parentElement);return!!g&&e.root.contains(g)&&!g.closest(Mo)};function a(){if(!n)return;let p=n.getBoundingClientRect(),{left:g,top:y}=Jt({left:p.left,top:p.top,width:p.width,height:p.height},{width:o.offsetWidth||36,height:o.offsetHeight||34},{width:window.innerWidth,height:window.innerHeight});o.style.left=`${g}px`,o.style.top=`${y}px`}function f(){n=null,o.inert=!0,o.classList.remove("show")}function d(p=!1){let g=window.getSelection();if(!e.state.s||!g||g.isCollapsed||g.rangeCount===0||!g.toString().trim()||!l(g.anchorNode)||!l(g.focusNode)){f();return}!n&&!p&&e.T("Enter comments on the selected words"),n=g.getRangeAt(0).cloneRange(),a(),o.inert=!1,o.classList.add("show")}t.addEventListener("mousedown",p=>p.preventDefault()),t.addEventListener("click",p=>{if(p.stopPropagation(),e.state.t&&!e.S())return e.F();let g=n;if(!g)return;let y;try{y=Nt(g,e.root,e.d.view(g.commonAncestorContainer))}catch(C){e.Z(C),f();return}let x=ge(g.toString().replace(/\s+/g," ").trim(),60);window.getSelection()?.removeAllRanges(),f(),e.Q({anchor:y,label:`\u201C${x}\u201D`,ranges:[g],resolved:{state:"attached",element:null,range:g}})});let h=()=>{if(window.clearTimeout(r),r=window.setTimeout(()=>s||d(),250),!n)return;let p=window.getSelection();(!p||p.isCollapsed||!p.toString().trim())&&f()};document.addEventListener("selectionchange",h);let T=p=>{p.type!=="keyup"&&(s=p.type==="mousedown"),!(s||e.f(p))&&window.setTimeout(()=>d(p.type==="mouseup"),0)};window.addEventListener("mousedown",T,!0),window.addEventListener("mouseup",T,!0),window.addEventListener("keyup",T,!0);let M=p=>{p.key!=="Enter"||!n||e.f(p)||p.target instanceof Element&&p.target.closest(`${Mo},${tn}`)||(p.preventDefault(),p.stopPropagation(),t.click())};return window.addEventListener("keydown",M,!0),{u(){!e.state.s&&n&&f()},M(){n&&a()},destroy(){window.removeEventListener("mousedown",T,!0),window.removeEventListener("mouseup",T,!0),window.removeEventListener("keyup",T,!0),window.removeEventListener("keydown",M,!0),window.clearTimeout(r),document.removeEventListener("selectionchange",h),o.remove()}}}async function On(e,t){try{await navigator.clipboard.writeText(e);return}catch{}let o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.cssText="position:fixed;opacity:0;pointer-events:none",t.append(o),o.select();let n=document.execCommand("copy");if(o.remove(),!n)throw new Error("pipeup: your browser blocked copying")}var ri=3e3,Po="Hidden on the page";function Oo(e){let t=[v("span",{class:"n"}),v("span",{class:"n"})],o=te("comment",20,1.4);o.lastElementChild.setAttribute("stroke-width","1.6");let n=v("button",{class:"mode",type:"button","aria-label":"Comment","aria-keyshortcuts":yn,"aria-haspopup":"menu","aria-expanded":"false"},v("span",{class:"plus"},o),v("span",{class:"cnt"},te("bubble",34,1.4),...t),v("span",{class:"dot"})),r=document.createTextNode("Comment"),s=v("span",{class:"ttip","aria-hidden":"true"},r,v("small",{},mt)),l=v("div",{class:"launch"},n,s),a=v("div",{class:"menu",role:"menu","aria-label":"Comments"}),f=v("div",{class:"list",role:"menu","aria-label":"All comments"}),d=v("span",{class:"pn"}),h=v("button",{class:"ib",type:"button","aria-label":"Close"},te("close")),T=v("button",{class:"hs",type:"button",role:"switch","aria-checked":"false"},"Show resolved",v("span",{class:"sw","aria-hidden":"true"}));T.addEventListener("click",m=>{m.stopPropagation(),e.c.ve()});let M=v("div",{class:"all",role:"dialog","aria-label":"All comments"},v("div",{class:"hd"},v("span",{},"All comments"),d,T,h),f),p=v("div",{class:"pop side",role:"dialog","aria-label":"Comment thread"});a.inert=M.inert=p.inert=!0,e.n.append(a,l,M);let g=!1,y=null,x=0,C=[],A=0,E=null,P=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,k=m=>{g=e.state.c=m,window.clearTimeout(x),x=0,m||y?.(!0),a.classList.toggle("show",m),ee(a,!m),n.setAttribute("aria-expanded",String(m))},q=(m,S=!1)=>{e.state.l!==m&&(e.state.l=m,e.u(),m?(W(f)[0]??h).focus({preventScroll:!0}):S&&n.focus({preventScroll:!0}))},W=(m=a)=>[...m.querySelectorAll(".mi")],F=()=>a.getRootNode().activeElement,Y=()=>{k(!1),n.focus({preventScroll:!0})},j=m=>{let S=W(m.currentTarget);if(S.length===0)return;let I=F(),R=S.indexOf(I),D=H=>{m.preventDefault(),S[(H+S.length)%S.length]?.focus({preventScroll:!0})};m.key==="ArrowDown"?D(R+1):m.key==="ArrowUp"?D(R<0?S.length-1:R-1):m.key==="Home"?D(0):m.key==="End"&&D(S.length-1)};a.addEventListener("keydown",j),f.addEventListener("keydown",j),h.addEventListener("click",m=>{m.stopPropagation(),q(!1,!0)});let B=m=>Pn(e,m),se=()=>C.filter(m=>!m.resolved&&!e.O(m)).length,ce=()=>C.filter(m=>!m.resolved&&e.O(m)).length,ve=()=>C.filter(m=>!m.resolved).length,de=m=>{let S=m.anchor.view?.slide,I=e.d.p(m.anchor.view)?"":It(m.anchor.view);return S&&e.d.slide()!==null?`On slide ${S}`:I?`In ${I}`:Po},oe=(m,S,I="")=>v("div",{role:"group","aria-label":I?`${m} \xB7 ${I}`:m},v("div",{class:"sec","aria-hidden":"true"},m,I&&v("b",{},I)),...S);function pe(m,S){let I=e.d.slide(),R=new Map;for(let D of m){let H=D.thread,U=I!==null?H.anchor.view?.slide??I:e.O(H)?e.d.p(H.anchor.view)?"":It(H.anchor.view):null;R.set(U,[...R.get(U)??[],D])}if(I===null){let D=R.get(null)??[];return R.delete(null),[...D.map(S),...[...R].map(([H,U])=>oe(H||Po,U.map(S)))]}return[...R].sort(([D],[H])=>Number(D)-Number(H)||0).map(([D,H])=>oe(`Slide ${D} \xB7 ${H.filter(U=>!U.thread.resolved).length} open`,H.map(S),D===I?"This slide":""))}function Ae(){let m=F()?.dataset.thread,S=e.c.all().filter(H=>!H.thread.resolved||e.state.k),I=H=>{let U=H.thread,le=Qe(U.root.author,U.root.name);le.classList.add("in");let Ce=v("button",{class:U.resolved?"mi done":"mi",type:"button",role:"menuitem","data-thread":U.id},le,v("span",{},v("span",{class:"clamp"},U.root.deleted?"Deleted":U.root.text),v("small",{},B(U)?`\u201C${ge(U.anchor.snapshot,80)}\u201D`:H.location.where)));return Ce.addEventListener("click",Ye=>{Ye.stopPropagation(),we(U.id,Ce.getBoundingClientRect().top)}),Ce},R=S.filter(H=>B(H.thread));d.textContent=String(ve()),T.setAttribute("aria-checked",String(e.state.k)),f.replaceChildren(S.length?"":v("div",{class:"sec",role:"presentation"},"No open comments"),...pe(S.filter(H=>!B(H.thread)),I),R.length?oe("No longer on the page",R.map(I)):"");let D=W(f);m&&D.find(H=>H.dataset.thread===m)?.focus({preventScroll:!0})}function we(m,S){tt()&&(e.state.L=!0,q(!1)),O(m,S)}let b="";function O(m,S){let I=C.find(R=>R.id===m);if(I){if(b=m,!e.O(I))return $(I,S);if(e.state.t&&!e.S())return e.F();e.d.Y(I.anchor.view??{}).then(()=>{e.ne();let R=C.find(D=>D.id===m);R&&b===m&&(e.state.l||e.state.L)&&$(R,S)})}}function $(m,S){let I=m.id,R=e.resolved.get(I),D=R&&!B(m)&&!e.O(m)?R.element??R.range?.startContainer.parentElement??null:null;if(D?.scrollIntoView({block:"center",inline:"nearest",behavior:P?"auto":"smooth"}),D&&R&&vt(m.anchor,R)&&D.checkVisibility?.({visibilityProperty:!0})!==!1){X(),e.open(I);return}e.open(null),tt()&&(e.state.L=!0,e.u()),K(m,S)}function K(m,S){let I=!B(m)&&e.O(m),R={quote:m.anchor.quote?.exact??null,lost:B(m)||I?m.anchor.snapshot:null,place:I?de(m):null};if(E?.id===m.id?E.view.update(m,R):(E={id:m.id,view:ct(m,e.D,{H:"popover",...R})},p.replaceChildren(E.view.element)),S===void 0)return;p.isConnected||(e.n.insertBefore(p,M),p.offsetWidth);let D=Gt(e.state.l),{left:H,top:U}=Xt({x:D.width,y:S,below:!1},{width:et,height:p.offsetHeight},D);p.style.left=`${H}px`,p.style.top=`${U}px`,p.classList.add("show"),p.inert=!1,e.we(m.id)}function X(m=!1){E&&(E=null,p.classList.remove("show"),ee(p,!0),m&&e.state.L&&(e.state.L=!1,e.u()))}function V(m,S,I,R=!1,...D){let H=v("button",{class:"mi",type:"button",role:R?"menuitemcheckbox":"menuitem"},m,v("span",{class:"lb"},S),...D,R&&v("span",{class:"sw","aria-hidden":"true"}),v("span",{class:"tt","aria-hidden":"true"}));return H.addEventListener("click",U=>{U.stopPropagation(),I(U)}),H}let _=(m,S,I,R)=>{let D=m.querySelector(".lb");D.textContent!==S&&(D.textContent=S),m.querySelector(".tt").textContent=I,m.setAttribute("aria-description",I),R!==void 0&&m.setAttribute("aria-checked",String(R))},Q=()=>v("div",{class:"sep",role:"separator"}),fe=v("span",{class:"ma"}),$e=v("span",{class:"kc"}),Ue="",G=V(fe,"",ae,!1,$e);G.dataset.item="name";let ye=V(te("copy"),"Copy as Markdown",()=>{Y(),e.c.copyAll("ai")}),Me=V(te("lines"),"Copy as Text",()=>{Y(),e.c.copyAll("text")}),Ne=v("span",{class:"kc"}),Be=V(te("list"),"All comments",()=>{k(!1),q(!0)},!1,Ne),be=V(te("comment"),"Start commenting",m=>{let S=!e.state.s&&m.detail===0;e.ye(!e.state.s,S),S&&k(!1)},!0,v("span",{class:"kc","aria-hidden":"true"},mt));be.dataset.item="comment",be.setAttribute("aria-keyshortcuts",yn);let xe=[G,Q(),ye,Me,Be,Q(),be];function re(){let m=ve(),S=e.c.name(),I=S||Le(e.doc.me);if(_(G,I,S?"The name on your comments":"Add a name to show on your comments"),G.setAttribute("aria-label",`${I}, ${S?"edit":"add"} your name`),$e.replaceChildren(S?te("edit",13):"Add name"),ht(e.doc.me,S)!==Ue){Ue=ht(e.doc.me,S);let R=Qe(e.doc.me,S);R.classList.add("in"),fe.replaceChildren(R)}_(ye,"Copy as Markdown","Markdown, with where each thread is"),_(Me,"Copy as Text","Just the words"),_(Be,"All comments","Every thread, and where it is"),Ne.textContent=m?String(m):"",_(be,"Start commenting",e.state.s?"Turn off to hide the comments again":"Shows the comments; choose any part of the page to comment on it",e.state.s)}function ze(){re(),a.firstChild!==G&&a.replaceChildren(...xe)}function ae(){let m=v("input",{class:"input",type:"text",maxlength:"80","aria-label":"Your name"});m.value=e.c.name();let S=v("div",{class:"ed"},fe.cloneNode(!0),m),I=(R,D=!1)=>{if(y!==I)return;y=null;let H=m.value.trim();R&&H&&H!==e.c.name()&&e.c.rename(H).then(re),S.replaceWith(G),D&&G.focus({preventScroll:!0})};y=I,m.addEventListener("keydown",R=>{R.stopPropagation(),(R.key==="Enter"||R.key==="Escape")&&(R.preventDefault(),I(R.key==="Enter",!0))}),m.addEventListener("blur",()=>I(!0)),G.replaceWith(S),m.focus({preventScroll:!0})}n.addEventListener("click",m=>{if(m.stopPropagation(),g){k(!1);return}ze(),k(!0),m.detail===0&&W().at(-1)?.focus({preventScroll:!0})});let He=!1,Ee=()=>{He=M.contains(F())},ke=m=>{let S=m.composedPath();g&&!S.includes(a)&&!S.includes(n)&&(k(!1),e.state.s&&!e.f(m)&&(e.X(m),m.preventDefault(),m.stopPropagation())),e.state.l&&!e.f(m)&&q(!1,He&&(!document.activeElement||document.activeElement===document.body)),!S.includes(p)&&!S.includes(M)&&X(!0)},Te=m=>{if(!g||m.pointerType==="touch"||m.type==="pointerout"&&m.relatedTarget)return;let S=m.composedPath();m.type==="pointerover"&&(S.includes(a)||S.includes(n))?(window.clearTimeout(x),x=0):x||(x=window.setTimeout(()=>{x=0,y||k(!1)},ri))};window.addEventListener("pointerdown",Ee,!0),window.addEventListener("click",ke,!0),window.addEventListener("pointerover",Te,!0),window.addEventListener("pointerout",Te,!0);let We=m=>{if(m.key!=="Escape"||y)return;let S=m.composedPath()[0];if(g)Y();else if(e.state.l&&!(S instanceof HTMLTextAreaElement&&!M.contains(S)))q(!1,!0);else if(E)X(!0),e.D.close();else return;m.stopPropagation()};return window.addEventListener("keydown",We,!0),{u(m){C=m;let S=se();if(S!==A){if(S){let[U,le]=t[0].classList.contains("on")?t:[t[1],t[0]];le.textContent=S>99?"99+":String(S),le.classList.toggle("s",S>99),U.classList.remove("on"),le.classList.add("on")}n.classList.toggle("has",S>0),A=S}let I=ce(),R=I?`${S} here \xB7 ${I} ${e.d.slide()!==null?"on other slides":"in other views"}`:"";n.classList.toggle("else",I>0);let D=`Comment${e.state.s?", comment mode on":""}${R?`, ${R}`:S?`, ${S} open`:""}`;n.getAttribute("aria-label")!==D&&n.setAttribute("aria-label",D),r.data!==(R||"Comment")&&(r.data=R||"Comment"),n.classList.toggle("on",e.state.s),g&&!e.state.c&&k(!1),g&&re();let H=e.state.l;if(M.classList.toggle("full",tt()),M.classList.contains("show")!==H&&(M.classList.toggle("show",H),ee(M,!H)),H&&Ae(),E){let U=m.find(le=>le.id===E?.id);!U||e.state.o||U.resolved&&!e.state.k?X():K(U)}},M(){},destroy(){window.removeEventListener("pointerdown",Ee,!0),window.removeEventListener("click",ke,!0),window.removeEventListener("pointerover",Te,!0),window.removeEventListener("pointerout",Te,!0),window.clearTimeout(x),window.removeEventListener("keydown",We,!0),a.remove(),M.remove(),p.remove(),l.remove()}}}var xt="[data-pipeup-slide]",Io=1e3,Ro=["scroll","resize","keyup","click","transitionend","slidechanged"],In=null,kt=null,nn=new Set,Rn=new Set,Et=e=>{try{e()}catch(t){globalThis.reportError?.(t)}};function No(e){let t=null;if(e){t={};let o=0;for(let[n,r]of Object.entries(e))if(!(typeof r!="string"||n==="slide"||n.length>Z.viewKey||r.length>Z.viewValue)){if(++o>=Z.viewEntries)break;t[n]=r}}In=t;for(let o of Rn)o()}function Bo(e){return nn.add(e),()=>void nn.delete(e)}function on(e){kt=typeof e?.current=="function"&&typeof e.go=="function"?e:null}function ii(e,t,o){let n=t.K(),r=null,s=0,l=0;for(let a of e){if(!t.shown(a))continue;let f=t.i(a),d=Math.min(f.left+f.width,n.width)-Math.max(f.left,0),h=Math.min(f.top+f.height,n.height)-Math.max(f.top,0);if(d<=0||h<=0)continue;let T=Math.round(d*h),M=t.opacity(a);(T>s||T===s&&(M>l||M===l&&a===o))&&(r=a,s=T,l=M)}return r}function si(e,t,o){return t!==null?e?.slide===void 0||e.slide===t:!e||!o?!0:Object.entries(e).every(([n,r])=>n==="label"||n==="slide"||o[n]===r)}function ai(){return{i:e=>e.getBoundingClientRect(),shown:e=>e.checkVisibility?.({opacityProperty:!0,visibilityProperty:!0})!==!1,opacity:e=>parseFloat(getComputedStyle(e).opacity)||0,K:()=>({width:window.innerWidth,height:window.innerHeight})}}var $o=()=>{let e=window.Reveal;return typeof e?.getIndices=="function"&&typeof e.slide=="function"?e:null};function Ho(e,t,o=ai()){let n=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,r=null,s=null,l=0,a=!1,f=()=>[...e.querySelectorAll(xt)],d=()=>[...e.querySelectorAll(".slides > section")],h=A=>typeof A=="string"&&A.length>0&&A.length<=Z.viewValue?A:null,T=A=>h(A?.getAttribute("data-pipeup-slide"));function M(){if(kt){let E=null;if(Et(()=>{let P=kt.current();Number.isInteger(P)&&P>0&&(E=String(P))}),E!==null)return E}let A=$o();if(A){let E=null;if(Et(()=>{let P=A.getIndices().h,k=d()[P];E=T(k?.matches(xt)?k:k?.querySelector(xt))??h(String(P+1))}),E!==null)return E}return r&&!r.isConnected&&(r=null),r=ii(f(),o,r)??r,T(r)}function p(){l=0,s=M(),t()}let g=()=>{!l&&!a&&(l=requestAnimationFrame(p))},y=A=>si(A,s,In);function x(A){if(y(A))return Promise.resolve(!0);let E=A.slide,P=$o(),k=f().find(F=>T(F)===E),q=/^[1-9]\d{0,5}$/.test(E??"");if(q&&kt)Et(()=>kt.go(Number(E)));else if(q&&P){let F=k?d().findIndex(Y=>Y===k||Y.contains(k)):-1;Et(()=>P.slide(F>=0?F:Number(E)-1))}else if(nn.size)for(let F of nn)Et(()=>F({...A}));else if(k)k.scrollIntoView({block:"start",behavior:n?"auto":"smooth"});else return Promise.resolve(!1);let W=performance.now();return new Promise(F=>{let Y=se=>{clearTimeout(j),F(se)},j=setTimeout(()=>Y(!1),Io),B=()=>{if(a)return Y(!1);if(s=M(),y(A))return Y(!0);if(performance.now()-W>=Io)return Y(!1);requestAnimationFrame(B)};requestAnimationFrame(B)})}let C=new MutationObserver(A=>{A.some(E=>E.target instanceof Element&&E.target.matches(xt))&&g()});C.observe(e,{subtree:!0,attributes:!0,attributeFilter:["class","style","hidden"]});for(let A of Ro)window.addEventListener(A,g,{capture:!0,passive:!0});return Rn.add(g),s=M(),{slide:()=>s,view(A){let E=A instanceof Element?A:A?.parentElement,P=T(E?.closest(xt))??s,k={...P!==null?{slide:P}:{},...In};return Object.keys(k).length?k:void 0},p:y,Y:x,destroy(){a=!0,cancelAnimationFrame(l),C.disconnect();for(let A of Ro)window.removeEventListener(A,g,!0);Rn.delete(g)}}}var Fo=["pipeup-quote","pipeup-on","pipeup-done"],li={"pipeup-quote":[[250,227,188,.75],[250,200,100,.28]],"pipeup-on":[[247,212,154,.95],[250,200,100,.42]],"pipeup-done":[[180,178,169,.22],[180,178,169,.2]]},ci=(e,t)=>Fo.map(o=>{let[n,r,s,l]=li[o][e?1:0];return`::highlight(${o}){background-color:rgba(${n},${r},${s},${+(l*t).toFixed(3)})}`}).join("");function Vo(){return typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u"}var di="<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><rect x='7' y='7' width='23' height='23' rx='4' fill='none' stroke='#534AB7' stroke-width='2' stroke-dasharray='4 3'/><path d='M3 2v15l4-3.5 3 6.5 2.5-1.2-3-6.3H15z' fill='#fff' stroke='#2C2C2A' stroke-width='1.2' stroke-linejoin='round'/></svg>",ui=`:not([data-pipeup-ignore],[data-pipeup-ignore] *){cursor:url("data:image/svg+xml,${encodeURIComponent(di)}") 3 2,crosshair!important}`;function qo(e=document,t=!1){let o=e.defaultView?.CSSStyleSheet;if(!o||!("replaceSync"in o.prototype)||!("adoptedStyleSheets"in e))return{oe(){},re(){},j(){},ie(){},remove:()=>Do()};let n=new o,r=null,s=!1,l=1,a=0,f="",d=0,h=()=>n.replaceSync(ci(t,l)+(r===null?"":`:root{--pipeup-gutter:${r}px}`)+(s?ui:"")+(a||f?`html{--pipeup-panel:${a}px;${a?`margin-right:${a}px!important;`:""}${f}}`:""));return h(),e.adoptedStyleSheets=[...e.adoptedStyleSheets,n],{oe(T){T!==r&&(r=T,h())},re(T){T!==s&&(s=T,h())},j(T){l=T,h()},ie(T,M){T!==a&&(a=T,f=M?"":"transition:margin-right .34s cubic-bezier(.4,0,.2,1)!important",clearTimeout(d),!T&&f&&(d=window.setTimeout(()=>{f="",h()},400)),h())},remove(){clearTimeout(d),e.adoptedStyleSheets=e.adoptedStyleSheets.filter(T=>T!==n),Do()}}}function _o(e){Vo()&&(CSS.highlights.set("pipeup-quote",new Highlight(...e.quote)),CSS.highlights.set("pipeup-on",new Highlight(...e.on)),CSS.highlights.set("pipeup-done",new Highlight(...e.done)))}function Do(){if(Vo())for(let e of Fo)CSS.highlights.delete(e)}var $n=':host{all:initial}*{box-sizing:border-box}button{-webkit-appearance:none;appearance:none;font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}svg{display:block}.layer{all:initial;display:block;position:fixed;inset:0;pointer-events:none;font:13px/1.5 var(--pu-font,system-ui,sans-serif);color:var(--k);--k:#2C2C2A;--mu:#5F5E5A;--fa:#888780;--ln:#E5E3DA;--ru:#ECEAE2;--so:#FAFAF7;--su:#FFFFFF;--ho:#F1EFE8;--as:color-mix(in srgb,var(--pu-accent,#534AB7) 12%,transparent);--sh:0 8px 28px rgba(44,44,42,.1);--in:.26s;--mv:.34s;--out:.2s;--pl:1.2s;--eo:cubic-bezier(.22,.61,.36,1);--eio:cubic-bezier(.4,0,.2,1);--ei:cubic-bezier(.4,0,1,1)}.layer.dark{--k:#ECEBE6;--mu:#B4B2A9;--fa:#8D8B84;--ln:#3A3936;--ru:#34332F;--so:#22221F;--su:#1B1B19;--ho:#2C2C29;--sh:0 8px 28px rgba(0,0,0,.45)}.layer.hidden .bub,.layer.hidden .col,.layer.hidden .pop,.layer.hidden .tip,.layer.hidden .mark,.layer.hidden .selbar{opacity:0!important;pointer-events:none!important}.tx{font-size:14px;line-height:1.5;color:var(--k);white-space:pre-wrap;overflow-wrap:anywhere}.tx.del,.who,.rest,.ctx{color:var(--fa)}.who,.rest{font-size:12px}.who{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rft>.who{display:block}.ctx[hidden]{display:none}.ctx{font-size:12px;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tx a{color:var(--pu-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}.ft,.rft{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows var(--in) var(--eo),opacity var(--in) var(--eo)}.ft>*,.rft>*{overflow:hidden;min-height:0;display:flex;align-items:center}.root:hover>.ft,.root:focus-within>.ft,.it:hover>.rft,.it:focus-within>.rft{grid-template-rows:1fr;opacity:1}.ft.has-rest{grid-template-rows:1fr;opacity:1}.ft.has-rest>*{grid-area:1/1}.ft .hover{opacity:0;transition:opacity var(--in) var(--eo)}.ft .rest{transition:opacity var(--in) var(--eo)}.root:hover>.ft .hover,.root:focus-within>.ft .hover,.ft:not(.has-rest) .hover{opacity:1}.root:hover>.ft .rest,.root:focus-within>.ft .rest{opacity:0}.acts{margin-left:6px;display:flex;flex:none}.ib{width:24px;height:22px;display:grid;place-items:center;border-radius:6px;color:var(--mu);transition:background-color .2s var(--eo),color .2s var(--eo)}.ib:hover,.ib:focus-visible{background:var(--ho);color:var(--k);outline:none}.rps,.rbox{padding-left:14px}.rps .it{padding-top:6px}.more{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--mv) var(--eio)}.more>div{overflow:hidden;min-height:0}.th:not(.on) .more{grid-template-rows:0fr}.row{display:flex;align-items:center;gap:8px;padding:8px 0 2px;cursor:text}.input{flex:1;min-width:0;height:27px;display:block;border:0;border-bottom:1px solid var(--ln);outline:none;resize:none;overflow:hidden;font:inherit;font-size:14px;line-height:1.5;padding:3px 0;color:var(--k);background:transparent;transition:border-color var(--in) var(--eo)}.row:hover .input,.input:hover{border-bottom-color:var(--mu)}.input:focus{border-bottom-color:var(--pu-accent)}.ed{display:flex;gap:10px;align-items:center;min-height:34px;padding:6px 10px}.ed .input{font-size:13px;height:22px}.root,.it{position:relative;padding-right:30px}.av{display:grid;place-items:center;width:22px;height:22px;border-radius:32%;font-size:12px;font-weight:600;line-height:1;opacity:0;transform:scale(.85);transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.av.in{opacity:1;transform:none}.av svg{width:80%;height:80%}.root>.av,.it>.av{position:absolute;top:0;right:0}.it>.av{top:6px}.av{--av-l:92%;--av-d:30%;--s:60%;background:hsl(var(--h) var(--s) var(--av-l));color:hsl(var(--h) var(--s) var(--av-d))}.dark .av{--av-l:20%;--av-d:78%}.c0{--h:0}.c1{--h:25}.c2{--h:50}.c3{--h:130}.c4{--h:175}.c5{--h:215}.c6{--h:270}.c7{--h:330}.c8{--h:28;--s:35%}.c9{--h:220;--s:8%}.me{flex:none;display:grid}.me>.av{grid-area:1/1;width:26px;height:26px;font-size:13px}.you{display:grid;padding:0 34px;min-height:24px;font-size:12px;color:var(--fa)}.you>*{grid-area:1/1;display:flex;align-items:center;min-width:0;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.say{white-space:pre;overflow:hidden}.nm{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.say button{flex:none}.say button{color:var(--mu);text-decoration:underline;text-decoration-color:var(--ln);text-underline-offset:2px;transition:color .2s var(--eo)}.say button:hover,.say button:focus-visible{color:var(--pu-accent);outline:none}.nf{opacity:0;transform:translateY(-4px);pointer-events:none}.nf .input{font-size:13px;height:24px}.you.naming .nf{opacity:1;transform:none;pointer-events:auto}.you.naming .say{opacity:0;pointer-events:none}.send{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;color:var(--pu-accent);flex:none;opacity:0;pointer-events:none;transition:opacity var(--in) var(--eo),background-color .2s var(--eo)}.send.show{opacity:1;pointer-events:auto}.send:hover{background:var(--as)}.bub{position:fixed;left:0;top:0;width:20px;height:20px;margin:-20px 0 0 -2px;border-radius:50% 50% 50% 0;background:var(--pu-accent);border:2px solid var(--su);box-shadow:0 1px 4px #0003;pointer-events:auto;opacity:0;transform:translateY(-6px) scale(.9);transform-origin:2px 20px;transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.bub.in{opacity:1;transform:none;transition:opacity var(--in) var(--eo),transform var(--in) var(--eo)}.bub.in:hover,.bub.on{transform:scale(1.18)}.bub.done{background:var(--fa)}.bub.ghost{pointer-events:none}.tip,.pop,.menu,.all,.toast,.selbar{background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh)}.tip{position:fixed;max-width:260px;border-radius:10px;padding:7px 10px;opacity:0;transform:translateY(3px);transition:opacity .22s var(--eo),transform .26s var(--eo)}.tip.show{opacity:1;transform:none;pointer-events:auto;cursor:pointer;transition:opacity .22s var(--eo),transform .26s var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.pop{position:fixed;width:var(--pu-pop);border-radius:12px;padding:10px 12px 8px;pointer-events:none;opacity:0;transform:translateY(6px) scale(.98);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.pop.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.pop.show.glide{transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo),left var(--mv) var(--eio),top var(--mv) var(--eio)}.mark{position:fixed;border:2px solid color-mix(in srgb,var(--pu-accent) 50%,transparent);background:var(--as);border-radius:8px;opacity:0;transition:opacity .3s var(--eo)}.mark.show{opacity:1}.pulse{position:fixed;border:2px solid var(--pu-accent);border-radius:8px;background:var(--as);animation:pu-pulse var(--pl) var(--eio) forwards}@keyframes pu-pulse{0%{opacity:0;transform:scale(.985)}35%{opacity:.85;transform:scale(1)}to{opacity:0;transform:scale(1.02)}}.col{position:fixed;left:0;top:0;pointer-events:none;transition:opacity var(--in) var(--eo)}.th{position:absolute;left:0;right:0;top:0;padding:4px 4px 4px 12px;pointer-events:auto;cursor:pointer;box-shadow:inset 2px 0 0 transparent;transition:transform var(--mv) var(--eio),box-shadow var(--in) var(--eo),opacity var(--in) var(--eo)}.th.hot{box-shadow:inset 2px 0 0 var(--ln)}.th.on{box-shadow:inset 2px 0 0 var(--pu-accent);cursor:default}.th.dim{opacity:.45}.th.resolved:not(.on):not(.hot){opacity:.6}.th.lost .ctx{white-space:normal}.th.wait{opacity:0!important;pointer-events:none}.th.out{opacity:0!important;pointer-events:none;transition:opacity var(--out) var(--ei)}.th:has(.opn:focus-visible){box-shadow:inset 2px 0 0 var(--ln);outline:2px solid var(--pu-accent);outline-offset:2px;border-radius:4px}.selbar{position:fixed;display:flex;border-radius:10px;padding:2px;opacity:0;transform:translateY(4px);pointer-events:none;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.selbar.show{opacity:1;transform:none;pointer-events:auto}.selbar button{width:32px;height:30px;display:grid;place-items:center;border-radius:8px;color:var(--pu-accent);transition:background-color .2s var(--eo)}.selbar button:hover,.selbar button:focus-visible{background:var(--as);outline:none}.pick{position:fixed;left:0;top:0;border:2px solid color-mix(in srgb,var(--pu-accent) 70%,transparent);background:color-mix(in srgb,var(--pu-accent) 6%,transparent);border-radius:8px;pointer-events:none;opacity:0;transition:opacity var(--out) var(--ei),border-color var(--out) var(--ei),border-width var(--out) var(--ei),box-shadow var(--out) var(--ei)}.pick.show{opacity:1;transition-duration:var(--in);transition-timing-function:var(--eo)}.pick.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.pick.on{border-color:var(--pu-accent)}.pick.kf{border:3px solid var(--pu-accent);box-shadow:0 0 0 2px var(--su)}.km{position:fixed;left:0;top:0;pointer-events:none;outline:none}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.namebar{position:fixed;left:0;top:0;display:flex;align-items:center;gap:2px;padding:2px 2px 2px 10px;border-radius:10px;font-size:12px;color:var(--mu);white-space:nowrap;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(4px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.namebar.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform .3s var(--eo)}.namebar.show.glide{transition-property:all;transition-duration:var(--mv);transition-timing-function:var(--eio)}.namebar .lbl{margin-right:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis}.namebar .nb{padding:4px;display:grid;place-items:center;border-radius:7px;transition:background-color .2s var(--eo),color .2s var(--eo)}.namebar .nb:hover,.namebar .nb:focus-visible{background:var(--ho);color:var(--k);outline:none}.namebar .nb[hidden]{display:none}.launch{position:fixed;right:20px;bottom:20px;pointer-events:auto}.launch .mode{position:relative;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);transition:background-color .3s var(--eo),color .3s var(--eo)}.mode>*,.cnt>*{grid-area:1/1}.mode>*{display:grid;place-items:center;transition:opacity var(--in) var(--eo)}.cnt,.has>.plus{opacity:0}.has>.cnt{opacity:1}.n{font-size:12px;font-weight:500;line-height:1;margin:-1.4px 0 0 1.4px;font-variant-numeric:tabular-nums;opacity:0;transition:opacity var(--in) var(--eo)}.n.s{font-size:9.5px;letter-spacing:-.04em}.n.on{opacity:1}.launch .mode:hover,.launch .mode[aria-expanded=true]{background:var(--ho)}.launch .mode.on{background:var(--pu-accent);color:#fff}.mode>.dot{position:absolute;top:3px;right:3px;width:9px;height:9px;border-radius:50%;background:var(--pu-accent);border:2px solid var(--su);opacity:0}.mode.else>.dot{opacity:1}.ttip{position:absolute;right:0;bottom:54px;white-space:nowrap;border-radius:8px;padding:4px 9px;font-size:12px;background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translateY(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.ttip small{margin-left:8px}.ttip small,.mi .kc{font-size:12px;color:var(--fa)}.mode:hover+.ttip,.mode:focus-visible+.ttip{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}.launch .mode[aria-expanded=true]+.ttip{opacity:0;transition:opacity var(--out) var(--ei)}@media(hover:none){.ttip,.tt{display:none}}.menu{position:fixed;right:20px;bottom:76px;width:290px;border-radius:12px;padding:4px;pointer-events:none;opacity:0;transform:translateY(6px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.menu.show{opacity:1;transform:none;pointer-events:auto;transition:opacity var(--in) var(--eo),transform var(--mv) var(--eo)}.mi{position:relative;display:flex;gap:10px;align-items:center;width:100%;min-height:34px;text-align:left;padding:6px 10px;border-radius:8px;transition:background-color .2s var(--eo)}.mi:hover,.mi:focus-visible{background:var(--so);outline:none}.mi svg{color:var(--mu);flex:none}.mi small{display:block;color:var(--fa);font-size:12px}.lb{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ma{flex:none;display:grid;margin:-2px 0}.ma .av{width:20px;height:20px;font-size:11px}.mi .av svg{color:inherit}.sep{height:1px;margin:4px 10px;background:var(--ru)}.tt{position:absolute;right:calc(100% + 14px);top:50%;translate:0 -50%;width:max-content;max-width:220px;padding:4px 9px;border-radius:8px;font-size:12px;line-height:1.4;color:var(--mu);background:var(--su);border:1px solid var(--ln);box-shadow:var(--sh);pointer-events:none;opacity:0;transform:translate(3px);transition:opacity var(--out) var(--ei),transform var(--out) var(--ei)}.mi:hover>.tt,.mi:focus-visible>.tt{opacity:1;transform:none;transition:opacity var(--in) var(--eo) .5s,transform var(--in) var(--eo) .5s}@media(max-width:600px){.tt{right:8px;top:auto;bottom:100%;translate:none;transform:translateY(3px)}}.sw{position:relative;flex:none;width:26px;height:16px;border-radius:8px;background:var(--ln);transition:background-color var(--mv) var(--eio)}.sw:before,.sw:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #00000040;transition:transform var(--mv) var(--eio),opacity var(--mv) var(--eio)}.sw:before{opacity:0;transform:translate(10px)}[aria-checked=true]>.sw{background:var(--pu-accent)}[aria-checked=true]>.sw:after{transform:translate(10px)}.all{position:fixed;top:0;right:0;bottom:0;width:var(--pu-panel);display:flex;flex-direction:column;border-width:0 0 0 1px;opacity:0;transform:translate(100%);transition:transform var(--out) var(--ei),opacity var(--out) var(--ei)}.all.show{opacity:1;transform:none;pointer-events:auto;transition:transform var(--mv) var(--eo),opacity var(--in) var(--eo)}.all.full{width:100%}.hd{display:flex;align-items:center;gap:8px;padding:12px 10px 8px 16px;font-weight:600}.pn{font-weight:400;color:var(--fa)}.hs{margin-left:auto;display:flex;align-items:center;gap:6px;padding:3px 4px 3px 6px;border-radius:6px;font-size:12px;font-weight:400;color:var(--mu);transition:background-color .2s var(--eo)}.hs:hover,.hs:focus-visible{background:var(--ho);outline:none}.list{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px}.all .mi{align-items:flex-start}.all .mi>.av{flex:none}.all .mi>span:last-child{flex:1;min-width:0}.all .mi small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.all .mi .av svg{margin:0}.all .mi.done{opacity:.6}.layer.listing .col{opacity:0;transition:opacity var(--out) var(--ei)}.sec{padding:8px 10px 2px;font-size:12px;color:var(--fa)}.sec b{margin-left:6px;font-weight:500;color:var(--pu-accent)}.toast{position:fixed;left:50%;bottom:28px;border-radius:10px;padding:8px 14px;font-size:13px;opacity:0;transform:translate(-50%,6px);transition:opacity .3s var(--eo),transform .36s var(--eo)}.toast.show{opacity:1;transform:translate(-50%)}@media(forced-colors:active){.pick.kf{border:3px solid Highlight}.layer :is(.ib,.mi,.nb,.hs,.selbar button,.say button):focus-visible{outline:2px solid Highlight}}@media(prefers-reduced-motion:reduce){.bub,.bub.in,.bub.in:hover,.bub.on,.tip,.pop,.selbar,.menu,.all,.ttip,.tt,.toast{transform:none!important}.sw:after{transform:none!important;transition-property:opacity}[aria-checked=true]>.sw:after{opacity:0}[aria-checked=true]>.sw:before{opacity:1}.th{transition-property:opacity,box-shadow}.tip.show{transition-property:opacity}.pick,.pick.show{transition:opacity .16s ease-in-out}.all,.all.show{transition-property:opacity}.namebar,.namebar.show{transform:none!important;transition:opacity .16s ease-in-out}.av,.nf{transform:none!important}@keyframes pu-pulse{0%{opacity:0}35%{opacity:.85}to{opacity:0}}}';var Ko="#534AB7",pi="rgb(0, 0, 238)";function Uo(e){let t=/rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)/.exec(e);if(!t||t[1]===void 0||t[2]===void 0||t[3]===void 0)return null;let o=t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]);return{r:Number(t[1]),g:Number(t[2]),b:Number(t[3]),a:o}}function fi(e){let t=o=>{let n=o/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function zo(e){let t=e.ownerDocument,o=t.defaultView;if(!o)return{font:"system-ui, sans-serif",accent:Ko,dark:!1};let n=t.documentElement,r=o.getComputedStyle(e).fontFamily||"system-ui, sans-serif",s=(o.getComputedStyle(n).getPropertyValue("--pipeup-accent")||n.style.getPropertyValue("--pipeup-accent")).trim(),l=e.querySelector("a[href]"),a=l?o.getComputedStyle(l).color:"",f=s||(a&&a!==pi?a:Ko),d=Uo(o.getComputedStyle(t.body).backgroundColor);(!d||d.a===0)&&(d=Uo(o.getComputedStyle(n).backgroundColor));let h=d&&d.a>0?fi(d)<.2:o.matchMedia?.("(prefers-color-scheme: dark)").matches===!0&&/dark/.test(o.getComputedStyle(n).colorScheme||"");return{font:r,accent:f,dark:!!h}}function Wo(e,t){e.style.setProperty("--pu-font",t.font),e.style.setProperty("--pu-accent",t.accent),e.classList.toggle("dark",t.dark)}function Yo(e,t=document){let o=t.createElement("pipeup-root");o.setAttribute("data-pipeup-ignore",""),o.style.cssText="position:fixed!important;inset:0!important;pointer-events:none!important;z-index:2147483000!important;display:block!important;margin:0!important;visibility:visible!important;opacity:1!important;transform:none!important;filter:none!important;";let n=o.attachShadow({mode:"open"}),r=t.defaultView?.CSSStyleSheet;if(r&&"replaceSync"in r.prototype&&"adoptedStyleSheets"in n){let l=new r;l.replaceSync($n),n.adoptedStyleSheets=[l]}else{let l=t.createElement("style");l.textContent=$n,n.append(l)}let s=t.createElement("div");return s.className="layer",s.style.setProperty("--pu-panel",`${wt}px`),s.style.setProperty("--pu-pop",`${et}px`),Wo(s,e),n.append(s),t.documentElement.append(o),{element:o,shadow:n,n:s,destroy:()=>o.remove()}}var mi=40,hi=250,gi=120,vi=2400,wi=4e3,yi=1e4;function jo(e,t=!1){return Cn(e,t)?"column":"bubbles"}function bi(e){return[...e.state.mode==="column"?[Ao(e),En(e,{q:!1})]:[En(e,{q:!0})],Co(e),Oo(e)]}var xi=1e3,rn="Shown here, but not saved yet \u2014 it will be saved with your next change",ot=e=>e instanceof Error?e.message.replace(/^pipeup: /,""):"Something went wrong";function Go(e){let t=zo(e.root),o=Yo(t),n=qo(document,t.dark);n.j(0);let r=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,s=document.documentElement.hasAttribute("data-pipeup-reserve"),l=new Map,a=new Set,f=new WeakSet,d={o:null,E:null,k:!1,hidden:!0,mode:jo(e.root),t:null,s:!1,l:!1,L:!1,c:!1},h=v("div",{class:"toast",role:"status","aria-live":"polite"}),T=v("div",{class:"sr","aria-live":"polite"});o.n.append(h,T);let M=null,p=[],g=null,y=!1,x=0,C=0,A=0,E=0,P=0,k=new Set,q="",W=new Map,F=Ho(e.root,()=>{!y&&$()&&G()}),Y=!1,j=0;function B(c,L=vi,i=!1,u=!1){y||(Y=i,h.textContent=c,u?h.setAttribute("aria-hidden","true"):h.removeAttribute("aria-hidden"),h.classList.add("show"),window.clearTimeout(x),x=window.setTimeout(()=>h.classList.remove("show"),L))}function se(){Y&&(Y=!1,window.clearTimeout(x),h.classList.remove("show"))}function ce(c){T.textContent="",cancelAnimationFrame(j),j=requestAnimationFrame(()=>T.textContent=c)}function ve(c){B(ot(c))}function de(c){throw ve(c),c}let oe=c=>({thread:c,location:Ot(c.anchor,l.get(c.id)??ft(c.anchor,e.root),e.root)}),pe=c=>d.o!==c||d.k?!1:(g?.z()?g.W():o.n.querySelector(".launch .mode")?.focus({preventScroll:!0}),!0),Ae={reply:async(c,L)=>{try{await e.doc.reply(c,L)}catch(i){i instanceof he?B(rn):de(i)}},resolve:async c=>{try{await e.doc.resolve(c),pe(c)&&(d.o=null),B("Resolved \xB7 Show resolved brings it back")}catch(L){L instanceof he?(pe(c)&&(d.o=null),B(`Resolved \xB7 ${rn}`)):B(ot(L))}},reopen:async c=>{try{await e.doc.reopen(c),B("Reopened")}catch(L){B(L instanceof he?`Reopened \xB7 ${rn}`:ot(L))}},close:()=>{re(null);let c=ye&&o.n.querySelector(ye);c?c.focus({preventScroll:!0}):g?.W(),ye=""},copy:c=>{try{let L=e.doc.threads().find(u=>u.id===c);if(!L)return;let i=Ft(oe(L),"ai",location.href,Date.now());On(i,o.n).then(()=>B("Thread copied as Markdown for AI"),u=>B(ot(u)))}catch(L){B(ot(L))}}},we={copyAll:async c=>{let L=we.all(),i=Vt(L,c,{title:document.title,url:location.href,exportedAt:new Date});try{await On(i,o.n);let u=L.filter(w=>!w.thread.resolved).length;B(`Copied ${u} thread${u===1?"":"s"}${c==="ai"?" as Markdown for AI":""}`)}catch(u){B(ot(u))}},ve:()=>{d.k=!d.k,G()},rename:async c=>{let L=c.replace(/\s+/g," ").trim();try{await m(L)?B(`New comments will say ${L}, but this browser couldn't remember it`):B(`New comments will say ${L}`)}catch(i){B(ot(i))}},name:()=>e.doc.name,all:()=>[...e.doc.threads()].sort(Ke(b)).map(oe)},b={doc:e.doc,root:e.root,n:o.n,host:o.element,state:d,resolved:l,te:a,D:Ae,c:we,d:F,O:c=>k.has(c.id),ne:()=>{$()&&G()},R:c=>!d.hidden&&(!c.resolved||d.k)&&!k.has(c.id),be:(c,L)=>{for(let i of e.doc.threads()){let u=l.get(i.id);if(i.anchor.quote&&b.R(i)&&u?.range&&go(c,L,gt(u)))return i}return null},_:(c,L)=>b.S()?b.be(c,L):null,f:c=>c.composedPath().includes(o.element),X:c=>void f.add(c),pe:c=>f.has(c),open:re,we:c=>be(c),E:ze,Q:ae,ue:He,S:()=>!M||M.se(),J:c=>{let L=M?.G();c(),L?.()},he:()=>{let c=d.t?.anchor.view,L=M?.G();Promise.resolve(F.p(c)||F.Y(c??{}).then(()=>b.ne())).then(L)},ae:S,le:Ee,ye:ke,F:We,I:c=>{M=c},xe:B,T:ce,fe:se,Z:ve,Ee:I,u:G,U:Te};function O(c){let L=performance.now(),i=e.doc.threads();for(let u of i){if(c&&!c.has(u.id))continue;let w=performance.now()-L<mi,N=ft(u.anchor,e.root,{fuzzy:w});l.set(u.id,N),!w&&N.state==="orphaned"?a.add(u.id):a.delete(u.id)}for(let u of[...l.keys()])i.some(w=>w.id===u)||l.delete(u);a.size===0?(window.clearTimeout(E),E=0):E===0&&(E=window.setTimeout(()=>{E=0,!y&&(O(new Set(a)),G())},hi))}function $(){let c=new Set,L=F.slide()!==null,i=new Set;for(let w of e.doc.threads()){i.add(w.id);let N=l.get(w.id)?.element;(!F.p(w.anchor.view)||!L&&N?.checkVisibility?.({visibilityProperty:!0})===!1)&&c.add(w.id)}k=c;for(let w of W.keys())i.has(w)||W.delete(w);let u=`${F.slide()}|${[...c].join()}`;return u===q?!1:(q=u,!0)}function K(c){let L=[],i=[],u=[];for(let w of c){let N=l.get(w.id);w.resolved&&!d.k||!N?.range||k.has(w.id)||(w.id===d.o||w.id===d.E?i.push(N.range):w.resolved?u.push(N.range):L.push(N.range))}d.t&&F.p(d.t.anchor.view)&&i.push(...d.t.ranges),_o({quote:L,on:i,done:u})}let X=0,V=0,_=0;function Q(c){if(c===V)return;V=c,cancelAnimationFrame(_);let L=X,i=performance.now(),u=c?260:200,w=N=>{let z=Math.min(1,(N-i)/u);X=L+(c-L)*(c?1-(1-z)**3:z*z),n.j(X),z<1&&(_=requestAnimationFrame(w))};_=requestAnimationFrame(w)}let fe=0,$e=0;function Ue(c){c!==fe&&(fe=c,n.ie(c,r),window.clearTimeout($e),$e=window.setTimeout(()=>{O(),G()},r?0:400))}function G(){if(y)return;let c=e.doc.threads();if($(),d.o&&k.has(d.o)){let i=o.n.querySelector(`[data-thread="${d.o}"] .rbox textarea`)?.value;i&&W.set(d.o,i),d.o=null}d.hidden=!d.s&&!d.l&&!d.L&&!d.t,d.hidden&&(d.o=null),Q(d.hidden?0:1),o.n.classList.toggle("hidden",d.hidden),o.n.classList.toggle("listing",d.l);let L=d.l&&!tt();Ue(L?wt:0),n.oe(s?d.mode==="column"&&!d.hidden&&!L?bt:0:null),K(c);for(let i of p)i.u(c);g?.u(c)}let ye="",Me=()=>o.n.getRootNode().activeElement,Ne="input,textarea,select,[contenteditable]:not([contenteditable=false])",Be=()=>{let c=Me();return c instanceof HTMLTextAreaElement&&c.value!==""||!!document.activeElement?.matches(Ne)};function be(c,L=Be(),i=Me()){let u=[...o.n.querySelectorAll(`[data-thread="${c}"] .rbox textarea`)].find(N=>!N.closest("[inert]")),w=i?.getAttribute("data-thread");ye=w?`.${i.classList[0]}[data-thread="${w}"]`:"",!(L||!u)&&u.focus({preventScroll:!0})}function xe(){let c=d.t;return!c||b.S()?!1:(F.p(c.anchor.view)||F.Y(c.anchor.view??{}),!0)}function re(c,L=!1){if(c&&xe())return;if(d.o===c&&!d.t)return c?be(c):void 0;let i=!L&&Be(),u=Me();if(c||(d.L=!1),d.o=c,c&&(d.t=null,I(c)),G(),c){let w=W.get(c),N=w&&o.n.querySelector(`[data-thread="${c}"] .rbox textarea`);N&&!N.value&&(N.value=w,N.dispatchEvent(new Event("input",{bubbles:!0}))),W.delete(c),L&&g?.z()?g.W():be(c,i,u)}}function ze(c){d.E!==c&&(d.E=c,c&&c!==d.o&&I(c),G())}function ae(c){se(),d.l=!1,d.t=c,d.o=null,G()}function He(c){if(!d.t)return ae(c);Object.assign(d.t,c),G()}function Ee(){d.t&&(d.t=null,G())}function ke(c,L=!1){d.s!==c&&(d.s=c,n.re(c),c?(d.o=null,d.l=!1,g=So(b)):(se(),g?.destroy(),g=null,ce("Comment mode off")),G(),g&&(L&&g.ee(),L?g.z()?B(An,yi,!0,!0):B("Nothing here to comment on"):B(`Click anything to comment, or Tab between blocks \xB7 Option-click (Alt-click) to pin \xB7 ${mt} or Esc to finish`,wi,!0)))}function Te(){d.t&&(F.p(d.t.anchor.view)||b.S())?Ee():d.o?re(null):g&&!g.U()&&ke(!1)}function We(){if(d.t){xe()||Ee();return}d.o&&re(null)}async function m(c){try{return await e.onName(c),!1}catch(L){if(e.doc.name!==c)throw L;return!0}}async function S(c){let L=d.t;if(L)try{let i=await e.doc.comment(L.anchor,c);d.t=null,O(new Set([i])),re(i,!0)}catch(i){if(i instanceof he){d.t=null,O(new Set([i.id])),re(i.id,!0),B(rn);return}de(i)}}function I(c){let L=l.get(c);if(!L||L.state==="orphaned")return;let i=L.range?gt(L):L.element?[L.element.getBoundingClientRect()]:[];for(let u of i.slice(0,6)){let w=v("div",{class:"pulse"});_e(w,u,4),o.n.prepend(w),window.setTimeout(()=>w.remove(),1300)}}function R(){for(let c of p)c.destroy();p=bi(b),G()}let D=()=>{if(!y){for(let c of p)c.M();g?.M(),P=requestAnimationFrame(D)}},H=c=>{let L=c.composedPath()[0];return L instanceof Element&&L.closest(Ne)!==null},U=c=>{if(c.key==="Escape")return Te();if(fo(c)&&!c.isComposing&&!c.defaultPrevented&&!H(c)){if(c.preventDefault(),g?.ge()&&g.ee())return;ke(!d.s,!0)}},le=c=>{if(b.f(c)||f.has(c))return;let L=window.getSelection();L&&!L.isCollapsed||We()},Ce=()=>{let c=jo(e.root,d.mode==="column");c!==d.mode?(d.mode=c,R()):G()};function Ye(){let c=performance.now();C===0&&(A=c),window.clearTimeout(C);let L=Math.min(gi,Math.max(0,A+xi-c));C=window.setTimeout(()=>{C=0,O(),G()},L)}let Tt=new MutationObserver(c=>{c.every(L=>o.element.contains(L.target))||Ye()});window.addEventListener("keydown",U),window.addEventListener("click",le),window.addEventListener("resize",Ce),Tt.observe(e.root,{subtree:!0,childList:!0,characterData:!0});let dt=typeof ResizeObserver>"u"?null:new ResizeObserver(Ye);dt?.observe(e.root);let De=e.doc.onChange(()=>{O(),G()});return O(),R(),P=requestAnimationFrame(D),{ctx:b,destroy(){y=!0,cancelAnimationFrame(P),cancelAnimationFrame(_),cancelAnimationFrame(j),F.destroy(),window.clearTimeout($e),window.clearTimeout(x),window.clearTimeout(C),window.clearTimeout(E),Tt.disconnect(),dt?.disconnect(),De(),window.removeEventListener("keydown",U),window.removeEventListener("click",le),window.removeEventListener("resize",Ce),g?.destroy();for(let c of p)c.destroy();n.remove(),o.destroy()}}}var rt=null,Ei=4e3;function Nn(e={}){if(rt)return rt;let t=Ti(e,()=>t).catch(o=>{throw rt===t&&(rt=null),o});return rt=t,t}function ki(e,t){return new Promise((o,n)=>{let r=setTimeout(()=>n(new Error("timed out")),t);e.then(o,n).finally(()=>clearTimeout(r))})}async function Ti(e,t){let o=document.documentElement.getAttribute("data-pipeup-doc"),{id:n,key:r}=o?await St(o):{id:`page-${qe(location.origin+location.pathname)}`,key:null},s,l=!1,a;if(e.store)s=e.store,a=await lt(s);else try{let p=st.open();s=await ki(p,Ei).catch(g=>{throw p.then(y=>y.close(),()=>{}),g}),a=await lt(s)}catch{s=new at,l=!0,a=await lt(s)}let f=e.name?.trim();f&&f!==a.name&&(a={...a,name:f},await s.saveProfile(a));let d=await it.open({doc:n,key:r,store:s,identity:a.identity,name:a.name});on(e.slides??null);let h;try{h=Go({doc:d,root:e.root??document.body,onName:async p=>{d.name=p,a={...a,name:p},await s.saveProfile(a)}})}catch(p){throw on(null),p}l&&h.ctx.xe("This browser can't keep comments for this page \u2014 copy the comments (Copy as Markdown) to keep them");let T=()=>void d.flush().catch(p=>globalThis.reportError?.(p)),M=!1;return window.addEventListener("pagehide",T),{document:d,flush:()=>d.flush(),unmount:()=>{M||(M=!0,window.removeEventListener("pagehide",T),h.destroy(),on(null),rt===t()&&(rt=null))}}}function Xo(){let e=document.documentElement;if(!e.hasAttribute("data-pipeup-doc")||e.getAttribute("data-pipeup-auto")==="off")return;let t=()=>void Nn().catch(o=>console.error(o));document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}var Si="0.4.1";typeof document<"u"&&Xo();return nr(Li);})();
|
package/dist/types/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VERSION = "0.4.1
|
|
1
|
+
export declare const VERSION = "0.4.1";
|
|
2
2
|
export { PipeupDocument, UnsavedChangeError, type Listener, type OpenOptions } from "./document";
|
|
3
3
|
export { DEFAULT_PROFILE_NAME, MemoryStore, loadOrCreateProfile, type OpStore, type Profile, } from "./storage/store";
|
|
4
4
|
export { IndexedDbStore } from "./storage/indexeddb";
|