efficient-shell 7.73.0 → 7.74.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.
@@ -1,44 +1,44 @@
1
- import{Breadcrumbs as e}from"./chunk-L5X6V677.js";import{useInSidebarBar as t,useSidebarSheet as r,SidebarLayout as n}from"./chunk-A5UR5LGU.js";import{BrandMark as a}from"./chunk-2ZRX3NRH.js";import{useShellLanguage as l}from"./chunk-SLEWYXMY.js";import{loadIconSet as i,iconSetFor as o}from"./chunk-ITIXJFKF.js";import{Markdown as s,Banner as c,Textarea_default as d}from"./chunk-F6FTF37T.js";import{IconButton_default as u}from"./chunk-RWNNFCSA.js";import{inputClasses as h,PLACEHOLDER_INK as m,FILTER_ON as p,FILTER_ON_INK as f,FILTER_OFF as g,INPUT_BASE_ON as b,INPUT_BASE as y,INPUT_SIZES as x}from"./chunk-CU3GY5Y2.js";import{isSafeLinkHref as v}from"./chunk-PJPK2ADX.js";import{toast_default as w}from"./chunk-DAMBAXPA.js";import{useIsMobile as N,GROUP_COLORS as k,OneLineLabel as $,TH_ONE_LINE as M,StatusBadgeProvider as C,StatusBadge as D,useShellPrefs as S}from"./chunk-RZHHSQDO.js";import{useTabLayer as L,focusableIn as A,useFocusTrap as j,useScrollLock as P,dialogA11y as z,stopAfter as F}from"./chunk-3NYPZO4K.js";import{optionNoteClass as E,PopupMenu as T,PopupMenuDivider as B,PopupMenuLabel as I,menuTextRowStyle as O,itemLook as R,MenuCheckMark as W,MenuSemanticsContext as K,leavesContextMenuAlone as _}from"./chunk-YIC644QO.js";import{useDismissPopupsOnOpen as q}from"./chunk-UVBK6YSR.js";import{reportBoundaryError as H}from"./chunk-KNUR2UEG.js";import{Button_default as U}from"./chunk-G5GERM76.js";import{Tooltip as V,useDropdownPosition as Y,MENU_MAX_HEIGHT as G,placeMenu as X,popupBounds as Z,followAnchor as J,VIEWPORT_MARGIN as Q,swallowPress as ee,describedByWith as te,OffWithReason as re,POPUP_MAX_WIDTH as ne,followRect as ae,placeAtPoint as le}from"./chunk-3E27HV76.js";import{solidSurfaceStyle as ie,glassStyle as oe,GLASS_DIVIDER as se}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as ce,onOverlayOpen as de,Z_LAYERS as ue}from"./chunk-FIEA5CGB.js";import{iconButtonClasses as he,buttonClasses as me}from"./chunk-K7PQXJO7.js";import{useBrowserLayoutEffect as pe,useBrowserValue as fe,useHydrated as ge,useBrowserValueOnce as be,useBrowserState as ye}from"./chunk-D65T4H6J.js";import{Icon as xe,setIconSet as ve}from"./chunk-76DRQSJM.js";import{useFileIntake as we,humanSize as Ne,FileIntakeAlert as ke}from"./chunk-R57S7SWU.js";import{useShellStrings as $e,useShellLocale as Me,DEFAULT_SHELL_STRINGS as Ce,currentShellStrings as De,splitAround as Se}from"./chunk-2EJRVQ3Y.js";import{formatPlain as Le,formatFixed as Ae,formatPercent as je}from"./chunk-C3QOHMR6.js";import{parseFocal as Pe,formatFocal as ze,isShown as Fe,nudgeFocal as Ee,focalFromRect as Te}from"./chunk-EJ4RMSQB.js";import{calendarNames as Be,firstDayOfWeek as Ie,formatDate as Oe,EMPTY_VALUE as Re,toInstant as We,timeAgo as Ke,formatDateTime as _e}from"./chunk-W32SKK3D.js";import{SpinnerRing as qe,LoadingSpinner as He}from"./chunk-2J6F4EE7.js";import{forwardRef as Ue,useId as Ve,createContext as Ye,useState as Ge,useRef as Xe,useMemo as Ze,useCallback as Je,useEffect as Qe,useContext as et,useLayoutEffect as tt,Children as rt,isValidElement as nt,cloneElement as at,Fragment as lt,Component as it,useSyncExternalStore as ot}from"react";import{jsxs as st,jsx as ct,Fragment as dt}from"react/jsx-runtime";import{createPortal as ut}from"react-dom";var ht=/(^|[\s:])!?z-/,mt={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"},pt=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled;function ft({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,"aria-disabled":m=!1,onOpenChange:p,footer:f,footerLabel:g}){const[b,y]=Ge(!1),[x,v]=Ge(-1),w=Xe(null),N=Xe(null),k=Xe(null),$=Xe(null),M=Xe(null),C=null!=f&&!1!==f,D=Xe({text:"",at:0}),S=Ve(),j=Ve(),P=u??j,z=Xe(p);z.current=p;const F=Xe(b);F.current=b;const E=Je(e=>{y(!1),F.current&&(F.current=!1,z.current?.(!1)),e&&N.current?.focus()},[]),K=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(pt(t[l]))return l}return-1},_=()=>k.current?.closest("[data-popup-menu-tree]")??null;Qe(()=>{if(!b)return;const e=e=>{const t=e.target;w.current?.contains(t)||_()?.contains(t)||E(!1)};document.addEventListener("pointerdown",e,!0);const t=de(()=>E(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[b,E]);const q=Je(()=>{const e=_(),t=N.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=X({trigger:t.getBoundingClientRect(),menu:l,bounds:Z(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]);pe(()=>{b&&q()}),Qe(()=>{if(b)return J(()=>N.current,q)},[b,q]),Qe(()=>{if(!b)return;const e=k.current,r=pt(t[x])?e?.querySelector(`[data-dropdown-index="${x}"]`):null;(r??e)?.focus({preventScroll:!0})},[b,x]),Qe(()=>{if(b)return ce(e=>"Escape"===e.key&&(E(!0),!0),()=>$.current)},[b,E]),L($,b&&C);const H=Xe(null),U=e=>"first"===e?K(0,1):K(t.length-1,-1),V=e=>{v(U(e)),y(!0),F.current||(F.current=!0,H.current=e,p?.(!0))};pe(()=>{const e=H.current;if(!b||!e)return;H.current=null;const t=U(e);t!==x&&v(t)});const Y=e=>{e.disabled||(E(!0),e.onSelect())},G=c??"a",Q=e=>`${S}-status-${e}`,ee=t.flatMap((e,t)=>"status"===e.type?[Q(t)]:[]).join(" ")||void 0,te=(e,t)=>({"data-dropdown-index":e,tabIndex:e===x?0:-1,onMouseEnter:()=>{t.disabled||M.current?.contains(document.activeElement)||v(e)}}),re=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
2
- return ct("div",{role:"separator",children:/* @__PURE__ */ct(B,{})},e.key);if("label"===e.type)/* @__PURE__ */
3
- return ct("div",{id:`${S}-label-${t}`,children:/* @__PURE__ */ct(I,{children:e.label})},e.key);if("status"===e.type)/* @__PURE__ */
4
- return ct("div",{id:Q(t),className:"text-xs",style:O(),children:e.label},e.key);if("checkbox"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
1
+ import{Breadcrumbs as e}from"./chunk-L5X6V677.js";import{useInSidebarBar as t,useSidebarSheet as r,SidebarLayout as n}from"./chunk-A5UR5LGU.js";import{BrandMark as a}from"./chunk-2ZRX3NRH.js";import{useShellLanguage as l}from"./chunk-SLEWYXMY.js";import{loadIconSet as i,iconSetFor as o}from"./chunk-ITIXJFKF.js";import{toast_default as s}from"./chunk-DAMBAXPA.js";import{useIsMobile as c,GROUP_COLORS as d,OneLineLabel as u,TH_ONE_LINE as h,StatusBadgeProvider as m,StatusBadge as p,useShellPrefs as f}from"./chunk-RZHHSQDO.js";import{useTabLayer as g,focusableIn as b,useFocusTrap as y,useScrollLock as x,dialogA11y as v,stopAfter as w}from"./chunk-3NYPZO4K.js";import{optionNoteClass as N,PopupMenu as k,PopupMenuDivider as $,PopupMenuLabel as M,menuTextRowStyle as C,itemLook as D,MenuCheckMark as S,MenuSemanticsContext as L,leavesContextMenuAlone as A}from"./chunk-YIC644QO.js";import{useDismissPopupsOnOpen as j}from"./chunk-UVBK6YSR.js";import{reportBoundaryError as P}from"./chunk-KNUR2UEG.js";import{Markdown as z,Banner as F,Textarea_default as E}from"./chunk-F6FTF37T.js";import{IconButton_default as T}from"./chunk-RWNNFCSA.js";import{inputClasses as B,PLACEHOLDER_INK as I,FILTER_ON as O,FILTER_ON_INK as R,FILTER_OFF as W,INPUT_BASE_ON as K,INPUT_BASE as _,INPUT_SIZES as q}from"./chunk-CU3GY5Y2.js";import{isSafeLinkHref as H}from"./chunk-PJPK2ADX.js";import{Button_default as U}from"./chunk-G5GERM76.js";import{Tooltip as V,useDropdownPosition as Y,MENU_MAX_HEIGHT as G,placeMenu as X,popupBounds as Z,followAnchor as J,VIEWPORT_MARGIN as Q,swallowPress as ee,describedByWith as te,OffWithReason as re,POPUP_MAX_WIDTH as ne,followRect as ae,placeAtPoint as le}from"./chunk-3E27HV76.js";import{solidSurfaceStyle as ie,glassStyle as oe,GLASS_DIVIDER as se}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as ce,onOverlayOpen as de,Z_LAYERS as ue}from"./chunk-FIEA5CGB.js";import{iconButtonClasses as he,buttonClasses as me}from"./chunk-K7PQXJO7.js";import{useBrowserLayoutEffect as pe,useBrowserValue as fe,useHydrated as ge,useBrowserValueOnce as be,useBrowserState as ye}from"./chunk-D65T4H6J.js";import{Icon as xe,setIconSet as ve}from"./chunk-76DRQSJM.js";import{useFileIntake as we,humanSize as Ne,FileIntakeAlert as ke}from"./chunk-R57S7SWU.js";import{useShellStrings as $e,useShellLocale as Me,DEFAULT_SHELL_STRINGS as Ce,currentShellStrings as De,splitAround as Se}from"./chunk-2EJRVQ3Y.js";import{formatPlain as Le,formatFixed as Ae,formatPercent as je}from"./chunk-C3QOHMR6.js";import{parseFocal as Pe,formatFocal as ze,isShown as Fe,nudgeFocal as Ee,focalFromRect as Te}from"./chunk-LJSZVZFB.js";import{calendarNames as Be,firstDayOfWeek as Ie,formatDate as Oe,EMPTY_VALUE as Re,toInstant as We,timeAgo as Ke,formatDateTime as _e}from"./chunk-W32SKK3D.js";import{SpinnerRing as qe,LoadingSpinner as He}from"./chunk-2J6F4EE7.js";import{forwardRef as Ue,useId as Ve,createContext as Ye,useState as Ge,useRef as Xe,useMemo as Ze,useCallback as Je,useEffect as Qe,useContext as et,useLayoutEffect as tt,Children as rt,isValidElement as nt,cloneElement as at,Fragment as lt,Component as it,useSyncExternalStore as ot}from"react";import{jsxs as st,jsx as ct,Fragment as dt}from"react/jsx-runtime";import{createPortal as ut}from"react-dom";var ht=/(^|[\s:])!?z-/,mt={paddingLeft:"var(--menu-padding-x, 1rem)",paddingRight:"var(--menu-padding-x, 1rem)",paddingTop:"0.25rem",paddingBottom:"0.25rem"},pt=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled;function ft({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,"aria-disabled":m=!1,onOpenChange:p,footer:f,footerLabel:y}){const[x,v]=Ge(!1),[w,N]=Ge(-1),L=Xe(null),A=Xe(null),j=Xe(null),P=Xe(null),z=Xe(null),F=null!=f&&!1!==f,E=Xe({text:"",at:0}),T=Ve(),B=Ve(),I=u??B,O=Xe(p);O.current=p;const R=Xe(x);R.current=x;const W=Je(e=>{v(!1),R.current&&(R.current=!1,O.current?.(!1)),e&&A.current?.focus()},[]),K=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(pt(t[l]))return l}return-1},_=()=>j.current?.closest("[data-popup-menu-tree]")??null;Qe(()=>{if(!x)return;const e=e=>{const t=e.target;L.current?.contains(t)||_()?.contains(t)||W(!1)};document.addEventListener("pointerdown",e,!0);const t=de(()=>W(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[x,W]);const q=Je(()=>{const e=_(),t=A.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=X({trigger:t.getBoundingClientRect(),menu:l,bounds:Z(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]);pe(()=>{x&&q()}),Qe(()=>{if(x)return J(()=>A.current,q)},[x,q]),Qe(()=>{if(!x)return;const e=j.current,r=pt(t[w])?e?.querySelector(`[data-dropdown-index="${w}"]`):null;(r??e)?.focus({preventScroll:!0})},[x,w]),Qe(()=>{if(x)return ce(e=>"Escape"===e.key&&(W(!0),!0),()=>P.current)},[x,W]),g(P,x&&F);const H=Xe(null),U=e=>"first"===e?K(0,1):K(t.length-1,-1),V=e=>{N(U(e)),v(!0),R.current||(R.current=!0,H.current=e,p?.(!0))};pe(()=>{const e=H.current;if(!x||!e)return;H.current=null;const t=U(e);t!==w&&N(t)});const Y=e=>{e.disabled||(W(!0),e.onSelect())},G=c??"a",Q=e=>`${T}-status-${e}`,ee=t.flatMap((e,t)=>"status"===e.type?[Q(t)]:[]).join(" ")||void 0,te=(e,t)=>({"data-dropdown-index":e,tabIndex:e===w?0:-1,onMouseEnter:()=>{t.disabled||z.current?.contains(document.activeElement)||N(e)}}),re=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
2
+ return ct("div",{role:"separator",children:/* @__PURE__ */ct($,{})},e.key);if("label"===e.type)/* @__PURE__ */
3
+ return ct("div",{id:`${T}-label-${t}`,children:/* @__PURE__ */ct(M,{children:e.label})},e.key);if("status"===e.type)/* @__PURE__ */
4
+ return ct("div",{id:Q(t),className:"text-xs",style:C(),children:e.label},e.key);if("checkbox"===e.type){const r=D(!1,e.disabled,"");/* @__PURE__ */
5
5
  return st("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),...te(t,e),children:[
6
- /* @__PURE__ */ct(W,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=R(!1,e.disabled,"");/* @__PURE__ */
6
+ /* @__PURE__ */ct(S,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=D(!1,e.disabled,"");/* @__PURE__ */
7
7
  return st("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>Y(e),...te(t,e),children:[
8
- /* @__PURE__ */ct(W,{kind:"radio",checked:e.checked}),e.icon,e.label]},e.key)}if((e=>"link"===e.type||void 0===e.type&&"string"==typeof e.href)(e)){const r=R(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */st("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...te(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */st(G,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>E(!0),...te(t,e),children:[e.icon,e.label]},e.key)}const r=R(e.danger,e.disabled,"");/* @__PURE__ */
9
- return st("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>Y(e),...te(t,e),children:[e.icon,e.label]},e.key)},ne="function"==typeof f?f({close:()=>E(!0)}):f,ae={...ht.test(o)?{}:{zIndex:ue.popup},minWidth:s};/* @__PURE__ */
10
- return st("div",{ref:w,className:`relative inline-flex ${l}`.trim(),children:[
11
- /* @__PURE__ */ct("button",{ref:N,id:P,type:"button","aria-haspopup":"menu","aria-expanded":b,"aria-controls":b?S:void 0,"aria-label":a,"aria-describedby":h,"aria-disabled":m||void 0,disabled:d,onClick:()=>{m||(b?E(!1):V("first"))},onKeyDown:e=>{m||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),V("first")):"ArrowUp"===e.key&&(e.preventDefault(),V("last")))},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}),b&&
12
- /* @__PURE__ */ct(T,{portal:!0,className:o,style:ae,children:/* @__PURE__ */st("div",{ref:$,children:[
13
- /* @__PURE__ */ct("div",{ref:k,id:S,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:P,"aria-describedby":ee,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),v(K(x+1,1));else if("ArrowUp"===e.key)e.preventDefault(),v(K(x-1,-1));else if("Home"===e.key)e.preventDefault(),v(K(0,1));else if("End"===e.key)e.preventDefault(),v(K(t.length-1,-1));else if("Tab"===e.key){e.preventDefault();const t=!e.shiftKey&&M.current?A(M.current)[0]:void 0;t?t.focus({preventScroll:!0}):E(!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-D.current.at<500?D.current.text+n:n;D.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?x+1:Math.max(x,0),s=k.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(pt(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void v(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(re(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(re(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${S}-label-${l-1}`:void 0;e.push(/* @__PURE__ */ct("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()}),C&&/* @__PURE__ */st("div",{ref:M,role:"group","aria-label":g,"data-dropdown-footer":"",onKeyDown:e=>{const t=M.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=A(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=k.current?.querySelector(`[data-dropdown-index="${x}"]`);return void(t??k.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),E(!0))},children:[
14
- /* @__PURE__ */ct("div",{"aria-hidden":"true",children:/* @__PURE__ */ct(B,{})}),
8
+ /* @__PURE__ */ct(S,{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=D(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */st("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...te(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */st(G,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>W(!0),...te(t,e),children:[e.icon,e.label]},e.key)}const r=D(e.danger,e.disabled,"");/* @__PURE__ */
9
+ return st("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>Y(e),...te(t,e),children:[e.icon,e.label]},e.key)},ne="function"==typeof f?f({close:()=>W(!0)}):f,ae={...ht.test(o)?{}:{zIndex:ue.popup},minWidth:s};/* @__PURE__ */
10
+ return st("div",{ref:L,className:`relative inline-flex ${l}`.trim(),children:[
11
+ /* @__PURE__ */ct("button",{ref:A,id:I,type:"button","aria-haspopup":"menu","aria-expanded":x,"aria-controls":x?T:void 0,"aria-label":a,"aria-describedby":h,"aria-disabled":m||void 0,disabled:d,onClick:()=>{m||(x?W(!1):V("first"))},onKeyDown:e=>{m||("ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),V("first")):"ArrowUp"===e.key&&(e.preventDefault(),V("last")))},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}),x&&
12
+ /* @__PURE__ */ct(k,{portal:!0,className:o,style:ae,children:/* @__PURE__ */st("div",{ref:P,children:[
13
+ /* @__PURE__ */ct("div",{ref:j,id:T,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:I,"aria-describedby":ee,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),N(K(w+1,1));else if("ArrowUp"===e.key)e.preventDefault(),N(K(w-1,-1));else if("Home"===e.key)e.preventDefault(),N(K(0,1));else if("End"===e.key)e.preventDefault(),N(K(t.length-1,-1));else if("Tab"===e.key){e.preventDefault();const t=!e.shiftKey&&z.current?b(z.current)[0]:void 0;t?t.focus({preventScroll:!0}):W(!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-E.current.at<500?E.current.text+n:n;E.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?w+1:Math.max(w,0),s=j.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(pt(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void N(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(re(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(re(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${T}-label-${l-1}`:void 0;e.push(/* @__PURE__ */ct("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()}),F&&/* @__PURE__ */st("div",{ref:z,role:"group","aria-label":y,"data-dropdown-footer":"",onKeyDown:e=>{const t=z.current;if("Tab"!==e.key||!t||!t.contains(e.target))return;const r=b(t),n=document.activeElement;if(e.shiftKey){if(r.length>0&&n!==r[0])return;e.preventDefault();const t=j.current?.querySelector(`[data-dropdown-index="${w}"]`);return void(t??j.current)?.focus({preventScroll:!0})}r.length>0&&n!==r[r.length-1]||(e.preventDefault(),W(!0))},children:[
14
+ /* @__PURE__ */ct("div",{"aria-hidden":"true",children:/* @__PURE__ */ct($,{})}),
15
15
  /* @__PURE__ */ct("div",{style:mt,children:ne})]})]})})]})}var gt="relative focus-visible:z-10",bt={secondary:"border-l-0",primary:"border-l border-white/30",warning:"border-l border-white/30"},yt=Ue(function({children:e,onClick:t,type:r="button",items:n,menuLabel:a,variant:l="primary",size:i="md",loading:o=!1,leftIcon:s,disabled:c=!1,disabledReason:d,tooltip:u,menuDisabled:h=!1,menuDisabledReason:m,onMenuOpenChange:p,menuFooter:f,menuFooterLabel:g,align:b="end",side:y="bottom",menuMinWidth:x,linkAs:v,block:w=!1,className:N=""},k){const $=c&&(null!=d&&""!==d&&!1!==d)&&!o,M=h&&null!=m&&""!==m&&!1!==m,C=Ve(),D=/* @__PURE__ */ct(U,{ref:k,type:r,variant:l,size:i,loading:o,leftIcon:s,block:w,disabled:c&&!$,"aria-disabled":!!$||void 0,disabledReason:$?d:void 0,onClick:t,className:`rounded-r-none ${gt}`,children:e}),S=w?"relative flex min-w-0 flex-1":"relative inline-flex",L=i.startsWith("touch")?"h-5 w-5":"h-4 w-4";/* @__PURE__ */
16
16
  return st("div",{className:[w?"flex w-full":"inline-flex","items-stretch",N].filter(Boolean).join(" "),children:[null==u||""===u||$?D:/* @__PURE__ */ct(V,{content:u,className:S,children:D}),
17
17
  /* @__PURE__ */ct(V,{content:M?m:a,describe:!1,className:"relative inline-flex shrink-0",children:/* @__PURE__ */ct(ft,{"aria-label":a,"aria-describedby":M?C:void 0,items:n,align:b,side:y,minWidth:x,linkAs:v,disabled:h&&!M,"aria-disabled":M,onOpenChange:p,footer:f,footerLabel:g,triggerClassName:he({variant:l,size:i,className:`rounded-l-none ${bt[l]} ${gt}`}),trigger:/* @__PURE__ */ct(xe,{name:"chevron-down",className:L,strokeWidth:2,"aria-hidden":"true"})})}),M&&/* @__PURE__ */ct("span",{id:C,className:"sr-only",children:m})]})}),xt=Ue(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:l,...i},o){const s=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),c=
18
- /* @__PURE__ */ct("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:h({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */st("div",{className:"relative",children:[t&&/* @__PURE__ */ct("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${m}`,children:t}),c,r&&/* @__PURE__ */ct("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),vt=Ye(!1);function wt(){return et(vt)}var Nt=Ye(!1);function kt(){return et(Nt)}function $t(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Mt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ct(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?$t(e):Mt(e)}function Dt(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 St=e=>Array.isArray(e.options);function Lt(e){const t=[];for(const r of e)St(r)?t.push(...r.options):t.push(r);return t}function At(e,t){const r=[];for(const n of e){if(!St(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function jt(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!St(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
18
+ /* @__PURE__ */ct("input",{ref:o,"aria-invalid":e||void 0,readOnly:l,className:B({invalid:e,size:n,readOnly:l,className:[s,a].filter(Boolean).join(" ")}),...i});return t||r?/* @__PURE__ */st("div",{className:"relative",children:[t&&/* @__PURE__ */ct("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${I}`,children:t}),c,r&&/* @__PURE__ */ct("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):c}),vt=Ye(!1);function wt(){return et(vt)}var Nt=Ye(!1);function kt(){return et(Nt)}function $t(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function Mt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function Ct(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?$t(e):Mt(e)}function Dt(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 St=e=>Array.isArray(e.options);function Lt(e){const t=[];for(const r of e)St(r)?t.push(...r.options):t.push(r);return t}function At(e,t){const r=[];for(const n of e){if(!St(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function jt(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!St(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
19
19
  /* @__PURE__ */st("div",{role:"group","aria-labelledby":o,children:[
20
20
  /* @__PURE__ */ct("div",{id:o,role:"presentation","data-option-group-heading":"",className:`truncate px-3 pb-1 pt-2 text-xs font-semibold text-gray-500 ${n}`.trim(),children:e.label}),e.options.map((e,r)=>t(e,s+r))]},o))}),a}function Pt({selected:e}){/* @__PURE__ */
21
21
  return ct(xe,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e?"":"invisible"),strokeWidth:2.5})}function zt(e,t){return e.label.toLowerCase().includes(t)||(e.sublabel?.toLowerCase().includes(t)??!1)}function Ft({children:e,grows:t=!1}){/* @__PURE__ */
22
- return ct("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var Et=Ue(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:o,renderOption:s,renderValue:c,valueText:d,readOnly:u,footer:m,changed:p,auto:f,multiple:g,"aria-describedby":b,...y},x){const v=t,w=$e(),N=kt(),k=f??N,$=Ve(),M=/* @__PURE__ */st("select",{ref:x,value:e,multiple:g||void 0,onChange:e=>v(g?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,"aria-describedby":[b,k?$:void 0].filter(Boolean).join(" ")||void 0,className:h({invalid:a,size:i,auto:k,className:`pr-8 ${l}`.trim()}),...y,children:[void 0!==n&&!g&&/* @__PURE__ */ct("option",{value:"",disabled:!0,children:n}),
23
- /* @__PURE__ */ct(Tt,{items:r})]});return k?/* @__PURE__ */st(dt,{children:[M,
24
- /* @__PURE__ */ct("span",{id:$,hidden:!0,children:w.settingView.auto})]}):M});function Tt({items:e}){const t=e=>/* @__PURE__ */ct("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
25
- return ct(dt,{children:e.map((e,r)=>(e=>St(e))(e)?/* @__PURE__ */ct("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var Bt=Ue(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:d,multiple:u,renderOption:p,renderValue:f,valueText:g,readOnly:b=!1,footer:y,changed:x=!1,auto:v,"aria-describedby":w,"aria-label":N,"aria-labelledby":k,...$},M){const[C,D]=Ge(!1),[S,L]=Ge(-1),A=Xe(null),j=Xe(null),P=Xe(null),z=Xe(null),F=Xe([]),T=()=>z.current??P.current,B=!!y?.length,I="sm"===s,O=I?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",R=E(I),[W,K]=Ge(null),_=$e(),q=Xe(C);q.current=C;const H=Xe({buffer:"",timer:null}),U=Ve(),V=`${U}-listbox`,X=i??`${U}-trigger`,Z=e=>`${U}-opt-${e}`,J=`${U}-changed`,Q=kt(),ee=v??Q,te=`${U}-auto`,re=[w,x?J:void 0,ee?te:void 0].filter(Boolean).join(" ")||void 0,ne=Ze(()=>Lt(r),[r]),ae=u?e:[],le=t,oe=Y(j,C,{matchTriggerWidth:!0,...y?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),se="undefined"==typeof window?Qe:tt,he=`${C}|${oe?.top}|${oe?.bottom}|${oe?.maxHeight}|${r.length}`;se(()=>{K(null)},[he]),se(()=>{const e=P.current;if(!C||!e||null!==W)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let a=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;a=r}a>r&&K(Math.floor(a))},[C,W,he]);const me=u?ne.findIndex(e=>ae.includes(e.value)):ne.findIndex(t=>t.value===e),pe=u?ne.filter(e=>ae.includes(e.value)).map(e=>e.label).join(", ")||void 0:me>=0?ne[me].label:void 0,fe=!u&&me>=0?ne[me].lang:void 0,ge=u?ne.filter(e=>ae.includes(e.value)):me>=0?[ne[me]]:[],be=f&&ge.length?f(ge):void 0,ye=void 0!==be&&g?g(ge):void 0,ve=Je((e=!0)=>{D(!1),L(-1),e&&j.current?.focus()},[]),we=Je(()=>{o||b||(L(me>=0?me:$t(ne)),D(!0))},[o,b,ne,me]),Ne=Je(t=>{const r=ne[t];if(r&&!r.disabled){if(u){const n=e;return le(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void L(t)}le(r.value),ve()}},[ne,u,e,le,ve]);Qe(()=>{if(!C)return;return ce(e=>!("Escape"!==e.key||!q.current)&&(ve(),!0),T)},[C,ve]),Qe(()=>{if(!C)return;const e=e=>{const t=e.target;A.current?.contains(t)||T()?.contains(t)||ve(!1)};document.addEventListener("pointerdown",e);const t=de(()=>ve(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[C,ve]),Qe(()=>{!C||S<0||P.current?.querySelector(`#${CSS.escape(Z(S))}`)?.scrollIntoView({block:"nearest"})},[C,S]);const ke=Je(e=>{const t=H.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=C?S:me,n=Dt(ne,t.buffer,r);n<0||(C?L(n):u?(L(n),D(!0)):Ne(n))},[C,S,me,ne,Ne,u]),Me=C?jt(r,(t,r)=>{const n=(a=t.value,u?ae.includes(a):e===a);var a;const l=r===S;/* @__PURE__ */
26
- return st("div",{id:Z(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||L(r)},onClick:()=>Ne(r),className:`mx-1 cursor-pointer truncate rounded-lg ${O}${u?" 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:[u&&/* @__PURE__ */ct(Pt,{selected:n}),p?/* @__PURE__ */ct("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):u?/* @__PURE__ */st("span",{className:"block min-w-0 flex-1",children:[
22
+ return ct("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var Et=Ue(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",size:i,touchSize:o,renderOption:s,renderValue:c,valueText:d,readOnly:u,footer:h,changed:m,auto:p,multiple:f,"aria-describedby":g,...b},y){const x=t,v=$e(),w=kt(),N=p??w,k=Ve(),$=/* @__PURE__ */st("select",{ref:y,value:e,multiple:f||void 0,onChange:e=>x(f?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,"aria-describedby":[g,N?k:void 0].filter(Boolean).join(" ")||void 0,className:B({invalid:a,size:i,auto:N,className:`pr-8 ${l}`.trim()}),...b,children:[void 0!==n&&!f&&/* @__PURE__ */ct("option",{value:"",disabled:!0,children:n}),
23
+ /* @__PURE__ */ct(Tt,{items:r})]});return N?/* @__PURE__ */st(dt,{children:[$,
24
+ /* @__PURE__ */ct("span",{id:k,hidden:!0,children:v.settingView.auto})]}):$});function Tt({items:e}){const t=e=>/* @__PURE__ */ct("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
25
+ return ct(dt,{children:e.map((e,r)=>(e=>St(e))(e)?/* @__PURE__ */ct("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var Bt=Ue(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:l="",id:i,disabled:o,size:s,touchSize:c,title:d,multiple:u,renderOption:h,renderValue:m,valueText:p,readOnly:f=!1,footer:g,changed:b=!1,auto:y,"aria-describedby":x,"aria-label":v,"aria-labelledby":w,...k},$){const[M,C]=Ge(!1),[D,S]=Ge(-1),L=Xe(null),A=Xe(null),j=Xe(null),P=Xe(null),z=Xe([]),F=()=>P.current??j.current,E=!!g?.length,T="sm"===s,O=T?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",R=N(T),[W,K]=Ge(null),_=$e(),q=Xe(M);q.current=M;const H=Xe({buffer:"",timer:null}),U=Ve(),V=`${U}-listbox`,X=i??`${U}-trigger`,Z=e=>`${U}-opt-${e}`,J=`${U}-changed`,Q=kt(),ee=y??Q,te=`${U}-auto`,re=[x,b?J:void 0,ee?te:void 0].filter(Boolean).join(" ")||void 0,ne=Ze(()=>Lt(r),[r]),ae=u?e:[],le=t,oe=Y(A,M,{matchTriggerWidth:!0,...g?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),se="undefined"==typeof window?Qe:tt,he=`${M}|${oe?.top}|${oe?.bottom}|${oe?.maxHeight}|${r.length}`;se(()=>{K(null)},[he]),se(()=>{const e=j.current;if(!M||!e||null!==W)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let a=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;a=r}a>r&&K(Math.floor(a))},[M,W,he]);const me=u?ne.findIndex(e=>ae.includes(e.value)):ne.findIndex(t=>t.value===e),pe=u?ne.filter(e=>ae.includes(e.value)).map(e=>e.label).join(", ")||void 0:me>=0?ne[me].label:void 0,fe=!u&&me>=0?ne[me].lang:void 0,ge=u?ne.filter(e=>ae.includes(e.value)):me>=0?[ne[me]]:[],be=m&&ge.length?m(ge):void 0,ye=void 0!==be&&p?p(ge):void 0,ve=Je((e=!0)=>{C(!1),S(-1),e&&A.current?.focus()},[]),we=Je(()=>{o||f||(S(me>=0?me:$t(ne)),C(!0))},[o,f,ne,me]),Ne=Je(t=>{const r=ne[t];if(r&&!r.disabled){if(u){const n=e;return le(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void S(t)}le(r.value),ve()}},[ne,u,e,le,ve]);Qe(()=>{if(!M)return;return ce(e=>!("Escape"!==e.key||!q.current)&&(ve(),!0),F)},[M,ve]),Qe(()=>{if(!M)return;const e=e=>{const t=e.target;L.current?.contains(t)||F()?.contains(t)||ve(!1)};document.addEventListener("pointerdown",e);const t=de(()=>ve(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[M,ve]),Qe(()=>{!M||D<0||j.current?.querySelector(`#${CSS.escape(Z(D))}`)?.scrollIntoView({block:"nearest"})},[M,D]);const ke=Je(e=>{const t=H.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=M?D:me,n=Dt(ne,t.buffer,r);n<0||(M?S(n):u?(S(n),C(!0)):Ne(n))},[M,D,me,ne,Ne,u]),Me=M?jt(r,(t,r)=>{const n=(a=t.value,u?ae.includes(a):e===a);var a;const l=r===D;/* @__PURE__ */
26
+ return st("div",{id:Z(r),role:"option",lang:t.description||h?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||S(r)},onClick:()=>Ne(r),className:`mx-1 cursor-pointer truncate rounded-lg ${O}${u?" 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:[u&&/* @__PURE__ */ct(Pt,{selected:n}),h?/* @__PURE__ */ct("span",{className:"block min-w-0 flex-1 truncate",children:h(t,{selected:n,active:l})}):u?/* @__PURE__ */st("span",{className:"block min-w-0 flex-1",children:[
27
27
  /* @__PURE__ */ct("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */ct("span",{className:R,children:t.description})]}):t.description?
28
28
  /* @__PURE__ */st(dt,{children:[
29
29
  /* @__PURE__ */ct("span",{lang:t.lang,className:"block truncate",children:t.label}),
30
30
  /* @__PURE__ */ct("span",{className:R,children:t.description})]}):t.label]},t.value)},U,"mx-1"):null,Ce=void 0!==be?
31
31
  /* @__PURE__ */st("span",{className:"relative block min-w-0 truncate",children:[
32
32
  /* @__PURE__ */ct("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:be}),
33
- /* @__PURE__ */ct("span",{lang:void 0===ye?fe:void 0,className:"sr-only",children:ye??pe})]}):/* @__PURE__ */ct("span",{lang:fe,className:"block truncate "+(void 0===pe?"text-gray-400":""),children:pe??n??" "}),De={zIndex:ue.popup,left:oe?.left,top:oe?.top,bottom:oe?.bottom,width:oe?.width,maxHeight:oe?.maxHeight??G,visibility:oe?void 0:"hidden",...ie()},Se=/* @__PURE__ */ct("div",{ref:P,id:V,role:"listbox","aria-labelledby":k??(N?void 0:X),"aria-label":k?void 0:N,"aria-multiselectable":u||void 0,className:B?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:B?null!==W?{maxHeight:W}:void 0:null!==W?{...De,maxHeight:W}:De,children:Me}),Le=B?/* @__PURE__ */st("div",{ref:z,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:De,children:[Se,
34
- /* @__PURE__ */ct("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:y.map((e,t)=>/* @__PURE__ */st("button",{ref:e=>{F.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(ve(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(y?.length??0)-1,n=t=>{e.preventDefault(),F.current[t]?.focus()},a=()=>{e.preventDefault(),j.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?a():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?a():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void ve());case"Escape":return e.preventDefault(),e.stopPropagation(),void ve()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${O} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */ct(xe,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
33
+ /* @__PURE__ */ct("span",{lang:void 0===ye?fe:void 0,className:"sr-only",children:ye??pe})]}):/* @__PURE__ */ct("span",{lang:fe,className:"block truncate "+(void 0===pe?"text-gray-400":""),children:pe??n??" "}),De={zIndex:ue.popup,left:oe?.left,top:oe?.top,bottom:oe?.bottom,width:oe?.width,maxHeight:oe?.maxHeight??G,visibility:oe?void 0:"hidden",...ie()},Se=/* @__PURE__ */ct("div",{ref:j,id:V,role:"listbox","aria-labelledby":w??(v?void 0:X),"aria-label":w?void 0:v,"aria-multiselectable":u||void 0,className:E?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:E?null!==W?{maxHeight:W}:void 0:null!==W?{...De,maxHeight:W}:De,children:Me}),Le=E?/* @__PURE__ */st("div",{ref:P,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:De,children:[Se,
34
+ /* @__PURE__ */ct("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:g.map((e,t)=>/* @__PURE__ */st("button",{ref:e=>{z.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(ve(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(g?.length??0)-1,n=t=>{e.preventDefault(),z.current[t]?.focus()},a=()=>{e.preventDefault(),A.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?a():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?a():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void ve());case"Escape":return e.preventDefault(),e.stopPropagation(),void ve()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${O} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */ct(xe,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
35
35
  /* @__PURE__ */ct("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Se;/* @__PURE__ */
36
- return st("div",{ref:A,className:"relative",children:[
37
- /* @__PURE__ */ct("button",{ref:j,id:X,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":C,"aria-controls":C?V:void 0,"aria-activedescendant":C&&S>=0?Z(S):void 0,"aria-invalid":a||void 0,"aria-describedby":re,"aria-label":N,"aria-labelledby":k,title:d,disabled:o,"aria-readonly":b||void 0,onClick:()=>C?ve():we(),onKeyDown:e=>{if(!o&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(C?L(e=>Ct(ne,e,1)):we());case"ArrowUp":return e.preventDefault(),void(C?L(e=>Ct(ne,e,-1)):we());case"Home":return void(C&&(e.preventDefault(),L($t(ne))));case"End":return void(C&&(e.preventDefault(),L(Mt(ne))));case"Enter":return void(C&&(e.preventDefault(),Ne(S)));case" ":return e.preventDefault(),void(C?Ne(S):we());case"Escape":return void(C&&(e.preventDefault(),e.stopPropagation(),ve()));case"Tab":return C&&B&&!e.shiftKey?(e.preventDefault(),void F.current[0]?.focus()):void(C&&ve(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),ke(e.key))}},className:h({invalid:a,size:s,readOnly:b,auto:ee,className:`${b?"":"pr-8 "}text-left ${l}`.trim()}),children:x?
36
+ return st("div",{ref:L,className:"relative",children:[
37
+ /* @__PURE__ */ct("button",{ref:A,id:X,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":M,"aria-controls":M?V:void 0,"aria-activedescendant":M&&D>=0?Z(D):void 0,"aria-invalid":a||void 0,"aria-describedby":re,"aria-label":v,"aria-labelledby":w,title:d,disabled:o,"aria-readonly":f||void 0,onClick:()=>M?ve():we(),onKeyDown:e=>{if(!o&&!f)switch(e.key){case"ArrowDown":return e.preventDefault(),void(M?S(e=>Ct(ne,e,1)):we());case"ArrowUp":return e.preventDefault(),void(M?S(e=>Ct(ne,e,-1)):we());case"Home":return void(M&&(e.preventDefault(),S($t(ne))));case"End":return void(M&&(e.preventDefault(),S(Mt(ne))));case"Enter":return void(M&&(e.preventDefault(),Ne(D)));case" ":return e.preventDefault(),void(M?Ne(D):we());case"Escape":return void(M&&(e.preventDefault(),e.stopPropagation(),ve()));case"Tab":return M&&E&&!e.shiftKey?(e.preventDefault(),void z.current[0]?.focus()):void(M&&ve(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),ke(e.key))}},className:B({invalid:a,size:s,readOnly:f,auto:ee,className:`${f?"":"pr-8 "}text-left ${l}`.trim()}),children:b?
38
38
  /* @__PURE__ */st("span",{className:"flex min-w-0 items-center gap-1",children:[Ce,
39
- /* @__PURE__ */ct("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ce}),x&&/* @__PURE__ */ct("span",{id:J,hidden:!0,children:_.select.changed}),ee&&/* @__PURE__ */ct("span",{id:te,hidden:!0,children:_.settingView.auto}),!b&&/* @__PURE__ */ct(xe,{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 ${m}`,strokeWidth:2}),
40
- /* @__PURE__ */st("select",{ref:M,value:e,multiple:u||void 0,onChange:e=>le(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:o,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...$,children:[void 0!==n&&!u&&/* @__PURE__ */ct("option",{value:"",disabled:!0,children:n}),
41
- /* @__PURE__ */ct(Tt,{items:r})]}),C&&ut(Le,document.body)]})}),It=Ue(function({touchSize:e="touch",...t},r){const n=N();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */ct(Et,{ref:r,...t,size:e}):/* @__PURE__ */ct(Bt,{ref:r,...t}):/* @__PURE__ */ct(Bt,{ref:r,...t,size:e})});function Ot(e,t,r,n){const a=Ve(),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 Rt=Ue(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=Xe(null),h=Ot(n,a,o,s);Qe(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Je(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */ct("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__ */st("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
39
+ /* @__PURE__ */ct("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ce}),b&&/* @__PURE__ */ct("span",{id:J,hidden:!0,children:_.select.changed}),ee&&/* @__PURE__ */ct("span",{id:te,hidden:!0,children:_.settingView.auto}),!f&&/* @__PURE__ */ct(xe,{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 ${I}`,strokeWidth:2}),
40
+ /* @__PURE__ */st("select",{ref:$,value:e,multiple:u||void 0,onChange:e=>le(u?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:o,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...k,children:[void 0!==n&&!u&&/* @__PURE__ */ct("option",{value:"",disabled:!0,children:n}),
41
+ /* @__PURE__ */ct(Tt,{items:r})]}),M&&ut(Le,document.body)]})}),It=Ue(function({touchSize:e="touch",...t},r){const n=c();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */ct(Et,{ref:r,...t,size:e}):/* @__PURE__ */ct(Bt,{ref:r,...t}):/* @__PURE__ */ct(Bt,{ref:r,...t,size:e})});function Ot(e,t,r,n){const a=Ve(),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 Rt=Ue(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=Xe(null),h=Ot(n,a,o,s);Qe(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Je(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */ct("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__ */st("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
42
42
  /* @__PURE__ */st("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */ct("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */ct("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),Wt="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",Kt=Ue(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=Ot(r,n,i,o);return r||n?/* @__PURE__ */st("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
43
43
  /* @__PURE__ */ct("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Wt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
44
44
  /* @__PURE__ */st("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */ct("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */ct("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */ct("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${Wt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function _t({label:e,htmlFor:t,labelId:r,hint:n,error:a,required:l,className:i="",children:o}){const s=t?a?`${t}-error`:n?`${t}-hint`:void 0:void 0,c=1===rt.count(o)?rt.only(o):null,d=nt(c)?c:null,u={};if(d){if(s){const e=(d.props["aria-describedby"]??"").split(/\s+/);u["aria-describedby"]=Array.from(new Set([...e,s].filter(Boolean))).join(" ")}a&&void 0===d.props["aria-invalid"]&&(u["aria-invalid"]=!0)}const h=d&&Object.keys(u).length>0?at(d,u):o;/* @__PURE__ */
@@ -61,11 +61,11 @@ return st(dt,{children:[e?/* @__PURE__ */ct("span",{"aria-hidden":"true",classNa
61
61
  return ct("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */st("label",{htmlFor:i,className:tr({size:a,selected:o,disabled:r.disabled,block:l}),children:[
62
62
  /* @__PURE__ */ct("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)]"}),
63
63
  /* @__PURE__ */ct(nr,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */ct("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */ct(V,{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__ */ct("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:tr({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */ct(nr,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */ct(V,{content:r.title,className:m,children:i},r.value):i})})}var lr="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";function ir({label:e,glyph:t,onClick:r}){/* @__PURE__ */
64
- return ct(V,{content:e,describe:!1,children:/* @__PURE__ */ct("button",{type:"button",onClick:r,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */ct("span",{"aria-hidden":"true",children:t})})})}function or({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=$e().transfer;if("idle"===e)return null==t?null:/* @__PURE__ */ct("span",{className:`${lr} ${k.neutral} pr-2 ${s}`.trim(),children:t});if("error"===e)/* @__PURE__ */
65
- return st("span",{role:"status",className:`${lr} ${k.danger} ${s}`.trim(),children:[
66
- /* @__PURE__ */ct("span",{children:c.error}),i&&/* @__PURE__ */ct(ir,{label:c.retry,glyph:"↻",onClick:i}),o&&/* @__PURE__ */ct(ir,{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__ */
67
- return st("span",{role:"status","aria-live":"polite",className:`${lr} ${k.info} ${s}`.trim(),children:[null==u&&/* @__PURE__ */ct(qe,{ink:""}),
68
- /* @__PURE__ */ct("span",{className:"tabular-nums",children:"string"==typeof d?m(d):/* @__PURE__ */st(dt,{children:[d,m("")&&` ${m("")}`]})}),l&&/* @__PURE__ */ct(ir,{label:h,glyph:"×",onClick:l})]})}var sr=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function cr(e){if(/^data:/i.test(e||""))return function(e){const t=sr.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 dr=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function ur(e,t=Ce.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 hr(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 mr(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function pr({label:e,progress:t,rounded:r="rounded-lg"}){/* @__PURE__ */
64
+ return ct(V,{content:e,describe:!1,children:/* @__PURE__ */ct("button",{type:"button",onClick:r,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */ct("span",{"aria-hidden":"true",children:t})})})}function or({state:e,label:t,verb:r,subject:n,pct:a,onCancel:l,onRetry:i,onDismiss:o,className:s=""}){const c=$e().transfer;if("idle"===e)return null==t?null:/* @__PURE__ */ct("span",{className:`${lr} ${d.neutral} pr-2 ${s}`.trim(),children:t});if("error"===e)/* @__PURE__ */
65
+ return st("span",{role:"status",className:`${lr} ${d.danger} ${s}`.trim(),children:[
66
+ /* @__PURE__ */ct("span",{children:c.error}),i&&/* @__PURE__ */ct(ir,{label:c.retry,glyph:"↻",onClick:i}),o&&/* @__PURE__ */ct(ir,{label:c.dismiss,glyph:"×",onClick:o})]});const u=r??c.uploading,h=null==a||Number.isNaN(a)?null:Math.max(0,Math.min(100,Math.round(a))),m="string"==typeof u?c.cancelVerb(u.toLowerCase()):c.cancel,p=e=>[e,n,null==h?"":`${h}%`].filter(Boolean).join(" ");/* @__PURE__ */
67
+ return st("span",{role:"status","aria-live":"polite",className:`${lr} ${d.info} ${s}`.trim(),children:[null==h&&/* @__PURE__ */ct(qe,{ink:""}),
68
+ /* @__PURE__ */ct("span",{className:"tabular-nums",children:"string"==typeof u?p(u):/* @__PURE__ */st(dt,{children:[u,p("")&&` ${p("")}`]})}),l&&/* @__PURE__ */ct(ir,{label:m,glyph:"×",onClick:l})]})}var sr=/^data:([a-z0-9!#$&^_.+-]+)\/([a-z0-9!#$&^_.+-]+)/i;function cr(e){if(/^data:/i.test(e||""))return function(e){const t=sr.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 dr=/\.(mp4|webm|ogg|ogv|mov|m4v)(\?|#|$)/i;function ur(e,t=Ce.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 hr(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 mr(e){return e?"rosh-focus-ring":"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-zone)]"}function pr({label:e,progress:t,rounded:r="rounded-lg"}){/* @__PURE__ */
69
69
  return ct("div",{className:`absolute inset-0 flex items-center justify-center bg-white/60 ${r}`,children:/* @__PURE__ */ct(or,{state:"busy",verb:e,pct:t})})}function fr({children:e}){/* @__PURE__ */
70
70
  return ct("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 gr(e,t=""){if(!e)return!1;const r=sr.exec(e);if(r)return"video"===r[1].toLowerCase();const n=t.includes("video"),a=t.includes("image")||"*"===t||""===t;return dr.test(e)||n&&!a}function br({className:e="h-4 w-4"}){/* @__PURE__ */
71
71
  return ct(xe,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function yr({className:e="h-6 w-6"}){/* @__PURE__ */
@@ -119,60 +119,60 @@ return st("div",{className:p,children:[
119
119
  /* @__PURE__ */st("div",{ref:j,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=Pr(R)??y??S,r={ArrowLeft:()=>Er(t,-1),ArrowRight:()=>Er(t,1),ArrowUp:()=>Er(t,-7),ArrowDown:()=>Er(t,7),Home:()=>Er(t,-(t.getDay()-k+7)%7),End:()=>Er(t,6-(t.getDay()-k+7)%7),PageUp:()=>Tr(t,e.shiftKey?-12:-1),PageDown:()=>Tr(t,e.shiftKey?12:1)};if(r[e.key])return e.preventDefault(),a=r[e.key](),P.current=!0,A(jr(a)),void(zr(a)!==D&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||T(R)||n(R))},hidden:"days"!==z,children:[
120
120
  /* @__PURE__ */ct("div",{role:"row",className:`${Ar} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
121
121
  /* @__PURE__ */ct("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */ct("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */ct("div",{role:"row",className:`${Ar} text-center text-sm`,children:E.slice(7*l,7*l+7).map(a=>{const l=jr(a),i=a.getMonth()!==S.getMonth(),o=l===e||"range"===r&&l===t,s=(n=>!("range"!==r||!e||!t)&&n>e&&n<t)(l),c=T(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=f.has(l)&&/* @__PURE__ */ct("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__ */
122
- return ct("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */st("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */st("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 Ir=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Or=e=>`${e.getFullYear()}-${Rr(e.getMonth()+1)}`,Rr=e=>String(e).padStart(2,"0");function Wr(e){return`${e.getFullYear()}-${Rr(e.getMonth()+1)}-${Rr(e.getDate())}`}function Kr(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:Wr(new Date(r,n,t.getDate()-14)),to:Wr(a)};case"lastMonth":return{from:Wr(i(1)),to:Wr(l)};case"last3Months":return{from:Wr(i(3)),to:Wr(l)};case"last6Months":return{from:Wr(i(6)),to:Wr(l)};case"last12Months":return{from:Wr(i(12)),to:Wr(l)}}}function _r(e,t,r){const n=Or(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function qr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Hr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Ur=/* @__PURE__ */new Map;function Vr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":s,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:m,max:b,disabled:y=!1,allowOpenEnd:x=!1}){const v=$e().dateRange,w=Me(),N=n??(w?function(e){let t=Ur.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Ur.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):Hr),k=u??v.placeholder,$=a??!l,[M,C]=Ge(!1),[D,S]=Ge(e),[L,A]=Ge(t),[j,P]=Ge(null),[z,F]=Ge("from"),E=Xe(null),T=Xe(null),B=Xe(null),I=Ve(),O=Ve(),R=Ve(),[W,K]=Ge(!1),_=Y(E,M,{preferredMaxWidth:520,preferredMaxHeight:W?720:560,popupRef:B}),q=Xe(null),H=Xe(null),[U,V]=Ge(!0);pe(()=>{const e=H.current;if(!M||!W||!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!==U&&V(a)});const G=Xe(null);pe(()=>{const e=B.current;if(!M||!_||!e)return;const t=getComputedStyle(e),r=_.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(W)null!==G.current&&G.current<=r&&K(!1);else{const e=q.current?.offsetWidth??0;if(0===e)return;G.current=e,e>r+.5&&K(!0)}});const[X,Z]=Ge(!1);pe(()=>{const e=!!o&&(T.current?.labels?.length??0)>0;e!==X&&Z(e)});const J=!!c||!!s||X,Q=/* @__PURE__ */new Date,[ee,te]=Ge(()=>e?Or(qr(e)):_r(Q,m,b)),re=Ir.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Kr(e,Q),m,b)),ne=e=>e?N(e):"";Qe(()=>{if(!M)return;const e=e=>{const t=e.target;E.current?.contains(t)||B.current?.contains(t)||C(!1)};document.addEventListener("mousedown",e);const t=de(()=>C(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[M]),Qe(()=>{y&&C(!1)},[y]);const ae=()=>{r("",""),C(!1)},le=e&&t?`${ne(e)} — ${ne(t)}`:e?v.fromOnly(ne(e)):t?v.toOnly(ne(t)):"",ie=Be(w),se=e=>{const t=Pr(e);return t?ie.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},ce=e&&t?v.range(se(e),se(t)):e?v.fromOnly(se(e)):t?v.toOnly(se(t)):k,he=e=>W?"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"),fe=/* @__PURE__ */st(dt,{children:[re.map(e=>/* @__PURE__ */ct("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Kr(e,Q);S(t.from),A(t.to),P(e),te(t.from.slice(0,7))})(e),className:he(e),"aria-label":W?v[e]:void 0,children:W?U?v[e]:v[`${e}Short`]:v[e]},e)),
123
- /* @__PURE__ */ct("button",{type:"button",onClick:()=>P("Custom"),className:he("Custom"),children:v.custom})]}),ge=(e,t)=>x?/* @__PURE__ */ct("button",{type:"button","data-range-end":e,"aria-pressed":z===e,onClick:()=>F(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */ct("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),be=e=>x&&z===e?" ring-1 ring-blue-400":"",ye=
124
- /* @__PURE__ */ct(Br,{mode:"range",min:m,max:b,value:D||null,endValue:L||null,month:ee,onMonthChange:te,onSelect:e=>{P("Custom"),x?"from"===z?(L&&e>L?(S(L),A(e)):S(e),F("to")):D&&e<D?(A(D),S(e)):A(e):!D||D&&L?(S(e),A("")):e<D?(A(D),S(e)):A(e)},weekStartsOn:d,"aria-label":v.dialog});/* @__PURE__ */
125
- return st("div",{className:"relative"+(h?" w-full":""),ref:E,children:[
126
- /* @__PURE__ */st("div",{className:`${h?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?`${p} ${f}`:g}${y?" cursor-not-allowed opacity-60":""}`,children:[
127
- /* @__PURE__ */st("button",{ref:T,type:"button",onClick:()=>{y||(S(e),A(t),P(null),F(e&&!t?"to":"from"),te(e?Or(qr(e)):_r(Q,m,b)),C(!0))},"aria-haspopup":"dialog","aria-expanded":M,id:o,disabled:y||void 0,"aria-label":c,"aria-labelledby":s,"aria-describedby":[J?O:void 0,l?R:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":M?I:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
122
+ return ct("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */st("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */st("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 Ir=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],Or=e=>`${e.getFullYear()}-${Rr(e.getMonth()+1)}`,Rr=e=>String(e).padStart(2,"0");function Wr(e){return`${e.getFullYear()}-${Rr(e.getMonth()+1)}-${Rr(e.getDate())}`}function Kr(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:Wr(new Date(r,n,t.getDate()-14)),to:Wr(a)};case"lastMonth":return{from:Wr(i(1)),to:Wr(l)};case"last3Months":return{from:Wr(i(3)),to:Wr(l)};case"last6Months":return{from:Wr(i(6)),to:Wr(l)};case"last12Months":return{from:Wr(i(12)),to:Wr(l)}}}function _r(e,t,r){const n=Or(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function qr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function Hr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var Ur=/* @__PURE__ */new Map;function Vr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:o,"aria-labelledby":s,"aria-label":c,weekStartsOn:d,placeholder:u,fullWidth:h=!1,min:m,max:p,disabled:f=!1,allowOpenEnd:g=!1}){const b=$e().dateRange,y=Me(),x=n??(y?function(e){let t=Ur.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),Ur.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}}(y):Hr),v=u??b.placeholder,w=a??!l,[N,k]=Ge(!1),[$,M]=Ge(e),[C,D]=Ge(t),[S,L]=Ge(null),[A,j]=Ge("from"),P=Xe(null),z=Xe(null),F=Xe(null),E=Ve(),T=Ve(),B=Ve(),[I,K]=Ge(!1),_=Y(P,N,{preferredMaxWidth:520,preferredMaxHeight:I?720:560,popupRef:F}),q=Xe(null),H=Xe(null),[U,V]=Ge(!0);pe(()=>{const e=H.current;if(!N||!I||!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!==U&&V(a)});const G=Xe(null);pe(()=>{const e=F.current;if(!N||!_||!e)return;const t=getComputedStyle(e),r=_.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(I)null!==G.current&&G.current<=r&&K(!1);else{const e=q.current?.offsetWidth??0;if(0===e)return;G.current=e,e>r+.5&&K(!0)}});const[X,Z]=Ge(!1);pe(()=>{const e=!!o&&(z.current?.labels?.length??0)>0;e!==X&&Z(e)});const J=!!c||!!s||X,Q=/* @__PURE__ */new Date,[ee,te]=Ge(()=>e?Or(qr(e)):_r(Q,m,p)),re=Ir.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(Kr(e,Q),m,p)),ne=e=>e?x(e):"";Qe(()=>{if(!N)return;const e=e=>{const t=e.target;P.current?.contains(t)||F.current?.contains(t)||k(!1)};document.addEventListener("mousedown",e);const t=de(()=>k(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[N]),Qe(()=>{f&&k(!1)},[f]);const ae=()=>{r("",""),k(!1)},le=e&&t?`${ne(e)} — ${ne(t)}`:e?b.fromOnly(ne(e)):t?b.toOnly(ne(t)):"",ie=Be(y),se=e=>{const t=Pr(e);return t?ie.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},ce=e&&t?b.range(se(e),se(t)):e?b.fromOnly(se(e)):t?b.toOnly(se(t)):v,he=e=>I?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(S===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 "+(S===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),fe=/* @__PURE__ */st(dt,{children:[re.map(e=>/* @__PURE__ */ct("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=Kr(e,Q);M(t.from),D(t.to),L(e),te(t.from.slice(0,7))})(e),className:he(e),"aria-label":I?b[e]:void 0,children:I?U?b[e]:b[`${e}Short`]:b[e]},e)),
123
+ /* @__PURE__ */ct("button",{type:"button",onClick:()=>L("Custom"),className:he("Custom"),children:b.custom})]}),ge=(e,t)=>g?/* @__PURE__ */ct("button",{type:"button","data-range-end":e,"aria-pressed":A===e,onClick:()=>j(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */ct("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),be=e=>g&&A===e?" ring-1 ring-blue-400":"",ye=
124
+ /* @__PURE__ */ct(Br,{mode:"range",min:m,max:p,value:$||null,endValue:C||null,month:ee,onMonthChange:te,onSelect:e=>{L("Custom"),g?"from"===A?(C&&e>C?(M(C),D(e)):M(e),j("to")):$&&e<$?(D($),M(e)):D(e):!$||$&&C?(M(e),D("")):e<$?(D($),M(e)):D(e)},weekStartsOn:d,"aria-label":b.dialog});/* @__PURE__ */
125
+ return st("div",{className:"relative"+(h?" w-full":""),ref:P,children:[
126
+ /* @__PURE__ */st("div",{className:`${h?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${e||t?`${O} ${R}`:W}${f?" cursor-not-allowed opacity-60":""}`,children:[
127
+ /* @__PURE__ */st("button",{ref:z,type:"button",onClick:()=>{f||(M(e),D(t),L(null),j(e&&!t?"to":"from"),te(e?Or(qr(e)):_r(Q,m,p)),k(!0))},"aria-haspopup":"dialog","aria-expanded":N,id:o,disabled:f||void 0,"aria-label":c,"aria-labelledby":s,"aria-describedby":[J?T:void 0,l?B:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":N?E:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(h?" min-w-0 flex-1 justify-start":""),children:[
128
128
  /* @__PURE__ */ct(xe,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
129
- /* @__PURE__ */ct("span",{className:"truncate",children:le||k})]}),$&&!y&&(e||t)&&/* @__PURE__ */ct("button",{type:"button",onClick:ae,"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:"×"})]}),J&&/* @__PURE__ */ct("span",{id:O,className:"sr-only",children:ce}),l&&/* @__PURE__ */ct("span",{id:R,className:"sr-only",children:v.required}),i&&/* @__PURE__ */st(dt,{children:[
130
- /* @__PURE__ */ct("input",{type:"hidden",name:i.from,value:e,disabled:y||void 0}),
131
- /* @__PURE__ */ct("input",{type:"hidden",name:i.to,value:t,disabled:y||void 0})]}),M&&ut(
132
- /* @__PURE__ */st("div",{ref:B,id:I,role:"dialog","aria-label":v.dialog,"data-layout":W?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:ue.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,width:W&&_?_.maxWidth:"max-content",maxWidth:_?.maxWidth,maxHeight:_?.maxHeight,overflowY:"auto",visibility:_?void 0:"hidden",...oe()},children:[
133
- /* @__PURE__ */st("div",{className:W?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[ge("from",/* @__PURE__ */st(dt,{children:[
134
- /* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:v.from}),
135
- /* @__PURE__ */ct("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"}${be("from")}`,children:D?ne(D):v.start})]})),!W&&/* @__PURE__ */ct("span",{className:"text-gray-300",children:"—"}),ge("to",/* @__PURE__ */st(dt,{children:[
136
- /* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:v.to}),
137
- /* @__PURE__ */ct("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${L?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${be("to")}`,children:L?ne(L):v.end})]}))]}),W?/* @__PURE__ */st(dt,{children:[re.length>0&&/* @__PURE__ */st("div",{className:"mb-3 @container",children:[!U&&/* @__PURE__ */ct("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:v.lastHeading}),
138
- /* @__PURE__ */st("div",{ref:H,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[fe,re.map(e=>/* @__PURE__ */ct("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:v[e]},e))]})]}),
129
+ /* @__PURE__ */ct("span",{className:"truncate",children:le||v})]}),w&&!f&&(e||t)&&/* @__PURE__ */ct("button",{type:"button",onClick:ae,"aria-label":b.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:"×"})]}),J&&/* @__PURE__ */ct("span",{id:T,className:"sr-only",children:ce}),l&&/* @__PURE__ */ct("span",{id:B,className:"sr-only",children:b.required}),i&&/* @__PURE__ */st(dt,{children:[
130
+ /* @__PURE__ */ct("input",{type:"hidden",name:i.from,value:e,disabled:f||void 0}),
131
+ /* @__PURE__ */ct("input",{type:"hidden",name:i.to,value:t,disabled:f||void 0})]}),N&&ut(
132
+ /* @__PURE__ */st("div",{ref:F,id:E,role:"dialog","aria-label":b.dialog,"data-layout":I?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:ue.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,width:I&&_?_.maxWidth:"max-content",maxWidth:_?.maxWidth,maxHeight:_?.maxHeight,overflowY:"auto",visibility:_?void 0:"hidden",...oe()},children:[
133
+ /* @__PURE__ */st("div",{className:I?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[ge("from",/* @__PURE__ */st(dt,{children:[
134
+ /* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:b.from}),
135
+ /* @__PURE__ */ct("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${$?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${be("from")}`,children:$?ne($):b.start})]})),!I&&/* @__PURE__ */ct("span",{className:"text-gray-300",children:"—"}),ge("to",/* @__PURE__ */st(dt,{children:[
136
+ /* @__PURE__ */ct("span",{className:"text-xs font-medium text-gray-500",children:b.to}),
137
+ /* @__PURE__ */ct("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${C?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${be("to")}`,children:C?ne(C):b.end})]}))]}),I?/* @__PURE__ */st(dt,{children:[re.length>0&&/* @__PURE__ */st("div",{className:"mb-3 @container",children:[!U&&/* @__PURE__ */ct("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:b.lastHeading}),
138
+ /* @__PURE__ */st("div",{ref:H,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[fe,re.map(e=>/* @__PURE__ */ct("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:b[e]},e))]})]}),
139
139
  /* @__PURE__ */ct("div",{className:"w-full",children:ye})]}):
140
140
  /* @__PURE__ */st("div",{ref:q,className:"flex w-max gap-4",children:[
141
141
  /* @__PURE__ */ct("div",{className:"w-64",children:ye}),re.length>0&&/* @__PURE__ */ct("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:fe})]}),
142
- /* @__PURE__ */st("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[$&&/* @__PURE__ */ct("button",{type:"button",onClick:ae,className:me({variant:"ghost"}),children:v.clear}),
143
- /* @__PURE__ */ct("button",{type:"button",onClick:()=>C(!1),className:me({variant:"secondary"}),children:v.cancel}),
144
- /* @__PURE__ */ct("button",{type:"button",onClick:()=>{r(D,L),C(!1)},disabled:x?!D&&!L:!D||!L,className:me({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var Yr=/^\d{2}:\d{2}(:\d{2})?$/,Gr=e=>String(e).padStart(2,"0");function Xr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Gr(e.getHours())}:${Gr(e.getMinutes())}`;return t?`${r}:${Gr(e.getSeconds())}`:r}return Yr.test(e)?e:""}var Zr=Ue(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:o,...s},c){const d=null!=o&&Number(o)<60,u=Me();/* @__PURE__ */
145
- return ct("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:Xr(e,d),min:Xr(r,d)||void 0,max:Xr(n,d)||void 0,onChange:e=>t?.(Yr.test(e.target.value)?e.target.value:null),className:h({invalid:a,size:l,className:i}),...s})}),Jr=/^\d{4}-\d{2}-\d{2}$/,Qr=/^(aria|data)-/,en=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function tn(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Wr(e);if(Jr.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Wr(t)}function rn(e){if(!Jr.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 nn(e,t){const r=rn(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var an=Ue(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:i,weekStartsOn:o,className:s="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:p,name:f,disabled:g,placeholder:b,required:y,clearable:x,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C},D){const S=x??!y,L=tn(e),A=tn(r),j=tn(n),P=$e().datePicker,z=Me(),F=Be(z),[E,T]=Ge(!1),B=Xe(null),I=Xe(null),O=Xe(null),R=Ve(),W=Ve(),K=Ve(),_=Y(I,E,{popupRef:O}),[q,H]=Ge(!1);pe(()=>{const e=!!p&&(I.current?.labels?.length??0)>0;e!==q&&H(e)});const U=!c&&(!!u||q);if(Qe(()=>{if(!E)return;const e=e=>{const t=e.target;B.current?.contains(t)||O.current?.contains(t)||T(!1)};document.addEventListener("pointerdown",e,!0);const t=de(()=>T(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[E]),Qe(()=>{if(E)return ce(e=>"Escape"===e.key&&(T(!1),I.current?.focus(),!0),()=>O.current)},[E]),i)/* @__PURE__ */
146
- return ct("input",{ref:D,type:"date",lang:z,id:p,name:f,disabled:g,"aria-label":c,"aria-describedby":d,"aria-invalid":a||void 0,value:L,min:A||void 0,max:j||void 0,onChange:e=>t?.(rn(e.target.value)),className:h({invalid:a,size:l,className:s}),"aria-labelledby":u,required:y,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C});const V=Object.fromEntries(Object.entries(C).filter(([e])=>Qr.test(e)&&!en.has(e))),G=C["aria-required"],X=!!y||!0===G||"true"===G,Z=[U?W:void 0,X?K:void 0,d].filter(Boolean).join(" ")||void 0,J=Wr(/* @__PURE__ */new Date),Q=(!A||J>=A)&&(!j||J<=j),ee=b??P.placeholder;/* @__PURE__ */
147
- return st("div",{ref:B,className:"relative",children:[
148
- /* @__PURE__ */ct("input",{ref:D,type:"hidden",name:f,form:v,value:L}),
149
- /* @__PURE__ */st("button",{ref:I,type:"button",...V,id:p,disabled:g,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?R:void 0,"aria-labelledby":u,"aria-describedby":Z,"aria-label":c?`${c}${L?`, ${nn(L,F)}`:""}`:void 0,onClick:()=>T(e=>!e),className:`${h({invalid:a,size:l,className:s})} flex items-center justify-between text-left`,children:[
150
- /* @__PURE__ */ct("span",{className:L?"text-gray-900":"text-gray-400",children:L?nn(L,F):ee}),
151
- /* @__PURE__ */ct(xe,{name:"date",className:`h-4 w-4 shrink-0 ${m}`,strokeWidth:"1.75","aria-hidden":"true"})]}),U&&/* @__PURE__ */ct("span",{id:W,className:"sr-only",children:L?nn(L,F):ee}),X&&/* @__PURE__ */ct("span",{id:K,className:"sr-only",children:P.required}),E&&ut(
152
- /* @__PURE__ */st("div",{ref:O,id:R,role:"dialog","aria-label":c??P.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:ue.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,maxWidth:_?.maxWidth,visibility:_?void 0:"hidden"},children:[
153
- /* @__PURE__ */ct(Br,{value:L||null,min:A||null,max:j||null,weekStartsOn:o,onSelect:e=>{T(!1),I.current?.focus(),t?.(rn(e))}}),(S||Q)&&/* @__PURE__ */st("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[S&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>{T(!1),I.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:P.clear}),Q&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>{T(!1),I.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:P.today})]})]}),document.body)]})}),ln=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,on=e=>String(e).padStart(2,"0");function sn(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${on(t.getMonth()+1)}-${on(t.getDate())}T${on(t.getHours())}:${on(t.getMinutes())}`:ln.test(e)?e:"";var t}var cn=Ue(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=Me();/* @__PURE__ */
154
- return ct("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:sn(e),min:sn(r)||void 0,max:sn(n)||void 0,onChange:e=>t?.(function(e){if(!ln.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:h({invalid:a,size:l,className:i}),...o})});function dn(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 un(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 hn(e,t,r){const n=await un(t,r),a=De().copy;return n?w.success(a.copiedLabel(e)):w.error(a.failed),n}var mn={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},pn={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 fn(){/* @__PURE__ */
142
+ /* @__PURE__ */st("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[w&&/* @__PURE__ */ct("button",{type:"button",onClick:ae,className:me({variant:"ghost"}),children:b.clear}),
143
+ /* @__PURE__ */ct("button",{type:"button",onClick:()=>k(!1),className:me({variant:"secondary"}),children:b.cancel}),
144
+ /* @__PURE__ */ct("button",{type:"button",onClick:()=>{r($,C),k(!1)},disabled:g?!$&&!C:!$||!C,className:me({variant:"primary"}),children:b.apply})]})]}),document.body)]})}var Yr=/^\d{2}:\d{2}(:\d{2})?$/,Gr=e=>String(e).padStart(2,"0");function Xr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${Gr(e.getHours())}:${Gr(e.getMinutes())}`;return t?`${r}:${Gr(e.getSeconds())}`:r}return Yr.test(e)?e:""}var Zr=Ue(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",step:o,...s},c){const d=null!=o&&Number(o)<60,u=Me();/* @__PURE__ */
145
+ return ct("input",{ref:c,type:"time",lang:u,step:o,"aria-invalid":a||void 0,value:Xr(e,d),min:Xr(r,d)||void 0,max:Xr(n,d)||void 0,onChange:e=>t?.(Yr.test(e.target.value)?e.target.value:null),className:B({invalid:a,size:l,className:i}),...s})}),Jr=/^\d{4}-\d{2}-\d{2}$/,Qr=/^(aria|data)-/,en=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function tn(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":Wr(e);if(Jr.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":Wr(t)}function rn(e){if(!Jr.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 nn(e,t){const r=rn(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var an=Ue(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,native:i,weekStartsOn:o,className:s="","aria-label":c,"aria-describedby":d,"aria-labelledby":u,id:h,name:m,disabled:p,placeholder:f,required:g,clearable:b,form:y,title:x,tabIndex:v,autoFocus:w,onFocus:N,onBlur:k,...$},M){const C=b??!g,D=tn(e),S=tn(r),L=tn(n),A=$e().datePicker,j=Me(),P=Be(j),[z,F]=Ge(!1),E=Xe(null),T=Xe(null),O=Xe(null),R=Ve(),W=Ve(),K=Ve(),_=Y(T,z,{popupRef:O}),[q,H]=Ge(!1);pe(()=>{const e=!!h&&(T.current?.labels?.length??0)>0;e!==q&&H(e)});const U=!c&&(!!u||q);if(Qe(()=>{if(!z)return;const e=e=>{const t=e.target;E.current?.contains(t)||O.current?.contains(t)||F(!1)};document.addEventListener("pointerdown",e,!0);const t=de(()=>F(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[z]),Qe(()=>{if(z)return ce(e=>"Escape"===e.key&&(F(!1),T.current?.focus(),!0),()=>O.current)},[z]),i)/* @__PURE__ */
146
+ return ct("input",{ref:M,type:"date",lang:j,id:h,name:m,disabled:p,"aria-label":c,"aria-describedby":d,"aria-invalid":a||void 0,value:D,min:S||void 0,max:L||void 0,onChange:e=>t?.(rn(e.target.value)),className:B({invalid:a,size:l,className:s}),"aria-labelledby":u,required:g,form:y,title:x,tabIndex:v,autoFocus:w,onFocus:N,onBlur:k,...$});const V=Object.fromEntries(Object.entries($).filter(([e])=>Qr.test(e)&&!en.has(e))),G=$["aria-required"],X=!!g||!0===G||"true"===G,Z=[U?W:void 0,X?K:void 0,d].filter(Boolean).join(" ")||void 0,J=Wr(/* @__PURE__ */new Date),Q=(!S||J>=S)&&(!L||J<=L),ee=f??A.placeholder;/* @__PURE__ */
147
+ return st("div",{ref:E,className:"relative",children:[
148
+ /* @__PURE__ */ct("input",{ref:M,type:"hidden",name:m,form:y,value:D}),
149
+ /* @__PURE__ */st("button",{ref:T,type:"button",...V,id:h,disabled:p,title:x,tabIndex:v,autoFocus:w,onFocus:N,onBlur:k,"aria-haspopup":"dialog","aria-expanded":z,"aria-controls":z?R:void 0,"aria-labelledby":u,"aria-describedby":Z,"aria-label":c?`${c}${D?`, ${nn(D,P)}`:""}`:void 0,onClick:()=>F(e=>!e),className:`${B({invalid:a,size:l,className:s})} flex items-center justify-between text-left`,children:[
150
+ /* @__PURE__ */ct("span",{className:D?"text-gray-900":"text-gray-400",children:D?nn(D,P):ee}),
151
+ /* @__PURE__ */ct(xe,{name:"date",className:`h-4 w-4 shrink-0 ${I}`,strokeWidth:"1.75","aria-hidden":"true"})]}),U&&/* @__PURE__ */ct("span",{id:W,className:"sr-only",children:D?nn(D,P):ee}),X&&/* @__PURE__ */ct("span",{id:K,className:"sr-only",children:A.required}),z&&ut(
152
+ /* @__PURE__ */st("div",{ref:O,id:R,role:"dialog","aria-label":c??A.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:ue.popup,left:_?.left,right:_?.right,top:_?.top,bottom:_?.bottom,maxWidth:_?.maxWidth,visibility:_?void 0:"hidden"},children:[
153
+ /* @__PURE__ */ct(Br,{value:D||null,min:S||null,max:L||null,weekStartsOn:o,onSelect:e=>{F(!1),T.current?.focus(),t?.(rn(e))}}),(C||Q)&&/* @__PURE__ */st("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[C&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>{F(!1),T.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:A.clear}),Q&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>{F(!1),T.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:A.today})]})]}),document.body)]})}),ln=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,on=e=>String(e).padStart(2,"0");function sn(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${on(t.getMonth()+1)}-${on(t.getDate())}T${on(t.getHours())}:${on(t.getMinutes())}`:ln.test(e)?e:"";var t}var cn=Ue(function({value:e,onChange:t,min:r,max:n,invalid:a,size:l,className:i="",...o},s){const c=Me();/* @__PURE__ */
154
+ return ct("input",{ref:s,type:"datetime-local",lang:c,"aria-invalid":a||void 0,value:sn(e),min:sn(r)||void 0,max:sn(n)||void 0,onChange:e=>t?.(function(e){if(!ln.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:B({invalid:a,size:l,className:i}),...o})});function dn(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 un(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 hn(e,t,r){const n=await un(t,r),a=De().copy;return n?s.success(a.copiedLabel(e)):s.error(a.failed),n}var mn={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},pn={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 fn(){/* @__PURE__ */
155
155
  return ct(xe,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function gn(){/* @__PURE__ */
156
- return ct(xe,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function bn({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:c,"aria-describedby":d,className:h=""}){const[m,p]=Ge(!1),f=Xe(null),g=$e().copy;Qe(()=>()=>{f.current&&clearTimeout(f.current)},[]);const b=Je(async()=>{await un(e)?(p(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{p(!1),f.current=null},2e3),o?.(e)):w.error(g.failed)},[e,o,g]),{box:y,button:x}=pn[a],v=!i;/* @__PURE__ */
157
- return st("div",{id:v?void 0:c,"aria-describedby":v?void 0:d,className:["inline-flex max-w-full items-center rounded-md",mn[l],y,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
158
- /* @__PURE__ */ct("span",{className:"min-w-0 font-mono text-gray-800 "+(s?"whitespace-pre-wrap break-all":"truncate"),title:s?void 0:e,children:t??e}),!i&&/* @__PURE__ */st(dt,{children:[
159
- /* @__PURE__ */ct(u,{id:c,"aria-label":n?g.copyLabel(n):g.copy,"aria-describedby":d,onClick:b,className:`${x} text-gray-400`,children:/* @__PURE__ */ct(m?gn:fn,{})}),
156
+ return ct(xe,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function bn({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:c=!1,id:d,"aria-describedby":u,className:h=""}){const[m,p]=Ge(!1),f=Xe(null),g=$e().copy;Qe(()=>()=>{f.current&&clearTimeout(f.current)},[]);const b=Je(async()=>{await un(e)?(p(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{p(!1),f.current=null},2e3),o?.(e)):s.error(g.failed)},[e,o,g]),{box:y,button:x}=pn[a],v=!i;/* @__PURE__ */
157
+ return st("div",{id:v?void 0:d,"aria-describedby":v?void 0:u,className:["inline-flex max-w-full items-center rounded-md",mn[l],y,h].filter(Boolean).join(" "),children:[null!=r&&""!==r&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:r}),
158
+ /* @__PURE__ */ct("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}),!i&&/* @__PURE__ */st(dt,{children:[
159
+ /* @__PURE__ */ct(T,{id:d,"aria-label":n?g.copyLabel(n):g.copy,"aria-describedby":u,onClick:b,className:`${x} text-gray-400`,children:/* @__PURE__ */ct(m?gn:fn,{})}),
160
160
  /* @__PURE__ */ct("span",{"aria-live":"polite",className:"sr-only",children:m?g.copied:""})]})]})}var yn=2;function xn(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 vn(e){return e.slice(0,-1)}var wn=["1","2","3","4","5","6","7","8","9",".","0"];function Nn({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=$e().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
161
161
  return st("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[wn.map(t=>/* @__PURE__ */ct(U,{size:"touch-xl",variant:"secondary",onClick:()=>o(xn(e,t)),children:t},t)),
162
162
  /* @__PURE__ */ct(U,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(vn(e)),children:"⌫"}),r&&/* @__PURE__ */ct(U,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var kn={md:"h-24 p-3",lg:"h-32 p-4"},$n=Ue(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
163
163
  return st("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)]",kn[r],i].filter(Boolean).join(" "),...o,children:[
164
- /* @__PURE__ */ct("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */ct("span",{className:"text-sm text-gray-500",children:t})]})}),Mn=/(^|[\s:])!?z-/;function Cn({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":f,disabled:g,className:b="",triggerClassName:y,panelClassName:x=""}){const[v,w]=Ge(s),N=(o??v)&&!g,k=ge(),$=Xe(null),M=Xe(null),C=Xe(null),D=Xe(null),S=Ve(),j=m??S,P=Ve(),z=Ve(),E=Ve(),T=Xe(null),B=Xe(!1),I=Xe({openProp:o,onOpenChange:c});I.current={openProp:o,onOpenChange:c};const O=Je(e=>{void 0===I.current.openProp&&w(e),I.current.onOpenChange?.(e)},[]),R=Je((e=!1)=>{B.current=e,O(!1)},[O]),W=e=>{T.current=e.nativeEvent},K=Je(()=>{const e=C.current,t=M.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=Z(t),a=Math.max(0,n.right-n.left-2*Q),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=X({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]);pe(()=>{N&&k&&K()}),Qe(()=>{if(!N||!k)return;const e=J(()=>M.current,K),t=D.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>K());return r.observe(t),()=>{e(),r.disconnect()}},[N,k,K]),Qe(()=>{if(!N)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(T.current===e)return!1;const t=e.target;return!(t&&($.current?.contains(t)||C.current?.contains(t)))})(e)&&R(!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=de(()=>R()),a=ce(e=>"Escape"===e.key&&(R(),M.current?.focus(),!0),()=>C.current);return()=>{t(),r(),n(),a()}},[N,R]),L(C,N&&k),pe(()=>{if(!N||!k)return;const e=C.current;return()=>{if(B.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||M.current?.focus({preventScroll:!0})}},[N,k]),Qe(()=>{if(!N||!k)return;const e=C.current;e&&(B.current=!1,(h?.current??A(e)[0]??e).focus({preventScroll:!0}))},[N,k]);const _="function"==typeof t?t({close:()=>R()}):t,q=r?{"aria-labelledby":z}:a?{"aria-label":a}:{"aria-labelledby":j};/* @__PURE__ */
165
- return st("div",{ref:$,className:`relative inline-flex ${b}`.trim(),children:[
166
- /* @__PURE__ */ct("button",{ref:M,id:j,type:"button","aria-haspopup":"dialog","aria-expanded":N,"aria-controls":N&&k?P:void 0,"aria-label":p,"aria-describedby":f,disabled:g,onClick:()=>N?R():O(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!N)return;const t=(()=>{const e=C.current;return e?A(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:y??me({variant:"secondary"}),children:e}),N&&k&&ut(
167
- /* @__PURE__ */ct("div",{ref:C,id:P,role:"dialog",...q,"aria-describedby":n?E:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:W,onFocusCapture:W,onKeyDown:e=>{const t=C.current,r=M.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=A(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=F(r,t);R(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${x}`.trim(),style:Mn.test(x)?void 0:{zIndex:ue.popup},children:/* @__PURE__ */st("div",{ref:D,children:[r&&/* @__PURE__ */ct("h2",{id:z,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */ct("p",{id:E,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */ct("div",{className:"mt-3",children:_}):_]})}),document.body)]})}var Dn={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function Sn({value:e,onChange:t,options:r,label:n,emptyValue:a,columns:l=5,disabled:i=!1,className:o=""}){const s=$e(),c=s.iconPicker,d=s.iconNames,h=e=>e.label??d[e.value]??e.value,m=Xe([]),p=Math.max(0,r.findIndex(t=>t.value===e)),f=r[p],g=f?.value===a,b=Xe(null);/* @__PURE__ */
168
- return ct(Cn,{className:o,disabled:i,triggerLabel:f?c.button(n,h(f)):n,"aria-label":n,initialFocus:b,panelClassName:"!p-2",trigger:/* @__PURE__ */st("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */ct("span",g||!f?{className:"text-sm",children:f?h(f):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:f.icon}),
164
+ /* @__PURE__ */ct("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */ct("span",{className:"text-sm text-gray-500",children:t})]})}),Mn=/(^|[\s:])!?z-/;function Cn({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":f,disabled:y,className:x="",triggerClassName:v,panelClassName:N=""}){const[k,$]=Ge(s),M=(o??k)&&!y,C=ge(),D=Xe(null),S=Xe(null),L=Xe(null),A=Xe(null),j=Ve(),P=m??j,z=Ve(),F=Ve(),E=Ve(),T=Xe(null),B=Xe(!1),I=Xe({openProp:o,onOpenChange:c});I.current={openProp:o,onOpenChange:c};const O=Je(e=>{void 0===I.current.openProp&&$(e),I.current.onOpenChange?.(e)},[]),R=Je((e=!1)=>{B.current=e,O(!1)},[O]),W=e=>{T.current=e.nativeEvent},K=Je(()=>{const e=L.current,t=S.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=Z(t),a=Math.max(0,n.right-n.left-2*Q),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=X({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]);pe(()=>{M&&C&&K()}),Qe(()=>{if(!M||!C)return;const e=J(()=>S.current,K),t=A.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>K());return r.observe(t),()=>{e(),r.disconnect()}},[M,C,K]),Qe(()=>{if(!M)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(T.current===e)return!1;const t=e.target;return!(t&&(D.current?.contains(t)||L.current?.contains(t)))})(e)&&R(!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=de(()=>R()),a=ce(e=>"Escape"===e.key&&(R(),S.current?.focus(),!0),()=>L.current);return()=>{t(),r(),n(),a()}},[M,R]),g(L,M&&C),pe(()=>{if(!M||!C)return;const e=L.current;return()=>{if(B.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||S.current?.focus({preventScroll:!0})}},[M,C]),Qe(()=>{if(!M||!C)return;const e=L.current;e&&(B.current=!1,(h?.current??b(e)[0]??e).focus({preventScroll:!0}))},[M,C]);const _="function"==typeof t?t({close:()=>R()}):t,q=r?{"aria-labelledby":F}:a?{"aria-label":a}:{"aria-labelledby":P};/* @__PURE__ */
165
+ return st("div",{ref:D,className:`relative inline-flex ${x}`.trim(),children:[
166
+ /* @__PURE__ */ct("button",{ref:S,id:P,type:"button","aria-haspopup":"dialog","aria-expanded":M,"aria-controls":M&&C?z:void 0,"aria-label":p,"aria-describedby":f,disabled:y,onClick:()=>M?R():O(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!M)return;const t=(()=>{const e=L.current;return e?b(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:v??me({variant:"secondary"}),children:e}),M&&C&&ut(
167
+ /* @__PURE__ */ct("div",{ref:L,id:z,role:"dialog",...q,"aria-describedby":n?E:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:W,onFocusCapture:W,onKeyDown:e=>{const t=L.current,r=S.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=w(r,t);R(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${N}`.trim(),style:Mn.test(N)?void 0:{zIndex:ue.popup},children:/* @__PURE__ */st("div",{ref:A,children:[r&&/* @__PURE__ */ct("h2",{id:F,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */ct("p",{id:E,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */ct("div",{className:"mt-3",children:_}):_]})}),document.body)]})}var Dn={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function Sn({value:e,onChange:t,options:r,label:n,emptyValue:a,columns:l=5,disabled:i=!1,className:o=""}){const s=$e(),c=s.iconPicker,d=s.iconNames,u=e=>e.label??d[e.value]??e.value,h=Xe([]),m=Math.max(0,r.findIndex(t=>t.value===e)),p=r[m],f=p?.value===a,g=Xe(null);/* @__PURE__ */
168
+ return ct(Cn,{className:o,disabled:i,triggerLabel:p?c.button(n,u(p)):n,"aria-label":n,initialFocus:g,panelClassName:"!p-2",trigger:/* @__PURE__ */st("span",{className:"inline-flex items-center gap-2",children:[/* @__PURE__ */ct("span",f||!p?{className:"text-sm",children:p?u(p):""}:{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:p.icon}),
169
169
  /* @__PURE__ */ct(xe,{name:"chevron-down",className:"h-4 w-4"})]}),children:({close:a})=>/* @__PURE__ */ct("div",{role:"listbox","aria-label":n,className:"grid gap-1",style:{gridTemplateColumns:`repeat(${l}, 2rem)`},children:r.map((n,i)=>{const o=n.value===e;/* @__PURE__ */
170
- return ct(V,{content:h(n),children:/* @__PURE__ */ct(u,{ref:e=>{m.current[i]=e,i===p&&(b.current=e)},role:"option","aria-selected":o,"aria-label":h(n),pressed:o,tabIndex:i===p?0:-1,onKeyDown:e=>((e,t)=>{const n=Dn[t.key];if(!n)return;t.preventDefault();const a=Math.floor(e/l)+n[0],i=e%l+n[1];if(a<0||i<0||i>=l)return;const o=a*l+i;if(!(o>=r.length)){for(const[e,t]of m.current.entries())t?.setAttribute("tabindex",e===o?"0":"-1");m.current[o]?.focus()}})(i,e),onClick:()=>{t(n.value),a()},children:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}function Ln(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var An=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function jn({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Xe(a);l.current=a;const i=Xe({}),o=Je(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Qe(()=>o,[o]),Qe(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */ct(xe,{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}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */ct("button",{type:"button",...c,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:s}):/* @__PURE__ */ct(u,{size:"sm",...c,children:s})}var Pn=Ue(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:o,readOnly:s,invalid:c,placeholder:d,size:u,prefix:m,suffix:p,id:f,name:g,className:b="",onBlur:y,onFocus:x,steppers:v,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:D,"aria-label":S,"aria-labelledby":L,"aria-describedby":A,auto:j,...P},z){const F="bare"===$,E=kt(),T=j??E,B=Ve(),I="string"==typeof p&&""!==p.trim()?p.trim():void 0,O=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,I),R=Object.fromEntries(Object.entries(P).filter(([e])=>e.startsWith("data-"))),W=$e(),[K,_]=Ge(()=>An(e,a)),q=Xe(K);q.current=K;const H=Xe(null),U=Je(e=>{H.current=e,"function"==typeof z?z(e):z&&(z.current=e)},[z]),V=Xe(e),Y=Xe(e);Y.current=e;const G=Boolean(o||s),X=wt(),Z=v??(!!X&&"compact"),J="compact"===Z;Qe(()=>{O(q.current)!==e&&_(An(e,a))},[e,a]);const Q=e=>{if(G)return;let i=(O(q.current)??w??(d?O(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const o=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(o));const s=An(i,a);q.current=s,_(s),t(i),ie()},ee=Xe(Q);ee.current=Q;const te=Xe({unit:l??1,big:i??10*(l??1),locked:G});te.current={unit:l??1,big:i??10*(l??1),locked:G},Qe(()=>{const e=H.current;if(!e)return;const t=t=>{const{unit:r,big:n,locked:a}=te.current;if(a||e.ownerDocument.activeElement!==e)return;const l=t.deltaY||t.deltaX;l&&(t.preventDefault(),ee.current((l<0?1:-1)*(t.shiftKey?n:r)))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]);const[re,ne]=Ge(!1),[ae,le]=Ge(0),ie=()=>{F&&le(e=>e+1)};Qe(()=>{F&&re&&document.activeElement===H.current&&H.current?.select()},[F,re,ae]);const oe=Xe(!1);Qe(()=>{if(re&&!G)return ce(e=>{if("Escape"!==e.key||document.activeElement!==H.current)return!1;const r=V.current;if(O(q.current)===r)return!1;const n=An(r,a);return q.current=n,_(n),Y.current!==r&&(D??t)(r),ie(),!0})},[re,G,a,t,D]);const se=()=>{const e=O(q.current);if(null==e){if(!k){const e=An(Y.current,a);return q.current=e,_(e),Y.current}return q.current="",_(""),null!==Y.current&&t(null),null}let i=e;const o=a??(N?Math.max(Ln(l??1),Ln(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=An(i,a);return q.current=s,_(s),i===e&&i===Y.current||t(i),i},de=/* @__PURE__ */ct("input",{ref:U,id:f,"data-number-input":"",name:g,type:"text",inputMode:0===a?"numeric":"decimal",value:!re&&M?M(e):K,disabled:o,readOnly:s,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?d||void 0:`${An(e,a)}${F&&I?I:""}`,"aria-describedby":[A,T?B:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":F?"bare":void 0,...R,autoComplete:F?"off":void 0,spellCheck:!F&&void 0,"aria-invalid":c||void 0,"aria-label":S,"aria-labelledby":L,onChange:e=>(e=>{if(s)return;const r=I&&e.trimEnd().endsWith(I)?e.trimEnd().slice(0,-I.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(_(e),!C)return;const n=O(e);(null!==n||k)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!G)return V.current=se(),void ie();const t=l??1,r=i??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||G||(e.preventDefault(),Q(n))},onFocus:()=>{V.current=Y.current,ne(!0),oe.current=!0,x?.()},onMouseUp:F?e=>{oe.current&&(oe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{ne(!1),oe.current=!1,se(),y?.()},className:F?["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)]",re?"bg-white":"bg-transparent",G?"cursor-default":"cursor-text",b].filter(Boolean).join(" "):h({invalid:c,size:u,readOnly:s,auto:T,className:[m?"pl-6":"",J?p?"pr-10":"pr-6":Z?p?"pr-24":"pr-16":p?"pr-10":"","text-left tabular-nums",b].filter(Boolean).join(" ")})}),ue=T?/* @__PURE__ */ct("span",{id:B,hidden:!0,children:W.settingView.auto}):null;if(F||!m&&!p&&!Z)return ue?/* @__PURE__ */st(dt,{children:[de,ue]}):de;const he=O(K);/* @__PURE__ */
171
- return st("div",{className:"relative","data-number-box":"",children:[m&&/* @__PURE__ */ct("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),de,ue,p&&/* @__PURE__ */ct("span",{className:`pointer-events-none absolute ${J?"right-6":Z?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-gray-500`,children:p}),Z&&(()=>{const e=/* @__PURE__ */ct(jn,{dir:-1,compact:J,label:W.number.decrease,disabled:G||null!=r&&null!=he&&he<=r,onStep:e=>ee.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */ct(jn,{dir:1,compact:J,label:W.number.increase,disabled:G||null!=n&&null!=he&&he>=n,onStep:e=>ee.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
170
+ return ct(V,{content:u(n),children:/* @__PURE__ */ct(T,{ref:e=>{h.current[i]=e,i===m&&(g.current=e)},role:"option","aria-selected":o,"aria-label":u(n),pressed:o,tabIndex:i===m?0:-1,onKeyDown:e=>((e,t)=>{const n=Dn[t.key];if(!n)return;t.preventDefault();const a=Math.floor(e/l)+n[0],i=e%l+n[1];if(a<0||i<0||i>=l)return;const o=a*l+i;if(!(o>=r.length)){for(const[e,t]of h.current.entries())t?.setAttribute("tabindex",e===o?"0":"-1");h.current[o]?.focus()}})(i,e),onClick:()=>{t(n.value),a()},children:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"inline-flex [&_svg]:h-4 [&_svg]:w-4",children:n.icon})})},n.value)})})})}function Ln(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var An=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function jn({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Xe(a);l.current=a;const i=Xe({}),o=Je(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Qe(()=>o,[o]),Qe(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */ct(xe,{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}),c={tabIndex:-1,"aria-label":r,disabled:n,onPointerDown:e=>{if(0!==e.button||n)return;e.preventDefault(),o();const t=e.shiftKey;l.current(t);const r=e.currentTarget.ownerDocument.defaultView??window;r.addEventListener("pointerup",o),i.current={off:()=>r.removeEventListener("pointerup",o),wait:setTimeout(()=>{i.current.every=setInterval(()=>l.current(t),60)},400)}},onPointerLeave:o,onPointerCancel:o,onClick:e=>{0===e.detail&&l.current(e.shiftKey)}};return t?/* @__PURE__ */ct("button",{type:"button",...c,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:s}):/* @__PURE__ */ct(T,{size:"sm",...c,children:s})}var Pn=Ue(function({value:e,onChange:t,min:r,max:n,precision:a,step:l,shiftStep:i,disabled:o,readOnly:s,invalid:c,placeholder:d,size:u,prefix:h,suffix:m,id:p,name:f,className:g="",onBlur:b,onFocus:y,steppers:x,stepFrom:v,snap:w=!1,allowEmpty:N=!0,appearance:k="box",display:$,reportWhileTyping:M=!0,onRevert:C,"aria-label":D,"aria-labelledby":S,"aria-describedby":L,auto:A,...j},P){const z="bare"===k,F=kt(),E=A??F,T=Ve(),I="string"==typeof m&&""!==m.trim()?m.trim():void 0,O=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,I),R=Object.fromEntries(Object.entries(j).filter(([e])=>e.startsWith("data-"))),W=$e(),[K,_]=Ge(()=>An(e,a)),q=Xe(K);q.current=K;const H=Xe(null),U=Je(e=>{H.current=e,"function"==typeof P?P(e):P&&(P.current=e)},[P]),V=Xe(e),Y=Xe(e);Y.current=e;const G=Boolean(o||s),X=wt(),Z=x??(!!X&&"compact"),J="compact"===Z;Qe(()=>{O(q.current)!==e&&_(An(e,a))},[e,a]);const Q=e=>{if(G)return;let i=(O(q.current)??v??(d?O(d):null)??0)+e;null!=r&&i<r&&(i=r),null!=n&&i>n&&(i=n);const o=a??String(l??1).split(".")[1]?.length??0;i=Number(i.toFixed(o));const s=An(i,a);q.current=s,_(s),t(i),ie()},ee=Xe(Q);ee.current=Q;const te=Xe({unit:l??1,big:i??10*(l??1),locked:G});te.current={unit:l??1,big:i??10*(l??1),locked:G},Qe(()=>{const e=H.current;if(!e)return;const t=t=>{const{unit:r,big:n,locked:a}=te.current;if(a||e.ownerDocument.activeElement!==e)return;const l=t.deltaY||t.deltaX;l&&(t.preventDefault(),ee.current((l<0?1:-1)*(t.shiftKey?n:r)))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[]);const[re,ne]=Ge(!1),[ae,le]=Ge(0),ie=()=>{z&&le(e=>e+1)};Qe(()=>{z&&re&&document.activeElement===H.current&&H.current?.select()},[z,re,ae]);const oe=Xe(!1);Qe(()=>{if(re&&!G)return ce(e=>{if("Escape"!==e.key||document.activeElement!==H.current)return!1;const r=V.current;if(O(q.current)===r)return!1;const n=An(r,a);return q.current=n,_(n),Y.current!==r&&(C??t)(r),ie(),!0})},[re,G,a,t,C]);const se=()=>{const e=O(q.current);if(null==e){if(!N){const e=An(Y.current,a);return q.current=e,_(e),Y.current}return q.current="",_(""),null!==Y.current&&t(null),null}let i=e;const o=a??(w?Math.max(Ln(l??1),Ln(r??0)):void 0);w&&(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=An(i,a);return q.current=s,_(s),i===e&&i===Y.current||t(i),i},de=/* @__PURE__ */ct("input",{ref:U,id:p,"data-number-input":"",name:f,type:"text",inputMode:0===a?"numeric":"decimal",value:!re&&$?$(e):K,disabled:o,readOnly:s,placeholder:d,step:l,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?d||void 0:`${An(e,a)}${z&&I?I:""}`,"aria-describedby":[L,E?T:void 0].filter(Boolean).join(" ")||void 0,"data-appearance":z?"bare":void 0,...R,autoComplete:z?"off":void 0,spellCheck:!z&&void 0,"aria-invalid":c||void 0,"aria-label":D,"aria-labelledby":S,onChange:e=>(e=>{if(s)return;const r=I&&e.trimEnd().endsWith(I)?e.trimEnd().slice(0,-I.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(_(e),!M)return;const n=O(e);(null!==n||N)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!G)return V.current=se(),void ie();const t=l??1,r=i??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||G||(e.preventDefault(),Q(n))},onFocus:()=>{V.current=Y.current,ne(!0),oe.current=!0,y?.()},onMouseUp:z?e=>{oe.current&&(oe.current=!1,e.preventDefault())}:void 0,onBlur:()=>{ne(!1),oe.current=!1,se(),b?.()},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)]",re?"bg-white":"bg-transparent",G?"cursor-default":"cursor-text",g].filter(Boolean).join(" "):B({invalid:c,size:u,readOnly:s,auto:E,className:[h?"pl-6":"",J?m?"pr-10":"pr-6":Z?m?"pr-24":"pr-16":m?"pr-10":"","text-left tabular-nums",g].filter(Boolean).join(" ")})}),ue=E?/* @__PURE__ */ct("span",{id:T,hidden:!0,children:W.settingView.auto}):null;if(z||!h&&!m&&!Z)return ue?/* @__PURE__ */st(dt,{children:[de,ue]}):de;const he=O(K);/* @__PURE__ */
171
+ return st("div",{className:"relative","data-number-box":"",children:[h&&/* @__PURE__ */ct("span",{className:"pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:h}),de,ue,m&&/* @__PURE__ */ct("span",{className:`pointer-events-none absolute ${J?"right-6":Z?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-xs text-gray-500`,children:m}),Z&&(()=>{const e=/* @__PURE__ */ct(jn,{dir:-1,compact:J,label:W.number.decrease,disabled:G||null!=r&&null!=he&&he<=r,onStep:e=>ee.current(-(e?i??10*(l??1):l??1))}),t=/* @__PURE__ */ct(jn,{dir:1,compact:J,label:W.number.increase,disabled:G||null!=n&&null!=he&&he>=n,onStep:e=>ee.current(e?i??10*(l??1):l??1)});/* @__PURE__ */
172
172
  return st("span",J?{"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]})})()]})}),zn="h-3.5 w-3.5",Fn={top:/* @__PURE__ */ct(xe,{name:"padding-top","aria-hidden":"true",className:zn}),right:/* @__PURE__ */ct(xe,{name:"padding-right","aria-hidden":"true",className:zn}),bottom:/* @__PURE__ */ct(xe,{name:"padding-bottom","aria-hidden":"true",className:zn}),left:/* @__PURE__ */ct(xe,{name:"padding-left","aria-hidden":"true",className:zn}),vertical:/* @__PURE__ */ct(xe,{name:"padding-y","aria-hidden":"true",className:zn}),horizontal:/* @__PURE__ */ct(xe,{name:"padding-left-right","aria-hidden":"true",className:zn}),each:/* @__PURE__ */ct(xe,{name:"sides-each","aria-hidden":"true",className:"h-4 w-4"})};var En=(e,t,r)=>null===e[r]?t[r]:String(e[r]);function Tn(e,t){const r=r=>En(e,t,r);return r("left")!==r("right")||r("top")!==r("bottom")}function Bn({label:e,value:t,onChange:r,each:n,placeholder:a,words:l,min:i=0,max:o=200,step:s=4,readOnly:c}){const d=(e,n,d)=>{const u=function(e,t){const r=t.map(t=>e[t]);return r.every(e=>e===r[0])?r[0]:"mixed"}(t,e),h=e.map(e=>En(t,a,e)),m="mixed"!==u&&h.every(e=>e===h[0])?h[0]:"–";/* @__PURE__ */
173
173
  return ct("div",{"data-side":e.join("-"),className:"min-w-0",children:/* @__PURE__ */ct(Pn,{value:"mixed"===u?null:u,onChange:n=>((e,n)=>{const a={...t};for(const t of e)a[t]=n;r(a)})(e,n),min:i,max:o,step:s,snap:!0,precision:0,steppers:"compact",readOnly:c,placeholder:m,prefix:d,suffix:l.unit,"aria-label":n})})};/* @__PURE__ */
174
174
  return ct("div",{role:"group","aria-label":e,"data-sides":n?"each":"pairs",className:"grid min-w-0 grid-cols-2 gap-2",children:/* @__PURE__ */st(dt,n?{children:[d(["left"],l.sides.left,Fn.left),d(["top"],l.sides.top,Fn.top),d(["right"],l.sides.right,Fn.right),d(["bottom"],l.sides.bottom,Fn.bottom)]}:{children:[d(["left","right"],l.horizontal,Fn.horizontal),d(["top","bottom"],l.vertical,Fn.vertical)]})})}function In({each:e,onChange:t,label:r,disabled:n}){/* @__PURE__ */
175
- return ct(V,{content:r,children:/* @__PURE__ */ct(u,{size:"sm","aria-label":r,"aria-pressed":e,disabled:n,onClick:()=>t(!e),children:Fn.each})})}var On=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function Rn(e){const t=e.trim().replace(/^#/,"");if(!On.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Wn=e=>e.toUpperCase(),Kn=(e,t,r)=>Math.min(r,Math.max(t,e));function _n(e){const t=Rn(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 qn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Kn(t,0,1),l=Kn(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 Hn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>qn({h:e%360,s:1,v:1})).join(", ")})`,Un={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Vn={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Yn(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function Gn(e,t){if(!e)return Vn;const r=Yn(t);if(r>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${r}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${Vn.backgroundImage}`,backgroundSize:`auto, ${Vn.backgroundSize}`}}function Xn({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",Un[e],r].filter(Boolean).join(" ")}var Zn=Ue(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
175
+ return ct(V,{content:r,children:/* @__PURE__ */ct(T,{size:"sm","aria-label":r,"aria-pressed":e,disabled:n,onClick:()=>t(!e),children:Fn.each})})}var On=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function Rn(e){const t=e.trim().replace(/^#/,"");if(!On.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var Wn=e=>e.toUpperCase(),Kn=(e,t,r)=>Math.min(r,Math.max(t,e));function _n(e){const t=Rn(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 qn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Kn(t,0,1),l=Kn(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 Hn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>qn({h:e%360,s:1,v:1})).join(", ")})`,Un={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},Vn={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Yn(e){return null==e||Number.isNaN(e)?100:Math.round(Math.min(100,Math.max(0,e)))}function Gn(e,t){if(!e)return Vn;const r=Yn(t);if(r>=100)return{background:e};const n=`color-mix(in srgb, ${e} ${r}%, transparent)`;return{backgroundImage:`linear-gradient(${n}, ${n}), ${Vn.backgroundImage}`,backgroundSize:`auto, ${Vn.backgroundSize}`}}function Xn({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",Un[e],r].filter(Boolean).join(" ")}var Zn=Ue(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
176
176
  return ct("button",{ref:i,type:a,"aria-pressed":r,className:Xn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"absolute inset-0",style:Gn(e)})})}),Jn=(e,t,r)=>Math.min(r,Math.max(t,e)),Qn=e=>"string"==typeof e?{value:e}:e;var ea={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function ta({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,opacity:s,onOpacityChange:c,onClose:d,id:u,className:h=""}){const m=$e().color,p=Yn(s),f=e=>{const t=Yn(e);o||t===p||c?.(t)},g=e=>{const t=e.currentTarget.getBoundingClientRect();return t.width>0?(e.clientX-t.left)/t.width*100:p},b=Rn(l??""),[y,x]=Ge(()=>_n(e||b||"")),v=Xe(e);Qe(()=>{e!==v.current&&(v.current=e,e?x(_n(e)):b&&x(_n(b)))},[e]);const w=r=>{o||r===e||(v.current=r,t(r))},N=e=>{const t=Rn(e);t&&(x(_n(t)),w(t))},k=e=>{x(e),w(qn(e))},[$,M]=Ge(!1),C=Xe(y);C.current=y;const D=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,C.current);"end"===i?(M(!0),x(r)):k(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,C.current);"end"===i?x(r):k(r)},onPointerUp:t=>{"end"===i&&$&&(M(!1),k(e(t,C.current)))}}),S=D((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Kn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Kn((n-a.top)/a.height,0,1):0})};var r,n,a}),L=D((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Kn((r-n.left)/n.width,0,1)):0)};var r,n}),A=$?qn(y):e,j=e=>`${Math.round(100*e)}%`,P=(n??[]).map(Qn),z=Rn(e),F=A||b||"";
177
177
  /* @__PURE__ */
178
178
  return ct(vt.Provider,{value:!1,children:/* @__PURE__ */st("div",{id:u,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${h}`.trim(),onKeyDown:e=>{"Escape"===e.key&&d&&(e.preventDefault(),e.stopPropagation(),d())},children:[(P.length>0||a)&&/* @__PURE__ */st("div",{role:"group","aria-label":m.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */ct(V,{content:m.clear,children:/* @__PURE__ */ct(Zn,{color:"",size:"sm","aria-label":m.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(v.current="",t(""))}})}),P.map(e=>{const t=Rn(e.value),r=e.label?`${e.label} · ${Wn(t??e.value)}`:Wn(t??e.value);/* @__PURE__ */
@@ -181,7 +181,7 @@ return ct(V,{content:r,children:/* @__PURE__ */ct(Zn,{color:t??e.value,size:"sm"
181
181
  /* @__PURE__ */ct("div",{role:"slider",tabIndex:o?-1:0,"aria-label":m.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(y.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 Jn(e-n,0,359);case"ArrowRight":case"ArrowUp":return Jn(e+n,0,359);case"PageDown":return Jn(e-10,0,359);case"PageUp":return Jn(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(y.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),k({...y,h:t}))},...L,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:Hn},children:/* @__PURE__ */ct("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:y.h/360*100+"%",background:qn({h:y.h,s:1,v:1}),...ea}})}),c&&/* @__PURE__ */ct("div",{role:"slider",tabIndex:o?-1:0,"aria-label":m.opacity(r),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":p,"aria-valuetext":`${p}%`,"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-opacity":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return Jn(e-n,0,100);case"ArrowRight":case"ArrowUp":return Jn(e+n,0,100);case"PageDown":return Jn(e-10,0,100);case"PageUp":return Jn(e+10,0,100);case"Home":return 0;case"End":return 100;default:return null}}(p,e.key,e.shiftKey);null!==t&&(e.preventDefault(),f(t))},onPointerDown:e=>{o||0!==e.button||(e.currentTarget.setPointerCapture?.(e.pointerId),e.currentTarget.focus({preventScroll:!0}),f(g(e)))},onPointerMove:e=>{!o&&1&e.buttons&&f(g(e))},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:`linear-gradient(to right, transparent, ${F||"black"}), ${Vn.backgroundImage}`,backgroundSize:`auto, ${Vn.backgroundSize}`},children:/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:`${p}%`,...Gn(F||"black",p),...ea}})}),
182
182
  /* @__PURE__ */st("div",{className:"flex items-center gap-2",children:[
183
183
  /* @__PURE__ */ct("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Gn(F,c?p:null)}),
184
- /* @__PURE__ */ct(la,{value:A,placeholder:!e&&b?Wn(b):void 0,onChange:N,label:m.hex(r),disabled:o}),c&&/* @__PURE__ */ct(ia,{value:p,onChange:f,label:m.opacity(r),disabled:o})]})]})})}var ra={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)]"},na={sm:"h-6",md:"h-8",lg:"h-10"},aa=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-gray-800 placeholder:text-gray-400 hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function la({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,size:i="md",look:o="box",className:s=""}){const[c,d]=Ge(null),u="text"===o?`${aa} ${na[i]} ${s}`.trim():h({size:i,className:`${ra[i]} flex-1 font-mono uppercase ${s}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
184
+ /* @__PURE__ */ct(la,{value:A,placeholder:!e&&b?Wn(b):void 0,onChange:N,label:m.hex(r),disabled:o}),c&&/* @__PURE__ */ct(ia,{value:p,onChange:f,label:m.opacity(r),disabled:o})]})]})})}var ra={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)]"},na={sm:"h-6",md:"h-8",lg:"h-10"},aa=["block w-[calc(7ch+0.5rem+4px)] min-w-[calc(7ch+0.5rem+4px)] flex-none rounded-(--radius-control)","border border-transparent bg-transparent px-1 text-2xs font-mono uppercase","text-gray-800 placeholder:text-gray-400 hover:border-gray-300","focus:border-blue-400 focus:bg-(--surface) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)]","disabled:cursor-not-allowed disabled:opacity-60"].join(" ");function la({value:e,onChange:t,label:r,placeholder:n,disabled:a,id:l,size:i="md",look:o="box",className:s=""}){const[c,d]=Ge(null),u="text"===o?`${aa} ${na[i]} ${s}`.trim():B({size:i,className:`${ra[i]} flex-1 font-mono uppercase ${s}`.trim()}).replace(/(^| )w-full( |$)/," ");/* @__PURE__ */
185
185
  return ct("input",{id:l,type:"text",value:c??(e?Wn(e):""),"aria-label":r,placeholder:n,maxLength:7,spellCheck:!1,autoComplete:"off",disabled:a,onChange:r=>{d(r.target.value);const n=Rn(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),"data-hex-look":o,className:u})}function ia({value:e,onChange:t,label:r,disabled:n,size:a="md"}){/* @__PURE__ */
186
186
  return ct("div",{"data-color-opacity-box":"",className:"w-20 shrink-0",children:/* @__PURE__ */ct(Pn,{value:e,onChange:e=>{null!==e&&t(e)},min:0,max:100,precision:0,suffix:"%",size:a,"aria-label":r,disabled:n})})}function oa({value:e,onChange:t,label:r,presets:n,clearable:a,fallback:l,dragWrites:i,disabled:o,id:s,showHexInput:c=!1,opacity:d,onOpacityChange:u,size:h="md",align:m="start",open:p,onOpenChange:f,className:g=""}){const b=$e().color,y=Yn(d),x=Ve(),v=Rn(l??""),w=e||v||"",N=e?Wn(e):v?Wn(v):b.none;
187
187
  /* @__PURE__ */
@@ -198,7 +198,7 @@ return st("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${
198
198
  /* @__PURE__ */ct("div",{ref:F,"data-slider-box":"",className:H?"ml-auto shrink-0":"shrink-0 text-xs",style:H?void 0:{width:K?.width??R,...E?{fontSize:E.fontSize}:{}},children:/* @__PURE__ */ct(Pn,{value:e,onChange:e=>{null!=e?e<L||e>A||t(e):j&&t(null)},min:L,max:A,step:a,shiftStep:l,stepFrom:P,precision:S,snap:!0,allowEmpty:j,suffix:c,disabled:y,placeholder:u??(null!=h?h.toFixed(S):void 0),size:H?void 0:"sm",auto:M,"aria-label":p?N.slider.value(p):void 0,"aria-labelledby":p?void 0:f})}),M&&/* @__PURE__ */ct("span",{id:C,hidden:!0,children:N.settingView.auto})]})}function Sa({items:e,onChange:t,label:r,className:n="","aria-labelledby":a,"aria-describedby":l}){const i=$e().displayChips,o=Ve();/* @__PURE__ */
199
199
  return ct("div",{role:"group","aria-label":a?void 0:r,"aria-labelledby":a,"aria-describedby":l,className:`flex flex-wrap gap-2 ${n}`.trim(),children:e.map((e,r)=>{const n=`${o}-${r}-state`,a=`${o}-${r}-reason`,l=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,s=/* @__PURE__ */st("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||l)||void 0,"aria-disabled":!!l||void 0,"aria-describedby":te(n,l?a:void 0),onClick:l?ee:()=>t(e.id,!e.shown),className:"inline-flex h-6 max-w-full shrink-0 items-center gap-1 whitespace-nowrap rounded-full border pl-2 pr-3 text-xs font-medium transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(e.shown?"border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-900"),children:[
200
200
  /* @__PURE__ */ct(xe,{name:e.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
201
- /* @__PURE__ */ct($,{children:e.label})]}),c=/* @__PURE__ */ct("span",{id:n,className:"sr-only",children:e.shown?i.shown:i.hidden});/* @__PURE__ */
201
+ /* @__PURE__ */ct(u,{children:e.label})]}),c=/* @__PURE__ */ct("span",{id:n,className:"sr-only",children:e.shown?i.shown:i.hidden});/* @__PURE__ */
202
202
  return st(lt,{children:[l?/* @__PURE__ */ct(re,{reason:e.disabledReason,id:a,children:s}):/* @__PURE__ */ct(V,{content:e.shown?i.shownHint:i.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:s}),c]},e.id)})})}function La({options:e,value:t,onChange:r,onClear:n,columns:a,captions:l=!1,label:i,className:o="","aria-labelledby":s}){/* @__PURE__ */
203
203
  return ct("div",{role:"group","aria-label":s?void 0:i,"aria-labelledby":s,style:a?{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`}:void 0,className:`grid gap-(--space-8) ${a?"":"grid-cols-[repeat(auto-fill,minmax(58px,1fr))]"} ${o}`.replace(/\s+/g," ").trim(),children:e.map(e=>{const a=e.value===t,i=/* @__PURE__ */st("button",{type:"button","aria-pressed":a,"aria-label":l?void 0:e.label,disabled:e.disabled||void 0,onClick:()=>{a?n?.():r(e.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${l?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${a?"border-blue-600 bg-white text-blue-600 ring-2 ring-blue-400/40":"border-gray-200 bg-white text-gray-500 hover:bg-gray-50 hover:text-gray-700"}`,children:[e.picture,l&&/* @__PURE__ */ct("span",{className:"max-w-full truncate text-2xs leading-4",children:e.label})]});return l?/* @__PURE__ */ct("div",{className:"flex min-w-0",children:i},e.value):/* @__PURE__ */ct(V,{content:e.label,describe:!1,className:"relative flex min-w-0",children:i},e.value)})})}var Aa=4,ja=10,Pa={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},za={1:[],2:[50],3:[34,33],4:[25,25,25]},Fa=e=>"number"==typeof e&&Number.isFinite(e);function Ea(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(Fa))return;const r=[];let n=0;return e.forEach((e,a)=>{const l=((e,t,r)=>Math.min(r,Math.max(t,Math.round(e))))(e,ja,100-n-(t-1-a)*ja);r.push(l),n+=l}),r}function Ta(e,t){const r=Ea(e,t);if(!r)return(e=>[...Pa[e]??Pa[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function Ba(e,t){return Ta(t,e)}var Ia=(e,t,r)=>Math.min(r,Math.max(t,e)),Oa=e=>e.reduce((e,t)=>e+t,0),Ra=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var Wa,Ka="w-0.5",_a=`${Ka} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var qa=["text-blue-700","text-gray-600"];function Ha({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=$e().widths,d=Ve(),u=Ia(Math.round(e)||1,1,4),h=Ea(t,u),m=h??[...za[u]??[]],p=[...m,100-Oa(m)],f=l||i,g=Xe(null),b=Xe({onChange:r,shown:m,locked:f,n:u,stored:h});b.current={onChange:r,shown:m,locked:f,n:u,stored:h};const y=e=>{const{onChange:t,shown:r,locked:n,n:a}=b.current;if(n)return!1;const l=Ea(e,a);return!(!l||Ra(l,r))&&(t(l),!0)},x=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=Ia(Math.round(r),ja,n-ja),a[t+1]=n-a[t],y(a.slice(0,-1))&&(B.current=null)},v=e=>t=>{if(t.altKey||t.ctrlKey||t.metaKey)return;const r=t.shiftKey?10:1,n=p[e]+p[e+1],a="ArrowRight"===t.key?p[e]+r:"ArrowLeft"===t.key?p[e]-r:"PageUp"===t.key?p[e]+10:"PageDown"===t.key?p[e]-10:"Home"===t.key?ja:"End"===t.key?n-ja:null;null!==a&&(t.preventDefault(),x(p,e,a))},w=Xe(null),[N,k]=Ge(null),$=()=>{w.current=null,k(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};Qe(()=>$,[]);const M=e=>t=>{if(0!==t.button||f)return;t.preventDefault();const r=g.current?.getBoundingClientRect().width??0;r<=0||(w.current={i:e,x:t.clientX,width:r,from:p,moved:!1,pointer:t.pointerId},k(e),t.currentTarget.setPointerCapture?.(t.pointerId),document.body.style.cursor="col-resize",document.body.style.userSelect="none")},C=e=>{const t=w.current;if(!t)return;if(0===e.buttons)return void $();const r=e.clientX-t.x;if(!t.moved){if(Math.abs(r)<3)return;t.moved=!0}x(t.from,t.i,t.from[t.i]+r/t.width*100)},D=e=>{const t=w.current;t&&(e.currentTarget.hasPointerCapture?.(t.pointer)&&e.currentTarget.releasePointerCapture(t.pointer),$())},S=(e,t)=>{const{shown:r}=b.current,n=function(e,t,r){const n=e.length,a=[...e];if(n<2)return a;const l=Ia(Math.round(r),ja,100-(n-1)*ja);let i=l-a[t];a[t]=l;const o=[...Array.from({length:n-1-t},(e,r)=>t+1+r),...Array.from({length:t},(e,r)=>t-1-r)];if(i<0)return a[o[0]]-=i,a;for(const e of o){if(i<=0)break;const t=Math.min(i,a[e]-ja);a[e]-=t,i-=t}return a}([...r,100-Oa(r)],e,t);return y(n.slice(0,-1))?n:null},[L,A]=Ge(0);Qe(()=>{const e=g.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>A(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const j=Xe(null),[P,z]=Ge(null),[F,E]=Ge([]),T=(e,t)=>z(r=>t?e:r===e?null:r),B=Xe(null),I=(e,t)=>{const r=B.current;if(!r||r.column!==e||r.share!==t)return!1;const{onChange:n,locked:a,stored:l}=b.current;var i,o;return a||(i=l,o=r.stored,void 0===i||void 0===o?i===o:Ra(i,o))||n(r.stored),!0},O=p.join(",");Qe(()=>{const e=null===P?[]:function(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll("input[data-widths-label]")),n=r[t]?.getBoundingClientRect();if(!n||0===n.width)return[];if(void 0===Wa&&(Wa=document.createElement("canvas").getContext("2d")),!Wa)return[];const a=Wa;return r.flatMap((e,r)=>{if(r===t)return[];const l=e.getBoundingClientRect(),i=getComputedStyle(e);a.font=`${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;const o=a.measureText(e.value).width/2,s=(l.left+l.right)/2;return s+o>n.left&&s-o<n.right?[r]:[]})}(j.current,P);E(t=>Ra(t,e)?t:e)},[P,O,L]);const R=p.slice(0,-1).map((e,t)=>Oa(p.slice(0,t+1)));/* @__PURE__ */
204
204
  return st("div",{role:"group","aria-label":a?void 0:n,"aria-labelledby":a,"aria-describedby":u>1?d:void 0,className:`flex w-full min-w-0 flex-col gap-2 ${i?"opacity-60":""} ${s}`.trim(),children:[
@@ -208,17 +208,17 @@ return st("div",{role:"group","aria-label":a?void 0:n,"aria-labelledby":a,"aria-
208
208
  return ct("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__ */ct(Pn,{appearance:"bare",value:e,display:()=>(e=>L>0&&L*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:ja,max:100-(u-1)*ja,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||I(t,e)||S(t,e)},onRevert:e=>((e,t)=>{b.current.locked||null===t||I(e,t)||S(e,t)})(t,e),onFocus:()=>{B.current={column:t,share:e,stored:b.current.stored},T(t,!0)},onBlur:()=>T(t,!1),className:`absolute inset-0 text-xs font-medium ${qa[t%2]} ${F.includes(t)&&!r?"opacity-0":""}`})})})(),t<u-1&&/* @__PURE__ */ct("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${R[t]}%`},children:/* @__PURE__ */ct(V,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */ct("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":ja,"aria-valuemax":p[t]+p[t+1]-ja,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":f||void 0,onKeyDown:f?void 0:v(t),onPointerDown:M(t),onPointerMove:C,onPointerUp:D,onPointerCancel:D,onLostPointerCapture:()=>{w.current&&$()},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)] "+(f?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */ct("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(f?`${Ka} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${N===t?"w-1":_a}`)})})})})]},t))]}),u>1&&!o&&/* @__PURE__ */ct("span",{id:d,className:"sr-only",children:c.hint(u,ja)}),u>1&&o&&/* @__PURE__ */ct("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */st("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
209
209
  /* @__PURE__ */ct("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,ja)}),
210
210
  /* @__PURE__ */ct(U,{variant:"secondary",size:"sm",disabled:f,onClick:()=>{f||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}function Ua({onClear:e,ariaLabel:t}){/* @__PURE__ */
211
- return ct("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 Va(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:u=!1,error:h,onRetry:m,rightAdornment:p,renderOption:f,clearable:g=!0,"aria-label":x,"aria-labelledby":v,"aria-describedby":w}=e,N=!0===e.multiple,k=e.multiple?e.value:e.value?[e.value]:[],$=e.multiple?"":e.value,M=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},C=k.length>0,D=o&&C&&!l,S=N||o,L=null!=c,A=s||L,[j,P]=Ge(!1),[z,F]=Ge(-1),E=Ve(),T=i??`${E}-input`,B=`${E}-listbox`,I=e=>`${E}-opt-${e}`,[O,R]=Ge(""),W=$e(),K=n??W.select.none,_=e=>{R(e),F(-1),d?.(e)},q=Xe(null),H=Xe(null),X=Xe(null),Z=Xe(null),J=Xe(j);J.current=j;const Q=Xe(!1),ee=e=>{J.current&&(J.current=!1,e&&s&&!L&&Le&&(N?k.includes(Le)||M([...k,Le]):Le!==$&&M([Le])),P(!1),_(""))},te=(e,t)=>{if(!e.disabled){if(N)return M(k.includes(e.value)?k.filter(t=>t!==e.value):[...k,e.value]),void(e===Ae?_(""):F(t));M([e.value]),ee(!1)}},[re,ne]=Ge(null);pe(()=>{if(!p||j)return void ne(null);const e=Z.current?.offsetWidth??0;ne(e?e+(fe?32:8)+6:null)});const ae=Y(H,j,S?{popupRef:X}:{matchTriggerWidth:!0}),le=Ze(()=>Lt(t),[t]),ie=k.join("\0"),he=Ze(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of le)k.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(A)for(const r of k)t.has(r)||e.push(r);return e},[le,ie,A]),me=he.join(", "),fe=g&&C&&!l,[ge,be]=Ge(null),ye=Xe(null),xe=Xe(""),ve=Xe(()=>{});ve.current=()=>{const e=H.current,t=ye.current;if(!N||!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}|${he.join("\0")}`;if(l===xe.current)return;xe.current=l;let i=null;n>0&&he.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}}(he,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),be(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},pe(()=>{ve.current()}),Qe(()=>{const e=H.current;if(!N||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>ve.current());return t.observe(e),()=>t.disconnect()},[N]);const we=he.length,Ne=!N||!ge||ge.shown>=we?me:0===ge.shown?W.select.selectedCount(we):`${he.slice(0,ge.shown).join(", ")} +${we-ge.shown}`,ke=N&&null!==ge&&(ge.shown<we||ge.cut),Me=j&&C&&S;Qe(()=>{if(!j)return;const e=e=>{const t=e.target;q.current?.contains(t)||X.current?.contains(t)||ee(!0)};document.addEventListener("mousedown",e);const t=de(()=>ee(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[j,s,O,ie,e.onChange]),Qe(()=>{if(j)return ce(e=>!("Escape"!==e.key||!J.current)&&(ee(!1),H.current?.blur(),!0),()=>X.current)},[j]);const Ce=Ze(()=>{const e=/* @__PURE__ */new Set;return At(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),De=Ze(()=>{if(d)return Ce;const e=O.trim().toLowerCase();return e?At(Ce,t=>zt(t,e)):Ce},[Ce,O,d]),Se=Ze(()=>Lt(De),[De]),Le=O.trim(),Ae=Ze(()=>L&&Le?le.some(e=>e.label===Le)||k.includes(Le)?null:{value:Le,label:Le}:null,[L,Le,le,ie]),je=Ze(()=>Ae?[...Se,Ae]:Se,[Se,Ae]);/* @__PURE__ */
212
- return st("div",{ref:q,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(q.current?.contains(t)||X.current?.contains(t))||Q.current||document.activeElement!==H.current&&ee(!0)},children:[(Pe=/* @__PURE__ */ct("input",{id:T,ref:H,type:"text",autoComplete:"off",role:"combobox","aria-expanded":j,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":j?B:void 0,"aria-activedescendant":j&&z>=0&&z<je.length?I(z):void 0,"aria-label":v?void 0:x,"aria-labelledby":v,"aria-describedby":w,value:j?O:Ne,onChange:e=>{_(e.target.value),P(!0)},onFocus:()=>{l||(_(""),P(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!j)return void P(!0);if(0===je.length)return;const t="ArrowDown"===e.key?1:-1;return void F(e=>Ct(je,e,t))}"Enter"===e.key?(e.preventDefault(),j&&z>=0&&z<je.length?te(je[z],z):1!==Se.length||Se[0].disabled?s&&!L&&Le&&(N?(k.includes(Le)||M([...k,Le]),_("")):(M([Le]),ee(!1),H.current?.blur())):te(Se[0],0)):"Escape"===e.key?(ee(!1),H.current?.blur()):"Tab"===e.key&&ee(!0)},placeholder:Me?Ne:r||K,className:`${D?b:y} ${a} ${fe?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Me?" rosh-field-shows-choice":""}`,style:re?{paddingRight:re}:void 0,disabled:l}),N?/* @__PURE__ */ct(V,{content:!j&&ke?me:null,className:"block",children:Pe}):Pe),N&&
213
- /* @__PURE__ */ct("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */ct("span",{ref:ye,className:"whitespace-pre"})}),fe&&/* @__PURE__ */ct(Ua,{ariaLabel:W.select.clear,onClear:()=>{M([]),ee(!1)}}),p&&!j&&/* @__PURE__ */ct("div",{ref:Z,className:`absolute top-1/2 -translate-y-1/2 ${fe?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:p}),j&&ut(
214
- /* @__PURE__ */st("div",{ref:X,onMouseDownCapture:()=>{Q.current=!0,setTimeout(()=>{Q.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ue.popup,left:ae?.left,right:ae?.right,top:ae?.top,bottom:ae?.bottom,minWidth:ae?.minWidth,width:ae?.width,...S&&{maxWidth:ae?.maxWidth},visibility:ae?void 0:"hidden",...oe()},children:[N&&C&&g&&!l&&
215
- /* @__PURE__ */ct("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),M([])},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 ${se}`,children:W.select.clearAll}),u?
216
- /* @__PURE__ */ct(He,{size:"sm",padding:"py-2",label:W.search.searching}):h?/* @__PURE__ */st("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
217
- /* @__PURE__ */ct("span",{className:"min-w-0 flex-1",children:h}),m&&/* @__PURE__ */ct(U,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:m,className:"shrink-0",children:W.list.retry})]}):null,
218
- /* @__PURE__ */st("div",{id:B,role:je.length?"listbox":void 0,"aria-labelledby":je.length?v??(x?void 0:T):void 0,"aria-label":je.length&&!v?x:void 0,"aria-multiselectable":!(!je.length||!N)||void 0,className:"overflow-y-auto",style:{maxHeight:ae?.maxHeight??G},children:[0===je.length?u||h?null:/* @__PURE__ */ct("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:W.select.noMatches}):0===Se.length?null:jt(De,(e,t)=>{const r=k.includes(e.value);/* @__PURE__ */
219
- return st("button",{id:I(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||N)&&r.preventDefault(),te(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===z?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[N&&/* @__PURE__ */ct(Pt,{selected:r}),
220
- /* @__PURE__ */ct("span",{className:`min-w-0 ${S?"flex-auto":"flex-1"} truncate`,children:f?f(e,{selected:r,active:t===z}):e.label}),e.sublabel&&/* @__PURE__ */ct(Ft,{grows:S,children:e.sublabel})]},e.value)},E),Ae&&c&&
221
- /* @__PURE__ */ct("button",{id:I(Se.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{N&&e.preventDefault(),te(Ae,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 ${se}`:""} ${z===Se.length?"bg-gray-100":""}`,children:/* @__PURE__ */ct("span",{className:"min-w-0 flex-1 truncate",children:c(Ae.value)})},`${E}-typed`)]})]}),document.body)]});var Pe}function Ya(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Ga="address",Xa={kindOf:()=>Ga,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Za=e=>v(e.trim());function Ja(e){const{value:t,kinds:r,rules:n=Xa,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=$e().link,u=n.isSafe??Za,h=Ve(),m=Xe(null),p=Xe(null),[f,g]=Ge({url:t}),b=c?f.url:t,[y,x]=Ge(!1),[v,w]=Ge(null),[N,k]=Ge(null),$=Xe(()=>{});$.current=c?e.onCancel:()=>{},Qe(()=>{if(c)return ce(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&($.current(),!0)},()=>m.current)},[c]),Qe(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const M=r??[{value:Ga,label:d.address,target:{type:"text"}}],C=v&&v.against===b?v.kind:n.kindOf(b),D=M.filter(e=>!e.hideWhenEmpty||Ya(e.target).length>0||e.value===C),S=D.find(e=>"text"===e.target.type),L=D.find(e=>e.value===C)??S??D[0];if(!L)return null;const A="text"!==L.target.type,j=A?n.targetOf(b):b,P=Ya(L.target),z=P.find(e=>e.value===j),F=e=>({value:e,label:d.unavailable(e)}),E="select"===L.target.type&&j&&a?a(j):null,T=E?n.readFilter(b):null,B=T?E?.find(e=>e.param===T.param):void 0,I=N&&N.against===b?N.text:b,O=!A&&""!==I.trim()&&!u(I),R=O&&(!c||y),W=(t,r)=>{c?g({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},K=(e,t)=>{w(t=>t?{...t,against:e}:t),W(e,t)},_=e=>{if(!e)return K("");const t=P.find(t=>t.value===e);K(e,t?.label)},q=A?b:I.trim(),H=()=>{if(!c||!q)return;if(!A&&O)return void x(!0);const t=A&&f.url===q?f.name:void 0,r=e.onApply;void 0===t?r(q):r(q,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[F(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__ */
211
+ return ct("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 Va(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:u=!1,error:h,onRetry:m,rightAdornment:p,renderOption:f,clearable:g=!0,"aria-label":b,"aria-labelledby":y,"aria-describedby":x}=e,v=!0===e.multiple,w=e.multiple?e.value:e.value?[e.value]:[],N=e.multiple?"":e.value,k=t=>{e.multiple?e.onChange(t):e.onChange(t[0]??"")},$=w.length>0,M=o&&$&&!l,C=v||o,D=null!=c,S=s||D,[L,A]=Ge(!1),[j,P]=Ge(-1),z=Ve(),F=i??`${z}-input`,E=`${z}-listbox`,T=e=>`${z}-opt-${e}`,[B,I]=Ge(""),O=$e(),R=n??O.select.none,W=e=>{I(e),P(-1),d?.(e)},q=Xe(null),H=Xe(null),X=Xe(null),Z=Xe(null),J=Xe(L);J.current=L;const Q=Xe(!1),ee=e=>{J.current&&(J.current=!1,e&&s&&!D&&Le&&(v?w.includes(Le)||k([...w,Le]):Le!==N&&k([Le])),A(!1),W(""))},te=(e,t)=>{if(!e.disabled){if(v)return k(w.includes(e.value)?w.filter(t=>t!==e.value):[...w,e.value]),void(e===Ae?W(""):P(t));k([e.value]),ee(!1)}},[re,ne]=Ge(null);pe(()=>{if(!p||L)return void ne(null);const e=Z.current?.offsetWidth??0;ne(e?e+(fe?32:8)+6:null)});const ae=Y(H,L,C?{popupRef:X}:{matchTriggerWidth:!0}),le=Ze(()=>Lt(t),[t]),ie=w.join("\0"),he=Ze(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of le)w.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(S)for(const r of w)t.has(r)||e.push(r);return e},[le,ie,S]),me=he.join(", "),fe=g&&$&&!l,[ge,be]=Ge(null),ye=Xe(null),xe=Xe(""),ve=Xe(()=>{});ve.current=()=>{const e=H.current,t=ye.current;if(!v||!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}|${he.join("\0")}`;if(l===xe.current)return;xe.current=l;let i=null;n>0&&he.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}}(he,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),be(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},pe(()=>{ve.current()}),Qe(()=>{const e=H.current;if(!v||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>ve.current());return t.observe(e),()=>t.disconnect()},[v]);const we=he.length,Ne=!v||!ge||ge.shown>=we?me:0===ge.shown?O.select.selectedCount(we):`${he.slice(0,ge.shown).join(", ")} +${we-ge.shown}`,ke=v&&null!==ge&&(ge.shown<we||ge.cut),Me=L&&$&&C;Qe(()=>{if(!L)return;const e=e=>{const t=e.target;q.current?.contains(t)||X.current?.contains(t)||ee(!0)};document.addEventListener("mousedown",e);const t=de(()=>ee(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[L,s,B,ie,e.onChange]),Qe(()=>{if(L)return ce(e=>!("Escape"!==e.key||!J.current)&&(ee(!1),H.current?.blur(),!0),()=>X.current)},[L]);const Ce=Ze(()=>{const e=/* @__PURE__ */new Set;return At(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),De=Ze(()=>{if(d)return Ce;const e=B.trim().toLowerCase();return e?At(Ce,t=>zt(t,e)):Ce},[Ce,B,d]),Se=Ze(()=>Lt(De),[De]),Le=B.trim(),Ae=Ze(()=>D&&Le?le.some(e=>e.label===Le)||w.includes(Le)?null:{value:Le,label:Le}:null,[D,Le,le,ie]),je=Ze(()=>Ae?[...Se,Ae]:Se,[Se,Ae]);/* @__PURE__ */
212
+ return st("div",{ref:q,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(q.current?.contains(t)||X.current?.contains(t))||Q.current||document.activeElement!==H.current&&ee(!0)},children:[(Pe=/* @__PURE__ */ct("input",{id:F,ref:H,type:"text",autoComplete:"off",role:"combobox","aria-expanded":L,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":L?E:void 0,"aria-activedescendant":L&&j>=0&&j<je.length?T(j):void 0,"aria-label":y?void 0:b,"aria-labelledby":y,"aria-describedby":x,value:L?B:Ne,onChange:e=>{W(e.target.value),A(!0)},onFocus:()=>{l||(W(""),A(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!L)return void A(!0);if(0===je.length)return;const t="ArrowDown"===e.key?1:-1;return void P(e=>Ct(je,e,t))}"Enter"===e.key?(e.preventDefault(),L&&j>=0&&j<je.length?te(je[j],j):1!==Se.length||Se[0].disabled?s&&!D&&Le&&(v?(w.includes(Le)||k([...w,Le]),W("")):(k([Le]),ee(!1),H.current?.blur())):te(Se[0],0)):"Escape"===e.key?(ee(!1),H.current?.blur()):"Tab"===e.key&&ee(!0)},placeholder:Me?Ne:r||R,className:`${M?K:_} ${a} ${fe?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Me?" rosh-field-shows-choice":""}`,style:re?{paddingRight:re}:void 0,disabled:l}),v?/* @__PURE__ */ct(V,{content:!L&&ke?me:null,className:"block",children:Pe}):Pe),v&&
213
+ /* @__PURE__ */ct("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */ct("span",{ref:ye,className:"whitespace-pre"})}),fe&&/* @__PURE__ */ct(Ua,{ariaLabel:O.select.clear,onClear:()=>{k([]),ee(!1)}}),p&&!L&&/* @__PURE__ */ct("div",{ref:Z,className:`absolute top-1/2 -translate-y-1/2 ${fe?"right-8":"right-2"} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:p}),L&&ut(
214
+ /* @__PURE__ */st("div",{ref:X,onMouseDownCapture:()=>{Q.current=!0,setTimeout(()=>{Q.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ue.popup,left:ae?.left,right:ae?.right,top:ae?.top,bottom:ae?.bottom,minWidth:ae?.minWidth,width:ae?.width,...C&&{maxWidth:ae?.maxWidth},visibility:ae?void 0:"hidden",...oe()},children:[v&&$&&g&&!l&&
215
+ /* @__PURE__ */ct("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),k([])},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 ${se}`,children:O.select.clearAll}),u?
216
+ /* @__PURE__ */ct(He,{size:"sm",padding:"py-2",label:O.search.searching}):h?/* @__PURE__ */st("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
217
+ /* @__PURE__ */ct("span",{className:"min-w-0 flex-1",children:h}),m&&/* @__PURE__ */ct(U,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:m,className:"shrink-0",children:O.list.retry})]}):null,
218
+ /* @__PURE__ */st("div",{id:E,role:je.length?"listbox":void 0,"aria-labelledby":je.length?y??(b?void 0:F):void 0,"aria-label":je.length&&!y?b:void 0,"aria-multiselectable":!(!je.length||!v)||void 0,className:"overflow-y-auto",style:{maxHeight:ae?.maxHeight??G},children:[0===je.length?u||h?null:/* @__PURE__ */ct("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:O.select.noMatches}):0===Se.length?null:jt(De,(e,t)=>{const r=w.includes(e.value);/* @__PURE__ */
219
+ return st("button",{id:T(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||v)&&r.preventDefault(),te(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===j?"bg-gray-100":r?"bg-blue-50/50":""}`),children:[v&&/* @__PURE__ */ct(Pt,{selected:r}),
220
+ /* @__PURE__ */ct("span",{className:`min-w-0 ${C?"flex-auto":"flex-1"} truncate`,children:f?f(e,{selected:r,active:t===j}):e.label}),e.sublabel&&/* @__PURE__ */ct(Ft,{grows:C,children:e.sublabel})]},e.value)},z),Ae&&c&&
221
+ /* @__PURE__ */ct("button",{id:T(Se.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{v&&e.preventDefault(),te(Ae,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 ${se}`:""} ${j===Se.length?"bg-gray-100":""}`,children:/* @__PURE__ */ct("span",{className:"min-w-0 flex-1 truncate",children:c(Ae.value)})},`${z}-typed`)]})]}),document.body)]});var Pe}function Ya(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var Ga="address",Xa={kindOf:()=>Ga,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},Za=e=>H(e.trim());function Ja(e){const{value:t,kinds:r,rules:n=Xa,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=$e().link,u=n.isSafe??Za,h=Ve(),m=Xe(null),p=Xe(null),[f,g]=Ge({url:t}),b=c?f.url:t,[y,x]=Ge(!1),[v,w]=Ge(null),[N,k]=Ge(null),$=Xe(()=>{});$.current=c?e.onCancel:()=>{},Qe(()=>{if(c)return ce(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&($.current(),!0)},()=>m.current)},[c]),Qe(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const M=r??[{value:Ga,label:d.address,target:{type:"text"}}],C=v&&v.against===b?v.kind:n.kindOf(b),D=M.filter(e=>!e.hideWhenEmpty||Ya(e.target).length>0||e.value===C),S=D.find(e=>"text"===e.target.type),L=D.find(e=>e.value===C)??S??D[0];if(!L)return null;const A="text"!==L.target.type,j=A?n.targetOf(b):b,P=Ya(L.target),z=P.find(e=>e.value===j),F=e=>({value:e,label:d.unavailable(e)}),E="select"===L.target.type&&j&&a?a(j):null,T=E?n.readFilter(b):null,B=T?E?.find(e=>e.param===T.param):void 0,I=N&&N.against===b?N.text:b,O=!A&&""!==I.trim()&&!u(I),R=O&&(!c||y),W=(t,r)=>{c?g({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},K=(e,t)=>{w(t=>t?{...t,against:e}:t),W(e,t)},_=e=>{if(!e)return K("");const t=P.find(t=>t.value===e);K(e,t?.label)},q=A?b:I.trim(),H=()=>{if(!c||!q)return;if(!A&&O)return void x(!0);const t=A&&f.url===q?f.name:void 0,r=e.onApply;void 0===t?r(q):r(q,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[F(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__ */
222
222
  return ct(Va,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
223
223
  return ct(It,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===L.target.type)G=/* @__PURE__ */ct(xt,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:R,"aria-label":d.address,"aria-describedby":R?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:I,readOnly:i,onChange:e=>(e=>{x(!1);const t=e.trim();t?u(e)?(k({text:e,against:t}),K(t)):k({text:e,against:b}):(k({text:e,against:""}),K(""))})(e.target.value)});else{const e="groups"===L.target.type?L.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):L.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:L.target.placeholder},...V(e,j)];G=Y(L.label,j,t,_,e.length>10)}const X=/* @__PURE__ */st(dt,{children:[r&&Y(d.linkType,L.value,D.map(e=>({value:e.value,label:e.label})),e=>{k(null),x(!1);const t=D.find(t=>t.value===e);if(!t||"text"===t.target.type)return void w({kind:e,against:b});const r=Ya(t.target)[0];w({kind:e,against:r?r.value:""}),r?W(r.value,r.label):W("")},!1),G,E&&Y(d.filter,T?.param??"",[{value:"",label:d.noFilter},...T&&!B?[F(T.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return K(j,z?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&K(n.withFilter(j,{param:e,value:r.value}),r.label)},!1),E&&T&&Y(d.value,T.value,V((B?.values??[]).map(e=>({value:e.value,label:e.label})),T.value),e=>{if(!T)return;const t=B?.values.find(t=>t.value===e);K(n.withFilter(j,{param:T.param,value:e}),t?.label)},(B?.values.length??0)>10),R&&/* @__PURE__ */ct("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),L.hint&&/* @__PURE__ */ct("p",{className:"text-2xs leading-4 text-gray-400",children:L.hint}),E&&/* @__PURE__ */ct("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
224
224
  return ct("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__ */
@@ -229,17 +229,17 @@ return st("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min
229
229
  /* @__PURE__ */ct(U,{variant:"primary",size:"sm","data-window-action":"apply",onClick:H,disabled:i||""===q,children:d.apply})]})]})]})}function Qa({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:d=""}){const u=$e().link,[h,m]=Ge(!1),p=Xe(null),f=Ve(),g=()=>{m(!1),p.current?.focus()};/* @__PURE__ */
230
230
  return st("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),children:[
231
231
  /* @__PURE__ */ct(xt,{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)}),
232
- /* @__PURE__ */st("button",{ref:p,type:"button","aria-label":u.linkOf(e,n),"aria-expanded":h,"aria-controls":h?f:void 0,disabled:c,onClick:()=>m(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 ${x.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:[
232
+ /* @__PURE__ */st("button",{ref:p,type:"button","aria-label":u.linkOf(e,n),"aria-expanded":h,"aria-controls":h?f:void 0,disabled:c,onClick:()=>m(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 ${q.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:[
233
233
  /* @__PURE__ */ct(xe,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(n?"text-blue-600":"text-gray-400")}),
234
234
  /* @__PURE__ */ct("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||u.addLink})]}),h&&/* @__PURE__ */ct("div",{id:f,className:"mt-2",children:/* @__PURE__ */ct(Ja,{value:n,label:u.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),g()},onRemove:n?()=>{a(""),g()}:void 0,onCancel:g})})]})}var el=e=>e.preventDefault(),tl=e=>null!=e&&!1!==e,rl=["bold","italic","underline","strike","link","sup","sub","code"],nl=["left","center","right","justify"];function al(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 ll(e,t){const r=["bold","italic","underline","strike"].filter(t=>e.has(t)).length;return{color:r,link:r+(t?1:0)}}function il({offered:e,color:t,last:r,alignment:n,list:a,letterCase:l}){const i=rl.filter(t=>e.has(t)).length+(t?1:0)+(tl(r)?1:0),o=(n?nl.filter(e=>n.allow.includes(e)).length:0)+(a&&e.has("bullet")?1:0)+(a&&e.has("number")?1:0)+(e.has("quote")?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 ol(e,t){/* @__PURE__ */
235
- return ct(V,{content:e,children:t},t.key??void 0)}function sl({offered:e,pressed:t,onMark:r,color:n,linkOpen:a=!1,last:l,alignment:i,list:o,letterCase:s,disabled:c=!1,"aria-label":d,windows:h,className:m=""}){const p=$e().textToolbar,f=il({offered:e,color:n,last:l,alignment:i,list:o,letterCase:s});if(!f.words&&!f.paragraph)return null;const g=(e,t="")=>`rosh-tb-btn${e?" is-on":""}${t?` ${t}`:""}`,b=(n,l,i,o)=>e.has(n)?ol(l,/* @__PURE__ */ct(u,"link"===n?{pressed:a,className:g(a),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":a,"aria-keyshortcuts":o,disabled:c,onMouseDown:el,onClick:()=>r(n),children:i}:{className:g(Boolean(t[n])),"aria-label":l,"aria-pressed":Boolean(t[n]),"aria-keyshortcuts":o,disabled:c,onMouseDown:el,onClick:()=>r(n),children:i},n)):null,y=[["left",p.alignLeft,/* @__PURE__ */ct(xe,{name:"align-left"})],["center",p.alignCenter,/* @__PURE__ */ct(xe,{name:"align-center"})],["right",p.alignRight,/* @__PURE__ */ct(xe,{name:"align-right"})],["justify",p.alignJustify,/* @__PURE__ */ct(xe,{name:"align-justify"})]],x=i?nl.filter(e=>i.allow.includes(e)):[],v=i&&x.includes(i.value)?i.value:x[0],w=[["none",p.caseNone,/* @__PURE__ */ct(xe,{name:"case-normal"})],["upper",p.caseUpper,/* @__PURE__ */ct(xe,{name:"case-upper"})],["lower",p.caseLower,/* @__PURE__ */ct(xe,{name:"case-lower"})]],N=/* @__PURE__ */st(dt,{children:[b("bold",p.bold,/* @__PURE__ */ct(xe,{name:"bold"}),"Meta+B"),b("italic",p.italic,/* @__PURE__ */ct(xe,{name:"italic"}),"Meta+I"),b("underline",p.underline,/* @__PURE__ */ct(xe,{name:"underline"}),"Meta+U"),b("strike",p.strike,/* @__PURE__ */ct(xe,{name:"strike"})),n?ol(p.color,/* @__PURE__ */ct(u,{pressed:n.open,className:g(n.open,"rosh-tb-color"),"aria-label":p.color,"aria-haspopup":"dialog","aria-expanded":n.open,disabled:c,style:n.run?{"--rosh-tb-run":n.run}:void 0,onMouseDown:el,onClick:n.onToggle,children:/* @__PURE__ */ct(xe,{name:"text-color"})},"color")):null,b("link",p.link,/* @__PURE__ */ct(xe,{name:"link"}),"Meta+K"),b("sup",p.sup,/* @__PURE__ */ct(xe,{name:"superscript"})),b("sub",p.sub,/* @__PURE__ */ct(xe,{name:"subscript"})),b("code",p.code,/* @__PURE__ */ct(xe,{name:"code"})),tl(l)?l:null]}),k=/* @__PURE__ */st(dt,{children:[i&&x.length>0?/* @__PURE__ */ct("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.alignment,onKeyDown:e=>al(e,x,e=>i.onChange(e)),children:y.map(([e,t,r])=>i.allow.includes(e)?ol(t,/* @__PURE__ */ct(u,{role:"radio",pressed:i.value===e,className:g(i.value===e),"aria-checked":i.value===e,"aria-label":t,tabIndex:e===v?0:-1,disabled:c||i.disabled,onMouseDown:el,onClick:()=>i.onChange(e),children:r},e)):null)}):null,o&&e.has("bullet")?ol(p.bullet,/* @__PURE__ */ct(u,{className:g("bullet"===o.pressed),"aria-label":p.bullet,"aria-pressed":"bullet"===o.pressed,disabled:c,onMouseDown:el,onClick:()=>o.onList("bullet"),children:/* @__PURE__ */ct(xe,{name:"list"})},"bullet")):null,o&&e.has("number")?ol(p.number,/* @__PURE__ */ct(u,{className:g("number"===o.pressed),"aria-label":p.number,"aria-pressed":"number"===o.pressed,disabled:c,onMouseDown:el,onClick:()=>o.onList("number"),children:/* @__PURE__ */ct(xe,{name:"numbered-list"})},"number")):null,b("quote",p.quote,/* @__PURE__ */ct(xe,{name:"quote"})),s?/* @__PURE__ */ct("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":p.letterCase,onKeyDown:e=>al(e,w.map(([e])=>e),e=>s.onChange(e)),children:w.map(([e,t,r])=>ol(t,/* @__PURE__ */ct(u,{role:"radio",pressed:s.value===e,className:g(s.value===e),"aria-checked":s.value===e,"aria-label":t,tabIndex:e===(s.value||"none")?0:-1,disabled:c||s.disabled,onMouseDown:el,onClick:()=>s.onChange(s.value===e?"":e),children:r},e)))}):null]}),$=f.flow?" is-flow":f.oneRow?" is-one-row":f.words&&void 0===l?" is-eight":"",M=ll(e,Boolean(n)),C={"--rosh-tb-color-col":String(M.color),"--rosh-tb-link-col":String(M.link)};let D;return D=f.flow?/* @__PURE__ */st("div",{className:"rosh-tb-row is-flow",children:[N,
236
- /* @__PURE__ */ct("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),k]}):f.oneRow?/* @__PURE__ */st("div",{className:"rosh-tb-row is-one-row",children:[
237
- /* @__PURE__ */ct("div",{className:"rosh-tb-words",children:N}),
238
- /* @__PURE__ */ct("div",{className:"rosh-tb-para",children:k})]}):/* @__PURE__ */st(dt,{children:[f.words?/* @__PURE__ */ct("div",{className:"rosh-tb-row"+(void 0===l?" is-eight":""),children:N}):null,f.paragraph?/* @__PURE__ */ct("div",{className:"rosh-tb-row",children:k}):null]}),/* @__PURE__ */st("div",{className:`rosh-tb-wrap${$} ${m}`.trim(),style:C,children:[
239
- /* @__PURE__ */ct("div",{className:"rosh-tb",role:"toolbar","aria-label":d??p.formatting,children:D}),h]})}var cl={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},dl=["tl","tr","bl","br"];function ul({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:c=1,radiusPlaceholder:d,disabled:h=!1,disabledReason:m,id:p,className:f=""}){const g=$e(),b=function(e){const t=dl.map(t=>e.find(e=>e.value===t));for(const r of e){if(dl.includes(r.value))continue;const e=t.findIndex(e=>void 0===e);-1===e?t.push(r):t[e]=r}return t.filter(e=>void 0!==e)}(r),[y,x]=Ge(0),v=Xe(null);/* @__PURE__ */
240
- return st("div",{id:p,role:"group","aria-label":e,className:`flex min-w-0 flex-wrap items-center gap-2 ${f}`.trim(),children:[l&&
241
- /* @__PURE__ */ct("div",{className:"w-30 shrink-0",children:/* @__PURE__ */ct(Pn,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */ct("span",{"data-radius-mark":"","aria-hidden":"true",children:g.corners.radiusMark}),suffix:g.corners.unit,steppers:"compact",disabled:h,"aria-label":i??g.corners.radius})}),
242
- /* @__PURE__ */ct("div",{ref:v,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const t=Array.from(v.current?.querySelectorAll("button[data-corner]")??[]),r=t.indexOf(document.activeElement);if(-1===r)return;const n=r%2,a=Math.floor(r/2),l="ArrowRight"===e.key?2*a+1:"ArrowLeft"===e.key?2*a:"ArrowDown"===e.key?2+n:"ArrowUp"===e.key?n:null;null!==l&&(e.preventDefault(),l<t.length&&t[l].focus())},children:b.map((e,r)=>{const a=t.includes(e.value),l=h||!0===e.disabled,i=l&&(!0===e.disabled&&e.title||(h?m:void 0))||void 0,o=/* @__PURE__ */ct(u,{"aria-pressed":a,"aria-label":e.label,"aria-disabled":l||void 0,disabledReason:i,"data-corner":e.value,size:"sm",tabIndex:r===y?0:-1,onFocus:()=>x(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */ct(xe,{name:"corner",strokeWidth:2,className:["h-4 w-4",cl[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */ct(V,{content:e.title??e.label,children:o},e.value)})})]})}var hl={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function ml({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=Ve(),c=Xe([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
235
+ return ct(V,{content:e,children:t},t.key??void 0)}function sl({offered:e,pressed:t,onMark:r,color:n,linkOpen:a=!1,last:l,alignment:i,list:o,letterCase:s,disabled:c=!1,"aria-label":d,windows:u,className:h=""}){const m=$e().textToolbar,p=il({offered:e,color:n,last:l,alignment:i,list:o,letterCase:s});if(!p.words&&!p.paragraph)return null;const f=(e,t="")=>`rosh-tb-btn${e?" is-on":""}${t?` ${t}`:""}`,g=(n,l,i,o)=>e.has(n)?ol(l,/* @__PURE__ */ct(T,"link"===n?{pressed:a,className:f(a),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":a,"aria-keyshortcuts":o,disabled:c,onMouseDown:el,onClick:()=>r(n),children:i}:{className:f(Boolean(t[n])),"aria-label":l,"aria-pressed":Boolean(t[n]),"aria-keyshortcuts":o,disabled:c,onMouseDown:el,onClick:()=>r(n),children:i},n)):null,b=[["left",m.alignLeft,/* @__PURE__ */ct(xe,{name:"align-left"})],["center",m.alignCenter,/* @__PURE__ */ct(xe,{name:"align-center"})],["right",m.alignRight,/* @__PURE__ */ct(xe,{name:"align-right"})],["justify",m.alignJustify,/* @__PURE__ */ct(xe,{name:"align-justify"})]],y=i?nl.filter(e=>i.allow.includes(e)):[],x=i&&y.includes(i.value)?i.value:y[0],v=[["none",m.caseNone,/* @__PURE__ */ct(xe,{name:"case-normal"})],["upper",m.caseUpper,/* @__PURE__ */ct(xe,{name:"case-upper"})],["lower",m.caseLower,/* @__PURE__ */ct(xe,{name:"case-lower"})]],w=/* @__PURE__ */st(dt,{children:[g("bold",m.bold,/* @__PURE__ */ct(xe,{name:"bold"}),"Meta+B"),g("italic",m.italic,/* @__PURE__ */ct(xe,{name:"italic"}),"Meta+I"),g("underline",m.underline,/* @__PURE__ */ct(xe,{name:"underline"}),"Meta+U"),g("strike",m.strike,/* @__PURE__ */ct(xe,{name:"strike"})),n?ol(m.color,/* @__PURE__ */ct(T,{pressed:n.open,className:f(n.open,"rosh-tb-color"),"aria-label":m.color,"aria-haspopup":"dialog","aria-expanded":n.open,disabled:c,style:n.run?{"--rosh-tb-run":n.run}:void 0,onMouseDown:el,onClick:n.onToggle,children:/* @__PURE__ */ct(xe,{name:"text-color"})},"color")):null,g("link",m.link,/* @__PURE__ */ct(xe,{name:"link"}),"Meta+K"),g("sup",m.sup,/* @__PURE__ */ct(xe,{name:"superscript"})),g("sub",m.sub,/* @__PURE__ */ct(xe,{name:"subscript"})),g("code",m.code,/* @__PURE__ */ct(xe,{name:"code"})),tl(l)?l:null]}),N=/* @__PURE__ */st(dt,{children:[i&&y.length>0?/* @__PURE__ */ct("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":m.alignment,onKeyDown:e=>al(e,y,e=>i.onChange(e)),children:b.map(([e,t,r])=>i.allow.includes(e)?ol(t,/* @__PURE__ */ct(T,{role:"radio",pressed:i.value===e,className:f(i.value===e),"aria-checked":i.value===e,"aria-label":t,tabIndex:e===x?0:-1,disabled:c||i.disabled,onMouseDown:el,onClick:()=>i.onChange(e),children:r},e)):null)}):null,o&&e.has("bullet")?ol(m.bullet,/* @__PURE__ */ct(T,{className:f("bullet"===o.pressed),"aria-label":m.bullet,"aria-pressed":"bullet"===o.pressed,disabled:c,onMouseDown:el,onClick:()=>o.onList("bullet"),children:/* @__PURE__ */ct(xe,{name:"list"})},"bullet")):null,o&&e.has("number")?ol(m.number,/* @__PURE__ */ct(T,{className:f("number"===o.pressed),"aria-label":m.number,"aria-pressed":"number"===o.pressed,disabled:c,onMouseDown:el,onClick:()=>o.onList("number"),children:/* @__PURE__ */ct(xe,{name:"numbered-list"})},"number")):null,g("quote",m.quote,/* @__PURE__ */ct(xe,{name:"quote"})),s?/* @__PURE__ */ct("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":m.letterCase,onKeyDown:e=>al(e,v.map(([e])=>e),e=>s.onChange(e)),children:v.map(([e,t,r])=>ol(t,/* @__PURE__ */ct(T,{role:"radio",pressed:s.value===e,className:f(s.value===e),"aria-checked":s.value===e,"aria-label":t,tabIndex:e===(s.value||"none")?0:-1,disabled:c||s.disabled,onMouseDown:el,onClick:()=>s.onChange(s.value===e?"":e),children:r},e)))}):null]}),k=p.flow?" is-flow":p.oneRow?" is-one-row":p.words&&void 0===l?" is-eight":"",$=ll(e,Boolean(n)),M={"--rosh-tb-color-col":String($.color),"--rosh-tb-link-col":String($.link)};let C;return C=p.flow?/* @__PURE__ */st("div",{className:"rosh-tb-row is-flow",children:[w,
236
+ /* @__PURE__ */ct("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),N]}):p.oneRow?/* @__PURE__ */st("div",{className:"rosh-tb-row is-one-row",children:[
237
+ /* @__PURE__ */ct("div",{className:"rosh-tb-words",children:w}),
238
+ /* @__PURE__ */ct("div",{className:"rosh-tb-para",children:N})]}):/* @__PURE__ */st(dt,{children:[p.words?/* @__PURE__ */ct("div",{className:"rosh-tb-row"+(void 0===l?" is-eight":""),children:w}):null,p.paragraph?/* @__PURE__ */ct("div",{className:"rosh-tb-row",children:N}):null]}),/* @__PURE__ */st("div",{className:`rosh-tb-wrap${k} ${h}`.trim(),style:M,children:[
239
+ /* @__PURE__ */ct("div",{className:"rosh-tb",role:"toolbar","aria-label":d??m.formatting,children:C}),u]})}var cl={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},dl=["tl","tr","bl","br"];function ul({label:e,value:t,corners:r,onChange:n,radius:a=null,onRadiusChange:l,radiusLabel:i,radiusMin:o=0,radiusMax:s,radiusStep:c=1,radiusPlaceholder:d,disabled:u=!1,disabledReason:h,id:m,className:p=""}){const f=$e(),g=function(e){const t=dl.map(t=>e.find(e=>e.value===t));for(const r of e){if(dl.includes(r.value))continue;const e=t.findIndex(e=>void 0===e);-1===e?t.push(r):t[e]=r}return t.filter(e=>void 0!==e)}(r),[b,y]=Ge(0),x=Xe(null);/* @__PURE__ */
240
+ return st("div",{id:m,role:"group","aria-label":e,className:`flex min-w-0 flex-wrap items-center gap-2 ${p}`.trim(),children:[l&&
241
+ /* @__PURE__ */ct("div",{className:"w-30 shrink-0",children:/* @__PURE__ */ct(Pn,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */ct("span",{"data-radius-mark":"","aria-hidden":"true",children:f.corners.radiusMark}),suffix:f.corners.unit,steppers:"compact",disabled:u,"aria-label":i??f.corners.radius})}),
242
+ /* @__PURE__ */ct("div",{ref:x,"data-corners-grid":"",className:"grid shrink-0 grid-cols-2 gap-1",onKeyDown:e=>{if(e.altKey||e.ctrlKey||e.metaKey)return;const t=Array.from(x.current?.querySelectorAll("button[data-corner]")??[]),r=t.indexOf(document.activeElement);if(-1===r)return;const n=r%2,a=Math.floor(r/2),l="ArrowRight"===e.key?2*a+1:"ArrowLeft"===e.key?2*a:"ArrowDown"===e.key?2+n:"ArrowUp"===e.key?n:null;null!==l&&(e.preventDefault(),l<t.length&&t[l].focus())},children:g.map((e,r)=>{const a=t.includes(e.value),l=u||!0===e.disabled,i=l&&(!0===e.disabled&&e.title||(u?h:void 0))||void 0,o=/* @__PURE__ */ct(T,{"aria-pressed":a,"aria-label":e.label,"aria-disabled":l||void 0,disabledReason:i,"data-corner":e.value,size:"sm",tabIndex:r===b?0:-1,onFocus:()=>y(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */ct(xe,{name:"corner",strokeWidth:2,className:["h-4 w-4",cl[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */ct(V,{content:e.title??e.label,children:o},e.value)})})]})}var hl={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function ml({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=Ve(),c=Xe([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
243
243
  return ct("div",{id:i,role:"radiogroup","aria-label":e,className:`grid w-max grid-cols-3 gap-px overflow-hidden rounded-(--radius-control) border border-gray-200 bg-gray-200 ${o}`.trim(),children:r.map((e,i)=>{const o=t===e.value,d=a||!0===e.disabled,u=d&&(!0===e.disabled&&e.title||(a?l:void 0))||void 0,m=`${s}-${i}`,p=/* @__PURE__ */ct("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":te(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=hl[l.key];if(!i)return;l.preventDefault();const o=Math.floor(e/3)+i[0],s=e%3+i[1];if(o<0||s<0||s>=3)return;const d=3*o+s;if(d>=r.length)return;c.current[d]?.focus();const u=r[d];a||!0===u.disabled||u.value===t||n(u.value)})(i,e),onClick:d?ee:()=>n(e.value),className:"group relative flex size-(--control-height-lg) items-center justify-center transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring)] aria-disabled:cursor-not-allowed aria-disabled:opacity-60 "+(o?"bg-blue-50 hover:bg-blue-100":"bg-white hover:bg-gray-50"),children:e.icon?/* @__PURE__ */ct("span",{"data-icon-slot":"","aria-hidden":"true",className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4 "+(o?"text-blue-700":"text-gray-500 group-hover:text-gray-700"),children:e.icon}):/* @__PURE__ */ct("span",{"data-dot":"","aria-hidden":"true",className:o?"size-3 rounded-sm bg-blue-600":"size-1 rounded-full bg-[color:var(--ink-faintest)] transition-colors group-hover:bg-[color:var(--ink-faint)]"})},e.value);return u?/* @__PURE__ */ct(re,{reason:u,id:m,block:!0,children:p},e.value):/* @__PURE__ */ct(V,{content:e.title??e.label,className:"relative flex",children:p},e.value)})})}var pl=Ue(function({files:e,onChange:t,accept:r,acceptHint:n,multiple:a=!0,maxSizeBytes:l,maxFiles:i,disabled:o=!1,label:s,hint:c,error:d,required:u,className:h=""},m){const p=Ve(),f=$e().files,g=we({accept:r,acceptHint:n,maxSizeBytes:l,maxFiles:i,multiple:a,disabled:o,currentCount:e.length,onAccept:r=>t(a?[...e,...r]:r.slice(0,1))}),b=d?`${p}-error`:c?`${p}-hint`:void 0;/* @__PURE__ */
244
244
  return st(_t,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
245
245
  /* @__PURE__ */st("button",{ref:m,type:"button",id:p,disabled:o,onClick:g.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...g.zoneProps,className:hr(g.dragOver,o,mr(o),"px-4 py-6"),children:[
@@ -258,16 +258,16 @@ return st("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,childr
258
258
  return st("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__ */ct("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */ct("span",{className:"text-gray-400",children:/* @__PURE__ */ct(gl,{})}),
259
259
  /* @__PURE__ */ct("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
260
260
  /* @__PURE__ */ct("span",{className:"shrink-0 tabular-nums text-gray-400",children:Ne(e.size,a)}),t&&/* @__PURE__ */ct("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__ */ct(br,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function xl({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=$e().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */st("span",{className:"relative inline-flex",children:[
261
- /* @__PURE__ */ct(u,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */ct(fl,{})}),t>0&&/* @__PURE__ */ct("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__ */ct(U,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */ct(fl,{}),children:o})}function vl({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=we({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),f=Xe([]);return Qe(()=>{u&&p.rejections.length>0&&p.rejections!==f.current&&(f.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */st(bl,{intake:p,dropLabel:o,className:h,children:[m,
261
+ /* @__PURE__ */ct(T,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */ct(fl,{})}),t>0&&/* @__PURE__ */ct("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__ */ct(U,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */ct(fl,{}),children:o})}function vl({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=we({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),f=Xe([]);return Qe(()=>{u&&p.rejections.length>0&&p.rejections!==f.current&&(f.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */st(bl,{intake:p,dropLabel:o,className:h,children:[m,
262
262
  /* @__PURE__ */ct(yl,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
263
263
  /* @__PURE__ */st("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
264
264
  /* @__PURE__ */ct(xl,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
265
- /* @__PURE__ */ct(ke,{rejections:p.rejections})]})}var wl={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${k.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function Nl({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s="",tone:c,tooltip:d,split:u}){const[m,p]=Ge(!1),[f,g]=Ge(""),b=$e(),y=Xe(null),x=Xe(null),v=Xe(null),w=Y(y,m),N=e=>r.find(t=>t.value===e)?.label??e,k=Ze(()=>{const t=new Set(e),n=[],a=f.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!zt(e,a)||n.push(e));return n},[r,e,f]),$=n=>{const l=[...e];for(const e of n){const t=e.trim();if(!t)continue;const n=t.toLowerCase(),i=r.find(e=>e.value===t||e.label.toLowerCase()===n)?.value,o=i??(a?t:null);o&&!l.includes(o)&&l.push(o)}l.length!==e.length&&t(l)},M=r=>{r&&!e.includes(r)?(t([...e,r]),g("")):g("")},C=r=>t(e.filter(e=>e!==r)),D=()=>{const e=f.trim();if(u&&e)return $(e.split(u)),void g("");a&&e?M(e):g("")},S=Xe(()=>{});S.current=()=>{D(),p(!1)},Qe(()=>{if(!m)return;const e=e=>{const t=e.target;y.current?.contains(t)||v.current?.contains(t)||(D(),p(!1))};document.addEventListener("mousedown",e);const t=de(()=>S.current());return()=>{document.removeEventListener("mousedown",e),t()}});const L=r.length>0;/* @__PURE__ */
266
- return st("div",{ref:y,className:"relative",children:[
267
- /* @__PURE__ */st("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),x.current?.focus())},className:h({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)] ${i?"bg-gray-50 cursor-not-allowed":""} ${s}`}),children:[e.map(e=>{const t=c?.(e),r=wl[t??"accent"],n=/* @__PURE__ */st("span",{"data-tone":t,className:r.chip,children:[
268
- /* @__PURE__ */ct("span",{className:"truncate",children:N(e)}),!i&&/* @__PURE__ */ct("button",{type:"button","aria-label":b.select.removeItem?.(N(e))??`${b.select.remove} ${N(e)}`,onClick:()=>C(e),className:r.remove,children:"×"})]},e),a=d?.(e);return null==a?n:/* @__PURE__ */ct(V,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
269
- /* @__PURE__ */ct("input",{id:o,ref:x,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&L,"aria-invalid":l||void 0,disabled:i,value:f,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(u){const t=e.split(u);if(t.length>1)return $(t.slice(0,-1)),void g(t[t.length-1])}g(e)})(e.target.value),p(!0)},onFocus:()=>{!i&&L&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=f.trim(),r=e?k.filter(t=>zt(t,e.toLowerCase())):[];1===r.length?M(r[0].value):D()}else"Backspace"===t.key&&""===f&&e.length>0?C(e[e.length-1]):"Escape"===t.key?(p(!1),g(""),x.current?.blur()):"Tab"===t.key&&(D(),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&&L&&ut(
270
- /* @__PURE__ */ct("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ue.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??ne,width:"max-content",visibility:w?void 0:"hidden",...oe()},children:/* @__PURE__ */ct("div",{className:"overflow-y-auto",style:{maxHeight:w?.maxHeight??G},children:0===k.length?/* @__PURE__ */ct("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}):k.map(e=>/* @__PURE__ */ct("button",{type:"button",onMouseDown:t=>{t.preventDefault(),M(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__ */st(dt,{children:[
265
+ /* @__PURE__ */ct(ke,{rejections:p.rejections})]})}var wl={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${d.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function Nl({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:l,disabled:i,id:o,className:s="",tone:c,tooltip:d,split:u}){const[h,m]=Ge(!1),[p,f]=Ge(""),g=$e(),b=Xe(null),y=Xe(null),x=Xe(null),v=Y(b,h),w=e=>r.find(t=>t.value===e)?.label??e,N=Ze(()=>{const t=new Set(e),n=[],a=p.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!zt(e,a)||n.push(e));return n},[r,e,p]),k=n=>{const l=[...e];for(const e of n){const t=e.trim();if(!t)continue;const n=t.toLowerCase(),i=r.find(e=>e.value===t||e.label.toLowerCase()===n)?.value,o=i??(a?t:null);o&&!l.includes(o)&&l.push(o)}l.length!==e.length&&t(l)},$=r=>{r&&!e.includes(r)?(t([...e,r]),f("")):f("")},M=r=>t(e.filter(e=>e!==r)),C=()=>{const e=p.trim();if(u&&e)return k(e.split(u)),void f("");a&&e?$(e):f("")},D=Xe(()=>{});D.current=()=>{C(),m(!1)},Qe(()=>{if(!h)return;const e=e=>{const t=e.target;b.current?.contains(t)||x.current?.contains(t)||(C(),m(!1))};document.addEventListener("mousedown",e);const t=de(()=>D.current());return()=>{document.removeEventListener("mousedown",e),t()}});const S=r.length>0;/* @__PURE__ */
266
+ return st("div",{ref:b,className:"relative",children:[
267
+ /* @__PURE__ */st("div",{onMouseDown:e=>{i||e.target.closest("button")||(e.preventDefault(),y.current?.focus())},className:B({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)] ${i?"bg-gray-50 cursor-not-allowed":""} ${s}`}),children:[e.map(e=>{const t=c?.(e),r=wl[t??"accent"],n=/* @__PURE__ */st("span",{"data-tone":t,className:r.chip,children:[
268
+ /* @__PURE__ */ct("span",{className:"truncate",children:w(e)}),!i&&/* @__PURE__ */ct("button",{type:"button","aria-label":g.select.removeItem?.(w(e))??`${g.select.remove} ${w(e)}`,onClick:()=>M(e),className:r.remove,children:"×"})]},e),a=d?.(e);return null==a?n:/* @__PURE__ */ct(V,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
269
+ /* @__PURE__ */ct("input",{id:o,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":h&&S,"aria-invalid":l||void 0,disabled:i,value:p,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(u){const t=e.split(u);if(t.length>1)return k(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),m(!0)},onFocus:()=>{!i&&S&&m(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=p.trim(),r=e?N.filter(t=>zt(t,e.toLowerCase())):[];1===r.length?$(r[0].value):C()}else"Backspace"===t.key&&""===p&&e.length>0?M(e[e.length-1]):"Escape"===t.key?(m(!1),f(""),y.current?.blur()):"Tab"===t.key&&(C(),m(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),h&&S&&ut(
270
+ /* @__PURE__ */ct("div",{ref:x,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:ue.popup,left:v?.left,right:v?.right,top:v?.top,bottom:v?.bottom,minWidth:v?.minWidth,maxWidth:v?.maxWidth??ne,width:"max-content",visibility:v?void 0:"hidden",...oe()},children:/* @__PURE__ */ct("div",{className:"overflow-y-auto",style:{maxHeight:v?.maxHeight??G},children:0===N.length?/* @__PURE__ */ct("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?g.select.allSelected:g.select.noMatches}):N.map(e=>/* @__PURE__ */ct("button",{type:"button",onMouseDown:t=>{t.preventDefault(),$(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__ */st(dt,{children:[
271
271
  /* @__PURE__ */ct("span",{className:"min-w-0 truncate",children:e.label}),
272
272
  /* @__PURE__ */ct(Ft,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var kl={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"}},$l={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function Ml({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=kl[l??(a?"md":"none")],p=Ve(),f=Ve(),g=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,y=`h${i}`,x=null!=s&&""!==s,v=b||x,w=v?"section":"div",N=`rounded-(--radius-card) border ${$l[h]} bg-white shadow-sm ${c}`.trim(),k=rt.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",D=M?"rounded-t-(--radius-card) bg-blue-50 ":"",S=`${$}${D}${m.edge} ${C}`;/* @__PURE__ */
273
273
  return st(w,{className:N,style:u,...x?{"aria-label":s}:b?{"aria-labelledby":p}:{},...g&&v?{"aria-describedby":f}:{},...M?{"aria-current":!0}:{},children:[g?
@@ -310,7 +310,7 @@ return st("div",{className:C,"data-setting-row":"compact"===c?c:void 0,children:
310
310
  /* @__PURE__ */ct("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:r})]}):null!=r?/* @__PURE__ */st("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[y&&/* @__PURE__ */ct("div",{className:`${b.text} ${w}`,children:M}),r]}):y&&/* @__PURE__ */ct("div",{className:`shrink-0 ${b.text} ${w}`,children:M})]}),null!=l&&!1!==l&&/* @__PURE__ */ct("div",{className:`${b.bodyTop} border-t border-gray-100 ${b.bodyPad}`,children:l})]})}var pi=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function fi({label:e,onReset:t,view:r="desktop",detail:n,disabled:a}){const l=$e().settingView,i=Ve(),o="desktop"===r,s=o?l.resetName(e):l.inheritName(e),c=n?l.backTo(n):o?l.backToDefault:l.backToAuto;
311
311
  /* @__PURE__ */
312
312
  return st(V,{content:l.tip(s,c),describe:!1,children:[
313
- /* @__PURE__ */ct(u,{size:"sm","aria-label":s,"aria-describedby":i,disabled:a,className:"relative before:absolute before:-top-2.5 before:-bottom-2.5 before:-left-1 before:-right-4",onClick:e=>{t(),function(e){const t=e.currentTarget,r=t.closest("[data-setting-reset]")??t;let n=r.parentElement;for(let e=0;n&&e<4;e+=1,n=n.parentElement){const e=[...n.querySelectorAll(pi)].find(e=>!r.contains(e)&&!e.closest('[aria-hidden="true"]'));if(e)return void e.focus()}}(e)},children:/* @__PURE__ */ct(xe,{name:"revert",size:16,"aria-hidden":"true"})}),
313
+ /* @__PURE__ */ct(T,{size:"sm","aria-label":s,"aria-describedby":i,disabled:a,className:"relative before:absolute before:-top-2.5 before:-bottom-2.5 before:-left-1 before:-right-4",onClick:e=>{t(),function(e){const t=e.currentTarget,r=t.closest("[data-setting-reset]")??t;let n=r.parentElement;for(let e=0;n&&e<4;e+=1,n=n.parentElement){const e=[...n.querySelectorAll(pi)].find(e=>!r.contains(e)&&!e.closest('[aria-hidden="true"]'));if(e)return void e.focus()}}(e)},children:/* @__PURE__ */ct(xe,{name:"revert",size:16,"aria-hidden":"true"})}),
314
314
  /* @__PURE__ */ct("span",{id:i,hidden:!0,children:c})]})}function gi({rule:e,values:t,context:r,children:n}){return Fe(e,t,r)?/* @__PURE__ */ct(dt,{children:n}):null}var bi={sm:"text-lg",md:"text-2xl",lg:"text-3xl"},yi={default:"text-gray-900",success:"text-green-600",danger:"text-red-600",muted:"text-gray-500"};function xi({title:e,value:t,precision:r,prefix:n,suffix:a,tone:l="default",size:i="md",className:o=""}){const s=Me(),c="number"!=typeof t?t:null!=r?Ae(t,r,s):s?Le(t,s):t;/* @__PURE__ */
315
315
  return st("div",{className:o,children:[e&&/* @__PURE__ */ct("div",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:e}),
316
316
  /* @__PURE__ */st("div",{className:`mt-1 flex items-baseline gap-1 ${yi[l]}`,children:[n&&/* @__PURE__ */ct("span",{className:"text-sm",children:n}),
@@ -505,27 +505,27 @@ return st("div",{className:"flex items-center gap-2",children:[
505
505
  /* @__PURE__ */ct("span",{className:"text-gray-400",children:"/"}),
506
506
  /* @__PURE__ */st("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
507
507
  /* @__PURE__ */ct("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(D)]})]}):/* @__PURE__ */ct("b",{className:"text-gray-700",children:h.volume(S)})]}),
508
- /* @__PURE__ */st("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",j," × ",L]})]})]}):/* @__PURE__ */ct("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var ds=({open:e})=>/* @__PURE__ */ct(xe,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function us({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:i,emptyMessage:o}){const c=$e(),[d,u]=Ge(""),[h,p]=Ge(null),[f,g]=Ge({}),b=d.trim().toLowerCase(),y=Ze(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),x=e=>!b||e.title.toLowerCase().includes(b)||e.body.toLowerCase().includes(b)||e.category_label.toLowerCase().includes(b),v=Ze(()=>y.map(e=>({...e,docs:e.docs.filter(x)})).filter(e=>e.docs.length>0),[y,b]),w=Ze(()=>v.flatMap(e=>e.docs),[v]),N=(h?w.find(e=>e.slug===h):void 0)??w[0]??null,k=e=>!!b||(f[e]??e===N?.category);/* @__PURE__ */
508
+ /* @__PURE__ */st("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",j," × ",L]})]})]}):/* @__PURE__ */ct("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var ds=({open:e})=>/* @__PURE__ */ct(xe,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function us({docs:e,loading:t=!1,categoryOrder:r,canEdit:n=!1,onNew:a,onEdit:l,renderBody:i,emptyMessage:o}){const s=$e(),[c,d]=Ge(""),[u,h]=Ge(null),[m,p]=Ge({}),f=c.trim().toLowerCase(),g=Ze(()=>{const t=/* @__PURE__ */new Map;for(const r of e){let e=t.get(r.category);e||(e={key:r.category,label:r.category_label||r.category,docs:[]},t.set(r.category,e)),e.docs.push(r)}if(!r?.length)return[...t.values()];const n=new Map(r.map((e,t)=>[e,t]));return[...t.values()].sort((e,t)=>(n.get(e.key)??1/0)-(n.get(t.key)??1/0))},[e,r]),b=e=>!f||e.title.toLowerCase().includes(f)||e.body.toLowerCase().includes(f)||e.category_label.toLowerCase().includes(f),y=Ze(()=>g.map(e=>({...e,docs:e.docs.filter(b)})).filter(e=>e.docs.length>0),[g,f]),x=Ze(()=>y.flatMap(e=>e.docs),[y]),v=(u?x.find(e=>e.slug===u):void 0)??x[0]??null,w=e=>!!f||(m[e]??e===v?.category);/* @__PURE__ */
509
509
  return st("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
510
510
  /* @__PURE__ */st("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
511
511
  /* @__PURE__ */st("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
512
- /* @__PURE__ */ct("h2",{className:"text-sm font-semibold text-gray-900",children:c.help.title}),n&&a&&/* @__PURE__ */ct("button",{type:"button",onClick:a,className:"text-xs text-blue-600 hover:underline",children:c.help.newArticle})]}),
512
+ /* @__PURE__ */ct("h2",{className:"text-sm font-semibold text-gray-900",children:s.help.title}),n&&a&&/* @__PURE__ */ct("button",{type:"button",onClick:a,className:"text-xs text-blue-600 hover:underline",children:s.help.newArticle})]}),
513
513
  /* @__PURE__ */ct("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */st("div",{className:"relative",children:[
514
- /* @__PURE__ */ct(xe,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${m}`,"aria-hidden":"true"}),
515
- /* @__PURE__ */ct("input",{type:"text",value:d,onChange:e=>u(e.target.value),placeholder:c.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
516
- /* @__PURE__ */ct("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */ct(He,{size:"sm",padding:"py-6",label:c.help.loading}):0===v.length?/* @__PURE__ */ct("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:b?c.help.noResults:o??c.help.empty}):v.map(e=>{const t=k(e.key);/* @__PURE__ */
514
+ /* @__PURE__ */ct(xe,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${I}`,"aria-hidden":"true"}),
515
+ /* @__PURE__ */ct("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:s.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
516
+ /* @__PURE__ */ct("div",{className:"flex-1 overflow-y-auto py-1",children:t?/* @__PURE__ */ct(He,{size:"sm",padding:"py-6",label:s.help.loading}):0===y.length?/* @__PURE__ */ct("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:f?s.help.noResults:o??s.help.empty}):y.map(e=>{const t=w(e.key);/* @__PURE__ */
517
517
  return st("div",{className:"py-0.5",children:[
518
- /* @__PURE__ */st("button",{type:"button",onClick:()=>{return t=e.key,g(e=>({...e,[t]:!k(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
518
+ /* @__PURE__ */st("button",{type:"button",onClick:()=>{return t=e.key,p(e=>({...e,[t]:!w(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
519
519
  /* @__PURE__ */ct(ds,{open:t}),
520
- /* @__PURE__ */ct("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=N?.slug===e.slug;/* @__PURE__ */
521
- return st("button",{type:"button",onClick:()=>p(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
522
- /* @__PURE__ */ct("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */ct("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:c.help.draft})]},e.slug)})]},e.key)})})]}),
523
- /* @__PURE__ */ct("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:N?/* @__PURE__ */st(dt,{children:[
520
+ /* @__PURE__ */ct("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=v?.slug===e.slug;/* @__PURE__ */
521
+ return st("button",{type:"button",onClick:()=>h(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
522
+ /* @__PURE__ */ct("span",{className:"truncate",children:e.title}),!1===e.is_published&&/* @__PURE__ */ct("span",{className:"ml-auto shrink-0 text-2xs text-amber-600",children:s.help.draft})]},e.slug)})]},e.key)})})]}),
523
+ /* @__PURE__ */ct("main",{className:"flex-1 min-w-0 bg-white rounded-lg shadow overflow-hidden flex flex-col",children:v?/* @__PURE__ */st(dt,{children:[
524
524
  /* @__PURE__ */st("div",{className:"flex items-start justify-between gap-4 px-5 py-3 border-b border-gray-200 bg-gray-50 shrink-0",children:[
525
525
  /* @__PURE__ */st("div",{className:"min-w-0",children:[
526
- /* @__PURE__ */ct("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:N.title}),
527
- /* @__PURE__ */st("p",{className:"text-xs text-gray-500 mt-0.5",children:[N.category_label,!1===N.is_published&&/* @__PURE__ */st("span",{className:"ml-2 text-amber-600",children:["· ",c.help.draft]})]})]}),n&&l&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>l(N),className:"shrink-0 text-sm text-blue-600 hover:underline",children:c.help.edit})]}),
528
- /* @__PURE__ */ct("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(N):N.body?/* @__PURE__ */ct(s,{children:N.body}):/* @__PURE__ */ct("p",{className:"text-sm text-gray-500 italic",children:c.help.noBody})})]}):/* @__PURE__ */ct("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */ct(He,{size:"sm",padding:"",label:c.help.loading}):/* @__PURE__ */ct("p",{className:"text-sm text-gray-500",children:c.help.pickArticle})})})]})}var hs={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 ms({children:e,onClick:r,variant:n="primary",hotkey:a,disabled:l=!1,type:i="button",title:o,className:s=""}){const c=t();/* @__PURE__ */
526
+ /* @__PURE__ */ct("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:v.title}),
527
+ /* @__PURE__ */st("p",{className:"text-xs text-gray-500 mt-0.5",children:[v.category_label,!1===v.is_published&&/* @__PURE__ */st("span",{className:"ml-2 text-amber-600",children:["· ",s.help.draft]})]})]}),n&&l&&/* @__PURE__ */ct("button",{type:"button",onClick:()=>l(v),className:"shrink-0 text-sm text-blue-600 hover:underline",children:s.help.edit})]}),
528
+ /* @__PURE__ */ct("div",{className:"flex-1 overflow-auto px-5 py-4",children:i?i(v):v.body?/* @__PURE__ */ct(z,{children:v.body}):/* @__PURE__ */ct("p",{className:"text-sm text-gray-500 italic",children:s.help.noBody})})]}):/* @__PURE__ */ct("div",{className:"flex-1 flex items-center justify-center px-6 text-center",children:t?/* @__PURE__ */ct(He,{size:"sm",padding:"",label:s.help.loading}):/* @__PURE__ */ct("p",{className:"text-sm text-gray-500",children:s.help.pickArticle})})})]})}var hs={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 ms({children:e,onClick:r,variant:n="primary",hotkey:a,disabled:l=!1,type:i="button",title:o,className:s=""}){const c=t();/* @__PURE__ */
529
529
  return ct("button",c?{type:i,onClick:r,disabled:l,title:o,className:`inline-flex h-8 max-w-full items-center justify-center rounded-lg px-3 text-sm font-medium transition-colors disabled:opacity-50 ${hs[n]} ${s}`,children:/* @__PURE__ */ct("span",{className:"truncate",children:e})}:{type:i,onClick:r,disabled:l,title:o,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 ${hs[n]} ${s}`,children:e})}function ps(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 fs({children:e,count:t}){return null==t?/* @__PURE__ */ct("p",{className:"px-3 pb-1 pt-1 text-2xs font-semibold uppercase tracking-wide text-gray-400",children:e}):/* @__PURE__ */st("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:[
530
530
  /* @__PURE__ */ct("span",{className:"min-w-0 truncate",children:e}),
531
531
  /* @__PURE__ */ct("span",{className:"shrink-0 normal-case tracking-normal tabular-nums",children:t})]})}function gs(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 bs({label:e,count:t,active:n,onClick:a,icon:l,trailing:i,severity:o,depth:s=0}){const c=Hi(o,"SidebarNavItem"),d=$e().severity,u=c?(m=d,(h=c).tone?m[h.tone]:m.unrecognised(h.token??"")):void 0;var h,m;const p=r(),f=Ve(),g=Xe(null),b=Xe(e);b.current=e,Qe(()=>{if(p&&n)return p.report(f,()=>b.current,g.current)},[p,n,f]);const y=/* @__PURE__ */st(dt,{children:[null!=l&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:l}),c&&
@@ -544,26 +544,26 @@ return st("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b bord
544
544
  return ct(ft,{trigger:/* @__PURE__ */ct(Ns,{item:e,active:r,caret:!0}),items:e.menu,align:"start",linkAs:l,disabled:e.disabled,className:"items-stretch",triggerClassName:`${xs} ${r?vs:ws}`},e.key)}const n=e.key===t;/* @__PURE__ */
545
545
  return ct("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:`${xs} ${n?vs:ws}`,children:/* @__PURE__ */ct(Ns,{item:e,active:n})},e.key)})}),a&&/* @__PURE__ */ct("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var $s=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function Ms({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=ge(),s=Xe(null),c=Xe(e);c.current=e;const d=Xe(t);d.current=t;const u=Je(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??$s)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*Q)}px`;const i=X({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]);pe(()=>{o&&u()}),Qe(()=>{if(!o)return;const e=ae(()=>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()?ut(
546
546
  /* @__PURE__ */ct("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:{...ie(),position:"fixed",left:0,top:0,zIndex:ue.popup},children:l}),document.body):null}function Cs(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function Ds({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Xe(null),[c,d]=Ge(null),u=Xe(t);u.current=t,pe(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=le({point:e,menu:r,bounds:Z(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=Xe(null),m=Xe(!1);Qe(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Qe(()=>{c&&!m.current&&o&&(m.current=!0,Cs(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),Qe(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=Cs(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]),Qe(()=>ce(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),Qe(()=>{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=Je(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=Cs(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())},[]),f=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
547
- return ct(T,{portal:!0,minWidth:l,style:f,onClose:t,className:i,children:/* @__PURE__ */ct(K.Provider,{value:!0,children:/* @__PURE__ */ct("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Ss(){const[e,t]=Ge(null),r=Je(()=>t(null),[]),n=Je((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(_(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=Je(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 Ls="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 js=/* @__PURE__ */st("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
547
+ return ct(k,{portal:!0,minWidth:l,style:f,onClose:t,className:i,children:/* @__PURE__ */ct(L.Provider,{value:!0,children:/* @__PURE__ */ct("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Ss(){const[e,t]=Ge(null),r=Je(()=>t(null),[]),n=Je((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(A(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=Je(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 Ls="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 js=/* @__PURE__ */st("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
548
548
  /* @__PURE__ */ct("circle",{cx:"2",cy:"3",r:"1.1"}),
549
549
  /* @__PURE__ */ct("circle",{cx:"2",cy:"7",r:"1.1"}),
550
550
  /* @__PURE__ */ct("circle",{cx:"2",cy:"11",r:"1.1"})]});function Ps({hint:e,dragging:t,revealClassName:r,marker:n}){const a=$e().tree;/* @__PURE__ */
551
551
  return ct(V,{content:e??a.dragHint,side:"left",delay:700,className:"absolute inset-y-0 left-0 inline-flex transition-opacity "+(t?"opacity-0":`opacity-0 ${r}`),children:/* @__PURE__ */ct("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-full w-2 items-center justify-center text-[color:var(--ink-faintest)]",children:js})})}function zs({id:e}){/* @__PURE__ */
552
552
  return ct("span",{id:e,hidden:!0,children:$e().tree.moveHint})}var Fs='[role="treeitem"]';function Es(e){return[...e.querySelectorAll(Fs)].filter(t=>{for(let r=t.parentElement?.closest('[role="group"]');r&&e.contains(r);r=r.parentElement?.closest('[role="group"]')??null)if(r.hasAttribute("hidden"))return!1;return!0})}function Ts({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=Xe(null);pe(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(Fs)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Es(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Je(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(Fs);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=Es(t),i=n.indexOf(r),o=Number(r.getAttribute("aria-level")??"1"),s=r=>{e.preventDefault(),function(e,t){if(t){for(const r of e.querySelectorAll(Fs))r.tabIndex=r===t?0:-1;t.focus()}}(t,r)};switch(e.key){case"ArrowDown":s(n[i+1]);break;case"ArrowUp":s(n[i-1]);break;case"Home":s(n[0]);break;case"End":s(n[n.length-1]);break;case"ArrowRight":if("true"===r.getAttribute("aria-expanded")){const t=n[i+1];t&&Number(t.getAttribute("aria-level")??"1")>o?s(t):e.preventDefault()}break;case"ArrowLeft":if("true"!==r.getAttribute("aria-expanded"))for(let e=i-1;e>=0;e--)if(Number(n[e].getAttribute("aria-level")??"1")<o){s(n[e]);break}}},[a]);/* @__PURE__ */
553
553
  return ct("div",{...a,ref:l,role:"tree","aria-label":t?void 0:e,"aria-labelledby":t,onKeyDown:i,className:`flex flex-col gap-1 ${n}`.trim(),children:r})}function Bs({children:e,hidden:t,className:r=""}){/* @__PURE__ */
554
- return ct("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var Is=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),Os=`${Is} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function Rs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!nt(e)&&"label"in e}function Ws(e){if(null==e||!1===e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(Rs)?e:Rs(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */ct("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${Is} ${k[e.tone]}`:Os,children:e.label},t)):/* @__PURE__ */ct("span",{"data-tree-count":"",className:Os,children:e})}function Ks({children:e,count:t,expanded:r,onToggle:n}){const a=void 0!==r,l=
555
- /* @__PURE__ */ct("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */ct($,{children:e})}),i=null!=t&&!1!==t&&/* @__PURE__ */ct("span",{"data-tree-count":"",className:Os,children:t}),o="text-xs font-semibold uppercase tracking-wide text-gray-500";return a?/* @__PURE__ */ct("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */st("button",{type:"button","aria-expanded":r,onClick:n,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o].join(" "),children:[
554
+ return ct("div",{role:"group",hidden:t,className:`ml-4 flex flex-col gap-1 border-l border-gray-200 pl-2 ${r}`.trim(),children:e})}var Is=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-2","text-2xs font-medium normal-case tabular-nums tracking-normal"].join(" "),Os=`${Is} bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600`;function Rs(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!nt(e)&&"label"in e}function Ws(e){if(null==e||!1===e)return null;const t=Array.isArray(e)&&e.length>0&&e.every(Rs)?e:Rs(e)?[e]:null;return t?t.map((e,t)=>/* @__PURE__ */ct("span",{"data-tree-count":"","data-tone":e.tone,className:e.tone?`${Is} ${d[e.tone]}`:Os,children:e.label},t)):/* @__PURE__ */ct("span",{"data-tree-count":"",className:Os,children:e})}function Ks({children:e,count:t,expanded:r,onToggle:n}){const a=void 0!==r,l=
555
+ /* @__PURE__ */ct("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */ct(u,{children:e})}),i=null!=t&&!1!==t&&/* @__PURE__ */ct("span",{"data-tree-count":"",className:Os,children:t}),o="text-xs font-semibold uppercase tracking-wide text-gray-500";return a?/* @__PURE__ */ct("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */st("button",{type:"button","aria-expanded":r,onClick:n,className:["flex w-full items-center gap-2 rounded-md px-2 hover:text-gray-900","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",o].join(" "),children:[
556
556
  /* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:_s(!!r)}),l,i]})}):/* @__PURE__ */st("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${o}`,children:[
557
- /* @__PURE__ */ct("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,i]})}var _s=e=>/* @__PURE__ */ct(xe,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),qs={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Hs({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:o,muted:s=!1,badge:c,actions:d,actionsPinned:u=!1,actionsOverlay:h=!0,rename:m,drop:p,dragging:f=!1,draggable:g=!1,dragHint:b,onMove:y,rowProps:x,className:v=""}){const w=void 0!==l,N=Ve(),k=[x?.["aria-describedby"],y?N:void 0].filter(Boolean).join(" ")||void 0,M=a?"bg-blue-50 text-blue-700":"into"===p?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
558
- return st("div",{...x,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":w?l:void 0,tabIndex:a?0:-1,"aria-keyshortcuts":x?.["aria-keyshortcuts"]??(y?Ls:void 0),"aria-describedby":k,"data-drop":p,"data-draggable":g||void 0,onKeyDown:e=>{if(x?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=As(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!o?("ArrowRight"===e.key&&w&&!l&&i||"ArrowLeft"===e.key&&w&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),o())},onClick:e=>{x?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",g?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",M,"into"===p?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",f?"opacity-40":"",v].filter(Boolean).join(" "),children:["before"===p&&/* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===p&&/* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),g&&
559
- /* @__PURE__ */ct(Ps,{marker:"tree",hint:b,dragging:f,revealClassName:"group-hover/treerow:opacity-100"}),
560
- /* @__PURE__ */ct("span",w?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:_s(!!l)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(s?"text-gray-400":""),children:r}),
561
- /* @__PURE__ */st("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[m??
562
- /* @__PURE__ */ct("span",{className:`flex min-w-0 ${a?"font-semibold":"font-medium"} ${s?"text-gray-400 line-through":""}`,children:/* @__PURE__ */st($,{children:[e,null!=n&&/* @__PURE__ */ct("span",{className:"ml-2 font-normal text-gray-500",children:n})]})}),Ws(c),null!=d&&!h&&/* @__PURE__ */ct("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(u||s?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]}),null!=d&&h&&
563
- /* @__PURE__ */st("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:qs,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(u||s||a?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
557
+ /* @__PURE__ */ct("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),l,i]})}var _s=e=>/* @__PURE__ */ct(xe,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),qs={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function Hs({label:e,level:t=1,icon:r,preview:n,selected:a=!1,expanded:l,onToggle:i,onSelect:o,muted:s=!1,badge:c,actions:d,actionsPinned:h=!1,actionsOverlay:m=!0,rename:p,drop:f,dragging:g=!1,draggable:b=!1,dragHint:y,onMove:x,rowProps:v,className:w=""}){const N=void 0!==l,k=Ve(),$=[v?.["aria-describedby"],x?k:void 0].filter(Boolean).join(" ")||void 0,M=a?"bg-blue-50 text-blue-700":"into"===f?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
558
+ return st("div",{...v,role:"treeitem","aria-level":t,"aria-selected":a,"aria-expanded":N?l:void 0,tabIndex:a?0:-1,"aria-keyshortcuts":v?.["aria-keyshortcuts"]??(x?Ls:void 0),"aria-describedby":$,"data-drop":f,"data-draggable":b||void 0,onKeyDown:e=>{if(v?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=As(e);t&&x?(e.preventDefault(),x(t)):"Enter"!==e.key&&" "!==e.key||!o?("ArrowRight"===e.key&&N&&!l&&i||"ArrowLeft"===e.key&&N&&l&&i)&&(e.preventDefault(),i()):(e.preventDefault(),o())},onClick:e=>{v?.onClick?.(e),e.defaultPrevented||o?.()},className:["group/treerow relative flex h-8 shrink-0 select-none items-center gap-2 rounded-md px-2 text-sm",b?"cursor-grab active:cursor-grabbing":"cursor-pointer","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",M,"into"===f?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",g?"opacity-40":"",w].filter(Boolean).join(" "),children:["before"===f&&/* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -top-0.5 h-0.5 rounded-full bg-blue-500"}),"after"===f&&/* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-drop-line":"",className:"pointer-events-none absolute inset-x-2 -bottom-0.5 h-0.5 rounded-full bg-blue-500"}),b&&
559
+ /* @__PURE__ */ct(Ps,{marker:"tree",hint:y,dragging:g,revealClassName:"group-hover/treerow:opacity-100"}),
560
+ /* @__PURE__ */ct("span",N?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),i?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:_s(!!l)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */ct("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(s?"text-gray-400":""),children:r}),
561
+ /* @__PURE__ */st("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[p??
562
+ /* @__PURE__ */ct("span",{className:`flex min-w-0 ${a?"font-semibold":"font-medium"} ${s?"text-gray-400 line-through":""}`,children:/* @__PURE__ */st(u,{children:[e,null!=n&&/* @__PURE__ */ct("span",{className:"ml-2 font-normal text-gray-500",children:n})]})}),Ws(c),null!=d&&!m&&/* @__PURE__ */ct("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(h||s?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:d})]}),null!=d&&m&&
563
+ /* @__PURE__ */st("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:qs,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(h||s||a?"opacity-100":"pointer-events-none opacity-0 group-hover/treerow:pointer-events-auto group-hover/treerow:opacity-100 group-focus-within/treerow:pointer-events-auto group-focus-within/treerow:opacity-100"),children:[
564
564
  /* @__PURE__ */ct("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
565
565
  /* @__PURE__ */ct("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
566
- /* @__PURE__ */ct("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),y&&/* @__PURE__ */ct(zs,{id:N})]})}function Us({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=$e().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
566
+ /* @__PURE__ */ct("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:d})]}),x&&/* @__PURE__ */ct(zs,{id:k})]})}function Us({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=$e().tree,l=r?a.dropHere:t??a.empty,i="flex min-h-8 w-full items-center gap-2 rounded-md border border-dashed px-3 text-sm "+(r?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 text-gray-500");/* @__PURE__ */
567
567
  return ct("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */st("button",{type:"button",onClick:e,className:`${i} text-left hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]`,children:[
568
568
  /* @__PURE__ */ct("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */ct("span",{className:i,children:l})})}function Vs({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=$e().tree,l=t??a.insertHere,i=r?"opacity-100":e?"opacity-0 group-hover/seam:opacity-100 group-focus-within/seam:opacity-100":"opacity-0";/* @__PURE__ */
569
569
  return st("div",{...n,role:"presentation","data-tree-seam":"","data-drop":r||void 0,className:`group/seam relative z-10 -my-1 h-1 shrink-0 ${n?.className??""}`.trim(),children:[
@@ -579,13 +579,13 @@ return ct("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-
579
579
  /* @__PURE__ */ct("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
580
580
  /* @__PURE__ */ct("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__ */
581
581
  return ct(V,{content:e,side:i,children:p})}var rc=6e4;function nc({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Ge(null);return Qe(()=>{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 ac({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=nc({currentVersion:e,versionUrl:t,pollMs:r}),o=$e();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
582
- return ct("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__ */st(c,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */ct(U,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
582
+ return ct("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__ */st(F,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */ct(U,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
583
583
  /* @__PURE__ */ct("span",{className:"font-medium",children:n??o.update.available}),
584
584
  /* @__PURE__ */st("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var lc={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},ic={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function oc({onClose:e}){const t=$e().dialog;/* @__PURE__ */
585
- return ct("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__ */ct(xe,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function sc({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=Xe(null),f=Ve(),g=Ve(),b=Ve();if(q(e),j(p,e,c),P(e),Qe(()=>{if(e)return ce(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const y="bottom"===r,x=y?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
585
+ return ct("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__ */ct(xe,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function sc({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=Xe(null),f=Ve(),g=Ve(),b=Ve();if(j(e),y(p,e,c),x(e),Qe(()=>{if(e)return ce(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const w="bottom"===r,N=w?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
586
586
  return st("div",{className:"fixed inset-0",style:{zIndex:ue.overlay},role:"presentation",children:[
587
587
  /* @__PURE__ */ct("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
588
- /* @__PURE__ */st("div",{ref:p,...z({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?g:o?f:void 0),style:x,className:["fixed flex flex-col bg-white shadow-xl",y?"":`w-full max-w-full ${lc[n]}`,ic[r],y?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */st("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
588
+ /* @__PURE__ */st("div",{ref:p,...v({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?g:o?f:void 0),style:N,className:["fixed flex flex-col bg-white shadow-xl",w?"":`w-full max-w-full ${lc[n]}`,ic[r],w?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */st("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
589
589
  /* @__PURE__ */st("div",{className:"min-w-0",children:[
590
590
  /* @__PURE__ */ct("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */ct("p",{id:g,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */ct(oc,{onClose:t})]}):!s&&/* @__PURE__ */ct("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */ct(oc,{onClose:t})}),
591
591
  /* @__PURE__ */st("div",{id:f,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */ct("p",{id:g,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */ct("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function cc({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const f=$e().kanban,g=Me(),b=c??f.loading,y=h??f.dropHere,x=p??f.addItem,[v,w]=Ge(null),[N,k]=Ge(null),$=Ze(()=>{const n={};for(const e of t)n[e.value]=[];for(const t of e)(n[r(t)]??=[]).push(t);if(o)for(const e of Object.keys(n))n[e].sort(o);return n},[e,t,r,o]),M=()=>{w(null),k(null)},C=Xe(null),D=Xe(/* @__PURE__ */new Map);pe(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=D.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),D.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[$,v]);return s?/* @__PURE__ */ct(He,{size:"sm",padding:"p-4",label:b}):0!==e.length||u?/* @__PURE__ */ct("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */ct("div",{className:"flex gap-3 h-full min-w-max pb-2",children:t.map(e=>{const t=$[e.value]??[],r=null!==N&&N.col===e.value,o=null!==v?t.findIndex(e=>n(e)===v):-1,s=r&&(-1===o||N.index!==o&&N.index!==o+1)?N.index:-1;/* @__PURE__ */
@@ -603,23 +603,23 @@ return st("nav",{"aria-label":i.label,className:`flex items-center gap-1 ${l}`.t
603
603
  /* @__PURE__ */ct("button",{type:"button","aria-label":i.next,disabled:e===t,onClick:()=>c(e+1),className:`${dc} text-gray-600 hover:bg-gray-100`,children:"›"}),a&&/* @__PURE__ */ct("button",{type:"button","aria-label":i.last,disabled:e===t,onClick:()=>c(t),className:`${dc} text-gray-600 hover:bg-gray-100`,children:"»"})]})}function hc(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 mc=e=>Array.isArray(e.columns),pc=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",fc="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",gc={sm:"px-2 py-2",md:"px-3 py-2"},bc={left:"text-left",right:"text-right",center:"text-center"};function yc({direction:e}){/* @__PURE__ */
604
604
  return st("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
605
605
  /* @__PURE__ */ct("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ct("path",{d:"M4 0L8 5H0z"})}),
606
- /* @__PURE__ */ct("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ct("path",{d:"M4 5L0 0h8z"})})]})}function xc(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function vc({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:u,onRow:h,rowHref:m,onRowPress:p,linkAs:f,emptyText:g,selection:b,footer:y,virtualized:x,stackOnNarrow:v=!1,stackBelow:w,className:N=""}){const k=$e(),C=g??k.table.empty,D=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),S=v&&!x,L=S?e:e.flatMap(e=>{if(!mc(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),A=e=>S?{role:e}:{},j=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,z]=Ge(0),F=x?.overscan??6,E=x?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/x.rowHeight)-F);z(e=>e===t?e:t)}:void 0,T=x?Math.ceil(x.height/x.rowHeight)+2*F:t.length,B=x?Math.min(P,Math.max(0,t.length-T)):0,I=Math.min(t.length,B+T),O=x?B*x.rowHeight:0,R=x?(t.length-I)*x.rowHeight:0,W=Xe(null),[K,_]=Ge(0);pe(()=>{if(!x)return;const e=W.current?.offsetHeight??0;_(t=>t===e?t:e)});const q=e=>e.sortField??e.key,H=e=>n&&n.field===q(e)?n.direction:null,U=L.flatMap(e=>mc(e)?e.columns:[e]),V=L.some(mc),Y=/* @__PURE__ */new Map;if(S)for(const e of L)if(mc(e))for(const t of e.columns)Y.set(t,j(e.title,e.label));const G=e=>{const t=j(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(b?.selected??[]),Z=b?t.map((e,t)=>D(e,t)):[],J=Z.length>0&&Z.every(e=>X.has(e)),Q=Z.some(e=>X.has(e)),ee=b?36:0,te=U.length+(b?1:0),re=U.some(e=>"left"===e.fixed),ne=S&&!b&&U.some(e=>e.cardCorner),ae=f??"a",le=`${gc[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t)=>e.ellipsis?/* @__PURE__ */ct("span",{className:"block w-0 min-w-full",children:t}):t,oe=(e,t,r,n=0)=>{const l=H(e),i=bc[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
607
- return ct("th",{scope:"col",...A("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":s?"none":void 0,style:{width:e.width,...o?{left:(ce[t]??0)+ee}:{},...x?{top:n}:{}},className:[le,i,M,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs",o?x?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":x?"sticky z-10 bg-gray-50":"",S&&s?"rosh-dt-sort":"",S?pc(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:ie(e,s?/* @__PURE__ */st("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=q(e),r=H(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":S?Y.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[
608
- /* @__PURE__ */ct($,{children:e.title}),
609
- /* @__PURE__ */ct(yc,{direction:l})]}):/* @__PURE__ */ct($,{children:e.title}))},e.key)};let se=0;const ce=U.map(e=>{if("left"!==e.fixed)return null;const t=se;return se+=e.width??0,t}),de=/* @__PURE__ */st(dt,{children:[
610
- /* @__PURE__ */st("div",{onScroll:E,style:x?{maxHeight:x.height}:void 0,className:`relative overflow-x-auto ${x?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${S?" rosh-dt-scroll":""}`.trim(),children:[o&&
606
+ /* @__PURE__ */ct("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */ct("path",{d:"M4 5L0 0h8z"})})]})}function xc(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function vc({columns:e,data:t,rowKey:r,sort:n=null,onSortChange:a,pagination:l,caption:i,loading:o=!1,bordered:s=!1,size:c="md",minWidth:d,rowClassName:m,onRow:p,rowHref:f,onRowPress:g,linkAs:b,emptyText:y,selection:x,footer:v,virtualized:w,stackOnNarrow:N=!1,stackBelow:k,className:$=""}){const M=$e(),C=y??M.table.empty,D=(e,t)=>"function"==typeof r?r(e,t):String(e[r]),S=N&&!w,L=S?e:e.flatMap(e=>{if(!mc(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),A=e=>S?{role:e}:{},j=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[P,z]=Ge(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,T=w?Math.ceil(w.height/w.rowHeight)+2*F:t.length,B=w?Math.min(P,Math.max(0,t.length-T)):0,I=Math.min(t.length,B+T),O=w?B*w.rowHeight:0,R=w?(t.length-I)*w.rowHeight:0,W=Xe(null),[K,_]=Ge(0);pe(()=>{if(!w)return;const e=W.current?.offsetHeight??0;_(t=>t===e?t:e)});const q=e=>e.sortField??e.key,H=e=>n&&n.field===q(e)?n.direction:null,U=L.flatMap(e=>mc(e)?e.columns:[e]),V=L.some(mc),Y=/* @__PURE__ */new Map;if(S)for(const e of L)if(mc(e))for(const t of e.columns)Y.set(t,j(e.title,e.label));const G=e=>{const t=j(e.title,e.label),r=Y.get(e);return t&&r?`${r} · ${t}`:t},X=new Set(x?.selected??[]),Z=x?t.map((e,t)=>D(e,t)):[],J=Z.length>0&&Z.every(e=>X.has(e)),Q=Z.some(e=>X.has(e)),ee=x?36:0,te=U.length+(x?1:0),re=U.some(e=>"left"===e.fixed),ne=S&&!x&&U.some(e=>e.cardCorner),ae=b??"a",le=`${gc[c]} ${"sm"===c?"text-xs":"text-sm"}`,ie=(e,t)=>e.ellipsis?/* @__PURE__ */ct("span",{className:"block w-0 min-w-full",children:t}):t,oe=(e,t,r,n=0)=>{const l=H(e),i=bc[e.align??(e.numeric?"right":"left")],o="left"===e.fixed,s=!(!e.sortable||!a);/* @__PURE__ */
607
+ return ct("th",{scope:"col",...A("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===l?"ascending":"desc"===l?"descending":s?"none":void 0,style:{width:e.width,...o?{left:(ce[t]??0)+ee}:{},...w?{top:n}:{}},className:[le,i,h,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs",o?w?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":w?"sticky z-10 bg-gray-50":"",S&&s?"rosh-dt-sort":"",S?pc(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:ie(e,s?/* @__PURE__ */st("button",{type:"button",onClick:()=>(e=>{if(!a)return;const t=q(e),r=H(e),n=e.sortFirst??"asc";a(null===r?{field:t,direction:n}:r===n?{field:t,direction:"asc"===n?"desc":"asc"}:null)})(e),"data-group":S?Y.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-gray-700 ${i}`,children:[
608
+ /* @__PURE__ */ct(u,{children:e.title}),
609
+ /* @__PURE__ */ct(yc,{direction:l})]}):/* @__PURE__ */ct(u,{children:e.title}))},e.key)};let se=0;const ce=U.map(e=>{if("left"!==e.fixed)return null;const t=se;return se+=e.width??0,t}),de=/* @__PURE__ */st(dt,{children:[
610
+ /* @__PURE__ */st("div",{onScroll:E,style:w?{maxHeight:w.height}:void 0,className:`relative overflow-x-auto ${w?"overflow-y-auto":""} ${s?"rounded-lg border border-gray-200":""}${S?" rosh-dt-scroll":""}`.trim(),children:[o&&
611
611
  /* @__PURE__ */st("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
612
612
  /* @__PURE__ */ct(qe,{className:"h-6 w-6"}),
613
- /* @__PURE__ */ct("span",{className:"sr-only",children:k.table.loading})]}),
613
+ /* @__PURE__ */ct("span",{className:"sr-only",children:M.table.loading})]}),
614
614
  /* @__PURE__ */st("table",{...A("table"),className:(S?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:d?{minWidth:d}:void 0,children:[i&&/* @__PURE__ */ct("caption",{className:"sr-only",children:i}),
615
615
  /* @__PURE__ */st("thead",{...A("rowgroup"),className:S?"rosh-dt-head":void 0,children:[
616
- /* @__PURE__ */st("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[b&&/* @__PURE__ */ct("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...x?{top:0}:{}},className:[le,M,re||x?"sticky z-20 bg-gray-50":"",re?"left-0":"",S?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(Rt,{"aria-label":k.table.selectAll,checked:J,indeterminate:Q&&!J,onChange:()=>{if(!b)return;const e=new Set(Z);b.onChange(J?b.selected.filter(t=>!e.has(t)):[...b.selected,...Z.filter(e=>!X.has(e))])}})}),L.map((e,t)=>mc(e)?/* @__PURE__ */ct("th",{scope:"colgroup",...A("columnheader"),colSpan:e.columns.length,style:x?{top:0}:void 0,className:[le,"text-center",M,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs","border-b border-gray-200",x?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */ct($,{children:e.title})},e.key??`group-${t}`):oe(e,U.indexOf(e),V?2:1))]}),V&&/* @__PURE__ */ct("tr",{...A("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>mc(e)?e.columns:[]).map(e=>oe(e,U.indexOf(e),1,K))})]}),
617
- /* @__PURE__ */ct("tbody",{...A("rowgroup"),className:S?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */st(dt,{children:[O>0&&/* @__PURE__ */ct("tr",{"aria-hidden":"true",children:/* @__PURE__ */ct("td",{colSpan:te,style:{height:O,padding:0,border:0}})}),t.slice(B,I).map((e,t)=>{const r=B+t,n=h?.(e,r),a=!!n?.current,l=m?.(e,r),i=void 0===l&&p?()=>p(e,r):void 0,o=void 0!==l||void 0!==i;let s=!1;const c=(e,t)=>{if(s=!0,!o)return e;const r=[fc,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */ct(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */ct("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 f=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
618
- return st("tr",{...hc(n),...A("row"),style:x?{height:x.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:f(n?.onFocus),onBlur:f(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:[S?b?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",S&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",u?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[b&&(()=>{const t=D(e,r);/* @__PURE__ */
619
- return ct("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",S?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(Rt,{"aria-label":k.table.selectRow,checked:X.has(t),onChange:()=>(e=>{b&&b.onChange(X.has(e)?b.selected.filter(t=>t!==e):[...b.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=S&&!a&&"wide"!==e.only;/* @__PURE__ */
616
+ /* @__PURE__ */st("tr",{ref:W,...A("row"),className:"border-b border-gray-200 bg-gray-50",children:[x&&/* @__PURE__ */ct("th",{scope:"col",...A("columnheader"),rowSpan:V?2:void 0,style:{width:36,...w?{top:0}:{}},className:[le,h,re||w?"sticky z-20 bg-gray-50":"",re?"left-0":"",S?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(Rt,{"aria-label":M.table.selectAll,checked:J,indeterminate:Q&&!J,onChange:()=>{if(!x)return;const e=new Set(Z);x.onChange(J?x.selected.filter(t=>!e.has(t)):[...x.selected,...Z.filter(e=>!X.has(e))])}})}),L.map((e,t)=>mc(e)?/* @__PURE__ */ct("th",{scope:"colgroup",...A("columnheader"),colSpan:e.columns.length,style:w?{top:0}:void 0,className:[le,"text-center",h,"font-semibold uppercase tracking-wide text-gray-500","sm"===c?"text-2xs":"text-xs","border-b border-gray-200",w?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(u,{children:e.title})},e.key??`group-${t}`):oe(e,U.indexOf(e),V?2:1))]}),V&&/* @__PURE__ */ct("tr",{...A("row"),className:"border-b border-gray-200 bg-gray-50",children:L.flatMap(e=>mc(e)?e.columns:[]).map(e=>oe(e,U.indexOf(e),1,K))})]}),
617
+ /* @__PURE__ */ct("tbody",{...A("rowgroup"),className:S?"rosh-dt-body":void 0,children:0!==t.length||o?/* @__PURE__ */st(dt,{children:[O>0&&/* @__PURE__ */ct("tr",{"aria-hidden":"true",children:/* @__PURE__ */ct("td",{colSpan:te,style:{height:O,padding:0,border:0}})}),t.slice(B,I).map((e,t)=>{const r=B+t,n=p?.(e,r),a=!!n?.current,l=f?.(e,r),i=void 0===l&&g?()=>g(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=[fc,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),n=a?"true":void 0;return void 0!==l?/* @__PURE__ */ct(ae,{href:l,className:r,"aria-current":n,children:e}):/* @__PURE__ */ct("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__ */
618
+ return st("tr",{...hc(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:[S?x?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",S&&ne?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",o?"rosh-dt-linked hover:bg-gray-50":"",a?"rosh-dt-current":"",m?.(e,r)??"",n?.className??""].filter(Boolean).join(" "),children:[x&&(()=>{const t=D(e,r);/* @__PURE__ */
619
+ return ct("td",{...A("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[le,re?"sticky left-0 z-10 bg-white":"",S?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */ct(Rt,{"aria-label":M.table.selectRow,checked:X.has(t),onChange:()=>(e=>{x&&x.onChange(X.has(e)?x.selected.filter(t=>t!==e):[...x.selected,e])})(t)})})})(),U.map((e,t)=>{const r="left"===e.fixed,n=d[t],a=ne&&!!e.cardCorner,l=S&&!a&&"wide"!==e.only;/* @__PURE__ */
620
620
  return ct("td",{...A("cell"),"data-label":l?G(e):void 0,style:r?{left:(ce[t]??0)+ee}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",a?"rosh-dt-corner":"",S?pc(e):"",le,bc[e.align??(e.numeric?"right":"left")],S?"":xc(e),"text-gray-900",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:S?
621
- /* @__PURE__ */ct("span",{className:["rosh-dt-value",xc(e,!0)].filter(Boolean).join(" "),children:n}):n},e.key)})]},D(e,r))}),R>0&&/* @__PURE__ */ct("tr",{"aria-hidden":"true",children:/* @__PURE__ */ct("td",{colSpan:te,style:{height:R,padding:0,border:0}})})]}):/* @__PURE__ */ct("tr",{...A("row"),className:S?"rosh-dt-empty":void 0,children:/* @__PURE__ */ct("td",{...A("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:C})})})]}),y]}),l&&l.pageCount>1&&/* @__PURE__ */ct("div",{className:S?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */ct(uc,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
622
- return ct("div",S?void 0!==w&&w>0&&40!==w?{className:`rosh-dt-at ${N}`.trim(),children:/* @__PURE__ */ct("div",{className:"rosh-dt-stack",style:{width:40/w*100+"%"},children:/* @__PURE__ */ct("div",{className:"rosh-dt-fit",style:{width:w/40*100+"%"},children:de})})}:{className:`rosh-dt-stack ${N}`.trim(),children:de}:{className:N,children:de})}function wc({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=$e().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
621
+ /* @__PURE__ */ct("span",{className:["rosh-dt-value",xc(e,!0)].filter(Boolean).join(" "),children:n}):n},e.key)})]},D(e,r))}),R>0&&/* @__PURE__ */ct("tr",{"aria-hidden":"true",children:/* @__PURE__ */ct("td",{colSpan:te,style:{height:R,padding:0,border:0}})})]}):/* @__PURE__ */ct("tr",{...A("row"),className:S?"rosh-dt-empty":void 0,children:/* @__PURE__ */ct("td",{...A("cell"),colSpan:te,className:`${le} py-10 text-center text-gray-500`,children:C})})})]}),v]}),l&&l.pageCount>1&&/* @__PURE__ */ct("div",{className:S?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */ct(uc,{page:l.page,pageCount:l.pageCount,onPageChange:l.onPageChange})})]});/* @__PURE__ */
622
+ return ct("div",S?void 0!==k&&k>0&&40!==k?{className:`rosh-dt-at ${$}`.trim(),children:/* @__PURE__ */ct("div",{className:"rosh-dt-stack",style:{width:40/k*100+"%"},children:/* @__PURE__ */ct("div",{className:"rosh-dt-fit",style:{width:k/40*100+"%"},children:de})})}:{className:`rosh-dt-stack ${$}`.trim(),children:de}:{className:$,children:de})}function wc({selectedCount:e,hiddenSelectedCount:t=0,loadedCount:r,totalCount:n,label:a,isFetchingMore:l,extra:i}){const o=$e().list,s=n??r,c=r>=s,d=t>0?o.selectedNotShown(e,t):e>0?o.selected(e):"";/* @__PURE__ */
623
623
  return st(dt,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,a):o.loadedOf(r,s,a),l?/* @__PURE__ */st(dt,{children:[" · ",
624
624
  /* @__PURE__ */st("span",{className:"inline-flex items-center gap-1",role:"status",children:[
625
625
  /* @__PURE__ */ct(qe,{}),o.loadingMore]})]}):""]})}function Nc({title:e,message:t,onRetry:r,variant:n="dashed"}){const a=$e().list;/* @__PURE__ */
@@ -670,7 +670,7 @@ return st("g",{children:[
670
670
  /* @__PURE__ */ct("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:A(e)}}),
671
671
  /* @__PURE__ */ct("span",{className:"flex-1 truncate",children:e.label}),
672
672
  /* @__PURE__ */ct("span",{className:"tabular-nums text-gray-800",children:je(e.value/j*100,1,f)})]},e.key))})]})}var md={paid:"success",shipped:"active",processing:"queued",refunded:"neutral",overdue:"danger"},pd=[12,18,14,22,19,27,24,31,28,35,30,38],fd=["J","F","M","A","M","J","J","A","S","O","N","D"],gd=[{key:"direct",label:"Direct",value:45},{key:"search",label:"Search",value:30},{key:"social",label:"Social",value:15},{key:"email",label:"Email",value:10}],bd=[{id:"#3201",customer:"Alice Nguyen",total:"$1,204",status:"paid"},{id:"#3202",customer:"Marco Reyes",total:"$642",status:"shipped"},{id:"#3203",customer:"Priya Patel",total:"$2,980",status:"processing"},{id:"#3204",customer:"Tom Becker",total:"$318",status:"overdue"},{id:"#3205",customer:"Sara Lind",total:"$540",status:"refunded"}];function yd(){/* @__PURE__ */
673
- return ct(C,{groups:md,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */st("div",{className:"mx-auto max-w-6xl space-y-6",children:[
673
+ return ct(m,{groups:md,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */st("div",{className:"mx-auto max-w-6xl space-y-6",children:[
674
674
  /* @__PURE__ */st("div",{className:"flex items-center justify-between gap-4",children:[
675
675
  /* @__PURE__ */st("div",{children:[
676
676
  /* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
@@ -688,19 +688,19 @@ return ct(C,{groups:md,children:/* @__PURE__ */ct("div",{className:"h-full overf
688
688
  /* @__PURE__ */ct(Ml,{header:"Traffic sources",children:/* @__PURE__ */ct(hd,{variant:"ring",size:180,segments:gd,centerLabel:"100%"})})]}),
689
689
  /* @__PURE__ */ct(Ml,{header:"Recent orders",padded:!1,children:/* @__PURE__ */st("table",{className:"w-full text-sm",children:[
690
690
  /* @__PURE__ */ct("thead",{children:/* @__PURE__ */st("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
691
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Order"}),
692
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Customer"}),
693
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Total"}),
694
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Status"})]})}),
691
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Order"}),
692
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Customer"}),
693
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Total"}),
694
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Status"})]})}),
695
695
  /* @__PURE__ */ct("tbody",{className:"divide-y divide-gray-100",children:bd.map(e=>/* @__PURE__ */st("tr",{className:"text-gray-700",children:[
696
696
  /* @__PURE__ */ct("td",{className:"px-4 py-2 font-mono text-xs text-gray-500",children:e.id}),
697
697
  /* @__PURE__ */ct("td",{className:"px-4 py-2",children:/* @__PURE__ */st("span",{className:"flex items-center gap-2",children:[
698
698
  /* @__PURE__ */ct(ki,{size:"xs",name:e.customer}),e.customer]})}),
699
699
  /* @__PURE__ */ct("td",{className:"px-4 py-2",children:e.total}),
700
- /* @__PURE__ */ct("td",{className:"px-4 py-2",children:/* @__PURE__ */ct(D,{status:e.status})})]},e.id))})]})}),
700
+ /* @__PURE__ */ct("td",{className:"px-4 py-2",children:/* @__PURE__ */ct(p,{status:e.status})})]},e.id))})]})}),
701
701
  /* @__PURE__ */st("p",{className:"flex items-center gap-2 text-xs text-gray-400",children:[
702
702
  /* @__PURE__ */ct("span",{className:"text-emerald-600",children:/* @__PURE__ */ct(kc,{data:pd,width:80,height:20})}),"Trending up 12% vs last month"]})]})})})}var xd={active:"success",invited:"queued",suspended:"danger",pending:"pending"},vd=[{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 wd(){const[e,t]=Ge(1),[r,n]=Ge(""),[a,l]=Ge("");/* @__PURE__ */
703
- return ct(C,{groups:xd,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */st("div",{className:"mx-auto max-w-5xl space-y-4",children:[
703
+ return ct(m,{groups:xd,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */st("div",{className:"mx-auto max-w-5xl space-y-4",children:[
704
704
  /* @__PURE__ */st("div",{className:"flex items-center justify-between gap-4",children:[
705
705
  /* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
706
706
  /* @__PURE__ */ct(U,{size:"sm",children:"Invite member"})]}),
@@ -711,16 +711,16 @@ return ct(C,{groups:xd,children:/* @__PURE__ */ct("div",{className:"h-full overf
711
711
  /* @__PURE__ */ct(U,{variant:"secondary",size:"sm",children:"Filter"})]}),
712
712
  /* @__PURE__ */st("table",{className:"w-full text-sm",children:[
713
713
  /* @__PURE__ */ct("thead",{children:/* @__PURE__ */st("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
714
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Name"}),
715
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Role"}),
716
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium`,children:"Status"}),
717
- /* @__PURE__ */ct("th",{className:`${M} px-4 py-2 font-medium text-right`,children:"Actions"})]})}),
714
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Name"}),
715
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Role"}),
716
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium`,children:"Status"}),
717
+ /* @__PURE__ */ct("th",{className:`${h} px-4 py-2 font-medium text-right`,children:"Actions"})]})}),
718
718
  /* @__PURE__ */ct("tbody",{className:"divide-y divide-gray-100",children:vd.map(e=>/* @__PURE__ */st("tr",{className:"text-gray-700 hover:bg-gray-50",children:[
719
719
  /* @__PURE__ */st("td",{className:"px-4 py-3",children:[
720
720
  /* @__PURE__ */ct("div",{className:"font-medium text-gray-900",children:e.name}),
721
721
  /* @__PURE__ */ct("div",{className:"text-xs text-gray-400",children:e.email})]}),
722
722
  /* @__PURE__ */ct("td",{className:"px-4 py-3",children:e.role}),
723
- /* @__PURE__ */ct("td",{className:"px-4 py-3",children:/* @__PURE__ */ct(D,{status:e.status})}),
723
+ /* @__PURE__ */ct("td",{className:"px-4 py-3",children:/* @__PURE__ */ct(p,{status:e.status})}),
724
724
  /* @__PURE__ */ct("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */ct(U,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
725
725
  /* @__PURE__ */st("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
726
726
  /* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
@@ -735,7 +735,7 @@ return ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
735
735
  /* @__PURE__ */ct(_t,{label:"First name",htmlFor:"fn",required:!0,children:/* @__PURE__ */ct(xt,{id:"fn",defaultValue:"Alice"})}),
736
736
  /* @__PURE__ */ct(_t,{label:"Last name",htmlFor:"ln",required:!0,children:/* @__PURE__ */ct(xt,{id:"ln",defaultValue:"Nguyen"})})]}),
737
737
  /* @__PURE__ */ct(_t,{label:"Email",htmlFor:"email",hint:"We'll never share your email.",children:/* @__PURE__ */ct(xt,{id:"email",type:"email",defaultValue:"alice@acme.co"})}),
738
- /* @__PURE__ */ct(_t,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */ct(d,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
738
+ /* @__PURE__ */ct(_t,{label:"Bio",htmlFor:"bio",hint:"Brief description for your profile.",children:/* @__PURE__ */ct(E,{id:"bio",autoGrow:!0,defaultValue:"Product designer at Acme."})})]})}),
739
739
  /* @__PURE__ */ct(Ml,{header:"Preferences",children:/* @__PURE__ */st("div",{className:"space-y-4",children:[
740
740
  /* @__PURE__ */st("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[
741
741
  /* @__PURE__ */ct(_t,{label:"Country",htmlFor:"country",children:/* @__PURE__ */ct(It,{value:a,onChange:l,options:[{value:"us",label:"United States"},{value:"de",label:"Germany"},{value:"jp",label:"Japan"}]})}),
@@ -784,7 +784,7 @@ return ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
784
784
  /* @__PURE__ */ct("span",{children:"Total"}),
785
785
  /* @__PURE__ */st("span",{children:["$",l]})]})]}),
786
786
  /* @__PURE__ */st(U,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
787
- /* @__PURE__ */ct(c,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var Cd=[{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"}],Dd=[{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 Sd(){const[e,t]=Ge(1),r=Dd.find(t=>t.id===e)??Dd[0];/* @__PURE__ */
787
+ /* @__PURE__ */ct(F,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var Cd=[{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"}],Dd=[{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 Sd(){const[e,t]=Ge(1),r=Dd.find(t=>t.id===e)??Dd[0];/* @__PURE__ */
788
788
  return ct("div",{className:"h-full",children:/* @__PURE__ */ct(n,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */st("div",{className:"flex h-full flex-col p-2",children:[
789
789
  /* @__PURE__ */ct(U,{block:!0,className:"mb-2",children:"Compose"}),Cd.map((e,t)=>/* @__PURE__ */st("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:[
790
790
  /* @__PURE__ */ct("span",{children:e.label}),null!=e.count&&/* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */st("div",{className:"flex h-full",children:[
@@ -826,13 +826,13 @@ return ct("div",{className:"h-full",children:/* @__PURE__ */ct(n,{side:"left",de
826
826
  /* @__PURE__ */st("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
827
827
  /* @__PURE__ */ct("div",{className:"flex-1",children:/* @__PURE__ */ct(xt,{placeholder:"Type a message…"})}),
828
828
  /* @__PURE__ */ct(U,{type:"submit",children:"Send"})]})]})})})}var Pd={featured:"success",new:"active",draft:"draft"},zd=["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 Fd(){const[e,t]=Ge("all"),r="all"===e?zd:zd.filter(t=>t.tag===e);/* @__PURE__ */
829
- return ct(C,{groups:Pd,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */st("div",{className:"mx-auto max-w-5xl space-y-4",children:[
829
+ return ct(m,{groups:Pd,children:/* @__PURE__ */ct("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */st("div",{className:"mx-auto max-w-5xl space-y-4",children:[
830
830
  /* @__PURE__ */st("div",{className:"flex items-center justify-between gap-4",children:[
831
831
  /* @__PURE__ */ct("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
832
832
  /* @__PURE__ */ct(U,{size:"sm",children:"Upload"})]}),
833
833
  /* @__PURE__ */ct(Li,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
834
834
  /* @__PURE__ */ct("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */st(Ml,{padded:!1,className:"overflow-hidden",children:[
835
- /* @__PURE__ */ct("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */ct("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */ct(D,{status:e.tag})})}),
835
+ /* @__PURE__ */ct("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */ct("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */ct(p,{status:e.tag})})}),
836
836
  /* @__PURE__ */st("div",{className:"flex items-center justify-between gap-2 p-3",children:[
837
837
  /* @__PURE__ */ct("span",{className:"truncate text-sm font-medium text-gray-900",children:e.title}),
838
838
  /* @__PURE__ */ct("span",{className:"text-xs text-gray-400",children:"2.4 MB"})]})]},e.id))})]})})})}var Ed={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function Td({mode:e="login"}){const[t,r]=Ge(!0),n=Ed[e];/* @__PURE__ */
@@ -853,12 +853,12 @@ return st("div",{className:"flex h-full flex-col items-center justify-center bg-
853
853
  /* @__PURE__ */ct("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:e}),
854
854
  /* @__PURE__ */ct("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:r.title}),
855
855
  /* @__PURE__ */ct("p",{className:"mt-1 max-w-sm text-sm text-gray-500",children:r.body}),t&&/* @__PURE__ */ct("div",{className:"mt-6 flex items-center gap-2",children:t})]})}function Od({pick:e}){/* @__PURE__ */
856
- return ct(dt,{children:e($e().errors)})}var Rd=class extends it{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),H(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):
856
+ return ct(dt,{children:e($e().errors)})}var Rd=class extends it{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),P(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):
857
857
  /* @__PURE__ */st("div",{className:"flex h-full flex-col",children:[
858
858
  /* @__PURE__ */ct("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */ct(Id,{code:500,actions:/* @__PURE__ */st(dt,{children:[
859
859
  /* @__PURE__ */ct(U,{onClick:this.reset,children:/* @__PURE__ */ct(Od,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */st("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
860
860
  /* @__PURE__ */ct("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */ct(Od,{pick:e=>e.details})}),
861
- /* @__PURE__ */ct("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 Wd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Kd(e){const t=Wd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function _d(){return Wd()?.matches??!1}function qd(){return!1}function Hd(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 Ud(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 Vd(e){const t=e||"system";return"system"===t?_d()?"dark":"light":t}function Yd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Hd(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Ud(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Ud(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Ud(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Ud(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Ud(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Ud(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Ud(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 Gd(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]=Hd(a);l.style.setProperty("--custom-button-hover",Ud(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Xd=["square","soft","round"];function Zd(e){return"square"===e||"round"===e?e:"soft"}var Jd={pink:"round",grey:"square"};function Qd(e,t,r){return r?"square"===t||"round"===t?t:"soft":Jd[e]??"soft"}function eu(e){const t=Zd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function tu(e){const t="string"==typeof e&&e?e:null;ve(t),t&&i(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function ru(e){const t=!!e.accent_color;"corners"in e&&eu(Qd(Vd(e.theme),e.corners,t)),"icon_set"in e&&tu(o(Vd(e.theme),e.icon_set,t)),document.documentElement.setAttribute("data-theme",Vd(e.theme)),Yd(e.accent_color??null),Gd(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 nu(){const{prefs:e}=S(),t=ot(Kd,_d,qd),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,s=e.custom_button_color||null,c=e.corners,d="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,u="system"===r?t?"dark":"light":r,h=Qd(u,c,!!n);Qe(()=>(document.documentElement.setAttribute("data-theme",u),()=>document.documentElement.removeAttribute("data-theme")),[u]),Qe(()=>(eu(h),()=>document.documentElement.removeAttribute("data-corners")),[h]);const m=o(u,d,!!n);return Qe(()=>(tu(m),()=>tu(null)),[m]),Qe(()=>{Yd(n)},[n]),Qe(()=>{Gd(n,a,l,i,s)},[n,a,l,i,s]),{theme:r,resolved:u,corners:h,iconSet:d}}function au(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 lu({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=l(),i=$e().language;return n.length<2?null:/* @__PURE__ */st("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
861
+ /* @__PURE__ */ct("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 Wd(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Kd(e){const t=Wd();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function _d(){return Wd()?.matches??!1}function qd(){return!1}function Hd(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 Ud(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 Vd(e){const t=e||"system";return"system"===t?_d()?"dark":"light":t}function Yd(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=Hd(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",Ud(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",Ud(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",Ud(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",Ud(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",Ud(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",Ud(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",Ud(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 Gd(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]=Hd(a);l.style.setProperty("--custom-button-hover",Ud(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var Xd=["square","soft","round"];function Zd(e){return"square"===e||"round"===e?e:"soft"}var Jd={pink:"round",grey:"square"};function Qd(e,t,r){return r?"square"===t||"round"===t?t:"soft":Jd[e]??"soft"}function eu(e){const t=Zd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function tu(e){const t="string"==typeof e&&e?e:null;ve(t),t&&i(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function ru(e){const t=!!e.accent_color;"corners"in e&&eu(Qd(Vd(e.theme),e.corners,t)),"icon_set"in e&&tu(o(Vd(e.theme),e.icon_set,t)),document.documentElement.setAttribute("data-theme",Vd(e.theme)),Yd(e.accent_color??null),Gd(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 nu(){const{prefs:e}=f(),t=ot(Kd,_d,qd),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,s=e.custom_button_color||null,c=e.corners,d="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,u="system"===r?t?"dark":"light":r,h=Qd(u,c,!!n);Qe(()=>(document.documentElement.setAttribute("data-theme",u),()=>document.documentElement.removeAttribute("data-theme")),[u]),Qe(()=>(eu(h),()=>document.documentElement.removeAttribute("data-corners")),[h]);const m=o(u,d,!!n);return Qe(()=>(tu(m),()=>tu(null)),[m]),Qe(()=>{Yd(n)},[n]),Qe(()=>{Gd(n,a,l,i,s)},[n,a,l,i,s]),{theme:r,resolved:u,corners:h,iconSet:d}}function au(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 lu({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=l(),i=$e().language;return n.length<2?null:/* @__PURE__ */st("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
862
862
  /* @__PURE__ */ct(xe,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
863
863
  /* @__PURE__ */ct("span",{className:"block",style:{width:`${au(n.map(e=>e.name))}em`},children:/* @__PURE__ */ct(It,{size:e,touchSize:e,"aria-label":i.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function iu({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=l(),i=$e().language;return n.length<2?null:/* @__PURE__ */st("div",{className:`space-y-4 ${t}`.trim(),children:[
864
864
  /* @__PURE__ */st("div",{children:[
@@ -974,7 +974,7 @@ return ct("rect",{x:C+a*L+u/2,y:26*n+u/2,width:Math.max(1,L-u),height:26-u,rx:h,
974
974
  /* @__PURE__ */ct("text",{x:C+Math.min(180,Math.max(40,v-C)),y:D+48,textAnchor:"end",fontSize:11,fill:Dc.label,style:{fontVariantNumeric:"tabular-nums"},children:f(M)})]}),N&&/* @__PURE__ */ct("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */ct(Qc,{title:`${e[N.r]} · ${t[N.c]}`,rows:[{key:"v",label:g,color:$,value:null==r[N.r]?.[N.c]?void 0:f(r[N.r][N.c])}]})})]})}function Iu({caption:e,head:t,rows:r}){/* @__PURE__ */
975
975
  return st("table",{className:"sr-only",children:[
976
976
  /* @__PURE__ */ct("caption",{children:e}),
977
- /* @__PURE__ */ct("thead",{children:/* @__PURE__ */ct("tr",{children:t.map(e=>/* @__PURE__ */ct("th",{className:M,scope:"col",children:e},e))})}),
977
+ /* @__PURE__ */ct("thead",{children:/* @__PURE__ */ct("tr",{children:t.map(e=>/* @__PURE__ */ct("th",{className:h,scope:"col",children:e},e))})}),
978
978
  /* @__PURE__ */ct("tbody",{children:r.map((e,t)=>/* @__PURE__ */ct("tr",{children:e.map((e,t)=>/* @__PURE__ */ct("td",{children:e},t))},t))})]})}var Ou=3,Ru=e=>`${e.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" ")} Z`;function Wu({axes:e,series:t,size:r=300,mode:n="area",grid:a="polygon",rings:l=4,formatValue:i,animate:o=!0,className:s,emptyLabel:c}){const d=$e().charts,u=Me(),h=i??(e=>Le(e,u)),m=c??d.nothingToCompare,p=Ve(),[f,g]=Ge(null),{highlighted:b}=Xc(),y=t;if(e.length<3||0===y.length)/* @__PURE__ */
979
979
  return ct("p",{className:`text-sm text-gray-500 ${s??""}`,children:m});const x=r/2,v=r/2,w=r/2-46,N=Rc(e.length),k=e.map((e,t)=>null!=e.max&&Number.isFinite(e.max)&&e.max>0?e.max:Math.max(1,...y.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[x+w*r*Math.cos(n),v+w*r*Math.sin(n)]},M=(e,t)=>null!==f?f!==e:null!==b&&b!==t,C=null!==f?y[f]:void 0;/* @__PURE__ */
980
980
  return st("div",{className:`relative ${s??""}`,children:[