orqevio 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/web/assets/{AccessKeyReveal-CP2Sm1DM.js → AccessKeyReveal-BhGhJ9TO.js} +1 -1
  2. package/dist/web/assets/{AccessRows-BDJ9Gtg1.js → AccessRows-BukzKFuJ.js} +1 -1
  3. package/dist/web/assets/{ActivityList-CS7AMLtm.js → ActivityList-TVMXixkB.js} +1 -1
  4. package/dist/web/assets/{AgentsPage-CC9Qqwrq.js → AgentsPage-lZ18h_Fd.js} +1 -1
  5. package/dist/web/assets/{Avatar-DJI4yDCJ.js → Avatar-B1img0gb.js} +1 -1
  6. package/dist/web/assets/BoardPage-DiTjq46K.js +1 -0
  7. package/dist/web/assets/{Button-CaaiSWVd.js → Button-CHkkj3LG.js} +1 -1
  8. package/dist/web/assets/{CardItem-335cP4hf.js → CardItem-BAkxFtTs.js} +1 -1
  9. package/dist/web/assets/{Checkbox-DsYEB6SC.js → Checkbox-S2SJTJty.js} +1 -1
  10. package/dist/web/assets/{ColorPicker-CgNvcSm7.js → ColorPicker-DSVbH2ix.js} +1 -1
  11. package/dist/web/assets/{ConsentPage-B1cAJnPs.js → ConsentPage-CXS-bOLl.js} +1 -1
  12. package/dist/web/assets/{CopyButton-MHBEUW1-.js → CopyButton-BDbxvAXk.js} +1 -1
  13. package/dist/web/assets/DocPage-8QmjOXZg.js +1 -0
  14. package/dist/web/assets/{EmptyState-BjkQU_2d.js → EmptyState-D6CMbgBz.js} +1 -1
  15. package/dist/web/assets/{Field-BHRDucE9.js → Field-BsUKJQ-4.js} +1 -1
  16. package/dist/web/assets/{HomePage-GVs6GSeR.js → HomePage-Bm_gsAiP.js} +1 -1
  17. package/dist/web/assets/{Menu-GG9F8t1A.js → Menu-CzgZwzmu.js} +1 -1
  18. package/dist/web/assets/{PageHeader-CE8sCm7O.js → PageHeader-DJdrnGpr.js} +1 -1
  19. package/dist/web/assets/{Phrases-DftRflqk.js → Phrases-C89QdC4L.js} +1 -1
  20. package/dist/web/assets/Popover-BVPB22vZ.js +1 -0
  21. package/dist/web/assets/{ProjectPage-Y62SbAUg.js → ProjectPage-hVAuJHb8.js} +1 -1
  22. package/dist/web/assets/{ProjectSettingsDialog-CucUzCi8.js → ProjectSettingsDialog-ekHTFmaO.js} +1 -1
  23. package/dist/web/assets/{Segmented-C_LnD1mj.js → Segmented-BibQ5uCT.js} +1 -1
  24. package/dist/web/assets/{SettingsPage-6VUN2Hkm.js → SettingsPage-BlACK1Ir.js} +1 -1
  25. package/dist/web/assets/{States-BfRfXN15.js → States-D9T0E3QG.js} +1 -1
  26. package/dist/web/assets/{TokenCard-CXXi_YD_.js → TokenCard-DcxUdsB4.js} +1 -1
  27. package/dist/web/assets/{Trans-Dwl9vXMB.js → Trans-CA0OvHif.js} +1 -1
  28. package/dist/web/assets/TrashPage-DtEce2C1.js +1 -0
  29. package/dist/web/assets/{VaultPage-Cpf15EJg.js → VaultPage-BXNKzLjV.js} +1 -1
  30. package/dist/web/assets/{actions-B4SD3ZSA.js → actions-TwDLbdln.js} +1 -1
  31. package/dist/web/assets/{activity-C3OJB6dT.js → activity-C0-uReAO.js} +1 -1
  32. package/dist/web/assets/{arrow-up-right-DzWSrgbl.js → arrow-up-right-GSt0z737.js} +1 -1
  33. package/dist/web/assets/check-A2t_TRNF.js +1 -0
  34. package/dist/web/assets/chevron-down-MyAtFaeL.js +1 -0
  35. package/dist/web/assets/chevron-right-BGyQzokh.js +1 -0
  36. package/dist/web/assets/{clock-Dv2gO1hx.js → clock-Dat3GIX9.js} +1 -1
  37. package/dist/web/assets/dist-DFO0RDUp.js +1 -0
  38. package/dist/web/assets/{download-G_xumAL_.js → download-CHH-5Z1W.js} +1 -1
  39. package/dist/web/assets/{download-CC5hNb_z.js → download-CRdduKx2.js} +1 -1
  40. package/dist/web/assets/{eye-BRlDzN6c.js → eye-CkYWwyJN.js} +1 -1
  41. package/dist/web/assets/{file-plus-BJ5sZ4_S.js → file-plus-B9m4uZcE.js} +1 -1
  42. package/dist/web/assets/{folder-open-BnGaROW7.js → folder-open-DCuG03EB.js} +1 -1
  43. package/dist/web/assets/{format-BVq_UI0J.js → format-Dk1nO38Z.js} +1 -1
  44. package/dist/web/assets/{index-55_U3eq8.js → index-DaNg7x81.js} +1 -1
  45. package/dist/web/assets/{lock-keyhole-Djv60i7r.js → lock-keyhole-DVrMCpqy.js} +1 -1
  46. package/dist/web/assets/{markdown-html-DCdPZD4C.js → markdown-html-Bbis0Fwx.js} +73 -73
  47. package/dist/web/assets/{paperclip-Dbt7ft29.js → paperclip-BnASHXPW.js} +1 -1
  48. package/dist/web/assets/{pencil-DL6HUNUM.js → pencil-C37OTkSN.js} +1 -1
  49. package/dist/web/assets/plus-DcOCeQtr.js +1 -0
  50. package/dist/web/assets/{realtime-BMqja886.js → realtime-Dn6o1BHn.js} +1 -1
  51. package/dist/web/assets/{restore-BE3HhGP4.js → restore-CAzTqClb.js} +1 -1
  52. package/dist/web/assets/router-BVJjZgrw.js +1 -0
  53. package/dist/web/assets/router-C3-WXlLY.js +6 -0
  54. package/dist/web/assets/{search-Bj8d5ft7.js → search-6TSW8Big.js} +1 -1
  55. package/dist/web/assets/{session-Bk-WM0zq.js → session-BdZhhrrQ.js} +1 -1
  56. package/dist/web/assets/{shield-exclamation-point-Bc5-UJbC.js → shield-exclamation-point-sqW5yuTY.js} +1 -1
  57. package/dist/web/assets/{square-kanban-WA9_EY-N.js → square-kanban-Cd_tPOtx.js} +1 -1
  58. package/dist/web/assets/{sticky-note-DyZXd_-_.js → sticky-note-hvgZ-pol.js} +1 -1
  59. package/dist/web/assets/{sync-B8v5y0v_.js → sync-Byk1kJR_.js} +1 -1
  60. package/dist/web/assets/{tag-B9G_Z0Ii.js → tag-CBK0qBXV.js} +1 -1
  61. package/dist/web/assets/{trash-C0okQtqH.js → trash-BtTKuFPT.js} +2 -2
  62. package/dist/web/assets/{trash-COg6vRm8.js → trash-CkQBpprn.js} +1 -1
  63. package/dist/web/assets/{triangle-exclamation-point-B2z2xtST.js → triangle-exclamation-point-BTUlFMkc.js} +1 -1
  64. package/dist/web/index.html +33 -33
  65. package/dist/worker/index.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/web/assets/BoardPage-BhOlMFNk.js +0 -1
  68. package/dist/web/assets/DocPage-pqtzFH44.js +0 -1
  69. package/dist/web/assets/Popover-DQ5dN5Cv.js +0 -1
  70. package/dist/web/assets/TrashPage-Dnx7-c4T.js +0 -1
  71. package/dist/web/assets/check-a7phVGDi.js +0 -1
  72. package/dist/web/assets/chevron-down-DHFpQP3r.js +0 -1
  73. package/dist/web/assets/chevron-right-BJJ2BXpg.js +0 -1
  74. package/dist/web/assets/dist-BsPSSv6i.js +0 -1
  75. package/dist/web/assets/plus-Hg2QI8YW.js +0 -1
  76. package/dist/web/assets/router-QbdvZGkb.js +0 -6
  77. package/dist/web/assets/router-qpSsldc5.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ct as t,Dt as n,Ot as r,Tt as i,in as a,rn as o,wt as s}from"./format-BVq_UI0J.js";import{t as c}from"./check-a7phVGDi.js";var l=e(a(),1),u={tomato:`#e5532a`,amber:`#d29a12`,lime:`#7fa82d`,jade:`#2a9668`,teal:`#1b93a6`,cobalt:`#3a6ae0`,iris:`#7657e0`,rose:`#d4468a`,slate:`#6b7180`},d={light:{min:0,max:u.amber},dark:{min:`#6f95ff`,max:`#a5cf52`}},f=.11,p=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,m=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,h=e=>Math.min(1,Math.max(0,e)),g=e=>[1,3,5].map(t=>p(Number.parseInt(e.slice(t,t+2),16)/255)),_=([e,t,n])=>.2126*h(e)+.7152*h(t)+.0722*h(n);function v([e,t,n]){let r=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*n),i=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*n),a=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*n);return{L:.2104542553*r+.793617785*i-.0040720468*a,a:1.9779984951*r-2.428592205*i+.4505937099*a,b:.0259040371*r+.7827717662*i-.808675766*a}}function y({L:e,a:t,b:n}){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[4.0767416621*r-3.3077115913*i+.2309699292*a,-1.2684380046*r+2.6097574011*i-.3413193965*a,-.0041960863*r-.7034186147*i+1.707614701*a]}var b=e=>e.every(e=>e>=-1e-4&&e<=1.0001),x=e=>`#${e.map(e=>Math.round(h(m(h(e)))*255).toString(16).padStart(2,`0`)).join(``)}`;function S(e,t){let n=y({L:t,a:e.a,b:e.b});if(b(n))return n;let[r,i]=[0,1];for(let n=0;n<20;n++){let n=(r+i)/2;b(y({L:t,a:e.a*n,b:e.b*n}))?r=n:i=n}return y({L:t,a:e.a*r,b:e.b*r})}function C(e,t,n){let[r,i]=[n.min,n.max].map((e,t)=>typeof e==`number`?e:_(g(e))*(t===0?1.01:.99)),a=t=>_(S(e,t)),o=(e,t,n,r)=>{for(let i=0;i<24;i++){let i=(e+t)/2;n(i)===(r===`low`)?e=i:t=i}return r===`low`?e:t};return a(t)>i?t=o(0,t,e=>a(e)<=i,`low`):a(t)<r&&(t=o(t,1,e=>a(e)>=r,`high`)),S(e,t)}var w=new Map;function T(e){let t=w.get(e);if(t)return t;let n=g(e),r=v(n),i=_(n)<=_(g(d.light.max))?n:C(r,r.L,d.light),a={light:x(i),dark:x(C(r,v(i).L+f,d.dark))};return w.set(e,a),a}function E(e){if(i(e))return{className:`c-${e}`};if(!t.test(e))return{className:`c-slate`};let{light:n,dark:r}=T(e);return{className:`c-custom`,style:{"--c-custom-light":n,"--c-custom-dark":r}}}var D=o(),O=`conic-gradient(from 210deg, ${[...s.filter(e=>e!==`slate`),`tomato`].map(e=>u[e]).join(`, `)})`;function k(e){let{value:t,onChange:i,label:a}=e,{t:o}=r();return(0,D.jsxs)(`div`,{role:`radiogroup`,"aria-label":a??o(`color`),className:`flex flex-wrap gap-1.5`,children:[s.map(e=>(0,D.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e,"aria-label":o(`colors.${e}`),title:o(`colors.${e}`),onClick:()=>i(e),className:n(`c-${e}`,`grid size-7 place-items-center rounded-full transition-transform duration-150 hover:scale-110`,t===e&&`ring-2 ring-[var(--c)] ring-offset-2 ring-offset-sheet`),style:{background:`var(--c)`},children:t===e&&(0,D.jsx)(c,{className:`size-3.5 text-white`,strokeWidth:3})},e)),e.custom&&(0,D.jsx)(A,{value:e.value,onChange:e.onChange})]})}function A({value:e,onChange:t}){let{t:a}=r(),o=(0,l.useRef)(null),s=!i(e),d=s?E(e):null,f=s?a(`colors.customValue`,{value:e}):a(`colors.custom`),p=i(e)?u[e]:e;return(0,D.jsxs)(`span`,{className:`group/swatch relative grid size-7`,children:[(0,D.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":s,"aria-label":f,onClick:()=>{navigator.maxTouchPoints>0&&o.current?.focus({preventScroll:!0}),o.current?.click()},className:n(d?.className,`grid size-7 place-items-center rounded-full transition-transform duration-150 group-hover/swatch:scale-110`,`group-has-[input:focus-visible]/swatch:outline-2 group-has-[input:focus-visible]/swatch:outline-offset-2 group-has-[input:focus-visible]/swatch:outline-accent`,s&&`ring-2 ring-[var(--c)] ring-offset-2 ring-offset-sheet`),style:s?{...d?.style,background:`var(--c)`}:{background:O},children:s?(0,D.jsx)(c,{className:`size-3.5 text-white`,strokeWidth:3}):(0,D.jsx)(`span`,{className:`size-[18px] rounded-full bg-sheet`})}),(0,D.jsx)(`input`,{ref:o,type:`color`,value:p,tabIndex:-1,"aria-hidden":`true`,title:f,className:`absolute inset-0 size-full cursor-pointer rounded-full opacity-0`,onChange:e=>t(e.currentTarget.value.toLowerCase())})]})}export{E as n,k as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Ct as t,Dt as n,Ot as r,Tt as i,in as a,rn as o,wt as s}from"./format-Dk1nO38Z.js";import{t as c}from"./check-A2t_TRNF.js";var l=e(a(),1),u={tomato:`#e5532a`,amber:`#d29a12`,lime:`#7fa82d`,jade:`#2a9668`,teal:`#1b93a6`,cobalt:`#3a6ae0`,iris:`#7657e0`,rose:`#d4468a`,slate:`#6b7180`},d={light:{min:0,max:u.amber},dark:{min:`#6f95ff`,max:`#a5cf52`}},f=.11,p=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,m=e=>e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,h=e=>Math.min(1,Math.max(0,e)),g=e=>[1,3,5].map(t=>p(Number.parseInt(e.slice(t,t+2),16)/255)),_=([e,t,n])=>.2126*h(e)+.7152*h(t)+.0722*h(n);function v([e,t,n]){let r=Math.cbrt(.4122214708*e+.5363325363*t+.0514459929*n),i=Math.cbrt(.2119034982*e+.6806995451*t+.1073969566*n),a=Math.cbrt(.0883024619*e+.2817188376*t+.6299787005*n);return{L:.2104542553*r+.793617785*i-.0040720468*a,a:1.9779984951*r-2.428592205*i+.4505937099*a,b:.0259040371*r+.7827717662*i-.808675766*a}}function y({L:e,a:t,b:n}){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[4.0767416621*r-3.3077115913*i+.2309699292*a,-1.2684380046*r+2.6097574011*i-.3413193965*a,-.0041960863*r-.7034186147*i+1.707614701*a]}var b=e=>e.every(e=>e>=-1e-4&&e<=1.0001),x=e=>`#${e.map(e=>Math.round(h(m(h(e)))*255).toString(16).padStart(2,`0`)).join(``)}`;function S(e,t){let n=y({L:t,a:e.a,b:e.b});if(b(n))return n;let[r,i]=[0,1];for(let n=0;n<20;n++){let n=(r+i)/2;b(y({L:t,a:e.a*n,b:e.b*n}))?r=n:i=n}return y({L:t,a:e.a*r,b:e.b*r})}function C(e,t,n){let[r,i]=[n.min,n.max].map((e,t)=>typeof e==`number`?e:_(g(e))*(t===0?1.01:.99)),a=t=>_(S(e,t)),o=(e,t,n,r)=>{for(let i=0;i<24;i++){let i=(e+t)/2;n(i)===(r===`low`)?e=i:t=i}return r===`low`?e:t};return a(t)>i?t=o(0,t,e=>a(e)<=i,`low`):a(t)<r&&(t=o(t,1,e=>a(e)>=r,`high`)),S(e,t)}var w=new Map;function T(e){let t=w.get(e);if(t)return t;let n=g(e),r=v(n),i=_(n)<=_(g(d.light.max))?n:C(r,r.L,d.light),a={light:x(i),dark:x(C(r,v(i).L+f,d.dark))};return w.set(e,a),a}function E(e){if(i(e))return{className:`c-${e}`};if(!t.test(e))return{className:`c-slate`};let{light:n,dark:r}=T(e);return{className:`c-custom`,style:{"--c-custom-light":n,"--c-custom-dark":r}}}var D=o(),O=`conic-gradient(from 210deg, ${[...s.filter(e=>e!==`slate`),`tomato`].map(e=>u[e]).join(`, `)})`;function k(e){let{value:t,onChange:i,label:a}=e,{t:o}=r();return(0,D.jsxs)(`div`,{role:`radiogroup`,"aria-label":a??o(`color`),className:`flex flex-wrap gap-1.5`,children:[s.map(e=>(0,D.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===e,"aria-label":o(`colors.${e}`),title:o(`colors.${e}`),onClick:()=>i(e),className:n(`c-${e}`,`grid size-7 place-items-center rounded-full transition-transform duration-150 hover:scale-110`,t===e&&`ring-2 ring-[var(--c)] ring-offset-2 ring-offset-sheet`),style:{background:`var(--c)`},children:t===e&&(0,D.jsx)(c,{className:`size-3.5 text-white`,strokeWidth:3})},e)),e.custom&&(0,D.jsx)(A,{value:e.value,onChange:e.onChange})]})}function A({value:e,onChange:t}){let{t:a}=r(),o=(0,l.useRef)(null),s=!i(e),d=s?E(e):null,f=s?a(`colors.customValue`,{value:e}):a(`colors.custom`),p=i(e)?u[e]:e;return(0,D.jsxs)(`span`,{className:`group/swatch relative grid size-7`,children:[(0,D.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":s,"aria-label":f,onClick:()=>{navigator.maxTouchPoints>0&&o.current?.focus({preventScroll:!0}),o.current?.click()},className:n(d?.className,`grid size-7 place-items-center rounded-full transition-transform duration-150 group-hover/swatch:scale-110`,`group-has-[input:focus-visible]/swatch:outline-2 group-has-[input:focus-visible]/swatch:outline-offset-2 group-has-[input:focus-visible]/swatch:outline-accent`,s&&`ring-2 ring-[var(--c)] ring-offset-2 ring-offset-sheet`),style:s?{...d?.style,background:`var(--c)`}:{background:O},children:s?(0,D.jsx)(c,{className:`size-3.5 text-white`,strokeWidth:3}):(0,D.jsx)(`span`,{className:`size-[18px] rounded-full bg-sheet`})}),(0,D.jsx)(`input`,{ref:o,type:`color`,value:p,tabIndex:-1,"aria-hidden":`true`,title:f,className:`absolute inset-0 size-full cursor-pointer rounded-full opacity-0`,onChange:e=>t(e.currentTarget.value.toLowerCase())})]})}export{E as n,k as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Et as t,Gt as n,N as r,Ot as i,Xt as a,bt as o,en as s,in as c,nt as l,ot as u,p as d,rn as f,yt as p}from"./format-BVq_UI0J.js";import{t as m}from"./triangle-exclamation-point-B2z2xtST.js";import{n as h,t as g}from"./shield-exclamation-point-Bc5-UJbC.js";import{a as _,i as v,t as y}from"./States-BfRfXN15.js";import{t as b}from"./Avatar-DJI4yDCJ.js";import{t as x}from"./Button-CaaiSWVd.js";import{n as S}from"./theme-BfxBDblB.js";import{t as C}from"./AccessRows-BDJ9Gtg1.js";import{t as w}from"./destination-CEcYXsDA.js";var T={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};T.node;var E=t(T),D=e(c(),1),O=f();function k({title:e,subtitle:t,children:n}){return(0,O.jsxs)(`main`,{className:`flex min-h-dvh flex-col items-center justify-center bg-sheet px-6 py-12 sm:px-10`,children:[(0,O.jsxs)(`div`,{className:`mb-10 flex items-center gap-2.5`,children:[(0,O.jsx)(v,{size:30}),(0,O.jsx)(_,{})]}),(0,O.jsxs)(`div`,{className:`animate-rise w-full max-w-[460px]`,children:[(0,O.jsx)(`h1`,{className:`font-display text-[30px] leading-tight font-medium tracking-[-0.02em]`,children:e}),t&&(0,O.jsx)(`p`,{className:`mt-2 text-[14px] leading-relaxed text-ink-2`,children:t}),(0,O.jsx)(`div`,{className:`mt-8`,children:n})]})]})}function A(){let{t:e}=i(`oauth`),t=r(),o=a(),c=(0,D.useMemo)(()=>Object.fromEntries(new URLSearchParams(o.search)),[o.search]),d=s({queryKey:[`oauth-request`,o.search],queryFn:()=>u(`/oauth/request`,{params:c}),enabled:!!t.data?.user,retry:!1,staleTime:1/0});if(t.isPending)return(0,O.jsx)(y,{});if(t.isError||!t.data?.user)return(0,O.jsx)(n,{to:`/login?next=${encodeURIComponent(o.pathname+o.search)}`,replace:!0});if(d.isPending)return(0,O.jsx)(y,{});if(d.isError)return(0,O.jsx)(j,{message:l(d.error)});let f=d.data;return f.kind===`problem`?(0,O.jsx)(j,{message:e(`problems.${f.problem}`),detail:f.detail}):f.kind===`redirect`?(0,O.jsx)(M,{to:f.redirect}):(0,O.jsx)(N,{params:c,request:f,workspaces:t.data.workspaces})}function j({message:e,detail:t}){let{t:n}=i(`oauth`);return(0,O.jsxs)(k,{title:n(`problem.title`),children:[(0,O.jsx)(`p`,{role:`alert`,className:`rounded-[12px] bg-danger-soft px-3.5 py-3 text-[13.5px] leading-relaxed text-danger`,children:e}),t&&(0,O.jsx)(`p`,{className:`mt-3 font-mono text-[11.5px] break-words text-ink-3`,children:t}),(0,O.jsx)(`a`,{href:`/`,className:`mt-6 inline-flex text-[13.5px] font-medium text-accent hover:underline`,children:n(`problem.home`)})]})}function M({to:e}){let{t}=i(`oauth`),n=w(e);return(0,D.useEffect)(()=>window.location.assign(e),[e]),(0,O.jsx)(k,{title:t(`leaving.title`),subtitle:t(`leaving.subtitle.${n.kind}`,{name:n.name}),children:(0,O.jsx)(`span`,{})})}function N({params:e,request:t,workspaces:n}){let{t:r}=i([`oauth`,`agents`,`common`]),{client:a}=t,s=t.scopes.length>0,[c,f]=(0,D.useState)(s?p(t.scopes,`tasks`):`write`),[_,v]=(0,D.useState)(s?p(t.scopes,`docs`):`read`),[y,T]=(0,D.useState)(!s||t.scopes.includes(`organize`)),A=S(`workspace`,null),[j,N]=(0,D.useState)(n.find(e=>e.id===A)?.id??n[0]?.id??``),[P,F]=(0,D.useState)(null),[I,L]=(0,D.useState)(null),[R,z]=(0,D.useState)(null),B=o({tasks:c,docs:_,organize:y}),V=w(a.redirectUri),[H,U]=(0,D.useState)(!0),W=t.existing.filter(e=>e.workspaceId===j),G=W.map(e=>e.lastUsedAt).filter(e=>e!==null).sort().at(-1);async function K(t){F(t?`allow`:`deny`),L(null);try{let{redirect:n}=await u(`/oauth/decision`,{params:e,allow:t,workspaceId:j,scopes:B,replace:W.length>0&&H});z(n)}catch(e){L(l(e)),F(null)}}return R?(0,O.jsx)(M,{to:R}):(0,O.jsx)(k,{title:r(`consent.title`,{name:a.name}),subtitle:r(`consent.subtitle`),children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,O.jsxs)(`section`,{"aria-label":r(`consent.app`),className:`rounded-[14px] border border-line bg-surface p-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(b,{name:a.name,kind:`agent`,size:36}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`truncate text-[14.5px] font-semibold`,children:a.name}),(0,O.jsx)(`p`,{className:`text-[12px] text-ink-3`,children:r(`consent.returnsTo.${V.kind}`,{name:V.name})})]})]}),(0,O.jsx)(`p`,{className:`mt-3 flex gap-2 text-[12.5px] leading-relaxed text-ink-2`,children:a.publishedBy?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(h,{className:`mt-0.5 size-4 shrink-0 text-ok`}),` `,r(`consent.publishedBy`,{publisher:a.publishedBy})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(g,{className:`mt-0.5 size-4 shrink-0 text-warn`}),` `,r(`consent.unverified`)]})}),V.local&&(0,O.jsxs)(`p`,{className:`mt-2 flex gap-2 text-[12.5px] leading-relaxed text-ink-2`,children:[(0,O.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-warn`}),` `,r(`consent.local`)]})]}),(0,O.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,O.jsx)(`span`,{className:`text-[13px] font-medium text-ink-2`,children:r(`consent.workspace`)}),(0,O.jsx)(`select`,{value:j,onChange:e=>N(e.target.value),className:`field`,children:n.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),W.length>0&&(0,O.jsxs)(`section`,{className:`rounded-[14px] border border-line bg-sunken p-4 text-[13px] leading-relaxed`,children:[(0,O.jsx)(`p`,{className:`text-ink-2`,children:G?r(`consent.existing`,{name:a.name,when:d(G)}):r(`consent.existingUnused`,{name:a.name})}),(0,O.jsxs)(`label`,{className:`mt-3 flex cursor-pointer items-start gap-2.5`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>U(e.target.checked),className:`mt-0.5 size-4 shrink-0 accent-[var(--accent)]`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`span`,{className:`block font-medium text-ink`,children:r(`consent.replace`)}),(0,O.jsx)(`span`,{className:`block text-[12.5px] text-ink-3`,children:r(`consent.replaceHint`,{name:a.name})})]})]})]}),(0,O.jsx)(C,{tasks:c,docs:_,organize:y,onTasks:f,onDocs:v,onOrganize:T}),B.length===0&&(0,O.jsx)(`p`,{className:`text-[12.5px] text-danger`,children:r(`agents:access.atLeastOne`)}),I&&(0,O.jsx)(`p`,{role:`alert`,className:`rounded-[10px] bg-danger-soft px-3 py-2.5 text-[13px] text-danger`,children:I}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,O.jsx)(x,{variant:`ghost`,loading:P===`deny`,disabled:P!==null,onClick:()=>void K(!1),children:r(`common:actions.cancel`)}),(0,O.jsx)(x,{variant:`agent`,icon:(0,O.jsx)(E,{}),loading:P===`allow`,disabled:P!==null||B.length===0||!j,onClick:()=>void K(!0),children:r(`consent.allow`)})]}),(0,O.jsx)(`p`,{className:`text-[12px] text-ink-3`,children:r(`consent.revokeLater`)})]})})}export{A as ConsentPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Et as t,Gt as n,N as r,Ot as i,Xt as a,bt as o,en as s,in as c,nt as l,ot as u,p as d,rn as f,yt as p}from"./format-Dk1nO38Z.js";import{t as m}from"./triangle-exclamation-point-BTUlFMkc.js";import{n as h,t as g}from"./shield-exclamation-point-sqW5yuTY.js";import{a as _,i as v,t as y}from"./States-D9T0E3QG.js";import{t as b}from"./Avatar-B1img0gb.js";import{t as x}from"./Button-CHkkj3LG.js";import{n as S}from"./theme-BfxBDblB.js";import{t as C}from"./AccessRows-BukzKFuJ.js";import{t as w}from"./destination-CEcYXsDA.js";var T={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};T.node;var E=t(T),D=e(c(),1),O=f();function k({title:e,subtitle:t,children:n}){return(0,O.jsxs)(`main`,{className:`flex min-h-dvh flex-col items-center justify-center bg-sheet px-6 py-12 sm:px-10`,children:[(0,O.jsxs)(`div`,{className:`mb-10 flex items-center gap-2.5`,children:[(0,O.jsx)(v,{size:30}),(0,O.jsx)(_,{})]}),(0,O.jsxs)(`div`,{className:`animate-rise w-full max-w-[460px]`,children:[(0,O.jsx)(`h1`,{className:`font-display text-[30px] leading-tight font-medium tracking-[-0.02em]`,children:e}),t&&(0,O.jsx)(`p`,{className:`mt-2 text-[14px] leading-relaxed text-ink-2`,children:t}),(0,O.jsx)(`div`,{className:`mt-8`,children:n})]})]})}function A(){let{t:e}=i(`oauth`),t=r(),o=a(),c=(0,D.useMemo)(()=>Object.fromEntries(new URLSearchParams(o.search)),[o.search]),d=s({queryKey:[`oauth-request`,o.search],queryFn:()=>u(`/oauth/request`,{params:c}),enabled:!!t.data?.user,retry:!1,staleTime:1/0});if(t.isPending)return(0,O.jsx)(y,{});if(t.isError||!t.data?.user)return(0,O.jsx)(n,{to:`/login?next=${encodeURIComponent(o.pathname+o.search)}`,replace:!0});if(d.isPending)return(0,O.jsx)(y,{});if(d.isError)return(0,O.jsx)(j,{message:l(d.error)});let f=d.data;return f.kind===`problem`?(0,O.jsx)(j,{message:e(`problems.${f.problem}`),detail:f.detail}):f.kind===`redirect`?(0,O.jsx)(M,{to:f.redirect}):(0,O.jsx)(N,{params:c,request:f,workspaces:t.data.workspaces})}function j({message:e,detail:t}){let{t:n}=i(`oauth`);return(0,O.jsxs)(k,{title:n(`problem.title`),children:[(0,O.jsx)(`p`,{role:`alert`,className:`rounded-[12px] bg-danger-soft px-3.5 py-3 text-[13.5px] leading-relaxed text-danger`,children:e}),t&&(0,O.jsx)(`p`,{className:`mt-3 font-mono text-[11.5px] break-words text-ink-3`,children:t}),(0,O.jsx)(`a`,{href:`/`,className:`mt-6 inline-flex text-[13.5px] font-medium text-accent hover:underline`,children:n(`problem.home`)})]})}function M({to:e}){let{t}=i(`oauth`),n=w(e);return(0,D.useEffect)(()=>window.location.assign(e),[e]),(0,O.jsx)(k,{title:t(`leaving.title`),subtitle:t(`leaving.subtitle.${n.kind}`,{name:n.name}),children:(0,O.jsx)(`span`,{})})}function N({params:e,request:t,workspaces:n}){let{t:r}=i([`oauth`,`agents`,`common`]),{client:a}=t,s=t.scopes.length>0,[c,f]=(0,D.useState)(s?p(t.scopes,`tasks`):`write`),[_,v]=(0,D.useState)(s?p(t.scopes,`docs`):`read`),[y,T]=(0,D.useState)(!s||t.scopes.includes(`organize`)),A=S(`workspace`,null),[j,N]=(0,D.useState)(n.find(e=>e.id===A)?.id??n[0]?.id??``),[P,F]=(0,D.useState)(null),[I,L]=(0,D.useState)(null),[R,z]=(0,D.useState)(null),B=o({tasks:c,docs:_,organize:y}),V=w(a.redirectUri),[H,U]=(0,D.useState)(!0),W=t.existing.filter(e=>e.workspaceId===j),G=W.map(e=>e.lastUsedAt).filter(e=>e!==null).sort().at(-1);async function K(t){F(t?`allow`:`deny`),L(null);try{let{redirect:n}=await u(`/oauth/decision`,{params:e,allow:t,workspaceId:j,scopes:B,replace:W.length>0&&H});z(n)}catch(e){L(l(e)),F(null)}}return R?(0,O.jsx)(M,{to:R}):(0,O.jsx)(k,{title:r(`consent.title`,{name:a.name}),subtitle:r(`consent.subtitle`),children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,O.jsxs)(`section`,{"aria-label":r(`consent.app`),className:`rounded-[14px] border border-line bg-surface p-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(b,{name:a.name,kind:`agent`,size:36}),(0,O.jsxs)(`div`,{className:`min-w-0`,children:[(0,O.jsx)(`p`,{className:`truncate text-[14.5px] font-semibold`,children:a.name}),(0,O.jsx)(`p`,{className:`text-[12px] text-ink-3`,children:r(`consent.returnsTo.${V.kind}`,{name:V.name})})]})]}),(0,O.jsx)(`p`,{className:`mt-3 flex gap-2 text-[12.5px] leading-relaxed text-ink-2`,children:a.publishedBy?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(h,{className:`mt-0.5 size-4 shrink-0 text-ok`}),` `,r(`consent.publishedBy`,{publisher:a.publishedBy})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(g,{className:`mt-0.5 size-4 shrink-0 text-warn`}),` `,r(`consent.unverified`)]})}),V.local&&(0,O.jsxs)(`p`,{className:`mt-2 flex gap-2 text-[12.5px] leading-relaxed text-ink-2`,children:[(0,O.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-warn`}),` `,r(`consent.local`)]})]}),(0,O.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,O.jsx)(`span`,{className:`text-[13px] font-medium text-ink-2`,children:r(`consent.workspace`)}),(0,O.jsx)(`select`,{value:j,onChange:e=>N(e.target.value),className:`field`,children:n.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),W.length>0&&(0,O.jsxs)(`section`,{className:`rounded-[14px] border border-line bg-sunken p-4 text-[13px] leading-relaxed`,children:[(0,O.jsx)(`p`,{className:`text-ink-2`,children:G?r(`consent.existing`,{name:a.name,when:d(G)}):r(`consent.existingUnused`,{name:a.name})}),(0,O.jsxs)(`label`,{className:`mt-3 flex cursor-pointer items-start gap-2.5`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>U(e.target.checked),className:`mt-0.5 size-4 shrink-0 accent-[var(--accent)]`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`span`,{className:`block font-medium text-ink`,children:r(`consent.replace`)}),(0,O.jsx)(`span`,{className:`block text-[12.5px] text-ink-3`,children:r(`consent.replaceHint`,{name:a.name})})]})]})]}),(0,O.jsx)(C,{tasks:c,docs:_,organize:y,onTasks:f,onDocs:v,onOrganize:T}),B.length===0&&(0,O.jsx)(`p`,{className:`text-[12.5px] text-danger`,children:r(`agents:access.atLeastOne`)}),I&&(0,O.jsx)(`p`,{role:`alert`,className:`rounded-[10px] bg-danger-soft px-3 py-2.5 text-[13px] text-danger`,children:I}),(0,O.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,O.jsx)(x,{variant:`ghost`,loading:P===`deny`,disabled:P!==null,onClick:()=>void K(!1),children:r(`common:actions.cancel`)}),(0,O.jsx)(x,{variant:`agent`,icon:(0,O.jsx)(E,{}),loading:P===`allow`,disabled:P!==null||B.length===0||!j,onClick:()=>void K(!0),children:r(`consent.allow`)})]}),(0,O.jsx)(`p`,{className:`text-[12px] text-ink-3`,children:r(`consent.revokeLater`)})]})})}export{A as ConsentPage};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./check-a7phVGDi.js";import{Dt as n,Et as r,Ht as i,Ot as a,in as o,rn as s}from"./format-BVq_UI0J.js";import{n as c}from"./dist-BsPSSv6i.js";var l={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};l.node;var u=r(l),d=e(o(),1),f=null,p,m=null,h=!1,g=()=>{f&&(f.leftPage=!0)};function _(e){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){let{selectionStart:t,selectionEnd:n,value:r}=e;return t===null||n===null?void 0:r.slice(t,n)}return document.getSelection()?.toString()||void 0}var v=e=>{if(!f)return;let t=_(e.target);t===void 0?f.leftPage=!0:t!==f.value&&E()},y=()=>{f?.due&&w()};function b(e){let t=e?`addEventListener`:`removeEventListener`;window[t](`blur`,g),window[t](`focus`,y),document[t](`visibilitychange`,y),document[t](`copy`,v,!0),document[t](`cut`,v,!0)}function x(){clearTimeout(p),f&&b(!1),f=null,m=null}async function S(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}async function C(){try{return(await navigator.permissions?.query({name:`clipboard-read`}))?.state===`granted`?await navigator.clipboard.readText():void 0}catch{return}}async function w(){let e=f;if(!e||h||document.visibilityState!==`visible`||!document.hasFocus())return;h=!0;let t=()=>{f===e&&x()};try{if(!e.leftPage&&await S(``))return t();if(f!==e)return;let n=await C();if(f!==e)return;if(n!==void 0&&(n!==e.value||await S(``)))return t();let r=m;x(),r?.()}finally{h=!1,f&&f!==e&&f.due&&w()}}function T(e,t,n){x(),f={value:e,leftPage:!document.hasFocus(),due:!1},m=n,b(!0),p=setTimeout(()=>{f&&(f.due=!0,w())},t)}function E(){x()}function D(){return x(),S(``)}var O=s();async function k(e,t={}){try{await navigator.clipboard.writeText(e)}catch{return c.error(i(`copyFailed`)),!1}return t.clearAfterMs?T(e,t.clearAfterMs,A):E(),t.message&&c.success(t.message),!0}function A(){c(i(`clipboard.stillThere`),{duration:6e4,action:{label:i(`clipboard.clear`),onClick:async()=>{await D()?c.success(i(`clipboard.cleared`)):c.error(i(`clipboard.clearFailed`))}}})}function j({value:e,label:r,className:i,clearAfterMs:o,message:s}){let{t:c}=a(),l=r??c(`actions.copy`),[f,p]=(0,d.useState)(!1);return(0,O.jsx)(`button`,{type:`button`,"aria-label":l,title:l,onClick:async t=>{t.stopPropagation(),await k(e,{clearAfterMs:o,message:s})&&(p(!0),setTimeout(()=>p(!1),1400))},className:n(`grid size-7 shrink-0 place-items-center rounded-[8px] text-ink-3 transition-colors hover:bg-hover hover:text-ink`,i),children:(0,O.jsxs)(`span`,{className:`relative size-[15px]`,children:[(0,O.jsx)(u,{className:n(`absolute inset-0 size-[15px] transition-all duration-200`,f?`scale-50 opacity-0`:`scale-100 opacity-100`)}),(0,O.jsx)(t,{className:n(`absolute inset-0 size-[15px] text-ok transition-all duration-200`,f?`scale-100 opacity-100`:`scale-50 opacity-0`)})]})})}export{k as n,u as r,j as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./check-A2t_TRNF.js";import{Dt as n,Et as r,Ht as i,Ot as a,in as o,rn as s}from"./format-Dk1nO38Z.js";import{n as c}from"./dist-DFO0RDUp.js";var l={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};l.node;var u=r(l),d=e(o(),1),f=null,p,m=null,h=!1,g=()=>{f&&(f.leftPage=!0)};function _(e){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){let{selectionStart:t,selectionEnd:n,value:r}=e;return t===null||n===null?void 0:r.slice(t,n)}return document.getSelection()?.toString()||void 0}var v=e=>{if(!f)return;let t=_(e.target);t===void 0?f.leftPage=!0:t!==f.value&&E()},y=()=>{f?.due&&w()};function b(e){let t=e?`addEventListener`:`removeEventListener`;window[t](`blur`,g),window[t](`focus`,y),document[t](`visibilitychange`,y),document[t](`copy`,v,!0),document[t](`cut`,v,!0)}function x(){clearTimeout(p),f&&b(!1),f=null,m=null}async function S(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}async function C(){try{return(await navigator.permissions?.query({name:`clipboard-read`}))?.state===`granted`?await navigator.clipboard.readText():void 0}catch{return}}async function w(){let e=f;if(!e||h||document.visibilityState!==`visible`||!document.hasFocus())return;h=!0;let t=()=>{f===e&&x()};try{if(!e.leftPage&&await S(``))return t();if(f!==e)return;let n=await C();if(f!==e)return;if(n!==void 0&&(n!==e.value||await S(``)))return t();let r=m;x(),r?.()}finally{h=!1,f&&f!==e&&f.due&&w()}}function T(e,t,n){x(),f={value:e,leftPage:!document.hasFocus(),due:!1},m=n,b(!0),p=setTimeout(()=>{f&&(f.due=!0,w())},t)}function E(){x()}function D(){return x(),S(``)}var O=s();async function k(e,t={}){try{await navigator.clipboard.writeText(e)}catch{return c.error(i(`copyFailed`)),!1}return t.clearAfterMs?T(e,t.clearAfterMs,A):E(),t.message&&c.success(t.message),!0}function A(){c(i(`clipboard.stillThere`),{duration:6e4,action:{label:i(`clipboard.clear`),onClick:async()=>{await D()?c.success(i(`clipboard.cleared`)):c.error(i(`clipboard.clearFailed`))}}})}function j({value:e,label:r,className:i,clearAfterMs:o,message:s}){let{t:c}=a(),l=r??c(`actions.copy`),[f,p]=(0,d.useState)(!1);return(0,O.jsx)(`button`,{type:`button`,"aria-label":l,title:l,onClick:async t=>{t.stopPropagation(),await k(e,{clearAfterMs:o,message:s})&&(p(!0),setTimeout(()=>p(!1),1400))},className:n(`grid size-7 shrink-0 place-items-center rounded-[8px] text-ink-3 transition-colors hover:bg-hover hover:text-ink`,i),children:(0,O.jsxs)(`span`,{className:`relative size-[15px]`,children:[(0,O.jsx)(u,{className:n(`absolute inset-0 size-[15px] transition-all duration-200`,f?`scale-50 opacity-0`:`scale-100 opacity-100`)}),(0,O.jsx)(t,{className:n(`absolute inset-0 size-[15px] text-ok transition-all duration-200`,f?`scale-100 opacity-100`:`scale-50 opacity-0`)})]})})}export{k as n,u as r,j as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,Dt as n,Et as r,F as i,Ot as a,Qt as o,S as s,Ut as ee,Xt as c,Yt as l,Zt as u,at as d,ht as f,in as p,nt as m,ot as h,p as g,rn as te,rt as _,s as ne,x as v}from"./format-Dk1nO38Z.js";import{a as re,i as ie,n as ae,o as oe,r as se,s as ce,t as le}from"./markdown-html-Bbis0Fwx.js";import{n as ue}from"./Avatar-B1img0gb.js";import{t as de}from"./download-CRdduKx2.js";import{Z as fe,c as pe,g as me,n as y,o as he,s as ge,t as _e,u as ve}from"./Menu-CzgZwzmu.js";import{n as ye,t as be}from"./square-kanban-Cd_tPOtx.js";import{t as xe}from"./file-plus-B9m4uZcE.js";import{t as Se}from"./paperclip-BnASHXPW.js";import{t as Ce}from"./trash-CkQBpprn.js";import{t as we}from"./triangle-exclamation-point-BTUlFMkc.js";import{t as b}from"./Trans-CA0OvHif.js";import{a as x,i as Te,n as S,s as Ee}from"./dist-DFO0RDUp.js";import{n as De,r as Oe,t as ke}from"./Phrases-C89QdC4L.js";import{t as C}from"./Button-CHkkj3LG.js";import{i as Ae,o as je,r as Me}from"./realtime-Dn6o1BHn.js";import{n as Ne}from"./CardItem-BAkxFtTs.js";import{t as Pe}from"./PageHeader-DJdrnGpr.js";import{t as Fe}from"./actions-TwDLbdln.js";import{n as Ie,r as w}from"./States-D9T0E3QG.js";import{t as T}from"./Popover-BVPB22vZ.js";import{t as E}from"./folder-open-DCuG03EB.js";import{t as Le}from"./download-CHH-5Z1W.js";import{t as Re}from"./restore-CAzTqClb.js";var D={name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]};D.node;var ze=r(D),O={name:`face-slightly-smiling-plus`,size:24,node:[[`path`,{d:`M13.267 2.08a10 10 0 108.653 8.653`,key:`1wbpyh`}],[`path`,{d:`M15 10V9`,key:`4dkmfx`}],[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M16.472 15a6 6 0 01-8.943 0`,key:`7qomzy`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M9 10V9`,key:`1lazqi`}]],aliases:[`smile-plus`]};O.node;var k=r(O),A={name:`folder-input`,size:24,node:[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]};A.node;var Be=r(A),j={name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]};j.node;var Ve=r(j),He=e(fe(),1),M=e(p(),1),N=te(),Ue=`📄.📝.📌.📎.📚.📖.🧭.🎯.🚀.💡.🧪.🛠️.⚙️.🔒.🔑.🗂️.📁.📊.📈.🗓️.✅.❗.❓.💬.🧩.🏁.🌱.🔥.⭐.🎨.🧠.🤖.📦.🧾.🏷️.🔗.🌍.🏠.💼.📣.🛡️.⏱️.🎉.🧑‍💻.🗺️.📐.🔍.✍️`.split(`.`);function We({value:e,onChange:t}){let{t:n}=a(`docs`),[r,i]=(0,M.useState)(!1);return(0,N.jsxs)(T,{open:r,onOpenChange:i,className:`w-[296px] p-2`,trigger:e?(0,N.jsx)(`button`,{type:`button`,"aria-label":n(`icon.change`),className:`grid size-14 place-items-center rounded-[14px] text-[40px] leading-none transition-colors hover:bg-hover`,children:e}):(0,N.jsxs)(`button`,{type:`button`,className:`flex h-7 items-center gap-1.5 rounded-[8px] px-2 text-[12.5px] text-ink-3 opacity-0 transition-opacity group-hover/title:opacity-100 hover:bg-hover hover:text-ink focus-visible:opacity-100 data-[state=open]:opacity-100`,children:[(0,N.jsx)(k,{className:`size-4`}),n(`icon.add`)]}),children:[(0,N.jsx)(`div`,{className:`grid grid-cols-8 gap-0.5`,children:Ue.map(e=>(0,N.jsx)(`button`,{type:`button`,onClick:()=>{t(e),i(!1)},"aria-label":n(`icon.use`,{icon:e}),className:`grid size-8 place-items-center rounded-[8px] text-[19px] hover:bg-hover`,children:e},e))}),e&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>{t(null),i(!1)},className:`mt-2 w-full rounded-[8px] py-1.5 text-[12.5px] font-medium text-ink-3 hover:bg-hover hover:text-ink`,children:n(`icon.remove`)})]})}function Ge({open:e,onOpenChange:t,pageId:r,projectName:i,pages:o,workspaceId:ee}){let{t:c}=a(`docs`),l=new Set([r]),u=!0;for(;u;){u=!1;for(let e of o)e.parentId&&l.has(e.parentId)&&!l.has(e.id)&&(l.add(e.id),u=!0)}let d=o.find(e=>e.id===r),f=[],p=(e,t)=>{for(let n of o.filter(t=>t.parentId===e))l.has(n.id)||(f.push({page:n,depth:t}),p(n.id,t+1))};p(null,0);async function g(e){try{await h(`/pages/${r}/move`,{parentId:e,index:1e5}),await Promise.all([s.invalidateQueries({queryKey:v.overview(ee)}),s.invalidateQueries({queryKey:v.page(r)})]),t(!1),S.success(c(`move.moved`))}catch(e){S.error(m(e))}}return(0,N.jsx)(x,{open:e,onOpenChange:t,title:c(`move.title`),description:c(`move.description`),children:(0,N.jsxs)(`div`,{className:`flex max-h-[50vh] flex-col gap-0.5 overflow-y-auto`,children:[(0,N.jsxs)(`button`,{type:`button`,disabled:d?.parentId===null,onClick:()=>void g(null),className:`flex items-center gap-2.5 rounded-[9px] px-2.5 py-2 text-left text-[13.5px] hover:bg-hover disabled:opacity-40`,children:[(0,N.jsx)(E,{className:`size-4 text-ink-3`}),(0,N.jsx)(`span`,{className:`font-medium`,children:i}),(0,N.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:c(`move.root`)})]}),f.map(({page:e,depth:t})=>(0,N.jsxs)(`button`,{type:`button`,disabled:d?.parentId===e.id,onClick:()=>void g(e.id),style:{paddingLeft:10+t*18},className:n(`flex items-center gap-2.5 rounded-[9px] py-2 pr-2.5 text-left text-[13.5px] hover:bg-hover disabled:opacity-40`),children:[t>0?(0,N.jsx)(ze,{className:`size-3.5 text-ink-4`}):null,(0,N.jsx)(`span`,{className:`w-4 text-center text-[13px]`,children:e.icon??(0,N.jsx)(ye,{className:`size-4 text-ink-3`})}),(0,N.jsx)(`span`,{className:`truncate`,children:e.title||c(`untitled`,{ns:`common`})})]},e.id))]})})}var Ke=(e,t)=>Le(`/api/pages/${e}/download${t?`?subpages=1`:``}`);function qe({open:e,title:t,onOpenChange:n,onChoose:r}){let{t:i}=a(`docs`);return(0,N.jsx)(x,{open:e,onOpenChange:n,title:i(`page.downloadAsk.title`,{title:t}),description:i(`page.downloadAsk.description`),footer:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(C,{variant:`ghost`,onClick:()=>r(!1),children:i(`page.downloadAsk.only`)}),(0,N.jsx)(C,{variant:`primary`,onClick:()=>r(!0),children:i(`page.downloadAsk.withSubpages`)})]}),children:(0,N.jsx)(`span`,{})})}async function Je(e,t=3e3){let n=[...e?.querySelectorAll(`img`)??[]];await Promise.race([Promise.all(n.map(e=>e.decode().catch(()=>{}))),new Promise(e=>setTimeout(e,t))])}function Ye({title:e,icon:t,markdown:n}){let r=(0,M.useMemo)(()=>le(n),[n]),i=(0,M.useRef)(null);return(0,M.useLayoutEffect)(()=>(document.documentElement.classList.add(`orq-printing`),()=>document.documentElement.classList.remove(`orq-printing`)),[]),(0,M.useLayoutEffect)(()=>{for(let e of i.current?.querySelectorAll(`a[href]`)??[]){let t=e.getAttribute(`href`)??``;if(t.startsWith(`#`))continue;let n;try{n=new URL(t,window.location.href).href}catch{continue}let r=e.textContent?.trim()??``;r!==n&&r!==t&&`mailto:${r}`!==t&&e.setAttribute(`data-address`,n.replace(/^mailto:/,``))}},[r]),(0,He.createPortal)((0,N.jsx)(`div`,{className:`orq-print-root`,children:(0,N.jsxs)(`article`,{className:`orq-print`,children:[(0,N.jsxs)(`h1`,{className:`orq-print-title`,children:[t?`${t} `:``,(0,N.jsx)(ke,{text:e})]}),(0,N.jsx)(`div`,{ref:i,className:`orq-prose`,dangerouslySetInnerHTML:{__html:r}})]})}),document.body)}var Xe=`font-display text-[40px] leading-[1.1] font-medium tracking-[-0.025em] sm:text-[44px]`,Ze=e=>e instanceof t&&e.status===404,Qe=e=>!(e instanceof t)||e.status===0||e.status>=500||e.status===408||e.status===429,$e=e=>Math.min(3e4,1e3*2**(e-1));function P(){let{pageId:e=``}=o(),t=i(e);return t.data?(0,N.jsx)(F,{page:t.data,missing:t.isError&&Ze(t.error),readAt:t.dataUpdatedAt},t.data.id):t.isError?(0,N.jsx)(Ie,{}):(0,N.jsx)(w,{})}function F({page:e,missing:r,readAt:i}){let{t:o}=a(`docs`),{workspaceId:p,me:h,overview:te}=ve(),le=u(),fe=Te(),x=c(),ke=Fe(p),Ie=je(e.id),[w,T]=(0,M.useState)(e.title),[E,Le]=(0,M.useState)(e.icon),[D,O]=(0,M.useState)(`idle`),[k,A]=(0,M.useState)(null),[j,Ue]=(0,M.useState)(null),[P,F]=(0,M.useState)(null),[tt,nt]=(0,M.useState)(!1),[rt,it]=(0,M.useState)(!1),I=Oe(w,Xe),[at,ot]=(0,M.useState)(!1),[st,ct]=(0,M.useState)(null),L=(0,M.useRef)(null),R=(0,M.useRef)(e.version),z=(0,M.useRef)(e.content),B=(0,M.useRef)(!1),V=(0,M.useRef)(!1),H=(0,M.useRef)(void 0),lt=(0,M.useRef)(void 0),U=(0,M.useRef)(!1),W=(0,M.useRef)(null),G=(0,M.useRef)(null),ut=(0,M.useRef)(null),K=(0,M.useRef)(!1);K.current=k!==null;let q=(0,M.useRef)(null),J=(0,M.useRef)(!1),Y=(0,M.useRef)(0),dt=(0,M.useRef)(!1),X=(0,M.useRef)(()=>{}),ft=(0,M.useRef)(oe(e.content).cards.sort().join(`,`));(0,M.useEffect)(()=>De(ut.current),[w]),(0,M.useEffect)(()=>{x.state?.focusTitle&&ut.current?.focus()},[x.state]),(0,M.useEffect)(()=>{U.current||T(e.title),Le(e.icon)},[e.title,e.icon]),(0,M.useEffect)(()=>{let e=()=>(0,He.flushSync)(()=>ct(z.current)),t=()=>ct(null);return window.addEventListener(`beforeprint`,e),window.addEventListener(`afterprint`,t),()=>{window.removeEventListener(`beforeprint`,e),window.removeEventListener(`afterprint`,t)}},[]);let Z=(0,M.useCallback)(e=>{q.current=e,Ue(e)},[]),Q=(0,M.useCallback)(async()=>{if(V.current||K.current||J.current||!B.current)return;clearTimeout(H.current);let n=z.current,r=f(n);if(r>2e5){Z({kind:`too_long`,length:r}),O(`error`);return}V.current=!0,O(`saving`);let i=null;try{let t=await d(`/pages/${e.id}`,{content:n,baseVersion:R.current});R.current=t.version,z.current===n&&(B.current=!1),Y.current=0,Z(null),O(B.current?`pending`:`saved`);let r=oe(n).cards.sort().join(`,`);r!==ft.current&&(ft.current=r,s.invalidateQueries({queryKey:v.page(e.id)}))}catch(e){O(`error`),e instanceof t&&e.status===409?(K.current=!0,A({by:null})):Ze(e)?X.current(null):Qe(e)?(Y.current+=1,i=$e(Y.current),Z({kind:`retrying`,reason:m(e)})):Z({kind:`refused`,reason:m(e)})}finally{V.current=!1,B.current&&!K.current&&!J.current&&(i===null?q.current||(H.current=setTimeout(()=>void Q(),400)):H.current=setTimeout(()=>void Q(),i))}},[e.id,Z]),pt=(0,M.useCallback)(()=>{Y.current=0,Q()},[Q]);(0,M.useEffect)(()=>{let e=()=>q.current?.kind===`retrying`&&pt();return window.addEventListener(`online`,e),()=>window.removeEventListener(`online`,e)},[pt]),X.current=t=>{J.current||dt.current||(J.current=!0,clearTimeout(H.current),Z(null),A(null),F({by:t,entry:null}),_(`/workspaces/${p}/trash/${encodeURIComponent(`page:${e.id}`)}`).then(e=>{if(!e)return;let{node:t,ancestors:n}=e,r=n.find(e=>e.trashId===t.trashId);J.current&&F({by:t.deletedBy,entry:{key:t.key,holder:r?r.title:null}})}).catch(()=>{}))};let mt=(0,M.useCallback)(()=>{J.current&&(J.current=!1,F(null),B.current&&Q())},[Q]),$=(0,M.useCallback)(async()=>{try{let t=await _(`/pages/${e.id}`);return s.setQueryData(v.page(e.id),t),mt(),!0}catch{return!1}},[e.id,mt]),ht=Re(p,{onRestored:()=>{$().then(e=>{e&&L.current?.commands.focus()})}});(0,M.useEffect)(()=>{r?X.current(null):J.current&&$()},[r,i,$]);let gt=()=>B.current&&(J.current||K.current||q.current!==null),_t=l(({currentLocation:e,nextLocation:t})=>e.pathname!==t.pathname&&gt());(0,M.useEffect)(()=>{_t.state===`blocked`&&fe({title:o(`page.leave.title`),description:o(`page.leave.body`),confirmLabel:o(`page.leave.confirm`),danger:!0}).then(e=>e?_t.proceed():_t.reset())},[_t,fe,o]),(0,M.useEffect)(()=>{let t=e=>{B.current&&e.preventDefault()};return window.addEventListener(`beforeunload`,t),()=>{window.removeEventListener(`beforeunload`,t),clearTimeout(H.current),B.current&&!K.current&&!J.current&&f(z.current)<=2e5&&d(`/pages/${e.id}`,{content:z.current,baseVersion:R.current}).catch(()=>{})}},[e.id]);let vt=(0,M.useCallback)(e=>(Ze(e)?X.current(null):S.error(m(e)),null),[]),yt=(0,M.useCallback)(async t=>{let n=await _(`/pages/${e.id}`).catch(vt);if(!n)return;R.current=n.version,z.current=n.content,B.current=!1;let r=L.current;if(r){r.commands.setContent(n.content,{contentType:`markdown`,emitUpdate:!1});let{doc:e,plugins:t,selection:i}=r.state;r.view.updateState(ie.create({doc:e,plugins:t,selection:i}))}s.setQueryData(v.page(e.id),n),U.current||T(n.title),A(null),Z(null),O(`idle`),t&&S(o(`page.agentUpdated`,{name:t}),{icon:(0,N.jsx)(ue,{className:`size-4 text-agent`}),duration:2500})},[e.id,o,Z,vt]),bt=(0,M.useCallback)(t=>t.action===`page.deleted`&&(t.pageId===e.id||e.breadcrumbs.some(e=>e.id===t.pageId))||t.action===`project.deleted`&&t.projectId===e.projectId,[e.id,e.breadcrumbs,e.projectId]);(0,M.useEffect)(()=>Me(t=>{if(J.current){t.action===`trash.restored`&&$();return}if(bt(t))return X.current(t.actor);if(t.structure&&(t.pageId===e.id||t.projectId===e.projectId)&&Ae(v.page(e.id)),t.pageId!==e.id)return;if(t.version===void 0){s.invalidateQueries({queryKey:v.page(e.id)});return}if(t.version<=R.current)return;let n=t.actor.kind===`user`&&t.actor.id===h.user.id;n&&V.current||(B.current?A({by:n?null:t.actor.name}):yt(t.actor.kind===`agent`?t.actor.name:void 0))}),[e.id,e.projectId,h.user.id,yt,$,bt]);async function xt(){let t=await _(`/pages/${e.id}`).catch(vt);t&&(R.current=t.version,A(null),K.current=!1,B.current=!0,await Q())}function St(t){t.title!==void 0&&W.current===t.title&&(W.current=null);let n=d(`/pages/${e.id}`,t).then(async e=>(R.current=Math.max(R.current,e.version),await s.invalidateQueries({queryKey:v.overview(p)}),!0)).catch(e=>(vt(e),t.title!==void 0&&G.current===n&&(W.current??=t.title),!1));return t.title!==void 0&&(G.current=n),n}let Ct=te?.projects.find(t=>t.id===e.projectId)?.pages??[];async function wt(){if(W.current!==null&&(clearTimeout(lt.current),St({title:W.current})),G.current&&!await G.current)return!1;let e=!1;for(let t=0;t<200&&(B.current||V.current)&&!(K.current||J.current||e&&q.current);t++)V.current?await new Promise(e=>setTimeout(e,50)):(e=!0,await Q());return!B.current}async function Tt(t){if(J.current)S.error(o(`page.gone.unknown`));else if(!await wt())S.error(o(`page.downloadUnsaved`));else{if(t===void 0&&Ct.some(t=>t.parentId===e.id))return ot(!0);await Ke(e.id,!!t)}}async function Et(){(0,He.flushSync)(()=>ct(z.current));let e=document.querySelector(`.orq-print-root`);[...e?.querySelectorAll(`img`)??[]].every(e=>e.complete)||await Je(e),window.print()}let Dt=D===`idle`?``:o(`page.status.${D}`);return(0,N.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,N.jsx)(Pe,{crumbs:[{label:e.project.name,to:`/w/${p}/p/${e.project.id}`},...e.breadcrumbs.map(e=>({label:`${e.icon?`${e.icon} `:``}${e.title||o(`untitled`,{ns:`common`})}`,to:`/w/${p}/d/${e.id}`})),{label:`${E?`${E} `:``}${w||o(`untitled`,{ns:`common`})}`}],actions:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{className:n(`mr-2 text-[12px] max-sm:hidden`,D===`error`?`text-danger`:`text-ink-3`),"aria-live":`polite`,children:Dt}),(0,N.jsxs)(he,{children:[(0,N.jsx)(pe,{asChild:!0,children:(0,N.jsx)(C,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:(0,N.jsx)(me,{}),"aria-label":o(`page.actions`)})}),(0,N.jsxs)(_e,{children:[(0,N.jsx)(y,{icon:(0,N.jsx)(xe,{}),onSelect:()=>void ke.createPage(e.projectId,e.id),children:o(`page.newSubpage`)}),(0,N.jsx)(y,{icon:(0,N.jsx)(Be,{}),onSelect:()=>nt(!0),children:o(`page.move`)}),(0,N.jsx)(y,{icon:(0,N.jsx)(ce,{}),onSelect:()=>it(!0),children:o(`page.history`)}),(0,N.jsx)(ge,{}),(0,N.jsx)(y,{icon:(0,N.jsx)(de,{}),onSelect:()=>void Tt(),children:o(`page.download`)}),(0,N.jsx)(y,{icon:(0,N.jsx)(Ve,{}),onSelect:()=>void Et(),children:o(`page.print`)}),(0,N.jsx)(ge,{}),(0,N.jsx)(y,{icon:(0,N.jsx)(Ce,{}),danger:!0,onSelect:async()=>{let t=B.current;dt.current=!0,B.current=!1;let n=!1;try{n=await ke.deletePage({id:e.id,title:w})}catch(e){S.error(m(e))}if(n)return le(e.parentId?`/w/${p}/d/${e.parentId}`:`/w/${p}/p/${e.projectId}`);dt.current=!1,B.current=t,t&&Q()},children:o(`page.delete`)})]})]})]})}),(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,N.jsxs)(`article`,{className:`mx-auto w-full max-w-[780px] px-6 pt-12 sm:px-12 sm:pt-16`,children:[(0,N.jsxs)(`div`,{className:`group/title`,children:[(0,N.jsx)(We,{value:E,onChange:e=>{Le(e),St({icon:e})}}),(0,N.jsxs)(`div`,{className:`mt-2 grid`,children:[(0,N.jsx)(`textarea`,{ref:ut,value:w,rows:1,maxLength:200,placeholder:o(`untitled`,{ns:`common`}),"aria-label":o(`page.titleLabel`),onFocus:()=>{U.current=!0,I.onFocus()},onBlur:()=>{U.current=!1,I.onBlur()},onPointerDown:I.onPointerDown,onClick:I.onClick,onChange:e=>{let t=e.target.value.replace(/\n/g,``);T(t),clearTimeout(lt.current),W.current=t.trim(),lt.current=setTimeout(()=>void St({title:t.trim()}),500)},onKeyDown:e=>{if(!Ee(e)&&(e.key===`Enter`||e.key===`ArrowDown`&&e.currentTarget.selectionStart===w.length)){e.preventDefault();let t=L.current;t&&(t.view.focus(),t.commands.setTextSelection(1))}},className:n(`orq-title block w-full resize-none self-stretch overflow-hidden bg-transparent outline-none placeholder:text-ink-3 [grid-area:1/1]`,Xe,I.hidden&&`opacity-0`)}),I.overlay]})]}),(0,N.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-x-3 gap-y-2 text-[12.5px] text-ink-3`,children:[e.updatedBy&&(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[e.updatedBy.kind===`agent`&&(0,N.jsx)(ue,{className:`size-3.5 text-agent`}),(0,N.jsx)(b,{t:o,i18nKey:`page.editedBy`,values:{name:e.updatedBy.name,time:g(e.updatedAt)},components:{name:(0,N.jsx)(`span`,{className:e.updatedBy.kind===`agent`?`font-medium text-agent`:`font-medium text-ink-2`})}})]}),Ie&&(0,N.jsxs)(`span`,{className:`animate-pop inline-flex items-center gap-1 rounded-full bg-agent-soft px-2 py-0.5 font-medium text-agent`,children:[(0,N.jsx)(`span`,{className:`live-dot size-1.5`}),` `,o(`page.agentWorking`,{name:Ie})]})]}),e.cards.length>0&&(0,N.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-1.5`,"aria-label":o(`page.linkedTasks`),children:e.cards.map(e=>(0,N.jsxs)(ee,{to:`/w/${p}/b/${e.boardId}?card=${e.id}`,className:n(`group inline-flex h-7 max-w-full items-center gap-1.5 rounded-[8px] border border-line bg-surface pr-2 pl-1.5 text-[12.5px] shadow-sm transition-colors hover:border-line-strong`,e.archived&&`opacity-60`),title:`${e.boardName} · ${e.columnName}`,children:[(0,N.jsx)(be,{className:`size-3.5 shrink-0 text-accent`}),(0,N.jsx)(`span`,{className:`truncate font-medium`,children:e.title}),(0,N.jsx)(`span`,{className:`shrink-0 text-ink-3`,children:e.columnName}),e.dueAt&&(0,N.jsx)(Ne,{dueAt:e.dueAt,className:`-mr-1`})]},e.id))}),(0,N.jsxs)(`div`,{className:`sticky top-3 z-20 mt-6 empty:hidden`,children:[k&&(0,N.jsxs)(`div`,{role:`alert`,className:`animate-pop flex flex-wrap items-center gap-3 rounded-[12px] border border-warn/40 bg-[color-mix(in_oklab,var(--warn)_10%,var(--sheet))] px-4 py-3 text-[13px] shadow-md`,children:[(0,N.jsx)(we,{className:`size-4 shrink-0 text-warn`}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1`,children:k.by?(0,N.jsx)(b,{t:o,i18nKey:`page.conflict.byName`,values:{name:k.by},components:{strong:(0,N.jsx)(`strong`,{className:`font-semibold`})}}):(0,N.jsx)(b,{t:o,i18nKey:`page.conflict.byOtherSession`,components:{strong:(0,N.jsx)(`strong`,{className:`font-semibold`})}})}),(0,N.jsx)(C,{size:`sm`,variant:`secondary`,onClick:()=>void yt(),children:o(`page.conflict.loadTheirs`)}),(0,N.jsx)(C,{size:`sm`,variant:`primary`,onClick:()=>void xt(),children:o(`page.conflict.keepMine`)})]}),P&&(0,N.jsxs)(`div`,{role:`alert`,className:`animate-pop flex flex-wrap items-center gap-3 rounded-[12px] border border-danger/30 bg-danger-soft px-4 py-3 text-[13px] shadow-md`,children:[(0,N.jsx)(Ce,{className:`size-4 shrink-0 text-danger`}),(0,N.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(et,{gone:P,selfId:h.user.id}),` `,P.entry?o(`page.gone.inTrash`):``,` `,B.current&&(0,N.jsx)(`strong`,{className:`font-semibold`,children:o(P.entry?`page.gone.unsaved`:`page.gone.unsavedLost`)})]}),P.entry&&(0,N.jsx)(C,{size:`sm`,variant:`primary`,loading:ht.starting!==null,onClick:()=>void ht.start(P.entry.key),children:o(`page.gone.restore`)})]}),j&&!P&&!k&&(0,N.jsxs)(`div`,{role:`alert`,className:`animate-pop flex flex-wrap items-center gap-3 rounded-[12px] border border-warn/40 bg-[color-mix(in_oklab,var(--warn)_10%,var(--sheet))] px-4 py-3 text-[13px] shadow-md`,children:[(0,N.jsx)(we,{className:`size-4 shrink-0 text-warn`}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1`,children:j.kind===`too_long`?o(`page.problem.tooLong`,{length:ne(j.length),max:ne(2e5)}):o(j.kind===`retrying`?`page.problem.retrying`:`page.problem.refused`,{reason:j.reason})}),j.kind!==`too_long`&&(0,N.jsx)(C,{size:`sm`,variant:`secondary`,onClick:pt,children:o(`page.problem.retry`)})]})]}),(0,N.jsx)(`div`,{className:`mt-8`,children:(0,N.jsx)(se,{content:e.content,workspaceId:p,upload:{type:`page`,id:e.id},onUploaded:()=>void s.invalidateQueries({queryKey:v.page(e.id)}),ariaLabel:o(`page.content`),onReady:e=>L.current=e,onChange:e=>{z.current=e,B.current=!0,O(`pending`),q.current?.kind!==`retrying`&&(clearTimeout(H.current),H.current=setTimeout(()=>void Q(),700))}})}),(e.children.length>0||e.attachments.length>0)&&(0,N.jsxs)(`footer`,{className:`relative z-10 -mt-[22vh] mb-24 flex flex-col gap-8 border-t border-line pt-8`,children:[e.children.length>0&&(0,N.jsxs)(`section`,{children:[(0,N.jsx)(`h2`,{className:`mb-3 text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:o(`page.subpages`)}),(0,N.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.children.map(e=>(0,N.jsxs)(ee,{to:`/w/${p}/d/${e.id}`,className:`group flex items-center gap-3 rounded-[12px] border border-line bg-surface px-3 py-2.5 shadow-sm transition-all hover:-translate-y-px hover:border-line-strong hover:shadow-md`,children:[(0,N.jsx)(ze,{className:`size-3.5 text-ink-4`}),(0,N.jsx)(`span`,{className:`text-[15px]`,children:e.icon??(0,N.jsx)(ye,{className:`size-4 text-ink-3`})}),(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13.5px] font-medium`,children:e.title||o(`untitled`,{ns:`common`})}),(0,N.jsx)(`span`,{className:`text-[11.5px] text-ink-3`,children:g(e.updatedAt)})]},e.id))})]}),e.attachments.length>0&&(0,N.jsxs)(`section`,{children:[(0,N.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:[(0,N.jsx)(Se,{className:`size-3.5`}),` `,o(`page.attachments`)]}),(0,N.jsx)(ae,{items:e.attachments,target:{type:`page`,id:e.id},onChanged:()=>void s.invalidateQueries({queryKey:v.page(e.id)})})]})]})]})}),(0,N.jsx)(Ge,{open:tt,onOpenChange:nt,pageId:e.id,projectName:e.project.name,pages:Ct,workspaceId:p}),(0,N.jsx)(qe,{open:at,onOpenChange:ot,title:w.trim()||o(`untitled`,{ns:`common`}),onChoose:e=>{ot(!1),Tt(e)}}),st!==null&&(0,N.jsx)(Ye,{title:w.trim()||o(`untitled`,{ns:`common`}),icon:E,markdown:st}),(0,N.jsx)(re,{open:rt,onOpenChange:it,type:`page`,id:e.id,name:w||o(`untitled`,{ns:`common`})}),ht.dialog]})}function et({gone:e,selfId:t}){let{t:n}=a(`docs`),r={strong:(0,N.jsx)(`strong`,{className:`font-semibold`})},i=e.by;if(!i)return(0,N.jsx)(N.Fragment,{children:n(`page.gone.unknown`)});let o=i.kind===`user`&&i.id===t,s=e.entry?.holder??null;return s===null?(0,N.jsx)(b,{t:n,i18nKey:o?`page.gone.byYou`:`page.gone.byName`,values:{name:i.name},components:r}):(0,N.jsx)(b,{t:n,i18nKey:o?`page.gone.withByYou`:`page.gone.withByName`,values:{name:i.name,title:s},components:r})}export{P as DocPage};
