@hazem3500/komo 0.9.18 → 0.9.19

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 CHANGED
@@ -435,6 +435,7 @@ Pass these to `initKomo(config)` from `@hazem3500/komo` or `useKomo(config)` fro
435
435
  | `frame.include(element)` | `(element: HTMLElement) => boolean` | Fixed portals, including fixed descendants of static wrappers | Frame scales dialogs, overlays and toasts with the page. Script-positioned popovers keep their viewport placement while their content scales. Host transforms, animations and focus are preserved without moving portal DOM. Return `true` to map a whole body child through Frame or `false` to exclude its subtree; komo's own host is never framed. |
436
436
  | `isolateEvents` | `boolean` | `true` | Keep komo's events out of the host page. See [Host events](#host-events). |
437
437
  | `source(element)` | `(element: Element) => string \| undefined` | Anchor metadata | Return a repository-relative source path. |
438
+ | `anchorTarget(element)` | `(element: Element) => Element \| undefined` | Declared owners and stable semantic cards | Optional persistent ancestor for comment capture. Offsets stay relative to this owner when hover-only children disappear. Owners cannot cross a dialog/popover boundary. Design inspection continues to target the exact element. |
438
439
  | `sourceUrl(source, branch)` | `(source: string, branch: string) => string` | GitHub viewer | Custom source or editor link. |
439
440
  | `page()` | `() => string` | `location.pathname` | Canonical page identifier. |
440
441
  | `navigate(url)` | `(url: URL) => void \| Promise<void>` | `location.assign` | Route to a comment on another page without reloading, e.g. `(url) => router.navigate({ href: url.pathname + url.search })`. komo opens the thread once its anchor renders; a rejection falls back to a page load. |
@@ -482,8 +483,9 @@ komo renders in a shadow root, so page listeners see its events as coming from k
482
483
  - **Typing.** `keydown`, `keyup` and `keypress` from komo's inputs don't reach `document` or `window`, so app shortcuts (such as `react-hotkeys-hook` or a custom `keydown` listener) don't fire while someone writes a comment. Keys pressed on komo's buttons still reach the page.
483
484
  - **Modals.** `pointerdown`, `mousedown`, `touchstart`, `touchmove`, `touchend`, `click`, `wheel`, `focusin` and `focusout` from komo's UI don't reach page listeners. An open Radix or similar dialog doesn't treat komo as an outside interaction, so it doesn't close, take focus back from the composer, or block the sidebar's scroll.
484
485
  - **Focus traps.** When focus moves from the page into komo, komo stops that `focusout` for `document` listeners added after komo mounted, such as Radix's FocusScope.
486
+ - **Escape.** Escape from feedback fields and controls is marked handled in the host's own window before document capture listeners run. Feedback still receives it to close its composer or menu; Radix's document handler leaves the host dialog open. This also works when feedback runs inside an iframe.
485
487
 
486
- Limits: capture-phase listeners on `document` or `window` run before komo can stop anything. For example, Radix's Escape handler (`onEscapeKeyDown`) still closes a dialog when Escape is pressed in komo's composer; prevent that with `event.target.closest("[data-branch-comments]")`. Libraries that detect outside clicks in the capture phase, such as Headless UI, need their own check. Modal libraries that hide other content with `aria-hidden` also hide komo from assistive technology. Set `isolateEvents: false` if your app needs to observe these events.
488
+ Other capture-phase listeners still run. Set `isolateEvents: false` if your app needs to observe feedback events or handle Escape itself.
487
489
 
488
490
  ### CLI
489
491
 
