@coffre/ui 0.1.12 → 0.1.14

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 (96) hide show
  1. package/dist/client/_coffre/assets/{account-DHSs5h2f.js → account-DGGcVkqt.js} +1 -1
  2. package/dist/client/_coffre/assets/{account-CyJDFhek.js → account-DqjL4kP9.js} +2 -2
  3. package/dist/client/_coffre/assets/{affordances-BQD5B421.js → affordances-B9nFwqIv.js} +1 -1
  4. package/dist/client/_coffre/assets/{audit-rMy9mU9Q.js → audit-CcQmaSan.js} +1 -1
  5. package/dist/client/_coffre/assets/audit-XwuBA4r9.js +2 -0
  6. package/dist/client/_coffre/assets/{auth.device-DuvaComb.js → auth.device-CFCn1DXA.js} +1 -1
  7. package/dist/client/_coffre/assets/{auth.device-yBt_sLZW.js → auth.device-CHHcm089.js} +2 -2
  8. package/dist/client/_coffre/assets/{directory-C4BMGC7-.js → directory-skRBmF1Y.js} +1 -1
  9. package/dist/client/_coffre/assets/{dist-BNkBTkxj.js → dist-BHhATf1q.js} +1 -1
  10. package/dist/client/_coffre/assets/globals-DCrHjrpD.css +1 -0
  11. package/dist/client/_coffre/assets/{grants-CyDW25eX.js → grants-BEmVXYg5.js} +1 -1
  12. package/dist/client/_coffre/assets/{icons-BRl8DlXW.js → icons-BFziRUf9.js} +1 -1
  13. package/dist/client/_coffre/assets/index-Bo6udWLL.js +12 -0
  14. package/dist/client/_coffre/assets/{link-CqlAJWBd.js → link-Bg_PHv45.js} +1 -1
  15. package/dist/client/_coffre/assets/{login-B73b6bsJ.js → login-GV0ZjCQy.js} +1 -1
  16. package/dist/client/_coffre/assets/login-pzHGDqU5.js +2 -0
  17. package/dist/client/_coffre/assets/{offboarding--5vSKNHv.js → offboarding-CXV0KyMt.js} +1 -1
  18. package/dist/client/_coffre/assets/{page-Dngv8FMr.js → page-CDuo3uft.js} +1 -1
  19. package/dist/client/_coffre/assets/{preload-helper-DBha3tys.js → preload-helper-CYFH1xAV.js} +1 -1
  20. package/dist/client/_coffre/assets/{principal-page-C4qDD-d8.js → principal-page-BmgkTnAl.js} +1 -1
  21. package/dist/client/_coffre/assets/projects._project._environment-5PA9NHET.js +2 -0
  22. package/dist/client/_coffre/assets/{projects._project._environment-or_AX6o5.js → projects._project._environment-B-5I0ZFP.js} +1 -1
  23. package/dist/client/_coffre/assets/projects._project.index-BzJQojbd.js +2 -0
  24. package/dist/client/_coffre/assets/{projects._project.index-iynQgenH.js → projects._project.index-wjtfc8E6.js} +1 -1
  25. package/dist/client/_coffre/assets/{projects.index-CGW8mRil.js → projects.index-dl7dfnGW.js} +1 -1
  26. package/dist/client/_coffre/assets/{row-state-BlarvG7E.js → row-state-BzGdu73b.js} +1 -1
  27. package/dist/client/_coffre/assets/{settings-D-7RJIDf.js → settings-DnENNWn8.js} +1 -1
  28. package/dist/client/_coffre/assets/{suspense-q_eJaZ18.js → suspense-Cnh1cNc1.js} +1 -1
  29. package/dist/client/_coffre/assets/{tokens._token-C53NqScg.js → tokens._token-BJiMX2TJ.js} +1 -1
  30. package/dist/client/_coffre/assets/tokens._token-C2s6HHWK.js +2 -0
  31. package/dist/client/_coffre/assets/{tokens.index-DBZTLnbi.js → tokens.index-D4HYaFJl.js} +1 -1
  32. package/dist/client/_coffre/assets/{ui-BPWFJNz7.js → ui-Ch0beQy-.js} +1 -1
  33. package/dist/client/_coffre/assets/{unregistered-CLhgtwUt.js → unregistered-wV1yqr9t.js} +1 -1
  34. package/dist/client/_coffre/assets/{use-action-LULgF26O.js → use-action-cgaBRBBH.js} +1 -1
  35. package/dist/client/_coffre/assets/{use-change-Bd6NZJj9.js → use-change-DIpkq9iI.js} +1 -1
  36. package/dist/client/_coffre/assets/{use-shell-Dx92Huhb.js → use-shell-BJwawvkh.js} +1 -1
  37. package/dist/client/_coffre/assets/useQuery-BHCBwHtH.js +1 -0
  38. package/dist/client/_coffre/assets/{useSuspenseQuery-tP9HFZ8w.js → useSuspenseQuery-BfnNEmf7.js} +1 -1
  39. package/dist/client/_coffre/assets/users._user--OY2srG0.js +1 -0
  40. package/dist/client/_coffre/assets/users._user-Cj4NY0p5.js +2 -0
  41. package/dist/client/_coffre/assets/{users.index-Cs9tibIv.js → users.index-C7_aZ0jb.js} +1 -1
  42. package/dist/server/.vite/manifest.json +155 -155
  43. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-C-_y9u60.js +162 -0
  44. package/dist/server/_coffre/assets/{account-BUhhOS5-.js → account-BJtaf5d7.js} +5 -5
  45. package/dist/server/_coffre/assets/{account-B_h55GCs.js → account-CL3AX6kY.js} +2 -2
  46. package/dist/server/_coffre/assets/{audit-B8Ck358-.js → audit-BtjuffEH.js} +4 -4
  47. package/dist/server/_coffre/assets/{audit-DFsXfeAQ.js → audit-DiHTzVVe.js} +2 -2
  48. package/dist/server/_coffre/assets/{auth.device-cqjWACvB.js → auth.device-8RMD0nyz.js} +2 -2
  49. package/dist/server/_coffre/assets/{auth.device-BXf_JjT7.js → auth.device-dUMx6Srl.js} +2 -2
  50. package/dist/server/_coffre/assets/{directory-C9SfNgpM.js → directory-9Jc5MEra.js} +2 -2
  51. package/dist/server/_coffre/assets/globals-DCrHjrpD.css +1 -0
  52. package/dist/server/_coffre/assets/{grants--315KmXu.js → grants-D5-q8fXB.js} +2 -2
  53. package/dist/server/_coffre/assets/{login-LBpXXfsQ.js → login-C80ImEsO.js} +1 -1
  54. package/dist/server/_coffre/assets/{login-CQSkYW_D.js → login-DmpfrcPB.js} +3 -3
  55. package/dist/server/_coffre/assets/{offboarding-CykelNis.js → offboarding-CXIgvZbO.js} +2 -2
  56. package/dist/server/_coffre/assets/{page-BGeDoQO5.js → page-x4nICC9d.js} +2 -0
  57. package/dist/server/_coffre/assets/{principal-page-CRdoAQOq.js → principal-page-BO6Ijpqv.js} +8 -8
  58. package/dist/server/_coffre/assets/{projects._project._environment-BrDqn8kW.js → projects._project._environment-BMqZsCfi.js} +6 -6
  59. package/dist/server/_coffre/assets/{projects._project._environment-BXU1Mee5.js → projects._project._environment-BeXpetmJ.js} +2 -2
  60. package/dist/server/_coffre/assets/{projects._project.index-CAxBU4tY.js → projects._project.index-B74-XdI3.js} +9 -9
  61. package/dist/server/_coffre/assets/{projects._project.index-CYyUVTCl.js → projects._project.index-DZ1KZvHR.js} +2 -2
  62. package/dist/server/_coffre/assets/{projects.index-D6ZoDE_0.js → projects.index-D7F7hiVe.js} +4 -4
  63. package/dist/server/_coffre/assets/{router-Bu2qtyqw.js → router-fxr2e6Ht.js} +70 -22
  64. package/dist/server/_coffre/assets/{settings-ByeF6hBa.js → settings-DO8wvTmo.js} +3 -3
  65. package/dist/server/_coffre/assets/{suspense-beD01bb8.js → suspense-WsBv84ga.js} +1 -1
  66. package/dist/server/_coffre/assets/{tokens._token-D2E4P3Qc.js → tokens._token-CVWTFOM-.js} +7 -7
  67. package/dist/server/_coffre/assets/{tokens._token-CM01QPCq.js → tokens._token-DhcJxsf3.js} +2 -2
  68. package/dist/server/_coffre/assets/{tokens.index-Cmrgn3mU.js → tokens.index-hvPM5IjY.js} +5 -5
  69. package/dist/server/_coffre/assets/{unregistered-DSArejP9.js → unregistered-DKdzrjVr.js} +2 -2
  70. package/dist/server/_coffre/assets/{use-action-C2wz34kq.js → use-action-D6KlY-sv.js} +2 -2
  71. package/dist/server/_coffre/assets/{use-change-CJpGSNIq.js → use-change-CAcOZo-a.js} +2 -2
  72. package/dist/server/_coffre/assets/{use-shell-C3iYcyP1.js → use-shell-C-yuQ1hA.js} +2 -2
  73. package/dist/server/_coffre/assets/{useQuery-ChxaQ4Cb.js → useQuery-MqmaAeUF.js} +2 -2
  74. package/dist/server/_coffre/assets/{useSuspenseQuery-BjAmlGZl.js → useSuspenseQuery-BDvlOPB7.js} +2 -2
  75. package/dist/server/_coffre/assets/{users._user-BVeR9fZP.js → users._user-dCIYuxyZ.js} +2 -2
  76. package/dist/server/_coffre/assets/{users._user-Cih2Etf4.js → users._user-pLdzKe1F.js} +2 -2
  77. package/dist/server/_coffre/assets/{users.index-Bo2_a95G.js → users.index-CDCDlQxN.js} +5 -5
  78. package/dist/server/index.js +2 -2
  79. package/package.json +3 -3
  80. package/src/components/shell.tsx +26 -2
  81. package/src/lib/instance.ts +13 -0
  82. package/src/lib/queries.ts +2 -0
  83. package/src/routes/__root.tsx +2 -1
  84. package/src/styles/globals.css +5 -0
  85. package/dist/client/_coffre/assets/audit-Bcyp_dU1.js +0 -2
  86. package/dist/client/_coffre/assets/globals-BJkzu6T5.css +0 -1
  87. package/dist/client/_coffre/assets/index-CA1mtrIx.js +0 -12
  88. package/dist/client/_coffre/assets/login-BO1KAGPU.js +0 -2
  89. package/dist/client/_coffre/assets/projects._project._environment-eBKxOZ0_.js +0 -2
  90. package/dist/client/_coffre/assets/projects._project.index-DHdXfEh-.js +0 -2
  91. package/dist/client/_coffre/assets/tokens._token-0u7midqA.js +0 -2
  92. package/dist/client/_coffre/assets/useQuery-BIIZz1CB.js +0 -1
  93. package/dist/client/_coffre/assets/users._user-BXtaL8Ee.js +0 -2
  94. package/dist/client/_coffre/assets/users._user-CNYVkXaY.js +0 -1
  95. package/dist/server/_coffre/assets/_tanstack-start-manifest_v-T9tMsCwo.js +0 -162
  96. package/dist/server/_coffre/assets/globals-BJkzu6T5.css +0 -1