@@ -1 +1 @@
1
- import{rn as e}from"./format-BVq_UI0J.js";var t=e();function n({icon:e,title:n,children:r,action:i}){return(0,t.jsxs)(`div`,{className:`animate-rise mx-auto flex max-w-sm flex-col items-center px-6 py-14 text-center`,children:[e&&(0,t.jsx)(`div`,{className:`mb-5 grid size-14 place-items-center rounded-[16px] border border-line bg-surface text-ink-3 shadow-sm [&_svg]:size-6`,children:e}),(0,t.jsx)(`h3`,{className:`font-display text-[20px] font-medium`,children:n}),r&&(0,t.jsx)(`p`,{className:`mt-2 text-[13.5px] leading-relaxed text-ink-2`,children:r}),i&&(0,t.jsx)(`div`,{className:`mt-6`,children:i})]})}export{n as t};
1
+ import{rn as e}from"./format-Dk1nO38Z.js";var t=e();function n({icon:e,title:n,children:r,action:i}){return(0,t.jsxs)(`div`,{className:`animate-rise mx-auto flex max-w-sm flex-col items-center px-6 py-14 text-center`,children:[e&&(0,t.jsx)(`div`,{className:`mb-5 grid size-14 place-items-center rounded-[16px] border border-line bg-surface text-ink-3 shadow-sm [&_svg]:size-6`,children:e}),(0,t.jsx)(`h3`,{className:`font-display text-[20px] font-medium`,children:n}),r&&(0,t.jsx)(`p`,{className:`mt-2 text-[13.5px] leading-relaxed text-ink-2`,children:r}),i&&(0,t.jsx)(`div`,{className:`mt-6`,children:i})]})}export{n as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,in as n,rn as r}from"./format-BVq_UI0J.js";var i=e(n(),1),a=r(),o=(0,i.forwardRef)(function({label:e,hint:n,error:r,trailing:o,className:s,id:c,...l},u){let d=(0,i.useId)(),f=c??d;return(0,a.jsxs)(`div`,{className:t(`flex flex-col gap-1.5`,s),children:[(0,a.jsx)(`label`,{htmlFor:f,className:`text-[12.5px] font-medium text-ink-2`,children:e}),(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(`input`,{ref:u,id:f,"aria-invalid":r?!0:void 0,"aria-describedby":r?`${f}-error`:n?`${f}-hint`:void 0,className:t(`field h-10`,o?`pr-10`:void 0),"data-autofocus":l.autoFocus||void 0,...l}),o&&(0,a.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:o})]}),r?(0,a.jsx)(`p`,{id:`${f}-error`,className:`text-[12.5px] text-danger`,role:`alert`,children:r}):n?(0,a.jsx)(`p`,{id:`${f}-hint`,className:`text-[12.5px] text-ink-3`,children:n}):null]})});export{o as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,in as n,rn as r}from"./format-Dk1nO38Z.js";var i=e(n(),1),a=r(),o=(0,i.forwardRef)(function({label:e,hint:n,error:r,trailing:o,className:s,id:c,...l},u){let d=(0,i.useId)(),f=c??d;return(0,a.jsxs)(`div`,{className:t(`flex flex-col gap-1.5`,s),children:[(0,a.jsx)(`label`,{htmlFor:f,className:`text-[12.5px] font-medium text-ink-2`,children:e}),(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(`input`,{ref:u,id:f,"aria-invalid":r?!0:void 0,"aria-describedby":r?`${f}-error`:n?`${f}-hint`:void 0,className:t(`field h-10`,o?`pr-10`:void 0),"data-autofocus":l.autoFocus||void 0,...l}),o&&(0,a.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:o})]}),r?(0,a.jsx)(`p`,{id:`${f}-error`,className:`text-[12.5px] text-danger`,role:`alert`,children:r}):n?(0,a.jsx)(`p`,{id:`${f}-hint`,className:`text-[12.5px] text-ink-3`,children:n}):null]})});export{o as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,Et as n,L as r,M as i,Ot as a,Ut as o,c as s,d as c,en as l,in as u,p as d,rn as f,rt as p,ut as m,x as h}from"./format-BVq_UI0J.js";import{t as g}from"./arrow-up-right-DzWSrgbl.js";import{n as _}from"./Avatar-DJI4yDCJ.js";import{t as v}from"./check-a7phVGDi.js";import{n as y,t as b}from"./square-kanban-WA9_EY-N.js";import{t as x}from"./lock-keyhole-Djv60i7r.js";import{h as S,u as C}from"./Menu-GG9F8t1A.js";import{t as w}from"./ActivityList-CS7AMLtm.js";import{i as T,t as E}from"./Phrases-DftRflqk.js";import{n as D,r as O}from"./theme-BfxBDblB.js";import{n as k}from"./CardItem-335cP4hf.js";import{t as A}from"./PageHeader-CE8sCm7O.js";var j={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};j.node;var M=n(j),N=e(u(),1),P=f();function F(){let{t:e}=a(`home`),{workspaceId:n,me:u,overview:f,openNewProject:j}=C(),F=i(n),L=r(),R=l({queryKey:h.vault,queryFn:({signal:e})=>p(`/vault`,e)}),[z,B]=(0,N.useState)(()=>D(`onboarding-dismissed`,!1)),V=u.user.name.split(/\s+/)[0],[H,U]=T(e(`greeting`,{greeting:s(),name:V})),W=`/w/${n}`,G=f?.projects??[],K=[{done:G.length>0,title:e(`onboarding.project.title`),body:e(`onboarding.project.body`),icon:(0,P.jsx)(M,{}),action:j},{done:G.some(e=>e.pages.length>0),title:e(`onboarding.page.title`),body:e(`onboarding.page.body`),icon:(0,P.jsx)(y,{}),to:G[0]?`${W}/p/${G[0].id}`:void 0},{done:!!R.data?.initialized,title:e(`onboarding.vault.title`),body:e(`onboarding.vault.body`),icon:(0,P.jsx)(x,{}),to:`${W}/vault`},{done:(L.data??[]).some(e=>e.workspaceId===n&&m(e)),title:e(`onboarding.agent.title`),body:e(`onboarding.agent.body`),icon:(0,P.jsx)(_,{}),to:`${W}/agents`}],q=f&&L.data&&R.data&&!z&&K.some(e=>!e.done);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,P.jsx)(A,{crumbs:[{label:e(`title`)}]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,P.jsxs)(`div`,{className:`mx-auto w-full max-w-[1080px] px-6 py-10 sm:px-10 sm:py-14`,children:[(0,P.jsx)(`p`,{className:`animate-rise font-mono text-[11.5px] tracking-[0.14em] text-ink-3 uppercase first-letter:uppercase`,children:c()}),(0,P.jsx)(`h1`,{className:`animate-rise mt-2 font-display text-[40px] leading-[1.05] font-medium tracking-[-0.03em] sm:text-[48px]`,style:{animationDelay:`40ms`},children:(0,P.jsx)(E,{text:H,italic:U})}),q&&(0,P.jsxs)(`section`,{className:`animate-rise relative mt-10 rounded-[18px] border border-line bg-surface p-5 shadow-sm`,style:{animationDelay:`80ms`},"aria-label":e(`onboarding.title`),children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>{B(!0),O(`onboarding-dismissed`,!0)},"aria-label":e(`onboarding.dismiss`),className:`absolute top-3 right-3 grid size-7 place-items-center rounded-[8px] text-ink-3 hover:bg-hover hover:text-ink`,children:(0,P.jsx)(S,{className:`size-4`})}),(0,P.jsx)(`h2`,{className:`font-display text-[19px] font-medium`,children:e(`onboarding.title`)}),(0,P.jsx)(`p`,{className:`mt-0.5 text-[13px] text-ink-3`,children:e(`onboarding.progress`,{done:K.filter(e=>e.done).length,total:K.length})}),(0,P.jsx)(`ol`,{className:`mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:K.map((e,n)=>{let r=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:t(`grid size-8 shrink-0 place-items-center rounded-[9px] [&_svg]:size-4`,e.done?`bg-ok/12 text-ok`:`bg-sunken text-ink-2`),children:e.done?(0,P.jsx)(v,{}):e.icon}),(0,P.jsxs)(`span`,{className:`min-w-0`,children:[(0,P.jsxs)(`span`,{className:t(`block text-[13.5px] font-medium`,e.done&&`text-ink-3 line-through decoration-ink-4`),children:[(0,P.jsx)(`span`,{className:`mr-1 font-mono text-[11px] text-ink-3`,children:n+1}),e.title]}),(0,P.jsx)(`span`,{className:`block text-[12px] text-ink-3`,children:e.body})]})]}),i=`flex h-full items-start gap-3 rounded-[12px] border border-line p-3 text-left transition-colors hover:border-line-strong hover:bg-hover`;return(0,P.jsx)(`li`,{children:e.to?(0,P.jsx)(o,{to:e.to,className:i,children:r}):(0,P.jsx)(`button`,{type:`button`,onClick:e.action,className:t(i,`w-full`),children:r})},e.title)})})]}),(0,P.jsxs)(`div`,{className:`mt-10 grid gap-6 lg:grid-cols-[1.25fr_1fr] [&>*]:min-w-0`,children:[(0,P.jsx)(I,{title:e(`due.title`),delay:120,empty:F.data&&F.data.dueCards.length===0?e(`due.empty`):null,children:(0,P.jsx)(`ul`,{className:`flex flex-col`,children:F.data?.dueCards.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(o,{to:`${W}/b/${e.boardId}?card=${e.id}`,className:`flex items-center gap-3 rounded-[10px] px-2.5 py-2 transition-colors hover:bg-hover`,children:[(0,P.jsx)(b,{className:`size-4 shrink-0 text-ink-3`}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-[13.5px] font-medium`,children:e.title}),(0,P.jsxs)(`span`,{className:`block truncate text-[12px] text-ink-3`,children:[e.projectName,` · `,e.boardName,` · `,e.columnName]})]}),e.dueAt&&(0,P.jsx)(k,{dueAt:e.dueAt})]})},e.id))})}),(0,P.jsx)(I,{title:e(`recent.title`),delay:160,empty:F.data&&F.data.recentPages.length===0?e(`recent.empty`):null,children:(0,P.jsx)(`ul`,{className:`flex flex-col`,children:F.data?.recentPages.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(o,{to:`${W}/d/${t.id}`,className:`flex items-center gap-3 rounded-[10px] px-2.5 py-2 transition-colors hover:bg-hover`,children:[(0,P.jsx)(`span`,{className:`w-4 text-center text-[14px]`,children:t.icon??(0,P.jsx)(y,{className:`size-4 text-ink-3`})}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-[13.5px] font-medium`,children:t.title||e(`untitled`,{ns:`common`})}),(0,P.jsx)(`span`,{className:`block truncate text-[12px] text-ink-3`,children:t.projectName})]}),(0,P.jsx)(`span`,{className:`shrink-0 text-[11.5px] text-ink-3`,children:d(t.updatedAt)})]})},t.id))})})]}),(0,P.jsx)(`div`,{className:`mt-6`,children:(0,P.jsx)(I,{title:e(`activity.title`),delay:200,action:(0,P.jsxs)(o,{to:`${W}/agents`,className:`inline-flex items-center gap-1 text-[12px] font-medium text-ink-3 hover:text-ink`,children:[e(`activity.agents`),` `,(0,P.jsx)(g,{className:`size-3.5`})]}),empty:F.data&&F.data.activity.length===0?e(`activity.empty`):null,children:F.data&&F.data.activity.length>0&&(0,P.jsx)(`div`,{className:`px-2.5 py-1`,children:(0,P.jsx)(w,{items:F.data.activity,workspaceId:n})})})})]})})]})}function I({title:e,children:t,empty:n,delay:r=0,action:i}){return(0,P.jsxs)(`section`,{className:`animate-rise flex flex-col`,style:{animationDelay:`${r}ms`},children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center justify-between px-1`,children:[(0,P.jsx)(`h2`,{className:`text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e}),i]}),(0,P.jsx)(`div`,{className:`min-h-[120px] flex-1 rounded-[16px] border border-line bg-surface p-1.5 shadow-sm`,children:n?(0,P.jsx)(`p`,{className:`px-3 py-8 text-center text-[13px] text-ink-3`,children:n}):t})]})}export{F as HomePage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,Et as n,L as r,M as i,Ot as a,Ut as o,c as s,d as c,en as l,in as u,p as d,rn as f,rt as p,ut as m,x as h}from"./format-Dk1nO38Z.js";import{t as g}from"./arrow-up-right-GSt0z737.js";import{n as _}from"./Avatar-B1img0gb.js";import{t as v}from"./check-A2t_TRNF.js";import{n as y,t as b}from"./square-kanban-Cd_tPOtx.js";import{t as x}from"./lock-keyhole-DVrMCpqy.js";import{h as S,u as C}from"./Menu-CzgZwzmu.js";import{t as w}from"./ActivityList-TVMXixkB.js";import{i as T,t as E}from"./Phrases-C89QdC4L.js";import{n as D,r as O}from"./theme-BfxBDblB.js";import{n as k}from"./CardItem-BAkxFtTs.js";import{t as A}from"./PageHeader-DJdrnGpr.js";var j={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};j.node;var M=n(j),N=e(u(),1),P=f();function F(){let{t:e}=a(`home`),{workspaceId:n,me:u,overview:f,openNewProject:j}=C(),F=i(n),L=r(),R=l({queryKey:h.vault,queryFn:({signal:e})=>p(`/vault`,e)}),[z,B]=(0,N.useState)(()=>D(`onboarding-dismissed`,!1)),V=u.user.name.split(/\s+/)[0],[H,U]=T(e(`greeting`,{greeting:s(),name:V})),W=`/w/${n}`,G=f?.projects??[],K=[{done:G.length>0,title:e(`onboarding.project.title`),body:e(`onboarding.project.body`),icon:(0,P.jsx)(M,{}),action:j},{done:G.some(e=>e.pages.length>0),title:e(`onboarding.page.title`),body:e(`onboarding.page.body`),icon:(0,P.jsx)(y,{}),to:G[0]?`${W}/p/${G[0].id}`:void 0},{done:!!R.data?.initialized,title:e(`onboarding.vault.title`),body:e(`onboarding.vault.body`),icon:(0,P.jsx)(x,{}),to:`${W}/vault`},{done:(L.data??[]).some(e=>e.workspaceId===n&&m(e)),title:e(`onboarding.agent.title`),body:e(`onboarding.agent.body`),icon:(0,P.jsx)(_,{}),to:`${W}/agents`}],q=f&&L.data&&R.data&&!z&&K.some(e=>!e.done);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,P.jsx)(A,{crumbs:[{label:e(`title`)}]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,P.jsxs)(`div`,{className:`mx-auto w-full max-w-[1080px] px-6 py-10 sm:px-10 sm:py-14`,children:[(0,P.jsx)(`p`,{className:`animate-rise font-mono text-[11.5px] tracking-[0.14em] text-ink-3 uppercase first-letter:uppercase`,children:c()}),(0,P.jsx)(`h1`,{className:`animate-rise mt-2 font-display text-[40px] leading-[1.05] font-medium tracking-[-0.03em] sm:text-[48px]`,style:{animationDelay:`40ms`},children:(0,P.jsx)(E,{text:H,italic:U})}),q&&(0,P.jsxs)(`section`,{className:`animate-rise relative mt-10 rounded-[18px] border border-line bg-surface p-5 shadow-sm`,style:{animationDelay:`80ms`},"aria-label":e(`onboarding.title`),children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>{B(!0),O(`onboarding-dismissed`,!0)},"aria-label":e(`onboarding.dismiss`),className:`absolute top-3 right-3 grid size-7 place-items-center rounded-[8px] text-ink-3 hover:bg-hover hover:text-ink`,children:(0,P.jsx)(S,{className:`size-4`})}),(0,P.jsx)(`h2`,{className:`font-display text-[19px] font-medium`,children:e(`onboarding.title`)}),(0,P.jsx)(`p`,{className:`mt-0.5 text-[13px] text-ink-3`,children:e(`onboarding.progress`,{done:K.filter(e=>e.done).length,total:K.length})}),(0,P.jsx)(`ol`,{className:`mt-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:K.map((e,n)=>{let r=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`span`,{className:t(`grid size-8 shrink-0 place-items-center rounded-[9px] [&_svg]:size-4`,e.done?`bg-ok/12 text-ok`:`bg-sunken text-ink-2`),children:e.done?(0,P.jsx)(v,{}):e.icon}),(0,P.jsxs)(`span`,{className:`min-w-0`,children:[(0,P.jsxs)(`span`,{className:t(`block text-[13.5px] font-medium`,e.done&&`text-ink-3 line-through decoration-ink-4`),children:[(0,P.jsx)(`span`,{className:`mr-1 font-mono text-[11px] text-ink-3`,children:n+1}),e.title]}),(0,P.jsx)(`span`,{className:`block text-[12px] text-ink-3`,children:e.body})]})]}),i=`flex h-full items-start gap-3 rounded-[12px] border border-line p-3 text-left transition-colors hover:border-line-strong hover:bg-hover`;return(0,P.jsx)(`li`,{children:e.to?(0,P.jsx)(o,{to:e.to,className:i,children:r}):(0,P.jsx)(`button`,{type:`button`,onClick:e.action,className:t(i,`w-full`),children:r})},e.title)})})]}),(0,P.jsxs)(`div`,{className:`mt-10 grid gap-6 lg:grid-cols-[1.25fr_1fr] [&>*]:min-w-0`,children:[(0,P.jsx)(I,{title:e(`due.title`),delay:120,empty:F.data&&F.data.dueCards.length===0?e(`due.empty`):null,children:(0,P.jsx)(`ul`,{className:`flex flex-col`,children:F.data?.dueCards.map(e=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(o,{to:`${W}/b/${e.boardId}?card=${e.id}`,className:`flex items-center gap-3 rounded-[10px] px-2.5 py-2 transition-colors hover:bg-hover`,children:[(0,P.jsx)(b,{className:`size-4 shrink-0 text-ink-3`}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-[13.5px] font-medium`,children:e.title}),(0,P.jsxs)(`span`,{className:`block truncate text-[12px] text-ink-3`,children:[e.projectName,` · `,e.boardName,` · `,e.columnName]})]}),e.dueAt&&(0,P.jsx)(k,{dueAt:e.dueAt})]})},e.id))})}),(0,P.jsx)(I,{title:e(`recent.title`),delay:160,empty:F.data&&F.data.recentPages.length===0?e(`recent.empty`):null,children:(0,P.jsx)(`ul`,{className:`flex flex-col`,children:F.data?.recentPages.map(t=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(o,{to:`${W}/d/${t.id}`,className:`flex items-center gap-3 rounded-[10px] px-2.5 py-2 transition-colors hover:bg-hover`,children:[(0,P.jsx)(`span`,{className:`w-4 text-center text-[14px]`,children:t.icon??(0,P.jsx)(y,{className:`size-4 text-ink-3`})}),(0,P.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`span`,{className:`block truncate text-[13.5px] font-medium`,children:t.title||e(`untitled`,{ns:`common`})}),(0,P.jsx)(`span`,{className:`block truncate text-[12px] text-ink-3`,children:t.projectName})]}),(0,P.jsx)(`span`,{className:`shrink-0 text-[11.5px] text-ink-3`,children:d(t.updatedAt)})]})},t.id))})})]}),(0,P.jsx)(`div`,{className:`mt-6`,children:(0,P.jsx)(I,{title:e(`activity.title`),delay:200,action:(0,P.jsxs)(o,{to:`${W}/agents`,className:`inline-flex items-center gap-1 text-[12px] font-medium text-ink-3 hover:text-ink`,children:[e(`activity.agents`),` `,(0,P.jsx)(g,{className:`size-3.5`})]}),empty:F.data&&F.data.activity.length===0?e(`activity.empty`):null,children:F.data&&F.data.activity.length>0&&(0,P.jsx)(`div`,{className:`px-2.5 py-1`,children:(0,P.jsx)(w,{items:F.data.activity,workspaceId:n})})})})]})})]})}function I({title:e,children:t,empty:n,delay:r=0,action:i}){return(0,P.jsxs)(`section`,{className:`animate-rise flex flex-col`,style:{animationDelay:`${r}ms`},children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center justify-between px-1`,children:[(0,P.jsx)(`h2`,{className:`text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e}),i]}),(0,P.jsx)(`div`,{className:`min-h-[120px] flex-1 rounded-[16px] border border-line bg-surface p-1.5 shadow-sm`,children:n?(0,P.jsx)(`p`,{className:`px-3 py-8 text-center text-[13px] text-ink-3`,children:n}):t})]})}export{F as HomePage};
@@ -1,4 +1,4 @@
1
- import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as n,Et as r,in as i,rn as a}from"./format-BVq_UI0J.js";var o=t((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`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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.browser=function(e){return{$$typeof:s,_reason:e}},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 l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.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=d(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=d(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=d(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=d(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),s=t(((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=o()})),c=e(i(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}u(d,`setRef`);function f(...e){return t=>{let n=!1,r=e.map(e=>{let r=d(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():d(e[t],null)}}}}u(f,`composeRefs`);function p(...e){return c.useCallback(f(...e),e)}u(p,`useComposedRefs`);var m=a(),h=e(s(),1),g=Object.defineProperty,_=(e,t)=>g(e,`name`,{value:t,configurable:!0});function v(e){let t=c.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=O(r),c.Children.forEach(r,e=>{if(w(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;E(n)&&typeof j==`function`;)n=j(n._payload);a=x(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=c.cloneElement(a,void 0,s):!o&&c.Children.count(r)===1&&c.isValidElement(r)&&(a=r);let l=a?C(a):void 0,u=p(n,l);if(!a){if(r||r===0)throw Error(o?A(e):ee(e));return r}let d=S(i,a.props??{});return a.type!==c.Fragment&&(d.ref=n?u:l),c.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}_(v,`createSlot`);var y=Symbol.for(`radix.slottable`);function b(e){let t=_(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=y,t}_(b,`createSlottable`);var x=_((e,t)=>`child`in e.props?c.isValidElement(t)?c.cloneElement(t,void 0,e.props.children(t.props.children)):null:c.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function S(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=k(a,i))}return{...e,...n}}_(S,`mergeProps`);function C(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}_(C,`getElementRef`);function w(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===y}_(w,`isSlottable`);var T=Symbol.for(`react.lazy`);function E(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===T&&`_payload`in e&&D(e._payload)}_(E,`isLazyComponent`);function D(e){return typeof e==`object`&&!!e&&`then`in e}_(D,`isPromiseLike`);function O(e){let t=e;for(;E(t)&&typeof j==`function`;)t=j(t._payload);return t}_(O,`useUnwrappedLazy`);function k(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}_(k,`concatAriaDescribedby`);var ee=_(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),A=_(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),j=c.use,te=Object.defineProperty,M=(e,t)=>te(e,`name`,{value:t,configurable:!0}),N=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=v(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,m.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ne(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}M(ne,`dispatchDiscreteCustomEvent`);var re=Object.defineProperty,P=(e,t)=>re(e,`name`,{value:t,configurable:!0}),ie=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ae=c.forwardRef(P(function(e,t){return(0,m.jsx)(N.span,{...e,ref:t,style:{...ie,...e.style}})},`VisuallyHidden`)),oe=Object.defineProperty,F=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e,t){let n=c.createContext(t);n.displayName=e+`Context`;let r=F(e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,m.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=c.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return F(i,`useContext`),[r,i]}F(se,`createContext`);function ce(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=F(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,m.jsx)(s.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:l=!1}=s,u=o?.[e]?.[a]||i,d=c.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return F(s,`useContext`),[o,s]}F(r,`createContext`);let i=F(()=>{let t=n.map(e=>c.createContext(e));return F(function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,le(i,...t)]}F(ce,`createContextScope`);function le(...e){let t=e[0];if(e.length===1)return t;let n=F(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return F(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}F(le,`composeContextScopes`);var I=globalThis?.document?c.useLayoutEffect:()=>{},ue=Object.defineProperty,L=(e,t)=>ue(e,`name`,{value:t,configurable:!0});function de(e){let t=e+`CollectionProvider`,[n,r]=ce(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=L(e=>{let{scope:t,children:n}=e,r=c.useRef(null),a=c.useRef(new Map).current;return(0,m.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,l=v(s),u=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=p(t,a(s,n).collectionRef);return(0,m.jsx)(l,{ref:i,children:r})});u.displayName=s;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,h=v(d),g=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=p(t,o),l=a(d,n);return c.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,m.jsx)(h,{[f]:``,ref:s,children:r})});g.displayName=d;function _(t){let n=a(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return L(_,`useCollection`),[{Provider:o,Slot:u,ItemSlot:g},_,r]}L(de,`createCollection`);var fe=new WeakMap,pe=class e extends Map{static{L(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],fe.set(this,!0)}set(e,t){return fe.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=ge(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=me(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=me(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return me(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function me(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=he(e,t);return n===-1?void 0:e[n]}L(me,`at`);function he(e,t){let n=e.length,r=ge(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}L(he,`toSafeIndex`);function ge(e){return e!==e||e===0?0:Math.trunc(e)}L(ge,`toSafeInteger`);function _e(e){let t=e+`CollectionProvider`,[n,r]=ce(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let l=L(({state:e,...t})=>e?(0,m.jsx)(d,{...t,state:e}):(0,m.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=L(e=>{let t=x();return(0,m.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=L(e=>{let{scope:t,children:n,state:r}=e,a=c.useRef(null),[s,l]=c.useState(null),u=p(a,l),[d,f]=r,h=c.useRef(new pe),g=c.useCallback(()=>{let e=h.current;return be(e)||e.sort(xe),e},[]);return c.useEffect(()=>{if(!s)return;let e=Se(()=>{f(e=>{let t=e.toSorted(xe);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,f]),(0,m.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:g,setCollection:f,registryRef:h,children:(0,m.jsx)(o,{scope:t,collectionElement:s,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,h=v(f),g=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=p(t,a(f,n).collectionElementRef);return(0,m.jsx)(h,{ref:i,children:r})});g.displayName=f;let _=e+`CollectionItemSlot`,y=v(_),b=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),{setCollection:s,registryRef:l}=a(_,n),u=c.useRef(i);ve(u.current,i)||(u.current=i);let d=u.current,f=p(t,c.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):o.current&&t.delete(o.current)},[l]),o);I(()=>{let e=o.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let h=c.useRef(null);return c.useEffect(()=>{let e=o.current,t=h.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(h.current=e?{element:e,itemData:d}:null,s(n=>{let r=new pe(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(xe)}))}),c.useEffect(()=>()=>{let e=h.current;h.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new pe(t);return n.delete(e.element),n})},[s]),(0,m.jsx)(y,{"data-radix-collection-item":``,ref:f,children:r})});b.displayName=_;function x(){return c.useState(new pe)}L(x,`useInitCollection`);function S(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}L(S,`useCollection`);function C(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return L(C,`useGetCollection`),[{Provider:l,Slot:g,ItemSlot:b},{createCollectionScope:r,useCollection:S,useGetCollection:C,useInitCollection:x}]}L(_e,`createCollection`);function ve(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}L(ve,`shallowEqual`);function ye(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}L(ye,`isElementPreceding`);function be(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}L(be,`isInDocumentOrder`);function xe(e,t){return!e[1].element||!t[1].element?0:ye(e[1].element,t[1].element)?-1:1}L(xe,`sortByDocumentPosition`);function Se(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}L(Se,`getChildListObserver`);var Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),Te=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return we(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}we(R,`composeEventHandlers`);function Ee(e){if(!Te)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}we(Ee,`getOwnerWindow`);function De(e){if(!Te)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}we(De,`getOwnerDocument`);function Oe(e,t=!1){let{activeElement:n}=De(e);if(!n?.nodeName)return null;if(ke(n)&&n.contentDocument)return Oe(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=De(n).getElementById(e);if(t)return t}}return n}we(Oe,`getActiveElement`);function ke(e){return e.tagName===`IFRAME`}we(ke,`isFrame`);var Ae=Object.defineProperty,je=(e,t)=>Ae(e,`name`,{value:t,configurable:!0}),Me=c.useEffectEvent,Ne=c.useInsertionEffect;function Pe(e){if(typeof Me==`function`)return Me(e);let t=c.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ne==`function`?Ne(()=>{t.current=e}):I(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}je(Pe,`useEffectEvent`);var Fe=Object.defineProperty,Ie=(e,t)=>Fe(e,`name`,{value:t,configurable:!0}),Le=c.useInsertionEffect||I;function Re({prop:e,defaultProp:t,onChange:n=Ie(()=>{},`onChange`),caller:r}){let[i,a,o]=ze({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,c.useCallback(t=>{if(s){let n=Be(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ie(Re,`useControllableState`);function ze({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return Le(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ie(ze,`useUncontrolledState`);function Be(e){return typeof e==`function`}Ie(Be,`isFunction`);var Ve=Symbol(`RADIX:SYNC_STATE`);function He(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,l=i!==void 0,u=Pe(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=c.useReducer((t,n)=>{if(n.type===Ve)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=c.useRef(m);c.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=c.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return c.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Ve,state:i})},[i,f.state,l]),[g,p]}Ie(He,`useControllableStateReducer`);var Ue=Object.defineProperty,We=(e,t)=>Ue(e,`name`,{value:t,configurable:!0});function Ge(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}We(Ge,`useStateMachine`);var Ke=We(e=>{let{present:t,children:n}=e,r=qe(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=Ye(r.ref,Ze(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null},`Presence`);function qe(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),o=c.useRef(void 0),[s,l]=Ge(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{s===`mounted`?(a.current=o.current??Xe(r.current),o.current=void 0):a.current=`none`},[s]),I(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Xe(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),I(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=We(a=>{let o=Xe(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=We(e=>{e.target===t&&(a.current=Xe(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:c.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Xe(t)}else r.current=null;n(e)},[])}}We(qe,`usePresence`);function Je(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}We(Je,`setRef`);function Ye(...e){let t=c.useRef(e);return t.current=e,c.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Je(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Je(n[e],null)}}},[])}We(Ye,`useStableComposedRefs`);function Xe(e){return e?.animationName||`none`}We(Xe,`getAnimationName`);function Ze(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}We(Ze,`getElementRef`);var Qe=Object.defineProperty,$e=(e,t)=>Qe(e,`name`,{value:t,configurable:!0}),et=c.useId||(()=>void 0),tt=0;function nt(e){let[t,n]=c.useState(et());return I(()=>{e||n(e=>e??String(tt++))},[e]),e||(t?`radix-${t}`:``)}$e(nt,`useId`);var rt=Object.defineProperty,it=(e,t)=>rt(e,`name`,{value:t,configurable:!0}),at={LTR:`ltr`,RTL:`rtl`},ot=c.createContext(void 0);function st(e){let t=c.useContext(ot);return e||t||at.LTR}it(st,`useDirection`);var ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=c.useInsertionEffect;function z(e){let t=c.useRef(e);return typeof ut==`function`?ut(()=>{t.current=e}):I(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}lt(z,`useCallbackRef`);var dt=Object.defineProperty,B=(e,t)=>dt(e,`name`,{value:t,configurable:!0}),ft=`dismissableLayer.update`,pt=`dismissableLayer.pointerDownOutside`,mt=`dismissableLayer.focusOutside`,ht,gt=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_t=c.forwardRef(B(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=c.useContext(gt),[f,h]=c.useState(null),g=f?.ownerDocument??globalThis?.document,[,_]=c.useState({}),v=p(t,h),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=f?y.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=c.useRef(!1),E=bt(e=>{a?.(e),s?.(e),e.defaultPrevented||l?.()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=xt(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},g),O=f?S===y.length-1:!1,k=z(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return c.useEffect(()=>{if(O)return g.addEventListener(`keydown`,k,{capture:!0}),()=>g.removeEventListener(`keydown`,k,{capture:!0})},[g,O,k]),c.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ht=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),St(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=ht))}},[f,g,n,d]),c.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),St())},[f,d]),c.useEffect(()=>{let e=B(()=>_({}),`handleUpdate`);return document.addEventListener(ft,e),()=>document.removeEventListener(ft,e)},[]),(0,m.jsx)(N.div,{...u,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,D.onFocusCapture),onBlurCapture:R(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function vt(){let e=c.useContext(gt),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}B(vt,`useDismissableLayerSurface`);var yt=B(()=>!0,`IS_TRUE`);function bt(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=yt}=t,s=z(e),l=c.useRef(!1),u=c.useRef(!1),d=c.useRef(new Map),f=c.useRef(()=>{});return c.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}B(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}B(t,`isOutsideInteractionIntercepted`);function c(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}B(c,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}B(p,`handleInteractionBubble`);let m=B(a=>{if(a.target&&!l.current){let c=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Ct(pt,s,p,{discrete:!0})};if(B(c,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?c():(n.removeEventListener(`click`,f.current),f.current=c,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,c,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,c,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:B(()=>l.current=!0,`onPointerDownCapture`)}}B(bt,`usePointerDownOutside`);function xt(e,t=globalThis?.document){let n=z(e),r=c.useRef(!1);return c.useEffect(()=>{let e=B(e=>{e.target&&!r.current&&Ct(mt,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:B(()=>r.current=!0,`onFocusCapture`),onBlurCapture:B(()=>r.current=!1,`onBlurCapture`)}}B(xt,`useFocusOutside`);function St(){let e=new CustomEvent(ft);document.dispatchEvent(e)}B(St,`dispatchUpdate`);function Ct(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ne(i,a):i.dispatchEvent(a)}B(Ct,`handleAndDispatchCustomEvent`);var wt=Object.defineProperty,V=(e,t)=>wt(e,`name`,{value:t,configurable:!0}),Tt=`focusScope.autoFocusOnMount`,Et=`focusScope.autoFocusOnUnmount`,Dt={bubbles:!1,cancelable:!0},Ot=c.forwardRef(V(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,u]=c.useState(null),d=z(a),f=z(o),h=c.useRef(null),g=p(t,u),_=c.useRef(i);c.useEffect(()=>{_.current=i});let v=c.useCallback(e=>e?l?.contains(e)?!0:!!_.current?.some(t=>t.contains(e)):!1,[l]),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(y.paused||!l)return;let t=e.target;v(t)?h.current=t:zt(h.current,{select:!0})},t=function(e){if(y.paused||!l)return;let t=e.relatedTarget;t!==null&&(v(t)||zt(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&zt(l)};V(e,`handleFocusIn`),V(t,`handleFocusOut`),V(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,y.paused,v]),c.useEffect(()=>{if(l){Bt.add(y);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Tt,Dt);l.addEventListener(Tt,d),l.dispatchEvent(t),t.defaultPrevented||(Nt(Ut(Ft(l)),{select:!0}),document.activeElement===e&&zt(l))}return()=>{l.removeEventListener(Tt,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Et,Dt);l.addEventListener(Et,f),l.dispatchEvent(r),r.defaultPrevented||zt(e??t.body,{select:!0}),l.removeEventListener(Et,f),Bt.remove(y)},0)}}},[l,d,f,y]);let b=c.useCallback(e=>{if(!n&&!r||y.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Pt(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&zt(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&zt(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,y.paused]);return(0,m.jsx)(N.div,{tabIndex:-1,...s,ref:g,onKeyDown:b})},`FocusScope`)),kt=c.createContext(null);function At({registry:e,children:t}){return e?(0,m.jsx)(kt.Provider,{value:e,children:t}):t}V(At,`FocusScopeBranchProvider`);function jt(){let[e,t]=c.useState([]);return{nodes:e,registry:c.useMemo(()=>({add:V(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:V(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}V(jt,`useFocusScopeBranchRegistry`);function Mt(e){let t=c.useContext(kt);c.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}V(Mt,`useFocusScopeBranch`);function Nt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(zt(r,{select:t}),document.activeElement!==n)return}V(Nt,`focusFirst`);function Pt(e){let t=Ft(e);return[It(t,e),It(t.reverse(),e)]}V(Pt,`getTabbableEdges`);function Ft(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:V(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}V(Ft,`getTabbableCandidates`);function It(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Lt(r,{upTo:t})))return r}V(It,`findVisible`);function Lt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}V(Lt,`isHidden`);function Rt(e){return e.tagName===`INPUT`&&typeof e.select==`function`}V(Rt,`isSelectableInput`);function zt(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Rt(e)&&t&&e.select()}}V(zt,`focus`);var Bt=Vt();function Vt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ht(e,t),e.unshift(t)},remove(t){e=Ht(e,t),e[0]?.resume()}}}V(Vt,`createFocusScopesStack`);function Ht(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}V(Ht,`arrayRemove`);function Ut(e){return e.filter(e=>e.tagName!==`A`)}V(Ut,`removeLinks`);var Wt=Object.defineProperty,Gt=c.forwardRef(((e,t)=>Wt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=c.useState(!1);I(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?h.createPortal((0,m.jsx)(N.div,{...r,ref:t}),o):null},`Portal`)),Kt=Object.defineProperty,qt=(e,t)=>Kt(e,`name`,{value:t,configurable:!0}),Jt=0,Yt=null;function Xt(e){return Zt(),e.children}qt(Xt,`FocusGuards`);function Zt(){c.useEffect(()=>{Yt||={start:Qt(),end:Qt()};let{start:e,end:t}=Yt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Jt++,()=>{Jt===1&&(Yt?.start.remove(),Yt?.end.remove(),Yt=null),Jt=Math.max(0,Jt-1)}},[])}qt(Zt,`useFocusGuards`);function Qt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}qt(Qt,`createFocusGuard`);var H=function(){return H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},H.apply(this,arguments)};function $t(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function en(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tn=`right-scroll-bar-position`,nn=`width-before-scroll-bar`,rn=`with-scroll-bars-hidden`,an=`--removed-body-scroll-bar-size`;function on(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function sn(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var cn=typeof window<`u`?c.useLayoutEffect:c.useEffect,ln=new WeakMap;function un(e,t){var n=sn(t||null,function(t){return e.forEach(function(e){return on(e,t)})});return cn(function(){var t=ln.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||on(e,null)}),i.forEach(function(e){r.has(e)||on(e,a)})}ln.set(n,e)},[e]),n}function dn(e){return e}function fn(e,t){t===void 0&&(t=dn);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function pn(e){e===void 0&&(e={});var t=fn(null);return t.options=H({async:!0,ssr:!1},e),t}var mn=function(e){var t=e.sideCar,n=$t(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,H({},n))};mn.isSideCarExport=!0;function hn(e,t){return e.useMedium(t),mn}var gn=pn(),_n=function(){},vn=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:_n,onWheelCapture:_n,onTouchMoveCapture:_n}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=$t(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=un([n,t]),w=H(H({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:gn,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),H(H({},w),{ref:C})):c.createElement(y,H({},w,{className:l,ref:C}),s))});vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vn.classNames={fullWidth:nn,zeroRight:tn};var yn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function bn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=yn();return t&&e.setAttribute(`nonce`,t),e}function xn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Cn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bn())&&(xn(t,n),Sn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wn=function(){var e=Cn();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Tn=function(){var e=wn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},En={left:0,top:0,right:0,gap:0},Dn=function(e){return parseInt(e||``,10)||0},On=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Dn(n),Dn(r),Dn(i)]},kn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return En;var t=On(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},An=Tn(),jn=`data-scroll-locked`,Mn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as n,Et as r,in as i,rn as a}from"./format-Dk1nO38Z.js";var o=t((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`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(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.browser=function(e){return{$$typeof:s,_reason:e}},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 l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.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=d(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=d(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,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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=d(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=d(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,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority: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 u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),s=t(((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=o()})),c=e(i(),1),l=Object.defineProperty,u=(e,t)=>l(e,`name`,{value:t,configurable:!0});function d(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}u(d,`setRef`);function f(...e){return t=>{let n=!1,r=e.map(e=>{let r=d(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():d(e[t],null)}}}}u(f,`composeRefs`);function p(...e){return c.useCallback(f(...e),e)}u(p,`useComposedRefs`);var m=a(),h=e(s(),1),g=Object.defineProperty,_=(e,t)=>g(e,`name`,{value:t,configurable:!0});function v(e){let t=c.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=O(r),c.Children.forEach(r,e=>{if(w(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;E(n)&&typeof j==`function`;)n=j(n._payload);a=x(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=c.cloneElement(a,void 0,s):!o&&c.Children.count(r)===1&&c.isValidElement(r)&&(a=r);let l=a?C(a):void 0,u=p(n,l);if(!a){if(r||r===0)throw Error(o?A(e):ee(e));return r}let d=S(i,a.props??{});return a.type!==c.Fragment&&(d.ref=n?u:l),c.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}_(v,`createSlot`);var y=Symbol.for(`radix.slottable`);function b(e){let t=_(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=y,t}_(b,`createSlottable`);var x=_((e,t)=>`child`in e.props?c.isValidElement(t)?c.cloneElement(t,void 0,e.props.children(t.props.children)):null:c.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function S(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=k(a,i))}return{...e,...n}}_(S,`mergeProps`);function C(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}_(C,`getElementRef`);function w(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===y}_(w,`isSlottable`);var T=Symbol.for(`react.lazy`);function E(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===T&&`_payload`in e&&D(e._payload)}_(E,`isLazyComponent`);function D(e){return typeof e==`object`&&!!e&&`then`in e}_(D,`isPromiseLike`);function O(e){let t=e;for(;E(t)&&typeof j==`function`;)t=j(t._payload);return t}_(O,`useUnwrappedLazy`);function k(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}_(k,`concatAriaDescribedby`);var ee=_(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),A=_(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),j=c.use,te=Object.defineProperty,M=(e,t)=>te(e,`name`,{value:t,configurable:!0}),N=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=v(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,m.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ne(e,t){e&&h.flushSync(()=>e.dispatchEvent(t))}M(ne,`dispatchDiscreteCustomEvent`);var re=Object.defineProperty,P=(e,t)=>re(e,`name`,{value:t,configurable:!0}),ie=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),ae=c.forwardRef(P(function(e,t){return(0,m.jsx)(N.span,{...e,ref:t,style:{...ie,...e.style}})},`VisuallyHidden`)),oe=Object.defineProperty,F=(e,t)=>oe(e,`name`,{value:t,configurable:!0});function se(e,t){let n=c.createContext(t);n.displayName=e+`Context`;let r=F(e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,m.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=c.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return F(i,`useContext`),[r,i]}F(se,`createContext`);function ce(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=F(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,m.jsx)(s.Provider,{value:l,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:l=!1}=s,u=o?.[e]?.[a]||i,d=c.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return F(s,`useContext`),[o,s]}F(r,`createContext`);let i=F(()=>{let t=n.map(e=>c.createContext(e));return F(function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,le(i,...t)]}F(ce,`createContextScope`);function le(...e){let t=e[0];if(e.length===1)return t;let n=F(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return F(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}F(le,`composeContextScopes`);var I=globalThis?.document?c.useLayoutEffect:()=>{},ue=Object.defineProperty,L=(e,t)=>ue(e,`name`,{value:t,configurable:!0});function de(e){let t=e+`CollectionProvider`,[n,r]=ce(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=L(e=>{let{scope:t,children:n}=e,r=c.useRef(null),a=c.useRef(new Map).current;return(0,m.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,l=v(s),u=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=p(t,a(s,n).collectionRef);return(0,m.jsx)(l,{ref:i,children:r})});u.displayName=s;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,h=v(d),g=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=p(t,o),l=a(d,n);return c.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,m.jsx)(h,{[f]:``,ref:s,children:r})});g.displayName=d;function _(t){let n=a(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return L(_,`useCollection`),[{Provider:o,Slot:u,ItemSlot:g},_,r]}L(de,`createCollection`);var fe=new WeakMap,pe=class e extends Map{static{L(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],fe.set(this,!0)}set(e,t){return fe.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=ge(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=me(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=me(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return me(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function me(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=he(e,t);return n===-1?void 0:e[n]}L(me,`at`);function he(e,t){let n=e.length,r=ge(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}L(he,`toSafeIndex`);function ge(e){return e!==e||e===0?0:Math.trunc(e)}L(ge,`toSafeInteger`);function _e(e){let t=e+`CollectionProvider`,[n,r]=ce(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let l=L(({state:e,...t})=>e?(0,m.jsx)(d,{...t,state:e}):(0,m.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=L(e=>{let t=x();return(0,m.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=L(e=>{let{scope:t,children:n,state:r}=e,a=c.useRef(null),[s,l]=c.useState(null),u=p(a,l),[d,f]=r,h=c.useRef(new pe),g=c.useCallback(()=>{let e=h.current;return be(e)||e.sort(xe),e},[]);return c.useEffect(()=>{if(!s)return;let e=Se(()=>{f(e=>{let t=e.toSorted(xe);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,f]),(0,m.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:g,setCollection:f,registryRef:h,children:(0,m.jsx)(o,{scope:t,collectionElement:s,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,h=v(f),g=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=p(t,a(f,n).collectionElementRef);return(0,m.jsx)(h,{ref:i,children:r})});g.displayName=f;let _=e+`CollectionItemSlot`,y=v(_),b=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),{setCollection:s,registryRef:l}=a(_,n),u=c.useRef(i);ve(u.current,i)||(u.current=i);let d=u.current,f=p(t,c.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):o.current&&t.delete(o.current)},[l]),o);I(()=>{let e=o.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let h=c.useRef(null);return c.useEffect(()=>{let e=o.current,t=h.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(h.current=e?{element:e,itemData:d}:null,s(n=>{let r=new pe(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(xe)}))}),c.useEffect(()=>()=>{let e=h.current;h.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new pe(t);return n.delete(e.element),n})},[s]),(0,m.jsx)(y,{"data-radix-collection-item":``,ref:f,children:r})});b.displayName=_;function x(){return c.useState(new pe)}L(x,`useInitCollection`);function S(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}L(S,`useCollection`);function C(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return L(C,`useGetCollection`),[{Provider:l,Slot:g,ItemSlot:b},{createCollectionScope:r,useCollection:S,useGetCollection:C,useInitCollection:x}]}L(_e,`createCollection`);function ve(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}L(ve,`shallowEqual`);function ye(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}L(ye,`isElementPreceding`);function be(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}L(be,`isInDocumentOrder`);function xe(e,t){return!e[1].element||!t[1].element?0:ye(e[1].element,t[1].element)?-1:1}L(xe,`sortByDocumentPosition`);function Se(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}L(Se,`getChildListObserver`);var Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0}),Te=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return we(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}we(R,`composeEventHandlers`);function Ee(e){if(!Te)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}we(Ee,`getOwnerWindow`);function De(e){if(!Te)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}we(De,`getOwnerDocument`);function Oe(e,t=!1){let{activeElement:n}=De(e);if(!n?.nodeName)return null;if(ke(n)&&n.contentDocument)return Oe(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=De(n).getElementById(e);if(t)return t}}return n}we(Oe,`getActiveElement`);function ke(e){return e.tagName===`IFRAME`}we(ke,`isFrame`);var Ae=Object.defineProperty,je=(e,t)=>Ae(e,`name`,{value:t,configurable:!0}),Me=c.useEffectEvent,Ne=c.useInsertionEffect;function Pe(e){if(typeof Me==`function`)return Me(e);let t=c.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ne==`function`?Ne(()=>{t.current=e}):I(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}je(Pe,`useEffectEvent`);var Fe=Object.defineProperty,Ie=(e,t)=>Fe(e,`name`,{value:t,configurable:!0}),Le=c.useInsertionEffect||I;function Re({prop:e,defaultProp:t,onChange:n=Ie(()=>{},`onChange`),caller:r}){let[i,a,o]=ze({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,c.useCallback(t=>{if(s){let n=Be(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ie(Re,`useControllableState`);function ze({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return Le(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ie(ze,`useUncontrolledState`);function Be(e){return typeof e==`function`}Ie(Be,`isFunction`);var Ve=Symbol(`RADIX:SYNC_STATE`);function He(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,l=i!==void 0,u=Pe(o),d=[{...n,state:a}];r&&d.push(r);let[f,p]=c.useReducer((t,n)=>{if(n.type===Ve)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=c.useRef(m);c.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=c.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return c.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:Ve,state:i})},[i,f.state,l]),[g,p]}Ie(He,`useControllableStateReducer`);var Ue=Object.defineProperty,We=(e,t)=>Ue(e,`name`,{value:t,configurable:!0});function Ge(e,t){return c.useReducer((e,n)=>t[e][n]??e,e)}We(Ge,`useStateMachine`);var Ke=We(e=>{let{present:t,children:n}=e,r=qe(t),i=typeof n==`function`?n({present:r.isPresent}):c.Children.only(n),a=Ye(r.ref,Ze(i));return typeof n==`function`||r.isPresent?c.cloneElement(i,{ref:a}):null},`Presence`);function qe(e){let[t,n]=c.useState(),r=c.useRef(null),i=c.useRef(e),a=c.useRef(`none`),o=c.useRef(void 0),[s,l]=Ge(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return c.useEffect(()=>{s===`mounted`?(a.current=o.current??Xe(r.current),o.current=void 0):a.current=`none`},[s]),I(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Xe(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),I(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=We(a=>{let o=Xe(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=We(e=>{e.target===t&&(a.current=Xe(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:c.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Xe(t)}else r.current=null;n(e)},[])}}We(qe,`usePresence`);function Je(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}We(Je,`setRef`);function Ye(...e){let t=c.useRef(e);return t.current=e,c.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Je(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Je(n[e],null)}}},[])}We(Ye,`useStableComposedRefs`);function Xe(e){return e?.animationName||`none`}We(Xe,`getAnimationName`);function Ze(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}We(Ze,`getElementRef`);var Qe=Object.defineProperty,$e=(e,t)=>Qe(e,`name`,{value:t,configurable:!0}),et=c.useId||(()=>void 0),tt=0;function nt(e){let[t,n]=c.useState(et());return I(()=>{e||n(e=>e??String(tt++))},[e]),e||(t?`radix-${t}`:``)}$e(nt,`useId`);var rt=Object.defineProperty,it=(e,t)=>rt(e,`name`,{value:t,configurable:!0}),at={LTR:`ltr`,RTL:`rtl`},ot=c.createContext(void 0);function st(e){let t=c.useContext(ot);return e||t||at.LTR}it(st,`useDirection`);var ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=c.useInsertionEffect;function z(e){let t=c.useRef(e);return typeof ut==`function`?ut(()=>{t.current=e}):I(()=>{t.current=e}),c.useMemo(()=>((...e)=>t.current?.(...e)),[])}lt(z,`useCallbackRef`);var dt=Object.defineProperty,B=(e,t)=>dt(e,`name`,{value:t,configurable:!0}),ft=`dismissableLayer.update`,pt=`dismissableLayer.pointerDownOutside`,mt=`dismissableLayer.focusOutside`,ht,gt=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),_t=c.forwardRef(B(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=c.useContext(gt),[f,h]=c.useState(null),g=f?.ownerDocument??globalThis?.document,[,_]=c.useState({}),v=p(t,h),y=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=b?y.indexOf(b):-1,S=f?y.indexOf(f):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=c.useRef(!1),E=bt(e=>{a?.(e),s?.(e),e.defaultPrevented||l?.()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:c.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return w&&!t},[d.branches,w])}),D=xt(e=>{if(r&&T.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},g),O=f?S===y.length-1:!1,k=z(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return c.useEffect(()=>{if(O)return g.addEventListener(`keydown`,k,{capture:!0}),()=>g.removeEventListener(`keydown`,k,{capture:!0})},[g,O,k]),c.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ht=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),St(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=ht))}},[f,g,n,d]),c.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),St())},[f,d]),c.useEffect(()=>{let e=B(()=>_({}),`handleUpdate`);return document.addEventListener(ft,e),()=>document.removeEventListener(ft,e)},[]),(0,m.jsx)(N.div,{...u,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,D.onFocusCapture),onBlurCapture:R(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,E.onPointerDownCapture)})},`DismissableLayer`));function vt(){let e=c.useContext(gt),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}B(vt,`useDismissableLayerSurface`);var yt=B(()=>!0,`IS_TRUE`);function bt(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=yt}=t,s=z(e),l=c.useRef(!1),u=c.useRef(!1),d=c.useRef(new Map),f=c.useRef(()=>{});return c.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}B(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}B(t,`isOutsideInteractionIntercepted`);function c(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}B(c,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}B(p,`handleInteractionBubble`);let m=B(a=>{if(a.target&&!l.current){let c=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||Ct(pt,s,p,{discrete:!0})};if(B(c,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?c():(n.removeEventListener(`click`,f.current),f.current=c,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,c,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,c,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:B(()=>l.current=!0,`onPointerDownCapture`)}}B(bt,`usePointerDownOutside`);function xt(e,t=globalThis?.document){let n=z(e),r=c.useRef(!1);return c.useEffect(()=>{let e=B(e=>{e.target&&!r.current&&Ct(mt,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:B(()=>r.current=!0,`onFocusCapture`),onBlurCapture:B(()=>r.current=!1,`onBlurCapture`)}}B(xt,`useFocusOutside`);function St(){let e=new CustomEvent(ft);document.dispatchEvent(e)}B(St,`dispatchUpdate`);function Ct(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ne(i,a):i.dispatchEvent(a)}B(Ct,`handleAndDispatchCustomEvent`);var wt=Object.defineProperty,V=(e,t)=>wt(e,`name`,{value:t,configurable:!0}),Tt=`focusScope.autoFocusOnMount`,Et=`focusScope.autoFocusOnUnmount`,Dt={bubbles:!1,cancelable:!0},Ot=c.forwardRef(V(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[l,u]=c.useState(null),d=z(a),f=z(o),h=c.useRef(null),g=p(t,u),_=c.useRef(i);c.useEffect(()=>{_.current=i});let v=c.useCallback(e=>e?l?.contains(e)?!0:!!_.current?.some(t=>t.contains(e)):!1,[l]),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(y.paused||!l)return;let t=e.target;v(t)?h.current=t:zt(h.current,{select:!0})},t=function(e){if(y.paused||!l)return;let t=e.relatedTarget;t!==null&&(v(t)||zt(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&zt(l)};V(e,`handleFocusIn`),V(t,`handleFocusOut`),V(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,y.paused,v]),c.useEffect(()=>{if(l){Bt.add(y);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Tt,Dt);l.addEventListener(Tt,d),l.dispatchEvent(t),t.defaultPrevented||(Nt(Ut(Ft(l)),{select:!0}),document.activeElement===e&&zt(l))}return()=>{l.removeEventListener(Tt,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Et,Dt);l.addEventListener(Et,f),l.dispatchEvent(r),r.defaultPrevented||zt(e??t.body,{select:!0}),l.removeEventListener(Et,f),Bt.remove(y)},0)}}},[l,d,f,y]);let b=c.useCallback(e=>{if(!n&&!r||y.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Pt(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&zt(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&zt(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,y.paused]);return(0,m.jsx)(N.div,{tabIndex:-1,...s,ref:g,onKeyDown:b})},`FocusScope`)),kt=c.createContext(null);function At({registry:e,children:t}){return e?(0,m.jsx)(kt.Provider,{value:e,children:t}):t}V(At,`FocusScopeBranchProvider`);function jt(){let[e,t]=c.useState([]);return{nodes:e,registry:c.useMemo(()=>({add:V(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:V(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}V(jt,`useFocusScopeBranchRegistry`);function Mt(e){let t=c.useContext(kt);c.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}V(Mt,`useFocusScopeBranch`);function Nt(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(zt(r,{select:t}),document.activeElement!==n)return}V(Nt,`focusFirst`);function Pt(e){let t=Ft(e);return[It(t,e),It(t.reverse(),e)]}V(Pt,`getTabbableEdges`);function Ft(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:V(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}V(Ft,`getTabbableCandidates`);function It(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Lt(r,{upTo:t})))return r}V(It,`findVisible`);function Lt(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}V(Lt,`isHidden`);function Rt(e){return e.tagName===`INPUT`&&typeof e.select==`function`}V(Rt,`isSelectableInput`);function zt(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Rt(e)&&t&&e.select()}}V(zt,`focus`);var Bt=Vt();function Vt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ht(e,t),e.unshift(t)},remove(t){e=Ht(e,t),e[0]?.resume()}}}V(Vt,`createFocusScopesStack`);function Ht(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}V(Ht,`arrayRemove`);function Ut(e){return e.filter(e=>e.tagName!==`A`)}V(Ut,`removeLinks`);var Wt=Object.defineProperty,Gt=c.forwardRef(((e,t)=>Wt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=c.useState(!1);I(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?h.createPortal((0,m.jsx)(N.div,{...r,ref:t}),o):null},`Portal`)),Kt=Object.defineProperty,qt=(e,t)=>Kt(e,`name`,{value:t,configurable:!0}),Jt=0,Yt=null;function Xt(e){return Zt(),e.children}qt(Xt,`FocusGuards`);function Zt(){c.useEffect(()=>{Yt||={start:Qt(),end:Qt()};let{start:e,end:t}=Yt;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Jt++,()=>{Jt===1&&(Yt?.start.remove(),Yt?.end.remove(),Yt=null),Jt=Math.max(0,Jt-1)}},[])}qt(Zt,`useFocusGuards`);function Qt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}qt(Qt,`createFocusGuard`);var H=function(){return H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},H.apply(this,arguments)};function $t(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function en(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var tn=`right-scroll-bar-position`,nn=`width-before-scroll-bar`,rn=`with-scroll-bars-hidden`,an=`--removed-body-scroll-bar-size`;function on(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function sn(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var cn=typeof window<`u`?c.useLayoutEffect:c.useEffect,ln=new WeakMap;function un(e,t){var n=sn(t||null,function(t){return e.forEach(function(e){return on(e,t)})});return cn(function(){var t=ln.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||on(e,null)}),i.forEach(function(e){r.has(e)||on(e,a)})}ln.set(n,e)},[e]),n}function dn(e){return e}function fn(e,t){t===void 0&&(t=dn);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function pn(e){e===void 0&&(e={});var t=fn(null);return t.options=H({async:!0,ssr:!1},e),t}var mn=function(e){var t=e.sideCar,n=$t(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,H({},n))};mn.isSideCarExport=!0;function hn(e,t){return e.useMedium(t),mn}var gn=pn(),_n=function(){},vn=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:_n,onWheelCapture:_n,onTouchMoveCapture:_n}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=$t(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=un([n,t]),w=H(H({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:gn,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),H(H({},w),{ref:C})):c.createElement(y,H({},w,{className:l,ref:C}),s))});vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vn.classNames={fullWidth:nn,zeroRight:tn};var yn=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function bn(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=yn();return t&&e.setAttribute(`nonce`,t),e}function xn(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Sn(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Cn=function(){var e=0,t=null;return{add:function(n){e==0&&(t=bn())&&(xn(t,n),Sn(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wn=function(){var e=Cn();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Tn=function(){var e=wn();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},En={left:0,top:0,right:0,gap:0},Dn=function(e){return parseInt(e||``,10)||0},On=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Dn(n),Dn(r),Dn(i)]},kn=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return En;var t=On(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},An=Tn(),jn=`data-scroll-locked`,Mn=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${rn} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -1 +1 @@
1
- import{c as e,d as t,g as n,n as r,o as i,t as a,u as o}from"./Menu-GG9F8t1A.js";import{Dt as s,Et as c,Ot as l,Ut as u,Zt as d,rn as f}from"./format-BVq_UI0J.js";var p={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};p.node;var m=c(p),h=f(),g=5;function _({crumbs:c,actions:f,className:p}){let{t:_}=l(`shell`),{sidebarOpen:v,toggleSidebar:y}=o(),b=d(),x=c.length>g?c.slice(1,-3):[],S=x.length?[c[0],`folded`,...c.slice(-3)]:c;return(0,h.jsxs)(`header`,{className:s(`flex h-[52px] shrink-0 items-center gap-2 border-b border-line px-3 sm:px-4`,p),children:[(0,h.jsx)(`div`,{className:s(v&&`min-[900px]:hidden`),children:(0,h.jsx)(t,{label:_(v?`header.hideSidebar`:`header.showSidebar`),keys:[`mod`,`\\`],children:(0,h.jsx)(`button`,{type:`button`,onClick:y,className:`grid size-8 place-items-center rounded-[8px] text-ink-3 hover:bg-hover hover:text-ink`,"aria-label":_(`header.toggleSidebar`),"aria-expanded":v,children:(0,h.jsx)(m,{className:`size-[17px]`})})})}),(0,h.jsx)(`nav`,{"aria-label":_(`header.breadcrumb`),className:`flex min-w-0 flex-1 items-center gap-1 text-[13px]`,children:S.map((t,o)=>{if(t===`folded`)return(0,h.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 max-sm:hidden`,children:[(0,h.jsxs)(i,{children:[(0,h.jsx)(e,{asChild:!0,children:(0,h.jsx)(`button`,{type:`button`,"aria-label":_(`header.moreCrumbs`),className:`grid h-7 w-7 place-items-center rounded-[6px] text-ink-3 hover:bg-hover hover:text-ink data-[state=open]:bg-hover`,children:(0,h.jsx)(n,{className:`size-4`})})}),(0,h.jsx)(a,{align:`start`,className:`max-h-[60vh] max-w-[320px] overflow-y-auto`,children:x.map((e,t)=>(0,h.jsx)(r,{onSelect:()=>e.to&&b(e.to),children:(0,h.jsx)(`span`,{className:`block truncate`,children:e.label})},t))})]}),(0,h.jsx)(`span`,{className:`text-ink-4`,children:`/`})]},`folded`);let c=o===S.length-1;return(0,h.jsxs)(`span`,{className:s(`flex min-w-0 items-center gap-1`,!c&&`max-sm:hidden`),children:[t.to&&!c?(0,h.jsx)(u,{to:t.to,className:`truncate rounded-[6px] px-1.5 py-1 text-ink-3 hover:bg-hover hover:text-ink`,children:t.label}):(0,h.jsx)(`span`,{className:s(`truncate px-1.5 py-1`,c?`font-medium text-ink`:`text-ink-3`),"aria-current":c?`page`:void 0,children:t.label}),!c&&(0,h.jsx)(`span`,{className:`text-ink-4`,children:`/`})]},o)})}),f&&(0,h.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:f})]})}export{_ as t};
1
+ import{c as e,d as t,g as n,n as r,o as i,t as a,u as o}from"./Menu-CzgZwzmu.js";import{Dt as s,Et as c,Ot as l,Ut as u,Zt as d,rn as f}from"./format-Dk1nO38Z.js";var p={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};p.node;var m=c(p),h=f(),g=5;function _({crumbs:c,actions:f,className:p}){let{t:_}=l(`shell`),{sidebarOpen:v,toggleSidebar:y}=o(),b=d(),x=c.length>g?c.slice(1,-3):[],S=x.length?[c[0],`folded`,...c.slice(-3)]:c;return(0,h.jsxs)(`header`,{className:s(`flex h-[52px] shrink-0 items-center gap-2 border-b border-line px-3 sm:px-4`,p),children:[(0,h.jsx)(`div`,{className:s(v&&`min-[900px]:hidden`),children:(0,h.jsx)(t,{label:_(v?`header.hideSidebar`:`header.showSidebar`),keys:[`mod`,`\\`],children:(0,h.jsx)(`button`,{type:`button`,onClick:y,className:`grid size-8 place-items-center rounded-[8px] text-ink-3 hover:bg-hover hover:text-ink`,"aria-label":_(`header.toggleSidebar`),"aria-expanded":v,children:(0,h.jsx)(m,{className:`size-[17px]`})})})}),(0,h.jsx)(`nav`,{"aria-label":_(`header.breadcrumb`),className:`flex min-w-0 flex-1 items-center gap-1 text-[13px]`,children:S.map((t,o)=>{if(t===`folded`)return(0,h.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 max-sm:hidden`,children:[(0,h.jsxs)(i,{children:[(0,h.jsx)(e,{asChild:!0,children:(0,h.jsx)(`button`,{type:`button`,"aria-label":_(`header.moreCrumbs`),className:`grid h-7 w-7 place-items-center rounded-[6px] text-ink-3 hover:bg-hover hover:text-ink data-[state=open]:bg-hover`,children:(0,h.jsx)(n,{className:`size-4`})})}),(0,h.jsx)(a,{align:`start`,className:`max-h-[60vh] max-w-[320px] overflow-y-auto`,children:x.map((e,t)=>(0,h.jsx)(r,{onSelect:()=>e.to&&b(e.to),children:(0,h.jsx)(`span`,{className:`block truncate`,children:e.label})},t))})]}),(0,h.jsx)(`span`,{className:`text-ink-4`,children:`/`})]},`folded`);let c=o===S.length-1;return(0,h.jsxs)(`span`,{className:s(`flex min-w-0 items-center gap-1`,!c&&`max-sm:hidden`),children:[t.to&&!c?(0,h.jsx)(u,{to:t.to,className:`truncate rounded-[6px] px-1.5 py-1 text-ink-3 hover:bg-hover hover:text-ink`,children:t.label}):(0,h.jsx)(`span`,{className:s(`truncate px-1.5 py-1`,c?`font-medium text-ink`:`text-ink-3`),"aria-current":c?`page`:void 0,children:t.label}),!c&&(0,h.jsx)(`span`,{className:`text-ink-4`,children:`/`})]},o)})}),f&&(0,h.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:f})]})}export{_ as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Bt as t,Dt as n,G as r,J as i,Ot as a,X as o,Y as s,Z as c,in as l,q as u,rn as d}from"./format-BVq_UI0J.js";var f=e(l(),1),p=d(),m=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}ー]/u,h=/[\p{L}\p{N}]/u,g=e=>e!==void 0&&h.test(e)&&!m.test(e),_=new Intl.Segmenter(`ja`,{granularity:`grapheme`});function v(e,t){let n=new Set(Array.from(_.segment(e),e=>e.index)),r=[],i=0;for(let a of t(e)){let e=r.at(-1);e!==void 0&&(!n.has(i)||g([...e].at(-1))&&g([...a][0]))?r[r.length-1]=e+a:r.push(a),i+=a.length}return r}var y=(e,t)=>r(e)??c(e,v(e,t));function b(e,{cache:n=!0}={}){a();let r=t.resolvedLanguage===`ja`&&m.test(e),c=(0,f.useSyncExternalStore)(s,o,o);return(0,f.useEffect)(()=>{r&&u()},[r]),r?i?`native`:c?n?y(e,c):v(e,c):null:null}var x=(e,t,n)=>e.slice(t,n)||null;function S(e,t,n){let r=0;return(t??[e]).map((e,t)=>{let i=r;r+=e.length;let a=Math.max(n?.[0]??0,i)-i,o=Math.min(n?.[1]??0,r)-i;return(0,p.jsxs)(f.Fragment,{children:[t>0&&(0,p.jsx)(`wbr`,{}),a<o?(0,p.jsxs)(p.Fragment,{children:[x(e,0,a),(0,p.jsx)(`span`,{className:`italic`,children:e.slice(a,o)}),x(e,o)]}):e]},t)})}function C({text:e,cache:t,italic:n}){let r=b(e,{cache:t});return r===null?n?S(e,null,n):e:(0,p.jsx)(`span`,{className:`orq-phrases`,children:S(e,r===`native`?null:r,n)})}function w(e,t=`name`){let[n,r]=[`<${t}>`,`</${t}>`],i=e.indexOf(n),a=e.lastIndexOf(r);if(i<0||a<i+n.length)return[e,void 0];let o=e.slice(i+n.length,a);return[e.slice(0,i)+o+e.slice(a+r.length),[i,i+o.length]]}function T(e,t,n){let r={offset:0,distance:1/0},i=0,a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=document.createRange();for(let e=a.nextNode();e;e=a.nextNode()){let a=e.textContent??``;for(let{index:s,segment:c}of _.segment(a)){o.setStart(e,s),o.setEnd(e,s+c.length);let a=o.getBoundingClientRect();if(a.width===0&&a.height===0)continue;let l=t<a.left?a.left-t:t>a.right?t-a.right:0,u=(n<a.top?a.top-n:n>a.bottom?n-a.bottom:0)*1e4+l;u<r.distance&&(r={offset:i+s+(t>a.left+a.width/2?c.length:0),distance:u})}i+=a.length}return r.offset}function E(e){if(!e)return;e.style.minHeight=`0`,e.style.height=`0`;let t=e.scrollHeight;e.style.height=``,e.style.minHeight=`${t}px`}function D(e,t){let[r,i]=(0,f.useState)(null),a=b(r??e),o=(0,f.useRef)(null),s=(0,f.useRef)(null),c=Array.isArray(a),l=c&&r===null;return{hidden:l,onFocus:()=>i(e),onBlur:()=>i(null),onPointerDown:e=>{s.current=l&&o.current?T(o.current,e.clientX,e.clientY):null},onClick:e=>{let t=e.currentTarget,n=s.current;s.current=null,n!==null&&t.selectionStart===t.selectionEnd&&t.setSelectionRange(n,n)},overlay:c?(0,p.jsx)(`div`,{ref:o,"aria-hidden":`true`,className:n(`pointer-events-none orq-phrases whitespace-pre-wrap [grid-area:1/1]`,t,r!==null&&`invisible`),children:S(r??e,a)}):null}}export{w as i,E as n,D as r,C as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Bt as t,Dt as n,G as r,J as i,Ot as a,X as o,Y as s,Z as c,in as l,q as u,rn as d}from"./format-Dk1nO38Z.js";var f=e(l(),1),p=d(),m=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}ー]/u,h=/[\p{L}\p{N}]/u,g=e=>e!==void 0&&h.test(e)&&!m.test(e),_=new Intl.Segmenter(`ja`,{granularity:`grapheme`});function v(e,t){let n=new Set(Array.from(_.segment(e),e=>e.index)),r=[],i=0;for(let a of t(e)){let e=r.at(-1);e!==void 0&&(!n.has(i)||g([...e].at(-1))&&g([...a][0]))?r[r.length-1]=e+a:r.push(a),i+=a.length}return r}var y=(e,t)=>r(e)??c(e,v(e,t));function b(e,{cache:n=!0}={}){a();let r=t.resolvedLanguage===`ja`&&m.test(e),c=(0,f.useSyncExternalStore)(s,o,o);return(0,f.useEffect)(()=>{r&&u()},[r]),r?i?`native`:c?n?y(e,c):v(e,c):null:null}var x=(e,t,n)=>e.slice(t,n)||null;function S(e,t,n){let r=0;return(t??[e]).map((e,t)=>{let i=r;r+=e.length;let a=Math.max(n?.[0]??0,i)-i,o=Math.min(n?.[1]??0,r)-i;return(0,p.jsxs)(f.Fragment,{children:[t>0&&(0,p.jsx)(`wbr`,{}),a<o?(0,p.jsxs)(p.Fragment,{children:[x(e,0,a),(0,p.jsx)(`span`,{className:`italic`,children:e.slice(a,o)}),x(e,o)]}):e]},t)})}function C({text:e,cache:t,italic:n}){let r=b(e,{cache:t});return r===null?n?S(e,null,n):e:(0,p.jsx)(`span`,{className:`orq-phrases`,children:S(e,r===`native`?null:r,n)})}function w(e,t=`name`){let[n,r]=[`<${t}>`,`</${t}>`],i=e.indexOf(n),a=e.lastIndexOf(r);if(i<0||a<i+n.length)return[e,void 0];let o=e.slice(i+n.length,a);return[e.slice(0,i)+o+e.slice(a+r.length),[i,i+o.length]]}function T(e,t,n){let r={offset:0,distance:1/0},i=0,a=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),o=document.createRange();for(let e=a.nextNode();e;e=a.nextNode()){let a=e.textContent??``;for(let{index:s,segment:c}of _.segment(a)){o.setStart(e,s),o.setEnd(e,s+c.length);let a=o.getBoundingClientRect();if(a.width===0&&a.height===0)continue;let l=t<a.left?a.left-t:t>a.right?t-a.right:0,u=(n<a.top?a.top-n:n>a.bottom?n-a.bottom:0)*1e4+l;u<r.distance&&(r={offset:i+s+(t>a.left+a.width/2?c.length:0),distance:u})}i+=a.length}return r.offset}function E(e){if(!e)return;e.style.minHeight=`0`,e.style.height=`0`;let t=e.scrollHeight;e.style.height=``,e.style.minHeight=`${t}px`}function D(e,t){let[r,i]=(0,f.useState)(null),a=b(r??e),o=(0,f.useRef)(null),s=(0,f.useRef)(null),c=Array.isArray(a),l=c&&r===null;return{hidden:l,onFocus:()=>i(e),onBlur:()=>i(null),onPointerDown:e=>{s.current=l&&o.current?T(o.current,e.clientX,e.clientY):null},onClick:e=>{let t=e.currentTarget,n=s.current;s.current=null,n!==null&&t.selectionStart===t.selectionEnd&&t.setSelectionRange(n,n)},overlay:c?(0,p.jsx)(`div`,{ref:o,"aria-hidden":`true`,className:n(`pointer-events-none orq-phrases whitespace-pre-wrap [grid-area:1/1]`,t,r!==null&&`invisible`),children:S(r??e,a)}):null}}export{w as i,E as n,D as r,C as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,Et as n,in as r,rn as i}from"./format-Dk1nO38Z.js";import{F as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,P as p,R as m,U as h,V as g,W as _,X as v,_ as y,b,j as x,q as S,v as C,y as w,z as T}from"./Menu-CzgZwzmu.js";import{c as E}from"./dist-DFO0RDUp.js";var D=e(r(),1),O=i(),k=Object.defineProperty,A=(e,t)=>k(e,`name`,{value:t,configurable:!0}),j=`Popover`,[M,ee]=l(j,[b]),N=b(),[P,F]=M(j),I=A(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=N(t),c=D.useRef(null),[l,u]=D.useState(!1),[d,f]=D.useState(0),[p,m]=D.useState(0),[_,v]=h({prop:r,defaultProp:i??!1,onChange:a,caller:j});return(0,O.jsx)(y,{...s,children:(0,O.jsx)(P,{scope:t,contentId:g(),titleId:g(),descriptionId:g(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:_,onOpenChange:v,onOpenToggle:D.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:l,onCustomAnchorAdd:D.useCallback(()=>u(!0),[]),onCustomAnchorRemove:D.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),L=`PopoverTrigger`,R=D.forwardRef(A(function(e,t){let{__scopePopover:n,...r}=e,i=F(L,n),a=N(n),o=v(t,i.triggerRef),s=(0,O.jsx)(S.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Y(i.open),...r,ref:o,onClick:_(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,O.jsx)(C,{asChild:!0,...a,children:s})},`PopoverTrigger`)),z=`PopoverPortal`,[B,V]=M(z,{forceMount:void 0}),H=A(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=F(z,t);return(0,O.jsx)(B,{scope:t,forceMount:n,children:(0,O.jsx)(o,{present:n||a.open,children:(0,O.jsx)(p,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),U=`PopoverContent`,W=D.forwardRef(A(function(e,t){let n=V(U,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=F(U,e.__scopePopover);return(0,O.jsx)(o,{present:r||a.open,children:a.modal?(0,O.jsx)(K,{...i,ref:t}):(0,O.jsx)(q,{...i,ref:t})})},`PopoverContent`)),G=c(`PopoverContent.RemoveScroll`),K=D.forwardRef(A(function(e,t){let n=F(U,e.__scopePopover),r=D.useRef(null),i=v(t,r),a=D.useRef(!1),{nodes:o,registry:s}=m();return D.useEffect(()=>{let e=r.current;if(e)return x(e)},[]),(0,O.jsx)(d,{as:G,allowPinchZoom:!0,shards:D.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,O.jsx)(J,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:_(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),q=D.forwardRef(A(function(e,t){let n=F(U,e.__scopePopover),r=D.useRef(!1),i=D.useRef(!1);return(0,O.jsx)(J,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),J=D.forwardRef(A(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,"aria-describedby":h,branchNodes:g,branchRegistry:_,...y}=e,b=F(U,n),x=N(n),[S,C]=D.useState(null),E=v(t,C);return u(S),f(),(0,O.jsx)(s,{registry:_,children:(0,O.jsx)(a,{asChild:!0,loop:!0,trapped:r,branches:g,onMountAutoFocus:i,onUnmountAutoFocus:o,children:(0,O.jsx)(T,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:m,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:p,onDismiss:()=>b.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,O.jsx)(w,{"data-state":Y(b.open),role:`dialog`,id:b.contentId,"aria-labelledby":b.titlePresent?b.titleId:void 0,"aria-describedby":b.descriptionPresent?X(h,b.descriptionId):h,...x,...y,ref:E,style:{...y.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function Y(e){return e?`open`:`closed`}A(Y,`getState`);function X(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}A(X,`concatAriaDescribedby`);var Z={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Z.node;var Q=n(Z);function $({trigger:e,children:n,open:r,onOpenChange:i,align:a=`start`,className:o}){return(0,O.jsxs)(I,{open:r,onOpenChange:i,children:[(0,O.jsx)(R,{asChild:!0,children:e}),(0,O.jsx)(H,{children:(0,O.jsx)(W,{align:a,sideOffset:6,collisionPadding:12,onEscapeKeyDown:E,className:t(`z-50 rounded-[14px] border border-line bg-surface p-2 shadow-lg outline-none`,o),children:n})})]})}export{Q as n,$ as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./file-plus-BJ5sZ4_S.js";import{n,t as r}from"./square-kanban-WA9_EY-N.js";import{t as i}from"./pencil-DL6HUNUM.js";import{t as a}from"./plus-Hg2QI8YW.js";import{t as o}from"./trash-COg6vRm8.js";import{Dt as s,Ot as c,Qt as l,Ut as u,f as d,in as f,p,rn as m}from"./format-BVq_UI0J.js";import{t as h}from"./Phrases-DftRflqk.js";import{n as g,t as _}from"./ProjectSettingsDialog-CucUzCi8.js";import{t as v}from"./Button-CaaiSWVd.js";import{n as y}from"./ColorPicker-CgNvcSm7.js";import{t as b}from"./PageHeader-CE8sCm7O.js";import{t as x}from"./actions-B4SD3ZSA.js";import{n as S}from"./States-BfRfXN15.js";import{u as C}from"./Menu-GG9F8t1A.js";var w=e(f(),1),T=m();function E(){let{t:e}=c([`projects`,`docs`]),{projectId:f}=l(),{workspaceId:m,overview:E}=C(),D=x(m),[O,k]=(0,w.useState)(!1),A=E?.projects.find(e=>e.id===f);if(!E)return(0,T.jsx)(`div`,{className:`p-10`,children:(0,T.jsx)(`div`,{className:`skeleton h-10 w-1/3`})});if(!A)return(0,T.jsx)(S,{});let j=A.pages.filter(e=>e.parentId===null),M=e=>A.pages.filter(t=>t.parentId===e).length,N=[...A.pages].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).slice(0,5),P=y(A.color);return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsx)(b,{crumbs:[{label:A.name}],actions:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(v,{variant:`ghost`,size:`sm`,icon:(0,T.jsx)(i,{}),onClick:()=>k(!0),children:(0,T.jsx)(`span`,{className:`max-sm:sr-only`,children:e(`edit`)})}),(0,T.jsx)(v,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:(0,T.jsx)(o,{}),"aria-label":e(`delete`),onClick:()=>void D.deleteProject(A)})]})}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,T.jsxs)(`div`,{className:`mx-auto w-full max-w-[1040px] px-6 py-10 sm:px-10`,children:[(0,T.jsxs)(`div`,{className:`animate-rise flex items-start gap-4`,children:[(0,T.jsx)(g,{color:A.color,className:`size-12 rounded-[12px] text-[22px]`,children:d(A.name)}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h1`,{className:`font-display text-[34px] leading-tight font-medium tracking-[-0.02em]`,children:(0,T.jsx)(h,{text:A.name})}),(0,T.jsx)(`p`,{className:`mt-1 text-[14px] text-ink-2`,children:A.description||e(`summary`,{boards:e(`boardCount`,{count:A.boards.length}),pages:e(`pageCount`,{count:A.pages.length})})})]})]}),(0,T.jsxs)(`section`,{className:`mt-10`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsx)(`h2`,{className:`text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e(`boards.title`)}),(0,T.jsx)(v,{size:`sm`,variant:`ghost`,icon:(0,T.jsx)(a,{}),onClick:()=>void D.createBoard(A.id),children:e(`boards.new`)})]}),A.boards.length?(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:A.boards.map((t,n)=>(0,T.jsxs)(u,{to:`/w/${m}/b/${t.id}`,style:{animationDelay:`${n*40}ms`},className:`animate-rise group relative overflow-hidden rounded-[14px] border border-line bg-surface p-4 shadow-sm transition-all hover:-translate-y-0.5 hover:border-line-strong hover:shadow-md`,children:[(0,T.jsx)(`div`,{className:`mb-6 flex gap-1.5`,"aria-hidden":`true`,children:[.9,.6,.35].map((e,t)=>(0,T.jsx)(`span`,{className:s(`h-10 flex-1 rounded-[6px] bg-sunken`,P.className),style:{...P.style,boxShadow:`inset 0 3px 0 color-mix(in oklab, var(--c) ${e*100}%, transparent)`}},t))}),(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[14.5px] font-semibold`,children:[(0,T.jsx)(r,{className:`size-4 shrink-0 text-ink-3`}),(0,T.jsx)(`span`,{className:`min-w-0`,children:(0,T.jsx)(h,{text:t.name})})]}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:e(`boards.openCards`,{count:t.cardCount})})]},t.id))}):(0,T.jsx)(`button`,{type:`button`,onClick:()=>void D.createBoard(A.id),className:`w-full rounded-[14px] border border-dashed border-line-strong px-5 py-8 text-center text-[13.5px] text-ink-3 transition-colors hover:border-ink-3 hover:text-ink-2`,children:e(`boards.empty`)})]}),(0,T.jsxs)(`section`,{className:`mt-10`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsx)(`h2`,{className:`text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e(`docs.title`)}),(0,T.jsx)(v,{size:`sm`,variant:`ghost`,icon:(0,T.jsx)(t,{}),onClick:()=>void D.createPage(A.id),children:e(`docs.new`)})]}),j.length?(0,T.jsx)(`ul`,{className:`overflow-hidden rounded-[14px] border border-line bg-surface shadow-sm`,children:j.map(t=>(0,T.jsx)(`li`,{className:`border-b border-line last:border-b-0`,children:(0,T.jsxs)(u,{to:`/w/${m}/d/${t.id}`,className:`flex items-center gap-3 px-4 py-3 transition-colors hover:bg-hover`,children:[(0,T.jsx)(`span`,{className:`w-5 text-center text-[16px]`,children:t.icon??(0,T.jsx)(n,{className:`size-4 text-ink-3`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[14px] font-medium`,children:t.title||e(`untitled`,{ns:`common`})}),M(t.id)>0&&(0,T.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:e(`docs.subpages`,{count:M(t.id)})})]})},t.id))}):(0,T.jsx)(`button`,{type:`button`,onClick:()=>void D.createPage(A.id),className:`w-full rounded-[14px] border border-dashed border-line-strong px-5 py-8 text-center text-[13.5px] text-ink-3 transition-colors hover:border-ink-3 hover:text-ink-2`,children:e(`docs.empty`)})]}),N.length>0&&(0,T.jsxs)(`section`,{className:`mt-10`,children:[(0,T.jsx)(`h2`,{className:`mb-3 text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e(`recent`)}),(0,T.jsx)(`ul`,{className:`overflow-hidden rounded-[14px] border border-line bg-surface shadow-sm`,children:N.map(t=>(0,T.jsx)(`li`,{className:`border-b border-line last:border-b-0`,children:(0,T.jsxs)(u,{to:`/w/${m}/d/${t.id}`,className:`flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-hover`,children:[(0,T.jsx)(`span`,{className:`w-5 text-center text-[15px]`,children:t.icon??(0,T.jsx)(n,{className:`size-4 text-ink-3`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13.5px]`,children:t.title||e(`untitled`,{ns:`common`})}),(0,T.jsx)(`span`,{className:`shrink-0 text-[12px] text-ink-3`,children:p(t.updatedAt)})]})},t.id))})]})]})}),(0,T.jsx)(_,{project:A,open:O,onOpenChange:k})]})}export{E as ProjectPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{t}from"./file-plus-B9m4uZcE.js";import{n,t as r}from"./square-kanban-Cd_tPOtx.js";import{t as i}from"./pencil-C37OTkSN.js";import{t as a}from"./plus-DcOCeQtr.js";import{t as o}from"./trash-CkQBpprn.js";import{Dt as s,Ot as c,Qt as l,Ut as u,f as d,in as f,p,rn as m}from"./format-Dk1nO38Z.js";import{t as h}from"./Phrases-C89QdC4L.js";import{n as g,t as _}from"./ProjectSettingsDialog-ekHTFmaO.js";import{t as v}from"./Button-CHkkj3LG.js";import{n as y}from"./ColorPicker-DSVbH2ix.js";import{t as b}from"./PageHeader-DJdrnGpr.js";import{t as x}from"./actions-TwDLbdln.js";import{n as S}from"./States-D9T0E3QG.js";import{u as C}from"./Menu-CzgZwzmu.js";var w=e(f(),1),T=m();function E(){let{t:e}=c([`projects`,`docs`]),{projectId:f}=l(),{workspaceId:m,overview:E}=C(),D=x(m),[O,k]=(0,w.useState)(!1),A=E?.projects.find(e=>e.id===f);if(!E)return(0,T.jsx)(`div`,{className:`p-10`,children:(0,T.jsx)(`div`,{className:`skeleton h-10 w-1/3`})});if(!A)return(0,T.jsx)(S,{});let j=A.pages.filter(e=>e.parentId===null),M=e=>A.pages.filter(t=>t.parentId===e).length,N=[...A.pages].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt)).slice(0,5),P=y(A.color);return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsx)(b,{crumbs:[{label:A.name}],actions:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(v,{variant:`ghost`,size:`sm`,icon:(0,T.jsx)(i,{}),onClick:()=>k(!0),children:(0,T.jsx)(`span`,{className:`max-sm:sr-only`,children:e(`edit`)})}),(0,T.jsx)(v,{variant:`ghost`,size:`sm`,iconOnly:!0,icon:(0,T.jsx)(o,{}),"aria-label":e(`delete`),onClick:()=>void D.deleteProject(A)})]})}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,T.jsxs)(`div`,{className:`mx-auto w-full max-w-[1040px] px-6 py-10 sm:px-10`,children:[(0,T.jsxs)(`div`,{className:`animate-rise flex items-start gap-4`,children:[(0,T.jsx)(g,{color:A.color,className:`size-12 rounded-[12px] text-[22px]`,children:d(A.name)}),(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h1`,{className:`font-display text-[34px] leading-tight font-medium tracking-[-0.02em]`,children:(0,T.jsx)(h,{text:A.name})}),(0,T.jsx)(`p`,{className:`mt-1 text-[14px] text-ink-2`,children:A.description||e(`summary`,{boards:e(`boardCount`,{count:A.boards.length}),pages:e(`pageCount`,{count:A.pages.length})})})]})]}),(0,T.jsxs)(`section`,{className:`mt-10`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsx)(`h2`,{className:`text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e(`boards.title`)}),(0,T.jsx)(v,{size:`sm`,variant:`ghost`,icon:(0,T.jsx)(a,{}),onClick:()=>void D.createBoard(A.id),children:e(`boards.new`)})]}),A.boards.length?(0,T.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:A.boards.map((t,n)=>(0,T.jsxs)(u,{to:`/w/${m}/b/${t.id}`,style:{animationDelay:`${n*40}ms`},className:`animate-rise group relative overflow-hidden rounded-[14px] border border-line bg-surface p-4 shadow-sm transition-all hover:-translate-y-0.5 hover:border-line-strong hover:shadow-md`,children:[(0,T.jsx)(`div`,{className:`mb-6 flex gap-1.5`,"aria-hidden":`true`,children:[.9,.6,.35].map((e,t)=>(0,T.jsx)(`span`,{className:s(`h-10 flex-1 rounded-[6px] bg-sunken`,P.className),style:{...P.style,boxShadow:`inset 0 3px 0 color-mix(in oklab, var(--c) ${e*100}%, transparent)`}},t))}),(0,T.jsxs)(`p`,{className:`flex items-center gap-2 text-[14.5px] font-semibold`,children:[(0,T.jsx)(r,{className:`size-4 shrink-0 text-ink-3`}),(0,T.jsx)(`span`,{className:`min-w-0`,children:(0,T.jsx)(h,{text:t.name})})]}),(0,T.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:e(`boards.openCards`,{count:t.cardCount})})]},t.id))}):(0,T.jsx)(`button`,{type:`button`,onClick:()=>void D.createBoard(A.id),className:`w-full rounded-[14px] border border-dashed border-line-strong px-5 py-8 text-center text-[13.5px] text-ink-3 transition-colors hover:border-ink-3 hover:text-ink-2`,children:e(`boards.empty`)})]}),(0,T.jsxs)(`section`,{className:`mt-10`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsx)(`h2`,{className:`text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e(`docs.title`)}),(0,T.jsx)(v,{size:`sm`,variant:`ghost`,icon:(0,T.jsx)(t,{}),onClick:()=>void D.createPage(A.id),children:e(`docs.new`)})]}),j.length?(0,T.jsx)(`ul`,{className:`overflow-hidden rounded-[14px] border border-line bg-surface shadow-sm`,children:j.map(t=>(0,T.jsx)(`li`,{className:`border-b border-line last:border-b-0`,children:(0,T.jsxs)(u,{to:`/w/${m}/d/${t.id}`,className:`flex items-center gap-3 px-4 py-3 transition-colors hover:bg-hover`,children:[(0,T.jsx)(`span`,{className:`w-5 text-center text-[16px]`,children:t.icon??(0,T.jsx)(n,{className:`size-4 text-ink-3`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[14px] font-medium`,children:t.title||e(`untitled`,{ns:`common`})}),M(t.id)>0&&(0,T.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:e(`docs.subpages`,{count:M(t.id)})})]})},t.id))}):(0,T.jsx)(`button`,{type:`button`,onClick:()=>void D.createPage(A.id),className:`w-full rounded-[14px] border border-dashed border-line-strong px-5 py-8 text-center text-[13.5px] text-ink-3 transition-colors hover:border-ink-3 hover:text-ink-2`,children:e(`docs.empty`)})]}),N.length>0&&(0,T.jsxs)(`section`,{className:`mt-10`,children:[(0,T.jsx)(`h2`,{className:`mb-3 text-[11.5px] font-semibold tracking-[0.08em] text-ink-3 uppercase`,children:e(`recent`)}),(0,T.jsx)(`ul`,{className:`overflow-hidden rounded-[14px] border border-line bg-surface shadow-sm`,children:N.map(t=>(0,T.jsx)(`li`,{className:`border-b border-line last:border-b-0`,children:(0,T.jsxs)(u,{to:`/w/${m}/d/${t.id}`,className:`flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-hover`,children:[(0,T.jsx)(`span`,{className:`w-5 text-center text-[15px]`,children:t.icon??(0,T.jsx)(n,{className:`size-4 text-ink-3`})}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13.5px]`,children:t.title||e(`untitled`,{ns:`common`})}),(0,T.jsx)(`span`,{className:`shrink-0 text-[12px] text-ink-3`,children:p(t.updatedAt)})]})},t.id))})]})]})}),(0,T.jsx)(_,{project:A,open:O,onOpenChange:k})]})}export{E as ProjectPage};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,Ot as n,S as r,at as i,in as a,nt as o,rn as s,x as c}from"./format-BVq_UI0J.js";import{t as l}from"./Button-CaaiSWVd.js";import{a as u,n as d}from"./dist-BsPSSv6i.js";import{t as f}from"./Field-BHRDucE9.js";import{n as p,t as m}from"./ColorPicker-CgNvcSm7.js";var h=s();function g({color:e,className:n,children:r}){let i=p(e);return(0,h.jsx)(`span`,{className:t(`glyph`,i.className,n),style:i.style,children:r})}var _=e(a(),1);function v({project:e,open:t,onOpenChange:a}){let{t:s}=n([`shell`,`common`]),[p,g]=(0,_.useState)(e.name),[v,y]=(0,_.useState)(e.description??``),[b,x]=(0,_.useState)(e.color),[S,C]=(0,_.useState)(!1);(0,_.useEffect)(()=>{t&&(g(e.name),y(e.description??``),x(e.color))},[t,e]);async function w(t){t.preventDefault(),C(!0);try{await i(`/projects/${e.id}`,{name:p.trim(),color:b,description:v.trim()}),await r.invalidateQueries({queryKey:c.overview(e.workspaceId)}),a(!1)}catch(e){d.error(o(e))}finally{C(!1)}}return(0,h.jsx)(u,{open:t,onOpenChange:a,title:s(`projectSettings.title`),children:(0,h.jsxs)(`form`,{onSubmit:w,className:`flex flex-col gap-5`,children:[(0,h.jsx)(f,{label:s(`projectSettings.name`),value:p,onChange:e=>g(e.target.value),maxLength:80,autoFocus:!0}),(0,h.jsx)(f,{label:s(`projectSettings.description`),value:v,onChange:e=>y(e.target.value),maxLength:500,placeholder:s(`projectSettings.optional`)}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(`span`,{className:`text-[12.5px] font-medium text-ink-2`,children:s(`projectSettings.color`)}),(0,h.jsx)(m,{value:b,onChange:x,custom:!0})]}),(0,h.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,h.jsx)(l,{variant:`ghost`,onClick:()=>a(!1),children:s(`common:actions.cancel`)}),(0,h.jsx)(l,{type:`submit`,variant:`primary`,loading:S,disabled:!p.trim(),children:s(`common:actions.save`)})]})]})})}export{g as n,v as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Dt as t,Ot as n,S as r,at as i,in as a,nt as o,rn as s,x as c}from"./format-Dk1nO38Z.js";import{t as l}from"./Button-CHkkj3LG.js";import{a as u,n as d}from"./dist-DFO0RDUp.js";import{t as f}from"./Field-BsUKJQ-4.js";import{n as p,t as m}from"./ColorPicker-DSVbH2ix.js";var h=s();function g({color:e,className:n,children:r}){let i=p(e);return(0,h.jsx)(`span`,{className:t(`glyph`,i.className,n),style:i.style,children:r})}var _=e(a(),1);function v({project:e,open:t,onOpenChange:a}){let{t:s}=n([`shell`,`common`]),[p,g]=(0,_.useState)(e.name),[v,y]=(0,_.useState)(e.description??``),[b,x]=(0,_.useState)(e.color),[S,C]=(0,_.useState)(!1);(0,_.useEffect)(()=>{t&&(g(e.name),y(e.description??``),x(e.color))},[t,e]);async function w(t){t.preventDefault(),C(!0);try{await i(`/projects/${e.id}`,{name:p.trim(),color:b,description:v.trim()}),await r.invalidateQueries({queryKey:c.overview(e.workspaceId)}),a(!1)}catch(e){d.error(o(e))}finally{C(!1)}}return(0,h.jsx)(u,{open:t,onOpenChange:a,title:s(`projectSettings.title`),children:(0,h.jsxs)(`form`,{onSubmit:w,className:`flex flex-col gap-5`,children:[(0,h.jsx)(f,{label:s(`projectSettings.name`),value:p,onChange:e=>g(e.target.value),maxLength:80,autoFocus:!0}),(0,h.jsx)(f,{label:s(`projectSettings.description`),value:v,onChange:e=>y(e.target.value),maxLength:500,placeholder:s(`projectSettings.optional`)}),(0,h.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,h.jsx)(`span`,{className:`text-[12.5px] font-medium text-ink-2`,children:s(`projectSettings.color`)}),(0,h.jsx)(m,{value:b,onChange:x,custom:!0})]}),(0,h.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,h.jsx)(l,{variant:`ghost`,onClick:()=>a(!1),children:s(`common:actions.cancel`)}),(0,h.jsx)(l,{type:`submit`,variant:`primary`,loading:S,disabled:!p.trim(),children:s(`common:actions.save`)})]})]})})}export{g as n,v as t};
@@ -1 +1 @@
1
- import{Dt as e,rn as t}from"./format-BVq_UI0J.js";var n=t();function r({value:t,onChange:r,options:i,label:a,size:o=`md`}){return(0,n.jsx)(`div`,{role:`radiogroup`,"aria-label":a,className:`inline-flex rounded-[10px] bg-sunken p-0.5 shadow-[inset_0_0_0_1px_var(--line)]`,children:i.map(i=>(0,n.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===i.value,"aria-label":i.name,onClick:()=>r(i.value),className:e(`rounded-[8px] font-medium transition-all duration-150`,o===`sm`?`h-6.5 px-2.5 text-[12px]`:`h-7.5 px-3 text-[13px]`,t===i.value?`bg-surface text-ink shadow-sm`:`text-ink-3 hover:text-ink`),children:i.label},i.value))})}export{r as t};
1
+ import{Dt as e,rn as t}from"./format-Dk1nO38Z.js";var n=t();function r({value:t,onChange:r,options:i,label:a,size:o=`md`}){return(0,n.jsx)(`div`,{role:`radiogroup`,"aria-label":a,className:`inline-flex rounded-[10px] bg-sunken p-0.5 shadow-[inset_0_0_0_1px_var(--line)]`,children:i.map(i=>(0,n.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":t===i.value,"aria-label":i.name,onClick:()=>r(i.value),className:e(`rounded-[8px] font-medium transition-all duration-150`,o===`sm`?`h-6.5 px-2.5 text-[12px]`:`h-7.5 px-3 text-[13px]`,t===i.value?`bg-surface text-ink shadow-sm`:`text-ink-3 hover:text-ink`),children:i.label},i.value))})}export{r as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,B as n,Dt as r,E as i,Et as a,H as o,K as s,Ot as c,Zt as l,at as u,in as d,n as f,nn as p,nt as m,ot as h,p as g,rn as _,s as v,t as y,tt as b,x}from"./format-BVq_UI0J.js";import{a as S,i as C,n as w}from"./dist-BsPSSv6i.js";import{t as T}from"./Button-CaaiSWVd.js";import{t as E}from"./Field-BHRDucE9.js";import{t as D}from"./Segmented-C_LnD1mj.js";import{n as O,t as k}from"./AccessKeyReveal-CP2Sm1DM.js";import{t as A}from"./download-G_xumAL_.js";import{t as j}from"./theme-BfxBDblB.js";import{t as M}from"./Trans-Dwl9vXMB.js";import{r as N}from"./session-Bk-WM0zq.js";import{t as P}from"./sync-B8v5y0v_.js";import{t as F}from"./arrow-up-right-DzWSrgbl.js";import{t as I}from"./CopyButton-MHBEUW1-.js";import{t as L}from"./PageHeader-CE8sCm7O.js";import{u as R}from"./Menu-GG9F8t1A.js";var z={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};z.node;var B=a(z),V=e(d(),1),H=_(),U=(0,H.jsx)(`code`,{className:`font-mono text-[12px] break-words text-ink`});function W({where:e}){let{t}=c(`settings`);return(0,H.jsx)(M,{t,i18nKey:e.kind===`folder`?`backups.whereFolder`:`backups.whereBucket`,values:{name:e.name},components:{code:U}})}function G(){let{t:e}=c([`settings`,`common`]),n=p(),r=i(),[a,o]=(0,V.useState)(!1),[s,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null);async function _(){o(!0);try{await h(`/backups`),d(null),await n.invalidateQueries({queryKey:x.backups}),w.success(e(`backups.made`))}catch(e){w.error(m(e)),e instanceof t&&e.code===`backup_folder`&&e.details&&d(e.details),await n.invalidateQueries({queryKey:x.backups})}finally{o(!1)}}let b=r.data;if(!b)return null;let S=b.problem??u;return b.where?(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:(0,H.jsx)(W,{where:b.where})}),S&&(0,H.jsx)(K,{problem:S,root:b.where.name}),(0,H.jsx)(T,{variant:`secondary`,className:`self-start`,loading:a,onClick:_,children:e(`backups.now`)}),b.backups.length===0?!S&&(0,H.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:e(`backups.none`)}):(0,H.jsx)(`ul`,{"aria-label":e(`backups.list`),className:`flex flex-col divide-y divide-line rounded-[12px] border border-line`,children:b.backups.map(t=>(0,H.jsxs)(`li`,{className:`flex items-start justify-between gap-3 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-[13.5px] font-medium first-letter:uppercase`,children:f(t.createdAt)}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:[e(`backups.kind.${t.kind}`),` · `,g(t.createdAt),` · `,y(t.bytes)]}),(0,H.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:e(`backups.contents`,{cards:v(t.counts.cards),pages:v(t.counts.pages),files:v(t.files),count:t.counts.cards})}),t.missingFiles>0&&(0,H.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-danger`,children:e(`backups.missingFiles`,{count:t.missingFiles})}),t.newer&&(0,H.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:e(`backups.newer`,{version:t.version})})]}),(0,H.jsx)(T,{variant:`ghost`,size:`sm`,disabled:t.newer,onClick:()=>l(t),children:e(`backups.restore`)})]},t.id))}),(0,H.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-3`,children:e(`backups.keep`,{count:b.keep})}),(0,H.jsx)(q,{backup:s,onClose:()=>l(null)})]}):(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-3`,children:e(`backups.off`)})}function K({problem:e,root:t}){let{t:n}=c(`settings`);return(0,H.jsxs)(`div`,{role:`alert`,className:`flex flex-col gap-1 rounded-[12px] border border-danger/30 bg-danger-soft px-3.5 py-3 text-[13px] leading-relaxed`,children:[(0,H.jsx)(`p`,{className:`font-medium text-ink`,children:n(`backups.problem.title`)}),(0,H.jsx)(`p`,{className:`text-ink-2`,children:(0,H.jsx)(M,{t:n,i18nKey:`backups.problem.${e.code}`,values:{path:e.path,root:t,user:e.user??`100:101`,detail:e.detail},components:{code:U}})})]})}function q({backup:e,onClose:r}){let{t:i}=c([`settings`,`common`]),a=n(),[o,s]=(0,V.useState)(``),[l,u]=(0,V.useState)(``),[d,p]=(0,V.useState)(!1),[g,_]=(0,V.useState)(null),v=a.data?.copyName??window.location.hostname;function y(){s(``),u(``),_(null),r()}async function b(n){if(n.preventDefault(),e){p(!0);try{await h(`/backups/${e.id}/restore`,{accessKey:o,leaveOut:g?.map(e=>e.key)??[]}),N(),P(),window.location.assign(`/`)}catch(e){e instanceof t&&e.code===`backup_files_damaged`?_(e.details.files):w.error(m(e)),p(!1)}}}return(0,H.jsx)(S,{open:e!==null,onOpenChange:e=>!e&&y(),title:i(`backups.restoreTitle`),description:e?i(`backups.restoreDescription`,{date:f(e.createdAt)}):void 0,children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:b,children:[(0,H.jsxs)(`ul`,{className:`flex list-disc flex-col gap-1.5 pl-5 text-[13px] leading-relaxed text-ink-2`,children:[(0,H.jsx)(`li`,{children:i(`backups.restoreLoses`)}),(0,H.jsx)(`li`,{children:i(`backups.restoreSafety`)}),(0,H.jsx)(`li`,{children:i(`backups.restoreSessions`)}),(0,H.jsx)(`li`,{children:i(`backups.restoreAgents`)})]}),g&&(0,H.jsxs)(`div`,{role:`alert`,className:`flex flex-col gap-1.5 rounded-[12px] border border-danger/30 bg-danger-soft px-3.5 py-3 text-[13px] leading-relaxed`,children:[(0,H.jsx)(`p`,{className:`font-medium text-ink`,children:i(`backups.damaged.title`,{count:g.length})}),(0,H.jsx)(`ul`,{className:`flex flex-col gap-0.5 text-ink-2`,"aria-label":i(`backups.damaged.list`),children:g.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`font-medium text-ink`,children:e.name}),` · `,i(`backups.damaged.reason.${e.reason}`)]},e.key))}),(0,H.jsx)(`p`,{className:`text-ink-2`,children:i(`backups.damaged.body`)})]}),(0,H.jsx)(E,{label:i(`backups.accessKey`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:o,onChange:e=>s(e.target.value),autoFocus:!0}),(0,H.jsx)(E,{label:i(`backups.typeName`,{name:v}),autoComplete:`off`,spellCheck:!1,className:`[&_input]:font-mono`,value:l,onChange:e=>u(e.target.value)}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(T,{variant:`ghost`,onClick:y,children:i(`common:actions.cancel`)}),(0,H.jsx)(T,{type:`submit`,variant:`danger`,loading:d,disabled:!o||l.trim()!==v,children:i(g?`backups.damaged.confirm`:`backups.restoreConfirm`)})]})]})})}function J(e){switch(e.install){case`cli`:case`cloudflare`:return{how:`cli`,command:`npx create-orqevio@latest update${e.copyName&&e.copyName!==`orqevio`?` --name ${e.copyName}`:``}`};case`button`:return{how:`button`};case`docker`:return{how:`docker`,command:`docker compose pull && docker compose up -d`};default:return{how:`source`,command:`git pull && pnpm install && pnpm build`}}}function Y(){let{t:e}=c(`settings`),{data:t}=n();if(!t)return null;let r=J(t);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`p`,{className:`text-[14px]`,children:[`Orqevio `,(0,H.jsx)(`span`,{className:`font-mono text-[13px]`,children:t.current}),t.latest&&!t.updateAvailable&&(0,H.jsxs)(`span`,{className:`text-ink-3`,children:[` · `,e(`version.upToDate`)]})]}),t.updateAvailable&&(0,H.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3 rounded-[12px] border border-accent/40 bg-[color-mix(in_oklab,var(--accent)_8%,var(--sheet))] p-4`,children:[(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-[14px] font-medium`,children:[(0,H.jsx)(B,{className:`size-4 text-accent`}),e(`version.available`,{version:t.latest??``})]}),(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:e(`version.how.${r.how}`)}),r.command&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[10px] border border-line bg-surface py-1 pr-1 pl-3`,children:[(0,H.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[12.5px]`,children:r.command}),(0,H.jsx)(I,{value:r.command,label:e(`version.copy`),message:e(`version.copied`)})]}),(0,H.jsx)(`p`,{className:`text-[12.5px] text-ink-3`,children:e(`version.kept`)}),t.releaseUrl&&(0,H.jsxs)(`a`,{href:t.releaseUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 self-start text-[13px] font-medium text-accent hover:underline`,children:[e(`version.releaseNotes`),(0,H.jsx)(F,{className:`size-3.5`})]})]})]})}var X=[`data`,`files`,`vault`,`agents`];function Z(){let{t:e}=c([`settings`,`common`]),t=p(),a=l(),o=n(),u=i(),d=u.data?.where??null,[f,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(!1),[y,b]=(0,V.useState)(``),[x,C]=(0,V.useState)(``),[D,O]=(0,V.useState)(!1),k=o.data?.copyName??window.location.hostname,A=o.data?.copyName,j=o.data?.install===`cli`?`npx create-orqevio@latest uninstall${A&&A!==`orqevio`?` --name ${A}`:``}`:null;async function P(e){e.preventDefault(),O(!0);try{await h(`/account/uninstall`,{accessKey:y,deleteBackups:d?f===!0:!1}),N(),t.clear(),s(),a(`/login`,{replace:!0})}catch(e){w.error(m(e)),O(!1)}}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>v(!0),children:e(`uninstall.action`)}),(0,H.jsx)(S,{open:_,onOpenChange:v,title:e(`uninstall.title`),description:e(`uninstall.confirmDescription`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:P,children:[(0,H.jsx)(`ul`,{className:`flex list-disc flex-col gap-1.5 pl-5 text-[13px] leading-relaxed text-ink-2`,children:X.map(t=>(0,H.jsx)(`li`,{children:e(`uninstall.loses.${t}`)},t))}),(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-3`,children:e(`uninstall.afterwards`)}),j&&(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-3`,children:(0,H.jsx)(M,{t:e,i18nKey:`uninstall.oneCommand`,values:{command:j},components:{code:(0,H.jsx)(`code`,{className:`font-mono text-[12px] break-words text-ink`})}})}),d&&(0,H.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`legend`,{className:`mb-1 text-[13px] font-medium text-ink`,children:e(`uninstall.backups.legend`)}),(0,H.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-3`,children:(0,H.jsx)(W,{where:d})}),[`keep`,`delete`].map(t=>{let n=f===(t===`delete`);return(0,H.jsxs)(`label`,{className:r(`flex cursor-pointer items-start gap-3 rounded-[10px] border bg-sheet px-3 py-2.5`,n?`border-accent`:`border-line`),children:[(0,H.jsx)(`input`,{type:`radio`,name:`uninstall-backups`,value:t,checked:n,onChange:()=>g(t===`delete`),className:`mt-1 size-4 accent-[var(--accent)]`}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`block text-[13px] font-medium text-ink`,children:e(`uninstall.backups.${t}.label`)}),(0,H.jsx)(`span`,{className:`block text-[12.5px] text-ink-3`,children:e(`uninstall.backups.${t}.hint`)})]})]},t)})]}),(0,H.jsx)(E,{label:e(`uninstall.accessKey`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:y,onChange:e=>b(e.target.value),autoFocus:!0}),(0,H.jsx)(E,{label:e(`uninstall.typeName`,{name:k}),autoComplete:`off`,spellCheck:!1,className:`[&_input]:font-mono`,value:x,onChange:e=>C(e.target.value)}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(T,{variant:`ghost`,onClick:()=>v(!1),children:e(`common:actions.cancel`)}),(0,H.jsx)(T,{type:`submit`,variant:`danger`,loading:D,disabled:!y||x.trim()!==k||u.isPending||d!==null&&f===null,children:e(`uninstall.confirm`)})]})]})})]})}function Q({title:e,description:t,children:n}){return(0,H.jsxs)(`section`,{className:`grid gap-4 border-b border-line py-8 last:border-b-0 md:grid-cols-[240px_1fr] md:gap-10`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`font-display text-[18px] font-medium`,children:e}),t&&(0,H.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-3`,children:t})]}),(0,H.jsx)(`div`,{className:`max-w-[460px]`,children:n})]})}function $(){let{t:e}=c([`settings`,`common`]),{me:t,workspaceId:n}=R(),r=p(),i=l(),a=C(),d=t.workspaces.find(e=>e.id===n),[f,g]=(0,V.useState)(t.user.name),[_,v]=(0,V.useState)(t.user.theme),[y,M]=(0,V.useState)(d?.name??``),[P,F]=(0,V.useState)(``),[I,z]=(0,V.useState)(null),[B,U]=(0,V.useState)(!1),[W,K]=(0,V.useState)(``),[q,J]=(0,V.useState)(null);async function X(e,t,n){J(e);try{return await t(),w.success(n),!0}catch(e){return w.error(m(e)),!1}finally{J(null)}}return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,H.jsx)(L,{crumbs:[{label:e(`title`)}]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-[900px] px-6 py-10 sm:px-10`,children:[(0,H.jsx)(`h1`,{className:`font-display text-[34px] font-medium tracking-[-0.02em]`,children:e(`title`)}),(0,H.jsx)(Q,{title:e(`profile.title`),description:e(`profile.description`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),X(`profile`,async()=>{await u(`/account`,{name:f.trim()}),await r.invalidateQueries({queryKey:x.me})},e(`profile.saved`))},children:[(0,H.jsx)(E,{label:e(`profile.name`),value:f,onChange:e=>g(e.target.value),maxLength:80}),(0,H.jsx)(T,{type:`submit`,variant:`primary`,className:`self-start`,loading:q===`profile`,disabled:!f.trim()||f.trim()===t.user.name,children:e(`common:actions.save`)})]})}),(0,H.jsx)(Q,{title:e(`appearance.title`),description:e(`appearance.description`),children:(0,H.jsx)(D,{label:e(`appearance.theme`),value:_,onChange:e=>{v(e),j(e),u(`/account`,{theme:e}).then(()=>r.invalidateQueries({queryKey:x.me}))},options:[{value:`system`,label:e(`appearance.themes.system`)},{value:`light`,label:e(`appearance.themes.light`)},{value:`dark`,label:e(`appearance.themes.dark`)}]})}),(0,H.jsx)(Q,{title:e(`language.title`),description:e(`language.description`),children:(0,H.jsx)(O,{hideLabel:!0,onChange:async e=>{await o(e);try{let t=await u(`/account`,{locale:e});r.setQueryData(x.me,e=>e&&{...e,user:t})}catch(e){w.error(m(e))}}})}),(0,H.jsx)(Q,{title:e(`accessKey.title`),description:e(`accessKey.description`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:async e=>{e.preventDefault(),J(`access-key`);try{let e=await h(`/account/access-key`,{currentAccessKey:P});F(``),z(e.accessKey)}catch(e){w.error(m(e))}finally{J(null)}},children:[(0,H.jsx)(E,{label:e(`accessKey.current`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:P,onChange:e=>F(e.target.value)}),(0,H.jsx)(T,{type:`submit`,variant:`primary`,className:`self-start`,loading:q===`access-key`,disabled:!P.trim(),children:e(`accessKey.generate`)})]})}),d&&(0,H.jsx)(Q,{title:e(`workspace.title`),description:e(`workspace.description`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),X(`workspace`,async()=>{await u(`/workspaces/${n}`,{name:y.trim()}),await r.invalidateQueries({queryKey:x.me})},e(`workspace.saved`))},children:[(0,H.jsx)(E,{label:e(`workspace.name`),value:y,onChange:e=>M(e.target.value),maxLength:60}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(T,{type:`submit`,variant:`primary`,loading:q===`workspace`,disabled:!y.trim()||y.trim()===d.name,children:e(`common:actions.save`)}),d.role===`owner`&&t.workspaces.length>1&&(0,H.jsx)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:async()=>{await a({title:e(`workspace.deleteTitle`,{name:d.name}),description:e(`workspace.deleteDescription`),confirmLabel:e(`workspace.delete`),danger:!0})&&await X(`delete-ws`,()=>b(`/workspaces/${n}`),e(`workspace.deleted`))&&(await r.invalidateQueries({queryKey:x.me}),i(`/`,{replace:!0}))},children:e(`workspace.delete`)})]})]})}),(0,H.jsx)(Q,{title:e(`copy.title`),description:e(`copy.description`),children:(0,H.jsx)(Y,{})}),(0,H.jsx)(Q,{title:e(`backups.title`),description:e(`backups.description`),children:(0,H.jsx)(G,{})}),(0,H.jsx)(Q,{title:e(`export.title`),description:e(`export.description`),children:(0,H.jsx)(T,{variant:`secondary`,onClick:()=>void A(`/api/export`),children:e(`export.action`)})}),(0,H.jsx)(Q,{title:e(`erase.title`),description:e(`erase.description`),children:(0,H.jsx)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>U(!0),children:e(`erase.action`)})}),(0,H.jsx)(Q,{title:e(`uninstall.title`),description:e(`uninstall.description`),children:(0,H.jsx)(Z,{})})]})}),(0,H.jsx)(S,{open:I!==null,onOpenChange:()=>{},hideClose:!0,title:e(`accessKey.newTitle`),description:e(`accessKey.newDescription`),children:I&&(0,H.jsx)(k,{accessKey:I,confirmLabel:e(`accessKey.done`),onDone:()=>{z(null),w.success(e(`accessKey.updated`))}})}),(0,H.jsx)(S,{open:B,onOpenChange:U,title:e(`erase.title`),description:e(`erase.confirmDescription`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:async t=>{t.preventDefault(),await X(`delete`,()=>h(`/account/delete`,{accessKey:W}),e(`erase.done`))&&(N(),r.clear(),s(),i(`/setup`,{replace:!0}))},children:[(0,H.jsx)(E,{label:e(`erase.accessKey`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:W,onChange:e=>K(e.target.value),autoFocus:!0}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(T,{variant:`ghost`,onClick:()=>U(!1),children:e(`common:actions.cancel`)}),(0,H.jsx)(T,{type:`submit`,variant:`danger`,loading:q===`delete`,disabled:!W,children:e(`erase.confirm`)})]})]})})]})}export{$ as SettingsPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{$ as t,B as n,Dt as r,E as i,Et as a,H as o,K as s,Ot as c,Zt as l,at as u,in as d,n as f,nn as p,nt as m,ot as h,p as g,rn as _,s as v,t as y,tt as b,x}from"./format-Dk1nO38Z.js";import{a as S,i as C,n as w}from"./dist-DFO0RDUp.js";import{t as T}from"./Button-CHkkj3LG.js";import{t as E}from"./Field-BsUKJQ-4.js";import{t as D}from"./Segmented-BibQ5uCT.js";import{n as O,t as k}from"./AccessKeyReveal-BhGhJ9TO.js";import{t as A}from"./download-CHH-5Z1W.js";import{t as j}from"./theme-BfxBDblB.js";import{t as M}from"./Trans-CA0OvHif.js";import{r as N}from"./session-BdZhhrrQ.js";import{t as P}from"./sync-Byk1kJR_.js";import{t as F}from"./arrow-up-right-GSt0z737.js";import{t as I}from"./CopyButton-BDbxvAXk.js";import{t as L}from"./PageHeader-DJdrnGpr.js";import{u as R}from"./Menu-CzgZwzmu.js";var z={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};z.node;var B=a(z),V=e(d(),1),H=_(),U=(0,H.jsx)(`code`,{className:`font-mono text-[12px] break-words text-ink`});function W({where:e}){let{t}=c(`settings`);return(0,H.jsx)(M,{t,i18nKey:e.kind===`folder`?`backups.whereFolder`:`backups.whereBucket`,values:{name:e.name},components:{code:U}})}function G(){let{t:e}=c([`settings`,`common`]),n=p(),r=i(),[a,o]=(0,V.useState)(!1),[s,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null);async function _(){o(!0);try{await h(`/backups`),d(null),await n.invalidateQueries({queryKey:x.backups}),w.success(e(`backups.made`))}catch(e){w.error(m(e)),e instanceof t&&e.code===`backup_folder`&&e.details&&d(e.details),await n.invalidateQueries({queryKey:x.backups})}finally{o(!1)}}let b=r.data;if(!b)return null;let S=b.problem??u;return b.where?(0,H.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:(0,H.jsx)(W,{where:b.where})}),S&&(0,H.jsx)(K,{problem:S,root:b.where.name}),(0,H.jsx)(T,{variant:`secondary`,className:`self-start`,loading:a,onClick:_,children:e(`backups.now`)}),b.backups.length===0?!S&&(0,H.jsx)(`p`,{className:`text-[13px] text-ink-3`,children:e(`backups.none`)}):(0,H.jsx)(`ul`,{"aria-label":e(`backups.list`),className:`flex flex-col divide-y divide-line rounded-[12px] border border-line`,children:b.backups.map(t=>(0,H.jsxs)(`li`,{className:`flex items-start justify-between gap-3 px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-[13.5px] font-medium first-letter:uppercase`,children:f(t.createdAt)}),(0,H.jsxs)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:[e(`backups.kind.${t.kind}`),` · `,g(t.createdAt),` · `,y(t.bytes)]}),(0,H.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:e(`backups.contents`,{cards:v(t.counts.cards),pages:v(t.counts.pages),files:v(t.files),count:t.counts.cards})}),t.missingFiles>0&&(0,H.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-danger`,children:e(`backups.missingFiles`,{count:t.missingFiles})}),t.newer&&(0,H.jsx)(`p`,{className:`mt-0.5 text-[12.5px] text-ink-3`,children:e(`backups.newer`,{version:t.version})})]}),(0,H.jsx)(T,{variant:`ghost`,size:`sm`,disabled:t.newer,onClick:()=>l(t),children:e(`backups.restore`)})]},t.id))}),(0,H.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-3`,children:e(`backups.keep`,{count:b.keep})}),(0,H.jsx)(q,{backup:s,onClose:()=>l(null)})]}):(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-3`,children:e(`backups.off`)})}function K({problem:e,root:t}){let{t:n}=c(`settings`);return(0,H.jsxs)(`div`,{role:`alert`,className:`flex flex-col gap-1 rounded-[12px] border border-danger/30 bg-danger-soft px-3.5 py-3 text-[13px] leading-relaxed`,children:[(0,H.jsx)(`p`,{className:`font-medium text-ink`,children:n(`backups.problem.title`)}),(0,H.jsx)(`p`,{className:`text-ink-2`,children:(0,H.jsx)(M,{t:n,i18nKey:`backups.problem.${e.code}`,values:{path:e.path,root:t,user:e.user??`100:101`,detail:e.detail},components:{code:U}})})]})}function q({backup:e,onClose:r}){let{t:i}=c([`settings`,`common`]),a=n(),[o,s]=(0,V.useState)(``),[l,u]=(0,V.useState)(``),[d,p]=(0,V.useState)(!1),[g,_]=(0,V.useState)(null),v=a.data?.copyName??window.location.hostname;function y(){s(``),u(``),_(null),r()}async function b(n){if(n.preventDefault(),e){p(!0);try{await h(`/backups/${e.id}/restore`,{accessKey:o,leaveOut:g?.map(e=>e.key)??[]}),N(),P(),window.location.assign(`/`)}catch(e){e instanceof t&&e.code===`backup_files_damaged`?_(e.details.files):w.error(m(e)),p(!1)}}}return(0,H.jsx)(S,{open:e!==null,onOpenChange:e=>!e&&y(),title:i(`backups.restoreTitle`),description:e?i(`backups.restoreDescription`,{date:f(e.createdAt)}):void 0,children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:b,children:[(0,H.jsxs)(`ul`,{className:`flex list-disc flex-col gap-1.5 pl-5 text-[13px] leading-relaxed text-ink-2`,children:[(0,H.jsx)(`li`,{children:i(`backups.restoreLoses`)}),(0,H.jsx)(`li`,{children:i(`backups.restoreSafety`)}),(0,H.jsx)(`li`,{children:i(`backups.restoreSessions`)}),(0,H.jsx)(`li`,{children:i(`backups.restoreAgents`)})]}),g&&(0,H.jsxs)(`div`,{role:`alert`,className:`flex flex-col gap-1.5 rounded-[12px] border border-danger/30 bg-danger-soft px-3.5 py-3 text-[13px] leading-relaxed`,children:[(0,H.jsx)(`p`,{className:`font-medium text-ink`,children:i(`backups.damaged.title`,{count:g.length})}),(0,H.jsx)(`ul`,{className:`flex flex-col gap-0.5 text-ink-2`,"aria-label":i(`backups.damaged.list`),children:g.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`font-medium text-ink`,children:e.name}),` · `,i(`backups.damaged.reason.${e.reason}`)]},e.key))}),(0,H.jsx)(`p`,{className:`text-ink-2`,children:i(`backups.damaged.body`)})]}),(0,H.jsx)(E,{label:i(`backups.accessKey`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:o,onChange:e=>s(e.target.value),autoFocus:!0}),(0,H.jsx)(E,{label:i(`backups.typeName`,{name:v}),autoComplete:`off`,spellCheck:!1,className:`[&_input]:font-mono`,value:l,onChange:e=>u(e.target.value)}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(T,{variant:`ghost`,onClick:y,children:i(`common:actions.cancel`)}),(0,H.jsx)(T,{type:`submit`,variant:`danger`,loading:d,disabled:!o||l.trim()!==v,children:i(g?`backups.damaged.confirm`:`backups.restoreConfirm`)})]})]})})}function J(e){switch(e.install){case`cli`:case`cloudflare`:return{how:`cli`,command:`npx create-orqevio@latest update${e.copyName&&e.copyName!==`orqevio`?` --name ${e.copyName}`:``}`};case`button`:return{how:`button`};case`docker`:return{how:`docker`,command:`docker compose pull && docker compose up -d`};default:return{how:`source`,command:`git pull && pnpm install && pnpm build`}}}function Y(){let{t:e}=c(`settings`),{data:t}=n();if(!t)return null;let r=J(t);return(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsxs)(`p`,{className:`text-[14px]`,children:[`Orqevio `,(0,H.jsx)(`span`,{className:`font-mono text-[13px]`,children:t.current}),t.latest&&!t.updateAvailable&&(0,H.jsxs)(`span`,{className:`text-ink-3`,children:[` · `,e(`version.upToDate`)]})]}),t.updateAvailable&&(0,H.jsxs)(`div`,{role:`status`,className:`flex flex-col gap-3 rounded-[12px] border border-accent/40 bg-[color-mix(in_oklab,var(--accent)_8%,var(--sheet))] p-4`,children:[(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-[14px] font-medium`,children:[(0,H.jsx)(B,{className:`size-4 text-accent`}),e(`version.available`,{version:t.latest??``})]}),(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-2`,children:e(`version.how.${r.how}`)}),r.command&&(0,H.jsxs)(`div`,{className:`flex items-center gap-2 rounded-[10px] border border-line bg-surface py-1 pr-1 pl-3`,children:[(0,H.jsx)(`code`,{className:`min-w-0 flex-1 truncate font-mono text-[12.5px]`,children:r.command}),(0,H.jsx)(I,{value:r.command,label:e(`version.copy`),message:e(`version.copied`)})]}),(0,H.jsx)(`p`,{className:`text-[12.5px] text-ink-3`,children:e(`version.kept`)}),t.releaseUrl&&(0,H.jsxs)(`a`,{href:t.releaseUrl,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 self-start text-[13px] font-medium text-accent hover:underline`,children:[e(`version.releaseNotes`),(0,H.jsx)(F,{className:`size-3.5`})]})]})]})}var X=[`data`,`files`,`vault`,`agents`];function Z(){let{t:e}=c([`settings`,`common`]),t=p(),a=l(),o=n(),u=i(),d=u.data?.where??null,[f,g]=(0,V.useState)(null),[_,v]=(0,V.useState)(!1),[y,b]=(0,V.useState)(``),[x,C]=(0,V.useState)(``),[D,O]=(0,V.useState)(!1),k=o.data?.copyName??window.location.hostname,A=o.data?.copyName,j=o.data?.install===`cli`?`npx create-orqevio@latest uninstall${A&&A!==`orqevio`?` --name ${A}`:``}`:null;async function P(e){e.preventDefault(),O(!0);try{await h(`/account/uninstall`,{accessKey:y,deleteBackups:d?f===!0:!1}),N(),t.clear(),s(),a(`/login`,{replace:!0})}catch(e){w.error(m(e)),O(!1)}}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>v(!0),children:e(`uninstall.action`)}),(0,H.jsx)(S,{open:_,onOpenChange:v,title:e(`uninstall.title`),description:e(`uninstall.confirmDescription`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:P,children:[(0,H.jsx)(`ul`,{className:`flex list-disc flex-col gap-1.5 pl-5 text-[13px] leading-relaxed text-ink-2`,children:X.map(t=>(0,H.jsx)(`li`,{children:e(`uninstall.loses.${t}`)},t))}),(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-3`,children:e(`uninstall.afterwards`)}),j&&(0,H.jsx)(`p`,{className:`text-[13px] leading-relaxed text-ink-3`,children:(0,H.jsx)(M,{t:e,i18nKey:`uninstall.oneCommand`,values:{command:j},components:{code:(0,H.jsx)(`code`,{className:`font-mono text-[12px] break-words text-ink`})}})}),d&&(0,H.jsxs)(`fieldset`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(`legend`,{className:`mb-1 text-[13px] font-medium text-ink`,children:e(`uninstall.backups.legend`)}),(0,H.jsx)(`p`,{className:`text-[12.5px] leading-relaxed text-ink-3`,children:(0,H.jsx)(W,{where:d})}),[`keep`,`delete`].map(t=>{let n=f===(t===`delete`);return(0,H.jsxs)(`label`,{className:r(`flex cursor-pointer items-start gap-3 rounded-[10px] border bg-sheet px-3 py-2.5`,n?`border-accent`:`border-line`),children:[(0,H.jsx)(`input`,{type:`radio`,name:`uninstall-backups`,value:t,checked:n,onChange:()=>g(t===`delete`),className:`mt-1 size-4 accent-[var(--accent)]`}),(0,H.jsxs)(`span`,{children:[(0,H.jsx)(`span`,{className:`block text-[13px] font-medium text-ink`,children:e(`uninstall.backups.${t}.label`)}),(0,H.jsx)(`span`,{className:`block text-[12.5px] text-ink-3`,children:e(`uninstall.backups.${t}.hint`)})]})]},t)})]}),(0,H.jsx)(E,{label:e(`uninstall.accessKey`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:y,onChange:e=>b(e.target.value),autoFocus:!0}),(0,H.jsx)(E,{label:e(`uninstall.typeName`,{name:k}),autoComplete:`off`,spellCheck:!1,className:`[&_input]:font-mono`,value:x,onChange:e=>C(e.target.value)}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(T,{variant:`ghost`,onClick:()=>v(!1),children:e(`common:actions.cancel`)}),(0,H.jsx)(T,{type:`submit`,variant:`danger`,loading:D,disabled:!y||x.trim()!==k||u.isPending||d!==null&&f===null,children:e(`uninstall.confirm`)})]})]})})]})}function Q({title:e,description:t,children:n}){return(0,H.jsxs)(`section`,{className:`grid gap-4 border-b border-line py-8 last:border-b-0 md:grid-cols-[240px_1fr] md:gap-10`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h2`,{className:`font-display text-[18px] font-medium`,children:e}),t&&(0,H.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-ink-3`,children:t})]}),(0,H.jsx)(`div`,{className:`max-w-[460px]`,children:n})]})}function $(){let{t:e}=c([`settings`,`common`]),{me:t,workspaceId:n}=R(),r=p(),i=l(),a=C(),d=t.workspaces.find(e=>e.id===n),[f,g]=(0,V.useState)(t.user.name),[_,v]=(0,V.useState)(t.user.theme),[y,M]=(0,V.useState)(d?.name??``),[P,F]=(0,V.useState)(``),[I,z]=(0,V.useState)(null),[B,U]=(0,V.useState)(!1),[W,K]=(0,V.useState)(``),[q,J]=(0,V.useState)(null);async function X(e,t,n){J(e);try{return await t(),w.success(n),!0}catch(e){return w.error(m(e)),!1}finally{J(null)}}return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,H.jsx)(L,{crumbs:[{label:e(`title`)}]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,H.jsxs)(`div`,{className:`mx-auto w-full max-w-[900px] px-6 py-10 sm:px-10`,children:[(0,H.jsx)(`h1`,{className:`font-display text-[34px] font-medium tracking-[-0.02em]`,children:e(`title`)}),(0,H.jsx)(Q,{title:e(`profile.title`),description:e(`profile.description`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),X(`profile`,async()=>{await u(`/account`,{name:f.trim()}),await r.invalidateQueries({queryKey:x.me})},e(`profile.saved`))},children:[(0,H.jsx)(E,{label:e(`profile.name`),value:f,onChange:e=>g(e.target.value),maxLength:80}),(0,H.jsx)(T,{type:`submit`,variant:`primary`,className:`self-start`,loading:q===`profile`,disabled:!f.trim()||f.trim()===t.user.name,children:e(`common:actions.save`)})]})}),(0,H.jsx)(Q,{title:e(`appearance.title`),description:e(`appearance.description`),children:(0,H.jsx)(D,{label:e(`appearance.theme`),value:_,onChange:e=>{v(e),j(e),u(`/account`,{theme:e}).then(()=>r.invalidateQueries({queryKey:x.me}))},options:[{value:`system`,label:e(`appearance.themes.system`)},{value:`light`,label:e(`appearance.themes.light`)},{value:`dark`,label:e(`appearance.themes.dark`)}]})}),(0,H.jsx)(Q,{title:e(`language.title`),description:e(`language.description`),children:(0,H.jsx)(O,{hideLabel:!0,onChange:async e=>{await o(e);try{let t=await u(`/account`,{locale:e});r.setQueryData(x.me,e=>e&&{...e,user:t})}catch(e){w.error(m(e))}}})}),(0,H.jsx)(Q,{title:e(`accessKey.title`),description:e(`accessKey.description`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:async e=>{e.preventDefault(),J(`access-key`);try{let e=await h(`/account/access-key`,{currentAccessKey:P});F(``),z(e.accessKey)}catch(e){w.error(m(e))}finally{J(null)}},children:[(0,H.jsx)(E,{label:e(`accessKey.current`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:P,onChange:e=>F(e.target.value)}),(0,H.jsx)(T,{type:`submit`,variant:`primary`,className:`self-start`,loading:q===`access-key`,disabled:!P.trim(),children:e(`accessKey.generate`)})]})}),d&&(0,H.jsx)(Q,{title:e(`workspace.title`),description:e(`workspace.description`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),X(`workspace`,async()=>{await u(`/workspaces/${n}`,{name:y.trim()}),await r.invalidateQueries({queryKey:x.me})},e(`workspace.saved`))},children:[(0,H.jsx)(E,{label:e(`workspace.name`),value:y,onChange:e=>M(e.target.value),maxLength:60}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(T,{type:`submit`,variant:`primary`,loading:q===`workspace`,disabled:!y.trim()||y.trim()===d.name,children:e(`common:actions.save`)}),d.role===`owner`&&t.workspaces.length>1&&(0,H.jsx)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:async()=>{await a({title:e(`workspace.deleteTitle`,{name:d.name}),description:e(`workspace.deleteDescription`),confirmLabel:e(`workspace.delete`),danger:!0})&&await X(`delete-ws`,()=>b(`/workspaces/${n}`),e(`workspace.deleted`))&&(await r.invalidateQueries({queryKey:x.me}),i(`/`,{replace:!0}))},children:e(`workspace.delete`)})]})]})}),(0,H.jsx)(Q,{title:e(`copy.title`),description:e(`copy.description`),children:(0,H.jsx)(Y,{})}),(0,H.jsx)(Q,{title:e(`backups.title`),description:e(`backups.description`),children:(0,H.jsx)(G,{})}),(0,H.jsx)(Q,{title:e(`export.title`),description:e(`export.description`),children:(0,H.jsx)(T,{variant:`secondary`,onClick:()=>void A(`/api/export`),children:e(`export.action`)})}),(0,H.jsx)(Q,{title:e(`erase.title`),description:e(`erase.description`),children:(0,H.jsx)(T,{variant:`ghost`,className:`text-danger hover:bg-danger-soft hover:text-danger`,onClick:()=>U(!0),children:e(`erase.action`)})}),(0,H.jsx)(Q,{title:e(`uninstall.title`),description:e(`uninstall.description`),children:(0,H.jsx)(Z,{})})]})}),(0,H.jsx)(S,{open:I!==null,onOpenChange:()=>{},hideClose:!0,title:e(`accessKey.newTitle`),description:e(`accessKey.newDescription`),children:I&&(0,H.jsx)(k,{accessKey:I,confirmLabel:e(`accessKey.done`),onDone:()=>{z(null),w.success(e(`accessKey.updated`))}})}),(0,H.jsx)(S,{open:B,onOpenChange:U,title:e(`erase.title`),description:e(`erase.confirmDescription`),children:(0,H.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:async t=>{t.preventDefault(),await X(`delete`,()=>h(`/account/delete`,{accessKey:W}),e(`erase.done`))&&(N(),r.clear(),s(),i(`/setup`,{replace:!0}))},children:[(0,H.jsx)(E,{label:e(`erase.accessKey`),type:`password`,autoComplete:`current-password`,spellCheck:!1,className:`[&_input]:font-mono`,value:W,onChange:e=>K(e.target.value),autoFocus:!0}),(0,H.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,H.jsx)(T,{variant:`ghost`,onClick:()=>U(!1),children:e(`common:actions.cancel`)}),(0,H.jsx)(T,{type:`submit`,variant:`danger`,loading:q===`delete`,disabled:!W,children:e(`erase.confirm`)})]})]})})]})}export{$ as SettingsPage};