efficient-shell 4.159.0 → 4.160.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +12 -1
  2. package/dist/{Browser-OQCHLKM3.js → Browser-3KOGROX7.js} +12 -12
  3. package/dist/{Calculator-YBL65JNM.js → Calculator-QLJJ3ICT.js} +22 -22
  4. package/dist/{CurrencyConverter-6VFY4GF6.js → CurrencyConverter-3GTKDKHH.js} +7 -7
  5. package/dist/{Documents-IPXRU4CT.js → Documents-FDGF7QBQ.js} +12 -12
  6. package/dist/{Files-3MGL4ZT7.js → Files-TTSYOPVB.js} +26 -26
  7. package/dist/{Notepad-RJ2DYW2O.js → Notepad-ITHIATP2.js} +10 -10
  8. package/dist/{PomodoroTimer-6OQ33FY3.js → PomodoroTimer-CRKL26PP.js} +19 -19
  9. package/dist/{Preview-3WRPZWDU.js → Preview-GZTTEZWS.js} +14 -14
  10. package/dist/{Sidebar-FUPFF7BT.js → Sidebar-ECJEQXFK.js} +21 -21
  11. package/dist/{Spreadsheet-6NK53IZV.js → Spreadsheet-PFKZTLSI.js} +12 -12
  12. package/dist/{Stock-ZFLDG6TT.js → Stock-NAHSVLAJ.js} +3 -3
  13. package/dist/{Weather-BBPTXGQA.js → Weather-AY3QWBQT.js} +17 -17
  14. package/dist/{WorldClock-CQGQ2Y6N.js → WorldClock-AXNMA4PG.js} +3 -3
  15. package/dist/apps/index.js +1 -1
  16. package/dist/{chunk-EI4WZOP3.js → chunk-A6FPBD7W.js} +1 -1
  17. package/dist/chunk-GF2XCISN.js +1 -0
  18. package/dist/{chunk-Z3LPT4HB.js → chunk-HQTSPK5Q.js} +1 -1
  19. package/dist/{chunk-CK245P3T.js → chunk-JK3IIJN5.js} +7 -7
  20. package/dist/{chunk-J7AAGG7P.js → chunk-LCB4IVEL.js} +131 -131
  21. package/dist/{chunk-DLD4AKVT.js → chunk-X6E6UULK.js} +74 -74
  22. package/dist/{chunk-M4AKWGQM.js → chunk-XPSADW6W.js} +1 -1
  23. package/dist/chunk-YKZGKYVT.js +2 -0
  24. package/dist/{index-D0K5U1Pb.d.ts → index-Brl0XepS.d.ts} +8 -2
  25. package/dist/index.d.ts +24 -3
  26. package/dist/index.js +645 -645
  27. package/dist/ui/index.d.ts +1 -1
  28. package/dist/ui/index.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/chunk-L4KRS7N3.js +0 -1
  31. package/dist/chunk-MVLIXV7C.js +0 -2
