@snagset/server 0.1.36 → 0.1.38

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.
Files changed (66) hide show
  1. package/dist/vendor/types/names.js +2 -0
  2. package/package.json +1 -1
  3. package/static/dashboard/assets/{CompositeItem-CJog0hVD.js → CompositeItem-Yi3wWYM7.js} +1 -1
  4. package/static/dashboard/assets/{ConfirmDialog-D2seMnrm.js → ConfirmDialog-D6hyhISD.js} +1 -1
  5. package/static/dashboard/assets/{CopyButton-Bc4lyikk.js → CopyButton-hyiQh1Zr.js} +1 -1
  6. package/static/dashboard/assets/{FieldItemContext-CzXi3fsx.js → FieldItemContext-Gb3Lo5Ci.js} +1 -1
  7. package/static/dashboard/assets/{InstallTag-SMFR2B0h.js → InstallTag-BRvgfS91.js} +1 -1
  8. package/static/dashboard/assets/{McpTokens-BXqxvFAS.js → McpTokens--C1TeZqq.js} +1 -1
  9. package/static/dashboard/assets/{SaveState-Cmf4iv03.js → SaveState-CmcJ4unZ.js} +1 -1
  10. package/static/dashboard/assets/{_app-DwywpWfz.js → _app-CBnYJfLp.js} +1 -1
  11. package/static/dashboard/assets/{_app-bdnugJ8u.js → _app-Dsd1bbNv.js} +1 -1
  12. package/static/dashboard/assets/{activity-qDQs5Zz8.js → activity-DG1e6z-2.js} +1 -1
  13. package/static/dashboard/assets/{arrow-left-CDK8KGdH.js → arrow-left-CWiSdgA-.js} +1 -1
  14. package/static/dashboard/assets/{avatar-BIbCnV-M.js → avatar-nrKPMD7A.js} +1 -1
  15. package/static/dashboard/assets/{badge-BD0L3Rdr.js → badge-DEvpNOzs.js} +1 -1
  16. package/static/dashboard/assets/{card-CCRzd-vJ.js → card--8RLEIGP.js} +1 -1
  17. package/static/dashboard/assets/{check-CvTMcsU6.js → check-XHwuM5zg.js} +1 -1
  18. package/static/dashboard/assets/{chevron-right-NPSJD-jD.js → chevron-right-CG2rSUns.js} +1 -1
  19. package/static/dashboard/assets/{copy-CwAe5Q6l.js → copy-eakuUTpI.js} +1 -1
  20. package/static/dashboard/assets/{dialog-CvU77XfW.js → dialog-D0b9dX2m.js} +1 -1
  21. package/static/dashboard/assets/{dropdown-menu-VHkK2Dt7.js → dropdown-menu-BMIst4Wj.js} +1 -1
  22. package/static/dashboard/assets/{image-off-wPLko91u.js → image-off-DZOyJVTM.js} +1 -1
  23. package/static/dashboard/assets/{index-B1JGVSdd.js → index-COORBw3J.js} +4 -4
  24. package/static/dashboard/assets/{invite-DWNnOuAZ.js → invite-Df7qdHBL.js} +1 -1
  25. package/static/dashboard/assets/{label-C6rZlF0y.js → label-Ds2CYKth.js} +1 -1
  26. package/static/dashboard/assets/{labels-DhKmOzOU.js → labels-CUVq_Uf0.js} +1 -1
  27. package/static/dashboard/assets/{layout-grid-CPYmheoR.js → layout-grid-BXWirugp.js} +1 -1
  28. package/static/dashboard/assets/{parts-sBoh2K5o.js → parts-B46j7QJi.js} +1 -1
  29. package/static/dashboard/assets/{plus-B7K-9XU0.js → plus-yZPLf0r6.js} +1 -1
  30. package/static/dashboard/assets/s._site-BQiiE9w4.js +1 -0
  31. package/static/dashboard/assets/s._site.comments-CQYkPWo4.js +54 -0
  32. package/static/dashboard/assets/{s._site.reviewers-yBn4jjwr.js → s._site.reviewers-BCQWB5GA.js} +1 -1
  33. package/static/dashboard/assets/{s._site.settings-CsiWJZ8D.js → s._site.settings-D9Qix9dj.js} +1 -1
  34. package/static/dashboard/assets/{setup-DrjzRZp8.js → setup-CefvYWGy.js} +1 -1
  35. package/static/dashboard/assets/{sign-in-BsM2n_hk.js → sign-in-Q4AWMmvk.js} +1 -1
  36. package/static/dashboard/assets/{sign-up-BXcvVUC-.js → sign-up-nsUll0Gy.js} +1 -1
  37. package/static/dashboard/assets/{sites-DRTZAXN_.js → sites-BKsg9Pla.js} +1 -1
  38. package/static/dashboard/assets/{studio-DdM6OVdO.js → studio-CSGo60dt.js} +1 -1
  39. package/static/dashboard/assets/studio-ytRb_WCk.js +1 -0
  40. package/static/dashboard/assets/{studio.index-BOXLD6ah.js → studio.index-Cul4Sj15.js} +1 -1
  41. package/static/dashboard/assets/{studio.integrations-B7XK6X3K.js → studio.integrations-CC61jGXL.js} +1 -1
  42. package/static/dashboard/assets/{studio.members-DSJEjb1M.js → studio.members-DEM1MjLy.js} +1 -1
  43. package/static/dashboard/assets/{sun-DojiLt7X.js → sun-Djjj3CUF.js} +1 -1
  44. package/static/dashboard/assets/{switch-SJYZN0-3.js → switch-WMRF6OK1.js} +1 -1
  45. package/static/dashboard/assets/{table-BDQkr8bT.js → table-CgakQRAC.js} +1 -1
  46. package/static/dashboard/assets/{useAriaLabelledBy-BDqDB_Wq.js → useAriaLabelledBy-obWCIEg1.js} +1 -1
  47. package/static/dashboard/assets/{useBaseQuery-DXKWEN1Y.js → useBaseQuery-DG87f6yY.js} +1 -1
  48. package/static/dashboard/assets/useQuery-DT3w11tR.js +1 -0
  49. package/static/dashboard/assets/useRender-Bu6Vyu1g.js +1 -0
  50. package/static/dashboard/assets/{useValueChanged-B9j_H2Sq.js → useValueChanged-CHzVruZ0.js} +1 -1
  51. package/static/dashboard/assets/{users-jrxD0Qlm.js → users-BvfczmcS.js} +1 -1
  52. package/static/dashboard/assets/{welcome-BGT16RMO.js → welcome-D5mKF-J3.js} +1 -1
  53. package/static/dashboard/assets/{widget-signin-A_kxUEvx.js → widget-signin-BmCBYJgF.js} +1 -1
  54. package/static/dashboard/assets/{you-CdfLrYaC.js → you-Dsp9kUVS.js} +1 -1
  55. package/static/dashboard/assets/{zod-C7-R6TNW.js → zod-D7wsVto4.js} +1 -1
  56. package/static/dashboard/index.html +1 -1
  57. package/static/widget/build.json +2 -2
  58. package/static/widget/snag.capture.js +1 -1
  59. package/static/widget/snag.dock.js +5 -5
  60. package/static/widget/snag.js +1 -1
  61. package/static/widget/snag.runtime.js +2 -2
  62. package/static/dashboard/assets/s._site-DKfVuunu.js +0 -1
  63. package/static/dashboard/assets/s._site.comments-DqDBqjhy.js +0 -54
  64. package/static/dashboard/assets/studio-CEwWJLvF.js +0 -1
  65. package/static/dashboard/assets/useQuery-BCK_zdLj.js +0 -1
  66. package/static/dashboard/assets/useRender-hAtJO9As.js +0 -1
