@tapflowio/relay 0.28.0 → 0.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/dist/api/builds.d.ts.map +1 -1
  2. package/dist/api/builds.js +3 -2
  3. package/dist/api/builds.js.map +1 -1
  4. package/dist/api/profile.d.ts.map +1 -1
  5. package/dist/api/profile.js +3 -1
  6. package/dist/api/profile.js.map +1 -1
  7. package/dist/api/settings.d.ts.map +1 -1
  8. package/dist/api/settings.js +4 -2
  9. package/dist/api/settings.js.map +1 -1
  10. package/package.json +3 -3
  11. package/public/assets/{AISessionWatch-Bxew762e.js → AISessionWatch-C2h4NZ_I.js} +7 -12
  12. package/public/assets/AISessionWatch-C2h4NZ_I.js.br +0 -0
  13. package/public/assets/AISessionWatch-C2h4NZ_I.js.gz +0 -0
  14. package/public/assets/{AppCenter-93hnrrdy.js → AppCenter-S1y-8_7l.js} +1 -1
  15. package/public/assets/AppCenter-S1y-8_7l.js.br +0 -0
  16. package/public/assets/AppCenter-S1y-8_7l.js.gz +0 -0
  17. package/public/assets/Default-C-l1O-g9.js +6 -0
  18. package/public/assets/Default-C-l1O-g9.js.br +0 -0
  19. package/public/assets/Default-C-l1O-g9.js.gz +0 -0
  20. package/public/assets/{Invite-DQBwLaOl.js → Invite-BCndVxaO.js} +1 -1
  21. package/public/assets/Invite-BCndVxaO.js.br +0 -0
  22. package/public/assets/Invite-BCndVxaO.js.gz +0 -0
  23. package/public/assets/{MacResources-D4LMGxgV.js → MacResources-41cFDgE1.js} +1 -1
  24. package/public/assets/MacResources-41cFDgE1.js.br +0 -0
  25. package/public/assets/MacResources-41cFDgE1.js.gz +0 -0
  26. package/public/assets/QASession-B67RsIPm.js +81 -0
  27. package/public/assets/QASession-B67RsIPm.js.br +0 -0
  28. package/public/assets/QASession-B67RsIPm.js.gz +0 -0
  29. package/public/assets/{ResetPassword-inTbbral.js → ResetPassword-8rj7ASt1.js} +1 -1
  30. package/public/assets/ResetPassword-8rj7ASt1.js.br +0 -0
  31. package/public/assets/ResetPassword-8rj7ASt1.js.gz +0 -0
  32. package/public/assets/{RunDetail-B3dw8_U0.js → RunDetail-BIgq9gJ0.js} +2 -2
  33. package/public/assets/RunDetail-BIgq9gJ0.js.br +0 -0
  34. package/public/assets/RunDetail-BIgq9gJ0.js.gz +0 -0
  35. package/public/assets/Runs-DpK5aoBr.js +6 -0
  36. package/public/assets/Runs-DpK5aoBr.js.br +0 -0
  37. package/public/assets/Runs-DpK5aoBr.js.gz +0 -0
  38. package/public/assets/{Setup-CPa_UWpa.js → Setup-DZrhA_7b.js} +1 -1
  39. package/public/assets/Setup-DZrhA_7b.js.br +0 -0
  40. package/public/assets/Setup-DZrhA_7b.js.gz +0 -0
  41. package/public/assets/{Team-DZie8W7R.js → Team-CJThCjd3.js} +2 -2
  42. package/public/assets/Team-CJThCjd3.js.br +0 -0
  43. package/public/assets/Team-CJThCjd3.js.gz +0 -0
  44. package/public/assets/{Tokens-u3-uRAwd.js → Tokens-DGURtHWi.js} +1 -1
  45. package/public/assets/Tokens-DGURtHWi.js.br +0 -0
  46. package/public/assets/Tokens-DGURtHWi.js.gz +0 -0
  47. package/public/assets/{aiSession-BsmDnyV1.js → aiSession-BW09Jhqz.js} +6 -11
  48. package/public/assets/aiSession-BW09Jhqz.js.br +0 -0
  49. package/public/assets/aiSession-BW09Jhqz.js.gz +0 -0
  50. package/public/assets/{alert-dialog-Bq_Ln5bp.js → alert-dialog-t5vlOabq.js} +1 -1
  51. package/public/assets/alert-dialog-t5vlOabq.js.br +0 -0
  52. package/public/assets/alert-dialog-t5vlOabq.js.gz +0 -0
  53. package/public/assets/{badge-D-bt97WR.js → badge-DrDCTAQQ.js} +1 -1
  54. package/public/assets/badge-DrDCTAQQ.js.br +0 -0
  55. package/public/assets/badge-DrDCTAQQ.js.gz +0 -0
  56. package/public/assets/{dialog-CtzPkg0O.js → dialog-BOFZkCES.js} +1 -1
  57. package/public/assets/dialog-BOFZkCES.js.br +0 -0
  58. package/public/assets/dialog-BOFZkCES.js.gz +0 -0
  59. package/public/assets/{field-hint-B774BIWK.js → field-hint-B9fPUgi7.js} +1 -1
  60. package/public/assets/field-hint-B9fPUgi7.js.br +0 -0
  61. package/public/assets/field-hint-B9fPUgi7.js.gz +0 -0
  62. package/public/assets/index-Bixhy5MB.js +248 -0
  63. package/public/assets/index-Bixhy5MB.js.br +0 -0
  64. package/public/assets/index-Bixhy5MB.js.gz +0 -0
  65. package/public/assets/{index-EPyP3g9A.css → index-h2hiZ2OM.css} +1 -1
  66. package/public/assets/index-h2hiZ2OM.css.br +0 -0
  67. package/public/assets/index-h2hiZ2OM.css.gz +0 -0
  68. package/public/assets/list-view-BpOY1e-d.js +1 -0
  69. package/public/assets/list-view-BpOY1e-d.js.br +0 -0
  70. package/public/assets/list-view-BpOY1e-d.js.gz +0 -0
  71. package/public/assets/{pencil-1XSs32nb.js → pencil-ZlrAsWuU.js} +1 -1
  72. package/public/assets/pencil-ZlrAsWuU.js.br +0 -0
  73. package/public/assets/pencil-ZlrAsWuU.js.gz +0 -0
  74. package/public/assets/{play-DCvrorIC.js → play-4CsGZdQU.js} +1 -1
  75. package/public/assets/{play-DCvrorIC.js.br → play-4CsGZdQU.js.br} +0 -0
  76. package/public/assets/play-4CsGZdQU.js.gz +0 -0
  77. package/public/assets/{search-input-CFWgLcKA.js → search-input-G_QpBvPM.js} +1 -1
  78. package/public/assets/search-input-G_QpBvPM.js.br +0 -0
  79. package/public/assets/search-input-G_QpBvPM.js.gz +0 -0
  80. package/public/assets/{select-5ZtzWRYG.js → select-DDzv2YfY.js} +1 -1
  81. package/public/assets/select-DDzv2YfY.js.br +0 -0
  82. package/public/assets/select-DDzv2YfY.js.gz +0 -0
  83. package/public/assets/{slider-DHuMDXcP.js → slider-DE7lQdK4.js} +1 -1
  84. package/public/assets/slider-DE7lQdK4.js.br +0 -0
  85. package/public/assets/slider-DE7lQdK4.js.gz +0 -0
  86. package/public/assets/{tabs-CmgV_sSI.js → tabs-Co1N3x_X.js} +1 -1
  87. package/public/assets/tabs-Co1N3x_X.js.br +0 -0
  88. package/public/assets/tabs-Co1N3x_X.js.gz +0 -0
  89. package/public/assets/{tech-label-qLodPeUI.js → tech-label-BMvuJmUf.js} +1 -1
  90. package/public/assets/tech-label-BMvuJmUf.js.br +0 -0
  91. package/public/assets/tech-label-BMvuJmUf.js.gz +0 -0
  92. package/public/assets/{trash-CXjB9oU1.js → trash-Cwj2dbgB.js} +1 -1
  93. package/public/assets/trash-Cwj2dbgB.js.br +0 -0
  94. package/public/assets/trash-Cwj2dbgB.js.gz +0 -0
  95. package/public/assets/{video-CK2q3-0B.js → video-swsaHrfi.js} +1 -1
  96. package/public/assets/video-swsaHrfi.js.br +0 -0
  97. package/public/assets/video-swsaHrfi.js.gz +0 -0
  98. package/public/index.html +14 -2
  99. package/public/index.html.br +0 -0
  100. package/public/index.html.gz +0 -0
  101. package/public/og-image.jpg +0 -0
  102. package/public/assets/AISessionWatch-Bxew762e.js.br +0 -0
  103. package/public/assets/AISessionWatch-Bxew762e.js.gz +0 -0
  104. package/public/assets/AppCenter-93hnrrdy.js.br +0 -0
  105. package/public/assets/AppCenter-93hnrrdy.js.gz +0 -0
  106. package/public/assets/Default-BhgcUKBm.js +0 -6
  107. package/public/assets/Default-BhgcUKBm.js.br +0 -0
  108. package/public/assets/Default-BhgcUKBm.js.gz +0 -0
  109. package/public/assets/Invite-DQBwLaOl.js.br +0 -0
  110. package/public/assets/Invite-DQBwLaOl.js.gz +0 -0
  111. package/public/assets/MacResources-D4LMGxgV.js.br +0 -0
  112. package/public/assets/MacResources-D4LMGxgV.js.gz +0 -0
  113. package/public/assets/QASession-Dnuq0yrN.js +0 -81
  114. package/public/assets/QASession-Dnuq0yrN.js.br +0 -0
  115. package/public/assets/QASession-Dnuq0yrN.js.gz +0 -0
  116. package/public/assets/ResetPassword-inTbbral.js.br +0 -0
  117. package/public/assets/ResetPassword-inTbbral.js.gz +0 -0
  118. package/public/assets/RunDetail-B3dw8_U0.js.br +0 -0
  119. package/public/assets/RunDetail-B3dw8_U0.js.gz +0 -0
  120. package/public/assets/Runs-DqZl9Y6M.js +0 -6
  121. package/public/assets/Runs-DqZl9Y6M.js.br +0 -0
  122. package/public/assets/Runs-DqZl9Y6M.js.gz +0 -0
  123. package/public/assets/Setup-CPa_UWpa.js.br +0 -0
  124. package/public/assets/Setup-CPa_UWpa.js.gz +0 -0
  125. package/public/assets/Team-DZie8W7R.js.br +0 -0
  126. package/public/assets/Team-DZie8W7R.js.gz +0 -0
  127. package/public/assets/Tokens-u3-uRAwd.js.br +0 -0
  128. package/public/assets/Tokens-u3-uRAwd.js.gz +0 -0
  129. package/public/assets/aiSession-BsmDnyV1.js.br +0 -0
  130. package/public/assets/aiSession-BsmDnyV1.js.gz +0 -0
  131. package/public/assets/alert-dialog-Bq_Ln5bp.js.br +0 -0
  132. package/public/assets/alert-dialog-Bq_Ln5bp.js.gz +0 -0
  133. package/public/assets/badge-D-bt97WR.js.br +0 -0
  134. package/public/assets/badge-D-bt97WR.js.gz +0 -0
  135. package/public/assets/dialog-CtzPkg0O.js.br +0 -0
  136. package/public/assets/dialog-CtzPkg0O.js.gz +0 -0
  137. package/public/assets/field-hint-B774BIWK.js.br +0 -1
  138. package/public/assets/field-hint-B774BIWK.js.gz +0 -0
  139. package/public/assets/index-EPyP3g9A.css.br +0 -0
  140. package/public/assets/index-EPyP3g9A.css.gz +0 -0
  141. package/public/assets/index-cgl1yEKu.js +0 -223
  142. package/public/assets/index-cgl1yEKu.js.br +0 -0
  143. package/public/assets/index-cgl1yEKu.js.gz +0 -0
  144. package/public/assets/list-view-BcjDCJy5.js +0 -1
  145. package/public/assets/list-view-BcjDCJy5.js.br +0 -0
  146. package/public/assets/list-view-BcjDCJy5.js.gz +0 -0
  147. package/public/assets/pencil-1XSs32nb.js.br +0 -0
  148. package/public/assets/pencil-1XSs32nb.js.gz +0 -0
  149. package/public/assets/play-DCvrorIC.js.gz +0 -0
  150. package/public/assets/search-input-CFWgLcKA.js.br +0 -0
  151. package/public/assets/search-input-CFWgLcKA.js.gz +0 -0
  152. package/public/assets/select-5ZtzWRYG.js.br +0 -0
  153. package/public/assets/select-5ZtzWRYG.js.gz +0 -0
  154. package/public/assets/slider-DHuMDXcP.js.br +0 -0
  155. package/public/assets/slider-DHuMDXcP.js.gz +0 -0
  156. package/public/assets/tabs-CmgV_sSI.js.br +0 -0
  157. package/public/assets/tabs-CmgV_sSI.js.gz +0 -0
  158. package/public/assets/tech-label-qLodPeUI.js.br +0 -0
  159. package/public/assets/tech-label-qLodPeUI.js.gz +0 -0
  160. package/public/assets/trash-CXjB9oU1.js.br +0 -0
  161. package/public/assets/trash-CXjB9oU1.js.gz +0 -0
  162. package/public/assets/video-CK2q3-0B.js.br +0 -0
  163. package/public/assets/video-CK2q3-0B.js.gz +0 -0
