efficient-shell 4.165.0 → 4.166.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 (56) hide show
  1. package/README.md +75 -2
  2. package/dist/{Browser-ZX5GWPSM.js → Browser-2MBG34IR.js} +14 -14
  3. package/dist/Calculator-R3WJTNZ6.js +29 -0
  4. package/dist/ConfirmDialog-ZDVMT74Y.js +1 -0
  5. package/dist/{CurrencyConverter-7OPRFA5D.js → CurrencyConverter-PEXSQQUK.js} +7 -7
  6. package/dist/{Documents-QV63346J.js → Documents-YL4RIOZO.js} +15 -15
  7. package/dist/{Files-BU5V56YF.js → Files-3ZRUTRSB.js} +22 -22
  8. package/dist/Notepad-3ZM2FR6C.js +25 -0
  9. package/dist/{PomodoroTimer-FJV6MGE3.js → PomodoroTimer-5QHA5UOY.js} +14 -14
  10. package/dist/{Preview-PMQKG6FH.js → Preview-32F4DTCK.js} +9 -9
  11. package/dist/{Sidebar-E6GLVCJL.js → Sidebar-QQSRLMJG.js} +22 -22
  12. package/dist/Spreadsheet-GOZI7I4L.js +37 -0
  13. package/dist/{Stock-SSNUY34E.js → Stock-XJFITZZA.js} +4 -4
  14. package/dist/{Weather-T5WM66B2.js → Weather-BDC633GV.js} +16 -16
  15. package/dist/{WorldClock-C3GT27AV.js → WorldClock-ROOVRRCJ.js} +7 -7
  16. package/dist/apps/index.js +1 -1
  17. package/dist/brand.css +1 -1
  18. package/dist/{chunk-QTPVA26D.js → chunk-7TQ7NMT3.js} +1 -1
  19. package/dist/{chunk-PLX2N4N6.js → chunk-7YFAFXQG.js} +2 -2
  20. package/dist/chunk-AFYQTVZO.js +1 -0
  21. package/dist/chunk-BKDE67DB.js +12 -0
  22. package/dist/{chunk-A7Q4BCPI.js → chunk-CRI4UFBU.js} +5 -5
  23. package/dist/{chunk-DJ6UVHAZ.js → chunk-DTRXR6JQ.js} +11 -11
  24. package/dist/chunk-G5J6YSN5.js +5 -0
  25. package/dist/{chunk-YWXYBJ5Y.js → chunk-HA2WG27U.js} +2 -2
  26. package/dist/{chunk-D7EJSASN.js → chunk-HGG5M5AB.js} +1 -1
  27. package/dist/chunk-HZZNJHRH.js +1 -0
  28. package/dist/chunk-JKVDTKBE.js +988 -0
  29. package/dist/chunk-M4DB7UBZ.js +29 -0
  30. package/dist/{chunk-RKEHUV7U.js → chunk-QASZIYLG.js} +1 -1
  31. package/dist/chunk-SOI4LR67.js +27 -0
  32. package/dist/chunk-UVZIPXIA.js +10 -0
  33. package/dist/chunk-VRHUY4P4.js +1 -0
  34. package/dist/{chunk-ZLJCWBDF.js → chunk-VXBJNMAA.js} +60 -60
  35. package/dist/chunk-X4FJ54PP.js +1 -0
  36. package/dist/{index-DRkpyISn.d.ts → index-DcLqfJX3.d.ts} +182 -13
  37. package/dist/index.d.ts +3 -13
  38. package/dist/index.js +83 -83
  39. package/dist/map/index.js +3 -3
  40. package/dist/page-tabs/index.js +5 -5
  41. package/dist/ui/index.d.ts +1 -1
  42. package/dist/ui/index.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/Calculator-NZH4FVRW.js +0 -29
  45. package/dist/ConfirmDialog-WEVZTFLU.js +0 -1
  46. package/dist/Notepad-KZIJ5ZTF.js +0 -25
  47. package/dist/Spreadsheet-DE5HPVE2.js +0 -37
  48. package/dist/chunk-4UCRT4ST.js +0 -5
  49. package/dist/chunk-ELSUXC3N.js +0 -1
  50. package/dist/chunk-FGPWGHNT.js +0 -27
  51. package/dist/chunk-KRTZFHYW.js +0 -29
  52. package/dist/chunk-MAIHBBWT.js +0 -1
  53. package/dist/chunk-SHVGZW2J.js +0 -1
  54. package/dist/chunk-SQ7BPUZG.js +0 -9
  55. package/dist/chunk-VDL2RLZG.js +0 -10
  56. package/dist/chunk-XYITV4EC.js +0 -983