@@ -1 +1 @@
1
- import{J as e,U as t,V as n,X as r,q as i}from"./page-Dngv8FMr.js";var a=e((e=>{var t=i();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 r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},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=r(i(),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=i();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=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!r(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=i(),n=Ne();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:r,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=r(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
+ import{J as e,U as t,V as n,X as r,q as i}from"./page-CDuo3uft.js";var a=e((e=>{var t=i();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 r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},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=r(i(),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=i();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=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!r(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=i(),n=Ne();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:r,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=r(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 +1 @@
1
- import{U as e,X as t,n,q as r}from"./page-Dngv8FMr.js";import{t as i}from"./use-shell-Dx92Huhb.js";import{a,c as o}from"./ui-BPWFJNz7.js";import{F as s,S as c,j as l}from"./icons-BRl8DlXW.js";import{t as u}from"./login-BO1KAGPU.js";import{t as d}from"./signin-errors-CroZWZgm.js";var f=t(r()),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)(n,{icon:(0,p.jsx)(c,{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)(n,{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),[c,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":c===e.id,onClick:()=>m(e.id),children:[(0,p.jsx)(`span`,{className:`provider-mark`,"aria-hidden":!0,children:c===e.id?(0,p.jsx)(o,{}):(0,p.jsx)(l,{brand:e.brand})}),`Continue with `,e.label]})},e.id))})]})}export{m as component};
1
+ import{U as e,X as t,n,q as r}from"./page-CDuo3uft.js";import{t as i}from"./use-shell-BJwawvkh.js";import{a,c as o}from"./ui-Ch0beQy-.js";import{F as s,S as c,j as l}from"./icons-BFziRUf9.js";import{t as u}from"./login-pzHGDqU5.js";import{t as d}from"./signin-errors-CroZWZgm.js";var f=t(r()),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)(n,{icon:(0,p.jsx)(c,{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)(n,{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),[c,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":c===e.id,onClick:()=>m(e.id),children:[(0,p.jsx)(`span`,{className:`provider-mark`,"aria-hidden":!0,children:c===e.id?(0,p.jsx)(o,{}):(0,p.jsx)(l,{brand:e.brand})}),`Continue with `,e.label]})},e.id))})]})}export{m as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/login-GV0ZjCQy.js","_coffre/assets/page-CDuo3uft.js","_coffre/assets/use-shell-BJwawvkh.js","_coffre/assets/suspense-Cnh1cNc1.js","_coffre/assets/ui-Ch0beQy-.js","_coffre/assets/link-Bg_PHv45.js","_coffre/assets/icons-BFziRUf9.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-CYFH1xAV.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-GV0ZjCQy.js`),__vite__mapDeps([0,1,2,3,4,5,6,7])),`component`)});export{r as t};
@@ -1 +1 @@
1
- import{U as e,t}from"./page-Dngv8FMr.js";import{t as n}from"./link-CqlAJWBd.js";import{i as r,l as i,s as a}from"./ui-BPWFJNz7.js";import{V as o,s,v as c}from"./icons-BRl8DlXW.js";import{s as l}from"./directory-C4BMGC7-.js";var u=e();function d({report:e}){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m,{report:e,removed:e.status===`removed`,person:e.principalType===`user`}),e.issuedTokens.length>0&&(0,u.jsx)(h,{report:e})]})}function f({report:e}){let t=e.principalType===`user`;return(0,u.jsx)(`div`,{className:`report-notice`,children:(0,u.jsxs)(a,{children:[`Removed`,e.removedBy!==null&&(0,u.jsxs)(u.Fragment,{children:[` `,`by `,(0,u.jsx)(`span`,{className:`mono`,children:e.removedBy})]}),e.removedAt!==null&&(0,u.jsxs)(u.Fragment,{children:[` `,`on `,(0,u.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 p({principalType:e,removed:t}){let n=e===`user`,r=t.filter(t=>t.principalType===e);return r.length===0?null:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`h2`,{className:`section-title`,children:`Removed`}),(0,u.jsx)(`section`,{className:`card`,"aria-label":n?`Removed users`:`Removed tokens`,children:(0,u.jsx)(`div`,{className:`dt-wrap`,children:(0,u.jsxs)(`table`,{className:`dt directory stacks`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{className:`n`,children:`#`}),(0,u.jsx)(`th`,{className:`col-principal`,children:(0,u.jsxs)(`span`,{className:`th`,children:[n?(0,u.jsx)(o,{size:14}):(0,u.jsx)(c,{size:14}),n?`Email`:`Name`]})}),(0,u.jsx)(`th`,{className:`col-role`,children:`Still to rotate`}),(0,u.jsx)(`th`,{className:`col-actions`,children:(0,u.jsx)(`span`,{className:`visually-hidden`,children:`Report`})})]})}),(0,u.jsx)(`tbody`,{children:r.map((e,t)=>(0,u.jsxs)(`tr`,{className:`row-link`,children:[(0,u.jsx)(`td`,{className:`n`,children:t+1}),(0,u.jsx)(`td`,{className:`col-lead`,"data-label":n?`Email`:`Name`,children:(0,u.jsx)(l,{type:e.principalType,id:e.principalId,stretch:!0})}),(0,u.jsx)(`td`,{className:`col-role`,"data-label":`Still to rotate`,children:e.toRotate===0?(0,u.jsx)(`span`,{className:`cell-muted`,children:`Nothing`}):`${e.toRotate} ${e.toRotate===1?`value`:`values`}`}),(0,u.jsx)(`td`,{className:`col-actions col-open cell-muted`,"aria-hidden":`true`,children:(0,u.jsx)(s,{size:16})})]},e.principalId))})]})})}),(0,u.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 m({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,u.jsx)(t,{labelledBy:`seen-values`,title:a?`Still to rotate`:`Values seen`,description:c,actions:e.rotated>0&&(0,u.jsxs)(`span`,{className:`card-aside`,children:[e.rotated,` already rotated`]}),children:e.exposed.length===0?(0,u.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,u.jsx)(`div`,{className:`dt-wrap`,children:(0,u.jsxs)(`table`,{className:`dt report-values`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`Secret`}),(0,u.jsx)(`th`,{className:`col-shrink`,children:`Version`}),(0,u.jsx)(`th`,{className:`col-shrink`,children:`Last seen`})]})}),(0,u.jsx)(`tbody`,{children:e.exposed.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsxs)(n,{className:`cell-link mono`,to:`/projects/$project/$environment`,params:{project:e.project,environment:e.environment},search:{filter:e.key},children:[(0,u.jsxs)(`span`,{className:`report-path`,children:[e.project,`/`,e.environment,`/`]}),e.key]})}),(0,u.jsxs)(`td`,{className:`col-shrink cell-mono cell-muted`,children:[`v`,e.version]}),(0,u.jsxs)(`td`,{className:`col-shrink nowrap`,children:[e.how===`wrote`?`Wrote`:`Read`,` `,(0,u.jsx)(i,{iso:e.at,display:`relative`})]})]},`${e.project}/${e.environment}/${e.key}`))})]})})})}function h({report:e}){return(0,u.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,u.jsx)(`div`,{className:`dt-wrap`,children:(0,u.jsxs)(`table`,{className:`dt report-tokens`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`Token`}),(0,u.jsx)(`th`,{className:`col-shrink`,children:`Expires`}),(0,u.jsx)(`th`,{className:`col-shrink col-hide-narrow`,children:`Last used`})]})}),(0,u.jsx)(`tbody`,{children:e.issuedTokens.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsxs)(`span`,{className:`cell-stack`,children:[(0,u.jsx)(n,{className:`cell-link mono`,to:`/tokens/$token`,params:{token:e.service},children:e.service}),(0,u.jsxs)(`small`,{children:[e.label??`No label`,` · `,(0,u.jsx)(`span`,{className:`mono`,children:e.hint})]})]})}),(0,u.jsx)(`td`,{className:`col-shrink nowrap`,children:(0,u.jsx)(i,{iso:e.expiresAt,display:`relative`})}),(0,u.jsx)(`td`,{className:`col-shrink col-hide-narrow nowrap`,children:e.lastUsedAt===null?(0,u.jsx)(`span`,{className:`cell-muted`,children:`Never`}):(0,u.jsx)(i,{iso:e.lastUsedAt,display:`relative`})})]},e.id))})]})})})}export{p as n,f as r,d as t};
1
+ import{U as e,t}from"./page-CDuo3uft.js";import{t as n}from"./link-Bg_PHv45.js";import{i as r,l as i,s as a}from"./ui-Ch0beQy-.js";import{V as o,s,v as c}from"./icons-BFziRUf9.js";import{s as l}from"./directory-skRBmF1Y.js";var u=e();function d({report:e}){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m,{report:e,removed:e.status===`removed`,person:e.principalType===`user`}),e.issuedTokens.length>0&&(0,u.jsx)(h,{report:e})]})}function f({report:e}){let t=e.principalType===`user`;return(0,u.jsx)(`div`,{className:`report-notice`,children:(0,u.jsxs)(a,{children:[`Removed`,e.removedBy!==null&&(0,u.jsxs)(u.Fragment,{children:[` `,`by `,(0,u.jsx)(`span`,{className:`mono`,children:e.removedBy})]}),e.removedAt!==null&&(0,u.jsxs)(u.Fragment,{children:[` `,`on `,(0,u.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 p({principalType:e,removed:t}){let n=e===`user`,r=t.filter(t=>t.principalType===e);return r.length===0?null:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`h2`,{className:`section-title`,children:`Removed`}),(0,u.jsx)(`section`,{className:`card`,"aria-label":n?`Removed users`:`Removed tokens`,children:(0,u.jsx)(`div`,{className:`dt-wrap`,children:(0,u.jsxs)(`table`,{className:`dt directory stacks`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{className:`n`,children:`#`}),(0,u.jsx)(`th`,{className:`col-principal`,children:(0,u.jsxs)(`span`,{className:`th`,children:[n?(0,u.jsx)(o,{size:14}):(0,u.jsx)(c,{size:14}),n?`Email`:`Name`]})}),(0,u.jsx)(`th`,{className:`col-role`,children:`Still to rotate`}),(0,u.jsx)(`th`,{className:`col-actions`,children:(0,u.jsx)(`span`,{className:`visually-hidden`,children:`Report`})})]})}),(0,u.jsx)(`tbody`,{children:r.map((e,t)=>(0,u.jsxs)(`tr`,{className:`row-link`,children:[(0,u.jsx)(`td`,{className:`n`,children:t+1}),(0,u.jsx)(`td`,{className:`col-lead`,"data-label":n?`Email`:`Name`,children:(0,u.jsx)(l,{type:e.principalType,id:e.principalId,stretch:!0})}),(0,u.jsx)(`td`,{className:`col-role`,"data-label":`Still to rotate`,children:e.toRotate===0?(0,u.jsx)(`span`,{className:`cell-muted`,children:`Nothing`}):`${e.toRotate} ${e.toRotate===1?`value`:`values`}`}),(0,u.jsx)(`td`,{className:`col-actions col-open cell-muted`,"aria-hidden":`true`,children:(0,u.jsx)(s,{size:16})})]},e.principalId))})]})})}),(0,u.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 m({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,u.jsx)(t,{labelledBy:`seen-values`,title:a?`Still to rotate`:`Values seen`,description:c,actions:e.rotated>0&&(0,u.jsxs)(`span`,{className:`card-aside`,children:[e.rotated,` already rotated`]}),children:e.exposed.length===0?(0,u.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,u.jsx)(`div`,{className:`dt-wrap`,children:(0,u.jsxs)(`table`,{className:`dt report-values`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`Secret`}),(0,u.jsx)(`th`,{className:`col-shrink`,children:`Version`}),(0,u.jsx)(`th`,{className:`col-shrink`,children:`Last seen`})]})}),(0,u.jsx)(`tbody`,{children:e.exposed.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsxs)(n,{className:`cell-link mono`,to:`/projects/$project/$environment`,params:{project:e.project,environment:e.environment},search:{filter:e.key},children:[(0,u.jsxs)(`span`,{className:`report-path`,children:[e.project,`/`,e.environment,`/`]}),e.key]})}),(0,u.jsxs)(`td`,{className:`col-shrink cell-mono cell-muted`,children:[`v`,e.version]}),(0,u.jsxs)(`td`,{className:`col-shrink nowrap`,children:[e.how===`wrote`?`Wrote`:`Read`,` `,(0,u.jsx)(i,{iso:e.at,display:`relative`})]})]},`${e.project}/${e.environment}/${e.key}`))})]})})})}function h({report:e}){return(0,u.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,u.jsx)(`div`,{className:`dt-wrap`,children:(0,u.jsxs)(`table`,{className:`dt report-tokens`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`Token`}),(0,u.jsx)(`th`,{className:`col-shrink`,children:`Expires`}),(0,u.jsx)(`th`,{className:`col-shrink col-hide-narrow`,children:`Last used`})]})}),(0,u.jsx)(`tbody`,{children:e.issuedTokens.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{children:(0,u.jsxs)(`span`,{className:`cell-stack`,children:[(0,u.jsx)(n,{className:`cell-link mono`,to:`/tokens/$token`,params:{token:e.service},children:e.service}),(0,u.jsxs)(`small`,{children:[e.label??`No label`,` · `,(0,u.jsx)(`span`,{className:`mono`,children:e.hint})]})]})}),(0,u.jsx)(`td`,{className:`col-shrink nowrap`,children:(0,u.jsx)(i,{iso:e.expiresAt,display:`relative`})}),(0,u.jsx)(`td`,{className:`col-shrink col-hide-narrow nowrap`,children:e.lastUsedAt===null?(0,u.jsx)(`span`,{className:`cell-muted`,children:`Never`}):(0,u.jsx)(i,{iso:e.lastUsedAt,display:`relative`})})]},e.id))})]})})})}export{p as n,f as r,d as t};
@@ -1 +1 @@
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 ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(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?O(``+e.key):t.toString(36)}function j(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 M(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,M(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,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(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+=M(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+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(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 N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(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 F=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)},I={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,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=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},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,F)}catch(e){F(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),p=Symbol.for(`@coffre/client:CoffreError`),m=class extends Error{static[Symbol.hasInstance](e){return typeof e==`object`&&!!e&&p in e}[p]=!0;status;code;reason;constructor(e,t,n,r){super(n),this.name=`CoffreError`,this.status=e,this.code=t,this.reason=r}};function h(e){let[t=``,n=``,r=``]=e.replace(/^\/+|\/+$/g,``).split(`/`);return{project:t,environment:n,key:r}}function g(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 m(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`,h(e),t),update:(e,t)=>a(`PATCH /projects/:project/:environment`,h(e),t)},secrets:{list:e=>a(`GET /secrets/:project/:environment`,h(e)),reveal:e=>a(`POST /reveals`,{},{path:e}),set:(e,t)=>a(`PATCH /secrets/:project/:environment`,h(e),t),dryRun:(e,t)=>{let[n,a]=i(`PATCH /secrets/:project/:environment`,h(e));return r(n,`${a}?dryRun=1`,t)},history:e=>a(`GET /secrets/:project/:environment/:key/versions`,h(e)),restore:(e,t)=>a(`POST /secrets/:project/:environment/:key/restore`,h(e),{version:t}),rename:(e,t)=>a(`PATCH /secrets/:project/:environment/:key`,h(e),{key:t}),update:(e,t)=>a(`PATCH /secrets/:project/:environment/:key`,h(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})},audit:{list:(e={})=>a(`GET /audit`,{},e),verify:()=>a(`GET /audit/verification`,{}),keys:()=>a(`GET /audit/keys`,{})}}}async function _(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 v=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})),y=o(((e,t)=>{t.exports=v()})),b=f.createContext(null);function x(e){return f.useContext(b)}var S={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},C=new class{#e=S;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 w(e){setTimeout(e,0)}var T=typeof window>`u`||`Deno`in globalThis;function E(){}function ee(e,t){return typeof e==`function`?e(t):e}function D(e){return typeof e==`number`&&e>=0&&e!==1/0}function O(e,t){return Math.max(e+(t||0)-Date.now(),0)}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==M(o,t.options))return!1}else if(!P(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 j(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(N(t.options.mutationKey)!==N(a))return!1}else if(!P(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function M(e,t){return(t?.queryKeyHashFn||N)(e)}function N(e){return JSON.stringify(e,(e,t)=>L(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function P(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(!P(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!P(e[r],t[r]))return!1;return!0}return!1}var F=Object.prototype.hasOwnProperty;function I(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(L(e)&&L(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:F.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=I(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function te(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 ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function L(e){if(!re(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!(!re(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{C.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:I(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var R=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===R?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function le(e,t){return typeof e==`function`?e(...t):!!e}function ue(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 de=()=>T,z=()=>de(),B=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(){}},V=new class extends B{#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`}},fe=w;function pe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=fe,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 H=pe(),U=new class extends B{#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 me(e){return Math.min(1e3*2**e,3e4)}function he(e){return(e??`online`)!==`online`||U.isOnline()}var W=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ge(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(E);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new W(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>V.isFocused()&&(e.networkMode===`always`||U.isOnline())&&e.canRun(),p=()=>he(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??(z()?0:3),a=e.retryDelay??me,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),ie(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 _e=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),D(this.gcTime)&&(this.#e=C.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(z()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(C.clearTimeout(this.#e),this.#e=void 0)}};function ve(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=>{ue(e,()=>t.signal,()=>n=!0)},u=ce(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?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?be:ye,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:ye(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 ye(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 be(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var xe=class extends _e{#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=we(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=we(this.options);e.data!==void 0&&(this.setState(Ce(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(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(E).catch(E):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=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===R||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>k(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:!O(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=ce(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`?ve(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=ge({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof W&&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 W){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,...Se(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ce(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),H.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Se(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:he(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ce(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function we(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 Te=class extends _e{#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||Ee(),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=ge({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),H.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends B{#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 Te({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=G(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=G(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=G(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=G(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){H.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=>j(t,e))}findAll(e={}){return this.getAll().filter(t=>j(e,t))}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return H.batch(()=>Promise.all(e.map(e=>e.continue().catch(E))))}};function G(e){return e.options.scope?.id}var Oe=class extends B{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??M(r,t),a=this.get(i);return a||(a=new xe({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(){H.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=>A(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>A(e,t)):t}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){H.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){H.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ke=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Oe,this.#t=e.mutationCache||new De,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=V.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=U.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(k(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=ee(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return H.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;H.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return H.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=H.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return H.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=H.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(E)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(E)}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(k(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(k(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}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(E).catch(E)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return U.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(N(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{P(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(N(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{P(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||=M(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===R&&(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 K(e){return e}var Ae={canManageGrants:!1,canReadAudit:!1,canCreateProject:!1};function je(e,t){if(e===null)return Ae;let n=e.instanceRole===`owner`||e.instanceRole===`root-admin`;return{canManageGrants:n,canReadAudit:e.canReadAudit,canCreateProject:n}}function Me(e){return e.includes(`secret.read`)}function Ne(){return x().options.context.client}var Pe=class extends Error{};function q(e){return e instanceof m?e.status:void 0}function Fe(e){return e instanceof Pe?e.message:e instanceof m?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 Ie(e){return{ok:!1,error:Fe(e),signedOut:q(e)===401}}async function J(e){try{return{ok:!0,...await e()}}catch(e){return Ie(e)}}function Le(e,t){return`${e===`user`?`user`:`token`}:${t}`}var Re=1e4;function ze(){return new ke({defaultOptions:{queries:{staleTime:Re,refetchOnWindowFocus:!0,retry:!1}}})}var Y={me:[`me`],auth:[`auth`],projects:[`projects`],grants:e=>[`grants`,e],secrets:({project:e,environment:t})=>[`secrets`,e,t],directory:[`directory`],report:e=>[`report`,e],credentials:e=>[`credentials`,e],identities:[`identities`],sessions:[`sessions`],audit:[`audit`]};function Be(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 Ve(e){return J(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 He=e=>J(()=>e.projects.list()),X={me:e=>K({queryKey:Y.me,queryFn:async()=>{try{return await e.me()}catch(e){if(q(e)===401)return null;throw e}}}),auth:e=>K({queryKey:Y.auth,queryFn:()=>e.auth()}),projects:e=>K({queryKey:Y.projects,queryFn:()=>He(e)}),grants:(e,t)=>K({queryKey:Y.grants(t),queryFn:()=>J(async()=>({grants:Be((await e.members.list(t)).members)}))}),secrets:(e,t)=>K({queryKey:Y.secrets(t),queryFn:()=>J(()=>e.secrets.list(`${t.project}/${t.environment}`))}),directory:(e,t)=>K({queryKey:[...Y.directory,{owner:t}],queryFn:()=>t?Ve(e):Promise.resolve({ok:!1,error:`Only owners can manage users and service accounts.`,signedOut:!1})}),report:(e,t,n)=>K({queryKey:[...Y.report(t),{owner:n}],queryFn:()=>n?J(async()=>{try{return{report:await e.members.get(t)}}catch(e){if(q(e)===404)return{report:null};throw e}}):Promise.resolve(null)}),credentials:(e,t,n)=>K({queryKey:[...Y.credentials(t),{allowed:n}],queryFn:()=>n?J(()=>e.tokens.list(t)):Promise.resolve(null)}),identities:e=>K({queryKey:Y.identities,queryFn:()=>J(()=>e.identities.list())}),sessions:e=>K({queryKey:Y.sessions,queryFn:()=>J(()=>e.sessions.list())}),auditEntries:(e,t)=>K({queryKey:[...Y.audit,`entries`,t],staleTime:0,queryFn:()=>J(()=>e.audit.list({limit:200,decision:t.decision,actor:t.actorId,detail:t.detail}))}),auditChain:e=>K({queryKey:[...Y.audit,`chain`],staleTime:0,queryFn:()=>Ue(e)})};async function Ue(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=q(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 We(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:je(i,r),registrationRequired:t!==null&&!t.registered,accessTampered:t?.tampered===!0}}async function Z(e,t){let[n,r,i]=await Promise.all([e.fetchQuery(X.auth(t)),e.fetchQuery(X.me(t)),e.fetchQuery(X.projects(t))]);return We(n,r,i)}function Ge(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 Ke(e,t,n){let r=Ge(await e.fetchQuery(X.projects(t)),n);r.ok&&r.managesAccess&&await e.fetchQuery(X.grants(t,n))}async function qe(e,t){let n=await Z(e,t);return e.fetchQuery(X.directory(t,n.capabilities.canManageGrants))}async function Je(e,t,n,r){let i=await Z(e,t),a=Le(n,r),o=i.capabilities.canManageGrants;await Promise.all([e.fetchQuery(X.report(t,a,o)),n===`service`?e.fetchQuery(X.credentials(t,a,o&&i.auth.signin!==null)):null,...Ye(i.projects).map(n=>e.fetchQuery(X.grants(t,n.slug)))])}function Ye(e){return e.filter(e=>e.permissions.includes(`grant.manage`))}var Xe={places:()=>[Y.projects,Y.me],secrets:e=>[Y.secrets(e),Y.projects],access:(e,t)=>[Y.grants(e),Y.report(t),Y.projects,Y.me],admission:()=>[Y.directory],role:e=>[Y.directory,Y.report(e),Y.me,Y.projects],removal:e=>[Y.directory,Y.report(e),[`grants`]],credentials:e=>[Y.credentials(e)],identities:()=>[Y.identities,Y.sessions],sessions:()=>[Y.sessions]};async function Ze(e,t){await Promise.all([...t,Y.audit].map(t=>e.invalidateQueries({queryKey:t})))}var Q=y(),Qe=[`blue`,`green`,`amber`,`violet`];function $e(e){let t=2166136261;for(let n of e)t=Math.imul(t^n.charCodeAt(0),16777619)>>>0;return Qe[t%Qe.length]}function $({name:e,size:t=`sm`}){return(0,Q.jsx)(`span`,{className:`tile tile-${$e(e)}${t===`lg`?` tile-lg`:``}`,"aria-hidden":!0,children:e.slice(0,1)})}function et({tile:e,lead:t,title:n,aside:r,description:i,meta:a,actions:o}){return(0,Q.jsxs)(`header`,{className:`page-head`,children:[(0,Q.jsxs)(`div`,{className:`page-head-text`,children:[e!==void 0&&(0,Q.jsx)($,{name:e,size:`lg`}),t,(0,Q.jsxs)(`div`,{style:{minWidth:0},children:[(0,Q.jsxs)(`h1`,{className:`page-title`,children:[(0,Q.jsx)(`span`,{children:n}),r!=null&&(0,Q.jsx)(`span`,{className:`page-title-aside`,children:r})]}),i!==void 0&&(0,Q.jsx)(`p`,{className:`page-desc`,children:i}),a!==void 0&&(0,Q.jsx)(`div`,{className:`page-meta`,children:a})]})]}),o!==void 0&&o!==!1&&(0,Q.jsx)(`div`,{className:`page-actions`,children:o})]})}function tt({title:e,description:t,actions:n,children:r,labelledBy:i,tone:a}){return(0,Q.jsxs)(`section`,{className:`card${a===`danger`?` card-danger`:``}`,"aria-labelledby":i,children:[(0,Q.jsxs)(`div`,{className:`card-head`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`card-title`,id:i,children:e}),t!==void 0&&(0,Q.jsx)(`p`,{className:`card-desc`,children:t})]}),n]}),r]})}function nt({label:e,children:t}){return(0,Q.jsxs)(`div`,{className:`fact`,children:[(0,Q.jsx)(`dt`,{children:e}),(0,Q.jsx)(`dd`,{children:t})]})}function rt({icon:e,label:t,title:n,children:r,actions:i}){return(0,Q.jsxs)(`div`,{className:`closed`,role:`status`,children:[e!==void 0&&(0,Q.jsx)(`div`,{className:`closed-icon`,"aria-hidden":!0,children:e}),t!==void 0&&(0,Q.jsx)(`p`,{className:`closed-label`,children:t}),(0,Q.jsx)(`h1`,{className:`closed-title`,children:n}),(0,Q.jsx)(`div`,{className:`closed-body`,children:r}),i!==void 0&&(0,Q.jsx)(`div`,{className:`closed-actions`,children:i})]})}export{z as A,C as B,Ne as C,H as D,Se as E,I as F,g as G,b as H,k as I,o as J,_ as K,te as L,D as M,E as N,V as O,ae as P,le as R,J as S,Ee as T,y as U,x as V,m as W,l as X,s as Y,We as _,$ as a,Le as b,Y as c,Ke as d,Z as f,Ze as g,X as h,et as i,N as j,B as k,qe as l,Ge as m,rt as n,Xe as o,Ye as p,d as q,nt as r,ze as s,tt as t,Je as u,Pe as v,Me as w,q as x,Fe as y,O as z};
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 ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(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?O(``+e.key):t.toString(36)}function j(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 M(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,M(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,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(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+=M(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+=M(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return M(j(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 N(e,t,n){if(e==null)return e;var r=[],i=0;return M(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function P(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 F=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)},I={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,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=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:P}},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,F)}catch(e){F(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),p=Symbol.for(`@coffre/client:CoffreError`),m=class extends Error{static[Symbol.hasInstance](e){return typeof e==`object`&&!!e&&p in e}[p]=!0;status;code;reason;constructor(e,t,n,r){super(n),this.name=`CoffreError`,this.status=e,this.code=t,this.reason=r}};function h(e){let[t=``,n=``,r=``]=e.replace(/^\/+|\/+$/g,``).split(`/`);return{project:t,environment:n,key:r}}function g(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 m(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`,h(e),t),update:(e,t)=>a(`PATCH /projects/:project/:environment`,h(e),t)},secrets:{list:e=>a(`GET /secrets/:project/:environment`,h(e)),reveal:e=>a(`POST /reveals`,{},{path:e}),set:(e,t)=>a(`PATCH /secrets/:project/:environment`,h(e),t),dryRun:(e,t)=>{let[n,a]=i(`PATCH /secrets/:project/:environment`,h(e));return r(n,`${a}?dryRun=1`,t)},history:e=>a(`GET /secrets/:project/:environment/:key/versions`,h(e)),restore:(e,t)=>a(`POST /secrets/:project/:environment/:key/restore`,h(e),{version:t}),rename:(e,t)=>a(`PATCH /secrets/:project/:environment/:key`,h(e),{key:t}),update:(e,t)=>a(`PATCH /secrets/:project/:environment/:key`,h(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})},audit:{list:(e={})=>a(`GET /audit`,{},e),verify:()=>a(`GET /audit/verification`,{}),keys:()=>a(`GET /audit/keys`,{})}}}async function _(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 v=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})),y=o(((e,t)=>{t.exports=v()})),b=f.createContext(null);function x(e){return f.useContext(b)}var S={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},C=new class{#e=S;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 w(e){setTimeout(e,0)}var T=typeof window>`u`||`Deno`in globalThis;function E(){}function ee(e,t){return typeof e==`function`?e(t):e}function D(e){return typeof e==`number`&&e>=0&&e!==1/0}function O(e,t){return Math.max(e+(t||0)-Date.now(),0)}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==M(o,t.options))return!1}else if(!P(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 j(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(N(t.options.mutationKey)!==N(a))return!1}else if(!P(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function M(e,t){return(t?.queryKeyHashFn||N)(e)}function N(e){return JSON.stringify(e,(e,t)=>L(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function P(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(!P(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!P(e[r],t[r]))return!1;return!0}return!1}var F=Object.prototype.hasOwnProperty;function I(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ne(e)&&ne(t);if(!r&&!(L(e)&&L(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:F.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=I(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function te(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 ne(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function L(e){if(!re(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!(!re(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{C.setTimeout(t,e)})}function ae(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:I(e,t)}function oe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function se(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var R=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===R?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function le(e,t){return typeof e==`function`?e(...t):!!e}function ue(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 de=()=>T,z=()=>de(),B=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(){}},V=new class extends B{#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`}},fe=w;function pe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=fe,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 H=pe(),U=new class extends B{#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 me(e){return Math.min(1e3*2**e,3e4)}function he(e){return(e??`online`)!==`online`||U.isOnline()}var W=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ge(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(E);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new W(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>V.isFocused()&&(e.networkMode===`always`||U.isOnline())&&e.canRun(),p=()=>he(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??(z()?0:3),a=e.retryDelay??me,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),ie(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 _e=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),D(this.gcTime)&&(this.#e=C.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(z()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(C.clearTimeout(this.#e),this.#e=void 0)}};function ve(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=>{ue(e,()=>t.signal,()=>n=!0)},u=ce(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?se:oe;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?be:ye,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:ye(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 ye(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 be(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var xe=class extends _e{#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=we(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=we(this.options);e.data!==void 0&&(this.setState(Ce(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ae(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(E).catch(E):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=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===R||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>k(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:!O(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=ce(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`?ve(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=ge({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof W&&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 W){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,...Se(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ce(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),H.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Se(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:he(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ce(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function we(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 Te=class extends _e{#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||Ee(),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=ge({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),H.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ee(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var De=class extends B{#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 Te({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=G(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=G(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=G(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=G(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){H.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=>j(t,e))}findAll(e={}){return this.getAll().filter(t=>j(e,t))}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return H.batch(()=>Promise.all(e.map(e=>e.continue().catch(E))))}};function G(e){return e.options.scope?.id}var Oe=class extends B{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??M(r,t),a=this.get(i);return a||(a=new xe({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(){H.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=>A(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>A(e,t)):t}notify(e){H.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){H.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){H.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ke=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Oe,this.#t=e.mutationCache||new De,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=V.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=U.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(k(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=ee(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return H.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;H.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return H.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=H.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(E).catch(E)}invalidateQueries(e,t={}){return H.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=H.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(E)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(E)}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(k(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(k(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(E).catch(E)}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(E).catch(E)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return U.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(N(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{P(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(N(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{P(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||=M(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===R&&(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 K(e){return e}var Ae={canManageGrants:!1,canReadAudit:!1,canCreateProject:!1};function je(e,t){if(e===null)return Ae;let n=e.instanceRole===`owner`||e.instanceRole===`root-admin`;return{canManageGrants:n,canReadAudit:e.canReadAudit,canCreateProject:n}}function Me(e){return e.includes(`secret.read`)}function Ne(){return x().options.context.client}var Pe=class extends Error{};function q(e){return e instanceof m?e.status:void 0}function Fe(e){return e instanceof Pe?e.message:e instanceof m?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 Ie(e){return{ok:!1,error:Fe(e),signedOut:q(e)===401}}async function J(e){try{return{ok:!0,...await e()}}catch(e){return Ie(e)}}function Le(e,t){return`${e===`user`?`user`:`token`}:${t}`}var Re=1e4;function ze(){return new ke({defaultOptions:{queries:{staleTime:Re,refetchOnWindowFocus:!0,retry:!1}}})}var Y={me:[`me`],auth:[`auth`],projects:[`projects`],grants:e=>[`grants`,e],secrets:({project:e,environment:t})=>[`secrets`,e,t],directory:[`directory`],report:e=>[`report`,e],credentials:e=>[`credentials`,e],identities:[`identities`],sessions:[`sessions`],audit:[`audit`]};function Be(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 Ve(e){return J(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 He=e=>J(()=>e.projects.list()),X={me:e=>K({queryKey:Y.me,queryFn:async()=>{try{return await e.me()}catch(e){if(q(e)===401)return null;throw e}}}),auth:e=>K({queryKey:Y.auth,queryFn:()=>e.auth()}),projects:e=>K({queryKey:Y.projects,queryFn:()=>He(e)}),grants:(e,t)=>K({queryKey:Y.grants(t),queryFn:()=>J(async()=>({grants:Be((await e.members.list(t)).members)}))}),secrets:(e,t)=>K({queryKey:Y.secrets(t),queryFn:()=>J(()=>e.secrets.list(`${t.project}/${t.environment}`))}),directory:(e,t)=>K({queryKey:[...Y.directory,{owner:t}],queryFn:()=>t?Ve(e):Promise.resolve({ok:!1,error:`Only owners can manage users and service accounts.`,signedOut:!1})}),report:(e,t,n)=>K({queryKey:[...Y.report(t),{owner:n}],queryFn:()=>n?J(async()=>{try{return{report:await e.members.get(t)}}catch(e){if(q(e)===404)return{report:null};throw e}}):Promise.resolve(null)}),credentials:(e,t,n)=>K({queryKey:[...Y.credentials(t),{allowed:n}],queryFn:()=>n?J(()=>e.tokens.list(t)):Promise.resolve(null)}),identities:e=>K({queryKey:Y.identities,queryFn:()=>J(()=>e.identities.list())}),sessions:e=>K({queryKey:Y.sessions,queryFn:()=>J(()=>e.sessions.list())}),auditEntries:(e,t)=>K({queryKey:[...Y.audit,`entries`,t],staleTime:0,queryFn:()=>J(()=>e.audit.list({limit:200,decision:t.decision,actor:t.actorId,detail:t.detail}))}),auditChain:e=>K({queryKey:[...Y.audit,`chain`],staleTime:0,queryFn:()=>Ue(e)})};async function Ue(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=q(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 We(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:je(i,r),registrationRequired:t!==null&&!t.registered,instance:i?.instance??null,accessTampered:t?.tampered===!0}}async function Z(e,t){let[n,r,i]=await Promise.all([e.fetchQuery(X.auth(t)),e.fetchQuery(X.me(t)),e.fetchQuery(X.projects(t))]);return We(n,r,i)}function Ge(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 Ke(e,t,n){let r=Ge(await e.fetchQuery(X.projects(t)),n);r.ok&&r.managesAccess&&await e.fetchQuery(X.grants(t,n))}async function qe(e,t){let n=await Z(e,t);return e.fetchQuery(X.directory(t,n.capabilities.canManageGrants))}async function Je(e,t,n,r){let i=await Z(e,t),a=Le(n,r),o=i.capabilities.canManageGrants;await Promise.all([e.fetchQuery(X.report(t,a,o)),n===`service`?e.fetchQuery(X.credentials(t,a,o&&i.auth.signin!==null)):null,...Ye(i.projects).map(n=>e.fetchQuery(X.grants(t,n.slug)))])}function Ye(e){return e.filter(e=>e.permissions.includes(`grant.manage`))}var Xe={places:()=>[Y.projects,Y.me],secrets:e=>[Y.secrets(e),Y.projects],access:(e,t)=>[Y.grants(e),Y.report(t),Y.projects,Y.me],admission:()=>[Y.directory],role:e=>[Y.directory,Y.report(e),Y.me,Y.projects],removal:e=>[Y.directory,Y.report(e),[`grants`]],credentials:e=>[Y.credentials(e)],identities:()=>[Y.identities,Y.sessions],sessions:()=>[Y.sessions]};async function Ze(e,t){await Promise.all([...t,Y.audit].map(t=>e.invalidateQueries({queryKey:t})))}var Q=y(),Qe=[`blue`,`green`,`amber`,`violet`];function $e(e){let t=2166136261;for(let n of e)t=Math.imul(t^n.charCodeAt(0),16777619)>>>0;return Qe[t%Qe.length]}function $({name:e,size:t=`sm`}){return(0,Q.jsx)(`span`,{className:`tile tile-${$e(e)}${t===`lg`?` tile-lg`:``}`,"aria-hidden":!0,children:e.slice(0,1)})}function et({tile:e,lead:t,title:n,aside:r,description:i,meta:a,actions:o}){return(0,Q.jsxs)(`header`,{className:`page-head`,children:[(0,Q.jsxs)(`div`,{className:`page-head-text`,children:[e!==void 0&&(0,Q.jsx)($,{name:e,size:`lg`}),t,(0,Q.jsxs)(`div`,{style:{minWidth:0},children:[(0,Q.jsxs)(`h1`,{className:`page-title`,children:[(0,Q.jsx)(`span`,{children:n}),r!=null&&(0,Q.jsx)(`span`,{className:`page-title-aside`,children:r})]}),i!==void 0&&(0,Q.jsx)(`p`,{className:`page-desc`,children:i}),a!==void 0&&(0,Q.jsx)(`div`,{className:`page-meta`,children:a})]})]}),o!==void 0&&o!==!1&&(0,Q.jsx)(`div`,{className:`page-actions`,children:o})]})}function tt({title:e,description:t,actions:n,children:r,labelledBy:i,tone:a}){return(0,Q.jsxs)(`section`,{className:`card${a===`danger`?` card-danger`:``}`,"aria-labelledby":i,children:[(0,Q.jsxs)(`div`,{className:`card-head`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`card-title`,id:i,children:e}),t!==void 0&&(0,Q.jsx)(`p`,{className:`card-desc`,children:t})]}),n]}),r]})}function nt({label:e,children:t}){return(0,Q.jsxs)(`div`,{className:`fact`,children:[(0,Q.jsx)(`dt`,{children:e}),(0,Q.jsx)(`dd`,{children:t})]})}function rt({icon:e,label:t,title:n,children:r,actions:i}){return(0,Q.jsxs)(`div`,{className:`closed`,role:`status`,children:[e!==void 0&&(0,Q.jsx)(`div`,{className:`closed-icon`,"aria-hidden":!0,children:e}),t!==void 0&&(0,Q.jsx)(`p`,{className:`closed-label`,children:t}),(0,Q.jsx)(`h1`,{className:`closed-title`,children:n}),(0,Q.jsx)(`div`,{className:`closed-body`,children:r}),i!==void 0&&(0,Q.jsx)(`div`,{className:`closed-actions`,children:i})]})}export{z as A,C as B,Ne as C,H as D,Se as E,I as F,g as G,b as H,k as I,o as J,_ as K,te as L,D as M,E as N,V as O,ae as P,le as R,J as S,Ee as T,y as U,x as V,m as W,l as X,s as Y,We as _,$ as a,Le as b,Y as c,Ke as d,Z as f,Ze as g,X as h,et as i,N as j,B as k,qe as l,Ge as m,rt as n,Xe as o,Ye as p,d as q,nt as r,ze as s,tt as t,Je as u,Pe as v,Me as w,q as x,Fe as y,O as z};
@@ -1 +1 @@
1
- import{U as e,V as t,X as n,q as r}from"./page-Dngv8FMr.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-CqlAJWBd.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=n(r(),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
+ import{U as e,V as t,X as n,q as r}from"./page-CDuo3uft.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-Bg_PHv45.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=n(r(),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 +1 @@
1
- import{C as e,U as t,X as n,a as r,b as i,h as a,i as o,n as s,o as c,p as l,q as u}from"./page-Dngv8FMr.js";import{t as d}from"./link-CqlAJWBd.js";import{E as f,l as p,n as m}from"./use-change-Bd6NZJj9.js";import{n as h,t as g}from"./use-shell-Dx92Huhb.js";import{t as _}from"./useSuspenseQuery-tP9HFZ8w.js";import{n as v}from"./dist-BNkBTkxj.js";import{a as y,c as b,i as x,o as S,s as C}from"./ui-BPWFJNz7.js";import{U as w,W as T,k as E,l as D,p as O,v as k}from"./icons-BRl8DlXW.js";import{t as A}from"./row-state-BlarvG7E.js";import{a as j,i as M,o as N,r as ee}from"./directory-C4BMGC7-.js";import{t as P}from"./use-action-LULgF26O.js";import{n as F,t as I}from"./grants-CyDW25eX.js";import{r as L,t as R}from"./offboarding--5vSKNHv.js";var z=n(u(),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:o,capabilities:s}=g(),c=l(o),{data:u}=_(a.report(r,i(t,n),s.canManageGrants)),d=h({queries:c.map(e=>a.grants(r,e.slug))});return{report:u,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:c}=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&&c.length===0)return(0,X.jsx)(s,{icon:_?(0,X.jsx)(w,{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 T=c.flatMap(({project:e,grants:t})=>t.map(t=>({project:e,grant:t}))),E=c.filter(e=>e.grantsError!==null),D=b?[]:c.filter(({project:e,grantsError:t})=>e.archivedAt===null&&t===null);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(o,{lead:(0,X.jsx)(N,{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)(ee,{principal:S}),actions:(D.length>0||S!==void 0)&&(0,X.jsxs)(X.Fragment,{children:[D.length>0&&(0,X.jsx)(te,{principalType:e,principalId:t,access:D}),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`}),E.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:T.length===0?(0,X.jsx)(x,{title:`No project access yet`,children:D.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)(O,{size:14}),`Project`]}),children:T.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,l]=(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 w(){l(!1),d({}),h(null)}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>l(!0),children:[(0,X.jsx)(E,{size:14}),`Edit access`]}),(0,X.jsx)(S,{open:s,onOpenChange:e=>e?l(!0):w(),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})=>c.access(e.slug,i(t,n))),onSuccess:()=>{v.success(`Updated ${n}’s access on ${C.length} project${C.length===1?``:`s`}`),w()}})},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:w,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)(D,{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};
1
+ import{C as e,U as t,X as n,a as r,b as i,h as a,i as o,n as s,o as c,p as l,q as u}from"./page-CDuo3uft.js";import{t as d}from"./link-Bg_PHv45.js";import{E as f,l as p,n as m}from"./use-change-DIpkq9iI.js";import{n as h,t as g}from"./use-shell-BJwawvkh.js";import{t as _}from"./useSuspenseQuery-BfnNEmf7.js";import{n as v}from"./dist-BHhATf1q.js";import{a as y,c as b,i as x,o as S,s as C}from"./ui-Ch0beQy-.js";import{U as w,W as T,k as E,l as D,p as O,v as k}from"./icons-BFziRUf9.js";import{t as A}from"./row-state-BzGdu73b.js";import{a as j,i as M,o as N,r as ee}from"./directory-skRBmF1Y.js";import{t as P}from"./use-action-cgaBRBBH.js";import{n as F,t as I}from"./grants-BEmVXYg5.js";import{r as L,t as R}from"./offboarding-CXV0KyMt.js";var z=n(u(),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:o,capabilities:s}=g(),c=l(o),{data:u}=_(a.report(r,i(t,n),s.canManageGrants)),d=h({queries:c.map(e=>a.grants(r,e.slug))});return{report:u,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:c}=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&&c.length===0)return(0,X.jsx)(s,{icon:_?(0,X.jsx)(w,{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 T=c.flatMap(({project:e,grants:t})=>t.map(t=>({project:e,grant:t}))),E=c.filter(e=>e.grantsError!==null),D=b?[]:c.filter(({project:e,grantsError:t})=>e.archivedAt===null&&t===null);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(o,{lead:(0,X.jsx)(N,{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)(ee,{principal:S}),actions:(D.length>0||S!==void 0)&&(0,X.jsxs)(X.Fragment,{children:[D.length>0&&(0,X.jsx)(te,{principalType:e,principalId:t,access:D}),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`}),E.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:T.length===0?(0,X.jsx)(x,{title:`No project access yet`,children:D.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)(O,{size:14}),`Project`]}),children:T.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,l]=(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 w(){l(!1),d({}),h(null)}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{className:`btn btn-primary`,onClick:()=>l(!0),children:[(0,X.jsx)(E,{size:14}),`Edit access`]}),(0,X.jsx)(S,{open:s,onOpenChange:e=>e?l(!0):w(),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})=>c.access(e.slug,i(t,n))),onSuccess:()=>{v.success(`Updated ${n}’s access on ${C.length} project${C.length===1?``:`s`}`),w()}})},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:w,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)(D,{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};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_coffre/assets/projects._project._environment-B-5I0ZFP.js","_coffre/assets/page-CDuo3uft.js","_coffre/assets/link-Bg_PHv45.js","_coffre/assets/use-change-DIpkq9iI.js","_coffre/assets/suspense-Cnh1cNc1.js","_coffre/assets/row-state-BzGdu73b.js","_coffre/assets/ui-Ch0beQy-.js","_coffre/assets/icons-BFziRUf9.js","_coffre/assets/use-shell-BJwawvkh.js","_coffre/assets/useSuspenseQuery-BfnNEmf7.js","_coffre/assets/dist-BHhATf1q.js","_coffre/assets/affordances-B9nFwqIv.js","_coffre/assets/use-action-cgaBRBBH.js","_coffre/assets/validation-9Cl_XS-l.js"])))=>i.map(i=>d[i]);
2
+ import{h as e}from"./page-CDuo3uft.js";import{n as t,r as n,t as r}from"./preload-helper-CYFH1xAV.js";var i=n(`/projects/$project/$environment`)({validateSearch:e=>({filter:typeof e.filter==`string`&&e.filter!==``?e.filter:void 0}),loader:({context:{client:t,queryClient:n},params:r})=>n.fetchQuery(e.secrets(t,r)),component:t(()=>r(()=>import(`./projects._project._environment-B-5I0ZFP.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),`component`)});export{i as t};