@@ -1,25 +1,25 @@
1
- import{Breadcrumbs as e}from"./chunk-26RS37FG.js";import{SidebarLayout as t}from"./chunk-KASHUEJV.js";import{BrandMark as r}from"./chunk-CK245P3T.js";import{toast_default as n}from"./chunk-B2TBCVHH.js";import{useIsMobile as a,useShortcutLabel as l,useShellPrefs as i}from"./chunk-T6MKFQRH.js";import{useFileIntake as s,humanSize as o,FileIntakeAlert as c}from"./chunk-FHIF6IUV.js";import{calendarNames as d,firstDayOfWeek as u,formatDate as h,EMPTY_VALUE as m,toInstant as p,timeAgo as g,formatDateTime as f}from"./chunk-S2AZZGFF.js";import{iconButtonClasses as x,Button_default as b,buttonClasses as y}from"./chunk-PH3PRIFP.js";import{useTabLayer as v,focusableIn as w,useFocusTrap as N,useScrollLock as k,stopAfter as M}from"./chunk-PDTZTADH.js";import{glassStyle as $,glassFill as C,PopupMenu as L,PopupMenuDivider as j,PopupMenuLabel as z,itemLook as P}from"./chunk-VNEH2Y6H.js";import{registerModalEscapeInterceptor as D,onOverlayOpen as S,Z_LAYERS as A,useDismissPopupsOnOpen as B}from"./chunk-OSJ3ADF2.js";import{useShellLocale as F,useShellStrings as T,DEFAULT_SHELL_STRINGS as E,currentShellStrings as I,formatPlain as W,formatFixed as R,formatPercent as O,splitAround as H}from"./chunk-VVI77XNV.js";import{useBrowserLayoutEffect as _,useBrowserValue as q,useBrowserValueOnce as U,useBrowserState as V,useHydrated as K}from"./chunk-D65T4H6J.js";import{forwardRef as Y,useCallback as G,useState as Z,useRef as X,useId as J,useEffect as Q,createContext as ee,useMemo as te,Children as re,isValidElement as ne,cloneElement as ae,useContext as le,Fragment as ie,Component as se,useSyncExternalStore as oe,useLayoutEffect as ce}from"react";import{jsx as de,jsxs as ue,Fragment as he}from"react/jsx-runtime";import{createPortal as me}from"react-dom";var pe=Y(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-26RS37FG.js";import{SidebarLayout as t}from"./chunk-KASHUEJV.js";import{BrandMark as r}from"./chunk-JK3IIJN5.js";import{toast_default as n}from"./chunk-B2TBCVHH.js";import{useIsMobile as a,useShortcutLabel as l,useShellPrefs as i}from"./chunk-T6MKFQRH.js";import{useFileIntake as s,humanSize as o,FileIntakeAlert as c}from"./chunk-FHIF6IUV.js";import{calendarNames as d,firstDayOfWeek as u,formatDate as h,EMPTY_VALUE as m,toInstant as p,timeAgo as g,formatDateTime as f}from"./chunk-S2AZZGFF.js";import{iconButtonClasses as x,Button_default as b,buttonClasses as y}from"./chunk-PH3PRIFP.js";import{useTabLayer as v,focusableIn as w,useFocusTrap as N,useScrollLock as k,stopAfter as M}from"./chunk-PDTZTADH.js";import{glassStyle as $,glassFill as C,PopupMenu as L,PopupMenuDivider as j,PopupMenuLabel as z,itemLook as D}from"./chunk-VNEH2Y6H.js";import{registerModalEscapeInterceptor as P,onOverlayOpen as S,Z_LAYERS as A,useDismissPopupsOnOpen as B}from"./chunk-OSJ3ADF2.js";import{useShellLocale as F,useShellStrings as T,DEFAULT_SHELL_STRINGS as E,currentShellStrings as I,formatPlain as W,formatFixed as R,formatPercent as O,splitAround as H}from"./chunk-VVI77XNV.js";import{useBrowserLayoutEffect as _,useBrowserValue as q,useBrowserValueOnce as U,useBrowserState as V,useHydrated as K}from"./chunk-D65T4H6J.js";import{forwardRef as Y,useCallback as G,useState as Z,useRef as J,useId as X,useEffect as Q,createContext as ee,useMemo as te,Children as re,isValidElement as ne,cloneElement as ae,useContext as le,Fragment as ie,Component as se,useSyncExternalStore as oe,useLayoutEffect as ce}from"react";import{jsx as de,jsxs as ue,Fragment as he}from"react/jsx-runtime";import{createPortal as me}from"react-dom";var pe=Y(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
2
2
  return de("button",{ref:i,type:n,className:x({variant:t,size:r,className:a}),...l,children:e})}),ge="block w-full rounded-md border border-gray-300 bg-white",fe="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)]",xe={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"},be=`${ge} ${xe.md} ${fe}`,ye="disabled:cursor-not-allowed disabled:opacity-60";function ve(e){return[e?.size&&"md"!==e.size?`${ge} ${xe[e.size]} ${fe}`:be,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",ye,e?.className??""].filter(Boolean).join(" ")}var we=Y(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",...l},i){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),o=
3
3
  /* @__PURE__ */de("input",{ref:i,"aria-invalid":e||void 0,className:ve({invalid:e,size:n,className:[s,a].filter(Boolean).join(" ")}),...l});return t||r?/* @__PURE__ */ue("div",{className:"relative",children:[t&&/* @__PURE__ */de("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),o,r&&/* @__PURE__ */de("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):o}),Ne=Y(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,...i},s){const o=G(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
4
- return de("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:o,className:ve({invalid:e,size:l,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...i})}),ke=448,Me=240,$e=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function Ce(e){const t=$e(),r=e?.closest?.("[data-modal-panel]");if(!r)return t;const n=r.getBoundingClientRect();return n.width<=0||n.height<=0?t:{left:Math.max(t.left,n.left),right:Math.min(t.right,n.right),top:Math.max(t.top,n.top),bottom:Math.min(t.bottom,n.bottom)}}var Le=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var je={top:"bottom",bottom:"top",left:"right",right:"left"},ze={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function Pe(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 De=(e,t,r)=>Math.max(t,Math.min(e,r));function Se(e,t,r){let n=NaN,a=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!==n||t.top!==a||t.right!==l||t.bottom!==i||o!==s&&!(Number.isNaN(o)&&Number.isNaN(s));return n=t.left,a=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 Ae({trigger:e,menu:t,bounds:r,align:n,side:a}){const l=Pe(e,r,4),i="bottom"===a?"top":"bottom",s=t.height>l[a]&&(t.height<=l[i]||l[i]>l[a])?i:a,o=Math.max(Math.min(t.height,96),l[s]),c=Math.min(t.height,o),d=De("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:De("start"===n?e.left:e.right-h,r.left+8,r.right-8-h),top:d,side:s,maxHeight:o,maxWidth:u}}function Be(e,t,r={}){const{matchTriggerWidth:n=!1,preferredMaxWidth:a=ke,preferredMaxHeight:l=Me,popupRef:i}=r,[s,o]=Z(null);return _(()=>{if(!t)return void o(null);const r=()=>{const t=e.current,r=t?.getBoundingClientRect();if(!r)return;const s=Ce(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(a,m),maxHeight:h};if(n){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(),Se(()=>e.current,r,i?()=>i.current?.offsetWidth??NaN:void 0)},[t,e,n,a,l,i]),s}function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Te(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ee(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?Fe(e):Te(e)}function Ie(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var We=Y(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:s,...o},c){/* @__PURE__ */
5
- return ue("select",{ref:c,value:e,onChange:e=>t(e.target.value),"aria-invalid":a||void 0,className:ve({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...o,children:[void 0!==n&&/* @__PURE__ */de("option",{value:"",disabled:!0,children:n}),r.map(e=>/* @__PURE__ */de("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value))]})}),Re=Y(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:s,size:o,touchSize:c,title:d,"aria-describedby":u,"aria-label":h,"aria-labelledby":m,...p},g){const[f,x]=Z(!1),[b,y]=Z(-1),v=X(null),w=X(null),N=X(null),k=X(f);k.current=f;const M=X({buffer:"",timer:null}),C=J(),L=`${C}-listbox`,j=e=>`${C}-opt-${e}`,z=Be(w,f,{matchTriggerWidth:!0}),P=r.findIndex(t=>t.value===e),B=P>=0?r[P].label:void 0,F=P>=0?r[P].lang:void 0,T=G((e=!0)=>{x(!1),y(-1),e&&w.current?.focus()},[]),E=G(()=>{s||(y(P>=0?P:Fe(r)),x(!0))},[s,r,P]),I=G(e=>{const n=r[e];n&&!n.disabled&&(t(n.value),T())},[r,t,T]);Q(()=>{if(!f)return;return D(e=>!("Escape"!==e.key||!k.current)&&(T(),!0))},[f,T]),Q(()=>{if(!f)return;const e=e=>{const t=e.target;v.current?.contains(t)||N.current?.contains(t)||T(!1)};document.addEventListener("pointerdown",e);const t=S(()=>T(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[f,T]),Q(()=>{!f||b<0||N.current?.querySelector(`#${CSS.escape(j(b))}`)?.scrollIntoView({block:"nearest"})});const W=G(e=>{const t=M.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const n=f?b:P,a=Ie(r,t.buffer,n);a<0||(f?y(a):I(a))},[f,b,P,r,I]);/* @__PURE__ */
4
+ return de("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:o,className:ve({invalid:e,size:l,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...i})}),ke=448,Me=240,$e=()=>({left:0,right:window.innerWidth,top:0,bottom:window.innerHeight});function Ce(e){const t=$e(),r=e?.closest?.("[data-modal-panel]");if(!r)return t;const n=r.getBoundingClientRect();return n.width<=0||n.height<=0?t:{left:Math.max(t.left,n.left),right:Math.min(t.right,n.right),top:Math.max(t.top,n.top),bottom:Math.min(t.bottom,n.bottom)}}var Le=/* @__PURE__ */new Set(["hidden","clip","auto","scroll"]);var je={top:"bottom",bottom:"top",left:"right",right:"left"},ze={top:["right","left"],bottom:["right","left"],left:["top","bottom"],right:["top","bottom"]};function De(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 Pe=(e,t,r)=>Math.max(t,Math.min(e,r));function Se(e,t,r){let n=NaN,a=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!==n||t.top!==a||t.right!==l||t.bottom!==i||o!==s&&!(Number.isNaN(o)&&Number.isNaN(s));return n=t.left,a=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 Ae({trigger:e,menu:t,bounds:r,align:n,side:a}){const l=De(e,r,4),i="bottom"===a?"top":"bottom",s=t.height>l[a]&&(t.height<=l[i]||l[i]>l[a])?i:a,o=Math.max(Math.min(t.height,96),l[s]),c=Math.min(t.height,o),d=Pe("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:Pe("start"===n?e.left:e.right-h,r.left+8,r.right-8-h),top:d,side:s,maxHeight:o,maxWidth:u}}function Be(e,t,r={}){const{matchTriggerWidth:n=!1,preferredMaxWidth:a=ke,preferredMaxHeight:l=Me,popupRef:i}=r,[s,o]=Z(null);return _(()=>{if(!t)return void o(null);const r=()=>{const t=e.current,r=t?.getBoundingClientRect();if(!r)return;const s=Ce(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(a,m),maxHeight:h};if(n){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(),Se(()=>e.current,r,i?()=>i.current?.offsetWidth??NaN:void 0)},[t,e,n,a,l,i]),s}function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Te(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ee(e,t,r){let n=t+r;for(;n>=0&&n<e.length;){if(!e[n].disabled)return n;n+=r}return t>=0&&t<e.length&&!e[t].disabled?t:r>0?Fe(e):Te(e)}function Ie(e,t,r){const n=t.toLowerCase(),a=e.length;if(!n||0===a)return-1;for(let t=1;t<=a;t++){const l=((r+t)%a+a)%a,i=e[l];if(!i.disabled&&i.label.toLowerCase().startsWith(n))return l}return-1}var We=Y(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:s,...o},c){/* @__PURE__ */
5
+ return ue("select",{ref:c,value:e,onChange:e=>t(e.target.value),"aria-invalid":a||void 0,className:ve({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...o,children:[void 0!==n&&/* @__PURE__ */de("option",{value:"",disabled:!0,children:n}),r.map(e=>/* @__PURE__ */de("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value))]})}),Re=Y(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:s,size:o,touchSize:c,title:d,"aria-describedby":u,"aria-label":h,"aria-labelledby":m,...p},g){const[f,x]=Z(!1),[b,y]=Z(-1),v=J(null),w=J(null),N=J(null),k=J(f);k.current=f;const M=J({buffer:"",timer:null}),C=X(),L=`${C}-listbox`,j=e=>`${C}-opt-${e}`,z=Be(w,f,{matchTriggerWidth:!0}),D=r.findIndex(t=>t.value===e),B=D>=0?r[D].label:void 0,F=D>=0?r[D].lang:void 0,T=G((e=!0)=>{x(!1),y(-1),e&&w.current?.focus()},[]),E=G(()=>{s||(y(D>=0?D:Fe(r)),x(!0))},[s,r,D]),I=G(e=>{const n=r[e];n&&!n.disabled&&(t(n.value),T())},[r,t,T]);Q(()=>{if(!f)return;return P(e=>!("Escape"!==e.key||!k.current)&&(T(),!0))},[f,T]),Q(()=>{if(!f)return;const e=e=>{const t=e.target;v.current?.contains(t)||N.current?.contains(t)||T(!1)};document.addEventListener("pointerdown",e);const t=S(()=>T(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[f,T]),Q(()=>{!f||b<0||N.current?.querySelector(`#${CSS.escape(j(b))}`)?.scrollIntoView({block:"nearest"})});const W=G(e=>{const t=M.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const n=f?b:D,a=Ie(r,t.buffer,n);a<0||(f?y(a):I(a))},[f,b,D,r,I]);/* @__PURE__ */
6
6
  return ue("div",{ref:v,className:"relative",children:[
7
7
  /* @__PURE__ */de("button",{ref:w,id:i,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":f,"aria-controls":f?L:void 0,"aria-activedescendant":f&&b>=0?j(b):void 0,"aria-invalid":a||void 0,"aria-describedby":u,"aria-label":h,"aria-labelledby":m,title:d,disabled:s,onClick:()=>f?T():E(),onKeyDown:e=>{if(!s)switch(e.key){case"ArrowDown":return e.preventDefault(),void(f?y(e=>Ee(r,e,1)):E());case"ArrowUp":return e.preventDefault(),void(f?y(e=>Ee(r,e,-1)):E());case"Home":return void(f&&(e.preventDefault(),y(Fe(r))));case"End":return void(f&&(e.preventDefault(),y(Te(r))));case"Enter":return void(f&&(e.preventDefault(),I(b)));case" ":return e.preventDefault(),void(f?I(b):E());case"Escape":return void(f&&(e.preventDefault(),e.stopPropagation(),T()));case"Tab":return void(f&&T(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),W(e.key))}},className:ve({invalid:a,size:o,className:`pr-8 text-left ${l}`.trim()}),children:/* @__PURE__ */de("span",{lang:F,className:"block truncate "+(void 0===B?"text-gray-400":""),children:B??n??" "})}),
8
8
  /* @__PURE__ */de("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__ */de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
9
9
  /* @__PURE__ */ue("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!==n&&/* @__PURE__ */de("option",{value:"",disabled:!0,children:n}),r.map(e=>/* @__PURE__ */de("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value))]}),f&&me(
10
10
  /* @__PURE__ */de("div",{ref:N,id:L,role:"listbox",className:"fixed overflow-y-auto rounded-2xl py-1",style:{zIndex:A.popup,left:z?.left,top:z?.top,bottom:z?.bottom,width:z?.width,maxHeight:z?.maxHeight??Me,visibility:z?void 0:"hidden",...$()},children:r.map((t,r)=>/* @__PURE__ */de("div",{id:j(r),role:"option",lang:t.description?void 0:t.lang,"aria-selected":e===t.value,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||y(r)},onClick:()=>I(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===b?"bg-blue-50 text-blue-700":e===t.value?"font-medium text-blue-600":"text-gray-700"),children:t.description?/* @__PURE__ */ue(he,{children:[
11
11
  /* @__PURE__ */de("span",{lang:t.lang,className:"block truncate",children:t.label}),
12
- /* @__PURE__ */de("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label},t.value))}),document.body)]})}),Oe=Y(function({touchSize:e="touch",...t},r){return a()?/* @__PURE__ */de(We,{ref:r,...t,size:e}):/* @__PURE__ */de(Re,{ref:r,...t})});function He(e,t,r,n){const a=J(),l=!!e&&!!t,i=l?`${a}-label`:void 0,s=l?`${a}-description`:void 0;return{labelId:i,descriptionId:s,labelledBy:r??i,describedBy:[n,s].filter(Boolean).join(" ")||void 0}}var _e=Y(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":s,"aria-describedby":o,...c},d){const u=X(null),h=He(n,a,s,o);Q(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=G(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */de("input",{ref:m,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(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */ue("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
12
+ /* @__PURE__ */de("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label},t.value))}),document.body)]})}),Oe=Y(function({touchSize:e="touch",...t},r){return a()?/* @__PURE__ */de(We,{ref:r,...t,size:e}):/* @__PURE__ */de(Re,{ref:r,...t})});function He(e,t,r,n){const a=X(),l=!!e&&!!t,i=l?`${a}-label`:void 0,s=l?`${a}-description`:void 0;return{labelId:i,descriptionId:s,labelledBy:r??i,describedBy:[n,s].filter(Boolean).join(" ")||void 0}}var _e=Y(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":s,"aria-describedby":o,...c},d){const u=J(null),h=He(n,a,s,o);Q(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=G(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */de("input",{ref:m,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(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */ue("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
13
13
  /* @__PURE__ */ue("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */de("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */de("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),qe="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",Ue=Y(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":s,...o},c){const d=He(r,n,i,s);return r||n?/* @__PURE__ */ue("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
14
14
  /* @__PURE__ */de("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${qe} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o}),
15
15
  /* @__PURE__ */ue("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */de("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */de("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */de("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${qe} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...o})});function Ve({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:s}){const o=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===re.count(s)?re.only(s):null,d=ne(c)?c:null,u={};d&&(o&&(u["aria-describedby"]=[d.props["aria-describedby"],o].filter(Boolean).join(" ")),a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?ae(d,u):s;/* @__PURE__ */
16
16
  return ue("div",{className:i,children:[e&&/* @__PURE__ */ue("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
17
- /* @__PURE__ */de("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:a}):n?/* @__PURE__ */de("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:n}):null]})}var Ke={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Ye({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:s,orientation:o="vertical",disabled:c=!1,className:d=""}){const u=J(),h=e?`${u}-label`:void 0;/* @__PURE__ */
18
- return de(Ve,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */de("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Ke[o],children:s.map(e=>/* @__PURE__ */de(Ue,{name:a,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 Ge({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=T(),l=X(null),i=X(!1);if(Q(()=>{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__ */
17
+ /* @__PURE__ */de("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:a}):n?/* @__PURE__ */de("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:n}):null]})}var Ke={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Ye({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:s,orientation:o="vertical",disabled:c=!1,className:d=""}){const u=X(),h=e?`${u}-label`:void 0;/* @__PURE__ */
18
+ return de(Ve,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */de("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Ke[o],children:s.map(e=>/* @__PURE__ */de(Ue,{name:a,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 Ge({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=T(),l=J(null),i=J(!1);if(Q(()=>{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
19
  return ue("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)] ${n}`.trim(),children:[
20
20
  /* @__PURE__ */de("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
21
- /* @__PURE__ */de("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */de("li",{children:/* @__PURE__ */de("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}`))})]})}var Ze="text-xs font-medium text-gray-600";function Xe({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ze,t].filter(Boolean).join(" ")}function Je({required:e,children:t,className:r="",...n}){/* @__PURE__ */
22
- return ue("label",{className:Xe({className:r}),...n,children:[t,e&&/* @__PURE__ */de("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Qe=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function et(e){if(/^data:/i.test(e||""))return function(e){const t=Qe.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.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 tt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function rt(e,t=E.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 nt(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 at(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function lt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
21
+ /* @__PURE__ */de("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */de("li",{children:/* @__PURE__ */de("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}`))})]})}var Ze="text-xs font-medium text-gray-600";function Je({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Ze,t].filter(Boolean).join(" ")}function Xe({required:e,children:t,className:r="",...n}){/* @__PURE__ */
22
+ return ue("label",{className:Je({className:r}),...n,children:[t,e&&/* @__PURE__ */de("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Qe=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function et(e){if(/^data:/i.test(e||""))return function(e){const t=Qe.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.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 tt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function rt(e,t=E.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 nt(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 at(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function lt({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
23
23
  return ue("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
24
24
  /* @__PURE__ */de(ot,{}),
25
25
  /* @__PURE__ */de("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function it({children:e}){/* @__PURE__ */
@@ -31,22 +31,22 @@ return de("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColo
31
31
  return ue("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
32
32
  /* @__PURE__ */de("path",{d:"M12 15V4"}),
33
33
  /* @__PURE__ */de("path",{d:"M8 8l4-4 4 4"}),
34
- /* @__PURE__ */de("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function ut({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:d,accept:u="image/*",maxSizeBytes:h,fit:m="cover",height:p=112,placeholder:g,cta:f,acceptHint:x,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:N,removeLabel:k,busy:M=!1,busyLabel:$,disabled:C=!1}){const L=T().media,j=f??L.cta,z=N??L.replace,P=k??L.remove,D=$??L.uploading,S=J(),A=X(null),[B,F]=Z(null);Q(()=>()=>{A.current&&URL.revokeObjectURL(A.current)},[]);const E=C||M,I=!!e&&(st(e,u)||e===B),W=g??rt(u,L),R=e=>{r?r(e):n?n(e):(e=>{A.current&&URL.revokeObjectURL(A.current);const r=URL.createObjectURL(e);A.current=r,F(e.type.startsWith("video/")?r:null),t(r)})(e)},O=s({accept:u,maxSizeBytes:h,acceptHint:x,multiple:!1,disabled:E,onAccept:([e])=>R(e)}),{dragOver:H}=O,_=()=>{E||(r?r():O.open())},q=e?et(e):"",U=/* @__PURE__ */ue("div",{children:[
35
- /* @__PURE__ */ue("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",H?"border-blue-500":"border-gray-200"].join(" "),style:{height:p},children:[I?/* @__PURE__ */de("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":q||void 0,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */de("img",{src:e??void 0,alt:q,className:"h-full w-full",style:{objectFit:m}}),y&&e&&/* @__PURE__ */de(it,{children:q}),M&&/* @__PURE__ */de(lt,{label:D,rounded:"rounded-md"})]}),!C&&(v||w)&&/* @__PURE__ */ue("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */de(b,{id:S,variant:"secondary",size:"sm",onClick:()=>_(),disabled:M,children:z}),w&&/* @__PURE__ */de(b,{variant:"ghost",size:"sm",onClick:()=>{A.current&&(URL.revokeObjectURL(A.current),A.current=null),F(null),t("")},disabled:M,children:P})]})]}),V=/* @__PURE__ */de("button",{type:"button",id:S,onClick:()=>_(),disabled:E,"aria-label":"string"==typeof W?W:L.upload,"aria-busy":M||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${S}-error`:l?`${S}-hint`:void 0,...O.zoneProps,className:nt(H,E,at(E)),style:{minHeight:p},children:M?/* @__PURE__ */ue("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
34
+ /* @__PURE__ */de("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function ut({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:d,accept:u="image/*",maxSizeBytes:h,fit:m="cover",height:p=112,placeholder:g,cta:f,acceptHint:x,showFilename:y=!0,allowReplace:v=!0,allowRemove:w=!0,replaceLabel:N,removeLabel:k,busy:M=!1,busyLabel:$,disabled:C=!1}){const L=T().media,j=f??L.cta,z=N??L.replace,D=k??L.remove,P=$??L.uploading,S=X(),A=J(null),[B,F]=Z(null);Q(()=>()=>{A.current&&URL.revokeObjectURL(A.current)},[]);const E=C||M,I=!!e&&(st(e,u)||e===B),W=g??rt(u,L),R=e=>{r?r(e):n?n(e):(e=>{A.current&&URL.revokeObjectURL(A.current);const r=URL.createObjectURL(e);A.current=r,F(e.type.startsWith("video/")?r:null),t(r)})(e)},O=s({accept:u,maxSizeBytes:h,acceptHint:x,multiple:!1,disabled:E,onAccept:([e])=>R(e)}),{dragOver:H}=O,_=()=>{E||(r?r():O.open())},q=e?et(e):"",U=/* @__PURE__ */ue("div",{children:[
35
+ /* @__PURE__ */ue("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",H?"border-blue-500":"border-gray-200"].join(" "),style:{height:p},children:[I?/* @__PURE__ */de("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":q||void 0,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */de("img",{src:e??void 0,alt:q,className:"h-full w-full",style:{objectFit:m}}),y&&e&&/* @__PURE__ */de(it,{children:q}),M&&/* @__PURE__ */de(lt,{label:P,rounded:"rounded-md"})]}),!C&&(v||w)&&/* @__PURE__ */ue("div",{className:"mt-2 flex gap-2",children:[v&&/* @__PURE__ */de(b,{id:S,variant:"secondary",size:"sm",onClick:()=>_(),disabled:M,children:z}),w&&/* @__PURE__ */de(b,{variant:"ghost",size:"sm",onClick:()=>{A.current&&(URL.revokeObjectURL(A.current),A.current=null),F(null),t("")},disabled:M,children:D})]})]}),V=/* @__PURE__ */de("button",{type:"button",id:S,onClick:()=>_(),disabled:E,"aria-label":"string"==typeof W?W:L.upload,"aria-busy":M||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${S}-error`:l?`${S}-hint`:void 0,...O.zoneProps,className:nt(H,E,at(E)),style:{minHeight:p},children:M?/* @__PURE__ */ue("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
36
36
  /* @__PURE__ */de(ot,{}),
37
- /* @__PURE__ */de("span",{className:"text-xs font-medium text-gray-500",children:D})]}):/* @__PURE__ */ue(he,{children:[
37
+ /* @__PURE__ */de("span",{className:"text-xs font-medium text-gray-500",children:P})]}):/* @__PURE__ */ue(he,{children:[
38
38
  /* @__PURE__ */de("span",{className:"text-gray-400",children:/* @__PURE__ */de(dt,{})}),
39
39
  /* @__PURE__ */de("span",{className:"px-3 text-xs text-gray-500",children:W}),
40
40
  /* @__PURE__ */de("span",{className:"text-sm font-medium text-blue-600",children:j}),x&&/* @__PURE__ */de("span",{className:"text-xs text-gray-400",children:x})]})});/* @__PURE__ */
41
41
  return ue(Ve,{label:a,htmlFor:S,hint:l,error:i,required:o,className:d,children:[e?U:V,!r&&/* @__PURE__ */de("input",{...O.inputProps}),
42
- /* @__PURE__ */de(c,{rejections:O.rejections})]})}function ht({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:o,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=X(null),[x,y]=Z(null),[v,w]=Z(""),[N,k]=Z(""),[M,$]=Z(!1),[C,L]=Z(!1),j=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),z=T().brandAsset,P=v||e||a||"",D=x?null:e?t:l,S=x?null:e?n:i;Q(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const A=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
42
+ /* @__PURE__ */de(c,{rejections:O.rejections})]})}function ht({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:s,assetName:o,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=J(null),[x,y]=Z(null),[v,w]=Z(""),[N,k]=Z(""),[M,$]=Z(!1),[C,L]=Z(!1),j=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),z=T().brandAsset,D=v||e||a||"",P=x?null:e?t:l,S=x?null:e?n:i;Q(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const A=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
43
43
  return ue("section",{"aria-label":z.region(o,s),className:"grid gap-4 lg:grid-cols-2",children:[
44
44
  /* @__PURE__ */ue("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
45
- /* @__PURE__ */de(ut,{value:P,onChange:()=>{},onFile:e=>{if(g)return;A();const t=URL.createObjectURL(e);f.current=t,y(e),w(t),k("")},label:o,hint:N||z.usedFor(s),error:N||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:M||C,disabled:g}),
45
+ /* @__PURE__ */de(ut,{value:D,onChange:()=>{},onFile:e=>{if(g)return;A();const t=URL.createObjectURL(e);f.current=t,y(e),w(t),k("")},label:o,hint:N||z.usedFor(s),error:N||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:M||C,disabled:g}),
46
46
  /* @__PURE__ */ue("div",{className:"mt-3 flex flex-wrap gap-2",children:[
47
47
  /* @__PURE__ */de(b,{onClick:async()=>{if(x&&!g&&!M){$(!0),k("");try{await c(x),A(),y(null),w("")}catch(e){k(e instanceof Error?e.message:z.saveFailed(j,o))}finally{$(!1)}}},disabled:!x||g,loading:M,children:z.save(j,o)}),(x||e)&&/* @__PURE__ */de(b,{variant:"ghost-danger",onClick:async()=>{if(!g&&!C){if(x)return A(),y(null),w(""),void k("");if(e){L(!0),k("");try{await d()}catch(e){k(e instanceof Error?e.message:z.removeFailed(j,o))}finally{L(!1)}}}},disabled:g,loading:C,children:x?z.discard:z.remove(j,o)})]})]}),p.length>0&&/* @__PURE__ */ue("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":z.previews(o),children:[
48
48
  /* @__PURE__ */de("h3",{className:"text-sm font-semibold text-gray-900",children:z.preview}),
49
- /* @__PURE__ */de("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */de(r,{src:P,alt:z.alt(s,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:D,isLight:S,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
49
+ /* @__PURE__ */de("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */de(r,{src:D,alt:z.alt(s,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:S,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
50
50
  return ue("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
51
51
  /* @__PURE__ */de("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */ue("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
52
52
  /* @__PURE__ */ue("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,
@@ -58,17 +58,17 @@ return ue("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-whit
58
58
  /* @__PURE__ */ue("div",{className:"min-w-0 leading-tight",children:[
59
59
  /* @__PURE__ */de("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??s}),e.url&&/* @__PURE__ */de("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
60
60
  /* @__PURE__ */de("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??s}),e.description&&/* @__PURE__ */de("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */ue("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__ */de("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function mt(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 pt=ee(null);function gt(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 ft({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=Z(t),[i,s]=Z(!0),[o,c]=Z(null),d=X(e),u=X(t);d.current=e,u.current=t,Q(()=>{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()}},[]),Q(()=>(gt(a.favicon_url),()=>gt(null)),[a.favicon_url]),Q(()=>{r&&(document.title=r(a))},[a,r]);const h=te(()=>({branding:a,loading:i,error:o}),[a,i,o]);/* @__PURE__ */
62
- return de(pt.Provider,{value:h,children:n})}function xt(){const e=le(pt);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var bt=/* @__PURE__ */de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */de("path",{d:"M6 6l12 12M18 6L6 18"})});function yt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,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:N=!1,busyLabel:k,disabled:M=!1,readOnly:$=!1}){const C=T().media,L=b??C.cta,j=w??C.cover,z=k??C.uploading,P=J(),[D,S]=Z(null),A=M||N,B=!(!t&&!r||A||$),F=!!n&&!A&&!$,E=!!a&&!A&&!$,I=at(A),W=x??rt(h,C),R=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)}}),O=R.dragOver,H=()=>{B&&(t?t():R.open())},_={width:f,height:f},q=B&&/* @__PURE__ */ue("button",{type:"button",onClick:()=>H(),"aria-label":C.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 ${I}`,style:_,children:[
61
+ /* @__PURE__ */de("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function mt(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 pt=ee(null);function gt(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 ft({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=Z(t),[i,s]=Z(!0),[o,c]=Z(null),d=J(e),u=J(t);d.current=e,u.current=t,Q(()=>{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()}},[]),Q(()=>(gt(a.favicon_url),()=>gt(null)),[a.favicon_url]),Q(()=>{r&&(document.title=r(a))},[a,r]);const h=te(()=>({branding:a,loading:i,error:o}),[a,i,o]);/* @__PURE__ */
62
+ return de(pt.Provider,{value:h,children:n})}function xt(){const e=le(pt);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var bt=/* @__PURE__ */de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */de("path",{d:"M6 6l12 12M18 6L6 18"})});function yt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,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:N=!1,busyLabel:k,disabled:M=!1,readOnly:$=!1}){const C=T().media,L=b??C.cta,j=w??C.cover,z=k??C.uploading,D=X(),[P,S]=Z(null),A=M||N,B=!(!t&&!r||A||$),F=!!n&&!A&&!$,E=!!a&&!A&&!$,I=at(A),W=x??rt(h,C),R=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)}}),O=R.dragOver,H=()=>{B&&(t?t():R.open())},_={width:f,height:f},q=B&&/* @__PURE__ */ue("button",{type:"button",onClick:()=>H(),"aria-label":C.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 ${I}`,style:_,children:[
63
63
  /* @__PURE__ */de(dt,{className:"h-5 w-5"}),
64
64
  /* @__PURE__ */de("span",{className:"text-xs font-medium text-gray-500",children:C.add})]}),U=B?/* @__PURE__ */ue("button",{type:"button",onClick:()=>H(),"aria-label":"string"==typeof W?W:C.upload,className:nt(O,!1,I),style:{minHeight:f+32},children:[
65
65
  /* @__PURE__ */de("span",{className:"text-gray-400",children:/* @__PURE__ */de(dt,{})}),
66
66
  /* @__PURE__ */de("span",{className:"px-3 text-xs text-gray-500",children:W}),
67
67
  /* @__PURE__ */de("span",{className:"text-sm font-medium text-blue-600",children:L}),y&&/* @__PURE__ */de("span",{className:"text-xs text-gray-400",children:y})]}):/* @__PURE__ */de("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:C.empty});/* @__PURE__ */
68
- return ue(Ve,{label:l,labelId:l?`${P}-label`:void 0,htmlFor:P,hint:i,error:o,required:d,className:u,children:[
69
- /* @__PURE__ */ue("div",{id:P,role:"group","aria-labelledby":l?`${P}-label`:void 0,"aria-describedby":o?`${P}-error`:i?`${P}-hint`:void 0,"aria-busy":N||void 0,...R.zoneProps,className:"relative rounded-lg transition-colors",style:{...A?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?U:/* @__PURE__ */ue("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:st(t.url,h),i=et(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
70
- return ue("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),S(r)}:void 0,onDragEnd:E?()=>S(null):void 0,onDragOver:E?e=>{null!=D&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=D&&(e.preventDefault(),e.stopPropagation(),D!==r&&a(D,r),S(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?C.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",I,D===r?"opacity-50":""].join(" "),style:{..._,cursor:E?"move":void 0},children:[l?/* @__PURE__ */de("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:g}}):/* @__PURE__ */de("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:g}}),s&&/* @__PURE__ */de("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__ */de(it,{children:t.caption}),F&&/* @__PURE__ */de("button",{type:"button",onClick:()=>n(t.id),"aria-label":C.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${I}`,style:{background:"var(--rosh-media-scrim-button)"},children:bt})]},t.id)}),q]}),N&&/* @__PURE__ */de(lt,{label:z})]}),!t&&r&&/* @__PURE__ */de("input",{...R.inputProps}),
71
- /* @__PURE__ */de(c,{rejections:R.rejections})]})}var vt=e=>String(e).padStart(2,"0");function wt(e){return`${e.getFullYear()}-${vt(e.getMonth()+1)}-${vt(e.getDate())}`}function Nt(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 kt=e=>`${e.getFullYear()}-${vt(e.getMonth()+1)}`;var Mt=()=>wt(/* @__PURE__ */new Date);var $t=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Ct=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function Lt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:h=!0,"aria-label":m,className:p=""}){const g=Nt(e),f=q(Mt,null),x=Nt(f),b=T().calendar,y=F(),v=d(y),w=q(()=>u(y),0),N=c??w,k=()=>{if(!x)return null;const e=kt(x);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,$]=Z(()=>s||(g?kt(g):k())),C=i??M??k(),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,x),[j,z]=Z(()=>e??f),P=X(null),D=X(!1),[S,A]=Z("days"),B=te(()=>L?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(L,N):[],[C,N]),E=e=>!!a&&e<a||!!l&&e>l,I=j??f,W=B.some(e=>wt(e)===I),R=L?B.find(e=>e.getMonth()===L.getMonth())??B[0]:null,O=W&&I?I:R?wt(R):"";if(Q(()=>{D.current&&(D.current=!1,P.current?.querySelector('[data-active="true"]')?.focus())},[O,C]),!L)/* @__PURE__ */
68
+ return ue(Ve,{label:l,labelId:l?`${D}-label`:void 0,htmlFor:D,hint:i,error:o,required:d,className:u,children:[
69
+ /* @__PURE__ */ue("div",{id:D,role:"group","aria-labelledby":l?`${D}-label`:void 0,"aria-describedby":o?`${D}-error`:i?`${D}-hint`:void 0,"aria-busy":N||void 0,...R.zoneProps,className:"relative rounded-lg transition-colors",style:{...A?{opacity:.6}:{},...O?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?U:/* @__PURE__ */ue("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:st(t.url,h),i=et(t.url),s=v&&(t.cover??0===r);/* @__PURE__ */
70
+ return ue("div",{draggable:E||void 0,onDragStart:E?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(r)),S(r)}:void 0,onDragEnd:E?()=>S(null):void 0,onDragOver:E?e=>{null!=P&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:E?e=>{null!=P&&(e.preventDefault(),e.stopPropagation(),P!==r&&a(P,r),S(null))}:void 0,tabIndex:E?0:void 0,"aria-label":E?C.reorder(i,r+1,e.length):void 0,onKeyDown:E?t=>{"ArrowLeft"===t.key||"ArrowUp"===t.key?r>0&&(t.preventDefault(),a(r,r-1)):"ArrowRight"!==t.key&&"ArrowDown"!==t.key||r<e.length-1&&(t.preventDefault(),a(r,r+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-gray-200 bg-gray-100",I,P===r?"opacity-50":""].join(" "),style:{..._,cursor:E?"move":void 0},children:[l?/* @__PURE__ */de("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:g}}):/* @__PURE__ */de("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:g}}),s&&/* @__PURE__ */de("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__ */de(it,{children:t.caption}),F&&/* @__PURE__ */de("button",{type:"button",onClick:()=>n(t.id),"aria-label":C.removeItem(i),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${I}`,style:{background:"var(--rosh-media-scrim-button)"},children:bt})]},t.id)}),q]}),N&&/* @__PURE__ */de(lt,{label:z})]}),!t&&r&&/* @__PURE__ */de("input",{...R.inputProps}),
71
+ /* @__PURE__ */de(c,{rejections:R.rejections})]})}var vt=e=>String(e).padStart(2,"0");function wt(e){return`${e.getFullYear()}-${vt(e.getMonth()+1)}-${vt(e.getDate())}`}function Nt(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 kt=e=>`${e.getFullYear()}-${vt(e.getMonth()+1)}`;var Mt=()=>wt(/* @__PURE__ */new Date);var $t=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Ct=(e,t)=>{const r=new Date(e.getFullYear(),e.getMonth()+t,1),n=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();return new Date(r.getFullYear(),r.getMonth(),Math.min(e.getDate(),n))};function Lt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:s,onMonthChange:o,weekStartsOn:c,quickJump:h=!0,"aria-label":m,className:p=""}){const g=Nt(e),f=q(Mt,null),x=Nt(f),b=T().calendar,y=F(),v=d(y),w=q(()=>u(y),0),N=c??w,k=()=>{if(!x)return null;const e=kt(x);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,$]=Z(()=>s||(g?kt(g):k())),C=i??M??k(),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,x),[j,z]=Z(()=>e??f),D=J(null),P=J(!1),[S,A]=Z("days"),B=te(()=>L?function(e,t){const r=new Date(e.getFullYear(),e.getMonth(),1),n=(r.getDay()-t+7)%7,a=new Date(r.getFullYear(),r.getMonth(),1-n);return Array.from({length:42},(e,t)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+t))}(L,N):[],[C,N]),E=e=>!!a&&e<a||!!l&&e>l,I=j??f,W=B.some(e=>wt(e)===I),R=L?B.find(e=>e.getMonth()===L.getMonth())??B[0]:null,O=W&&I?I:R?wt(R):"";if(Q(()=>{P.current&&(P.current=!1,D.current?.querySelector('[data-active="true"]')?.focus())},[O,C]),!L)/* @__PURE__ */
72
72
  return ue("div",{className:p,"aria-hidden":"true","data-calendar-pending":"",children:[
73
73
  /* @__PURE__ */de("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */de("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const H=e=>"years"===S?new Date(L.getFullYear()+12*e,L.getMonth(),1):"months"===S?new Date(L.getFullYear()+e,L.getMonth(),1):Ct(L,e),_=e=>{const t=kt(e);void 0===i&&$(t),o?.(t)},U=m??v.monthYear(L.getFullYear(),L.getMonth());/* @__PURE__ */
74
74
  return ue("div",{className:p,children:[
@@ -77,15 +77,15 @@ return ue("div",{className:p,children:[
77
77
  /* @__PURE__ */de("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:h?/* @__PURE__ */ue(he,{children:["years"!==S&&/* @__PURE__ */de("button",{type:"button","aria-label":b.chooseMonth(v.months[L.getMonth()]),onClick:()=>A(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:v.months[L.getMonth()]}),
78
78
  /* @__PURE__ */de("button",{type:"button","aria-label":b.chooseYear(L.getFullYear()),onClick:()=>A(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__ */de("span",{children:v.monthYear(L.getFullYear(),L.getMonth())})}),
79
79
  /* @__PURE__ */de("button",{type:"button","aria-label":"years"===S?b.nextYears:"months"===S?b.nextYear:b.nextMonth,onClick:()=>_(H(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__ */de("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===S&&/* @__PURE__ */de("div",{role:"group","aria-label":b.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:v.monthsShort.map((e,t)=>/* @__PURE__ */de("button",{type:"button","aria-pressed":t===L.getMonth(),onClick:()=>{_(new Date(L.getFullYear(),t,1)),A("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":x&&t===x.getMonth()&&L.getFullYear()===x.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===S&&/* @__PURE__ */de("div",{role:"group","aria-label":b.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__ */de("button",{type:"button","aria-pressed":e===L.getFullYear(),onClick:()=>{_(new Date(e,L.getMonth(),1)),A("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===x?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
80
- /* @__PURE__ */ue("div",{ref:P,role:"grid","aria-label":U,onKeyDown:e=>{const t=Nt(O)??x??L,r={ArrowLeft:()=>$t(t,-1),ArrowRight:()=>$t(t,1),ArrowUp:()=>$t(t,-7),ArrowDown:()=>$t(t,7),Home:()=>$t(t,-(t.getDay()-N+7)%7),End:()=>$t(t,6-(t.getDay()-N+7)%7),PageUp:()=>Ct(t,e.shiftKey?-12:-1),PageDown:()=>Ct(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),D.current=!0,z(wt(a)),void(kt(a)!==C&&_(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),E(O)||n(O))},hidden:"days"!==S,children:[
80
+ /* @__PURE__ */ue("div",{ref:D,role:"grid","aria-label":U,onKeyDown:e=>{const t=Nt(O)??x??L,r={ArrowLeft:()=>$t(t,-1),ArrowRight:()=>$t(t,1),ArrowUp:()=>$t(t,-7),ArrowDown:()=>$t(t,7),Home:()=>$t(t,-(t.getDay()-N+7)%7),End:()=>$t(t,6-(t.getDay()-N+7)%7),PageUp:()=>Ct(t,e.shiftKey?-12:-1),PageDown:()=>Ct(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),P.current=!0,z(wt(a)),void(kt(a)!==C&&_(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),E(O)||n(O))},hidden:"days"!==S,children:[
81
81
  /* @__PURE__ */de("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+N)%7).map(e=>
82
82
  /* @__PURE__ */de("div",{role:"columnheader","aria-label":v.weekdays[e],className:"py-1",children:/* @__PURE__ */de("abbr",{title:v.weekdays[e],className:"no-underline",children:v.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */de("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:B.slice(7*l,7*l+7).map(a=>{const l=wt(a),i=a.getMonth()!==L.getMonth(),s=l===e||"range"===r&&l===t,o=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=E(l);/* @__PURE__ */
83
- return de("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */de("button",{type:"button","data-active":l===O,tabIndex:l===O?0:-1,disabled:c,"aria-label":v.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===f?"date":void 0,onClick:()=>{z(l),n(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-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==f||s?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var jt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],zt=e=>`${e.getFullYear()}-${Pt(e.getMonth()+1)}`,Pt=e=>String(e).padStart(2,"0");function Dt(e){return`${e.getFullYear()}-${Pt(e.getMonth()+1)}-${Pt(e.getDate())}`}function St(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Dt(new Date(r,n,t.getDate()-14)),to:Dt(a)};case"lastMonth":return{from:Dt(i(1)),to:Dt(l)};case"last3Months":return{from:Dt(i(3)),to:Dt(l)};case"last6Months":return{from:Dt(i(6)),to:Dt(l)};case"last12Months":return{from:Dt(i(12)),to:Dt(l)}}}function At(e,t,r){const n=zt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Bt(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Ft(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Tt=/* @__PURE__ */new Map;function Et({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:s,"aria-labelledby":o,"aria-label":c,weekStartsOn:u,placeholder:h,fullWidth:m=!1,min:p,max:g}){const f=T().dateRange,x=F(),b=n??(x?function(e){let t=Tt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Tt.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(x):Ft),y=h??f.placeholder,v=a??!l,[w,N]=Z(!1),[k,M]=Z(e),[C,L]=Z(t),[j,z]=Z(null),P=X(null),D=X(null),B=X(null),E=J(),I=J(),W=J(),[R,O]=Z(!1),H=Be(P,w,{preferredMaxWidth:520,preferredMaxHeight:R?720:560,popupRef:B}),q=X(null),U=X(null);_(()=>{const e=B.current;if(!w||!H||!e)return;const t=getComputedStyle(e),r=H.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(R)null!==U.current&&U.current<=r&&O(!1);else{const e=q.current?.offsetWidth??0;if(0===e)return;U.current=e,e>r+.5&&O(!0)}});const[V,K]=Z(!1);_(()=>{const e=!!s&&(D.current?.labels?.length??0)>0;e!==V&&K(e)});const Y=!!c||!!o||V,G=/* @__PURE__ */new Date,[ee,te]=Z(()=>e?zt(Bt(e)):At(G,p,g)),re=jt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(St(e,G),p,g)),ne=e=>e?b(e):"";Q(()=>{if(!w)return;const e=e=>{const t=e.target;P.current?.contains(t)||B.current?.contains(t)||N(!1)};document.addEventListener("mousedown",e);const t=S(()=>N(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[w]);const ae=()=>{r("",""),N(!1)},le=e&&t?`${ne(e)} — ${ne(t)}`:e?f.fromOnly(ne(e)):t?f.toOnly(ne(t)):"",ie=d(x),se=e=>{const t=Nt(e);return t?ie.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},oe=e&&t?f.range(se(e),se(t)):e?f.fromOnly(se(e)):t?f.toOnly(se(t)):y,ce=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"),pe=/* @__PURE__ */ue(he,{children:[re.map(e=>/* @__PURE__ */de("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=St(e,G);M(t.from),L(t.to),z(e),te(t.from.slice(0,7))})(e),className:ce(e),children:f[e]},e)),
83
+ return de("div",{role:"gridcell","aria-selected":s,children:/* @__PURE__ */de("button",{type:"button","data-active":l===O,tabIndex:l===O?0:-1,disabled:c,"aria-label":v.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===f?"date":void 0,onClick:()=>{z(l),n(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-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==f||s?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var jt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],zt=e=>`${e.getFullYear()}-${Dt(e.getMonth()+1)}`,Dt=e=>String(e).padStart(2,"0");function Pt(e){return`${e.getFullYear()}-${Dt(e.getMonth()+1)}-${Dt(e.getDate())}`}function St(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),l=new Date(r,n,0),i=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:Pt(new Date(r,n,t.getDate()-14)),to:Pt(a)};case"lastMonth":return{from:Pt(i(1)),to:Pt(l)};case"last3Months":return{from:Pt(i(3)),to:Pt(l)};case"last6Months":return{from:Pt(i(6)),to:Pt(l)};case"last12Months":return{from:Pt(i(12)),to:Pt(l)}}}function At(e,t,r){const n=zt(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Bt(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Ft(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Tt=/* @__PURE__ */new Map;function Et({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:s,"aria-labelledby":o,"aria-label":c,weekStartsOn:u,placeholder:h,fullWidth:m=!1,min:p,max:g}){const f=T().dateRange,x=F(),b=n??(x?function(e){let t=Tt.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Tt.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(x):Ft),y=h??f.placeholder,v=a??!l,[w,N]=Z(!1),[k,M]=Z(e),[C,L]=Z(t),[j,z]=Z(null),D=J(null),P=J(null),B=J(null),E=X(),I=X(),W=X(),[R,O]=Z(!1),H=Be(D,w,{preferredMaxWidth:520,preferredMaxHeight:R?720:560,popupRef:B}),q=J(null),U=J(null);_(()=>{const e=B.current;if(!w||!H||!e)return;const t=getComputedStyle(e),r=H.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(R)null!==U.current&&U.current<=r&&O(!1);else{const e=q.current?.offsetWidth??0;if(0===e)return;U.current=e,e>r+.5&&O(!0)}});const[V,K]=Z(!1);_(()=>{const e=!!s&&(P.current?.labels?.length??0)>0;e!==V&&K(e)});const Y=!!c||!!o||V,G=/* @__PURE__ */new Date,[ee,te]=Z(()=>e?zt(Bt(e)):At(G,p,g)),re=jt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(St(e,G),p,g)),ne=e=>e?b(e):"";Q(()=>{if(!w)return;const e=e=>{const t=e.target;D.current?.contains(t)||B.current?.contains(t)||N(!1)};document.addEventListener("mousedown",e);const t=S(()=>N(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[w]);const ae=()=>{r("",""),N(!1)},le=e&&t?`${ne(e)} — ${ne(t)}`:e?f.fromOnly(ne(e)):t?f.toOnly(ne(t)):"",ie=d(x),se=e=>{const t=Nt(e);return t?ie.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},oe=e&&t?f.range(se(e),se(t)):e?f.fromOnly(se(e)):t?f.toOnly(se(t)):y,ce=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"),pe=/* @__PURE__ */ue(he,{children:[re.map(e=>/* @__PURE__ */de("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=St(e,G);M(t.from),L(t.to),z(e),te(t.from.slice(0,7))})(e),className:ce(e),children:f[e]},e)),
84
84
  /* @__PURE__ */de("button",{type:"button",onClick:()=>z("Custom"),className:ce("Custom"),children:f.custom})]}),ge=
85
85
  /* @__PURE__ */de(Lt,{mode:"range",min:p,max:g,value:k||null,endValue:C||null,month:ee,onMonthChange:te,onSelect:e=>{z("Custom"),!k||k&&C?(M(e),L("")):e<k?(L(k),M(e)):L(e)},weekStartsOn:u,"aria-label":f.dialog});/* @__PURE__ */
86
- return ue("div",{className:"relative"+(m?" w-full":""),ref:P,children:[
86
+ return ue("div",{className:"relative"+(m?" w-full":""),ref:D,children:[
87
87
  /* @__PURE__ */ue("div",{className:`${m?"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__ */ue("button",{ref:D,type:"button",onClick:()=>{M(e),L(t),z(null),te(e?zt(Bt(e)):At(G,p,g)),N(!0)},"aria-haspopup":"dialog","aria-expanded":w,id:s,"aria-label":c,"aria-labelledby":o,"aria-describedby":[Y?I:void 0,l?W:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":w?E:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(m?" min-w-0 flex-1 justify-start":""),children:[
88
+ /* @__PURE__ */ue("button",{ref:P,type:"button",onClick:()=>{M(e),L(t),z(null),te(e?zt(Bt(e)):At(G,p,g)),N(!0)},"aria-haspopup":"dialog","aria-expanded":w,id:s,"aria-label":c,"aria-labelledby":o,"aria-describedby":[Y?I:void 0,l?W:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":w?E:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(m?" min-w-0 flex-1 justify-start":""),children:[
89
89
  /* @__PURE__ */de("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */de("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
90
  /* @__PURE__ */de("span",{className:"truncate",children:le||y})]}),v&&(e||t)&&/* @__PURE__ */de("button",{type:"button",onClick:ae,"aria-label":f.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:"×"})]}),Y&&/* @__PURE__ */de("span",{id:I,className:"sr-only",children:oe}),l&&/* @__PURE__ */de("span",{id:W,className:"sr-only",children:f.required}),i&&/* @__PURE__ */ue(he,{children:[
91
91
  /* @__PURE__ */de("input",{type:"hidden",name:i.from,value:e}),
@@ -104,18 +104,18 @@ return ue("div",{className:"relative"+(m?" w-full":""),ref:P,children:[
104
104
  /* @__PURE__ */ue("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[v&&/* @__PURE__ */de("button",{type:"button",onClick:ae,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:f.clear}),
105
105
  /* @__PURE__ */de("button",{type:"button",onClick:()=>N(!1),className:"px-3 py-1.5 text-sm text-gray-600 border border-gray-300 rounded-md hover:bg-gray-50",children:f.cancel}),
106
106
  /* @__PURE__ */de("button",{type:"button",onClick:()=>{r(k,C),N(!1)},disabled:!k||!C,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:f.apply})]})]}),document.body)]})}var It=/^\d{2}:\d{2}(:\d{2})?$/,Wt=e=>String(e).padStart(2,"0");function Rt(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Wt(e.getHours())}:${Wt(e.getMinutes())}`;return t?`${r}:${Wt(e.getSeconds())}`:r}return It.test(e)?e:""}var Ot=Y(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:s,...o},c){const d=null!=s&&Number(s)<60,u=F();/* @__PURE__ */
107
- return de("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":a||void 0,value:Rt(e,d),min:Rt(r,d)||void 0,max:Rt(n,d)||void 0,onChange:e=>t?.(It.test(e.target.value)?e.target.value:null),className:ve({invalid:a,size:l,className:i}),...o})}),Ht=/^\d{4}-\d{2}-\d{2}$/,_t=/^(aria|data)-/,qt=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Ut(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Dt(e);if(Ht.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Dt(t)}function Vt(e){if(!Ht.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function Kt(e,t){const r=Vt(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Yt=Y(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:i,weekStartsOn:s,className:o="","aria-label":c,"aria-describedby":u,"aria-labelledby":h,id:m,name:p,disabled:g,placeholder:f,required:x,clearable:b,form:y,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:M,...$},C){const L=b??!x,j=Ut(e),z=Ut(r),P=Ut(n),B=T().datePicker,E=F(),I=d(E),[W,R]=Z(!1),O=X(null),H=X(null),q=X(null),U=J(),V=J(),K=J(),Y=Be(H,W,{popupRef:q}),[G,ee]=Z(!1);_(()=>{const e=!!m&&(H.current?.labels?.length??0)>0;e!==G&&ee(e)});const te=!c&&(!!h||G);if(Q(()=>{if(!W)return;const e=e=>{const t=e.target;O.current?.contains(t)||q.current?.contains(t)||R(!1)};document.addEventListener("pointerdown",e,!0);const t=S(()=>R(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[W]),Q(()=>{if(W)return D(e=>"Escape"===e.key&&(R(!1),H.current?.focus(),!0))},[W]),i)/* @__PURE__ */
108
- return de("input",{ref:C,type:"date",lang:E,id:m,name:p,disabled:g,"aria-label":c,"aria-describedby":u,"aria-invalid":a||void 0,value:j,min:z||void 0,max:P||void 0,onChange:e=>t?.(Vt(e.target.value)),className:ve({invalid:a,size:l,className:o}),"aria-labelledby":h,required:x,form:y,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:M,...$});const re=Object.fromEntries(Object.entries($).filter(([e])=>_t.test(e)&&!qt.has(e))),ne=$["aria-required"],ae=!!x||!0===ne||"true"===ne,le=[te?V:void 0,ae?K:void 0,u].filter(Boolean).join(" ")||void 0,ie=Dt(/* @__PURE__ */new Date),se=(!z||ie>=z)&&(!P||ie<=P),oe=f??B.placeholder;/* @__PURE__ */
107
+ return de("input",{ref:c,type:"time",lang:u,step:s,"aria-invalid":a||void 0,value:Rt(e,d),min:Rt(r,d)||void 0,max:Rt(n,d)||void 0,onChange:e=>t?.(It.test(e.target.value)?e.target.value:null),className:ve({invalid:a,size:l,className:i}),...o})}),Ht=/^\d{4}-\d{2}-\d{2}$/,_t=/^(aria|data)-/,qt=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Ut(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Pt(e);if(Ht.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Pt(t)}function Vt(e){if(!Ht.test(e))return null;const[t,r,n]=e.split("-").map(Number),a=new Date(t,r-1,n);return a.getMonth()===r-1&&a.getDate()===n?a:null}function Kt(e,t){const r=Vt(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Yt=Y(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:i,weekStartsOn:s,className:o="","aria-label":c,"aria-describedby":u,"aria-labelledby":h,id:m,name:p,disabled:g,placeholder:f,required:x,clearable:b,form:y,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:M,...$},C){const L=b??!x,j=Ut(e),z=Ut(r),D=Ut(n),B=T().datePicker,E=F(),I=d(E),[W,R]=Z(!1),O=J(null),H=J(null),q=J(null),U=X(),V=X(),K=X(),Y=Be(H,W,{popupRef:q}),[G,ee]=Z(!1);_(()=>{const e=!!m&&(H.current?.labels?.length??0)>0;e!==G&&ee(e)});const te=!c&&(!!h||G);if(Q(()=>{if(!W)return;const e=e=>{const t=e.target;O.current?.contains(t)||q.current?.contains(t)||R(!1)};document.addEventListener("pointerdown",e,!0);const t=S(()=>R(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[W]),Q(()=>{if(W)return P(e=>"Escape"===e.key&&(R(!1),H.current?.focus(),!0))},[W]),i)/* @__PURE__ */
108
+ return de("input",{ref:C,type:"date",lang:E,id:m,name:p,disabled:g,"aria-label":c,"aria-describedby":u,"aria-invalid":a||void 0,value:j,min:z||void 0,max:D||void 0,onChange:e=>t?.(Vt(e.target.value)),className:ve({invalid:a,size:l,className:o}),"aria-labelledby":h,required:x,form:y,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:M,...$});const re=Object.fromEntries(Object.entries($).filter(([e])=>_t.test(e)&&!qt.has(e))),ne=$["aria-required"],ae=!!x||!0===ne||"true"===ne,le=[te?V:void 0,ae?K:void 0,u].filter(Boolean).join(" ")||void 0,ie=Pt(/* @__PURE__ */new Date),se=(!z||ie>=z)&&(!D||ie<=D),oe=f??B.placeholder;/* @__PURE__ */
109
109
  return ue("div",{ref:O,className:"relative",children:[
110
110
  /* @__PURE__ */de("input",{ref:C,type:"hidden",name:p,form:y,value:j}),
111
111
  /* @__PURE__ */ue("button",{ref:H,type:"button",...re,id:m,disabled:g,title:v,tabIndex:w,autoFocus:N,onFocus:k,onBlur:M,"aria-haspopup":"dialog","aria-expanded":W,"aria-controls":W?U:void 0,"aria-labelledby":h,"aria-describedby":le,"aria-label":c?`${c}${j?`, ${Kt(j,I)}`:""}`:void 0,onClick:()=>R(e=>!e),className:`${ve({invalid:a,size:l,className:o})} flex items-center justify-between text-left`,children:[
112
112
  /* @__PURE__ */de("span",{className:j?"text-gray-900":"text-gray-400",children:j?Kt(j,I):oe}),
113
113
  /* @__PURE__ */de("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__ */de("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"})})]}),te&&/* @__PURE__ */de("span",{id:V,className:"sr-only",children:j?Kt(j,I):oe}),ae&&/* @__PURE__ */de("span",{id:K,className:"sr-only",children:B.required}),W&&me(
114
114
  /* @__PURE__ */ue("div",{ref:q,id:U,role:"dialog","aria-label":c??B.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:A.popup,left:Y?.left,right:Y?.right,top:Y?.top,bottom:Y?.bottom,maxWidth:Y?.maxWidth,visibility:Y?void 0:"hidden"},children:[
115
- /* @__PURE__ */de(Lt,{value:j||null,min:z||null,max:P||null,weekStartsOn:s,onSelect:e=>{R(!1),H.current?.focus(),t?.(Vt(e))}}),(L||se)&&/* @__PURE__ */ue("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[L&&/* @__PURE__ */de("button",{type:"button",onClick:()=>{R(!1),H.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:B.clear}),se&&/* @__PURE__ */de("button",{type:"button",onClick:()=>{R(!1),H.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:B.today})]})]}),document.body)]})}),Gt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Zt=e=>String(e).padStart(2,"0");function Xt(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Zt(t.getMonth()+1)}-${Zt(t.getDate())}T${Zt(t.getHours())}:${Zt(t.getMinutes())}`:Gt.test(e)?e:"";var t}var Jt=Y(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...s},o){const c=F();/* @__PURE__ */
116
- return de("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:Xt(e),min:Xt(r)||void 0,max:Xt(n)||void 0,onChange:e=>t?.(function(e){if(!Gt.test(e))return null;const[t,r]=e.split("T"),[n,a,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(n,a-1,l,i,s,o);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:ve({invalid:a,size:l,className:i}),...s})});function Qt(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 n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function er(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()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function tr(e,t,r){const a=await er(t,r),l=I().copy;return a?n.success(l.copiedLabel(e)):n.error(l.failed),a}var rr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},nr={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 ar(){/* @__PURE__ */
115
+ /* @__PURE__ */de(Lt,{value:j||null,min:z||null,max:D||null,weekStartsOn:s,onSelect:e=>{R(!1),H.current?.focus(),t?.(Vt(e))}}),(L||se)&&/* @__PURE__ */ue("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[L&&/* @__PURE__ */de("button",{type:"button",onClick:()=>{R(!1),H.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:B.clear}),se&&/* @__PURE__ */de("button",{type:"button",onClick:()=>{R(!1),H.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:B.today})]})]}),document.body)]})}),Gt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Zt=e=>String(e).padStart(2,"0");function Jt(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Zt(t.getMonth()+1)}-${Zt(t.getDate())}T${Zt(t.getHours())}:${Zt(t.getMinutes())}`:Gt.test(e)?e:"";var t}var Xt=Y(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...s},o){const c=F();/* @__PURE__ */
116
+ return de("input",{ref:o,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:Jt(e),min:Jt(r)||void 0,max:Jt(n)||void 0,onChange:e=>t?.(function(e){if(!Gt.test(e))return null;const[t,r]=e.split("T"),[n,a,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(n,a-1,l,i,s,o);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:ve({invalid:a,size:l,className:i}),...s})});function Qt(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 n=0;n<t.rangeCount&&!e;n++)e=t.getRangeAt(n).intersectsNode(r);if(!e)return null}const n=t.toString();if(!n.trim())return null;const a=document.createElement("div");for(let e=0;e<t.rangeCount;e++)a.appendChild(t.getRangeAt(e).cloneContents());return{text:n,html:a.innerHTML}}async function er(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()},n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.addEventListener("copy",r);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",r),n.remove()}}async function tr(e,t,r){const a=await er(t,r),l=I().copy;return a?n.success(l.copiedLabel(e)):n.error(l.failed),a}var rr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},nr={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 ar(){/* @__PURE__ */
117
117
  return de("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */de("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 lr(){/* @__PURE__ */
118
- return de("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */de("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function ir({value:e,children:t,symbol:r,label:a,size:l="md",variant:i="bordered",hideCopyButton:s=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Z(!1),g=X(null),f=T().copy;Q(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=G(async()=>{await er(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):n.error(f.failed)},[e,o,f]),{box:b,button:y}=nr[l],v=!s;/* @__PURE__ */
118
+ return de("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */de("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function ir({value:e,children:t,symbol:r,label:a,size:l="md",variant:i="bordered",hideCopyButton:s=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Z(!1),g=J(null),f=T().copy;Q(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=G(async()=>{await er(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):n.error(f.failed)},[e,o,f]),{box:b,button:y}=nr[l],v=!s;/* @__PURE__ */
119
119
  return ue("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",rr[i],b,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
120
120
  /* @__PURE__ */de("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__ */ue(he,{children:[
121
121
  /* @__PURE__ */de(pe,{id:d,"aria-label":a?f.copyLabel(a):f.copy,"aria-describedby":u,onClick:x,className:`${y} text-gray-400`,children:/* @__PURE__ */de(m?lr:ar,{})}),
@@ -123,13 +123,13 @@ return ue("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-
123
123
  return ue("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[dr.map(t=>/* @__PURE__ */de(b,{size:"touch-xl",variant:"secondary",onClick:()=>s(or(e,t)),children:t},t)),
124
124
  /* @__PURE__ */de(b,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>s(cr(e)),children:"⌫"}),r&&/* @__PURE__ */de(b,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var hr={md:"h-24 p-3",lg:"h-32 p-4"},mr=Y(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...s},o){/* @__PURE__ */
125
125
  return ue("button",{ref:o,type:l,disabled:a,"aria-pressed":n||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",n?"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)]",hr[r],i].filter(Boolean).join(" "),...s,children:[
126
- /* @__PURE__ */de("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */de("span",{className:"text-sm text-gray-500",children:t})]})}),pr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},gr="bg-white text-gray-900 shadow-sm rosh-segmented-on",fr="text-gray-600 hover:text-gray-900";function xr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:s="","aria-labelledby":o,"aria-describedby":c}){const d={"aria-label":o?void 0:i,"aria-labelledby":o,"aria-describedby":c},u=J(),h=`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(),m="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
126
+ /* @__PURE__ */de("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */de("span",{className:"text-sm text-gray-500",children:t})]})}),pr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},gr="bg-white text-gray-900 shadow-sm rosh-segmented-on",fr="text-gray-600 hover:text-gray-900";function xr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:s="","aria-labelledby":o,"aria-describedby":c}){const d={"aria-label":o?void 0:i,"aria-labelledby":o,"aria-describedby":c},u=X(),h=`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(),m="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(l?"flex-1":"");/* @__PURE__ */
127
127
  return de("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const l=`${u}-${r.value}`,i=r.value===e;
128
128
  /* @__PURE__ */
129
129
  return ue("label",{htmlFor:l,title:r.title,className:[m,"relative",pr[a],i?gr:fr,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
130
130
  /* @__PURE__ */de("input",{id:l,type:"radio",name:n,value:r.value,checked:i,disabled:r.disabled,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),r.icon,r.label]},r.value)})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e;/* @__PURE__ */
131
- return ue("button",{type:"button",title:r.title,"aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:[m,pr[a],n?gr:fr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value)})})}var br={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},yr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},vr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},wr=Y(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=J(),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__ */de("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",br[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */de("span",{className:["inline-block rounded-full bg-white shadow transition-transform",yr[n],e?vr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */ue("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
132
- /* @__PURE__ */ue("span",{className:"min-w-0",children:[a&&/* @__PURE__ */de("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */de("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */de("span",{id:x,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */de("span",{className:s,children:y})}),Nr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function kr(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var Mr=Y(function({value:e,onChange:t,min:r,max:n,precision:a,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]=Z(()=>Nr(e,a)),y=X(x);y.current=x,Q(()=>{kr(y.current)!==e&&b(Nr(e,a))},[e,a]);const v=/* @__PURE__ */de("input",{ref:f,id:h,name:m,type:"text",inputMode:0===a?"numeric":"decimal",value:x,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?void 0:Nr(e,a),"aria-invalid":s||void 0,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(b(r),t(kr(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=(kr(y.current)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const s=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),b(Nr(i,a)),t(i)})(o))},onBlur:()=>{const e=kr(x);if(null==e)b(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n),null!=a&&(l=Number(l.toFixed(a))),b(Nr(l,a)),l!==e&&t(l)}g?.()},className:ve({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */ue("div",{className:"relative",children:[d&&/* @__PURE__ */de("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__ */de("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):v}),$r=Y(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:d=!1,label:u,hint:h,error:m,required:p,className:g=""},f){const x=J(),b=T().files,y=s({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:d,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=m?`${x}-error`:h?`${x}-hint`:void 0;/* @__PURE__ */
131
+ return ue("button",{type:"button",title:r.title,"aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:[m,pr[a],n?gr:fr,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value)})})}var br={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},yr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},vr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},wr=Y(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:s="",disabledReason:o,disabledReasonId:c,...d},u){const h=X(),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__ */de("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",br[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */de("span",{className:["inline-block rounded-full bg-white shadow transition-transform",yr[n],e?vr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */ue("span",{className:`flex items-start gap-3 ${s}`.trim(),children:[y,
132
+ /* @__PURE__ */ue("span",{className:"min-w-0",children:[a&&/* @__PURE__ */de("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */de("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */de("span",{id:x,className:"mt-0.5 block text-xs text-red-600",children:o})]})]}):/* @__PURE__ */de("span",{className:s,children:y})}),Nr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function kr(e){const t=e.trim();if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}var Mr=Y(function({value:e,onChange:t,min:r,max:n,precision:a,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]=Z(()=>Nr(e,a)),y=J(x);y.current=x,Q(()=>{kr(y.current)!==e&&b(Nr(e,a))},[e,a]);const v=/* @__PURE__ */de("input",{ref:f,id:h,name:m,type:"text",inputMode:0===a?"numeric":"decimal",value:x,disabled:i,placeholder:o,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?void 0:Nr(e,a),"aria-invalid":s||void 0,onChange:e=>{var r;(""===(r=e.target.value)||/^-?\d*\.?\d*$/.test(r))&&(b(r),t(kr(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=(kr(y.current)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const s=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(s)),b(Nr(i,a)),t(i)})(o))},onBlur:()=>{const e=kr(x);if(null==e)b(""),t(null);else{let l=e;null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n),null!=a&&(l=Number(l.toFixed(a))),b(Nr(l,a)),l!==e&&t(l)}g?.()},className:ve({invalid:s,size:c,className:[d?"pl-7":"",u?"pr-9":"","text-right tabular-nums",p].filter(Boolean).join(" ")})});return d||u?/* @__PURE__ */ue("div",{className:"relative",children:[d&&/* @__PURE__ */de("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__ */de("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:u})]}):v}),$r=Y(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:d=!1,label:u,hint:h,error:m,required:p,className:g=""},f){const x=X(),b=T().files,y=s({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:d,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=m?`${x}-error`:h?`${x}-hint`:void 0;/* @__PURE__ */
133
133
  return ue(Ve,{label:u,htmlFor:x,hint:h,error:m,required:p,className:g,children:[
134
134
  /* @__PURE__ */ue("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:nt(y.dragOver,d,`px-4 py-6 ${at(d)}`),children:[
135
135
  /* @__PURE__ */ue("span",{children:[
@@ -145,25 +145,25 @@ return ue("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWid
145
145
  /* @__PURE__ */de("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),
146
146
  /* @__PURE__ */de("path",{d:"M14 3v5h5"})]})}function jr({intake:e,dropLabel:t,className:r="",children:n}){const a=T().files;/* @__PURE__ */
147
147
  return ue("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
148
- /* @__PURE__ */de("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */de("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??a.drop})]})}function zr({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=T().files,l=X(/* @__PURE__ */new Map);Q(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Q(()=>()=>{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__ */de("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
148
+ /* @__PURE__ */de("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */de("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??a.drop})]})}function zr({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=T().files,l=J(/* @__PURE__ */new Map);Q(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Q(()=>()=>{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__ */de("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
149
149
  return ue("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__ */de("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */de("span",{className:"text-gray-400",children:/* @__PURE__ */de(Lr,{})}),
150
150
  /* @__PURE__ */de("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
151
- /* @__PURE__ */de("span",{className:"shrink-0 tabular-nums text-gray-400",children:o(e.size,a)}),t&&/* @__PURE__ */de("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.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__ */de(ct,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Pr({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=T().files,i=n??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */ue("span",{className:"relative inline-flex",children:[
152
- /* @__PURE__ */de(pe,{"aria-label":s,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */de(Cr,{})}),t>0&&/* @__PURE__ */de("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__ */de(b,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */de(Cr,{}),children:s})}function Dr({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,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:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),x=X([]);return Q(()=>{m&&f.rejections.length>0&&f.rejections!==x.current&&(x.current=f.rejections,m(f.rejections))},[f.rejections,m]),/* @__PURE__ */ue(jr,{intake:f,dropLabel:o,className:p,children:[g,
151
+ /* @__PURE__ */de("span",{className:"shrink-0 tabular-nums text-gray-400",children:o(e.size,a)}),t&&/* @__PURE__ */de("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.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__ */de(ct,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Dr({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=T().files,i=n??l.attach,s=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */ue("span",{className:"relative inline-flex",children:[
152
+ /* @__PURE__ */de(pe,{"aria-label":s,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */de(Cr,{})}),t>0&&/* @__PURE__ */de("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__ */de(b,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */de(Cr,{}),children:s})}function Pr({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,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:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),x=J([]);return Q(()=>{m&&f.rejections.length>0&&f.rejections!==x.current&&(x.current=f.rejections,m(f.rejections))},[f.rejections,m]),/* @__PURE__ */ue(jr,{intake:f,dropLabel:o,className:p,children:[g,
153
153
  /* @__PURE__ */de(zr,{files:e,disabled:i,onRemove:r=>{f.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
154
154
  /* @__PURE__ */ue("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
155
- /* @__PURE__ */de(Pr,{onClick:f.open,count:e.length,variant:u,label:d,disabled:i}),h]}),
155
+ /* @__PURE__ */de(Dr,{onClick:f.open,count:e.length,variant:u,label:d,disabled:i}),h]}),
156
156
  /* @__PURE__ */de(c,{rejections:f.rejections})]})}function Sr({onClear:e,ariaLabel:t}){/* @__PURE__ */
157
- return de("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 Ar({value:e,onChange:t,options:r,placeholder:n,emptyOptionLabel:a,className:l="",disabled:i,id:s,allowFreeText:o=!1,onSearchChange:c,rightAdornment:d}){const[u,h]=Z(!1),[m,p]=Z(""),g=T(),f=a??g.select.none,x=e=>{p(e),c?.(e)},b=X(null),y=X(null),v=X(null),w=X(null),N=X(u);N.current=u;const k=X(!1),M=r=>{if(!N.current)return;N.current=!1;const n=m.trim();r&&o&&n&&n!==e&&t(n),h(!1),x("")},[C,L]=Z(null);_(()=>{if(!d||u)return void L(null);const t=w.current?.offsetWidth??0;L(t?t+(e&&!i?32:8)+6:null)});const j=Be(y,u,{matchTriggerWidth:!0}),z=te(()=>{const t=r.find(t=>t.value===e);return t?t.label:o?e:""},[r,e,o]);Q(()=>{if(!u)return;const e=e=>{const t=e.target;b.current?.contains(t)||v.current?.contains(t)||M(!0)};document.addEventListener("mousedown",e);const t=S(()=>M(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[u,o,m,e,t]),Q(()=>{if(u)return D(e=>!("Escape"!==e.key||!N.current)&&(M(!1),y.current?.blur(),!0))},[u]);const P=te(()=>{const e=/* @__PURE__ */new Set,t=[];for(const n of r)e.has(n.value)||(e.add(n.value),t.push(n));return t},[r]),B=te(()=>{if(c)return P;const e=m.trim().toLowerCase();return e?P.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):P},[P,m,c]);/* @__PURE__ */
157
+ return de("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 Ar({value:e,onChange:t,options:r,placeholder:n,emptyOptionLabel:a,className:l="",disabled:i,id:s,allowFreeText:o=!1,onSearchChange:c,rightAdornment:d}){const[u,h]=Z(!1),[m,p]=Z(""),g=T(),f=a??g.select.none,x=e=>{p(e),c?.(e)},b=J(null),y=J(null),v=J(null),w=J(null),N=J(u);N.current=u;const k=J(!1),M=r=>{if(!N.current)return;N.current=!1;const n=m.trim();r&&o&&n&&n!==e&&t(n),h(!1),x("")},[C,L]=Z(null);_(()=>{if(!d||u)return void L(null);const t=w.current?.offsetWidth??0;L(t?t+(e&&!i?32:8)+6:null)});const j=Be(y,u,{matchTriggerWidth:!0}),z=te(()=>{const t=r.find(t=>t.value===e);return t?t.label:o?e:""},[r,e,o]);Q(()=>{if(!u)return;const e=e=>{const t=e.target;b.current?.contains(t)||v.current?.contains(t)||M(!0)};document.addEventListener("mousedown",e);const t=S(()=>M(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[u,o,m,e,t]),Q(()=>{if(u)return P(e=>!("Escape"!==e.key||!N.current)&&(M(!1),y.current?.blur(),!0))},[u]);const D=te(()=>{const e=/* @__PURE__ */new Set,t=[];for(const n of r)e.has(n.value)||(e.add(n.value),t.push(n));return t},[r]),B=te(()=>{if(c)return D;const e=m.trim().toLowerCase();return e?D.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):D},[D,m,c]);/* @__PURE__ */
158
158
  return ue("div",{ref:b,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(b.current?.contains(t)||v.current?.contains(t))||k.current||document.activeElement!==y.current&&M(!0)},children:[
159
159
  /* @__PURE__ */de("input",{id:s,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":u,value:u?m:z,onChange:e=>{x(e.target.value),h(!0)},onFocus:()=>{i||(x(""),h(!0))},onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),1===B.length?(t(B[0].value),M(!1)):o&&m.trim()&&(t(m.trim()),M(!1),y.current?.blur())):"Escape"===e.key?(M(!1),y.current?.blur()):"Tab"===e.key&&M(!0)},placeholder:n||f,className:`${be} ${l} ${e?"pr-8":""} ${i?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:C?{paddingRight:C}:void 0,disabled:i}),e&&!i&&/* @__PURE__ */de(Sr,{ariaLabel:g.select.clear,onClear:()=>{t(""),M(!1)}}),d&&!u&&/* @__PURE__ */de("div",{ref:w,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&&me(
160
160
  /* @__PURE__ */de("div",{ref:v,onMouseDownCapture:()=>{k.current=!0,setTimeout(()=>{k.current=!1},0)},className:"fixed rounded-2xl overflow-hidden",style:{zIndex:A.popup,left:j?.left,right:j?.right,top:j?.top,bottom:j?.bottom,minWidth:j?.minWidth,width:j?.width,visibility:j?void 0:"hidden",...$()},children:/* @__PURE__ */de("div",{className:"overflow-y-auto",style:{maxHeight:j?.maxHeight??Me},children:0===B.length?/* @__PURE__ */de("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:g.select.noMatches}):B.map(r=>/* @__PURE__ */ue("button",{type:"button",onMouseDown:()=>{t(r.value),M(!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:[
161
- /* @__PURE__ */de("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.sublabel&&/* @__PURE__ */de("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:r.sublabel})]},r.value))})}),document.body)]})}function Br({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:s,className:o=""}){const[c,d]=Z(!1),[u,h]=Z(""),m=T(),p=X(null),g=X(null),f=X(null),x=Be(p,c),b=e=>r.find(t=>t.value===e)?.label??e,y=te(()=>{const t=new Set(e),n=[],a=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!e.label.toLowerCase().includes(a)||n.push(e));return n},[r,e,u]),v=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},w=r=>t(e.filter(e=>e!==r)),N=()=>{const e=u.trim();a&&e?v(e):h("")},k=X(()=>{});k.current=()=>{N(),d(!1)},Q(()=>{if(!c)return;const e=e=>{const t=e.target;p.current?.contains(t)||f.current?.contains(t)||(N(),d(!1))};document.addEventListener("mousedown",e);const t=S(()=>k.current());return()=>{document.removeEventListener("mousedown",e),t()}});const M=r.length>0;/* @__PURE__ */
161
+ /* @__PURE__ */de("span",{className:"min-w-0 flex-1 truncate",children:r.label}),r.sublabel&&/* @__PURE__ */de("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:r.sublabel})]},r.value))})}),document.body)]})}function Br({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:s,className:o=""}){const[c,d]=Z(!1),[u,h]=Z(""),m=T(),p=J(null),g=J(null),f=J(null),x=Be(p,c),b=e=>r.find(t=>t.value===e)?.label??e,y=te(()=>{const t=new Set(e),n=[],a=u.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!e.label.toLowerCase().includes(a)||n.push(e));return n},[r,e,u]),v=r=>{r&&!e.includes(r)?(t([...e,r]),h("")):h("")},w=r=>t(e.filter(e=>e!==r)),N=()=>{const e=u.trim();a&&e?v(e):h("")},k=J(()=>{});k.current=()=>{N(),d(!1)},Q(()=>{if(!c)return;const e=e=>{const t=e.target;p.current?.contains(t)||f.current?.contains(t)||(N(),d(!1))};document.addEventListener("mousedown",e);const t=S(()=>k.current());return()=>{document.removeEventListener("mousedown",e),t()}});const M=r.length>0;/* @__PURE__ */
162
162
  return ue("div",{ref:p,className:"relative",children:[
163
163
  /* @__PURE__ */ue("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),g.current?.focus())},className:ve({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__ */ue("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:[
164
164
  /* @__PURE__ */de("span",{className:"truncate",children:b(e)}),!i&&/* @__PURE__ */de("button",{type:"button","aria-label":m.select.removeItem?.(b(e))??`${m.select.remove} ${b(e)}`,onClick:()=>w(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)),
165
165
  /* @__PURE__ */de("input",{id:s,ref:g,type:"text",autoComplete:"off",role:"combobox","aria-expanded":c&&M,"aria-invalid":l||void 0,disabled:i,value:u,placeholder:0===e.length?n:void 0,onChange:e=>{h(e.target.value),d(!0)},onFocus:()=>{!i&&M&&d(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=u.trim(),r=e?y.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?v(r[0].value):N()}else"Backspace"===t.key&&""===u&&e.length>0?w(e[e.length-1]):"Escape"===t.key?(d(!1),h(""),g.current?.blur()):"Tab"===t.key&&(N(),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&&M&&me(
166
- /* @__PURE__ */de("div",{ref:f,className:"fixed rounded-2xl overflow-hidden",style:{zIndex:A.popup,left:x?.left,right:x?.right,top:x?.top,bottom:x?.bottom,minWidth:x?.minWidth,maxWidth:x?.maxWidth??ke,width:"max-content",visibility:x?void 0:"hidden",...$()},children:/* @__PURE__ */de("div",{className:"overflow-y-auto",style:{maxHeight:x?.maxHeight??Me},children:0===y.length?/* @__PURE__ */de("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}):y.map(e=>/* @__PURE__ */de("button",{type:"button",onMouseDown:t=>{t.preventDefault(),v(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 Fr={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 Tr({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":s,className:o="",bodyClassName:c="",style:d}){const u=Fr[a??(n?"md":"none")],h=J(),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__ */
166
+ /* @__PURE__ */de("div",{ref:f,className:"fixed rounded-2xl overflow-hidden",style:{zIndex:A.popup,left:x?.left,right:x?.right,top:x?.top,bottom:x?.bottom,minWidth:x?.minWidth,maxWidth:x?.maxWidth??ke,width:"max-content",visibility:x?void 0:"hidden",...$()},children:/* @__PURE__ */de("div",{className:"overflow-y-auto",style:{maxHeight:x?.maxHeight??Me},children:0===y.length?/* @__PURE__ */de("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}):y.map(e=>/* @__PURE__ */de("button",{type:"button",onMouseDown:t=>{t.preventDefault(),v(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 Fr={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 Tr({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":s,className:o="",bodyClassName:c="",style:d}){const u=Fr[a??(n?"md":"none")],h=X(),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__ */
167
167
  return ue(f,{className:x,style:d,...m?{"aria-labelledby":h}:g?{"aria-label":s}:{},children:[null!=t&&(null!=i?
168
168
  /* @__PURE__ */ue("div",{className:`${b} flex items-center justify-between gap-3`,children:[m?/* @__PURE__ */de(p,{id:h,children:t}):/* @__PURE__ */de("span",{children:t}),i]}):m?
169
169
  /* @__PURE__ */de(p,{id:h,className:b,children:t}):/* @__PURE__ */de("div",{className:b,children:t})),
@@ -177,8 +177,8 @@ return de(l,{className:[Ir[t],Wr[r],Rr[n],a?"block truncate":"",i].filter(Boolea
177
177
  return de(`h${t}`,{className:[Hr[t],Ir[r],n].filter(Boolean).join(" "),children:e})}function qr({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
178
178
  return de("p",{className:[Ir[t],Wr[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var Ur={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},Vr={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Kr={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function Yr({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
179
179
  return de("div",{className:["flex flex-col",Ur[t],r?Vr[r]:"",n?Kr[n]:"",a].filter(Boolean).join(" "),children:e})}function Gr({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
180
- return de("div",{className:["flex",a?"flex-wrap":"",Ur[t],Vr[r],n?Kr[n]:"",l].filter(Boolean).join(" "),children:e})}var Zr={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Xr={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"},Jr={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 Qr({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
181
- return de("div",{className:["grid",Zr[t],r?Xr[r]:"",n?Jr[n]:"",Ur[a],l].filter(Boolean).join(" "),children:e})}var en={sm:"my-2",md:"my-4",lg:"my-6"};function tn({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=J();if("vertical"===e)/* @__PURE__ */
180
+ return de("div",{className:["flex",a?"flex-wrap":"",Ur[t],Vr[r],n?Kr[n]:"",l].filter(Boolean).join(" "),children:e})}var Zr={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Jr={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"},Xr={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 Qr({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
181
+ return de("div",{className:["grid",Zr[t],r?Jr[r]:"",n?Xr[n]:"",Ur[a],l].filter(Boolean).join(" "),children:e})}var en={sm:"my-2",md:"my-4",lg:"my-6"};function tn({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=X();if("vertical"===e)/* @__PURE__ */
182
182
  return de("span",{role:"presentation",className:`inline-block h-full min-h-[1em] w-px shrink-0 self-stretch bg-gray-200 ${a}`.trim()});if(!t)/* @__PURE__ */
183
183
  return de("hr",{className:`border-0 border-t border-gray-200 ${en[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",s="right"===r?"w-4 shrink-0":"flex-1";
184
184
  /* @__PURE__ */
@@ -209,17 +209,17 @@ return ue("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-s
209
209
  /* @__PURE__ */de("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */de(Mn,{tone:e})}),null==l?/* @__PURE__ */de("div",{className:"min-w-0 flex-1 text-sm",children:p}):
210
210
  /* @__PURE__ */ue("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
211
211
  /* @__PURE__ */de("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
212
- /* @__PURE__ */de("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */de("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__ */de("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var Cn=(e,t)=>`${e}-tab-${t}`,Ln=(e,t)=>`${e}-panel-${t}`,jn={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 zn(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 Pn({items:e,value:t,onChange:r,variant:n="underline",idPrefix:a,className:l="","aria-label":i,"aria-labelledby":s}){const o=X([]),c=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}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__ */
212
+ /* @__PURE__ */de("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */de("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__ */de("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var Cn=(e,t)=>`${e}-tab-${t}`,Ln=(e,t)=>`${e}-panel-${t}`,jn={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 zn(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 Dn({items:e,value:t,onChange:r,variant:n="underline",idPrefix:a,className:l="","aria-label":i,"aria-labelledby":s}){const o=J([]),c=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}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
213
  return de("div",{role:"tablist","aria-label":i,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=c(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=c(a,-1);else if("Home"===n.key)l=d(1);else{if("End"!==n.key)return;l=d(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),o.current[l]?.focus())},className:`${jn[n]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t;/* @__PURE__ */
214
- return ue("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:a?Cn(a,e.id):void 0,"aria-controls":a?Ln(a,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:zn(n,i),children:[e.icon&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var Dn=()=>/* @__PURE__ */de("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function Sn({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
215
- return de("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,s=/* @__PURE__ */de("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"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */de(Dn,{}):n+1}),o=/* @__PURE__ */ue("span",{className:"min-w-0 text-center",children:[
214
+ return ue("button",{ref:e=>{o.current[l]=e},type:"button",role:"tab",id:a?Cn(a,e.id):void 0,"aria-controls":a?Ln(a,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:zn(n,i),children:[e.icon&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var Pn=()=>/* @__PURE__ */de("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function Sn({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
215
+ return de("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,s=/* @__PURE__ */de("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"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */de(Pn,{}):n+1}),o=/* @__PURE__ */ue("span",{className:"min-w-0 text-center",children:[
216
216
  /* @__PURE__ */de("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */de("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
217
217
  return ue("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */ue("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__ */ue("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 An({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,s]=Z(t),o=r??i;/* @__PURE__ */
218
218
  return de("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
219
  return ue("div",{children:[
220
220
  /* @__PURE__ */ue("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=o.includes(e)?o.filter(t=>t!==e):a?[...o,e]:[e];void 0===r&&s(t),n?.(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
221
  /* @__PURE__ */de("span",{children:e.title}),
222
- /* @__PURE__ */de("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__ */de("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */de("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var Bn={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 Fn({content:e,side:t="top",delay:r=200,children:n}){const[a,l]=Z(!1),[i,s]=Z(null),o=X(void 0),c=X(null),d=X(null),u=J(),h=()=>{o.current=window.setTimeout(()=>l(!0),r)},m=()=>{window.clearTimeout(o.current),l(!1)};Q(()=>()=>window.clearTimeout(o.current),[]),_(()=>{if(!a)return void s(null);const e=()=>{const e=c.current,r=d.current;if(!e||!r)return;const n=Ce(e),a=Math.max(0,n.right-n.left-16),l=Math.max(0,n.bottom-n.top-16);r.style.maxWidth=`${a}px`,r.style.maxHeight=`${l}px`;const i=r.getBoundingClientRect();if(i.width<=0||i.height<=0)return;const o=e.getBoundingClientRect();if(!function(e){const t=e.getBoundingClientRect();if(t.width<=0&&t.height<=0&&0===t.left&&0===t.top)return null;const r=$e(),n={left:Math.max(r.left,t.left),right:Math.min(r.right,t.right),top:Math.max(r.top,t.top),bottom:Math.min(r.bottom,t.bottom)};let a=getComputedStyle(e).position;for(let t=e.parentElement;t&&t!==document.documentElement&&"fixed"!==a;t=t.parentElement){const e=getComputedStyle(t);if("absolute"===a&&"static"===e.position)continue;a=e.position;const r=Le.has(e.overflowX),l=Le.has(e.overflowY);if(!r&&!l)continue;const i=t.getBoundingClientRect();i.width<=0&&i.height<=0||(r&&(n.left=Math.max(n.left,i.left),n.right=Math.min(n.right,i.right)),l&&(n.top=Math.max(n.top,i.top),n.bottom=Math.min(n.bottom,i.bottom)))}return n.right>=n.left&&n.bottom>=n.top?n:null}(e))return void m();const u=function(e,t,r,n,a){const l=Pe(e,n,a),i=e=>l[e]-("top"===e||"bottom"===e?t.height:t.width),s=[r,je[r],...ze[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-a-t.height;break;case"bottom":u=c-t.width/2,h=e.bottom+a;break;case"left":u=e.left-a-t.width,h=d-t.height/2;break;case"right":u=e.right+a,h=d-t.height/2}return{side:o,left:De(u,n.left+8,n.right-8-t.width),top:De(h,n.top+8,n.bottom-8-t.height)}}(o,i,t,n,12),h=function(e,t,r,n,a){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]<a)return null;const d=(e,t,r)=>r<2*n?t+r/2:Math.max(t+n,Math.min(e,t+r-n)),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),p={anchor:{left:o.left,top:o.top,width:o.width,height:o.height},left:u.left-o.left,top:u.top-o.top,maxWidth:a,maxHeight:l,side:u.side,arrow:h&&{left:h.x-o.left,top:h.y-o.top}};s(e=>{return e&&(r=p,(t=e).anchor.left===r.anchor.left&&t.anchor.top===r.anchor.top&&t.anchor.width===r.anchor.width&&t.anchor.height===r.anchor.height&&t.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:p;var t,r})};return e(),Se(()=>c.current,e)},[a,t,e]),Q(()=>{if(a)return D(e=>"Escape"===e.key&&(m(),!0))},[a]);const p=a?u:void 0,g=ne(n)?ae(n,{"aria-describedby":[n.props["aria-describedby"],p].filter(Boolean).join(" ")||void 0}):n,f=a?$():void 0,x=a?C():void 0;/* @__PURE__ */
222
+ /* @__PURE__ */de("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__ */de("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */de("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var Bn={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 Fn({content:e,side:t="top",delay:r=200,children:n}){const[a,l]=Z(!1),[i,s]=Z(null),o=J(void 0),c=J(null),d=J(null),u=X(),h=()=>{o.current=window.setTimeout(()=>l(!0),r)},m=()=>{window.clearTimeout(o.current),l(!1)};Q(()=>()=>window.clearTimeout(o.current),[]),_(()=>{if(!a)return void s(null);const e=()=>{const e=c.current,r=d.current;if(!e||!r)return;const n=Ce(e),a=Math.max(0,n.right-n.left-16),l=Math.max(0,n.bottom-n.top-16);r.style.maxWidth=`${a}px`,r.style.maxHeight=`${l}px`;const i=r.getBoundingClientRect();if(i.width<=0||i.height<=0)return;const o=e.getBoundingClientRect();if(!function(e){const t=e.getBoundingClientRect();if(t.width<=0&&t.height<=0&&0===t.left&&0===t.top)return null;const r=$e(),n={left:Math.max(r.left,t.left),right:Math.min(r.right,t.right),top:Math.max(r.top,t.top),bottom:Math.min(r.bottom,t.bottom)};let a=getComputedStyle(e).position;for(let t=e.parentElement;t&&t!==document.documentElement&&"fixed"!==a;t=t.parentElement){const e=getComputedStyle(t);if("absolute"===a&&"static"===e.position)continue;a=e.position;const r=Le.has(e.overflowX),l=Le.has(e.overflowY);if(!r&&!l)continue;const i=t.getBoundingClientRect();i.width<=0&&i.height<=0||(r&&(n.left=Math.max(n.left,i.left),n.right=Math.min(n.right,i.right)),l&&(n.top=Math.max(n.top,i.top),n.bottom=Math.min(n.bottom,i.bottom)))}return n.right>=n.left&&n.bottom>=n.top?n:null}(e))return void m();const u=function(e,t,r,n,a){const l=De(e,n,a),i=e=>l[e]-("top"===e||"bottom"===e?t.height:t.width),s=[r,je[r],...ze[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-a-t.height;break;case"bottom":u=c-t.width/2,h=e.bottom+a;break;case"left":u=e.left-a-t.width,h=d-t.height/2;break;case"right":u=e.right+a,h=d-t.height/2}return{side:o,left:Pe(u,n.left+8,n.right-8-t.width),top:Pe(h,n.top+8,n.bottom-8-t.height)}}(o,i,t,n,12),h=function(e,t,r,n,a){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]<a)return null;const d=(e,t,r)=>r<2*n?t+r/2:Math.max(t+n,Math.min(e,t+r-n)),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),p={anchor:{left:o.left,top:o.top,width:o.width,height:o.height},left:u.left-o.left,top:u.top-o.top,maxWidth:a,maxHeight:l,side:u.side,arrow:h&&{left:h.x-o.left,top:h.y-o.top}};s(e=>{return e&&(r=p,(t=e).anchor.left===r.anchor.left&&t.anchor.top===r.anchor.top&&t.anchor.width===r.anchor.width&&t.anchor.height===r.anchor.height&&t.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:p;var t,r})};return e(),Se(()=>c.current,e)},[a,t,e]),Q(()=>{if(a)return P(e=>"Escape"===e.key&&(m(),!0))},[a]);const p=a?u:void 0,g=ne(n)?ae(n,{"aria-describedby":[n.props["aria-describedby"],p].filter(Boolean).join(" ")||void 0}):n,f=a?$():void 0,x=a?C():void 0;/* @__PURE__ */
223
223
  return ue("span",{ref:c,className:"relative inline-flex","aria-describedby":ne(n)?void 0:p,onMouseEnter:h,onMouseLeave:m,onFocus:h,onBlur:m,children:[g,a&&me(
224
224
  /* @__PURE__ */ue("span",{className:"pointer-events-none fixed left-0 top-0",style:{zIndex:A.popup,...i?.anchor},children:[
225
225
  /* @__PURE__ */de("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?"":Bn[t]}`,style:{...f,...i&&{left:i.left,top:i.top,maxWidth:i.maxWidth,maxHeight:i.maxHeight}},children:e}),(!i||i.arrow)&&
@@ -231,23 +231,23 @@ return ue("div",{className:`flex flex-col items-center justify-center text-cente
231
231
  return ue("div",{className:"mb-6",children:[s&&s.length>0&&/* @__PURE__ */de(e,{items:s,className:"mb-3"}),
232
232
  /* @__PURE__ */ue("div",{className:"flex items-start justify-between gap-4",children:[
233
233
  /* @__PURE__ */ue("div",{children:[
234
- /* @__PURE__ */ue("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */de("span",{className:"shrink-0 text-gray-400",children:i}),t]}),o&&/* @__PURE__ */de("p",{className:"mt-1 text-sm text-gray-500",children:o})]}),c&&/* @__PURE__ */de("div",{className:"flex items-center gap-2",children:c})]})]})}var Un=["success","warning","danger"];function Vn(e){return"string"==typeof e&&Un.includes(e)}function Kn(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Yn(t),a=Yn(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Yn(e){return null!=e&&Number.isFinite(e)?e:null}var Gn={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 Zn=/* @__PURE__ */new Set;function Xn(e,t){if(null==e)return null;if(Vn(e))return Gn[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}`;Zn.has(r)||(Zn.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Un.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 Jn({at:e,title:t,className:r}){/* @__PURE__ */
235
- return de("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Qn=e=>Math.min(100,Math.max(0,e));function ea({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:s,emptyLabel:o,size:c="sm",ariaLabel:d,className:u=""}){const h=T().meter,m=F(),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.`,Zn.has(x)||(Zn.add(x),console.error(b)));const y=Xn(l,"MetricBar"),v=null!=g?y??(null==(w=Kn(g,n,a))?null:Gn[w]):null;var w;const N=Yn(n),k=Yn(a),M=null!=g&&null!=f?Qn(g/f*100):0,$=null!=g?(s??(e=>100===f?O(e,1,m):W(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",j=null!=g&&null!=f,z=/* @__PURE__ */ue("div",{...j?{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":$}:{"aria-hidden":!0},className:j&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[j&&
236
- /* @__PURE__ */de("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */de(Jn,{at:Qn(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */de(Jn,{at:Qn(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),P=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
234
+ /* @__PURE__ */ue("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */de("span",{className:"shrink-0 text-gray-400",children:i}),t]}),o&&/* @__PURE__ */de("p",{className:"mt-1 text-sm text-gray-500",children:o})]}),c&&/* @__PURE__ */de("div",{className:"flex items-center gap-2",children:c})]})]})}var Un=["success","warning","danger"];function Vn(e){return"string"==typeof e&&Un.includes(e)}function Kn(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=Yn(t),a=Yn(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function Yn(e){return null!=e&&Number.isFinite(e)?e:null}var Gn={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 Zn=/* @__PURE__ */new Set;function Jn(e,t){if(null==e)return null;if(Vn(e))return Gn[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}`;Zn.has(r)||(Zn.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${Un.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 Xn({at:e,title:t,className:r}){/* @__PURE__ */
235
+ return de("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var Qn=e=>Math.min(100,Math.max(0,e));function ea({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:s,emptyLabel:o,size:c="sm",ariaLabel:d,className:u=""}){const h=T().meter,m=F(),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.`,Zn.has(x)||(Zn.add(x),console.error(b)));const y=Jn(l,"MetricBar"),v=null!=g?y??(null==(w=Kn(g,n,a))?null:Gn[w]):null;var w;const N=Yn(n),k=Yn(a),M=null!=g&&null!=f?Qn(g/f*100):0,$=null!=g?(s??(e=>100===f?O(e,1,m):W(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=N||null!=k),L="md"===c?"h-2":"h-1.5",j=null!=g&&null!=f,z=/* @__PURE__ */ue("div",{...j?{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":$}:{"aria-hidden":!0},className:j&&v?`relative mt-2 ${L} rounded-full bg-gray-200`:`relative mt-2 ${L} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[j&&
236
+ /* @__PURE__ */de("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=N&&/* @__PURE__ */de(Xn,{at:Qn(N/f*100),title:h.warningAt(N),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=k&&/* @__PURE__ */de(Xn,{at:Qn(k/f*100),title:h.criticalAt(k),className:"bg-gray-500"})]}),D=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
237
237
  return ue("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */de("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
238
238
  /* @__PURE__ */ue("div",{className:"mt-1 flex items-baseline gap-2",children:[
239
- /* @__PURE__ */de("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${P}`,children:$}),
239
+ /* @__PURE__ */de("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${D}`,children:$}),
240
240
  /* @__PURE__ */de("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),z]}:{className:u,children:[
241
241
  /* @__PURE__ */ue("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */de("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
242
- /* @__PURE__ */de("span",{className:`text-sm font-semibold tabular-nums ${P}`,children:$}),
243
- /* @__PURE__ */de("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),z]})}function ta(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function ra(e,t){const r=ta(e);if(null==r)return"no-reading";const n=ta(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var na=e=>Math.min(100,Math.max(0,e));function aa({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=T().meter,h=F(),m=l??(e=>function(e,t=E.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=ta(t),x=ta(r),b=null!=x&&x>0?x:null,y=ta(n)??0,v="over"===ra(t,r),w=null!=b?b+y:null,N=null!=b&&null!=w?na(b/w*100):null,k=v&&y>0,M=null==w||null==f?0:v?k?N??0:0:na(f/w*100),$=k?N??0:0,C=v?k&&null!=w&&null!=f?na(f/w*100):100:0,L=Math.max(0,C-$),j=null!=f&&null!=b?f/b*100:null,z=null!=j?O(Math.round(j),0,h):null!=f?m(f):"—",P=a??(null==f?p:null==b?g:`${m(f)} / ${m(b)}`),D="md"===o?"h-2":"h-1.5",S=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",A=null!=f&&null!=b&&null!=w?/* @__PURE__ */ue("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(z),className:`relative mt-2 ${D} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */de("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${M}%`}}),L>0&&/* @__PURE__ */de("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${$}%`,width:`${L}%`}}),y>0&&null!=N&&/* @__PURE__ */de("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
242
+ /* @__PURE__ */de("span",{className:`text-sm font-semibold tabular-nums ${D}`,children:$}),
243
+ /* @__PURE__ */de("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),z]})}function ta(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function ra(e,t){const r=ta(e);if(null==r)return"no-reading";const n=ta(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var na=e=>Math.min(100,Math.max(0,e));function aa({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:s,size:o="sm",ariaLabel:c,className:d=""}){const u=T().meter,h=F(),m=l??(e=>function(e,t=E.meter){const r=Math.round(e),n=Math.floor(r/3600),a=Math.floor(r%3600/60),l=r%60;return n>0?t.hoursMinutes(n,a):a>0?t.minutesSeconds(a,l):t.seconds(l)}(e,u)),p=i??u.noReading,g=s??u.noBudget,f=ta(t),x=ta(r),b=null!=x&&x>0?x:null,y=ta(n)??0,v="over"===ra(t,r),w=null!=b?b+y:null,N=null!=b&&null!=w?na(b/w*100):null,k=v&&y>0,M=null==w||null==f?0:v?k?N??0:0:na(f/w*100),$=k?N??0:0,C=v?k&&null!=w&&null!=f?na(f/w*100):100:0,L=Math.max(0,C-$),j=null!=f&&null!=b?f/b*100:null,z=null!=j?O(Math.round(j),0,h):null!=f?m(f):"—",D=a??(null==f?p:null==b?g:`${m(f)} / ${m(b)}`),P="md"===o?"h-2":"h-1.5",S=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",A=null!=f&&null!=b&&null!=w?/* @__PURE__ */ue("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(z),className:`relative mt-2 ${P} overflow-hidden rounded-full bg-gray-200`,children:[(!v||k)&&/* @__PURE__ */de("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${M}%`}}),L>0&&/* @__PURE__ */de("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${$}%`,width:`${L}%`}}),y>0&&null!=N&&/* @__PURE__ */de("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${N}%`}})]}):null;/* @__PURE__ */
244
244
  return ue("div","md"===o?{className:d,children:[null!=e&&/* @__PURE__ */de("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
245
245
  /* @__PURE__ */ue("div",{className:"mt-1 flex items-baseline gap-2",children:[
246
246
  /* @__PURE__ */de("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${S}`,children:z}),
247
- /* @__PURE__ */de("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:P})]}),A]}:{className:d,children:[
247
+ /* @__PURE__ */de("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:D})]}),A]}:{className:d,children:[
248
248
  /* @__PURE__ */ue("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */de("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
249
249
  /* @__PURE__ */de("span",{className:`text-sm font-semibold tabular-nums ${S}`,children:z}),
250
- /* @__PURE__ */de("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:P})]}),A]})}var la=864e5;function ia(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 sa(e,t){return h(new Date(e).toISOString().slice(0,10),{locale:t})}var oa=(e,t)=>`${e}-fill-${t}`,ca=e=>`${e}-glow`,da=e=>`${e}-reveal`,ua=e=>`${e}-ground`;function ha(e,t,r,n){return"solid"===r?n:`url(#${oa(e,t)})`}function ma(e){return"solid"===e?void 0:"4 3"}function pa({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=oa(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
250
+ /* @__PURE__ */de("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:D})]}),A]})}var la=864e5;function ia(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 sa(e,t){return h(new Date(e).toISOString().slice(0,10),{locale:t})}var oa=(e,t)=>`${e}-fill-${t}`,ca=e=>`${e}-glow`,da=e=>`${e}-reveal`,ua=e=>`${e}-ground`;function ha(e,t,r,n){return"solid"===r?n:`url(#${oa(e,t)})`}function ma(e){return"solid"===e?void 0:"4 3"}function pa({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=oa(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
251
251
  return ue("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
252
252
  /* @__PURE__ */de("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
253
253
  /* @__PURE__ */de("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const s=/* @__PURE__ */de("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */ue("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
@@ -282,7 +282,7 @@ return de("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:va[e]})}funct
282
282
  return ue("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
283
283
  /* @__PURE__ */de("path",{d:"M4.2 2.2v11.6"}),
284
284
  /* @__PURE__ */de("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function ka(){/* @__PURE__ */
285
- return de("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */de("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Ma=1e-6;function $a(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,n),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-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 n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-Ma||(a+=r-n[e],n[e]=r);if(a<=Ma)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Ma&&(l+=n[e]-r);if(l<=Ma)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Ma||(n[e]-=i*(n[e]-r)/l);return n}(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]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[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:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function Ca(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var La="mixed";function ja(e,t){return 5.6*Math.max(e.length,t.length)+8}var za=(e,t,r)=>Math.min(Math.max(e,t),r),Pa=e=>-(Math.cos(Math.PI*e)-1)/2;function Da(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)*Pa(t);return{px:r,ms:e.msByPx(r)}}var Sa={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 Aa(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Ba=e=>5.6*e.length,Fa={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:{}},Ta={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Ea(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:Fa[t].glyph??(r?"flag":void 0)}function Ia(e,t,r=!1){const n=Fa[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function Wa(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Ra="undefined"==typeof document?Q:ce;function Oa(e,t){const[r,n]=Z(0);return Ra(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function Ha(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),s=i-l,o=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;o.push(Math.max(28,t,a[e+1]-a[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<a.length;r++){if(e>a[r+1]){t+=b[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*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<a.length;r++){if(!(e>t+b[r]))return a[r]+(b[r]>0?(e-t)/b[r]*(a[r+1]-a[r]):0);t+=b[r]}return i})(t)),inCut:e.inCut}}function _a(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 qa({marks:e,innerRef:t}){/* @__PURE__ */
285
+ return de("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */de("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Ma=1e-6;function $a(e,t,r={}){const n=Number.isFinite(t)&&t>0?t:0,a=Array.from(new Set(e.filter(e=>Number.isFinite(e)))).sort((e,t)=>e-t);if(n<=0||a.length<2){const e=a[0]??0;return{anchorsMs:a,xs:a.map(()=>0),gaps:[],xByMs:()=>0,msByPx:()=>e,inCut:()=>!1}}const l=a[a.length-1]-a[0],i=r.maxTimeShare??.3,s=Math.min(r.breakPx??48,n),o=r.minGapPx??48,c=[],d=[],u=[];for(let e=0;e+1<a.length;e++){const t=a[e+1]-a[e];c.push(t),d.push(l>0?t/l*n:0),u.push(l>0&&t/l>i)}const h=u.filter(Boolean).length,m=Math.max(0,n-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 n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-Ma||(a+=r-n[e],n[e]=r);if(a<=Ma)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Ma&&(l+=n[e]-r);if(l<=Ma)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Ma||(n[e]-=i*(n[e]-r)/l);return n}(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]=n;const w=v.slice(0,-1).map((e,t)=>({fromMs:a[t],toMs:a[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:a,xs:v,gaps:w,xByMs:e=>{if(!Number.isFinite(e)||e<=a[0])return 0;if(e>=a[a.length-1])return n;for(let t=0;t+1<a.length;t++){if(e>a[t+1])continue;const r=a[t+1]-a[t],n=r>0?(e-a[t])/r:0;return v[t]+n*(v[t+1]-v[t])}return n},msByPx:e=>{const t=Math.min(Math.max(Number.isFinite(e)?e:0,0),n);for(let e=0;e+1<a.length;e++){if(t>v[e+1]&&e+2<a.length)continue;const r=v[e+1]-v[e],n=r>0?(t-v[e])/r:0;return a[e]+n*(a[e+1]-a[e])}return a[a.length-1]},inCut:e=>w.some(t=>t.compressed&&e>t.fromMs&&e<t.toMs)}}function Ca(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var La="mixed";function ja(e,t){return 5.6*Math.max(e.length,t.length)+8}var za=(e,t,r)=>Math.min(Math.max(e,t),r),Da=e=>-(Math.cos(Math.PI*e)-1)/2;function Pa(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)*Da(t);return{px:r,ms:e.msByPx(r)}}var Sa={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 Aa(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Ba=e=>5.6*e.length,Fa={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:{}},Ta={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Ea(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:Fa[t].glyph??(r?"flag":void 0)}function Ia(e,t,r=!1){const n=Fa[e],a=["rosh-tl-node","rosh-tl-mark",`is-${t}`];n.diamond&&a.push("is-diamond"),r&&a.push("is-provisional");const l="current"===t?"var(--tl-accent)":n.token??"var(--tl-accent)",i="dot"===t||r?{borderColor:l,color:l}:{backgroundColor:l,color:"var(--tl-on-kind)"};return{className:a.join(" "),style:i}}function Wa(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Ra="undefined"==typeof document?Q:ce;function Oa(e,t){const[r,n]=Z(0);return Ra(()=>{const r=t?e.current:null;if(!r)return;const a=()=>{const e=r.getBoundingClientRect().width;e>0&&n(e)};if(a(),"undefined"==typeof ResizeObserver)return;const l=new ResizeObserver(a);return l.observe(r),()=>{l.disconnect()}},[e,t]),r}function Ha(e,t,r){const n=/* @__PURE__ */new Map;for(const e of t)Number.isFinite(e.x)&&n.set(e.x,Math.max(n.get(e.x)??0,e.widthPx));const a=[...n.keys()].sort((e,t)=>e-t);if(r<=0||a.length<2)return e;const l=Math.max(0,a[0]),i=Math.min(r,a[a.length-1]),s=i-l,o=[];for(let e=0;e+1<a.length;e++){const t=(n.get(a[e])??0)/2+(n.get(a[e+1])??0)/2+8;o.push(Math.max(28,t,a[e+1]-a[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<a.length;r++){if(e>a[r+1]){t+=b[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*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<a.length;r++){if(!(e>t+b[r]))return a[r]+(b[r]>0?(e-t)/b[r]*(a[r+1]-a[r]):0);t+=b[r]}return i})(t)),inCut:e.inCut}}function _a(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 qa({marks:e,innerRef:t}){/* @__PURE__ */
286
286
  return de("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */ue("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
287
287
  /* @__PURE__ */de("span",{className:"rosh-tl-name",children:e.label}),
288
288
  /* @__PURE__ */de("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function Ua({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=T().timeline,i=d(F()),s=n.ruler,o=[],c=[],u=r.gaps.filter(e=>e.compressed),h=new Date(e);h.setUTCDate(h.getUTCDate()+(8-h.getUTCDay())%7);for(let e=h.getTime();e<t;e+=7*la){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*la)-t<14||o.push(
@@ -319,7 +319,7 @@ return ue("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
319
319
  /* @__PURE__ */de("i",{className:`rosh-tl-start${n?" is-around":""}${s}`,style:{left:"0px",top:`${e.rail+3}px`,...o}}),null!=t&&!1!==t&&/* @__PURE__ */de("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__ */de("span",{className:`rosh-tl-edge is-end${s}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...o},children:r})]})}function Za({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=T().timeline;/* @__PURE__ */
320
320
  return ue("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
321
321
  /* @__PURE__ */de("div",{className:"rosh-tl-todayline"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${t.laneA}px`,height:t.ruler+20-t.laneA+"px",...a?{animationDelay:"420ms"}:{}}}),
322
- /* @__PURE__ */de("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${Ca(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Xa({nodes:e,geo:t,reveal:r}){const n=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),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=Ba(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__ */de("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */de("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 Ja({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
322
+ /* @__PURE__ */de("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${Ca(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function Ja({nodes:e,geo:t,reveal:r}){const n=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),a=[];let l=null;const i=()=>{l&&(a.push({x:(l.from+l.to)/2,text:l.first===l.last?l.first:`${l.first}–${l.last}`}),l=null)};for(const e of n){const t=e.first===e.last?e.first:`${e.first}–${e.last}`,r=Ba(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__ */de("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */de("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 Xa({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
323
323
  return ue("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
324
324
  /* @__PURE__ */de("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
325
325
  /* @__PURE__ */ue("span",{className:"rosh-tl-phase-label text-gray-500",style:{left:`${n+a/2}px`,top:`${t.laneB+t.laneH+5}px`},children:[e.label," · parallel"]})]})}function Qa({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=T().timeline,s=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),o=e.find(e=>e.key===a)??e.find(e=>s(e,n))??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:ja(d,u),m=c?.onOpen;/* @__PURE__ */
@@ -339,19 +339,19 @@ return ue("div",{children:[
339
339
  /* @__PURE__ */de("p",{className:"rosh-tl-popover-head",children:w.text}),
340
340
  /* @__PURE__ */de("ol",{children:w.group.members.map(e=>/* @__PURE__ */ue("li",{children:[
341
341
  /* @__PURE__ */de("span",{children:e.label}),
342
- /* @__PURE__ */de("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function tl({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=T().timeline,p=F(),g=X(!1),f=c?c.px:n.xByMs(t),x=c?c.ms:t,b=_a(e.stops),y=b?b.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},N=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},M=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 n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?za((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},$=e.valueText?e.valueText(x):sa(x,p),C=Math.max(1,Math.round((i-l)/la));/* @__PURE__ */
342
+ /* @__PURE__ */de("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function tl({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:s,layerRef:o,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=T().timeline,p=F(),g=J(!1),f=c?c.px:n.xByMs(t),x=c?c.ms:t,b=_a(e.stops),y=b?b.indexOf(t):-1,v=e=>{const r=o.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},N=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},k=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},M=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 n=r[e],a=r[e+1];if(t<n.ms||t>a.ms)continue;const l=a.ms-n.ms;return{fromKey:n.key,toKey:a.key,t:l>0?za((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},$=e.valueText?e.valueText(x):sa(x,p),C=Math.max(1,Math.round((i-l)/la));/* @__PURE__ */
343
343
  return ue(he,{children:[
344
344
  /* @__PURE__ */de("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:M,onPointerUp:k,onPointerCancel:k}),
345
345
  /* @__PURE__ */de("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${Ca(f,88,s)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(x):sa(x,p)}),
346
- /* @__PURE__ */de("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:C,"aria-valuenow":b&&b.length>0?Math.max(0,y):Math.round((t-l)/la),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:M,onPointerUp:k,onPointerCancel:k,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 n=(e.shiftKey?7:1)*la;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function rl(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function nl({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],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:f=null,motion:x=!0,ariaLabel:b,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===o,k=U(Date.now,null),M=U(Aa,!1),$=s??k,C=X(null),L=T().timeline,j=F(),z=e=>sa(e,j),P=X(null),S=X(null),A=X(null),B=X(/* @__PURE__ */new Map),E=X(void 0),I=X(void 0),W=X(null),[R,O]=Z({}),[H,_]=Z(null),[q,V]=Z(null),[K,Y]=Z(null),[ee,te]=Z(null),[re,ne]=Z(null),[ae,le]=Z(null),ie=J(),se=J(),oe=Oa(C,!0),ce=oe>0?oe-(l.length>0&&!N?176:0):0,me=ce>0&&ce-20<320,pe=Oa(P,!me),ge=pe>0?pe:600,fe=Sa[o],xe=N&&l.length>0,be=xe?Math.max(0,ge-36):ge,ye=r=>r>=e-la&&r<=t+la,ve=n.filter(e=>Number.isFinite(e.ms)&&ye(e.ms)).slice().sort((e,t)=>e.ms-t.ms),we="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=$a([e,...[...ve.map(e=>e.ms),...we].filter(r=>r>e&&r<t),t],be,"compressed"===(ke=r)?{}:"spread"===ke?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var ke;const Me=Ne.xByMs,$e=ve.filter(e=>!e.provisional),Le=g??($e.length>0?$e[$e.length-1].key:null),je=ve.map((e,t)=>{const r=e.date??z(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Ta[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:Me(e.ms),baseX:Me(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Ea(e,a,0===t&&"default"===a),role:e.key===Le?"current":n?"dot":"key",widthPx:N?Math.max(16,Ba(e.caption??"")+6):R[e.key]||ja(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),ze=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&ye(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=z(t);return{key:r,ms:t,x:Me(t),baseX:Me(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Fa[e.kind].glyph,role:"key",widthPx:R[r]||ja(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Pe=xe?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+la,x:ge,baseX:ge,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],De=N&&w&&!xe?[{key:w.key,ms:t,x:be,baseX:be,kind:"default",label:w.label,dateText:w.dateText??z(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...je,...ze,...Pe,...De].sort((e,t)=>e.x-t.x||e.ms-t.ms),Ae=m?.start??L.start(z(e)),Be=null==Ae||!1===Ae?0:"string"==typeof Ae?Math.ceil(Ba(Ae)):96,Fe="lanes"===o?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||s)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Se):[],Te=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:La,members:t})}n=a}return r}(Se),Ee=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Te)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Ee(e));const We=K??ee??re,Re=Fe.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===We)??Te.find(e=>"cluster"===e.type&&Ee(e)===We),Oe=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(Oe):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Oe):[],_e=He.length>1?Ha(Ne,He,be):Ne,qe=_e!==Ne;if(qe)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const Ue=Se.some(e=>e.x<14),Ve=qe&&Re?We:null,Ke=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=me?Se.map(Ke):Te.flatMap(e=>{if("item"===e.type)return[Ke(e.mark)];const t=Ee(e);if(t===Ve&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ke);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ge.set(t.key,e.key);const Ze=Te.find(e=>"cluster"===e.type&&Ee(e)===Ve),Xe=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,Je=X(Ve),[Qe,et]=Z(!1);Q(()=>{if(Je.current===Ve)return;Je.current=Ve,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ve]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Ra(()=>{const e=S.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(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("|")}`,[nt,at]=Z(rt),lt=x&&nt===rt;Q(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),st=_a(u?.stops),ot=r=>{const n=Math.min(Math.max(r,e),t);if(!st)return n;let a=st[0];for(const e of st)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?ot(u.valueMs):null,dt=h&&u?je.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,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:za(350*u/100,450,1400)/n;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:M}),[ht,mt]=Z(null),pt=X(null),gt=X({segments:ut,value:ct,playback:h});Q(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=X(null),xt=G(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),bt=G(()=>{pt.current=null,mt(null),xt(null),gt.current.playback?.onStop?.()},[xt]),yt=!!h?.playing&&!!u;Q(()=>{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,n=0;const a=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},a(Da(t,0))):bt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Da(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Da(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=Da(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Pa(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:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(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(),n=requestAnimationFrame(s)):bt()};return l(),n=requestAnimationFrame(s),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,xt(null))}},[yt,bt,xt]);const vt=je.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===$?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,$):null,Nt=new Set(y??[]),kt=Se.filter(e=>Nt.has(e.key)).map(e=>e.x),Mt=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,$t=G(()=>{clearTimeout(E.current),clearTimeout(I.current),_(null),V(null),Y(null),te(null),ne(null)},[]);Q(()=>()=>{clearTimeout(E.current),clearTimeout(I.current)},[]),Q(()=>{const e=W.current;e&&(W.current=null,B.current.get(e)?.focus())});const Ct=null!==q||null!==K||null!==ee||null!==re;Q(()=>{if(Ct)return D(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=G((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ge-r)):t;const a=e.parentElement;if(r>0&&a){const t=Ce(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,s=t.right-8-r-l;i<=s&&(n=Math.max(i,Math.min(n,s)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[ge]),jt=Ye.find(e=>e.key===q)??null,zt=jt?jt.x:0;Ra(()=>{Lt(A.current,zt)},[Lt,q,zt]);const Pt=ct??void 0,Dt=X(null);Q(()=>{if(void 0===Pt)return;const e=_e.xByMs(Pt),t=Dt.current;if(Dt.current=e,null===t||e<=t)return;const r=[];for(const n of Se){if(n.x<=t||n.x>e)continue;const a=B.current.get(Ge.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const St=Ye.map(e=>e.key),At=Le?Ge.get(Le)??null:null,Bt=ae&&St.includes(ae)?ae:At&&St.includes(At)?At:St[0],Ft=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(),le(St[r]),B.current.get(St[r])?.focus())},Tt=()=>clearTimeout(I.current),Et=e=>{Tt(),ne(e)},It=()=>{clearTimeout(I.current),I.current=setTimeout(()=>ne(null),260)},Wt=e=>{Ve&&Ie.get(e)===Ve?Tt():(Tt(),ne(null))},Rt=e=>{clearTimeout(E.current),_(e),V(e),v?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Ot=e=>{_(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>V(t=>t===e?null:t),160),v?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Wa(e),"aria-describedby":q===e.key?ie:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{Wt(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Wt(e.key),Rt(e.key),le(e.key)},onBlur:()=>{It(),Ot(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=L,r.events(t.length,t.map(Wa))),"aria-describedby":q===e.key?ie:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{e.openable?Et(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Tt(),Rt(e.key),le(e.key)},onBlur:()=>{It(),Ot(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Et(e.key);const r=e.members[0];le(r.key),W.current=r.key}};var t,r},qt="lanes"!==o||Se.length>1;if(me)/* @__PURE__ */
346
+ /* @__PURE__ */de("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:C,"aria-valuenow":b&&b.length>0?Math.max(0,y):Math.round((t-l)/la),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:M,onPointerUp:k,onPointerCancel:k,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 n=(e.shiftKey?7:1)*la;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function rl(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function nl({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],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:f=null,motion:x=!0,ariaLabel:b,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===o,k=U(Date.now,null),M=U(Aa,!1),$=s??k,C=J(null),L=T().timeline,j=F(),z=e=>sa(e,j),D=J(null),S=J(null),A=J(null),B=J(/* @__PURE__ */new Map),E=J(void 0),I=J(void 0),W=J(null),[R,O]=Z({}),[H,_]=Z(null),[q,V]=Z(null),[K,Y]=Z(null),[ee,te]=Z(null),[re,ne]=Z(null),[ae,le]=Z(null),ie=X(),se=X(),oe=Oa(C,!0),ce=oe>0?oe-(l.length>0&&!N?176:0):0,me=ce>0&&ce-20<320,pe=Oa(D,!me),ge=pe>0?pe:600,fe=Sa[o],xe=N&&l.length>0,be=xe?Math.max(0,ge-36):ge,ye=r=>r>=e-la&&r<=t+la,ve=n.filter(e=>Number.isFinite(e.ms)&&ye(e.ms)).slice().sort((e,t)=>e.ms-t.ms),we="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],Ne=$a([e,...[...ve.map(e=>e.ms),...we].filter(r=>r>e&&r<t),t],be,"compressed"===(ke=r)?{}:"spread"===ke?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var ke;const Me=Ne.xByMs,$e=ve.filter(e=>!e.provisional),Le=g??($e.length>0?$e[$e.length-1].key:null),je=ve.map((e,t)=>{const r=e.date??z(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Ta[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:Me(e.ms),baseX:Me(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Ea(e,a,0===t&&"default"===a),role:e.key===Le?"current":n?"dot":"key",widthPx:N?Math.max(16,Ba(e.caption??"")+6):R[e.key]||ja(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),ze=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&ye(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=z(t);return{key:r,ms:t,x:Me(t),baseX:Me(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Fa[e.kind].glyph,role:"key",widthPx:R[r]||ja(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),De=xe?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+la,x:ge,baseX:ge,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&w&&!xe?[{key:w.key,ms:t,x:be,baseX:be,kind:"default",label:w.label,dateText:w.dateText??z(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...je,...ze,...De,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),Ae=m?.start??L.start(z(e)),Be=null==Ae||!1===Ae?0:"string"==typeof Ae?Math.ceil(Ba(Ae)):96,Fe="lanes"===o?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),s=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||s)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}(Se):[],Te=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:La,members:t})}n=a}return r}(Se),Ee=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Te)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Ee(e));const We=K??ee??re,Re=Fe.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===We)??Te.find(e=>"cluster"===e.type&&Ee(e)===We),Oe=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(Oe):f?Se.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Oe):[],_e=He.length>1?Ha(Ne,He,be):Ne,qe=_e!==Ne;if(qe)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const Ue=Se.some(e=>e.x<14),Ve=qe&&Re?We:null,Ke=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=me?Se.map(Ke):Te.flatMap(e=>{if("item"===e.type)return[Ke(e.mark)];const t=Ee(e);if(t===Ve&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ke);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ge=/* @__PURE__ */new Map;for(const e of Ye)for(const t of e.members)Ge.set(t.key,e.key);const Ze=Te.find(e=>"cluster"===e.type&&Ee(e)===Ve),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=J(Ve),[Qe,et]=Z(!1);Q(()=>{if(Xe.current===Ve)return;Xe.current=Ve,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ve]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Ra(()=>{const e=S.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(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("|")}`,[nt,at]=Z(rt),lt=x&&nt===rt;Q(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),st=_a(u?.stops),ot=r=>{const n=Math.min(Math.max(r,e),t);if(!st)return n;let a=st[0];for(const e of st)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?ot(u.valueMs):null,dt=h&&u?je.filter(e=>!st||st.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,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:za(350*u/100,450,1400)/n;i.push({fromKey:s.key,toKey:o.key,fromMs:s.ms,toMs:o.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:h?.speed,reducedMotion:M}),[ht,mt]=Z(null),pt=J(null),gt=J({segments:ut,value:ct,playback:h});Q(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=J(null),xt=G(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),bt=G(()=>{pt.current=null,mt(null),xt(null),gt.current.playback?.onStop?.()},[xt]),yt=!!h?.playing&&!!u;Q(()=>{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,n=0;const a=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},a(Pa(t,0))):bt()},s=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Pa(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Pa(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=Pa(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Da(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:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(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(),n=requestAnimationFrame(s)):bt()};return l(),n=requestAnimationFrame(s),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,xt(null))}},[yt,bt,xt]);const vt=je.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===$?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,$):null,Nt=new Set(y??[]),kt=Se.filter(e=>Nt.has(e.key)).map(e=>e.x),Mt=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,$t=G(()=>{clearTimeout(E.current),clearTimeout(I.current),_(null),V(null),Y(null),te(null),ne(null)},[]);Q(()=>()=>{clearTimeout(E.current),clearTimeout(I.current)},[]),Q(()=>{const e=W.current;e&&(W.current=null,B.current.get(e)?.focus())});const Ct=null!==q||null!==K||null!==ee||null!==re;Q(()=>{if(Ct)return P(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=G((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ge-r)):t;const a=e.parentElement;if(r>0&&a){const t=Ce(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,s=t.right-8-r-l;i<=s&&(n=Math.max(i,Math.min(n,s)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[ge]),jt=Ye.find(e=>e.key===q)??null,zt=jt?jt.x:0;Ra(()=>{Lt(A.current,zt)},[Lt,q,zt]);const Dt=ct??void 0,Pt=J(null);Q(()=>{if(void 0===Dt)return;const e=_e.xByMs(Dt),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of Se){if(n.x<=t||n.x>e)continue;const a=B.current.get(Ge.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Dt]);const St=Ye.map(e=>e.key),At=Le?Ge.get(Le)??null:null,Bt=ae&&St.includes(ae)?ae:At&&St.includes(At)?At:St[0],Ft=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(),le(St[r]),B.current.get(St[r])?.focus())},Tt=()=>clearTimeout(I.current),Et=e=>{Tt(),ne(e)},It=()=>{clearTimeout(I.current),I.current=setTimeout(()=>ne(null),260)},Wt=e=>{Ve&&Ie.get(e)===Ve?Tt():(Tt(),ne(null))},Rt=e=>{clearTimeout(E.current),_(e),V(e),v?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Ot=e=>{_(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>V(t=>t===e?null:t),160),v?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Wa(e),"aria-describedby":q===e.key?ie:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{Wt(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Wt(e.key),Rt(e.key),le(e.key)},onBlur:()=>{It(),Ot(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=L,r.events(t.length,t.map(Wa))),"aria-describedby":q===e.key?ie:void 0,tabIndex:e.key===Bt?0:-1,ref:t=>{t?B.current.set(e.key,t):B.current.delete(e.key)},onMouseEnter:()=>{e.openable?Et(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Ot(e.key)},onFocus:()=>{Tt(),Rt(e.key),le(e.key)},onBlur:()=>{It(),Ot(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Et(e.key);const r=e.members[0];le(r.key),W.current=r.key}};var t,r},qt="lanes"!==o||Se.length>1;if(me)/* @__PURE__ */
347
347
  return de("div",{ref:C,children:/* @__PURE__ */de(Ka,{marks:Se.filter(e=>!e.isCap),pending:l,currentKey:Le,todayMs:$,reveal:lt,ariaLabel:b,step:it,nodeProps:Ht,onKeyDown:Ft})});const Ut=(e,t)=>null==e||!1===e?null:/* @__PURE__ */de("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:fe.rail-3+"px"},children:e});/* @__PURE__ */
348
348
  return ue("div",{ref:C,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
349
349
  /* @__PURE__ */ue("div",{className:"flex items-stretch gap-3",children:[N&&Ut(Ae,!1),
350
- /* @__PURE__ */de("div",{className:"rosh-tl-stage",style:{height:`${rl(fe,qt,p.length>0&&!N)}px`},children:/* @__PURE__ */ue("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Xe)return;const t=P.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Xe.from&&r<=Xe.to?Tt():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */de(qa,{marks:Se,innerRef:S}),
350
+ /* @__PURE__ */de("div",{className:"rosh-tl-stage",style:{height:`${rl(fe,qt,p.length>0&&!N)}px`},children:/* @__PURE__ */ue("div",{ref:D,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Je)return;const t=D.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Je.from&&r<=Je.to?Tt():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */de(qa,{marks:Se,innerRef:S}),
351
351
  /* @__PURE__ */de(Ya,{axis:_e,geo:fe,fillTo:wt,reveal:lt,trackPx:be,tweened:!!u}),xe&&
352
352
  /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${be}px`,width:ge-be+"px",top:fe.rail+3-1+"px"}}),Mt&&/* @__PURE__ */de("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:fe.rail-7+"px",height:"20px"}}),
353
353
  /* @__PURE__ */de(Ua,{startMs:e,endMs:t,axis:_e,geo:fe,reveal:lt}),
354
- /* @__PURE__ */de(Ga,{geo:fe,caption:N?null:Ae,endCaption:N?null:m?.end,around:Ue,reveal:lt,trackPx:ge}),N&&/* @__PURE__ */de(Xa,{nodes:Ye,geo:fe,reveal:lt}),null!==$&&$>e&&$<=t+la&&/* @__PURE__ */de(Za,{x:_e.xByMs(Math.min($,t)),geo:fe,trackPx:ge,label:z($),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */de(Ja,{phase:e,geo:fe,xOf:_e.xByMs},e.key)),
354
+ /* @__PURE__ */de(Ga,{geo:fe,caption:N?null:Ae,endCaption:N?null:m?.end,around:Ue,reveal:lt,trackPx:ge}),N&&/* @__PURE__ */de(Ja,{nodes:Ye,geo:fe,reveal:lt}),null!==$&&$>e&&$<=t+la&&/* @__PURE__ */de(Za,{x:_e.xByMs(Math.min($,t)),geo:fe,trackPx:ge,label:z($),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */de(Xa,{phase:e,geo:fe,xOf:_e.xByMs},e.key)),
355
355
  /* @__PURE__ */de("ol",{className:"rosh-tl-nodes","aria-label":b,onKeyDown:Ft,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${fe.rail+3}px`,a=lt?ya(t,it):{},l=(e=>!!Mt&&e.x>=Mt.from-.5&&e.x<=Mt.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
356
356
  return de("li",{children:/* @__PURE__ */de("button",{...Ht(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===La,i=Ia(t?"default":e.kind,"key"),s=t?void 0:Fa[e.kind]?.glyph;/* @__PURE__ */
357
357
  return ue("li",{...r(Le)?{"aria-current":"step"}:{},children:[
@@ -365,36 +365,36 @@ return de("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ *
365
365
  /* @__PURE__ */ue("p",{className:"rosh-tl-foldrow",children:[
366
366
  /* @__PURE__ */de("span",{children:e.label}),
367
367
  /* @__PURE__ */de("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */de("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */de("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
368
- /* @__PURE__ */de(tl,{thumb:u,value:ct,snap:ot,axis:_e,geo:fe,startMs:e,endMs:t,trackPx:ge,layerRef:P,glide:ht,onScrub:h?bt:void 0,nodes:dt,onProgress:xt})]})}),N&&Ut(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */de(Va,{pending:l,reveal:lt})]})}function al({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const s=[...r?[/* @__PURE__ */de("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
368
+ /* @__PURE__ */de(tl,{thumb:u,value:ct,snap:ot,axis:_e,geo:fe,startMs:e,endMs:t,trackPx:ge,layerRef:D,glide:ht,onScrub:h?bt:void 0,nodes:dt,onProgress:xt})]})}),N&&Ut(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */de(Va,{pending:l,reveal:lt})]})}function al({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const s=[...r?[/* @__PURE__ */de("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
369
369
  return ue("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
370
370
  /* @__PURE__ */ue("div",{className:"rosh-tl-head",children:[
371
371
  /* @__PURE__ */ue("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */de("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
372
372
  /* @__PURE__ */de("h4",{className:"rosh-tl-title text-gray-800",children:t}),s.length>0&&/* @__PURE__ */de("p",{className:"rosh-tl-meta text-gray-500",children:s.map((e,t)=>
373
373
  /* @__PURE__ */ue(ie,{children:[t>0&&/* @__PURE__ */de("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */de("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */de("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function ll({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:s="card",edgeCaptions:o,highlightKeys:c=null,onHoverChange:d}){const u=U(Date.now,null),h=[],m=[],p=T().timeline,g=F();for(const e of n){const t=ia(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=ia(l??null);let x,b,y=!0;0===h.length?(b=f??u??0,x=b-30*la,y=null!==f||null!==u):(x=h[0].ms,b=f??h[h.length-1].ms,b-x<la&&(b=x+la));const v=h.length>0?Math.max(0,Math.round((b-x)/la)):0,w=a??(v>0?p.duration(v):void 0),N=[h.length>0?p.started(sa(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],k=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}),M={};for(const e of h)e.phase&&(M[e.phase]=M[e.phase]||[]).push(e.ms);const $=Object.entries(M).filter(([,e])=>e.length>=2).map(([e,t])=>({key:e,label:i?.[e]??e,minMs:Math.min(...t),maxMs:Math.max(...t)})),C="rail"===s,L=y&&/* @__PURE__ */de("div",{className:"select-none",children:/* @__PURE__ */de(nl,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:k,pending:m,phases:$,startMs:x,endMs:b,todayMs:u??void 0,edgeCaptions:o,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
374
- return de("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */de(al,{icon:/* @__PURE__ */de(Na,{}),heading:t??e,subject:r,meta:N,children:L})})}var il=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),sl=[{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 ol(e){if(e.order_qty<=0)return 0;let t=0;for(const r of sl)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function cl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+ol(t),0)/t.length}function dl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:s,msPerDayOfPlayback:o=500,markers:c=[]}=e,[d,u]=Z(null),h=T().production;Q(()=>{s?u(new Date(s).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Z(!1),g=X(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};Q(()=>()=>f(),[]),Q(()=>{f()},[i]);const x=t.map(e=>ia(e.date)).filter(e=>null!=e),b=U(Date.now,null)??Math.max(0,...x,...c.map(e=>ia(e.date)??0),ia(r??null)??0,ia(n??null)??0),y=x.length?Math.min(...x):b,v=x.length?Math.max(...x):b,w=ia(r??null)??y,N=ia(n??null)??0,k=il.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=ia(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[N,v,M,w+la];return k||e.push(b),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/la)),L=ia(s??null)??v??w,j=Math.min(Math.max(d??L,w),$),z=t.find(e=>{const t=ia(e.date);return null!=t&&t<=j})??null;let P=null;for(let e=t.length-1;e>=0;e--){const r=ia(t[e].date);if(null!=r&&r>j){P=t[e];break}}const D=(()=>{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:n??null,created_by_name:"",notes:""}})(),S=z??D,A=z?ia(z.date):D?w:null,B=P?ia(P.date):null,F=!!(S&&P&&null!=A&&null!=B&&j>A&&j<B);let E,I;if(F&&null!=A&&null!=B){const e=(j-A)/Math.max(B-A,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of S?.items??[])r[e.part_number]=e;const n={};for(const e of P?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,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=ia(S?.est_completion_date),i=ia(P?.est_completion_date);let s;s=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):S?.est_completion_date||P?.est_completion_date||null,E={id:`interp-${j}`,progress_number:h.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:s,items:a,notes:""},I=S}else if(E=S??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);I=e>=0&&e<t.length-1?t[e+1]:null}else I=null;const W={};for(const e of I?.items??[])W[e.part_number]=e;const R=!(!i||E?.id===i),O=i?Math.min(ia(s??null)??$,$):$,H=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:j,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),s&&u(new Date(s).getTime())},scrubbedAway:R,beforeAnchor:S,nextAfter:P,displayed:E,prevReport:I,prevByPN:W,isInterpolated:F,playing:m,startPlay:()=>{if(m)return void f();if(O<=w)return void u(O);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/o*la,t>=O)return u(O),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:H,estCompletionMs:ia(n??null)}}function ul({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,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=T().production,b=F(),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])),N=y.map(({ms:e})=>e),k=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
375
- return de("div",{className:"select-none",children:/* @__PURE__ */de(nl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,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:a,onChange:i,onDragStart:d,stops:N,ariaLabel:x.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${sa(e,b)}`:sa(e,b)}},ariaLabel:x.label(sa(e,b),sa(t,b))})})}function hl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,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:N,currentReportId:k,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=Z(!1),l=X(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>ia(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=T().production,j=F(),z=i??L.heading,P=e=>sa(e,j);if(0===h.length&&0===m.length)return null;const D=m.filter(e=>"shipment"===e.kind),S=m.filter(e=>"inspection"===e.kind),A=m.filter(e=>"invoice"===e.kind),B=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),E=v?cl(v):0,I=h.find(e=>e.id===k),W=I?o(I):M,R=
374
+ return de("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */de(al,{icon:/* @__PURE__ */de(Na,{}),heading:t??e,subject:r,meta:N,children:L})})}var il=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),sl=[{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 ol(e){if(e.order_qty<=0)return 0;let t=0;for(const r of sl)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function cl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+ol(t),0)/t.length}function dl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:s,msPerDayOfPlayback:o=500,markers:c=[]}=e,[d,u]=Z(null),h=T().production;Q(()=>{s?u(new Date(s).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=Z(!1),g=J(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};Q(()=>()=>f(),[]),Q(()=>{f()},[i]);const x=t.map(e=>ia(e.date)).filter(e=>null!=e),b=U(Date.now,null)??Math.max(0,...x,...c.map(e=>ia(e.date)??0),ia(r??null)??0,ia(n??null)??0),y=x.length?Math.min(...x):b,v=x.length?Math.max(...x):b,w=ia(r??null)??y,N=ia(n??null)??0,k=il.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=ia(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[N,v,M,w+la];return k||e.push(b),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/la)),L=ia(s??null)??v??w,j=Math.min(Math.max(d??L,w),$),z=t.find(e=>{const t=ia(e.date);return null!=t&&t<=j})??null;let D=null;for(let e=t.length-1;e>=0;e--){const r=ia(t[e].date);if(null!=r&&r>j){D=t[e];break}}const P=(()=>{if(z||!D||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:n??null,created_by_name:"",notes:""}})(),S=z??P,A=z?ia(z.date):P?w:null,B=D?ia(D.date):null,F=!!(S&&D&&null!=A&&null!=B&&j>A&&j<B);let E,I;if(F&&null!=A&&null!=B){const e=(j-A)/Math.max(B-A,1),t=(t,r)=>Math.round(t+(r-t)*e),r={};for(const e of S?.items??[])r[e.part_number]=e;const n={};for(const e of D?.items??[])n[e.part_number]=e;const a=Array.from(/* @__PURE__ */new Set([...Object.keys(r),...Object.keys(n)])).map((e,a)=>{const l=r[e]??{},i=n[e]??{},s=e=>Number(e)||0;return{id:`interp-${e}-${a}`,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=ia(S?.est_completion_date),i=ia(D?.est_completion_date);let s;s=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):S?.est_completion_date||D?.est_completion_date||null,E={id:`interp-${j}`,progress_number:h.estimated,date:new Date(j).toISOString().slice(0,10),created_by_name:"",est_completion_date:s,items:a,notes:""},I=S}else if(E=S??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);I=e>=0&&e<t.length-1?t[e+1]:null}else I=null;const W={};for(const e of I?.items??[])W[e.part_number]=e;const R=!(!i||E?.id===i),O=i?Math.min(ia(s??null)??$,$):$,H=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:j,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),s&&u(new Date(s).getTime())},scrubbedAway:R,beforeAnchor:S,nextAfter:D,displayed:E,prevReport:I,prevByPN:W,isInterpolated:F,playing:m,startPlay:()=>{if(m)return void f();if(O<=w)return void u(O);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/o*la,t>=O)return u(O),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:H,estCompletionMs:ia(n??null)}}function ul({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,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=T().production,b=F(),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])),N=y.map(({ms:e})=>e),k=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
375
+ return de("div",{className:"select-none",children:/* @__PURE__ */de(nl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:k,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:a,onChange:i,onDragStart:d,stops:N,ariaLabel:x.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${sa(e,b)}`:sa(e,b)}},ariaLabel:x.label(sa(e,b),sa(t,b))})})}function hl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,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:N,currentReportId:k,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=Z(!1),l=J(!1);return{playing:n,toggle:()=>{n?a(!1):0!==e.length&&(r?.(),l.current||(l.current=!0,t(e[0])),a(!0))},stop:()=>{l.current=!1,a(!1)}}}(h.map(e=>ia(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=T().production,j=F(),z=i??L.heading,D=e=>sa(e,j);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),S=m.filter(e=>"inspection"===e.kind),A=m.filter(e=>"invoice"===e.kind),B=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),E=v?cl(v):0,I=h.find(e=>e.id===k),W=I?o(I):M,R=
376
376
  /* @__PURE__ */ue("button",{type:"button",onClick:C.toggle,"aria-pressed":C.playing,title:C.playing?L.pause:L.playTitle,className:"rosh-tl-play text-gray-700 border-gray-300 hover:text-blue-600 hover:border-blue-600",children:[C.playing?/* @__PURE__ */de("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M2 1.5h2.3v7H2zM5.7 1.5H8v7H5.7z"})}):/* @__PURE__ */de("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M2 1.2 8.4 5 2 8.8z"})}),
377
377
  /* @__PURE__ */de("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??W)?/* @__PURE__ */de("button",{type:"button",onClick:()=>{C.stop(),N()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(W))}):null,[_,q]=H(L.showing),U=e=>/* @__PURE__ */de("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */ue(he,{children:[e&&_,
378
378
  /* @__PURE__ */de("b",{className:"font-medium",children:o(v)}),e&&q,
379
- /* @__PURE__ */ue("span",{className:"text-gray-500",children:[" · ",P(new Date(v.date).getTime())," · ",L.overall(Math.round(E))," · ",L.inStock(B)]})]}):/* @__PURE__ */de("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=$&&$>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:P($)}:null;/* @__PURE__ */
379
+ /* @__PURE__ */ue("span",{className:"text-gray-500",children:[" · ",D(new Date(v.date).getTime())," · ",L.overall(Math.round(E))," · ",L.inStock(B)]})]}):/* @__PURE__ */de("span",{className:"text-gray-500",children:L.noReport})});if("rail"===d){const e=null!=$&&$>=f&&f>g,i=e?{key:"__estimate__",label:L.estimatedCompletion,dateText:D($)}:null;/* @__PURE__ */
380
380
  return ue("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
381
381
  /* @__PURE__ */de(ul,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:b,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:{start:s?.start??L.start,end:s?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
382
382
  /* @__PURE__ */ue("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[R,O,U(!1)]})]})}/* @__PURE__ */
383
- return de("div",{className:"shrink-0",children:/* @__PURE__ */de(al,{icon:/* @__PURE__ */de(ka,{}),heading:z,subject:p,meta:[`${P(g)} → ${P(f)}`,L.leadTime(x)],actions:/* @__PURE__ */ue(he,{children:[O,R]}),footer:/* @__PURE__ */ue(he,{children:[U(!0),
383
+ return de("div",{className:"shrink-0",children:/* @__PURE__ */de(al,{icon:/* @__PURE__ */de(ka,{}),heading:z,subject:p,meta:[`${D(g)} → ${D(f)}`,L.leadTime(x)],actions:/* @__PURE__ */ue(he,{children:[O,R]}),footer:/* @__PURE__ */ue(he,{children:[U(!0),
384
384
  /* @__PURE__ */ue("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */ue("span",{className:"border-gray-200 text-gray-500",children:[
385
- /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),D.length>0&&/* @__PURE__ */ue("span",{className:"border-gray-200 text-gray-500",children:[
385
+ /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),P.length>0&&/* @__PURE__ */ue("span",{className:"border-gray-200 text-gray-500",children:[
386
386
  /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */de(wa,{name:"truck"})}),L.shipment]}),S.length>0&&/* @__PURE__ */ue("span",{className:"border-gray-200 text-gray-500",children:[
387
387
  /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */de(wa,{name:"flask"})}),L.inspection]}),A.length>0&&/* @__PURE__ */ue("span",{className:"border-gray-200 text-gray-500",children:[
388
- /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */de(wa,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */de(ul,{startMs:g,endMs:f,reports:h,markers:m,valueMs:b,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:s,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var ml=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function pl({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="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=T().containers,m=o?e.filter(o):e,p=e=>ml(i(e)),g=e=>ml(s(e)),f=m.some(e=>null!=s(e)&&g(e)>0),x=e=>f?p(e):"actual"===a?s(e)??i(e)??0:i(e)??0,b=m.reduce((e,t)=>e+ml(x(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+ml(x(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+g(t),0),k=e=>t?.(e)??0,M=r??(e=>k(e)*p(e)),$=n??(e=>k(e)*g(e)),C=m.reduce((e,t)=>e+M(t),0),L=m.reduce((e,t)=>e+$(t),0),j=f?Math.max(C,L):"actual"===a&&L||C,z=j<=34.65?"20ft":"40ft",P="20ft"===z?33:67,D=j>0?Math.max(1,Math.ceil(j/P)):0,S=D*P,A=j>0&&j>=.95*S&&j<=1.1*S;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
+ /* @__PURE__ */de("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */de(wa,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */de(ul,{startMs:g,endMs:f,reports:h,markers:m,valueMs:b,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:o,edgeCaptions:s,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var ml=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function pl({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="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=T().containers,m=o?e.filter(o):e,p=e=>ml(i(e)),g=e=>ml(s(e)),f=m.some(e=>null!=s(e)&&g(e)>0),x=e=>f?p(e):"actual"===a?s(e)??i(e)??0:i(e)??0,b=m.reduce((e,t)=>e+ml(x(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+ml(x(t)),0),w=m.reduce((e,t)=>e+p(t),0),N=m.reduce((e,t)=>e+g(t),0),k=e=>t?.(e)??0,M=r??(e=>k(e)*p(e)),$=n??(e=>k(e)*g(e)),C=m.reduce((e,t)=>e+M(t),0),L=m.reduce((e,t)=>e+$(t),0),j=f?Math.max(C,L):"actual"===a&&L||C,z=j<=34.65?"20ft":"40ft",D="20ft"===z?33:67,P=j>0?Math.max(1,Math.ceil(j/D)):0,S=P*D,A=j>0&&j>=.95*S&&j<=1.1*S;if(0===m.length)return null;const B=(e,t)=>D>0?Math.max(0,Math.min((e-t*D)/D*100,100)):0;/* @__PURE__ */
389
389
  return ue("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
390
390
  /* @__PURE__ */ue("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
391
391
  /* @__PURE__ */ue("span",{children:[`${h.items(m.length)} · ${h.pieces(b)}`,f&&w!==N&&/* @__PURE__ */de("span",{className:"ml-1 text-gray-400",children:h.split(w,N)})]}),l&&y>0&&/* @__PURE__ */ue("span",{className:"flex items-center gap-1 text-green-600",children:[
392
- /* @__PURE__ */de("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),j>0?/* @__PURE__ */ue("div",{className:"space-y-1.5",children:[Array.from({length:D}).map((e,t)=>{const r=B(C,t),n=B(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),s=r>=n,o=a?s?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?s?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
392
+ /* @__PURE__ */de("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),j>0?/* @__PURE__ */ue("div",{className:"space-y-1.5",children:[Array.from({length:P}).map((e,t)=>{const r=B(C,t),n=B(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),s=r>=n,o=a?s?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?s?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
393
393
  return ue("div",{className:"flex items-center gap-2",children:[
394
394
  /* @__PURE__ */de("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:z}),
395
395
  /* @__PURE__ */ue("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
396
396
  /* @__PURE__ */de("div",{className:`absolute inset-y-0 left-0 ${o} transition-all`,style:{width:`${l}%`}}),a&&i>0&&/* @__PURE__ */de("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
397
- /* @__PURE__ */de("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*P,P),P):h.fill(Math.min(C-t*P,P),P)})]},`bar-${t}`)}),
397
+ /* @__PURE__ */de("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*D,D),D):h.fill(Math.min(C-t*D,D),D)})]},`bar-${t}`)}),
398
398
  /* @__PURE__ */ue("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
399
399
  /* @__PURE__ */ue("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */ue(he,{children:[
400
400
  /* @__PURE__ */ue("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
@@ -402,7 +402,7 @@ return ue("div",{className:"flex items-center gap-2",children:[
402
402
  /* @__PURE__ */de("span",{className:"text-gray-400",children:"/"}),
403
403
  /* @__PURE__ */ue("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
404
404
  /* @__PURE__ */de("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */de("b",{className:"text-gray-700",children:h.volume(j)})]}),
405
- /* @__PURE__ */ue("span",{className:"font-medium "+(A?"text-green-600":"text-gray-500"),children:[A&&"✓ ",D," × ",z]})]})]}):/* @__PURE__ */de("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var gl=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function fl(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function xl(e){const t=[];let r,n=0,a=0;for(gl.lastIndex=0;null!==(r=gl.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
405
+ /* @__PURE__ */ue("span",{className:"font-medium "+(A?"text-green-600":"text-gray-500"),children:[A&&"✓ ",P," × ",z]})]})]}):/* @__PURE__ */de("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var gl=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function fl(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function xl(e){const t=[];let r,n=0,a=0;for(gl.lastIndex=0;null!==(r=gl.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
406
406
  /* @__PURE__ */ue("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
407
407
  /* @__PURE__ */de("a",{href:fl(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
408
408
  /* @__PURE__ */de("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
@@ -443,12 +443,12 @@ return ue("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-l
443
443
  /* @__PURE__ */de("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
444
444
  /* @__PURE__ */ue("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */ue("span",{className:"ml-2 text-amber-600",children:["· ",o.help.draft]})]})]}),n&&l&&/* @__PURE__ */de("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:o.help.edit})]}),
445
445
  /* @__PURE__ */de("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */de(Ml,{children:v.body}):/* @__PURE__ */de("p",{className:"text-sm text-gray-500 italic",children:o.help.noBody})})]}):/* @__PURE__ */de("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */de("p",{className:"text-sm text-gray-500",children:t?o.help.loading:o.help.pickArticle})})})]})}var Ll={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 jl({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:i="button",title:s,className:o=""}){const c=l(n??"");/* @__PURE__ */
446
- return ue("button",{type:i,onClick:t,disabled:a,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 ${Ll[r]} ${o}`,children:[e,n&&/* @__PURE__ */de("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:c})]})}function zl(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-1.5 h-5 rounded-full text-[11px] font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function Pl({children:e,count:t}){return null==t?/* @__PURE__ */de("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */ue("p",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
446
+ return ue("button",{type:i,onClick:t,disabled:a,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 ${Ll[r]} ${o}`,children:[e,n&&/* @__PURE__ */de("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:c})]})}function zl(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-1.5 h-5 rounded-full text-[11px] font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function Dl({children:e,count:t}){return null==t?/* @__PURE__ */de("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */ue("p",{className:"flex items-center justify-between gap-2 px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:[
447
447
  /* @__PURE__ */de("span",{className:"min-w-0 truncate",children:e}),
448
- /* @__PURE__ */de("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function Dl(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 py-1.5 pl-2.5 pr-2.5 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function Sl({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:s=0}){const o=Xn(i,"SidebarNavItem"),c=T().severity,d=o?(h=c,(u=o).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */ue(he,{children:[null!=a&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),o&&
448
+ /* @__PURE__ */de("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function Pl(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 py-1.5 pl-2.5 pr-2.5 text-sm "+(e?"border-blue-500 bg-blue-50 font-medium text-blue-700":"border-gray-200 text-gray-700 hover:bg-gray-100")}function Sl({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:s=0}){const o=Jn(i,"SidebarNavItem"),c=T().severity,d=o?(h=c,(u=o).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */ue(he,{children:[null!=a&&/* @__PURE__ */de("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),o&&
449
449
  /* @__PURE__ */de("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${o.fill}`}),
450
450
  /* @__PURE__ */de("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),o&&/* @__PURE__ */de("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */de("span",{className:zl(r),children:t}),null!=l&&/* @__PURE__ */de("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
451
- return de("button",1===s?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */de("span",{className:Dl(r),children:m})}:{type:"button",onClick:n,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:m})}function Al({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=J(),[i,s]=V(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),o=!i&&re.toArray(r).some(e=>ne(e)&&!0===e.props.active);/* @__PURE__ */
451
+ return de("button",1===s?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */de("span",{className:Pl(r),children:m})}:{type:"button",onClick:n,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:m})}function Al({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=X(),[i,s]=V(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),o=!i&&re.toArray(r).some(e=>ne(e)&&!0===e.props.active);/* @__PURE__ */
452
452
  return ue("div",{children:[
453
453
  /* @__PURE__ */ue("button",{type:"button",onClick:()=>{const e=!i;if(s(e),a)try{window.localStorage.setItem(a,e?"1":"0")}catch{}},"aria-expanded":i,"aria-controls":l,className:"flex w-full items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-left "+(o?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
454
454
  /* @__PURE__ */de("span",{className:"min-w-0 truncate",title:e,children:e}),
@@ -457,30 +457,30 @@ return ue("div",{children:[
457
457
  return ue("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */de("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
458
458
  /* @__PURE__ */de("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
459
459
  return ue("button",{type:"button",disabled:e.disabled,"aria-current":n?"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 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */de("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
460
- /* @__PURE__ */de("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */de("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}),n&&/* @__PURE__ */de("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */de("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Fl=/(^|[\s:])!?z-/,Tl=/* @__PURE__ */de("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),El=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Il({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:s="",minWidth:o=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Z(!1),[g,f]=Z(-1),x=X(null),b=X(null),y=X(null),v=X({text:"",at:0}),w=J(),N=J(),k=u??N,M=G(e=>{p(!1),e&&b.current?.focus()},[]),$=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(El(t[l]))return l}return-1},C=()=>y.current?.closest("[data-popup-menu-tree]")??null;Q(()=>{if(!m)return;const e=e=>{const t=e.target;x.current?.contains(t)||C()?.contains(t)||M(!1)};document.addEventListener("pointerdown",e,!0);const t=S(()=>M(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,M]);const B=G(()=>{const e=C(),t=b.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=Ae({trigger:t.getBoundingClientRect(),menu:l,bounds:Ce(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);_(()=>{m&&B()}),Q(()=>{if(m)return Se(()=>b.current,B)},[m,B]),Q(()=>{if(!m)return;const e=y.current,r=El(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Q(()=>{if(m)return D(e=>"Escape"===e.key&&(M(!0),!0))},[m,M]);const F=e=>{f(e),p(!0)},T=e=>{e.disabled||(M(!0),e.onSelect())},E=c??"a",I=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),W=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
460
+ /* @__PURE__ */de("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */de("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}),n&&/* @__PURE__ */de("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */de("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Fl=/(^|[\s:])!?z-/,Tl=/* @__PURE__ */de("svg",{"aria-hidden":!0,className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */de("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),El=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Il({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:s="",minWidth:o=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Z(!1),[g,f]=Z(-1),x=J(null),b=J(null),y=J(null),v=J({text:"",at:0}),w=X(),N=X(),k=u??N,M=G(e=>{p(!1),e&&b.current?.focus()},[]),$=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(El(t[l]))return l}return-1},C=()=>y.current?.closest("[data-popup-menu-tree]")??null;Q(()=>{if(!m)return;const e=e=>{const t=e.target;x.current?.contains(t)||C()?.contains(t)||M(!1)};document.addEventListener("pointerdown",e,!0);const t=S(()=>M(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,M]);const B=G(()=>{const e=C(),t=b.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=Ae({trigger:t.getBoundingClientRect(),menu:l,bounds:Ce(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);_(()=>{m&&B()}),Q(()=>{if(m)return Se(()=>b.current,B)},[m,B]),Q(()=>{if(!m)return;const e=y.current,r=El(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Q(()=>{if(m)return P(e=>"Escape"===e.key&&(M(!0),!0))},[m,M]);const F=e=>{f(e),p(!0)},T=e=>{e.disabled||(M(!0),e.onSelect())},E=c??"a",I=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),W=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
461
461
  return de("div",{role:"separator",children:/* @__PURE__ */de(j,{})},e.key);if("label"===e.type)/* @__PURE__ */
462
- return de("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */de(z,{children:e.label})},e.key);if("checkbox"===e.type){const r=P(!1,e.disabled,"");/* @__PURE__ */
462
+ return de("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */de(z,{children:e.label})},e.key);if("checkbox"===e.type){const r=D(!1,e.disabled,"");/* @__PURE__ */
463
463
  return ue("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...I(t,e),children:[
464
- /* @__PURE__ */de("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(e.checked?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:e.checked&&Tl}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=P(!1,e.disabled,"");/* @__PURE__ */
464
+ /* @__PURE__ */de("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded border "+(e.checked?"border-blue-600 bg-blue-600 text-white":"border-gray-400"),children:e.checked&&Tl}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=D(!1,e.disabled,"");/* @__PURE__ */
465
465
  return ue("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...I(t,e),children:[
466
- /* @__PURE__ */de("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e.checked&&Tl}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=P(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */ue("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...I(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */ue(E,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>M(!0),...I(t,e),children:[e.icon,e.label]},e.key)}const r=P(e.danger,e.disabled,"");/* @__PURE__ */
466
+ /* @__PURE__ */de("span",{"aria-hidden":!0,className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:e.checked&&Tl}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=D(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */ue("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...I(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */ue(E,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>M(!0),...I(t,e),children:[e.icon,e.label]},e.key)}const r=D(e.danger,e.disabled,"");/* @__PURE__ */
467
467
  return ue("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>T(e),...I(t,e),children:[e.icon,e.label]},e.key)},R={...Fl.test(s)?{}:{zIndex:A.popup},minWidth:o};/* @__PURE__ */
468
468
  return ue("div",{ref:x,className:`relative inline-flex ${l}`.trim(),children:[
469
469
  /* @__PURE__ */de("button",{ref:b,id:k,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?M(!1):F($(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),F($(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),F($(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}),m&&
470
- /* @__PURE__ */de(L,{portal:!0,className:s,style:R,children:/* @__PURE__ */de("div",{ref:y,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f($(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f($(g-1,-1));else if("Home"===e.key)e.preventDefault(),f($(0,1));else if("End"===e.key)e.preventDefault(),f($(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),M(!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(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,s=l?g+1:Math.max(g,0),o=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((s+r)%c+c)%c;if(El(t[n])&&(o?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(W(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(W(t[r],r)),r+=1;const s="label"===t[l-1]?.type?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */de("div",{role:"group","aria-labelledby":s,children:i},`group:${n.key}`))}return e})()})})]})}var Wl=/(^|[\s:])!?z-/;function Rl({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:s,defaultOpen:o=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:x="",triggerClassName:b,panelClassName:N=""}){const[k,$]=Z(o),C=(s??k)&&!f,L=K(),j=X(null),z=X(null),P=X(null),B=X(null),F=J(),T=m??F,E=J(),I=J(),W=J(),R=X(null),O=X(!1),H=X({openProp:s,onOpenChange:c});H.current={openProp:s,onOpenChange:c};const q=G(e=>{void 0===H.current.openProp&&$(e),H.current.onOpenChange?.(e)},[]),U=G((e=!1)=>{O.current=e,q(!1)},[q]),V=e=>{R.current=e.nativeEvent},Y=G(()=>{const e=P.current,t=z.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=Ce(t),a=Math.max(0,n.right-n.left-16),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${a}px`,s.maxHeight="none",s.width=d?`${Math.min(r.width,a)}px`:"";const o={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=Ae({trigger:r,menu:{width:o.width,height:Math.min(o.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);s.left=`${h.left}px`,s.top=`${h.top}px`,s.maxHeight=`${m}px`,s.overflowY=o.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);_(()=>{C&&L&&Y()}),Q(()=>{if(!C||!L)return;const e=Se(()=>z.current,Y),t=B.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>Y());return r.observe(t),()=>{e(),r.disconnect()}},[C,L,Y]),Q(()=>{if(!C)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(R.current===e)return!1;const t=e.target;return!(t&&(j.current?.contains(t)||P.current?.contains(t)))})(e)&&U(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=S(()=>U()),a=D(e=>"Escape"===e.key&&(U(),z.current?.focus(),!0));return()=>{t(),r(),n(),a()}},[C,U]),v(P,C&&L),_(()=>{if(!C||!L)return;const e=P.current;return()=>{if(O.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||z.current?.focus({preventScroll:!0})}},[C,L]),Q(()=>{if(!C||!L)return;const e=P.current;e&&(O.current=!1,(h?.current??w(e)[0]??e).focus({preventScroll:!0}))},[C,L]);const ee="function"==typeof t?t({close:()=>U()}):t,te=r?{"aria-labelledby":I}:a?{"aria-label":a}:{"aria-labelledby":T};/* @__PURE__ */
470
+ /* @__PURE__ */de(L,{portal:!0,className:s,style:R,children:/* @__PURE__ */de("div",{ref:y,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f($(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f($(g-1,-1));else if("Home"===e.key)e.preventDefault(),f($(0,1));else if("End"===e.key)e.preventDefault(),f($(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),M(!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(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,s=l?g+1:Math.max(g,0),o=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((s+r)%c+c)%c;if(El(t[n])&&(o?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(W(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(W(t[r],r)),r+=1;const s="label"===t[l-1]?.type?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */de("div",{role:"group","aria-labelledby":s,children:i},`group:${n.key}`))}return e})()})})]})}var Wl=/(^|[\s:])!?z-/;function Rl({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:s,defaultOpen:o=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:x="",triggerClassName:b,panelClassName:N=""}){const[k,$]=Z(o),C=(s??k)&&!f,L=K(),j=J(null),z=J(null),D=J(null),B=J(null),F=X(),T=m??F,E=X(),I=X(),W=X(),R=J(null),O=J(!1),H=J({openProp:s,onOpenChange:c});H.current={openProp:s,onOpenChange:c};const q=G(e=>{void 0===H.current.openProp&&$(e),H.current.onOpenChange?.(e)},[]),U=G((e=!1)=>{O.current=e,q(!1)},[q]),V=e=>{R.current=e.nativeEvent},Y=G(()=>{const e=D.current,t=z.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=Ce(t),a=Math.max(0,n.right-n.left-16),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${a}px`,s.maxHeight="none",s.width=d?`${Math.min(r.width,a)}px`:"";const o={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=Ae({trigger:r,menu:{width:o.width,height:Math.min(o.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);s.left=`${h.left}px`,s.top=`${h.top}px`,s.maxHeight=`${m}px`,s.overflowY=o.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);_(()=>{C&&L&&Y()}),Q(()=>{if(!C||!L)return;const e=Se(()=>z.current,Y),t=B.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>Y());return r.observe(t),()=>{e(),r.disconnect()}},[C,L,Y]),Q(()=>{if(!C)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(R.current===e)return!1;const t=e.target;return!(t&&(j.current?.contains(t)||D.current?.contains(t)))})(e)&&U(!0))},a=e=>{t=e,r=window.setTimeout(()=>n(e),0)},l=e=>n(e);return document.addEventListener(e,a,!0),window.addEventListener(e,l),()=>{window.clearTimeout(r),document.removeEventListener(e,a,!0),window.removeEventListener(e,l)}},t=e("pointerdown"),r=e("focusin"),n=S(()=>U()),a=P(e=>"Escape"===e.key&&(U(),z.current?.focus(),!0));return()=>{t(),r(),n(),a()}},[C,U]),v(D,C&&L),_(()=>{if(!C||!L)return;const e=D.current;return()=>{if(O.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||z.current?.focus({preventScroll:!0})}},[C,L]),Q(()=>{if(!C||!L)return;const e=D.current;e&&(O.current=!1,(h?.current??w(e)[0]??e).focus({preventScroll:!0}))},[C,L]);const ee="function"==typeof t?t({close:()=>U()}):t,te=r?{"aria-labelledby":I}:a?{"aria-label":a}:{"aria-labelledby":T};/* @__PURE__ */
471
471
  return ue("div",{ref:j,className:`relative inline-flex ${x}`.trim(),children:[
472
- /* @__PURE__ */de("button",{ref:z,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":C,"aria-controls":C&&L?E:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>C?U():q(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!C)return;const t=(()=>{const e=P.current;return e?w(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:b??y({variant:"secondary"}),children:e}),C&&L&&me(
473
- /* @__PURE__ */de("div",{ref:P,id:E,role:"dialog",...te,"aria-describedby":n?W:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:V,onFocusCapture:V,onKeyDown:e=>{const t=P.current,r=z.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=w(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=M(r,t);U(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${N}`.trim(),style:Wl.test(N)?void 0:{zIndex:A.popup},children:/* @__PURE__ */ue("div",{ref:B,children:[r&&/* @__PURE__ */de("h2",{id:I,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */de("p",{id:W,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */de("div",{className:"mt-3",children:ee}):ee]})}),document.body)]})}var Ol=6e4;function Hl({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Z(null);return Q(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&a(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,n]),n}function _l({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Hl({currentVersion:e,versionUrl:t,pollMs:r}),s=T();if(null===i)return null;const o=a??(()=>window.location.reload());/* @__PURE__ */
472
+ /* @__PURE__ */de("button",{ref:z,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":C,"aria-controls":C&&L?E:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>C?U():q(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!C)return;const t=(()=>{const e=D.current;return e?w(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:b??y({variant:"secondary"}),children:e}),C&&L&&me(
473
+ /* @__PURE__ */de("div",{ref:D,id:E,role:"dialog",...te,"aria-describedby":n?W:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:V,onFocusCapture:V,onKeyDown:e=>{const t=D.current,r=z.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=w(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=M(r,t);U(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${N}`.trim(),style:Wl.test(N)?void 0:{zIndex:A.popup},children:/* @__PURE__ */ue("div",{ref:B,children:[r&&/* @__PURE__ */de("h2",{id:I,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */de("p",{id:W,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */de("div",{className:"mt-3",children:ee}):ee]})}),document.body)]})}var Ol=6e4;function Hl({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Z(null);return Q(()=>{if(!e||null!==n)return;let l=!1;const i=async()=>{if("undefined"==typeof document||"hidden"!==document.visibilityState)try{const r=t.includes("?")?"&":"?",n=await fetch(`${t}${r}t=${Date.now()}`,{cache:"no-store"});if(!n.ok)return;const i=await n.json(),s=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&s&&s!==e&&a(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,n]),n}function _l({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Hl({currentVersion:e,versionUrl:t,pollMs:r}),s=T();if(null===i)return null;const o=a??(()=>window.location.reload());/* @__PURE__ */
474
474
  return de("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__ */ue($n,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */de(b,{type:"button",variant:"primary",size:"md",onClick:o,children:s.update.refreshNow}),children:[
475
475
  /* @__PURE__ */de("span",{className:"font-medium",children:n??s.update.available}),
476
476
  /* @__PURE__ */ue("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var ql={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Ul={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function Vl({onClose:e}){const t=T().dialog;/* @__PURE__ */
477
- return de("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__ */de("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Kl({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:s,blocking:o=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=X(null),g=J(),f=J(),x=J();if(B(e),N(p,e,c),k(e),Q(()=>{if(e)return D(()=>(o||t(),!0))},[e,o,t]),!e)return null;const b="bottom"===r,y=b?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
477
+ return de("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__ */de("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */de("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Kl({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:s,blocking:o=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=J(null),g=X(),f=X(),x=X();if(B(e),N(p,e,c),k(e),Q(()=>{if(e)return P(()=>(o||t(),!0))},[e,o,t]),!e)return null;const b="bottom"===r,y=b?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
478
478
  return ue("div",{className:"fixed inset-0",style:{zIndex:A.overlay},role:"presentation",children:[
479
479
  /* @__PURE__ */de("div",{className:"fixed inset-0 bg-black/30",onClick:o?void 0:t,"aria-hidden":"true"}),
480
480
  /* @__PURE__ */ue("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?x:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:s?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",b?"":`w-full max-w-full ${ql[n]}`,Ul[r],b?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */ue("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
481
481
  /* @__PURE__ */ue("div",{className:"min-w-0",children:[
482
482
  /* @__PURE__ */de("h2",{id:x,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */de("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!o&&/* @__PURE__ */de(Vl,{onClose:t})]}):!o&&/* @__PURE__ */de("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */de(Vl,{onClose:t})}),
483
- /* @__PURE__ */ue("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */de("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(o?"":"pr-8")).trim(),children:l}),s]}),i&&/* @__PURE__ */de("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function Yl({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:s,isLoading:o=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=T().kanban,f=F(),x=c??g.loading,b=h??g.dropHere,y=p??g.addItem,[v,w]=Z(null),[N,k]=Z(null),M=te(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(s)for(const e of Object.keys(n))n[e].sort(s);return n},[e,t,r,s]),$=()=>{w(null),k(null)},C=X(null),L=X(/* @__PURE__ */new Map);_(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}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})})}},[M,v]);return o?/* @__PURE__ */de("div",{className:"text-sm text-gray-500 p-4",children:x}):0!==e.length||u?/* @__PURE__ */de("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */de("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==N&&N.col===e.value,s=null!==v?t.findIndex(e=>n(e)===v):-1,o=r&&(-1===s||N.index!==s&&N.index!==s+1)?N.index:-1;/* @__PURE__ */
483
+ /* @__PURE__ */ue("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */de("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(o?"":"pr-8")).trim(),children:l}),s]}),i&&/* @__PURE__ */de("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function Yl({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:s,isLoading:o=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=T().kanban,f=F(),x=c??g.loading,b=h??g.dropHere,y=p??g.addItem,[v,w]=Z(null),[N,k]=Z(null),M=te(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(s)for(const e of Object.keys(n))n[e].sort(s);return n},[e,t,r,s]),$=()=>{w(null),k(null)},C=J(null),L=J(/* @__PURE__ */new Map);_(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}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})})}},[M,v]);return o?/* @__PURE__ */de("div",{className:"text-sm text-gray-500 p-4",children:x}):0!==e.length||u?/* @__PURE__ */de("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */de("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==N&&N.col===e.value,s=null!==v?t.findIndex(e=>n(e)===v):-1,o=r&&(-1===s||N.index!==s&&N.index!==s+1)?N.index:-1;/* @__PURE__ */
484
484
  return ue("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&&N&&N.col===e){const t=(M[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||N.index!==t&&N.index!==t+1){const n=r&&N.index>t?N.index-1:N.index;a(v,e,n)}}$()})(e.value)},children:[
485
485
  /* @__PURE__ */ue("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:[
486
486
  /* @__PURE__ */ue("span",{className:"flex items-center gap-2",children:[
@@ -492,10 +492,10 @@ return ue(ie,{children:[o===a&&/* @__PURE__ */de("div",{className:"h-0.5 rounded
492
492
  /* @__PURE__ */de("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */de(he,{children:d??/* @__PURE__ */de("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var Gl="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 Zl({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=T().pagination,s=F();if(t<=1)return null;const o=function(e,t,r){const n=/* @__PURE__ */new Set([1,t]);for(let a=e-r;a<=e+r;a++)a>=1&&a<=t&&n.add(a);const a=[...n].sort((e,t)=>e-t),l=[];let i=0;for(const e of a)i&&e-i>1&&l.push("…"),l.push(e),i=e;return l}(e,t,n),c=n=>{n>=1&&n<=t&&n!==e&&r(n)};/* @__PURE__ */
493
493
  return ue("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */de("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${Gl} text-gray-600 hover:bg-gray-100`,children:"«"}),
494
494
  /* @__PURE__ */de("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${Gl} text-gray-600 hover:bg-gray-100`,children:"‹"}),o.map((t,r)=>"…"===t?/* @__PURE__ */de("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */de("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${Gl} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:W(t,s)},t)),
495
- /* @__PURE__ */de("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Gl} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */de("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Gl} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Xl(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var Jl=e=>Array.isArray(e.columns),Ql=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",ei="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",ti={sm:"px-2 py-1.5",md:"px-3 py-2"},ri={left:"text-left",right:"text-right",center:"text-center"};function ni({direction:e}){/* @__PURE__ */
495
+ /* @__PURE__ */de("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Gl} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */de("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Gl} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Jl(e){const t={};if(!e)return t;for(const[r,n]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n||(t[r]=n);return t}var Xl=e=>Array.isArray(e.columns),Ql=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",ei="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",ti={sm:"px-2 py-1.5",md:"px-3 py-2"},ri={left:"text-left",right:"text-right",center:"text-center"};function ni({direction:e}){/* @__PURE__ */
496
496
  return ue("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
497
497
  /* @__PURE__ */de("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */de("path",{d:"M4 0L8 5H0z"})}),
498
- /* @__PURE__ */de("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */de("path",{d:"M4 5L0 0h8z"})})]})}function ai({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:x,footer:b,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=T(),M=f??k.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!Jl(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),j=e=>C?{role:e}:{},z=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,D]=Z(0),S=y?.overscan??6,A=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-S);D(e=>e===t?e:t)}:void 0,B=y?Math.ceil(y.height/y.rowHeight)+2*S:t.length,F=y?Math.min(P,Math.max(0,t.length-B)):0,E=Math.min(t.length,F+B),I=y?F*y.rowHeight:0,W=y?(t.length-E)*y.rowHeight:0,R=X(null),[O,H]=Z(0);_(()=>{if(!y)return;const e=R.current?.offsetHeight??0;H(t=>t===e?t:e)});const q=e=>e.sortField??e.key,U=e=>n&&n.field===q(e)?n.direction:null,V=L.flatMap(e=>Jl(e)?e.columns:[e]),K=L.some(Jl),Y=/* @__PURE__ */new Map;if(C)for(const e of L)if(Jl(e))for(const t of e.columns)Y.set(t,z(e.title,e.label));const G=e=>{const t=z(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},J=new Set(x?.selected??[]),Q=x?t.map((e,t)=>$(e,t)):[],ee=Q.length>0&&Q.every(e=>J.has(e)),te=Q.some(e=>J.has(e)),re=x?36:0,ne=V.length+(x?1:0),ae=V.some(e=>"left"===e.fixed),le=C&&!x&&V.some(e=>e.cardCorner),ie=g??"a",se=`${ti[c]} ${"sm"===c?"text-xs":"text-sm"}`,oe=(e,t,r,n=0)=>{const l=U(e),i=ri[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!a);/* @__PURE__ */
498
+ /* @__PURE__ */de("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */de("path",{d:"M4 5L0 0h8z"})})]})}function ai({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:s=!1,bordered:o=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:x,footer:b,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=T(),M=f??k.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!Xl(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),j=e=>C?{role:e}:{},z=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[D,P]=Z(0),S=y?.overscan??6,A=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-S);P(e=>e===t?e:t)}:void 0,B=y?Math.ceil(y.height/y.rowHeight)+2*S:t.length,F=y?Math.min(D,Math.max(0,t.length-B)):0,E=Math.min(t.length,F+B),I=y?F*y.rowHeight:0,W=y?(t.length-E)*y.rowHeight:0,R=J(null),[O,H]=Z(0);_(()=>{if(!y)return;const e=R.current?.offsetHeight??0;H(t=>t===e?t:e)});const q=e=>e.sortField??e.key,U=e=>n&&n.field===q(e)?n.direction:null,V=L.flatMap(e=>Xl(e)?e.columns:[e]),K=L.some(Xl),Y=/* @__PURE__ */new Map;if(C)for(const e of L)if(Xl(e))for(const t of e.columns)Y.set(t,z(e.title,e.label));const G=e=>{const t=z(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(x?.selected??[]),Q=x?t.map((e,t)=>$(e,t)):[],ee=Q.length>0&&Q.every(e=>X.has(e)),te=Q.some(e=>X.has(e)),re=x?36:0,ne=V.length+(x?1:0),ae=V.some(e=>"left"===e.fixed),le=C&&!x&&V.some(e=>e.cardCorner),ie=g??"a",se=`${ti[c]} ${"sm"===c?"text-xs":"text-sm"}`,oe=(e,t,r,n=0)=>{const l=U(e),i=ri[e.align??(e.numeric?"right":"left")],s="left"===e.fixed,o=!(!e.sortable||!a);/* @__PURE__ */
499
499
  return de("th",{scope:"col",...j("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:(me[t]??0)+re}:{},...y?{top:n}:{}},className:[se,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",s?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&o?"rosh-dt-sort":"",C?Ql(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:o?/* @__PURE__ */ue("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=q(e),r=U(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":C?Y.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
500
500
  /* @__PURE__ */de(ni,{direction:l})]}):e.title},e.key)};let ce=0;const me=V.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),pe=/* @__PURE__ */ue(he,{children:[
501
501
  /* @__PURE__ */ue("div",{onScroll:A,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${o?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[s&&
@@ -504,10 +504,10 @@ return de("th",{scope:"col",...j("columnheader"),rowSpan:r>1?r:void 0,"aria-sort
504
504
  /* @__PURE__ */de("span",{className:"sr-only",children:k.table.loading})]}),
505
505
  /* @__PURE__ */ue("table",{...j("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */de("caption",{className:"sr-only",children:i}),
506
506
  /* @__PURE__ */ue("thead",{...j("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
507
- /* @__PURE__ */ue("tr",{ref:R,...j("row"),className:"border-b border-gray-200 bg-gray-50",children:[x&&/* @__PURE__ */de("th",{scope:"col",...j("columnheader"),rowSpan:K?2:void 0,style:{width:36,...y?{top:0}:{}},className:[se,ae||y?"sticky z-20 bg-gray-50":"",ae?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */de(_e,{"aria-label":k.table.selectAll,checked:ee,indeterminate:te&&!ee,onChange:()=>{if(!x)return;const e=new Set(Q);x.onChange(ee?x.selected.filter(t=>!e.has(t)):[...x.selected,...Q.filter(e=>!J.has(e))])}})}),L.map((e,t)=>Jl(e)?/* @__PURE__ */de("th",{scope:"colgroup",...j("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[se,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",y?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):oe(e,V.indexOf(e),K?2:1))]}),K&&/* @__PURE__ */de("tr",{...j("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>Jl(e)?e.columns:[]).map(e=>oe(e,V.indexOf(e),1,O))})]}),
507
+ /* @__PURE__ */ue("tr",{ref:R,...j("row"),className:"border-b border-gray-200 bg-gray-50",children:[x&&/* @__PURE__ */de("th",{scope:"col",...j("columnheader"),rowSpan:K?2:void 0,style:{width:36,...y?{top:0}:{}},className:[se,ae||y?"sticky z-20 bg-gray-50":"",ae?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */de(_e,{"aria-label":k.table.selectAll,checked:ee,indeterminate:te&&!ee,onChange:()=>{if(!x)return;const e=new Set(Q);x.onChange(ee?x.selected.filter(t=>!e.has(t)):[...x.selected,...Q.filter(e=>!X.has(e))])}})}),L.map((e,t)=>Xl(e)?/* @__PURE__ */de("th",{scope:"colgroup",...j("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[se,"text-center","font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs","border-b border-gray-200",y?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:e.title},e.key??`group-${t}`):oe(e,V.indexOf(e),K?2:1))]}),K&&/* @__PURE__ */de("tr",{...j("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>Xl(e)?e.columns:[]).map(e=>oe(e,V.indexOf(e),1,O))})]}),
508
508
  /* @__PURE__ */de("tbody",{...j("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||s?/* @__PURE__ */ue(he,{children:[I>0&&/* @__PURE__ */de("tr",{"aria-hidden":"true",children:/* @__PURE__ */de("td",{colSpan:ne,style:{height:I,padding:0,border:0}})}),t.slice(F,E).map((e,t)=>{const r=F+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,s=void 0!==l||void 0!==i;let o=!1;const c=(e,t)=>{if(o=!0,!s)return e;const r=[ei,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */de(ie,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */de("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=V.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(s&&!o){const e=V.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=V.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const g=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
509
- return ue("tr",{...Xl(n),...j("row"),style:y?{height:y.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!s?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?x?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&le?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.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)]":"",s?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[x&&(()=>{const t=$(e,r);/* @__PURE__ */
510
- return de("td",{...j("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[se,ae?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */de(_e,{"aria-label":k.table.selectRow,checked:J.has(t),onChange:()=>(e=>{x&&x.onChange(J.has(e)?x.selected.filter(t=>t!==e):[...x.selected,e])})(t)})})})(),V.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=le&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
509
+ return ue("tr",{...Jl(n),...j("row"),style:y?{height:y.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:g(n?.onFocus),onBlur:g(n?.onBlur),"aria-current":a&&!s?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?x?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&le?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.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)]":"",s?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[x&&(()=>{const t=$(e,r);/* @__PURE__ */
510
+ return de("td",{...j("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[se,ae?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */de(_e,{"aria-label":k.table.selectRow,checked:X.has(t),onChange:()=>(e=>{x&&x.onChange(X.has(e)?x.selected.filter(t=>t!==e):[...x.selected,e])})(t)})})})(),V.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=le&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
511
511
  return de("td",{...j("cell"),"data-label":l?G(e):void 0,style:r?{left:(me[t]??0)+re}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?Ql(e):"",se,ri[e.align??(e.numeric?"right":"left")],e.numeric&&!C?"font-mono":"","text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:C?
512
512
  /* @__PURE__ */de("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),W>0&&/* @__PURE__ */de("tr",{"aria-hidden":"true",children:/* @__PURE__ */de("td",{colSpan:ne,style:{height:W,padding:0,border:0}})})]}):/* @__PURE__ */de("tr",{...j("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */de("td",{...j("cell"),colSpan:ne,className:`${se} py-10 text-center text-gray-500`,children:M})})})]}),b]}),l&&l.pageCount>1&&/* @__PURE__ */de("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */de(Zl,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
513
513
  return de("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${N}`.trim(),children:/* @__PURE__ */de("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */de("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:pe})})}:{className:`rosh-dt-stack ${N}`.trim(),children:pe}:{className:N,children:pe})}function li({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const s=T().list,o=n??r,c=r>=o,d=t>0?s.selectedNotShown(e,t):e>0?s.selected(e):"";/* @__PURE__ */
@@ -684,7 +684,7 @@ return de("div",{className:"h-full",children:/* @__PURE__ */de(t,{side:"left",de
684
684
  /* @__PURE__ */de("p",{children:"Hi,"}),
685
685
  /* @__PURE__ */ue("p",{children:[n.preview," The full details are attached — happy to walk through anything on a quick call."]}),
686
686
  /* @__PURE__ */ue("p",{children:["Best,",
687
- /* @__PURE__ */de("br",{}),n.from]})]})]})]})})})}var zi=[{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"}],Pi=[{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 Di(){const[e,r]=Z(1),n=zi.find(t=>t.id===e)??zi[0];/* @__PURE__ */
687
+ /* @__PURE__ */de("br",{}),n.from]})]})]})]})})})}var zi=[{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"}],Di=[{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 Pi(){const[e,r]=Z(1),n=zi.find(t=>t.id===e)??zi[0];/* @__PURE__ */
688
688
  return de("div",{className:"h-full",children:/* @__PURE__ */de(t,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */de("div",{className:"h-full overflow-auto",children:zi.map(t=>/* @__PURE__ */ue("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:[
689
689
  /* @__PURE__ */de(vn,{name:t.name,status:t.status}),
690
690
  /* @__PURE__ */ue("div",{className:"min-w-0 flex-1",children:[
@@ -697,7 +697,7 @@ return de("div",{className:"h-full",children:/* @__PURE__ */de(t,{side:"left",de
697
697
  /* @__PURE__ */ue("div",{children:[
698
698
  /* @__PURE__ */de("div",{className:"text-sm font-medium text-gray-900",children:n.name}),
699
699
  /* @__PURE__ */de("div",{className:"text-xs text-gray-400 capitalize",children:n.status})]})]}),
700
- /* @__PURE__ */de("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:Pi.map((e,t)=>/* @__PURE__ */de("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */de("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))}),
700
+ /* @__PURE__ */de("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:Di.map((e,t)=>/* @__PURE__ */de("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */de("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))}),
701
701
  /* @__PURE__ */ue("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
702
702
  /* @__PURE__ */de("div",{className:"flex-1",children:/* @__PURE__ */de(we,{placeholder:"Type a message…"})}),
703
703
  /* @__PURE__ */de(b,{type:"submit",children:"Send"})]})]})})})}var Si={featured:"success",new:"active",draft:"draft"},Ai=["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 Bi(){const[e,t]=Z("all"),r="all"===e?Ai:Ai.filter(t=>t.tag===e);/* @__PURE__ */
@@ -705,7 +705,7 @@ return de(Rn,{groups:Si,children:/* @__PURE__ */de("div",{className:"h-full over
705
705
  /* @__PURE__ */ue("div",{className:"flex items-center justify-between gap-4",children:[
706
706
  /* @__PURE__ */de("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
707
707
  /* @__PURE__ */de(b,{size:"sm",children:"Upload"})]}),
708
- /* @__PURE__ */de(Pn,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
708
+ /* @__PURE__ */de(Dn,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
709
709
  /* @__PURE__ */de("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */ue(Tr,{padded:!1,className:"overflow-hidden",children:[
710
710
  /* @__PURE__ */de("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */de("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */de(On,{status:e.tag})})}),
711
711
  /* @__PURE__ */ue("div",{className:"flex items-center justify-between gap-2 p-3",children:[
@@ -733,10 +733,10 @@ return de(he,{children:e(T().errors)})}var Ri=class extends se{state={error:null
733
733
  /* @__PURE__ */de("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */de(Ii,{code:500,actions:/* @__PURE__ */ue(he,{children:[
734
734
  /* @__PURE__ */de(b,{onClick:this.reset,children:/* @__PURE__ */de(Wi,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */ue("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
735
735
  /* @__PURE__ */de("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */de(Wi,{pick:e=>e.details})}),
736
- /* @__PURE__ */de("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 Oi(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Hi(e){const t=Oi();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function _i(){return Oi()?.matches??!1}function qi(){return!1}function Ui(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,s=0;const o=(a+l)/2;if(a!==l){const e=a-l;s=o>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function Vi(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Ki(e){const t=e||"system";return"system"===t?_i()?"dark":"light":t}function Yi(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Ui(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Vi(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Vi(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Vi(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Vi(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Vi(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Vi(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Vi(r,Math.min(n+20,100),Math.min(a+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 Gi(e,t,r,n,a){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))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Ui(a);l.style.setProperty("--custom-button-hover",Vi(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Zi(e){document.documentElement.setAttribute("data-theme",Ki(e.theme)),Yi(e.accent_color??null),Gi(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 Xi(){const{prefs:e}=i(),t=oe(Hi,_i,qi),r=e.theme||"system",n=e.accent_color||null,a=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 Q(()=>(document.documentElement.setAttribute("data-theme",c),()=>document.documentElement.removeAttribute("data-theme")),[c]),Q(()=>{Yi(n)},[n]),Q(()=>{Gi(n,a,l,s,o)},[n,a,l,s,o]),{theme:r,resolved:c}}function Ji({label:e="Not available"}){/* @__PURE__ */
737
- return de("span",{className:"text-gray-400",role:"img","aria-label":e,children:m})}function Qi({value:e,precise:t,className:r}){const n=p(e);if(!n)/* @__PURE__ */return de(Ji,{});const a="string"==typeof e?e:n.toISOString();/* @__PURE__ */
738
- return de("time",{dateTime:a,title:f(a),className:r,children:g(n,{precise:t})})}function es(e,t=300){const[r,n]=Z(e);return Q(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function ts(e,t){Q(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var rs=8,ns=["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)"],as={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},ls={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function is(e){return ns[e]??ls.muted}function ss(e,t,r){return t||(r?as[r]:is(e))}function os(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function cs(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function ds(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function us(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 hs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),s=a>0&&l>0?Math.log10(a)-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,a],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},o}function ms(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function ps(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function gs(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 n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var fs=e=>e.toFixed(2);function xs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${fs(e)},${fs(t)}`).join(" ")}function bs(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${fs(e.start)},${fs(e.y)}`,t+=` L${fs(e.end)},${fs(e.y)}`}),t}function ys(e){if(e.length<3)return xs(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${fs(e[0][0])},${fs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${fs(e[n][0]+t)},${fs(e[n][1]+a[n]*t)} ${fs(e[n+1][0]-t)},${fs(e[n+1][1]-a[n+1]*t)} ${fs(e[n+1][0])},${fs(e[n+1][1])}`}return l}function vs(e,t=0){if(e.length<3)return xs(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let s=`M${fs(e[0][0])},${fs(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],o=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(o[0]-n[0])*i,h=l(a[1]-(o[1]-n[1])*i);s+=` C${fs(c)},${fs(d)} ${fs(u)},${fs(h)} ${fs(a[0])},${fs(a[1])}`}return s}function ws(e){if(e.length<2)return xs(e);let t=`M${fs(e[0][0])},${fs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],s=(n+l)/2;t+=` C${fs(s)},${fs(a)} ${fs(s)},${fs(i)} ${fs(l)},${fs(i)}`}return t}function Ns(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${fs(e[0][0])},${fs(e[0][1])}`:"monotone"===t?ys(e):"spline"===t?vs(e,r):"bump"===t?ws(e):xs(e)}function ks(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${fs(a[0])},${fs(r)} L${fs(n[0])},${fs(r)} Z`}function Ms(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${fs(e)},${fs(t)}`).join(" L")} Z`}function $s(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const s=a+2*i*Math.PI/n;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function Cs(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${Cs(e,t,r,n,a,l)} ${Cs(e,t,r,n,l,a+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=o(n,a),[u,h]=o(n,l);if(r<=0)return`M${fs(e)},${fs(t)} L${fs(c)},${fs(d)} A${fs(n)},${fs(n)} 0 ${s} 1 ${fs(u)},${fs(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,a);return`M${fs(c)},${fs(d)} A${fs(n)},${fs(n)} 0 ${s} 1 ${fs(u)},${fs(h)} L${fs(m)},${fs(p)} A${fs(r)},${fs(r)} 0 ${s} 0 ${fs(g)},${fs(f)} Z`}function Ls(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function js(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*a:0,o=n?{...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:n?{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 zs(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.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=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,n=Ls(o.map(e=>e.value),c,t),a=Ls([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||a<=n)o.push(e),c+=e.value,d=d.slice(1);else{const e=js(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...js(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 Ps=ee({highlighted:null,setHighlighted:()=>{}});function Ds({children:e}){const[t,r]=Z(null),n=te(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
739
- return de(Ps.Provider,{value:n,children:e})}function Ss(){return le(Ps)}function As(e,t,r=.22){return null===t?null:t===e?1:r}function Bs(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((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function Fs(e,t=720){const[r,n]=Z(t);return Q(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Ts({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=T().charts,h=F(),m=r??(e=>W(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
736
+ /* @__PURE__ */de("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 Oi(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Hi(e){const t=Oi();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function _i(){return Oi()?.matches??!1}function qi(){return!1}function Ui(e){const t=parseInt(e.slice(1,3),16)/255,r=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,r,n),l=Math.min(t,r,n);let i=0,s=0;const o=(a+l)/2;if(a!==l){const e=a-l;s=o>.5?e/(2-a-l):e/(a+l),i=a===t?((r-n)/e+(r<n?6:0))/6:a===r?((n-t)/e+2)/6:((t-r)/e+4)/6}return[360*i,100*s,100*o]}function Vi(e,t,r){r/=100;const n=(t/=100)*Math.min(r,1-r),a=t=>{const a=(t+e/30)%12;return r-n*Math.max(Math.min(a-3,9-a,1),-1)},l=e=>Math.round(255*e).toString(16).padStart(2,"0");return`#${l(a(0))}${l(a(8))}${l(a(4))}`}function Ki(e){const t=e||"system";return"system"===t?_i()?"dark":"light":t}function Yi(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Ui(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Vi(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Vi(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Vi(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Vi(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Vi(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Vi(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Vi(r,Math.min(n+20,100),Math.min(a+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 Gi(e,t,r,n,a){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))),n&&l.style.setProperty("--window-content-rgb",e(n)),a){l.style.setProperty("--custom-button-color",a);const[e,t,r]=Ui(a);l.style.setProperty("--custom-button-hover",Vi(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Zi(e){document.documentElement.setAttribute("data-theme",Ki(e.theme)),Yi(e.accent_color??null),Gi(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 Ji(){const{prefs:e}=i(),t=oe(Hi,_i,qi),r=e.theme||"system",n=e.accent_color||null,a=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 Q(()=>(document.documentElement.setAttribute("data-theme",c),()=>document.documentElement.removeAttribute("data-theme")),[c]),Q(()=>{Yi(n)},[n]),Q(()=>{Gi(n,a,l,s,o)},[n,a,l,s,o]),{theme:r,resolved:c}}function Xi({label:e="Not available"}){/* @__PURE__ */
737
+ return de("span",{className:"text-gray-400",role:"img","aria-label":e,children:m})}function Qi({value:e,precise:t,className:r}){const n=p(e);if(!n)/* @__PURE__ */return de(Xi,{});const a="string"==typeof e?e:n.toISOString();/* @__PURE__ */
738
+ return de("time",{dateTime:a,title:f(a),className:r,children:g(n,{precise:t})})}function es(e,t=300){const[r,n]=Z(e);return Q(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function ts(e,t){Q(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var rs=8,ns=["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)"],as={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},ls={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function is(e){return ns[e]??ls.muted}function ss(e,t,r){return t||(r?as[r]:is(e))}function os(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function cs(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function ds(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function us(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 hs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),s=a>0&&l>0?Math.log10(a)-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,a],o.range=t,o.ticks=e=>{if(e<2||s<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},o}function ms(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function ps(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function gs(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 n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}var fs=e=>e.toFixed(2);function xs(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${fs(e)},${fs(t)}`).join(" ")}function bs(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${fs(e.start)},${fs(e.y)}`,t+=` L${fs(e.end)},${fs(e.y)}`}),t}function ys(e){if(e.length<3)return xs(e);const t=e.length,r=[],n=[];for(let a=0;a<t-1;a+=1){const t=e[a+1][0]-e[a][0];r.push(t),n.push(0===t?0:(e[a+1][1]-e[a][1])/t)}const a=[n[0]];for(let e=1;e<t-1;e+=1)a.push(n[e-1]*n[e]<=0?0:(n[e-1]+n[e])/2);a.push(n[t-2]);for(let e=0;e<t-1;e+=1){if(0===n[e]){a[e]=0,a[e+1]=0;continue}const t=a[e]/n[e],r=a[e+1]/n[e],l=t*t+r*r;if(l>9){const i=3/Math.sqrt(l);a[e]=i*t*n[e],a[e+1]=i*r*n[e]}}let l=`M${fs(e[0][0])},${fs(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${fs(e[n][0]+t)},${fs(e[n][1]+a[n]*t)} ${fs(e[n+1][0]-t)},${fs(e[n+1][1]-a[n+1]*t)} ${fs(e[n+1][0])},${fs(e[n+1][1])}`}return l}function vs(e,t=0){if(e.length<3)return xs(e);const r=e.map(e=>e[1]),n=Math.min(...r),a=Math.max(...r),l=e=>Math.min(a,Math.max(n,e)),i=(1-t)/6;let s=`M${fs(e[0][0])},${fs(e[0][1])}`;for(let t=0;t<e.length-1;t+=1){const r=e[t-1]??e[t],n=e[t],a=e[t+1],o=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(o[0]-n[0])*i,h=l(a[1]-(o[1]-n[1])*i);s+=` C${fs(c)},${fs(d)} ${fs(u)},${fs(h)} ${fs(a[0])},${fs(a[1])}`}return s}function ws(e){if(e.length<2)return xs(e);let t=`M${fs(e[0][0])},${fs(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],s=(n+l)/2;t+=` C${fs(s)},${fs(a)} ${fs(s)},${fs(i)} ${fs(l)},${fs(i)}`}return t}function Ns(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${fs(e[0][0])},${fs(e[0][1])}`:"monotone"===t?ys(e):"spline"===t?vs(e,r):"bump"===t?ws(e):xs(e)}function ks(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${fs(a[0])},${fs(r)} L${fs(n[0])},${fs(r)} Z`}function Ms(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${fs(e)},${fs(t)}`).join(" L")} Z`}function $s(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const s=a+2*i*Math.PI/n;return[e+r*Math.cos(s),t+r*Math.sin(s)]})}function Cs(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${Cs(e,t,r,n,a,l)} ${Cs(e,t,r,n,l,a+2*Math.PI)}`}const s=Math.abs(i)>Math.PI?1:0,o=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=o(n,a),[u,h]=o(n,l);if(r<=0)return`M${fs(e)},${fs(t)} L${fs(c)},${fs(d)} A${fs(n)},${fs(n)} 0 ${s} 1 ${fs(u)},${fs(h)} Z`;const[m,p]=o(r,l),[g,f]=o(r,a);return`M${fs(c)},${fs(d)} A${fs(n)},${fs(n)} 0 ${s} 1 ${fs(u)},${fs(h)} L${fs(m)},${fs(p)} A${fs(r)},${fs(r)} 0 ${s} 0 ${fs(g)},${fs(f)} Z`}function Ls(e,t,r){if(0===e.length||t<=0||r<=0)return 1/0;const n=Math.max(...e),a=Math.min(...e),l=t*t,i=r*r;return Math.max(i*n/l,l/(i*a))}function js(e,t,r,n){const a=n?r.height:r.width,l=a>0?t/a:0;let i=0;return{tiles:e.map(e=>{const s=t>0?e.value/t*a:0,o=n?{...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:n?{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 zs(e,t,r){const n=e.filter(e=>e.value>0).sort((e,t)=>t.value-e.value);if(0===n.length||t<=0||r<=0)return[];const a=n.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=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(s.width,s.height),r=s.width>=s.height,n=Ls(o.map(e=>e.value),c,t),a=Ls([...o.map(e=>e.value),e.value],c+e.value,t);if(0===o.length||a<=n)o.push(e),c+=e.value,d=d.slice(1);else{const e=js(o,c,s,r);i.push(...e.tiles),s=e.rest,o=[],c=0}}o.length>0&&i.push(...js(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 Ds=ee({highlighted:null,setHighlighted:()=>{}});function Ps({children:e}){const[t,r]=Z(null),n=te(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
739
+ return de(Ds.Provider,{value:n,children:e})}function Ss(){return le(Ds)}function As(e,t,r=.22){return null===t?null:t===e?1:r}function Bs(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((n,a)=>{if("number"!=typeof n||!Number.isFinite(n))return;if(null===r)return void(r=a);const l=e[r];("max"===t?n>l:n<l)&&(r=a)}),r}function Fs(e,t=720){const[r,n]=Z(t);return Q(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function Ts({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:s=30,animate:o=!0,className:c,emptyLabel:d}){const u=T().charts,h=F(),m=r??(e=>W(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
740
740
  return de("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=Bs(e.map(e=>e.value),a),f=n??(null===g?void 0:e[g]?.key),x=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),b=is(0);/* @__PURE__ */
741
741
  return de("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,n=r?l?as[l]:is(1):f?ls.muted:b,a=Number.isFinite(e.value)?e.value:null,s=null!==a&&x>0?Math.max(0,Math.min(1,a/x)):0;/* @__PURE__ */
742
742
  return ue("li",{className:"grid gap-1",children:[
@@ -757,7 +757,7 @@ return ue("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-
757
757
  /* @__PURE__ */ue("span",{className:"flex items-baseline gap-1.5",children:[
758
758
  /* @__PURE__ */de("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */de("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */ue("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
759
759
  /* @__PURE__ */de("span",{"aria-hidden":"true",children:Ws[u].glyph})," ",W(Math.abs(n),d),
760
- /* @__PURE__ */ue("span",{className:"sr-only",children:[" ",c[Ws[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */de(si,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),s&&/* @__PURE__ */de("span",{className:"mt-1 text-xs text-gray-500",children:s})]})}function Os({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=T().charts,s=a??i.loading,o=`${J()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
760
+ /* @__PURE__ */ue("span",{className:"sr-only",children:[" ",c[Ws[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */de(si,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),s&&/* @__PURE__ */de("span",{className:"mt-1 text-xs text-gray-500",children:s})]})}function Os({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=T().charts,s=a??i.loading,o=`${X()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
761
761
  return de("div",{className:l,children:/* @__PURE__ */ue("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":s,"aria-busy":"true",children:[
762
762
  /* @__PURE__ */de("defs",{children:/* @__PURE__ */ue("linearGradient",{id:o,x1:"0",y1:"0",x2:"1",y2:"0",children:[
763
763
  /* @__PURE__ */de("stop",{offset:"0%",stopColor:ls.surface,stopOpacity:"0"}),
@@ -777,7 +777,7 @@ return de("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor
777
777
  return de("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!==n&&n!==e.key,s=/* @__PURE__ */ue(he,{children:[
778
778
  /* @__PURE__ */de(Hs,{shape:e.swatch??r,colour:ss(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
779
779
  return de("li",{className:"list-none",children:t?/* @__PURE__ */de("button",{type:"button",onMouseEnter:()=>a(e.key),onMouseLeave:()=>a(null),onFocus:()=>a(e.key),onBlur:()=>a(null),className:"flex items-center gap-2 rounded text-xs text-gray-600 transition-opacity rosh-focus-outline "+(i?"opacity-40":""),children:s}):/* @__PURE__ */de("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:s})},e.key)})})}function qs({title:e,subtitle:t,legend:r,table:n,tableLabel:a,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=T().charts;/* @__PURE__ */
780
- return de(Ds,{children:/* @__PURE__ */ue("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:[
780
+ return de(Ps,{children:/* @__PURE__ */ue("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:[
781
781
  /* @__PURE__ */ue("header",{className:"flex items-start justify-between gap-4",children:[
782
782
  /* @__PURE__ */ue("div",{className:"min-w-0",children:[
783
783
  /* @__PURE__ */de("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */de("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */de("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */de(Os,{variant:s,height:o}):/* @__PURE__ */de("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */de(_s,{entries:r,interactive:c,fallbackSwatch:d}),!i&&n&&/* @__PURE__ */ue("details",{className:"border-t border-gray-100 pt-3",children:[
@@ -789,22 +789,22 @@ return ue("div",{role:"status",className:`pointer-events-none min-w-44 rounded-x
789
789
  /* @__PURE__ */de("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
790
790
  /* @__PURE__ */de("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */de("p",{className:"mt-2 text-[11px] text-gray-500",children:n})]})}function Vs({cx:e,cy:t,color:r,variant:n="default",pulse:a=!1,title:l}){const i="border"===n?3:"colored-border"===n?1.5:0,s="border"===n?3:3.5;/* @__PURE__ */
791
791
  return ue("g",{children:[a&&/* @__PURE__ */de("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:s,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */de("circle",{cx:e,cy:t,r:s+i,fill:ls.surface}),
792
- /* @__PURE__ */de("circle",{cx:e,cy:t,r:s,fill:"colored-border"===n?ls.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */de("title",{children:l})})]})}function Ks({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:s}){const o=T().charts,c=X(null),d=e.length-1,[u,h]=r,m=i??ss(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=>a-e/x*(a-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=y[y.length-1];n&&n.to===r-1?n.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${b(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},N=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=X(null),M=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},$=e=>t=>{k.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))},C=e=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
792
+ /* @__PURE__ */de("circle",{cx:e,cy:t,r:s,fill:"colored-border"===n?ls.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */de("title",{children:l})})]})}function Ks({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:s}){const o=T().charts,c=J(null),d=e.length-1,[u,h]=r,m=i??ss(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=>a-e/x*(a-6),y=[];e.forEach((e,r)=>{if(!g(t[r]))return;const n=y[y.length-1];n&&n.to===r-1?n.to=r:y.push({from:r,to:r})});const v=y.map(e=>{const r=[];for(let n=e.from;n<=e.to;n+=1)r.push(`${n===e.from?"M":"L"}${p(n).toFixed(2)},${b(t[n]).toFixed(2)}`);return`${r.join(" ")} L${p(e.to).toFixed(2)},${a} L${p(e.from).toFixed(2)},${a} Z`}).join(" "),w=(e,t)=>{const r=Math.max(0,Math.min(d,t));n("from"===e?[Math.min(r,h-1),h]:[u,Math.max(r,u+1)])},N=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=J(null),M=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},$=e=>t=>{k.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))},C=e=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
793
793
  return de("rect",{x:p(r)-4.5,y:0,width:9,height:a,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:N(t),onPointerDown:M(t),onPointerMove:$(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
794
794
  return de("div",{className:s,children:/* @__PURE__ */ue("svg",{ref:c,width:"100%",height:a,viewBox:`0 0 ${l} ${a}`,role:"group","aria-label":o.window(e[u],e[h],e.length),children:[
795
795
  /* @__PURE__ */de("path",{d:v,fill:ls.grid}),
796
796
  /* @__PURE__ */de("rect",{x:0,y:0,width:p(u),height:a,fill:ls.surface,fillOpacity:.72}),
797
797
  /* @__PURE__ */de("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:ls.surface,fillOpacity:.72}),
798
- /* @__PURE__ */de("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function Ys(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function Gs({labels:e,values:t,height:r=220,width:n,bandPadding:a=.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 f=T().charts,x=F(),b=o??(e=>W(e,x)),y=g??f.noData,v=X(null),w=Fs(v),N=n??w,[k,M]=Z(null),$=J();if(Q(()=>{if(null!==k)return D(e=>"Escape"===e.key&&(M(null),!0))},[k]),0===e.length)/* @__PURE__ */
799
- return de("div",{className:p,ref:v,children:/* @__PURE__ */de("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const C={top:12,right:16,bottom:26,left:c?58:48},L=C.left,j=Math.max(L+1,N-C.right),z=C.top,P=r-C.bottom,S=t.filter(Number.isFinite),A=l??Math.min(0,...S),B=os([A,i??us(Math.max(...S,0))],{from:P,to:z}),E=cs(e.length,{from:L,to:j},a),I=B.ticks(s+1),R=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(N/84))));/* @__PURE__ */
798
+ /* @__PURE__ */de("rect",{x:p(u),y:0,width:Math.max(1,p(h)-p(u)),height:a,fill:"none",stroke:m,strokeWidth:1}),L("from"),L("to")]})})}function Ys(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function Gs({labels:e,values:t,height:r=220,width:n,bandPadding:a=.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 f=T().charts,x=F(),b=o??(e=>W(e,x)),y=g??f.noData,v=J(null),w=Fs(v),N=n??w,[k,M]=Z(null),$=X();if(Q(()=>{if(null!==k)return P(e=>"Escape"===e.key&&(M(null),!0))},[k]),0===e.length)/* @__PURE__ */
799
+ return de("div",{className:p,ref:v,children:/* @__PURE__ */de("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:y})});const C={top:12,right:16,bottom:26,left:c?58:48},L=C.left,j=Math.max(L+1,N-C.right),z=C.top,D=r-C.bottom,S=t.filter(Number.isFinite),A=l??Math.min(0,...S),B=os([A,i??us(Math.max(...S,0))],{from:D,to:z}),E=cs(e.length,{from:L,to:j},a),I=B.ticks(s+1),R=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(N/84))));/* @__PURE__ */
800
800
  return ue("div",{className:`relative ${p??""}`,ref:v,children:[
801
801
  /* @__PURE__ */ue("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:()=>M(null),onBlur:()=>M(null),onKeyDown:t=>{if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;M(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
802
- /* @__PURE__ */de("defs",{children:/* @__PURE__ */de("clipPath",{id:$,children:/* @__PURE__ */de("rect",{x:L,y:z,width:j-L,height:P-z})})}),I.map(e=>/* @__PURE__ */de("line",{x1:L,y1:B(e),x2:j,y2:B(e),stroke:ls.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
803
- /* @__PURE__ */de("line",{x1:L,y1:B(Math.max(A,0)),x2:j,y2:B(Math.max(A,0)),stroke:ls.axis,strokeWidth:1,shapeRendering:"crispEdges"}),I.map(e=>/* @__PURE__ */de("text",{x:L-8,y:B(e)+4,textAnchor:"end",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)},`t${e}`)),c&&/* @__PURE__ */de("text",{x:14,y:(z+P)/2,transform:`rotate(-90 14 ${(z+P)/2})`,textAnchor:"middle",fontSize:11,fill:ls.label,children:c}),
804
- /* @__PURE__ */de("g",{clipPath:`url(#${$})`,children:u({x:E,y:B,left:L,right:j,top:z,bottom:P,width:N,height:r,clipId:$,active:k})}),e.map((e,t)=>t%R===0?/* @__PURE__ */de("text",{x:"start"===d?E(t):E.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */de("rect",{x:E.center(r)-(j-L)/e.length/2,y:z,width:(j-L)/e.length,height:P-z,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==k&&
805
- /* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 z-10",style:Ys(E.center(k),E.bandwidth,N),children:h(k)})]})}var Zs=12,Xs=16,Js=26,Qs=52,eo=e=>"number"==typeof e&&Number.isFinite(e);function to({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="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:f=!1,brush:x=!1,range:b,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:N="left-to-right",fillVariant:k="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const j=T().charts,z=F(),P=d??(e=>W(e,z)),S=L??j.noData,A=X(null),B=Fs(A),E=$??B,[I,R]=Z(null),[H,_]=Z(null),{highlighted:q}=Ss(),U=J();if(Q(()=>{if(null!==I)return D(e=>"Escape"===e.key&&(R(null),!0))},[I]),v)/* @__PURE__ */
802
+ /* @__PURE__ */de("defs",{children:/* @__PURE__ */de("clipPath",{id:$,children:/* @__PURE__ */de("rect",{x:L,y:z,width:j-L,height:D-z})})}),I.map(e=>/* @__PURE__ */de("line",{x1:L,y1:B(e),x2:j,y2:B(e),stroke:ls.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
803
+ /* @__PURE__ */de("line",{x1:L,y1:B(Math.max(A,0)),x2:j,y2:B(Math.max(A,0)),stroke:ls.axis,strokeWidth:1,shapeRendering:"crispEdges"}),I.map(e=>/* @__PURE__ */de("text",{x:L-8,y:B(e)+4,textAnchor:"end",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)},`t${e}`)),c&&/* @__PURE__ */de("text",{x:14,y:(z+D)/2,transform:`rotate(-90 14 ${(z+D)/2})`,textAnchor:"middle",fontSize:11,fill:ls.label,children:c}),
804
+ /* @__PURE__ */de("g",{clipPath:`url(#${$})`,children:u({x:E,y:B,left:L,right:j,top:z,bottom:D,width:N,height:r,clipId:$,active:k})}),e.map((e,t)=>t%R===0?/* @__PURE__ */de("text",{x:"start"===d?E(t):E.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */de("rect",{x:E.center(r)-(j-L)/e.length/2,y:z,width:(j-L)/e.length,height:D-z,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==k&&
805
+ /* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 z-10",style:Ys(E.center(k),E.bandwidth,N),children:h(k)})]})}var Zs=12,Js=16,Xs=26,Qs=52,eo=e=>"number"==typeof e&&Number.isFinite(e);function to({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="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:f=!1,brush:x=!1,range:b,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:N="left-to-right",fillVariant:k="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const j=T().charts,z=F(),D=d??(e=>W(e,z)),S=L??j.noData,A=J(null),B=Fs(A),E=$??B,[I,R]=Z(null),[H,_]=Z(null),{highlighted:q}=Ss(),U=X();if(Q(()=>{if(null!==I)return P(e=>"Escape"===e.key&&(R(null),!0))},[I]),v)/* @__PURE__ */
806
806
  return de("div",{className:C,ref:A,children:/* @__PURE__ */de(Os,{height:r,width:$??B})});const V=t,K=b??H??[0,Math.max(0,V.length-1)],[Y,G]=K,ee=e=>x?e.slice(Y,G+1):e,te=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(eo)).map(e=>({...e,data:ee(e.data)}));if(t=ee(V),0===te.length||0===t.length)/* @__PURE__ */
807
- return de("div",{className:C,ref:A,children:/* @__PURE__ */de("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:S})});const re={left:Qs,right:Math.max(Qs+1,E-Xs),top:Zs,bottom:r-Js},ne=cs(t.length,{from:re.left,to:re.right}),ae=t.map((e,t)=>te.reduce((e,r)=>e+(eo(r.data[t])?r.data[t]:0),0)),le=(e,t)=>ae[t]>0?e/ae[t]:null,ie=[];if(n){let e=t.map(()=>0);for(const t of te)e=e.map((e,r)=>e+(eo(t.data[r])?t.data[r]:0)),ie.push("percent"===a?e.map((e,t)=>le(e,t)):[...e])}const se=l&&l.length>0?ds(l,{from:re.bottom,to:re.top}):null,oe=n?(ie.at(-1)??[]).filter(eo):te.flatMap(e=>e.data.filter(eo)),ce=os([0,n&&"percent"===a?1:o??us(Math.max(...oe,0))],{from:re.bottom,to:re.top}),he=e=>se?se(e):ce(e),me=n&&"percent"===a?e=>O(Math.round(100*e),0,z):P,pe=se?se.levels.map(e=>({value:e,y:se(e)})):ce.ticks(c+1).map(e=>({value:e,y:ce(e)})),ge=e=>r=>{r.preventDefault(),R(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},fe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(E/96))));/* @__PURE__ */
807
+ return de("div",{className:C,ref:A,children:/* @__PURE__ */de("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:S})});const re={left:Qs,right:Math.max(Qs+1,E-Js),top:Zs,bottom:r-Xs},ne=cs(t.length,{from:re.left,to:re.right}),ae=t.map((e,t)=>te.reduce((e,r)=>e+(eo(r.data[t])?r.data[t]:0),0)),le=(e,t)=>ae[t]>0?e/ae[t]:null,ie=[];if(n){let e=t.map(()=>0);for(const t of te)e=e.map((e,r)=>e+(eo(t.data[r])?t.data[r]:0)),ie.push("percent"===a?e.map((e,t)=>le(e,t)):[...e])}const se=l&&l.length>0?ds(l,{from:re.bottom,to:re.top}):null,oe=n?(ie.at(-1)??[]).filter(eo):te.flatMap(e=>e.data.filter(eo)),ce=os([0,n&&"percent"===a?1:o??us(Math.max(...oe,0))],{from:re.bottom,to:re.top}),he=e=>se?se(e):ce(e),me=n&&"percent"===a?e=>O(Math.round(100*e),0,z):D,pe=se?se.levels.map(e=>({value:e,y:se(e)})):ce.ticks(c+1).map(e=>({value:e,y:ce(e)})),ge=e=>r=>{r.preventDefault(),R(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},fe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(E/96))));/* @__PURE__ */
808
808
  return ue("div",{className:`relative ${C??""}`,ref:A,children:[
809
809
  /* @__PURE__ */ue("svg",{width:"100%",height:r,viewBox:`0 0 ${E} ${r}`,role:"img","aria-label":j.overIntervals(te.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:()=>R(null),onBlur:()=>R(null),onKeyDown:e=>{"ArrowRight"===e.key&&ge(1)(e),"ArrowLeft"===e.key&&ge(-1)(e)},children:[
810
810
  /* @__PURE__ */de("defs",{children:/* @__PURE__ */de("clipPath",{id:U,children:/* @__PURE__ */de("rect",{x:re.left,y:re.top,width:re.right-re.left,height:re.bottom-re.top})})}),
@@ -819,19 +819,19 @@ return ue("g",{opacity:o??void 0,className:"rosh-viz-mark",children:[("area"===l
819
819
  /* @__PURE__ */de("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:ma(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?ba.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??as[e.tone??"critical"],n=he(e.value);/* @__PURE__ */
820
820
  return ue("g",{children:[
821
821
  /* @__PURE__ */de("line",{x1:re.left,y1:n,x2:re.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */de("text",{x:re.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&te.map((e,r)=>{const a=p??(m?"last":"none"),l=ss(e.slot,e.color,e.tone),i=[...e.data].map(eo).lastIndexOf(!0),s="all"===a?t.map((e,t)=>t).filter(t=>eo(n?ie[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
822
- return ue("g",{children:[s.map(a=>{const s=n?ie[r]?.[a]:e.data[a];return eo(s)?/* @__PURE__ */de(Vs,{cx:ne.center(a),cy:he(s),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${P(s)}`},a):null}),m&&i>=0&&eo(n?ie[r]?.[i]:e.data[i])&&/* @__PURE__ */de("text",{x:ne.center(i)-10,y:he(n?ie[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:P(n?ie[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */de("text",{x:ne.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==I&&/* @__PURE__ */de("line",{x1:ne.center(I),y1:re.top,x2:ne.center(I),y2:re.bottom,stroke:ls.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */de("rect",{x:ne(t),y:re.top,width:Math.max(1,ne.bandwidth),height:re.bottom-re.top,fill:"transparent",onMouseEnter:()=>R(t)},`hit-${t}`))]}),x&&V.length>2&&/* @__PURE__ */de(Ks,{className:"mt-1",labels:V,width:E,data:e[0]?.data??[],range:K,onRangeChange:e=>{y?y(e):_(e)}}),null!==I&&
823
- /* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 z-10",style:Ys(ne.center(I),ne.bandwidth,E),children:/* @__PURE__ */de(Us,{title:t[I],rows:te.map((e,t)=>({key:e.key,label:e.label,color:ss(e.slot,e.color,e.tone),value:eo(e.data[I])?n&&"percent"===a?`${O(100*(le(e.data[I],I)??0),1,z)} · ${P(e.data[I])}`:P(e.data[I]):void 0})),footnote:n&&"percent"===a?j.inBucket(P(ae[I])):void 0})})]})}function ro({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=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=J(),{highlighted:y}=Ss(),v=T().charts,w=F(),N=s??(e=>W(e,w));if(h)/* @__PURE__ */return de(Os,{height:a,width:l,variant:"bars",className:c});const k=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>k.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>k.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>k.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),j=r&&"percent"===n,z=(e,t)=>$[t]>0?e/$[t]:null,P=j?[1]:r?[...C,...L]:k.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
824
- return de(Gs,{labels:t,values:P,height:a,width:l,max:j?1:i,formatValue:j?e=>O(Math.round(100*e),0,w):N,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(k.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */de(Us,{title:t[e],rows:k.map(t=>({key:t.key,label:t.label,color:ss(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?j?`${O(100*(z(t.data[e],e)??0),1,w)} · ${N(t.data[e])}`:N(t.data[e]):void 0})),footnote:j?v.inCategory(N($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,s=Bs(r?$:k[0]?.data??[],x),o=l??(i>=0?i:s);/* @__PURE__ */
822
+ return ue("g",{children:[s.map(a=>{const s=n?ie[r]?.[a]:e.data[a];return eo(s)?/* @__PURE__ */de(Vs,{cx:ne.center(a),cy:he(s),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${D(s)}`},a):null}),m&&i>=0&&eo(n?ie[r]?.[i]:e.data[i])&&/* @__PURE__ */de("text",{x:ne.center(i)-10,y:he(n?ie[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:D(n?ie[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%fe===0?/* @__PURE__ */de("text",{x:ne.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==I&&/* @__PURE__ */de("line",{x1:ne.center(I),y1:re.top,x2:ne.center(I),y2:re.bottom,stroke:ls.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */de("rect",{x:ne(t),y:re.top,width:Math.max(1,ne.bandwidth),height:re.bottom-re.top,fill:"transparent",onMouseEnter:()=>R(t)},`hit-${t}`))]}),x&&V.length>2&&/* @__PURE__ */de(Ks,{className:"mt-1",labels:V,width:E,data:e[0]?.data??[],range:K,onRangeChange:e=>{y?y(e):_(e)}}),null!==I&&
823
+ /* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 z-10",style:Ys(ne.center(I),ne.bandwidth,E),children:/* @__PURE__ */de(Us,{title:t[I],rows:te.map((e,t)=>({key:e.key,label:e.label,color:ss(e.slot,e.color,e.tone),value:eo(e.data[I])?n&&"percent"===a?`${O(100*(le(e.data[I],I)??0),1,z)} · ${D(e.data[I])}`:D(e.data[I]):void 0})),footnote:n&&"percent"===a?j.inBucket(D(ae[I])):void 0})})]})}function ro({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=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=X(),{highlighted:y}=Ss(),v=T().charts,w=F(),N=s??(e=>W(e,w));if(h)/* @__PURE__ */return de(Os,{height:a,width:l,variant:"bars",className:c});const k=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),M=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},$=t.map((e,t)=>k.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>k.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>k.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),j=r&&"percent"===n,z=(e,t)=>$[t]>0?e/$[t]:null,D=j?[1]:r?[...C,...L]:k.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
824
+ return de(Gs,{labels:t,values:D,height:a,width:l,max:j?1:i,formatValue:j?e=>O(Math.round(100*e),0,w):N,yAxisLabel:o,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(k.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */de(Us,{title:t[e],rows:k.map(t=>({key:t.key,label:t.label,color:ss(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?j?`${O(100*(z(t.data[e],e)??0),1,w)} · ${N(t.data[e])}`:N(t.data[e]):void 0})),footnote:j?v.inCategory(N($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,s=Bs(r?$:k[0]?.data??[],x),o=l??(i>=0?i:s);/* @__PURE__ */
825
825
  return ue("g",{children:[
826
- /* @__PURE__ */de(fa,{id:b,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,k.length));let i=0,s=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return k.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=j?z(h,a):h;if(null===f)return null;const x=ss(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,N,M=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=n(Math.max(e,t)),N=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),N=Math.max(n(f),c);const $=Math.max(0,N-w-(r&&!M?2:0)),C=null===o||o===a,L=C?x:g?ls.muted:x,P=As(t.key,y);/* @__PURE__ */
827
- return de("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:P??(C?1:g?.32:.45),filter:p&&o===a?`url(#${ca(b)})`:void 0,className:"rosh-viz-mark"+(m?` ${ba.rise}`:""),style:m?ya(a*(r?1:k.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */de("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:ls.axis,strokeWidth:1})]})}})}var no=3;function ao({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=T().charts,g=F(),f=l??(e=>W(e,g)),x=i??(e=>W(e,g)),b=m??p.noObservations,y=X(null),v=Fs(y),w=r??v,N=J(),[k,M]=Z(null);Q(()=>{if(null!==k)return D(e=>"Escape"===e.key&&(M(null),!0))},[k]);const $=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=s||o?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,s)&&$(e.y,o))})).filter(e=>e.points.length>0):C,j=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
828
- return de("div",{className:h,ref:y,children:/* @__PURE__ */de("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:b})});const z=L.flatMap(e=>e.points),P=z.some(e=>null!=e.size),S=14,A=20,B=34,E=52,I=Math.max(E+1,w-A),R=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,us(Math.max(...e))];return"log"===r?hs(i,n):os(i,n)},O=R(z.map(e=>e.x),s,c,{from:E,to:I}),H=R(z.map(e=>e.y),o,d,{from:t-B,to:S}),_=ps([0,Math.max(...z.map(e=>e.size??1))],{from:u[0],to:u[1]}),q=k?L[k.s]:void 0,U=k&&q?q.points[k.i]:void 0,V=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
826
+ /* @__PURE__ */de(fa,{id:b,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,k.length));let i=0,s=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return k.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=j?z(h,a):h;if(null===f)return null;const x=ss(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,N,M=!0;if(r){const e=f>=0?i:s,t=e+f;f>=0?i=t:s=t,w=n(Math.max(e,t)),N=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),N=Math.max(n(f),c);const $=Math.max(0,N-w-(r&&!M?2:0)),C=null===o||o===a,L=C?x:g?ls.muted:x,D=As(t.key,y);/* @__PURE__ */
827
+ return de("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===a?`url(#${ca(b)})`:void 0,className:"rosh-viz-mark"+(m?` ${ba.rise}`:""),style:m?ya(a*(r?1:k.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */de("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:ls.axis,strokeWidth:1})]})}})}var no=3;function ao({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:s,yDomain:o,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=T().charts,g=F(),f=l??(e=>W(e,g)),x=i??(e=>W(e,g)),b=m??p.noObservations,y=J(null),v=Fs(y),w=r??v,N=X(),[k,M]=Z(null);Q(()=>{if(null!==k)return P(e=>"Escape"===e.key&&(M(null),!0))},[k]);const $=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.filter(e=>e.points.length>0).slice(0,3),L=s||o?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,s)&&$(e.y,o))})).filter(e=>e.points.length>0):C,j=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
828
+ return de("div",{className:h,ref:y,children:/* @__PURE__ */de("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:b})});const z=L.flatMap(e=>e.points),D=z.some(e=>null!=e.size),S=14,A=20,B=34,E=52,I=Math.max(E+1,w-A),R=(e,t,r,n)=>{const a=e.filter(e=>e>0),l="log"===r?a.length>0?Math.min(...a):0:Math.min(0,...e),i=t??[l,us(Math.max(...e))];return"log"===r?hs(i,n):os(i,n)},O=R(z.map(e=>e.x),s,c,{from:E,to:I}),H=R(z.map(e=>e.y),o,d,{from:t-B,to:S}),_=ps([0,Math.max(...z.map(e=>e.size??1))],{from:u[0],to:u[1]}),q=k?L[k.s]:void 0,U=k&&q?q.points[k.i]:void 0,V=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
829
829
  return ue("div",{className:`relative ${h??""}`,ref:y,children:[
830
830
  /* @__PURE__ */ue("svg",{width:"100%",height:t,viewBox:`0 0 ${w} ${t}`,role:"img","aria-label":p.scatter(L.map(e=>e.label),a??p.yAxis,n??p.xAxis)+(j>0?`. ${p.outsideRange(j)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>M(null),onBlur:()=>M(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?V.findIndex(e=>e.s===k.s&&e.i===k.i):0;M(V[Math.min(V.length-1,Math.max(0,r+t))])},children:[
831
831
  /* @__PURE__ */de("defs",{children:/* @__PURE__ */de("clipPath",{id:N,children:/* @__PURE__ */de("rect",{x:E-u[1],y:S-u[1],width:I-E+2*u[1],height:t-B-S+2*u[1]})})}),H.ticks(5).map(e=>/* @__PURE__ */ue("g",{children:[
832
832
  /* @__PURE__ */de("line",{x1:E,y1:H(e),x2:I,y2:H(e),stroke:ls.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
833
833
  /* @__PURE__ */de("text",{x:E-8,y:H(e)+4,textAnchor:"end",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)})]},`y${e}`)),O.ticks(5).map(e=>/* @__PURE__ */de("text",{x:O(e),y:t-12,textAnchor:"middle",fontSize:11,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */de("text",{x:(E+I)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:ls.label,children:n}),a&&/* @__PURE__ */de("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:ls.label,children:a}),
834
- /* @__PURE__ */de("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=ss(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */de("circle",{cx:O(n.x),cy:H(n.y),r:P?_(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:ls.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&q&&U&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:U.label??q.label,rows:[{key:"x",label:n??p.xAxis,color:ss(k.s,q.color,q.tone),value:f(U.x)},{key:"y",label:a??p.yAxis,color:ss(k.s,q.color,q.tone),value:x(U.y)},...null!=U.size?[{key:"size",label:p.size,color:ls.muted,value:W(U.size,g)}]:[]],footnote:U.label?q.label:void 0})})]})}function lo({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=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=T().charts,x=F(),b=o??(e=>W(e,x)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=ss(0,d,u);/* @__PURE__ */
834
+ /* @__PURE__ */de("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=ss(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */de("circle",{cx:O(n.x),cy:H(n.y),r:D?_(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:ls.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&q&&U&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:U.label??q.label,rows:[{key:"x",label:n??p.xAxis,color:ss(k.s,q.color,q.tone),value:f(U.x)},{key:"y",label:a??p.yAxis,color:ss(k.s,q.color,q.tone),value:x(U.y)},...null!=U.size?[{key:"size",label:p.size,color:ls.muted,value:W(U.size,g)}]:[]],footnote:U.label?q.label:void 0})})]})}function lo({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=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=T().charts,x=F(),b=o??(e=>W(e,x)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=ss(0,d,u);/* @__PURE__ */
835
835
  return de(Gs,{labels:t,values:v,height:a,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__ */de(Us,{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:a,active:l})=>"bar"===r?/* @__PURE__ */de("g",{children:e.map((e,r)=>/* @__PURE__ */de("rect",{x:t(r),y:a(e.high),width:Math.max(1,t.bandwidth),height:Math.max(1,a(e.low)-a(e.high)),rx:g,fill:w,fillOpacity:null===l||l===r?.85:.4},r))}):/* @__PURE__ */ue("g",{children:[(()=>{const r=e.map((e,r)=>[t.center(r),a(e.high)]),l=e.map((e,r)=>[t.center(r),a(e.low)]);/* @__PURE__ */
836
836
  return ue(he,{children:[
837
837
  /* @__PURE__ */de("path",{d:Ms(Ns(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
@@ -856,21 +856,21 @@ return de(Us,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.ope
856
856
  return ue("g",{opacity:d?.45:1,children:[
857
857
  /* @__PURE__ */de("line",{x1:o,y1:n(e.high),x2:o,y2:n(e.low),stroke:s,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */de("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__ */ue(he,{children:[
858
858
  /* @__PURE__ */de("line",{x1:o-c/2,y1:n(e.open),x2:o,y2:n(e.open),stroke:s,strokeWidth:2}),
859
- /* @__PURE__ */de("line",{x1:o,y1:n(e.close),x2:o+c/2,y2:n(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function uo({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=T().charts,p=F(),g=s??(e=>W(e,p)),f=o??m.intensity,x=d??m.noActivity,b=X(null),y=Fs(b),v=a??y,w=J(),[N,k]=Z(null);if(Q(()=>{if(null!==N)return D(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
860
- return de("div",{className:c,ref:b,children:/* @__PURE__ */de("p",{className:"py-8 text-center text-sm text-gray-500",children:x})});const M=l??ss(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,j=n??L+26+26,z=Math.max(2,(Math.max(97,v)-C)/t.length),P=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${ls.surface})`};/* @__PURE__ */
859
+ /* @__PURE__ */de("line",{x1:o,y1:n(e.close),x2:o+c/2,y2:n(e.close),stroke:s,strokeWidth:2})]})]},l)})})})}function uo({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:s,label:o,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=T().charts,p=F(),g=s??(e=>W(e,p)),f=o??m.intensity,x=d??m.noActivity,b=J(null),y=Fs(b),v=a??y,w=X(),[N,k]=Z(null);if(Q(()=>{if(null!==N)return P(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
860
+ return de("div",{className:c,ref:b,children:/* @__PURE__ */de("p",{className:"py-8 text-center text-sm text-gray-500",children:x})});const M=l??ss(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,j=n??L+26+26,z=Math.max(2,(Math.max(97,v)-C)/t.length),D=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${ls.surface})`};/* @__PURE__ */
861
861
  return ue("div",{className:`relative ${c??""}`,ref:b,children:[
862
862
  /* @__PURE__ */ue("svg",{width:"100%",height:j,viewBox:`0 0 ${v} ${j}`,role:"img","aria-label":m.heatmap(f,e.length,t.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
863
863
  /* @__PURE__ */de("defs",{children:/* @__PURE__ */ue("linearGradient",{id:w,x1:"0",x2:"1",children:[
864
- /* @__PURE__ */de("stop",{offset:"0",stopColor:P(0)}),
865
- /* @__PURE__ */de("stop",{offset:"1",stopColor:P($)})]})}),e.map((e,t)=>/* @__PURE__ */de("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:ls.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=N&&(N.r!==n||N.c!==a);/* @__PURE__ */
866
- return de("rect",{x:C+a*z+u/2,y:26*n+u/2,width:Math.max(1,z-u),height:26-u,rx:h,fill:P(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */de("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */de("text",{x:C+r*z+z/2,y:L+15,textAnchor:"middle",fontSize:11,fill:ls.label,children:e},`c${r}`):null),
864
+ /* @__PURE__ */de("stop",{offset:"0",stopColor:D(0)}),
865
+ /* @__PURE__ */de("stop",{offset:"1",stopColor:D($)})]})}),e.map((e,t)=>/* @__PURE__ */de("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:ls.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=N&&(N.r!==n||N.c!==a);/* @__PURE__ */
866
+ return de("rect",{x:C+a*z+u/2,y:26*n+u/2,width:Math.max(1,z-u),height:26-u,rx:h,fill:D(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */de("title",{children:`${e} · ${t}: ${g(l)}`})},`${n}-${a}`)})),t.map((e,r)=>r%Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor((v-C)/56))))===0?/* @__PURE__ */de("text",{x:C+r*z+z/2,y:L+15,textAnchor:"middle",fontSize:11,fill:ls.label,children:e},`c${r}`):null),
867
867
  /* @__PURE__ */de("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
868
868
  /* @__PURE__ */de("text",{x:C,y:L+48,fontSize:10.5,fill:ls.label,children:"0"}),
869
869
  /* @__PURE__ */de("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:10.5,fill:ls.label,style:{fontVariantNumeric:"tabular-nums"},children:g($)})]}),N&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */de(Us,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:f,color:M,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function ho({caption:e,head:t,rows:r}){/* @__PURE__ */
870
870
  return ue("table",{className:"sr-only",children:[
871
871
  /* @__PURE__ */de("caption",{children:e}),
872
872
  /* @__PURE__ */de("thead",{children:/* @__PURE__ */de("tr",{children:t.map(e=>/* @__PURE__ */de("th",{scope:"col",children:e},e))})}),
873
- /* @__PURE__ */de("tbody",{children:r.map((e,t)=>/* @__PURE__ */de("tr",{children:e.map((e,t)=>/* @__PURE__ */de("td",{children:e},t))},t))})]})}var mo=3,po=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function go({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=T().charts,u=F(),h=i??(e=>W(e,u)),m=c??d.nothingToCompare,p=J(),[g,f]=Z(null),{highlighted:x}=Ss(),b=t.slice(0,3);if(e.length<3||0===b.length)/* @__PURE__ */
873
+ /* @__PURE__ */de("tbody",{children:r.map((e,t)=>/* @__PURE__ */de("tr",{children:e.map((e,t)=>/* @__PURE__ */de("td",{children:e},t))},t))})]})}var mo=3,po=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function go({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:s=!0,className:o,emptyLabel:c}){const d=T().charts,u=F(),h=i??(e=>W(e,u)),m=c??d.nothingToCompare,p=X(),[g,f]=Z(null),{highlighted:x}=Ss(),b=t.slice(0,3);if(e.length<3||0===b.length)/* @__PURE__ */
874
874
  return de("p",{className:`text-sm text-gray-500 ${o??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,N=ms(e.length),k=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))),M=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},$=(e,t)=>null!==g?g!==e:null!==x&&x!==t,C=null!==g?b[g]:void 0;/* @__PURE__ */
875
875
  return ue("div",{className:`relative ${o??""}`,children:[
876
876
  /* @__PURE__ */ue("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
@@ -884,19 +884,19 @@ return ue("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:s?`url(#${da(p
884
884
  /* @__PURE__ */de("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__ */ue("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
885
885
  /* @__PURE__ */de("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ss(t,e.color,e.tone)}}),
886
886
  /* @__PURE__ */de("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
887
- /* @__PURE__ */de(ho,{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 fo({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.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=T().charts,g=F(),f=s??(e=>W(e,g)),x=i??p.other,b=m??p.nothingToBreakDown,y=J(),[v,w]=Z(null),{highlighted:N}=Ss(),k=e.filter(e=>e.value>0);if(0===k.length)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${h??""}`,children:b});const M=[...k].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:x,value:C.reduce((e,t)=>e+t.value,0)}]:$,j=L.reduce((e,t)=>e+t.value,0),z=r/2,P=r/2,D=r/2-12,S=n??("ring"===t?.58*D:0),A=ms(L.length,a),B=Math.max(...L.map(e=>e.value)),E=e=>S+(D-S)*Math.sqrt(Math.max(0,e)/B);let I=-Math.PI/2;const R=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?ms(L.length,a).step:r.value/j*Math.PI*2,i="rose"===t?ms(L.length,a).center(n):e+l/2;e+=l;const s="rose"===t?E(r.value):D;return{key:r.key,label:r.label,share:r.value/j,right:Math.cos(i)>=0,anchor:[z+s*Math.cos(i),P+s*Math.sin(i)],y:P+(s+14)*Math.sin(i),index:n}}).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!==N&&N!==t,_=null!==v?L[v]:void 0;/* @__PURE__ */
887
+ /* @__PURE__ */de(ho,{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 fo({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.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=T().charts,g=F(),f=s??(e=>W(e,g)),x=i??p.other,b=m??p.nothingToBreakDown,y=X(),[v,w]=Z(null),{highlighted:N}=Ss(),k=e.filter(e=>e.value>0);if(0===k.length)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${h??""}`,children:b});const M=[...k].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:x,value:C.reduce((e,t)=>e+t.value,0)}]:$,j=L.reduce((e,t)=>e+t.value,0),z=r/2,D=r/2,P=r/2-12,S=n??("ring"===t?.58*P:0),A=ms(L.length,a),B=Math.max(...L.map(e=>e.value)),E=e=>S+(P-S)*Math.sqrt(Math.max(0,e)/B);let I=-Math.PI/2;const R=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?ms(L.length,a).step:r.value/j*Math.PI*2,i="rose"===t?ms(L.length,a).center(n):e+l/2;e+=l;const s="rose"===t?E(r.value):P;return{key:r.key,label:r.label,share:r.value/j,right:Math.cos(i)>=0,anchor:[z+s*Math.cos(i),D+s*Math.sin(i)],y:D+(s+14)*Math.sin(i),index:n}}).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!==N&&N!==t,_=null!==v?L[v]:void 0;/* @__PURE__ */
888
888
  return ue("div",{className:`relative ${h??""}`,children:[
889
889
  /* @__PURE__ */ue("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
890
- /* @__PURE__ */de("title",{id:y,children:p.breakdown(f(j),L.length)}),L.map((e,r)=>{const n=ss(r,e.color,e.tone),l="rose"===t?A(r):I,i="rose"===t?A.step:e.value/j*Math.PI*2-a;"rose"!==t&&(I+=e.value/j*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?E(e.value):D;/* @__PURE__ */
891
- return de("path",{d:Cs(z,P,S,o,l,s),fill:n,fillOpacity:H(r,e.key)?.4:1,stroke:ls.surface,strokeWidth:1,className:c?ba.sweep:void 0,style:c?ya(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),R.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
890
+ /* @__PURE__ */de("title",{id:y,children:p.breakdown(f(j),L.length)}),L.map((e,r)=>{const n=ss(r,e.color,e.tone),l="rose"===t?A(r):I,i="rose"===t?A.step:e.value/j*Math.PI*2-a;"rose"!==t&&(I+=e.value/j*Math.PI*2);const s=l+Math.max(.001,i),o="rose"===t?E(e.value):P;/* @__PURE__ */
891
+ return de("path",{d:Cs(z,D,S,o,l,s),fill:n,fillOpacity:H(r,e.key)?.4:1,stroke:ls.surface,strokeWidth:1,className:c?ba.sweep:void 0,style:c?ya(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),R.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
892
892
  return ue("g",{children:[
893
893
  /* @__PURE__ */de("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${n},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:ls.grid,strokeWidth:1}),
894
894
  /* @__PURE__ */de("text",{x:t,y:e.y-2,fontSize:10.5,fill:ls.label,textAnchor:e.right?"end":"start",children:e.label}),
895
- /* @__PURE__ */de("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:ls.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:O(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&S>0&&/* @__PURE__ */de("text",{x:z,y:P+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:ls.label,children:o})]}),_&&null!==v&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:_.label,rows:[{key:"value",label:p.value,color:ss(v,_.color,_.tone),value:f(_.value)},{key:"share",label:p.share,color:ls.muted,value:O(_.value/j*100,1,g)}]})}),
895
+ /* @__PURE__ */de("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:ls.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:O(100*e.share,1,g)})]},`lbl-${e.key}`)}),o&&S>0&&/* @__PURE__ */de("text",{x:z,y:D+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:ls.label,children:o})]}),_&&null!==v&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:_.label,rows:[{key:"value",label:p.value,color:ss(v,_.color,_.tone),value:f(_.value)},{key:"share",label:p.share,color:ls.muted,value:O(_.value/j*100,1,g)}]})}),
896
896
  /* @__PURE__ */de("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:L.map((e,t)=>/* @__PURE__ */ue("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
897
897
  /* @__PURE__ */de("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ss(t,e.color,e.tone)}}),
898
898
  /* @__PURE__ */de("span",{className:"flex-1 truncate",children:e.label}),
899
- /* @__PURE__ */de("span",{className:"tabular-nums text-gray-800",children:O(e.value/j*100,1,g)})]},e.key))})]})}var xo=300*Math.PI/180;function bo({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=T().charts,d=F(),u=a??(e=>W(e,d)),h=s??c.nothingToPlot,m=J(),[p,g]=Z(null),{highlighted:f}=Ss();if(0===e.length)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const x=r/2,b=r/2,y=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,N=Math.max(1,Math.floor((y-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,M=Math.min(o,Math.max(1,w-2)),$=ms(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
899
+ /* @__PURE__ */de("span",{className:"tabular-nums text-gray-800",children:O(e.value/j*100,1,g)})]},e.key))})]})}var xo=300*Math.PI/180;function bo({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:s,trackGap:o=6}){const c=T().charts,d=F(),u=a??(e=>W(e,d)),h=s??c.nothingToPlot,m=X(),[p,g]=Z(null),{highlighted:f}=Ss();if(0===e.length)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const x=r/2,b=r/2,y=r/2-10,v=n??Math.max(...e.map(e=>e.value),1),w="track"===t?Math.max(6,(y-.16*r)/e.length):0,N=Math.max(1,Math.floor((y-.16*r)/w||1)),k="track"===t?e.slice(0,N):e,M=Math.min(o,Math.max(1,w-2)),$=ms(k.length,.03),C=null!==p?k[p]:void 0;/* @__PURE__ */
900
900
  return ue("div",{className:`relative ${i??""}`,children:[
901
901
  /* @__PURE__ */ue("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
902
902
  /* @__PURE__ */de("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=ss(n,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)(n,e.key);if("track"===t){const t=y-n*w,r=t-w+M,o=-Math.PI/2;/* @__PURE__ */
@@ -907,7 +907,7 @@ return de("g",{opacity:s?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */de("
907
907
  /* @__PURE__ */de("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__ */ue("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
908
908
  /* @__PURE__ */de("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ss(t,e.color,e.tone)}}),
909
909
  /* @__PURE__ */de("span",{className:"flex-1 truncate",children:e.label}),
910
- /* @__PURE__ */de("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function yo({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=l??(e=>W(e,d)),h=o??c.noStages,m=J(),[p,g]=Z(null),{highlighted:f}=Ss();if(0===e.length)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const x=i??ss(0),b=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,N=e=>w*Math.max(0,e/y)/2,k=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${x} ${M(e).toFixed(0)}%, ${ls.surface})`,C=e=>M(e)>=55?ls.surface:ls.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,j=null!==p?e[p]:void 0;/* @__PURE__ */
910
+ /* @__PURE__ */de("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function yo({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=l??(e=>W(e,d)),h=o??c.noStages,m=X(),[p,g]=Z(null),{highlighted:f}=Ss();if(0===e.length)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const x=i??ss(0),b=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,N=e=>w*Math.max(0,e/y)/2,k=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${x} ${M(e).toFixed(0)}%, ${ls.surface})`,C=e=>M(e)>=55?ls.surface:ls.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,j=null!==p?e[p]:void 0;/* @__PURE__ */
911
911
  return ue("div",{className:`relative ${s??""}`,children:[
912
912
  /* @__PURE__ */ue("svg",{width:"100%",height:b,viewBox:`0 0 ${n} ${b}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
913
913
  /* @__PURE__ */de("title",{id:m,children:c.funnel(e.length,u(e[0].value),u(e[e.length-1].value))}),e.map((r,n)=>{const l=n*b/e.length+a/2,i=(n+1)*b/e.length-a/2,s=N(r.value),o="cone"===t?N(e[n+1]?.value??r.value):s,c=e[n-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
@@ -915,7 +915,7 @@ return ue("g",{opacity:L(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
915
915
  /* @__PURE__ */de("path",{d:`M${k-s},${l} L${k+s},${l} L${k+o},${i} L${k-o},${i} Z`,fill:$(n)}),
916
916
  /* @__PURE__ */de("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:ls.label,children:r.label}),
917
917
  /* @__PURE__ */ue("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:ls.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${O(h,1,d)}`:""]}),
918
- /* @__PURE__ */de("text",{x:k,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:O(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),j&&null!==p&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:j.label,rows:[{key:"value",label:c.count,color:$(p),value:u(j.value)},{key:"share",label:c.ofFirstStage,color:ls.muted,value:O(j.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:as.critical,value:`−${O(100*(1-j.value/e[p-1].value),1,d)}`}]:[]]})})]})}function vo({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=l??(e=>W(e,d)),h=o??c.nothingToBreakDown,m=X(null),p=Fs(m),g=r??p,[f,x]=Z(null),{highlighted:b}=Ss(),y=zs(e,g,t);if(0===y.length)/* @__PURE__ */
918
+ /* @__PURE__ */de("text",{x:k,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:O(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),j&&null!==p&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:j.label,rows:[{key:"value",label:c.count,color:$(p),value:u(j.value)},{key:"share",label:c.ofFirstStage,color:ls.muted,value:O(j.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:as.critical,value:`−${O(100*(1-j.value/e[p-1].value),1,d)}`}]:[]]})})]})}function vo({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=l??(e=>W(e,d)),h=o??c.nothingToBreakDown,m=J(null),p=Fs(m),g=r??p,[f,x]=Z(null),{highlighted:b}=Ss(),y=zs(e,g,t);if(0===y.length)/* @__PURE__ */
919
919
  return de("div",{className:s,ref:m,children:/* @__PURE__ */de("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??ss(0),w=Math.max(...y.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${ls.surface})`,M=e=>N(e)>=55?ls.surface:ls.label,$=f??b,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
920
920
  return ue("div",{className:`relative ${s??""}`,ref:m,children:[
921
921
  /* @__PURE__ */de("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-n),r=Math.max(0,e.height-n),l=t>6.2*e.label.length+12&&r>30,i=l&&r>44;/* @__PURE__ */
@@ -924,19 +924,19 @@ return ue("g",{opacity:$&&$!==e.key?.55:1,onMouseEnter:()=>x(e.key),children:[
924
924
  /* @__PURE__ */de(ho,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function wo(e,t,r,n,a,l,i,s){if(n>=8)return;const o=e.reduce((e,t)=>e+No(t,8-n),0);if(o<=0)return;let c=t;e.forEach((e,t)=>{const d=No(e,8-n),u=d/o*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;s.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&wo(e.children,c,u,n+1,m,p,h,s),c+=u})}function No(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+No(r,t-1),0):Math.max(0,e.value??0)}function ko({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:s}){const o=T().charts,c=F(),d=a??(e=>W(e,c)),u=s??o.nothingToBreakDown,[h,m]=Z(null),{highlighted:p}=Ss(),g=[];if(wo(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return de("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, ${ss(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${ls.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,M=e=>O(e.value/v*100,1,c);/* @__PURE__ */
925
925
  return ue("div",{className:`relative ${i??""}`,children:[
926
926
  /* @__PURE__ */ue("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__ */de("path",{d:Cs(x,b,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:ls.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */de("text",{x:x,y:b+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:ls.label,children:l})]}),k&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:k.label,rows:[{key:"value",label:o.value,color:w(k),value:d(k.value)},{key:"share",label:o.share,color:ls.muted,value:M(k)}]})}),
927
- /* @__PURE__ */de(ho,{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),M(e)])})]})}function Mo({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=i??(e=>W(e,d)),h=o??c.noFlows,m=X(null),p=Fs(m),g=n??p,[f,x]=Z(null),{highlighted:b}=Ss();if(0===e.length||0===t.length)/* @__PURE__ */
928
- return de("div",{className:s,ref:m,children:/* @__PURE__ */de("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-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=k>0?(M-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*$)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>M&&a>0?Math.max(0,1-(n-M)/a):1;let s=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:s,h:a,index:n}),s+=a+l})}const L=/* @__PURE__ */new Map,j=/* @__PURE__ */new Map,z=/* @__PURE__ */new Map,P=(e,t)=>e.from===t||e.to===t,D="link"===f?.kind?t[f.index]:void 0,S="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
927
+ /* @__PURE__ */de(ho,{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),M(e)])})]})}function Mo({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=i??(e=>W(e,d)),h=o??c.noFlows,m=J(null),p=Fs(m),g=n??p,[f,x]=Z(null),{highlighted:b}=Ss();if(0===e.length||0===t.length)/* @__PURE__ */
928
+ return de("div",{className:s,ref:m,children:/* @__PURE__ */de("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-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=k>0?(M-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*$)),n=r.reduce((e,t)=>e+t,0)+l*(t.length-1),a=r.reduce((e,t)=>e+Math.max(0,t-2),0),i=n>M&&a>0?Math.max(0,1-(n-M)/a):1;let s=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:s,h:a,index:n}),s+=a+l})}const L=/* @__PURE__ */new Map,j=/* @__PURE__ */new Map,z=/* @__PURE__ */new Map,D=(e,t)=>e.from===t||e.to===t,P="link"===f?.kind?t[f.index]:void 0,S="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
929
929
  return ue("div",{className:`relative ${s??""}`,ref:m,children:[
930
- /* @__PURE__ */ue("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=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*$),i=r.y+(L.get(e.from)??0)+l/2,s=n.y+(j.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),j.set(e.to,(j.get(e.to)??0)+l);const o=r.x+a,c=n.x,d=ss(r.index,e.color),u=`${e.from}→${e.to}`,h=z.get(u)??0;z.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:P(e,f.key):null!==b?P(e,b):null)(e,t);/* @__PURE__ */
931
- return de("path",{d:ws([[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=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:P(t[f.index],i):null!==b?b===i:null);var i;/* @__PURE__ */
930
+ /* @__PURE__ */ue("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=C.get(e.from),n=C.get(e.to);if(!r||!n)return null;const l=Math.max(1,e.value*$),i=r.y+(L.get(e.from)??0)+l/2,s=n.y+(j.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),j.set(e.to,(j.get(e.to)??0)+l);const o=r.x+a,c=n.x,d=ss(r.index,e.color),u=`${e.from}→${e.to}`,h=z.get(u)??0;z.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:D(e,f.key):null!==b?D(e,b):null)(e,t);/* @__PURE__ */
931
+ return de("path",{d:ws([[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=C.get(e.key);if(!r)return null;const n=r.x>g/2,l=(i=e.key,f?"node"===f.kind?f.key===i:D(t[f.index],i):null!==b?b===i:null);var i;/* @__PURE__ */
932
932
  return ue("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>x({kind:"node",key:e.key}),children:[
933
933
  /* @__PURE__ */de("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:ss(r.index,e.color,e.tone)}),
934
- /* @__PURE__ */de("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:ls.label,children:e.label})]},e.key)})]}),D&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:`${D.from} → ${D.to}`,rows:[{key:"value",label:c.flow,color:ss(C.get(D.from)?.index??0,D.color),value:u(D.value)}]})}),S&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:S.label,rows:[{key:"value",label:c.throughput,color:ss(C.get(S.key)?.index??0,S.color,S.tone),value:u(w.get(S.key)??0)}]})}),
935
- /* @__PURE__ */de(ho,{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 $o({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=i??(e=>W(e,d)),h=o??c.noFlows,[m,p]=Z(null),{highlighted:g}=Ss(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},x=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),b=e.map((e,t)=>t).sort((e,t)=>x[t]-x[e]).slice(0,n),y=b.reduce((e,t)=>e+x[t],0);if(y<=0)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,N=r/2-44,k=N-l,M=a*b.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;b.forEach((e,t)=>{const r=x[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,j=[];for(const e of b)for(const t of b){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,x[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),j.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const z=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],P="arc"===m?.kind?m.index:void 0,D="ribbon"===m?.kind?j[m.index]:void 0;/* @__PURE__ */
934
+ /* @__PURE__ */de("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:ls.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:ss(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),S&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:S.label,rows:[{key:"value",label:c.throughput,color:ss(C.get(S.key)?.index??0,S.color,S.tone),value:u(w.get(S.key)??0)}]})}),
935
+ /* @__PURE__ */de(ho,{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 $o({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:s,emptyLabel:o}){const c=T().charts,d=F(),u=i??(e=>W(e,d)),h=o??c.noFlows,[m,p]=Z(null),{highlighted:g}=Ss(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},x=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),b=e.map((e,t)=>t).sort((e,t)=>x[t]-x[e]).slice(0,n),y=b.reduce((e,t)=>e+x[t],0);if(y<=0)/* @__PURE__ */return de("p",{className:`text-sm text-gray-500 ${s??""}`,children:h});const v=r/2,w=r/2,N=r/2-44,k=N-l,M=a*b.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;b.forEach((e,t)=>{const r=x[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,j=[];for(const e of b)for(const t of b){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,x[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),j.push({from:e,to:t,value:r,a:n.start+l+a/2,b:$.get(t).start+($.get(t).end-$.get(t).start)/2})}const z=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],D="arc"===m?.kind?m.index:void 0,P="ribbon"===m?.kind?j[m.index]:void 0;/* @__PURE__ */
936
936
  return ue("div",{className:`relative ${s??""}`,children:[
937
937
  /* @__PURE__ */ue("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(b.length),onMouseLeave:()=>p(null),children:[j.map((t,n)=>{const[a,l]=z(t.a,k),[i,s]=z(t.b,k),o=ss($.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,n);/* @__PURE__ */
938
938
  return de("path",{d:`M${a},${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:n})},`${e[t.from]}→${e[t.to]}`)}),b.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=z(n,N+16),i=(t=>m?"arc"===m.kind?m.index===t:j[m.index].from===t||j[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
939
939
  return ue("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
940
940
  /* @__PURE__ */de("path",{d:Cs(v,w,k,N,r.start,r.end),fill:ss(r.slot),fillOpacity:null===i||i?1:.45}),
941
- /* @__PURE__ */de("text",{x:a,y:l+4,fontSize:11,fill:ls.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==P&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:e[P],rows:[{key:"total",label:c.totalFlow,color:ss($.get(P).slot),value:u(x[P])}]})}),D&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:`${e[D.from]} → ${e[D.to]}`,rows:[{key:"value",label:c.flow,color:ss($.get(D.from).slot),value:u(D.value)}]})}),
942
- /* @__PURE__ */de(ho,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:j.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Ol as APP_UPDATE_POLL_MS,An as Accordion,_l as AppUpdateBanner,Pr as AttachButton,jr as AttachmentDropZone,zr as AttachmentList,Ti as AuthScreen,vn as Avatar,wn as AvatarGroup,$n as Banner,oi as BarChart,oo as BoxPlotChart,ht as BrandAssetEditor,aa as BudgetBar,ls as CHART_INK,Lt as Calendar,co as CandlestickChart,Tr as Card,Gs as CartesianPlot,Ks as ChartBrush,fa as ChartDefs,Vs as ChartDot,qs as ChartFrame,Ds as ChartHighlightProvider,Os as ChartSkeleton,Us as ChartTooltip,Di as ChatTemplate,_e as Checkbox_default,$i as CheckoutTemplate,$o as ChordChart,Hn as ColoredBadge,ro as ColumnChart,Dr as ComposerAttachments,pl as ContainerFillChart,mn as CountBadge,la as DAY_MS,xi as DashboardTemplate,ai as DataTable,wi as DataTablePage,Yt as DatePicker_default,Et as DateRangePicker,Jt as DateTimePicker_default,dn as DescriptionList,tn as Divider,di as DonutChart,Kl as Drawer,Il as DropdownMenu,ji as EmailTemplate,_n as EmptyState,Ji as EmptyValue,Ri as ErrorBoundary,Ii as ErrorPage,$r as FilePicker_default,Ge as FormErrorSummary,Ve as FormField,ki as FormLayoutPage,yo as FunnelChart,Tn as GROUP_COLORS,En as GROUP_COLORS_SOLID,Bi as GalleryTemplate,Qr as Grid,uo as HeatmapChart,Cl as HelpCenter,so as HistogramChart,be as INPUT_BASE,xe as INPUT_SIZES,pe as IconButton_default,Gr as Inline,Mr as InputNumber_default,we as Input_default,Yl as Kanban,Je as Label,hi as LineChart,li as ListFooter,ii as ListLoadError,sr as MAX_FRACTION_DIGITS,Me as MENU_MAX_HEIGHT,ba as MOTION,Ml as Markdown,ut as MediaUploadField,yt as MediaUploadGrid,Is as Meter,ea as MetricBar,ll as MilestoneTimeline,We as NativeSelect,ur as NumericKeypad,ke as POPUP_MAX_WIDTH,il as POST_PRODUCTION_STATUSES,qn as PageHeader,Zl as Pagination,Cr as PaperclipGlyph,qr as Paragraph,fo as PieChart,Rl as Popover,ft as PortalBrandingProvider,hl as ProductionTimeline,mo as RADAR_SERIES_CAP,go as RadarChart,bo as RadialBarChart,Ye as RadioGroup,Ue as Radio_default,lo as RangeChart,Ts as RankedBars,no as SCATTER_SERIES_CAP,rs as SERIES_SLOT_COUNT,ns as SERIES_VARS,sl as STAGES,as as STATUS_VARS,Mo as SankeyChart,ao as ScatterChart,Ar as SearchableSelect,xr as Segmented,Oe as Select_default,un as SettingRow,jl as SidebarActionButton,Pl as SidebarGroupLabel,Al as SidebarNavGroup,Sl as SidebarNavItem,an as Skeleton,ir as Snippet,si as Sparkline,Yr as Stack,Er as StatCard,Rs as StatTile,fn as Statistic,On as StatusBadge,Rn as StatusBadgeProvider,Sn as Stepper,ko as SunburstChart,wr as Switch_default,Pn as Tabs,Br as TagInput,Or as Text,Ne as Textarea_default,mr as TileButton_default,Qi as TimeAgo,Ot as TimePicker_default,to as TimeSeriesChart,nl as TimelineTrack,_r as Title,Fn as Tooltip,Bl as TopNav,vo as TreemapChart,io as WaterfallChart,ms as angleScale,or as appendKey,Zi as applyThemePrefs,Cs as arcPath,Ms as areaBetween,ks as areaFrom,Bs as autoHighlightIndex,cr as backspace,cs as bandScale,gs as binValues,ra as budgetState,ws as bumpPath,ol as calcOverall,cl as calcReportOverall,tr as copyToClipboard,Ns as curvePath,ma as dashFor,ha as fillFor,oa as fillId,Fe as firstEnabledIndex,sa as fmtSliderDate,Nt as fromKey,ca as glowId,ua as groundId,In as groupColors,As as highlightOpacity,ve as inputClasses,Vn as isSeverityTone,Xe as labelClasses,ds as ladderScale,Te as lastEnabledIndex,xs as linearPath,os as linearScale,hs as logScale,da as maskId,Ie as matchTypeahead,et as mediaFileName,ys as monotonePath,Ee as nextEnabledIndex,us as niceMax,$s as polygonPoints,Ce as popupBounds,ps as radiusScale,mt as resolvePortalBrandAsset,ss as resolveSeriesColor,Ki as resolveTheme,Qt as selectionAt,is as seriesColor,Kn as severityOf,vs as splinePath,zs as squarify,ya as stagger,bs as stepPath,Cn as tabButtonId,Ln as tabPanelId,ia as toDayMs,Dt as toISODate,wt as toKey,Hl as useAppUpdate,ts as useClickOutside,es as useDebouncedValue,Be as useDropdownPosition,Ss as useHighlight,Fs as usePlotWidth,xt as usePortalBranding,dl as useProductionTimeline,Xi as useTheme};
941
+ /* @__PURE__ */de("text",{x:a,y:l+4,fontSize:11,fill:ls.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==D&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:e[D],rows:[{key:"total",label:c.totalFlow,color:ss($.get(D).slot),value:u(x[D])}]})}),P&&/* @__PURE__ */de("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */de(Us,{title:`${e[P.from]} → ${e[P.to]}`,rows:[{key:"value",label:c.flow,color:ss($.get(P.from).slot),value:u(P.value)}]})}),
942
+ /* @__PURE__ */de(ho,{caption:c.chord(b.length),head:[c.tableFrom,c.tableTo,c.value],rows:j.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Ol as APP_UPDATE_POLL_MS,An as Accordion,_l as AppUpdateBanner,Dr as AttachButton,jr as AttachmentDropZone,zr as AttachmentList,Ti as AuthScreen,vn as Avatar,wn as AvatarGroup,$n as Banner,oi as BarChart,oo as BoxPlotChart,ht as BrandAssetEditor,aa as BudgetBar,ls as CHART_INK,Lt as Calendar,co as CandlestickChart,Tr as Card,Gs as CartesianPlot,Ks as ChartBrush,fa as ChartDefs,Vs as ChartDot,qs as ChartFrame,Ps as ChartHighlightProvider,Os as ChartSkeleton,Us as ChartTooltip,Pi as ChatTemplate,_e as Checkbox_default,$i as CheckoutTemplate,$o as ChordChart,Hn as ColoredBadge,ro as ColumnChart,Pr as ComposerAttachments,pl as ContainerFillChart,mn as CountBadge,la as DAY_MS,xi as DashboardTemplate,ai as DataTable,wi as DataTablePage,Yt as DatePicker_default,Et as DateRangePicker,Xt as DateTimePicker_default,dn as DescriptionList,tn as Divider,di as DonutChart,Kl as Drawer,Il as DropdownMenu,ji as EmailTemplate,_n as EmptyState,Xi as EmptyValue,Ri as ErrorBoundary,Ii as ErrorPage,$r as FilePicker_default,Ge as FormErrorSummary,Ve as FormField,ki as FormLayoutPage,yo as FunnelChart,Tn as GROUP_COLORS,En as GROUP_COLORS_SOLID,Bi as GalleryTemplate,Qr as Grid,uo as HeatmapChart,Cl as HelpCenter,so as HistogramChart,be as INPUT_BASE,xe as INPUT_SIZES,pe as IconButton_default,Gr as Inline,Mr as InputNumber_default,we as Input_default,Yl as Kanban,Xe as Label,hi as LineChart,li as ListFooter,ii as ListLoadError,sr as MAX_FRACTION_DIGITS,Me as MENU_MAX_HEIGHT,ba as MOTION,Ml as Markdown,ut as MediaUploadField,yt as MediaUploadGrid,Is as Meter,ea as MetricBar,ll as MilestoneTimeline,We as NativeSelect,ur as NumericKeypad,ke as POPUP_MAX_WIDTH,il as POST_PRODUCTION_STATUSES,qn as PageHeader,Zl as Pagination,Cr as PaperclipGlyph,qr as Paragraph,fo as PieChart,Rl as Popover,ft as PortalBrandingProvider,hl as ProductionTimeline,mo as RADAR_SERIES_CAP,go as RadarChart,bo as RadialBarChart,Ye as RadioGroup,Ue as Radio_default,lo as RangeChart,Ts as RankedBars,no as SCATTER_SERIES_CAP,rs as SERIES_SLOT_COUNT,ns as SERIES_VARS,sl as STAGES,as as STATUS_VARS,Mo as SankeyChart,ao as ScatterChart,Ar as SearchableSelect,xr as Segmented,Oe as Select_default,un as SettingRow,jl as SidebarActionButton,Dl as SidebarGroupLabel,Al as SidebarNavGroup,Sl as SidebarNavItem,an as Skeleton,ir as Snippet,si as Sparkline,Yr as Stack,Er as StatCard,Rs as StatTile,fn as Statistic,On as StatusBadge,Rn as StatusBadgeProvider,Sn as Stepper,ko as SunburstChart,wr as Switch_default,Dn as Tabs,Br as TagInput,Or as Text,Ne as Textarea_default,mr as TileButton_default,Qi as TimeAgo,Ot as TimePicker_default,to as TimeSeriesChart,nl as TimelineTrack,_r as Title,Fn as Tooltip,Bl as TopNav,vo as TreemapChart,io as WaterfallChart,ms as angleScale,or as appendKey,Zi as applyThemePrefs,Cs as arcPath,Ms as areaBetween,ks as areaFrom,Bs as autoHighlightIndex,cr as backspace,cs as bandScale,gs as binValues,ra as budgetState,ws as bumpPath,ol as calcOverall,cl as calcReportOverall,tr as copyToClipboard,Ns as curvePath,ma as dashFor,ha as fillFor,oa as fillId,Fe as firstEnabledIndex,sa as fmtSliderDate,Nt as fromKey,ca as glowId,ua as groundId,In as groupColors,As as highlightOpacity,ve as inputClasses,Vn as isSeverityTone,Je as labelClasses,ds as ladderScale,Te as lastEnabledIndex,xs as linearPath,os as linearScale,hs as logScale,da as maskId,Ie as matchTypeahead,et as mediaFileName,ys as monotonePath,Ee as nextEnabledIndex,us as niceMax,$s as polygonPoints,Ce as popupBounds,ps as radiusScale,mt as resolvePortalBrandAsset,ss as resolveSeriesColor,Ki as resolveTheme,Qt as selectionAt,is as seriesColor,Kn as severityOf,vs as splinePath,zs as squarify,ya as stagger,bs as stepPath,Cn as tabButtonId,Ln as tabPanelId,ia as toDayMs,Pt as toISODate,wt as toKey,Hl as useAppUpdate,ts as useClickOutside,es as useDebouncedValue,Be as useDropdownPosition,Ss as useHighlight,Fs as usePlotWidth,xt as usePortalBranding,dl as useProductionTimeline,Ji as useTheme};