@@ -1,983 +0,0 @@
1
- import{Breadcrumbs as e}from"./chunk-FZRQBHTK.js";import{useDropdownPosition as t,MENU_MAX_HEIGHT as r,Tooltip as n,popupBounds as a,VIEWPORT_MARGIN as l,placeMenu as i,followAnchor as o,POPUP_MAX_WIDTH as s,placeAtPoint as c,SidebarLayout as d}from"./chunk-SQ7BPUZG.js";import{BrandMark as u}from"./chunk-FGPWGHNT.js";import{toast_default as h}from"./chunk-KSSAVLO7.js";import{useIsMobile as m,useShortcutLabel as p,useShellPrefs as g}from"./chunk-A7Q4BCPI.js";import{useFileIntake as f,humanSize as b,FileIntakeAlert as x}from"./chunk-5J2TKKGH.js";import{calendarNames as y,firstDayOfWeek as v,formatDate as w,EMPTY_VALUE as k,toInstant as N,timeAgo as M,formatDateTime as $}from"./chunk-S2AZZGFF.js";import{iconButtonClasses as C,Button_default as L,buttonClasses as D}from"./chunk-4UCRT4ST.js";import{useTabLayer as j,focusableIn as A,useFocusTrap as P,useScrollLock as S,stopAfter as z}from"./chunk-KRTZFHYW.js";import{glassStyle as F,PopupMenu as B,MenuSemanticsContext as E,leavesContextMenuAlone as T,PopupMenuDivider as I,PopupMenuLabel as O,itemLook as R,MenuCheckMark as W}from"./chunk-VDL2RLZG.js";import{registerModalEscapeInterceptor as H,onOverlayOpen as _,Z_LAYERS as q,useDismissPopupsOnOpen as K}from"./chunk-ELSUXC3N.js";import{useShellLocale as U,useShellStrings as V,DEFAULT_SHELL_STRINGS as Y,currentShellStrings as G,formatPlain as Z,formatFixed as X,formatPercent as J,splitAround as Q}from"./chunk-NCQLGQYR.js";import{useBrowserLayoutEffect as ee,useBrowserValue as te,useHydrated as re,useBrowserValueOnce as ne,useBrowserState as ae}from"./chunk-D65T4H6J.js";import{forwardRef as le,useCallback as ie,useState as oe,useRef as se,useId as ce,useMemo as de,useEffect as ue,createContext as he,Children as me,isValidElement as pe,cloneElement as ge,useContext as fe,Fragment as be,Component as xe,useSyncExternalStore as ye,useLayoutEffect as ve}from"react";import{jsx as we,jsxs as ke,Fragment as Ne}from"react/jsx-runtime";import{createPortal as Me}from"react-dom";var $e=le(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",...l},i){/* @__PURE__ */
2
- return we("button",{ref:i,type:n,className:C({variant:t,size:r,pressed:!0===l["aria-pressed"]||"true"===l["aria-pressed"],className:a}),...l,children:e})}),Ce="block w-full rounded-md border border-gray-300 bg-white",Le="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)]",De={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"},je=`${Ce} ${De.md} ${Le}`,Ae="disabled:cursor-not-allowed disabled:opacity-60";function Pe(e){return[e?.readOnly?`block w-full rounded-md border border-gray-300 bg-gray-50 ${De[e.size??"md"]} ${Le}`:e?.size&&"md"!==e.size?`${Ce} ${De[e.size]} ${Le}`:je,e?.invalid?"border-red-300 focus:border-red-400 focus-visible:ring-[color:var(--rosh-focus-ring-invalid)]":"",Ae,e?.className??""].filter(Boolean).join(" ")}var Se=le(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...i},o){const s=`${t?"pl-9":""} ${r?"pr-9":""}`.trim(),c=
3
- /* @__PURE__ */we("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:Pe({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */ke("div",{className:"relative",children:[t&&/* @__PURE__ */we("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",children:t}),c,r&&/* @__PURE__ */we("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),ze=le(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,readOnly:i,...o},s){const c=ie(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
4
- return we("textarea",{ref:s,"aria-invalid":e||void 0,rows:a,onInput:c,readOnly:i,className:Pe({invalid:e,size:l,readOnly:i,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...o})});function Fe(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Be(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):Be(e)}function Te(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 Ie=e=>Array.isArray(e.options);var Oe=le(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:o,renderOption:s,multiple:c,...d},u){const h=t;/* @__PURE__ */
5
- return ke("select",{ref:u,value:e,multiple:c||void 0,onChange:e=>h(c?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:Pe({invalid:a,size:i,className:`pr-8 ${l}`.trim()}),...d,children:[void 0!==n&&!c&&/* @__PURE__ */we("option",{value:"",disabled:!0,children:n}),
6
- /* @__PURE__ */we(Re,{items:r})]})});function Re({items:e}){const t=e=>/* @__PURE__ */we("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
7
- return we(Ne,{children:e.map((e,r)=>Ie(e)?/* @__PURE__ */we("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var We=le(function({value:e,onChange:n,options:a,placeholder:l,invalid:i,className:o="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,"aria-describedby":g,"aria-label":f,"aria-labelledby":b,...x},y){const[v,w]=oe(!1),[k,N]=oe(-1),M=se(null),$=se(null),C=se(null),L=se(v);L.current=v;const D=se({buffer:"",timer:null}),j=ce(),A=`${j}-listbox`,P=s??`${j}-trigger`,S=e=>`${j}-opt-${e}`,z=de(()=>function(e){const t=[];for(const r of e)Ie(r)?t.push(...r.options):t.push(r);return t}(a),[a]),B=m?e:[],E=n,T=t($,v,{matchTriggerWidth:!0}),I=m?z.findIndex(e=>B.includes(e.value)):z.findIndex(t=>t.value===e),O=m?z.filter(e=>B.includes(e.value)).map(e=>e.label).join(", ")||void 0:I>=0?z[I].label:void 0,R=!m&&I>=0?z[I].lang:void 0,W=ie((e=!0)=>{w(!1),N(-1),e&&$.current?.focus()},[]),K=ie(()=>{c||(N(I>=0?I:Fe(z)),w(!0))},[c,z,I]),U=ie(t=>{const r=z[t];if(r&&!r.disabled){if(m){const n=e;return E(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void N(t)}E(r.value),W()}},[z,m,e,E,W]);ue(()=>{if(!v)return;return H(e=>!("Escape"!==e.key||!L.current)&&(W(),!0),()=>C.current)},[v,W]),ue(()=>{if(!v)return;const e=e=>{const t=e.target;M.current?.contains(t)||C.current?.contains(t)||W(!1)};document.addEventListener("pointerdown",e);const t=_(()=>W(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[v,W]),ue(()=>{!v||k<0||C.current?.querySelector(`#${CSS.escape(S(k))}`)?.scrollIntoView({block:"nearest"})});const V=ie(e=>{const t=D.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=v?k:I,n=Te(z,t.buffer,r);n<0||(v?N(n):m?(N(n),w(!0)):U(n))},[v,k,I,z,U,m]),Y=(t,r)=>{const n=(a=t.value,m?B.includes(a):e===a);var a;const l=r===k;/* @__PURE__ */
8
- return ke("div",{id:S(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||N(r)},onClick:()=>U(r),className:`mx-1 cursor-pointer truncate rounded-lg px-3 py-1.5 text-sm${m?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[m&&/* @__PURE__ */we("svg",{"aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(n?"":"invisible"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),p?/* @__PURE__ */we("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */ke("span",{className:"block min-w-0 flex-1",children:[
9
- /* @__PURE__ */we("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */we("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.description?
10
- /* @__PURE__ */ke(Ne,{children:[
11
- /* @__PURE__ */we("span",{lang:t.lang,className:"block truncate",children:t.label}),
12
- /* @__PURE__ */we("span",{className:"mt-0.5 block truncate text-xs font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},G=[];let Z=0;return a.forEach((e,t)=>{if(!Ie(e))return G.push(Y(e,Z)),void(Z+=1);const r=`${j}-group-${t}`,n=Z;Z+=e.options.length,G.push(
13
- /* @__PURE__ */ke("div",{role:"group","aria-labelledby":r,children:[
14
- /* @__PURE__ */we("div",{id:r,role:"presentation",className:"mx-1 truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500",children:e.label}),e.options.map((e,t)=>Y(e,n+t))]},r))}),/* @__PURE__ */ke("div",{ref:M,className:"relative",children:[
15
- /* @__PURE__ */we("button",{ref:$,id:P,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":v,"aria-controls":v?A:void 0,"aria-activedescendant":v&&k>=0?S(k):void 0,"aria-invalid":i||void 0,"aria-describedby":g,"aria-label":f,"aria-labelledby":b,title:h,disabled:c,onClick:()=>v?W():K(),onKeyDown:e=>{if(!c)switch(e.key){case"ArrowDown":return e.preventDefault(),void(v?N(e=>Ee(z,e,1)):K());case"ArrowUp":return e.preventDefault(),void(v?N(e=>Ee(z,e,-1)):K());case"Home":return void(v&&(e.preventDefault(),N(Fe(z))));case"End":return void(v&&(e.preventDefault(),N(Be(z))));case"Enter":return void(v&&(e.preventDefault(),U(k)));case" ":return e.preventDefault(),void(v?U(k):K());case"Escape":return void(v&&(e.preventDefault(),e.stopPropagation(),W()));case"Tab":return void(v&&W(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),V(e.key))}},className:Pe({invalid:i,size:d,className:`pr-8 text-left ${o}`.trim()}),children:/* @__PURE__ */we("span",{lang:R,className:"block truncate "+(void 0===O?"text-gray-400":""),children:O??l??" "})}),
16
- /* @__PURE__ */we("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__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9l3.75-3.75L15.75 9M8.25 15l3.75 3.75L15.75 15"})}),
17
- /* @__PURE__ */ke("select",{ref:y,value:e,multiple:m||void 0,onChange:e=>E(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...x,children:[void 0!==l&&!m&&/* @__PURE__ */we("option",{value:"",disabled:!0,children:l}),
18
- /* @__PURE__ */we(Re,{items:a})]}),v&&Me(
19
- /* @__PURE__ */we("div",{ref:C,id:A,role:"listbox","aria-labelledby":b??(f?void 0:P),"aria-label":b?void 0:f,"aria-multiselectable":m||void 0,className:"fixed overflow-y-auto rounded-2xl py-1",style:{zIndex:q.popup,left:T?.left,top:T?.top,bottom:T?.bottom,width:T?.width,maxHeight:T?.maxHeight??r,visibility:T?void 0:"hidden",...F()},children:G}),document.body)]})}),He=le(function({touchSize:e="touch",...t},r){return m()?/* @__PURE__ */we(Oe,{ref:r,...t,size:e}):/* @__PURE__ */we(We,{ref:r,...t})});function _e(e,t,r,n){const a=ce(),l=!!e&&!!t,i=l?`${a}-label`:void 0,o=l?`${a}-description`:void 0;return{labelId:i,descriptionId:o,labelledBy:r??i,describedBy:[n,o].filter(Boolean).join(" ")||void 0}}var qe=le(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":o,"aria-describedby":s,...c},d){const u=se(null),h=_e(n,a,o,s);ue(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=ie(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */we("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__ */ke("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
20
- /* @__PURE__ */ke("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */we("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */we("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),Ke="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=le(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=_e(r,n,i,o);return r||n?/* @__PURE__ */ke("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
21
- /* @__PURE__ */we("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Ke} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
22
- /* @__PURE__ */ke("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */we("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */we("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */we("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Ke} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function Ve({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:o}){const s=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===me.count(o)?me.only(o):null,d=pe(c)?c:null,u={};d&&(s&&(u["aria-describedby"]=[d.props["aria-describedby"],s].filter(Boolean).join(" ")),a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0));const h=d&&Object.keys(u).length>0?ge(d,u):o;/* @__PURE__ */
23
- return ke("div",{className:i,children:[e&&/* @__PURE__ */ke("label",{id:r,htmlFor:t,className:"mb-1 block text-xs font-medium text-gray-600",children:[e,l&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"ml-0.5 text-red-500",children:"*"})]}),h,a?
24
- /* @__PURE__ */we("p",{id:t?`${t}-error`:void 0,role:"alert",className:"mt-1 text-[11px] text-red-600",children:a}):n?/* @__PURE__ */we("p",{id:t?`${t}-hint`:void 0,className:"mt-1 text-[11px] text-gray-400",children:n}):null]})}var Ye={vertical:"flex flex-col gap-2",horizontal:"flex flex-wrap items-start gap-x-6 gap-y-2"};function Ge({label:e,hint:t,error:r,required:n,name:a,value:l,onChange:i,options:o,orientation:s="vertical",disabled:c=!1,className:d=""}){const u=ce(),h=e?`${u}-label`:void 0;/* @__PURE__ */
25
- return we(Ve,{label:e,labelId:h,htmlFor:u,hint:t,error:r,required:n,className:d,children:/* @__PURE__ */we("div",{id:u,role:"radiogroup","aria-labelledby":h,"aria-required":n||void 0,className:Ye[s],children:o.map(e=>/* @__PURE__ */we(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 Ze({errors:e,title:t,autoFocus:r=!0,className:n=""}){const a=V(),l=se(null),i=se(!1);if(ue(()=>{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__ */
26
- return ke("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:[
27
- /* @__PURE__ */we("h2",{className:"text-sm font-semibold text-red-800",children:t??a.form.errorSummaryTitle}),
28
- /* @__PURE__ */we("ul",{className:"mt-1.5 space-y-1",children:e.map((e,t)=>/* @__PURE__ */we("li",{children:/* @__PURE__ */we("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 Xe="text-xs font-medium text-gray-600";function Je({inline:e=!1,className:t=""}={}){return[e?"":"mb-1 block",Xe,t].filter(Boolean).join(" ")}function Qe({required:e,children:t,className:r="",...n}){/* @__PURE__ */
29
- return ke("label",{className:Je({className:r}),...n,children:[t,e&&/* @__PURE__ */we("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var et=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function tt(e){if(/^data:/i.test(e||""))return function(e){const t=et.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 rt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function nt(e,t=Y.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 at(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 lt(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function it({label:e,rounded:t="rounded-lg"}){/* @__PURE__ */
30
- return ke("div",{role:"status",className:`absolute inset-0 flex items-center justify-center gap-2 bg-white/60 ${t}`,children:[
31
- /* @__PURE__ */we(ct,{}),
32
- /* @__PURE__ */we("span",{className:"text-xs font-medium text-gray-600",children:e})]})}function ot({children:e}){/* @__PURE__ */
33
- return we("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-1.5 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function st(e,t=""){if(!e)return!1;const r=et.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return rt.test(e)||n&&!a}function ct({className:e="h-5 w-5"}){/* @__PURE__ */
34
- return ke("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
35
- /* @__PURE__ */we("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
36
- /* @__PURE__ */we("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function dt({className:e="h-4 w-4"}){/* @__PURE__ */
37
- return we("svg",{className:e,viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M6 6l8 8M14 6l-8 8"})})}function ut({className:e="h-6 w-6"}){/* @__PURE__ */
38
- return ke("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
39
- /* @__PURE__ */we("path",{d:"M12 15V4"}),
40
- /* @__PURE__ */we("path",{d:"M8 8l4-4 4 4"}),
41
- /* @__PURE__ */we("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]})}function ht({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:b=!0,allowReplace:y=!0,allowRemove:v=!0,replaceLabel:w,removeLabel:k,busy:N=!1,busyLabel:M,disabled:$=!1}){const C=V().media,D=p??C.cta,j=w??C.replace,A=k??C.remove,P=M??C.uploading,S=ce(),z=se(null),[F,B]=oe(null);ue(()=>()=>{z.current&&URL.revokeObjectURL(z.current)},[]);const E=$||N,T=!!e&&(st(e,c)||e===F),I=m??nt(c,C),O=e=>{r?r(e):n?n(e):(e=>{z.current&&URL.revokeObjectURL(z.current);const r=URL.createObjectURL(e);z.current=r,B(e.type.startsWith("video/")?r:null),t(r)})(e)},R=f({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:E,onAccept:([e])=>O(e)}),{dragOver:W}=R,H=()=>{E||(r?r():R.open())},_=e?tt(e):"",q=/* @__PURE__ */ke("div",{children:[
42
- /* @__PURE__ */ke("div",{...R.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",W?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[T?/* @__PURE__ */we("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":_||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */we("img",{src:e??void 0,alt:_,className:"h-full w-full",style:{objectFit:u}}),b&&e&&/* @__PURE__ */we(ot,{children:_}),N&&/* @__PURE__ */we(it,{label:P,rounded:"rounded-md"})]}),!$&&(y||v)&&/* @__PURE__ */ke("div",{className:"mt-2 flex gap-2",children:[y&&/* @__PURE__ */we(L,{id:S,variant:"secondary",size:"sm",onClick:()=>H(),disabled:N,children:j}),v&&/* @__PURE__ */we(L,{variant:"ghost",size:"sm",onClick:()=>{z.current&&(URL.revokeObjectURL(z.current),z.current=null),B(null),t("")},disabled:N,children:A})]})]}),K=/* @__PURE__ */we("button",{type:"button",id:S,onClick:()=>H(),disabled:E,"aria-label":"string"==typeof I?I:C.upload,"aria-busy":N||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${S}-error`:l?`${S}-hint`:void 0,...R.zoneProps,className:at(W,E,lt(E)),style:{minHeight:h},children:N?/* @__PURE__ */ke("span",{role:"status",className:"flex flex-col items-center gap-1.5",children:[
43
- /* @__PURE__ */we(ct,{}),
44
- /* @__PURE__ */we("span",{className:"text-xs font-medium text-gray-500",children:P})]}):/* @__PURE__ */ke(Ne,{children:[
45
- /* @__PURE__ */we("span",{className:"text-gray-400",children:/* @__PURE__ */we(ut,{})}),
46
- /* @__PURE__ */we("span",{className:"px-3 text-xs text-gray-500",children:I}),
47
- /* @__PURE__ */we("span",{className:"text-sm font-medium text-blue-600",children:D}),g&&/* @__PURE__ */we("span",{className:"text-xs text-gray-400",children:g})]})});/* @__PURE__ */
48
- return ke(Ve,{label:a,htmlFor:S,hint:l,error:i,required:o,className:s,children:[e?q:K,!r&&/* @__PURE__ */we("input",{...R.inputProps}),
49
- /* @__PURE__ */we(x,{rejections:R.rejections})]})}function mt({committedUrl:e,committedHasAlpha:t=null,committedIsLight:r=null,fallbackUrl:n,fallbackHasAlpha:a=null,fallbackIsLight:l=null,subjectName:i,assetName:o,onSave:s,onRemove:c,accept:d="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=se(null),[b,x]=oe(null),[y,v]=oe(""),[w,k]=oe(""),[N,M]=oe(!1),[$,C]=oe(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(o),j=V().brandAsset,A=y||e||n||"",P=b?null:e?t:a,S=b?null:e?r:l;ue(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const z=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
50
- return ke("section",{"aria-label":j.region(o,i),className:"grid gap-4 lg:grid-cols-2",children:[
51
- /* @__PURE__ */ke("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
52
- /* @__PURE__ */we(ht,{value:A,onChange:()=>{},onFile:e=>{if(g)return;z();const t=URL.createObjectURL(e);f.current=t,x(e),v(t),k("")},label:o,hint:w||j.usedFor(i),error:w||void 0,accept:d,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:N||$,disabled:g}),
53
- /* @__PURE__ */ke("div",{className:"mt-3 flex flex-wrap gap-2",children:[
54
- /* @__PURE__ */we(L,{onClick:async()=>{if(b&&!g&&!N){M(!0),k("");try{await s(b),z(),x(null),v("")}catch(e){k(e instanceof Error?e.message:j.saveFailed(D,o))}finally{M(!1)}}},disabled:!b||g,loading:N,children:j.save(D,o)}),(b||e)&&/* @__PURE__ */we(L,{variant:"ghost-danger",onClick:async()=>{if(!g&&!$){if(b)return z(),x(null),v(""),void k("");if(e){C(!0),k("");try{await c()}catch(e){k(e instanceof Error?e.message:j.removeFailed(D,o))}finally{C(!1)}}}},disabled:g,loading:$,children:b?j.discard:j.remove(D,o)})]})]}),p.length>0&&/* @__PURE__ */ke("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":j.previews(o),children:[
55
- /* @__PURE__ */we("h3",{className:"text-sm font-semibold text-gray-900",children:j.preview}),
56
- /* @__PURE__ */we("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */we(u,{src:A,alt:j.alt(i,o),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:S,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
57
- return ke("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
58
- /* @__PURE__ */we("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */ke("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
59
- /* @__PURE__ */ke("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,
60
- /* @__PURE__ */we("span",{className:"truncate text-xs text-gray-700",children:e.title??i}),
61
- /* @__PURE__ */we("span",{className:"text-gray-400",children:"×"})]}),
62
- /* @__PURE__ */we("span",{className:"mb-1 ml-1 text-gray-400",children:"+"})]}):"search-result"===e.kind?/* @__PURE__ */ke("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[
63
- /* @__PURE__ */ke("div",{className:"flex items-center gap-2",children:[
64
- /* @__PURE__ */we("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center overflow-hidden rounded-full border border-gray-200 bg-gray-50",children:t}),
65
- /* @__PURE__ */ke("div",{className:"min-w-0 leading-tight",children:[
66
- /* @__PURE__ */we("div",{className:"truncate text-xs font-medium text-gray-700",children:e.title??i}),e.url&&/* @__PURE__ */we("div",{className:"truncate text-xs text-gray-400",children:e.url})]})]}),
67
- /* @__PURE__ */we("div",{className:"mt-1.5 text-sm font-medium text-blue-700",children:e.title??i}),e.description&&/* @__PURE__ */we("div",{className:"text-xs text-gray-500",children:e.description})]}):/* @__PURE__ */ke("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,
68
- /* @__PURE__ */we("span",{className:"text-sm",children:e.title??e.label})]})]},`${e.label}-${e.slot}-${e.surface??"light"}`)})})]})]})}function pt(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 gt=he(null);function ft(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 bt({load:e,fallback:t,documentTitle:r,children:n}){const[a,l]=oe(t),[i,o]=oe(!0),[s,c]=oe(null),d=se(e),u=se(t);d.current=e,u.current=t,ue(()=>{const e=new AbortController;let t=!0;return l(u.current),o(!0),c(null),d.current(e.signal).then(e=>{t&&(l(e),o(!1))},e=>{t&&(c(e instanceof Error?e:new Error("Could not load portal branding.")),o(!1))}),()=>{t=!1,e.abort()}},[]),ue(()=>(ft(a.favicon_url),()=>ft(null)),[a.favicon_url]),ue(()=>{r&&(document.title=r(a))},[a,r]);const h=de(()=>({branding:a,loading:i,error:s}),[a,i,s]);/* @__PURE__ */
69
- return we(gt.Provider,{value:h,children:n})}function xt(){const e=fe(gt);if(!e)throw new Error("usePortalBranding must be used inside PortalBrandingProvider.");return e}var yt=/* @__PURE__ */we("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3",children:/* @__PURE__ */we("path",{d:"M6 6l12 12M18 6L6 18"})});function vt({items:e,onPick:t,onFiles:r,onRemove:n,onReorder:a,label:l,hint:i,error:o,required:s,className:c,accept:d="image/*",maxSizeBytes:u,maxFiles:h,fit:m="cover",thumbSize:p=96,placeholder:g,cta:b,acceptHint:y,showCover:v=!1,coverLabel:w,busy:k=!1,busyLabel:N,disabled:M=!1,readOnly:$=!1}){const C=V().media,L=b??C.cta,D=w??C.cover,j=N??C.uploading,A=ce(),[P,S]=oe(null),z=M||k,F=!(!t&&!r||z||$),B=!!n&&!z&&!$,E=!!a&&!z&&!$,T=lt(z),I=g??nt(d,C),O=f({accept:d,maxSizeBytes:u,maxFiles:h,acceptHint:y,multiple:!0,disabled:!F,currentCount:e.length,onAccept:e=>{if(r)r(e);else for(const r of e)t(r)}}),R=O.dragOver,W=()=>{F&&(t?t():O.open())},H={width:p,height:p},_=F&&/* @__PURE__ */ke("button",{type:"button",onClick:()=>W(),"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 ${T}`,style:H,children:[
70
- /* @__PURE__ */we(ut,{className:"h-5 w-5"}),
71
- /* @__PURE__ */we("span",{className:"text-xs font-medium text-gray-500",children:C.add})]}),q=F?/* @__PURE__ */ke("button",{type:"button",onClick:()=>W(),"aria-label":"string"==typeof I?I:C.upload,className:at(R,!1,T),style:{minHeight:p+32},children:[
72
- /* @__PURE__ */we("span",{className:"text-gray-400",children:/* @__PURE__ */we(ut,{})}),
73
- /* @__PURE__ */we("span",{className:"px-3 text-xs text-gray-500",children:I}),
74
- /* @__PURE__ */we("span",{className:"text-sm font-medium text-blue-600",children:L}),y&&/* @__PURE__ */we("span",{className:"text-xs text-gray-400",children:y})]}):/* @__PURE__ */we("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:p+32},children:C.empty});/* @__PURE__ */
75
- return ke(Ve,{label:l,labelId:l?`${A}-label`:void 0,htmlFor:A,hint:i,error:o,required:s,className:c,children:[
76
- /* @__PURE__ */ke("div",{id:A,role:"group","aria-labelledby":l?`${A}-label`:void 0,"aria-describedby":o?`${A}-error`:i?`${A}-hint`:void 0,"aria-busy":k||void 0,...O.zoneProps,className:"relative rounded-lg transition-colors",style:{...z?{opacity:.6}:{},...R?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===e.length?q:/* @__PURE__ */ke("div",{className:"flex flex-wrap gap-2",children:[e.map((t,r)=>{const l=t.kind?"video"===t.kind:st(t.url,d),i=tt(t.url),o=v&&(t.cover??0===r);/* @__PURE__ */
77
- return ke("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",T,P===r?"opacity-50":""].join(" "),style:{...H,cursor:E?"move":void 0},children:[l?/* @__PURE__ */we("video",{src:t.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":i,className:"h-full w-full",style:{objectFit:m}}):/* @__PURE__ */we("img",{src:t.url,alt:i,className:"h-full w-full",style:{objectFit:m}}),o&&/* @__PURE__ */we("span",{className:"absolute left-1 top-1 rounded bg-blue-600 px-1.5 py-0.5 text-xs font-medium text-white",children:D}),null!=t.caption&&/* @__PURE__ */we(ot,{children:t.caption}),B&&/* @__PURE__ */we("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 ${T}`,style:{background:"var(--rosh-media-scrim-button)"},children:yt})]},t.id)}),_]}),k&&/* @__PURE__ */we(it,{label:j})]}),!t&&r&&/* @__PURE__ */we("input",{...O.inputProps}),
78
- /* @__PURE__ */we(x,{rejections:O.rejections})]})}var wt=e=>String(e).padStart(2,"0");function kt(e){return`${e.getFullYear()}-${wt(e.getMonth()+1)}-${wt(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 Mt=e=>`${e.getFullYear()}-${wt(e.getMonth()+1)}`;var $t=()=>kt(/* @__PURE__ */new Date);var Ct=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),Lt=(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 Dt({value:e,endValue:t,mode:r="single",onSelect:n,min:a,max:l,month:i,defaultMonth:o,onMonthChange:s,weekStartsOn:c,quickJump:d=!0,"aria-label":u,className:h=""}){const m=Nt(e),p=te($t,null),g=Nt(p),f=V().calendar,b=U(),x=y(b),w=te(()=>v(b),0),k=c??w,N=()=>{if(!g)return null;const e=Mt(g);return a&&e<a.slice(0,7)?a.slice(0,7):l&&e>l.slice(0,7)?l.slice(0,7):e},[M,$]=oe(()=>o||(m?Mt(m):N())),C=i??M??N(),L=null===C?null:function(e,t){const r=/^(\d{4})-(\d{2})$/.exec(e);return r?new Date(Number(r[1]),Number(r[2])-1,1):t}(C,g),[D,j]=oe(()=>e??p),A=se(null),P=se(!1),[S,z]=oe("days"),F=de(()=>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,k):[],[C,k]),B=e=>!!a&&e<a||!!l&&e>l,E=D??p,T=F.some(e=>kt(e)===E),I=L?F.find(e=>e.getMonth()===L.getMonth())??F[0]:null,O=T&&E?E:I?kt(I):"";if(ue(()=>{P.current&&(P.current=!1,A.current?.querySelector('[data-active="true"]')?.focus())},[O,C]),!L)/* @__PURE__ */
79
- return ke("div",{className:h,"aria-hidden":"true","data-calendar-pending":"",children:[
80
- /* @__PURE__ */we("div",{className:"mb-2 h-6"}),Array.from({length:7},(e,t)=>/* @__PURE__ */we("div",{className:0===t?"py-1 text-xs":"py-1.5 min-h-11 sm:min-h-0 text-sm",children:" "},t))]});const R=e=>"years"===S?new Date(L.getFullYear()+12*e,L.getMonth(),1):"months"===S?new Date(L.getFullYear()+e,L.getMonth(),1):Lt(L,e),W=e=>{const t=Mt(e);void 0===i&&$(t),s?.(t)},H=u??x.monthYear(L.getFullYear(),L.getMonth());/* @__PURE__ */
81
- return ke("div",{className:h,children:[
82
- /* @__PURE__ */ke("div",{className:"mb-2 flex items-center justify-between px-1",children:[
83
- /* @__PURE__ */we("button",{type:"button","aria-label":"years"===S?f.previousYears:"months"===S?f.previousYear:f.previousMonth,onClick:()=>W(R(-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__ */we("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),
84
- /* @__PURE__ */we("div",{"aria-live":"polite",className:"flex items-center gap-1 text-sm font-semibold text-gray-800",children:d?/* @__PURE__ */ke(Ne,{children:["years"!==S&&/* @__PURE__ */we("button",{type:"button","aria-label":f.chooseMonth(x.months[L.getMonth()]),onClick:()=>z(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:x.months[L.getMonth()]}),
85
- /* @__PURE__ */we("button",{type:"button","aria-label":f.chooseYear(L.getFullYear()),onClick:()=>z(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__ */we("span",{children:x.monthYear(L.getFullYear(),L.getMonth())})}),
86
- /* @__PURE__ */we("button",{type:"button","aria-label":"years"===S?f.nextYears:"months"===S?f.nextYear:f.nextMonth,onClick:()=>W(R(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__ */we("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]}),"months"===S&&/* @__PURE__ */we("div",{role:"group","aria-label":f.monthPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:x.monthsShort.map((e,t)=>/* @__PURE__ */we("button",{type:"button","aria-pressed":t===L.getMonth(),onClick:()=>{W(new Date(L.getFullYear(),t,1)),z("days")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",t===L.getMonth()?"bg-blue-600 font-semibold text-white":g&&t===g.getMonth()&&L.getFullYear()===g.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),"years"===S&&/* @__PURE__ */we("div",{role:"group","aria-label":f.yearPanel,className:"grid grid-cols-3 gap-1 text-center text-sm",children:Array.from({length:12},(e,t)=>{return r=L.getFullYear(),12*Math.floor(r/12)+t;var r}).map(e=>/* @__PURE__ */we("button",{type:"button","aria-pressed":e===L.getFullYear(),onClick:()=>{W(new Date(e,L.getMonth(),1)),z("months")},className:["rounded-md py-4 transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",e===L.getFullYear()?"bg-blue-600 font-semibold text-white":e===g?.getFullYear()?"font-medium text-blue-600 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100"].join(" "),children:e},e))}),
87
- /* @__PURE__ */ke("div",{ref:A,role:"grid","aria-label":H,onKeyDown:e=>{const t=Nt(O)??g??L,r={ArrowLeft:()=>Ct(t,-1),ArrowRight:()=>Ct(t,1),ArrowUp:()=>Ct(t,-7),ArrowDown:()=>Ct(t,7),Home:()=>Ct(t,-(t.getDay()-k+7)%7),End:()=>Ct(t,6-(t.getDay()-k+7)%7),PageUp:()=>Lt(t,e.shiftKey?-12:-1),PageDown:()=>Lt(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),P.current=!0,j(kt(a)),void(Mt(a)!==C&&W(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),B(O)||n(O))},hidden:"days"!==S,children:[
88
- /* @__PURE__ */we("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+k)%7).map(e=>
89
- /* @__PURE__ */we("div",{role:"columnheader","aria-label":x.weekdays[e],className:"py-1",children:/* @__PURE__ */we("abbr",{title:x.weekdays[e],className:"no-underline",children:x.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */we("div",{role:"row",className:"grid grid-cols-7 text-center text-sm",children:F.slice(7*l,7*l+7).map(a=>{const l=kt(a),i=a.getMonth()!==L.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=B(l);/* @__PURE__ */
90
- return we("div",{role:"gridcell","aria-selected":o,children:/* @__PURE__ */we("button",{type:"button","data-active":l===O,tabIndex:l===O?0:-1,disabled:c,"aria-label":x.longDate(a.getFullYear(),a.getMonth(),a.getDate()),"aria-current":l===p?"date":void 0,onClick:()=>{j(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":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100",l!==p||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),children:a.getDate()})},l)})},l))]})]})}var jt=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],At=e=>`${e.getFullYear()}-${Pt(e.getMonth()+1)}`,Pt=e=>String(e).padStart(2,"0");function St(e){return`${e.getFullYear()}-${Pt(e.getMonth()+1)}-${Pt(e.getDate())}`}function zt(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:St(new Date(r,n,t.getDate()-14)),to:St(a)};case"lastMonth":return{from:St(i(1)),to:St(l)};case"last3Months":return{from:St(i(3)),to:St(l)};case"last6Months":return{from:St(i(6)),to:St(l)};case"last12Months":return{from:St(i(12)),to:St(l)}}}function Ft(e,t,r){const n=At(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 Et(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Tt=/* @__PURE__ */new Map;function It({from:e,to:r,onChange:n,formatDisplay:a,clearable:l,required:i=!1,name:o,id:s,"aria-labelledby":c,"aria-label":d,weekStartsOn:u,placeholder:h,fullWidth:m=!1,min:p,max:g}){const f=V().dateRange,b=U(),x=a??(b?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}}(b):Et),v=h??f.placeholder,w=l??!i,[k,N]=oe(!1),[M,$]=oe(e),[C,L]=oe(r),[D,j]=oe(null),A=se(null),P=se(null),S=se(null),z=ce(),B=ce(),E=ce(),[T,I]=oe(!1),O=t(A,k,{preferredMaxWidth:520,preferredMaxHeight:T?720:560,popupRef:S}),R=se(null),W=se(null);ee(()=>{const e=S.current;if(!k||!O||!e)return;const t=getComputedStyle(e),r=O.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(T)null!==W.current&&W.current<=r&&I(!1);else{const e=R.current?.offsetWidth??0;if(0===e)return;W.current=e,e>r+.5&&I(!0)}});const[H,K]=oe(!1);ee(()=>{const e=!!s&&(P.current?.labels?.length??0)>0;e!==H&&K(e)});const Y=!!d||!!c||H,G=/* @__PURE__ */new Date,[Z,X]=oe(()=>e?At(Bt(e)):Ft(G,p,g)),J=jt.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(zt(e,G),p,g)),Q=e=>e?x(e):"";ue(()=>{if(!k)return;const e=e=>{const t=e.target;A.current?.contains(t)||S.current?.contains(t)||N(!1)};document.addEventListener("mousedown",e);const t=_(()=>N(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[k]);const te=()=>{n("",""),N(!1)},re=e&&r?`${Q(e)} — ${Q(r)}`:e?f.fromOnly(Q(e)):r?f.toOnly(Q(r)):"",ne=y(b),ae=e=>{const t=Nt(e);return t?ne.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},le=e&&r?f.range(ae(e),ae(r)):e?f.fromOnly(ae(e)):r?f.toOnly(ae(r)):v,ie=e=>T?"rounded-md border px-2.5 py-1 text-sm transition-colors "+(D===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 "+(D===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),de=/* @__PURE__ */ke(Ne,{children:[J.map(e=>/* @__PURE__ */we("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=zt(e,G);$(t.from),L(t.to),j(e),X(t.from.slice(0,7))})(e),className:ie(e),children:f[e]},e)),
91
- /* @__PURE__ */we("button",{type:"button",onClick:()=>j("Custom"),className:ie("Custom"),children:f.custom})]}),he=
92
- /* @__PURE__ */we(Dt,{mode:"range",min:p,max:g,value:M||null,endValue:C||null,month:Z,onMonthChange:X,onSelect:e=>{j("Custom"),!M||M&&C?($(e),L("")):e<M?(L(M),$(e)):L(e)},weekStartsOn:u,"aria-label":f.dialog});/* @__PURE__ */
93
- return ke("div",{className:"relative"+(m?" w-full":""),ref:A,children:[
94
- /* @__PURE__ */ke("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||r?"border-blue-400 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500"}`,children:[
95
- /* @__PURE__ */ke("button",{ref:P,type:"button",onClick:()=>{$(e),L(r),j(null),X(e?At(Bt(e)):Ft(G,p,g)),N(!0)},"aria-haspopup":"dialog","aria-expanded":k,id:s,"aria-label":d,"aria-labelledby":c,"aria-describedby":[Y?B:void 0,i?E:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":k?z:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(m?" min-w-0 flex-1 justify-start":""),children:[
96
- /* @__PURE__ */we("svg",{className:"w-4 h-4 shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */we("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"})}),
97
- /* @__PURE__ */we("span",{className:"truncate",children:re||v})]}),w&&(e||r)&&/* @__PURE__ */we("button",{type:"button",onClick:te,"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__ */we("span",{id:B,className:"sr-only",children:le}),i&&/* @__PURE__ */we("span",{id:E,className:"sr-only",children:f.required}),o&&/* @__PURE__ */ke(Ne,{children:[
98
- /* @__PURE__ */we("input",{type:"hidden",name:o.from,value:e}),
99
- /* @__PURE__ */we("input",{type:"hidden",name:o.to,value:r})]}),k&&Me(
100
- /* @__PURE__ */ke("div",{ref:S,id:z,role:"dialog","aria-label":f.dialog,"data-layout":T?"stacked":"side",className:"fixed rounded-2xl p-4",style:{zIndex:q.popup,left:O?.left,right:O?.right,top:O?.top,bottom:O?.bottom,width:T&&O?O.maxWidth:"max-content",maxWidth:O?.maxWidth,maxHeight:O?.maxHeight,overflowY:"auto",visibility:O?void 0:"hidden",...F()},children:[
101
- /* @__PURE__ */ke("div",{className:T?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[
102
- /* @__PURE__ */ke("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
103
- /* @__PURE__ */we("span",{className:"text-xs font-medium text-gray-500",children:f.from}),
104
- /* @__PURE__ */we("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(M?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:M?Q(M):f.start})]}),!T&&/* @__PURE__ */we("span",{className:"text-gray-300",children:"—"}),
105
- /* @__PURE__ */ke("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[
106
- /* @__PURE__ */we("span",{className:"text-xs font-medium text-gray-500",children:f.to}),
107
- /* @__PURE__ */we("span",{className:"text-sm px-2 py-1 rounded border min-w-[90px] "+(C?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"),children:C?Q(C):f.end})]})]}),T?/* @__PURE__ */ke(Ne,{children:[J.length>0&&/* @__PURE__ */we("div",{className:"mb-3 flex flex-wrap gap-1.5",children:de}),
108
- /* @__PURE__ */we("div",{className:"w-full",children:he})]}):
109
- /* @__PURE__ */ke("div",{ref:R,className:"flex w-max gap-4",children:[
110
- /* @__PURE__ */we("div",{className:"w-64",children:he}),J.length>0&&/* @__PURE__ */we("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:de})]}),
111
- /* @__PURE__ */ke("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[w&&/* @__PURE__ */we("button",{type:"button",onClick:te,className:"px-3 py-1.5 text-sm text-gray-500 hover:text-gray-700",children:f.clear}),
112
- /* @__PURE__ */we("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}),
113
- /* @__PURE__ */we("button",{type:"button",onClick:()=>{n(M,C),N(!1)},disabled:!M||!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 Ot=/^\d{2}:\d{2}(:\d{2})?$/,Rt=e=>String(e).padStart(2,"0");function Wt(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Rt(e.getHours())}:${Rt(e.getMinutes())}`;return t?`${r}:${Rt(e.getSeconds())}`:r}return Ot.test(e)?e:""}var Ht=le(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:o,...s},c){const d=null!=o&&Number(o)<60,u=U();/* @__PURE__ */
114
- return we("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:Wt(e,d),min:Wt(r,d)||void 0,max:Wt(n,d)||void 0,onChange:e=>t?.(Ot.test(e.target.value)?e.target.value:null),className:Pe({invalid:a,size:l,className:i}),...s})}),_t=/^\d{4}-\d{2}-\d{2}$/,qt=/^(aria|data)-/,Kt=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function Ut(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":St(e);if(_t.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":St(t)}function Vt(e){if(!_t.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 Yt(e,t){const r=Vt(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Gt=le(function({value:e,onChange:r,min:n,max:a,invalid:l,size:i,native:o,weekStartsOn:s,className:c="","aria-label":d,"aria-describedby":u,"aria-labelledby":h,id:m,name:p,disabled:g,placeholder:f,required:b,clearable:x,form:v,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,...C},L){const D=x??!b,j=Ut(e),A=Ut(n),P=Ut(a),S=V().datePicker,z=U(),F=y(z),[B,E]=oe(!1),T=se(null),I=se(null),O=se(null),R=ce(),W=ce(),K=ce(),Y=t(I,B,{popupRef:O}),[G,Z]=oe(!1);ee(()=>{const e=!!m&&(I.current?.labels?.length??0)>0;e!==G&&Z(e)});const X=!d&&(!!h||G);if(ue(()=>{if(!B)return;const e=e=>{const t=e.target;T.current?.contains(t)||O.current?.contains(t)||E(!1)};document.addEventListener("pointerdown",e,!0);const t=_(()=>E(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[B]),ue(()=>{if(B)return H(e=>"Escape"===e.key&&(E(!1),I.current?.focus(),!0),()=>O.current)},[B]),o)/* @__PURE__ */
115
- return we("input",{ref:L,type:"date",lang:z,id:m,name:p,disabled:g,"aria-label":d,"aria-describedby":u,"aria-invalid":l||void 0,value:j,min:A||void 0,max:P||void 0,onChange:e=>r?.(Vt(e.target.value)),className:Pe({invalid:l,size:i,className:c}),"aria-labelledby":h,required:b,form:v,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,...C});const J=Object.fromEntries(Object.entries(C).filter(([e])=>qt.test(e)&&!Kt.has(e))),Q=C["aria-required"],te=!!b||!0===Q||"true"===Q,re=[X?W:void 0,te?K:void 0,u].filter(Boolean).join(" ")||void 0,ne=St(/* @__PURE__ */new Date),ae=(!A||ne>=A)&&(!P||ne<=P),le=f??S.placeholder;/* @__PURE__ */
116
- return ke("div",{ref:T,className:"relative",children:[
117
- /* @__PURE__ */we("input",{ref:L,type:"hidden",name:p,form:v,value:j}),
118
- /* @__PURE__ */ke("button",{ref:I,type:"button",...J,id:m,disabled:g,title:w,tabIndex:k,autoFocus:N,onFocus:M,onBlur:$,"aria-haspopup":"dialog","aria-expanded":B,"aria-controls":B?R:void 0,"aria-labelledby":h,"aria-describedby":re,"aria-label":d?`${d}${j?`, ${Yt(j,F)}`:""}`:void 0,onClick:()=>E(e=>!e),className:`${Pe({invalid:l,size:i,className:c})} flex items-center justify-between text-left`,children:[
119
- /* @__PURE__ */we("span",{className:j?"text-gray-900":"text-gray-400",children:j?Yt(j,F):le}),
120
- /* @__PURE__ */we("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__ */we("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"})})]}),X&&/* @__PURE__ */we("span",{id:W,className:"sr-only",children:j?Yt(j,F):le}),te&&/* @__PURE__ */we("span",{id:K,className:"sr-only",children:S.required}),B&&Me(
121
- /* @__PURE__ */ke("div",{ref:O,id:R,role:"dialog","aria-label":d??S.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:q.popup,left:Y?.left,right:Y?.right,top:Y?.top,bottom:Y?.bottom,maxWidth:Y?.maxWidth,visibility:Y?void 0:"hidden"},children:[
122
- /* @__PURE__ */we(Dt,{value:j||null,min:A||null,max:P||null,weekStartsOn:s,onSelect:e=>{E(!1),I.current?.focus(),r?.(Vt(e))}}),(D||ae)&&/* @__PURE__ */ke("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[D&&/* @__PURE__ */we("button",{type:"button",onClick:()=>{E(!1),I.current?.focus(),r?.(null)},className:"rounded-md px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:S.clear}),ae&&/* @__PURE__ */we("button",{type:"button",onClick:()=>{E(!1),I.current?.focus(),r?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-md px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:S.today})]})]}),document.body)]})}),Zt=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Xt=e=>String(e).padStart(2,"0");function Jt(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Xt(t.getMonth()+1)}-${Xt(t.getDate())}T${Xt(t.getHours())}:${Xt(t.getMinutes())}`:Zt.test(e)?e:"";var t}var Qt=le(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=U();/* @__PURE__ */
123
- return we("input",{ref:s,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(!Zt.test(e))return null;const[t,r]=e.split("T"),[n,a,l]=t.split("-").map(Number),[i,o,s=0]=r.split(":").map(Number);if(i>23||o>59||s>59)return null;const c=new Date(n,a-1,l,i,o,s);return c.getMonth()===a-1&&c.getDate()===l?c:null}(e.target.value)),className:Pe({invalid:a,size:l,className:i}),...o})});function er(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 tr(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 rr(e,t,r){const n=await tr(t,r),a=G().copy;return n?h.success(a.copiedLabel(e)):h.error(a.failed),n}var nr={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},ar={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 lr(){/* @__PURE__ */
124
- return we("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */we("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 ir(){/* @__PURE__ */
125
- return we("svg",{className:"h-4 w-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}function or({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:c,"aria-describedby":d,className:u=""}){const[m,p]=oe(!1),g=se(null),f=V().copy;ue(()=>()=>{g.current&&clearTimeout(g.current)},[]);const b=ie(async()=>{await tr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),o?.(e)):h.error(f.failed)},[e,o,f]),{box:x,button:y}=ar[a],v=!i;/* @__PURE__ */
126
- return ke("div",{id:v?void 0:c,"aria-describedby":v?void 0:d,className:["inline-flex max-w-full items-center rounded-md",nr[l],x,u].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
127
- /* @__PURE__ */we("span",{className:"min-w-0 font-mono text-gray-800 "+(s?"whitespace-pre-wrap break-all":"truncate"),title:s?void 0:e,children:t??e}),!i&&/* @__PURE__ */ke(Ne,{children:[
128
- /* @__PURE__ */we($e,{id:c,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":d,onClick:b,className:`${y} text-gray-400`,children:/* @__PURE__ */we(m?ir:lr,{})}),
129
- /* @__PURE__ */we("span",{"aria-live":"polite",className:"sr-only",children:m?f.copied:""})]})]})}var sr=2;function cr(e,t){if("."===t)return e.includes(".")?e:""===e?"0.":`${e}.`;if(t<"0"||t>"9")return e;const r=e.indexOf(".");return-1!==r&&e.length-r-1>=2?e:"0"===e?t:e+t}function dr(e){return e.slice(0,-1)}var ur=["1","2","3","4","5","6","7","8","9",".","0"];function hr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=V().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
130
- return ke("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[ur.map(t=>/* @__PURE__ */we(L,{size:"touch-xl",variant:"secondary",onClick:()=>o(cr(e,t)),children:t},t)),
131
- /* @__PURE__ */we(L,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(dr(e)),children:"⌫"}),r&&/* @__PURE__ */we(L,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var mr={md:"h-24 p-3",lg:"h-32 p-4"},pr=le(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
132
- return ke("button",{ref:s,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)]",mr[r],i].filter(Boolean).join(" "),...o,children:[
133
- /* @__PURE__ */we("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */we("span",{className:"text-sm text-gray-500",children:t})]})}),gr={sm:"h-7 px-2.5 text-xs",md:"h-9 px-3 text-sm",touch:"h-14 px-5 text-base"},fr="bg-white text-gray-900 shadow-sm ring-1 ring-inset ring-[color:var(--ink-faint)] rosh-segmented-on",br="text-gray-600 hover:text-gray-900";function xr({value:e,onChange:t,options:r,name:a,size:l="md",block:i=!1,label:o,className:s="","aria-labelledby":c,"aria-describedby":d}){const u={"aria-label":c?void 0:o,"aria-labelledby":c,"aria-describedby":d},h=ce(),m=`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 ${i?"w-full":""} ${s}`.trim(),p=("relative inline-flex shrink-0 "+(i?"flex-1":"")).trim(),g="inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors "+(i?"flex-1":"");/* @__PURE__ */
134
- return we("div",a?{role:"radiogroup",...u,className:m,children:r.map(r=>{const i=`${h}-${r.value}`,o=r.value===e,s=/* @__PURE__ */ke("label",{htmlFor:i,className:[g,"relative",gr[l],o?fr:br,r.disabled?"cursor-not-allowed opacity-40":"cursor-pointer"].join(" "),children:[
135
- /* @__PURE__ */we("input",{id:i,type:"radio",name:a,value:r.value,checked:o,disabled:r.disabled,"aria-describedby":r.title?`${i}-note`:void 0,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.title&&/* @__PURE__ */we("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */we(n,{content:r.title,className:p,children:s},r.value):s})}:{role:"group",...u,className:m,children:r.map(r=>{const a=r.value===e,i=/* @__PURE__ */ke("button",{type:"button","aria-pressed":a,disabled:r.disabled,onClick:()=>t(r.value),className:[g,gr[l],a?fr:br,"disabled:cursor-not-allowed disabled:opacity-40"].join(" "),children:[r.icon,r.label]},r.value);return r.title?/* @__PURE__ */we(n,{content:r.title,className:p,children:i},r.value):i})})}var yr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},vr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},wr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},kr=le(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=ce(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */we("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,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",yr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */we("span",{className:["inline-block rounded-full bg-white shadow transition-transform",vr[n],e?wr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */ke("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[y,
136
- /* @__PURE__ */ke("span",{className:"min-w-0",children:[a&&/* @__PURE__ */we("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */we("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */we("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */we("span",{className:o,children:y})});function Nr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var Mr=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function $r(e){const t=e.trim().replace(",",".");if(""===t||"-"===t||"."===t||"-."===t)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Cr({dir:e,label:t,disabled:r,onStep:n}){const a=se(n);a.current=n;const l=se({}),i=ie(()=>{const e=l.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),l.current={}},[]);ue(()=>i,[i]),ue(()=>{r&&i()},[r,i]);/* @__PURE__ */
137
- return we($e,{size:"sm",tabIndex:-1,"aria-label":t,disabled:r,onPointerDown:e=>{if(0!==e.button||r)return;e.preventDefault(),i();const t=e.shiftKey;a.current(t);const n=e.currentTarget.ownerDocument.defaultView??window;n.addEventListener("pointerup",i),l.current={off:()=>n.removeEventListener("pointerup",i),wait:setTimeout(()=>{l.current.every=setInterval(()=>a.current(t),60)},400)}},onPointerLeave:i,onPointerCancel:i,onClick:e=>{0===e.detail&&a.current(e.shiftKey)},children:/* @__PURE__ */we("svg",{"aria-hidden":"true",focusable:"false",className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e>0?"M4.5 15.75l7.5-7.5 7.5 7.5":"M19.5 8.25l-7.5 7.5-7.5-7.5"})})})}var Lr=le(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:o,readOnly:s,invalid:c,placeholder:d,size:u,prefix:h,suffix:m,id:p,name:g,className:f="",onBlur:b,steppers:x=!1,snap:y=!1,allowEmpty:v=!0,"aria-label":w,"aria-labelledby":k},N){const M=V(),[$,C]=oe(()=>Mr(e,a)),L=se($);L.current=$;const D=se(null),j=ie(e=>{D.current=e,"function"==typeof N?N(e):N&&(N.current=e)},[N]),A=se(e),P=se(e);P.current=e;const S=Boolean(o||s);ue(()=>{$r(L.current)!==e&&C(Mr(e,a))},[e,a]);const z=e=>{if(S)return;let i=($r(L.current)??(d?$r(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const o=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(o));const s=Mr(i,a);L.current=s,C(s),t(i)},F=se(z);F.current=z;const[B,E]=oe(!1);ue(()=>{if(B&&!S)return H(e=>{if("Escape"!==e.key||document.activeElement!==D.current)return!1;const r=A.current;if($r(L.current)===r)return!1;const n=Mr(r,a);return L.current=n,C(n),P.current!==r&&t(r),!0})},[B,S,a,t]);const T=()=>{const e=$r(L.current);if(null==e){if(!v){const e=Mr(P.current,a);return L.current=e,C(e),P.current}return L.current="",C(""),null!==P.current&&t(null),null}let i=e;const o=a??(y?Math.max(Nr(l??1),Nr(r??0)):void 0);if(y){const e=l??1,t=r??0;i=t+Math.round((i-t)/e)*e}null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=o&&(i=Number(i.toFixed(o)));const s=Mr(i,a);return L.current=s,C(s),i===e&&i===P.current||t(i),i},I=/* @__PURE__ */we("input",{ref:j,id:p,name:g,type:"text",inputMode:0===a?"numeric":"decimal",value:$,disabled:o,readOnly:s,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?d||void 0:Mr(e,a),"aria-invalid":c||void 0,"aria-label":w,"aria-labelledby":k,onChange:e=>(e=>{if(s)return;if(""!==e&&!/^-?\d*[.,]?\d*$/.test(e))return;C(e);const r=$r(e);(null!==r||v)&&t(r)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!S)return void(A.current=T());const t=l??1,r=i??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||S||(e.preventDefault(),z(n))},onFocus:()=>{A.current=P.current,E(!0)},onBlur:()=>{E(!1),T(),b?.()},className:Pe({invalid:c,size:u,readOnly:s,className:[h?"pl-7":"",x?m?"pr-24":"pr-16":m?"pr-9":"","text-right tabular-nums",f].filter(Boolean).join(" ")})});if(!h&&!m&&!x)return I;const O=$r($);/* @__PURE__ */
138
- return ke("div",{className:"relative",children:[h&&/* @__PURE__ */we("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:h}),I,m&&/* @__PURE__ */we("span",{className:`pointer-events-none absolute ${x?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:m}),x&&/* @__PURE__ */ke("span",{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[
139
- /* @__PURE__ */we(Cr,{dir:-1,label:M.number.decrease,disabled:S||null!=r&&null!=O&&O<=r,onStep:e=>F.current(-(e?i??10*(l??1):l??1))}),
140
- /* @__PURE__ */we(Cr,{dir:1,label:M.number.increase,disabled:S||null!=n&&null!=O&&O>=n,onStep:e=>F.current(e?i??10*(l??1):l??1)})]})]})}),Dr=(e,t,r)=>Math.min(r,Math.max(t,e));function jr({value:e,onChange:t,min:r,max:n,step:a=1,precision:l,inputMin:i,inputMax:o,suffix:s,showInput:c=!0,emptyLabel:d,label:u,"aria-labelledby":h,valueText:m,id:p,disabled:g,size:f="md",className:b=""}){const x=V(),y=ce(),v=p??y,w=l??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),k=i??r,N=o??n,M=void 0!==d,$=null==e?r:Dr(e,r,n),C=null==e?d:m?m(e):"string"==typeof s?`${e.toFixed(w)} ${s}`:void 0;/* @__PURE__ */
141
- return ke("div",{className:`flex items-center gap-3 ${b}`.trim(),children:[
142
- /* @__PURE__ */we("input",{id:v,type:"range",min:r,max:n,step:a,value:$,disabled:g,"aria-label":h?void 0:u,"aria-labelledby":h,"aria-valuetext":C,onChange:e=>t(function(e,t,r,n){return Number(Dr(e,t,r).toFixed(n))}(Number(e.target.value),r,n,w)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===f?"h-1":"h-1.5")}),c&&/* @__PURE__ */we("div",{className:"sm"===f?"w-16 shrink-0":"w-20 shrink-0",children:/* @__PURE__ */we(Lr,{value:e,onChange:e=>{null!=e?e<k||e>N||t(e):M&&t(null)},min:k,max:N,step:a,precision:w,snap:!0,allowEmpty:M,suffix:s,disabled:g,placeholder:d,size:"sm","aria-label":u?x.slider.value(u):void 0,"aria-labelledby":u?void 0:h})})]})}var Ar=/(^|[\s:])!?z-/;function Pr({trigger:e,children:t,title:r,description:n,"aria-label":s,align:c="start",side:d="bottom",open:u,defaultOpen:h=!1,onOpenChange:m,matchTriggerWidth:p=!1,maxHeight:g,initialFocus:f,id:b,triggerLabel:x,"aria-describedby":y,disabled:v,className:w="",triggerClassName:k,panelClassName:N=""}){const[M,$]=oe(h),C=(u??M)&&!v,L=re(),P=se(null),S=se(null),F=se(null),B=se(null),E=ce(),T=b??E,I=ce(),O=ce(),R=ce(),W=se(null),K=se(!1),U=se({openProp:u,onOpenChange:m});U.current={openProp:u,onOpenChange:m};const V=ie(e=>{void 0===U.current.openProp&&$(e),U.current.onOpenChange?.(e)},[]),Y=ie((e=!1)=>{K.current=e,V(!1)},[V]),G=e=>{W.current=e.nativeEvent},Z=ie(()=>{const e=F.current,t=S.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=a(t),o=Math.max(0,n.right-n.left-2*l),s=e.style;s.left="0px",s.top="0px",s.maxWidth=`${o}px`,s.maxHeight="none",s.width=p?`${Math.min(r.width,o)}px`:"";const u={width:e.offsetWidth,height:e.offsetHeight},h=g??1/0,m=i({trigger:r,menu:{width:u.width,height:Math.min(u.height,h)},bounds:n,align:c,side:d}),f=Math.min(m.maxHeight,h);s.left=`${m.left}px`,s.top=`${m.top}px`,s.maxHeight=`${f}px`,s.overflowY=u.height>f?"auto":"",e.dataset.side=m.side,e.dataset.align=c},[c,d,p,g]);ee(()=>{C&&L&&Z()}),ue(()=>{if(!C||!L)return;const e=o(()=>S.current,Z),t=B.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>Z());return r.observe(t),()=>{e(),r.disconnect()}},[C,L,Z]),ue(()=>{if(!C)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(W.current===e)return!1;const t=e.target;return!(t&&(P.current?.contains(t)||F.current?.contains(t)))})(e)&&Y(!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=_(()=>Y()),a=H(e=>"Escape"===e.key&&(Y(),S.current?.focus(),!0),()=>F.current);return()=>{t(),r(),n(),a()}},[C,Y]),j(F,C&&L),ee(()=>{if(!C||!L)return;const e=F.current;return()=>{if(K.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||S.current?.focus({preventScroll:!0})}},[C,L]),ue(()=>{if(!C||!L)return;const e=F.current;e&&(K.current=!1,(f?.current??A(e)[0]??e).focus({preventScroll:!0}))},[C,L]);const X="function"==typeof t?t({close:()=>Y()}):t,J=r?{"aria-labelledby":O}:s?{"aria-label":s}:{"aria-labelledby":T};/* @__PURE__ */
143
- return ke("div",{ref:P,className:`relative inline-flex ${w}`.trim(),children:[
144
- /* @__PURE__ */we("button",{ref:S,id:T,type:"button","aria-haspopup":"dialog","aria-expanded":C,"aria-controls":C&&L?I:void 0,"aria-label":x,"aria-describedby":y,disabled:v,onClick:()=>C?Y():V(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!C)return;const t=(()=>{const e=F.current;return e?A(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:k??D({variant:"secondary"}),children:e}),C&&L&&Me(
145
- /* @__PURE__ */we("div",{ref:F,id:I,role:"dialog",...J,"aria-describedby":n?R:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:G,onFocusCapture:G,onKeyDown:e=>{const t=F.current,r=S.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=A(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=z(r,t);Y(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${N}`.trim(),style:Ar.test(N)?void 0:{zIndex:q.popup},children:/* @__PURE__ */ke("div",{ref:B,children:[r&&/* @__PURE__ */we("h2",{id:O,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */we("p",{id:R,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */we("div",{className:"mt-3",children:X}):X]})}),document.body)]})}var Sr=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function zr(e){const t=e.trim().replace(/^#/,"");if(!Sr.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Fr=e=>e.toUpperCase(),Br=(e,t,r)=>Math.min(r,Math.max(t,e));function Er(e){const t=zr(e);if(!t)return{h:0,s:0,v:0};const r=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,a=parseInt(t.slice(5,7),16)/255,l=Math.max(r,n,a),i=l-Math.min(r,n,a);let o=0;return 0!==i&&(o=l===r?(n-a)/i%6*60:l===n?60*((a-r)/i+2):60*((r-n)/i+4)),{h:(o+360)%360,s:0===l?0:i/l,v:l}}function Tr({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Br(t,0,1),l=Br(r,0,1),i=l*a,o=i*(1-Math.abs(n/60%2-1)),s=l-i,[c,d,u]=n<60?[i,o,0]:n<120?[o,i,0]:n<180?[0,i,o]:n<240?[0,o,i]:n<300?[o,0,i]:[i,0,o],h=e=>Math.round(255*(e+s)).toString(16).padStart(2,"0");return`#${h(c)}${h(d)}${h(u)}`}var Ir=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Tr({h:e%360,s:1,v:1})).join(", ")})`,Or={sm:"h-5 w-5",md:"h-7 w-7",lg:"h-9 w-9"},Rr={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Wr(e){return e?{background:e}:Rr}function Hr({size:e="md",selected:t=!1,className:r=""}={}){return["relative inline-flex shrink-0 overflow-hidden rounded-md p-0 transition-shadow","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-60",t?"border-2 border-blue-500":"border border-gray-300 hover:shadow-sm",Or[e],r].filter(Boolean).join(" ")}var _r=le(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
146
- return we("button",{ref:i,type:a,"aria-pressed":r,className:Hr({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:"absolute inset-0",style:Wr(e)})})}),qr=(e,t,r)=>Math.min(r,Math.max(t,e)),Kr=e=>"string"==typeof e?{value:e}:e;var Ur={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Vr({value:e,onChange:t,label:r,presets:a,clearable:l=!1,fallback:i,dragWrites:o="live",disabled:s=!1,onClose:c,id:d,className:u=""}){const h=V().color,m=zr(i??""),[p,g]=oe(()=>Er(e||m||"")),f=se(e);ue(()=>{e!==f.current&&(f.current=e,e?g(Er(e)):m&&g(Er(m)))},[e]);const b=r=>{s||r===e||(f.current=r,t(r))},x=e=>{const t=zr(e);t&&(g(Er(t)),b(t))},y=e=>{g(e),b(Tr(e))},[v,w]=oe(!1),k=se(p);k.current=p;const N=e=>({onPointerDown:t=>{if(s||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,k.current);"end"===o?(w(!0),g(r)):y(r)},onPointerMove:t=>{if(s||!(1&t.buttons))return;const r=e(t,k.current);"end"===o?g(r):y(r)},onPointerUp:t=>{"end"===o&&v&&(w(!1),y(e(t,k.current)))}}),M=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Br((r-a.left)/a.width,0,1):0,v:a.height>0?1-Br((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Br((r-n.left)/n.width,0,1)):0)};var r,n}),C=v?Tr(p):e,L=e=>`${Math.round(100*e)}%`,D=(a??[]).map(Kr),j=zr(e);/* @__PURE__ */
147
- return ke("div",{id:d,className:`flex w-56 flex-col gap-3 ${s?"opacity-60":""} ${u}`.trim(),onKeyDown:e=>{"Escape"===e.key&&c&&(e.preventDefault(),e.stopPropagation(),c())},children:[(D.length>0||l)&&/* @__PURE__ */ke("div",{role:"group","aria-label":h.presets,className:"flex flex-wrap gap-1.5",children:[l&&/* @__PURE__ */we(n,{content:h.clear,children:/* @__PURE__ */we(_r,{color:"",size:"sm","aria-label":h.clear,selected:""===e,disabled:s,onClick:()=>{s||""===e||(f.current="",t(""))}})}),D.map(e=>{const t=zr(e.value),r=e.label?`${e.label} · ${Fr(t??e.value)}`:Fr(t??e.value);/* @__PURE__ */
148
- return we(n,{content:r,children:/* @__PURE__ */we(_r,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===j,disabled:s,onClick:()=>x(e.value)})},`${e.label??""}:${e.value}`)})]}),
149
- /* @__PURE__ */we("div",{role:"slider",tabIndex:s?-1:0,"aria-label":h.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*p.v),"aria-valuetext":h.squareValue(Math.round(100*p.s),Math.round(100*p.v)),"aria-disabled":s||void 0,"data-color-square":"",onKeyDown:e=>{if(s)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:qr(e.s+a[0],0,1),v:qr(e.v+a[1],0,1)}:null}(p,e.key,e.shiftKey);t&&(e.preventDefault(),y(t))},...M,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Tr({h:p.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:L(p.s),top:L(1-p.v),...Ur}})}),
150
- /* @__PURE__ */we("div",{role:"slider",tabIndex:s?-1:0,"aria-label":h.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(p.h),"aria-orientation":"horizontal","aria-disabled":s||void 0,"data-color-hue":"",onKeyDown:e=>{if(s)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return qr(e-n,0,359);case"ArrowRight":case"ArrowUp":return qr(e+n,0,359);case"PageDown":return qr(e-10,0,359);case"PageUp":return qr(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(p.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),y({...p,h:t}))},...$,className:"relative h-3 w-full cursor-pointer touch-none rounded-full rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundImage:Ir},children:/* @__PURE__ */we("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:p.h/360*100+"%",background:Tr({h:p.h,s:1,v:1}),...Ur}})}),
151
- /* @__PURE__ */ke("div",{className:"flex items-center gap-2",children:[
152
- /* @__PURE__ */we("span",{"aria-hidden":"true",className:"relative h-7 w-7 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Wr(C||(m??""))}),
153
- /* @__PURE__ */we(Yr,{value:C,placeholder:!e&&m?Fr(m):void 0,onChange:x,label:h.hex(r),disabled:s})]})]})}function Yr({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,className:i=""}){const[o,s]=oe(null);/* @__PURE__ */
154
- return we("input",{id:l,type:"text",value:o??(e?Fr(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{s(r.target.value);const n=zr(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s(null))},onBlur:()=>s(null),className:Pe({size:"sm",className:`min-w-0 flex-1 font-mono uppercase ${i}`.trim()})})}function Gr({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,size:d="md",align:u="start",open:h,onOpenChange:m,className:p=""}){const g=V().color,f=ce(),b=zr(l??""),x=e||b||"",y=e?Fr(e):b?Fr(b):g.none;/* @__PURE__ */
155
- return ke("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
156
- /* @__PURE__ */we(Pr,{id:s,trigger:/* @__PURE__ */we("span",{"aria-hidden":"true",className:"absolute inset-0",style:Wr(x)}),triggerLabel:g.swatch(r,y),triggerClassName:Hr({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */we(Vr,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
157
- /* @__PURE__ */we("div",{className:"w-24 flex-none",children:/* @__PURE__ */we(Yr,{value:e,placeholder:!e&&b?Fr(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o})})]})}var Zr=le(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=ce(),g=V().files,y=f({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:o,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),v=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
158
- return ke(Ve,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
159
- /* @__PURE__ */ke("button",{ref:m,type:"button",id:p,disabled:o,onClick:y.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":v,...y.zoneProps,className:at(y.dragOver,o,`px-4 py-6 ${lt(o)}`),children:[
160
- /* @__PURE__ */ke("span",{children:[
161
- /* @__PURE__ */we("span",{className:"text-sm font-medium text-blue-600",children:a?g.chooseMany:g.chooseOne}),
162
- /* @__PURE__ */we("span",{className:"text-sm text-gray-500",children:` ${a?g.dragMany:g.dragOne}`})]}),n&&/* @__PURE__ */we("span",{className:"text-xs text-gray-400",children:n})]}),
163
- /* @__PURE__ */we("input",{...y.inputProps}),e.length>0&&/* @__PURE__ */we("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */ke("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
164
- /* @__PURE__ */we("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
165
- /* @__PURE__ */we("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:b(r.size,g)}),
166
- /* @__PURE__ */we("button",{type:"button",disabled:o,onClick:()=>{y.clearRejections(),t(e.filter((e,t)=>t!==n))},"aria-label":g.remove(r.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */we(dt,{})})]},`${r.name}-${n}`))}),
167
- /* @__PURE__ */we(x,{rejections:y.rejections})]})});function Xr({className:e="h-4 w-4"}){/* @__PURE__ */
168
- return we("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:/* @__PURE__ */we("path",{d:"M21 11.5l-8.5 8.5a5.5 5.5 0 0 1-7.8-7.8l9-9a3.5 3.5 0 0 1 5 5l-9 9a1.5 1.5 0 0 1-2.1-2.1l8-8"})})}function Jr({className:e="h-4 w-4"}){/* @__PURE__ */
169
- return ke("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e,children:[
170
- /* @__PURE__ */we("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),
171
- /* @__PURE__ */we("path",{d:"M14 3v5h5"})]})}function Qr({intake:e,dropLabel:t,className:r="",children:n}){const a=V().files;/* @__PURE__ */
172
- return ke("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,children:[n,
173
- /* @__PURE__ */we("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */we("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 en({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=V().files,l=se(/* @__PURE__ */new Map);ue(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),ue(()=>()=>{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__ */we("ul",{className:`flex flex-wrap gap-1.5 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
174
- return ke("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__ */we("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */we("span",{className:"text-gray-400",children:/* @__PURE__ */we(Jr,{})}),
175
- /* @__PURE__ */we("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
176
- /* @__PURE__ */we("span",{className:"shrink-0 tabular-nums text-gray-400",children:b(e.size,a)}),t&&/* @__PURE__ */we("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__ */we(dt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function tn({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=V().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */ke("span",{className:"relative inline-flex",children:[
177
- /* @__PURE__ */we($e,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */we(Xr,{})}),t>0&&/* @__PURE__ */we("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__ */we(L,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */we(Xr,{}),children:o})}function rn({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:s,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=f({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=se([]);return ue(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */ke(Qr,{intake:p,dropLabel:o,className:h,children:[m,
178
- /* @__PURE__ */we(en,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
179
- /* @__PURE__ */ke("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
180
- /* @__PURE__ */we(tn,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
181
- /* @__PURE__ */we(x,{rejections:p.rejections})]})}function nn({onClear:e,ariaLabel:t}){/* @__PURE__ */
182
- return we("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 an({value:e,onChange:n,options:a,placeholder:l,emptyOptionLabel:i,className:o="",disabled:s,id:c,allowFreeText:d=!1,onSearchChange:u,rightAdornment:h,renderOption:m,"aria-label":p,"aria-labelledby":g,"aria-describedby":f}){const[b,x]=oe(!1),[y,v]=oe(-1),w=ce(),k=c??`${w}-input`,N=`${w}-listbox`,M=e=>`${w}-opt-${e}`,[$,C]=oe(""),L=V(),D=i??L.select.none,j=e=>{C(e),v(-1),u?.(e)},A=se(null),P=se(null),S=se(null),z=se(null),B=se(b);B.current=b;const E=se(!1),T=t=>{if(!B.current)return;B.current=!1;const r=$.trim();t&&d&&r&&r!==e&&n(r),x(!1),j("")},[I,O]=oe(null);ee(()=>{if(!h||b)return void O(null);const t=z.current?.offsetWidth??0;O(t?t+(e&&!s?32:8)+6:null)});const R=t(P,b,{matchTriggerWidth:!0}),W=de(()=>{const t=a.find(t=>t.value===e);return t?t.label:d?e:""},[a,e,d]);ue(()=>{if(!b)return;const e=e=>{const t=e.target;A.current?.contains(t)||S.current?.contains(t)||T(!0)};document.addEventListener("mousedown",e);const t=_(()=>T(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[b,d,$,e,n]),ue(()=>{if(b)return H(e=>!("Escape"!==e.key||!B.current)&&(T(!1),P.current?.blur(),!0),()=>S.current)},[b]);const K=de(()=>{const e=/* @__PURE__ */new Set,t=[];for(const r of a)e.has(r.value)||(e.add(r.value),t.push(r));return t},[a]),U=de(()=>{if(u)return K;const e=$.trim().toLowerCase();return e?K.filter(t=>t.label.toLowerCase().includes(e)||(t.sublabel?.toLowerCase().includes(e)??!1)):K},[K,$,u]);/* @__PURE__ */
183
- return ke("div",{ref:A,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(A.current?.contains(t)||S.current?.contains(t))||E.current||document.activeElement!==P.current&&T(!0)},children:[
184
- /* @__PURE__ */we("input",{id:k,ref:P,type:"text",autoComplete:"off",role:"combobox","aria-expanded":b,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":b?N:void 0,"aria-activedescendant":b&&y>=0&&y<U.length?M(y):void 0,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-describedby":f,value:b?$:W,onChange:e=>{j(e.target.value),x(!0)},onFocus:()=>{s||(j(""),x(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(s)return;if(e.preventDefault(),!b)return void x(!0);const t=U.length-1;if(t<0)return;return void v(r=>"ArrowDown"===e.key?r<0?0:Math.min(r+1,t):r<0?t:Math.max(r-1,0))}"Enter"===e.key?(e.preventDefault(),b&&y>=0&&y<U.length?(n(U[y].value),T(!1)):1===U.length?(n(U[0].value),T(!1)):d&&$.trim()&&(n($.trim()),T(!1),P.current?.blur())):"Escape"===e.key?(T(!1),P.current?.blur()):"Tab"===e.key&&T(!0)},placeholder:l||D,className:`${je} ${o} ${e?"pr-8":""} ${s?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate`,style:I?{paddingRight:I}:void 0,disabled:s}),e&&!s&&/* @__PURE__ */we(nn,{ariaLabel:L.select.clear,onClear:()=>{n(""),T(!1)}}),h&&!b&&/* @__PURE__ */we("div",{ref:z,className:`absolute top-1/2 -translate-y-1/2 ${e&&!s?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:h}),b&&Me(
185
- /* @__PURE__ */we("div",{ref:S,onMouseDownCapture:()=>{E.current=!0,setTimeout(()=>{E.current=!1},0)},className:"fixed rounded-2xl overflow-hidden",style:{zIndex:q.popup,left:R?.left,right:R?.right,top:R?.top,bottom:R?.bottom,minWidth:R?.minWidth,width:R?.width,visibility:R?void 0:"hidden",...F()},children:/* @__PURE__ */we("div",{id:N,role:U.length?"listbox":void 0,"aria-labelledby":U.length?g??(p?void 0:k):void 0,"aria-label":U.length&&!g?p:void 0,className:"overflow-y-auto",style:{maxHeight:R?.maxHeight??r},children:0===U.length?/* @__PURE__ */we("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:L.select.noMatches}):U.map((t,r)=>/* @__PURE__ */ke("button",{id:M(r),type:"button",role:"option","aria-selected":e===t.value,tabIndex:-1,onMouseDown:()=>{n(t.value),T(!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===t.value?"text-blue-600 font-medium":"text-gray-700"} ${r===y?"bg-gray-100":e===t.value?"bg-blue-50/50":""}`,children:[
186
- /* @__PURE__ */we("span",{className:"min-w-0 flex-1 truncate",children:m?m(t,{selected:e===t.value}):t.label}),t.sublabel&&/* @__PURE__ */we("span",{className:"min-w-0 max-w-[45%] shrink-0 truncate text-xs text-gray-400",children:t.sublabel})]},t.value))})}),document.body)]})}function ln({value:e,onChange:n,options:a=[],placeholder:l,allowFreeText:i=!1,invalid:o,disabled:c,id:d,className:u=""}){const[h,m]=oe(!1),[p,g]=oe(""),f=V(),b=se(null),x=se(null),y=se(null),v=t(b,h),w=e=>a.find(t=>t.value===e)?.label??e,k=de(()=>{const t=new Set(e),r=[],n=p.trim().toLowerCase();for(const e of a)t.has(e.value)||(t.add(e.value),n&&!e.label.toLowerCase().includes(n)||r.push(e));return r},[a,e,p]),N=t=>{t&&!e.includes(t)?(n([...e,t]),g("")):g("")},M=t=>n(e.filter(e=>e!==t)),$=()=>{const e=p.trim();i&&e?N(e):g("")},C=se(()=>{});C.current=()=>{$(),m(!1)},ue(()=>{if(!h)return;const e=e=>{const t=e.target;b.current?.contains(t)||y.current?.contains(t)||($(),m(!1))};document.addEventListener("mousedown",e);const t=_(()=>C.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=a.length>0;/* @__PURE__ */
187
- return ke("div",{ref:b,className:"relative",children:[
188
- /* @__PURE__ */ke("div",{onMouseDown:e=>{c||e.target.closest("button")||(e.preventDefault(),x.current?.focus())},className:Pe({invalid:o,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)] ${c?"bg-gray-50 cursor-not-allowed":""} ${u}`}),children:[e.map(e=>/* @__PURE__ */ke("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:[
189
- /* @__PURE__ */we("span",{className:"truncate",children:w(e)}),!c&&/* @__PURE__ */we("button",{type:"button","aria-label":f.select.removeItem?.(w(e))??`${f.select.remove} ${w(e)}`,onClick:()=>M(e),className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none",children:"×"})]},e)),
190
- /* @__PURE__ */we("input",{id:d,ref:x,type:"text",autoComplete:"off",role:"combobox","aria-expanded":h&&L,"aria-invalid":o||void 0,disabled:c,value:p,placeholder:0===e.length?l:void 0,onChange:e=>{g(e.target.value),m(!0)},onFocus:()=>{!c&&L&&m(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&i){t.preventDefault();const e=p.trim(),r=e?k.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):[];1===r.length?N(r[0].value):$()}else"Backspace"===t.key&&""===p&&e.length>0?M(e[e.length-1]):"Escape"===t.key?(m(!1),g(""),x.current?.blur()):"Tab"===t.key&&($(),m(!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"})]}),h&&L&&Me(
191
- /* @__PURE__ */we("div",{ref:y,className:"fixed rounded-2xl overflow-hidden",style:{zIndex:q.popup,left:v?.left,right:v?.right,top:v?.top,bottom:v?.bottom,minWidth:v?.minWidth,maxWidth:v?.maxWidth??s,width:"max-content",visibility:v?void 0:"hidden",...F()},children:/* @__PURE__ */we("div",{className:"overflow-y-auto",style:{maxHeight:v?.maxHeight??r},children:0===k.length?/* @__PURE__ */we("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:a.length>0&&e.length>=a.length?f.select.allSelected:f.select.noMatches}):k.map(e=>/* @__PURE__ */we("button",{type:"button",onMouseDown:t=>{t.preventDefault(),N(e.value)},className:"w-full text-left px-3 py-1.5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.label},e.value))})}),document.body)]})}var on={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 sn({children:e,header:t,footer:r,padded:n=!0,padding:a,headingLevel:l,headerActions:i,"aria-label":o,className:s="",bodyClassName:c="",style:d}){const u=on[a??(n?"md":"none")],h=ce(),m=null!=l&&null!=t,p=`h${l}`,g=m||null!=o&&""!==o,f=g?"section":"div",b=`rounded-lg border border-gray-200 bg-white shadow-sm ${s}`.trim(),x=`border-b border-gray-100 ${u.edge} text-sm font-semibold text-gray-900`;/* @__PURE__ */
192
- return ke(f,{className:b,style:d,...m?{"aria-labelledby":h}:g?{"aria-label":o}:{},children:[null!=t&&(null!=i?
193
- /* @__PURE__ */ke("div",{className:`${x} flex items-center justify-between gap-3`,children:[m?/* @__PURE__ */we(p,{id:h,children:t}):/* @__PURE__ */we("span",{children:t}),i]}):m?
194
- /* @__PURE__ */we(p,{id:h,className:x,children:t}):/* @__PURE__ */we("div",{className:x,children:t})),
195
- /* @__PURE__ */we("div",{className:[u.body,c].filter(Boolean).join(" "),children:e}),r&&/* @__PURE__ */we("div",{className:`border-t border-gray-100 ${u.edge}`,children:r})]})}function cn({label:e,value:t,icon:r,delta:n,className:a=""}){const l=U(),i="number"==typeof t&&l?Z(t,l):t,o="up"===n?.direction?"text-green-600":"down"===n?.direction?"text-red-600":"text-gray-500",s="up"===n?.direction?"▲":"down"===n?.direction?"▼":"→";/* @__PURE__ */
196
- return ke("div",{className:`rounded-lg border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
197
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between",children:[
198
- /* @__PURE__ */we("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),r&&/* @__PURE__ */we("span",{className:"text-gray-400",children:r})]}),
199
- /* @__PURE__ */ke("div",{className:"mt-2 flex items-baseline gap-2",children:[
200
- /* @__PURE__ */we("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */ke("span",{className:`text-xs font-medium ${o}`,children:[s," ",n.value]})]})]})}var dn={default:"text-gray-900",secondary:"text-gray-500",tertiary:"text-gray-400",disabled:"text-gray-300",danger:"text-red-600",success:"text-green-600",warning:"text-amber-600",link:"text-blue-600",inherit:""},un={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},hn={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function mn({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...o}){/* @__PURE__ */
201
- return we(l,{className:[dn[t],un[r],hn[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var pn={1:"text-2xl font-semibold",2:"text-xl font-semibold",3:"text-lg font-semibold",4:"text-base font-semibold",5:"text-sm font-semibold"};function gn({children:e,level:t=2,tone:r="default",className:n=""}){/* @__PURE__ */
202
- return we(`h${t}`,{className:[pn[t],dn[r],n].filter(Boolean).join(" "),children:e})}function fn({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
203
- return we("p",{className:[dn[t],un[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var bn={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},xn={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},yn={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function vn({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
204
- return we("div",{className:["flex flex-col",bn[t],r?xn[r]:"",n?yn[n]:"",a].filter(Boolean).join(" "),children:e})}function wn({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
205
- return we("div",{className:["flex",a?"flex-wrap":"",bn[t],xn[r],n?yn[n]:"",l].filter(Boolean).join(" "),children:e})}var kn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},Nn={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"},Mn={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 $n({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
206
- return we("div",{className:["grid",kn[t],r?Nn[r]:"",n?Mn[n]:"",bn[a],l].filter(Boolean).join(" "),children:e})}var Cn={sm:"my-2",md:"my-4",lg:"my-6"};function Ln({orientation:e="horizontal",children:t,align:r="center",spacing:n="md",className:a=""}){const l=ce();if("vertical"===e)/* @__PURE__ */
207
- return we("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__ */
208
- return we("hr",{className:`border-0 border-t border-gray-200 ${Cn[n]} ${a}`.trim()});const i="left"===r?"w-4 shrink-0":"flex-1",o="right"===r?"w-4 shrink-0":"flex-1";
209
- /* @__PURE__ */
210
- return ke("div",{role:"separator","aria-orientation":"horizontal","aria-labelledby":l,className:`flex items-center gap-3 ${Cn[n]} ${a}`.trim(),children:[
211
- /* @__PURE__ */we("span",{"aria-hidden":"true",className:`${i} border-t border-gray-200`}),
212
- /* @__PURE__ */we("span",{id:l,className:"shrink-0 text-xs font-medium text-gray-500",children:t}),
213
- /* @__PURE__ */we("span",{"aria-hidden":"true",className:`${o} border-t border-gray-200`})]})}var Dn={text:"rounded",rect:"rounded-md",circle:"rounded-full"},jn=e=>"number"==typeof e?`${e}px`:e;function An({variant:e="text",width:t,height:r,lines:n=1,className:a=""}){const l=`animate-pulse bg-gray-200 ${Dn[e]} ${a}`.trim();if("circle"===e){const e=jn(r??t)??"2.5rem";/* @__PURE__ */
214
- return we("span",{className:`inline-block ${l}`,style:{width:e,height:e},"aria-hidden":"true"})}const i={width:jn(t)??"100%",height:jn(r)??("text"===e?"1rem":"4rem")};/* @__PURE__ */
215
- return we("span","text"===e&&n>1?{className:"flex flex-col gap-2","aria-hidden":"true",children:Array.from({length:n},(e,t)=>/* @__PURE__ */we("span",{className:`block ${l}`,style:{...i,width:t===n-1?"60%":i.width}},t))}:{className:`block ${l}`,style:i,"aria-hidden":"true"})}var Pn={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3"},Sn={1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3"},zn={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3"},Fn={1:"col-span-1",2:"col-span-2",3:"col-span-3"};function Bn({items:e,columns:t=1,bordered:r=!1,size:n="md",title:a,className:l="",emptyText:i="—"}){const o="number"==typeof t?{base:t}:t,s=o.base??1,c=Math.max(s,o.sm??0,o.lg??0),d="sm"===n?"px-3 py-2":"px-4 py-3",u="sm"===n?"text-xs":"text-sm";/* @__PURE__ */
216
- return ke("div",{className:[r?"rounded-lg border border-gray-200 bg-white":"",l].filter(Boolean).join(" "),children:[a&&/* @__PURE__ */we("div",{className:`${d} ${r?"border-b border-gray-100":""} text-sm font-semibold text-gray-900`.trim(),children:a}),
217
- /* @__PURE__ */we("dl",{className:["grid",Pn[s],o.sm?Sn[o.sm]:"",o.lg?zn[o.lg]:"",r?"":"gap-x-6 gap-y-3",r?"":"px-4 py-3"===d?"py-1":""].filter(Boolean).join(" "),children:e.map((e,t)=>/* @__PURE__ */ke("div",{className:[e.span?Fn[c]:"",r?`${d} border-b border-gray-100 last:border-b-0`:""].filter(Boolean).join(" "),children:[
218
- /* @__PURE__ */we("dt",{className:`${u} text-gray-500`,children:e.label}),
219
- /* @__PURE__ */we("dd",{className:`mt-0.5 min-w-0 break-words ${u} text-gray-900`,children:null===e.value||void 0===e.value||""===e.value?i:e.value})]},e.key??t))})]})}function En({name:e,value:t,description:r,controlId:n,unknownText:a="—",quiet:l=!1,className:i=""}){const o=null==t||""===t,s=l?"text-gray-500":"text-gray-800",c=o?"text-gray-400":l?"text-gray-500":"text-gray-900";/* @__PURE__ */
220
- return ke("div",{className:i,children:[
221
- /* @__PURE__ */ke("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[n?/* @__PURE__ */we("label",{htmlFor:n,className:`min-w-0 text-sm font-medium ${s}`,children:e}):/* @__PURE__ */we("span",{className:`min-w-0 text-sm font-medium ${s}`,children:e}),
222
- /* @__PURE__ */we("span",{className:`shrink-0 text-sm ${c}`,children:o?a:t})]}),r&&/* @__PURE__ */we("p",{className:"mt-1 text-xs leading-relaxed text-gray-500",children:r})]})}var Tn={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function In({count:e=0,max:t=99,dot:r=!1,tone:n="danger",showZero:a=!1,children:l,className:i=""}){const o=r||e>0||0===e&&a,s=U(),c=e>t?`${Z(t,s)}+`:Z(e,s),d=l?"":i,u=o?/* @__PURE__ */we("span",r?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${Tn[n]} ${d}`.trim(),"aria-hidden":l?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${Tn[n]} ${d}`.trim(),children:c}):null;return l?/* @__PURE__ */ke("span",{className:`relative inline-flex ${i}`.trim(),children:[l,u&&/* @__PURE__ */we("span",{className:"absolute -right-1.5 -top-1.5 flex",children:u})]}):u}var On={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},Rn={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function Wn({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=U(),c="number"!=typeof t?t:null!=r?X(t,r,s):s?Z(t,s):t;/* @__PURE__ */
223
- return ke("div",{className:o,children:[e&&/* @__PURE__ */we("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
224
- /* @__PURE__ */ke("div",{className:`mt-1 flex items-baseline gap-1 ${Rn[l]}`,children:[n&&/* @__PURE__ */we("span",{className:"text-sm",children:n}),
225
- /* @__PURE__ */we("span",{className:`font-semibold tabular-nums ${On[i]}`,children:c}),a&&/* @__PURE__ */we("span",{className:"text-sm",children:a})]})]})}var Hn={xs:24,sm:32,md:40,lg:56},_n={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function qn(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function Kn({src:e,name:t,size:r="md",status:n,className:a=""}){const l=Hn[r],i=Math.max(8,Math.round(.28*l)),[o,s]=oe(!1);ue(()=>{s(!1)},[e]);const c=Boolean(e)&&!o;
226
- /* @__PURE__ */
227
- return ke("span",{className:`relative inline-flex shrink-0 ${a}`.trim(),style:{width:l,height:l},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[c?/* @__PURE__ */we("img",{src:e,alt:"",onError:()=>s(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */we("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*l)},children:qn(t)}),n&&/* @__PURE__ */we("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${_n[n]}`,style:{width:i,height:i}})]})}function Un({children:e,max:t,size:r="md",className:n=""}){const a=me.toArray(e),l=t?a.slice(0,t):a,i=t?a.length-l.length:0,o=Hn[r],s=Math.round(.3*o),c=U();/* @__PURE__ */
228
- return ke("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)=>/* @__PURE__ */we("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-s},children:e},t)),i>0&&/* @__PURE__ */ke("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:o,height:o,marginLeft:-s,fontSize:Math.round(.36*o)},children:["+",Z(i,c)]})]})}var Vn={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"}},Yn={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white"};function Gn({tone:e}){const t={className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0};switch(e){case"success":/* @__PURE__ */
229
- return we("svg",{...t,children:/* @__PURE__ */we("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z",clipRule:"evenodd"})});case"warning":/* @__PURE__ */
230
- return we("svg",{...t,children:/* @__PURE__ */we("path",{fillRule:"evenodd",d:"M8.3 2.8a2 2 0 013.4 0l6 10A2 2 0 0116 16H4a2 2 0 01-1.7-3.2l6-10zM10 7a1 1 0 00-1 1v3a1 1 0 102 0V8a1 1 0 00-1-1zm0 7a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})});case"danger":/* @__PURE__ */
231
- return we("svg",{...t,children:/* @__PURE__ */we("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 10-1.4-1.4L10 8.6 8.7 7.3z",clipRule:"evenodd"})});default:/* @__PURE__ */
232
- return we("svg",{...t,children:/* @__PURE__ */we("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z",clipRule:"evenodd"})})}}function Zn({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:o=!1,className:s=""}){const c=Vn[e],d="solid"===t,u=V().banner,h=d?Yn[e]:c.box,m=o?"sticky top-0 z-30":"",p=/* @__PURE__ */ke(Ne,{children:[r&&/* @__PURE__ */we("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */we("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
233
- return ke("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${s}`.trim(),children:[
234
- /* @__PURE__ */we("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */we(Gn,{tone:e})}),null==l?/* @__PURE__ */we("div",{className:"min-w-0 flex-1 text-sm",children:p}):
235
- /* @__PURE__ */ke("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
236
- /* @__PURE__ */we("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
237
- /* @__PURE__ */we("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */we("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__ */we("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M6 6l8 8M14 6l-8 8"})})})]})}var Xn=(e,t)=>`${e}-tab-${t}`,Jn=(e,t)=>`${e}-panel-${t}`,Qn={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 ea(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 ta({items:e,value:t,onChange:r,variant:n="underline",idPrefix:a,className:l="","aria-label":i,"aria-labelledby":o}){const s=se([]),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__ */
238
- return we("div",{role:"tablist","aria-label":i,"aria-labelledby":o,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),s.current[l]?.focus())},className:`${Qn[n]} ${l}`.trim(),children:e.map((e,l)=>{const i=e.id===t;/* @__PURE__ */
239
- return ke("button",{ref:e=>{s.current[l]=e},type:"button",role:"tab",id:a?Xn(a,e.id):void 0,"aria-controls":a?Jn(a,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:ea(n,i),children:[e.icon&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e.icon}),e.label]},e.id)})})}var ra=()=>/* @__PURE__ */we("svg",{viewBox:"0 0 12 12",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M2.5 6.5L5 9l4.5-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})});function na({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
240
- return we("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,o=/* @__PURE__ */we("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__ */we(ra,{}):n+1}),s=/* @__PURE__ */ke("span",{className:"min-w-0 text-center",children:[
241
- /* @__PURE__ */we("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */we("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
242
- return ke("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */we("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__ */ke("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:[o,s]}):/* @__PURE__ */ke("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-1.5 px-2 text-center",children:[o,s]})]},t.id)})})}function aa({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,o]=oe(t),s=r??i;/* @__PURE__ */
243
- return we("div",{className:`divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${l}`.trim(),children:e.map(e=>{const t=s.includes(e.id);/* @__PURE__ */
244
- return ke("div",{children:[
245
- /* @__PURE__ */ke("button",{type:"button",disabled:e.disabled,"aria-expanded":t,onClick:()=>(e=>{const t=s.includes(e)?s.filter(t=>t!==e):a?[...s,e]:[e];void 0===r&&o(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:[
246
- /* @__PURE__ */we("span",{children:e.title}),
247
- /* @__PURE__ */we("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__ */we("path",{d:"M6 8l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&/* @__PURE__ */we("div",{className:"px-4 pb-3 text-sm text-gray-600",children:e.content})]},e.id)})})}var la={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},ia={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function oa(e,t="subtle"){return"solid"===t?ia[e]:la[e]}var sa=he({});function ca({groups:e,children:t}){/* @__PURE__ */
248
- return we(sa.Provider,{value:e,children:t})}function da({status:e,label:t,emphasis:r="subtle"}){const n=oa(fe(sa)[e]??"neutral",r),a=t??e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());/* @__PURE__ */
249
- return we("span",{className:`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${n}`,children:a})}function ua({colorClass:e,tone:t,children:r,size:n="sm",capitalize:a=!1,closable:l=!1,onClose:i,closeLabel:o,className:s=""}){const c=e??la[t??"neutral"],d="xs"===n?"px-2 py-0.5 text-[10px]":"md"===n?"px-2.5 py-0.5 text-xs":"px-2 py-0.5 text-xs",u=a?"capitalize":"",h=V().badge,m=o??("string"==typeof r?h.removeItem(r):h.remove),p="xs"===n?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
250
- return ke("span",{className:["inline-flex items-center rounded-full font-medium",d,u,c,s].filter(Boolean).join(" "),children:[r,l&&/* @__PURE__ */we("button",{type:"button",onClick:i,"aria-label":m,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */we("svg",{className:p,viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})})]})}function ha({title:e,message:t,description:r,hint:n,variant:a,frameless:l,icon:i,children:o}){const s=l?"none":a??"dashed",c="boolean"!=typeof i&&null!=i?i:null,d=!c&&(i??"card"!==s),u=V().emptyState,h=t??(e?void 0:u.message),m=r??n;/* @__PURE__ */
251
- return ke("div",{className:`flex flex-col items-center justify-center text-center ${"card"===s?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===s?"px-6 py-12":"rounded-lg border-2 border-dashed border-gray-300 px-6 py-12"}`,children:[c&&/* @__PURE__ */we("div",{className:"mb-3 flex h-10 w-10 items-center justify-center text-gray-300","aria-hidden":"true",children:c}),d&&/* @__PURE__ */we("svg",{className:"h-10 w-10 text-gray-300 mb-3","aria-hidden":"true",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e&&/* @__PURE__ */we("h3",{className:"text-sm font-medium text-gray-900",children:e}),h&&/* @__PURE__ */we("p",{className:"text-sm text-gray-500 "+(e?"mt-2":""),children:h}),m&&/* @__PURE__ */we("p",{className:"text-xs text-gray-400 mt-1",children:m}),o&&/* @__PURE__ */we("div",{className:"mt-4",children:o})]})}function ma({title:t,description:r,subtitle:n,actions:a,children:l,icon:i,breadcrumbs:o}){const s=r??n,c=a??l;/* @__PURE__ */
252
- return ke("div",{className:"mb-6",children:[o&&o.length>0&&/* @__PURE__ */we(e,{items:o,className:"mb-3"}),
253
- /* @__PURE__ */ke("div",{className:"flex items-start justify-between gap-4",children:[
254
- /* @__PURE__ */ke("div",{children:[
255
- /* @__PURE__ */ke("h1",{className:"flex items-center gap-2 text-xl font-semibold text-gray-900",children:[i&&/* @__PURE__ */we("span",{className:"shrink-0 text-gray-400",children:i}),t]}),s&&/* @__PURE__ */we("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),c&&/* @__PURE__ */we("div",{className:"flex items-center gap-2",children:c})]})]})}var pa=["success","warning","danger"];function ga(e){return"string"==typeof e&&pa.includes(e)}function fa(e,t,r){if(null==e||!Number.isFinite(e))return null;const n=ba(t),a=ba(r);return null==n&&null==a?null:null!=a&&e>=a?"danger":null!=n&&e>=n?"warning":"success"}function ba(e){return null!=e&&Number.isFinite(e)?e:null}var xa={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 ya=/* @__PURE__ */new Set;function va(e,t){if(null==e)return null;if(ga(e))return xa[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}`;ya.has(r)||(ya.add(r),console.error(`[efficient-shell] ${e}: severity ${t} is not one of ${pa.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 wa({at:e,title:t,className:r}){/* @__PURE__ */
256
- return we("div",{title:t,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${r}`,style:{left:`${e}%`}})}var ka=e=>Math.min(100,Math.max(0,e));function Na({label:e,value:t,max:r=100,warn:n,crit:a,severity:l,detail:i,formatValue:o,emptyLabel:s,size:c="sm",ariaLabel:d,className:u=""}){const h=V().meter,m=U(),p=s??h.noData,g=null!=t&&Number.isFinite(t)?t:null,f=Number.isFinite(r)&&r>0?r:null;var b,x;null==f&&(b=`MetricBar:max:${String(r)}`,x=`[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.`,ya.has(b)||(ya.add(b),console.error(x)));const y=va(l,"MetricBar"),v=null!=g?y??(null==(w=fa(g,n,a))?null:xa[w]):null;var w;const k=ba(n),N=ba(a),M=null!=g&&null!=f?ka(g/f*100):0,$=null!=g?(o??(e=>100===f?J(e,1,m):Z(e,m)))(g):"—",C=null!=g&&null!=f&&(null!=k||null!=N),L="md"===c?"h-2":"h-1.5",D=null!=g&&null!=f,j=/* @__PURE__ */ke("div",{...D?{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:D&&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:[D&&
257
- /* @__PURE__ */we("div",{className:`absolute inset-y-0 left-0 rounded-full ${v?v.fill:"bg-gray-400"}`,style:{width:`${M}%`}}),C&&null!=f&&null!=k&&/* @__PURE__ */we(wa,{at:ka(k/f*100),title:h.warningAt(k),className:"bg-gray-400 opacity-75"}),C&&null!=f&&null!=N&&/* @__PURE__ */we(wa,{at:ka(N/f*100),title:h.criticalAt(N),className:"bg-gray-500"})]}),A=v?v.ink:null!=g?"text-gray-900":"text-gray-400";/* @__PURE__ */
258
- return ke("div","md"===c?{className:u,children:[null!=e&&/* @__PURE__ */we("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
259
- /* @__PURE__ */ke("div",{className:"mt-1 flex items-baseline gap-2",children:[
260
- /* @__PURE__ */we("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${A}`,children:$}),
261
- /* @__PURE__ */we("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:null!=g?i:p})]}),j]}:{className:u,children:[
262
- /* @__PURE__ */ke("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */we("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
263
- /* @__PURE__ */we("span",{className:`text-sm font-semibold tabular-nums ${A}`,children:$}),
264
- /* @__PURE__ */we("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:null!=g?i:p})]}),j]})}function Ma(e){return null!=e&&Number.isFinite(e)&&e>=0?e:null}function $a(e,t){const r=Ma(e);if(null==r)return"no-reading";const n=Ma(t);return null==n||0===n?"no-budget":r>n?"over":"within"}var Ca=e=>Math.min(100,Math.max(0,e));function La({label:e,elapsed:t,budget:r,grace:n,detail:a,formatDuration:l,emptyLabel:i,noBudgetLabel:o,size:s="sm",ariaLabel:c,className:d=""}){const u=V().meter,h=U(),m=l??(e=>function(e,t=Y.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=o??u.noBudget,f=Ma(t),b=Ma(r),x=null!=b&&b>0?b:null,y=Ma(n)??0,v="over"===$a(t,r),w=null!=x?x+y:null,k=null!=x&&null!=w?Ca(x/w*100):null,N=v&&y>0,M=null==w||null==f?0:v?N?k??0:0:Ca(f/w*100),$=N?k??0:0,C=v?N&&null!=w&&null!=f?Ca(f/w*100):100:0,L=Math.max(0,C-$),D=null!=f&&null!=x?f/x*100:null,j=null!=D?J(Math.round(D),0,h):null!=f?m(f):"—",A=a??(null==f?p:null==x?g:`${m(f)} / ${m(x)}`),P="md"===s?"h-2":"h-1.5",S=v?"text-red-600":null!=f?"text-gray-900":"text-gray-400",z=null!=f&&null!=x&&null!=w?/* @__PURE__ */ke("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(j),className:`relative mt-2 ${P} overflow-hidden rounded-full bg-gray-200`,children:[(!v||N)&&/* @__PURE__ */we("div",{className:"absolute inset-y-0 left-0 rounded-full bg-blue-600",style:{width:`${M}%`}}),L>0&&/* @__PURE__ */we("div",{className:"rosh-budget-overrun absolute inset-y-0",style:{left:`${$}%`,width:`${L}%`}}),y>0&&null!=k&&/* @__PURE__ */we("div",{title:u.budget,className:"absolute inset-y-0 w-0.5 bg-gray-700",style:{left:`${k}%`}})]}):null;/* @__PURE__ */
265
- return ke("div","md"===s?{className:d,children:[null!=e&&/* @__PURE__ */we("div",{className:"text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
266
- /* @__PURE__ */ke("div",{className:"mt-1 flex items-baseline gap-2",children:[
267
- /* @__PURE__ */we("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${S}`,children:j}),
268
- /* @__PURE__ */we("span",{className:"min-w-0 truncate text-[11px] tabular-nums text-gray-400",children:A})]}),z]}:{className:d,children:[
269
- /* @__PURE__ */ke("div",{className:"flex items-baseline gap-2",children:[null!=e&&/* @__PURE__ */we("span",{className:"w-14 shrink-0 truncate text-[10px] font-medium uppercase tracking-wide text-gray-500",children:e}),
270
- /* @__PURE__ */we("span",{className:`text-sm font-semibold tabular-nums ${S}`,children:j}),
271
- /* @__PURE__ */we("span",{className:"ml-auto min-w-0 truncate text-[10px] tabular-nums text-gray-400",children:A})]}),z]})}var Da=864e5;function ja(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 Aa(e,t){return w(new Date(e).toISOString().slice(0,10),{locale:t})}var Pa=(e,t)=>`${e}-fill-${t}`,Sa=e=>`${e}-glow`,za=e=>`${e}-reveal`,Fa=e=>`${e}-ground`;function Ba(e,t,r,n){return"solid"===r?n:`url(#${Pa(e,t)})`}function Ea(e){return"solid"===e?void 0:"4 3"}function Ta({id:e,index:t,colour:r,variant:n,from:a,to:l}){const i=Pa(e,t);if("solid"===n)return null;if("gradient"===n||"gradient-reverse"===n){const e="gradient-reverse"===n;/* @__PURE__ */
272
- return ke("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
273
- /* @__PURE__ */we("stop",{offset:"0%",stopColor:r,stopOpacity:e?l:a}),
274
- /* @__PURE__ */we("stop",{offset:"100%",stopColor:r,stopOpacity:e?a:l})]})}const o=/* @__PURE__ */we("rect",{width:"100%",height:"100%",fill:r,fillOpacity:.45*a});return"duotone"===n?/* @__PURE__ */ke("linearGradient",{id:i,x1:"0",y1:"0",x2:"0",y2:"1",children:[
275
- /* @__PURE__ */we("stop",{offset:"0%",stopColor:r,stopOpacity:a}),
276
- /* @__PURE__ */we("stop",{offset:"45%",stopColor:r,stopOpacity:a}),
277
- /* @__PURE__ */we("stop",{offset:"45%",stopColor:r,stopOpacity:.35*a}),
278
- /* @__PURE__ */we("stop",{offset:"100%",stopColor:r,stopOpacity:.35*a})]}):/* @__PURE__ */ke("pattern","striped"===n?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",patternTransform:"rotate(-45)",children:[o,
279
- /* @__PURE__ */we("rect",{width:"5",height:"10",fill:r,fillOpacity:.7})]}:"blocks"===n?{id:i,width:"10",height:"10",patternUnits:"userSpaceOnUse",children:[o,
280
- /* @__PURE__ */we("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8}),
281
- /* @__PURE__ */we("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1",fill:r,fillOpacity:.8})]}:"dotted"===n?{id:i,width:"8",height:"8",patternUnits:"userSpaceOnUse",children:[o,
282
- /* @__PURE__ */we("circle",{cx:"2",cy:"2",r:"1.2",fill:r,fillOpacity:.85})]}:"lines"===n?{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[o,
283
- /* @__PURE__ */we("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"1.5",strokeOpacity:.8})]}:{id:i,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:[o,
284
- /* @__PURE__ */we("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:r,strokeWidth:"2",strokeOpacity:.75})]})}function Ia({id:e,direction:t}){const r="center-out"===t?"rosh-viz-wipe-center":"right-to-left"===t?"rosh-viz-wipe-rtl":"rosh-viz-wipe";/* @__PURE__ */
285
- return we("mask",{id:za(e),maskUnits:"objectBoundingBox",maskContentUnits:"objectBoundingBox",children:/* @__PURE__ */we("rect",{x:"0",y:"0",width:"1",height:"1",fill:"white",className:r})})}function Oa({id:e,fills:t=[],fadeFrom:r=.3,fadeTo:n=0,glow:a=!1,reveal:l=!1,background:i="none"}){/* @__PURE__ */
286
- return ke("defs",{children:[t.map((t,a)=>/* @__PURE__ */we(Ta,{id:e,index:a,colour:t.color,variant:t.variant??"gradient",from:r,to:n},a)),l&&/* @__PURE__ */we(Ia,{id:e,direction:l}),a&&/* @__PURE__ */ke("filter",{id:Sa(e),x:"-40%",y:"-40%",width:"180%",height:"180%",children:[
287
- /* @__PURE__ */we("feGaussianBlur",{stdDeviation:"3.5",result:"blur"}),
288
- /* @__PURE__ */ke("feMerge",{children:[
289
- /* @__PURE__ */we("feMergeNode",{in:"blur"}),
290
- /* @__PURE__ */we("feMergeNode",{in:"SourceGraphic"})]})]}),"none"!==i&&/* @__PURE__ */we(Ra,{id:Fa(e),variant:i})]})}function Ra({id:e,variant:t}){/* @__PURE__ */
291
- return we("pattern","dots"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */we("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor"})}:"grid"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */we("path",{d:"M 20 0 L 0 0 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"cross-hatch"===t?{id:e,width:"20",height:"20",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */we("path",{d:"M 0 0 L 20 20 M 20 0 L 0 20",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})}:"plus"===t?{id:e,width:"16",height:"16",patternUnits:"userSpaceOnUse",children:/* @__PURE__ */we("path",{d:"M 8 4 L 8 12 M 4 8 L 12 8",fill:"none",stroke:"currentColor",strokeWidth:"0.5",strokeLinecap:"round"})}:{id:e,width:"6",height:"6",patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:/* @__PURE__ */we("line",{x1:"0",y1:"0",x2:"0",y2:"6",stroke:"currentColor",strokeWidth:"0.5"})})}var Wa={rise:"rosh-viz-rise",grow:"rosh-viz-grow",sweep:"rosh-viz-sweep",march:"rosh-viz-march",fade:"rosh-viz-fade"},Ha=(e,t=60)=>({animationDelay:e*t+"ms"}),_a={receipt:/* @__PURE__ */ke(Ne,{children:[
292
- /* @__PURE__ */we("path",{d:"M3.4 1.9h5.2v7.2l-1.3-.9-1.3.9-1.3-.9-1.3.9z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
293
- /* @__PURE__ */we("path",{d:"M4.9 4.4h2.2M4.9 6.1h2.2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),check:/* @__PURE__ */we("path",{d:"M2.6 6.3 4.9 8.6 9.4 3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round"}),doc:/* @__PURE__ */ke(Ne,{children:[
294
- /* @__PURE__ */we("path",{d:"M3.5 1.9h3.4l2 2v6.2H3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
295
- /* @__PURE__ */we("path",{d:"M5.1 6.5h2.8M5.1 8.2h2",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]}),flask:/* @__PURE__ */we("path",{d:"M4.6 1.8h2.8M5.4 1.8v3.1L3.3 9.3a.9.9 0 0 0 .8 1.3h3.8a.9.9 0 0 0 .8-1.3L6.6 4.9V1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),truck:/* @__PURE__ */ke(Ne,{children:[
296
- /* @__PURE__ */we("path",{d:"M1.8 2.9h4.9v4.4H1.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
297
- /* @__PURE__ */we("path",{d:"M6.7 4.4h1.6l1.5 1.7v1.2H6.7z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),
298
- /* @__PURE__ */we("circle",{cx:"3.5",cy:"8.7",r:"1",fill:"currentColor"}),
299
- /* @__PURE__ */we("circle",{cx:"8.4",cy:"8.7",r:"1",fill:"currentColor"})]}),flag:/* @__PURE__ */ke(Ne,{children:[
300
- /* @__PURE__ */we("path",{d:"M3.8 1.7v8.6",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"}),
301
- /* @__PURE__ */we("path",{d:"M3.8 2.5h4.8L7.5 4.4l1.1 1.9H3.8z",fill:"currentColor"})]})};function qa({name:e}){/* @__PURE__ */
302
- return we("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:_a[e]})}function Ka(){/* @__PURE__ */
303
- return ke("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
304
- /* @__PURE__ */we("path",{d:"M4.2 2.2v11.6"}),
305
- /* @__PURE__ */we("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function Ua(){/* @__PURE__ */
306
- return we("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */we("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Va=1e-6;function Ya(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,o=Math.min(r.breakPx??48,n),s=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*o);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]?o:0===g?0:p>0?m*e/p:m/g),b=function(e,t,r){const n=e.slice();let a=0;for(let e=0;e<n.length;e++)t[e]||n[e]>=r-Va||(a+=r-n[e],n[e]=r);if(a<=Va)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Va&&(l+=n[e]-r);if(l<=Va)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Va||(n[e]-=i*(n[e]-r)/l);return n}(f,u,s),x=b.reduce((e,t,r)=>u[r]?e:e+t,0),y=b.map((e,t)=>u[t]?e:x>0?e*m/x: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 Ga(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var Za="mixed";function Xa(e,t){return 5.6*Math.max(e.length,t.length)+8}var Ja=(e,t,r)=>Math.min(Math.max(e,t),r),Qa=e=>-(Math.cos(Math.PI*e)-1)/2;function el(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)*Qa(t);return{px:r,ms:e.msByPx(r)}}var tl={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 rl(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var nl=e=>5.6*e.length,al={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:{}},ll={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function il(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:al[t].glyph??(r?"flag":void 0)}function ol(e,t,r=!1){const n=al[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 sl(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var cl="undefined"==typeof document?ue:ve;function dl(e,t){const[r,n]=oe(0);return cl(()=>{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 ul(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]),o=i-l,s=[];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;s.push(Math.max(28,t,a[e+1]-a[e]))}const c=s.reduce((e,t)=>e+t,0),d=Math.min(Math.max(c,o),.8*r);if(d<=o+.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,b=g+d,x=s.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?b+(e-i)*(r-b)/h:b;let t=f;for(let r=0;r+1<a.length;r++){if(e>a[r+1]){t+=x[r];continue}const n=a[r+1]-a[r];return t+(n>0?(e-a[r])/n*x[r]:0)}return b};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>=b)return r-b>0?i+(e-b)*h/(r-b):i;let t=f;for(let r=0;r+1<a.length;r++){if(!(e>t+x[r]))return a[r]+(x[r]>0?(e-t)/x[r]*(a[r+1]-a[r]):0);t+=x[r]}return i})(t)),inCut:e.inCut}}function hl(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 ml({marks:e,innerRef:t}){/* @__PURE__ */
307
- return we("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */ke("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
308
- /* @__PURE__ */we("span",{className:"rosh-tl-name",children:e.label}),
309
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function pl({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=V().timeline,i=y(U()),o=n.ruler,s=[],c=[],d=r.gaps.filter(e=>e.compressed),u=new Date(e);u.setUTCDate(u.getUTCDate()+(8-u.getUTCDay())%7);for(let e=u.getTime();e<t;e+=7*Da){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*Da)-t<14||s.push(
310
- /* @__PURE__ */we("i",{className:"rosh-tl-tick is-week",style:{left:`${t}px`,top:`${o}px`,height:"3px"}},`wk-${e}`))}const h=d.map(e=>{const t=(e.fromPx+e.toPx)/2,r=nl(l.days(Math.round(e.gapMs/Da)))/2+6;return[t-r,t+r]}),m=(e,t)=>h.some(([r,n])=>e<n&&t>r);s.push(
311
- /* @__PURE__ */we("i",{"data-timeline-part":"start-tick",className:"rosh-tl-tick",style:{left:"0px",top:`${o}px`,height:"6px"}},"start"));const p=new Date(e);p.setUTCDate(1);let g=-1/0,f=!0;for(;p.getTime()<t;){const t=p.getTime();if(!(t<=e)&&!r.inCut(t)){const e=r.xByMs(t);if(s.push(
312
- /* @__PURE__ */we("i",{className:"rosh-tl-tick",style:{left:`${e}px`,top:`${o}px`,height:"6px"}},`mo-${t}`)),e-g>=72||f){const r=f||0===p.getUTCMonth()?i.shortMonthYear(p.getUTCFullYear(),p.getUTCMonth()):i.monthsShort[p.getUTCMonth()];m(e,e+nl(r))||(c.push(
313
- /* @__PURE__ */we("span",{className:"rosh-tl-month"+(a?" rosh-tl-fade":""),style:{left:`${e}px`,top:`${o+9}px`,...a?{animationDelay:"420ms"}:{}},children:r},`mon-${t}`)),g=e,f=!1)}}p.setUTCMonth(p.getUTCMonth()+1)}/* @__PURE__ */
314
- return ke("div",{"aria-hidden":"true","data-timeline-part":"ruler",children:[s,c,d.map(e=>{const t=Math.max(1,Math.round(e.gapMs/Da));/* @__PURE__ */
315
- return ke("span",{"data-timeline-part":"break",className:"rosh-tl-rulercut"+(a?" rosh-tl-fade":""),style:{left:(e.fromPx+e.toPx)/2+"px",top:`${o}px`,...a?{animationDelay:"420ms"}:{}},children:[
316
- /* @__PURE__ */ke("span",{className:"rosh-tl-cutglyph",children:[
317
- /* @__PURE__ */we("i",{}),
318
- /* @__PURE__ */we("i",{})]}),
319
- /* @__PURE__ */we("span",{children:l.days(t)})]},`cut-${e.fromMs}`)})]})}function gl({pending:e,reveal:t}){const r=V().timeline,[n,a]=oe(!1),l=n?e:e.slice(0,2),i=e.length-l.length;/* @__PURE__ */
320
- return ke("div",{className:"rosh-tl-pending","data-timeline-part":"pending",children:[
321
- /* @__PURE__ */we("p",{className:"rosh-tl-pending-head",children:r.notReached}),
322
- /* @__PURE__ */we("ol",{className:"rosh-tl-ghosts","aria-label":r.notReached,children:l.map((e,n)=>/* @__PURE__ */ke("li",{className:t?"rosh-tl-fade":void 0,style:t?{animationDelay:440+60*n+"ms"}:void 0,children:[
323
- /* @__PURE__ */we("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&al[e.kind].diamond?" is-diamond":"")}),
324
- /* @__PURE__ */ke("span",{children:[0===n&&/* @__PURE__ */we("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */we("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function fl({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=V().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/Da):0;/* @__PURE__ */
325
- return ke("div",{"data-timeline-part":"vertical",children:[
326
- /* @__PURE__ */we("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=ol(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
327
- return ke("li",{className:a?"rosh-tl-fade":void 0,style:a?Ha(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
328
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&a?" rosh-tl-drawy":""}`}),
329
- /* @__PURE__ */ke("button",{...o(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?Ha(t,i):{}},children:[s&&/* @__PURE__ */we(qa,{name:s}),"current"===e.role&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
330
- /* @__PURE__ */ke("span",{className:"rosh-tl-vrow","aria-hidden":"true",children:[
331
- /* @__PURE__ */we("span",{className:"rosh-tl-name",children:e.label}),
332
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:e.dateText})]})]},e.key)})}),u>0&&/* @__PURE__ */ke("p",{className:"rosh-tl-vgap","aria-hidden":"true",children:[
333
- /* @__PURE__ */we("i",{className:"rosh-tl-vline is-dash"}),
334
- /* @__PURE__ */we("span",{children:c.daysToToday(u)})]}),t.length>0&&/* @__PURE__ */we(gl,{pending:t,reveal:a})]})}function bl({axis:e,geo:t,fillTo:r,reveal:n,trackPx:a,tweened:l=!1}){/* @__PURE__ */
335
- return ke("div",{"aria-hidden":"true",children:[
336
- /* @__PURE__ */we("div",{className:"rosh-tl-rail bg-gray-200",style:{top:`${t.rail}px`,height:"6px",width:`${a}px`}}),null!==r&&/* @__PURE__ */we("div",{"data-timeline-part":"fill",className:`rosh-tl-fill bg-blue-600${l?" is-tweened":""}${n?" rosh-tl-draw":""}`,style:{top:`${t.rail}px`,height:"6px",width:`${Math.max(0,Math.min(e.xByMs(r),a))}px`}}),e.gaps.filter(e=>e.compressed).map(e=>/* @__PURE__ */ke("div",{className:"rosh-tl-cut",style:{left:(e.fromPx+e.toPx)/2+"px",top:`${t.rail}px`,height:"6px"},children:[
337
- /* @__PURE__ */we("i",{}),
338
- /* @__PURE__ */we("i",{})]},`railcut-${e.fromMs}`))]})}function xl({geo:e,caption:t,endCaption:r,around:n,reveal:a,trackPx:l}){const i=e.rail-13-4,o=a?" rosh-tl-fade":"",s=a?{animationDelay:"420ms"}:{};/* @__PURE__ */
339
- return ke("div",{"aria-hidden":"true","data-timeline-part":"start",children:[
340
- /* @__PURE__ */we("i",{className:`rosh-tl-start${n?" is-around":""}${o}`,style:{left:"0px",top:`${e.rail+3}px`,...s}}),null!=t&&!1!==t&&/* @__PURE__ */we("span",{className:`rosh-tl-edge${o}`,"data-timeline-part":"start-caption",style:{left:"0px",top:`${i}px`,...s},children:t}),null!=r&&!1!==r&&/* @__PURE__ */we("span",{className:`rosh-tl-edge is-end${o}`,"data-timeline-part":"end-caption",style:{left:`${l}px`,top:`${i}px`,...s},children:r})]})}function yl({x:e,geo:t,trackPx:r,label:n,reveal:a}){const l=V().timeline;/* @__PURE__ */
341
- return ke("div",{"aria-hidden":"true","data-timeline-part":"today",children:[
342
- /* @__PURE__ */we("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"}:{}}}),
343
- /* @__PURE__ */we("span",{className:"rosh-tl-todaytag"+(a?" rosh-tl-fade":""),title:l.todayTitle(n),style:{left:`${Ga(e,48,r)}px`,top:`${t.tag}px`,...a?{animationDelay:"420ms"}:{}},children:l.today})]})}function vl({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=nl(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__ */we("div",{"aria-hidden":"true","data-timeline-part":"captions",children:a.map(e=>/* @__PURE__ */we("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 wl({phase:e,geo:t,xOf:r}){const n=r(e.minMs),a=Math.max(r(e.maxMs)-n,4);/* @__PURE__ */
344
- return ke("div",{"aria-hidden":"true","data-timeline-part":"phase",children:[
345
- /* @__PURE__ */we("div",{className:"rosh-tl-phase border-gray-300",style:{left:`${n}px`,width:`${a}px`,top:t.laneB+t.laneH-4+"px"}}),
346
- /* @__PURE__ */ke("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 kl({nodes:e,trackPx:t,geo:r,activeKey:n,hoveredKey:a,currentKey:l}){const i=V().timeline,o=(e,t)=>null!==t&&(e.key===t||e.members.some(e=>e.key===t)),s=e.find(e=>e.key===a)??e.find(e=>o(e,n))??null;if(!s)return null;const c=s.mark,d=c?c.label:`×${s.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}`}(s.members),h=c?c.widthPx:Xa(d,u),m=c?.onOpen;/* @__PURE__ */
347
- return ke("div",{"data-timeline-part":"label",className:`rosh-tl-label${s.key===a?" is-hot":""}${o(s,l)?" is-current":""}`,style:{left:`${Ga(s.x,h,t)}px`,top:`${r.laneB}px`,width:`${h}px`,height:`${r.laneH}px`},children:[m?/* @__PURE__ */we("button",{type:"button",className:"rosh-tl-name rosh-tl-open","data-timeline-part":"open","aria-label":i.open(d),onClick:m,children:d}):/* @__PURE__ */we("span",{className:"rosh-tl-name","aria-hidden":"true",children:d}),
348
- /* @__PURE__ */we("span",{className:"rosh-tl-date","aria-hidden":"true",children:u})]})}function Nl({groups:e,trackPx:t,geo:r,startMs:n,endMs:a,currentKey:l,hoveredKey:i,reveal:o,step:s,zoomedKey:c,popId:d,aimBubble:u,openCluster:h,setOpenCluster:m,previewCluster:p,setPreviewCluster:g,setZoomKey:f,startCaptionPx:b}){const x=[];e.forEach((e,t)=>{if("cluster"===e.type){const n=`cluster-${e.members[0].key}`,a=(r=e.members,`${(r[0]?.label??"").replace(/\s*v?\d+$/i,"").trim()||(r[0]?.label??"")} ×${r.length}`);if(x.push({key:n,group:e,text:a,x:e.members.reduce((e,t)=>e+t.baseX,0)/e.members.length,index:t,lane:-1,left:0,widthPx:Math.ceil(nl(a))+28}),n===c)for(const r of e.members)x.push({key:r.key,group:{type:"item",mark:r},text:r.label,x:r.x,index:t,lane:-1,left:0,widthPx:r.widthPx});return}var r;x.push({key:e.mark.key,group:e,text:e.mark.label,x:e.mark.x,index:t,lane:-1,left:0,widthPx:e.mark.widthPx})}),x.sort((e,t)=>e.x-t.x);const y=function(e,t,r,n,a={}){const l=t>0?t:0,i=n>0?n:1,o=a.gapPx??6,s=Math.max(1,a.laneCount??4),c=e.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.priority??0)-(t.item.priority??0)||e.item.ms-t.item.ms||e.index-t.index),d=Array.from({length:s},()=>[]),u=/* @__PURE__ */new Map;for(const{item:e}of c){const t=Math.max(0,e.widthPx);if(l<=0||t>l){u.set(e.key,-1);continue}const n=e.xPx??(e.ms-r)/i*l,a=Math.min(Math.max(n-t/2,0),l-t),c=a+t;let h=-1;for(let e=0;e<s;e++)if(d[e].every(e=>a>e.right+o||c+o<e.left)){d[e].push({left:a,right:c}),h=e;break}u.set(e.key,h)}return e.map(e=>({key:e.key,lane:u.get(e.key)??-1}))}([...b>0?[{key:"__rosh-tl-start__",ms:n,xPx:0,widthPx:b,priority:-2}]:[],...x.map(e=>({key:e.key,ms:"cluster"===e.group.type?e.group.members[0].ms:e.group.mark.ms,xPx:e.x,widthPx:e.widthPx,priority:"cluster"===e.group.type?-1:0}))],t,n,Math.max(a-n,Da),{laneCount:2}),v=new Map(y.map(e=>[e.key,e.lane]));for(const e of x)e.lane=v.get(e.key)??-1,e.left=Ga(e.x,e.widthPx,t);const w=x.find(e=>e.key===(h??p)),k=e=>0===e?r.laneA:r.laneB,N=e=>0===e?r.rail-4:r.rail+6+3;/* @__PURE__ */
349
- return ke(Ne,{children:[x.map(e=>{const t=Math.max(0,e.lane),n=Math.round(e.index*s+60);if("cluster"===e.group.type){const a=h===e.key,l=e.group.members.map(e=>e.x),i=()=>{g(null),a||f(null)};/* @__PURE__ */
350
- return ke("div",{children:[
351
- /* @__PURE__ */ke("button",{type:"button","data-timeline-part":"cluster",className:`rosh-tl-pill${al[e.group.kind]?.token?"":" text-blue-600"}${o?" rosh-tl-fade":""}`,"aria-expanded":a,"aria-controls":d,style:{left:`${e.left}px`,top:`${0===t?r.laneA+r.laneH-19:r.laneB}px`,color:al[e.group.kind]?.token,...o?{animationDelay:`${n}ms`}:{}},onMouseEnter:()=>{g(e.key),f(e.key)},onMouseLeave:i,onFocus:()=>{g(e.key),f(e.key)},onBlur:i,onClick:()=>{m(a?null:e.key),f(a?null:e.key)},children:[
352
- /* @__PURE__ */we("i",{"aria-hidden":"true"}),e.text]}),
353
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-cspan",style:{left:`${Math.min(...l)}px`,width:`${Math.max(1,Math.max(...l)-Math.min(...l))}px`,top:`${N(t)}px`}})]},e.key)}const a=e.group.mark;if(e.lane<0)return a.key===i?/* @__PURE__ */ke("div",{"aria-hidden":"true","data-timeline-part":"reveal",className:"rosh-tl-label is-reveal is-hot",style:{left:`${e.left}px`,top:`${r.laneA}px`,width:`${e.widthPx}px`},children:[
354
- /* @__PURE__ */we("span",{className:"rosh-tl-name",children:a.label}),
355
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:a.dateText})]},e.key):null;const c=Math.abs(e.left+e.widthPx/2-a.x)<=8;/* @__PURE__ */
356
- return ke("div",{children:[
357
- /* @__PURE__ */ke("div",{"aria-hidden":"true","data-timeline-part":"label",className:`rosh-tl-label${0===t?" is-up":""}${a.key===l?" is-current":""}${a.key===i?" is-hot":""}${o?" rosh-tl-fade":""}`,style:{left:`${e.left}px`,top:`${k(t)}px`,width:`${e.widthPx}px`,height:`${r.laneH}px`,...o?{animationDelay:`${n}ms`}:{}},children:[
358
- /* @__PURE__ */we("span",{className:"rosh-tl-name",children:a.label}),
359
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:a.dateText})]}),!c&&/* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-lead"+(o?" rosh-tl-fade":""),style:{left:`${Math.min(e.left+e.widthPx/2,a.x)}px`,width:`${Math.abs(e.left+e.widthPx/2-a.x)}px`,top:`${N(t)}px`,...o?{animationDelay:`${n}ms`}:{}}})]},e.key)}),w&&"cluster"===w.group.type&&/* @__PURE__ */ke("div",{ref:e=>{u(e,w.x)},id:d,className:"rosh-tl-popover","data-timeline-part":"cluster-popover",style:{top:`${r.rail+6+6}px`},onMouseEnter:()=>g(w.key),onMouseLeave:()=>g(null),children:[
360
- /* @__PURE__ */we("p",{className:"rosh-tl-popover-head",children:w.text}),
361
- /* @__PURE__ */we("ol",{children:w.group.members.map(e=>/* @__PURE__ */ke("li",{children:[
362
- /* @__PURE__ */we("span",{children:e.label}),
363
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})]})]})}function Ml({thumb:e,value:t,snap:r,axis:n,geo:a,startMs:l,endMs:i,trackPx:o,layerRef:s,glide:c,onScrub:d,nodes:u,onProgress:h}){const m=V().timeline,p=U(),g=se(!1),f=c?c.px:n.xByMs(t),b=c?c.ms:t,x=hl(e.stops),y=x?x.indexOf(t):-1,v=e=>{const r=s.current?.getBoundingClientRect();return r?n.msByPx(e-r.left):t},w=n=>{const a=r(n);a!==t&&e.onChange(a)},k=t=>{d?.(),g.current=!0,t.currentTarget.setPointerCapture?.(t.pointerId),e.onDragStart?.()},N=t=>{g.current&&(g.current=!1,t.currentTarget.releasePointerCapture?.(t.pointerId),h(null),e.onDragEnd?.())},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?Ja((t-n.ms)/l,0,1):1,ms:t}}return null}(u,t))},$=e.valueText?e.valueText(b):Aa(b,p),C=Math.max(1,Math.round((i-l)/Da));/* @__PURE__ */
364
- return ke(Ne,{children:[
365
- /* @__PURE__ */we("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{k(e),w(v(e.clientX))},onPointerMove:M,onPointerUp:N,onPointerCancel:N}),
366
- /* @__PURE__ */we("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${Ga(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):Aa(b,p)}),
367
- /* @__PURE__ */we("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":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/Da),"aria-valuetext":$,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:k,onPointerMove:M,onPointerUp:N,onPointerCancel:N,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*Da;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 $l(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function Cl({startMs:e,endMs:t,axis:r="linear",items:n,markers:l=[],pending:i=[],fillToMs:o,todayMs:s,labels:c="lanes",activeKey:d=null,onActivate:u,thumb:h,playback:m,edgeCaptions:p,phases:g=[],currentKey:f,zoomRange:b=null,motion:x=!0,ariaLabel:y,highlightKeys:v=null,onHoverChange:w,endMark:k=null}){const N="none"===c,M=ne(Date.now,null),$=ne(rl,!1),C=s??M,L=se(null),D=V().timeline,j=U(),A=e=>Aa(e,j),P=se(null),S=se(null),z=se(null),F=se(/* @__PURE__ */new Map),B=se(void 0),E=se(void 0),T=se(null),[I,O]=oe({}),[R,W]=oe(null),[_,q]=oe(null),[K,Y]=oe(null),[G,Z]=oe(null),[X,J]=oe(null),[Q,ee]=oe(null),te=ce(),re=ce(),ae=dl(L,!0),le=ae>0?ae-(i.length>0&&!N?176:0):0,de=le>0&&le-20<320,he=dl(P,!de),me=he>0?he:600,pe=tl[c],ge=N&&i.length>0,fe=ge?Math.max(0,me-36):me,be=r=>r>=e-Da&&r<=t+Da,xe=n.filter(e=>Number.isFinite(e.ms)&&be(e.ms)).slice().sort((e,t)=>e.ms-t.ms),ye="spread"===r?l.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ve=Ya([e,...[...xe.map(e=>e.ms),...ye].filter(r=>r>e&&r<t),t],fe,"compressed"===(Me=r)?{}:"spread"===Me?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var Me;const $e=ve.xByMs,Ce=xe.filter(e=>!e.provisional),Le=f??(Ce.length>0?Ce[Ce.length-1].key:null),De=xe.map((e,t)=>{const r=e.date??A(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?ll[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:$e(e.ms),baseX:$e(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:il(e,a,0===t&&"default"===a),role:e.key===Le?"current":n?"dot":"key",widthPx:N?Math.max(16,nl(e.caption??"")+6):I[e.key]||Xa(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),je=l.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&be(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=A(t);return{key:r,ms:t,x:$e(t),baseX:$e(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??al[e.kind].glyph,role:"key",widthPx:I[r]||Xa(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}}),Ae=ge?(()=>{const e=i[i.length-1],r=i.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+Da,x:me,baseX:me,kind:e.kind??"default",label:e.label,dateText:D.notReached,detail:r.length>0?D.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],Pe=N&&k&&!ge?[{key:k.key,ms:t,x:fe,baseX:fe,kind:"default",label:k.label,dateText:k.dateText??A(t),detail:k.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],Se=[...De,...je,...Ae,...Pe].sort((e,t)=>e.x-t.x||e.ms-t.ms),ze=p?.start??D.start(A(e)),Fe=null==ze||!1===ze?0:"string"==typeof ze?Math.ceil(nl(ze)):96,Be="lanes"===c?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),o=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||o)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):[],Ee=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:Za,members:t})}n=a}return r}(Se),Te=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ie=/* @__PURE__ */new Map;for(const e of Ee)if("cluster"===e.type)for(const t of e.members)Ie.set(t.key,Te(e));const Oe=K??G??X,Re=Be.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Oe)??Ee.find(e=>"cluster"===e.type&&Te(e)===Oe),We=e=>({x:e.baseX,widthPx:e.widthPx}),He=Re&&"cluster"===Re.type?Re.members.map(We):b?Se.filter(e=>e.ms>=b[0]&&e.ms<=b[1]).map(We):[],_e=He.length>1?ul(ve,He,fe):ve,qe=_e!==ve;if(qe)for(const e of Se)e.isCap||(e.x=_e.xByMs(e.ms));const Ke=Se.some(e=>e.x<14),Ue=qe&&Re?Oe:null,Ve=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ye=de?Se.map(Ve):Ee.flatMap(e=>{if("item"===e.type)return[Ve(e.mark)];const t=Te(e);if(t===Ue&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(Ve);var r;const 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=Ee.find(e=>"cluster"===e.type&&Te(e)===Ue),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=se(Ue),[Qe,et]=oe(!1);ue(()=>{if(Je.current===Ue)return;Je.current=Ue,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[Ue]);const tt=Se.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");cl(()=>{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=`${c}|${r}|${Se.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=oe(rt),lt=x&&nt===rt;ue(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,Se.length-1)),ot=hl(h?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=h?st(h.valueMs):null,dt=m&&h?De.filter(e=>!ot||ot.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 o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:Ja(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(_e,dt,{speed:m?.speed,reducedMotion:$}),[ht,mt]=oe(null),pt=se(null),gt=se({segments:ut,value:ct,playback:m});ue(()=>{gt.current={segments:ut,value:ct,playback:m}});const ft=se(null),bt=ie(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=ie(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!m?.playing&&!!h;ue(()=>{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 xt();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(el(t,0))):xt()},o=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:el(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:el(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=el(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Qa(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.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),bt(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(o)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=De.filter(e=>!e.provisional),wt=h?ht?ht.ms:ct:void 0!==o?o:vt.length>0?null===C?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,C):null,kt=new Set(v??[]),Nt=Se.filter(e=>kt.has(e.key)).map(e=>e.x),Mt=Nt.length>0?{from:Math.min(...Nt),to:Math.max(...Nt)}:null,$t=ie(()=>{clearTimeout(B.current),clearTimeout(E.current),W(null),q(null),Y(null),Z(null),J(null)},[]);ue(()=>()=>{clearTimeout(B.current),clearTimeout(E.current)},[]),ue(()=>{const e=T.current;e&&(T.current=null,F.current.get(e)?.focus())});const Ct=null!==_||null!==K||null!==G||null!==X;ue(()=>{if(Ct)return H(e=>"Escape"===e.key&&($t(),!0))},[Ct,$t]);const Lt=ie((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,me-r)):t;const l=e.parentElement;if(r>0&&l){const t=a(e),i=l.getBoundingClientRect().left,o=t.left+8+r-i,s=t.right-8-r-i;o<=s&&(n=Math.max(o,Math.min(n,s)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[me]),Dt=Ye.find(e=>e.key===_)??null,jt=Dt?Dt.x:0;cl(()=>{Lt(z.current,jt)},[Lt,_,jt]);const At=ct??void 0,Pt=se(null);ue(()=>{if(void 0===At)return;const e=_e.xByMs(At),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=F.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)}},[At]);const St=Ye.map(e=>e.key),zt=Le?Ge.get(Le)??null:null,Ft=Q&&St.includes(Q)?Q:zt&&St.includes(zt)?zt:St[0],Bt=e=>{const t=St.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?St.length-1:-1;r<0||r>St.length-1||(e.preventDefault(),ee(St[r]),F.current.get(St[r])?.focus())},Et=()=>clearTimeout(E.current),Tt=e=>{Et(),J(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>J(null),260)},Ot=e=>{Ue&&Ie.get(e)===Ue?Et():(Et(),J(null))},Rt=e=>{clearTimeout(B.current),W(e),q(e),w?.((e=>{const t=Ye.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{W(t=>t===e?null:t),clearTimeout(B.current),B.current=setTimeout(()=>q(t=>t===e?null:t),160),w?.(null)},Ht=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":sl(e),"aria-describedby":_===e.key?te:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),ee(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&u?.(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=D,r.events(t.length,t.map(sl))),"aria-describedby":_===e.key?te:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?Tt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Et(),Rt(e.key),ee(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Tt(e.key);const r=e.members[0];ee(r.key),T.current=r.key}};var t,r},qt="lanes"!==c||Se.length>1;if(de)/* @__PURE__ */
368
- return we("div",{ref:L,children:/* @__PURE__ */we(fl,{marks:Se.filter(e=>!e.isCap),pending:i,currentKey:Le,todayMs:C,reveal:lt,ariaLabel:y,step:it,nodeProps:Ht,onKeyDown:Bt})});const Kt=(e,t)=>null==e||!1===e?null:/* @__PURE__ */we("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:pe.rail-3+"px"},children:e});/* @__PURE__ */
369
- return ke("div",{ref:L,className:"rosh-tl-body"+(i.length>0&&!N?"":" is-solo"),children:[
370
- /* @__PURE__ */ke("div",{className:"flex items-stretch gap-3",children:[N&&Kt(ze,!1),
371
- /* @__PURE__ */we("div",{className:"rosh-tl-stage",style:{height:`${$l(pe,qt,g.length>0&&!N)}px`},children:/* @__PURE__ */ke("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?Et():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */we(ml,{marks:Se,innerRef:S}),
372
- /* @__PURE__ */we(bl,{axis:_e,geo:pe,fillTo:wt,reveal:lt,trackPx:fe,tweened:!!h}),ge&&
373
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${fe}px`,width:me-fe+"px",top:pe.rail+3-1+"px"}}),Mt&&/* @__PURE__ */we("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:pe.rail-7+"px",height:"20px"}}),
374
- /* @__PURE__ */we(pl,{startMs:e,endMs:t,axis:_e,geo:pe,reveal:lt}),
375
- /* @__PURE__ */we(xl,{geo:pe,caption:N?null:ze,endCaption:N?null:p?.end,around:Ke,reveal:lt,trackPx:me}),N&&/* @__PURE__ */we(vl,{nodes:Ye,geo:pe,reveal:lt}),null!==C&&C>e&&C<=t+Da&&/* @__PURE__ */we(yl,{x:_e.xByMs(Math.min(C,t)),geo:pe,trackPx:me,label:A(C),reveal:lt}),!N&&g.map(e=>/* @__PURE__ */we(wl,{phase:e,geo:pe,xOf:_e.xByMs},e.key)),
376
- /* @__PURE__ */we("ol",{className:"rosh-tl-nodes","aria-label":y,onKeyDown:Bt,children:Ye.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${pe.rail+3}px`,a=lt?Ha(t,it):{},l=(e=>!!Mt&&e.x>=Mt.from-.5&&e.x<=Mt.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
377
- return we("li",{children:/* @__PURE__ */we("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===Za,i=ol(t?"default":e.kind,"key"),o=t?void 0:al[e.kind]?.glyph;/* @__PURE__ */
378
- return ke("li",{...r(Le)?{"aria-current":"step"}:{},children:[
379
- /* @__PURE__ */ke("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(d)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */we(qa,{name:o}),t&&/* @__PURE__ */ke("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */ke("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=ol(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
380
- return we("li",{...i.key===Le?{"aria-current":"step"}:{},children:/* @__PURE__ */ke("button",{...Ht(i),className:`${o.className}${i.key===d?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */we(qa,{name:s}),"current"===i.role&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===c?/* @__PURE__ */we(Nl,{groups:Be,trackPx:me,geo:pe,startMs:e,endMs:t,currentKey:Le,hoveredKey:R,reveal:lt,step:it,zoomedKey:Ue,popId:re,aimBubble:Lt,startCaptionPx:Fe,openCluster:K,setOpenCluster:Y,previewCluster:G,setPreviewCluster:Z,setZoomKey:J}):"active"===c?/* @__PURE__ */we(kl,{nodes:Ye,trackPx:me,geo:pe,activeKey:d,hoveredKey:R,currentKey:Le}):null,Dt&&/* @__PURE__ */we("div",{ref:z,id:te,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${pe.rail+6+6}px`},onMouseEnter:()=>{Et(),Rt(Dt.key)},onMouseLeave:()=>{It(),Wt(Dt.key)},onFocus:()=>{Et(),Rt(Dt.key)},onBlur:()=>{It(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */ke(Ne,{children:[
381
- /* @__PURE__ */we("span",{className:"rosh-tl-name",children:Dt.mark.label}),
382
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */we("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */we("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */we("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:D.openButton})]}):
383
- /* @__PURE__ */ke("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
384
- /* @__PURE__ */ke("p",{className:"rosh-tl-popover-head",children:["×",Dt.members.length]}),
385
- /* @__PURE__ */we("ol",{children:Dt.members.map(e=>/* @__PURE__ */ke("li",{children:[
386
- /* @__PURE__ */ke("p",{className:"rosh-tl-foldrow",children:[
387
- /* @__PURE__ */we("span",{children:e.label}),
388
- /* @__PURE__ */we("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */we("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */we("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),h&&null!==ct&&
389
- /* @__PURE__ */we(Ml,{thumb:h,value:ct,snap:st,axis:_e,geo:pe,startMs:e,endMs:t,trackPx:me,layerRef:P,glide:ht,onScrub:m?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&Kt(p?.end,!0)]}),i.length>0&&!N&&/* @__PURE__ */we(gl,{pending:i,reveal:lt})]})}function Ll({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */we("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
390
- return ke("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
391
- /* @__PURE__ */ke("div",{className:"rosh-tl-head",children:[
392
- /* @__PURE__ */ke("div",{className:"rosh-tl-head-main",children:[e&&/* @__PURE__ */we("span",{className:"rosh-tl-ico text-gray-500","aria-hidden":"true",children:e}),
393
- /* @__PURE__ */we("h4",{className:"rosh-tl-title text-gray-800",children:t}),o.length>0&&/* @__PURE__ */we("p",{className:"rosh-tl-meta text-gray-500",children:o.map((e,t)=>
394
- /* @__PURE__ */ke(be,{children:[t>0&&/* @__PURE__ */we("span",{"aria-hidden":"true",children:" · "}),e]},t))})]}),a&&/* @__PURE__ */we("span",{className:"rosh-tl-head-actions",children:a})]}),i,l&&/* @__PURE__ */we("div",{className:"rosh-tl-foot border-gray-200",children:l})]})}function Dl({title:e,heading:t,subject:r,milestones:n,summary:a,endDate:l,phaseLabels:i,variant:o="card",edgeCaptions:s,highlightKeys:c=null,onHoverChange:d}){const u=ne(Date.now,null),h=[],m=[],p=V().timeline,g=U();for(const e of n){const t=ja(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=ja(l??null);let b,x,y=!0;0===h.length?(x=f??u??0,b=x-30*Da,y=null!==f||null!==u):(b=h[0].ms,x=f??h[h.length-1].ms,x-b<Da&&(x=b+Da));const v=h.length>0?Math.max(0,Math.round((x-b)/Da)):0,w=a??(v>0?p.duration(v):void 0),k=[h.length>0?p.started(Aa(h[0].ms,g)):void 0,w,m.length>0?p.reached(h.length,n.length):void 0],N=h.map(e=>{return{key:e.key,ms:e.ms,kind:e.kind,label:e.label,detail:e.detail,preview:e.preview,glyph:e.glyph,onClick:e.onClick,onOpen:e.onOpen,priority:(t=e.kind,"dfm"===t?1:0),caption:e.caption,provisional:e.provisional};var t}),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"===o,L=y&&/* @__PURE__ */we("div",{className:"select-none",children:/* @__PURE__ */we(Cl,{axis:C?"spread":"compressed",labels:C?"none":"lanes",items:N,pending:m,phases:$,startMs:b,endMs:x,todayMs:u??void 0,edgeCaptions:s,highlightKeys:c,onHoverChange:d,ariaLabel:p.milestones(e)})});/* @__PURE__ */
395
- return we("div",C?{className:"shrink-0","data-timeline-variant":"rail",children:L}:{className:"shrink-0",children:/* @__PURE__ */we(Ll,{icon:/* @__PURE__ */we(Ka,{}),heading:t??e,subject:r,meta:k,children:L})})}var jl=/* @__PURE__ */new Set(["finished","partial_shipped","shipped","completed","cancelled"]),Al=[{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 Pl(e){if(e.order_qty<=0)return 0;let t=0;for(const r of Al)if(r.weight>0){t+=Math.min((e[r.key]||0)/e.order_qty,1)*r.weight}return 100*t}function Sl(e){const t=e?.items??[];return 0===t.length?0:t.reduce((e,t)=>e+Pl(t),0)/t.length}function zl(e){const{reports:t,poProductionStartDate:r,poEstCompletionDate:n,poStatus:a,poNumber:l="",currentReportId:i,currentReportDate:o,msPerDayOfPlayback:s=500,markers:c=[]}=e,[d,u]=oe(null),h=V().production;ue(()=>{o?u(new Date(o).getTime()):t.length>0&&u(new Date(t[0].date).getTime())},[i]);const[m,p]=oe(!1),g=se(null),f=()=>{null!=g.current&&(cancelAnimationFrame(g.current),g.current=null),p(!1)};ue(()=>()=>f(),[]),ue(()=>{f()},[i]);const b=t.map(e=>ja(e.date)).filter(e=>null!=e),x=ne(Date.now,null)??Math.max(0,...b,...c.map(e=>ja(e.date)??0),ja(r??null)??0,ja(n??null)??0),y=b.length?Math.min(...b):x,v=b.length?Math.max(...b):x,w=ja(r??null)??y,k=ja(n??null)??0,N=jl.has((a||"").toLowerCase()),M=c.reduce((e,t)=>{const r=ja(t.date);return null!=r&&r>e?r:e},0),$=(()=>{const e=[k,v,M,w+Da];return N||e.push(x),Math.max(...e)})(),C=Math.max(1,Math.round(($-w)/Da)),L=ja(o??null)??v??w,D=Math.min(Math.max(d??L,w),$),j=t.find(e=>{const t=ja(e.date);return null!=t&&t<=D})??null;let A=null;for(let e=t.length-1;e>=0;e--){const r=ja(t[e].date);if(null!=r&&r>D){A=t[e];break}}const P=(()=>{if(j||!A||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=j??P,z=j?ja(j.date):P?w:null,F=A?ja(A.date):null,B=!!(S&&A&&null!=z&&null!=F&&D>z&&D<F);let E,T;if(B&&null!=z&&null!=F){const e=(D-z)/Math.max(F-z,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 A?.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]??{},o=e=>Number(e)||0;return{id:`interp-${e}-${a}`,part_number:e,description:l.description??i.description??"",order_qty:o(l.order_qty??i.order_qty??0),casting:t(o(l.casting),o(i.casting)),cnc:t(o(l.cnc),o(i.cnc)),painting:t(o(l.painting),o(i.painting)),packing:t(o(l.packing),o(i.packing)),finished_goods:t(o(l.finished_goods),o(i.finished_goods)),stock_qty:t(o(l.stock_qty),o(i.stock_qty))}}),l=ja(S?.est_completion_date),i=ja(A?.est_completion_date);let o;o=null!=l&&null!=i?new Date(Math.round(l+(i-l)*e)).toISOString().slice(0,10):S?.est_completion_date||A?.est_completion_date||null,E={id:`interp-${D}`,progress_number:h.estimated,date:new Date(D).toISOString().slice(0,10),created_by_name:"",est_completion_date:o,items:a,notes:""},T=S}else if(E=S??t[t.length-1]??null,E){const e=t.findIndex(e=>e.id===E.id);T=e>=0&&e<t.length-1?t[e+1]:null}else T=null;const I={};for(const e of T?.items??[])I[e.part_number]=e;const O=!(!i||E?.id===i),R=i?Math.min(ja(o??null)??$,$):$,W=i?t.find(e=>e.id===i)?.progress_number:void 0;return{startMs:w,endMs:$,totalLeadDays:C,scrubMs:D,setScrubMs:e=>{f(),u(e)},resetToCurrent:()=>{f(),o&&u(new Date(o).getTime())},scrubbedAway:O,beforeAnchor:S,nextAfter:A,displayed:E,prevReport:T,prevByPN:I,isInterpolated:B,playing:m,startPlay:()=>{if(m)return void f();if(R<=w)return void u(R);p(!0),u(w);let e=performance.now(),t=w;const r=n=>{const a=n-e;if(e=n,t+=a/s*Da,t>=R)return u(R),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:W,estCompletionMs:ja(n??null)}}function Fl({startMs:e,endMs:t,reports:r,markers:n,valueMs:a,activeId:l,onChange:i,onPickReport:o,onOpenReport:s,onOpenMarker:c,onDragStart:d,renderReportPreview:u,reportLabel:h,playback:m,edgeCaptions:p,bare:g=!1,endMark:f=null}){const b=V().production,x=U(),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:s?()=>s(e.id):void 0})),w=new Map(y.map(({report:e,ms:t})=>[e.id,t])),k=y.map(({ms:e})=>e),N=c?n.map(e=>({...e,onOpen:c})):n;/* @__PURE__ */
396
- return we("div",{className:"select-none",children:/* @__PURE__ */we(Cl,{axis:g?"spread":"linear",labels:g?"none":"active",endMark:g?f:null,items:v,markers:N,startMs:e,endMs:t,activeKey:l,onActivate:e=>{const t=w.get(e);null!=t&&i(t),o(e)},playback:m,edgeCaptions:p,thumb:{valueMs:a,onChange:i,onDragStart:d,stops:k,ariaLabel:b.scrub,valueText:e=>{const t=(e=>y.find(t=>t.ms===e)?.report)(e);return t?`${h(t)} · ${Aa(e,x)}`:Aa(e,x)}},ariaLabel:b.label(Aa(e,x),Aa(t,x))})})}function Bl({snapshot:e,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,onScrubProgress:l,heading:i,edgeCaptions:o,reportLabel:s=e=>e.progress_number,resetLabel:c,variant:d="card",onPlayStart:u}){const{reports:h,markers:m,poNumber:p,startMs:g,endMs:f,totalLeadDays:b,scrubMs:x,setScrubMs:y,displayed:v,scrubbedAway:w,resetToCurrent:k,currentReportId:N,currentReportProgressNumber:M,estCompletionMs:$}=e,C=function(e,t,r){const[n,a]=oe(!1),l=se(!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=>ja(e.date)).filter(e=>null!=e).sort((e,t)=>e-t),y,u),L=V().production,D=U(),j=i??L.heading,A=e=>Aa(e,D);if(0===h.length&&0===m.length)return null;const P=m.filter(e=>"shipment"===e.kind),S=m.filter(e=>"inspection"===e.kind),z=m.filter(e=>"invoice"===e.kind),F=(v?.items??[]).reduce((e,t)=>e+(Number(t.stock_qty)||0),0),B=v?Sl(v):0,E=h.find(e=>e.id===N),T=E?s(E):M,I=
397
- /* @__PURE__ */ke("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__ */we("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M2 1.5h2.3v7H2zM5.7 1.5H8v7H5.7z"})}):/* @__PURE__ */we("svg",{viewBox:"0 0 10 10","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M2 1.2 8.4 5 2 8.8z"})}),
398
- /* @__PURE__ */we("span",{children:C.playing?L.pause:L.play})]}),O=w&&(c??T)?/* @__PURE__ */we("button",{type:"button",onClick:()=>{C.stop(),k()},className:"text-xs text-blue-600 underline-offset-4 hover:underline font-medium",children:c??L.backTo(String(T))}):null,[R,W]=Q(L.showing),H=e=>/* @__PURE__ */we("p",{className:"rosh-tl-status text-gray-800",children:v?/* @__PURE__ */ke(Ne,{children:[e&&R,
399
- /* @__PURE__ */we("b",{className:"font-medium",children:s(v)}),e&&W,
400
- /* @__PURE__ */ke("span",{className:"text-gray-500",children:[" · ",A(new Date(v.date).getTime())," · ",L.overall(Math.round(B))," · ",L.inStock(F)]})]}):/* @__PURE__ */we("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:A($)}:null;/* @__PURE__ */
401
- return ke("div",{className:"shrink-0","data-timeline-variant":"rail",children:[
402
- /* @__PURE__ */we(Fl,{bare:!0,endMark:i,startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:{start:o?.start??L.start,end:o?.end??(e?L.estDone:void 0)},onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}}),
403
- /* @__PURE__ */ke("div",{className:"rosh-tl-railrow","data-timeline-part":"rail-row",children:[I,O,H(!1)]})]})}/* @__PURE__ */
404
- return we("div",{className:"shrink-0",children:/* @__PURE__ */we(Ll,{icon:/* @__PURE__ */we(Ua,{}),heading:j,subject:p,meta:[`${A(g)} → ${A(f)}`,L.leadTime(b)],actions:/* @__PURE__ */ke(Ne,{children:[O,I]}),footer:/* @__PURE__ */ke(Ne,{children:[H(!0),
405
- /* @__PURE__ */ke("div",{className:"rosh-tl-legend",children:[h.length>0&&/* @__PURE__ */ke("span",{className:"border-gray-200 text-gray-500",children:[
406
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-ring border-blue-600"}),L.report]}),P.length>0&&/* @__PURE__ */ke("span",{className:"border-gray-200 text-gray-500",children:[
407
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-diamond",style:{background:"var(--tl-shipment)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */we(qa,{name:"truck"})}),L.shipment]}),S.length>0&&/* @__PURE__ */ke("span",{className:"border-gray-200 text-gray-500",children:[
408
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-inspection)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */we(qa,{name:"flask"})}),L.inspection]}),z.length>0&&/* @__PURE__ */ke("span",{className:"border-gray-200 text-gray-500",children:[
409
- /* @__PURE__ */we("i",{"aria-hidden":"true",className:"rosh-tl-glyph is-disc",style:{background:"var(--tl-invoice)",color:"var(--tl-on-kind)"},children:/* @__PURE__ */we(qa,{name:"receipt"})}),L.invoice]})]})]}),children:/* @__PURE__ */we(Fl,{startMs:g,endMs:f,reports:h,markers:m,valueMs:x,activeId:v?.id??"",onChange:y,onPickReport:t,onOpenReport:r,onOpenMarker:n,renderReportPreview:a,reportLabel:s,edgeCaptions:o,onDragStart:C.stop,playback:{playing:C.playing,onArrive:(e,t)=>y(t),onProgress:l,onStop:C.stop}})})})}var El=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function Tl({items:e,getVolume:t,getInstructionVolume:r,getActualVolume:n,qtyField:a="instruction",showNewIndicator:l=!1,getInstructionQty:i=e=>e.quantity,getActualQty:o=e=>e.actual_qty,isFilled:s,isNew:c=e=>Boolean(e._isNew),className:d,style:u}){const h=V().containers,m=s?e.filter(s):e,p=e=>El(i(e)),g=e=>El(o(e)),f=m.some(e=>null!=o(e)&&g(e)>0),b=e=>f?p(e):"actual"===a?o(e)??i(e)??0:i(e)??0,x=m.reduce((e,t)=>e+El(b(t)),0),y=m.filter(e=>c(e)).length,v=m.filter(e=>c(e)).reduce((e,t)=>e+El(b(t)),0),w=m.reduce((e,t)=>e+p(t),0),k=m.reduce((e,t)=>e+g(t),0),N=e=>t?.(e)??0,M=r??(e=>N(e)*p(e)),$=n??(e=>N(e)*g(e)),C=m.reduce((e,t)=>e+M(t),0),L=m.reduce((e,t)=>e+$(t),0),D=f?Math.max(C,L):"actual"===a&&L||C,j=D<=34.65?"20ft":"40ft",A="20ft"===j?33:67,P=D>0?Math.max(1,Math.ceil(D/A)):0,S=P*A,z=D>0&&D>=.95*S&&D<=1.1*S;if(0===m.length)return null;const F=(e,t)=>A>0?Math.max(0,Math.min((e-t*A)/A*100,100)):0;/* @__PURE__ */
410
- return ke("div",{className:`mt-2 px-1 space-y-2 ${d??""}`.trim(),style:u,children:[
411
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
412
- /* @__PURE__ */ke("span",{children:[`${h.items(m.length)} · ${h.pieces(x)}`,f&&w!==k&&/* @__PURE__ */we("span",{className:"ml-1 text-gray-400",children:h.split(w,k)})]}),l&&y>0&&/* @__PURE__ */ke("span",{className:"flex items-center gap-1 text-green-600",children:[
413
- /* @__PURE__ */we("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),h.added(y,v)]})]}),D>0?/* @__PURE__ */ke("div",{className:"space-y-1.5",children:[Array.from({length:P}).map((e,t)=>{const r=F(C,t),n=F(L,t),a=f,l=Math.max(r,n),i=Math.min(r,n),o=r>=n,s=a?o?"bg-blue-500":"bg-green-500":"bg-blue-500",c=a?o?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
414
- return ke("div",{className:"flex items-center gap-2",children:[
415
- /* @__PURE__ */we("span",{className:"text-[10px] text-gray-400 w-8 shrink-0",children:j}),
416
- /* @__PURE__ */ke("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
417
- /* @__PURE__ */we("div",{className:`absolute inset-y-0 left-0 ${s} transition-all`,style:{width:`${l}%`}}),a&&i>0&&/* @__PURE__ */we("div",{className:`absolute inset-y-0 left-0 ${c} transition-all`,style:{width:`${i}%`}})]}),
418
- /* @__PURE__ */we("span",{className:"text-[10px] text-gray-500 w-16 text-right",children:a?h.fill(Math.min(L-t*A,A),A):h.fill(Math.min(C-t*A,A),A)})]},`bar-${t}`)}),
419
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
420
- /* @__PURE__ */ke("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[h.total,f?/* @__PURE__ */ke(Ne,{children:[
421
- /* @__PURE__ */ke("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
422
- /* @__PURE__ */we("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),h.instructed(C)]}),
423
- /* @__PURE__ */we("span",{className:"text-gray-400",children:"/"}),
424
- /* @__PURE__ */ke("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
425
- /* @__PURE__ */we("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */we("b",{className:"text-gray-700",children:h.volume(D)})]}),
426
- /* @__PURE__ */ke("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",P," × ",j]})]})]}):/* @__PURE__ */we("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var Il=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g;function Ol(e){const t=/^[a-zA-Z][a-zA-Z0-9+.-]*:/.exec(e.trim());return null===t||/^(?:https?|mailto|tel):$/i.test(t[0])}function Rl(e){const t=[];let r,n=0,a=0;for(Il.lastIndex=0;null!==(r=Il.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
427
- /* @__PURE__ */ke("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
428
- /* @__PURE__ */we("a",{href:Ol(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(
429
- /* @__PURE__ */we("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
430
- /* @__PURE__ */we("code",{className:"rounded bg-gray-200 px-1 py-0.5 font-mono text-[0.85em] text-gray-800",children:r[6]},a++)):void 0!==r[7]&&t.push(/* @__PURE__ */we("em",{children:r[7]},a++)),n=Il.lastIndex;return n<e.length&&t.push(e.slice(n)),t}function Wl({alt:e}){const t=e.replace(/^screenshot:\s*/i,""),r=V().markdown;/* @__PURE__ */
431
- return ke("div",{className:"my-1 flex items-start gap-2 rounded-lg border border-dashed border-gray-300 bg-gray-50 px-3 py-2.5",children:[
432
- /* @__PURE__ */we("svg",{className:"mt-0.5 h-4 w-4 shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M3 6a1.5 1.5 0 0 1 1.5-1.5h1.1l.4-.9a1 1 0 0 1 .9-.6h6.2a1 1 0 0 1 .9.6l.4.9h1.1A1.5 1.5 0 0 1 18 6v8.5A1.5 1.5 0 0 1 16.5 16h-13A1.5 1.5 0 0 1 2 14.5V6Zm7.5 1.5a3.25 3.25 0 1 0 0 6.5 3.25 3.25 0 0 0 0-6.5Z"})}),
433
- /* @__PURE__ */ke("span",{className:"text-xs text-gray-500",children:[
434
- /* @__PURE__ */we("span",{className:"font-medium text-gray-600",children:`${r.screenshot} — `}),t]})]})}function Hl(e,t){const r=[];for(const n of e){const e=t.exec(n);e?r.push(e[1]):r.length&&(r[r.length-1]+=" "+n.trim())}return r}var _l=e=>e.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(e=>e.trim());function ql(e,t){const r=e.split("\n"),n=r[0],a=/^(#{2,4})\s+(.*)$/.exec(n);if(a&&1===r.length){const e=a[1].length;/* @__PURE__ */
435
- return we(`h${e}`,{className:2===e?"mt-2 text-[13px] font-semibold uppercase tracking-wide text-gray-500":3===e?"mt-1 text-base font-semibold text-gray-900":"mt-1 text-sm font-semibold text-gray-900",children:Rl(a[2])},t)}if(1===r.length&&/^---+$/.test(n))/* @__PURE__ */
436
- return we("hr",{className:"border-gray-200"},t);if(function(e){return e.length>=2&&e[0].includes("|")&&/^\s*\|?[\s:|-]*-[\s:|-]*\|?\s*$/.test(e[1])&&e[1].includes("-")}(r))return function(e,t){const r=_l(e[0]),n=e.slice(2).map(_l);/* @__PURE__ */
437
- return we("div",{className:"my-1 overflow-x-auto rounded-lg border border-gray-200",children:/* @__PURE__ */ke("table",{className:"w-full border-collapse text-sm",children:[
438
- /* @__PURE__ */we("thead",{children:/* @__PURE__ */we("tr",{className:"bg-gray-50",children:r.map((e,t)=>/* @__PURE__ */we("th",{className:"border-b border-gray-200 px-3 py-1.5 text-left font-semibold text-gray-700",children:Rl(e)},t))})}),
439
- /* @__PURE__ */we("tbody",{children:n.map((e,t)=>/* @__PURE__ */we("tr",{className:"even:bg-gray-50/50",children:e.map((e,t)=>/* @__PURE__ */we("td",{className:"border-t border-gray-100 px-3 py-1.5 align-top text-gray-700",children:Rl(e)},t))},t))})]})},t)}(r,t);if(/^>\s?/.test(n)){const e=r.map(e=>e.replace(/^>\s?/,"")).join(" ");/* @__PURE__ */
440
- return we("div",{className:"my-1 rounded-r-lg border-l-4 border-blue-300 bg-blue-50/60 px-3 py-2 text-gray-700",children:Rl(e)},t)}const l=/^!\[([^\]]*)\]\(([^)]+)\)$/.exec(n);if(l&&1===r.length)/* @__PURE__ */
441
- return we(Wl,{alt:l[1]},t);if(/^[-*]\s+/.test(n)){const e=Hl(r,/^[-*]\s+(.*)$/);/* @__PURE__ */
442
- return we("ul",{className:"list-disc space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */we("li",{children:Rl(e)},t))},t)}const i=/^(\d+)\.\s+/.exec(n);if(i){const e=Hl(r,/^\d+\.\s+(.*)$/);/* @__PURE__ */
443
- return we("ol",{start:Number(i[1]),className:"list-decimal space-y-1 pl-5 marker:text-gray-400",children:e.map((e,t)=>/* @__PURE__ */we("li",{className:"pl-1",children:Rl(e)},t))},t)}/* @__PURE__ */
444
- return we("p",{children:Rl(r.join(" "))},t)}var Kl=/^( {0,3})(`{3,}|~{3,})[ \t]*(.*?)[ \t]*$/;function Ul(e){const t=e.replace(/\r\n/g,"\n").split("\n"),r=[];let n=[];const a=()=>{for(const e of n.join("\n").split(/\n{2,}/)){const t=e.replace(/\s+$/,"");""!==t.trim()&&r.push({text:t})}n=[]};for(let e=0;e<t.length;e+=1){const l=Kl.exec(t[e]);if(!(null!==l&&!("`"===l[2][0]&&l[3].includes("`")))){n.push(t[e]);continue}a();const[,i,o,s]=l,c=[];for(e+=1;e<t.length;e+=1){const r=Kl.exec(t[e]);if(null!==r&&r[2][0]===o[0]&&r[2].length>=o.length&&""===r[3])break;c.push(i?t[e].replace(new RegExp(`^ {0,${i.length}}`),""):t[e])}r.push({fence:{lang:s.split(/[ \t]/)[0],code:c.join("\n")}})}return a(),r}function Vl({children:e,className:t}){/* @__PURE__ */
445
- return we("div",{className:`space-y-3 text-sm leading-relaxed text-gray-700 ${t??""}`.trim(),children:Ul(e??"").map((e,t)=>"fence"in e?function({lang:e,code:t},r){/* @__PURE__ */
446
- return we("pre",{"data-language":e||void 0,className:"my-1 overflow-x-auto rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-800",children:/* @__PURE__ */we("code",{children:t})},r)}(e.fence,t):ql(e.text,t))})}var Yl=({open:e})=>/* @__PURE__ */we("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-400 transition-transform "+(e?"rotate-90":""),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */we("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 0 1 .02-1.06L11.168 10 7.23 6.29a.75.75 0 1 1 1.04-1.08l4.5 4.25a.75.75 0 0 1 0 1.08l-4.5 4.25a.75.75 0 0 1-1.06-.02Z",clipRule:"evenodd"})});function Gl({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:i,emptyMessage:o}){const s=V(),[c,d]=oe(""),[u,h]=oe(null),[m,p]=oe({}),g=c.trim().toLowerCase(),f=de(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),b=e=>!g||e.title.toLowerCase().includes(g)||e.body.toLowerCase().includes(g)||e.category_label.toLowerCase().includes(g),x=de(()=>f.map(e=>({...e,docs:e.docs.filter(b)})).filter(e=>e.docs.length>0),[f,g]),y=de(()=>x.flatMap(e=>e.docs),[x]),v=(u?y.find(e=>e.slug===u):void 0)??y[0]??null,w=e=>!!g||(m[e]??e===v?.category);/* @__PURE__ */
447
- return ke("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
448
- /* @__PURE__ */ke("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
449
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
450
- /* @__PURE__ */we("h2",{className:"text-sm font-semibold text-gray-900",children:s.help.title}),n&&a&&/* @__PURE__ */we("button",{type:"button",onClick:a,className:"text-xs text-blue-600 hover:underline",children:s.help.newArticle})]}),
451
- /* @__PURE__ */we("div",{className:"px-2.5 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */ke("div",{className:"relative",children:[
452
- /* @__PURE__ */we("svg",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */we("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 1 0 3.36 9.85l3.14 3.15a.75.75 0 1 0 1.06-1.06l-3.15-3.14A5.5 5.5 0 0 0 9 3.5ZM5 9a4 4 0 1 1 8 0 4 4 0 0 1-8 0Z",clipRule:"evenodd"})}),
453
- /* @__PURE__ */we("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:s.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white py-1.5 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
454
- /* @__PURE__ */we("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */we("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:s.help.loading}):0===x.length?/* @__PURE__ */we("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:g?s.help.noResults:o??s.help.empty}):x.map(e=>{const t=w(e.key);/* @__PURE__ */
455
- return ke("div",{className:"py-0.5",children:[
456
- /* @__PURE__ */ke("button",{type:"button",onClick:()=>{return t=e.key,p(e=>({...e,[t]:!w(t)}));var t},className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-left text-[10px] font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
457
- /* @__PURE__ */we(Yl,{open:t}),
458
- /* @__PURE__ */we("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=v?.slug===e.slug;/* @__PURE__ */
459
- return ke("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-left pl-8 pr-3 py-1.5 text-sm flex items-center gap-1.5 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
460
- /* @__PURE__ */we("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */we("span",{className:"ml-auto shrink-0 text-[10px] text-amber-600",children:s.help.draft})]},e.slug)})]},e.key)})})]}),
461
- /* @__PURE__ */we("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:v?/* @__PURE__ */ke(Ne,{children:[
462
- /* @__PURE__ */ke("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
463
- /* @__PURE__ */ke("div",{className:"min-w-0",children:[
464
- /* @__PURE__ */we("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
465
- /* @__PURE__ */ke("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */ke("span",{className:"ml-2 text-amber-600",children:["· ",s.help.draft]})]})]}),n&&l&&/* @__PURE__ */we("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:s.help.edit})]}),
466
- /* @__PURE__ */we("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */we(Vl,{children:v.body}):/* @__PURE__ */we("p",{className:"text-sm text-gray-500 italic",children:s.help.noBody})})]}):/* @__PURE__ */we("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:/* @__PURE__ */we("p",{className:"text-sm text-gray-500",children:t?s.help.loading:s.help.pickArticle})})})]})}var Zl={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 Xl({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:o=""}){const s=p(n??"");/* @__PURE__ */
467
- return ke("button",{type:l,onClick:t,disabled:a,title:i,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 ${Zl[r]} ${o}`,children:[e,n&&/* @__PURE__ */we("kbd",{className:"kbd-submit rounded border px-1.5 py-0.5 text-[10px] font-medium",children:s})]})}function Jl(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 Ql({children:e,count:t}){return null==t?/* @__PURE__ */we("p",{className:"px-2.5 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */ke("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:[
468
- /* @__PURE__ */we("span",{className:"min-w-0 truncate",children:e}),
469
- /* @__PURE__ */we("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function ei(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 ti({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=va(i,"SidebarNavItem"),c=V().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */ke(Ne,{children:[null!=a&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4 "+(r?"text-blue-600":"text-gray-400"),children:a}),s&&
470
- /* @__PURE__ */we("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
471
- /* @__PURE__ */we("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */we("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */we("span",{className:Jl(r),children:t}),null!=l&&/* @__PURE__ */we("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
472
- return we("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */we("span",{className:ei(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 ri({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=ce(),[i,o]=ae(()=>{if(a){let e=null;try{e=window.localStorage.getItem(a)}catch{}if("1"===e||"0"===e)return"1"===e}return n},n),s=!i&&me.toArray(r).some(e=>pe(e)&&!0===e.props.active);/* @__PURE__ */
473
- return ke("div",{children:[
474
- /* @__PURE__ */ke("button",{type:"button",onClick:()=>{const e=!i;if(o(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 "+(s?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
475
- /* @__PURE__ */we("span",{className:"min-w-0 truncate",title:e,children:e}),
476
- /* @__PURE__ */we("svg",{className:"mr-auto ml-0.5 size-3 shrink-0 text-gray-400 transition-transform "+(i?"":"-rotate-90"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.6,"aria-hidden":"true",children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})}),null!=t&&t>0&&/* @__PURE__ */we("span",{className:Jl(s),children:t})]}),
477
- /* @__PURE__ */we("div",{id:l,role:"group","aria-label":e,hidden:!i,children:r})]})}function ni({items:e,activeKey:t,onSelect:r,brand:n,actions:a,className:l}){/* @__PURE__ */
478
- return ke("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */we("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
479
- /* @__PURE__ */we("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
480
- return ke("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__ */we("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
481
- /* @__PURE__ */we("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */we("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__ */we("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */we("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var ai=/(^|[\s:])!?z-/,li=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function ii({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":l,className:s="",triggerClassName:c,menuClassName:d="",minWidth:u=180,linkAs:h,disabled:m,id:p,"aria-describedby":g}){const[f,b]=oe(!1),[x,y]=oe(-1),v=se(null),w=se(null),k=se(null),N=se({text:"",at:0}),M=ce(),$=ce(),C=p??$,L=ie(e=>{b(!1),e&&w.current?.focus()},[]),D=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(li(t[l]))return l}return-1},j=()=>k.current?.closest("[data-popup-menu-tree]")??null;ue(()=>{if(!f)return;const e=e=>{const t=e.target;v.current?.contains(t)||j()?.contains(t)||L(!1)};document.addEventListener("pointerdown",e,!0);const t=_(()=>L(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[f,L]);const A=ie(()=>{const e=j(),t=w.current;if(!e||!t)return;const l=e.style;l.left="0px",l.top="0px",l.maxWidth="none",l.maxHeight="none";const o={width:e.offsetWidth,height:e.offsetHeight},s=i({trigger:t.getBoundingClientRect(),menu:o,bounds:a(t),align:r,side:n});l.left=`${s.left}px`,l.top=`${s.top}px`,l.maxWidth=`${s.maxWidth}px`,l.maxHeight=`${s.maxHeight}px`,l.overflowY=o.height>s.maxHeight?"auto":"",e.dataset.side=s.side,e.dataset.align=r},[r,n]);ee(()=>{f&&A()}),ue(()=>{if(f)return o(()=>w.current,A)},[f,A]),ue(()=>{if(!f)return;const e=k.current,r=li(t[x])?e?.querySelector(`[data-dropdown-index="${x}"]`):null;(r??e)?.focus({preventScroll:!0})},[f,x]),ue(()=>{if(f)return H(e=>"Escape"===e.key&&(L(!0),!0),()=>k.current)},[f,L]);const P=e=>{y(e),b(!0)},S=e=>{e.disabled||(L(!0),e.onSelect())},z=h??"a",F=(e,t)=>({"data-dropdown-index":e,tabIndex:e===x?0:-1,onMouseEnter:()=>{t.disabled||y(e)}}),E=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
482
- return we("div",{role:"separator",children:/* @__PURE__ */we(I,{})},e.key);if("label"===e.type)/* @__PURE__ */
483
- return we("div",{id:`${M}-label-${t}`,children:/* @__PURE__ */we(O,{children:e.label})},e.key);if("checkbox"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
484
- return ke("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),...F(t,e),children:[
485
- /* @__PURE__ */we(W,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
486
- return ke("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>S(e),...F(t,e),children:[
487
- /* @__PURE__ */we(W,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=R(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */ke("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...F(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */ke(z,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>L(!0),...F(t,e),children:[e.icon,e.label]},e.key)}const r=R(e.danger,e.disabled,"");/* @__PURE__ */
488
- return ke("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>S(e),...F(t,e),children:[e.icon,e.label]},e.key)},T={...ai.test(d)?{}:{zIndex:q.popup},minWidth:u};/* @__PURE__ */
489
- return ke("div",{ref:v,className:`relative inline-flex ${s}`.trim(),children:[
490
- /* @__PURE__ */we("button",{ref:w,id:C,type:"button","aria-haspopup":"menu","aria-expanded":f,"aria-controls":f?M:void 0,"aria-label":l,"aria-describedby":g,disabled:m,onClick:()=>f?L(!1):P(D(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),P(D(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),P(D(t.length-1,-1)))},className:c??"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}),f&&
491
- /* @__PURE__ */we(B,{portal:!0,className:d,style:T,children:/* @__PURE__ */we("div",{ref:k,id:M,role:"menu","aria-orientation":"vertical","aria-label":l,"aria-labelledby":l?void 0:C,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),y(D(x+1,1));else if("ArrowUp"===e.key)e.preventDefault(),y(D(x-1,-1));else if("Home"===e.key)e.preventDefault(),y(D(0,1));else if("End"===e.key)e.preventDefault(),y(D(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),L(!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-N.current.at<500?N.current.text+n:n;N.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?x+1:Math.max(x,0),s=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(li(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void y(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(E(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(E(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${M}-label-${l-1}`:void 0;e.push(/* @__PURE__ */we("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}function oi(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function si({at:e,onClose:t,children:r,owner:n,"aria-label":l,minWidth:i=180,className:o="",autoFocus:s=!0}){const d=se(null),[u,h]=oe(null),m=se(t);m.current=t,ee(()=>{const t=d.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},l=c({point:e,menu:r,bounds:a(n??null)});h(e=>e&&e.left===l.left&&e.top===l.top&&e.maxHeight===l.maxHeight?e:{left:l.left,top:l.top,maxHeight:l.maxHeight,scroll:r.height>l.maxHeight})},[e.x,e.y,n]);const p=se(null),g=se(!1);ue(()=>(p.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!d.current?.contains(e)||p.current?.focus?.({preventScroll:!0})}),[]),ue(()=>{u&&!g.current&&s&&(g.current=!0,oi(d.current)[0]?.focus({preventScroll:!0}))},[u,s]),ue(()=>{if(s)return;const e=e=>{if(d.current?.contains(document.activeElement))return;const t=oi(d.current),r="ArrowDown"===e.key||"Home"===e.key?t[0]:"ArrowUp"===e.key||"End"===e.key?t[t.length-1]:void 0;r&&(e.preventDefault(),r.focus({preventScroll:!0}))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),ue(()=>H(e=>"Escape"===e.key&&(m.current(),!0),()=>d.current),[]),ue(()=>{const e=()=>m.current();return window.addEventListener("resize",e),window.addEventListener("blur",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("blur",e),window.removeEventListener("scroll",e,!0)}},[]);const f=ie(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void m.current();const t=oi(d.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),b=u?{left:u.left,top:u.top,maxHeight:u.maxHeight,...u.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
492
- return we(B,{portal:!0,minWidth:i,style:b,onClose:t,className:o,children:/* @__PURE__ */we(E.Provider,{value:!0,children:/* @__PURE__ */we("div",{ref:d,role:"menu","aria-label":l,"data-context-menu":"",onKeyDown:f,children:r})})})}function ci(){const[e,t]=oe(null),r=ie(()=>t(null),[]),n=ie((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(T(n))return!1;e.preventDefault();const a=e.target instanceof Element?e.target:null;let{clientX:l,clientY:i}=e;if(0===l&&0===i&&a){const e=a.getBoundingClientRect();l=e.left,i=e.bottom}return t({x:l,y:i,data:r,owner:a}),!0},[]),a=ie(e=>{n(e,void 0)},[n]);return{open:n,onContextMenu:a,close:r,state:e,props:{at:{x:e?.x??0,y:e?.y??0},owner:e?.owner??null,onClose:r}}}var di='[role="treeitem"]';function ui(e){return[...e.querySelectorAll(di)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function hi({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=se(null);ee(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(di)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??ui(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=ie(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(di);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=ui(t),i=n.indexOf(r),o=Number(r.getAttribute("aria-level")??"1"),s=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(di))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":s(n[i+1]);break;case"ArrowUp":s(n[i-1]);break;case"Home":s(n[0]);break;case"End":s(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>o?s(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<o){s(n[e]);break}}},[a]);/* @__PURE__ */
493
- return we("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function mi({children:e,hidden:t,className:r=""}){/* @__PURE__ */
494
- return we("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}function pi({children:e}){/* @__PURE__ */
495
- return we("div",{role:"presentation",className:"px-3 pb-1 pt-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e})}var gi=/* @__PURE__ */ke("svg",{"aria-hidden":"true",viewBox:"0 0 8 14",fill:"currentColor",className:"h-3.5 w-2",children:[
496
- /* @__PURE__ */we("circle",{cx:"2",cy:"3",r:"1.1"}),
497
- /* @__PURE__ */we("circle",{cx:"6",cy:"3",r:"1.1"}),
498
- /* @__PURE__ */we("circle",{cx:"2",cy:"7",r:"1.1"}),
499
- /* @__PURE__ */we("circle",{cx:"6",cy:"7",r:"1.1"}),
500
- /* @__PURE__ */we("circle",{cx:"2",cy:"11",r:"1.1"}),
501
- /* @__PURE__ */we("circle",{cx:"6",cy:"11",r:"1.1"})]});function fi({label:e,level:t=1,icon:r,preview:a,selected:l=!1,expanded:i,onToggle:o,onSelect:s,muted:c=!1,badge:d,actions:u,actionsPinned:h=!1,rename:m,drop:p,dragging:g=!1,draggable:f=!1,dragHint:b,onMove:x,rowProps:y,className:v=""}){const w=void 0!==i,k=V().tree,N=ce(),M=[y?.["aria-describedby"],x?N:void 0].filter(Boolean).join(" ")||void 0,$=l?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
502
- return ke("div",{...y,role:"treeitem","aria-level":t,"aria-selected":l,"aria-expanded":w?i:void 0,tabIndex:l?0:-1,"aria-keyshortcuts":y?.["aria-keyshortcuts"]??(x?"Alt+ArrowUp Alt+ArrowDown":void 0),"aria-describedby":M,"data-drop":p,"data-draggable":f||void 0,onKeyDown:e=>{y?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented||(!e.altKey||e.ctrlKey||e.metaKey||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||!x?"Enter"!==e.key&&" "!==e.key||!s?("ArrowRight"===e.key&&w&&!i&&o||"ArrowLeft"===e.key&&w&&i&&o)&&(e.preventDefault(),o()):(e.preventDefault(),s()):(e.preventDefault(),x("ArrowUp"===e.key?"up":"down")))},onClick:e=>{y?.onClick?.(e),e.defaultPrevented||s?.()},className:["group/treerow relative flex min-h-8 select-none items-center gap-1.5 rounded-md px-2 py-1 text-sm",f?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",$,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",g?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */we("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===p&&/* @__PURE__ */we("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),f&&
503
- /* @__PURE__ */we(n,{content:b??k.dragHint,side:"left",delay:700,className:"absolute left-0 top-1/2 inline-flex -translate-y-1/2 transition-opacity "+(g?"opacity-0":"opacity-0 group-hover/treerow:opacity-100 group-focus-visible/treerow:opacity-100"),children:/* @__PURE__ */we("span",{"aria-hidden":"true","data-tree-grip":"",className:"flex h-4 w-2 items-center justify-center text-gray-400",children:gi})}),
504
- /* @__PURE__ */we("span",w?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),o?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:(C=!!i,/* @__PURE__ */we("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(C?"rotate-90":""),children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}))}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */we("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(l?"text-blue-600":"text-gray-500"),children:r}),
505
- /* @__PURE__ */ke("span",{className:"relative flex min-w-0 flex-1 items-center gap-1.5",children:[m??/* @__PURE__ */ke("span",{className:`min-w-0 truncate ${l?"font-semibold":"font-medium"} ${c?"text-gray-400 line-through":""}`,children:[e,null!=a&&/* @__PURE__ */we("span",{className:"ml-2 font-normal text-gray-500",children:a})]}),null!=d&&!1!==d&&/* @__PURE__ */we("span",{className:"shrink-0 rounded bg-gray-100 px-1 py-0.5 text-[10px] font-medium tabular-nums text-gray-500",children:d}),null!=u&&/* @__PURE__ */we("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(h||c?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:u})]}),x&&/* @__PURE__ */we("span",{id:N,hidden:!0,children:k.moveHint})]});var C}function bi({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=V().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
506
- return we("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */ke("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
507
- /* @__PURE__ */we("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */we("span",{className:i,children:l})})}function xi({onInsert:e,label:t,drop:r=!1,seamProps:a}){const l=V().tree,i=t??l.insertHere,o=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
508
- return ke("div",{...a,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${a?.className??""}`.trim(),children:[
509
- /* @__PURE__ */we("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
510
- /* @__PURE__ */we("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${o}`}),e&&/* @__PURE__ */we(n,{content:i,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */we("button",{type:"button","aria-label":i,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */we("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.6,className:"h-3 w-3",children:/* @__PURE__ */we("path",{strokeLinecap:"round",d:"M12 5v14M5 12h14"})})})})]})}var yi=he({labels:"none",shown:"none"}),vi="button[data-icon-rail-button]:not([disabled])";function wi(e,t,r){const n=getComputedStyle(e),a=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),l="horizontal"===t?(parseFloat(n.columnGap)||0)*Math.max(0,r-1):0,i=e.parentElement;let o=1/0;if(i){const e=getComputedStyle(i);o=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:a+l,room:o}}function ki({"aria-label":e,orientation:t="vertical",children:r,className:n="",labels:a="none",labelsFit:l=!1,onLabelsShown:i}){const o=se(null),s="none"!==a&&l,[c,d]=oe(null),u="none"===a?"none":s?c??"none":"all",h=se(()=>{});h.current=()=>{const e=o.current;if(!e||!s)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const r=getComputedStyle(e),n=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a=parseFloat(r.minWidth)||0,l=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(a,n+l),worded:"below"===t?Math.max(a,n+Math.max(l,i)):Math.max(a,n+l+6+i),active:"true"===e.getAttribute("aria-pressed")}})}(e,a);d(function({buttons:e,orientation:t,chrome:r,room:n}){if(0===e.length)return"none";const a=n=>{const a=e.map(e=>n(e)?e.worded:e.bare);return r+("horizontal"===t?a.reduce((e,t)=>e+t,0):Math.max(...a))};return a(()=>!0)<=n+.5?"all":e.some(e=>e.active)&&a(e=>e.active)<=n+.5?"chosen":"none"}({buttons:r,orientation:t,...wi(e,t,r.length)}))},ee(()=>{h.current()}),ue(()=>{const e=o.current?.parentElement;if(!s||!e)return;let t=!0;const r=()=>{t&&h.current()},n="undefined"==typeof ResizeObserver?void 0:ResizeObserver,a=n?new n(r):null;return a?.observe(e),document.fonts?.ready.then(r,()=>{}),()=>{t=!1,a?.disconnect()}},[s]);const m=se(null),p=se(i);p.current=i,ue(()=>{s&&null!==c&&m.current!==c&&(m.current=c,p.current?.(c))},[s,c]),ee(()=>{const e=o.current;if(!e)return;const t=[...e.querySelectorAll(vi)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===r?0:-1});/* @__PURE__ */
511
- return we("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=o.current;if(!r)return;const n=[...r.querySelectorAll(vi)],a=n.indexOf(e.target);if(a<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",s=e.key===i?(a+1)%n.length:e.key===l?(a-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(s<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[s]?0:-1;n[s].focus()}},"data-labels":"none"===a?void 0:a,"data-labels-shown":"none"===a?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:/* @__PURE__ */we(yi.Provider,{value:{labels:a,shown:u},children:r})})}function Ni({label:e,icon:t,active:r,disabled:a,onClick:l,badge:i,tooltipSide:o="right",className:s=""}){const c=!0===r,{labels:d,shown:u}=fe(yi),h=void 0===i||!1===i||0===i?t:/* @__PURE__ */we(In,{count:"number"==typeof i?i:void 0,dot:!0===i,max:99,children:t}),m="none"!==d,p=m&&("all"===u||"chosen"===u&&c),g=/* @__PURE__ */we("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:a,onClick:a?void 0:l,className:[`relative inline-flex ${m?"beside"===d?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",c?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",s].filter(Boolean).join(" "),children:m?/* @__PURE__ */ke(Ne,{children:[
512
- /* @__PURE__ */we("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:h}),
513
- /* @__PURE__ */we("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",p?"beside"===d?"ml-1.5":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):h});/* @__PURE__ */
514
- return we(n,{content:e,side:o,children:g})}var Mi=6e4;function $i({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=oe(null);return ue(()=>{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(),o=i&&"object"==typeof i&&"string"==typeof i.version?i.version:null;!l&&o&&o!==e&&a(o)}catch{}};i();const o=setInterval(()=>{i()},r),s=()=>{"visible"===document.visibilityState&&i()};return document.addEventListener("visibilitychange",s),()=>{l=!0,clearInterval(o),document.removeEventListener("visibilitychange",s)}},[e,t,r,n]),n}function Ci({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=$i({currentVersion:e,versionUrl:t,pollMs:r}),o=V();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
515
- return we("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__ */ke(Zn,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */we(L,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
516
- /* @__PURE__ */we("span",{className:"font-medium",children:n??o.update.available}),
517
- /* @__PURE__ */ke("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var Li={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Di={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function ji({onClose:e}){const t=V().dialog;/* @__PURE__ */
518
- return we("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__ */we("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:/* @__PURE__ */we("path",{d:"M6 6l8 8M14 6l-8 8"})})})}function Ai({open:e,onClose:t,side:r="right",size:n="md",title:a,description:l,footer:i,children:o,blocking:s=!1,initialFocus:c,"aria-label":d,"aria-labelledby":u,"aria-describedby":h,className:m=""}){const p=se(null),g=ce(),f=ce(),b=ce();if(K(e),P(p,e,c),S(e),ue(()=>{if(e)return H(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
519
- return ke("div",{className:"fixed inset-0",style:{zIndex:q.overlay},role:"presentation",children:[
520
- /* @__PURE__ */we("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
521
- /* @__PURE__ */ke("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":a?b:u,"aria-label":a||u?void 0:d,"aria-describedby":h??(l?f:o?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${Li[n]}`,Di[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */ke("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
522
- /* @__PURE__ */ke("div",{className:"min-w-0",children:[
523
- /* @__PURE__ */we("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */we("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */we(ji,{onClose:t})]}):!s&&/* @__PURE__ */we("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */we(ji,{onClose:t})}),
524
- /* @__PURE__ */ke("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */we("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */we("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function Pi({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=V().kanban,f=U(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=oe(null),[k,N]=oe(null),M=de(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),$=()=>{w(null),N(null)},C=se(null),L=se(/* @__PURE__ */new Map);ee(()=>{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 s?/* @__PURE__ */we("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */we("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */we("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=M[e.value]??[],r=null!==k&&k.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||k.index!==o&&k.index!==o+1)?k.index:-1;/* @__PURE__ */
525
- return ke("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(r?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:t=>{t.preventDefault(),(e=>{if(v&&k&&k.col===e){const t=(M[e]??[]).findIndex(e=>n(e)===v),r=-1!==t;if(!r||k.index!==t&&k.index!==t+1){const n=r&&k.index>t?k.index-1:k.index;a(v,e,n)}}$()})(e.value)},children:[
526
- /* @__PURE__ */ke("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:[
527
- /* @__PURE__ */ke("span",{className:"flex items-center gap-2",children:[
528
- /* @__PURE__ */we("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
529
- /* @__PURE__ */we("span",{className:"text-xs opacity-70",children:Z(t.length,f)})]}),
530
- /* @__PURE__ */ke("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>N(r=>r&&r.col===e.value&&r.index===t.length?r:{col:e.value,index:t.length}),children:[t.map((r,a)=>{const o=n(r),c=o===v;/* @__PURE__ */
531
- return ke(be,{children:[s===a&&/* @__PURE__ */we("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
532
- /* @__PURE__ */we("div",{"data-kanban-card":o,draggable:!0,onDragStart:e=>{w(o);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:r=>{r.stopPropagation();const l=null!==v?t.findIndex(e=>n(e)===v):-1,i=-1!==l&&l<a?a+1:a;N(t=>t&&t.col===e.value&&t.index===i?t:{col:e.value,index:i})},onDragEnd:$,onClick:i?()=>i(r):void 0,style:null===v?void 0:{opacity:c?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(i?"cursor-pointer":""),children:l(r)})]},o)}),t.length>0&&s===t.length&&/* @__PURE__ */we("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===t.length&&/* @__PURE__ */we("div",{className:"text-[11px] text-center rounded-lg transition-all duration-150 "+(r?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:x})]}),m&&/* @__PURE__ */we("div",{className:"p-2 pt-0",children:/* @__PURE__ */ke("button",{type:"button",onClick:()=>m(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
533
- /* @__PURE__ */we("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),y]})})]},e.value)})})}):/* @__PURE__ */we(Ne,{children:d??/* @__PURE__ */we("div",{className:"text-sm text-gray-500 p-4",children:g.empty})})}var Si="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 zi({page:e,pageCount:t,onPageChange:r,siblingCount:n=1,showEdges:a=!1,className:l=""}){const i=V().pagination,o=U();if(t<=1)return null;const s=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__ */
534
- return ke("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.trim(),children:[a&&/* @__PURE__ */we("button",{type:"button","aria-label":i.first,disabled:1===e,onClick:()=>c(1),className:`${Si} text-gray-600 hover:bg-gray-100`,children:"«"}),
535
- /* @__PURE__ */we("button",{type:"button","aria-label":i.previous,disabled:1===e,onClick:()=>c(e-1),className:`${Si} text-gray-600 hover:bg-gray-100`,children:"‹"}),s.map((t,r)=>"…"===t?/* @__PURE__ */we("span",{className:"px-1 text-gray-400",children:"…"},`gap-${r}`):/* @__PURE__ */we("button",{type:"button","aria-current":t===e?"page":void 0,onClick:()=>c(t),className:`${Si} ${t===e?"bg-blue-600 font-medium text-white":"text-gray-700 hover:bg-gray-100"}`,children:Z(t,o)},t)),
536
- /* @__PURE__ */we("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Si} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */we("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Si} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Fi(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 Bi=e=>Array.isArray(e.columns),Ei=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",Ti="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",Ii={sm:"px-2 py-1.5",md:"px-3 py-2"},Oi={left:"text-left",right:"text-right",center:"text-center"};function Ri({direction:e}){/* @__PURE__ */
537
- return ke("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
538
- /* @__PURE__ */we("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */we("path",{d:"M4 0L8 5H0z"})}),
539
- /* @__PURE__ */we("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */we("path",{d:"M4 5L0 0h8z"})})]})}function Wi({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:g,emptyText:f,selection:b,footer:x,virtualized:y,stackOnNarrow:v=!1,stackBelow:w,className:k=""}){const N=V(),M=f??N.table.empty,$=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),C=v&&!y,L=C?e:e.flatMap(e=>{if(!Bi(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),D=e=>C?{role:e}:{},j=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[A,P]=oe(0),S=y?.overscan??6,z=y?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/y.rowHeight)-S);P(e=>e===t?e:t)}:void 0,F=y?Math.ceil(y.height/y.rowHeight)+2*S:t.length,B=y?Math.min(A,Math.max(0,t.length-F)):0,E=Math.min(t.length,B+F),T=y?B*y.rowHeight:0,I=y?(t.length-E)*y.rowHeight:0,O=se(null),[R,W]=oe(0);ee(()=>{if(!y)return;const e=O.current?.offsetHeight??0;W(t=>t===e?t:e)});const H=e=>e.sortField??e.key,_=e=>n&&n.field===H(e)?n.direction:null,q=L.flatMap(e=>Bi(e)?e.columns:[e]),K=L.some(Bi),U=/* @__PURE__ */new Map;if(C)for(const e of L)if(Bi(e))for(const t of e.columns)U.set(t,j(e.title,e.label));const Y=e=>{const t=j(e.title,e.label),r=U.get(e);return t&&r?`${r} · ${t}`:t},G=new Set(b?.selected??[]),Z=b?t.map((e,t)=>$(e,t)):[],X=Z.length>0&&Z.every(e=>G.has(e)),J=Z.some(e=>G.has(e)),Q=b?36:0,te=q.length+(b?1:0),re=q.some(e=>"left"===e.fixed),ne=C&&!b&&q.some(e=>e.cardCorner),ae=g??"a",le=`${Ii[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t,r,n=0)=>{const l=_(e),i=Oi[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
540
- return we("th",{scope:"col",...D("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":s?"none":void 0,style:{width:e.width,...o?{left:(de[t]??0)+Q}:{},...y?{top:n}:{}},className:[le,i,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-[10px]":"text-xs",o?y?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":y?"sticky z-10 bg-gray-50":"",C&&s?"rosh-dt-sort":"",C?Ei(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:s?/* @__PURE__ */ke("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=H(e),r=_(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?U.get(e):void 0,className:`inline-flex items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[e.title,
541
- /* @__PURE__ */we(Ri,{direction:l})]}):e.title},e.key)};let ce=0;const de=q.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */ke(Ne,{children:[
542
- /* @__PURE__ */ke("div",{onScroll:z,style:y?{maxHeight:y.height}:void 0,className:`relative overflow-x-auto ${y?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${C?" rosh-dt-scroll":""}`.trim(),children:[o&&
543
- /* @__PURE__ */ke("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
544
- /* @__PURE__ */we("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
545
- /* @__PURE__ */we("span",{className:"sr-only",children:N.table.loading})]}),
546
- /* @__PURE__ */ke("table",{...D("table"),className:(C?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */we("caption",{className:"sr-only",children:i}),
547
- /* @__PURE__ */ke("thead",{...D("rowgroup"),className:C?"rosh-dt-head":void 0,children:[
548
- /* @__PURE__ */ke("tr",{ref:O,...D("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */we("th",{scope:"col",...D("columnheader"),rowSpan:K?2:void 0,style:{width:36,...y?{top:0}:{}},className:[le,re||y?"sticky z-20 bg-gray-50":"",re?"left-0":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */we(qe,{"aria-label":N.table.selectAll,checked:X,indeterminate:J&&!X,onChange:()=>{if(!b)return;const e=new Set(Z);b.onChange(X?b.selected.filter(t=>!e.has(t)):[...b.selected,...Z.filter(e=>!G.has(e))])}})}),L.map((e,t)=>Bi(e)?/* @__PURE__ */we("th",{scope:"colgroup",...D("columnheader"),colSpan:e.columns.length,style:y?{top:0}:void 0,className:[le,"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}`):ie(e,q.indexOf(e),K?2:1))]}),K&&/* @__PURE__ */we("tr",{...D("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>Bi(e)?e.columns:[]).map(e=>ie(e,q.indexOf(e),1,R))})]}),
549
- /* @__PURE__ */we("tbody",{...D("rowgroup"),className:C?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */ke(Ne,{children:[T>0&&/* @__PURE__ */we("tr",{"aria-hidden":"true",children:/* @__PURE__ */we("td",{colSpan:te,style:{height:T,padding:0,border:0}})}),t.slice(B,E).map((e,t)=>{const r=B+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[Ti,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */we(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */we("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=q.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=q.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=q.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__ */
550
- return ke("tr",{...Fi(n),...D("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&&!o?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[C?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",C&&ne?"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)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=$(e,r);/* @__PURE__ */
551
- return we("td",{...D("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",C?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */we(qe,{"aria-label":N.table.selectRow,checked:G.has(t),onChange:()=>(e=>{b&&b.onChange(G.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),q.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=C&&!a&&"wide"!==e.only;/* @__PURE__ */
552
- return we("td",{...D("cell"),"data-label":l?Y(e):void 0,style:r?{left:(de[t]??0)+Q}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",C?Ei(e):"",le,Oi[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?
553
- /* @__PURE__ */we("span",{className:e.numeric?"rosh-dt-value font-mono":"rosh-dt-value",children:n}):n},e.key)})]},$(e,r))}),I>0&&/* @__PURE__ */we("tr",{"aria-hidden":"true",children:/* @__PURE__ */we("td",{colSpan:te,style:{height:I,padding:0,border:0}})})]}):/* @__PURE__ */we("tr",{...D("row"),className:C?"rosh-dt-empty":void 0,children:/* @__PURE__ */we("td",{...D("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:M})})})]}),x]}),l&&l.pageCount>1&&/* @__PURE__ */we("div",{className:C?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */we(zi,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
554
- return we("div",C?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${k}`.trim(),children:/* @__PURE__ */we("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */we("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${k}`.trim(),children:ue}:{className:k,children:ue})}function Hi({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=V().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
555
- return ke(Ne,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?` · ${o.loadingMore}`:""]})}function _i({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=V().list;/* @__PURE__ */
556
- return ke("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
557
- /* @__PURE__ */we("svg",{className:"h-10 w-10 text-red-300 mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,"aria-hidden":"true",children:/* @__PURE__ */we("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m0 3.75h.008M10.34 3.94l-8.4 14.55A1.5 1.5 0 003.24 21h17.52a1.5 1.5 0 001.3-2.51l-8.4-14.55a1.5 1.5 0 00-2.6 0z"})}),
558
- /* @__PURE__ */we("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
559
- /* @__PURE__ */we("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */we("div",{className:"mt-4",children:/* @__PURE__ */we(L,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function qi({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
560
- return ke("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */we("path",{d:f,fill:a,stroke:"none"}),
561
- /* @__PURE__ */we("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */we("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}function Ki({data:e,labels:t,height:r=120,color:n="currentColor",colors:a,max:l,gap:i=6,className:o,style:s}){const c=U();if(0===e.length)return null;const d=l??(Math.max(...e,0)||1);/* @__PURE__ */
562
- return ke("div",{className:o,style:s,children:[
563
- /* @__PURE__ */we("div",{className:"flex items-end",style:{height:r,gap:i},children:e.map((e,r)=>/* @__PURE__ */we("div",{className:"flex flex-1 flex-col justify-end",style:{height:"100%"},children:/* @__PURE__ */we("div",{className:"w-full rounded-t",style:{height:`${Math.max(0,e/d*100)}%`,minHeight:e>0?2:0,backgroundColor:a?.[r]??n},title:null!=t?.[r]?`${t[r]}: ${Z(e,c)}`:Z(e,c)})},r))}),t&&/* @__PURE__ */we("div",{className:"mt-1 flex",style:{gap:i},children:t.map((e,t)=>/* @__PURE__ */we("div",{className:"flex-1 truncate text-center text-[10px] text-gray-400",children:e},t))})]})}var Ui=["var(--rosh-donut-1)","var(--rosh-donut-2)","var(--rosh-donut-3)","var(--rosh-donut-4)","var(--rosh-donut-5)","var(--rosh-donut-6)","var(--rosh-donut-7)","var(--rosh-donut-8)"];function Vi({segments:e,size:t=120,thickness:r=16,centerLabel:n,className:a,style:l}){const i=e.reduce((e,t)=>e+Math.max(0,t.value),0)||1,o=(t-r)/2,s=t/2,c=2*Math.PI*o;let d=0;/* @__PURE__ */
564
- return ke("div",{className:`relative inline-flex items-center justify-center ${a??""}`.trim(),style:{width:t,height:t,...l},children:[
565
- /* @__PURE__ */ke("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-hidden":"true",style:{transform:"rotate(-90deg)"},children:[
566
- /* @__PURE__ */we("circle",{cx:s,cy:s,r:o,fill:"none",stroke:"var(--rosh-donut-track)",strokeWidth:r}),e.map((e,t)=>{const n=Math.max(0,e.value)/i*c,a=/* @__PURE__ */we("circle",{cx:s,cy:s,r:o,fill:"none",stroke:e.color??Ui[t%Ui.length],strokeWidth:r,strokeDasharray:`${n} ${c-n}`,strokeDashoffset:-d},t);return d+=n,a})]}),null!=n&&/* @__PURE__ */we("div",{className:"absolute text-center text-sm font-semibold text-gray-900",children:n})]})}var Yi=(e,t)=>Number.isInteger(e)?Z(e,t):X(e,1,t);function Gi({series:e,labels:t,height:r=160,strokeWidth:n=2,showDots:a=!1,max:l,min:i,showScale:o=!1,showLegend:s=!1,className:c,style:d}){const u=U(),h=e.filter(e=>e.data.length>0);if(0===h.length)return null;const m=h.flatMap(e=>e.data),p=l??Math.max(...m),g=i??Math.min(...m),f=p-g||1,b=e=>e.color??"currentColor";/* @__PURE__ */
567
- return ke("div",{className:c,style:d,children:[s&&h.some(e=>e.label)&&/* @__PURE__ */we("div",{className:"mb-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5",children:h.map((e,t)=>e.label&&/* @__PURE__ */ke("span",{className:"flex items-center gap-1 text-xs text-gray-500",children:[
568
- /* @__PURE__ */we("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:b(e)}}),e.label]},t))}),
569
- /* @__PURE__ */ke("div",{className:"flex",children:[o&&/* @__PURE__ */ke("div",{className:"flex flex-col justify-between pr-1.5 text-right text-[10px] leading-none text-gray-400",style:{height:r},children:[
570
- /* @__PURE__ */we("span",{children:Yi(p,u)}),
571
- /* @__PURE__ */we("span",{children:Yi(g+f/2,u)}),
572
- /* @__PURE__ */we("span",{children:Yi(g,u)})]}),
573
- /* @__PURE__ */ke("svg",{className:"min-w-0 flex-1",width:"100%",height:r,viewBox:"0 0 100 100",preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[o&&[0,50,100].map(e=>/* @__PURE__ */we("line",{x1:0,y1:e,x2:100,y2:e,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1,vectorEffect:"non-scaling-stroke"},e)),h.map((e,r)=>{const l=function(e,t,r){return 1===e.length?[[0,100-(e[0]-t)/r*100],[100,100-(e[0]-t)/r*100]]:e.map((n,a)=>[100*a/(e.length-1),100-(n-t)/r*100])}(e.data,g,f),i=function(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")}(l);/* @__PURE__ */
574
- return ke("g",{children:[e.fill&&/* @__PURE__ */we("path",{d:`${i} L100,100 L0,100 Z`,fill:e.fill,stroke:"none"}),
575
- /* @__PURE__ */we("path",{d:i,fill:"none",stroke:b(e),strokeWidth:n,strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),a&&e.data.length>1&&l.map(([r,a],l)=>/* @__PURE__ */we("path",{d:`M${r.toFixed(2)},${a.toFixed(2)} h0.01`,stroke:b(e),strokeWidth:2.5*n,strokeLinecap:"round",vectorEffect:"non-scaling-stroke",children:/* @__PURE__ */we("title",{children:`${null!=t?.[l]?`${t[l]}: `:""}${e.label?`${e.label} `:""}${Z(e.data[l],u)}`})},l))]},r)})]})]}),t&&/* @__PURE__ */we("div",{className:"mt-1 flex justify-between "+(o?"pl-6":""),children:t.map((e,t)=>/* @__PURE__ */we("div",{className:"truncate text-[10px] text-gray-400",children:e},t))})]})}var Zi={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},Xi=[12,18,14,22,19,27,24,31,28,35,30,38],Ji=["J","F","M","A","M","J","J","A","S","O","N","D"],Qi=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function eo(){/* @__PURE__ */
576
- return we(ca,{groups:Zi,children:/* @__PURE__ */we("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ke("div",{className:"mx-auto max-w-6xl space-y-6",children:[
577
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-4",children:[
578
- /* @__PURE__ */ke("div",{children:[
579
- /* @__PURE__ */we("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
580
- /* @__PURE__ */we("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
581
- /* @__PURE__ */ke("div",{className:"flex items-center gap-2",children:[
582
- /* @__PURE__ */we(L,{variant:"secondary",size:"sm",children:"Export"}),
583
- /* @__PURE__ */we(L,{size:"sm",children:"New report"})]})]}),
584
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
585
- /* @__PURE__ */we(cn,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
586
- /* @__PURE__ */we(cn,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
587
- /* @__PURE__ */we(cn,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
588
- /* @__PURE__ */we(cn,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
589
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
590
- /* @__PURE__ */we(sn,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */we("div",{className:"text-blue-600",children:/* @__PURE__ */we(Ki,{data:Xi,labels:Ji,height:160})})}),
591
- /* @__PURE__ */we(sn,{header:"Traffic sources",children:/* @__PURE__ */ke("div",{className:"flex items-center gap-4",children:[
592
- /* @__PURE__ */we(Vi,{size:120,segments:[{label:"Direct",value:45},{label:"Search",value:30},{label:"Social",value:15},{label:"Email",value:10}],centerLabel:/* @__PURE__ */we("span",{className:"text-gray-900",children:"100%"})}),
593
- /* @__PURE__ */ke("ul",{className:"space-y-1.5 text-sm text-gray-600",children:[
594
- /* @__PURE__ */ke("li",{className:"flex items-center gap-2",children:[
595
- /* @__PURE__ */we(to,{c:Ui[0]}),"Direct · 45%"]}),
596
- /* @__PURE__ */ke("li",{className:"flex items-center gap-2",children:[
597
- /* @__PURE__ */we(to,{c:Ui[1]}),"Search · 30%"]}),
598
- /* @__PURE__ */ke("li",{className:"flex items-center gap-2",children:[
599
- /* @__PURE__ */we(to,{c:Ui[2]}),"Social · 15%"]}),
600
- /* @__PURE__ */ke("li",{className:"flex items-center gap-2",children:[
601
- /* @__PURE__ */we(to,{c:Ui[3]}),"Email · 10%"]})]})]})})]}),
602
- /* @__PURE__ */we(sn,{header:"Recent orders",padded:!1,children:/* @__PURE__ */ke("table",{className:"w-full text-sm",children:[
603
- /* @__PURE__ */we("thead",{children:/* @__PURE__ */ke("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
604
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Order"}),
605
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Customer"}),
606
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Total"}),
607
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Status"})]})}),
608
- /* @__PURE__ */we("tbody",{className:"divide-y divide-gray-100",children:Qi.map(e=>/* @__PURE__ */ke("tr",{className:"text-gray-700",children:[
609
- /* @__PURE__ */we("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
610
- /* @__PURE__ */we("td",{className:"px-4 py-2",children:/* @__PURE__ */ke("span",{className:"flex items-center gap-2",children:[
611
- /* @__PURE__ */we(Kn,{size:"xs",name:e.customer}),e.customer]})}),
612
- /* @__PURE__ */we("td",{className:"px-4 py-2",children:e.total}),
613
- /* @__PURE__ */we("td",{className:"px-4 py-2",children:/* @__PURE__ */we(da,{status:e.status})})]},e.id))})]})}),
614
- /* @__PURE__ */ke("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
615
- /* @__PURE__ */we("span",{className:"text-emerald-600",children:/* @__PURE__ */we(qi,{data:Xi,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}function to({c:e}){/* @__PURE__ */
616
- return we("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:e}})}var ro={active:"success",invited:"queued",suspended:"danger",pending:"pending"},no=[{name:"Alice Nguyen",email:"alice@acme.co",role:"Admin",status:"active"},{name:"Marco Reyes",email:"marco@acme.co",role:"Editor",status:"invited"},{name:"Priya Patel",email:"priya@acme.co",role:"Editor",status:"active"},{name:"Tom Becker",email:"tom@acme.co",role:"Viewer",status:"suspended"},{name:"Sara Lind",email:"sara@acme.co",role:"Viewer",status:"pending"},{name:"Yuki Tanaka",email:"yuki@acme.co",role:"Editor",status:"active"}];function ao(){const[e,t]=oe(1),[r,n]=oe(""),[a,l]=oe("");/* @__PURE__ */
617
- return we(ca,{groups:ro,children:/* @__PURE__ */we("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ke("div",{className:"mx-auto max-w-5xl space-y-4",children:[
618
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-4",children:[
619
- /* @__PURE__ */we("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
620
- /* @__PURE__ */we(L,{size:"sm",children:"Invite member"})]}),
621
- /* @__PURE__ */ke(sn,{padded:!1,children:[
622
- /* @__PURE__ */ke("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
623
- /* @__PURE__ */we("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */we(Se,{value:a,onChange:e=>l(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */we(lo,{})})}),
624
- /* @__PURE__ */we("div",{className:"w-40",children:/* @__PURE__ */we(He,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
625
- /* @__PURE__ */we(L,{variant:"secondary",size:"sm",children:"Filter"})]}),
626
- /* @__PURE__ */ke("table",{className:"w-full text-sm",children:[
627
- /* @__PURE__ */we("thead",{children:/* @__PURE__ */ke("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
628
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Name"}),
629
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Role"}),
630
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium",children:"Status"}),
631
- /* @__PURE__ */we("th",{className:"px-4 py-2 font-medium text-right",children:"Actions"})]})}),
632
- /* @__PURE__ */we("tbody",{className:"divide-y divide-gray-100",children:no.map(e=>/* @__PURE__ */ke("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
633
- /* @__PURE__ */ke("td",{className:"px-4 py-2.5",children:[
634
- /* @__PURE__ */we("div",{className:"font-medium text-gray-900",children:e.name}),
635
- /* @__PURE__ */we("div",{className:"text-xs text-gray-400",children:e.email})]}),
636
- /* @__PURE__ */we("td",{className:"px-4 py-2.5",children:e.role}),
637
- /* @__PURE__ */we("td",{className:"px-4 py-2.5",children:/* @__PURE__ */we(da,{status:e.status})}),
638
- /* @__PURE__ */we("td",{className:"px-4 py-2.5 text-right",children:/* @__PURE__ */we(L,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
639
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
640
- /* @__PURE__ */we("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
641
- /* @__PURE__ */we(zi,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function lo(){/* @__PURE__ */
642
- return ke("svg",{className:"h-4 w-4",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[
643
- /* @__PURE__ */we("circle",{cx:"9",cy:"9",r:"6"}),
644
- /* @__PURE__ */we("path",{d:"M14 14l3 3",strokeLinecap:"round"})]})}function io(){const[e,t]=oe("pro"),[r,n]=oe(!0),[a,l]=oe("us");/* @__PURE__ */
645
- return we("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ke("form",{className:"mx-auto max-w-2xl space-y-5",onSubmit:e=>e.preventDefault(),children:[
646
- /* @__PURE__ */ke("div",{children:[
647
- /* @__PURE__ */we("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
648
- /* @__PURE__ */we("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
649
- /* @__PURE__ */we(sn,{header:"Profile",children:/* @__PURE__ */ke("div",{className:"space-y-4",children:[
650
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
651
- /* @__PURE__ */we(Ve,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */we(Se,{id:"fn",defaultValue:"Alice"})}),
652
- /* @__PURE__ */we(Ve,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */we(Se,{id:"ln",defaultValue:"Nguyen"})})]}),
653
- /* @__PURE__ */we(Ve,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */we(Se,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
654
- /* @__PURE__ */we(Ve,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */we(ze,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
655
- /* @__PURE__ */we(sn,{header:"Preferences",children:/* @__PURE__ */ke("div",{className:"space-y-4",children:[
656
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
657
- /* @__PURE__ */we(Ve,{label:"Country",htmlFor:"country",children:/* @__PURE__ */we(He,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
658
- /* @__PURE__ */we(Ve,{label:"Plan",children:/* @__PURE__ */ke("div",{className:"space-y-1.5 pt-1",children:[
659
- /* @__PURE__ */we(Ue,{name:"plan",checked:"free"===e,onChange:()=>t("free"),label:"Free"}),
660
- /* @__PURE__ */we(Ue,{name:"plan",checked:"pro"===e,onChange:()=>t("pro"),label:"Pro"}),
661
- /* @__PURE__ */we(Ue,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
662
- /* @__PURE__ */we(qe,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
663
- /* @__PURE__ */ke("div",{className:"flex items-center justify-end gap-2",children:[
664
- /* @__PURE__ */we(L,{variant:"secondary",children:"Cancel"}),
665
- /* @__PURE__ */we(L,{type:"submit",children:"Save changes"})]})]})})}var oo=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function so(){const[e,t]=oe(!0),[r,n]=oe("us"),a=oo.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
666
- return we("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ke("div",{className:"mx-auto max-w-5xl space-y-5",children:[
667
- /* @__PURE__ */we("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
668
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
669
- /* @__PURE__ */ke("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
670
- /* @__PURE__ */we(sn,{header:"Contact",children:/* @__PURE__ */we("div",{className:"space-y-4",children:/* @__PURE__ */we(Ve,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */we(Se,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
671
- /* @__PURE__ */we(sn,{header:"Shipping address",children:/* @__PURE__ */ke("div",{className:"space-y-4",children:[
672
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
673
- /* @__PURE__ */we(Ve,{label:"First name",required:!0,children:/* @__PURE__ */we(Se,{placeholder:"Alice"})}),
674
- /* @__PURE__ */we(Ve,{label:"Last name",required:!0,children:/* @__PURE__ */we(Se,{placeholder:"Nguyen"})})]}),
675
- /* @__PURE__ */we(Ve,{label:"Address",required:!0,children:/* @__PURE__ */we(Se,{placeholder:"123 Market St"})}),
676
- /* @__PURE__ */ke("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
677
- /* @__PURE__ */we(Ve,{label:"City",children:/* @__PURE__ */we(Se,{placeholder:"San Francisco"})}),
678
- /* @__PURE__ */we(Ve,{label:"ZIP",children:/* @__PURE__ */we(Se,{placeholder:"94103"})}),
679
- /* @__PURE__ */we(Ve,{label:"Country",children:/* @__PURE__ */we(He,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
680
- /* @__PURE__ */we(qe,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
681
- /* @__PURE__ */we(sn,{header:"Payment",children:/* @__PURE__ */ke("div",{className:"space-y-4",children:[
682
- /* @__PURE__ */we(Ve,{label:"Card number",required:!0,children:/* @__PURE__ */we(Se,{placeholder:"1234 5678 9012 3456"})}),
683
- /* @__PURE__ */ke("div",{className:"grid grid-cols-2 gap-4",children:[
684
- /* @__PURE__ */we(Ve,{label:"Expiry",required:!0,children:/* @__PURE__ */we(Se,{placeholder:"MM / YY"})}),
685
- /* @__PURE__ */we(Ve,{label:"CVC",required:!0,children:/* @__PURE__ */we(Se,{placeholder:"123"})})]})]})})]}),
686
- /* @__PURE__ */ke("div",{className:"space-y-4",children:[
687
- /* @__PURE__ */ke(sn,{header:"Order summary",children:[
688
- /* @__PURE__ */we("ul",{className:"space-y-2 text-sm",children:oo.map(e=>/* @__PURE__ */ke("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
689
- /* @__PURE__ */ke("span",{children:[e.name," ",
690
- /* @__PURE__ */ke("span",{className:"text-gray-400",children:["×",e.qty]})]}),
691
- /* @__PURE__ */ke("span",{children:["$",e.qty*e.price]})]},e.name))}),
692
- /* @__PURE__ */ke("div",{className:"mt-3 space-y-1.5 border-t border-gray-100 pt-3 text-sm text-gray-600",children:[
693
- /* @__PURE__ */ke("div",{className:"flex justify-between",children:[
694
- /* @__PURE__ */we("span",{children:"Subtotal"}),
695
- /* @__PURE__ */ke("span",{children:["$",a]})]}),
696
- /* @__PURE__ */ke("div",{className:"flex justify-between",children:[
697
- /* @__PURE__ */we("span",{children:"Shipping"}),
698
- /* @__PURE__ */ke("span",{children:["$",9]})]}),
699
- /* @__PURE__ */ke("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
700
- /* @__PURE__ */we("span",{children:"Total"}),
701
- /* @__PURE__ */ke("span",{children:["$",l]})]})]}),
702
- /* @__PURE__ */ke(L,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
703
- /* @__PURE__ */we(Zn,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var co=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],uo=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function ho(){const[e,t]=oe(1),r=uo.find(t=>t.id===e)??uo[0];/* @__PURE__ */
704
- return we("div",{className:"h-full",children:/* @__PURE__ */we(d,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */ke("div",{className:"flex h-full flex-col p-2",children:[
705
- /* @__PURE__ */we(L,{block:!0,className:"mb-2",children:"Compose"}),co.map((e,t)=>/* @__PURE__ */ke("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
706
- /* @__PURE__ */we("span",{children:e.label}),null!=e.count&&/* @__PURE__ */we("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */ke("div",{className:"flex h-full",children:[
707
- /* @__PURE__ */we("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:uo.map(r=>/* @__PURE__ */ke("button",{onClick:()=>t(r.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
708
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-2",children:[
709
- /* @__PURE__ */we("span",{className:"truncate text-sm "+(r.unread?"font-semibold text-gray-900":"text-gray-700"),children:r.from}),
710
- /* @__PURE__ */we("span",{className:"shrink-0 text-[11px] text-gray-400",children:r.time})]}),
711
- /* @__PURE__ */we("div",{className:"truncate text-sm "+(r.unread?"text-gray-800":"text-gray-600"),children:r.subject}),
712
- /* @__PURE__ */we("div",{className:"truncate text-xs text-gray-400",children:r.preview})]},r.id))}),
713
- /* @__PURE__ */ke("div",{className:"flex min-w-0 flex-1 flex-col overflow-auto",children:[
714
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
715
- /* @__PURE__ */we("h2",{className:"truncate text-base font-semibold text-gray-900",children:r.subject}),
716
- /* @__PURE__ */ke("div",{className:"flex shrink-0 gap-1.5",children:[
717
- /* @__PURE__ */we(L,{variant:"ghost",size:"sm",children:"Archive"}),
718
- /* @__PURE__ */we(L,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
719
- /* @__PURE__ */ke("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
720
- /* @__PURE__ */we(Kn,{name:r.from}),
721
- /* @__PURE__ */ke("div",{className:"min-w-0",children:[
722
- /* @__PURE__ */we("div",{className:"text-sm font-medium text-gray-900",children:r.from}),
723
- /* @__PURE__ */ke("div",{className:"text-xs text-gray-400",children:["to me · ",r.time]})]})]}),
724
- /* @__PURE__ */ke("div",{className:"space-y-3 p-4 text-sm leading-relaxed text-gray-700",children:[
725
- /* @__PURE__ */we("p",{children:"Hi,"}),
726
- /* @__PURE__ */ke("p",{children:[r.preview," The full details are attached — happy to walk through anything on a quick call."]}),
727
- /* @__PURE__ */ke("p",{children:["Best,",
728
- /* @__PURE__ */we("br",{}),r.from]})]})]})]})})})}var mo=[{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"}],po=[{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 go(){const[e,t]=oe(1),r=mo.find(t=>t.id===e)??mo[0];/* @__PURE__ */
729
- return we("div",{className:"h-full",children:/* @__PURE__ */we(d,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */we("div",{className:"h-full overflow-auto",children:mo.map(r=>/* @__PURE__ */ke("button",{onClick:()=>t(r.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(r.id===e?"bg-blue-50/50":""),children:[
730
- /* @__PURE__ */we(Kn,{name:r.name,status:r.status}),
731
- /* @__PURE__ */ke("div",{className:"min-w-0 flex-1",children:[
732
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-2",children:[
733
- /* @__PURE__ */we("span",{className:"truncate text-sm font-medium text-gray-900",children:r.name}),
734
- /* @__PURE__ */we("span",{className:"shrink-0 text-[11px] text-gray-400",children:r.time})]}),
735
- /* @__PURE__ */we("div",{className:"truncate text-xs text-gray-500",children:r.last})]})]},r.id))}),children:/* @__PURE__ */ke("div",{className:"flex h-full flex-col",children:[
736
- /* @__PURE__ */ke("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
737
- /* @__PURE__ */we(Kn,{name:r.name,status:r.status,size:"sm"}),
738
- /* @__PURE__ */ke("div",{children:[
739
- /* @__PURE__ */we("div",{className:"text-sm font-medium text-gray-900",children:r.name}),
740
- /* @__PURE__ */we("div",{className:"text-xs text-gray-400 capitalize",children:r.status})]})]}),
741
- /* @__PURE__ */we("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:po.map((e,t)=>/* @__PURE__ */we("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */we("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))}),
742
- /* @__PURE__ */ke("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
743
- /* @__PURE__ */we("div",{className:"flex-1",children:/* @__PURE__ */we(Se,{placeholder:"Type a message…"})}),
744
- /* @__PURE__ */we(L,{type:"submit",children:"Send"})]})]})})})}var fo={featured:"success",new:"active",draft:"draft"},bo=["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 xo(){const[e,t]=oe("all"),r="all"===e?bo:bo.filter(t=>t.tag===e);/* @__PURE__ */
745
- return we(ca,{groups:fo,children:/* @__PURE__ */we("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ke("div",{className:"mx-auto max-w-5xl space-y-4",children:[
746
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-4",children:[
747
- /* @__PURE__ */we("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
748
- /* @__PURE__ */we(L,{size:"sm",children:"Upload"})]}),
749
- /* @__PURE__ */we(ta,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
750
- /* @__PURE__ */we("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */ke(sn,{padded:!1,className:"overflow-hidden",children:[
751
- /* @__PURE__ */we("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */we("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */we(da,{status:e.tag})})}),
752
- /* @__PURE__ */ke("div",{className:"flex items-center justify-between gap-2 p-3",children:[
753
- /* @__PURE__ */we("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
754
- /* @__PURE__ */we("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var yo={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function vo({mode:e="login"}){const[t,r]=oe(!0),n=yo[e];/* @__PURE__ */
755
- return we("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */ke("div",{className:"w-full max-w-sm",children:[
756
- /* @__PURE__ */ke("div",{className:"mb-6 text-center",children:[
757
- /* @__PURE__ */we("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
758
- /* @__PURE__ */we("h1",{className:"text-lg font-semibold text-gray-900",children:n.title}),
759
- /* @__PURE__ */we("p",{className:"text-sm text-gray-500",children:n.subtitle})]}),
760
- /* @__PURE__ */we(sn,{children:/* @__PURE__ */ke("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */we(Ve,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */we(Se,{id:"au-name",placeholder:"Alice Nguyen"})}),
761
- /* @__PURE__ */we(Ve,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */we(Se,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */we(Ve,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */we(Se,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */ke("div",{className:"flex items-center justify-between",children:[
762
- /* @__PURE__ */we(qe,{checked:t,onChange:r,label:"Remember me"}),
763
- /* @__PURE__ */we("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
764
- /* @__PURE__ */we(L,{type:"submit",block:!0,children:n.cta})]})}),
765
- /* @__PURE__ */we("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */ke(Ne,"register"===e?{children:["Already have an account? ",
766
- /* @__PURE__ */we("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
767
- /* @__PURE__ */we("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var wo={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function ko({code:e=404,actions:t}){const r=wo[e](V().errors);/* @__PURE__ */
768
- return ke("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
769
- /* @__PURE__ */we("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
770
- /* @__PURE__ */we("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
771
- /* @__PURE__ */we("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */we("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function No({pick:e}){/* @__PURE__ */
772
- return we(Ne,{children:e(V().errors)})}var Mo=class extends xe{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
773
- /* @__PURE__ */ke("div",{className:"flex h-full flex-col",children:[
774
- /* @__PURE__ */we("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */we(ko,{code:500,actions:/* @__PURE__ */ke(Ne,{children:[
775
- /* @__PURE__ */we(L,{onClick:this.reset,children:/* @__PURE__ */we(No,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */ke("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
776
- /* @__PURE__ */we("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */we(No,{pick:e=>e.details})}),
777
- /* @__PURE__ */we("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 $o(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Co(e){const t=$o();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function Lo(){return $o()?.matches??!1}function Do(){return!1}function jo(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,o=0;const s=(a+l)/2;if(a!==l){const e=a-l;o=s>.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*o,100*s]}function Ao(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 Po(e){const t=e||"system";return"system"===t?Lo()?"dark":"light":t}function So(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=jo(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Ao(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Ao(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Ao(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Ao(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Ao(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Ao(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Ao(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 zo(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]=jo(a);l.style.setProperty("--custom-button-hover",Ao(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}function Fo(e){document.documentElement.setAttribute("data-theme",Po(e.theme)),So(e.accent_color??null),zo(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 Bo(){const{prefs:e}=g(),t=ye(Co,Lo,Do),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,s="system"===r?t?"dark":"light":r;return ue(()=>(document.documentElement.setAttribute("data-theme",s),()=>document.documentElement.removeAttribute("data-theme")),[s]),ue(()=>{So(n)},[n]),ue(()=>{zo(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:s}}function Eo({label:e="Not available"}){/* @__PURE__ */
778
- return we("span",{className:"text-gray-400",role:"img","aria-label":e,children:k})}function To({value:e,precise:t,className:r}){const n=N(e);if(!n)/* @__PURE__ */return we(Eo,{});const a="string"==typeof e?e:n.toISOString();/* @__PURE__ */
779
- return we("time",{dateTime:a,title:$(a),className:r,children:M(n,{precise:t})})}function Io(e,t=300){const[r,n]=oe(e);return ue(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function Oo(e,t){ue(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}var Ro=8,Wo=["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)"],Ho={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},_o={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function qo(e){return Wo[e]??_o.muted}function Ko(e,t,r){return t||(r?Ho[r]:qo(e))}function Uo(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 Vo(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 Yo(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 Go(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 Zo(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),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=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)},s}function Xo(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 Jo(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 Qo(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 es=e=>e.toFixed(2);function ts(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${es(e)},${es(t)}`).join(" ")}function rs(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${es(e.start)},${es(e.y)}`,t+=` L${es(e.end)},${es(e.y)}`}),t}function ns(e){if(e.length<3)return ts(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${es(e[0][0])},${es(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${es(e[n][0]+t)},${es(e[n][1]+a[n]*t)} ${es(e[n+1][0]-t)},${es(e[n+1][1]-a[n+1]*t)} ${es(e[n+1][0])},${es(e[n+1][1])}`}return l}function as(e,t=0){if(e.length<3)return ts(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 o=`M${es(e[0][0])},${es(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],s=e[t+2]??a,c=n[0]+(a[0]-r[0])*i,d=l(n[1]+(a[1]-r[1])*i),u=a[0]-(s[0]-n[0])*i,h=l(a[1]-(s[1]-n[1])*i);o+=` C${es(c)},${es(d)} ${es(u)},${es(h)} ${es(a[0])},${es(a[1])}`}return o}function ls(e){if(e.length<2)return ts(e);let t=`M${es(e[0][0])},${es(e[0][1])}`;for(let r=1;r<e.length;r+=1){const[n,a]=e[r-1],[l,i]=e[r],o=(n+l)/2;t+=` C${es(o)},${es(a)} ${es(o)},${es(i)} ${es(l)},${es(i)}`}return t}function is(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${es(e[0][0])},${es(e[0][1])}`:"monotone"===t?ns(e):"spline"===t?as(e,r):"bump"===t?ls(e):ts(e)}function os(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${es(a[0])},${es(r)} L${es(n[0])},${es(r)} Z`}function ss(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${es(e)},${es(t)}`).join(" L")} Z`}function cs(e,t,r,n,a=-Math.PI/2){return Array.from({length:n},(l,i)=>{const o=a+2*i*Math.PI/n;return[e+r*Math.cos(o),t+r*Math.sin(o)]})}function ds(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${ds(e,t,r,n,a,l)} ${ds(e,t,r,n,l,a+2*Math.PI)}`}const o=Math.abs(i)>Math.PI?1:0,s=(r,n)=>[e+r*Math.cos(n),t+r*Math.sin(n)],[c,d]=s(n,a),[u,h]=s(n,l);if(r<=0)return`M${es(e)},${es(t)} L${es(c)},${es(d)} A${es(n)},${es(n)} 0 ${o} 1 ${es(u)},${es(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${es(c)},${es(d)} A${es(n)},${es(n)} 0 ${o} 1 ${es(u)},${es(h)} L${es(m)},${es(p)} A${es(r)},${es(r)} 0 ${o} 0 ${es(g)},${es(f)} Z`}function us(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 hs(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 o=t>0?e.value/t*a:0,s=n?{...e,x:r.x,y:r.y+i,width:l,height:o}:{...e,x:r.x+i,y:r.y,width:o,height:l};return i+=o,s}),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 ms(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 o={x:0,y:0,width:t,height:r},s=[],c=0,d=[...n.map(e=>({...e,value:e.value/a*l}))];for(;d.length>0;){const e=d[0],t=Math.min(o.width,o.height),r=o.width>=o.height,n=us(s.map(e=>e.value),c,t),a=us([...s.map(e=>e.value),e.value],c+e.value,t);if(0===s.length||a<=n)s.push(e),c+=e.value,d=d.slice(1);else{const e=hs(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...hs(s,c,o,o.width>=o.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=he({highlighted:null,setHighlighted:()=>{}});function gs({children:e}){const[t,r]=oe(null),n=de(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
780
- return we(ps.Provider,{value:n,children:e})}function fs(){return fe(ps)}function bs(e,t,r=.22){return null===t?null:t===e?1:r}function xs(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 ys(e,t=720){const[r,n]=oe(t);return ue(()=>{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 vs({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,className:c,emptyLabel:d}){const u=V().charts,h=U(),m=r??(e=>Z(e,h)),p=d??u.nothingToRank;if(0===e.length)/* @__PURE__ */
781
- return we("p",{className:`text-sm text-gray-500 ${c??""}`,children:p});const g=xs(e.map(e=>e.value),a),f=n??(null===g?void 0:e[g]?.key),b=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),x=qo(0);/* @__PURE__ */
782
- return we("ol",{className:`m-0 list-none p-0 ${c??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===f,n=r?l?Ho[l]:qo(1):f?_o.muted:x,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&b>0?Math.max(0,Math.min(1,a/b)):0;/* @__PURE__ */
783
- return ke("li",{className:"grid gap-1",children:[
784
- /* @__PURE__ */ke("div",{className:"flex items-baseline justify-between gap-3",children:[
785
- /* @__PURE__ */ke("span",{className:"truncate font-mono text-xs text-gray-600 "+(r?"font-semibold":""),title:e.label,children:[e.label,r&&/* @__PURE__ */we("span",{className:"sr-only",children:` ${u.emphasised}`})]}),
786
- /* @__PURE__ */we("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":m(a)})]}),
787
- /* @__PURE__ */we("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */we("div",{className:`rounded-sm ${s?Wa.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?Ha(t):{}}})})]},e.key)})})}var ws=e=>Math.max(0,Math.min(1,e));function ks({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=V().charts,d=U(),u=l??(e=>J(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
788
- return ke("div",{className:o,children:[n&&/* @__PURE__ */we("p",{className:"text-sm font-medium text-gray-700",children:n}),
789
- /* @__PURE__ */we("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=ws(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Ho[g],b=[t?.length?t.map(e=>`${e.label} ${u(e.value)}`).join(" · "):"",a??"",null!=r?(p?c.objectiveMet:c.objectiveMissed)(u(r)):""].filter(Boolean).join(" · ");/* @__PURE__ */
790
- return ke("div",{className:o,children:[
791
- /* @__PURE__ */ke("div",{className:"mb-1.5 flex items-baseline justify-between gap-3",children:[
792
- /* @__PURE__ */we("span",{className:"text-sm font-medium text-gray-700",children:n}),
793
- /* @__PURE__ */we("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
794
- /* @__PURE__ */ke("div",{className:"relative w-full rounded-full bg-gray-200",style:{height:12},role:"meter","aria-valuenow":Number((100*m).toFixed(2)),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":u(e),"aria-label":n,children:[
795
- /* @__PURE__ */we("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */we("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*ws(e.value)).toFixed(2)}%`,backgroundColor:Ho[e.tone??(0===r?g:"neutral")]}},`${e.label}-${r}`))}:{className:"h-full rounded-full",style:{width:`${(100*m).toFixed(2)}%`,backgroundColor:f}}),null!=r&&/* @__PURE__ */we("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*ws(r)).toFixed(2)}%`,height:20,backgroundColor:_o.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */we("p",{className:"mt-1.5 text-xs text-gray-500",children:b})]})}var Ns={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function Ms({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=V().charts,d=U(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?Ho[a]:void 0,m=i?Ho[i]:Ko(0);/* @__PURE__ */
796
- return ke("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
797
- /* @__PURE__ */we("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
798
- /* @__PURE__ */ke("span",{className:"flex items-baseline gap-1.5",children:[
799
- /* @__PURE__ */we("span",{className:"text-2xl font-semibold leading-tight text-gray-900",children:t}),r&&/* @__PURE__ */we("span",{className:"text-sm font-medium text-gray-500",children:r})]}),u&&/* @__PURE__ */ke("span",{className:"text-xs font-medium",style:h?{color:h}:void 0,children:[
800
- /* @__PURE__ */we("span",{"aria-hidden":"true",children:Ns[u].glyph})," ",Z(Math.abs(n),d),
801
- /* @__PURE__ */ke("span",{className:"sr-only",children:[" ",c[Ns[u].word]]})]}),l&&l.length>1&&/* @__PURE__ */we(qi,{data:l,height:26,stroke:m,strokeWidth:2,className:"mt-1.5 w-full"}),o&&/* @__PURE__ */we("span",{className:"mt-1 text-xs text-gray-500",children:o})]})}function $s({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=V().charts,o=a??i.loading,s=`${ce()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
802
- return we("div",{className:l,children:/* @__PURE__ */ke("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
803
- /* @__PURE__ */we("defs",{children:/* @__PURE__ */ke("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
804
- /* @__PURE__ */we("stop",{offset:"0%",stopColor:_o.surface,stopOpacity:"0"}),
805
- /* @__PURE__ */we("stop",{offset:"45%",stopColor:_o.surface,stopOpacity:"0.55"}),
806
- /* @__PURE__ */we("stop",{offset:"55%",stopColor:_o.surface,stopOpacity:"0.55"}),
807
- /* @__PURE__ */we("stop",{offset:"100%",stopColor:_o.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
808
- return we("line",{x1:c,y1:r,x2:d,y2:r,stroke:_o.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */we("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:_o.grid},`t${t}`)),"bars"===r?Array.from({length:n},(e,t)=>{const r=(d-c)/n,a=.35+.4*Math.abs(Math.sin(1.1*(t+1))),l=(h-u)*a;/* @__PURE__ */
809
- return we("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:_o.grid},t)}):/* @__PURE__ */we("path",{d:`M48,${h} C${c+.25*(d-c)},${u+.35*(h-u)} ${c+.55*(d-c)},${u+.15*(h-u)} ${d},${u+.55*(h-u)} L${d},${h} Z`,fill:_o.grid}),
810
- /* @__PURE__ */we("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}function Cs({shape:e,colour:t}){const r="shrink-0";switch(e){case"circle":/* @__PURE__ */
811
- return we("span",{className:`${r} h-2.5 w-2.5 rounded-full`,style:{backgroundColor:t}});case"circle-outline":/* @__PURE__ */
812
- return we("span",{className:`${r} h-2.5 w-2.5 rounded-full border-2`,style:{borderColor:t}});case"rounded-square-outline":/* @__PURE__ */
813
- return we("span",{className:`${r} h-2.5 w-2.5 rounded-sm border-2`,style:{borderColor:t}});case"square":/* @__PURE__ */
814
- return we("span",{className:`${r} h-2.5 w-2.5`,style:{backgroundColor:t}});case"bar":/* @__PURE__ */
815
- return we("span",{className:`${r} h-1 w-4 rounded-full`,style:{backgroundColor:t}});case"bar-vertical":/* @__PURE__ */
816
- return we("span",{className:`${r} h-3.5 w-1 rounded-full`,style:{backgroundColor:t}});default:/* @__PURE__ */
817
- return we("span",{className:`${r} h-2.5 w-2.5 rounded-sm`,style:{backgroundColor:t}})}}function Ls({entries:e,interactive:t,fallbackSwatch:r}){const{highlighted:n,setHighlighted:a}=fs();/* @__PURE__ */
818
- return we("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,o=/* @__PURE__ */ke(Ne,{children:[
819
- /* @__PURE__ */we(Cs,{shape:e.swatch??r,colour:Ko(l,e.color,e.tone)}),e.label]});/* @__PURE__ */
820
- return we("li",{className:"list-none",children:t?/* @__PURE__ */we("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:o}):/* @__PURE__ */we("span",{className:"flex items-center gap-2 text-xs text-gray-600",children:o})},e.key)})})}function Ds({title:e,subtitle:t,legend:r,table:n,tableLabel:a,busy:l=!1,loading:i=!1,skeletonVariant:o="area",skeletonHeight:s,interactiveLegend:c=!0,legendSwatch:d="rounded-square",actions:u,children:h,className:m}){const p=V().charts;/* @__PURE__ */
821
- return we(gs,{children:/* @__PURE__ */ke("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:[
822
- /* @__PURE__ */ke("header",{className:"flex items-start justify-between gap-4",children:[
823
- /* @__PURE__ */ke("div",{className:"min-w-0",children:[
824
- /* @__PURE__ */we("h3",{className:"truncate text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */we("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),u&&/* @__PURE__ */we("div",{className:"shrink-0",children:u})]}),i?/* @__PURE__ */we($s,{variant:o,height:s}):/* @__PURE__ */we("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:h}),!i&&r&&r.length>1&&/* @__PURE__ */we(Ls,{entries:r,interactive:c,fallbackSwatch:d}),!i&&n&&/* @__PURE__ */ke("details",{className:"border-t border-gray-100 pt-3",children:[
825
- /* @__PURE__ */we("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??p.showTable}),
826
- /* @__PURE__ */we("div",{className:"mt-3 overflow-x-auto",style:{color:_o.label},children:n})]})]})})}function js({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
827
- return ke("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white shadow-xl ring-1 ring-black/5"} ${l??""}`,style:i?F():void 0,children:[t&&/* @__PURE__ */we("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
828
- /* @__PURE__ */we("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:r.map(e=>/* @__PURE__ */ke("li",{className:"flex items-center gap-2.5",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
829
- /* @__PURE__ */we("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??_o.muted}}),
830
- /* @__PURE__ */we("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
831
- /* @__PURE__ */we("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */we("p",{className:"mt-2 text-[11px] text-gray-500",children:n})]})}function As({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,o="border"===n?3:3.5;/* @__PURE__ */
832
- return ke("g",{children:[a&&/* @__PURE__ */we("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */we("circle",{cx:e,cy:t,r:o+i,fill:_o.surface}),
833
- /* @__PURE__ */we("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?_o.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */we("title",{children:l})})]})}function Ps({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=V().charts,c=se(null),d=e.length-1,[u,h]=r,m=i??Ko(0),p=e=>0===d?0:e/d*l,g=e=>"number"==typeof e&&Number.isFinite(e),f=t.filter(g),b=Math.max(...f,1),x=e=>a-e/b*(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)},${x(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)])},k=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))},N=se(null),M=e=>t=>{N.current=e,t.currentTarget.setPointerCapture(t.pointerId)},$=e=>t=>{N.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{N.current===e&&(N.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
834
- return we("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?s.windowStart:s.windowEnd,"aria-valuemin":0,"aria-valuemax":d,"aria-valuenow":r,"aria-valuetext":e[r],style:{touchAction:"none"},onKeyDown:k(t),onPointerDown:M(t),onPointerMove:$(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
835
- return we("div",{className:o,children:/* @__PURE__ */ke("svg",{ref:c,width:"100%",height:a,viewBox:`0 0 ${l} ${a}`,role:"group","aria-label":s.window(e[u],e[h],e.length),children:[
836
- /* @__PURE__ */we("path",{d:v,fill:_o.grid}),
837
- /* @__PURE__ */we("rect",{x:0,y:0,width:p(u),height:a,fill:_o.surface,fillOpacity:.72}),
838
- /* @__PURE__ */we("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:_o.surface,fillOpacity:.72}),
839
- /* @__PURE__ */we("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 Ss(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 zs({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,tooltip:h,ariaLabel:m,className:p,emptyLabel:g}){const f=V().charts,b=U(),x=s??(e=>Z(e,b)),y=g??f.noData,v=se(null),w=ys(v),k=n??w,[N,M]=oe(null),$=ce();if(ue(()=>{if(null!==N)return H(e=>"Escape"===e.key&&(M(null),!0))},[N]),0===e.length)/* @__PURE__ */
840
- return we("div",{className:p,ref:v,children:/* @__PURE__ */we("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,D=Math.max(L+1,k-C.right),j=C.top,A=r-C.bottom,P=t.filter(Number.isFinite),S=l??Math.min(0,...P),z=Uo([S,i??Go(Math.max(...P,0))],{from:A,to:j}),F=Vo(e.length,{from:L,to:D},a),B=z.ticks(o+1),E=Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor(k/84))));/* @__PURE__ */
841
- return ke("div",{className:`relative ${p??""}`,ref:v,children:[
842
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${k} ${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:[
843
- /* @__PURE__ */we("defs",{children:/* @__PURE__ */we("clipPath",{id:$,children:/* @__PURE__ */we("rect",{x:L,y:j,width:D-L,height:A-j})})}),B.map(e=>/* @__PURE__ */we("line",{x1:L,y1:z(e),x2:D,y2:z(e),stroke:_o.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
844
- /* @__PURE__ */we("line",{x1:L,y1:z(Math.max(S,0)),x2:D,y2:z(Math.max(S,0)),stroke:_o.axis,strokeWidth:1,shapeRendering:"crispEdges"}),B.map(e=>/* @__PURE__ */we("text",{x:L-8,y:z(e)+4,textAnchor:"end",fontSize:11,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:x(e)},`t${e}`)),c&&/* @__PURE__ */we("text",{x:14,y:(j+A)/2,transform:`rotate(-90 14 ${(j+A)/2})`,textAnchor:"middle",fontSize:11,fill:_o.label,children:c}),
845
- /* @__PURE__ */we("g",{clipPath:`url(#${$})`,children:u({x:F,y:z,left:L,right:D,top:j,bottom:A,width:k,height:r,clipId:$,active:N})}),e.map((e,t)=>t%E===0?/* @__PURE__ */we("text",{x:"start"===d?F(t):F.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */we("rect",{x:F.center(r)-(D-L)/e.length/2,y:j,width:(D-L)/e.length,height:A-j,fill:"transparent",onMouseEnter:()=>M(r)},`h${r}`))]}),h&&null!==N&&
846
- /* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 z-10",style:Ss(F.center(N),F.bandwidth,k),children:h(N)})]})}var Fs=12,Bs=16,Es=26,Ts=52,Is=e=>"number"==typeof e&&Number.isFinite(e);function Os({series:e,labels:t,height:r=200,stacked:n=!1,stackMode:a="value",levels:l,curve:i="linear",tension:o=0,max:s,yTickCount:c=4,formatValue:d,yAxisLabel:u,referenceLines:h,labelEndpoints:m=!1,dots:p,dotVariant:g="border",pulse:f=!1,brush:b=!1,range:x,onRangeChange:y,loading:v=!1,animate:w=!0,reveal:k="left-to-right",fillVariant:N="gradient",gridStyle:M="solid",width:$,className:C,emptyLabel:L}){const D=V().charts,j=U(),A=d??(e=>Z(e,j)),P=L??D.noData,S=se(null),z=ys(S),F=$??z,[B,E]=oe(null),[T,I]=oe(null),{highlighted:O}=fs(),R=ce();if(ue(()=>{if(null!==B)return H(e=>"Escape"===e.key&&(E(null),!0))},[B]),v)/* @__PURE__ */
847
- return we("div",{className:C,ref:S,children:/* @__PURE__ */we($s,{height:r,width:$??z})});const W=t,_=x??T??[0,Math.max(0,W.length-1)],[q,K]=_,Y=e=>b?e.slice(q,K+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Is)).map(e=>({...e,data:Y(e.data)}));if(t=Y(W),0===G.length||0===t.length)/* @__PURE__ */
848
- return we("div",{className:C,ref:S,children:/* @__PURE__ */we("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:P})});const X={left:Ts,right:Math.max(Ts+1,F-Bs),top:Fs,bottom:r-Es},Q=Vo(t.length,{from:X.left,to:X.right}),ee=t.map((e,t)=>G.reduce((e,r)=>e+(Is(r.data[t])?r.data[t]:0),0)),te=(e,t)=>ee[t]>0?e/ee[t]:null,re=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(Is(t.data[r])?t.data[r]:0)),re.push("percent"===a?e.map((e,t)=>te(e,t)):[...e])}const ne=l&&l.length>0?Yo(l,{from:X.bottom,to:X.top}):null,ae=n?(re.at(-1)??[]).filter(Is):G.flatMap(e=>e.data.filter(Is)),le=Uo([0,n&&"percent"===a?1:s??Go(Math.max(...ae,0))],{from:X.bottom,to:X.top}),ie=e=>ne?ne(e):le(e),de=n&&"percent"===a?e=>J(Math.round(100*e),0,j):A,he=ne?ne.levels.map(e=>({value:e,y:ne(e)})):le.ticks(c+1).map(e=>({value:e,y:le(e)})),me=e=>r=>{r.preventDefault(),E(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},pe=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(F/96))));/* @__PURE__ */
849
- return ke("div",{className:`relative ${C??""}`,ref:S,children:[
850
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${F} ${r}`,role:"img","aria-label":D.overIntervals(G.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:()=>E(null),onBlur:()=>E(null),onKeyDown:e=>{"ArrowRight"===e.key&&me(1)(e),"ArrowLeft"===e.key&&me(-1)(e)},children:[
851
- /* @__PURE__ */we("defs",{children:/* @__PURE__ */we("clipPath",{id:R,children:/* @__PURE__ */we("rect",{x:X.left,y:X.top,width:X.right-X.left,height:X.bottom-X.top})})}),
852
- /* @__PURE__ */we(Oa,{id:R,fills:G.map((e,t)=>({color:Ko(e.slot,e.color,e.tone),variant:e.fillVariant??N})),fadeFrom:n?.42:.3,reveal:!!w&&k}),he.map(e=>/* @__PURE__ */we("line",{x1:X.left,y1:e.y,x2:X.right,y2:e.y,stroke:_o.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===M?"3 3":void 0},`grid-${e.value}`)),
853
- /* @__PURE__ */we("line",{x1:X.left,y1:X.bottom,x2:X.right,y2:X.bottom,stroke:_o.axis,strokeWidth:1,shapeRendering:"crispEdges"}),he.map(e=>/* @__PURE__ */we("text",{x:X.left-8,y:e.y+4,textAnchor:"end",fontSize:11,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e.value)},`ytick-${e.value}`)),u&&/* @__PURE__ */we("text",{x:12,y:(X.top+X.bottom)/2,transform:`rotate(-90 12 ${(X.top+X.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:_o.label,children:u}),
854
- /* @__PURE__ */we("g",{clipPath:`url(#${R})`,mask:w&&k?`url(#${za(R)})`:void 0,children:G.map((e,r)=>{const a=Ko(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=bs(e.key,O);if("step"===l){const r=t.map((t,r)=>({start:Q(r),end:Q.end(r),value:e.data[r]})).filter(e=>Is(e.value)).map(e=>({start:e.start,end:e.end,y:ie(e.value)}));/* @__PURE__ */
855
- return we("path",{d:rs(r),fill:"none",stroke:a,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:s??void 0,className:"rosh-viz-mark"},e.key)}const c=t.map((t,a)=>{const l=n?re[r]?.[a]:e.data[a];return Is(l)?[Q.center(a),ie(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*Q.bandwidth);/* @__PURE__ */
856
- return we("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,i)=>{const o=n?re[r]?.[i]:e.data[i];if(!Is(o))return null;const s=ie(o);/* @__PURE__ */
857
- return we("rect",{x:Q.center(i)-l/2,y:s,width:l,height:Math.max(0,X.bottom-s),rx:2,fill:a,fillOpacity:.35,className:w?Wa.rise:void 0,style:w?Ha(i,26):void 0},i)})},e.key)}const d=is(c,i,o),u=n&&r>0?t.map((e,t)=>[Q.center(t),ie(re[r-1]?.[t]??0)-2]):null,h=u?ss(d,u):os(d,c,X.bottom);/* @__PURE__ */
858
- return ke("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
859
- /* @__PURE__ */we("path",{d:h,fill:Ba(R,r,e.fillVariant??N,a),stroke:"none"}),
860
- /* @__PURE__ */we("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Ea(e.stroke??(e.forecast?"animated-dashed":"solid")),className:w&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?Wa.march:void 0})]},e.key)})}),h?.map((e,t)=>{const r=e.color??Ho[e.tone??"critical"],n=ie(e.value);/* @__PURE__ */
861
- return ke("g",{children:[
862
- /* @__PURE__ */we("line",{x1:X.left,y1:n,x2:X.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */we("text",{x:X.right-4,y:n-5,textAnchor:"end",fontSize:10.5,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(p??(m?"last":"none"))&&G.map((e,r)=>{const a=p??(m?"last":"none"),l=Ko(e.slot,e.color,e.tone),i=[...e.data].map(Is).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>Is(n?re[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
863
- return ke("g",{children:[o.map(a=>{const o=n?re[r]?.[a]:e.data[a];return Is(o)?/* @__PURE__ */we(As,{cx:Q.center(a),cy:ie(o),color:l,variant:g,pulse:f&&a===i,title:`${t[a]}: ${e.label} ${A(o)}`},a):null}),m&&i>=0&&Is(n?re[r]?.[i]:e.data[i])&&/* @__PURE__ */we("text",{x:Q.center(i)-10,y:ie(n?re[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:11.5,fontWeight:600,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:A(n?re[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%pe===0?/* @__PURE__ */we("text",{x:Q.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==B&&/* @__PURE__ */we("line",{x1:Q.center(B),y1:X.top,x2:Q.center(B),y2:X.bottom,stroke:_o.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */we("rect",{x:Q(t),y:X.top,width:Math.max(1,Q.bandwidth),height:X.bottom-X.top,fill:"transparent",onMouseEnter:()=>E(t)},`hit-${t}`))]}),b&&W.length>2&&/* @__PURE__ */we(Ps,{className:"mt-1",labels:W,width:F,data:e[0]?.data??[],range:_,onRangeChange:e=>{y?y(e):I(e)}}),null!==B&&
864
- /* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 z-10",style:Ss(Q.center(B),Q.bandwidth,F),children:/* @__PURE__ */we(js,{title:t[B],rows:G.map((e,t)=>({key:e.key,label:e.label,color:Ko(e.slot,e.color,e.tone),value:Is(e.data[B])?n&&"percent"===a?`${J(100*(te(e.data[B],B)??0),1,j)} · ${A(e.data[B])}`:A(e.data[B]):void 0})),footnote:n&&"percent"===a?D.inBucket(A(ee[B])):void 0})})]})}function Rs({series:e,labels:t,stacked:r=!1,stackMode:n="value",height:a=220,width:l,max:i,formatValue:o,yAxisLabel:s,className:c,emptyLabel:d,radius:u=3,loading:h=!1,animate:m=!0,glow:p=!1,emphasise:g=!1,activeKey:f,highlight:b="none"}){const x=ce(),{highlighted:y}=fs(),v=V().charts,w=U(),k=o??(e=>Z(e,w));if(h)/* @__PURE__ */return we($s,{height:a,width:l,variant:"bars",className:c});const N=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)=>N.reduce((e,r)=>e+M(r,t),0)),C=t.map((e,t)=>N.reduce((e,r)=>e+Math.max(0,M(r,t)),0)),L=t.map((e,t)=>N.reduce((e,r)=>e+Math.min(0,M(r,t)),0)),D=r&&"percent"===n,j=(e,t)=>$[t]>0?e/$[t]:null,A=D?[1]:r?[...C,...L]:N.flatMap(e=>e.data.filter(Number.isFinite));/* @__PURE__ */
865
- return we(zs,{labels:t,values:A,height:a,width:l,max:D?1:i,formatValue:D?e=>J(Math.round(100*e),0,w):k,yAxisLabel:s,className:c,emptyLabel:d,ariaLabel:v.acrossCategories(N.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */we(js,{title:t[e],rows:N.map(t=>({key:t.key,label:t.label,color:Ko(t.slot,t.color,t.tone),value:Number.isFinite(t.data[e])?D?`${J(100*(j(t.data[e],e)??0),1,w)} · ${k(t.data[e])}`:k(t.data[e]):void 0})),footnote:D?v.inCategory(k($[e])):void 0}),children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=xs(r?$:N[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
866
- return ke("g",{children:[
867
- /* @__PURE__ */we(Oa,{id:x,glow:p}),t.map((t,a)=>{const l=e.bandwidth/(r?1:Math.max(1,N.length));let i=0,o=0;const c=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return N.map((t,d)=>{const h=t.data[a];if(!Number.isFinite(h))return null;const f=D?j(h,a):h;if(null===f)return null;const b=Ko(t.slot,t.color,t.tone),v=r?e(a):e(a)+d*l;let w,k,M=!0;if(r){const e=f>=0?i:o,t=e+f;f>=0?i=t:o=t,w=n(Math.max(e,t)),k=n(Math.min(e,t)),M=0===e}else w=Math.min(n(f),c),k=Math.max(n(f),c);const $=Math.max(0,k-w-(r&&!M?2:0)),C=null===s||s===a,L=C?b:g?_o.muted:b,A=bs(t.key,y);/* @__PURE__ */
868
- return we("rect",{x:v,y:w,width:Math.max(1,l),height:$,rx:u,fill:L,fillOpacity:A??(C?1:g?.32:.45),filter:p&&s===a?`url(#${Sa(x)})`:void 0,className:"rosh-viz-mark"+(m?` ${Wa.rise}`:""),style:m?Ha(a*(r?1:N.length)+d,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */we("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:_o.axis,strokeWidth:1})]})}})}var Ws=3;function Hs({series:e,height:t=260,width:r,xLabel:n,yLabel:a,formatX:l,formatY:i,xDomain:o,yDomain:s,xScale:c="linear",yScale:d="linear",radiusRange:u=[4,22],className:h,emptyLabel:m}){const p=V().charts,g=U(),f=l??(e=>Z(e,g)),b=i??(e=>Z(e,g)),x=m??p.noObservations,y=se(null),v=ys(y),w=r??v,k=ce(),[N,M]=oe(null);ue(()=>{if(null!==N)return H(e=>"Escape"===e.key&&(M(null),!0))},[N]);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=o||s?C.map(e=>({...e,points:e.points.filter(e=>$(e.x,o)&&$(e.y,s))})).filter(e=>e.points.length>0):C,D=C.reduce((e,t)=>e+t.points.length,0)-L.reduce((e,t)=>e+t.points.length,0);if(0===L.length)/* @__PURE__ */
869
- return we("div",{className:h,ref:y,children:/* @__PURE__ */we("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const j=L.flatMap(e=>e.points),A=j.some(e=>null!=e.size),P=14,S=20,z=34,F=52,B=Math.max(F+1,w-S),E=(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,Go(Math.max(...e))];return"log"===r?Zo(i,n):Uo(i,n)},T=E(j.map(e=>e.x),o,c,{from:F,to:B}),I=E(j.map(e=>e.y),s,d,{from:t-z,to:P}),O=Jo([0,Math.max(...j.map(e=>e.size??1))],{from:u[0],to:u[1]}),R=N?L[N.s]:void 0,W=N&&R?R.points[N.i]:void 0,_=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
870
- return ke("div",{className:`relative ${h??""}`,ref:y,children:[
871
- /* @__PURE__ */ke("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)+(D>0?`. ${p.outsideRange(D)}`:""),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=N?_.findIndex(e=>e.s===N.s&&e.i===N.i):0;M(_[Math.min(_.length-1,Math.max(0,r+t))])},children:[
872
- /* @__PURE__ */we("defs",{children:/* @__PURE__ */we("clipPath",{id:k,children:/* @__PURE__ */we("rect",{x:F-u[1],y:P-u[1],width:B-F+2*u[1],height:t-z-P+2*u[1]})})}),I.ticks(5).map(e=>/* @__PURE__ */ke("g",{children:[
873
- /* @__PURE__ */we("line",{x1:F,y1:I(e),x2:B,y2:I(e),stroke:_o.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
874
- /* @__PURE__ */we("text",{x:F-8,y:I(e)+4,textAnchor:"end",fontSize:11,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),T.ticks(5).map(e=>/* @__PURE__ */we("text",{x:T(e),y:t-12,textAnchor:"middle",fontSize:11,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */we("text",{x:(F+B)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:_o.label,children:n}),a&&/* @__PURE__ */we("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:_o.label,children:a}),
875
- /* @__PURE__ */we("g",{clipPath:`url(#${k})`,children:L.map((e,t)=>{const r=Ko(t,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */we("circle",{cx:T(n.x),cy:I(n.y),r:A?O(n.size??0):u[0]+1,fill:r,fillOpacity:N&&N.s!==t?.25:.62,stroke:_o.surface,strokeWidth:2,onMouseEnter:()=>M({s:t,i:a})},`${e.key}-${a}`))})})]}),N&&R&&W&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:W.label??R.label,rows:[{key:"x",label:n??p.xAxis,color:Ko(N.s,R.color,R.tone),value:f(W.x)},{key:"y",label:a??p.yAxis,color:Ko(N.s,R.color,R.tone),value:b(W.y)},...null!=W.size?[{key:"size",label:p.size,color:_o.muted,value:Z(W.size,g)}]:[]],footnote:W.label?R.label:void 0})})]})}function _s({rows:e,labels:t,variant:r="area",curve:n="linear",height:a=220,width:l,max:i,min:o,formatValue:s,yAxisLabel:c,color:d,tone:u,label:h,className:m,emptyLabel:p,radius:g=3}){const f=V().charts,b=U(),x=s??(e=>Z(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=Ko(0,d,u);/* @__PURE__ */
876
- return we(zs,{labels:t,values:v,height:a,width:l,max:i,min:o,formatValue:x,yAxisLabel:c,className:m,emptyLabel:p,bandPadding:"bar"===r?.34:0,ariaLabel:f.rangeLabel(y,t.length),tooltip:r=>/* @__PURE__ */we(js,{title:t[r],rows:[{key:"high",label:f.high,color:w,value:null==e[r]?void 0:x(e[r].high)},{key:"low",label:f.low,color:w,value:null==e[r]?void 0:x(e[r].low)}]}),children:({x:t,y:a,active:l})=>"bar"===r?/* @__PURE__ */we("g",{children:e.map((e,r)=>/* @__PURE__ */we("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__ */ke("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__ */
877
- return ke(Ne,{children:[
878
- /* @__PURE__ */we("path",{d:ss(is(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
879
- /* @__PURE__ */we("path",{d:is(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
880
- /* @__PURE__ */we("path",{d:is(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */we("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:_o.axis,strokeWidth:1})]})})}function qs({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=V().charts,d=U(),u=n??(e=>Z(e,d));let h=0;const m=e.map(e=>{if(e.total){const t={from:0,to:h,value:h,total:!0};return{...e,...t}}const t=h;return h+=e.value,{...e,from:t,to:h,value:e.value,total:!1}}),p=m.flatMap(e=>[e.from,e.to]);/* @__PURE__ */
881
- return we(zs,{labels:e.map(e=>e.label),values:p,height:t,width:r,formatValue:u,yAxisLabel:a,className:l,emptyLabel:i,bandPadding:.36,ariaLabel:c.waterfall(e.length,u(m[0]?.from??0),u(h)),tooltip:e=>{const t=m[e],r=t?.total?Ho.neutral:t.value>=0?Ho.good:Ho.critical;/* @__PURE__ */
882
- return we(js,{title:t?.label,rows:[{key:"step",color:r,label:t?.total?c.balance:t.value>=0?c.increase:c.decrease,value:t?.total?u(t.to):`${t.value>=0?"+":"−"}${u(Math.abs(t.value))}`},...t?.total?[]:[{key:"running",label:c.runningTotal,color:Ho.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */ke("g",{children:[s&&m.slice(0,-1).map((r,n)=>
883
- /* @__PURE__ */we("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:_o.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?Ho.neutral:n.value>=0?Ho.good:Ho.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
884
- return we("rect",{x:e(a),y:i,width:Math.max(1,e.bandwidth),height:s,rx:o,fill:l,fillOpacity:null===r||r===a?1:.45},a)})]})})}function Ks({values:e,bins:t=10,precomputed:r,height:n=220,width:a,color:l,tone:i,formatBound:o,formatCount:s,yAxisLabel:c,label:d,className:u,emptyLabel:h}){const m=V().charts,p=U(),g=o??(e=>Number.isInteger(e)?Z(e,p):X(e,1,p)),f=s??(e=>Z(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??Qo(e??[],t),v=Ko(0,l,i),w=y.map(e=>g(e.from)),k=y.map(e=>e.count);/* @__PURE__ */
885
- return we(zs,{labels:w,values:k,height:n,width:a,bandPadding:0,xTickAnchor:"start",formatValue:f,yAxisLabel:b,className:u,emptyLabel:h,ariaLabel:m.histogram(x,y.length,(e??[]).length),tooltip:e=>/* @__PURE__ */we(js,{title:`${g(y[e].from)} – ${g(y[e].to)}`,rows:[{key:"count",label:m.observations,color:v,value:f(y[e].count)}]}),children:({x:e,y:t,bottom:r,active:n})=>/* @__PURE__ */we("g",{children:y.map((a,l)=>/* @__PURE__ */we("rect",{x:e(l)+.5,y:t(a.count),width:Math.max(1,e.bandwidth-1),height:Math.max(0,r-t(a.count)),fill:v,fillOpacity:null===n||n===l?.85:.42},l))})})}function Us({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=V().charts,u=U(),h=l??(e=>Z(e,u)),m=o??d.distribution,p=Ko(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
886
- return we(zs,{labels:e.map(e=>e.label),values:g,height:t,width:r,bandPadding:.5,formatValue:h,yAxisLabel:i,className:s,emptyLabel:c,ariaLabel:d.fiveNumber(m,e.length),tooltip:t=>{const r=e[t];/* @__PURE__ */
887
- return we(js,{title:r.label,rows:[{key:"max",label:d.maximum,color:p,value:h(r.max)},{key:"q3",label:d.q3,color:p,value:h(r.q3)},{key:"median",label:d.median,color:p,value:h(r.median)},{key:"q1",label:d.q1,color:p,value:h(r.q1)},{key:"min",label:d.minimum,color:p,value:h(r.min)}],emphasisKey:"median",footnote:r.outliers?.length?d.outliers(r.outliers.length):void 0})},children:({x:t,y:r,active:n})=>/* @__PURE__ */we("g",{children:e.map((e,a)=>{const l=t.center(a),i=Math.max(6,t.bandwidth);/* @__PURE__ */
888
- return ke("g",{opacity:null!==n&&n!==a?.45:1,children:[
889
- /* @__PURE__ */we("line",{x1:l,y1:r(e.max),x2:l,y2:r(e.q3),stroke:p,strokeWidth:1.5}),
890
- /* @__PURE__ */we("line",{x1:l,y1:r(e.q1),x2:l,y2:r(e.min),stroke:p,strokeWidth:1.5}),
891
- /* @__PURE__ */we("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
892
- /* @__PURE__ */we("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
893
- /* @__PURE__ */we("rect",{x:l-i/2,y:r(e.q3),width:i,height:Math.max(1,r(e.q1)-r(e.q3)),rx:2,fill:p,fillOpacity:.22,stroke:p,strokeWidth:1.5}),
894
- /* @__PURE__ */we("line",{x1:l-i/2,y1:r(e.median),x2:l+i/2,y2:r(e.median),stroke:p,strokeWidth:3}),(e.outliers??[]).map((e,t)=>/* @__PURE__ */we("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:_o.surface,strokeWidth:1.5},t))]},a)})})})}function Vs({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=V().charts,d=U(),u=a??(e=>Number.isInteger(e)?Z(e,d):X(e,2,d)),h=i??c.price,m=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),p=Math.min(...m),g=Math.max(...m),f=.08*(g-p)||1;/* @__PURE__ */
895
- return we(zs,{labels:e.map(e=>e.label),values:m,height:r,width:n,min:p-f,max:g+f,bandPadding:.42,formatValue:u,yAxisLabel:l,className:o,emptyLabel:s,ariaLabel:c.ohlc(h,e.length),tooltip:t=>{const r=e[t],n=r.close>=r.open,a=n?Ho.good:Ho.critical;/* @__PURE__ */
896
- return we(js,{title:r.label,rows:[{key:"open",label:c.open,color:a,value:u(r.open)},{key:"high",label:c.high,color:a,value:u(r.high)},{key:"low",label:c.low,color:a,value:u(r.low)},{key:"close",label:c.close,color:a,value:u(r.close)}],emphasisKey:"close",footnote:n?c.closedAbove:c.closedBelow})},children:({x:r,y:n,active:a})=>/* @__PURE__ */we("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?Ho.good:Ho.critical,s=r.center(l),c=Math.max(3,r.bandwidth),d=null!==a&&a!==l,u=n(Math.max(e.open,e.close)),h=Math.max(1,Math.abs(n(e.close)-n(e.open)));/* @__PURE__ */
897
- return ke("g",{opacity:d?.45:1,children:[
898
- /* @__PURE__ */we("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */we("rect",{x:s-c/2,y:u,width:c,height:h,rx:1,fill:i?o:"transparent",fillOpacity:i?.85:1,stroke:o,strokeWidth:1.5}):/* @__PURE__ */ke(Ne,{children:[
899
- /* @__PURE__ */we("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
900
- /* @__PURE__ */we("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function Ys({rows:e,columns:t,cells:r,height:n,width:a,color:l,max:i,formatValue:o,label:s,className:c,emptyLabel:d,cellGap:u=2,cellRadius:h=2}){const m=V().charts,p=U(),g=o??(e=>Z(e,p)),f=s??m.intensity,b=d??m.noActivity,x=se(null),y=ys(x),v=a??y,w=ce(),[k,N]=oe(null);if(ue(()=>{if(null!==k)return H(e=>"Escape"===e.key&&(N(null),!0))},[k]),0===e.length||0===t.length)/* @__PURE__ */
901
- return we("div",{className:c,ref:x,children:/* @__PURE__ */we("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const M=l??Ko(0),$=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,j=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=$>0?Math.max(0,Math.min(1,e/$)):0;return`color-mix(in oklab, ${M} ${(8+92*t).toFixed(1)}%, ${_o.surface})`};/* @__PURE__ */
902
- return ke("div",{className:`relative ${c??""}`,ref:x,children:[
903
- /* @__PURE__ */ke("svg",{width:"100%",height:D,viewBox:`0 0 ${v} ${D}`,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:()=>N(null),onBlur:()=>N(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(),N(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:[
904
- /* @__PURE__ */we("defs",{children:/* @__PURE__ */ke("linearGradient",{id:w,x1:"0",x2:"1",children:[
905
- /* @__PURE__ */we("stop",{offset:"0",stopColor:A(0)}),
906
- /* @__PURE__ */we("stop",{offset:"1",stopColor:A($)})]})}),e.map((e,t)=>/* @__PURE__ */we("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:_o.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=k&&(k.r!==n||k.c!==a);/* @__PURE__ */
907
- return we("rect",{x:C+a*j+u/2,y:26*n+u/2,width:Math.max(1,j-u),height:26-u,rx:h,fill:A(l),opacity:i?.55:1,onMouseEnter:()=>N({r:n,c:a}),children:/* @__PURE__ */we("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__ */we("text",{x:C+r*j+j/2,y:L+15,textAnchor:"middle",fontSize:11,fill:_o.label,children:e},`c${r}`):null),
908
- /* @__PURE__ */we("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
909
- /* @__PURE__ */we("text",{x:C,y:L+48,fontSize:10.5,fill:_o.label,children:"0"}),
910
- /* @__PURE__ */we("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:10.5,fill:_o.label,style:{fontVariantNumeric:"tabular-nums"},children:g($)})]}),k&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */we(js,{title:`${e[k.r]} · ${t[k.c]}`,rows:[{key:"v",label:f,color:M,value:null==r[k.r]?.[k.c]?void 0:g(r[k.r][k.c])}]})})]})}function Gs({caption:e,head:t,rows:r}){/* @__PURE__ */
911
- return ke("table",{className:"sr-only",children:[
912
- /* @__PURE__ */we("caption",{children:e}),
913
- /* @__PURE__ */we("thead",{children:/* @__PURE__ */we("tr",{children:t.map(e=>/* @__PURE__ */we("th",{scope:"col",children:e},e))})}),
914
- /* @__PURE__ */we("tbody",{children:r.map((e,t)=>/* @__PURE__ */we("tr",{children:e.map((e,t)=>/* @__PURE__ */we("td",{children:e},t))},t))})]})}var Zs=3,Xs=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Js({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=V().charts,u=U(),h=i??(e=>Z(e,u)),m=c??d.nothingToCompare,p=ce(),[g,f]=oe(null),{highlighted:b}=fs(),x=t.slice(0,3);if(e.length<3||0===x.length)/* @__PURE__ */
915
- return we("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,k=Xo(e.length),N=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...x.map(e=>e.values[t]??0).filter(Number.isFinite))),M=(e,t)=>{const r=Math.max(0,Math.min(1,t/N[e])),n=k.center(e)-k.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},$=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
916
- return ke("div",{className:`relative ${s??""}`,children:[
917
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
918
- /* @__PURE__ */we("title",{id:p,children:d.acrossMeasures(x.map(e=>e.label),e.length)}),Array.from({length:l},(t,r)=>{const n=w*(r+1)/l;return"circle"===a?/* @__PURE__ */we("circle",{cx:y,cy:v,r:n,fill:"none",stroke:_o.grid,strokeWidth:1},r):/* @__PURE__ */we("path",{d:Xs(cs(y,v,n,e.length)),fill:"none",stroke:_o.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=M(t,N[t]);/* @__PURE__ */
919
- return ke("g",{children:[
920
- /* @__PURE__ */we("line",{x1:y,y1:v,x2:r,y2:n,stroke:_o.grid,strokeWidth:1}),
921
- /* @__PURE__ */we("text",{x:y+(w+18)*Math.cos(k.center(t)-k.step/2),y:v+(w+18)*Math.sin(k.center(t)-k.step/2)+4,textAnchor:"middle",fontSize:11,fill:_o.label,children:e.label})]},e.key)}),
922
- /* @__PURE__ */we(Oa,{id:p,reveal:!!o&&"center-out"}),x.map((t,r)=>{const a=Ko(r,t.color,t.tone),l=e.map((e,r)=>M(r,t.values[r]??0));/* @__PURE__ */
923
- return ke("g",{opacity:$(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${za(p)})`:void 0,children:["area"===n&&/* @__PURE__ */we("path",{d:Xs(l),fill:a,fillOpacity:.18,stroke:"none"}),
924
- /* @__PURE__ */we("path",{d:Xs(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */we("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:_o.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:Ko(g,C.color,C.tone),value:h(C.values[t]??0)}))})}),
925
- /* @__PURE__ */we("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:x.map((e,t)=>/* @__PURE__ */ke("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
926
- /* @__PURE__ */we("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ko(t,e.color,e.tone)}}),
927
- /* @__PURE__ */we("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
928
- /* @__PURE__ */we(Gs,{caption:d.acrossMeasures(x.map(e=>e.label),e.length),head:[d.tableSeries,...e.map(e=>e.label)],rows:x.map(t=>[t.label,...e.map((e,r)=>h(t.values[r]??0))])})]})}function Qs({segments:e,variant:t="pie",size:r=280,innerRadius:n,padAngle:a=.012,maxSegments:l=6,otherLabel:i,formatValue:o,centerLabel:s,animate:c=!0,labels:d="none",labelMinShare:u=.04,className:h,emptyLabel:m}){const p=V().charts,g=U(),f=o??(e=>Z(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=ce(),[v,w]=oe(null),{highlighted:k}=fs(),N=e.filter(e=>e.value>0);if(0===N.length)/* @__PURE__ */return we("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const M=[...N].sort((e,t)=>t.value-e.value),$=M.slice(0,l),C=M.slice(l),L=C.length>0?[...$,{key:"__other__",label:b,value:C.reduce((e,t)=>e+t.value,0)}]:$,D=L.reduce((e,t)=>e+t.value,0),j=r/2,A=r/2,P=r/2-12,S=n??("ring"===t?.58*P:0),z=Xo(L.length,a),F=Math.max(...L.map(e=>e.value)),B=e=>S+(P-S)*Math.sqrt(Math.max(0,e)/F);let E=-Math.PI/2;const T=(()=>{if("outside"!==d)return[];let e=-Math.PI/2;const r=L.map((r,n)=>{const l="rose"===t?Xo(L.length,a).step:r.value/D*Math.PI*2,i="rose"===t?Xo(L.length,a).center(n):e+l/2;e+=l;const o="rose"===t?B(r.value):P;return{key:r.key,label:r.label,share:r.value/D,right:Math.cos(i)>=0,anchor:[j+o*Math.cos(i),A+o*Math.sin(i)],y:A+(o+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})(),I=(e,t)=>null!==v?v!==e:null!==k&&k!==t,O=null!==v?L[v]:void 0;/* @__PURE__ */
929
- return ke("div",{className:`relative ${h??""}`,children:[
930
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
931
- /* @__PURE__ */we("title",{id:y,children:p.breakdown(f(D),L.length)}),L.map((e,r)=>{const n=Ko(r,e.color,e.tone),l="rose"===t?z(r):E,i="rose"===t?z.step:e.value/D*Math.PI*2-a;"rose"!==t&&(E+=e.value/D*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?B(e.value):P;/* @__PURE__ */
932
- return we("path",{d:ds(j,A,S,s,l,o),fill:n,fillOpacity:I(r,e.key)?.4:1,stroke:_o.surface,strokeWidth:1,className:c?Wa.sweep:void 0,style:c?Ha(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),T.map(e=>{const t=e.right?r-6:6,n=e.right?r-58:58;/* @__PURE__ */
933
- return ke("g",{children:[
934
- /* @__PURE__ */we("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:_o.grid,strokeWidth:1}),
935
- /* @__PURE__ */we("text",{x:t,y:e.y-2,fontSize:10.5,fill:_o.label,textAnchor:e.right?"end":"start",children:e.label}),
936
- /* @__PURE__ */we("text",{x:t,y:e.y+10,fontSize:10.5,fontWeight:600,fill:_o.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:J(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&S>0&&/* @__PURE__ */we("text",{x:j,y:A+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:_o.label,children:s})]}),O&&null!==v&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:O.label,rows:[{key:"value",label:p.value,color:Ko(v,O.color,O.tone),value:f(O.value)},{key:"share",label:p.share,color:_o.muted,value:J(O.value/D*100,1,g)}]})}),
937
- /* @__PURE__ */we("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__ */ke("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
938
- /* @__PURE__ */we("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ko(t,e.color,e.tone)}}),
939
- /* @__PURE__ */we("span",{className:"flex-1 truncate",children:e.label}),
940
- /* @__PURE__ */we("span",{className:"tabular-nums text-gray-800",children:J(e.value/D*100,1,g)})]},e.key))})]})}var ec=300*Math.PI/180;function tc({rows:e,variant:t="track",size:r=300,max:n,formatValue:a,animate:l=!0,className:i,emptyLabel:o,trackGap:s=6}){const c=V().charts,d=U(),u=a??(e=>Z(e,d)),h=o??c.nothingToPlot,m=ce(),[p,g]=oe(null),{highlighted:f}=fs();if(0===e.length)/* @__PURE__ */return we("p",{className:`text-sm text-gray-500 ${i??""}`,children:h});const b=r/2,x=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,k=Math.max(1,Math.floor((y-.16*r)/w||1)),N="track"===t?e.slice(0,k):e,M=Math.min(s,Math.max(1,w-2)),$=Xo(N.length,.03),C=null!==p?N[p]:void 0;/* @__PURE__ */
941
- return ke("div",{className:`relative ${i??""}`,children:[
942
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
943
- /* @__PURE__ */we("title",{id:m,children:"track"===t?c.radialTrack(N.length):c.radialCycle(N.length)}),N.map((e,n)=>{const a=Ko(n,e.color,e.tone),i=Math.max(0,Math.min(1,e.value/v)),o=((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,s=-Math.PI/2;/* @__PURE__ */
944
- return ke("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),className:l?Wa.sweep:void 0,style:l?Ha(n,70):void 0,children:[
945
- /* @__PURE__ */we("path",{d:ds(b,x,r,t,s,s+ec),fill:_o.grid}),
946
- /* @__PURE__ */we("path",{d:ds(b,x,r,t,s,s+ec*i),fill:a})]},e.key)}const s=.14*r;/* @__PURE__ */
947
- return we("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */we("path",{d:ds(b,x,s,s+(y-s)*i,$(n),$(n)+$.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:C.label,rows:[{key:"value",label:c.value,color:Ko(p,C.color,C.tone),value:u(C.value)}]})}),
948
- /* @__PURE__ */we("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__ */ke("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
949
- /* @__PURE__ */we("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Ko(t,e.color,e.tone)}}),
950
- /* @__PURE__ */we("span",{className:"flex-1 truncate",children:e.label}),
951
- /* @__PURE__ */we("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function rc({stages:e,shape:t="funnel",height:r,width:n=560,gap:a=4,formatValue:l,color:i,className:o,emptyLabel:s}){const c=V().charts,d=U(),u=l??(e=>Z(e,d)),h=s??c.noStages,m=ce(),[p,g]=oe(null),{highlighted:f}=fs();if(0===e.length)/* @__PURE__ */return we("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const b=i??Ko(0),x=r??54*e.length,y=Math.max(...e.map(e=>e.value),1),v=168,w=n-v,k=e=>w*Math.max(0,e/y)/2,N=v+w/2,M=t=>46+t/Math.max(1,e.length-1)*54,$=e=>`color-mix(in oklab, ${b} ${M(e).toFixed(0)}%, ${_o.surface})`,C=e=>M(e)>=55?_o.surface:_o.label,L=(e,t)=>null!==p?p!==e:null!==f&&f!==t,D=null!==p?e[p]:void 0;/* @__PURE__ */
952
- return ke("div",{className:`relative ${o??""}`,children:[
953
- /* @__PURE__ */ke("svg",{width:"100%",height:x,viewBox:`0 0 ${n} ${x}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
954
- /* @__PURE__ */we("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*x/e.length+a/2,i=(n+1)*x/e.length-a/2,o=k(r.value),s="cone"===t?k(e[n+1]?.value??r.value):o,c=e[n-1]?.value,h=null!=c&&c>0?100*(1-r.value/c):null;/* @__PURE__ */
955
- return ke("g",{opacity:L(n,r.key)?.45:1,onMouseEnter:()=>g(n),children:[
956
- /* @__PURE__ */we("path",{d:`M${N-o},${l} L${N+o},${l} L${N+s},${i} L${N-s},${i} Z`,fill:$(n)}),
957
- /* @__PURE__ */we("text",{x:154,y:(l+i)/2-2,textAnchor:"end",fontSize:12,fill:_o.label,children:r.label}),
958
- /* @__PURE__ */ke("text",{x:154,y:(l+i)/2+14,textAnchor:"end",fontSize:11,fill:_o.muted,style:{fontVariantNumeric:"tabular-nums"},children:[u(r.value),null!=h?` · −${J(h,1,d)}`:""]}),
959
- /* @__PURE__ */we("text",{x:N,y:(l+i)/2+4,textAnchor:"middle",fontSize:11.5,fontWeight:600,fill:C(n),style:{fontVariantNumeric:"tabular-nums"},children:J(r.value/(e[0].value||1)*100,0,d)})]},r.key)})]}),D&&null!==p&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:D.label,rows:[{key:"value",label:c.count,color:$(p),value:u(D.value)},{key:"share",label:c.ofFirstStage,color:_o.muted,value:J(D.value/(e[0].value||1)*100,0,d)},...p>0&&e[p-1].value>0?[{key:"drop",label:c.droppedHere,color:Ho.critical,value:`−${J(100*(1-D.value/e[p-1].value),1,d)}`}]:[]]})})]})}function nc({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=V().charts,d=U(),u=l??(e=>Z(e,d)),h=s??c.nothingToBreakDown,m=se(null),p=ys(m),g=r??p,[f,b]=oe(null),{highlighted:x}=fs(),y=ms(e,g,t);if(0===y.length)/* @__PURE__ */
960
- return we("div",{className:o,ref:m,children:/* @__PURE__ */we("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??Ko(0),w=Math.max(...y.map(e=>e.value),1),k=e=>34+e/w*62,N=e=>`color-mix(in oklab, ${v} ${k(e).toFixed(0)}%, ${_o.surface})`,M=e=>k(e)>=55?_o.surface:_o.label,$=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
961
- return ke("div",{className:`relative ${o??""}`,ref:m,children:[
962
- /* @__PURE__ */we("svg",{width:"100%",height:t,viewBox:`0 0 ${g} ${t}`,role:"img","aria-label":c.treemap(e.length),onMouseLeave:()=>b(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__ */
963
- return ke("g",{opacity:$&&$!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
964
- /* @__PURE__ */we("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:N(e.value)}),l&&/* @__PURE__ */we("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:11.5,fontWeight:600,fill:M(e.value),children:e.label}),i&&/* @__PURE__ */we("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:M(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:C.label,rows:[{key:"value",label:c.value,color:N(C.value),value:u(C.value)}]})}),
965
- /* @__PURE__ */we(Gs,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function ac(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+lc(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=lc(e,8-n),u=d/s*r,h=`${i}/${e.key}`,m=0===n?t:a,p=0===n?e.key:l;o.push({id:h,label:e.label,value:d,depth:n,start:c,end:c+u,branch:m,branchKey:p}),e.children?.length&&ac(e.children,c,u,n+1,m,p,h,o),c+=u})}function lc(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+lc(r,t-1),0):Math.max(0,e.value??0)}function ic({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=V().charts,c=U(),d=a??(e=>Z(e,c)),u=o??s.nothingToBreakDown,[h,m]=oe(null),{highlighted:p}=fs(),g=[];if(ac(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return we("p",{className:`text-sm text-gray-500 ${i??""}`,children:u});const f=Math.max(...g.map(e=>e.depth))+1,b=t/2,x=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, ${Ko(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${_o.surface})`,k=e=>null!==h?e.id===h:null===p||e.branchKey===p,N=h?g.find(e=>e.id===h):void 0,M=e=>J(e.value/v*100,1,c);/* @__PURE__ */
966
- return ke("div",{className:`relative ${i??""}`,children:[
967
- /* @__PURE__ */ke("svg",{width:"100%",height:t,viewBox:`0 0 ${t} ${t}`,role:"img","aria-label":s.sunburst(d(v),f),onMouseLeave:()=>m(null),children:[g.map(e=>/* @__PURE__ */we("path",{d:ds(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:k(e)?1:.45,stroke:_o.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */we("text",{x:b,y:x+5,textAnchor:"middle",fontSize:15,fontWeight:600,fill:_o.label,children:l})]}),N&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:N.label,rows:[{key:"value",label:s.value,color:w(N),value:d(N.value)},{key:"share",label:s.share,color:_o.muted,value:M(N)}]})}),
968
- /* @__PURE__ */we(Gs,{caption:s.sunburst(d(v),f),head:[s.tableLevel,s.tableItem,s.value,s.share],rows:g.map(e=>[e.depth+1,e.label,d(e.value),M(e)])})]})}function oc({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=V().charts,d=U(),u=i??(e=>Z(e,d)),h=s??c.noFlows,m=se(null),p=ys(m),g=n??p,[f,b]=oe(null),{highlighted:x}=fs();if(0===e.length||0===t.length)/* @__PURE__ */
969
- return we("div",{className:o,ref:m,children:/* @__PURE__ */we("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)]})),k=/* @__PURE__ */new Map;for(const t of e)k.set(t.depth,[...k.get(t.depth)??[],t]);const N=Math.max(...[...k.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),M=r-20,$=N>0?(M-l*(Math.max(...[...k.values()].map(e=>e.length))-1))/N:0,C=/* @__PURE__ */new Map;for(const[e,t]of k){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 o=10;t.forEach((t,n)=>{const a=2+Math.max(0,r[n]-2)*i;C.set(t.key,{x:v(e),y:o,h:a,index:n}),o+=a+l})}const L=/* @__PURE__ */new Map,D=/* @__PURE__ */new Map,j=/* @__PURE__ */new Map,A=(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__ */
970
- return ke("div",{className:`relative ${o??""}`,ref:m,children:[
971
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${g} ${r}`,role:"img","aria-label":c.sankey(e.length,t.length),onMouseLeave:()=>b(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,o=n.y+(D.get(e.to)??0)+l/2;L.set(e.from,(L.get(e.from)??0)+l),D.set(e.to,(D.get(e.to)??0)+l);const s=r.x+a,c=n.x,d=Ko(r.index,e.color),u=`${e.from}→${e.to}`,h=j.get(u)??0;j.set(u,h+1);const m=((e,t)=>f?"link"===f.kind?f.index===t:A(e,f.key):null!==x?A(e,x):null)(e,t);/* @__PURE__ */
972
- return we("path",{d:ls([[s,i],[c,o]]),fill:"none",stroke:d,strokeWidth:l,strokeOpacity:null===m||m?.42:.12,onMouseEnter:()=>b({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:A(t[f.index],i):null!==x?x===i:null);var i;/* @__PURE__ */
973
- return ke("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
974
- /* @__PURE__ */we("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:Ko(r.index,e.color,e.tone)}),
975
- /* @__PURE__ */we("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:_o.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:Ko(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),S&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:S.label,rows:[{key:"value",label:c.throughput,color:Ko(C.get(S.key)?.index??0,S.color,S.tone),value:u(w.get(S.key)??0)}]})}),
976
- /* @__PURE__ */we(Gs,{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 sc({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=V().charts,d=U(),u=i??(e=>Z(e,d)),h=s??c.noFlows,[m,p]=oe(null),{highlighted:g}=fs(),f=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},b=e.map((t,r)=>e.reduce((e,t,n)=>e+f(r,n)+f(n,r),0)),x=e.map((e,t)=>t).sort((e,t)=>b[t]-b[e]).slice(0,n),y=x.reduce((e,t)=>e+b[t],0);if(y<=0)/* @__PURE__ */return we("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const v=r/2,w=r/2,k=r/2-44,N=k-l,M=a*x.length,$=/* @__PURE__ */new Map;let C=-Math.PI/2;x.forEach((e,t)=>{const r=b[e]/y*(2*Math.PI-M);$.set(e,{start:C,end:C+r,slot:t}),C+=r+a});const L=/* @__PURE__ */new Map,D=[];for(const e of x)for(const t of x){const r=f(e,t);if(r<=0)continue;const n=$.get(e),a=r/Math.max(1,b[e])*(n.end-n.start),l=L.get(e)??0;L.set(e,l+a),D.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 j=(e,t)=>[v+t*Math.cos(e),w+t*Math.sin(e)],A="arc"===m?.kind?m.index:void 0,P="ribbon"===m?.kind?D[m.index]:void 0;/* @__PURE__ */
977
- return ke("div",{className:`relative ${o??""}`,children:[
978
- /* @__PURE__ */ke("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord(x.length),onMouseLeave:()=>p(null),children:[D.map((t,n)=>{const[a,l]=j(t.a,N),[i,o]=j(t.b,N),s=Ko($.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__ */
979
- return we("path",{d:`M${a},${l} Q${v},${w} ${i},${o}`,fill:"none",stroke:s,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]}`)}),x.map(t=>{const r=$.get(t),n=(r.start+r.end)/2,[a,l]=j(n,k+16),i=(t=>m?"arc"===m.kind?m.index===t:D[m.index].from===t||D[m.index].to===t:null!==g?e[t]===g:null)(t);/* @__PURE__ */
980
- return ke("g",{onMouseEnter:()=>p({kind:"arc",index:t}),children:[
981
- /* @__PURE__ */we("path",{d:ds(v,w,N,k,r.start,r.end),fill:Ko(r.slot),fillOpacity:null===i||i?1:.45}),
982
- /* @__PURE__ */we("text",{x:a,y:l+4,fontSize:11,fill:_o.label,textAnchor:Math.cos(n)>.15?"start":Math.cos(n)<-.15?"end":"middle",children:e[t]})]},t)})]}),void 0!==A&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:e[A],rows:[{key:"total",label:c.totalFlow,color:Ko($.get(A).slot),value:u(b[A])}]})}),P&&/* @__PURE__ */we("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */we(js,{title:`${e[P.from]} → ${e[P.to]}`,rows:[{key:"value",label:c.flow,color:Ko($.get(P.from).slot),value:u(P.value)}]})}),
983
- /* @__PURE__ */we(Gs,{caption:c.chord(x.length),head:[c.tableFrom,c.tableTo,c.value],rows:D.map(t=>[e[t.from],e[t.to],u(t.value)])})]})}export{Mi as APP_UPDATE_POLL_MS,aa as Accordion,Ci as AppUpdateBanner,tn as AttachButton,Qr as AttachmentDropZone,en as AttachmentList,vo as AuthScreen,Kn as Avatar,Un as AvatarGroup,Zn as Banner,Ki as BarChart,Us as BoxPlotChart,mt as BrandAssetEditor,La as BudgetBar,_o as CHART_INK,Dt as Calendar,Vs as CandlestickChart,sn as Card,zs as CartesianPlot,Ps as ChartBrush,Oa as ChartDefs,As as ChartDot,Ds as ChartFrame,gs as ChartHighlightProvider,$s as ChartSkeleton,js as ChartTooltip,go as ChatTemplate,qe as Checkbox_default,so as CheckoutTemplate,sc as ChordChart,Gr as ColorPicker,Vr as ColorPickerPanel,_r as ColorSwatch,ua as ColoredBadge,Rs as ColumnChart,rn as ComposerAttachments,Tl as ContainerFillChart,si as ContextMenu,In as CountBadge,Da as DAY_MS,eo as DashboardTemplate,Wi as DataTable,ao as DataTablePage,Gt as DatePicker_default,It as DateRangePicker,Qt as DateTimePicker_default,Bn as DescriptionList,Ln as Divider,Vi as DonutChart,Ai as Drawer,ii as DropdownMenu,ho as EmailTemplate,ha as EmptyState,Eo as EmptyValue,Mo as ErrorBoundary,ko as ErrorPage,Zr as FilePicker_default,Ze as FormErrorSummary,Ve as FormField,io as FormLayoutPage,rc as FunnelChart,la as GROUP_COLORS,ia as GROUP_COLORS_SOLID,xo as GalleryTemplate,$n as Grid,Ys as HeatmapChart,Gl as HelpCenter,Yr as HexInput,Ks as HistogramChart,je as INPUT_BASE,De as INPUT_SIZES,$e as IconButton_default,ki as IconRail,Ni as IconRailButton,wn as Inline,Lr as InputNumber_default,Se as Input_default,Pi as Kanban,Qe as Label,Gi as LineChart,Hi as ListFooter,_i as ListLoadError,sr as MAX_FRACTION_DIGITS,Wa as MOTION,Vl as Markdown,ht as MediaUploadField,vt as MediaUploadGrid,ks as Meter,Na as MetricBar,Dl as MilestoneTimeline,Oe as NativeSelect,hr as NumericKeypad,jl as POST_PRODUCTION_STATUSES,ma as PageHeader,zi as Pagination,Xr as PaperclipGlyph,fn as Paragraph,Qs as PieChart,Pr as Popover,bt as PortalBrandingProvider,Bl as ProductionTimeline,Zs as RADAR_SERIES_CAP,Js as RadarChart,tc as RadialBarChart,Ge as RadioGroup,Ue as Radio_default,_s as RangeChart,vs as RankedBars,Ws as SCATTER_SERIES_CAP,Ro as SERIES_SLOT_COUNT,Wo as SERIES_VARS,Al as STAGES,Ho as STATUS_VARS,oc as SankeyChart,Hs as ScatterChart,an as SearchableSelect,xr as Segmented,He as Select_default,En as SettingRow,Xl as SidebarActionButton,Ql as SidebarGroupLabel,ri as SidebarNavGroup,ti as SidebarNavItem,An as Skeleton,jr as Slider,or as Snippet,qi as Sparkline,vn as Stack,cn as StatCard,Ms as StatTile,Wn as Statistic,da as StatusBadge,ca as StatusBadgeProvider,na as Stepper,ic as SunburstChart,kr as Switch_default,ta as Tabs,ln as TagInput,mn as Text,ze as Textarea_default,pr as TileButton_default,To as TimeAgo,Ht as TimePicker_default,Os as TimeSeriesChart,Cl as TimelineTrack,gn as Title,ni as TopNav,hi as Tree,bi as TreeEmptySlot,mi as TreeGroup,pi as TreeGroupLabel,fi as TreeRow,xi as TreeSeam,nc as TreemapChart,qs as WaterfallChart,Xo as angleScale,cr as appendKey,Fo as applyThemePrefs,ds as arcPath,ss as areaBetween,os as areaFrom,xs as autoHighlightIndex,dr as backspace,Vo as bandScale,Qo as binValues,$a as budgetState,ls as bumpPath,Pl as calcOverall,Sl as calcReportOverall,Wr as colorFill,Hr as colorSwatchClasses,rr as copyToClipboard,is as curvePath,Ea as dashFor,Ba as fillFor,Pa as fillId,Fe as firstEnabledIndex,Aa as fmtSliderDate,Nt as fromKey,Sa as glowId,Fa as groundId,oa as groupColors,Er as hexToHsv,bs as highlightOpacity,Tr as hsvToHex,Pe as inputClasses,ga as isSeverityTone,Je as labelClasses,Yo as ladderScale,Be as lastEnabledIndex,ts as linearPath,Uo as linearScale,Zo as logScale,za as maskId,Te as matchTypeahead,tt as mediaFileName,ns as monotonePath,Ee as nextEnabledIndex,Go as niceMax,zr as parseHexColor,cs as polygonPoints,Jo as radiusScale,pt as resolvePortalBrandAsset,Ko as resolveSeriesColor,Po as resolveTheme,er as selectionAt,qo as seriesColor,fa as severityOf,as as splinePath,ms as squarify,Ha as stagger,rs as stepPath,Xn as tabButtonId,Jn as tabPanelId,ja as toDayMs,St as toISODate,kt as toKey,$i as useAppUpdate,Oo as useClickOutside,ci as useContextMenu,Io as useDebouncedValue,fs as useHighlight,ys as usePlotWidth,xt as usePortalBranding,zl as useProductionTimeline,Bo as useTheme};