railwatch 0.3.7 → 0.5.0

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 (156) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +58 -0
  3. data/app/controllers/railwatch/commands_controller.rb +1 -1
  4. data/app/controllers/railwatch/environment_scoped.rb +18 -36
  5. data/app/controllers/railwatch/exceptions_controller.rb +8 -9
  6. data/app/controllers/railwatch/processes_controller.rb +1 -1
  7. data/app/controllers/railwatch/releases_controller.rb +2 -2
  8. data/app/controllers/railwatch/tenants_controller.rb +2 -2
  9. data/app/controllers/railwatch/thresholds_controller.rb +8 -1
  10. data/{lib/generators/railwatch/install/templates → app/frontend/lib}/railwatch.ts +162 -42
  11. data/app/jobs/railwatch/detect_performance_issues_job.rb +12 -2
  12. data/app/models/railwatch/anomaly_rule.rb +20 -2
  13. data/app/models/railwatch/ingest/batch.rb +1 -0
  14. data/app/models/railwatch/ingest/mapper.rb +12 -0
  15. data/app/models/railwatch/telemetry/aggregations.rb +154 -19
  16. data/app/models/railwatch/telemetry/exception.rb +7 -0
  17. data/app/models/railwatch/telemetry/execution.rb +18 -0
  18. data/app/models/railwatch/telemetry/log.rb +6 -0
  19. data/app/models/railwatch/telemetry/query.rb +7 -0
  20. data/app/models/railwatch/telemetry/release_health.rb +12 -6
  21. data/app/models/railwatch/telemetry/rollup.rb +17 -2
  22. data/app/models/railwatch/telemetry/tenant.rb +8 -23
  23. data/app/models/railwatch/telemetry_record.rb +8 -6
  24. data/app/models/railwatch/threshold.rb +41 -4
  25. data/app/models/railwatch/window.rb +66 -0
  26. data/docs/embedded.md +11 -0
  27. data/lib/generators/railwatch/install/install_generator.rb +5 -1
  28. data/lib/railwatch/transport/http.rb +15 -5
  29. data/lib/railwatch/version.rb +1 -1
  30. data/lib/railwatch/wire_fixtures.json +856 -0
  31. data/lib/railwatch.rb +22 -0
  32. data/lib/tasks/railwatch_tasks.rake +7 -0
  33. data/public/railwatch/assets/app-layout-DDyQa72H.js +1 -0
  34. data/public/railwatch/assets/{app-wordmark-1SRllgHv.js → app-wordmark-o9CODKP0.js} +1 -1
  35. data/public/railwatch/assets/{appearance-DbwahDrc.js → appearance-BwuCXabr.js} +1 -1
  36. data/public/railwatch/assets/application-B7h1MIhi.css +1 -0
  37. data/public/railwatch/assets/{arrow-up-DwKQcab4.js → arrow-up-C6PxDiY3.js} +1 -1
  38. data/public/railwatch/assets/{auth-layout-DXfxXAN_.js → auth-layout-BRt8MGFD.js} +1 -1
  39. data/public/railwatch/assets/{badge-CApjyWcg.js → badge-CAxXV8za.js} +1 -1
  40. data/public/railwatch/assets/{braces-kGSgxWnS.js → braces-DgomTCNf.js} +1 -1
  41. data/public/railwatch/assets/{card-BaJ8kNkp.js → card-cAtqCxWl.js} +1 -1
  42. data/public/railwatch/assets/{chart-Xnrz1Nqw.js → chart-BBeBkkNa.js} +1 -1
  43. data/public/railwatch/assets/{chart-hover-XYPNE2CX.js → chart-hover-B1M9jc0y.js} +1 -1
  44. data/public/railwatch/assets/chart-panel-DUQTz_C8.js +1 -0
  45. data/public/railwatch/assets/{checkbox-Bf41R8W6.js → checkbox-CmhMHWZO.js} +1 -1
  46. data/public/railwatch/assets/{code-a-9sh36A.js → code-DESvxyTj.js} +1 -1
  47. data/public/railwatch/assets/{copy-block-zykZWQym.js → copy-block-BkSU5832.js} +1 -1
  48. data/public/railwatch/assets/{copy-id-b6CW5ESL.js → copy-id-D03GhN9F.js} +1 -1
  49. data/public/railwatch/assets/{cursor-load-more-0cHzbTPT.js → cursor-load-more-CRyuMeQb.js} +1 -1
  50. data/public/railwatch/assets/{data-table-IvA7xvrK.js → data-table-BIlt7Rtm.js} +1 -1
  51. data/public/railwatch/assets/{edit-DTtRV1fO.js → edit-Bb6MKoe4.js} +1 -1
  52. data/public/railwatch/assets/{edit-7lmf3k80.js → edit-DJ0D0wHN.js} +1 -1
  53. data/public/railwatch/assets/{edit-ZKE15r-F.js → edit-O0NSBWxo.js} +1 -1
  54. data/public/railwatch/assets/{empty-state-BFTnQ2oT.js → empty-state-C38il627.js} +1 -1
  55. data/public/railwatch/assets/env-layout-REF7OM4q.js +1 -0
  56. data/public/railwatch/assets/{execution-path-Di5uUHi-.js → execution-path-FYLq1TwC.js} +1 -1
  57. data/public/railwatch/assets/{filter-bar-Btm__gQi.js → filter-bar-CYog9Alp.js} +1 -1
  58. data/public/railwatch/assets/{flamegraph-C-mZdqa7.js → flamegraph-DSs69foN.js} +1 -1
  59. data/public/railwatch/assets/{frames-KZBsjg6-.js → frames-BUi2J5Mk.js} +1 -1
  60. data/public/railwatch/assets/{google-sign-in-button-DJRoD72g.js → google-sign-in-button-BQiIKFdd.js} +1 -1
  61. data/public/railwatch/assets/{index-9LL_C3eG.js → index-8-hnAhOD.js} +1 -1
  62. data/public/railwatch/assets/{index-Bjw4sTXU.js → index-BaR1U9An.js} +1 -1
  63. data/public/railwatch/assets/{index-BtSlLmkg.js → index-BeOh2t_S.js} +1 -1
  64. data/public/railwatch/assets/{index-DXUwhSCQ.js → index-BiiyMcA0.js} +1 -1
  65. data/public/railwatch/assets/{index-P_e_cI0O.js → index-BoUBioBP.js} +1 -1
  66. data/public/railwatch/assets/{index-kNhZPLVj.js → index-C-PmdhXA.js} +1 -1
  67. data/public/railwatch/assets/{index-DCAho97K.js → index-C3A_9imx.js} +1 -1
  68. data/public/railwatch/assets/{index-BsrCnQqg.js → index-C7OtLq_3.js} +1 -1
  69. data/public/railwatch/assets/{index-Bot7kHMA.js → index-CFFpnzIS.js} +1 -1
  70. data/public/railwatch/assets/{index-Z1c4nFL0.js → index-CFRLPs4J.js} +1 -1
  71. data/public/railwatch/assets/{index-BAkZNNEh.js → index-CGs4m_fa.js} +1 -1
  72. data/public/railwatch/assets/{index-CIUl9POV.js → index-CICUIFHL.js} +1 -1
  73. data/public/railwatch/assets/{index-wOj5j0KC.js → index-C_upSl_k.js} +1 -1
  74. data/public/railwatch/assets/{index-Cj3_jD1E.js → index-CiPo4Gob.js} +1 -1
  75. data/public/railwatch/assets/{index-EGU__DOB.js → index-CpkI015n.js} +1 -1
  76. data/public/railwatch/assets/{index-DEfu_YvU.js → index-CrZ3vHDL.js} +1 -1
  77. data/public/railwatch/assets/{index-CAzQkw-h.js → index-CsoN51vW.js} +1 -1
  78. data/public/railwatch/assets/{index-CeqMDByC.js → index-DDI_Zx5V.js} +1 -1
  79. data/public/railwatch/assets/index-DSvlZVWG.js +1 -0
  80. data/public/railwatch/assets/{index-CU6yhEyt.js → index-DW2CBbxU.js} +1 -1
  81. data/public/railwatch/assets/{index-uHBVO8Lh.js → index-Dh4IRLFI.js} +1 -1
  82. data/public/railwatch/assets/{index-HCJmFcZu.js → index-DqTFTP8p.js} +1 -1
  83. data/public/railwatch/assets/index-DrcKVG2f.js +1 -0
  84. data/public/railwatch/assets/{index-QyHE9WsU.js → index-DtHmuB9Q.js} +1 -1
  85. data/public/railwatch/assets/{index-CBJZQgHA.js → index-DvjY3dPD.js} +1 -1
  86. data/public/railwatch/assets/{index-Bo8hrjbs.js → index-FhUaPPab.js} +1 -1
  87. data/public/railwatch/assets/{index-BWSyQRZI.js → index-JdCVBrw8.js} +1 -1
  88. data/public/railwatch/assets/{index-DAEzO_vq.js → index-QpTtwFwu.js} +1 -1
  89. data/public/railwatch/assets/{index-D4968-TC.js → index-ZOGOB8SA.js} +1 -1
  90. data/public/railwatch/assets/{index-CP6jrrPT.js → index-ZSZg9rtq.js} +1 -1
  91. data/public/railwatch/assets/{index-DcItJxa5.js → index-r0tSIplE.js} +1 -1
  92. data/public/railwatch/assets/{index-CYYmZpZu.js → index-sTYvcbkh.js} +1 -1
  93. data/public/railwatch/assets/{index-B0VXzXYG.js → index-so4lRrRq.js} +1 -1
  94. data/public/railwatch/assets/{index-B-bSm1jB.js → index-tpz-OGUP.js} +1 -1
  95. data/public/railwatch/assets/{index-CX8Br7m9.js → index-umIAl-pL.js} +1 -1
  96. data/public/railwatch/assets/{inertia-Degv_G9N.js → inertia-DLew8ZNx.js} +3 -3
  97. data/public/railwatch/assets/{input-error-C6SqO_iU.js → input-error-cvM6_Jht.js} +1 -1
  98. data/public/railwatch/assets/{json-viewer-DcQIxT86.js → json-viewer-D922McGi.js} +1 -1
  99. data/public/railwatch/assets/{klass-WgQEfWpo.js → klass-CrwICqN8.js} +1 -1
  100. data/public/railwatch/assets/{label-B_vK19tR.js → label-GWl7I6sf.js} +1 -1
  101. data/public/railwatch/assets/{layout-C8q7GUlZ.js → layout-0ZAnD3zl.js} +1 -1
  102. data/public/railwatch/assets/{live-dot-DaXEbkXo.js → live-dot-D1n_BreY.js} +1 -1
  103. data/public/railwatch/assets/{nav-BnD5XArZ.js → nav-DPxr1NNC.js} +1 -1
  104. data/public/railwatch/assets/{new-BL9OqXHe.js → new-Cdl6pqST.js} +1 -1
  105. data/public/railwatch/assets/{new-uxMnBtoY.js → new-D-ZzUK9a.js} +1 -1
  106. data/public/railwatch/assets/{new-BqP0NhOF.js → new-DEVkYv-z.js} +1 -1
  107. data/public/railwatch/assets/{new-CWP3wtwt.js → new-DHAHDrN7.js} +1 -1
  108. data/public/railwatch/assets/{new-DIjwu2jF.js → new-Dz4lZf1L.js} +1 -1
  109. data/public/railwatch/assets/{new-BhRnQn4w.js → new-GMrRFurX.js} +1 -1
  110. data/public/railwatch/assets/{onboarding-C_Y3xTsH.js → onboarding-D1vwaHYT.js} +1 -1
  111. data/public/railwatch/assets/{origin-identity-CNhOnfBa.js → origin-identity-Bk9yHWZ1.js} +1 -1
  112. data/public/railwatch/assets/{percentile-picker-BujVEhP6.js → percentile-picker-DfSx9yJO.js} +1 -1
  113. data/public/railwatch/assets/{relative-time-6CoKr1lN.js → relative-time-CjIjb8Lg.js} +1 -1
  114. data/public/railwatch/assets/{release-health-1Qzc_XhT.js → release-health-4b3tivEf.js} +1 -1
  115. data/public/railwatch/assets/{route-xqgYjOwJ.js → route-C_5BUtHK.js} +1 -1
  116. data/public/railwatch/assets/{segmented-CVKq2Xpa.js → segmented-BgbT3wZa.js} +1 -1
  117. data/public/railwatch/assets/{select-CsmSXsJ4.js → select-DmunxCKE.js} +1 -1
  118. data/public/railwatch/assets/{separator-CrM10Oot.js → separator-BXzEdZ_8.js} +1 -1
  119. data/public/railwatch/assets/series-chart-Xf49v9cv.js +1 -0
  120. data/public/railwatch/assets/{show-zxVxhUel.js → show-B2zLAW83.js} +1 -1
  121. data/public/railwatch/assets/{show-BM-E2iYc.js → show-BLpWUHWD.js} +1 -1
  122. data/public/railwatch/assets/{show-CvNV23gH.js → show-CAl7xcex.js} +1 -1
  123. data/public/railwatch/assets/{show-BlNR3ZOZ.js → show-DI8IhNUH.js} +1 -1
  124. data/public/railwatch/assets/{show-B0nHy31L.js → show-DSP9Cq_C.js} +2 -2
  125. data/public/railwatch/assets/{show-rysBbvt-.js → show-DXs4deaC.js} +1 -1
  126. data/public/railwatch/assets/{show-DUwQlohF.js → show-DYskfl3-.js} +1 -1
  127. data/public/railwatch/assets/{show-ixK2r2f1.js → show-DcpTFiLi.js} +1 -1
  128. data/public/railwatch/assets/{show-CQ4Ze-Un.js → show-Dily73Xk.js} +1 -1
  129. data/public/railwatch/assets/{show-B3izvRdU.js → show-DlRVS18-.js} +1 -1
  130. data/public/railwatch/assets/{show-8H9WAGav.js → show-Dn-GwFZL.js} +1 -1
  131. data/public/railwatch/assets/{show-DZwcZZrz.js → show-DnR1Dnjd.js} +1 -1
  132. data/public/railwatch/assets/{show-CMisHNAI.js → show-SHwZjXb7.js} +1 -1
  133. data/public/railwatch/assets/{show-B7NhcWgp.js → show-SvLOcPrx.js} +1 -1
  134. data/public/railwatch/assets/{show-CJMeX75E.js → show-Y74rM0VT.js} +1 -1
  135. data/public/railwatch/assets/{show-DMZlwzL_.js → show-mU38uGTg.js} +1 -1
  136. data/public/railwatch/assets/{show-9jDeBNpc.js → show-vQ4bndYD.js} +1 -1
  137. data/public/railwatch/assets/{sort-header-CKj_7G3U.js → sort-header-Dcq9bzmo.js} +1 -1
  138. data/public/railwatch/assets/{sparkline-cell-Ckg29yVq.js → sparkline-cell-BON3qQUB.js} +1 -1
  139. data/public/railwatch/assets/{stat-TxvoBiC8.js → stat-DFEyFxkO.js} +1 -1
  140. data/public/railwatch/assets/{status-badge-5NCVJHjo.js → status-badge-BaUKP7Yo.js} +1 -1
  141. data/public/railwatch/assets/{tenant-path-B5ZRK4x3.js → tenant-path-DPZPc985.js} +1 -1
  142. data/public/railwatch/assets/{text-link-BPllRj0F.js → text-link-BO77t9Xk.js} +1 -1
  143. data/public/railwatch/assets/{textarea-DtD5yZp_.js → textarea-DTqrCiV0.js} +1 -1
  144. data/public/railwatch/assets/{timeline-DZz5ZnHN.js → timeline-D5rJ0es2.js} +1 -1
  145. data/public/railwatch/assets/{transition-Ds6Cakuc.js → transition-DMIrZVth.js} +1 -1
  146. data/public/railwatch/assets/{use-clipboard-BLjjYH8V.js → use-clipboard-ByoUGQqA.js} +1 -1
  147. data/public/railwatch/assets/{use-live-GKze1mNC.js → use-live-D7xKz2ma.js} +1 -1
  148. data/public/railwatch/manifest.json +1284 -1284
  149. metadata +119 -117
  150. data/public/railwatch/assets/app-layout-B5Fcdwfz.js +0 -1
  151. data/public/railwatch/assets/application-CwshqwM6.css +0 -1
  152. data/public/railwatch/assets/chart-panel-BYk68mJJ.js +0 -1
  153. data/public/railwatch/assets/env-layout-erSDpIXg.js +0 -1
  154. data/public/railwatch/assets/index-BoTOVM0v.js +0 -1
  155. data/public/railwatch/assets/index-DBTxQw77.js +0 -1
  156. data/public/railwatch/assets/series-chart-D33UhdG2.js +0 -1
