efficient-shell 7.28.0 → 7.29.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.
- package/dist/{Browser-CUAQCAZ2.js → Browser-5DWPCWSB.js} +14 -14
- package/dist/Calculator-756J7AGT.js +29 -0
- package/dist/ConfirmDialog-GY3PLMAD.js +1 -0
- package/dist/{CurrencyConverter-ZIERKELA.js → CurrencyConverter-TVIYMDYE.js} +9 -9
- package/dist/{Documents-GOOHQYBQ.js → Documents-ZHENRDK2.js} +4 -4
- package/dist/Files-YKUTWABM.js +87 -0
- package/dist/{Notepad-YV4JDSRK.js → Notepad-7MXZE6S4.js} +10 -10
- package/dist/PdfViewer-T6SP6R6J.js +1 -0
- package/dist/{PomodoroTimer-GYLJIAWS.js → PomodoroTimer-IUPEDDQV.js} +6 -6
- package/dist/{Preview-K4QOB3J2.js → Preview-6XGCKFXK.js} +23 -23
- package/dist/Sidebar-P3WJQSY5.js +44 -0
- package/dist/{Spreadsheet-7WU4NDJP.js → Spreadsheet-POFCH3DZ.js} +12 -12
- package/dist/{Stock-7AOF4PKL.js → Stock-MKUCNEAH.js} +6 -6
- package/dist/{Weather-23SUCMNL.js → Weather-6Q7DSJR4.js} +15 -15
- package/dist/{WorldClock-ENURKJG6.js → WorldClock-LTJJP4SS.js} +4 -4
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-IUBESHKK.js → chunk-2ECESCBH.js} +1 -1
- package/dist/{chunk-EZ73LTEI.js → chunk-2PNYIWIN.js} +1 -1
- package/dist/{chunk-KROUETJQ.js → chunk-4EMCPU7W.js} +18 -18
- package/dist/{chunk-A22D3FXG.js → chunk-BDXFODVC.js} +2 -2
- package/dist/chunk-BTLM7W6P.js +1 -0
- package/dist/{chunk-ITW5DB2J.js → chunk-C4QIJNW3.js} +12 -12
- package/dist/{chunk-4MSDABE3.js → chunk-DFCTQOIL.js} +1 -1
- package/dist/{chunk-5TFUQOEM.js → chunk-DFEO2CGF.js} +1 -1
- package/dist/{chunk-FHKJQU3U.js → chunk-EFYGUYEZ.js} +8 -8
- package/dist/{chunk-7776CT23.js → chunk-GPHWFPXA.js} +1 -1
- package/dist/{chunk-HCQ7SIGC.js → chunk-H3ODY2XB.js} +1 -1
- package/dist/{chunk-AHBO5PKR.js → chunk-IIIUHK3J.js} +8 -8
- package/dist/{chunk-BJN6DNDM.js → chunk-JIHKEOLY.js} +1 -1
- package/dist/{chunk-MQUGCJRS.js → chunk-LKFJPLTO.js} +208 -208
- package/dist/{chunk-QHL3LL5F.js → chunk-LU7X6LLY.js} +28 -28
- package/dist/{chunk-I4GL7BVS.js → chunk-OD3MT6SF.js} +2 -2
- package/dist/{chunk-XTAGVLZJ.js → chunk-RAFTWZF5.js} +1 -1
- package/dist/{chunk-QJ4YAH34.js → chunk-REZ2UWJT.js} +41 -41
- package/dist/{chunk-ABXVRYKR.js → chunk-T3UAIICC.js} +1 -1
- package/dist/chunk-V5MNUKAJ.js +1 -0
- package/dist/{chunk-76VZ67RK.js → chunk-X6ALQ2S6.js} +3 -3
- package/dist/{chunk-SUXBGACL.js → chunk-YO4FRA7Y.js} +6 -6
- package/dist/{chunk-EBTCC5N3.js → chunk-Z756FAL6.js} +9 -9
- package/dist/file-intake/index.js +1 -1
- package/dist/i18n/index.d.ts +1 -1
- package/dist/{index-HJwNWiNU.d.ts → index-CLkh3Bps.d.ts} +42 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +56 -56
- package/dist/locales/zh-Hans.d.ts +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +7 -7
- package/dist/page-tabs/index.js +4 -4
- package/dist/pdf/index.js +1 -1
- package/dist/{strings-BuYlsGKG.d.ts → strings-DzmlWMRe.d.ts} +2 -0
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-YQS2NTUZ.js +0 -29
- package/dist/ConfirmDialog-YZCM3HJP.js +0 -1
- package/dist/Files-R4Z3BYJL.js +0 -87
- package/dist/PdfViewer-JLIMTMVK.js +0 -1
- package/dist/Sidebar-4RJEWBBN.js +0 -44
- package/dist/chunk-3VYANOTN.js +0 -1
- package/dist/chunk-KWW5PPQN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-T3UAIICC.js";import{SidebarLayout as t}from"./chunk-BDXFODVC.js";import{IconButton_default as r,BrandMark as n}from"./chunk-EFYGUYEZ.js";import{OneLineLabel as a,TH_ONE_LINE as l}from"./chunk-RYBDLJJV.js";import{inputClasses as i,PLACEHOLDER_INK as o,FILTER_ON as s,FILTER_ON_INK as c,FILTER_OFF as d,INPUT_BASE_ON as u,INPUT_BASE as h,INPUT_SIZES as m}from"./chunk-HJQAE6SP.js";import{isSafeLinkHref as p}from"./chunk-PJPK2ADX.js";import{useShellLanguage as g}from"./chunk-2ECESCBH.js";import{toast_default as f}from"./chunk-BTLM7W6P.js";import{useIsMobile as b,useShortcutLabel as x,useShellPrefs as y}from"./chunk-YO4FRA7Y.js";import{LoadingSpinner as v}from"./chunk-NVFKXL52.js";import{Button_default as w}from"./chunk-XZXMVACA.js";import{useDropdownPosition as N,MENU_MAX_HEIGHT as k,Tooltip as $,swallowPress as M,describedByWith as C,OffWithReason as L,popupBounds as D,VIEWPORT_MARGIN as S,placeMenu as A,followAnchor as P,POPUP_MAX_WIDTH as j,followRect as z,placeAtPoint as F}from"./chunk-WOZ36LPR.js";import{useTabLayer as E,focusableIn as B,useFocusTrap as I,useScrollLock as T,dialogA11y as O,stopAfter as R}from"./chunk-4EMCPU7W.js";import{PopupMenu as W,MenuSemanticsContext as K,leavesContextMenuAlone as q,PopupMenuDivider as _,PopupMenuLabel as H,itemLook as U,MenuCheckMark as V}from"./chunk-GNW45MGV.js";import{useDismissPopupsOnOpen as Y}from"./chunk-UVBK6YSR.js";import{glassStyle as G,GLASS_DIVIDER as X,solidSurfaceStyle as Z}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as J,onOverlayOpen as Q,Z_LAYERS as ee}from"./chunk-FIEA5CGB.js";import{buttonClasses as te}from"./chunk-K7PQXJO7.js";import{useBrowserLayoutEffect as re,useBrowserValue as ne,useHydrated as ae,useBrowserValueOnce as le,useBrowserState as ie}from"./chunk-D65T4H6J.js";import{reportBoundaryError as oe}from"./chunk-KNUR2UEG.js";import{useFileIntake as se,humanSize as ce,FileIntakeAlert as de}from"./chunk-DFCTQOIL.js";import{useShellLocale as ue,useShellStrings as he,DEFAULT_SHELL_STRINGS as me,currentShellStrings as pe,splitAround as ge}from"./chunk-2PNYIWIN.js";import{formatPlain as fe,formatFixed as be,formatPercent as xe}from"./chunk-C3QOHMR6.js";import{parseFocal as ye,formatFocal as ve,nudgeFocal as we,focalFromRect as Ne}from"./chunk-AP2QEJXQ.js";import{calendarNames as ke,firstDayOfWeek as $e,formatDate as Me,EMPTY_VALUE as Ce,toInstant as Le,timeAgo as De,formatDateTime as Se}from"./chunk-W32SKK3D.js";import{Icon as Ae,setIconSet as Pe}from"./chunk-B427NVDP.js";import{forwardRef as je,useCallback as ze,useState as Fe,useRef as Ee,useId as Be,useMemo as Ie,useEffect as Te,createContext as Oe,Children as Re,isValidElement as We,cloneElement as Ke,useContext as qe,Fragment as _e,Component as He,useSyncExternalStore as Ue,useLayoutEffect as Ve}from"react";import{jsx as Ye,jsxs as Ge,Fragment as Xe}from"react/jsx-runtime";import{createPortal as Ze}from"react-dom";var Je=je(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...s},c){const d=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),u=
|
|
2
2
|
/* @__PURE__ */Ye("input",{ref:c,"aria-invalid":e||void 0,readOnly:l,className:i({invalid:e,size:n,readOnly:l,className:[d,a].filter(Boolean).join(" ")}),...s});return t||r?/* @__PURE__ */Ge("div",{className:"relative",children:[t&&/* @__PURE__ */Ye("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${o}`,children:t}),u,r&&/* @__PURE__ */Ye("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):u}),Qe=je(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:l,readOnly:o,...s},c){const d=ze(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
|
|
3
3
|
return Ye("textarea",{ref:c,"aria-invalid":e||void 0,rows:a,onInput:d,readOnly:o,className:i({invalid:e,size:l,readOnly:o,multiline:!0,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function et(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function tt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function rt(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?et(e):tt(e)}function nt(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 at=e=>Array.isArray(e.options);function lt(e){const t=[];for(const r of e)at(r)?t.push(...r.options):t.push(r);return t}function it(e,t){const r=[];for(const n of e){if(!at(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function ot(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!at(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
4
4
|
/* @__PURE__ */Ge("div",{role:"group","aria-labelledby":o,children:[
|
|
@@ -7,19 +7,19 @@ return Ye(Ae,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e
|
|
|
7
7
|
return Ye("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var ut=je(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:o,touchSize:s,renderOption:c,renderValue:d,valueText:u,readOnly:h,multiple:m,...p},g){const f=t;/* @__PURE__ */
|
|
8
8
|
return Ge("select",{ref:g,value:e,multiple:m||void 0,onChange:e=>f(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:i({invalid:a,size:o,className:`pr-8 ${l}`.trim()}),...p,children:[void 0!==n&&!m&&/* @__PURE__ */Ye("option",{value:"",disabled:!0,children:n}),
|
|
9
9
|
/* @__PURE__ */Ye(ht,{items:r})]})});function ht({items:e}){const t=e=>/* @__PURE__ */Ye("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
10
|
-
return Ye(Xe,{children:e.map((e,r)=>(e=>at(e))(e)?/* @__PURE__ */Ye("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var mt=je(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,...w},$){const[M,C]=Fe(!1),[L,D]=Fe(-1),S=Ee(null),A=Ee(null),P=Ee(null),j=Ee(M);j.current=M;const z=Ee({buffer:"",timer:null}),F=Be(),E=`${F}-listbox`,B=s??`${F}-trigger`,I=e=>`${F}-opt-${e}`,T=Ie(()=>lt(r),[r]),O=m?e:[],R=t,W=N(A,M,{matchTriggerWidth:!0}),K=m?T.findIndex(e=>O.includes(e.value)):T.findIndex(t=>t.value===e),q=m?T.filter(e=>O.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?T[K].label:void 0,_=!m&&K>=0?T[K].lang:void 0,
|
|
11
|
-
return Ge("div",{id:I(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||D(r)},onClick:()=>
|
|
10
|
+
return Ye(Xe,{children:e.map((e,r)=>(e=>at(e))(e)?/* @__PURE__ */Ye("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var mt=je(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,...w},$){const[M,C]=Fe(!1),[L,D]=Fe(-1),S=Ee(null),A=Ee(null),P=Ee(null),j=Ee(M);j.current=M;const z=Ee({buffer:"",timer:null}),F=Be(),E=`${F}-listbox`,B=s??`${F}-trigger`,I=e=>`${F}-opt-${e}`,T=Ie(()=>lt(r),[r]),O=m?e:[],R=t,W=N(A,M,{matchTriggerWidth:!0}),K=m?T.findIndex(e=>O.includes(e.value)):T.findIndex(t=>t.value===e),q=m?T.filter(e=>O.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?T[K].label:void 0,_=!m&&K>=0?T[K].lang:void 0,H=m?T.filter(e=>O.includes(e.value)):K>=0?[T[K]]:[],U=g&&H.length?g(H):void 0,V=void 0!==U&&f?f(H):void 0,Y=ze((e=!0)=>{C(!1),D(-1),e&&A.current?.focus()},[]),X=ze(()=>{c||b||(D(K>=0?K:et(T)),C(!0))},[c,b,T,K]),Z=ze(t=>{const r=T[t];if(r&&!r.disabled){if(m){const n=e;return R(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void D(t)}R(r.value),Y()}},[T,m,e,R,Y]);Te(()=>{if(!M)return;return J(e=>!("Escape"!==e.key||!j.current)&&(Y(),!0),()=>P.current)},[M,Y]),Te(()=>{if(!M)return;const e=e=>{const t=e.target;S.current?.contains(t)||P.current?.contains(t)||Y(!1)};document.addEventListener("pointerdown",e);const t=Q(()=>Y(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[M,Y]),Te(()=>{!M||L<0||P.current?.querySelector(`#${CSS.escape(I(L))}`)?.scrollIntoView({block:"nearest"})});const te=ze(e=>{const t=z.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=M?L:K,n=nt(T,t.buffer,r);n<0||(M?D(n):m?(D(n),C(!0)):Z(n))},[M,L,K,T,Z,m]),re=M?ot(r,(t,r)=>{const n=(a=t.value,m?O.includes(a):e===a);var a;const l=r===L;/* @__PURE__ */
|
|
11
|
+
return Ge("div",{id:I(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||D(r)},onClick:()=>Z(r),className:`mx-1 cursor-pointer truncate rounded-lg min-h-(--row-height-menu) px-3 py-2 text-sm leading-5${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__ */Ye(st,{selected:n}),p?/* @__PURE__ */Ye("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */Ge("span",{className:"block min-w-0 flex-1",children:[
|
|
12
12
|
/* @__PURE__ */Ye("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */Ye("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.description?
|
|
13
13
|
/* @__PURE__ */Ge(Xe,{children:[
|
|
14
14
|
/* @__PURE__ */Ye("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
15
15
|
/* @__PURE__ */Ye("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},F,"mx-1"):null;/* @__PURE__ */
|
|
16
16
|
return Ge("div",{ref:S,className:"relative",children:[
|
|
17
|
-
/* @__PURE__ */Ye("button",{ref:A,id:B,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?E:void 0,"aria-activedescendant":M&&L>=0?I(L):void 0,"aria-invalid":a||void 0,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,title:h,disabled:c,"aria-readonly":b||void 0,onClick:()=>M?Y():X(),onKeyDown:e=>{if(!c&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(M?D(e=>rt(T,e,1)):X());case"ArrowUp":return e.preventDefault(),void(M?D(e=>rt(T,e,-1)):X());case"Home":return void(M&&(e.preventDefault(),D(et(T))));case"End":return void(M&&(e.preventDefault(),D(tt(T))));case"Enter":return void(M&&(e.preventDefault(),
|
|
17
|
+
/* @__PURE__ */Ye("button",{ref:A,id:B,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?E:void 0,"aria-activedescendant":M&&L>=0?I(L):void 0,"aria-invalid":a||void 0,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,title:h,disabled:c,"aria-readonly":b||void 0,onClick:()=>M?Y():X(),onKeyDown:e=>{if(!c&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(M?D(e=>rt(T,e,1)):X());case"ArrowUp":return e.preventDefault(),void(M?D(e=>rt(T,e,-1)):X());case"Home":return void(M&&(e.preventDefault(),D(et(T))));case"End":return void(M&&(e.preventDefault(),D(tt(T))));case"Enter":return void(M&&(e.preventDefault(),Z(L)));case" ":return e.preventDefault(),void(M?Z(L):X());case"Escape":return void(M&&(e.preventDefault(),e.stopPropagation(),Y()));case"Tab":return void(M&&Y(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),te(e.key))}},className:i({invalid:a,size:d,readOnly:b,className:`${b?"":"pr-8 "}text-left ${l}`.trim()}),children:void 0!==U?
|
|
18
18
|
/* @__PURE__ */Ge("span",{className:"relative block min-w-0 truncate",children:[
|
|
19
|
-
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:
|
|
19
|
+
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:U}),
|
|
20
20
|
/* @__PURE__ */Ye("span",{lang:void 0===V?_:void 0,className:"sr-only",children:V??q})]}):/* @__PURE__ */Ye("span",{lang:_,className:"block truncate "+(void 0===q?"text-gray-400":""),children:q??n??" "})}),!b&&/* @__PURE__ */Ye(Ae,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${o}`,strokeWidth:2}),
|
|
21
21
|
/* @__PURE__ */Ge("select",{ref:$,value:e,multiple:m||void 0,onChange:e=>R(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...w,children:[void 0!==n&&!m&&/* @__PURE__ */Ye("option",{value:"",disabled:!0,children:n}),
|
|
22
|
-
/* @__PURE__ */Ye(ht,{items:r})]}),M&&
|
|
22
|
+
/* @__PURE__ */Ye(ht,{items:r})]}),M&&Ze(
|
|
23
23
|
/* @__PURE__ */Ye("div",{ref:P,id:E,role:"listbox","aria-labelledby":v??(y?void 0:B),"aria-label":v?void 0:y,"aria-multiselectable":m||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:ee.popup,left:W?.left,top:W?.top,bottom:W?.bottom,width:W?.width,maxHeight:W?.maxHeight??k,visibility:W?void 0:"hidden",...G()},children:re}),document.body)]})}),pt=je(function({touchSize:e="touch",...t},r){return b()&&!t.readOnly?/* @__PURE__ */Ye(ut,{ref:r,...t,size:e}):/* @__PURE__ */Ye(mt,{ref:r,...t})});function gt(e,t,r,n){const a=Be(),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 ft=je(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=Ee(null),h=gt(n,a,o,s);Te(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=ze(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */Ye("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__ */Ge("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
24
24
|
/* @__PURE__ */Ge("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */Ye("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */Ye("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),bt="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",xt=je(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=gt(r,n,i,o);return r||n?/* @__PURE__ */Ge("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
25
25
|
/* @__PURE__ */Ye("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${bt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
@@ -34,19 +34,19 @@ return Ge("div",{ref:l,role:"alert",tabIndex:-1,className:`rounded-md border bor
|
|
|
34
34
|
return Ge("label",{className:$t({className:r}),...n,children:[t,e&&/* @__PURE__ */Ye("span",{className:"ml-0.5 text-red-500",children:"*"})]})}var Ct="inline-flex max-w-full items-center whitespace-nowrap rounded-full",Lt={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)]"},Dt={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 St(e,t="subtle"){return"solid"===t?Dt[e]:Lt[e]}var At=Oe({}),Pt=Oe(void 0);function jt(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function zt({groups:e,labelFor:t,children:r}){/* @__PURE__ */
|
|
35
35
|
return Ye(At.Provider,{value:e,children:/* @__PURE__ */Ye(Pt.Provider,{value:t,children:r})})}function Ft(){const e=qe(Pt);return ze(t=>e?.(t)??jt(t),[e])}function Et({status:e,label:t,emphasis:r="subtle"}){const n=St(qe(At)[e]??"neutral",r),l=qe(Pt),i=t??l?.(e)??jt(e);/* @__PURE__ */
|
|
36
36
|
return Ye("span",{className:`${Ct} px-3 py-0.5 text-xs font-medium ${n}`,children:/* @__PURE__ */Ye(a,{children:i})})}var Bt=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function It(e){if(/^data:/i.test(e||""))return function(e){const t=Bt.exec(e);if(!t)return"media";const[,r,n]=t,a=n.split("+")[0].split(".").pop().replace(/^x-/i,"");return a?`${r.toLowerCase()}.${a.toLowerCase()}`:"media"}(e);const t=(e||"").split("?")[0].split("#")[0],r=t.substring(t.lastIndexOf("/")+1);try{return decodeURIComponent(r.replace(/^[0-9a-f]{32}_/i,""))||r||"media"}catch{return r||"media"}}var Tt=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function Ot(e,t=me.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 Rt(e,t,r="",n="p-4"){return["flex w-full flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed text-center transition-colors",n,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 Wt(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function Kt({label:e,progress:t,rounded:r="rounded-lg"}){/* @__PURE__ */
|
|
37
|
-
return Ye("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${r}`,children:/* @__PURE__ */Ye(
|
|
38
|
-
return Ye("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function _t(e,t=""){if(!e)return!1;const r=Bt.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Tt.test(e)||n&&!a}function
|
|
37
|
+
return Ye("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${r}`,children:/* @__PURE__ */Ye(Zt,{state:"busy",verb:e,pct:t})})}function qt({children:e}){/* @__PURE__ */
|
|
38
|
+
return Ye("span",{className:"absolute inset-x-1 bottom-1 truncate rounded px-2 py-0.5 text-xs text-white",style:{background:"var(--rosh-media-scrim)"},children:e})}function _t(e,t=""){if(!e)return!1;const r=Bt.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return Tt.test(e)||n&&!a}function Ht({className:e="h-5 w-5",ink:t="text-gray-400"}){/* @__PURE__ */
|
|
39
39
|
return Ge("svg",{className:`${e} animate-spin ${t}`.trim(),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[
|
|
40
40
|
/* @__PURE__ */Ye("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
41
|
-
/* @__PURE__ */Ye("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function
|
|
41
|
+
/* @__PURE__ */Ye("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function Ut({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
42
42
|
return Ye(Ae,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function Vt({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
43
43
|
return Ye(Ae,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}var Yt="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium",Gt="flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2";function Xt({label:e,glyph:t,onClick:r}){/* @__PURE__ */
|
|
44
|
-
return Ye($,{content:e,describe:!1,children:/* @__PURE__ */Ye("button",{type:"button",onClick:r,"aria-label":e,className:Gt,children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",children:t})})})}function
|
|
44
|
+
return Ye($,{content:e,describe:!1,children:/* @__PURE__ */Ye("button",{type:"button",onClick:r,"aria-label":e,className:Gt,children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",children:t})})})}function Zt({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=he().transfer;if("idle"===e)return null==t?null:/* @__PURE__ */Ye("span",{className:`${Yt} ${Lt.neutral} pr-2 ${s}`.trim(),children:t});if("error"===e)/* @__PURE__ */
|
|
45
45
|
return Ge("span",{role:"status",className:`${Yt} ${Lt.danger} ${s}`.trim(),children:[
|
|
46
46
|
/* @__PURE__ */Ye("span",{children:c.error}),i&&/* @__PURE__ */Ye(Xt,{label:c.retry,glyph:"↻",onClick:i}),o&&/* @__PURE__ */Ye(Xt,{label:c.dismiss,glyph:"×",onClick:o})]});const d=r??c.uploading,u=null==a||Number.isNaN(a)?null:Math.max(0,Math.min(100,Math.round(a))),h="string"==typeof d?c.cancelVerb(d.toLowerCase()):c.cancel,m=e=>[e,n,null==u?"":`${u}%`].filter(Boolean).join(" ");/* @__PURE__ */
|
|
47
47
|
return Ge("span",{role:"status","aria-live":"polite",className:`${Yt} ${Lt.info} ${s}`.trim(),children:[
|
|
48
|
-
/* @__PURE__ */Ye("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */Ge(Xe,{children:[d,m("")&&` ${m("")}`]})}),null==u&&/* @__PURE__ */Ye(
|
|
49
|
-
/* @__PURE__ */Ge("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",R?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[B?/* @__PURE__ */Ye("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */Ye("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:u}}),f&&e&&/* @__PURE__ */Ye(qt,{children:K}),N&&/* @__PURE__ */Ye(Kt,{label:A,progress:$,rounded:"rounded-md"})]}),!M&&(b||x)&&/* @__PURE__ */Ge("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */Ye(w,{id:P,variant:"secondary",size:"sm",onClick:()=>W(),disabled:N,children:D}),x&&/* @__PURE__ */Ye(w,{variant:"ghost",size:"sm",onClick:()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null),F(null),t("")},disabled:N,children:S})]})]}),_=/* @__PURE__ */Ye("button",{type:"button",id:P,onClick:()=>W(),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?`${P}-error`:l?`${P}-hint`:void 0,...O.zoneProps,className:Rt(R,E,Wt(E)),style:{minHeight:h},children:N?/* @__PURE__ */Ye(
|
|
48
|
+
/* @__PURE__ */Ye("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */Ge(Xe,{children:[d,m("")&&` ${m("")}`]})}),null==u&&/* @__PURE__ */Ye(Ht,{className:"h-3 w-3",ink:""}),l&&/* @__PURE__ */Ye(Xt,{label:h,glyph:"×",onClick:l})]})}function Jt({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:f=!0,allowReplace:b=!0,allowRemove:x=!0,replaceLabel:y,removeLabel:v,busy:N=!1,busyLabel:k,progress:$,disabled:M=!1}){const C=he().media,L=p??C.cta,D=y??C.replace,S=v??C.remove,A=k??C.uploading,P=Be(),j=Ee(null),[z,F]=Fe(null);Te(()=>()=>{j.current&&URL.revokeObjectURL(j.current)},[]);const E=M||N,B=!!e&&(_t(e,c)||e===z),I=m??Ot(c,C),T=e=>{r?r(e):n?n(e):(e=>{j.current&&URL.revokeObjectURL(j.current);const r=URL.createObjectURL(e);j.current=r,F(e.type.startsWith("video/")?r:null),t(r)})(e)},O=se({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:E,onAccept:([e])=>T(e)}),{dragOver:R}=O,W=()=>{E||(r?r():O.open())},K=e?It(e):"",q=/* @__PURE__ */Ge("div",{children:[
|
|
49
|
+
/* @__PURE__ */Ge("div",{...O.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",R?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[B?/* @__PURE__ */Ye("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":K||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */Ye("img",{src:e??void 0,alt:K,className:"h-full w-full",style:{objectFit:u}}),f&&e&&/* @__PURE__ */Ye(qt,{children:K}),N&&/* @__PURE__ */Ye(Kt,{label:A,progress:$,rounded:"rounded-md"})]}),!M&&(b||x)&&/* @__PURE__ */Ge("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */Ye(w,{id:P,variant:"secondary",size:"sm",onClick:()=>W(),disabled:N,children:D}),x&&/* @__PURE__ */Ye(w,{variant:"ghost",size:"sm",onClick:()=>{j.current&&(URL.revokeObjectURL(j.current),j.current=null),F(null),t("")},disabled:N,children:S})]})]}),_=/* @__PURE__ */Ye("button",{type:"button",id:P,onClick:()=>W(),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?`${P}-error`:l?`${P}-hint`:void 0,...O.zoneProps,className:Rt(R,E,Wt(E)),style:{minHeight:h},children:N?/* @__PURE__ */Ye(Zt,{state:"busy",verb:A,pct:$}):/* @__PURE__ */Ge(Xe,{children:[
|
|
50
50
|
/* @__PURE__ */Ye("span",{className:"text-gray-400",children:/* @__PURE__ */Ye(Vt,{})}),
|
|
51
51
|
/* @__PURE__ */Ye("span",{className:"px-3 text-xs text-gray-500",children:I}),
|
|
52
52
|
/* @__PURE__ */Ye("span",{className:"text-sm font-medium text-blue-600",children:L}),g&&/* @__PURE__ */Ye("span",{className:"text-xs text-gray-400",children:g})]})});/* @__PURE__ */
|
|
@@ -54,7 +54,7 @@ return Ge(yt,{label:a,htmlFor:P,hint:l,error:i,required:o,className:s,children:[
|
|
|
54
54
|
/* @__PURE__ */Ye(de,{rejections:O.rejections})]})}function Qt({committedUrl:e,committedHasAlpha:t=null,committedIsLight:r=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:o,assetName:s,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=Ee(null),[b,x]=Fe(null),[y,v]=Fe(""),[N,k]=Fe(""),[$,M]=Fe(!1),[C,L]=Fe(!1),D=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),S=he().brandAsset,A=y||e||a||"",P=b?null:e?t:l,j=b?null:e?r:i;Te(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const z=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
|
|
55
55
|
return Ge("section",{"aria-label":S.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
56
56
|
/* @__PURE__ */Ge("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
57
|
-
/* @__PURE__ */Ye(
|
|
57
|
+
/* @__PURE__ */Ye(Jt,{value:A,onChange:()=>{},onFile:e=>{if(g)return;z();const t=URL.createObjectURL(e);f.current=t,x(e),v(t),k("")},label:s,hint:N||S.usedFor(o),error:N||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:$||C,disabled:g}),
|
|
58
58
|
/* @__PURE__ */Ge("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
59
59
|
/* @__PURE__ */Ye(w,{onClick:async()=>{if(b&&!g&&!$){M(!0),k("");try{await c(b),z(),x(null),v("")}catch(e){k(e instanceof Error?e.message:S.saveFailed(D,s))}finally{M(!1)}}},disabled:!b||g,loading:$,children:S.save(D,s)}),(b||e)&&/* @__PURE__ */Ye(w,{variant:"ghost-danger",onClick:async()=>{if(!g&&!C){if(b)return z(),x(null),v(""),void k("");if(e){L(!0),k("");try{await d()}catch(e){k(e instanceof Error?e.message:S.removeFailed(D,s))}finally{L(!1)}}}},disabled:g,loading:C,children:b?S.discard:S.remove(D,s)})]})]}),p.length>0&&/* @__PURE__ */Ge("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":S.previews(s),children:[
|
|
60
60
|
/* @__PURE__ */Ye("h3",{className:"text-sm font-semibold text-gray-900",children:S.preview}),
|
|
@@ -93,7 +93,7 @@ return Ge("div",{className:p,children:[
|
|
|
93
93
|
/* @__PURE__ */Ge("div",{ref:P,role:"grid","aria-label":q,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=dr(R)??x??D,r={ArrowLeft:()=>mr(t,-1),ArrowRight:()=>mr(t,1),ArrowUp:()=>mr(t,-7),ArrowDown:()=>mr(t,7),Home:()=>mr(t,-(t.getDay()-k+7)%7),End:()=>mr(t,6-(t.getDay()-k+7)%7),PageUp:()=>pr(t,e.shiftKey?-12:-1),PageDown:()=>pr(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),j.current=!0,A(cr(a)),void(ur(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||B(R)||n(R))},hidden:"days"!==z,children:[
|
|
94
94
|
/* @__PURE__ */Ye("div",{role:"row",className:`${sr} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
|
|
95
95
|
/* @__PURE__ */Ye("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */Ye("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */Ye("div",{role:"row",className:`${sr} text-center text-sm`,children:E.slice(7*l,7*l+7).map(a=>{const l=cr(a),i=a.getMonth()!==D.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=B(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"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"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=g.has(l)&&/* @__PURE__ */Ye("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(o?"bg-white":i?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
96
|
-
return Ye("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Ge("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{A(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var fr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],br=e=>`${e.getFullYear()}-${xr(e.getMonth()+1)}`,xr=e=>String(e).padStart(2,"0");function yr(e){return`${e.getFullYear()}-${xr(e.getMonth()+1)}-${xr(e.getDate())}`}function vr(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:yr(new Date(r,n,t.getDate()-14)),to:yr(a)};case"lastMonth":return{from:yr(i(1)),to:yr(l)};case"last3Months":return{from:yr(i(3)),to:yr(l)};case"last6Months":return{from:yr(i(6)),to:yr(l)};case"last12Months":return{from:yr(i(12)),to:yr(l)}}}function wr(e,t,r){const n=br(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Nr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function kr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var $r=/* @__PURE__ */new Map;function Mr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":u,"aria-label":h,weekStartsOn:m,placeholder:p,fullWidth:g=!1,min:f,max:b,disabled:x=!1,allowOpenEnd:y=!1}){const v=he().dateRange,w=ue(),k=n??(w?function(e){let t=$r.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),$r.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}}(w):kr),$=p??v.placeholder,M=a??!l,[C,L]=Fe(!1),[D,S]=Fe(e),[A,P]=Fe(t),[j,z]=Fe(null),[F,E]=Fe("from"),B=Ee(null),I=Ee(null),T=Ee(null),O=Be(),R=Be(),W=Be(),[K,q]=Fe(!1),_=N(B,C,{preferredMaxWidth:520,preferredMaxHeight:K?720:560,popupRef:T}),
|
|
96
|
+
return Ye("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Ge("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{A(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var fr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],br=e=>`${e.getFullYear()}-${xr(e.getMonth()+1)}`,xr=e=>String(e).padStart(2,"0");function yr(e){return`${e.getFullYear()}-${xr(e.getMonth()+1)}-${xr(e.getDate())}`}function vr(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:yr(new Date(r,n,t.getDate()-14)),to:yr(a)};case"lastMonth":return{from:yr(i(1)),to:yr(l)};case"last3Months":return{from:yr(i(3)),to:yr(l)};case"last6Months":return{from:yr(i(6)),to:yr(l)};case"last12Months":return{from:yr(i(12)),to:yr(l)}}}function wr(e,t,r){const n=br(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function Nr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function kr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var $r=/* @__PURE__ */new Map;function Mr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":u,"aria-label":h,weekStartsOn:m,placeholder:p,fullWidth:g=!1,min:f,max:b,disabled:x=!1,allowOpenEnd:y=!1}){const v=he().dateRange,w=ue(),k=n??(w?function(e){let t=$r.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),$r.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}}(w):kr),$=p??v.placeholder,M=a??!l,[C,L]=Fe(!1),[D,S]=Fe(e),[A,P]=Fe(t),[j,z]=Fe(null),[F,E]=Fe("from"),B=Ee(null),I=Ee(null),T=Ee(null),O=Be(),R=Be(),W=Be(),[K,q]=Fe(!1),_=N(B,C,{preferredMaxWidth:520,preferredMaxHeight:K?720:560,popupRef:T}),H=Ee(null),U=Ee(null),[V,Y]=Fe(!0);re(()=>{const e=U.current;if(!C||!K||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==V&&Y(a)});const X=Ee(null);re(()=>{const e=T.current;if(!C||!_||!e)return;const t=getComputedStyle(e),r=_.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(K)null!==X.current&&X.current<=r&&q(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;X.current=e,e>r+.5&&q(!0)}});const[Z,J]=Fe(!1);re(()=>{const e=!!o&&(I.current?.labels?.length??0)>0;e!==Z&&J(e)});const ne=!!h||!!u||Z,ae=/* @__PURE__ */new Date,[le,ie]=Fe(()=>e?br(Nr(e)):wr(ae,f,b)),oe=fr.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(vr(e,ae),f,b)),se=e=>e?k(e):"";Te(()=>{if(!C)return;const e=e=>{const t=e.target;B.current?.contains(t)||T.current?.contains(t)||L(!1)};document.addEventListener("mousedown",e);const t=Q(()=>L(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[C]),Te(()=>{x&&L(!1)},[x]);const ce=()=>{r("",""),L(!1)},de=e&&t?`${se(e)} — ${se(t)}`:e?v.fromOnly(se(e)):t?v.toOnly(se(t)):"",me=ke(w),pe=e=>{const t=dr(e);return t?me.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},ge=e&&t?v.range(pe(e),pe(t)):e?v.fromOnly(pe(e)):t?v.toOnly(pe(t)):$,fe=e=>K?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(j===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(j===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),be=/* @__PURE__ */Ge(Xe,{children:[oe.map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=vr(e,ae);S(t.from),P(t.to),z(e),ie(t.from.slice(0,7))})(e),className:fe(e),"aria-label":K?v[e]:void 0,children:K?V?v[e]:v[`${e}Short`]:v[e]},e)),
|
|
97
97
|
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>z("Custom"),className:fe("Custom"),children:v.custom})]}),xe=(e,t)=>y?/* @__PURE__ */Ye("button",{type:"button","data-range-end":e,"aria-pressed":F===e,onClick:()=>E(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */Ye("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),ye=e=>y&&F===e?" ring-1 ring-blue-400":"",ve=
|
|
98
98
|
/* @__PURE__ */Ye(gr,{mode:"range",min:f,max:b,value:D||null,endValue:A||null,month:le,onMonthChange:ie,onSelect:e=>{z("Custom"),y?"from"===F?(A&&e>A?(S(A),P(e)):S(e),E("to")):D&&e<D?(P(D),S(e)):P(e):!D||D&&A?(S(e),P("")):e<D?(P(D),S(e)):P(e)},weekStartsOn:m,"aria-label":v.dialog});/* @__PURE__ */
|
|
99
99
|
return Ge("div",{className:"relative"+(g?" w-full":""),ref:B,children:[
|
|
@@ -102,47 +102,47 @@ return Ge("div",{className:"relative"+(g?" w-full":""),ref:B,children:[
|
|
|
102
102
|
/* @__PURE__ */Ye(Ae,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
103
103
|
/* @__PURE__ */Ye("span",{className:"truncate",children:de||$})]}),M&&!x&&(e||t)&&/* @__PURE__ */Ye("button",{type:"button",onClick:ce,"aria-label":v.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:"×"})]}),ne&&/* @__PURE__ */Ye("span",{id:R,className:"sr-only",children:ge}),l&&/* @__PURE__ */Ye("span",{id:W,className:"sr-only",children:v.required}),i&&/* @__PURE__ */Ge(Xe,{children:[
|
|
104
104
|
/* @__PURE__ */Ye("input",{type:"hidden",name:i.from,value:e,disabled:x||void 0}),
|
|
105
|
-
/* @__PURE__ */Ye("input",{type:"hidden",name:i.to,value:t,disabled:x||void 0})]}),C&&
|
|
105
|
+
/* @__PURE__ */Ye("input",{type:"hidden",name:i.to,value:t,disabled:x||void 0})]}),C&&Ze(
|
|
106
106
|
/* @__PURE__ */Ge("div",{ref:T,id:O,role:"dialog","aria-label":v.dialog,"data-layout":K?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:ee.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,width:K&&_?_.maxWidth:"max-content",maxWidth:_?.maxWidth,maxHeight:_?.maxHeight,overflowY:"auto",visibility:_?void 0:"hidden",...G()},children:[
|
|
107
107
|
/* @__PURE__ */Ge("div",{className:K?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[xe("from",/* @__PURE__ */Ge(Xe,{children:[
|
|
108
108
|
/* @__PURE__ */Ye("span",{className:"text-xs font-medium text-gray-500",children:v.from}),
|
|
109
109
|
/* @__PURE__ */Ye("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${D?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ye("from")}`,children:D?se(D):v.start})]})),!K&&/* @__PURE__ */Ye("span",{className:"text-gray-300",children:"—"}),xe("to",/* @__PURE__ */Ge(Xe,{children:[
|
|
110
110
|
/* @__PURE__ */Ye("span",{className:"text-xs font-medium text-gray-500",children:v.to}),
|
|
111
111
|
/* @__PURE__ */Ye("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${A?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ye("to")}`,children:A?se(A):v.end})]}))]}),K?/* @__PURE__ */Ge(Xe,{children:[oe.length>0&&/* @__PURE__ */Ge("div",{className:"mb-3 @container",children:[!V&&/* @__PURE__ */Ye("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:v.lastHeading}),
|
|
112
|
-
/* @__PURE__ */Ge("div",{ref:
|
|
112
|
+
/* @__PURE__ */Ge("div",{ref:U,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[be,oe.map(e=>/* @__PURE__ */Ye("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:v[e]},e))]})]}),
|
|
113
113
|
/* @__PURE__ */Ye("div",{className:"w-full",children:ve})]}):
|
|
114
|
-
/* @__PURE__ */Ge("div",{ref:
|
|
114
|
+
/* @__PURE__ */Ge("div",{ref:H,className:"flex w-max gap-4",children:[
|
|
115
115
|
/* @__PURE__ */Ye("div",{className:"w-64",children:ve}),oe.length>0&&/* @__PURE__ */Ye("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:be})]}),
|
|
116
116
|
/* @__PURE__ */Ge("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[M&&/* @__PURE__ */Ye("button",{type:"button",onClick:ce,className:te({variant:"ghost"}),children:v.clear}),
|
|
117
117
|
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>L(!1),className:te({variant:"secondary"}),children:v.cancel}),
|
|
118
118
|
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{r(D,A),L(!1)},disabled:y?!D&&!A:!D||!A,className:te({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var Cr=/^\d{2}:\d{2}(:\d{2})?$/,Lr=e=>String(e).padStart(2,"0");function Dr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Lr(e.getHours())}:${Lr(e.getMinutes())}`;return t?`${r}:${Lr(e.getSeconds())}`:r}return Cr.test(e)?e:""}var Sr=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:o="",step:s,...c},d){const u=null!=s&&Number(s)<60,h=ue();/* @__PURE__ */
|
|
119
|
-
return Ye("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":a||void 0,value:Dr(e,u),min:Dr(r,u)||void 0,max:Dr(n,u)||void 0,onChange:e=>t?.(Cr.test(e.target.value)?e.target.value:null),className:i({invalid:a,size:l,className:o}),...c})}),Ar=/^\d{4}-\d{2}-\d{2}$/,Pr=/^(aria|data)-/,jr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function zr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":yr(e);if(Ar.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":yr(t)}function Fr(e){if(!Ar.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 Er(e,t){const r=Fr(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Br=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:x,clearable:y,form:v,title:w,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,...L},D){const S=y??!x,A=zr(e),P=zr(r),j=zr(n),z=he().datePicker,F=ue(),E=ke(F),[B,I]=Fe(!1),T=Ee(null),O=Ee(null),R=Ee(null),W=Be(),K=Be(),q=Be(),_=N(O,B,{popupRef:R}),[U
|
|
120
|
-
return Ye("input",{ref:D,type:"date",lang:F,id:p,name:g,disabled:f,"aria-label":u,"aria-describedby":h,"aria-invalid":a||void 0,value:A,min:P||void 0,max:j||void 0,onChange:e=>t?.(Fr(e.target.value)),className:i({invalid:a,size:l,className:d}),"aria-labelledby":m,required:x,form:v,title:w,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,...L});const Y=Object.fromEntries(Object.entries(L).filter(([e])=>Pr.test(e)&&!jr.has(e))),G=L["aria-required"],X=!!x||!0===G||"true"===G,
|
|
119
|
+
return Ye("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":a||void 0,value:Dr(e,u),min:Dr(r,u)||void 0,max:Dr(n,u)||void 0,onChange:e=>t?.(Cr.test(e.target.value)?e.target.value:null),className:i({invalid:a,size:l,className:o}),...c})}),Ar=/^\d{4}-\d{2}-\d{2}$/,Pr=/^(aria|data)-/,jr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function zr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":yr(e);if(Ar.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":yr(t)}function Fr(e){if(!Ar.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 Er(e,t){const r=Fr(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var Br=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:x,clearable:y,form:v,title:w,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,...L},D){const S=y??!x,A=zr(e),P=zr(r),j=zr(n),z=he().datePicker,F=ue(),E=ke(F),[B,I]=Fe(!1),T=Ee(null),O=Ee(null),R=Ee(null),W=Be(),K=Be(),q=Be(),_=N(O,B,{popupRef:R}),[H,U]=Fe(!1);re(()=>{const e=!!p&&(O.current?.labels?.length??0)>0;e!==H&&U(e)});const V=!u&&(!!m||H);if(Te(()=>{if(!B)return;const e=e=>{const t=e.target;T.current?.contains(t)||R.current?.contains(t)||I(!1)};document.addEventListener("pointerdown",e,!0);const t=Q(()=>I(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[B]),Te(()=>{if(B)return J(e=>"Escape"===e.key&&(I(!1),O.current?.focus(),!0),()=>R.current)},[B]),s)/* @__PURE__ */
|
|
120
|
+
return Ye("input",{ref:D,type:"date",lang:F,id:p,name:g,disabled:f,"aria-label":u,"aria-describedby":h,"aria-invalid":a||void 0,value:A,min:P||void 0,max:j||void 0,onChange:e=>t?.(Fr(e.target.value)),className:i({invalid:a,size:l,className:d}),"aria-labelledby":m,required:x,form:v,title:w,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,...L});const Y=Object.fromEntries(Object.entries(L).filter(([e])=>Pr.test(e)&&!jr.has(e))),G=L["aria-required"],X=!!x||!0===G||"true"===G,Z=[V?K:void 0,X?q:void 0,h].filter(Boolean).join(" ")||void 0,te=yr(/* @__PURE__ */new Date),ne=(!P||te>=P)&&(!j||te<=j),ae=b??z.placeholder;/* @__PURE__ */
|
|
121
121
|
return Ge("div",{ref:T,className:"relative",children:[
|
|
122
122
|
/* @__PURE__ */Ye("input",{ref:D,type:"hidden",name:g,form:v,value:A}),
|
|
123
|
-
/* @__PURE__ */Ge("button",{ref:O,type:"button",...Y,id:p,disabled:f,title:w,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,"aria-haspopup":"dialog","aria-expanded":B,"aria-controls":B?W:void 0,"aria-labelledby":m,"aria-describedby":
|
|
123
|
+
/* @__PURE__ */Ge("button",{ref:O,type:"button",...Y,id:p,disabled:f,title:w,tabIndex:k,autoFocus:$,onFocus:M,onBlur:C,"aria-haspopup":"dialog","aria-expanded":B,"aria-controls":B?W:void 0,"aria-labelledby":m,"aria-describedby":Z,"aria-label":u?`${u}${A?`, ${Er(A,E)}`:""}`:void 0,onClick:()=>I(e=>!e),className:`${i({invalid:a,size:l,className:d})} flex items-center justify-between text-left`,children:[
|
|
124
124
|
/* @__PURE__ */Ye("span",{className:A?"text-gray-900":"text-gray-400",children:A?Er(A,E):ae}),
|
|
125
|
-
/* @__PURE__ */Ye(Ae,{name:"date",className:`h-4 w-4 shrink-0 ${o}`,strokeWidth:"1.75","aria-hidden":"true"})]}),V&&/* @__PURE__ */Ye("span",{id:K,className:"sr-only",children:A?Er(A,E):ae}),X&&/* @__PURE__ */Ye("span",{id:q,className:"sr-only",children:z.required}),B&&
|
|
125
|
+
/* @__PURE__ */Ye(Ae,{name:"date",className:`h-4 w-4 shrink-0 ${o}`,strokeWidth:"1.75","aria-hidden":"true"})]}),V&&/* @__PURE__ */Ye("span",{id:K,className:"sr-only",children:A?Er(A,E):ae}),X&&/* @__PURE__ */Ye("span",{id:q,className:"sr-only",children:z.required}),B&&Ze(
|
|
126
126
|
/* @__PURE__ */Ge("div",{ref:R,id:W,role:"dialog","aria-label":u??z.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:ee.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,maxWidth:_?.maxWidth,visibility:_?void 0:"hidden"},children:[
|
|
127
127
|
/* @__PURE__ */Ye(gr,{value:A||null,min:P||null,max:j||null,weekStartsOn:c,onSelect:e=>{I(!1),O.current?.focus(),t?.(Fr(e))}}),(S||ne)&&/* @__PURE__ */Ge("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[S&&/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{I(!1),O.current?.focus(),t?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:z.clear}),ne&&/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{I(!1),O.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:z.today})]})]}),document.body)]})}),Ir=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Tr=e=>String(e).padStart(2,"0");function Or(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Tr(t.getMonth()+1)}-${Tr(t.getDate())}T${Tr(t.getHours())}:${Tr(t.getMinutes())}`:Ir.test(e)?e:"";var t}var Rr=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:o="",...s},c){const d=ue();/* @__PURE__ */
|
|
128
|
-
return Ye("input",{ref:c,type:"datetime-local",lang:d,"aria-invalid":a||void 0,value:Or(e),min:Or(r)||void 0,max:Or(n)||void 0,onChange:e=>t?.(function(e){if(!Ir.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:i({invalid:a,size:l,className:o}),...s})});function Wr(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 Kr(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 qr(e,t,r){const n=await Kr(t,r),a=pe().copy;return n?f.success(a.copiedLabel(e)):f.error(a.failed),n}var _r={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},
|
|
128
|
+
return Ye("input",{ref:c,type:"datetime-local",lang:d,"aria-invalid":a||void 0,value:Or(e),min:Or(r)||void 0,max:Or(n)||void 0,onChange:e=>t?.(function(e){if(!Ir.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:i({invalid:a,size:l,className:o}),...s})});function Wr(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 Kr(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 qr(e,t,r){const n=await Kr(t,r),a=pe().copy;return n?f.success(a.copiedLabel(e)):f.error(a.failed),n}var _r={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},Hr={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function Ur(){/* @__PURE__ */
|
|
129
129
|
return Ye(Ae,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function Vr(){/* @__PURE__ */
|
|
130
|
-
return Ye(Ae,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Yr({value:e,children:t,symbol:n,label:a,size:l="md",variant:i="bordered",hideCopyButton:o=!1,onCopy:s,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Fe(!1),g=Ee(null),b=he().copy;Te(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=ze(async()=>{await Kr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):f.error(b.failed)},[e,s,b]),{box:y,button:v}=
|
|
130
|
+
return Ye(Ae,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Yr({value:e,children:t,symbol:n,label:a,size:l="md",variant:i="bordered",hideCopyButton:o=!1,onCopy:s,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Fe(!1),g=Ee(null),b=he().copy;Te(()=>()=>{g.current&&clearTimeout(g.current)},[]);const x=ze(async()=>{await Kr(e)?(p(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(!1),g.current=null},2e3),s?.(e)):f.error(b.failed)},[e,s,b]),{box:y,button:v}=Hr[l],w=!o;/* @__PURE__ */
|
|
131
131
|
return Ge("div",{id:w?void 0:d,"aria-describedby":w?void 0:u,className:["inline-flex max-w-full items-center rounded-md",_r[i],y,h].filter(Boolean).join(" "),children:[null!=n&&""!==n&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:n}),
|
|
132
132
|
/* @__PURE__ */Ye("span",{className:"min-w-0 font-mono text-gray-800 "+(c?"whitespace-pre-wrap break-all":"truncate"),title:c?void 0:e,children:t??e}),!o&&/* @__PURE__ */Ge(Xe,{children:[
|
|
133
|
-
/* @__PURE__ */Ye(r,{id:d,"aria-label":a?b.copyLabel(a):b.copy,"aria-describedby":u,onClick:x,className:`${v} text-gray-400`,children:/* @__PURE__ */Ye(m?Vr:
|
|
134
|
-
/* @__PURE__ */Ye("span",{"aria-live":"polite",className:"sr-only",children:m?b.copied:""})]})]})}var Gr=2;function Xr(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
|
|
135
|
-
return Ge("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[
|
|
136
|
-
/* @__PURE__ */Ye(w,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(
|
|
133
|
+
/* @__PURE__ */Ye(r,{id:d,"aria-label":a?b.copyLabel(a):b.copy,"aria-describedby":u,onClick:x,className:`${v} text-gray-400`,children:/* @__PURE__ */Ye(m?Vr:Ur,{})}),
|
|
134
|
+
/* @__PURE__ */Ye("span",{"aria-live":"polite",className:"sr-only",children:m?b.copied:""})]})]})}var Gr=2;function Xr(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 Zr(e){return e.slice(0,-1)}var Jr=["1","2","3","4","5","6","7","8","9",".","0"];function Qr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=he().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
135
|
+
return Ge("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[Jr.map(t=>/* @__PURE__ */Ye(w,{size:"touch-xl",variant:"secondary",onClick:()=>o(Xr(e,t)),children:t},t)),
|
|
136
|
+
/* @__PURE__ */Ye(w,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(Zr(e)),children:"⌫"}),r&&/* @__PURE__ */Ye(w,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var en={md:"h-24 p-3",lg:"h-32 p-4"},tn=je(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
|
|
137
137
|
return Ge("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)]",en[r],i].filter(Boolean).join(" "),...o,children:[
|
|
138
138
|
/* @__PURE__ */Ye("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */Ye("span",{className:"text-sm text-gray-500",children:t})]})}),rn={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function nn(e=!1,t=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",t].filter(Boolean).join(" ")}function an({size:e="md",selected:t,disabled:r=!1,block:n=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",rn[e],t?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",r?"cursor-not-allowed opacity-40":"cursor-pointer",n?"flex-1":""].filter(Boolean).join(" ")}function ln(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function on({icon:e,label:t}){/* @__PURE__ */
|
|
139
139
|
return Ge(Xe,{children:[e?/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function sn({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=Be(),h=nn(l,o),m=ln(l);/* @__PURE__ */
|
|
140
140
|
return Ye("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */Ge("label",{htmlFor:i,className:an({size:a,selected:o,disabled:r.disabled,block:l}),children:[
|
|
141
141
|
/* @__PURE__ */Ye("input",{id:i,type:"radio",name:n,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)]"}),
|
|
142
142
|
/* @__PURE__ */Ye(on,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */Ye("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */Ye($,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */Ye("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:an({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */Ye(on,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */Ye($,{content:r.title,className:m,children:i},r.value):i})})}var cn={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},dn={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},un={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},hn=je(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=Be(),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__ */Ye("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",cn[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */Ye("span",{className:["inline-block rounded-full bg-white shadow transition-transform",dn[n],e?un[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */Ge("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[y,
|
|
143
|
-
/* @__PURE__ */Ge("span",{className:"min-w-0",children:[a&&/* @__PURE__ */Ye("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */Ye("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */Ye("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */Ye("span",{className:o,children:y})});function mn(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var pn=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function gn({dir:e,compact:t,label:n,disabled:a,onStep:l}){const i=Ee(l);i.current=l;const o=Ee({}),s=ze(()=>{const e=o.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),o.current={}},[]);Te(()=>s,[s]),Te(()=>{a&&s()},[a,s]);const c=/* @__PURE__ */Ye(Ae,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),d={tabIndex:-1,"aria-label":n,disabled:a,onPointerDown:e=>{if(0!==e.button||a)return;e.preventDefault(),s();const t=e.shiftKey;i.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",s),o.current={off:()=>r.removeEventListener("pointerup",s),wait:setTimeout(()=>{o.current.every=setInterval(()=>i.current(t),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&i.current(e.shiftKey)}};return t?/* @__PURE__ */Ye("button",{type:"button",...d,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:c}):/* @__PURE__ */Ye(r,{size:"sm",...d,children:c})}var fn=je(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:o,disabled:s,readOnly:c,invalid:d,placeholder:u,size:h,prefix:m,suffix:p,id:g,name:f,className:b="",onBlur:x,onFocus:y,steppers:v=!1,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:L,"aria-label":D,"aria-labelledby":S,"aria-describedby":A,...P},j){const z="bare"===$,F="string"==typeof p&&""!==p.trim()?p.trim():void 0,E=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,F),B=Object.fromEntries(Object.entries(P).filter(([e])=>e.startsWith("data-"))),I=he(),[T,O]=Fe(()=>pn(e,a)),R=Ee(T);R.current=T;const W=Ee(null),K=ze(e=>{W.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),q=Ee(e),_=Ee(e);_.current=e;const
|
|
144
|
-
return Ge("div",{className:"relative",children:[m&&/* @__PURE__ */Ye("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),ne,p&&/* @__PURE__ */Ye("span",{className:`pointer-events-none absolute ${
|
|
145
|
-
return Ge("span",
|
|
143
|
+
/* @__PURE__ */Ge("span",{className:"min-w-0",children:[a&&/* @__PURE__ */Ye("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */Ye("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */Ye("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */Ye("span",{className:o,children:y})});function mn(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var pn=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function gn({dir:e,compact:t,label:n,disabled:a,onStep:l}){const i=Ee(l);i.current=l;const o=Ee({}),s=ze(()=>{const e=o.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),o.current={}},[]);Te(()=>s,[s]),Te(()=>{a&&s()},[a,s]);const c=/* @__PURE__ */Ye(Ae,{name:e>0?"chevron-up":"chevron-down","aria-hidden":"true",focusable:"false",className:t?"h-2.5 w-2.5":"h-3.5 w-3.5",strokeWidth:t?2.6:2}),d={tabIndex:-1,"aria-label":n,disabled:a,onPointerDown:e=>{if(0!==e.button||a)return;e.preventDefault(),s();const t=e.shiftKey;i.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",s),o.current={off:()=>r.removeEventListener("pointerup",s),wait:setTimeout(()=>{o.current.every=setInterval(()=>i.current(t),60)},400)}},onPointerLeave:s,onPointerCancel:s,onClick:e=>{0===e.detail&&i.current(e.shiftKey)}};return t?/* @__PURE__ */Ye("button",{type:"button",...d,className:"flex min-h-0 flex-1 items-center justify-center text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-900 disabled:cursor-not-allowed disabled:opacity-40",children:c}):/* @__PURE__ */Ye(r,{size:"sm",...d,children:c})}var fn=je(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:o,disabled:s,readOnly:c,invalid:d,placeholder:u,size:h,prefix:m,suffix:p,id:g,name:f,className:b="",onBlur:x,onFocus:y,steppers:v=!1,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:L,"aria-label":D,"aria-labelledby":S,"aria-describedby":A,...P},j){const z="bare"===$,F="string"==typeof p&&""!==p.trim()?p.trim():void 0,E=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,F),B=Object.fromEntries(Object.entries(P).filter(([e])=>e.startsWith("data-"))),I=he(),[T,O]=Fe(()=>pn(e,a)),R=Ee(T);R.current=T;const W=Ee(null),K=ze(e=>{W.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),q=Ee(e),_=Ee(e);_.current=e;const H=Boolean(s||c),U="compact"===v;Te(()=>{E(R.current)!==e&&O(pn(e,a))},[e,a]);const V=e=>{if(H)return;let i=(E(R.current)??w??(u?E(u):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=pn(i,a);R.current=s,O(s),t(i),ee()},Y=Ee(V);Y.current=V;const[G,X]=Fe(!1),[Z,Q]=Fe(0),ee=()=>{z&&Q(e=>e+1)};Te(()=>{z&&G&&document.activeElement===W.current&&W.current?.select()},[z,G,Z]);const te=Ee(!1);Te(()=>{if(G&&!H)return J(e=>{if("Escape"!==e.key||document.activeElement!==W.current)return!1;const r=q.current;if(E(R.current)===r)return!1;const n=pn(r,a);return R.current=n,O(n),_.current!==r&&(L??t)(r),ee(),!0})},[G,H,a,t,L]);const re=()=>{const e=E(R.current);if(null==e){if(!k){const e=pn(_.current,a);return R.current=e,O(e),_.current}return R.current="",O(""),null!==_.current&&t(null),null}let i=e;const o=a??(N?Math.max(mn(l??1),mn(r??0)):void 0);N&&(i=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(i,l??1,r??0)),null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n),null!=o&&(i=Number(i.toFixed(o)));const s=pn(i,a);return R.current=s,O(s),i===e&&i===_.current||t(i),i},ne=/* @__PURE__ */Ye("input",{ref:K,id:g,name:f,type:"text",inputMode:0===a?"numeric":"decimal",value:!G&&M?M(e):T,disabled:s,readOnly:c,placeholder:u,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?u||void 0:`${pn(e,a)}${z&&F?F:""}`,"aria-describedby":A,"data-appearance":z?"bare":void 0,...B,autoComplete:z?"off":void 0,spellCheck:!z&&void 0,"aria-invalid":d||void 0,"aria-label":D,"aria-labelledby":S,onChange:e=>(e=>{if(c)return;const r=F&&e.trimEnd().endsWith(F)?e.trimEnd().slice(0,-F.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(O(e),!C)return;const n=E(e);(null!==n||k)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!H)return q.current=re(),void ee();const t=l??1,r=o??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||H||(e.preventDefault(),V(n))},onFocus:()=>{q.current=_.current,X(!0),te.current=!0,y?.()},onMouseUp:z?e=>{te.current&&(te.current=!1,e.preventDefault())}:void 0,onBlur:()=>{X(!1),te.current=!1,re(),x?.()},className:z?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G?"bg-white":"bg-transparent",H?"cursor-default":"cursor-text",b].filter(Boolean).join(" "):i({invalid:d,size:h,readOnly:c,className:[m?"pl-8":"",U?p?"pr-12":"pr-6":v?p?"pr-24":"pr-16":p?"pr-10":"","text-right tabular-nums",b].filter(Boolean).join(" ")})});if(z||!m&&!p&&!v)return ne;const ae=E(T);/* @__PURE__ */
|
|
144
|
+
return Ge("div",{className:"relative",children:[m&&/* @__PURE__ */Ye("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),ne,p&&/* @__PURE__ */Ye("span",{className:`pointer-events-none absolute ${U?"right-6":v?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:p}),v&&(()=>{const e=/* @__PURE__ */Ye(gn,{dir:-1,compact:U,label:I.number.decrease,disabled:H||null!=r&&null!=ae&&ae<=r,onStep:e=>Y.current(-(e?o??10*(l??1):l??1))}),t=/* @__PURE__ */Ye(gn,{dir:1,compact:U,label:I.number.increase,disabled:H||null!=n&&null!=ae&&ae>=n,onStep:e=>Y.current(e?o??10*(l??1):l??1)});/* @__PURE__ */
|
|
145
|
+
return Ge("span",U?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),bn=(e,t,r)=>Math.min(r,Math.max(t,e));var xn=8,yn=40;var vn="undefined"==typeof window?Te:Ve;function wn(e,t,r,n){return Number(bn(e,t,r).toFixed(n))}var Nn=Oe(null);function kn({children:e}){const[t,r]=Fe({}),n=Ie(()=>(e,t)=>r(r=>{if(null===t){if(!(e in r))return r;const t={...r};return delete t[e],t}return r[e]===t?r:{...r,[e]:t}}),[]),a=Ie(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
146
146
|
return Ye(Nn.Provider,{value:a,children:e})}function $n({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:x,size:y="md",className:v=""}){const w=he(),N=Be(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),M=o??r,C=s??n,L=void 0!==u||void 0!==h,D=m??h,S=bn(e??h??r,r,n),A=Ee(null),[P,j]=Fe(null),z=Boolean(c);vn(()=>{const e=()=>{const e=A.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,r)=>e+(parseFloat(t[r])||0),0);r<=0||j(e=>e&&e.frame===r&&e.fontSize===t.fontSize?e:{frame:r,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[z,d]);const F=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,E=null==e?u??(null!=h?F(h)??String(h):void 0):F(e),B=`calc(${I=[r.toFixed($),n.toFixed($),e?.toFixed($),u,h?.toFixed($)],Math.max(1,...I.map(e=>(e??"").length))}ch + ${(P?.frame??10+(z?yn:xn))+2}px)`;var I;const T=qe(Nn),O=Be(),R=T?.set;return vn(()=>{R&&R(O,d?B:null)},[R,O,B,d]),Te(()=>()=>R?.(O,null),[R,O]),/* @__PURE__ */Ge("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
147
147
|
/* @__PURE__ */Ye("input",{id:k,type:"range",min:r,max:n,step:a,value:S,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":E,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=D))return;i.preventDefault();t(wn((e??D??S)+o*(s?l??a:a),r,n,$))},onChange:e=>t(wn(Number(e.target.value),r,n,$)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===y?"h-1":"h-1.5")}),d&&
|
|
148
148
|
/* @__PURE__ */Ye("div",{ref:A,className:"shrink-0 text-xs",style:{width:T?.width??B,...P?{fontSize:P.fontSize}:{}},children:/* @__PURE__ */Ye(fn,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:a,shiftStep:l,stepFrom:D,precision:$,snap:!0,allowEmpty:L,suffix:c,disabled:x,placeholder:u??(null!=h?h.toFixed($):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}function Mn({items:e,onChange:t,label:r,className:n="","aria-labelledby":l,"aria-describedby":i}){const o=he().displayChips,s=Be();/* @__PURE__ */
|
|
@@ -156,22 +156,22 @@ return Ge("div",{role:"group","aria-label":a?void 0:n,"aria-labelledby":a,"aria-
|
|
|
156
156
|
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Ge(_e,{children:[(()=>{const r=F===t,n=En(p.slice(0,t)),a=r?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
157
157
|
return Ye("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */Ye(fn,{appearance:"bare",value:e,display:()=>(e=>P>0&&P*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:Ln,max:100-(u-1)*Ln,step:1,shiftStep:10,precision:0,allowEmpty:!1,reportWhileTyping:!1,readOnly:l,disabled:i,"aria-label":c.column(t+1),"aria-describedby":d,"data-widths-label":"",onChange:e=>{null===e||R(t,e)||A(t,e)},onRevert:e=>((e,t)=>{b.current.locked||null===t||R(e,t)||A(e,t)})(t,e),onFocus:()=>{O.current={column:t,share:e,stored:b.current.stored},T(t,!0)},onBlur:()=>T(t,!1),className:`absolute inset-0 text-xs font-medium ${Rn[t%2]} ${B.includes(t)&&!r?"opacity-0":""}`})})})(),t<u-1&&/* @__PURE__ */Ye("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${K[t]}%`},children:/* @__PURE__ */Ye($,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */Ye("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":Ln,"aria-valuemax":p[t]+p[t+1]-Ln,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":g||void 0,onKeyDown:g?void 0:v(t),onPointerDown:L(t),onPointerMove:D,onPointerUp:S,onPointerCancel:S,onLostPointerCapture:()=>{N.current&&C()},className:"group/widths flex h-full w-full touch-none justify-center rounded-(--radius-control) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(g?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(g?`${Tn} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${k===t?"w-1":On}`)})})})})]},t))]}),u>1&&!o&&/* @__PURE__ */Ye("span",{id:d,className:"sr-only",children:c.hint(u,Ln)}),u>1&&o&&/* @__PURE__ */Ye("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
|
|
158
158
|
/* @__PURE__ */Ye("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,Ln)}),
|
|
159
|
-
/* @__PURE__ */Ye(w,{variant:"secondary",size:"sm",disabled:g,onClick:()=>{g||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var Kn=/(^|[\s:])!?z-/;function qn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:b="",triggerClassName:x,panelClassName:y=""}){const[v,w]=Fe(s),N=(o??v)&&!f,k=ae(),$=Ee(null),M=Ee(null),C=Ee(null),L=Ee(null),j=Be(),z=m??j,F=Be(),I=Be(),T=Be(),O=Ee(null),W=Ee(!1),K=Ee({openProp:o,onOpenChange:c});K.current={openProp:o,onOpenChange:c};const q=ze(e=>{void 0===K.current.openProp&&w(e),K.current.onOpenChange?.(e)},[]),_=ze((e=!1)=>{W.current=e,q(!1)},[q]),
|
|
159
|
+
/* @__PURE__ */Ye(w,{variant:"secondary",size:"sm",disabled:g,onClick:()=>{g||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var Kn=/(^|[\s:])!?z-/;function qn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:b="",triggerClassName:x,panelClassName:y=""}){const[v,w]=Fe(s),N=(o??v)&&!f,k=ae(),$=Ee(null),M=Ee(null),C=Ee(null),L=Ee(null),j=Be(),z=m??j,F=Be(),I=Be(),T=Be(),O=Ee(null),W=Ee(!1),K=Ee({openProp:o,onOpenChange:c});K.current={openProp:o,onOpenChange:c};const q=ze(e=>{void 0===K.current.openProp&&w(e),K.current.onOpenChange?.(e)},[]),_=ze((e=!1)=>{W.current=e,q(!1)},[q]),H=e=>{O.current=e.nativeEvent},U=ze(()=>{const e=C.current,t=M.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=D(t),a=Math.max(0,n.right-n.left-2*S),o=e.style;o.left="0px",o.top="0px",o.maxWidth=`${a}px`,o.maxHeight="none",o.width=d?`${Math.min(r.width,a)}px`:"";const s={width:e.offsetWidth,height:e.offsetHeight},c=u??1/0,h=A({trigger:r,menu:{width:s.width,height:Math.min(s.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);o.left=`${h.left}px`,o.top=`${h.top}px`,o.maxHeight=`${m}px`,o.overflowY=s.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);re(()=>{N&&k&&U()}),Te(()=>{if(!N||!k)return;const e=P(()=>M.current,U),t=L.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>U());return r.observe(t),()=>{e(),r.disconnect()}},[N,k,U]),Te(()=>{if(!N)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(O.current===e)return!1;const t=e.target;return!(t&&($.current?.contains(t)||C.current?.contains(t)))})(e)&&_(!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=Q(()=>_()),a=J(e=>"Escape"===e.key&&(_(),M.current?.focus(),!0),()=>C.current);return()=>{t(),r(),n(),a()}},[N,_]),E(C,N&&k),re(()=>{if(!N||!k)return;const e=C.current;return()=>{if(W.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||M.current?.focus({preventScroll:!0})}},[N,k]),Te(()=>{if(!N||!k)return;const e=C.current;e&&(W.current=!1,(h?.current??B(e)[0]??e).focus({preventScroll:!0}))},[N,k]);const V="function"==typeof t?t({close:()=>_()}):t,Y=r?{"aria-labelledby":I}:a?{"aria-label":a}:{"aria-labelledby":z};/* @__PURE__ */
|
|
160
160
|
return Ge("div",{ref:$,className:`relative inline-flex ${b}`.trim(),children:[
|
|
161
|
-
/* @__PURE__ */Ye("button",{ref:M,id:z,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&k?F:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>N?_():q(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!N)return;const t=(()=>{const e=C.current;return e?B(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:x??te({variant:"secondary"}),children:e}),N&&k&&
|
|
162
|
-
/* @__PURE__ */Ye("div",{ref:C,id:F,role:"dialog",...Y,"aria-describedby":n?T:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:
|
|
163
|
-
return Ye("button",{ref:i,type:a,"aria-pressed":r,className:ea({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qn(e)})})}),ra=(e,t,r)=>Math.min(r,Math.max(t,e)),na=e=>"string"==typeof e?{value:e}:e;var aa={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function la({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=he().color,h=
|
|
164
|
-
return Ge("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(D.length>0||a)&&/* @__PURE__ */Ge("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */Ye($,{content:u.clear,children:/* @__PURE__ */Ye(ta,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),D.map(e=>{const t=
|
|
161
|
+
/* @__PURE__ */Ye("button",{ref:M,id:z,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&k?F:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>N?_():q(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!N)return;const t=(()=>{const e=C.current;return e?B(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:x??te({variant:"secondary"}),children:e}),N&&k&&Ze(
|
|
162
|
+
/* @__PURE__ */Ye("div",{ref:C,id:F,role:"dialog",...Y,"aria-describedby":n?T:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:H,onFocusCapture:H,onKeyDown:e=>{const t=C.current,r=M.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=B(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=R(r,t);_(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${y}`.trim(),style:Kn.test(y)?void 0:{zIndex:ee.popup},children:/* @__PURE__ */Ge("div",{ref:L,children:[r&&/* @__PURE__ */Ye("h2",{id:I,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */Ye("p",{id:T,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */Ye("div",{className:"mt-3",children:V}):V]})}),document.body)]})}var _n=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function Hn(e){const t=e.trim().replace(/^#/,"");if(!_n.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Un=e=>e.toUpperCase(),Vn=(e,t,r)=>Math.min(r,Math.max(t,e));function Yn(e){const t=Hn(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 Gn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Vn(t,0,1),l=Vn(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 Xn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Gn({h:e%360,s:1,v:1})).join(", ")})`,Zn={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Jn={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Qn(e){return e?{background:e}:Jn}function ea({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",Zn[e],r].filter(Boolean).join(" ")}var ta=je(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
163
|
+
return Ye("button",{ref:i,type:a,"aria-pressed":r,className:ea({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qn(e)})})}),ra=(e,t,r)=>Math.min(r,Math.max(t,e)),na=e=>"string"==typeof e?{value:e}:e;var aa={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function la({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=he().color,h=Hn(l??""),[m,p]=Fe(()=>Yn(e||h||"")),g=Ee(e);Te(()=>{e!==g.current&&(g.current=e,e?p(Yn(e)):h&&p(Yn(h)))},[e]);const f=r=>{o||r===e||(g.current=r,t(r))},b=e=>{const t=Hn(e);t&&(p(Yn(t)),f(t))},x=e=>{p(e),f(Gn(e))},[y,v]=Fe(!1),w=Ee(m);w.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,w.current);"end"===i?(v(!0),p(r)):x(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,w.current);"end"===i?p(r):x(r)},onPointerUp:t=>{"end"===i&&y&&(v(!1),x(e(t,w.current)))}}),k=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Vn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Vn((n-a.top)/a.height,0,1):0})};var r,n,a}),M=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Vn((r-n.left)/n.width,0,1)):0)};var r,n}),C=y?Gn(m):e,L=e=>`${Math.round(100*e)}%`,D=(n??[]).map(na),S=Hn(e);/* @__PURE__ */
|
|
164
|
+
return Ge("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(D.length>0||a)&&/* @__PURE__ */Ge("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */Ye($,{content:u.clear,children:/* @__PURE__ */Ye(ta,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),D.map(e=>{const t=Hn(e.value),r=e.label?`${e.label} · ${Un(t??e.value)}`:Un(t??e.value);/* @__PURE__ */
|
|
165
165
|
return Ye($,{content:r,children:/* @__PURE__ */Ye(ta,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===S,disabled:o,onClick:()=>b(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
166
166
|
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)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:ra(e.s+a[0],0,1),v:ra(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),x(t))},...k,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:Gn({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */Ye("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(m.s),top:L(1-m.v),...aa}})}),
|
|
167
167
|
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return ra(e-n,0,359);case"ArrowRight":case"ArrowUp":return ra(e+n,0,359);case"PageDown":return ra(e-10,0,359);case"PageUp":return ra(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),x({...m,h:t}))},...M,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:Xn},children:/* @__PURE__ */Ye("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:m.h/360*100+"%",background:Gn({h:m.h,s:1,v:1}),...aa}})}),
|
|
168
168
|
/* @__PURE__ */Ge("div",{className:"flex items-center gap-2",children:[
|
|
169
169
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Qn(C||(h??""))}),
|
|
170
|
-
/* @__PURE__ */Ye(oa,{value:C,placeholder:!e&&h?
|
|
171
|
-
return Ye("input",{id:l,type:"text",value:c??(e?
|
|
170
|
+
/* @__PURE__ */Ye(oa,{value:C,placeholder:!e&&h?Un(h):void 0,onChange:b,label:u.hex(r),disabled:o})]})]})}var ia={sm:"w-[calc(7ch+1rem+4px)] min-w-[calc(7ch+1rem+4px)]",md:"w-[calc(7ch+1.5rem+4px)] min-w-[calc(7ch+1.5rem+4px)]",lg:"w-[calc(7ch+2rem+4px)] min-w-[calc(7ch+2rem+4px)]"};function oa({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,size:o="md",className:s=""}){const[c,d]=Fe(null);/* @__PURE__ */
|
|
171
|
+
return Ye("input",{id:l,type:"text",value:c??(e?Un(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{d(r.target.value);const n=Hn(r.target.value);null!==n&&n!==e&&t(n)},onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d(null))},onBlur:()=>d(null),className:i({size:o,className:`${ia[o]} flex-1 font-mono uppercase ${s}`.trim()}).replace(/(^| )w-full( |$)/," ")})}function sa({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=he().color,f=Be(),b=Hn(l??""),x=e||b||"",y=e?Un(e):b?Un(b):g.none;/* @__PURE__ */
|
|
172
172
|
return Ge("div",{className:`inline-flex items-center gap-2 ${p}`.trim(),children:[
|
|
173
173
|
/* @__PURE__ */Ye(qn,{id:s,trigger:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute inset-0",style:Qn(x)}),triggerLabel:g.swatch(r,y),triggerClassName:ea({size:d}),"aria-label":g.panel(r),align:u,open:h,onOpenChange:m,disabled:o,children:/* @__PURE__ */Ye(la,{id:f,value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o})}),c&&
|
|
174
|
-
/* @__PURE__ */Ye("div",{className:"w-24 flex-none",children:/* @__PURE__ */Ye(oa,{value:e,placeholder:!e&&b?
|
|
174
|
+
/* @__PURE__ */Ye("div",{className:"w-24 flex-none",children:/* @__PURE__ */Ye(oa,{value:e,placeholder:!e&&b?Un(b):void 0,onChange:r=>{o||r===e||t(r)},label:g.hex(r),disabled:o,size:d})})]})}var ca={background:"color-mix(in srgb, var(--status-on-solid) 45%, transparent)"},da={borderColor:"var(--status-on-solid)",boxShadow:"0 0 0 1px var(--rosh-media-scrim-button), 0 1px 4px var(--rosh-media-scrim-button)"};function ua({value:e,onChange:t,label:r,image:n,hint:a,emptyText:l,actions:i,disabled:o=!1,id:s,className:c=""}){const d=he().imageFocus,u=Be(),h=Ee(null),m=Ee(!1),{x:p,y:g}=ye(e),f=ve(p,g),b=r=>{r!==e&&t(r)},x=(e,t)=>{const r=h.current?.getBoundingClientRect();if(!r)return;const n=Ne(r,e,t);b(ve(n.x,n.y))},y=()=>{m.current=!1};if(!n)/* @__PURE__ */
|
|
175
175
|
return Ye("div",{"data-image-focus":"",className:c||void 0,children:/* @__PURE__ */Ye("p",{className:"text-xs text-gray-500",children:l??d.noImage})});const v=void 0===a,w=null!==a;/* @__PURE__ */
|
|
176
176
|
return Ge("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim(),children:[
|
|
177
177
|
/* @__PURE__ */Ye("button",{id:s,type:"button","data-image-focus-picture":"",disabled:o,"aria-label":d.picture(r,f),"aria-describedby":u,onKeyDown:t=>{if(o||t.altKey||t.ctrlKey||t.metaKey)return;const r=we(e,t.key,t.shiftKey);null!==r&&(t.preventDefault(),b(r))},onPointerDown:e=>{o||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),m.current=!0,x(e.clientX,e.clientY))},onPointerMove:e=>{m.current&&!o&&x(e.clientX,e.clientY)},onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,className:["flex min-h-36 w-full touch-none items-center justify-center overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-0","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o?"cursor-not-allowed opacity-60":"cursor-crosshair"].join(" "),children:/* @__PURE__ */Ge("span",{ref:h,"data-image-focus-pane":"",className:"relative block max-w-full",children:[
|
|
@@ -179,27 +179,27 @@ return Ge("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim
|
|
|
179
179
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...ca}}),
|
|
180
180
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...ca}}),
|
|
181
181
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...da}})]})}),w||i?/* @__PURE__ */Ge("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */Ye("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:a}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */Ye("span",{id:u,className:"sr-only",children:d.hint})]})}function ha({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
182
|
-
return Ye("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 ma(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:d,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:x=!0,"aria-label":y,"aria-labelledby":M,"aria-describedby":C}=e,L=!0===e.multiple,D=e.multiple?e.value:e.value?[e.value]:[],S=e.multiple?"":e.value,A=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},P=D.length>0,j=o&&P&&!l,z=L||o,F=null!=c,E=s||F,[B,I]=Fe(!1),[T,O]=Fe(-1),R=Be(),W=i??`${R}-input`,K=`${R}-listbox`,q=e=>`${R}-opt-${e}`,[_,
|
|
183
|
-
return Ge("div",{ref:
|
|
184
|
-
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Ye("span",{ref:ve,className:"whitespace-pre"})}),be&&/* @__PURE__ */Ye(ha,{ariaLabel:
|
|
182
|
+
return Ye("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 ma(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:d,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:x=!0,"aria-label":y,"aria-labelledby":M,"aria-describedby":C}=e,L=!0===e.multiple,D=e.multiple?e.value:e.value?[e.value]:[],S=e.multiple?"":e.value,A=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},P=D.length>0,j=o&&P&&!l,z=L||o,F=null!=c,E=s||F,[B,I]=Fe(!1),[T,O]=Fe(-1),R=Be(),W=i??`${R}-input`,K=`${R}-listbox`,q=e=>`${R}-opt-${e}`,[_,H]=Fe(""),U=he(),V=n??U.select.none,Y=e=>{H(e),O(-1),d?.(e)},Z=Ee(null),te=Ee(null),ne=Ee(null),ae=Ee(null),le=Ee(B);le.current=B;const ie=Ee(!1),oe=e=>{le.current&&(le.current=!1,e&&s&&!F&&Ae&&(L?D.includes(Ae)||A([...D,Ae]):Ae!==S&&A([Ae])),I(!1),Y(""))},se=(e,t)=>{if(!e.disabled){if(L)return A(D.includes(e.value)?D.filter(t=>t!==e.value):[...D,e.value]),void(e===Pe?Y(""):O(t));A([e.value]),oe(!1)}},[ce,de]=Fe(null);re(()=>{if(!f||B)return void de(null);const e=ae.current?.offsetWidth??0;de(e?e+(be?32:8)+6:null)});const ue=N(te,B,z?{popupRef:ne}:{matchTriggerWidth:!0}),me=Ie(()=>lt(t),[t]),pe=D.join("\0"),ge=Ie(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of me)D.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(E)for(const r of D)t.has(r)||e.push(r);return e},[me,pe,E]),fe=ge.join(", "),be=x&&P&&!l,[xe,ye]=Fe(null),ve=Ee(null),we=Ee(""),Ne=Ee(()=>{});Ne.current=()=>{const e=te.current,t=ve.current;if(!L||!e||!t)return;const r=getComputedStyle(e),n=e.clientWidth-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0),a=[r.fontStyle,r.fontWeight,r.fontSize,r.fontFamily,r.letterSpacing].join("|"),l=`${n}|${a}|${ge.join("\0")}`;if(l===we.current)return;we.current=l;let i=null;n>0&&ge.length>0&&(t.style.fontStyle=r.fontStyle,t.style.fontWeight=r.fontWeight,t.style.fontSize=r.fontSize,t.style.fontFamily=r.fontFamily,t.style.letterSpacing=r.letterSpacing,i=function(e,t){const r=e.length;if(0===r||t(e.join(", ")))return{shown:r,cut:!1};if(1===r)return{shown:1,cut:!0};let n=0;for(let a=1;a<r&&t(`${e.slice(0,a).join(", ")} +${r-a}`);a+=1)n=a;return{shown:n,cut:!1}}(ge,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),ye(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},re(()=>{Ne.current()}),Te(()=>{const e=te.current;if(!L||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ne.current());return t.observe(e),()=>t.disconnect()},[L]);const ke=ge.length,$e=!L||!xe||xe.shown>=ke?fe:0===xe.shown?U.select.selectedCount(ke):`${ge.slice(0,xe.shown).join(", ")} +${ke-xe.shown}`,Me=L&&null!==xe&&(xe.shown<ke||xe.cut),Ce=B&&P&&z;Te(()=>{if(!B)return;const e=e=>{const t=e.target;Z.current?.contains(t)||ne.current?.contains(t)||oe(!0)};document.addEventListener("mousedown",e);const t=Q(()=>oe(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[B,s,_,pe,e.onChange]),Te(()=>{if(B)return J(e=>!("Escape"!==e.key||!le.current)&&(oe(!1),te.current?.blur(),!0),()=>ne.current)},[B]);const Le=Ie(()=>{const e=/* @__PURE__ */new Set;return it(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),De=Ie(()=>{if(d)return Le;const e=_.trim().toLowerCase();return e?it(Le,t=>ct(t,e)):Le},[Le,_,d]),Se=Ie(()=>lt(De),[De]),Ae=_.trim(),Pe=Ie(()=>F&&Ae?me.some(e=>e.label===Ae)||D.includes(Ae)?null:{value:Ae,label:Ae}:null,[F,Ae,me,pe]),je=Ie(()=>Pe?[...Se,Pe]:Se,[Se,Pe]);/* @__PURE__ */
|
|
183
|
+
return Ge("div",{ref:Z,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Z.current?.contains(t)||ne.current?.contains(t))||ie.current||document.activeElement!==te.current&&oe(!0)},children:[(ze=/* @__PURE__ */Ye("input",{id:W,ref:te,type:"text",autoComplete:"off",role:"combobox","aria-expanded":B,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":B?K:void 0,"aria-activedescendant":B&&T>=0&&T<je.length?q(T):void 0,"aria-label":M?void 0:y,"aria-labelledby":M,"aria-describedby":C,value:B?_:$e,onChange:e=>{Y(e.target.value),I(!0)},onFocus:()=>{l||(Y(""),I(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!B)return void I(!0);if(0===je.length)return;const t="ArrowDown"===e.key?1:-1;return void O(e=>rt(je,e,t))}"Enter"===e.key?(e.preventDefault(),B&&T>=0&&T<je.length?se(je[T],T):1!==Se.length||Se[0].disabled?s&&!F&&Ae&&(L?(D.includes(Ae)||A([...D,Ae]),Y("")):(A([Ae]),oe(!1),te.current?.blur())):se(Se[0],0)):"Escape"===e.key?(oe(!1),te.current?.blur()):"Tab"===e.key&&oe(!0)},placeholder:Ce?$e:r||V,className:`${j?u:h} ${a} ${be?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Ce?" rosh-field-shows-choice":""}`,style:ce?{paddingRight:ce}:void 0,disabled:l}),L?/* @__PURE__ */Ye($,{content:!B&&Me?fe:null,className:"block",children:ze}):ze),L&&
|
|
184
|
+
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Ye("span",{ref:ve,className:"whitespace-pre"})}),be&&/* @__PURE__ */Ye(ha,{ariaLabel:U.select.clear,onClear:()=>{A([]),oe(!1)}}),f&&!B&&/* @__PURE__ */Ye("div",{ref:ae,className:`absolute top-1/2 -translate-y-1/2 ${be?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:f}),B&&Ze(
|
|
185
185
|
/* @__PURE__ */Ge("div",{ref:ne,onMouseDownCapture:()=>{ie.current=!0,setTimeout(()=>{ie.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ee.popup,left:ue?.left,right:ue?.right,top:ue?.top,bottom:ue?.bottom,minWidth:ue?.minWidth,width:ue?.width,...z&&{maxWidth:ue?.maxWidth},visibility:ue?void 0:"hidden",...G()},children:[L&&P&&x&&!l&&
|
|
186
|
-
/* @__PURE__ */Ye("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),A([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${X}`,children:
|
|
187
|
-
/* @__PURE__ */Ye(v,{size:"sm",padding:"py-2",label:
|
|
188
|
-
/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1",children:p}),g&&/* @__PURE__ */Ye(w,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:g,className:"shrink-0",children:
|
|
189
|
-
/* @__PURE__ */Ge("div",{id:K,role:je.length?"listbox":void 0,"aria-labelledby":je.length?M??(y?void 0:W):void 0,"aria-label":je.length&&!M?y:void 0,"aria-multiselectable":!(!je.length||!L)||void 0,className:"overflow-y-auto",style:{maxHeight:ue?.maxHeight??k},children:[0===je.length?m||p?null:/* @__PURE__ */Ye("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:
|
|
186
|
+
/* @__PURE__ */Ye("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),A([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-gray-50 border-b ${X}`,children:U.select.clearAll}),m?
|
|
187
|
+
/* @__PURE__ */Ye(v,{size:"sm",padding:"py-2",label:U.search.searching}):p?/* @__PURE__ */Ge("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
188
|
+
/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1",children:p}),g&&/* @__PURE__ */Ye(w,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:g,className:"shrink-0",children:U.list.retry})]}):null,
|
|
189
|
+
/* @__PURE__ */Ge("div",{id:K,role:je.length?"listbox":void 0,"aria-labelledby":je.length?M??(y?void 0:W):void 0,"aria-label":je.length&&!M?y:void 0,"aria-multiselectable":!(!je.length||!L)||void 0,className:"overflow-y-auto",style:{maxHeight:ue?.maxHeight??k},children:[0===je.length?m||p?null:/* @__PURE__ */Ye("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:U.select.noMatches}):0===Se.length?null:ot(De,(e,t)=>{const r=D.includes(e.value);/* @__PURE__ */
|
|
190
190
|
return Ge("button",{id:q(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||L)&&r.preventDefault(),se(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${r?"text-blue-600 font-medium":"text-gray-700"} ${t===T?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[L&&/* @__PURE__ */Ye(st,{selected:r}),
|
|
191
191
|
/* @__PURE__ */Ye("span",{className:`min-w-0 ${z?"flex-auto":"flex-1"} truncate`,children:b?b(e,{selected:r,active:t===T}):e.label}),e.sublabel&&/* @__PURE__ */Ye(dt,{grows:z,children:e.sublabel})]},e.value)},R),Pe&&c&&
|
|
192
|
-
/* @__PURE__ */Ye("button",{id:q(Se.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{L&&e.preventDefault(),se(Pe,Se.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Se.length?`border-t ${X}`:""} ${T===Se.length?"bg-gray-100":""}`,children:/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1 truncate",children:c(Pe.value)})},`${R}-typed`)]})]}),document.body)]});var ze}function pa(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var ga="address",fa={kindOf:()=>ga,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},ba=e=>p(e.trim());function xa(e){const{value:t,kinds:r,rules:n=fa,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=he().link,u=n.isSafe??ba,h=Be(),m=Ee(null),p=Ee(null),[g,f]=Fe({url:t}),b=c?g.url:t,[x,y]=Fe(!1),[v,N]=Fe(null),[k,$]=Fe(null),M=Ee(()=>{});M.current=c?e.onCancel:()=>{},Te(()=>{if(c)return
|
|
192
|
+
/* @__PURE__ */Ye("button",{id:q(Se.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{L&&e.preventDefault(),se(Pe,Se.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Se.length?`border-t ${X}`:""} ${T===Se.length?"bg-gray-100":""}`,children:/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1 truncate",children:c(Pe.value)})},`${R}-typed`)]})]}),document.body)]});var ze}function pa(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var ga="address",fa={kindOf:()=>ga,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},ba=e=>p(e.trim());function xa(e){const{value:t,kinds:r,rules:n=fa,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=he().link,u=n.isSafe??ba,h=Be(),m=Ee(null),p=Ee(null),[g,f]=Fe({url:t}),b=c?g.url:t,[x,y]=Fe(!1),[v,N]=Fe(null),[k,$]=Fe(null),M=Ee(()=>{});M.current=c?e.onCancel:()=>{},Te(()=>{if(c)return J(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&(M.current(),!0)},()=>m.current)},[c]),Te(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const C=r??[{value:ga,label:d.address,target:{type:"text"}}],L=v&&v.against===b?v.kind:n.kindOf(b),D=C.filter(e=>!e.hideWhenEmpty||pa(e.target).length>0||e.value===L),S=D.find(e=>"text"===e.target.type),A=D.find(e=>e.value===L)??S??D[0];if(!A)return null;const P="text"!==A.target.type,j=P?n.targetOf(b):b,z=pa(A.target),F=z.find(e=>e.value===j),E=e=>({value:e,label:d.unavailable(e)}),B="select"===A.target.type&&j&&a?a(j):null,I=B?n.readFilter(b):null,T=I?B?.find(e=>e.param===I.param):void 0,O=k&&k.against===b?k.text:b,R=!P&&""!==O.trim()&&!u(O),W=R&&(!c||x),K=(t,r)=>{c?f({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},q=(e,t)=>{N(t=>t?{...t,against:e}:t),K(e,t)},_=e=>{if(!e)return q("");const t=z.find(t=>t.value===e);q(e,t?.label)},H=P?b:O.trim(),U=()=>{if(!c||!H)return;if(!P&&R)return void y(!0);const t=P&&g.url===H?g.name:void 0,r=e.onApply;void 0===t?r(H):r(H,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[E(t),...e]:[...e],Y=(e,t,r,n,a)=>{const l=[];for(const e of r){const t=l[l.length-1],r={value:e.value,label:e.label};e.group?t&&"options"in t&&t.label===e.group?t.options.push(r):l.push({label:e.group,options:[r]}):l.push(r)}if(a){const a=r.some(e=>""===e.value);/* @__PURE__ */
|
|
193
193
|
return Ye(ma,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
194
|
-
return Ye(pt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===A.target.type)G=/* @__PURE__ */Ye(
|
|
195
|
-
return Ye("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const
|
|
196
|
-
return Ge("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),
|
|
197
|
-
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2",children:[
|
|
194
|
+
return Ye(pt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===A.target.type)G=/* @__PURE__ */Ye(Je,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:W,"aria-label":d.address,"aria-describedby":W?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:O,readOnly:i,onChange:e=>(e=>{y(!1);const t=e.trim();t?u(e)?($({text:e,against:t}),q(t)):$({text:e,against:b}):($({text:e,against:""}),q(""))})(e.target.value)});else{const e="groups"===A.target.type?A.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):A.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:A.target.placeholder},...V(e,j)];G=Y(A.label,j,t,_,e.length>10)}const X=/* @__PURE__ */Ge(Xe,{children:[r&&Y(d.linkType,A.value,D.map(e=>({value:e.value,label:e.label})),e=>{$(null),y(!1);const t=D.find(t=>t.value===e);if(!t||"text"===t.target.type)return void N({kind:e,against:b});const r=pa(t.target)[0];N({kind:e,against:r?r.value:""}),r?K(r.value,r.label):K("")},!1),G,B&&Y(d.filter,I?.param??"",[{value:"",label:d.noFilter},...I&&!T?[E(I.param)]:[],...B.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return q(j,F?.label);const t=B?.find(t=>t.param===e),r=t?.values[0];r&&q(n.withFilter(j,{param:e,value:r.value}),r.label)},!1),B&&I&&Y(d.value,I.value,V((T?.values??[]).map(e=>({value:e.value,label:e.label})),I.value),e=>{if(!I)return;const t=T?.values.find(t=>t.value===e);q(n.withFilter(j,{param:I.param,value:e}),t?.label)},(T?.values.length??0)>10),W&&/* @__PURE__ */Ye("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),A.hint&&/* @__PURE__ */Ye("p",{className:"text-2xs leading-4 text-gray-400",children:A.hint}),B&&/* @__PURE__ */Ye("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
|
|
195
|
+
return Ye("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const Z=e.onRemove;/* @__PURE__ */
|
|
196
|
+
return Ge("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),U())},children:[P?/* @__PURE__ */Ye("span",{className:$t({inline:!0}),children:d.title}):/* @__PURE__ */Ye("label",{htmlFor:`${h}-address`,className:$t({inline:!0}),children:d.title}),X,
|
|
197
|
+
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2",children:[Z?/* @__PURE__ */Ye(w,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:Z,children:d.remove}):null,
|
|
198
198
|
/* @__PURE__ */Ge("span",{className:"ml-auto flex gap-1",children:[
|
|
199
199
|
/* @__PURE__ */Ye(w,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>M.current(),children:d.cancel}),
|
|
200
|
-
/* @__PURE__ */Ye(w,{variant:"primary",size:"sm","data-window-action":"apply",onClick:
|
|
200
|
+
/* @__PURE__ */Ye(w,{variant:"primary",size:"sm","data-window-action":"apply",onClick:U,disabled:i||""===H,children:d.apply})]})]})]})}function ya({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:d=""}){const u=he().link,[h,p]=Fe(!1),g=Ee(null),f=Be(),b=()=>{p(!1),g.current?.focus()};/* @__PURE__ */
|
|
201
201
|
return Ge("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),children:[
|
|
202
|
-
/* @__PURE__ */Ye(
|
|
202
|
+
/* @__PURE__ */Ye(Je,{size:"sm",type:"text",className:"rounded-b-none","aria-label":u.text(e),placeholder:s,value:t,readOnly:c,onChange:e=>r(e.target.value)}),
|
|
203
203
|
/* @__PURE__ */Ge("button",{ref:g,type:"button","aria-label":u.linkOf(e,n),"aria-expanded":h,"aria-controls":h?f:void 0,disabled:c,onClick:()=>p(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${m.sm} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
204
204
|
/* @__PURE__ */Ye(Ae,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(n?"text-blue-600":"text-gray-400")}),
|
|
205
205
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||u.addLink})]}),h&&/* @__PURE__ */Ye("div",{id:f,className:"mt-2",children:/* @__PURE__ */Ye(xa,{value:n,label:u.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),b()},onRemove:n?()=>{a(""),b()}:void 0,onCancel:b})})]})}var va=e=>e.preventDefault(),wa=e=>null!=e&&!1!==e,Na=["bold","italic","underline","strike","link","sup","sub"],ka=["left","center","right","justify"];function $a(e,t,r){const n={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===n||0===t.length)return;const a=[...e.currentTarget.querySelectorAll('[role="radio"]')],l=a.findIndex(t=>t===e.target||t.contains(e.target));if(l<0)return;e.preventDefault();const i=a.length,o="first"===n?0:"last"===n?i-1:(l+n+i)%i;a[o].disabled||(r(t[o]),a[o].focus())}function Ma(e,t){const r=["bold","italic","underline","strike"].filter(t=>e.has(t)).length;return{color:r,link:r+(t?1:0)}}function Ca({offered:e,color:t,last:r,alignment:n,list:a,letterCase:l}){const i=Na.filter(t=>e.has(t)).length+(t?1:0)+(wa(r)?1:0),o=(n?ka.filter(e=>n.allow.includes(e)).length:0)+(a&&e.has("bullet")?1:0)+(a&&e.has("number")?1:0)+(l?3:0);return{words:i>0,paragraph:o>0,oneRow:i>0&&o>0&&i+1+o<=9,flow:i>0&&o>0&&i+1+o>9&&i<=7}}function La(e,t){/* @__PURE__ */
|
|
@@ -220,7 +220,7 @@ return Ge(yt,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
|
220
220
|
/* @__PURE__ */Ye("input",{...f.inputProps}),e.length>0&&/* @__PURE__ */Ye("ul",{className:"mt-2 flex flex-col gap-1",children:e.map((r,n)=>/* @__PURE__ */Ge("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
|
|
221
221
|
/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:r.name,children:r.name}),
|
|
222
222
|
/* @__PURE__ */Ye("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:ce(r.size,g)}),
|
|
223
|
-
/* @__PURE__ */Ye("button",{type:"button",disabled:o,onClick:()=>{f.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__ */Ye(
|
|
223
|
+
/* @__PURE__ */Ye("button",{type:"button",disabled:o,onClick:()=>{f.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__ */Ye(Ut,{})})]},`${r.name}-${n}`))}),
|
|
224
224
|
/* @__PURE__ */Ye(de,{rejections:f.rejections})]})});function Ea({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
225
225
|
return Ye(Ae,{name:"attach",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function Ba({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
226
226
|
return Ye(Ae,{name:"page",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function Ia({intake:e,dropLabel:t,className:r="",children:n}){const a=he().files;/* @__PURE__ */
|
|
@@ -228,7 +228,7 @@ return Ge("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,childr
|
|
|
228
228
|
/* @__PURE__ */Ye("input",{...e.inputProps}),e.dragOver&&/* @__PURE__ */Ye("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 Ta({files:e,onRemove:t,disabled:r=!1,className:n=""}){const a=he().files,l=Ee(/* @__PURE__ */new Map);Te(()=>{const t=new Set(e);for(const[e,r]of l.current)t.has(e)||(URL.revokeObjectURL(r),l.current.delete(e))},[e]),Te(()=>()=>{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__ */Ye("ul",{className:`flex flex-wrap gap-2 ${n}`,children:e.map((e,n)=>{const l=i(e);/* @__PURE__ */
|
|
229
229
|
return Ge("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */Ye("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */Ye("span",{className:"text-gray-400",children:/* @__PURE__ */Ye(Ba,{})}),
|
|
230
230
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
231
|
-
/* @__PURE__ */Ye("span",{className:"shrink-0 tabular-nums text-gray-400",children:ce(e.size,a)}),t&&/* @__PURE__ */Ye("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__ */Ye(
|
|
231
|
+
/* @__PURE__ */Ye("span",{className:"shrink-0 tabular-nums text-gray-400",children:ce(e.size,a)}),t&&/* @__PURE__ */Ye("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__ */Ye(Ut,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function Oa({onClick:e,count:t=0,variant:n="button",label:a,disabled:l=!1}){const i=he().files,o=a??i.attach,s=t>0?`${o} (${t})`:o;return"icon"===n?/* @__PURE__ */Ge("span",{className:"relative inline-flex",children:[
|
|
232
232
|
/* @__PURE__ */Ye(r,{"aria-label":s,onClick:e,disabled:l,size:"sm",children:/* @__PURE__ */Ye(Ea,{})}),t>0&&/* @__PURE__ */Ye("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-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */Ye(w,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:l,leftIcon:/* @__PURE__ */Ye(Ea,{}),children:s})}function Ra({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=se({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=Ee([]);return Te(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */Ge(Ia,{intake:p,dropLabel:o,className:h,children:[m,
|
|
233
233
|
/* @__PURE__ */Ye(Ta,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
234
234
|
/* @__PURE__ */Ge("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
@@ -237,22 +237,22 @@ return Ge("li",{className:"flex max-w-full items-center gap-2 rounded-md border
|
|
|
237
237
|
return Ge("div",{ref:x,className:"relative",children:[
|
|
238
238
|
/* @__PURE__ */Ge("div",{onMouseDown:e=>{o||e.target.closest("button")||(e.preventDefault(),y.current?.focus())},className:i({invalid:l,multiline:!0,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)] ${o?"bg-gray-50 cursor-not-allowed":""} ${c}`}),children:[e.map(e=>{const t=d?.(e),r=Wa[t??"accent"],n=/* @__PURE__ */Ge("span",{"data-tone":t,className:r.chip,children:[
|
|
239
239
|
/* @__PURE__ */Ye("span",{className:"truncate",children:M(e)}),!o&&/* @__PURE__ */Ye("button",{type:"button","aria-label":b.select.removeItem?.(M(e))??`${b.select.remove} ${M(e)}`,onClick:()=>S(e),className:r.remove,children:"×"})]},e),a=u?.(e);return null==a?n:/* @__PURE__ */Ye($,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
|
|
240
|
-
/* @__PURE__ */Ye("input",{id:s,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&z,"aria-invalid":l||void 0,disabled:o,value:g,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return L(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),p(!0)},onFocus:()=>{!o&&z&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=g.trim(),r=e?C.filter(t=>ct(t,e.toLowerCase())):[];1===r.length?D(r[0].value):A()}else"Backspace"===t.key&&""===g&&e.length>0?S(e[e.length-1]):"Escape"===t.key?(p(!1),f(""),y.current?.blur()):"Tab"===t.key&&(A(),p(!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"})]}),m&&z&&
|
|
240
|
+
/* @__PURE__ */Ye("input",{id:s,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&z,"aria-invalid":l||void 0,disabled:o,value:g,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return L(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),p(!0)},onFocus:()=>{!o&&z&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=g.trim(),r=e?C.filter(t=>ct(t,e.toLowerCase())):[];1===r.length?D(r[0].value):A()}else"Backspace"===t.key&&""===g&&e.length>0?S(e[e.length-1]):"Escape"===t.key?(p(!1),f(""),y.current?.blur()):"Tab"===t.key&&(A(),p(!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"})]}),m&&z&&Ze(
|
|
241
241
|
/* @__PURE__ */Ye("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ee.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??j,width:"max-content",visibility:w?void 0:"hidden",...G()},children:/* @__PURE__ */Ye("div",{className:"overflow-y-auto",style:{maxHeight:w?.maxHeight??k},children:0===C.length?/* @__PURE__ */Ye("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?b.select.allSelected:b.select.noMatches}):C.map(e=>/* @__PURE__ */Ye("button",{type:"button",onMouseDown:t=>{t.preventDefault(),D(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */Ge(Xe,{children:[
|
|
242
242
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate",children:e.label}),
|
|
243
|
-
/* @__PURE__ */Ye(dt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var qa={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"}},_a={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function
|
|
243
|
+
/* @__PURE__ */Ye(dt,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var qa={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"}},_a={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function Ha({children:e,header:t,description:r,footer:n,padded:a=!0,padding:l,headingLevel:i,headerActions:o,"aria-label":s,className:c="",bodyClassName:d="",style:u,tone:h="neutral"}){const m=qa[l??(a?"md":"none")],p=Be(),g=Be(),f=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,x=`h${i}`,y=null!=s&&""!==s,v=b||y,w=v?"section":"div",N=`rounded-(--radius-card) border ${_a[h]} bg-white shadow-sm ${c}`.trim(),k=Re.toArray(e).length>0,$=k?"border-b border-gray-100 ":"",M="current"===h,C=M?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=M?"rounded-t-(--radius-card) bg-blue-50 ":"",D=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
|
|
244
244
|
return Ge(w,{className:N,style:u,...y?{"aria-label":s}:b?{"aria-labelledby":p}:{},...f&&v?{"aria-describedby":g}:{},...M?{"aria-current":!0}:{},children:[f?
|
|
245
245
|
/* @__PURE__ */Ge("div",{className:`${$}${L}${m.edge}`,children:[null!=o?/* @__PURE__ */Ge("div",{className:`flex items-center justify-between gap-3 ${C}`,children:[b?/* @__PURE__ */Ye(x,{id:p,children:t}):/* @__PURE__ */Ye("span",{children:t}),o]}):b?/* @__PURE__ */Ye(x,{id:p,className:C,children:t}):/* @__PURE__ */Ye("div",{className:C,children:t}),
|
|
246
246
|
/* @__PURE__ */Ye("p",{id:g,className:M?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-gray-500",children:r})]}):null!=t&&(null!=o?
|
|
247
247
|
/* @__PURE__ */Ge("div",{className:`${D} flex items-center justify-between gap-3`,children:[b?/* @__PURE__ */Ye(x,{id:p,children:t}):/* @__PURE__ */Ye("span",{children:t}),o]}):b?
|
|
248
|
-
/* @__PURE__ */Ye(x,{id:p,className:D,children:t}):/* @__PURE__ */Ye("div",{className:D,children:t})),k&&/* @__PURE__ */Ye("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */Ye("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function
|
|
248
|
+
/* @__PURE__ */Ye(x,{id:p,className:D,children:t}):/* @__PURE__ */Ye("div",{className:D,children:t})),k&&/* @__PURE__ */Ye("div",{className:[m.body,d].filter(Boolean).join(" "),children:e}),n&&/* @__PURE__ */Ye("div",{className:`border-t border-gray-100 ${m.edge}`,children:n})]})}function Ua({label:e,value:t,icon:r,delta:n,className:a=""}){const l=ue(),i="number"==typeof t&&l?fe(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__ */
|
|
249
249
|
return Ge("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${a}`.trim(),children:[
|
|
250
250
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between text-gray-500",children:[
|
|
251
251
|
/* @__PURE__ */Ye("span",{className:"text-xs font-medium uppercase tracking-wide",children:e}),r]}),
|
|
252
252
|
/* @__PURE__ */Ge("div",{className:"mt-2 flex items-baseline gap-2",children:[
|
|
253
253
|
/* @__PURE__ */Ye("span",{className:"text-2xl font-semibold text-gray-900",children:i}),n&&/* @__PURE__ */Ge("span",{className:`text-xs font-medium ${o}`,children:[s," ",n.value]})]})]})}var Va={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:""},Ya={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"},Ga={normal:"font-normal",medium:"font-medium",semibold:"font-semibold"};function Xa({children:e,tone:t="default",size:r="sm",weight:n="normal",truncate:a=!1,as:l="span",className:i="",...o}){/* @__PURE__ */
|
|
254
|
-
return Ye(l,{className:[Va[t],Ya[r],Ga[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var
|
|
255
|
-
return Ye(`h${t}`,{className:[
|
|
254
|
+
return Ye(l,{className:[Va[t],Ya[r],Ga[n],a?"block truncate":"",i].filter(Boolean).join(" "),title:o.title??(a&&"string"==typeof e?e:void 0),htmlFor:o.htmlFor,children:e})}var Za={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 Ja({children:e,level:t=2,tone:r="default",className:n=""}){/* @__PURE__ */
|
|
255
|
+
return Ye(`h${t}`,{className:[Za[t],Va[r],n].filter(Boolean).join(" "),children:e})}function Qa({children:e,tone:t="secondary",size:r="sm",className:n=""}){/* @__PURE__ */
|
|
256
256
|
return Ye("p",{className:[Va[t],Ya[r],"mb-2 last:mb-0",n].filter(Boolean).join(" "),children:e})}var el={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",6:"gap-6",8:"gap-8"},tl={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},rl={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"};function nl({children:e,gap:t=4,align:r,justify:n,className:a=""}){/* @__PURE__ */
|
|
257
257
|
return Ye("div",{className:["flex flex-col",el[t],r?tl[r]:"",n?rl[n]:"",a].filter(Boolean).join(" "),children:e})}function al({children:e,gap:t=2,align:r="center",justify:n,wrap:a=!0,className:l=""}){/* @__PURE__ */
|
|
258
258
|
return Ye("div",{className:["flex",a?"flex-wrap":"",el[t],tl[r],n?rl[n]:"",l].filter(Boolean).join(" "),children:e})}var ll={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",6:"grid-cols-6",12:"grid-cols-12"},il={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"},ol={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 sl({children:e,cols:t=1,smCols:r,lgCols:n,gap:a=4,className:l=""}){/* @__PURE__ */
|
|
@@ -282,14 +282,14 @@ return Ge("div",{className:`flex items-center ${n}`.trim(),children:[l.map((e,t)
|
|
|
282
282
|
return Ye(Ae,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
283
283
|
return Ye(Ae,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
284
284
|
return Ye(Ae,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
285
|
-
return Ye(Ae,{name:"info",look:"mini",...t})}}function
|
|
285
|
+
return Ye(Ae,{name:"info",look:"mini",...t})}}function Hl({tone:e="info",emphasis:t="subtle",title:r,children:n,icon:a,action:l,onDismiss:i,sticky:o=!1,className:s=""}){const c=Kl[e],d="solid"===t,u=he().banner,h=d?ql[e]:c.box,m=o?"sticky top-0 z-30":"",p=/* @__PURE__ */Ge(Xe,{children:[r&&/* @__PURE__ */Ye("div",{className:("font-semibold "+(d?"":"text-gray-900")).trim(),children:r}),n&&/* @__PURE__ */Ye("div",{className:`${d?"":"text-gray-700"} ${r?"mt-0.5":""}`.trim(),children:n})]});/* @__PURE__ */
|
|
286
286
|
return Ge("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-start gap-3 rounded-lg border px-4 py-3 ${h} ${s}`.trim(),children:[
|
|
287
287
|
/* @__PURE__ */Ye("span",{className:`mt-0.5 shrink-0 ${d?"":c.icon}`.trim(),children:a??/* @__PURE__ */Ye(_l,{tone:e})}),null==l?/* @__PURE__ */Ye("div",{className:"min-w-0 flex-1 text-sm",children:p}):
|
|
288
288
|
/* @__PURE__ */Ge("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
289
289
|
/* @__PURE__ */Ye("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
290
|
-
/* @__PURE__ */Ye("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */Ye("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__ */Ye(Ae,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var
|
|
291
|
-
return Ye("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?nn(a,i):Yl(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */Ye("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?
|
|
292
|
-
return Ye("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__ */Ye("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__ */Ye(
|
|
290
|
+
/* @__PURE__ */Ye("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */Ye("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__ */Ye(Ae,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var Ul=(e,t)=>`${e}-tab-${t}`,Vl=(e,t)=>`${e}-panel-${t}`,Yl=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function Gl(e,t){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":"border-transparent text-gray-900 hover:border-gray-300"}`}function Xl({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=Ee([]),d="pill"===n,u=(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},h=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__ */
|
|
291
|
+
return Ye("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?nn(a,i):Yl(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */Ye("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?Ul(l,e.id):void 0,"aria-controls":l?Vl(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?an({selected:i,disabled:e.disabled,block:a}):Gl(i,a),children:/* @__PURE__ */Ye(on,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */Ye($,{content:e.tooltip,className:d||a?ln(a):void 0,children:o},e.id):o})})}var Zl=()=>/* @__PURE__ */Ye(Ae,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function Jl({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
292
|
+
return Ye("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__ */Ye("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__ */Ye(Zl,{}):n+1}),s=/* @__PURE__ */Ge("span",{className:"min-w-0 text-center",children:[
|
|
293
293
|
/* @__PURE__ */Ye("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */Ye("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
294
294
|
return Ge("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */Ye("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__ */Ge("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 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__ */Ge("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}function Ql({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,o]=Fe(t),s=r??i;/* @__PURE__ */
|
|
295
295
|
return Ye("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__ */
|
|
@@ -354,7 +354,7 @@ return Ye("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:zi[e]})}funct
|
|
|
354
354
|
return Ge("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",children:[
|
|
355
355
|
/* @__PURE__ */Ye("path",{d:"M4.2 2.2v11.6"}),
|
|
356
356
|
/* @__PURE__ */Ye("path",{d:"M4.2 3.1h7.4l-1.6 2.5 1.6 2.6H4.2z"})]})}function Bi(){/* @__PURE__ */
|
|
357
|
-
return Ye("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */Ye("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Ii=1e-6;function Ti(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-Ii||(a+=r-n[e],n[e]=r);if(a<=Ii)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Ii&&(l+=n[e]-r);if(l<=Ii)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Ii||(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 Oi(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var Ri="mixed";function Wi(e,t){return 5.6*Math.max(e.length,t.length)+8}var Ki=(e,t,r)=>Math.min(Math.max(e,t),r),qi=e=>-(Math.cos(Math.PI*e)-1)/2;function _i(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)*qi(t);return{px:r,ms:e.msByPx(r)}}var
|
|
357
|
+
return Ye("svg",{viewBox:"0 0 16 16","aria-hidden":"true",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",children:/* @__PURE__ */Ye("path",{d:"M2.8 11.6V8.2M6.6 11.6V5.4M10.4 11.6V7M14.2 11.6V3.6"})})}var Ii=1e-6;function Ti(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-Ii||(a+=r-n[e],n[e]=r);if(a<=Ii)return n;let l=0;for(let e=0;e<n.length;e++)!t[e]&&n[e]>r+Ii&&(l+=n[e]-r);if(l<=Ii)return n;const i=Math.min(a,l);for(let e=0;e<n.length;e++)t[e]||n[e]<=r+Ii||(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 Oi(e,t,r){return Math.max(0,Math.min(e-t/2,Math.max(0,r-t)))}var Ri="mixed";function Wi(e,t){return 5.6*Math.max(e.length,t.length)+8}var Ki=(e,t,r)=>Math.min(Math.max(e,t),r),qi=e=>-(Math.cos(Math.PI*e)-1)/2;function _i(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)*qi(t);return{px:r,ms:e.msByPx(r)}}var Hi={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 Ui(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}var Vi=e=>5.6*e.length,Yi={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:{}},Gi={doc:"dfm",flask:"testing",check:"completion",truck:"shipment",receipt:"invoice"};function Xi(e,t,r){if("none"!==e.glyph)return e.glyph?e.glyph:Yi[t].glyph??(r?"flag":void 0)}function Zi(e,t,r=!1){const n=Yi[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 Ji(e){const t=(e=>"string"==typeof e?e:"")(e.detail);return`${e.label} · ${e.dateText}${t?` · ${t}`:""}`}var Qi="undefined"==typeof document?Te:Ve;function eo(e,t){const[r,n]=Fe(0);return Qi(()=>{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 to(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 ro(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 no({marks:e,innerRef:t}){/* @__PURE__ */
|
|
358
358
|
return Ye("div",{ref:t,"aria-hidden":"true",className:"rosh-tl-measure",children:e.map(e=>/* @__PURE__ */Ge("div",{"data-lane-key":e.key,className:"rosh-tl-measure-box",children:[
|
|
359
359
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-name",children:e.label}),
|
|
360
360
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-date",children:e.dateText})]},e.key))})}function ao({startMs:e,endMs:t,axis:r,geo:n,reveal:a}){const l=he().timeline,i=ke(ue()),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*xi){if(r.inCut(e))continue;const t=r.xByMs(e);r.xByMs(e+7*xi)-t<14||s.push(
|
|
@@ -374,7 +374,7 @@ return Ge("div",{className:"rosh-tl-pending","data-timeline-part":"pending",chil
|
|
|
374
374
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-node is-ghost"+(e.kind&&Yi[e.kind].diamond?" is-diamond":"")}),
|
|
375
375
|
/* @__PURE__ */Ge("span",{children:[0===n&&/* @__PURE__ */Ye("b",{children:`${r.next} · `}),e.label]})]},e.key))}),i>0&&/* @__PURE__ */Ye("button",{type:"button",className:"rosh-tl-more text-gray-500",onClick:()=>a(!0),children:r.more(i)})]})}function io({marks:e,pending:t,currentKey:r,todayMs:n,reveal:a,ariaLabel:l,step:i,nodeProps:o,onKeyDown:s}){const c=he().timeline,d=e.findIndex(e=>e.key===r),u=e.length>0&&null!==n?Math.round((n-e[e.length-1].ms)/xi):0;/* @__PURE__ */
|
|
376
376
|
return Ge("div",{"data-timeline-part":"vertical",children:[
|
|
377
|
-
/* @__PURE__ */Ye("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=
|
|
377
|
+
/* @__PURE__ */Ye("ol",{className:"rosh-tl-v","aria-label":l,onKeyDown:s,children:e.map((e,t)=>{const n=Zi(e.kind,e.role),l=d>=0&&t<d,{glyph:s}=e;/* @__PURE__ */
|
|
378
378
|
return Ge("li",{className:a?"rosh-tl-fade":void 0,style:a?ji(t,i):void 0,...e.key===r?{"aria-current":"step"}:{},children:[
|
|
379
379
|
/* @__PURE__ */Ye("i",{"aria-hidden":"true",className:`rosh-tl-vline text-blue-600${l?" is-on":" is-dash"}${l&&a?" rosh-tl-drawy":""}`}),
|
|
380
380
|
/* @__PURE__ */Ge("button",{...o(e),className:`${n.className}${a?" rosh-tl-pop":""}`,style:{...n.style,...a?ji(t,i):{}},children:[s&&/* @__PURE__ */Ye(Fi,{name:s}),"current"===e.role&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(a?" is-on":"")})]}),
|
|
@@ -415,20 +415,20 @@ return Ge("div",{children:[
|
|
|
415
415
|
return Ge(Xe,{children:[
|
|
416
416
|
/* @__PURE__ */Ye("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:$,onPointerUp:k,onPointerCancel:k}),
|
|
417
417
|
/* @__PURE__ */Ye("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${Oi(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):vi(b,p)}),
|
|
418
|
-
/* @__PURE__ */Ye("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)/xi),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,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)*xi;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 fo(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function bo({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:x,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=le(Date.now,null),$=le(Hi,!1),M=o??k,C=Ee(null),L=he().timeline,S=ue(),A=e=>vi(e,S),P=Ee(null),j=Ee(null),z=Ee(null),F=Ee(/* @__PURE__ */new Map),E=Ee(void 0),B=Ee(void 0),I=Ee(null),[T,O]=Fe({}),[R,W]=Fe(null),[K,q]=Fe(null),[_,U]=Fe(null),[H,V]=Fe(null),[Y,G]=Fe(null),[X,J]=Fe(null),Q=Be(),ee=Be(),te=eo(C,!0),re=te>0?te-(l.length>0&&!N?176:0):0,ne=re>0&&re-20<320,ae=eo(P,!ne),ie=ae>0?ae:600,oe=Ui[s],se=N&&l.length>0,ce=se?Math.max(0,ie-36):ie,de=r=>r>=e-xi&&r<=t+xi,me=n.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=Ti([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ce,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,xe=me.filter(e=>!e.provisional),ye=g??(xe.length>0?xe[xe.length-1].key:null),ve=me.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?Gi[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Xi(e,a,0===t&&"default"===a),role:e.key===ye?"current":n?"dot":"key",widthPx:N?Math.max(16,Vi(e.caption??"")+6):T[e.key]||Wi(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=A(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Yi[e.kind].glyph,role:"key",widthPx:T[r]||Wi(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}}),Ne=se?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+xi,x:ie,baseX:ie,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=N&&w&&!se?[{key:w.key,ms:t,x:ce,baseX:ce,kind:"default",label:w.label,dateText:w.dateText??A(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),Me=m?.start??L.start(A(e)),Ce=null==Me||!1===Me?0:"string"==typeof Me?Math.ceil(Vi(Me)):96,Le="lanes"===s?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}($e):[],De=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:Ri,members:t})}n=a}return r}($e),Se=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ae=/* @__PURE__ */new Map;for(const e of De)if("cluster"===e.type)for(const t of e.members)Ae.set(t.key,Se(e));const Pe=_??H??Y,je=Le.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Pe)??De.find(e=>"cluster"===e.type&&Se(e)===Pe),Ie=e=>({x:e.baseX,widthPx:e.widthPx}),Oe=je&&"cluster"===je.type?je.members.map(Ie):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Ie):[],Re=Oe.length>1?to(ge,Oe,ce):ge,We=Re!==ge;if(We)for(const e of $e)e.isCap||(e.x=Re.xByMs(e.ms));const Ke=$e.some(e=>e.x<14),qe=We&&je?Pe:null,_e=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),Ue=ne?$e.map(_e):De.flatMap(e=>{if("item"===e.type)return[_e(e.mark)];const t=Se(e);if(t===qe&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(_e);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}]}),He=/* @__PURE__ */new Map;for(const e of Ue)for(const t of e.members)He.set(t.key,e.key);const Ve=De.find(e=>"cluster"===e.type&&Se(e)===qe),Je=Ve&&"cluster"===Ve.type?{from:Math.min(...Ve.members.map(e=>e.x))-16,to:Math.max(...Ve.members.map(e=>e.x))+16}:null,Ze=Ee(qe),[Qe,et]=Fe(!1);Te(()=>{if(Ze.current===qe)return;Ze.current=qe,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[qe]);const tt=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Qi(()=>{const e=j.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=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Fe(rt),lt=b&&nt===rt;Te(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=ro(u?.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=u?st(u.valueMs):null,dt=h&&u?ve.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:Ki(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}(Re,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=Fe(null),pt=Ee(null),gt=Ee({segments:ut,value:ct,playback:h});Te(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Ee(null),bt=ze(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=ze(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;Te(()=>{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(_i(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:_i(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:_i(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=_i(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:qi(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=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(y??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=ze(()=>{clearTimeout(E.current),clearTimeout(B.current),W(null),q(null),U(null),V(null),G(null)},[]);Te(()=>()=>{clearTimeout(E.current),clearTimeout(B.current)},[]),Te(()=>{const e=I.current;e&&(I.current=null,F.current.get(e)?.focus())});const Ct=null!==K||null!==_||null!==H||null!==Y;Te(()=>{if(Ct)return Z(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=ze((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ie-r)):t;const a=e.parentElement;if(r>0&&a){const t=D(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[ie]),Dt=Ue.find(e=>e.key===K)??null,St=Dt?Dt.x:0;Qi(()=>{Lt(z.current,St)},[Lt,K,St]);const At=ct??void 0,Pt=Ee(null);Te(()=>{if(void 0===At)return;const e=Re.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=F.current.get(He.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 jt=Ue.map(e=>e.key),zt=ye?He.get(ye)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.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?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),J(jt[r]),F.current.get(jt[r])?.focus())},Bt=()=>clearTimeout(B.current),It=e=>{Bt(),G(e)},Tt=()=>{clearTimeout(B.current),B.current=setTimeout(()=>G(null),260)},Ot=e=>{qe&&Ae.get(e)===qe?Bt():(Bt(),G(null))},Rt=e=>{clearTimeout(E.current),W(e),q(e),v?.((e=>{const t=Ue.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{W(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>q(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Zi(e),"aria-describedby":K===e.key?Q: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:()=>{Tt(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),J(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),qt=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(Zi))),"aria-describedby":K===e.key?Q: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?It(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),J(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);It(e.key);const r=e.members[0];J(r.key),I.current=r.key}};var t,r},_t="lanes"!==s||$e.length>1;if(ne)/* @__PURE__ */
|
|
419
|
-
return Ye("div",{ref:C,children:/* @__PURE__ */Ye(io,{marks:$e.filter(e=>!e.isCap),pending:l,currentKey:ye,todayMs:M,reveal:lt,ariaLabel:x,step:it,nodeProps:Kt,onKeyDown:Et})});const
|
|
418
|
+
/* @__PURE__ */Ye("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)/xi),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,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)*xi;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 fo(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function bo({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:x,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=le(Date.now,null),$=le(Ui,!1),M=o??k,C=Ee(null),L=he().timeline,S=ue(),A=e=>vi(e,S),P=Ee(null),j=Ee(null),z=Ee(null),F=Ee(/* @__PURE__ */new Map),E=Ee(void 0),B=Ee(void 0),I=Ee(null),[T,O]=Fe({}),[R,W]=Fe(null),[K,q]=Fe(null),[_,H]=Fe(null),[U,V]=Fe(null),[Y,G]=Fe(null),[X,Z]=Fe(null),Q=Be(),ee=Be(),te=eo(C,!0),re=te>0?te-(l.length>0&&!N?176:0):0,ne=re>0&&re-20<320,ae=eo(P,!ne),ie=ae>0?ae:600,oe=Hi[s],se=N&&l.length>0,ce=se?Math.max(0,ie-36):ie,de=r=>r>=e-xi&&r<=t+xi,me=n.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=Ti([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ce,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,xe=me.filter(e=>!e.provisional),ye=g??(xe.length>0?xe[xe.length-1].key:null),ve=me.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?Gi[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Xi(e,a,0===t&&"default"===a),role:e.key===ye?"current":n?"dot":"key",widthPx:N?Math.max(16,Vi(e.caption??"")+6):T[e.key]||Wi(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=A(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Yi[e.kind].glyph,role:"key",widthPx:T[r]||Wi(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}}),Ne=se?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+xi,x:ie,baseX:ie,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=N&&w&&!se?[{key:w.key,ms:t,x:ce,baseX:ce,kind:"default",label:w.label,dateText:w.dateText??A(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),Me=m?.start??L.start(A(e)),Ce=null==Me||!1===Me?0:"string"==typeof Me?Math.ceil(Vi(Me)):96,Le="lanes"===s?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}($e):[],De=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:Ri,members:t})}n=a}return r}($e),Se=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Ae=/* @__PURE__ */new Map;for(const e of De)if("cluster"===e.type)for(const t of e.members)Ae.set(t.key,Se(e));const Pe=_??U??Y,je=Le.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Pe)??De.find(e=>"cluster"===e.type&&Se(e)===Pe),Ie=e=>({x:e.baseX,widthPx:e.widthPx}),Oe=je&&"cluster"===je.type?je.members.map(Ie):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Ie):[],Re=Oe.length>1?to(ge,Oe,ce):ge,We=Re!==ge;if(We)for(const e of $e)e.isCap||(e.x=Re.xByMs(e.ms));const Ke=$e.some(e=>e.x<14),qe=We&&je?Pe:null,_e=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),He=ne?$e.map(_e):De.flatMap(e=>{if("item"===e.type)return[_e(e.mark)];const t=Se(e);if(t===qe&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(_e);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}]}),Ue=/* @__PURE__ */new Map;for(const e of He)for(const t of e.members)Ue.set(t.key,e.key);const Ve=De.find(e=>"cluster"===e.type&&Se(e)===qe),Ze=Ve&&"cluster"===Ve.type?{from:Math.min(...Ve.members.map(e=>e.x))-16,to:Math.max(...Ve.members.map(e=>e.x))+16}:null,Je=Ee(qe),[Qe,et]=Fe(!1);Te(()=>{if(Je.current===qe)return;Je.current=qe,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[qe]);const tt=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Qi(()=>{const e=j.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=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Fe(rt),lt=b&&nt===rt;Te(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=ro(u?.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=u?st(u.valueMs):null,dt=h&&u?ve.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:Ki(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}(Re,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=Fe(null),pt=Ee(null),gt=Ee({segments:ut,value:ct,playback:h});Te(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Ee(null),bt=ze(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=ze(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;Te(()=>{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(_i(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:_i(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:_i(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=_i(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:qi(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=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(y??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=ze(()=>{clearTimeout(E.current),clearTimeout(B.current),W(null),q(null),H(null),V(null),G(null)},[]);Te(()=>()=>{clearTimeout(E.current),clearTimeout(B.current)},[]),Te(()=>{const e=I.current;e&&(I.current=null,F.current.get(e)?.focus())});const Ct=null!==K||null!==_||null!==U||null!==Y;Te(()=>{if(Ct)return J(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=ze((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ie-r)):t;const a=e.parentElement;if(r>0&&a){const t=D(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[ie]),Dt=He.find(e=>e.key===K)??null,St=Dt?Dt.x:0;Qi(()=>{Lt(z.current,St)},[Lt,K,St]);const At=ct??void 0,Pt=Ee(null);Te(()=>{if(void 0===At)return;const e=Re.xByMs(At),t=Pt.current;if(Pt.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ue.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 jt=He.map(e=>e.key),zt=ye?Ue.get(ye)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.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?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),Z(jt[r]),F.current.get(jt[r])?.focus())},Bt=()=>clearTimeout(B.current),It=e=>{Bt(),G(e)},Tt=()=>{clearTimeout(B.current),B.current=setTimeout(()=>G(null),260)},Ot=e=>{qe&&Ae.get(e)===qe?Bt():(Bt(),G(null))},Rt=e=>{clearTimeout(E.current),W(e),q(e),v?.((e=>{const t=He.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{W(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>q(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Ji(e),"aria-describedby":K===e.key?Q: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:()=>{Tt(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),Z(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),qt=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(Ji))),"aria-describedby":K===e.key?Q: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?It(e.key):Rt(e.key)},onMouseLeave:()=>{Tt(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),Z(e.key)},onBlur:()=>{Tt(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);It(e.key);const r=e.members[0];Z(r.key),I.current=r.key}};var t,r},_t="lanes"!==s||$e.length>1;if(ne)/* @__PURE__ */
|
|
419
|
+
return Ye("div",{ref:C,children:/* @__PURE__ */Ye(io,{marks:$e.filter(e=>!e.isCap),pending:l,currentKey:ye,todayMs:M,reveal:lt,ariaLabel:x,step:it,nodeProps:Kt,onKeyDown:Et})});const Ht=(e,t)=>null==e||!1===e?null:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:oe.rail-3+"px"},children:e});/* @__PURE__ */
|
|
420
420
|
return Ge("div",{ref:C,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
|
|
421
|
-
/* @__PURE__ */Ge("div",{className:"flex items-stretch gap-3",children:[N&&
|
|
422
|
-
/* @__PURE__ */Ye("div",{className:"rosh-tl-stage",style:{height:`${fo(oe,_t,p.length>0&&!N)}px`},children:/* @__PURE__ */Ge("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!
|
|
421
|
+
/* @__PURE__ */Ge("div",{className:"flex items-stretch gap-3",children:[N&&Ht(Me,!1),
|
|
422
|
+
/* @__PURE__ */Ye("div",{className:"rosh-tl-stage",style:{height:`${fo(oe,_t,p.length>0&&!N)}px`},children:/* @__PURE__ */Ge("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Ze)return;const t=P.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Ze.from&&r<=Ze.to?Bt():Tt()},onMouseLeave:Tt,children:[!N&&/* @__PURE__ */Ye(no,{marks:$e,innerRef:j}),
|
|
423
423
|
/* @__PURE__ */Ye(oo,{axis:Re,geo:oe,fillTo:wt,reveal:lt,trackPx:ce,tweened:!!u}),se&&
|
|
424
424
|
/* @__PURE__ */Ye("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ce}px`,width:ie-ce+"px",top:oe.rail+3-1+"px"}}),$t&&/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:oe.rail-7+"px",height:"20px"}}),
|
|
425
425
|
/* @__PURE__ */Ye(ao,{startMs:e,endMs:t,axis:Re,geo:oe,reveal:lt}),
|
|
426
|
-
/* @__PURE__ */Ye(so,{geo:oe,caption:N?null:Me,endCaption:N?null:m?.end,around:Ke,reveal:lt,trackPx:ie}),N&&/* @__PURE__ */Ye(uo,{nodes:
|
|
427
|
-
/* @__PURE__ */Ye("ol",{className:"rosh-tl-nodes","aria-label":x,onKeyDown:Et,children:
|
|
428
|
-
return Ye("li",{children:/* @__PURE__ */Ye("button",{...Kt(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===Ri,i=
|
|
426
|
+
/* @__PURE__ */Ye(so,{geo:oe,caption:N?null:Me,endCaption:N?null:m?.end,around:Ke,reveal:lt,trackPx:ie}),N&&/* @__PURE__ */Ye(uo,{nodes:He,geo:oe,reveal:lt}),null!==M&&M>e&&M<=t+xi&&/* @__PURE__ */Ye(co,{x:Re.xByMs(Math.min(M,t)),geo:oe,trackPx:ie,label:A(M),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */Ye(ho,{phase:e,geo:oe,xOf:Re.xByMs},e.key)),
|
|
427
|
+
/* @__PURE__ */Ye("ol",{className:"rosh-tl-nodes","aria-label":x,onKeyDown:Et,children:He.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${oe.rail+3}px`,a=lt?ji(t,it):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
428
|
+
return Ye("li",{children:/* @__PURE__ */Ye("button",{...Kt(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===Ri,i=Zi(t?"default":e.kind,"key"),o=t?void 0:Yi[e.kind]?.glyph;/* @__PURE__ */
|
|
429
429
|
return Ge("li",{...r(ye)?{"aria-current":"step"}:{},children:[
|
|
430
|
-
/* @__PURE__ */Ge("button",{...qt(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */Ye(Fi,{name:o}),t&&/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Ge("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=
|
|
431
|
-
return Ye("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ */Ge("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Ye(Fi,{name:s}),"current"===i.role&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Ye(po,{groups:Le,trackPx:ie,geo:oe,startMs:e,endMs:t,currentKey:ye,hoveredKey:R,reveal:lt,step:it,zoomedKey:qe,popId:ee,aimBubble:Lt,startCaptionPx:Ce,openCluster:_,setOpenCluster:
|
|
430
|
+
/* @__PURE__ */Ge("button",{...qt(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */Ye(Fi,{name:o}),t&&/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Ge("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=Zi(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
431
|
+
return Ye("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ */Ge("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Ye(Fi,{name:s}),"current"===i.role&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Ye(po,{groups:Le,trackPx:ie,geo:oe,startMs:e,endMs:t,currentKey:ye,hoveredKey:R,reveal:lt,step:it,zoomedKey:qe,popId:ee,aimBubble:Lt,startCaptionPx:Ce,openCluster:_,setOpenCluster:H,previewCluster:U,setPreviewCluster:V,setZoomKey:G}):"active"===s?/* @__PURE__ */Ye(mo,{nodes:He,trackPx:ie,geo:oe,activeKey:c,hoveredKey:R,currentKey:ye}):null,Dt&&/* @__PURE__ */Ye("div",{ref:z,id:Q,role:"tooltip",className:"rosh-tl-bubble"+(Dt.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${oe.rail+6+6}px`},onMouseEnter:()=>{Bt(),Rt(Dt.key)},onMouseLeave:()=>{Tt(),Wt(Dt.key)},onFocus:()=>{Bt(),Rt(Dt.key)},onBlur:()=>{Tt(),Wt(Dt.key)},children:Dt.mark?/* @__PURE__ */Ge(Xe,{children:[
|
|
432
432
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-name",children:Dt.mark.label}),
|
|
433
433
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-date",children:Dt.mark.dateText}),Dt.mark.preview?/* @__PURE__ */Ye("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:Dt.mark.preview}):Dt.mark.detail&&/* @__PURE__ */Ye("span",{className:"rosh-tl-detail",children:Dt.mark.detail}),(Dt.mark.onOpen??Dt.mark.onClick)&&/* @__PURE__ */Ye("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(Dt.mark?.onOpen??Dt.mark?.onClick)?.(),children:L.openButton})]}):
|
|
434
434
|
/* @__PURE__ */Ge("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
@@ -437,7 +437,7 @@ return Ye("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ *
|
|
|
437
437
|
/* @__PURE__ */Ge("p",{className:"rosh-tl-foldrow",children:[
|
|
438
438
|
/* @__PURE__ */Ye("span",{children:e.label}),
|
|
439
439
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */Ye("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */Ye("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
440
|
-
/* @__PURE__ */Ye(go,{thumb:u,value:ct,snap:st,axis:Re,geo:oe,startMs:e,endMs:t,trackPx:ie,layerRef:P,glide:ht,onScrub:h?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&
|
|
440
|
+
/* @__PURE__ */Ye(go,{thumb:u,value:ct,snap:st,axis:Re,geo:oe,startMs:e,endMs:t,trackPx:ie,layerRef:P,glide:ht,onScrub:h?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&Ht(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */Ye(lo,{pending:l,reveal:lt})]})}function xo({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */Ye("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
441
441
|
return Ge("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
442
442
|
/* @__PURE__ */Ge("div",{className:"rosh-tl-head",children:[
|
|
443
443
|
/* @__PURE__ */Ge("div",{className:"rosh-tl-head-main text-gray-800",children:[e&&/* @__PURE__ */Ye("span",{className:"rosh-tl-ico","aria-hidden":"true",children:e}),
|
|
@@ -517,10 +517,10 @@ return Ge("button",{type:"button",onClick:()=>m(e.slug),className:"w-full text-l
|
|
|
517
517
|
/* @__PURE__ */Ye("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(N):N.body?/* @__PURE__ */Ye(To,{children:N.body}):/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */Ye("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */Ye(v,{size:"sm",padding:"",label:c.help.loading}):/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500",children:c.help.pickArticle})})})]})}var Wo={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 Ko({children:e,onClick:t,variant:r="primary",hotkey:n,disabled:a=!1,type:l="button",title:i,className:o=""}){const s=x(n??"");/* @__PURE__ */
|
|
518
518
|
return Ge("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 ${Wo[r]} ${o}`,children:[e,n&&/* @__PURE__ */Ye("kbd",{className:"kbd-submit rounded border px-2 py-0.5 text-2xs font-medium",children:s})]})}function qo(e){return"shrink-0 inline-flex items-center justify-center min-w-[1.25rem] px-2 h-5 rounded-full text-2xs font-medium "+(e?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600")}function _o({children:e,count:t}){return null==t?/* @__PURE__ */Ye("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */Ge("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:[
|
|
519
519
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate",children:e}),
|
|
520
|
-
/* @__PURE__ */Ye("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function
|
|
520
|
+
/* @__PURE__ */Ye("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function Ho(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 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 Uo({label:e,count:t,active:r,onClick:n,icon:a,trailing:l,severity:i,depth:o=0}){const s=di(i,"SidebarNavItem"),c=he().severity,d=s?(h=c,(u=s).tone?h[u.tone]:h.unrecognised(u.token??"")):void 0;var u,h;const m=/* @__PURE__ */Ge(Xe,{children:[null!=a&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:a}),s&&
|
|
521
521
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",title:d,className:`shrink-0 h-1.5 w-1.5 rounded-full ${s.fill}`}),
|
|
522
522
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof e?e:void 0,children:e}),s&&/* @__PURE__ */Ye("span",{className:"sr-only",children:d}),null!=t&&t>0&&/* @__PURE__ */Ye("span",{className:qo(r),children:t}),null!=l&&/* @__PURE__ */Ye("span",{className:"shrink-0",children:l})]});/* @__PURE__ */
|
|
523
|
-
return Ye("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */Ye("span",{className:
|
|
523
|
+
return Ye("button",1===o?{type:"button",onClick:n,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */Ye("span",{className:Ho(r),children:m})}:{type:"button",onClick:n,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(r?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:m})}function Vo({label:e,count:t,children:r,defaultExpanded:n=!0,storageKey:a}){const l=Be(),[i,o]=ie(()=>{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&&Re.toArray(r).some(e=>We(e)&&!0===e.props.active);/* @__PURE__ */
|
|
524
524
|
return Ge("div",{children:[
|
|
525
525
|
/* @__PURE__ */Ge("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-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(s?"bg-blue-50 text-blue-700":"text-gray-800 hover:bg-gray-100"),children:[
|
|
526
526
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -529,18 +529,18 @@ return Ge("div",{children:[
|
|
|
529
529
|
return Ge("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */Ye("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
530
530
|
/* @__PURE__ */Ye("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
531
531
|
return Ge("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-2 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__ */Ye("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
532
|
-
/* @__PURE__ */Ye("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Ye("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */Ye("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Ye("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Go=/(^|[\s:])!?z-/,Xo=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function
|
|
532
|
+
/* @__PURE__ */Ye("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Ye("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */Ye("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Ye("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Go=/(^|[\s:])!?z-/,Xo=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function Zo({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Fe(!1),[g,f]=Fe(-1),b=Ee(null),x=Ee(null),y=Ee(null),v=Ee({text:"",at:0}),w=Be(),N=Be(),k=u??N,$=ze(e=>{p(!1),e&&x.current?.focus()},[]),M=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(Xo(t[l]))return l}return-1},C=()=>y.current?.closest("[data-popup-menu-tree]")??null;Te(()=>{if(!m)return;const e=e=>{const t=e.target;b.current?.contains(t)||C()?.contains(t)||$(!1)};document.addEventListener("pointerdown",e,!0);const t=Q(()=>$(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,$]);const L=ze(()=>{const e=C(),t=x.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=A({trigger:t.getBoundingClientRect(),menu:l,bounds:D(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);re(()=>{m&&L()}),Te(()=>{if(m)return P(()=>x.current,L)},[m,L]),Te(()=>{if(!m)return;const e=y.current,r=Xo(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Te(()=>{if(m)return J(e=>"Escape"===e.key&&($(!0),!0),()=>y.current)},[m,$]);const S=e=>{f(e),p(!0)},j=e=>{e.disabled||($(!0),e.onSelect())},z=c??"a",F=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),E=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
533
533
|
return Ye("div",{role:"separator",children:/* @__PURE__ */Ye(_,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
534
|
-
return Ye("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */Ye(
|
|
534
|
+
return Ye("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */Ye(H,{children:e.label})},e.key);if("checkbox"===e.type){const r=U(!1,e.disabled,"");/* @__PURE__ */
|
|
535
535
|
return Ge("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:[
|
|
536
|
-
/* @__PURE__ */Ye(V,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=
|
|
536
|
+
/* @__PURE__ */Ye(V,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=U(!1,e.disabled,"");/* @__PURE__ */
|
|
537
537
|
return Ge("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>j(e),...F(t,e),children:[
|
|
538
|
-
/* @__PURE__ */Ye(V,{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=
|
|
538
|
+
/* @__PURE__ */Ye(V,{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=U(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Ge("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...F(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */Ge(z,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>$(!0),...F(t,e),children:[e.icon,e.label]},e.key)}const r=U(e.danger,e.disabled,"");/* @__PURE__ */
|
|
539
539
|
return Ge("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>j(e),...F(t,e),children:[e.icon,e.label]},e.key)},B={...Go.test(o)?{}:{zIndex:ee.popup},minWidth:s};/* @__PURE__ */
|
|
540
540
|
return Ge("div",{ref:b,className:`relative inline-flex ${l}`.trim(),children:[
|
|
541
541
|
/* @__PURE__ */Ye("button",{ref:x,id:k,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?$(!1):S(M(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),S(M(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),S(M(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled: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 "+(a?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:e}),m&&
|
|
542
|
-
/* @__PURE__ */Ye(W,{portal:!0,className:o,style:B,children:/* @__PURE__ */Ye("div",{ref:y,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(M(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(M(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(M(0,1));else if("End"===e.key)e.preventDefault(),f(M(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),$(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(Xo(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(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?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */Ye("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}var
|
|
543
|
-
/* @__PURE__ */Ye("div",{ref:s,role:"group","aria-label":a,"data-floating-bar":"",onMouseDown:e=>{const t=e.target;t?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||e.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${i}`.trim(),style:{...
|
|
542
|
+
/* @__PURE__ */Ye(W,{portal:!0,className:o,style:B,children:/* @__PURE__ */Ye("div",{ref:y,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(M(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(M(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(M(0,1));else if("End"===e.key)e.preventDefault(),f(M(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),$(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(Xo(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(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?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */Ye("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}var Jo=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function Qo({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=ae(),s=Ee(null),c=Ee(e);c.current=e;const d=Ee(t);d.current=t;const u=ze(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??Jo)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*S)}px`;const i=A({trigger:t,menu:{width:e.offsetWidth,height:e.offsetHeight},bounds:a,align:n,side:r});l.left=`${i.left}px`,l.top=`${i.top}px`,e.dataset.side=i.side},[n,r]);re(()=>{o&&u()}),Te(()=>{if(!o)return;const e=z(()=>c.current(),u),t=s.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>u());return r.observe(t),()=>{e(),r.disconnect()}},[o,u]);return o&&e()?Ze(
|
|
543
|
+
/* @__PURE__ */Ye("div",{ref:s,role:"group","aria-label":a,"data-floating-bar":"",onMouseDown:e=>{const t=e.target;t?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])')||e.preventDefault()},className:`fixed rounded-(--radius-popup) p-1 ${i}`.trim(),style:{...Z(),position:"fixed",left:0,top:0,zIndex:ee.popup},children:l}),document.body):null}function es(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function ts({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Ee(null),[c,d]=Fe(null),u=Ee(t);u.current=t,re(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=F({point:e,menu:r,bounds:D(n??null)});d(e=>e&&e.left===a.left&&e.top===a.top&&e.maxHeight===a.maxHeight?e:{left:a.left,top:a.top,maxHeight:a.maxHeight,scroll:r.height>a.maxHeight})},[e.x,e.y,n]);const h=Ee(null),m=Ee(!1);Te(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Te(()=>{c&&!m.current&&o&&(m.current=!0,es(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),Te(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=es(s.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)},[o]),Te(()=>J(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),Te(()=>{const e=()=>u.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 p=ze(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=es(s.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())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
|
|
544
544
|
return Ye(W,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */Ye(K.Provider,{value:!0,children:/* @__PURE__ */Ye("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function rs(){const[e,t]=Fe(null),r=ze(()=>t(null),[]),n=ze((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(q(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=ze(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 ns="Alt+ArrowUp Alt+ArrowDown";function as(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var ls=/* @__PURE__ */Ge("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
545
545
|
/* @__PURE__ */Ye("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
546
546
|
/* @__PURE__ */Ye("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
@@ -574,10 +574,10 @@ return Ye("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-
|
|
|
574
574
|
/* @__PURE__ */Ye("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
575
575
|
/* @__PURE__ */Ye("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
|
|
576
576
|
return Ye($,{content:e,side:i,children:p})}var Ls=6e4;function Ds({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Fe(null);return Te(()=>{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 Ss({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=Ds({currentVersion:e,versionUrl:t,pollMs:r}),o=he();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
|
|
577
|
-
return Ye("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Ge(
|
|
577
|
+
return Ye("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Ge(Hl,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */Ye(w,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
|
|
578
578
|
/* @__PURE__ */Ye("span",{className:"font-medium",children:n??o.update.available}),
|
|
579
579
|
/* @__PURE__ */Ge("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var As={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},Ps={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function js({onClose:e}){const t=he().dialog;/* @__PURE__ */
|
|
580
|
-
return Ye("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) 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__ */Ye(Ae,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function zs({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=Ee(null),g=Be(),f=Be(),b=Be();if(Y(e),I(p,e,c),T(e),Te(()=>{if(e)return
|
|
580
|
+
return Ye("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) 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__ */Ye(Ae,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function zs({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=Ee(null),g=Be(),f=Be(),b=Be();if(Y(e),I(p,e,c),T(e),Te(()=>{if(e)return J(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
581
581
|
return Ge("div",{className:"fixed inset-0",style:{zIndex:ee.overlay},role:"presentation",children:[
|
|
582
582
|
/* @__PURE__ */Ye("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
|
|
583
583
|
/* @__PURE__ */Ge("div",{ref:p,...O({modal:!0,titleId:a?b:void 0,labelledBy:u,label: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 ${As[n]}`,Ps[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */Ge("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
@@ -598,69 +598,69 @@ return Ge("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.t
|
|
|
598
598
|
/* @__PURE__ */Ye("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${Es} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */Ye("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${Es} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function Is(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 Ts=e=>Array.isArray(e.columns),Os=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",Rs="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",Ws={sm:"px-2 py-2",md:"px-3 py-2"},Ks={left:"text-left",right:"text-right",center:"text-center"};function qs({direction:e}){/* @__PURE__ */
|
|
599
599
|
return Ge("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
600
600
|
/* @__PURE__ */Ye("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Ye("path",{d:"M4 0L8 5H0z"})}),
|
|
601
|
-
/* @__PURE__ */Ye("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Ye("path",{d:"M4 5L0 0h8z"})})]})}function _s(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function
|
|
602
|
-
return Ye("th",{scope:"col",...A("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===o?"ascending":"desc"===o?"descending":d?"none":void 0,style:{width:e.width,...c?{left:(de[t]??0)+ee}:{},...w?{top:n}:{}},className:[ie,s,l,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs",c?w?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":w?"sticky z-10 bg-gray-50":"",D&&d?"rosh-dt-sort":"",D?Os(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:oe(e,d?/* @__PURE__ */Ge("button",{type:"button",onClick:()=>(e=>{if(!i)return;const t=_(e),r=
|
|
601
|
+
/* @__PURE__ */Ye("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */Ye("path",{d:"M4 5L0 0h8z"})})]})}function _s(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function Hs({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:i,pagination:o,caption:s,loading:c=!1,bordered:d=!1,size:u="md",minWidth:h,rowClassName:m,onRow:p,rowHref:g,onRowPress:f,linkAs:b,emptyText:x,selection:y,footer:v,virtualized:w,stackOnNarrow:N=!1,stackBelow:k,className:$=""}){const M=he(),C=x??M.table.empty,L=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),D=N&&!w,S=D?e:e.flatMap(e=>{if(!Ts(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),A=e=>D?{role:e}:{},P=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[j,z]=Fe(0),F=w?.overscan??6,E=w?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/w.rowHeight)-F);z(e=>e===t?e:t)}:void 0,B=w?Math.ceil(w.height/w.rowHeight)+2*F:t.length,I=w?Math.min(j,Math.max(0,t.length-B)):0,T=Math.min(t.length,I+B),O=w?I*w.rowHeight:0,R=w?(t.length-T)*w.rowHeight:0,W=Ee(null),[K,q]=Fe(0);re(()=>{if(!w)return;const e=W.current?.offsetHeight??0;q(t=>t===e?t:e)});const _=e=>e.sortField??e.key,H=e=>n&&n.field===_(e)?n.direction:null,U=S.flatMap(e=>Ts(e)?e.columns:[e]),V=S.some(Ts),Y=/* @__PURE__ */new Map;if(D)for(const e of S)if(Ts(e))for(const t of e.columns)Y.set(t,P(e.title,e.label));const G=e=>{const t=P(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(y?.selected??[]),Z=y?t.map((e,t)=>L(e,t)):[],J=Z.length>0&&Z.every(e=>X.has(e)),Q=Z.some(e=>X.has(e)),ee=y?36:0,te=U.length+(y?1:0),ne=U.some(e=>"left"===e.fixed),ae=D&&!y&&U.some(e=>e.cardCorner),le=b??"a",ie=`${Ws[u]} ${"sm"===u?"text-xs":"text-sm"}`,oe=(e,t)=>e.ellipsis?/* @__PURE__ */Ye("span",{className:"block w-0 min-w-full",children:t}):t,se=(e,t,r,n=0)=>{const o=H(e),s=Ks[e.align??(e.numeric?"right":"left")],c="left"===e.fixed,d=!(!e.sortable||!i);/* @__PURE__ */
|
|
602
|
+
return Ye("th",{scope:"col",...A("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===o?"ascending":"desc"===o?"descending":d?"none":void 0,style:{width:e.width,...c?{left:(de[t]??0)+ee}:{},...w?{top:n}:{}},className:[ie,s,l,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs",c?w?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":w?"sticky z-10 bg-gray-50":"",D&&d?"rosh-dt-sort":"",D?Os(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:oe(e,d?/* @__PURE__ */Ge("button",{type:"button",onClick:()=>(e=>{if(!i)return;const t=_(e),r=H(e),n=e.sortFirst??"asc";i(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":D?Y.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${s}`,children:[
|
|
603
603
|
/* @__PURE__ */Ye(a,{children:e.title}),
|
|
604
|
-
/* @__PURE__ */Ye(qs,{direction:o})]}):/* @__PURE__ */Ye(a,{children:e.title}))},e.key)};let ce=0;const de=
|
|
604
|
+
/* @__PURE__ */Ye(qs,{direction:o})]}):/* @__PURE__ */Ye(a,{children:e.title}))},e.key)};let ce=0;const de=U.map(e=>{if("left"!==e.fixed)return null;const t=ce;return ce+=e.width??0,t}),ue=/* @__PURE__ */Ge(Xe,{children:[
|
|
605
605
|
/* @__PURE__ */Ge("div",{onScroll:E,style:w?{maxHeight:w.height}:void 0,className:`relative overflow-x-auto ${w?"overflow-y-auto":""} ${d?"rounded-lg border border-gray-200":""}${D?" rosh-dt-scroll":""}`.trim(),children:[c&&
|
|
606
606
|
/* @__PURE__ */Ge("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
607
607
|
/* @__PURE__ */Ye("span",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-blue-600"}),
|
|
608
608
|
/* @__PURE__ */Ye("span",{className:"sr-only",children:M.table.loading})]}),
|
|
609
609
|
/* @__PURE__ */Ge("table",{...A("table"),className:(D?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:h?{minWidth:h}:void 0,children:[s&&/* @__PURE__ */Ye("caption",{className:"sr-only",children:s}),
|
|
610
610
|
/* @__PURE__ */Ge("thead",{...A("rowgroup"),className:D?"rosh-dt-head":void 0,children:[
|
|
611
|
-
/* @__PURE__ */Ge("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[y&&/* @__PURE__ */Ye("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...w?{top:0}:{}},className:[ie,l,ne||w?"sticky z-20 bg-gray-50":"",ne?"left-0":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Ye(ft,{"aria-label":M.table.selectAll,checked:
|
|
612
|
-
/* @__PURE__ */Ye("tbody",{...A("rowgroup"),className:D?"rosh-dt-body":void 0,children:0!==t.length||c?/* @__PURE__ */Ge(Xe,{children:[O>0&&/* @__PURE__ */Ye("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ye("td",{colSpan:te,style:{height:O,padding:0,border:0}})}),t.slice(I,T).map((e,t)=>{const r=I+t,n=p?.(e,r),a=!!n?.current,l=g?.(e,r),i=void 0===l&&f?()=>f(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=[Rs,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */Ye(le,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */Ye("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=
|
|
611
|
+
/* @__PURE__ */Ge("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[y&&/* @__PURE__ */Ye("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...w?{top:0}:{}},className:[ie,l,ne||w?"sticky z-20 bg-gray-50":"",ne?"left-0":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Ye(ft,{"aria-label":M.table.selectAll,checked:J,indeterminate:Q&&!J,onChange:()=>{if(!y)return;const e=new Set(Z);y.onChange(J?y.selected.filter(t=>!e.has(t)):[...y.selected,...Z.filter(e=>!X.has(e))])}})}),S.map((e,t)=>Ts(e)?/* @__PURE__ */Ye("th",{scope:"colgroup",...A("columnheader"),colSpan:e.columns.length,style:w?{top:0}:void 0,className:[ie,"text-center",l,"font-semibold uppercase tracking-wide text-gray-500","sm"===u?"text-2xs":"text-xs","border-b border-gray-200",w?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */Ye(a,{children:e.title})},e.key??`group-${t}`):se(e,U.indexOf(e),V?2:1))]}),V&&/* @__PURE__ */Ye("tr",{...A("row"),className:"border-b border-gray-200 bg-gray-50",children:S.flatMap(e=>Ts(e)?e.columns:[]).map(e=>se(e,U.indexOf(e),1,K))})]}),
|
|
612
|
+
/* @__PURE__ */Ye("tbody",{...A("rowgroup"),className:D?"rosh-dt-body":void 0,children:0!==t.length||c?/* @__PURE__ */Ge(Xe,{children:[O>0&&/* @__PURE__ */Ye("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ye("td",{colSpan:te,style:{height:O,padding:0,border:0}})}),t.slice(I,T).map((e,t)=>{const r=I+t,n=p?.(e,r),a=!!n?.current,l=g?.(e,r),i=void 0===l&&f?()=>f(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=[Rs,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */Ye(le,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */Ye("button",{type:"button",onClick:i,className:r,"aria-current":n,children:e})},d=U.map(t=>t.render?t.render(e,r,c):t.dataIndex?e[t.dataIndex]:null);if(o&&!s){const e=U.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=U.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(d[r]=c(d[r]))}const u=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
613
613
|
return Ge("tr",{...Is(n),...A("row"),style:w?{height:w.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:u(n?.onFocus),onBlur:u(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:[D?y?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",D&&ae?"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":"",m?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[y&&(()=>{const t=L(e,r);/* @__PURE__ */
|
|
614
|
-
return Ye("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[ie,ne?"sticky left-0 z-10 bg-white":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Ye(ft,{"aria-label":M.table.selectRow,checked:X.has(t),onChange:()=>(e=>{y&&y.onChange(X.has(e)?y.selected.filter(t=>t!==e):[...y.selected,e])})(t)})})})(),
|
|
614
|
+
return Ye("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[ie,ne?"sticky left-0 z-10 bg-white":"",D?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */Ye(ft,{"aria-label":M.table.selectRow,checked:X.has(t),onChange:()=>(e=>{y&&y.onChange(X.has(e)?y.selected.filter(t=>t!==e):[...y.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ae&&!!e.cardCorner,l=D&&!a&&"wide"!==e.only;/* @__PURE__ */
|
|
615
615
|
return Ye("td",{...A("cell"),"data-label":l?G(e):void 0,style:r?{left:(de[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",D?Os(e):"",ie,Ks[e.align??(e.numeric?"right":"left")],D?"":_s(e),"text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:D?
|
|
616
616
|
/* @__PURE__ */Ye("span",{className:["rosh-dt-value",_s(e,!0)].filter(Boolean).join(" "),children:n}):n},e.key)})]},L(e,r))}),R>0&&/* @__PURE__ */Ye("tr",{"aria-hidden":"true",children:/* @__PURE__ */Ye("td",{colSpan:te,style:{height:R,padding:0,border:0}})})]}):/* @__PURE__ */Ye("tr",{...A("row"),className:D?"rosh-dt-empty":void 0,children:/* @__PURE__ */Ye("td",{...A("cell"),colSpan:te,className:`${ie} py-10 text-center text-gray-500`,children:C})})})]}),v]}),o&&o.pageCount>1&&/* @__PURE__ */Ye("div",{className:D?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */Ye(Bs,{page:o.page,pageCount:o.pageCount,onPageChange:o.onPageChange})})]});/* @__PURE__ */
|
|
617
|
-
return Ye("div",D?void 0!==k&&k>0&&40!==k?{className:`rosh-dt-at ${$}`.trim(),children:/* @__PURE__ */Ye("div",{className:"rosh-dt-stack",style:{width:40/k*100+"%"},children:/* @__PURE__ */Ye("div",{className:"rosh-dt-fit",style:{width:k/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${$}`.trim(),children:ue}:{className:$,children:ue})}function
|
|
617
|
+
return Ye("div",D?void 0!==k&&k>0&&40!==k?{className:`rosh-dt-at ${$}`.trim(),children:/* @__PURE__ */Ye("div",{className:"rosh-dt-stack",style:{width:40/k*100+"%"},children:/* @__PURE__ */Ye("div",{className:"rosh-dt-fit",style:{width:k/40*100+"%"},children:ue})})}:{className:`rosh-dt-stack ${$}`.trim(),children:ue}:{className:$,children:ue})}function Us({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=he().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
|
|
618
618
|
return Ge(Xe,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?/* @__PURE__ */Ge(Xe,{children:[" · ",
|
|
619
619
|
/* @__PURE__ */Ge("span",{className:"inline-flex items-center gap-1",role:"status",children:[
|
|
620
|
-
/* @__PURE__ */Ye(
|
|
620
|
+
/* @__PURE__ */Ye(Ht,{className:"h-3 w-3"}),o.loadingMore]})]}):""]})}function Vs({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=he().list;/* @__PURE__ */
|
|
621
621
|
return Ge("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:[
|
|
622
622
|
/* @__PURE__ */Ye(Ae,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
623
623
|
/* @__PURE__ */Ye("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
|
|
624
624
|
/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */Ye("div",{className:"mt-4",children:/* @__PURE__ */Ye(w,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function Ys({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__ */
|
|
625
625
|
return Ge("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */Ye("path",{d:f,fill:a,stroke:"none"}),
|
|
626
|
-
/* @__PURE__ */Ye("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var Gs=8,Xs=["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)"],
|
|
627
|
-
return Ye("div",{className:f,ref:N,children:/* @__PURE__ */Ye("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),A=void 0===l&&void 0===i?sc(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,P=void 0!==l&&void 0===i?sc(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=A?A.lo:l??Math.min(0,...D),z=A?A.hi:P?P.hi:i??oc(Math.max(...D,0)),F=A?A.ticks:P?[j,...P.ticks.filter(e=>e>j)]:ac([j,z],{from:0,to:1}).ticks(o+1),E={top:12,right:16,bottom:26,left:pc(F.map(v),48)+(c?10:0)},B=E.left,I=Math.max(B+1,$-E.right),T=E.top,O=r-E.bottom,R=ac([j,z],{from:O,to:T}),W=lc(e.length,{from:B,to:I},a),K=(I-B)/Math.max(1,e.length),q=K>=48,_=q?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),
|
|
626
|
+
/* @__PURE__ */Ye("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var Gs=8,Xs=["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)"],Zs={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Js={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Qs(e){return Xs[e]??Js.muted}function ec(e,t,r){return t||(r?Zs[r]:Qs(e))}function tc(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function rc(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function nc(e,t,r,n){return r||n?ec(e,r,n):e<t?Qs(e):Js.muted}function ac(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 lc(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 ic(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 oc(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 sc(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function cc(e,t,{intervals:r=5,integerLeft:n=!1,integerRight:a=!1}={}){const l=e=>Math.min(0,e),i=e=>Math.max(0,e),o=([e,t],r,n,a)=>{if(l(e)<0&&0===r)return null;if(i(t)>0&&0===n)return null;const o=function(e,t){if(!(e>0))return 1;let r=10**Math.floor(Math.log10(e));for(;;){for(const n of[1,2,2.5,5]){const a=n*r;if((!t||Number.isInteger(a))&&a>=e*(1-1e-9))return a}r*=10}}(Math.max(r?-l(e)/r:0,n?i(t)/n:0),a),s=o*(r+n),c=i(t)-l(e);return{step:o,waste:c>0?(s-c)/s:1}};let s=null;const c=Math.max(2,Math.floor(r));for(let r=2;r<=c;r++)for(let l=0;l<=r;l++){const i=o(e,l,r-l,n),d=o(t,l,r-l,a);if(!i||!d)continue;const u=i.waste+d.waste+.02*(c-r);(!s||u<s.score-1e-9)&&(s={n:r,k:l,l:i.step,r:d.step,score:u})}const{n:d,k:u,l:h,r:m}=s??{n:1,k:0,l:1,r:1},p=e=>{const t=Array.from({length:d+1},(t,r)=>Number(((r-u)*e).toPrecision(12)));return{lo:t[0],hi:t[d],ticks:t}};return{left:p(h),right:p(m)}}function dc(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 uc(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 hc(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 mc(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}function pc(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function gc(e,t=720){const[r,n]=Fe(t);return Te(()=>{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 fc(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 bc({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,overlay:h,tooltip:m,onSelect:p,ariaLabel:g,className:f,emptyLabel:b}){const x=he().charts,y=ue(),v=s??(e=>fe(e,y)),w=b??x.noData,N=Ee(null),k=gc(N),$=n??k,[M,C]=Fe(null),L=Be();if(Te(()=>{if(null!==M)return J(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
|
|
627
|
+
return Ye("div",{className:f,ref:N,children:/* @__PURE__ */Ye("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const D=t.filter(Number.isFinite),S=D.every(Number.isInteger),A=void 0===l&&void 0===i?sc(Math.min(0,...D),Math.max(0,...D),{intervals:o+1,integer:S}):null,P=void 0!==l&&void 0===i?sc(l,Math.max(l,...D),{intervals:o+1,integer:S,zero:!1}):null,j=A?A.lo:l??Math.min(0,...D),z=A?A.hi:P?P.hi:i??oc(Math.max(...D,0)),F=A?A.ticks:P?[j,...P.ticks.filter(e=>e>j)]:ac([j,z],{from:0,to:1}).ticks(o+1),E={top:12,right:16,bottom:26,left:pc(F.map(v),48)+(c?10:0)},B=E.left,I=Math.max(B+1,$-E.right),T=E.top,O=r-E.bottom,R=ac([j,z],{from:O,to:T}),W=lc(e.length,{from:B,to:I},a),K=(I-B)/Math.max(1,e.length),q=K>=48,_=q?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),H=Math.max(2,Math.floor((K-6)/6.6)),U=e=>q&&e.length>H?`${e.slice(0,H-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
628
628
|
return Ge("div",{className:`relative ${f??""}`,ref:N,children:[
|
|
629
629
|
/* @__PURE__ */Ge("svg",{width:"100%",height:r,viewBox:`0 0 ${$} ${r}`,role:"img","aria-label":g,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>C(null),onBlur:()=>C(null),onKeyDown:t=>{if(p&&null!==M&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void p(M);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const r="ArrowRight"===t.key?1:-1;C(t=>Math.min(e.length-1,Math.max(0,(t??0)+r)))},children:[
|
|
630
|
-
/* @__PURE__ */Ye("defs",{children:/* @__PURE__ */Ye("clipPath",{id:L,children:/* @__PURE__ */Ye("rect",{x:B,y:T,width:I-B,height:O-T})})}),F.map(e=>/* @__PURE__ */Ye("line",{x1:B,y1:R(e),x2:I,y2:R(e),stroke:
|
|
631
|
-
/* @__PURE__ */Ye("line",{x1:B,y1:R(Math.max(j,0)),x2:I,y2:R(Math.max(j,0)),stroke:
|
|
632
|
-
/* @__PURE__ */Ye("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:B,right:I,top:T,bottom:O,width:$,height:r,clipId:L,active:M})}),h?.({x:W,y:R,left:B,right:I,top:T,bottom:O,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%_===0?/* @__PURE__ */Ye("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:
|
|
630
|
+
/* @__PURE__ */Ye("defs",{children:/* @__PURE__ */Ye("clipPath",{id:L,children:/* @__PURE__ */Ye("rect",{x:B,y:T,width:I-B,height:O-T})})}),F.map(e=>/* @__PURE__ */Ye("line",{x1:B,y1:R(e),x2:I,y2:R(e),stroke:Js.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${e}`)),
|
|
631
|
+
/* @__PURE__ */Ye("line",{x1:B,y1:R(Math.max(j,0)),x2:I,y2:R(Math.max(j,0)),stroke:Js.axis,strokeWidth:1,shapeRendering:"crispEdges"}),F.map(e=>/* @__PURE__ */Ye("text",{x:B-8,y:R(e)+4,textAnchor:"end",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:v(e)},`t${e}`)),c&&/* @__PURE__ */Ye("text",{x:14,y:(T+O)/2,transform:`rotate(-90 14 ${(T+O)/2})`,textAnchor:"middle",fontSize:11,fill:Js.label,children:c}),
|
|
632
|
+
/* @__PURE__ */Ye("g",{clipPath:`url(#${L})`,children:u({x:W,y:R,left:B,right:I,top:T,bottom:O,width:$,height:r,clipId:L,active:M})}),h?.({x:W,y:R,left:B,right:I,top:T,bottom:O,width:$,height:r,clipId:L,active:M}),e.map((e,t)=>t%_===0?/* @__PURE__ */Ye("text",{x:"start"===d?W(t):W.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:U(e)},`x${t}`):null),e.map((t,r)=>/* @__PURE__ */Ye("rect",{x:W.center(r)-(I-B)/e.length/2,y:T,width:(I-B)/e.length,height:O-T,fill:"transparent",onMouseEnter:()=>C(r),onClick:p?()=>p(r):void 0,style:p?{cursor:"pointer"}:void 0},`h${r}`))]}),m&&null!==M&&
|
|
633
633
|
/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 z-10",style:fc(W.center(M),W.bandwidth,$),children:m(M)})]})}function xc({height:e=220,width:t=720,variant:r="area",bars:n=9,label:a,className:l}){const i=he().charts,o=a??i.loading,s=`${Be()}-shimmer`,c=48,d=t-16,u=12,h=e-26;/* @__PURE__ */
|
|
634
634
|
return Ye("div",{className:l,children:/* @__PURE__ */Ge("svg",{width:"100%",height:e,viewBox:`0 0 ${t} ${e}`,role:"img","aria-label":o,"aria-busy":"true",children:[
|
|
635
635
|
/* @__PURE__ */Ye("defs",{children:/* @__PURE__ */Ge("linearGradient",{id:s,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
636
|
-
/* @__PURE__ */Ye("stop",{offset:"0%",stopColor:
|
|
637
|
-
/* @__PURE__ */Ye("stop",{offset:"45%",stopColor:
|
|
638
|
-
/* @__PURE__ */Ye("stop",{offset:"55%",stopColor:
|
|
639
|
-
/* @__PURE__ */Ye("stop",{offset:"100%",stopColor:
|
|
640
|
-
return Ye("line",{x1:c,y1:r,x2:d,y2:r,stroke:
|
|
641
|
-
return Ye("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:
|
|
636
|
+
/* @__PURE__ */Ye("stop",{offset:"0%",stopColor:Js.surface,stopOpacity:"0"}),
|
|
637
|
+
/* @__PURE__ */Ye("stop",{offset:"45%",stopColor:Js.surface,stopOpacity:"0.55"}),
|
|
638
|
+
/* @__PURE__ */Ye("stop",{offset:"55%",stopColor:Js.surface,stopOpacity:"0.55"}),
|
|
639
|
+
/* @__PURE__ */Ye("stop",{offset:"100%",stopColor:Js.surface,stopOpacity:"0"})]})}),Array.from({length:5},(e,t)=>{const r=u+(h-u)*t/4;/* @__PURE__ */
|
|
640
|
+
return Ye("line",{x1:c,y1:r,x2:d,y2:r,stroke:Js.grid,strokeWidth:1,shapeRendering:"crispEdges"},t)}),Array.from({length:5},(e,t)=>/* @__PURE__ */Ye("rect",{x:18,y:u+(h-u)*t/4-4,width:22,height:8,rx:4,fill:Js.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__ */
|
|
641
|
+
return Ye("rect",{x:c+t*r+.18*r,y:h-l,width:.64*r,height:l,rx:3,fill:Js.grid},t)}):/* @__PURE__ */Ye("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:Js.grid}),
|
|
642
642
|
/* @__PURE__ */Ye("rect",{className:"rosh-viz-shimmer",x:-t,y:0,width:t,height:e,fill:`url(#${s})`})]})})}var yc=Oe({highlighted:null,setHighlighted:()=>{}});function vc({children:e}){const[t,r]=Fe(null),n=Ie(()=>({highlighted:t,setHighlighted:r}),[t]);/* @__PURE__ */
|
|
643
643
|
return Ye(yc.Provider,{value:n,children:e})}function wc(){return qe(yc)}function Nc(e,t,r=.22){return null===t?null:t===e?1:r}function kc(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 $c({variant:e="solid",title:t,rows:r,footnote:n,emphasisKey:a,className:l}){const i="glass"===e;/* @__PURE__ */
|
|
644
644
|
return Ge("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${i?"":"bg-white ring-1 ring-black/5"} ${l??""}`,style:i?G():{boxShadow:"var(--elevation-popup)"},children:[t&&/* @__PURE__ */Ye("p",{className:"mb-2 text-sm font-medium text-gray-800",children:t}),
|
|
645
645
|
/* @__PURE__ */Ye("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */Ge("li",{className:"flex items-center gap-3",style:a&&e.key!==a?{opacity:.45}:void 0,children:[
|
|
646
|
-
/* @__PURE__ */Ye("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??
|
|
646
|
+
/* @__PURE__ */Ye("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??Js.muted}}),
|
|
647
647
|
/* @__PURE__ */Ye("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
648
|
-
/* @__PURE__ */Ye("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */Ye("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Mc({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",valueLabels:x=!1,onSelect:y,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=Be(),{highlighted:C}=wc(),L=he().charts,D=ue(),S=o??(e=>fe(e,D)),A=w??S;if(h)/* @__PURE__ */return Ye(xc,{height:a,width:l,variant:"bars",className:c});const P=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?
|
|
649
|
-
return Ye("text",{"data-series-label":"true",x:d,y:f,transform:`rotate(-90 ${d} ${f})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?
|
|
648
|
+
/* @__PURE__ */Ye("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),n&&/* @__PURE__ */Ye("p",{className:"mt-2 text-2xs text-gray-500",children:n})]})}function Mc({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",valueLabels:x=!1,onSelect:y,min:v,formatTooltipValue:w,tooltipLabels:N,barGap:k=4,seriesLabels:$=!1}){const M=Be(),{highlighted:C}=wc(),L=he().charts,D=ue(),S=o??(e=>fe(e,D)),A=w??S;if(h)/* @__PURE__ */return Ye(xc,{height:a,width:l,variant:"bars",className:c});const P=(e,t)=>{const r=e.pointColors?.[t];if(r)return r;const n=e.pointTones?.[t];return n?Zs[n]:ec(e.slot,e.color,e.tone)},j=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(e=>Number.isFinite(e))),z=(e,t)=>{const r=e.data[t];return"number"==typeof r&&Number.isFinite(r)?r:0},F=t.map((e,t)=>j.reduce((e,r)=>e+z(r,t),0)),E=t.map((e,t)=>j.reduce((e,r)=>e+Math.max(0,z(r,t)),0)),B=t.map((e,t)=>j.reduce((e,r)=>e+Math.min(0,z(r,t)),0)),I=r&&"percent"===n,T=(e,t)=>F[t]>0?e/F[t]:null,O=I?[1]:r?[...E,...B]:j.flatMap(e=>e.data.filter(Number.isFinite)),R=(e,t)=>{const r=e.bandwidth/Math.max(1,j.length),n=j.length>1?Math.min(k,.25*r):0;return{offset:t*r+n/2,width:Math.max(1,r-n)}},W=$&&!r?({x:e,y:r})=>{const n=Math.min(r.domain[1],Math.max(r.domain[0],0));return t.map((t,a)=>j.map((t,l)=>{const i=t.data[a];if(!Number.isFinite(i))return null;const o=Math.min(r.domain[1],Math.max(r.domain[0],i)),{offset:s,width:c}=R(e,l),d=e(a)+s+c/2,u=Math.min(r(o),r(n)),h=Math.max(r(o),r(n));if(c<13)return null;const m=Math.floor((h-u-12)/6.6),p=m>=Math.min(4,t.label.length),g=p&&t.label.length>m?`${t.label.slice(0,m-1).trimEnd()}…`:t.label,f=p?h-6:u-4;/* @__PURE__ */
|
|
649
|
+
return Ye("text",{"data-series-label":"true",x:d,y:f,transform:`rotate(-90 ${d} ${f})`,textAnchor:"start",dominantBaseline:"central",fontSize:11,fill:p?Js.surface:Js.label,children:g},`n${t.key}-${a}`)}))}:null;/* @__PURE__ */
|
|
650
650
|
return Ye(bc,{labels:t,values:O,height:a,width:l,max:I?1:i,min:I?void 0:v,formatValue:I?e=>xe(Math.round(100*e),0,D):S,yAxisLabel:s,className:c,emptyLabel:d,onSelect:y,ariaLabel:L.acrossCategories(j.map(e=>e.label),t.length),tooltip:e=>/* @__PURE__ */Ye($c,{title:N?.[e]??t[e],rows:j.map(t=>({key:t.key,label:t.label,color:P(t,e),value:Number.isFinite(t.data[e])?I?`${xe(100*(T(t.data[e],e)??0),1,D)} · ${A(t.data[e])}`:A(t.data[e]):void 0})),footnote:I?L.inCategory(A(F[e])):void 0}),overlay:x&&!I||W?({x:e,y:n})=>/* @__PURE__ */Ge("g",{pointerEvents:"none",children:[W?.({x:e,y:n}),x&&!I&&t.map((t,a)=>{if(r){if(!j.some(e=>Number.isFinite(e.data[a])))return null;const t=j.reduce((e,t)=>e+z(t,a),0),r=t>=0?E[a]:B[a];/* @__PURE__ */
|
|
651
|
-
return Ye("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:
|
|
652
|
-
return Ye("text",{"data-value-label":"true",x:e(a)+o+s/2,y:i>=0?n(i)-4:n(i)+12,textAnchor:"middle",fontSize:11,fill:
|
|
651
|
+
return Ye("text",{"data-value-label":"true",x:e.center(a),y:t>=0?n(r)-4:n(r)+12,textAnchor:"middle",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`v${a}`)}return j.map((t,r)=>{const l=t.data[a];if(!Number.isFinite(l))return null;const i=l,{offset:o,width:s}=R(e,r);/* @__PURE__ */
|
|
652
|
+
return Ye("text",{"data-value-label":"true",x:e(a)+o+s/2,y:i>=0?n(i)-4:n(i)+12,textAnchor:"middle",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:S(i)},`v${t.key}-${a}`)})})]}):void 0,children:({x:e,y:n,bottom:a,active:l})=>{const i=f?t.indexOf(f):-1,o=kc(r?F:j[0]?.data??[],b),s=l??(i>=0?i:o);/* @__PURE__ */
|
|
653
653
|
return Ge("g",{children:[
|
|
654
|
-
/* @__PURE__ */Ye(Si,{id:M,glow:p}),t.map((t,a)=>{let l=0,i=0;const o=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return j.map((t,c)=>{const d=t.data[a];if(!Number.isFinite(d))return null;const h=I?T(d,a):d;if(null===h)return null;const f=P(t,a),b=R(e,c),x=r?e(a):e(a)+b.offset,y=r?Math.max(1,e.bandwidth):b.width;let v,w,N=!0;if(r){const e=h>=0?l:i,t=e+h;h>=0?l=t:i=t,v=n(Math.max(e,t)),w=n(Math.min(e,t)),N=0===e}else v=Math.min(n(h),o),w=Math.max(n(h),o);const k=Math.max(0,w-v-(r&&!N?2:0)),$=null===s||s===a,L=$?f:g?
|
|
655
|
-
return Ye("rect",{x:x,y:v,width:y,height:k,rx:u,fill:L,fillOpacity:D??($?1:g?.32:.45),filter:p&&s===a?`url(#${Ni(M)})`:void 0,className:"rosh-viz-mark"+(m?` ${Pi.rise}`:""),style:m?ji(a*(r?1:j.length)+c,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */Ye("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:
|
|
654
|
+
/* @__PURE__ */Ye(Si,{id:M,glow:p}),t.map((t,a)=>{let l=0,i=0;const o=n(Math.min(n.domain[1],Math.max(n.domain[0],0)));return j.map((t,c)=>{const d=t.data[a];if(!Number.isFinite(d))return null;const h=I?T(d,a):d;if(null===h)return null;const f=P(t,a),b=R(e,c),x=r?e(a):e(a)+b.offset,y=r?Math.max(1,e.bandwidth):b.width;let v,w,N=!0;if(r){const e=h>=0?l:i,t=e+h;h>=0?l=t:i=t,v=n(Math.max(e,t)),w=n(Math.min(e,t)),N=0===e}else v=Math.min(n(h),o),w=Math.max(n(h),o);const k=Math.max(0,w-v-(r&&!N?2:0)),$=null===s||s===a,L=$?f:g?Js.muted:f,D=Nc(t.key,C);/* @__PURE__ */
|
|
655
|
+
return Ye("rect",{x:x,y:v,width:y,height:k,rx:u,fill:L,fillOpacity:D??($?1:g?.32:.45),filter:p&&s===a?`url(#${Ni(M)})`:void 0,className:"rosh-viz-mark"+(m?` ${Pi.rise}`:""),style:m?ji(a*(r?1:j.length)+c,26):void 0},`${t.key}-${a}`)})}),null!==l&&!g&&/* @__PURE__ */Ye("line",{x1:e.center(l),y1:n(n.domain[1]),x2:e.center(l),y2:a,stroke:Js.axis,strokeWidth:1})]})}})}var Cc=e=>e.toFixed(2);function Lc(e){return e.map(([e,t],r)=>`${0===r?"M":"L"}${Cc(e)},${Cc(t)}`).join(" ")}function Dc(e){let t="";return e.forEach((e,r)=>{t+=`${0===r?"M":" L"}${Cc(e.start)},${Cc(e.y)}`,t+=` L${Cc(e.end)},${Cc(e.y)}`}),t}function Sc(e){if(e.length<3)return Lc(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${Cc(e[0][0])},${Cc(e[0][1])}`;for(let n=0;n<t-1;n+=1){const t=r[n]/3;l+=` C${Cc(e[n][0]+t)},${Cc(e[n][1]+a[n]*t)} ${Cc(e[n+1][0]-t)},${Cc(e[n+1][1]-a[n+1]*t)} ${Cc(e[n+1][0])},${Cc(e[n+1][1])}`}return l}function Ac(e,t=0){if(e.length<3)return Lc(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${Cc(e[0][0])},${Cc(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${Cc(c)},${Cc(d)} ${Cc(u)},${Cc(h)} ${Cc(a[0])},${Cc(a[1])}`}return o}function Pc(e){if(e.length<2)return Lc(e);let t=`M${Cc(e[0][0])},${Cc(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${Cc(o)},${Cc(a)} ${Cc(o)},${Cc(i)} ${Cc(l)},${Cc(i)}`}return t}function jc(e,t="linear",r=0){return 0===e.length?"":1===e.length?`M${Cc(e[0][0])},${Cc(e[0][1])}`:"monotone"===t?Sc(e):"spline"===t?Ac(e,r):"bump"===t?Pc(e):Lc(e)}function zc(e,t,r){if(0===t.length)return"";const n=t[0],a=t[t.length-1];return`${e} L${Cc(a[0])},${Cc(r)} L${Cc(n[0])},${Cc(r)} Z`}function Fc(e,t){if(0===t.length)return e;return`${e} L${[...t].reverse().map(([e,t])=>`${Cc(e)},${Cc(t)}`).join(" L")} Z`}function Ec(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 Bc(e,t,r,n,a,l){const i=l-a;if(Math.abs(i)>=2*Math.PI){const l=a+Math.PI;return`${Bc(e,t,r,n,a,l)} ${Bc(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${Cc(e)},${Cc(t)} L${Cc(c)},${Cc(d)} A${Cc(n)},${Cc(n)} 0 ${o} 1 ${Cc(u)},${Cc(h)} Z`;const[m,p]=s(r,l),[g,f]=s(r,a);return`M${Cc(c)},${Cc(d)} A${Cc(n)},${Cc(n)} 0 ${o} 1 ${Cc(u)},${Cc(h)} L${Cc(m)},${Cc(p)} A${Cc(r)},${Cc(r)} 0 ${o} 0 ${Cc(g)},${Cc(f)} Z`}function Ic({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=he().charts,g=ue(),f=o??(e=>fe(e,g)),b=i??p.other,x=m??p.nothingToBreakDown,y=Be(),[v,w]=Fe(null),{highlighted:N}=wc(),k=Ee(null),$=gc(k,Number.POSITIVE_INFINITY),M=e.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===M.length)/* @__PURE__ */return Ye("p",{className:`text-sm text-gray-500 ${h??""}`,children:x});const C=[...M].sort((e,t)=>t.value-e.value),L=C.slice(0,l),D=C.slice(l),S=D.length>0?[...L,{key:"__other__",label:b,value:D.reduce((e,t)=>e+t.value,0),slot:-1,color:Js.muted}]:L,A=e=>ec(e.slot,e.color,e.tone),P=S.reduce((e,t)=>e+t.value,0),j=Math.ceil(.62*Math.max(...S.map(e=>String(e.label).length),4)*11)+24,z="outside"===d&&$>=120+2*j,F=z?j:0,E=z?Math.max(120,Math.min(r,$-2*F)):r,B=E+2*F,I=F+E/2,T=E/2,O=E/2-12,R=n??("ring"===t?.58*O:0),W=uc(S.length,a),K=Math.max(...S.map(e=>e.value)),q=e=>R+(O-R)*Math.sqrt(Math.max(0,e)/K);let _=-Math.PI/2;const H=(()=>{if(!z)return[];let e=-Math.PI/2;const r=S.map((r,n)=>{const l="rose"===t?uc(S.length,a).step:r.value/P*Math.PI*2,i="rose"===t?uc(S.length,a).center(n):e+l/2;e+=l;const o="rose"===t?q(r.value):O;return{key:r.key,label:r.label,share:r.value/P,right:Math.cos(i)>=0,anchor:[I+o*Math.cos(i),T+o*Math.sin(i)],y:T+(o+14)*Math.sin(i),index:n}}).filter(e=>e.share>=u),n=Math.max(1,Math.floor((E-11-13)/26)+1),l=/* @__PURE__ */new Set;for(const e of[!0,!1]){const t=r.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,n).sort((e,t)=>e.y-t.y);for(let e=1;e<t.length;e+=1)t[e].y-t[e-1].y<26&&(t[e].y=t[e-1].y+26);for(let e=t.length-1;e>=0;e-=1){const r=e===t.length-1?E-13:t[e+1].y-26;t[e].y=Math.min(t[e].y,r)}t.forEach((e,r)=>{e.y=Math.max(e.y,0===r?11:t[r-1].y+26),l.add(e.key)})}return r.filter(e=>l.has(e.key))})(),U=(e,t)=>null!==v?v!==e:null!==N&&N!==t,V=null!==v?S[v]:void 0;/* @__PURE__ */
|
|
656
656
|
return Ge("div",{className:`relative ${h??""}`,ref:k,children:[
|
|
657
657
|
/* @__PURE__ */Ge("svg",{width:"100%",height:E,viewBox:`0 0 ${B} ${E}`,role:"img","aria-labelledby":y,onMouseLeave:()=>w(null),children:[
|
|
658
658
|
/* @__PURE__ */Ye("title",{id:y,children:p.breakdown(f(P),S.length)}),S.map((e,r)=>{const n=A(e),l="rose"===t?W(r):_,i="rose"===t?W.step:e.value/P*Math.PI*2-a;"rose"!==t&&(_+=e.value/P*Math.PI*2);const o=l+Math.max(.001,i),s="rose"===t?q(e.value):O;/* @__PURE__ */
|
|
659
|
-
return Ye("path",{d:Bc(I,T,R,s,l,o),fill:n,fillOpacity:
|
|
659
|
+
return Ye("path",{d:Bc(I,T,R,s,l,o),fill:n,fillOpacity:U(r,e.key)?.4:1,stroke:Js.surface,strokeWidth:1,className:c?Pi.sweep:void 0,style:c?ji(r,55):void 0,onMouseEnter:()=>w(r)},e.key)}),H.map(e=>{const t=e.right?B-6:6,r=e.right?I+O+14:I-O-14;/* @__PURE__ */
|
|
660
660
|
return Ge("g",{children:[
|
|
661
|
-
/* @__PURE__ */Ye("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${r},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:
|
|
662
|
-
/* @__PURE__ */Ye("text",{x:t,y:e.y-2,fontSize:11,fill:
|
|
663
|
-
/* @__PURE__ */Ye("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:
|
|
661
|
+
/* @__PURE__ */Ye("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${r},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:Js.grid,strokeWidth:1}),
|
|
662
|
+
/* @__PURE__ */Ye("text",{x:t,y:e.y-2,fontSize:11,fill:Js.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
663
|
+
/* @__PURE__ */Ye("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:Js.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:xe(100*e.share,1,g)})]},`lbl-${e.key}`)}),s&&R>0&&/* @__PURE__ */Ye("text",{x:I,y:T+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Js.label,children:s})]}),V&&null!==v&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:V.label,rows:[{key:"value",label:p.value,color:A(V),value:f(V.value)},{key:"share",label:p.share,color:Js.muted,value:xe(V.value/P*100,1,g)}]})}),
|
|
664
664
|
/* @__PURE__ */Ye("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:S.map((e,t)=>/* @__PURE__ */Ge("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
665
665
|
/* @__PURE__ */Ye("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:A(e)}}),
|
|
666
666
|
/* @__PURE__ */Ye("span",{className:"flex-1 truncate",children:e.label}),
|
|
@@ -674,14 +674,14 @@ return Ye(zt,{groups:Tc,children:/* @__PURE__ */Ye("div",{className:"h-full over
|
|
|
674
674
|
/* @__PURE__ */Ye(w,{variant:"secondary",size:"sm",children:"Export"}),
|
|
675
675
|
/* @__PURE__ */Ye(w,{size:"sm",children:"New report"})]})]}),
|
|
676
676
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
677
|
-
/* @__PURE__ */Ye(
|
|
678
|
-
/* @__PURE__ */Ye(
|
|
679
|
-
/* @__PURE__ */Ye(
|
|
680
|
-
/* @__PURE__ */Ye(
|
|
677
|
+
/* @__PURE__ */Ye(Ua,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
678
|
+
/* @__PURE__ */Ye(Ua,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
679
|
+
/* @__PURE__ */Ye(Ua,{label:"Customers",value:"892",delta:{value:"2%",direction:"down"}}),
|
|
680
|
+
/* @__PURE__ */Ye(Ua,{label:"Refunds",value:"$1.1k",delta:{value:"0%",direction:"flat"}})]}),
|
|
681
681
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-3",children:[
|
|
682
|
-
/* @__PURE__ */Ye(
|
|
683
|
-
/* @__PURE__ */Ye(
|
|
684
|
-
/* @__PURE__ */Ye(
|
|
682
|
+
/* @__PURE__ */Ye(Ha,{header:"Revenue",className:"lg:col-span-2",children:/* @__PURE__ */Ye(Mc,{labels:Rc,height:200,series:[{key:"revenue",label:"Revenue",data:Oc}],formatValue:e=>`$${e}k`})}),
|
|
683
|
+
/* @__PURE__ */Ye(Ha,{header:"Traffic sources",children:/* @__PURE__ */Ye(Ic,{variant:"ring",size:180,segments:Wc,centerLabel:"100%"})})]}),
|
|
684
|
+
/* @__PURE__ */Ye(Ha,{header:"Recent orders",padded:!1,children:/* @__PURE__ */Ge("table",{className:"w-full text-sm",children:[
|
|
685
685
|
/* @__PURE__ */Ye("thead",{children:/* @__PURE__ */Ge("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
686
686
|
/* @__PURE__ */Ye("th",{className:`${l} px-4 py-2 font-medium`,children:"Order"}),
|
|
687
687
|
/* @__PURE__ */Ye("th",{className:`${l} px-4 py-2 font-medium`,children:"Customer"}),
|
|
@@ -694,14 +694,14 @@ return Ye(zt,{groups:Tc,children:/* @__PURE__ */Ye("div",{className:"h-full over
|
|
|
694
694
|
/* @__PURE__ */Ye("td",{className:"px-4 py-2",children:e.total}),
|
|
695
695
|
/* @__PURE__ */Ye("td",{className:"px-4 py-2",children:/* @__PURE__ */Ye(Et,{status:e.status})})]},e.id))})]})}),
|
|
696
696
|
/* @__PURE__ */Ge("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
|
|
697
|
-
/* @__PURE__ */Ye("span",{className:"text-emerald-600",children:/* @__PURE__ */Ye(Ys,{data:Oc,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}var _c={active:"success",invited:"queued",suspended:"danger",pending:"pending"},
|
|
697
|
+
/* @__PURE__ */Ye("span",{className:"text-emerald-600",children:/* @__PURE__ */Ye(Ys,{data:Oc,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}var _c={active:"success",invited:"queued",suspended:"danger",pending:"pending"},Hc=[{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 Uc(){const[e,t]=Fe(1),[r,n]=Fe(""),[a,i]=Fe("");/* @__PURE__ */
|
|
698
698
|
return Ye(zt,{groups:_c,children:/* @__PURE__ */Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ge("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
699
699
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-4",children:[
|
|
700
700
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
701
701
|
/* @__PURE__ */Ye(w,{size:"sm",children:"Invite member"})]}),
|
|
702
|
-
/* @__PURE__ */Ge(
|
|
702
|
+
/* @__PURE__ */Ge(Ha,{padded:!1,children:[
|
|
703
703
|
/* @__PURE__ */Ge("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
|
|
704
|
-
/* @__PURE__ */Ye("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */Ye(
|
|
704
|
+
/* @__PURE__ */Ye("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */Ye(Je,{value:a,onChange:e=>i(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */Ye(Vc,{})})}),
|
|
705
705
|
/* @__PURE__ */Ye("div",{className:"w-40",children:/* @__PURE__ */Ye(pt,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
|
|
706
706
|
/* @__PURE__ */Ye(w,{variant:"secondary",size:"sm",children:"Filter"})]}),
|
|
707
707
|
/* @__PURE__ */Ge("table",{className:"w-full text-sm",children:[
|
|
@@ -710,7 +710,7 @@ return Ye(zt,{groups:_c,children:/* @__PURE__ */Ye("div",{className:"h-full over
|
|
|
710
710
|
/* @__PURE__ */Ye("th",{className:`${l} px-4 py-2 font-medium`,children:"Role"}),
|
|
711
711
|
/* @__PURE__ */Ye("th",{className:`${l} px-4 py-2 font-medium`,children:"Status"}),
|
|
712
712
|
/* @__PURE__ */Ye("th",{className:`${l} px-4 py-2 font-medium text-right`,children:"Actions"})]})}),
|
|
713
|
-
/* @__PURE__ */Ye("tbody",{className:"divide-y divide-gray-100",children:
|
|
713
|
+
/* @__PURE__ */Ye("tbody",{className:"divide-y divide-gray-100",children:Hc.map(e=>/* @__PURE__ */Ge("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
|
|
714
714
|
/* @__PURE__ */Ge("td",{className:"px-4 py-3",children:[
|
|
715
715
|
/* @__PURE__ */Ye("div",{className:"font-medium text-gray-900",children:e.name}),
|
|
716
716
|
/* @__PURE__ */Ye("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
@@ -725,13 +725,13 @@ return Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
725
725
|
/* @__PURE__ */Ge("div",{children:[
|
|
726
726
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Account settings"}),
|
|
727
727
|
/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500",children:"Update your profile and preferences."})]}),
|
|
728
|
-
/* @__PURE__ */Ye(
|
|
728
|
+
/* @__PURE__ */Ye(Ha,{header:"Profile",children:/* @__PURE__ */Ge("div",{className:"space-y-4",children:[
|
|
729
729
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
730
|
-
/* @__PURE__ */Ye(yt,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */Ye(
|
|
731
|
-
/* @__PURE__ */Ye(yt,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */Ye(
|
|
732
|
-
/* @__PURE__ */Ye(yt,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */Ye(
|
|
730
|
+
/* @__PURE__ */Ye(yt,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */Ye(Je,{id:"fn",defaultValue:"Alice"})}),
|
|
731
|
+
/* @__PURE__ */Ye(yt,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */Ye(Je,{id:"ln",defaultValue:"Nguyen"})})]}),
|
|
732
|
+
/* @__PURE__ */Ye(yt,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */Ye(Je,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
|
|
733
733
|
/* @__PURE__ */Ye(yt,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */Ye(Qe,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
|
|
734
|
-
/* @__PURE__ */Ye(
|
|
734
|
+
/* @__PURE__ */Ye(Ha,{header:"Preferences",children:/* @__PURE__ */Ge("div",{className:"space-y-4",children:[
|
|
735
735
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
736
736
|
/* @__PURE__ */Ye(yt,{label:"Country",htmlFor:"country",children:/* @__PURE__ */Ye(pt,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
|
|
737
737
|
/* @__PURE__ */Ye(yt,{label:"Plan",children:/* @__PURE__ */Ge("div",{className:"space-y-2 pt-1",children:[
|
|
@@ -746,24 +746,24 @@ return Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
746
746
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
747
747
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
748
748
|
/* @__PURE__ */Ge("form",{className:"space-y-5 lg:col-span-2",onSubmit:e=>e.preventDefault(),children:[
|
|
749
|
-
/* @__PURE__ */Ye(
|
|
750
|
-
/* @__PURE__ */Ye(
|
|
749
|
+
/* @__PURE__ */Ye(Ha,{header:"Contact",children:/* @__PURE__ */Ye("div",{className:"space-y-4",children:/* @__PURE__ */Ye(yt,{label:"Email",htmlFor:"ck-email",required:!0,children:/* @__PURE__ */Ye(Je,{id:"ck-email",type:"email",placeholder:"you@example.com"})})})}),
|
|
750
|
+
/* @__PURE__ */Ye(Ha,{header:"Shipping address",children:/* @__PURE__ */Ge("div",{className:"space-y-4",children:[
|
|
751
751
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
|
|
752
|
-
/* @__PURE__ */Ye(yt,{label:"First name",required:!0,children:/* @__PURE__ */Ye(
|
|
753
|
-
/* @__PURE__ */Ye(yt,{label:"Last name",required:!0,children:/* @__PURE__ */Ye(
|
|
754
|
-
/* @__PURE__ */Ye(yt,{label:"Address",required:!0,children:/* @__PURE__ */Ye(
|
|
752
|
+
/* @__PURE__ */Ye(yt,{label:"First name",required:!0,children:/* @__PURE__ */Ye(Je,{placeholder:"Alice"})}),
|
|
753
|
+
/* @__PURE__ */Ye(yt,{label:"Last name",required:!0,children:/* @__PURE__ */Ye(Je,{placeholder:"Nguyen"})})]}),
|
|
754
|
+
/* @__PURE__ */Ye(yt,{label:"Address",required:!0,children:/* @__PURE__ */Ye(Je,{placeholder:"123 Market St"})}),
|
|
755
755
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[
|
|
756
|
-
/* @__PURE__ */Ye(yt,{label:"City",children:/* @__PURE__ */Ye(
|
|
757
|
-
/* @__PURE__ */Ye(yt,{label:"ZIP",children:/* @__PURE__ */Ye(
|
|
756
|
+
/* @__PURE__ */Ye(yt,{label:"City",children:/* @__PURE__ */Ye(Je,{placeholder:"San Francisco"})}),
|
|
757
|
+
/* @__PURE__ */Ye(yt,{label:"ZIP",children:/* @__PURE__ */Ye(Je,{placeholder:"94103"})}),
|
|
758
758
|
/* @__PURE__ */Ye(yt,{label:"Country",children:/* @__PURE__ */Ye(pt,{value:r,onChange:n,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})})]}),
|
|
759
759
|
/* @__PURE__ */Ye(ft,{checked:e,onChange:t,label:"Billing address same as shipping"})]})}),
|
|
760
|
-
/* @__PURE__ */Ye(
|
|
761
|
-
/* @__PURE__ */Ye(yt,{label:"Card number",required:!0,children:/* @__PURE__ */Ye(
|
|
760
|
+
/* @__PURE__ */Ye(Ha,{header:"Payment",children:/* @__PURE__ */Ge("div",{className:"space-y-4",children:[
|
|
761
|
+
/* @__PURE__ */Ye(yt,{label:"Card number",required:!0,children:/* @__PURE__ */Ye(Je,{placeholder:"1234 5678 9012 3456"})}),
|
|
762
762
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-2 gap-4",children:[
|
|
763
|
-
/* @__PURE__ */Ye(yt,{label:"Expiry",required:!0,children:/* @__PURE__ */Ye(
|
|
764
|
-
/* @__PURE__ */Ye(yt,{label:"CVC",required:!0,children:/* @__PURE__ */Ye(
|
|
763
|
+
/* @__PURE__ */Ye(yt,{label:"Expiry",required:!0,children:/* @__PURE__ */Ye(Je,{placeholder:"MM / YY"})}),
|
|
764
|
+
/* @__PURE__ */Ye(yt,{label:"CVC",required:!0,children:/* @__PURE__ */Ye(Je,{placeholder:"123"})})]})]})})]}),
|
|
765
765
|
/* @__PURE__ */Ge("div",{className:"space-y-4",children:[
|
|
766
|
-
/* @__PURE__ */Ge(
|
|
766
|
+
/* @__PURE__ */Ge(Ha,{header:"Order summary",children:[
|
|
767
767
|
/* @__PURE__ */Ye("ul",{className:"space-y-2 text-sm",children:Gc.map(e=>/* @__PURE__ */Ge("li",{className:"flex items-center justify-between gap-2 text-gray-700",children:[
|
|
768
768
|
/* @__PURE__ */Ge("span",{children:[e.name," ",
|
|
769
769
|
/* @__PURE__ */Ge("span",{className:"text-gray-400",children:["×",e.qty]})]}),
|
|
@@ -779,11 +779,11 @@ return Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
779
779
|
/* @__PURE__ */Ye("span",{children:"Total"}),
|
|
780
780
|
/* @__PURE__ */Ge("span",{children:["$",l]})]})]}),
|
|
781
781
|
/* @__PURE__ */Ge(w,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
|
|
782
|
-
/* @__PURE__ */Ye(
|
|
782
|
+
/* @__PURE__ */Ye(Hl,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var Zc=[{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"}],Jc=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function Qc(){const[e,r]=Fe(1),n=Jc.find(t=>t.id===e)??Jc[0];/* @__PURE__ */
|
|
783
783
|
return Ye("div",{className:"h-full",children:/* @__PURE__ */Ye(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */Ge("div",{className:"flex h-full flex-col p-2",children:[
|
|
784
|
-
/* @__PURE__ */Ye(w,{block:!0,className:"mb-2",children:"Compose"}),
|
|
784
|
+
/* @__PURE__ */Ye(w,{block:!0,className:"mb-2",children:"Compose"}),Zc.map((e,t)=>/* @__PURE__ */Ge("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:[
|
|
785
785
|
/* @__PURE__ */Ye("span",{children:e.label}),null!=e.count&&/* @__PURE__ */Ye("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */Ge("div",{className:"flex h-full",children:[
|
|
786
|
-
/* @__PURE__ */Ye("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:
|
|
786
|
+
/* @__PURE__ */Ye("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:Jc.map(t=>/* @__PURE__ */Ge("button",{onClick:()=>r(t.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
|
|
787
787
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2",children:[
|
|
788
788
|
/* @__PURE__ */Ye("span",{className:"truncate text-sm "+(t.unread?"font-semibold text-gray-900":"text-gray-700"),children:t.from}),
|
|
789
789
|
/* @__PURE__ */Ye("span",{className:"shrink-0 text-2xs text-gray-400",children:t.time})]}),
|
|
@@ -819,14 +819,14 @@ return Ye("div",{className:"h-full",children:/* @__PURE__ */Ye(t,{side:"left",de
|
|
|
819
819
|
/* @__PURE__ */Ye("div",{className:"text-xs text-gray-400 capitalize",children:n.status})]})]}),
|
|
820
820
|
/* @__PURE__ */Ye("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:td.map((e,t)=>/* @__PURE__ */Ye("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */Ye("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))}),
|
|
821
821
|
/* @__PURE__ */Ge("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
822
|
-
/* @__PURE__ */Ye("div",{className:"flex-1",children:/* @__PURE__ */Ye(
|
|
822
|
+
/* @__PURE__ */Ye("div",{className:"flex-1",children:/* @__PURE__ */Ye(Je,{placeholder:"Type a message…"})}),
|
|
823
823
|
/* @__PURE__ */Ye(w,{type:"submit",children:"Send"})]})]})})})}var nd={featured:"success",new:"active",draft:"draft"},ad=["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 ld(){const[e,t]=Fe("all"),r="all"===e?ad:ad.filter(t=>t.tag===e);/* @__PURE__ */
|
|
824
824
|
return Ye(zt,{groups:nd,children:/* @__PURE__ */Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ge("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
825
825
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-4",children:[
|
|
826
826
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
827
827
|
/* @__PURE__ */Ye(w,{size:"sm",children:"Upload"})]}),
|
|
828
828
|
/* @__PURE__ */Ye(Xl,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
|
|
829
|
-
/* @__PURE__ */Ye("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */Ge(
|
|
829
|
+
/* @__PURE__ */Ye("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */Ge(Ha,{padded:!1,className:"overflow-hidden",children:[
|
|
830
830
|
/* @__PURE__ */Ye("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */Ye("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */Ye(Et,{status:e.tag})})}),
|
|
831
831
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2 p-3",children:[
|
|
832
832
|
/* @__PURE__ */Ye("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
|
|
@@ -836,8 +836,8 @@ return Ye("div",{className:"flex h-full items-center justify-center overflow-aut
|
|
|
836
836
|
/* @__PURE__ */Ye("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"}),
|
|
837
837
|
/* @__PURE__ */Ye("h1",{className:"text-lg font-semibold text-gray-900",children:n.title}),
|
|
838
838
|
/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500",children:n.subtitle})]}),
|
|
839
|
-
/* @__PURE__ */Ye(
|
|
840
|
-
/* @__PURE__ */Ye(yt,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */Ye(
|
|
839
|
+
/* @__PURE__ */Ye(Ha,{children:/* @__PURE__ */Ge("form",{className:"space-y-4",onSubmit:e=>e.preventDefault(),children:["register"===e&&/* @__PURE__ */Ye(yt,{label:"Name",htmlFor:"au-name",children:/* @__PURE__ */Ye(Je,{id:"au-name",placeholder:"Alice Nguyen"})}),
|
|
840
|
+
/* @__PURE__ */Ye(yt,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */Ye(Je,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */Ye(yt,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */Ye(Je,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */Ge("div",{className:"flex items-center justify-between",children:[
|
|
841
841
|
/* @__PURE__ */Ye(ft,{checked:t,onChange:r,label:"Remember me"}),
|
|
842
842
|
/* @__PURE__ */Ye("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
843
843
|
/* @__PURE__ */Ye(w,{type:"submit",block:!0,children:n.cta})]})}),
|
|
@@ -848,12 +848,12 @@ return Ge("div",{className:"flex h-full flex-col items-center justify-center bg-
|
|
|
848
848
|
/* @__PURE__ */Ye("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
|
|
849
849
|
/* @__PURE__ */Ye("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
|
|
850
850
|
/* @__PURE__ */Ye("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */Ye("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function dd({pick:e}){/* @__PURE__ */
|
|
851
|
-
return Ye(Xe,{children:e(he().errors)})}var ud=class extends
|
|
851
|
+
return Ye(Xe,{children:e(he().errors)})}var ud=class extends He{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),oe(e),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):
|
|
852
852
|
/* @__PURE__ */Ge("div",{className:"flex h-full flex-col",children:[
|
|
853
853
|
/* @__PURE__ */Ye("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */Ye(cd,{code:500,actions:/* @__PURE__ */Ge(Xe,{children:[
|
|
854
854
|
/* @__PURE__ */Ye(w,{onClick:this.reset,children:/* @__PURE__ */Ye(dd,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */Ge("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
855
855
|
/* @__PURE__ */Ye("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */Ye(dd,{pick:e=>e.details})}),
|
|
856
|
-
/* @__PURE__ */Ye("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 hd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function md(e){const t=hd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function pd(){return hd()?.matches??!1}function gd(){return!1}function fd(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 bd(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 xd(e){const t=e||"system";return"system"===t?pd()?"dark":"light":t}function yd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=fd(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",bd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",bd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",bd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",bd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",bd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",bd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",bd(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 vd(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]=fd(a);l.style.setProperty("--custom-button-hover",bd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var wd=["square","soft","round"];function Nd(e){return"square"===e||"round"===e?e:"soft"}function kd(e){const t=Nd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function $d(e){const t="string"==typeof e&&e?e:null;Pe(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Md(e){"corners"in e&&kd(e.corners),"icon_set"in e&&$d(e.icon_set),document.documentElement.setAttribute("data-theme",xd(e.theme)),yd(e.accent_color??null),vd(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 Cd(){const{prefs:e}=y(),t=
|
|
856
|
+
/* @__PURE__ */Ye("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 hd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function md(e){const t=hd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function pd(){return hd()?.matches??!1}function gd(){return!1}function fd(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 bd(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 xd(e){const t=e||"system";return"system"===t?pd()?"dark":"light":t}function yd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=fd(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",bd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",bd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",bd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",bd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",bd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",bd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",bd(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 vd(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]=fd(a);l.style.setProperty("--custom-button-hover",bd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var wd=["square","soft","round"];function Nd(e){return"square"===e||"round"===e?e:"soft"}function kd(e){const t=Nd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function $d(e){const t="string"==typeof e&&e?e:null;Pe(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function Md(e){"corners"in e&&kd(e.corners),"icon_set"in e&&$d(e.icon_set),document.documentElement.setAttribute("data-theme",xd(e.theme)),yd(e.accent_color??null),vd(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 Cd(){const{prefs:e}=y(),t=Ue(md,pd,gd),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=Nd(e.corners),c="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,d="system"===r?t?"dark":"light":r;return Te(()=>(document.documentElement.setAttribute("data-theme",d),()=>document.documentElement.removeAttribute("data-theme")),[d]),Te(()=>(kd(s),()=>document.documentElement.removeAttribute("data-corners")),[s]),Te(()=>($d(c),()=>$d(null)),[c]),Te(()=>{yd(n)},[n]),Te(()=>{vd(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:d,corners:s,iconSet:c}}function Ld(e){const t=Math.max(0,...e.map(e=>[...e].reduce((e,t)=>e+((t.codePointAt(0)??0)>=11904?1:.62),0)));return Math.round(10*(t+3.5))/10}function Dd({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=g(),l=he().language;return n.length<2?null:/* @__PURE__ */Ge("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
|
|
857
857
|
/* @__PURE__ */Ye(Ae,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
858
858
|
/* @__PURE__ */Ye("span",{className:"block",style:{width:`${Ld(n.map(e=>e.name))}em`},children:/* @__PURE__ */Ye(pt,{size:e,touchSize:e,"aria-label":l.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function Sd({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=g(),l=he().language;return n.length<2?null:/* @__PURE__ */Ge("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
859
859
|
/* @__PURE__ */Ge("div",{children:[
|
|
@@ -863,20 +863,20 @@ return Ye(Xe,{children:e(he().errors)})}var ud=class extends Ue{state={error:nul
|
|
|
863
863
|
return Ye("span",{className:"text-gray-400",role:"img","aria-label":e,children:Ce})}function Pd({value:e,precise:t,locale:r,className:n}){const a=ue(),l=Le(e);if(!l)/* @__PURE__ */return Ye(Ad,{});const i="string"==typeof e?e:l.toISOString();/* @__PURE__ */
|
|
864
864
|
return Ye("time",{dateTime:i,title:Se(i,{locale:r??a}),className:n,children:De(l,{precise:t,locale:r??a})})}function jd(e,t=300){const[r,n]=Fe(e);return Te(()=>{const r=setTimeout(()=>n(e),t);return()=>clearTimeout(r)},[e,t]),r}function zd(e,t){Te(()=>{const r=r=>{e.current&&!e.current.contains(r.target)&&t()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}function Fd(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 Ed(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 Bd(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=Fd(s.map(e=>e.value),c,t),a=Fd([...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=Ed(s,c,o,r);i.push(...e.tiles),o=e.rest,s=[],c=0}}s.length>0&&i.push(...Ed(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}))}function Id({rows:e,max:t,formatValue:r,emphasisKey:n,highlight:a="none",emphasisTone:l,barHeight:i=12,rowGap:o=30,animate:s=!0,labelFont:c="sans",className:d,emptyLabel:u}){const h=he().charts,m=ue(),p=r??(e=>fe(e,m)),g=u??h.nothingToRank;if(0===e.length)/* @__PURE__ */
|
|
865
865
|
return Ye("p",{className:`text-sm text-gray-500 ${d??""}`,children:g});const f=kc(e.map(e=>e.value),a),b=n??(null===f?void 0:e[f]?.key),x=t??Math.max(...e.map(e=>e.value).filter(Number.isFinite),0),y=Qs(0);/* @__PURE__ */
|
|
866
|
-
return Ye("ol",{className:`m-0 list-none p-0 ${d??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===b,n=r?l?
|
|
866
|
+
return Ye("ol",{className:`m-0 list-none p-0 ${d??""}`,style:{display:"grid",rowGap:`${Math.max(4,o-i)}px`},children:e.map((e,t)=>{const r=e.key===b,n=r?l?Zs[l]:Qs(1):b?Js.muted:y,a=Number.isFinite(e.value)?e.value:null,o=null!==a&&x>0?Math.max(0,Math.min(1,a/x)):0;/* @__PURE__ */
|
|
867
867
|
return Ge("li",{className:"grid gap-1",children:[
|
|
868
868
|
/* @__PURE__ */Ge("div",{className:"flex items-baseline justify-between gap-3",children:[
|
|
869
869
|
/* @__PURE__ */Ge("span",{className:`truncate ${"mono"===c?"font-mono ":""}text-xs text-gray-600 ${r?"font-semibold":""}`,title:e.label,children:[e.label,r&&/* @__PURE__ */Ye("span",{className:"sr-only",children:` ${h.emphasised}`})]}),
|
|
870
870
|
/* @__PURE__ */Ye("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-gray-700",style:r?{color:n}:void 0,children:null===a?"—":p(a)})]}),
|
|
871
871
|
/* @__PURE__ */Ye("div",{className:"w-full rounded-sm bg-gray-200",style:{height:i},children:/* @__PURE__ */Ye("div",{className:`rounded-sm ${s?Pi.grow:""}`,style:{width:`${(100*o).toFixed(2)}%`,height:i,backgroundColor:n,minWidth:o>0?2:0,...s?ji(t):{}}})})]},e.key)})})}var Td=e=>Math.max(0,Math.min(1,e));function Od({value:e,segments:t,objective:r,label:n,detail:a,formatValue:l,tone:i,className:o,unavailableLabel:s}){const c=he().charts,d=ue(),u=l??(e=>xe(100*e,1,d)),h=s??c.notEnough;if(null==e||!Number.isFinite(e))/* @__PURE__ */
|
|
872
872
|
return Ge("div",{className:o,children:[n&&/* @__PURE__ */Ye("p",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
873
|
-
/* @__PURE__ */Ye("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=Td(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=
|
|
873
|
+
/* @__PURE__ */Ye("p",{className:"mt-1 text-sm text-gray-500",children:h})]});const m=Td(e),p=null==r||e>=r,g=i??(p?"good":"critical"),f=Zs[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__ */
|
|
874
874
|
return Ge("div",{className:o,children:[
|
|
875
875
|
/* @__PURE__ */Ge("div",{className:"mb-2 flex items-baseline justify-between gap-3",children:[
|
|
876
876
|
/* @__PURE__ */Ye("span",{className:"text-sm font-medium text-gray-700",children:n}),
|
|
877
877
|
/* @__PURE__ */Ye("span",{className:"text-sm font-semibold tabular-nums",style:{color:f},children:u(e)})]}),
|
|
878
878
|
/* @__PURE__ */Ge("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:[
|
|
879
|
-
/* @__PURE__ */Ye("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */Ye("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*Td(e.value)).toFixed(2)}%`,backgroundColor:
|
|
879
|
+
/* @__PURE__ */Ye("div",t?.length?{className:"flex h-full overflow-hidden rounded-full",children:t.map((e,r)=>/* @__PURE__ */Ye("div",{className:"h-full shrink-0"+(r===t.length-1?" rounded-r-full":""),style:{width:`${(100*Td(e.value)).toFixed(2)}%`,backgroundColor:Zs[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__ */Ye("span",{className:"absolute top-[-4px] w-0.5 rounded-full",style:{left:`${(100*Td(r)).toFixed(2)}%`,height:20,backgroundColor:Js.axis},"aria-hidden":"true"})]}),b&&/* @__PURE__ */Ye("p",{className:"mt-2 text-xs text-gray-500",children:b})]})}var Rd={up:{glyph:"▲",word:"trendUp"},down:{glyph:"▼",word:"trendDown"},flat:{glyph:"■",word:"trendFlat"}};function Wd({label:e,value:t,unit:r,delta:n,deltaTone:a,trend:l,trendTone:i,footnote:o,className:s}){const c=he().charts,d=ue(),u=null==n?null:n>0?"up":n<0?"down":"flat",h=a?Zs[a]:void 0,m=i?Zs[i]:ec(0);/* @__PURE__ */
|
|
880
880
|
return Ge("div",{className:`flex flex-col gap-0.5 rounded-lg border border-gray-200 bg-white p-4 ${s??""}`,children:[
|
|
881
881
|
/* @__PURE__ */Ye("span",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
|
|
882
882
|
/* @__PURE__ */Ge("span",{className:"flex items-baseline gap-2",children:[
|
|
@@ -898,48 +898,48 @@ return Ye(vc,{children:/* @__PURE__ */Ge("section",{className:`flex min-w-0 flex
|
|
|
898
898
|
/* @__PURE__ */Ge("div",{className:"min-w-0",children:[
|
|
899
899
|
/* @__PURE__ */Ye("h3",{className:"text-base font-semibold text-gray-900",children:e}),t&&/* @__PURE__ */Ye("p",{className:"mt-0.5 text-sm text-gray-500",children:t})]}),h&&/* @__PURE__ */Ye("div",{className:"shrink-0",children:h})]}),i?/* @__PURE__ */Ye(xc,{variant:o,height:s}):/* @__PURE__ */Ye("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:m}),!i&&r&&r.length>1&&/* @__PURE__ */Ye(qd,{entries:r,interactive:c,fallbackSwatch:d,onClick:u}),!i&&n&&/* @__PURE__ */Ge("details",{className:"border-t border-gray-100 pt-3",children:[
|
|
900
900
|
/* @__PURE__ */Ye("summary",{className:"cursor-pointer text-sm font-medium text-gray-600 rosh-focus-outline",children:a??g.showTable}),
|
|
901
|
-
/* @__PURE__ */Ye("div",{className:"mt-3 overflow-x-auto",style:{color:
|
|
902
|
-
return Ge("g",{children:[a&&/* @__PURE__ */Ye("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:o+i,fill:
|
|
903
|
-
/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?
|
|
901
|
+
/* @__PURE__ */Ye("div",{className:"mt-3 overflow-x-auto",style:{color:Js.label},children:n})]})]})})}function Hd({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__ */
|
|
902
|
+
return Ge("g",{children:[a&&/* @__PURE__ */Ye("circle",{className:"rosh-viz-ping",cx:e,cy:t,r:o,fill:r,fillOpacity:.45}),"border"===n&&/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:o+i,fill:Js.surface}),
|
|
903
|
+
/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:o,fill:"colored-border"===n?Js.surface:r,stroke:"colored-border"===n?r:void 0,strokeWidth:"colored-border"===n?i:void 0,children:l&&/* @__PURE__ */Ye("title",{children:l})})]})}function Ud({labels:e,data:t,range:r,onRangeChange:n,height:a=46,width:l=720,color:i,className:o}){const s=he().charts,c=Ee(null),d=e.length-1,[u,h]=r,m=i??ec(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)])},N=e=>t=>{const r=t.shiftKey?5:1,n="from"===e?u:h;"ArrowLeft"===t.key&&(t.preventDefault(),w(e,n-r)),"ArrowRight"===t.key&&(t.preventDefault(),w(e,n+r)),"Home"===t.key&&(t.preventDefault(),w(e,0)),"End"===t.key&&(t.preventDefault(),w(e,d))},k=Ee(null),$=e=>t=>{k.current=e,t.currentTarget.setPointerCapture(t.pointerId)},M=e=>t=>{k.current===e&&w(e,(e=>{const t=c.current?.getBoundingClientRect();if(!t||0===t.width)return u;const r=Math.max(0,Math.min(1,(e-t.left)/t.width));return Math.round(r*d)})(t.clientX))},C=e=>()=>{k.current===e&&(k.current=null)},L=t=>{const r="from"===t?u:h;/* @__PURE__ */
|
|
904
904
|
return Ye("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:N(t),onPointerDown:$(t),onPointerMove:M(t),onPointerUp:C(t),onPointerCancel:C(t)},t)};/* @__PURE__ */
|
|
905
905
|
return Ye("div",{className:o,children:/* @__PURE__ */Ge("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:[
|
|
906
|
-
/* @__PURE__ */Ye("path",{d:v,fill:
|
|
907
|
-
/* @__PURE__ */Ye("rect",{x:0,y:0,width:p(u),height:a,fill:
|
|
908
|
-
/* @__PURE__ */Ye("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:
|
|
909
|
-
/* @__PURE__ */Ye("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")]})})}var Vd=12,Yd=16,Gd=26,Xd=52,
|
|
910
|
-
return Ye("div",{className:D,ref:E,children:/* @__PURE__ */Ye(xc,{height:r,width:L??B})});const _=t,
|
|
911
|
-
return Ye("div",{className:D,ref:E,children:/* @__PURE__ */Ye("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const X=t.map((e,t)=>G.reduce((e,r)=>e+(
|
|
906
|
+
/* @__PURE__ */Ye("path",{d:v,fill:Js.grid}),
|
|
907
|
+
/* @__PURE__ */Ye("rect",{x:0,y:0,width:p(u),height:a,fill:Js.surface,fillOpacity:.72}),
|
|
908
|
+
/* @__PURE__ */Ye("rect",{x:p(h),y:0,width:Math.max(0,l-p(h)),height:a,fill:Js.surface,fillOpacity:.72}),
|
|
909
|
+
/* @__PURE__ */Ye("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")]})})}var Vd=12,Yd=16,Gd=26,Xd=52,Zd=e=>"number"==typeof e&&Number.isFinite(e);function Jd({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,formatTooltipValue:u,tooltipLabels:h,yAxisLabel:m,referenceLines:p,labelEndpoints:g=!1,dots:f,dotVariant:b="border",pulse:x=!1,brush:y=!1,range:v,onRangeChange:w,loading:N=!1,animate:k=!0,reveal:$="left-to-right",fillVariant:M="gradient",gridStyle:C="solid",width:L,className:D,emptyLabel:S}){const A=he().charts,P=ue(),j=d??(e=>fe(e,P)),z=u??j,F=S??A.noData,E=Ee(null),B=gc(E),I=L??B,[T,O]=Fe(null),[R,W]=Fe(null),{highlighted:K}=wc(),q=Be();if(Te(()=>{if(null!==T)return J(e=>"Escape"===e.key&&(O(null),!0))},[T]),N)/* @__PURE__ */
|
|
910
|
+
return Ye("div",{className:D,ref:E,children:/* @__PURE__ */Ye(xc,{height:r,width:L??B})});const _=t,H=v??R??[0,Math.max(0,_.length-1)],[U,V]=H,Y=e=>y?e.slice(U,V+1):e,G=e.map((e,t)=>({...e,slot:t})).filter(e=>e.data.some(Zd)).map(e=>({...e,data:Y(e.data)}));if(t=Y(_),0===G.length||0===t.length)/* @__PURE__ */
|
|
911
|
+
return Ye("div",{className:D,ref:E,children:/* @__PURE__ */Ye("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:F})});const X=t.map((e,t)=>G.reduce((e,r)=>e+(Zd(r.data[t])?r.data[t]:0),0)),Z=(e,t)=>X[t]>0?e/X[t]:null,Q=[];if(n){let e=t.map(()=>0);for(const t of G)e=e.map((e,r)=>e+(Zd(t.data[r])?t.data[r]:0)),Q.push("percent"===a?e.map((e,t)=>Z(e,t)):[...e])}const ee=!!l&&l.length>0,te=e=>"right"===e.axis,re=!n&&!ee&&void 0===s&&G.some(te)&&G.some(e=>!te(e)),ne=re?G.filter(e=>!te(e)):G,ae=re?G.filter(te).flatMap(e=>e.data.filter(Zd)):[],le=n?(Q.at(-1)??[]).filter(Zd):ne.flatMap(e=>e.data.filter(Zd)),ie=re?cc([Math.min(0,...le),Math.max(0,...le)],[Math.min(0,...ae),Math.max(0,...ae)],{intervals:c+1,integerLeft:le.every(Number.isInteger),integerRight:ae.every(Number.isInteger)}):null,oe=ie?ie.left:n&&"percent"===a||ee||void 0!==s?null:sc(n?0:Math.min(0,...le),Math.max(0,...le),{intervals:c+1,integer:le.every(Number.isInteger)}),se=oe?oe.lo:0,ce=n&&"percent"===a?1:oe?oe.hi:s??oc(Math.max(...le,0)),de=n&&"percent"===a?e=>xe(Math.round(100*e),0,P):j,me=ee?l:oe?oe.ticks:ac([se,ce],{from:0,to:1}).ticks(c+1),pe=pc(me.map(de),Xd),ge=ie?pc(ie.right.ticks.map(j),Yd):Yd,be={left:pe,right:Math.max(pe+1,I-ge),top:Vd,bottom:r-Gd},ye=lc(t.length,{from:be.left,to:be.right}),ve=ee?ic(l,{from:be.bottom,to:be.top}):null,we=ac([se,ce],{from:be.bottom,to:be.top}),Ne=we(Math.max(se,0)),ke=e=>ve?ve(e):we(e),$e=ie?ac([ie.right.lo,ie.right.hi],{from:be.bottom,to:be.top}):null,Me=e=>$e&&te(e)?$e:ke,Ce=ve?ve.levels.map(e=>({value:e,y:ve(e)})):me.map(e=>({value:e,y:we(e)})),Le=e=>r=>{r.preventDefault(),O(r=>{const n=(r??0)+e;return Math.min(t.length-1,Math.max(0,n))})},De=Math.max(1,Math.ceil(t.length/Math.max(1,Math.floor(I/96))));/* @__PURE__ */
|
|
912
912
|
return Ge("div",{className:`relative ${D??""}`,ref:E,children:[
|
|
913
913
|
/* @__PURE__ */Ge("svg",{width:"100%",height:r,viewBox:`0 0 ${I} ${r}`,role:"img","aria-label":A.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:()=>O(null),onBlur:()=>O(null),onKeyDown:e=>{"ArrowRight"===e.key&&Le(1)(e),"ArrowLeft"===e.key&&Le(-1)(e)},children:[
|
|
914
914
|
/* @__PURE__ */Ye("defs",{children:/* @__PURE__ */Ye("clipPath",{id:q,children:/* @__PURE__ */Ye("rect",{x:be.left,y:be.top,width:be.right-be.left,height:be.bottom-be.top})})}),
|
|
915
|
-
/* @__PURE__ */Ye(Si,{id:q,fills:G.map((e,t)=>({color:ec(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),Ce.map(e=>/* @__PURE__ */Ye("line",{x1:be.left,y1:e.y,x2:be.right,y2:e.y,stroke:
|
|
916
|
-
/* @__PURE__ */Ye("line",{x1:be.left,y1:Ne,x2:be.right,y2:Ne,stroke:
|
|
917
|
-
/* @__PURE__ */Ye("g",{clipPath:`url(#${q})`,mask:k&&$?`url(#${ki(q)})`:void 0,children:G.map((e,r)=>{const a=ec(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Nc(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:ye(r),end:ye.end(r),value:e.data[r]})).filter(e=>
|
|
918
|
-
return Ye("path",{d:Dc(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?Q[r]?.[a]:e.data[a];return
|
|
919
|
-
return Ye("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?Q[r]?.[s]:e.data[s];if(!
|
|
915
|
+
/* @__PURE__ */Ye(Si,{id:q,fills:G.map((e,t)=>({color:ec(e.slot,e.color,e.tone),variant:e.fillVariant??M})),fadeFrom:n?.42:.3,reveal:!!k&&$}),Ce.map(e=>/* @__PURE__ */Ye("line",{x1:be.left,y1:e.y,x2:be.right,y2:e.y,stroke:Js.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===C?"3 3":void 0},`grid-${e.value}`)),
|
|
916
|
+
/* @__PURE__ */Ye("line",{x1:be.left,y1:Ne,x2:be.right,y2:Ne,stroke:Js.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Ce.map(e=>/* @__PURE__ */Ye("text",{x:be.left-8,y:e.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:de(e.value)},`ytick-${e.value}`)),ie&&Ce.map((e,t)=>/* @__PURE__ */Ye("text",{x:be.right+8,y:e.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:j(ie.right.ticks[t])},`ytick-r-${e.value}`)),m&&/* @__PURE__ */Ye("text",{x:12,y:(be.top+be.bottom)/2,transform:`rotate(-90 12 ${(be.top+be.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:Js.label,children:m}),
|
|
917
|
+
/* @__PURE__ */Ye("g",{clipPath:`url(#${q})`,mask:k&&$?`url(#${ki(q)})`:void 0,children:G.map((e,r)=>{const a=ec(e.slot,e.color,e.tone),l=e.mode??(n?"area":"line"),s=Nc(e.key,K);if("step"===l){const r=t.map((t,r)=>({start:ye(r),end:ye.end(r),value:e.data[r]})).filter(e=>Zd(e.value)).map(t=>({start:t.start,end:t.end,y:Me(e)(t.value)}));/* @__PURE__ */
|
|
918
|
+
return Ye("path",{d:Dc(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?Q[r]?.[a]:e.data[a];return Zd(l)?[ye.center(a),Me(e)(l)]:null}).filter(e=>null!==e);if(0===c.length)return null;if("column"===l){const l=Math.max(1,.62*ye.bandwidth),i="solid"===e.fillVariant,o=Me(e);/* @__PURE__ */
|
|
919
|
+
return Ye("g",{opacity:s??void 0,className:"rosh-viz-mark",children:t.map((t,s)=>{const c=n?Q[r]?.[s]:e.data[s];if(!Zd(c))return null;const d=o(c);/* @__PURE__ */
|
|
920
920
|
return Ye("rect",{x:ye.center(s)-l/2,y:Math.min(d,Ne),width:l,height:Math.abs(Ne-d),rx:2,fill:a,fillOpacity:i?1:.35,className:k?Pi.rise:void 0,style:k?ji(s,26):void 0},s)})},e.key)}const d=jc(c,i,o),u=n&&r>0?t.map((e,t)=>[ye.center(t),ke(Q[r-1]?.[t]??0)-2]):null,h=u?Fc(d,u):zc(d,c,Ne);/* @__PURE__ */
|
|
921
921
|
return Ge("g",{opacity:s??void 0,className:"rosh-viz-mark",children:[("area"===l||n)&&
|
|
922
922
|
/* @__PURE__ */Ye("path",{d:h,fill:Mi(q,r,e.fillVariant??M,a),stroke:"none"}),
|
|
923
|
-
/* @__PURE__ */Ye("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Ci(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?Pi.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??
|
|
923
|
+
/* @__PURE__ */Ye("path",{d:d,fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:Ci(e.stroke??(e.forecast?"animated-dashed":"solid")),className:k&&("animated-dashed"===e.stroke||e.forecast&&!e.stroke)?Pi.march:void 0})]},e.key)})}),p?.map((e,t)=>{const r=e.color??Zs[e.tone??"critical"],n=ke(e.value);/* @__PURE__ */
|
|
924
924
|
return Ge("g",{children:[
|
|
925
|
-
/* @__PURE__ */Ye("line",{x1:be.left,y1:n,x2:be.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */Ye("text",{x:be.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(f??(g?"last":"none"))&&G.map((e,r)=>{if("column"===e.mode)return null;const a=f??(g?"last":"none"),l=ec(e.slot,e.color,e.tone),i=[...e.data].map(
|
|
926
|
-
return Ge("g",{children:[o.map(a=>{const o=n?Q[r]?.[a]:e.data[a];return
|
|
927
|
-
/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 z-10",style:fc(ye.center(T),ye.bandwidth,I),children:/* @__PURE__ */Ye($c,{title:h?.[T]??t[T],rows:G.map((e,t)=>({key:e.key,label:e.label,color:ec(e.slot,e.color,e.tone),value:
|
|
925
|
+
/* @__PURE__ */Ye("line",{x1:be.left,y1:n,x2:be.right,y2:n,stroke:r,strokeWidth:1,strokeDasharray:"5 4"}),e.label&&/* @__PURE__ */Ye("text",{x:be.right-4,y:n-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:r,children:e.label})]},`rule-${t}`)}),"none"!==(f??(g?"last":"none"))&&G.map((e,r)=>{if("column"===e.mode)return null;const a=f??(g?"last":"none"),l=ec(e.slot,e.color,e.tone),i=[...e.data].map(Zd).lastIndexOf(!0),o="all"===a?t.map((e,t)=>t).filter(t=>Zd(n?Q[r]?.[t]:e.data[t])):i>=0?[i]:[];/* @__PURE__ */
|
|
926
|
+
return Ge("g",{children:[o.map(a=>{const o=n?Q[r]?.[a]:e.data[a];return Zd(o)?/* @__PURE__ */Ye(Hd,{cx:ye.center(a),cy:Me(e)(o),color:l,variant:b,pulse:x&&a===i,title:`${t[a]}: ${e.label} ${j(o)}`},a):null}),g&&i>=0&&Zd(n?Q[r]?.[i]:e.data[i])&&/* @__PURE__ */Ye("text",{x:ye.center(i)-10,y:Me(e)(n?Q[r]?.[i]:e.data[i])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:j(n?Q[r]?.[i]:e.data[i])})]},`dots-${e.key}`)}),t.map((e,t)=>t%De===0?/* @__PURE__ */Ye("text",{x:ye.center(t),y:r-8,textAnchor:"middle",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:e},`xtick-${t}`):null),null!==T&&/* @__PURE__ */Ye("line",{x1:ye.center(T),y1:be.top,x2:ye.center(T),y2:be.bottom,stroke:Js.axis,strokeWidth:1}),t.map((e,t)=>/* @__PURE__ */Ye("rect",{x:ye(t),y:be.top,width:Math.max(1,ye.bandwidth),height:be.bottom-be.top,fill:"transparent",onMouseEnter:()=>O(t)},`hit-${t}`))]}),y&&_.length>2&&/* @__PURE__ */Ye(Ud,{className:"mt-1",labels:_,width:I,data:e[0]?.data??[],range:H,onRangeChange:e=>{w?w(e):W(e)}}),null!==T&&
|
|
927
|
+
/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 z-10",style:fc(ye.center(T),ye.bandwidth,I),children:/* @__PURE__ */Ye($c,{title:h?.[T]??t[T],rows:G.map((e,t)=>({key:e.key,label:e.label,color:ec(e.slot,e.color,e.tone),value:Zd(e.data[T])?n&&"percent"===a?`${xe(100*(Z(e.data[T],T)??0),1,P)} · ${z(e.data[T])}`:z(e.data[T]):void 0})),footnote:n&&"percent"===a?A.inBucket(z(X[T])):void 0})})]})}var Qd=3;function eu({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=he().charts,g=ue(),f=l??(e=>fe(e,g)),b=i??(e=>fe(e,g)),x=m??p.noObservations,y=Ee(null),v=gc(y),w=r??v,N=Be(),[k,$]=Fe(null);Te(()=>{if(null!==k)return J(e=>"Escape"===e.key&&($(null),!0))},[k]);const M=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),C=e.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),L=o||s?C.map(e=>({...e,points:e.points.filter(e=>M(e.x,o)&&M(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__ */
|
|
928
928
|
return Ye("div",{className:h,ref:y,children:/* @__PURE__ */Ye("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:t},children:x})});const S=L.flatMap(e=>e.points),A=S.some(e=>null!=e.size),P=14,j=20,z=34,F=52,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,oc(Math.max(...e))];return"log"===r?dc(i,n):ac(i,n)},B=E(S.map(e=>e.y),s,d,{from:t-z,to:P}),I=pc(B.ticks(5).map(b),F),T=Math.max(I+1,w-j),O=E(S.map(e=>e.x),o,c,{from:I,to:T}),R=hc([0,Math.max(...S.map(e=>e.size??1))],{from:u[0],to:u[1]}),W=k?L[k.s]:void 0,K=k&&W?W.points[k.i]:void 0,q=L.flatMap((e,t)=>e.points.map((e,r)=>({s:t,i:r})));/* @__PURE__ */
|
|
929
929
|
return Ge("div",{className:`relative ${h??""}`,ref:y,children:[
|
|
930
930
|
/* @__PURE__ */Ge("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:()=>$(null),onBlur:()=>$(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,r=k?q.findIndex(e=>e.s===k.s&&e.i===k.i):0;$(q[Math.min(q.length-1,Math.max(0,r+t))])},children:[
|
|
931
931
|
/* @__PURE__ */Ye("defs",{children:/* @__PURE__ */Ye("clipPath",{id:N,children:/* @__PURE__ */Ye("rect",{x:I-u[1],y:P-u[1],width:T-I+2*u[1],height:t-z-P+2*u[1]})})}),B.ticks(5).map(e=>/* @__PURE__ */Ge("g",{children:[
|
|
932
|
-
/* @__PURE__ */Ye("line",{x1:I,y1:B(e),x2:T,y2:B(e),stroke:
|
|
933
|
-
/* @__PURE__ */Ye("text",{x:I-8,y:B(e)+4,textAnchor:"end",fontSize:11,fill:
|
|
934
|
-
/* @__PURE__ */Ye("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=nc(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */Ye("circle",{cx:O(n.x),cy:B(n.y),r:A?R(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:
|
|
932
|
+
/* @__PURE__ */Ye("line",{x1:I,y1:B(e),x2:T,y2:B(e),stroke:Js.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
933
|
+
/* @__PURE__ */Ye("text",{x:I-8,y:B(e)+4,textAnchor:"end",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:b(e)})]},`y${e}`)),O.ticks(5).map(e=>/* @__PURE__ */Ye("text",{x:O(e),y:t-12,textAnchor:"middle",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:f(e)},`x${e}`)),n&&/* @__PURE__ */Ye("text",{x:(I+T)/2,y:t-.5,textAnchor:"middle",fontSize:11,fill:Js.label,children:n}),a&&/* @__PURE__ */Ye("text",{x:12,y:t/2,transform:`rotate(-90 12 ${t/2})`,textAnchor:"middle",fontSize:11,fill:Js.label,children:a}),
|
|
934
|
+
/* @__PURE__ */Ye("g",{clipPath:`url(#${N})`,children:L.map((e,t)=>{const r=nc(e.slot,3,e.color,e.tone);return e.points.map((n,a)=>/* @__PURE__ */Ye("circle",{cx:O(n.x),cy:B(n.y),r:A?R(n.size??0):u[0]+1,fill:r,fillOpacity:k&&k.s!==t?.25:.62,stroke:Js.surface,strokeWidth:2,onMouseEnter:()=>$({s:t,i:a})},`${e.key}-${a}`))})})]}),k&&W&&K&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:K.label??W.label,rows:[{key:"x",label:n??p.xAxis,color:nc(W.slot,3,W.color,W.tone),value:f(K.x)},{key:"y",label:a??p.yAxis,color:nc(W.slot,3,W.color,W.tone),value:b(K.y)},...null!=K.size?[{key:"size",label:p.size,color:Js.muted,value:fe(K.size,g)}]:[]],footnote:K.label?W.label:void 0})})]})}function tu({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=he().charts,b=ue(),x=s??(e=>fe(e,b)),y=h??f.range,v=e.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),w=ec(0,d,u);/* @__PURE__ */
|
|
935
935
|
return Ye(bc,{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__ */Ye($c,{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__ */Ye("g",{children:e.map((e,r)=>/* @__PURE__ */Ye("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__ */Ge("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__ */
|
|
936
936
|
return Ge(Xe,{children:[
|
|
937
937
|
/* @__PURE__ */Ye("path",{d:Fc(jc(r,n),l),fill:w,fillOpacity:.2,stroke:"none"}),
|
|
938
938
|
/* @__PURE__ */Ye("path",{d:jc(r,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round"}),
|
|
939
|
-
/* @__PURE__ */Ye("path",{d:jc(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */Ye("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:
|
|
940
|
-
return Ye(bc,{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?
|
|
941
|
-
return Ye($c,{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:
|
|
942
|
-
/* @__PURE__ */Ye("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:
|
|
939
|
+
/* @__PURE__ */Ye("path",{d:jc(l,n),fill:"none",stroke:w,strokeWidth:2,strokeLinejoin:"round",strokeOpacity:.7})]})})(),null!==l&&/* @__PURE__ */Ye("line",{x1:t.center(l),y1:a(e[l].high),x2:t.center(l),y2:a(e[l].low),stroke:Js.axis,strokeWidth:1})]})})}function ru({steps:e,height:t=240,width:r,formatValue:n,yAxisLabel:a,className:l,emptyLabel:i,radius:o=3,connectors:s=!0}){const c=he().charts,d=ue(),u=n??(e=>fe(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__ */
|
|
940
|
+
return Ye(bc,{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?Zs.neutral:t.value>=0?Zs.good:Zs.critical;/* @__PURE__ */
|
|
941
|
+
return Ye($c,{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:Zs.neutral,value:u(t.to)}]]})},children:({x:e,y:t,active:r})=>/* @__PURE__ */Ge("g",{children:[s&&m.slice(0,-1).map((r,n)=>
|
|
942
|
+
/* @__PURE__ */Ye("line",{x1:e.end(n),y1:t(r.to),x2:e(n+1),y2:t(r.to),stroke:Js.grid,strokeWidth:1,shapeRendering:"crispEdges"},`c${n}`)),m.map((n,a)=>{const l=n.total?Zs.neutral:n.value>=0?Zs.good:Zs.critical,i=Math.min(t(n.from),t(n.to)),s=Math.max(1,Math.abs(t(n.to)-t(n.from)));/* @__PURE__ */
|
|
943
943
|
return Ye("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 nu({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=he().charts,p=ue(),g=o??(e=>Number.isInteger(e)?fe(e,p):be(e,1,p)),f=s??(e=>fe(e,p)),b=c??m.countAxis,x=d??m.distribution,y=r??mc(e??[],t),v=ec(0,l,i),w=y.map(e=>g(e.from)),N=y.map(e=>e.count);/* @__PURE__ */
|
|
944
944
|
return Ye(bc,{labels:w,values:N,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__ */Ye($c,{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__ */Ye("g",{children:y.map((a,l)=>/* @__PURE__ */Ye("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 au({boxes:e,height:t=240,width:r,color:n,tone:a,formatValue:l,yAxisLabel:i,label:o,className:s,emptyLabel:c}){const d=he().charts,u=ue(),h=l??(e=>fe(e,u)),m=o??d.distribution,p=ec(0,n,a),g=e.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
945
945
|
return Ye(bc,{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__ */
|
|
@@ -950,23 +950,23 @@ return Ge("g",{opacity:null!==n&&n!==a?.45:1,children:[
|
|
|
950
950
|
/* @__PURE__ */Ye("line",{x1:l-i/4,y1:r(e.max),x2:l+i/4,y2:r(e.max),stroke:p,strokeWidth:1.5}),
|
|
951
951
|
/* @__PURE__ */Ye("line",{x1:l-i/4,y1:r(e.min),x2:l+i/4,y2:r(e.min),stroke:p,strokeWidth:1.5}),
|
|
952
952
|
/* @__PURE__ */Ye("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}),
|
|
953
|
-
/* @__PURE__ */Ye("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__ */Ye("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:
|
|
954
|
-
return Ye(bc,{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?
|
|
955
|
-
return Ye($c,{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__ */Ye("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?
|
|
953
|
+
/* @__PURE__ */Ye("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__ */Ye("circle",{cx:l,cy:r(e),r:3,fill:p,stroke:Js.surface,strokeWidth:1.5},t))]},a)})})})}function lu({candles:e,variant:t="candle",height:r=260,width:n,formatValue:a,yAxisLabel:l,label:i,className:o,emptyLabel:s}){const c=he().charts,d=ue(),u=a??(e=>Number.isInteger(e)?fe(e,d):be(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__ */
|
|
954
|
+
return Ye(bc,{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?Zs.good:Zs.critical;/* @__PURE__ */
|
|
955
|
+
return Ye($c,{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__ */Ye("g",{children:e.map((e,l)=>{const i=e.close>=e.open,o=i?Zs.good:Zs.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__ */
|
|
956
956
|
return Ge("g",{opacity:d?.45:1,children:[
|
|
957
957
|
/* @__PURE__ */Ye("line",{x1:s,y1:n(e.high),x2:s,y2:n(e.low),stroke:o,strokeWidth:1.5}),"candle"===t?/* @__PURE__ */Ye("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__ */Ge(Xe,{children:[
|
|
958
958
|
/* @__PURE__ */Ye("line",{x1:s-c/2,y1:n(e.open),x2:s,y2:n(e.open),stroke:o,strokeWidth:2}),
|
|
959
|
-
/* @__PURE__ */Ye("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function iu({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=he().charts,p=ue(),g=o??(e=>fe(e,p)),f=s??m.intensity,b=d??m.noActivity,x=Ee(null),y=gc(x),v=a??y,w=Be(),[N,k]=Fe(null);if(Te(()=>{if(null!==N)return
|
|
960
|
-
return Ye("div",{className:c,ref:x,children:/* @__PURE__ */Ye("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??ec(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,S=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${
|
|
959
|
+
/* @__PURE__ */Ye("line",{x1:s,y1:n(e.close),x2:s+c/2,y2:n(e.close),stroke:o,strokeWidth:2})]})]},l)})})})}function iu({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=he().charts,p=ue(),g=o??(e=>fe(e,p)),f=s??m.intensity,b=d??m.noActivity,x=Ee(null),y=gc(x),v=a??y,w=Be(),[N,k]=Fe(null);if(Te(()=>{if(null!==N)return J(e=>"Escape"===e.key&&(k(null),!0))},[N]),0===e.length||0===t.length)/* @__PURE__ */
|
|
960
|
+
return Ye("div",{className:c,ref:x,children:/* @__PURE__ */Ye("p",{className:"py-8 text-center text-sm text-gray-500",children:b})});const $=l??ec(0),M=i??Math.max(1,...r.flat().filter(Number.isFinite)),C=96,L=26*e.length,D=n??L+26+26,S=Math.max(2,(Math.max(97,v)-C)/t.length),A=e=>{const t=M>0?Math.max(0,Math.min(1,e/M)):0;return`color-mix(in oklab, ${$} ${(8+92*t).toFixed(1)}%, ${Js.surface})`};/* @__PURE__ */
|
|
961
961
|
return Ge("div",{className:`relative ${c??""}`,ref:x,children:[
|
|
962
962
|
/* @__PURE__ */Ge("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:()=>k(null),onBlur:()=>k(null),onKeyDown:r=>{const n="ArrowDown"===r.key?1:"ArrowUp"===r.key?-1:0,a="ArrowRight"===r.key?1:"ArrowLeft"===r.key?-1:0;0===n&&0===a||(r.preventDefault(),k(r=>({r:Math.min(e.length-1,Math.max(0,(r?.r??0)+n)),c:Math.min(t.length-1,Math.max(0,(r?.c??0)+a))})))},children:[
|
|
963
963
|
/* @__PURE__ */Ye("defs",{children:/* @__PURE__ */Ge("linearGradient",{id:w,x1:"0",x2:"1",children:[
|
|
964
964
|
/* @__PURE__ */Ye("stop",{offset:"0",stopColor:A(0)}),
|
|
965
|
-
/* @__PURE__ */Ye("stop",{offset:"1",stopColor:A(M)})]})}),e.map((e,t)=>/* @__PURE__ */Ye("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:
|
|
966
|
-
return Ye("rect",{x:C+a*S+u/2,y:26*n+u/2,width:Math.max(1,S-u),height:26-u,rx:h,fill:A(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */Ye("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__ */Ye("text",{x:C+r*S+S/2,y:L+15,textAnchor:"middle",fontSize:11,fill:
|
|
965
|
+
/* @__PURE__ */Ye("stop",{offset:"1",stopColor:A(M)})]})}),e.map((e,t)=>/* @__PURE__ */Ye("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:Js.label,children:e},`r${t}`)),e.map((e,n)=>t.map((t,a)=>{const l=r[n]?.[a]??0,i=N&&(N.r!==n||N.c!==a);/* @__PURE__ */
|
|
966
|
+
return Ye("rect",{x:C+a*S+u/2,y:26*n+u/2,width:Math.max(1,S-u),height:26-u,rx:h,fill:A(l),opacity:i?.55:1,onMouseEnter:()=>k({r:n,c:a}),children:/* @__PURE__ */Ye("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__ */Ye("text",{x:C+r*S+S/2,y:L+15,textAnchor:"middle",fontSize:11,fill:Js.label,children:e},`c${r}`):null),
|
|
967
967
|
/* @__PURE__ */Ye("rect",{x:C,y:L+26,width:Math.min(180,Math.max(40,v-C)),height:8,rx:4,fill:`url(#${w})`}),
|
|
968
|
-
/* @__PURE__ */Ye("text",{x:C,y:L+48,fontSize:11,fill:
|
|
969
|
-
/* @__PURE__ */Ye("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:11,fill:
|
|
968
|
+
/* @__PURE__ */Ye("text",{x:C,y:L+48,fontSize:11,fill:Js.label,children:"0"}),
|
|
969
|
+
/* @__PURE__ */Ye("text",{x:C+Math.min(180,Math.max(40,v-C)),y:L+48,textAnchor:"end",fontSize:11,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:g(M)})]}),N&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */Ye($c,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:f,color:$,value:null==r[N.r]?.[N.c]?void 0:g(r[N.r][N.c])}]})})]})}function ou({caption:e,head:t,rows:r}){/* @__PURE__ */
|
|
970
970
|
return Ge("table",{className:"sr-only",children:[
|
|
971
971
|
/* @__PURE__ */Ye("caption",{children:e}),
|
|
972
972
|
/* @__PURE__ */Ye("thead",{children:/* @__PURE__ */Ye("tr",{children:t.map(e=>/* @__PURE__ */Ye("th",{className:l,scope:"col",children:e},e))})}),
|
|
@@ -974,13 +974,13 @@ return Ge("table",{className:"sr-only",children:[
|
|
|
974
974
|
return Ye("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const y=r/2,v=r/2,w=r/2-46,N=uc(e.length),k=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))),$=(e,t)=>{const r=Math.max(0,Math.min(1,t/k[e])),n=N.center(e)-N.step/2;return[y+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==g?g!==e:null!==b&&b!==t,C=null!==g?x[g]:void 0;/* @__PURE__ */
|
|
975
975
|
return Ge("div",{className:`relative ${s??""}`,children:[
|
|
976
976
|
/* @__PURE__ */Ge("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
977
|
-
/* @__PURE__ */Ye("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__ */Ye("circle",{cx:y,cy:v,r:n,fill:"none",stroke:
|
|
977
|
+
/* @__PURE__ */Ye("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__ */Ye("circle",{cx:y,cy:v,r:n,fill:"none",stroke:Js.grid,strokeWidth:1},r):/* @__PURE__ */Ye("path",{d:cu(Ec(y,v,n,e.length)),fill:"none",stroke:Js.grid,strokeWidth:1},r)}),e.map((e,t)=>{const[r,n]=$(t,k[t]);/* @__PURE__ */
|
|
978
978
|
return Ge("g",{children:[
|
|
979
|
-
/* @__PURE__ */Ye("line",{x1:y,y1:v,x2:r,y2:n,stroke:
|
|
980
|
-
/* @__PURE__ */Ye("text",{x:y+(w+18)*Math.cos(N.center(t)-N.step/2),y:v+(w+18)*Math.sin(N.center(t)-N.step/2)+4,textAnchor:"middle",fontSize:11,fill:
|
|
979
|
+
/* @__PURE__ */Ye("line",{x1:y,y1:v,x2:r,y2:n,stroke:Js.grid,strokeWidth:1}),
|
|
980
|
+
/* @__PURE__ */Ye("text",{x:y+(w+18)*Math.cos(N.center(t)-N.step/2),y:v+(w+18)*Math.sin(N.center(t)-N.step/2)+4,textAnchor:"middle",fontSize:11,fill:Js.label,children:e.label})]},e.key)}),
|
|
981
981
|
/* @__PURE__ */Ye(Si,{id:p,reveal:!!o&&"center-out"}),x.map((t,r)=>{const a=nc(r,3,t.color,t.tone),l=e.map((e,r)=>$(r,t.values[r]??0));/* @__PURE__ */
|
|
982
982
|
return Ge("g",{opacity:M(r,t.key)?.3:1,onMouseEnter:()=>f(r),mask:o?`url(#${ki(p)})`:void 0,children:["area"===n&&/* @__PURE__ */Ye("path",{d:cu(l),fill:a,fillOpacity:.18,stroke:"none"}),
|
|
983
|
-
/* @__PURE__ */Ye("path",{d:cu(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:
|
|
983
|
+
/* @__PURE__ */Ye("path",{d:cu(l),fill:"none",stroke:a,strokeWidth:2,strokeLinejoin:"round"}),l.map(([e,t],r)=>/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:3.5,fill:a,stroke:Js.surface,strokeWidth:1.5},r))]},t.key)})]}),C&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:C.label,rows:e.map((e,t)=>({key:e.key,label:e.label,color:nc(g,3,C.color,C.tone),value:h(C.values[t]??0)}))})}),
|
|
984
984
|
/* @__PURE__ */Ye("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__ */Ge("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
985
985
|
/* @__PURE__ */Ye("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:nc(t,3,e.color,e.tone)}}),
|
|
986
986
|
/* @__PURE__ */Ye("span",{className:"flex-1 truncate",children:e.label})]},e.key))}),
|
|
@@ -989,34 +989,34 @@ return Ge("div",{className:`relative ${i??""}`,children:[
|
|
|
989
989
|
/* @__PURE__ */Ge("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-labelledby":m,onMouseLeave:()=>g(null),children:[
|
|
990
990
|
/* @__PURE__ */Ye("title",{id:m,children:"track"===t?c.radialTrack(k.length):c.radialCycle(k.length)}),k.map((e,n)=>{const a=ec(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+$,s=-Math.PI/2;/* @__PURE__ */
|
|
991
991
|
return Ge("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),className:l?Pi.sweep:void 0,style:l?ji(n,70):void 0,children:[
|
|
992
|
-
/* @__PURE__ */Ye("path",{d:Bc(b,x,r,t,s,s+uu),fill:
|
|
992
|
+
/* @__PURE__ */Ye("path",{d:Bc(b,x,r,t,s,s+uu),fill:Js.grid}),
|
|
993
993
|
/* @__PURE__ */Ye("path",{d:Bc(b,x,r,t,s,s+uu*i),fill:a})]},e.key)}const s=.14*r;/* @__PURE__ */
|
|
994
994
|
return Ye("g",{opacity:o?.4:1,onMouseEnter:()=>g(n),children:/* @__PURE__ */Ye("path",{d:Bc(b,x,s,s+(y-s)*i,M(n),M(n)+M.step),fill:a})},e.key)})]}),C&&null!==p&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:C.label,rows:[{key:"value",label:c.value,color:ec(p,C.color,C.tone),value:u(C.value)}]})}),
|
|
995
995
|
/* @__PURE__ */Ye("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__ */Ge("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
996
996
|
/* @__PURE__ */Ye("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:ec(t,e.color,e.tone)}}),
|
|
997
997
|
/* @__PURE__ */Ye("span",{className:"flex-1 truncate",children:e.label}),
|
|
998
|
-
/* @__PURE__ */Ye("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function mu({stages:e,shape:t="funnel",height:r,width:n,gap:a=4,minBandWidth:l=0,formatValue:i,color:o,className:s,emptyLabel:c}){const d=he().charts,u=ue(),h=i??(e=>fe(e,u)),m=c??d.noStages,p=Be(),[g,f]=Fe(null),{highlighted:b}=wc(),x=Ee(null),y=gc(x,560),v=n??y;if(0===e.length)/* @__PURE__ */return Ye("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const w=o??ec(0),N=r??54*e.length,k=Math.max(...e.map(e=>e.value),1),$="bars"===t,M=$?Math.round(Math.min(132,Math.max(80,.24*v))):Math.round(Math.min(168,Math.max(104,.38*v))),C=t=>{const r=e[t-1]?.value;return null!=r&&r>0?100*(1-e[t].value/r):null},L=t=>{const r=C(t);return{count:h(e[t].value),drop:null!=r?`−${xe(r,1,u)}`:""}},D=$?Math.ceil(Math.max(...e.map((e,t)=>{const{count:r,drop:n}=L(t);return.62*(r.length+(n?n.length+1:0))*12}))+16):0,S=v-M-D,A=Math.max($?2:0,Math.min(l,S)),P=e=>Math.max(A,S*Math.max(0,e/k)),j=e=>P(e)/2,z=M+S/2,F=t=>46+t/Math.max(1,e.length-1)*54,E=e=>`color-mix(in oklab, ${w} ${F(e).toFixed(0)}%, ${
|
|
998
|
+
/* @__PURE__ */Ye("span",{className:"tabular-nums text-gray-800",children:u(e.value)})]},e.key))})]})}function mu({stages:e,shape:t="funnel",height:r,width:n,gap:a=4,minBandWidth:l=0,formatValue:i,color:o,className:s,emptyLabel:c}){const d=he().charts,u=ue(),h=i??(e=>fe(e,u)),m=c??d.noStages,p=Be(),[g,f]=Fe(null),{highlighted:b}=wc(),x=Ee(null),y=gc(x,560),v=n??y;if(0===e.length)/* @__PURE__ */return Ye("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const w=o??ec(0),N=r??54*e.length,k=Math.max(...e.map(e=>e.value),1),$="bars"===t,M=$?Math.round(Math.min(132,Math.max(80,.24*v))):Math.round(Math.min(168,Math.max(104,.38*v))),C=t=>{const r=e[t-1]?.value;return null!=r&&r>0?100*(1-e[t].value/r):null},L=t=>{const r=C(t);return{count:h(e[t].value),drop:null!=r?`−${xe(r,1,u)}`:""}},D=$?Math.ceil(Math.max(...e.map((e,t)=>{const{count:r,drop:n}=L(t);return.62*(r.length+(n?n.length+1:0))*12}))+16):0,S=v-M-D,A=Math.max($?2:0,Math.min(l,S)),P=e=>Math.max(A,S*Math.max(0,e/k)),j=e=>P(e)/2,z=M+S/2,F=t=>46+t/Math.max(1,e.length-1)*54,E=e=>`color-mix(in oklab, ${w} ${F(e).toFixed(0)}%, ${Js.surface})`,B=e=>F(e)>=55?Js.surface:Js.label,I=(e,t)=>null!==g?g!==e:null!==b&&b!==t,T=null!==g?e[g]:void 0;/* @__PURE__ */
|
|
999
999
|
return Ge("div",{className:`relative ${s??""}`,ref:x,children:[
|
|
1000
1000
|
/* @__PURE__ */Ge("svg",{width:"100%",height:N,viewBox:`0 0 ${v} ${N}`,role:"img","aria-labelledby":p,onMouseLeave:()=>f(null),children:[
|
|
1001
1001
|
/* @__PURE__ */Ye("title",{id:p,children:d.funnel(e.length,h(e[0].value),h(e[e.length-1].value))}),e.map((r,n)=>{const l=n*N/e.length+a/2,i=(n+1)*N/e.length-a/2,o=(l+i)/2,s=xe(r.value/(e[0].value||1)*100,0,u),c=.62*s.length*12+12;if($){const e=M,t=e+P(r.value),{count:a,drop:d}=L(n);/* @__PURE__ */
|
|
1002
1002
|
return Ge("g",{opacity:I(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
|
|
1003
1003
|
/* @__PURE__ */Ye("path",{d:`M${e},${l} L${t},${l} L${t},${i} L${e},${i} Z`,fill:E(n)}),
|
|
1004
|
-
/* @__PURE__ */Ye("text",{x:M-12,y:o+4,textAnchor:"end",fontSize:12,fill:
|
|
1005
|
-
/* @__PURE__ */Ge("text",{"data-funnel-value":"true",x:t+8,y:o+4,textAnchor:"start",fontSize:12,fill:
|
|
1006
|
-
/* @__PURE__ */Ye("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */Ye("tspan",{fill:
|
|
1004
|
+
/* @__PURE__ */Ye("text",{x:M-12,y:o+4,textAnchor:"end",fontSize:12,fill:Js.label,children:r.label}),t-e>=c&&/* @__PURE__ */Ye("text",{x:e+8,y:o+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:B(n),style:{fontVariantNumeric:"tabular-nums"},children:s}),
|
|
1005
|
+
/* @__PURE__ */Ge("text",{"data-funnel-value":"true",x:t+8,y:o+4,textAnchor:"start",fontSize:12,fill:Js.label,style:{fontVariantNumeric:"tabular-nums"},children:[
|
|
1006
|
+
/* @__PURE__ */Ye("tspan",{fontWeight:600,children:a}),d&&/* @__PURE__ */Ye("tspan",{fill:Js.muted,children:` ${d}`})]})]},r.key)}const d=j(r.value),m="cone"===t?j(e[n+1]?.value??r.value):d,p=C(n),g=2*Math.min(d,m)>=c;/* @__PURE__ */
|
|
1007
1007
|
return Ge("g",{opacity:I(n,r.key)?.45:1,onMouseEnter:()=>f(n),children:[
|
|
1008
1008
|
/* @__PURE__ */Ye("path",{d:`M${z-d},${l} L${z+d},${l} L${z+m},${i} L${z-m},${i} Z`,fill:E(n)}),
|
|
1009
|
-
/* @__PURE__ */Ye("text",{x:M-14,y:o-2,textAnchor:"end",fontSize:12,fill:
|
|
1010
|
-
/* @__PURE__ */Ge("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:
|
|
1011
|
-
/* @__PURE__ */Ye("text",{x:g?z:z+Math.max(d,m)+6,y:o+4,textAnchor:g?"middle":"start",fontSize:12,fontWeight:600,fill:g?B(n):
|
|
1012
|
-
return Ye("div",{className:o,ref:m,children:/* @__PURE__ */Ye("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??ec(0),w=Math.max(...y.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${
|
|
1009
|
+
/* @__PURE__ */Ye("text",{x:M-14,y:o-2,textAnchor:"end",fontSize:12,fill:Js.label,children:r.label}),
|
|
1010
|
+
/* @__PURE__ */Ge("text",{x:M-14,y:o+14,textAnchor:"end",fontSize:11,fill:Js.muted,style:{fontVariantNumeric:"tabular-nums"},children:[h(r.value),null!=p?` · −${xe(p,1,u)}`:""]}),
|
|
1011
|
+
/* @__PURE__ */Ye("text",{x:g?z:z+Math.max(d,m)+6,y:o+4,textAnchor:g?"middle":"start",fontSize:12,fontWeight:600,fill:g?B(n):Js.label,style:{fontVariantNumeric:"tabular-nums"},children:s})]},r.key)})]}),T&&null!==g&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:T.label,rows:[{key:"value",label:d.count,color:E(g),value:h(T.value)},{key:"share",label:d.ofFirstStage,color:Js.muted,value:xe(T.value/(e[0].value||1)*100,0,u)},...g>0&&e[g-1].value>0?[{key:"drop",label:d.droppedHere,color:Zs.critical,value:`−${xe(100*(1-T.value/e[g-1].value),1,u)}`}]:[]]})})]})}function pu({items:e,height:t=320,width:r,gap:n=2,radius:a=3,formatValue:l,color:i,className:o,emptyLabel:s}){const c=he().charts,d=ue(),u=l??(e=>fe(e,d)),h=s??c.nothingToBreakDown,m=Ee(null),p=gc(m),g=r??p,[f,b]=Fe(null),{highlighted:x}=wc(),y=Bd(e,g,t);if(0===y.length)/* @__PURE__ */
|
|
1012
|
+
return Ye("div",{className:o,ref:m,children:/* @__PURE__ */Ye("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const v=i??ec(0),w=Math.max(...y.map(e=>e.value),1),N=e=>34+e/w*62,k=e=>`color-mix(in oklab, ${v} ${N(e).toFixed(0)}%, ${Js.surface})`,$=e=>N(e)>=55?Js.surface:Js.label,M=f??x,C=f?y.find(e=>e.key===f):void 0;/* @__PURE__ */
|
|
1013
1013
|
return Ge("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
1014
1014
|
/* @__PURE__ */Ye("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__ */
|
|
1015
1015
|
return Ge("g",{opacity:M&&M!==e.key?.55:1,onMouseEnter:()=>b(e.key),children:[
|
|
1016
1016
|
/* @__PURE__ */Ye("rect",{x:e.x+n/2,y:e.y+n/2,width:t,height:r,rx:a,fill:k(e.value)}),l&&/* @__PURE__ */Ye("text",{x:e.x+n/2+8,y:e.y+n/2+18,fontSize:12,fontWeight:600,fill:$(e.value),children:e.label}),i&&/* @__PURE__ */Ye("text",{x:e.x+n/2+8,y:e.y+n/2+34,fontSize:11,fill:$(e.value),fillOpacity:.85,style:{fontVariantNumeric:"tabular-nums"},children:u(e.value)})]},e.key)})}),C&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:C.label,rows:[{key:"value",label:c.value,color:k(C.value),value:u(C.value)}]})}),
|
|
1017
|
-
/* @__PURE__ */Ye(ou,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function gu(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+fu(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=fu(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&&gu(e.children,c,u,n+1,m,p,h,o),c+=u})}function fu(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+fu(r,t-1),0):Math.max(0,e.value??0)}function bu({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=he().charts,c=ue(),d=a??(e=>fe(e,c)),u=o??s.nothingToBreakDown,[h,m]=Fe(null),{highlighted:p}=wc(),g=[];if(gu(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return Ye("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, ${ec(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${
|
|
1017
|
+
/* @__PURE__ */Ye(ou,{caption:c.treemap(e.length),head:[c.tableItem,c.value],rows:y.map(e=>[e.label,u(e.value)])})]})}function gu(e,t,r,n,a,l,i,o){if(n>=8)return;const s=e.reduce((e,t)=>e+fu(t,8-n),0);if(s<=0)return;let c=t;e.forEach((e,t)=>{const d=fu(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&&gu(e.children,c,u,n+1,m,p,h,o),c+=u})}function fu(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+fu(r,t-1),0):Math.max(0,e.value??0)}function bu({nodes:e,size:t=320,innerRadius:r=44,ringGap:n=2,formatValue:a,centerLabel:l,className:i,emptyLabel:o}){const s=he().charts,c=ue(),d=a??(e=>fe(e,c)),u=o??s.nothingToBreakDown,[h,m]=Fe(null),{highlighted:p}=wc(),g=[];if(gu(e,-Math.PI/2,2*Math.PI,0,0,"","",g),0===g.length)/* @__PURE__ */return Ye("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, ${ec(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${Js.surface})`,N=e=>null!==h?e.id===h:null===p||e.branchKey===p,k=h?g.find(e=>e.id===h):void 0,$=e=>xe(e.value/v*100,1,c);/* @__PURE__ */
|
|
1018
1018
|
return Ge("div",{className:`relative ${i??""}`,children:[
|
|
1019
|
-
/* @__PURE__ */Ge("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__ */Ye("path",{d:Bc(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:
|
|
1019
|
+
/* @__PURE__ */Ge("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__ */Ye("path",{d:Bc(b,x,r+e.depth*y+n/2,r+(e.depth+1)*y-n/2,e.start,e.end),fill:w(e),fillOpacity:N(e)?1:.45,stroke:Js.surface,strokeWidth:1,onMouseEnter:()=>m(e.id)},e.id)),l&&/* @__PURE__ */Ye("text",{x:b,y:x+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:Js.label,children:l})]}),k&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:k.label,rows:[{key:"value",label:s.value,color:w(k),value:d(k.value)},{key:"share",label:s.share,color:Js.muted,value:$(k)}]})}),
|
|
1020
1020
|
/* @__PURE__ */Ye(ou,{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),$(e)])})]})}function xu({nodes:e,links:t,height:r=320,width:n,nodeWidth:a=14,nodePadding:l=12,formatValue:i,className:o,emptyLabel:s}){const c=he().charts,d=ue(),u=i??(e=>fe(e,d)),h=s??c.noFlows,m=Ee(null),p=gc(m),g=n??p,[f,b]=Fe(null),{highlighted:x}=wc();if(0===e.length||0===t.length)/* @__PURE__ */
|
|
1021
1021
|
return Ye("div",{className:o,ref:m,children:/* @__PURE__ */Ye("p",{className:"py-8 text-center text-sm text-gray-500",children:h})});const y=[...new Set(e.map(e=>e.depth))].sort((e,t)=>e-t),v=e=>y.length<=1?0:y.indexOf(e)/(y.length-1)*(g-a-140)+70,w=new Map(e.map(e=>{const r=t.filter(t=>t.from===e.key).reduce((e,t)=>e+t.value,0),n=t.filter(t=>t.to===e.key).reduce((e,t)=>e+t.value,0);return[e.key,Math.max(r,n,e.value??0)]})),N=/* @__PURE__ */new Map;for(const t of e)N.set(t.depth,[...N.get(t.depth)??[],t]);const k=Math.max(...[...N.values()].map(e=>e.reduce((e,t)=>e+(w.get(t.key)??0),0))),$=r-20,M=k>0?($-l*(Math.max(...[...N.values()].map(e=>e.length))-1))/k:0,C=/* @__PURE__ */new Map;for(const[e,t]of N){const r=t.map(e=>Math.max(2,(w.get(e.key)??0)*M)),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>$&&a>0?Math.max(0,1-(n-$)/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,S=/* @__PURE__ */new Map,A=(e,t)=>e.from===t||e.to===t,P="link"===f?.kind?t[f.index]:void 0,j="node"===f?.kind?e.find(e=>e.key===f.key):void 0;/* @__PURE__ */
|
|
1022
1022
|
return Ge("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
@@ -1024,12 +1024,12 @@ return Ge("div",{className:`relative ${o??""}`,ref:m,children:[
|
|
|
1024
1024
|
return Ye("path",{d:Pc([[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__ */
|
|
1025
1025
|
return Ge("g",{opacity:null===l||l?1:.45,onMouseEnter:()=>b({kind:"node",key:e.key}),children:[
|
|
1026
1026
|
/* @__PURE__ */Ye("rect",{x:r.x,y:r.y,width:a,height:r.h,rx:2,fill:ec(r.index,e.color,e.tone)}),
|
|
1027
|
-
/* @__PURE__ */Ye("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:
|
|
1028
|
-
/* @__PURE__ */Ye(ou,{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 yu({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=he().charts,d=ue(),u=i??(e=>fe(e,d)),h=s??c.noFlows,[m,p]=Fe(null),{highlighted:g}=wc(),f=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:x,otherIndex:y,foldedCount:v}=f,w=(e,t)=>x[e]?.[t]??0,N=e=>e===y?
|
|
1027
|
+
/* @__PURE__ */Ye("text",{x:n?r.x-8:r.x+a+8,y:r.y+r.h/2+4,textAnchor:n?"end":"start",fontSize:11,fill:Js.label,children:e.label})]},e.key)})]}),P&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:`${P.from} → ${P.to}`,rows:[{key:"value",label:c.flow,color:ec(C.get(P.from)?.index??0,P.color),value:u(P.value)}]})}),j&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:j.label,rows:[{key:"value",label:c.throughput,color:ec(C.get(j.key)?.index??0,j.color,j.tone),value:u(w.get(j.key)??0)}]})}),
|
|
1028
|
+
/* @__PURE__ */Ye(ou,{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 yu({labels:e,matrix:t,size:r=340,maxNodes:n=8,padAngle:a=.04,arcWidth:l=12,formatValue:i,className:o,emptyLabel:s}){const c=he().charts,d=ue(),u=i??(e=>fe(e,d)),h=s??c.noFlows,[m,p]=Fe(null),{highlighted:g}=wc(),f=function(e,t,r,n){const a=(e,r)=>{const n=t[e]?.[r];return"number"==typeof n&&Number.isFinite(n)?n:0},l=e.map((t,r)=>e.reduce((e,t,n)=>e+a(r,n)+a(n,r),0)),i=Math.max(2,r),o=e.length>i,s=o?e.map((e,t)=>t).sort((e,t)=>l[t]-l[e]).slice(0,i-1).sort((e,t)=>e-t):e.map((e,t)=>t),c=new Map(s.map((e,t)=>[e,t])),d=o?s.length:-1,u=o?[...s.map(t=>e[t]),n]:[...e],h=u.map(()=>u.map(()=>0));let m=0;e.forEach((t,r)=>e.forEach((e,t)=>{const n=c.get(r)??d,l=c.get(t)??d;n!==d||l!==d?h[n][l]+=a(r,t):m+=a(r,t)}));const p=u.map((e,t)=>u.reduce((e,r,n)=>e+h[t][n]+h[n][t],0));return d>=0&&(p[d]+=m),{labels:u,matrix:h,totals:p,otherIndex:d,foldedCount:o?e.length-s.length:0}}(e,t,n,c.other),{labels:b,matrix:x,otherIndex:y,foldedCount:v}=f,w=(e,t)=>x[e]?.[t]??0,N=e=>e===y?Js.muted:ec(e),k=f.totals,$=b.map((e,t)=>t).sort((e,t)=>k[t]-k[e]),M=$.reduce((e,t)=>e+k[t],0);if(M<=0)/* @__PURE__ */return Ye("p",{className:`text-sm text-gray-500 ${o??""}`,children:h});const C=r/2,L=r/2,D=r/2-44,S=D-l,A=a*$.length,P=/* @__PURE__ */new Map;let j=-Math.PI/2;$.forEach((e,t)=>{const r=k[e]/M*(2*Math.PI-A);P.set(e,{start:j,end:j+r,slot:t}),j+=r+a});const z=/* @__PURE__ */new Map,F=[];for(const e of $)for(const t of $){const r=w(e,t);if(r<=0)continue;const n=P.get(e),a=r/Math.max(1,k[e])*(n.end-n.start),l=z.get(e)??0;z.set(e,l+a),F.push({from:e,to:t,value:r,a:n.start+l+a/2,b:P.get(t).start+(P.get(t).end-P.get(t).start)/2})}const E=(e,t)=>[C+t*Math.cos(e),L+t*Math.sin(e)],B="arc"===m?.kind?m.index:void 0,I="ribbon"===m?.kind?F[m.index]:void 0;/* @__PURE__ */
|
|
1029
1029
|
return Ge("div",{className:`relative ${o??""}`,children:[
|
|
1030
1030
|
/* @__PURE__ */Ge("svg",{width:"100%",height:r,viewBox:`0 0 ${r} ${r}`,role:"img","aria-label":c.chord($.length),onMouseLeave:()=>p(null),children:[F.map((e,t)=>{const[n,a]=E(e.a,S),[l,i]=E(e.b,S),o=N(e.from),s=((e,t)=>m?"ribbon"===m.kind?m.index===t:m.index===e.from||m.index===e.to:null!==g?b[e.from]===g||b[e.to]===g:null)(e,t);/* @__PURE__ */
|
|
1031
1031
|
return Ye("path",{d:`M${n},${a} Q${C},${L} ${l},${i}`,fill:"none",stroke:o,strokeWidth:Math.max(1,e.value/M*r*.9),strokeOpacity:null===s||s?.34:.07,strokeLinecap:"round",onMouseEnter:()=>p({kind:"ribbon",index:t})},`${b[e.from]}→${b[e.to]}`)}),$.map(e=>{const t=P.get(e),r=(t.start+t.end)/2,[n,a]=E(r,D+16),l=(e=>m?"arc"===m.kind?m.index===e:F[m.index].from===e||F[m.index].to===e:null!==g?b[e]===g:null)(e);/* @__PURE__ */
|
|
1032
1032
|
return Ge("g",{onMouseEnter:()=>p({kind:"arc",index:e}),children:[
|
|
1033
1033
|
/* @__PURE__ */Ye("path",{d:Bc(C,L,S,D,t.start,t.end),fill:N(e),fillOpacity:null===l||l?1:.45}),
|
|
1034
|
-
/* @__PURE__ */Ye("text",{x:n,y:a+4,fontSize:11,fill:
|
|
1035
|
-
/* @__PURE__ */Ye(ou,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Ls as APP_UPDATE_POLL_MS,Ql as Accordion,za as AlignmentGrid,Ss as AppUpdateBanner,Oa as AttachButton,Ia as AttachmentDropZone,Ta as AttachmentList,od as AuthScreen,Rl as Avatar,Wl as AvatarGroup,yl as BORDER_WIDTHS,
|
|
1034
|
+
/* @__PURE__ */Ye("text",{x:n,y:a+4,fontSize:11,fill:Js.label,textAnchor:Math.cos(r)>.15?"start":Math.cos(r)<-.15?"end":"middle",children:b[e]})]},e)})]}),v>0&&/* @__PURE__ */Ye("p",{className:"mt-1 text-xs text-gray-500",children:c.chordFolded(v)}),void 0!==B&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:b[B],rows:[{key:"total",label:c.totalFlow,color:N(B),value:u(k[B])}]})}),I&&/* @__PURE__ */Ye("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */Ye($c,{title:`${b[I.from]} → ${b[I.to]}`,rows:[{key:"value",label:c.flow,color:N(I.from),value:u(I.value)}]})}),
|
|
1035
|
+
/* @__PURE__ */Ye(ou,{caption:c.chord($.length),head:[c.tableFrom,c.tableTo,c.value],rows:F.map(e=>[b[e.from],b[e.to],u(e.value)])})]})}export{Ls as APP_UPDATE_POLL_MS,Ql as Accordion,za as AlignmentGrid,Ss as AppUpdateBanner,Oa as AttachButton,Ia as AttachmentDropZone,Ta as AttachmentList,od as AuthScreen,Rl as Avatar,Wl as AvatarGroup,yl as BORDER_WIDTHS,Hl as Banner,au as BoxPlotChart,Qt as BrandAssetEditor,bi as BudgetBar,Js as CHART_INK,Cn as COLUMN_COUNT_MAX,Dn as COLUMN_COUNT_WIDTHS,Sn as COLUMN_SHARES_EQUAL,Ln as COLUMN_SHARE_MIN,ml as CONTROL_HEIGHTS,wd as CORNERS,gr as Calendar,lu as CandlestickChart,Ha as Card,bc as CartesianPlot,Ud as ChartBrush,Si as ChartDefs,Hd as ChartDot,_d as ChartFrame,vc as ChartHighlightProvider,xc as ChartSkeleton,$c as ChartTooltip,rd as ChatTemplate,ft as Checkbox_default,Xc as CheckoutTemplate,yu as ChordChart,sa as ColorPicker,la as ColorPickerPanel,ta as ColorSwatch,ti as ColoredBadge,Mc as ColumnChart,Ra as ComposerAttachments,Do as ContainerFillChart,ts as ContextMenu,Pa as CornersInput,zl as CountBadge,xi as DAY_MS,qc as DashboardTemplate,Hs as DataTable,Uc as DataTablePage,Br as DatePicker_default,Mr as DateRangePicker,Rr as DateTimePicker_default,Sl as DescriptionList,Mn as DisplayChips,dl as Divider,zs as Drawer,Zo as DropdownMenu,wl as ELEVATION_LEVELS,Qc as EmailTemplate,ri as EmptyState,Ad as EmptyValue,ud as ErrorBoundary,cd as ErrorPage,bl as FONT_WEIGHTS,Fa as FilePicker_default,Qo as FloatingBar,Nt as FormErrorSummary,yt as FormField,Yc as FormLayoutPage,mu as FunnelChart,Lt as GROUP_COLORS,Dt as GROUP_COLORS_SOLID,ld as GalleryTemplate,sl as Grid,iu as HeatmapChart,Ro as HelpCenter,oa as HexInput,nu as HistogramChart,Ms as IconRail,Cs as IconRailButton,ua as ImageFocusPoint,al as Inline,fn as InputNumber_default,Je as Input_default,Fs as Kanban,Mt as Label,Sd as LanguagePanel,Dd as LanguageSelect,xa as LinkPicker,Us as ListFooter,Vs as ListLoadError,ws as ListRow,Gr as MAX_FRACTION_DIGITS,Pi as MOTION,xl as MOTION_DURATIONS,To as Markdown,Jt as MediaUploadField,ir as MediaUploadGrid,Od as Meter,mi as MetricBar,yo as MilestoneTimeline,ut as NativeSelect,Qr as NumericKeypad,vo as POST_PRODUCTION_STATUSES,ni as PageHeader,Bs as Pagination,Ea as PaperclipGlyph,Qa as Paragraph,Ic as PieChart,qn as Popover,nr as PortalBrandingProvider,Co as ProductionTimeline,su as RADAR_SERIES_CAP,vl as RADIUS_ROLES,pl as ROW_HEIGHTS,du as RadarChart,hu as RadialBarChart,wt as RadioGroup,xt as Radio_default,tu as RangeChart,Id as RankedBars,Qd as SCATTER_SERIES_CAP,Gs as SERIES_SLOT_COUNT,Xs as SERIES_VARS,hl as SPACING_ROLES,ul as SPACING_SCALE,wo as STAGES,Zs as STATUS_VARS,xu as SankeyChart,eu as ScatterChart,ma as SearchableSelect,sn as Segmented,pt as Select_default,Pl as SettingRow,Ko as SidebarActionButton,_o as SidebarGroupLabel,Vo as SidebarNavGroup,Uo as SidebarNavItem,$l as Skeleton,$n as Slider,kn as SliderGroup,Yr as Snippet,vs as SortableList,Ys as Sparkline,Ht as Spinner,nl as Stack,Ua as StatCard,Wd as StatTile,Bl as Statistic,Et as StatusBadge,zt as StatusBadgeProvider,Jl as Stepper,bu as SunburstChart,hn as Switch_default,fl as TYPE_SCALE,Xl as Tabs,Ka as TagInput,Xa as Text,ya as TextLinkField,Da as TextToolbar,Qe as Textarea_default,tn as TileButton_default,Pd as TimeAgo,Sr as TimePicker_default,Jd as TimeSeriesChart,bo as TimelineTrack,Ja as Title,Yo as TopNav,Zt as TransferProgress,ds as Tree,bs as TreeEmptySlot,us as TreeGroup,ms as TreeGroupLabel,fs as TreeRow,xs as TreeSeam,pu as TreemapChart,ru as WaterfallChart,Wn as WidthsBar,uc as angleScale,Xr as appendKey,kd as applyCorners,$d as applyIconSet,Md as applyThemePrefs,Bc as arcPath,Fc as areaBetween,zc as areaFrom,tc as assignSeriesSlots,kc as autoHighlightIndex,Zr as backspace,lc as bandScale,mc as binValues,gi as budgetState,Pc as bumpPath,No as calcOverall,ko as calcReportOverall,Qn as colorFill,ea as colorSwatchClasses,jn as columnSharesWidths,qr as copyToClipboard,jc as curvePath,Ci as dashFor,Mi as fillFor,wi as fillId,et as firstEnabledIndex,vi as fmtSliderDate,dr as fromKey,Ni as glowId,$i as groundId,St as groupColors,Yn as hexToHsv,Nc as highlightOpacity,Gn as hsvToHex,li as isSeverityTone,gl as isSpacingStep,$t as labelClasses,ic as ladderScale,Ld as languageSelectWidth,tt as lastEnabledIndex,Lc as linearPath,ac as linearScale,dc as logScale,ki as maskId,nt as matchTypeahead,It as mediaFileName,Sc as monotonePath,rt as nextEnabledIndex,sc as niceAxis,oc as niceMax,Hn as parseHexColor,Ec as polygonPoints,hc as radiusScale,Pn as resolveColumnShares,zn as resolveColumnWidths,Nd as resolveCorners,er as resolvePortalBrandAsset,ec as resolveSeriesColor,nc as resolveSeriesColorWithin,xd as resolveTheme,Wr as selectionAt,Qs as seriesColor,ii as severityOf,Ac as splinePath,Bd as squarify,ji as stagger,Dc as stepPath,Ul as tabButtonId,Vl as tabPanelId,Ca as textToolbarRows,Ma as textToolbarWindowColumns,yi as toDayMs,yr as toISODate,cr as toKey,rc as toggleSeriesSlot,Ds as useAppUpdate,zd as useClickOutside,rs as useContextMenu,jd as useDebouncedValue,wc as useHighlight,gc as usePlotWidth,ar as usePortalBranding,$o as useProductionTimeline,Ft as useStatusLabel,Cd as useTheme,ei as useTransferProgress};
|