railwatch 0.9.0 → 0.9.2

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/app/frontend/components/railwatch/stat.tsx +13 -1
  4. data/app/frontend/hooks/use-live.ts +26 -0
  5. data/docs/configuration.md +3 -1
  6. data/lib/railwatch/version.rb +1 -1
  7. data/lib/railwatch.rb +9 -2
  8. data/public/railwatch/assets/{app-layout-LvxN9xSS.js → app-layout-CpEbDy93.js} +1 -1
  9. data/public/railwatch/assets/{arrow-up-DG01k9AL.js → arrow-up-DAODKT5N.js} +1 -1
  10. data/public/railwatch/assets/{braces-C3w7pfxS.js → braces-DgB4bqp0.js} +1 -1
  11. data/public/railwatch/assets/{card-Dpwlr0uY.js → card-C4EFUWG1.js} +1 -1
  12. data/public/railwatch/assets/{chart-DJHv3R7W.js → chart-CD6EHDjG.js} +1 -1
  13. data/public/railwatch/assets/{chart-hover-CEH-DtXO.js → chart-hover-B5cFOZ24.js} +1 -1
  14. data/public/railwatch/assets/{chart-panel-CUdIzJvk.js → chart-panel-XD8qJDmg.js} +1 -1
  15. data/public/railwatch/assets/{code-BRZprwun.js → code-CuTKEYtT.js} +1 -1
  16. data/public/railwatch/assets/{copy-id-CwhGGiwF.js → copy-id-COM9oXfT.js} +1 -1
  17. data/public/railwatch/assets/{cursor-load-more-uF1_955Q.js → cursor-load-more-CleS4nD4.js} +1 -1
  18. data/public/railwatch/assets/{data-table-DYi-N0hm.js → data-table-Bzj8zcao.js} +1 -1
  19. data/public/railwatch/assets/{env-layout-HdcOaPPX.js → env-layout-Dic4A8Kn.js} +1 -1
  20. data/public/railwatch/assets/{execution-path-CElXXFO_.js → execution-path-C7Up9w4e.js} +1 -1
  21. data/public/railwatch/assets/{filter-bar-DEv0G_34.js → filter-bar-B5wbix1y.js} +1 -1
  22. data/public/railwatch/assets/{flamegraph-SKD9yxW9.js → flamegraph-Dve4TVkl.js} +1 -1
  23. data/public/railwatch/assets/{frames-CUpyJQDy.js → frames-CkDFkUhi.js} +1 -1
  24. data/public/railwatch/assets/{index-HRXGir-0.js → index-0glo-UpF.js} +1 -1
  25. data/public/railwatch/assets/{index-CvqfEExO.js → index-6t2RLBwA.js} +1 -1
  26. data/public/railwatch/assets/{index-CjxXgOs-.js → index-7fYWYI1v.js} +1 -1
  27. data/public/railwatch/assets/{index-CiRMSYMn.js → index-B2hTf0w6.js} +1 -1
  28. data/public/railwatch/assets/{index-74ocuU5d.js → index-B51WiPQg.js} +1 -1
  29. data/public/railwatch/assets/{index-BxCXBHP2.js → index-BA3nScnV.js} +1 -1
  30. data/public/railwatch/assets/{index-CIaZkokF.js → index-BheGBdI9.js} +1 -1
  31. data/public/railwatch/assets/{index-d-3J7gQ5.js → index-BxSwNl8H.js} +1 -1
  32. data/public/railwatch/assets/{index-BBCEkLqp.js → index-CEcv5bba.js} +1 -1
  33. data/public/railwatch/assets/{index-CEetm4oC.js → index-CG7VCShP.js} +1 -1
  34. data/public/railwatch/assets/{index-ClL-PYEV.js → index-CXSEiNWw.js} +1 -1
  35. data/public/railwatch/assets/{index-B_KFb9LS.js → index-C_3JsXHv.js} +1 -1
  36. data/public/railwatch/assets/{index-DJd3OUSd.js → index-CgoVIV-m.js} +1 -1
  37. data/public/railwatch/assets/{index-C1jc1OoH.js → index-CnlT_aCL.js} +1 -1
  38. data/public/railwatch/assets/{index-DPD-rLp6.js → index-D7t5pSOT.js} +1 -1
  39. data/public/railwatch/assets/{index-CteZ6fop.js → index-DJZkxYZf.js} +1 -1
  40. data/public/railwatch/assets/{index-Ce4SB5AB.js → index-DKwz3gSX.js} +1 -1
  41. data/public/railwatch/assets/{index-CNH85TZp.js → index-DTLmaJha.js} +1 -1
  42. data/public/railwatch/assets/{index-UJOUALr_.js → index-D_dUD6LY.js} +1 -1
  43. data/public/railwatch/assets/{index-BqK_VKom.js → index-Dj03Gham.js} +1 -1
  44. data/public/railwatch/assets/{index-DrayARrI.js → index-DqeNWrJc.js} +1 -1
  45. data/public/railwatch/assets/{index-oQrvBpOm.js → index-DwGETVLb.js} +1 -1
  46. data/public/railwatch/assets/{index-CxTLT-Qh.js → index-Dx7oNB2j.js} +1 -1
  47. data/public/railwatch/assets/{index-BDcglJzX.js → index-Kxpc-Jju.js} +1 -1
  48. data/public/railwatch/assets/{index-B8NA62Lz.js → index-YqmR-RY4.js} +1 -1
  49. data/public/railwatch/assets/{index-2W-ppwap.js → index-kX9K5M8z.js} +1 -1
  50. data/public/railwatch/assets/{index-DYK_dps4.js → index-wH-xxmJK.js} +1 -1
  51. data/public/railwatch/assets/{index-C7zREldp.js → index-x18ma-AF.js} +1 -1
  52. data/public/railwatch/assets/{inertia-FoqYZAk8.js → inertia-b7M33AzA.js} +2 -2
  53. data/public/railwatch/assets/{json-viewer-CxqMojEm.js → json-viewer-C0RZwcC2.js} +1 -1
  54. data/public/railwatch/assets/{klass-DEF-Vat5.js → klass-BT-gRTuY.js} +1 -1
  55. data/public/railwatch/assets/{origin-identity-Y6gvfQVR.js → origin-identity-ouOEvOlq.js} +1 -1
  56. data/public/railwatch/assets/{percentile-picker-E2aUdLxx.js → percentile-picker-BYFo11OE.js} +1 -1
  57. data/public/railwatch/assets/{relative-time-DcJbkKlN.js → relative-time-CJX4HXBB.js} +1 -1
  58. data/public/railwatch/assets/{release-health-C8WSCDKD.js → release-health-CIxeXQ_e.js} +1 -1
  59. data/public/railwatch/assets/{route-qO5vX1p-.js → route-eUFnanVO.js} +1 -1
  60. data/public/railwatch/assets/{segmented-BWee8uc9.js → segmented-CJq8WOHZ.js} +1 -1
  61. data/public/railwatch/assets/{select-G7rNBzv0.js → select-vYjStP1q.js} +1 -1
  62. data/public/railwatch/assets/{series-chart-C5nXIUc5.js → series-chart-FBOfRLhK.js} +1 -1
  63. data/public/railwatch/assets/{show-CTO8Lvd2.js → show-BBNCHyV9.js} +1 -1
  64. data/public/railwatch/assets/{show-Nfpxs8su.js → show-BJcTlqdU.js} +1 -1
  65. data/public/railwatch/assets/{show-CH7yxt7R.js → show-Bq4w9YtT.js} +1 -1
  66. data/public/railwatch/assets/{show-DyzHM527.js → show-C5SMVt6Z.js} +1 -1
  67. data/public/railwatch/assets/{show-BEa9PGu1.js → show-C7w8Tnt2.js} +1 -1
  68. data/public/railwatch/assets/{show-ddjUMo9G.js → show-D7fBqLw0.js} +1 -1
  69. data/public/railwatch/assets/{show-DnYsDMUt.js → show-DGPuUSHE.js} +1 -1
  70. data/public/railwatch/assets/{show-ksjbSzDH.js → show-DNY79oEl.js} +1 -1
  71. data/public/railwatch/assets/{show-BpCO49d3.js → show-DeTnRall.js} +1 -1
  72. data/public/railwatch/assets/{show-BiT_Aloc.js → show-daCAn8qV.js} +1 -1
  73. data/public/railwatch/assets/{show-BEWisLQw.js → show-zaB17ZGC.js} +1 -1
  74. data/public/railwatch/assets/{sort-header-uOq5VlrB.js → sort-header-dslBMND2.js} +1 -1
  75. data/public/railwatch/assets/{sparkline-cell-DgGij0cu.js → sparkline-cell-C7fhjJby.js} +1 -1
  76. data/public/railwatch/assets/stat-nY8iS5q9.js +1 -0
  77. data/public/railwatch/assets/{status-badge-BDkOXa-C.js → status-badge-D40D8TiV.js} +1 -1
  78. data/public/railwatch/assets/{tenant-path-DU0ezKSU.js → tenant-path-UhieazCc.js} +1 -1
  79. data/public/railwatch/assets/{use-clipboard-DoENmlWY.js → use-clipboard-T9kCBcs8.js} +1 -1
  80. data/public/railwatch/assets/use-live-rp6jfGac.js +1 -0
  81. data/public/railwatch/manifest.json +611 -611
  82. metadata +74 -74
  83. data/public/railwatch/assets/stat-BTzNKTm2.js +0 -1
  84. data/public/railwatch/assets/use-live-CE_fN5_6.js +0 -1
