efficient-shell 4.134.0 → 4.137.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 (171) hide show
  1. package/LICENSE +6 -17
  2. package/README.md +84 -8
  3. package/dist/Browser-ZX5OTOKK.js +43 -0
  4. package/dist/Calculator-4SQGOQFQ.js +29 -0
  5. package/dist/ConfirmDialog-NPKW2XHM.js +1 -0
  6. package/dist/CurrencyConverter-2KOM7L6V.js +21 -0
  7. package/dist/Documents-IZTIQYPG.js +52 -0
  8. package/dist/Files-B63KKXGZ.js +89 -0
  9. package/dist/Notepad-WA77V45J.js +25 -0
  10. package/dist/PdfViewer-RBRGEKWF.js +1 -0
  11. package/dist/PomodoroTimer-SDUBKXUS.js +99 -0
  12. package/dist/Preview-D4KOA4OI.js +187 -0
  13. package/dist/Sidebar-Y57LYXXI.js +23 -0
  14. package/dist/Spreadsheet-JX5E6WH6.js +37 -0
  15. package/dist/Stock-XAQ5WMUZ.js +16 -0
  16. package/dist/Weather-HLAGJ5LV.js +60 -0
  17. package/dist/WorldClock-IRI4VCTA.js +32 -0
  18. package/dist/apps/index.js +1 -151
  19. package/dist/brand.css +1 -1
  20. package/dist/chunk-3A46NCXK.js +29 -0
  21. package/dist/chunk-44UO7FYU.js +11 -0
  22. package/dist/chunk-466CM2TJ.js +1 -0
  23. package/dist/chunk-57MIENLJ.js +1 -0
  24. package/dist/chunk-5CRAF2AD.js +2 -0
  25. package/dist/chunk-A2OQLLYK.js +6 -0
  26. package/dist/chunk-B43AGQET.js +4 -0
  27. package/dist/chunk-BR22X7E5.js +1 -0
  28. package/dist/chunk-BUTSU7FO.js +1 -0
  29. package/dist/chunk-D65T4H6J.js +1 -0
  30. package/dist/chunk-ESL5TDNA.js +1 -0
  31. package/dist/chunk-FBDZGO3V.js +1 -0
  32. package/dist/chunk-FHTLC7HH.js +1 -0
  33. package/dist/chunk-FQLMX3IE.js +948 -0
  34. package/dist/chunk-H562R4GX.js +34 -0
  35. package/dist/chunk-JN4WXTWJ.js +106 -0
  36. package/dist/chunk-LVDRBRYU.js +1 -0
  37. package/dist/chunk-LWLCNQY7.js +1 -0
  38. package/dist/chunk-MAIHBBWT.js +1 -0
  39. package/dist/chunk-NPJH5MD7.js +13 -0
  40. package/dist/chunk-OCSOMMY2.js +1 -0
  41. package/dist/chunk-OQDWLHZI.js +1 -0
  42. package/dist/chunk-OWSAMA3I.js +23 -0
  43. package/dist/chunk-PH3PRIFP.js +5 -0
  44. package/dist/chunk-TAWKWSPN.js +9 -0
  45. package/dist/chunk-U4GTZPXP.js +1 -0
  46. package/dist/chunk-UB4JIOLD.js +2 -0
  47. package/dist/chunk-UZAJ5BF6.js +9 -0
  48. package/dist/chunk-VEGMDXT4.js +1 -0
  49. package/dist/chunk-VTVSMRFX.js +1 -0
  50. package/dist/chunk-VVAGSKW7.js +1 -0
  51. package/dist/chunk-XO43FJRM.js +19 -0
  52. package/dist/chunk-Y7BOLDRM.js +69 -0
  53. package/dist/file-intake/index.js +1 -4
  54. package/dist/{index-DZ7E7bCl.d.ts → index-DVI9DMSu.d.ts} +189 -18
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.js +639 -7473
  57. package/dist/map/index.js +20 -540
  58. package/dist/markdown/index.js +6 -184
  59. package/dist/markup/index.js +1 -135
  60. package/dist/page-tabs/index.js +21 -709
  61. package/dist/sounds-OMHXVVQ4.js +1 -0
  62. package/dist/ui/index.d.ts +1 -1
  63. package/dist/ui/index.js +1 -19
  64. package/dist/ui.css +78 -10
  65. package/package.json +4 -3
  66. package/dist/Browser-O3QZGUF2.js +0 -482
  67. package/dist/Browser-O3QZGUF2.js.map +0 -1
  68. package/dist/Calculator-L6N5X3KU.js +0 -192
  69. package/dist/Calculator-L6N5X3KU.js.map +0 -1
  70. package/dist/ConfirmDialog-LYSSZSUD.js +0 -4
  71. package/dist/ConfirmDialog-LYSSZSUD.js.map +0 -1
  72. package/dist/CurrencyConverter-64MKXB3D.js +0 -236
  73. package/dist/CurrencyConverter-64MKXB3D.js.map +0 -1
  74. package/dist/Documents-5WXXYCLI.js +0 -441
  75. package/dist/Documents-5WXXYCLI.js.map +0 -1
  76. package/dist/Files-AUURUUDN.js +0 -805
  77. package/dist/Files-AUURUUDN.js.map +0 -1
  78. package/dist/Notepad-GPXJVPB7.js +0 -410
  79. package/dist/Notepad-GPXJVPB7.js.map +0 -1
  80. package/dist/PdfViewer-HKO6P4SR.js +0 -5
  81. package/dist/PdfViewer-HKO6P4SR.js.map +0 -1
  82. package/dist/PomodoroTimer-4TQBWLP2.js +0 -633
  83. package/dist/PomodoroTimer-4TQBWLP2.js.map +0 -1
  84. package/dist/Preview-FOZYPKM2.js +0 -2959
  85. package/dist/Preview-FOZYPKM2.js.map +0 -1
  86. package/dist/Sidebar-BPU7RCZP.js +0 -291
  87. package/dist/Sidebar-BPU7RCZP.js.map +0 -1
  88. package/dist/Spreadsheet-3C66BBBF.js +0 -519
  89. package/dist/Spreadsheet-3C66BBBF.js.map +0 -1
  90. package/dist/Stock-IF4IHYLU.js +0 -158
  91. package/dist/Stock-IF4IHYLU.js.map +0 -1
  92. package/dist/Weather-725PFR7T.js +0 -431
  93. package/dist/Weather-725PFR7T.js.map +0 -1
  94. package/dist/WorldClock-UU4NZIQ7.js +0 -202
  95. package/dist/WorldClock-UU4NZIQ7.js.map +0 -1
  96. package/dist/apps/index.js.map +0 -1
  97. package/dist/chunk-2TPTHAKI.js +0 -316
  98. package/dist/chunk-2TPTHAKI.js.map +0 -1
  99. package/dist/chunk-4P44JXDS.js +0 -195
  100. package/dist/chunk-4P44JXDS.js.map +0 -1
  101. package/dist/chunk-5O42JXQE.js +0 -26
  102. package/dist/chunk-5O42JXQE.js.map +0 -1
  103. package/dist/chunk-72CQWN7O.js +0 -547
  104. package/dist/chunk-72CQWN7O.js.map +0 -1
  105. package/dist/chunk-7CCHEEYC.js +0 -94
  106. package/dist/chunk-7CCHEEYC.js.map +0 -1
  107. package/dist/chunk-BE7FZOFU.js +0 -17
  108. package/dist/chunk-BE7FZOFU.js.map +0 -1
  109. package/dist/chunk-D276EMXS.js +0 -57
  110. package/dist/chunk-D276EMXS.js.map +0 -1
  111. package/dist/chunk-D7PYW2QS.js +0 -265
  112. package/dist/chunk-D7PYW2QS.js.map +0 -1
  113. package/dist/chunk-DVZWYWSD.js +0 -26
  114. package/dist/chunk-DVZWYWSD.js.map +0 -1
  115. package/dist/chunk-ET6ID4LP.js +0 -102
  116. package/dist/chunk-ET6ID4LP.js.map +0 -1
  117. package/dist/chunk-GA35NEND.js +0 -56
  118. package/dist/chunk-GA35NEND.js.map +0 -1
  119. package/dist/chunk-GIGV2ZRW.js +0 -70
  120. package/dist/chunk-GIGV2ZRW.js.map +0 -1
  121. package/dist/chunk-IPXN646P.js +0 -14
  122. package/dist/chunk-IPXN646P.js.map +0 -1
  123. package/dist/chunk-IRWSRJ4K.js +0 -48
  124. package/dist/chunk-IRWSRJ4K.js.map +0 -1
  125. package/dist/chunk-IULP5BCD.js +0 -79
  126. package/dist/chunk-IULP5BCD.js.map +0 -1
  127. package/dist/chunk-MGGY74RY.js +0 -14
  128. package/dist/chunk-MGGY74RY.js.map +0 -1
  129. package/dist/chunk-OLJDJYSU.js +0 -13678
  130. package/dist/chunk-OLJDJYSU.js.map +0 -1
  131. package/dist/chunk-PIGDNN5F.js +0 -46
  132. package/dist/chunk-PIGDNN5F.js.map +0 -1
  133. package/dist/chunk-Q2MJVSJT.js +0 -7
  134. package/dist/chunk-Q2MJVSJT.js.map +0 -1
  135. package/dist/chunk-Q3LT745N.js +0 -3710
  136. package/dist/chunk-Q3LT745N.js.map +0 -1
  137. package/dist/chunk-QAGQRNKI.js +0 -145
  138. package/dist/chunk-QAGQRNKI.js.map +0 -1
  139. package/dist/chunk-QRL64J5F.js +0 -503
  140. package/dist/chunk-QRL64J5F.js.map +0 -1
  141. package/dist/chunk-QSKCQUZE.js +0 -1103
  142. package/dist/chunk-QSKCQUZE.js.map +0 -1
  143. package/dist/chunk-R4OQIQYX.js +0 -153
  144. package/dist/chunk-R4OQIQYX.js.map +0 -1
  145. package/dist/chunk-RT6DSB5Y.js +0 -143
  146. package/dist/chunk-RT6DSB5Y.js.map +0 -1
  147. package/dist/chunk-SHQM5CK3.js +0 -549
  148. package/dist/chunk-SHQM5CK3.js.map +0 -1
  149. package/dist/chunk-T4VQHMG4.js +0 -822
  150. package/dist/chunk-T4VQHMG4.js.map +0 -1
  151. package/dist/chunk-TRCWINHF.js +0 -105
  152. package/dist/chunk-TRCWINHF.js.map +0 -1
  153. package/dist/chunk-TW7LPMVR.js +0 -16
  154. package/dist/chunk-TW7LPMVR.js.map +0 -1
  155. package/dist/chunk-W622KQTD.js +0 -465
  156. package/dist/chunk-W622KQTD.js.map +0 -1
  157. package/dist/chunk-X4Q6G253.js +0 -416
  158. package/dist/chunk-X4Q6G253.js.map +0 -1
  159. package/dist/chunk-YNKK7NE3.js +0 -171
  160. package/dist/chunk-YNKK7NE3.js.map +0 -1
  161. package/dist/chunk-YPO6RDMX.js +0 -20
  162. package/dist/chunk-YPO6RDMX.js.map +0 -1
  163. package/dist/file-intake/index.js.map +0 -1
  164. package/dist/index.js.map +0 -1
  165. package/dist/map/index.js.map +0 -1
  166. package/dist/markdown/index.js.map +0 -1
  167. package/dist/markup/index.js.map +0 -1
  168. package/dist/page-tabs/index.js.map +0 -1
  169. package/dist/sounds-NT4DEZGD.js +0 -3
  170. package/dist/sounds-NT4DEZGD.js.map +0 -1
  171. package/dist/ui/index.js.map +0 -1