@@ -1,54 +0,0 @@
1
- import{c as W,r as p,i as Is,a8 as Es,a9 as Ps,e as Qe,aa as Xe,ab as _s,m as Bs,E as Fs,k as rs,j as e,ac as Ls,g as Os,h as M,B as S,ad as os,ae as Vs,a0 as Ze,af as Ye,$ as is,C as qs,ag as es,p as Us,ah as Ks,ai as ss,aj as Hs,ak as Ws,al as Gs,am as Js,an as Qs,ao as Xs,ap as Zs,aq as Ys,ar as et,as as st,q as De,at as ye,L as ls,H as tt,a5 as ts,I as ke,au as nt,z as Re}from"./index-B1JGVSdd.js";import{u as Ne}from"./useQuery-BCK_zdLj.js";import{C as ds}from"./check-CvTMcsU6.js";import{f as at,e as rt,h as ot,j as it,u as ns,k as lt,l as dt,c as ct,n as ut,L as Ue,I as Ee}from"./label-C6rZlF0y.js";import{L as mt,M as ht,N as xt,A as pt,O as ft,E as cs,G as us,I as ms,H as hs,J as xs,K as ps,X as gt}from"./dialog-CvU77XfW.js";import{u as bt}from"./FieldItemContext-CzXi3fsx.js";import{u as jt}from"./useAriaLabelledBy-BDqDB_Wq.js";import{u as vt}from"./useValueChanged-B9j_H2Sq.js";import{D as se,i as te,j as ne,k as ue,l as we,m as H,n as fs,E as as,o as Ke,p as ce,S as yt}from"./dropdown-menu-VHkK2Dt7.js";import{A as xe,a as pe}from"./avatar-BIbCnV-M.js";import{C as gs}from"./ConfirmDialog-D2seMnrm.js";import{b as He,S as bs,E as Ve}from"./parts-sBoh2K5o.js";import{S as fe,i as kt,b as Pe,c as ze,a as Ce,u as Nt}from"./labels-DhKmOzOU.js";import{C as wt}from"./copy-CwAe5Q6l.js";import{I as Ct}from"./image-off-wPLko91u.js";import{C as St}from"./chevron-right-NPSJD-jD.js";import{I as $t}from"./InstallTag-SMFR2B0h.js";import{A as Mt}from"./arrow-left-CDK8KGdH.js";import"./useBaseQuery-DXKWEN1Y.js";import"./CompositeItem-CJog0hVD.js";import"./card-CCRzd-vJ.js";/**
2
- * @license lucide-react v1.39.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const At=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Te=W("chevron-down",At);/**
7
- * @license lucide-react v1.39.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Dt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Rt=W("columns-2",Dt);/**
12
- * @license lucide-react v1.39.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const zt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Tt=W("ellipsis",zt);/**
17
- * @license lucide-react v1.39.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const It=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Et=W("inbox",It);/**
22
- * @license lucide-react v1.39.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Pt=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],_t=W("list",Pt);/**
27
- * @license lucide-react v1.39.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const Bt=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Ft=W("pencil",Bt);/**
32
- * @license lucide-react v1.39.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const Lt=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Ot=W("rotate-cw",Lt);/**
37
- * @license lucide-react v1.39.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const Vt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],js=W("trash-2",Vt);/**
42
- * @license lucide-react v1.39.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const qt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Ut=W("user-plus",qt);/**
47
- * @license lucide-react v1.39.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const Kt=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],Ht=W("user-round",Kt);function Wt(s){if(!s)return null;for(const n of s.elements){const r=n.tagName;if(r==="BUTTON"||r==="INPUT"){const o=n;if(o.type==="submit")return o}}return null}function vs(s){return{checked(n){return s.indeterminate?{}:n?{"data-checked":""}:{"data-unchecked":""}},...at}}const Gt=p.createContext(void 0);function Jt(){return p.useContext(Gt)}const ys=p.createContext(void 0);function Qt(){const s=p.useContext(ys);if(s===void 0)throw new Error(Is(14));return s}const Xt="data-parent",Zt=p.forwardRef(function(n,r){const{checked:o,className:x,defaultChecked:i=!1,"aria-labelledby":l,disabled:y=!1,form:u,id:h,indeterminate:j=!1,inputRef:f,name:d,onCheckedChange:N,parent:a=!1,readOnly:w=!1,render:E,required:k=!1,uncheckedValue:g,value:z,nativeButton:T=!1,style:V,...$}=n,{clearErrors:v}=rt(),{disabled:D,name:G,setDirty:q,setFilled:U,setFocused:C,setTouched:_,state:L,validationMode:ge,validityData:ae,validation:B}=ot(),be=bt(),{labelId:c,controlId:O,registerControlId:I,getDescriptionProps:Se}=it(),R=Jt(),J=R?.allValues===void 0?void 0:R.parent,Q=J!==void 0,F=D||be.disabled||R?.disabled||y,ee=G??d,P=z??ee,X=ns(),$e=ns();let t=h||O;Q&&(a?t=$e:P!==void 0?t=`${J.id}-${P}`:t||=$e);let m={};Q&&(a?m=J.getParentProps():P!==void 0&&(m=J.getChildProps(P)));const{checked:A=o,indeterminate:Z=j,onCheckedChange:re,...oe}=m,me=R?.value,he=p.useRef(null),Me=Es(()=>Symbol()),_e=p.useRef(!1),{getButtonProps:Cs,buttonRef:Ss}=Ps({disabled:F,native:T}),je=R?.validation??B,[K,$s]=lt({controlled:P!==void 0&&me!==void 0&&!a?me.includes(P):A,default:i,name:"Checkbox",state:"checked"}),Be=Q?!!A:K,ve=Q&&Z||j;Qe(()=>{I!==Xe&&(_e.current=!0,I(Me.current,t))},[t,I,Me]),p.useEffect(()=>{const b=Me.current;return()=>{!_e.current||I===Xe||(_e.current=!1,I(b,void 0))}},[I,Me]),dt(he,X,K,void 0,!R&&!F,d);const ie=p.useRef(null),Ge=je.registerInput,Je=R?P:void 0,Ms=p.useCallback(b=>Ge(b,{controlRef:he,value:Je}),[Ge,Je]),As=_s(f,ie,a?void 0:Ms),Ds=jt(l,c,ie,!T,t??void 0);Qe(()=>{ie.current&&(ie.current.indeterminate=ve,K&&U(!0))},[K,ve,U]),vt(K,()=>{R||(v(ee),U(K),q(K!==ae.initialValue),je.change(K))});const Rs=Bs({checked:K,disabled:F,form:u,name:a?void 0:ee,id:T?void 0:t??void 0,required:k,ref:As,style:ee?mt:ht,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(b){if(b.nativeEvent.defaultPrevented)return;if(w){b.preventDefault();return}const Y=b.currentTarget.checked,le=ct(ut,b.nativeEvent);if(N?.(Y,le),!le.isCanceled&&(re?.(Y,le),!le.isCanceled&&($s(Y),P!==void 0&&R!==void 0&&!a&&!Q))){const de=Y?[...R.value,P]:R.value.filter(Ae=>Ae!==P);R.setValue(de,le)}},onClick(b){b.stopPropagation()},onFocus(){he.current?.focus()}},z!==void 0?{value:(R?K&&z:z)||""}:Fs,Se,b=>je.getValidationProps(F,b));p.useEffect(()=>{if(!J||P===void 0)return;const b=J.disabledStatesRef.current;return b.set(P,F),()=>{b.delete(P)}},[J,F,P]);const Fe=p.useMemo(()=>({...L,checked:Be,disabled:F,readOnly:w,required:k,indeterminate:ve}),[L,Be,F,w,k,ve]),zs=vs(Fe),Ts=rs("span",n,{state:Fe,ref:[Ss,he,r],props:[{id:T?t??void 0:X,role:"checkbox","aria-checked":ve?"mixed":Be,"aria-readonly":w||void 0,"aria-required":k||void 0,"aria-labelledby":Ds,[Xt]:a?"":void 0,onFocus(){F||C(!0)},onBlur(){const b=ie.current;b&&(_(!0),C(!1),ge==="onBlur"&&je.commit(R?me:b.checked))},onKeyDown(b){if(b.key!=="Enter"||(b.preventBaseUIHandler(),b.defaultPrevented))return;const Y=ie.current?.form??null,le=b.currentTarget,de=b.nativeEvent,Ae=b.preventDefault,Le=de.preventDefault;let Oe=!1;b.preventDefault=()=>{Oe=!0,Ae.call(b)},de.preventDefault=()=>{Oe=!0,Le.call(de)},Le.call(de),Os(le).queueMicrotask(()=>{b.preventDefault=Ae,de.preventDefault=Le,Oe||Wt(Y)?.click()})},onClick(b){if(w||F)return;b.preventDefault();const Y=ie.current;Y&&Ls(Y,b)}},$,oe,Cs,Se,b=>je.getValidationProps(F,b)],stateAttributesMapping:zs});return e.jsxs(ys.Provider,{value:Fe,children:[Ts,!K&&!R&&ee&&!a&&g!==void 0&&e.jsx("input",{type:"hidden",form:u,name:ee,value:g,disabled:F}),e.jsx("input",{...Rs,suppressHydrationWarning:!0})]})}),Yt=p.forwardRef(function(n,r){const{render:o,className:x,style:i,keepMounted:l=!1,...y}=n,u=Qt(),h=u.checked||u.indeterminate,{mounted:j,transitionStatus:f,setMounted:d}=xt(h),N=p.useRef(null),a={...u,transitionStatus:f};pt({open:h,ref:N,onComplete(){h||d(!1)}});const E={...vs(u),...ft},k=l||j,g=rs("span",n,{ref:[r,N],state:a,stateAttributesMapping:E,props:y});return k?g:null});function en({className:s,...n}){return e.jsx(Zt,{"data-slot":"checkbox",className:M("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary",s),...n,children:e.jsx(Yt,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:e.jsx(ds,{})})})}function ks({className:s,...n}){return e.jsx("textarea",{"data-slot":"textarea",className:M("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",s),...n})}function sn({rounds:s,active:n,onPick:r,onStart:o,starting:x}){const i=s.find(f=>f.number===n),l=(s[0]?.number??0)+1,[y,u]=p.useState(!1),[h,j]=p.useState("");return e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:"inline-flex h-7 items-center gap-1.5 rounded-md border border-line-strong bg-muted px-2.5 text-[12.5px] font-semibold text-foreground","aria-label":"Round"}),children:[e.jsx(Ot,{className:"size-3.5"}),i?.name??`Round ${n}`,e.jsx(Te,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ne,{align:"start",className:"w-[260px]",children:[e.jsxs(ue,{children:[e.jsx(we,{children:"Rounds"}),s.map(f=>e.jsxs(H,{onClick:()=>r(f.number),children:[e.jsx("span",{className:"truncate",children:f.name}),e.jsxs("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:[f.closed?"closed":"open",f.unresolved>0?` · ${f.unresolved} to go`:""]})]},f.id))]}),e.jsx(fs,{}),e.jsx(H,{onClick:()=>{j(`Round ${l}`),u(!0)},children:"Start a new round…"})]})]}),i&&e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:[i.closed?"closed":"open",i.unresolved>0?` · ${i.unresolved} to go`:i.closed?"":" · all clear"]}),e.jsx(cs,{open:y,onOpenChange:u,children:e.jsx(us,{children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),!(!h.trim()||x)&&(o(h.trim()),u(!1))},children:[e.jsxs(ms,{children:[e.jsx(hs,{children:"Start a new round"}),e.jsx(xs,{children:"A round is one pass of feedback, and it runs beside the others: starting one closes none of them. Reviewers pick a round in the widget and their comments go to it. Close or archive rounds in Settings."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(Ue,{htmlFor:"round-name",children:"Name"}),e.jsx(Ee,{id:"round-name",value:h,onChange:f=>j(f.target.value),autoFocus:!0})]}),e.jsxs(ps,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>u(!1),children:"Cancel"}),e.jsx(S,{type:"submit",disabled:!h.trim()||x,children:x?"Starting…":"Start the round"})]})]})})})]})}function Ns({rounds:s,onMove:n,busy:r}){return s.length===0?null:e.jsxs(se,{children:[e.jsx(te,{render:e.jsx(S,{variant:"outline",size:"sm",disabled:r}),children:"Move to round…"}),e.jsx(ne,{align:"start",className:"w-[240px]",children:e.jsxs(ue,{children:[e.jsx(we,{children:"Move to round"}),s.map(o=>e.jsxs(H,{onClick:()=>n(o.number),children:[e.jsx("span",{className:"truncate",children:o.name}),e.jsx("span",{className:"ml-auto text-[11.5px] text-muted-foreground",children:o.closed?"closed":"open"})]},o.id))]})})]})}const tn={open:"Open",progress:"In progress",review:"In review",resolved:"Resolved"};function nn(s,n,r={}){const o=r.fence??((v,D)=>D),x=r.statusLabel??(v=>tn[v]??v),i=s.anchor??{},l=s.context??{},y=i.page,u=y?.route??s.route??"/",h=y?.origin??n.origin??"",j=y?.pathname??u,f=h?`${h}${j}`:j,d=typeof i.label=="string"?o("label",i.label):"",N=i.element??i,a=[];a.push(`# ${s.key}${d?` — ${d}`:""}`),a.push(""),a.push(`${n.name} · ${x(s.status)} · left by ${s.createdBy?.name?o("name",s.createdBy.name):"someone"} on ${s.createdAt.slice(0,10)}`+(s.assignee?` · assigned to ${o("name",s.assignee.name)}`:"")),a.push(""),a.push("## Where to look"),a.push(""),a.push(`- Page: ${f}`),h&&a.push(`- Open on the page: ${h}${j}?${os("t")}=${encodeURIComponent(s.key)}`),d&&a.push(`- Element: ${d}`);const w=typeof i.css=="string"?i.css:typeof N.selector=="string"?N.selector:"";if(w&&a.push(`- Selector: \`${o("selector",w)}\``),typeof i.domid=="string"&&a.push(`- DOM id: \`#${o("selector",i.domid)}\``),typeof N.role=="string"){const v=typeof N.accessibleName=="string"?` “${o("label",N.accessibleName)}”`:"";a.push(`- Role: ${o("label",N.role)}${v}`)}typeof N.testId=="string"&&a.push(`- Test id: ${o("label",N.testId)}`);const E=i.text;E?.exact&&a.push(`- Text: “${o("label",E.exact)}”`),a.push(`- Anchor: ${s.anchorState??"unknown"}`),a.push(""),a.push("## What's wrong"),a.push("");const k=(s.comments??[]).filter(v=>v.body!==null);k.length===0&&a.push("> (no comment — a pin with no words)");for(const v of k){const D=v.author?.name?o("name",v.author.name):"Anonymous";a.push(`> **${D}${v.author?.kind==="agent"?" (agent)":""}** — ${v.createdAt.slice(0,16).replace("T"," ")}`);for(const G of o("body",String(v.body)).split(`
52
- `))a.push(`> ${G}`);a.push(">")}a[a.length-1]===">"&&a.pop(),a.push(""),a.push("## Environment"),a.push("");const g=l.derived,z=l.viewport;(g?.browser||g?.os)&&a.push(`- Browser: ${[g.browser,g.os,g.device].filter(Boolean).join(" · ")}`),z?.w&&a.push(`- Viewport: ${z.w} × ${z.h}${z.dpr?` @${Math.round(z.dpr*10)/10}x`:""}`),l.prefersColorScheme&&a.push(`- Colour scheme: ${l.prefersColorScheme}`),l.language&&a.push(`- Language: ${l.language}`),l.ua&&a.push(`- User agent: ${o("label",String(l.ua))}`);const T=l.build;T&&Object.keys(T).length&&a.push(`- Build: ${Object.entries(T).map(([v,D])=>`${v}=${o("label",String(D))}`).join(", ")}`),a.push("");const V=l.breadcrumbs;if(V?.length){a.push(`## Breadcrumbs (${V.length}, oldest first)`),a.push("");for(const v of V)a.push(`- \`${String(v.t).slice(11,19)}\` ${v.type}${v.level?`/${v.level}`:""}: ${o("breadcrumb",String(v.message))}`);a.push("")}const $=s.attachments?.find(v=>v.kind==="screenshot")??s.attachments?.[0];if($){a.push("## Screenshot"),a.push(""),a.push("Examine this screenshot for visual context — it is the viewport at the moment of the click."),a.push("");const v=$.url.startsWith("http")?$.url:`${n.dashboardOrigin??""}${$.url}`;a.push(`![${s.key}${$.width?` at ${$.width}×${$.height}`:""}](${v})`),a.push("")}return a.join(`
53
- `).trimEnd()+`
54
- `}function an(s,n){return nn(s,n,{statusLabel:r=>kt(r)?fe[r]:r})}function rn({thread:s,site:n,onStatus:r,onReply:o,replying:x,onClose:i,pool:l,onAssign:y,onAddPerson:u,trackers:h,onCreateIssue:j,creatingIssue:f,onEditComment:d,onDeleteComment:N,onDeleteThread:a,move:w,moderator:E=!0}){const k=s.anchor??{},g=s.context??{},z=typeof k.label=="string"?k.label:"",T=k.page,V=T?.route??s.route??"/",$=T?.origin??n.origin,v=$?`${$}${T?.pathname??V}?${os("t")}=${encodeURIComponent(s.key)}`:"",D=s.attachments?.find(c=>c.kind==="screenshot")??s.attachments?.[0],[G,q]=p.useState(""),[U,C]=p.useState(""),[_,L]=p.useState(!1),[ge,ae]=p.useState(!1),B=l.find(c=>c.isMe)?.id,be=()=>{navigator.clipboard?.writeText(an(s,{name:n.name,...$?{origin:$}:{},dashboardOrigin:location.origin})),is.success("Copied as a brief")};return e.jsxs("article",{className:"flex min-h-0 flex-1 flex-col","aria-label":`${s.key} — ${z||"a comment"}`,children:[e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border/60 px-4 py-2.5",children:[e.jsx("span",{className:"font-mono text-[12px] text-muted-foreground",children:s.key}),e.jsx(ln,{status:s.status,onStatus:r}),e.jsx(hn,{assignee:s.assignee??null,pool:l,onAssign:y,onAddPerson:u}),(h??[]).map(c=>{const O=s.refs?.find(I=>I.provider===c&&I.kind===Vs[c]&&I.status!=="detached");if(O){const I=c==="github"?`Issue #${O.externalId}`:c==="jira"?O.externalId:c==="slack"?"Slack message":/\/issue\/([A-Z][A-Z0-9]*-\d+)/.exec(O.url)?.[1]??`${Ze[c]} issue`;return e.jsxs(S,{variant:"ghost",size:"sm",render:e.jsx("a",{href:O.url,target:"_blank",rel:"noreferrer"}),children:[e.jsx(as,{}),I]},c)}return j?e.jsx(S,{variant:"ghost",size:"sm",disabled:!!f,onClick:()=>j(c),children:f===c?c==="slack"?"Posting…":"Creating…":c==="slack"?"Post to Slack":`Create ${Ze[c]} issue`},c):null}),e.jsx("div",{className:"flex-1"}),w&&e.jsx(Ns,{rounds:w.rounds,onMove:w.onMove,busy:w.busy}),e.jsxs(S,{variant:"ghost",size:"sm",onClick:be,children:[e.jsx(wt,{}),"Copy as brief"]}),a&&e.jsx(S,{variant:"ghost",size:"icon-sm","aria-label":`Delete ${s.key}`,title:"Delete this thread",onClick:()=>L(!0),children:e.jsx(js,{})}),e.jsx(S,{variant:"ghost",size:"icon-sm","aria-label":"Close",onClick:i,children:e.jsx(gt,{})})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto px-4 py-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"m-0 text-[16px] font-semibold leading-snug tracking-tight",children:z||"A comment on this page"}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[12.5px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:V}),$&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsxs("a",{href:`${$}${T?.pathname??V}`,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-brand hover:underline",children:[$.replace(/^https?:\/\//,""),e.jsx(as,{className:"size-3"})]})]}),v&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("a",{href:v,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:"Open on the page"})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[!s.comments[0]?.body&&e.jsx("p",{className:"m-0 text-muted-foreground",children:"A pin with no words — the element says what it is about."}),s.comments.filter(c=>c.body!==null).map(c=>e.jsx(on,{comment:c,reply:c!==s.comments[0],mine:Ye(c,B),...d?{onEdit:O=>d(c.id,O)}:{},...N&&(E||Ye(c,B))?{onDelete:()=>N(c.id)}:{}},c.id)),e.jsxs("form",{className:"flex gap-2.5",onSubmit:async c=>{c.preventDefault();const O=G.trim();if(!(!O||x)){C("");try{await o(O),q("")}catch(I){C(I instanceof Error?I.message:"Could not send that reply.")}}},children:[e.jsx(xe,{className:"size-6 shrink-0",children:e.jsx(pe,{className:"bg-primary text-[10px] font-semibold text-primary-foreground",children:"you"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2 rounded-md border border-input bg-card p-2",children:[e.jsx(ks,{"aria-label":"Reply",placeholder:`Reply to ${s.createdBy.name||"the reviewer"}…`,value:G,onChange:c=>q(c.target.value),rows:2,className:"min-h-0 resize-none border-0 bg-transparent p-1 shadow-none focus-visible:ring-0"}),U&&e.jsx("p",{role:"alert",className:"m-0 text-[12px] text-destructive",children:U}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.status==="resolved"?e.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("open"),children:"Reopen"}):e.jsxs(e.Fragment,{children:[s.status!=="review"&&e.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("review"),children:"Mark in review"}),e.jsx(S,{type:"button",variant:"ghost",size:"sm",onClick:()=>r("resolved"),children:"Mark resolved"})]}),e.jsx(S,{type:"submit",size:"sm",disabled:!G.trim()||x,children:x?"Sending…":"Reply"})]})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(He,{children:"Screenshot"}),D?e.jsxs(e.Fragment,{children:[e.jsx("a",{href:D.url,target:"_blank",rel:"noreferrer",className:"block overflow-hidden rounded-lg border border-border bg-background",children:e.jsx("img",{src:D.url,alt:`The page when ${s.key} was left`,width:D.width,height:D.height,loading:"lazy",className:"block h-auto w-full"})}),e.jsxs("p",{className:"m-0 text-[12px] text-muted-foreground",children:[D.width??"?"," × ",D.height??"?",g.prefersColorScheme?` · ${g.prefersColorScheme}`:""," · taken at the click, ",Pe(s.createdAt)," ·"," ",e.jsx("a",{href:D.url,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:"open full size"})]})]}):e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-dashed border-border px-3 py-3 text-[12.5px] text-muted-foreground",children:[e.jsx(Ct,{className:"size-4 shrink-0"}),e.jsx("span",{children:"No screenshot for this one — either no bucket was connected when it was left, or the reviewer turned the picture off. The element and the environment below are unaffected."})]}),e.jsx(cn,{ctx:g})]}),e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(He,{children:"Element"}),e.jsxs("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:[z&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Label"}),e.jsx("dd",{className:"m-0",children:z})]}),typeof k.css=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Selector"}),e.jsx("dd",{className:"m-0 break-all font-mono text-[12px] text-ink-soft",children:k.css})]}),typeof k.domid=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"DOM id"}),e.jsxs("dd",{className:"m-0 font-mono text-[12px] text-ink-soft",children:["#",k.domid]})]}),typeof k.role=="string"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Role"}),e.jsxs("dd",{className:"m-0",children:[k.role,typeof k.accessibleName=="string"?` “${k.accessibleName}”`:""]})]}),k.text?.exact&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:"Text"}),e.jsxs("dd",{className:"m-0",children:["“",String(k.text.exact),"”"]})]}),e.jsx("dt",{className:"text-muted-foreground",children:"Anchor"}),e.jsx("dd",{className:"m-0",children:e.jsx(dn,{state:s.anchorState})})]})]}),e.jsx(un,{ctx:g}),e.jsx(mn,{ctx:g})]}),a&&e.jsx(gs,{open:_,onOpenChange:L,title:`Delete ${s.key}?`,description:"Removes this comment thread and its screenshot for everyone. Linked issues in your tracker are not deleted.",confirmLabel:"Delete thread",busy:ge,onConfirm:async()=>{ae(!0);try{await a(),L(!1)}catch{}finally{ae(!1)}}})]})}function on({comment:s,reply:n,mine:r,onEdit:o,onDelete:x}){const[i,l]=p.useState(!1),[y,u]=p.useState(""),[h,j]=p.useState(!1),[f,d]=p.useState(!1),[N,a]=p.useState(!1),w=r&&!!o,E=!!x,k=async()=>{const g=y.trim();if(!(!g||h||!o)){if(g===s.body){l(!1);return}j(!0);try{await o(g),l(!1)}catch{}finally{j(!1)}}};return e.jsxs("div",{className:"flex gap-2.5",children:[e.jsx(xe,{className:"size-6 shrink-0",children:e.jsx(pe,{className:M("text-[10px] font-semibold",s.author.kind==="agent"?"bg-muted text-ink-soft":"bg-brand-soft text-brand"),children:Ce(s.author.name,"?")})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2 text-[12px] text-muted-foreground",children:[e.jsx("b",{className:"text-[13px] font-semibold text-foreground",children:s.author.name||"Anonymous"}),s.author.kind==="agent"&&e.jsx("span",{className:"rounded-sm bg-muted px-1 text-[10.5px] font-medium uppercase tracking-wide",children:"agent"}),e.jsx("span",{children:Pe(s.createdAt)}),(w||E)&&!i&&e.jsxs(se,{children:[e.jsx(te,{render:e.jsx(S,{variant:"ghost",size:"icon-xs",className:"ml-auto self-center text-muted-foreground","aria-label":`Actions for ${s.author.name||"Anonymous"}’s comment`}),children:e.jsx(Tt,{})}),e.jsxs(ne,{align:"end",className:"min-w-36",children:[w&&e.jsxs(H,{onClick:()=>{u(s.body??""),l(!0)},children:[e.jsx(Ft,{}),"Edit"]}),E&&e.jsxs(H,{variant:"destructive",onClick:()=>d(!0),children:[e.jsx(js,{}),"Delete"]})]})]})]}),i?e.jsxs("form",{className:"mt-1 flex flex-col gap-2",onSubmit:g=>{g.preventDefault(),k()},children:[e.jsx(ks,{"aria-label":"Edit your comment",value:y,autoFocus:!0,rows:3,disabled:h,onChange:g=>u(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),k()),g.key==="Escape"&&!h&&(g.preventDefault(),l(!1))}}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(S,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>l(!1),children:"Cancel"}),e.jsx(S,{type:"submit",size:"sm",loading:h,disabled:!y.trim(),children:h?"Saving…":"Save"})]})]}):e.jsx("p",{className:"m-0 whitespace-pre-wrap text-[13.5px] leading-normal",children:s.body})]}),E&&e.jsx(gs,{open:f,onOpenChange:d,title:"Delete this comment?",description:n?"The reply is removed for everyone.":"The comment is removed for everyone. The pin and its replies stay.",confirmLabel:"Delete comment",busy:N,onConfirm:async()=>{a(!0);try{await x(),d(!1)}catch{}finally{a(!1)}}})]})}function ln({status:s,onStatus:n}){return e.jsxs(se,{children:[e.jsx(te,{render:e.jsx("button",{type:"button",className:"inline-flex items-center rounded-full","aria-label":"Status"}),children:e.jsx(bs,{status:s})}),e.jsx(ne,{align:"start",className:"w-[180px]",children:e.jsx(Ke,{value:s,onValueChange:r=>n(r),children:ze.map(r=>e.jsx(ce,{value:r,children:fe[r]},r))})})]})}function dn({state:s}){const n=s==="anchored"?"bg-ok-soft text-ok":s==="approximate"?"bg-muted text-ink-soft":"bg-warn-soft text-destructive",r=s==="anchored"?"Anchored":s==="approximate"?"Approximate":s==="orphaned"?"Orphaned":s;return e.jsx("span",{className:M("rounded-full px-2 py-0.5 text-[11.5px] font-medium",n),children:r})}function cn({ctx:s}){const n=s.capture;if(!n)return null;const r=[];return n.screenshot&&n.screenshot!=="ok"&&r.push(`Screenshot ${n.screenshot}${n.reasons?.length?` — ${n.reasons.join("; ")}`:""}`),n.breadcrumbs&&n.breadcrumbs!=="ok"&&r.push(`Breadcrumbs ${n.breadcrumbs}`),n.blindSpots?.length&&r.push(`${n.blindSpots.length} blind spot${n.blindSpots.length===1?"":"s"}: ${n.blindSpots.join("; ")}`),n.droppedCategories?.length&&r.push(`Dropped: ${n.droppedCategories.join(", ")}`),r.length?e.jsx("ul",{className:"m-0 list-none p-0 text-[12px] text-caution",children:r.map(o=>e.jsx("li",{children:o},o))}):null}function un({ctx:s}){const n=s.derived,r=s.viewport,o=s.build,x=[];return n?.browser||n?.os?x.push(["Browser",[n.browser,n.os,n.device].filter(Boolean).join(" · ")]):s.ua&&x.push(["User agent",String(s.ua)]),r?.w&&x.push(["Viewport",`${r.w} × ${r.h}${r.dpr?` @${Math.round(r.dpr*10)/10}x`:""}`]),s.language&&x.push(["Language",String(s.language)]),o&&Object.keys(o).length&&x.push(["Build",Object.entries(o).map(([i,l])=>`${i} ${String(l)}`).join(" · ")]),x.length?e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(He,{children:"Environment"}),e.jsx("button",{type:"button",className:"text-[11.5px] text-brand hover:underline",onClick:()=>{navigator.clipboard?.writeText(JSON.stringify(s,null,2)),is.success("Copied the environment")},children:"copy as JSON"})]}),e.jsx("dl",{className:"m-0 grid grid-cols-[110px_1fr] gap-x-3 gap-y-1.5 text-[13px]",children:x.map(([i,l])=>e.jsxs("span",{className:"contents",children:[e.jsx("dt",{className:"text-muted-foreground",children:i}),e.jsx("dd",{className:M("m-0",i==="Build"&&"font-mono text-[12px] text-ink-soft"),children:l})]},i))})]}):null}function mn({ctx:s}){const n=s.breadcrumbs,[r,o]=p.useState(!1);if(!n?.length)return null;const x=n.filter(i=>i.level==="error"||i.type==="error").length;return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-left text-[13px] text-ink-soft","aria-expanded":r,onClick:()=>o(!r),children:[e.jsx(St,{className:M("size-3.5 text-muted-foreground transition-transform",r&&"rotate-90")}),n.length," breadcrumb",n.length===1?"":"s",x>0?` · ${x} error${x===1?"":"s"} before the click`:"",e.jsx("span",{className:"ml-auto text-[12px] text-muted-foreground",children:r?"hide":"show"})]}),r&&e.jsx("ol",{className:"m-0 flex list-none flex-col gap-1 p-0 font-mono text-[11.5px]",children:n.map((i,l)=>e.jsxs("li",{className:M("flex gap-2",(i.level==="error"||i.type==="error")&&"text-destructive"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:i.t.slice(11,19)}),e.jsxs("span",{className:"shrink-0 w-14 text-muted-foreground",children:[i.type,i.level?`/${i.level}`:""]}),e.jsx("span",{className:"min-w-0 break-words",children:i.message})]},l))})]})}function hn({assignee:s,pool:n,onAssign:r,onAddPerson:o}){const[x,i]=p.useState(!1),l=n.find(d=>d.isMe),y=n.filter(d=>d.isTeam),u=n.filter(d=>!d.isTeam&&!d.isAgent),h=n.filter(d=>!d.isTeam&&d.isAgent),j=d=>r({id:d.id,name:d.name,kind:d.kind,isTeam:d.isTeam}),f=d=>e.jsxs(H,{onClick:()=>j(d),children:[e.jsx(xe,{className:"size-4",children:e.jsx(pe,{className:M("text-[8px] font-semibold",d.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Ce(d.name,d.email)})}),e.jsx("span",{className:"truncate",children:d.isMe?`${d.name} (you)`:d.name}),s?.id===d.id&&e.jsx(ds,{className:"ml-auto size-3.5"})]},d.id);return e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(te,{render:e.jsx(S,{variant:"ghost",size:"sm","aria-label":s?`Assignee: ${s.name}`:"Assignee"}),children:s?e.jsxs(e.Fragment,{children:[e.jsx(xe,{className:"size-4",children:e.jsx(pe,{className:M("text-[8px] font-semibold",s.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Ce(s.name)})}),e.jsx("span",{className:"max-w-[150px] truncate",children:s.name})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ht,{}),"Assign"]})}),e.jsxs(ne,{align:"start",className:"min-w-56",children:[l&&s?.id!==l.id||s?e.jsxs(ue,{children:[l&&s?.id!==l.id&&e.jsx(H,{onClick:()=>j(l),children:"Assign to me"}),s&&e.jsx(H,{onClick:()=>r(null),children:"Unassign"})]}):null,y.length>0&&e.jsxs(ue,{children:[e.jsx(we,{children:"The studio"}),y.map(f)]}),u.length>0&&e.jsxs(ue,{children:[e.jsx(we,{children:"People who commented"}),u.map(f)]}),h.length>0&&e.jsxs(ue,{children:[e.jsx(we,{children:"Agents"}),h.map(f)]}),e.jsx(fs,{}),e.jsx(ue,{children:e.jsxs(H,{onClick:()=>i(!0),children:[e.jsx(Ut,{}),"Add a person…"]})})]})]}),e.jsx(xn,{open:x,onOpenChange:i,onAdd:async d=>{const N=await o(d);j(N)}})]})}function xn({open:s,onOpenChange:n,onAdd:r}){const[o,x]=p.useState(""),[i,l]=p.useState(""),[y,u]=p.useState(!1),[h,j]=p.useState(""),f=async d=>{if(d.preventDefault(),!(!o.trim()||y)){u(!0),j("");try{await r({name:o.trim(),...i.trim()?{email:i.trim()}:{}}),x(""),l(""),n(!1)}catch(N){j(N instanceof qs?N.message:"Could not add the person.")}finally{u(!1)}}};return e.jsx(cs,{open:s,onOpenChange:n,children:e.jsx(us,{children:e.jsxs("form",{onSubmit:d=>void f(d),className:"flex flex-col gap-4",noValidate:!0,children:[e.jsxs(ms,{children:[e.jsx(hs,{children:"Add a person"}),e.jsx(xs,{children:"Somebody to assign comments to who has not commented yet — your client, before they have said anything. If they later open a review link with this email, their comments join up."})]}),h&&e.jsx("p",{role:"alert",className:"m-0 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:h}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(Ue,{htmlFor:"person-name",children:"Name"}),e.jsx(Ee,{id:"person-name",placeholder:"Sofia",value:o,onChange:d=>x(d.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(Ue,{htmlFor:"person-email",children:"Email (optional)"}),e.jsx(Ee,{id:"person-email",type:"email",placeholder:"sofia@acme.com",value:i,onChange:d=>l(d.target.value)})]}),e.jsxs(ps,{children:[e.jsx(S,{type:"button",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),e.jsx(S,{type:"submit",loading:y,disabled:!o.trim(),children:y?"Adding…":"Add and assign"})]})]})})})}tt({thread:ke().optional(),status:ke().optional(),page:ke().optional(),q:ke().optional(),sort:ts(["newest","oldest"]).optional(),round:nt().int().positive().optional(),assignee:ke().optional(),view:ts(["board"]).optional()});const ws={open:"bg-status-open",progress:"bg-status-progress",review:"bg-status-review",resolved:"bg-status-resolved"};function On(){const{site:s}=es.useParams(),n=es.useSearch(),r=Us(),o=Nt(),x=o.projects.find(t=>t.uid===s),i=Ne(Re.origins(s)),l=Ne(Re.rounds(s)),y=Ne(Re.assignees(s)),u=Ne(Re.siteIntegrations(s)),h=y.data?.data??[],j=h.find(t=>t.isMe)?.id,f=n.round??(l.data?Ks(l.data.data):void 0),d=(l.data?.data??[]).filter(t=>!t.archived||t.number===f),N=p.useMemo(()=>({...f!==void 0?{round:f}:{},...n.page?{route:n.page}:{},...n.q?{q:n.q}:{}}),[f,n.page,n.q]),a=Ne({...ss(s,N),enabled:l.isSuccess}),w=ss(s,N).queryKey,E=Hs(s,w),k=Ws(w),g=Gs(s,w),z=Js(s),T=Qs(s,w),V=Xs(s),$=Zs(s),v=Ys(w),D=et(w),G=st(s,w),[q,U]=p.useState(new Set),C=t=>void r({to:"/s/$site/comments",params:{site:s},search:m=>({...m,...t}),replace:!0}),_=a.data?.data??[],L=p.useMemo(()=>new Set((n.status??"").split(",").filter(Boolean)),[n.status]),ge=p.useMemo(()=>{const t=new Map;for(const m of _)t.set(m.status,(t.get(m.status)??0)+1);return t},[_]),ae=p.useMemo(()=>[...new Set(_.map(t=>We(t)))].sort(),[_]),B=p.useMemo(()=>{let t=L.size?_.filter(m=>L.has(m.status)):_;return n.assignee==="unassigned"?t=t.filter(m=>!m.assignee):n.assignee==="me"?t=t.filter(m=>!!j&&m.assignee?.id===j):n.assignee&&(t=t.filter(m=>m.assignee?.id===n.assignee)),n.sort==="oldest"&&(t=[...t].reverse()),t},[_,L,n.sort,n.assignee,j]),be=p.useMemo(()=>{const t=new Map;for(const m of B){const A=We(m);t.has(A)||t.set(A,[]),t.get(A).push(m)}return[...t.entries()]},[B]),c=n.thread?_.find(t=>t.key===n.thread)??null:null,O=L.size>0||!!n.page||!!n.q||!!n.assignee,I=d.filter(t=>t.number!==f&&t.unresolved>0),Se=De(o.user.role,"review"),R=De(o.user.role,"moderate"),J=t=>!!j&&t.comments.every(m=>m.body===null||m.author.id===j),Q=Se?d.filter(t=>!t.archived&&t.number!==f):[],F=(t,m)=>$.mutate({ids:t,round:m},{onSuccess:()=>{U(new Set),n.thread&&t.includes(c?.id??"")&&C({thread:void 0})}}),ee=t=>{const m=new Set(L);m.has(t)?m.delete(t):m.add(t),C({status:[...m].join(",")||void 0})},P=async t=>{const m=[...q];U(new Set);for(const A of m)await E.mutateAsync({id:A,status:t}).catch(()=>{})};p.useEffect(()=>{const t=m=>{if(m.metaKey||m.ctrlKey||m.altKey)return;const A=m.target;if(A&&(A.closest("input,textarea,select,[contenteditable]")||A.isContentEditable))return;const Z=m.key.toLowerCase();if(Z!=="j"&&Z!=="k"&&Z!=="e"||B.length===0)return;if(m.preventDefault(),Z==="e"){if(!c)return;E.mutate({id:c.id,status:c.status==="resolved"?"open":"resolved"});return}const re=c?B.findIndex(he=>he.id===c.id):-1,oe=Z==="j"?Math.min(re+1,B.length-1):Math.max(re-1,0),me=B[re===-1?0:oe];me&&C({thread:me.key})};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)});const X=n.view==="board",$e=p.useMemo(()=>ze.map(t=>({status:t,items:B.filter(m=>m.status===t)})),[B]);return e.jsxs("div",{className:"flex h-[calc(100dvh-3rem)] min-h-0 flex-col",children:[e.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2 border-b border-border/60 px-4 py-2",children:q.size>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-[13px] font-medium",children:[q.size," selected"]}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:"Move to"}),ze.map(t=>e.jsx(S,{variant:"outline",size:"sm",onClick:()=>void P(t),children:fe[t]},t)),e.jsx(Ns,{rounds:Q,busy:$.isPending,onMove:t=>F([...q],t)}),e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>U(new Set),children:"Clear"})]}):e.jsxs(e.Fragment,{children:[d.length>0&&f!==void 0&&e.jsx(sn,{rounds:d,active:f,onPick:t=>C({round:t,thread:void 0}),onStart:t=>V.mutate(t,{onSuccess:m=>C({round:m.number,thread:void 0,status:void 0})}),starting:V.isPending}),e.jsx("span",{className:"mx-1 h-[18px] w-px bg-border"}),e.jsxs(qe,{on:L.size===0,onClick:()=>C({status:void 0}),children:["All ",e.jsx("span",{className:"text-muted-foreground",children:_.length})]}),ze.map(t=>e.jsxs(qe,{on:L.has(t),onClick:()=>ee(t),children:[e.jsx("span",{className:M("size-[7px] rounded-full",ws[t])}),fe[t]," ",e.jsx("span",{className:"text-muted-foreground",children:ge.get(t)??0})]},t)),e.jsx("div",{className:"flex-1"}),e.jsxs(qe,{on:X,onClick:()=>C({view:X?void 0:"board"}),children:[X?e.jsx(_t,{className:"size-3.5"}):e.jsx(Rt,{className:"size-3.5"}),X?"List":"Board"]}),e.jsx(fn,{value:n.q??"",onChange:t=>C({q:t||void 0})}),ae.length>1&&e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:Ie(!!n.page)}),children:[n.page??"All pages",e.jsx(Te,{className:"size-3 text-muted-foreground"})]}),e.jsxs(ne,{align:"end",children:[e.jsx(H,{onClick:()=>C({page:void 0}),children:"All pages"}),ae.map(t=>e.jsx(H,{onClick:()=>C({page:t}),children:e.jsx("span",{className:"font-mono text-[12px]",children:t})},t))]})]}),e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:Ie(!!n.assignee),"aria-label":"Filter by assignee"}),children:[pn(n.assignee,h),e.jsx(Te,{className:"size-3 text-muted-foreground"})]}),e.jsx(ne,{align:"end",children:e.jsxs(Ke,{value:n.assignee??"any",onValueChange:t=>C({assignee:t==="any"?void 0:t}),children:[e.jsx(ce,{value:"any",children:"Anyone"}),e.jsx(ce,{value:"unassigned",children:"Unassigned"}),j&&e.jsx(ce,{value:"me",children:"Me"}),h.filter(t=>!t.isMe).map(t=>e.jsx(ce,{value:t.id,children:t.name},t.id))]})})]}),e.jsxs(se,{children:[e.jsxs(te,{render:e.jsx("button",{type:"button",className:Ie(!1)}),children:[n.sort==="oldest"?"Oldest":"Newest",e.jsx(Te,{className:"size-3 text-muted-foreground"})]}),e.jsx(ne,{align:"end",children:e.jsxs(Ke,{value:n.sort??"newest",onValueChange:t=>C({sort:t==="oldest"?"oldest":void 0}),children:[e.jsx(ce,{value:"newest",children:"Newest first"}),e.jsx(ce,{value:"oldest",children:"Oldest first"})]})})]})]})}),I.map(t=>e.jsxs("button",{type:"button",className:"shrink-0 border-b border-border/60 bg-brand-soft px-4 py-1.5 text-left text-[12.5px] text-foreground",onClick:()=>C({round:t.number,thread:void 0}),children:[e.jsxs("b",{className:"font-semibold",children:[t.unresolved," unresolved"]})," in ",t.name," — still open, not carried over."," ",e.jsx("span",{className:"text-brand",children:"Go there"})]},t.id)),e.jsxs("div",{className:M("grid min-h-0 flex-1",c?"grid-cols-1 lg:grid-cols-[minmax(0,1fr)_520px]":"grid-cols-1"),children:[e.jsxs("div",{className:M("min-h-0 overflow-auto lg:border-r lg:border-border",c&&"hidden lg:block"),children:[a.isPending&&e.jsx(bn,{}),a.isError&&e.jsx(Ve,{title:"Could not load the comments",children:a.error.message}),a.isSuccess&&_.length===0&&!O&&e.jsx("div",{className:"mx-auto max-w-[560px] py-8",children:e.jsxs(Ve,{icon:e.jsx(Et,{className:"size-5"}),title:"No comments yet",children:[e.jsxs("p",{className:"m-0",children:["When someone leaves a comment on ",x.name," it appears here, grouped by page."]}),e.jsx("div",{className:"mt-4 text-left",children:e.jsx($t,{uid:s})})]})}),a.isSuccess&&_.length>0&&B.length===0&&e.jsx(Ve,{title:"Nothing matches",action:e.jsx(S,{variant:"outline",size:"sm",onClick:()=>C({status:void 0,page:void 0,q:void 0,assignee:void 0}),children:"Show all"}),children:"No comment matches that filter."}),X&&a.isSuccess&&B.length>0&&e.jsx(jn,{columns:$e,uid:s,selectedId:c?.id??null,onMove:(t,m)=>E.mutate({id:t,status:m})}),!X&&be.map(([t,m])=>e.jsxs("div",{children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center gap-2 border-b border-border/60 bg-background px-4 py-2 font-mono text-[12px] text-ink-soft",children:[t," ",e.jsxs("span",{className:"font-sans text-muted-foreground",children:["· ",m.length]})]}),m.map(A=>e.jsx(gn,{t:A,uid:s,on:c?.id===A.id,picked:q.has(A.id),picking:q.size>0,onPick:Z=>U(re=>{const oe=new Set(re);return Z?oe.add(A.id):oe.delete(A.id),oe})},A.id))]},t))]}),c&&e.jsxs("div",{className:"flex min-h-0 flex-col overflow-hidden bg-card",children:[e.jsx("div",{className:"lg:hidden",children:e.jsxs(S,{variant:"ghost",size:"sm",className:"m-2",onClick:()=>C({thread:void 0}),children:[e.jsx(Mt,{}),"Back to the list"]})}),e.jsx(rn,{thread:c,site:{name:x.name,...i.data?.origins[0]?{origin:i.data.origins[0]}:{}},onStatus:t=>E.mutate({id:c.id,status:t}),onReply:t=>k.mutateAsync({id:c.id,body:t}),replying:k.isPending,pool:h,onAssign:t=>g.mutate({id:c.id,assignee:t}),onAddPerson:t=>z.mutateAsync(t),trackers:(u.data?.data??[]).map(t=>t.provider),...De(o.user.role,"settings")?{onCreateIssue:t=>T.mutate({id:c.id,provider:t})}:{},creatingIssue:T.isPending?T.variables?.provider:void 0,onEditComment:(t,m)=>v.mutateAsync({threadId:c.id,commentId:t,body:m}),onDeleteComment:t=>D.mutateAsync({threadId:c.id,commentId:t}),moderator:R,...R||De(o.user.role,"review")&&J(c)?{onDeleteThread:async()=>{await G.mutateAsync(c.id),C({thread:void 0})}}:{},...Q.length?{move:{rounds:Q,busy:$.isPending,onMove:t=>F([c.id],t)}}:{},onClose:()=>C({thread:void 0})})]})]})]})}function pn(s,n){return s?s==="unassigned"?"Unassigned":s==="me"?"Me":n.find(r=>r.id===s)?.name??"Assignee":"Assignee"}function We(s){return s.anchor?.page?.route??s.route??"/"}function Ie(s){return M("inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-md border border-border bg-card px-2.5 text-[12.5px] font-medium text-ink-soft",s&&"border-line-strong bg-muted text-foreground")}function qe({on:s,onClick:n,children:r}){return e.jsx("button",{type:"button",className:Ie(s),"aria-pressed":s,onClick:n,children:r})}function fn({value:s,onChange:n}){const[r,o]=p.useState(s);return e.jsxs("form",{className:"relative",onSubmit:x=>{x.preventDefault(),n(r.trim())},children:[e.jsx(yt,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),e.jsx(Ee,{type:"search","aria-label":"Search comments",placeholder:"Search",value:r,onChange:x=>o(x.target.value),onBlur:()=>r.trim()!==s&&n(r.trim()),className:"h-7 w-[170px] pl-7 text-[12.5px]"})]})}function gn({t:s,uid:n,on:r,picked:o,picking:x,onPick:i}){const l=s.comments[0]?.body??(typeof s.anchor?.label=="string"?s.anchor.label:"(no comment)"),y=s.comments[0]?.body&&typeof s.anchor?.label=="string"?s.anchor.label:"";return e.jsxs("div",{className:M("group grid h-12 grid-cols-[22px_56px_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border/60 bg-card px-4 hover:bg-accent/60",r&&"bg-brand-soft hover:bg-brand-soft"),children:[e.jsx("span",{className:M("flex items-center",!x&&"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:e.jsx(en,{checked:o,onCheckedChange:u=>i(!!u),"aria-label":`Select ${s.key}`})}),e.jsxs(ls,{to:"/s/$site/comments",params:{site:n},search:u=>({...u,thread:s.key}),className:"contents text-foreground",children:[e.jsx("span",{className:"font-mono text-[11.5px] text-muted-foreground",children:s.key}),e.jsxs("span",{className:"truncate text-[13.5px]",children:[l,y&&e.jsx("small",{className:"ml-2 text-[12px] text-muted-foreground",children:y})]}),e.jsxs("span",{className:"flex items-center gap-2.5 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"hidden sm:inline",children:s.createdBy.name||"someone"}),s.assignee&&e.jsx(xe,{className:"size-5",title:`Assigned to ${s.assignee.name}`,children:e.jsx(pe,{className:M("text-[9px] font-semibold",s.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Ce(s.assignee.name)})}),e.jsx(bs,{status:s.status}),e.jsx("span",{className:"w-11 whitespace-nowrap text-right",children:Pe(s.updatedAt)})]})]})]})}function bn(){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"flex items-center border-b border-border/60 bg-background px-4 py-2",children:e.jsx(ye,{className:"h-3 w-16"})}),[70,55,80,62].map((s,n)=>e.jsxs("div",{className:"grid h-12 grid-cols-[22px_56px_minmax(0,1fr)_auto] items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx("span",{}),e.jsx(ye,{className:"h-3 w-10"}),e.jsx(ye,{className:"h-3",style:{width:`${s}%`}}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(ye,{className:"h-3 w-11"}),e.jsx(ye,{className:"h-[18px] w-16 rounded-full"})]})]},n))]})}function jn({columns:s,uid:n,selectedId:r,onMove:o}){const[x,i]=p.useState(null);return e.jsx("div",{className:"flex h-full min-h-0 gap-3 overflow-x-auto p-3",children:s.map(({status:l,items:y})=>e.jsxs("section",{"aria-label":fe[l],onDragOver:u=>{u.preventDefault(),i(l)},onDragLeave:()=>i(u=>u===l?null:u),onDrop:u=>{u.preventDefault(),i(null);const h=u.dataTransfer.getData("text/plain");h&&o(h,l)},className:M("flex w-[280px] shrink-0 flex-col rounded-lg border border-border bg-muted/40",x===l&&"border-brand bg-brand-soft"),children:[e.jsxs("h3",{className:"m-0 flex items-center gap-2 px-3 py-2 text-[12px] font-medium",children:[e.jsx("span",{className:M("size-[7px] rounded-full",ws[l])}),fe[l],e.jsx("span",{className:"text-muted-foreground",children:y.length})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-auto p-2 pt-0",children:[y.length===0&&e.jsx("p",{className:"m-0 px-1 py-3 text-[12px] text-muted-foreground",children:"Nothing here."}),y.map(u=>e.jsxs(ls,{to:"/s/$site/comments",params:{site:n},search:h=>({...h,thread:u.key}),draggable:!0,onDragStart:h=>{h.dataTransfer.setData("text/plain",u.id),h.dataTransfer.effectAllowed="move"},className:M("flex cursor-grab flex-col gap-1.5 rounded-md border border-border bg-card p-2.5 text-foreground no-underline active:cursor-grabbing",r===u.id&&"border-brand ring-1 ring-brand"),children:[e.jsx("span",{className:"line-clamp-3 text-[13px]",children:u.comments[0]?.body??(typeof u.anchor?.label=="string"?u.anchor.label:"(no comment)")}),e.jsxs("span",{className:"flex items-center gap-2 text-[11.5px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:u.key}),e.jsx("span",{className:"truncate",children:We(u)}),e.jsx("span",{className:"flex-1"}),u.assignee&&e.jsx(xe,{className:"size-4",title:`Assigned to ${u.assignee.name}`,children:e.jsx(pe,{className:M("text-[8px] font-semibold",u.assignee.isTeam?"bg-brand-soft text-brand":"bg-muted text-ink-soft"),children:Ce(u.assignee.name)})}),e.jsx("span",{children:Pe(u.updatedAt)})]})]},u.id))]})]},l))})}export{On as component,kt as isStatus};
@@ -1 +0,0 @@
1
- import{j as t,O as o}from"./index-B1JGVSdd.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
1
- import{u as r,Q as u}from"./useBaseQuery-DXKWEN1Y.js";function a(e,s){return r(e,u)}export{a as u};
@@ -1 +0,0 @@
1
- import{k as n}from"./index-B1JGVSdd.js";function u(e){return n(e.defaultTagName??"div",e,e)}export{u};