@@ -1 +1 @@
1
- import{c as B,u as U,R as W,j as t,L as K,k as F,i as G}from"./inertia-FoqYZAk8.js";import{C as J}from"./chart-panel-CUdIzJvk.js";import{D as z}from"./data-table-DYi-N0hm.js";import{b as Q,E as A,ab as V,O as X}from"./app-layout-LvxN9xSS.js";import{P as Y,E as Z}from"./env-layout-HdcOaPPX.js";import{b as ee}from"./series-chart-C5nXIUc5.js";import{I as se}from"./status-badge-BDkOXa-C.js";import{C as M,a as T,b as q,c as H}from"./card-Dpwlr0uY.js";import{w as te,c as P,m as re,a as ie}from"./format-B9SDkrWj.js";import{ReleaseHealthStrip as le}from"./release-health-C8WSCDKD.js";import"./chart-hover-CEH-DtXO.js";import"./use-live-CE_fN5_6.js";import"./segmented-BWee8uc9.js";import"./chart-DJHv3R7W.js";import"./stat-BTzNKTm2.js";import"./arrow-up-DG01k9AL.js";function L(s){const e=B.c(6),{rows:a,empty:l}=s;let r;e[0]!==l?(r=t.jsx(A,{icon:X,...l}),e[0]=l,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=[{key:"k",header:"Issue",cell:ne},{key:"t",header:"Title",cell:oe},{key:"s",header:"",cell:ae}],e[2]=i):i=e[2];let o;return e[3]!==a||e[4]!==r?(o=t.jsx(z,{rows:a,rowKey:ce,empty:r,columns:i}),e[3]=a,e[4]=r,e[5]=o):o=e[5],o}function ae(s){return t.jsx(se,{status:s.status})}function oe(s){return t.jsx("span",{className:"line-clamp-1 text-xs",children:s.title})}function ne(s){return t.jsx(K,{className:"font-mono text-xs hover:underline",href:G(s.id),children:s.key})}function ce(s){return s.id}function Te(s){const e=B.c(58),{environment:a,window:l}=U().props,r=a.application_id,i=a.id,o=s.release.ref;let n;e[0]!==r||e[1]!==i||e[2]!==l?(n=W(r,i,{window:l}),e[0]=r,e[1]=i,e[2]=l,e[3]=n):n=e[3];let c;e[4]!==n?(c={title:"Releases",href:n},e[4]=n,e[5]=c):c=e[5];let m;e[6]!==s.release.ref?(m={title:s.release.ref,href:"#"},e[6]=s.release.ref,e[7]=m):m=e[7];let d;e[8]!==c||e[9]!==m?(d=[c,m],e[8]=c,e[9]=m,e[10]=d):d=e[10];let u;e[11]!==s.release.deploy?(u=t.jsx("span",{className:"font-mono",children:s.release.deploy}),e[11]=s.release.deploy,e[12]=u):u=e[12];let g;e[13]!==s.release.deployed_at?(g=s.release.deployed_at?te(s.release.deployed_at):"never deployed",e[13]=s.release.deployed_at,e[14]=g):g=e[14];const O=`${g}${s.release.name?` · ${s.release.name}`:""}${s.release.previous_ref?` · after ${s.release.previous_ref}`:""}`;let f;e[15]!==r||e[16]!==i||e[17]!==s.release.deploy_id?(f=s.release.deploy_id&&t.jsx(Q,{asChild:!0,variant:"outline",size:"sm",children:t.jsx(K,{href:F(r,i,s.release.deploy_id),children:"Deploy"})}),e[15]=r,e[16]=i,e[17]=s.release.deploy_id,e[18]=f):f=e[18];let h;e[19]!==u||e[20]!==O||e[21]!==f?(h=t.jsx(Y,{withWindow:!1,title:u,description:O,actions:f}),e[19]=u,e[20]=O,e[21]=f,e[22]=h):h=e[22];const D=s.release.previous_ref?`vs ${s.release.previous_ref}`:void 0;let y;e[23]!==s.previous_summary||e[24]!==s.summary||e[25]!==D?(y=t.jsx(le,{health:s.summary,previous:s.previous_summary,deltaCaption:D}),e[23]=s.previous_summary,e[24]=s.summary,e[25]=D,e[26]=y):y=e[26];let x;e[27]!==s.summary.sessions?(x=P(s.summary.sessions),e[27]=s.summary.sessions,e[28]=x):x=e[28];let _;e[29]!==s.series?(_=t.jsx(ee,{data:s.series}),e[29]=s.series,e[30]=_):_=e[30];let p;e[31]!==x||e[32]!==_?(p=t.jsx(J,{label:"Sessions by status",value:x,children:_}),e[31]=x,e[32]=_,e[33]=p):p=e[33];let S;e[34]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(q,{children:t.jsx(H,{children:"Issues first seen in this release"})}),e[34]=S):S=e[34];let k;e[35]===Symbol.for("react.memo_cache_sentinel")?(k={title:"No new issues in this release",description:"Issues first seen while this release was live would show here."},e[35]=k):k=e[35];let j;e[36]!==s.new_issues?(j=t.jsxs(M,{children:[S,t.jsx(T,{children:t.jsx(L,{rows:s.new_issues,empty:k})})]}),e[36]=s.new_issues,e[37]=j):j=e[37];let N;e[38]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(q,{children:t.jsx(H,{children:"Issues resolved in this release"})}),e[38]=N):N=e[38];let C;e[39]===Symbol.for("react.memo_cache_sentinel")?(C={title:"No issues marked resolved in this release",description:"Issues resolved and tagged with this deploy would show here."},e[39]=C):C=e[39];let v;e[40]!==s.resolved_issues?(v=t.jsxs(M,{children:[N,t.jsx(T,{children:t.jsx(L,{rows:s.resolved_issues,empty:C})})]}),e[40]=s.resolved_issues,e[41]=v):v=e[41];let w;e[42]!==j||e[43]!==v?(w=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[j,v]}),e[42]=j,e[43]=v,e[44]=w):w=e[44];let $;e[45]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("h2",{className:"text-sm font-semibold",children:"Sessions"}),e[45]=$):$=e[45];let E,I;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(A,{icon:V,title:"No sessions reported for this release",description:"Sessions come from the browser client and the gem's request middleware; config.track_sessions turns both off."}),I=[{key:"id",header:"Session",cell:_e},{key:"source",hideOnMobile:!0,header:"Source",cell:xe},{key:"status",header:"Status",cell:ye},{key:"user",hideOnMobile:!0,header:"User",cell:he},{key:"duration",header:"Duration",align:"right",cell:fe},{key:"activity",hideOnMobile:!0,header:"Requests / visits",align:"right",cell:ue},{key:"errors",hideOnMobile:!0,header:"Errors",align:"right",cell:de},{key:"started",header:"Started",align:"right",cell:me}],e[46]=E,e[47]=I):(E=e[46],I=e[47]);let b;e[48]!==s.sessions?(b=t.jsx(z,{rows:s.sessions,rowKey:je,rowClassName:pe,empty:E,columns:I}),e[48]=s.sessions,e[49]=b):b=e[49];let R;return e[50]!==s.release.ref||e[51]!==y||e[52]!==p||e[53]!==w||e[54]!==b||e[55]!==d||e[56]!==h?(R=t.jsxs(Z,{title:o,crumbs:d,children:[h,y,p,w,$,b]}),e[50]=s.release.ref,e[51]=y,e[52]=p,e[53]=w,e[54]=b,e[55]=d,e[56]=h,e[57]=R):R=e[57],R}function me(s){return ie(s.started_at)}function de(s){return t.jsx("span",{className:s.errors?"text-destructive":"",children:P(s.errors)})}function ue(s){return`${P(s.requests)} / ${P(s.visits)}`}function fe(s){return re(s.duration)}function he(s){return t.jsx("span",{className:"font-mono text-xs",children:s.user_ref})}function ye(s){return t.jsx("span",{className:s.status==="crashed"?"text-destructive text-xs font-semibold":"text-xs",children:s.status})}function xe(s){return t.jsx("span",{className:"text-xs",children:s.source})}function _e(s){return t.jsx("span",{className:"font-mono text-xs",children:s.session_id})}function pe(s){return s.status==="crashed"?"bg-destructive/5":void 0}function je(s){return s.id}export{Te as default};
1
+ import{c as B,u as U,R as W,j as t,L as K,k as F,i as G}from"./inertia-b7M33AzA.js";import{C as J}from"./chart-panel-XD8qJDmg.js";import{D as z}from"./data-table-Bzj8zcao.js";import{b as Q,E as A,ab as V,O as X}from"./app-layout-CpEbDy93.js";import{P as Y,E as Z}from"./env-layout-Dic4A8Kn.js";import{b as ee}from"./series-chart-FBOfRLhK.js";import{I as se}from"./status-badge-D40D8TiV.js";import{C as M,a as T,b as q,c as H}from"./card-C4EFUWG1.js";import{w as te,c as P,m as re,a as ie}from"./format-B9SDkrWj.js";import{ReleaseHealthStrip as le}from"./release-health-CIxeXQ_e.js";import"./chart-hover-B5cFOZ24.js";import"./use-live-rp6jfGac.js";import"./segmented-CJq8WOHZ.js";import"./chart-CD6EHDjG.js";import"./stat-nY8iS5q9.js";import"./arrow-up-DAODKT5N.js";function L(s){const e=B.c(6),{rows:a,empty:l}=s;let r;e[0]!==l?(r=t.jsx(A,{icon:X,...l}),e[0]=l,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=[{key:"k",header:"Issue",cell:ne},{key:"t",header:"Title",cell:oe},{key:"s",header:"",cell:ae}],e[2]=i):i=e[2];let o;return e[3]!==a||e[4]!==r?(o=t.jsx(z,{rows:a,rowKey:ce,empty:r,columns:i}),e[3]=a,e[4]=r,e[5]=o):o=e[5],o}function ae(s){return t.jsx(se,{status:s.status})}function oe(s){return t.jsx("span",{className:"line-clamp-1 text-xs",children:s.title})}function ne(s){return t.jsx(K,{className:"font-mono text-xs hover:underline",href:G(s.id),children:s.key})}function ce(s){return s.id}function Te(s){const e=B.c(58),{environment:a,window:l}=U().props,r=a.application_id,i=a.id,o=s.release.ref;let n;e[0]!==r||e[1]!==i||e[2]!==l?(n=W(r,i,{window:l}),e[0]=r,e[1]=i,e[2]=l,e[3]=n):n=e[3];let c;e[4]!==n?(c={title:"Releases",href:n},e[4]=n,e[5]=c):c=e[5];let m;e[6]!==s.release.ref?(m={title:s.release.ref,href:"#"},e[6]=s.release.ref,e[7]=m):m=e[7];let d;e[8]!==c||e[9]!==m?(d=[c,m],e[8]=c,e[9]=m,e[10]=d):d=e[10];let u;e[11]!==s.release.deploy?(u=t.jsx("span",{className:"font-mono",children:s.release.deploy}),e[11]=s.release.deploy,e[12]=u):u=e[12];let g;e[13]!==s.release.deployed_at?(g=s.release.deployed_at?te(s.release.deployed_at):"never deployed",e[13]=s.release.deployed_at,e[14]=g):g=e[14];const O=`${g}${s.release.name?` · ${s.release.name}`:""}${s.release.previous_ref?` · after ${s.release.previous_ref}`:""}`;let f;e[15]!==r||e[16]!==i||e[17]!==s.release.deploy_id?(f=s.release.deploy_id&&t.jsx(Q,{asChild:!0,variant:"outline",size:"sm",children:t.jsx(K,{href:F(r,i,s.release.deploy_id),children:"Deploy"})}),e[15]=r,e[16]=i,e[17]=s.release.deploy_id,e[18]=f):f=e[18];let h;e[19]!==u||e[20]!==O||e[21]!==f?(h=t.jsx(Y,{withWindow:!1,title:u,description:O,actions:f}),e[19]=u,e[20]=O,e[21]=f,e[22]=h):h=e[22];const D=s.release.previous_ref?`vs ${s.release.previous_ref}`:void 0;let y;e[23]!==s.previous_summary||e[24]!==s.summary||e[25]!==D?(y=t.jsx(le,{health:s.summary,previous:s.previous_summary,deltaCaption:D}),e[23]=s.previous_summary,e[24]=s.summary,e[25]=D,e[26]=y):y=e[26];let x;e[27]!==s.summary.sessions?(x=P(s.summary.sessions),e[27]=s.summary.sessions,e[28]=x):x=e[28];let _;e[29]!==s.series?(_=t.jsx(ee,{data:s.series}),e[29]=s.series,e[30]=_):_=e[30];let p;e[31]!==x||e[32]!==_?(p=t.jsx(J,{label:"Sessions by status",value:x,children:_}),e[31]=x,e[32]=_,e[33]=p):p=e[33];let S;e[34]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(q,{children:t.jsx(H,{children:"Issues first seen in this release"})}),e[34]=S):S=e[34];let k;e[35]===Symbol.for("react.memo_cache_sentinel")?(k={title:"No new issues in this release",description:"Issues first seen while this release was live would show here."},e[35]=k):k=e[35];let j;e[36]!==s.new_issues?(j=t.jsxs(M,{children:[S,t.jsx(T,{children:t.jsx(L,{rows:s.new_issues,empty:k})})]}),e[36]=s.new_issues,e[37]=j):j=e[37];let N;e[38]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(q,{children:t.jsx(H,{children:"Issues resolved in this release"})}),e[38]=N):N=e[38];let C;e[39]===Symbol.for("react.memo_cache_sentinel")?(C={title:"No issues marked resolved in this release",description:"Issues resolved and tagged with this deploy would show here."},e[39]=C):C=e[39];let v;e[40]!==s.resolved_issues?(v=t.jsxs(M,{children:[N,t.jsx(T,{children:t.jsx(L,{rows:s.resolved_issues,empty:C})})]}),e[40]=s.resolved_issues,e[41]=v):v=e[41];let w;e[42]!==j||e[43]!==v?(w=t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[j,v]}),e[42]=j,e[43]=v,e[44]=w):w=e[44];let $;e[45]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("h2",{className:"text-sm font-semibold",children:"Sessions"}),e[45]=$):$=e[45];let E,I;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(A,{icon:V,title:"No sessions reported for this release",description:"Sessions come from the browser client and the gem's request middleware; config.track_sessions turns both off."}),I=[{key:"id",header:"Session",cell:_e},{key:"source",hideOnMobile:!0,header:"Source",cell:xe},{key:"status",header:"Status",cell:ye},{key:"user",hideOnMobile:!0,header:"User",cell:he},{key:"duration",header:"Duration",align:"right",cell:fe},{key:"activity",hideOnMobile:!0,header:"Requests / visits",align:"right",cell:ue},{key:"errors",hideOnMobile:!0,header:"Errors",align:"right",cell:de},{key:"started",header:"Started",align:"right",cell:me}],e[46]=E,e[47]=I):(E=e[46],I=e[47]);let b;e[48]!==s.sessions?(b=t.jsx(z,{rows:s.sessions,rowKey:je,rowClassName:pe,empty:E,columns:I}),e[48]=s.sessions,e[49]=b):b=e[49];let R;return e[50]!==s.release.ref||e[51]!==y||e[52]!==p||e[53]!==w||e[54]!==b||e[55]!==d||e[56]!==h?(R=t.jsxs(Z,{title:o,crumbs:d,children:[h,y,p,w,$,b]}),e[50]=s.release.ref,e[51]=y,e[52]=p,e[53]=w,e[54]=b,e[55]=d,e[56]=h,e[57]=R):R=e[57],R}function me(s){return ie(s.started_at)}function de(s){return t.jsx("span",{className:s.errors?"text-destructive":"",children:P(s.errors)})}function ue(s){return`${P(s.requests)} / ${P(s.visits)}`}function fe(s){return re(s.duration)}function he(s){return t.jsx("span",{className:"font-mono text-xs",children:s.user_ref})}function ye(s){return t.jsx("span",{className:s.status==="crashed"?"text-destructive text-xs font-semibold":"text-xs",children:s.status})}function xe(s){return t.jsx("span",{className:"text-xs",children:s.source})}function _e(s){return t.jsx("span",{className:"font-mono text-xs",children:s.session_id})}function pe(s){return s.status==="crashed"?"bg-destructive/5":void 0}function je(s){return s.id}export{Te as default};
@@ -1 +1 @@
1
- import{c as f,o as x,j as c}from"./inertia-FoqYZAk8.js";import{A as p,a as u}from"./arrow-up-DG01k9AL.js";function b(m){const e=f.c(10),{label:n,active:o,dir:i,onClick:a}=m,l=o&&"text-foreground font-semibold";let t;e[0]!==l?(t=x("hover:text-foreground inline-flex items-center gap-1",l),e[0]=l,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=o&&(i==="asc"?c.jsx(p,{className:"size-3"}):c.jsx(u,{className:"size-3"})),e[2]=o,e[3]=i,e[4]=s):s=e[4];let r;return e[5]!==n||e[6]!==a||e[7]!==t||e[8]!==s?(r=c.jsxs("button",{type:"button",onClick:a,className:t,children:[n,s]}),e[5]=n,e[6]=a,e[7]=t,e[8]=s,e[9]=r):r=e[9],r}export{b as S};
1
+ import{c as f,o as x,j as c}from"./inertia-b7M33AzA.js";import{A as p,a as u}from"./arrow-up-DAODKT5N.js";function b(m){const e=f.c(10),{label:n,active:o,dir:i,onClick:a}=m,l=o&&"text-foreground font-semibold";let t;e[0]!==l?(t=x("hover:text-foreground inline-flex items-center gap-1",l),e[0]=l,e[1]=t):t=e[1];let s;e[2]!==o||e[3]!==i?(s=o&&(i==="asc"?c.jsx(p,{className:"size-3"}):c.jsx(u,{className:"size-3"})),e[2]=o,e[3]=i,e[4]=s):s=e[4];let r;return e[5]!==n||e[6]!==a||e[7]!==t||e[8]!==s?(r=c.jsxs("button",{type:"button",onClick:a,className:t,children:[n,s]}),e[5]=n,e[6]=a,e[7]=t,e[8]=s,e[9]=r):r=e[9],r}export{b as S};
@@ -1 +1 @@
1
- import{c as a,j as i}from"./inertia-FoqYZAk8.js";import{S as n}from"./series-chart-C5nXIUc5.js";function m(o){const e=a.c(3),{data:r,hoverKey:s}=o;let t;return e[0]!==r||e[1]!==s?(t=i.jsx(n,{data:r,className:"h-[10px] w-8",hoverKey:s}),e[0]=r,e[1]=s,e[2]=t):t=e[2],t}export{m as S};
1
+ import{c as a,j as i}from"./inertia-b7M33AzA.js";import{S as n}from"./series-chart-FBOfRLhK.js";function m(o){const e=a.c(3),{data:r,hoverKey:s}=o;let t;return e[0]!==r||e[1]!==s?(t=i.jsx(n,{data:r,className:"h-[10px] w-8",hoverKey:s}),e[0]=r,e[1]=s,e[2]=t):t=e[2],t}export{m as S};
@@ -0,0 +1 @@
1
+ import{r as w,j as h,o as C,c as k,u as M}from"./inertia-b7M33AzA.js";import{a as D}from"./use-live-rp6jfGac.js";import{A as I,a as O}from"./arrow-up-DAODKT5N.js";const T=300,F="cubic-bezier(.22, 1, .36, 1)",Y=2e3,$="inline-block h-[1.15em] overflow-hidden leading-[1.15em] align-top",U="inline-block h-[1.15em] overflow-visible leading-[1.15em] align-top text-center",P="block will-change-transform",E="block h-[1.15em] leading-[1.15em]",z="inline-block h-[1.15em] leading-[1.15em]";function N(o){const t=document.createElement("span");return t.className=o,t}function V(o){let t=o.length;for(;t>0&&!/[0-9]/.test(o[t-1]);)t--;return{digits:o.slice(0,t),suffix:o.slice(t)}}function q(o){const t=N(o?U:$);if(o)return{separator:!0,el:t,char:null};const u=N(P),s=N(E),i=N(E);return u.append(s,i),t.append(u),{separator:!1,el:t,strip:u,top:s,bottom:i,animation:null,char:null}}function G(o,{durationMs:t,easing:u}){const s=new Map;let i="";function d(e,r){e.animation?.cancel(),e.animation=null,e.top.textContent=r,e.bottom.textContent="",e.char=r}function R(e,r,m){if(typeof e.strip.animate!="function"){d(e,r);return}e.animation?.cancel();const a=e.char??r;m>0?(e.top.textContent=a,e.bottom.textContent=r):(e.top.textContent=r,e.bottom.textContent=a);const c=m>0?[{transform:"translateY(0)"},{transform:"translateY(-50%)"}]:[{transform:"translateY(-50%)"},{transform:"translateY(0)"}],n=e.strip.animate(c,{duration:t,easing:u,fill:"forwards"});e.animation=n,e.char=r,n.onfinish=()=>{e.animation===n&&d(e,r)}}function g(e){typeof e.el.animate=="function"&&e.el.animate([{opacity:0,transform:"translateY(0.35em)"},{opacity:1,transform:"none"}],{duration:t,easing:u})}return{paint(e,r){const{digits:m,suffix:a}=V(e),c=m.split(""),n=c.map((p,l)=>({key:c.length-1-l,char:p})),x=`${n.map(p=>p.key).join(",")}|${a}`,b=i==="";if(x!==i){const p=document.createDocumentFragment(),l=new Set;for(const{key:f,char:y}of n){l.add(f);const S=!/[0-9]/.test(y);let v=s.get(f);v?.separator!==S&&(v=q(S),s.set(f,v),!b&&r!==0&&g(v)),p.append(v.el)}for(const f of[...s.keys()])l.has(f)||s.delete(f);if(o.replaceChildren(p),a){const f=N(z);f.textContent=a,o.append(f)}i=x}for(const{key:p,char:l}of n){const f=s.get(p);!f||f.char===l||(f.separator?(f.el.textContent=l,f.char=l):f.char===null||r===0?d(f,l):R(f,l,r))}},destroy(){for(const e of s.values())e.separator||e.animation?.cancel()}}}function Q({value:o,format:t,className:u,durationMs:s=T,easing:i=F,minIntervalMs:d=Y}){const R=w.useRef(null),g=w.useRef(null),e=w.useRef(o),r=w.useRef(null),m=w.useRef(0),a=w.useRef(void 0),c=w.useRef({format:t,durationMs:s,easing:i,minIntervalMs:d});return w.useEffect(()=>{c.current={format:t,durationMs:s,easing:i,minIntervalMs:d}}),w.useEffect(()=>{const n=R.current;if(!n)return;const{format:x,durationMs:b,easing:p}=c.current,l=G(n,{durationMs:b,easing:p});return g.current=l,l.paint(x(e.current),0),()=>{clearTimeout(a.current),a.current=void 0,r.current=null,g.current=null,l.destroy()}},[]),w.useEffect(()=>{const n=g.current;if(!n||o===e.current)return;const x=l=>{m.current=Date.now(),n.paint(c.current.format(l),l>=e.current?1:-1),e.current=l},b=Date.now()-m.current,p=c.current.minIntervalMs-b;if(p<=0){x(o);return}r.current=o,a.current??=window.setTimeout(()=>{a.current=void 0;const l=r.current;r.current=null,l!==null&&l!==e.current&&x(l)},p)},[o]),h.jsx("span",{ref:R,className:C(u)})}const A="(prefers-reduced-motion: reduce)";function X(o){const t=window.matchMedia(A);return t.addEventListener("change",o),()=>{t.removeEventListener("change",o)}}function B(){return window.matchMedia(A).matches}function H(){return w.useSyncExternalStore(X,B,J)}function J(){return!0}function K(o){const t=k.c(15),{current:u,previous:s,goodDirection:i,caption:d}=o;if(!s)return null;const R=(u-s)/s*100;if(R===0)return null;const g=R>0?"up":"down",e=g===i,r=g==="up"?I:O,m=e?"text-live":"text-destructive";let a;t[0]!==m?(a=C("inline-flex items-center gap-0.5 font-mono text-xs tabular-nums",m),t[0]=m,t[1]=a):a=t[1];let c;t[2]!==r?(c=h.jsx(r,{className:"size-3"}),t[2]=r,t[3]=c):c=t[3];let n;t[4]!==R?(n=Math.abs(R).toFixed(1),t[4]=R,t[5]=n):n=t[5];let x;t[6]!==a||t[7]!==c||t[8]!==n?(x=h.jsxs("span",{className:a,children:[c,n,"%"]}),t[6]=a,t[7]=c,t[8]=n,t[9]=x):x=t[9];let b;t[10]!==d?(b=d&&h.jsx("span",{className:"text-muted-foreground text-[11px]",children:d}),t[10]=d,t[11]=b):b=t[11];let p;return t[12]!==x||t[13]!==b?(p=h.jsxs(h.Fragment,{children:[x,b]}),t[12]=x,t[13]=b,t[14]=p):p=t[14],p}function W(o){const t=k.c(16),{value:u,format:s}=o,{url:i}=M(),d=D(),R=H();let g;t[0]!==s||t[1]!==u?(g=s(u),t[0]=s,t[1]=u,t[2]=g):g=t[2];const e=g,r=d&&!R;let m;t[3]!==r||t[4]!==s||t[5]!==e||t[6]!==i||t[7]!==u?(m=r?h.jsx(Q,{value:u,format:s},i):e,t[3]=r,t[4]=s,t[5]=e,t[6]=i,t[7]=u,t[8]=m):m=t[8];let a;t[9]!==m?(a=h.jsx("span",{"aria-hidden":"true",children:m}),t[9]=m,t[10]=a):a=t[10];let c;t[11]!==e?(c=h.jsx("span",{className:"sr-only",children:e}),t[11]=e,t[12]=c):c=t[12];let n;return t[13]!==a||t[14]!==c?(n=h.jsxs(h.Fragment,{children:[a,c]}),t[13]=a,t[14]=c,t[15]=n):n=t[15],n}function nt(o){const t=k.c(28),{label:u,value:s,roll:i,hint:d,tone:R,delta:g,deltaCaption:e,card:r,className:m}=o,c=(r===void 0?!1:r)&&"bg-card rounded-lg border";let n;t[0]!==m||t[1]!==c?(n=C("flex min-w-0 flex-col gap-1 px-4 py-3",c,m),t[0]=m,t[1]=c,t[2]=n):n=t[2];let x;t[3]!==u?(x=h.jsx("div",{className:"label-caps truncate",children:u}),t[3]=u,t[4]=x):x=t[4];const b=R==="destructive"&&"text-destructive",p=R==="warning"&&"text-warning",l=R==="success"&&"text-live";let f;t[5]!==b||t[6]!==p||t[7]!==l?(f=C("text-xl font-semibold tracking-tight tabular-nums sm:text-2xl",b,p,l),t[5]=b,t[6]=p,t[7]=l,t[8]=f):f=t[8];let y;t[9]!==i||t[10]!==s?(y=i?h.jsx(W,{...i}):s,t[9]=i,t[10]=s,t[11]=y):y=t[11];let S;t[12]!==f||t[13]!==y?(S=h.jsx("div",{className:f,children:y}),t[12]=f,t[13]=y,t[14]=S):S=t[14];let v;t[15]!==g||t[16]!==e?(v=g&&h.jsx(K,{...g,caption:e}),t[15]=g,t[16]=e,t[17]=v):v=t[17];let j;t[18]!==S||t[19]!==v?(j=h.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[S,v]}),t[18]=S,t[19]=v,t[20]=j):j=t[20];let L;t[21]!==d?(L=d&&h.jsx("div",{className:"text-muted-foreground truncate font-mono text-[11px]",children:d}),t[21]=d,t[22]=L):L=t[22];let _;return t[23]!==j||t[24]!==L||t[25]!==n||t[26]!==x?(_=h.jsxs("div",{className:n,children:[x,j,L]}),t[23]=j,t[24]=L,t[25]=n,t[26]=x,t[27]=_):_=t[27],_}function st(o){const t=k.c(5),{children:u,className:s}=o;let i;t[0]!==s?(i=C("bg-card divide-border grid grid-cols-2 divide-y overflow-hidden rounded-lg border sm:divide-x sm:divide-y-0","[&>*:nth-child(odd)]:border-r sm:[&>*:nth-child(odd)]:border-r-0","[&>*:nth-child(odd):last-child]:col-span-2 [&>*:nth-child(odd):last-child]:border-r-0 sm:[&>*:nth-child(odd):last-child]:col-span-1","sm:auto-cols-fr sm:grid-flow-col",s),t[0]=s,t[1]=i):i=t[1];let d;return t[2]!==u||t[3]!==i?(d=h.jsx("div",{className:i,children:u}),t[2]=u,t[3]=i,t[4]=d):d=t[4],d}export{nt as S,st as a};
@@ -1 +1 @@
1
- import{c as u,o as d,j as m}from"./inertia-FoqYZAk8.js";import{B as g}from"./app-layout-LvxN9xSS.js";import{s as x}from"./format-B9SDkrWj.js";const f={success:"border-live/30 bg-live/10 text-live",warning:"border-warning/40 bg-warning/10 text-warning",destructive:"border-danger/40 bg-danger/10 text-danger",muted:"border-border bg-muted text-muted-foreground"},v="rounded-sm px-1.5 font-mono text-[10px] tracking-wider uppercase";function j(c){const t=u.c(5),{status:e,outcome:i,label:o}=c,n=x(e,i),s=f[n];let r;t[0]!==s?(r=d(v,"tabular-nums",s),t[0]=s,t[1]=r):r=t[1];const a=o??i??e??"–";let l;return t[2]!==r||t[3]!==a?(l=m.jsx(g,{variant:"outline",className:r,children:a}),t[2]=r,t[3]=a,t[4]=l):l=t[4],l}function B(c){const t=u.c(5),{level:e}=c,o=f[e==="error"||e==="fatal"?"destructive":e==="warn"?"warning":e==="event"?"success":"muted"];let n;t[0]!==o?(n=d(v,o),t[0]=o,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s=m.jsx(g,{variant:"outline",className:n,children:e}),t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function N(c){const t=u.c(5),{status:e}=c,o=f[e==="open"?"destructive":e==="resolved"?"success":"muted"];let n;t[0]!==o?(n=d(v,o),t[0]=o,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s=m.jsx(g,{variant:"outline",className:n,children:e}),t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function h(c){const t=u.c(6),{children:e,tone:i,className:o}=c,s=f[i===void 0?"muted":i];let r;t[0]!==o||t[1]!==s?(r=d(v,s,o),t[0]=o,t[1]=s,t[2]=r):r=t[2];let a;return t[3]!==e||t[4]!==r?(a=m.jsx(g,{variant:"outline",className:r,children:e}),t[3]=e,t[4]=r,t[5]=a):a=t[5],a}export{N as I,h as K,B as L,j as S};
1
+ import{c as u,o as d,j as m}from"./inertia-b7M33AzA.js";import{B as g}from"./app-layout-CpEbDy93.js";import{s as x}from"./format-B9SDkrWj.js";const f={success:"border-live/30 bg-live/10 text-live",warning:"border-warning/40 bg-warning/10 text-warning",destructive:"border-danger/40 bg-danger/10 text-danger",muted:"border-border bg-muted text-muted-foreground"},v="rounded-sm px-1.5 font-mono text-[10px] tracking-wider uppercase";function j(c){const t=u.c(5),{status:e,outcome:i,label:o}=c,n=x(e,i),s=f[n];let r;t[0]!==s?(r=d(v,"tabular-nums",s),t[0]=s,t[1]=r):r=t[1];const a=o??i??e??"–";let l;return t[2]!==r||t[3]!==a?(l=m.jsx(g,{variant:"outline",className:r,children:a}),t[2]=r,t[3]=a,t[4]=l):l=t[4],l}function B(c){const t=u.c(5),{level:e}=c,o=f[e==="error"||e==="fatal"?"destructive":e==="warn"?"warning":e==="event"?"success":"muted"];let n;t[0]!==o?(n=d(v,o),t[0]=o,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s=m.jsx(g,{variant:"outline",className:n,children:e}),t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function N(c){const t=u.c(5),{status:e}=c,o=f[e==="open"?"destructive":e==="resolved"?"success":"muted"];let n;t[0]!==o?(n=d(v,o),t[0]=o,t[1]=n):n=t[1];let s;return t[2]!==e||t[3]!==n?(s=m.jsx(g,{variant:"outline",className:n,children:e}),t[2]=e,t[3]=n,t[4]=s):s=t[4],s}function h(c){const t=u.c(6),{children:e,tone:i,className:o}=c,s=f[i===void 0?"muted":i];let r;t[0]!==o||t[1]!==s?(r=d(v,s,o),t[0]=o,t[1]=s,t[2]=r):r=t[2];let a;return t[3]!==e||t[4]!==r?(a=m.jsx(g,{variant:"outline",className:r,children:e}),t[3]=e,t[4]=r,t[5]=a):a=t[5],a}export{N as I,h as K,B as L,j as S};
@@ -1 +1 @@
1
- import{am as p}from"./inertia-FoqYZAk8.js";function s(n,a,r,e){const o=String(p(n,a,r,e)),[i,t]=o.split("?");return`${i.replace(/\./g,"%2E")}${t?`?${t}`:""}`}export{s as t};
1
+ import{am as p}from"./inertia-b7M33AzA.js";function s(n,a,r,e){const o=String(p(n,a,r,e)),[i,t]=o.split("?");return`${i.replace(/\./g,"%2E")}${t?`?${t}`:""}`}export{s as t};
@@ -1 +1 @@
1
- import{x as i,c as l,r as p}from"./inertia-FoqYZAk8.js";const u=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],f=i("copy",u);function x(){const e=l.c(3),[o,c]=p.useState(null);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async a=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),c(a),!0}catch(s){return console.warn("Copy failed",s),c(null),!1}},e[0]=t):t=e[0];const n=t;let r;return e[1]!==o?(r=[o,n],e[1]=o,e[2]=r):r=e[2],r}export{f as C,x as u};
1
+ import{x as i,c as l,r as p}from"./inertia-b7M33AzA.js";const u=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],f=i("copy",u);function x(){const e=l.c(3),[o,c]=p.useState(null);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=async a=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(a),c(a),!0}catch(s){return console.warn("Copy failed",s),c(null),!1}},e[0]=t):t=e[0];const n=t;let r;return e[1]!==o?(r=[o,n],e[1]=o,e[2]=r):r=e[2],r}export{f as C,x as u};
@@ -0,0 +1 @@
1
+ import{r as c,c as rt,d as L}from"./inertia-b7M33AzA.js";var T={logger:typeof console<"u"?console:void 0,WebSocket:typeof WebSocket<"u"?WebSocket:void 0},i={log(...n){this.enabled&&(n.push(Date.now()),T.logger.log("[ActionCable]",...n))}};const g=()=>new Date().getTime(),C=n=>(g()-n)/1e3;class N{constructor(t){this.visibilityDidChange=this.visibilityDidChange.bind(this),this.connection=t,this.reconnectAttempts=0}start(){this.isRunning()||(this.startedAt=g(),delete this.stoppedAt,this.startPolling(),addEventListener("visibilitychange",this.visibilityDidChange),i.log(`ConnectionMonitor started. stale threshold = ${this.constructor.staleThreshold} s`))}stop(){this.isRunning()&&(this.stoppedAt=g(),this.stopPolling(),removeEventListener("visibilitychange",this.visibilityDidChange),i.log("ConnectionMonitor stopped"))}isRunning(){return this.startedAt&&!this.stoppedAt}recordMessage(){this.pingedAt=g()}recordConnect(){this.reconnectAttempts=0,delete this.disconnectedAt,i.log("ConnectionMonitor recorded connect")}recordDisconnect(){this.disconnectedAt=g(),i.log("ConnectionMonitor recorded disconnect")}startPolling(){this.stopPolling(),this.poll()}stopPolling(){clearTimeout(this.pollTimeout)}poll(){this.pollTimeout=setTimeout((()=>{this.reconnectIfStale(),this.poll()}),this.getPollInterval())}getPollInterval(){const{staleThreshold:t,reconnectionBackoffRate:e}=this.constructor,s=Math.pow(1+e,Math.min(this.reconnectAttempts,10)),r=(this.reconnectAttempts===0?1:e)*Math.random();return t*1e3*s*(1+r)}reconnectIfStale(){this.connectionIsStale()&&(i.log(`ConnectionMonitor detected stale connection. reconnectAttempts = ${this.reconnectAttempts}, time stale = ${C(this.refreshedAt)} s, stale threshold = ${this.constructor.staleThreshold} s`),this.reconnectAttempts++,this.disconnectedRecently()?i.log(`ConnectionMonitor skipping reopening recent disconnect. time disconnected = ${C(this.disconnectedAt)} s`):(i.log("ConnectionMonitor reopening"),this.connection.reopen()))}get refreshedAt(){return this.pingedAt?this.pingedAt:this.startedAt}connectionIsStale(){return C(this.refreshedAt)>this.constructor.staleThreshold}disconnectedRecently(){return this.disconnectedAt&&C(this.disconnectedAt)<this.constructor.staleThreshold}visibilityDidChange(){document.visibilityState==="visible"&&setTimeout((()=>{(this.connectionIsStale()||!this.connection.isOpen())&&(i.log(`ConnectionMonitor reopening stale connection on visibilitychange. visibilityState = ${document.visibilityState}`),this.connection.reopen())}),200)}}N.staleThreshold=6;N.reconnectionBackoffRate=.15;var z={message_types:{welcome:"welcome",disconnect:"disconnect",ping:"ping",confirmation:"confirm_subscription",rejection:"reject_subscription"},default_mount_path:"/cable",protocols:["actioncable-v1-json","actioncable-unsupported"]};const{message_types:p,protocols:x}=z,ct=x.slice(0,x.length-1),V=[].indexOf;class I{constructor(t){this.open=this.open.bind(this),this.consumer=t,this.subscriptions=this.consumer.subscriptions,this.monitor=new N(this),this.disconnected=!0}send(t){return this.isOpen()?(this.webSocket.send(JSON.stringify(t)),!0):!1}open(){if(this.isActive())return i.log(`Attempted to open WebSocket, but existing socket is ${this.getState()}`),!1;{const t=[...x,...this.consumer.subprotocols||[]];return i.log(`Opening WebSocket, current state is ${this.getState()}, subprotocols: ${t}`),this.webSocket&&this.uninstallEventHandlers(),this.webSocket=new T.WebSocket(this.consumer.url,t),this.installEventHandlers(),this.monitor.start(),!0}}close({allowReconnect:t}={allowReconnect:!0}){if(t||this.monitor.stop(),this.isOpen())return this.webSocket.close()}reopen(){if(i.log(`Reopening WebSocket, current state is ${this.getState()}`),this.isActive())try{return this.close()}catch(t){i.log("Failed to reopen WebSocket",t)}finally{i.log(`Reopening WebSocket in ${this.constructor.reopenDelay}ms`),setTimeout(this.open,this.constructor.reopenDelay)}else return this.open()}getProtocol(){if(this.webSocket)return this.webSocket.protocol}isOpen(){return this.isState("open")}isActive(){return this.isState("open","connecting")}triedToReconnect(){return this.monitor.reconnectAttempts>0}isProtocolSupported(){return V.call(ct,this.getProtocol())>=0}isState(...t){return V.call(t,this.getState())>=0}getState(){if(this.webSocket){for(let t in T.WebSocket)if(T.WebSocket[t]===this.webSocket.readyState)return t.toLowerCase()}return null}installEventHandlers(){for(let t in this.events){const e=this.events[t].bind(this);this.webSocket[`on${t}`]=e}}uninstallEventHandlers(){for(let t in this.events)this.webSocket[`on${t}`]=function(){}}}I.reopenDelay=500;I.prototype.events={message(n){if(!this.isProtocolSupported())return;const{identifier:t,message:e,reason:s,reconnect:o,type:r}=JSON.parse(n.data);switch(this.monitor.recordMessage(),r){case p.welcome:return this.triedToReconnect()&&(this.reconnectAttempted=!0),this.monitor.recordConnect(),this.subscriptions.reload();case p.disconnect:return i.log(`Disconnecting. Reason: ${s}`),this.close({allowReconnect:o});case p.ping:return null;case p.confirmation:return this.subscriptions.confirmSubscription(t),this.reconnectAttempted?(this.reconnectAttempted=!1,this.subscriptions.notify(t,"connected",{reconnected:!0})):this.subscriptions.notify(t,"connected",{reconnected:!1});case p.rejection:return this.subscriptions.reject(t);default:return this.subscriptions.notify(t,"received",e)}},open(){if(i.log(`WebSocket onopen event, using '${this.getProtocol()}' subprotocol`),this.disconnected=!1,!this.isProtocolSupported())return i.log("Protocol is unsupported. Stopping monitor and disconnecting."),this.close({allowReconnect:!1})},close(n){if(i.log("WebSocket onclose event"),!this.disconnected)return this.disconnected=!0,this.monitor.recordDisconnect(),this.subscriptions.notifyAll("disconnected",{willAttemptReconnect:this.monitor.isRunning()})},error(){i.log("WebSocket onerror event")}};const lt=function(n,t){if(t!=null)for(let e in t){const s=t[e];n[e]=s}return n};class at{constructor(t,e={},s){this.consumer=t,this.identifier=JSON.stringify(e),lt(this,s)}perform(t,e={}){return e.action=t,this.send(e)}send(t){return this.consumer.send({command:"message",identifier:this.identifier,data:JSON.stringify(t)})}unsubscribe(){return this.consumer.subscriptions.remove(this)}}class ut{constructor(t){this.subscriptions=t,this.pendingSubscriptions=[]}guarantee(t){this.pendingSubscriptions.indexOf(t)==-1?(i.log(`SubscriptionGuarantor guaranteeing ${t.identifier}`),this.pendingSubscriptions.push(t)):i.log(`SubscriptionGuarantor already guaranteeing ${t.identifier}`),this.startGuaranteeing()}forget(t){i.log(`SubscriptionGuarantor forgetting ${t.identifier}`),this.pendingSubscriptions=this.pendingSubscriptions.filter((e=>e!==t))}startGuaranteeing(){this.stopGuaranteeing(),this.retrySubscribing()}stopGuaranteeing(){clearTimeout(this.retryTimeout)}retrySubscribing(){this.retryTimeout=setTimeout((()=>{this.subscriptions&&typeof this.subscriptions.subscribe=="function"&&this.pendingSubscriptions.map((t=>{i.log(`SubscriptionGuarantor resubscribing ${t.identifier}`),this.subscriptions.subscribe(t)}))}),500)}}class ht{constructor(t){this.consumer=t,this.guarantor=new ut(this),this.subscriptions=[]}create(t,e){const s=t,o=typeof s=="object"?s:{channel:s},r=new at(this.consumer,o,e);return this.add(r)}add(t){return this.subscriptions.push(t),this.consumer.ensureActiveConnection(),this.notify(t,"initialized"),this.subscribe(t),t}remove(t){return this.forget(t),this.findAll(t.identifier).length||this.sendCommand(t,"unsubscribe"),t}reject(t){return this.findAll(t).map((e=>(this.forget(e),this.notify(e,"rejected"),e)))}forget(t){return this.guarantor.forget(t),this.subscriptions=this.subscriptions.filter((e=>e!==t)),t}findAll(t){return this.subscriptions.filter((e=>e.identifier===t))}reload(){return this.subscriptions.map((t=>this.subscribe(t)))}notifyAll(t,...e){return this.subscriptions.map((s=>this.notify(s,t,...e)))}notify(t,e,...s){let o;return typeof t=="string"?o=this.findAll(t):o=[t],o.map((r=>typeof r[e]=="function"?r[e](...s):void 0))}subscribe(t){this.sendCommand(t,"subscribe")&&this.guarantor.guarantee(t)}confirmSubscription(t){i.log(`Subscription confirmed ${t}`),this.findAll(t).map((e=>this.guarantor.forget(e)))}sendCommand(t,e){const{identifier:s}=t;return this.consumer.send({command:e,identifier:s})}}class dt{constructor(t){this._url=t,this.subscriptions=new ht(this),this.connection=new I(this),this.subprotocols=[]}get url(){return ft(this._url)}send(t){return this.connection.send(t)}connect(){return this.connection.open()}disconnect(){return this.connection.close({allowReconnect:!1})}ensureActiveConnection(){if(!this.connection.isActive())return this.connection.open()}addSubProtocol(t){this.subprotocols=[...this.subprotocols,t]}}function ft(n){if(typeof n=="function"&&(n=n()),n&&!/^wss?:/i.test(n)){const t=document.createElement("a");return t.href=n,t.href=t.href,t.protocol=t.protocol.replace("http","ws"),t.href}else return n}function pt(n=gt("url")||z.default_mount_path){return new dt(n)}function gt(n){const t=document.head.querySelector(`meta[name='action-cable-${n}']`);if(t)return t.getAttribute("content")}let q;function mt(){return q??=pt(),q}const bt=5e3,K="railwatch:live-paused";let j=!1;const G=new Set;function Y(n){if(j!==n){j=n;for(const t of G)t()}}function St(n){return G.add(n),()=>{G.delete(n)}}function Tt(){return c.useSyncExternalStore(St,vt,yt)}function yt(){return!1}function vt(){return j}function Et(n,t){const e=rt.c(19);let s;e[0]!==t?(s={},e[0]=t,e[1]=s):s=e[1];const{only:o,onEvent:r}=s,[h,E]=c.useState(!1),[_,H]=c.useState(null),[$,F]=c.useState(null),[Q,X]=c.useState(n);Q!==n&&(X(n),E(!1),H(null),F(null));const[l,Z]=c.useState(kt),J=c.useRef(o),B=c.useRef(r),P=c.useRef(l);let m;e[2]!==r||e[3]!==o||e[4]!==l?(m=()=>{J.current=o,B.current=r,P.current=l},e[2]=r,e[3]=o,e[4]=l,e[5]=m):m=e[5],c.useEffect(m);const D=c.useRef(Rt);let b,S;e[6]!==h||e[7]!==l?(b=()=>(Y(h&&!l),wt),S=[h,l],e[6]=h,e[7]=l,e[8]=b,e[9]=S):(b=e[8],S=e[9]),c.useEffect(b,S);let y;e[10]===Symbol.for("react.memo_cache_sentinel")?(y=function(u){P.current=u,localStorage.setItem(K,u?"1":"0"),Z(u),D.current()},e[10]=y):y=e[10];const tt=y;let v,A;e[11]!==n?(v=()=>{let d=!1,u=!1,M=!1,O=!1,W=-1/0,R,k;const et=function(){u=!1,M=!0,W=Date.now(),L.reload({only:J.current,onCancelToken:ot=>{k=()=>ot.cancel()},onSuccess:()=>{d||F(Date.now())},onFinish:()=>{k=void 0,M=!1,f()}})};function f(){if(clearTimeout(R),R=void 0,d||!u||M||O||P.current||document.visibilityState!=="visible")return;const a=bt-(Date.now()-W);a>0?R=setTimeout(f,a):et()}const U=function(){f()},nt=L.on("start",a=>{a.detail.visit.async||(O=!0,u=!1,W=Date.now(),k?.())}),it=L.on("finish",a=>{a.detail.visit.async||(O=!1,f())});document.addEventListener("visibilitychange",U),D.current=f;const st=mt().subscriptions.create({channel:"EnvironmentChannel",id:n},{connected:()=>{d||E(!0)},disconnected:()=>{d||E(!1)},received:a=>{d||(H(Date.now()),B.current?.(a),u=!0,f())}});return()=>{d=!0,k?.(),clearTimeout(R),nt(),it(),D.current=At,document.removeEventListener("visibilitychange",U),st.unsubscribe()}},A=[n],e[11]=n,e[12]=v,e[13]=A):(v=e[12],A=e[13]),c.useEffect(v,A);let w;return e[14]!==h||e[15]!==_||e[16]!==$||e[17]!==l?(w={connected:h,lastEventAt:_,lastRefreshedAt:$,paused:l,setPaused:tt},e[14]=h,e[15]=_,e[16]=$,e[17]=l,e[18]=w):w=e[18],w}function At(){}function wt(){return Y(!1)}function Rt(){}function kt(){return typeof window>"u"?!1:localStorage.getItem(K)==="1"}export{Tt as a,Et as u};