@@ -1 +1 @@
1
- import{r as i,j as u,c as L,C as H}from"./inertia-Degv_G9N.js";import{u as U}from"./app-wordmark-1SRllgHv.js";import{c as G,d as K,a as j,u as X,P as $,C as J}from"./index-CX8Br7m9.js";import{P as S}from"./index-B0VXzXYG.js";var Q=Object.defineProperty,k=(o,e)=>Q(o,"name",{value:e,configurable:!0}),w="Checkbox",[V,ue]=G(w),[W,B]=V(w);function q(o){const{__scopeCheckbox:e,checked:c,children:r,defaultChecked:n,disabled:d,form:t,name:l,onCheckedChange:s,required:f,value:v="on",internal_do_not_use_render:C}=o,[b,x]=X({prop:c,defaultProp:n??!1,onChange:s,caller:w}),[g,I]=i.useState(null),[R,_]=i.useState(null),P=i.useRef(!1),[a,p]=i.useReducer(m=>m+1,0),E=g?!!t||!!g.closest("form"):!0,y={checked:b,disabled:d,setChecked:x,control:g,setControl:I,name:l,form:t,value:v,hasConsumerStoppedPropagationRef:P,userInteractionCount:a,onUserInteraction:p,required:f,defaultChecked:h(n)?!1:n,isFormControl:E,bubbleInput:R,setBubbleInput:_};return u.jsx(W,{scope:e,...y,children:A(C)?C(y):r})}k(q,"CheckboxProvider");var Y="CheckboxTrigger",Z=i.forwardRef(k(function({__scopeCheckbox:e,onKeyDown:c,onClick:r,...n},d){const{control:t,value:l,disabled:s,checked:f,required:v,setControl:C,setChecked:b,hasConsumerStoppedPropagationRef:x,onUserInteraction:g,isFormControl:I,bubbleInput:R}=B(Y,e),_=U(d,C),P=i.useRef(f);return i.useEffect(()=>{const a=t?.form;if(a){const p=k(()=>b(P.current),"reset");return a.addEventListener("reset",p),()=>a.removeEventListener("reset",p)}},[t,b]),u.jsx(S.button,{type:"button",role:"checkbox","aria-checked":h(f)?"mixed":f,"aria-required":v,"data-state":N(f),"data-disabled":s?"":void 0,disabled:s,value:l,...n,ref:_,onKeyDown:j(c,a=>{a.key==="Enter"&&a.preventDefault()}),onClick:j(r,a=>{g(),b(p=>h(p)?!0:!p),R&&I&&(x.current=a.isPropagationStopped(),x.current||a.stopPropagation())})})},"CheckboxTrigger")),ee=i.forwardRef(k(function(e,c){const{__scopeCheckbox:r,name:n,checked:d,defaultChecked:t,required:l,disabled:s,value:f,onCheckedChange:v,form:C,...b}=e;return u.jsx(q,{__scopeCheckbox:r,checked:d,defaultChecked:t,disabled:s,required:l,onCheckedChange:v,name:n,form:C,value:f,internal_do_not_use_render:({isFormControl:x})=>u.jsxs(u.Fragment,{children:[u.jsx(Z,{...b,ref:c,__scopeCheckbox:r}),x&&u.jsx(ne,{__scopeCheckbox:r})]})})},"Checkbox")),te="CheckboxIndicator",re=i.forwardRef(k(function(e,c){const{__scopeCheckbox:r,forceMount:n,...d}=e,t=B(te,r);return u.jsx($,{present:n||h(t.checked)||t.checked===!0,children:u.jsx(S.span,{"data-state":N(t.checked),"data-disabled":t.disabled?"":void 0,...d,ref:c,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),oe="CheckboxBubbleInput",ne=i.forwardRef(k(function({__scopeCheckbox:e,onClick:c,...r},n){const{control:d,hasConsumerStoppedPropagationRef:t,userInteractionCount:l,checked:s,defaultChecked:f,required:v,disabled:C,name:b,value:x,form:g,bubbleInput:I,setBubbleInput:R}=B(oe,e),_=U(n,R),P=K(d),a=i.useRef(!1),p=i.useRef(s),E=i.useRef(l);i.useEffect(()=>{const m=I;if(!m)return;const F=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(F,"checked").set,M=l!==E.current;E.current=l;const O=p.current!==s;p.current=s;const z=!(M&&t.current);if(O&&T){a.current=!M;const D=new Event("click",{bubbles:z});m.indeterminate=h(s),T.call(m,h(s)?!1:s),m.dispatchEvent(D),a.current=!1}},[I,s,t,l]);const y=i.useRef(h(s)?!1:s);return u.jsx(S.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??y.current,required:v,disabled:C,name:b,value:x,form:g,...r,tabIndex:-1,ref:_,onClick:j(c,m=>{a.current&&m.stopPropagation()}),style:{...r.style,...P,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function A(o){return typeof o=="function"}k(A,"isFunction");function h(o){return o==="indeterminate"}k(h,"isIndeterminate");function N(o){return h(o)?"indeterminate":o?"checked":"unchecked"}k(N,"getState");function le(o){const e=L.c(9);let c,r;e[0]!==o?({className:c,...r}=o,e[0]=o,e[1]=c,e[2]=r):(c=e[1],r=e[2]);let n;e[3]!==c?(n=H("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",c),e[3]=c,e[4]=n):n=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(re,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:u.jsx(J,{className:"size-3.5"})}),e[5]=d):d=e[5];let t;return e[6]!==r||e[7]!==n?(t=u.jsx(ee,{"data-slot":"checkbox",className:n,...r,children:d}),e[6]=r,e[7]=n,e[8]=t):t=e[8],t}export{le as C};
1
+ import{r as i,j as u,c as L,C as H}from"./inertia-DLew8ZNx.js";import{u as U}from"./app-wordmark-o9CODKP0.js";import{c as G,d as K,a as j,u as X,P as $,C as J}from"./index-umIAl-pL.js";import{P as S}from"./index-so4lRrRq.js";var Q=Object.defineProperty,k=(o,e)=>Q(o,"name",{value:e,configurable:!0}),w="Checkbox",[V,ue]=G(w),[W,B]=V(w);function q(o){const{__scopeCheckbox:e,checked:c,children:r,defaultChecked:n,disabled:d,form:t,name:l,onCheckedChange:s,required:f,value:v="on",internal_do_not_use_render:C}=o,[b,x]=X({prop:c,defaultProp:n??!1,onChange:s,caller:w}),[g,I]=i.useState(null),[R,_]=i.useState(null),P=i.useRef(!1),[a,p]=i.useReducer(m=>m+1,0),E=g?!!t||!!g.closest("form"):!0,y={checked:b,disabled:d,setChecked:x,control:g,setControl:I,name:l,form:t,value:v,hasConsumerStoppedPropagationRef:P,userInteractionCount:a,onUserInteraction:p,required:f,defaultChecked:h(n)?!1:n,isFormControl:E,bubbleInput:R,setBubbleInput:_};return u.jsx(W,{scope:e,...y,children:A(C)?C(y):r})}k(q,"CheckboxProvider");var Y="CheckboxTrigger",Z=i.forwardRef(k(function({__scopeCheckbox:e,onKeyDown:c,onClick:r,...n},d){const{control:t,value:l,disabled:s,checked:f,required:v,setControl:C,setChecked:b,hasConsumerStoppedPropagationRef:x,onUserInteraction:g,isFormControl:I,bubbleInput:R}=B(Y,e),_=U(d,C),P=i.useRef(f);return i.useEffect(()=>{const a=t?.form;if(a){const p=k(()=>b(P.current),"reset");return a.addEventListener("reset",p),()=>a.removeEventListener("reset",p)}},[t,b]),u.jsx(S.button,{type:"button",role:"checkbox","aria-checked":h(f)?"mixed":f,"aria-required":v,"data-state":N(f),"data-disabled":s?"":void 0,disabled:s,value:l,...n,ref:_,onKeyDown:j(c,a=>{a.key==="Enter"&&a.preventDefault()}),onClick:j(r,a=>{g(),b(p=>h(p)?!0:!p),R&&I&&(x.current=a.isPropagationStopped(),x.current||a.stopPropagation())})})},"CheckboxTrigger")),ee=i.forwardRef(k(function(e,c){const{__scopeCheckbox:r,name:n,checked:d,defaultChecked:t,required:l,disabled:s,value:f,onCheckedChange:v,form:C,...b}=e;return u.jsx(q,{__scopeCheckbox:r,checked:d,defaultChecked:t,disabled:s,required:l,onCheckedChange:v,name:n,form:C,value:f,internal_do_not_use_render:({isFormControl:x})=>u.jsxs(u.Fragment,{children:[u.jsx(Z,{...b,ref:c,__scopeCheckbox:r}),x&&u.jsx(ne,{__scopeCheckbox:r})]})})},"Checkbox")),te="CheckboxIndicator",re=i.forwardRef(k(function(e,c){const{__scopeCheckbox:r,forceMount:n,...d}=e,t=B(te,r);return u.jsx($,{present:n||h(t.checked)||t.checked===!0,children:u.jsx(S.span,{"data-state":N(t.checked),"data-disabled":t.disabled?"":void 0,...d,ref:c,style:{pointerEvents:"none",...e.style}})})},"CheckboxIndicator")),oe="CheckboxBubbleInput",ne=i.forwardRef(k(function({__scopeCheckbox:e,onClick:c,...r},n){const{control:d,hasConsumerStoppedPropagationRef:t,userInteractionCount:l,checked:s,defaultChecked:f,required:v,disabled:C,name:b,value:x,form:g,bubbleInput:I,setBubbleInput:R}=B(oe,e),_=U(n,R),P=K(d),a=i.useRef(!1),p=i.useRef(s),E=i.useRef(l);i.useEffect(()=>{const m=I;if(!m)return;const F=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(F,"checked").set,M=l!==E.current;E.current=l;const O=p.current!==s;p.current=s;const z=!(M&&t.current);if(O&&T){a.current=!M;const D=new Event("click",{bubbles:z});m.indeterminate=h(s),T.call(m,h(s)?!1:s),m.dispatchEvent(D),a.current=!1}},[I,s,t,l]);const y=i.useRef(h(s)?!1:s);return u.jsx(S.input,{type:"checkbox","aria-hidden":!0,defaultChecked:f??y.current,required:v,disabled:C,name:b,value:x,form:g,...r,tabIndex:-1,ref:_,onClick:j(c,m=>{a.current&&m.stopPropagation()}),style:{...r.style,...P,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function A(o){return typeof o=="function"}k(A,"isFunction");function h(o){return o==="indeterminate"}k(h,"isIndeterminate");function N(o){return h(o)?"indeterminate":o?"checked":"unchecked"}k(N,"getState");function le(o){const e=L.c(9);let c,r;e[0]!==o?({className:c,...r}=o,e[0]=o,e[1]=c,e[2]=r):(c=e[1],r=e[2]);let n;e[3]!==c?(n=H("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",c),e[3]=c,e[4]=n):n=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=u.jsx(re,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:u.jsx(J,{className:"size-3.5"})}),e[5]=d):d=e[5];let t;return e[6]!==r||e[7]!==n?(t=u.jsx(ee,{"data-slot":"checkbox",className:n,...r,children:d}),e[6]=r,e[7]=n,e[8]=t):t=e[8],t}export{le as C};
@@ -1 +1 @@
1
- import{c as l,C as a,j as i}from"./inertia-Degv_G9N.js";function m(c){const t=l.c(5),{children:n,className:o}=c;let e;t[0]!==o?(e=a("block max-w-full truncate font-mono text-xs",o),t[0]=o,t[1]=e):e=t[1];let s;return t[2]!==n||t[3]!==e?(s=i.jsx("code",{className:e,title:n,children:n}),t[2]=n,t[3]=e,t[4]=s):s=t[4],s}function x(c){const t=l.c(5),{children:n,className:o}=c;let e;t[0]!==o?(e=a("font-mono text-xs",o),t[0]=o,t[1]=e):e=t[1];let s;return t[2]!==n||t[3]!==e?(s=i.jsx("span",{className:e,children:n}),t[2]=n,t[3]=e,t[4]=s):s=t[4],s}export{x as M,m as S};
1
+ import{c as l,C as a,j as i}from"./inertia-DLew8ZNx.js";function m(c){const t=l.c(5),{children:n,className:o}=c;let e;t[0]!==o?(e=a("block max-w-full truncate font-mono text-xs",o),t[0]=o,t[1]=e):e=t[1];let s;return t[2]!==n||t[3]!==e?(s=i.jsx("code",{className:e,title:n,children:n}),t[2]=n,t[3]=e,t[4]=s):s=t[4],s}function x(c){const t=l.c(5),{children:n,className:o}=c;let e;t[0]!==o?(e=a("font-mono text-xs",o),t[0]=o,t[1]=e):e=t[1];let s;return t[2]!==n||t[3]!==e?(s=i.jsx("span",{className:e,children:n}),t[2]=n,t[3]=e,t[4]=s):s=t[4],s}export{x as M,m as S};
@@ -1 +1 @@
1
- import{c as h,r as j,C as y,j as l}from"./inertia-Degv_G9N.js";import{B as E}from"./app-wordmark-1SRllgHv.js";import{u as N,C as b}from"./use-clipboard-BLjjYH8V.js";import{C as v}from"./index-CX8Br7m9.js";const z=1500;function R(C){const e=h.c(17),{code:t,className:p}=C,[,m]=N(),[r,f]=j.useState(!1);let c;e[0]!==t||e[1]!==m?(c=()=>{m(t).then(x=>{x&&(f(!0),window.setTimeout(()=>f(!1),z))})},e[0]=t,e[1]=m,e[2]=c):c=e[2];const u=c;let s;e[3]!==p?(s=y("relative",p),e[3]=p,e[4]=s):s=e[4];let o;e[5]!==t?(o=l.jsx("pre",{className:"bg-muted overflow-x-auto rounded p-3 pr-10 font-mono text-xs",children:t}),e[5]=t,e[6]=o):o=e[6];const d=r?"Copied code":"Copy code";let a;e[7]!==r?(a=r?l.jsx(v,{className:"size-3.5 text-emerald-500"}):l.jsx(b,{className:"size-3.5 opacity-60"}),e[7]=r,e[8]=a):a=e[8];let i;e[9]!==u||e[10]!==d||e[11]!==a?(i=l.jsx(E,{type:"button","aria-label":d,variant:"ghost",size:"icon",className:"absolute top-1.5 right-1.5 size-6",onClick:u,children:a}),e[9]=u,e[10]=d,e[11]=a,e[12]=i):i=e[12];let n;return e[13]!==s||e[14]!==o||e[15]!==i?(n=l.jsxs("div",{className:s,children:[o,i]}),e[13]=s,e[14]=o,e[15]=i,e[16]=n):n=e[16],n}export{R as C};
1
+ import{c as h,r as j,C as y,j as l}from"./inertia-DLew8ZNx.js";import{B as E}from"./app-wordmark-o9CODKP0.js";import{u as N,C as b}from"./use-clipboard-ByoUGQqA.js";import{C as v}from"./index-umIAl-pL.js";const z=1500;function R(C){const e=h.c(17),{code:t,className:p}=C,[,m]=N(),[r,f]=j.useState(!1);let c;e[0]!==t||e[1]!==m?(c=()=>{m(t).then(x=>{x&&(f(!0),window.setTimeout(()=>f(!1),z))})},e[0]=t,e[1]=m,e[2]=c):c=e[2];const u=c;let s;e[3]!==p?(s=y("relative",p),e[3]=p,e[4]=s):s=e[4];let o;e[5]!==t?(o=l.jsx("pre",{className:"bg-muted overflow-x-auto rounded p-3 pr-10 font-mono text-xs",children:t}),e[5]=t,e[6]=o):o=e[6];const d=r?"Copied code":"Copy code";let a;e[7]!==r?(a=r?l.jsx(v,{className:"size-3.5 text-emerald-500"}):l.jsx(b,{className:"size-3.5 opacity-60"}),e[7]=r,e[8]=a):a=e[8];let i;e[9]!==u||e[10]!==d||e[11]!==a?(i=l.jsx(E,{type:"button","aria-label":d,variant:"ghost",size:"icon",className:"absolute top-1.5 right-1.5 size-6",onClick:u,children:a}),e[9]=u,e[10]=d,e[11]=a,e[12]=i):i=e[12];let n;return e[13]!==s||e[14]!==o||e[15]!==i?(n=l.jsxs("div",{className:s,children:[o,i]}),e[13]=s,e[14]=o,e[15]=i,e[16]=n):n=e[16],n}export{R as C};
@@ -1 +1 @@
1
- import{c as d,r as y,C as h,j as m}from"./inertia-Degv_G9N.js";import{B as j}from"./app-wordmark-1SRllgHv.js";import{u as E,C as N}from"./use-clipboard-BLjjYH8V.js";import{C as b}from"./index-CX8Br7m9.js";const z=1500;function v(f){const t=d.c(12),{value:o,label:C,className:n}=f,[,r]=E(),[l,u]=y.useState(!1);let a;t[0]!==r||t[1]!==o?(a=()=>{r(o).then(x=>{x&&(u(!0),window.setTimeout(()=>u(!1),z))})},t[0]=r,t[1]=o,t[2]=a):a=t[2];const c=a;let s;t[3]!==n?(s=h("h-auto gap-1.5 px-1.5 py-0.5 font-mono text-xs",n),t[3]=n,t[4]=s):s=t[4];const p=C??o;let e;t[5]!==l?(e=l?m.jsx(b,{className:"size-3 text-emerald-500"}):m.jsx(N,{className:"size-3 opacity-60"}),t[5]=l,t[6]=e):e=t[6];let i;return t[7]!==c||t[8]!==s||t[9]!==p||t[10]!==e?(i=m.jsxs(j,{type:"button",variant:"ghost",size:"sm",className:s,onClick:c,children:[p,e]}),t[7]=c,t[8]=s,t[9]=p,t[10]=e,t[11]=i):i=t[11],i}export{v as C};
1
+ import{c as d,r as y,C as h,j as m}from"./inertia-DLew8ZNx.js";import{B as j}from"./app-wordmark-o9CODKP0.js";import{u as E,C as N}from"./use-clipboard-ByoUGQqA.js";import{C as b}from"./index-umIAl-pL.js";const z=1500;function v(f){const t=d.c(12),{value:o,label:C,className:n}=f,[,r]=E(),[l,u]=y.useState(!1);let a;t[0]!==r||t[1]!==o?(a=()=>{r(o).then(x=>{x&&(u(!0),window.setTimeout(()=>u(!1),z))})},t[0]=r,t[1]=o,t[2]=a):a=t[2];const c=a;let s;t[3]!==n?(s=h("h-auto gap-1.5 px-1.5 py-0.5 font-mono text-xs",n),t[3]=n,t[4]=s):s=t[4];const p=C??o;let e;t[5]!==l?(e=l?m.jsx(b,{className:"size-3 text-emerald-500"}):m.jsx(N,{className:"size-3 opacity-60"}),t[5]=l,t[6]=e):e=t[6];let i;return t[7]!==c||t[8]!==s||t[9]!==p||t[10]!==e?(i=m.jsxs(j,{type:"button",variant:"ghost",size:"sm",className:s,onClick:c,children:[p,e]}),t[7]=c,t[8]=s,t[9]=p,t[10]=e,t[11]=i):i=t[11],i}export{v as C};
@@ -1 +1 @@
1
- import{c as m,r as x,e as f,j as u}from"./inertia-Degv_G9N.js";import{B as p}from"./app-wordmark-1SRllgHv.js";function j(c){const t=m.c(8),{meta:e,href:n,only:i}=c,[o,l]=x.useState(!1);if(!e.has_more||!e.next_cursor)return null;let r;t[0]!==n||t[1]!==e.next_cursor||t[2]!==i?(r=()=>f.visit(n(e.next_cursor),{only:i,preserveState:!0,preserveScroll:!0,onStart:()=>l(!0),onFinish:()=>l(!1)}),t[0]=n,t[1]=e.next_cursor,t[2]=i,t[3]=r):r=t[3];const a=o?"Loading…":"Load "+e.limit+" more";let s;return t[4]!==o||t[5]!==r||t[6]!==a?(s=u.jsx("div",{className:"flex justify-center pt-3",children:u.jsx(p,{type:"button",variant:"outline",disabled:o,onClick:r,children:a})}),t[4]=o,t[5]=r,t[6]=a,t[7]=s):s=t[7],s}export{j as C};
1
+ import{c as m,r as x,e as f,j as u}from"./inertia-DLew8ZNx.js";import{B as p}from"./app-wordmark-o9CODKP0.js";function j(c){const t=m.c(8),{meta:e,href:n,only:i}=c,[o,l]=x.useState(!1);if(!e.has_more||!e.next_cursor)return null;let r;t[0]!==n||t[1]!==e.next_cursor||t[2]!==i?(r=()=>f.visit(n(e.next_cursor),{only:i,preserveState:!0,preserveScroll:!0,onStart:()=>l(!0),onFinish:()=>l(!1)}),t[0]=n,t[1]=e.next_cursor,t[2]=i,t[3]=r):r=t[3];const a=o?"Loading…":"Load "+e.limit+" more";let s;return t[4]!==o||t[5]!==r||t[6]!==a?(s=u.jsx("div",{className:"flex justify-center pt-3",children:u.jsx(p,{type:"button",variant:"outline",disabled:o,onClick:r,children:a})}),t[4]=o,t[5]=r,t[6]=a,t[7]=s):s=t[7],s}export{j as C};
@@ -1 +1 @@
1
- import{c as j,C as h,j as o,r as d}from"./inertia-Degv_G9N.js";import{u as C}from"./chart-hover-XYPNE2CX.js";import{E as D}from"./empty-state-BFTnQ2oT.js";function _(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("w-full caption-bottom text-sm",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:l,...t})}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function M(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("[&_tr]:border-b",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function S(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("[&_tr:last-child]:border-0",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function T(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function I(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function H(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("px-3 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function K(n){return n.defaultPrevented||n.isComposing||n.repeat||n.metaKey||n.ctrlKey||n.altKey||n.shiftKey||n.target instanceof Element&&!!n.target.closest('input, textarea, select, button, a, [contenteditable]:not([contenteditable="false"]), [role="button"], [role="combobox"], [role="textbox"], [role="menu"], [role="listbox"], [role="dialog"]')}const N=new Map;let x;function $({rows:n,rowKey:e,onOpen:s,enabled:t=!0}){const[l,r]=d.useState(null),[u]=d.useState(()=>Symbol("row-nav"));function v(){!t||x===u||(x&&N.get(x)?.(),x=u)}d.useEffect(()=>{if(t)return N.set(u,()=>r(null)),x??=u,()=>{N.delete(u),x===u&&(x=N.keys().next().value)}},[t,u]);const w=d.useRef(n),m=d.useRef(e),g=d.useRef(s);return d.useEffect(()=>{w.current=n,m.current=e,g.current=s}),d.useEffect(()=>{if(!t)return;function b(c){if(x!==u||K(c))return;if(c.key==="/"){const i=document.querySelector("[data-filter-bar-input]");i&&(c.preventDefault(),i.focus());return}const f=w.current,y=m.current,a=f.findIndex(i=>y(i)===l);if(c.key==="j"){if(f.length===0)return;c.preventDefault();const i=Math.min(a+1,f.length-1);r(y(f[i]))}else if(c.key==="k"){if(f.length===0)return;c.preventDefault();const i=a<0?0:Math.max(a-1,0);r(y(f[i]))}else c.key==="Enter"?a>=0&&(c.preventDefault(),g.current(f[a])):c.key==="o"?a>=0&&(c.preventDefault(),g.current(f[a],{newTab:!0})):c.key==="Escape"&&r(null)}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[l,t,u]),{highlighted:l,setHighlighted:r,activate:v}}const B='a, button, input, select, textarea, [role="button"], [role="link"], [contenteditable="true"]';function L(n){return n instanceof Element&&n.closest(B)}function V({rows:n,columns:e,rowKey:s,empty:t="Nothing here yet.",onRowClick:l,keyboardNav:r,hoverKey:u,rowClassName:v,className:w}){const{highlighted:m,activate:g}=$({rows:n,rowKey:s,onOpen:r?.onOpen??(()=>{}),enabled:!!r&&r?.enabled!==!1}),b=d.useRef(new Map);d.useEffect(()=>{m!=null&&b.current.get(m)?.scrollIntoView({block:"nearest"})},[m]),d.useEffect(()=>{if(!r?.onHighlightChange)return;const a=n.find(i=>s(i)===m)??null;r.onHighlightChange(a)},[m]);const{hoveredKey:c,setHoveredKey:f}=C(),y=a=>h(a.align==="right"&&"text-right",a.hideOnMobile&&"hidden md:table-cell",a.grow&&"w-full max-w-0 truncate",a.className);return o.jsx("div",{tabIndex:r&&r.enabled!==!1?0:void 0,onFocusCapture:g,onPointerDownCapture:g,className:h("bg-card -mx-3 overflow-x-auto border-y md:mx-0 md:rounded-lg md:border",w),children:o.jsxs(_,{children:[o.jsx(M,{children:o.jsx(T,{className:"hover:bg-transparent",children:e.map(a=>o.jsx(I,{className:y(a),children:a.header},a.key))})}),o.jsxs(S,{children:[n.length===0&&o.jsx(T,{children:o.jsx(H,{colSpan:e.length,className:"p-0 whitespace-normal",children:typeof t=="string"?o.jsx(D,{title:t}):o.jsx("div",{className:"text-muted-foreground min-h-24 text-center",children:t})})}),n.map(a=>{const i=s(a),R=!!r&&m===i,E=u?.(a),k=E!=null&&c===E;return o.jsx(T,{ref:p=>{p?b.current.set(i,p):b.current.delete(i)},"data-state":R?"highlighted":void 0,"data-hovered":k||void 0,className:h(l&&"cursor-pointer",v?.(a),R&&"bg-accent shadow-[inset_2px_0_0_0_var(--primary)]",k&&!R&&"bg-accent/50"),onClick:l?p=>{L(p.target)||l(a)}:void 0,onMouseEnter:E?()=>f(E):void 0,onMouseLeave:E?()=>f(null):void 0,children:e.map(p=>o.jsx(H,{className:h("py-1.5 text-xs",p.align==="right"&&"font-mono tabular-nums",y(p)),children:p.cell(a)},p.key))},i)})]})]})})}export{V as D,K as i};
1
+ import{c as j,C as h,j as o,r as d}from"./inertia-DLew8ZNx.js";import{u as C}from"./chart-hover-B1M9jc0y.js";import{E as D}from"./empty-state-C38il627.js";function _(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("w-full caption-bottom text-sm",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:l,...t})}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function M(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("[&_tr]:border-b",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("thead",{"data-slot":"table-header",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function S(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("[&_tr:last-child]:border-0",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("tbody",{"data-slot":"table-body",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function T(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("tr",{"data-slot":"table-row",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function I(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("th",{"data-slot":"table-head",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function H(n){const e=j.c(8);let s,t;e[0]!==n?({className:s,...t}=n,e[0]=n,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let l;e[3]!==s?(l=h("px-3 py-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),e[3]=s,e[4]=l):l=e[4];let r;return e[5]!==t||e[6]!==l?(r=o.jsx("td",{"data-slot":"table-cell",className:l,...t}),e[5]=t,e[6]=l,e[7]=r):r=e[7],r}function K(n){return n.defaultPrevented||n.isComposing||n.repeat||n.metaKey||n.ctrlKey||n.altKey||n.shiftKey||n.target instanceof Element&&!!n.target.closest('input, textarea, select, button, a, [contenteditable]:not([contenteditable="false"]), [role="button"], [role="combobox"], [role="textbox"], [role="menu"], [role="listbox"], [role="dialog"]')}const N=new Map;let x;function $({rows:n,rowKey:e,onOpen:s,enabled:t=!0}){const[l,r]=d.useState(null),[u]=d.useState(()=>Symbol("row-nav"));function v(){!t||x===u||(x&&N.get(x)?.(),x=u)}d.useEffect(()=>{if(t)return N.set(u,()=>r(null)),x??=u,()=>{N.delete(u),x===u&&(x=N.keys().next().value)}},[t,u]);const w=d.useRef(n),m=d.useRef(e),g=d.useRef(s);return d.useEffect(()=>{w.current=n,m.current=e,g.current=s}),d.useEffect(()=>{if(!t)return;function b(c){if(x!==u||K(c))return;if(c.key==="/"){const i=document.querySelector("[data-filter-bar-input]");i&&(c.preventDefault(),i.focus());return}const f=w.current,y=m.current,a=f.findIndex(i=>y(i)===l);if(c.key==="j"){if(f.length===0)return;c.preventDefault();const i=Math.min(a+1,f.length-1);r(y(f[i]))}else if(c.key==="k"){if(f.length===0)return;c.preventDefault();const i=a<0?0:Math.max(a-1,0);r(y(f[i]))}else c.key==="Enter"?a>=0&&(c.preventDefault(),g.current(f[a])):c.key==="o"?a>=0&&(c.preventDefault(),g.current(f[a],{newTab:!0})):c.key==="Escape"&&r(null)}return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[l,t,u]),{highlighted:l,setHighlighted:r,activate:v}}const B='a, button, input, select, textarea, [role="button"], [role="link"], [contenteditable="true"]';function L(n){return n instanceof Element&&n.closest(B)}function V({rows:n,columns:e,rowKey:s,empty:t="Nothing here yet.",onRowClick:l,keyboardNav:r,hoverKey:u,rowClassName:v,className:w}){const{highlighted:m,activate:g}=$({rows:n,rowKey:s,onOpen:r?.onOpen??(()=>{}),enabled:!!r&&r?.enabled!==!1}),b=d.useRef(new Map);d.useEffect(()=>{m!=null&&b.current.get(m)?.scrollIntoView({block:"nearest"})},[m]),d.useEffect(()=>{if(!r?.onHighlightChange)return;const a=n.find(i=>s(i)===m)??null;r.onHighlightChange(a)},[m]);const{hoveredKey:c,setHoveredKey:f}=C(),y=a=>h(a.align==="right"&&"text-right",a.hideOnMobile&&"hidden md:table-cell",a.grow&&"w-full max-w-0 truncate",a.className);return o.jsx("div",{tabIndex:r&&r.enabled!==!1?0:void 0,onFocusCapture:g,onPointerDownCapture:g,className:h("bg-card -mx-3 overflow-x-auto border-y md:mx-0 md:rounded-lg md:border",w),children:o.jsxs(_,{children:[o.jsx(M,{children:o.jsx(T,{className:"hover:bg-transparent",children:e.map(a=>o.jsx(I,{className:y(a),children:a.header},a.key))})}),o.jsxs(S,{children:[n.length===0&&o.jsx(T,{children:o.jsx(H,{colSpan:e.length,className:"p-0 whitespace-normal",children:typeof t=="string"?o.jsx(D,{title:t}):o.jsx("div",{className:"text-muted-foreground min-h-24 text-center",children:t})})}),n.map(a=>{const i=s(a),R=!!r&&m===i,E=u?.(a),k=E!=null&&c===E;return o.jsx(T,{ref:p=>{p?b.current.set(i,p):b.current.delete(i)},"data-state":R?"highlighted":void 0,"data-hovered":k||void 0,className:h(l&&"cursor-pointer",v?.(a),R&&"bg-accent shadow-[inset_2px_0_0_0_var(--primary)]",k&&!R&&"bg-accent/50"),onClick:l?p=>{L(p.target)||l(a)}:void 0,onMouseEnter:E?()=>f(E):void 0,onMouseLeave:E?()=>f(null):void 0,children:e.map(p=>o.jsx(H,{className:h("py-1.5 text-xs",p.align==="right"&&"font-mono tabular-nums",y(p)),children:p.cell(a)},p.key))},i)})]})]})})}export{V as D,K as i};
@@ -1 +1 @@
1
- import{c as L,g as b,j as s,H as V,F as k,e as D}from"./inertia-Degv_G9N.js";import{I as y}from"./input-error-C6SqO_iU.js";import{B as N}from"./app-wordmark-1SRllgHv.js";import{b as A,c as w,C as F,a as C}from"./card-BaJ8kNkp.js";import{L as u,I as g}from"./label-B_vK19tR.js";import{A as H}from"./app-layout-B5Fcdwfz.js";import"./index-B0VXzXYG.js";import"./live-dot-DaXEbkXo.js";import"./index-CX8Br7m9.js";import"./checkbox-Bf41R8W6.js";function K(p){const e=L.c(32),t=p.application,E=t.name;let r;e[0]!==t.id?(r=b(t.id),e[0]=t.id,e[1]=r):r=e[1];let a;e[2]!==t.name||e[3]!==r?(a={title:E,href:r},e[2]=t.name,e[3]=r,e[4]=a):a=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={title:"Edit",href:"#"},e[5]=h):h=e[5];let i;e[6]!==a?(i=[a,h],e[6]=a,e[7]=i):i=e[7];const v=`Edit ${t.name}`;let l;e[8]!==v?(l=s.jsx(V,{title:v}),e[8]=v,e[9]=l):l=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(A,{children:s.jsx(w,{children:"Edit application"})}),e[10]=f):f=e[10];let o;e[11]!==t.id?(o=b(t.id),e[11]=t.id,e[12]=o):o=e[12];let n;e[13]!==t.default_branch||e[14]!==t.issue_prefix||e[15]!==t.name||e[16]!==t.repository_url||e[17]!==p.auto_resolve_after_days?(n=S=>{const{errors:j,processing:I}=S;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"name",children:"Name"}),s.jsx(g,{id:"name",name:"name",defaultValue:t.name,required:!0}),s.jsx(y,{messages:j.name})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"issue_prefix",children:"Issue prefix"}),s.jsx(g,{id:"issue_prefix",name:"issue_prefix",defaultValue:t.issue_prefix,maxLength:8}),s.jsx(y,{messages:j.issue_prefix})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"repository_url",children:"Repository URL"}),s.jsx(g,{id:"repository_url",name:"repository_url",defaultValue:t.repository_url??"",placeholder:"https://github.com/org/repo"}),s.jsx(y,{messages:j.repository_url})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"default_branch",children:"Default branch"}),s.jsx(g,{id:"default_branch",name:"default_branch",defaultValue:t.default_branch}),s.jsx(y,{messages:j.default_branch}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Stack frames link into this repository at the deploy's git SHA when one was recorded, and at this branch otherwise."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"auto_resolve_after_days",children:"Auto-resolve issues"}),s.jsxs("select",{id:"auto_resolve_after_days",name:"auto_resolve_after_days",defaultValue:p.auto_resolve_after_days??"",className:"border-input bg-background h-9 rounded-md border px-3 text-sm",children:[s.jsx("option",{value:"",children:"Never"}),s.jsx("option",{value:"7",children:"After 7 days without a recurrence"}),s.jsx("option",{value:"14",children:"After 14 days without a recurrence"}),s.jsx("option",{value:"30",children:"After 30 days without a recurrence"})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Applies to every application in this account."})]}),s.jsx(N,{disabled:I,children:"Save"})]})},e[13]=t.default_branch,e[14]=t.issue_prefix,e[15]=t.name,e[16]=t.repository_url,e[17]=p.auto_resolve_after_days,e[18]=n):n=e[18];let d;e[19]!==o||e[20]!==n?(d=s.jsxs(F,{children:[f,s.jsx(C,{children:s.jsx(k,{method:"patch",action:o,className:"space-y-4",children:n})})]}),e[19]=o,e[20]=n,e[21]=d):d=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(A,{children:s.jsx(w,{children:"Danger zone"})}),e[22]=x):x=e[22];let c;e[23]!==t.id?(c=s.jsxs(F,{className:"border-destructive/40",children:[x,s.jsx(C,{children:s.jsx(N,{variant:"destructive",size:"sm",onClick:()=>confirm("Delete this application, its environments, telemetry, and issues?")&&D.delete(b(t.id)),children:"Delete application"})})]}),e[23]=t.id,e[24]=c):c=e[24];let m;e[25]!==d||e[26]!==c?(m=s.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 p-6",children:[d,c]}),e[25]=d,e[26]=c,e[27]=m):m=e[27];let _;return e[28]!==m||e[29]!==i||e[30]!==l?(_=s.jsxs(H,{breadcrumbs:i,children:[l,m]}),e[28]=m,e[29]=i,e[30]=l,e[31]=_):_=e[31],_}export{K as default};
1
+ import{c as L,g as b,j as s,H as V,F as k,e as D}from"./inertia-DLew8ZNx.js";import{I as y}from"./input-error-cvM6_Jht.js";import{B as N}from"./app-wordmark-o9CODKP0.js";import{b as A,c as w,C as F,a as C}from"./card-cAtqCxWl.js";import{L as u,I as g}from"./label-GWl7I6sf.js";import{A as H}from"./app-layout-DDyQa72H.js";import"./index-so4lRrRq.js";import"./live-dot-D1n_BreY.js";import"./index-umIAl-pL.js";import"./checkbox-CmhMHWZO.js";function K(p){const e=L.c(32),t=p.application,E=t.name;let r;e[0]!==t.id?(r=b(t.id),e[0]=t.id,e[1]=r):r=e[1];let a;e[2]!==t.name||e[3]!==r?(a={title:E,href:r},e[2]=t.name,e[3]=r,e[4]=a):a=e[4];let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h={title:"Edit",href:"#"},e[5]=h):h=e[5];let i;e[6]!==a?(i=[a,h],e[6]=a,e[7]=i):i=e[7];const v=`Edit ${t.name}`;let l;e[8]!==v?(l=s.jsx(V,{title:v}),e[8]=v,e[9]=l):l=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(A,{children:s.jsx(w,{children:"Edit application"})}),e[10]=f):f=e[10];let o;e[11]!==t.id?(o=b(t.id),e[11]=t.id,e[12]=o):o=e[12];let n;e[13]!==t.default_branch||e[14]!==t.issue_prefix||e[15]!==t.name||e[16]!==t.repository_url||e[17]!==p.auto_resolve_after_days?(n=S=>{const{errors:j,processing:I}=S;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"name",children:"Name"}),s.jsx(g,{id:"name",name:"name",defaultValue:t.name,required:!0}),s.jsx(y,{messages:j.name})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"issue_prefix",children:"Issue prefix"}),s.jsx(g,{id:"issue_prefix",name:"issue_prefix",defaultValue:t.issue_prefix,maxLength:8}),s.jsx(y,{messages:j.issue_prefix})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"repository_url",children:"Repository URL"}),s.jsx(g,{id:"repository_url",name:"repository_url",defaultValue:t.repository_url??"",placeholder:"https://github.com/org/repo"}),s.jsx(y,{messages:j.repository_url})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"default_branch",children:"Default branch"}),s.jsx(g,{id:"default_branch",name:"default_branch",defaultValue:t.default_branch}),s.jsx(y,{messages:j.default_branch}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Stack frames link into this repository at the deploy's git SHA when one was recorded, and at this branch otherwise."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(u,{htmlFor:"auto_resolve_after_days",children:"Auto-resolve issues"}),s.jsxs("select",{id:"auto_resolve_after_days",name:"auto_resolve_after_days",defaultValue:p.auto_resolve_after_days??"",className:"border-input bg-background h-9 rounded-md border px-3 text-sm",children:[s.jsx("option",{value:"",children:"Never"}),s.jsx("option",{value:"7",children:"After 7 days without a recurrence"}),s.jsx("option",{value:"14",children:"After 14 days without a recurrence"}),s.jsx("option",{value:"30",children:"After 30 days without a recurrence"})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Applies to every application in this account."})]}),s.jsx(N,{disabled:I,children:"Save"})]})},e[13]=t.default_branch,e[14]=t.issue_prefix,e[15]=t.name,e[16]=t.repository_url,e[17]=p.auto_resolve_after_days,e[18]=n):n=e[18];let d;e[19]!==o||e[20]!==n?(d=s.jsxs(F,{children:[f,s.jsx(C,{children:s.jsx(k,{method:"patch",action:o,className:"space-y-4",children:n})})]}),e[19]=o,e[20]=n,e[21]=d):d=e[21];let x;e[22]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx(A,{children:s.jsx(w,{children:"Danger zone"})}),e[22]=x):x=e[22];let c;e[23]!==t.id?(c=s.jsxs(F,{className:"border-destructive/40",children:[x,s.jsx(C,{children:s.jsx(N,{variant:"destructive",size:"sm",onClick:()=>confirm("Delete this application, its environments, telemetry, and issues?")&&D.delete(b(t.id)),children:"Delete application"})})]}),e[23]=t.id,e[24]=c):c=e[24];let m;e[25]!==d||e[26]!==c?(m=s.jsxs("div",{className:"mx-auto w-full max-w-md space-y-4 p-6",children:[d,c]}),e[25]=d,e[26]=c,e[27]=m):m=e[27];let _;return e[28]!==m||e[29]!==i||e[30]!==l?(_=s.jsxs(H,{breadcrumbs:i,children:[l,m]}),e[28]=m,e[29]=i,e[30]=l,e[31]=_):_=e[31],_}export{K as default};
@@ -1 +1 @@
1
- import{c as h,R as j,j as e,H as _,F as g}from"./inertia-Degv_G9N.js";import{I as p}from"./input-error-C6SqO_iU.js";import{B as y}from"./app-wordmark-1SRllgHv.js";import{L as w,I as f}from"./label-B_vK19tR.js";import{S as b,A as N}from"./auth-layout-DXfxXAN_.js";import"./index-B0VXzXYG.js";import"./copy-DaQMJWoT.js";import"./empty-state-BFTnQ2oT.js";function k(x){const s=h.c(11),{sid:d,email:a}=x;let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(_,{title:"Reset password"}),s[0]=t):t=s[0];let l;s[1]===Symbol.for("react.memo_cache_sentinel")?(l=j(),s[1]=l):l=s[1];let r;s[2]!==a||s[3]!==d?(r=n=>({...n,sid:d,email:a}),s[2]=a,s[3]=d,s[4]=r):r=s[4];let i;s[5]===Symbol.for("react.memo_cache_sentinel")?(i=["password","password_confirmation"],s[5]=i):i=s[5];let o;s[6]!==a?(o=n=>{const{processing:u,errors:c}=n;return e.jsxs("div",{className:"grid gap-6",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"email",children:"Email"}),e.jsx(f,{id:"email",type:"email",name:"email",autoComplete:"email",value:a,className:"mt-1 block w-full",readOnly:!0}),e.jsx(p,{messages:c.email,className:"mt-2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"password",children:"Password"}),e.jsx(f,{id:"password",type:"password",name:"password",autoComplete:"new-password",className:"mt-1 block w-full",autoFocus:!0,placeholder:"Password"}),e.jsx(p,{messages:c.password})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"password_confirmation",children:"Confirm password"}),e.jsx(f,{id:"password_confirmation",type:"password",name:"password_confirmation",autoComplete:"new-password",className:"mt-1 block w-full",placeholder:"Confirm password"}),e.jsx(p,{messages:c.password_confirmation,className:"mt-2"})]}),e.jsxs(y,{type:"submit",className:"mt-4 w-full",disabled:u,children:[u&&e.jsx(b,{}),"Reset password"]})]})},s[6]=a,s[7]=o):o=s[7];let m;return s[8]!==r||s[9]!==o?(m=e.jsxs(N,{title:"Reset password",description:"Please enter your new password below",children:[t,e.jsx(g,{method:"put",action:l,transform:r,resetOnSuccess:i,children:o})]}),s[8]=r,s[9]=o,s[10]=m):m=s[10],m}export{k as default};
1
+ import{c as h,R as j,j as e,H as _,F as g}from"./inertia-DLew8ZNx.js";import{I as p}from"./input-error-cvM6_Jht.js";import{B as y}from"./app-wordmark-o9CODKP0.js";import{L as w,I as f}from"./label-GWl7I6sf.js";import{S as b,A as N}from"./auth-layout-BRt8MGFD.js";import"./index-so4lRrRq.js";import"./copy-DaQMJWoT.js";import"./empty-state-C38il627.js";function k(x){const s=h.c(11),{sid:d,email:a}=x;let t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=e.jsx(_,{title:"Reset password"}),s[0]=t):t=s[0];let l;s[1]===Symbol.for("react.memo_cache_sentinel")?(l=j(),s[1]=l):l=s[1];let r;s[2]!==a||s[3]!==d?(r=n=>({...n,sid:d,email:a}),s[2]=a,s[3]=d,s[4]=r):r=s[4];let i;s[5]===Symbol.for("react.memo_cache_sentinel")?(i=["password","password_confirmation"],s[5]=i):i=s[5];let o;s[6]!==a?(o=n=>{const{processing:u,errors:c}=n;return e.jsxs("div",{className:"grid gap-6",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"email",children:"Email"}),e.jsx(f,{id:"email",type:"email",name:"email",autoComplete:"email",value:a,className:"mt-1 block w-full",readOnly:!0}),e.jsx(p,{messages:c.email,className:"mt-2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"password",children:"Password"}),e.jsx(f,{id:"password",type:"password",name:"password",autoComplete:"new-password",className:"mt-1 block w-full",autoFocus:!0,placeholder:"Password"}),e.jsx(p,{messages:c.password})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(w,{htmlFor:"password_confirmation",children:"Confirm password"}),e.jsx(f,{id:"password_confirmation",type:"password",name:"password_confirmation",autoComplete:"new-password",className:"mt-1 block w-full",placeholder:"Confirm password"}),e.jsx(p,{messages:c.password_confirmation,className:"mt-2"})]}),e.jsxs(y,{type:"submit",className:"mt-4 w-full",disabled:u,children:[u&&e.jsx(b,{}),"Reset password"]})]})},s[6]=a,s[7]=o):o=s[7];let m;return s[8]!==r||s[9]!==o?(m=e.jsxs(N,{title:"Reset password",description:"Please enter your new password below",children:[t,e.jsx(g,{method:"put",action:l,transform:r,resetOnSuccess:i,children:o})]}),s[8]=r,s[9]=o,s[10]=m):m=s[10],m}export{k as default};
@@ -1,4 +1,4 @@
1
- import{c as L,g as K,s as P,j as s,C as F,H as O,F as D}from"./inertia-Degv_G9N.js";import{I as E}from"./input-error-C6SqO_iU.js";import{R as W}from"./relative-time-6CoKr1lN.js";import{B}from"./app-wordmark-1SRllgHv.js";import{b as k,c as A,C as T,a as C}from"./card-BaJ8kNkp.js";import{L as S,I}from"./label-B_vK19tR.js";import{T as M}from"./textarea-DtD5yZp_.js";import{A as $}from"./app-layout-B5Fcdwfz.js";import"./live-dot-DaXEbkXo.js";import"./index-B0VXzXYG.js";import"./index-CX8Br7m9.js";import"./format-B9SDkrWj.js";import"./checkbox-Bf41R8W6.js";const q=`# Nothing to add under Kamal: the gem already stamps records with
1
+ import{c as L,g as K,s as P,j as s,C as F,H as O,F as D}from"./inertia-DLew8ZNx.js";import{I as E}from"./input-error-cvM6_Jht.js";import{R as W}from"./relative-time-CjIjb8Lg.js";import{B}from"./app-wordmark-o9CODKP0.js";import{b as k,c as A,C as T,a as C}from"./card-cAtqCxWl.js";import{L as S,I}from"./label-GWl7I6sf.js";import{T as M}from"./textarea-DTqrCiV0.js";import{A as $}from"./app-layout-DDyQa72H.js";import"./live-dot-D1n_BreY.js";import"./index-so4lRrRq.js";import"./index-umIAl-pL.js";import"./format-B9SDkrWj.js";import"./checkbox-CmhMHWZO.js";const q=`# Nothing to add under Kamal: the gem already stamps records with
2
2
  # KAMAL_HOST, the same host the post-deploy hook registers here.
3
3
  # Anywhere else, name the host yourself:
4
4
  Railwatch.configure do |c|
@@ -1 +1 @@
1
- import{c as y,C as N,r as b,j as t}from"./inertia-Degv_G9N.js";function v(g){const e=y.c(13),{className:a}=g,c=b.useId();let r;e[0]!==a?(r=N("text-foreground/35 dark:text-foreground/40 pointer-events-none absolute inset-x-0 top-1/2 h-12 w-full -translate-y-1/2","[mask-composite:intersect]","[mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent),radial-gradient(ellipse_200px_160%_at_50%_50%,transparent_20%,black_100%)]","md:[mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent),radial-gradient(ellipse_300px_160%_at_50%_50%,transparent_35%,black_100%)]",a),e[0]=a,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("rect",{x:"9",y:"9",width:"4",height:"30",rx:"1",fill:"currentColor"}),e[2]=i):i=e[2];let l;e[3]!==c?(l=t.jsx("defs",{children:t.jsx("pattern",{id:c,width:"22",height:"48",patternUnits:"userSpaceOnUse",children:i})}),e[3]=c,e[4]=l):l=e[4];const n=`url(#${c})`;let s;e[5]!==n?(s=t.jsx("rect",{width:"100%",height:"100%",fill:n}),e[5]=n,e[6]=s):s=e[6];let o,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("rect",{y:"16",width:"100%",height:"2.5",fill:"currentColor"}),d=t.jsx("rect",{y:"29.5",width:"100%",height:"2.5",fill:"currentColor"}),e[7]=o,e[8]=d):(o=e[7],d=e[8]);let x;return e[9]!==r||e[10]!==l||e[11]!==s?(x=t.jsxs("svg",{"aria-hidden":!0,className:r,preserveAspectRatio:"none",children:[l,s,o,d]}),e[9]=r,e[10]=l,e[11]=s,e[12]=x):x=e[12],x}const k={clear:"text-live",caution:"text-warning",stop:"text-danger"},j={stop:8,caution:17,clear:26},w=["stop","caution","clear"];function C(g){const e=y.c(8),{aspect:a,className:c}=g;let r;e[0]!==c?(r=N("pointer-events-none absolute top-1/2 h-16 w-5 -translate-y-[calc(50%+8px)]","left-[calc(50%+100px)] md:left-[calc(50%+150px)]",c),e[0]=c,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("g",{className:"text-foreground/35 dark:text-foreground/40",children:[t.jsx("rect",{x:"9",y:"33",width:"2",height:"26",rx:"1",fill:"currentColor"}),t.jsx("rect",{x:"5",y:"58",width:"10",height:"2",rx:"1",fill:"currentColor"}),t.jsx("rect",{x:"4.75",y:"1.75",width:"10.5",height:"31.5",rx:"5.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),e[2]=i):i=e[2];let l;e[3]!==a?(l=w.map(s=>s===a?t.jsxs("g",{className:k[s],"data-lamp":s,children:[t.jsx("circle",{cx:"10",cy:j[s],r:"6",fill:"currentColor",opacity:"0.2",className:"blur-[2px]"}),t.jsx("circle",{cx:"10",cy:j[s],r:"3",fill:"currentColor"})]},s):t.jsx("circle",{cx:"10",cy:j[s],r:"3",className:"text-foreground/15",fill:"currentColor"},s)),e[3]=a,e[4]=l):l=e[4];let n;return e[5]!==r||e[6]!==l?(n=t.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 20 64",className:r,children:[i,l]}),e[5]=r,e[6]=l,e[7]=n):n=e[7],n}function E(g){const e=y.c(22),{icon:a,title:c,description:r,action:i,signal:l,className:n}=g,s=l===void 0?"clear":l;let o;e[0]!==n?(o=N("relative flex min-h-48 items-center justify-center overflow-hidden px-4 py-8 text-center",n),e[0]=n,e[1]=o):o=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(v,{}),e[2]=d):d=e[2];let x;e[3]!==s?(x=t.jsx(C,{aspect:s}),e[3]=s,e[4]=x):x=e[4];let f;e[5]!==a?(f=a&&t.jsx("span",{className:"bg-muted text-muted-foreground mb-1 flex size-9 items-center justify-center rounded-md",children:t.jsx(a,{className:"size-4"})}),e[5]=a,e[6]=f):f=e[6];let m;e[7]!==c?(m=t.jsx("span",{className:"text-sm font-medium",children:c}),e[7]=c,e[8]=m):m=e[8];let h;e[9]!==r?(h=r&&t.jsx("span",{className:"text-muted-foreground text-xs leading-relaxed",children:r}),e[9]=r,e[10]=h):h=e[10];let u;e[11]!==i?(u=i&&t.jsx("div",{className:"mt-2",children:i}),e[11]=i,e[12]=u):u=e[12];let p;e[13]!==f||e[14]!==m||e[15]!==h||e[16]!==u?(p=t.jsxs("div",{className:"relative flex max-w-xs flex-col items-center gap-1.5",children:[f,m,h,u]}),e[13]=f,e[14]=m,e[15]=h,e[16]=u,e[17]=p):p=e[17];let _;return e[18]!==o||e[19]!==x||e[20]!==p?(_=t.jsxs("div",{className:o,"aria-live":"polite",children:[d,x,p]}),e[18]=o,e[19]=x,e[20]=p,e[21]=_):_=e[21],_}export{E,C as S,v as T};
1
+ import{c as y,C as N,r as b,j as t}from"./inertia-DLew8ZNx.js";function v(g){const e=y.c(13),{className:a}=g,c=b.useId();let r;e[0]!==a?(r=N("text-foreground/35 dark:text-foreground/40 pointer-events-none absolute inset-x-0 top-1/2 h-12 w-full -translate-y-1/2","[mask-composite:intersect]","[mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent),radial-gradient(ellipse_200px_160%_at_50%_50%,transparent_20%,black_100%)]","md:[mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent),radial-gradient(ellipse_300px_160%_at_50%_50%,transparent_35%,black_100%)]",a),e[0]=a,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("rect",{x:"9",y:"9",width:"4",height:"30",rx:"1",fill:"currentColor"}),e[2]=i):i=e[2];let l;e[3]!==c?(l=t.jsx("defs",{children:t.jsx("pattern",{id:c,width:"22",height:"48",patternUnits:"userSpaceOnUse",children:i})}),e[3]=c,e[4]=l):l=e[4];const n=`url(#${c})`;let s;e[5]!==n?(s=t.jsx("rect",{width:"100%",height:"100%",fill:n}),e[5]=n,e[6]=s):s=e[6];let o,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("rect",{y:"16",width:"100%",height:"2.5",fill:"currentColor"}),d=t.jsx("rect",{y:"29.5",width:"100%",height:"2.5",fill:"currentColor"}),e[7]=o,e[8]=d):(o=e[7],d=e[8]);let x;return e[9]!==r||e[10]!==l||e[11]!==s?(x=t.jsxs("svg",{"aria-hidden":!0,className:r,preserveAspectRatio:"none",children:[l,s,o,d]}),e[9]=r,e[10]=l,e[11]=s,e[12]=x):x=e[12],x}const k={clear:"text-live",caution:"text-warning",stop:"text-danger"},j={stop:8,caution:17,clear:26},w=["stop","caution","clear"];function C(g){const e=y.c(8),{aspect:a,className:c}=g;let r;e[0]!==c?(r=N("pointer-events-none absolute top-1/2 h-16 w-5 -translate-y-[calc(50%+8px)]","left-[calc(50%+100px)] md:left-[calc(50%+150px)]",c),e[0]=c,e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs("g",{className:"text-foreground/35 dark:text-foreground/40",children:[t.jsx("rect",{x:"9",y:"33",width:"2",height:"26",rx:"1",fill:"currentColor"}),t.jsx("rect",{x:"5",y:"58",width:"10",height:"2",rx:"1",fill:"currentColor"}),t.jsx("rect",{x:"4.75",y:"1.75",width:"10.5",height:"31.5",rx:"5.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),e[2]=i):i=e[2];let l;e[3]!==a?(l=w.map(s=>s===a?t.jsxs("g",{className:k[s],"data-lamp":s,children:[t.jsx("circle",{cx:"10",cy:j[s],r:"6",fill:"currentColor",opacity:"0.2",className:"blur-[2px]"}),t.jsx("circle",{cx:"10",cy:j[s],r:"3",fill:"currentColor"})]},s):t.jsx("circle",{cx:"10",cy:j[s],r:"3",className:"text-foreground/15",fill:"currentColor"},s)),e[3]=a,e[4]=l):l=e[4];let n;return e[5]!==r||e[6]!==l?(n=t.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 20 64",className:r,children:[i,l]}),e[5]=r,e[6]=l,e[7]=n):n=e[7],n}function E(g){const e=y.c(22),{icon:a,title:c,description:r,action:i,signal:l,className:n}=g,s=l===void 0?"clear":l;let o;e[0]!==n?(o=N("relative flex min-h-48 items-center justify-center overflow-hidden px-4 py-8 text-center",n),e[0]=n,e[1]=o):o=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(v,{}),e[2]=d):d=e[2];let x;e[3]!==s?(x=t.jsx(C,{aspect:s}),e[3]=s,e[4]=x):x=e[4];let f;e[5]!==a?(f=a&&t.jsx("span",{className:"bg-muted text-muted-foreground mb-1 flex size-9 items-center justify-center rounded-md",children:t.jsx(a,{className:"size-4"})}),e[5]=a,e[6]=f):f=e[6];let m;e[7]!==c?(m=t.jsx("span",{className:"text-sm font-medium",children:c}),e[7]=c,e[8]=m):m=e[8];let h;e[9]!==r?(h=r&&t.jsx("span",{className:"text-muted-foreground text-xs leading-relaxed",children:r}),e[9]=r,e[10]=h):h=e[10];let u;e[11]!==i?(u=i&&t.jsx("div",{className:"mt-2",children:i}),e[11]=i,e[12]=u):u=e[12];let p;e[13]!==f||e[14]!==m||e[15]!==h||e[16]!==u?(p=t.jsxs("div",{className:"relative flex max-w-xs flex-col items-center gap-1.5",children:[f,m,h,u]}),e[13]=f,e[14]=m,e[15]=h,e[16]=u,e[17]=p):p=e[17];let _;return e[18]!==o||e[19]!==x||e[20]!==p?(_=t.jsxs("div",{className:o,"aria-live":"polite",children:[d,x,p]}),e[18]=o,e[19]=x,e[20]=p,e[21]=_):_=e[21],_}export{E,C as S,v as T};
@@ -0,0 +1 @@
1
+ import{r as P,j as n,c as O,C as le,u as U,e as X,g as ge,o as ve,H as xe}from"./inertia-DLew8ZNx.js";import{b as Pe}from"./badge-CAxXV8za.js";import{t as we,v as be,w as Ce,D as _e,C as je,x as Se,y as De,z as Re,E as ye,H as Oe,J as Ne,K as Ie,A as Te}from"./app-layout-DDyQa72H.js";import{u as Ee}from"./use-live-D7xKz2ma.js";import{d as ie,R as $e,u as ke,A as Ae,P as Me,h as Fe,g as Le,f as ze,F as He,e as We,C as Ge,t as Ue,L as Ve}from"./live-dot-D1n_BreY.js";import{a as q}from"./format-B9SDkrWj.js";import{u as ce,a as Be,B as Q}from"./app-wordmark-o9CODKP0.js";import{a as ne,S as Ke}from"./segmented-BgbT3wZa.js";import{L as re,I as ae}from"./label-GWl7I6sf.js";import{c as Ye,u as Je,a as Z,P as de}from"./index-umIAl-pL.js";import{P as Ze}from"./index-so4lRrRq.js";var qe=Object.defineProperty,T=(t,e)=>qe(t,"name",{value:e,configurable:!0}),ee="Popover",[ue,Ft]=Ye(ee,[ie]),te=ie(),[Qe,W]=ue(ee),Xe=T(t=>{const{__scopePopover:e,children:o,open:s,defaultOpen:l,onOpenChange:c,modal:i=!1}=t,r=te(e),a=P.useRef(null),[u,d]=P.useState(!1),[f,p]=Je({prop:s,defaultProp:l??!1,onChange:c,caller:ee});return n.jsx($e,{...r,children:n.jsx(Qe,{scope:e,contentId:ke(),triggerRef:a,open:f,onOpenChange:p,onOpenToggle:P.useCallback(()=>p(m=>!m),[p]),hasCustomAnchor:u,onCustomAnchorAdd:P.useCallback(()=>d(!0),[]),onCustomAnchorRemove:P.useCallback(()=>d(!1),[]),modal:i,children:o})})},"Popover"),et="PopoverTrigger",tt=P.forwardRef(T(function(e,o){const{__scopePopover:s,...l}=e,c=W(et,s),i=te(s),r=ce(o,c.triggerRef),a=n.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":oe(c.open),...l,ref:r,onClick:Z(e.onClick,c.onOpenToggle)});return c.hasCustomAnchor?a:n.jsx(Ae,{asChild:!0,...i,children:a})},"PopoverTrigger")),pe="PopoverPortal",[ot,st]=ue(pe,{forceMount:void 0}),nt=T(t=>{const{__scopePopover:e,forceMount:o,children:s,container:l}=t,c=W(pe,e);return n.jsx(ot,{scope:e,forceMount:o,children:n.jsx(de,{present:o||c.open,children:n.jsx(Me,{asChild:!0,container:l,children:s})})})},"PopoverPortal"),G="PopoverContent",rt=P.forwardRef(T(function(e,o){const s=st(G,e.__scopePopover),{forceMount:l=s.forceMount,...c}=e,i=W(G,e.__scopePopover);return n.jsx(de,{present:l||i.open,children:i.modal?n.jsx(lt,{...c,ref:o}):n.jsx(it,{...c,ref:o})})},"PopoverContent")),at=Be("PopoverContent.RemoveScroll"),lt=P.forwardRef(T(function(e,o){const s=W(G,e.__scopePopover),l=P.useRef(null),c=ce(o,l),i=P.useRef(!1);return P.useEffect(()=>{const r=l.current;if(r)return Fe(r)},[]),n.jsx(Le,{as:at,allowPinchZoom:!0,children:n.jsx(fe,{...e,ref:c,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Z(e.onCloseAutoFocus,r=>{r.preventDefault(),i.current||s.triggerRef.current?.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,r=>{const a=r.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,d=a.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Z(e.onFocusOutside,r=>r.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),it=P.forwardRef(T(function(e,o){const s=W(G,e.__scopePopover),l=P.useRef(!1),c=P.useRef(!1);return n.jsx(fe,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(l.current||s.triggerRef.current?.focus(),i.preventDefault()),l.current=!1,c.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(l.current=!0,i.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const r=i.target;s.triggerRef.current?.contains(r)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&c.current&&i.preventDefault()}})},"PopoverContentNonModal")),fe=P.forwardRef(T(function(e,o){const{__scopePopover:s,trapFocus:l,onOpenAutoFocus:c,onCloseAutoFocus:i,disableOutsidePointerEvents:r,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,...p}=e,m=W(G,s),h=te(s);return ze(),n.jsx(He,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:c,onUnmountAutoFocus:i,children:n.jsx(We,{asChild:!0,disableOutsidePointerEvents:r,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:n.jsx(Ge,{"data-state":oe(m.open),role:"dialog",id:m.contentId,...h,...p,ref:o,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl"));function oe(t){return t?"open":"closed"}T(oe,"getState");var ct=Xe,dt=tt,ut=nt,pt=rt;function ft(t){const e=O.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=n.jsx(ct,{"data-slot":"popover",...o}),e[2]=o,e[3]=s):s=e[3],s}function mt(t){const e=O.c(4);let o;e[0]!==t?({...o}=t,e[0]=t,e[1]=o):o=e[1];let s;return e[2]!==o?(s=n.jsx(dt,{"data-slot":"popover-trigger",...o}),e[2]=o,e[3]=s):s=e[3],s}function ht(t){const e=O.c(12);let o,s,l,c;e[0]!==t?({className:o,align:l,sideOffset:c,...s}=t,e[0]=t,e[1]=o,e[2]=s,e[3]=l,e[4]=c):(o=e[1],s=e[2],l=e[3],c=e[4]);const i=l===void 0?"center":l,r=c===void 0?4:c;let a;e[5]!==o?(a=le("bg-popover text-popover-foreground data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",o),e[5]=o,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==s||e[9]!==r||e[10]!==a?(u=n.jsx(ut,{children:n.jsx(pt,{"data-slot":"popover-content",align:i,sideOffset:r,className:a,...s})}),e[7]=i,e[8]=s,e[9]=r,e[10]=a,e[11]=u):u=e[11],u}function gt(t){const e=O.c(46),{environmentId:o}=t;Ue();const{environment:s,telemetry_freshness:l}=U().props,{connected:c,lastEventAt:i,lastRefreshedAt:r,paused:a,setPaused:u}=Ee(o);let d;e[0]!==s?.last_seen_at||e[1]!==l?.received_at||e[2]!==i?(d=i!=null?new Date(i).toISOString():l?.received_at??s?.last_seen_at??null,e[0]=s?.last_seen_at,e[1]=l?.received_at,e[2]=i,e[3]=d):d=e[3];const f=d;let p,m,h,g,v;if(e[4]!==c||e[5]!==f||e[6]!==r||e[7]!==a||e[8]!==u){const E=r!=null?new Date(r).toISOString():null;m=we;const $=a?"Resume live updates":"Pause live updates";let b;e[14]!==a||e[15]!==u?(b=()=>u(!a),e[14]=a,e[15]=u,e[16]=b):b=e[16];let j;e[17]===Symbol.for("react.memo_cache_sentinel")?(j=le(Pe({variant:"outline"}),"hover:bg-accent h-7 cursor-pointer gap-1.5 rounded-md font-mono text-[11px] tracking-wide uppercase"),e[17]=j):j=e[17];const y=c?f:null;let C;e[18]!==y?(C=n.jsx(Ve,{lastSeenAt:y,thresholdMs:1e4}),e[18]=y,e[19]=C):C=e[19];const I=a?"Paused":c?"Live":"Disconnected";e[20]!==a||e[21]!==I||e[22]!==$||e[23]!==b||e[24]!==C?(v=n.jsx(be,{asChild:!0,children:n.jsxs("button",{type:"button","aria-pressed":a,"aria-label":$,onClick:b,className:j,children:[C,I]})}),e[20]=a,e[21]=I,e[22]=$,e[23]=b,e[24]=C,e[25]=v):v=e[25],p=Ce;let S;e[26]!==f?(S=f?`Telemetry received ${q(f)}`:"No telemetry received yet",e[26]=f,e[27]=S):S=e[27],e[28]!==S?(g=n.jsx("p",{children:S}),e[28]=S,e[29]=g):g=e[29],h=E?`Page refreshed ${q(E)}`:"No live refresh yet",e[4]=c,e[5]=f,e[6]=r,e[7]=a,e[8]=u,e[9]=p,e[10]=m,e[11]=h,e[12]=g,e[13]=v}else p=e[9],m=e[10],h=e[11],g=e[12],v=e[13];let _;e[30]!==h?(_=n.jsx("p",{children:h}),e[30]=h,e[31]=_):_=e[31];let D;e[32]!==l?(D=l?.processing_lag_seconds!=null&&n.jsxs("p",{children:["Ingest processing pending:"," ",Math.round(l.processing_lag_seconds),"s"]}),e[32]=l,e[33]=D):D=e[33];let w;e[34]!==l?(w=l?.aggregated_at&&n.jsxs("p",{children:["Charts updated ",q(l.aggregated_at)]}),e[34]=l,e[35]=w):w=e[35];let R;e[36]!==p||e[37]!==g||e[38]!==_||e[39]!==D||e[40]!==w?(R=n.jsxs(p,{children:[g,_,D,w]}),e[36]=p,e[37]=g,e[38]=_,e[39]=D,e[40]=w,e[41]=R):R=e[41];let N;return e[42]!==m||e[43]!==v||e[44]!==R?(N=n.jsxs(m,{children:[v,R]}),e[42]=m,e[43]=v,e[44]=R,e[45]=N):N=e[45],N}const se={"1m":"1 minute","5m":"5 minutes","15m":"15 minutes","1h":"1 hour","6h":"6 hours","1d":"1 day"};function vt(){const t=O.c(6),{step:e,steps:o}=U().props,s=e===void 0?"1h":e;let l;t[0]!==o?(l=o===void 0?[]:o,t[0]=o,t[1]=l):l=t[1];const c=l,i=xt,r=se[s]??s;let a;return t[2]!==s||t[3]!==c||t[4]!==r?(a={step:s,steps:c,set:i,label:r},t[2]=s,t[3]=c,t[4]=r,t[5]=a):a=t[5],a}function xt(t){const e=new URL(globalThis.location.href);e.searchParams.set("step",t),X.visit(e.toString(),{preserveScroll:!0,preserveState:!0})}function Pt(){const t=O.c(18),{step:e,steps:o,set:s}=vt();if(o.length<2)return null;const l=`Chart buckets: ${se[e]}`;let c;t[0]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("span",{className:"text-muted-foreground normal-case",children:"per"}),t[0]=c):c=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=n.jsx(je,{className:"text-muted-foreground size-3"}),t[1]=i):i=t[1];let r;t[2]!==e||t[3]!==l?(r=n.jsx(Se,{asChild:!0,children:n.jsxs(Q,{variant:"outline",size:"sm",className:"h-8 gap-1 px-2 font-mono text-xs uppercase","aria-label":l,children:[c,e,i]})}),t[2]=e,t[3]=l,t[4]=r):r=t[4];let a,u;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx(De,{className:"label-caps",children:"Chart buckets"}),u=n.jsx(Re,{}),t[5]=a,t[6]=u):(a=t[5],u=t[6]);let d;t[7]!==s?(d=h=>s(h),t[7]=s,t[8]=d):d=t[8];let f;t[9]!==o?(f=o.map(wt),t[9]=o,t[10]=f):f=t[10];let p;t[11]!==e||t[12]!==d||t[13]!==f?(p=n.jsxs(ye,{align:"end",className:"w-44",children:[a,u,n.jsx(Oe,{value:e,onValueChange:d,children:f})]}),t[11]=e,t[12]=d,t[13]=f,t[14]=p):p=t[14];let m;return t[15]!==r||t[16]!==p?(m=n.jsxs(Ne,{children:[r,p]}),t[15]=r,t[16]=p,t[17]=m):m=t[17],m}function wt(t){return n.jsxs(_e,{value:t,className:"text-xs",children:[n.jsx("span",{className:"font-mono uppercase",children:t}),n.jsx("span",{className:"text-muted-foreground ml-auto",children:se[t]})]},t)}const me=[{value:"1h",label:"1 hour"},{value:"6h",label:"6 hours"},{value:"24h",label:"24 hours"},{value:"7d",label:"7 days"},{value:"30d",label:"30 days"}];function bt(t,e){const o={month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"};return`${new Date(t).toLocaleString(void 0,o)} – ${new Date(e).toLocaleString(void 0,o)}`}function Ct(){const t=O.c(8),{window:e,range:o}=U().props,s=e===void 0?"24h":e,l=jt,c=_t;let i;t[0]!==s||t[1]!==o?(i=s==="custom"&&o?bt(o.from,o.to):me.find(f=>f.value===s)?.label??s,t[0]=s,t[1]=o,t[2]=i):i=t[2];const r=i,a=o?.from,u=o?.to;let d;return t[3]!==s||t[4]!==r||t[5]!==a||t[6]!==u?(d={window:s,from:a,to:u,set:l,setRange:c,label:r},t[3]=s,t[4]=r,t[5]=a,t[6]=u,t[7]=d):d=t[7],d}function _t(t,e){const o=new URL(globalThis.location.href);o.searchParams.set("from",t),o.searchParams.set("to",e),o.searchParams.delete("window"),o.searchParams.delete("step"),X.visit(o.toString(),{preserveScroll:!0,preserveState:!0})}function jt(t){const e=new URL(globalThis.location.href);e.searchParams.set("window",t),e.searchParams.delete("from"),e.searchParams.delete("to"),e.searchParams.delete("step"),X.visit(e.toString(),{preserveScroll:!0,preserveState:!0})}function Y(t){const e=new Date(t),o=s=>String(s).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}T${o(e.getHours())}:${o(e.getMinutes())}`}function J(t){const e=new Date(t);return e.setHours(0,0,0,0),e}const St=[{label:"Today",range:()=>[J(new Date),new Date]},{label:"Yesterday",range:()=>{const t=J(new Date);return[J(new Date(t.getTime()-1440*60*1e3)),t]}},{label:"This week",range:()=>{const t=J(new Date);return t.setDate(t.getDate()-t.getDay()),[t,new Date]}}];function Dt(){const t=O.c(48),{window:e,from:o,to:s,set:l,setRange:c,label:i}=Ct(),[r,a]=P.useState(!1);let u;t[0]!==o?(u=()=>Y(o??new Date(Date.now()-864e5).toISOString()),t[0]=o,t[1]=u):u=t[1];const[d,f]=P.useState(u);let p;t[2]!==s?(p=()=>Y(s??new Date().toISOString()),t[2]=s,t[3]=p):p=t[3];const[m,h]=P.useState(p);let g;t[4]!==c?(g=(x,k)=>{f(Y(x.toISOString())),h(Y(k.toISOString())),c(x.toISOString(),k.toISOString()),a(!1)},t[4]=c,t[5]=g):g=t[5];const v=g;let _;t[6]!==v||t[7]!==d||t[8]!==m?(_=()=>{const x=new Date(d),k=new Date(m);!Number.isNaN(x.getTime())&&!Number.isNaN(k.getTime())&&v(x,k)},t[6]=v,t[7]=d,t[8]=m,t[9]=_):_=t[9];const D=_;let w;t[10]!==l||t[11]!==e?(w=me.map(x=>n.jsx(ne,{active:e===x.value,onClick:()=>l(x.value),"aria-label":x.label,children:x.value},x.value)),t[10]=l,t[11]=e,t[12]=w):w=t[12];const R=e==="custom";let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=()=>a(!0),t[13]=N):N=t[13];let E;t[14]===Symbol.for("react.memo_cache_sentinel")?(E=n.jsx(Ie,{className:"size-3"}),t[14]=E):E=t[14];const $=e==="custom"?i:"Custom";let b;t[15]!==$?(b=n.jsx("span",{className:"hidden sm:inline",children:$}),t[15]=$,t[16]=b):b=t[16];let j;t[17]!==R||t[18]!==b?(j=n.jsx(mt,{asChild:!0,children:n.jsxs(ne,{active:R,onClick:N,"aria-label":"Custom range",className:"px-2",children:[E,b]})}),t[17]=R,t[18]=b,t[19]=j):j=t[19];let y;t[20]!==v?(y=St.map(x=>n.jsx(Q,{type:"button",variant:"outline",size:"sm",onClick:()=>{const[k,he]=x.range();v(k,he)},children:x.label},x.label)),t[20]=v,t[21]=y):y=t[21];let C;t[22]!==y?(C=n.jsx("div",{className:"flex flex-wrap gap-1",children:y}),t[22]=y,t[23]=C):C=t[23];let I;t[24]===Symbol.for("react.memo_cache_sentinel")?(I=n.jsx(re,{htmlFor:"window-picker-from",className:"text-xs",children:"From"}),t[24]=I):I=t[24];let S;t[25]===Symbol.for("react.memo_cache_sentinel")?(S=x=>f(x.target.value),t[25]=S):S=t[25];let A;t[26]!==d?(A=n.jsx(ae,{id:"window-picker-from",type:"datetime-local",value:d,onChange:S}),t[26]=d,t[27]=A):A=t[27];let V;t[28]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(re,{htmlFor:"window-picker-to",className:"text-xs",children:"To"}),t[28]=V):V=t[28];let B;t[29]===Symbol.for("react.memo_cache_sentinel")?(B=x=>h(x.target.value),t[29]=B):B=t[29];let M;t[30]!==m?(M=n.jsx(ae,{id:"window-picker-to",type:"datetime-local",value:m,onChange:B}),t[30]=m,t[31]=M):M=t[31];let F;t[32]!==A||t[33]!==M?(F=n.jsxs("div",{className:"flex flex-col gap-2",children:[I,A,V,M]}),t[32]=A,t[33]=M,t[34]=F):F=t[34];let L;t[35]!==D?(L=n.jsx(Q,{type:"button",size:"sm",onClick:D,children:"Apply"}),t[35]=D,t[36]=L):L=t[36];let z;t[37]!==C||t[38]!==F||t[39]!==L?(z=n.jsx(ht,{className:"w-72",align:"end",children:n.jsxs("div",{className:"flex flex-col gap-3",children:[C,F,L]})}),t[37]=C,t[38]=F,t[39]=L,t[40]=z):z=t[40];let H;t[41]!==r||t[42]!==j||t[43]!==z?(H=n.jsxs(ft,{open:r,onOpenChange:a,children:[j,z]}),t[41]=r,t[42]=j,t[43]=z,t[44]=H):H=t[44];let K;return t[45]!==H||t[46]!==w?(K=n.jsxs(Ke,{children:[w,H]}),t[45]=H,t[46]=w,t[47]=K):K=t[47],K}function Lt(t){const e=O.c(21),{title:o,description:s,actions:l,withWindow:c}=t,i=c===void 0?!0:c,{environment:r}=U().props;let a;e[0]!==o?(a=n.jsx("h1",{className:"truncate text-xl font-semibold tracking-tight md:text-2xl",children:o}),e[0]=o,e[1]=a):a=e[1];let u;e[2]!==s?(u=s&&n.jsx("p",{className:"text-muted-foreground mt-0.5 text-sm",children:s}),e[2]=s,e[3]=u):u=e[3];let d;e[4]!==a||e[5]!==u?(d=n.jsxs("div",{className:"min-w-0",children:[a,u]}),e[4]=a,e[5]=u,e[6]=d):d=e[6];let f;e[7]!==r?(f=r&&n.jsx(gt,{environmentId:r.id}),e[7]=r,e[8]=f):f=e[8];let p;e[9]!==i?(p=i&&n.jsx(Pt,{}),e[9]=i,e[10]=p):p=e[10];let m;e[11]!==i?(m=i&&n.jsx(Dt,{}),e[11]=i,e[12]=m):m=e[12];let h;e[13]!==l||e[14]!==f||e[15]!==p||e[16]!==m?(h=n.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:shrink-0 md:justify-end",children:[f,l,p,m]}),e[13]=l,e[14]=f,e[15]=p,e[16]=m,e[17]=h):h=e[17];let g;return e[18]!==d||e[19]!==h?(g=n.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between md:gap-4",children:[d,h]}),e[18]=d,e[19]=h,e[20]=g):g=e[20],g}function zt(t){const e=O.c(18),{title:o,children:s,crumbs:l}=t;let c;e[0]!==l?(c=l===void 0?[]:l,e[0]=l,e[1]=c):c=e[1];const i=c,{environment:r}=U().props;let a;e[2]!==r?(a=r?[{title:r.application_name,href:ge(r.application_id)},{title:r.name,href:ve(r.application_id,r.id)}]:[],e[2]=r,e[3]=a):a=e[3];const u=a;let d;e[4]!==i||e[5]!==o?(d=i.length?i:[{title:o,href:"#"}],e[4]=i,e[5]=o,e[6]=d):d=e[6];let f;e[7]!==u||e[8]!==d?(f=[...u,...d],e[7]=u,e[8]=d,e[9]=f):f=e[9];const p=f,m=r?`${o} · ${r.application_name} ${r.name}`:o;let h;e[10]!==m?(h=n.jsx(xe,{title:m}),e[10]=m,e[11]=h):h=e[11];let g;e[12]!==s?(g=n.jsx("div",{className:"flex flex-1 flex-col gap-4 p-3 md:gap-5 md:p-6",children:s}),e[12]=s,e[13]=g):g=e[13];let v;return e[14]!==p||e[15]!==h||e[16]!==g?(v=n.jsxs(Te,{breadcrumbs:p,children:[h,g]}),e[14]=p,e[15]=h,e[16]=g,e[17]=v):v=e[17],v}export{zt as E,Lt as P,ft as a,mt as b,ht as c,Ct as u};
@@ -1 +1 @@
1
- import{ax as e,w as n,ay as h,K as u,t as m}from"./inertia-Degv_G9N.js";function c({applicationId:t,environmentId:r,source:s,executionId:a}){if(!a||s==="browser")return null;switch(s){case"request":return m(t,r,a);case"job":case"job_attempt":return u(t,r,a);case"scheduled_task":return h(t,r,a);case"command":return n(t,r,a);default:return e(t,r,a)}}export{c as e};
1
+ import{ax as e,w as n,ay as h,K as u,t as m}from"./inertia-DLew8ZNx.js";function c({applicationId:t,environmentId:r,source:s,executionId:a}){if(!a||s==="browser")return null;switch(s){case"request":return m(t,r,a);case"job":case"job_attempt":return u(t,r,a);case"scheduled_task":return h(t,r,a);case"command":return n(t,r,a);default:return e(t,r,a)}}export{c as e};
@@ -1 +1 @@
1
- import{B as U,c as Y,r as I,j as s,a5 as Z}from"./inertia-Degv_G9N.js";import{B as ee}from"./badge-CApjyWcg.js";import{B as te}from"./app-wordmark-1SRllgHv.js";import{f as V,g as G,e as se,s as ne,m as le,l as oe}from"./app-layout-B5Fcdwfz.js";import{a as ae,b as ie,c as re}from"./env-layout-erSDpIXg.js";const ce=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],me=U("funnel",ce),de=/^([a-z_]+):(\S+)$/;function fe(m){const e=[],l={};for(const a of m.trim().split(/\s+/)){if(!a)continue;const o=de.exec(a);o?l[o[1]]=o[2]:e.push(a)}return{text:e.join(" "),fields:l}}function H(m){const e=Object.entries(m.fields).map(([l,a])=>`${l}:${a}`);return m.text&&e.push(m.text),e.join(" ")}function be(m){const e=Y.c(57),{value:l,fields:a,onChange:o,placeholder:K}=m,$=K===void 0?"Filter...":K,[i,z]=I.useState(l),[R,D]=I.useState(!1),[M,W]=I.useState(l);l!==M&&(W(l),z(l));let f,x,p,u,h,r,j,b,y,g,_,c,v;if(e[0]!==i||e[1]!==a||e[2]!==o||e[3]!==R||e[4]!==$||e[5]!==l){const B=fe(l),X=t=>{const n={...B.fields};delete n[t];const d=H({text:B.text,fields:n});z(d),o(d)},J=(t,n)=>{const d=H({text:B.text,fields:{...B.fields,[t]:n}});z(d),o(d),D(!1)};let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=t=>{z(n=>`${n}${n&&!n.endsWith(" ")?" ":""}${t}:`),D(!1)},e[19]=E):E=e[19];const Q=E;let O;e[20]!==i||e[21]!==o?(O=()=>o(i),e[20]=i,e[21]=o,e[22]=O):O=e[22];const w=O;v="flex flex-wrap items-center gap-2";let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(se,{className:"text-muted-foreground size-3.5 shrink-0"}),e[23]=A):A=e[23];let q;e[24]===Symbol.for("react.memo_cache_sentinel")?(q=t=>z(t.target.value),e[24]=q):q=e[24];let T;e[25]!==w?(T=t=>t.key==="Enter"&&w(),e[25]=w,e[26]=T):T=e[26];let L;e[27]!==w||e[28]!==i||e[29]!==$||e[30]!==T?(L=s.jsx("input",{"data-filter-bar-input":!0,value:i,onChange:q,onKeyDown:T,onBlur:w,placeholder:$,className:"placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent font-mono text-xs outline-none"}),e[27]=w,e[28]=i,e[29]=$,e[30]=T,e[31]=L):L=e[31];let P;e[32]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("kbd",{className:"bg-muted text-muted-foreground hidden rounded px-1 font-mono text-[10px] md:inline",children:"/"}),e[32]=P):P=e[32],h=s.jsxs("div",{className:"bg-card focus-within:border-ring flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-md border px-2 md:max-w-md md:flex-none md:basis-80",children:[A,Object.entries(B.fields).map(t=>{const[n,d]=t;return s.jsxs(ee,{variant:"secondary",className:"shrink-0 gap-1 rounded-sm px-1.5 font-mono text-[10px]",children:[n,":",d,s.jsx("button",{type:"button",onClick:()=>X(n),className:"hover:text-destructive","aria-label":`Remove ${n} filter`,children:s.jsx(Z,{className:"size-3"})})]},n)}),L,P]}),u=ae,g=R,_=D,e[33]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ie,{asChild:!0,children:s.jsx(te,{type:"button",variant:"outline",size:"sm",className:"h-8 px-2","aria-label":"Add filter",children:s.jsx(me,{className:"size-3.5"})})}),e[33]=c):c=e[33],p=re,b="w-56 p-0",y="start",x=ne,f=le,e[34]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(oe,{children:"No fields."}),e[34]=r):r=e[34],j=a.map(t=>t.options?s.jsx(V,{heading:t.label,children:t.options.map(n=>s.jsx(G,{onSelect:()=>J(t.key,n),children:n},n))},t.key):s.jsx(V,{heading:t.label,children:s.jsxs(G,{onSelect:()=>Q(t.key),children:[t.key,":…"]})},t.key)),e[0]=i,e[1]=a,e[2]=o,e[3]=R,e[4]=$,e[5]=l,e[6]=f,e[7]=x,e[8]=p,e[9]=u,e[10]=h,e[11]=r,e[12]=j,e[13]=b,e[14]=y,e[15]=g,e[16]=_,e[17]=c,e[18]=v}else f=e[6],x=e[7],p=e[8],u=e[9],h=e[10],r=e[11],j=e[12],b=e[13],y=e[14],g=e[15],_=e[16],c=e[17],v=e[18];let k;e[35]!==f||e[36]!==r||e[37]!==j?(k=s.jsxs(f,{children:[r,j]}),e[35]=f,e[36]=r,e[37]=j,e[38]=k):k=e[38];let N;e[39]!==x||e[40]!==k?(N=s.jsx(x,{children:k}),e[39]=x,e[40]=k,e[41]=N):N=e[41];let S;e[42]!==p||e[43]!==N||e[44]!==b||e[45]!==y?(S=s.jsx(p,{className:b,align:y,children:N}),e[42]=p,e[43]=N,e[44]=b,e[45]=y,e[46]=S):S=e[46];let C;e[47]!==u||e[48]!==S||e[49]!==g||e[50]!==_||e[51]!==c?(C=s.jsxs(u,{open:g,onOpenChange:_,children:[c,S]}),e[47]=u,e[48]=S,e[49]=g,e[50]=_,e[51]=c,e[52]=C):C=e[52];let F;return e[53]!==h||e[54]!==C||e[55]!==v?(F=s.jsxs("div",{className:v,children:[h,C]}),e[53]=h,e[54]=C,e[55]=v,e[56]=F):F=e[56],F}export{be as F,fe as p,H as s};
1
+ import{B as U,c as Y,r as I,j as s,a5 as Z}from"./inertia-DLew8ZNx.js";import{B as ee}from"./badge-CAxXV8za.js";import{B as te}from"./app-wordmark-o9CODKP0.js";import{f as V,g as G,e as se,s as ne,m as le,l as oe}from"./app-layout-DDyQa72H.js";import{a as ae,b as ie,c as re}from"./env-layout-REF7OM4q.js";const ce=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],me=U("funnel",ce),de=/^([a-z_]+):(\S+)$/;function fe(m){const e=[],l={};for(const a of m.trim().split(/\s+/)){if(!a)continue;const o=de.exec(a);o?l[o[1]]=o[2]:e.push(a)}return{text:e.join(" "),fields:l}}function H(m){const e=Object.entries(m.fields).map(([l,a])=>`${l}:${a}`);return m.text&&e.push(m.text),e.join(" ")}function be(m){const e=Y.c(57),{value:l,fields:a,onChange:o,placeholder:K}=m,$=K===void 0?"Filter...":K,[i,z]=I.useState(l),[R,D]=I.useState(!1),[M,W]=I.useState(l);l!==M&&(W(l),z(l));let f,x,p,u,h,r,j,b,y,g,_,c,v;if(e[0]!==i||e[1]!==a||e[2]!==o||e[3]!==R||e[4]!==$||e[5]!==l){const B=fe(l),X=t=>{const n={...B.fields};delete n[t];const d=H({text:B.text,fields:n});z(d),o(d)},J=(t,n)=>{const d=H({text:B.text,fields:{...B.fields,[t]:n}});z(d),o(d),D(!1)};let E;e[19]===Symbol.for("react.memo_cache_sentinel")?(E=t=>{z(n=>`${n}${n&&!n.endsWith(" ")?" ":""}${t}:`),D(!1)},e[19]=E):E=e[19];const Q=E;let O;e[20]!==i||e[21]!==o?(O=()=>o(i),e[20]=i,e[21]=o,e[22]=O):O=e[22];const w=O;v="flex flex-wrap items-center gap-2";let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=s.jsx(se,{className:"text-muted-foreground size-3.5 shrink-0"}),e[23]=A):A=e[23];let q;e[24]===Symbol.for("react.memo_cache_sentinel")?(q=t=>z(t.target.value),e[24]=q):q=e[24];let T;e[25]!==w?(T=t=>t.key==="Enter"&&w(),e[25]=w,e[26]=T):T=e[26];let L;e[27]!==w||e[28]!==i||e[29]!==$||e[30]!==T?(L=s.jsx("input",{"data-filter-bar-input":!0,value:i,onChange:q,onKeyDown:T,onBlur:w,placeholder:$,className:"placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent font-mono text-xs outline-none"}),e[27]=w,e[28]=i,e[29]=$,e[30]=T,e[31]=L):L=e[31];let P;e[32]===Symbol.for("react.memo_cache_sentinel")?(P=s.jsx("kbd",{className:"bg-muted text-muted-foreground hidden rounded px-1 font-mono text-[10px] md:inline",children:"/"}),e[32]=P):P=e[32],h=s.jsxs("div",{className:"bg-card focus-within:border-ring flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-md border px-2 md:max-w-md md:flex-none md:basis-80",children:[A,Object.entries(B.fields).map(t=>{const[n,d]=t;return s.jsxs(ee,{variant:"secondary",className:"shrink-0 gap-1 rounded-sm px-1.5 font-mono text-[10px]",children:[n,":",d,s.jsx("button",{type:"button",onClick:()=>X(n),className:"hover:text-destructive","aria-label":`Remove ${n} filter`,children:s.jsx(Z,{className:"size-3"})})]},n)}),L,P]}),u=ae,g=R,_=D,e[33]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(ie,{asChild:!0,children:s.jsx(te,{type:"button",variant:"outline",size:"sm",className:"h-8 px-2","aria-label":"Add filter",children:s.jsx(me,{className:"size-3.5"})})}),e[33]=c):c=e[33],p=re,b="w-56 p-0",y="start",x=ne,f=le,e[34]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(oe,{children:"No fields."}),e[34]=r):r=e[34],j=a.map(t=>t.options?s.jsx(V,{heading:t.label,children:t.options.map(n=>s.jsx(G,{onSelect:()=>J(t.key,n),children:n},n))},t.key):s.jsx(V,{heading:t.label,children:s.jsxs(G,{onSelect:()=>Q(t.key),children:[t.key,":…"]})},t.key)),e[0]=i,e[1]=a,e[2]=o,e[3]=R,e[4]=$,e[5]=l,e[6]=f,e[7]=x,e[8]=p,e[9]=u,e[10]=h,e[11]=r,e[12]=j,e[13]=b,e[14]=y,e[15]=g,e[16]=_,e[17]=c,e[18]=v}else f=e[6],x=e[7],p=e[8],u=e[9],h=e[10],r=e[11],j=e[12],b=e[13],y=e[14],g=e[15],_=e[16],c=e[17],v=e[18];let k;e[35]!==f||e[36]!==r||e[37]!==j?(k=s.jsxs(f,{children:[r,j]}),e[35]=f,e[36]=r,e[37]=j,e[38]=k):k=e[38];let N;e[39]!==x||e[40]!==k?(N=s.jsx(x,{children:k}),e[39]=x,e[40]=k,e[41]=N):N=e[41];let S;e[42]!==p||e[43]!==N||e[44]!==b||e[45]!==y?(S=s.jsx(p,{className:b,align:y,children:N}),e[42]=p,e[43]=N,e[44]=b,e[45]=y,e[46]=S):S=e[46];let C;e[47]!==u||e[48]!==S||e[49]!==g||e[50]!==_||e[51]!==c?(C=s.jsxs(u,{open:g,onOpenChange:_,children:[c,S]}),e[47]=u,e[48]=S,e[49]=g,e[50]=_,e[51]=c,e[52]=C):C=e[52];let F;return e[53]!==h||e[54]!==C||e[55]!==v?(F=s.jsxs("div",{className:v,children:[h,C]}),e[53]=h,e[54]=C,e[55]=v,e[56]=F):F=e[56],F}export{be as F,fe as p,H as s};
@@ -1,2 +1,2 @@
1
- import{r as j,j as o,C,c as $}from"./inertia-Degv_G9N.js";import{D as E}from"./data-table-IvA7xvrK.js";import{S as V,a as z}from"./segmented-CVKq2Xpa.js";import{I as W}from"./label-B_vK19tR.js";import{c as M,p as T}from"./format-B9SDkrWj.js";function L(s){let e=0;const t=a=>({id:e++,name:a,value:0,self:0,children:[]}),n=t("all"),m=new Map;for(const a of s.split(`
1
+ import{r as j,j as o,C,c as $}from"./inertia-DLew8ZNx.js";import{D as E}from"./data-table-BIlt7Rtm.js";import{S as V,a as z}from"./segmented-BgbT3wZa.js";import{I as W}from"./label-GWl7I6sf.js";import{c as M,p as T}from"./format-B9SDkrWj.js";function L(s){let e=0;const t=a=>({id:e++,name:a,value:0,self:0,children:[]}),n=t("all"),m=new Map;for(const a of s.split(`
2
2
  `)){const f=a.trim(),x=f.lastIndexOf(" ");if(x<=0)continue;const i=Number(f.slice(x+1));if(!Number.isFinite(i)||i<=0)continue;const r=f.slice(0,x).split(";").filter(u=>u.length>0);if(r.length===0)continue;n.value+=i;let c=n,h="";for(const u of r){h+=";"+u;let d=m.get(h);d||(d=t(u),c.children.push(d),m.set(h,d)),d.value+=i,c=d}c.self+=i}return n}function A(s,e){const t=[],n=s.value>0?e/s.value:0,m=(a,f,x,i)=>{t.push({id:a.id,node:a,x:f,width:a.value*n,depth:x,parentValue:i});let r=f;for(const c of a.children)m(c,r,x+1,a.value),r+=c.value*n};return m(s,0,0,s.value),t}function F(s){const e=new Map,t=(n,m)=>{if(!m){const a=e.get(n.name)??{name:n.name,self:0,total:0};a.self+=n.self,a.total+=n.value,e.set(n.name,a)}for(const a of n.children)t(a,!1)};return t(s,!0),e}function B(s,e){return[...F(s).values()].sort((t,n)=>n.self-t.self||n.total-t.total).slice(0,e)}function D(s,e){return[...F(s).values()].sort((t,n)=>n.total-t.total||n.self-t.self).slice(0,e)}function H(s,e){const t=new Set,n=e.trim().toLowerCase();if(n==="")return t;const m=a=>{a.name.toLowerCase().includes(n)&&t.add(a.id);for(const f of a.children)m(f)};return m(s),t}const y=18,R=15;function X(s){const e=s.lastIndexOf(" ("),t=e>=0?s.slice(e+2):"";return/^(app|lib|config|db|engines)\//.test(t)}function q(s){let e=0;for(let t=0;t<s.length;t++)e=e*31+s.charCodeAt(t)|0;return Math.abs(e)}function K(s){const e=q(s);return X(s)?`hsl(${[24,34,14,44,4][e%5]} 78% ${52+e%3*6}%)`:`hsl(${[215,220,210][e%3]} 14% ${58+e%3*7}%)`}function Q(s,e){const t=Math.floor((e-8)/5.6);return t<4?"":s.length<=t?s:s.slice(0,t-1)+"…"}function Y(s){const e=$.c(30),{rect:t,total:n,x:m,y:a}=s,f=Math.max(0,m-8),x=a+14;let i;e[0]!==f||e[1]!==x?(i={left:f,top:x},e[0]=f,e[1]=x,e[2]=i):i=e[2];let r;e[3]!==t.node.name?(r=o.jsx("div",{className:"font-mono text-[11px] break-all",children:t.node.name}),e[3]=t.node.name,e[4]=r):r=e[4];let c;e[5]!==t.node.value?(c=M(t.node.value),e[5]=t.node.value,e[6]=c):c=e[6];let h;e[7]!==c?(h=o.jsxs("span",{children:[c," samples"]}),e[7]=c,e[8]=h):h=e[8];let u;e[9]!==t.node.value||e[10]!==n?(u=T(t.node.value,n),e[9]=t.node.value,e[10]=n,e[11]=u):u=e[11];let d;e[12]!==u?(d=o.jsxs("span",{children:[u," of total"]}),e[12]=u,e[13]=d):d=e[13];let p;e[14]!==t.node.value||e[15]!==t.parentValue?(p=T(t.node.value,t.parentValue),e[14]=t.node.value,e[15]=t.parentValue,e[16]=p):p=e[16];let w;e[17]!==p?(w=o.jsxs("span",{children:[p," of parent"]}),e[17]=p,e[18]=w):w=e[18];let v;e[19]!==t.node.self?(v=t.node.self>0&&o.jsxs("span",{children:[M(t.node.self)," self"]}),e[19]=t.node.self,e[20]=v):v=e[20];let b;e[21]!==w||e[22]!==v||e[23]!==h||e[24]!==d?(b=o.jsxs("div",{className:"text-muted-foreground mt-1 flex flex-wrap gap-x-3 font-mono text-[10px] tabular-nums",children:[h,d,w,v]}),e[21]=w,e[22]=v,e[23]=h,e[24]=d,e[25]=b):b=e[25];let N;return e[26]!==b||e[27]!==i||e[28]!==r?(N=o.jsxs("div",{className:"bg-popover text-popover-foreground pointer-events-none absolute z-10 max-w-[min(22rem,90vw)] rounded-md border p-2 shadow-md",style:i,children:[r,b]}),e[26]=b,e[27]=i,e[28]=r,e[29]=N):N=e[29],N}function _({collapsed:s,className:e}){const t=j.useMemo(()=>L(s),[s]),[n,m]=j.useState(""),[a,f]=j.useState("self"),[x,i]=j.useState({tree:t,zoom:[],hovered:null}),r=x.tree===t?x:{tree:t,zoom:[],hovered:null},c=r.zoom,h=j.useRef(null),[u,d]=j.useState(0);j.useEffect(()=>{const l=h.current;if(!l)return;d(l.clientWidth);const g=new ResizeObserver(([k])=>d(k.contentRect.width));return g.observe(l),()=>g.disconnect()},[]);const p=c[c.length-1]??t,w=j.useMemo(()=>A(p,u),[p,u]),v=j.useMemo(()=>H(t,n),[t,n]),b=j.useMemo(()=>a==="self"?B(p,R):D(p,R),[p,a]),N=w.reduce((l,g)=>Math.max(l,g.depth),0),O=v.size>0;return t.value===0?o.jsx("p",{className:"text-muted-foreground py-6 text-center text-sm",children:"This profile recorded no samples."}):o.jsxs("div",{className:C("space-y-3",e),children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(W,{value:n,onChange:l=>m(l.target.value),placeholder:"Search frames",className:"h-8 max-w-56 font-mono text-xs","aria-label":"Search frames"}),n!==""&&o.jsxs("span",{className:"text-muted-foreground font-mono text-[11px]",children:[v.size," match",v.size===1?"":"es"]}),o.jsx("div",{className:"ml-auto flex flex-wrap items-center gap-1 font-mono text-[11px]",children:[t,...c].map((l,g)=>o.jsxs("span",{className:"flex items-center gap-1",children:[g>0&&o.jsx("span",{className:"text-muted-foreground",children:"/"}),o.jsx("button",{type:"button",onClick:()=>i({...r,zoom:c.slice(0,g)}),disabled:g===c.length,className:C("max-w-40 truncate",g===c.length?"text-foreground font-semibold":"text-muted-foreground hover:underline"),children:l.name})]},l.id))})]}),o.jsxs("div",{ref:h,className:"bg-muted/20 relative overflow-hidden rounded-lg border",onMouseLeave:()=>i({...r,hovered:null}),children:[o.jsx("svg",{width:u,height:(N+1)*y,role:"img","aria-label":`Flamegraph of ${t.value} samples`,children:w.map(l=>{const g=Q(l.node.name,l.width);return o.jsxs("g",{onClick:()=>i({...r,zoom:[...c,...I(p,l.node)]}),onMouseMove:k=>{const S=h.current?.getBoundingClientRect();i({...r,hovered:{rect:l,x:k.clientX-(S?.left??0),y:k.clientY-(S?.top??0)}})},className:"cursor-pointer",children:[o.jsx("rect",{x:l.x,y:l.depth*y,width:Math.max(0,l.width-1),height:y-1,rx:2,fill:K(l.node.name),opacity:O?v.has(l.id)?1:.18:r.hovered?.rect.id===l.id?1:.88,stroke:v.has(l.id)?"currentColor":"none",strokeWidth:1}),g!==""&&o.jsx("text",{x:l.x+4,y:l.depth*y+y/2,dominantBaseline:"central",className:"pointer-events-none fill-black/85 font-mono text-[10px]",children:g})]},l.id)})}),r.hovered&&o.jsx(Y,{rect:r.hovered.rect,total:t.value,x:r.hovered.x,y:r.hovered.y})]}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[o.jsx("h3",{className:"label-caps",children:"Hottest frames"}),o.jsxs(V,{children:[o.jsx(z,{active:a==="self",onClick:()=>f("self"),children:"Self"}),o.jsx(z,{active:a==="total",onClick:()=>f("total"),children:"Total"})]})]}),o.jsx(E,{rows:b,rowKey:l=>l.name,empty:"No frames in this view.",columns:[{key:"name",header:"Frame",className:"max-w-0",cell:l=>o.jsx("span",{className:"block truncate font-mono text-xs",title:l.name,children:l.name})},{key:"self",header:"Self",align:"right",cell:l=>o.jsx("span",{className:a==="self"?"font-semibold":"",children:M(l.self)})},{key:"total",header:"Total",align:"right",cell:l=>o.jsx("span",{className:a==="total"?"font-semibold":"",children:M(l.total)})}]})]})}function I(s,e){if(s===e)return[];for(const t of s.children){const n=I(t,e);if(n.length>0||t===e)return[t,...n]}return[]}export{_ as F};
@@ -1 +1 @@
1
- import{B as S,c as _,u as C,C as N,j as s,r as w}from"./inertia-Degv_G9N.js";import{s as E}from"./source-link-B2183i2-.js";import{B as $}from"./badge-CApjyWcg.js";const q=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Z=S("clipboard-copy",q);const M=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],F=S("external-link",M);function A(m){const e=_.c(26),{location:t,deploy:o,className:l}=m,{auth:r,environment:n}=C().props;let x,c,a;if(e[0]!==r||e[1]!==l||e[2]!==o||e[3]!==n?.default_branch||e[4]!==n?.repository_url||e[5]!==t){c=Symbol.for("react.early_return_sentinel");e:{const g=/^(.*):(\d+)$/.exec(t);if(a=g?E({file:g[1],line:Number(g[2]),repositoryUrl:n?.repository_url,ref:o,defaultBranch:n?.default_branch,editor:r.user.editor,editorRoot:r.user.editor_root}):null,!a){let d;e[9]!==l?(d=N("truncate font-mono text-xs",l),e[9]=l,e[10]=d):d=e[10];let j;e[11]!==t||e[12]!==d?(j=s.jsx("span",{className:d,children:t}),e[11]=t,e[12]=d,e[13]=j):j=e[13],c=j;break e}x=a.startsWith("http")}e[0]=r,e[1]=l,e[2]=o,e[3]=n?.default_branch,e[4]=n?.repository_url,e[5]=t,e[6]=x,e[7]=c,e[8]=a}else x=e[6],c=e[7],a=e[8];if(c!==Symbol.for("react.early_return_sentinel"))return c;const b=x;let i;e[14]!==b?(i=b?{target:"_blank",rel:"noreferrer"}:{},e[14]=b,e[15]=i):i=e[15];let f;e[16]!==l?(f=N("inline-flex min-w-0 items-center gap-1 font-mono text-xs hover:underline",l),e[16]=l,e[17]=f):f=e[17];let h;e[18]!==t?(h=s.jsx("span",{className:"truncate",children:t}),e[18]=t,e[19]=h):h=e[19];let u;e[20]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(F,{className:"size-3 shrink-0 opacity-60"}),e[20]=u):u=e[20];let p;return e[21]!==i||e[22]!==f||e[23]!==h||e[24]!==a?(p=s.jsxs("a",{href:a,...i,className:f,children:[h,u]}),e[21]=i,e[22]=f,e[23]=h,e[24]=a,e[25]=p):p=e[25],p}const H=/-[A-Za-z0-9_-]{8,}\.(?:js|mjs|cjs|css)$/;function O(m){const e=_.c(36),{frame:t,deploy:o,open:l,onToggle:r}=m;let n;e[0]!==t.code?(n=t.code?Object.entries(t.code):[],e[0]=t.code,e[1]=n):n=e[1];const x=n;let c;e[2]!==t.file||e[3]!==t.in_app?(c=t.in_app&&!H.test(t.file),e[2]=t.file,e[3]=t.in_app,e[4]=c):c=e[4];const a=c,b=t.in_app?"bg-background":"bg-muted/40";let i;e[5]!==b?(i=N("border-b last:border-b-0",b),e[5]=b,e[6]=i):i=e[6];let f;e[7]!==o||e[8]!==t.file||e[9]!==t.line||e[10]!==a?(f=a&&s.jsx(A,{location:`${t.file}:${t.line}`,deploy:o}),e[7]=o,e[8]=t.file,e[9]=t.line,e[10]=a,e[11]=f):f=e[11];let h;e[12]!==t.file||e[13]!==t.line||e[14]!==a?(h=!a&&s.jsxs("span",{className:"text-muted-foreground truncate",children:[t.file,":",t.line]}),e[12]=t.file,e[13]=t.line,e[14]=a,e[15]=h):h=e[15];let u;e[16]!==t.function?(u=s.jsxs("span",{className:"text-muted-foreground ml-auto truncate",children:["in ",t.function]}),e[16]=t.function,e[17]=u):u=e[17];let p;e[18]!==t.in_app?(p=t.in_app&&s.jsx($,{variant:"outline",className:"shrink-0 text-[10px]",children:"app"}),e[18]=t.in_app,e[19]=p):p=e[19];let g;e[20]!==r||e[21]!==h||e[22]!==u||e[23]!==p?(g=s.jsxs("button",{type:"button",onClick:r,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[h,u,p]}),e[20]=r,e[21]=h,e[22]=u,e[23]=p,e[24]=g):g=e[24];let d;e[25]!==f||e[26]!==g?(d=s.jsxs("div",{className:"hover:bg-muted/60 flex w-full items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[f,g]}),e[25]=f,e[26]=g,e[27]=d):d=e[27];let j;e[28]!==t.line||e[29]!==x||e[30]!==l?(j=l&&x.length>0&&s.jsx("pre",{className:"bg-muted/60 overflow-x-auto px-3 py-2 font-mono text-xs leading-5",children:x.map(v=>{const[k,B]=v;return s.jsxs("div",{className:N("flex gap-3 border-l-2 border-transparent pl-2",Number(k)===t.line&&"border-destructive bg-destructive/10 font-semibold"),children:[s.jsx("span",{className:"text-muted-foreground w-10 shrink-0 text-right select-none",children:k}),s.jsx("span",{className:"whitespace-pre",children:B})]},k)})}),e[28]=t.line,e[29]=x,e[30]=l,e[31]=j):j=e[31];let y;return e[32]!==d||e[33]!==j||e[34]!==i?(y=s.jsxs("div",{className:i,children:[d,j]}),e[32]=d,e[33]=j,e[34]=i,e[35]=y):y=e[35],y}function z(m){const e=_.c(22),{frames:t,deploy:o}=m;let l,r;if(e[0]!==t){const d=t.flatMap(R);l=w.useState,r=new Set(d.length>0?d:[0]),e[0]=t,e[1]=l,e[2]=r}else l=e[1],r=e[2];const[n,x]=l(r),[c,a]=w.useState(!1);let b;e[3]!==t||e[4]!==c?(b=c?t:t.filter(L),e[3]=t,e[4]=c,e[5]=b):b=e[5];const i=b;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=function(j){x(y=>{const v=new Set(y);return v.has(j)?v.delete(j):v.add(j),v})},e[6]=f):f=e[6];const h=f;let u;if(e[7]!==o||e[8]!==t||e[9]!==n||e[10]!==i){let d;e[12]!==o||e[13]!==t||e[14]!==n?(d=j=>{const y=t.indexOf(j);return s.jsx(O,{frame:j,deploy:o,open:n.has(y),onToggle:()=>h(y)},y)},e[12]=o,e[13]=t,e[14]=n,e[15]=d):d=e[15],u=i.map(d),e[7]=o,e[8]=t,e[9]=n,e[10]=i,e[11]=u}else u=e[11];let p;e[16]!==t.length||e[17]!==i.length?(p=i.length<t.length&&s.jsxs("button",{type:"button",className:"text-muted-foreground w-full px-3 py-1.5 text-left text-xs hover:underline",onClick:()=>a(!0),children:["Show ",t.length-i.length," framework frames"]}),e[16]=t.length,e[17]=i.length,e[18]=p):p=e[18];let g;return e[19]!==u||e[20]!==p?(g=s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[u,p]}),e[19]=u,e[20]=p,e[21]=g):g=e[21],g}function L(m,e){return m.in_app||e<3}function R(m,e){return m.in_app?[e]:[]}function G(m){const e=_.c(34),{exception:t,deploy:o}=m;let l;e[0]!==t.class_name?(l=s.jsx("span",{className:"font-mono text-sm font-semibold",children:t.class_name}),e[0]=t.class_name,e[1]=l):l=e[1];const r=t.handled?"secondary":"destructive",n=t.handled?"handled":"unhandled";let x;e[2]!==r||e[3]!==n?(x=s.jsx($,{variant:r,children:n}),e[2]=r,e[3]=n,e[4]=x):x=e[4];let c;e[5]!==t.severity?(c=t.severity&&s.jsx($,{variant:"outline",children:t.severity}),e[5]=t.severity,e[6]=c):c=e[6];let a;e[7]!==t.source?(a=t.source&&s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:t.source}),e[7]=t.source,e[8]=a):a=e[8];let b;e[9]!==l||e[10]!==x||e[11]!==c||e[12]!==a?(b=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l,x,c,a]}),e[9]=l,e[10]=x,e[11]=c,e[12]=a,e[13]=b):b=e[13];let i;e[14]!==t.message?(i=s.jsx("p",{className:"mt-1 font-mono text-sm break-words",children:t.message}),e[14]=t.message,e[15]=i):i=e[15];let f;e[16]!==t.cause?(f=t.cause&&s.jsxs("p",{className:"text-muted-foreground mt-1 font-mono text-xs",children:["caused by ",t.cause.class,": ",t.cause.message]}),e[16]=t.cause,e[17]=f):f=e[17];let h;e[18]!==b||e[19]!==i||e[20]!==f?(h=s.jsxs("div",{children:[b,i,f]}),e[18]=b,e[19]=i,e[20]=f,e[21]=h):h=e[21];let u;e[22]!==o||e[23]!==t.frames?(u=s.jsx(z,{frames:t.frames,deploy:o}),e[22]=o,e[23]=t.frames,e[24]=u):u=e[24];let p;e[25]!==t.locals?(p=t.locals&&Object.keys(t.locals).length>0&&s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[s.jsx("div",{className:"label-caps border-b px-3 py-1.5",children:"Local variables at the raise site"}),s.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 px-3 py-2 font-mono text-xs",children:Object.entries(t.locals).map(T)})]}),e[25]=t.locals,e[26]=p):p=e[26];let g;e[27]!==t.context?(g=t.context&&t.context!=="{}"&&s.jsx("pre",{className:"bg-muted/60 overflow-x-auto rounded-lg p-3 font-mono text-xs",children:t.context}),e[27]=t.context,e[28]=g):g=e[28];let d;return e[29]!==h||e[30]!==u||e[31]!==p||e[32]!==g?(d=s.jsxs("div",{className:"space-y-3",children:[h,u,p,g]}),e[29]=h,e[30]=u,e[31]=p,e[32]=g,e[33]=d):d=e[33],d}function T(m){const[e,t]=m;return s.jsxs(w.Fragment,{children:[s.jsx("dt",{className:"text-muted-foreground",children:e}),s.jsx("dd",{className:"break-all",children:t})]},e)}const I={query:"bg-sky-500",transaction:"bg-sky-300",cache_event:"bg-violet-500",outgoing_request:"bg-orange-500",mail:"bg-pink-500",broadcast:"bg-teal-500",enqueued_job:"bg-amber-500",view_render:"bg-emerald-500",storage_op:"bg-indigo-500",exception:"bg-red-500",log:"bg-neutral-400"};function J(m){const e=_.c(9),{entries:t}=m;if(t.length===0)return null;let o;e[0]!==t.length?(o=s.jsxs("div",{className:"label-caps border-b px-3 py-1.5",children:["Breadcrumbs · ",t.length," events before the exception"]}),e[0]=t.length,e[1]=o):o=e[1];let l;e[2]!==t?(l=t.map(U),e[2]=t,e[3]=l):l=e[3];let r;e[4]!==l?(r=s.jsx("ol",{className:"divide-y",children:l}),e[4]=l,e[5]=r):r=e[5];let n;return e[6]!==o||e[7]!==r?(n=s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[o,r]}),e[6]=o,e[7]=r,e[8]=n):n=e[8],n}function U(m){return s.jsxs("li",{className:"grid grid-cols-[3.5rem_5rem_1fr_4rem] items-center gap-2 px-3 py-1 font-mono text-xs",children:[s.jsxs("span",{className:"text-muted-foreground tabular-nums",children:["+",m.offset.toFixed(1),"ms"]}),s.jsxs("span",{className:"text-muted-foreground flex items-center gap-1.5 truncate",children:[s.jsx("span",{className:N("inline-block size-1.5 shrink-0 rounded-full",I[m.type]??"bg-neutral-500")}),m.type.replace("_"," ")]}),s.jsx("span",{className:"truncate",children:m.label}),s.jsx("span",{className:"text-muted-foreground text-right tabular-nums",children:m.duration!=null?`${m.duration.toFixed(1)}ms`:""})]},`${m.type}-${m.id}`)}const D={console:"bg-red-500",click:"bg-violet-500",navigate:"bg-sky-500"};function K(m){const e=_.c(12),{crumbs:t}=m;if(t.length===0)return null;const o=t[0].at;let l;e[0]!==t.length?(l=s.jsxs("div",{className:"label-caps border-b px-3 py-1.5",children:["Breadcrumbs · ",t.length," events before the error"]}),e[0]=t.length,e[1]=l):l=e[1];let r;if(e[2]!==t||e[3]!==o){let c;e[5]!==o?(c=(a,b)=>s.jsxs("li",{className:"grid grid-cols-[3.5rem_5rem_1fr] items-center gap-2 px-3 py-1 font-mono text-xs",children:[s.jsxs("span",{className:"text-muted-foreground tabular-nums",children:["+",((a.at-o)/1e3).toFixed(1),"s"]}),s.jsxs("span",{className:"text-muted-foreground flex items-center gap-1.5 truncate",children:[s.jsx("span",{className:N("inline-block size-1.5 shrink-0 rounded-full",D[a.kind]??"bg-neutral-500")}),a.kind]}),s.jsx("span",{className:"truncate",children:a.text})]},`${a.at}-${a.kind}-${b}`),e[5]=o,e[6]=c):c=e[6],r=t.map(c),e[2]=t,e[3]=o,e[4]=r}else r=e[4];let n;e[7]!==r?(n=s.jsx("ol",{className:"divide-y",children:r}),e[7]=r,e[8]=n):n=e[8];let x;return e[9]!==l||e[10]!==n?(x=s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[l,n]}),e[9]=l,e[10]=n,e[11]=x):x=e[11],x}export{J as B,Z as C,G as E,A as S,K as a};
1
+ import{B as S,c as _,u as C,C as N,j as s,r as w}from"./inertia-DLew8ZNx.js";import{s as E}from"./source-link-B2183i2-.js";import{B as $}from"./badge-CAxXV8za.js";const q=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],Z=S("clipboard-copy",q);const M=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],F=S("external-link",M);function A(m){const e=_.c(26),{location:t,deploy:o,className:l}=m,{auth:r,environment:n}=C().props;let x,c,a;if(e[0]!==r||e[1]!==l||e[2]!==o||e[3]!==n?.default_branch||e[4]!==n?.repository_url||e[5]!==t){c=Symbol.for("react.early_return_sentinel");e:{const g=/^(.*):(\d+)$/.exec(t);if(a=g?E({file:g[1],line:Number(g[2]),repositoryUrl:n?.repository_url,ref:o,defaultBranch:n?.default_branch,editor:r.user.editor,editorRoot:r.user.editor_root}):null,!a){let d;e[9]!==l?(d=N("truncate font-mono text-xs",l),e[9]=l,e[10]=d):d=e[10];let j;e[11]!==t||e[12]!==d?(j=s.jsx("span",{className:d,children:t}),e[11]=t,e[12]=d,e[13]=j):j=e[13],c=j;break e}x=a.startsWith("http")}e[0]=r,e[1]=l,e[2]=o,e[3]=n?.default_branch,e[4]=n?.repository_url,e[5]=t,e[6]=x,e[7]=c,e[8]=a}else x=e[6],c=e[7],a=e[8];if(c!==Symbol.for("react.early_return_sentinel"))return c;const b=x;let i;e[14]!==b?(i=b?{target:"_blank",rel:"noreferrer"}:{},e[14]=b,e[15]=i):i=e[15];let f;e[16]!==l?(f=N("inline-flex min-w-0 items-center gap-1 font-mono text-xs hover:underline",l),e[16]=l,e[17]=f):f=e[17];let h;e[18]!==t?(h=s.jsx("span",{className:"truncate",children:t}),e[18]=t,e[19]=h):h=e[19];let u;e[20]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(F,{className:"size-3 shrink-0 opacity-60"}),e[20]=u):u=e[20];let p;return e[21]!==i||e[22]!==f||e[23]!==h||e[24]!==a?(p=s.jsxs("a",{href:a,...i,className:f,children:[h,u]}),e[21]=i,e[22]=f,e[23]=h,e[24]=a,e[25]=p):p=e[25],p}const H=/-[A-Za-z0-9_-]{8,}\.(?:js|mjs|cjs|css)$/;function O(m){const e=_.c(36),{frame:t,deploy:o,open:l,onToggle:r}=m;let n;e[0]!==t.code?(n=t.code?Object.entries(t.code):[],e[0]=t.code,e[1]=n):n=e[1];const x=n;let c;e[2]!==t.file||e[3]!==t.in_app?(c=t.in_app&&!H.test(t.file),e[2]=t.file,e[3]=t.in_app,e[4]=c):c=e[4];const a=c,b=t.in_app?"bg-background":"bg-muted/40";let i;e[5]!==b?(i=N("border-b last:border-b-0",b),e[5]=b,e[6]=i):i=e[6];let f;e[7]!==o||e[8]!==t.file||e[9]!==t.line||e[10]!==a?(f=a&&s.jsx(A,{location:`${t.file}:${t.line}`,deploy:o}),e[7]=o,e[8]=t.file,e[9]=t.line,e[10]=a,e[11]=f):f=e[11];let h;e[12]!==t.file||e[13]!==t.line||e[14]!==a?(h=!a&&s.jsxs("span",{className:"text-muted-foreground truncate",children:[t.file,":",t.line]}),e[12]=t.file,e[13]=t.line,e[14]=a,e[15]=h):h=e[15];let u;e[16]!==t.function?(u=s.jsxs("span",{className:"text-muted-foreground ml-auto truncate",children:["in ",t.function]}),e[16]=t.function,e[17]=u):u=e[17];let p;e[18]!==t.in_app?(p=t.in_app&&s.jsx($,{variant:"outline",className:"shrink-0 text-[10px]",children:"app"}),e[18]=t.in_app,e[19]=p):p=e[19];let g;e[20]!==r||e[21]!==h||e[22]!==u||e[23]!==p?(g=s.jsxs("button",{type:"button",onClick:r,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[h,u,p]}),e[20]=r,e[21]=h,e[22]=u,e[23]=p,e[24]=g):g=e[24];let d;e[25]!==f||e[26]!==g?(d=s.jsxs("div",{className:"hover:bg-muted/60 flex w-full items-center gap-2 px-3 py-1.5 font-mono text-xs",children:[f,g]}),e[25]=f,e[26]=g,e[27]=d):d=e[27];let j;e[28]!==t.line||e[29]!==x||e[30]!==l?(j=l&&x.length>0&&s.jsx("pre",{className:"bg-muted/60 overflow-x-auto px-3 py-2 font-mono text-xs leading-5",children:x.map(v=>{const[k,B]=v;return s.jsxs("div",{className:N("flex gap-3 border-l-2 border-transparent pl-2",Number(k)===t.line&&"border-destructive bg-destructive/10 font-semibold"),children:[s.jsx("span",{className:"text-muted-foreground w-10 shrink-0 text-right select-none",children:k}),s.jsx("span",{className:"whitespace-pre",children:B})]},k)})}),e[28]=t.line,e[29]=x,e[30]=l,e[31]=j):j=e[31];let y;return e[32]!==d||e[33]!==j||e[34]!==i?(y=s.jsxs("div",{className:i,children:[d,j]}),e[32]=d,e[33]=j,e[34]=i,e[35]=y):y=e[35],y}function z(m){const e=_.c(22),{frames:t,deploy:o}=m;let l,r;if(e[0]!==t){const d=t.flatMap(R);l=w.useState,r=new Set(d.length>0?d:[0]),e[0]=t,e[1]=l,e[2]=r}else l=e[1],r=e[2];const[n,x]=l(r),[c,a]=w.useState(!1);let b;e[3]!==t||e[4]!==c?(b=c?t:t.filter(L),e[3]=t,e[4]=c,e[5]=b):b=e[5];const i=b;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=function(j){x(y=>{const v=new Set(y);return v.has(j)?v.delete(j):v.add(j),v})},e[6]=f):f=e[6];const h=f;let u;if(e[7]!==o||e[8]!==t||e[9]!==n||e[10]!==i){let d;e[12]!==o||e[13]!==t||e[14]!==n?(d=j=>{const y=t.indexOf(j);return s.jsx(O,{frame:j,deploy:o,open:n.has(y),onToggle:()=>h(y)},y)},e[12]=o,e[13]=t,e[14]=n,e[15]=d):d=e[15],u=i.map(d),e[7]=o,e[8]=t,e[9]=n,e[10]=i,e[11]=u}else u=e[11];let p;e[16]!==t.length||e[17]!==i.length?(p=i.length<t.length&&s.jsxs("button",{type:"button",className:"text-muted-foreground w-full px-3 py-1.5 text-left text-xs hover:underline",onClick:()=>a(!0),children:["Show ",t.length-i.length," framework frames"]}),e[16]=t.length,e[17]=i.length,e[18]=p):p=e[18];let g;return e[19]!==u||e[20]!==p?(g=s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[u,p]}),e[19]=u,e[20]=p,e[21]=g):g=e[21],g}function L(m,e){return m.in_app||e<3}function R(m,e){return m.in_app?[e]:[]}function G(m){const e=_.c(34),{exception:t,deploy:o}=m;let l;e[0]!==t.class_name?(l=s.jsx("span",{className:"font-mono text-sm font-semibold",children:t.class_name}),e[0]=t.class_name,e[1]=l):l=e[1];const r=t.handled?"secondary":"destructive",n=t.handled?"handled":"unhandled";let x;e[2]!==r||e[3]!==n?(x=s.jsx($,{variant:r,children:n}),e[2]=r,e[3]=n,e[4]=x):x=e[4];let c;e[5]!==t.severity?(c=t.severity&&s.jsx($,{variant:"outline",children:t.severity}),e[5]=t.severity,e[6]=c):c=e[6];let a;e[7]!==t.source?(a=t.source&&s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:t.source}),e[7]=t.source,e[8]=a):a=e[8];let b;e[9]!==l||e[10]!==x||e[11]!==c||e[12]!==a?(b=s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l,x,c,a]}),e[9]=l,e[10]=x,e[11]=c,e[12]=a,e[13]=b):b=e[13];let i;e[14]!==t.message?(i=s.jsx("p",{className:"mt-1 font-mono text-sm break-words",children:t.message}),e[14]=t.message,e[15]=i):i=e[15];let f;e[16]!==t.cause?(f=t.cause&&s.jsxs("p",{className:"text-muted-foreground mt-1 font-mono text-xs",children:["caused by ",t.cause.class,": ",t.cause.message]}),e[16]=t.cause,e[17]=f):f=e[17];let h;e[18]!==b||e[19]!==i||e[20]!==f?(h=s.jsxs("div",{children:[b,i,f]}),e[18]=b,e[19]=i,e[20]=f,e[21]=h):h=e[21];let u;e[22]!==o||e[23]!==t.frames?(u=s.jsx(z,{frames:t.frames,deploy:o}),e[22]=o,e[23]=t.frames,e[24]=u):u=e[24];let p;e[25]!==t.locals?(p=t.locals&&Object.keys(t.locals).length>0&&s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[s.jsx("div",{className:"label-caps border-b px-3 py-1.5",children:"Local variables at the raise site"}),s.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1 px-3 py-2 font-mono text-xs",children:Object.entries(t.locals).map(T)})]}),e[25]=t.locals,e[26]=p):p=e[26];let g;e[27]!==t.context?(g=t.context&&t.context!=="{}"&&s.jsx("pre",{className:"bg-muted/60 overflow-x-auto rounded-lg p-3 font-mono text-xs",children:t.context}),e[27]=t.context,e[28]=g):g=e[28];let d;return e[29]!==h||e[30]!==u||e[31]!==p||e[32]!==g?(d=s.jsxs("div",{className:"space-y-3",children:[h,u,p,g]}),e[29]=h,e[30]=u,e[31]=p,e[32]=g,e[33]=d):d=e[33],d}function T(m){const[e,t]=m;return s.jsxs(w.Fragment,{children:[s.jsx("dt",{className:"text-muted-foreground",children:e}),s.jsx("dd",{className:"break-all",children:t})]},e)}const I={query:"bg-sky-500",transaction:"bg-sky-300",cache_event:"bg-violet-500",outgoing_request:"bg-orange-500",mail:"bg-pink-500",broadcast:"bg-teal-500",enqueued_job:"bg-amber-500",view_render:"bg-emerald-500",storage_op:"bg-indigo-500",exception:"bg-red-500",log:"bg-neutral-400"};function J(m){const e=_.c(9),{entries:t}=m;if(t.length===0)return null;let o;e[0]!==t.length?(o=s.jsxs("div",{className:"label-caps border-b px-3 py-1.5",children:["Breadcrumbs · ",t.length," events before the exception"]}),e[0]=t.length,e[1]=o):o=e[1];let l;e[2]!==t?(l=t.map(U),e[2]=t,e[3]=l):l=e[3];let r;e[4]!==l?(r=s.jsx("ol",{className:"divide-y",children:l}),e[4]=l,e[5]=r):r=e[5];let n;return e[6]!==o||e[7]!==r?(n=s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[o,r]}),e[6]=o,e[7]=r,e[8]=n):n=e[8],n}function U(m){return s.jsxs("li",{className:"grid grid-cols-[3.5rem_5rem_1fr_4rem] items-center gap-2 px-3 py-1 font-mono text-xs",children:[s.jsxs("span",{className:"text-muted-foreground tabular-nums",children:["+",m.offset.toFixed(1),"ms"]}),s.jsxs("span",{className:"text-muted-foreground flex items-center gap-1.5 truncate",children:[s.jsx("span",{className:N("inline-block size-1.5 shrink-0 rounded-full",I[m.type]??"bg-neutral-500")}),m.type.replace("_"," ")]}),s.jsx("span",{className:"truncate",children:m.label}),s.jsx("span",{className:"text-muted-foreground text-right tabular-nums",children:m.duration!=null?`${m.duration.toFixed(1)}ms`:""})]},`${m.type}-${m.id}`)}const D={console:"bg-red-500",click:"bg-violet-500",navigate:"bg-sky-500"};function K(m){const e=_.c(12),{crumbs:t}=m;if(t.length===0)return null;const o=t[0].at;let l;e[0]!==t.length?(l=s.jsxs("div",{className:"label-caps border-b px-3 py-1.5",children:["Breadcrumbs · ",t.length," events before the error"]}),e[0]=t.length,e[1]=l):l=e[1];let r;if(e[2]!==t||e[3]!==o){let c;e[5]!==o?(c=(a,b)=>s.jsxs("li",{className:"grid grid-cols-[3.5rem_5rem_1fr] items-center gap-2 px-3 py-1 font-mono text-xs",children:[s.jsxs("span",{className:"text-muted-foreground tabular-nums",children:["+",((a.at-o)/1e3).toFixed(1),"s"]}),s.jsxs("span",{className:"text-muted-foreground flex items-center gap-1.5 truncate",children:[s.jsx("span",{className:N("inline-block size-1.5 shrink-0 rounded-full",D[a.kind]??"bg-neutral-500")}),a.kind]}),s.jsx("span",{className:"truncate",children:a.text})]},`${a.at}-${a.kind}-${b}`),e[5]=o,e[6]=c):c=e[6],r=t.map(c),e[2]=t,e[3]=o,e[4]=r}else r=e[4];let n;e[7]!==r?(n=s.jsx("ol",{className:"divide-y",children:r}),e[7]=r,e[8]=n):n=e[8];let x;return e[9]!==l||e[10]!==n?(x=s.jsxs("div",{className:"overflow-hidden rounded-lg border",children:[l,n]}),e[9]=l,e[10]=n,e[11]=x):x=e[11],x}export{J as B,Z as C,G as E,A as S,K as a};
@@ -1 +1 @@
1
- import{c as h,j as t}from"./inertia-Degv_G9N.js";import{B as p}from"./app-wordmark-1SRllgHv.js";import{S as x}from"./separator-CrM10Oot.js";function j(m){const e=h.c(6);let n,s,i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),s=t.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.99.66-2.25 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.85A11 11 0 0 0 12 23Z",fill:"#34A853"}),i=t.jsx("path",{d:"M5.84 14.09A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.43.34-2.09V7.06H2.18A11 11 0 0 0 1 12c0 1.77.42 3.45 1.18 4.94l3.66-2.85Z",fill:"#FBBC05"}),a=t.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1a11 11 0 0 0-9.82 6.06l3.66 2.85C6.71 7.31 9.14 5.38 12 5.38Z",fill:"#EA4335"}),e[0]=n,e[1]=s,e[2]=i,e[3]=a):(n=e[0],s=e[1],i=e[2],a=e[3]);let l;return e[4]!==m?(l=t.jsxs("svg",{viewBox:"0 0 24 24",...m,children:[n,s,i,a]}),e[4]=m,e[5]=l):l=e[5],l}function v(){return typeof document>"u"?"":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??""}function _(m){const e=h.c(14),{label:n,reauthenticateFor:s,separated:i}=m,a=i===void 0?!0:i;let l;e[0]!==a?(l=a&&t.jsxs("div",{className:"relative text-center text-sm",children:[t.jsx(x,{className:"absolute top-1/2"}),t.jsx("span",{className:"bg-background text-muted-foreground relative px-2",children:"Or"})]}),e[0]=a,e[1]=l):l=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("input",{type:"hidden",name:"authenticity_token",value:v()}),e[2]=u):u=e[2];let o;e[3]!==s?(o=s&&t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"hidden",name:"reauthenticate",value:s}),t.jsx("input",{type:"hidden",name:"prompt",value:"select_account"})]}),e[3]=s,e[4]=o):o=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(j,{className:"size-4"}),e[5]=d):d=e[5];let c;e[6]!==n?(c=t.jsxs(p,{type:"submit",variant:"outline",className:"w-full",children:[d,n]}),e[6]=n,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==c?(r=t.jsxs("form",{method:"post",action:"/auth/google_oauth2",children:[u,o,c]}),e[8]=o,e[9]=c,e[10]=r):r=e[10];let f;return e[11]!==l||e[12]!==r?(f=t.jsxs("div",{className:"grid gap-6",children:[l,r]}),e[11]=l,e[12]=r,e[13]=f):f=e[13],f}export{_ as G};
1
+ import{c as h,j as t}from"./inertia-DLew8ZNx.js";import{B as p}from"./app-wordmark-o9CODKP0.js";import{S as x}from"./separator-BXzEdZ_8.js";function j(m){const e=h.c(6);let n,s,i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1Z",fill:"#4285F4"}),s=t.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.99.66-2.25 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.85A11 11 0 0 0 12 23Z",fill:"#34A853"}),i=t.jsx("path",{d:"M5.84 14.09A6.6 6.6 0 0 1 5.5 12c0-.73.13-1.43.34-2.09V7.06H2.18A11 11 0 0 0 1 12c0 1.77.42 3.45 1.18 4.94l3.66-2.85Z",fill:"#FBBC05"}),a=t.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1a11 11 0 0 0-9.82 6.06l3.66 2.85C6.71 7.31 9.14 5.38 12 5.38Z",fill:"#EA4335"}),e[0]=n,e[1]=s,e[2]=i,e[3]=a):(n=e[0],s=e[1],i=e[2],a=e[3]);let l;return e[4]!==m?(l=t.jsxs("svg",{viewBox:"0 0 24 24",...m,children:[n,s,i,a]}),e[4]=m,e[5]=l):l=e[5],l}function v(){return typeof document>"u"?"":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??""}function _(m){const e=h.c(14),{label:n,reauthenticateFor:s,separated:i}=m,a=i===void 0?!0:i;let l;e[0]!==a?(l=a&&t.jsxs("div",{className:"relative text-center text-sm",children:[t.jsx(x,{className:"absolute top-1/2"}),t.jsx("span",{className:"bg-background text-muted-foreground relative px-2",children:"Or"})]}),e[0]=a,e[1]=l):l=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("input",{type:"hidden",name:"authenticity_token",value:v()}),e[2]=u):u=e[2];let o;e[3]!==s?(o=s&&t.jsxs(t.Fragment,{children:[t.jsx("input",{type:"hidden",name:"reauthenticate",value:s}),t.jsx("input",{type:"hidden",name:"prompt",value:"select_account"})]}),e[3]=s,e[4]=o):o=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(j,{className:"size-4"}),e[5]=d):d=e[5];let c;e[6]!==n?(c=t.jsxs(p,{type:"submit",variant:"outline",className:"w-full",children:[d,n]}),e[6]=n,e[7]=c):c=e[7];let r;e[8]!==o||e[9]!==c?(r=t.jsxs("form",{method:"post",action:"/auth/google_oauth2",children:[u,o,c]}),e[8]=o,e[9]=c,e[10]=r):r=e[10];let f;return e[11]!==l||e[12]!==r?(f=t.jsxs("div",{className:"grid gap-6",children:[l,r]}),e[11]=l,e[12]=r,e[13]=f):f=e[13],f}export{_ as G};
@@ -1 +1 @@
1
- import{c as D,x as L,j as t,H as O,L as S,g as q,e as k,m as B,o as R,i as z,h as H}from"./inertia-Degv_G9N.js";import{D as M}from"./data-table-IvA7xvrK.js";import{E as T}from"./empty-state-BFTnQ2oT.js";import{L as $}from"./live-dot-DaXEbkXo.js";import{S as I}from"./sparkline-cell-Ckg29yVq.js";import{S as b,a as F}from"./stat-TxvoBiC8.js";import{B as C}from"./badge-CApjyWcg.js";import{B as E}from"./app-wordmark-1SRllgHv.js";import{C as y,a as N,b as A,c as K}from"./card-BaJ8kNkp.js";import{O as U,A as W,P as G}from"./app-layout-B5Fcdwfz.js";import{c as w,a as P}from"./format-B9SDkrWj.js";import"./chart-hover-XYPNE2CX.js";import"./index-B0VXzXYG.js";import"./index-CX8Br7m9.js";import"./series-chart-D33UhdG2.js";import"./chart-Xnrz1Nqw.js";import"./use-live-GKze1mNC.js";import"./arrow-up-DwKQcab4.js";import"./checkbox-Bf41R8W6.js";import"./label-B_vK19tR.js";function Ne(s){const e=D.c(32);let d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[{title:"Dashboard",href:L()}],u=t.jsx(O,{title:"Dashboard"}),e[0]=d,e[1]=u):(d=e[0],u=e[1]);let i;e[2]!==s.overview_apps.length?(i=t.jsx(b,{label:"Applications",value:s.overview_apps.length}),e[2]=s.overview_apps.length,e[3]=i):i=e[3];const g=s.recent_issues.length?"destructive":"success";let a;e[4]!==s.recent_issues.length||e[5]!==g?(a=t.jsx(b,{label:"Open issues",value:s.recent_issues.length,tone:g}),e[4]=s.recent_issues.length,e[5]=g,e[6]=a):a=e[6];let r;e[7]!==s.usage.events_this_month?(r=w(s.usage.events_this_month),e[7]=s.usage.events_this_month,e[8]=r):r=e[8];let h;e[9]!==s.usage.quota?(h=w(s.usage.quota),e[9]=s.usage.quota,e[10]=h):h=e[10];const v=`of ${h} on ${s.usage.plan}`;let n;e[11]!==r||e[12]!==v?(n=t.jsx(b,{label:"Events this month",value:r,hint:v}),e[11]=r,e[12]=v,e[13]=n):n=e[13];let l;e[14]!==i||e[15]!==a||e[16]!==n?(l=t.jsxs(F,{children:[i,a,n]}),e[14]=i,e[15]=a,e[16]=n,e[17]=l):l=e[17];let o;e[18]!==s.overview_apps?(o=s.overview_apps.map(te),e[18]=s.overview_apps,e[19]=o):o=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(y,{className:"border-dashed",children:t.jsx(N,{className:"flex h-full items-center justify-center pt-6",children:t.jsx(E,{variant:"outline",onClick:se,children:"Add application"})})}),e[20]=x):x=e[20];let c;e[21]!==o?(c=t.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:[o,x]}),e[21]=o,e[22]=c):c=e[22];let f;e[23]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(A,{children:t.jsx(K,{children:"Recent open issues"})}),e[23]=f):f=e[23];let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(T,{icon:U,title:"No open issues",description:"Issues are opened when a request, job, or exception starts repeating."}),e[24]=p):p=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=[{key:"k",header:"Issue",cell:Y},{key:"t",header:"Title",cell:X},{key:"w",hideOnMobile:!0,header:"Where",cell:V},{key:"n",hideOnMobile:!0,header:"Events",align:"right",cell:Q},{key:"l",header:"Last",align:"right",cell:J}],e[25]=_):_=e[25];let m;e[26]!==s.recent_issues?(m=t.jsxs(y,{children:[f,t.jsx(N,{children:t.jsx(M,{rows:s.recent_issues,rowKey:ee,empty:p,onRowClick:Z,columns:_})})]}),e[26]=s.recent_issues,e[27]=m):m=e[27];let j;return e[28]!==c||e[29]!==m||e[30]!==l?(j=t.jsxs(W,{breadcrumbs:d,children:[u,t.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-3 md:gap-5 md:px-6 md:pt-2 md:pb-6",children:[l,c,m]})]}),e[28]=c,e[29]=m,e[30]=l,e[31]=j):j=e[31],j}function J(s){return P(s.last_seen_at)}function Q(s){return w(s.occurrences)}function V(s){return t.jsxs("span",{className:"text-xs",children:[s.application," · ",s.environment]})}function X(s){return t.jsx("span",{className:"line-clamp-1 text-xs",children:s.title})}function Y(s){return t.jsx("span",{className:"font-mono text-xs font-semibold",children:s.key})}function Z(s){return k.visit(z(s.id))}function ee(s){return s.id}function se(){return k.visit(H())}function te(s){return t.jsxs(y,{children:[t.jsxs(A,{className:"flex-row items-center justify-between",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"bg-muted flex size-8 shrink-0 items-center justify-center rounded-md font-mono text-xs font-semibold",children:s.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(S,{className:"block truncate text-sm font-semibold hover:underline",href:q(s.id),children:s.name}),t.jsx("div",{className:"label-caps",children:s.issue_prefix})]})]}),t.jsxs(E,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>k.visit(B(s.id)),children:[t.jsx(G,{className:"size-3"}),"Environment"]})]}),t.jsx(N,{className:"space-y-2",children:s.environments.map(e=>t.jsxs(S,{href:R(s.id,e.id),className:"hover:bg-muted flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:[t.jsxs("span",{className:"flex flex-1 items-center gap-2",children:[t.jsx($,{lastSeenAt:e.paused?null:e.last_seen_at,thresholdMs:6e5}),e.name]}),t.jsx(I,{data:e.request_sparkline}),t.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[e.error_rate>0&&t.jsxs(C,{variant:"destructive",children:[(e.error_rate*100).toFixed(1),"% err"]}),e.open_issues>0&&t.jsx(C,{variant:"destructive",children:e.open_issues}),e.last_seen_at?P(e.last_seen_at):"no data"]})]},e.id))})]},s.id)}export{Ne as default};
1
+ import{c as D,x as L,j as t,H as O,L as S,g as q,e as k,m as B,o as R,i as z,h as H}from"./inertia-DLew8ZNx.js";import{D as M}from"./data-table-BIlt7Rtm.js";import{E as T}from"./empty-state-C38il627.js";import{L as $}from"./live-dot-D1n_BreY.js";import{S as I}from"./sparkline-cell-BON3qQUB.js";import{S as b,a as F}from"./stat-DFEyFxkO.js";import{B as C}from"./badge-CAxXV8za.js";import{B as E}from"./app-wordmark-o9CODKP0.js";import{C as y,a as N,b as A,c as K}from"./card-cAtqCxWl.js";import{O as U,A as W,P as G}from"./app-layout-DDyQa72H.js";import{c as w,a as P}from"./format-B9SDkrWj.js";import"./chart-hover-B1M9jc0y.js";import"./index-so4lRrRq.js";import"./index-umIAl-pL.js";import"./series-chart-Xf49v9cv.js";import"./chart-BBeBkkNa.js";import"./use-live-D7xKz2ma.js";import"./arrow-up-C6PxDiY3.js";import"./checkbox-CmhMHWZO.js";import"./label-GWl7I6sf.js";function Ne(s){const e=D.c(32);let d,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[{title:"Dashboard",href:L()}],u=t.jsx(O,{title:"Dashboard"}),e[0]=d,e[1]=u):(d=e[0],u=e[1]);let i;e[2]!==s.overview_apps.length?(i=t.jsx(b,{label:"Applications",value:s.overview_apps.length}),e[2]=s.overview_apps.length,e[3]=i):i=e[3];const g=s.recent_issues.length?"destructive":"success";let a;e[4]!==s.recent_issues.length||e[5]!==g?(a=t.jsx(b,{label:"Open issues",value:s.recent_issues.length,tone:g}),e[4]=s.recent_issues.length,e[5]=g,e[6]=a):a=e[6];let r;e[7]!==s.usage.events_this_month?(r=w(s.usage.events_this_month),e[7]=s.usage.events_this_month,e[8]=r):r=e[8];let h;e[9]!==s.usage.quota?(h=w(s.usage.quota),e[9]=s.usage.quota,e[10]=h):h=e[10];const v=`of ${h} on ${s.usage.plan}`;let n;e[11]!==r||e[12]!==v?(n=t.jsx(b,{label:"Events this month",value:r,hint:v}),e[11]=r,e[12]=v,e[13]=n):n=e[13];let l;e[14]!==i||e[15]!==a||e[16]!==n?(l=t.jsxs(F,{children:[i,a,n]}),e[14]=i,e[15]=a,e[16]=n,e[17]=l):l=e[17];let o;e[18]!==s.overview_apps?(o=s.overview_apps.map(te),e[18]=s.overview_apps,e[19]=o):o=e[19];let x;e[20]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(y,{className:"border-dashed",children:t.jsx(N,{className:"flex h-full items-center justify-center pt-6",children:t.jsx(E,{variant:"outline",onClick:se,children:"Add application"})})}),e[20]=x):x=e[20];let c;e[21]!==o?(c=t.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:[o,x]}),e[21]=o,e[22]=c):c=e[22];let f;e[23]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(A,{children:t.jsx(K,{children:"Recent open issues"})}),e[23]=f):f=e[23];let p;e[24]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(T,{icon:U,title:"No open issues",description:"Issues are opened when a request, job, or exception starts repeating."}),e[24]=p):p=e[24];let _;e[25]===Symbol.for("react.memo_cache_sentinel")?(_=[{key:"k",header:"Issue",cell:Y},{key:"t",header:"Title",cell:X},{key:"w",hideOnMobile:!0,header:"Where",cell:V},{key:"n",hideOnMobile:!0,header:"Events",align:"right",cell:Q},{key:"l",header:"Last",align:"right",cell:J}],e[25]=_):_=e[25];let m;e[26]!==s.recent_issues?(m=t.jsxs(y,{children:[f,t.jsx(N,{children:t.jsx(M,{rows:s.recent_issues,rowKey:ee,empty:p,onRowClick:Z,columns:_})})]}),e[26]=s.recent_issues,e[27]=m):m=e[27];let j;return e[28]!==c||e[29]!==m||e[30]!==l?(j=t.jsxs(W,{breadcrumbs:d,children:[u,t.jsxs("div",{className:"flex flex-1 flex-col gap-4 p-3 md:gap-5 md:px-6 md:pt-2 md:pb-6",children:[l,c,m]})]}),e[28]=c,e[29]=m,e[30]=l,e[31]=j):j=e[31],j}function J(s){return P(s.last_seen_at)}function Q(s){return w(s.occurrences)}function V(s){return t.jsxs("span",{className:"text-xs",children:[s.application," · ",s.environment]})}function X(s){return t.jsx("span",{className:"line-clamp-1 text-xs",children:s.title})}function Y(s){return t.jsx("span",{className:"font-mono text-xs font-semibold",children:s.key})}function Z(s){return k.visit(z(s.id))}function ee(s){return s.id}function se(){return k.visit(H())}function te(s){return t.jsxs(y,{children:[t.jsxs(A,{className:"flex-row items-center justify-between",children:[t.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[t.jsx("span",{className:"bg-muted flex size-8 shrink-0 items-center justify-center rounded-md font-mono text-xs font-semibold",children:s.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"min-w-0",children:[t.jsx(S,{className:"block truncate text-sm font-semibold hover:underline",href:q(s.id),children:s.name}),t.jsx("div",{className:"label-caps",children:s.issue_prefix})]})]}),t.jsxs(E,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>k.visit(B(s.id)),children:[t.jsx(G,{className:"size-3"}),"Environment"]})]}),t.jsx(N,{className:"space-y-2",children:s.environments.map(e=>t.jsxs(S,{href:R(s.id,e.id),className:"hover:bg-muted flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:[t.jsxs("span",{className:"flex flex-1 items-center gap-2",children:[t.jsx($,{lastSeenAt:e.paused?null:e.last_seen_at,thresholdMs:6e5}),e.name]}),t.jsx(I,{data:e.request_sparkline}),t.jsxs("span",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[e.error_rate>0&&t.jsxs(C,{variant:"destructive",children:[(e.error_rate*100).toFixed(1),"% err"]}),e.open_issues>0&&t.jsx(C,{variant:"destructive",children:e.open_issues}),e.last_seen_at?P(e.last_seen_at):"no data"]})]},e.id))})]},s.id)}export{Ne as default};
@@ -1 +1 @@
1
- import{u as F,r as D,j as s,L as w,J as O,e as S,t as T,ae as Q,c as L}from"./inertia-Degv_G9N.js";import{S as _}from"./code-a-9sh36A.js";import{C as R}from"./cursor-load-more-0cHzbTPT.js";import{D as q}from"./data-table-IvA7xvrK.js";import{E as z}from"./empty-state-BFTnQ2oT.js";import{F as B}from"./filter-bar-Btm__gQi.js";import{u as K,E as $,P as A}from"./env-layout-erSDpIXg.js";import{u as H,P as I}from"./percentile-picker-BujVEhP6.js";import{S as k}from"./sort-header-CKj_7G3U.js";import{S as J}from"./sparkline-cell-Ckg29yVq.js";import{a as U,S as C}from"./stat-TxvoBiC8.js";import{B as W}from"./app-wordmark-1SRllgHv.js";import{C as G,b as V,c as X,a as Y}from"./card-BaJ8kNkp.js";import{u as Z,C as ee}from"./use-clipboard-BLjjYH8V.js";import{c as E,m as f}from"./format-B9SDkrWj.js";import{C as se,a as oe,D as re}from"./app-layout-B5Fcdwfz.js";import{C as te}from"./index-CX8Br7m9.js";import"./chart-hover-XYPNE2CX.js";import"./badge-CApjyWcg.js";import"./use-live-GKze1mNC.js";import"./live-dot-DaXEbkXo.js";import"./index-B0VXzXYG.js";import"./segmented-CVKq2Xpa.js";import"./label-B_vK19tR.js";import"./arrow-up-DwKQcab4.js";import"./series-chart-D33UhdG2.js";import"./chart-Xnrz1Nqw.js";import"./checkbox-Bf41R8W6.js";const ae=1500;function ie(r){const o=L.c(20),{suggestion:a}=r,[,d]=Z(),[u,v]=D.useState(!1);let m;o[0]!==d||o[1]!==a.code?(m=()=>{d(a.code).then(g=>{g&&(v(!0),window.setTimeout(()=>v(!1),ae))})},o[0]=d,o[1]=a.code,o[2]=m):m=o[2];const y=m;let n;o[3]!==a.code?(n=s.jsx("pre",{className:"overflow-x-auto font-mono text-xs whitespace-pre-wrap",children:a.code}),o[3]=a.code,o[4]=n):n=o[4];let l;o[5]!==y?(l=g=>{g.stopPropagation(),y()},o[5]=y,o[6]=l):l=o[6];let c;o[7]!==u?(c=u?s.jsx(te,{className:"size-3 text-emerald-500"}):s.jsx(ee,{className:"size-3 opacity-60"}),o[7]=u,o[8]=c):c=o[8];let h;o[9]!==l||o[10]!==c?(h=s.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 shrink-0 gap-1 px-1.5 text-xs",onClick:l,children:[c,"Copy"]}),o[9]=l,o[10]=c,o[11]=h):h=o[11];let p;o[12]!==n||o[13]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n,h]}),o[12]=n,o[13]=h,o[14]=p):p=o[14];let t;o[15]!==a.explanation?(t=s.jsx("p",{className:"text-muted-foreground text-xs whitespace-normal",children:a.explanation}),o[15]=a.explanation,o[16]=t):t=o[16];let x;return o[17]!==p||o[18]!==t?(x=s.jsxs("div",{className:"border-warning/40 bg-muted/40 mt-2 space-y-2 rounded-lg border p-2",children:[p,t]}),o[17]=p,o[18]=t,o[19]=x):x=o[19],x}function Fe(r){const{environment:o,window:a,range:d}=F().props,{percentile:u}=H(),{label:v}=K(),[m,y]=D.useState(null),n=o.application_id,l=o.id,c=a==="custom"?{from:d?.from,to:d?.to}:{window:a},h=d?{from:d.from,to:d.to}:c,p=(e,i=r.q)=>Q(n,l,{...e?h:c,q:i||void 0,cursor:e,limit:r.pagination.limit,sort:r.sort,dir:r.dir}),t=r.summary.current,x=r.summary.previous,g=a==="custom"?"vs previous period":`vs previous ${v}`,M=r.n_plus_ones.filter(e=>e.suggestion).length,P=e=>{e.suggestion&&y(i=>i===e.group_hash?null:e.group_hash)},b=e=>S.visit(Q(n,l,{...c,q:r.q||void 0,sort:e,dir:r.sort===e&&r.dir==="desc"?"asc":"desc"}),{preserveState:!0}),j=e=>O(n,l,e,c),N=(e,i)=>i?.newTab?globalThis.window.open(j(e),"_blank"):S.visit(j(e));return s.jsxs($,{title:"Queries",children:[s.jsx(A,{title:"Queries",description:"Every SQL shape your app ran, grouped by normalized statement.",actions:s.jsx(I,{})}),s.jsxs(U,{children:[s.jsx(C,{label:"Queries",value:E(t.count),delta:{current:t.count,previous:x.count,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"N+1 groups",value:E(r.n_plus_ones.length),tone:r.n_plus_ones.length>0?"warning":void 0,hint:r.n_plus_ones.length>0?`${M} with a suggested fix`:void 0}),s.jsx(C,{label:"Avg",value:f(t.avg/1e3,2),delta:{current:t.avg,previous:x.avg,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"p95",value:f(t.p95/1e3,2),hint:`p99 ${f(t.p99/1e3,2)}`,delta:{current:t.p95,previous:x.p95,goodDirection:"down"},deltaCaption:g})]}),r.n_plus_ones.length>0&&s.jsxs(G,{className:"border-amber-500/40",children:[s.jsx(V,{children:s.jsx(X,{children:"N+1 queries detected"})}),s.jsx(Y,{children:s.jsx(q,{rows:r.n_plus_ones,rowKey:e=>e.group_hash,onRowClick:P,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query shape",grow:!0,cell:e=>s.jsxs(s.Fragment,{children:[s.jsx(w,{href:O(n,l,e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})}),m===e.group_hash&&e.suggestion&&s.jsx(ie,{suggestion:e.suggestion})]})},{key:"fix",header:"Fix",cell:e=>e.suggestion?s.jsxs("button",{type:"button","aria-expanded":m===e.group_hash,"aria-label":`Suggested fix: ${e.suggestion.code}`,onClick:i=>{i.stopPropagation(),P(e)},className:"border-warning/50 text-warning hover:bg-warning/10 inline-flex items-center gap-0.5 rounded-md border py-0.5 pr-1.5 pl-0.5 font-mono text-[11px] uppercase",children:[m===e.group_hash?s.jsx(se,{className:"size-3"}):s.jsx(oe,{className:"size-3"}),"Fix"]}):null},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"occ",header:"Executions affected",align:"right",cell:e=>e.occurrences},{key:"mx",hideOnMobile:!0,header:"Max repeats",align:"right",cell:e=>e.max_count}]})})]}),s.jsx(q,{rows:r.queries,rowKey:e=>e.group_hash,empty:s.jsx(z,{icon:re,title:"No queries in this window",description:"SQL queries executed by your app appear here as they're reported."}),hoverKey:e=>e.group_hash,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.name})})},{key:"trend",hideOnMobile:!0,header:"Trend",cell:e=>s.jsx(J,{data:e.sparkline,hoverKey:e.group_hash})},{key:"n",header:s.jsx(k,{label:"Count",active:r.sort==="count",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("count")}),align:"right",cell:e=>E(e.count)},{key:"avg",hideOnMobile:!0,header:s.jsx(k,{label:"Avg",active:r.sort==="avg",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("avg")}),align:"right",cell:e=>f(e.avg,2)},{key:u,header:s.jsx(k,{label:u,active:r.sort===u,dir:r.dir==="asc"?"asc":"desc",onClick:()=>b(u)}),align:"right",cell:e=>s.jsx("span",{className:"font-semibold",children:f(e[u],2)})},{key:"max",hideOnMobile:!0,header:s.jsx(k,{label:"Max",active:r.sort==="max",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("max")}),align:"right",cell:e=>f(e.max,2)}]}),s.jsx("h2",{className:"text-sm font-semibold",children:"Slowest individual queries"}),s.jsx(B,{value:r.q,fields:[{key:"after",label:"After"},{key:"before",label:"Before"},{key:"user",label:"User"},{key:"tenant",label:"Tenant"},{key:"deploy",label:"Deploy"},{key:"source",label:"Source"},{key:"kind",label:"Execution kind",options:["request","job","scheduled_task","command"]},{key:"connection",label:"Connection"},{key:"role",label:"Role"},{key:"adapter",label:"Adapter"}],onChange:e=>S.visit(p(void 0,e),{only:["slowest","pagination","q"],preserveState:!0,reset:["slowest"]}),placeholder:"connection:primary role:reading source:app/models"}),s.jsx(q,{rows:r.slowest,rowKey:e=>e.id,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"SQL",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})})},{key:"exe",hideOnMobile:!0,header:"In",cell:e=>e.execution_id?s.jsx(w,{className:"font-mono text-xs hover:underline",href:T(n,l,e.execution_id),children:e.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"d",header:"Duration",align:"right",cell:e=>f(e.duration,2)}]}),s.jsx(R,{meta:r.pagination,href:p,only:["slowest","pagination"]})]})}export{Fe as default};
1
+ import{u as F,r as M,j as s,L as w,J as Q,e as S,t as T,ae as O,c as L}from"./inertia-DLew8ZNx.js";import{S as _}from"./code-DESvxyTj.js";import{C as R}from"./cursor-load-more-CRyuMeQb.js";import{D as q}from"./data-table-BIlt7Rtm.js";import{E as z}from"./empty-state-C38il627.js";import{F as B}from"./filter-bar-CYog9Alp.js";import{u as K,E as $,P as A}from"./env-layout-REF7OM4q.js";import{u as H,P as I}from"./percentile-picker-DfSx9yJO.js";import{S as k}from"./sort-header-Dcq9bzmo.js";import{S as J}from"./sparkline-cell-BON3qQUB.js";import{a as U,S as C}from"./stat-DFEyFxkO.js";import{B as W}from"./app-wordmark-o9CODKP0.js";import{C as G,b as V,c as X,a as Y}from"./card-cAtqCxWl.js";import{u as Z,C as ee}from"./use-clipboard-ByoUGQqA.js";import{c as E,m as f}from"./format-B9SDkrWj.js";import{C as se,a as oe,Q as re}from"./app-layout-DDyQa72H.js";import{C as te}from"./index-umIAl-pL.js";import"./chart-hover-B1M9jc0y.js";import"./badge-CAxXV8za.js";import"./use-live-D7xKz2ma.js";import"./live-dot-D1n_BreY.js";import"./index-so4lRrRq.js";import"./segmented-BgbT3wZa.js";import"./label-GWl7I6sf.js";import"./arrow-up-C6PxDiY3.js";import"./series-chart-Xf49v9cv.js";import"./chart-BBeBkkNa.js";import"./checkbox-CmhMHWZO.js";const ae=1500;function ie(r){const o=L.c(20),{suggestion:a}=r,[,d]=Z(),[u,v]=M.useState(!1);let m;o[0]!==d||o[1]!==a.code?(m=()=>{d(a.code).then(g=>{g&&(v(!0),window.setTimeout(()=>v(!1),ae))})},o[0]=d,o[1]=a.code,o[2]=m):m=o[2];const y=m;let n;o[3]!==a.code?(n=s.jsx("pre",{className:"overflow-x-auto font-mono text-xs whitespace-pre-wrap",children:a.code}),o[3]=a.code,o[4]=n):n=o[4];let l;o[5]!==y?(l=g=>{g.stopPropagation(),y()},o[5]=y,o[6]=l):l=o[6];let c;o[7]!==u?(c=u?s.jsx(te,{className:"size-3 text-emerald-500"}):s.jsx(ee,{className:"size-3 opacity-60"}),o[7]=u,o[8]=c):c=o[8];let h;o[9]!==l||o[10]!==c?(h=s.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"h-6 shrink-0 gap-1 px-1.5 text-xs",onClick:l,children:[c,"Copy"]}),o[9]=l,o[10]=c,o[11]=h):h=o[11];let p;o[12]!==n||o[13]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n,h]}),o[12]=n,o[13]=h,o[14]=p):p=o[14];let t;o[15]!==a.explanation?(t=s.jsx("p",{className:"text-muted-foreground text-xs whitespace-normal",children:a.explanation}),o[15]=a.explanation,o[16]=t):t=o[16];let x;return o[17]!==p||o[18]!==t?(x=s.jsxs("div",{className:"border-warning/40 bg-muted/40 mt-2 space-y-2 rounded-lg border p-2",children:[p,t]}),o[17]=p,o[18]=t,o[19]=x):x=o[19],x}function Fe(r){const{environment:o,window:a,range:d}=F().props,{percentile:u}=H(),{label:v}=K(),[m,y]=M.useState(null),n=o.application_id,l=o.id,c=a==="custom"?{from:d?.from,to:d?.to}:{window:a},h=d?{from:d.from,to:d.to}:c,p=(e,i=r.q)=>O(n,l,{...e?h:c,q:i||void 0,cursor:e,limit:r.pagination.limit,sort:r.sort,dir:r.dir}),t=r.summary.current,x=r.summary.previous,g=a==="custom"?"vs previous period":`vs previous ${v}`,D=r.n_plus_ones.filter(e=>e.suggestion).length,P=e=>{e.suggestion&&y(i=>i===e.group_hash?null:e.group_hash)},b=e=>S.visit(O(n,l,{...c,q:r.q||void 0,sort:e,dir:r.sort===e&&r.dir==="desc"?"asc":"desc"}),{preserveState:!0}),j=e=>Q(n,l,e,c),N=(e,i)=>i?.newTab?globalThis.window.open(j(e),"_blank"):S.visit(j(e));return s.jsxs($,{title:"Queries",children:[s.jsx(A,{title:"Queries",description:"Every SQL shape your app ran, grouped by normalized statement.",actions:s.jsx(I,{})}),s.jsxs(U,{children:[s.jsx(C,{label:"Queries",value:E(t.count),delta:{current:t.count,previous:x.count,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"N+1 groups",value:E(r.n_plus_ones.length),tone:r.n_plus_ones.length>0?"warning":void 0,hint:r.n_plus_ones.length>0?`${D} with a suggested fix`:void 0}),s.jsx(C,{label:"Avg",value:f(t.avg/1e3,2),delta:{current:t.avg,previous:x.avg,goodDirection:"down"},deltaCaption:g}),s.jsx(C,{label:"p95",value:f(t.p95/1e3,2),hint:`p99 ${f(t.p99/1e3,2)}`,delta:{current:t.p95,previous:x.p95,goodDirection:"down"},deltaCaption:g})]}),r.n_plus_ones.length>0&&s.jsxs(G,{className:"border-amber-500/40",children:[s.jsx(V,{children:s.jsx(X,{children:"N+1 queries detected"})}),s.jsx(Y,{children:s.jsx(q,{rows:r.n_plus_ones,rowKey:e=>e.group_hash,onRowClick:P,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query shape",grow:!0,cell:e=>s.jsxs(s.Fragment,{children:[s.jsx(w,{href:Q(n,l,e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})}),m===e.group_hash&&e.suggestion&&s.jsx(ie,{suggestion:e.suggestion})]})},{key:"fix",header:"Fix",cell:e=>e.suggestion?s.jsxs("button",{type:"button","aria-expanded":m===e.group_hash,"aria-label":`Suggested fix: ${e.suggestion.code}`,onClick:i=>{i.stopPropagation(),P(e)},className:"border-warning/50 text-warning hover:bg-warning/10 inline-flex items-center gap-0.5 rounded-md border py-0.5 pr-1.5 pl-0.5 font-mono text-[11px] uppercase",children:[m===e.group_hash?s.jsx(se,{className:"size-3"}):s.jsx(oe,{className:"size-3"}),"Fix"]}):null},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"occ",header:"Executions affected",align:"right",cell:e=>e.occurrences},{key:"mx",hideOnMobile:!0,header:"Max repeats",align:"right",cell:e=>e.max_count}]})})]}),s.jsx(q,{rows:r.queries,rowKey:e=>e.group_hash,empty:s.jsx(z,{icon:re,title:"No queries in this window",description:"SQL queries executed by your app appear here as they're reported."}),hoverKey:e=>e.group_hash,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"Query",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.name})})},{key:"trend",hideOnMobile:!0,header:"Trend",cell:e=>s.jsx(J,{data:e.sparkline,hoverKey:e.group_hash})},{key:"n",header:s.jsx(k,{label:"Count",active:r.sort==="count",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("count")}),align:"right",cell:e=>E(e.count)},{key:"avg",hideOnMobile:!0,header:s.jsx(k,{label:"Avg",active:r.sort==="avg",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("avg")}),align:"right",cell:e=>f(e.avg,2)},{key:u,header:s.jsx(k,{label:u,active:r.sort===u,dir:r.dir==="asc"?"asc":"desc",onClick:()=>b(u)}),align:"right",cell:e=>s.jsx("span",{className:"font-semibold",children:f(e[u],2)})},{key:"max",hideOnMobile:!0,header:s.jsx(k,{label:"Max",active:r.sort==="max",dir:r.dir==="asc"?"asc":"desc",onClick:()=>b("max")}),align:"right",cell:e=>f(e.max,2)}]}),s.jsx("h2",{className:"text-sm font-semibold",children:"Slowest individual queries"}),s.jsx(B,{value:r.q,fields:[{key:"after",label:"After"},{key:"before",label:"Before"},{key:"user",label:"User"},{key:"tenant",label:"Tenant"},{key:"deploy",label:"Deploy"},{key:"source",label:"Source"},{key:"kind",label:"Execution kind",options:["request","job","scheduled_task","command"]},{key:"connection",label:"Connection"},{key:"role",label:"Role"},{key:"adapter",label:"Adapter"}],onChange:e=>S.visit(p(void 0,e),{only:["slowest","pagination","q"],preserveState:!0,reset:["slowest"]}),placeholder:"connection:primary role:reading source:app/models"}),s.jsx(q,{rows:r.slowest,rowKey:e=>e.id,keyboardNav:{onOpen:(e,i)=>N(e.group_hash,i)},columns:[{key:"sql",header:"SQL",grow:!0,cell:e=>s.jsx(w,{href:j(e.group_hash),children:s.jsx(_,{className:"hover:underline",children:e.sql})})},{key:"exe",hideOnMobile:!0,header:"In",cell:e=>e.execution_id?s.jsx(w,{className:"font-mono text-xs hover:underline",href:T(n,l,e.execution_id),children:e.execution_preview}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"–"})},{key:"src",hideOnMobile:!0,header:"Source",cell:e=>s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:e.source??""})},{key:"d",header:"Duration",align:"right",cell:e=>f(e.duration,2)}]}),s.jsx(R,{meta:r.pagination,href:p,only:["slowest","pagination"]})]})}export{Fe as default};
@@ -1 +1 @@
1
- import{aC as te,c as ae,u as le,j as r,e as re,L as ie}from"./inertia-Degv_G9N.js";import{C as oe}from"./chart-panel-BYk68mJJ.js";import{D as ne}from"./data-table-IvA7xvrK.js";import{E as me}from"./empty-state-BFTnQ2oT.js";import{E as ue,P as ce}from"./env-layout-erSDpIXg.js";import{b as fe}from"./series-chart-D33UhdG2.js";import{S as Y,a as he}from"./stat-TxvoBiC8.js";import{c as a,w as de,m as ye}from"./format-B9SDkrWj.js";import{rate as Z,crashFreeTone as se}from"./release-health-1Qzc_XhT.js";import{z as _e}from"./app-layout-B5Fcdwfz.js";import"./chart-hover-XYPNE2CX.js";import"./badge-CApjyWcg.js";import"./app-wordmark-1SRllgHv.js";import"./use-live-GKze1mNC.js";import"./live-dot-DaXEbkXo.js";import"./index-B0VXzXYG.js";import"./index-CX8Br7m9.js";import"./segmented-CVKq2Xpa.js";import"./label-B_vK19tR.js";import"./chart-Xnrz1Nqw.js";import"./arrow-up-DwKQcab4.js";import"./checkbox-Bf41R8W6.js";function pe(s,e,H,q){const z=String(te(s,e,H,q)),[F,u]=z.split("?");return`${F.replace(/\./g,"%2E")}${u?`?${u}`:""}`}function Ve(s){const e=ae.c(98),{environment:H,window:q}=le().props,z=H.application_id,F=H.id;let u;e[0]!==z||e[1]!==F||e[2]!==q?(u=t=>pe(z,F,t.deploy,{window:q}),e[0]=z,e[1]=F,e[2]=q,e[3]=u):u=e[3];const l=u;let c,f,h,i,d,y,_,p,x,o,k,n;if(e[4]!==s.series||e[5]!==s.summary.crash_free_sessions||e[6]!==s.summary.crash_free_users||e[7]!==s.summary.releases||e[8]!==s.summary.sessions||e[9]!==s.summary.users){const t=s.series.reduce(Ce,{ok:0,errored:0,crashed:0});f=ue,k="Releases",e[22]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(ce,{title:"Releases",description:"Sessions per deploy, and how many of them ended without a crash. A release is the deploy stamped on every record the gem ships."}),e[22]=n):n=e[22];let m;e[23]!==s.summary.crash_free_sessions?(m=Z(s.summary.crash_free_sessions),e[23]=s.summary.crash_free_sessions,e[24]=m):m=e[24];let N;e[25]!==s.summary.crash_free_sessions?(N=se(s.summary.crash_free_sessions),e[25]=s.summary.crash_free_sessions,e[26]=N):N=e[26];let P;e[27]!==m||e[28]!==N?(P=r.jsx(Y,{label:"Crash-free sessions",value:m,tone:N}),e[27]=m,e[28]=N,e[29]=P):P=e[29];let T;e[30]!==s.summary.crash_free_users?(T=Z(s.summary.crash_free_users),e[30]=s.summary.crash_free_users,e[31]=T):T=e[31];let $;e[32]!==s.summary.crash_free_users?($=se(s.summary.crash_free_users),e[32]=s.summary.crash_free_users,e[33]=$):$=e[33];let A;e[34]!==T||e[35]!==$?(A=r.jsx(Y,{label:"Crash-free users",value:T,tone:$}),e[34]=T,e[35]=$,e[36]=A):A=e[36];let D;e[37]!==s.summary.sessions?(D=a(s.summary.sessions),e[37]=s.summary.sessions,e[38]=D):D=e[38];let X;e[39]!==s.summary.users?(X=a(s.summary.users),e[39]=s.summary.users,e[40]=X):X=e[40];const ee=`${X} users`;let O;e[41]!==D||e[42]!==ee?(O=r.jsx(Y,{label:"Sessions",value:D,hint:ee}),e[41]=D,e[42]=ee,e[43]=O):O=e[43];let L;e[44]!==s.summary.releases?(L=a(s.summary.releases),e[44]=s.summary.releases,e[45]=L):L=e[45];let M;e[46]!==L?(M=r.jsx(Y,{label:"Active releases",value:L}),e[46]=L,e[47]=M):M=e[47],e[48]!==P||e[49]!==A||e[50]!==O||e[51]!==M?(i=r.jsxs(he,{children:[P,A,O,M]}),e[48]=P,e[49]=A,e[50]=O,e[51]=M,e[52]=i):i=e[52],c=oe,x="Sessions by status",e[53]!==s.summary.sessions?(o=a(s.summary.sessions),e[53]=s.summary.sessions,e[54]=o):o=e[54],_={key:"ok",label:"ok",value:a(t.ok),color:"var(--ok)"},p={key:"errored",label:"errored",value:a(t.errored),color:"var(--warning)"},h="crashed",d="crashed",y=a(t.crashed),e[4]=s.series,e[5]=s.summary.crash_free_sessions,e[6]=s.summary.crash_free_users,e[7]=s.summary.releases,e[8]=s.summary.sessions,e[9]=s.summary.users,e[10]=c,e[11]=f,e[12]=h,e[13]=i,e[14]=d,e[15]=y,e[16]=_,e[17]=p,e[18]=x,e[19]=o,e[20]=k,e[21]=n}else c=e[10],f=e[11],h=e[12],i=e[13],d=e[14],y=e[15],_=e[16],p=e[17],x=e[18],o=e[19],k=e[20],n=e[21];let v;e[55]!==h||e[56]!==d||e[57]!==y?(v={key:h,label:d,value:y,color:"var(--danger)"},e[55]=h,e[56]=d,e[57]=y,e[58]=v):v=e[58];let b;e[59]!==v||e[60]!==_||e[61]!==p?(b=[_,p,v],e[59]=v,e[60]=_,e[61]=p,e[62]=b):b=e[62];let g;e[63]!==s.series?(g=r.jsx(fe,{data:s.series}),e[63]=s.series,e[64]=g):g=e[64];let w;e[65]!==c||e[66]!==b||e[67]!==g||e[68]!==x||e[69]!==o?(w=r.jsx(c,{label:x,value:o,legend:b,children:g}),e[65]=c,e[66]=b,e[67]=g,e[68]=x,e[69]=o,e[70]=w):w=e[70];let K;e[71]===Symbol.for("react.memo_cache_sentinel")?(K=r.jsx(me,{icon:_e,title:"No releases in this window",description:"A release appears once a deploy is recorded and the app reports sessions for it."}),e[71]=K):K=e[71];let j,S;e[72]!==l?(j=t=>re.visit(l(t)),S={onOpen:(t,m)=>m?.newTab?globalThis.window.open(l(t),"_blank"):re.visit(l(t))},e[72]=l,e[73]=j,e[74]=S):(j=e[73],S=e[74]);let C;e[75]!==l?(C={key:"ref",header:"Release",cell:t=>r.jsx(ie,{className:"font-mono text-xs hover:underline",href:l(t),children:t.ref})},e[75]=l,e[76]=C):C=e[76];let B,G,I,J,Q,U,V;e[77]===Symbol.for("react.memo_cache_sentinel")?(B={key:"at",header:"Deployed",cell:je},G={key:"adoption",header:"Adoption",align:"right",cell:we},I={key:"sessions",header:"Sessions",align:"right",cell:ge},J={key:"cfs",header:"Crash-free sessions",align:"right",cell:be},Q={key:"cfu",hideOnMobile:!0,header:"Crash-free users",align:"right",cell:ve},U={key:"issues",hideOnMobile:!0,header:"New issues",align:"right",cell:ke},V={key:"duration",hideOnMobile:!0,header:"Duration",align:"right",cell:xe},e[77]=B,e[78]=G,e[79]=I,e[80]=J,e[81]=Q,e[82]=U,e[83]=V):(B=e[77],G=e[78],I=e[79],J=e[80],Q=e[81],U=e[82],V=e[83]);let E;e[84]!==C?(E=[C,B,G,I,J,Q,U,V],e[84]=C,e[85]=E):E=e[85];let R;e[86]!==s.releases||e[87]!==j||e[88]!==S||e[89]!==E?(R=r.jsx(ne,{rows:s.releases,rowKey:Se,empty:K,onRowClick:j,keyboardNav:S,columns:E}),e[86]=s.releases,e[87]=j,e[88]=S,e[89]=E,e[90]=R):R=e[90];let W;return e[91]!==f||e[92]!==i||e[93]!==w||e[94]!==R||e[95]!==k||e[96]!==n?(W=r.jsxs(f,{title:k,children:[n,i,w,R]}),e[91]=f,e[92]=i,e[93]=w,e[94]=R,e[95]=k,e[96]=n,e[97]=W):W=e[97],W}function xe(s){return ye(s.avg_duration_ms)}function ke(s){return r.jsx("span",{className:s.new_issues?"text-destructive":"",children:a(s.new_issues)})}function ve(s){return Z(s.crash_free_users)}function be(s){return r.jsx("span",{className:se(s.crash_free_sessions)==="destructive"?"text-destructive font-semibold":"font-semibold",children:Z(s.crash_free_sessions)})}function ge(s){return a(s.sessions)}function we(s){return`${s.adoption}%`}function je(s){return r.jsx("span",{className:"text-xs",children:de(s.deployed_at)})}function Se(s){return s.deploy}function Ce(s,e){return{ok:s.ok+e.ok,errored:s.errored+e.errored,crashed:s.crashed+e.crashed}}export{Ve as default};
1
+ import{aC as te,c as ae,u as le,j as r,e as re,L as ie}from"./inertia-DLew8ZNx.js";import{C as oe}from"./chart-panel-DUQTz_C8.js";import{D as ne}from"./data-table-BIlt7Rtm.js";import{E as me}from"./empty-state-C38il627.js";import{E as ue,P as ce}from"./env-layout-REF7OM4q.js";import{b as fe}from"./series-chart-Xf49v9cv.js";import{S as Y,a as he}from"./stat-DFEyFxkO.js";import{c as a,w as de,m as ye}from"./format-B9SDkrWj.js";import{rate as Z,crashFreeTone as se}from"./release-health-4b3tivEf.js";import{X as _e}from"./app-layout-DDyQa72H.js";import"./chart-hover-B1M9jc0y.js";import"./badge-CAxXV8za.js";import"./app-wordmark-o9CODKP0.js";import"./use-live-D7xKz2ma.js";import"./live-dot-D1n_BreY.js";import"./index-so4lRrRq.js";import"./index-umIAl-pL.js";import"./segmented-BgbT3wZa.js";import"./label-GWl7I6sf.js";import"./chart-BBeBkkNa.js";import"./arrow-up-C6PxDiY3.js";import"./checkbox-CmhMHWZO.js";function pe(s,e,K,q){const F=String(te(s,e,K,q)),[H,u]=F.split("?");return`${H.replace(/\./g,"%2E")}${u?`?${u}`:""}`}function Ue(s){const e=ae.c(98),{environment:K,window:q}=le().props,F=K.application_id,H=K.id;let u;e[0]!==F||e[1]!==H||e[2]!==q?(u=t=>pe(F,H,t.deploy,{window:q}),e[0]=F,e[1]=H,e[2]=q,e[3]=u):u=e[3];const l=u;let c,f,h,i,d,y,_,p,x,o,k,n;if(e[4]!==s.series||e[5]!==s.summary.crash_free_sessions||e[6]!==s.summary.crash_free_users||e[7]!==s.summary.releases||e[8]!==s.summary.sessions||e[9]!==s.summary.users){const t=s.series.reduce(Ce,{ok:0,errored:0,crashed:0});f=ue,k="Releases",e[22]===Symbol.for("react.memo_cache_sentinel")?(n=r.jsx(ce,{title:"Releases",description:"Sessions per deploy, and how many of them ended without a crash. A release is the deploy stamped on every record the gem ships."}),e[22]=n):n=e[22];let m;e[23]!==s.summary.crash_free_sessions?(m=Z(s.summary.crash_free_sessions),e[23]=s.summary.crash_free_sessions,e[24]=m):m=e[24];let N;e[25]!==s.summary.crash_free_sessions?(N=se(s.summary.crash_free_sessions),e[25]=s.summary.crash_free_sessions,e[26]=N):N=e[26];let P;e[27]!==m||e[28]!==N?(P=r.jsx(Y,{label:"Crash-free sessions",value:m,tone:N}),e[27]=m,e[28]=N,e[29]=P):P=e[29];let T;e[30]!==s.summary.crash_free_users?(T=Z(s.summary.crash_free_users),e[30]=s.summary.crash_free_users,e[31]=T):T=e[31];let $;e[32]!==s.summary.crash_free_users?($=se(s.summary.crash_free_users),e[32]=s.summary.crash_free_users,e[33]=$):$=e[33];let A;e[34]!==T||e[35]!==$?(A=r.jsx(Y,{label:"Crash-free users",value:T,tone:$}),e[34]=T,e[35]=$,e[36]=A):A=e[36];let D;e[37]!==s.summary.sessions?(D=a(s.summary.sessions),e[37]=s.summary.sessions,e[38]=D):D=e[38];let W;e[39]!==s.summary.users?(W=a(s.summary.users),e[39]=s.summary.users,e[40]=W):W=e[40];const ee=`${W} users`;let O;e[41]!==D||e[42]!==ee?(O=r.jsx(Y,{label:"Sessions",value:D,hint:ee}),e[41]=D,e[42]=ee,e[43]=O):O=e[43];let L;e[44]!==s.summary.releases?(L=a(s.summary.releases),e[44]=s.summary.releases,e[45]=L):L=e[45];let M;e[46]!==L?(M=r.jsx(Y,{label:"Active releases",value:L}),e[46]=L,e[47]=M):M=e[47],e[48]!==P||e[49]!==A||e[50]!==O||e[51]!==M?(i=r.jsxs(he,{children:[P,A,O,M]}),e[48]=P,e[49]=A,e[50]=O,e[51]=M,e[52]=i):i=e[52],c=oe,x="Sessions by status",e[53]!==s.summary.sessions?(o=a(s.summary.sessions),e[53]=s.summary.sessions,e[54]=o):o=e[54],_={key:"ok",label:"ok",value:a(t.ok),color:"var(--ok)"},p={key:"errored",label:"errored",value:a(t.errored),color:"var(--warning)"},h="crashed",d="crashed",y=a(t.crashed),e[4]=s.series,e[5]=s.summary.crash_free_sessions,e[6]=s.summary.crash_free_users,e[7]=s.summary.releases,e[8]=s.summary.sessions,e[9]=s.summary.users,e[10]=c,e[11]=f,e[12]=h,e[13]=i,e[14]=d,e[15]=y,e[16]=_,e[17]=p,e[18]=x,e[19]=o,e[20]=k,e[21]=n}else c=e[10],f=e[11],h=e[12],i=e[13],d=e[14],y=e[15],_=e[16],p=e[17],x=e[18],o=e[19],k=e[20],n=e[21];let v;e[55]!==h||e[56]!==d||e[57]!==y?(v={key:h,label:d,value:y,color:"var(--danger)"},e[55]=h,e[56]=d,e[57]=y,e[58]=v):v=e[58];let b;e[59]!==v||e[60]!==_||e[61]!==p?(b=[_,p,v],e[59]=v,e[60]=_,e[61]=p,e[62]=b):b=e[62];let g;e[63]!==s.series?(g=r.jsx(fe,{data:s.series}),e[63]=s.series,e[64]=g):g=e[64];let w;e[65]!==c||e[66]!==b||e[67]!==g||e[68]!==x||e[69]!==o?(w=r.jsx(c,{label:x,value:o,legend:b,children:g}),e[65]=c,e[66]=b,e[67]=g,e[68]=x,e[69]=o,e[70]=w):w=e[70];let X;e[71]===Symbol.for("react.memo_cache_sentinel")?(X=r.jsx(me,{icon:_e,title:"No releases in this window",description:"A release appears once a deploy is recorded and the app reports sessions for it."}),e[71]=X):X=e[71];let j,S;e[72]!==l?(j=t=>re.visit(l(t)),S={onOpen:(t,m)=>m?.newTab?globalThis.window.open(l(t),"_blank"):re.visit(l(t))},e[72]=l,e[73]=j,e[74]=S):(j=e[73],S=e[74]);let C;e[75]!==l?(C={key:"ref",header:"Release",cell:t=>r.jsx(ie,{className:"font-mono text-xs hover:underline",href:l(t),children:t.ref})},e[75]=l,e[76]=C):C=e[76];let z,B,G,I,J,Q,U;e[77]===Symbol.for("react.memo_cache_sentinel")?(z={key:"at",header:"Deployed",cell:je},B={key:"adoption",header:"Adoption",align:"right",cell:we},G={key:"sessions",header:"Sessions",align:"right",cell:ge},I={key:"cfs",header:"Crash-free sessions",align:"right",cell:be},J={key:"cfu",hideOnMobile:!0,header:"Crash-free users",align:"right",cell:ve},Q={key:"issues",hideOnMobile:!0,header:"New issues",align:"right",cell:ke},U={key:"duration",hideOnMobile:!0,header:"Duration",align:"right",cell:xe},e[77]=z,e[78]=B,e[79]=G,e[80]=I,e[81]=J,e[82]=Q,e[83]=U):(z=e[77],B=e[78],G=e[79],I=e[80],J=e[81],Q=e[82],U=e[83]);let E;e[84]!==C?(E=[C,z,B,G,I,J,Q,U],e[84]=C,e[85]=E):E=e[85];let R;e[86]!==s.releases||e[87]!==j||e[88]!==S||e[89]!==E?(R=r.jsx(ne,{rows:s.releases,rowKey:Se,empty:X,onRowClick:j,keyboardNav:S,columns:E}),e[86]=s.releases,e[87]=j,e[88]=S,e[89]=E,e[90]=R):R=e[90];let V;return e[91]!==f||e[92]!==i||e[93]!==w||e[94]!==R||e[95]!==k||e[96]!==n?(V=r.jsxs(f,{title:k,children:[n,i,w,R]}),e[91]=f,e[92]=i,e[93]=w,e[94]=R,e[95]=k,e[96]=n,e[97]=V):V=e[97],V}function xe(s){return ye(s.avg_duration_ms)}function ke(s){return r.jsx("span",{className:s.new_issues?"text-destructive":"",children:a(s.new_issues)})}function ve(s){return Z(s.crash_free_users)}function be(s){return r.jsx("span",{className:se(s.crash_free_sessions)==="destructive"?"text-destructive font-semibold":"font-semibold",children:Z(s.crash_free_sessions)})}function ge(s){return a(s.sessions)}function we(s){return`${s.adoption}%`}function je(s){return r.jsx("span",{className:"text-xs",children:de(s.deployed_at)})}function Se(s){return s.deploy}function Ce(s,e){return{ok:s.ok+e.ok,errored:s.errored+e.errored,crashed:s.crashed+e.crashed}}export{Ue as default};
@@ -1 +1 @@
1
- import{c as G,r as D,at as T,aL as J,j as t,H as V,F as z,e as o,aM as Y,aN as R,aO as Z,aP as ee,aQ as te}from"./inertia-Degv_G9N.js";import{I as O}from"./input-error-C6SqO_iU.js";import{D as E}from"./data-table-IvA7xvrK.js";import{R as se}from"./relative-time-6CoKr1lN.js";import{B as K}from"./badge-CApjyWcg.js";import{B as i}from"./app-wordmark-1SRllgHv.js";import{b as H,c as B,C as M,a as W}from"./card-BaJ8kNkp.js";import{C as U}from"./checkbox-Bf41R8W6.js";import{L as r,I as l}from"./label-B_vK19tR.js";import{A as ne}from"./app-layout-B5Fcdwfz.js";import"./chart-hover-XYPNE2CX.js";import"./empty-state-BFTnQ2oT.js";import"./live-dot-DaXEbkXo.js";import"./index-B0VXzXYG.js";import"./index-CX8Br7m9.js";import"./format-B9SDkrWj.js";const re={slack:"Slack hook id — incoming webhooks do not expose their channel"},$={slack:{key:"webhook_url",label:"New Slack incoming webhook URL"},webhook:{key:"secret",label:"New signing secret"},linear:{key:"api_key",label:"New Linear API key"}};function ie(e){const s=$[e.kind];if(!s)return;const n=window.prompt(s.label)?.trim();n&&o.patch(R(e.id),{enabled:!0,settings:{[s.key]:n}})}const Q={new_issue:"New issue",regressed_issue:"Regressed or reopened issue",resolved_issue:"Issue resolved",ignored_issue:"Issue ignored",assigned_issue:"Issue assigned",threshold:"Threshold exceeded",quota:"Quota reached"};function ae(e,s){const n=e.filters??{};return[...(s[e.application_id]??[]).filter(a=>(n.environment_ids??[]).includes(a.id)).map(a=>a.name),...n.kinds??[],n.min_priority?`>= ${n.min_priority}`:null,n.title_pattern].filter(Boolean).join(" · ")}function Ke(e){const s=G.c(40),[n,q]=D.useState("slack"),[a,X]=D.useState(e.application_options[0]?.id);let j,f;s[0]===Symbol.for("react.memo_cache_sentinel")?(j=[{title:"Integrations",href:T()}],f=t.jsx(V,{title:"Integrations"}),s[0]=j,s[1]=f):(j=s[0],f=s[1]);let _;s[2]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold",children:"Integrations and alerts"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"Where alerts go, and which events trigger them per application."})]}),s[2]=_):_=s[2];let b;s[3]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add integration"})}),s[3]=b):b=s[3];let k;s[4]===Symbol.for("react.memo_cache_sentinel")?(k=T(),s[4]=k):k=s[4];let d;s[5]!==n||s[6]!==e.kinds||s[7]!==e.linear_oauth_enabled?(d=t.jsxs(M,{children:[b,t.jsx(W,{children:t.jsx(z,{method:"post",action:k,className:"space-y-3",resetOnSuccess:!0,children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"kind",children:"Kind"}),t.jsx("select",{id:"kind",name:"kind",value:n,onChange:P=>q(P.target.value),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.kinds.map(Ce)})]}),!(n==="linear"&&e.linear_oauth_enabled)&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"name",children:"Name"}),t.jsx(l,{id:"name",name:"name",required:!0,placeholder:"#alerts"}),t.jsx(O,{messages:L.name})]}),n==="email"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"to",children:"Send to"}),t.jsx(l,{id:"to",name:"settings[to]",type:"email",required:!0})]}),n==="slack"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"webhook_url",children:"Incoming webhook URL"}),t.jsx(l,{id:"webhook_url",name:"settings[webhook_url]",type:"url",required:!0,placeholder:"https://hooks.slack.com/services/…"})]}),n==="webhook"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"url",children:"URL"}),t.jsx(l,{id:"url",name:"settings[url]",type:"url",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"secret",children:"Signing secret (optional)"}),t.jsx(l,{id:"secret",name:"settings[secret]"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Sent as X-Railwatch-Signature: sha256=HMAC(body)."})]})]}),n==="linear"&&e.linear_oauth_enabled&&t.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm",children:"Linear uses OAuth to discover your workspace and teams. Connect your workspace, then select a team."}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Railwatch names the integration from the Linear workspace."})]}),n==="linear"&&!e.linear_oauth_enabled&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"api_key",children:"API key"}),t.jsx(l,{id:"api_key",name:"settings[api_key]",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"team_id",children:"Team ID"}),t.jsx(l,{id:"team_id",name:"settings[team_id]",required:!0})]})]}),t.jsx(O,{messages:L.settings}),n==="linear"&&e.linear_oauth_enabled?t.jsx(i,{type:"button",onClick:Se,children:"Connect Linear workspace"}):t.jsx(i,{disabled:A,children:"Add"})]})}})})]}),s[5]=n,s[6]=e.kinds,s[7]=e.linear_oauth_enabled,s[8]=d):d=s[8];let v;s[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add alert rule"})}),s[9]=v):v=s[9];let y;s[10]===Symbol.for("react.memo_cache_sentinel")?(y=J(),s[10]=y):y=s[10];let c;s[11]!==a||s[12]!==e.application_options||s[13]!==e.environment_options||s[14]!==e.events||s[15]!==e.integrations||s[16]!==e.issue_kinds||s[17]!==e.priorities?(c=t.jsxs(M,{children:[v,t.jsx(W,{children:t.jsx(z,{method:"post",action:y,className:"space-y-3",children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"application_id",children:"Application"}),t.jsx("select",{id:"application_id",name:"application_id",value:a??"",onChange:P=>X(Number(P.target.value)),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.application_options.map(we)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"event",children:"When"}),t.jsx("select",{id:"event",name:"event",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.events.map(Ne)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"integration_id",children:"Notify"}),t.jsx("select",{id:"integration_id",name:"integration_id",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.integrations.map(ye)})]}),t.jsxs("div",{className:"space-y-3 border-t pt-3",children:[t.jsx("p",{className:"label-caps",children:"Only notify when (optional)"}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Environments"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:(e.environment_options[a??0]??[]).map(ve)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Issue kinds"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:e.issue_kinds.map(ke)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"min_priority",children:"Minimum priority"}),t.jsxs("select",{id:"min_priority",name:"filters[min_priority]",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:[t.jsx("option",{value:"",children:"any"}),e.priorities.map(be)]})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"title_pattern",children:"Title matches"}),t.jsx(l,{id:"title_pattern",name:"filters[title_pattern]",placeholder:"timeout, or /Redis.*timeout/"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Case-insensitive substring, or a regular expression when wrapped in slashes."})]})]}),t.jsx(O,{messages:L.event}),t.jsx(i,{disabled:A||e.integrations.length===0,children:"Add rule"})]})}})})]}),s[11]=a,s[12]=e.application_options,s[13]=e.environment_options,s[14]=e.events,s[15]=e.integrations,s[16]=e.issue_kinds,s[17]=e.priorities,s[18]=c):c=s[18];let m;s[19]!==d||s[20]!==c?(m=t.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[d,c]}),s[19]=d,s[20]=c,s[21]=m):m=s[21];let N;s[22]===Symbol.for("react.memo_cache_sentinel")?(N=[{key:"n",header:"Integration",cell:fe},{key:"k",header:"Kind",cell:je},{key:"s",header:"Destination",cell:ge},{key:"d",header:"Health",hideOnMobile:!0,cell:xe},{key:"e",header:"",cell:pe},{key:"x",header:"",align:"right",cell:he}],s[22]=N):N=s[22];let h;s[23]!==e.integrations?(h=t.jsx(E,{rows:e.integrations,rowKey:_e,empty:"No integrations yet.",columns:N}),s[23]=e.integrations,s[24]=h):h=s[24];let w,S,C;s[25]===Symbol.for("react.memo_cache_sentinel")?(w={key:"a",header:"Application",cell:ce},S={key:"e",header:"When",cell:de},C={key:"i",header:"Notify",cell:oe},s[25]=w,s[26]=S,s[27]=C):(w=s[25],S=s[26],C=s[27]);let u;s[28]!==e.environment_options?(u={key:"f",header:"Only when",hideOnMobile:!0,cell:g=>t.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:ae(g,e.environment_options)||"—"})},s[28]=e.environment_options,s[29]=u):u=s[29];let I;s[30]===Symbol.for("react.memo_cache_sentinel")?(I={key:"x",header:"",align:"right",cell:le},s[30]=I):I=s[30];let p;s[31]!==u?(p=[w,S,C,u,I],s[31]=u,s[32]=p):p=s[32];let x;s[33]!==e.alert_rules||s[34]!==p?(x=t.jsx(E,{rows:e.alert_rules,rowKey:me,empty:"No alert rules yet.",columns:p}),s[33]=e.alert_rules,s[34]=p,s[35]=x):x=s[35];let F;return s[36]!==h||s[37]!==x||s[38]!==m?(F=t.jsxs(ne,{breadcrumbs:j,children:[f,t.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6",children:[_,m,h,x]})]}),s[36]=h,s[37]=x,s[38]=m,s[39]=F):F=s[39],F}function le(e){return t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(te(e.id)),children:"Remove"})}function oe(e){return e.integration}function de(e){return Q[e.event]??e.event}function ce(e){return e.application}function me(e){return e.id}function he(e){return t.jsxs("span",{className:"flex flex-wrap justify-end gap-1",children:[e.kind==="linear"&&(e.settings.team_options?.length??0)>0&&t.jsxs("select",{"aria-label":`Linear team for ${e.name}`,value:e.settings.team_id??"",onChange:s=>o.patch(R(e.id),{enabled:!0,settings:{team_id:s.target.value}}),className:"border-input h-8 rounded-md border bg-transparent px-2 text-xs",children:[t.jsx("option",{value:"",children:"Select team…"}),e.settings.team_options?.map(ue)]}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.post(Z(e.id),{},{preserveScroll:!0}),children:"Send test"}),$[e.kind]&&!(e.kind==="linear"&&e.settings.oauth)&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>ie(e),children:"Rotate"}),e.kind==="linear"&&e.settings.oauth&&e.settings.credential&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.delete(ee(e.id)),children:"Disconnect"}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.patch(R(e.id),{enabled:!e.enabled}),children:e.enabled?"Disable":"Enable"}),t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(R(e.id)),children:"Remove"})]})}function ue(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.key,")"]},e.id)}function pe(e){return e.enabled?null:t.jsx(K,{variant:"secondary",children:"disabled"})}function xe(e){return t.jsxs("span",{className:"flex flex-col gap-0.5",children:[t.jsxs("span",{className:"text-muted-foreground text-xs",children:[e.kind==="linear"?"Last sync ":"Last delivery ",t.jsx(se,{iso:e.kind==="linear"?e.last_synced_at:e.last_delivered_at})]}),e.kind==="linear"&&e.webhook_health&&t.jsxs("span",{className:"text-muted-foreground text-xs",children:["Webhooks: ",e.webhook_health.pending," pending ·"," ",e.webhook_health.failed," failed"]}),e.last_error&&t.jsx("span",{className:"text-destructive max-w-64 truncate text-xs",title:e.last_error,children:e.last_error})]})}function ge(e){return t.jsx("span",{className:"font-mono text-xs",title:re[e.kind],children:e.destination??"—"})}function je(e){return t.jsx(K,{variant:"outline",children:e.kind})}function fe(e){return t.jsx("span",{className:"font-medium",children:e.name})}function _e(e){return e.id}function be(e){return t.jsx("option",{value:e,children:e},e)}function ke(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[kinds][]",value:e}),e]},e)}function ve(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[environment_ids][]",value:String(e.id)}),e.name]},e.id)}function ye(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.kind,")"]},e.id)}function Ne(e){return t.jsx("option",{value:e,children:Q[e]??e},e)}function we(e){return t.jsx("option",{value:e.id,children:e.name},e.id)}function Se(){return o.post(Y())}function Ce(e){return t.jsx("option",{value:e,children:e},e)}export{Ke as default};
1
+ import{c as G,r as D,at as T,aL as J,j as t,H as V,F as z,e as o,aM as Y,aN as R,aO as Z,aP as ee,aQ as te}from"./inertia-DLew8ZNx.js";import{I as O}from"./input-error-cvM6_Jht.js";import{D as E}from"./data-table-BIlt7Rtm.js";import{R as se}from"./relative-time-CjIjb8Lg.js";import{B as K}from"./badge-CAxXV8za.js";import{B as i}from"./app-wordmark-o9CODKP0.js";import{b as H,c as B,C as M,a as W}from"./card-cAtqCxWl.js";import{C as U}from"./checkbox-CmhMHWZO.js";import{L as r,I as l}from"./label-GWl7I6sf.js";import{A as ne}from"./app-layout-DDyQa72H.js";import"./chart-hover-B1M9jc0y.js";import"./empty-state-C38il627.js";import"./live-dot-D1n_BreY.js";import"./index-so4lRrRq.js";import"./index-umIAl-pL.js";import"./format-B9SDkrWj.js";const re={slack:"Slack hook id — incoming webhooks do not expose their channel"},$={slack:{key:"webhook_url",label:"New Slack incoming webhook URL"},webhook:{key:"secret",label:"New signing secret"},linear:{key:"api_key",label:"New Linear API key"}};function ie(e){const s=$[e.kind];if(!s)return;const n=window.prompt(s.label)?.trim();n&&o.patch(R(e.id),{enabled:!0,settings:{[s.key]:n}})}const Q={new_issue:"New issue",regressed_issue:"Regressed or reopened issue",resolved_issue:"Issue resolved",ignored_issue:"Issue ignored",assigned_issue:"Issue assigned",threshold:"Threshold exceeded",quota:"Quota reached"};function ae(e,s){const n=e.filters??{};return[...(s[e.application_id]??[]).filter(a=>(n.environment_ids??[]).includes(a.id)).map(a=>a.name),...n.kinds??[],n.min_priority?`>= ${n.min_priority}`:null,n.title_pattern].filter(Boolean).join(" · ")}function Ke(e){const s=G.c(40),[n,q]=D.useState("slack"),[a,X]=D.useState(e.application_options[0]?.id);let j,f;s[0]===Symbol.for("react.memo_cache_sentinel")?(j=[{title:"Integrations",href:T()}],f=t.jsx(V,{title:"Integrations"}),s[0]=j,s[1]=f):(j=s[0],f=s[1]);let _;s[2]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsxs("div",{children:[t.jsx("h1",{className:"text-xl font-semibold",children:"Integrations and alerts"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"Where alerts go, and which events trigger them per application."})]}),s[2]=_):_=s[2];let b;s[3]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add integration"})}),s[3]=b):b=s[3];let k;s[4]===Symbol.for("react.memo_cache_sentinel")?(k=T(),s[4]=k):k=s[4];let d;s[5]!==n||s[6]!==e.kinds||s[7]!==e.linear_oauth_enabled?(d=t.jsxs(M,{children:[b,t.jsx(W,{children:t.jsx(z,{method:"post",action:k,className:"space-y-3",resetOnSuccess:!0,children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"kind",children:"Kind"}),t.jsx("select",{id:"kind",name:"kind",value:n,onChange:P=>q(P.target.value),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.kinds.map(Ce)})]}),!(n==="linear"&&e.linear_oauth_enabled)&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"name",children:"Name"}),t.jsx(l,{id:"name",name:"name",required:!0,placeholder:"#alerts"}),t.jsx(O,{messages:L.name})]}),n==="email"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"to",children:"Send to"}),t.jsx(l,{id:"to",name:"settings[to]",type:"email",required:!0})]}),n==="slack"&&t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"webhook_url",children:"Incoming webhook URL"}),t.jsx(l,{id:"webhook_url",name:"settings[webhook_url]",type:"url",required:!0,placeholder:"https://hooks.slack.com/services/…"})]}),n==="webhook"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"url",children:"URL"}),t.jsx(l,{id:"url",name:"settings[url]",type:"url",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"secret",children:"Signing secret (optional)"}),t.jsx(l,{id:"secret",name:"settings[secret]"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Sent as X-Railwatch-Signature: sha256=HMAC(body)."})]})]}),n==="linear"&&e.linear_oauth_enabled&&t.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border p-3",children:[t.jsx("p",{className:"text-sm",children:"Linear uses OAuth to discover your workspace and teams. Connect your workspace, then select a team."}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Railwatch names the integration from the Linear workspace."})]}),n==="linear"&&!e.linear_oauth_enabled&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"api_key",children:"API key"}),t.jsx(l,{id:"api_key",name:"settings[api_key]",required:!0})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"team_id",children:"Team ID"}),t.jsx(l,{id:"team_id",name:"settings[team_id]",required:!0})]})]}),t.jsx(O,{messages:L.settings}),n==="linear"&&e.linear_oauth_enabled?t.jsx(i,{type:"button",onClick:Se,children:"Connect Linear workspace"}):t.jsx(i,{disabled:A,children:"Add"})]})}})})]}),s[5]=n,s[6]=e.kinds,s[7]=e.linear_oauth_enabled,s[8]=d):d=s[8];let v;s[9]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(H,{children:t.jsx(B,{className:"text-sm",children:"Add alert rule"})}),s[9]=v):v=s[9];let y;s[10]===Symbol.for("react.memo_cache_sentinel")?(y=J(),s[10]=y):y=s[10];let c;s[11]!==a||s[12]!==e.application_options||s[13]!==e.environment_options||s[14]!==e.events||s[15]!==e.integrations||s[16]!==e.issue_kinds||s[17]!==e.priorities?(c=t.jsxs(M,{children:[v,t.jsx(W,{children:t.jsx(z,{method:"post",action:y,className:"space-y-3",children:g=>{const{errors:L,processing:A}=g;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"application_id",children:"Application"}),t.jsx("select",{id:"application_id",name:"application_id",value:a??"",onChange:P=>X(Number(P.target.value)),className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.application_options.map(we)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"event",children:"When"}),t.jsx("select",{id:"event",name:"event",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.events.map(Ne)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"integration_id",children:"Notify"}),t.jsx("select",{id:"integration_id",name:"integration_id",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:e.integrations.map(ye)})]}),t.jsxs("div",{className:"space-y-3 border-t pt-3",children:[t.jsx("p",{className:"label-caps",children:"Only notify when (optional)"}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Environments"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:(e.environment_options[a??0]??[]).map(ve)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx("span",{className:"text-sm",children:"Issue kinds"}),t.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2",children:e.issue_kinds.map(ke)})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"min_priority",children:"Minimum priority"}),t.jsxs("select",{id:"min_priority",name:"filters[min_priority]",className:"border-input h-9 rounded-md border bg-transparent px-2 text-sm",children:[t.jsx("option",{value:"",children:"any"}),e.priorities.map(be)]})]}),t.jsxs("div",{className:"grid gap-1",children:[t.jsx(r,{htmlFor:"title_pattern",children:"Title matches"}),t.jsx(l,{id:"title_pattern",name:"filters[title_pattern]",placeholder:"timeout, or /Redis.*timeout/"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Case-insensitive substring, or a regular expression when wrapped in slashes."})]})]}),t.jsx(O,{messages:L.event}),t.jsx(i,{disabled:A||e.integrations.length===0,children:"Add rule"})]})}})})]}),s[11]=a,s[12]=e.application_options,s[13]=e.environment_options,s[14]=e.events,s[15]=e.integrations,s[16]=e.issue_kinds,s[17]=e.priorities,s[18]=c):c=s[18];let m;s[19]!==d||s[20]!==c?(m=t.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[d,c]}),s[19]=d,s[20]=c,s[21]=m):m=s[21];let N;s[22]===Symbol.for("react.memo_cache_sentinel")?(N=[{key:"n",header:"Integration",cell:fe},{key:"k",header:"Kind",cell:je},{key:"s",header:"Destination",cell:ge},{key:"d",header:"Health",hideOnMobile:!0,cell:xe},{key:"e",header:"",cell:pe},{key:"x",header:"",align:"right",cell:he}],s[22]=N):N=s[22];let h;s[23]!==e.integrations?(h=t.jsx(E,{rows:e.integrations,rowKey:_e,empty:"No integrations yet.",columns:N}),s[23]=e.integrations,s[24]=h):h=s[24];let w,S,C;s[25]===Symbol.for("react.memo_cache_sentinel")?(w={key:"a",header:"Application",cell:ce},S={key:"e",header:"When",cell:de},C={key:"i",header:"Notify",cell:oe},s[25]=w,s[26]=S,s[27]=C):(w=s[25],S=s[26],C=s[27]);let u;s[28]!==e.environment_options?(u={key:"f",header:"Only when",hideOnMobile:!0,cell:g=>t.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:ae(g,e.environment_options)||"—"})},s[28]=e.environment_options,s[29]=u):u=s[29];let I;s[30]===Symbol.for("react.memo_cache_sentinel")?(I={key:"x",header:"",align:"right",cell:le},s[30]=I):I=s[30];let p;s[31]!==u?(p=[w,S,C,u,I],s[31]=u,s[32]=p):p=s[32];let x;s[33]!==e.alert_rules||s[34]!==p?(x=t.jsx(E,{rows:e.alert_rules,rowKey:me,empty:"No alert rules yet.",columns:p}),s[33]=e.alert_rules,s[34]=p,s[35]=x):x=s[35];let F;return s[36]!==h||s[37]!==x||s[38]!==m?(F=t.jsxs(ne,{breadcrumbs:j,children:[f,t.jsxs("div",{className:"flex flex-1 flex-col gap-6 p-4 md:p-6",children:[_,m,h,x]})]}),s[36]=h,s[37]=x,s[38]=m,s[39]=F):F=s[39],F}function le(e){return t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(te(e.id)),children:"Remove"})}function oe(e){return e.integration}function de(e){return Q[e.event]??e.event}function ce(e){return e.application}function me(e){return e.id}function he(e){return t.jsxs("span",{className:"flex flex-wrap justify-end gap-1",children:[e.kind==="linear"&&(e.settings.team_options?.length??0)>0&&t.jsxs("select",{"aria-label":`Linear team for ${e.name}`,value:e.settings.team_id??"",onChange:s=>o.patch(R(e.id),{enabled:!0,settings:{team_id:s.target.value}}),className:"border-input h-8 rounded-md border bg-transparent px-2 text-xs",children:[t.jsx("option",{value:"",children:"Select team…"}),e.settings.team_options?.map(ue)]}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.post(Z(e.id),{},{preserveScroll:!0}),children:"Send test"}),$[e.kind]&&!(e.kind==="linear"&&e.settings.oauth)&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>ie(e),children:"Rotate"}),e.kind==="linear"&&e.settings.oauth&&e.settings.credential&&t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.delete(ee(e.id)),children:"Disconnect"}),t.jsx(i,{size:"sm",variant:"ghost",onClick:()=>o.patch(R(e.id),{enabled:!e.enabled}),children:e.enabled?"Disable":"Enable"}),t.jsx(i,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>o.delete(R(e.id)),children:"Remove"})]})}function ue(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.key,")"]},e.id)}function pe(e){return e.enabled?null:t.jsx(K,{variant:"secondary",children:"disabled"})}function xe(e){return t.jsxs("span",{className:"flex flex-col gap-0.5",children:[t.jsxs("span",{className:"text-muted-foreground text-xs",children:[e.kind==="linear"?"Last sync ":"Last delivery ",t.jsx(se,{iso:e.kind==="linear"?e.last_synced_at:e.last_delivered_at})]}),e.kind==="linear"&&e.webhook_health&&t.jsxs("span",{className:"text-muted-foreground text-xs",children:["Webhooks: ",e.webhook_health.pending," pending ·"," ",e.webhook_health.failed," failed"]}),e.last_error&&t.jsx("span",{className:"text-destructive max-w-64 truncate text-xs",title:e.last_error,children:e.last_error})]})}function ge(e){return t.jsx("span",{className:"font-mono text-xs",title:re[e.kind],children:e.destination??"—"})}function je(e){return t.jsx(K,{variant:"outline",children:e.kind})}function fe(e){return t.jsx("span",{className:"font-medium",children:e.name})}function _e(e){return e.id}function be(e){return t.jsx("option",{value:e,children:e},e)}function ke(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[kinds][]",value:e}),e]},e)}function ve(e){return t.jsxs(r,{className:"text-muted-foreground gap-1.5 font-normal",children:[t.jsx(U,{name:"filters[environment_ids][]",value:String(e.id)}),e.name]},e.id)}function ye(e){return t.jsxs("option",{value:e.id,children:[e.name," (",e.kind,")"]},e.id)}function Ne(e){return t.jsx("option",{value:e,children:Q[e]??e},e)}function we(e){return t.jsx("option",{value:e.id,children:e.name},e.id)}function Se(){return o.post(Y())}function Ce(e){return t.jsx("option",{value:e,children:e},e)}export{Ke as default};