efficient-shell 7.21.0 → 7.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Browser-CMG4E355.js → Browser-XPRHVZJS.js} +13 -13
- package/dist/Calculator-BLKI5RDH.js +29 -0
- package/dist/{CurrencyConverter-7UT6W5OA.js → CurrencyConverter-MELIA5ZN.js} +4 -4
- package/dist/{Documents-3HI2X2CW.js → Documents-BC5M2PBJ.js} +7 -7
- package/dist/{Files-R25E77W4.js → Files-AOQNEOZ7.js} +33 -33
- package/dist/{Notepad-XMDF3VX7.js → Notepad-DWVT66EF.js} +9 -9
- package/dist/{PomodoroTimer-3OJYMVX7.js → PomodoroTimer-RHJHTLSU.js} +46 -46
- package/dist/{Preview-VQOOKLO5.js → Preview-7LYC662F.js} +25 -25
- package/dist/{Spreadsheet-25C2SXPH.js → Spreadsheet-PDA4JIJ6.js} +13 -13
- package/dist/{Stock-5RQ2JXWL.js → Stock-44LXLO2A.js} +2 -2
- package/dist/{Weather-3AMX2QSU.js → Weather-TCGDUHYK.js} +18 -18
- package/dist/{WorldClock-JNHPO3ZQ.js → WorldClock-GIRESICQ.js} +4 -4
- package/dist/apps/index.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/{chunk-7LRJBINZ.js → chunk-2GJNH4XW.js} +28 -28
- package/dist/{chunk-5V3IFQ7F.js → chunk-2QC3VXCS.js} +1 -1
- package/dist/{chunk-OA7DQ77U.js → chunk-G3WYQP4R.js} +133 -131
- package/dist/chunk-IDJPDSA3.js +1 -0
- package/dist/{chunk-HMCE2MKM.js → chunk-JUISSKJW.js} +1 -1
- package/dist/{chunk-Y6KFHPIP.js → chunk-RN3NG35J.js} +1 -1
- package/dist/{chunk-ZAKN5MPN.js → chunk-XM2IIPJO.js} +1 -1
- package/dist/index.js +104 -104
- package/dist/telemetry/index.js +1 -1
- package/dist/ui/index.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-QLVWIU4C.js +0 -29
- package/dist/chunk-YLWIEEDW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-Z2TTHY7G.js";import{SidebarLayout as t}from"./chunk-GIWC2ZTG.js";import{BrandMark as r}from"./chunk-BQ7GR7H6.js";import{OneLineLabel as n,TH_ONE_LINE as a}from"./chunk-VOFDPOB6.js";import{inputClasses as l,PLACEHOLDER_INK as i,FILTER_ON as o,FILTER_ON_INK as s,FILTER_OFF as c,INPUT_BASE_ON as d,INPUT_BASE as u,INPUT_SIZES as h}from"./chunk-HJQAE6SP.js";import{
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-Z2TTHY7G.js";import{SidebarLayout as t}from"./chunk-GIWC2ZTG.js";import{BrandMark as r}from"./chunk-BQ7GR7H6.js";import{OneLineLabel as n,TH_ONE_LINE as a}from"./chunk-VOFDPOB6.js";import{inputClasses as l,PLACEHOLDER_INK as i,FILTER_ON as o,FILTER_ON_INK as s,FILTER_OFF as c,INPUT_BASE_ON as d,INPUT_BASE as u,INPUT_SIZES as h}from"./chunk-HJQAE6SP.js";import{isSafeLinkHref as m}from"./chunk-PJPK2ADX.js";import{useShellLanguage as p}from"./chunk-RBKIYZ7H.js";import{toast_default as g}from"./chunk-RUHUTZN4.js";import{useIsMobile as f,useShortcutLabel as b,useShellPrefs as x}from"./chunk-ZRU5F2XT.js";import{useTabLayer as y,focusableIn as v,useFocusTrap as w,useScrollLock as N,dialogA11y as k,stopAfter as $}from"./chunk-76VCH7N6.js";import{PopupMenu as M,MenuSemanticsContext as C,leavesContextMenuAlone as L,PopupMenuDivider as S,PopupMenuLabel as D,itemLook as P,MenuCheckMark as A}from"./chunk-IQDY2YFN.js";import{useDismissPopupsOnOpen as j}from"./chunk-UVBK6YSR.js";import{isAriaDisabled as z,swallowPress as F,describedByWith as E,OffWithReason as B,useDropdownPosition as T,MENU_MAX_HEIGHT as I,Button_default as O,Tooltip as R,popupBounds as W,VIEWPORT_MARGIN as K,placeMenu as _,followAnchor as q,POPUP_MAX_WIDTH as H,followRect as U,placeAtPoint as V}from"./chunk-IJ7RXIWX.js";import{iconButtonClasses as Y,buttonClasses as G}from"./chunk-JTNKC4CR.js";import{glassStyle as X,GLASS_DIVIDER as Z,solidSurfaceStyle as J}from"./chunk-7IQ3B77H.js";import{registerModalEscapeInterceptor as Q,onOverlayOpen as ee,Z_LAYERS as te}from"./chunk-FIEA5CGB.js";import{useBrowserLayoutEffect as re,useBrowserValue as ne,useHydrated as ae,useBrowserValueOnce as le,useBrowserState as ie}from"./chunk-D65T4H6J.js";import{reportBoundaryError as oe}from"./chunk-KNUR2UEG.js";import{useFileIntake as se,humanSize as ce,FileIntakeAlert as de}from"./chunk-M4TRVJTO.js";import{useShellLocale as ue,useShellStrings as he,DEFAULT_SHELL_STRINGS as me,currentShellStrings as pe,splitAround as ge}from"./chunk-QRCDQPJA.js";import{formatPlain as fe,formatFixed as be,formatPercent as xe}from"./chunk-C3QOHMR6.js";import{parseFocal as ye,formatFocal as ve,nudgeFocal as we,focalFromRect as Ne}from"./chunk-AP2QEJXQ.js";import{calendarNames as ke,firstDayOfWeek as $e,formatDate as Me,EMPTY_VALUE as Ce,toInstant as Le,timeAgo as Se,formatDateTime as De}from"./chunk-W32SKK3D.js";import{Icon as Pe,setIconSet as Ae}from"./chunk-ZGUQLVY4.js";import{forwardRef as je,useId as ze,useCallback as Fe,useState as Ee,useRef as Be,useMemo as Te,useEffect as Ie,createContext as Oe,Children as Re,isValidElement as We,cloneElement as Ke,useContext as _e,Fragment as qe,Component as He,useSyncExternalStore as Ue,useLayoutEffect as Ve}from"react";import{jsx as Ye,jsxs as Ge,Fragment as Xe}from"react/jsx-runtime";import{createPortal as Ze}from"react-dom";var Je=je(function({children:e,variant:t="ghost",size:r="md",type:n="button",className:a="",pressed:l,disabledReason:i,ink:o,disabled:s,onClick:c,"aria-disabled":d,"aria-describedby":u,...h},m){const p=ze(),g=(Boolean(s)||z(d))&&null!=i&&""!==i,f=g||z(d),b=/* @__PURE__ */Ye("button",{ref:m,type:n,className:Y({variant:t,size:r,pressed:l??(!0===h["aria-pressed"]||"true"===h["aria-pressed"]),ink:o,className:a}),...h,disabled:g?void 0:s,"aria-disabled":!!f||d,"aria-describedby":E(u,g?p:void 0),onClick:f?F:c,children:e});return g?/* @__PURE__ */Ye(B,{reason:i,id:p,children:b}):b}),Qe=je(function({invalid:e,leftIcon:t,rightAdornment:r,size:n,className:a="",readOnly:o,...s},c){const d=`${t?"pl-10":""} ${r?"pr-10":""}`.trim(),u=
|
|
2
2
|
/* @__PURE__ */Ye("input",{ref:c,"aria-invalid":e||void 0,readOnly:o,className:l({invalid:e,size:n,readOnly:o,className:[d,a].filter(Boolean).join(" ")}),...s});return t||r?/* @__PURE__ */Ge("div",{className:"relative",children:[t&&/* @__PURE__ */Ye("span",{className:`pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 ${i}`,children:t}),u,r&&/* @__PURE__ */Ye("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400",children:r})]}):u}),et=je(function({invalid:e,autoGrow:t,className:r="",onInput:n,rows:a=3,size:i,readOnly:o,...s},c){const d=Fe(e=>{if(t){const t=e.currentTarget;t.style.height="auto",t.style.height=`${t.scrollHeight}px`}n?.(e)},[t,n]);/* @__PURE__ */
|
|
3
3
|
return Ye("textarea",{ref:c,"aria-invalid":e||void 0,rows:a,onInput:d,readOnly:o,className:l({invalid:e,size:i,readOnly:o,multiline:!0,className:`${t?"resize-none overflow-hidden":""} ${r}`.trim()}),...s})});function tt(e){for(let t=0;t<e.length;t++)if(!e[t].disabled)return t;return-1}function rt(e){for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}function nt(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?tt(e):rt(e)}function at(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 lt=e=>Array.isArray(e.options);function it(e){const t=[];for(const r of e)lt(r)?t.push(...r.options):t.push(r);return t}function ot(e,t){const r=[];for(const n of e){if(!lt(n)){t(n)&&r.push(n);continue}const e=n.options.filter(t);e.length&&r.push({...n,options:e})}return r}function st(e,t,r,n=""){const a=[];let l=0;return e.forEach((e,i)=>{if(!lt(e))return a.push(t(e,l)),void(l+=1);const o=`${r}-group-${i}`,s=l;l+=e.options.length,a.push(
|
|
4
4
|
/* @__PURE__ */Ge("div",{role:"group","aria-labelledby":o,children:[
|
|
@@ -7,20 +7,20 @@ return Ye(Pe,{name:"check","aria-hidden":"true",className:"h-4 w-4 shrink-0 "+(e
|
|
|
7
7
|
return Ye("span",{className:`min-w-0 ${t?"shrink":"max-w-[45%] shrink-0"} truncate text-xs text-gray-400`,children:e})}var ht=je(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:i="",size:o,touchSize:s,renderOption:c,renderValue:d,valueText:u,readOnly:h,multiple:m,...p},g){const f=t;/* @__PURE__ */
|
|
8
8
|
return Ge("select",{ref:g,value:e,multiple:m||void 0,onChange:e=>f(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":a||void 0,className:l({invalid:a,size:o,className:`pr-8 ${i}`.trim()}),...p,children:[void 0!==n&&!m&&/* @__PURE__ */Ye("option",{value:"",disabled:!0,children:n}),
|
|
9
9
|
/* @__PURE__ */Ye(mt,{items:r})]})});function mt({items:e}){const t=e=>/* @__PURE__ */Ye("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
10
|
-
return Ye(Xe,{children:e.map((e,r)=>(e=>lt(e))(e)?/* @__PURE__ */Ye("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var pt=je(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:o="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,...w},N){const[
|
|
11
|
-
return Ge("div",{id:
|
|
10
|
+
return Ye(Xe,{children:e.map((e,r)=>(e=>lt(e))(e)?/* @__PURE__ */Ye("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var pt=je(function({value:e,onChange:t,options:r,placeholder:n,invalid:a,className:o="",id:s,disabled:c,size:d,touchSize:u,title:h,multiple:m,renderOption:p,renderValue:g,valueText:f,readOnly:b=!1,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,...w},N){const[k,$]=Ee(!1),[M,C]=Ee(-1),L=Be(null),S=Be(null),D=Be(null),P=Be(k);P.current=k;const A=Be({buffer:"",timer:null}),j=ze(),z=`${j}-listbox`,F=s??`${j}-trigger`,E=e=>`${j}-opt-${e}`,B=Te(()=>it(r),[r]),O=m?e:[],R=t,W=T(S,k,{matchTriggerWidth:!0}),K=m?B.findIndex(e=>O.includes(e.value)):B.findIndex(t=>t.value===e),_=m?B.filter(e=>O.includes(e.value)).map(e=>e.label).join(", ")||void 0:K>=0?B[K].label:void 0,q=!m&&K>=0?B[K].lang:void 0,H=m?B.filter(e=>O.includes(e.value)):K>=0?[B[K]]:[],U=g&&H.length?g(H):void 0,V=void 0!==U&&f?f(H):void 0,Y=Fe((e=!0)=>{$(!1),C(-1),e&&S.current?.focus()},[]),G=Fe(()=>{c||b||(C(K>=0?K:tt(B)),$(!0))},[c,b,B,K]),Z=Fe(t=>{const r=B[t];if(r&&!r.disabled){if(m){const n=e;return R(n.includes(r.value)?n.filter(e=>e!==r.value):[...n,r.value]),void C(t)}R(r.value),Y()}},[B,m,e,R,Y]);Ie(()=>{if(!k)return;return Q(e=>!("Escape"!==e.key||!P.current)&&(Y(),!0),()=>D.current)},[k,Y]),Ie(()=>{if(!k)return;const e=e=>{const t=e.target;L.current?.contains(t)||D.current?.contains(t)||Y(!1)};document.addEventListener("pointerdown",e);const t=ee(()=>Y(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[k,Y]),Ie(()=>{!k||M<0||D.current?.querySelector(`#${CSS.escape(E(M))}`)?.scrollIntoView({block:"nearest"})});const J=Fe(e=>{const t=A.current;t.timer&&clearTimeout(t.timer),t.buffer+=e,t.timer=setTimeout(()=>{t.buffer="",t.timer=null},500);const r=k?M:K,n=at(B,t.buffer,r);n<0||(k?C(n):m?(C(n),$(!0)):Z(n))},[k,M,K,B,Z,m]),re=k?st(r,(t,r)=>{const n=(a=t.value,m?O.includes(a):e===a);var a;const l=r===M;/* @__PURE__ */
|
|
11
|
+
return Ge("div",{id:E(r),role:"option",lang:t.description||p?void 0:t.lang,"aria-selected":n,"aria-disabled":t.disabled||void 0,onPointerEnter:()=>{t.disabled||C(r)},onClick:()=>Z(r),className:`mx-1 cursor-pointer truncate rounded-lg min-h-(--row-height-menu) px-3 py-2 text-sm leading-5${m?" flex items-center gap-2":""}\n ${t.disabled?"cursor-not-allowed text-gray-400":l?"bg-blue-50 text-blue-700":n?"font-medium text-blue-600":"text-gray-700"}`,children:[m&&/* @__PURE__ */Ye(ct,{selected:n}),p?/* @__PURE__ */Ye("span",{className:"block min-w-0 flex-1 truncate",children:p(t,{selected:n,active:l})}):m?/* @__PURE__ */Ge("span",{className:"block min-w-0 flex-1",children:[
|
|
12
12
|
/* @__PURE__ */Ye("span",{lang:t.lang,className:"block truncate",children:t.label}),t.description&&/* @__PURE__ */Ye("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.description?
|
|
13
13
|
/* @__PURE__ */Ge(Xe,{children:[
|
|
14
14
|
/* @__PURE__ */Ye("span",{lang:t.lang,className:"block truncate",children:t.label}),
|
|
15
|
-
/* @__PURE__ */Ye("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},
|
|
16
|
-
return Ge("div",{ref:
|
|
17
|
-
/* @__PURE__ */Ye("button",{ref:
|
|
15
|
+
/* @__PURE__ */Ye("span",{className:"mt-0.5 block truncate text-xs leading-4 font-normal text-gray-500",children:t.description})]}):t.label]},t.value)},j,"mx-1"):null;/* @__PURE__ */
|
|
16
|
+
return Ge("div",{ref:L,className:"relative",children:[
|
|
17
|
+
/* @__PURE__ */Ye("button",{ref:S,id:F,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":k,"aria-controls":k?z:void 0,"aria-activedescendant":k&&M>=0?E(M):void 0,"aria-invalid":a||void 0,"aria-describedby":x,"aria-label":y,"aria-labelledby":v,title:h,disabled:c,"aria-readonly":b||void 0,onClick:()=>k?Y():G(),onKeyDown:e=>{if(!c&&!b)switch(e.key){case"ArrowDown":return e.preventDefault(),void(k?C(e=>nt(B,e,1)):G());case"ArrowUp":return e.preventDefault(),void(k?C(e=>nt(B,e,-1)):G());case"Home":return void(k&&(e.preventDefault(),C(tt(B))));case"End":return void(k&&(e.preventDefault(),C(rt(B))));case"Enter":return void(k&&(e.preventDefault(),Z(M)));case" ":return e.preventDefault(),void(k?Z(M):G());case"Escape":return void(k&&(e.preventDefault(),e.stopPropagation(),Y()));case"Tab":return void(k&&Y(!1));default:1!==e.key.length||e.metaKey||e.ctrlKey||e.altKey||(e.preventDefault(),J(e.key))}},className:l({invalid:a,size:d,readOnly:b,className:`${b?"":"pr-8 "}text-left ${o}`.trim()}),children:void 0!==U?
|
|
18
18
|
/* @__PURE__ */Ge("span",{className:"relative block min-w-0 truncate",children:[
|
|
19
19
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:U}),
|
|
20
20
|
/* @__PURE__ */Ye("span",{lang:void 0===V?q:void 0,className:"sr-only",children:V??_})]}):/* @__PURE__ */Ye("span",{lang:q,className:"block truncate "+(void 0===_?"text-gray-400":""),children:_??n??" "})}),!b&&/* @__PURE__ */Ye(Pe,{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}),
|
|
21
21
|
/* @__PURE__ */Ge("select",{ref:N,value:e,multiple:m||void 0,onChange:e=>R(m?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:c,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...w,children:[void 0!==n&&!m&&/* @__PURE__ */Ye("option",{value:"",disabled:!0,children:n}),
|
|
22
|
-
/* @__PURE__ */Ye(mt,{items:r})]}),
|
|
23
|
-
/* @__PURE__ */Ye("div",{ref:
|
|
22
|
+
/* @__PURE__ */Ye(mt,{items:r})]}),k&&Ze(
|
|
23
|
+
/* @__PURE__ */Ye("div",{ref:D,id:z,role:"listbox","aria-labelledby":v??(y?void 0:F),"aria-label":v?void 0:y,"aria-multiselectable":m||void 0,className:"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:{zIndex:te.popup,left:W?.left,top:W?.top,bottom:W?.bottom,width:W?.width,maxHeight:W?.maxHeight??I,visibility:W?void 0:"hidden",...X()},children:re}),document.body)]})}),gt=je(function({touchSize:e="touch",...t},r){return f()&&!t.readOnly?/* @__PURE__ */Ye(ht,{ref:r,...t,size:e}):/* @__PURE__ */Ye(pt,{ref:r,...t})});function ft(e,t,r,n){const a=ze(),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 bt=je(function({checked:e,onChange:t,indeterminate:r=!1,label:n,description:a,disabled:l,className:i="","aria-labelledby":o,"aria-describedby":s,...c},d){const u=Be(null),h=ft(n,a,o,s);Ie(()=>{u.current&&(u.current.indeterminate=r)},[r,e]);const m=Fe(e=>{u.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),p=(r="")=>/* @__PURE__ */Ye("input",{ref:m,type:"checkbox",checked:e,disabled:l,onChange:e=>t(e.target.checked),className:`h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60 ${r}`.trim(),"aria-labelledby":h.labelledBy,"aria-describedby":h.describedBy,...c});return n||a?/* @__PURE__ */Ge("label",{className:`flex items-start gap-2 ${l?"cursor-not-allowed opacity-60":"cursor-pointer"} ${i}`.trim(),children:[p("mt-0.5"),
|
|
24
24
|
/* @__PURE__ */Ge("span",{className:"text-sm leading-tight",children:[n&&/* @__PURE__ */Ye("span",{id:h.labelId,className:"font-medium text-gray-700",children:n}),a&&/* @__PURE__ */Ye("span",{id:h.descriptionId,className:"mt-0.5 block text-xs text-gray-500",children:a})]})]}):p(i)}),xt="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",yt=je(function({checked:e,onChange:t,label:r,description:n,disabled:a,className:l="","aria-labelledby":i,"aria-describedby":o,...s},c){const d=ft(r,n,i,o);return r||n?/* @__PURE__ */Ge("label",{className:`flex items-start gap-2 ${a?"cursor-not-allowed opacity-60":"cursor-pointer"} ${l}`.trim(),children:[
|
|
25
25
|
/* @__PURE__ */Ye("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${xt} mt-0.5`,"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s}),
|
|
26
26
|
/* @__PURE__ */Ge("span",{className:"min-w-0 flex-1 text-sm leading-tight",children:[r&&/* @__PURE__ */Ye("span",{id:d.labelId,className:"block min-w-0 font-medium text-gray-700",children:r}),n&&/* @__PURE__ */Ye("span",{id:d.descriptionId,className:"mt-0.5 block min-w-0 text-xs text-gray-500",children:n})]})]}):/* @__PURE__ */Ye("input",{ref:c,type:"radio",checked:e,disabled:a,onChange:e=>t(e.target.checked),className:`${xt} ${l}`.trim(),"aria-labelledby":d.labelledBy,"aria-describedby":d.describedBy,...s})});function vt({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===Re.count(o)?Re.only(o):null,d=We(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?Ke(d,u):o;/* @__PURE__ */
|
|
@@ -40,22 +40,22 @@ return Ge("svg",{className:`${e} animate-spin text-gray-400`,viewBox:"0 0 24 24"
|
|
|
40
40
|
/* @__PURE__ */Ye("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),
|
|
41
41
|
/* @__PURE__ */Ye("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]})}function Tt({className:e="h-4 w-4"}){/* @__PURE__ */
|
|
42
42
|
return Ye(Pe,{name:"close",className:e,strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})}function It({className:e="h-6 w-6"}){/* @__PURE__ */
|
|
43
|
-
return Ye(Pe,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function Ot({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:f=!0,allowReplace:b=!0,allowRemove:x=!0,replaceLabel:y,removeLabel:v,busy:w=!1,busyLabel:N,disabled:k=!1}){const $=he().media,
|
|
44
|
-
/* @__PURE__ */Ge("div",{...
|
|
43
|
+
return Ye(Pe,{name:"upload",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:e})}function Ot({value:e,onChange:t,onPick:r,onFile:n,label:a,hint:l,error:i,required:o,className:s,accept:c="image/*",maxSizeBytes:d,fit:u="cover",height:h=112,placeholder:m,cta:p,acceptHint:g,showFilename:f=!0,allowReplace:b=!0,allowRemove:x=!0,replaceLabel:y,removeLabel:v,busy:w=!1,busyLabel:N,disabled:k=!1}){const $=he().media,M=p??$.cta,C=y??$.replace,L=v??$.remove,S=N??$.uploading,D=ze(),P=Be(null),[A,j]=Ee(null);Ie(()=>()=>{P.current&&URL.revokeObjectURL(P.current)},[]);const z=k||w,F=!!e&&(Et(e,c)||e===A),E=m??Pt(c,$),B=e=>{r?r(e):n?n(e):(e=>{P.current&&URL.revokeObjectURL(P.current);const r=URL.createObjectURL(e);P.current=r,j(e.type.startsWith("video/")?r:null),t(r)})(e)},T=se({accept:c,maxSizeBytes:d,acceptHint:g,multiple:!1,disabled:z,onAccept:([e])=>B(e)}),{dragOver:I}=T,R=()=>{z||(r?r():T.open())},W=e?St(e):"",K=/* @__PURE__ */Ge("div",{children:[
|
|
44
|
+
/* @__PURE__ */Ge("div",{...T.zoneProps,className:["relative overflow-hidden rounded-md border bg-gray-100 transition-colors",I?"border-blue-500":"border-gray-200"].join(" "),style:{height:h},children:[F?/* @__PURE__ */Ye("video",{src:e??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":W||void 0,className:"h-full w-full",style:{objectFit:u}}):/* @__PURE__ */Ye("img",{src:e??void 0,alt:W,className:"h-full w-full",style:{objectFit:u}}),f&&e&&/* @__PURE__ */Ye(Ft,{children:W}),w&&/* @__PURE__ */Ye(zt,{label:S,rounded:"rounded-md"})]}),!k&&(b||x)&&/* @__PURE__ */Ge("div",{className:"mt-2 flex gap-2",children:[b&&/* @__PURE__ */Ye(O,{id:D,variant:"secondary",size:"sm",onClick:()=>R(),disabled:w,children:C}),x&&/* @__PURE__ */Ye(O,{variant:"ghost",size:"sm",onClick:()=>{P.current&&(URL.revokeObjectURL(P.current),P.current=null),j(null),t("")},disabled:w,children:L})]})]}),_=/* @__PURE__ */Ye("button",{type:"button",id:D,onClick:()=>R(),disabled:z,"aria-label":"string"==typeof E?E:$.upload,"aria-busy":w||void 0,"aria-invalid":!!i||void 0,"aria-required":o||void 0,"aria-describedby":i?`${D}-error`:l?`${D}-hint`:void 0,...T.zoneProps,className:At(I,z,jt(z)),style:{minHeight:h},children:w?/* @__PURE__ */Ge("span",{role:"status",className:"flex flex-col items-center gap-2",children:[
|
|
45
45
|
/* @__PURE__ */Ye(Bt,{}),
|
|
46
|
-
/* @__PURE__ */Ye("span",{className:"text-xs font-medium text-gray-500",children:
|
|
46
|
+
/* @__PURE__ */Ye("span",{className:"text-xs font-medium text-gray-500",children:S})]}):/* @__PURE__ */Ge(Xe,{children:[
|
|
47
47
|
/* @__PURE__ */Ye("span",{className:"text-gray-400",children:/* @__PURE__ */Ye(It,{})}),
|
|
48
|
-
/* @__PURE__ */Ye("span",{className:"px-3 text-xs text-gray-500",children:
|
|
49
|
-
/* @__PURE__ */Ye("span",{className:"text-sm font-medium text-blue-600",children:
|
|
50
|
-
return Ge(vt,{label:a,htmlFor:
|
|
51
|
-
/* @__PURE__ */Ye(de,{rejections:
|
|
52
|
-
return Ge("section",{"aria-label":
|
|
48
|
+
/* @__PURE__ */Ye("span",{className:"px-3 text-xs text-gray-500",children:E}),
|
|
49
|
+
/* @__PURE__ */Ye("span",{className:"text-sm font-medium text-blue-600",children:M}),g&&/* @__PURE__ */Ye("span",{className:"text-xs text-gray-400",children:g})]})});/* @__PURE__ */
|
|
50
|
+
return Ge(vt,{label:a,htmlFor:D,hint:l,error:i,required:o,className:s,children:[e?K:_,!r&&/* @__PURE__ */Ye("input",{...T.inputProps}),
|
|
51
|
+
/* @__PURE__ */Ye(de,{rejections:T.rejections})]})}function Rt({committedUrl:e,committedHasAlpha:t=null,committedIsLight:n=null,fallbackUrl:a,fallbackHasAlpha:l=null,fallbackIsLight:i=null,subjectName:o,assetName:s,onSave:c,onRemove:d,accept:u="image/png,image/x-icon,image/vnd.microsoft.icon,.ico,image/svg+xml,image/jpeg,image/webp",acceptHint:h="PNG · ICO · SVG · JPG · WEBP",maxBytes:m=5242880,previews:p=[],disabled:g=!1}){const f=Be(null),[b,x]=Ee(null),[y,v]=Ee(""),[w,N]=Ee(""),[k,$]=Ee(!1),[M,C]=Ee(!1),L=function(e){return e.trim().toLocaleLowerCase().split(/\s+/).at(-1)||"image"}(s),S=he().brandAsset,D=y||e||a||"",P=b?null:e?t:l,A=b?null:e?n:i;Ie(()=>()=>{f.current&&URL.revokeObjectURL(f.current)},[]);const j=()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null)};/* @__PURE__ */
|
|
52
|
+
return Ge("section",{"aria-label":S.region(s,o),className:"grid gap-4 lg:grid-cols-2",children:[
|
|
53
53
|
/* @__PURE__ */Ge("div",{className:"rounded-lg border border-gray-200 bg-white p-4",children:[
|
|
54
|
-
/* @__PURE__ */Ye(Ot,{value:
|
|
54
|
+
/* @__PURE__ */Ye(Ot,{value:D,onChange:()=>{},onFile:e=>{if(g)return;j();const t=URL.createObjectURL(e);f.current=t,x(e),v(t),N("")},label:s,hint:w||S.usedFor(o),error:w||void 0,accept:u,acceptHint:h,maxSizeBytes:m,fit:"contain",height:180,allowRemove:!1,busy:k||M,disabled:g}),
|
|
55
55
|
/* @__PURE__ */Ge("div",{className:"mt-3 flex flex-wrap gap-2",children:[
|
|
56
|
-
/* @__PURE__ */Ye(
|
|
57
|
-
/* @__PURE__ */Ye("h3",{className:"text-sm font-semibold text-gray-900",children:
|
|
58
|
-
/* @__PURE__ */Ye("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */Ye(r,{src:
|
|
56
|
+
/* @__PURE__ */Ye(O,{onClick:async()=>{if(b&&!g&&!k){$(!0),N("");try{await c(b),j(),x(null),v("")}catch(e){N(e instanceof Error?e.message:S.saveFailed(L,s))}finally{$(!1)}}},disabled:!b||g,loading:k,children:S.save(L,s)}),(b||e)&&/* @__PURE__ */Ye(O,{variant:"ghost-danger",onClick:async()=>{if(!g&&!M){if(b)return j(),x(null),v(""),void N("");if(e){C(!0),N("");try{await d()}catch(e){N(e instanceof Error?e.message:S.removeFailed(L,s))}finally{C(!1)}}}},disabled:g,loading:M,children:b?S.discard:S.remove(L,s)})]})]}),p.length>0&&/* @__PURE__ */Ge("div",{className:"rounded-lg border border-gray-200 bg-white p-4","aria-label":S.previews(s),children:[
|
|
57
|
+
/* @__PURE__ */Ye("h3",{className:"text-sm font-semibold text-gray-900",children:S.preview}),
|
|
58
|
+
/* @__PURE__ */Ye("div",{className:"mt-3 grid gap-3",children:p.map(e=>{const t=/* @__PURE__ */Ye(r,{src:D,alt:S.alt(o,s),slot:e.slot,surface:e.surface,adaptive:!0,hasAlpha:P,isLight:A,size:"browser-tab"===e.kind?16:void 0});/* @__PURE__ */
|
|
59
59
|
return Ge("div",{"data-brand-preview":!0,className:"dark"===e.surface?"text-white":"text-gray-900",children:[
|
|
60
60
|
/* @__PURE__ */Ye("div",{className:"mb-2 text-xs font-medium text-gray-500",children:e.label}),"browser-tab"===e.kind?/* @__PURE__ */Ge("div",{className:"flex items-end gap-1 border-b border-gray-200",children:[
|
|
61
61
|
/* @__PURE__ */Ge("div",{className:"flex max-w-[220px] items-center gap-2 rounded-t-lg border border-b-0 border-gray-200 bg-white px-3 py-2",children:[t,
|
|
@@ -90,38 +90,38 @@ return Ge("div",{className:p,children:[
|
|
|
90
90
|
/* @__PURE__ */Ge("div",{ref:A,role:"grid","aria-label":_,className:"space-y-1","aria-readonly":h||void 0,onKeyDown:e=>{const t=Zt(R)??x??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](),j.current=!0,P(Xt(a)),void(Jt(a)!==L&&K(a));var a;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h||B(R)||n(R))},hidden:"days"!==z,children:[
|
|
91
91
|
/* @__PURE__ */Ye("div",{role:"row",className:`${Gt} text-center text-xs font-medium text-gray-500`,children:Array.from({length:7},(e,t)=>(t+k)%7).map(e=>
|
|
92
92
|
/* @__PURE__ */Ye("div",{role:"columnheader","aria-label":w.weekdays[e],className:"py-1",children:/* @__PURE__ */Ye("abbr",{title:w.weekdays[e],className:"no-underline",children:w.weekdaysShort[e]})},e))}),Array.from({length:6},(a,l)=>/* @__PURE__ */Ye("div",{role:"row",className:`${Gt} text-center text-sm`,children:E.slice(7*l,7*l+7).map(a=>{const l=Xt(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=B(l),d=w.longDate(a.getFullYear(),a.getMonth(),a.getDate()),u=e=>["relative w-full aspect-square rounded-md transition-colors",e?"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",c?"cursor-not-allowed text-gray-300":o?"bg-blue-600 font-semibold text-white":s?"bg-blue-100 text-blue-800":i?"text-gray-500"+(e?" hover:bg-gray-100":""):"text-gray-700"+(e?" hover:bg-gray-100":""),l!==b||o?"":"font-semibold text-blue-600"].filter(Boolean).join(" "),m=g.has(l)&&/* @__PURE__ */Ye("span",{"data-marked":"","aria-hidden":"true",className:"absolute bottom-1 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full "+(o?"bg-white":i?"bg-gray-400":"bg-blue-500")});/* @__PURE__ */
|
|
93
|
-
return Ye("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Ge("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{P(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var nr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],ar=e=>`${e.getFullYear()}-${lr(e.getMonth()+1)}`,lr=e=>String(e).padStart(2,"0");function ir(e){return`${e.getFullYear()}-${lr(e.getMonth()+1)}-${lr(e.getDate())}`}function or(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:ir(new Date(r,n,t.getDate()-14)),to:ir(a)};case"lastMonth":return{from:ir(i(1)),to:ir(l)};case"last3Months":return{from:ir(i(3)),to:ir(l)};case"last6Months":return{from:ir(i(6)),to:ir(l)};case"last12Months":return{from:ir(i(12)),to:ir(l)}}}function sr(e,t,r){const n=ar(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function cr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function dr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var ur=/* @__PURE__ */new Map;function hr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:d,"aria-labelledby":u,"aria-label":h,weekStartsOn:m,placeholder:p,fullWidth:g=!1,min:f,max:b,disabled:x=!1,allowOpenEnd:y=!1}){const v=he().dateRange,w=ue(),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):dr)
|
|
94
|
-
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>
|
|
95
|
-
/* @__PURE__ */Ye(rr,{mode:"range",min:f,max:b,value:
|
|
96
|
-
return Ge("div",{className:"relative"+(g?" w-full":""),ref:
|
|
93
|
+
return Ye("div",{role:"gridcell","aria-selected":o,"aria-label":h?d:void 0,children:h?/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:`grid place-items-center ${u(!1)}`,children:[a.getDate(),m]}):/* @__PURE__ */Ge("button",{type:"button","data-active":l===R,tabIndex:l===R?0:-1,disabled:c,"aria-label":d,"aria-current":l===b?"date":void 0,onClick:()=>{P(l),n(l)},className:u(!0),children:[a.getDate(),m]})},l)})},l))]})]})}var nr=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],ar=e=>`${e.getFullYear()}-${lr(e.getMonth()+1)}`,lr=e=>String(e).padStart(2,"0");function ir(e){return`${e.getFullYear()}-${lr(e.getMonth()+1)}-${lr(e.getDate())}`}function or(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:ir(new Date(r,n,t.getDate()-14)),to:ir(a)};case"lastMonth":return{from:ir(i(1)),to:ir(l)};case"last3Months":return{from:ir(i(3)),to:ir(l)};case"last6Months":return{from:ir(i(6)),to:ir(l)};case"last12Months":return{from:ir(i(12)),to:ir(l)}}}function sr(e,t,r){const n=ar(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function cr(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function dr(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var ur=/* @__PURE__ */new Map;function hr({from:e,to:t,onChange:r,formatDisplay:n,clearable:a,required:l=!1,name:i,id:d,"aria-labelledby":u,"aria-label":h,weekStartsOn:m,placeholder:p,fullWidth:g=!1,min:f,max:b,disabled:x=!1,allowOpenEnd:y=!1}){const v=he().dateRange,w=ue(),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):dr),k=p??v.placeholder,$=a??!l,[M,C]=Ee(!1),[L,S]=Ee(e),[D,P]=Ee(t),[A,j]=Ee(null),[z,F]=Ee("from"),E=Be(null),B=Be(null),I=Be(null),O=ze(),R=ze(),W=ze(),[K,_]=Ee(!1),q=T(E,M,{preferredMaxWidth:520,preferredMaxHeight:K?720:560,popupRef:I}),H=Be(null),U=Be(null),[V,Y]=Ee(!0);re(()=>{const e=U.current;if(!M||!K||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==V&&Y(a)});const Z=Be(null);re(()=>{const e=I.current;if(!M||!q||!e)return;const t=getComputedStyle(e),r=q.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(K)null!==Z.current&&Z.current<=r&&_(!1);else{const e=H.current?.offsetWidth??0;if(0===e)return;Z.current=e,e>r+.5&&_(!0)}});const[J,Q]=Ee(!1);re(()=>{const e=!!d&&(B.current?.labels?.length??0)>0;e!==J&&Q(e)});const ne=!!h||!!u||J,ae=/* @__PURE__ */new Date,[le,ie]=Ee(()=>e?ar(cr(e)):sr(ae,f,b)),oe=nr.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(or(e,ae),f,b)),se=e=>e?N(e):"";Ie(()=>{if(!M)return;const e=e=>{const t=e.target;E.current?.contains(t)||I.current?.contains(t)||C(!1)};document.addEventListener("mousedown",e);const t=ee(()=>C(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[M]),Ie(()=>{x&&C(!1)},[x]);const ce=()=>{r("",""),C(!1)},de=e&&t?`${se(e)} — ${se(t)}`:e?v.fromOnly(se(e)):t?v.toOnly(se(t)):"",me=ke(w),pe=e=>{const t=Zt(e);return t?me.longDate(t.getFullYear(),t.getMonth(),t.getDate()):e},ge=e&&t?v.range(pe(e),pe(t)):e?v.fromOnly(pe(e)):t?v.toOnly(pe(t)):k,fe=e=>K?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(A===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 "+(A===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),be=/* @__PURE__ */Ge(Xe,{children:[oe.map(e=>/* @__PURE__ */Ye("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=or(e,ae);S(t.from),P(t.to),j(e),ie(t.from.slice(0,7))})(e),className:fe(e),"aria-label":K?v[e]:void 0,children:K?V?v[e]:v[`${e}Short`]:v[e]},e)),
|
|
94
|
+
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>j("Custom"),className:fe("Custom"),children:v.custom})]}),xe=(e,t)=>y?/* @__PURE__ */Ye("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__ */Ye("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),ye=e=>y&&z===e?" ring-1 ring-blue-400":"",ve=
|
|
95
|
+
/* @__PURE__ */Ye(rr,{mode:"range",min:f,max:b,value:L||null,endValue:D||null,month:le,onMonthChange:ie,onSelect:e=>{j("Custom"),y?"from"===z?(D&&e>D?(S(D),P(e)):S(e),F("to")):L&&e<L?(P(L),S(e)):P(e):!L||L&&D?(S(e),P("")):e<L?(P(L),S(e)):P(e)},weekStartsOn:m,"aria-label":v.dialog});/* @__PURE__ */
|
|
96
|
+
return Ge("div",{className:"relative"+(g?" w-full":""),ref:E,children:[
|
|
97
97
|
/* @__PURE__ */Ge("div",{className:`${g?"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} ${s}`:c}${x?" cursor-not-allowed opacity-60":""}`,children:[
|
|
98
|
-
/* @__PURE__ */Ge("button",{ref:
|
|
98
|
+
/* @__PURE__ */Ge("button",{ref:B,type:"button",onClick:()=>{x||(S(e),P(t),j(null),F(e&&!t?"to":"from"),ie(e?ar(cr(e)):sr(ae,f,b)),C(!0))},"aria-haspopup":"dialog","aria-expanded":M,id:d,disabled:x||void 0,"aria-label":h,"aria-labelledby":u,"aria-describedby":[ne?R:void 0,l?W:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":M?O:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(g?" min-w-0 flex-1 justify-start":""),children:[
|
|
99
99
|
/* @__PURE__ */Ye(Pe,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
100
|
-
/* @__PURE__ */Ye("span",{className:"truncate",children:de
|
|
100
|
+
/* @__PURE__ */Ye("span",{className:"truncate",children:de||k})]}),$&&!x&&(e||t)&&/* @__PURE__ */Ye("button",{type:"button",onClick:ce,"aria-label":v.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),ne&&/* @__PURE__ */Ye("span",{id:R,className:"sr-only",children:ge}),l&&/* @__PURE__ */Ye("span",{id:W,className:"sr-only",children:v.required}),i&&/* @__PURE__ */Ge(Xe,{children:[
|
|
101
101
|
/* @__PURE__ */Ye("input",{type:"hidden",name:i.from,value:e,disabled:x||void 0}),
|
|
102
|
-
/* @__PURE__ */Ye("input",{type:"hidden",name:i.to,value:t,disabled:x||void 0})]}),
|
|
102
|
+
/* @__PURE__ */Ye("input",{type:"hidden",name:i.to,value:t,disabled:x||void 0})]}),M&&Ze(
|
|
103
103
|
/* @__PURE__ */Ge("div",{ref:I,id:O,role:"dialog","aria-label":v.dialog,"data-layout":K?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:te.popup,left:q?.left,right:q?.right,top:q?.top,bottom:q?.bottom,width:K&&q?q.maxWidth:"max-content",maxWidth:q?.maxWidth,maxHeight:q?.maxHeight,overflowY:"auto",visibility:q?void 0:"hidden",...X()},children:[
|
|
104
104
|
/* @__PURE__ */Ge("div",{className:K?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[xe("from",/* @__PURE__ */Ge(Xe,{children:[
|
|
105
105
|
/* @__PURE__ */Ye("span",{className:"text-xs font-medium text-gray-500",children:v.from}),
|
|
106
|
-
/* @__PURE__ */Ye("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${
|
|
106
|
+
/* @__PURE__ */Ye("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"}${ye("from")}`,children:L?se(L):v.start})]})),!K&&/* @__PURE__ */Ye("span",{className:"text-gray-300",children:"—"}),xe("to",/* @__PURE__ */Ge(Xe,{children:[
|
|
107
107
|
/* @__PURE__ */Ye("span",{className:"text-xs font-medium text-gray-500",children:v.to}),
|
|
108
|
-
/* @__PURE__ */Ye("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${
|
|
108
|
+
/* @__PURE__ */Ye("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${D?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${ye("to")}`,children:D?se(D):v.end})]}))]}),K?/* @__PURE__ */Ge(Xe,{children:[oe.length>0&&/* @__PURE__ */Ge("div",{className:"mb-3 @container",children:[!V&&/* @__PURE__ */Ye("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:v.lastHeading}),
|
|
109
109
|
/* @__PURE__ */Ge("div",{ref:U,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[be,oe.map(e=>/* @__PURE__ */Ye("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:v[e]},e))]})]}),
|
|
110
110
|
/* @__PURE__ */Ye("div",{className:"w-full",children:ve})]}):
|
|
111
111
|
/* @__PURE__ */Ge("div",{ref:H,className:"flex w-max gap-4",children:[
|
|
112
112
|
/* @__PURE__ */Ye("div",{className:"w-64",children:ve}),oe.length>0&&/* @__PURE__ */Ye("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:be})]}),
|
|
113
|
-
/* @__PURE__ */Ge("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[
|
|
114
|
-
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>
|
|
115
|
-
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{r(
|
|
116
|
-
return Ye("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":a||void 0,value:gr(e,u),min:gr(r,u)||void 0,max:gr(n,u)||void 0,onChange:e=>t?.(mr.test(e.target.value)?e.target.value:null),className:l({invalid:a,size:i,className:o}),...c})}),br=/^\d{4}-\d{2}-\d{2}$/,xr=/^(aria|data)-/,yr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function vr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":ir(e);if(br.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":ir(t)}function wr(e){if(!br.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 Nr(e,t){const r=wr(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var kr=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:o,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:x,clearable:y,form:v,title:w,tabIndex:N,autoFocus
|
|
117
|
-
return Ye("input",{ref:
|
|
113
|
+
/* @__PURE__ */Ge("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[$&&/* @__PURE__ */Ye("button",{type:"button",onClick:ce,className:G({variant:"ghost"}),children:v.clear}),
|
|
114
|
+
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>C(!1),className:G({variant:"secondary"}),children:v.cancel}),
|
|
115
|
+
/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{r(L,D),C(!1)},disabled:y?!L&&!D:!L||!D,className:G({variant:"primary"}),children:v.apply})]})]}),document.body)]})}var mr=/^\d{2}:\d{2}(:\d{2})?$/,pr=e=>String(e).padStart(2,"0");function gr(e,t){if(null==e||""===e)return"";if(e instanceof Date){if(Number.isNaN(e.getTime()))return"";const r=`${pr(e.getHours())}:${pr(e.getMinutes())}`;return t?`${r}:${pr(e.getSeconds())}`:r}return mr.test(e)?e:""}var fr=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:i,className:o="",step:s,...c},d){const u=null!=s&&Number(s)<60,h=ue();/* @__PURE__ */
|
|
116
|
+
return Ye("input",{ref:d,type:"time",lang:h,step:s,"aria-invalid":a||void 0,value:gr(e,u),min:gr(r,u)||void 0,max:gr(n,u)||void 0,onChange:e=>t?.(mr.test(e.target.value)?e.target.value:null),className:l({invalid:a,size:i,className:o}),...c})}),br=/^\d{4}-\d{2}-\d{2}$/,xr=/^(aria|data)-/,yr=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function vr(e){if(null==e||""===e)return"";if(e instanceof Date)return Number.isNaN(e.getTime())?"":ir(e);if(br.test(e))return e;const t=new Date(e);return Number.isNaN(t.getTime())?"":ir(t)}function wr(e){if(!br.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 Nr(e,t){const r=wr(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var kr=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:o,native:s,weekStartsOn:c,className:d="","aria-label":u,"aria-describedby":h,"aria-labelledby":m,id:p,name:g,disabled:f,placeholder:b,required:x,clearable:y,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C},L){const S=y??!x,D=vr(e),P=vr(r),A=vr(n),j=he().datePicker,z=ue(),F=ke(z),[E,B]=Ee(!1),I=Be(null),O=Be(null),R=Be(null),W=ze(),K=ze(),_=ze(),q=T(O,E,{popupRef:R}),[H,U]=Ee(!1);re(()=>{const e=!!p&&(O.current?.labels?.length??0)>0;e!==H&&U(e)});const V=!u&&(!!m||H);if(Ie(()=>{if(!E)return;const e=e=>{const t=e.target;I.current?.contains(t)||R.current?.contains(t)||B(!1)};document.addEventListener("pointerdown",e,!0);const t=ee(()=>B(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[E]),Ie(()=>{if(E)return Q(e=>"Escape"===e.key&&(B(!1),O.current?.focus(),!0),()=>R.current)},[E]),s)/* @__PURE__ */
|
|
117
|
+
return Ye("input",{ref:L,type:"date",lang:z,id:p,name:g,disabled:f,"aria-label":u,"aria-describedby":h,"aria-invalid":a||void 0,value:D,min:P||void 0,max:A||void 0,onChange:e=>t?.(wr(e.target.value)),className:l({invalid:a,size:o,className:d}),"aria-labelledby":m,required:x,form:v,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,...C});const Y=Object.fromEntries(Object.entries(C).filter(([e])=>xr.test(e)&&!yr.has(e))),G=C["aria-required"],X=!!x||!0===G||"true"===G,Z=[V?K:void 0,X?_:void 0,h].filter(Boolean).join(" ")||void 0,J=ir(/* @__PURE__ */new Date),ne=(!P||J>=P)&&(!A||J<=A),ae=b??j.placeholder;/* @__PURE__ */
|
|
118
118
|
return Ge("div",{ref:I,className:"relative",children:[
|
|
119
|
-
/* @__PURE__ */Ye("input",{ref:
|
|
120
|
-
/* @__PURE__ */Ge("button",{ref:O,type:"button",...Y,id:p,disabled:f,title:w,tabIndex:N,autoFocus
|
|
121
|
-
/* @__PURE__ */Ye("span",{className:
|
|
122
|
-
/* @__PURE__ */Ye(Pe,{name:"date",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:"1.75","aria-hidden":"true"})]}),V&&/* @__PURE__ */Ye("span",{id:K,className:"sr-only",children:
|
|
123
|
-
/* @__PURE__ */Ge("div",{ref:R,id:W,role:"dialog","aria-label":u??
|
|
124
|
-
/* @__PURE__ */Ye(rr,{value:
|
|
119
|
+
/* @__PURE__ */Ye("input",{ref:L,type:"hidden",name:g,form:v,value:D}),
|
|
120
|
+
/* @__PURE__ */Ge("button",{ref:O,type:"button",...Y,id:p,disabled:f,title:w,tabIndex:N,autoFocus:k,onFocus:$,onBlur:M,"aria-haspopup":"dialog","aria-expanded":E,"aria-controls":E?W:void 0,"aria-labelledby":m,"aria-describedby":Z,"aria-label":u?`${u}${D?`, ${Nr(D,F)}`:""}`:void 0,onClick:()=>B(e=>!e),className:`${l({invalid:a,size:o,className:d})} flex items-center justify-between text-left`,children:[
|
|
121
|
+
/* @__PURE__ */Ye("span",{className:D?"text-gray-900":"text-gray-400",children:D?Nr(D,F):ae}),
|
|
122
|
+
/* @__PURE__ */Ye(Pe,{name:"date",className:`h-4 w-4 shrink-0 ${i}`,strokeWidth:"1.75","aria-hidden":"true"})]}),V&&/* @__PURE__ */Ye("span",{id:K,className:"sr-only",children:D?Nr(D,F):ae}),X&&/* @__PURE__ */Ye("span",{id:_,className:"sr-only",children:j.required}),E&&Ze(
|
|
123
|
+
/* @__PURE__ */Ge("div",{ref:R,id:W,role:"dialog","aria-label":u??j.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:te.popup,left:q?.left,right:q?.right,top:q?.top,bottom:q?.bottom,maxWidth:q?.maxWidth,visibility:q?void 0:"hidden"},children:[
|
|
124
|
+
/* @__PURE__ */Ye(rr,{value:D||null,min:P||null,max:A||null,weekStartsOn:c,onSelect:e=>{B(!1),O.current?.focus(),t?.(wr(e))}}),(S||ne)&&/* @__PURE__ */Ge("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[S&&/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{B(!1),O.current?.focus(),t?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:j.clear}),ne&&/* @__PURE__ */Ye("button",{type:"button",onClick:()=>{B(!1),O.current?.focus(),t?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:j.today})]})]}),document.body)]})}),$r=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,Mr=e=>String(e).padStart(2,"0");function Cr(e){return null==e||""===e?"":e instanceof Date?Number.isNaN(e.getTime())?"":`${(t=e).getFullYear()}-${Mr(t.getMonth()+1)}-${Mr(t.getDate())}T${Mr(t.getHours())}:${Mr(t.getMinutes())}`:$r.test(e)?e:"";var t}var Lr=je(function({value:e,onChange:t,min:r,max:n,invalid:a,size:i,className:o="",...s},c){const d=ue();/* @__PURE__ */
|
|
125
125
|
return Ye("input",{ref:c,type:"datetime-local",lang:d,"aria-invalid":a||void 0,value:Cr(e),min:Cr(r)||void 0,max:Cr(n)||void 0,onChange:e=>t?.(function(e){if(!$r.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:l({invalid:a,size:i,className:o}),...s})});function Sr(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 Dr(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 Pr(e,t,r){const n=await Dr(t,r),a=pe().copy;return n?g.success(a.copiedLabel(e)):g.error(a.failed),n}var Ar={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},jr={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 zr(){/* @__PURE__ */
|
|
126
126
|
return Ye(Pe,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function Fr(){/* @__PURE__ */
|
|
127
127
|
return Ye(Pe,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function Er({value:e,children:t,symbol:r,label:n,size:a="md",variant:l="bordered",hideCopyButton:i=!1,onCopy:o,multiline:s=!1,id:c,"aria-describedby":d,className:u=""}){const[h,m]=Ee(!1),p=Be(null),f=he().copy;Ie(()=>()=>{p.current&&clearTimeout(p.current)},[]);const b=Fe(async()=>{await Dr(e)?(m(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{m(!1),p.current=null},2e3),o?.(e)):g.error(f.failed)},[e,o,f]),{box:x,button:y}=jr[a],v=!i;/* @__PURE__ */
|
|
@@ -129,38 +129,38 @@ return Ge("div",{id:v?void 0:c,"aria-describedby":v?void 0:d,className:["inline-
|
|
|
129
129
|
/* @__PURE__ */Ye("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__ */Ge(Xe,{children:[
|
|
130
130
|
/* @__PURE__ */Ye(Je,{id:c,"aria-label":n?f.copyLabel(n):f.copy,"aria-describedby":d,onClick:b,className:`${y} text-gray-400`,children:/* @__PURE__ */Ye(h?Fr:zr,{})}),
|
|
131
131
|
/* @__PURE__ */Ye("span",{"aria-live":"polite",className:"sr-only",children:h?f.copied:""})]})]})}var Br=2;function Tr(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 Ir(e){return e.slice(0,-1)}var Or=["1","2","3","4","5","6","7","8","9",".","0"];function Rr({value:e,onChange:t,onEnter:r,enterLabel:n,enterDisabled:a,className:l=""}){const i=he().keypad,o=r=>{r!==e&&t(r)};/* @__PURE__ */
|
|
132
|
-
return Ge("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[Or.map(t=>/* @__PURE__ */Ye(
|
|
133
|
-
/* @__PURE__ */Ye(
|
|
132
|
+
return Ge("div",{className:`grid grid-cols-3 gap-3 ${l}`.trim(),children:[Or.map(t=>/* @__PURE__ */Ye(O,{size:"touch-xl",variant:"secondary",onClick:()=>o(Tr(e,t)),children:t},t)),
|
|
133
|
+
/* @__PURE__ */Ye(O,{size:"touch-xl",variant:"secondary","aria-label":i.backspace,onClick:()=>o(Ir(e)),children:"⌫"}),r&&/* @__PURE__ */Ye(O,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:a,onClick:r,children:n??i.enter})]})}var Wr={md:"h-24 p-3",lg:"h-32 p-4"},Kr=je(function({title:e,subtitle:t,size:r="lg",selected:n=!1,disabled:a,type:l="button",className:i="",...o},s){/* @__PURE__ */
|
|
134
134
|
return Ge("button",{ref:s,type:l,disabled:a,"aria-pressed":n||void 0,className:["flex w-full flex-col justify-between rounded-xl border text-left transition-colors rosh-focus-ring","disabled:cursor-not-allowed disabled:opacity-50",n?"border-blue-600 bg-blue-50 ring-2 ring-blue-400/40":"border-gray-200 bg-white hover:bg-gray-50 focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",Wr[r],i].filter(Boolean).join(" "),...o,children:[
|
|
135
135
|
/* @__PURE__ */Ye("span",{className:"line-clamp-2 font-medium text-gray-900",children:e}),null!=t&&/* @__PURE__ */Ye("span",{className:"text-sm text-gray-500",children:t})]})}),_r={sm:"h-(--control-height-sm) px-(--space-control-x-sm) gap-(--space-icon-gap-sm) text-xs",md:"h-(--control-height-md) px-(--space-control-x) gap-(--space-icon-gap) text-sm",lg:"h-(--control-height-lg) px-(--space-control-x-lg) gap-(--space-icon-gap) text-sm",touch:"h-14 px-(--space-20) gap-(--space-icon-gap) text-base"};function qr(e=!1,t=""){return["rosh-choice-track inline-flex max-w-full items-center gap-(--space-4) overflow-x-auto rounded-(--radius-card) bg-gray-100 p-(--space-4)","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",e?"w-full":"",t].filter(Boolean).join(" ")}function Hr({size:e="md",selected:t,disabled:r=!1,block:n=!1}){return["relative inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-(--radius-control) font-medium transition-colors",_r[e],t?"bg-blue-600 text-white shadow-sm rosh-segmented-on":"text-gray-600 hover:text-gray-900",r?"cursor-not-allowed opacity-40":"cursor-pointer",n?"flex-1":""].filter(Boolean).join(" ")}function Ur(e=!1){return e?"relative inline-flex shrink-0 flex-1":"relative inline-flex shrink-0"}function Vr({icon:e,label:t}){/* @__PURE__ */
|
|
136
136
|
return Ge(Xe,{children:[e?/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"inline-flex shrink-0",children:e}):null,t]})}function Yr({value:e,onChange:t,options:r,name:n,size:a="md",block:l=!1,label:i,className:o="","aria-labelledby":s,"aria-describedby":c}){const d={"aria-label":s?void 0:i,"aria-labelledby":s,"aria-describedby":c},u=ze(),h=qr(l,o),m=Ur(l);/* @__PURE__ */
|
|
137
137
|
return Ye("div",n?{role:"radiogroup",...d,className:h,children:r.map(r=>{const i=`${u}-${r.value}`,o=r.value===e,s=/* @__PURE__ */Ge("label",{htmlFor:i,className:Hr({size:a,selected:o,disabled:r.disabled,block:l}),children:[
|
|
138
138
|
/* @__PURE__ */Ye("input",{id:i,type:"radio",name:n,value:r.value,checked:o,disabled:r.disabled,"aria-describedby":r.title?`${i}-note`:void 0,onChange:()=>t(r.value),className:"absolute inset-0 m-0 h-full w-full appearance-none rounded-[inherit] bg-transparent cursor-[inherit] rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"}),
|
|
139
|
-
/* @__PURE__ */Ye(Vr,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */Ye("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */Ye(
|
|
139
|
+
/* @__PURE__ */Ye(Vr,{icon:r.icon,label:r.label}),r.title&&/* @__PURE__ */Ye("span",{id:`${i}-note`,className:"sr-only",children:r.title})]},r.value);return r.title?/* @__PURE__ */Ye(R,{content:r.title,className:m,children:s},r.value):s})}:{role:"group",...d,className:h,children:r.map(r=>{const n=r.value===e,i=/* @__PURE__ */Ye("button",{type:"button","aria-pressed":n,disabled:r.disabled,onClick:()=>t(r.value),className:Hr({size:a,selected:n,disabled:r.disabled,block:l}),children:/* @__PURE__ */Ye(Vr,{icon:r.icon,label:r.label})},r.value);return r.title?/* @__PURE__ */Ye(R,{content:r.title,className:m,children:i},r.value):i})})}var Gr={sm:"h-5 w-9",md:"h-6 w-11",touch:"h-8 w-14"},Xr={sm:"h-4 w-4",md:"h-5 w-5",touch:"h-7 w-7"},Zr={sm:"translate-x-4",md:"translate-x-5",touch:"translate-x-6"},Jr=je(function({checked:e,onChange:t,disabled:r=!1,size:n="md",label:a,hint:l,id:i,className:o="",disabledReason:s,disabledReasonId:c,...d},u){const h=ze(),m=i??h,p=l?`${m}-hint`:void 0,g=r&&c?c:void 0,f=r&&!g&&null!=s&&""!==s,b=f?`${m}-reason`:void 0,x=[p,g??b].filter(Boolean).join(" ")||void 0,y=/* @__PURE__ */Ye("button",{ref:u,id:m,type:"button",role:"switch","aria-checked":e,"aria-describedby":x,disabled:r,onClick:()=>t(!e),...d,className:["relative inline-flex shrink-0 items-center rounded-full p-0.5 transition-colors","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]","disabled:cursor-not-allowed disabled:opacity-40",Gr[n],e?"bg-blue-600":"bg-gray-300"].join(" "),children:/* @__PURE__ */Ye("span",{className:["inline-block rounded-full bg-white shadow transition-transform",Xr[n],e?Zr[n]:"translate-x-0"].join(" ")})});return a||l||f?/* @__PURE__ */Ge("span",{className:`flex items-start gap-3 ${o}`.trim(),children:[y,
|
|
140
140
|
/* @__PURE__ */Ge("span",{className:"min-w-0",children:[a&&/* @__PURE__ */Ye("label",{htmlFor:m,className:"block text-sm font-medium text-gray-800",children:a}),l&&/* @__PURE__ */Ye("span",{id:p,className:"mt-0.5 block text-xs text-gray-500",children:l}),f&&/* @__PURE__ */Ye("span",{id:b,className:"mt-0.5 block text-xs text-red-600",children:s})]})]}):/* @__PURE__ */Ye("span",{className:o,children:y})});function Qr(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}var en=(e,t)=>null==e?"":null!=t?e.toFixed(t):String(e);function tn({dir:e,compact:t,label:r,disabled:n,onStep:a}){const l=Be(a);l.current=a;const i=Be({}),o=Fe(()=>{const e=i.current;void 0!==e.wait&&clearTimeout(e.wait),void 0!==e.every&&clearInterval(e.every),e.off?.(),i.current={}},[]);Ie(()=>o,[o]),Ie(()=>{n&&o()},[n,o]);const s=/* @__PURE__ */Ye(Pe,{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__ */Ye("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__ */Ye(Je,{size:"sm",...c,children:s})}var rn=je(function({value:e,onChange:t,min:r,max:n,precision:a,step:i,shiftStep:o,disabled:s,readOnly:c,invalid:d,placeholder:u,size:h,prefix:m,suffix:p,id:g,name:f,className:b="",onBlur:x,onFocus:y,steppers:v=!1,stepFrom:w,snap:N=!1,allowEmpty:k=!0,appearance:$="box",display:M,reportWhileTyping:C=!0,onRevert:L,"aria-label":S,"aria-labelledby":D,"aria-describedby":P,...A},j){const z="bare"===$,F="string"==typeof p&&""!==p.trim()?p.trim():void 0,E=e=>function(e,t){let r=e.trim();if(t&&r.endsWith(t)&&(r=r.slice(0,-t.length).trim()),r=r.replace(",","."),""===r||"-"===r||"."===r||"-."===r)return null;const n=Number(r);return Number.isFinite(n)?n:null}(e,F),B=Object.fromEntries(Object.entries(A).filter(([e])=>e.startsWith("data-"))),T=he(),[I,O]=Ee(()=>en(e,a)),R=Be(I);R.current=I;const W=Be(null),K=Fe(e=>{W.current=e,"function"==typeof j?j(e):j&&(j.current=e)},[j]),_=Be(e),q=Be(e);q.current=e;const H=Boolean(s||c),U="compact"===v;Ie(()=>{E(R.current)!==e&&O(en(e,a))},[e,a]);const V=e=>{if(H)return;let l=(E(R.current)??w??(u?E(u):null)??0)+e;null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n);const o=a??String(i??1).split(".")[1]?.length??0;l=Number(l.toFixed(o));const s=en(l,a);R.current=s,O(s),t(l),ee()},Y=Be(V);Y.current=V;const[G,X]=Ee(!1),[Z,J]=Ee(0),ee=()=>{z&&J(e=>e+1)};Ie(()=>{z&&G&&document.activeElement===W.current&&W.current?.select()},[z,G,Z]);const te=Be(!1);Ie(()=>{if(G&&!H)return Q(e=>{if("Escape"!==e.key||document.activeElement!==W.current)return!1;const r=_.current;if(E(R.current)===r)return!1;const n=en(r,a);return R.current=n,O(n),q.current!==r&&(L??t)(r),ee(),!0})},[G,H,a,t,L]);const re=()=>{const e=E(R.current);if(null==e){if(!k){const e=en(q.current,a);return R.current=e,O(e),q.current}return R.current="",O(""),null!==q.current&&t(null),null}let l=e;const o=a??(N?Math.max(Qr(i??1),Qr(r??0)):void 0);N&&(l=function(e,t,r){const n=(e-r)/t;return r+Math.round(n+1e-9*Math.sign(e))*t}(l,i??1,r??0)),null!=r&&l<r&&(l=r),null!=n&&l>n&&(l=n),null!=o&&(l=Number(l.toFixed(o)));const s=en(l,a);return R.current=s,O(s),l===e&&l===q.current||t(l),l},ne=/* @__PURE__ */Ye("input",{ref:K,id:g,name:f,type:"text",inputMode:0===a?"numeric":"decimal",value:!G&&M?M(e):I,disabled:s,readOnly:c,placeholder:u,step:i,role:"spinbutton","aria-valuenow":e??void 0,"aria-valuemin":r,"aria-valuemax":n,"aria-valuetext":null==e?u||void 0:`${en(e,a)}${z&&F?F:""}`,"aria-describedby":P,"data-appearance":z?"bare":void 0,...B,autoComplete:z?"off":void 0,spellCheck:!z&&void 0,"aria-invalid":d||void 0,"aria-label":S,"aria-labelledby":D,onChange:e=>(e=>{if(c)return;const r=F&&e.trimEnd().endsWith(F)?e.trimEnd().slice(0,-F.length).trimEnd():e;if(""!==r&&!/^-?\d*[.,]?\d*$/.test(r))return;if(O(e),!C)return;const n=E(e);(null!==n||k)&&t(n)})(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&!H)return _.current=re(),void ee();const t=i??1,r=o??10*t,n="ArrowUp"===e.key?e.shiftKey?r:t:"ArrowDown"===e.key?-(e.shiftKey?r:t):"PageUp"===e.key?10*t:"PageDown"===e.key?10*-t:null;null===n||H||(e.preventDefault(),V(n))},onFocus:()=>{_.current=q.current,X(!0),te.current=!0,y?.()},onMouseUp:z?e=>{te.current&&(te.current=!1,e.preventDefault())}:void 0,onBlur:()=>{X(!1),te.current=!1,re(),x?.()},className:z?["block min-w-0 m-0 rounded-(--radius-control) border-0 p-0 text-center tabular-nums","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",G?"bg-white":"bg-transparent",H?"cursor-default":"cursor-text",b].filter(Boolean).join(" "):l({invalid:d,size:h,readOnly:c,className:[m?"pl-8":"",U?p?"pr-12":"pr-6":v?p?"pr-24":"pr-16":p?"pr-10":"","text-right tabular-nums",b].filter(Boolean).join(" ")})});if(z||!m&&!p&&!v)return ne;const ae=E(I);/* @__PURE__ */
|
|
141
141
|
return Ge("div",{className:"relative",children:[m&&/* @__PURE__ */Ye("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-500",children:m}),ne,p&&/* @__PURE__ */Ye("span",{className:`pointer-events-none absolute ${U?"right-6":v?"right-16":"right-3"} top-1/2 -translate-y-1/2 text-sm text-gray-500`,children:p}),v&&(()=>{const e=/* @__PURE__ */Ye(tn,{dir:-1,compact:U,label:T.number.decrease,disabled:H||null!=r&&null!=ae&&ae<=r,onStep:e=>Y.current(-(e?o??10*(i??1):i??1))}),t=/* @__PURE__ */Ye(tn,{dir:1,compact:U,label:T.number.increase,disabled:H||null!=n&&null!=ae&&ae>=n,onStep:e=>Y.current(e?o??10*(i??1):i??1)});/* @__PURE__ */
|
|
142
142
|
return Ge("span",U?{"data-steppers":"compact",className:"absolute inset-y-px right-px flex w-4 flex-col overflow-hidden rounded-r-(--radius-control)",children:[t,e]}:{className:"absolute right-1 top-1/2 flex -translate-y-1/2 items-center gap-0.5",children:[e,t]})})()]})}),nn=(e,t,r)=>Math.min(r,Math.max(t,e));var an=8,ln=40;var on="undefined"==typeof window?Ie:Ve;function sn(e,t,r,n){return Number(nn(e,t,r).toFixed(n))}var cn=Oe(null);function dn({children:e}){const[t,r]=Ee({}),n=Te(()=>(e,t)=>r(r=>{if(null===t){if(!(e in r))return r;const t={...r};return delete t[e],t}return r[e]===t?r:{...r,[e]:t}}),[]),a=Te(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
143
143
|
return Ye(cn.Provider,{value:a,children:e})}function un({value:e,onChange:t,min:r,max:n,step:a=1,shiftStep:l,precision:i,inputMin:o,inputMax:s,suffix:c,showInput:d=!0,emptyLabel:u,placeholderValue:h,stepFrom:m,label:p,"aria-labelledby":g,valueText:f,id:b,disabled:x,size:y="md",className:v=""}){const w=he(),N=ze(),k=b??N,$=i??function(e){const t=String(e),r=/e-(\d+)$/.exec(t);return r?Number(r[1]):t.split(".")[1]?.length??0}(a),M=o??r,C=s??n,L=void 0!==u||void 0!==h,S=m??h,D=nn(e??h??r,r,n),P=Be(null),[A,j]=Ee(null),z=Boolean(c);on(()=>{const e=()=>{const e=P.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,r)=>e+(parseFloat(t[r])||0),0);r<=0||j(e=>e&&e.frame===r&&e.fontSize===t.fontSize?e:{frame:r,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[z,d]);const F=e=>f?f(e):"string"==typeof c?`${e.toFixed($)} ${c}`:void 0,E=null==e?u??(null!=h?F(h)??String(h):void 0):F(e),B=`calc(${T=[r.toFixed($),n.toFixed($),e?.toFixed($),u,h?.toFixed($)],Math.max(1,...T.map(e=>(e??"").length))}ch + ${(A?.frame??10+(z?ln:an))+2}px)`;var T;const I=_e(cn),O=ze(),R=I?.set;return on(()=>{R&&R(O,d?B:null)},[R,O,B,d]),Ie(()=>()=>R?.(O,null),[R,O]),/* @__PURE__ */Ge("div",{className:`flex items-center gap-3 ${v}`.trim(),children:[
|
|
144
144
|
/* @__PURE__ */Ye("input",{id:k,type:"range",min:r,max:n,step:a,value:D,disabled:x,"aria-label":g?void 0:p,"aria-labelledby":g,"aria-valuetext":E,onKeyDown:i=>{const o="ArrowUp"===i.key||"ArrowRight"===i.key?1:"ArrowDown"===i.key||"ArrowLeft"===i.key?-1:0;if(!o||i.altKey||i.ctrlKey||i.metaKey)return;const s=i.shiftKey&&null!=l;if(!s&&!(null==e&&null!=S))return;i.preventDefault();t(sn((e??S??D)+o*(s?l??a:a),r,n,$))},onChange:e=>t(sn(Number(e.target.value),r,n,$)),className:"min-w-0 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===y?"h-1":"h-1.5")}),d&&
|
|
145
145
|
/* @__PURE__ */Ye("div",{ref:P,className:"shrink-0 text-xs",style:{width:I?.width??B,...A?{fontSize:A.fontSize}:{}},children:/* @__PURE__ */Ye(rn,{value:e,onChange:e=>{null!=e?e<M||e>C||t(e):L&&t(null)},min:M,max:C,step:a,shiftStep:l,stepFrom:S,precision:$,snap:!0,allowEmpty:L,suffix:c,disabled:x,placeholder:u??(null!=h?h.toFixed($):void 0),size:"sm","aria-label":p?w.slider.value(p):void 0,"aria-labelledby":p?void 0:g})})]})}function hn({items:e,onChange:t,label:r,className:a="","aria-labelledby":l,"aria-describedby":i}){const o=he().displayChips,s=ze();/* @__PURE__ */
|
|
146
|
-
return Ye("div",{role:"group","aria-label":l?void 0:r,"aria-labelledby":l,"aria-describedby":i,className:`flex flex-wrap gap-2 ${a}`.trim(),children:e.map((e,r)=>{const a=`${s}-${r}-state`,l=`${s}-${r}-reason`,i=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,c=/* @__PURE__ */Ge("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||i)||void 0,"aria-disabled":!!i||void 0,"aria-describedby":
|
|
146
|
+
return Ye("div",{role:"group","aria-label":l?void 0:r,"aria-labelledby":l,"aria-describedby":i,className:`flex flex-wrap gap-2 ${a}`.trim(),children:e.map((e,r)=>{const a=`${s}-${r}-state`,l=`${s}-${r}-reason`,i=Boolean(e.disabled)&&null!=e.disabledReason&&""!==e.disabledReason,c=/* @__PURE__ */Ge("button",{type:"button","aria-pressed":e.shown,disabled:!(!e.disabled||i)||void 0,"aria-disabled":!!i||void 0,"aria-describedby":E(a,i?l:void 0),onClick:i?F:()=>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:[
|
|
147
147
|
/* @__PURE__ */Ye(Pe,{name:e.shown?"eye":"eye-off",className:"h-4 w-4 shrink-0",strokeWidth:"1.75"}),
|
|
148
148
|
/* @__PURE__ */Ye(n,{children:e.label})]}),d=/* @__PURE__ */Ye("span",{id:a,className:"sr-only",children:e.shown?o.shown:o.hidden});/* @__PURE__ */
|
|
149
|
-
return Ge(qe,{children:[i?/* @__PURE__ */Ye(
|
|
149
|
+
return Ge(qe,{children:[i?/* @__PURE__ */Ye(B,{reason:e.disabledReason,id:l,children:c}):/* @__PURE__ */Ye(R,{content:e.shown?o.shownHint:o.hiddenHint,describe:!1,className:"relative inline-flex max-w-full",children:c}),d]},e.id)})})}var mn=4,pn=10,gn={1:["100%"],2:["50%","50%"],3:["33.34%","33.33%","33.33%"],4:["25%","25%","25%","25%"]},fn={1:[],2:[50],3:[34,33],4:[25,25,25]},bn=e=>"number"==typeof e&&Number.isFinite(e);function xn(e,t){if(!Number.isInteger(t)||t<2||t>4)return;if(!Array.isArray(e)||e.length!==t-1)return;if(!e.every(bn))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,pn,100-n-(t-1-a)*pn);r.push(l),n+=l}),r}function yn(e,t){const r=xn(e,t);if(!r)return(e=>[...gn[e]??gn[1]])(t);const n=r.reduce((e,t)=>e+t,0);return[...r.map(e=>`${e}%`),100-n+"%"]}function vn(e,t){return yn(t,e)}var wn=(e,t,r)=>Math.min(r,Math.max(t,e)),Nn=e=>e.reduce((e,t)=>e+t,0),kn=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]);var $n,Mn="w-0.5",Cn=`${Mn} group-hover/widths:w-1 group-focus-visible/widths:w-1`;var Ln=["text-blue-700","text-gray-600"];function Sn({count:e,value:t,onChange:r,label:n,"aria-labelledby":a,readOnly:l=!1,disabled:i=!1,footer:o=!0,className:s=""}){const c=he().widths,d=ze(),u=wn(Math.round(e)||1,1,4),h=xn(t,u),m=h??[...fn[u]??[]],p=[...m,100-Nn(m)],g=l||i,f=Be(null),b=Be({onChange:r,shown:m,locked:g,n:u,stored:h});b.current={onChange:r,shown:m,locked:g,n:u,stored:h};const x=e=>{const{onChange:t,shown:r,locked:n,n:a}=b.current;if(n)return!1;const l=xn(e,a);return!(!l||kn(l,r))&&(t(l),!0)},y=(e,t,r)=>{const n=e[t]+e[t+1],a=[...e];a[t]=wn(Math.round(r),pn,n-pn),a[t+1]=n-a[t],x(a.slice(0,-1))&&(T.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?pn:"End"===t.key?n-pn:null;null!==a&&(t.preventDefault(),y(p,e,a))},w=Be(null),[N,k]=Ee(null),$=()=>{w.current=null,k(null),document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")};Ie(()=>$,[]);const M=e=>t=>{if(0!==t.button||g)return;t.preventDefault();const r=f.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}y(t.from,t.i,t.from[t.i]+r/t.width*100)},L=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=wn(Math.round(r),pn,100-(n-1)*pn);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]-pn);a[e]-=t,i-=t}return a}([...r,100-Nn(r)],e,t);return x(n.slice(0,-1))?n:null},[D,P]=Ee(0);Ie(()=>{const e=f.current;if(!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>P(e.getBoundingClientRect().width));return t.observe(e),()=>t.disconnect()},[]);const A=Be(null),[j,z]=Ee(null),[F,E]=Ee([]),B=(e,t)=>z(r=>t?e:r===e?null:r),T=Be(null),I=(e,t)=>{const r=T.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:kn(i,o))||n(r.stored),!0},W=p.join(",");Ie(()=>{const e=null===j?[]: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===$n&&($n=document.createElement("canvas").getContext("2d")),!$n)return[];const a=$n;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]:[]})}(A.current,j);E(t=>kn(t,e)?t:e)},[j,W,D]);const K=p.slice(0,-1).map((e,t)=>Nn(p.slice(0,t+1)));/* @__PURE__ */
|
|
150
150
|
return Ge("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:[
|
|
151
|
-
/* @__PURE__ */Ge("div",{ref:
|
|
151
|
+
/* @__PURE__ */Ge("div",{ref:A,"data-widths-bar":"",className:"relative h-8",children:[
|
|
152
152
|
/* @__PURE__ */Ye("div",{ref:f,"data-widths-track":"",className:"flex h-full w-full overflow-hidden rounded-(--radius-control) bg-white",children:p.map((e,t)=>/* @__PURE__ */Ye("div",{"data-widths-segment":"",style:{flexBasis:`${e}%`},className:`flex min-w-0 shrink-0 grow-0 items-center justify-center overflow-hidden whitespace-nowrap text-xs font-medium tabular-nums ${Ln[t%2]} ${t%2==0?"bg-blue-50":""}`,children:1===u&&/* @__PURE__ */Ye("span",{"data-widths-label":"",children:`${e}%`})},t))}),
|
|
153
|
-
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Ge(qe,{children:[(()=>{const r=
|
|
154
|
-
return Ye("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */Ye(rn,{appearance:"bare",value:e,display:()=>(e=>
|
|
153
|
+
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 rounded-(--radius-control) border border-gray-300"}),u>1&&p.map((e,t)=>/* @__PURE__ */Ge(qe,{children:[(()=>{const r=j===t,n=Nn(p.slice(0,t)),a=r?`max(${e}%, 40px)`:`${e}%`;/* @__PURE__ */
|
|
154
|
+
return Ye("div",{className:"absolute inset-y-0 "+(r?"z-20":""),style:{left:`clamp(0px, calc(${n+e/2}% - ${a} / 2), calc(100% - ${a}))`,width:a},children:/* @__PURE__ */Ye(rn,{appearance:"bare",value:e,display:()=>(e=>D>0&&D*e/100<36?String(e):`${e}%`)(e),suffix:"%",min:pn,max:100-(u-1)*pn,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:()=>{T.current={column:t,share:e,stored:b.current.stored},B(t,!0)},onBlur:()=>B(t,!1),className:`absolute inset-0 text-xs font-medium ${Ln[t%2]} ${F.includes(t)&&!r?"opacity-0":""}`})})})(),t<u-1&&/* @__PURE__ */Ye("div",{className:"absolute inset-y-0 z-10 w-3 -translate-x-1/2",style:{left:`${K[t]}%`},children:/* @__PURE__ */Ye(R,{content:c.dragHint,delay:600,className:"relative flex h-full w-full",children:/* @__PURE__ */Ye("div",{role:"separator",tabIndex:i?-1:0,"aria-orientation":"vertical","aria-label":c.divider(t+1,t+2),"aria-valuenow":p[t],"aria-valuemin":pn,"aria-valuemax":p[t]+p[t+1]-pn,"aria-valuetext":c.dividerValue(t+1,p[t],t+2,p[t+1]),"aria-disabled":g||void 0,onKeyDown:g?void 0:v(t),onPointerDown:M(t),onPointerMove:C,onPointerUp:L,onPointerCancel:L,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)] "+(g?"cursor-default":"cursor-col-resize"),children:/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-widths-line":"",className:"h-full rounded-full "+(g?`${Mn} bg-gray-300`:`bg-blue-600 transition-[width,background-color] duration-(--motion-fast) group-hover/widths:bg-blue-700 ${N===t?"w-1":Cn}`)})})})})]},t))]}),u>1&&!o&&/* @__PURE__ */Ye("span",{id:d,className:"sr-only",children:c.hint(u,pn)}),u>1&&o&&/* @__PURE__ */Ye("div",{"data-widths-footer":"",className:"@container",children:/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2 @max-[264px]:flex-col @max-[264px]:items-end",children:[
|
|
155
155
|
/* @__PURE__ */Ye("span",{id:d,"data-widths-hint":"",className:"text-2xs leading-tight text-gray-500 @max-[264px]:self-stretch",children:c.hint(u,pn)}),
|
|
156
|
-
/* @__PURE__ */Ye(
|
|
157
|
-
return Ge("div",{ref
|
|
158
|
-
/* @__PURE__ */Ye("button",{ref:
|
|
159
|
-
/* @__PURE__ */Ye("div",{ref:
|
|
160
|
-
return Ye("button",{ref:i,type:a,"aria-pressed":r,className:Wn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute inset-0",style:Rn(e)})})}),_n=(e,t,r)=>Math.min(r,Math.max(t,e)),qn=e=>"string"==typeof e?{value:e}:e;var Hn={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Un({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=he().color,h=jn(l??""),[m,p]=Ee(()=>En(e||h||"")),g=Be(e);Ie(()=>{e!==g.current&&(g.current=e,e?p(En(e)):h&&p(En(h)))},[e]);const f=r=>{o||r===e||(g.current=r,t(r))},b=e=>{const t=jn(e);t&&(p(En(t)),f(t))},x=e=>{p(e),f(Bn(e))},[y,v]=Ee(!1),w=Be(m);w.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,w.current);"end"===i?(v(!0),p(r)):x(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,w.current);"end"===i?p(r):x(r)},onPointerUp:t=>{"end"===i&&y&&(v(!1),x(e(t,w.current)))}}),k=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Fn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Fn((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Fn((r-n.left)/n.width,0,1)):0)};var r,n}),M=y?Bn(m):e,
|
|
161
|
-
return Ge("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(
|
|
162
|
-
return Ye(
|
|
163
|
-
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:_n(e.s+a[0],0,1),v:_n(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),x(t))},...k,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Bn({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:
|
|
156
|
+
/* @__PURE__ */Ye(O,{variant:"secondary",size:"sm",disabled:g,onClick:()=>{g||void 0===t||r(void 0)},className:"shrink-0",children:c.reset})]})})]})}var Dn=/(^|[\s:])!?z-/;function Pn({trigger:e,children:t,title:r,description:n,"aria-label":a,align:l="start",side:i="bottom",open:o,defaultOpen:s=!1,onOpenChange:c,matchTriggerWidth:d=!1,maxHeight:u,initialFocus:h,id:m,triggerLabel:p,"aria-describedby":g,disabled:f,className:b="",triggerClassName:x,panelClassName:w=""}){const[N,k]=Ee(s),M=(o??N)&&!f,C=ae(),L=Be(null),S=Be(null),D=Be(null),P=Be(null),A=ze(),j=m??A,z=ze(),F=ze(),E=ze(),B=Be(null),T=Be(!1),I=Be({openProp:o,onOpenChange:c});I.current={openProp:o,onOpenChange:c};const O=Fe(e=>{void 0===I.current.openProp&&k(e),I.current.onOpenChange?.(e)},[]),R=Fe((e=!1)=>{T.current=e,O(!1)},[O]),H=e=>{B.current=e.nativeEvent},U=Fe(()=>{const e=D.current,t=S.current;if(!e||!t)return;const r=t.getBoundingClientRect(),n=W(t),a=Math.max(0,n.right-n.left-2*K),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=_({trigger:r,menu:{width:s.width,height:Math.min(s.height,c)},bounds:n,align:l,side:i}),m=Math.min(h.maxHeight,c);o.left=`${h.left}px`,o.top=`${h.top}px`,o.maxHeight=`${m}px`,o.overflowY=s.height>m?"auto":"",e.dataset.side=h.side,e.dataset.align=l},[l,i,d,u]);re(()=>{M&&C&&U()}),Ie(()=>{if(!M||!C)return;const e=q(()=>S.current,U),t=P.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>U());return r.observe(t),()=>{e(),r.disconnect()}},[M,C,U]),Ie(()=>{if(!M)return;const e=e=>{let t=null,r=0;const n=e=>{t===e&&(t=null,window.clearTimeout(r),(e=>{if(B.current===e)return!1;const t=e.target;return!(t&&(L.current?.contains(t)||D.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=ee(()=>R()),a=Q(e=>"Escape"===e.key&&(R(),S.current?.focus(),!0),()=>D.current);return()=>{t(),r(),n(),a()}},[M,R]),y(D,M&&C),re(()=>{if(!M||!C)return;const e=D.current;return()=>{if(T.current)return;const t=document.activeElement;t&&t!==document.body&&!e?.contains(t)||S.current?.focus({preventScroll:!0})}},[M,C]),Ie(()=>{if(!M||!C)return;const e=D.current;e&&(T.current=!1,(h?.current??v(e)[0]??e).focus({preventScroll:!0}))},[M,C]);const V="function"==typeof t?t({close:()=>R()}):t,Y=r?{"aria-labelledby":F}:a?{"aria-label":a}:{"aria-labelledby":j};/* @__PURE__ */
|
|
157
|
+
return Ge("div",{ref:L,className:`relative inline-flex ${b}`.trim(),children:[
|
|
158
|
+
/* @__PURE__ */Ye("button",{ref:S,id:j,type:"button","aria-haspopup":"dialog","aria-expanded":M,"aria-controls":M&&C?z:void 0,"aria-label":p,"aria-describedby":g,disabled:f,onClick:()=>M?R():O(!0),onKeyDown:e=>{if("Tab"!==e.key||e.shiftKey||!M)return;const t=(()=>{const e=D.current;return e?v(e)[0]??e:null})();t&&(e.preventDefault(),t.focus({preventScroll:!0}))},className:x??G({variant:"secondary"}),children:e}),M&&C&&Ze(
|
|
159
|
+
/* @__PURE__ */Ye("div",{ref:D,id:z,role:"dialog",...Y,"aria-describedby":n?E:void 0,tabIndex:-1,"data-popover-panel":"",onPointerDownCapture:H,onFocusCapture:H,onKeyDown:e=>{const t=D.current,r=S.current;if("Tab"!==e.key||!t||!r||!t.contains(e.target))return;const n=v(t),a=document.activeElement;if(e.shiftKey){if(n.length>0&&a!==n[0]&&a!==t)return;return e.preventDefault(),void r.focus({preventScroll:!0})}if(n.length>0&&a!==n[n.length-1])return;e.preventDefault();const l=$(r,t);R(!!l),(l??r).focus({preventScroll:!0})},className:`fixed rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${w}`.trim(),style:Dn.test(w)?void 0:{zIndex:te.popup},children:/* @__PURE__ */Ge("div",{ref:P,children:[r&&/* @__PURE__ */Ye("h2",{id:F,className:"text-sm font-semibold text-gray-900",children:r}),n&&/* @__PURE__ */Ye("p",{id:E,className:"mt-1 text-sm text-gray-500",children:n}),r||n?/* @__PURE__ */Ye("div",{className:"mt-3",children:V}):V]})}),document.body)]})}var An=/^(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;function jn(e){const t=e.trim().replace(/^#/,"");if(!An.test(t))return null;return`#${(3===t.length?[...t].map(e=>e+e).join(""):t).toLowerCase()}`}var zn=e=>e.toUpperCase(),Fn=(e,t,r)=>Math.min(r,Math.max(t,e));function En(e){const t=jn(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 Bn({h:e,s:t,v:r}){const n=(e%360+360)%360,a=Fn(t,0,1),l=Fn(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 Tn=`linear-gradient(to right, ${[0,60,120,180,240,300,360].map(e=>Bn({h:e%360,s:1,v:1})).join(", ")})`,In={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},On={backgroundImage:"conic-gradient(var(--line-strong) 25%, var(--surface) 0 50%, var(--line-strong) 0 75%, var(--surface) 0)",backgroundSize:"8px 8px"};function Rn(e){return e?{background:e}:On}function Wn({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",In[e],r].filter(Boolean).join(" ")}var Kn=je(function({color:e,size:t="md",selected:r,className:n,type:a="button",...l},i){/* @__PURE__ */
|
|
160
|
+
return Ye("button",{ref:i,type:a,"aria-pressed":r,className:Wn({size:t,selected:r,className:n}),...l,children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute inset-0",style:Rn(e)})})}),_n=(e,t,r)=>Math.min(r,Math.max(t,e)),qn=e=>"string"==typeof e?{value:e}:e;var Hn={boxShadow:"0 0 0 2px white, 0 0 0 3px color-mix(in srgb, black 35%, transparent)"};function Un({value:e,onChange:t,label:r,presets:n,clearable:a=!1,fallback:l,dragWrites:i="live",disabled:o=!1,onClose:s,id:c,className:d=""}){const u=he().color,h=jn(l??""),[m,p]=Ee(()=>En(e||h||"")),g=Be(e);Ie(()=>{e!==g.current&&(g.current=e,e?p(En(e)):h&&p(En(h)))},[e]);const f=r=>{o||r===e||(g.current=r,t(r))},b=e=>{const t=jn(e);t&&(p(En(t)),f(t))},x=e=>{p(e),f(Bn(e))},[y,v]=Ee(!1),w=Be(m);w.current=m;const N=e=>({onPointerDown:t=>{if(o||0!==t.button)return;t.currentTarget.setPointerCapture?.(t.pointerId),t.currentTarget.focus({preventScroll:!0});const r=e(t,w.current);"end"===i?(v(!0),p(r)):x(r)},onPointerMove:t=>{if(o||!(1&t.buttons))return;const r=e(t,w.current);"end"===i?p(r):x(r)},onPointerUp:t=>{"end"===i&&y&&(v(!1),x(e(t,w.current)))}}),k=N((e,t)=>{return{...t,...(r=e.clientX,n=e.clientY,a=e.currentTarget.getBoundingClientRect(),{s:a.width>0?Fn((r-a.left)/a.width,0,1):0,v:a.height>0?1-Fn((n-a.top)/a.height,0,1):0})};var r,n,a}),$=N((e,t)=>{return{...t,h:(r=e.clientX,n=e.currentTarget.getBoundingClientRect(),n.width>0?Math.min(359,360*Fn((r-n.left)/n.width,0,1)):0)};var r,n}),M=y?Bn(m):e,C=e=>`${Math.round(100*e)}%`,L=(n??[]).map(qn),S=jn(e);/* @__PURE__ */
|
|
161
|
+
return Ge("div",{id:c,className:`flex w-56 flex-col gap-3 ${o?"opacity-60":""} ${d}`.trim(),onKeyDown:e=>{"Escape"===e.key&&s&&(e.preventDefault(),e.stopPropagation(),s())},children:[(L.length>0||a)&&/* @__PURE__ */Ge("div",{role:"group","aria-label":u.presets,className:"flex flex-wrap gap-2",children:[a&&/* @__PURE__ */Ye(R,{content:u.clear,children:/* @__PURE__ */Ye(Kn,{color:"",size:"sm","aria-label":u.clear,selected:""===e,disabled:o,onClick:()=>{o||""===e||(g.current="",t(""))}})}),L.map(e=>{const t=jn(e.value),r=e.label?`${e.label} · ${zn(t??e.value)}`:zn(t??e.value);/* @__PURE__ */
|
|
162
|
+
return Ye(R,{content:r,children:/* @__PURE__ */Ye(Kn,{color:t??e.value,size:"sm","aria-label":r,selected:null!==t&&t===S,disabled:o,onClick:()=>b(e.value)})},`${e.label??""}:${e.value}`)})]}),
|
|
163
|
+
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.square,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*m.v),"aria-valuetext":u.squareValue(Math.round(100*m.s),Math.round(100*m.v)),"aria-disabled":o||void 0,"data-color-square":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?.1:.01,a={ArrowLeft:[-n,0],ArrowRight:[n,0],ArrowDown:[0,-n],ArrowUp:[0,n]}[t];return a?{...e,s:_n(e.s+a[0],0,1),v:_n(e.v+a[1],0,1)}:null}(m,e.key,e.shiftKey);t&&(e.preventDefault(),x(t))},...k,className:"relative h-36 w-full cursor-crosshair touch-none rounded-md rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",style:{backgroundColor:Bn({h:m.h,s:1,v:1}),backgroundImage:"linear-gradient(to top, black, transparent), linear-gradient(to right, white, transparent)"},children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"pointer-events-none absolute h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:C(m.s),top:C(1-m.v),...Hn}})}),
|
|
164
164
|
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:o?-1:0,"aria-label":u.hue,"aria-valuemin":0,"aria-valuemax":359,"aria-valuenow":Math.round(m.h),"aria-orientation":"horizontal","aria-disabled":o||void 0,"data-color-hue":"",onKeyDown:e=>{if(o)return;const t=function(e,t,r){const n=r?10:1;switch(t){case"ArrowLeft":case"ArrowDown":return _n(e-n,0,359);case"ArrowRight":case"ArrowUp":return _n(e+n,0,359);case"PageDown":return _n(e-10,0,359);case"PageUp":return _n(e+10,0,359);case"Home":return 0;case"End":return 359;default:return null}}(m.h,e.key,e.shiftKey);null!==t&&(e.preventDefault(),x({...m,h:t}))},...$,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:Tn},children:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 h-3.5 w-3.5 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{left:m.h/360*100+"%",background:Bn({h:m.h,s:1,v:1}),...Hn}})}),
|
|
165
165
|
/* @__PURE__ */Ge("div",{className:"flex items-center gap-2",children:[
|
|
166
166
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"relative h-8 w-8 shrink-0 overflow-hidden rounded-md border border-gray-300",style:Rn(M||(h??""))}),
|
|
@@ -176,25 +176,25 @@ return Ge("div",{"data-image-focus":"",className:`flex flex-col gap-2 ${c}`.trim
|
|
|
176
176
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-image-focus-cross":"h",className:"pointer-events-none absolute inset-x-0 h-px",style:{top:`${g}%`,...Gn}}),
|
|
177
177
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-image-focus-cross":"v",className:"pointer-events-none absolute inset-y-0 w-px",style:{left:`${p}%`,...Gn}}),
|
|
178
178
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-image-focus-dot":"",className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2",style:{left:`${p}%`,top:`${g}%`,...Xn}})]})}),w||i?/* @__PURE__ */Ge("div",{className:"flex items-center gap-2",children:[/* @__PURE__ */Ye("span",w?{id:v?u:void 0,className:"min-w-0 flex-1 text-xs text-gray-500",children:v?d.hint:a}:{className:"min-w-0 flex-1"}),i]}):null,!v&&/* @__PURE__ */Ye("span",{id:u,className:"sr-only",children:d.hint})]})}function Jn({onClear:e,ariaLabel:t}){/* @__PURE__ */
|
|
179
|
-
return Ye("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function Qn(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:h,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:x=!0,"aria-label":y,"aria-labelledby":v,"aria-describedby":w}=e,N=!0===e.multiple,
|
|
180
|
-
return Ge("div",{ref:Y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Y.current?.contains(t)||J.current?.contains(t))||le.current||document.activeElement!==G.current&&ie(!0)},children:[(je=/* @__PURE__ */Ye("input",{id:
|
|
181
|
-
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Ye("span",{ref:ye,className:"whitespace-pre"})}),fe&&/* @__PURE__ */Ye(Jn,{ariaLabel:H.select.clear,onClear:()=>{
|
|
182
|
-
/* @__PURE__ */Ge("div",{ref:J,onMouseDownCapture:()=>{le.current=!0,setTimeout(()=>{le.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:te.popup,left:de?.left,right:de?.right,top:de?.top,bottom:de?.bottom,minWidth:de?.minWidth,width:de?.width,...
|
|
183
|
-
/* @__PURE__ */Ye("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),
|
|
179
|
+
return Ye("button",{type:"button","aria-label":t,onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),e()},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity text-base leading-none",children:"×"})}function Qn(e){const{options:t,placeholder:r,emptyOptionLabel:n,className:a="",disabled:l,id:i,filter:o=!1,allowFreeText:s=!1,freeTextOption:c,onSearchChange:h,loading:m=!1,error:p,onRetry:g,rightAdornment:f,renderOption:b,clearable:x=!0,"aria-label":y,"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,L=o&&C&&!l,S=N||o,D=null!=c,P=s||D,[A,j]=Ee(!1),[z,F]=Ee(-1),E=ze(),B=i??`${E}-input`,W=`${E}-listbox`,K=e=>`${E}-opt-${e}`,[_,q]=Ee(""),H=he(),U=n??H.select.none,V=e=>{q(e),F(-1),h?.(e)},Y=Be(null),G=Be(null),J=Be(null),ne=Be(null),ae=Be(A);ae.current=A;const le=Be(!1),ie=e=>{ae.current&&(ae.current=!1,e&&s&&!D&&De&&(N?k.includes(De)||M([...k,De]):De!==$&&M([De])),j(!1),V(""))},oe=(e,t)=>{if(!e.disabled){if(N)return M(k.includes(e.value)?k.filter(t=>t!==e.value):[...k,e.value]),void(e===Pe?V(""):F(t));M([e.value]),ie(!1)}},[se,ce]=Ee(null);re(()=>{if(!f||A)return void ce(null);const e=ne.current?.offsetWidth??0;ce(e?e+(fe?32:8)+6:null)});const de=T(G,A,S?{popupRef:J}:{matchTriggerWidth:!0}),ue=Te(()=>it(t),[t]),me=k.join("\0"),pe=Te(()=>{const e=[],t=/* @__PURE__ */new Set;for(const r of ue)k.includes(r.value)&&!t.has(r.value)&&(t.add(r.value),e.push(r.label));if(P)for(const r of k)t.has(r)||e.push(r);return e},[ue,me,P]),ge=pe.join(", "),fe=x&&C&&!l,[be,xe]=Ee(null),ye=Be(null),ve=Be(""),we=Be(()=>{});we.current=()=>{const e=G.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}|${pe.join("\0")}`;if(l===ve.current)return;ve.current=l;let i=null;n>0&&pe.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}}(pe,e=>(t.textContent=e,t.getBoundingClientRect().width<=n)),t.textContent=""),xe(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},re(()=>{we.current()}),Ie(()=>{const e=G.current;if(!N||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>we.current());return t.observe(e),()=>t.disconnect()},[N]);const Ne=pe.length,ke=!N||!be||be.shown>=Ne?ge:0===be.shown?H.select.selectedCount(Ne):`${pe.slice(0,be.shown).join(", ")} +${Ne-be.shown}`,$e=N&&null!==be&&(be.shown<Ne||be.cut),Me=A&&C&&S;Ie(()=>{if(!A)return;const e=e=>{const t=e.target;Y.current?.contains(t)||J.current?.contains(t)||ie(!0)};document.addEventListener("mousedown",e);const t=ee(()=>ie(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[A,s,_,me,e.onChange]),Ie(()=>{if(A)return Q(e=>!("Escape"!==e.key||!ae.current)&&(ie(!1),G.current?.blur(),!0),()=>J.current)},[A]);const Ce=Te(()=>{const e=/* @__PURE__ */new Set;return ot(t,t=>!e.has(t.value)&&(e.add(t.value),!0))},[t]),Le=Te(()=>{if(h)return Ce;const e=_.trim().toLowerCase();return e?ot(Ce,t=>dt(t,e)):Ce},[Ce,_,h]),Se=Te(()=>it(Le),[Le]),De=_.trim(),Pe=Te(()=>D&&De?ue.some(e=>e.label===De)||k.includes(De)?null:{value:De,label:De}:null,[D,De,ue,me]),Ae=Te(()=>Pe?[...Se,Pe]:Se,[Se,Pe]);/* @__PURE__ */
|
|
180
|
+
return Ge("div",{ref:Y,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Y.current?.contains(t)||J.current?.contains(t))||le.current||document.activeElement!==G.current&&ie(!0)},children:[(je=/* @__PURE__ */Ye("input",{id:B,ref:G,type:"text",autoComplete:"off",role:"combobox","aria-expanded":A,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":A?W:void 0,"aria-activedescendant":A&&z>=0&&z<Ae.length?K(z):void 0,"aria-label":v?void 0:y,"aria-labelledby":v,"aria-describedby":w,value:A?_:ke,onChange:e=>{V(e.target.value),j(!0)},onFocus:()=>{l||(V(""),j(!0))},onKeyDown:e=>{if("ArrowDown"===e.key||"ArrowUp"===e.key){if(l)return;if(e.preventDefault(),!A)return void j(!0);if(0===Ae.length)return;const t="ArrowDown"===e.key?1:-1;return void F(e=>nt(Ae,e,t))}"Enter"===e.key?(e.preventDefault(),A&&z>=0&&z<Ae.length?oe(Ae[z],z):1!==Se.length||Se[0].disabled?s&&!D&&De&&(N?(k.includes(De)||M([...k,De]),V("")):(M([De]),ie(!1),G.current?.blur())):oe(Se[0],0)):"Escape"===e.key?(ie(!1),G.current?.blur()):"Tab"===e.key&&ie(!0)},placeholder:Me?ke:r||U,className:`${L?d:u} ${a} ${fe?"pr-8":""} ${l?"bg-gray-50 text-gray-400 cursor-not-allowed":""} truncate${Me?" rosh-field-shows-choice":""}`,style:se?{paddingRight:se}:void 0,disabled:l}),N?/* @__PURE__ */Ye(R,{content:!A&&$e?ge:null,className:"block",children:je}):je),N&&
|
|
181
|
+
/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */Ye("span",{ref:ye,className:"whitespace-pre"})}),fe&&/* @__PURE__ */Ye(Jn,{ariaLabel:H.select.clear,onClear:()=>{M([]),ie(!1)}}),f&&!A&&/* @__PURE__ */Ye("div",{ref:ne,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:f}),A&&Ze(
|
|
182
|
+
/* @__PURE__ */Ge("div",{ref:J,onMouseDownCapture:()=>{le.current=!0,setTimeout(()=>{le.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:te.popup,left:de?.left,right:de?.right,top:de?.top,bottom:de?.bottom,minWidth:de?.minWidth,width:de?.width,...S&&{maxWidth:de?.maxWidth},visibility:de?void 0:"hidden",...X()},children:[N&&C&&x&&!l&&
|
|
183
|
+
/* @__PURE__ */Ye("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 ${Z}`,children:H.select.clearAll}),m?
|
|
184
184
|
/* @__PURE__ */Ye("p",{role:"status",className:"px-3 py-2 text-sm text-gray-500",children:H.search.searching}):p?/* @__PURE__ */Ge("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
185
|
-
/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1",children:p}),g&&/* @__PURE__ */Ye(
|
|
186
|
-
/* @__PURE__ */Ge("div",{id:W,role:Ae.length?"listbox":void 0,"aria-labelledby":Ae.length?v??(y?void 0:
|
|
187
|
-
return Ge("button",{id:K(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||N)&&r.preventDefault(),oe(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===
|
|
188
|
-
/* @__PURE__ */Ye("span",{className:`min-w-0 ${
|
|
189
|
-
/* @__PURE__ */Ye("button",{id:K(Se.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{N&&e.preventDefault(),oe(Pe,Se.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Se.length?`border-t ${Z}`:""} ${
|
|
185
|
+
/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1",children:p}),g&&/* @__PURE__ */Ye(O,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:g,className:"shrink-0",children:H.list.retry})]}):null,
|
|
186
|
+
/* @__PURE__ */Ge("div",{id:W,role:Ae.length?"listbox":void 0,"aria-labelledby":Ae.length?v??(y?void 0:B):void 0,"aria-label":Ae.length&&!v?y:void 0,"aria-multiselectable":!(!Ae.length||!N)||void 0,className:"overflow-y-auto",style:{maxHeight:de?.maxHeight??I},children:[0===Ae.length?m||p?null:/* @__PURE__ */Ye("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:H.select.noMatches}):0===Se.length?null:st(Le,(e,t)=>{const r=k.includes(e.value);/* @__PURE__ */
|
|
187
|
+
return Ge("button",{id:K(t),type:"button",role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:r=>{(e.disabled||N)&&r.preventDefault(),oe(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__ */Ye(ct,{selected:r}),
|
|
188
|
+
/* @__PURE__ */Ye("span",{className:`min-w-0 ${S?"flex-auto":"flex-1"} truncate`,children:b?b(e,{selected:r,active:t===z}):e.label}),e.sublabel&&/* @__PURE__ */Ye(ut,{grows:S,children:e.sublabel})]},e.value)},E),Pe&&c&&
|
|
189
|
+
/* @__PURE__ */Ye("button",{id:K(Se.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{N&&e.preventDefault(),oe(Pe,Se.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-gray-700 hover:bg-gray-50 ${Se.length?`border-t ${Z}`:""} ${z===Se.length?"bg-gray-100":""}`,children:/* @__PURE__ */Ye("span",{className:"min-w-0 flex-1 truncate",children:c(Pe.value)})},`${E}-typed`)]})]}),document.body)]});var je}function ea(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var ta="address",ra={kindOf:()=>ta,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},na=e=>m(e.trim());function aa(e){const{value:t,kinds:r,rules:n=ra,filtersFor:a,label:l,readOnly:i,placeholder:o,className:s=""}=e,c=void 0!==e.onApply,d=he().link,u=n.isSafe??na,h=ze(),m=Be(null),p=Be(null),[g,f]=Ee({url:t}),b=c?g.url:t,[x,y]=Ee(!1),[v,w]=Ee(null),[N,k]=Ee(null),$=Be(()=>{});$.current=c?e.onCancel:()=>{},Ie(()=>{if(c)return Q(e=>{const t=m.current;return!!("Escape"===e.key&&t&&e.target instanceof Node&&t.contains(e.target))&&($.current(),!0)},()=>m.current)},[c]),Ie(()=>{if(!c)return;const e=p.current;e?(e.focus(),e.select()):m.current?.querySelector("button, input")?.focus()},[]);const M=r??[{value:ta,label:d.address,target:{type:"text"}}],C=v&&v.against===b?v.kind:n.kindOf(b),L=M.filter(e=>!e.hideWhenEmpty||ea(e.target).length>0||e.value===C),S=L.find(e=>"text"===e.target.type),D=L.find(e=>e.value===C)??S??L[0];if(!D)return null;const P="text"!==D.target.type,A=P?n.targetOf(b):b,j=ea(D.target),z=j.find(e=>e.value===A),F=e=>({value:e,label:d.unavailable(e)}),E="select"===D.target.type&&A&&a?a(A):null,B=E?n.readFilter(b):null,T=B?E?.find(e=>e.param===B.param):void 0,I=N&&N.against===b?N.text:b,R=!P&&""!==I.trim()&&!u(I),W=R&&(!c||x),K=(t,r)=>{c?f({url:t,name:r}):void 0===r?e.onChange(t):e.onChange(t,r)},_=(e,t)=>{w(t=>t?{...t,against:e}:t),K(e,t)},q=e=>{if(!e)return _("");const t=j.find(t=>t.value===e);_(e,t?.label)},H=P?b:I.trim(),U=()=>{if(!c||!H)return;if(!P&&R)return void y(!0);const t=P&&g.url===H?g.name:void 0,r=e.onApply;void 0===t?r(H):r(H,t)},V=(e,t)=>t&&!e.some(e=>e.value===t)?[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__ */
|
|
190
190
|
return Ye(Qn,{"aria-label":e,value:t,options:l,disabled:i,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
191
|
-
return Ye(gt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===
|
|
191
|
+
return Ye(gt,{size:"sm","aria-label":e,value:t,options:l,readOnly:i,onChange:n})};let G;if("text"===D.target.type)G=/* @__PURE__ */Ye(Qe,{ref:p,id:`${h}-address`,size:"sm",type:"text",invalid:W,"aria-label":d.address,"aria-describedby":W?`${h}-why`:void 0,placeholder:o??d.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:I,readOnly:i,onChange:e=>(e=>{y(!1);const t=e.trim();t?u(e)?(k({text:e,against:t}),_(t)):k({text:e,against:b}):(k({text:e,against:""}),_(""))})(e.target.value)});else{const e="groups"===D.target.type?D.target.groups.flatMap(e=>e.options.map(t=>({value:t.value,label:t.label,group:e.label}))):D.target.options.map(e=>({value:e.value,label:e.label})),t=[{value:"",label:D.target.placeholder},...V(e,A)];G=Y(D.label,A,t,q,e.length>10)}const X=/* @__PURE__ */Ge(Xe,{children:[r&&Y(d.linkType,D.value,L.map(e=>({value:e.value,label:e.label})),e=>{k(null),y(!1);const t=L.find(t=>t.value===e);if(!t||"text"===t.target.type)return void w({kind:e,against:b});const r=ea(t.target)[0];w({kind:e,against:r?r.value:""}),r?K(r.value,r.label):K("")},!1),G,E&&Y(d.filter,B?.param??"",[{value:"",label:d.noFilter},...B&&!T?[F(B.param)]:[],...E.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return _(A,z?.label);const t=E?.find(t=>t.param===e),r=t?.values[0];r&&_(n.withFilter(A,{param:e,value:r.value}),r.label)},!1),E&&B&&Y(d.value,B.value,V((T?.values??[]).map(e=>({value:e.value,label:e.label})),B.value),e=>{if(!B)return;const t=T?.values.find(t=>t.value===e);_(n.withFilter(A,{param:B.param,value:e}),t?.label)},(T?.values.length??0)>10),W&&/* @__PURE__ */Ye("p",{id:`${h}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:d.unsafe}),D.hint&&/* @__PURE__ */Ye("p",{className:"text-2xs leading-4 text-gray-400",children:D.hint}),E&&/* @__PURE__ */Ye("p",{className:"text-2xs leading-4 text-gray-400",children:d.filterHint})]});if(!c)/* @__PURE__ */
|
|
192
192
|
return Ye("div",{ref:m,className:`flex min-w-0 flex-auto flex-col gap-2 ${s}`.trim(),role:l?"group":void 0,"aria-label":l,children:X});const Z=e.onRemove;/* @__PURE__ */
|
|
193
|
-
return Ge("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),U())},children:[
|
|
194
|
-
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2",children:[Z?/* @__PURE__ */Ye(
|
|
193
|
+
return Ge("div",{ref:m,role:"dialog","aria-label":l??d.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${s}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),U())},children:[P?/* @__PURE__ */Ye("span",{className:Mt({inline:!0}),children:d.title}):/* @__PURE__ */Ye("label",{htmlFor:`${h}-address`,className:Mt({inline:!0}),children:d.title}),X,
|
|
194
|
+
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2",children:[Z?/* @__PURE__ */Ye(O,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:Z,children:d.remove}):null,
|
|
195
195
|
/* @__PURE__ */Ge("span",{className:"ml-auto flex gap-1",children:[
|
|
196
|
-
/* @__PURE__ */Ye(
|
|
197
|
-
/* @__PURE__ */Ye(
|
|
196
|
+
/* @__PURE__ */Ye(O,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>$.current(),children:d.cancel}),
|
|
197
|
+
/* @__PURE__ */Ye(O,{variant:"primary",size:"sm","data-window-action":"apply",onClick:U,disabled:i||""===H,children:d.apply})]})]})]})}function la({label:e,text:t,onTextChange:r,link:n,onLinkChange:a,kinds:l,rules:i,filtersFor:o,textPlaceholder:s,readOnly:c,className:d=""}){const u=he().link,[m,p]=Ee(!1),g=Be(null),f=ze(),b=()=>{p(!1),g.current?.focus()};/* @__PURE__ */
|
|
198
198
|
return Ge("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),children:[
|
|
199
199
|
/* @__PURE__ */Ye(Qe,{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)}),
|
|
200
200
|
/* @__PURE__ */Ge("button",{ref:g,type:"button","aria-label":u.linkOf(e,n),"aria-expanded":m,"aria-controls":m?f:void 0,disabled:c,onClick:()=>p(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${h.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:[
|
|
@@ -202,8 +202,8 @@ return Ge("div",{className:`flex min-w-0 flex-auto flex-col ${d}`.trim(),childre
|
|
|
202
202
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate "+(n?"text-blue-600":"text-gray-400"),children:n||u.addLink})]}),m&&/* @__PURE__ */Ye("div",{id:f,className:"mt-2",children:/* @__PURE__ */Ye(aa,{value:n,label:u.linkOf(e,n),kinds:l,rules:i,filtersFor:o,onApply:(e,t)=>{void 0===t?a(e):a(e,t),b()},onRemove:n?()=>{a(""),b()}:void 0,onCancel:b})})]})}var ia={tl:"",tr:"rotate-90",br:"rotate-180",bl:"-rotate-90"},oa=["tl","tr","bl","br"];function sa({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 g=he(),f=function(e){const t=oa.map(t=>e.find(e=>e.value===t));for(const r of e){if(oa.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,x]=Ee(0),y=Be(null);/* @__PURE__ */
|
|
203
203
|
return Ge("div",{id:m,role:"group","aria-label":e,className:`flex min-w-0 flex-wrap items-center gap-2 ${p}`.trim(),children:[l&&
|
|
204
204
|
/* @__PURE__ */Ye("div",{className:"w-30 shrink-0",children:/* @__PURE__ */Ye(rn,{value:a,onChange:l,min:o,max:s,step:c,precision:0,placeholder:d,prefix:/* @__PURE__ */Ye("span",{"data-radius-mark":"","aria-hidden":"true",children:g.corners.radiusMark}),suffix:g.corners.unit,steppers:"compact",disabled:u,"aria-label":i??g.corners.radius})}),
|
|
205
|
-
/* @__PURE__ */Ye("div",{ref:y,"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(y.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:f.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__ */Ye(Je,{"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:()=>x(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */Ye(Pe,{name:"corner",strokeWidth:2,className:["h-4 w-4",ia[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */Ye(
|
|
206
|
-
return Ye("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__ */Ye("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":
|
|
205
|
+
/* @__PURE__ */Ye("div",{ref:y,"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(y.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:f.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__ */Ye(Je,{"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:()=>x(r),onClick:()=>{l||n(a?t.filter(t=>t!==e.value):[...t,e.value])},children:/* @__PURE__ */Ye(Pe,{name:"corner",strokeWidth:2,className:["h-4 w-4",ia[e.value]??""].filter(Boolean).join(" ")})},e.value);return i?o:/* @__PURE__ */Ye(R,{content:e.title??e.label,children:o},e.value)})})]})}var ca={ArrowLeft:[0,-1],ArrowRight:[0,1],ArrowUp:[-1,0],ArrowDown:[1,0]};function da({label:e,value:t,points:r,onChange:n,disabled:a=!1,disabledReason:l,id:i,className:o=""}){const s=ze(),c=Be([]),d=r.findIndex(e=>e.value===t),u=r.findIndex(e=>!a&&!0!==e.disabled),h=d>=0?d:Math.max(0,u);/* @__PURE__ */
|
|
206
|
+
return Ye("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__ */Ye("button",{type:"button",role:"radio","aria-checked":o,"aria-label":e.label,"aria-disabled":d||void 0,"aria-describedby":E(void 0,u?m:void 0),ref:e=>{c.current[i]=e},tabIndex:i===h?0:-1,onKeyDown:e=>((e,l)=>{const i=ca[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?F:()=>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__ */Ye("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__ */Ye("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__ */Ye(B,{reason:u,id:m,block:!0,children:p},e.value):/* @__PURE__ */Ye(R,{content:e.title??e.label,className:"relative flex",children:p},e.value)})})}var ua=je(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=ze(),g=he().files,f=se({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__ */
|
|
207
207
|
return Ge(vt,{label:s,htmlFor:p,hint:c,error:d,required:u,className:h,children:[
|
|
208
208
|
/* @__PURE__ */Ge("button",{ref:m,type:"button",id:p,disabled:o,onClick:f.open,"aria-invalid":!!d||void 0,"aria-required":u||void 0,"aria-describedby":b,...f.zoneProps,className:At(f.dragOver,o,jt(o),"px-4 py-6"),children:[
|
|
209
209
|
/* @__PURE__ */Ge("span",{children:[
|
|
@@ -221,18 +221,18 @@ return Ge("div",{...e.zoneProps,...e.pasteProps,className:`relative ${r}`,childr
|
|
|
221
221
|
return Ge("li",{className:"flex max-w-full items-center gap-2 rounded-md border border-gray-200 bg-gray-50 py-1 pl-2 pr-1 text-xs text-gray-700",children:[l?/* @__PURE__ */Ye("img",{src:l,alt:"",className:"h-6 w-6 shrink-0 rounded object-cover"}):/* @__PURE__ */Ye("span",{className:"text-gray-400",children:/* @__PURE__ */Ye(ma,{})}),
|
|
222
222
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate",title:e.name,children:e.name}),
|
|
223
223
|
/* @__PURE__ */Ye("span",{className:"shrink-0 tabular-nums text-gray-400",children:ce(e.size,a)}),t&&/* @__PURE__ */Ye("button",{type:"button",disabled:r,onClick:()=>t(n),"aria-label":a.remove(e.name),className:"shrink-0 rounded p-0.5 text-gray-400 hover:bg-gray-200 hover:text-gray-600 disabled:cursor-not-allowed",children:/* @__PURE__ */Ye(Tt,{className:"h-3.5 w-3.5"})})]},`${e.name}-${e.size}-${n}`)})})}function fa({onClick:e,count:t=0,variant:r="button",label:n,disabled:a=!1}){const l=he().files,i=n??l.attach,o=t>0?`${i} (${t})`:i;return"icon"===r?/* @__PURE__ */Ge("span",{className:"relative inline-flex",children:[
|
|
224
|
-
/* @__PURE__ */Ye(Je,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */Ye(ha,{})}),t>0&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */Ye(
|
|
224
|
+
/* @__PURE__ */Ye(Je,{"aria-label":o,onClick:e,disabled:a,size:"sm",children:/* @__PURE__ */Ye(ha,{})}),t>0&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"pointer-events-none absolute -right-1 -top-1 min-w-[1rem] rounded-full bg-blue-600 px-1 text-center text-2xs font-semibold leading-4 text-white",children:t})]}):/* @__PURE__ */Ye(O,{type:"button",variant:"secondary",size:"sm",onClick:e,disabled:a,leftIcon:/* @__PURE__ */Ye(ha,{}),children:o})}function ba({files:e,onChange:t,accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i=!1,dropLabel:o,attachLabel:s,trigger:c="button",actions:d,onReject:u,className:h="",children:m}){const p=se({accept:r,maxSizeBytes:n,maxFiles:a,acceptHint:l,disabled:i,multiple:!0,currentCount:e.length,onAccept:r=>t([...e,...r])}),g=Be([]);return Ie(()=>{u&&p.rejections.length>0&&p.rejections!==g.current&&(g.current=p.rejections,u(p.rejections))},[p.rejections,u]),/* @__PURE__ */Ge(pa,{intake:p,dropLabel:o,className:h,children:[m,
|
|
225
225
|
/* @__PURE__ */Ye(ga,{files:e,disabled:i,onRemove:r=>{p.clearRejections(),t(e.filter((e,t)=>t!==r))},className:"mt-2"}),
|
|
226
226
|
/* @__PURE__ */Ge("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[
|
|
227
227
|
/* @__PURE__ */Ye(fa,{onClick:p.open,count:e.length,variant:c,label:s,disabled:i}),d]}),
|
|
228
228
|
/* @__PURE__ */Ye(de,{rejections:p.rejections})]})}var xa="inline-flex max-w-full items-center whitespace-nowrap rounded-full",ya={success:"bg-[var(--status-success-soft)] text-[color:var(--status-success-soft-ink)]",active:"bg-[var(--status-active-soft)] text-[color:var(--status-active-soft-ink)]",queued:"bg-[var(--status-queued-soft)] text-[color:var(--status-queued-soft-ink)]",info:"bg-[var(--status-info-soft)] text-[color:var(--status-info-soft-ink)]",pending:"bg-[var(--status-pending-soft)] text-[color:var(--status-pending-soft-ink)]",warning:"bg-[var(--status-warning-soft)] text-[color:var(--status-warning-soft-ink)]",danger:"bg-[var(--status-danger-soft)] text-[color:var(--status-danger-soft-ink)]",draft:"bg-[var(--status-draft-soft)] text-[color:var(--status-draft-soft-ink)]",neutral:"bg-[var(--status-neutral-soft)] text-[color:var(--status-neutral-soft-ink)]"},va={success:"bg-[var(--status-success-solid)] text-[color:var(--status-on-solid)]",active:"bg-[var(--status-active-solid)] text-[color:var(--status-on-solid)]",queued:"bg-[var(--status-queued-solid)] text-[color:var(--status-on-solid)]",info:"bg-[var(--status-info-solid)] text-[color:var(--status-on-solid)]",pending:"bg-[var(--status-pending-solid)] text-[color:var(--status-on-solid)]",warning:"bg-[var(--status-warning-solid)] text-[color:var(--status-on-solid)]",danger:"bg-[var(--status-danger-solid)] text-[color:var(--status-on-solid)]",draft:"bg-[var(--status-draft-solid)] text-[color:var(--status-on-solid)]",neutral:"bg-[var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function wa(e,t="subtle"){return"solid"===t?va[e]:ya[e]}var Na=Oe({}),ka=Oe(void 0);function $a(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Ma({groups:e,labelFor:t,children:r}){/* @__PURE__ */
|
|
229
229
|
return Ye(Na.Provider,{value:e,children:/* @__PURE__ */Ye(ka.Provider,{value:t,children:r})})}function Ca(){const e=_e(ka);return Fe(t=>e?.(t)??$a(t),[e])}function La({status:e,label:t,emphasis:r="subtle"}){const a=wa(_e(Na)[e]??"neutral",r),l=_e(ka),i=t??l?.(e)??$a(e);/* @__PURE__ */
|
|
230
|
-
return Ye("span",{className:`${xa} px-3 py-0.5 text-xs font-medium ${a}`,children:/* @__PURE__ */Ye(n,{children:i})})}var Sa={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 ${ya.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 Da({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:i,disabled:o,id:s,className:c="",tone:d,tooltip:u,split:h}){const[m,p]=Ee(!1),[g,f]=Ee(""),b=he(),x=Be(null),y=Be(null),v=Be(null),w=
|
|
230
|
+
return Ye("span",{className:`${xa} px-3 py-0.5 text-xs font-medium ${a}`,children:/* @__PURE__ */Ye(n,{children:i})})}var Sa={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 ${ya.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 Da({value:e,onChange:t,options:r=[],placeholder:n,allowFreeText:a=!1,invalid:i,disabled:o,id:s,className:c="",tone:d,tooltip:u,split:h}){const[m,p]=Ee(!1),[g,f]=Ee(""),b=he(),x=Be(null),y=Be(null),v=Be(null),w=T(x,m),N=e=>r.find(t=>t.value===e)?.label??e,k=Te(()=>{const t=new Set(e),n=[],a=g.trim().toLowerCase();for(const e of r)t.has(e.value)||(t.add(e.value),a&&!dt(e,a)||n.push(e));return n},[r,e,g]),$=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]),f("")):f("")},C=r=>t(e.filter(e=>e!==r)),L=()=>{const e=g.trim();if(h&&e)return $(e.split(h)),void f("");a&&e?M(e):f("")},S=Be(()=>{});S.current=()=>{L(),p(!1)},Ie(()=>{if(!m)return;const e=e=>{const t=e.target;x.current?.contains(t)||v.current?.contains(t)||(L(),p(!1))};document.addEventListener("mousedown",e);const t=ee(()=>S.current());return()=>{document.removeEventListener("mousedown",e),t()}});const D=r.length>0;/* @__PURE__ */
|
|
231
231
|
return Ge("div",{ref:x,className:"relative",children:[
|
|
232
232
|
/* @__PURE__ */Ge("div",{onMouseDown:e=>{o||e.target.closest("button")||(e.preventDefault(),y.current?.focus())},className:l({invalid:i,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${o?"bg-gray-50 cursor-not-allowed":""} ${c}`}),children:[e.map(e=>{const t=d?.(e),r=Sa[t??"accent"],n=/* @__PURE__ */Ge("span",{"data-tone":t,className:r.chip,children:[
|
|
233
|
-
/* @__PURE__ */Ye("span",{className:"truncate",children:N(e)}),!o&&/* @__PURE__ */Ye("button",{type:"button","aria-label":b.select.removeItem?.(N(e))??`${b.select.remove} ${N(e)}`,onClick:()=>
|
|
234
|
-
/* @__PURE__ */Ye("input",{id:s,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&
|
|
235
|
-
/* @__PURE__ */Ye("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:te.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??
|
|
233
|
+
/* @__PURE__ */Ye("span",{className:"truncate",children:N(e)}),!o&&/* @__PURE__ */Ye("button",{type:"button","aria-label":b.select.removeItem?.(N(e))??`${b.select.remove} ${N(e)}`,onClick:()=>C(e),className:r.remove,children:"×"})]},e),a=u?.(e);return null==a?n:/* @__PURE__ */Ye(R,{content:a,className:"relative inline-flex max-w-full",children:n},e)}),
|
|
234
|
+
/* @__PURE__ */Ye("input",{id:s,ref:y,type:"text",autoComplete:"off",role:"combobox","aria-expanded":m&&D,"aria-invalid":i||void 0,disabled:o,value:g,placeholder:0===e.length?n:void 0,onChange:e=>{(e=>{if(h){const t=e.split(h);if(t.length>1)return $(t.slice(0,-1)),void f(t[t.length-1])}f(e)})(e.target.value),p(!0)},onFocus:()=>{!o&&D&&p(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&a){t.preventDefault();const e=g.trim(),r=e?k.filter(t=>dt(t,e.toLowerCase())):[];1===r.length?M(r[0].value):L()}else"Backspace"===t.key&&""===g&&e.length>0?C(e[e.length-1]):"Escape"===t.key?(p(!1),f(""),y.current?.blur()):"Tab"===t.key&&(L(),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&&D&&Ze(
|
|
235
|
+
/* @__PURE__ */Ye("div",{ref:v,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:te.popup,left:w?.left,right:w?.right,top:w?.top,bottom:w?.bottom,minWidth:w?.minWidth,maxWidth:w?.maxWidth??H,width:"max-content",visibility:w?void 0:"hidden",...X()},children:/* @__PURE__ */Ye("div",{className:"overflow-y-auto",style:{maxHeight:w?.maxHeight??I},children:0===k.length?/* @__PURE__ */Ye("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:r.length>0&&e.length>=r.length?b.select.allSelected:b.select.noMatches}):k.map(e=>/* @__PURE__ */Ye("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__ */Ge(Xe,{children:[
|
|
236
236
|
/* @__PURE__ */Ye("span",{className:"min-w-0 truncate",children:e.label}),
|
|
237
237
|
/* @__PURE__ */Ye(ut,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}var Pa={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"}},Aa={neutral:"border-gray-200",warning:"border-amber-300",current:"border-gray-200"};function ja({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=Pa[l??(a?"md":"none")],p=ze(),g=ze(),f=null!=t&&null!=r&&""!==r,b=null!=i&&null!=t,x=`h${i}`,y=null!=s&&""!==s,v=b||y,w=v?"section":"div",N=`rounded-(--radius-card) border ${Aa[h]} bg-white shadow-sm ${c}`.trim(),k=Re.toArray(e).length>0,$=k?"border-b border-gray-100 ":"",M="current"===h,C=M?"text-base font-semibold text-blue-700":"text-base font-semibold text-gray-900",L=M?"rounded-t-(--radius-card) bg-blue-50 ":"",S=`${$}${L}${m.edge} ${C}`;/* @__PURE__ */
|
|
238
238
|
return Ge(w,{className:N,style:u,...y?{"aria-label":s}:b?{"aria-labelledby":p}:{},...f&&v?{"aria-describedby":g}:{},...M?{"aria-current":!0}:{},children:[f?
|
|
@@ -282,7 +282,7 @@ return Ge("div",{role:"danger"===e?"alert":"status",className:`${m} flex items-s
|
|
|
282
282
|
/* @__PURE__ */Ge("div",{className:"flex min-w-0 flex-1 flex-wrap items-start gap-x-3 gap-y-2",children:[
|
|
283
283
|
/* @__PURE__ */Ye("div",{className:"min-w-0 grow basis-48 text-sm",children:p}),
|
|
284
284
|
/* @__PURE__ */Ye("div",{className:"shrink-0 self-center",children:l})]}),i&&/* @__PURE__ */Ye("button",{type:"button",onClick:i,"aria-label":u.dismiss,className:"shrink-0 "+(d?"opacity-80 hover:opacity-100":"text-gray-400 hover:text-gray-600"),children:/* @__PURE__ */Ye(Pe,{name:"close",className:"h-4 w-4",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})}var zl=(e,t)=>`${e}-tab-${t}`,Fl=(e,t)=>`${e}-panel-${t}`,El=(e,t)=>`flex items-center border-b border-gray-200${e?"":" gap-1"} ${t}`.trim();function Bl(e,t){return`-mb-px inline-flex items-center gap-2 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${t?"flex-1 justify-center ":""}${e?"border-blue-600 text-blue-600":"border-transparent text-gray-900 hover:border-gray-300"}`}function Tl({items:e,value:t,onChange:r,variant:n="underline",block:a=!1,idPrefix:l,className:i="","aria-label":o,"aria-labelledby":s}){const c=Be([]),d="pill"===n,u=(t,r)=>{for(let n=1;n<=e.length;n+=1){const a=((t+r*n)%e.length+e.length)%e.length;if(!e[a]?.disabled)return a}return null},h=t=>{const r=1===t?e.map((e,t)=>t):e.map((t,r)=>e.length-1-r);for(const t of r)if(!e[t]?.disabled)return t;return null};/* @__PURE__ */
|
|
285
|
-
return Ye("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?qr(a,i):El(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */Ye("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?zl(l,e.id):void 0,"aria-controls":l?Fl(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?Hr({selected:i,disabled:e.disabled,block:a}):Bl(i,a),children:/* @__PURE__ */Ye(Vr,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */Ye(
|
|
285
|
+
return Ye("div",{role:"tablist","aria-label":o,"aria-labelledby":s,onKeyDown:n=>{const a=e.findIndex(e=>e.id===t);let l=null;if("ArrowRight"===n.key||"ArrowDown"===n.key)l=u(a,1);else if("ArrowLeft"===n.key||"ArrowUp"===n.key)l=u(a,-1);else if("Home"===n.key)l=h(1);else{if("End"!==n.key)return;l=h(-1)}n.preventDefault(),null!==l&&l!==a&&(r(e[l].id),c.current[l]?.focus())},className:d?qr(a,i):El(a,i),children:e.map((e,n)=>{const i=e.id===t,o=/* @__PURE__ */Ye("button",{ref:e=>{c.current[n]=e},type:"button",role:"tab",id:l?zl(l,e.id):void 0,"aria-controls":l?Fl(l,e.id):void 0,"aria-selected":i,tabIndex:i?0:-1,disabled:e.disabled,onClick:()=>r(e.id),className:d?Hr({selected:i,disabled:e.disabled,block:a}):Bl(i,a),children:/* @__PURE__ */Ye(Vr,{icon:e.icon,label:e.label})},e.id);return null!=e.tooltip&&!1!==e.tooltip?/* @__PURE__ */Ye(R,{content:e.tooltip,className:d||a?Ur(a):void 0,children:o},e.id):o})})}var Il=()=>/* @__PURE__ */Ye(Pe,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function Ol({items:e,value:t,onChange:r,"aria-label":n,className:a=""}){const l=Math.max(0,e.findIndex(e=>e.id===t));/* @__PURE__ */
|
|
286
286
|
return Ye("ol",{"aria-label":n,className:`grid items-start ${a}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((t,n)=>{const a=n<l?"complete":n===l?"current":"upcoming",i="complete"===a&&!!r,o=/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===a?"bg-blue-600 text-white":"","current"===a?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===a?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===a?/* @__PURE__ */Ye(Il,{}):n+1}),s=/* @__PURE__ */Ge("span",{className:"min-w-0 text-center",children:[
|
|
287
287
|
/* @__PURE__ */Ye("span",{className:"block text-sm font-medium "+("upcoming"===a?"text-gray-400":"text-gray-900"),children:t.label}),t.description&&/* @__PURE__ */Ye("span",{className:"block text-xs text-gray-500",children:t.description})]});/* @__PURE__ */
|
|
288
288
|
return Ge("li",{"aria-current":"current"===a?"step":void 0,className:"relative flex min-w-0 justify-center",children:[n<e.length-1&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(n<l?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),i?/* @__PURE__ */Ge("button",{type:"button",onClick:()=>r?.(t.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[o,s]}):/* @__PURE__ */Ge("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[o,s]})]},t.id)})})}function Rl({items:e,defaultOpenIds:t=[],openIds:r,onOpenChange:n,allowMultiple:a=!1,className:l=""}){const[i,o]=Ee(t),s=r??i;/* @__PURE__ */
|
|
@@ -409,29 +409,29 @@ return Ge("div",{children:[
|
|
|
409
409
|
return Ge(Xe,{children:[
|
|
410
410
|
/* @__PURE__ */Ye("div",{className:"rosh-tl-hit","aria-hidden":"true","data-timeline-part":"hit",style:{top:a.rail-9+"px",height:"24px"},onPointerDown:e=>{N(e),w(v(e.clientX))},onPointerMove:$,onPointerUp:k,onPointerCancel:k}),
|
|
411
411
|
/* @__PURE__ */Ye("div",{className:"rosh-tl-chip","data-timeline-part":"chip",style:{left:`${Mi(f,88,o)+44}px`,top:`${a.tag}px`},children:e.chip?e.chip(b):ii(b,p)}),
|
|
412
|
-
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/ai),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*ai;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function to(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function ro({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:x,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=le(Date.now,null),$=le(ji,!1),M=o??k,C=Be(null),S=he().timeline,D=ue(),P=e=>ii(e,D),A=Be(null),j=Be(null),z=Be(null),F=Be(/* @__PURE__ */new Map),E=Be(void 0),B=Be(void 0),T=Be(null),[I,O]=Ee({}),[R,W]=Ee(null),[K,_]=Ee(null),[q,H]=Ee(null),[U,V]=Ee(null),[Y,G]=Ee(null),[X,Z]=Ee(null),J=ze(),ee=ze(),te=Ri(C,!0),re=te>0?te-(l.length>0&&!N?176:0):0,ne=re>0&&re-20<320,ae=Ri(A,!ne),ie=ae>0?ae:600,oe=Ai[s],se=N&&l.length>0,ce=se?Math.max(0,ie-36):ie,de=r=>r>=e-ai&&r<=t+ai,me=n.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=$i([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ce,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,xe=me.filter(e=>!e.provisional),ye=g??(xe.length>0?xe[xe.length-1].key:null),ve=me.map((e,t)=>{const r=e.date??P(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Ei[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Bi(e,a,0===t&&"default"===a),role:e.key===ye?"current":n?"dot":"key",widthPx:N?Math.max(16,zi(e.caption??"")+6):I[e.key]||Li(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=P(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Fi[e.kind].glyph,role:"key",widthPx:I[r]||Li(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Ne=se?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+ai,x:ie,baseX:ie,kind:e.kind??"default",label:e.label,dateText:S.notReached,detail:r.length>0?S.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=N&&w&&!se?[{key:w.key,ms:t,x:ce,baseX:ce,kind:"default",label:w.label,dateText:w.dateText??P(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),Me=m?.start??S.start(P(e)),Ce=null==Me||!1===Me?0:"string"==typeof Me?Math.ceil(zi(Me)):96,Le="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}($e):[],Se=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:Ci,members:t})}n=a}return r}($e),De=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Pe=/* @__PURE__ */new Map;for(const e of Se)if("cluster"===e.type)for(const t of e.members)Pe.set(t.key,De(e));const Ae=q??U??Y,je=Le.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ae)??Se.find(e=>"cluster"===e.type&&De(e)===Ae),Te=e=>({x:e.baseX,widthPx:e.widthPx}),Oe=je&&"cluster"===je.type?je.members.map(Te):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Te):[],Re=Oe.length>1?Wi(ge,Oe,ce):ge,We=Re!==ge;if(We)for(const e of $e)e.isCap||(e.x=Re.xByMs(e.ms));const Ke=$e.some(e=>e.x<14),_e=We&&je?Ae:null,qe=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),He=ne?$e.map(qe):Se.flatMap(e=>{if("item"===e.type)return[qe(e.mark)];const t=De(e);if(t===_e&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(qe);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ue=/* @__PURE__ */new Map;for(const e of He)for(const t of e.members)Ue.set(t.key,e.key);const Ve=Se.find(e=>"cluster"===e.type&&De(e)===_e),Ze=Ve&&"cluster"===Ve.type?{from:Math.min(...Ve.members.map(e=>e.x))-16,to:Math.max(...Ve.members.map(e=>e.x))+16}:null,Je=Be(_e),[Qe,et]=Ee(!1);Ie(()=>{if(Je.current===_e)return;Je.current=_e,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[_e]);const tt=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Oi(()=>{const e=j.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}O(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Ee(rt),lt=b&&nt===rt;Ie(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=Ki(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ve.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:Si(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(Re,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=Ee(null),pt=Be(null),gt=Be({segments:ut,value:ct,playback:h});Ie(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Be(null),bt=Fe(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=Fe(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;Ie(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(Pi(t,0))):xt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Pi(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Pi(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=Pi(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Di(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(y??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Fe(()=>{clearTimeout(E.current),clearTimeout(B.current),W(null),_(null),H(null),V(null),G(null)},[]);Ie(()=>()=>{clearTimeout(E.current),clearTimeout(B.current)},[]),Ie(()=>{const e=T.current;e&&(T.current=null,F.current.get(e)?.focus())});const Ct=null!==K||null!==q||null!==U||null!==Y;Ie(()=>{if(Ct)return Q(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Fe((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ie-r)):t;const a=e.parentElement;if(r>0&&a){const t=L(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[ie]),St=He.find(e=>e.key===K)??null,Dt=St?St.x:0;Oi(()=>{Lt(z.current,Dt)},[Lt,K,Dt]);const Pt=ct??void 0,At=Be(null);Ie(()=>{if(void 0===Pt)return;const e=Re.xByMs(Pt),t=At.current;if(At.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=F.current.get(Ue.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const jt=He.map(e=>e.key),zt=ye?Ue.get(ye)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),Z(jt[r]),F.current.get(jt[r])?.focus())},Bt=()=>clearTimeout(B.current),Tt=e=>{Bt(),G(e)},It=()=>{clearTimeout(B.current),B.current=setTimeout(()=>G(null),260)},Ot=e=>{_e&&Pe.get(e)===_e?Bt():(Bt(),G(null))},Rt=e=>{clearTimeout(E.current),W(e),_(e),v?.((e=>{const t=He.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{W(t=>t===e?null:t),clearTimeout(E.current),E.current=setTimeout(()=>_(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Ii(e),"aria-describedby":K===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),Z(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=S,r.events(t.length,t.map(Ii))),"aria-describedby":K===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?F.current.set(e.key,t):F.current.delete(e.key)},onMouseEnter:()=>{e.openable?Tt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),Z(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Tt(e.key);const r=e.members[0];Z(r.key),T.current=r.key}};var t,r},qt="lanes"!==s||$e.length>1;if(ne)/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */Ye("div",{role:"slider",tabIndex:0,className:"rosh-tl-thumb text-blue-600","data-timeline-part":"thumb","aria-label":e.ariaLabel??m.scrub,"aria-valuemin":0,"aria-valuemax":x&&x.length>0?x.length-1:C,"aria-valuenow":x&&x.length>0?Math.max(0,y):Math.round((t-l)/ai),"aria-valuetext":M,style:{left:`${f}px`,top:`${a.rail+3}px`},onPointerDown:N,onPointerMove:$,onPointerUp:k,onPointerCancel:k,onKeyDown:e=>{const r=(e=>{const{key:r}=e;if(x&&x.length>0){const e=y<0?0:y;return"ArrowRight"===r||"ArrowUp"===r?x[Math.min(e+1,x.length-1)]:"ArrowLeft"===r||"ArrowDown"===r?x[Math.max(e-1,0)]:"Home"===r?x[0]:"End"===r?x[x.length-1]:null}const n=(e.shiftKey?7:1)*ai;return"ArrowRight"===r||"ArrowUp"===r?t+n:"ArrowLeft"===r||"ArrowDown"===r?t-n:"Home"===r?l:"End"===r?i:null})(e);null!==r&&(e.preventDefault(),d?.(),w(r))}})]})}function to(e,t,r){return(t?e.height:e.ruler+26)+(r?22:0)}function ro({startMs:e,endMs:t,axis:r="linear",items:n,markers:a=[],pending:l=[],fillToMs:i,todayMs:o,labels:s="lanes",activeKey:c=null,onActivate:d,thumb:u,playback:h,edgeCaptions:m,phases:p=[],currentKey:g,zoomRange:f=null,motion:b=!0,ariaLabel:x,highlightKeys:y=null,onHoverChange:v,endMark:w=null}){const N="none"===s,k=le(Date.now,null),$=le(ji,!1),M=o??k,C=Be(null),L=he().timeline,S=ue(),D=e=>ii(e,S),P=Be(null),A=Be(null),j=Be(null),z=Be(/* @__PURE__ */new Map),F=Be(void 0),E=Be(void 0),B=Be(null),[T,I]=Ee({}),[O,R]=Ee(null),[K,_]=Ee(null),[q,H]=Ee(null),[U,V]=Ee(null),[Y,G]=Ee(null),[X,Z]=Ee(null),J=ze(),ee=ze(),te=Ri(C,!0),re=te>0?te-(l.length>0&&!N?176:0):0,ne=re>0&&re-20<320,ae=Ri(P,!ne),ie=ae>0?ae:600,oe=Ai[s],se=N&&l.length>0,ce=se?Math.max(0,ie-36):ie,de=r=>r>=e-ai&&r<=t+ai,me=n.filter(e=>Number.isFinite(e.ms)&&de(e.ms)).slice().sort((e,t)=>e.ms-t.ms),pe="spread"===r?a.map(e=>new Date(e.date).getTime()).filter(e=>Number.isFinite(e)):[],ge=$i([e,...[...me.map(e=>e.ms),...pe].filter(r=>r>e&&r<t),t],ce,"compressed"===(fe=r)?{}:"spread"===fe?{maxTimeShare:1/0}:{maxTimeShare:1/0,minGapPx:0});var fe;const be=ge.xByMs,xe=me.filter(e=>!e.provisional),ye=g??(xe.length>0?xe[xe.length-1].key:null),ve=me.map((e,t)=>{const r=e.date??D(e.ms),n=(e.priority??0)>0||"report"===e.kind,a=function(e){const t=e.kind??"default";return"default"===t&&e.glyph&&"none"!==e.glyph?Ei[e.glyph]??t:t}(e);return{key:e.key,ms:e.ms,x:be(e.ms),baseX:be(e.ms),kind:a,label:e.label,dateText:r,detail:e.detail,preview:e.preview,glyph:Bi(e,a,0===t&&"default"===a),role:e.key===ye?"current":n?"dot":"key",widthPx:N?Math.max(16,zi(e.caption??"")+6):T[e.key]||Li(e.label,r),collapsible:n,onClick:e.onClick,onOpen:e.onOpen,isItem:!0,caption:e.caption,provisional:!!e.provisional,isCap:!1}}),we=a.map(e=>({marker:e,ms:new Date(e.date).getTime()})).filter(({ms:e})=>Number.isFinite(e)&&de(e)).map(({marker:e,ms:t})=>{const r=`marker-${e.id}`,n=D(t);return{key:r,ms:t,x:be(t),baseX:be(t),kind:e.kind,label:e.label,dateText:n,detail:e.detail,preview:e.preview,glyph:e.glyph??Fi[e.kind].glyph,role:"key",widthPx:T[r]||Li(e.label,n),collapsible:!1,onClick:e.onClick?()=>e.onClick?.(e):void 0,onOpen:e.onOpen?()=>e.onOpen?.(e):void 0,isItem:!1,provisional:!1,isCap:!1}}),Ne=se?(()=>{const e=l[l.length-1],r=l.slice(0,-1).map(e=>e.label);return[{key:e.key,ms:t+ai,x:ie,baseX:ie,kind:e.kind??"default",label:e.label,dateText:L.notReached,detail:r.length>0?L.alsoToCome(r):void 0,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]})():[],ke=N&&w&&!se?[{key:w.key,ms:t,x:ce,baseX:ce,kind:"default",label:w.label,dateText:w.dateText??D(t),detail:w.detail,glyph:void 0,role:"key",widthPx:16,collapsible:!1,isItem:!1,provisional:!1,isCap:!0}]:[],$e=[...ve,...we,...Ne,...ke].sort((e,t)=>e.x-t.x||e.ms-t.ms),Me=m?.start??L.start(D(e)),Ce=null==Me||!1===Me?0:"string"==typeof Me?Math.ceil(zi(Me)):96,Le="lanes"===s?function(e,t={}){const r=t.minPitchPx??40,n=[];let a=0;for(;a<e.length;){const t=e[a];if(!t.collapsible){n.push({type:"item",mark:t}),a+=1;continue}let l=a+1;for(;l<e.length&&e[l].collapsible&&e[l].kind===t.kind;)l+=1;const i=e.slice(a,l),o=i.length>1&&i.every((e,t)=>{if(0===t)return!0;const n=i[t-1],a=Math.max(r,Math.max(e.widthPx,n.widthPx)+8);return e.x-n.x<a});if(i.length>=3||o)n.push({type:"cluster",kind:t.kind,members:i});else for(const e of i)n.push({type:"item",mark:e});a=l}return n}($e):[],Se=function(e,t=16){const r=[];let n=0;for(;n<e.length;){let a=n+1;for(;a<e.length&&e[a].x-e[a-1].x<t;)a+=1;if(a-n===1)r.push({type:"item",mark:e[n]});else{const t=e.slice(n,a),l=new Set(t.map(e=>e.kind));r.push({type:"cluster",kind:1===l.size?t[0].kind:Ci,members:t})}n=a}return r}($e),De=e=>"cluster"===e.type?`fold-${e.members[0].key}`:e.mark.key,Pe=/* @__PURE__ */new Map;for(const e of Se)if("cluster"===e.type)for(const t of e.members)Pe.set(t.key,De(e));const Ae=q??U??Y,je=Le.find(e=>"cluster"===e.type&&(e=>"cluster"===e.type?`cluster-${e.members[0].key}`:e.mark.key)(e)===Ae)??Se.find(e=>"cluster"===e.type&&De(e)===Ae),Te=e=>({x:e.baseX,widthPx:e.widthPx}),Oe=je&&"cluster"===je.type?je.members.map(Te):f?$e.filter(e=>e.ms>=f[0]&&e.ms<=f[1]).map(Te):[],Re=Oe.length>1?Wi(ge,Oe,ce):ge,We=Re!==ge;if(We)for(const e of $e)e.isCap||(e.x=Re.xByMs(e.ms));const Ke=$e.some(e=>e.x<14),_e=We&&je?Ae:null,qe=e=>({key:e.key,mark:e,members:[e],x:e.x,kind:e.kind,openable:!1}),He=ne?$e.map(qe):Se.flatMap(e=>{if("item"===e.type)return[qe(e.mark)];const t=De(e);if(t===_e&&(r=e.members).every((e,t)=>0===t||e.x-r[t-1].x>=16))return e.members.map(qe);var r;const n=e.members.map(e=>e.x);return[{key:t,mark:null,members:e.members,x:n.reduce((e,t)=>e+t,0)/n.length,kind:e.kind,openable:new Set(e.members.map(e=>e.ms)).size>1}]}),Ue=/* @__PURE__ */new Map;for(const e of He)for(const t of e.members)Ue.set(t.key,e.key);const Ve=Se.find(e=>"cluster"===e.type&&De(e)===_e),Ze=Ve&&"cluster"===Ve.type?{from:Math.min(...Ve.members.map(e=>e.x))-16,to:Math.max(...Ve.members.map(e=>e.x))+16}:null,Je=Be(_e),[Qe,et]=Ee(!1);Ie(()=>{if(Je.current===_e)return;Je.current=_e,et(!0);const e=setTimeout(()=>et(!1),240);return()=>clearTimeout(e)},[_e]);const tt=$e.map(e=>`${e.key} ${e.label} ${e.dateText}`).join("|");Oi(()=>{const e=A.current;if(!e)return;const t={};for(const r of Array.from(e.children)){const e=r.dataset.laneKey,n=r.getBoundingClientRect().width;e&&n>0&&(t[e]=n)}I(e=>function(e,t){const r=Object.keys(e);return r.length===Object.keys(t).length&&r.every(r=>Math.abs((e[r]??0)-(t[r]??0))<.5)}(e,t)?e:t)},[tt]);const rt=`${s}|${r}|${$e.map(e=>`${e.key}@${e.ms}`).join("|")}`,[nt,at]=Ee(rt),lt=b&&nt===rt;Ie(()=>{nt!==rt&&at(rt)},[nt,rt]);const it=Math.min(28,340/Math.max(1,$e.length-1)),ot=Ki(u?.stops),st=r=>{const n=Math.min(Math.max(r,e),t);if(!ot)return n;let a=ot[0];for(const e of ot)Math.abs(e-n)<Math.abs(a-n)&&(a=e);return a},ct=u?st(u.valueMs):null,dt=h&&u?ve.filter(e=>!ot||ot.includes(e.ms)).map(e=>({key:e.key,ms:e.ms})):[],ut=function(e,t,r={}){const n=Number.isFinite(r.speed)&&(r.speed??0)>0?r.speed:1,a=Math.max(0,r.dwellMs??700)/n,l=t.filter(e=>Number.isFinite(e.ms)).slice().sort((e,t)=>e.ms-t.ms),i=[];for(let t=0;t+1<l.length;t++){const o=l[t],s=l[t+1],c=e.xByMs(o.ms),d=e.xByMs(s.ms),u=Math.max(0,d-c),h=u<=.5||r.reducedMotion?0:Si(350*u/100,450,1400)/n;i.push({fromKey:o.key,toKey:s.key,fromMs:o.ms,toMs:s.ms,fromPx:c,toPx:d,lengthPx:u,durationMs:h,dwellMs:a,msByPx:e.msByPx})}return i}(Re,dt,{speed:h?.speed,reducedMotion:$}),[ht,mt]=Ee(null),pt=Be(null),gt=Be({segments:ut,value:ct,playback:h});Ie(()=>{gt.current={segments:ut,value:ct,playback:h}});const ft=Be(null),bt=Fe(e=>{null===e&&null===ft.current||(ft.current=e,gt.current.playback?.onProgress?.(e))},[]),xt=Fe(()=>{pt.current=null,mt(null),bt(null),gt.current.playback?.onStop?.()},[bt]),yt=!!h?.playing&&!!u;Ie(()=>{if(!yt)return;const e=gt.current,t=null===e.value?-1:e.segments.findIndex(t=>t.fromMs===e.value);if(t<0)return void xt();pt.current&&pt.current.index===t||(pt.current={index:t,phase:"rest",t:0,restLeftMs:e.segments[t].dwellMs,sinceMs:null});let r,n=0;const a=e=>mt(t=>t&&t.px===e.px&&t.ms===e.ms?t:e),l=()=>{clearTimeout(r);const e=pt.current;"rest"===e?.phase&&(r=setTimeout(i,Math.max(0,e.restLeftMs)))},i=()=>{const e=pt.current;if("rest"!==e?.phase)return;const t=gt.current.segments[e.index];t?(pt.current={index:e.index,phase:"glide",t:0,restLeftMs:0,sinceMs:null},a(Pi(t,0))):xt()},o=e=>{const t=gt.current,r=pt.current;if(!r)return;const i=function(e,t,r){const n=e[t.index];if(!n)return{cursor:null,at:null,arrived:null,progress:null};const a=null===t.sinceMs?0:Math.max(0,r-t.sinceMs);if("rest"===t.phase){const e=t.restLeftMs-a;return e>0?{cursor:{...t,restLeftMs:e,sinceMs:r},at:Pi(n,0),arrived:null,progress:null}:{cursor:{index:t.index,phase:"glide",t:0,restLeftMs:0,sinceMs:r},at:Pi(n,0),arrived:null,progress:null}}const l=n.durationMs>0?Math.min(1,t.t+a/n.durationMs):1,i=Pi(n,l);if(l<1)return{cursor:{...t,t:l,sinceMs:r},at:i,arrived:null,progress:{fromKey:n.fromKey,toKey:n.toKey,t:Di(l),ms:i.ms}};const o=e[t.index+1];return{cursor:o?{index:t.index+1,phase:"rest",t:0,restLeftMs:o.dwellMs,sinceMs:r}:null,at:i,arrived:{key:n.toKey,ms:n.toMs},progress:null}}(t.segments,r,e);pt.current=i.cursor,i.at&&a(i.at),bt(i.progress),i.arrived&&t.playback?.onArrive(i.arrived.key,i.arrived.ms),i.cursor?(i.cursor.phase===r.phase&&i.cursor.index===r.index||l(),n=requestAnimationFrame(o)):xt()};return l(),n=requestAnimationFrame(o),()=>{cancelAnimationFrame(n),clearTimeout(r),pt.current&&(pt.current.sinceMs=null,bt(null))}},[yt,xt,bt]);const vt=ve.filter(e=>!e.provisional),wt=u?ht?ht.ms:ct:void 0!==i?i:vt.length>0?null===M?vt[vt.length-1].ms:Math.min(vt[vt.length-1].ms,M):null,Nt=new Set(y??[]),kt=$e.filter(e=>Nt.has(e.key)).map(e=>e.x),$t=kt.length>0?{from:Math.min(...kt),to:Math.max(...kt)}:null,Mt=Fe(()=>{clearTimeout(F.current),clearTimeout(E.current),R(null),_(null),H(null),V(null),G(null)},[]);Ie(()=>()=>{clearTimeout(F.current),clearTimeout(E.current)},[]),Ie(()=>{const e=B.current;e&&(B.current=null,z.current.get(e)?.focus())});const Ct=null!==K||null!==q||null!==U||null!==Y;Ie(()=>{if(Ct)return Q(e=>"Escape"===e.key&&(Mt(),!0))},[Ct,Mt]);const Lt=Fe((e,t)=>{if(!e)return;const r=e.offsetWidth/2;let n=r>0?Math.max(r,Math.min(t,ie-r)):t;const a=e.parentElement;if(r>0&&a){const t=W(e),l=a.getBoundingClientRect().left,i=t.left+8+r-l,o=t.right-8-r-l;i<=o&&(n=Math.max(i,Math.min(n,o)))}e.style.left=`${n}px`,e.style.setProperty("--rosh-tl-arrow",`${r+(t-n)}px`)},[ie]),St=He.find(e=>e.key===K)??null,Dt=St?St.x:0;Oi(()=>{Lt(j.current,Dt)},[Lt,K,Dt]);const Pt=ct??void 0,At=Be(null);Ie(()=>{if(void 0===Pt)return;const e=Re.xByMs(Pt),t=At.current;if(At.current=e,null===t||e<=t)return;const r=[];for(const n of $e){if(n.x<=t||n.x>e)continue;const a=z.current.get(Ue.get(n.key)??n.key);a&&(a.classList.add("is-hit"),r.push(setTimeout(()=>a.classList.remove("is-hit"),460)))}return()=>{for(const e of r)clearTimeout(e)}},[Pt]);const jt=He.map(e=>e.key),zt=ye?Ue.get(ye)??null:null,Ft=X&&jt.includes(X)?X:zt&&jt.includes(zt)?zt:jt[0],Et=e=>{const t=jt.indexOf(e.target.dataset?.timelineKey??"");if(t<0)return;const r="ArrowRight"===e.key||"ArrowDown"===e.key?t+1:"ArrowLeft"===e.key||"ArrowUp"===e.key?t-1:"Home"===e.key?0:"End"===e.key?jt.length-1:-1;r<0||r>jt.length-1||(e.preventDefault(),Z(jt[r]),z.current.get(jt[r])?.focus())},Bt=()=>clearTimeout(E.current),Tt=e=>{Bt(),G(e)},It=()=>{clearTimeout(E.current),E.current=setTimeout(()=>G(null),260)},Ot=e=>{_e&&Pe.get(e)===_e?Bt():(Bt(),G(null))},Rt=e=>{clearTimeout(F.current),R(e),_(e),v?.((e=>{const t=He.find(t=>t.key===e);return t?.members[0]?.key??e})(e))},Wt=e=>{R(t=>t===e?null:t),clearTimeout(F.current),F.current=setTimeout(()=>_(t=>t===e?null:t),160),v?.(null)},Kt=e=>({type:"button","data-timeline-node":e.isCap?"cap":e.isItem?"item":"marker","data-timeline-key":e.key,"aria-label":Ii(e),"aria-describedby":K===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{Ot(e.key),Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Ot(e.key),Rt(e.key),Z(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{t.stopPropagation(),e.onClick?.(),e.isItem&&d?.(e.key)}}),_t=e=>{return{type:"button","data-timeline-node":"fold","data-timeline-key":e.key,"data-timeline-count":String(e.members.length),"aria-label":(t=e.members,r=L,r.events(t.length,t.map(Ii))),"aria-describedby":K===e.key?J:void 0,tabIndex:e.key===Ft?0:-1,ref:t=>{t?z.current.set(e.key,t):z.current.delete(e.key)},onMouseEnter:()=>{e.openable?Tt(e.key):Rt(e.key)},onMouseLeave:()=>{It(),Wt(e.key)},onFocus:()=>{Bt(),Rt(e.key),Z(e.key)},onBlur:()=>{It(),Wt(e.key)},onPointerDown:e=>e.stopPropagation(),onClick:t=>{if(t.stopPropagation(),!e.openable)return void Rt(e.key);Tt(e.key);const r=e.members[0];Z(r.key),B.current=r.key}};var t,r},qt="lanes"!==s||$e.length>1;if(ne)/* @__PURE__ */
|
|
413
413
|
return Ye("div",{ref:C,children:/* @__PURE__ */Ye(Ui,{marks:$e.filter(e=>!e.isCap),pending:l,currentKey:ye,todayMs:M,reveal:lt,ariaLabel:x,step:it,nodeProps:Kt,onKeyDown:Et})});const Ht=(e,t)=>null==e||!1===e?null:/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-flank"+(t?" is-end":""),"data-timeline-part":t?"end-caption":"start-caption",style:{paddingTop:oe.rail-3+"px"},children:e});/* @__PURE__ */
|
|
414
414
|
return Ge("div",{ref:C,className:"rosh-tl-body"+(l.length>0&&!N?"":" is-solo"),children:[
|
|
415
415
|
/* @__PURE__ */Ge("div",{className:"flex items-stretch gap-3",children:[N&&Ht(Me,!1),
|
|
416
|
-
/* @__PURE__ */Ye("div",{className:"rosh-tl-stage",style:{height:`${to(oe,qt,p.length>0&&!N)}px`},children:/* @__PURE__ */Ge("div",{ref:
|
|
416
|
+
/* @__PURE__ */Ye("div",{className:"rosh-tl-stage",style:{height:`${to(oe,qt,p.length>0&&!N)}px`},children:/* @__PURE__ */Ge("div",{ref:P,className:`rosh-tl-layer${Qe?" is-zooming":""}${ht?" is-gliding":""}`,onMouseMove:e=>{if(!Ze)return;const t=P.current?.getBoundingClientRect();if(!t)return;const r=e.clientX-t.left;r>=Ze.from&&r<=Ze.to?Bt():It()},onMouseLeave:It,children:[!N&&/* @__PURE__ */Ye(_i,{marks:$e,innerRef:A}),
|
|
417
417
|
/* @__PURE__ */Ye(Vi,{axis:Re,geo:oe,fillTo:wt,reveal:lt,trackPx:ce,tweened:!!u}),se&&
|
|
418
418
|
/* @__PURE__ */Ye("i",{"aria-hidden":"true",className:"rosh-tl-tail","data-timeline-part":"tail",style:{left:`${ce}px`,width:ie-ce+"px",top:oe.rail+3-1+"px"}}),$t&&/* @__PURE__ */Ye("div",{"aria-hidden":"true",className:"rosh-tl-band","data-timeline-part":"highlight",style:{left:$t.from-10+"px",width:$t.to-$t.from+20+"px",top:oe.rail-7+"px",height:"20px"}}),
|
|
419
419
|
/* @__PURE__ */Ye(qi,{startMs:e,endMs:t,axis:Re,geo:oe,reveal:lt}),
|
|
420
|
-
/* @__PURE__ */Ye(Yi,{geo:oe,caption:N?null:Me,endCaption:N?null:m?.end,around:Ke,reveal:lt,trackPx:ie}),N&&/* @__PURE__ */Ye(Xi,{nodes:He,geo:oe,reveal:lt}),null!==M&&M>e&&M<=t+ai&&/* @__PURE__ */Ye(Gi,{x:Re.xByMs(Math.min(M,t)),geo:oe,trackPx:ie,label:
|
|
420
|
+
/* @__PURE__ */Ye(Yi,{geo:oe,caption:N?null:Me,endCaption:N?null:m?.end,around:Ke,reveal:lt,trackPx:ie}),N&&/* @__PURE__ */Ye(Xi,{nodes:He,geo:oe,reveal:lt}),null!==M&&M>e&&M<=t+ai&&/* @__PURE__ */Ye(Gi,{x:Re.xByMs(Math.min(M,t)),geo:oe,trackPx:ie,label:D(M),reveal:lt}),!N&&p.map(e=>/* @__PURE__ */Ye(Zi,{phase:e,geo:oe,xOf:Re.xByMs},e.key)),
|
|
421
421
|
/* @__PURE__ */Ye("ol",{className:"rosh-tl-nodes","aria-label":x,onKeyDown:Et,children:He.map((e,t)=>{const r=t=>null!==t&&e.members.some(e=>e.key===t),n=`${oe.rail+3}px`,a=lt?xi(t,it):{},l=(e=>!!$t&&e.x>=$t.from-.5&&e.x<=$t.to+.5)(e)?" is-lit":"";if(e.mark?.isCap)/* @__PURE__ */
|
|
422
422
|
return Ye("li",{children:/* @__PURE__ */Ye("button",{...Kt(e.mark),className:`rosh-tl-node rosh-tl-mark is-cap${l}${lt?" rosh-tl-pop":""}`,style:{left:`${e.x}px`,top:n,...a}})},e.key);if(!e.mark){const t=e.kind===Ci,i=Ti(t?"default":e.kind,"key"),o=t?void 0:Fi[e.kind]?.glyph;/* @__PURE__ */
|
|
423
423
|
return Ge("li",{...r(ye)?{"aria-current":"step"}:{},children:[
|
|
424
424
|
/* @__PURE__ */Ge("button",{..._t(e),className:`${i.className} is-fold${t?" is-mixed":""}${r(c)?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...i.style,left:`${e.x}px`,top:n,...a},children:[o&&/* @__PURE__ */Ye(vi,{name:o}),t&&/* @__PURE__ */Ge("span",{"aria-hidden":"true",className:"rosh-tl-foldnum",children:["×",e.members.length]})]}),!t&&/* @__PURE__ */Ge("i",{"aria-hidden":"true",className:"rosh-tl-count"+(lt?" rosh-tl-fade":""),style:{left:`${e.x}px`,top:n},children:["×",e.members.length]})]},e.key)}const i=e.mark,o=Ti(i.kind,i.role,i.provisional),{glyph:s}=i;/* @__PURE__ */
|
|
425
|
-
return Ye("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ */Ge("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Ye(vi,{name:s}),"current"===i.role&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Ye(Qi,{groups:Le,trackPx:ie,geo:oe,startMs:e,endMs:t,currentKey:ye,hoveredKey:
|
|
425
|
+
return Ye("li",{...i.key===ye?{"aria-current":"step"}:{},children:/* @__PURE__ */Ge("button",{...Kt(i),className:`${o.className}${i.key===c?" is-active":""}${l}${lt?" rosh-tl-pop":""}`,style:{...o.style,left:`${i.x}px`,top:n,...a},children:[s&&/* @__PURE__ */Ye(vi,{name:s}),"current"===i.role&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"rosh-tl-pulse bg-blue-600"+(lt?" is-on":"")})]})},i.key)})}),"lanes"===s?/* @__PURE__ */Ye(Qi,{groups:Le,trackPx:ie,geo:oe,startMs:e,endMs:t,currentKey:ye,hoveredKey:O,reveal:lt,step:it,zoomedKey:_e,popId:ee,aimBubble:Lt,startCaptionPx:Ce,openCluster:q,setOpenCluster:H,previewCluster:U,setPreviewCluster:V,setZoomKey:G}):"active"===s?/* @__PURE__ */Ye(Ji,{nodes:He,trackPx:ie,geo:oe,activeKey:c,hoveredKey:O,currentKey:ye}):null,St&&/* @__PURE__ */Ye("div",{ref:j,id:J,role:"tooltip",className:"rosh-tl-bubble"+(St.members.some(e=>e.preview)?" is-preview":""),"data-timeline-part":"tooltip",style:{top:`${oe.rail+6+6}px`},onMouseEnter:()=>{Bt(),Rt(St.key)},onMouseLeave:()=>{It(),Wt(St.key)},onFocus:()=>{Bt(),Rt(St.key)},onBlur:()=>{It(),Wt(St.key)},children:St.mark?/* @__PURE__ */Ge(Xe,{children:[
|
|
426
426
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-name",children:St.mark.label}),
|
|
427
|
-
/* @__PURE__ */Ye("span",{className:"rosh-tl-date",children:St.mark.dateText}),St.mark.preview?/* @__PURE__ */Ye("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:St.mark.preview}):St.mark.detail&&/* @__PURE__ */Ye("span",{className:"rosh-tl-detail",children:St.mark.detail}),(St.mark.onOpen??St.mark.onClick)&&/* @__PURE__ */Ye("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(St.mark?.onOpen??St.mark?.onClick)?.(),children:
|
|
427
|
+
/* @__PURE__ */Ye("span",{className:"rosh-tl-date",children:St.mark.dateText}),St.mark.preview?/* @__PURE__ */Ye("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:St.mark.preview}):St.mark.detail&&/* @__PURE__ */Ye("span",{className:"rosh-tl-detail",children:St.mark.detail}),(St.mark.onOpen??St.mark.onClick)&&/* @__PURE__ */Ye("button",{type:"button",className:"rosh-tl-bubble-open text-blue-600","data-timeline-part":"bubble-open",onClick:()=>(St.mark?.onOpen??St.mark?.onClick)?.(),children:L.openButton})]}):
|
|
428
428
|
/* @__PURE__ */Ge("div",{className:"rosh-tl-fold-list","data-timeline-part":"fold-members",children:[
|
|
429
429
|
/* @__PURE__ */Ge("p",{className:"rosh-tl-popover-head",children:["×",St.members.length]}),
|
|
430
430
|
/* @__PURE__ */Ye("ol",{children:St.members.map(e=>/* @__PURE__ */Ge("li",{children:[
|
|
431
431
|
/* @__PURE__ */Ge("p",{className:"rosh-tl-foldrow",children:[
|
|
432
432
|
/* @__PURE__ */Ye("span",{children:e.label}),
|
|
433
433
|
/* @__PURE__ */Ye("span",{className:"rosh-tl-date",children:e.dateText})]}),e.preview?/* @__PURE__ */Ye("div",{className:"rosh-tl-preview","data-timeline-part":"preview",children:e.preview}):e.detail&&/* @__PURE__ */Ye("span",{className:"rosh-tl-detail",children:e.detail})]},e.key))})]})}),u&&null!==ct&&
|
|
434
|
-
/* @__PURE__ */Ye(eo,{thumb:u,value:ct,snap:st,axis:Re,geo:oe,startMs:e,endMs:t,trackPx:ie,layerRef:
|
|
434
|
+
/* @__PURE__ */Ye(eo,{thumb:u,value:ct,snap:st,axis:Re,geo:oe,startMs:e,endMs:t,trackPx:ie,layerRef:P,glide:ht,onScrub:h?xt:void 0,nodes:dt,onProgress:bt})]})}),N&&Ht(m?.end,!0)]}),l.length>0&&!N&&/* @__PURE__ */Ye(Hi,{pending:l,reveal:lt})]})}function no({icon:e,heading:t,subject:r,meta:n=[],actions:a,footer:l,children:i}){const o=[...r?[/* @__PURE__ */Ye("b",{children:r},"subject")]:[],...n.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
435
435
|
return Ge("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
436
436
|
/* @__PURE__ */Ge("div",{className:"rosh-tl-head",children:[
|
|
437
437
|
/* @__PURE__ */Ge("div",{className:"rosh-tl-head-main text-gray-800",children:[e&&/* @__PURE__ */Ye("span",{className:"rosh-tl-ico","aria-hidden":"true",children:e}),
|
|
@@ -468,7 +468,7 @@ return Ge("div",{className:"flex items-center gap-2",children:[
|
|
|
468
468
|
/* @__PURE__ */Ye("span",{className:"text-gray-400",children:"/"}),
|
|
469
469
|
/* @__PURE__ */Ge("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
|
|
470
470
|
/* @__PURE__ */Ye("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),h.loaded(L)]})]}):/* @__PURE__ */Ye("b",{className:"text-gray-700",children:h.volume(S)})]}),
|
|
471
|
-
/* @__PURE__ */Ge("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",A," × ",D]})]})]}):/* @__PURE__ */Ye("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var go=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,fo=e=>
|
|
471
|
+
/* @__PURE__ */Ge("span",{className:"font-medium "+(z?"text-green-600":"text-gray-500"),children:[z&&"✓ ",A," × ",D]})]})]}):/* @__PURE__ */Ye("div",{className:"text-xs text-gray-400",children:h.noVolume})]})}var go=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]+)\]\(([^)]+)\)|\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*/g,fo=e=>m(e.trim());function bo(e){const t=[];let r,n=0,a=0;for(go.lastIndex=0;null!==(r=go.exec(e));)r.index>n&&t.push(e.slice(n,r.index)),void 0!==r[1]?t.push(
|
|
472
472
|
/* @__PURE__ */Ge("span",{className:"text-gray-400",children:["[",r[1],"]"]},a++)):void 0!==r[3]?t.push(
|
|
473
473
|
/* @__PURE__ */Ye("a",{href:fo(r[4])?r[4]:void 0,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r[3]},a++)):void 0!==r[5]?t.push(
|
|
474
474
|
/* @__PURE__ */Ye("strong",{className:"font-semibold text-gray-900",children:r[5]},a++)):void 0!==r[6]?t.push(
|
|
@@ -523,41 +523,43 @@ return Ge("div",{children:[
|
|
|
523
523
|
return Ge("div",{className:`flex h-12 shrink-0 items-stretch gap-1 border-b border-gray-200 bg-white px-3 ${l??""}`,children:[n&&/* @__PURE__ */Ye("div",{className:"mr-1 flex items-center gap-2 pr-3 font-semibold text-gray-900",children:n}),
|
|
524
524
|
/* @__PURE__ */Ye("nav",{className:"flex items-stretch gap-0.5",children:e.map(e=>{const n=e.key===t;/* @__PURE__ */
|
|
525
525
|
return Ge("button",{type:"button",disabled:e.disabled,"aria-current":n?"page":void 0,onClick:()=>!e.disabled&&r?.(e.key),className:"relative inline-flex items-center gap-2 px-3 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40 "+(n?"text-blue-600":"text-gray-600 hover:text-gray-900"),children:[e.icon&&/* @__PURE__ */Ye("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
526
|
-
/* @__PURE__ */Ye("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Ye("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */Ye("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Ye("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Eo=/(^|[\s:])!?z-/,Bo=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function To({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Ee(!1),[g,f]=Ee(-1),b=Be(null),x=Be(null),y=Be(null),v=Be({text:"",at:0}),w=ze(),N=ze(),k=u??N,$=Fe(e=>{p(!1),e&&x.current?.focus()},[]),
|
|
527
|
-
return Ye("div",{role:"separator",children:/* @__PURE__ */Ye(
|
|
528
|
-
return Ye("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */Ye(
|
|
529
|
-
return Ge("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...
|
|
530
|
-
/* @__PURE__ */Ye(
|
|
531
|
-
return Ge("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>
|
|
532
|
-
/* @__PURE__ */Ye(
|
|
533
|
-
return Ge("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>
|
|
526
|
+
/* @__PURE__ */Ye("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */Ye("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),n&&/* @__PURE__ */Ye("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]},e.key)})}),a&&/* @__PURE__ */Ye("div",{className:"ml-auto flex items-center gap-2",children:a})]})}var Eo=/(^|[\s:])!?z-/,Bo=e=>!!e&&"label"!==e.type&&"divider"!==e.type&&!e.disabled;function To({trigger:e,items:t,align:r="end",side:n="bottom","aria-label":a,className:l="",triggerClassName:i,menuClassName:o="",minWidth:s=180,linkAs:c,disabled:d,id:u,"aria-describedby":h}){const[m,p]=Ee(!1),[g,f]=Ee(-1),b=Be(null),x=Be(null),y=Be(null),v=Be({text:"",at:0}),w=ze(),N=ze(),k=u??N,$=Fe(e=>{p(!1),e&&x.current?.focus()},[]),C=(e,r)=>{const n=t.length;for(let a=0;a<n;a+=1){const l=((e+r*a)%n+n)%n;if(Bo(t[l]))return l}return-1},L=()=>y.current?.closest("[data-popup-menu-tree]")??null;Ie(()=>{if(!m)return;const e=e=>{const t=e.target;b.current?.contains(t)||L()?.contains(t)||$(!1)};document.addEventListener("pointerdown",e,!0);const t=ee(()=>$(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[m,$]);const j=Fe(()=>{const e=L(),t=x.current;if(!e||!t)return;const a=e.style;a.left="0px",a.top="0px",a.maxWidth="none",a.maxHeight="none";const l={width:e.offsetWidth,height:e.offsetHeight},i=_({trigger:t.getBoundingClientRect(),menu:l,bounds:W(t),align:r,side:n});a.left=`${i.left}px`,a.top=`${i.top}px`,a.maxWidth=`${i.maxWidth}px`,a.maxHeight=`${i.maxHeight}px`,a.overflowY=l.height>i.maxHeight?"auto":"",e.dataset.side=i.side,e.dataset.align=r},[r,n]);re(()=>{m&&j()}),Ie(()=>{if(m)return q(()=>x.current,j)},[m,j]),Ie(()=>{if(!m)return;const e=y.current,r=Bo(t[g])?e?.querySelector(`[data-dropdown-index="${g}"]`):null;(r??e)?.focus({preventScroll:!0})},[m,g]),Ie(()=>{if(m)return Q(e=>"Escape"===e.key&&($(!0),!0),()=>y.current)},[m,$]);const z=e=>{f(e),p(!0)},F=e=>{e.disabled||($(!0),e.onSelect())},E=c??"a",B=(e,t)=>({"data-dropdown-index":e,tabIndex:e===g?0:-1,onMouseEnter:()=>{t.disabled||f(e)}}),T=(e,t)=>{if("divider"===e.type)/* @__PURE__ */
|
|
527
|
+
return Ye("div",{role:"separator",children:/* @__PURE__ */Ye(S,{})},e.key);if("label"===e.type)/* @__PURE__ */
|
|
528
|
+
return Ye("div",{id:`${w}-label-${t}`,children:/* @__PURE__ */Ye(D,{children:e.label})},e.key);if("checkbox"===e.type){const r=P(!1,e.disabled,"");/* @__PURE__ */
|
|
529
|
+
return Ge("button",{type:"button",role:"menuitemcheckbox","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>(e=>{e.disabled||e.onSelect()})(e),...B(t,e),children:[
|
|
530
|
+
/* @__PURE__ */Ye(A,{kind:"checkbox",checked:e.checked}),e.icon,e.label]},e.key)}if("radio"===e.type){const r=P(!1,e.disabled,"");/* @__PURE__ */
|
|
531
|
+
return Ge("button",{type:"button",role:"menuitemradio","aria-checked":e.checked,disabled:e.disabled,className:r.className,style:r.style,onClick:()=>F(e),...B(t,e),children:[
|
|
532
|
+
/* @__PURE__ */Ye(A,{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=P(!1,e.disabled,"no-underline "+(e.current?"font-medium":""));return e.disabled?/* @__PURE__ */Ge("a",{role:"menuitem","aria-disabled":"true",className:r.className,style:r.style,...B(t,e),children:[e.icon,e.label]},e.key):/* @__PURE__ */Ge(E,{href:e.href,role:"menuitem","aria-current":e.current?"page":void 0,className:r.className,style:r.style,onClick:()=>$(!0),...B(t,e),children:[e.icon,e.label]},e.key)}const r=P(e.danger,e.disabled,"");/* @__PURE__ */
|
|
533
|
+
return Ge("button",{type:"button",role:"menuitem",disabled:e.disabled,className:r.className,style:r.style,onClick:()=>F(e),...B(t,e),children:[e.icon,e.label]},e.key)},I={...Eo.test(o)?{}:{zIndex:te.popup},minWidth:s};/* @__PURE__ */
|
|
534
534
|
return Ge("div",{ref:b,className:`relative inline-flex ${l}`.trim(),children:[
|
|
535
|
-
/* @__PURE__ */Ye("button",{ref:x,id:k,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?$(!1):
|
|
536
|
-
/* @__PURE__ */Ye(
|
|
537
|
-
/* @__PURE__ */Ye("div",{ref:s,role:"toolbar","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:{...J(),position:"fixed",left:0,top:0,zIndex:te.popup},children:l}),document.body):null}function Ro(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function Wo({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Be(null),[c,d]=Ee(null),u=Be(t);u.current=t,re(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=
|
|
538
|
-
return Ye(
|
|
535
|
+
/* @__PURE__ */Ye("button",{ref:x,id:k,type:"button","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?w:void 0,"aria-label":a,"aria-describedby":h,disabled:d,onClick:()=>m?$(!1):z(C(0,1)),onKeyDown:e=>{"ArrowDown"===e.key||"Enter"===e.key||" "===e.key?(e.preventDefault(),z(C(0,1))):"ArrowUp"===e.key&&(e.preventDefault(),z(C(t.length-1,-1)))},className:i??"inline-flex items-center justify-center rounded-(--radius-control) text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] disabled:cursor-not-allowed disabled:opacity-60 "+(a?"h-8 min-w-8 px-0":"h-8 min-w-8 gap-2 px-3"),children:e}),m&&
|
|
536
|
+
/* @__PURE__ */Ye(M,{portal:!0,className:o,style:I,children:/* @__PURE__ */Ye("div",{ref:y,id:w,role:"menu","aria-orientation":"vertical","aria-label":a,"aria-labelledby":a?void 0:k,tabIndex:-1,onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(C(g+1,1));else if("ArrowUp"===e.key)e.preventDefault(),f(C(g-1,-1));else if("Home"===e.key)e.preventDefault(),f(C(0,1));else if("End"===e.key)e.preventDefault(),f(C(t.length-1,-1));else if("Tab"===e.key)e.preventDefault(),$(!0);else if(" "===e.key){const t=e.target;t.matches?.("a[href]")&&(e.preventDefault(),t.click())}else 1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e=>{const r=Date.now(),n=e.key.toLowerCase(),a=r-v.current.at<500?v.current.text+n:n;v.current={text:a,at:r};const l=[...a].every(e=>e===a[0]),i=l?a[0]:a,o=l?g+1:Math.max(g,0),s=y.current,c=t.length;for(let r=0;r<c;r+=1){const n=((o+r)%c+c)%c;if(Bo(t[n])&&(s?.querySelector(`[data-dropdown-index="${n}"]`)?.textContent?.trim().toLowerCase()??"").startsWith(i))return e.preventDefault(),void f(n)}})(e)},children:(()=>{const e=[];for(let r=0;r<t.length;){const n=t[r];if("radio"!==n.type&&"checkbox"!==n.type){e.push(T(n,r)),r+=1;continue}const a=n.type,l=r,i=[];for(;r<t.length&&t[r].type===a;)i.push(T(t[r],r)),r+=1;const o="label"===t[l-1]?.type?`${w}-label-${l-1}`:void 0;e.push(/* @__PURE__ */Ye("div",{role:"group","aria-labelledby":o,children:i},`group:${n.key}`))}return e})()})})]})}var Io=()=>({left:0,top:0,right:window.innerWidth,bottom:window.innerHeight});function Oo({anchor:e,bounds:t,side:r="top",align:n="start","aria-label":a,children:l,className:i=""}){const o=ae(),s=Be(null),c=Be(e);c.current=e;const d=Be(t);d.current=t;const u=Fe(()=>{const e=s.current,t=c.current();if(!e||!t)return;const a=(d.current??Io)(),l=e.style;l.maxWidth=`${Math.max(0,a.right-a.left-2*K)}px`;const i=_({trigger:t,menu:{width:e.offsetWidth,height:e.offsetHeight},bounds:a,align:n,side:r});l.left=`${i.left}px`,l.top=`${i.top}px`,e.dataset.side=i.side},[n,r]);re(()=>{o&&u()}),Ie(()=>{if(!o)return;const e=U(()=>c.current(),u),t=s.current;if(!t||"undefined"==typeof ResizeObserver)return e;const r=new ResizeObserver(()=>u());return r.observe(t),()=>{e(),r.disconnect()}},[o,u]);return o&&e()?Ze(
|
|
537
|
+
/* @__PURE__ */Ye("div",{ref:s,role:"toolbar","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:{...J(),position:"fixed",left:0,top:0,zIndex:te.popup},children:l}),document.body):null}function Ro(e){return e?[...e.querySelectorAll("button:not([disabled])")].filter(e=>!e.closest("[data-popup-submenu-panel]")):[]}function Wo({at:e,onClose:t,children:r,owner:n,"aria-label":a,minWidth:l=180,className:i="",autoFocus:o=!0}){const s=Be(null),[c,d]=Ee(null),u=Be(t);u.current=t,re(()=>{const t=s.current?.closest("[data-popup-menu-tree]");if(!t)return;const r={width:t.offsetWidth,height:t.offsetHeight},a=V({point:e,menu:r,bounds:W(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=Be(null),m=Be(!1);Ie(()=>(h.current=document.activeElement,()=>{const e=document.activeElement;e&&e!==document.body&&!s.current?.contains(e)||h.current?.focus?.({preventScroll:!0})}),[]),Ie(()=>{c&&!m.current&&o&&(m.current=!0,Ro(s.current)[0]?.focus({preventScroll:!0}))},[c,o]),Ie(()=>{if(o)return;const e=e=>{if(s.current?.contains(document.activeElement))return;const t=Ro(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]),Ie(()=>Q(e=>"Escape"===e.key&&(u.current(),!0),()=>s.current),[]),Ie(()=>{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=Fe(e=>{if(e.target.closest("[data-popup-submenu-panel]"))return;if("Tab"===e.key)return e.preventDefault(),void u.current();const t=Ro(s.current);if(0===t.length)return;const r=t.indexOf(document.activeElement),n="ArrowDown"===e.key?(r+1)%t.length:"ArrowUp"===e.key?r<=0?t.length-1:r-1:"Home"===e.key?0:"End"===e.key?t.length-1:-1;n<0||(e.preventDefault(),t[n].focus())},[]),g=c?{left:c.left,top:c.top,maxHeight:c.maxHeight,...c.scroll?{overflowY:"auto"}:{}}:{left:e.x,top:e.y,visibility:"hidden"};/* @__PURE__ */
|
|
538
|
+
return Ye(M,{portal:!0,minWidth:l,style:g,onClose:t,className:i,children:/* @__PURE__ */Ye(C.Provider,{value:!0,children:/* @__PURE__ */Ye("div",{ref:s,role:"menu","aria-label":a,"data-context-menu":"",onKeyDown:p,children:r})})})}function Ko(){const[e,t]=Ee(null),r=Fe(()=>t(null),[]),n=Fe((e,r)=>{const n="nativeEvent"in e?e.nativeEvent:e;if(L(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=Fe(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 _o="Alt+ArrowUp Alt+ArrowDown";function qo(e){return!e.altKey||e.ctrlKey||e.metaKey?null:"ArrowUp"===e.key?"up":"ArrowDown"===e.key?"down":null}var Ho=/* @__PURE__ */Ge("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
539
539
|
/* @__PURE__ */Ye("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
540
540
|
/* @__PURE__ */Ye("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
541
541
|
/* @__PURE__ */Ye("circle",{cx:"2",cy:"11",r:"1.1"})]});function Uo({hint:e,dragging:t,revealClassName:r,marker:n}){const a=he().tree;/* @__PURE__ */
|
|
542
|
-
return Ye(
|
|
542
|
+
return Ye(R,{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__ */Ye("span",{"aria-hidden":"true",[`data-${n}-grip`]:"",className:"flex h-full w-2 items-center justify-center text-[color:var(--ink-faintest)]",children:Ho})})}function Vo({id:e}){/* @__PURE__ */
|
|
543
543
|
return Ye("span",{id:e,hidden:!0,children:he().tree.moveHint})}var Yo='[role="treeitem"]';function Go(e){return[...e.querySelectorAll(Yo)].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 Xo({"aria-label":e,"aria-labelledby":t,children:r,className:n="",rootProps:a}){const l=Be(null);re(()=>{const e=l.current;if(!e)return;const t=[...e.querySelectorAll(Yo)];if(0===t.length)return;const r=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-selected"))??Go(e)[0]??t[0];for(const e of t)e.tabIndex=e===r?0:-1});const i=Fe(e=>{a?.onKeyDown?.(e);const t=l.current,r=e.target.closest?.(Yo);if(!t||!r||e.target!==r||e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;const n=Go(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(Yo))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__ */
|
|
544
544
|
return Ye("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 Zo({children:e,hidden:t,className:r=""}){/* @__PURE__ */
|
|
545
|
-
return Ye("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 Jo=["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","bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600"].join(" ");function Qo({children:e,count:t,expanded:r,onToggle:
|
|
546
|
-
/* @__PURE__ */Ye("span",{"
|
|
547
|
-
/* @__PURE__ */Ye("span",{"aria-hidden":"true",
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
/* @__PURE__ */Ye(
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */Ge("span",{
|
|
545
|
+
return Ye("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 Jo=["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","bg-[color:color-mix(in_srgb,var(--ink-faint)_12%,transparent)] text-gray-600"].join(" ");function Qo({children:e,count:t,expanded:r,onToggle:a}){const l=void 0!==r,i=
|
|
546
|
+
/* @__PURE__ */Ye("span",{"data-tree-label-text":"",className:"flex min-w-0 flex-1 text-left",children:/* @__PURE__ */Ye(n,{children:e})}),o=null!=t&&!1!==t&&/* @__PURE__ */Ye("span",{"data-tree-count":"",className:Jo,children:t}),s="text-xs font-semibold uppercase tracking-wide text-gray-500";return l?/* @__PURE__ */Ye("div",{role:"presentation",className:"pb-1 pt-3",children:/* @__PURE__ */Ge("button",{type:"button","aria-expanded":r,onClick:a,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)]",s].join(" "),children:[
|
|
547
|
+
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-tree-caret":"",className:"flex h-4 w-4 shrink-0 items-center justify-center",children:es(!!r)}),i,o]})}):/* @__PURE__ */Ge("div",{role:"presentation",className:`flex items-center gap-2 px-2 pb-1 pt-3 ${s}`,children:[
|
|
548
|
+
/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),i,o]})}var es=e=>/* @__PURE__ */Ye(Pe,{name:"chevron-right","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3 transition-transform "+(e?"rotate-90":"")}),ts={backgroundColor:"inherit",maskImage:"linear-gradient(to right, transparent, black 12px)",WebkitMaskImage:"linear-gradient(to right, transparent, black 12px)"};function rs({label:e,level:t=1,icon:r,preview:a,selected:l=!1,expanded:i,onToggle:o,onSelect:s,muted:c=!1,badge:d,actions:u,actionsPinned:h=!1,actionsOverlay:m=!0,rename:p,drop:g,dragging:f=!1,draggable:b=!1,dragHint:x,onMove:y,rowProps:v,className:w=""}){const N=void 0!==i,k=ze(),$=[v?.["aria-describedby"],y?k:void 0].filter(Boolean).join(" ")||void 0,M=l?"bg-blue-50 text-blue-700":"into"===g?"bg-blue-50 text-gray-900":"text-gray-700 hover:bg-gray-100";/* @__PURE__ */
|
|
549
|
+
return Ge("div",{...v,role:"treeitem","aria-level":t,"aria-selected":l,"aria-expanded":N?i:void 0,tabIndex:l?0:-1,"aria-keyshortcuts":v?.["aria-keyshortcuts"]??(y?_o:void 0),"aria-describedby":$,"data-drop":g,"data-draggable":b||void 0,onKeyDown:e=>{if(v?.onKeyDown?.(e),e.target!==e.currentTarget||e.defaultPrevented)return;const t=qo(e);t&&y?(e.preventDefault(),y(t)):"Enter"!==e.key&&" "!==e.key||!s?("ArrowRight"===e.key&&N&&!i&&o||"ArrowLeft"===e.key&&N&&i&&o)&&(e.preventDefault(),o()):(e.preventDefault(),s())},onClick:e=>{v?.onClick?.(e),e.defaultPrevented||s?.()},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"===g?"ring-2 ring-inset ring-[color:var(--rosh-drop-ring)]":"",f?"opacity-40":"",w].filter(Boolean).join(" "),children:["before"===g&&/* @__PURE__ */Ye("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"===g&&/* @__PURE__ */Ye("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&&
|
|
550
|
+
/* @__PURE__ */Ye(Uo,{marker:"tree",hint:x,dragging:f,revealClassName:"group-hover/treerow:opacity-100"}),
|
|
551
|
+
/* @__PURE__ */Ye("span",N?{"aria-hidden":"true","data-tree-caret":"",onClick:e=>{e.stopPropagation(),o?.()},className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-gray-500 hover:bg-gray-200 hover:text-gray-900",children:es(!!i)}:{"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),null!=r&&/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"flex h-4 w-4 shrink-0 items-center justify-center "+(c?"text-gray-400":""),children:r}),
|
|
552
|
+
/* @__PURE__ */Ge("span",{className:"relative flex min-w-0 flex-1 items-center gap-2",children:[p??
|
|
553
|
+
/* @__PURE__ */Ye("span",{className:`flex min-w-0 ${l?"font-semibold":"font-medium"} ${c?"text-gray-400 line-through":""}`,children:/* @__PURE__ */Ge(n,{children:[e,null!=a&&/* @__PURE__ */Ye("span",{className:"ml-2 font-normal text-gray-500",children:a})]})}),null!=d&&!1!==d&&/* @__PURE__ */Ye("span",{"data-tree-count":"",className:Jo,children:d}),null!=u&&!m&&/* @__PURE__ */Ye("span",{"data-tree-actions":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"ml-auto flex shrink-0 items-center gap-0.5 transition-opacity "+(h||c?"opacity-100":"opacity-0 group-hover/treerow:opacity-100 group-focus-within/treerow:opacity-100"),children:u})]}),null!=u&&m&&
|
|
554
|
+
/* @__PURE__ */Ge("span",{"data-tree-actions":"","data-tree-actions-overlay":"",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),style:ts,className:"absolute inset-y-0 right-0 grid rounded-r-md transition-opacity "+(h||c||l?"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:[
|
|
553
555
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-tree-actions-scrim":"",className:"col-start-1 row-start-1",style:{background:"var(--rosh-tree-ground, var(--surface))"}}),
|
|
554
556
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"col-start-1 row-start-1",style:{backgroundColor:"inherit"}}),
|
|
555
|
-
/* @__PURE__ */Ye("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:
|
|
557
|
+
/* @__PURE__ */Ye("span",{className:"col-start-1 row-start-1 flex items-center gap-0.5 pl-4 pr-2",children:u})]}),y&&/* @__PURE__ */Ye(Vo,{id:k})]})}function ns({onAdd:e,label:t,drop:r=!1,slotProps:n}){const a=he().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__ */
|
|
556
558
|
return Ye("div",{...n,role:"presentation","data-drop":r||void 0,children:e?/* @__PURE__ */Ge("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:[
|
|
557
559
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",children:"+"}),l]}):/* @__PURE__ */Ye("span",{className:i,children:l})})}function as({onInsert:e,label:t,drop:r=!1,seamProps:n}){const a=he().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__ */
|
|
558
560
|
return Ge("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:[
|
|
559
561
|
/* @__PURE__ */Ye("span",{"aria-hidden":"true",className:"absolute inset-x-0 -bottom-1 -top-1"}),
|
|
560
|
-
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */Ye(
|
|
562
|
+
/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-tree-seam-line":"",className:`pointer-events-none absolute inset-x-2 top-1/2 h-0.5 -translate-y-1/2 rounded-full bg-blue-500 transition-opacity ${i}`}),e&&/* @__PURE__ */Ye(R,{content:l,className:"absolute left-1/2 top-1/2 inline-flex -translate-x-1/2 -translate-y-1/2",children:/* @__PURE__ */Ye("button",{type:"button","aria-label":l,onClick:e,className:"flex h-5 w-5 items-center justify-center rounded-full bg-blue-600 text-white transition rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(r?"scale-75 opacity-0":"scale-75 opacity-0 group-hover/seam:scale-100 group-hover/seam:opacity-100 focus-visible:scale-100 focus-visible:opacity-100"),children:/* @__PURE__ */Ye(Pe,{name:"add","aria-hidden":"true",strokeWidth:2.6,className:"h-3 w-3"})})})]})}var ls=Oe("compact");function is({"aria-label":e,"aria-labelledby":t,children:r,spacing:n="compact",className:a="",rootProps:l}){/* @__PURE__ */
|
|
561
563
|
return Ye(ls.Provider,{value:n,children:/* @__PURE__ */Ye("div",{...l,role:"list","aria-label":t?void 0:e,"aria-labelledby":t,"data-sortable-list":n,className:`flex min-w-0 flex-col ${"comfortable"===n?"gap-2":"gap-1"} ${a}`.trim(),children:r})})}function os({children:e,actions:t,below:r,active:n=!1,flat:a=!1,draggable:l=!1,dragHint:i,dragging:o=!1,drop:s,onMove:c,rowProps:d,rowRef:u,className:h=""}){const m=_e(ls),p=Be(null),g=ze(),f=[d?.["aria-describedby"],c?g:void 0].filter(Boolean).join(" ")||void 0,b=d?.tabIndex;re(()=>{const e=p.current;if(!e||void 0!==b)return;const t=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(t=>t!==e);c&&!t?e.tabIndex=0:e.removeAttribute("tabindex")});/* @__PURE__ */
|
|
562
564
|
return Ge("div",{role:"listitem","data-list-item":"","data-drop":s,className:"relative flex min-w-0 flex-col",children:[s&&/* @__PURE__ */Ye("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${("comfortable"===m?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"})[s]}`}),
|
|
563
565
|
/* @__PURE__ */Ge("div",{...d,ref:e=>{var t,r;p.current=e,r=e,"function"==typeof(t=u)?t(r):t&&(t.current=r)},"data-list-row":"","data-active":n||void 0,"data-draggable":l||void 0,"aria-keyshortcuts":d?.["aria-keyshortcuts"]??(c?_o:void 0),"aria-describedby":f,onKeyDown:e=>{if(d?.onKeyDown?.(e),e.defaultPrevented||!c)return;const t=qo(e);t&&!e.target.closest?.("select")&&(e.preventDefault(),c(t))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md pl-3 text-sm",l?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=t&&!1!==t?"":"pr-2",n?"bg-gray-100":a?"":"hover:bg-gray-100",o?"opacity-40":"",h].filter(Boolean).join(" "),children:[l&&/* @__PURE__ */Ye(Uo,{marker:"list",hint:i,dragging:o,revealClassName:"group-hover/listrow:opacity-100 group-focus-within/listrow:opacity-100"}),
|
|
@@ -565,14 +567,14 @@ return Ge("div",{role:"listitem","data-list-item":"","data-drop":s,className:"re
|
|
|
565
567
|
return Ye("div",{ref:o,role:"toolbar","aria-label":e,"aria-orientation":t,"data-orientation":t,onKeyDown:e=>{const r=o.current;if(!r)return;const n=[...r.querySelectorAll(cs)],a=n.indexOf(e.target);if(a<0)return;const l="vertical"===t?"ArrowUp":"ArrowLeft",i="vertical"===t?"ArrowDown":"ArrowRight",s=e.key===i?(a+1)%n.length:e.key===l?(a-1+n.length)%n.length:"Home"===e.key?0:"End"===e.key?n.length-1:-1;if(!(s<0)){e.preventDefault();for(const e of n)e.tabIndex=e===n[s]?0:-1;n[s].focus()}},"data-labels":"none"===a?void 0:a,"data-labels-shown":"none"===a?void 0:u,className:`flex gap-1 ${"vertical"===t?"flex-col items-center":"flex-row items-center"} ${n}`.trim(),children:/* @__PURE__ */Ye(ss.Provider,{value:{labels:a,shown:u},children:r})})}function hs({label:e,icon:t,active:r,disabled:n,onClick:a,badge:l,tooltipSide:i="right",className:o=""}){const s=!0===r,{labels:c,shown:d}=_e(ss),u=void 0===l||!1===l||0===l?t:/* @__PURE__ */Ye(vl,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:t}),h="none"!==c,m=h&&("all"===d||"chosen"===d&&s),p=/* @__PURE__ */Ye("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof r?r:void 0,disabled:n,onClick:n?void 0:a,className:[`relative inline-flex ${h?"beside"===c?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",s?"bg-blue-50 text-blue-700":"text-gray-600 hover:bg-gray-100 hover:text-gray-900",o].filter(Boolean).join(" "),children:h?/* @__PURE__ */Ge(Xe,{children:[
|
|
566
568
|
/* @__PURE__ */Ye("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:u}),
|
|
567
569
|
/* @__PURE__ */Ye("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",m?"beside"===c?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):u});/* @__PURE__ */
|
|
568
|
-
return Ye(
|
|
569
|
-
return Ye("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Ge(jl,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */Ye(
|
|
570
|
+
return Ye(R,{content:e,side:i,children:p})}var ms=6e4;function ps({currentVersion:e,versionUrl:t="/version.json",pollMs:r=6e4}){const[n,a]=Ee(null);return Ie(()=>{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 gs({currentVersion:e,versionUrl:t,pollMs:r,message:n,onRefresh:a,className:l=""}){const i=ps({currentVersion:e,versionUrl:t,pollMs:r}),o=he();if(null===i)return null;const s=a??(()=>window.location.reload());/* @__PURE__ */
|
|
571
|
+
return Ye("div",{"data-app-update-banner":"",className:`fixed left-1/2 top-3 z-(--z-toast) w-max max-w-[calc(100vw-1.5rem)] -translate-x-1/2 ${l}`.trim(),children:/* @__PURE__ */Ge(jl,{tone:"warning",className:"shadow-lg",action:/* @__PURE__ */Ye(O,{type:"button",variant:"primary",size:"md",onClick:s,children:o.update.refreshNow}),children:[
|
|
570
572
|
/* @__PURE__ */Ye("span",{className:"font-medium",children:n??o.update.available}),
|
|
571
573
|
/* @__PURE__ */Ge("span",{className:"ml-2 whitespace-nowrap font-mono text-xs text-gray-500",children:[e," → ",i]})]})})}var fs={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},bs={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function xs({onClose:e}){const t=he().dialog;/* @__PURE__ */
|
|
572
|
-
return Ye("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */Ye(Pe,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function ys({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=Be(null),g=ze(),f=ze(),b=ze();if(
|
|
574
|
+
return Ye("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */Ye(Pe,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function ys({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=Be(null),g=ze(),f=ze(),b=ze();if(j(e),w(p,e,c),N(e),Ie(()=>{if(e)return Q(()=>(s||t(),!0),()=>p.current)},[e,s,t]),!e)return null;const x="bottom"===r,y=x?{maxHeight:"85vh"}:void 0;/* @__PURE__ */
|
|
573
575
|
return Ge("div",{className:"fixed inset-0",style:{zIndex:te.overlay},role:"presentation",children:[
|
|
574
576
|
/* @__PURE__ */Ye("div",{className:"fixed inset-0 bg-black/30",onClick:s?void 0:t,"aria-hidden":"true"}),
|
|
575
|
-
/* @__PURE__ */Ge("div",{ref:p,...
|
|
577
|
+
/* @__PURE__ */Ge("div",{ref:p,...k({modal:!0,titleId:a?b:void 0,labelledBy:u,label:d}),"aria-describedby":h??(l?f:o?g:void 0),style:y,className:["fixed flex flex-col bg-white shadow-xl",x?"":`w-full max-w-full ${fs[n]}`,bs[r],x?"rounded-t-xl":"",m].filter(Boolean).join(" "),children:[a?/* @__PURE__ */Ge("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
576
578
|
/* @__PURE__ */Ge("div",{className:"min-w-0",children:[
|
|
577
579
|
/* @__PURE__ */Ye("h2",{id:b,className:"text-base font-semibold text-gray-900",children:a}),l&&/* @__PURE__ */Ye("p",{id:f,className:"mt-0.5 text-sm text-gray-500",children:l})]}),!s&&/* @__PURE__ */Ye(xs,{onClose:t})]}):!s&&/* @__PURE__ */Ye("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */Ye(xs,{onClose:t})}),
|
|
578
580
|
/* @__PURE__ */Ge("div",{id:g,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[l&&!a&&/* @__PURE__ */Ye("p",{id:f,className:("mb-3 text-sm text-gray-500 "+(s?"":"pr-8")).trim(),children:l}),o]}),i&&/* @__PURE__ */Ye("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:i})]})]})}function vs({items:e,columns:t,columnOf:r,getId:n,onMove:a,renderCard:l,onCardClick:i,sortInColumn:o,isLoading:s=!1,loadingText:c,emptyState:d,showColumnsWhenEmpty:u=!1,columnEmptyText:h,onAddItem:m,addItemText:p}){const g=he().kanban,f=ue(),b=c??g.loading,x=h??g.dropHere,y=p??g.addItem,[v,w]=Ee(null),[N,k]=Ee(null),$=Te(()=>{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=Be(null),L=Be(/* @__PURE__ */new Map);re(()=>{if(null!==v)return;const e=C.current;if(!e)return;const t=/* @__PURE__ */new Map,r=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const n=e.dataset.kanbanCard,a=e.getBoundingClientRect();t.set(n,a);const l=L.current.get(n);if(l){const t=l.left-a.left,n=l.top-a.top;(t||n)&&r.push([e,t,n])}}),L.current=t,r.length){for(const[e,t,n]of r)e.style.transition="none",e.style.transform=`translate(${t}px, ${n}px)`;requestAnimationFrame(()=>{for(const[e]of r)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[$,v]);return s?/* @__PURE__ */Ye("div",{className:"text-sm text-gray-500 p-4",children:b}):0!==e.length||u?/* @__PURE__ */Ye("div",{ref:C,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */Ye("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__ */
|
|
@@ -611,7 +613,7 @@ return Ge(Xe,{children:[i,d?`${d} — `:"",c?null!=n?o.allLoaded(s,a):o.count(s,
|
|
|
611
613
|
return Ge("div",{className:`flex flex-col items-center justify-center text-center ${"card"===n?"rounded-md border border-gray-200 bg-white px-6 py-12":"none"===n?"px-6 py-12":"rounded-lg border-2 border-dashed border-red-200 px-6 py-12"}`,role:"alert",children:[
|
|
612
614
|
/* @__PURE__ */Ye(Pe,{name:"warning",className:"h-10 w-10 text-red-300 mb-3",strokeWidth:1,"aria-hidden":"true"}),
|
|
613
615
|
/* @__PURE__ */Ye("h3",{className:"text-sm font-medium text-gray-900",children:e??a.loadError}),
|
|
614
|
-
/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */Ye("div",{className:"mt-4",children:/* @__PURE__ */Ye(
|
|
616
|
+
/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500 mt-2",children:t??a.loadErrorMessage}),r&&/* @__PURE__ */Ye("div",{className:"mt-4",children:/* @__PURE__ */Ye(O,{variant:"secondary",size:"sm",onClick:r,children:a.retry})})]})}function Fs({data:e,width:t=120,height:r=32,stroke:n="currentColor",fill:a,strokeWidth:l=1.5,showDots:i=!1,className:o,style:s}){if(0===e.length)return null;const c=Math.max(...e),d=Math.min(...e),u=c-d||1,h=l+(i?2:0),m=e=>r-h-(e-d)/u*(r-2*h),p=1===e.length?[[0,r/2],[t,r/2]]:e.map((r,n)=>[n*t/(e.length-1),m(r)]),g=p.map(([e,t],r)=>`${0===r?"M":"L"}${e.toFixed(2)},${t.toFixed(2)}`).join(" "),f=`${g} L${t.toFixed(2)},${r} L0,${r} Z`;/* @__PURE__ */
|
|
615
617
|
return Ge("svg",{className:o,style:s,width:t,height:r,viewBox:`0 0 ${t} ${r}`,preserveAspectRatio:"none",role:"img","aria-hidden":"true",children:[a&&/* @__PURE__ */Ye("path",{d:f,fill:a,stroke:"none"}),
|
|
616
618
|
/* @__PURE__ */Ye("path",{d:g,fill:"none",stroke:n,strokeWidth:l,strokeLinejoin:"round",strokeLinecap:"round"}),i&&p.map(([e,t],r)=>/* @__PURE__ */Ye("circle",{cx:e,cy:t,r:l+.5,fill:n},r))]})}var Es=8,Bs=["var(--viz-series-1)","var(--viz-series-2)","var(--viz-series-3)","var(--viz-series-4)","var(--viz-series-5)","var(--viz-series-6)","var(--viz-series-7)","var(--viz-series-8)"],Ts={good:"var(--viz-good)",neutral:"var(--viz-neutral)",warning:"var(--viz-warning)",serious:"var(--viz-serious)",critical:"var(--viz-critical)"},Is={grid:"var(--viz-grid)",axis:"var(--viz-axis)",label:"var(--viz-label)",muted:"var(--viz-muted)",surface:"var(--viz-surface)"};function Os(e){return Bs[e]??Is.muted}function Rs(e,t,r){return t||(r?Ts[r]:Os(e))}function Ws(e,t={},r=8){const n={},a=/* @__PURE__ */new Set,l=/* @__PURE__ */new Set;for(const r of e){const e=t[r];void 0===e||a.has(e)||(n[r]=e,a.add(e)),l.add(r)}const i=0===Object.keys(t).length;for(const l of e){if(void 0!==n[l])continue;if(!i&&l in t)continue;const e=Array.from({length:r},(e,t)=>t).find(e=>!a.has(e));if(void 0===e)break;n[l]=e,a.add(e)}return n}function Ks(e,t,r=8){if(void 0!==e[t]){const{[t]:r,...n}=e;return n}const n=new Set(Object.values(e)),a=Array.from({length:r},(e,t)=>t).find(e=>!n.has(e));return void 0===a?e:{...e,[t]:a}}function _s(e,t,r,n){return r||n?Rs(e,r,n):e<t?Os(e):Is.muted}function qs(e,t){const[r,n]=e,a=n-r,l=e=>0===a?t.from:t.from+(e-r)/a*(t.to-t.from);return l.domain=e,l.range=t,l.ticks=e=>e<2?[r]:Array.from({length:e},(t,n)=>r+a*n/(e-1)),l}function Hs(e,t,r=0){const n=e>0?(t.to-t.from)/e:0,a=n*r,l=e=>t.from+e*n+a/2;return l.bandwidth=Math.max(0,n-a),l.center=e=>t.from+e*n+n/2,l.end=e=>t.from+(e+1)*n-a/2,l.count=e,l}function Us(e,t){const r=[...e].sort((e,t)=>e-t),n=Math.max(0,r.length-1),a=e=>0===n?t.from:t.from+e/n*(t.to-t.from),l=e=>{const t=r.indexOf(e);if(t>=0)return a(t);const l=r.findIndex(t=>t>=e);return a(-1===l?n:l)};return l.levels=r,l.indexOf=e=>r.indexOf(e),l.range=t,l}function Vs(e){if(!Number.isFinite(e)||e<=0)return 1;const t=10**Math.floor(Math.log10(e)),r=e/t;return(r<=1?1:r<=2?2:r<=2.5?2.5:r<=5?5:10)*t}function Ys(e,t,{intervals:r=5,integer:n=!1,zero:a=!0}={}){const l=a?Math.min(0,e):e,i=a?Math.max(0,t):Math.max(e,t);if(!Number.isFinite(l)||!Number.isFinite(i)||i-l<=0){const e=Number.isFinite(l)&&!a?l:0;return{lo:e,hi:e+1,ticks:[e,e+1]}}const o=Math.max(1,Math.floor(r));let s=10**Math.floor(Math.log10((i-l)/o));for(;;){for(const e of[1,2,2.5,5]){const t=e*s;if(n&&!Number.isInteger(t))continue;const r=Math.floor(l/t)*t,a=Math.ceil(i/t)*t,c=Math.round((a-r)/t);if(c<=o){const e=Array.from({length:c+1},(e,n)=>Number((r+n*t).toPrecision(12)));return{lo:e[0],hi:e[c],ticks:e}}}s*=10}}function Gs(e,t,{intervals:r=5,integerLeft:n=!1,integerRight:a=!1}={}){const l=e=>Math.min(0,e),i=e=>Math.max(0,e),o=([e,t],r,n,a)=>{if(l(e)<0&&0===r)return null;if(i(t)>0&&0===n)return null;const o=function(e,t){if(!(e>0))return 1;let r=10**Math.floor(Math.log10(e));for(;;){for(const n of[1,2,2.5,5]){const a=n*r;if((!t||Number.isInteger(a))&&a>=e*(1-1e-9))return a}r*=10}}(Math.max(r?-l(e)/r:0,n?i(t)/n:0),a),s=o*(r+n),c=i(t)-l(e);return{step:o,waste:c>0?(s-c)/s:1}};let s=null;const c=Math.max(2,Math.floor(r));for(let r=2;r<=c;r++)for(let l=0;l<=r;l++){const i=o(e,l,r-l,n),d=o(t,l,r-l,a);if(!i||!d)continue;const u=i.waste+d.waste+.02*(c-r);(!s||u<s.score-1e-9)&&(s={n:r,k:l,l:i.step,r:d.step,score:u})}const{n:d,k:u,l:h,r:m}=s??{n:1,k:0,l:1,r:1},p=e=>{const t=Array.from({length:d+1},(t,r)=>Number(((r-u)*e).toPrecision(12)));return{lo:t[0],hi:t[d],ticks:t}};return{left:p(h),right:p(m)}}function Xs(e,t){const r=Math.max(e[0],e[1]),n=Math.min(e[0],e[1]),a=r>0?r:0,l=n>0?n:a>0?10**(Math.ceil(Math.log10(a))-3):0,i=Math.log10(l),o=a>0&&l>0?Math.log10(a)-i:0,s=e=>{if(o<=0)return t.from;const r=Math.max(l,e);return t.from+(Math.log10(r)-i)/o*(t.to-t.from)};return s.domain=[l,a],s.range=t,s.ticks=e=>{if(e<2||o<=0)return[l];const t=Math.ceil(i),r=Math.floor(Math.log10(a)),n=[];for(let e=t;e<=r;e+=1)n.push(10**e);return 0===n.length?[l,a]:(Math.log10(n[0])-i>.15&&n.unshift(l),Math.log10(a)-Math.log10(n[n.length-1])>.15&&n.push(a),n)},s}function Zs(e,t=0){const r=e>0?2*Math.PI/e:0,n=e=>-Math.PI/2+e*r+t/2;return n.step=Math.max(0,r-t),n.center=e=>-Math.PI/2+e*r+r/2,n.count=e,n}function Js(e,t){const[r,n]=e,a=Math.sqrt(Math.max(0,n))-Math.sqrt(Math.max(0,r));return e=>{if(0===a)return t.to;const n=(Math.sqrt(Math.max(0,e))-Math.sqrt(Math.max(0,r)))/a;return t.from+Math.min(1,Math.max(0,n))*(t.to-t.from)}}function Qs(e,t=10){const r=e.filter(Number.isFinite);if(Array.isArray(t)){const e=[...t].filter(Number.isFinite).sort((e,t)=>e-t);if(e.length<2)return[];const n=Array.from({length:e.length-1},(t,r)=>({from:e[r],to:e[r+1],count:0})),a=e[e.length-1];for(const t of r){if(t<e[0]||t>a)continue;const r=t===a?n.length-1:n.findIndex(e=>t>=e.from&&t<e.to);r>=0&&(n[r].count+=1)}return n}const n=t;if(0===r.length||n<1)return[];const a=Math.min(...r),l=(Math.max(...r)-a)/n||1,i=Array.from({length:n},(e,t)=>({from:a+t*l,to:a+(t+1)*l,count:0}));for(const e of r){i[Math.min(n-1,Math.floor((e-a)/l))].count+=1}return i}function ec(e,t,{fontSize:r=11,gap:n=8}={}){const a=e.reduce((e,t)=>Math.max(e,t.length),0);return Math.max(t,Math.ceil(.62*a*r+n+2))}function tc(e,t=720){const[r,n]=Ee(t);return Ie(()=>{const t=e.current;if(!t||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(e=>{const t=e[0]?.contentRect.width??0;t>0&&n(t)});return r.observe(t),()=>r.disconnect()},[e]),r}function rc(e,t,r){const n=(t/2+8).toFixed(1),a=e=>{return`clamp(0px, calc(${t=e,r>0?(t/r*100).toFixed(2):"0.00"}% + ${n}px), calc(100% - 184px))`;var t};return e<=r/2?{left:a(e)}:{right:a(r-e)}}function nc({labels:e,values:t,height:r=220,width:n,bandPadding:a=.24,min:l,max:i,yTickCount:o=4,formatValue:s,yAxisLabel:c,xTickAnchor:d="center",children:u,overlay:h,tooltip:m,onSelect:p,ariaLabel:g,className:f,emptyLabel:b}){const x=he().charts,y=ue(),v=s??(e=>fe(e,y)),w=b??x.noData,N=Be(null),k=tc(N),$=n??k,[M,C]=Ee(null),L=ze();if(Ie(()=>{if(null!==M)return Q(e=>"Escape"===e.key&&(C(null),!0))},[M]),0===e.length||!t.some(Number.isFinite))/* @__PURE__ */
|
|
617
619
|
return Ye("div",{className:f,ref:N,children:/* @__PURE__ */Ye("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:r},children:w})});const S=t.filter(Number.isFinite),D=S.every(Number.isInteger),P=void 0===l&&void 0===i?Ys(Math.min(0,...S),Math.max(0,...S),{intervals:o+1,integer:D}):null,A=void 0!==l&&void 0===i?Ys(l,Math.max(l,...S),{intervals:o+1,integer:D,zero:!1}):null,j=P?P.lo:l??Math.min(0,...S),z=P?P.hi:A?A.hi:i??Vs(Math.max(...S,0)),F=P?P.ticks:A?[j,...A.ticks.filter(e=>e>j)]:qs([j,z],{from:0,to:1}).ticks(o+1),E={top:12,right:16,bottom:26,left:ec(F.map(v),48)+(c?10:0)},B=E.left,T=Math.max(B+1,$-E.right),I=E.top,O=r-E.bottom,R=qs([j,z],{from:O,to:I}),W=Hs(e.length,{from:B,to:T},a),K=(T-B)/Math.max(1,e.length),_=K>=48,q=_?1:Math.max(1,Math.ceil(e.length/Math.max(1,Math.floor($/84)))),H=Math.max(2,Math.floor((K-6)/6.6)),U=e=>_&&e.length>H?`${e.slice(0,H-1).trimEnd()}…`:e;/* @__PURE__ */
|
|
@@ -661,8 +663,8 @@ return Ye(Ma,{groups:$c,children:/* @__PURE__ */Ye("div",{className:"h-full over
|
|
|
661
663
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Dashboard"}),
|
|
662
664
|
/* @__PURE__ */Ye("p",{className:"text-sm text-gray-500",children:"Overview of your store this month"})]}),
|
|
663
665
|
/* @__PURE__ */Ge("div",{className:"flex items-center gap-2",children:[
|
|
664
|
-
/* @__PURE__ */Ye(
|
|
665
|
-
/* @__PURE__ */Ye(
|
|
666
|
+
/* @__PURE__ */Ye(O,{variant:"secondary",size:"sm",children:"Export"}),
|
|
667
|
+
/* @__PURE__ */Ye(O,{size:"sm",children:"New report"})]})]}),
|
|
666
668
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[
|
|
667
669
|
/* @__PURE__ */Ye(za,{label:"Revenue",value:"$38.2k",delta:{value:"12%",direction:"up"}}),
|
|
668
670
|
/* @__PURE__ */Ye(za,{label:"Orders",value:"1,204",delta:{value:"4%",direction:"up"}}),
|
|
@@ -688,12 +690,12 @@ return Ye(Ma,{groups:$c,children:/* @__PURE__ */Ye("div",{className:"h-full over
|
|
|
688
690
|
return Ye(Ma,{groups:Pc,children:/* @__PURE__ */Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ge("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
689
691
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-4",children:[
|
|
690
692
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Members"}),
|
|
691
|
-
/* @__PURE__ */Ye(
|
|
693
|
+
/* @__PURE__ */Ye(O,{size:"sm",children:"Invite member"})]}),
|
|
692
694
|
/* @__PURE__ */Ge(ja,{padded:!1,children:[
|
|
693
695
|
/* @__PURE__ */Ge("div",{className:"flex flex-wrap items-center gap-2 border-b border-gray-100 p-3",children:[
|
|
694
696
|
/* @__PURE__ */Ye("div",{className:"min-w-48 flex-1",children:/* @__PURE__ */Ye(Qe,{value:l,onChange:e=>i(e.target.value),placeholder:"Search members…",leftIcon:/* @__PURE__ */Ye(zc,{})})}),
|
|
695
697
|
/* @__PURE__ */Ye("div",{className:"w-40",children:/* @__PURE__ */Ye(gt,{value:r,onChange:n,placeholder:"All roles",options:[{value:"admin",label:"Admin"},{value:"editor",label:"Editor"},{value:"viewer",label:"Viewer"}]})}),
|
|
696
|
-
/* @__PURE__ */Ye(
|
|
698
|
+
/* @__PURE__ */Ye(O,{variant:"secondary",size:"sm",children:"Filter"})]}),
|
|
697
699
|
/* @__PURE__ */Ge("table",{className:"w-full text-sm",children:[
|
|
698
700
|
/* @__PURE__ */Ye("thead",{children:/* @__PURE__ */Ge("tr",{className:"border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400",children:[
|
|
699
701
|
/* @__PURE__ */Ye("th",{className:`${a} px-4 py-2 font-medium`,children:"Name"}),
|
|
@@ -706,7 +708,7 @@ return Ye(Ma,{groups:Pc,children:/* @__PURE__ */Ye("div",{className:"h-full over
|
|
|
706
708
|
/* @__PURE__ */Ye("div",{className:"text-xs text-gray-400",children:e.email})]}),
|
|
707
709
|
/* @__PURE__ */Ye("td",{className:"px-4 py-3",children:e.role}),
|
|
708
710
|
/* @__PURE__ */Ye("td",{className:"px-4 py-3",children:/* @__PURE__ */Ye(La,{status:e.status})}),
|
|
709
|
-
/* @__PURE__ */Ye("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */Ye(
|
|
711
|
+
/* @__PURE__ */Ye("td",{className:"px-4 py-3 text-right",children:/* @__PURE__ */Ye(O,{variant:"ghost",size:"sm",children:"Edit"})})]},e.email))})]}),
|
|
710
712
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between border-t border-gray-100 p-3",children:[
|
|
711
713
|
/* @__PURE__ */Ye("span",{className:"text-xs text-gray-400",children:"Showing 1–6 of 48"}),
|
|
712
714
|
/* @__PURE__ */Ye(Ns,{page:e,pageCount:8,onPageChange:t,showEdges:!0})]})]})]})})})}function zc(){/* @__PURE__ */
|
|
@@ -730,8 +732,8 @@ return Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
730
732
|
/* @__PURE__ */Ye(yt,{name:"plan",checked:"team"===e,onChange:()=>t("team"),label:"Team"})]})})]}),
|
|
731
733
|
/* @__PURE__ */Ye(bt,{checked:r,onChange:n,label:"Email me product updates",description:"Occasional news — no more than once a month."})]})}),
|
|
732
734
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-end gap-2",children:[
|
|
733
|
-
/* @__PURE__ */Ye(
|
|
734
|
-
/* @__PURE__ */Ye(
|
|
735
|
+
/* @__PURE__ */Ye(O,{variant:"secondary",children:"Cancel"}),
|
|
736
|
+
/* @__PURE__ */Ye(O,{type:"submit",children:"Save changes"})]})]})})}var Ec=[{name:"Mechanical keyboard",qty:1,price:129},{name:"USB-C cable (2m)",qty:2,price:12},{name:"Laptop stand",qty:1,price:48}];function Bc(){const[e,t]=Ee(!0),[r,n]=Ee("us"),a=Ec.reduce((e,t)=>e+t.qty*t.price,0),l=a+9;/* @__PURE__ */
|
|
735
737
|
return Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ge("div",{className:"mx-auto max-w-5xl space-y-5",children:[
|
|
736
738
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Checkout"}),
|
|
737
739
|
/* @__PURE__ */Ge("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:[
|
|
@@ -768,10 +770,10 @@ return Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__
|
|
|
768
770
|
/* @__PURE__ */Ge("div",{className:"flex justify-between text-base font-semibold text-gray-900",children:[
|
|
769
771
|
/* @__PURE__ */Ye("span",{children:"Total"}),
|
|
770
772
|
/* @__PURE__ */Ge("span",{children:["$",l]})]})]}),
|
|
771
|
-
/* @__PURE__ */Ge(
|
|
773
|
+
/* @__PURE__ */Ge(O,{block:!0,className:"mt-4",children:["Pay $",l]})]}),
|
|
772
774
|
/* @__PURE__ */Ye(jl,{tone:"success",title:"Promo applied",children:"Free returns within 30 days."})]})]})]})})}var Tc=[{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"}],Ic=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know…",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported…",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by…",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th…",time:"Yest"}];function Oc(){const[e,r]=Ee(1),n=Ic.find(t=>t.id===e)??Ic[0];/* @__PURE__ */
|
|
773
775
|
return Ye("div",{className:"h-full",children:/* @__PURE__ */Ye(t,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */Ge("div",{className:"flex h-full flex-col p-2",children:[
|
|
774
|
-
/* @__PURE__ */Ye(
|
|
776
|
+
/* @__PURE__ */Ye(O,{block:!0,className:"mb-2",children:"Compose"}),Tc.map((e,t)=>/* @__PURE__ */Ge("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
775
777
|
/* @__PURE__ */Ye("span",{children:e.label}),null!=e.count&&/* @__PURE__ */Ye("span",{className:"text-xs text-gray-400",children:e.count})]},e.id))]}),children:/* @__PURE__ */Ge("div",{className:"flex h-full",children:[
|
|
776
778
|
/* @__PURE__ */Ye("div",{className:"w-72 shrink-0 overflow-auto border-r border-gray-200",children:Ic.map(t=>/* @__PURE__ */Ge("button",{onClick:()=>r(t.id),className:"block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 "+(t.id===e?"bg-blue-50/50":""),children:[
|
|
777
779
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-2",children:[
|
|
@@ -783,8 +785,8 @@ return Ye("div",{className:"h-full",children:/* @__PURE__ */Ye(t,{side:"left",de
|
|
|
783
785
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-3 border-b border-gray-200 p-4",children:[
|
|
784
786
|
/* @__PURE__ */Ye("h2",{className:"truncate text-base font-semibold text-gray-900",children:n.subject}),
|
|
785
787
|
/* @__PURE__ */Ge("div",{className:"flex shrink-0 gap-2",children:[
|
|
786
|
-
/* @__PURE__ */Ye(
|
|
787
|
-
/* @__PURE__ */Ye(
|
|
788
|
+
/* @__PURE__ */Ye(O,{variant:"ghost",size:"sm",children:"Archive"}),
|
|
789
|
+
/* @__PURE__ */Ye(O,{variant:"secondary",size:"sm",children:"Reply"})]})]}),
|
|
788
790
|
/* @__PURE__ */Ge("div",{className:"flex items-center gap-3 border-b border-gray-100 p-4",children:[
|
|
789
791
|
/* @__PURE__ */Ye(Ll,{name:n.from}),
|
|
790
792
|
/* @__PURE__ */Ge("div",{className:"min-w-0",children:[
|
|
@@ -810,11 +812,11 @@ return Ye("div",{className:"h-full",children:/* @__PURE__ */Ye(t,{side:"left",de
|
|
|
810
812
|
/* @__PURE__ */Ye("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:Wc.map((e,t)=>/* @__PURE__ */Ye("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */Ye("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
|
|
811
813
|
/* @__PURE__ */Ge("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
812
814
|
/* @__PURE__ */Ye("div",{className:"flex-1",children:/* @__PURE__ */Ye(Qe,{placeholder:"Type a message…"})}),
|
|
813
|
-
/* @__PURE__ */Ye(
|
|
815
|
+
/* @__PURE__ */Ye(O,{type:"submit",children:"Send"})]})]})})})}var _c={featured:"success",new:"active",draft:"draft"},qc=["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 Hc(){const[e,t]=Ee("all"),r="all"===e?qc:qc.filter(t=>t.tag===e);/* @__PURE__ */
|
|
814
816
|
return Ye(Ma,{groups:_c,children:/* @__PURE__ */Ye("div",{className:"h-full overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */Ge("div",{className:"mx-auto max-w-5xl space-y-4",children:[
|
|
815
817
|
/* @__PURE__ */Ge("div",{className:"flex items-center justify-between gap-4",children:[
|
|
816
818
|
/* @__PURE__ */Ye("h1",{className:"text-xl font-semibold text-gray-900",children:"Gallery"}),
|
|
817
|
-
/* @__PURE__ */Ye(
|
|
819
|
+
/* @__PURE__ */Ye(O,{size:"sm",children:"Upload"})]}),
|
|
818
820
|
/* @__PURE__ */Ye(Tl,{value:e,onChange:t,variant:"pill",items:[{id:"all",label:"All"},{id:"featured",label:"Featured"},{id:"new",label:"New"},{id:"draft",label:"Drafts"}]}),
|
|
819
821
|
/* @__PURE__ */Ye("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(e=>/* @__PURE__ */Ge(ja,{padded:!1,className:"overflow-hidden",children:[
|
|
820
822
|
/* @__PURE__ */Ye("div",{className:"relative h-28",style:{background:e.bg},children:/* @__PURE__ */Ye("span",{className:"absolute right-2 top-2",children:/* @__PURE__ */Ye(La,{status:e.tag})})}),
|
|
@@ -830,7 +832,7 @@ return Ye("div",{className:"flex h-full items-center justify-center overflow-aut
|
|
|
830
832
|
/* @__PURE__ */Ye(vt,{label:"Email",htmlFor:"au-email",children:/* @__PURE__ */Ye(Qe,{id:"au-email",type:"email",placeholder:"you@example.com"})}),"forgot"!==e&&/* @__PURE__ */Ye(vt,{label:"Password",htmlFor:"au-pass",hint:"register"===e?"At least 8 characters.":void 0,children:/* @__PURE__ */Ye(Qe,{id:"au-pass",type:"password",placeholder:"••••••••"})}),"login"===e&&/* @__PURE__ */Ge("div",{className:"flex items-center justify-between",children:[
|
|
831
833
|
/* @__PURE__ */Ye(bt,{checked:t,onChange:r,label:"Remember me"}),
|
|
832
834
|
/* @__PURE__ */Ye("a",{href:"#",className:"text-sm text-blue-600 hover:underline",children:"Forgot?"})]}),
|
|
833
|
-
/* @__PURE__ */Ye(
|
|
835
|
+
/* @__PURE__ */Ye(O,{type:"submit",block:!0,children:n.cta})]})}),
|
|
834
836
|
/* @__PURE__ */Ye("p",{className:"mt-4 text-center text-sm text-gray-500",children:/* @__PURE__ */Ge(Xe,"register"===e?{children:["Already have an account? ",
|
|
835
837
|
/* @__PURE__ */Ye("a",{href:"#",className:"text-blue-600 hover:underline",children:"Sign in"})]}:{children:["New here? ",
|
|
836
838
|
/* @__PURE__ */Ye("a",{href:"#",className:"text-blue-600 hover:underline",children:"Create an account"})]})})]})})}var Yc={403:e=>({title:e.forbidden,body:e.forbiddenBody}),404:e=>({title:e.notFound,body:e.notFoundBody}),500:e=>({title:e.serverError,body:e.serverErrorBody})};function Gc({code:e=404,actions:t}){const r=Yc[e](he().errors);/* @__PURE__ */
|
|
@@ -841,11 +843,11 @@ return Ge("div",{className:"flex h-full flex-col items-center justify-center bg-
|
|
|
841
843
|
return Ye(Xe,{children:e(he().errors)})}var Zc=class extends He{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught an error:",e,t),oe(e),this.props.onError?.(e,t)}componentDidUpdate(e){if(!this.state.error)return;const t=e.resetKeys??[],r=this.props.resetKeys??[];(t.length!==r.length||t.some((e,t)=>!Object.is(e,r[t])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
842
844
|
/* @__PURE__ */Ge("div",{className:"flex h-full flex-col",children:[
|
|
843
845
|
/* @__PURE__ */Ye("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */Ye(Gc,{code:500,actions:/* @__PURE__ */Ge(Xe,{children:[
|
|
844
|
-
/* @__PURE__ */Ye(
|
|
846
|
+
/* @__PURE__ */Ye(O,{onClick:this.reset,children:/* @__PURE__ */Ye(Xc,{pick:e=>e.retry})}),this.props.actions]})})}),this.props.showDetails&&/* @__PURE__ */Ge("details",{className:"mx-auto w-full max-w-2xl shrink-0 px-6 pb-6",children:[
|
|
845
847
|
/* @__PURE__ */Ye("summary",{className:"cursor-pointer text-sm font-medium text-gray-600",children:/* @__PURE__ */Ye(Xc,{pick:e=>e.details})}),
|
|
846
|
-
/* @__PURE__ */Ye("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function Jc(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Qc(e){const t=Jc();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function ed(){return Jc()?.matches??!1}function td(){return!1}function rd(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 nd(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 ad(e){const t=e||"system";return"system"===t?ed()?"dark":"light":t}function ld(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=rd(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",nd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",nd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",nd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",nd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",nd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",nd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",nd(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 id(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]=rd(a);l.style.setProperty("--custom-button-hover",nd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var od=["square","soft","round"];function sd(e){return"square"===e||"round"===e?e:"soft"}function cd(e){const t=sd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function dd(e){const t="string"==typeof e&&e?e:null;Ae(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function ud(e){"corners"in e&&cd(e.corners),"icon_set"in e&&dd(e.icon_set),document.documentElement.setAttribute("data-theme",ad(e.theme)),ld(e.accent_color??null),id(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 hd(){const{prefs:e}=x(),t=Ue(Qc,ed,td),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,s=sd(e.corners),c="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,d="system"===r?t?"dark":"light":r;return Ie(()=>(document.documentElement.setAttribute("data-theme",d),()=>document.documentElement.removeAttribute("data-theme")),[d]),Ie(()=>(cd(s),()=>document.documentElement.removeAttribute("data-corners")),[s]),Ie(()=>(dd(c),()=>dd(null)),[c]),Ie(()=>{ld(n)},[n]),Ie(()=>{id(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:d,corners:s,iconSet:c}}function md(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 pd({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=
|
|
848
|
+
/* @__PURE__ */Ye("pre",{className:"mt-2 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-700",children:e.stack??e.message})]})]}):this.props.children}};function Jc(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}function Qc(e){const t=Jc();return t?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):()=>{}}function ed(){return Jc()?.matches??!1}function td(){return!1}function rd(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 nd(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 ad(e){const t=e||"system";return"system"===t?ed()?"dark":"light":t}function ld(e){const t=document.documentElement;if(e&&/^#[0-9a-fA-F]{6}$/.test(e)){const[r,n,a]=rd(e);t.setAttribute("data-custom-accent","true"),t.style.setProperty("--accent-600",e),t.style.setProperty("--accent-700",nd(r,n,Math.max(a-10,5))),t.style.setProperty("--accent-500",nd(r,n,Math.min(a+10,95))),t.style.setProperty("--accent-400",nd(r,n,Math.min(a+20,95))),t.style.setProperty("--accent-300",nd(r,Math.min(n+10,100),Math.min(a+30,92))),t.style.setProperty("--accent-200",nd(r,Math.min(n+15,100),Math.min(a+38,94))),t.style.setProperty("--accent-100",nd(r,Math.min(n+20,100),Math.min(a+42,96))),t.style.setProperty("--accent-50",nd(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 id(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]=rd(a);l.style.setProperty("--custom-button-hover",nd(e,t,Math.max(r-10,5)))}}else["--custom-bg-color","--custom-button-color","--custom-button-hover"].forEach(e=>l.style.removeProperty(e))}var od=["square","soft","round"];function sd(e){return"square"===e||"round"===e?e:"soft"}function cd(e){const t=sd(e);"soft"===t?document.documentElement.removeAttribute("data-corners"):document.documentElement.setAttribute("data-corners",t)}function dd(e){const t="string"==typeof e&&e?e:null;Ae(t),t?document.documentElement.setAttribute("data-icon-set",t):document.documentElement.removeAttribute("data-icon-set")}function ud(e){"corners"in e&&cd(e.corners),"icon_set"in e&&dd(e.icon_set),document.documentElement.setAttribute("data-theme",ad(e.theme)),ld(e.accent_color??null),id(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 hd(){const{prefs:e}=x(),t=Ue(Qc,ed,td),r=e.theme||"system",n=e.accent_color||null,a=e.custom_bg_color||null,l=e.custom_title_color||null,i=e.custom_window_color||null,o=e.custom_button_color||null,s=sd(e.corners),c="string"==typeof e.icon_set&&e.icon_set?e.icon_set:null,d="system"===r?t?"dark":"light":r;return Ie(()=>(document.documentElement.setAttribute("data-theme",d),()=>document.documentElement.removeAttribute("data-theme")),[d]),Ie(()=>(cd(s),()=>document.documentElement.removeAttribute("data-corners")),[s]),Ie(()=>(dd(c),()=>dd(null)),[c]),Ie(()=>{ld(n)},[n]),Ie(()=>{id(n,a,l,i,o)},[n,a,l,i,o]),{theme:r,resolved:d,corners:s,iconSet:c}}function md(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 pd({size:e="sm",className:t=""}){const{language:r,languages:n,setLanguage:a}=p(),l=he().language;return n.length<2?null:/* @__PURE__ */Ge("span",{className:`inline-flex items-center gap-2 text-gray-500 ${t}`.trim(),children:[
|
|
847
849
|
/* @__PURE__ */Ye(Pe,{name:"globe","aria-hidden":!0,className:"h-4 w-4 shrink-0"}),
|
|
848
|
-
/* @__PURE__ */Ye("span",{className:"block",style:{width:`${md(n.map(e=>e.name))}em`},children:/* @__PURE__ */Ye(gt,{size:e,touchSize:e,"aria-label":l.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function gd({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=
|
|
850
|
+
/* @__PURE__ */Ye("span",{className:"block",style:{width:`${md(n.map(e=>e.name))}em`},children:/* @__PURE__ */Ye(gt,{size:e,touchSize:e,"aria-label":l.title,value:r,onChange:e=>{a(e)},options:n.map(({tag:e,name:t})=>({value:e,label:t,lang:e}))})})]})}function gd({description:e,className:t=""}){const{language:r,languages:n,setLanguage:a}=p(),l=he().language;return n.length<2?null:/* @__PURE__ */Ge("div",{className:`space-y-4 ${t}`.trim(),children:[
|
|
849
851
|
/* @__PURE__ */Ge("div",{children:[
|
|
850
852
|
/* @__PURE__ */Ye("h3",{className:"text-sm font-semibold text-gray-900",children:l.title}),
|
|
851
853
|
/* @__PURE__ */Ye("p",{className:"mt-0.5 text-sm text-gray-500",children:e??l.description})]}),
|