@coffre/ui 0.1.11 → 0.1.13

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 (122) hide show
  1. package/dist/client/_coffre/assets/account-CyJDFhek.js +2 -0
  2. package/dist/client/_coffre/assets/account-DHSs5h2f.js +1 -0
  3. package/dist/client/_coffre/assets/affordances-BQD5B421.js +1 -0
  4. package/dist/client/_coffre/assets/audit-Bcyp_dU1.js +2 -0
  5. package/dist/client/_coffre/assets/audit-rMy9mU9Q.js +1 -0
  6. package/dist/client/_coffre/assets/auth.device-DuvaComb.js +1 -0
  7. package/dist/client/_coffre/assets/{auth.device-CWHNQn9W.js → auth.device-yBt_sLZW.js} +2 -2
  8. package/dist/client/_coffre/assets/directory-C4BMGC7-.js +1 -0
  9. package/dist/client/_coffre/assets/dist-BNkBTkxj.js +1 -0
  10. package/dist/client/_coffre/assets/{globals-CKBoTlyH.css → globals-BJkzu6T5.css} +1 -1
  11. package/dist/client/_coffre/assets/{grants-CjoOnxzz.js → grants-CyDW25eX.js} +1 -1
  12. package/dist/client/_coffre/assets/icons-BRl8DlXW.js +1 -0
  13. package/dist/client/_coffre/assets/{index-CUGytaO3.js → index-CA1mtrIx.js} +5 -5
  14. package/dist/client/_coffre/assets/link-CqlAJWBd.js +1 -0
  15. package/dist/client/_coffre/assets/login-B73b6bsJ.js +1 -0
  16. package/dist/client/_coffre/assets/login-BO1KAGPU.js +2 -0
  17. package/dist/client/_coffre/assets/offboarding--5vSKNHv.js +1 -0
  18. package/dist/client/_coffre/assets/page-Dngv8FMr.js +1 -0
  19. package/dist/client/_coffre/assets/preload-helper-DBha3tys.js +1 -0
  20. package/dist/client/_coffre/assets/principal-page-C4qDD-d8.js +1 -0
  21. package/dist/client/_coffre/assets/projects._project._environment-eBKxOZ0_.js +2 -0
  22. package/dist/client/_coffre/assets/projects._project._environment-or_AX6o5.js +3 -0
  23. package/dist/client/_coffre/assets/projects._project.index-DHdXfEh-.js +2 -0
  24. package/dist/client/_coffre/assets/projects._project.index-iynQgenH.js +1 -0
  25. package/dist/client/_coffre/assets/projects.index-CGW8mRil.js +1 -0
  26. package/dist/client/_coffre/assets/row-state-BlarvG7E.js +1 -0
  27. package/dist/client/_coffre/assets/{settings-D2zp1Ssu.js → settings-D-7RJIDf.js} +1 -1
  28. package/dist/client/_coffre/assets/suspense-q_eJaZ18.js +1 -0
  29. package/dist/client/_coffre/assets/tokens._token-0u7midqA.js +2 -0
  30. package/dist/client/_coffre/assets/tokens._token-C53NqScg.js +1 -0
  31. package/dist/client/_coffre/assets/{tokens.index-CSi5Wxwf.js → tokens.index-DBZTLnbi.js} +1 -1
  32. package/dist/client/_coffre/assets/{ui-BdipqGpP.js → ui-BPWFJNz7.js} +3 -3
  33. package/dist/client/_coffre/assets/{unregistered-CA7B4C1m.js → unregistered-CLhgtwUt.js} +1 -1
  34. package/dist/client/_coffre/assets/use-action-LULgF26O.js +1 -0
  35. package/dist/client/_coffre/assets/{use-change-BRRMJocl.js → use-change-Bd6NZJj9.js} +1 -1
  36. package/dist/client/_coffre/assets/use-shell-Dx92Huhb.js +1 -0
  37. package/dist/client/_coffre/assets/useQuery-BIIZz1CB.js +1 -0
  38. package/dist/client/_coffre/assets/useSuspenseQuery-tP9HFZ8w.js +1 -0
  39. package/dist/client/_coffre/assets/users._user-BXtaL8Ee.js +2 -0
  40. package/dist/client/_coffre/assets/users._user-CNYVkXaY.js +1 -0
  41. package/dist/client/_coffre/assets/{users.index-CKnQ1G76.js → users.index-Cs9tibIv.js} +1 -1
  42. package/dist/server/.vite/manifest.json +205 -206
  43. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js +162 -0
  44. package/dist/server/_coffre/assets/{account-BocTPU1J.js → account-BUhhOS5-.js} +8 -8
  45. package/dist/server/_coffre/assets/{account-CL8hOGhO.js → account-B_h55GCs.js} +4 -4
  46. package/dist/server/_coffre/assets/{audit-Bcka4vA6.js → audit-B8Ck358-.js} +6 -6
  47. package/dist/server/_coffre/assets/{audit-CSRQYIhu.js → audit-DFsXfeAQ.js} +2 -2
  48. package/dist/server/_coffre/assets/{auth.device-DqO0T-rU.js → auth.device-BXf_JjT7.js} +2 -2
  49. package/dist/server/_coffre/assets/{auth.device-CMcUISZY.js → auth.device-cqjWACvB.js} +4 -4
  50. package/dist/server/_coffre/assets/{directory-CyYx6Jx1.js → directory-C9SfNgpM.js} +5 -5
  51. package/dist/server/_coffre/assets/{globals-CKBoTlyH.css → globals-BJkzu6T5.css} +1 -1
  52. package/dist/server/_coffre/assets/{grants-CRijabX0.js → grants--315KmXu.js} +5 -5
  53. package/dist/server/_coffre/assets/{icons-Dy-5ccDF.js → icons-CWsTEfpn.js} +123 -241
  54. package/dist/server/_coffre/assets/{login-BI9tzJEy.js → login-CQSkYW_D.js} +5 -5
  55. package/dist/server/_coffre/assets/{login-C-v88YwP.js → login-LBpXXfsQ.js} +1 -1
  56. package/dist/server/_coffre/assets/{offboarding-1H0LavTd.js → offboarding-CykelNis.js} +9 -79
  57. package/dist/server/_coffre/assets/{page-D_mO0-sn.js → page-BGeDoQO5.js} +3 -64
  58. package/dist/server/_coffre/assets/{principal-page-DQDoXute.js → principal-page-CRdoAQOq.js} +11 -11
  59. package/dist/server/_coffre/assets/{projects._project._environment-D_5R40of.js → projects._project._environment-BXU1Mee5.js} +3 -3
  60. package/dist/server/_coffre/assets/{projects._project._environment-C-yVwC92.js → projects._project._environment-BrDqn8kW.js} +11 -550
  61. package/dist/server/_coffre/assets/{projects._project.index-A2BImFIT.js → projects._project.index-CAxBU4tY.js} +12 -12
  62. package/dist/server/_coffre/assets/{projects._project.index-BPPKxKrt.js → projects._project.index-CYyUVTCl.js} +2 -2
  63. package/dist/server/_coffre/assets/{projects.index-543IsPzY.js → projects.index-D6ZoDE_0.js} +7 -7
  64. package/dist/server/_coffre/assets/{router-CM3vK8QO.js → router-Bu2qtyqw.js} +20 -20
  65. package/dist/server/_coffre/assets/{row-state-XBtDoIA4.js → row-state-CAItu3n_.js} +2 -2
  66. package/dist/server/_coffre/assets/{settings-BLVU74ym.js → settings-ByeF6hBa.js} +3 -3
  67. package/dist/server/_coffre/assets/{suspense-CzYTwxOj.js → suspense-beD01bb8.js} +1 -1
  68. package/dist/server/_coffre/assets/{tokens._token-B-hBgwBW.js → tokens._token-CM01QPCq.js} +2 -2
  69. package/dist/server/_coffre/assets/{tokens._token-aubAUonP.js → tokens._token-D2E4P3Qc.js} +10 -10
  70. package/dist/server/_coffre/assets/{tokens.index-4D3jwp5v.js → tokens.index-Cmrgn3mU.js} +6 -6
  71. package/dist/server/_coffre/assets/{ui-BI3Bf72q.js → ui-DvlGkmaH.js} +1 -1
  72. package/dist/server/_coffre/assets/{unregistered-CagDxMyw.js → unregistered-DSArejP9.js} +3 -3
  73. package/dist/server/_coffre/assets/{use-action-tzBZvjjQ.js → use-action-C2wz34kq.js} +2 -2
  74. package/dist/server/_coffre/assets/{use-change-Dggqxy5y.js → use-change-CJpGSNIq.js} +3 -3
  75. package/dist/server/_coffre/assets/{use-shell-CwStDfzX.js → use-shell-C3iYcyP1.js} +2 -2
  76. package/dist/server/_coffre/assets/{useQuery-C6_dBjem.js → useQuery-ChxaQ4Cb.js} +2 -2
  77. package/dist/server/_coffre/assets/{useSuspenseQuery-BuapQt_P.js → useSuspenseQuery-BjAmlGZl.js} +2 -2
  78. package/dist/server/_coffre/assets/{users._user-C252Iilj.js → users._user-BVeR9fZP.js} +2 -2
  79. package/dist/server/_coffre/assets/{users._user-137WNyxn.js → users._user-Cih2Etf4.js} +2 -2
  80. package/dist/server/_coffre/assets/{users.index-DQHsfnal.js → users.index-Bo2_a95G.js} +6 -6
  81. package/dist/server/index.js +2 -2
  82. package/package.json +3 -3
  83. package/src/components/icons.tsx +0 -34
  84. package/src/components/offboarding.tsx +1 -52
  85. package/src/lib/coffre.ts +1 -1
  86. package/src/lib/queries.ts +2 -10
  87. package/src/routes/projects.$project.$environment.tsx +1 -11
  88. package/src/shared/models.ts +1 -5
  89. package/src/styles/globals.css +2 -49
  90. package/dist/client/_coffre/assets/account-BJAdDvZf.js +0 -2
  91. package/dist/client/_coffre/assets/account-D0jLpk5c.js +0 -1
  92. package/dist/client/_coffre/assets/affordances-Bq2-oUB5.js +0 -1
  93. package/dist/client/_coffre/assets/audit-C-pcBgKe.js +0 -2
  94. package/dist/client/_coffre/assets/audit-CHGlDeBB.js +0 -1
  95. package/dist/client/_coffre/assets/auth.device-BndOUjse.js +0 -1
  96. package/dist/client/_coffre/assets/directory-nDExpkAz.js +0 -1
  97. package/dist/client/_coffre/assets/dist-QVHMLatb.js +0 -1
  98. package/dist/client/_coffre/assets/icons-BQ27Ds9u.js +0 -1
  99. package/dist/client/_coffre/assets/link-DP8SVWon.js +0 -1
  100. package/dist/client/_coffre/assets/login-CeaxDMcr.js +0 -2
  101. package/dist/client/_coffre/assets/login-DrMgvqZn.js +0 -1
  102. package/dist/client/_coffre/assets/offboarding-CNr_1tnl.js +0 -1
  103. package/dist/client/_coffre/assets/page-CGmvjSy4.js +0 -1
  104. package/dist/client/_coffre/assets/preload-helper-ClBkJ19f.js +0 -1
  105. package/dist/client/_coffre/assets/principal-page-DNLb_q_e.js +0 -1
  106. package/dist/client/_coffre/assets/projects._project._environment-CHzbboGp.js +0 -3
  107. package/dist/client/_coffre/assets/projects._project._environment-DDxu_HHD.js +0 -2
  108. package/dist/client/_coffre/assets/projects._project.index-CIAsjvg6.js +0 -2
  109. package/dist/client/_coffre/assets/projects._project.index-DZ9l6d-1.js +0 -1
  110. package/dist/client/_coffre/assets/projects.index-4eUXreE_.js +0 -1
  111. package/dist/client/_coffre/assets/row-state-ByET1OKX.js +0 -1
  112. package/dist/client/_coffre/assets/suspense-C7KwSnTG.js +0 -1
  113. package/dist/client/_coffre/assets/tokens._token-DWmbqzNk.js +0 -2
  114. package/dist/client/_coffre/assets/tokens._token-Dui_4KfS.js +0 -1
  115. package/dist/client/_coffre/assets/use-action-DRm9yVhV.js +0 -1
  116. package/dist/client/_coffre/assets/use-shell-BMGlJ25Q.js +0 -1
  117. package/dist/client/_coffre/assets/useQuery-D__2KBOs.js +0 -1
  118. package/dist/client/_coffre/assets/useSuspenseQuery-CSXyDALB.js +0 -1
  119. package/dist/client/_coffre/assets/users._user-BkNrX7Qf.js +0 -1
  120. package/dist/client/_coffre/assets/users._user-jbSvtdOg.js +0 -2
  121. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-Dx-c3XVk.js +0 -162
  122. package/src/components/syncs.tsx +0 -597
@@ -3911,38 +3911,6 @@ a.env-card-name:hover {
3911
3911
  grid-template-areas: none;
3912
3912
  }
3913
3913
 
3914
- /* Syncs: the destination and its actions on one line, the state beneath,
3915
- and an error, when there is one, under both. */
3916
- .dt.syncs.stacks tr {
3917
- grid-template-areas:
3918
- 'destination actions'
3919
- 'status status';
3920
- align-items: center;
3921
- }
3922
-
3923
- .dt.syncs.stacks td.col-destination {
3924
- grid-area: destination;
3925
- }
3926
-
3927
- .dt.syncs.stacks td.col-status {
3928
- grid-area: status;
3929
- padding-left: 1.5rem;
3930
- }
3931
-
3932
- .dt.syncs.stacks td.col-actions {
3933
- grid-area: actions;
3934
- }
3935
-
3936
- .dt.syncs.stacks tr.has-error {
3937
- padding-bottom: 0.25rem;
3938
- border-bottom: 0;
3939
- }
3940
-
3941
- .dt.syncs.stacks tr.row-error {
3942
- grid-template-areas: none;
3943
- padding-top: 0;
3944
- }
3945
-
3946
3914
  /* Secrets: key, version and actions on one line, the value beneath. */