@@ -1 +1 @@
1
- import{h as e,i as t}from"./chunk-ANKCS6NI.js";import{useEffect as r,useLayoutEffect as n,useRef as o,useState as a}from"react";import{createRoot as c}from"react-dom/client";import l,{useRef as i,useMemo as u,useEffect as s,useState as f,useCallback as d,useLayoutEffect as h}from"react";function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}function m(e){var t=i(e),r=i(function(e){t.current&&t.current(e)});return t.current=e,r.current}var g=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e<t?t:e},b=function(e){return"touches"in e},_=function(e){return e&&e.ownerDocument.defaultView||self},w=function(e,t,r){var n=e.getBoundingClientRect(),o=b(t)?function(e,t){for(var r=0;r<e.length;r++)if(e[r].identifier===t)return e[r];return e[0]}(t.touches,r):t;return{left:g((o.pageX-(n.left+_(e).pageXOffset))/n.width),top:g((o.pageY-(n.top+_(e).pageYOffset))/n.height)}},x=function(e){!b(e)&&e.preventDefault()},C=l.memo(function(e){var t=e.onMove,r=e.onKey,n=e.onEnd,o=v(e,["onMove","onKey","onEnd"]),a=i(null),c=m(t),f=m(r),d=m(n),h=i(null),g=i(!1),C=u(function(){var e=function(e){x(e),(b(e)?e.touches.length>0:e.buttons>0)&&a.current?c(w(a.current,e,h.current)):(r(!1),d())},t=function(){r(!1),d()};function r(r){var n=g.current,o=_(a.current),c=r?o.addEventListener:o.removeEventListener;c(n?"touchmove":"mousemove",e),c(n?"touchend":"mouseup",t)}return[function(e){var t,n=e.nativeEvent,o=a.current;if(o&&(x(n),t=n,(!g.current||b(t))&&o)){if(b(n)){g.current=!0;var l=n.changedTouches||[];l.length&&(h.current=l[0].identifier)}o.focus(),c(w(o,n,h.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),f({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&d()},r]},[f,c,d]),E=C[0],y=C[1],k=C[2],N=C[3];return s(function(){return N},[N]),l.createElement("div",p({},o,{onTouchStart:E,onMouseDown:E,className:"react-colorful__interactive",ref:a,onKeyDown:y,onKeyUp:k,tabIndex:0,role:"slider"}))}),E=function(e){return e.filter(Boolean).join(" ")},y=function(e){var t=e.color,r=e.left,n=e.top,o=void 0===n?.5:n,a=E(["react-colorful__pointer",e.className]);return l.createElement("div",{className:a,style:{top:100*o+"%",left:100*r+"%"}},l.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},N=(Math.PI,function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?k(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?k(parseInt(e.substring(6,8),16)/255,2):1}}),M=function(e){var t=function(e){var t=e.s,r=e.v,n=e.a,o=(200-t)*r/100;return{h:k(e.h),s:k(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:k(o/2),a:k(n,2)}}(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},L=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),c=n*(1-r),l=n*(1-(t-a)*r),i=n*(1-(1-t+a)*r),u=a%6;return{r:k(255*[n,l,c,c,i,n][u]),g:k(255*[i,n,n,l,c,c][u]),b:k(255*[c,c,i,n,n,l][u]),a:k(o,2)}},H=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},I=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=o<1?H(k(255*o)):"";return"#"+H(t)+H(r)+H(n)+a},P=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),c=a-Math.min(t,r,n),l=c?a===t?(r-n)/c:a===r?2+(n-t)/c:4+(t-r)/c:0;return{h:60*(l<0?l+6:l),s:a?c/a*100:0,v:a/255*100,a:o}},j=l.memo(function(e){var t=e.hue,r=e.onChange,n=e.onChangeEnd,o=E(["react-colorful__hue",e.className]);return l.createElement("div",{className:o},l.createElement(C,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:g(t+360*e.left,0,360)})},onEnd:n,"aria-label":"Hue","aria-valuenow":k(t),"aria-valuemax":"360","aria-valuemin":"0"},l.createElement(y,{className:"react-colorful__hue-pointer",left:t/360,color:M({h:t,s:100,v:100,a:1})})))}),z=l.memo(function(e){var t=e.hsva,r=e.onChange,n=e.onChangeEnd,o={backgroundColor:M({h:t.h,s:100,v:100,a:1})};return l.createElement("div",{className:"react-colorful__saturation",style:o},l.createElement(C,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:g(t.s+100*e.left,0,100),v:g(t.v-100*e.top,0,100)})},onEnd:n,"aria-label":"Color","aria-valuetext":"Saturation "+k(t.s)+"%, Brightness "+k(t.v)+"%"},l.createElement(y,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:M(t)})))}),D=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0};var B=typeof window<"u"?h:s,K=new WeakMap,O=function(e){B(function(){var t=e.current;if(typeof document<"u"&&t){var r=t.getRootNode?t.getRootNode():t.ownerDocument,n=r&&("head"in r||"host"in r)?r:t.ownerDocument;if(!K.has(n)){var o="head"in n?n.head:n,a=(o.ownerDocument||document).createElement("style");a.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}';var c=typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0;c&&a.setAttribute("nonce",c),K.set(n,a),o.appendChild(a)}}},[])},S=function(e){var t=e.className,r=e.colorModel,n=e.color,o=void 0===n?r.defaultColor:n,a=e.onChange,c=e.onChangeEnd,u=v(e,["className","colorModel","color","onChange","onChangeEnd"]),h=i(null);O(h);var g=function(e,t,r,n){var o=m(r),a=m(n),c=f(function(){return e.toHsva(t)}),l=c[0],u=c[1],h=i({color:t,hsva:l}),p=i(!1);s(function(){if(!e.equal(t,h.current.color)){var r=e.toHsva(t);h.current={hsva:r,color:t},u(r),p.current=!1}},[t,e]),s(function(){var t;D(l,h.current.hsva)||e.equal(t=e.fromHsva(l),h.current.color)||(h.current={hsva:l,color:t},o(t),p.current=!0)},[l,e,o]);var v=d(function(e){u(function(t){return Object.assign({},t,e)})},[]),g=d(function(){p.current&&(p.current=!1,a(h.current.color))},[a]);return[l,v,g]}(r,o,a,c),b=g[0],_=g[1],w=g[2],x=E(["react-colorful",t]);return l.createElement("div",p({},u,{ref:h,className:x}),l.createElement(z,{hsva:b,onChange:_,onChangeEnd:w}),l.createElement(j,{hue:b.h,onChange:_,onChangeEnd:w,className:"react-colorful__last-control"}))},A={defaultColor:"000",toHsva:function(e){return P(N(e))},fromHsva:function(e){return function(e){return I(L(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||D(N(e),N(t))}},R=function(e){return l.createElement(S,p({},e,{colorModel:A}))},T=/^#?([0-9A-F]{3,8})$/i,W=function(e){var t=e.color,r=void 0===t?"":t,n=e.onChange,o=e.onBlur,a=e.escape,c=e.validate,i=e.format,u=e.process,h=v(e,["color","onChange","onBlur","escape","validate","format","process"]),g=f(function(){return a(r)}),b=g[0],_=g[1],w=m(n),x=m(o),C=d(function(e){var t=a(e.target.value);_(t),c(t)&&w(u?u(t):t)},[a,u,c,w]),E=d(function(e){c(e.target.value)||_(a(r)),x(e)},[r,a,c,x]);return s(function(){_(a(r))},[r,a]),l.createElement("input",p({},h,{value:i?i(b):b,spellCheck:"false",onChange:C,onBlur:E}))},q=function(e){return"#"+e},$=function(e){var t=e.prefixed,r=e.alpha,n=v(e,["prefixed","alpha"]),o=d(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),a=d(function(e){return t=e,n=r,o=T.exec(t),3===(a=o?o[1].length:0)||6===a||!!n&&4===a||!!n&&8===a;var t,n,o,a},[r]);return l.createElement(W,p({},n,{escape:o,format:t?q:void 0,process:q,validate:a}))};import*as Y from"react";var F=({size:e=24,color:t="currentColor",...r})=>Y.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},Y.createElement("path",{d:"M12 5v14m-7-7h14"}));F.displayName="Plus";import{jsx as X,jsxs as U}from"react/jsx-runtime";var V=[["Lavender","#c8b5f4"],["Blue","#85b5ff"],["Mint","#84d9bb"],["Yellow","#f4d779"],["Peach","#f5af87"],["Pink","#efa5c6"]];function G({initial:t,onChange:c}){let[l,i]=a(t),[u,s]=a(!1),f=o(null),d=o(null),h=!V.some(([,e])=>e===l),p=e=>{if(!/^#[0-9a-f]{6}$/i.test(e))return;let t=e.toLowerCase();i(t),c(t)};return n(()=>{let e=f.current;if(!e)return;if(!u){let t=window.setTimeout(()=>e.hidePopover(),150);return()=>clearTimeout(t)}e.showPopover();let t=()=>{let t=d.current.getBoundingClientRect();e.style.left=`${Math.max(8,Math.min(t.right-e.offsetWidth,innerWidth-e.offsetWidth-8))}px`,e.style.top=`${Math.max(8,t.top-e.offsetHeight-8)}px`};return t(),e.querySelector('[role="slider"]')?.focus({preventScroll:!0}),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[u]),r(()=>{if(!u)return;let t=new AbortController;return e(d.current,"pointerdown",e=>{!e.composedPath().includes(f.current)&&!e.composedPath().includes(d.current)&&s(!1)},{signal:t.signal}),()=>t.abort()},[u]),U("div",{className:"account-accent",children:[X("span",{className:"account-accent-label",children:"Accent color"}),U("div",{className:"accent-swatches",role:"group","aria-label":"Accent color",children:[V.map(([e,t])=>X("button",{type:"button",className:"accent-swatch","aria-label":e,title:e,"aria-pressed":l===t,style:{"--swatch":t},onClick:()=>{p(t),s(!1)}},e)),X("button",{ref:d,type:"button",className:"accent-swatch accent-custom","aria-label":"Custom accent color","aria-haspopup":"dialog","aria-expanded":u,"aria-pressed":h,onClick:()=>s(!u),children:X(F,{"aria-hidden":"true"})})]}),U("div",{ref:f,popover:"manual",role:"dialog","aria-label":"Custom accent color",className:u?"accent-popover t-dropdown is-open":"accent-popover t-dropdown is-closing",onKeyDown:e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),s(!1),d.current?.focus())},children:[U("div",{className:"accent-popover-head",children:[X("span",{children:"Color"}),X("span",{children:l})]}),U("div",{className:"accent-picker-body",children:[X(R,{color:l,onChange:p}),X($,{"aria-label":"Hex accent color",className:"accent-hex",color:l,onChange:p,prefixed:!0})]})]})]})}function J(e,r){let n=t("div","account-accent-mount"),o=c(n);return o.render(X(G,{initial:e,onChange:r})),{element:n,destroy:()=>o.unmount()}}export{J as accentPicker};
1
+ import{i as e,j as t}from"./chunk-PLSWBSSX.js";import{useEffect as r,useLayoutEffect as n,useRef as o,useState as a}from"react";import{createRoot as c}from"react-dom/client";import l,{useRef as i,useMemo as u,useEffect as s,useState as f,useCallback as d,useLayoutEffect as h}from"react";function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function v(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}function m(e){var t=i(e),r=i(function(e){t.current&&t.current(e)});return t.current=e,r.current}var g=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e<t?t:e},b=function(e){return"touches"in e},_=function(e){return e&&e.ownerDocument.defaultView||self},w=function(e,t,r){var n=e.getBoundingClientRect(),o=b(t)?function(e,t){for(var r=0;r<e.length;r++)if(e[r].identifier===t)return e[r];return e[0]}(t.touches,r):t;return{left:g((o.pageX-(n.left+_(e).pageXOffset))/n.width),top:g((o.pageY-(n.top+_(e).pageYOffset))/n.height)}},x=function(e){!b(e)&&e.preventDefault()},C=l.memo(function(e){var t=e.onMove,r=e.onKey,n=e.onEnd,o=v(e,["onMove","onKey","onEnd"]),a=i(null),c=m(t),f=m(r),d=m(n),h=i(null),g=i(!1),C=u(function(){var e=function(e){x(e),(b(e)?e.touches.length>0:e.buttons>0)&&a.current?c(w(a.current,e,h.current)):(r(!1),d())},t=function(){r(!1),d()};function r(r){var n=g.current,o=_(a.current),c=r?o.addEventListener:o.removeEventListener;c(n?"touchmove":"mousemove",e),c(n?"touchend":"mouseup",t)}return[function(e){var t,n=e.nativeEvent,o=a.current;if(o&&(x(n),t=n,(!g.current||b(t))&&o)){if(b(n)){g.current=!0;var l=n.changedTouches||[];l.length&&(h.current=l[0].identifier)}o.focus(),c(w(o,n,h.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),f({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&d()},r]},[f,c,d]),E=C[0],y=C[1],k=C[2],N=C[3];return s(function(){return N},[N]),l.createElement("div",p({},o,{onTouchStart:E,onMouseDown:E,className:"react-colorful__interactive",ref:a,onKeyDown:y,onKeyUp:k,tabIndex:0,role:"slider"}))}),E=function(e){return e.filter(Boolean).join(" ")},y=function(e){var t=e.color,r=e.left,n=e.top,o=void 0===n?.5:n,a=E(["react-colorful__pointer",e.className]);return l.createElement("div",{className:a,style:{top:100*o+"%",left:100*r+"%"}},l.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},N=(Math.PI,function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?k(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?k(parseInt(e.substring(6,8),16)/255,2):1}}),M=function(e){var t=function(e){var t=e.s,r=e.v,n=e.a,o=(200-t)*r/100;return{h:k(e.h),s:k(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:k(o/2),a:k(n,2)}}(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},L=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),c=n*(1-r),l=n*(1-(t-a)*r),i=n*(1-(1-t+a)*r),u=a%6;return{r:k(255*[n,l,c,c,i,n][u]),g:k(255*[i,n,n,l,c,c][u]),b:k(255*[c,c,i,n,n,l][u]),a:k(o,2)}},P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},j=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=o<1?P(k(255*o)):"";return"#"+P(t)+P(r)+P(n)+a},H=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),c=a-Math.min(t,r,n),l=c?a===t?(r-n)/c:a===r?2+(n-t)/c:4+(t-r)/c:0;return{h:60*(l<0?l+6:l),s:a?c/a*100:0,v:a/255*100,a:o}},z=l.memo(function(e){var t=e.hue,r=e.onChange,n=e.onChangeEnd,o=E(["react-colorful__hue",e.className]);return l.createElement("div",{className:o},l.createElement(C,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:g(t+360*e.left,0,360)})},onEnd:n,"aria-label":"Hue","aria-valuenow":k(t),"aria-valuemax":"360","aria-valuemin":"0"},l.createElement(y,{className:"react-colorful__hue-pointer",left:t/360,color:M({h:t,s:100,v:100,a:1})})))}),B=l.memo(function(e){var t=e.hsva,r=e.onChange,n=e.onChangeEnd,o={backgroundColor:M({h:t.h,s:100,v:100,a:1})};return l.createElement("div",{className:"react-colorful__saturation",style:o},l.createElement(C,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:g(t.s+100*e.left,0,100),v:g(t.v-100*e.top,0,100)})},onEnd:n,"aria-label":"Color","aria-valuetext":"Saturation "+k(t.s)+"%, Brightness "+k(t.v)+"%"},l.createElement(y,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:M(t)})))}),D=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0};var I=typeof window<"u"?h:s,S=new WeakMap,O=function(e){I(function(){var t=e.current;if(typeof document<"u"&&t){var r=t.getRootNode?t.getRootNode():t.ownerDocument,n=r&&("head"in r||"host"in r)?r:t.ownerDocument;if(!S.has(n)){var o="head"in n?n.head:n,a=(o.ownerDocument||document).createElement("style");a.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}';var c=typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0;c&&a.setAttribute("nonce",c),S.set(n,a),o.appendChild(a)}}},[])},K=function(e){var t=e.className,r=e.colorModel,n=e.color,o=void 0===n?r.defaultColor:n,a=e.onChange,c=e.onChangeEnd,u=v(e,["className","colorModel","color","onChange","onChangeEnd"]),h=i(null);O(h);var g=function(e,t,r,n){var o=m(r),a=m(n),c=f(function(){return e.toHsva(t)}),l=c[0],u=c[1],h=i({color:t,hsva:l}),p=i(!1);s(function(){if(!e.equal(t,h.current.color)){var r=e.toHsva(t);h.current={hsva:r,color:t},u(r),p.current=!1}},[t,e]),s(function(){var t;D(l,h.current.hsva)||e.equal(t=e.fromHsva(l),h.current.color)||(h.current={hsva:l,color:t},o(t),p.current=!0)},[l,e,o]);var v=d(function(e){u(function(t){return Object.assign({},t,e)})},[]),g=d(function(){p.current&&(p.current=!1,a(h.current.color))},[a]);return[l,v,g]}(r,o,a,c),b=g[0],_=g[1],w=g[2],x=E(["react-colorful",t]);return l.createElement("div",p({},u,{ref:h,className:x}),l.createElement(B,{hsva:b,onChange:_,onChangeEnd:w}),l.createElement(z,{hue:b.h,onChange:_,onChangeEnd:w,className:"react-colorful__last-control"}))},R={defaultColor:"000",toHsva:function(e){return H(N(e))},fromHsva:function(e){return function(e){return j(L(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||D(N(e),N(t))}},A=function(e){return l.createElement(K,p({},e,{colorModel:R}))},W=/^#?([0-9A-F]{3,8})$/i,T=function(e){var t=e.color,r=void 0===t?"":t,n=e.onChange,o=e.onBlur,a=e.escape,c=e.validate,i=e.format,u=e.process,h=v(e,["color","onChange","onBlur","escape","validate","format","process"]),g=f(function(){return a(r)}),b=g[0],_=g[1],w=m(n),x=m(o),C=d(function(e){var t=a(e.target.value);_(t),c(t)&&w(u?u(t):t)},[a,u,c,w]),E=d(function(e){c(e.target.value)||_(a(r)),x(e)},[r,a,c,x]);return s(function(){_(a(r))},[r,a]),l.createElement("input",p({},h,{value:i?i(b):b,spellCheck:"false",onChange:C,onBlur:E}))},q=function(e){return"#"+e},$=function(e){var t=e.prefixed,r=e.alpha,n=v(e,["prefixed","alpha"]),o=d(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),a=d(function(e){return t=e,n=r,o=W.exec(t),3===(a=o?o[1].length:0)||6===a||!!n&&4===a||!!n&&8===a;var t,n,o,a},[r]);return l.createElement(T,p({},n,{escape:o,format:t?q:void 0,process:q,validate:a}))};import*as X from"react";var Y=({size:e=24,color:t="currentColor",...r})=>X.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...r},X.createElement("path",{d:"M12 5v14m-7-7h14"}));Y.displayName="Plus";import{jsx as F,jsxs as U}from"react/jsx-runtime";var V=[["Lavender","#c8b5f4"],["Blue","#85b5ff"],["Mint","#84d9bb"],["Yellow","#f4d779"],["Peach","#f5af87"],["Pink","#efa5c6"]];function G({initial:t,onChange:c}){let[l,i]=a(t),[u,s]=a(!1),f=o(null),d=o(null),h=!V.some(([,e])=>e===l),p=e=>{if(!/^#[0-9a-f]{6}$/i.test(e))return;let t=e.toLowerCase();i(t),c(t)};return n(()=>{let e=f.current;if(!e)return;if(!u){let t=window.setTimeout(()=>e.hidePopover(),150);return()=>clearTimeout(t)}e.showPopover();let t=()=>{let t=d.current.getBoundingClientRect();e.style.left=`${Math.max(8,Math.min(t.right-e.offsetWidth,innerWidth-e.offsetWidth-8))}px`,e.style.top=`${Math.max(8,t.top-e.offsetHeight-8)}px`};return t(),e.querySelector('[role="slider"]')?.focus({preventScroll:!0}),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[u]),r(()=>{if(!u)return;let t=new AbortController;return e(d.current,"pointerdown",e=>{!e.composedPath().includes(f.current)&&!e.composedPath().includes(d.current)&&s(!1)},{signal:t.signal}),()=>t.abort()},[u]),U("div",{className:"account-accent",children:[F("span",{className:"account-accent-label",children:"Accent color"}),U("div",{className:"accent-swatches",role:"group","aria-label":"Accent color",children:[V.map(([e,t])=>F("button",{type:"button",className:"accent-swatch","aria-label":e,title:e,"aria-pressed":l===t,style:{"--swatch":t},onClick:()=>{p(t),s(!1)}},e)),F("button",{ref:d,type:"button",className:"accent-swatch accent-custom","aria-label":"Custom accent color","aria-haspopup":"dialog","aria-expanded":u,"aria-pressed":h,onClick:()=>s(!u),children:F(Y,{"aria-hidden":"true"})})]}),U("div",{ref:f,popover:"manual",role:"dialog","aria-label":"Custom accent color",className:u?"accent-popover t-dropdown is-open":"accent-popover t-dropdown is-closing",onKeyDown:e=>{e.stopPropagation(),"Escape"===e.key&&(e.preventDefault(),s(!1),d.current?.focus())},children:[U("div",{className:"accent-popover-head",children:[F("span",{children:"Color"}),F("span",{children:l})]}),U("div",{className:"accent-picker-body",children:[F(A,{color:l,onChange:p}),F($,{"aria-label":"Hex accent color",className:"accent-hex",color:l,onChange:p,prefixed:!0})]})]})]})}function J(e,r){let n=t("div","account-accent-mount"),o=c(n);return o.render(F(G,{initial:e,onChange:r})),{element:n,destroy:()=>o.unmount()}}export{J as accentPicker};
package/dist/anchors.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import type { Anchor } from "./types.js";
2
+ /** Prefer a persistent comment owner without changing precise DOM anchor capture. */
3
+ export declare function commentAnchorTarget(element: Element, root: Element, resolve?: (element: Element) => Element | undefined): Element;
2
4
  export declare function captureAnchor(element: Element, start: {
3
5
  x: number;
4
6
  y: number;
@@ -1 +1 @@
1
- import{i as e,j as t,k as r}from"./chunk-ANKCS6NI.js";function o(o,s){let i=e("details","comment-menu"),n=e("summary","icon");n.setAttribute("aria-label",o),n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded","false"),n.title=o,n.append(t("more"));let a=e("div","comment-menu-items");a.popover="manual",a.setAttribute("role","menu"),a.setAttribute("aria-label",o);let c=s.map(t=>{let o=r(t.label,()=>{i.open=!1,n.focus({preventScroll:!0}),t.onSelect()},"menu-action"+(t.destructive?" destructive":""),t.icon);return o.append(e("span","",t.label)),o.setAttribute("role","menuitem"),o.tabIndex=-1,a.append(o),o});return i.addEventListener("toggle",()=>{if(n.setAttribute("aria-expanded",String(i.open)),i.open){a.showPopover();let e=n.getBoundingClientRect();a.style.left=`${Math.max(8,Math.min(e.right-a.offsetWidth,innerWidth-a.offsetWidth-8))}px`,a.style.top=`${Math.max(8,Math.min(e.bottom+6,innerHeight-a.offsetHeight-8))}px`,(c.find(e=>"true"===e.getAttribute("aria-checked"))??c[0])?.focus({preventScroll:!0})}else a.hidePopover()}),i.addEventListener("keydown",e=>{if(!i.open)return;let t,r=c.indexOf(e.target);"ArrowDown"===e.key&&(t=(r+1)%c.length),"ArrowUp"===e.key&&(t=(r-1+c.length)%c.length),"Home"===e.key&&(t=0),"End"===e.key&&(t=c.length-1),void 0!==t&&(e.preventDefault(),c[t]?.focus()),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),i.open=!1,n.focus({preventScroll:!0})),"Tab"===e.key&&(i.open=!1)}),i.append(n,a),i}function s(r,s,i,n){let a=o(r,s.map(([e,t])=>({label:t,icon:"check",onSelect:()=>n(e)})));a.classList.add("selection-menu");let c=a.querySelector("summary");return c.className="selection-trigger",c.replaceChildren(e("span","selection-label",s.find(([e])=>e===i)?.[1]),t("chevron")),a.querySelectorAll("[role=menuitem]").forEach((e,t)=>{e.setAttribute("role","menuitemradio"),e.setAttribute("aria-checked",String(s[t][0]===i))}),a}var i=class extends Error{constructor(e,t,r){super(t),this.status=e,this.code=r}status;code};function n(e){return!!e&&"string"==typeof e.id&&"string"==typeof e.name&&"boolean"==typeof e.verified&&[e.avatarUrl,e.accentColor].every(e=>void 0===e||"string"==typeof e)}function a(e){return Array.isArray(e)&&e.every(e=>e&&"string"==typeof e.id&&"string"==typeof e.page&&"boolean"==typeof e.resolved&&Number.isFinite(e.createdAt)&&Number.isFinite(e.updatedAt)&&(null===e.resolvedBy||n(e.resolvedBy))&&e.anchor&&(!("context"in e.anchor)||function(e){if(void 0===e)return!0;if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t={tag:32,role:80,label:160,nearby:160,classes:200,selectedText:200,styles:500,scope:2e3};return Object.entries(e).every(([e,r])=>"number"==typeof t[e]&&"string"==typeof r&&r.length<=t[e])}(e.anchor.context))&&"string"==typeof e.anchor.selector&&"string"==typeof e.anchor.text&&[e.anchor.x,e.anchor.y,e.anchor.width,e.anchor.height,e.anchor.pageX,e.anchor.pageY,e.anchor.viewportWidth].every(Number.isFinite)&&Array.isArray(e.comments)&&e.comments.every(e=>e&&"string"==typeof e.id&&"string"==typeof e.body&&n(e.author)&&Number.isFinite(e.createdAt)&&(null===e.editedAt||Number.isFinite(e.editedAt))&&e.reactions&&"object"==typeof e.reactions&&!Array.isArray(e.reactions)&&Object.values(e.reactions).every(e=>Array.isArray(e)&&e.every(e=>"string"==typeof e))))}function c(e,t){if(!t||!Array.isArray(e))return e;let r=e=>"string"==typeof e?Object.hasOwn(t,e)?t[e]:void 0:e;return e.map(e=>e&&{...e,resolvedBy:r(e.resolvedBy),comments:Array.isArray(e.comments)&&e.comments.map(e=>e&&{...e,author:r(e.author)})})}function h(){return new i(0,"Could not read comments. Try again.","invalid_response")}var l=class{constructor(e){this.options=e;let t=new URL(e.sessionEndpoint??e.endpoint).href.replace(/\/$/,""),r=e.sessionDomain?.replace(/^\./,"")??"";this.cookieDomain=r&&(location.hostname===r||location.hostname.endsWith(`.${r}`))?r:"",this.cookieName=`${this.cookieDomain?"__Secure-":"__Host-"}bc-session-${encodeURIComponent(JSON.stringify([t,e.project]))}`,this.key=`branch-comments:${e.endpoint}:${e.project}`;let o=!1;try{let e=document.cookie.split("; ").find(e=>e.startsWith(`${this.cookieName}=`));o=void 0!==e,this.token=e?.slice(this.cookieName.length+1)||null}catch{}try{let e;try{e=JSON.parse(localStorage.getItem(this.userKey)??"null")}catch{}let t=localStorage.getItem(this.key)??(n(e?.user)&&"string"==typeof e.token?e.token:null);o?!this.token&&t&&this.clear():this.token=t,this.token&&e?.token===this.token&&n(e.user)&&(this.user=e.user)}catch{}try{let t=`bc-session-${encodeURIComponent(e.project)}`,r=location.hostname.match(/^[^.]+\.([^.]+\.(?:workers|pages)\.dev)$/)?.[1];for(let e of new Set(["",this.cookieDomain,r]))void 0!==e&&(document.cookie=`${t}=; Max-Age=0; Path=/${e?`; Domain=${e}`:""}`)}catch{}}options;token=null;user=null;transient=!1;revision;cachedThreads=[];reads=new AbortController;persistenceQueued=!1;persistenceBlocked=!1;key;cookieName;cookieDomain;get sessionKey(){return this.key}get userKey(){return`${this.key}:user`}rememberUser(){try{this.token&&this.user?localStorage.setItem(this.userKey,JSON.stringify({token:this.token,user:this.user})):localStorage.removeItem(this.userKey)}catch{}}cancelReads(){this.reads.abort(),this.reads=new AbortController}async request(e,t="GET",r){let o=new URL(e,this.options.endpoint.replace(/\/?$/,"/"));o.searchParams.set("project",this.options.project),o.searchParams.set("repo",this.options.repo),o.searchParams.set("branch",this.options.branch);let s={},n=this.token;n&&(s.Authorization=`Bearer ${n}`),void 0!==r&&(s["Content-Type"]="application/json");let a="GET"===t?this.reads.signal:void 0,c=AbortSignal.timeout(15e3),l=await fetch(o,{method:t,headers:s,body:void 0===r?void 0:JSON.stringify(r),credentials:"omit",cache:"no-store",signal:a?AbortSignal.any([a,c]):c}).catch(e=>{throw e instanceof TypeError?!1===navigator.onLine?new i(0,"You’re offline.","offline"):new i(0,"Can’t connect to comments.","unreachable"):e});a?.throwIfAborted();let u=await l.json().catch(()=>{if(a?.throwIfAborted(),l.ok)throw h();return{}});if(a?.throwIfAborted(),l.ok&&(!u||"object"!=typeof u||Array.isArray(u)))throw h();if(!l.ok)throw 401===l.status&&n&&this.token===n&&this.clear(),new i(l.status,"site_not_approved"===u?.code?"Comments aren’t turned on for this site yet.":u?.error??"Could not load comments.",u?.code);return u}get listKey(){return`${this.key}:${JSON.stringify([this.options.repo,this.options.branch])}:threads`}cached(){try{let e=JSON.parse(localStorage.getItem(this.listKey)??"null");return e&&(e.threads=c(e.threads,e.authors)),e?.token!==(this.token??"")||!a(e.threads)||void 0!==e.revision&&(!Number.isSafeInteger(e.revision)||e.revision<0)?null:(this.revision=e.revision,this.cachedThreads=e.threads,e.threads)}catch{return null}}persist(){this.persistenceQueued||this.persistenceBlocked||(this.persistenceQueued=!0,queueMicrotask(()=>{this.persistenceQueued=!1;try{let e=Object.create(null),t=[],r=0,o=!1,s=this.options.page?.()??location.pathname,i=[...this.cachedThreads].sort((e,t)=>+(t.page===s)-+(e.page===s));for(let s of i){let i=Object.create(null),n=t=>(t&&(i[t.id]={...e[t.id],...i[t.id],...t}),t?.id??null),a={...s,resolvedBy:n(s.resolvedBy),comments:s.comments.map(e=>({...e,author:n(e.author)}))},c=JSON.stringify(a).length+Object.entries(i).reduce((t,[r,o])=>t+JSON.stringify([r,o]).length-(e[r]?JSON.stringify([r,e[r]]).length:0),0)+2;r+c>25e4?o=!0:(r+=c,Object.assign(e,i),t.push(a))}if(o&&!t.length)return void localStorage.removeItem(this.listKey);localStorage.setItem(this.listKey,JSON.stringify({token:this.token??"",revision:o?void 0:this.revision,threads:t,authors:e}))}catch{this.persistenceBlocked=!0;try{localStorage.removeItem(this.listKey)}catch{}}}))}async list(){let e,t,r=this.token,o=this.reads.signal,s=[],n=0;for(;null!==n;){let l=await this.request(`threads?authors=1&offset=${n}${e?`&cursor=${encodeURIComponent(e)}`:""}${0===n&&void 0!==this.revision?`&revision=${this.revision}`:""}`).catch(e=>{throw e instanceof i&&403===e.status&&this.token===r&&(this.revision=void 0,this.cachedThreads=[],this.persist()),e});if(o.throwIfAborted(),l.threads=c(l.threads,l.authors),!0===l.notModified&&0===n&&void 0!==this.revision)return this.cachedThreads;if(!a(l.threads)||null!=l.nextCursor&&("string"!=typeof l.nextCursor||l.nextCursor.length>200||l.nextCursor===e)||void 0!==l.revision&&(!Number.isSafeInteger(l.revision)||l.revision<0)||null!=l.next&&(!Number.isSafeInteger(l.next)||l.next<=n))throw h();0===n&&(t=l.revision),s.push(...l.threads??[]),e=l.nextCursor??void 0,n=l.next??null}return this.revision=t,this.cachedThreads=s,this.persist(),s}save(e){e.token!==this.token&&(this.cancelReads(),this.revision=void 0,this.cachedThreads=[]),this.token=e.token,this.user=e.user,this.rememberUser();let t=!1;try{localStorage.setItem(this.key,e.token),t=!0}catch{}this.transient=!this.writeCookie(e.token,3456e4)&&!t}writeCookie(e,t){if("https:"!==location.protocol)return;let r="Path=/; SameSite=Lax; Secure";try{return this.cookieDomain&&(document.cookie=`${this.cookieName}=; Max-Age=0; ${r}`),document.cookie=`${this.cookieName}=${e}; Max-Age=${t}; ${r}${this.cookieDomain?`; Domain=${this.cookieDomain}`:""}`,document.cookie.split("; ").includes(`${this.cookieName}=${e}`)}catch{}}clear(){this.cancelReads();try{localStorage.removeItem(this.listKey);for(let e of Object.keys(localStorage))e.startsWith(`${this.key}:`)&&localStorage.removeItem(e)}catch{}this.revision=void 0,this.cachedThreads=[],this.token=null,this.user=null,this.transient=!1,this.rememberUser(),this.writeCookie("",3456e4);try{localStorage.removeItem(this.key)}catch{}}async restore(){if(!this.token)return;let e=this.token,t=await this.request("me");if(this.token===e){if(!n(t.user))throw h();this.save({token:e,user:t.user})}}async guest(e){this.save(await this.request("auth/guest","POST",{name:e}))}async logout(){let e=this.request("me","DELETE");this.clear(),await e}};export{o as a,s as b,i as c,l as d};
1
+ import{j as e,k as t,l as r}from"./chunk-PLSWBSSX.js";function o(o,s){let i=e("details","comment-menu"),n=e("summary","icon");n.setAttribute("aria-label",o),n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded","false"),n.title=o,n.append(t("more"));let a=e("div","comment-menu-items");a.popover="manual",a.setAttribute("role","menu"),a.setAttribute("aria-label",o);let c=s.map(t=>{let o=r(t.label,()=>{i.open=!1,n.focus({preventScroll:!0}),t.onSelect()},"menu-action"+(t.destructive?" destructive":""),t.icon);return o.append(e("span","",t.label)),o.setAttribute("role","menuitem"),o.tabIndex=-1,a.append(o),o});return i.addEventListener("toggle",()=>{if(n.setAttribute("aria-expanded",String(i.open)),i.open){a.showPopover();let e=n.getBoundingClientRect();a.style.left=`${Math.max(8,Math.min(e.right-a.offsetWidth,innerWidth-a.offsetWidth-8))}px`,a.style.top=`${Math.max(8,Math.min(e.bottom+6,innerHeight-a.offsetHeight-8))}px`,(c.find(e=>"true"===e.getAttribute("aria-checked"))??c[0])?.focus({preventScroll:!0})}else a.hidePopover()}),i.addEventListener("keydown",e=>{if(!i.open)return;let t,r=c.indexOf(e.target);"ArrowDown"===e.key&&(t=(r+1)%c.length),"ArrowUp"===e.key&&(t=(r-1+c.length)%c.length),"Home"===e.key&&(t=0),"End"===e.key&&(t=c.length-1),void 0!==t&&(e.preventDefault(),c[t]?.focus()),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),i.open=!1,n.focus({preventScroll:!0})),"Tab"===e.key&&(i.open=!1)}),i.append(n,a),i}function s(r,s,i,n){let a=o(r,s.map(([e,t])=>({label:t,icon:"check",onSelect:()=>n(e)})));a.classList.add("selection-menu");let c=a.querySelector("summary");return c.className="selection-trigger",c.replaceChildren(e("span","selection-label",s.find(([e])=>e===i)?.[1]),t("chevron")),a.querySelectorAll("[role=menuitem]").forEach((e,t)=>{e.setAttribute("role","menuitemradio"),e.setAttribute("aria-checked",String(s[t][0]===i))}),a}var i=class extends Error{constructor(e,t,r){super(t),this.status=e,this.code=r}status;code};function n(e){return!!e&&"string"==typeof e.id&&"string"==typeof e.name&&"boolean"==typeof e.verified&&[e.avatarUrl,e.accentColor].every(e=>void 0===e||"string"==typeof e)}function a(e){return Array.isArray(e)&&e.every(e=>e&&"string"==typeof e.id&&"string"==typeof e.page&&"boolean"==typeof e.resolved&&Number.isFinite(e.createdAt)&&Number.isFinite(e.updatedAt)&&(null===e.resolvedBy||n(e.resolvedBy))&&e.anchor&&(!("context"in e.anchor)||function(e){if(void 0===e)return!0;if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t={tag:32,role:80,label:160,nearby:160,classes:200,selectedText:200,styles:500,scope:2e3};return Object.entries(e).every(([e,r])=>"number"==typeof t[e]&&"string"==typeof r&&r.length<=t[e])}(e.anchor.context))&&"string"==typeof e.anchor.selector&&"string"==typeof e.anchor.text&&[e.anchor.x,e.anchor.y,e.anchor.width,e.anchor.height,e.anchor.pageX,e.anchor.pageY,e.anchor.viewportWidth].every(Number.isFinite)&&Array.isArray(e.comments)&&e.comments.every(e=>e&&"string"==typeof e.id&&"string"==typeof e.body&&n(e.author)&&Number.isFinite(e.createdAt)&&(null===e.editedAt||Number.isFinite(e.editedAt))&&e.reactions&&"object"==typeof e.reactions&&!Array.isArray(e.reactions)&&Object.values(e.reactions).every(e=>Array.isArray(e)&&e.every(e=>"string"==typeof e))))}function c(e,t){if(!t||!Array.isArray(e))return e;let r=e=>"string"==typeof e?Object.hasOwn(t,e)?t[e]:void 0:e;return e.map(e=>e&&{...e,resolvedBy:r(e.resolvedBy),comments:Array.isArray(e.comments)&&e.comments.map(e=>e&&{...e,author:r(e.author)})})}function h(){return new i(0,"Could not read comments. Try again.","invalid_response")}var l=class{constructor(e){this.options=e;let t=new URL(e.sessionEndpoint??e.endpoint).href.replace(/\/$/,""),r=e.sessionDomain?.replace(/^\./,"")??"";this.cookieDomain=r&&(location.hostname===r||location.hostname.endsWith(`.${r}`))?r:"",this.cookieName=`${this.cookieDomain?"__Secure-":"__Host-"}bc-session-${encodeURIComponent(JSON.stringify([t,e.project]))}`,this.key=`branch-comments:${e.endpoint}:${e.project}`;let o=!1;try{let e=document.cookie.split("; ").find(e=>e.startsWith(`${this.cookieName}=`));o=void 0!==e,this.token=e?.slice(this.cookieName.length+1)||null}catch{}try{let e;try{e=JSON.parse(localStorage.getItem(this.userKey)??"null")}catch{}let t=localStorage.getItem(this.key)??(n(e?.user)&&"string"==typeof e.token?e.token:null);o?!this.token&&t&&this.clear():this.token=t,this.token&&e?.token===this.token&&n(e.user)&&(this.user=e.user)}catch{}try{let t=`bc-session-${encodeURIComponent(e.project)}`,r=location.hostname.match(/^[^.]+\.([^.]+\.(?:workers|pages)\.dev)$/)?.[1];for(let e of new Set(["",this.cookieDomain,r]))void 0!==e&&(document.cookie=`${t}=; Max-Age=0; Path=/${e?`; Domain=${e}`:""}`)}catch{}}options;token=null;user=null;transient=!1;revision;cachedThreads=[];reads=new AbortController;persistenceQueued=!1;persistenceBlocked=!1;key;cookieName;cookieDomain;get sessionKey(){return this.key}get userKey(){return`${this.key}:user`}rememberUser(){try{this.token&&this.user?localStorage.setItem(this.userKey,JSON.stringify({token:this.token,user:this.user})):localStorage.removeItem(this.userKey)}catch{}}cancelReads(){this.reads.abort(),this.reads=new AbortController}async request(e,t="GET",r){let o=new URL(e,this.options.endpoint.replace(/\/?$/,"/"));o.searchParams.set("project",this.options.project),o.searchParams.set("repo",this.options.repo),o.searchParams.set("branch",this.options.branch);let s={},n=this.token;n&&(s.Authorization=`Bearer ${n}`),void 0!==r&&(s["Content-Type"]="application/json");let a="GET"===t?this.reads.signal:void 0,c=AbortSignal.timeout(15e3),l=await fetch(o,{method:t,headers:s,body:void 0===r?void 0:JSON.stringify(r),credentials:"omit",cache:"no-store",signal:a?AbortSignal.any([a,c]):c}).catch(e=>{throw e instanceof TypeError?!1===navigator.onLine?new i(0,"You’re offline.","offline"):new i(0,"Can’t connect to comments.","unreachable"):e});a?.throwIfAborted();let u=await l.json().catch(()=>{if(a?.throwIfAborted(),l.ok)throw h();return{}});if(a?.throwIfAborted(),l.ok&&(!u||"object"!=typeof u||Array.isArray(u)))throw h();if(!l.ok)throw 401===l.status&&n&&this.token===n&&this.clear(),new i(l.status,"site_not_approved"===u?.code?"Comments aren’t turned on for this site yet.":u?.error??"Could not load comments.",u?.code);return u}get listKey(){return`${this.key}:${JSON.stringify([this.options.repo,this.options.branch])}:threads`}cached(){try{let e=JSON.parse(localStorage.getItem(this.listKey)??"null");return e&&(e.threads=c(e.threads,e.authors)),e?.token!==(this.token??"")||!a(e.threads)||void 0!==e.revision&&(!Number.isSafeInteger(e.revision)||e.revision<0)?null:(this.revision=e.revision,this.cachedThreads=e.threads,e.threads)}catch{return null}}persist(){this.persistenceQueued||this.persistenceBlocked||(this.persistenceQueued=!0,queueMicrotask(()=>{this.persistenceQueued=!1;try{let e=Object.create(null),t=[],r=0,o=!1,s=this.options.page?.()??location.pathname,i=[...this.cachedThreads].sort((e,t)=>+(t.page===s)-+(e.page===s));for(let s of i){let i=Object.create(null),n=t=>(t&&(i[t.id]={...e[t.id],...i[t.id],...t}),t?.id??null),a={...s,resolvedBy:n(s.resolvedBy),comments:s.comments.map(e=>({...e,author:n(e.author)}))},c=JSON.stringify(a).length+Object.entries(i).reduce((t,[r,o])=>t+JSON.stringify([r,o]).length-(e[r]?JSON.stringify([r,e[r]]).length:0),0)+2;r+c>25e4?o=!0:(r+=c,Object.assign(e,i),t.push(a))}if(o&&!t.length)return void localStorage.removeItem(this.listKey);localStorage.setItem(this.listKey,JSON.stringify({token:this.token??"",revision:o?void 0:this.revision,threads:t,authors:e}))}catch{this.persistenceBlocked=!0;try{localStorage.removeItem(this.listKey)}catch{}}}))}async list(){let e,t,r=this.token,o=this.reads.signal,s=[],n=0;for(;null!==n;){let l=await this.request(`threads?authors=1&offset=${n}${e?`&cursor=${encodeURIComponent(e)}`:""}${0===n&&void 0!==this.revision?`&revision=${this.revision}`:""}`).catch(e=>{throw e instanceof i&&403===e.status&&this.token===r&&(this.revision=void 0,this.cachedThreads=[],this.persist()),e});if(o.throwIfAborted(),l.threads=c(l.threads,l.authors),!0===l.notModified&&0===n&&void 0!==this.revision)return this.cachedThreads;if(!a(l.threads)||null!=l.nextCursor&&("string"!=typeof l.nextCursor||l.nextCursor.length>200||l.nextCursor===e)||void 0!==l.revision&&(!Number.isSafeInteger(l.revision)||l.revision<0)||null!=l.next&&(!Number.isSafeInteger(l.next)||l.next<=n))throw h();0===n&&(t=l.revision),s.push(...l.threads??[]),e=l.nextCursor??void 0,n=l.next??null}return this.revision=t,this.cachedThreads=s,this.persist(),s}save(e){e.token!==this.token&&(this.cancelReads(),this.revision=void 0,this.cachedThreads=[]),this.token=e.token,this.user=e.user,this.rememberUser();let t=!1;try{localStorage.setItem(this.key,e.token),t=!0}catch{}this.transient=!this.writeCookie(e.token,3456e4)&&!t}writeCookie(e,t){if("https:"!==location.protocol)return;let r="Path=/; SameSite=Lax; Secure";try{return this.cookieDomain&&(document.cookie=`${this.cookieName}=; Max-Age=0; ${r}`),document.cookie=`${this.cookieName}=${e}; Max-Age=${t}; ${r}${this.cookieDomain?`; Domain=${this.cookieDomain}`:""}`,document.cookie.split("; ").includes(`${this.cookieName}=${e}`)}catch{}}clear(){this.cancelReads();try{localStorage.removeItem(this.listKey);for(let e of Object.keys(localStorage))e.startsWith(`${this.key}:`)&&localStorage.removeItem(e)}catch{}this.revision=void 0,this.cachedThreads=[],this.token=null,this.user=null,this.transient=!1,this.rememberUser(),this.writeCookie("",3456e4);try{localStorage.removeItem(this.key)}catch{}}async restore(){if(!this.token)return;let e=this.token,t=await this.request("me");if(this.token===e){if(!n(t.user))throw h();this.save({token:e,user:t.user})}}async guest(e){this.save(await this.request("auth/guest","POST",{name:e}))}async logout(){let e=this.request("me","DELETE");this.clear(),await e}};export{o as a,s as b,i as c,l as d};
@@ -1 +1 @@
1
- var e="#c8b5f4";function t(t,o){let r=o&&/^#[0-9a-f]{6}$/i.test(o)?o:e,n=[1,3,5].map(e=>{let t=parseInt(r.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}),i=.2126*n[0]+.7152*n[1]+.0722*n[2];t.style.backgroundColor=r,t.style.color=i>.179?"#161616":"#ffffff",t.style.setProperty("--reviewer-accent",r),t.style.setProperty("--reviewer-ink",i>.179?"#161616":"#ffffff")}var o={chevron:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"></path></svg>',drawer:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m7 15 5 5 5-5M7 9l5-5 5 5"></path></svg>',edit:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"></path></svg>',trash:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M16 6v-.8c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C14.48 2 13.92 2 12.8 2h-1.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2V6m2 5.5v5m4-5v5M3 6h18m-2 0v11.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C16.72 22 15.88 22 14.2 22H9.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C5 19.72 5 18.88 5 17.2V6"></path></svg>',info:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 16v-4m0-4h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"></path></svg>',more:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path></svg>',person:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"></path></svg>',search:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"></path></svg>',plus:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14m-7-7h14"></path></svg>',comment:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.094 11.229A8.01 8.01 0 0 1 6 10c0-4.418 3.605-8 8.053-8 4.447 0 8.052 3.582 8.052 8a7.94 7.94 0 0 1-.52 2.835c-.07.182-.105.274-.12.345a.897.897 0 0 0-.024.194c-.002.073.008.153.028.314l.403 3.27c.043.355.065.532.006.66a.5.5 0 0 1-.257.252c-.13.055-.306.03-.66-.022l-3.184-.467c-.167-.024-.25-.037-.326-.036a.898.898 0 0 0-.2.021 2.989 2.989 0 0 0-.358.122 8.174 8.174 0 0 1-4.07.42M7.632 22C10.597 22 13 19.538 13 16.5S10.597 11 7.632 11c-2.965 0-5.369 2.462-5.369 5.5 0 .61.097 1.198.277 1.747.075.232.113.348.126.427.013.083.015.13.01.213-.005.08-.025.17-.065.351L2 22l2.995-.409c.163-.022.245-.034.316-.033.076 0 .115.005.19.02.07.013.173.05.381.123a5.246 5.246 0 0 0 1.75.299Z"></path></svg>',copy:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 0 1 1.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C10.52 22 11.08 22 12.2 22Z"></path></svg>',pointer:'<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path transform="translate(24 0) scale(-1 1)" d="M3.41345 10.7445C2.81811 10.513 2.52043 10.3972 2.43353 10.2304C2.35819 10.0858 2.35809 9.91354 2.43326 9.76886C2.51997 9.60195 2.8175 9.48584 3.41258 9.25361L20.3003 2.66327C20.8375 2.45364 21.1061 2.34883 21.2777 2.40616C21.4268 2.45596 21.5437 2.57292 21.5935 2.72197C21.6509 2.8936 21.5461 3.16219 21.3364 3.69937L14.7461 20.5871C14.5139 21.1822 14.3977 21.4797 14.2308 21.5664C14.0862 21.6416 13.9139 21.6415 13.7693 21.5662C13.6025 21.4793 13.4867 21.1816 13.2552 20.5862L10.6271 13.8282C10.5801 13.7074 10.5566 13.647 10.5203 13.5961C10.4881 13.551 10.4487 13.5115 10.4036 13.4794C10.3527 13.4431 10.2923 13.4196 10.1715 13.3726L3.41345 10.7445Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>',expand:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"></path></svg>',close:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg>',check:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>',arrow:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5m0 0-7 7m7-7 7 7"></path></svg>',link:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"></path></svg>',code:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"></path></svg>',smile:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',tag:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 8h.01M2 5.2v4.475c0 .489 0 .733.055.963.05.204.13.4.24.579.123.201.296.374.642.72l7.669 7.669c1.188 1.188 1.782 1.782 2.467 2.004a3 3 0 0 0 1.854 0c.685-.222 1.28-.816 2.467-2.004l2.212-2.212c1.188-1.188 1.782-1.782 2.004-2.467a3 3 0 0 0 0-1.854c-.222-.685-.816-1.28-2.004-2.467l-7.669-7.669c-.346-.346-.519-.519-.72-.642a2.001 2.001 0 0 0-.579-.24C10.409 2 10.165 2 9.676 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2ZM8.5 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"></path></svg>',design:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12c0 5.523 4.477 10 10 10a3 3 0 0 0 3-3v-.5c0-.464 0-.697.026-.892a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.892-.026h.5a3 3 0 0 0 3-3c0-5.523-4.477-10-10-10S2 6.477 2 12Z"></path><path d="M7 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm9-4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-6-1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path></svg>'},r=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,n=e=>e instanceof HTMLElement&&(e.matches("input,textarea,select")||e.isContentEditable),i="pointerdown mousedown touchstart touchmove touchend click wheel focusin focusout keydown keyup keypress".split(" "),a=(e,t)=>t instanceof ShadowRoot&&t.host.hasAttribute("data-isolate")&&(!e.type.startsWith("key")||n(e.composedPath()[0]));function s(e,t,o,r){let n=e.getRootNode();document.addEventListener(t,o,r),n.addEventListener(t,e=>a(e,n)&&o(e),r)}function h(e,t="",o){let r=document.createElement(e);return t&&(r.className=t),void 0!==o&&(r.textContent=o),r}var d=new Map;function l(e){let t=d.get(e);if(!t){let r=document.createElement("div");r.innerHTML=o[e],t=r.querySelector("svg"),d.set(e,t)}return t.cloneNode(!0)}function c(e,t,o="icon",r){let n=h("button",o);return n.type="button",n.title=e,n.setAttribute("aria-label",e),r?n.append(l(r)):n.textContent=e,n.addEventListener("click",t),n}var u=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]).join("").toUpperCase();function p(e){let t=Math.max(0,Math.floor((Date.now()-e)/6e4));return t?t<60?`${t}m`:t<1440?`${Math.floor(t/60)}h`:`${Math.floor(t/1440)}d`:"Just now"}var g,k=e=>{g=e};function v(e){let t=e.avatarUrl;if(t?.startsWith("data:image/jpeg;base64,"))return t;try{return t||=e.verified?g?.({id:e.id,name:e.name}):"","https:"==new URL(t).protocol?t:void 0}catch{}}function w(e){let o=h("span","avatar",u(e.name));t(o,e.accentColor);let r=v(e);if(r){let e=h("img");e.alt="",e.referrerPolicy="no-referrer",e.loading="lazy",e.decoding="async",e.addEventListener("error",()=>e.remove(),{once:!0}),e.src=r,o.append(e)}return o}function C(){let e=h("img","google-logo");return e.src="data:image/webp;base64,UklGRgAMAABXRUJQVlA4TPMLAAAvOsAOEAGGbdtGgu3gnCDp/gN/t0JE/ycAj9w3m2Q5YlvLRneVRGKt5QEAbbQtbcfyN2+AJHTfun+A5MvMtvcCoZk42SakmdhsWwhNVWMybQmIqmpmprXtzZyRpIHbSLLVqE0xS8eQf3TfPAvFGbBpJMlRnQFgARx/PA/gotdHFsDJaWzbTrVwOeNzAfRfCQ4kkp+j6P8EAECFCTjyRIHZCkyzA3iRgEl6KBQAZAA68ISef4S5YTqA3QkJFwSwnPkdLSJg4cSYcoLuLSMDtb/HuPI7CgkJCekJCWGEzsNxc68IXIVAIySEjRY4UoGCIwDYAbhkyiMYH8E0p+W43sWGjo6IkciO/H+KZDn/f1Z191ve9VbkMbjMFjPLYkZXJr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lenquKGSqMGIOwBxR4AvEaOaFTAo4HqilDpPEu67zrIEVAmX+cxy61eFVERXhVArBy+B3godNq22yQiQapQsKHUhPfTL151/r8f5aav9zIZzksY7jTa0MOgES0WbrQJAWEWwcrGcSTvWLpezZO/UfKZXv27+Wzf/5KPmopJe6GbKomCbzypsPCGMlFVbThh24+6QWSEBBuz0uzSb54/giV8rHt85uEVDWm3M23koCmDTWRiQSoVAIEAHwClFECqjNLJICuhQdbhrt0ll3nzykMs8f1ffhJhd1bMp03spHjKaLRKtsQWAHwPgGorIgMMSVJGmb60us8s1l7w9RtgGJ/46NuUtFk8N0sTc2VImsKnn99APWNRSqVRv7f8KuFx3lwwOGyMZ+e6fguyAcP6EN9F3ZGJszVS04H8vCjAeEUMEoz42eA6cVWGjlRK2PDl9WcnPZf2EWQXcgaUCAA=",e.alt="",e.width=e.height=18,e}export{e as a,t as b,o as c,r as d,n as e,i as f,a as g,s as h,h as i,l as j,c as k,u as l,p as m,k as n,v as o,w as p,C as q};
1
+ var e="#c8b5f4";function t(t,o){let r=o&&/^#[0-9a-f]{6}$/i.test(o)?o:e,n=[1,3,5].map(e=>{let t=parseInt(r.slice(e,e+2),16)/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}),i=.2126*n[0]+.7152*n[1]+.0722*n[2];t.style.backgroundColor=r,t.style.color=i>.179?"#161616":"#ffffff",t.style.setProperty("--reviewer-accent",r),t.style.setProperty("--reviewer-ink",i>.179?"#161616":"#ffffff")}var o={chevron:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"></path></svg>',drawer:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m7 15 5 5 5-5M7 9l5-5 5 5"></path></svg>',edit:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 0 0-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 0 0-.24.579c-.055.23-.055.474-.055.963V16Z"></path></svg>',trash:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M16 6v-.8c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C14.48 2 13.92 2 12.8 2h-1.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2V6m2 5.5v5m4-5v5M3 6h18m-2 0v11.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C16.72 22 15.88 22 14.2 22H9.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C5 19.72 5 18.88 5 17.2V6"></path></svg>',info:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 16v-4m0-4h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"></path></svg>',more:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path></svg>',person:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 21c0-1.396 0-2.093-.172-2.661a4 4 0 0 0-2.667-2.667c-.568-.172-1.265-.172-2.661-.172h-5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C4 18.907 4 19.604 4 21M16.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"></path></svg>',search:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 21-3.5-3.5m2.5-6a8.5 8.5 0 1 1-17 0 8.5 8.5 0 0 1 17 0Z"></path></svg>',plus:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14m-7-7h14"></path></svg>',comment:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.094 11.229A8.01 8.01 0 0 1 6 10c0-4.418 3.605-8 8.053-8 4.447 0 8.052 3.582 8.052 8a7.94 7.94 0 0 1-.52 2.835c-.07.182-.105.274-.12.345a.897.897 0 0 0-.024.194c-.002.073.008.153.028.314l.403 3.27c.043.355.065.532.006.66a.5.5 0 0 1-.257.252c-.13.055-.306.03-.66-.022l-3.184-.467c-.167-.024-.25-.037-.326-.036a.898.898 0 0 0-.2.021 2.989 2.989 0 0 0-.358.122 8.174 8.174 0 0 1-4.07.42M7.632 22C10.597 22 13 19.538 13 16.5S10.597 11 7.632 11c-2.965 0-5.369 2.462-5.369 5.5 0 .61.097 1.198.277 1.747.075.232.113.348.126.427.013.083.015.13.01.213-.005.08-.025.17-.065.351L2 22l2.995-.409c.163-.022.245-.034.316-.033.076 0 .115.005.19.02.07.013.173.05.381.123a5.246 5.246 0 0 0 1.75.299Z"></path></svg>',copy:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 0 1 1.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C10.52 22 11.08 22 12.2 22Z"></path></svg>',pointer:'<svg width="100%" height="100%" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path transform="translate(24 0) scale(-1 1)" d="M3.41345 10.7445C2.81811 10.513 2.52043 10.3972 2.43353 10.2304C2.35819 10.0858 2.35809 9.91354 2.43326 9.76886C2.51997 9.60195 2.8175 9.48584 3.41258 9.25361L20.3003 2.66327C20.8375 2.45364 21.1061 2.34883 21.2777 2.40616C21.4268 2.45596 21.5437 2.57292 21.5935 2.72197C21.6509 2.8936 21.5461 3.16219 21.3364 3.69937L14.7461 20.5871C14.5139 21.1822 14.3977 21.4797 14.2308 21.5664C14.0862 21.6416 13.9139 21.6415 13.7693 21.5662C13.6025 21.4793 13.4867 21.1816 13.2552 20.5862L10.6271 13.8282C10.5801 13.7074 10.5566 13.647 10.5203 13.5961C10.4881 13.551 10.4487 13.5115 10.4036 13.4794C10.3527 13.4431 10.2923 13.4196 10.1715 13.3726L3.41345 10.7445Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>',expand:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 3v18M7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"></path></svg>',close:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"></path></svg>',check:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg>',arrow:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5m0 0-7 7m7-7 7 7"></path></svg>',link:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"></path></svg>',code:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m17 17 5-5-5-5M7 7l-5 5 5 5m7-14-4 18"></path></svg>',smile:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="M8 14s1.5 2 4 2 4-2 4-2"></path><line x1="9" y1="9" x2="9.01" y2="9"></line><line x1="15" y1="9" x2="15.01" y2="9"></line></svg>',tag:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 8h.01M2 5.2v4.475c0 .489 0 .733.055.963.05.204.13.4.24.579.123.201.296.374.642.72l7.669 7.669c1.188 1.188 1.782 1.782 2.467 2.004a3 3 0 0 0 1.854 0c.685-.222 1.28-.816 2.467-2.004l2.212-2.212c1.188-1.188 1.782-1.782 2.004-2.467a3 3 0 0 0 0-1.854c-.222-.685-.816-1.28-2.004-2.467l-7.669-7.669c-.346-.346-.519-.519-.72-.642a2.001 2.001 0 0 0-.579-.24C10.409 2 10.165 2 9.676 2H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 3.52 2 4.08 2 5.2ZM8.5 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0Z"></path></svg>',design:'<svg viewBox="0 0 24 24" width="24" height="24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 12c0 5.523 4.477 10 10 10a3 3 0 0 0 3-3v-.5c0-.464 0-.697.026-.892a3 3 0 0 1 2.582-2.582c.195-.026.428-.026.892-.026h.5a3 3 0 0 0 3-3c0-5.523-4.477-10-10-10S2 6.477 2 12Z"></path><path d="M7 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm9-4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-6-1a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"></path></svg>'},r=()=>matchMedia("(prefers-reduced-motion: reduce)").matches,n=e=>e instanceof HTMLElement&&(e.matches("input,textarea,select")||e.isContentEditable),i="pointerdown mousedown touchstart touchmove touchend click wheel focusin focusout keydown keyup keypress".split(" "),a=(e,t)=>t instanceof ShadowRoot&&t.host.hasAttribute("data-isolate")&&(!e.type.startsWith("key")||n(e.composedPath()[0]));function s(e,t){e.ownerDocument.defaultView?.addEventListener("keydown",t=>{"Escape"===t.key&&t.composedPath().includes(e)&&t.preventDefault()},{capture:!0,signal:t})}function d(e,t,o,r){let n=e.getRootNode();document.addEventListener(t,o,r),n.addEventListener(t,e=>a(e,n)&&o(e),r)}function h(e,t="",o){let r=document.createElement(e);return t&&(r.className=t),void 0!==o&&(r.textContent=o),r}var l=new Map;function c(e){let t=l.get(e);if(!t){let r=document.createElement("div");r.innerHTML=o[e],t=r.querySelector("svg"),l.set(e,t)}return t.cloneNode(!0)}function u(e,t,o="icon",r){let n=h("button",o);return n.type="button",n.title=e,n.setAttribute("aria-label",e),r?n.append(c(r)):n.textContent=e,n.addEventListener("click",t),n}var p=e=>e.trim().split(/\s+/).slice(0,2).map(e=>e[0]).join("").toUpperCase();function g(e){let t=Math.max(0,Math.floor((Date.now()-e)/6e4));return t?t<60?`${t}m`:t<1440?`${Math.floor(t/60)}h`:`${Math.floor(t/1440)}d`:"Just now"}var k,v=e=>{k=e};function w(e){let t=e.avatarUrl;if(t?.startsWith("data:image/jpeg;base64,"))return t;try{return t||=e.verified?k?.({id:e.id,name:e.name}):"","https:"==new URL(t).protocol?t:void 0}catch{}}function C(e){let o=h("span","avatar",p(e.name));t(o,e.accentColor);let r=w(e);if(r){let e=h("img");e.alt="",e.referrerPolicy="no-referrer",e.loading="lazy",e.decoding="async",e.addEventListener("error",()=>e.remove(),{once:!0}),e.src=r,o.append(e)}return o}function f(){let e=h("img","google-logo");return e.src="data:image/webp;base64,UklGRgAMAABXRUJQVlA4TPMLAAAvOsAOEAGG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lJnx813rtdocd6UW9lx70X32Xm/5Ih9K2timZ6XMu/Matd2nrznZUxc7J4r5N02ElSVBSi0Wa5+T+lDGrZ7qJ9/LABkZzO5XJJ4Ar+lpsIHIjVUVVQMGrLiscuoXIslDbaSdcH0k5jQ1QGShYnkwDJhBsenAT8eE3GqTQSlSubZpKkz+bDot52QvMNvnIqULZKicW1lRdVp2EdoWbGq2iOqJaK2tp4GBObhfQAi1MNrLzt+czyVGwXNsEUnhP6+JTbQSldwWBNQVQpAhcymYxul7bEKP/qSCFWzR0THdkiy2XyXX//1FTnjt8fdHbTvasCMKl/YYQKaWEG1iajg5ukHnGcYVLUBELWNe3SdJ5vNrl3mFW1RfHC99zW/5lenquKGSqMGIOwBxR4AvEaOaFTAo4HqilDpPEu67zrIEVAmX+cxy61eFVERXhVArBy+B3godNq22yQiQapQsKHUhPfTL151/r8f5aav9zIZzksY7jTa0MOgES0WbrQJAWEWwcrGcSTvWLpezZO/UfKZXv27+Wzf/5KPmopJe6GbKomCbzypsPCGMlFVbThh24+6QWSEBBuz0uzSb54/giV8rHt85uEVDWm3M23koCmDTWRiQSoVAIEAHwClFECqjNLJICuhQdbhrt0ll3nzykMs8f1ffhJhd1bMp03spHjKaLRKtsQWAHwPgGorIgMMSVJGmb60us8s1l7w9RtgGJ/46NuUtFk8N0sTc2VImsKnn99APWNRSqVRv7f8KuFx3lwwOGyMZ+e6fguyAcP6EN9F3ZGJszVS04H8vCjAeEUMEoz42eA6cVWGjlRK2PDl9WcnPZf2EWQXcgaUCAA=",e.alt="",e.width=e.height=18,e}export{e as a,t as b,o as c,r as d,n as e,i as f,a as g,s as h,d as i,h as j,c as k,u as l,p as m,g as n,v as o,w as p,C as q,f as r};