@@ -0,0 +1,948 @@
1
+ import{Breadcrumbs as e}from"./chunk-A2OQLLYK.js";import{SidebarLayout as t}from"./chunk-B43AGQET.js";import{BrandMark as r}from"./chunk-OCSOMMY2.js";import{toast_default as a}from"./chunk-VEGMDXT4.js";import{useIsMobile as n,useShortcutLabel as l,useShellPrefs as i}from"./chunk-44UO7FYU.js";import{useFileIntake as s,humanSize as o,FileIntakeAlert as c}from"./chunk-VVAGSKW7.js";import{iconButtonClasses as d,Button_default as u}from"./chunk-PH3PRIFP.js";import{PopupMenu as h,PopupMenuDivider as m,PopupMenuLabel as p,itemLook as g}from"./chunk-UZAJ5BF6.js";import{registerModalEscapeInterceptor as f,onOverlayOpen as x,Z_LAYERS as b,useDismissPopupsOnOpen as y,useFocusTrap as v,useScrollLock as w}from"./chunk-3A46NCXK.js";import{glassStyle as k,glassFill as N}from"./chunk-57MIENLJ.js";import{useShellLocale as M,useShellStrings as $,DEFAULT_SHELL_STRINGS as C,currentShellStrings as L,formatPlain as D,formatFixed as j,formatPercent as z,splitAround as P}from"./chunk-OQDWLHZI.js";import{useBrowserLayoutEffect as S,useBrowserValue as A,useBrowserValueOnce as F}from"./chunk-D65T4H6J.js";import{forwardRef as B,useCallback as T,useState as W,useRef as E,useId as I,useEffect as O,createContext as R,useMemo as Y,Children as _,isValidElement as H,cloneElement as q,useContext as U,Fragment as V,Component as K,useSyncExternalStore as G,useLayoutEffect as Z}from"react";import{jsx as J,jsxs as X,Fragment as Q}from"react/jsx-runtime";import{createPortal as ee}from"react-dom";var te=B(function({children:e,variant:t="ghost",size:r="md",type:a="button",className:n="",...l},i){/* @__PURE__ */
2
+ return J("button",{ref:i,type:a,className:d({variant:t,size:r,className:n}),...l,children:e})}),re="block w-full rounded-md border border-gray-300 bg-white",ae="text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]",ne={sm:"px-2.5 py-1 text-xs",md:"px-3 py-1.5 text-sm",lg:"px-3.5 py-2 text-base",touch:"h-14 px-4 text-base"},le=`${re} ${ne.md} ${ae}`,ie="disabled:cursor-not-allowed disabled:opacity-60";function se(e){return[e?.size&&"md"!==e.size?`${re} ${ne[e.size]} ${ae}`:le,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",ie,e?.className??""].filter(Boolean).join(" ")}var oe=B(function({invalid:e,leftIcon:t,rightAdornment:r,size:a,className:n="",...l},i){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),o=
3
+ /* @__PURE__ */J("input",{ref:i,"aria-invalid":e||void 0,className:se({invalid:e,size:a,className:[s,n].filter(Boolean).join(" ")}),...l});return t||r?/* @__PURE__ */X("div",{className:"relative",children:[t&&/* @__PURE__ */J("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),o,r&&/* @__PURE__ */J("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):o}),ce=B(function({invalid:e,autoGrow:t,className:r="",onInput:a,rows:n=3,size:l,...i},s){const o=T(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}a?.(e)},[t,a]);/* @__PURE__ */
4
+ return J("textarea",{ref:s,"aria-invalid":e||void 0,rows:n,onInput:o,className:se({invalid:e,size:l,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...i})}),de=448,ue=240;function he(e){const t={left:0,right:window.innerWidth,top:0,bottom:window.innerHeight},r=e?.closest?.("[data-modal-panel]");if(!r)return t;const a=r.getBoundingClientRect();return a.width<=0||a.height<=0?t:{left:Math.max(t.left,a.left),right:Math.min(t.right,a.right),top:Math.max(t.top,a.top),bottom:Math.min(t.bottom,a.bottom)}}var me={top:"bottom",bottom:"top",left:"right",right:"left"},pe={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function ge(e,t,r){return{top:e.top-r-(t.top+8),bottom:t.bottom-8-(e.bottom+r),left:e.left-r-(t.left+8),right:t.right-8-(e.right+r)}}var fe=(e,t,r)=>Math.max(t,Math.min(e,r));function xe(e,t,r){let a=NaN,n=NaN,l=NaN,i=NaN,s=NaN;const o=()=>{const t=e()?.getBoundingClientRect();if(!t)return!1;const o=r?r():NaN,c=t.left!==a||t.top!==n||t.right!==l||t.bottom!==i||o!==s&&!(Number.isNaN(o)&&Number.isNaN(s));return a=t.left,n=t.top,l=t.right,i=t.bottom,s=o,c};o();const c=()=>{o(),t()};let d=requestAnimationFrame(function e(){o()&&t(),d=requestAnimationFrame(e)});return window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{cancelAnimationFrame(d),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}}function be(e,t,r={}){const{matchTriggerWidth:a=!1,preferredMaxWidth:n=de,preferredMaxHeight:l=ue,popupRef:i}=r,[s,o]=W(null);return S(()=>{if(!t)return void o(null);const r=()=>{const t=e.current,r=t?.getBoundingClientRect();if(!r)return;const s=he(t),c=s.bottom-r.bottom-4-8,d=r.top-s.top-4-8,u=c<Math.min(l,160)&&d>c,h=Math.max(96,Math.min(l,u?d:c)),m=Math.max(0,s.right-s.left-16),p={minWidth:r.width,maxWidth:Math.min(n,m),maxHeight:h};if(a){const e=Math.min(r.width,m);p.width=e,p.maxWidth=e,p.left=Math.min(Math.max(s.left+8,r.left),s.right-8-e)}else if(i&&s.right-8-r.left<p.maxWidth&&Math.min(r.right,s.right-8)-s.left-8<p.maxWidth){const e=i.current?.offsetWidth??0,t=e>0?Math.min(e,p.maxWidth):p.maxWidth;p.left=Math.max(s.left+8,Math.min(r.left,s.right-8-t))}else if(s.right-8-r.left<p.maxWidth){const e=Math.min(r.right,s.right-8);p.right=window.innerWidth-e,p.maxWidth=Math.min(p.maxWidth,Math.max(0,e-s.left-8))}else p.left=Math.max(s.left+8,r.left);u?p.bottom=window.innerHeight-r.top+4:p.top=r.bottom+4,o(p)};return r(),xe(()=>e.current,r,i?()=>i.current?.offsetWidth??NaN:void 0)},[t,e,a,n,l,i]),s}function ye(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function ve(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function we(e,t,r){let a=t+r;for(;a>=0&&a<e.length;){if(!e[a].disabled)return a;a+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?ye(e):ve(e)}function ke(e,t,r){const a=t.toLowerCase(),n=e.length;if(!a||0===n)return-1;for(let t=1;t<=n;t++){const l=((r+t)%n+n)%n,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(a))return l}return-1}var Ne=B(function({value:e,onChange:t,options:r,placeholder:a,invalid:n,className:l="",size:i,touchSize:s,...o},c){/* @__PURE__ */
5
+ return X("select",{ref:c,value:e,onChange:e=>t(e.target.value),"aria-invalid":n||void 0,className:se({invalid:n,size:i,className:`pr-8 ${l}`.trim()}),...o,children:[void 0!==a&&/* @__PURE__ */J("option",{value:"",disabled:!0,children:a}),r.map(e=>/* @__PURE__ */J("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))]})}),Me=B(function({value:e,onChange:t,options:r,placeholder:a,invalid:n,className:l="",id:i,disabled:s,size:o,touchSize:c,title:d,"aria-describedby":u,"aria-label":h,"aria-labelledby":m,...p},g){const[y,v]=W(!1),[w,N]=W(-1),M=E(null),$=E(null),C=E(null),L=E(y);L.current=y;const D=E({buffer:"",timer:null}),j=I(),z=`${j}-listbox`,P=e=>`${j}-opt-${e}`,S=be($,y,{matchTriggerWidth:!0}),A=r.findIndex(t=>t.value===e),F=A>=0?r[A].label:void 0,B=T((e=!0)=>{v(!1),N(-1),e&&$.current?.focus()},[]),R=T(()=>{s||(N(A>=0?A:ye(r)),v(!0))},[s,r,A]),Y=T(e=>{const a=r[e];a&&!a.disabled&&(t(a.value),B())},[r,t,B]);O(()=>{if(!y)return;return f(e=>!("Escape"!==e.key||!L.current)&&(B(),!0))},[y,B]),O(()=>{if(!y)return;const e=e=>{const t=e.target;M.current?.contains(t)||C.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e);const t=x(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[y,B]),O(()=>{!y||w<0||C.current?.querySelector(`#${CSS.escape(P(w))}`)?.scrollIntoView({block:"nearest"})});const _=T(e=>{const t=D.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const a=y?w:A,n=ke(r,t.buffer,a);n<0||(y?N(n):Y(n))},[y,w,A,r,Y]);/* @__PURE__ */
6
+ return X("div",{ref:M,className:"relative",children:[
7
+ /* @__PURE__ */J("button",{ref:$,id:i,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":y,"aria-controls":y?z:void 0,"aria-activedescendant":y&&w>=0?P(w):void 0,"aria-invalid":n||void 0,"aria-describedby":u,"aria-label":h,"aria-labelledby":m,title:d,disabled:s,onClick:()=>y?B():R(),onKeyDown:e=>{if(!s)switch(e.key){case"ArrowDown":return e.preventDefault(),void(y?N(e=>we(r,e,1)):R());case"ArrowUp":return e.preventDefault(),void(y?N(e=>we(r,e,-1)):R());case"Home":return void(y&&(e.preventDefault(),N(ye(r))));case"End":return void(y&&(e.preventDefault(),N(ve(r))));case"Enter":return void(y&&(e.preventDefault(),Y(w)));case" ":return e.preventDefault(),void(y?Y(w):R());case"Escape":return void(y&&(e.preventDefault(),e.stopPropagation(),B()));case"Tab":return void(y&&B(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),_(e.key))}},className:se({invalid:n,size:o,className:`pr-8 text-left ${l}`.trim()}),children:/* @__PURE__ */J("span",{className:"block truncate "+(void 0===F?"text-gray-400":""),children:F??a??" "})}),
8
+ /* @__PURE__ */J("svg",{"aria-hidden":"true",className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
9
+ /* @__PURE__ */X("select",{ref:g,value:e,onChange:e=>t(e.target.value),disabled:s,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...p,children:[void 0!==a&&/* @__PURE__ */J("option",{value:"",disabled:!0,children:a}),r.map(e=>/* @__PURE__ */J("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),y&&ee(
10
+ /* @__PURE__ */J("div",{ref:C,id:z,role:"listbox",className:"fixed overflow-y-auto rounded-2xl py-1",style:{zIndex:b.popup,left:S?.left,top:S?.top,bottom:S?.bottom,width:S?.width,maxHeight:S?.maxHeight??ue,visibility:S?void 0:"hidden",...k()},children:r.map((t,r)=>/* @__PURE__ */J("div",{id:P(r),role:"option","aria-selected":e===t.value,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||N(r)},onClick:()=>Y(r),className:"mx-1 cursor-pointer truncate rounded-lg px-3 py-1.5 text-sm\n "+(t.disabled?"cursor-not-allowed text-gray-400":r===w?"bg-blue-50 text-blue-700":e===t.value?"font-medium text-blue-600":"text-gray-700"),children:t.description?/* @__PURE__ */X(Q,{children:[
11
+ /* @__PURE__ */J("span",{className:"block truncate",children:t.label}),
12
+ /* @__PURE__ */J("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label},t.value))}),document.body)]})}),$e=B(function({touchSize:e="touch",...t},r){return n()?/* @__PURE__ */J(Ne,{ref:r,...t,size:e}):/* @__PURE__ */J(Me,{ref:r,...t})}),Ce=B(function({checked:e,onChange:t,indeterminate:r=!1,label:a,description:n,disabled:l,className:i="",...s},o){const c=E(null);O(()=>{c.current&&(c.current.indeterminate=r)},[r,e]);const d=T(e=>{c.current=e,"function"==typeof o?o(e):o&&(o.current=e)},[o]),u=(r="")=>/* @__PURE__ */J("input",{ref:d,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),...s});return a||n?/* @__PURE__ */X("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[u("mt-0.5"),
13
+ /* @__PURE__ */X("span",{className:"text-sm leading-tight",children:[a&&/* @__PURE__ */J("span",{className:"font-medium text-gray-700",children:a}),n&&/* @__PURE__ */J("span",{className:"mt-0.5 block text-xs text-gray-500",children:n})]})]}):u(i)}),Le="h-4 w-4 shrink-0 border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60",De=B(function({checked:e,onChange:t,label:r,description:a,disabled:n,className:l="",...i},s){return r||a?/* @__PURE__ */X("label",{className:`flex items-start gap-2 ${n?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
14
+ /* @__PURE__ */J("input",{ref:s,type:"radio",checked:e,disabled:n,onChange:e=>t(e.target.checked),className:`${Le} mt-0.5`,...i}),
15
+ /* @__PURE__ */X("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */J("span",{className:"block min-w-0 font-medium text-gray-700",children:r}),a&&/* @__PURE__ */J("span",{className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:a})]})]}):/* @__PURE__ */J("input",{ref:s,type:"radio",checked:e,disabled:n,onChange:e=>t(e.target.checked),className:`${Le} ${l}`.trim(),...i})});function je({label:e,htmlFor:t,labelId:r,hint:a,error:n,required:l,className:i="",children:s}){const o=t?n?`${t}-error`:a?`${t}-hint`:void 0:void 0,c=1===_.count(s)?_.only(s):null,d=H(c)?c:null,u={};d&&(o&&(u["aria-describedby"]=[d.props["aria-describedby"],o].filter(Boolean).join(" ")),n&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?q(d,u):s;/* @__PURE__ */
16
+ return X("div",{className:i,children:[e&&/* @__PURE__ */X("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,n?
17
+ /* @__PURE__ */J("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:n}):a?/* @__PURE__ */J("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:a}):null]})}var ze={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Pe({label:e,hint:t,error:r,required:a,name:n,value:l,onChange:i,options:s,orientation:o="vertical",disabled:c=!1,className:d=""}){const u=I(),h=e?`${u}-label`:void 0;/* @__PURE__ */
18
+ return J(je,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:a,className:d,children:/* @__PURE__ */J("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":a||void 0,className:ze[o],children:s.map(e=>/* @__PURE__ */J(De,{name:n,value:e.value,checked:l===e.value,onChange:t=>{t&&i(e.value)},label:e.label,description:e.description,disabled:c||e.disabled},e.value))})})}function Se({errors:e,title:t,autoFocus:r=!0,className:a=""}){const n=$(),l=E(null),i=E(!1);if(O(()=>{const t=e.length>0;t&&!i.current&&r&&l.current?.focus(),i.current=t},[e.length>0,r]),0===e.length)return null;/* @__PURE__ */
19
+ return X("div",{ref:l,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${a}`.trim(),children:[
20
+ /* @__PURE__ */J("h2",{className:"text-sm font-semibold text-red-800",children:t??n.form.errorSummaryTitle}),
21
+ /* @__PURE__ */J("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */J("li",{children:/* @__PURE__ */J("a",{href:`#${e.fieldId}`,onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({block:"center"}),t.focus())})(e.fieldId)},className:"text-sm text-red-700 underline hover:text-red-900",children:e.message})},`${e.fieldId}-${t}`))})]})}function Ae({required:e,children:t,className:r="",...a}){/* @__PURE__ */
22
+ return X("label",{className:`mb-1 block text-xs font-medium text-gray-600 ${r}`.trim(),...a,children:[t,e&&/* @__PURE__ */J("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Fe=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function Be(e){if(/^data:/i.test(e||""))return function(e){const t=Fe.exec(e);if(!t)return"media";const[,r,a]=t,n=a.split("+")[0].split(".").pop().replace(/^x-/i,"");return n?`${r.toLowerCase()}.${n.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Te=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function We(e,t=C.media){const r=function(e){const t=e.includes("video"),r=e.includes("image")||"*"===e||""===e;return t&&!r?"video":r&&!t?"image":"file"}(e);return"image"===r?t.uploadImage:"video"===r?t.uploadVideo:t.uploadFile}function Ee(e,t,r=""){return["flex w-full flex-col items-center justify-center gap-1.5 rounded-lg border-2 border-dashed text-center transition-colors",t?"cursor-not-allowed opacity-60":"cursor-pointer",e?"border-blue-500 bg-blue-50":"border-gray-300 bg-gray-50 hover:bg-gray-100",r].filter(Boolean).join(" ")}function Ie(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function Oe({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
23
+ return X("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
24
+ /* @__PURE__ */J(_e,{}),
25
+ /* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function Re({children:e}){/* @__PURE__ */
26
+ return J("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-1.5 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function Ye(e,t=""){if(!e)return!1;const r=Fe.exec(e);if(r)return"video"===r[1].toLowerCase();const a=t.includes("video"),n=t.includes("image")||"*"===t||""===t;return Te.test(e)||a&&!n}function _e({className:e="h-5 w-5"}){/* @__PURE__ */
27
+ return X("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
28
+ /* @__PURE__ */J("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
29
+ /* @__PURE__ */J("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function He({className:e="h-4 w-4"}){/* @__PURE__ */
30
+ return J("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M6 6l8 8M14 6l-8 8"})})}function qe({className:e="h-6 w-6"}){/* @__PURE__ */
31
+ return X("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
32
+ /* @__PURE__ */J("path",{d:"M12 15V4"}),
33
+ /* @__PURE__ */J("path",{d:"M8 8l4-4 4 4"}),
34
+ /* @__PURE__ */J("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function Ue({value:e,onChange:t,onPick:r,onFile:a,label:n,hint:l,error:i,required:o,className:d,accept:h="image/*",maxSizeBytes:m,fit:p="cover",height:g=112,placeholder:f,cta:x,acceptHint:b,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:k,removeLabel:N,busy:M=!1,busyLabel:C,disabled:L=!1}){const D=$().media,j=x??D.cta,z=k??D.replace,P=N??D.remove,S=C??D.uploading,A=I(),F=E(null),[B,T]=W(null);O(()=>()=>{F.current&&URL.revokeObjectURL(F.current)},[]);const R=L||M,Y=!!e&&(Ye(e,h)||e===B),_=f??We(h,D),H=e=>{r?r(e):a?a(e):(e=>{F.current&&URL.revokeObjectURL(F.current);const r=URL.createObjectURL(e);F.current=r,T(e.type.startsWith("video/")?r:null),t(r)})(e)},q=s({accept:h,maxSizeBytes:m,acceptHint:b,multiple:!1,disabled:R,onAccept:([e])=>H(e)}),{dragOver:U}=q,V=()=>{R||(r?r():q.open())},K=e?Be(e):"",G=/* @__PURE__ */X("div",{children:[
35
+ /* @__PURE__ */X("div",{...q.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",U?"border-blue-500":"border-gray-200"].join(" "),style:{height:g},children:[Y?/* @__PURE__ */J("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:p}}):/* @__PURE__ */J("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:p}}),y&&e&&/* @__PURE__ */J(Re,{children:K}),M&&/* @__PURE__ */J(Oe,{label:S,rounded:"rounded-md"})]}),!L&&(v||w)&&/* @__PURE__ */X("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */J(u,{id:A,variant:"secondary",size:"sm",onClick:()=>V(),disabled:M,children:z}),w&&/* @__PURE__ */J(u,{variant:"ghost",size:"sm",onClick:()=>{F.current&&(URL.revokeObjectURL(F.current),F.current=null),T(null),t("")},disabled:M,children:P})]})]}),Z=/* @__PURE__ */J("button",{type:"button",id:A,onClick:()=>V(),disabled:R,"aria-label":"string"==typeof _?_:D.upload,"aria-busy":M||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${A}-error`:l?`${A}-hint`:void 0,...q.zoneProps,className:Ee(U,R,Ie(R)),style:{minHeight:g},children:M?/* @__PURE__ */X("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
36
+ /* @__PURE__ */J(_e,{}),
37
+ /* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-500",children:S})]}):/* @__PURE__ */X(Q,{children:[
38
+ /* @__PURE__ */J("span",{className:"text-gray-400",children:/* @__PURE__ */J(qe,{})}),
39
+ /* @__PURE__ */J("span",{className:"px-3 text-xs text-gray-500",children:_}),
40
+ /* @__PURE__ */J("span",{className:"text-sm font-medium text-blue-600",children:j}),b&&/* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:b})]})});/* @__PURE__ */
41
+ return X(je,{label:n,htmlFor:A,hint:l,error:i,required:o,className:d,children:[e?G:Z,!r&&/* @__PURE__ */J("input",{...q.inputProps}),
42
+ /* @__PURE__ */J(c,{rejections:q.rejections})]})}function Ve({committedUrl:e,committedHasAlpha:t=null,committedIsLight:a=null,fallbackUrl:n,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:o,onSave:c,onRemove:d,accept:h="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:m="PNG · ICO · SVG · JPG · WEBP",maxBytes:p=5242880,previews:g=[],disabled:f=!1}){const x=E(null),[b,y]=W(null),[v,w]=W(""),[k,N]=W(""),[M,C]=W(!1),[L,D]=W(!1),j=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),z=$().brandAsset,P=v||e||n||"",S=b?null:e?t:l,A=b?null:e?a:i;O(()=>()=>{x.current&&URL.revokeObjectURL(x.current)},[]);const F=()=>{x.current&&(URL.revokeObjectURL(x.current),x.current=null)};/* @__PURE__ */
43
+ return X("section",{"aria-label":z.region(o,s),className:"grid gap-4 lg:grid-cols-2",children:[
44
+ /* @__PURE__ */X("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
45
+ /* @__PURE__ */J(Ue,{value:P,onChange:()=>{},onFile:e=>{if(f)return;F();const t=URL.createObjectURL(e);x.current=t,y(e),w(t),N("")},label:o,hint:k||z.usedFor(s),error:k||void 0,accept:h,acceptHint:m,maxSizeBytes:p,fit:"contain",height:180,allowRemove:!1,busy:M||L,disabled:f}),
46
+ /* @__PURE__ */X("div",{className:"mt-3 flex flex-wrap gap-2",children:[
47
+ /* @__PURE__ */J(u,{onClick:async()=>{if(b&&!f&&!M){C(!0),N("");try{await c(b),F(),y(null),w("")}catch(e){N(e instanceof Error?e.message:z.saveFailed(j,o))}finally{C(!1)}}},disabled:!b||f,loading:M,children:z.save(j,o)}),(b||e)&&/* @__PURE__ */J(u,{variant:"ghost-danger",onClick:async()=>{if(!f&&!L){if(b)return F(),y(null),w(""),void N("");if(e){D(!0),N("");try{await d()}catch(e){N(e instanceof Error?e.message:z.removeFailed(j,o))}finally{D(!1)}}}},disabled:f,loading:L,children:b?z.discard:z.remove(j,o)})]})]}),g.length>0&&/* @__PURE__ */X("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":z.previews(o),children:[
48
+ /* @__PURE__ */J("h3",{className:"text-sm font-semibold text-gray-900",children:z.preview}),
49
+ /* @__PURE__ */J("div",{className:"mt-3 grid gap-3",children:g.map(e=>{const t=/* @__PURE__ */J(r,{src:P,alt:z.alt(s,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:S,isLight:A,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
50
+ return X("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
51
+ /* @__PURE__ */J("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */X("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
52
+ /* @__PURE__ */X("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[t,
53
+ /* @__PURE__ */J("span",{className:"truncate text-xs text-gray-700",children:e.title??s}),
54
+ /* @__PURE__ */J("span",{className:"text-gray-400",children:"×"})]}),
55
+ /* @__PURE__ */J("span",{className:"mb-1 ml-1 text-gray-400",children:"+"})]}):"search-result"===e.kind?/* @__PURE__ */X("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[
56
+ /* @__PURE__ */X("div",{className:"flex items-center gap-2",children:[
57
+ /* @__PURE__ */J("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full border border-gray-200 bg-gray-50",children:t}),
58
+ /* @__PURE__ */X("div",{className:"min-w-0 leading-tight",children:[
59
+ /* @__PURE__ */J("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??s}),e.url&&/* @__PURE__ */J("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
60
+ /* @__PURE__ */J("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??s}),e.description&&/* @__PURE__ */J("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */X("div",{className:["flex items-center gap-3 rounded-md border border-gray-200 p-3","dark"===e.surface?"bg-gray-900 text-white":"bg-white text-gray-900"].join(" "),children:[t,
61
+ /* @__PURE__ */J("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function Ke(e,t={}){return t.preferSquare&&e.logo_square_url?{src:e.logo_square_url,hasAlpha:e.logo_square_has_alpha,isLight:e.logo_square_is_light,adaptive:!0}:"dark"===t.surface&&e.logo_on_dark_url?{src:e.logo_on_dark_url,hasAlpha:null,isLight:null,adaptive:!1}:{src:e.logo_url,hasAlpha:e.logo_has_alpha,isLight:e.logo_is_light,adaptive:!0}}var Ge=R(null);function Ze(e){const t=document.head.querySelector('link[data-portal-branding="favicon"]');if(!e)return void t?.remove();const r=t??document.createElement("link");r.rel="icon",r.href=e,r.dataset.portalBranding="favicon",t||document.head.appendChild(r)}function Je({load:e,fallback:t,documentTitle:r,children:a}){const[n,l]=W(t),[i,s]=W(!0),[o,c]=W(null),d=E(e),u=E(t);d.current=e,u.current=t,O(()=>{const e=new AbortController;let t=!0;return l(u.current),s(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),s(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),s(!1))}),()=>{t=!1,e.abort()}},[]),O(()=>(Ze(n.favicon_url),()=>Ze(null)),[n.favicon_url]),O(()=>{r&&(document.title=r(n))},[n,r]);const h=Y(()=>({branding:n,loading:i,error:o}),[n,i,o]);/* @__PURE__ */
62
+ return J(Ge.Provider,{value:h,children:a})}function Xe(){const e=U(Ge);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var Qe=/* @__PURE__ */J("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */J("path",{d:"M6 6l12 12M18 6L6 18"})});function et({items:e,onPick:t,onFiles:r,onRemove:a,onReorder:n,label:l,hint:i,error:o,required:d,className:u,accept:h="image/*",maxSizeBytes:m,maxFiles:p,fit:g="cover",thumbSize:f=96,placeholder:x,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1,readOnly:C=!1}){const L=$().media,D=b??L.cta,j=w??L.cover,z=N??L.uploading,P=I(),[S,A]=W(null),F=M||k,B=!(!t&&!r||F||C),T=!!a&&!F&&!C,E=!!n&&!F&&!C,O=Ie(F),R=x??We(h,L),Y=s({accept:h,maxSizeBytes:m,maxFiles:p,acceptHint:y,multiple:!0,disabled:!B,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),_=Y.dragOver,H=()=>{B&&(t?t():Y.open())},q={width:f,height:f},U=B&&/* @__PURE__ */X("button",{type:"button",onClick:()=>H(),"aria-label":L.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${O}`,style:q,children:[
63
+ /* @__PURE__ */J(qe,{className:"h-5 w-5"}),
64
+ /* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-500",children:L.add})]}),V=B?/* @__PURE__ */X("button",{type:"button",onClick:()=>H(),"aria-label":"string"==typeof R?R:L.upload,className:Ee(_,!1,O),style:{minHeight:f+32},children:[
65
+ /* @__PURE__ */J("span",{className:"text-gray-400",children:/* @__PURE__ */J(qe,{})}),
66
+ /* @__PURE__ */J("span",{className:"px-3 text-xs text-gray-500",children:R}),
67
+ /* @__PURE__ */J("span",{className:"text-sm font-medium text-blue-600",children:D}),y&&/* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:y})]}):/* @__PURE__ */J("div",{className:"flex w-full items-center justify-center rounded-lg border border-gray-200 bg-gray-50 px-3 text-xs text-gray-400",style:{minHeight:f+32},children:L.empty});/* @__PURE__ */
68
+ return X(je,{label:l,labelId:l?`${P}-label`:void 0,htmlFor:P,hint:i,error:o,required:d,className:u,children:[
69
+ /* @__PURE__ */X("div",{id:P,role:"group","aria-labelledby":l?`${P}-label`:void 0,"aria-describedby":o?`${P}-error`:i?`${P}-hint`:void 0,"aria-busy":k||void 0,...Y.zoneProps,className:"relative rounded-lg transition-colors",style:{...F?{opacity:.6}:{},..._?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?V:/* @__PURE__ */X("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:Ye(t.url,h),i=Be(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
70
+ return X("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),A(r)}:void 0,onDragEnd:E?()=>A(null):void 0,onDragOver:E?e=>{null!=S&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=S&&(e.preventDefault(),e.stopPropagation(),S!==r&&n(S,r),A(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?L.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),n(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),n(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",O,S===r?"opacity-50":""].join(" "),style:{...q,cursor:E?"move":void 0},children:[l?/* @__PURE__ */J("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:g}}):/* @__PURE__ */J("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:g}}),s&&/* @__PURE__ */J("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:j}),null!=t.caption&&/* @__PURE__ */J(Re,{children:t.caption}),T&&/* @__PURE__ */J("button",{type:"button",onClick:()=>a(t.id),"aria-label":L.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${O}`,style:{background:"var(--rosh-media-scrim-button)"},children:Qe})]},t.id)}),U]}),k&&/* @__PURE__ */J(Oe,{label:z})]}),!t&&r&&/* @__PURE__ */J("input",{...Y.inputProps}),
71
+ /* @__PURE__ */J(c,{rejections:Y.rejections})]})}var tt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rt=["January","February","March","April","May","June","July","August","September","October","November","December"];function at(e){return tt[parseInt(e,10)-1]??e}function nt(e){return rt[parseInt(e,10)-1]??e}var lt={dateStyle:"medium"},it=/* @__PURE__ */new Map;function st(e,t){const r=`${e}|${JSON.stringify(t)}`;let a=it.get(r);return a||(a=new Intl.DateTimeFormat(e,{...t,timeZone:"UTC",calendar:"gregory"}),it.set(r,a)),a}function ot(e,t){if(!e)return"—";const r=e.includes("T")?e.split("T")[0]:e,[a,n,l]=r.split("-").map(Number);if(!a||!n||!l)return e;if(t?.locale)return st(t.locale,t.style??lt).format(new Date(Date.UTC(a,n-1,l)));const i=String(l).padStart(2,"0"),s=String(n).padStart(2,"0"),o=String(a);switch(function(){if("undefined"==typeof window)return"DD/MM/YYYY";try{return localStorage.getItem("user_date_format")||"DD/MM/YYYY"}catch{return"DD/MM/YYYY"}}()){case"MM/DD/YYYY":return`${s}/${i}/${o}`;case"YYYY-MM-DD":return`${o}-${s}-${i}`;case"DD-MM-YYYY":return`${i}-${s}-${o}`;case"MM-DD-YYYY":return`${s}-${i}-${o}`;case"DD.MM.YYYY":return`${i}.${s}.${o}`;case"YYYY.MM.DD":return`${o}.${s}.${i}`;case"YYYY/MM/DD":return`${o}/${s}/${i}`;case"DD/MM/YY":return`${i}/${s}/${o.slice(-2)}`;case"MM/DD/YY":return`${s}/${i}/${o.slice(-2)}`;case"DD/MMM/YYYY":return`${i}/${at(s)}/${o}`;case"DD/MMM/YY":return`${i}/${at(s)}/${o.slice(-2)}`;case"DD MMM YYYY":return`${i} ${at(s)} ${o}`;case"MMM DD, YYYY":return`${at(s)} ${i}, ${o}`;case"DD MMMM YYYY":return`${i} ${nt(s)} ${o}`;case"MMMM DD, YYYY":return`${nt(s)} ${i}, ${o}`;default:return`${i}/${s}/${o}`}}var ct={months:rt,monthsShort:tt,weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Su","Mo","Tu","We","Th","Fr","Sa"],monthYear:(e,t)=>`${rt[t]} ${e}`,shortMonthYear:(e,t)=>`${tt[t]} ${e}`,longDate:(e,t,r)=>`${r} ${rt[t]} ${e}`},dt=/* @__PURE__ */new Map;function ut(e){if(!e)return ct;const t=dt.get(e);if(t)return t;const r=t=>st(e,t),a=(e,t,r=1)=>new Date(Date.UTC(e,t,r)),n=r({month:"long"}),l=r({month:"short"}),i=r({weekday:"long"}),s=r({weekday:"short"}),o=r({month:"long",year:"numeric"}),c=r({month:"short",year:"numeric"}),d=r({day:"numeric",month:"long",year:"numeric"}),u=Array.from({length:12},(e,t)=>t),h=Array.from({length:7},(e,t)=>t),m={months:u.map(e=>n.format(a(2e3,e))),monthsShort:u.map(e=>l.format(a(2e3,e))),weekdays:h.map(e=>i.format(a(2e3,0,2+e))),weekdaysShort:h.map(e=>s.format(a(2e3,0,2+e))),monthYear:(e,t)=>o.format(a(e,t)),shortMonthYear:(e,t)=>c.format(a(e,t)),longDate:(e,t,r)=>d.format(a(e,t,r))};return dt.set(e,m),m}var ht=/* @__PURE__ */new Map;function mt(e){if(!e)return 0;let t=ht.get(e);if(void 0===t){t=0;try{const r=new Intl.Locale(e),a="function"==typeof r.getWeekInfo?r.getWeekInfo():r.weekInfo;1===a?.firstDay&&(t=1)}catch{}ht.set(e,t)}return t}var pt=e=>String(e).padStart(2,"0");function gt(e){return`${e.getFullYear()}-${pt(e.getMonth()+1)}-${pt(e.getDate())}`}function ft(e){if(!e)return null;const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const r=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(r.getTime())?null:r}var xt=e=>`${e.getFullYear()}-${pt(e.getMonth()+1)}`;var bt=()=>gt(/* @__PURE__ */new Date);var yt=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),vt=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),a=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),a))};function wt({value:e,endValue:t,mode:r="single",onSelect:a,min:n,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=ft(e),p=A(bt,null),g=ft(p),f=$().calendar,x=M(),b=ut(x),y=A(()=>mt(x),0),v=c??y,w=()=>{if(!g)return null;const e=xt(g);return n&&e<n.slice(0,7)?n.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[k,N]=W(()=>s||(m?xt(m):w())),C=i??k??w(),L=null===C?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(C,g),[D,j]=W(()=>e??p),z=E(null),P=E(!1),[S,F]=W("days"),B=Y(()=>L?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),a=(r.getDay()-t+7)%7,n=new Date(r.getFullYear(),r.getMonth(),1-a);return Array.from({length:42},(e,t)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))}(L,v):[],[C,v]),T=e=>!!n&&e<n||!!l&&e>l,I=D??p,R=B.some(e=>gt(e)===I),_=L?B.find(e=>e.getMonth()===L.getMonth())??B[0]:null,H=R&&I?I:_?gt(_):"";if(O(()=>{P.current&&(P.current=!1,z.current?.querySelector('[data-active="true"]')?.focus())},[H,C]),!L)/* @__PURE__ */
72
+ return X("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
73
+ /* @__PURE__ */J("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */J("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const q=e=>"years"===S?new Date(L.getFullYear()+12*e,L.getMonth(),1):"months"===S?new Date(L.getFullYear()+e,L.getMonth(),1):vt(L,e),U=e=>{const t=xt(e);void 0===i&&N(t),o?.(t)},V=u??b.monthYear(L.getFullYear(),L.getMonth());/* @__PURE__ */
74
+ return X("div",{className:h,children:[
75
+ /* @__PURE__ */X("div",{className:"mb-2 flex items-center justify-between px-1",children:[
76
+ /* @__PURE__ */J("button",{type:"button","aria-label":"years"===S?f.previousYears:"months"===S?f.previousYear:f.previousMonth,onClick:()=>U(q(-1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */J("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),
77
+ /* @__PURE__ */J("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */X(Q,{children:["years"!==S&&/* @__PURE__ */J("button",{type:"button","aria-label":f.chooseMonth(b.months[L.getMonth()]),onClick:()=>F(e=>"months"===e?"days":"months"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:b.months[L.getMonth()]}),
78
+ /* @__PURE__ */J("button",{type:"button","aria-label":f.chooseYear(L.getFullYear()),onClick:()=>F(e=>"years"===e?"days":"years"),className:"rounded-md px-1.5 py-0.5 transition-colors hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:L.getFullYear()})]}):/* @__PURE__ */J("span",{children:b.monthYear(L.getFullYear(),L.getMonth())})}),
79
+ /* @__PURE__ */J("button",{type:"button","aria-label":"years"===S?f.nextYears:"months"===S?f.nextYear:f.nextMonth,onClick:()=>U(q(1)),className:"rounded-full p-1 text-gray-600 hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */J("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===S&&/* @__PURE__ */J("div",{role:"group","aria-label":f.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:b.monthsShort.map((e,t)=>/* @__PURE__ */J("button",{type:"button","aria-pressed":t===L.getMonth(),onClick:()=>{U(new Date(L.getFullYear(),t,1)),F("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===L.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&L.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===S&&/* @__PURE__ */J("div",{role:"group","aria-label":f.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=L.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */J("button",{type:"button","aria-pressed":e===L.getFullYear(),onClick:()=>{U(new Date(e,L.getMonth(),1)),F("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===L.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
80
+ /* @__PURE__ */X("div",{ref:z,role:"grid","aria-label":V,onKeyDown:e=>{const t=ft(H)??g??L,r={ArrowLeft:()=>yt(t,-1),ArrowRight:()=>yt(t,1),ArrowUp:()=>yt(t,-7),ArrowDown:()=>yt(t,7),Home:()=>yt(t,-(t.getDay()-v+7)%7),End:()=>yt(t,6-(t.getDay()-v+7)%7),PageUp:()=>vt(t,e.shiftKey?-12:-1),PageDown:()=>vt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),n=r[e.key](),P.current=!0,j(gt(n)),void(xt(n)!==C&&U(n));var n;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T(H)||a(H))},hidden:"days"!==S,children:[
81
+ /* @__PURE__ */J("div",{role:"row",className:"grid grid-cols-7 text-center text-xs font-medium text-gray-500",children:Array.from({length:7},(e,t)=>(t+v)%7).map(e=>
82
+ /* @__PURE__ */J("div",{role:"columnheader","aria-label":b.weekdays[e],className:"py-1",children:/* @__PURE__ */J("abbr",{title:b.weekdays[e],className:"no-underline",children:b.weekdaysShort[e]})},e))}),Array.from({length:6},(n,l)=>/* @__PURE__ */J("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:B.slice(7*l,7*l+7).map(n=>{const l=gt(n),i=n.getMonth()!==L.getMonth(),s=l===e||"range"===r&&l===t,o=(a=>!("range"!==r||!e||!t)&&a>e&&a<t)(l),c=T(l);/* @__PURE__ */
83
+ return J("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */J("button",{type:"button","data-active":l===H,tabIndex:l===H?0:-1,disabled:c,"aria-label":b.longDate(n.getFullYear(),n.getMonth(),n.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{j(l),a(l)},className:["w-full rounded-md py-1.5 min-h-11 sm:min-h-0 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",c?"cursor-not-allowed text-gray-300":s?"bg-blue-600 font-semibold text-white":o?"bg-blue-100 text-blue-800":i?"text-gray-300 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||s?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:n.getDate()})},l)})},l))]})]})}var kt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Nt=e=>`${e.getFullYear()}-${Mt(e.getMonth()+1)}`,Mt=e=>String(e).padStart(2,"0");function $t(e){return`${e.getFullYear()}-${Mt(e.getMonth()+1)}-${Mt(e.getDate())}`}function Ct(e){const[t,r,a]=e.split("-").map(Number);return new Date(t,r-1,a)}function Lt(e){const[t,r,a]=e.split("-");return t&&r&&a?`${a}/${r}/${t}`:e}var Dt=/* @__PURE__ */new Map;function jt({from:e,to:t,onChange:r,formatDisplay:a,clearable:n,required:l=!1,name:i,id:s,"aria-labelledby":o,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1}){const m=$().dateRange,p=M(),g=a??(p?function(e){let t=Dt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Dt.set(e,t));const r=t;return e=>{const[t,a,n]=e.split("-").map(Number);return t&&a&&n?r.format(new Date(Date.UTC(t,a-1,n))):e}}(p):Lt),f=u??m.placeholder,y=n??!l,[v,w]=W(!1),[N,C]=W(e),[L,D]=W(t),[j,z]=W(null),P=E(null),A=E(null),F=E(null),B=I(),T=I(),[R,Y]=W(!1),_=be(P,v,{preferredMaxWidth:520,preferredMaxHeight:R?720:560,popupRef:F}),H=E(null),q=E(null);S(()=>{const e=F.current;if(!v||!_||!e)return;const t=getComputedStyle(e),r=_.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(R)null!==q.current&&q.current<=r&&Y(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;q.current=e,e>r+.5&&Y(!0)}});const[U,V]=W(!1);S(()=>{const e=!!s&&(A.current?.labels?.length??0)>0;e!==U&&V(e)});const K=!!c||!!o||U,G=/* @__PURE__ */new Date,[Z,te]=W(()=>Nt(e?Ct(e):G)),re=e=>e?g(e):"";O(()=>{if(!v)return;const e=e=>{const t=e.target;P.current?.contains(t)||F.current?.contains(t)||w(!1)};document.addEventListener("mousedown",e);const t=x(()=>w(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[v]);const ae=()=>{r("",""),w(!1)},ne=e&&t?`${re(e)} — ${re(t)}`:e?m.fromOnly(re(e)):t?m.toOnly(re(t)):"",le=ut(p),ie=e=>{const t=ft(e);return t?le.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},se=e&&t?m.range(ie(e),ie(t)):e?m.fromOnly(ie(e)):t?m.toOnly(ie(t)):f,oe=e=>R?"rounded-md border px-2.5 py-1 text-sm transition-colors "+(j===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"text-left px-3 py-1.5 text-sm rounded-md transition-colors "+(j===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),ce=/* @__PURE__ */X(Q,{children:[kt.map(e=>/* @__PURE__ */J("button",{type:"button",onClick:()=>(e=>{let t,r;switch(e){case"last2Weeks":r=/* @__PURE__ */new Date,t=/* @__PURE__ */new Date,t.setDate(t.getDate()-14);break;case"lastMonth":t=new Date(G.getFullYear(),G.getMonth()-1,1),r=new Date(G.getFullYear(),G.getMonth(),0);break;case"last3Months":t=new Date(G.getFullYear(),G.getMonth()-3,1),r=new Date(G.getFullYear(),G.getMonth(),0);break;case"last6Months":t=new Date(G.getFullYear(),G.getMonth()-6,1),r=new Date(G.getFullYear(),G.getMonth(),0);break;case"last12Months":t=new Date(G.getFullYear(),G.getMonth()-12,1),r=new Date(G.getFullYear(),G.getMonth(),0);break;default:return}C($t(t)),D($t(r)),z(e),te(Nt(t))})(e),className:oe(e),children:m[e]},e)),
84
+ /* @__PURE__ */J("button",{type:"button",onClick:()=>z("Custom"),className:oe("Custom"),children:m.custom})]}),de=
85
+ /* @__PURE__ */J(wt,{mode:"range",value:N||null,endValue:L||null,month:Z,onMonthChange:te,onSelect:e=>{z("Custom"),!N||N&&L?(C(e),D("")):e<N?(D(N),C(e)):D(e)},weekStartsOn:d,"aria-label":m.dialog});/* @__PURE__ */
86
+ return X("div",{className:"relative"+(h?" w-full":""),ref:P,children:[
87
+ /* @__PURE__ */X("div",{className:`${h?"flex w-full":"inline-flex"} items-center gap-2 border rounded-lg px-2.5 py-1.5 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}`,children:[
88
+ /* @__PURE__ */X("button",{ref:A,type:"button",onClick:()=>{C(e),D(t),z(null),te(Nt(e?Ct(e):G)),w(!0)},"aria-haspopup":"dialog","aria-expanded":v,id:s,"aria-label":c,"aria-labelledby":o,"aria-describedby":K?T:void 0,"aria-controls":v?B:void 0,"aria-required":l||void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
89
+ /* @__PURE__ */J("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),
90
+ /* @__PURE__ */J("span",{className:"truncate",children:ne||f})]}),y&&(e||t)&&/* @__PURE__ */J("button",{type:"button",onClick:ae,"aria-label":m.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),K&&/* @__PURE__ */J("span",{id:T,className:"sr-only",children:se}),i&&/* @__PURE__ */X(Q,{children:[
91
+ /* @__PURE__ */J("input",{type:"hidden",name:i.from,value:e}),
92
+ /* @__PURE__ */J("input",{type:"hidden",name:i.to,value:t})]}),v&&ee(
93
+ /* @__PURE__ */X("div",{ref:F,id:B,role:"dialog","aria-label":m.dialog,"data-layout":R?"stacked":"side",className:"fixed rounded-2xl p-4",style:{zIndex:b.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,width:R&&_?_.maxWidth:"max-content",maxWidth:_?.maxWidth,maxHeight:_?.maxHeight,overflowY:"auto",visibility:_?void 0:"hidden",...k()},children:[
94
+ /* @__PURE__ */X("div",{className:R?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
95
+ /* @__PURE__ */X("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
96
+ /* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-500",children:m.from}),
97
+ /* @__PURE__ */J("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(N?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:N?re(N):m.start})]}),!R&&/* @__PURE__ */J("span",{className:"text-gray-300",children:"—"}),
98
+ /* @__PURE__ */X("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
99
+ /* @__PURE__ */J("span",{className:"text-xs font-medium text-gray-500",children:m.to}),
100
+ /* @__PURE__ */J("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(L?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:L?re(L):m.end})]})]}),R?/* @__PURE__ */X(Q,{children:[
101
+ /* @__PURE__ */J("div",{className:"mb-3 flex flex-wrap gap-1.5",children:ce}),
102
+ /* @__PURE__ */J("div",{className:"w-full",children:de})]}):
103
+ /* @__PURE__ */X("div",{ref:H,className:"flex w-max gap-4",children:[
104
+ /* @__PURE__ */J("div",{className:"w-64",children:de}),
105
+ /* @__PURE__ */J("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:ce})]}),
106
+ /* @__PURE__ */X("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[y&&/* @__PURE__ */J("button",{type:"button",onClick:ae,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:m.clear}),
107
+ /* @__PURE__ */J("button",{type:"button",onClick:()=>w(!1),className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50",children:m.cancel}),
108
+ /* @__PURE__ */J("button",{type:"button",onClick:()=>{r(N,L),w(!1)},disabled:!N||!L,className:"px-4 py-1.5 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m.apply})]})]}),document.body)]})}var zt=/^\d{2}:\d{2}(:\d{2})?$/,Pt=e=>String(e).padStart(2,"0");function St(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Pt(e.getHours())}:${Pt(e.getMinutes())}`;return t?`${r}:${Pt(e.getSeconds())}`:r}return zt.test(e)?e:""}var At=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,className:i="",step:s,...o},c){const d=null!=s&&Number(s)<60,u=M();/* @__PURE__ */
109
+ return J("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":n||void 0,value:St(e,d),min:St(r,d)||void 0,max:St(a,d)||void 0,onChange:e=>t?.(zt.test(e.target.value)?e.target.value:null),className:se({invalid:n,size:l,className:i}),...o})}),Ft=/^\d{4}-\d{2}-\d{2}$/,Bt=/^(aria|data)-/;function Tt(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":$t(e);if(Ft.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":$t(t)}function Wt(e){if(!Ft.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function Et(e,t){const r=Wt(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var It=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,native:i,weekStartsOn:s,className:o="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:m,disabled:p,placeholder:g,required:y,clearable:v,form:w,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,...j},z){const P=v??!y,A=Tt(e),F=Tt(r),B=Tt(a),T=$().datePicker,R=M(),Y=ut(R),[_,H]=W(!1),q=E(null),U=E(null),V=E(null),K=I(),G=I(),Z=be(U,_,{popupRef:V}),[Q,te]=W(!1);S(()=>{const e=!!h&&(U.current?.labels?.length??0)>0;e!==Q&&te(e)});const re=!c&&(!!u||Q);if(O(()=>{if(!_)return;const e=e=>{const t=e.target;q.current?.contains(t)||V.current?.contains(t)||H(!1)};document.addEventListener("pointerdown",e,!0);const t=x(()=>H(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[_]),O(()=>{if(_)return f(e=>"Escape"===e.key&&(H(!1),U.current?.focus(),!0))},[_]),i)/* @__PURE__ */
110
+ return J("input",{ref:z,type:"date",lang:R,id:h,name:m,disabled:p,"aria-label":c,"aria-describedby":d,"aria-invalid":n||void 0,value:A,min:F||void 0,max:B||void 0,onChange:e=>t?.(Wt(e.target.value)),className:se({invalid:n,size:l,className:o}),"aria-labelledby":u,required:y,form:w,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,...j});const ae=Object.fromEntries(Object.entries(j).filter(([e])=>Bt.test(e))),ne=$t(/* @__PURE__ */new Date),le=(!F||ne>=F)&&(!B||ne<=B),ie=g??T.placeholder;/* @__PURE__ */
111
+ return X("div",{ref:q,className:"relative",children:[
112
+ /* @__PURE__ */J("input",{ref:z,type:"hidden",name:m,form:w,value:A}),
113
+ /* @__PURE__ */X("button",{ref:U,type:"button",...ae,id:h,disabled:p,title:k,tabIndex:N,autoFocus:C,onFocus:L,onBlur:D,"aria-haspopup":"dialog","aria-expanded":_,"aria-controls":_?K:void 0,"aria-labelledby":u,"aria-describedby":[re?G:void 0,d].filter(Boolean).join(" ")||void 0,"aria-invalid":n||void 0,"aria-required":y||void 0,"aria-label":c?`${c}${A?`, ${Et(A,Y)}`:""}`:void 0,onClick:()=>H(e=>!e),className:`${se({invalid:n,size:l,className:o})} flex items-center justify-between text-left`,children:[
114
+ /* @__PURE__ */J("span",{className:A?"text-gray-900":"text-gray-400",children:A?Et(A,Y):ie}),
115
+ /* @__PURE__ */J("svg",{className:"h-4 w-4 shrink-0 text-gray-400",fill:"none",stroke:"currentColor",strokeWidth:"1.75",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3M4 11h16M5 7h14a1 1 0 011 1v11a1 1 0 01-1 1H5a1 1 0 01-1-1V8a1 1 0 011-1z"})})]}),re&&/* @__PURE__ */J("span",{id:G,className:"sr-only",children:A?Et(A,Y):ie}),_&&ee(
116
+ /* @__PURE__ */X("div",{ref:V,id:K,role:"dialog","aria-label":c??T.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:b.popup,left:Z?.left,right:Z?.right,top:Z?.top,bottom:Z?.bottom,maxWidth:Z?.maxWidth,visibility:Z?void 0:"hidden"},children:[
117
+ /* @__PURE__ */J(wt,{value:A||null,min:F||null,max:B||null,weekStartsOn:s,onSelect:e=>{H(!1),U.current?.focus(),t?.(Wt(e))}}),(P||le)&&/* @__PURE__ */X("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[P&&/* @__PURE__ */J("button",{type:"button",onClick:()=>{H(!1),U.current?.focus(),t?.(null)},className:"rounded-md px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:T.clear}),le&&/* @__PURE__ */J("button",{type:"button",onClick:()=>{H(!1),U.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-md px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:T.today})]})]}),document.body)]})}),Ot=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Rt=e=>String(e).padStart(2,"0");function Yt(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Rt(t.getMonth()+1)}-${Rt(t.getDate())}T${Rt(t.getHours())}:${Rt(t.getMinutes())}`:Ot.test(e)?e:"";var t}var _t=B(function({value:e,onChange:t,min:r,max:a,invalid:n,size:l,className:i="",...s},o){const c=M();/* @__PURE__ */
118
+ return J("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":n||void 0,value:Yt(e),min:Yt(r)||void 0,max:Yt(a)||void 0,onChange:e=>t?.(function(e){if(!Ot.test(e))return null;const[t,r]=e.split("T"),[a,n,l]=t.split("-").map(Number),[i,s,o=0]=r.split(":").map(Number);if(i>23||s>59||o>59)return null;const c=new Date(a,n-1,l,i,s,o);return c.getMonth()===n-1&&c.getDate()===l?c:null}(e.target.value)),className:se({invalid:n,size:l,className:i}),...s})});function Ht(e){let t=null;try{t=window.getSelection()}catch{return null}if(!t||0===t.rangeCount||t.isCollapsed)return null;const r=e;if(r&&"number"==typeof r.nodeType){let e=!1;for(let a=0;a<t.rangeCount&&!e;a++)e=t.getRangeAt(a).intersectsNode(r);if(!e)return null}const a=t.toString();if(!a.trim())return null;const n=document.createElement("div");for(let e=0;e<t.rangeCount;e++)n.appendChild(t.getRangeAt(e).cloneContents());return{text:a,html:n.innerHTML}}async function qt(e,t){try{if(t&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}const r=r=>{r.clipboardData?.setData("text/plain",e),t&&r.clipboardData?.setData("text/html",t),r.preventDefault()},a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),a.remove()}}async function Ut(e,t,r){const n=await qt(t,r),l=L().copy;return n?a.success(l.copiedLabel(e)):a.error(l.failed),n}var Vt={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},Kt={sm:{box:"gap-1.5 px-2.5 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 py-1.5 text-sm",button:"-my-0.5"}};function Gt(){/* @__PURE__ */
119
+ return J("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})}function Zt(){/* @__PURE__ */
120
+ return J("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function Jt({value:e,children:t,symbol:r,label:n,size:l="md",variant:i="bordered",hideCopyButton:s=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=W(!1),g=E(null),f=$().copy;O(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=T(async()=>{await qt(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):a.error(f.failed)},[e,o,f]),{box:b,button:y}=Kt[l],v=!s;/* @__PURE__ */
121
+ return X("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",Vt[i],b,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
122
+ /* @__PURE__ */J("span",{className:"min-w-0 font-mono text-gray-800 "+(c?"whitespace-pre-wrap break-all":"truncate"),title:c?void 0:e,children:t??e}),!s&&/* @__PURE__ */X(Q,{children:[
123
+ /* @__PURE__ */J(te,{id:d,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":u,onClick:x,className:`${y} text-gray-400`,children:/* @__PURE__ */J(m?Zt:Gt,{})}),
124
+ /* @__PURE__ */J("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var Xt=2;function Qt(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function er(e){return e.slice(0,-1)}var tr=["1","2","3","4","5","6","7","8","9",".","0"];function rr({value:e,onChange:t,onEnter:r,enterLabel:a,enterDisabled:n,className:l=""}){const i=$().keypad,s=r=>{r!==e&&t(r)};/* @__PURE__ */
125
+ return X("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[tr.map(t=>/* @__PURE__ */J(u,{size:"touch-xl",variant:"secondary",onClick:()=>s(Qt(e,t)),children:t},t)),
126
+ /* @__PURE__ */J(u,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(er(e)),children:"⌫"}),r&&/* @__PURE__ */J(u,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:n,onClick:r,children:a??i.enter})]})}var ar={md:"h-24 p-3",lg:"h-32 p-4"},nr=B(function({title:e,subtitle:t,size:r="lg",selected:a=!1,disabled:n,type:l="button",className:i="",...s},o){/* @__PURE__ */
127
+ return X("button",{ref:o,type:l,disabled:n,"aria-pressed":a||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",a?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",ar[r],i].filter(Boolean).join(" "),...s,children:[
128
+ /* @__PURE__ */J("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */J("span",{className:"text-sm text-gray-500",children:t})]})}),lr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},ir="bg-white text-gray-900 shadow-sm",sr="text-gray-500 hover:text-gray-700";function or({value:e,onChange:t,options:r,name:a,size:n="md",block:l=!1,label:i,className:s=""}){const o=I(),c=`inline-flex max-w-full items-center gap-1 overflow-x-auto rounded-lg bg-gray-100 p-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden ${l?"w-full":""} ${s}`.trim(),d="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
129
+ return J("div",a?{role:"radiogroup","aria-label":i,className:c,children:r.map(r=>{const l=`${o}-${r.value}`,i=r.value===e;
130
+ /* @__PURE__ */
131
+ return X("label",{htmlFor:l,className:[d,lr[n],i?ir:sr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
132
+ /* @__PURE__ */J("input",{id:l,type:"radio",name:a,value:r.value,checked:i,disabled:r.disabled,onChange:()=>t(r.value),className:"sr-only"}),r.icon,r.label]},r.value)})}:{role:"group","aria-label":i,className:c,children:r.map(r=>{const a=r.value===e;/* @__PURE__ */
133
+ return X("button",{type:"button","aria-pressed":a,disabled:r.disabled,onClick:()=>t(r.value),className:[d,lr[n],a?ir:sr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value)})})}var cr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},dr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},ur={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},hr=B(function({checked:e,onChange:t,disabled:r=!1,size:a="md",label:n,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=I(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=o&&""!==o,x=f?`${m}-reason`:void 0,b=[p,g??x].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */J("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":b,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",cr[a],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */J("span",{className:["inline-block rounded-full bg-white shadow transition-transform",dr[a],e?ur[a]:"translate-x-0"].join(" ")})});return n||l||f?/* @__PURE__ */X("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
134
+ /* @__PURE__ */X("span",{className:"min-w-0",children:[n&&/* @__PURE__ */J("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:n}),l&&/* @__PURE__ */J("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */J("span",{id:x,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */J("span",{className:s,children:y})}),mr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function pr(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var gr=B(function({value:e,onChange:t,min:r,max:a,precision:n,step:l,disabled:i,invalid:s,placeholder:o,size:c,prefix:d,suffix:u,id:h,name:m,className:p="",onBlur:g},f){const[x,b]=W(()=>mr(e,n)),y=E(x);y.current=x,O(()=>{pr(y.current)!==e&&b(mr(e,n))},[e,n]);const v=/* @__PURE__ */J("input",{ref:f,id:h,name:m,type:"text",inputMode:0===n?"numeric":"decimal",value:x,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":a,"aria-valuetext":null==e?void 0:mr(e,n),"aria-invalid":s||void 0,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(b(r),t(pr(r)))},onKeyDown:e=>{const s=l??1,o="ArrowUp"===e.key?s:"ArrowDown"===e.key?-s:"PageUp"===e.key?10*s:"PageDown"===e.key?10*-s:null;null===o||i||(e.preventDefault(),(e=>{let i=(pr(y.current)??0)+e;null!=r&&i<r&&(i=r),null!=a&&i>a&&(i=a);const s=n??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),b(mr(i,n)),t(i)})(o))},onBlur:()=>{const e=pr(x);if(null==e)b(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=a&&l>a&&(l=a),null!=n&&(l=Number(l.toFixed(n))),b(mr(l,n)),l!==e&&t(l)}g?.()},className:se({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */X("div",{className:"relative",children:[d&&/* @__PURE__ */J("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:d}),v,u&&/* @__PURE__ */J("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):v}),fr=B(function({files:e,onChange:t,accept:r,acceptHint:a,multiple:n=!0,maxSizeBytes:l,maxFiles:i,disabled:d=!1,label:u,hint:h,error:m,required:p,className:g=""},f){const x=I(),b=$().files,y=s({accept:r,acceptHint:a,maxSizeBytes:l,maxFiles:i,multiple:n,disabled:d,currentCount:e.length,onAccept:r=>t(n?[...e,...r]:r.slice(0,1))}),v=m?`${x}-error`:h?`${x}-hint`:void 0;/* @__PURE__ */
135
+ return X(je,{label:u,htmlFor:x,hint:h,error:m,required:p,className:g,children:[
136
+ /* @__PURE__ */X("button",{ref:f,type:"button",id:x,disabled:d,onClick:y.open,"aria-invalid":!!m||void 0,"aria-required":p||void 0,"aria-describedby":v,...y.zoneProps,className:Ee(y.dragOver,d,`px-4 py-6 ${Ie(d)}`),children:[
137
+ /* @__PURE__ */X("span",{children:[
138
+ /* @__PURE__ */J("span",{className:"text-sm font-medium text-blue-600",children:n?b.chooseMany:b.chooseOne}),
139
+ /* @__PURE__ */J("span",{className:"text-sm text-gray-500",children:` ${n?b.dragMany:b.dragOne}`})]}),a&&/* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:a})]}),
140
+ /* @__PURE__ */J("input",{...y.inputProps}),e.length>0&&/* @__PURE__ */J("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,a)=>/* @__PURE__ */X("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
141
+ /* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
142
+ /* @__PURE__ */J("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:o(r.size,b)}),
143
+ /* @__PURE__ */J("button",{type:"button",disabled:d,onClick:()=>{y.clearRejections(),t(e.filter((e,t)=>t!==a))},"aria-label":b.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */J(He,{})})]},`${r.name}-${a}`))}),
144
+ /* @__PURE__ */J(c,{rejections:y.rejections})]})});function xr({className:e="h-4 w-4"}){/* @__PURE__ */
145
+ return J("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:/* @__PURE__ */J("path",{d:"M21 11.5l-8.5 8.5a5.5 5.5 0 0 1-7.8-7.8l9-9a3.5 3.5 0 0 1 5 5l-9 9a1.5 1.5 0 0 1-2.1-2.1l8-8"})})}function br({className:e="h-4 w-4"}){/* @__PURE__ */
146
+ return X("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
147
+ /* @__PURE__ */J("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),
148
+ /* @__PURE__ */J("path",{d:"M14 3v5h5"})]})}function yr({intake:e,dropLabel:t,className:r="",children:a}){const n=$().files;/* @__PURE__ */
149
+ return X("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[a,
150
+ /* @__PURE__ */J("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */J("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg border-2 border-dashed border-blue-500 bg-blue-50/80 text-sm font-medium text-blue-600",children:t??n.drop})]})}function vr({files:e,onRemove:t,disabled:r=!1,className:a=""}){const n=$().files,l=E(/* @__PURE__ */new Map);O(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),O(()=>()=>{for(const e of l.current.values())URL.revokeObjectURL(e);l.current.clear()},[]);const i=e=>{if(!e.type.startsWith("image/")||"undefined"==typeof URL||"function"!=typeof URL.createObjectURL)return null;let t=l.current.get(e);return t||(t=URL.createObjectURL(e),l.current.set(e,t)),t};return 0===e.length?null:/* @__PURE__ */J("ul",{className:`flex flex-wrap gap-1.5 ${a}`,children:e.map((e,a)=>{const l=i(e);/* @__PURE__ */
151
+ return X("li",{className:"flex max-w-full items-center gap-1.5 rounded-md border border-gray-200 bg-gray-50 py-1 pl-1.5 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */J("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */J("span",{className:"text-gray-400",children:/* @__PURE__ */J(br,{})}),
152
+ /* @__PURE__ */J("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
153
+ /* @__PURE__ */J("span",{className:"shrink-0 tabular-nums text-gray-400",children:o(e.size,n)}),t&&/* @__PURE__ */J("button",{type:"button",disabled:r,onClick:()=>t(a),"aria-label":n.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */J(He,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${a}`)})})}function wr({onClick:e,count:t=0,variant:r="button",label:a,disabled:n=!1}){const l=$().files,i=a??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */X("span",{className:"relative inline-flex",children:[
154
+ /* @__PURE__ */J(te,{"aria-label":s,onClick:e,disabled:n,size:"sm",children:/* @__PURE__ */J(xr,{})}),t>0&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-[10px] font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */J(u,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:n,leftIcon:/* @__PURE__ */J(xr,{}),children:s})}function kr({files:e,onChange:t,accept:r,maxSizeBytes:a,maxFiles:n,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:d,trigger:u="button",actions:h,onReject:m,className:p="",children:g}){const f=s({accept:r,maxSizeBytes:a,maxFiles:n,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),x=E([]);return O(()=>{m&&f.rejections.length>0&&f.rejections!==x.current&&(x.current=f.rejections,m(f.rejections))},[f.rejections,m]),/* @__PURE__ */X(yr,{intake:f,dropLabel:o,className:p,children:[g,
155
+ /* @__PURE__ */J(vr,{files:e,disabled:i,onRemove:r=>{f.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
156
+ /* @__PURE__ */X("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
157
+ /* @__PURE__ */J(wr,{onClick:f.open,count:e.length,variant:u,label:d,disabled:i}),h]}),
158
+ /* @__PURE__ */J(c,{rejections:f.rejections})]})}function Nr({onClear:e,ariaLabel:t}){/* @__PURE__ */
159
+ return J("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function Mr({value:e,onChange:t,options:r,placeholder:a,emptyOptionLabel:n,className:l="",disabled:i,id:s,allowFreeText:o=!1,onSearchChange:c,rightAdornment:d}){const[u,h]=W(!1),[m,p]=W(""),g=$(),y=n??g.select.none,v=e=>{p(e),c?.(e)},w=E(null),N=E(null),M=E(null),C=E(null),L=E(u);L.current=u;const D=E(!1),j=r=>{if(!L.current)return;L.current=!1;const a=m.trim();r&&o&&a&&a!==e&&t(a),h(!1),v("")},[z,P]=W(null);S(()=>{if(!d||u)return void P(null);const t=C.current?.offsetWidth??0;P(t?t+(e&&!i?32:8)+6:null)});const A=be(N,u,{matchTriggerWidth:!0}),F=Y(()=>{const t=r.find(t=>t.value===e);return t?t.label:o?e:""},[r,e,o]);O(()=>{if(!u)return;const e=e=>{const t=e.target;w.current?.contains(t)||M.current?.contains(t)||j(!0)};document.addEventListener("mousedown",e);const t=x(()=>j(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[u,o,m,e,t]),O(()=>{if(u)return f(e=>!("Escape"!==e.key||!L.current)&&(j(!1),N.current?.blur(),!0))},[u]);const B=Y(()=>{const e=/* @__PURE__ */new Set,t=[];for(const a of r)e.has(a.value)||(e.add(a.value),t.push(a));return t},[r]),T=Y(()=>{if(c)return B;const e=m.trim().toLowerCase();return e?B.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):B},[B,m,c]);/* @__PURE__ */
160
+ return X("div",{ref:w,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(w.current?.contains(t)||M.current?.contains(t))||D.current||document.activeElement!==N.current&&j(!0)},children:[
161
+ /* @__PURE__ */J("input",{id:s,ref:N,type:"text",autoComplete:"off",role:"combobox","aria-expanded":u,value:u?m:F,onChange:e=>{v(e.target.value),h(!0)},onFocus:()=>{i||(v(""),h(!0))},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),1===T.length?(t(T[0].value),j(!1)):o&&m.trim()&&(t(m.trim()),j(!1),N.current?.blur())):"Escape"===e.key?(j(!1),N.current?.blur()):"Tab"===e.key&&j(!0)},placeholder:a||y,className:`${le} ${l} ${e?"pr-8":""} ${i?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:z?{paddingRight:z}:void 0,disabled:i}),e&&!i&&/* @__PURE__ */J(Nr,{ariaLabel:g.select.clear,onClear:()=>{t(""),j(!1)}}),d&&!u&&/* @__PURE__ */J("div",{ref:C,className:`absolute top-1/2 -translate-y-1/2 ${e&&!i?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:d}),u&&ee(
162
+ /* @__PURE__ */J("div",{ref:M,onMouseDownCapture:()=>{D.current=!0,setTimeout(()=>{D.current=!1},0)},className:"fixed rounded-2xl overflow-hidden",style:{zIndex:b.popup,left:A?.left,right:A?.right,top:A?.top,bottom:A?.bottom,minWidth:A?.minWidth,width:A?.width,visibility:A?void 0:"hidden",...k()},children:/* @__PURE__ */J("div",{className:"overflow-y-auto",style:{maxHeight:A?.maxHeight??ue},children:0===T.length?/* @__PURE__ */J("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:g.select.noMatches}):T.map(r=>/* @__PURE__ */X("button",{type:"button",onMouseDown:()=>{t(r.value),j(!1)},className:"w-full overflow-hidden text-left px-3 py-1.5 text-sm hover:bg-gray-50 flex items-center justify-between gap-2 whitespace-nowrap "+(e===r.value?"text-blue-600 font-medium bg-blue-50/50":"text-gray-700"),children:[
163
+ /* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.sublabel&&/* @__PURE__ */J("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:r.sublabel})]},r.value))})}),document.body)]})}function $r({value:e,onChange:t,options:r=[],placeholder:a,allowFreeText:n=!1,invalid:l,disabled:i,id:s,className:o=""}){const[c,d]=W(!1),[u,h]=W(""),m=$(),p=E(null),g=E(null),f=E(null),y=be(p,c),v=e=>r.find(t=>t.value===e)?.label??e,w=Y(()=>{const t=new Set(e),a=[],n=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),n&&!e.label.toLowerCase().includes(n)||a.push(e));return a},[r,e,u]),N=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},M=r=>t(e.filter(e=>e!==r)),C=()=>{const e=u.trim();n&&e?N(e):h("")},L=E(()=>{});L.current=()=>{C(),d(!1)},O(()=>{if(!c)return;const e=e=>{const t=e.target;p.current?.contains(t)||f.current?.contains(t)||(C(),d(!1))};document.addEventListener("mousedown",e);const t=x(()=>L.current());return()=>{document.removeEventListener("mousedown",e),t()}});const D=r.length>0;/* @__PURE__ */
164
+ return X("div",{ref:p,className:"relative",children:[
165
+ /* @__PURE__ */X("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),g.current?.focus())},className:se({invalid:l,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${i?"bg-gray-50 cursor-not-allowed":""} ${o}`}),children:[e.map(e=>/* @__PURE__ */X("span",{className:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-1.5 py-0.5 text-xs font-medium text-blue-700",children:[
166
+ /* @__PURE__ */J("span",{className:"truncate",children:v(e)}),!i&&/* @__PURE__ */J("button",{type:"button","aria-label":m.select.removeItem?.(v(e))??`${m.select.remove} ${v(e)}`,onClick:()=>M(e),className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none",children:"×"})]},e)),
167
+ /* @__PURE__ */J("input",{id:s,ref:g,type:"text",autoComplete:"off",role:"combobox","aria-expanded":c&&D,"aria-invalid":l||void 0,disabled:i,value:u,placeholder:0===e.length?a:void 0,onChange:e=>{h(e.target.value),d(!0)},onFocus:()=>{!i&&D&&d(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&n){t.preventDefault();const e=u.trim(),r=e?w.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?N(r[0].value):C()}else"Backspace"===t.key&&""===u&&e.length>0?M(e[e.length-1]):"Escape"===t.key?(d(!1),h(""),g.current?.blur()):"Tab"===t.key&&(C(),d(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),c&&D&&ee(
168
+ /* @__PURE__ */J("div",{ref:f,className:"fixed rounded-2xl overflow-hidden",style:{zIndex:b.popup,left:y?.left,right:y?.right,top:y?.top,bottom:y?.bottom,minWidth:y?.minWidth,maxWidth:y?.maxWidth??de,width:"max-content",visibility:y?void 0:"hidden",...k()},children:/* @__PURE__ */J("div",{className:"overflow-y-auto",style:{maxHeight:y?.maxHeight??ue},children:0===w.length?/* @__PURE__ */J("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?m.select.allSelected:m.select.noMatches}):w.map(e=>/* @__PURE__ */J("button",{type:"button",onMouseDown:t=>{t.preventDefault(),N(e.value)},className:"w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.label},e.value))})}),document.body)]})}var Cr={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}};function Lr({children:e,header:t,footer:r,padded:a=!0,padding:n,headingLevel:l,headerActions:i,"aria-label":s,className:o="",bodyClassName:c="",style:d}){const u=Cr[n??(a?"md":"none")],h=I(),m=null!=l&&null!=t,p=`h${l}`,g=m||null!=s&&""!==s,f=g?"section":"div",x=`rounded-lg border border-gray-200 bg-white shadow-sm ${o}`.trim(),b=`border-b border-gray-100 ${u.edge} text-sm font-semibold text-gray-900`;/* @__PURE__ */
169
+ return X(f,{className:x,style:d,...m?{"aria-labelledby":h}:g?{"aria-label":s}:{},children:[null!=t&&(null!=i?
170
+ /* @__PURE__ */X("div",{className:`${b} flex items-center justify-between gap-3`,children:[m?/* @__PURE__ */J(p,{id:h,children:t}):/* @__PURE__ */J("span",{children:t}),i]}):m?
171
+ /* @__PURE__ */J(p,{id:h,className:b,children:t}):/* @__PURE__ */J("div",{className:b,children:t})),
172
+ /* @__PURE__ */J("div",{className:[u.body,c].filter(Boolean).join(" "),children:e}),r&&/* @__PURE__ */J("div",{className:`border-t border-gray-100 ${u.edge}`,children:r})]})}function Dr({label:e,value:t,icon:r,delta:a,className:n=""}){const l=M(),i="number"==typeof t&&l?D(t,l):t,s="up"===a?.direction?"text-green-600":"down"===a?.direction?"text-red-600":"text-gray-500",o="up"===a?.direction?"▲":"down"===a?.direction?"▼":"→";/* @__PURE__ */
173
+ return X("div",{className:`rounded-lg border border-gray-200 bg-white p-4 shadow-sm ${n}`.trim(),children:[
174
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between",children:[
175
+ /* @__PURE__ */J("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),r&&/* @__PURE__ */J("span",{className:"text-gray-400",children:r})]}),
176
+ /* @__PURE__ */X("div",{className:"mt-2 flex items-baseline gap-2",children:[
177
+ /* @__PURE__ */J("span",{className:"text-2xl font-semibold text-gray-900",children:i}),a&&/* @__PURE__ */X("span",{className:`text-xs font-medium ${s}`,children:[o," ",a.value]})]})]})}var jr={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},zr={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Pr={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function Sr({children:e,tone:t="default",size:r="sm",weight:a="normal",truncate:n=!1,as:l="span",className:i="",...s}){/* @__PURE__ */
178
+ return J(l,{className:[jr[t],zr[r],Pr[a],n?"block truncate":"",i].filter(Boolean).join(" "),title:s.title??(n&&"string"==typeof e?e:void 0),htmlFor:s.htmlFor,children:e})}var Ar={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function Fr({children:e,level:t=2,tone:r="default",className:a=""}){/* @__PURE__ */
179
+ return J(`h${t}`,{className:[Ar[t],jr[r],a].filter(Boolean).join(" "),children:e})}function Br({children:e,tone:t="secondary",size:r="sm",className:a=""}){/* @__PURE__ */
180
+ return J("p",{className:[jr[t],zr[r],"mb-2 last:mb-0",a].filter(Boolean).join(" "),children:e})}var Tr={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},Wr={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Er={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Ir({children:e,gap:t=4,align:r,justify:a,className:n=""}){/* @__PURE__ */
181
+ return J("div",{className:["flex flex-col",Tr[t],r?Wr[r]:"",a?Er[a]:"",n].filter(Boolean).join(" "),children:e})}function Or({children:e,gap:t=2,align:r="center",justify:a,wrap:n=!0,className:l=""}){/* @__PURE__ */
182
+ return J("div",{className:["flex",n?"flex-wrap":"",Tr[t],Wr[r],a?Er[a]:"",l].filter(Boolean).join(" "),children:e})}var Rr={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Yr={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",6:"sm:grid-cols-6",12:"sm:grid-cols-12"},_r={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",6:"lg:grid-cols-6",12:"lg:grid-cols-12"};function Hr({children:e,cols:t=1,smCols:r,lgCols:a,gap:n=4,className:l=""}){/* @__PURE__ */
183
+ return J("div",{className:["grid",Rr[t],r?Yr[r]:"",a?_r[a]:"",Tr[n],l].filter(Boolean).join(" "),children:e})}var qr={sm:"my-2",md:"my-4",lg:"my-6"};function Ur({orientation:e="horizontal",children:t,align:r="center",spacing:a="md",className:n=""}){const l=I();if("vertical"===e)/* @__PURE__ */
184
+ return J("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${n}`.trim()});if(!t)/* @__PURE__ */
185
+ return J("hr",{className:`border-0 border-t border-gray-200 ${qr[a]} ${n}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",s="right"===r?"w-4 shrink-0":"flex-1";
186
+ /* @__PURE__ */
187
+ return X("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${qr[a]} ${n}`.trim(),children:[
188
+ /* @__PURE__ */J("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
189
+ /* @__PURE__ */J("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
190
+ /* @__PURE__ */J("span",{"aria-hidden":"true",className:`${s} border-t border-gray-200`})]})}var Vr={text:"rounded",rect:"rounded-md",circle:"rounded-full"},Kr=e=>"number"==typeof e?`${e}px`:e;function Gr({variant:e="text",width:t,height:r,lines:a=1,className:n=""}){const l=`animate-pulse bg-gray-200 ${Vr[e]} ${n}`.trim();if("circle"===e){const e=Kr(r??t)??"2.5rem";/* @__PURE__ */
191
+ return J("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:Kr(t)??"100%",height:Kr(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
192
+ return J("span","text"===e&&a>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:a},(e,t)=>/* @__PURE__ */J("span",{className:`block ${l}`,style:{...i,width:t===a-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Zr={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Jr={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},Xr={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Qr={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function ea({items:e,columns:t=1,bordered:r=!1,size:a="md",title:n,className:l="",emptyText:i="—"}){const s="number"==typeof t?{base:t}:t,o=s.base??1,c=Math.max(o,s.sm??0,s.lg??0),d="sm"===a?"px-3 py-2":"px-4 py-3",u="sm"===a?"text-xs":"text-sm";/* @__PURE__ */
193
+ return X("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[n&&/* @__PURE__ */J("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:n}),
194
+ /* @__PURE__ */J("dl",{className:["grid",Zr[o],s.sm?Jr[s.sm]:"",s.lg?Xr[s.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */X("div",{className:[e.span?Qr[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
195
+ /* @__PURE__ */J("dt",{className:`${u} text-gray-500`,children:e.label}),
196
+ /* @__PURE__ */J("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}function ta({name:e,value:t,description:r,controlId:a,unknownText:n="—",quiet:l=!1,className:i=""}){const s=null==t||""===t,o=l?"text-gray-500":"text-gray-800",c=s?"text-gray-400":l?"text-gray-500":"text-gray-900";/* @__PURE__ */
197
+ return X("div",{className:i,children:[
198
+ /* @__PURE__ */X("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[a?/* @__PURE__ */J("label",{htmlFor:a,className:`min-w-0 text-sm font-medium ${o}`,children:e}):/* @__PURE__ */J("span",{className:`min-w-0 text-sm font-medium ${o}`,children:e}),
199
+ /* @__PURE__ */J("span",{className:`shrink-0 text-sm ${c}`,children:s?n:t})]}),r&&/* @__PURE__ */J("p",{className:"mt-1 text-xs leading-relaxed text-gray-500",children:r})]})}var ra={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function aa({count:e=0,max:t=99,dot:r=!1,tone:a="danger",showZero:n=!1,children:l,className:i=""}){const s=r||e>0||0===e&&n,o=M(),c=e>t?`${D(t,o)}+`:D(e,o),d=s?/* @__PURE__ */J("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${ra[a]}`,"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${ra[a]}`,children:c}):null;return l?/* @__PURE__ */X("span",{className:`relative inline-flex ${i}`.trim(),children:[l,d&&/* @__PURE__ */J("span",{className:"absolute -right-1.5 -top-1.5 flex",children:d})]}):d}var na={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},la={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function ia({title:e,value:t,precision:r,prefix:a,suffix:n,tone:l="default",size:i="md",className:s=""}){const o=M(),c="number"!=typeof t?t:null!=r?j(t,r,o):o?D(t,o):t;/* @__PURE__ */
200
+ return X("div",{className:s,children:[e&&/* @__PURE__ */J("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
201
+ /* @__PURE__ */X("div",{className:`mt-1 flex items-baseline gap-1 ${la[l]}`,children:[a&&/* @__PURE__ */J("span",{className:"text-sm",children:a}),
202
+ /* @__PURE__ */J("span",{className:`font-semibold tabular-nums ${na[i]}`,children:c}),n&&/* @__PURE__ */J("span",{className:"text-sm",children:n})]})]})}var sa={xs:24,sm:32,md:40,lg:56},oa={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function ca(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function da({src:e,name:t,size:r="md",status:a,className:n=""}){const l=sa[r],i=Math.max(8,Math.round(.28*l)),[s,o]=W(!1);O(()=>{o(!1)},[e]);const c=Boolean(e)&&!s;
203
+ /* @__PURE__ */
204
+ return X("span",{className:`relative inline-flex shrink-0 ${n}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */J("img",{src:e,alt:"",onError:()=>o(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */J("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:ca(t)}),a&&/* @__PURE__ */J("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${oa[a]}`,style:{width:i,height:i}})]})}function ua({children:e,max:t,size:r="md",className:a=""}){const n=_.toArray(e),l=t?n.slice(0,t):n,i=t?n.length-l.length:0,s=sa[r],o=Math.round(.3*s),c=M();/* @__PURE__ */
205
+ return X("div",{className:`flex items-center ${a}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */J("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-o},children:e},t)),i>0&&/* @__PURE__ */X("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:s,height:s,marginLeft:-o,fontSize:Math.round(.36*s)},children:["+",D(i,c)]})]})}var ha={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"}},ma={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white"};function pa({tone:e}){const t={className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
206
+ return J("svg",{...t,children:/* @__PURE__ */J("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",clipRule:"evenodd"})});case"warning":/* @__PURE__ */
207
+ return J("svg",{...t,children:/* @__PURE__ */J("path",{fillRule:"evenodd",d:"M8.3 2.8a2 2 0 013.4 0l6 10A2 2 0 0116 16H4a2 2 0 01-1.7-3.2l6-10zM10 7a1 1 0 00-1 1v3a1 1 0 102 0V8a1 1 0 00-1-1zm0 7a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})});case"danger":/* @__PURE__ */
208
+ return J("svg",{...t,children:/* @__PURE__ */J("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 10-1.4-1.4L10 8.6 8.7 7.3z",clipRule:"evenodd"})});default:/* @__PURE__ */
209
+ return J("svg",{...t,children:/* @__PURE__ */J("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})})}}function ga({tone:e="info",emphasis:t="subtle",title:r,children:a,icon:n,action:l,onDismiss:i,sticky:s=!1,className:o=""}){const c=ha[e],d="solid"===t,u=$().banner,h=d?ma[e]:c.box;/* @__PURE__ */
210
+ return X("div",{role:"danger"===e?"alert":"status",className:`${s?"sticky top-0 z-30":""} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${o}`.trim(),children:[
211
+ /* @__PURE__ */J("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:n??/* @__PURE__ */J(pa,{tone:e})}),
212
+ /* @__PURE__ */X("div",{className:"min-w-0 flex-1 text-sm",children:[r&&/* @__PURE__ */J("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),a&&/* @__PURE__ */J("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:a})]}),null!=l&&/* @__PURE__ */J("div",{className:"shrink-0 self-center",children:l}),i&&/* @__PURE__ */J("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */J("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var fa=(e,t)=>`${e}-tab-${t}`,xa=(e,t)=>`${e}-panel-${t}`,ba={underline:"flex items-center gap-1 border-b border-gray-200",pill:"inline-flex items-center gap-1 rounded-lg bg-gray-100 p-1"};function ya(e,t){return"pill"===e?"inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"bg-blue-600 text-white shadow-sm":"text-gray-600 hover:text-gray-900"):"-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 "+(t?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:border-gray-300 hover:text-gray-900")}function va({items:e,value:t,onChange:r,variant:a="underline",idPrefix:n,className:l="","aria-label":i,"aria-labelledby":s}){const o=E([]),c=(t,r)=>{for(let a=1;a<=e.length;a+=1){const n=((t+r*a)%e.length+e.length)%e.length;if(!e[n]?.disabled)return n}return null},d=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
213
+ return J("div",{role:"tablist","aria-label":i,"aria-labelledby":s,onKeyDown:a=>{const n=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===a.key||"ArrowDown"===a.key)l=c(n,1);else if("ArrowLeft"===a.key||"ArrowUp"===a.key)l=c(n,-1);else if("Home"===a.key)l=d(1);else{if("End"!==a.key)return;l=d(-1)}a.preventDefault(),null!==l&&l!==n&&(r(e[l].id),o.current[l]?.focus())},className:`${ba[a]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t;/* @__PURE__ */
214
+ return X("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:n?fa(n,e.id):void 0,"aria-controls":n?xa(n,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:ya(a,i),children:[e.icon&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var wa=()=>/* @__PURE__ */J("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function ka({items:e,value:t,onChange:r,"aria-label":a,className:n=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
215
+ return J("ol",{"aria-label":a,className:`grid items-start ${n}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,a)=>{const n=a<l?"complete":a===l?"current":"upcoming",i="complete"===n&&!!r,s=/* @__PURE__ */J("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===n?"bg-blue-600 text-white":"","current"===n?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===n?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===n?/* @__PURE__ */J(wa,{}):a+1}),o=/* @__PURE__ */X("span",{className:"min-w-0 text-center",children:[
216
+ /* @__PURE__ */J("span",{className:"block text-sm font-medium "+("upcoming"===n?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */J("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
217
+ return X("li",{"aria-current":"current"===n?"step":void 0,className:"relative flex min-w-0 justify-center",children:[a<e.length-1&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(a<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */X("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[s,o]}):/* @__PURE__ */X("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 px-2 text-center",children:[s,o]})]},t.id)})})}function Na({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:a,allowMultiple:n=!1,className:l=""}){const[i,s]=W(t),o=r??i;/* @__PURE__ */
218
+ return J("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${l}`.trim(),children:e.map(e=>{const t=o.includes(e.id);/* @__PURE__ */
219
+ return X("div",{children:[
220
+ /* @__PURE__ */X("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=o.includes(e)?o.filter(t=>t!==e):n?[...o,e]:[e];void 0===r&&s(t),a?.(t)})(e.id),className:"flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:[
221
+ /* @__PURE__ */J("span",{children:e.title}),
222
+ /* @__PURE__ */J("svg",{className:"h-4 w-4 shrink-0 text-gray-400 transition-transform "+(t?"rotate-180":""),viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */J("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var Ma={top:"bottom-full left-1/2 -translate-x-1/2 mb-3",bottom:"top-full left-1/2 -translate-x-1/2 mt-3",left:"right-full top-1/2 -translate-y-1/2 mr-3",right:"left-full top-1/2 -translate-y-1/2 ml-3"};function $a({content:e,side:t="top",delay:r=200,children:a}){const[n,l]=W(!1),[i,s]=W(null),o=E(void 0),c=E(null),d=E(null),u=I(),h=()=>{o.current=window.setTimeout(()=>l(!0),r)},m=()=>{window.clearTimeout(o.current),l(!1)};O(()=>()=>window.clearTimeout(o.current),[]),S(()=>{if(!n)return void s(null);const e=()=>{const e=c.current,r=d.current;if(!e||!r)return;const a=he(e),n=Math.max(0,a.right-a.left-16),l=Math.max(0,a.bottom-a.top-16);r.style.maxWidth=`${n}px`,r.style.maxHeight=`${l}px`;const i=r.getBoundingClientRect();if(i.width<=0||i.height<=0)return;const o=e.getBoundingClientRect(),u=function(e,t,r,a,n){const l=ge(e,a,n),i=e=>l[e]-("top"===e||"bottom"===e?t.height:t.width),s=[r,me[r],...pe[r]],o=s.find(e=>i(e)>=0)??s.reduce((e,t)=>i(t)>i(e)?t:e),c=(e.left+e.right)/2,d=(e.top+e.bottom)/2;let u,h;switch(o){case"top":u=c-t.width/2,h=e.top-n-t.height;break;case"bottom":u=c-t.width/2,h=e.bottom+n;break;case"left":u=e.left-n-t.width,h=d-t.height/2;break;case"right":u=e.right+n,h=d-t.height/2}return{side:o,left:fe(u,a.left+8,a.right-8-t.width),top:fe(h,a.top+8,a.bottom-8-t.height)}}(o,i,t,a,12),h=function(e,t,r,a,n){const{side:l,left:i,top:s}=t,o=i+r.width,c=s+r.height;if({top:e.top-c,bottom:s-e.bottom,left:e.left-o,right:i-e.right}[l]<n)return null;const d=(e,t,r)=>r<2*a?t+r/2:Math.max(t+a,Math.min(e,t+r-a)),u=(e.left+e.right)/2,h=(e.top+e.bottom)/2;switch(l){case"top":return{side:l,x:d(u,i,r.width),y:c};case"bottom":return{side:l,x:d(u,i,r.width),y:s};case"left":return{side:l,x:o,y:d(h,s,r.height)};case"right":return{side:l,x:i,y:d(h,s,r.height)}}}(o,u,i,16,6),m={left:u.left-o.left,top:u.top-o.top,maxWidth:n,maxHeight:l,side:u.side,arrow:h&&{left:h.x-o.left,top:h.y-o.top}};s(e=>{return e&&(r=m,(t=e).left===r.left&&t.top===r.top&&t.maxWidth===r.maxWidth&&t.maxHeight===r.maxHeight&&t.side===r.side&&t.arrow?.left===r.arrow?.left&&t.arrow?.top===r.arrow?.top)?e:m;var t,r})};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[n,t,e]),O(()=>{if(n)return f(e=>"Escape"===e.key&&(m(),!0))},[n]);const p=n?u:void 0,g=H(a)?q(a,{"aria-describedby":[a.props["aria-describedby"],p].filter(Boolean).join(" ")||void 0}):a,x=n?k():void 0,b=n?N():void 0;/* @__PURE__ */
223
+ return X("span",{ref:c,className:"relative inline-flex","aria-describedby":H(a)?void 0:p,onMouseEnter:h,onMouseLeave:m,onFocus:h,onBlur:m,children:[g,n&&
224
+ /* @__PURE__ */J("span",{ref:d,id:u,role:"tooltip",className:`pointer-events-none absolute z-[300] box-border w-max overflow-hidden whitespace-normal break-words text-start rounded-md px-2 py-1 text-xs text-gray-800 ${i?"":Ma[t]}`,style:{...x,...i&&{left:i.left,top:i.top,maxWidth:i.maxWidth,maxHeight:i.maxHeight}},children:e}),n&&(!i||i.arrow)&&
225
+ /* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tooltip-arrow","data-side":i?.side??t,style:{background:b,"--rosh-tooltip-edge":x?.border,...i?.arrow&&{left:i.arrow.left,top:i.arrow.top}}})]})}var Ca={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},La={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function Da(e,t="subtle"){return"solid"===t?La[e]:Ca[e]}var ja=R({});function za({groups:e,children:t}){/* @__PURE__ */
226
+ return J(ja.Provider,{value:e,children:t})}function Pa({status:e,label:t,emphasis:r="subtle"}){const a=Da(U(ja)[e]??"neutral",r),n=t??e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());/* @__PURE__ */
227
+ return J("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${a}`,children:n})}function Sa({colorClass:e,tone:t,children:r,size:a="sm",capitalize:n=!1,closable:l=!1,onClose:i,closeLabel:s,className:o=""}){const c=e??Ca[t??"neutral"],d="xs"===a?"px-2 py-0.5 text-[10px]":"md"===a?"px-2.5 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=n?"capitalize":"",h=$().badge,m=s??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===a?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
228
+ return X("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,o].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */J("button",{type:"button",onClick:i,"aria-label":m,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */J("svg",{className:p,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})}function Aa({title:e,message:t,description:r,hint:a,variant:n,frameless:l,icon:i,children:s}){const o=l?"none":n??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==o),u=$().emptyState,h=t??(e?void 0:u.message),m=r??a;/* @__PURE__ */
229
+ return X("div",{className:`flex flex-col items-center justify-center text-center ${"card"===o?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===o?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */J("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */J("svg",{className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e&&/* @__PURE__ */J("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */J("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */J("p",{className:"text-xs text-gray-400 mt-1",children:m}),s&&/* @__PURE__ */J("div",{className:"mt-4",children:s})]})}function Fa({title:t,description:r,subtitle:a,actions:n,children:l,icon:i,breadcrumbs:s}){const o=r??a,c=n??l;/* @__PURE__ */
230
+ return X("div",{className:"mb-6",children:[s&&s.length>0&&/* @__PURE__ */J(e,{items:s,className:"mb-3"}),
231
+ /* @__PURE__ */X("div",{className:"flex items-start justify-between gap-4",children:[
232
+ /* @__PURE__ */X("div",{children:[
233
+ /* @__PURE__ */X("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */J("span",{className:"shrink-0 text-gray-400",children:i}),t]}),o&&/* @__PURE__ */J("p",{className:"mt-1 text-sm text-gray-500",children:o})]}),c&&/* @__PURE__ */J("div",{className:"flex items-center gap-2",children:c})]})]})}var Ba=["success","warning","danger"];function Ta(e){return"string"==typeof e&&Ba.includes(e)}function Wa(e,t,r){if(null==e||!Number.isFinite(e))return null;const a=Ea(t),n=Ea(r);return null==a&&null==n?null:null!=n&&e>=n?"danger":null!=a&&e>=a?"warning":"success"}function Ea(e){return null!=e&&Number.isFinite(e)?e:null}var Ia={success:{tone:"success",fill:"bg-green-500",ink:"text-gray-900",word:"ok"},warning:{tone:"warning",fill:"bg-amber-500",ink:"text-amber-600",word:"warning"},danger:{tone:"danger",fill:"bg-red-500",ink:"text-red-600",word:"critical"}};var Oa=/* @__PURE__ */new Set;function Ra(e,t){if(null==e)return null;if(Ta(e))return Ia[e];const r=function(e){const t="string"==typeof e?JSON.stringify(e):"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e?String(e):Object.prototype.toString.call(e);return t.length>32?`${t.slice(0,31)}…`:t}(e);return function(e,t){const r=`${e}:${t}`;Oa.has(r)||(Oa.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Ba.join(" | ")}. Rendering an "unknown severity" marker — a health marker must never silently disappear. If this came from a backend rollup, map it to the shell's vocabulary at the fetch boundary (see isSeverityTone).`))}(t,r),{tone:null,fill:"bg-gray-300 border border-red-500",ink:"text-gray-900",word:`unrecognised severity ${r}`,token:r}}function Ya({at:e,title:t,className:r}){/* @__PURE__ */
234
+ return J("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var _a=e=>Math.min(100,Math.max(0,e));function Ha({label:e,value:t,max:r=100,warn:a,crit:n,severity:l,detail:i,formatValue:s,emptyLabel:o,size:c="sm",ariaLabel:d,className:u=""}){const h=$().meter,m=M(),p=o??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var x,b;null==f&&(x=`MetricBar:max:${String(r)}`,b=`[efficient-shell] MetricBar: max=${String(r)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`,Oa.has(x)||(Oa.add(x),console.error(b)));const y=Ra(l,"MetricBar"),v=null!=g?y??(null==(w=Wa(g,a,n))?null:Ia[w]):null;var w;const k=Ea(a),N=Ea(n),C=null!=g&&null!=f?_a(g/f*100):0,L=null!=g?(s??(e=>100===f?z(e,1,m):D(e,m)))(g):"—",j=null!=g&&null!=f&&(null!=k||null!=N),P="md"===c?"h-2":"h-1.5",S=null!=g&&null!=f,A=/* @__PURE__ */X("div",{...S?{role:"meter","aria-label":d??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":f,"aria-valuenow":Math.min(f,Math.max(0,g)),"aria-valuetext":L}:{"aria-hidden":!0},className:S&&v?`relative mt-2 ${P} rounded-full bg-gray-200`:`relative mt-2 ${P} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[S&&
235
+ /* @__PURE__ */J("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${C}%`}}),j&&null!=f&&null!=k&&/* @__PURE__ */J(Ya,{at:_a(k/f*100),title:h.warningAt(k),className:"bg-gray-400 opacity-75"}),j&&null!=f&&null!=N&&/* @__PURE__ */J(Ya,{at:_a(N/f*100),title:h.criticalAt(N),className:"bg-gray-500"})]}),F=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
236
+ return X("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */J("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
237
+ /* @__PURE__ */X("div",{className:"mt-1 flex items-baseline gap-2",children:[
238
+ /* @__PURE__ */J("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${F}`,children:L}),
239
+ /* @__PURE__ */J("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]}:{className:u,children:[
240
+ /* @__PURE__ */X("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */J("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
241
+ /* @__PURE__ */J("span",{className:`text-sm font-semibold tabular-nums ${F}`,children:L}),
242
+ /* @__PURE__ */J("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),A]})}function qa(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function Ua(e,t){const r=qa(e);if(null==r)return"no-reading";const a=qa(t);return null==a||0===a?"no-budget":r>a?"over":"within"}var Va=e=>Math.min(100,Math.max(0,e));function Ka({label:e,elapsed:t,budget:r,grace:a,detail:n,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=$().meter,h=M(),m=l??(e=>function(e,t=C.meter){const r=Math.round(e),a=Math.floor(r/3600),n=Math.floor(r%3600/60),l=r%60;return a>0?t.hoursMinutes(a,n):n>0?t.minutesSeconds(n,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=qa(t),x=qa(r),b=null!=x&&x>0?x:null,y=qa(a)??0,v="over"===Ua(t,r),w=null!=b?b+y:null,k=null!=b&&null!=w?Va(b/w*100):null,N=v&&y>0,L=null==w||null==f?0:v?N?k??0:0:Va(f/w*100),D=N?k??0:0,j=v?N&&null!=w&&null!=f?Va(f/w*100):100:0,P=Math.max(0,j-D),S=null!=f&&null!=b?f/b*100:null,A=null!=S?z(Math.round(S),0,h):null!=f?m(f):"—",F=n??(null==f?p:null==b?g:`${m(f)} / ${m(b)}`),B="md"===o?"h-2":"h-1.5",T=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",W=null!=f&&null!=b&&null!=w?/* @__PURE__ */X("div",{role:"meter","aria-label":c??("string"==typeof e?e:void 0),"aria-valuemin":0,"aria-valuemax":w,"aria-valuenow":Math.min(w,f),"aria-valuetext":u.ofBudget(A),className:`relative mt-2 ${B} overflow-hidden rounded-full bg-gray-200`,children:[(!v||N)&&/* @__PURE__ */J("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${L}%`}}),P>0&&/* @__PURE__ */J("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${D}%`,width:`${P}%`}}),y>0&&null!=k&&/* @__PURE__ */J("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${k}%`}})]}):null;/* @__PURE__ */
243
+ return X("div","md"===o?{className:d,children:[null!=e&&/* @__PURE__ */J("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
244
+ /* @__PURE__ */X("div",{className:"mt-1 flex items-baseline gap-2",children:[
245
+ /* @__PURE__ */J("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${T}`,children:A}),
246
+ /* @__PURE__ */J("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:F})]}),W]}:{className:d,children:[
247
+ /* @__PURE__ */X("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */J("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
248
+ /* @__PURE__ */J("span",{className:`text-sm font-semibold tabular-nums ${T}`,children:A}),
249
+ /* @__PURE__ */J("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:F})]}),W]})}var Ga=864e5;function Za(e){if(!e)return null;const t=new Date(e).getTime();if(!Number.isFinite(t))return null;const r=new Date(t).getUTCFullYear();return r<2e3||r>2100?null:t}function Ja(e,t){return ot(new Date(e).toISOString().slice(0,10),{locale:t})}var Xa=(e,t)=>`${e}-fill-${t}`,Qa=e=>`${e}-glow`,en=e=>`${e}-reveal`,tn=e=>`${e}-ground`;function rn(e,t,r,a){return"solid"===r?a:`url(#${Xa(e,t)})`}function an(e){return"solid"===e?void 0:"4 3"}function nn({id:e,index:t,colour:r,variant:a,from:n,to:l}){const i=Xa(e,t);if("solid"===a)return null;if("gradient"===a||"gradient-reverse"===a){const e="gradient-reverse"===a;/* @__PURE__ */
250
+ return X("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
251
+ /* @__PURE__ */J("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:n}),
252
+ /* @__PURE__ */J("stop",{offset:"100%",stopColor:r,stopOpacity:e?n:l})]})}const s=/* @__PURE__ */J("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*n});return"duotone"===a?/* @__PURE__ */X("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
253
+ /* @__PURE__ */J("stop",{offset:"0%",stopColor:r,stopOpacity:n}),
254
+ /* @__PURE__ */J("stop",{offset:"45%",stopColor:r,stopOpacity:n}),
255
+ /* @__PURE__ */J("stop",{offset:"45%",stopColor:r,stopOpacity:.35*n}),
256
+ /* @__PURE__ */J("stop",{offset:"100%",stopColor:r,stopOpacity:.35*n})]}):/* @__PURE__ */X("pattern","striped"===a?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(-45)",children:[s,
257
+ /* @__PURE__ */J("rect",{width:"5",height:"10",fill:r,fillOpacity:.7})]}:"blocks"===a?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",children:[s,
258
+ /* @__PURE__ */J("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8}),
259
+ /* @__PURE__ */J("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===a?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[s,
260
+ /* @__PURE__ */J("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===a?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[s,
261
+ /* @__PURE__ */J("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[s,
262
+ /* @__PURE__ */J("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function ln({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
263
+ return J("mask",{id:en(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */J("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function sn({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:a=0,glow:n=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
264
+ return X("defs",{children:[t.map((t,n)=>/* @__PURE__ */J(nn,{id:e,index:n,colour:t.color,variant:t.variant??"gradient",from:r,to:a},n)),l&&/* @__PURE__ */J(ln,{id:e,direction:l}),n&&/* @__PURE__ */X("filter",{id:Qa(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
265
+ /* @__PURE__ */J("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
266
+ /* @__PURE__ */X("feMerge",{children:[
267
+ /* @__PURE__ */J("feMergeNode",{in:"blur"}),
268
+ /* @__PURE__ */J("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */J(on,{id:tn(e),variant:i})]})}function on({id:e,variant:t}){/* @__PURE__ */
269
+ return J("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */J("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */J("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */J("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */J("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */J("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var cn={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},dn=(e,t=60)=>({animationDelay:e*t+"ms"}),un={receipt:/* @__PURE__ */X(Q,{children:[
270
+ /* @__PURE__ */J("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
271
+ /* @__PURE__ */J("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */J("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */X(Q,{children:[
272
+ /* @__PURE__ */J("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
273
+ /* @__PURE__ */J("path",{d:"M5.1 6.5h2.8M5.1 8.2h2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),flask:/* @__PURE__ */J("path",{d:"M4.6 1.8h2.8M5.4 1.8v3.1L3.3 9.3a.9.9 0 0 0 .8 1.3h3.8a.9.9 0 0 0 .8-1.3L6.6 4.9V1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),truck:/* @__PURE__ */X(Q,{children:[
274
+ /* @__PURE__ */J("path",{d:"M1.8 2.9h4.9v4.4H1.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
275
+ /* @__PURE__ */J("path",{d:"M6.7 4.4h1.6l1.5 1.7v1.2H6.7z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
276
+ /* @__PURE__ */J("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
277
+ /* @__PURE__ */J("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */X(Q,{children:[
278
+ /* @__PURE__ */J("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
279
+ /* @__PURE__ */J("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function hn({name:e}){/* @__PURE__ */
280
+ return J("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:un[e]})}function mn(){/* @__PURE__ */
281
+ return X("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
282
+ /* @__PURE__ */J("path",{d:"M4.2 2.2v11.6"}),
283
+ /* @__PURE__ */J("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function pn(){/* @__PURE__ */
284
+ return J("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */J("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var gn=1e-6;function fn(e,t,r={}){const a=Number.isFinite(t)&&t>0?t:0,n=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(a<=0||n.length<2){const e=n[0]??0;return{anchorsMs:n,xs:n.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=n[n.length-1]-n[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,a),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<n.length;e++){const t=n[e+1]-n[e];c.push(t),d.push(l>0?t/l*a:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,a-h*s);let p=0,g=0;for(let e=0;e<c.length;e++)u[e]||(p+=c[e],g+=1);const f=c.map((e,t)=>u[t]?s:0===g?0:p>0?m*e/p:m/g),x=function(e,t,r){const a=e.slice();let n=0;for(let e=0;e<a.length;e++)t[e]||a[e]>=r-gn||(n+=r-a[e],a[e]=r);if(n<=gn)return a;let l=0;for(let e=0;e<a.length;e++)!t[e]&&a[e]>r+gn&&(l+=a[e]-r);if(l<=gn)return a;const i=Math.min(n,l);for(let e=0;e<a.length;e++)t[e]||a[e]<=r+gn||(a[e]-=i*(a[e]-r)/l);return a}(f,u,o),b=x.reduce((e,t,r)=>u[r]?e:e+t,0),y=x.map((e,t)=>u[t]?e:b>0?e*m/b:e),v=[0];for(let e=0;e<y.length;e++)v.push(v[e]+y[e]);v[v.length-1]=a;const w=v.slice(0,-1).map((e,t)=>({fromMs:n[t],toMs:n[t+1],gapMs:c[t],fromPx:e,toPx:v[t+1],wantPx:d[t],clampedPx:f[t],px:v[t+1]-e,compressed:u[t]}));return{anchorsMs:n,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=n[0])return 0;if(e>=n[n.length-1])return a;for(let t=0;t+1<n.length;t++){if(e>n[t+1])continue;const r=n[t+1]-n[t],a=r>0?(e-n[t])/r:0;return v[t]+a*(v[t+1]-v[t])}return a},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),a);for(let e=0;e+1<n.length;e++){if(t>v[e+1]&&e+2<n.length)continue;const r=v[e+1]-v[e],a=r>0?(t-v[e])/r:0;return n[e]+a*(n[e+1]-n[e])}return n[n.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function xn(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var bn="mixed";function yn(e,t){return 5.6*Math.max(e.length,t.length)+8}var vn=(e,t,r)=>Math.min(Math.max(e,t),r),wn=e=>-(Math.cos(Math.PI*e)-1)/2;function kn(e,t){if(!(t>0))return{px:e.fromPx,ms:e.fromMs};if(t>=1||e.durationMs<=0)return{px:e.toPx,ms:e.toMs};const r=e.fromPx+(e.toPx-e.fromPx)*wn(t);return{px:r,ms:e.msByPx(r)}}var Nn={lanes:{tag:0,laneA:17,laneH:30,rail:52,ruler:64,laneB:86,height:120},active:{tag:0,laneA:17,laneH:30,rail:38,ruler:50,laneB:74,height:108},none:{tag:0,laneA:16,laneH:14,rail:34,ruler:46,laneB:46,height:72}};function Mn(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var $n=e=>5.6*e.length,Cn={default:{},dfm:{glyph:"doc",token:"var(--tl-dfm)"},shipment:{diamond:!0,glyph:"truck",token:"var(--tl-shipment)"},testing:{glyph:"flask",token:"var(--tl-testing)"},completion:{glyph:"check",token:"var(--tl-completion)"},inspection:{glyph:"flask",token:"var(--tl-inspection)"},invoice:{glyph:"receipt",token:"var(--tl-invoice)"},report:{}},Ln={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Dn(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:Cn[t].glyph??(r?"flag":void 0)}function jn(e,t,r=!1){const a=Cn[e],n=["rosh-tl-node","rosh-tl-mark",`is-${t}`];a.diamond&&n.push("is-diamond"),r&&n.push("is-provisional");const l="current"===t?"var(--tl-accent)":a.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:n.join(" "),style:i}}function zn(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Pn="undefined"==typeof document?O:Z;function Sn(e,t){const[r,a]=W(0);return Pn(()=>{const r=t?e.current:null;if(!r)return;const n=()=>{const e=r.getBoundingClientRect().width;e>0&&a(e)};if(n(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(n);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function An(e,t,r){const a=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&a.set(e.x,Math.max(a.get(e.x)??0,e.widthPx));const n=[...a.keys()].sort((e,t)=>e-t);if(r<=0||n.length<2)return e;const l=Math.max(0,n[0]),i=Math.min(r,n[n.length-1]),s=i-l,o=[];for(let e=0;e+1<n.length;e++){const t=(a.get(n[e])??0)/2+(a.get(n[e+1])??0)/2+8;o.push(Math.max(28,t,n[e+1]-n[e]))}const c=o.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,s),.8*r);if(d<=s+.5)return e;const u=l,h=r-i,m=u+h,p=Math.max(0,r-d),g=m>0?p*u/m:0,f=g,x=g+d,b=o.map(e=>c>0?e*d/c:0),y=e=>{if(e<=l)return u>0?e*g/u:f;if(e>=i)return h>0?x+(e-i)*(r-x)/h:x;let t=f;for(let r=0;r+1<n.length;r++){if(e>n[r+1]){t+=b[r];continue}const a=n[r+1]-n[r];return t+(a>0?(e-n[r])/a*b[r]:0)}return x};return{anchorsMs:e.anchorsMs,xs:e.xs.map(y),gaps:e.gaps.map(e=>({...e,fromPx:y(e.fromPx),toPx:y(e.toPx),px:y(e.toPx)-y(e.fromPx)})),xByMs:t=>y(e.xByMs(t)),msByPx:t=>e.msByPx((e=>{if(e<=f)return g>0?e*u/g:l;if(e>=x)return r-x>0?i+(e-x)*h/(r-x):i;let t=f;for(let r=0;r+1<n.length;r++){if(!(e>t+b[r]))return n[r]+(b[r]>0?(e-t)/b[r]*(n[r+1]-n[r]):0);t+=b[r]}return i})(t)),inCut:e.inCut}}function Fn(e){if(!e||0===e.length)return null;const t=e.filter(e=>Number.isFinite(e)).sort((e,t)=>e-t);return t.length>0?t:null}function Bn({marks:e,innerRef:t}){/* @__PURE__ */
285
+ return J("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */X("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
286
+ /* @__PURE__ */J("span",{className:"rosh-tl-name",children:e.label}),
287
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Tn({startMs:e,endMs:t,axis:r,geo:a,reveal:n}){const l=$().timeline,i=ut(M()),s=a.ruler,o=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*Ga){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Ga)-t<14||o.push(
288
+ /* @__PURE__ */J("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${s}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=$n(l.days(Math.round(e.gapMs/Ga)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,a])=>e<a&&t>r);o.push(
289
+ /* @__PURE__ */J("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${s}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(o.push(
290
+ /* @__PURE__ */J("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${s}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+$n(r))||(c.push(
291
+ /* @__PURE__ */J("span",{className:"rosh-tl-month"+(n?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${s+9}px`,...n?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
292
+ return X("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[o,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/Ga));/* @__PURE__ */
293
+ return X("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(n?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${s}px`,...n?{animationDelay:"420ms"}:{}},children:[
294
+ /* @__PURE__ */X("span",{className:"rosh-tl-cutglyph",children:[
295
+ /* @__PURE__ */J("i",{}),
296
+ /* @__PURE__ */J("i",{})]}),
297
+ /* @__PURE__ */J("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function Wn({pending:e,reveal:t}){const r=$().timeline,[a,n]=W(!1),l=a?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
298
+ return X("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
299
+ /* @__PURE__ */J("p",{className:"rosh-tl-pending-head",children:r.notReached}),
300
+ /* @__PURE__ */J("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,a)=>/* @__PURE__ */X("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*a+"ms"}:void 0,children:[
301
+ /* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&Cn[e.kind].diamond?" is-diamond":"")}),
302
+ /* @__PURE__ */X("span",{children:[0===a&&/* @__PURE__ */J("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */J("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>n(!0),children:r.more(i)})]})}function En({marks:e,pending:t,currentKey:r,todayMs:a,reveal:n,ariaLabel:l,step:i,nodeProps:s,onKeyDown:o}){const c=$().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==a?Math.round((a-e[e.length-1].ms)/Ga):0;/* @__PURE__ */
303
+ return X("div",{"data-timeline-part":"vertical",children:[
304
+ /* @__PURE__ */J("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:o,children:e.map((e,t)=>{const a=jn(e.kind,e.role),l=d>=0&&t<d,{glyph:o}=e;/* @__PURE__ */
305
+ return X("li",{className:n?"rosh-tl-fade":void 0,style:n?dn(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
306
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&n?" rosh-tl-drawy":""}`}),
307
+ /* @__PURE__ */X("button",{...s(e),className:`${a.className}${n?" rosh-tl-pop":""}`,style:{...a.style,...n?dn(t,i):{}},children:[o&&/* @__PURE__ */J(hn,{name:o}),"current"===e.role&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(n?" is-on":"")})]}),
308
+ /* @__PURE__ */X("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
309
+ /* @__PURE__ */J("span",{className:"rosh-tl-name",children:e.label}),
310
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */X("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
311
+ /* @__PURE__ */J("i",{className:"rosh-tl-vline is-dash"}),
312
+ /* @__PURE__ */J("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */J(Wn,{pending:t,reveal:n})]})}function In({axis:e,geo:t,fillTo:r,reveal:a,trackPx:n,tweened:l=!1}){/* @__PURE__ */
313
+ return X("div",{"aria-hidden":"true",children:[
314
+ /* @__PURE__ */J("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${n}px`}}),null!==r&&/* @__PURE__ */J("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${a?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),n))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */X("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
315
+ /* @__PURE__ */J("i",{}),
316
+ /* @__PURE__ */J("i",{})]},`railcut-${e.fromMs}`))]})}function On({geo:e,caption:t,endCaption:r,around:a,reveal:n,trackPx:l}){const i=e.rail-13-4,s=n?" rosh-tl-fade":"",o=n?{animationDelay:"420ms"}:{};/* @__PURE__ */
317
+ return X("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
318
+ /* @__PURE__ */J("i",{className:`rosh-tl-start${a?" is-around":""}${s}`,style:{left:"0px",top:`${e.rail+3}px`,...o}}),null!=t&&!1!==t&&/* @__PURE__ */J("span",{className:`rosh-tl-edge${s}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...o},children:t}),null!=r&&!1!==r&&/* @__PURE__ */J("span",{className:`rosh-tl-edge is-end${s}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...o},children:r})]})}function Rn({x:e,geo:t,trackPx:r,label:a,reveal:n}){const l=$().timeline;/* @__PURE__ */
319
+ return X("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
320
+ /* @__PURE__ */J("div",{className:"rosh-tl-todayline"+(n?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...n?{animationDelay:"420ms"}:{}}}),
321
+ /* @__PURE__ */J("span",{className:"rosh-tl-todaytag"+(n?" rosh-tl-fade":""),title:l.todayTitle(a),style:{left:`${xn(e,48,r)}px`,top:`${t.tag}px`,...n?{animationDelay:"420ms"}:{}},children:l.today})]})}function Yn({nodes:e,geo:t,reveal:r}){const a=e.map(e=>{const t=e.members.map(e=>e.caption).filter(e=>!!e);return 0===t.length?null:{x:e.x,first:t[0],last:t[t.length-1]}}).filter(e=>null!==e).sort((e,t)=>e.x-t.x),n=[];let l=null;const i=()=>{l&&(n.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of a){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=$n(t)/2;l&&e.x-r<l.right+6?(l.to=e.x,l.last=e.last,l.right=e.x+r):(i(),l={from:e.x,to:e.x,first:e.first,last:e.last,right:e.x+r})}return i(),/* @__PURE__ */J("div",{"aria-hidden":"true","data-timeline-part":"captions",children:n.map(e=>/* @__PURE__ */J("span",{className:"rosh-tl-caption"+(r?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:`${t.laneA}px`,...r?{animationDelay:"360ms"}:{}},children:e.text},`${e.x}-${e.text}`))})}function _n({phase:e,geo:t,xOf:r}){const a=r(e.minMs),n=Math.max(r(e.maxMs)-a,4);/* @__PURE__ */
322
+ return X("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
323
+ /* @__PURE__ */J("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${a}px`,width:`${n}px`,top:t.laneB+t.laneH-4+"px"}}),
324
+ /* @__PURE__ */X("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${a+n/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Hn({nodes:e,trackPx:t,geo:r,activeKey:a,hoveredKey:n,currentKey:l}){const i=$().timeline,s=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),o=e.find(e=>e.key===n)??e.find(e=>s(e,a))??null;if(!o)return null;const c=o.mark,d=c?c.label:`×${o.members.length}`,u=c?c.dateText:function(e){const t=e[0].dateText,r=e[e.length-1].dateText;return t===r?t:`${t} – ${r}`}(o.members),h=c?c.widthPx:yn(d,u),m=c?.onOpen;/* @__PURE__ */
325
+ return X("div",{"data-timeline-part":"label",className:`rosh-tl-label${o.key===n?" is-hot":""}${s(o,l)?" is-current":""}`,style:{left:`${xn(o.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */J("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */J("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
326
+ /* @__PURE__ */J("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function qn({groups:e,trackPx:t,geo:r,startMs:a,endMs:n,currentKey:l,hoveredKey:i,reveal:s,step:o,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:x}){const b=[];e.forEach((e,t)=>{if("cluster"===e.type){const a=`cluster-${e.members[0].key}`,n=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(b.push({key:a,group:e,text:n,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil($n(n))+28}),a===c)for(const r of e.members)b.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;b.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),b.sort((e,t)=>e.x-t.x);const y=function(e,t,r,a,n={}){const l=t>0?t:0,i=a>0?a:1,s=n.gapPx??6,o=Math.max(1,n.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:o},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const a=e.xPx??(e.ms-r)/i*l,n=Math.min(Math.max(a-t/2,0),l-t),c=n+t;let h=-1;for(let e=0;e<o;e++)if(d[e].every(e=>n>e.right+s||c+s<e.left)){d[e].push({left:n,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...x>0?[{key:"__rosh-tl-start__",ms:a,xPx:0,widthPx:x,priority:-2}]:[],...b.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,a,Math.max(n-a,Ga),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of b)e.lane=v.get(e.key)??-1,e.left=xn(e.x,e.widthPx,t);const w=b.find(e=>e.key===(h??p)),k=e=>0===e?r.laneA:r.laneB,N=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
327
+ return X(Q,{children:[b.map(e=>{const t=Math.max(0,e.lane),a=Math.round(e.index*o+60);if("cluster"===e.group.type){const n=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),n||f(null)};/* @__PURE__ */
328
+ return X("div",{children:[
329
+ /* @__PURE__ */X("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${Cn[e.group.kind]?.token?"":" text-blue-600"}${s?" rosh-tl-fade":""}`,"aria-expanded":n,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:Cn[e.group.kind]?.token,...s?{animationDelay:`${a}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(n?null:e.key),f(n?null:e.key)},children:[
330
+ /* @__PURE__ */J("i",{"aria-hidden":"true"}),e.text]}),
331
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-cspan",style:{left:`${Math.min(...l)}px`,width:`${Math.max(1,Math.max(...l)-Math.min(...l))}px`,top:`${N(t)}px`}})]},e.key)}const n=e.group.mark;if(e.lane<0)return n.key===i?/* @__PURE__ */X("div",{"aria-hidden":"true","data-timeline-part":"reveal",className:"rosh-tl-label is-reveal is-hot",style:{left:`${e.left}px`,top:`${r.laneA}px`,width:`${e.widthPx}px`},children:[
332
+ /* @__PURE__ */J("span",{className:"rosh-tl-name",children:n.label}),
333
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:n.dateText})]},e.key):null;const c=Math.abs(e.left+e.widthPx/2-n.x)<=8;/* @__PURE__ */
334
+ return X("div",{children:[
335
+ /* @__PURE__ */X("div",{"aria-hidden":"true","data-timeline-part":"label",className:`rosh-tl-label${0===t?" is-up":""}${n.key===l?" is-current":""}${n.key===i?" is-hot":""}${s?" rosh-tl-fade":""}`,style:{left:`${e.left}px`,top:`${k(t)}px`,width:`${e.widthPx}px`,height:`${r.laneH}px`,...s?{animationDelay:`${a}ms`}:{}},children:[
336
+ /* @__PURE__ */J("span",{className:"rosh-tl-name",children:n.label}),
337
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:n.dateText})]}),!c&&/* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-lead"+(s?" rosh-tl-fade":""),style:{left:`${Math.min(e.left+e.widthPx/2,n.x)}px`,width:`${Math.abs(e.left+e.widthPx/2-n.x)}px`,top:`${N(t)}px`,...s?{animationDelay:`${a}ms`}:{}}})]},e.key)}),w&&"cluster"===w.group.type&&/* @__PURE__ */X("div",{ref:e=>{u(e,w.x)},id:d,className:"rosh-tl-popover","data-timeline-part":"cluster-popover",style:{top:`${r.rail+6+6}px`},onMouseEnter:()=>g(w.key),onMouseLeave:()=>g(null),children:[
338
+ /* @__PURE__ */J("p",{className:"rosh-tl-popover-head",children:w.text}),
339
+ /* @__PURE__ */J("ol",{children:w.group.members.map(e=>/* @__PURE__ */X("li",{children:[
340
+ /* @__PURE__ */J("span",{children:e.label}),
341
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Un({thumb:e,value:t,snap:r,axis:a,geo:n,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=$().timeline,p=M(),g=E(!1),f=c?c.px:a.xByMs(t),x=c?c.ms:t,b=Fn(e.stops),y=b?b.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?a.msByPx(e-r.left):t},w=a=>{const n=r(a);n!==t&&e.onChange(n)},k=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},N=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},C=e=>{if(!g.current)return;const t=v(e.clientX);w(t),h(function(e,t){if(!Number.isFinite(t))return null;const r=e.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms);for(let e=0;e+1<r.length;e++){const a=r[e],n=r[e+1];if(t<a.ms||t>n.ms)continue;const l=n.ms-a.ms;return{fromKey:a.key,toKey:n.key,t:l>0?vn((t-a.ms)/l,0,1):1,ms:t}}return null}(u,t))},L=e.valueText?e.valueText(x):Ja(x,p),D=Math.max(1,Math.round((i-l)/Ga));/* @__PURE__ */
342
+ return X(Q,{children:[
343
+ /* @__PURE__ */J("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:n.rail-9+"px",height:"24px"},onPointerDown:e=>{k(e),w(v(e.clientX))},onPointerMove:C,onPointerUp:N,onPointerCancel:N}),
344
+ /* @__PURE__ */J("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${xn(f,88,s)+44}px`,top:`${n.tag}px`},children:e.chip?e.chip(x):Ja(x,p)}),
345
+ /* @__PURE__ */J("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":b&&b.length>0?b.length-1:D,"aria-valuenow":b&&b.length>0?Math.max(0,y):Math.round((t-l)/Ga),"aria-valuetext":L,style:{left:`${f}px`,top:`${n.rail+3}px`},onPointerDown:k,onPointerMove:C,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(b&&b.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?b[Math.min(e+1,b.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?b[Math.max(e-1,0)]:"Home"===r?b[0]:"End"===r?b[b.length-1]:null}const a=(e.shiftKey?7:1)*Ga;return"ArrowRight"===r||"ArrowUp"===r?t+a:"ArrowLeft"===r||"ArrowDown"===r?t-a:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function Vn(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Kn({startMs:e,endMs:t,axis:r="linear",items:a,markers:n=[],pending:l=[],fillToMs:i,todayMs:s,labels:o="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:x=null,motion:b=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===o,C=F(Date.now,null),L=F(Mn,!1),D=s??C,j=E(null),z=$().timeline,P=M(),S=e=>Ja(e,P),A=E(null),B=E(null),R=E(null),Y=E(/* @__PURE__ */new Map),_=E(void 0),H=E(void 0),q=E(null),[U,V]=W({}),[K,G]=W(null),[Z,ee]=W(null),[te,re]=W(null),[ae,ne]=W(null),[le,ie]=W(null),[se,oe]=W(null),ce=I(),de=I(),ue=Sn(j,!0),me=ue>0?ue-(l.length>0&&!N?176:0):0,pe=me>0&&me-20<320,ge=Sn(A,!pe),fe=ge>0?ge:600,xe=Nn[o],be=N&&l.length>0,ye=be?Math.max(0,fe-36):fe,ve=r=>r>=e-Ga&&r<=t+Ga,we=a.filter(e=>Number.isFinite(e.ms)&&ve(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ke="spread"===r?n.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=fn([e,...[...we.map(e=>e.ms),...ke].filter(r=>r>e&&r<t),t],ye,"compressed"===(Me=r)?{}:"spread"===Me?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var Me;const $e=Ne.xByMs,Ce=we.filter(e=>!e.provisional),Le=g??(Ce.length>0?Ce[Ce.length-1].key:null),De=we.map((e,t)=>{const r=e.date??S(e.ms),a=(e.priority??0)>0||"report"===e.kind,n=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Ln[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:$e(e.ms),baseX:$e(e.ms),kind:n,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Dn(e,n,0===t&&"default"===n),role:e.key===Le?"current":a?"dot":"key",widthPx:N?Math.max(16,$n(e.caption??"")+6):U[e.key]||yn(e.label,r),collapsible:a,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),je=n.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&ve(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,a=S(t);return{key:r,ms:t,x:$e(t),baseX:$e(t),kind:e.kind,label:e.label,dateText:a,detail:e.detail,preview:e.preview,glyph:e.glyph??Cn[e.kind].glyph,role:"key",widthPx:U[r]||yn(e.label,a),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),ze=be?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Ga,x:fe,baseX:fe,kind:e.kind??"default",label:e.label,dateText:z.notReached,detail:r.length>0?z.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&k&&!be?[{key:k.key,ms:t,x:ye,baseX:ye,kind:"default",label:k.label,dateText:k.dateText??S(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...De,...je,...ze,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),Ae=m?.start??z.start(S(e)),Fe=null==Ae||!1===Ae?0:"string"==typeof Ae?Math.ceil($n(Ae)):96,Be="lanes"===o?function(e,t={}){const r=t.minPitchPx??40,a=[];let n=0;for(;n<e.length;){const t=e[n];if(!t.collapsible){a.push({type:"item",mark:t}),n+=1;continue}let l=n+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(n,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const a=i[t-1],n=Math.max(r,Math.max(e.widthPx,a.widthPx)+8);return e.x-a.x<n});if(i.length>=3||s)a.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)a.push({type:"item",mark:e});n=l}return a}(Se):[],Te=function(e,t=16){const r=[];let a=0;for(;a<e.length;){let n=a+1;for(;n<e.length&&e[n].x-e[n-1].x<t;)n+=1;if(n-a===1)r.push({type:"item",mark:e[a]});else{const t=e.slice(a,n),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:bn,members:t})}a=n}return r}(Se),We=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ee=/* @__PURE__ */new Map;for(const e of Te)if("cluster"===e.type)for(const t of e.members)Ee.set(t.key,We(e));const Ie=te??ae??le,Oe=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ie)??Te.find(e=>"cluster"===e.type&&We(e)===Ie),Re=e=>({x:e.baseX,widthPx:e.widthPx}),Ye=Oe&&"cluster"===Oe.type?Oe.members.map(Re):x?Se.filter(e=>e.ms>=x[0]&&e.ms<=x[1]).map(Re):[],_e=Ye.length>1?An(Ne,Ye,ye):Ne,He=_e!==Ne;if(He)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const qe=Se.some(e=>e.x<14),Ue=He&&Oe?Ie:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ke=pe?Se.map(Ve):Te.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=We(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const a=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:a.reduce((e,t)=>e+t,0)/a.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ke)for(const t of e.members)Ge.set(t.key,e.key);const Ze=Te.find(e=>"cluster"===e.type&&We(e)===Ue),Je=Ze&&"cluster"===Ze.type?{from:Math.min(...Ze.members.map(e=>e.x))-16,to:Math.max(...Ze.members.map(e=>e.x))+16}:null,Xe=E(Ue),[Qe,et]=W(!1);O(()=>{if(Xe.current===Ue)return;Xe.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Pn(()=>{const e=B.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,a=r.getBoundingClientRect().width;e&&a>0&&(t[e]=a)}V(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${o}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[at,nt]=W(rt),lt=b&&at===rt;O(()=>{at!==rt&&nt(rt)},[at,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),st=Fn(u?.stops),ot=r=>{const a=Math.min(Math.max(r,e),t);if(!st)return a;let n=st[0];for(const e of st)Math.abs(e-a)<Math.abs(n-a)&&(n=e);return n},ct=u?ot(u.valueMs):null,dt=h&&u?De.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const a=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,n=Math.max(0,r.dwellMs??700)/a,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const s=l[t],o=l[t+1],c=e.xByMs(s.ms),d=e.xByMs(o.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:vn(350*u/100,450,1400)/a;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:n,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:L}),[ht,mt]=W(null),pt=E(null),gt=E({segments:ut,value:ct,playback:h});O(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=E(null),xt=T(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),bt=T(()=>{pt.current=null,mt(null),xt(null),gt.current.playback?.onStop?.()},[xt]),yt=!!h?.playing&&!!u;O(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void bt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,a=0;const n=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},n(kn(t,0))):bt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const a=e[t.index];if(!a)return{cursor:null,at:null,arrived:null,progress:null};const n=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-n;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:kn(a,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:kn(a,0),arrived:null,progress:null}}const l=a.durationMs>0?Math.min(1,t.t+n/a.durationMs):1,i=kn(a,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:a.fromKey,toKey:a.toKey,t:wn(l),ms:i.ms}};const s=e[t.index+1];return{cursor:s?{index:t.index+1,phase:"rest",t:0,restLeftMs:s.dwellMs,sinceMs:r}:null,at:i,arrived:{key:a.toKey,ms:a.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&n(i.at),xt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),a=requestAnimationFrame(s)):bt()};return l(),a=requestAnimationFrame(s),()=>{cancelAnimationFrame(a),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,xt(null))}},[yt,bt,xt]);const vt=De.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===D?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,D):null,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=T(()=>{clearTimeout(_.current),clearTimeout(H.current),G(null),ee(null),re(null),ne(null),ie(null)},[]);O(()=>()=>{clearTimeout(_.current),clearTimeout(H.current)},[]),O(()=>{const e=q.current;e&&(q.current=null,Y.current.get(e)?.focus())});const Ct=null!==Z||null!==te||null!==ae||null!==le;O(()=>{if(Ct)return f(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=T((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let a=r>0?Math.max(r,Math.min(t,fe-r)):t;const n=e.parentElement;if(r>0&&n){const t=he(e),l=n.getBoundingClientRect().left,i=t.left+8+r-l,s=t.right-8-r-l;i<=s&&(a=Math.max(i,Math.min(a,s)))}e.style.left=`${a}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-a)}px`)},[fe]),Dt=Ke.find(e=>e.key===Z)??null,jt=Dt?Dt.x:0;Pn(()=>{Lt(R.current,jt)},[Lt,Z,jt]);const zt=ct??void 0,Pt=E(null);O(()=>{if(void 0===zt)return;const e=_e.xByMs(zt),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const a of Se){if(a.x<=t||a.x>e)continue;const n=Y.current.get(Ge.get(a.key)??a.key);n&&(n.classList.add("is-hit"),r.push(setTimeout(()=>n.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[zt]);const St=Ke.map(e=>e.key),At=Le?Ge.get(Le)??null:null,Ft=se&&St.includes(se)?se:At&&St.includes(At)?At:St[0],Bt=e=>{const t=St.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),oe(St[r]),Y.current.get(St[r])?.focus())},Tt=()=>clearTimeout(H.current),Wt=e=>{Tt(),ie(e)},Et=()=>{clearTimeout(H.current),H.current=setTimeout(()=>ie(null),260)},It=e=>{Ue&&Ee.get(e)===Ue?Tt():(Tt(),ie(null))},Ot=e=>{clearTimeout(_.current),G(e),ee(e),w?.((e=>{const t=Ke.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Rt=e=>{G(t=>t===e?null:t),clearTimeout(_.current),_.current=setTimeout(()=>ee(t=>t===e?null:t),160),w?.(null)},Yt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":zn(e),"aria-describedby":Z===e.key?ce:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?Y.current.set(e.key,t):Y.current.delete(e.key)},onMouseEnter:()=>{It(e.key),Ot(e.key)},onMouseLeave:()=>{Et(),Rt(e.key)},onFocus:()=>{It(e.key),Ot(e.key),oe(e.key)},onBlur:()=>{Et(),Rt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=z,r.events(t.length,t.map(zn))),"aria-describedby":Z===e.key?ce:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?Y.current.set(e.key,t):Y.current.delete(e.key)},onMouseEnter:()=>{e.openable?Wt(e.key):Ot(e.key)},onMouseLeave:()=>{Et(),Rt(e.key)},onFocus:()=>{Tt(),Ot(e.key),oe(e.key)},onBlur:()=>{Et(),Rt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Ot(e.key);Wt(e.key);const r=e.members[0];oe(r.key),q.current=r.key}};var t,r},Ht="lanes"!==o||Se.length>1;if(pe)/* @__PURE__ */
346
+ return J("div",{ref:j,children:/* @__PURE__ */J(En,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:Le,todayMs:D,reveal:lt,ariaLabel:y,step:it,nodeProps:Yt,onKeyDown:Bt})});const qt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:xe.rail-3+"px"},children:e});/* @__PURE__ */
347
+ return X("div",{ref:j,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
348
+ /* @__PURE__ */X("div",{className:"flex items-stretch gap-3",children:[N&&qt(Ae,!1),
349
+ /* @__PURE__ */J("div",{className:"rosh-tl-stage",style:{height:`${Vn(xe,Ht,p.length>0&&!N)}px`},children:/* @__PURE__ */X("div",{ref:A,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Je)return;const t=A.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Je.from&&r<=Je.to?Tt():Et()},onMouseLeave:Et,children:[!N&&/* @__PURE__ */J(Bn,{marks:Se,innerRef:B}),
350
+ /* @__PURE__ */J(In,{axis:_e,geo:xe,fillTo:wt,reveal:lt,trackPx:ye,tweened:!!u}),be&&
351
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ye}px`,width:fe-ye+"px",top:xe.rail+3-1+"px"}}),Mt&&/* @__PURE__ */J("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:Mt.from-10+"px",width:Mt.to-Mt.from+20+"px",top:xe.rail-7+"px",height:"20px"}}),
352
+ /* @__PURE__ */J(Tn,{startMs:e,endMs:t,axis:_e,geo:xe,reveal:lt}),
353
+ /* @__PURE__ */J(On,{geo:xe,caption:N?null:Ae,endCaption:N?null:m?.end,around:qe,reveal:lt,trackPx:fe}),N&&/* @__PURE__ */J(Yn,{nodes:Ke,geo:xe,reveal:lt}),null!==D&&D>e&&D<=t+Ga&&/* @__PURE__ */J(Rn,{x:_e.xByMs(Math.min(D,t)),geo:xe,trackPx:fe,label:S(D),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */J(_n,{phase:e,geo:xe,xOf:_e.xByMs},e.key)),
354
+ /* @__PURE__ */J("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Bt,children:Ke.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),a=`${xe.rail+3}px`,n=lt?dn(t,it):{},l=(e=>!!Mt&&e.x>=Mt.from-.5&&e.x<=Mt.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
355
+ return J("li",{children:/* @__PURE__ */J("button",{...Yt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:a,...n}})},e.key);if(!e.mark){const t=e.kind===bn,i=jn(t?"default":e.kind,"key"),s=t?void 0:Cn[e.kind]?.glyph;/* @__PURE__ */
356
+ return X("li",{...r(Le)?{"aria-current":"step"}:{},children:[
357
+ /* @__PURE__ */X("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:a,...n},children:[s&&/* @__PURE__ */J(hn,{name:s}),t&&/* @__PURE__ */X("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */X("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:a},children:["×",e.members.length]})]},e.key)}const i=e.mark,s=jn(i.kind,i.role,i.provisional),{glyph:o}=i;/* @__PURE__ */
358
+ return J("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */X("button",{...Yt(i),className:`${s.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...s.style,left:`${i.x}px`,top:a,...n},children:[o&&/* @__PURE__ */J(hn,{name:o}),"current"===i.role&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===o?/* @__PURE__ */J(qn,{groups:Be,trackPx:fe,geo:xe,startMs:e,endMs:t,currentKey:Le,hoveredKey:K,reveal:lt,step:it,zoomedKey:Ue,popId:de,aimBubble:Lt,startCaptionPx:Fe,openCluster:te,setOpenCluster:re,previewCluster:ae,setPreviewCluster:ne,setZoomKey:ie}):"active"===o?/* @__PURE__ */J(Hn,{nodes:Ke,trackPx:fe,geo:xe,activeKey:c,hoveredKey:K,currentKey:Le}):null,Dt&&/* @__PURE__ */J("div",{ref:R,id:ce,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${xe.rail+6+6}px`},onMouseEnter:()=>{Tt(),Ot(Dt.key)},onMouseLeave:()=>{Et(),Rt(Dt.key)},onFocus:()=>{Tt(),Ot(Dt.key)},onBlur:()=>{Et(),Rt(Dt.key)},children:Dt.mark?/* @__PURE__ */X(Q,{children:[
359
+ /* @__PURE__ */J("span",{className:"rosh-tl-name",children:Dt.mark.label}),
360
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */J("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */J("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */J("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:z.openButton})]}):
361
+ /* @__PURE__ */X("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
362
+ /* @__PURE__ */X("p",{className:"rosh-tl-popover-head",children:["×",Dt.members.length]}),
363
+ /* @__PURE__ */J("ol",{children:Dt.members.map(e=>/* @__PURE__ */X("li",{children:[
364
+ /* @__PURE__ */X("p",{className:"rosh-tl-foldrow",children:[
365
+ /* @__PURE__ */J("span",{children:e.label}),
366
+ /* @__PURE__ */J("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */J("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */J("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
367
+ /* @__PURE__ */J(Un,{thumb:u,value:ct,snap:ot,axis:_e,geo:xe,startMs:e,endMs:t,trackPx:fe,layerRef:A,glide:ht,onScrub:h?bt:void 0,nodes:dt,onProgress:xt})]})}),N&&qt(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */J(Wn,{pending:l,reveal:lt})]})}function Gn({icon:e,heading:t,subject:r,meta:a=[],actions:n,footer:l,children:i}){const s=[...r?[/* @__PURE__ */J("b",{children:r},"subject")]:[],...a.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
368
+ return X("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
369
+ /* @__PURE__ */X("div",{className:"rosh-tl-head",children:[
370
+ /* @__PURE__ */X("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */J("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
371
+ /* @__PURE__ */J("h4",{className:"rosh-tl-title text-gray-800",children:t}),s.length>0&&/* @__PURE__ */J("p",{className:"rosh-tl-meta text-gray-500",children:s.map((e,t)=>
372
+ /* @__PURE__ */X(V,{children:[t>0&&/* @__PURE__ */J("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),n&&/* @__PURE__ */J("span",{className:"rosh-tl-head-actions",children:n})]}),i,l&&/* @__PURE__ */J("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Zn({title:e,heading:t,subject:r,milestones:a,summary:n,endDate:l,phaseLabels:i,variant:s="card",edgeCaptions:o,highlightKeys:c=null,onHoverChange:d}){const u=F(Date.now,null),h=[],m=[],p=$().timeline,g=M();for(const e of a){const t=Za(e.date??null);null===t?m.push({key:e.key,label:e.label,kind:e.kind}):h.push({...e,ms:t})}h.sort((e,t)=>e.ms-t.ms);const f=Za(l??null);let x,b,y=!0;0===h.length?(b=f??u??0,x=b-30*Ga,y=null!==f||null!==u):(x=h[0].ms,b=f??h[h.length-1].ms,b-x<Ga&&(b=x+Ga));const v=h.length>0?Math.max(0,Math.round((b-x)/Ga)):0,w=n??(v>0?p.duration(v):void 0),k=[h.length>0?p.started(Ja(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,a.length):void 0],N=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),C={};for(const e of h)e.phase&&(C[e.phase]=C[e.phase]||[]).push(e.ms);const L=Object.entries(C).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),D="rail"===s,j=y&&/* @__PURE__ */J("div",{className:"select-none",children:/* @__PURE__ */J(Kn,{axis:D?"spread":"compressed",labels:D?"none":"lanes",items:N,pending:m,phases:L,startMs:x,endMs:b,todayMs:u??void 0,edgeCaptions:o,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
373
+ return J("div",D?{className:"shrink-0","data-timeline-variant":"rail",children:j}:{className:"shrink-0",children:/* @__PURE__ */J(Gn,{icon:/* @__PURE__ */J(mn,{}),heading:t??e,subject:r,meta:k,children:j})})}var Jn=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Xn=[{key:"casting",label:"Casting",weight:.2},{key:"cnc",label:"CNC",weight:.2},{key:"painting",label:"Painting",weight:.5},{key:"packing",label:"Packing",weight:.1},{key:"finished_goods",label:"FG",weight:0},{key:"stock_qty",label:"Stock",weight:0}];function Qn(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Xn)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function el(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Qn(t),0)/t.length}function tl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:a,poStatus:n,poNumber:l="",currentReportId:i,currentReportDate:s,msPerDayOfPlayback:o=500,markers:c=[]}=e,[d,u]=W(null),h=$().production;O(()=>{s?u(new Date(s).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=W(!1),g=E(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};O(()=>()=>f(),[]),O(()=>{f()},[i]);const x=t.map(e=>Za(e.date)).filter(e=>null!=e),b=F(Date.now,null)??Math.max(0,...x,...c.map(e=>Za(e.date)??0),Za(r??null)??0,Za(a??null)??0),y=x.length?Math.min(...x):b,v=x.length?Math.max(...x):b,w=Za(r??null)??y,k=Za(a??null)??0,N=Jn.has((n||"").toLowerCase()),M=c.reduce((e,t)=>{const r=Za(t.date);return null!=r&&r>e?r:e},0),C=(()=>{const e=[k,v,M,w+Ga];return N||e.push(b),Math.max(...e)})(),L=Math.max(1,Math.round((C-w)/Ga)),D=Za(s??null)??v??w,j=Math.min(Math.max(d??D,w),C),z=t.find(e=>{const t=Za(e.date);return null!=t&&t<=j})??null;let P=null;for(let e=t.length-1;e>=0;e--){const r=Za(t[e].date);if(null!=r&&r>j){P=t[e];break}}const S=(()=>{if(z||!P||0===t.length)return null;const e=(t[t.length-1].items??[]).map((e,t)=>({id:`zero-${e.part_number}-${t}`,part_number:e.part_number,description:e.description??"",order_qty:Number(e.order_qty||0),casting:0,cnc:0,painting:0,packing:0,finished_goods:0,stock_qty:0}));return{id:`zero-${l}`,progress_number:h.start,date:r||new Date(w).toISOString().slice(0,10),items:e,est_completion_date:a??null,created_by_name:"",notes:""}})(),A=z??S,B=z?Za(z.date):S?w:null,T=P?Za(P.date):null,I=!!(A&&P&&null!=B&&null!=T&&j>B&&j<T);let R,Y;if(I&&null!=B&&null!=T){const e=(j-B)/Math.max(T-B,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of A?.items??[])r[e.part_number]=e;const a={};for(const e of P?.items??[])a[e.part_number]=e;const n=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(a)])).map((e,n)=>{const l=r[e]??{},i=a[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${n}`,part_number:e,description:l.description??i.description??"",order_qty:s(l.order_qty??i.order_qty??0),casting:t(s(l.casting),s(i.casting)),cnc:t(s(l.cnc),s(i.cnc)),painting:t(s(l.painting),s(i.painting)),packing:t(s(l.packing),s(i.packing)),finished_goods:t(s(l.finished_goods),s(i.finished_goods)),stock_qty:t(s(l.stock_qty),s(i.stock_qty))}}),l=Za(A?.est_completion_date),i=Za(P?.est_completion_date);let s;s=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):A?.est_completion_date||P?.est_completion_date||null,R={id:`interp-${j}`,progress_number:h.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:s,items:n,notes:""},Y=A}else if(R=A??t[t.length-1]??null,R){const e=t.findIndex(e=>e.id===R.id);Y=e>=0&&e<t.length-1?t[e+1]:null}else Y=null;const _={};for(const e of Y?.items??[])_[e.part_number]=e;const H=!(!i||R?.id===i),q=i?Math.min(Za(s??null)??C,C):C,U=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:C,totalLeadDays:L,scrubMs:j,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),s&&u(new Date(s).getTime())},scrubbedAway:H,beforeAnchor:A,nextAfter:P,displayed:R,prevReport:Y,prevByPN:_,isInterpolated:I,playing:m,startPlay:()=>{if(m)return void f();if(q<=w)return void u(q);p(!0),u(w);let e=performance.now(),t=w;const r=a=>{const n=a-e;if(e=a,t+=n/o*Ga,t>=q)return u(q),g.current=null,void p(!1);u(t),g.current=requestAnimationFrame(r)};g.current=requestAnimationFrame(r)},stopPlay:f,reports:t,markers:c,poNumber:l,currentReportId:i,currentReportProgressNumber:U,estCompletionMs:Za(a??null)}}function rl({startMs:e,endMs:t,reports:r,markers:a,valueMs:n,activeId:l,onChange:i,onPickReport:s,onOpenReport:o,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const x=$().production,b=M(),y=r.map(e=>({report:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)).sort((e,t)=>e.ms-t.ms),v=y.map(({report:e,ms:t})=>({key:e.id,ms:t,kind:"report",label:h(e),preview:e.preview??u?.(e),onOpen:o?()=>o(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),k=y.map(({ms:e})=>e),N=c?a.map(e=>({...e,onOpen:c})):a;/* @__PURE__ */
374
+ return J("div",{className:"select-none",children:/* @__PURE__ */J(Kn,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),s(e)},playback:m,edgeCaptions:p,thumb:{valueMs:n,onChange:i,onDragStart:d,stops:k,ariaLabel:x.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Ja(e,b)}`:Ja(e,b)}},ariaLabel:x.label(Ja(e,b),Ja(t,b))})})}function al({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:a,renderReportPreview:n,onScrubProgress:l,heading:i,edgeCaptions:s,reportLabel:o=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:x,scrubMs:b,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:C,estCompletionMs:L}=e,D=function(e,t,r){const[a,n]=W(!1),l=E(!1);return{playing:a,toggle:()=>{a?n(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),n(!0))},stop:()=>{l.current=!1,n(!1)}}}(h.map(e=>Za(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),j=$().production,z=M(),S=i??j.heading,A=e=>Ja(e,z);if(0===h.length&&0===m.length)return null;const F=m.filter(e=>"shipment"===e.kind),B=m.filter(e=>"inspection"===e.kind),T=m.filter(e=>"invoice"===e.kind),I=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),O=v?el(v):0,R=h.find(e=>e.id===N),Y=R?o(R):C,_=
375
+ /* @__PURE__ */X("button",{type:"button",onClick:D.toggle,"aria-pressed":D.playing,title:D.playing?j.pause:j.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[D.playing?/* @__PURE__ */J("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M2 1.5h2.3v7H2zM5.7 1.5H8v7H5.7z"})}):/* @__PURE__ */J("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M2 1.2 8.4 5 2 8.8z"})}),
376
+ /* @__PURE__ */J("span",{children:D.playing?j.pause:j.play})]}),H=w&&(c??Y)?/* @__PURE__ */J("button",{type:"button",onClick:()=>{D.stop(),k()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??j.backTo(String(Y))}):null,[q,U]=P(j.showing),V=e=>/* @__PURE__ */J("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */X(Q,{children:[e&&q,
377
+ /* @__PURE__ */J("b",{className:"font-medium",children:o(v)}),e&&U,
378
+ /* @__PURE__ */X("span",{className:"text-gray-500",children:[" · ",A(new Date(v.date).getTime())," · ",j.overall(Math.round(O))," · ",j.inStock(I)]})]}):/* @__PURE__ */J("span",{className:"text-gray-500",children:j.noReport})});if("rail"===d){const e=null!=L&&L>=f&&f>g,i=e?{key:"__estimate__",label:j.estimatedCompletion,dateText:A(L)}:null;/* @__PURE__ */
379
+ return X("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
380
+ /* @__PURE__ */J(rl,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:b,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:a,renderReportPreview:n,reportLabel:o,edgeCaptions:{start:s?.start??j.start,end:s?.end??(e?j.estDone:void 0)},onDragStart:D.stop,playback:{playing:D.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:D.stop}}),
381
+ /* @__PURE__ */X("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[_,H,V(!1)]})]})}/* @__PURE__ */
382
+ return J("div",{className:"shrink-0",children:/* @__PURE__ */J(Gn,{icon:/* @__PURE__ */J(pn,{}),heading:S,subject:p,meta:[`${A(g)} → ${A(f)}`,j.leadTime(x)],actions:/* @__PURE__ */X(Q,{children:[H,_]}),footer:/* @__PURE__ */X(Q,{children:[V(!0),
383
+ /* @__PURE__ */X("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */X("span",{className:"border-gray-200 text-gray-500",children:[
384
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),j.report]}),F.length>0&&/* @__PURE__ */X("span",{className:"border-gray-200 text-gray-500",children:[
385
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */J(hn,{name:"truck"})}),j.shipment]}),B.length>0&&/* @__PURE__ */X("span",{className:"border-gray-200 text-gray-500",children:[
386
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */J(hn,{name:"flask"})}),j.inspection]}),T.length>0&&/* @__PURE__ */X("span",{className:"border-gray-200 text-gray-500",children:[
387
+ /* @__PURE__ */J("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */J(hn,{name:"receipt"})}),j.invoice]})]})]}),children:/* @__PURE__ */J(rl,{startMs:g,endMs:f,reports:h,markers:m,valueMs:b,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:a,renderReportPreview:n,reportLabel:o,edgeCaptions:s,onDragStart:D.stop,playback:{playing:D.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:D.stop}})})})}var nl=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function ll({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:a,qtyField:n="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:s=e=>e.actual_qty,isFilled:o,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=$().containers,m=o?e.filter(o):e,p=e=>nl(i(e)),g=e=>nl(s(e)),f=m.some(e=>null!=s(e)&&g(e)>0),x=e=>f?p(e):"actual"===n?s(e)??i(e)??0:i(e)??0,b=m.reduce((e,t)=>e+nl(x(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+nl(x(t)),0),w=m.reduce((e,t)=>e+p(t),0),k=m.reduce((e,t)=>e+g(t),0),N=e=>t?.(e)??0,M=r??(e=>N(e)*p(e)),C=a??(e=>N(e)*g(e)),L=m.reduce((e,t)=>e+M(t),0),D=m.reduce((e,t)=>e+C(t),0),j=f?Math.max(L,D):"actual"===n&&D||L,z=j<=34.65?"20ft":"40ft",P="20ft"===z?33:67,S=j>0?Math.max(1,Math.ceil(j/P)):0,A=S*P,F=j>0&&j>=.95*A&&j<=1.1*A;if(0===m.length)return null;const B=(e,t)=>P>0?Math.max(0,Math.min((e-t*P)/P*100,100)):0;/* @__PURE__ */
388
+ return X("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
389
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
390
+ /* @__PURE__ */X("span",{children:[`${h.items(m.length)} · ${h.pieces(b)}`,f&&w!==k&&/* @__PURE__ */J("span",{className:"ml-1 text-gray-400",children:h.split(w,k)})]}),l&&y>0&&/* @__PURE__ */X("span",{className:"flex items-center gap-1 text-green-600",children:[
391
+ /* @__PURE__ */J("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),j>0?/* @__PURE__ */X("div",{className:"space-y-1.5",children:[Array.from({length:S}).map((e,t)=>{const r=B(L,t),a=B(D,t),n=f,l=Math.max(r,a),i=Math.min(r,a),s=r>=a,o=n?s?"bg-blue-500":"bg-green-500":"bg-blue-500",c=n?s?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
392
+ return X("div",{className:"flex items-center gap-2",children:[
393
+ /* @__PURE__ */J("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:z}),
394
+ /* @__PURE__ */X("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
395
+ /* @__PURE__ */J("div",{className:`absolute inset-y-0 left-0 ${o} transition-all`,style:{width:`${l}%`}}),n&&i>0&&/* @__PURE__ */J("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
396
+ /* @__PURE__ */J("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:n?h.fill(Math.min(D-t*P,P),P):h.fill(Math.min(L-t*P,P),P)})]},`bar-${t}`)}),
397
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
398
+ /* @__PURE__ */X("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */X(Q,{children:[
399
+ /* @__PURE__ */X("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
400
+ /* @__PURE__ */J("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),h.instructed(L)]}),
401
+ /* @__PURE__ */J("span",{className:"text-gray-400",children:"/"}),
402
+ /* @__PURE__ */X("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
403
+ /* @__PURE__ */J("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(D)]})]}):/* @__PURE__ */J("b",{className:"text-gray-700",children:h.volume(j)})]}),
404
+ /* @__PURE__ */X("span",{className:"font-medium "+(F?"text-green-600":"text-gray-500"),children:[F&&"✓ ",S," × ",z]})]})]}):/* @__PURE__ */J("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var il=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function sl(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function ol(e){const t=[];let r,a=0,n=0;for(il.lastIndex=0;null!==(r=il.exec(e));)r.index>a&&t.push(e.slice(a,r.index)),void 0!==r[1]?t.push(
405
+ /* @__PURE__ */X("span",{className:"text-gray-400",children:["[",r[1],"]"]},n++)):void 0!==r[3]?t.push(
406
+ /* @__PURE__ */J("a",{href:sl(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},n++)):void 0!==r[5]?t.push(
407
+ /* @__PURE__ */J("strong",{className:"font-semibold text-gray-900",children:r[5]},n++)):void 0!==r[6]?t.push(
408
+ /* @__PURE__ */J("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},n++)):void 0!==r[7]&&t.push(/* @__PURE__ */J("em",{children:r[7]},n++)),a=il.lastIndex;return a<e.length&&t.push(e.slice(a)),t}function cl({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=$().markdown;/* @__PURE__ */
409
+ return X("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-2.5",children:[
410
+ /* @__PURE__ */J("svg",{className:"mt-0.5 h-4 w-4 shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M3 6a1.5 1.5 0 0 1 1.5-1.5h1.1l.4-.9a1 1 0 0 1 .9-.6h6.2a1 1 0 0 1 .9.6l.4.9h1.1A1.5 1.5 0 0 1 18 6v8.5A1.5 1.5 0 0 1 16.5 16h-13A1.5 1.5 0 0 1 2 14.5V6Zm7.5 1.5a3.25 3.25 0 1 0 0 6.5 3.25 3.25 0 0 0 0-6.5Z"})}),
411
+ /* @__PURE__ */X("span",{className:"text-xs text-gray-500",children:[
412
+ /* @__PURE__ */J("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function dl(e,t){const r=[];for(const a of e){const e=t.exec(a);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+a.trim())}return r}var ul=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function hl(e,t){const r=e.split("\n"),a=r[0],n=/^(#{2,4})\s+(.*)$/.exec(a);if(n&&1===r.length){const e=n[1].length;/* @__PURE__ */
413
+ return J(`h${e}`,{className:2===e?"mt-2 text-[13px] font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:ol(n[2])},t)}if(1===r.length&&/^---+$/.test(a))/* @__PURE__ */
414
+ return J("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=ul(e[0]),a=e.slice(2).map(ul);/* @__PURE__ */
415
+ return J("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */X("table",{className:"w-full border-collapse text-sm",children:[
416
+ /* @__PURE__ */J("thead",{children:/* @__PURE__ */J("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */J("th",{className:"border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",children:ol(e)},t))})}),
417
+ /* @__PURE__ */J("tbody",{children:a.map((e,t)=>/* @__PURE__ */J("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */J("td",{className:"border-t border-gray-100 px-3 py-1.5 align-top text-gray-700",children:ol(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(a)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
418
+ return J("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:ol(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(a);if(l&&1===r.length)/* @__PURE__ */
419
+ return J(cl,{alt:l[1]},t);if(/^[-*]\s+/.test(a)){const e=dl(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
420
+ return J("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */J("li",{children:ol(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(a);if(i){const e=dl(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
421
+ return J("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */J("li",{className:"pl-1",children:ol(e)},t))},t)}/* @__PURE__ */
422
+ return J("p",{children:ol(r.join(" "))},t)}var ml=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function pl(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let a=[];const n=()=>{for(const e of a.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}a=[]};for(let e=0;e<t.length;e+=1){const l=ml.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){a.push(t[e]);continue}n();const[,i,s,o]=l,c=[];for(e+=1;e<t.length;e+=1){const r=ml.exec(t[e]);if(null!==r&&r[2][0]===s[0]&&r[2].length>=s.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:o.split(/[ \t]/)[0],code:c.join("\n")}})}return n(),r}function gl({children:e,className:t}){/* @__PURE__ */
423
+ return J("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:pl(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
424
+ return J("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */J("code",{children:t})},r)}(e.fence,t):hl(e.text,t))})}var fl=({open:e})=>/* @__PURE__ */J("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform "+(e?"rotate-90":""),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */J("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})});function xl({docs:e,loading:t=!1,categoryOrder:r,canEdit:a=!1,onNew:n,onEdit:l,renderBody:i,emptyMessage:s}){const o=$(),[c,d]=W(""),[u,h]=W(null),[m,p]=W({}),g=c.trim().toLowerCase(),f=Y(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const a=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(a.get(e.key)??1/0)-(a.get(t.key)??1/0))},[e,r]),x=e=>!g||e.title.toLowerCase().includes(g)||e.body.toLowerCase().includes(g)||e.category_label.toLowerCase().includes(g),b=Y(()=>f.map(e=>({...e,docs:e.docs.filter(x)})).filter(e=>e.docs.length>0),[f,g]),y=Y(()=>b.flatMap(e=>e.docs),[b]),v=(u?y.find(e=>e.slug===u):void 0)??y[0]??null,w=e=>!!g||(m[e]??e===v?.category);/* @__PURE__ */
425
+ return X("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
426
+ /* @__PURE__ */X("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
427
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
428
+ /* @__PURE__ */J("h2",{className:"text-sm font-semibold text-gray-900",children:o.help.title}),a&&n&&/* @__PURE__ */J("button",{type:"button",onClick:n,className:"text-xs text-blue-600 hover:underline",children:o.help.newArticle})]}),
429
+ /* @__PURE__ */J("div",{className:"px-2.5 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */X("div",{className:"relative",children:[
430
+ /* @__PURE__ */J("svg",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */J("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 3.36 9.85l3.14 3.15a.75.75 0 1 0 1.06-1.06l-3.15-3.14A5.5 5.5 0 0 0 9 3.5ZM5 9a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",clipRule:"evenodd"})}),
431
+ /* @__PURE__ */J("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:o.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white py-1.5 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
432
+ /* @__PURE__ */J("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */J("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:o.help.loading}):0===b.length?/* @__PURE__ */J("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:g?o.help.noResults:s??o.help.empty}):b.map(e=>{const t=w(e.key);/* @__PURE__ */
433
+ return X("div",{className:"py-0.5",children:[
434
+ /* @__PURE__ */X("button",{type:"button",onClick:()=>{return t=e.key,p(e=>({...e,[t]:!w(t)}));var t},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-[10px] font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
435
+ /* @__PURE__ */J(fl,{open:t}),
436
+ /* @__PURE__ */J("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=v?.slug===e.slug;/* @__PURE__ */
437
+ return X("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-left pl-8 pr-3 py-1.5 text-sm flex items-center gap-1.5 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
438
+ /* @__PURE__ */J("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */J("span",{className:"ml-auto shrink-0 text-[10px] text-amber-600",children:o.help.draft})]},e.slug)})]},e.key)})})]}),
439
+ /* @__PURE__ */J("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:v?/* @__PURE__ */X(Q,{children:[
440
+ /* @__PURE__ */X("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
441
+ /* @__PURE__ */X("div",{className:"min-w-0",children:[
442
+ /* @__PURE__ */J("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
443
+ /* @__PURE__ */X("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */X("span",{className:"ml-2 text-amber-600",children:["· ",o.help.draft]})]})]}),a&&l&&/* @__PURE__ */J("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:o.help.edit})]}),
444
+ /* @__PURE__ */J("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */J(gl,{children:v.body}):/* @__PURE__ */J("p",{className:"text-sm text-gray-500 italic",children:o.help.noBody})})]}):/* @__PURE__ */J("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */J("p",{className:"text-sm text-gray-500",children:t?o.help.loading:o.help.pickArticle})})})]})}var bl={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"};function yl({children:e,onClick:t,variant:r="primary",hotkey:a,disabled:n=!1,type:i="button",title:s,className:o=""}){const c=l(a??"");/* @__PURE__ */
445
+ return X("button",{type:i,onClick:t,disabled:n,title:s,className:`w-full inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors disabled:opacity-50 ${bl[r]} ${o}`,children:[e,a&&/* @__PURE__ */J("kbd",{className:"rounded border border-blue-400/50 bg-blue-500/30 px-1.5 py-0.5 text-[10px] font-medium",children:c})]})}function vl({children:e}){/* @__PURE__ */
446
+ return J("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e})}function wl({label:e,count:t,active:r,onClick:a,icon:n,trailing:l,severity:i}){const s=Ra(i,"SidebarNavItem"),o=$().severity,c=s?(u=o,(d=s).tone?u[d.tone]:u.unrecognised(d.token??"")):void 0;var d,u;/* @__PURE__ */
447
+ return X("button",{type:"button",onClick:a,className:"flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[null!=n&&/* @__PURE__ */J("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:n}),s&&
448
+ /* @__PURE__ */J("span",{"aria-hidden":"true",title:c,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
449
+ /* @__PURE__ */J("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */J("span",{className:"sr-only",children:c}),null!=t&&t>0&&/* @__PURE__ */J("span",{className:"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-1.5 h-5 rounded-full text-[11px] font-medium "+(r?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"),children:t}),null!=l&&/* @__PURE__ */J("span",{className:"shrink-0",children:l})]})}function kl({items:e,activeKey:t,onSelect:r,brand:a,actions:n,className:l}){/* @__PURE__ */
450
+ return X("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[a&&/* @__PURE__ */J("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:a}),
451
+ /* @__PURE__ */J("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const a=e.key===t;/* @__PURE__ */
452
+ return X("button",{type:"button",disabled:e.disabled,"aria-current":a?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-1.5 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(a?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */J("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
453
+ /* @__PURE__ */J("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */J("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-1.5 text-[11px] font-semibold leading-5 text-gray-600",children:e.badge}),a&&/* @__PURE__ */J("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),n&&/* @__PURE__ */J("div",{className:"ml-auto flex items-center gap-2",children:n})]})}var Nl=/(^|[\s:])!?z-/,Ml=/* @__PURE__ */J("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),$l=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Cl({trigger:e,items:t,align:r="end",side:a="bottom","aria-label":n,className:l="",triggerClassName:i,menuClassName:s="",minWidth:o=180,linkAs:c,disabled:d}){const[u,y]=W(!1),[v,w]=W(-1),k=E(null),N=E(null),M=E(null),$=E({text:"",at:0}),C=I(),L=I(),D=T(e=>{y(!1),e&&N.current?.focus()},[]),j=(e,r)=>{const a=t.length;for(let n=0;n<a;n+=1){const l=((e+r*n)%a+a)%a;if($l(t[l]))return l}return-1},z=()=>M.current?.closest("[data-popup-menu-tree]")??null;O(()=>{if(!u)return;const e=e=>{const t=e.target;k.current?.contains(t)||z()?.contains(t)||D(!1)};document.addEventListener("pointerdown",e,!0);const t=x(()=>D(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[u,D]);const P=T(()=>{const e=z(),t=N.current;if(!e||!t)return;const n=e.style;n.left="0px",n.top="0px",n.maxWidth="none",n.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=function({trigger:e,menu:t,bounds:r,align:a,side:n}){const l=ge(e,r,4),i="bottom"===n?"top":"bottom",s=t.height>l[n]&&(t.height<=l[i]||l[i]>l[n])?i:n,o=Math.max(Math.min(t.height,96),l[s]),c=Math.min(t.height,o),d=fe("bottom"===s?e.bottom+4:e.top-4-c,r.top+8,r.bottom-8-c),u=Math.max(0,r.right-r.left-16),h=Math.min(t.width,u);return{left:fe("start"===a?e.left:e.right-h,r.left+8,r.right-8-h),top:d,side:s,maxHeight:o,maxWidth:u}}({trigger:t.getBoundingClientRect(),menu:l,bounds:he(t),align:r,side:a});n.left=`${i.left}px`,n.top=`${i.top}px`,n.maxWidth=`${i.maxWidth}px`,n.maxHeight=`${i.maxHeight}px`,n.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,a]);S(()=>{u&&P()}),O(()=>{if(u)return xe(()=>N.current,P)},[u,P]),O(()=>{if(!u)return;const e=M.current,r=$l(t[v])?e?.querySelector(`[data-dropdown-index="${v}"]`):null;(r??e)?.focus({preventScroll:!0})},[u,v]),O(()=>{if(u)return f(e=>"Escape"===e.key&&(D(!0),!0))},[u,D]);const A=e=>{w(e),y(!0)},F=e=>{e.disabled||(D(!0),e.onSelect())},B=c??"a",R=(e,t)=>({"data-dropdown-index":e,tabIndex:e===v?0:-1,onMouseEnter:()=>{t.disabled||w(e)}}),Y=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
454
+ return J("div",{role:"separator",children:/* @__PURE__ */J(m,{})},e.key);if("label"===e.type)/* @__PURE__ */
455
+ return J("div",{id:`${C}-label-${t}`,children:/* @__PURE__ */J(p,{children:e.label})},e.key);if("radio"===e.type){const r=g(!1,e.disabled,"");/* @__PURE__ */
456
+ return X("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>F(e),...R(t,e),children:[
457
+ /* @__PURE__ */J("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e.checked&&Ml}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=g(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */X("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...R(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */X(B,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>D(!0),...R(t,e),children:[e.icon,e.label]},e.key)}const r=g(e.danger,e.disabled,"");/* @__PURE__ */
458
+ return X("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>F(e),...R(t,e),children:[e.icon,e.label]},e.key)},_={...Nl.test(s)?{}:{zIndex:b.popup},minWidth:o};/* @__PURE__ */
459
+ return X("div",{ref:k,className:`relative inline-flex ${l}`.trim(),children:[
460
+ /* @__PURE__ */J("button",{ref:N,id:L,type:"button","aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?C:void 0,"aria-label":n,disabled:d,onClick:()=>u?D(!1):A(j(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),A(j(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),A(j(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-md text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60",children:e}),u&&
461
+ /* @__PURE__ */J(h,{portal:!0,className:s,style:_,children:/* @__PURE__ */J("div",{ref:M,id:C,role:"menu","aria-orientation":"vertical","aria-label":n,"aria-labelledby":n?void 0:L,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),w(j(v+1,1));else if("ArrowUp"===e.key)e.preventDefault(),w(j(v-1,-1));else if("Home"===e.key)e.preventDefault(),w(j(0,1));else if("End"===e.key)e.preventDefault(),w(j(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),D(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),a=e.key.toLowerCase(),n=r-$.current.at<500?$.current.text+a:a;$.current={text:n,at:r};const l=[...n].every(e=>e===n[0]),i=l?n[0]:n,s=l?v+1:Math.max(v,0),o=M.current,c=t.length;for(let r=0;r<c;r+=1){const a=((s+r)%c+c)%c;if($l(t[a])&&(o?.querySelector(`[data-dropdown-index="${a}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void w(a)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const a=t[r];if("radio"!==a.type){e.push(Y(a,r)),r+=1;continue}const n=r,l=[];for(;r<t.length&&"radio"===t[r].type;)l.push(Y(t[r],r)),r+=1;const i="label"===t[n-1]?.type?`${C}-label-${n-1}`:void 0;e.push(/* @__PURE__ */J("div",{role:"group","aria-labelledby":i,children:l},`group:${a.key}`))}return e})()})})]})}var Ll=6e4;function Dl({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[a,n]=W(null);return O(()=>{if(!e||null!==a)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",a=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!a.ok)return;const i=await a.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&n(s)}catch{}};i();const s=setInterval(()=>{i()},r),o=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",o),()=>{l=!0,clearInterval(s),document.removeEventListener("visibilitychange",o)}},[e,t,r,a]),a}function jl({currentVersion:e,versionUrl:t,pollMs:r,message:a,onRefresh:n,className:l=""}){const i=Dl({currentVersion:e,versionUrl:t,pollMs:r}),s=$();if(null===i)return null;const o=n??(()=>window.location.reload());/* @__PURE__ */
462
+ return J("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-[9999] w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */X(ga,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */J(u,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
463
+ /* @__PURE__ */J("span",{className:"font-medium",children:a??s.update.available}),
464
+ /* @__PURE__ */X("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var zl={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Pl={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Sl({onClose:e}){const t=$().dialog;/* @__PURE__ */
465
+ return J("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */J("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */J("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Al({open:e,onClose:t,side:r="right",size:a="md",title:n,footer:l,children:i,blocking:s=!1,initialFocus:o,"aria-label":c,className:d=""}){const u=E(null),h=I(),m=I();if(y(e),v(u,e,o),w(e),O(()=>{if(e)return f(()=>(s||t(),!0))},[e,s,t]),!e)return null;const p="bottom"===r,g=p?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
466
+ return X("div",{className:"fixed inset-0",style:{zIndex:b.overlay},role:"presentation",children:[
467
+ /* @__PURE__ */J("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
468
+ /* @__PURE__ */X("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":n?m:void 0,"aria-label":n?void 0:c,"aria-describedby":i?h:void 0,style:g,className:["fixed flex flex-col bg-white shadow-xl",p?"":`w-full max-w-full ${zl[a]}`,Pl[r],p?"rounded-t-xl":"",d].filter(Boolean).join(" "),children:[n?/* @__PURE__ */X("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
469
+ /* @__PURE__ */J("h2",{id:m,className:"text-base font-semibold text-gray-900",children:n}),!s&&/* @__PURE__ */J(Sl,{onClose:t})]}):!s&&/* @__PURE__ */J("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */J(Sl,{onClose:t})}),
470
+ /* @__PURE__ */J("div",{id:h,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:i}),l&&/* @__PURE__ */J("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:l})]})]})}var Fl="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z";function Bl({providers:e,typeIcons:t,placeholder:r,onSelect:a}={}){const n=$().search,l=r??n.placeholder,[i,s]=W(!1),[o,c]=W(""),[d,u]=W([]),[h,m]=W(!1),[p,g]=W(0),f=E(null),x=E();O(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),s(e=>!e)),"Escape"===e.key&&i&&s(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]),y(i),O(()=>{i?setTimeout(()=>f.current?.focus(),50):(c(""),u([]))},[i]),O(()=>{if(x.current&&clearTimeout(x.current),o.length<2)u([]);else{if(e&&0!==e.length)return x.current=setTimeout(async()=>{m(!0);try{const t=await Promise.all(e.map(e=>e(o).catch(()=>[])));u(t.flat()),g(0)}catch{u([])}m(!1)},250),()=>{x.current&&clearTimeout(x.current)};u([])}},[o,e]);const v=T(e=>{s(!1),a?.(e)},[a]);return i?ee(
471
+ /* @__PURE__ */X("div",{"data-global-search":"",className:"fixed inset-0 flex items-start justify-center pt-[15vh]",style:{zIndex:b.overlay},onClick:()=>s(!1),children:[
472
+ /* @__PURE__ */J("div",{"data-global-search-backdrop":"",className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),
473
+ /* @__PURE__ */X("div",{className:"relative z-10 w-full max-w-xl rounded-2xl overflow-hidden",onClick:e=>e.stopPropagation(),style:k(),children:[
474
+ /* @__PURE__ */X("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-gray-200",children:[
475
+ /* @__PURE__ */J("svg",{className:"h-5 w-5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:Fl})}),
476
+ /* @__PURE__ */J("input",{ref:f,type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"ArrowDown"===e.key?(e.preventDefault(),g(e=>Math.min(e+1,d.length-1))):"ArrowUp"===e.key?(e.preventDefault(),g(e=>Math.max(e-1,0))):"Enter"===e.key&&d[p]&&v(d[p])},placeholder:l,className:"flex-1 text-sm bg-transparent border-0 rosh-focus-ring placeholder-gray-400"}),
477
+ /* @__PURE__ */J("kbd",{className:"hidden sm:inline-flex items-center rounded border border-gray-300 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:n.escBadge})]}),
478
+ /* @__PURE__ */X("div",{className:"max-h-[50vh] overflow-y-auto",children:[h&&/* @__PURE__ */J("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:n.searching}),!h&&o.length>=2&&0===d.length&&/* @__PURE__ */J("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:n.noResults}),!h&&d.length>0&&/* @__PURE__ */J("ul",{className:"py-2",children:d.map((e,r)=>/* @__PURE__ */J("li",{children:/* @__PURE__ */X("button",{className:"flex items-center gap-3 w-full px-4 py-2.5 text-left transition-colors "+(r===p?"bg-blue-50":"hover:bg-gray-50"),onClick:()=>v(e),onMouseEnter:()=>g(r),children:[
479
+ /* @__PURE__ */J("svg",{className:"h-4 w-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t?.[e.type]||Fl})}),
480
+ /* @__PURE__ */X("div",{className:"flex-1 min-w-0",children:[
481
+ /* @__PURE__ */J("p",{className:"text-sm font-medium text-gray-900 truncate",children:e.label}),e.sub&&/* @__PURE__ */J("p",{className:"text-xs text-gray-400 truncate",children:e.sub})]}),
482
+ /* @__PURE__ */J("span",{className:"shrink-0 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500",children:e.type})]})},`${e.type}-${e.label}-${r}`))}),!h&&o.length<2&&/* @__PURE__ */J("div",{className:"px-4 py-6 text-center text-sm text-gray-400",children:n.minChars(2)})]}),
483
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between px-4 py-2 border-t border-gray-100 bg-gray-50 text-[11px] text-gray-400",children:[
484
+ /* @__PURE__ */X("div",{className:"flex items-center gap-3",children:[
485
+ /* @__PURE__ */X("span",{className:"flex items-center gap-1",children:[
486
+ /* @__PURE__ */J("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↑"}),
487
+ /* @__PURE__ */J("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:"↓"}),` ${n.navigate}`]}),
488
+ /* @__PURE__ */X("span",{className:"flex items-center gap-1",children:[
489
+ /* @__PURE__ */J("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:n.enterKey}),` ${n.open}`]})]}),
490
+ /* @__PURE__ */X("span",{className:"flex items-center gap-1",children:[
491
+ /* @__PURE__ */J("kbd",{className:"rounded border border-gray-300 px-1 py-0.5 font-medium",children:n.escKey}),` ${n.close}`]})]})]})]}),document.body):null}function Tl({items:e,columns:t,columnOf:r,getId:a,onMove:n,renderCard:l,onCardClick:i,sortInColumn:s,isLoading:o=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=$().kanban,f=M(),x=c??g.loading,b=h??g.dropHere,y=p??g.addItem,[v,w]=W(null),[k,N]=W(null),C=Y(()=>{const a={};for(const e of t)a[e.value]=[];for(const t of e)(a[r(t)]??=[]).push(t);if(s)for(const e of Object.keys(a))a[e].sort(s);return a},[e,t,r,s]),L=()=>{w(null),N(null)},j=E(null),z=E(/* @__PURE__ */new Map);S(()=>{if(null!==v)return;const e=j.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const a=e.dataset.kanbanCard,n=e.getBoundingClientRect();t.set(a,n);const l=z.current.get(a);if(l){const t=l.left-n.left,a=l.top-n.top;(t||a)&&r.push([e,t,a])}}),z.current=t,r.length){for(const[e,t,a]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${a}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[C,v]);return o?/* @__PURE__ */J("div",{className:"text-sm text-gray-500 p-4",children:x}):0!==e.length||u?/* @__PURE__ */J("div",{ref:j,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */J("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=C[e.value]??[],r=null!==k&&k.col===e.value,s=null!==v?t.findIndex(e=>a(e)===v):-1,o=r&&(-1===s||k.index!==s&&k.index!==s+1)?k.index:-1;/* @__PURE__ */
492
+ return X("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&k&&k.col===e){const t=(C[e]??[]).findIndex(e=>a(e)===v),r=-1!==t;if(!r||k.index!==t&&k.index!==t+1){const a=r&&k.index>t?k.index-1:k.index;n(v,e,a)}}L()})(e.value)},children:[
493
+ /* @__PURE__ */X("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
494
+ /* @__PURE__ */X("span",{className:"flex items-center gap-2",children:[
495
+ /* @__PURE__ */J("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
496
+ /* @__PURE__ */J("span",{className:"text-xs opacity-70",children:D(t.length,f)})]}),
497
+ /* @__PURE__ */X("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>N(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,n)=>{const s=a(r),c=s===v;/* @__PURE__ */
498
+ return X(V,{children:[o===n&&/* @__PURE__ */J("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
499
+ /* @__PURE__ */J("div",{"data-kanban-card":s,draggable:!0,onDragStart:e=>{w(s);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>a(e)===v):-1,i=-1!==l&&l<n?n+1:n;N(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:L,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},s)}),t.length>0&&o===t.length&&/* @__PURE__ */J("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */J("div",{className:"text-[11px] text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:b})]}),m&&/* @__PURE__ */J("div",{className:"p-2 pt-0",children:/* @__PURE__ */X("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
500
+ /* @__PURE__ */J("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */J(Q,{children:d??/* @__PURE__ */J("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var Wl="inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";function El({page:e,pageCount:t,onPageChange:r,siblingCount:a=1,showEdges:n=!1,className:l=""}){const i=$().pagination,s=M();if(t<=1)return null;const o=function(e,t,r){const a=/* @__PURE__ */new Set([1,t]);for(let n=e-r;n<=e+r;n++)n>=1&&n<=t&&a.add(n);const n=[...a].sort((e,t)=>e-t),l=[];let i=0;for(const e of n)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,a),c=a=>{a>=1&&a<=t&&a!==e&&r(a)};/* @__PURE__ */
501
+ return X("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[n&&/* @__PURE__ */J("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${Wl} text-gray-600 hover:bg-gray-100`,children:"«"}),
502
+ /* @__PURE__ */J("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${Wl} text-gray-600 hover:bg-gray-100`,children:"‹"}),o.map((t,r)=>"…"===t?/* @__PURE__ */J("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */J("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${Wl} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:D(t,s)},t)),
503
+ /* @__PURE__ */J("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Wl} text-gray-600 hover:bg-gray-100`,children:"›"}),n&&/* @__PURE__ */J("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Wl} text-gray-600 hover:bg-gray-100`,children:"»"})]})}var Il=e=>Array.isArray(e.columns),Ol={sm:"px-2 py-1.5",md:"px-3 py-2"},Rl={left:"text-left",right:"text-right",center:"text-center"};function Yl({direction:e}){/* @__PURE__ */
504
+ return X("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
505
+ /* @__PURE__ */J("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */J("path",{d:"M4 0L8 5H0z"})}),
506
+ /* @__PURE__ */J("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */J("path",{d:"M4 5L0 0h8z"})})]})}function _l({columns:e,data:t,rowKey:r,sort:a=null,onSortChange:n,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,emptyText:m,selection:p,footer:g,virtualized:f,stackOnNarrow:x=!1,className:b=""}){const y=$(),v=m??y.table.empty,w=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),k=x&&!f,N=e=>k?{role:e}:{},M=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[C,L]=W(0),D=f?.overscan??6,j=f?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/f.rowHeight)-D);L(e=>e===t?e:t)}:void 0,z=f?Math.ceil(f.height/f.rowHeight)+2*D:t.length,P=f?Math.min(C,Math.max(0,t.length-z)):0,A=Math.min(t.length,P+z),F=f?P*f.rowHeight:0,B=f?(t.length-A)*f.rowHeight:0,T=E(null),[I,O]=W(0);S(()=>{if(!f)return;const e=T.current?.offsetHeight??0;O(t=>t===e?t:e)});const R=e=>e.sortField??e.key,Y=e=>a&&a.field===R(e)?a.direction:null,_=e.flatMap(e=>Il(e)?e.columns:[e]),H=e.some(Il),q=/* @__PURE__ */new Map;if(k)for(const t of e)if(Il(t))for(const e of t.columns)q.set(e,M(t.title,t.label));const U=e=>{const t=M(e.title,e.label),r=q.get(e);return t&&r?`${r} · ${t}`:t},V=new Set(p?.selected??[]),K=p?t.map((e,t)=>w(e,t)):[],G=K.length>0&&K.every(e=>V.has(e)),Z=K.some(e=>V.has(e)),ee=p?36:0,te=_.length+(p?1:0),re=_.some(e=>"left"===e.fixed),ae=`${Ol[c]} ${"sm"===c?"text-xs":"text-sm"}`,ne=(e,t,r,a=0)=>{const l=Y(e),i=Rl[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!n);/* @__PURE__ */
507
+ return J("th",{scope:"col",...N("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":o?"none":void 0,style:{width:e.width,...s?{left:(ie[t]??0)+ee}:{},...f?{top:a}:{}},className:[ae,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",s?f?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":f?"sticky z-10 bg-gray-50":"",k&&o?"rosh-dt-sort":"",e.headerClassName??""].filter(Boolean).join(" "),children:o?/* @__PURE__ */X("button",{type:"button",onClick:()=>(e=>{if(!n)return;const t=R(e),r=Y(e),a=e.sortFirst??"asc";n(null===r?{field:t,direction:a}:r===a?{field:t,direction:"asc"===a?"desc":"asc"}:null)})(e),"data-group":k?q.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
508
+ /* @__PURE__ */J(Yl,{direction:l})]}):e.title},e.key)};let le=0;const ie=_.map(e=>{if("left"!==e.fixed)return null;const t=le;return le+=e.width??0,t});/* @__PURE__ */
509
+ return X("div",{className:k?`rosh-dt-stack ${b}`.trim():b,children:[
510
+ /* @__PURE__ */X("div",{onScroll:j,style:f?{maxHeight:f.height}:void 0,className:`relative overflow-x-auto ${f?"overflow-y-auto":""} ${o?"rounded-lg border border-gray-200":""}${k?" rosh-dt-scroll":""}`.trim(),children:[s&&
511
+ /* @__PURE__ */X("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
512
+ /* @__PURE__ */J("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
513
+ /* @__PURE__ */J("span",{className:"sr-only",children:y.table.loading})]}),
514
+ /* @__PURE__ */X("table",{...N("table"),className:(k?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */J("caption",{className:"sr-only",children:i}),
515
+ /* @__PURE__ */X("thead",{...N("rowgroup"),className:k?"rosh-dt-head":void 0,children:[
516
+ /* @__PURE__ */X("tr",{ref:T,...N("row"),className:"border-b border-gray-200 bg-gray-50",children:[p&&/* @__PURE__ */J("th",{scope:"col",...N("columnheader"),rowSpan:H?2:void 0,style:{width:36,...f?{top:0}:{}},className:[ae,re||f?"sticky z-20 bg-gray-50":"",re?"left-0":"",k?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */J(Ce,{"aria-label":y.table.selectAll,checked:G,indeterminate:Z&&!G,onChange:()=>{if(!p)return;const e=new Set(K);p.onChange(G?p.selected.filter(t=>!e.has(t)):[...p.selected,...K.filter(e=>!V.has(e))])}})}),e.map((e,t)=>Il(e)?/* @__PURE__ */J("th",{scope:"colgroup",...N("columnheader"),colSpan:e.columns.length,style:f?{top:0}:void 0,className:[ae,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",f?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):ne(e,_.indexOf(e),H?2:1))]}),H&&/* @__PURE__ */J("tr",{...N("row"),className:"border-b border-gray-200 bg-gray-50",children:e.flatMap(e=>Il(e)?e.columns:[]).map(e=>ne(e,_.indexOf(e),1,I))})]}),
517
+ /* @__PURE__ */J("tbody",{...N("rowgroup"),className:k?"rosh-dt-body":void 0,children:0!==t.length||s?/* @__PURE__ */X(Q,{children:[F>0&&/* @__PURE__ */J("tr",{"aria-hidden":"true",children:/* @__PURE__ */J("td",{colSpan:te,style:{height:F,padding:0,border:0}})}),t.slice(P,A).map((e,t)=>{const r=P+t,a=h?.(e,r);/* @__PURE__ */
518
+ return X("tr",{...N("row"),style:f?{height:f.rowHeight}:void 0,onClick:a?.onClick,...a?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a.onClick?.()))}}:{},className:[k?p?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"","border-b border-gray-100 last:border-b-0",a?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",u?.(e,r)??"",a?.className??""].filter(Boolean).join(" "),children:[p&&(()=>{const t=w(e,r);/* @__PURE__ */
519
+ return J("td",{...N("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[ae,re?"sticky left-0 z-10 bg-white":"",k?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */J(Ce,{"aria-label":y.table.selectRow,checked:V.has(t),onChange:()=>(e=>{p&&p.onChange(V.has(e)?p.selected.filter(t=>t!==e):[...p.selected,e])})(t)})})})(),_.map((t,a)=>{const n="left"===t.fixed,l=t.render?t.render(e,r):t.dataIndex?e[t.dataIndex]:null;/* @__PURE__ */
520
+ return J("td",{...N("cell"),"data-label":k?U(t):void 0,style:n?{left:(ie[a]??0)+ee}:void 0,className:[k?t.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",ae,Rl[t.align??(t.numeric?"right":"left")],t.numeric&&!k?"font-mono":"","text-gray-900",t.ellipsis?"max-w-0 truncate":"",n?"sticky z-10 bg-white":""].filter(Boolean).join(" "),children:k?
521
+ /* @__PURE__ */J("span",{className:t.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:l}):l},t.key)})]},w(e,r))}),B>0&&/* @__PURE__ */J("tr",{"aria-hidden":"true",children:/* @__PURE__ */J("td",{colSpan:te,style:{height:B,padding:0,border:0}})})]}):/* @__PURE__ */J("tr",{...N("row"),className:k?"rosh-dt-empty":void 0,children:/* @__PURE__ */J("td",{...N("cell"),colSpan:te,className:`${ae} py-10 text-center text-gray-500`,children:v})})})]}),g]}),l&&l.pageCount>1&&/* @__PURE__ */J("div",{className:k?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */J(El,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]})}function Hl({selectedCount:e,loadedCount:t,totalCount:r,label:a,isFetchingMore:n,extra:l}){const i=$().list,s=r??t,o=t>=s;/* @__PURE__ */
522
+ return X(Q,{children:[l,e>0?`${i.selected(e)} — `:"",o?null!=r?i.allLoaded(s,a):i.count(s,a):i.loadedOf(t,s,a),n?` · ${i.loadingMore}`:""]})}function ql({title:e,message:t,onRetry:r,variant:a="dashed"}){const n=$().list;/* @__PURE__ */
523
+ return X("div",{className:`flex flex-col items-center justify-center text-center ${"card"===a?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===a?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
524
+ /* @__PURE__ */J("svg",{className:"h-10 w-10 text-red-300 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,"aria-hidden":"true",children:/* @__PURE__ */J("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0 3.75h.008M10.34 3.94l-8.4 14.55A1.5 1.5 0 003.24 21h17.52a1.5 1.5 0 001.3-2.51l-8.4-14.55a1.5 1.5 0 00-2.6 0z"})}),
525
+ /* @__PURE__ */J("h3",{className:"text-sm font-medium text-gray-900",children:e??n.loadError}),
526
+ /* @__PURE__ */J("p",{className:"text-sm text-gray-500 mt-2",children:t??n.loadErrorMessage}),r&&/* @__PURE__ */J("div",{className:"mt-4",children:/* @__PURE__ */J(u,{variant:"secondary",size:"sm",onClick:r,children:n.retry})})]})}function Ul({data:e,width:t=120,height:r=32,stroke:a="currentColor",fill:n,strokeWidth:l=1.5,showDots:i=!1,className:s,style:o}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,a)=>[a*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
527
+ return X("svg",{className:s,style:o,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[n&&/* @__PURE__ */J("path",{d:f,fill:n,stroke:"none"}),
528
+ /* @__PURE__ */J("path",{d:g,fill:"none",stroke:a,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */J("circle",{cx:e,cy:t,r:l+.5,fill:a},r))]})}function Vl({data:e,labels:t,height:r=120,color:a="currentColor",colors:n,max:l,gap:i=6,className:s,style:o}){const c=M();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
529
+ return X("div",{className:s,style:o,children:[
530
+ /* @__PURE__ */J("div",{className:"flex items-end",style:{height:r,gap:i},children:e.map((e,r)=>/* @__PURE__ */J("div",{className:"flex flex-1 flex-col justify-end",style:{height:"100%"},children:/* @__PURE__ */J("div",{className:"w-full rounded-t",style:{height:`${Math.max(0,e/d*100)}%`,minHeight:e>0?2:0,backgroundColor:n?.[r]??a},title:null!=t?.[r]?`${t[r]}: ${D(e,c)}`:D(e,c)})},r))}),t&&/* @__PURE__ */J("div",{className:"mt-1 flex",style:{gap:i},children:t.map((e,t)=>/* @__PURE__ */J("div",{className:"flex-1 truncate text-center text-[10px] text-gray-400",children:e},t))})]})}var Kl=["var(--rosh-donut-1)","var(--rosh-donut-2)","var(--rosh-donut-3)","var(--rosh-donut-4)","var(--rosh-donut-5)","var(--rosh-donut-6)","var(--rosh-donut-7)","var(--rosh-donut-8)"];function Gl({segments:e,size:t=120,thickness:r=16,centerLabel:a,className:n,style:l}){const i=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,s=(t-r)/2,o=t/2,c=2*Math.PI*s;let d=0;/* @__PURE__ */
531
+ return X("div",{className:`relative inline-flex items-center justify-center ${n??""}`.trim(),style:{width:t,height:t,...l},children:[
532
+ /* @__PURE__ */X("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-hidden":"true",style:{transform:"rotate(-90deg)"},children:[
533
+ /* @__PURE__ */J("circle",{cx:o,cy:o,r:s,fill:"none",stroke:"var(--rosh-donut-track)",strokeWidth:r}),e.map((e,t)=>{const a=Math.max(0,e.value)/i*c,n=/* @__PURE__ */J("circle",{cx:o,cy:o,r:s,fill:"none",stroke:e.color??Kl[t%Kl.length],strokeWidth:r,strokeDasharray:`${a} ${c-a}`,strokeDashoffset:-d},t);return d+=a,n})]}),null!=a&&/* @__PURE__ */J("div",{className:"absolute text-center text-sm font-semibold text-gray-900",children:a})]})}var Zl=(e,t)=>Number.isInteger(e)?D(e,t):j(e,1,t);function Jl({series:e,labels:t,height:r=160,strokeWidth:a=2,showDots:n=!1,max:l,min:i,showScale:s=!1,showLegend:o=!1,className:c,style:d}){const u=M(),h=e.filter(e=>e.data.length>0);if(0===h.length)return null;const m=h.flatMap(e=>e.data),p=l??Math.max(...m),g=i??Math.min(...m),f=p-g||1,x=e=>e.color??"currentColor";/* @__PURE__ */
534
+ return X("div",{className:c,style:d,children:[o&&h.some(e=>e.label)&&/* @__PURE__ */J("div",{className:"mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5",children:h.map((e,t)=>e.label&&/* @__PURE__ */X("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[
535
+ /* @__PURE__ */J("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:x(e)}}),e.label]},t))}),
536
+ /* @__PURE__ */X("div",{className:"flex",children:[s&&/* @__PURE__ */X("div",{className:"flex flex-col justify-between pr-1.5 text-right text-[10px] leading-none text-gray-400",style:{height:r},children:[
537
+ /* @__PURE__ */J("span",{children:Zl(p,u)}),
538
+ /* @__PURE__ */J("span",{children:Zl(g+f/2,u)}),
539
+ /* @__PURE__ */J("span",{children:Zl(g,u)})]}),
540
+ /* @__PURE__ */X("svg",{className:"min-w-0 flex-1",width:"100%",height:r,viewBox:"0 0 100 100",preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[s&&[0,50,100].map(e=>/* @__PURE__ */J("line",{x1:0,y1:e,x2:100,y2:e,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1,vectorEffect:"non-scaling-stroke"},e)),h.map((e,r)=>{const l=function(e,t,r){return 1===e.length?[[0,100-(e[0]-t)/r*100],[100,100-(e[0]-t)/r*100]]:e.map((a,n)=>[100*n/(e.length-1),100-(a-t)/r*100])}(e.data,g,f),i=function(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")}(l);/* @__PURE__ */
541
+ return X("g",{children:[e.fill&&/* @__PURE__ */J("path",{d:`${i} L100,100 L0,100 Z`,fill:e.fill,stroke:"none"}),
542
+ /* @__PURE__ */J("path",{d:i,fill:"none",stroke:x(e),strokeWidth:a,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),n&&e.data.length>1&&l.map(([r,n],l)=>/* @__PURE__ */J("path",{d:`M${r.toFixed(2)},${n.toFixed(2)} h0.01`,stroke:x(e),strokeWidth:2.5*a,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",children:/* @__PURE__ */J("title",{children:`${null!=t?.[l]?`${t[l]}: `:""}${e.label?`${e.label} `:""}${D(e.data[l],u)}`})},l))]},r)})]})]}),t&&/* @__PURE__ */J("div",{className:"mt-1 flex justify-between "+(s?"pl-6":""),children:t.map((e,t)=>/* @__PURE__ */J("div",{className:"truncate text-[10px] text-gray-400",children:e},t))})]})}var Xl={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},Ql=[12,18,14,22,19,27,24,31,28,35,30,38],ei=["J","F","M","A","M","J","J","A","S","O","N","D"],ti=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function ri(){/* @__PURE__ */
543
+ return J(za,{groups:Xl,children:/* @__PURE__ */J("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */X("div",{className:"mx-auto max-w-6xl space-y-6",children:[
544
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-4",children:[
545
+ /* @__PURE__ */X("div",{children:[
546
+ /* @__PURE__ */J("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
547
+ /* @__PURE__ */J("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
548
+ /* @__PURE__ */X("div",{className:"flex items-center gap-2",children:[
549
+ /* @__PURE__ */J(u,{variant:"secondary",size:"sm",children:"Export"}),
550
+ /* @__PURE__ */J(u,{size:"sm",children:"New report"})]})]}),
551
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
552
+ /* @__PURE__ */J(Dr,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
553
+ /* @__PURE__ */J(Dr,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
554
+ /* @__PURE__ */J(Dr,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
555
+ /* @__PURE__ */J(Dr,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
556
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
557
+ /* @__PURE__ */J(Lr,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */J("div",{className:"text-blue-600",children:/* @__PURE__ */J(Vl,{data:Ql,labels:ei,height:160})})}),
558
+ /* @__PURE__ */J(Lr,{header:"Traffic sources",children:/* @__PURE__ */X("div",{className:"flex items-center gap-4",children:[
559
+ /* @__PURE__ */J(Gl,{size:120,segments:[{label:"Direct",value:45},{label:"Search",value:30},{label:"Social",value:15},{label:"Email",value:10}],centerLabel:/* @__PURE__ */J("span",{className:"text-gray-900",children:"100%"})}),
560
+ /* @__PURE__ */X("ul",{className:"space-y-1.5 text-sm text-gray-600",children:[
561
+ /* @__PURE__ */X("li",{className:"flex items-center gap-2",children:[
562
+ /* @__PURE__ */J(ai,{c:Kl[0]}),"Direct · 45%"]}),
563
+ /* @__PURE__ */X("li",{className:"flex items-center gap-2",children:[
564
+ /* @__PURE__ */J(ai,{c:Kl[1]}),"Search · 30%"]}),
565
+ /* @__PURE__ */X("li",{className:"flex items-center gap-2",children:[
566
+ /* @__PURE__ */J(ai,{c:Kl[2]}),"Social · 15%"]}),
567
+ /* @__PURE__ */X("li",{className:"flex items-center gap-2",children:[
568
+ /* @__PURE__ */J(ai,{c:Kl[3]}),"Email · 10%"]})]})]})})]}),
569
+ /* @__PURE__ */J(Lr,{header:"Recent orders",padded:!1,children:/* @__PURE__ */X("table",{className:"w-full text-sm",children:[
570
+ /* @__PURE__ */J("thead",{children:/* @__PURE__ */X("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
571
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Order"}),
572
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Customer"}),
573
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Total"}),
574
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Status"})]})}),
575
+ /* @__PURE__ */J("tbody",{className:"divide-y divide-gray-100",children:ti.map(e=>/* @__PURE__ */X("tr",{className:"text-gray-700",children:[
576
+ /* @__PURE__ */J("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
577
+ /* @__PURE__ */J("td",{className:"px-4 py-2",children:/* @__PURE__ */X("span",{className:"flex items-center gap-2",children:[
578
+ /* @__PURE__ */J(da,{size:"xs",name:e.customer}),e.customer]})}),
579
+ /* @__PURE__ */J("td",{className:"px-4 py-2",children:e.total}),
580
+ /* @__PURE__ */J("td",{className:"px-4 py-2",children:/* @__PURE__ */J(Pa,{status:e.status})})]},e.id))})]})}),
581
+ /* @__PURE__ */X("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
582
+ /* @__PURE__ */J("span",{className:"text-emerald-600",children:/* @__PURE__ */J(Ul,{data:Ql,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}function ai({c:e}){/* @__PURE__ */
583
+ return J("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}})}var ni={active:"success",invited:"queued",suspended:"danger",pending:"pending"},li=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function ii(){const[e,t]=W(1),[r,a]=W(""),[n,l]=W("");/* @__PURE__ */
584
+ return J(za,{groups:ni,children:/* @__PURE__ */J("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */X("div",{className:"mx-auto max-w-5xl space-y-4",children:[
585
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-4",children:[
586
+ /* @__PURE__ */J("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
587
+ /* @__PURE__ */J(u,{size:"sm",children:"Invite member"})]}),
588
+ /* @__PURE__ */X(Lr,{padded:!1,children:[
589
+ /* @__PURE__ */X("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
590
+ /* @__PURE__ */J("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */J(oe,{value:n,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */J(si,{})})}),
591
+ /* @__PURE__ */J("div",{className:"w-40",children:/* @__PURE__ */J($e,{value:r,onChange:a,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
592
+ /* @__PURE__ */J(u,{variant:"secondary",size:"sm",children:"Filter"})]}),
593
+ /* @__PURE__ */X("table",{className:"w-full text-sm",children:[
594
+ /* @__PURE__ */J("thead",{children:/* @__PURE__ */X("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
595
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Name"}),
596
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Role"}),
597
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium",children:"Status"}),
598
+ /* @__PURE__ */J("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
599
+ /* @__PURE__ */J("tbody",{className:"divide-y divide-gray-100",children:li.map(e=>/* @__PURE__ */X("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
600
+ /* @__PURE__ */X("td",{className:"px-4 py-2.5",children:[
601
+ /* @__PURE__ */J("div",{className:"font-medium text-gray-900",children:e.name}),
602
+ /* @__PURE__ */J("div",{className:"text-xs text-gray-400",children:e.email})]}),
603
+ /* @__PURE__ */J("td",{className:"px-4 py-2.5",children:e.role}),
604
+ /* @__PURE__ */J("td",{className:"px-4 py-2.5",children:/* @__PURE__ */J(Pa,{status:e.status})}),
605
+ /* @__PURE__ */J("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */J(u,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
606
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
607
+ /* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
608
+ /* @__PURE__ */J(El,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function si(){/* @__PURE__ */
609
+ return X("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[
610
+ /* @__PURE__ */J("circle",{cx:"9",cy:"9",r:"6"}),
611
+ /* @__PURE__ */J("path",{d:"M14 14l3 3",strokeLinecap:"round"})]})}function oi(){const[e,t]=W("pro"),[r,a]=W(!0),[n,l]=W("us");/* @__PURE__ */
612
+ return J("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */X("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
613
+ /* @__PURE__ */X("div",{children:[
614
+ /* @__PURE__ */J("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
615
+ /* @__PURE__ */J("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
616
+ /* @__PURE__ */J(Lr,{header:"Profile",children:/* @__PURE__ */X("div",{className:"space-y-4",children:[
617
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
618
+ /* @__PURE__ */J(je,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */J(oe,{id:"fn",defaultValue:"Alice"})}),
619
+ /* @__PURE__ */J(je,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */J(oe,{id:"ln",defaultValue:"Nguyen"})})]}),
620
+ /* @__PURE__ */J(je,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */J(oe,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
621
+ /* @__PURE__ */J(je,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */J(ce,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
622
+ /* @__PURE__ */J(Lr,{header:"Preferences",children:/* @__PURE__ */X("div",{className:"space-y-4",children:[
623
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
624
+ /* @__PURE__ */J(je,{label:"Country",htmlFor:"country",children:/* @__PURE__ */J($e,{value:n,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
625
+ /* @__PURE__ */J(je,{label:"Plan",children:/* @__PURE__ */X("div",{className:"space-y-1.5 pt-1",children:[
626
+ /* @__PURE__ */J(De,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
627
+ /* @__PURE__ */J(De,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
628
+ /* @__PURE__ */J(De,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
629
+ /* @__PURE__ */J(Ce,{checked:r,onChange:a,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
630
+ /* @__PURE__ */X("div",{className:"flex items-center justify-end gap-2",children:[
631
+ /* @__PURE__ */J(u,{variant:"secondary",children:"Cancel"}),
632
+ /* @__PURE__ */J(u,{type:"submit",children:"Save changes"})]})]})})}var ci=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function di(){const[e,t]=W(!0),[r,a]=W("us"),n=ci.reduce((e,t)=>e+t.qty*t.price,0),l=n+9;/* @__PURE__ */
633
+ return J("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */X("div",{className:"mx-auto max-w-5xl space-y-5",children:[
634
+ /* @__PURE__ */J("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
635
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
636
+ /* @__PURE__ */X("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
637
+ /* @__PURE__ */J(Lr,{header:"Contact",children:/* @__PURE__ */J("div",{className:"space-y-4",children:/* @__PURE__ */J(je,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */J(oe,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
638
+ /* @__PURE__ */J(Lr,{header:"Shipping address",children:/* @__PURE__ */X("div",{className:"space-y-4",children:[
639
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
640
+ /* @__PURE__ */J(je,{label:"First name",required:!0,children:/* @__PURE__ */J(oe,{placeholder:"Alice"})}),
641
+ /* @__PURE__ */J(je,{label:"Last name",required:!0,children:/* @__PURE__ */J(oe,{placeholder:"Nguyen"})})]}),
642
+ /* @__PURE__ */J(je,{label:"Address",required:!0,children:/* @__PURE__ */J(oe,{placeholder:"123 Market St"})}),
643
+ /* @__PURE__ */X("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
644
+ /* @__PURE__ */J(je,{label:"City",children:/* @__PURE__ */J(oe,{placeholder:"San Francisco"})}),
645
+ /* @__PURE__ */J(je,{label:"ZIP",children:/* @__PURE__ */J(oe,{placeholder:"94103"})}),
646
+ /* @__PURE__ */J(je,{label:"Country",children:/* @__PURE__ */J($e,{value:r,onChange:a,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
647
+ /* @__PURE__ */J(Ce,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
648
+ /* @__PURE__ */J(Lr,{header:"Payment",children:/* @__PURE__ */X("div",{className:"space-y-4",children:[
649
+ /* @__PURE__ */J(je,{label:"Card number",required:!0,children:/* @__PURE__ */J(oe,{placeholder:"1234 5678 9012 3456"})}),
650
+ /* @__PURE__ */X("div",{className:"grid grid-cols-2 gap-4",children:[
651
+ /* @__PURE__ */J(je,{label:"Expiry",required:!0,children:/* @__PURE__ */J(oe,{placeholder:"MM / YY"})}),
652
+ /* @__PURE__ */J(je,{label:"CVC",required:!0,children:/* @__PURE__ */J(oe,{placeholder:"123"})})]})]})})]}),
653
+ /* @__PURE__ */X("div",{className:"space-y-4",children:[
654
+ /* @__PURE__ */X(Lr,{header:"Order summary",children:[
655
+ /* @__PURE__ */J("ul",{className:"space-y-2 text-sm",children:ci.map(e=>/* @__PURE__ */X("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
656
+ /* @__PURE__ */X("span",{children:[e.name," ",
657
+ /* @__PURE__ */X("span",{className:"text-gray-400",children:["×",e.qty]})]}),
658
+ /* @__PURE__ */X("span",{children:["$",e.qty*e.price]})]},e.name))}),
659
+ /* @__PURE__ */X("div",{className:"mt-3 space-y-1.5 border-t border-gray-100 pt-3 text-sm text-gray-600",children:[
660
+ /* @__PURE__ */X("div",{className:"flex justify-between",children:[
661
+ /* @__PURE__ */J("span",{children:"Subtotal"}),
662
+ /* @__PURE__ */X("span",{children:["$",n]})]}),
663
+ /* @__PURE__ */X("div",{className:"flex justify-between",children:[
664
+ /* @__PURE__ */J("span",{children:"Shipping"}),
665
+ /* @__PURE__ */X("span",{children:["$",9]})]}),
666
+ /* @__PURE__ */X("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
667
+ /* @__PURE__ */J("span",{children:"Total"}),
668
+ /* @__PURE__ */X("span",{children:["$",l]})]})]}),
669
+ /* @__PURE__ */X(u,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
670
+ /* @__PURE__ */J(ga,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var ui=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],hi=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function mi(){const[e,r]=W(1),a=hi.find(t=>t.id===e)??hi[0];/* @__PURE__ */
671
+ return J("div",{className:"h-full",children:/* @__PURE__ */J(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */X("div",{className:"flex h-full flex-col p-2",children:[
672
+ /* @__PURE__ */J(u,{block:!0,className:"mb-2",children:"Compose"}),ui.map((e,t)=>/* @__PURE__ */X("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
673
+ /* @__PURE__ */J("span",{children:e.label}),null!=e.count&&/* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */X("div",{className:"flex h-full",children:[
674
+ /* @__PURE__ */J("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:hi.map(t=>/* @__PURE__ */X("button",{onClick:()=>r(t.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
675
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-2",children:[
676
+ /* @__PURE__ */J("span",{className:"truncate text-sm "+(t.unread?"font-semibold text-gray-900":"text-gray-700"),children:t.from}),
677
+ /* @__PURE__ */J("span",{className:"shrink-0 text-[11px] text-gray-400",children:t.time})]}),
678
+ /* @__PURE__ */J("div",{className:"truncate text-sm "+(t.unread?"text-gray-800":"text-gray-600"),children:t.subject}),
679
+ /* @__PURE__ */J("div",{className:"truncate text-xs text-gray-400",children:t.preview})]},t.id))}),
680
+ /* @__PURE__ */X("div",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:[
681
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
682
+ /* @__PURE__ */J("h2",{className:"truncate text-base font-semibold text-gray-900",children:a.subject}),
683
+ /* @__PURE__ */X("div",{className:"flex shrink-0 gap-1.5",children:[
684
+ /* @__PURE__ */J(u,{variant:"ghost",size:"sm",children:"Archive"}),
685
+ /* @__PURE__ */J(u,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
686
+ /* @__PURE__ */X("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
687
+ /* @__PURE__ */J(da,{name:a.from}),
688
+ /* @__PURE__ */X("div",{className:"min-w-0",children:[
689
+ /* @__PURE__ */J("div",{className:"text-sm font-medium text-gray-900",children:a.from}),
690
+ /* @__PURE__ */X("div",{className:"text-xs text-gray-400",children:["to me · ",a.time]})]})]}),
691
+ /* @__PURE__ */X("div",{className:"space-y-3 p-4 text-sm leading-relaxed text-gray-700",children:[
692
+ /* @__PURE__ */J("p",{children:"Hi,"}),
693
+ /* @__PURE__ */X("p",{children:[a.preview," The full details are attached — happy to walk through anything on a quick call."]}),
694
+ /* @__PURE__ */X("p",{children:["Best,",
695
+ /* @__PURE__ */J("br",{}),a.from]})]})]})]})})})}var pi=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],gi=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function fi(){const[e,r]=W(1),a=pi.find(t=>t.id===e)??pi[0];/* @__PURE__ */
696
+ return J("div",{className:"h-full",children:/* @__PURE__ */J(t,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */J("div",{className:"h-full overflow-auto",children:pi.map(t=>/* @__PURE__ */X("button",{onClick:()=>r(t.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
697
+ /* @__PURE__ */J(da,{name:t.name,status:t.status}),
698
+ /* @__PURE__ */X("div",{className:"min-w-0 flex-1",children:[
699
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-2",children:[
700
+ /* @__PURE__ */J("span",{className:"truncate text-sm font-medium text-gray-900",children:t.name}),
701
+ /* @__PURE__ */J("span",{className:"shrink-0 text-[11px] text-gray-400",children:t.time})]}),
702
+ /* @__PURE__ */J("div",{className:"truncate text-xs text-gray-500",children:t.last})]})]},t.id))}),children:/* @__PURE__ */X("div",{className:"flex h-full flex-col",children:[
703
+ /* @__PURE__ */X("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
704
+ /* @__PURE__ */J(da,{name:a.name,status:a.status,size:"sm"}),
705
+ /* @__PURE__ */X("div",{children:[
706
+ /* @__PURE__ */J("div",{className:"text-sm font-medium text-gray-900",children:a.name}),
707
+ /* @__PURE__ */J("div",{className:"text-xs text-gray-400 capitalize",children:a.status})]})]}),
708
+ /* @__PURE__ */J("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:gi.map((e,t)=>/* @__PURE__ */J("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */J("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
709
+ /* @__PURE__ */X("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
710
+ /* @__PURE__ */J("div",{className:"flex-1",children:/* @__PURE__ */J(oe,{placeholder:"Type a message…"})}),
711
+ /* @__PURE__ */J(u,{type:"submit",children:"Send"})]})]})})})}var xi={featured:"success",new:"active",draft:"draft"},bi=["linear-gradient(135deg,#60a5fa,#a78bfa)","linear-gradient(135deg,#34d399,#10b981)","linear-gradient(135deg,#fbbf24,#f59e0b)","linear-gradient(135deg,#f472b6,#ec4899)","linear-gradient(135deg,#38bdf8,#6366f1)","linear-gradient(135deg,#fb7185,#ef4444)","linear-gradient(135deg,#4ade80,#22c55e)","linear-gradient(135deg,#c084fc,#8b5cf6)"].map((e,t)=>({id:t,title:["Sunrise","Forest","Desert","Bloom","Ocean","Ember","Meadow","Dusk"][t],tag:["featured","new","draft"][t%3],bg:e}));function yi(){const[e,t]=W("all"),r="all"===e?bi:bi.filter(t=>t.tag===e);/* @__PURE__ */
712
+ return J(za,{groups:xi,children:/* @__PURE__ */J("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */X("div",{className:"mx-auto max-w-5xl space-y-4",children:[
713
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-4",children:[
714
+ /* @__PURE__ */J("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
715
+ /* @__PURE__ */J(u,{size:"sm",children:"Upload"})]}),
716
+ /* @__PURE__ */J(va,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
717
+ /* @__PURE__ */J("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */X(Lr,{padded:!1,className:"overflow-hidden",children:[
718
+ /* @__PURE__ */J("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */J("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */J(Pa,{status:e.tag})})}),
719
+ /* @__PURE__ */X("div",{className:"flex items-center justify-between gap-2 p-3",children:[
720
+ /* @__PURE__ */J("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
721
+ /* @__PURE__ */J("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var vi={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function wi({mode:e="login"}){const[t,r]=W(!0),a=vi[e];/* @__PURE__ */
722
+ return J("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */X("div",{className:"w-full max-w-sm",children:[
723
+ /* @__PURE__ */X("div",{className:"mb-6 text-center",children:[
724
+ /* @__PURE__ */J("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
725
+ /* @__PURE__ */J("h1",{className:"text-lg font-semibold text-gray-900",children:a.title}),
726
+ /* @__PURE__ */J("p",{className:"text-sm text-gray-500",children:a.subtitle})]}),
727
+ /* @__PURE__ */J(Lr,{children:/* @__PURE__ */X("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */J(je,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */J(oe,{id:"au-name",placeholder:"Alice Nguyen"})}),
728
+ /* @__PURE__ */J(je,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */J(oe,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */J(je,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */J(oe,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */X("div",{className:"flex items-center justify-between",children:[
729
+ /* @__PURE__ */J(Ce,{checked:t,onChange:r,label:"Remember me"}),
730
+ /* @__PURE__ */J("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
731
+ /* @__PURE__ */J(u,{type:"submit",block:!0,children:a.cta})]})}),
732
+ /* @__PURE__ */J("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */X(Q,"register"===e?{children:["Already have an account? ",
733
+ /* @__PURE__ */J("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
734
+ /* @__PURE__ */J("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var ki={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function Ni({code:e=404,actions:t}){const r=ki[e]($().errors);/* @__PURE__ */
735
+ return X("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
736
+ /* @__PURE__ */J("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
737
+ /* @__PURE__ */J("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
738
+ /* @__PURE__ */J("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */J("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function Mi({pick:e}){/* @__PURE__ */
739
+ return J(Q,{children:e($().errors)})}var $i=class extends K{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
740
+ /* @__PURE__ */X("div",{className:"flex h-full flex-col",children:[
741
+ /* @__PURE__ */J("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */J(Ni,{code:500,actions:/* @__PURE__ */X(Q,{children:[
742
+ /* @__PURE__ */J(u,{onClick:this.reset,children:/* @__PURE__ */J(Mi,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */X("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
743
+ /* @__PURE__ */J("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */J(Mi,{pick:e=>e.details})}),
744
+ /* @__PURE__ */J("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function Ci(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Li(e){const t=Ci();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Di(){return Ci()?.matches??!1}function ji(){return!1}function zi(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,a=parseInt(e.slice(5,7),16)/255,n=Math.max(t,r,a),l=Math.min(t,r,a);let i=0,s=0;const o=(n+l)/2;if(n!==l){const e=n-l;s=o>.5?e/(2-n-l):e/(n+l),i=n===t?((r-a)/e+(r<a?6:0))/6:n===r?((a-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function Pi(e,t,r){r/=100;const a=(t/=100)*Math.min(r,1-r),n=t=>{const n=(t+e/30)%12;return r-a*Math.max(Math.min(n-3,9-n,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(n(0))}${l(n(8))}${l(n(4))}`}function Si(e){const t=e||"system";return"system"===t?Di()?"dark":"light":t}function Ai(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,a,n]=zi(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Pi(r,a,Math.max(n-10,5))),t.style.setProperty("--accent-500",Pi(r,a,Math.min(n+10,95))),t.style.setProperty("--accent-400",Pi(r,a,Math.min(n+20,95))),t.style.setProperty("--accent-300",Pi(r,Math.min(a+10,100),Math.min(n+30,92))),t.style.setProperty("--accent-200",Pi(r,Math.min(a+15,100),Math.min(n+38,94))),t.style.setProperty("--accent-100",Pi(r,Math.min(a+20,100),Math.min(n+42,96))),t.style.setProperty("--accent-50",Pi(r,Math.min(a+20,100),Math.min(n+46,98)))}else t.removeAttribute("data-custom-accent"),["--accent-600","--accent-700","--accent-500","--accent-400","--accent-300","--accent-200","--accent-100","--accent-50"].forEach(e=>t.style.removeProperty(e))}function Fi(e,t,r,a,n){const l=document.documentElement;if(e){const e=e=>`${parseInt(e.slice(1,3),16)} ${parseInt(e.slice(3,5),16)} ${parseInt(e.slice(5,7),16)}`;if(t&&l.style.setProperty("--custom-bg-color",t),r&&(l.style.setProperty("--window-header-rgb",e(r)),l.style.setProperty("--window-footer-rgb",e(r))),a&&l.style.setProperty("--window-content-rgb",e(a)),n){l.style.setProperty("--custom-button-color",n);const[e,t,r]=zi(n);l.style.setProperty("--custom-button-hover",Pi(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Bi(e){document.documentElement.setAttribute("data-theme",Si(e.theme)),Ai(e.accent_color??null),Fi(e.accent_color??null,e.custom_bg_color??null,e.custom_title_color??null,e.custom_window_color??null,e.custom_button_color??null)}function Ti(){const{prefs:e}=i(),t=G(Li,Di,ji),r=e.theme||"system",a=e.accent_color||null,n=e.custom_bg_color||null,l=e.custom_title_color||null,s=e.custom_window_color||null,o=e.custom_button_color||null,c="system"===r?t?"dark":"light":r;return O(()=>(document.documentElement.setAttribute("data-theme",c),()=>document.documentElement.removeAttribute("data-theme")),[c]),O(()=>{Ai(a)},[a]),O(()=>{Fi(a,n,l,s,o)},[a,n,l,s,o]),{theme:r,resolved:c}}function Wi(e,t){O(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var Ei=8,Ii=["var(--viz-series-1)","var(--viz-series-2)","var(--viz-series-3)","var(--viz-series-4)","var(--viz-series-5)","var(--viz-series-6)","var(--viz-series-7)","var(--viz-series-8)"],Oi={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Ri={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Yi(e){return Ii[e]??Ri.muted}function _i(e,t,r){return t||(r?Oi[r]:Yi(e))}function Hi(e,t){const[r,a]=e,n=a-r,l=e=>0===n?t.from:t.from+(e-r)/n*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,a)=>r+n*a/(e-1)),l}function qi(e,t,r=0){const a=e>0?(t.to-t.from)/e:0,n=a*r,l=e=>t.from+e*a+n/2;return l.bandwidth=Math.max(0,a-n),l.center=e=>t.from+e*a+a/2,l.end=e=>t.from+(e+1)*a-n/2,l.count=e,l}function Ui(e,t){const r=[...e].sort((e,t)=>e-t),a=Math.max(0,r.length-1),n=e=>0===a?t.from:t.from+e/a*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return n(t);const l=r.findIndex(t=>t>=e);return n(-1===l?a:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Vi(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e)),r=e/t;return(r<=1?1:r<=2?2:r<=2.5?2.5:r<=5?5:10)*t}function Ki(e,t){const r=Math.max(e[0],e[1]),a=Math.min(e[0],e[1]),n=r>0?r:0,l=a>0?a:n>0?10**(Math.ceil(Math.log10(n))-3):0,i=Math.log10(l),s=n>0&&l>0?Math.log10(n)-i:0,o=e=>{if(s<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/s*(t.to-t.from)};return o.domain=[l,n],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(n)),a=[];for(let e=t;e<=r;e+=1)a.push(10**e);return 0===a.length?[l,n]:(Math.log10(a[0])-i>.15&&a.unshift(l),Math.log10(n)-Math.log10(a[a.length-1])>.15&&a.push(n),a)},o}function Gi(e,t=0){const r=e>0?2*Math.PI/e:0,a=e=>-Math.PI/2+e*r+t/2;return a.step=Math.max(0,r-t),a.center=e=>-Math.PI/2+e*r+r/2,a.count=e,a}function Zi(e,t){const[r,a]=e,n=Math.sqrt(Math.max(0,a))-Math.sqrt(Math.max(0,r));return e=>{if(0===n)return t.to;const a=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/n;return t.from+Math.min(1,Math.max(0,a))*(t.to-t.from)}}function Ji(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const a=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),n=e[e.length-1];for(const t of r){if(t<e[0]||t>n)continue;const r=t===n?a.length-1:a.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(a[r].count+=1)}return a}const a=t;if(0===r.length||a<1)return[];const n=Math.min(...r),l=(Math.max(...r)-n)/a||1,i=Array.from({length:a},(e,t)=>({from:n+t*l,to:n+(t+1)*l,count:0}));for(const e of r){i[Math.min(a-1,Math.floor((e-n)/l))].count+=1}return i}var Xi=e=>e.toFixed(2);function Qi(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Xi(e)},${Xi(t)}`).join(" ")}function es(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Xi(e.start)},${Xi(e.y)}`,t+=` L${Xi(e.end)},${Xi(e.y)}`}),t}function ts(e){if(e.length<3)return Qi(e);const t=e.length,r=[],a=[];for(let n=0;n<t-1;n+=1){const t=e[n+1][0]-e[n][0];r.push(t),a.push(0===t?0:(e[n+1][1]-e[n][1])/t)}const n=[a[0]];for(let e=1;e<t-1;e+=1)n.push(a[e-1]*a[e]<=0?0:(a[e-1]+a[e])/2);n.push(a[t-2]);for(let e=0;e<t-1;e+=1){if(0===a[e]){n[e]=0,n[e+1]=0;continue}const t=n[e]/a[e],r=n[e+1]/a[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);n[e]=i*t*a[e],n[e+1]=i*r*a[e]}}let l=`M${Xi(e[0][0])},${Xi(e[0][1])}`;for(let a=0;a<t-1;a+=1){const t=r[a]/3;l+=` C${Xi(e[a][0]+t)},${Xi(e[a][1]+n[a]*t)} ${Xi(e[a+1][0]-t)},${Xi(e[a+1][1]-n[a+1]*t)} ${Xi(e[a+1][0])},${Xi(e[a+1][1])}`}return l}function rs(e,t=0){if(e.length<3)return Qi(e);const r=e.map(e=>e[1]),a=Math.min(...r),n=Math.max(...r),l=e=>Math.min(n,Math.max(a,e)),i=(1-t)/6;let s=`M${Xi(e[0][0])},${Xi(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],a=e[t],n=e[t+1],o=e[t+2]??n,c=a[0]+(n[0]-r[0])*i,d=l(a[1]+(n[1]-r[1])*i),u=n[0]-(o[0]-a[0])*i,h=l(n[1]-(o[1]-a[1])*i);s+=` C${Xi(c)},${Xi(d)} ${Xi(u)},${Xi(h)} ${Xi(n[0])},${Xi(n[1])}`}return s}function as(e){if(e.length<2)return Qi(e);let t=`M${Xi(e[0][0])},${Xi(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[a,n]=e[r-1],[l,i]=e[r],s=(a+l)/2;t+=` C${Xi(s)},${Xi(n)} ${Xi(s)},${Xi(i)} ${Xi(l)},${Xi(i)}`}return t}function ns(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Xi(e[0][0])},${Xi(e[0][1])}`:"monotone"===t?ts(e):"spline"===t?rs(e,r):"bump"===t?as(e):Qi(e)}function ls(e,t,r){if(0===t.length)return"";const a=t[0],n=t[t.length-1];return`${e} L${Xi(n[0])},${Xi(r)} L${Xi(a[0])},${Xi(r)} Z`}function is(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Xi(e)},${Xi(t)}`).join(" L")} Z`}function ss(e,t,r,a,n=-Math.PI/2){return Array.from({length:a},(l,i)=>{const s=n+2*i*Math.PI/a;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function os(e,t,r,a,n,l){const i=l-n;if(Math.abs(i)>=2*Math.PI){const l=n+Math.PI;return`${os(e,t,r,a,n,l)} ${os(e,t,r,a,l,n+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,a)=>[e+r*Math.cos(a),t+r*Math.sin(a)],[c,d]=o(a,n),[u,h]=o(a,l);if(r<=0)return`M${Xi(e)},${Xi(t)} L${Xi(c)},${Xi(d)} A${Xi(a)},${Xi(a)} 0 ${s} 1 ${Xi(u)},${Xi(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,n);return`M${Xi(c)},${Xi(d)} A${Xi(a)},${Xi(a)} 0 ${s} 1 ${Xi(u)},${Xi(h)} L${Xi(m)},${Xi(p)} A${Xi(r)},${Xi(r)} 0 ${s} 0 ${Xi(g)},${Xi(f)} Z`}function cs(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const a=Math.max(...e),n=Math.min(...e),l=t*t,i=r*r;return Math.max(i*a/l,l/(i*n))}function ds(e,t,r,a){const n=a?r.height:r.width,l=n>0?t/n:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*n:0,o=a?{...e,x:r.x,y:r.y+i,width:l,height:s}:{...e,x:r.x+i,y:r.y,width:s,height:l};return i+=s,o}),rest:a?{x:r.x+l,y:r.y,width:r.width-l,height:r.height}:{x:r.x,y:r.y+l,width:r.width,height:r.height-l}}}function us(e,t,r){const a=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===a.length||t<=0||r<=0)return[];const n=a.reduce((e,t)=>e+t.value,0),l=t*r,i=[];let s={x:0,y:0,width:t,height:r},o=[],c=0,d=[...a.map(e=>({...e,value:e.value/n*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,a=cs(o.map(e=>e.value),c,t),n=cs([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||n<=a)o.push(e),c+=e.value,d=d.slice(1);else{const e=ds(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...ds(o,c,s,s.width>=s.height).tiles);const u=new Map(e.map(e=>[e.key,e.value]));return i.map(e=>({...e,value:u.get(e.key)??e.value}))}var hs=R({highlighted:null,setHighlighted:()=>{}});function ms({children:e}){const[t,r]=W(null),a=Y(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
745
+ return J(hs.Provider,{value:a,children:e})}function ps(){return U(hs)}function gs(e,t,r=.22){return null===t?null:t===e?1:r}function fs(e,t="none"){if("none"===t||0===e.length)return null;if("last"===t){for(let t=e.length-1;t>=0;t-=1)if("number"==typeof e[t]&&Number.isFinite(e[t]))return t;return null}let r=null;return e.forEach((a,n)=>{if("number"!=typeof a||!Number.isFinite(a))return;if(null===r)return void(r=n);const l=e[r];("max"===t?a>l:a<l)&&(r=n)}),r}function xs(e,t=720){const[r,a]=W(t);return O(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&a(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function bs({rows:e,max:t,formatValue:r,emphasisKey:a,highlight:n="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=$().charts,h=M(),m=r??(e=>D(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
746
+ return J("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=fs(e.map(e=>e.value),n),f=a??(null===g?void 0:e[g]?.key),x=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),b=Yi(0);/* @__PURE__ */
747
+ return J("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,s-i)}px`},children:e.map((e,t)=>{const r=e.key===f,a=r?l?Oi[l]:Yi(1):f?Ri.muted:b,n=Number.isFinite(e.value)?e.value:null,s=null!==n&&x>0?Math.max(0,Math.min(1,n/x)):0;/* @__PURE__ */
748
+ return X("li",{className:"grid gap-1",children:[
749
+ /* @__PURE__ */X("div",{className:"flex items-baseline justify-between gap-3",children:[
750
+ /* @__PURE__ */X("span",{className:"truncate font-mono text-xs text-gray-600 "+(r?"font-semibold":""),title:e.label,children:[e.label,r&&/* @__PURE__ */J("span",{className:"sr-only",children:` ${u.emphasised}`})]}),
751
+ /* @__PURE__ */J("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:a}:void 0,children:null===n?"—":m(n)})]}),
752
+ /* @__PURE__ */J("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */J("div",{className:`rounded-sm ${o?cn.grow:""}`,style:{width:`${(100*s).toFixed(2)}%`,height:i,backgroundColor:a,minWidth:s>0?2:0,...o?dn(t):{}}})})]},e.key)})})}var ys=e=>Math.max(0,Math.min(1,e));function vs({value:e,segments:t,objective:r,label:a,detail:n,formatValue:l,tone:i,className:s,unavailableLabel:o}){const c=$().charts,d=M(),u=l??(e=>z(100*e,1,d)),h=o??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
753
+ return X("div",{className:s,children:[a&&/* @__PURE__ */J("p",{className:"text-sm font-medium text-gray-700",children:a}),
754
+ /* @__PURE__ */J("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=ys(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Oi[g],x=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",n??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
755
+ return X("div",{className:s,children:[
756
+ /* @__PURE__ */X("div",{className:"mb-1.5 flex items-baseline justify-between gap-3",children:[
757
+ /* @__PURE__ */J("span",{className:"text-sm font-medium text-gray-700",children:a}),
758
+ /* @__PURE__ */J("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
759
+ /* @__PURE__ */X("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*m).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":u(e),"aria-label":a,children:[
760
+ /* @__PURE__ */J("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */J("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*ys(e.value)).toFixed(2)}%`,backgroundColor:Oi[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */J("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*ys(r)).toFixed(2)}%`,height:20,backgroundColor:Ri.axis},"aria-hidden":"true"})]}),x&&/* @__PURE__ */J("p",{className:"mt-1.5 text-xs text-gray-500",children:x})]})}var ws={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function ks({label:e,value:t,unit:r,delta:a,deltaTone:n,trend:l,trendTone:i,footnote:s,className:o}){const c=$().charts,d=M(),u=null==a?null:a>0?"up":a<0?"down":"flat",h=n?Oi[n]:void 0,m=i?Oi[i]:_i(0);/* @__PURE__ */
761
+ return X("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${o??""}`,children:[
762
+ /* @__PURE__ */J("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
763
+ /* @__PURE__ */X("span",{className:"flex items-baseline gap-1.5",children:[
764
+ /* @__PURE__ */J("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */J("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */X("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
765
+ /* @__PURE__ */J("span",{"aria-hidden":"true",children:ws[u].glyph})," ",D(Math.abs(a),d),
766
+ /* @__PURE__ */X("span",{className:"sr-only",children:[" ",c[ws[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */J(Ul,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),s&&/* @__PURE__ */J("span",{className:"mt-1 text-xs text-gray-500",children:s})]})}function Ns({height:e=220,width:t=720,variant:r="area",bars:a=9,label:n,className:l}){const i=$().charts,s=n??i.loading,o=`${I()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
767
+ return J("div",{className:l,children:/* @__PURE__ */X("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":s,"aria-busy":"true",children:[
768
+ /* @__PURE__ */J("defs",{children:/* @__PURE__ */X("linearGradient",{id:o,x1:"0",y1:"0",x2:"1",y2:"0",children:[
769
+ /* @__PURE__ */J("stop",{offset:"0%",stopColor:Ri.surface,stopOpacity:"0"}),
770
+ /* @__PURE__ */J("stop",{offset:"45%",stopColor:Ri.surface,stopOpacity:"0.55"}),
771
+ /* @__PURE__ */J("stop",{offset:"55%",stopColor:Ri.surface,stopOpacity:"0.55"}),
772
+ /* @__PURE__ */J("stop",{offset:"100%",stopColor:Ri.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
773
+ return J("line",{x1:c,y1:r,x2:d,y2:r,stroke:Ri.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */J("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:Ri.grid},`t${t}`)),"bars"===r?Array.from({length:a},(e,t)=>{const r=(d-c)/a,n=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*n;/* @__PURE__ */
774
+ return J("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:Ri.grid},t)}):/* @__PURE__ */J("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:Ri.grid}),
775
+ /* @__PURE__ */J("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${o})`})]})})}function Ms({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
776
+ return J("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
777
+ return J("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
778
+ return J("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
779
+ return J("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
780
+ return J("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
781
+ return J("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
782
+ return J("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function $s({entries:e,interactive:t,fallbackSwatch:r}){const{highlighted:a,setHighlighted:n}=ps();/* @__PURE__ */
783
+ return J("ul",{className:"m-0 flex flex-wrap items-center gap-x-4 gap-y-1 p-0",children:e.map((e,l)=>{const i=t&&null!==a&&a!==e.key,s=/* @__PURE__ */X(Q,{children:[
784
+ /* @__PURE__ */J(Ms,{shape:e.swatch??r,colour:_i(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
785
+ return J("li",{className:"list-none",children:t?/* @__PURE__ */J("button",{type:"button",onMouseEnter:()=>n(e.key),onMouseLeave:()=>n(null),onFocus:()=>n(e.key),onBlur:()=>n(null),className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(i?"opacity-40":""),children:s}):/* @__PURE__ */J("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function Cs({title:e,subtitle:t,legend:r,table:a,tableLabel:n,busy:l=!1,loading:i=!1,skeletonVariant:s="area",skeletonHeight:o,interactiveLegend:c=!0,legendSwatch:d="rounded-square",actions:u,children:h,className:m}){const p=$().charts;/* @__PURE__ */
786
+ return J(ms,{children:/* @__PURE__ */X("section",{className:`flex min-w-0 flex-col gap-3 rounded-lg border border-gray-200 bg-white p-5 ${m??""}`,"aria-busy":l||i||void 0,children:[
787
+ /* @__PURE__ */X("header",{className:"flex items-start justify-between gap-4",children:[
788
+ /* @__PURE__ */X("div",{className:"min-w-0",children:[
789
+ /* @__PURE__ */J("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */J("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */J("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */J(Ns,{variant:s,height:o}):/* @__PURE__ */J("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */J($s,{entries:r,interactive:c,fallbackSwatch:d}),!i&&a&&/* @__PURE__ */X("details",{className:"border-t border-gray-100 pt-3",children:[
790
+ /* @__PURE__ */J("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:n??p.showTable}),
791
+ /* @__PURE__ */J("div",{className:"mt-3 overflow-x-auto",style:{color:Ri.label},children:a})]})]})})}function Ls({variant:e="solid",title:t,rows:r,footnote:a,emphasisKey:n,className:l}){const i="glass"===e;/* @__PURE__ */
792
+ return X("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white shadow-xl ring-1 ring-black/5"} ${l??""}`,style:i?k():void 0,children:[t&&/* @__PURE__ */J("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
793
+ /* @__PURE__ */J("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(e=>/* @__PURE__ */X("li",{className:"flex items-center gap-2.5",style:n&&e.key!==n?{opacity:.45}:void 0,children:[
794
+ /* @__PURE__ */J("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??Ri.muted}}),
795
+ /* @__PURE__ */J("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
796
+ /* @__PURE__ */J("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),a&&/* @__PURE__ */J("p",{className:"mt-2 text-[11px] text-gray-500",children:a})]})}function Ds({cx:e,cy:t,color:r,variant:a="default",pulse:n=!1,title:l}){const i="border"===a?3:"colored-border"===a?1.5:0,s="border"===a?3:3.5;/* @__PURE__ */
797
+ return X("g",{children:[n&&/* @__PURE__ */J("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:s,fill:r,fillOpacity:.45}),"border"===a&&/* @__PURE__ */J("circle",{cx:e,cy:t,r:s+i,fill:Ri.surface}),
798
+ /* @__PURE__ */J("circle",{cx:e,cy:t,r:s,fill:"colored-border"===a?Ri.surface:r,stroke:"colored-border"===a?r:void 0,strokeWidth:"colored-border"===a?i:void 0,children:l&&/* @__PURE__ */J("title",{children:l})})]})}function js({labels:e,data:t,range:r,onRangeChange:a,height:n=46,width:l=720,color:i,className:s}){const o=$().charts,c=E(null),d=e.length-1,[u,h]=r,m=i??_i(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),x=Math.max(...f,1),b=e=>n-e/x*(n-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const a=y[y.length-1];a&&a.to===r-1?a.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let a=e.from;a<=e.to;a+=1)r.push(`${a===e.from?"M":"L"}${p(a).toFixed(2)},${b(t[a]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${n} L${p(e.from).toFixed(2)},${n} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));a("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},k=e=>t=>{const r=t.shiftKey?5:1,a="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,a-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,a+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},N=E(null),M=e=>t=>{N.current=e,t.currentTarget.setPointerCapture(t.pointerId)},C=e=>t=>{N.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},L=e=>()=>{N.current===e&&(N.current=null)},D=t=>{const r="from"===t?u:h;/* @__PURE__ */
799
+ return J("rect",{x:p(r)-4.5,y:0,width:9,height:n,rx:3,fill:m,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?o.windowStart:o.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:k(t),onPointerDown:M(t),onPointerMove:C(t),onPointerUp:L(t),onPointerCancel:L(t)},t)};/* @__PURE__ */
800
+ return J("div",{className:s,children:/* @__PURE__ */X("svg",{ref:c,width:"100%",height:n,viewBox:`0 0 ${l} ${n}`,role:"group","aria-label":o.window(e[u],e[h],e.length),children:[
801
+ /* @__PURE__ */J("path",{d:v,fill:Ri.grid}),
802
+ /* @__PURE__ */J("rect",{x:0,y:0,width:p(u),height:n,fill:Ri.surface,fillOpacity:.72}),
803
+ /* @__PURE__ */J("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:n,fill:Ri.surface,fillOpacity:.72}),
804
+ /* @__PURE__ */J("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:n,fill:"none",stroke:m,strokeWidth:1}),D("from"),D("to")]})})}function zs({labels:e,values:t,height:r=220,width:a,bandPadding:n=.24,min:l,max:i,yTickCount:s=4,formatValue:o,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const x=$().charts,b=M(),y=o??(e=>D(e,b)),v=g??x.noData,w=E(null),k=xs(w),N=a??k,[C,L]=W(null),j=I();if(O(()=>{if(null!==C)return f(e=>"Escape"===e.key&&(L(null),!0))},[C]),0===e.length)/* @__PURE__ */
805
+ return J("div",{className:p,ref:w,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:v})});const z={top:12,right:16,bottom:26,left:c?58:48},P=z.left,S=Math.max(P+1,N-z.right),A=z.top,F=r-z.bottom,B=t.filter(Number.isFinite),T=l??Math.min(0,...B),R=Hi([T,i??Vi(Math.max(...B,0))],{from:F,to:A}),Y=qi(e.length,{from:P,to:S},n),_=R.ticks(s+1),H=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(N/84))));/* @__PURE__ */
806
+ return X("div",{className:`relative ${p??""}`,ref:w,children:[
807
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${N} ${r}`,role:"img","aria-label":m,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>L(null),onBlur:()=>L(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;L(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
808
+ /* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:j,children:/* @__PURE__ */J("rect",{x:P,y:A,width:S-P,height:F-A})})}),_.map(e=>/* @__PURE__ */J("line",{x1:P,y1:R(e),x2:S,y2:R(e),stroke:Ri.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
809
+ /* @__PURE__ */J("line",{x1:P,y1:R(Math.max(T,0)),x2:S,y2:R(Math.max(T,0)),stroke:Ri.axis,strokeWidth:1,shapeRendering:"crispEdges"}),_.map(e=>/* @__PURE__ */J("text",{x:P-8,y:R(e)+4,textAnchor:"end",fontSize:11,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:y(e)},`t${e}`)),c&&/* @__PURE__ */J("text",{x:14,y:(A+F)/2,transform:`rotate(-90 14 ${(A+F)/2})`,textAnchor:"middle",fontSize:11,fill:Ri.label,children:c}),
810
+ /* @__PURE__ */J("g",{clipPath:`url(#${j})`,children:u({x:Y,y:R,left:P,right:S,top:A,bottom:F,width:N,height:r,clipId:j,active:C})}),e.map((e,t)=>t%H===0?/* @__PURE__ */J("text",{x:"start"===d?Y(t):Y.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */J("rect",{x:Y.center(r)-(S-P)/e.length/2,y:A,width:(S-P)/e.length,height:F-A,fill:"transparent",onMouseEnter:()=>L(r)},`h${r}`))]}),h&&null!==C&&
811
+ /* @__PURE__ */J("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(Y.center(C)/N*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:h(C)})]})}var Ps=12,Ss=16,As=26,Fs=52,Bs=e=>"number"==typeof e&&Number.isFinite(e);function Ts({series:e,labels:t,height:r=200,stacked:a=!1,stackMode:n="value",levels:l,curve:i="linear",tension:s=0,max:o,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:x=!1,brush:b=!1,range:y,onRangeChange:v,loading:w=!1,animate:k=!0,reveal:N="left-to-right",fillVariant:C="gradient",gridStyle:L="solid",width:j,className:P,emptyLabel:S}){const A=$().charts,F=M(),B=d??(e=>D(e,F)),T=S??A.noData,R=E(null),Y=xs(R),_=j??Y,[H,q]=W(null),[U,V]=W(null),{highlighted:K}=ps(),G=I();if(O(()=>{if(null!==H)return f(e=>"Escape"===e.key&&(q(null),!0))},[H]),w)/* @__PURE__ */
812
+ return J("div",{className:P,ref:R,children:/* @__PURE__ */J(Ns,{height:r,width:j??Y})});const Z=t,Q=y??U??[0,Math.max(0,Z.length-1)],[ee,te]=Q,re=e=>b?e.slice(ee,te+1):e,ae=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Bs)).map(e=>({...e,data:re(e.data)}));if(t=re(Z),0===ae.length||0===t.length)/* @__PURE__ */
813
+ return J("div",{className:P,ref:R,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:T})});const ne={left:Fs,right:Math.max(Fs+1,_-Ss),top:Ps,bottom:r-As},le=qi(t.length,{from:ne.left,to:ne.right}),ie=t.map((e,t)=>ae.reduce((e,r)=>e+(Bs(r.data[t])?r.data[t]:0),0)),se=(e,t)=>ie[t]>0?e/ie[t]:null,oe=[];if(a){let e=t.map(()=>0);for(const t of ae)e=e.map((e,r)=>e+(Bs(t.data[r])?t.data[r]:0)),oe.push("percent"===n?e.map((e,t)=>se(e,t)):[...e])}const ce=l&&l.length>0?Ui(l,{from:ne.bottom,to:ne.top}):null,de=a?(oe.at(-1)??[]).filter(Bs):ae.flatMap(e=>e.data.filter(Bs)),ue=Hi([0,a&&"percent"===n?1:o??Vi(Math.max(...de,0))],{from:ne.bottom,to:ne.top}),he=e=>ce?ce(e):ue(e),me=a&&"percent"===n?e=>z(Math.round(100*e),0,F):B,pe=ce?ce.levels.map(e=>({value:e,y:ce(e)})):ue.ticks(c+1).map(e=>({value:e,y:ue(e)})),ge=e=>r=>{r.preventDefault(),q(r=>{const a=(r??0)+e;return Math.min(t.length-1,Math.max(0,a))})},fe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(_/96))));/* @__PURE__ */
814
+ return X("div",{className:`relative ${P??""}`,ref:R,children:[
815
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${_} ${r}`,role:"img","aria-label":A.overIntervals(ae.map(e=>e.label),t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>q(null),onBlur:()=>q(null),onKeyDown:e=>{"ArrowRight"===e.key&&ge(1)(e),"ArrowLeft"===e.key&&ge(-1)(e)},children:[
816
+ /* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:G,children:/* @__PURE__ */J("rect",{x:ne.left,y:ne.top,width:ne.right-ne.left,height:ne.bottom-ne.top})})}),
817
+ /* @__PURE__ */J(sn,{id:G,fills:ae.map((e,t)=>({color:_i(e.slot,e.color,e.tone),variant:e.fillVariant??C})),fadeFrom:a?.42:.3,reveal:!!k&&N}),pe.map(e=>/* @__PURE__ */J("line",{x1:ne.left,y1:e.y,x2:ne.right,y2:e.y,stroke:Ri.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===L?"3 3":void 0},`grid-${e.value}`)),
818
+ /* @__PURE__ */J("line",{x1:ne.left,y1:ne.bottom,x2:ne.right,y2:ne.bottom,stroke:Ri.axis,strokeWidth:1,shapeRendering:"crispEdges"}),pe.map(e=>/* @__PURE__ */J("text",{x:ne.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:me(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */J("text",{x:12,y:(ne.top+ne.bottom)/2,transform:`rotate(-90 12 ${(ne.top+ne.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Ri.label,children:u}),
819
+ /* @__PURE__ */J("g",{clipPath:`url(#${G})`,mask:k&&N?`url(#${en(G)})`:void 0,children:ae.map((e,r)=>{const n=_i(e.slot,e.color,e.tone),l=e.mode??(a?"area":"line"),o=gs(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:le(r),end:le.end(r),value:e.data[r]})).filter(e=>Bs(e.value)).map(e=>({start:e.start,end:e.end,y:he(e.value)}));/* @__PURE__ */
820
+ return J("path",{d:es(r),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:o??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,n)=>{const l=a?oe[r]?.[n]:e.data[n];return Bs(l)?[le.center(n),he(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*le.bandwidth);/* @__PURE__ */
821
+ return J("g",{opacity:o??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const s=a?oe[r]?.[i]:e.data[i];if(!Bs(s))return null;const o=he(s);/* @__PURE__ */
822
+ return J("rect",{x:le.center(i)-l/2,y:o,width:l,height:Math.max(0,ne.bottom-o),rx:2,fill:n,fillOpacity:.35,className:k?cn.rise:void 0,style:k?dn(i,26):void 0},i)})},e.key)}const d=ns(c,i,s),u=a&&r>0?t.map((e,t)=>[le.center(t),he(oe[r-1]?.[t]??0)-2]):null,h=u?is(d,u):ls(d,c,ne.bottom);/* @__PURE__ */
823
+ return X("g",{opacity:o??void 0,className:"rosh-viz-mark",children:[("area"===l||a)&&
824
+ /* @__PURE__ */J("path",{d:h,fill:rn(G,r,e.fillVariant??C,n),stroke:"none"}),
825
+ /* @__PURE__ */J("path",{d:d,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:an(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?cn.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??Oi[e.tone??"critical"],a=he(e.value);/* @__PURE__ */
826
+ return X("g",{children:[
827
+ /* @__PURE__ */J("line",{x1:ne.left,y1:a,x2:ne.right,y2:a,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */J("text",{x:ne.right-4,y:a-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&ae.map((e,r)=>{const n=p??(m?"last":"none"),l=_i(e.slot,e.color,e.tone),i=[...e.data].map(Bs).lastIndexOf(!0),s="all"===n?t.map((e,t)=>t).filter(t=>Bs(a?oe[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
828
+ return X("g",{children:[s.map(n=>{const s=a?oe[r]?.[n]:e.data[n];return Bs(s)?/* @__PURE__ */J(Ds,{cx:le.center(n),cy:he(s),color:l,variant:g,pulse:x&&n===i,title:`${t[n]}: ${e.label} ${B(s)}`},n):null}),m&&i>=0&&Bs(a?oe[r]?.[i]:e.data[i])&&/* @__PURE__ */J("text",{x:le.center(i)-10,y:he(a?oe[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:B(a?oe[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */J("text",{x:le.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==H&&/* @__PURE__ */J("line",{x1:le.center(H),y1:ne.top,x2:le.center(H),y2:ne.bottom,stroke:Ri.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */J("rect",{x:le(t),y:ne.top,width:Math.max(1,le.bandwidth),height:ne.bottom-ne.top,fill:"transparent",onMouseEnter:()=>q(t)},`hit-${t}`))]}),b&&Z.length>2&&/* @__PURE__ */J(js,{className:"mt-1",labels:Z,width:_,data:e[0]?.data??[],range:Q,onRangeChange:e=>{v?v(e):V(e)}}),null!==H&&
829
+ /* @__PURE__ */J("div",{className:"absolute top-2 z-10",style:{left:`clamp(0px, calc(${(le.center(H)/_*100).toFixed(2)}% - 88px), calc(100% - 184px))`},children:/* @__PURE__ */J(Ls,{title:t[H],rows:ae.map((e,t)=>({key:e.key,label:e.label,color:_i(e.slot,e.color,e.tone),value:Bs(e.data[H])?a&&"percent"===n?`${z(100*(se(e.data[H],H)??0),1,F)} · ${B(e.data[H])}`:B(e.data[H]):void 0})),footnote:a&&"percent"===n?A.inBucket(B(ie[H])):void 0})})]})}function Ws({series:e,labels:t,stacked:r=!1,stackMode:a="value",height:n=220,width:l,max:i,formatValue:s,yAxisLabel:o,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:x="none"}){const b=I(),{highlighted:y}=ps(),v=$().charts,w=M(),k=s??(e=>D(e,w));if(h)/* @__PURE__ */return J(Ns,{height:n,width:l,variant:"bars",className:c});const N=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),C=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},L=t.map((e,t)=>N.reduce((e,r)=>e+C(r,t),0)),j=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,C(r,t)),0)),P=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,C(r,t)),0)),S=r&&"percent"===a,A=(e,t)=>L[t]>0?e/L[t]:null,F=S?[1]:r?[...j,...P]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
830
+ return J(zs,{labels:t,values:F,height:n,width:l,max:S?1:i,formatValue:S?e=>z(Math.round(100*e),0,w):k,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(N.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */J(Ls,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:_i(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?S?`${z(100*(A(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:S?v.inCategory(k(L[e])):void 0}),children:({x:e,y:a,bottom:n,active:l})=>{const i=f?t.indexOf(f):-1,s=fs(r?L:N[0]?.data??[],x),o=l??(i>=0?i:s);/* @__PURE__ */
831
+ return X("g",{children:[
832
+ /* @__PURE__ */J(sn,{id:b,glow:p}),t.map((t,n)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,s=0;const c=a(Math.min(a.domain[1],Math.max(a.domain[0],0)));return N.map((t,d)=>{const h=t.data[n];if(!Number.isFinite(h))return null;const f=S?A(h,n):h;if(null===f)return null;const x=_i(t.slot,t.color,t.tone),v=r?e(n):e(n)+d*l;let w,k,M=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=a(Math.max(e,t)),k=a(Math.min(e,t)),M=0===e}else w=Math.min(a(f),c),k=Math.max(a(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===o||o===n,L=C?x:g?Ri.muted:x,D=gs(t.key,y);/* @__PURE__ */
833
+ return J("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:D??(C?1:g?.32:.45),filter:p&&o===n?`url(#${Qa(b)})`:void 0,className:"rosh-viz-mark"+(m?` ${cn.rise}`:""),style:m?dn(n*(r?1:N.length)+d,26):void 0},`${t.key}-${n}`)})}),null!==l&&!g&&/* @__PURE__ */J("line",{x1:e.center(l),y1:a(a.domain[1]),x2:e.center(l),y2:n,stroke:Ri.axis,strokeWidth:1})]})}})}var Es=3;function Is({series:e,height:t=260,width:r,xLabel:a,yLabel:n,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=$().charts,g=M(),x=l??(e=>D(e,g)),b=i??(e=>D(e,g)),y=m??p.noObservations,v=E(null),w=xs(v),k=r??w,N=I(),[C,L]=W(null);O(()=>{if(null!==C)return f(e=>"Escape"===e.key&&(L(null),!0))},[C]);const j=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),z=e.filter(e=>e.points.length>0).slice(0,3),P=s||o?z.map(e=>({...e,points:e.points.filter(e=>j(e.x,s)&&j(e.y,o))})).filter(e=>e.points.length>0):z,S=z.reduce((e,t)=>e+t.points.length,0)-P.reduce((e,t)=>e+t.points.length,0);if(0===P.length)/* @__PURE__ */
834
+ return J("div",{className:h,ref:v,children:/* @__PURE__ */J("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:y})});const A=P.flatMap(e=>e.points),F=A.some(e=>null!=e.size),B=14,T=20,R=34,Y=52,_=Math.max(Y+1,k-T),H=(e,t,r,a)=>{const n=e.filter(e=>e>0),l="log"===r?n.length>0?Math.min(...n):0:Math.min(0,...e),i=t??[l,Vi(Math.max(...e))];return"log"===r?Ki(i,a):Hi(i,a)},q=H(A.map(e=>e.x),s,c,{from:Y,to:_}),U=H(A.map(e=>e.y),o,d,{from:t-R,to:B}),V=Zi([0,Math.max(...A.map(e=>e.size??1))],{from:u[0],to:u[1]}),K=C?P[C.s]:void 0,G=C&&K?K.points[C.i]:void 0,Z=P.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
835
+ return X("div",{className:`relative ${h??""}`,ref:v,children:[
836
+ /* @__PURE__ */X("svg",{width:"100%",height:t,viewBox:`0 0 ${k} ${t}`,role:"img","aria-label":p.scatter(P.map(e=>e.label),n??p.yAxis,a??p.xAxis)+(S>0?`. ${p.outsideRange(S)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>L(null),onBlur:()=>L(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=C?Z.findIndex(e=>e.s===C.s&&e.i===C.i):0;L(Z[Math.min(Z.length-1,Math.max(0,r+t))])},children:[
837
+ /* @__PURE__ */J("defs",{children:/* @__PURE__ */J("clipPath",{id:N,children:/* @__PURE__ */J("rect",{x:Y-u[1],y:B-u[1],width:_-Y+2*u[1],height:t-R-B+2*u[1]})})}),U.ticks(5).map(e=>/* @__PURE__ */X("g",{children:[
838
+ /* @__PURE__ */J("line",{x1:Y,y1:U(e),x2:_,y2:U(e),stroke:Ri.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
839
+ /* @__PURE__ */J("text",{x:Y-8,y:U(e)+4,textAnchor:"end",fontSize:11,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),q.ticks(5).map(e=>/* @__PURE__ */J("text",{x:q(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`x${e}`)),a&&/* @__PURE__ */J("text",{x:(Y+_)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Ri.label,children:a}),n&&/* @__PURE__ */J("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Ri.label,children:n}),
840
+ /* @__PURE__ */J("g",{clipPath:`url(#${N})`,children:P.map((e,t)=>{const r=_i(t,e.color,e.tone);return e.points.map((a,n)=>/* @__PURE__ */J("circle",{cx:q(a.x),cy:U(a.y),r:F?V(a.size??0):u[0]+1,fill:r,fillOpacity:C&&C.s!==t?.25:.62,stroke:Ri.surface,strokeWidth:2,onMouseEnter:()=>L({s:t,i:n})},`${e.key}-${n}`))})})]}),C&&K&&G&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:G.label??K.label,rows:[{key:"x",label:a??p.xAxis,color:_i(C.s,K.color,K.tone),value:x(G.x)},{key:"y",label:n??p.yAxis,color:_i(C.s,K.color,K.tone),value:b(G.y)},...null!=G.size?[{key:"size",label:p.size,color:Ri.muted,value:D(G.size,g)}]:[]],footnote:G.label?K.label:void 0})})]})}function Os({rows:e,labels:t,variant:r="area",curve:a="linear",height:n=220,width:l,max:i,min:s,formatValue:o,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=$().charts,x=M(),b=o??(e=>D(e,x)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=_i(0,d,u);/* @__PURE__ */
841
+ return J(zs,{labels:t,values:v,height:n,width:l,max:i,min:s,formatValue:b,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */J(Ls,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:b(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:b(e[r].low)}]}),children:({x:t,y:n,active:l})=>"bar"===r?/* @__PURE__ */J("g",{children:e.map((e,r)=>/* @__PURE__ */J("rect",{x:t(r),y:n(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,n(e.low)-n(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */X("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),n(e.high)]),l=e.map((e,r)=>[t.center(r),n(e.low)]);/* @__PURE__ */
842
+ return X(Q,{children:[
843
+ /* @__PURE__ */J("path",{d:is(ns(r,a),l),fill:w,fillOpacity:.2,stroke:"none"}),
844
+ /* @__PURE__ */J("path",{d:ns(r,a),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
845
+ /* @__PURE__ */J("path",{d:ns(l,a),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */J("line",{x1:t.center(l),y1:n(e[l].high),x2:t.center(l),y2:n(e[l].low),stroke:Ri.axis,strokeWidth:1})]})})}function Rs({steps:e,height:t=240,width:r,formatValue:a,yAxisLabel:n,className:l,emptyLabel:i,radius:s=3,connectors:o=!0}){const c=$().charts,d=M(),u=a??(e=>D(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
846
+ return J(zs,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:n,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?Oi.neutral:t.value>=0?Oi.good:Oi.critical;/* @__PURE__ */
847
+ return J(Ls,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:Oi.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */X("g",{children:[o&&m.slice(0,-1).map((r,a)=>
848
+ /* @__PURE__ */J("line",{x1:e.end(a),y1:t(r.to),x2:e(a+1),y2:t(r.to),stroke:Ri.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${a}`)),m.map((a,n)=>{const l=a.total?Oi.neutral:a.value>=0?Oi.good:Oi.critical,i=Math.min(t(a.from),t(a.to)),o=Math.max(1,Math.abs(t(a.to)-t(a.from)));/* @__PURE__ */
849
+ return J("rect",{x:e(n),y:i,width:Math.max(1,e.bandwidth),height:o,rx:s,fill:l,fillOpacity:null===r||r===n?1:.45},n)})]})})}function Ys({values:e,bins:t=10,precomputed:r,height:a=220,width:n,color:l,tone:i,formatBound:s,formatCount:o,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=$().charts,p=M(),g=s??(e=>Number.isInteger(e)?D(e,p):j(e,1,p)),f=o??(e=>D(e,p)),x=c??m.countAxis,b=d??m.distribution,y=r??Ji(e??[],t),v=_i(0,l,i),w=y.map(e=>g(e.from)),k=y.map(e=>e.count);/* @__PURE__ */
850
+ return J(zs,{labels:w,values:k,height:a,width:n,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:x,className:u,emptyLabel:h,ariaLabel:m.histogram(b,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */J(Ls,{title:`${g(y[e].from)} – ${g(y[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(y[e].count)}]}),children:({x:e,y:t,bottom:r,active:a})=>/* @__PURE__ */J("g",{children:y.map((n,l)=>/* @__PURE__ */J("rect",{x:e(l)+.5,y:t(n.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(n.count)),fill:v,fillOpacity:null===a||a===l?.85:.42},l))})})}function _s({boxes:e,height:t=240,width:r,color:a,tone:n,formatValue:l,yAxisLabel:i,label:s,className:o,emptyLabel:c}){const d=$().charts,u=M(),h=l??(e=>D(e,u)),m=s??d.distribution,p=_i(0,a,n),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
851
+ return J(zs,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:o,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
852
+ return J(Ls,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:a})=>/* @__PURE__ */J("g",{children:e.map((e,n)=>{const l=t.center(n),i=Math.max(6,t.bandwidth);/* @__PURE__ */
853
+ return X("g",{opacity:null!==a&&a!==n?.45:1,children:[
854
+ /* @__PURE__ */J("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
855
+ /* @__PURE__ */J("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
856
+ /* @__PURE__ */J("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
857
+ /* @__PURE__ */J("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
858
+ /* @__PURE__ */J("rect",{x:l-i/2,y:r(e.q3),width:i,height:Math.max(1,r(e.q1)-r(e.q3)),rx:2,fill:p,fillOpacity:.22,stroke:p,strokeWidth:1.5}),
859
+ /* @__PURE__ */J("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */J("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Ri.surface,strokeWidth:1.5},t))]},n)})})})}function Hs({candles:e,variant:t="candle",height:r=260,width:a,formatValue:n,yAxisLabel:l,label:i,className:s,emptyLabel:o}){const c=$().charts,d=M(),u=n??(e=>Number.isInteger(e)?D(e,d):j(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
860
+ return J(zs,{labels:e.map(e=>e.label),values:m,height:r,width:a,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:s,emptyLabel:o,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],a=r.close>=r.open,n=a?Oi.good:Oi.critical;/* @__PURE__ */
861
+ return J(Ls,{title:r.label,rows:[{key:"open",label:c.open,color:n,value:u(r.open)},{key:"high",label:c.high,color:n,value:u(r.high)},{key:"low",label:c.low,color:n,value:u(r.low)},{key:"close",label:c.close,color:n,value:u(r.close)}],emphasisKey:"close",footnote:a?c.closedAbove:c.closedBelow})},children:({x:r,y:a,active:n})=>/* @__PURE__ */J("g",{children:e.map((e,l)=>{const i=e.close>=e.open,s=i?Oi.good:Oi.critical,o=r.center(l),c=Math.max(3,r.bandwidth),d=null!==n&&n!==l,u=a(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(a(e.close)-a(e.open)));/* @__PURE__ */
862
+ return X("g",{opacity:d?.45:1,children:[
863
+ /* @__PURE__ */J("line",{x1:o,y1:a(e.high),x2:o,y2:a(e.low),stroke:s,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */J("rect",{x:o-c/2,y:u,width:c,height:h,rx:1,fill:i?s:"transparent",fillOpacity:i?.85:1,stroke:s,strokeWidth:1.5}):/* @__PURE__ */X(Q,{children:[
864
+ /* @__PURE__ */J("line",{x1:o-c/2,y1:a(e.open),x2:o,y2:a(e.open),stroke:s,strokeWidth:2}),
865
+ /* @__PURE__ */J("line",{x1:o,y1:a(e.close),x2:o+c/2,y2:a(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function qs({rows:e,columns:t,cells:r,height:a,width:n,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=$().charts,p=M(),g=s??(e=>D(e,p)),x=o??m.intensity,b=d??m.noActivity,y=E(null),v=xs(y),w=n??v,k=I(),[N,C]=W(null);if(O(()=>{if(null!==N)return f(e=>"Escape"===e.key&&(C(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
866
+ return J("div",{className:c,ref:y,children:/* @__PURE__ */J("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const L=l??_i(0),j=i??Math.max(1,...r.flat().filter(Number.isFinite)),z=96,P=26*e.length,S=a??P+26+26,A=Math.max(2,(Math.max(97,w)-z)/t.length),F=e=>{const t=j>0?Math.max(0,Math.min(1,e/j)):0;return`color-mix(in oklab, ${L} ${(8+92*t).toFixed(1)}%, ${Ri.surface})`};/* @__PURE__ */
867
+ return X("div",{className:`relative ${c??""}`,ref:y,children:[
868
+ /* @__PURE__ */X("svg",{width:"100%",height:S,viewBox:`0 0 ${w} ${S}`,role:"img","aria-label":m.heatmap(x,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>C(null),onBlur:()=>C(null),onKeyDown:r=>{const a="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,n="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===a&&0===n||(r.preventDefault(),C(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+a)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+n))})))},children:[
869
+ /* @__PURE__ */J("defs",{children:/* @__PURE__ */X("linearGradient",{id:k,x1:"0",x2:"1",children:[
870
+ /* @__PURE__ */J("stop",{offset:"0",stopColor:F(0)}),
871
+ /* @__PURE__ */J("stop",{offset:"1",stopColor:F(j)})]})}),e.map((e,t)=>/* @__PURE__ */J("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:Ri.label,children:e},`r${t}`)),e.map((e,a)=>t.map((t,n)=>{const l=r[a]?.[n]??0,i=N&&(N.r!==a||N.c!==n);/* @__PURE__ */
872
+ return J("rect",{x:z+n*A+u/2,y:26*a+u/2,width:Math.max(1,A-u),height:26-u,rx:h,fill:F(l),opacity:i?.55:1,onMouseEnter:()=>C({r:a,c:n}),children:/* @__PURE__ */J("title",{children:`${e} · ${t}: ${g(l)}`})},`${a}-${n}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((w-z)/56))))===0?/* @__PURE__ */J("text",{x:z+r*A+A/2,y:P+15,textAnchor:"middle",fontSize:11,fill:Ri.label,children:e},`c${r}`):null),
873
+ /* @__PURE__ */J("rect",{x:z,y:P+26,width:Math.min(180,Math.max(40,w-z)),height:8,rx:4,fill:`url(#${k})`}),
874
+ /* @__PURE__ */J("text",{x:z,y:P+48,fontSize:10.5,fill:Ri.label,children:"0"}),
875
+ /* @__PURE__ */J("text",{x:z+Math.min(180,Math.max(40,w-z)),y:P+48,textAnchor:"end",fontSize:10.5,fill:Ri.label,style:{fontVariantNumeric:"tabular-nums"},children:g(j)})]}),N&&/* @__PURE__ */J("div",{className:"absolute top-1 right-1 z-10",children:/* @__PURE__ */J(Ls,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:x,color:L,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function Us({caption:e,head:t,rows:r}){/* @__PURE__ */
876
+ return X("table",{className:"sr-only",children:[
877
+ /* @__PURE__ */J("caption",{children:e}),
878
+ /* @__PURE__ */J("thead",{children:/* @__PURE__ */J("tr",{children:t.map(e=>/* @__PURE__ */J("th",{scope:"col",children:e},e))})}),
879
+ /* @__PURE__ */J("tbody",{children:r.map((e,t)=>/* @__PURE__ */J("tr",{children:e.map((e,t)=>/* @__PURE__ */J("td",{children:e},t))},t))})]})}var Vs=3,Ks=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Gs({axes:e,series:t,size:r=300,mode:a="area",grid:n="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=$().charts,u=M(),h=i??(e=>D(e,u)),m=c??d.nothingToCompare,p=I(),[g,f]=W(null),{highlighted:x}=ps(),b=t.slice(0,3);if(e.length<3||0===b.length)/* @__PURE__ */
880
+ return J("p",{className:`text-sm text-gray-500 ${o??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,k=Gi(e.length),N=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...b.map(e=>e.values[t]??0).filter(Number.isFinite))),C=(e,t)=>{const r=Math.max(0,Math.min(1,t/N[e])),a=k.center(e)-k.step/2;return[y+w*r*Math.cos(a),v+w*r*Math.sin(a)]},L=(e,t)=>null!==g?g!==e:null!==x&&x!==t,j=null!==g?b[g]:void 0;/* @__PURE__ */
881
+ return X("div",{className:`relative ${o??""}`,children:[
882
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
883
+ /* @__PURE__ */J("title",{id:p,children:d.acrossMeasures(b.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const a=w*(r+1)/l;return"circle"===n?/* @__PURE__ */J("circle",{cx:y,cy:v,r:a,fill:"none",stroke:Ri.grid,strokeWidth:1},r):/* @__PURE__ */J("path",{d:Ks(ss(y,v,a,e.length)),fill:"none",stroke:Ri.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,a]=C(t,N[t]);/* @__PURE__ */
884
+ return X("g",{children:[
885
+ /* @__PURE__ */J("line",{x1:y,y1:v,x2:r,y2:a,stroke:Ri.grid,strokeWidth:1}),
886
+ /* @__PURE__ */J("text",{x:y+(w+18)*Math.cos(k.center(t)-k.step/2),y:v+(w+18)*Math.sin(k.center(t)-k.step/2)+4,textAnchor:"middle",fontSize:11,fill:Ri.label,children:e.label})]},e.key)}),
887
+ /* @__PURE__ */J(sn,{id:p,reveal:!!s&&"center-out"}),b.map((t,r)=>{const n=_i(r,t.color,t.tone),l=e.map((e,r)=>C(r,t.values[r]??0));/* @__PURE__ */
888
+ return X("g",{opacity:L(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${en(p)})`:void 0,children:["area"===a&&/* @__PURE__ */J("path",{d:Ks(l),fill:n,fillOpacity:.18,stroke:"none"}),
889
+ /* @__PURE__ */J("path",{d:Ks(l),fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */J("circle",{cx:e,cy:t,r:3.5,fill:n,stroke:Ri.surface,strokeWidth:1.5},r))]},t.key)})]}),j&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:j.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:_i(g,j.color,j.tone),value:h(j.values[t]??0)}))})}),
890
+ /* @__PURE__ */J("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:b.map((e,t)=>/* @__PURE__ */X("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
891
+ /* @__PURE__ */J("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:_i(t,e.color,e.tone)}}),
892
+ /* @__PURE__ */J("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
893
+ /* @__PURE__ */J(Us,{caption:d.acrossMeasures(b.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:b.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function Zs({segments:e,variant:t="pie",size:r=280,innerRadius:a,padAngle:n=.012,maxSegments:l=6,otherLabel:i,formatValue:s,centerLabel:o,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=$().charts,g=M(),f=s??(e=>D(e,g)),x=i??p.other,b=m??p.nothingToBreakDown,y=I(),[v,w]=W(null),{highlighted:k}=ps(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return J("p",{className:`text-sm text-gray-500 ${h??""}`,children:b});const C=[...N].sort((e,t)=>t.value-e.value),L=C.slice(0,l),j=C.slice(l),P=j.length>0?[...L,{key:"__other__",label:x,value:j.reduce((e,t)=>e+t.value,0)}]:L,S=P.reduce((e,t)=>e+t.value,0),A=r/2,F=r/2,B=r/2-12,T=a??("ring"===t?.58*B:0),E=Gi(P.length,n),O=Math.max(...P.map(e=>e.value)),R=e=>T+(B-T)*Math.sqrt(Math.max(0,e)/O);let Y=-Math.PI/2;const _=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=P.map((r,a)=>{const l="rose"===t?Gi(P.length,n).step:r.value/S*Math.PI*2,i="rose"===t?Gi(P.length,n).center(a):e+l/2;e+=l;const s="rose"===t?R(r.value):B;return{key:r.key,label:r.label,share:r.value/S,right:Math.cos(i)>=0,anchor:[A+s*Math.cos(i),F+s*Math.sin(i)],y:F+(s+14)*Math.sin(i),index:a}}).filter(e=>e.share>=u);for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<15&&(t[e].y=t[e-1].y+15)}return r})(),H=(e,t)=>null!==v?v!==e:null!==k&&k!==t,q=null!==v?P[v]:void 0;/* @__PURE__ */
894
+ return X("div",{className:`relative ${h??""}`,children:[
895
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
896
+ /* @__PURE__ */J("title",{id:y,children:p.breakdown(f(S),P.length)}),P.map((e,r)=>{const a=_i(r,e.color,e.tone),l="rose"===t?E(r):Y,i="rose"===t?E.step:e.value/S*Math.PI*2-n;"rose"!==t&&(Y+=e.value/S*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?R(e.value):B;/* @__PURE__ */
897
+ return J("path",{d:os(A,F,T,o,l,s),fill:a,fillOpacity:H(r,e.key)?.4:1,stroke:Ri.surface,strokeWidth:1,className:c?cn.sweep:void 0,style:c?dn(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),_.map(e=>{const t=e.right?r-6:6,a=e.right?r-58:58;/* @__PURE__ */
898
+ return X("g",{children:[
899
+ /* @__PURE__ */J("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${a},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:Ri.grid,strokeWidth:1}),
900
+ /* @__PURE__ */J("text",{x:t,y:e.y-2,fontSize:10.5,fill:Ri.label,textAnchor:e.right?"end":"start",children:e.label}),
901
+ /* @__PURE__ */J("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:Ri.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:z(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&T>0&&/* @__PURE__ */J("text",{x:A,y:F+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Ri.label,children:o})]}),q&&null!==v&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:q.label,rows:[{key:"value",label:p.value,color:_i(v,q.color,q.tone),value:f(q.value)},{key:"share",label:p.share,color:Ri.muted,value:z(q.value/S*100,1,g)}]})}),
902
+ /* @__PURE__ */J("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:P.map((e,t)=>/* @__PURE__ */X("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
903
+ /* @__PURE__ */J("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:_i(t,e.color,e.tone)}}),
904
+ /* @__PURE__ */J("span",{className:"flex-1 truncate",children:e.label}),
905
+ /* @__PURE__ */J("span",{className:"tabular-nums text-gray-800",children:z(e.value/S*100,1,g)})]},e.key))})]})}var Js=300*Math.PI/180;function Xs({rows:e,variant:t="track",size:r=300,max:a,formatValue:n,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=$().charts,d=M(),u=n??(e=>D(e,d)),h=s??c.nothingToPlot,m=I(),[p,g]=W(null),{highlighted:f}=ps();if(0===e.length)/* @__PURE__ */return J("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const x=r/2,b=r/2,y=r/2-10,v=a??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,k=Math.max(1,Math.floor((y-.16*r)/w||1)),N="track"===t?e.slice(0,k):e,C=Math.min(o,Math.max(1,w-2)),L=Gi(N.length,.03),j=null!==p?N[p]:void 0;/* @__PURE__ */
906
+ return X("div",{className:`relative ${i??""}`,children:[
907
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
908
+ /* @__PURE__ */J("title",{id:m,children:"track"===t?c.radialTrack(N.length):c.radialCycle(N.length)}),N.map((e,a)=>{const n=_i(a,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),s=((e,t)=>null!==p?p!==e:null!==f&&f!==t)(a,e.key);if("track"===t){const t=y-a*w,r=t-w+C,o=-Math.PI/2;/* @__PURE__ */
909
+ return X("g",{opacity:s?.4:1,onMouseEnter:()=>g(a),className:l?cn.sweep:void 0,style:l?dn(a,70):void 0,children:[
910
+ /* @__PURE__ */J("path",{d:os(x,b,r,t,o,o+Js),fill:Ri.grid}),
911
+ /* @__PURE__ */J("path",{d:os(x,b,r,t,o,o+Js*i),fill:n})]},e.key)}const o=.14*r;/* @__PURE__ */
912
+ return J("g",{opacity:s?.4:1,onMouseEnter:()=>g(a),children:/* @__PURE__ */J("path",{d:os(x,b,o,o+(y-o)*i,L(a),L(a)+L.step),fill:n})},e.key)})]}),j&&null!==p&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:j.label,rows:[{key:"value",label:c.value,color:_i(p,j.color,j.tone),value:u(j.value)}]})}),
913
+ /* @__PURE__ */J("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:e.map((e,t)=>/* @__PURE__ */X("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
914
+ /* @__PURE__ */J("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:_i(t,e.color,e.tone)}}),
915
+ /* @__PURE__ */J("span",{className:"flex-1 truncate",children:e.label}),
916
+ /* @__PURE__ */J("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function Qs({stages:e,shape:t="funnel",height:r,width:a=560,gap:n=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=$().charts,d=M(),u=l??(e=>D(e,d)),h=o??c.noStages,m=I(),[p,g]=W(null),{highlighted:f}=ps();if(0===e.length)/* @__PURE__ */return J("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const x=i??_i(0),b=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=a-v,k=e=>w*Math.max(0,e/y)/2,N=v+w/2,C=t=>46+t/Math.max(1,e.length-1)*54,L=e=>`color-mix(in oklab, ${x} ${C(e).toFixed(0)}%, ${Ri.surface})`,j=e=>C(e)>=55?Ri.surface:Ri.label,P=(e,t)=>null!==p?p!==e:null!==f&&f!==t,S=null!==p?e[p]:void 0;/* @__PURE__ */
917
+ return X("div",{className:`relative ${s??""}`,children:[
918
+ /* @__PURE__ */X("svg",{width:"100%",height:b,viewBox:`0 0 ${a} ${b}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
919
+ /* @__PURE__ */J("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,a)=>{const l=a*b/e.length+n/2,i=(a+1)*b/e.length-n/2,s=k(r.value),o="cone"===t?k(e[a+1]?.value??r.value):s,c=e[a-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
920
+ return X("g",{opacity:P(a,r.key)?.45:1,onMouseEnter:()=>g(a),children:[
921
+ /* @__PURE__ */J("path",{d:`M${N-s},${l} L${N+s},${l} L${N+o},${i} L${N-o},${i} Z`,fill:L(a)}),
922
+ /* @__PURE__ */J("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:Ri.label,children:r.label}),
923
+ /* @__PURE__ */X("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:Ri.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${z(h,1,d)}`:""]}),
924
+ /* @__PURE__ */J("text",{x:N,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:j(a),style:{fontVariantNumeric:"tabular-nums"},children:z(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),S&&null!==p&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:S.label,rows:[{key:"value",label:c.count,color:L(p),value:u(S.value)},{key:"share",label:c.ofFirstStage,color:Ri.muted,value:z(S.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Oi.critical,value:`−${z(100*(1-S.value/e[p-1].value),1,d)}`}]:[]]})})]})}function eo({items:e,height:t=320,width:r,gap:a=2,radius:n=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=$().charts,d=M(),u=l??(e=>D(e,d)),h=o??c.nothingToBreakDown,m=E(null),p=xs(m),g=r??p,[f,x]=W(null),{highlighted:b}=ps(),y=us(e,g,t);if(0===y.length)/* @__PURE__ */
925
+ return J("div",{className:s,ref:m,children:/* @__PURE__ */J("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??_i(0),w=Math.max(...y.map(e=>e.value),1),k=e=>34+e/w*62,N=e=>`color-mix(in oklab, ${v} ${k(e).toFixed(0)}%, ${Ri.surface})`,C=e=>k(e)>=55?Ri.surface:Ri.label,L=f??b,j=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
926
+ return X("div",{className:`relative ${s??""}`,ref:m,children:[
927
+ /* @__PURE__ */J("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>x(null),children:y.map(e=>{const t=Math.max(0,e.width-a),r=Math.max(0,e.height-a),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
928
+ return X("g",{opacity:L&&L!==e.key?.55:1,onMouseEnter:()=>x(e.key),children:[
929
+ /* @__PURE__ */J("rect",{x:e.x+a/2,y:e.y+a/2,width:t,height:r,rx:n,fill:N(e.value)}),l&&/* @__PURE__ */J("text",{x:e.x+a/2+8,y:e.y+a/2+18,fontSize:11.5,fontWeight:600,fill:C(e.value),children:e.label}),i&&/* @__PURE__ */J("text",{x:e.x+a/2+8,y:e.y+a/2+34,fontSize:11,fill:C(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),j&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:j.label,rows:[{key:"value",label:c.value,color:N(j.value),value:u(j.value)}]})}),
930
+ /* @__PURE__ */J(Us,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function to(e,t,r,a,n,l,i,s){if(a>=8)return;const o=e.reduce((e,t)=>e+ro(t,8-a),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=ro(e,8-a),u=d/o*r,h=`${i}/${e.key}`,m=0===a?t:n,p=0===a?e.key:l;s.push({id:h,label:e.label,value:d,depth:a,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&to(e.children,c,u,a+1,m,p,h,s),c+=u})}function ro(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+ro(r,t-1),0):Math.max(0,e.value??0)}function ao({nodes:e,size:t=320,innerRadius:r=44,ringGap:a=2,formatValue:n,centerLabel:l,className:i,emptyLabel:s}){const o=$().charts,c=M(),d=n??(e=>D(e,c)),u=s??o.nothingToBreakDown,[h,m]=W(null),{highlighted:p}=ps(),g=[];if(to(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return J("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,x=t/2,b=t/2,y=(t/2-8-r)/f,v=g.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),w=e=>`color-mix(in oklab, ${_i(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${Ri.surface})`,k=e=>null!==h?e.id===h:null===p||e.branchKey===p,N=h?g.find(e=>e.id===h):void 0,C=e=>z(e.value/v*100,1,c);/* @__PURE__ */
931
+ return X("div",{className:`relative ${i??""}`,children:[
932
+ /* @__PURE__ */X("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":o.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */J("path",{d:os(x,b,r+e.depth*y+a/2,r+(e.depth+1)*y-a/2,e.start,e.end),fill:w(e),fillOpacity:k(e)?1:.45,stroke:Ri.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */J("text",{x:x,y:b+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:Ri.label,children:l})]}),N&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:N.label,rows:[{key:"value",label:o.value,color:w(N),value:d(N.value)},{key:"share",label:o.share,color:Ri.muted,value:C(N)}]})}),
933
+ /* @__PURE__ */J(Us,{caption:o.sunburst(d(v),f),head:[o.tableLevel,o.tableItem,o.value,o.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),C(e)])})]})}function no({nodes:e,links:t,height:r=320,width:a,nodeWidth:n=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=$().charts,d=M(),u=i??(e=>D(e,d)),h=o??c.noFlows,m=E(null),p=xs(m),g=a??p,[f,x]=W(null),{highlighted:b}=ps();if(0===e.length||0===t.length)/* @__PURE__ */
934
+ return J("div",{className:s,ref:m,children:/* @__PURE__ */J("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-n-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),a=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,a,e.value??0)]})),k=/* @__PURE__ */new Map;for(const t of e)k.set(t.depth,[...k.get(t.depth)??[],t]);const N=Math.max(...[...k.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),C=r-20,L=N>0?(C-l*(Math.max(...[...k.values()].map(e=>e.length))-1))/N:0,j=/* @__PURE__ */new Map;for(const[e,t]of k){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*L)),a=r.reduce((e,t)=>e+t,0)+l*(t.length-1),n=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=a>C&&n>0?Math.max(0,1-(a-C)/n):1;let s=10;t.forEach((t,a)=>{const n=2+Math.max(0,r[a]-2)*i;j.set(t.key,{x:v(e),y:s,h:n,index:a}),s+=n+l})}const z=/* @__PURE__ */new Map,P=/* @__PURE__ */new Map,S=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,F="link"===f?.kind?t[f.index]:void 0,B="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
935
+ return X("div",{className:`relative ${s??""}`,ref:m,children:[
936
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>x(null),children:[t.map((e,t)=>{const r=j.get(e.from),a=j.get(e.to);if(!r||!a)return null;const l=Math.max(1,e.value*L),i=r.y+(z.get(e.from)??0)+l/2,s=a.y+(P.get(e.to)??0)+l/2;z.set(e.from,(z.get(e.from)??0)+l),P.set(e.to,(P.get(e.to)??0)+l);const o=r.x+n,c=a.x,d=_i(r.index,e.color),u=`${e.from}→${e.to}`,h=S.get(u)??0;S.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==b?A(e,b):null)(e,t);/* @__PURE__ */
937
+ return J("path",{d:as([[o,i],[c,s]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>x({kind:"link",index:t})},h?`${u}#${h}`:u)}),e.map(e=>{const r=j.get(e.key);if(!r)return null;const a=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:A(t[f.index],i):null!==b?b===i:null);var i;/* @__PURE__ */
938
+ return X("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>x({kind:"node",key:e.key}),children:[
939
+ /* @__PURE__ */J("rect",{x:r.x,y:r.y,width:n,height:r.h,rx:2,fill:_i(r.index,e.color,e.tone)}),
940
+ /* @__PURE__ */J("text",{x:a?r.x-8:r.x+n+8,y:r.y+r.h/2+4,textAnchor:a?"end":"start",fontSize:11,fill:Ri.label,children:e.label})]},e.key)})]}),F&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:`${F.from} → ${F.to}`,rows:[{key:"value",label:c.flow,color:_i(j.get(F.from)?.index??0,F.color),value:u(F.value)}]})}),B&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:B.label,rows:[{key:"value",label:c.throughput,color:_i(j.get(B.key)?.index??0,B.color,B.tone),value:u(w.get(B.key)??0)}]})}),
941
+ /* @__PURE__ */J(Us,{caption:c.sankey(e.length,t.length),head:[c.tableFrom,c.tableTo,c.value],rows:t.map(e=>[e.from,e.to,u(e.value)])})]})}function lo({labels:e,matrix:t,size:r=340,maxNodes:a=8,padAngle:n=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=$().charts,d=M(),u=i??(e=>D(e,d)),h=o??c.noFlows,[m,p]=W(null),{highlighted:g}=ps(),f=(e,r)=>{const a=t[e]?.[r];return"number"==typeof a&&Number.isFinite(a)?a:0},x=e.map((t,r)=>e.reduce((e,t,a)=>e+f(r,a)+f(a,r),0)),b=e.map((e,t)=>t).sort((e,t)=>x[t]-x[e]).slice(0,a),y=b.reduce((e,t)=>e+x[t],0);if(y<=0)/* @__PURE__ */return J("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,k=r/2-44,N=k-l,C=n*b.length,L=/* @__PURE__ */new Map;let j=-Math.PI/2;b.forEach((e,t)=>{const r=x[e]/y*(2*Math.PI-C);L.set(e,{start:j,end:j+r,slot:t}),j+=r+n});const z=/* @__PURE__ */new Map,P=[];for(const e of b)for(const t of b){const r=f(e,t);if(r<=0)continue;const a=L.get(e),n=r/Math.max(1,x[e])*(a.end-a.start),l=z.get(e)??0;z.set(e,l+n),P.push({from:e,to:t,value:r,a:a.start+l+n/2,b:L.get(t).start+(L.get(t).end-L.get(t).start)/2})}const S=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],A="arc"===m?.kind?m.index:void 0,F="ribbon"===m?.kind?P[m.index]:void 0;/* @__PURE__ */
942
+ return X("div",{className:`relative ${s??""}`,children:[
943
+ /* @__PURE__ */X("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(b.length),onMouseLeave:()=>p(null),children:[P.map((t,a)=>{const[n,l]=S(t.a,N),[i,s]=S(t.b,N),o=_i(L.get(t.from).slot),c=((t,r)=>m?"ribbon"===m.kind?m.index===r:m.index===t.from||m.index===t.to:null!==g?e[t.from]===g||e[t.to]===g:null)(t,a);/* @__PURE__ */
944
+ return J("path",{d:`M${n},${l} Q${v},${w} ${i},${s}`,fill:"none",stroke:o,strokeWidth:Math.max(1,t.value/y*r*.9),strokeOpacity:null===c||c?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:a})},`${e[t.from]}→${e[t.to]}`)}),b.map(t=>{const r=L.get(t),a=(r.start+r.end)/2,[n,l]=S(a,k+16),i=(t=>m?"arc"===m.kind?m.index===t:P[m.index].from===t||P[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
945
+ return X("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
946
+ /* @__PURE__ */J("path",{d:os(v,w,N,k,r.start,r.end),fill:_i(r.slot),fillOpacity:null===i||i?1:.45}),
947
+ /* @__PURE__ */J("text",{x:n,y:l+4,fontSize:11,fill:Ri.label,textAnchor:Math.cos(a)>.15?"start":Math.cos(a)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:_i(L.get(A).slot),value:u(x[A])}]})}),F&&/* @__PURE__ */J("div",{className:"absolute top-2 left-2 z-10",children:/* @__PURE__ */J(Ls,{title:`${e[F.from]} → ${e[F.to]}`,rows:[{key:"value",label:c.flow,color:_i(L.get(F.from).slot),value:u(F.value)}]})}),
948
+ /* @__PURE__ */J(Us,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:P.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Ll as APP_UPDATE_POLL_MS,Na as Accordion,jl as AppUpdateBanner,wr as AttachButton,yr as AttachmentDropZone,vr as AttachmentList,wi as AuthScreen,da as Avatar,ua as AvatarGroup,ga as Banner,Vl as BarChart,_s as BoxPlotChart,Ve as BrandAssetEditor,Ka as BudgetBar,Ri as CHART_INK,wt as Calendar,Hs as CandlestickChart,Lr as Card,zs as CartesianPlot,js as ChartBrush,sn as ChartDefs,Ds as ChartDot,Cs as ChartFrame,ms as ChartHighlightProvider,Ns as ChartSkeleton,Ls as ChartTooltip,fi as ChatTemplate,Ce as Checkbox_default,di as CheckoutTemplate,lo as ChordChart,Sa as ColoredBadge,Ws as ColumnChart,kr as ComposerAttachments,ll as ContainerFillChart,aa as CountBadge,Ga as DAY_MS,ri as DashboardTemplate,_l as DataTable,ii as DataTablePage,It as DatePicker_default,jt as DateRangePicker,_t as DateTimePicker_default,ea as DescriptionList,Ur as Divider,Gl as DonutChart,Al as Drawer,Cl as DropdownMenu,mi as EmailTemplate,Aa as EmptyState,$i as ErrorBoundary,Ni as ErrorPage,fr as FilePicker_default,Se as FormErrorSummary,je as FormField,oi as FormLayoutPage,Qs as FunnelChart,Ca as GROUP_COLORS,La as GROUP_COLORS_SOLID,yi as GalleryTemplate,Bl as GlobalSearch,Hr as Grid,qs as HeatmapChart,xl as HelpCenter,Ys as HistogramChart,le as INPUT_BASE,ne as INPUT_SIZES,te as IconButton_default,Or as Inline,gr as InputNumber_default,oe as Input_default,Tl as Kanban,Ae as Label,Jl as LineChart,Hl as ListFooter,ql as ListLoadError,Xt as MAX_FRACTION_DIGITS,ue as MENU_MAX_HEIGHT,cn as MOTION,gl as Markdown,Ue as MediaUploadField,et as MediaUploadGrid,vs as Meter,Ha as MetricBar,Zn as MilestoneTimeline,Ne as NativeSelect,rr as NumericKeypad,de as POPUP_MAX_WIDTH,Jn as POST_PRODUCTION_STATUSES,Fa as PageHeader,El as Pagination,xr as PaperclipGlyph,Br as Paragraph,Zs as PieChart,Je as PortalBrandingProvider,al as ProductionTimeline,Vs as RADAR_SERIES_CAP,Gs as RadarChart,Xs as RadialBarChart,Pe as RadioGroup,De as Radio_default,Os as RangeChart,bs as RankedBars,Es as SCATTER_SERIES_CAP,Ei as SERIES_SLOT_COUNT,Ii as SERIES_VARS,Xn as STAGES,Oi as STATUS_VARS,no as SankeyChart,Is as ScatterChart,Mr as SearchableSelect,or as Segmented,$e as Select_default,ta as SettingRow,yl as SidebarActionButton,vl as SidebarGroupLabel,wl as SidebarNavItem,Gr as Skeleton,Jt as Snippet,Ul as Sparkline,Ir as Stack,Dr as StatCard,ks as StatTile,ia as Statistic,Pa as StatusBadge,za as StatusBadgeProvider,ka as Stepper,ao as SunburstChart,hr as Switch_default,va as Tabs,$r as TagInput,Sr as Text,ce as Textarea_default,nr as TileButton_default,At as TimePicker_default,Ts as TimeSeriesChart,Kn as TimelineTrack,Fr as Title,$a as Tooltip,kl as TopNav,eo as TreemapChart,Rs as WaterfallChart,Gi as angleScale,Qt as appendKey,Bi as applyThemePrefs,os as arcPath,is as areaBetween,ls as areaFrom,fs as autoHighlightIndex,er as backspace,qi as bandScale,Ji as binValues,Ua as budgetState,as as bumpPath,Qn as calcOverall,el as calcReportOverall,Ut as copyToClipboard,ns as curvePath,an as dashFor,rn as fillFor,Xa as fillId,mt as firstDayOfWeek,ye as firstEnabledIndex,Ja as fmtSliderDate,ot as formatDate,ft as fromKey,Qa as glowId,tn as groundId,Da as groupColors,gs as highlightOpacity,se as inputClasses,Ta as isSeverityTone,Ui as ladderScale,ve as lastEnabledIndex,Qi as linearPath,Hi as linearScale,Ki as logScale,en as maskId,ke as matchTypeahead,Be as mediaFileName,ts as monotonePath,we as nextEnabledIndex,Vi as niceMax,ss as polygonPoints,he as popupBounds,Zi as radiusScale,Ke as resolvePortalBrandAsset,_i as resolveSeriesColor,Si as resolveTheme,Ht as selectionAt,Yi as seriesColor,Wa as severityOf,rs as splinePath,us as squarify,dn as stagger,es as stepPath,fa as tabButtonId,xa as tabPanelId,Za as toDayMs,$t as toISODate,gt as toKey,Dl as useAppUpdate,Wi as useClickOutside,be as useDropdownPosition,ps as useHighlight,xs as usePlotWidth,Xe as usePortalBranding,tl as useProductionTimeline,Ti as useTheme};