3947
3915
  .dt.secrets.stacks tr.secret-row {
3948
3916
  grid-template-columns: minmax(0, 1fr) auto auto;
@@ -4126,15 +4094,10 @@ a.env-card-name:hover {
4126
4094
  }
4127
4095
 
4128
4096
  /* ========================================================================== */
4129
- /* Syncs */
4097
+ /* Form options */
4130
4098
  /* ========================================================================== */
4131
4099
 
4132
- /* Four providers read best as a square than as a row of three and one. */
4133
- .choice-grid.sync-providers {
4134
- grid-template-columns: repeat(2, minmax(0, 1fr));
4135
- }
4136
-
4137
- /* A provider's options keep their width, taking a line of their own rather
4100
+ /* A field's options keep their width, taking a line of their own rather
4138
4101
  than being squeezed, and wrap only when a line cannot hold them. */
4139
4102
  .form-row > .field-options {
4140
4103
  flex: 0 1 auto;
@@ -4144,16 +4107,6 @@ a.env-card-name:hover {
4144
4107
  flex-wrap: wrap;
4145
4108
  }
4146
4109
 
4147
- .sync-providers-state {
4148
- margin-top: 1.25rem;
4149
- }
4150
-
4151
- /* A sync's state tag sits above its counts at its own width, not the column's. */
4152
- .syncs .cell-stack {
4153
- align-items: flex-start;
4154
- gap: 0.25rem;
4155
- }
4156
-
4157
4110
  /* ========================================================================== */
4158
4111
  /* Offboarding report */
4159
4112
  /* ========================================================================== */
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/account-D0jLpk5c.js","_coffre/assets/page-CGmvjSy4.js","_coffre/assets/use-change-BRRMJocl.js","_coffre/assets/suspense-C7KwSnTG.js","_coffre/assets/row-state-ByET1OKX.js","_coffre/assets/ui-BdipqGpP.js","_coffre/assets/link-DP8SVWon.js","_coffre/assets/icons-BQ27Ds9u.js","_coffre/assets/use-shell-BMGlJ25Q.js","_coffre/assets/directory-nDExpkAz.js","_coffre/assets/signin-errors-CroZWZgm.js"])))=>i.map(i=>d[i]);
2
- import{U as e,Z as t,et as n,f as r,h as i}from"./page-CGmvjSy4.js";import{n as a,r as o,t as s}from"./preload-helper-ClBkJ19f.js";import{h as c}from"./ui-BdipqGpP.js";import{B as l,E as u,T as d,a as f}from"./icons-BQ27Ds9u.js";var p=n(t(),1),m=e(),h=`coffre-theme`,g=`coffre-theme-change`,_=`(function(){try{var t=localStorage.getItem(${JSON.stringify(h)});if(t==="light"||t==="dark"){document.documentElement.setAttribute("data-theme",t)}}catch(e){}})()`;function v(){try{let e=localStorage.getItem(h);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function y(e){let t=document.documentElement;try{e===`system`?localStorage.removeItem(h):localStorage.setItem(h,e)}catch{}e===`system`?t.removeAttribute(`data-theme`):t.setAttribute(`data-theme`,e),window.dispatchEvent(new CustomEvent(g))}var b=[{value:`system`,label:`Match system`,Icon:d},{value:`light`,label:`Light`,Icon:l},{value:`dark`,label:`Dark`,Icon:u}];function x(){let[e,t]=(0,p.useState)(`system`);return(0,p.useEffect)(()=>{let e=()=>t(v());return e(),window.addEventListener(g,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(g,e),window.removeEventListener(`storage`,e)}},[]),e}function S(){let e=x();return(0,m.jsx)(c.RadioGroup,{value:e,onValueChange:e=>y(e),children:b.map(({value:e,label:t,Icon:n})=>(0,m.jsxs)(c.RadioItem,{value:e,className:`menu-item`,children:[(0,m.jsx)(n,{size:15}),t,(0,m.jsx)(c.ItemIndicator,{className:`menu-check`,children:(0,m.jsx)(f,{size:14})})]},e))})}function C(){let e=x();return(0,m.jsx)(`div`,{className:`theme-choice`,role:`group`,"aria-label":`Colour scheme`,children:b.map(({value:t,label:n,Icon:r})=>(0,m.jsx)(`button`,{type:`button`,"aria-pressed":e===t,"aria-label":n,title:n,onClick:()=>y(t),children:(0,m.jsx)(r,{size:14})},t))})}function w(e){y(e)}function T(){let e=x();return(0,m.jsx)(`div`,{className:`choice-grid`,role:`group`,"aria-label":`Colour scheme`,children:b.map(({value:t,label:n,Icon:r})=>(0,m.jsxs)(`button`,{type:`button`,className:`choice`,"aria-pressed":e===t,onClick:()=>y(t),children:[(0,m.jsx)(r,{size:16}),n]},t))})}var E=o(`/account`)({validateSearch:e=>{let t={};for(let n of[`linked`,`error`]){let r=e[n];typeof r==`string`&&/^[a-z0-9_-]{1,40}$/.test(r)&&(t[n]=r)}return t},loader:async({context:{client:e,queryClient:t}})=>{let n=await r(t,e);n.auth.signin===null||n.principal?.type!==`user`||await Promise.all([t.fetchQuery(i.identities(e)),t.fetchQuery(i.sessions(e))])},component:a(()=>s(()=>import(`./account-D0jLpk5c.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),`component`)});export{w as a,C as i,T as n,_ as o,S as r,E as t};
@@ -1 +0,0 @@
1
- import{C as e,U as t,Z as n,et as r,h as i,i as a,r as o,t as s}from"./page-CGmvjSy4.js";import{S as c,n as l,t as u,u as d}from"./use-change-BRRMJocl.js";import{n as f,t as p}from"./use-shell-BMGlJ25Q.js";import{a as m,i as h,l as g,s as _,t as v}from"./ui-BdipqGpP.js";import{J as y,N as b,R as x,T as S,U as C}from"./icons-BQ27Ds9u.js";import{n as w,t as T}from"./account-BJAdDvZf.js";import{a as E,i as D,r as O}from"./row-state-ByET1OKX.js";import{r as k}from"./directory-nDExpkAz.js";import{t as A}from"./signin-errors-CroZWZgm.js";var j=r(n()),M=t();function N(){let{principal:e,instanceRole:t,auth:n}=p();return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a,{title:`Account`,actions:e!==null&&(0,M.jsx)(F,{})}),(0,M.jsx)(s,{labelledBy:`appearance`,title:`Appearance`,children:(0,M.jsx)(`div`,{className:`card-body`,children:(0,M.jsx)(w,{})})}),e!==null&&(0,M.jsx)(s,{labelledBy:`identity`,title:`Identity`,children:(0,M.jsxs)(`dl`,{className:`facts`,children:[(0,M.jsx)(o,{label:e.type===`user`?`Email`:`Name`,children:(0,M.jsx)(`span`,{className:`mono`,children:e.id})}),(0,M.jsx)(o,{label:`Kind`,children:e.type===`user`?`User`:`Token`}),e.type===`user`&&(0,M.jsx)(o,{label:`Instance role`,children:(0,M.jsx)(k,{principal:{principalType:`user`,principalId:e.id,instanceRole:t??`user`,isRootAdmin:t===`root-admin`}})})]})}),n.signin!==null&&e?.type===`user`&&(0,M.jsx)(P,{email:e.id,providers:n.signin.providers})]})}function P({email:t,providers:n}){let r=e(),[{data:a},{data:o}]=f({queries:[i.identities(r),i.sessions(r)]});return a.ok?o.ok?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(L,{email:t,providers:n,identities:a.identities}),(0,M.jsx)(R,{sessions:o.sessions,providers:n})]}):(0,M.jsx)(m,{error:o.error}):(0,M.jsx)(m,{error:a.error})}function F(){return(0,M.jsx)(`form`,{method:`post`,action:`/auth/signout`,children:(0,M.jsxs)(`button`,{className:`btn`,type:`submit`,children:[(0,M.jsx)(x,{size:14}),`Sign out`]})})}function I(e,t){return e.find(e=>e.id===t)?.label??t??`unknown`}function L({email:t,providers:n,identities:r}){let{linked:i,error:a}=T.useSearch(),o=A(a),d=c(e()),f=u(d),{status:p,dismiss:x}=l(d.list.queryKey);return(0,M.jsxs)(s,{labelledBy:`signin-accounts`,title:`Sign-in accounts`,description:`coffre recognises you by these accounts, never by an email address alone. A new account is linked here, while you are signed in.`,children:[(i!==void 0||o!==null)&&(0,M.jsxs)(`div`,{className:`card-body`,children:[i!==void 0&&(0,M.jsxs)(_,{tone:`good`,children:[I(n,i),` account linked.`]}),(0,M.jsx)(m,{error:o})]}),r.length===0?(0,M.jsxs)(h,{title:`No account linked`,children:[`Your next sign-in with a verified `,(0,M.jsx)(`span`,{className:`mono`,children:t}),` links that account.`]}):(0,M.jsx)(`div`,{className:`dt-wrap`,children:(0,M.jsxs)(`table`,{className:`dt`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:`Account`}),(0,M.jsx)(`th`,{className:`col-shrink`,children:`Linked (UTC)`}),(0,M.jsx)(`th`,{className:`col-shrink`,children:`Last sign-in`}),(0,M.jsx)(`th`,{className:`col-actions`,children:(0,M.jsx)(`span`,{className:`visually-hidden`,children:`Actions`})})]})}),(0,M.jsx)(`tbody`,{children:r.map(e=>{let i=I(n,e.provider),a=n.find(t=>t.id===e.provider)?.brand??`oidc`,o=p(e.id);return(0,M.jsxs)(j.Fragment,{children:[(0,M.jsxs)(`tr`,{className:E(o),children:[(0,M.jsx)(`td`,{children:(0,M.jsxs)(`span`,{className:`cell-account`,children:[(0,M.jsx)(b,{brand:a}),(0,M.jsxs)(`span`,{className:`cell-stack`,children:[(0,M.jsx)(`span`,{children:i}),e.email!==null&&(0,M.jsx)(`small`,{className:`mono`,children:e.email})]})]})}),(0,M.jsx)(`td`,{className:`nowrap`,children:(0,M.jsx)(g,{iso:e.createdAt})}),(0,M.jsx)(`td`,{className:`nowrap cell-muted`,children:e.lastSignInAt===null?`Never`:(0,M.jsx)(g,{iso:e.lastSignInAt,display:`relative`})}),(0,M.jsx)(`td`,{className:`col-actions`,children:o.state===`pending`?(0,M.jsx)(D,{status:o}):(0,M.jsx)(v,{trigger:(0,M.jsxs)(`button`,{className:`act`,children:[(0,M.jsx)(y,{size:13}),`Unlink`]}),title:`Unlink this ${i} account?`,body:r.length===1?(0,M.jsxs)(M.Fragment,{children:[`It stops signing you in, and every session it opened ends now, this one included if you signed in with it. Your next sign-in with any account whose verified email is`,` `,(0,M.jsx)(`span`,{className:`mono`,children:t}),` links that account instead.`]}):(0,M.jsx)(M.Fragment,{children:`It stops signing you in, and every session it opened ends now, this one included if you signed in with it.`}),confirmLabel:`Unlink`,onConfirm:()=>f({...e,label:i})})})]}),(0,M.jsx)(O,{status:o,columns:4,onDismiss:()=>o.state===`failed`&&x(o.mutationId)})]},e.id)})})]})}),n.length>0&&(0,M.jsxs)(`div`,{className:`card-foot`,children:[(0,M.jsx)(`span`,{className:`hint`,children:`Link another account`}),(0,M.jsx)(`div`,{className:`link-providers`,children:n.map(e=>(0,M.jsxs)(`a`,{className:`btn btn-sm`,href:`/auth/signin/${encodeURIComponent(e.id)}?link=1`,children:[(0,M.jsx)(b,{brand:e.brand,size:14}),e.label]},e.id))})]})]})}function R({sessions:t,providers:n}){let r=d(e()),i=u(r),{status:a,dismiss:o}=l(r.list.queryKey);return(0,M.jsx)(s,{labelledBy:`sessions`,title:`Sessions`,description:`Browsers and command lines signed in as you. Ending one signs it out at its next request.`,children:t.length===0?(0,M.jsx)(h,{title:`No sessions`,children:`Nothing is signed in as you right now.`}):(0,M.jsx)(`div`,{className:`dt-wrap`,children:(0,M.jsxs)(`table`,{className:`dt`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:`Where`}),(0,M.jsx)(`th`,{className:`col-shrink`,children:`Last active`}),(0,M.jsx)(`th`,{className:`col-shrink`,children:`Expires`}),(0,M.jsx)(`th`,{className:`col-actions`,children:(0,M.jsx)(`span`,{className:`visually-hidden`,children:`Actions`})})]})}),(0,M.jsx)(`tbody`,{children:t.map(e=>{let t=a(e.id);return(0,M.jsxs)(j.Fragment,{children:[(0,M.jsxs)(`tr`,{className:E(t),children:[(0,M.jsx)(`td`,{children:(0,M.jsxs)(`span`,{className:`cell-account`,children:[e.kind===`cli`?(0,M.jsx)(C,{size:15}):(0,M.jsx)(S,{size:15}),(0,M.jsxs)(`span`,{className:`cell-stack`,children:[(0,M.jsxs)(`span`,{children:[e.label??(e.kind===`cli`?`Command line`:`Browser`),` `,e.current&&(0,M.jsx)(`span`,{className:`tag tag-blue`,children:`this browser`})]}),(0,M.jsxs)(`small`,{children:[e.kind===`cli`?`coffre login`:`via ${I(n,e.provider)}`,e.lastUsedIp!==null&&(0,M.jsxs)(M.Fragment,{children:[` · `,(0,M.jsx)(`span`,{className:`mono`,children:e.lastUsedIp})]})]})]})]})}),(0,M.jsx)(`td`,{className:`nowrap cell-muted`,children:(0,M.jsx)(g,{iso:e.lastUsedAt??e.createdAt,display:`relative`})}),(0,M.jsx)(`td`,{className:`nowrap cell-muted`,children:(0,M.jsx)(g,{iso:e.expiresAt,display:`relative`})}),(0,M.jsx)(`td`,{className:`col-actions`,children:e.current?(0,M.jsx)(`form`,{method:`post`,action:`/auth/signout`,children:(0,M.jsxs)(`button`,{className:`act`,type:`submit`,children:[(0,M.jsx)(x,{size:13}),`Sign out`]})}):t.state===`pending`?(0,M.jsx)(D,{status:t}):(0,M.jsxs)(`button`,{className:`act`,onClick:()=>i(e),children:[(0,M.jsx)(y,{size:13}),`End`]})})]}),(0,M.jsx)(O,{status:t,columns:4,onDismiss:()=>t.state===`failed`&&o(t.mutationId)})]},e.id)})})]})})})}export{N as component};
@@ -1 +0,0 @@
1
- import{Z as e,et as t}from"./page-CGmvjSy4.js";var n=t(e(),1);function r({capabilities:e,users:t,audit:r}){return(0,n.createElement)(n.Fragment,null,e.canManageGrants?t:null,e.canReadAudit?r:null)}function i(e){return e.canManageGrants||e.canReadAudit}function a({capabilities:e,children:t}){return e.canCreateProject?t:null}function o({capabilities:e,hasArchivedProjects:t}){return t?e.canCreateProject?`No active projects. Start a new one, or restore one from the archive below.`:`No active projects. Your archived projects appear below.`:e.canCreateProject?`No projects exist yet. Start the first one with New project.`:(0,n.createElement)(n.Fragment,null,`No project is visible to you. Someone holding `,(0,n.createElement)(`span`,{className:`mono`},`grant.manage`),` on a project can add you.`)}function s({canReveal:e,children:t}){return e?t:null}export{i as a,s as i,o as n,a as r,r as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/audit-CHGlDeBB.js","_coffre/assets/page-CGmvjSy4.js","_coffre/assets/link-DP8SVWon.js","_coffre/assets/useSuspenseQuery-CSXyDALB.js","_coffre/assets/suspense-C7KwSnTG.js","_coffre/assets/useQuery-D__2KBOs.js","_coffre/assets/ui-BdipqGpP.js","_coffre/assets/icons-BQ27Ds9u.js"])))=>i.map(i=>d[i]);
2
- import{h as e}from"./page-CGmvjSy4.js";import{n as t,r as n,t as r}from"./preload-helper-ClBkJ19f.js";var i=n(`/audit`)({validateSearch:e=>({decision:e.decision===`deny`?`deny`:void 0,actorId:typeof e.actorId==`string`&&e.actorId!==``?e.actorId:void 0,detail:e.detail===`1`||e.detail===1?`1`:void 0}),loaderDeps:({search:e})=>e,loader:({context:{client:t,queryClient:n},deps:r})=>n.fetchQuery(e.auditEntries(t,r)),component:t(()=>r(()=>import(`./audit-CHGlDeBB.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`component`)});export{i as t};
@@ -1 +0,0 @@
1
- import{C as e,U as t,Z as n,et as r,h as i,i as a,n as o}from"./page-CGmvjSy4.js";import{t as s}from"./link-DP8SVWon.js";import{t as c}from"./useSuspenseQuery-CSXyDALB.js";import{t as l}from"./useQuery-D__2KBOs.js";import{c as u,d,i as f,l as p,p as m,s as h}from"./ui-BdipqGpP.js";import{G as g,J as ee,L as _,_ as v,b as y,l as b,r as x,s as S,t as C,z as w}from"./icons-BQ27Ds9u.js";import{t as te}from"./audit-C-pcBgKe.js";var T=r(n()),E=e=>typeof e==`string`&&e!==``?e:null,D=e=>typeof e==`number`?e:null;function O({project:e,environment:t,key:n}){let r=[e,t,n].filter(e=>e!==null);return r.length===0?[`coffre`]:[{place:r.join(`/`)}]}function k({project:e,environment:t}){return O({project:e,environment:t,key:null})}function A(e){if(e.subject!==null)return[{member:e.subject}];let t=E(e.metadata.principalId);return t===null?[`someone`]:[{member:`${e.metadata.principalType===`service`?`token`:`user`}:${t}`}]}function j(e,t,n=`${t}s`){return`${e} ${e===1?t:n}`}function M(e){return e.batch.length===1?O(e.entry):[...k(e.entry),e.refused?`, `:`: `,j(e.count,`secret`)]}function N(e){let t=E(e.metadata.destination);return t===null?``:` to ${t}`}function P(e){return E(e.metadata.destination)??`its destination`}var F={reveal:[`revealed`,`reveal`],run:[`ran`,`run`],compare:[`compared`,`compare`],sync:[`read`,`read`]};function I({entry:e}){return F[E(e.metadata.purpose)??`reveal`]??F.reveal}var L=e=>{let t=t=>[`${e} `,...e===`project`?O({...t.entry,environment:null,key:null}):k(t.entry)];return{[`${e}.create`]:{did:`created`,tried:`create`,what:t},[`${e}.update`]:{did:`changed`,tried:`change`,what:t},[`${e}.archive`]:{did:`archived`,tried:`archive`,what:t},[`${e}.restore`]:{did:`restored`,tried:`restore`,what:t}}},R={"secret.read":{did:e=>I(e)[0],tried:e=>I(e)[1],what:M},"secret.write":{did:({batch:e})=>{let t=e.filter(e=>e.version===1).length;return t===e.length?`added`:t===0?`changed`:`wrote`},tried:`change`,what:M,then:({entry:e,batch:t})=>t.length>1||e.version===null||e.version===1?[]:[`, now version ${e.version}`]},"secret.restore":{did:`restored`,tried:`restore`,what:({entry:e})=>[...O(e),...D(e.metadata.from)===null?[]:[` to version ${D(e.metadata.from)}`]],then:({entry:e})=>e.version===null?[]:[`, now ${e.version}`]},"secret.rename":{did:`renamed`,tried:`rename`,what:({entry:e})=>[...O(e),...E(e.metadata.nextKey)===null?[]:[` to ${E(e.metadata.nextKey)}`]]},"secret.archive":{did:`archived`,tried:`archive`,what:e=>O(e.entry)},"secret.unarchive":{did:`brought back`,tried:`bring back`,what:e=>O(e.entry)},...L(`project`),...L(`environment`),"access.grant":{did:`gave`,tried:`give`,what:({entry:e})=>[...A(e),` ${E(e.metadata.role)??`a role`} on `,...z(e)],then:({entry:e})=>[...E(e.metadata.previousRole)===null?[]:[`, was ${E(e.metadata.previousRole)}`],...E(e.metadata.expiresAt)===null?[]:[`, until ${E(e.metadata.expiresAt).slice(0,10)}`]]},"access.revoke":{did:`took`,tried:`take`,what:({entry:e})=>[...E(e.metadata.previousRole??e.metadata.role)===null?[`access to `]:[`${E(e.metadata.previousRole??e.metadata.role)} on `],...z(e),` from `,...A(e)]},"member.add":{did:`added`,tried:`add`,what:({entry:e})=>[...A(e),...e.metadata.rootAdmin===!0?[` as a root admin`]:e.metadata.owner===!0?[` as an owner`]:[]]},"member.remove":{did:`removed`,tried:`remove`,what:e=>A(e.entry),then:({entry:e})=>D(e.metadata.revoked)===null?[]:[`, who held ${j(D(e.metadata.revoked),`grant`)}`]},"member.restore":{did:`brought back`,tried:`bring back`,what:e=>A(e.entry)},"member.owner":{did:({entry:e})=>e.metadata.owner===!1?`took owner from`:`made`,tried:({entry:e})=>e.metadata.owner===!1?`take owner from`:`make`,what:({entry:e})=>[...A(e),...e.metadata.owner===!1?[]:[` an owner`]]},"sync.create":{did:`set up a sync of`,tried:`set up a sync of`,what:({entry:e})=>[...k(e),N(e)]},"sync.update":{did:({entry:e})=>e.metadata.paused===!0?`paused the sync of`:e.metadata.paused===!1?`resumed the sync of`:`changed the sync of`,tried:`change the sync of`,what:({entry:e})=>[...k(e),N(e)]},"sync.delete":{did:`removed the sync of`,tried:`remove the sync of`,what:({entry:e})=>[...k(e),N(e)]},"sync.push":{did:`pushed`,tried:`push`,what:e=>e.batch.length===1?[...O(e.entry),` to ${P(e.entry)}`]:[...k(e.entry),` to ${P(e.entry)}: ${j(e.count,`secret`)}`]},"sync.remove":{did:`removed`,tried:`remove`,what:e=>e.batch.length===1?[...O(e.entry),` from ${P(e.entry)}`]:[j(e.count,`secret`),` of `,...k(e.entry),` from ${P(e.entry)}`]},"vault.tampered":{did:`found`,tried:`check`,what:({entry:e})=>[...e.subject===null?[`an entry`]:[...A(e),`'s record`],` tampered with: ${ne[e.reason??``]??`it fails its seal`}`]},"key.rotate":{did:`rotated its key`,tried:`rotate its key`,what:()=>[]},sign_in:{did:({entry:e})=>e.metadata.kind===`cli`?`signed in to the CLI`:`signed in`,tried:`sign in`,what:({entry:e})=>E(e.metadata.provider)===null?[]:[`with ${E(e.metadata.provider)}`]},sign_out:{did:`signed out`,tried:`sign out`,what:()=>[]},"token.create":{did:`issued a token to`,tried:`issue a token to`,what:e=>A(e.entry)},"token.revoke":{did:`revoked a token of`,tried:`revoke a token of`,what:e=>A(e.entry)},"device.approve":{did:`approved a CLI sign-in`,tried:`approve a CLI sign-in`,what:()=>[]},"device.deny":{did:`turned down a CLI sign-in`,tried:`turn down a CLI sign-in`,what:()=>[]},"account.link":{did:`linked`,tried:`link`,what:({entry:e})=>[`a ${E(e.metadata.provider)??`sign-in`} account`]},"account.unlink":{did:`unlinked`,tried:`unlink`,what:({entry:e})=>[`a ${E(e.metadata.provider)??`sign-in`} account`]},"key.wrap":{did:`sealed the key of`,tried:`seal the key of`,what:e=>B(e.entry)},"key.rewrap":{did:`resealed the key of`,tried:`reseal the key of`,what:e=>B(e.entry)},"key.intent":{did:`asked KMS about`,tried:`ask KMS about`,what:e=>M(e)},"key.check":{did:`recorded the check value of`,tried:`check`,what:({entry:e})=>[[`the`,E(e.metadata.kekProvider)===`local`?null:E(e.metadata.kekProvider),`vault key`,E(e.metadata.kekId)].filter(e=>e!==null).join(` `)]},"sync.run":{did:`ran the sync of`,tried:`run the sync of`,what:({entry:e})=>[...k(e),N(e)]},"audit.heartbeat":{did:`checked in`,tried:`check in`,what:()=>[]},"audit.checkpoint":{did:`signed the log`,tried:`sign the log`,what:({entry:e})=>D(e.metadata.seq)===null?[]:[`through entry ${D(e.metadata.seq)}`]},"secret.list":{did:`listed`,tried:`list`,what:({entry:e})=>k(e)},"secret.history":{did:`read the history of`,tried:`read the history of`,what:e=>O(e.entry)},"secret.update":{did:`changed`,tried:`change`,what:e=>O(e.entry)},"sync.list":{did:`listed the syncs of`,tried:`list the syncs of`,what:({entry:e})=>k(e)}};function z(e){return O({...e,key:null})}function B(e){return[...O(e),...e.version===null?[]:[`, version ${e.version}`]]}var ne={mac:`it does not carry the vault's seal`,stale:`an older copy was put back`,forged_entry:`the vault did not write it`},V={no_grant:`no grant`,bulk_limit:`bulk limit`,expired:`grant expired`,removed:`removed from coffre`,not_a_member:`not a member`,not_registered:`not invited`,tampered:`their record was tampered with`,bad_claim:`the key did not match the secret`,not_allowed:`not allowed`,root_admin:`root admins are set by the deployment`,unknown_environment:`no such environment`,unknown_secret:`no such secret`,unknown_project:`no such project`,unusable_credential:`its token is not a secret they can read`,duplicate_destination:`already synced from elsewhere`,cannot_grant_sync:`cannot grant the sync its reads`,kms_unavailable:`KMS did not answer`,wrong_kek:`the vault's key is not the one that wrapped the data`},H={secret_read:`no grant to read it`,secret_write:`no grant to write`,secret_archive:`no grant to archive`,audit_read:`no grant to read the audit log`,environment_manage:`no grant to manage environments`,grant_manage:`no grant to manage access`,project_manage:`no grant to manage the project`};function U(e){return e===null?`refused`:e.startsWith(`missing_`)?H[e.slice(8)]??`no grant`:V[e]??e.replace(/_/g,` `)}var W=[`sync.push`,`sync.remove`,`secret.write`,`secret.read`];function G(e){for(let t of W){let n=e.find(e=>e.action===t);if(n!==void 0)return n}return e[0]}function K(e){let t=G(e),n=e.filter(e=>e.action===t.action),r=n.filter(e=>e.decision===`deny`),i=r.length===n.length,a={entry:t,batch:n,count:new Set(n.map(e=>`${e.project}/${e.environment}/${e.key}`)).size,refused:i},o=R[t.action];if(o===void 0)return{parts:[t.action,` `,...O(t)],refused:i};let s=e=>typeof e==`string`?e:e(a),c=o.what(a),l=c.length===0?[]:[` `];if(i){let e=U((r[0]??t).reason);return{parts:[`tried to `,s(o.tried),...l,...c,`: ${e}`],refused:i}}let u=r.length===0?[]:[`, ${r.length} refused: ${U(r[0].reason)}`];return{parts:[s(o.did),...l,...c,...o.then?.(a)??[],...u],refused:i}}function q(e){let t=e[0];if(t.actorType===`user`)return{member:`user:${t.actorId}`};if(t.actorType===`service`)return{member:`token:${t.actorId}`};if(t.actorId.startsWith(`sync:`)){let t=e.map(e=>E(e.metadata.provider)).find(e=>e!==null),n=t===void 0?void 0:J[t]??t;return n===void 0?`a sync`:`sync to ${n}`}return Y[t.actorId]??t.actorId}var J={"github-actions":`GitHub`,vercel:`Vercel`,railway:`Railway`,"cloudflare-workers":`Cloudflare`},Y={scheduler:`the scheduler`,cron:`the scheduler`,vault:`the vault`,app:`coffre`};function X(e){return[`vault`,`app`].filter(t=>e.some(e=>e.author===t)).join(`, `)}function re(e){let t=[],n=new Map;for(let r of e){let e=r.operationId===null?void 0:n.get(r.operationId);if(e!==void 0){e.push(r);continue}let i=[r];r.operationId!==null&&n.set(r.operationId,i),t.push(i)}return t}var Z=t();function ie(){let t=te.useSearch(),n=e(),{data:r}=c(i.auditEntries(n,t)),u=l(i.auditChain(n)),d=u.data,{decision:p,actorId:m}=t,v=t.detail===`1`,x=p===`deny`;if(!r.ok)return(0,Z.jsx)(o,{icon:(0,Z.jsx)(y,{size:18}),label:`Audit`,title:`The audit log is closed to you`,children:r.error});let S=d?.integrity===`broken`?d:null,T=S?.failedAtSeq??null,E=re(r.entries),D={decision:p,actorId:m};return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(a,{title:`Audit`,actions:(0,Z.jsx)(`div`,{className:`chain-live`,"aria-live":`polite`,"aria-atomic":`true`,children:(0,Z.jsx)(ue,{chain:d,onRetry:()=>void u.refetch()})})}),S!==null&&(0,Z.jsx)(`div`,{style:{marginBottom:`1.25rem`},children:(0,Z.jsxs)(h,{tone:`bad`,children:[(0,Z.jsx)(`strong`,{children:`Treat this as an incident.`}),` `,S.failedAtSeq===null?`The log does not verify, found by the ${S.author}'s check: ${S.reason}.`:`The log breaks at entry ${S.failedAtSeq}, found by the ${S.author}'s check: ${S.reason}.`,` `,S.through!==null&&`Every entry through ${S.through} holds. `,`Something with direct access to the database has changed what it records`,S.failedAtSeq===null?``:`, and nothing from entry ${S.failedAtSeq} on can be relied on`,` until that is explained.`,T!==null&&!r.entries.some(e=>e.seq===T)&&(0,Z.jsxs)(Z.Fragment,{children:[` `,`Entry `,T,` is not among the entries below`,v?(0,Z.jsxs)(Z.Fragment,{children:[`; `,(0,Z.jsx)(`code`,{children:`coffre audit`}),` lists them all.`]}):`: it may be detail, which Show detail lists.`]})]})}),(0,Z.jsxs)(`div`,{className:`toolbar`,children:[(0,Z.jsxs)(`nav`,{className:`segmented`,"aria-label":`Filter by decision`,children:[(0,Z.jsx)(s,{to:`/audit`,search:{...D,decision:void 0,detail:t.detail},activeOptions:{exact:!0},children:`All events`}),(0,Z.jsxs)(s,{to:`/audit`,search:{...D,decision:`deny`,detail:t.detail},activeOptions:{exact:!0},children:[(0,Z.jsx)(w,{size:13}),`Denials only`]})]}),m!==void 0&&(0,Z.jsxs)(s,{className:`filter-chip`,to:`/audit`,search:{...D,actorId:void 0,detail:t.detail},"aria-label":`Stop filtering by ${m}`,children:[`Actor `,(0,Z.jsx)(`span`,{className:`mono`,children:m}),(0,Z.jsx)(ee,{size:13})]}),(0,Z.jsxs)(s,{className:`detail-toggle`,to:`/audit`,search:{...D,detail:v?void 0:`1`},"aria-pressed":v,children:[(0,Z.jsx)(`span`,{className:`switch`,"aria-hidden":`true`}),`Show detail`]})]}),(0,Z.jsx)(`section`,{className:`card`,"aria-label":`Audit entries`,children:E.length===0?(0,Z.jsx)(f,{title:x?`No denials recorded`:`Nothing recorded yet`,children:x?`Every decision reaches this log, refusals included. An empty page means nobody has been turned away.`:`The log fills as people read and write secrets and change who has access.`}):(0,Z.jsx)(`div`,{className:`dt-wrap`,children:(0,Z.jsxs)(`table`,{className:`dt audit events stacks`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{children:[(0,Z.jsx)(`th`,{className:`n`,title:`Sequence number in the log`,children:`#`}),(0,Z.jsx)(`th`,{className:`col-shrink`,children:(0,Z.jsxs)(`span`,{className:`th`,children:[(0,Z.jsx)(b,{size:14}),`When (UTC)`]})}),(0,Z.jsx)(`th`,{className:`col-shrink`,children:(0,Z.jsxs)(`span`,{className:`th`,children:[(0,Z.jsx)(g,{size:14}),`Who`]})}),(0,Z.jsx)(`th`,{children:(0,Z.jsxs)(`span`,{className:`th`,children:[(0,Z.jsx)(C,{size:14}),`What they did`]})}),(0,Z.jsx)(`th`,{className:`col-shrink`,children:(0,Z.jsxs)(`span`,{className:`th`,children:[(0,Z.jsx)(_,{size:14}),`Decided by`]})})]})}),(0,Z.jsx)(`tbody`,{children:E.map(e=>(0,Z.jsx)(ae,{batch:e,filters:D,detail:t.detail,breakAt:T},e[0].seq))})]})})})]})}function ae({batch:e,filters:t,detail:n,breakAt:r}){let i=r!==null&&e.some(e=>e.seq===r),[a,o]=(0,T.useState)(i),s=e[0],c=K(e),l=e.map(e=>e.seq),u=e.length>1;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Q,{entry:s,seq:u?`${Math.min(...l)}–${Math.max(...l)}`:String(s.seq),parts:c.parts,refused:c.refused,decided:X(e),filters:t,detail:n,breaks:i&&!u,marked:i,batch:e,toggle:u?(0,Z.jsx)(`button`,{type:`button`,className:`batch-toggle`,"aria-expanded":a,"aria-label":a?`Hide each entry`:`Show each of ${e.length} entries`,onClick:()=>o(!a),children:(0,Z.jsx)(S,{size:14})}):void 0}),u&&a&&e.map(e=>{let i=K([e]);return(0,Z.jsx)(Q,{entry:e,seq:String(e.seq),parts:i.parts,refused:i.refused,decided:X([e]),filters:t,detail:n,breaks:e.seq===r,marked:!1,child:!0},e.seq)})]})}function Q({entry:e,seq:t,parts:n,refused:r,decided:i,filters:a,detail:o,breaks:c,marked:l,toggle:u,child:d=!1,batch:f}){let m=q(f??[e]),h=[r&&`is-denied`,(c||l)&&`is-break`,d&&`is-child`,e.detail&&`is-detail`,e.action===`vault.tampered`&&`is-tampered`].filter(Boolean);return(0,Z.jsxs)(`tr`,{className:h.length===0?void 0:h.join(` `),children:[(0,Z.jsx)(`td`,{className:`n`,"data-label":`Sequence`,children:t}),(0,Z.jsx)(`td`,{className:`nowrap cell-mono`,"data-label":`When (UTC)`,children:(0,Z.jsx)(p,{iso:e.occurredAt,precise:!0})}),(0,Z.jsx)(`td`,{"data-label":`Who`,children:(0,Z.jsx)(`span`,{className:`actor`,children:typeof m==`string`?(0,Z.jsx)(s,{to:`/audit`,search:{...a,actorId:e.actorId,detail:o},children:m}):(0,Z.jsx)(s,{to:`/audit`,search:{...a,actorId:e.actorId,detail:o},children:$(m.member)})})}),(0,Z.jsx)(`td`,{className:`cell-sentence`,"data-label":`What they did`,children:(0,Z.jsxs)(`span`,{className:`sentence`,children:[u,e.action===`vault.tampered`&&(0,Z.jsx)(x,{size:13}),(0,Z.jsx)(oe,{parts:n}),c&&(0,Z.jsx)(le,{})]})}),(0,Z.jsx)(`td`,{className:`nowrap`,"data-label":`Decided by`,children:(0,Z.jsxs)(`span`,{className:r?`decided decided-refused`:`decided`,children:[r&&(0,Z.jsx)(w,{size:13}),i,r&&`, refused`]})})]})}function oe({parts:e}){return(0,Z.jsx)(Z.Fragment,{children:e.map((e,t)=>(0,Z.jsx)(T.Fragment,{children:typeof e==`string`?e:`place`in e?(0,Z.jsx)(se,{path:e.place}):(0,Z.jsx)(ce,{member:e.member})},t))})}function se({path:e}){let[t,n]=e.split(`/`),r=(0,Z.jsx)(`span`,{className:`mono`,children:m(e)});return n===void 0?(0,Z.jsx)(s,{to:`/projects/$project`,params:{project:t},children:r}):(0,Z.jsx)(s,{to:`/projects/$project/$environment`,params:{project:t,environment:n},children:r})}function ce({member:e}){return e.startsWith(`token:`)?(0,Z.jsx)(s,{to:`/tokens/$token`,params:{token:e.slice(6)},children:e}):(0,Z.jsx)(s,{to:`/users/$user`,params:{user:$(e)},children:$(e)})}function $(e){return e.startsWith(`user:`)?e.slice(5):e}function le(){return(0,Z.jsxs)(`span`,{className:`break-mark`,children:[(0,Z.jsx)(x,{size:11}),`breaks here`]})}function ue({chain:e,onRetry:t}){return e===void 0?(0,Z.jsxs)(`span`,{className:`chain-note`,children:[(0,Z.jsx)(u,{size:14}),`Verifying…`]}):e.integrity===`owners-only`?(0,Z.jsx)(d,{align:`end`,label:`Owners and root admins see whether the log is intact. Checking it means recomputing every entry, and you read only your projects' part of it.`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`chain-note`,children:[(0,Z.jsx)(v,{size:14}),`Verified by owners`]})}):e.integrity===`unknown`?(0,Z.jsxs)(`div`,{className:`chain`,children:[(0,Z.jsx)(d,{align:`end`,label:`coffre could not check the log: ${e.problem}. The entries below loaded, but whether they are intact is unknown until it can.`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`chain-flag chain-flag-warn`,children:[(0,Z.jsx)(x,{size:14}),`Couldn’t verify`]})}),(0,Z.jsx)(`button`,{type:`button`,className:`btn btn-sm`,onClick:t,children:`Retry`})]}):e.integrity===`broken`?(0,Z.jsxs)(`span`,{className:`chain-flag chain-flag-bad`,children:[(0,Z.jsx)(x,{size:14}),e.failedAtSeq===null?`Log does not verify`:`Log broken at ${e.failedAtSeq}`]}):(0,Z.jsxs)(`div`,{className:`chain`,children:[e.pending>0&&(0,Z.jsx)(d,{align:`end`,label:`Keys released through KMS whose outcome the vault has not logged yet. Each settles within seconds, or is logged as failed.`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`chain-note`,role:`status`,children:[e.pending,` key operation`,e.pending===1?``:`s`,` in flight`]})}),(0,Z.jsx)(d,{align:`end`,label:`Every entry through ${e.through??0} holds, under the app's key and the vault's.`+(e.checkpoint===null?` The vault has not signed the log yet.`:` The vault last signed it through entry ${e.checkpoint.seq}, at ${e.checkpoint.signedAt}.`),children:(0,Z.jsxs)(`button`,{type:`button`,className:`chain-seal`,children:[(0,Z.jsx)(_,{size:14}),`Verified`]})})]})}export{ie as component};
@@ -1 +0,0 @@
1
- import{C as e,U as t,Z as n,et as r,n as i,x as a,y as o}from"./page-CGmvjSy4.js";import{t as s}from"./link-DP8SVWon.js";import{a as c}from"./preload-helper-ClBkJ19f.js";import{a as l,c as u,l as d}from"./ui-BdipqGpP.js";import{U as f,o as p,z as m}from"./icons-BQ27Ds9u.js";import{t as h}from"./auth.device-CWHNQn9W.js";var g=r(n()),_=t();function v(){let e=h.useLoaderData(),[t,n]=(0,g.useState)(null);return t===`approved`?(0,_.jsx)(i,{icon:(0,_.jsx)(p,{size:18}),label:`coffre CLI`,title:`Your terminal is signed in`,children:(0,_.jsx)(`p`,{children:`You can close this tab and go back to the terminal.`})}):t===`denied`?(0,_.jsx)(i,{icon:(0,_.jsx)(m,{size:18}),label:`coffre CLI`,title:`Sign-in refused`,children:(0,_.jsxs)(`p`,{children:[`The terminal that asked gets nothing. If you did not run `,(0,_.jsx)(`span`,{className:`mono`,children:`coffre login`}),` yourself, someone may be trying to get you to approve theirs; the refusal is in the audit log.`]})}):e===null?(0,_.jsx)(y,{}):e.ok?e.request===null?(0,_.jsx)(y,{error:`That code is unknown, already used, or expired. Run coffre login again for a new one.`}):(0,_.jsx)(b,{request:e.request,sessionDays:e.sessionDays,onDecided:n}):(0,_.jsx)(y,{error:e.error})}function y({error:e=null}){let t=c(),[n,r]=(0,g.useState)(``);return(0,_.jsxs)(`section`,{className:`card signin`,"aria-labelledby":`device-title`,children:[(0,_.jsxs)(`div`,{className:`signin-head`,children:[(0,_.jsx)(`h1`,{className:`signin-title`,id:`device-title`,children:`Sign in the coffre CLI`}),(0,_.jsxs)(`p`,{className:`signin-lede`,children:[`Enter the code your terminal shows after `,(0,_.jsx)(`span`,{className:`mono`,children:`coffre login`}),`.`]})]}),(0,_.jsxs)(`form`,{className:`signin-form`,onSubmit:e=>{e.preventDefault(),t({to:`/auth/device`,search:{code:n.trim()}})},children:[(0,_.jsxs)(`label`,{className:`field`,children:[(0,_.jsx)(`span`,{className:`label`,children:`Code`}),(0,_.jsx)(`input`,{className:`input mono device-code-input`,name:`code`,autoComplete:`off`,autoCapitalize:`characters`,spellCheck:!1,placeholder:`XXXX-XXXX`,maxLength:16,value:n,onChange:e=>r(e.target.value)})]}),(0,_.jsx)(`button`,{className:`btn btn-primary`,type:`submit`,style:{height:`2.125rem`},disabled:n.trim()===``,children:`Continue`})]}),e!==null&&(0,_.jsx)(`div`,{className:`signin-error`,children:(0,_.jsx)(l,{error:e})})]})}function b({request:t,sessionDays:n,onDecided:r}){let i=e(),[c,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(null);async function v(e){p(e?`approve`:`deny`);try{await i.deviceLogins.decide(t.userCode,e),r(e?`approved`:`denied`)}catch(e){h(a(e)===404?`That code is unknown, already used, or expired. Run coffre login again.`:a(e)===void 0?`The decision could not be sent. Nothing was approved.`:o(e))}finally{p(null)}}return(0,_.jsxs)(`section`,{className:`card signin`,"aria-labelledby":`device-title`,children:[(0,_.jsxs)(`div`,{className:`signin-head`,children:[(0,_.jsx)(`h1`,{className:`signin-title`,id:`device-title`,children:`Approve this terminal?`}),(0,_.jsxs)(`p`,{className:`signin-lede`,children:[`Only if you just ran `,(0,_.jsx)(`span`,{className:`mono`,children:`coffre login`}),` yourself and it shows this code. It gets your access, in your name, for `,n,` days or until you end it from your account page.`]})]}),(0,_.jsx)(`p`,{className:`device-code`,"aria-label":`Code`,children:t.userCode}),(0,_.jsxs)(`dl`,{className:`facts device-facts`,children:[(0,_.jsxs)(`div`,{className:`fact`,children:[(0,_.jsx)(`dt`,{children:`Client`}),(0,_.jsx)(`dd`,{children:(0,_.jsxs)(`span`,{className:`cell-account`,children:[(0,_.jsx)(f,{size:14}),t.clientLabel??`coffre CLI`]})})]}),(0,_.jsxs)(`div`,{className:`fact`,children:[(0,_.jsx)(`dt`,{children:`Requested from`}),(0,_.jsx)(`dd`,{className:`mono`,children:t.clientIp??`an unknown address`})]}),(0,_.jsxs)(`div`,{className:`fact`,children:[(0,_.jsx)(`dt`,{children:`Requested (UTC)`}),(0,_.jsx)(`dd`,{children:(0,_.jsx)(d,{iso:t.createdAt})})]})]}),m!==null&&(0,_.jsx)(`div`,{className:`signin-error`,children:(0,_.jsx)(l,{error:m})}),(0,_.jsxs)(`div`,{className:`device-actions`,children:[(0,_.jsx)(s,{className:`btn btn-quiet`,to:`/projects`,children:`Cancel`}),(0,_.jsxs)(`button`,{className:`btn`,disabled:c!==null,onClick:()=>void v(!1),children:[c===`deny`&&(0,_.jsx)(u,{}),`Deny`]}),(0,_.jsxs)(`button`,{className:`btn btn-primary`,disabled:c!==null,onClick:()=>void v(!0),children:[c===`approve`&&(0,_.jsx)(u,{}),`Approve`]})]})]})}export{v as component};
@@ -1 +0,0 @@
1
- import{C as e,U as t,Z as n,b as r,et as i}from"./page-CGmvjSy4.js";import{t as a}from"./link-DP8SVWon.js";import{g as o,l as s,m as c,n as l,o as u,t as d}from"./use-change-BRRMJocl.js";import{c as f,d as p,h as m,i as h,n as g,o as _}from"./ui-BdipqGpP.js";import{A as v,D as y,G as b,J as x,L as S,M as C,S as w,v as T}from"./icons-BQ27Ds9u.js";import{a as E,i as D,r as O}from"./row-state-ByET1OKX.js";var k=i(n(),1),A=t();function j({type:e,id:t,size:n=`sm`}){return(0,A.jsx)(`span`,{className:`avatar${e===`service`?` avatar-token`:``}${n===`lg`?` avatar-lg`:``}`,"aria-hidden":!0,children:e===`service`?(0,A.jsx)(T,{size:n===`lg`?18:13}):t.slice(0,1)})}function M({type:e,id:t,stretch:n=!1}){let r=`cell-link${n?` stretch`:``}`;return(0,A.jsxs)(`span`,{className:`cell-principal`,children:[(0,A.jsx)(j,{type:e,id:t}),e===`user`?(0,A.jsx)(a,{className:r,to:`/users/$user`,params:{user:t},children:t}):(0,A.jsx)(a,{className:r,to:`/tokens/$token`,params:{token:t},children:t})]})}var N=e=>r(e.principalType,e.principalId),P={"root-admin":`Root admin`,owner:`Owner`,user:`Member`},F={user:`user`,service:`token`};function I({principalType:e,principals:t,hasRemoved:n=!1}){let r=e===`user`,i=r?4:3,{status:a,failedAdds:o,dismiss:c}=l(s.queryKey),u=o(t.map(N)).filter(({vars:t})=>t.principalType===e);return(0,A.jsx)(`section`,{className:`card`,"aria-label":r?`Users`:`Tokens`,children:t.length===0&&u.length===0?(0,A.jsxs)(h,{title:n?`No active ${F[e]}s`:r?`Nobody is registered`:`No tokens yet`,children:[n?`Add a ${F[e]}`:`Add the first ${F[e]}`,` to let it through the door. Project access is a separate step, granted from each project's page.`]}):(0,A.jsx)(`div`,{className:`dt-wrap`,children:(0,A.jsxs)(`table`,{className:`dt directory directory-${e} stacks`,children:[(0,A.jsx)(`thead`,{children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{className:`n`,children:`#`}),(0,A.jsx)(`th`,{className:`col-principal`,children:(0,A.jsxs)(`span`,{className:`th`,children:[r?(0,A.jsx)(b,{size:14}):(0,A.jsx)(T,{size:14}),r?`Email`:`Name`]})}),r&&(0,A.jsx)(`th`,{className:`col-role`,children:(0,A.jsxs)(`span`,{className:`th`,children:[(0,A.jsx)(S,{size:14}),`Instance role`]})}),(0,A.jsx)(`th`,{className:`col-actions`,children:(0,A.jsx)(`span`,{className:`visually-hidden`,children:`Actions`})})]})}),(0,A.jsxs)(`tbody`,{children:[t.map((e,t)=>{let n=a(N(e));return(0,A.jsxs)(k.Fragment,{children:[(0,A.jsxs)(`tr`,{className:`row-link ${E(n)}`,children:[(0,A.jsx)(`td`,{className:`n`,children:t+1}),(0,A.jsx)(`td`,{className:`col-lead`,"data-label":e.principalType===`user`?`Email`:`Name`,children:(0,A.jsx)(M,{type:e.principalType,id:e.principalId,stretch:!0})}),r&&(0,A.jsx)(`td`,{className:`col-role`,"data-label":`Instance role`,children:(0,A.jsx)(L,{principal:e})}),(0,A.jsx)(`td`,{className:`col-actions`,children:n.state===`pending`?(0,A.jsx)(D,{status:n}):(0,A.jsx)(R,{principal:e})})]}),(0,A.jsx)(O,{status:n,columns:i,onDismiss:()=>n.state===`failed`&&c(n.mutationId)})]},e.principalId)}),u.map(({mutationId:e,vars:t,status:n})=>(0,A.jsxs)(O,{status:n,columns:i,onDismiss:()=>c(e),children:[t.principalId,` was not added.`]},e))]})]})})})}function L({principal:e}){return e.tampered===!0?(0,A.jsx)(p,{label:(0,A.jsx)(A.Fragment,{children:`Their record was changed outside coffre, so the vault refuses them everything. Remove them to start them over, then add them again.`}),children:(0,A.jsxs)(`button`,{type:`button`,className:`tag tag-red tag-button`,children:[(0,A.jsx)(w,{size:11}),`Integrity check failed`]})}):e.isRootAdmin?(0,A.jsx)(p,{label:(0,A.jsxs)(A.Fragment,{children:[`Set by `,(0,A.jsx)(`code`,{children:`rootAdmins`}),` in the vault's configuration, so it cannot be changed or removed here.`]}),children:(0,A.jsxs)(`button`,{type:`button`,className:`tag tag-violet tag-button`,children:[(0,A.jsx)(w,{size:11}),`Root admin`]})}):(0,A.jsx)(`span`,{className:`tag${e.instanceRole===`user`?``:` tag-violet`}`,children:P[e.instanceRole]})}function R({principal:t,trigger:n=`act act-quiet act-menu`}){let[r,i]=(0,k.useState)(!1),[a,c]=(0,k.useState)(!1),[p,h]=(0,k.useState)(t.instanceRole===`owner`?`owner`:`user`),b=e(),S=d(u(b)),C=d(o(b)),{status:w}=l(s.queryKey),T=w(N(t)).state===`pending`,E=F[t.principalType];return t.isRootAdmin?null:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(m.Root,{children:[(0,A.jsx)(m.Trigger,{asChild:!0,children:(0,A.jsx)(`button`,{className:n,"aria-label":`Actions for ${t.principalId}`,disabled:T,children:T?(0,A.jsx)(f,{size:13}):(0,A.jsx)(y,{size:16})})}),(0,A.jsx)(m.Portal,{children:(0,A.jsxs)(m.Content,{className:`menu`,sideOffset:6,align:`end`,children:[t.principalType===`user`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(m.Item,{className:`menu-item`,onSelect:()=>{h(t.instanceRole===`owner`?`owner`:`user`),i(!0)},children:[(0,A.jsx)(v,{size:14}),`Change role`]}),(0,A.jsx)(m.Separator,{className:`menu-sep`})]}),(0,A.jsxs)(m.Item,{className:`menu-item menu-item-danger`,onSelect:()=>c(!0),children:[(0,A.jsx)(x,{size:14}),`Remove `,E,`…`]})]})})]}),t.principalType===`user`&&(0,A.jsx)(_,{open:r,onOpenChange:i,title:(0,A.jsxs)(A.Fragment,{children:[`Role of `,(0,A.jsx)(`span`,{className:`mono`,children:t.principalId})]}),children:(0,A.jsxs)(`form`,{className:`form`,onSubmit:e=>{e.preventDefault(),S({principalId:t.principalId,owner:p===`owner`}),i(!1)},children:[(0,A.jsx)(B,{value:p,onChange:h}),(0,A.jsxs)(`div`,{className:`dialog-actions`,children:[(0,A.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>i(!1),children:`Cancel`}),(0,A.jsx)(`button`,{className:`btn btn-primary`,type:`submit`,children:`Save`})]})]})}),(0,A.jsx)(g,{open:a,onOpenChange:c,title:(0,A.jsxs)(A.Fragment,{children:[`Remove `,(0,A.jsx)(`span`,{className:`mono`,children:t.principalId}),`?`]}),body:t.principalType===`user`?(0,A.jsx)(A.Fragment,{children:`They are signed out everywhere, and their CLI logins, linked sign-in accounts and project permissions are revoked at once. Their past actions stay in the audit log, and their page then lists the values they saw, to rotate.`}):(0,A.jsx)(A.Fragment,{children:`Every token issued to it stops working and its project permissions are revoked at once, including for anything running with it right now. Its past actions stay in the audit log, and its page then lists the values it read, to rotate.`}),confirmLabel:`Remove ${E}`,onConfirm:()=>C(t)})]})}function z({principalType:t}){let[n,r]=(0,k.useState)(!1),[i,a]=(0,k.useState)(``),[o,s]=(0,k.useState)(`user`),l=d(c(e())),u=F[t];function f(){r(!1),a(``),s(`user`)}return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>r(!0),children:[(0,A.jsx)(C,{size:14}),`Add `,u]}),(0,A.jsx)(_,{open:n,onOpenChange:e=>e?r(!0):f(),title:`Add a ${u}`,description:`This lets the ${u} through the door and nothing more. Grant project access from its page or from each project's.`,children:(0,A.jsxs)(`form`,{className:`form`,onSubmit:e=>{e.preventDefault(),l({principalType:t,principalId:i.trim(),owner:o===`owner`}),f()},children:[(0,A.jsxs)(`label`,{className:`field`,children:[(0,A.jsx)(`span`,{className:`label`,children:t===`user`?`Cloudflare Access email`:`Service token common name`}),(0,A.jsx)(`input`,{className:`input input-mono`,autoFocus:!0,spellCheck:!1,autoComplete:`off`,value:i,placeholder:t===`user`?`someone@acme.example`:`ci-deploy`,onChange:e=>a(e.target.value)})]}),t===`user`&&(0,A.jsx)(B,{value:o,onChange:s}),(0,A.jsxs)(`div`,{className:`dialog-actions`,children:[(0,A.jsx)(`button`,{className:`btn`,type:`button`,onClick:f,children:`Cancel`}),(0,A.jsxs)(`button`,{className:`btn btn-primary`,type:`submit`,disabled:i.trim()===``,children:[`Add `,u]})]})]})})]})}function B({value:e,onChange:t}){return(0,A.jsxs)(`label`,{className:`field`,children:[(0,A.jsx)(`span`,{className:`label`,children:`Instance role`}),(0,A.jsxs)(`select`,{className:`select`,value:e,onChange:e=>t(e.target.value),children:[(0,A.jsx)(`option`,{value:`user`,children:`Member`}),(0,A.jsx)(`option`,{value:`owner`,children:`Owner`})]}),(0,A.jsx)(`span`,{className:`hint`,children:`Owners manage users and tokens, can create projects, and read the whole audit log. Neither role reads a secret without a project grant.`})]})}export{R as a,F as i,I as n,j as o,L as r,M as s,z as t};
@@ -1 +0,0 @@
1
- import{Z as e,et as t}from"./page-CGmvjSy4.js";import{z as n}from"./link-DP8SVWon.js";var r=t(e(),1),i=t(n(),1);function a(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var o=e=>{switch(e){case`success`:return l;case`info`:return d;case`warning`:return u;case`error`:return f;default:return null}},s=Array(12).fill(0),c=({visible:e,className:t})=>r.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},r.createElement(`div`,{className:`sonner-spinner`},s.map((e,t)=>r.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),l=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),u=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),d=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),f=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),p=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},r.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),r.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ee=()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},m=1,h=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:m++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let i=Promise.resolve(e instanceof Function?e():e),a=n!==void 0,o,s=i.then(async e=>{if(o=[`resolve`,e],r.isValidElement(e))a=!1,this.create({id:n,type:`default`,message:e});else if(_(e)&&!e.ok){a=!1;let i=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){a=!1;let i=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||m++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},g=(e,t)=>{let n=t?.id||m++;return h.addToast({title:e,...t,id:n}),n},_=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,v=Object.assign(g,{success:h.success,info:h.info,warning:h.warning,error:h.error,custom:h.custom,message:h.message,promise:h.promise,dismiss:h.dismiss,loading:h.loading},{getHistory:()=>h.toasts,getToasts:()=>h.getActiveToasts()});a(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function y(e){return e.label!==void 0}var te=3,b=`24px`,x=`16px`,S=4e3,C=356,w=14,T=45,E=200;function D(...e){return e.filter(Boolean).join(` `)}function ne(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var O=e=>{let{invert:t,toast:n,unstyled:i,interacting:a,setHeights:s,visibleToasts:l,heights:u,index:d,toasts:f,expanded:m,removeToast:h,defaultRichColors:g,closeButton:_,style:v,cancelButtonStyle:te,actionButtonStyle:b,className:x=``,descriptionClassName:C=``,duration:w,position:O,gap:k,expandByDefault:A,classNames:j,icons:M,closeButtonAriaLabel:re=`Close toast`}=e,[N,P]=r.useState(null),[F,ie]=r.useState(null),[I,L]=r.useState(!1),[R,z]=r.useState(!1),[B,V]=r.useState(!1),[ae,oe]=r.useState(!1),[se,ce]=r.useState(!1),[le,H]=r.useState(0),[ue,U]=r.useState(0),W=r.useRef(n.duration||w||S),de=r.useRef(null),G=r.useRef(null),fe=d===0,pe=d+1<=l,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=r.useMemo(()=>u.findIndex(e=>e.toastId===n.id)||0,[u,n.id]),ge=r.useMemo(()=>n.closeButton??_,[n.closeButton,_]),_e=r.useMemo(()=>n.duration||w||S,[n.duration,w]),Y=r.useRef(0),X=r.useRef(0),ve=r.useRef(0),Z=r.useRef(null),[ye,be]=O.split(`-`),xe=r.useMemo(()=>u.reduce((e,t,n)=>n>=J?e:e+t.height,0),[u,J]),Se=ee(),Ce=n.invert||t,Q=K===`loading`;X.current=r.useMemo(()=>J*k+xe,[J,xe]),r.useEffect(()=>{W.current=_e},[_e]),r.useEffect(()=>{L(!0)},[]),r.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return U(t),s(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>s(e=>e.filter(e=>e.toastId!==n.id))}},[s,n.id]),r.useLayoutEffect(()=>{if(!I)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),s(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[I,n.title,n.description,s,n.id,n.jsx,n.action,n.cancel]);let $=r.useCallback(()=>{z(!0),H(X.current),s(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{h(n)},E)},[n,h,s,X]);r.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return m||a||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[m,a,n,K,Se,$]),r.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return M?.loading?r.createElement(`div`,{className:D(j?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},M.loading):r.createElement(c,{className:D(j?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||M?.[K]||o(K);return r.createElement(`li`,{tabIndex:0,ref:G,className:D(x,me,j?.toast,n?.classNames?.toast,j?.default,j?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??g,"data-styled":!(n.jsx||n.unstyled||i),"data-mounted":I,"data-promise":!!n.promise,"data-swiped":se,"data-removed":R,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":B,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":ae,"data-swipe-direction":F,"data-expanded":!!(m||A&&I),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${R?le:X.current}px`,"--initial-height":A?`auto`:`${ue}px`,...v,...n.style},onDragEnd:()=>{V(!1),P(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,H(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(V(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(ae||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=N===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){H(X.current),n.onDismiss==null||n.onDismiss.call(n,n),ie(N===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),oe(!0);return}else{var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ce(!1),V(!1),P(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ne(O);!N&&(Math.abs(a)>1||Math.abs(i)>1)&&P(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(N===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(N===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ce(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?r.createElement(`button`,{"aria-label":re,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:D(j?.closeButton,n?.classNames?.closeButton)},M?.close??p):null,(K||n.icon||n.promise)&&n.icon!==null&&(M?.[K]!==null||n.icon)?r.createElement(`div`,{"data-icon":``,className:D(j?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,r.createElement(`div`,{"data-content":``,className:D(j?.content,n?.classNames?.content)},r.createElement(`div`,{"data-title":``,className:D(j?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?r.createElement(`div`,{"data-description":``,className:D(C,he,j?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),r.isValidElement(n.cancel)?n.cancel:n.cancel&&y(n.cancel)?r.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||te,onClick:e=>{y(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:D(j?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,r.isValidElement(n.action)?n.action:n.action&&y(n.action)?r.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||b,onClick:e=>{y(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:D(j?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function k(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function A(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?x:b;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var j=r.forwardRef(function(e,t){let{id:n,invert:a,position:o=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:ee,duration:m,style:g,visibleToasts:_=te,toastOptions:v,dir:y=k(),gap:b=w,icons:x,containerAriaLabel:S=`Notifications`}=e,[T,E]=r.useState([]),D=r.useMemo(()=>n?T.filter(e=>e.toasterId===n):T.filter(e=>!e.toasterId),[T,n]),ne=r.useMemo(()=>Array.from(new Set([o].concat(D.filter(e=>e.position).map(e=>e.position)))),[D,o]),[j,M]=r.useState([]),[re,N]=r.useState(!1),[P,F]=r.useState(!1),[ie,I]=r.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),L=r.useRef(null),R=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),z=r.useRef(null),B=r.useRef(!1),V=r.useCallback(e=>{E(t=>(t.find(t=>t.id===e.id)?.delete||h.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return r.useEffect(()=>h.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{E(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{i.flushSync(()=>{E(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[T]),r.useEffect(()=>{if(p!==`system`){I(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?I(`dark`):I(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{I(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{I(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),r.useEffect(()=>{T.length<=1&&N(!1)},[T]),r.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;N(!0),(t=L.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===L.current||L.current?.contains(document.activeElement))&&N(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),r.useEffect(()=>{if(L.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,B.current=!1)}},[L.current]),r.createElement(`section`,{ref:t,"aria-label":`${S} ${R}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ne.map((t,n)=>{let[i,o]=t.split(`-`);return D.length?r.createElement(`ol`,{key:t,dir:y===`auto`?k():y,tabIndex:-1,ref:L,className:u,"data-sonner-toaster":!0,"data-sonner-theme":ie,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${j[0]?.height||0}px`,"--width":`${C}px`,"--gap":`${b}px`,...g,...A(d,f)},onBlur:e=>{B.current&&!e.currentTarget.contains(e.relatedTarget)&&(B.current=!1,z.current&&=(z.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||B.current||(B.current=!0,z.current=e.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{P||N(!1)},onDragEnd:()=>N(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F(!0)},onPointerUp:()=>F(!1)},D.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>r.createElement(O,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:ee,duration:v?.duration??m,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:a,visibleToasts:_,closeButton:v?.closeButton??l,interacting:P,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:V,toasts:D.filter(e=>e.position==n.position),heights:j.filter(e=>e.position==n.position),setHeights:M,expandByDefault:c,gap:b,expanded:re,swipeDirections:e.swipeDirections}))):null}))});export{v as n,j as t};
@@ -1 +0,0 @@
1
- import{U as e,Z as t,et as n}from"./page-CGmvjSy4.js";var r=n(t(),1),i=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function a(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:i(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var o=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},s=e=>{let t=o(e);return t.charAt(0).toUpperCase()+t.slice(1)},c=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),l={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function u(e){return e!=null}function d(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??l.width,a=e.size??e.height??l.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],d=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?c(...d):c(`lucide`,...s,...d),p=t.absoluteStrokeWidth?Number(t.strokeWidth??l[`stroke-width`])*Number(e.size??e.width??l.width)/Number(t.size??t.width??l.width):t.strokeWidth??l[`stroke-width`];return[`svg`,{...Object.entries(l).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&u(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&u(t.width)&&{[r(`width`)]:t.width},...`height`in t&&u(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function f(e,t={}){return d(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var p=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ee=(0,r.createContext)({}),te=()=>(0,r.useContext)(ee),m=(0,r.forwardRef)(({color:e,size:t,width:n,height:i,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:s,className:l=``,children:u,iconNode:d=[],icon:ee={node:d,aliases:[],size:24},...m},h)=>{let{size:g=24,strokeWidth:ne=2,absoluteStrokeWidth:_=!1,nonScalingStroke:re=!1,color:v=`currentColor`,className:y=``}=te()??{},ie=!!u||p(m),[b,x,S=[]]=f(ee,{color:e??v,width:n??t??g,height:i??t??g,strokeWidth:a??ne,absoluteStrokeWidth:o??_,nonScalingStroke:s??re,className:c(y,l),hasA11yProp:ie,attributes:m});return(0,r.createElement)(b,{ref:h,...x},[...S.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function h(e,t=[],n=[]){let i=typeof e==`string`?a(e,t,n):e,o=(0,r.forwardRef)(({className:e,...t},n)=>(0,r.createElement)(m,{ref:n,icon:i,className:e,...t}));return i.name&&(o.displayName=s(i.name)),o}var g={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};g.node;var ne=h(g),_={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};_.node;var re=h(_),v={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};v.node,h(v);var y={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};y.node;var ie=h(y),b={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};b.node;var x=h(b),S={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};S.node,h(S);var C={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};C.node;var ae=h(C),w={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};w.node;var oe=h(w),T={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};T.node;var se=h(T),E={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};E.node;var ce=h(E),D={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};D.node;var le=h(D),O={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};O.node;var ue=h(O),k={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};k.node;var de=h(k),A={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};A.node;var fe=h(A),j={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};j.node;var pe=h(j),M={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};M.node;var me=h(M),N={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};N.node;var he=h(N),P={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};P.node;var ge=h(P),F={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};F.node,h(F);var I={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};I.node;var _e=h(I),L={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};L.node;var ve=h(L),R={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};R.node;var ye=h(R),z={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};z.node,h(z);var B={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};B.node;var be=h(B),V={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};V.node;var xe=h(V),H={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};H.node;var Se=h(H),U={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};U.node;var Ce=h(U),W={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};W.node;var we=h(W),Te={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Te.node;var Ee=h(Te),G={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};G.node;var De=h(G),K={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};K.node;var Oe=h(K),q={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};q.node;var ke=h(q),J={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};J.node;var Ae=h(J),Y={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Y.node;var je=h(Y),Me={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Me.node;var Ne=h(Me),Pe={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Pe.node;var Fe=h(Pe),Ie={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Ie.node;var Le=h(Ie),Re={name:`scroll-text`,size:24,node:[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]};Re.node;var ze=h(Re),Be={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Be.node;var Ve=h(Be),He={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};He.node;var Ue=h(He),We={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};We.node;var Ge=h(We),X={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};X.node;var Ke=h(X),qe={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};qe.node;var Je=h(qe),Ye={name:`train-front`,size:24,node:[[`path`,{d:`M8 3.1V7a4 4 0 0 0 8 0V3.1`,key:`1v71zp`}],[`path`,{d:`m9 15-1-1`,key:`1yrq24`}],[`path`,{d:`m15 15 1-1`,key:`1t0d6s`}],[`path`,{d:`M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z`,key:`1p0hjs`}],[`path`,{d:`m8 19-2 3`,key:`13i0xs`}],[`path`,{d:`m16 19 2 3`,key:`xo31yx`}]]};Ye.node;var Xe=h(Ye),Ze={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};Ze.node;var Qe=h(Ze),$e={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};$e.node;var et=h($e),tt={name:`user-round-cog`,size:24,node:[[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`M2 21a8 8 0 0 1 10.434-7.62`,key:`1yezr2`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]],aliases:[`user-cog-2`]};tt.node;var nt=h(tt),rt={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]};rt.node;var it=h(rt),at={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};at.node;var ot=h(at),st={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};st.node;var ct=h(st),lt=`M24.17 12.23A9 9 0 1 0 24.93 14.91L18.39 16.27A3.6 3.6 0 1 1 17.84 14.07Z`,ut=`M25.77 10.94A11 11 0 1 0 26.95 14.9L17.92 16.81A4 4 0 1 1 17.08 13.45Z`,dt=`#000`,ft=`#fff`;function pt(e){return e<=48?ut:lt}function mt(e,{square:t=!1,adaptive:n=!1}={}){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">${n?`<style>@media (prefers-color-scheme:dark){rect{fill:${ft}}path{fill:${dt}}}</style>`:``}<rect width="32" height="32"${t?``:` rx="7"`} fill="${dt}"/><path d="${pt(e)}" fill="${ft}"/></svg>`}var Z=e();function ht({size:e=16,className:t,style:n,label:r}){return(0,Z.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 32 32`,className:t,style:n,"aria-hidden":r===void 0,"aria-label":r,role:r===void 0?void 0:`img`,children:(0,Z.jsx)(`path`,{d:pt(e),fill:`currentColor`})})}var gt=1.75;function Q(e){return function({size:t=16,className:n,style:r,label:i}){return(0,Z.jsx)(e,{size:t,strokeWidth:gt,className:n,style:r,...i===void 0?{}:{"aria-label":i,role:`img`}})}}var _t=Q(he),vt=Q(ye),yt=Q(ot),bt=Q(it),xt=Q(nt),St=Q(ve),Ct=Q(ze),wt=Q(Ue),Tt=Q(me),Et=Q(pe),Dt=Q(de),Ot=Q(ke),kt=Q(re),At=Q(Fe),jt=Q(Le),Mt=Q(et),Nt=Q(Ne),Pt=Q(Oe),Ft=Q(Ae),It=Q(xe),Lt=Q(Je),Rt=Q(ge),zt=Q(le),Bt=Q(x),Vt=Q(ce),Ht=Q(ie),Ut=Q(Ge),Wt=Q(Qe),Gt=Q(se),Kt=Q(_e),qt=Q(ne),Jt=Q(be),Yt=Q(ct),Xt=Q(je),Zt=Q(Ve),Qt=Q(Ce),$t=Q(De),en=Q(fe),tn=Q(ae),nn=Q(oe),rn=Q(Se),an=Q(Ke),on=Q(Ee),sn=Q(we);function $({size:e=16,className:t,style:n}){return(0,Z.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 16 16`,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,Z.jsx)(`path`,{d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z`})})}function cn({size:e=16,className:t,style:n}){return(0,Z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 48 48`,className:t,style:n,"aria-hidden":!0,children:[(0,Z.jsx)(`path`,{fill:`#EA4335`,d:`M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z`}),(0,Z.jsx)(`path`,{fill:`#4285F4`,d:`M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z`}),(0,Z.jsx)(`path`,{fill:`#FBBC05`,d:`M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z`}),(0,Z.jsx)(`path`,{fill:`#34A853`,d:`M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z`})]})}function ln({size:e=16,className:t,style:n}){return(0,Z.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 21 21`,className:t,style:n,"aria-hidden":!0,children:[(0,Z.jsx)(`rect`,{x:`0`,y:`0`,width:`10`,height:`10`,fill:`#F25022`}),(0,Z.jsx)(`rect`,{x:`11`,y:`0`,width:`10`,height:`10`,fill:`#7FBA00`}),(0,Z.jsx)(`rect`,{x:`0`,y:`11`,width:`10`,height:`10`,fill:`#00A4EF`}),(0,Z.jsx)(`rect`,{x:`11`,y:`11`,width:`10`,height:`10`,fill:`#FFB900`})]})}function un({size:e=16,className:t,style:n}){return(0,Z.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,Z.jsx)(`path`,{d:`M12 2.5 23 21.5H1Z`})})}var dn=Q(ue),fn=Q(Xe);function pn({brand:e,size:t=16}){switch(e){case`github`:return(0,Z.jsx)($,{size:t});case`vercel`:return(0,Z.jsx)(un,{size:t});case`railway`:return(0,Z.jsx)(fn,{size:t});case`cloudflare`:return(0,Z.jsx)(dn,{size:t});default:return(0,Z.jsx)(Nt,{size:t})}}function mn({brand:e,size:t=16}){switch(e){case`github`:return(0,Z.jsx)($,{size:t});case`google`:return(0,Z.jsx)(cn,{size:t});case`microsoft`:return(0,Z.jsx)(ln,{size:t});default:return(0,Z.jsx)(St,{size:t})}}export{Ot as A,an as B,ht as C,en as D,on as E,Zt as F,bt as G,pn as H,wt as I,Yt as J,xt as K,Ut as L,Xt as M,mn as N,$t as O,jt as P,rn as R,It as S,sn as T,Lt as U,Nt as V,Mt as W,mt as Y,Kt as _,Bt as a,Ct as b,nn as c,Tt as d,Et as f,At as g,Rt as h,kt as i,Ft as j,Pt as k,zt as l,$ as m,Gt as n,Vt as o,_t as p,yt as q,Wt as r,tn as s,qt as t,Dt as u,St as v,Qt as w,Jt as x,vt as y,Ht as z};
@@ -1 +0,0 @@
1
- import{Q as e,U as t,V as n,Z as r,et as i}from"./page-CGmvjSy4.js";var a=e((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),o=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=a()}));function s(e){return e[e.length-1]}function c(e){return typeof e==`function`}function l(e,t){return c(e)?e(t):e}var u=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable;function f(e){for(let t in e)if(u.call(e,t))return!0;return!1}var p=()=>Object.create(null),m=(e,t)=>h(e,t,p);function h(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=y(e)&&y(i);if(!a&&!(_(e)&&_(i)))return i;let o=a?e:g(e);if(!o)return i;let s=a?i:g(i);if(!s)return i;let c=o.length,l=s.length,d=a?Array(l):n(),f=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],p=i[o];if(l===p){d[o]=l,(a?t<c:u.call(e,o))&&f++;continue}if(l===null||p===null||typeof l!=`object`||typeof p!=`object`){d[o]=p;continue}let m=h(l,p,n,r+1);d[o]=m,m===l&&f++}return c===l&&f===c?e:d}function g(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!d.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!d.call(e,t))return!1;r.push(t)}return r}function _(e){if(!v(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!v(n)||!n.hasOwnProperty(`isPrototypeOf`))}function v(e){return Object.prototype.toString.call(e)===`[object Object]`}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!b(e[r],t[r],n))return!1;return!0}if(_(e)&&_(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!b(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!b(e[o],t[o],n)))return!1;return i===a}return!1}function x(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function S(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}function C(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var w=/[\x00-\x1f\x7f"<>`{}]/g;function T(e){return e.replace(w,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function E(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return T(t)}var D=[`http:`,`https:`,`mailto:`,`tel:`];function ee(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var O={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},k=/[&><\u2028\u2029]/g;function te(e){return e.replace(k,e=>O[e])}function ne(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=E(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=E(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function re(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ie(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ae(){throw Error(`Invariant failed`)}function A(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var j=4,oe=5;function se(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function ce(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=se(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function M(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=ce(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=F(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=F(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=I(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=I(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=I(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=F(n.fullPath??n.from);e.kind=oe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=F(n.fullPath??n.from);e.kind=j,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)M(e,t,r,s,i,a,o)}function N(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function P(e){if(e.pathless)for(let t of e.pathless)P(t);if(e.static)for(let t of e.static.values())P(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())P(t);if(e.dynamic?.length){e.dynamic.sort(N);for(let t of e.dynamic)P(t)}if(e.optional?.length){e.optional.sort(N);for(let t of e.optional)P(t)}if(e.wildcard?.length){e.wildcard.sort(N);for(let t of e.wildcard)P(t)}}function F(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function I(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function le(e,t){let n=F(`/`),r=new Uint16Array(6);for(let t of e)M(!1,r,t,1,n,0);P(n),t.masksTree=n,t.flatCache=A(1e3)}function ue(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=V(e,t.masksTree);return t.flatCache.set(e,r),r}function L(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=F(`/`),M(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),V(r,o,n)}function R(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=V(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=U(a.route)),t.matchCache.set(r,a),a}function z(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function B(e,t=!1,n){let r=F(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return M(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&ae(),a[e.id]=e,s!==0&&e.path){let t=z(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),P(r),{processedTree:{segmentTree:r,singleCache:A(1e3),matchCache:A(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function V(e,t,n=!1){let r=e.split(`/`),i=fe(e,r,t,n);if(!i)return null;let[a]=H(e,r,i);return{route:i.node.route,rawParams:a}}function H(e,t,n){let r=de(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===j)break;if(u.kind===oe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function U(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function de(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function fe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!s(t),a=i&&e!==`/`,o=t.length-+!!i,c=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:i,index:s,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!q(u,n))continue;if(i.parse){if(!K(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==j&&q(l,n)&&(l=n);let v=s===o;if(v&&(i.route&&(!a||i.kind===j||i.kind===2)&&q(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[s],b;if(v&&i.index){let n={node:i.index,index:s,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(K(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&G(p,o))return n;q(u,n)&&(u=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(s).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}c.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];c.push({node:r,index:s,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}c.push({node:n,index:s+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+W(o,s),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}c.push({node:t,index:s+1,skipped:d,depth:f+1,statics:p,dynamics:m+W(o,s),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&c.push({node:e,index:s+1,skipped:d,depth:f+1,statics:p+W(o,s),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&c.push({node:e,index:s+1,skipped:d,depth:f+1,statics:p+W(o,s),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];c.push({node:n,index:s,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(u)return u;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function W(e,t){return 2**(e-t-1)}function G(e,t){return e===2**(t-1)-1}function K(e,t,n){let r,i;try{[r,i]=H(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function q(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===j)>(e.node.kind===j)||t.node.kind===j==(e.node.kind===j)&&t.depth>e.depth)))}function pe(e){return J(e.filter(e=>e!==void 0).join(`/`))}function J(e){return e.replace(/\/{2,}/g,`/`)}function me(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Y(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function he(e){return Y(me(e))}function X(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function ge(e,t,n){return X(e,n)===X(t,n)}function _e({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let c;if(a)c=e.split(`/`);else if(i)c=t.split(`/`);else{for(c=e.split(`/`);c.length>1&&s(c)===``;)c.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&c.push(r):c=[r]:r===`..`?c.pop():r===`.`||c.push(r)}}c.length>1&&(s(c)===``?n===`never`&&c.pop():n===`always`&&c.push(``));let l=J(c.join(`/`))||`/`;return o&&r&&r.set(o,l),l}function ve(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function ye(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>xe(e,n)).join(`/`):xe(r,n):r}function be({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=ce(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=ye(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ye(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=ye(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function xe(e,t){let n=encodeURIComponent(e);return t?.(n)??n}var Se=`Error preloading route! ☝️`,Z=i(r(),1),Ce=Z.use,we=typeof window<`u`?Z.useLayoutEffect:Z.useEffect;function Te(e){let t=Z.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Ee(e,t,n={},r={}){Z.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function De(e){let t=Z.useRef(null);return Z.useImperativeHandle(e,()=>t.current,[]),t}var Oe=t();function ke({children:e,fallback:t=null}){return Ae()?(0,Oe.jsx)(Z.Fragment,{children:e}):(0,Oe.jsx)(Z.Fragment,{children:t})}function Ae(){return Z.useSyncExternalStore(je,()=>!0,()=>!1)}function je(){return()=>{}}var Me=e((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ne=e(((e,t)=>{t.exports=Me()})),Pe=e((e=>{var t=r(),n=Ne();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Fe=e(((e,t)=>{t.exports=Pe()}))();function Ie(e,t){return e===t}function Le(e,t,n=Ie){let r=(0,Z.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,Z.useCallback)(()=>e?.get(),[e]);return(0,Fe.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Re=i(o(),1);function ze(e,t){let r=n(),i=De(t),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:u,preloadDelay:d,preloadIntentProximity:f,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:x,style:S,className:C,onClick:w,onBlur:T,onFocus:E,onMouseEnter:D,onMouseLeave:O,onTouchStart:k,ignoreBlocker:te,params:ne,search:re,hash:ie,state:ae,mask:A,reloadDocument:j,unsafeRelative:oe,from:se,_fromLocation:ce,...M}=e,N=Ae(),P=Z.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),F=Le(r.stores.location,e=>e,(e,t)=>e.href===t.href),I=Z.useMemo(()=>{let e={_fromLocation:F,...P};return r.buildLocation(e)},[r,F,P]),le=I.maskedLocation?I.maskedLocation.publicHref:I.publicHref,ue=I.maskedLocation?I.maskedLocation.external:I.external,L=Z.useMemo(()=>Ke(le,ue,r.history,x),[x,ue,le,r.history]),R=Z.useMemo(()=>{if(L?.external)return ee(L.href,r.protocolAllowlist)?void 0:L.href;if(!qe(c)&&!(typeof c!=`string`||c.indexOf(`:`)===-1))try{return new URL(c),ee(c,r.protocolAllowlist)?void 0:c}catch{}},[c,L,r.protocolAllowlist]),z=Z.useMemo(()=>{if(R)return!1;if(s?.exact){if(!ge(F.pathname,I.pathname,r.basepath))return!1}else{let e=X(F.pathname,r.basepath),t=X(I.pathname,r.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(s?.includeSearch??!0)&&!b(F.search,I.search,{partial:!s?.exact,ignoreUndefined:!s?.explicitUndefined})?!1:!s?.includeHash||N&&F.hash===I.hash},[s?.exact,s?.explicitUndefined,s?.includeHash,s?.includeSearch,F,R,N,I.hash,I.pathname,I.search,r.basepath]),B=z?l(a,{})??Ve:Be,V=z?Be:l(o,{})??Be,H=[C,B.className,V.className].filter(Boolean).join(` `),U=(S||B.style||V.style)&&{...S,...B.style,...V.style},[de,fe]=Z.useState(!1),W=Z.useRef(!1),G=e.reloadDocument||R?!1:u??r.options.defaultPreload,K=d??r.options.defaultPreloadDelay??0,q=Z.useCallback(()=>{r.preloadRoute({...P,_builtLocation:I}).catch(e=>{console.warn(e),console.warn(Se)})},[r,P,I]);Ee(i,Z.useCallback(e=>{e?.isIntersecting&&q()},[q]),Ge,{disabled:!!x||G!==`viewport`}),Z.useEffect(()=>{W.current||!x&&G===`render`&&(q(),W.current=!0)},[x,q,G]);let pe=e=>{let t=e.currentTarget.getAttribute(`target`),n=y===void 0?t:y;if(!x&&!Ye(e)&&!e.defaultPrevented&&(!n||n===`_self`)&&e.button===0){e.preventDefault(),(0,Re.flushSync)(()=>{fe(!0)});let t=r.subscribe(`onResolved`,()=>{t(),fe(!1)});r.navigate({...P,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:te})}};if(R)return{...M,ref:i,href:R,...v&&{children:v},...y&&{target:y},...x&&{disabled:x},...S&&{style:S},...C&&{className:C},...w&&{onClick:w},...T&&{onBlur:T},...E&&{onFocus:E},...D&&{onMouseEnter:D},...O&&{onMouseLeave:O},...k&&{onTouchStart:k}};let J=e=>{if(x||G!==`intent`)return;if(!K){q();return}let t=e.currentTarget;if(Q.has(t))return;let n=setTimeout(()=>{Q.delete(t),q()},K);Q.set(t,n)},me=e=>{x||G!==`intent`||q()},Y=e=>{if(x||!G||!K)return;let t=e.currentTarget,n=Q.get(t);n&&(clearTimeout(n),Q.delete(t))};return{...M,...B,...V,href:L?.href,ref:i,onClick:$([w,pe]),onBlur:$([T,Y]),onFocus:$([E,J]),onMouseEnter:$([D,J]),onMouseLeave:$([O,Y]),onTouchStart:$([k,me]),disabled:!!x,target:y,...U&&{style:U},...H&&{className:H},...x&&He,...z&&Ue,...N&&de&&We}}var Be={},Ve={className:`active`},He={role:`link`,"aria-disabled":!0},Ue={"data-status":`active`,"aria-current":`page`},We={"data-transitioning":`transitioning`},Q=new WeakMap,Ge={rootMargin:`100px`},$=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ke(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function qe(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Je=Z.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=ze(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return Z.createElement(`a`,t,o)}return Z.createElement(n,a,o)});function Ye(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}export{te as A,ae as C,ne as D,x as E,C as F,s as I,m as L,f as M,ee as N,b as O,S as P,h as R,A as S,ie as T,ue as _,Ce as a,le as b,J as c,pe as d,_e as f,U as g,Y as h,Ae as i,l as j,re as k,ve as l,me as m,Le as n,we as o,he as p,ke as r,Te as s,Je as t,be as u,R as v,D as w,B as x,L as y,o as z};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/login-DrMgvqZn.js","_coffre/assets/page-CGmvjSy4.js","_coffre/assets/use-shell-BMGlJ25Q.js","_coffre/assets/suspense-C7KwSnTG.js","_coffre/assets/ui-BdipqGpP.js","_coffre/assets/link-DP8SVWon.js","_coffre/assets/icons-BQ27Ds9u.js","_coffre/assets/signin-errors-CroZWZgm.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./preload-helper-ClBkJ19f.js";var r=t(`/login`)({validateSearch:e=>{let t={},{next:n,error:r}=e;return typeof n==`string`&&n.startsWith(`/`)&&!n.startsWith(`//`)&&(t.next=n),typeof r==`string`&&/^[a-z_]{1,40}$/.test(r)&&(t.error=r),t},component:e(()=>n(()=>import(`./login-DrMgvqZn.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`component`)});export{r as t};
@@ -1 +0,0 @@
1
- import{U as e,Z as t,et as n,n as r}from"./page-CGmvjSy4.js";import{t as i}from"./use-shell-BMGlJ25Q.js";import{a,c as o}from"./ui-BdipqGpP.js";import{L as s,N as c,S as l}from"./icons-BQ27Ds9u.js";import{t as u}from"./login-CeaxDMcr.js";import{t as d}from"./signin-errors-CroZWZgm.js";var f=n(t()),p=e();function m(){let{signin:e,access:t}=i().auth;return e===null?t?.assertion?(0,p.jsx)(g,{}):(0,p.jsx)(h,{}):(0,p.jsx)(_,{...e})}function h(){return(0,p.jsxs)(r,{icon:(0,p.jsx)(l,{size:18}),label:`Cloudflare Access`,title:`Open coffre through Access`,children:[(0,p.jsx)(`p`,{children:`This instance has no sign-in of its own. Cloudflare Access authenticates you before a request ever reaches coffre, and this request arrived without an Access assertion.`}),(0,p.jsx)(`p`,{children:`Use the Access-protected hostname. A request straight to the origin is refused by design.`})]})}function g(){return(0,p.jsxs)(r,{icon:(0,p.jsx)(s,{size:18}),label:`Cloudflare Access`,title:`Your identity could not be confirmed`,children:[(0,p.jsx)(`p`,{children:`Cloudflare Access forwarded an identity assertion, but coffre could not verify it. The Access session may have expired, or the identity verifier may be unavailable.`}),(0,p.jsx)(`p`,{children:`Reopen coffre through its Access-protected hostname. If this keeps happening, tell whoever operates coffre.`})]})}function _({title:e,note:t,providers:n}){let{next:r,error:i}=u.useSearch(),s=d(i),[l,m]=(0,f.useState)(null),h=r===void 0?``:`?next=${encodeURIComponent(r)}`;return(0,p.jsxs)(`section`,{className:`card signin`,"aria-labelledby":`signin-title`,children:[(0,p.jsxs)(`div`,{className:`signin-head`,children:[(0,p.jsx)(`h1`,{className:`signin-title`,id:`signin-title`,children:e}),(0,p.jsx)(`p`,{className:`signin-lede`,children:t??`Sign in with your organization’s account. Only people an owner has invited can get in.`})]}),s!==null&&(0,p.jsx)(`div`,{className:`signin-error`,children:(0,p.jsx)(a,{error:s})}),n.length===0?(0,p.jsxs)(`p`,{className:`signin-empty`,children:[`No sign-in provider is configured. Whoever runs coffre lists them in`,` `,(0,p.jsxs)(`span`,{className:`mono`,children:[`signin(`,`{`,` providers `,`}`,`)`]}),`.`]}):(0,p.jsx)(`ul`,{className:`providers`,children:n.map(e=>(0,p.jsx)(`li`,{children:(0,p.jsxs)(`a`,{className:`btn provider`,href:`/auth/signin/${encodeURIComponent(e.id)}${h}`,"aria-busy":l===e.id,onClick:()=>m(e.id),children:[(0,p.jsx)(`span`,{className:`provider-mark`,"aria-hidden":!0,children:l===e.id?(0,p.jsx)(o,{}):(0,p.jsx)(c,{brand:e.brand})}),`Continue with `,e.label]})},e.id))})]})}export{m as component};
@@ -1 +0,0 @@
1
- import{U as e,t}from"./page-CGmvjSy4.js";import{t as n}from"./link-DP8SVWon.js";import{i as r,l as i,s as a}from"./ui-BdipqGpP.js";import{G as o,H as s,s as c,v as l}from"./icons-BQ27Ds9u.js";import{s as u}from"./directory-nDExpkAz.js";var d=e();function f({report:e}){let t=e.status===`removed`,n=e.principalType===`user`;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{report:e,removed:t,person:n}),e.syncs.length>0&&(0,d.jsx)(g,{report:e,person:n}),e.issuedTokens.length>0&&(0,d.jsx)(_,{report:e})]})}function p({report:e}){let t=e.principalType===`user`;return(0,d.jsx)(`div`,{className:`report-notice`,children:(0,d.jsxs)(a,{children:[`Removed`,e.removedBy!==null&&(0,d.jsxs)(d.Fragment,{children:[` `,`by `,(0,d.jsx)(`span`,{className:`mono`,children:e.removedBy})]}),e.removedAt!==null&&(0,d.jsxs)(d.Fragment,{children:[` `,`on `,(0,d.jsx)(i,{iso:e.removedAt})]}),`.`,` `,t?`Their project access, sessions, CLI logins and linked sign-in accounts were revoked at the same time, so adding them again starts from nothing.`:`Its project access and every token issued to it were revoked at the same time, so adding it again starts from nothing.`]})})}function m({principalType:e,removed:t}){let n=e===`user`,r=t.filter(t=>t.principalType===e);return r.length===0?null:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`h2`,{className:`section-title`,children:`Removed`}),(0,d.jsx)(`section`,{className:`card`,"aria-label":n?`Removed users`:`Removed tokens`,children:(0,d.jsx)(`div`,{className:`dt-wrap`,children:(0,d.jsxs)(`table`,{className:`dt directory stacks`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{className:`n`,children:`#`}),(0,d.jsx)(`th`,{className:`col-principal`,children:(0,d.jsxs)(`span`,{className:`th`,children:[n?(0,d.jsx)(o,{size:14}):(0,d.jsx)(l,{size:14}),n?`Email`:`Name`]})}),(0,d.jsx)(`th`,{className:`col-role`,children:`Still to rotate`}),(0,d.jsx)(`th`,{className:`col-actions`,children:(0,d.jsx)(`span`,{className:`visually-hidden`,children:`Report`})})]})}),(0,d.jsx)(`tbody`,{children:r.map((e,t)=>(0,d.jsxs)(`tr`,{className:`row-link`,children:[(0,d.jsx)(`td`,{className:`n`,children:t+1}),(0,d.jsx)(`td`,{className:`col-lead`,"data-label":n?`Email`:`Name`,children:(0,d.jsx)(u,{type:e.principalType,id:e.principalId,stretch:!0})}),(0,d.jsx)(`td`,{className:`col-role`,"data-label":`Still to rotate`,children:e.toRotate===0?(0,d.jsx)(`span`,{className:`cell-muted`,children:`Nothing`}):`${e.toRotate} ${e.toRotate===1?`value`:`values`}`}),(0,d.jsx)(`td`,{className:`col-actions col-open cell-muted`,"aria-hidden":`true`,children:(0,d.jsx)(c,{size:16})})]},e.principalId))})]})})}),(0,d.jsxs)(`p`,{className:`hint section-foot`,children:[n?`They`:`These`,` can no longer sign in. Each page lists the values`,` `,n?`they`:`it`,` saw that nobody has changed since.`]})]})}function h({report:e,removed:a,person:o}){let s=o?`they`:`it`,c=a?`Values ${s} read or wrote that nobody has changed since, so ${s} may still hold them. Rotate each where it comes from, such as a new API key or database password, then save the new value here and it leaves this list.`:`Current values ${s} ${o?`have`:`has`} read or written: the ones to rotate if ${s} ${o?`leave`:`is retired`}. Saving a new version takes a value off.`;return(0,d.jsx)(t,{labelledBy:`seen-values`,title:a?`Still to rotate`:`Values seen`,description:c,actions:e.rotated>0&&(0,d.jsxs)(`span`,{className:`card-aside`,children:[e.rotated,` already rotated`]}),children:e.exposed.length===0?(0,d.jsx)(r,{title:a?`Nothing left to rotate`:`No current values seen`,children:e.rotated>0?`Every value ${s} saw has had a new version since.`:`${o?`They have`:`It has`} not read or written a value that is still current.`}):(0,d.jsx)(`div`,{className:`dt-wrap`,children:(0,d.jsxs)(`table`,{className:`dt report-values`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{children:`Secret`}),(0,d.jsx)(`th`,{className:`col-shrink`,children:`Version`}),(0,d.jsx)(`th`,{className:`col-shrink`,children:`Last seen`})]})}),(0,d.jsx)(`tbody`,{children:e.exposed.map(e=>(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`td`,{children:(0,d.jsxs)(n,{className:`cell-link mono`,to:`/projects/$project/$environment`,params:{project:e.project,environment:e.environment},search:{filter:e.key},children:[(0,d.jsxs)(`span`,{className:`report-path`,children:[e.project,`/`,e.environment,`/`]}),e.key]})}),(0,d.jsxs)(`td`,{className:`col-shrink cell-mono cell-muted`,children:[`v`,e.version]}),(0,d.jsxs)(`td`,{className:`col-shrink nowrap`,children:[e.how===`wrote`?`Wrote`:`Read`,` `,(0,d.jsx)(i,{iso:e.at,display:`relative`})]})]},`${e.project}/${e.environment}/${e.key}`))})]})})})}function g({report:e,person:r}){return(0,d.jsx)(t,{labelledBy:`created-syncs`,title:r?`Syncs they set up`:`Syncs it set up`,description:`A sync keeps pushing every change to the destination it names, whoever set it up. Check each one still points somewhere you control.`,children:(0,d.jsx)(`div`,{className:`dt-wrap`,children:(0,d.jsxs)(`table`,{className:`dt syncs`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{children:`Destination`}),(0,d.jsx)(`th`,{className:`col-shrink`,children:`From`}),(0,d.jsx)(`th`,{className:`col-shrink col-hide-narrow`,children:`Token`})]})}),(0,d.jsx)(`tbody`,{children:e.syncs.map(e=>(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`td`,{children:(0,d.jsxs)(`span`,{className:`cell-account`,children:[(0,d.jsx)(s,{brand:e.brand,size:15}),(0,d.jsxs)(`span`,{className:`cell-stack`,children:[(0,d.jsxs)(`span`,{children:[e.providerLabel,e.paused&&(0,d.jsx)(`span`,{className:`tag`,children:`Paused`})]}),(0,d.jsx)(`small`,{className:`mono`,children:e.destination})]})]})}),(0,d.jsx)(`td`,{className:`col-shrink`,children:(0,d.jsxs)(n,{className:`cell-link mono`,to:`/projects/$project/$environment`,params:{project:e.project,environment:e.environment},children:[e.project,`/`,e.environment]})}),(0,d.jsx)(`td`,{className:`col-shrink col-hide-narrow cell-mono cell-muted`,children:e.credential})]},e.id))})]})})})}function _({report:e}){return(0,d.jsx)(t,{labelledBy:`issued-tokens`,title:`Tokens they issued`,description:`Service tokens they created that still work. Each was shown to them once, when it was made; revoke any they may have kept a copy of.`,children:(0,d.jsx)(`div`,{className:`dt-wrap`,children:(0,d.jsxs)(`table`,{className:`dt report-tokens`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`th`,{children:`Token`}),(0,d.jsx)(`th`,{className:`col-shrink`,children:`Expires`}),(0,d.jsx)(`th`,{className:`col-shrink col-hide-narrow`,children:`Last used`})]})}),(0,d.jsx)(`tbody`,{children:e.issuedTokens.map(e=>(0,d.jsxs)(`tr`,{children:[(0,d.jsx)(`td`,{children:(0,d.jsxs)(`span`,{className:`cell-stack`,children:[(0,d.jsx)(n,{className:`cell-link mono`,to:`/tokens/$token`,params:{token:e.service},children:e.service}),(0,d.jsxs)(`small`,{children:[e.label??`No label`,` · `,(0,d.jsx)(`span`,{className:`mono`,children:e.hint})]})]})}),(0,d.jsx)(`td`,{className:`col-shrink nowrap`,children:(0,d.jsx)(i,{iso:e.expiresAt,display:`relative`})}),(0,d.jsx)(`td`,{className:`col-shrink col-hide-narrow nowrap`,children:e.lastUsedAt===null?(0,d.jsx)(`span`,{className:`cell-muted`,children:`Never`}):(0,d.jsx)(i,{iso:e.lastUsedAt,display:`relative`})})]},e.id))})]})})})}export{m as n,p as r,f as t};
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=j(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1);function p(e){return Object.fromEntries(e.fields.map(e=>[e.name,e.type===`text`?``:e.initial]))}function m(e,t){if(e.type===`options`||e.when===void 0)return!0;let n=t[e.when.field],r=Array.isArray(n)?n:[];return r.length===e.when.is.length&&e.when.is.every(e=>r.includes(e))}function h(e,t){for(let n of e.fields){if(!m(n,t))continue;let e=t[n.name];if((typeof e==`string`?e.trim()===``:(e??[]).length===0)&&(n.type===`options`||n.optional!==!0))return n.label}return null}function g(e,t){let n={};for(let r of e.fields){if(!m(r,t))continue;let e=t[r.name];if(r.type===`options`){let t=Array.isArray(e)?e:[];n[r.name]=r.multiple?t:t[0]}else{let t=typeof e==`string`?e.trim():``;t!==``&&(n[r.name]=t)}}return n}var _=Symbol.for(`@coffre/client:CoffreError`),v=class extends Error{static[Symbol.hasInstance](e){return typeof e==`object`&&!!e&&_ in e}[_]=!0;status;code;reason;constructor(e,t,n,r){super(n),this.name=`CoffreError`,this.status=e,this.code=t,this.reason=r}};function y(e){let[t=``,n=``,r=``]=e.replace(/^\/+|\/+$/g,``).split(`/`);return{project:t,environment:n,key:r}}function b(e){let t=e.url.replace(/\/+$/,``),n=e.transport??(e=>fetch(e));async function r(r,i,a){let o=new URL(`${t}/api${i}`),s=new Headers(await e.headers?.()),c;if(r===`GET`)for(let[e,t]of Object.entries(a??{}))t!=null&&o.searchParams.set(e,String(t));else a!==void 0&&(s.set(`content-type`,`application/json`),c=JSON.stringify(a));let l=await n(new Request(o,{method:r,headers:s,body:c})),u=await l.json().catch(()=>null);if(!l.ok){let e=u;throw new v(l.status,typeof e?.error==`string`?e.error:`http_error`,typeof e?.message==`string`?e.message:`request failed with status ${l.status}`,typeof e?.reason==`string`?e.reason:void 0)}return u}function i(e,t){let[n,r]=e.split(` `);return[n,r.replace(/:(\w+)/g,(e,n)=>encodeURIComponent(t[n]))]}async function a(e,...[t,n]){let[a,o]=i(e,t);return await r(a,o,n)}return{call:a,auth:()=>r(`GET`,`/auth`,void 0),me:()=>a(`GET /me`,{}),projects:{list:()=>a(`GET /projects`,{}),create:(e,t)=>a(`PUT /projects/:project`,{project:e},t),update:(e,t)=>a(`PATCH /projects/:project`,{project:e},t)},environments:{create:(e,t)=>a(`PUT /projects/:project/:environment`,y(e),t),update:(e,t)=>a(`PATCH /projects/:project/:environment`,y(e),t)},secrets:{list:e=>a(`GET /secrets/:project/:environment`,y(e)),reveal:e=>a(`POST /reveals`,{},{path:e}),set:(e,t)=>a(`PATCH /secrets/:project/:environment`,y(e),t),dryRun:(e,t)=>{let[n,a]=i(`PATCH /secrets/:project/:environment`,y(e));return r(n,`${a}?dryRun=1`,t)},history:e=>a(`GET /secrets/:project/:environment/:key/versions`,y(e)),restore:(e,t)=>a(`POST /secrets/:project/:environment/:key/restore`,y(e),{version:t}),rename:(e,t)=>a(`PATCH /secrets/:project/:environment/:key`,y(e),{key:t}),update:(e,t)=>a(`PATCH /secrets/:project/:environment/:key`,y(e),t)},members:{list:e=>a(`GET /members`,{},{path:e}),get:e=>a(`GET /members/:member`,{member:e}),add:(e,t={})=>a(`PUT /members/:member`,{member:e},t),remove:e=>a(`DELETE /members/:member`,{member:e})},tokens:{list:e=>a(`GET /members/:member/tokens`,{member:e}),issue:(e,t)=>a(`POST /members/:member/tokens`,{member:e},t),revoke:(e,t)=>a(`DELETE /members/:member/tokens/:id`,{member:e,id:t})},access:{set:(e,t)=>a(`PATCH /access/:member`,{member:e},t)},sessions:{list:()=>a(`GET /sessions`,{}),revoke:e=>a(`DELETE /sessions/:id`,{id:e})},identities:{list:()=>a(`GET /identities`,{}),unlink:e=>a(`DELETE /identities/:id`,{id:e})},deviceLogins:{get:e=>a(`GET /device-logins/:code`,{code:e}),decide:(e,t)=>a(`POST /device-logins/:code`,{code:e},{approve:t})},syncs:{providers:()=>a(`GET /syncs/providers`,{}),list:e=>a(`GET /syncs/:project/:environment`,y(e)),add:(e,t)=>a(`POST /syncs/:project/:environment`,y(e),t),update:(e,t)=>a(`PATCH /syncs/by-id/:id`,{id:e},t),remove:e=>a(`DELETE /syncs/by-id/:id`,{id:e}),run:e=>a(`POST /syncs/by-id/:id/runs`,{id:e})},audit:{list:(e={})=>a(`GET /audit`,{},e),verify:()=>a(`GET /audit/verification`,{}),keys:()=>a(`GET /audit/keys`,{})}}}async function x(e,t,n){let r=Object.create(null);for(let{key:e,value:t}of n)r[e]=t;let[i,a]=await Promise.allSettled([e.secrets.list(t),e.secrets.dryRun(t,{...r})]);if(i.status===`rejected`)throw i.reason;if(a.status===`rejected`)throw a.reason;let[{keys:o},s]=[i.value,a.value],c=new Map(o.map(e=>[e.key,e.version])),l=[],u=Object.create(null);for(let[e,t]of Object.entries(r)){let n=s.keys[e];l.push({key:e,action:n,version:c.get(e)??null}),n!==`unchanged`&&(u[e]=t)}return{plan:l,changes:{...u}}}var S=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),C=o(((e,t)=>{t.exports=S()})),w=f.createContext(null);function T(e){return f.useContext(w)}var E={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},D=new class{#e=E;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function O(e){setTimeout(e,0)}var ee=typeof window>`u`||`Deno`in globalThis;function k(){}function A(e,t){return typeof e==`function`?e(t):e}function te(e){return typeof e==`number`&&e>=0&&e!==1/0}function j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function M(e,t){return typeof e==`function`?e(t):e}function N(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==F(o,t.options))return!1}else if(!L(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function P(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(I(t.options.mutationKey)!==I(a))return!1}else if(!L(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function F(e,t){return(t?.queryKeyHashFn||I)(e)}function I(e){return JSON.stringify(e,(e,t)=>z(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function L(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!L(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!L(e[r],t[r]))return!1;return!0}return!1}var ne=Object.prototype.hasOwnProperty;function R(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ie(e)&&ie(t);if(!r&&!(z(e)&&z(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ne.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=R(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function re(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function z(e){if(!ae(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ae(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ae(e){return Object.prototype.toString.call(e)===`[object Object]`}function oe(e){return new Promise(t=>{D.setTimeout(t,e)})}function se(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:R(e,t)}function ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function le(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var B=Symbol();function ue(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===B?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=()=>ee,V=()=>pe(),H=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},U=new class extends H{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},me=O;function he(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=me,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var W=he(),G=new class extends H{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ge(e){return Math.min(1e3*2**e,3e4)}function _e(e){return(e??`online`)!==`online`||G.isOnline()}var K=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ve(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(k);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new K(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>U.isFocused()&&(e.networkMode===`always`||G.isOnline())&&e.canRun(),p=()=>_e(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(V()?0:3),a=e.retryDelay??ge,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),oe(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var ye=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),te(this.gcTime)&&(this.#e=D.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(V()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(D.clearTimeout(this.#e),this.#e=void 0)}};function be(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?le:ce;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Se:xe,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:xe(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function xe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Se(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ce=class extends ye{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ee(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ee(this.options);e.data!==void 0&&(this.setState(Te(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=se(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(k).catch(k):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>M(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===B||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>M(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!j(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?be(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=ve({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof K&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof K){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...we(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Te(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),W.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function we(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_e(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Te(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ee(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var De=class extends ye{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Oe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=ve({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),W.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Oe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ke=class extends H{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new De({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=q(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=q(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=q(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=q(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){W.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>P(t,e))}findAll(e={}){return this.getAll().filter(t=>P(e,t))}notify(e){W.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return W.batch(()=>Promise.all(e.map(e=>e.continue().catch(k))))}};function q(e){return e.options.scope?.id}var Ae=class extends H{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??F(r,t),a=this.get(i);return a||(a=new Ce({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){W.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>N(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>N(e,t)):t}notify(e){W.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){W.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){W.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},je=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ae,this.#t=e.mutationCache||new ke,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=U.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=G.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(M(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=A(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return W.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;W.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return W.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=W.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(k).catch(k)}invalidateQueries(e,t={}){return W.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=W.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(k)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(k)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(M(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(M(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(k).catch(k)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(k).catch(k)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return G.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(I(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{L(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(I(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{L(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=F(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===B&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function J(e){return e}var Me={canManageGrants:!1,canReadAudit:!1,canCreateProject:!1};function Ne(e,t){if(e===null)return Me;let n=e.instanceRole===`owner`||e.instanceRole===`root-admin`;return{canManageGrants:n,canReadAudit:e.canReadAudit,canCreateProject:n}}function Pe(e){return e.includes(`secret.read`)}function Fe(){return T().options.context.client}var Ie=class extends Error{};function Y(e){return e instanceof v?e.status:void 0}function Le(e){return e instanceof Ie?e.message:e instanceof v?e.status===401?`Your session has ended. Sign in again, then retry.`:e.code===`cross_origin`?`coffre refused a change that did not come from this page. Reload, then retry.`:e.status===403?`You hold no grant that covers this. Someone with grant.manage on the project can add one.`:e.status===404?`Not found. It may have been renamed or archived.`:e.status===400||e.status===409?e.message:`coffre is unavailable. Nothing was read or written.`:`The request could not be sent. Nothing was changed.`}function Re(e){return{ok:!1,error:Le(e),signedOut:Y(e)===401}}async function X(e){try{return{ok:!0,...await e()}}catch(e){return Re(e)}}function ze(e,t){return`${e===`user`?`user`:`token`}:${t}`}var Be=1e4;function Ve(){return new je({defaultOptions:{queries:{staleTime:Be,refetchOnWindowFocus:!0,retry:!1}}})}var Z={me:[`me`],auth:[`auth`],projects:[`projects`],grants:e=>[`grants`,e],secrets:({project:e,environment:t})=>[`secrets`,e,t],syncs:({project:e,environment:t})=>[`syncs`,e,t],directory:[`directory`],report:e=>[`report`,e],credentials:e=>[`credentials`,e],identities:[`identities`],sessions:[`sessions`],audit:[`audit`]};function He(e){return e.flatMap(e=>e.grants.map(t=>({id:t.id,principalType:e.principalType,principalId:e.principalId,role:t.role,roleName:t.roleName,permissions:t.permissions,scope:t.environment===null?`project`:`environment`,environmentSlug:t.environment,expiresAt:t.expiresAt})))}function Ue(e){return X(async()=>{let{members:t,removed:n}=await e.members.list();return{principals:t.map(({principalType:e,principalId:t,instanceRole:n,isRootAdmin:r,tampered:i})=>({principalType:e,principalId:t,instanceRole:n,isRootAdmin:r,tampered:i})),removed:n}})}var We=e=>X(()=>e.projects.list()),Q={me:e=>J({queryKey:Z.me,queryFn:async()=>{try{return await e.me()}catch(e){if(Y(e)===401)return null;throw e}}}),auth:e=>J({queryKey:Z.auth,queryFn:()=>e.auth()}),projects:e=>J({queryKey:Z.projects,queryFn:()=>We(e)}),grants:(e,t)=>J({queryKey:Z.grants(t),queryFn:()=>X(async()=>({grants:He((await e.members.list(t)).members)}))}),secrets:(e,t)=>J({queryKey:Z.secrets(t),queryFn:()=>X(()=>e.secrets.list(`${t.project}/${t.environment}`))}),syncs:(e,t)=>J({queryKey:Z.syncs(t),queryFn:()=>X(()=>e.syncs.list(`${t.project}/${t.environment}`))}),directory:(e,t)=>J({queryKey:[...Z.directory,{owner:t}],queryFn:()=>t?Ue(e):Promise.resolve({ok:!1,error:`Only owners can manage users and service accounts.`,signedOut:!1})}),report:(e,t,n)=>J({queryKey:[...Z.report(t),{owner:n}],queryFn:()=>n?X(async()=>{try{return{report:await e.members.get(t)}}catch(e){if(Y(e)===404)return{report:null};throw e}}):Promise.resolve(null)}),credentials:(e,t,n)=>J({queryKey:[...Z.credentials(t),{allowed:n}],queryFn:()=>n?X(()=>e.tokens.list(t)):Promise.resolve(null)}),identities:e=>J({queryKey:Z.identities,queryFn:()=>X(()=>e.identities.list())}),sessions:e=>J({queryKey:Z.sessions,queryFn:()=>X(()=>e.sessions.list())}),auditEntries:(e,t)=>J({queryKey:[...Z.audit,`entries`,t],staleTime:0,queryFn:()=>X(()=>e.audit.list({limit:200,decision:t.decision,actor:t.actorId,detail:t.detail}))}),auditChain:e=>J({queryKey:[...Z.audit,`chain`],staleTime:0,queryFn:()=>Ge(e)})};async function Ge(e){try{let t=await e.audit.verify();return t.ok?{integrity:`intact`,through:t.through,entries:t.entries,checkpoint:t.checkpoint,pending:t.pending??0}:{integrity:`broken`,through:t.through,failedAtSeq:t.failedAtSeq,author:t.author,reason:t.reason}}catch(e){let t=Y(e);return t===403?{integrity:`owners-only`}:{integrity:`unknown`,problem:t===void 0?`the request never got an answer`:`the request failed with HTTP ${t}`}}}function Ke(e,t,n){let r=n.ok?n.projects:[],i=t?.registered===!0?t:null;return{auth:e,principal:t===null?null:t.principal,instanceRole:i?.instanceRole??null,projects:r,capabilities:Ne(i,r),registrationRequired:t!==null&&!t.registered,accessTampered:t?.tampered===!0}}async function qe(e,t){let[n,r,i]=await Promise.all([e.fetchQuery(Q.auth(t)),e.fetchQuery(Q.me(t)),e.fetchQuery(Q.projects(t))]);return Ke(n,r,i)}function Je(e,t){if(!e.ok)return e;let n=e.projects.find(e=>e.slug===t);return n===void 0?{ok:!1,error:null}:{ok:!0,project:n,managesAccess:n.permissions.includes(`grant.manage`)}}async function Ye(e,t,n){let r=Je(await e.fetchQuery(Q.projects(t)),n);r.ok&&r.managesAccess&&await e.fetchQuery(Q.grants(t,n))}async function Xe(e,t){let n=await qe(e,t);return e.fetchQuery(Q.directory(t,n.capabilities.canManageGrants))}async function Ze(e,t,n,r){let i=await qe(e,t),a=ze(n,r),o=i.capabilities.canManageGrants;await Promise.all([e.fetchQuery(Q.report(t,a,o)),n===`service`?e.fetchQuery(Q.credentials(t,a,o&&i.auth.signin!==null)):null,...Qe(i.projects).map(n=>e.fetchQuery(Q.grants(t,n.slug)))])}function Qe(e){return e.filter(e=>e.permissions.includes(`grant.manage`))}var $e={places:()=>[Z.projects,Z.me],secrets:e=>[Z.secrets(e),Z.syncs(e),Z.projects],syncs:e=>[Z.syncs(e)],access:(e,t)=>[Z.grants(e),Z.report(t),Z.projects,Z.me],admission:()=>[Z.directory],role:e=>[Z.directory,Z.report(e),Z.me,Z.projects],removal:e=>[Z.directory,Z.report(e),[`grants`]],credentials:e=>[Z.credentials(e)],identities:()=>[Z.identities,Z.sessions],sessions:()=>[Z.sessions]};async function et(e,t){await Promise.all([...t,Z.audit].map(t=>e.invalidateQueries({queryKey:t})))}var $=C(),tt=[`blue`,`green`,`amber`,`violet`];function nt(e){let t=2166136261;for(let n of e)t=Math.imul(t^n.charCodeAt(0),16777619)>>>0;return tt[t%tt.length]}function rt({name:e,size:t=`sm`}){return(0,$.jsx)(`span`,{className:`tile tile-${nt(e)}${t===`lg`?` tile-lg`:``}`,"aria-hidden":!0,children:e.slice(0,1)})}function it({tile:e,lead:t,title:n,aside:r,description:i,meta:a,actions:o}){return(0,$.jsxs)(`header`,{className:`page-head`,children:[(0,$.jsxs)(`div`,{className:`page-head-text`,children:[e!==void 0&&(0,$.jsx)(rt,{name:e,size:`lg`}),t,(0,$.jsxs)(`div`,{style:{minWidth:0},children:[(0,$.jsxs)(`h1`,{className:`page-title`,children:[(0,$.jsx)(`span`,{children:n}),r!=null&&(0,$.jsx)(`span`,{className:`page-title-aside`,children:r})]}),i!==void 0&&(0,$.jsx)(`p`,{className:`page-desc`,children:i}),a!==void 0&&(0,$.jsx)(`div`,{className:`page-meta`,children:a})]})]}),o!==void 0&&o!==!1&&(0,$.jsx)(`div`,{className:`page-actions`,children:o})]})}function at({title:e,description:t,actions:n,children:r,labelledBy:i,tone:a}){return(0,$.jsxs)(`section`,{className:`card${a===`danger`?` card-danger`:``}`,"aria-labelledby":i,children:[(0,$.jsxs)(`div`,{className:`card-head`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{className:`card-title`,id:i,children:e}),t!==void 0&&(0,$.jsx)(`p`,{className:`card-desc`,children:t})]}),n]}),r]})}function ot({label:e,children:t}){return(0,$.jsxs)(`div`,{className:`fact`,children:[(0,$.jsx)(`dt`,{children:e}),(0,$.jsx)(`dd`,{children:t})]})}function st({icon:e,label:t,title:n,children:r,actions:i}){return(0,$.jsxs)(`div`,{className:`closed`,role:`status`,children:[e!==void 0&&(0,$.jsx)(`div`,{className:`closed-icon`,"aria-hidden":!0,children:e}),t!==void 0&&(0,$.jsx)(`p`,{className:`closed-label`,children:t}),(0,$.jsx)(`h1`,{className:`closed-title`,children:n}),(0,$.jsx)(`div`,{className:`closed-body`,children:r}),i!==void 0&&(0,$.jsx)(`div`,{className:`closed-actions`,children:i})]})}export{s as $,V as A,D as B,Fe as C,W as D,we as E,R as F,g as G,w as H,M as I,p as J,b as K,re as L,te as M,k as N,U as O,se as P,o as Q,de as R,X as S,Oe as T,C as U,T as V,v as W,x as X,m as Y,d as Z,Ke as _,rt as a,ze as b,Z as c,Ye as d,l as et,qe as f,et as g,Q as h,it as i,I as j,H as k,Xe as l,Je as m,st as n,$e as o,Qe as p,h as q,ot as r,Ve as s,at as t,Ze as u,Ie as v,Pe as w,Y as x,Le as y,j as z};
@@ -1 +0,0 @@
1
- import{U as e,V as t,Z as n,et as r}from"./page-CGmvjSy4.js";import{C as i,P as a,R as o,a as s,d as c,h as l,m as u,n as d,t as f}from"./link-DP8SVWon.js";var p=`__root__`;function m(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function h(e){return e instanceof Response&&!!e.options}function g(e){if(typeof e==`object`&&e&&e.isSerializedRedirect)return m(e)}var _=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=p:this.parentRoute||i();let r=n?p:t?.path;r&&r!==`/`&&(r=u(r));let a=t?.id||r,o=n?p:c([this.parentRoute.id===`__root__`?``:this.parentRoute.id,a]);r===`__root__`&&(r=`/`),o!==`__root__`&&(o=c([`/`,o]));let s=o===`__root__`?`/`:c([this.parentRoute.fullPath,r]);this._path=r,this._id=o,this._fullPath=s,this._to=l(s)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>m({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},v=class extends _{constructor(e){super(e)}},y=r(n(),1),b=y.createContext(void 0),x=y.createContext(void 0),S={get(){},subscribe(){return{unsubscribe(){}}}};function C(e,t){let n=y.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=o(n.current,i):i}}function w(e){let n=t(),r=y.useContext(e.from?x:b),a=e.from?n.stores.getRouteMatchStore(e.from):n.stores.matchStores.get(r),o=C(e,n),s=d(a??S,e=>e?o(e):S);if(s!==S)return s;(e.shouldThrow??!0)&&i()}function T(e){return w({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function E(e){let{select:t,...n}=e;return w({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function D(e){return w({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function O(e){return w({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function k(e){let n=t();return y.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}function A(e){return w({...e,select:t=>e.select?e.select(t.context):t.context})}var j=e(),M=class extends _{constructor(e){super(e),this.useMatch=e=>w({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>A({...e,from:this.id}),this.useSearch=e=>O({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>E({...e,from:this.id}),this.useLoaderData=e=>T({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=y.forwardRef((e,t)=>(0,j.jsx)(f,{ref:t,from:this.fullPath,...e}))}};function N(e){return new M(e)}function P(){return e=>I(e)}var F=class extends v{constructor(e){super(e),this.useMatch=e=>w({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>A({...e,from:this.id}),this.useSearch=e=>O({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>D({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>E({...e,from:this.id}),this.useLoaderData=e=>T({...e,from:this.id}),this.useNavigate=()=>k({from:this.fullPath}),this.Link=y.forwardRef((e,t)=>(0,j.jsx)(f,{ref:t,from:this.fullPath,...e}))}};function I(e){return new F(e)}function L(e){return new R(e,{silent:!0}).createRoute}var R=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=N(e);return t.isRoot=!1,t},this.silent=t?.silent}};function z(e,t){let n,r,i,o,c=()=>(n||=e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{if(i=e,a(i)&&i instanceof Error&&typeof window<`u`&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;sessionStorage.getItem(e)||(sessionStorage.setItem(e,`1`),o=!0)}}),n),l=function(e){if(o)throw window.location.reload(),new Promise(()=>{});if(i)throw i;if(!r)if(s)s(c());else throw c();return y.createElement(r,e)};return l.preload=c,l}var B=`modulepreload`,V=function(e){return`/`+e},H={},U=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=V(t,n),t=s(t),t in H)return;H[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:B,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};export{k as a,h as c,p as d,P as i,g as l,z as n,C as o,L as r,b as s,U as t,m as u};
@@ -1 +0,0 @@
1
- import{C as e,U as t,Z as n,a as r,b as i,et as a,h as o,i as s,n as c,o as l,p as u}from"./page-CGmvjSy4.js";import{t as d}from"./link-DP8SVWon.js";import{E as f,l as p,n as m}from"./use-change-BRRMJocl.js";import{n as h,t as g}from"./use-shell-BMGlJ25Q.js";import{t as _}from"./useSuspenseQuery-CSXyDALB.js";import{n as v}from"./dist-QVHMLatb.js";import{a as y,c as b,i as x,o as S,s as C}from"./ui-BdipqGpP.js";import{A as w,J as T,l as E,p as D,q as O,v as k}from"./icons-BQ27Ds9u.js";import{t as A}from"./row-state-ByET1OKX.js";import{a as j,i as M,o as ee,r as N}from"./directory-nDExpkAz.js";import{t as P}from"./use-action-DRm9yVhV.js";import{n as F,t as I}from"./grants-CjoOnxzz.js";import{r as L,t as R}from"./offboarding-CNr_1tnl.js";var z=a(n(),1);function B(e,t){return Object.hasOwn(e.environments,t)?e.environments[t]:null}function V(e,t){if(e.length===0)return{level:`none`,expiresAt:null,environments:{}};let[n]=e;if(e.length===1&&n.environmentSlug===null&&(n.role===`owner`||n.role===`viewer`||n.role===`developer`))return{level:n.role,expiresAt:n.expiresAt,environments:{}};let r={};for(let n of e){let e=n.environmentSlug;if(e===null||!t.includes(e)||Object.hasOwn(r,e)||n.role!==`viewer`&&n.role!==`developer`)return{level:`custom`,expiresAt:null,environments:{}};r[e]={role:n.role,expiresAt:n.expiresAt}}return{level:`env`,expiresAt:null,environments:r}}function H(e,t,n){if(t===`env`&&(e.level===`viewer`||e.level===`developer`)&&Object.keys(e.environments).length===0){let r={role:e.level,expiresAt:e.expiresAt};return{...e,level:t,environments:Object.fromEntries(n.map(e=>[e,r]))}}return{...e,level:t}}function U(e,t,n){let r={...e.environments};return n===null?delete r[t]:r[t]=n,{...e,environments:r}}function W(e){switch(e.level){case`none`:case`custom`:return[];case`owner`:case`viewer`:case`developer`:return[{role:e.level,environmentSlug:null,expiresAt:e.expiresAt}];case`env`:return Object.entries(e.environments).map(([e,t])=>({environmentSlug:e,...t}))}}function G(e,t){return e===t||e!==null&&t!==null&&Date.parse(e)===Date.parse(t)}function K(e,t){if(t.level===`custom`)return[];let n=e=>`${e.role}@${e.environmentSlug??``}`,r=new Map(W(t).map(e=>[n(e),e])),i=new Map(e.map(e=>[n(e),e])),a=[];for(let[e,t]of r)i.has(e)||a.push({kind:`create`,...t});for(let[e,t]of i){let n=r.get(e);n!==void 0&&!G(t.expiresAt,n.expiresAt)&&a.push({kind:`expiry`,grant:t,expiresAt:n.expiresAt})}for(let[e,t]of i)r.has(e)||a.push({kind:`revoke`,grant:t});return a}function q(e,t){let n=t=>t===null?e:`${e}/${t}`,r=(e,t)=>t===null?e:{role:e,until:t},i={};for(let e of t)e.kind===`revoke`&&(i[n(e.grant.environmentSlug)]=null);for(let e of t)e.kind===`expiry`&&(i[n(e.grant.environmentSlug)]=r(e.grant.role,e.expiresAt)),e.kind===`create`&&(i[n(e.environmentSlug)]=r(e.role,e.expiresAt));return i}function J(e){return e===``?null:new Date(`${e}T23:59:59Z`).toISOString()}function Y(e){return e===null?``:e.slice(0,10)}var X=t();function Z(t,n){let r=e(),{projects:a,capabilities:s}=g(),c=u(a),{data:l}=_(o.report(r,i(t,n),s.canManageGrants)),d=h({queries:c.map(e=>o.grants(r,e.slug))});return{report:l,access:c.map((e,r)=>{let i=d[r].data;return{project:e,grants:i.ok?i.grants.filter(e=>e.principalType===t&&e.principalId===n):[],grantsError:i.ok?null:i.error}})}}function Q({principalType:e,principalId:t}){let{instanceRole:n}=g(),{report:a,access:o}=Z(e,t),{status:l,dismiss:u}=m(p.queryKey),f=l(i(e,t)),h=M[e],_=e===`user`,v=_?`/users`:`/tokens`,y=a?.ok===!0?a.report:null,b=y?.status===`removed`,S=y!==null&&!b?{principalType:e,principalId:t,instanceRole:y.instanceRole,isRootAdmin:y.isRootAdmin,tampered:y.status===`tampered`}:void 0;if(a?.ok===!0&&y===null||a===null&&o.length===0)return(0,X.jsx)(c,{icon:_?(0,X.jsx)(O,{size:18}):(0,X.jsx)(k,{size:18}),label:(0,X.jsx)(`span`,{className:`mono`,children:t}),title:_?`No such user for you`:`No such token for you`,actions:(0,X.jsxs)(d,{className:`btn`,to:v,children:[`All `,_?`users`:`tokens`]}),children:a===null?`A ${h}'s page lists its access to the projects where you manage access, and you manage none.`:`No ${h} by that name has ever been registered here.`});let w=o.flatMap(({project:e,grants:t})=>t.map(t=>({project:e,grant:t}))),T=o.filter(e=>e.grantsError!==null),E=b?[]:o.filter(({project:e,grantsError:t})=>e.archivedAt===null&&t===null);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(s,{lead:(0,X.jsx)(ee,{type:e,id:t,size:`lg`}),title:t,meta:b?(0,X.jsx)(`span`,{className:`tag tag-red`,children:`Removed`}):S?.principalType===`user`&&(0,X.jsx)(N,{principal:S}),actions:(E.length>0||S!==void 0)&&(0,X.jsxs)(X.Fragment,{children:[E.length>0&&(0,X.jsx)(te,{principalType:e,principalId:t,access:E}),S!==void 0&&(0,X.jsx)(j,{principal:S,trigger:`btn btn-icon`})]})}),f.state===`failed`&&(0,X.jsx)(`div`,{className:`report-notice`,children:(0,X.jsx)(A,{status:f,onDismiss:()=>u(f.mutationId)})}),a?.ok===!1&&(0,X.jsx)(`div`,{className:`report-notice`,children:(0,X.jsx)(C,{tone:`bad`,children:a.error})}),b&&y!==null&&(0,X.jsx)(L,{report:y}),!b&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h2`,{className:`section-title`,children:`Project access`}),T.map(({project:e,grantsError:t})=>(0,X.jsx)(`div`,{style:{marginBottom:`0.75rem`},children:(0,X.jsxs)(C,{tone:`bad`,children:[(0,X.jsx)(`span`,{className:`mono`,children:e.slug}),`: `,t]})},e.slug)),(0,X.jsx)(`section`,{className:`card`,"aria-label":`Project access`,children:w.length===0?(0,X.jsx)(x,{title:`No project access yet`,children:E.length>0?`Edit access gives this ${h} access to several projects at once.`:`None of the projects where you manage access has a grant for this ${h}.`}):(0,X.jsx)(F,{lead:(0,X.jsxs)(`span`,{className:`th`,children:[(0,X.jsx)(D,{size:14}),`Project`]}),children:w.map(({project:e,grant:t},n)=>(0,X.jsx)(I,{number:n+1,project:e.slug,grant:t,leadLabel:`Project`,lead:(0,X.jsxs)(`span`,{className:`cell-project`,children:[(0,X.jsx)(r,{name:e.slug}),(0,X.jsx)(d,{className:`cell-link`,to:`/projects/$project`,params:{project:e.slug},search:{tab:_?`users`:`tokens`},children:e.name}),e.archivedAt!==null&&(0,X.jsx)(`span`,{className:`tag tag-red`,children:`archived`})]})},t.id))})}),n!==`root-admin`&&(0,X.jsx)(`p`,{className:`hint section-foot`,children:`Only projects where you manage access are listed.`})]}),y!==null&&(0,X.jsx)(R,{report:y})]})}function te({principalType:t,principalId:n,access:a}){let o=e(),[s,c]=(0,z.useState)(!1),[u,d]=(0,z.useState)({}),{pending:p,error:m,setError:h,run:g}=P(),_=M[t],x=a.map(({project:e,grants:t})=>{let n=e.environments.filter(e=>e.details!==null&&e.details.archivedAt===null).map(e=>e.slug),r=V(t,n),i=Object.hasOwn(u,e.slug)?u[e.slug]:r;return{project:e,grants:t,environments:n,held:r,plan:i,changes:K(t,i)}}),C=x.filter(e=>e.changes.length>0);function T(){c(!1),d({}),h(null)}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>c(!0),children:[(0,X.jsx)(w,{size:14}),`Edit access`]}),(0,X.jsx)(S,{open:s,onOpenChange:e=>e?c(!0):T(),title:(0,X.jsxs)(X.Fragment,{children:[`Edit access for `,(0,X.jsx)(`span`,{className:`mono`,children:n})]}),description:`Set what this ${_} can reach on each project you manage, and until when. Saving applies only what you changed.`,wide:!0,children:(0,X.jsxs)(`form`,{className:`form`,onSubmit:e=>{e.preventDefault(),g(()=>o.access.set(i(t,n),Object.assign({},...C.map(({project:e,changes:t})=>q(e.slug,t)))),{affects:C.flatMap(({project:e})=>l.access(e.slug,i(t,n))),onSuccess:()=>{v.success(`Updated ${n}’s access on ${C.length} project${C.length===1?``:`s`}`),T()}})},children:[(0,X.jsxs)(`ul`,{className:`plan-list`,children:[(0,X.jsxs)(`li`,{className:`plan-head`,"aria-hidden":`true`,children:[(0,X.jsx)(`span`,{children:`Project`}),(0,X.jsx)(`span`,{children:`Access`}),(0,X.jsx)(`span`,{children:`Expires`})]}),x.map(({project:e,grants:t,environments:n,held:i,plan:a,changes:o})=>{let s=`plan-${e.slug}`,c=t=>d(n=>({...n,[e.slug]:t}));return(0,X.jsxs)(`li`,{className:`plan-row${o.length>0?` is-changed`:``}`,children:[(0,X.jsxs)(`label`,{className:`plan-project`,htmlFor:s,children:[(0,X.jsx)(r,{name:e.slug}),(0,X.jsxs)(`span`,{className:`plan-project-text`,children:[(0,X.jsx)(`span`,{className:`plan-project-name`,children:e.name}),i.level===`custom`&&(0,X.jsxs)(`span`,{className:`plan-project-held`,children:[`Holds `,t.map(e=>f(e)).join(`, `)]})]})]}),(0,X.jsxs)(`select`,{id:s,className:`select select-sm`,value:a.level,onChange:e=>c(H(a,e.target.value,n)),children:[i.level===`custom`&&(0,X.jsx)(`option`,{value:`custom`,children:`Keep as is`}),(0,X.jsx)(`option`,{value:`none`,children:`No access`}),(0,X.jsx)(`option`,{value:`owner`,children:`Owner`}),(0,X.jsx)(`option`,{value:`viewer`,children:`Read: all`}),(0,X.jsx)(`option`,{value:`developer`,children:`Write: all`}),n.length>0&&(0,X.jsx)(`option`,{value:`env`,children:`Per environment…`})]}),(a.level===`owner`||a.level===`viewer`||a.level===`developer`)&&(0,X.jsx)($,{label:`${e.name} expires`,expiresAt:a.expiresAt,onChange:e=>c({...a,expiresAt:e})}),a.level===`env`&&(0,X.jsx)(`ul`,{className:`plan-envs`,"aria-label":`Environments of ${e.name}`,children:n.map(t=>{let n=B(a,t);return(0,X.jsxs)(`li`,{className:`plan-env`,children:[(0,X.jsx)(`label`,{className:`mono`,htmlFor:`${s}-${t}`,children:t}),(0,X.jsxs)(`select`,{id:`${s}-${t}`,className:`select select-sm`,value:n?.role??``,onChange:e=>{let r=e.target.value;c(U(a,t,r===`viewer`||r===`developer`?{role:r,expiresAt:n?.expiresAt??null}:null))},children:[(0,X.jsx)(`option`,{value:``,children:`No access`}),(0,X.jsx)(`option`,{value:`viewer`,children:`Read`}),(0,X.jsx)(`option`,{value:`developer`,children:`Write`})]}),n!==null&&(0,X.jsx)($,{label:`${t} of ${e.name} expires`,expiresAt:n.expiresAt,onChange:e=>c(U(a,t,{...n,expiresAt:e}))})]},t)})}),o.length>0&&(0,X.jsx)(`ul`,{className:`plan-changes`,"aria-label":`Changes to ${e.name}`,children:o.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsx)(ne,{change:e})},e.kind===`create`?`+${e.role}@${e.environmentSlug??``}`:e.grant.id))})]},e.slug)})]}),(0,X.jsx)(y,{error:m}),(0,X.jsxs)(`div`,{className:`dialog-actions`,children:[(0,X.jsx)(`button`,{className:`btn`,type:`button`,onClick:T,children:`Cancel`}),(0,X.jsxs)(`button`,{className:`btn btn-primary`,type:`submit`,disabled:p||C.length===0,children:[p&&(0,X.jsx)(b,{}),`Save changes`]})]})]})})]})}function $({label:e,expiresAt:t,onChange:n}){let r=Y(t);return(0,X.jsxs)(`span`,{className:`expiry${r===``?` is-never`:``}`,children:[(0,X.jsx)(`input`,{className:`input select-sm`,type:`date`,"aria-label":e,min:new Date().toISOString().slice(0,10),value:r,onChange:e=>n(J(e.target.value))}),(0,X.jsx)(`span`,{className:`expiry-never`,"aria-hidden":`true`,children:`Never`}),(0,X.jsx)(`button`,{className:`btn btn-quiet btn-sm btn-icon`,type:`button`,"aria-label":`${e}: never`,title:`Never expires`,onClick:()=>n(null),children:(0,X.jsx)(T,{size:12})})]})}function ne({change:e}){let t=e=>e===null?``:` until ${Y(e)}`;switch(e.kind){case`create`:return(0,X.jsxs)(`span`,{className:`tag tag-green`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`+`}),(0,X.jsx)(`span`,{className:`visually-hidden`,children:`Adds`}),f({...e,roleName:e.role}),t(e.expiresAt)]});case`expiry`:return(0,X.jsxs)(`span`,{className:`tag tag-blue`,children:[(0,X.jsx)(E,{size:12}),(0,X.jsx)(`span`,{className:`visually-hidden`,children:`Moves the expiry of`}),f(e.grant),e.expiresAt===null?`, no expiry`:t(e.expiresAt)]});case`revoke`:return(0,X.jsxs)(`span`,{className:`tag tag-red`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`−`}),(0,X.jsx)(`span`,{className:`visually-hidden`,children:`Removes`}),f(e.grant)]})}}export{Q as t};