@@ -1,4 +1,4 @@
1
- import{c as B,r as w,j as t}from"./vendor-react-DTSdA8m-.js";import{G as U,c as J,am as re,an as ie,ao as oe,ap as ce,T as ue,K as W,M as Q,aq as q,N as G,B as D,ar as de,q as X,as as me,at as fe,aj as xe,au as he,av as pe,I as ge,H as Y}from"./index-cgl1yEKu.js";import{B as K}from"./badge-D-bt97WR.js";import{T as A}from"./tech-label-qLodPeUI.js";import{r as ee,d as je,f as te,b as ye,s as Ne,a as be,c as ke,p as we,e as se,U as ve}from"./runs-CInQb6v1.js";import{S as Se}from"./slider-DHuMDXcP.js";import{d as Me,S as Ce,a as $e,b as Ee,c as Re}from"./select-5ZtzWRYG.js";import{W as Te}from"./WatchedDevice-CpaKHa1x.js";import{k as Ie,C as _e,H as Fe}from"./AndroidDeviceScreen-C55msKfh.js";import{P as Le}from"./play-DCvrorIC.js";import{V as Pe}from"./video-CK2q3-0B.js";import{d as qe,L as O}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";/**
1
+ import{c as B,r as w,j as t}from"./vendor-react-DTSdA8m-.js";import{G as U,c as J,an as re,ao as ie,ap as oe,aq as ce,T as ue,K as W,M as Q,ar as q,N as G,B as D,as as de,q as X,at as fe,au as me,ak as xe,av as he,aw as pe,I as ge,H as Y}from"./index-Bixhy5MB.js";import{B as K}from"./badge-DrDCTAQQ.js";import{T as A}from"./tech-label-BMvuJmUf.js";import{r as ee,d as je,f as te,b as ye,s as Ne,a as be,c as ke,p as we,e as se,U as ve}from"./runs-CInQb6v1.js";import{S as Se}from"./slider-DE7lQdK4.js";import{d as Me,S as Ce,a as $e,b as Ee,c as Re}from"./select-DDzv2YfY.js";import{W as Te}from"./WatchedDevice-CpaKHa1x.js";import{k as Ie,C as _e,H as Fe}from"./AndroidDeviceScreen-C55msKfh.js";import{P as Le}from"./play-4CsGZdQU.js";import{V as Pe}from"./video-swsaHrfi.js";import{d as qe,L as O}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";/**
2
2
  * @license lucide-react v1.58.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{c as B,r as w,j as t}from"./vendor-react-DTSdA8m-.js";import{G as U,c as
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const le={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};le.node;const Be=U(le),ze=[.5,1,2,4];function Ve(s){const e=B.c(43),{runId:a,idx:n,flowName:x,summary:r,running:o}=s,[i,c]=w.useState(!1),[d,g]=w.useState(!1);let m;e[0]!==n||e[1]!==a?(m=X.runVideo(a,n),e[0]=n,e[1]=a,e[2]=m):m=e[2];let p;e[3]!==n||e[4]!==a?(p=async f=>{const{signal:N}=f,C=await me(a,n,N);return C.kind==="ready"?{kind:"ready",index:C.index,video:fe(C.index,C.file)}:C},e[3]=n,e[4]=a,e[5]=p):p=e[5];let h;e[6]!==i||e[7]!==m||e[8]!==p?(h={queryKey:m,queryFn:p,enabled:i,staleTime:1/0,refetchOnWindowFocus:!1},e[6]=i,e[7]=m,e[8]=p,e[9]=h):h=e[9];const j=J(h);let b;e[10]!==r?(b=re(r),e[10]=r,e[11]=b):b=e[11];const P=b;if(P){let f;return e[12]!==P?(f=t.jsx("p",{className:"text-xs text-muted-foreground",children:P}),e[12]=P,e[13]=f):f=e[13],f}const u=j.data;if((u==null?void 0:u.kind)==="ready"){let f;e[14]!==j?(f=()=>void j.refetch(),e[14]=j,e[15]=f):f=e[15];let N;return e[16]!==x||e[17]!==d||e[18]!==u.index||e[19]!==u.video||e[20]!==f?(N=t.jsx(Ue,{video:u.video,index:u.index,flowName:x,focusPlay:d,onLoadRest:f},u.index.bytes),e[16]=x,e[17]=d,e[18]=u.index,e[19]=u.video,e[20]=f,e[21]=N):N=e[21],N}const v=i&&j.isFetching,R=(u==null?void 0:u.kind)==="gone"?"Video no longer kept.":(u==null?void 0:u.kind)==="unsupported"?"This video was recorded in a format this dashboard cannot play. Update the relay to play it.":j.isError?"Couldn't load the video. Try again.":"";let S;e[22]!==v||e[23]!==j?(S=f=>{v||(g(document.activeElement===f.currentTarget),j.isError?j.refetch():c(!0))},e[22]=v,e[23]=j,e[24]=S):S=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),e[25]=k):k=e[25];const _=v?"Loading the video…":"Play the video";let F;e[26]!==v||e[27]!==S||e[28]!==_?(F=t.jsxs(D,{size:"sm",variant:"outline","aria-disabled":v,className:"aria-disabled:opacity-50",onClick:S,children:[k,_]}),e[26]=v,e[27]=S,e[28]=_,e[29]=F):F=e[29];let M;e[30]!==r.bytes?(M=Oe(r.bytes),e[30]=r.bytes,e[31]=M):M=e[31];let $;e[32]!==M?($=t.jsx(A,{className:"text-muted-foreground",children:M}),e[32]=M,e[33]=$):$=e[33];let E;e[34]!==o?(E=o&&t.jsx("span",{className:"text-xs text-muted-foreground",children:"Still recording: it plays what has arrived so far."}),e[34]=o,e[35]=E):E=e[35];let l;e[36]!==R?(l=t.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:R}),e[36]=R,e[37]=l):l=e[37];let y;return e[38]!==$||e[39]!==E||e[40]!==l||e[41]!==F?(y=t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[F,$,E,l]}),e[38]=$,e[39]=E,e[40]=l,e[41]=F,e[42]=y):y=e[42],y}function Ke(s,e){return e>0&&s.chunks[e].seq!==s.chunks[e-1].seq+1}function Oe(s){return s>=1024*1024?`${(s/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(s/1024))} KB`}function Ue({video:s,index:e,flowName:a,focusPlay:n,onLoadRest:x}){const r=w.useRef(null);w.useEffect(()=>{var l;n&&((l=r.current)==null||l.focus())},[n]);const o=w.useRef(()=>{}),[i]=w.useState(()=>{let l;return{get current(){return l},set current(y){l=y,y&&queueMicrotask(()=>{l===y&&o.current()})}}}),c=Math.min(s.meta.flowStartMs,s.durationMs),[d,g]=w.useState(0),[m,p]=w.useState(c),[h,j]=w.useState(!1),[b,P]=w.useState(1),u=w.useRef({ms:c,next:0}),v=w.useRef({ms:c,flush:!0}),R=w.useRef(!1),S=w.useCallback((l,y=!1)=>{var T;const f=s.records;let N=u.current.next,C=-1;for(let I=N;I<f.length&&f[I].ms<=l;I++)f[I].kind==="frame"&&(C=I);for(;N<f.length&&f[N].ms<=l;){const I=f[N];if(I.kind==="frame"){const L=Ie(I.data);(L==null?void 0:L.codec)!==_e&&((T=i.current)==null||T.call(i,L?I.data.slice(Fe):I.data,L?{codec:L.codec,keyframe:L.keyframe,capturedAt:L.capturedAt,flush:y&&N===C}:void 0))}N++}u.current.next=N},[s,i]),k=w.useCallback((l,y)=>{v.current={ms:Math.max(0,Math.min(l,s.durationMs)),flush:y},p(v.current.ms),g(f=>f+1)},[s]);w.useLayoutEffect(()=>{o.current=()=>{const l=v.current,y=ie(s,l.ms);u.current={ms:l.ms,next:y>=0?s.chunkStarts[y]:s.records.length},S(l.ms,l.flush)}},[s,S]),w.useEffect(()=>{if(!h)return;let l=0,y=performance.now();const f=N=>{const C=u.current.ms+(N-y)*b;y=N;const T=s.records[u.current.next];if(T&&T.ms<=C&&u.current.next===s.chunkStarts[T.chunk]&&Ke(s,T.chunk)&&u.current.ms<s.chunks[T.chunk].startMs){k(s.chunks[T.chunk].startMs,!1);return}if(u.current.ms=Math.min(C,s.durationMs),S(u.current.ms),p(u.current.ms),u.current.ms>=s.durationMs){j(!1),k(s.durationMs,!0);return}l=requestAnimationFrame(f)};return l=requestAnimationFrame(f),()=>cancelAnimationFrame(l)},[h,b,s,S,k,d]);const _=()=>{if(h){j(!1),k(u.current.ms,!0);return}k(u.current.ms>=s.durationMs?c:u.current.ms,!1),j(!0)},F=oe(s,m),M=l=>`${s.durationMs>0?l/s.durationMs*100:0}%`,$=ce(e.endReason),E=l=>R.current?de(s,l):l;return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx("div",{role:"region","aria-label":`Video of ${a}`,className:"w-fit origin-top-left",style:{zoom:.6},children:t.jsx(Te,{screenKey:d,chrome:F,deviceReady:!0,platform:s.meta.platform??"ios",binaryFrameHandlerRef:i,replay:!0})}),t.jsxs("div",{className:"flex max-w-xl flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ue,{delayDuration:150,children:t.jsxs("div",{className:"relative mx-2 h-2",children:[s.gaps.map((l,y)=>t.jsxs(W,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":`${q(l.fromMs)} to ${q(l.toMs)}: did not reach the relay`,onClick:()=>k(l.toMs,!h),className:"absolute top-0 h-2 rounded-full bg-muted-foreground/40 active:transform-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",style:{left:M(l.fromMs),width:`max(8px, calc(${M(l.toMs)} - ${M(l.fromMs)}))`}})}),t.jsxs(G,{children:[q(l.fromMs),"–",q(l.toMs)," · did not reach the relay"]})]},`g${y}`)),s.steps.map(l=>t.jsxs(W,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":`${q(l.ms)} ${l.name}${l.status==="failed"?", failed":""}`,onClick:()=>k(l.ms,!h),className:`absolute top-0 -ml-1 h-2 w-2 rounded-full active:transform-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${l.status==="failed"?"bg-destructive":"bg-muted-foreground"}`,style:{left:M(l.ms)}})}),t.jsxs(G,{children:[q(l.ms)," · ",l.name,l.status==="failed"&&t.jsx("span",{className:"font-medium",children:" · failed"})]})]},`s${l.index}`))]})}),t.jsx(Se,{min:0,max:Math.max(1,s.durationMs),step:50,value:[m],onPointerDown:()=>{R.current=!0},onValueChange:([l])=>k(E(l??0),!h),onValueCommit:()=>{R.current=!1},"aria-label":`Position in the video of ${a}`,"aria-valuetext":`${q(m)} of ${q(s.durationMs)}`})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(D,{ref:r,size:"sm",variant:"outline",onClick:_,"aria-label":h?"Pause":"Play",children:h?t.jsx(Be,{className:"h-3.5 w-3.5","aria-hidden":!0}):t.jsx(Le,{className:"h-3.5 w-3.5","aria-hidden":!0})}),t.jsxs(A,{className:"text-muted-foreground",children:[q(m)," / ",q(s.durationMs)]}),t.jsxs(Me,{value:String(b),onValueChange:l=>P(Number(l)),children:[t.jsx(Ce,{"aria-label":"Playback speed",className:"ml-auto h-8 w-20 text-xs",children:t.jsx($e,{})}),t.jsx(Ee,{children:ze.map(l=>t.jsxs(Re,{value:String(l),children:[l,"×"]},l))})]})]}),($||!e.ended)&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[$,!e.ended&&t.jsxs(t.Fragment,{children:[$&&" ","Loaded while the flow was still running."," ",t.jsx("button",{type:"button",onClick:x,className:"underline underline-offset-2 hover:text-foreground",children:"Load the rest"})]})]})]})]})]})}function ft(){const s=B.c(16),{runId:e}=qe(),a=e===void 0?"":e;let n;s[0]!==a?(n=X.run(a),s[0]=a,s[1]=n):n=s[1];let x;s[2]!==a?(x=j=>{const{signal:b}=j;return he(a,b)},s[2]=a,s[3]=x):x=s[3];let r;s[4]!==n||s[5]!==x?(r={queryKey:n,queryFn:x,refetchInterval:He},s[4]=n,s[5]=x,s[6]=r):r=s[6];const o=J(r),i=o.data;let c;s[7]!==i?(c=i?ee(i.build):"Run",s[7]=i,s[8]=c):c=s[8];const d=c,{setNode:g}=xe();let m,p;s[9]!==d||s[10]!==g?(m=()=>(g(t.jsxs("span",{className:"flex items-center gap-1.5 text-sm",children:[t.jsx(O,{to:"/automation/runs",className:"text-muted-foreground hover:text-foreground",children:"Flow Runs"}),t.jsx("span",{className:"text-muted-foreground",children:"/"}),t.jsx("span",{className:"font-medium",children:d})]})),()=>g(null)),p=[g,d],s[9]=d,s[10]=g,s[11]=m,s[12]=p):(m=s[11],p=s[12]),w.useEffect(m,p);let h;return s[13]!==i||s[14]!==o?(h=t.jsx("div",{className:"flex flex-col gap-5 p-6",children:i?t.jsx(We,{run:i}):i===null?t.jsx("p",{className:"text-sm text-muted-foreground",children:"This run is gone. A run is deleted with its build, or after 7 days when it has none."}):o.isError?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Couldn't load this run.",t.jsx(D,{variant:"outline",size:"sm",className:"ml-3",onClick:()=>void o.refetch(),children:"Try again"})]}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})}),s[13]=i,s[14]=o,s[15]=h):h=s[15],h}function He(s){return we(s.state.data?[s.state.data.status]:void 0)}function We(s){var I,L;const e=B.c(69),{run:a}=s;let n;e[0]!==a?(n=je(a),e[0]=a,e[1]=n):n=e[1];const x=n;let r;e[2]!==a.failureKind||e[3]!==a.status?(r=te(a.status,a.failureKind),e[2]=a.failureKind,e[3]=a.status,e[4]=r):r=e[4];const o=r;let i;e[5]!==a.build?(i=ee(a.build),e[5]=a.build,e[6]=i):i=e[6];let c;e[7]!==i?(c=t.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:i}),e[7]=i,e[8]=c):c=e[8];let d;e[9]!==o.label||e[10]!==o.tone?(d=t.jsx(K,{tone:o.tone,className:"text-xs",children:o.label}),e[9]=o.label,e[10]=o.tone,e[11]=d):d=e[11];let g;e[12]!==c||e[13]!==d?(g=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[12]=c,e[13]=d,e[14]=g):g=e[14];let m;e[15]!==a?(m=ye(a),e[15]=a,e[16]=m):m=e[16];let p;e[17]!==m?(p=t.jsx("span",{children:m}),e[17]=m,e[18]=p):p=e[18];let h;e[19]!==a.ci?(h=((I=a.ci)==null?void 0:I.commit)&&t.jsx(A,{children:Ne(a.ci.commit)}),e[19]=a.ci,e[20]=h):h=e[20];let j;e[21]!==a.createdAt?(j=be(a.createdAt),e[21]=a.createdAt,e[22]=j):j=e[22];let b;e[23]!==j?(b=t.jsxs("span",{children:["Started ",j]}),e[23]=j,e[24]=b):b=e[24];const P=a.finishedAt?"Took":"Running for";let u;e[25]!==a?(u=ke(a),e[25]=a,e[26]=u):u=e[26];let v;e[27]!==u?(v=t.jsx(A,{children:u}),e[27]=u,e[28]=v):v=e[28];let R;e[29]!==P||e[30]!==v?(R=t.jsxs("span",{children:[P," ",v]}),e[29]=P,e[30]=v,e[31]=R):R=e[31];let S;e[32]!==a.exitCode?(S=a.exitCode!==null&&t.jsxs("span",{children:["Exit code ",t.jsx(A,{children:a.exitCode})]}),e[32]=a.exitCode,e[33]=S):S=e[33];let k;e[34]!==b||e[35]!==R||e[36]!==S||e[37]!==p||e[38]!==h?(k=t.jsxs("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[p,h,b,R,S]}),e[34]=b,e[35]=R,e[36]=S,e[37]=p,e[38]=h,e[39]=k):k=e[39];let _;e[40]!==k||e[41]!==g?(_=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,k]}),e[40]=k,e[41]=g,e[42]=_):_=e[42];const F=x??(a.status==="running"?"Running. This page follows the run.":"");let M;e[43]!==F?(M=t.jsx("p",{role:"status",className:"text-sm",children:F}),e[43]=F,e[44]=M):M=e[44];let $;e[45]!==a.watchSessionId?($=a.watchSessionId&&t.jsx(D,{asChild:!0,size:"sm",children:t.jsxs(O,{to:`/automation/sessions/${encodeURIComponent(a.watchSessionId)}`,children:[t.jsx(De,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),"Watch the device"]})}),e[45]=a.watchSessionId,e[46]=$):$=e[46];let E;e[47]!==a.ci?(E=((L=a.ci)==null?void 0:L.jobUrl)&&t.jsx(D,{asChild:!0,size:"sm",variant:"outline",children:t.jsxs("a",{href:a.ci.jobUrl,target:"_blank",rel:"noreferrer noopener",children:["Open the CI run",t.jsx(Ae,{className:"ml-1.5 h-3.5 w-3.5","aria-hidden":!0})]})}),e[47]=a.ci,e[48]=E):E=e[48];let l;e[49]!==a.build?(l=a.build&&t.jsx(D,{asChild:!0,size:"sm",variant:"outline",children:t.jsx(O,{to:`/automation/runs?source=all&build=${a.build.id}`,children:"Other runs of this build"})}),e[49]=a.build,e[50]=l):l=e[50];let y;e[51]!==$||e[52]!==E||e[53]!==l?(y=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[$,E,l]}),e[51]=$,e[52]=E,e[53]=l,e[54]=y):y=e[54];let f;e[55]!==_||e[56]!==M||e[57]!==y?(f=t.jsxs("div",{className:"flex flex-col gap-4",children:[_,M,y]}),e[55]=_,e[56]=M,e[57]=y,e[58]=f):f=e[58];let N;if(e[59]!==a.flows||e[60]!==a.id){let z;e[62]!==a.id?(z=H=>t.jsx(Qe,{runId:a.id,flow:H},H.idx),e[62]=a.id,e[63]=z):z=e[63],N=a.flows.map(z),e[59]=a.flows,e[60]=a.id,e[61]=N}else N=e[61];let C;e[64]!==N?(C=t.jsx("ol",{className:"flex flex-col gap-3","aria-label":"Flows",children:N}),e[64]=N,e[65]=C):C=e[65];let T;return e[66]!==f||e[67]!==C?(T=t.jsxs(t.Fragment,{children:[f,C]}),e[66]=f,e[67]=C,e[68]=T):T=e[68],T}function V(s){return s.status==="passed"||s.status==="failed"}function Qe(s){var b;const e=B.c(32),{runId:a,flow:n}=s;let x;e[0]!==n?(x=V(n)?te(n.status,n.failureKind):null,e[0]=n,e[1]=x):x=e[1];const r=x;let o;e[2]!==n.name?(o=t.jsx("span",{className:"text-sm font-medium",children:n.name}),e[2]=n.name,e[3]=o):o=e[3];let i;e[4]!==(r==null?void 0:r.label)||e[5]!==(r==null?void 0:r.tone)||e[6]!==n?(i=V(n)?t.jsxs(t.Fragment,{children:[t.jsx(K,{tone:r==null?void 0:r.tone,className:"text-xs",children:r==null?void 0:r.label}),t.jsx(A,{className:"text-muted-foreground",children:se(n.durationMs)}),((b=n.device)==null?void 0:b.name)&&t.jsx("span",{className:"text-xs text-muted-foreground",children:n.device.name})]}):t.jsx(K,{tone:n.status==="running"?"progress":"backlog",className:"text-xs",children:ve[n.status]}),e[4]=r==null?void 0:r.label,e[5]=r==null?void 0:r.tone,e[6]=n,e[7]=i):i=e[7];let c;e[8]!==o||e[9]!==i?(c=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,i]}),e[8]=o,e[9]=i,e[10]=c):c=e[10];let d;e[11]!==n.file?(d=n.file&&t.jsx(A,{className:"block text-muted-foreground",children:n.file}),e[11]=n.file,e[12]=d):d=e[12];let g;e[13]!==c||e[14]!==d?(g=t.jsxs("div",{className:"flex flex-col gap-1",children:[c,d]}),e[13]=c,e[14]=d,e[15]=g):g=e[15];let m;e[16]!==n||e[17]!==a?(m=V(n)&&n.status==="failed"&&t.jsxs(t.Fragment,{children:[n.failureMessage&&t.jsx("p",{className:"text-sm text-destructive",children:n.failureMessage}),n.steps.length>0&&t.jsx("ol",{className:"flex flex-col gap-1 text-xs","aria-label":`Steps of ${n.name}`,children:n.steps.map(Ge)}),n.hasScreenshot&&t.jsx(Z,{runId:a,flow:n})]}),e[16]=n,e[17]=a,e[18]=m):m=e[18];let p;e[19]!==n||e[20]!==a?(p=V(n)&&n.status==="passed"&&n.hasScreenshot&&t.jsx(Z,{runId:a,flow:n}),e[19]=n,e[20]=a,e[21]=p):p=e[21];let h;e[22]!==n.idx||e[23]!==n.name||e[24]!==n.video||e[25]!==a?(h=n.video&&t.jsx(Ve,{runId:a,idx:n.idx,flowName:n.name,summary:n.video,running:!n.video.ended}),e[22]=n.idx,e[23]=n.name,e[24]=n.video,e[25]=a,e[26]=h):h=e[26];let j;return e[27]!==g||e[28]!==m||e[29]!==p||e[30]!==h?(j=t.jsxs("li",{className:"flex flex-col gap-6 rounded-md border bg-card p-4",children:[g,m,p,h]}),e[27]=g,e[28]=m,e[29]=p,e[30]=h,e[31]=j):j=e[31],j}function Ge(s){return t.jsxs("li",{className:"flex gap-2",children:[t.jsxs("span",{className:s.status==="failed"?"text-destructive":"text-muted-foreground",children:[s.status==="passed"?"✓":s.status==="failed"?"✗":"–",t.jsxs("span",{className:"sr-only",children:[" ",s.status]})]}),t.jsxs("span",{className:"min-w-0 flex-1",children:[s.name,s.message&&t.jsx("span",{className:"block text-muted-foreground",children:s.message}),s.suggestions&&s.suggestions.length>0&&t.jsx(Ze,{step:s})]}),t.jsx(A,{className:"text-muted-foreground",children:se(s.durationMs)})]},s.index)}function Ze(s){const e=B.c(8),{step:a}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("span",{className:"text-muted-foreground",children:"Try instead, from the screen it failed on:"}),e[0]=n):n=e[0];let x;if(e[1]!==a.name||e[2]!==a.suggestions){let o;e[4]!==a.name?(o=(i,c)=>t.jsx(Je,{yaml:i.yaml,n:c+1,stepName:a.name},i.yaml),e[4]=a.name,e[5]=o):o=e[5],x=a.suggestions.map(o),e[1]=a.name,e[2]=a.suggestions,e[3]=x}else x=e[3];let r;return e[6]!==x?(r=t.jsxs("span",{className:"mt-1.5 flex flex-col gap-1",children:[n,x]}),e[6]=x,e[7]=r):r=e[7],r}function Je(s){const e=B.c(11),{yaml:a,n,stepName:x}=s,r=w.useRef(null),o=`Suggested line ${n} for ${x}`;let i;e[0]!==o||e[1]!==a?(i=t.jsx(ge,{ref:r,readOnly:!0,value:a,"aria-label":o,onFocus:Ye,className:"h-7 min-w-0 font-mono"}),e[0]=o,e[1]=a,e[2]=i):i=e[2];const c=`Copy suggested line ${n}`;let d;e[3]!==a?(d=()=>{(navigator.clipboard?navigator.clipboard.writeText(a):Promise.reject(new Error("no clipboard"))).then(Xe).catch(()=>{var p;Y.error("Could not copy — select the line and copy it by hand"),(p=r.current)==null||p.focus()})},e[3]=a,e[4]=d):d=e[4];let g;e[5]!==c||e[6]!==d?(g=t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"h-7","aria-label":c,onClick:d,children:"Copy"}),e[5]=c,e[6]=d,e[7]=g):g=e[7];let m;return e[8]!==i||e[9]!==g?(m=t.jsxs("span",{className:"flex items-center gap-2",children:[i,g]}),e[8]=i,e[9]=g,e[10]=m):m=e[10],m}function Xe(){return Y.success("Copied")}function Ye(s){return s.currentTarget.select()}function Z(s){const e=B.c(10),{runId:a,flow:n}=s;let x;e[0]!==n.idx||e[1]!==a?(x=pe(a,n.idx),e[0]=n.idx,e[1]=a,e[2]=x):x=e[2];const r=x,o=n.status==="failed"?`The screen when ${n.name} failed`:`The screen ${n.name} ended on`,i=`${n.status==="failed"?"max-h-96":"max-h-64"} rounded-md border`;let c;e[3]!==o||e[4]!==i||e[5]!==r?(c=t.jsx("img",{src:r,alt:o,loading:"lazy",className:i}),e[3]=o,e[4]=i,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==c||e[8]!==r?(d=t.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:"block w-fit",children:c}),e[7]=c,e[8]=r,e[9]=d):d=e[9],d}export{ft as RunDetail};
16
+ */const le={name:"pause",size:24,node:[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]};le.node;const Be=U(le),ze=[.5,1,2,4];function Ve(s){const e=B.c(43),{runId:a,idx:n,flowName:x,summary:r,running:o}=s,[i,c]=w.useState(!1),[d,g]=w.useState(!1);let f;e[0]!==n||e[1]!==a?(f=X.runVideo(a,n),e[0]=n,e[1]=a,e[2]=f):f=e[2];let p;e[3]!==n||e[4]!==a?(p=async m=>{const{signal:N}=m,C=await fe(a,n,N);return C.kind==="ready"?{kind:"ready",index:C.index,video:me(C.index,C.file)}:C},e[3]=n,e[4]=a,e[5]=p):p=e[5];let h;e[6]!==i||e[7]!==f||e[8]!==p?(h={queryKey:f,queryFn:p,enabled:i,staleTime:1/0,refetchOnWindowFocus:!1},e[6]=i,e[7]=f,e[8]=p,e[9]=h):h=e[9];const j=J(h);let b;e[10]!==r?(b=re(r),e[10]=r,e[11]=b):b=e[11];const P=b;if(P){let m;return e[12]!==P?(m=t.jsx("p",{className:"text-xs text-muted-foreground",children:P}),e[12]=P,e[13]=m):m=e[13],m}const u=j.data;if((u==null?void 0:u.kind)==="ready"){let m;e[14]!==j?(m=()=>void j.refetch(),e[14]=j,e[15]=m):m=e[15];let N;return e[16]!==x||e[17]!==d||e[18]!==u.index||e[19]!==u.video||e[20]!==m?(N=t.jsx(Ue,{video:u.video,index:u.index,flowName:x,focusPlay:d,onLoadRest:m},u.index.bytes),e[16]=x,e[17]=d,e[18]=u.index,e[19]=u.video,e[20]=m,e[21]=N):N=e[21],N}const v=i&&j.isFetching,R=(u==null?void 0:u.kind)==="gone"?"Video no longer kept.":(u==null?void 0:u.kind)==="unsupported"?"This video was recorded in a format this dashboard cannot play. Update the relay to play it.":j.isError?"Couldn't load the video. Try again.":"";let S;e[22]!==v||e[23]!==j?(S=m=>{v||(g(document.activeElement===m.currentTarget),j.isError?j.refetch():c(!0))},e[22]=v,e[23]=j,e[24]=S):S=e[24];let k;e[25]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Pe,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),e[25]=k):k=e[25];const _=v?"Loading the video…":"Play the video";let F;e[26]!==v||e[27]!==S||e[28]!==_?(F=t.jsxs(D,{size:"sm",variant:"outline","aria-disabled":v,className:"aria-disabled:opacity-50",onClick:S,children:[k,_]}),e[26]=v,e[27]=S,e[28]=_,e[29]=F):F=e[29];let M;e[30]!==r.bytes?(M=Oe(r.bytes),e[30]=r.bytes,e[31]=M):M=e[31];let $;e[32]!==M?($=t.jsx(A,{className:"text-muted-foreground",children:M}),e[32]=M,e[33]=$):$=e[33];let E;e[34]!==o?(E=o&&t.jsx("span",{className:"text-xs text-muted-foreground",children:"Still recording: it plays what has arrived so far."}),e[34]=o,e[35]=E):E=e[35];let l;e[36]!==R?(l=t.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:R}),e[36]=R,e[37]=l):l=e[37];let y;return e[38]!==$||e[39]!==E||e[40]!==l||e[41]!==F?(y=t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[F,$,E,l]}),e[38]=$,e[39]=E,e[40]=l,e[41]=F,e[42]=y):y=e[42],y}function Ke(s,e){return e>0&&s.chunks[e].seq!==s.chunks[e-1].seq+1}function Oe(s){return s>=1024*1024?`${(s/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(s/1024))} KB`}function Ue({video:s,index:e,flowName:a,focusPlay:n,onLoadRest:x}){const r=w.useRef(null);w.useEffect(()=>{var l;n&&((l=r.current)==null||l.focus())},[n]);const o=w.useRef(()=>{}),[i]=w.useState(()=>{let l;return{get current(){return l},set current(y){l=y,y&&queueMicrotask(()=>{l===y&&o.current()})}}}),c=Math.min(s.meta.flowStartMs,s.durationMs),[d,g]=w.useState(0),[f,p]=w.useState(c),[h,j]=w.useState(!1),[b,P]=w.useState(1),u=w.useRef({ms:c,next:0}),v=w.useRef({ms:c,flush:!0}),R=w.useRef(!1),S=w.useCallback((l,y=!1)=>{var T;const m=s.records;let N=u.current.next,C=-1;for(let I=N;I<m.length&&m[I].ms<=l;I++)m[I].kind==="frame"&&(C=I);for(;N<m.length&&m[N].ms<=l;){const I=m[N];if(I.kind==="frame"){const L=Ie(I.data);(L==null?void 0:L.codec)!==_e&&((T=i.current)==null||T.call(i,L?I.data.slice(Fe):I.data,L?{codec:L.codec,keyframe:L.keyframe,capturedAt:L.capturedAt,flush:y&&N===C}:void 0))}N++}u.current.next=N},[s,i]),k=w.useCallback((l,y)=>{v.current={ms:Math.max(0,Math.min(l,s.durationMs)),flush:y},p(v.current.ms),g(m=>m+1)},[s]);w.useLayoutEffect(()=>{o.current=()=>{const l=v.current,y=ie(s,l.ms);u.current={ms:l.ms,next:y>=0?s.chunkStarts[y]:s.records.length},S(l.ms,l.flush)}},[s,S]),w.useEffect(()=>{if(!h)return;let l=0,y=performance.now();const m=N=>{const C=u.current.ms+(N-y)*b;y=N;const T=s.records[u.current.next];if(T&&T.ms<=C&&u.current.next===s.chunkStarts[T.chunk]&&Ke(s,T.chunk)&&u.current.ms<s.chunks[T.chunk].startMs){k(s.chunks[T.chunk].startMs,!1);return}if(u.current.ms=Math.min(C,s.durationMs),S(u.current.ms),p(u.current.ms),u.current.ms>=s.durationMs){j(!1),k(s.durationMs,!0);return}l=requestAnimationFrame(m)};return l=requestAnimationFrame(m),()=>cancelAnimationFrame(l)},[h,b,s,S,k,d]);const _=()=>{if(h){j(!1),k(u.current.ms,!0);return}k(u.current.ms>=s.durationMs?c:u.current.ms,!1),j(!0)},F=oe(s,f),M=l=>`${s.durationMs>0?l/s.durationMs*100:0}%`,$=ce(e.endReason),E=l=>R.current?de(s,l):l;return t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx("div",{role:"region","aria-label":`Video of ${a}`,className:"w-fit origin-top-left",style:{zoom:.6},children:t.jsx(Te,{screenKey:d,chrome:F,deviceReady:!0,platform:s.meta.platform??"ios",binaryFrameHandlerRef:i,replay:!0})}),t.jsxs("div",{className:"flex max-w-xl flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(ue,{delayDuration:150,children:t.jsxs("div",{className:"relative mx-2 h-2",children:[s.gaps.map((l,y)=>t.jsxs(W,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":`${q(l.fromMs)} to ${q(l.toMs)}: did not reach the relay`,onClick:()=>k(l.toMs,!h),className:"absolute top-0 h-2 rounded-full bg-muted-foreground/40 active:transform-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",style:{left:M(l.fromMs),width:`max(8px, calc(${M(l.toMs)} - ${M(l.fromMs)}))`}})}),t.jsxs(G,{children:[q(l.fromMs),"–",q(l.toMs)," · did not reach the relay"]})]},`g${y}`)),s.steps.map(l=>t.jsxs(W,{children:[t.jsx(Q,{asChild:!0,children:t.jsx("button",{type:"button","aria-label":`${q(l.ms)} ${l.name}${l.status==="failed"?", failed":""}`,onClick:()=>k(l.ms,!h),className:`absolute top-0 -ml-1 h-2 w-2 rounded-full active:transform-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${l.status==="failed"?"bg-destructive":"bg-muted-foreground"}`,style:{left:M(l.ms)}})}),t.jsxs(G,{children:[q(l.ms)," · ",l.name,l.status==="failed"&&t.jsx("span",{className:"font-medium",children:" · failed"})]})]},`s${l.index}`))]})}),t.jsx(Se,{min:0,max:Math.max(1,s.durationMs),step:50,value:[f],onPointerDown:()=>{R.current=!0},onValueChange:([l])=>k(E(l??0),!h),onValueCommit:()=>{R.current=!1},"aria-label":`Position in the video of ${a}`,"aria-valuetext":`${q(f)} of ${q(s.durationMs)}`})]}),t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(D,{ref:r,size:"sm",variant:"outline",onClick:_,"aria-label":h?"Pause":"Play",children:h?t.jsx(Be,{className:"h-3.5 w-3.5","aria-hidden":!0}):t.jsx(Le,{className:"h-3.5 w-3.5","aria-hidden":!0})}),t.jsxs(A,{className:"text-muted-foreground",children:[q(f)," / ",q(s.durationMs)]}),t.jsxs(Me,{value:String(b),onValueChange:l=>P(Number(l)),children:[t.jsx(Ce,{"aria-label":"Playback speed",className:"ml-auto h-8 w-20 text-xs",children:t.jsx($e,{})}),t.jsx(Ee,{children:ze.map(l=>t.jsxs(Re,{value:String(l),children:[l,"×"]},l))})]})]}),($||!e.ended)&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[$,!e.ended&&t.jsxs(t.Fragment,{children:[$&&" ","Loaded while the flow was still running."," ",t.jsx("button",{type:"button",onClick:x,className:"underline underline-offset-2 hover:text-foreground",children:"Load the rest"})]})]})]})]})]})}function mt(){const s=B.c(16),{runId:e}=qe(),a=e===void 0?"":e;let n;s[0]!==a?(n=X.run(a),s[0]=a,s[1]=n):n=s[1];let x;s[2]!==a?(x=j=>{const{signal:b}=j;return he(a,b)},s[2]=a,s[3]=x):x=s[3];let r;s[4]!==n||s[5]!==x?(r={queryKey:n,queryFn:x,refetchInterval:He},s[4]=n,s[5]=x,s[6]=r):r=s[6];const o=J(r),i=o.data;let c;s[7]!==i?(c=i?ee(i.build):"Run",s[7]=i,s[8]=c):c=s[8];const d=c,{setNode:g}=xe();let f,p;s[9]!==d||s[10]!==g?(f=()=>(g(t.jsxs("span",{className:"flex items-center gap-1.5 text-sm",children:[t.jsx(O,{to:"/automation/runs",className:"text-muted-foreground hover:text-foreground",children:"Flow Runs"}),t.jsx("span",{className:"text-muted-foreground",children:"/"}),t.jsx("span",{className:"font-medium",children:d})]})),()=>g(null)),p=[g,d],s[9]=d,s[10]=g,s[11]=f,s[12]=p):(f=s[11],p=s[12]),w.useEffect(f,p);let h;return s[13]!==i||s[14]!==o?(h=t.jsx("div",{className:"flex flex-col gap-5 p-6",children:i?t.jsx(We,{run:i}):i===null?t.jsx("p",{className:"text-sm text-muted-foreground",children:"This run is gone. A run is deleted with its build, or after 7 days when it has none."}):o.isError?t.jsxs("p",{className:"text-sm text-muted-foreground",children:["Couldn't load this run.",t.jsx(D,{variant:"outline",size:"sm",className:"ml-3",onClick:()=>void o.refetch(),children:"Try again"})]}):t.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"})}),s[13]=i,s[14]=o,s[15]=h):h=s[15],h}function He(s){return we(s.state.data?[s.state.data.status]:void 0)}function We(s){var I,L;const e=B.c(69),{run:a}=s;let n;e[0]!==a?(n=je(a),e[0]=a,e[1]=n):n=e[1];const x=n;let r;e[2]!==a.failureKind||e[3]!==a.status?(r=te(a.status,a.failureKind),e[2]=a.failureKind,e[3]=a.status,e[4]=r):r=e[4];const o=r;let i;e[5]!==a.build?(i=ee(a.build),e[5]=a.build,e[6]=i):i=e[6];let c;e[7]!==i?(c=t.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:i}),e[7]=i,e[8]=c):c=e[8];let d;e[9]!==o.label||e[10]!==o.tone?(d=t.jsx(K,{tone:o.tone,className:"text-xs",children:o.label}),e[9]=o.label,e[10]=o.tone,e[11]=d):d=e[11];let g;e[12]!==c||e[13]!==d?(g=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c,d]}),e[12]=c,e[13]=d,e[14]=g):g=e[14];let f;e[15]!==a?(f=ye(a),e[15]=a,e[16]=f):f=e[16];let p;e[17]!==f?(p=t.jsx("span",{children:f}),e[17]=f,e[18]=p):p=e[18];let h;e[19]!==a.ci?(h=((I=a.ci)==null?void 0:I.commit)&&t.jsx(A,{children:Ne(a.ci.commit)}),e[19]=a.ci,e[20]=h):h=e[20];let j;e[21]!==a.createdAt?(j=be(a.createdAt),e[21]=a.createdAt,e[22]=j):j=e[22];let b;e[23]!==j?(b=t.jsxs("span",{children:["Started ",j]}),e[23]=j,e[24]=b):b=e[24];const P=a.finishedAt?"Took":"Running for";let u;e[25]!==a?(u=ke(a),e[25]=a,e[26]=u):u=e[26];let v;e[27]!==u?(v=t.jsx(A,{children:u}),e[27]=u,e[28]=v):v=e[28];let R;e[29]!==P||e[30]!==v?(R=t.jsxs("span",{children:[P," ",v]}),e[29]=P,e[30]=v,e[31]=R):R=e[31];let S;e[32]!==a.exitCode?(S=a.exitCode!==null&&t.jsxs("span",{children:["Exit code ",t.jsx(A,{children:a.exitCode})]}),e[32]=a.exitCode,e[33]=S):S=e[33];let k;e[34]!==b||e[35]!==R||e[36]!==S||e[37]!==p||e[38]!==h?(k=t.jsxs("p",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-muted-foreground",children:[p,h,b,R,S]}),e[34]=b,e[35]=R,e[36]=S,e[37]=p,e[38]=h,e[39]=k):k=e[39];let _;e[40]!==k||e[41]!==g?(_=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[g,k]}),e[40]=k,e[41]=g,e[42]=_):_=e[42];const F=x??(a.status==="running"?"Running. This page follows the run.":"");let M;e[43]!==F?(M=t.jsx("p",{role:"status",className:"text-sm",children:F}),e[43]=F,e[44]=M):M=e[44];let $;e[45]!==a.watchSessionId?($=a.watchSessionId&&t.jsx(D,{asChild:!0,size:"sm",children:t.jsxs(O,{to:`/automation/sessions/${encodeURIComponent(a.watchSessionId)}`,children:[t.jsx(De,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),"Watch the device"]})}),e[45]=a.watchSessionId,e[46]=$):$=e[46];let E;e[47]!==a.ci?(E=((L=a.ci)==null?void 0:L.jobUrl)&&t.jsx(D,{asChild:!0,size:"sm",variant:"outline",children:t.jsxs("a",{href:a.ci.jobUrl,target:"_blank",rel:"noreferrer noopener",children:["Open the CI run",t.jsx(Ae,{className:"ml-1.5 h-3.5 w-3.5","aria-hidden":!0})]})}),e[47]=a.ci,e[48]=E):E=e[48];let l;e[49]!==a.build?(l=a.build&&t.jsx(D,{asChild:!0,size:"sm",variant:"outline",children:t.jsx(O,{to:`/automation/runs?source=all&build=${a.build.id}`,children:"Other runs of this build"})}),e[49]=a.build,e[50]=l):l=e[50];let y;e[51]!==$||e[52]!==E||e[53]!==l?(y=t.jsxs("div",{className:"flex flex-wrap gap-2",children:[$,E,l]}),e[51]=$,e[52]=E,e[53]=l,e[54]=y):y=e[54];let m;e[55]!==_||e[56]!==M||e[57]!==y?(m=t.jsxs("div",{className:"flex flex-col gap-4",children:[_,M,y]}),e[55]=_,e[56]=M,e[57]=y,e[58]=m):m=e[58];let N;if(e[59]!==a.flows||e[60]!==a.id){let z;e[62]!==a.id?(z=H=>t.jsx(Qe,{runId:a.id,flow:H},H.idx),e[62]=a.id,e[63]=z):z=e[63],N=a.flows.map(z),e[59]=a.flows,e[60]=a.id,e[61]=N}else N=e[61];let C;e[64]!==N?(C=t.jsx("ol",{className:"flex flex-col gap-3","aria-label":"Flows",children:N}),e[64]=N,e[65]=C):C=e[65];let T;return e[66]!==m||e[67]!==C?(T=t.jsxs(t.Fragment,{children:[m,C]}),e[66]=m,e[67]=C,e[68]=T):T=e[68],T}function V(s){return s.status==="passed"||s.status==="failed"}function Qe(s){var b;const e=B.c(32),{runId:a,flow:n}=s;let x;e[0]!==n?(x=V(n)?te(n.status,n.failureKind):null,e[0]=n,e[1]=x):x=e[1];const r=x;let o;e[2]!==n.name?(o=t.jsx("span",{className:"text-sm font-medium",children:n.name}),e[2]=n.name,e[3]=o):o=e[3];let i;e[4]!==(r==null?void 0:r.label)||e[5]!==(r==null?void 0:r.tone)||e[6]!==n?(i=V(n)?t.jsxs(t.Fragment,{children:[t.jsx(K,{tone:r==null?void 0:r.tone,className:"text-xs",children:r==null?void 0:r.label}),t.jsx(A,{className:"text-muted-foreground",children:se(n.durationMs)}),((b=n.device)==null?void 0:b.name)&&t.jsx("span",{className:"text-xs text-muted-foreground",children:n.device.name})]}):t.jsx(K,{tone:n.status==="running"?"progress":"backlog",className:"text-xs",children:ve[n.status]}),e[4]=r==null?void 0:r.label,e[5]=r==null?void 0:r.tone,e[6]=n,e[7]=i):i=e[7];let c;e[8]!==o||e[9]!==i?(c=t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,i]}),e[8]=o,e[9]=i,e[10]=c):c=e[10];let d;e[11]!==n.file?(d=n.file&&t.jsx(A,{className:"block text-muted-foreground",children:n.file}),e[11]=n.file,e[12]=d):d=e[12];let g;e[13]!==c||e[14]!==d?(g=t.jsxs("div",{className:"flex flex-col gap-1",children:[c,d]}),e[13]=c,e[14]=d,e[15]=g):g=e[15];let f;e[16]!==n||e[17]!==a?(f=V(n)&&n.status==="failed"&&t.jsxs(t.Fragment,{children:[n.failureMessage&&t.jsx("p",{className:"text-sm text-destructive",children:n.failureMessage}),n.steps.length>0&&t.jsx("ol",{className:"flex flex-col gap-1 text-xs","aria-label":`Steps of ${n.name}`,children:n.steps.map(Ge)}),n.hasScreenshot&&t.jsx(Z,{runId:a,flow:n})]}),e[16]=n,e[17]=a,e[18]=f):f=e[18];let p;e[19]!==n||e[20]!==a?(p=V(n)&&n.status==="passed"&&n.hasScreenshot&&t.jsx(Z,{runId:a,flow:n}),e[19]=n,e[20]=a,e[21]=p):p=e[21];let h;e[22]!==n.idx||e[23]!==n.name||e[24]!==n.video||e[25]!==a?(h=n.video&&t.jsx(Ve,{runId:a,idx:n.idx,flowName:n.name,summary:n.video,running:!n.video.ended}),e[22]=n.idx,e[23]=n.name,e[24]=n.video,e[25]=a,e[26]=h):h=e[26];let j;return e[27]!==g||e[28]!==f||e[29]!==p||e[30]!==h?(j=t.jsxs("li",{className:"flex flex-col gap-6 rounded-md border bg-card p-4",children:[g,f,p,h]}),e[27]=g,e[28]=f,e[29]=p,e[30]=h,e[31]=j):j=e[31],j}function Ge(s){return t.jsxs("li",{className:"flex gap-2",children:[t.jsxs("span",{className:s.status==="failed"?"text-destructive":"text-muted-foreground",children:[s.status==="passed"?"✓":s.status==="failed"?"✗":"–",t.jsxs("span",{className:"sr-only",children:[" ",s.status]})]}),t.jsxs("span",{className:"min-w-0 flex-1",children:[s.name,s.message&&t.jsx("span",{className:"block text-muted-foreground",children:s.message}),s.suggestions&&s.suggestions.length>0&&t.jsx(Ze,{step:s})]}),t.jsx(A,{className:"text-muted-foreground",children:se(s.durationMs)})]},s.index)}function Ze(s){const e=B.c(8),{step:a}=s;let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("span",{className:"text-muted-foreground",children:"Try instead, from the screen it failed on:"}),e[0]=n):n=e[0];let x;if(e[1]!==a.name||e[2]!==a.suggestions){let o;e[4]!==a.name?(o=(i,c)=>t.jsx(Je,{yaml:i.yaml,n:c+1,stepName:a.name},i.yaml),e[4]=a.name,e[5]=o):o=e[5],x=a.suggestions.map(o),e[1]=a.name,e[2]=a.suggestions,e[3]=x}else x=e[3];let r;return e[6]!==x?(r=t.jsxs("span",{className:"mt-1.5 flex flex-col gap-1",children:[n,x]}),e[6]=x,e[7]=r):r=e[7],r}function Je(s){const e=B.c(11),{yaml:a,n,stepName:x}=s,r=w.useRef(null),o=`Suggested line ${n} for ${x}`;let i;e[0]!==o||e[1]!==a?(i=t.jsx(ge,{ref:r,readOnly:!0,value:a,"aria-label":o,onFocus:Ye,className:"h-7 min-w-0 font-mono"}),e[0]=o,e[1]=a,e[2]=i):i=e[2];const c=`Copy suggested line ${n}`;let d;e[3]!==a?(d=()=>{(navigator.clipboard?navigator.clipboard.writeText(a):Promise.reject(new Error("no clipboard"))).then(Xe).catch(()=>{var p;Y.error("Could not copy — select the line and copy it by hand"),(p=r.current)==null||p.focus()})},e[3]=a,e[4]=d):d=e[4];let g;e[5]!==c||e[6]!==d?(g=t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"h-7","aria-label":c,onClick:d,children:"Copy"}),e[5]=c,e[6]=d,e[7]=g):g=e[7];let f;return e[8]!==i||e[9]!==g?(f=t.jsxs("span",{className:"flex items-center gap-2",children:[i,g]}),e[8]=i,e[9]=g,e[10]=f):f=e[10],f}function Xe(){return Y.success("Copied")}function Ye(s){return s.currentTarget.select()}function Z(s){const e=B.c(10),{runId:a,flow:n}=s;let x;e[0]!==n.idx||e[1]!==a?(x=pe(a,n.idx),e[0]=n.idx,e[1]=a,e[2]=x):x=e[2];const r=x,o=n.status==="failed"?`The screen when ${n.name} failed`:`The screen ${n.name} ended on`,i=`${n.status==="failed"?"max-h-96":"max-h-64"} rounded-md border`;let c;e[3]!==o||e[4]!==i||e[5]!==r?(c=t.jsx("img",{src:r,alt:o,loading:"lazy",className:i}),e[3]=o,e[4]=i,e[5]=r,e[6]=c):c=e[6];let d;return e[7]!==c||e[8]!==r?(d=t.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:"block w-fit",children:c}),e[7]=c,e[8]=r,e[9]=d):d=e[9],d}export{mt as RunDetail};
@@ -0,0 +1,6 @@
1
+ import{c as he,r as Q,j as s}from"./vendor-react-DTSdA8m-.js";import{G as Ke,ak as Oe,c as Ue,O as qe,q as Ge,al as He,$ as Ve,B as Ee,am as We}from"./index-Bixhy5MB.js";import{B as Be}from"./badge-DrDCTAQQ.js";import{S as ze}from"./search-input-G_QpBvPM.js";import{T as Ce}from"./tech-label-BMvuJmUf.js";import{a as Me,T as me,c as Qe}from"./tabs-Co1N3x_X.js";import{S as Xe,a as Je,b as Ye,c as De,d as Ze}from"./select-DDzv2YfY.js";import{l as et,T as tt,a as st,b as W,c as lt,d as Fe,e as z,L as at}from"./list-view-BpOY1e-d.js";import{u as rt}from"./useFocusAfterSwap-BdItkQCu.js";import{r as $e,f as nt,a as Re,b as ot,c as it,R as ct,p as ut}from"./runs-CInQb6v1.js";import{c as dt,a as ft,L as mt}from"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";import"./useShownAfter-By1Yxysz.js";/**
2
+ * @license lucide-react v1.58.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 ke={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};ke.node;const ht=Ke(ke),xt=300,Ae=["running","passed","failed","aborted"],Le="newest";function Ft(){var ge,pe,je,we,Se,ve,Ne,Te,ye,Pe;const e=he.c(89),[t,l]=dt();let c;e[0]!==t?(c=["ci","local","all"].find(r=>r===t.get("source"))??"ci",e[0]=t,e[1]=c):c=e[1];const o=c;let x;e[2]!==t?(x=r=>r===t.get("status"),e[2]=t,e[3]=x):x=e[3];const u=Ae.find(x);let h;e[4]!==t?(h=t.get("build"),e[4]=t,e[5]=h):h=e[5];const b=Number(h);let p;e[6]!==b?(p=Number.isInteger(b)&&b>0?b:void 0,e[6]=b,e[7]=p):p=e[7];const d=p;let _;e[8]!==t?(_=t.get("flow")??"",e[8]=t,e[9]=_):_=e[9];const i=_,T=t.get("after")?{after:t.get("after")}:t.get("before")?{before:t.get("before")}:{},{setNode:g}=Oe();let j,w;e[10]!==g?(j=()=>(g(s.jsx("span",{className:"text-sm font-medium",children:"Flow Runs"})),()=>g(null)),w=[g],e[10]=g,e[11]=j,e[12]=w):(j=e[11],w=e[12]),Q.useEffect(j,w);let S;e[13]!==l?(S=function(N,C){l(Ie=>oe(Ie,N,C),{replace:!0})},e[13]=l,e[14]=S):S=e[14];const f=S,[m,v]=Q.useState(i),[y,E]=Q.useState(i);i!==y&&(E(i),i!==m.trim()&&v(i));let P,R;e[15]!==i||e[16]!==m||e[17]!==l?(P=()=>{const r=m.trim();if(r===i)return;const N=setTimeout(()=>l(C=>oe(C,"flow",r||null),{replace:!0}),xt);return()=>clearTimeout(N)},R=[m,i,l],e[15]=i,e[16]=m,e[17]=l,e[18]=P,e[19]=R):(P=e[18],R=e[19]),Q.useEffect(P,R);const xe={...o==="all"?{}:{ci:o==="ci"},...u?{status:u}:{},...i?{flow:i}:{},...d!==void 0?{build:d}:{}},ie=Ge.runs({...xe,...T}),ce=r=>{const{signal:N}=r;return He(xe,T,N)};let X;e[20]!==ie||e[21]!==ce?(X={queryKey:ie,queryFn:ce,placeholderData:Ve,refetchInterval:pt},e[20]=ie,e[21]=ce,e[22]=X):X=e[22];const a=Ue(X),n=(ge=a.data)==null?void 0:ge.items,A=!!(T.before||T.after),ue=a.isFetchedAfterMount&&(a.isPlaceholderData||a.isLoading);let J;e[23]!==ue||e[24]!==n||e[25]!==a.isLoadingError?(J=ue?"error":et({data:n,isError:a.isLoadingError}),e[23]=ue,e[24]=n,e[25]=a.isLoadingError,e[26]=J):J=e[26];const L=J,be=Q.useRef(null),de=rt(L,be);let Y;e[27]!==l?(Y=function(N){l(C=>oe(oe(C,"before",N.before??null),"after",N.after??null))},e[27]=l,e[28]=Y):Y=e[28];const Z=Y;let ee;if(e[29]!==d||e[30]!==n){const r=d===void 0||(pe=n==null?void 0:n.find(N=>{var C;return((C=N.build)==null?void 0:C.id)===d}))==null?void 0:pe.build;ee=d===void 0?null:r?$e(r):`build ${d}`,e[29]=d,e[30]=n,e[31]=ee}else ee=e[31];const M=ee;let te;e[32]===Symbol.for("react.memo_cache_sentinel")?(te=s.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:"Flow Runs"}),e[32]=te):te=e[32];let B;e[33]!==f?(B=r=>f("source",r==="ci"?null:r),e[33]=f,e[34]=B):B=e[34];let se;e[35]===Symbol.for("react.memo_cache_sentinel")?(se=s.jsxs(Me,{"aria-label":"Where the run came from",children:[s.jsx(me,{ref:be,value:"all",children:"All"}),s.jsx(me,{value:"ci",children:"CI"}),s.jsx(me,{value:"local",children:"Local"})]}),e[35]=se):se=e[35];let D;e[36]!==o||e[37]!==B?(D=s.jsx(Qe,{value:o,onValueChange:B,children:se}),e[36]=o,e[37]=B,e[38]=D):D=e[38];const fe=u??"any";let F;e[39]!==f?(F=r=>f("status",r==="any"?null:r),e[39]=f,e[40]=F):F=e[40];let le;e[41]===Symbol.for("react.memo_cache_sentinel")?(le=s.jsx(Xe,{className:"h-8 w-36","aria-label":"Status",children:s.jsx(Je,{})}),e[41]=le):le=e[41];let ae;e[42]===Symbol.for("react.memo_cache_sentinel")?(ae=s.jsxs(Ye,{children:[s.jsx(De,{value:"any",children:"Any status"}),Ae.map(gt)]}),e[42]=ae):ae=e[42];let $;e[43]!==fe||e[44]!==F?($=s.jsxs(Ze,{value:fe,onValueChange:F,children:[le,ae]}),e[43]=fe,e[44]=F,e[45]=$):$=e[45];let k;e[46]!==m||e[47]!==v?(k=s.jsx(ze,{value:m,onChange:v,placeholder:"Flow name","aria-label":"Flow name"}),e[46]=m,e[47]=v,e[48]=k):k=e[48];let I;e[49]!==M||e[50]!==f?(I=M&&s.jsxs(Be,{variant:"outline",className:"gap-1 pr-1 text-xs font-normal",children:[M,s.jsx(Ee,{variant:"ghost",size:"icon-sm",className:"h-5 w-5","aria-label":`Show runs of every build, not only ${M}`,onClick:()=>f("build",null),children:s.jsx(We,{className:"h-3 w-3","aria-hidden":!0})})]}),e[49]=M,e[50]=f,e[51]=I):I=e[51];let K;e[52]!==D||e[53]!==$||e[54]!==k||e[55]!==I?(K=s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[D,$,k,I]}),e[52]=D,e[53]=$,e[54]=k,e[55]=I,e[56]=K):K=e[56];let re;e[57]===Symbol.for("react.memo_cache_sentinel")?(re=s.jsx(lt,{children:s.jsxs(Fe,{children:[s.jsx(z,{children:"Status"}),s.jsx(z,{children:"Build"}),s.jsx(z,{children:"Flows passed"}),s.jsx(z,{children:"Source"}),s.jsx(z,{children:"Started"}),s.jsx(z,{children:"Duration"})]})}),e[57]=re):re=e[57];let O;e[58]!==d||e[59]!==i||e[60]!==A||e[61]!==o||e[62]!==u?(O=A?"No runs on this page any more. Newer goes back to the newest runs.":wt(o,!!(u||i||d!==void 0)),e[58]=d,e[59]=i,e[60]=A,e[61]=o,e[62]=u,e[63]=O):O=e[63];let U;e[64]!==a?(U=()=>void a.refetch(),e[64]=a,e[65]=U):U=e[65];let q;e[66]!==O||e[67]!==U||e[68]!==L?(q=s.jsx(at,{view:L,colSpan:6,rowHeight:54,noun:"flow runs",emptyText:O,onRetry:U}),e[66]=O,e[67]=U,e[68]=L,e[69]=q):q=e[69];let G;e[70]!==n||e[71]!==L?(G=L==="list"&&(n==null?void 0:n.map(bt)),e[70]=n,e[71]=L,e[72]=G):G=e[72];let H;e[73]!==de||e[74]!==a.isPlaceholderData||e[75]!==q||e[76]!==G?(H=s.jsx("div",{className:"rounded-md border bg-card",children:s.jsxs(tt,{children:[re,s.jsxs(st,{...de,"aria-busy":a.isPlaceholderData,children:[q,G]})]})}),e[73]=de,e[74]=a.isPlaceholderData,e[75]=q,e[76]=G,e[77]=H):H=e[77];let V;e[78]!==Z||e[79]!==A||e[80]!==(n==null?void 0:n.length)||e[81]!==((je=a.data)==null?void 0:je.nextCursor)||e[82]!==((we=a.data)==null?void 0:we.prevCursor)||e[83]!==a.isPlaceholderData?(V=(A||((Se=a.data)==null?void 0:Se.prevCursor)||((ve=a.data)==null?void 0:ve.nextCursor))&&s.jsxs("nav",{"aria-label":"Pages of flow runs",className:"flex items-center justify-end gap-2",children:[s.jsxs(_e,{cursor:a.isPlaceholderData?null:((Ne=a.data)==null?void 0:Ne.prevCursor)??(A&&!(n!=null&&n.length)?Le:null),onGo:r=>Z(r===Le?{}:{after:r}),children:[s.jsx(ht,{className:"mr-1 h-3.5 w-3.5","aria-hidden":!0}),"Newer"]}),s.jsxs(_e,{cursor:a.isPlaceholderData?null:((Te=a.data)==null?void 0:Te.nextCursor)??null,onGo:r=>Z({before:r}),children:["Older",s.jsx(qe,{className:"ml-1 h-3.5 w-3.5","aria-hidden":!0})]})]}),e[78]=Z,e[79]=A,e[80]=n==null?void 0:n.length,e[81]=(ye=a.data)==null?void 0:ye.nextCursor,e[82]=(Pe=a.data)==null?void 0:Pe.prevCursor,e[83]=a.isPlaceholderData,e[84]=V):V=e[84];let ne;return e[85]!==K||e[86]!==H||e[87]!==V?(ne=s.jsxs("div",{className:"flex flex-col gap-5 p-6",children:[te,K,H,V]}),e[85]=K,e[86]=H,e[87]=V,e[88]=ne):ne=e[88],ne}function bt(e){return s.jsx(St,{run:e},e.id)}function gt(e){return s.jsx(De,{value:e,children:ct[e]},e)}function pt(e){var t;return ut((t=e.state.data)==null?void 0:t.items.map(jt))}function jt(e){return e.status}function oe(e,t,l){const c=new URLSearchParams(e);return t!=="before"&&t!=="after"&&(c.delete("before"),c.delete("after")),l===null?c.delete(t):c.set(t,l),c}function _e(e){const t=he.c(7),{cursor:l,onGo:c,children:o}=e,x=l===null;let u;t[0]!==l||t[1]!==c?(u=()=>{l!==null&&c(l)},t[0]=l,t[1]=c,t[2]=u):u=t[2];let h;return t[3]!==o||t[4]!==x||t[5]!==u?(h=s.jsx(Ee,{variant:"outline",size:"sm",className:"aria-disabled:opacity-50","aria-disabled":x,onClick:u,children:o}),t[3]=o,t[4]=x,t[5]=u,t[6]=h):h=t[6],h}function wt(e,t){return t?"No runs match these filters.":e==="ci"?"No CI runs yet. A run is recorded when tapflow flow run has a token.":e==="local"?"No local runs yet.":"No runs yet. A run is recorded when tapflow flow run has a token."}function St(e){const t=he.c(40),{run:l}=e,c=ft(),o=`/automation/runs/${l.id}`;let x;t[0]!==l.build?(x=$e(l.build),t[0]=l.build,t[1]=x):x=t[1];const u=x;let h;t[2]!==l.failureKind||t[3]!==l.status?(h=nt(l.status,l.failureKind),t[2]=l.failureKind,t[3]=l.status,t[4]=h):h=t[4];const b=h;let p;t[5]!==o||t[6]!==c?(p=P=>{var R;P.target.closest('a, button, input, [role="button"]')||(R=window.getSelection())!=null&&R.toString()||(P.metaKey||P.ctrlKey?window.open(o,"_blank","noopener"):c(o))},t[5]=o,t[6]=c,t[7]=p):p=t[7];let d;t[8]!==b.label||t[9]!==b.tone?(d=s.jsx(W,{children:s.jsx(Be,{tone:b.tone,className:"text-xs",children:b.label})}),t[8]=b.label,t[9]=b.tone,t[10]=d):d=t[10];const _=b.label;let i;t[11]!==l.createdAt?(i=Re(l.createdAt),t[11]=l.createdAt,t[12]=i):i=t[12];const T=`${u}, ${_}, ${i}`;let g;t[13]!==u||t[14]!==o||t[15]!==T?(g=s.jsx(W,{className:"text-sm",children:s.jsx(mt,{to:o,className:"rounded-sm font-medium underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":T,children:u})}),t[13]=u,t[14]=o,t[15]=T,t[16]=g):g=t[16];let j;t[17]!==l.flowsPassed||t[18]!==l.flowsTotal?(j=s.jsx(W,{children:s.jsxs(Ce,{children:[l.flowsPassed,"/",l.flowsTotal]})}),t[17]=l.flowsPassed,t[18]=l.flowsTotal,t[19]=j):j=t[19];let w;t[20]!==l?(w=ot(l),t[20]=l,t[21]=w):w=t[21];let S;t[22]!==w?(S=s.jsx(W,{className:"text-sm text-muted-foreground",children:w}),t[22]=w,t[23]=S):S=t[23];let f;t[24]!==l.createdAt?(f=Re(l.createdAt),t[24]=l.createdAt,t[25]=f):f=t[25];let m;t[26]!==f?(m=s.jsx(W,{className:"text-sm text-muted-foreground",children:f}),t[26]=f,t[27]=m):m=t[27];let v;t[28]!==l?(v=it(l),t[28]=l,t[29]=v):v=t[29];let y;t[30]!==v?(y=s.jsx(W,{children:s.jsx(Ce,{children:v})}),t[30]=v,t[31]=y):y=t[31];let E;return t[32]!==S||t[33]!==m||t[34]!==y||t[35]!==p||t[36]!==d||t[37]!==g||t[38]!==j?(E=s.jsxs(Fe,{className:"cursor-pointer",onClick:p,children:[d,g,j,S,m,y]}),t[32]=S,t[33]=m,t[34]=y,t[35]=p,t[36]=d,t[37]=g,t[38]=j,t[39]=E):E=t[39],E}export{Ft as Runs};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-DTSdA8m-.js";import{z as A,u as O,a as P,b as k,c as I,C as _,d as q,e as D,f as E,I as t,L as l,F as i,g as R,P as L,B as W,h as z,q as w,o as H,s as d,i as M,j as B,k as Q}from"./index-cgl1yEKu.js";import{F as K}from"./field-hint-B774BIWK.js";import{a as G,N as J}from"./vendor-router-B1pQim9Z.js";const U=H({email:d().email("Enter a valid email"),password:d().min(M,B),confirm:d()}).refine(a=>a.password===a.confirm,{message:"Passwords do not match",path:["confirm"]});function $(){var u,p,h,x,f,g;const a=G(),{resolvedTheme:y}=A(),N=y==="dark"?"/logo-dark.svg":"/logo.svg",{register:o,handleSubmit:v,setError:m,formState:{errors:s,isSubmitting:c,submitCount:b}}=O({shouldFocusError:!1,resolver:P(U)}),S=k(),n=I({queryKey:w.authStatus,queryFn:Q,staleTime:1/0});async function C(r){try{const j=await fetch("/api/v1/auth/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r.email,password:r.password})});if(!j.ok){const T=await j.json();m("root",{message:T.error??"Failed to create account"});return}S.setQueryData(w.authStatus,{initialized:!0}),a("/login",{replace:!0})}catch{m("root",{message:"Network error. Please try again."})}}if((u=n.data)!=null&&u.initialized)return e.jsx(J,{to:"/login",replace:!0});if(n.isPending)return null;const F=((p=n.data)==null?void 0:p.canInitialize)===!1;return e.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:N,alt:"tapflow",className:"w-6 h-6"}),e.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"})]}),e.jsxs(_,{level:4,className:"w-full",children:[e.jsx(q,{className:"text-center",children:e.jsx(D,{className:"text-2xl tracking-display-md",children:"Set up tapflow"})}),e.jsx(E,{children:F?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{id:"setup-remote-command",className:"text-sm text-muted-foreground",children:"The admin account can only be created on the machine running the relay. Run this there, then reload this page:"}),e.jsx(t,{readOnly:!0,value:"tapflow admin init","aria-labelledby":"setup-remote-command",onFocus:r=>r.currentTarget.select(),className:"font-mono"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Running the relay in Docker? Set ",e.jsx("code",{className:"text-xs",children:"TAPFLOW_ADMIN_EMAIL"})," and ",e.jsx("code",{className:"text-xs",children:"TAPFLOW_ADMIN_PASSWORD"})," on the container and recreate it, e.g. with ",e.jsx("code",{className:"text-xs",children:"docker compose up -d"}),". A restart keeps the old environment."]})]}):e.jsxs("form",{onSubmit:v(C),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"email",children:"Admin email"}),e.jsx(t,{id:"email",type:"email",placeholder:"admin@yourteam.com",autoComplete:"email","aria-required":"true","aria-invalid":!!s.email,"aria-describedby":s.email?"email-error":void 0,...o("email")}),e.jsx(i,{id:"email-error",message:(h=s.email)==null?void 0:h.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"password",children:"Password"}),e.jsx(t,{id:"password",type:"password",autoComplete:"new-password","aria-required":"true","aria-invalid":!!s.password,"aria-describedby":R("password-hint","password-error",!!s.password),...o("password")}),!s.password&&e.jsx(K,{id:"password-hint",children:L}),e.jsx(i,{id:"password-error",message:(x=s.password)==null?void 0:x.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"confirm",children:"Confirm password"}),e.jsx(t,{id:"confirm",type:"password",autoComplete:"new-password","aria-required":"true","aria-invalid":!!s.confirm,"aria-describedby":s.confirm?"confirm-error":void 0,...o("confirm")}),e.jsx(i,{id:"confirm-error",message:(f=s.confirm)==null?void 0:f.message})]}),e.jsx(i,{assertive:!0,id:"setup-error",message:(g=s.root)==null?void 0:g.message}),e.jsx(W,{type:"submit",size:"lg",disabled:c,className:"w-full mt-1",children:c?"Creating account…":"Create admin account"}),e.jsx(z,{errors:s,submitCount:b})]})})]})]})})}export{$ as Setup};
1
+ import{j as e}from"./vendor-react-DTSdA8m-.js";import{z as A,u as O,a as P,b as k,c as I,C as _,d as q,e as D,f as E,I as t,L as l,F as i,g as R,P as L,B as W,h as z,q as w,o as H,s as d,i as M,j as B,k as Q}from"./index-Bixhy5MB.js";import{F as K}from"./field-hint-B9fPUgi7.js";import{a as G,N as J}from"./vendor-router-B1pQim9Z.js";const U=H({email:d().email("Enter a valid email"),password:d().min(M,B),confirm:d()}).refine(a=>a.password===a.confirm,{message:"Passwords do not match",path:["confirm"]});function $(){var u,p,h,x,f,g;const a=G(),{resolvedTheme:y}=A(),N=y==="dark"?"/logo-dark.svg":"/logo.svg",{register:o,handleSubmit:v,setError:m,formState:{errors:s,isSubmitting:c,submitCount:b}}=O({shouldFocusError:!1,resolver:P(U)}),S=k(),n=I({queryKey:w.authStatus,queryFn:Q,staleTime:1/0});async function C(r){try{const j=await fetch("/api/v1/auth/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r.email,password:r.password})});if(!j.ok){const T=await j.json();m("root",{message:T.error??"Failed to create account"});return}S.setQueryData(w.authStatus,{initialized:!0}),a("/login",{replace:!0})}catch{m("root",{message:"Network error. Please try again."})}}if((u=n.data)!=null&&u.initialized)return e.jsx(J,{to:"/login",replace:!0});if(n.isPending)return null;const F=((p=n.data)==null?void 0:p.canInitialize)===!1;return e.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:N,alt:"tapflow",className:"w-6 h-6"}),e.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"})]}),e.jsxs(_,{level:4,className:"w-full",children:[e.jsx(q,{className:"text-center",children:e.jsx(D,{className:"text-2xl tracking-display-md",children:"Set up tapflow"})}),e.jsx(E,{children:F?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{id:"setup-remote-command",className:"text-sm text-muted-foreground",children:"The admin account can only be created on the machine running the relay. Run this there, then reload this page:"}),e.jsx(t,{readOnly:!0,value:"tapflow admin init","aria-labelledby":"setup-remote-command",onFocus:r=>r.currentTarget.select(),className:"font-mono"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Running the relay in Docker? Set ",e.jsx("code",{className:"text-xs",children:"TAPFLOW_ADMIN_EMAIL"})," and ",e.jsx("code",{className:"text-xs",children:"TAPFLOW_ADMIN_PASSWORD"})," on the container and recreate it, e.g. with ",e.jsx("code",{className:"text-xs",children:"docker compose up -d"}),". A restart keeps the old environment."]})]}):e.jsxs("form",{onSubmit:v(C),className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"email",children:"Admin email"}),e.jsx(t,{id:"email",type:"email",placeholder:"admin@yourteam.com",autoComplete:"email","aria-required":"true","aria-invalid":!!s.email,"aria-describedby":s.email?"email-error":void 0,...o("email")}),e.jsx(i,{id:"email-error",message:(h=s.email)==null?void 0:h.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"password",children:"Password"}),e.jsx(t,{id:"password",type:"password",autoComplete:"new-password","aria-required":"true","aria-invalid":!!s.password,"aria-describedby":R("password-hint","password-error",!!s.password),...o("password")}),!s.password&&e.jsx(K,{id:"password-hint",children:L}),e.jsx(i,{id:"password-error",message:(x=s.password)==null?void 0:x.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(l,{htmlFor:"confirm",children:"Confirm password"}),e.jsx(t,{id:"confirm",type:"password",autoComplete:"new-password","aria-required":"true","aria-invalid":!!s.confirm,"aria-describedby":s.confirm?"confirm-error":void 0,...o("confirm")}),e.jsx(i,{id:"confirm-error",message:(f=s.confirm)==null?void 0:f.message})]}),e.jsx(i,{assertive:!0,id:"setup-error",message:(g=s.root)==null?void 0:g.message}),e.jsx(W,{type:"submit",size:"lg",disabled:c,className:"w-full mt-1",children:c?"Creating account…":"Create admin account"}),e.jsx(z,{errors:s,submitCount:b})]})})]})]})})}export{$ as Setup};
@@ -1,6 +1,6 @@
1
- import{r as a,j as e,c as je}from"./vendor-react-DTSdA8m-.js";import{G as ve,b as fe,c as ge,u as be,a as ye,B as k,L as _,I as ee,F as H,n as ke,h as Ce,C as we,d as Se,e as De,f as Te,H as h,o as E,s as C,q as Q,aH as se,aI as Ne}from"./index-cgl1yEKu.js";import{d as V,c as q,a as M,b as B,e as Re,D as Ae}from"./dialog-CtzPkg0O.js";import{g as Ee,d as Ie,A as $e,a as Fe,b as Oe,e as Le,c as Pe,f as _e}from"./alert-dialog-Bq_Ln5bp.js";import{d as U,S as z,a as J,b as K,c as x}from"./select-5ZtzWRYG.js";import{l as He,T as Qe,c as Ve,d as G,e as S,a as qe,L as Me,b as D}from"./list-view-BcjDCJy5.js";import{j as W,l as X}from"./publicLink-D6zKS_wu.js";import{u as Be}from"./useFocusAfterSwap-BdItkQCu.js";import"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";import"./useShownAfter-By1Yxysz.js";/**
1
+ import{r as a,j as e,c as je}from"./vendor-react-DTSdA8m-.js";import{G as ve,b as fe,c as ge,u as be,a as ye,B as k,L as _,I as ee,F as Q,n as ke,h as Ce,C as we,d as Se,e as De,f as Te,H as h,o as E,s as C,q as V,aJ as se,aK as Ne}from"./index-Bixhy5MB.js";import{d as q,c as H,a as M,b as B,e as Re,D as Ae}from"./dialog-BOFZkCES.js";import{g as Ee,d as Ie,A as $e,a as Fe,b as Oe,e as Le,c as Pe,f as _e}from"./alert-dialog-t5vlOabq.js";import{d as U,S as z,a as J,b as K,c as x}from"./select-DDzv2YfY.js";import{l as Qe,T as Ve,c as qe,d as G,e as S,a as He,L as Me,b as D}from"./list-view-BpOY1e-d.js";import{j as W,l as X}from"./publicLink-D6zKS_wu.js";import{u as Be}from"./useFocusAfterSwap-BdItkQCu.js";import"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";import"./useShownAfter-By1Yxysz.js";/**
2
2
  * @license lucide-react v1.58.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const te={name:"user-plus",size:24,node:[["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"}]]};te.node;const Ue=ve(te),ze=E({email:C().email("Enter a valid email"),role:C().min(1,"Pick a role")}),Je=E({token:C(),emailSent:se(),inviteUrl:C().nullable()}),Ke=E({token:C(),emailSent:se(),resetUrl:C().nullable()});function Y(p){return(navigator.clipboard?navigator.clipboard.writeText(p):Promise.reject(new Error("no clipboard"))).then(()=>!0,()=>!1)}function Z(p){const s=je.c(15),{link:r,copied:f,noun:m}=p,u=a.useId(),n=a.useRef(null);let g;s[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{var T;(T=n.current)==null||T.focus()},s[0]=g):g=s[0];let b;s[1]!==r?(b=[r],s[1]=r,s[2]=b):b=s[2],a.useEffect(g,b);let l;s[3]!==f||s[4]!==m?(l=f?`${m[0].toUpperCase()}${m.slice(1)} copied to clipboard:`:`Copy this ${m}:`,s[3]=f,s[4]=m,s[5]=l):l=s[5];let o;s[6]!==u||s[7]!==l?(o=e.jsx("p",{id:u,className:"text-sm text-muted-foreground",children:l}),s[6]=u,s[7]=l,s[8]=o):o=s[8];let c;s[9]!==u||s[10]!==r?(c=e.jsx(ee,{ref:n,readOnly:!0,value:r,"aria-labelledby":u,onFocus:Ge,className:"font-mono"}),s[9]=u,s[10]=r,s[11]=c):c=s[11];let j;return s[12]!==o||s[13]!==c?(j=e.jsxs(e.Fragment,{children:[o,c]}),s[12]=o,s[13]=c,s[14]=j):j=s[14],j}function Ge(p){return p.currentTarget.select()}function rs(){var L,P;const p=fe(),s=ge({queryKey:Q.teamMembers,queryFn:Ne}),r=s.data??[],f=He(s),m=a.useRef(null),u=Be(f,m),[n,g]=a.useState(null),[b,l]=a.useState(!1),o=a.useRef(null),[c,j]=a.useState(""),[T,I]=a.useState(!1),[ie,N]=a.useState(""),[ne,ae]=a.useState(!1),[R,A]=a.useState(null),{register:le,handleSubmit:re,control:oe,reset:ce,setError:de,formState:{errors:v,isSubmitting:$,submitCount:me}}=be({shouldFocusError:!1,resolver:ye(ze),defaultValues:{email:"",role:"QA"}}),F=()=>{p.invalidateQueries({queryKey:Q.teamMembers})};async function ue(t){N("");try{const i=await fetch("/api/v1/team/invite",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.email,role:t.role})});if(i.status===409){de("email",{message:"Already a member. Change their role in the list instead."});return}if(!i.ok)throw new Error(`Server error: ${i.status}`);const d=Je.parse(await i.json()),w=d.inviteUrl??W((await X()).linkBase,`/invite?token=${d.token}`),y=await Y(w);j(w),I(y),N(`${d.emailSent?`Invite email sent to ${t.email}.`:"Email could not be sent."} ${y?"Invite link copied to clipboard.":"Copy the invite link."}`),d.emailSent?h.success(`Invite email sent to ${t.email}`):y?h.warning("Invite link copied — email could not be sent. Check your SMTP settings."):h.warning("Email could not be sent. Copy the invite link from the dialog, and check your SMTP settings.")}catch{h.error("Failed to create invite link"),N("Failed to create invite link.")}}function O(t){ae(t),t&&(j(""),I(!1),N(""),ce())}async function he(t,i){await fetch(`/api/v1/team/members/${t}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:i})}),F()}async function xe(t){try{const i=await fetch(`/api/v1/team/members/${t.id}/send-reset`,{method:"POST",credentials:"include"});if(!i.ok)throw new Error(`Server error: ${i.status}`);const d=Ke.parse(await i.json()),w=d.resetUrl??W((await X()).linkBase,`/reset-password?token=${d.token}`),y=await Y(w);g({email:t.email,link:w,copied:y,emailSent:d.emailSent}),l(!0),d.emailSent?h.success(`Reset email sent to ${t.email}`):y?h.warning("Reset link copied — email could not be sent. Send the link to the member yourself."):h.warning("Email could not be sent. Copy the reset link from the dialog and send it to the member.")}catch{h.error("Failed to create reset link")}}async function pe(t){await fetch(`/api/v1/team/members/${t}`,{method:"DELETE",credentials:"include"}),A(null),F()}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsx(Ee,{open:R!==null,onOpenChange:t=>{t||A(null)},children:e.jsxs(Ie,{children:[e.jsxs($e,{children:[e.jsx(Fe,{children:"Remove this member?"}),e.jsx(Oe,{children:"This member will lose access to the team immediately."})]}),e.jsxs(Le,{children:[e.jsx(Pe,{children:"Cancel"}),e.jsx(_e,{className:"bg-destructive/10 text-destructive hover:bg-destructive/20 border-0",onClick:()=>R!==null&&pe(R),children:"Remove"})]})]})}),e.jsx(V,{open:b,onOpenChange:l,children:e.jsxs(q,{className:"sm:max-w-md",onCloseAutoFocus:t=>{var i;t.preventDefault(),(i=o.current)==null||i.focus()},children:[e.jsxs(M,{children:[e.jsx(B,{children:"Password reset link"}),e.jsxs(Re,{children:[n!=null&&n.emailSent?`Reset email sent to ${n.email}.`:`Email could not be sent to ${(n==null?void 0:n.email)??""}.`," ","The link works once, for 2 hours. Making a new one turns this one off. Completing the reset signs the member out everywhere and revokes their personal access tokens, so agents using those tokens disconnect until new ones are issued."]})]}),n&&e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx(Z,{link:n.link,copied:n.copied,noun:"reset link"}),e.jsx(k,{onClick:()=>l(!1),children:"Done"})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Team"}),e.jsxs(V,{open:ne,onOpenChange:O,children:[e.jsx(Ae,{asChild:!0,children:e.jsxs(k,{ref:m,size:"sm",children:[e.jsx(Ue,{className:"mr-2 h-4 w-4"}),"Invite member"]})}),e.jsxs(q,{className:"sm:max-w-md",children:[e.jsx(M,{children:e.jsx(B,{children:"Invite team member"})}),e.jsx("p",{role:"status",className:"sr-only",children:ie}),c?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx(Z,{link:c,copied:T,noun:"invite link"}),e.jsx(k,{onClick:()=>O(!1),children:"Done"})]}):e.jsxs("form",{onSubmit:re(ue),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(_,{htmlFor:"invite-email",children:"Email"}),e.jsx(ee,{id:"invite-email",type:"email","aria-required":"true","aria-invalid":!!v.email,"aria-describedby":v.email?"email-error":void 0,...le("email")}),e.jsx(H,{id:"email-error",message:(L=v.email)==null?void 0:L.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(_,{htmlFor:"invite-role",children:"Role"}),e.jsx(ke,{name:"role",control:oe,render:({field:t})=>e.jsxs(U,{value:t.value,onValueChange:t.onChange,children:[e.jsx(z,{id:"invite-role","aria-invalid":!!v.role,"aria-describedby":v.role?"role-error":void 0,children:e.jsx(J,{})}),e.jsxs(K,{children:[e.jsx(x,{value:"Admin",children:"Admin"}),e.jsx(x,{value:"Developer",children:"Developer"}),e.jsx(x,{value:"QA",children:"QA"}),e.jsx(x,{value:"Viewer",children:"Viewer"})]})]})}),e.jsx(H,{id:"role-error",message:(P=v.role)==null?void 0:P.message})]}),e.jsx(k,{type:"submit",disabled:$,children:$?"Creating link…":"Generate invite link"}),e.jsx(Ce,{errors:v,submitCount:me})]})]})]})]}),e.jsxs(we,{children:[e.jsx(Se,{children:e.jsxs(De,{children:["Members",s.data?` (${r.length})`:""]})}),e.jsx(Te,{className:"px-4 pt-0 pb-2",children:e.jsxs(Qe,{children:[e.jsx(Ve,{children:e.jsxs(G,{children:[e.jsx(S,{children:"Nickname"}),e.jsx(S,{children:"Email"}),e.jsx(S,{children:"Role"}),e.jsx(S,{children:"Joined"}),e.jsx(S,{className:"w-10"})]})}),e.jsxs(qe,{...u,children:[e.jsx(Me,{view:f,colSpan:5,noun:"team members",emptyText:"No members yet.",onRetry:()=>{s.refetch()}}),r.map(t=>e.jsxs(G,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"font-medium",children:t.display_name||"—"}),e.jsx(D,{className:"text-muted-foreground text-sm",children:t.email}),e.jsx(D,{children:e.jsxs(U,{value:t.role,onValueChange:i=>he(t.id,i),children:[e.jsx(z,{className:"h-7 w-28",children:e.jsx(J,{})}),e.jsxs(K,{children:[e.jsx(x,{value:"Admin",children:"Admin"}),e.jsx(x,{value:"Developer",children:"Developer"}),e.jsx(x,{value:"QA",children:"QA"}),e.jsx(x,{value:"Viewer",children:"Viewer"})]})]})}),e.jsx(D,{className:"text-muted-foreground text-sm",children:new Date(t.joined_at).toLocaleDateString()}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{variant:"secondary",size:"nav",onClick:i=>{o.current=i.currentTarget,xe(t)},children:"Reset pwd"}),e.jsx(k,{variant:"destructive",size:"nav",onClick:()=>A(t.id),children:"Remove"})]})})]},t.id))]})]})})]})]})}export{rs as TeamSettings};
6
+ */const te={name:"user-plus",size:24,node:[["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"}]]};te.node;const Ue=ve(te),ze=E({email:C().email("Enter a valid email"),role:C().min(1,"Pick a role")}),Je=E({token:C(),emailSent:se(),inviteUrl:C().nullable()}),Ke=E({token:C(),emailSent:se(),resetUrl:C().nullable()});function Y(p){return(navigator.clipboard?navigator.clipboard.writeText(p):Promise.reject(new Error("no clipboard"))).then(()=>!0,()=>!1)}function Z(p){const s=je.c(15),{link:r,copied:f,noun:m}=p,u=a.useId(),n=a.useRef(null);let g;s[0]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{var T;(T=n.current)==null||T.focus()},s[0]=g):g=s[0];let b;s[1]!==r?(b=[r],s[1]=r,s[2]=b):b=s[2],a.useEffect(g,b);let l;s[3]!==f||s[4]!==m?(l=f?`${m[0].toUpperCase()}${m.slice(1)} copied to clipboard:`:`Copy this ${m}:`,s[3]=f,s[4]=m,s[5]=l):l=s[5];let o;s[6]!==u||s[7]!==l?(o=e.jsx("p",{id:u,className:"text-sm text-muted-foreground",children:l}),s[6]=u,s[7]=l,s[8]=o):o=s[8];let c;s[9]!==u||s[10]!==r?(c=e.jsx(ee,{ref:n,readOnly:!0,value:r,"aria-labelledby":u,onFocus:Ge,className:"font-mono"}),s[9]=u,s[10]=r,s[11]=c):c=s[11];let j;return s[12]!==o||s[13]!==c?(j=e.jsxs(e.Fragment,{children:[o,c]}),s[12]=o,s[13]=c,s[14]=j):j=s[14],j}function Ge(p){return p.currentTarget.select()}function rs(){var L,P;const p=fe(),s=ge({queryKey:V.teamMembers,queryFn:Ne}),r=s.data??[],f=Qe(s),m=a.useRef(null),u=Be(f,m),[n,g]=a.useState(null),[b,l]=a.useState(!1),o=a.useRef(null),[c,j]=a.useState(""),[T,I]=a.useState(!1),[ie,N]=a.useState(""),[ne,ae]=a.useState(!1),[R,A]=a.useState(null),{register:le,handleSubmit:re,control:oe,reset:ce,setError:de,formState:{errors:v,isSubmitting:$,submitCount:me}}=be({shouldFocusError:!1,resolver:ye(ze),defaultValues:{email:"",role:"QA"}}),F=()=>{p.invalidateQueries({queryKey:V.teamMembers})};async function ue(t){N("");try{const i=await fetch("/api/v1/team/invite",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.email,role:t.role})});if(i.status===409){de("email",{message:"Already a member. Change their role in the list instead."});return}if(!i.ok)throw new Error(`Server error: ${i.status}`);const d=Je.parse(await i.json()),w=d.inviteUrl??W((await X()).linkBase,`/invite?token=${d.token}`),y=await Y(w);j(w),I(y),N(`${d.emailSent?`Invite email sent to ${t.email}.`:"Email could not be sent."} ${y?"Invite link copied to clipboard.":"Copy the invite link."}`),d.emailSent?h.success(`Invite email sent to ${t.email}`):y?h.warning("Invite link copied — email could not be sent. Check your SMTP settings."):h.warning("Email could not be sent. Copy the invite link from the dialog, and check your SMTP settings.")}catch{h.error("Failed to create invite link"),N("Failed to create invite link.")}}function O(t){ae(t),t&&(j(""),I(!1),N(""),ce())}async function he(t,i){await fetch(`/api/v1/team/members/${t}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:i})}),F()}async function xe(t){try{const i=await fetch(`/api/v1/team/members/${t.id}/send-reset`,{method:"POST",credentials:"include"});if(!i.ok)throw new Error(`Server error: ${i.status}`);const d=Ke.parse(await i.json()),w=d.resetUrl??W((await X()).linkBase,`/reset-password?token=${d.token}`),y=await Y(w);g({email:t.email,link:w,copied:y,emailSent:d.emailSent}),l(!0),d.emailSent?h.success(`Reset email sent to ${t.email}`):y?h.warning("Reset link copied — email could not be sent. Send the link to the member yourself."):h.warning("Email could not be sent. Copy the reset link from the dialog and send it to the member.")}catch{h.error("Failed to create reset link")}}async function pe(t){await fetch(`/api/v1/team/members/${t}`,{method:"DELETE",credentials:"include"}),A(null),F()}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsx(Ee,{open:R!==null,onOpenChange:t=>{t||A(null)},children:e.jsxs(Ie,{children:[e.jsxs($e,{children:[e.jsx(Fe,{children:"Remove this member?"}),e.jsx(Oe,{children:"This member will lose access to the team immediately."})]}),e.jsxs(Le,{children:[e.jsx(Pe,{children:"Cancel"}),e.jsx(_e,{className:"bg-destructive/10 text-destructive hover:bg-destructive/20 border-0",onClick:()=>R!==null&&pe(R),children:"Remove"})]})]})}),e.jsx(q,{open:b,onOpenChange:l,children:e.jsxs(H,{className:"sm:max-w-md",onCloseAutoFocus:t=>{var i;t.preventDefault(),(i=o.current)==null||i.focus()},children:[e.jsxs(M,{children:[e.jsx(B,{children:"Password reset link"}),e.jsxs(Re,{children:[n!=null&&n.emailSent?`Reset email sent to ${n.email}.`:`Email could not be sent to ${(n==null?void 0:n.email)??""}.`," ","The link works once, for 2 hours. Making a new one turns this one off. Completing the reset signs the member out everywhere and revokes their personal access tokens, so agents using those tokens disconnect until new ones are issued."]})]}),n&&e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx(Z,{link:n.link,copied:n.copied,noun:"reset link"}),e.jsx(k,{onClick:()=>l(!1),children:"Done"})]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Team"}),e.jsxs(q,{open:ne,onOpenChange:O,children:[e.jsx(Ae,{asChild:!0,children:e.jsxs(k,{ref:m,size:"sm",children:[e.jsx(Ue,{className:"mr-2 h-4 w-4"}),"Invite member"]})}),e.jsxs(H,{className:"sm:max-w-md",children:[e.jsx(M,{children:e.jsx(B,{children:"Invite team member"})}),e.jsx("p",{role:"status",className:"sr-only",children:ie}),c?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx(Z,{link:c,copied:T,noun:"invite link"}),e.jsx(k,{onClick:()=>O(!1),children:"Done"})]}):e.jsxs("form",{onSubmit:re(ue),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(_,{htmlFor:"invite-email",children:"Email"}),e.jsx(ee,{id:"invite-email",type:"email","aria-required":"true","aria-invalid":!!v.email,"aria-describedby":v.email?"email-error":void 0,...le("email")}),e.jsx(Q,{id:"email-error",message:(L=v.email)==null?void 0:L.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(_,{htmlFor:"invite-role",children:"Role"}),e.jsx(ke,{name:"role",control:oe,render:({field:t})=>e.jsxs(U,{value:t.value,onValueChange:t.onChange,children:[e.jsx(z,{id:"invite-role","aria-invalid":!!v.role,"aria-describedby":v.role?"role-error":void 0,children:e.jsx(J,{})}),e.jsxs(K,{children:[e.jsx(x,{value:"Admin",children:"Admin"}),e.jsx(x,{value:"Developer",children:"Developer"}),e.jsx(x,{value:"QA",children:"QA"}),e.jsx(x,{value:"Viewer",children:"Viewer"})]})]})}),e.jsx(Q,{id:"role-error",message:(P=v.role)==null?void 0:P.message})]}),e.jsx(k,{type:"submit",disabled:$,children:$?"Creating link…":"Generate invite link"}),e.jsx(Ce,{errors:v,submitCount:me})]})]})]})]}),e.jsxs(we,{children:[e.jsx(Se,{children:e.jsxs(De,{children:["Members",s.data?` (${r.length})`:""]})}),e.jsx(Te,{className:"px-4 pt-0 pb-2",children:e.jsxs(Ve,{children:[e.jsx(qe,{children:e.jsxs(G,{children:[e.jsx(S,{children:"Nickname"}),e.jsx(S,{children:"Email"}),e.jsx(S,{children:"Role"}),e.jsx(S,{children:"Joined"}),e.jsx(S,{className:"w-10"})]})}),e.jsxs(He,{...u,children:[e.jsx(Me,{view:f,colSpan:5,noun:"team members",emptyText:"No members yet.",onRetry:()=>{s.refetch()}}),r.map(t=>e.jsxs(G,{className:"hover:bg-transparent",children:[e.jsx(D,{className:"font-medium",children:t.display_name||"—"}),e.jsx(D,{className:"text-muted-foreground text-sm",children:t.email}),e.jsx(D,{children:e.jsxs(U,{value:t.role,onValueChange:i=>he(t.id,i),children:[e.jsx(z,{className:"h-7 w-28",children:e.jsx(J,{})}),e.jsxs(K,{children:[e.jsx(x,{value:"Admin",children:"Admin"}),e.jsx(x,{value:"Developer",children:"Developer"}),e.jsx(x,{value:"QA",children:"QA"}),e.jsx(x,{value:"Viewer",children:"Viewer"})]})]})}),e.jsx(D,{className:"text-muted-foreground text-sm",children:new Date(t.joined_at).toLocaleDateString()}),e.jsx(D,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{variant:"secondary",size:"nav",onClick:i=>{o.current=i.currentTarget,xe(t)},children:"Reset pwd"}),e.jsx(k,{variant:"destructive",size:"nav",onClick:()=>A(t.id),children:"Remove"})]})})]},t.id))]})]})})]})]})}export{rs as TeamSettings};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./vendor-react-DTSdA8m-.js";import{b as ce,R as de,c as xe,u as ue,a as me,l as pe,B as u,I as j,H as n,L as y,F as K,n as he,h as je,C as ye,d as ge,e as fe,m as ve,f as ke,o as be,aJ as Ne,s as Q,q as z,aK as we}from"./index-cgl1yEKu.js";import{B as N}from"./badge-D-bt97WR.js";import{g as Ce,d as Te,A as De,a as Se,b as Ae,e as Fe,c as Ie}from"./alert-dialog-Bq_Ln5bp.js";import{d as Re,D as Ee,c as Be,a as Pe,b as Le}from"./dialog-CtzPkg0O.js";import{d as $,S as J,a as M,b as G,c as m}from"./select-5ZtzWRYG.js";import{l as qe,T as Oe,c as He,d as U,e as p,a as Ve,L as We,b as h}from"./list-view-BcjDCJy5.js";import{l as _e}from"./publicLink-D6zKS_wu.js";import{u as Ke}from"./useFocusAfterSwap-BdItkQCu.js";import{P as Qe,T as ze}from"./trash-CXjB9oU1.js";import"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";import"./useShownAfter-By1Yxysz.js";const X=["7","30","60","90"],$e=be({name:Q().min(1,"Give the token a name"),expiry:Ne([...X,"custom","never"]),expiresDays:Q()}).superRefine((r,g)=>{if(r.expiry!=="custom")return;const o=Number(r.expiresDays);(!Number.isInteger(o)||o<1||o>365)&&g.addIssue({code:"custom",path:["expiresDays"],message:"Must be between 1 and 365"})});function Je(r){if(r.expiry!=="never")return Number(r.expiry==="custom"?r.expiresDays:r.expiry)}function is(){var V,W,_;const r=ce(),g=((V=de().user)==null?void 0:V.role)==="Admin",o=xe({queryKey:z.tokens,queryFn:we}),Y=o.data??[],w=qe(o),C=a.useRef(null),Z=Ke(w,C),[ee,se]=a.useState(!1),[l,T]=a.useState(""),[x,D]=a.useState("api"),[S,A]=a.useState(""),[f,v]=a.useState(null),F=a.useId(),I=a.useId(),k=a.useRef(null),[ae,c]=a.useState(""),R=a.useId(),{register:E,control:B,handleSubmit:re,reset:te,formState:{errors:i,isSubmitting:P,submitCount:ne}}=ue({shouldFocusError:!1,resolver:me($e),defaultValues:{name:"",expiry:"30",expiresDays:"30"}}),L=pe({control:B,name:"expiry"}),q=()=>{r.invalidateQueries({queryKey:z.tokens})};a.useEffect(()=>{var s;l&&((s=k.current)==null||s.focus())},[l]);async function oe(s){c("");try{const t=Je(s),b=await fetch("/api/v1/tokens",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.name,...t!==void 0?{expires_in_days:t}:{},...x==="agent"?{scope:"agent"}:{}})});if(!b.ok){const d=await b.json().catch(()=>null);n.error((d==null?void 0:d.error)??"Failed to create token"),c((d==null?void 0:d.error)??"Failed to create token");return}const le=await b.json();x==="agent"&&A((await _e()).agentWsBase),n.success("Token created"),T(le.token),q()}catch{n.error("Network error"),c("Network error")}}function O(s){se(s),s&&(T(""),D("api"),A(""),c(""),te())}async function ie(s){try{return(await fetch(`/api/v1/tokens/${s}`,{method:"DELETE",credentials:"include"})).ok?(n.success("Token revoked"),q(),!0):(n.error("Failed to revoke token"),!1)}catch{return n.error("Network error"),!1}}function H(s){return s.expires_at&&new Date(s.expires_at)<new Date}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Personal Access Tokens"}),e.jsxs(Re,{open:ee,onOpenChange:O,children:[e.jsx(Ee,{asChild:!0,children:e.jsxs(u,{ref:C,size:"sm",children:[e.jsx(Qe,{className:"mr-2 h-4 w-4"}),"New token"]})}),e.jsxs(Be,{className:"sm:max-w-md",children:[e.jsx(Pe,{children:e.jsx(Le,{children:"Create token"})}),e.jsx("p",{role:"status",className:"sr-only",children:ae}),l?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{id:F,className:"text-sm text-muted-foreground",children:"Copy this token now — it won't be shown again."}),e.jsx(j,{ref:k,readOnly:!0,value:l,"aria-labelledby":F,onFocus:s=>s.currentTarget.select(),className:"font-mono"}),x==="agent"&&S&&e.jsxs(e.Fragment,{children:[e.jsx("p",{id:I,className:"text-sm text-muted-foreground",children:"Run this on the agent Mac to connect it to this relay:"}),e.jsx(j,{readOnly:!0,value:`tapflow agent start --relay ${S} --token ${l}`,"aria-labelledby":I,onFocus:s=>s.currentTarget.select(),className:"font-mono"})]}),e.jsx(u,{onClick:()=>{c(""),(navigator.clipboard?navigator.clipboard.writeText(l):Promise.reject(new Error("no clipboard"))).then(()=>{n.success("Token copied to clipboard"),O(!1)}).catch(()=>{var s;n.error("Failed to copy — copy manually"),c("Could not copy the token. Select it and copy it by hand."),(s=k.current)==null||s.focus()})},children:"Copy & close"})]}):e.jsxs("form",{onSubmit:re(oe),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-name",children:"Name"}),e.jsx(j,{id:"token-name",placeholder:"e.g. ci-deploy","aria-required":"true","aria-invalid":!!i.name,"aria-describedby":i.name?"name-error":void 0,...E("name")}),e.jsx(K,{id:"name-error",message:(W=i.name)==null?void 0:W.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-expiry",children:"Expiration"}),e.jsx(he,{control:B,name:"expiry",render:({field:s})=>e.jsxs($,{value:s.value,onValueChange:t=>s.onChange(t),children:[e.jsx(J,{id:"token-expiry",ref:s.ref,onBlur:s.onBlur,"aria-describedby":s.value==="never"?R:void 0,children:e.jsx(M,{})}),e.jsxs(G,{children:[X.map(t=>e.jsxs(m,{value:t,children:[t," days"]},t)),e.jsx(m,{value:"custom",children:"Custom…"}),e.jsx(m,{value:"never",children:"No expiration"})]})]})}),L==="never"&&e.jsx("p",{id:R,className:"text-sm text-amber-700 dark:text-amber-300",children:"A token without an expiry stays valid until you revoke it. For CI, 90 days or less is recommended."})]}),L==="custom"&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"expires",children:"Expires in (days)"}),e.jsx(j,{id:"expires",type:"number","aria-required":"true","aria-invalid":!!i.expiresDays,"aria-describedby":i.expiresDays?"expiresDays-error":void 0,...E("expiresDays")}),e.jsx(K,{id:"expiresDays-error",message:(_=i.expiresDays)==null?void 0:_.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-type",children:"Type"}),e.jsxs($,{value:x,onValueChange:s=>D(s),children:[e.jsx(J,{id:"token-type",children:e.jsx(M,{})}),e.jsxs(G,{children:[e.jsx(m,{value:"api",children:"API — CI uploads & API access"}),g&&e.jsx(m,{value:"agent",children:"Agent — connect remote device agents (Admin only)"})]})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Scope: ",e.jsx(N,{variant:"secondary",children:x==="agent"?"agent":"view, builds:write"})]}),e.jsx(u,{type:"submit",disabled:P,children:P?"Creating…":"Create token"}),e.jsx(je,{errors:i,submitCount:ne})]})]})]})]}),e.jsxs(ye,{children:[e.jsxs(ge,{children:[e.jsx(fe,{children:"Active tokens"}),e.jsxs(ve,{children:["Use these tokens with ",e.jsx("code",{className:"text-xs",children:"Authorization: Bearer <token>"})," for API deployments."]})]}),e.jsx(ke,{className:"px-4 pt-0 pb-2",children:e.jsxs(Oe,{children:[e.jsx(He,{children:e.jsxs(U,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Scope"}),e.jsx(p,{children:"Last used"}),e.jsx(p,{children:"Expires"}),e.jsx(p,{className:"w-10"})]})}),e.jsxs(Ve,{...Z,children:[e.jsx(We,{view:w,colSpan:5,noun:"tokens",emptyText:"No tokens yet.",onRetry:()=>{o.refetch()}}),Y.map(s=>e.jsxs(U,{className:"hover:bg-transparent",children:[e.jsx(h,{className:"font-medium",children:s.name}),e.jsx(h,{children:e.jsx(N,{variant:"secondary",children:s.scope})}),e.jsx(h,{className:"text-muted-foreground text-sm",children:s.last_used_at?new Date(s.last_used_at).toLocaleDateString():"Never"}),e.jsx(h,{children:s.expires_at?e.jsx("span",{className:H(s)?"text-destructive text-sm":"text-muted-foreground text-sm",children:H(s)?"Expired":new Date(s.expires_at).toLocaleDateString()}):e.jsx(N,{variant:"outline",children:"No expiration"})}),e.jsx(h,{children:e.jsx(u,{variant:"destructive",size:"icon",className:"h-7 w-7","aria-label":"Revoke token",onClick:()=>v(s.id),children:e.jsx(ze,{className:"h-4 w-4"})})})]},s.id))]})]})})]}),e.jsx(Ce,{open:f!==null,onOpenChange:s=>{s||v(null)},children:e.jsxs(Te,{children:[e.jsxs(De,{children:[e.jsx(Se,{children:"Revoke token?"}),e.jsx(Ae,{children:"Any active API calls using this token will immediately fail."})]}),e.jsxs(Fe,{children:[e.jsx(Ie,{children:"Cancel"}),e.jsx(u,{variant:"destructive",onClick:async()=>{if(f===null)return;await ie(f)&&v(null)},children:"Revoke"})]})]})})]})}export{is as TokenSettings};
1
+ import{r as a,j as e}from"./vendor-react-DTSdA8m-.js";import{b as ce,R as de,c as xe,u as ue,a as me,l as pe,B as u,I as j,H as n,L as y,F as Q,n as he,h as je,C as ye,d as ge,e as fe,m as ve,f as ke,o as be,aL as Ne,s as z,q as K,aM as we}from"./index-Bixhy5MB.js";import{B as N}from"./badge-DrDCTAQQ.js";import{g as Ce,d as Te,A as De,a as Se,b as Ae,e as Fe,c as Ie}from"./alert-dialog-t5vlOabq.js";import{d as Re,D as Ee,c as Be,a as Le,b as Pe}from"./dialog-BOFZkCES.js";import{d as M,S as $,a as G,b as J,c as m}from"./select-DDzv2YfY.js";import{l as qe,T as Oe,c as He,d as U,e as p,a as Ve,L as We,b as h}from"./list-view-BpOY1e-d.js";import{l as _e}from"./publicLink-D6zKS_wu.js";import{u as Qe}from"./useFocusAfterSwap-BdItkQCu.js";import{P as ze,T as Ke}from"./trash-Cwj2dbgB.js";import"./vendor-router-B1pQim9Z.js";import"./index-D17hSi50.js";import"./useShownAfter-By1Yxysz.js";const X=["7","30","60","90"],Me=be({name:z().min(1,"Give the token a name"),expiry:Ne([...X,"custom","never"]),expiresDays:z()}).superRefine((r,g)=>{if(r.expiry!=="custom")return;const o=Number(r.expiresDays);(!Number.isInteger(o)||o<1||o>365)&&g.addIssue({code:"custom",path:["expiresDays"],message:"Must be between 1 and 365"})});function $e(r){if(r.expiry!=="never")return Number(r.expiry==="custom"?r.expiresDays:r.expiry)}function is(){var V,W,_;const r=ce(),g=((V=de().user)==null?void 0:V.role)==="Admin",o=xe({queryKey:K.tokens,queryFn:we}),Y=o.data??[],w=qe(o),C=a.useRef(null),Z=Qe(w,C),[ee,se]=a.useState(!1),[l,T]=a.useState(""),[x,D]=a.useState("api"),[S,A]=a.useState(""),[f,v]=a.useState(null),F=a.useId(),I=a.useId(),k=a.useRef(null),[ae,c]=a.useState(""),R=a.useId(),{register:E,control:B,handleSubmit:re,reset:te,formState:{errors:i,isSubmitting:L,submitCount:ne}}=ue({shouldFocusError:!1,resolver:me(Me),defaultValues:{name:"",expiry:"30",expiresDays:"30"}}),P=pe({control:B,name:"expiry"}),q=()=>{r.invalidateQueries({queryKey:K.tokens})};a.useEffect(()=>{var s;l&&((s=k.current)==null||s.focus())},[l]);async function oe(s){c("");try{const t=$e(s),b=await fetch("/api/v1/tokens",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.name,...t!==void 0?{expires_in_days:t}:{},...x==="agent"?{scope:"agent"}:{}})});if(!b.ok){const d=await b.json().catch(()=>null);n.error((d==null?void 0:d.error)??"Failed to create token"),c((d==null?void 0:d.error)??"Failed to create token");return}const le=await b.json();x==="agent"&&A((await _e()).agentWsBase),n.success("Token created"),T(le.token),q()}catch{n.error("Network error"),c("Network error")}}function O(s){se(s),s&&(T(""),D("api"),A(""),c(""),te())}async function ie(s){try{return(await fetch(`/api/v1/tokens/${s}`,{method:"DELETE",credentials:"include"})).ok?(n.success("Token revoked"),q(),!0):(n.error("Failed to revoke token"),!1)}catch{return n.error("Network error"),!1}}function H(s){return s.expires_at&&new Date(s.expires_at)<new Date}return e.jsxs("div",{className:"flex flex-col gap-6 max-w-[900px] mx-auto w-full p-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-xl font-semibold",children:"Personal Access Tokens"}),e.jsxs(Re,{open:ee,onOpenChange:O,children:[e.jsx(Ee,{asChild:!0,children:e.jsxs(u,{ref:C,size:"sm",children:[e.jsx(ze,{className:"mr-2 h-4 w-4"}),"New token"]})}),e.jsxs(Be,{className:"sm:max-w-md",children:[e.jsx(Le,{children:e.jsx(Pe,{children:"Create token"})}),e.jsx("p",{role:"status",className:"sr-only",children:ae}),l?e.jsxs("div",{className:"flex flex-col gap-3 pt-2",children:[e.jsx("p",{id:F,className:"text-sm text-muted-foreground",children:"Copy this token now — it won't be shown again."}),e.jsx(j,{ref:k,readOnly:!0,value:l,"aria-labelledby":F,onFocus:s=>s.currentTarget.select(),className:"font-mono"}),x==="agent"&&S&&e.jsxs(e.Fragment,{children:[e.jsx("p",{id:I,className:"text-sm text-muted-foreground",children:"Run this on the agent Mac to connect it to this relay:"}),e.jsx(j,{readOnly:!0,value:`tapflow agent start --relay ${S} --token ${l}`,"aria-labelledby":I,onFocus:s=>s.currentTarget.select(),className:"font-mono"})]}),e.jsx(u,{onClick:()=>{c(""),(navigator.clipboard?navigator.clipboard.writeText(l):Promise.reject(new Error("no clipboard"))).then(()=>{n.success("Token copied to clipboard"),O(!1)}).catch(()=>{var s;n.error("Failed to copy — copy manually"),c("Could not copy the token. Select it and copy it by hand."),(s=k.current)==null||s.focus()})},children:"Copy & close"})]}):e.jsxs("form",{onSubmit:re(oe),className:"flex flex-col gap-4 pt-2",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-name",children:"Name"}),e.jsx(j,{id:"token-name",placeholder:"e.g. ci-deploy","aria-required":"true","aria-invalid":!!i.name,"aria-describedby":i.name?"name-error":void 0,...E("name")}),e.jsx(Q,{id:"name-error",message:(W=i.name)==null?void 0:W.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-expiry",children:"Expiration"}),e.jsx(he,{control:B,name:"expiry",render:({field:s})=>e.jsxs(M,{value:s.value,onValueChange:t=>s.onChange(t),children:[e.jsx($,{id:"token-expiry",ref:s.ref,onBlur:s.onBlur,"aria-describedby":s.value==="never"?R:void 0,children:e.jsx(G,{})}),e.jsxs(J,{children:[X.map(t=>e.jsxs(m,{value:t,children:[t," days"]},t)),e.jsx(m,{value:"custom",children:"Custom…"}),e.jsx(m,{value:"never",children:"No expiration"})]})]})}),P==="never"&&e.jsx("p",{id:R,className:"text-sm text-amber-700 dark:text-amber-300",children:"A token without an expiry stays valid until you revoke it. For CI, 90 days or less is recommended."})]}),P==="custom"&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"expires",children:"Expires in (days)"}),e.jsx(j,{id:"expires",type:"number","aria-required":"true","aria-invalid":!!i.expiresDays,"aria-describedby":i.expiresDays?"expiresDays-error":void 0,...E("expiresDays")}),e.jsx(Q,{id:"expiresDays-error",message:(_=i.expiresDays)==null?void 0:_.message})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"token-type",children:"Type"}),e.jsxs(M,{value:x,onValueChange:s=>D(s),children:[e.jsx($,{id:"token-type",children:e.jsx(G,{})}),e.jsxs(J,{children:[e.jsx(m,{value:"api",children:"API — CI uploads & API access"}),g&&e.jsx(m,{value:"agent",children:"Agent — connect remote device agents (Admin only)"})]})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Scope: ",e.jsx(N,{variant:"secondary",children:x==="agent"?"agent":"view, builds:write"})]}),e.jsx(u,{type:"submit",disabled:L,children:L?"Creating…":"Create token"}),e.jsx(je,{errors:i,submitCount:ne})]})]})]})]}),e.jsxs(ye,{children:[e.jsxs(ge,{children:[e.jsx(fe,{children:"Active tokens"}),e.jsxs(ve,{children:["Use these tokens with ",e.jsx("code",{className:"text-xs",children:"Authorization: Bearer <token>"})," for API deployments."]})]}),e.jsx(ke,{className:"px-4 pt-0 pb-2",children:e.jsxs(Oe,{children:[e.jsx(He,{children:e.jsxs(U,{children:[e.jsx(p,{children:"Name"}),e.jsx(p,{children:"Scope"}),e.jsx(p,{children:"Last used"}),e.jsx(p,{children:"Expires"}),e.jsx(p,{className:"w-10"})]})}),e.jsxs(Ve,{...Z,children:[e.jsx(We,{view:w,colSpan:5,noun:"tokens",emptyText:"No tokens yet.",onRetry:()=>{o.refetch()}}),Y.map(s=>e.jsxs(U,{className:"hover:bg-transparent",children:[e.jsx(h,{className:"font-medium",children:s.name}),e.jsx(h,{children:e.jsx(N,{variant:"secondary",children:s.scope})}),e.jsx(h,{className:"text-muted-foreground text-sm",children:s.last_used_at?new Date(s.last_used_at).toLocaleDateString():"Never"}),e.jsx(h,{children:s.expires_at?e.jsx("span",{className:H(s)?"text-destructive text-sm":"text-muted-foreground text-sm",children:H(s)?"Expired":new Date(s.expires_at).toLocaleDateString()}):e.jsx(N,{variant:"outline",children:"No expiration"})}),e.jsx(h,{children:e.jsx(u,{variant:"destructive",size:"icon",className:"h-7 w-7","aria-label":"Revoke token",onClick:()=>v(s.id),children:e.jsx(Ke,{className:"h-4 w-4"})})})]},s.id))]})]})})]}),e.jsx(Ce,{open:f!==null,onOpenChange:s=>{s||v(null)},children:e.jsxs(Te,{children:[e.jsxs(De,{children:[e.jsx(Se,{children:"Revoke token?"}),e.jsx(Ae,{children:"Any active API calls using this token will immediately fail."})]}),e.jsxs(Fe,{children:[e.jsx(Ie,{children:"Cancel"}),e.jsx(u,{variant:"destructive",onClick:async()=>{if(f===null)return;await ie(f)&&v(null)},children:"Revoke"})]})]})})]})}export{is as TokenSettings};
@@ -1,31 +1,26 @@
1
- import{G as e}from"./index-cgl1yEKu.js";/**
1
+ import{G as a}from"./index-Bixhy5MB.js";/**
2
2
  * @license lucide-react v1.58.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;const c=e(n);/**
6
+ */const n={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};n.node;const i=a(n);/**
7
7
  * @license lucide-react v1.58.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const t={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};t.node;const r=e(t);/**
11
+ */const t={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};t.node;const c=a(t);/**
12
12
  * @license lucide-react v1.58.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const s={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};s.node;const l=e(s);/**
16
+ */const s={name:"house",size:24,node:[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],aliases:["home"]};s.node;const r=a(s);/**
17
17
  * @license lucide-react v1.58.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const o={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};o.node;const y=e(o);/**
21
+ */const o={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};o.node;const y=a(o);/**
22
22
  * @license lucide-react v1.58.0 - ISC
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const d={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};d.node;const p=e(d);/**
27
- * @license lucide-react v1.58.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 h={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};h.node;const k=e(h);function w(a){return a==="mcp"?"Coding agent":"Flow runner"}function m(a){switch(a){case"session-not-found":return"This session has ended.";case"not-watchable":return"This device is not being driven by an AI agent, so it cannot be watched.";case"not-permitted":return"Sign in to the dashboard to watch a session.";case"watchers-full":return"This session already has as many viewers as it allows. Try again later."}}function u(a){switch(a){case"session-ended":return"The session ended.";case"holder-changed":return"Someone else picked up this device, so the watch ended."}}export{c as A,r as D,l as H,y as K,k as L,p as a,u as b,w as h,m as w};
26
+ */const h={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};h.node;const l=a(h);function p(e){return e==="mcp"?"Coding agent":"Flow runner"}function k(e){switch(e){case"session-not-found":return"This session has ended.";case"not-watchable":return"This device is not being driven by an AI agent, so it cannot be watched.";case"not-permitted":return"Sign in to the dashboard to watch a session.";case"watchers-full":return"This session already has as many viewers as it allows. Try again later."}}function w(e){switch(e){case"session-ended":return"The session ended.";case"holder-changed":return"Someone else picked up this device, so the watch ended."}}export{i as A,c as D,r as H,y as K,l as L,w as a,p as h,k as w};
@@ -1 +1 @@
1
- import{r as n,j as i,c as d}from"./vendor-react-DTSdA8m-.js";import{aO as S,a4 as u,aP as O,ac as T,aQ as b,aR as E,aT as x,b5 as N,a7 as h,aM as z,aN as F,aS as M,a2 as f,aE as v}from"./index-cgl1yEKu.js";var H=Object.defineProperty,c=(s,t)=>H(s,"name",{value:t,configurable:!0}),k="AlertDialog",[I,oe]=h(k,[N]),p=N(),L=c(s=>{const{__scopeAlertDialog:t,...e}=s,a=p(t);return i.jsx(z,{...a,...e,modal:!0})},"AlertDialog"),Q=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(F,{...o,...l,ref:e})},"AlertDialogTrigger")),V=c(s=>{const{__scopeAlertDialog:t,...e}=s,a=p(t);return i.jsx(S,{...a,...e})},"AlertDialogPortal"),_=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(M,{...o,...l,ref:e})},"AlertDialogOverlay")),q="AlertDialogContent",[B,G]=I(q),y=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,children:l,...o}=t,r=p(a),g=n.useRef(null),$=u(e,g),m=n.useRef(null);return i.jsx(B,{scope:a,cancelRef:m,children:i.jsx(O,{role:"alertdialog",...r,...o,ref:$,onOpenAutoFocus:T(o.onOpenAutoFocus,D=>{var A;D.preventDefault(),(A=m.current)==null||A.focus({preventScroll:!0})}),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault(),children:l})})},"AlertDialogContent")),j=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(b,{...o,...l,ref:e})},"AlertDialogTitle")),R=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(E,{...o,...l,ref:e})},"AlertDialogDescription")),C=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(x,{...o,...l,ref:e})},"AlertDialogAction")),J="AlertDialogCancel",w=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,{cancelRef:o}=G(J,a),r=p(a),g=u(e,o);return i.jsx(x,{...r,...l,ref:g})},"AlertDialogCancel"));const se=L,re=Q,K=V,P=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(_,{className:o,...l,ref:t}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});P.displayName=_.displayName;const U=n.forwardRef((s,t)=>{const e=d.c(10);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(P,{}),e[3]=o):o=e[3];let r;e[4]!==a?(r=f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg",a),e[4]=a,e[5]=r):r=e[5];let g;return e[6]!==l||e[7]!==t||e[8]!==r?(g=i.jsxs(K,{children:[o,i.jsx(y,{ref:t,className:r,...l})]}),e[6]=l,e[7]=t,e[8]=r,e[9]=g):g=e[9],g});U.displayName=y.displayName;const W=s=>{const t=d.c(8);let e,a;t[0]!==s?({className:e,...a}=s,t[0]=s,t[1]=e,t[2]=a):(e=t[1],a=t[2]);let l;t[3]!==e?(l=f("flex flex-col space-y-2 text-center sm:text-left",e),t[3]=e,t[4]=l):l=t[4];let o;return t[5]!==a||t[6]!==l?(o=i.jsx("div",{className:l,...a}),t[5]=a,t[6]=l,t[7]=o):o=t[7],o};W.displayName="AlertDialogHeader";const X=s=>{const t=d.c(8);let e,a;t[0]!==s?({className:e,...a}=s,t[0]=s,t[1]=e,t[2]=a):(e=t[1],a=t[2]);let l;t[3]!==e?(l=f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),t[3]=e,t[4]=l):l=t[4];let o;return t[5]!==a||t[6]!==l?(o=i.jsx("div",{className:l,...a}),t[5]=a,t[6]=l,t[7]=o):o=t[7],o};X.displayName="AlertDialogFooter";const Y=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f("text-lg font-semibold",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(j,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});Y.displayName=j.displayName;const Z=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f("text-sm text-muted-foreground",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(R,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});Z.displayName=R.displayName;const ee=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f(v(),a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(C,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});ee.displayName=C.displayName;const te=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f(v({variant:"outline"}),"mt-2 sm:mt-0",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(w,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});te.displayName=w.displayName;export{W as A,Y as a,Z as b,te as c,U as d,X as e,ee as f,se as g,re as h};
1
+ import{r as n,j as i,c as d}from"./vendor-react-DTSdA8m-.js";import{aQ as S,a5 as u,aR as O,ad as T,aS as b,aT as E,aV as x,b7 as N,a8 as h,aO as z,aP as F,aU as H,a2 as f,aG as v}from"./index-Bixhy5MB.js";var M=Object.defineProperty,c=(s,t)=>M(s,"name",{value:t,configurable:!0}),k="AlertDialog",[V,oe]=h(k,[N]),p=N(),G=c(s=>{const{__scopeAlertDialog:t,...e}=s,a=p(t);return i.jsx(z,{...a,...e,modal:!0})},"AlertDialog"),I=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(F,{...o,...l,ref:e})},"AlertDialogTrigger")),L=c(s=>{const{__scopeAlertDialog:t,...e}=s,a=p(t);return i.jsx(S,{...a,...e})},"AlertDialogPortal"),_=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(H,{...o,...l,ref:e})},"AlertDialogOverlay")),Q="AlertDialogContent",[U,q]=V(Q),y=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,children:l,...o}=t,r=p(a),g=n.useRef(null),$=u(e,g),m=n.useRef(null);return i.jsx(U,{scope:a,cancelRef:m,children:i.jsx(O,{role:"alertdialog",...r,...o,ref:$,onOpenAutoFocus:T(o.onOpenAutoFocus,D=>{var A;D.preventDefault(),(A=m.current)==null||A.focus({preventScroll:!0})}),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault(),children:l})})},"AlertDialogContent")),j=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(b,{...o,...l,ref:e})},"AlertDialogTitle")),R=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(E,{...o,...l,ref:e})},"AlertDialogDescription")),C=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,o=p(a);return i.jsx(x,{...o,...l,ref:e})},"AlertDialogAction")),B="AlertDialogCancel",w=n.forwardRef(c(function(t,e){const{__scopeAlertDialog:a,...l}=t,{cancelRef:o}=q(B,a),r=p(a),g=u(e,o);return i.jsx(x,{...r,...l,ref:g})},"AlertDialogCancel"));const se=G,re=I,J=L,P=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(_,{className:o,...l,ref:t}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});P.displayName=_.displayName;const K=n.forwardRef((s,t)=>{const e=d.c(10);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx(P,{}),e[3]=o):o=e[3];let r;e[4]!==a?(r=f("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg",a),e[4]=a,e[5]=r):r=e[5];let g;return e[6]!==l||e[7]!==t||e[8]!==r?(g=i.jsxs(J,{children:[o,i.jsx(y,{ref:t,className:r,...l})]}),e[6]=l,e[7]=t,e[8]=r,e[9]=g):g=e[9],g});K.displayName=y.displayName;const W=s=>{const t=d.c(8);let e,a;t[0]!==s?({className:e,...a}=s,t[0]=s,t[1]=e,t[2]=a):(e=t[1],a=t[2]);let l;t[3]!==e?(l=f("flex flex-col space-y-2 text-center sm:text-left",e),t[3]=e,t[4]=l):l=t[4];let o;return t[5]!==a||t[6]!==l?(o=i.jsx("div",{className:l,...a}),t[5]=a,t[6]=l,t[7]=o):o=t[7],o};W.displayName="AlertDialogHeader";const X=s=>{const t=d.c(8);let e,a;t[0]!==s?({className:e,...a}=s,t[0]=s,t[1]=e,t[2]=a):(e=t[1],a=t[2]);let l;t[3]!==e?(l=f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),t[3]=e,t[4]=l):l=t[4];let o;return t[5]!==a||t[6]!==l?(o=i.jsx("div",{className:l,...a}),t[5]=a,t[6]=l,t[7]=o):o=t[7],o};X.displayName="AlertDialogFooter";const Y=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f("text-lg font-semibold",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(j,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});Y.displayName=j.displayName;const Z=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f("text-sm text-muted-foreground",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(R,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});Z.displayName=R.displayName;const ee=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f(v(),a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(C,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});ee.displayName=C.displayName;const te=n.forwardRef((s,t)=>{const e=d.c(9);let a,l;e[0]!==s?({className:a,...l}=s,e[0]=s,e[1]=a,e[2]=l):(a=e[1],l=e[2]);let o;e[3]!==a?(o=f(v({variant:"outline"}),"mt-2 sm:mt-0",a),e[3]=a,e[4]=o):o=e[4];let r;return e[5]!==l||e[6]!==t||e[7]!==o?(r=i.jsx(w,{ref:t,className:o,...l}),e[5]=l,e[6]=t,e[7]=o,e[8]=r):r=e[8],r});te.displayName=w.displayName;export{W as A,Y as a,Z as b,te as c,K as d,X as e,ee as f,se as g,re as h};
@@ -1 +1 @@
1
- import{c as i,j as b}from"./vendor-react-DTSdA8m-.js";import{a2 as l,aL as g}from"./index-cgl1yEKu.js";const x=g("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"},tone:{backlog:"border-transparent bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",progress:"border-transparent bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300",done:"border-transparent bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300",rejected:"border-transparent bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300",ios:"border-transparent bg-sky-50 text-sky-700 dark:bg-sky-950 dark:text-sky-300",android:"border-transparent bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300"}},defaultVariants:{variant:"default"}});function u(o){const e=i.c(12);let r,t,a,n;e[0]!==o?({className:r,variant:n,tone:a,...t}=o,e[0]=o,e[1]=r,e[2]=t,e[3]=a,e[4]=n):(r=e[1],t=e[2],a=e[3],n=e[4]);let d;e[5]!==r||e[6]!==a||e[7]!==n?(d=l(x({variant:n,tone:a}),r),e[5]=r,e[6]=a,e[7]=n,e[8]=d):d=e[8];let s;return e[9]!==t||e[10]!==d?(s=b.jsx("div",{className:d,...t}),e[9]=t,e[10]=d,e[11]=s):s=e[11],s}export{u as B};
1
+ import{c as i,j as b}from"./vendor-react-DTSdA8m-.js";import{a2 as l,aN as g}from"./index-Bixhy5MB.js";const x=g("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"},tone:{backlog:"border-transparent bg-zinc-100 text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400",progress:"border-transparent bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300",done:"border-transparent bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300",rejected:"border-transparent bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-300",ios:"border-transparent bg-sky-50 text-sky-700 dark:bg-sky-950 dark:text-sky-300",android:"border-transparent bg-emerald-50 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-300"}},defaultVariants:{variant:"default"}});function u(o){const e=i.c(12);let r,t,a,n;e[0]!==o?({className:r,variant:n,tone:a,...t}=o,e[0]=o,e[1]=r,e[2]=t,e[3]=a,e[4]=n):(r=e[1],t=e[2],a=e[3],n=e[4]);let d;e[5]!==r||e[6]!==a||e[7]!==n?(d=l(x({variant:n,tone:a}),r),e[5]=r,e[6]=a,e[7]=n,e[8]=d):d=e[8];let s;return e[9]!==t||e[10]!==d?(s=b.jsx("div",{className:d,...t}),e[9]=t,e[10]=d,e[11]=s):s=e[11],s}export{u as B};
@@ -1 +1 @@
1
- import{r as p,c,j as n}from"./vendor-react-DTSdA8m-.js";import{aM as y,aN as j,a2 as d,aO as $,aP as g,aQ as x,aR as u,aS as N,aT as h,al as b}from"./index-cgl1yEKu.js";const E=y,O=j,w=$,D=p.forwardRef((o,a)=>{const e=c.c(9);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=d("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==t||e[6]!==a||e[7]!==l?(i=n.jsx(N,{ref:a,className:l,...t}),e[5]=t,e[6]=a,e[7]=l,e[8]=i):i=e[8],i});D.displayName=N.displayName;const R=p.forwardRef((o,a)=>{const e=c.c(13);let s,t,l;e[0]!==o?({className:t,children:s,...l}=o,e[0]=o,e[1]=s,e[2]=t,e[3]=l):(s=e[1],t=e[2],l=e[3]);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(D,{}),e[4]=i):i=e[4];let r;e[5]!==t?(r=d("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg",t),e[5]=t,e[6]=r):r=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(h,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(b,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[7]=m):m=e[7];let f;return e[8]!==s||e[9]!==l||e[10]!==a||e[11]!==r?(f=n.jsxs(w,{children:[i,n.jsxs(g,{ref:a,className:r,...l,children:[s,m]})]}),e[8]=s,e[9]=l,e[10]=a,e[11]=r,e[12]=f):f=e[12],f});R.displayName=g.displayName;const v=o=>{const a=c.c(8);let e,s;a[0]!==o?({className:e,...s}=o,a[0]=o,a[1]=e,a[2]=s):(e=a[1],s=a[2]);let t;a[3]!==e?(t=d("flex flex-col space-y-1.5 text-center sm:text-left",e),a[3]=e,a[4]=t):t=a[4];let l;return a[5]!==s||a[6]!==t?(l=n.jsx("div",{className:t,...s}),a[5]=s,a[6]=t,a[7]=l):l=a[7],l};v.displayName="DialogHeader";const T=o=>{const a=c.c(8);let e,s;a[0]!==o?({className:e,...s}=o,a[0]=o,a[1]=e,a[2]=s):(e=a[1],s=a[2]);let t;a[3]!==e?(t=d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),a[3]=e,a[4]=t):t=a[4];let l;return a[5]!==s||a[6]!==t?(l=n.jsx("div",{className:t,...s}),a[5]=s,a[6]=t,a[7]=l):l=a[7],l};T.displayName="DialogFooter";const k=p.forwardRef((o,a)=>{const e=c.c(9);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=d("text-lg font-semibold leading-none tracking-tight",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==t||e[6]!==a||e[7]!==l?(i=n.jsx(x,{ref:a,className:l,...t}),e[5]=t,e[6]=a,e[7]=l,e[8]=i):i=e[8],i});k.displayName=x.displayName;const z=p.forwardRef((o,a)=>{const e=c.c(9);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=d("text-sm text-muted-foreground",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==t||e[6]!==a||e[7]!==l?(i=n.jsx(u,{ref:a,className:l,...t}),e[5]=t,e[6]=a,e[7]=l,e[8]=i):i=e[8],i});z.displayName=u.displayName;export{O as D,v as a,k as b,R as c,E as d,z as e,T as f};
1
+ import{r as p,c,j as n}from"./vendor-react-DTSdA8m-.js";import{aO as y,aP as j,a2 as d,aQ as $,aR as g,aS as x,aT as u,aU as N,aV as h,am as b}from"./index-Bixhy5MB.js";const E=y,O=j,w=$,D=p.forwardRef((o,a)=>{const e=c.c(9);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=d("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==t||e[6]!==a||e[7]!==l?(i=n.jsx(N,{ref:a,className:l,...t}),e[5]=t,e[6]=a,e[7]=l,e[8]=i):i=e[8],i});D.displayName=N.displayName;const R=p.forwardRef((o,a)=>{const e=c.c(13);let s,t,l;e[0]!==o?({className:t,children:s,...l}=o,e[0]=o,e[1]=s,e[2]=t,e[3]=l):(s=e[1],t=e[2],l=e[3]);let i;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(D,{}),e[4]=i):i=e[4];let r;e[5]!==t?(r=d("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-1/2 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-1/2 sm:rounded-lg",t),e[5]=t,e[6]=r):r=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=n.jsxs(h,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[n.jsx(b,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]}),e[7]=m):m=e[7];let f;return e[8]!==s||e[9]!==l||e[10]!==a||e[11]!==r?(f=n.jsxs(w,{children:[i,n.jsxs(g,{ref:a,className:r,...l,children:[s,m]})]}),e[8]=s,e[9]=l,e[10]=a,e[11]=r,e[12]=f):f=e[12],f});R.displayName=g.displayName;const v=o=>{const a=c.c(8);let e,s;a[0]!==o?({className:e,...s}=o,a[0]=o,a[1]=e,a[2]=s):(e=a[1],s=a[2]);let t;a[3]!==e?(t=d("flex flex-col space-y-1.5 text-center sm:text-left",e),a[3]=e,a[4]=t):t=a[4];let l;return a[5]!==s||a[6]!==t?(l=n.jsx("div",{className:t,...s}),a[5]=s,a[6]=t,a[7]=l):l=a[7],l};v.displayName="DialogHeader";const T=o=>{const a=c.c(8);let e,s;a[0]!==o?({className:e,...s}=o,a[0]=o,a[1]=e,a[2]=s):(e=a[1],s=a[2]);let t;a[3]!==e?(t=d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),a[3]=e,a[4]=t):t=a[4];let l;return a[5]!==s||a[6]!==t?(l=n.jsx("div",{className:t,...s}),a[5]=s,a[6]=t,a[7]=l):l=a[7],l};T.displayName="DialogFooter";const k=p.forwardRef((o,a)=>{const e=c.c(9);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=d("text-lg font-semibold leading-none tracking-tight",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==t||e[6]!==a||e[7]!==l?(i=n.jsx(x,{ref:a,className:l,...t}),e[5]=t,e[6]=a,e[7]=l,e[8]=i):i=e[8],i});k.displayName=x.displayName;const z=p.forwardRef((o,a)=>{const e=c.c(9);let s,t;e[0]!==o?({className:s,...t}=o,e[0]=o,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=d("text-sm text-muted-foreground",s),e[3]=s,e[4]=l):l=e[4];let i;return e[5]!==t||e[6]!==a||e[7]!==l?(i=n.jsx(u,{ref:a,className:l,...t}),e[5]=t,e[6]=a,e[7]=l,e[8]=i):i=e[8],i});z.displayName=u.displayName;export{O as D,v as a,k as b,R as c,E as d,z as e,T as f};
@@ -1 +1 @@
1
- import{c as n,j as c}from"./vendor-react-DTSdA8m-.js";import{a2 as a}from"./index-cgl1yEKu.js";function x(m){const t=n.c(6),{id:o,children:r,className:i}=m;let e;t[0]!==i?(e=a("text-sm text-muted-foreground",i),t[0]=i,t[1]=e):e=t[1];let s;return t[2]!==r||t[3]!==o||t[4]!==e?(s=c.jsx("p",{id:o,className:e,children:r}),t[2]=r,t[3]=o,t[4]=e,t[5]=s):s=t[5],s}export{x as F};
1
+ import{c as n,j as c}from"./vendor-react-DTSdA8m-.js";import{a2 as a}from"./index-Bixhy5MB.js";function x(m){const t=n.c(6),{id:o,children:r,className:i}=m;let e;t[0]!==i?(e=a("text-sm text-muted-foreground",i),t[0]=i,t[1]=e):e=t[1];let s;return t[2]!==r||t[3]!==o||t[4]!==e?(s=c.jsx("p",{id:o,className:e,children:r}),t[2]=r,t[3]=o,t[4]=e,t[5]=s):s=t[5],s}export{x as F};