@graphty/compact-mantine 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),t=require("react/jsx-runtime"),$=require("@mantine/hooks"),s=require("react"),wo=require("react-dom"),de=require("@tanstack/react-table"),Io=require("@tanstack/react-virtual"),u={WIDTH:280,PAD_LEFT:16,PAD_RIGHT:8,CONTENT:256,BODY:224,FIELD:108,GUTTER:8,TRAIL_GAP:8,TRAIL:24,TRIPLE:72,TRIPLE_GAP:4,CONTROL_HEIGHT:24,ROW_PITCH:32,TOGGLE_PITCH:24,DATA_PITCH:28,SECTION_HEADER:32,SECTION_PAD_BOTTOM:8,GLYPH_SLOT:16,GLYPH:14,CHEVRON:12,VALUE_INSET:24,SPARKLINE_HEIGHT:32,HISTOGRAM_HEIGHT:64,LABEL_COLUMN:76},b={VALUE:"var(--mantine-color-text)",CHROME:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PROSE:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PLACEHOLDER:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",DISABLED:"var(--mantine-color-disabled-color)",SURFACE:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))",PANEL:"var(--mantine-color-body)",RAISED:"light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))",SELECTED:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",ON_SELECTED:"var(--mantine-color-body)",BORDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",DIVIDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",ACCENT:"var(--mantine-primary-color-filled)",ON_ACCENT:"var(--mantine-primary-color-contrast)",WARNING:"var(--mantine-color-yellow-6)",SUCCESS:"var(--mantine-color-green-6)",DANGER:"var(--mantine-color-red-6)"},Dn=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],kn={...o.DEFAULT_THEME.colors,dark:Dn},Eo={"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"},So={"--ai-size":"24px"},Co={"--cb-size":"16px","--cb-icon-size":"12px"},To={Button:o.Button.extend({defaultProps:{size:"sm"},vars:()=>({root:Eo})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:()=>({root:So})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:()=>({root:Co})})},Ro={"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"},Po={"--checkbox-size":"16px"},Ao={"--radio-size":"16px","--radio-icon-size":"6px"},en={"--slider-size":"4px","--slider-thumb-size":"12px"},jo={"--sc-font-size":"10px","--sc-padding":"4px 8px"},Lo={backgroundColor:"transparent"},Oo={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},wt={fontSize:11},tn={fontSize:10,marginTop:2},Ho={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:()=>({root:jo}),styles:{root:Lo,indicator:Oo}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:()=>({root:Po}),styles:{label:wt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:()=>({root:Ro}),styles:{label:wt}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:()=>({root:en}),styles:{markLabel:tn}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:()=>({root:Ao}),styles:{label:wt}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:()=>({root:en}),styles:{markLabel:tn}})},_o={"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"},No={"--avatar-size":"24px"},Do={"--ti-size":"24px"},ko={"--indicator-size":"8px"},Go={"--kbd-fz":"10px","--kbd-padding":"2px 4px"},Mo={"--pill-height":"16px","--pill-fz":"10px"},zo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:()=>({root:_o})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:()=>({root:Mo})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:()=>({root:No})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:()=>({root:Do})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:()=>({root:ko})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:()=>({root:Go})})},Bo={"--loader-size":"18px"},Fo={"--progress-size":"4px"},Vo={label:{fontSize:9}},Uo={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:()=>({root:Bo})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:()=>({root:Fo}),styles:Vo}),RingProgress:o.RingProgress.extend({})},_t=1e3,ke=1100,Gn=8,Mn=4,zn="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",$e={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":zn},ut={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":zn},qe={fontSize:11,color:b.CHROME,marginBottom:1,lineHeight:1.2},Mt={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},Ke={label:qe,input:Mt},nn={label:qe,input:Mt},pt={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},It={input:{...Ke.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}},$o={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:$e}),styles:Ke}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:{...$e,"--input-right-section-width":"24px"},controls:{"--ni-chevron-size":"10px"}}),styles:{label:qe,input:Mt,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:$e}),styles:{...Ke,...pt}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:ut}),styles:nn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:$e}),styles:{...Ke,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:$e}),styles:{...Ke,...pt}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:{...$e,"--combobox-chevron-size":"12px"}}),styles:{label:qe,...pt,...It,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:ut}),styles:{label:qe,...pt,...It,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:ut}),styles:{label:qe,...It}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:$e}),styles:Ke}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:ut}),styles:nn}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:()=>({root:{"--cb-size":"16px","--cb-icon-size":"12px"}})})},Wo={"--pagination-control-size":"24px","--pagination-control-fz":"11px"},Yo={"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"},Xo={"--burger-size":"18px","--burger-line-size":"2px"},Ko={root:{fontSize:11}},qo={root:{fontSize:11,minHeight:28},label:{fontSize:11}},Zo={tab:{fontSize:11,padding:"6px 10px"}},Jo={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:Ko}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:()=>({root:Xo})}),NavLink:o.NavLink.extend({styles:qo}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:()=>({root:Wo})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:()=>({root:Yo})}),Tabs:o.Tabs.extend({styles:Zo})},Qo={"--menu-item-fz":"11px"},er={tooltip:{fontSize:11,padding:"4px 8px"}},tr={dropdown:{padding:8}},nr={dropdown:{padding:8}},or={Menu:o.Menu.extend({defaultProps:{zIndex:ke},vars:()=>({dropdown:Qo})}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:ke},styles:er}),Popover:o.Popover.extend({defaultProps:{zIndex:ke},styles:tr}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:ke},styles:nr})},rr={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},ar={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},sr={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Bn=o.createTheme({colors:kn,fontSizes:rr,spacing:ar,radius:sr,focusRing:"auto",other:{panelGrid:u},components:{...$o,...To,...Ho,...zo,...Uo,...Jo,...or}}),ir=o.mergeMantineTheme(o.DEFAULT_THEME,Bn),Fn=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],xt="#888888",Vn={mixed:"Mixed",fieldBound:"Bound to a data attribute",fieldPending:"Set but not yet applied",scaleSqrt:"Square root scale",scaleLinear:"Linear scale",scaleLog:"Logarithmic scale",details:"Details",departure:"Departure",percentile:e=>`${e} percentile`,expandSection:e=>`Expand ${e}`,collapseSection:e=>`Collapse ${e}`,addToSection:e=>`Add ${e}`,sectionHasConfiguredValues:e=>`${e} has configured values`,about:e=>`About ${e}`,resetToDefault:e=>`Reset ${e} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:e=>`Stop ${e} position`,removeColorStop:e=>`Remove color stop ${e}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:e=>`${e}°`,percent:e=>`${e}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(e,n)=>`${e} of ${n} rows`,rowsSelected:e=>`${e} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",ordinal:(e,n)=>{switch(n){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},lr="en",Nt=s.createContext(Vn),Dt=s.createContext(void 0);function cr(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:lr}function dr({labels:e,locale:n,children:a}){const r=s.useContext(Nt),i=s.useContext(Dt),l=s.useMemo(()=>({...r,...e}),[r,e]),d=n??i;return t.jsx(Dt.Provider,{value:d,children:t.jsx(Nt.Provider,{value:l,children:a})})}function re(){return s.useContext(Nt)}function ze(){const e=s.useContext(Dt);return cr(e)}const ur=1234.5,pr="9876543210",fr=9876543210,hr=new Set([" "," "," "," ","'","’"]),gr="−",xr=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,on=new Map;function mr(e){var h,p;const n=on.get(e);if(n!==void 0)return n;const a=new Intl.NumberFormat(e).formatToParts(ur),r=((h=a.find(f=>f.type==="decimal"))==null?void 0:h.value)??".",i=((p=a.find(f=>f.type==="group"))==null?void 0:p.value)??"",l=new Map;for(const f of"0123456789")l.set(f,f);const d=new Intl.NumberFormat(e,{useGrouping:!1}).format(fr);Array.from(d).forEach((f,x)=>{l.set(f,pr[x])});const g={decimal:r,digits:l,group:i};return on.set(e,g),g}function Un(e,n){const a=mr(n);let r="";for(const l of e.trim()){const d=a.digits.get(l);if(d!==void 0){r+=d;continue}if(l===a.decimal){r+=".";continue}if(!(l===a.group||hr.has(l))){if(l==="-"||l===gr){r+="-";continue}if(l==="+"){r+="+";continue}if(l==="e"||l==="E"){r+=l;continue}break}}const i=xr.exec(r);return i===null?Number.NaN:Number(i[0])}function Ye(e){const n=ze(),a=JSON.stringify(e??{});return s.useMemo(()=>new Intl.NumberFormat(n,e),[n,a])}function $n(){const e=ze(),n=re(),a=Ye(),r=s.useMemo(()=>new Intl.PluralRules(e,{type:"ordinal"}),[e]);return s.useCallback(i=>n.ordinal(a.format(i),r.select(i)),[n,a,r])}function Wn(e){const n=ze(),a=JSON.stringify(e??{});return s.useMemo(()=>new Intl.Collator(n,e),[n,a])}function zt(){const e=ze();return s.useCallback(n=>Un(n,e),[e])}const Yn=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],Xn=["N","E","W","D","K"],br=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","info","reset"],Kn={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},Re={fill:"currentColor",stroke:"none"},yr={sizeSmallest:e=>t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?Re:{}}),t.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?Re:{}})]}),sizeLargest:e=>t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?Re:{}}),t.jsx("circle",{cx:"10",cy:"6",r:"5",...e?Re:{}})]}),width:e=>t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"2.5",y1:"8",x2:"13.5",y2:"8"}),t.jsx("polyline",{points:"5,5.5 2.5,8 5,10.5",...e?Re:{}}),t.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?Re:{}})]}),opacity:e=>e?t.jsx("circle",{cx:"8",cy:"8",r:"5.5",...Re}):t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),t.jsx("path",{d:"M8 2.5a5.5 5.5 0 0 1 0 11z",...Re})]}),attribute:e=>e?t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z",...Re}),t.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75",style:{fill:b.SURFACE},stroke:"none"})]}):t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z"}),t.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75"})]}),scaleSqrt:()=>t.jsx("path",{d:"M2.5 13.5C4.5 5 8 2.5 13.5 2.5"}),scaleLinear:()=>t.jsx("line",{x1:"2.5",y1:"13.5",x2:"13.5",y2:"2.5"}),scaleLog:()=>t.jsx("path",{d:"M2.5 13.5C8 13.5 11.5 11 13.5 2.5"})},vr={chevronDown:t.jsx("polyline",{points:"4,6 8,10 12,6"}),chevronRight:t.jsx("polyline",{points:"6,4 10,8 6,12"}),chevronLeft:t.jsx("polyline",{points:"10,4 6,8 10,12"}),close:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]}),plus:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13"}),t.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"})]}),minus:t.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),gear:t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"2.25"}),t.jsx("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4"})]}),warning:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M8 2.5l6 11H2z"}),t.jsx("line",{x1:"8",y1:"6.5",x2:"8",y2:"9.5"}),t.jsx("line",{x1:"8",y1:"11.5",x2:"8",y2:"11.75"})]}),check:t.jsx("polyline",{points:"3.5,8.5 6.5,11.5 12.5,5"}),eye:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),t.jsx("circle",{cx:"8",cy:"8",r:"2"})]}),refresh:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1.6-3.9"}),t.jsx("polyline",{points:"2.5,2.5 2.5,6 6,6"})]}),copy:t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1"}),t.jsx("path",{d:"M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"})]}),pin:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M6 2.5h4l-.5 3.5 2 2.5H4.5l2-2.5z"}),t.jsx("line",{x1:"8",y1:"8.5",x2:"8",y2:"13.5"})]}),info:t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"6.5"}),t.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11.5"}),t.jsx("line",{x1:"8",y1:"4.5",x2:"8",y2:"4.75"})]}),reset:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})};function nt({name:e,filled:n=!1,size:a=u.GLYPH}){return t.jsx("svg",{width:a,height:a,...Kn,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":n?"true":"false",style:{flex:"0 0 auto",display:"block"},children:yr[e](n)})}function te({name:e,size:n=u.GLYPH}){return t.jsx("svg",{width:n,height:n,...Kn,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:vr[e]})}function Bt(e){return typeof e=="string"&&Yn.includes(e)}function Ft(e){return typeof e=="string"&&Xn.includes(e)}const Vt=255,Ut=100;function $t(e){return Math.round(parseInt(e,16)/Vt*Ut)}function Wt(e){return Math.round(e/Ut*Vt).toString(16).padStart(2,"0")}function wr(e){let n=e.replace("#","");n.length===3?n=`${n.split("").map(l=>l+l).join("")}ff`:n.length===4?n=n.split("").map(l=>l+l).join(""):n.length===6&&(n=`${n}ff`);const a=`#${n.slice(0,6)}`,r=n.slice(6,8),i=$t(r);return{hex:a,opacity:i}}function Ir(e,n){const a=e.replace("#",""),r=Wt(n);return`#${a}${r}`}function Er(e){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const qn=s.createContext(null);function Sr(){return s.useContext(qn)}function Cr({children:e}){const n=s.useRef(null);if(!s.isValidElement(e))throw new Error("PopoutAnchor requires a single valid React element as its child");const a=e,r=s.cloneElement(a,{ref:n});return t.jsx(qn.Provider,{value:{anchorRef:n},children:r})}function Tr({children:e}){return t.jsx(o.Box,{p:"sm",children:e})}const Rr=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function Pr(e,n=!0){s.useEffect(()=>{if(!n)return;const a=r=>{const i=r.target;i.closest('[role="dialog"]')||i.closest("[data-popout-trigger]")||i.closest("[data-popout-portal-container]")||i.closest(Rr)||e()};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[e,n])}function Ar(e,n=!0){s.useEffect(()=>{if(!n)return;const a=r=>{r.key==="Escape"&&(r.preventDefault(),e())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[e,n])}const Yt=s.createContext(null),Xt=s.createContext(null);function yt(){const e=s.useContext(Yt);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function jr(){return s.useContext(Yt)}function Lr(){const e=s.useContext(Xt);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function Or(){return s.useContext(Xt)}function Hr({children:e,parentId:n=null,opened:a,defaultOpened:r,onOpenChange:i}){const l=s.useId(),d=s.useRef(null),[g,h]=$.useUncontrolled({value:a,defaultValue:r,finalValue:!1,onChange:i}),p=s.useRef(h);s.useEffect(()=>{p.current=h});const f=s.useCallback((v,S)=>{if(S){p.current(v,S);return}p.current(v)},[]),x=s.useCallback(v=>{f(!0,v)},[f]),y=s.useCallback(v=>{f(!1,v)},[f]),C=s.useCallback(v=>{f(!g,v)},[g,f]),T=s.useMemo(()=>({id:l,isOpen:g,open:x,close:y,toggle:C,triggerRef:d,parentId:n}),[l,g,x,y,C,n]);return t.jsx(Yt.Provider,{value:T,children:e})}function _r({children:e}){const[n,a]=s.useState(null),r=s.useRef([]),i=s.useRef(new Map),l=s.useRef(new Map),[d,g]=s.useState(0),h=s.useCallback(m=>{const w=[];for(const R of r.current)(l.current.get(R)??null)===m&&w.push(R);return w},[]),p=s.useCallback(m=>{const w=[];for(const R of r.current){let j=R;for(;j;){const K=l.current.get(j)??null;if(K===m){w.push(R);break}j=K}}return w},[]),f=s.useCallback(m=>{let w=0,R=m;for(;R;){const j=l.current.get(R)??null;if(!j)break;w++,R=j}return w},[]),x=s.useCallback(m=>{var R;const w=[...m].sort((j,K)=>f(K)-f(j));for(const j of w)(R=i.current.get(j))==null||R()},[f]),y=s.useCallback((m,w,R)=>{if(r.current.includes(m)){i.current.set(m,w);return}const j=R??null,K=h(j),W=[];for(const U of K)W.push(U),W.push(...p(U));x(W);const xe=new Set(W);r.current=r.current.filter(U=>!xe.has(U)),r.current.push(m),i.current.set(m,w),l.current.set(m,j),g(U=>U+1)},[h,p,x]),C=s.useCallback(m=>{if(!r.current.includes(m)){i.current.delete(m),l.current.delete(m);return}r.current=r.current.filter(w=>w!==m),i.current.delete(m),l.current.delete(m),g(w=>w+1)},[]),T=s.useCallback(m=>{const w=r.current.indexOf(m);return w>=0?_t+w:_t},[]),v=s.useCallback(m=>{const w=r.current,R=w.indexOf(m);R===-1||R===w.length-1||(r.current=[...w.filter(j=>j!==m),m],g(j=>j+1))},[]),S=s.useCallback(m=>l.current.get(m)??null,[]),H=s.useCallback((m,w)=>{let R=w;for(;R;){const j=l.current.get(R);if(j===m)return!0;R=j??null}return!1},[]),P=s.useCallback(m=>{const w=[],R=r.current;for(const j of R)H(m,j)&&w.push(j);return w},[H]),E=s.useCallback(m=>{const w=P(m);for(const R of[...w].reverse()){const j=i.current.get(R);j==null||j()}},[P]),A=s.useCallback(m=>{E(m);const w=i.current.get(m);w==null||w()},[E]),_=s.useCallback((m,w)=>{const R=r.current;for(const j of R){if(j===m)continue;l.current.get(j)===w&&A(j)}},[A]),L=s.useCallback(()=>{const m=r.current;if(m.length===0)return;const w=m[m.length-1],R=i.current.get(w);R==null||R()},[]),D=s.useCallback(()=>{const m=[...r.current];for(const w of m){const R=i.current.get(w);R==null||R()}},[]),N=s.useCallback(()=>r.current.length>0,[]),[G,M]=s.useState(!1);s.useEffect(()=>{M(r.current.length>0)},[d]),Ar(L,G),Pr(D,G);const F=s.useMemo(()=>({register:y,unregister:C,getZIndex:T,bringToFront:v,portalContainer:n,zIndexVersion:d,closeFocused:L,closeAll:D,hasOpenPopouts:N,closeWithDescendants:A,closeDescendants:E,closeSiblings:_,getParentId:S,isAncestor:H}),[y,C,T,v,n,d,L,D,N,A,E,_,S,H]);return t.jsxs(Xt.Provider,{value:F,children:[e,t.jsx("div",{ref:a,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function Ae(){return o.useDirection().dir}function ue(e){return e==="rtl"}function Nr(e,n){return ue(n)?1-e:e}function Dr(e,n,a){return Nr(e,a)*n}function kr(e){return ue(e)?{transform:"scaleX(-1)"}:{}}const rn=3;function Gr(e){const{isOpen:n,onPress:a,onDragStart:r,onDrag:i,onDragEnd:l}=e,[d,g]=s.useState({left:0,top:0}),h=s.useRef(!1),p=s.useRef(!1),f=s.useRef(!1),x=s.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),y=s.useCallback(()=>{g({left:0,top:0})},[]),C=s.useCallback(()=>{const P=f.current;return f.current=!1,P},[]),T=s.useCallback(P=>{const E=P.target;if(!(E.tagName==="INPUT"||E.tagName==="TEXTAREA"||E.tagName==="BUTTON"||E.tagName==="SELECT"||E.closest("button")||E.closest("input")||E.closest("textarea")||E.closest("select"))){h.current=!0,p.current=!1,f.current=!1,x.current={x:P.clientX,y:P.clientY,offsetLeft:d.left,offsetTop:d.top},a==null||a(P);try{E.setPointerCapture(P.pointerId)}catch{}}},[d.left,d.top,a]),v=s.useCallback(P=>{if(!h.current)return;const E=P.clientX-x.current.x,A=P.clientY-x.current.y;if(!p.current){if(!(Math.abs(E)>=rn||Math.abs(A)>=rn))return;p.current=!0,r==null||r(P)}const _={left:x.current.offsetLeft+E,top:x.current.offsetTop+A};g(_),i==null||i(_,P)},[i,r]),S=s.useCallback(P=>{if(!h.current)return;h.current=!1;const E=P.target;E.hasPointerCapture(P.pointerId)&&E.releasePointerCapture(P.pointerId),p.current&&(p.current=!1,f.current=!0,l==null||l(P))},[l]),H=d.left!==0||d.top!==0;return n?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:T,onPointerMove:v,onPointerUp:S,onPointerCancel:S,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:d,resetDragOffset:y,hasDragged:H,consumeDragClick:C}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:y,hasDragged:!1,consumeDragClick:C}}function Mr({config:e,onClose:n,dragTriggerProps:a={},actions:r=[],activeTab:i,onTabChange:l,titleId:d}){var C;const g=re(),{style:h,...p}=a,x=e.variant==="tabs"?e:null,y=(x==null?void 0:x.tabs.map(T=>({value:T.id,label:T.label})))??[];return t.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...p,style:{...h},children:[e.variant==="title"?t.jsx(o.Text,{id:d,"data-testid":"popout-header-title",size:"sm",fw:500,children:e.title}):t.jsxs(t.Fragment,{children:[t.jsx(o.VisuallyHidden,{id:d,children:((C=x==null?void 0:x.tabs[0])==null?void 0:C.label)??g.settings}),t.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:y,value:i,onChange:T=>l==null?void 0:l(T),size:"xs"})]}),t.jsxs(o.Group,{gap:4,children:[r.map(T=>t.jsx(o.ActionIcon,{variant:"subtle",onClick:T.onClick,"aria-label":T.label,children:T.icon},T.id)),t.jsx(o.CloseButton,{size:"sm","data-testid":"popout-header-close",onClick:n,"aria-label":g.closePanel})]})]})}function zr(e,n=document){return e===null?null:n.querySelector(`[data-popout-id="${e}"]`)}function an(e,n,a){const{trigger:r,parent:i,panel:l}=a;if(e!==void 0){if(typeof e=="object")return e.current;switch(e){case"parent":return i??l??r;case"panel":return l??i??r;case"trigger":return r;default:{const d=e;throw new Error(`Unknown anchor target: ${String(d)}`)}}}return n==="x"?i??l??r:r??i??l}function Br(e,n){return e==="start"?ue(n)?"right":"left":e==="end"?ue(n)?"left":"right":e}function Fr(e,n,a=Gn,r={}){const{placement:i="left",alignment:l="start",panelHeight:d=0,crossAnchorRect:g=e,direction:h="ltr"}=r;let p,f;switch(i){case"left":p=e.left-n-a,f=sn(g,l,d);break;case"right":p=e.right+a,f=sn(g,l,d);break;case"top":p=ln(g,l,n,h),f=e.top-d-a;break;case"bottom":p=ln(g,l,n,h),f=e.bottom+a;break;default:{const x=i;throw new Error(`Unknown placement: ${String(x)}`)}}return{left:p,top:f}}function sn(e,n,a){switch(n){case"start":return e.top;case"center":return e.top+e.height/2-a/2;case"end":return e.bottom-a;default:{const r=n;throw new Error(`Unknown alignment: ${String(r)}`)}}}function ln(e,n,a,r){switch(n){case"start":return ue(r)?e.right-a:e.left;case"center":return e.left+e.width/2-a/2;case"end":return ue(r)?e.left:e.right-a;default:{const i=n;throw new Error(`Unknown alignment: ${String(i)}`)}}}function Vr(e){var Ie,Ve;const{width:n,height:a,header:r,label:i,children:l,anchorX:d,anchorY:g,placement:h="left",alignment:p="start",gap:f,actions:x,manageFocus:y=!0,onDragStart:C,onDrag:T,onDragEnd:v}=e,{isOpen:S,close:H,triggerRef:P,id:E,parentId:A}=yt(),{getZIndex:_,portalContainer:L,register:D,unregister:N,bringToFront:G,zIndexVersion:M,closeDescendants:F}=Lr(),m=Sr(),w=Ae(),R=s.useId(),j=`popout-panel-${E}`,K=`popout-title-${R}`,[W,xe]=s.useState(null),U=s.useRef(!1),le=s.useRef(null),V=s.useCallback(()=>{G(E)},[G,E]),{dragTriggerProps:Z,dragOffset:ee,resetDragOffset:je,hasDragged:Le,consumeDragClick:ne}=Gr({isOpen:S,onPress:V,onDragStart:C,onDrag:T,onDragEnd:v}),me=(r==null?void 0:r.variant)==="tabs",X=(r==null?void 0:r.variant)==="tabs"?r:null,ve=(X==null?void 0:X.defaultTab)??((Ie=X==null?void 0:X.tabs[0])==null?void 0:Ie.id),[pe,Be]=s.useState(ve),Oe=f??(A===null?0:Mn),Qe=s.useCallback((z,J)=>{var Y;Be(z),(Y=X==null?void 0:X.onTabChange)==null||Y.call(X,z,J)},[X]),Fe=s.useCallback(z=>{z.stopPropagation(),G(E),!ne()&&F(E)},[F,G,ne,E]),ae=s.useCallback(z=>{F(E),H(z)},[F,H,E]),ge=s.useRef(H);s.useEffect(()=>{ge.current=H});const we=s.useCallback(()=>{ge.current()},[]);s.useEffect(()=>(S?D(E,we,A):N(E),()=>{N(E)}),[S,E,D,N,we,A]);const be=s.useCallback(()=>{const z={trigger:P.current,parent:zr(A),panel:(m==null?void 0:m.anchorRef.current)??null};return{inline:an(d,"x",z),block:an(g,"y",z)}},[P,A,m,d,g]),He=s.useCallback(()=>{var se;const{inline:z,block:J}=be(),Y=z??J,fe=J??z;if(!Y||!fe)return;const Q=(se=le.current)==null?void 0:se.getBoundingClientRect(),Ee=Math.max(n,(Q==null?void 0:Q.width)??0),ce=Math.max(a??0,(Q==null?void 0:Q.height)??0),k=Br(h,w),oe=k==="top"||k==="bottom",Ue=oe?fe:Y,st=oe?Y:fe,Se=Fr(Ue.getBoundingClientRect(),Ee,Oe,{placement:k,alignment:p,panelHeight:ce,crossAnchorRect:st.getBoundingClientRect(),direction:w});xe(De=>De&&De.left===Se.left&&De.top===Se.top?De:Se)},[be,n,a,h,p,Oe,w]);if($.useIsomorphicEffect(()=>{if(!S){xe(null);return}U.current||(je(),me&&Be(ve)),He()},[S,He,je,me,ve]),s.useEffect(()=>{if(!S)return;let z=0;const J=()=>{z===0&&(z=requestAnimationFrame(()=>{z=0,He()}))},Y=new ResizeObserver(J),fe=new MutationObserver(J),{inline:Q,block:Ee}=be();for(const k of new Set([Q,Ee].filter(oe=>oe!==null)))Y.observe(k),fe.observe(k,{attributes:!0,attributeFilter:["style","class"]});le.current&&Y.observe(le.current);const ce=()=>{Le||J()};return window.addEventListener("resize",ce),window.addEventListener("scroll",ce,!0),()=>{z!==0&&cancelAnimationFrame(z),Y.disconnect(),fe.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("scroll",ce,!0)}},[S,He,be,Le]),s.useEffect(()=>{var z;if(y){if(S){const J=setTimeout(()=>{var Y;(Y=le.current)==null||Y.focus()},0);return()=>{clearTimeout(J)}}U.current&&((z=P.current)==null||z.focus())}},[S,y,P]),s.useEffect(()=>{U.current=S},[S]),!S||!L)return null;const et=_(E),_e={left:((W==null?void 0:W.left)??0)+ee.left,top:((W==null?void 0:W.top)??0)+ee.top},Ne=t.jsxs(o.Paper,{ref:le,id:j,role:"dialog","aria-modal":"false","aria-labelledby":r?K:void 0,"aria-label":r?void 0:i,tabIndex:-1,radius:8,onClick:Fe,"data-testid":"popout-panel","data-popout-id":E,...A&&{"data-parent-id":A},style:{position:"fixed",left:_e.left,top:_e.top,minWidth:n,width:"min-content",...a!==void 0&&{minHeight:a},...W===null&&{visibility:"hidden"},zIndex:et,backgroundColor:"var(--mantine-color-body)",border:"1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", ")},children:[r?t.jsx(Mr,{config:r,onClose:ae,dragTriggerProps:Z,activeTab:pe,onTabChange:Qe,actions:x,titleId:K}):null,t.jsx(o.Box,{"data-testid":"popout-panel-content",children:me?(Ve=X==null?void 0:X.tabs.find(z=>z.id===pe))==null?void 0:Ve.content:l})]});return wo.createPortal(Ne,L)}function Ur({children:e,action:n="toggle"}){const{open:a,toggle:r,triggerRef:i,isOpen:l,id:d}=yt(),g=s.useCallback(f=>{if(f.stopPropagation(),n==="open"){a(f);return}r(f)},[n,a,r]);if(!s.isValidElement(e))throw new Error("PopoutTrigger requires a single valid React element as its child");const h=`popout-panel-${d}`,p=e;return s.cloneElement(p,{onClick:f=>{var x,y;(y=(x=p.props).onClick)==null||y.call(x,f),g(f)},ref:i,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":h,"aria-haspopup":"dialog"})}function $r({children:e,opened:n,defaultOpened:a,onOpenChange:r}){const i=jr(),l=(i==null?void 0:i.id)??null;return t.jsx(Hr,{parentId:l,opened:n,defaultOpened:a,onOpenChange:r,children:e})}const Ge=Object.assign($r,{Trigger:Ur,Panel:Vr,Content:Tr,Anchor:Cr}),Wr=s.forwardRef(function({icon:n,size:a="xs",...r},i){const{isOpen:l}=yt();return t.jsx(o.ActionIcon,{ref:i,"data-testid":"popout-button",variant:l?"light":"subtle",size:a,c:l?void 0:"dimmed",...r,children:n})});function Zn({children:e}){return t.jsx(_r,{children:e})}const cn=4,dn=4,Yr=2,Xr=72,Kr=54,qr=220,un=0,Et=100,pn=9,fn=7,Zr=/^#[0-9A-F]{6}$/iu,Jr=1.1;function St(e){const n=e==="start"?dn:0,a=e==="end"?dn:0;return{borderStartStartRadius:n,borderEndStartRadius:n,borderStartEndRadius:a,borderEndEndRadius:a}}function Qr(){const e=ze();return s.useMemo(()=>{var a;return((a=new Intl.NumberFormat(e).formatToParts(Jr).find(r=>r.type==="decimal"))==null?void 0:a.value)??"."},[e])}function Jn({color:e,defaultColor:n,opacity:a,defaultOpacity:r=Et,onColorChange:i,onOpacityChange:l,label:d,showOpacity:g=!0,disabled:h=!1,onFocus:p,onBlur:f}){const x=re(),y=zt(),C=Qr(),T=s.useId(),[v,S]=$.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:i}),[H,P]=$.useUncontrolled({value:a,defaultValue:void 0,finalValue:void 0,onChange:l}),E=v===void 0,A=H===void 0,_=E&&(!g||A),L=v??n,D=H??r,[N,G]=s.useState(L.replace("#","").toUpperCase()),[M,F]=s.useState(D);s.useEffect(()=>{G(L.replace("#","").toUpperCase())},[L]),s.useEffect(()=>{F(D)},[D]);const m=V=>{if(V.length===pn){S(V.slice(0,fn).toUpperCase()),g&&P($t(V.slice(fn,pn)));return}S(V.toUpperCase())},w=()=>`${L}${Wt(D)}`.toUpperCase(),R=V=>{G(V.currentTarget.value.toUpperCase())},j=V=>{const Z=N.toUpperCase(),ee=Z.startsWith("#")?Z:`#${Z}`;Zr.test(ee)&&ee!==L?S(ee,V):G(L.replace("#","").toUpperCase()),f==null||f(V)},K=V=>{F(V)},W=V=>{const Z=typeof M=="string"?y(M):M;if(Number.isNaN(Z)){F(D),f==null||f(V);return}const ee=Math.min(Et,Math.max(un,Z));ee!==D&&P(ee,V),F(ee),f==null||f(V)},xe=V=>{S(void 0,V),g&&P(void 0,V)},U=g?"middle":"end",le=t.jsxs(o.Group,{"data-testid":"compact-color-input",gap:cn,wrap:"nowrap",children:[t.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[t.jsxs(Ge,{children:[t.jsx(Ge.Trigger,{children:t.jsx(o.ActionIcon,{variant:"filled",size:u.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...St("start")},"data-testid":"compact-color-input-swatch",disabled:h,"aria-label":x.colorSwatch,children:t.jsx(o.ColorSwatch,{color:L,size:u.GLYPH,radius:Yr,style:{border:`1px solid ${b.BORDER}`}})})}),t.jsx(Ge.Panel,{width:qr,header:{variant:"title",title:d??x.colorPanelTitle},placement:"bottom",alignment:"start",gap:cn,children:t.jsx(Ge.Content,{children:t.jsx(o.ColorPicker,{format:"hexa",value:w(),onChange:m,swatches:[...Fn]})})})]}),t.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:h,value:N,onChange:R,onFocus:p,onBlur:j,"aria-label":x.colorHexValue,"data-is-default":E?"true":"false",w:Xr,styles:{input:{...St(U),fontFamily:"monospace",textTransform:"uppercase",...E?{fontStyle:"italic",color:b.CHROME}:{}}}}),g&&t.jsxs(t.Fragment,{children:[t.jsx(o.Divider,{orientation:"vertical",color:b.BORDER,h:u.CONTROL_HEIGHT,my:0}),t.jsx(o.NumberInput,{"data-testid":"compact-color-input-opacity",disabled:h,value:M,onChange:K,onFocus:p,onBlur:W,min:un,max:Et,decimalSeparator:C,hideControls:!0,suffix:"%","aria-label":x.opacity,"data-is-default":A?"true":"false",w:Kr,styles:{input:{...St("end"),textAlign:"end",...A?{fontStyle:"italic",color:b.CHROME}:{}}}})]})]}),!_&&t.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:b.CHROME,"data-testid":"compact-color-input-reset",disabled:h,"aria-label":x.resetToDefault(d??x.colorGenericName),onClick:xe,children:t.jsx(te,{name:"reset",size:u.CHEVRON})})]});return d===void 0?le:t.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":T,children:[t.jsx(o.Text,{id:T,"data-testid":"compact-color-input-label",size:"xs",c:b.CHROME,mb:1,lh:1.2,children:d}),le]})}const ft=u.GUTTER,hn=4,ea=1,ta=1.2,na="calc(-1 * var(--mantine-spacing-sm) - 1px)";function oa({label:e,actions:n,children:a,bleed:r=!1}){const i=s.useId(),l=n!=null;return t.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":i,children:[t.jsx(o.Divider,{"data-testid":"control-group-divider",color:b.DIVIDER,size:ea,style:{marginBlockStart:ft,marginBlockEnd:0,marginInline:r?na:void 0}}),t.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:hn,boxSizing:"border-box",paddingBlock:ft,paddingInline:ft},children:[t.jsx(o.Box,{component:"span",id:i,"data-testid":"control-group-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:ta,color:b.VALUE},children:e}),l&&t.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:hn,flex:"0 0 auto"},children:n})]}),t.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:ft,children:a})]})}function Pe(e){const n=s.useRef(void 0);s.useEffect(()=>{process.env.NODE_ENV==="production"||e===void 0||n.current!==e&&(n.current=e,console.warn(e))},[e])}const gn=250,ra=4;function aa({name:e,bubbleId:n}){const{isOpen:a,open:r,close:i}=yt();return t.jsx(Ge.Trigger,{action:"open",children:t.jsx(o.UnstyledButton,{type:"button",title:e,"aria-label":e,"aria-describedby":a?n:void 0,"data-testid":"info-circle",onMouseEnter:r,onMouseLeave:i,onFocus:r,onBlur:i,style:{flex:"0 0 auto",width:u.GLYPH,height:u.GLYPH,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:b.CHROME,cursor:"default"},children:t.jsx(te,{name:"info",size:u.CHEVRON})})})}function Qn({children:e,label:n,opened:a,defaultOpened:r,onOpenChange:i}){const l=re(),d=s.useId(),g=Or()!==null,h=l.about(n),p=t.jsxs(Ge,{opened:a,defaultOpened:r,onOpenChange:i,children:[t.jsx(aa,{name:h,bubbleId:d}),t.jsx(Ge.Panel,{width:gn,label:h,placement:"bottom",alignment:"start",gap:ra,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:t.jsx(o.Box,{id:d,w:gn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:b.PROSE},children:e})})]});return g?p:t.jsx(Zn,{children:p})}function ot(e){return e!=null&&e!==!1}function ye({children:e}){return t.jsx(o.Box,{"data-testid":"trailing-slot",style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center"},children:e})}const eo=s.forwardRef(function(n,a){const{label:r,changed:i=!1,icon:l,onClick:d,disabled:g=!1,loading:h=!1,style:p,...f}=n,x=re(),y=i?x.sectionHasConfiguredValues(r):r,C=i?b.VALUE:b.CHROME;return t.jsx(o.ActionIcon,{...f,ref:a,type:"button",variant:"subtle",color:"gray",size:u.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":C}}),title:y,"aria-label":y,"aria-busy":h,disabled:g,loading:h,"data-testid":"advanced-button","data-changed":i?"true":"false",onClick:d,style:{flex:"0 0 auto",...p},children:l??t.jsx(te,{name:"gear",size:u.GLYPH})})}),Ct=4,sa=1,xn=6,ia=12,la=1.2;function ca(e){const{label:n,opened:a,defaultOpened:r,onOpenChange:i,hasConfiguredValues:l=!1,empty:d=!1,onAdd:g,info:h,actions:p,children:f}=e,x=re(),y=Ae(),C=s.useId(),T=s.useId(),v=s.useId(),[S,H]=$.useUncontrolled({value:a,defaultValue:r,finalValue:!0,onChange:i}),P=!d&&s.Children.toArray(f).length>0,E=h!=null;Pe(d||P?void 0:`ControlSection "${n}" was given no children, and it holds the rows of a section. Pass the rows, set "empty" to draw it as a single row with a "+", or do not render it: a section header whose chevron opens onto nothing is a dead end for the reader.`);const A=F=>{H(!S,F)},_=S?x.collapseSection(n):x.expandSection(n),L=x.addToSection(n),D=ue(y)?"chevronLeft":"chevronRight",N={flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},G={display:"flex",alignItems:"center",gap:Ct,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},M=t.jsx(o.Box,{component:"span",id:C,title:n,"data-testid":"control-section-name",style:{minWidth:0,fontSize:ia,fontWeight:500,lineHeight:la,color:d?b.CHROME:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n});return t.jsxs(o.Box,{role:"group","aria-labelledby":C,"aria-describedby":E?v:void 0,"data-testid":"control-section","data-empty":d?"true":void 0,children:[t.jsx(o.Divider,{"data-testid":"control-section-divider",color:b.DIVIDER,size:sa,my:0,mx:0}),t.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Ct,boxSizing:"border-box",height:u.SECTION_HEADER,paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT},children:[P?t.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":_,"aria-expanded":S,"aria-controls":T,onClick:A,style:{...G,cursor:"pointer"},children:[t.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:N,children:t.jsx(te,{name:S?"chevronDown":D,size:u.CHEVRON})}),M]}):t.jsxs(o.Box,{style:G,children:[t.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:N}),M]}),l&&t.jsx(o.Box,{role:"img","aria-label":x.sectionHasConfiguredValues(n),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:xn,height:xn,borderRadius:"50%",background:b.ACCENT}}),E&&t.jsx(Qn,{label:n,children:h}),t.jsx(o.Box,{style:{flex:"1 1 auto"}}),p!=null&&t.jsx(o.Box,{"data-testid":"control-section-actions",style:{display:"flex",alignItems:"center",gap:Ct,flex:"0 0 auto"},children:p}),d&&g!==void 0&&t.jsx(ye,{children:t.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:u.CONTROL_HEIGHT,radius:"sm",c:b.CHROME,title:L,"aria-label":L,"data-testid":"control-section-add",onClick:g,children:t.jsx(te,{name:"plus",size:u.GLYPH})})})]}),E&&t.jsx(o.Box,{id:v,"data-testid":"control-section-description",hidden:!0,children:h}),P&&t.jsx(o.Collapse,{id:T,in:S,children:t.jsx(o.Box,{"data-testid":"control-section-content",style:{paddingInlineStart:u.PAD_LEFT,paddingInlineEnd:u.PAD_RIGHT,paddingBottom:u.SECTION_PAD_BOTTOM},children:t.jsx(o.Stack,{gap:0,children:f})})})]})}const Tt="control-sub-group",mn=4,da=10,ua=1.2;function pa(e){const{label:n,opened:a,defaultOpened:r,onOpenChange:i,children:l}=e,d=re(),g=Ae(),h=s.useRef(void 0),[p,f]=$.useUncontrolled({value:a,defaultValue:r,finalValue:!1,onChange:i}),x=s.useCallback(S=>{h.current=S},[]),y=s.useCallback(S=>{const H=h.current;h.current=void 0,f(S===Tt,H)},[f]),C=p?d.collapseSection(n):d.expandSection(n);let T="chevronDown";p||(T=ue(g)?"chevronLeft":"chevronRight");const v={item:{border:"none",background:"transparent"},control:{paddingInline:0,paddingBlock:0,minHeight:u.TOGGLE_PITCH,color:b.CHROME},label:{paddingBlock:0,fontSize:"var(--mantine-font-size-xs)",lineHeight:ua,color:b.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:mn,color:b.CHROME},content:{paddingBlock:0,paddingInlineStart:u.GUTTER,paddingInlineEnd:0}};return t.jsx(o.Accordion,{"data-testid":"control-sub-group",value:p?Tt:null,onChange:y,chevronPosition:"left",chevronSize:u.GLYPH_SLOT,disableChevronRotation:!0,chevron:t.jsx(te,{name:T,size:da}),styles:v,children:t.jsxs(o.Accordion.Item,{value:Tt,"data-testid":"control-sub-group-item",children:[t.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":C,onClick:x,children:t.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:n,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})}),t.jsx(o.Accordion.Panel,{"data-testid":"control-sub-group-panel",children:t.jsx(o.Box,{"data-testid":"control-sub-group-content",style:{display:"flex",flexDirection:"column",gap:mn},children:l})})]})})}function Je(e){if("key"in e)return{source:"keyboard"};const n=e.nativeEvent;return typeof PointerEvent<"u"&&n instanceof PointerEvent?{source:n.pointerType===""?"keyboard":"pointer"}:{source:n.detail===0?"keyboard":"pointer"}}function fa(e){const n=re();return s.useMemo(()=>({...n,...e}),[n,e])}const ie=-1;function Ze(e,n,a){return Math.min(Math.max(e,n),a)}function ha(e,n,a,r,i){const{rowCount:l,columnCount:d,pageSize:g}=a,h=l-1,p=d-1;if(d===0)return;const f=ue(r)?"ArrowLeft":"ArrowRight",x=ue(r)?"ArrowRight":"ArrowLeft";if(n===f)return{row:e.row,column:Math.min(e.column+1,p)};if(n===x)return{row:e.row,column:Math.max(e.column-1,0)};if(n==="ArrowDown")return{row:Ze(e.row+1,ie,h),column:e.column};if(n==="ArrowUp")return{row:Ze(e.row-1,ie,h),column:e.column};if(n==="Home")return i.jumpToEnd?{row:ie,column:0}:{row:e.row,column:0};if(n==="End")return i.jumpToEnd?{row:Math.max(h,ie),column:p}:{row:e.row,column:p};if(n==="PageDown")return{row:Ze(Math.max(e.row,0)+g,0,Math.max(h,0)),column:e.column};if(n==="PageUp")return{row:Ze(Math.max(e.row,0)-g,0,Math.max(h,0)),column:e.column}}function ga(e,n){const a=n.rowCount-1,r=Math.max(n.columnCount-1,0);return{row:Ze(e.row,ie,Math.max(a,ie)),column:Ze(e.column,0,r)}}function ht(e,n){return e.row===n.row&&e.column===n.column}function xa(e,n,a){const r=Math.min(n,a),i=Math.max(n,a);return e.slice(r,i+1)}function kt(e,n){const a=new Set(e),r=[];for(const i of a)n.includes(i)||r.push(i);for(const i of n)a.has(i)&&r.push(i);return r}function ma(e){const{ids:n,index:a,selected:r,anchor:i,modifiers:l,mode:d}=e,g=n[a];if(d==="none"||g===void 0)return{selected:[...r],anchor:i};if(d==="single")return{selected:[g],anchor:g};const h=i===void 0?-1:n.indexOf(i);if(l.extend&&h!==-1){const p=xa(n,h,a);return{selected:l.toggle?kt([...r,...p],n):p,anchor:i}}if(l.toggle){const p=new Set(r);return p.has(g)?p.delete(g):p.add(g),{selected:kt(p,n),anchor:g}}return{selected:[g],anchor:g}}function ba(e,n,a){return a!=="multiple"?{selected:[...n],anchor:void 0}:{selected:kt([...n,...e],e),anchor:e[0]}}function bn(e,n){return e==null?"":typeof e=="string"?e:typeof e=="number"?Number.isFinite(e)?n.number.format(e):"":typeof e=="boolean"?e?n.yes:n.no:Number.isNaN(e.getTime())?"":n.date.format(e)}function yn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function ya(e,n,a){const r=yn(e),i=yn(n);return r||i?r&&i?0:r?-1:1:typeof e=="number"&&typeof n=="number"?e-n:typeof e=="boolean"&&typeof n=="boolean"?e===n?0:e?1:-1:e instanceof Date&&n instanceof Date?e.getTime()-n.getTime():a.compare(String(e),String(n))}const va=de.tableFeatures({columnFilteringFeature:de.columnFilteringFeature,columnOrderingFeature:de.columnOrderingFeature,columnVisibilityFeature:de.columnVisibilityFeature,filteredRowModel:de.createFilteredRowModel(),globalFilteringFeature:de.globalFilteringFeature,rowSelectionFeature:de.rowSelectionFeature,rowSortingFeature:de.rowSortingFeature,sortedRowModel:de.createSortedRowModel()}),wa=320,Ia=8,Ea=12,Sa=1.2,Ca="var(--mantine-primary-color-light)",vn="mantine-focus-auto",Rt=[],Ta=[];function wn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function Ra(e,n,a){return Math.min(Math.max(e,n),a)}function Pa(e,n){const{data:a,columns:r,getRowId:i,label:l,labelledBy:d,labels:g,height:h=wa,rowHeight:p=u.DATA_PITCH,headerHeight:f=u.CONTROL_HEIGHT,overscan:x=Ia,selectionMode:y="multiple",selectedIds:C,defaultSelectedIds:T,onSelectionChange:v,sorting:S,defaultSorting:H,onSortingChange:P,hiddenColumns:E,defaultHiddenColumns:A,onHiddenColumnsChange:_,columnOrder:L,defaultColumnOrder:D,onColumnOrderChange:N,filter:G,defaultFilter:M,onFilterChange:F,searchable:m=!1,onRowClick:w,onRowDoubleClick:R,onRowContextMenu:j,onFocus:K,onBlur:W,empty:xe}=e,U=fa(g),le=Ae(),V=ze(),Z=Ye(),ee=Wn({numeric:!0,sensitivity:"variant"}),je=s.useMemo(()=>new Intl.DateTimeFormat(V),[V]),Le=s.useMemo(()=>({number:Z,date:je,yes:U.yes,no:U.no}),[Z,je,U.yes,U.no]),[ne,me]=$.useUncontrolled({value:C,defaultValue:T,finalValue:Rt,onChange:(c,I)=>{v==null||v([...c],I)}}),[X,ve]=$.useUncontrolled({value:S,defaultValue:H,finalValue:Ta,onChange:(c,I)=>{P==null||P([...c],I)}}),[pe,Be]=$.useUncontrolled({value:E,defaultValue:A,finalValue:Rt,onChange:(c,I)=>{_==null||_([...c],I)}}),[Oe,Qe]=$.useUncontrolled({value:L,defaultValue:D,finalValue:Rt,onChange:(c,I)=>{N==null||N([...c],I)}}),[Fe,ae]=$.useUncontrolled({value:G,defaultValue:M,finalValue:"",onChange:(c,I)=>{F==null||F(c,I)}}),ge=s.useMemo(()=>{const c=new Map;for(const I of r)c.set(I.id,I);return c},[r]),we=JSON.stringify(pe),be=s.useMemo(()=>{const c=new Set(pe);return r.filter(I=>(I.filterable??!0)&&!c.has(I.id)).map(I=>I.id)},[r,we]),He=s.useMemo(()=>{const c=Fe.trim();if(c!=="")return{query:c.toLocaleLowerCase(V),columnIds:be}},[Fe,V,be]),et=s.useMemo(()=>[...a],[a]),_e=s.useMemo(()=>r.map(c=>({id:c.id,accessorFn:I=>c.value(I),enableSorting:c.sortable??!0,enableHiding:c.hideable??!0,enableGlobalFilter:c.filterable??!0,sortDescFirst:c.descendingFirst,sortFn:(I,O)=>ya(c.value(I.original),c.value(O.original),ee)})),[r,ee]),at=JSON.stringify(X),Xe=s.useMemo(()=>X.map(c=>({id:c.id,desc:c.desc})),[at]),Ne=s.useMemo(()=>{const c={};for(const I of pe)c[I]=!1;return c},[pe]),Ie=s.useMemo(()=>{const c={};for(const I of ne)c[I]=!0;return c},[ne]),Ve=s.useMemo(()=>[...Oe],[Oe]),z=s.useRef(void 0),J=de.useTable({features:va,data:et,columns:_e,getRowId:i,enableRowSelection:y!=="none",enableMultiRowSelection:y==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(c,I,O)=>{const B=O;if(B===void 0||!B.columnIds.includes(I))return!1;const q=ge.get(I);return q===void 0?!1:bn(q.value(c.original),Le).toLocaleLowerCase(V).includes(B.query)},state:{sorting:Xe,columnVisibility:Ne,columnOrder:Ve,rowSelection:Ie,globalFilter:He},onSortingChange:c=>{const I=de.functionalUpdate(c,Xe);ve(I.map(O=>({id:O.id,desc:O.desc})),z.current)},onColumnVisibilityChange:c=>{const I=de.functionalUpdate(c,Ne);Be(Object.keys(I).filter(O=>!I[O]))},onColumnOrderChange:c=>{Qe(de.functionalUpdate(c,Ve))},onRowSelectionChange:c=>{me(Object.keys(de.functionalUpdate(c,Ie)))}}),{rows:Y}=J.getRowModel(),fe=J.getVisibleLeafColumns(),Q=Y.length,Ee=fe.length,ce=s.useMemo(()=>Y.map(c=>c.id),[Y]),k=s.useRef(null),oe=s.useRef(null),Ue=Io.useVirtualizer({count:Q,getScrollElement:()=>k.current,estimateSize:()=>p,getItemKey:c=>ce[c]??c,overscan:x}),[st,Se]=s.useState({row:ie,column:0}),se=s.useMemo(()=>ga(st,{rowCount:Q,columnCount:Ee}),[st,Q,Ee]),De=s.useRef(!1),vt=s.useRef(void 0),go=c=>{c.row>=0&&Ue.scrollToIndex(c.row),De.current=!0,Se(I=>ht(I,c)?I:c)};s.useLayoutEffect(()=>{var O;if(!De.current)return;const c=`[data-grid-row="${se.row}"][data-grid-column="${se.column}"]`,I=(O=oe.current)==null?void 0:O.querySelector(c);I instanceof HTMLElement&&(De.current=!1,I.focus())});const qt=(c,I)=>{vt.current=c.anchor,!(c.selected.length===ne.length&&c.selected.every((B,q)=>B===ne[q]))&&me(c.selected,I)},it=(c,I,O)=>{qt(ma({ids:ce,index:c,selected:ne,anchor:vt.current,modifiers:I,mode:y}),O)},Zt=(c,I,O)=>{const B=Y[c];B!==void 0&&(w==null||w(B.original,I,O))},xo=(c,I)=>{c.getCanSort()&&(z.current=I,c.toggleSorting(void 0,I.shiftKey&&c.getCanMultiSort()),z.current=void 0)},mo=()=>{var O;const c=((O=k.current)==null?void 0:O.clientHeight)??0,I=Math.floor((c===0?p*10:c)/p);return Math.max(1,I-1)},bo=c=>{const I=y==="multiple",O=c.ctrlKey||c.metaKey;if(I&&O&&(c.key==="a"||c.key==="A")){c.preventDefault(),qt(ba(ce,ne,y),c);return}if(se.row>=0&&(c.key===" "||c.key==="Enter")){c.preventDefault(),c.key===" "?it(se.row,{extend:c.shiftKey,toggle:!c.shiftKey},c):(it(se.row,{extend:!1,toggle:!1},c),Zt(se.row,c,{source:"keyboard"}));return}const B=ha(se,c.key,{rowCount:Q,columnCount:Ee,pageSize:mo()},le,{jumpToEnd:O});B!==void 0&&(c.preventDefault(),go(B),I&&c.shiftKey&&B.row>=0&&B.row!==se.row&&it(B.row,{extend:!0,toggle:!1},c))};s.useImperativeHandle(n,()=>({scrollToRow:c=>{c>=0&&c<Q&&Ue.scrollToIndex(c)},setColumnHidden:(c,I)=>{var O;(O=J.getColumn(c))==null||O.toggleVisibility(!I)},moveColumn:(c,I)=>{const O=J.getAllLeafColumns().map(q=>q.id),B=O.indexOf(c);B!==-1&&(O.splice(B,1),O.splice(Ra(I,0,O.length),0,c),J.setColumnOrder(O))},clearSelection:()=>{vt.current=void 0,me([])}}),[J,Ue,Q,me]);const yo=fe.reduce((c,I)=>{var O;return c+(((O=ge.get(I.id))==null?void 0:O.width)??u.FIELD)},0),Jt=(c,I)=>{const O=(c==null?void 0:c.width)??u.FIELD;return{flex:I===Ee-1?`1 1 ${String(O)}px`:`0 0 ${String(O)}px`,minWidth:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:(c==null?void 0:c.align)==="end"?"flex-end":"flex-start",paddingInline:u.GUTTER,outlineOffset:-2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},lt=y!=="none",Qt=U.rowsShown(Z.format(Q),Z.format(a.length)),vo=()=>xe!==void 0?xe:a.length===0?U.noRows:U.noMatchingRows;return t.jsxs(o.Box,{"data-testid":"data-table",dir:ue(le)?"rtl":void 0,onFocus:K,onBlur:W,style:{display:"flex",flexDirection:"column",gap:u.TRAIL_GAP,width:"100%",color:b.VALUE},children:[m&&t.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:u.GUTTER},children:[t.jsx(o.TextInput,{"data-testid":"data-table-search",size:"xs",type:"search","aria-label":U.search,placeholder:U.searchPlaceholder,value:Fe,onChange:c=>{ae(c.currentTarget.value,c)},rightSection:Fe===""?void 0:t.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:u.CONTROL_HEIGHT,"aria-label":U.clearSearch,onClick:c=>{ae("",c)},children:t.jsx(te,{name:"close",size:u.CHEVRON})}),rightSectionPointerEvents:"all",style:{flex:"1 1 auto",minWidth:0}}),t.jsx(o.Box,{component:"span","data-testid":"data-table-count","aria-hidden":"true",dir:"auto",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:b.CHROME},children:Qt})]}),t.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[Qt,lt&&ne.length>0?` ${U.rowsSelected(Z.format(ne.length))}`:""]}),t.jsxs(o.Box,{ref:k,"data-testid":"data-table-viewport",style:{height:h,overflow:"auto",position:"relative",border:`1px solid ${b.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:b.PANEL},children:[t.jsxs(o.Table,{ref:oe,role:"grid","aria-label":d===void 0&&l===void 0?U.dataTable:l,"aria-labelledby":d,"aria-rowcount":Q+1,"aria-colcount":Ee,"aria-multiselectable":y==="multiple"?!0:void 0,onKeyDown:bo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:lt,highlightOnHoverColor:b.SURFACE,style:{display:"grid",width:"100%",minWidth:yo,fontSize:Ea,lineHeight:Sa},children:[t.jsx(o.Table.Thead,{style:{display:"grid",position:"sticky",insetBlockStart:0,zIndex:1,background:b.PANEL,borderBlockEnd:`1px solid ${b.DIVIDER}`},children:t.jsx(o.Table.Tr,{role:"row","aria-rowindex":1,style:{display:"flex",width:"100%",height:f},children:fe.map((c,I)=>{const O=ge.get(c.id),B=c.getCanSort(),q=c.getIsSorted(),he=se.row===ie&&se.column===I,ct=q===!1?-1:c.getSortIndex(),dt=he?0:-1,tt=t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:O==null?void 0:O.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:q===!1?void 0:b.VALUE},children:(O==null?void 0:O.header)??c.id}),q!==!1&&t.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":wn(q),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:b.VALUE,transform:q==="asc"?"rotate(180deg)":void 0},children:t.jsx(te,{name:"chevronDown",size:u.CHEVRON})}),Xe.length>1&&ct>=0&&t.jsx(o.Box,{component:"span","data-testid":"data-table-sort-priority","aria-hidden":"true",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-xs)",color:b.CHROME},children:Z.format(ct+1)})]});return t.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":I+1,"aria-sort":B?wn(q):void 0,"data-grid-row":B?void 0:ie,"data-grid-column":B?void 0:I,tabIndex:B?void 0:dt,className:B?void 0:vn,onFocus:B?void 0:()=>{Se(Ce=>ht(Ce,{row:ie,column:I})?Ce:{row:ie,column:I})},style:{...Jt(O,I),gap:u.GUTTER/2,height:f,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:b.CHROME,textAlign:"start"},children:B?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":ie,"data-grid-column":I,tabIndex:dt,onClick:Ce=>{Se({row:ie,column:I}),xo(c,Ce)},onFocus:()=>{Se(Ce=>ht(Ce,{row:ie,column:I})?Ce:{row:ie,column:I})},style:{display:"flex",alignItems:"center",gap:u.GUTTER/2,justifyContent:(O==null?void 0:O.align)==="end"?"flex-end":"flex-start",flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",outlineOffset:-2,cursor:"pointer"},children:tt}):tt},c.id)})})}),t.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Ue.getTotalSize()},children:Ue.getVirtualItems().map(c=>{const I=Y[c.index];if(I===void 0)return null;const O=ne.includes(I.id);return t.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":c.index,"data-selected":O?"true":void 0,"aria-rowindex":c.index+2,"aria-selected":lt?O:void 0,onDoubleClick:B=>{R==null||R(I.original,B)},onContextMenu:B=>{j==null||j(I.original,B)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:p,transform:`translateY(${String(c.start)}px)`,background:O?Ca:void 0,cursor:lt?"pointer":void 0},children:fe.map((B,q)=>{const he=ge.get(B.id),ct=se.row===c.index&&se.column===q,dt=he==null?void 0:he.value(I.original),tt=bn(dt,Le),Ce=(he==null?void 0:he.cell)===void 0?t.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:tt}):he.cell(I.original);return t.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":q+1,"data-grid-row":c.index,"data-grid-column":q,tabIndex:ct?0:-1,className:vn,title:(he==null?void 0:he.cell)===void 0?tt:void 0,onFocus:()=>{Se(Te=>ht(Te,{row:c.index,column:q})?Te:{row:c.index,column:q})},onClick:Te=>{Se({row:c.index,column:q}),it(c.index,{extend:Te.shiftKey,toggle:Te.metaKey||Te.ctrlKey},Te),Zt(c.index,Te,Je(Te))},style:Jt(he,q),children:Ce},B.id)})},I.id)})})]}),Q===0&&t.jsx(o.Box,{"data-testid":"data-table-empty",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:u.PAD_LEFT,fontSize:"var(--mantine-font-size-sm)",color:b.CHROME},children:vo()})]})]})}const Aa=s.forwardRef(Pa);function ja(){return crypto.randomUUID().slice(0,8)}function mt(e,n){return{id:ja(),offset:e,color:n}}function to(){return[mt(0,"#6366F1"),mt(1,"#06B6D4")]}const La=2,Oa=5,Ha=80,_a=0,Pt=100,At=0,Na=360,Da=[0,90,180,270,360];function ka({stops:e,defaultStops:n,direction:a,defaultDirection:r=At,showDirection:i=!0,onChange:l,onChangeStart:d,onChangeEnd:g,minStops:h=La,maxStops:p=Oa}){const f=re(),x=Ye({maximumFractionDigits:0}),y=s.useId(),C=s.useId(),T=s.useMemo(()=>to(),[]),[v,S]=$.useUncontrolled({value:e,defaultValue:n,finalValue:T,onChange:(m,w)=>{l==null||l(m,H,w)}}),[H,P]=$.useUncontrolled({value:a,defaultValue:r,finalValue:At,onChange:(m,w)=>{l==null||l(v,m,w)}}),E=s.useRef(!1),A=m=>{E.current||(E.current=!0,d==null||d(m))},_=(m,w)=>{E.current=!1,g==null||g(m,w)},L=(m,w)=>v.map((R,j)=>j===m?{...R,color:w}:R),D=(m,w)=>v.map((R,j)=>j===m?{...R,offset:w/Pt}:R),N=m=>{if(v.length>=p)return;const w=v[v.length-1],R=w===void 0?.5:(w.offset+1)/2,j=[...v,mt(R,xt)];j.sort((K,W)=>K.offset-W.offset),S(j,m)},G=(m,w)=>{v.length<=h||S(v.filter((R,j)=>j!==m),w)},M=v.length>=p,F=v.length<=h;return t.jsxs(o.Stack,{"data-testid":"gradient-editor",gap:"xs",children:[t.jsxs(o.Group,{justify:"space-between",align:"center",children:[t.jsx(o.Text,{id:y,"data-testid":"gradient-editor-heading",size:"xs",c:b.CHROME,children:f.colorStops}),t.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,"data-testid":"gradient-editor-add-stop",onClick:N,disabled:M,"aria-label":f.addColorStop,children:t.jsx(te,{name:"plus",size:u.CHEVRON})})]}),t.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":y,children:v.map((m,w)=>{const R=x.format(w+1);return t.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[t.jsx(Jn,{color:m.color,defaultColor:xt,onColorChange:(j,K)=>{S(L(w,j??xt),K)},showOpacity:!1}),t.jsx(o.Box,{style:{width:Ha},children:t.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:_a,max:Pt,value:m.offset*Pt,onPointerDown:A,onChange:j=>{A(),S(D(w,j))},onChangeEnd:j=>{_(D(w,j),H)},label:j=>f.percent(x.format(j)),thumbLabel:f.colorStopPosition(R)})}),t.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:u.TRAIL,onClick:j=>{G(w,j)},"data-testid":"gradient-editor-remove-stop",disabled:F,"aria-label":f.removeColorStop(R),children:t.jsx(te,{name:"minus",size:u.CHEVRON})})]},m.id)})}),i&&t.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":C,children:[t.jsx(o.Text,{id:C,"data-testid":"gradient-editor-direction-heading",size:"xs",c:b.CHROME,mb:4,children:f.direction}),t.jsx(o.Slider,{"data-testid":"gradient-editor-direction-slider",min:At,max:Na,value:H,onPointerDown:A,onChange:m=>{A(),P(m)},onChangeEnd:m=>{_(v,m)},label:m=>f.degrees(x.format(m)),thumbLabel:f.gradientDirection,marks:Da.map(m=>({value:m,label:f.degrees(x.format(m))}))})]})]})}const Ga=4,Ma=2,za=1.1;function Ba(){const e=ze();return s.useMemo(()=>{var a;return((a=new Intl.NumberFormat(e).formatToParts(za).find(r=>r.type==="decimal"))==null?void 0:a.value)??"."},[e])}function Fa({label:e,value:n,defaultValue:a,onChange:r,min:i,max:l,step:d,decimalScale:g,suffix:h,hideControls:p=!0,disabled:f=!1,onFocus:x,onBlur:y}){const C=re(),T=zt(),v=Ba(),[S,H]=$.useUncontrolled({value:n,defaultValue:void 0,finalValue:void 0,onChange:r}),P=S===void 0,E=S??a,[A,_]=s.useState(E),L=s.useRef(!1);s.useEffect(()=>{L.current||_(S??a),L.current=!1},[S,a]);const D=M=>{L.current=!0,_(M)},N=M=>{const F=typeof A=="string"?T(A):A;if(Number.isNaN(F)){_(S??a),y==null||y(M);return}let m=F;i!==void 0&&m<i&&(m=i),l!==void 0&&m>l&&(m=l),m!==S&&H(m,M),_(m),y==null||y(M)},G=M=>{H(void 0,M)};return t.jsxs(o.Group,{"data-testid":"style-number-input",gap:Ga,wrap:"nowrap",align:"flex-end",children:[t.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,value:A,onChange:D,onFocus:x,onBlur:N,min:i,max:l,step:d,decimalScale:g,decimalSeparator:v,suffix:h,hideControls:p,disabled:f,"data-is-default":P?"true":"false",styles:{input:P?{fontStyle:"italic",color:b.CHROME}:void 0},style:{flex:1}}),!P&&t.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:b.CHROME,"data-testid":"style-number-input-reset",disabled:f,"aria-label":C.resetToDefault(e),onClick:G,style:{marginBlockEnd:Ma},children:t.jsx(te,{name:"reset",size:u.CHEVRON})})]})}const Va=4,Ua=2;function $a({label:e,value:n,defaultValue:a,options:r,onChange:i,disabled:l=!1,onFocus:d,onBlur:g}){const h=re(),[p,f]=$.useUncontrolled({value:n,defaultValue:void 0,finalValue:void 0,onChange:i}),x=p===void 0,y=p??a,C=v=>{v!==null&&f(v)},T=v=>{f(void 0,v)};return t.jsxs(o.Group,{"data-testid":"style-select",gap:Va,wrap:"nowrap",align:"flex-end",children:[t.jsx(o.Select,{"data-testid":"style-select-field",label:e,value:y,onChange:C,onFocus:d,onBlur:g,data:r,rightSection:t.jsx(te,{name:"chevronDown",size:u.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":x?"true":"false",allowDeselect:!1,styles:{input:x?{fontStyle:"italic",color:b.CHROME}:void 0},style:{flex:1}}),!x&&t.jsx(o.ActionIcon,{variant:"subtle",size:u.TRAIL,c:b.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":h.resetToDefault(e),onClick:T,style:{marginBlockEnd:Ua},children:t.jsx(te,{name:"reset",size:u.CHEVRON})})]})}const jt=4,Wa=`${String(u.TOGGLE_PITCH)}px`;function Ya({label:e,checked:n,defaultChecked:a,onChange:r,disabled:i=!1,onFocus:l,onBlur:d,children:g}){const h=s.useId(),[p,f]=$.useUncontrolled({value:n,defaultValue:a,finalValue:!1,onChange:r}),x=C=>{f(C.currentTarget.checked,C)},y={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:jt,fontSize:"var(--mantine-font-size-sm)",lineHeight:Wa,color:i?b.DISABLED:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}};return t.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":p?"true":"false","data-disabled":i?"true":void 0,style:{display:"flex",flexDirection:"column",gap:jt},children:[t.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:e,checked:p,disabled:i,"aria-expanded":p,"aria-controls":p?h:void 0,onChange:x,onFocus:l,onBlur:d,wrapperProps:{title:e},styles:y}),p&&t.jsx(o.Box,{id:h,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:jt,paddingInlineStart:u.GUTTER},children:g})]})}function no(e,n){return e!==void 0?e:n===void 0?"off":"polite"}function Me(e,n){const a=no(e,n);return a==="off"?{"aria-busy":n}:{"aria-live":a,"aria-atomic":!0,"aria-busy":n}}const Lt=4,Xa="(hover: none)";function Ka(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function qa(e){const{state:n,stateTitle:a,busy:r,live:i,actions:l,residentActions:d,actionsVisible:g,onClick:h,onFocus:p,onBlur:f}=e,x=Me(i,r),{hovered:y,ref:C}=$.useHover(),T=$.useMediaQuery(Xa)??!1,[v,S]=s.useState(!1),H=s.useId(),P=v||(g??(y||T)),E=l!==void 0||d!==void 0,A=Ka(n),_=a!==void 0&&a!==A,L=a??A,D=E&&n!==void 0,N=_?t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:n}),t.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:a})]}):n;Pe(h!==void 0&&n===void 0?"ActionRow was given onClick but no state, and its own activation is carried by the text it reports. That text is also what names the row for a screen reader, so a row with nothing to report has nothing to activate. Give the row a state, or put the action on a control in actions.":void 0);const G=R=>{S(!0),p==null||p(R)},M=R=>{R.currentTarget.contains(R.relatedTarget)||S(!1),f==null||f(R)},F=R=>{h==null||h(R,Je(R))},m={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},w={...m,alignSelf:"stretch",lineHeight:`${u.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return t.jsxs(o.Box,{ref:C,"data-testid":"action-row",role:D?"group":void 0,"aria-labelledby":D?H:void 0,onFocus:G,onBlur:M,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[n!==void 0&&(h===void 0?t.jsx(o.Box,{component:"span",id:H,"data-testid":"action-row-state",title:L,...x,style:m,children:N}):t.jsx(o.UnstyledButton,{type:"button",id:H,"data-testid":"action-row-state",title:L,...x,onClick:F,style:w,children:N})),E&&t.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Lt},children:[l!==void 0&&t.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":P?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Lt,opacity:P?1:0,pointerEvents:P?void 0:"none"},children:l}),d!==void 0&&t.jsx(o.Box,{"data-testid":"action-row-resident-actions",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Lt},children:d})]})]})}const oo=u.GUTTER,Za=12,ro=1.2,Ja=20,Qa=500,es="var(--mantine-primary-color-light)";function ts({name:e,value:n,icon:a,selected:r=!1,role:i="button",tabIndex:l,onClick:d,onDoubleClick:g,onContextMenu:h,onFocus:p,onBlur:f,trailing:x}){const{hovered:y,ref:C}=$.useHover(),T=d!==void 0,v=a!=null,S=n!=null,H=ot(x),P=i==="option",E=P?r:void 0,A=!P&&r?!0:void 0,_=G=>{d==null||d(G,Je(G))};let L="transparent";r?L=es:T&&y&&(L=b.SURFACE);const D=t.jsxs(t.Fragment,{children:[v&&t.jsx(o.Box,{component:"span","data-testid":"data-row-icon",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},children:a}),t.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),S&&t.jsx(o.Box,{component:"span","data-testid":"data-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:b.CHROME},children:n})]}),N={display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:T?"pointer":"default"};return t.jsxs(o.Box,{ref:C,"data-testid":"data-row","data-selected":r?"true":void 0,onDoubleClick:g,onContextMenu:h,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:u.DATA_PITCH,paddingInline:oo,borderRadius:"var(--mantine-radius-sm)",background:L,color:b.VALUE,fontSize:Za,lineHeight:ro},children:[T?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:P?"option":void 0,"aria-current":A,"aria-selected":E,tabIndex:l,onClick:_,onFocus:p,onBlur:f,style:N,children:D}):t.jsx(o.Box,{"data-testid":"data-row-body",role:P?"option":void 0,"aria-current":A,"aria-selected":E,tabIndex:l,onFocus:p,onBlur:f,style:N,children:D}),H&&t.jsx(ye,{children:x})]})}function ns({label:e,unit:n,sortDirection:a,defaultSortDirection:r,onSortChange:i,sortPriority:l}){const[d,g]=$.useUncontrolled({value:a,defaultValue:r,finalValue:"none",onChange:i}),h=Ye(),p=i!==void 0,f=d!=="none",x=T=>{g(d==="ascending"?"descending":"ascending",T)},y=t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:f?b.VALUE:void 0},children:e}),n!==void 0&&t.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:n}),l!==void 0&&f&&t.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:t.jsx(Kt,{children:h.format(l)})}),f&&t.jsx(o.Box,{component:"span","data-testid":"data-row-header-sort-glyph","data-direction":d,style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:b.VALUE,transform:d==="ascending"?"rotate(180deg)":void 0},children:t.jsx(te,{name:"chevronDown",size:u.CHEVRON})})]}),C=p||f;return t.jsx(o.Box,{"data-testid":"data-row-header",role:C?"columnheader":void 0,"aria-sort":C?d:void 0,style:{display:"flex",alignItems:"center",gap:u.GUTTER,boxSizing:"border-box",width:"100%",height:Ja,paddingInline:oo,fontSize:"var(--mantine-font-size-sm)",lineHeight:ro,color:b.CHROME},children:p?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-header-sort",onClick:x,style:{display:"flex",alignItems:"center",gap:u.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:"pointer"},children:y}):y})}function Kt({children:e}){return t.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:b.RAISED,color:b.VALUE,fontWeight:Qa,textTransform:"none",letterSpacing:"normal"},children:e})}const In=2,os=1,rs=13,as=2,ss=1,is=1,ls=64,ao=4,En=ao/2,so=4,cs=12,We=100,ds=1.5,Gt=100;function bt({children:e,end:n,id:a}){return t.jsx(o.Box,{component:"span",id:a,"data-testid":`chart-axis-${n}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.CHROME,whiteSpace:"nowrap"},children:e})}function io(){return t.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:os,background:b.BORDER}})}function lo({caption:e,rows:n,testId:a}){return t.jsxs(o.VisuallyHidden,{component:"table","data-testid":a,children:[e!==void 0&&t.jsx("caption",{children:e}),t.jsx("tbody",{children:n.map(r=>t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:r.header}),t.jsx("td",{children:r.value})]},r.id))})]})}function us(e,n){if(e.length===0)return null;const a=We/2;if(e.length===1)return`0,${a} ${We},${a}`;const r=Math.min(...e),l=Math.max(...e)-r,d=e.length-1;return e.map((g,h)=>{const p=Dr(h/d,We,n),f=l===0?a:We-(g-r)/l*We;return`${p},${f}`}).join(" ")}function co(){const e=s.useId(),n=`${e}min`,a=`${e}max`;return{min:n,max:a,describedBy:`${n} ${a}`}}function ps({bins:e,label:n,minLabel:a,maxLabel:r,busy:i,live:l,trailing:d}){const g=Ye(),h=co(),p=e.reduce((x,y)=>Math.max(x,y.count,0),0),f=e.map((x,y)=>({id:`${x.label}-${String(y)}`,header:x.label,value:g.format(x.count)}));return t.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":i,style:{display:"flex",alignItems:"flex-start",gap:u.TRAIL_GAP,height:u.HISTOGRAM_HEIGHT},children:[t.jsxs(o.Box,{"data-testid":"histogram-chart",...Me(l,i),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:In},children:[t.jsxs(o.Box,{"data-testid":"histogram-drawing",role:n===void 0?void 0:"img","aria-label":n,"aria-describedby":n===void 0?void 0:h.describedBy,"aria-hidden":n===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:In},children:[t.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:as},children:e.map((x,y)=>{const C=Math.max(0,x.count),T=p===0?0:C/p*Gt,v=x.highlighted===!0;return t.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":v?"true":"false","aria-hidden":"true",title:x.label,style:{flex:"1 1 0",minWidth:0,height:`${String(T)}%`,minHeight:C>0?is:0,background:v?b.ACCENT:b.BORDER,borderRadius:ss}},`${x.label}-${String(y)}`)})}),t.jsx(io,{})]}),t.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:rs,display:"flex",alignItems:"center",justifyContent:"space-between",gap:so},children:[t.jsx(bt,{end:"min",id:h.min,children:a}),t.jsx(bt,{end:"max",id:h.max,children:r})]})]}),t.jsx(lo,{caption:n,rows:f,testId:"histogram-values"}),ot(d)&&t.jsx(ye,{children:d})]})}function fs({values:e,label:n,minLabel:a,maxLabel:r,busy:i,live:l,trailing:d}){const g=Ae(),h=Ye(),p=co(),f=us(e,g),x=e.map((y,C)=>({id:`point-${String(C)}`,header:h.format(C+1),value:h.format(y)}));return t.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":i,style:{display:"flex",alignItems:"center",gap:u.TRAIL_GAP,height:u.SPARKLINE_HEIGHT},children:[t.jsxs(o.Box,{"data-testid":"sparkline-chart",...Me(l,i),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:so},children:[t.jsx(bt,{end:"min",id:p.min,children:a}),t.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:n===void 0?void 0:"img","aria-label":n,"aria-describedby":n===void 0?void 0:p.describedBy,"aria-hidden":n===void 0?!0:void 0,style:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",color:b.BORDER},children:[t.jsx(o.Box,{component:"svg","data-testid":"sparkline-plot",width:"100%",height:u.CONTROL_HEIGHT,viewBox:`0 0 ${String(We)} ${String(We)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:ds,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{display:"block",overflow:"visible"},children:f!==null&&t.jsx("polyline",{points:f,vectorEffect:"non-scaling-stroke"})}),t.jsx(io,{})]}),t.jsx(bt,{end:"max",id:p.max,children:r})]}),t.jsx(lo,{caption:n,rows:x,testId:"sparkline-values"}),ot(d)&&t.jsx(ye,{children:d})]})}function hs({name:e,percentile:n,value:a,rank:r,busy:i,live:l,onClick:d,onDoubleClick:g,onContextMenu:h,onFocus:p,onBlur:f}){const x=re(),y=$n(),C=s.useId(),T=d,v=T!==void 0,S=Math.min(Gt,Math.max(0,n)),H=x.percentile(y(Math.round(S))),P=A=>{T!==void 0&&T(A,Je(A))},E=A=>{T!==void 0&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),T(A,Je(A)))};return t.jsxs(o.Box,{"data-testid":"metric-row",role:v?"button":void 0,tabIndex:v?0:void 0,...Me(l,i),onClick:P,onKeyDown:E,onDoubleClick:g,onContextMenu:h,onFocus:p,onBlur:f,style:{display:"flex",alignItems:"center",gap:u.GUTTER,height:u.ROW_PITCH,cursor:v?"pointer":"default"},children:[t.jsx(o.Box,{component:"span",id:C,"data-testid":"metric-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,fontSize:cs,lineHeight:1.2,color:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":C,"aria-valuemin":0,"aria-valuemax":Gt,"aria-valuenow":S,"aria-valuetext":H,title:H,size:ao,style:{flex:`0 0 ${String(ls)}px`,borderRadius:En,background:b.SURFACE},children:t.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:S,withAria:!1,color:b.ACCENT,style:{borderRadius:En}})}),t.jsx(o.Box,{component:"span","data-testid":"metric-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.VALUE},children:a}),r!==void 0&&t.jsx(Kt,{children:r})]})}const uo=s.createContext(!1);function po({showLabels:e=!1,children:n}){return t.jsx(uo.Provider,{value:e,children:n})}function rt(){return s.useContext(uo)}const gs=u.VALUE_INSET-u.GLYPH_SLOT,xs=2,ms=1,bs=2,ys=3;function vs(e){if(e.fullValue!==void 0)return e.fullValue;if(typeof e.value=="string")return e.value;if(typeof e.value=="number")return String(e.value)}function ws({segment:e,grow:n,index:a}){const{glyph:r,value:i,unit:l,mono:d=!1}=e;let g=null;Bt(r)?g=t.jsx(nt,{name:r}):Ft(r)?g=t.jsx(o.Box,{component:"span","data-letter":r,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:r}):r!=null&&(g=r);const h=vs(e),p=e.fullValue!==void 0;return t.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":a,"data-grow":n?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:n?"1 1 auto":"0 0 auto",minWidth:0,height:u.CONTROL_HEIGHT,paddingBlock:0,paddingInline:gs},children:[g!==null&&t.jsx(o.Box,{"data-testid":"compound-segment-slot",style:{flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},children:g}),t.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":d?"true":"false",title:h,"aria-hidden":p?!0:void 0,style:{flex:n?"1 1 auto":"0 0 auto",minWidth:0,fontFamily:d?"var(--mantine-font-family-monospace)":void 0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",unicodeBidi:"isolate"},children:i}),p&&t.jsx(o.VisuallyHidden,{children:e.fullValue}),l!==void 0&&t.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:xs,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.CHROME},children:l})]})}function Is(e,n){if(!(n>=bs&&n<=ys))return`CompoundRow "${e}" was given ${String(n)} ${n===1?"segment":"segments"}, and it holds two or three. A compound row shows one value together with the parts that belong to it: use PanelField for a single value, and a table or a list of rows for more than three.`}function Es(e,n){if(n!==1)return`CompoundRow "${e}" was given ${String(n)} segments that set grow, and exactly one should. The segment that sets grow takes the box's leftover width and should be the main value, with the rest sized to their content. Using the first segment that sets it, or the leading segment when none does.`}function Ss({label:e,segments:n,width:a=u.BODY,trailing:r,busy:i,live:l,onClick:d,onFocus:g,onBlur:h}){const p=rt(),f=s.useId(),x=n.filter(L=>L.grow===!0).length;Pe(Is(e,n.length)),Pe(Es(e,x));const y=n.findIndex(L=>L.grow===!0),C=y===-1?0:y,T=d!==void 0,v=no(l,i)!=="off",S=T||v,H=T?void 0:f,P=S?void 0:f,E=S||p,A={display:"flex",alignItems:"center",boxSizing:"border-box",flex:p?"1 1 auto":"0 0 auto",width:p?void 0:a,minWidth:0,height:u.CONTROL_HEIGHT,background:b.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:T?"pointer":void 0},_=t.jsxs(t.Fragment,{children:[S&&t.jsx(o.VisuallyHidden,{id:H,children:e}),n.map((L,D)=>t.jsxs(s.Fragment,{children:[D>0&&t.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:ms,height:u.CONTROL_HEIGHT,background:b.PANEL}}),t.jsx(ws,{segment:L,grow:D===C,index:D})]},D))]});return t.jsxs(o.Box,{"data-testid":"compound-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[p&&t.jsx(o.Box,{component:"span",id:P,"data-testid":"compound-row-label",title:e,"aria-hidden":S?!0:void 0,style:{flex:`0 0 ${u.LABEL_COLUMN}px`,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),T?t.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Me(l,i),onClick:d,onFocus:g,onBlur:h,style:A,children:_}):t.jsx(o.Box,{role:"group","aria-label":E?void 0:e,"aria-labelledby":E?f:void 0,title:e,"data-testid":"compound-row-box","data-interactive":"false",...Me(l,i),onFocus:g,onBlur:h,style:A,children:_}),t.jsx(ye,{children:r})]})}const Ot=u.VALUE_INSET-u.GLYPH_SLOT,gt=4,Sn=4,Cs=u.VALUE_INSET+u.LABEL_COLUMN,Cn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},fo=s.forwardRef(function(n,a){const{label:r,glyph:i,kind:l,value:d,defaultValue:g,onChange:h,data:p,unit:f,width:x=u.FIELD,bound:y=!1,mixed:C=!1,placeholder:T,pending:v=!1,min:S,max:H,step:P,onScrubStart:E,onScrub:A,onScrubEnd:_,onClick:L,disabled:D=!1,readOnly:N,boundDescription:G,pendingDescription:M,title:F,style:m,className:w,onKeyDown:R,...j}=n,K=rt(),W=re(),xe=Ae(),U=$.useMediaQuery("(pointer: coarse)"),[le,V]=$.useUncontrolled({value:d===null?"":d,defaultValue:g,finalValue:"",onChange:h}),Z=l??(p!==void 0?"select":"text"),ee=Z==="select",je=Z==="select"&&p!==void 0,Le=N??(h===void 0&&g===void 0),ne=String(le),me=T===!0,X=C||me;let ve;C?ve=W.mixed:me?ve=ne:typeof T=="string"&&(ve=T);const pe=[];C&&pe.push(W.mixed);const Be=G??W.fieldBound,Oe=M??W.fieldPending;y&&Be!==""&&pe.push(Be),v&&Oe!==""&&pe.push(Oe);const Qe=pe.length>0?pe.join(". "):void 0,ae=(E!==void 0||A!==void 0||_!==void 0)&&!D&&!U,ge=s.useRef(!1),we=s.useRef(!1),be=s.useRef(0),He=k=>{if(!ae||k.button!==0)return;k.preventDefault(),k.stopPropagation();const oe=k.currentTarget;typeof oe.setPointerCapture=="function"&&oe.setPointerCapture(k.pointerId),ge.current=!0,we.current=!1,be.current=k.clientX},et=k=>{if(!ge.current)return;const oe=k.clientX-be.current;oe!==0&&(be.current=k.clientX,we.current||(we.current=!0,E==null||E(k)),A==null||A(ue(xe)?-oe:oe,k))},_e=k=>{ge.current&&(ge.current=!1,we.current&&(we.current=!1,_==null||_(k)))},at=k=>{D||L==null||L(k)},Xe=k=>{R==null||R(k),!(L===void 0||D||k.defaultPrevented)&&(je||(k.key==="Enter"||k.key===" "&&Le)&&(k.preventDefault(),L(k)))},Ne=(k,oe)=>{V(k,oe)};let Ie=null;Bt(i)?Ie=t.jsx(nt,{name:i,filled:y}):Ft(i)?Ie=t.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(Ie=i);const Ve=t.jsxs(t.Fragment,{children:[t.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":ae?"true":void 0,onPointerDown:ae?He:void 0,onPointerMove:ae?et:void 0,onPointerUp:ae?_e:void 0,onPointerCancel:ae?_e:void 0,onLostPointerCapture:ae?_e:void 0,style:{position:"relative",flex:"0 0 auto",width:u.GLYPH_SLOT,height:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME,cursor:ae?"ew-resize":void 0,touchAction:ae?"none":void 0},children:[Ie,v&&t.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:Sn,height:Sn,background:b.ACCENT}})]}),K&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:gt,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})]}),z=f!==void 0,J=z||ee?t.jsxs(t.Fragment,{children:[z&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:f}),ee&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:z?gt:0},children:t.jsx(te,{name:"chevronDown",size:u.GLYPH})})]}):void 0;let Y=Ot+gt;ee&&(Y+=u.GLYPH),ee&&z&&(Y+=gt);const fe=J===void 0?void 0:`calc(${String((f==null?void 0:f.length)??0)}ch + ${String(Y)}px)`,Q=ae?"auto":"none",ce={"data-testid":"panel-field-value",...j,ref:a,className:w,label:r,description:Qe,placeholder:ve,disabled:D,readOnly:Le,onClick:at,onKeyDown:Xe,leftSection:Ve,leftSectionWidth:K?Cs:u.VALUE_INSET,leftSectionPointerEvents:Q,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:Ot}},rightSection:J,rightSectionWidth:fe,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:Ot,fontSize:"var(--mantine-font-size-sm)",color:b.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":C?b.VALUE:b.PLACEHOLDER},input:{backgroundColor:b.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:Cn,description:Cn},wrapperProps:{title:F??r,"data-testid":"panel-field","data-kind":Z,"data-bound":y?"true":void 0,"data-mixed":C?"true":void 0,"data-pending":v?"true":void 0,"data-disabled":D?"true":void 0},style:{flex:x==="fill"?"1 1 auto":"0 0 auto",width:x==="fill"?"100%":x,minWidth:0,...m}};return Z==="number"?t.jsx(o.NumberInput,{...ce,value:X?"":le,onChange:Ne,min:S,max:H,step:P,hideControls:!0}):je?t.jsx(o.Select,{...ce,data:p,value:X||ne===""?null:ne,onChange:k=>{Ne(k??"")}}):t.jsx(o.TextInput,{...ce,value:X?"":ne,onChange:k=>{Ne(k.currentTarget.value,k)}})}),Ts=2,Rs=u.BODY+u.TRAIL_GAP;function Ps(e){return s.Children.toArray(e).flatMap(n=>s.isValidElement(n)&&n.type===s.Fragment?s.Children.toArray(n.props.children):[n])}function Tn(e,n){return s.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(n)}`}function As(e){if(s.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function Rn(e){return s.isValidElement(e)&&e.type===fo?s.cloneElement(e,{width:"fill"}):e}const js=s.forwardRef(function({children:n,trailing:a,groupLabel:r,role:i,style:l,"aria-label":d,"aria-labelledby":g,...h},p){const f=rt(),x=Ps(n),y=x.length;Pe(y===0||y>Ts?`FieldRow was given ${String(y)} ${y===1?"field":"fields"}, and it holds one field, or two side by side. A row with none is an empty 32px gap, and a third field has nowhere to go in the 280px panel the row is measured for. Put the extra fields on rows of their own.`:void 0);const C=r??d,v=i??(C!==void 0||g!==void 0?"group":void 0),S=ot(a);if(f&&y>1)return t.jsx(o.Box,{ref:p,"data-testid":"field-row-labelled","data-fields":y,role:v,"aria-label":C,"aria-labelledby":g,...h,style:{display:"flex",flexDirection:"column",...l},children:x.map((_,L)=>{const D=As(_);return t.jsxs(o.Box,{"data-testid":"field-row","data-labelled":"true",style:{display:"flex",alignItems:"center",height:u.ROW_PITCH},children:[t.jsx(o.Box,{component:"span","data-testid":"field-row-label",title:D,style:{flex:`0 0 ${String(u.LABEL_COLUMN)}px`,minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:b.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D}),t.jsx(o.Box,{"data-testid":"field-row-slot","data-width":"fill",style:{display:"flex",alignItems:"center",flex:"1 1 auto",minWidth:0,marginInlineStart:u.GUTTER,marginInlineEnd:u.TRAIL_GAP},children:t.jsx(po,{showLabels:!1,children:Rn(_)})}),t.jsx(ye,{children:L===0?a:null})]},Tn(_,L))})});const H=y<=1,P=H&&!S;let E=u.FIELD;H&&(E=P?Rs:u.BODY);const A=P?void 0:u.TRAIL_GAP;return t.jsxs(o.Box,{ref:p,"data-testid":"field-row","data-fields":y,role:v,"aria-label":C,"aria-labelledby":g,...h,style:{display:"flex",alignItems:"center",height:u.ROW_PITCH,...l},children:[x.map((_,L)=>t.jsx(o.Box,{"data-testid":"field-row-slot","data-width":E,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(E)}px`,minWidth:0,marginInlineStart:L===0?void 0:u.GUTTER,marginInlineEnd:L===y-1?A:void 0},children:Rn(_)},Tn(_,L))),t.jsx(ye,{children:a})]})}),Ls=2,Os=6,ho=1,Hs=u.CONTROL_HEIGHT-ho*2,_s=2,Pn=3,Ns=4,Ds=6,ks=u.GLYPH,Gs=3;function Ms(e,n){return n?b.DISABLED:e?b.ON_SELECTED:b.CHROME}function zs(e){const{options:n,value:a,defaultValue:r,onChange:i,label:l,labelledBy:d,name:g,disabled:h=!1,hybrid:p=!1,width:f,trailing:x,onFocus:y,onBlur:C}=e,T=rt(),v=n.length,[S]=n,[H,P]=$.useUncontrolled({value:a,defaultValue:r,finalValue:S===void 0?"":S.value,onChange:i}),E=s.useRef(void 0);Pe(v<Ls||v>Os?`IconGroupRow was given ${String(v)} ${v===1?"option":"options"}, and it holds two to six drawable ones. One option is a statement rather than a choice and belongs in a field, and more than six stop reading as a set of drawings -- use a select instead. Rendering them anyway.`:void 0);const A=f??(v<=Gs?u.FIELD:u.BODY),_=A==="fill",L=N=>{var m;if(h||N.key!=="Home"&&N.key!=="End")return;const G=n.filter(w=>w.disabled!==!0),M=N.key==="Home"?G[0]:G[G.length-1];if(M===void 0)return;N.preventDefault(),P(M.value,N),(m=Array.from(N.currentTarget.querySelectorAll('input[type="radio"]')).find(w=>w.value===M.value))==null||m.focus()},D=n.map(N=>{const G=N.value===H,M=h||N.disabled===!0,F=T||p&&G;return{value:N.value,disabled:N.disabled,label:t.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":N.value,"data-active":G?"true":"false",title:N.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:F?Ns:0,paddingInline:F?Ds:0,width:"100%",minWidth:0,color:Ms(G,M)},children:[t.jsx(o.Box,{component:"span","data-testid":"icon-group-icon",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:N.icon}),F?t.jsx(o.Box,{component:"span","data-testid":"icon-group-word",style:{minWidth:0,fontWeight:500,lineHeight:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.label}):t.jsx(o.VisuallyHidden,{children:N.label})]})}});return t.jsxs(o.Box,{"data-testid":"icon-group-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:u.TRAIL_GAP,height:u.ROW_PITCH},children:[t.jsx(o.SegmentedControl,{data:D,value:H,onChange:N=>{const G=E.current;E.current=void 0,P(N,G)},onChangeCapture:N=>{E.current=N},onKeyDown:L,onFocus:y,onBlur:C,name:g,disabled:h,radius:"sm","aria-label":l,"aria-labelledby":d,"data-testid":"icon-group-track","data-hybrid":p?"true":void 0,__vars:{"--sc-color":b.SELECTED,"--sc-shadow":"none"},styles:{root:{boxSizing:"border-box",flex:_?"1 1 auto":"0 0 auto",width:_?"100%":A,minWidth:0,height:u.CONTROL_HEIGHT,padding:ho,gap:_s,backgroundColor:b.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:ks},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Hs,padding:0,borderRadius:Pn,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:b.SELECTED,borderRadius:Pn,boxShadow:"none"}}}),t.jsx(ye,{children:x})]})}const Bs=12,Fs=1.5,An=1.4,jn=4,Vs=20,Ln=220,On=2,Hn=new RegExp("\\p{Sentence_Terminal}","u"),Us=/[.!?]/u,_n=/\s/u;function $s(e){const n=Array.from(e);let a=0,r=0,i=0;for(;r<n.length;){if(!Hn.test(n[r])){r+=1;continue}let d=r;for(;d+1<n.length&&Hn.test(n[d+1]);)d+=1;const g=n[d+1],h=Us.test(n[d]);r=d+1,(!h||g===void 0||_n.test(g))&&(a+=1,i=r)}return n.slice(i).some(d=>!_n.test(d))?a+1:a}function Ws(e){return Array.from(e).length}function Ys(e,n){if(e!=="reading"||typeof n!="string")return;const a=Ws(n);if(a>Ln)return`ProseBlock was given a reading of ${String(a)} characters, and a reading is at most ${String(Ln)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const r=$s(n);if(r>On)return`ProseBlock was given a reading of ${String(r)} sentences, and a reading is at most ${String(On)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function Xs(e,n){if(!(n===void 0||e==="runRecord"))return`ProseBlock was given onDetails on the "${e}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function Ks({variant:e,children:n,onDetails:a,busy:r,live:i}){const l=re(),d=Ae(),g=s.useId();Pe(Ys(e,n)),Pe(Xs(e,a));const h=Me(i,r);if(e==="reading")return t.jsx(o.Text,{...h,"data-testid":"prose-block","data-variant":e,style:{fontSize:Bs,lineHeight:Fs,color:b.PROSE},children:n});if(e==="departure")return t.jsxs(o.Box,{...h,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"flex-start",gap:jn},children:[t.jsx(o.Box,{"aria-hidden":!0,"data-testid":"prose-block-warning",style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:b.WARNING},children:t.jsx(te,{name:"warning",size:u.GLYPH})}),t.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:An,color:b.VALUE},children:n})]});const p=typeof n=="string"?n:void 0;return t.jsxs(o.Box,{...h,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"center",gap:jn,blockSize:Vs},children:[t.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:g,title:p,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:An,color:b.CHROME},children:n}),a!==void 0&&t.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":g,"data-testid":"prose-block-details",onClick:a,style:{flex:"0 0 auto",inlineSize:u.GLYPH_SLOT,blockSize:u.GLYPH_SLOT,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"transparent",color:b.CHROME,cursor:"pointer"},children:t.jsx(te,{name:ue(d)?"chevronLeft":"chevronRight",size:u.CHEVRON})})]})}const Ht=4,qs=4,Zs=`polygon(0 calc(100% - ${qs}px), 100% 0, 100% 100%, 0 100%)`,Js=120,Qs=`linear-gradient(to right, ${b.SURFACE}, ${b.ACCENT})`,ei={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Nn={flex:"0 0 auto",lineHeight:1,color:b.CHROME,whiteSpace:"nowrap"};function ti({min:e,max:n,label:a,variant:r="size",gradient:i,scale:l,busy:d,live:g,onScaleClick:h,trailing:p}){const f=re(),x=Ae(),y=s.useId(),C=r==="color",T=l===void 0?void 0:ei[l],v=T===void 0?void 0:f[T],S=`${y}-label`,H=`${y}-min`,P=`${y}-max`,E=`${y}-scale`,A=[a===void 0?void 0:S,H,P,v===void 0?void 0:E].filter(D=>D!==void 0);let _=null;T!==void 0&&v!==void 0&&(h===void 0?_=t.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:v,style:{flex:"0 0 auto",width:u.TRAIL,height:u.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:b.CHROME},children:t.jsx(nt,{name:T})}):_=t.jsx(eo,{label:v,icon:t.jsx(nt,{name:T}),onClick:h}));const L=ot(p)?p:_;return t.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":r,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Ht,height:u.ROW_PITCH},children:[t.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":A.join(" "),...Me(g,d),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Ht},children:[a!==void 0&&t.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:S,children:a}),t.jsx(o.Text,{span:!0,size:"sm",id:H,"data-testid":"ramp-row-min",style:Nn,children:e}),t.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":r,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:Js,height:u.GLYPH,boxSizing:"border-box",background:C?i??Qs:b.CHROME,borderRadius:C?"var(--mantine-radius-xs)":void 0,border:C?`1px solid ${b.BORDER}`:void 0,clipPath:C?void 0:Zs,...kr(x)}}),t.jsx(o.Text,{span:!0,size:"sm",id:P,"data-testid":"ramp-row-max",style:Nn,children:n}),v!==void 0&&t.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:E,children:v})]}),t.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:u.TRAIL_GAP-Ht},children:t.jsx(ye,{children:L})})]})}const ni=4,oi=`${String(u.TOGGLE_PITCH)}px`,ri=2;function ai({label:e,checked:n,defaultChecked:a,onChange:r,control:i="checkbox",trailing:l,disabled:d=!1,onFocus:g,onBlur:h}){const[p,f]=$.useUncontrolled({value:n,defaultValue:a,finalValue:!1,onChange:r}),x=T=>{f(T.currentTarget.checked,T)},y={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:u.TOGGLE_PITCH,paddingInlineStart:ni,fontSize:"var(--mantine-font-size-sm)",lineHeight:oi,color:d?b.DISABLED:b.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},C={title:e};return t.jsxs(o.Box,{"data-testid":"toggle-row","data-control":i,"data-checked":p?"true":"false","data-disabled":d?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:u.TRAIL_GAP,height:u.TOGGLE_PITCH},children:[i==="switch"?t.jsx(o.Switch,{"data-testid":"toggle-row-control",label:e,checked:p,disabled:d,onChange:x,onFocus:g,onBlur:h,wrapperProps:C,styles:y}):t.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:e,checked:p,disabled:d,onChange:x,onFocus:g,onBlur:h,wrapperProps:C,styles:y}),t.jsx(ye,{children:l})]})}function si({children:e,label:n,labelledBy:a}){const r=s.Children.toArray(e).length;return Pe(r<ri?`ToggleRowGroup was given ${String(r)} ${r===1?"row":"rows"}, and it holds two or more. A single checkbox on a row of its own interrupts a column of rows to say one bit: put it in the trailing slot of the row it modifies, or make it one tile of a group of icon buttons. Rendering it anyway.`:void 0),t.jsx(o.Box,{role:"group","aria-label":a===void 0?n:void 0,"aria-labelledby":a,"data-testid":"toggle-row-group","data-rows":r,style:{display:"flex",flexDirection:"column"},children:e})}function ii(e="dark"){return o.useComputedColorScheme(e)}const li={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},ci={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4},di="0.6.0";exports.ActionRow=qa;exports.AdvancedButton=eo;exports.COMPACT_SIZING=ci;exports.CompactColorInput=Jn;exports.CompoundRow=Ss;exports.ControlGroup=oa;exports.ControlSection=ca;exports.ControlSubGroup=pa;exports.DEFAULT_GRADIENT_STOP_COLOR=xt;exports.DataRow=ts;exports.DataRowHeader=ns;exports.DataTable=Aa;exports.FIELD_GLYPH_NAMES=Yn;exports.FIELD_LETTERS=Xn;exports.FieldGlyph=nt;exports.FieldRow=js;exports.GradientEditor=ka;exports.HistogramRow=ps;exports.IconGroupRow=zs;exports.InfoCircle=Qn;exports.LabelsProvider=dr;exports.MANTINE_SPACING=li;exports.MAX_ALPHA_HEX=Vt;exports.MAX_OPACITY_PERCENT=Ut;exports.MetricRow=hs;exports.PANEL_GRID=u;exports.PANEL_INK=b;exports.POPOUT_GAP=Gn;exports.POPOUT_NESTED_GAP=Mn;exports.POPOUT_Z_INDEX_BASE=_t;exports.PanelField=fo;exports.PanelLabelsProvider=po;exports.Popout=Ge;exports.PopoutButton=Wr;exports.PopoutManager=Zn;exports.ProseBlock=Ks;exports.RampRow=ti;exports.RankChip=Kt;exports.SWATCH_COLORS_HEXA=Fn;exports.SparklineRow=fs;exports.StyleNumberInput=Fa;exports.StyleSelect=$a;exports.ToggleRow=ai;exports.ToggleRowGroup=si;exports.ToggleWithContent=Ya;exports.TrailingSlot=ye;exports.UI_GLYPH_NAMES=br;exports.UiGlyph=te;exports.VERSION=di;exports.compactColors=kn;exports.compactDarkColors=Dn;exports.compactTheme=ir;exports.compactThemeOverride=Bn;exports.createColorStop=mt;exports.createDefaultGradientStops=to;exports.defaultLabels=Vn;exports.getActivationMeta=Je;exports.isFieldGlyphName=Bt;exports.isFieldLetter=Ft;exports.isRtl=ue;exports.isValidHex=Er;exports.opacityToAlphaHex=Wt;exports.parseAlphaFromHexa=$t;exports.parseHexaColor=wr;exports.parseLocaleNumber=Un;exports.toHexaColor=Ir;exports.useActualColorScheme=ii;exports.useCollator=Wn;exports.useDirection=Ae;exports.useLabels=re;exports.useLocale=ze;exports.useNumberFormatter=Ye;exports.useNumberParser=zt;exports.useOrdinalFormatter=$n;exports.usePanelLabels=rt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@mantine/core"),t=require("react/jsx-runtime"),Y=require("@mantine/hooks"),s=require("react"),Eo=require("react-dom"),pe=require("@tanstack/react-table"),So=require("@tanstack/react-virtual"),d={WIDTH:280,PAD_LEFT:16,PAD_RIGHT:8,CONTENT:256,BODY:224,FIELD:108,GUTTER:8,TRAIL_GAP:8,TRAIL:24,TRIPLE:72,TRIPLE_GAP:4,CONTROL_HEIGHT:24,ROW_PITCH:32,TOGGLE_PITCH:24,DATA_PITCH:28,SECTION_HEADER:32,SECTION_PAD_BOTTOM:8,GLYPH_SLOT:16,GLYPH:14,CHEVRON:12,VALUE_INSET:24,SPARKLINE_HEIGHT:32,HISTOGRAM_HEIGHT:64,LABEL_COLUMN:76},m={VALUE:"var(--mantine-color-text)",CHROME:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PROSE:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",PLACEHOLDER:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",DISABLED:"var(--mantine-color-disabled-color)",SURFACE:"light-dark(var(--mantine-color-gray-1), var(--mantine-color-dark-6))",PANEL:"var(--mantine-color-body)",RAISED:"light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5))",SELECTED:"light-dark(var(--mantine-color-gray-7), var(--mantine-color-dark-1))",ON_SELECTED:"var(--mantine-color-body)",BORDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",DIVIDER:"light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2))",ACCENT:"var(--mantine-primary-color-filled)",ON_ACCENT:"var(--mantine-primary-color-contrast)",WARNING:"var(--mantine-color-yellow-6)",SUCCESS:"var(--mantine-color-green-6)",DANGER:"var(--mantine-color-red-6)"},Dn=["#d5d7da","#a3a8b1","#7a828e","#5f6873","#48525c","#374047","#2a3035","#1f2428","#161b22","#0d1117"],kn={...o.DEFAULT_THEME.colors,dark:Dn},Co={"--button-height":"24px","--button-fz":"11px","--button-padding-x":"8px"},To={"--ai-size":"24px"},Ro={"--cb-size":"16px","--cb-icon-size":"12px"},Po={Button:o.Button.extend({defaultProps:{size:"sm"},vars:()=>({root:Co})}),ActionIcon:o.ActionIcon.extend({defaultProps:{size:"sm",variant:"subtle"},vars:()=>({root:To})}),CloseButton:o.CloseButton.extend({defaultProps:{size:"xs"},vars:()=>({root:Ro})})},Ao={"--switch-height":"16px","--switch-width":"28px","--switch-thumb-size":"12px","--switch-track-label-padding":"2px","--switch-label-font-size":"5px"},jo={"--checkbox-size":"16px"},Lo={"--radio-size":"16px","--radio-icon-size":"6px"},en={"--slider-size":"4px","--slider-thumb-size":"12px"},Oo={"--sc-font-size":"10px","--sc-padding":"4px 8px"},Ho={backgroundColor:"transparent"},_o={backgroundColor:"light-dark(var(--mantine-color-gray-2), var(--mantine-color-dark-6))"},wt={fontSize:11},tn={fontSize:10,marginTop:2},No={SegmentedControl:o.SegmentedControl.extend({defaultProps:{size:"sm",withItemsBorders:!1},vars:()=>({root:Oo}),styles:{root:Ho,indicator:_o}}),Checkbox:o.Checkbox.extend({defaultProps:{size:"sm"},vars:()=>({root:jo}),styles:{label:wt}}),Switch:o.Switch.extend({defaultProps:{size:"sm"},vars:()=>({root:Ao}),styles:{label:wt}}),Slider:o.Slider.extend({defaultProps:{size:"sm"},vars:()=>({root:en}),styles:{markLabel:tn}}),Radio:o.Radio.extend({defaultProps:{size:"sm"},vars:()=>({root:Lo}),styles:{label:wt}}),RangeSlider:o.RangeSlider.extend({defaultProps:{size:"sm"},vars:()=>({root:en}),styles:{markLabel:tn}})},Do={"--badge-height":"14px","--badge-fz":"9px","--badge-padding-x":"4px"},ko={"--avatar-size":"24px"},Mo={"--ti-size":"24px"},Go={"--indicator-size":"8px"},zo={"--kbd-fz":"10px","--kbd-padding":"2px 4px"},Bo={"--pill-height":"16px","--pill-fz":"10px"},Fo={Text:o.Text.extend({}),Badge:o.Badge.extend({defaultProps:{size:"sm"},vars:()=>({root:Do})}),Pill:o.Pill.extend({defaultProps:{size:"sm"},vars:()=>({root:Bo})}),Avatar:o.Avatar.extend({defaultProps:{size:"sm"},vars:()=>({root:ko})}),ThemeIcon:o.ThemeIcon.extend({defaultProps:{size:"sm"},vars:()=>({root:Mo})}),Indicator:o.Indicator.extend({defaultProps:{size:"sm"},vars:()=>({root:Go})}),Kbd:o.Kbd.extend({defaultProps:{size:"sm"},vars:()=>({root:zo})})},Vo={"--loader-size":"18px"},Uo={"--progress-size":"4px"},$o={label:{fontSize:9}},Wo={Loader:o.Loader.extend({defaultProps:{size:"sm"},vars:()=>({root:Vo})}),Progress:o.Progress.extend({defaultProps:{size:"sm"},vars:()=>({root:Uo}),styles:$o}),RingProgress:o.RingProgress.extend({})},_t=1e3,ke=1100,Mn=8,Gn=4,zn="light-dark(var(--mantine-primary-color-filled), var(--mantine-primary-color-5))",We={"--input-height":"24px","--input-size":"24px","--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":zn},pt={"--input-fz":"11px","--input-bg":"var(--mantine-color-default)","--input-bd":"transparent","--input-bd-focus":zn},et={fontSize:11,color:m.CHROME,marginBottom:1,lineHeight:1.2},Gt={paddingInlineStart:8,paddingInlineEnd:8,backgroundColor:"var(--mantine-color-default)"},Qe={label:et,input:Gt},nn={label:et,input:Gt},ft={dropdown:{padding:4,border:"none",boxShadow:"var(--mantine-shadow-md)"},option:{fontSize:11,padding:"4px 8px",borderRadius:4},options:{},groupLabel:{fontSize:10,padding:"4px 8px"},empty:{fontSize:11,padding:"8px"}},It={input:{...Qe.input,minHeight:24,height:"auto",display:"flex",alignItems:"center",paddingTop:4,paddingBottom:4},pillsList:{columnGap:4,rowGap:2},pill:{margin:0}},Yo={TextInput:o.TextInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:We}),styles:Qe}),NumberInput:o.NumberInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:{...We,"--input-right-section-width":"24px"},controls:{"--ni-chevron-size":"10px"}}),styles:{label:et,input:Gt,control:{borderColor:"transparent"}}}),Select:o.Select.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:We}),styles:{...Qe,...ft}}),Textarea:o.Textarea.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:pt}),styles:nn}),PasswordInput:o.PasswordInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:We}),styles:{...Qe,innerInput:{paddingInlineStart:8,paddingInlineEnd:8}}}),Autocomplete:o.Autocomplete.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:We}),styles:{...Qe,...ft}}),MultiSelect:o.MultiSelect.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:{...We,"--combobox-chevron-size":"12px"}}),styles:{label:et,...ft,...It,inputField:{minWidth:60,flexBasis:60}}}),TagsInput:o.TagsInput.extend({defaultProps:{size:"sm",variant:"filled",comboboxProps:{zIndex:ke}},vars:()=>({root:{},wrapper:pt}),styles:{label:et,...ft,...It,inputField:{minWidth:30,flexBasis:30}}}),PillsInput:o.PillsInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:pt}),styles:{label:et,...It}}),FileInput:o.FileInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:We}),styles:Qe}),JsonInput:o.JsonInput.extend({defaultProps:{size:"sm",variant:"filled"},vars:()=>({root:{},wrapper:pt}),styles:nn}),InputClearButton:o.InputClearButton.extend({defaultProps:{size:"xs"},vars:()=>({root:{"--cb-size":"16px","--cb-icon-size":"12px"}})})},Xo={"--pagination-control-size":"24px","--pagination-control-fz":"11px"},Ko={"--stepper-icon-size":"24px","--stepper-fz":"11px","--stepper-spacing":"8px"},qo={"--burger-size":"18px","--burger-line-size":"2px"},Zo={root:{fontSize:11}},Jo={root:{fontSize:11,minHeight:28},label:{fontSize:11}},Qo={tab:{fontSize:11,padding:"6px 10px"}},er={Anchor:o.Anchor.extend({defaultProps:{size:"sm"},styles:Zo}),Burger:o.Burger.extend({defaultProps:{size:"sm"},vars:()=>({root:qo})}),NavLink:o.NavLink.extend({styles:Jo}),Pagination:o.Pagination.extend({defaultProps:{size:"sm"},vars:()=>({root:Xo})}),Stepper:o.Stepper.extend({defaultProps:{size:"sm"},vars:()=>({root:Ko})}),Tabs:o.Tabs.extend({styles:Qo})},tr={"--menu-item-fz":"11px"},nr={tooltip:{fontSize:11,padding:"4px 8px"}},or={dropdown:{padding:8}},rr={dropdown:{padding:8}},ar={Menu:o.Menu.extend({defaultProps:{zIndex:ke},vars:()=>({dropdown:tr})}),Tooltip:o.Tooltip.extend({defaultProps:{zIndex:ke},styles:nr}),Popover:o.Popover.extend({defaultProps:{zIndex:ke},styles:or}),HoverCard:o.HoverCard.extend({defaultProps:{zIndex:ke},styles:rr})},sr={xs:"10px",sm:"11px",md:"13px",lg:"14px",xl:"16px"},ir={xs:"4px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},lr={xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},Bn=o.createTheme({colors:kn,fontSizes:sr,spacing:ir,radius:lr,focusRing:"auto",other:{panelGrid:d},components:{...Yo,...Po,...No,...Fo,...Wo,...er,...ar}}),cr=o.mergeMantineTheme(o.DEFAULT_THEME,Bn),Fn=["#5B8FF9FF","#FF6B6BFF","#61D095FF","#F7B731FF","#9B59B6FF","#5B8FF980","#FF6B6B80","#61D09580","#F7B73180","#9B59B680"],mt="#888888",Vn={mixed:"Mixed",fieldBound:"Bound to a data attribute",fieldPending:"Set but not yet applied",scaleSqrt:"Square root scale",scaleLinear:"Linear scale",scaleLog:"Logarithmic scale",details:"Details",departure:"Departure",percentile:e=>`${e} percentile`,expandSection:e=>`Expand ${e}`,collapseSection:e=>`Collapse ${e}`,addToSection:e=>`Add ${e}`,sectionHasConfiguredValues:e=>`${e} has configured values`,about:e=>`About ${e}`,resetToDefault:e=>`Reset ${e} to default`,colorSwatch:"Color swatch",colorHexValue:"Color hex value",opacity:"Opacity",colorPanelTitle:"Color",colorGenericName:"color",colorStops:"Color Stops",addColorStop:"Add color stop",colorStopPosition:e=>`Stop ${e} position`,removeColorStop:e=>`Remove color stop ${e}`,direction:"Direction",gradientDirection:"Gradient direction",degrees:e=>`${e}°`,percent:e=>`${e}%`,dataTable:"Data table",search:"Search",searchPlaceholder:"Search",clearSearch:"Clear search",noRows:"No rows",noMatchingRows:"No rows match the search",rowsShown:(e,n)=>`${e} of ${n} rows`,rowsSelected:e=>`${e} selected`,yes:"Yes",no:"No",closePanel:"Close panel",settings:"Settings",ordinal:(e,n)=>{switch(n){case"one":return`${e}st`;case"two":return`${e}nd`;case"few":return`${e}rd`;default:return`${e}th`}}},dr="en",Nt=s.createContext(Vn),Dt=s.createContext(void 0);function ur(e){return e!==void 0&&e!==""?e:typeof document<"u"&&document.documentElement.lang!==""?document.documentElement.lang:typeof navigator<"u"&&navigator.language!==""?navigator.language:dr}function pr({labels:e,locale:n,children:a}){const r=s.useContext(Nt),i=s.useContext(Dt),l=s.useMemo(()=>({...r,...e}),[r,e]),p=n??i;return t.jsx(Dt.Provider,{value:p,children:t.jsx(Nt.Provider,{value:l,children:a})})}function se(){return s.useContext(Nt)}function ze(){const e=s.useContext(Dt);return ur(e)}const fr=1234.5,hr="9876543210",gr=9876543210,xr=new Set([" "," "," "," ","'","’"]),mr="−",br=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/iu,on=new Map;function yr(e){var h,u;const n=on.get(e);if(n!==void 0)return n;const a=new Intl.NumberFormat(e).formatToParts(fr),r=((h=a.find(f=>f.type==="decimal"))==null?void 0:h.value)??".",i=((u=a.find(f=>f.type==="group"))==null?void 0:u.value)??"",l=new Map;for(const f of"0123456789")l.set(f,f);const p=new Intl.NumberFormat(e,{useGrouping:!1}).format(gr);Array.from(p).forEach((f,x)=>{l.set(f,hr[x])});const g={decimal:r,digits:l,group:i};return on.set(e,g),g}function Un(e,n){const a=yr(n);let r="";for(const l of e.trim()){const p=a.digits.get(l);if(p!==void 0){r+=p;continue}if(l===a.decimal){r+=".";continue}if(!(l===a.group||xr.has(l))){if(l==="-"||l===mr){r+="-";continue}if(l==="+"){r+="+";continue}if(l==="e"||l==="E"){r+=l;continue}break}}const i=br.exec(r);return i===null?Number.NaN:Number(i[0])}function Xe(e){const n=ze(),a=JSON.stringify(e??{});return s.useMemo(()=>new Intl.NumberFormat(n,e),[n,a])}function $n(){const e=ze(),n=se(),a=Xe(),r=s.useMemo(()=>new Intl.PluralRules(e,{type:"ordinal"}),[e]);return s.useCallback(i=>n.ordinal(a.format(i),r.select(i)),[n,a,r])}function Wn(e){const n=ze(),a=JSON.stringify(e??{});return s.useMemo(()=>new Intl.Collator(n,e),[n,a])}function zt(){const e=ze();return s.useCallback(n=>Un(n,e),[e])}const Yn=["sizeSmallest","sizeLargest","width","opacity","attribute","scaleSqrt","scaleLinear","scaleLog"],Xn=["N","E","W","D","K"],vr=["chevronDown","chevronRight","chevronLeft","close","plus","minus","gear","warning","check","eye","refresh","copy","pin","keepOpen","info","reset"],Kn={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},Re={fill:"currentColor",stroke:"none"},wr={sizeSmallest:e=>t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"5",cy:"11",r:"2.5",...e?Re:{}}),t.jsx("circle",{cx:"10.5",cy:"6.5",r:"4",...e?Re:{}})]}),sizeLargest:e=>t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"4.5",cy:"11.5",r:"1.75",...e?Re:{}}),t.jsx("circle",{cx:"10",cy:"6",r:"5",...e?Re:{}})]}),width:e=>t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"2.5",y1:"8",x2:"13.5",y2:"8"}),t.jsx("polyline",{points:"5,5.5 2.5,8 5,10.5",...e?Re:{}}),t.jsx("polyline",{points:"11,5.5 13.5,8 11,10.5",...e?Re:{}})]}),opacity:e=>e?t.jsx("circle",{cx:"8",cy:"8",r:"5.5",...Re}):t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),t.jsx("path",{d:"M8 2.5a5.5 5.5 0 0 1 0 11z",...Re})]}),attribute:e=>e?t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z",...Re}),t.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75",style:{fill:m.SURFACE},stroke:"none"})]}):t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 7.2V3.5a1 1 0 0 1 1-1h3.7l6.3 6.3-4.7 4.7z"}),t.jsx("circle",{cx:"5.5",cy:"5.5",r:"0.75"})]}),scaleSqrt:()=>t.jsx("path",{d:"M2.5 13.5C4.5 5 8 2.5 13.5 2.5"}),scaleLinear:()=>t.jsx("line",{x1:"2.5",y1:"13.5",x2:"13.5",y2:"2.5"}),scaleLog:()=>t.jsx("path",{d:"M2.5 13.5C8 13.5 11.5 11 13.5 2.5"})},Ir={chevronDown:t.jsx("polyline",{points:"4,6 8,10 12,6"}),chevronRight:t.jsx("polyline",{points:"6,4 10,8 6,12"}),chevronLeft:t.jsx("polyline",{points:"10,4 6,8 10,12"}),close:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]}),plus:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"8",y1:"3",x2:"8",y2:"13"}),t.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"})]}),minus:t.jsx("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),gear:t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"2.25"}),t.jsx("circle",{cx:"8",cy:"8",r:"4.75"}),t.jsx("path",{d:"M8 1.5v2M8 12.5v2M1.5 8h2M12.5 8h2M3.4 3.4l1.4 1.4M11.2 11.2l1.4 1.4M12.6 3.4l-1.4 1.4M4.8 11.2l-1.4 1.4"})]}),warning:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M8 2.5l6 11H2z"}),t.jsx("line",{x1:"8",y1:"6.5",x2:"8",y2:"9.5"}),t.jsx("line",{x1:"8",y1:"11.5",x2:"8",y2:"11.75"})]}),check:t.jsx("polyline",{points:"3.5,8.5 6.5,11.5 12.5,5"}),eye:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),t.jsx("circle",{cx:"8",cy:"8",r:"2"})]}),refresh:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M2.5 8a5.5 5.5 0 1 0 1.6-3.9"}),t.jsx("polyline",{points:"2.5,2.5 2.5,6 6,6"})]}),copy:t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1"}),t.jsx("path",{d:"M10.5 5.5v-2a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2"})]}),pin:t.jsxs(t.Fragment,{children:[t.jsx("path",{d:"M6 2.5h4l-.5 3.5 2 2.5H4.5l2-2.5z"}),t.jsx("line",{x1:"8",y1:"8.5",x2:"8",y2:"13.5"})]}),keepOpen:t.jsxs(t.Fragment,{children:[t.jsx("rect",{x:"3.5",y:"7",width:"9",height:"6.5",rx:"1"}),t.jsx("path",{d:"M5.75 7V5.25a2.25 2.25 0 0 1 4.5 0V7"})]}),info:t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:"8",cy:"8",r:"6.5"}),t.jsx("line",{x1:"8",y1:"7",x2:"8",y2:"11.5"}),t.jsx("line",{x1:"8",y1:"4.5",x2:"8",y2:"4.75"})]}),reset:t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),t.jsx("line",{x1:"12",y1:"4",x2:"4",y2:"12"})]})};function rt({name:e,filled:n=!1,size:a=d.GLYPH}){return t.jsx("svg",{width:a,height:a,...Kn,"aria-hidden":"true",focusable:"false","data-glyph":e,"data-filled":n?"true":"false",style:{flex:"0 0 auto",display:"block"},children:wr[e](n)})}function oe({name:e,size:n=d.GLYPH}){return t.jsx("svg",{width:n,height:n,...Kn,"aria-hidden":"true",focusable:"false","data-glyph":e,style:{flex:"0 0 auto",display:"block"},children:Ir[e]})}function Bt(e){return typeof e=="string"&&Yn.includes(e)}function Ft(e){return typeof e=="string"&&Xn.includes(e)}const Vt=255,Ut=100;function $t(e){return Math.round(parseInt(e,16)/Vt*Ut)}function Wt(e){return Math.round(e/Ut*Vt).toString(16).padStart(2,"0")}function Er(e){let n=e.replace("#","");n.length===3?n=`${n.split("").map(l=>l+l).join("")}ff`:n.length===4?n=n.split("").map(l=>l+l).join(""):n.length===6&&(n=`${n}ff`);const a=`#${n.slice(0,6)}`,r=n.slice(6,8),i=$t(r);return{hex:a,opacity:i}}function Sr(e,n){const a=e.replace("#",""),r=Wt(n);return`#${a}${r}`}function Cr(e){return/^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}const qn=s.createContext(null);function Tr(){return s.useContext(qn)}function Rr({children:e}){const n=s.useRef(null);if(!s.isValidElement(e))throw new Error("PopoutAnchor requires a single valid React element as its child");const a=e,r=s.cloneElement(a,{ref:n});return t.jsx(qn.Provider,{value:{anchorRef:n},children:r})}function Pr({children:e}){return t.jsx(o.Box,{p:"sm",children:e})}const Ar=["[data-portal]","[data-combobox-dropdown]","[data-menu-dropdown]","[data-popover-dropdown]","[data-tooltip]","[data-hovercard-dropdown]","[data-dates-dropdown]","[data-modal]"].join(", ");function jr(e,n=!0){s.useEffect(()=>{if(!n)return;const a=r=>{const i=r.target;i.closest('[role="dialog"]')||i.closest("[data-popout-trigger]")||i.closest("[data-popout-portal-container]")||i.closest(Ar)||e()};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[e,n])}function Lr(e,n=!0){s.useEffect(()=>{if(!n)return;const a=r=>{r.key==="Escape"&&(r.preventDefault(),e())};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}},[e,n])}const Zn=s.createContext(null);function Or({id:e,children:n}){return t.jsx(Zn.Provider,{value:e,children:n})}function Jn(){return s.useContext(Zn)}const Yt=s.createContext(null),Xt=s.createContext(null);function vt(){const e=s.useContext(Yt);if(!e)throw new Error("usePopoutContext must be used within a Popout component");return e}function Hr(){return s.useContext(Yt)}function _r(){const e=s.useContext(Xt);if(!e)throw new Error("usePopoutManagerContext must be used within a PopoutManager");return e}function Nr(){return s.useContext(Xt)}function Dr({children:e,parentId:n=null,opened:a,defaultOpened:r,onOpenChange:i}){const l=s.useId(),p=s.useRef(null),g=Jn(),[h,u]=Y.useUncontrolled({value:a,defaultValue:r,finalValue:!1,onChange:i}),f=s.useRef(u);s.useEffect(()=>{f.current=u});const x=s.useCallback((E,L)=>{if(L){f.current(E,L);return}f.current(E)},[]),b=s.useCallback(E=>{x(!0,E)},[x]),T=s.useCallback(E=>{x(!1,E)},[x]),C=s.useCallback(E=>{x(!h,E)},[h,x]),S=s.useMemo(()=>({id:l,isOpen:h,open:b,close:T,toggle:C,triggerRef:p,parentId:n,region:g}),[l,h,b,T,C,n,g]);return t.jsx(Yt.Provider,{value:S,children:e})}function kr({children:e}){const[n,a]=s.useState(null),r=s.useRef([]),i=s.useRef(new Map),l=s.useRef(new Map),p=s.useRef(new Map),[g,h]=s.useState(0),u=s.useCallback((v,y,_)=>(l.current.get(v)??null)!==y?!1:y!==null?!0:(p.current.get(v)??null)===_,[]),f=s.useCallback((v,y)=>r.current.filter(_=>u(_,v,y)),[u]),x=s.useCallback(v=>{const y=[];for(const _ of r.current){let M=_;for(;M;){const X=l.current.get(M)??null;if(X===v){y.push(_);break}M=X}}return y},[]),b=s.useCallback(v=>{let y=0,_=v;for(;_;){const M=l.current.get(_)??null;if(!M)break;y++,_=M}return y},[]),T=s.useCallback(v=>{var _;const y=[...v].sort((M,X)=>b(X)-b(M));for(const M of y)(_=i.current.get(M))==null||_()},[b]),C=s.useCallback((v,y,_,M)=>{if(r.current.includes(v)){i.current.set(v,y);return}const X=_??null,K=M??null,de=f(X,K),F=[];for(const W of de)F.push(W),F.push(...x(W));T(F);const q=new Set(F);r.current=r.current.filter(W=>!q.has(W)),r.current.push(v),i.current.set(v,y),l.current.set(v,X),p.current.set(v,K),h(W=>W+1)},[f,x,T]),S=s.useCallback(v=>{if(!r.current.includes(v)){i.current.delete(v),l.current.delete(v),p.current.delete(v);return}r.current=r.current.filter(y=>y!==v),i.current.delete(v),l.current.delete(v),p.current.delete(v),h(y=>y+1)},[]),E=s.useCallback(v=>{const y=r.current.indexOf(v);return y>=0?_t+y:_t},[]),L=s.useCallback(v=>{const y=r.current,_=y.indexOf(v);_===-1||_===y.length-1||(r.current=[...y.filter(M=>M!==v),v],h(M=>M+1))},[]),R=s.useCallback(v=>l.current.get(v)??null,[]),I=s.useCallback((v,y)=>{let _=y;for(;_;){const M=l.current.get(_);if(M===v)return!0;_=M??null}return!1},[]),P=s.useCallback(v=>{const y=[],_=r.current;for(const M of _)I(v,M)&&y.push(M);return y},[I]),O=s.useCallback(v=>{const y=P(v);for(const _ of[...y].reverse()){const M=i.current.get(_);M==null||M()}},[P]),j=s.useCallback(v=>{O(v);const y=i.current.get(v);y==null||y()},[O]),D=s.useCallback((v,y)=>{const _=p.current.get(v)??null;for(const M of r.current)M!==v&&u(M,y,_)&&j(M)},[j,u]),N=s.useCallback(()=>{const v=r.current;if(v.length===0)return;const y=v[v.length-1],_=i.current.get(y);_==null||_()},[]),z=s.useCallback(()=>{const v=[...r.current];for(const y of v){const _=i.current.get(y);_==null||_()}},[]),B=s.useCallback(()=>r.current.length>0,[]),[$,A]=s.useState(!1);s.useEffect(()=>{A(r.current.length>0)},[g]),Lr(N,$),jr(z,$);const k=s.useMemo(()=>({register:C,unregister:S,getZIndex:E,bringToFront:L,portalContainer:n,zIndexVersion:g,closeFocused:N,closeAll:z,hasOpenPopouts:B,closeWithDescendants:j,closeDescendants:O,closeSiblings:D,getParentId:R,isAncestor:I}),[C,S,E,L,n,g,N,z,B,j,O,D,R,I]);return t.jsxs(Xt.Provider,{value:k,children:[e,t.jsx("div",{ref:a,"data-popout-portal-container":!0,style:{display:"contents"}})]})}function Ae(){return o.useDirection().dir}function fe(e){return e==="rtl"}function Mr(e,n){return fe(n)?1-e:e}function Gr(e,n,a){return Mr(e,a)*n}function zr(e){return fe(e)?{transform:"scaleX(-1)"}:{}}const rn=3;function Br(e){const{isOpen:n,onPress:a,onDragStart:r,onDrag:i,onDragEnd:l}=e,[p,g]=s.useState({left:0,top:0}),h=s.useRef(!1),u=s.useRef(!1),f=s.useRef(!1),x=s.useRef({x:0,y:0,offsetLeft:0,offsetTop:0}),b=s.useCallback(()=>{g({left:0,top:0})},[]),T=s.useCallback(()=>{const R=f.current;return f.current=!1,R},[]),C=s.useCallback(R=>{const I=R.target;if(!(I.tagName==="INPUT"||I.tagName==="TEXTAREA"||I.tagName==="BUTTON"||I.tagName==="SELECT"||I.closest("button")||I.closest("input")||I.closest("textarea")||I.closest("select"))){h.current=!0,u.current=!1,f.current=!1,x.current={x:R.clientX,y:R.clientY,offsetLeft:p.left,offsetTop:p.top},a==null||a(R);try{I.setPointerCapture(R.pointerId)}catch{}}},[p.left,p.top,a]),S=s.useCallback(R=>{if(!h.current)return;const I=R.clientX-x.current.x,P=R.clientY-x.current.y;if(!u.current){if(!(Math.abs(I)>=rn||Math.abs(P)>=rn))return;u.current=!0,r==null||r(R)}const O={left:x.current.offsetLeft+I,top:x.current.offsetTop+P};g(O),i==null||i(O,R)},[i,r]),E=s.useCallback(R=>{if(!h.current)return;h.current=!1;const I=R.target;I.hasPointerCapture(R.pointerId)&&I.releasePointerCapture(R.pointerId),u.current&&(u.current=!1,f.current=!0,l==null||l(R))},[l]),L=p.left!==0||p.top!==0;return n?{dragTriggerProps:{"data-drag-trigger":!0,onPointerDown:C,onPointerMove:S,onPointerUp:E,onPointerCancel:E,style:{cursor:"grab",userSelect:"none",touchAction:"none"}},dragOffset:p,resetDragOffset:b,hasDragged:L,consumeDragClick:T}:{dragTriggerProps:{},dragOffset:{left:0,top:0},resetDragOffset:b,hasDragged:!1,consumeDragClick:T}}function Fr({config:e,onClose:n,dragTriggerProps:a={},actions:r=[],activeTab:i,onTabChange:l,titleId:p}){var T;const g=se(),{style:h,...u}=a,x=e.variant==="tabs"?e:null,b=(x==null?void 0:x.tabs.map(C=>({value:C.id,label:C.label})))??[];return t.jsxs(o.Group,{"data-testid":"popout-header",justify:"space-between",px:"sm",py:"xs",...u,style:{...h},children:[e.variant==="title"?t.jsx(o.Text,{id:p,"data-testid":"popout-header-title",size:"sm",fw:500,children:e.title}):t.jsxs(t.Fragment,{children:[t.jsx(o.VisuallyHidden,{id:p,children:((T=x==null?void 0:x.tabs[0])==null?void 0:T.label)??g.settings}),t.jsx(o.SegmentedControl,{"data-testid":"popout-header-tabs",data:b,value:i,onChange:C=>l==null?void 0:l(C),size:"xs"})]}),t.jsxs(o.Group,{gap:4,children:[r.map(C=>t.jsx(o.ActionIcon,{variant:"subtle",onClick:C.onClick,"aria-label":C.label,children:C.icon},C.id)),t.jsx(o.CloseButton,{size:"sm","data-testid":"popout-header-close",onClick:n,"aria-label":g.closePanel})]})]})}function Vr(e,n=document){return e===null?null:n.querySelector(`[data-popout-id="${e}"]`)}function an(e,n,a){const{trigger:r,parent:i,panel:l}=a;if(e!==void 0){if(typeof e=="object")return e.current;switch(e){case"parent":return i??l??r;case"panel":return l??i??r;case"trigger":return r;default:{const p=e;throw new Error(`Unknown anchor target: ${String(p)}`)}}}return n==="x"?i??l??r:r??i??l}function Ur(e,n){return e==="start"?fe(n)?"right":"left":e==="end"?fe(n)?"left":"right":e}function $r(e,n,a=Mn,r={}){const{placement:i="left",alignment:l="start",panelHeight:p=0,crossAnchorRect:g=e,direction:h="ltr"}=r;let u,f;switch(i){case"left":u=e.left-n-a,f=sn(g,l,p);break;case"right":u=e.right+a,f=sn(g,l,p);break;case"top":u=ln(g,l,n,h),f=e.top-p-a;break;case"bottom":u=ln(g,l,n,h),f=e.bottom+a;break;default:{const x=i;throw new Error(`Unknown placement: ${String(x)}`)}}return{left:u,top:f}}function sn(e,n,a){switch(n){case"start":return e.top;case"center":return e.top+e.height/2-a/2;case"end":return e.bottom-a;default:{const r=n;throw new Error(`Unknown alignment: ${String(r)}`)}}}function ln(e,n,a,r){switch(n){case"start":return fe(r)?e.right-a:e.left;case"center":return e.left+e.width/2-a/2;case"end":return fe(r)?e.left:e.right-a;default:{const i=n;throw new Error(`Unknown alignment: ${String(i)}`)}}}function Wr(e){var $e,xe;const{width:n,height:a,header:r,label:i,children:l,anchorX:p,anchorY:g,placement:h="left",alignment:u="start",gap:f,actions:x,manageFocus:b=!0,onDragStart:T,onDrag:C,onDragEnd:S}=e,{isOpen:E,close:L,triggerRef:R,id:I,parentId:P,region:O}=vt(),{getZIndex:j,portalContainer:D,register:N,unregister:z,bringToFront:B,zIndexVersion:$,closeDescendants:A}=_r(),k=Tr(),v=Ae(),y=s.useId(),_=`popout-panel-${I}`,M=`popout-title-${y}`,[X,K]=s.useState(null),de=s.useRef(!1),F=s.useRef(null),q=s.useCallback(()=>{B(I)},[B,I]),{dragTriggerProps:W,dragOffset:je,resetDragOffset:Le,hasDragged:re,consumeDragClick:ye}=Br({isOpen:E,onPress:q,onDragStart:T,onDrag:C,onDragEnd:S}),ve=(r==null?void 0:r.variant)==="tabs",Z=(r==null?void 0:r.variant)==="tabs"?r:null,ue=(Z==null?void 0:Z.defaultTab)??(($e=Z==null?void 0:Z.tabs[0])==null?void 0:$e.id),[Be,Oe]=s.useState(ue),Ke=f??(P===null?0:Gn),Fe=s.useCallback((V,Q)=>{var ee;Oe(V),(ee=Z==null?void 0:Z.onTabChange)==null||ee.call(Z,V,Q)},[Z]),ie=s.useCallback(V=>{V.stopPropagation(),B(I),!ye()&&A(I)},[A,B,ye,I]),ge=s.useCallback(V=>{A(I),L(V)},[A,L,I]),we=s.useRef(L);s.useEffect(()=>{we.current=L});const Ee=s.useCallback(()=>{we.current()},[]);s.useEffect(()=>(E?N(I,Ee,P,O):z(I),()=>{z(I)}),[E,I,N,z,Ee,P,O]);const He=s.useCallback(()=>{const V={trigger:R.current,parent:Vr(P),panel:(k==null?void 0:k.anchorRef.current)??null};return{inline:an(p,"x",V),block:an(g,"y",V)}},[R,P,k,p,g]),_e=s.useCallback(()=>{var Je;const{inline:V,block:Q}=He(),ee=V??Q,te=Q??V;if(!ee||!te)return;const le=(Je=F.current)==null?void 0:Je.getBoundingClientRect(),me=Math.max(n,(le==null?void 0:le.width)??0),G=Math.max(a??0,(le==null?void 0:le.height)??0),ne=Ur(h,v),Ie=ne==="top"||ne==="bottom",it=Ie?te:ee,Ne=Ie?ee:te,ae=$r(it.getBoundingClientRect(),me,Ke,{placement:ne,alignment:u,panelHeight:G,crossAnchorRect:Ne.getBoundingClientRect(),direction:v});K(De=>De&&De.left===ae.left&&De.top===ae.top?De:ae)},[He,n,a,h,u,Ke,v]);if(Y.useIsomorphicEffect(()=>{if(!E){K(null);return}de.current||(Le(),ve&&Oe(ue)),_e()},[E,_e,Le,ve,ue]),s.useEffect(()=>{if(!E)return;let V=0;const Q=()=>{V===0&&(V=requestAnimationFrame(()=>{V=0,_e()}))},ee=new ResizeObserver(Q),te=new MutationObserver(Q),{inline:le,block:me}=He();for(const ne of new Set([le,me].filter(Ie=>Ie!==null)))ee.observe(ne),te.observe(ne,{attributes:!0,attributeFilter:["style","class"]});F.current&&ee.observe(F.current);const G=()=>{re||Q()};return window.addEventListener("resize",G),window.addEventListener("scroll",G,!0),()=>{V!==0&&cancelAnimationFrame(V),ee.disconnect(),te.disconnect(),window.removeEventListener("resize",G),window.removeEventListener("scroll",G,!0)}},[E,_e,He,re]),s.useEffect(()=>{var V;if(b){if(E){const Q=setTimeout(()=>{var ee;(ee=F.current)==null||ee.focus()},0);return()=>{clearTimeout(Q)}}de.current&&((V=R.current)==null||V.focus())}},[E,b,R]),s.useEffect(()=>{de.current=E},[E]),!E||!D)return null;const Ve=j(I),qe={left:((X==null?void 0:X.left)??0)+je.left,top:((X==null?void 0:X.top)??0)+je.top},Se=t.jsxs(o.Paper,{ref:F,id:_,role:"dialog","aria-modal":"false","aria-labelledby":r?M:void 0,"aria-label":r?void 0:i,tabIndex:-1,radius:8,onClick:ie,"data-testid":"popout-panel","data-popout-id":I,...P&&{"data-parent-id":P},style:{position:"fixed",left:qe.left,top:qe.top,minWidth:n,width:"min-content",...a!==void 0&&{minHeight:a},...X===null&&{visibility:"hidden"},zIndex:Ve,backgroundColor:"var(--mantine-color-body)",border:"1px solid light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.12))",boxShadow:["0 1px 2px light-dark(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.4))","0 4px 8px light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.35))","0 8px 16px light-dark(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.25))"].join(", ")},children:[r?t.jsx(Fr,{config:r,onClose:ge,dragTriggerProps:W,activeTab:Be,onTabChange:Fe,actions:x,titleId:M}):null,t.jsx(o.Box,{"data-testid":"popout-panel-content",children:ve?(xe=Z==null?void 0:Z.tabs.find(V=>V.id===Be))==null?void 0:xe.content:l})]});return Eo.createPortal(Se,D)}function Yr({children:e,action:n="toggle"}){const{open:a,toggle:r,triggerRef:i,isOpen:l,id:p}=vt(),g=s.useCallback(f=>{if(f.stopPropagation(),n==="open"){a(f);return}r(f)},[n,a,r]);if(!s.isValidElement(e))throw new Error("PopoutTrigger requires a single valid React element as its child");const h=`popout-panel-${p}`,u=e;return s.cloneElement(u,{onClick:f=>{var x,b;(b=(x=u.props).onClick)==null||b.call(x,f),g(f)},ref:i,"data-popout-trigger":!0,"aria-expanded":l,"aria-controls":h,"aria-haspopup":"dialog"})}function Xr({children:e,opened:n,defaultOpened:a,onOpenChange:r}){const i=Hr(),l=(i==null?void 0:i.id)??null;return t.jsx(Dr,{parentId:l,opened:n,defaultOpened:a,onOpenChange:r,children:e})}const Me=Object.assign(Xr,{Trigger:Yr,Panel:Wr,Content:Pr,Anchor:Rr}),Kr=s.forwardRef(function({icon:n,size:a="xs",...r},i){const{isOpen:l}=vt();return t.jsx(o.ActionIcon,{ref:i,"data-testid":"popout-button",variant:l?"light":"subtle",size:a,c:l?void 0:"dimmed",...r,children:n})});function Qn({children:e}){return t.jsx(kr,{children:e})}const cn=4,dn=4,qr=2,Zr=72,Jr=54,Qr=220,un=0,Et=100,pn=9,fn=7,ea=/^#[0-9A-F]{6}$/iu,ta=1.1;function St(e){const n=e==="start"?dn:0,a=e==="end"?dn:0;return{borderStartStartRadius:n,borderEndStartRadius:n,borderStartEndRadius:a,borderEndEndRadius:a}}function na(){const e=ze();return s.useMemo(()=>{var a;return((a=new Intl.NumberFormat(e).formatToParts(ta).find(r=>r.type==="decimal"))==null?void 0:a.value)??"."},[e])}function eo({color:e,defaultColor:n,opacity:a,defaultOpacity:r=Et,onColorChange:i,onOpacityChange:l,label:p,showOpacity:g=!0,disabled:h=!1,onFocus:u,onBlur:f}){const x=se(),b=zt(),T=na(),C=s.useId(),[S,E]=Y.useUncontrolled({value:e,defaultValue:void 0,finalValue:void 0,onChange:i}),[L,R]=Y.useUncontrolled({value:a,defaultValue:void 0,finalValue:void 0,onChange:l}),I=S===void 0,P=L===void 0,O=I&&(!g||P),j=S??n,D=L??r,[N,z]=s.useState(j.replace("#","").toUpperCase()),[B,$]=s.useState(D);s.useEffect(()=>{z(j.replace("#","").toUpperCase())},[j]),s.useEffect(()=>{$(D)},[D]);const A=F=>{if(F.length===pn){E(F.slice(0,fn).toUpperCase()),g&&R($t(F.slice(fn,pn)));return}E(F.toUpperCase())},k=()=>`${j}${Wt(D)}`.toUpperCase(),v=F=>{z(F.currentTarget.value.toUpperCase())},y=F=>{const q=N.toUpperCase(),W=q.startsWith("#")?q:`#${q}`;ea.test(W)&&W!==j?E(W,F):z(j.replace("#","").toUpperCase()),f==null||f(F)},_=F=>{$(F)},M=F=>{const q=typeof B=="string"?b(B):B;if(Number.isNaN(q)){$(D),f==null||f(F);return}const W=Math.min(Et,Math.max(un,q));W!==D&&R(W,F),$(W),f==null||f(F)},X=F=>{E(void 0,F),g&&R(void 0,F)},K=g?"middle":"end",de=t.jsxs(o.Group,{"data-testid":"compact-color-input",gap:cn,wrap:"nowrap",children:[t.jsxs(o.Group,{gap:0,wrap:"nowrap",children:[t.jsxs(Me,{children:[t.jsx(Me.Trigger,{children:t.jsx(o.ActionIcon,{variant:"filled",size:d.CONTROL_HEIGHT,radius:0,style:{backgroundColor:"var(--mantine-color-default)",...St("start")},"data-testid":"compact-color-input-swatch",disabled:h,"aria-label":x.colorSwatch,children:t.jsx(o.ColorSwatch,{color:j,size:d.GLYPH,radius:qr,style:{border:`1px solid ${m.BORDER}`}})})}),t.jsx(Me.Panel,{width:Qr,header:{variant:"title",title:p??x.colorPanelTitle},placement:"bottom",alignment:"start",gap:cn,children:t.jsx(Me.Content,{children:t.jsx(o.ColorPicker,{format:"hexa",value:k(),onChange:A,swatches:[...Fn]})})})]}),t.jsx(o.TextInput,{"data-testid":"compact-color-input-hex",disabled:h,value:N,onChange:v,onFocus:u,onBlur:y,"aria-label":x.colorHexValue,"data-is-default":I?"true":"false",w:Zr,styles:{input:{...St(K),fontFamily:"monospace",textTransform:"uppercase",...I?{fontStyle:"italic",color:m.CHROME}:{}}}}),g&&t.jsxs(t.Fragment,{children:[t.jsx(o.Divider,{orientation:"vertical",color:m.BORDER,h:d.CONTROL_HEIGHT,my:0}),t.jsx(o.NumberInput,{"data-testid":"compact-color-input-opacity",disabled:h,value:B,onChange:_,onFocus:u,onBlur:M,min:un,max:Et,decimalSeparator:T,hideControls:!0,suffix:"%","aria-label":x.opacity,"data-is-default":P?"true":"false",w:Jr,styles:{input:{...St("end"),textAlign:"end",...P?{fontStyle:"italic",color:m.CHROME}:{}}}})]})]}),!O&&t.jsx(o.ActionIcon,{variant:"subtle",size:d.TRAIL,c:m.CHROME,"data-testid":"compact-color-input-reset",disabled:h,"aria-label":x.resetToDefault(p??x.colorGenericName),onClick:X,children:t.jsx(oe,{name:"reset",size:d.CHEVRON})})]});return p===void 0?de:t.jsxs(o.Stack,{"data-testid":"compact-color-input-labelled",gap:0,role:"group","aria-labelledby":C,children:[t.jsx(o.Text,{id:C,"data-testid":"compact-color-input-label",size:"xs",c:m.CHROME,mb:1,lh:1.2,children:p}),de]})}const ht=d.GUTTER,hn=4,oa=1,ra=1.2,aa="calc(-1 * var(--mantine-spacing-sm) - 1px)";function sa({label:e,actions:n,children:a,bleed:r=!1}){const i=s.useId(),l=n!=null;return t.jsxs(o.Box,{"data-testid":"control-group",role:"group","aria-labelledby":i,children:[t.jsx(o.Divider,{"data-testid":"control-group-divider",color:m.DIVIDER,size:oa,style:{marginBlockStart:ht,marginBlockEnd:0,marginInline:r?aa:void 0}}),t.jsxs(o.Box,{"data-testid":"control-group-header",style:{display:"flex",alignItems:"center",gap:hn,boxSizing:"border-box",paddingBlock:ht,paddingInline:ht},children:[t.jsx(o.Box,{component:"span",id:i,"data-testid":"control-group-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--mantine-font-size-xs)",fontWeight:500,lineHeight:ra,color:m.VALUE},children:e}),l&&t.jsx(o.Box,{"data-testid":"control-group-actions",style:{display:"flex",alignItems:"center",gap:hn,flex:"0 0 auto"},children:n})]}),t.jsx(o.Stack,{"data-testid":"control-group-content",gap:0,px:ht,children:a})]})}function Pe(e){const n=s.useRef(void 0);s.useEffect(()=>{process.env.NODE_ENV==="production"||e===void 0||n.current!==e&&(n.current=e,console.warn(e))},[e])}const gn=250,ia=4;function la({name:e,bubbleId:n}){const{isOpen:a,open:r,close:i}=vt();return t.jsx(Me.Trigger,{action:"open",children:t.jsx(o.UnstyledButton,{type:"button",title:e,"aria-label":e,"aria-describedby":a?n:void 0,"data-testid":"info-circle",onMouseEnter:r,onMouseLeave:i,onFocus:r,onBlur:i,style:{flex:"0 0 auto",width:d.GLYPH,height:d.GLYPH,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"transparent",color:m.CHROME,cursor:"default"},children:t.jsx(oe,{name:"info",size:d.CHEVRON})})})}function to({children:e,label:n,opened:a,defaultOpened:r,onOpenChange:i}){const l=se(),p=s.useId(),g=Nr()!==null,h=l.about(n),u=t.jsxs(Me,{opened:a,defaultOpened:r,onOpenChange:i,children:[t.jsx(la,{name:h,bubbleId:p}),t.jsx(Me.Panel,{width:gn,label:h,placement:"bottom",alignment:"start",gap:ia,anchorX:"trigger",anchorY:"trigger",manageFocus:!1,children:t.jsx(o.Box,{id:p,w:gn,p:"xs",style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1.4,color:m.PROSE},children:e})})]});return g?u:t.jsx(Qn,{children:u})}function at(e){return e!=null&&e!==!1}function be({children:e}){return t.jsx(o.Box,{"data-testid":"trailing-slot",style:{flex:"0 0 auto",width:d.TRAIL,height:d.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center"},children:e})}const no=s.forwardRef(function(n,a){const{label:r,changed:i=!1,icon:l,onClick:p,disabled:g=!1,loading:h=!1,style:u,...f}=n,x=se(),b=i?x.sectionHasConfiguredValues(r):r,T=i?m.VALUE:m.CHROME;return t.jsx(o.ActionIcon,{...f,ref:a,type:"button",variant:"subtle",color:"gray",size:d.TRAIL,radius:"sm",vars:()=>({root:{"--ai-color":T}}),title:b,"aria-label":b,"aria-busy":h,disabled:g,loading:h,"data-testid":"advanced-button","data-changed":i?"true":"false",onClick:p,style:{flex:"0 0 auto",...u},children:l??t.jsx(oe,{name:"gear",size:d.GLYPH})})}),Ct=4,ca=1,xn=6,da=12,ua=1.2;function pa(e){const{label:n,technicalName:a,opened:r,defaultOpened:i,onOpenChange:l,hasConfiguredValues:p=!1,empty:g=!1,onAdd:h,info:u,actions:f,children:x}=e,b=se(),T=Ae(),C=s.useId(),S=s.useId(),E=s.useId(),[L,R]=Y.useUncontrolled({value:r,defaultValue:i,finalValue:!0,onChange:l}),I=!g&&s.Children.toArray(x).length>0,P=u!=null;Pe(g||I?void 0:`ControlSection "${n}" was given no children, and it holds the rows of a section. Pass the rows, set "empty" to draw it as a single row with a "+", or do not render it: a section header whose chevron opens onto nothing is a dead end for the reader.`);const O=k=>{R(!L,k)},j=L?b.collapseSection(n):b.expandSection(n),D=b.addToSection(n),N=fe(T)?"chevronLeft":"chevronRight",z={flex:"0 0 auto",width:d.GLYPH_SLOT,height:d.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:m.CHROME},B={display:"flex",alignItems:"center",gap:Ct,flex:"0 1 auto",minWidth:0,height:"100%",background:"transparent",textAlign:"start"},$=a===void 0?n:`${n} (${a})`,A=t.jsxs(o.Box,{component:"span",id:C,title:$,"data-testid":"control-section-name",style:{minWidth:0,fontSize:da,fontWeight:500,lineHeight:ua,color:g?m.CHROME:m.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[n,a===void 0?null:t.jsx(o.Box,{component:"span","data-testid":"control-section-technical-name",style:{fontWeight:400,color:m.CHROME},children:` (${a})`})]});return t.jsxs(o.Box,{role:"group","aria-labelledby":C,"aria-describedby":P?E:void 0,"data-testid":"control-section","data-empty":g?"true":void 0,children:[t.jsx(o.Divider,{"data-testid":"control-section-divider",color:m.DIVIDER,size:ca,my:0,mx:0}),t.jsxs(o.Box,{"data-testid":"control-section-header",style:{display:"flex",alignItems:"center",gap:Ct,boxSizing:"border-box",height:d.SECTION_HEADER,paddingInlineStart:d.PAD_LEFT,paddingInlineEnd:d.PAD_RIGHT},children:[I?t.jsxs(o.UnstyledButton,{type:"button","data-testid":"control-section-toggle","aria-label":j,"aria-expanded":L,"aria-controls":S,onClick:O,style:{...B,cursor:"pointer"},children:[t.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:z,children:t.jsx(oe,{name:L?"chevronDown":N,size:d.CHEVRON})}),A]}):t.jsxs(o.Box,{style:B,children:[t.jsx(o.Box,{"data-testid":"control-section-chevron-slot",style:z}),A]}),p&&t.jsx(o.Box,{role:"img","aria-label":b.sectionHasConfiguredValues(n),"data-testid":"control-section-dot",style:{flex:"0 0 auto",width:xn,height:xn,borderRadius:"50%",background:m.ACCENT}}),P&&t.jsx(to,{label:n,children:u}),t.jsx(o.Box,{style:{flex:"1 1 auto"}}),f!=null&&t.jsx(o.Box,{"data-testid":"control-section-actions",style:{display:"flex",alignItems:"center",gap:Ct,flex:"0 0 auto"},children:f}),g&&h!==void 0&&t.jsx(be,{children:t.jsx(o.ActionIcon,{type:"button",variant:"subtle",size:d.CONTROL_HEIGHT,radius:"sm",c:m.CHROME,title:D,"aria-label":D,"data-testid":"control-section-add",onClick:h,children:t.jsx(oe,{name:"plus",size:d.GLYPH})})})]}),P&&t.jsx(o.Box,{id:E,"data-testid":"control-section-description",hidden:!0,children:u}),I&&t.jsx(o.Collapse,{id:S,in:L,children:t.jsx(o.Box,{"data-testid":"control-section-content",style:{paddingInlineStart:d.PAD_LEFT,paddingInlineEnd:d.PAD_RIGHT,paddingBottom:d.SECTION_PAD_BOTTOM},children:t.jsx(o.Stack,{gap:0,children:x})})})]})}const Tt="control-sub-group",mn=4,fa=10,ha=1.2;function ga(e){const{label:n,opened:a,defaultOpened:r,onOpenChange:i,children:l}=e,p=se(),g=Ae(),h=s.useRef(void 0),[u,f]=Y.useUncontrolled({value:a,defaultValue:r,finalValue:!1,onChange:i}),x=s.useCallback(E=>{h.current=E},[]),b=s.useCallback(E=>{const L=h.current;h.current=void 0,f(E===Tt,L)},[f]),T=u?p.collapseSection(n):p.expandSection(n);let C="chevronDown";u||(C=fe(g)?"chevronLeft":"chevronRight");const S={item:{border:"none",background:"transparent"},control:{paddingInline:0,paddingBlock:0,minHeight:d.TOGGLE_PITCH,color:m.CHROME},label:{paddingBlock:0,fontSize:"var(--mantine-font-size-xs)",lineHeight:ha,color:m.CHROME},chevron:{marginInlineStart:0,marginInlineEnd:mn,color:m.CHROME},content:{paddingBlock:0,paddingInlineStart:d.GUTTER,paddingInlineEnd:0}};return t.jsx(o.Accordion,{"data-testid":"control-sub-group",value:u?Tt:null,onChange:b,chevronPosition:"left",chevronSize:d.GLYPH_SLOT,disableChevronRotation:!0,chevron:t.jsx(oe,{name:C,size:fa}),styles:S,children:t.jsxs(o.Accordion.Item,{value:Tt,"data-testid":"control-sub-group-item",children:[t.jsx(o.Accordion.Control,{"data-testid":"control-sub-group-control","aria-label":T,onClick:x,children:t.jsx(o.Box,{component:"span","data-testid":"control-sub-group-label",title:n,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})}),t.jsx(o.Accordion.Panel,{"data-testid":"control-sub-group-panel",children:t.jsx(o.Box,{"data-testid":"control-sub-group-content",style:{display:"flex",flexDirection:"column",gap:mn},children:l})})]})})}function nt(e){if("key"in e)return{source:"keyboard"};const n=e.nativeEvent;return typeof PointerEvent<"u"&&n instanceof PointerEvent?{source:n.pointerType===""?"keyboard":"pointer"}:{source:n.detail===0?"keyboard":"pointer"}}function xa(e){const n=se();return s.useMemo(()=>({...n,...e}),[n,e])}const ce=-1;function tt(e,n,a){return Math.min(Math.max(e,n),a)}function ma(e,n,a,r,i){const{rowCount:l,columnCount:p,pageSize:g}=a,h=l-1,u=p-1;if(p===0)return;const f=fe(r)?"ArrowLeft":"ArrowRight",x=fe(r)?"ArrowRight":"ArrowLeft";if(n===f)return{row:e.row,column:Math.min(e.column+1,u)};if(n===x)return{row:e.row,column:Math.max(e.column-1,0)};if(n==="ArrowDown")return{row:tt(e.row+1,ce,h),column:e.column};if(n==="ArrowUp")return{row:tt(e.row-1,ce,h),column:e.column};if(n==="Home")return i.jumpToEnd?{row:ce,column:0}:{row:e.row,column:0};if(n==="End")return i.jumpToEnd?{row:Math.max(h,ce),column:u}:{row:e.row,column:u};if(n==="PageDown")return{row:tt(Math.max(e.row,0)+g,0,Math.max(h,0)),column:e.column};if(n==="PageUp")return{row:tt(Math.max(e.row,0)-g,0,Math.max(h,0)),column:e.column}}function ba(e,n){const a=n.rowCount-1,r=Math.max(n.columnCount-1,0);return{row:tt(e.row,ce,Math.max(a,ce)),column:tt(e.column,0,r)}}function gt(e,n){return e.row===n.row&&e.column===n.column}function ya(e,n,a){const r=Math.min(n,a),i=Math.max(n,a);return e.slice(r,i+1)}function kt(e,n){const a=new Set(e),r=[];for(const i of a)n.includes(i)||r.push(i);for(const i of n)a.has(i)&&r.push(i);return r}function va(e){const{ids:n,index:a,selected:r,anchor:i,modifiers:l,mode:p}=e,g=n[a];if(p==="none"||g===void 0)return{selected:[...r],anchor:i};if(p==="single")return{selected:[g],anchor:g};const h=i===void 0?-1:n.indexOf(i);if(l.extend&&h!==-1){const u=ya(n,h,a);return{selected:l.toggle?kt([...r,...u],n):u,anchor:i}}if(l.toggle){const u=new Set(r);return u.has(g)?u.delete(g):u.add(g),{selected:kt(u,n),anchor:g}}return{selected:[g],anchor:g}}function wa(e,n,a){return a!=="multiple"?{selected:[...n],anchor:void 0}:{selected:kt([...n,...e],e),anchor:e[0]}}function bn(e,n){return e==null?"":typeof e=="string"?e:typeof e=="number"?Number.isFinite(e)?n.number.format(e):"":typeof e=="boolean"?e?n.yes:n.no:Number.isNaN(e.getTime())?"":n.date.format(e)}function yn(e){return e==null?!0:typeof e=="number"?!Number.isFinite(e):e instanceof Date&&Number.isNaN(e.getTime())}function Ia(e,n,a){const r=yn(e),i=yn(n);return r||i?r&&i?0:r?-1:1:typeof e=="number"&&typeof n=="number"?e-n:typeof e=="boolean"&&typeof n=="boolean"?e===n?0:e?1:-1:e instanceof Date&&n instanceof Date?e.getTime()-n.getTime():a.compare(String(e),String(n))}const Ea=pe.tableFeatures({columnFilteringFeature:pe.columnFilteringFeature,columnOrderingFeature:pe.columnOrderingFeature,columnVisibilityFeature:pe.columnVisibilityFeature,filteredRowModel:pe.createFilteredRowModel(),globalFilteringFeature:pe.globalFilteringFeature,rowSelectionFeature:pe.rowSelectionFeature,rowSortingFeature:pe.rowSortingFeature,sortedRowModel:pe.createSortedRowModel()}),Sa=320,Ca=8,Ta=12,Ra=1.2,Pa="var(--mantine-primary-color-light)",vn="mantine-focus-auto",Rt=[],Aa=[];function wn(e){return e==="asc"?"ascending":e==="desc"?"descending":"none"}function ja(e,n,a){return Math.min(Math.max(e,n),a)}function La(e,n){const{data:a,columns:r,getRowId:i,label:l,labelledBy:p,labels:g,height:h=Sa,rowHeight:u=d.DATA_PITCH,headerHeight:f=d.CONTROL_HEIGHT,overscan:x=Ca,selectionMode:b="multiple",selectedIds:T,defaultSelectedIds:C,onSelectionChange:S,sorting:E,defaultSorting:L,onSortingChange:R,hiddenColumns:I,defaultHiddenColumns:P,onHiddenColumnsChange:O,columnOrder:j,defaultColumnOrder:D,onColumnOrderChange:N,filter:z,defaultFilter:B,onFilterChange:$,searchable:A=!1,onRowClick:k,onRowDoubleClick:v,onRowContextMenu:y,onFocus:_,onBlur:M,empty:X}=e,K=xa(g),de=Ae(),F=ze(),q=Xe(),W=Wn({numeric:!0,sensitivity:"variant"}),je=s.useMemo(()=>new Intl.DateTimeFormat(F),[F]),Le=s.useMemo(()=>({number:q,date:je,yes:K.yes,no:K.no}),[q,je,K.yes,K.no]),[re,ye]=Y.useUncontrolled({value:T,defaultValue:C,finalValue:Rt,onChange:(c,w)=>{S==null||S([...c],w)}}),[ve,Z]=Y.useUncontrolled({value:E,defaultValue:L,finalValue:Aa,onChange:(c,w)=>{R==null||R([...c],w)}}),[ue,Be]=Y.useUncontrolled({value:I,defaultValue:P,finalValue:Rt,onChange:(c,w)=>{O==null||O([...c],w)}}),[Oe,Ke]=Y.useUncontrolled({value:j,defaultValue:D,finalValue:Rt,onChange:(c,w)=>{N==null||N([...c],w)}}),[Fe,ie]=Y.useUncontrolled({value:z,defaultValue:B,finalValue:"",onChange:(c,w)=>{$==null||$(c,w)}}),ge=s.useMemo(()=>{const c=new Map;for(const w of r)c.set(w.id,w);return c},[r]),we=JSON.stringify(ue),Ee=s.useMemo(()=>{const c=new Set(ue);return r.filter(w=>(w.filterable??!0)&&!c.has(w.id)).map(w=>w.id)},[r,we]),He=s.useMemo(()=>{const c=Fe.trim();if(c!=="")return{query:c.toLocaleLowerCase(F),columnIds:Ee}},[Fe,F,Ee]),_e=s.useMemo(()=>[...a],[a]),Ve=s.useMemo(()=>r.map(c=>({id:c.id,accessorFn:w=>c.value(w),enableSorting:c.sortable??!0,enableHiding:c.hideable??!0,enableGlobalFilter:c.filterable??!0,sortDescFirst:c.descendingFirst,sortFn:(w,H)=>Ia(c.value(w.original),c.value(H.original),W)})),[r,W]),qe=JSON.stringify(ve),Ze=s.useMemo(()=>ve.map(c=>({id:c.id,desc:c.desc})),[qe]),Ue=s.useMemo(()=>{const c={};for(const w of ue)c[w]=!1;return c},[ue]),Se=s.useMemo(()=>{const c={};for(const w of re)c[w]=!0;return c},[re]),$e=s.useMemo(()=>[...Oe],[Oe]),xe=s.useRef(void 0),V=pe.useTable({features:Ea,data:_e,columns:Ve,getRowId:i,enableRowSelection:b!=="none",enableMultiRowSelection:b==="multiple",getColumnCanGlobalFilter:()=>!0,globalFilterFn:(c,w,H)=>{const U=H;if(U===void 0||!U.columnIds.includes(w))return!1;const J=ge.get(w);return J===void 0?!1:bn(J.value(c.original),Le).toLocaleLowerCase(F).includes(U.query)},state:{sorting:Ze,columnVisibility:Ue,columnOrder:$e,rowSelection:Se,globalFilter:He},onSortingChange:c=>{const w=pe.functionalUpdate(c,Ze);Z(w.map(H=>({id:H.id,desc:H.desc})),xe.current)},onColumnVisibilityChange:c=>{const w=pe.functionalUpdate(c,Ue);Be(Object.keys(w).filter(H=>!w[H]))},onColumnOrderChange:c=>{Ke(pe.functionalUpdate(c,$e))},onRowSelectionChange:c=>{ye(Object.keys(pe.functionalUpdate(c,Se)))}}),{rows:Q}=V.getRowModel(),ee=V.getVisibleLeafColumns(),te=Q.length,le=ee.length,me=s.useMemo(()=>Q.map(c=>c.id),[Q]),G=s.useRef(null),ne=s.useRef(null),Ie=So.useVirtualizer({count:te,getScrollElement:()=>G.current,estimateSize:()=>u,getItemKey:c=>me[c]??c,overscan:x}),[it,Ne]=s.useState({row:ce,column:0}),ae=s.useMemo(()=>ba(it,{rowCount:te,columnCount:le}),[it,te,le]),Je=s.useRef(!1),De=s.useRef(void 0),mo=c=>{c.row>=0&&Ie.scrollToIndex(c.row),Je.current=!0,Ne(w=>gt(w,c)?w:c)};s.useLayoutEffect(()=>{var H;if(!Je.current)return;const c=`[data-grid-row="${ae.row}"][data-grid-column="${ae.column}"]`,w=(H=ne.current)==null?void 0:H.querySelector(c);w instanceof HTMLElement&&(Je.current=!1,w.focus())});const qt=(c,w)=>{De.current=c.anchor,!(c.selected.length===re.length&&c.selected.every((U,J)=>U===re[J]))&&ye(c.selected,w)},lt=(c,w,H)=>{qt(va({ids:me,index:c,selected:re,anchor:De.current,modifiers:w,mode:b}),H)},Zt=(c,w,H)=>{const U=Q[c];U!==void 0&&(k==null||k(U.original,w,H))},bo=(c,w)=>{c.getCanSort()&&(xe.current=w,c.toggleSorting(void 0,w.shiftKey&&c.getCanMultiSort()),xe.current=void 0)},yo=()=>{var H;const c=((H=G.current)==null?void 0:H.clientHeight)??0,w=Math.floor((c===0?u*10:c)/u);return Math.max(1,w-1)},vo=c=>{const w=b==="multiple",H=c.ctrlKey||c.metaKey;if(w&&H&&(c.key==="a"||c.key==="A")){c.preventDefault(),qt(wa(me,re,b),c);return}if(ae.row>=0&&(c.key===" "||c.key==="Enter")){c.preventDefault(),c.key===" "?lt(ae.row,{extend:c.shiftKey,toggle:!c.shiftKey},c):(lt(ae.row,{extend:!1,toggle:!1},c),Zt(ae.row,c,{source:"keyboard"}));return}const U=ma(ae,c.key,{rowCount:te,columnCount:le,pageSize:yo()},de,{jumpToEnd:H});U!==void 0&&(c.preventDefault(),mo(U),w&&c.shiftKey&&U.row>=0&&U.row!==ae.row&&lt(U.row,{extend:!0,toggle:!1},c))};s.useImperativeHandle(n,()=>({scrollToRow:c=>{c>=0&&c<te&&Ie.scrollToIndex(c)},setColumnHidden:(c,w)=>{var H;(H=V.getColumn(c))==null||H.toggleVisibility(!w)},moveColumn:(c,w)=>{const H=V.getAllLeafColumns().map(J=>J.id),U=H.indexOf(c);U!==-1&&(H.splice(U,1),H.splice(ja(w,0,H.length),0,c),V.setColumnOrder(H))},clearSelection:()=>{De.current=void 0,ye([])}}),[V,Ie,te,ye]);const wo=ee.reduce((c,w)=>{var H;return c+(((H=ge.get(w.id))==null?void 0:H.width)??d.FIELD)},0),Jt=(c,w)=>{const H=(c==null?void 0:c.width)??d.FIELD;return{flex:w===le-1?`1 1 ${String(H)}px`:`0 0 ${String(H)}px`,minWidth:0,boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:(c==null?void 0:c.align)==="end"?"flex-end":"flex-start",paddingInline:d.GUTTER,outlineOffset:-2,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ct=b!=="none",Qt=K.rowsShown(q.format(te),q.format(a.length)),Io=()=>X!==void 0?X:a.length===0?K.noRows:K.noMatchingRows;return t.jsxs(o.Box,{"data-testid":"data-table",dir:fe(de)?"rtl":void 0,onFocus:_,onBlur:M,style:{display:"flex",flexDirection:"column",gap:d.TRAIL_GAP,width:"100%",color:m.VALUE},children:[A&&t.jsxs(o.Box,{style:{display:"flex",alignItems:"center",gap:d.GUTTER},children:[t.jsx(o.TextInput,{"data-testid":"data-table-search",size:"xs",type:"search","aria-label":K.search,placeholder:K.searchPlaceholder,value:Fe,onChange:c=>{ie(c.currentTarget.value,c)},rightSection:Fe===""?void 0:t.jsx(o.ActionIcon,{"data-testid":"data-table-search-clear",variant:"subtle",size:d.CONTROL_HEIGHT,"aria-label":K.clearSearch,onClick:c=>{ie("",c)},children:t.jsx(oe,{name:"close",size:d.CHEVRON})}),rightSectionPointerEvents:"all",style:{flex:"1 1 auto",minWidth:0}}),t.jsx(o.Box,{component:"span","data-testid":"data-table-count","aria-hidden":"true",dir:"auto",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:m.CHROME},children:Qt})]}),t.jsxs(o.VisuallyHidden,{role:"status","aria-live":"polite",dir:"auto","data-testid":"data-table-status",children:[Qt,ct&&re.length>0?` ${K.rowsSelected(q.format(re.length))}`:""]}),t.jsxs(o.Box,{ref:G,"data-testid":"data-table-viewport",style:{height:h,overflow:"auto",position:"relative",border:`1px solid ${m.BORDER}`,borderRadius:"var(--mantine-radius-sm)",background:m.PANEL},children:[t.jsxs(o.Table,{ref:ne,role:"grid","aria-label":p===void 0&&l===void 0?K.dataTable:l,"aria-labelledby":p,"aria-rowcount":te+1,"aria-colcount":le,"aria-multiselectable":b==="multiple"?!0:void 0,onKeyDown:vo,stickyHeader:!0,tabularNums:!0,withRowBorders:!1,horizontalSpacing:0,verticalSpacing:0,highlightOnHover:ct,highlightOnHoverColor:m.SURFACE,style:{display:"grid",width:"100%",minWidth:wo,fontSize:Ta,lineHeight:Ra},children:[t.jsx(o.Table.Thead,{style:{display:"grid",position:"sticky",insetBlockStart:0,zIndex:1,background:m.PANEL,borderBlockEnd:`1px solid ${m.DIVIDER}`},children:t.jsx(o.Table.Tr,{role:"row","aria-rowindex":1,style:{display:"flex",width:"100%",height:f},children:ee.map((c,w)=>{const H=ge.get(c.id),U=c.getCanSort(),J=c.getIsSorted(),he=ae.row===ce&&ae.column===w,dt=J===!1?-1:c.getSortIndex(),ut=he?0:-1,ot=t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{component:"span","data-testid":"data-table-header-label",dir:"auto",title:H==null?void 0:H.header,style:{flex:"0 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:J===!1?void 0:m.VALUE},children:(H==null?void 0:H.header)??c.id}),J!==!1&&t.jsx(o.Box,{component:"span","data-testid":"data-table-sort-glyph","data-direction":wn(J),"aria-hidden":"true",style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:m.VALUE,transform:J==="asc"?"rotate(180deg)":void 0},children:t.jsx(oe,{name:"chevronDown",size:d.CHEVRON})}),Ze.length>1&&dt>=0&&t.jsx(o.Box,{component:"span","data-testid":"data-table-sort-priority","aria-hidden":"true",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-xs)",color:m.CHROME},children:q.format(dt+1)})]});return t.jsx(o.Table.Th,{scope:"col","data-testid":"data-table-header","aria-colindex":w+1,"aria-sort":U?wn(J):void 0,"data-grid-row":U?void 0:ce,"data-grid-column":U?void 0:w,tabIndex:U?void 0:ut,className:U?void 0:vn,onFocus:U?void 0:()=>{Ne(Ce=>gt(Ce,{row:ce,column:w})?Ce:{row:ce,column:w})},style:{...Jt(H,w),gap:d.GUTTER/2,height:f,fontSize:"var(--mantine-font-size-sm)",fontWeight:500,color:m.CHROME,textAlign:"start"},children:U?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-table-sort-button","data-grid-row":ce,"data-grid-column":w,tabIndex:ut,onClick:Ce=>{Ne({row:ce,column:w}),bo(c,Ce)},onFocus:()=>{Ne(Ce=>gt(Ce,{row:ce,column:w})?Ce:{row:ce,column:w})},style:{display:"flex",alignItems:"center",gap:d.GUTTER/2,justifyContent:(H==null?void 0:H.align)==="end"?"flex-end":"flex-start",flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",outlineOffset:-2,cursor:"pointer"},children:ot}):ot},c.id)})})}),t.jsx(o.Table.Tbody,{style:{display:"grid",position:"relative",height:Ie.getTotalSize()},children:Ie.getVirtualItems().map(c=>{const w=Q[c.index];if(w===void 0)return null;const H=re.includes(w.id);return t.jsx(o.Table.Tr,{role:"row","data-testid":"data-table-row","data-index":c.index,"data-selected":H?"true":void 0,"aria-rowindex":c.index+2,"aria-selected":ct?H:void 0,onDoubleClick:U=>{v==null||v(w.original,U)},onContextMenu:U=>{y==null||y(w.original,U)},style:{display:"flex",position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:u,transform:`translateY(${String(c.start)}px)`,background:H?Pa:void 0,cursor:ct?"pointer":void 0},children:ee.map((U,J)=>{const he=ge.get(U.id),dt=ae.row===c.index&&ae.column===J,ut=he==null?void 0:he.value(w.original),ot=bn(ut,Le),Ce=(he==null?void 0:he.cell)===void 0?t.jsx(o.Box,{component:"span",dir:"auto",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ot}):he.cell(w.original);return t.jsx(o.Table.Td,{role:"gridcell","data-testid":"data-table-cell","aria-colindex":J+1,"data-grid-row":c.index,"data-grid-column":J,tabIndex:dt?0:-1,className:vn,title:(he==null?void 0:he.cell)===void 0?ot:void 0,onFocus:()=>{Ne(Te=>gt(Te,{row:c.index,column:J})?Te:{row:c.index,column:J})},onClick:Te=>{Ne({row:c.index,column:J}),lt(c.index,{extend:Te.shiftKey,toggle:Te.metaKey||Te.ctrlKey},Te),Zt(c.index,Te,nt(Te))},style:Jt(he,J),children:Ce},U.id)})},w.id)})})]}),te===0&&t.jsx(o.Box,{"data-testid":"data-table-empty",style:{display:"flex",alignItems:"center",justifyContent:"center",padding:d.PAD_LEFT,fontSize:"var(--mantine-font-size-sm)",color:m.CHROME},children:Io()})]})]})}const Oa=s.forwardRef(La);function Ha(){return crypto.randomUUID().slice(0,8)}function bt(e,n){return{id:Ha(),offset:e,color:n}}function oo(){return[bt(0,"#6366F1"),bt(1,"#06B6D4")]}const _a=2,Na=5,Da=80,ka=0,Pt=100,At=0,Ma=360,Ga=[0,90,180,270,360];function za({stops:e,defaultStops:n,direction:a,defaultDirection:r=At,showDirection:i=!0,onChange:l,onChangeStart:p,onChangeEnd:g,minStops:h=_a,maxStops:u=Na}){const f=se(),x=Xe({maximumFractionDigits:0}),b=s.useId(),T=s.useId(),C=s.useMemo(()=>oo(),[]),[S,E]=Y.useUncontrolled({value:e,defaultValue:n,finalValue:C,onChange:(A,k)=>{l==null||l(A,L,k)}}),[L,R]=Y.useUncontrolled({value:a,defaultValue:r,finalValue:At,onChange:(A,k)=>{l==null||l(S,A,k)}}),I=s.useRef(!1),P=A=>{I.current||(I.current=!0,p==null||p(A))},O=(A,k)=>{I.current=!1,g==null||g(A,k)},j=(A,k)=>S.map((v,y)=>y===A?{...v,color:k}:v),D=(A,k)=>S.map((v,y)=>y===A?{...v,offset:k/Pt}:v),N=A=>{if(S.length>=u)return;const k=S[S.length-1],v=k===void 0?.5:(k.offset+1)/2,y=[...S,bt(v,mt)];y.sort((_,M)=>_.offset-M.offset),E(y,A)},z=(A,k)=>{S.length<=h||E(S.filter((v,y)=>y!==A),k)},B=S.length>=u,$=S.length<=h;return t.jsxs(o.Stack,{"data-testid":"gradient-editor",gap:"xs",children:[t.jsxs(o.Group,{justify:"space-between",align:"center",children:[t.jsx(o.Text,{id:b,"data-testid":"gradient-editor-heading",size:"xs",c:m.CHROME,children:f.colorStops}),t.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:d.TRAIL,"data-testid":"gradient-editor-add-stop",onClick:N,disabled:B,"aria-label":f.addColorStop,children:t.jsx(oe,{name:"plus",size:d.CHEVRON})})]}),t.jsx(o.Stack,{"data-testid":"gradient-editor-stops",gap:"xs",role:"group","aria-labelledby":b,children:S.map((A,k)=>{const v=x.format(k+1);return t.jsxs(o.Group,{"data-testid":"gradient-editor-stop",gap:"xs",align:"flex-end",wrap:"nowrap",children:[t.jsx(eo,{color:A.color,defaultColor:mt,onColorChange:(y,_)=>{E(j(k,y??mt),_)},showOpacity:!1}),t.jsx(o.Box,{style:{width:Da},children:t.jsx(o.Slider,{"data-testid":"gradient-editor-stop-position",min:ka,max:Pt,value:A.offset*Pt,onPointerDown:P,onChange:y=>{P(),E(D(k,y))},onChangeEnd:y=>{O(D(k,y),L)},label:y=>f.percent(x.format(y)),thumbLabel:f.colorStopPosition(v)})}),t.jsx(o.ActionIcon,{variant:"subtle",color:"gray",size:d.TRAIL,onClick:y=>{z(k,y)},"data-testid":"gradient-editor-remove-stop",disabled:$,"aria-label":f.removeColorStop(v),children:t.jsx(oe,{name:"minus",size:d.CHEVRON})})]},A.id)})}),i&&t.jsxs(o.Box,{"data-testid":"gradient-editor-direction",pb:"md",role:"group","aria-labelledby":T,children:[t.jsx(o.Text,{id:T,"data-testid":"gradient-editor-direction-heading",size:"xs",c:m.CHROME,mb:4,children:f.direction}),t.jsx(o.Slider,{"data-testid":"gradient-editor-direction-slider",min:At,max:Ma,value:L,onPointerDown:P,onChange:A=>{P(),R(A)},onChangeEnd:A=>{O(S,A)},label:A=>f.degrees(x.format(A)),thumbLabel:f.gradientDirection,marks:Ga.map(A=>({value:A,label:f.degrees(x.format(A))}))})]})]})}const Ba=4,Fa=2,Va=1.1;function Ua(){const e=ze();return s.useMemo(()=>{var a;return((a=new Intl.NumberFormat(e).formatToParts(Va).find(r=>r.type==="decimal"))==null?void 0:a.value)??"."},[e])}function $a({label:e,value:n,defaultValue:a,onChange:r,min:i,max:l,step:p,decimalScale:g,suffix:h,hideControls:u=!0,disabled:f=!1,onFocus:x,onBlur:b}){const T=se(),C=zt(),S=Ua(),[E,L]=Y.useUncontrolled({value:n,defaultValue:void 0,finalValue:void 0,onChange:r}),R=E===void 0,I=E??a,[P,O]=s.useState(I),j=s.useRef(!1);s.useEffect(()=>{j.current||O(E??a),j.current=!1},[E,a]);const D=B=>{j.current=!0,O(B)},N=B=>{const $=typeof P=="string"?C(P):P;if(Number.isNaN($)){O(E??a),b==null||b(B);return}let A=$;i!==void 0&&A<i&&(A=i),l!==void 0&&A>l&&(A=l),A!==E&&L(A,B),O(A),b==null||b(B)},z=B=>{L(void 0,B)};return t.jsxs(o.Group,{"data-testid":"style-number-input",gap:Ba,wrap:"nowrap",align:"flex-end",children:[t.jsx(o.NumberInput,{"data-testid":"style-number-input-field",label:e,value:P,onChange:D,onFocus:x,onBlur:N,min:i,max:l,step:p,decimalScale:g,decimalSeparator:S,suffix:h,hideControls:u,disabled:f,"data-is-default":R?"true":"false",styles:{input:R?{fontStyle:"italic",color:m.CHROME}:void 0},style:{flex:1}}),!R&&t.jsx(o.ActionIcon,{variant:"subtle",size:d.TRAIL,c:m.CHROME,"data-testid":"style-number-input-reset",disabled:f,"aria-label":T.resetToDefault(e),onClick:z,style:{marginBlockEnd:Fa},children:t.jsx(oe,{name:"reset",size:d.CHEVRON})})]})}const Wa=4,Ya=2;function Xa({label:e,value:n,defaultValue:a,options:r,onChange:i,disabled:l=!1,onFocus:p,onBlur:g}){const h=se(),[u,f]=Y.useUncontrolled({value:n,defaultValue:void 0,finalValue:void 0,onChange:i}),x=u===void 0,b=u??a,T=S=>{S!==null&&f(S)},C=S=>{f(void 0,S)};return t.jsxs(o.Group,{"data-testid":"style-select",gap:Wa,wrap:"nowrap",align:"flex-end",children:[t.jsx(o.Select,{"data-testid":"style-select-field",label:e,value:b,onChange:T,onFocus:p,onBlur:g,data:r,rightSection:t.jsx(oe,{name:"chevronDown",size:d.GLYPH}),rightSectionPointerEvents:"none",disabled:l,"data-is-default":x?"true":"false",allowDeselect:!1,styles:{input:x?{fontStyle:"italic",color:m.CHROME}:void 0},style:{flex:1}}),!x&&t.jsx(o.ActionIcon,{variant:"subtle",size:d.TRAIL,c:m.CHROME,"data-testid":"style-select-reset",disabled:l,"aria-label":h.resetToDefault(e),onClick:C,style:{marginBlockEnd:Ya},children:t.jsx(oe,{name:"reset",size:d.CHEVRON})})]})}const jt=4,Ka=`${String(d.TOGGLE_PITCH)}px`;function qa({label:e,checked:n,defaultChecked:a,onChange:r,disabled:i=!1,onFocus:l,onBlur:p,children:g}){const h=s.useId(),[u,f]=Y.useUncontrolled({value:n,defaultValue:a,finalValue:!1,onChange:r}),x=T=>{f(T.currentTarget.checked,T)},b={root:{minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:d.TOGGLE_PITCH,paddingInlineStart:jt,fontSize:"var(--mantine-font-size-sm)",lineHeight:Ka,color:i?m.DISABLED:m.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}};return t.jsxs(o.Box,{"data-testid":"toggle-with-content","data-checked":u?"true":"false","data-disabled":i?"true":void 0,style:{display:"flex",flexDirection:"column",gap:jt},children:[t.jsx(o.Checkbox,{"data-testid":"toggle-with-content-checkbox",label:e,checked:u,disabled:i,"aria-expanded":u,"aria-controls":u?h:void 0,onChange:x,onFocus:l,onBlur:p,wrapperProps:{title:e},styles:b}),u&&t.jsx(o.Box,{id:h,"data-testid":"toggle-with-content-children",style:{display:"flex",flexDirection:"column",gap:jt,paddingInlineStart:d.GUTTER},children:g})]})}function ro(e,n){return e!==void 0?e:n===void 0?"off":"polite"}function Ge(e,n){const a=ro(e,n);return a==="off"?{"aria-busy":n}:{"aria-live":a,"aria-atomic":!0,"aria-busy":n}}const Lt=4,Za="(hover: none)";function Ja(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e)}function Qa(e){const{state:n,stateTitle:a,busy:r,live:i,actions:l,residentActions:p,actionsVisible:g,disabled:h=!1,onClick:u,onFocus:f,onBlur:x}=e,b=Ge(i,r),{hovered:T,ref:C}=Y.useHover(),S=Y.useMediaQuery(Za)??!1,[E,L]=s.useState(!1),R=s.useId(),I=E||(g??(T||S)),P=l!==void 0||p!==void 0,O=Ja(n),j=a!==void 0&&a!==O,D=a??O,N=P&&n!==void 0,z=j?t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:n}),t.jsx(o.VisuallyHidden,{"data-testid":"action-row-state-full",children:a})]}):n;Pe(u!==void 0&&n===void 0?"ActionRow was given onClick but no state, and its own activation is carried by the text it reports. That text is also what names the row for a screen reader, so a row with nothing to report has nothing to activate. Give the row a state, or put the action on a control in actions.":void 0);const B=y=>{L(!0),f==null||f(y)},$=y=>{y.currentTarget.contains(y.relatedTarget)||L(!1),x==null||x(y)},A=y=>{h||u==null||u(y,nt(y))},k={flex:"1 1 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:h?m.DISABLED:m.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},v={...k,alignSelf:"stretch",lineHeight:`${d.ROW_PITCH}px`,textAlign:"start",borderRadius:"var(--mantine-radius-sm)"};return t.jsxs(o.Box,{ref:C,"data-testid":"action-row",role:N?"group":void 0,"aria-labelledby":N?R:void 0,"aria-disabled":h||void 0,"data-disabled":h||void 0,onFocus:B,onBlur:$,style:{display:"flex",alignItems:"center",justifyContent:"space-between",boxSizing:"border-box",gap:d.TRAIL_GAP,height:d.ROW_PITCH},children:[n!==void 0&&(u===void 0?t.jsx(o.Box,{component:"span",id:R,"data-testid":"action-row-state",title:D,...b,style:k,children:z}):t.jsx(o.UnstyledButton,{type:"button",id:R,"data-testid":"action-row-state",title:D,...b,onClick:A,style:v,children:z})),P&&t.jsxs(o.Box,{"data-testid":"action-row-affordances",style:{flex:"0 0 auto",marginInlineStart:"auto",display:"flex",alignItems:"center",gap:Lt},children:[l!==void 0&&t.jsx(o.Box,{"data-testid":"action-row-actions","data-visible":I?"true":"false",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Lt,opacity:I?1:0,pointerEvents:I?void 0:"none"},children:l}),p!==void 0&&t.jsx(o.Box,{"data-testid":"action-row-resident-actions",style:{flex:"0 0 auto",display:"flex",alignItems:"center",gap:Lt},children:p})]})]})}const ao=d.GUTTER,es=12,so=1.2,ts=20,ns=500,os="var(--mantine-primary-color-light)";function rs({name:e,value:n,icon:a,selected:r=!1,role:i="button",tabIndex:l,onClick:p,onDoubleClick:g,onContextMenu:h,onFocus:u,onBlur:f,trailing:x}){const{hovered:b,ref:T}=Y.useHover(),C=p!==void 0,S=a!=null,E=n!=null,L=at(x),R=i==="option",I=R?r:void 0,P=!R&&r?!0:void 0,O=z=>{p==null||p(z,nt(z))};let j="transparent";r?j=os:C&&b&&(j=m.SURFACE);const D=t.jsxs(t.Fragment,{children:[S&&t.jsx(o.Box,{component:"span","data-testid":"data-row-icon",style:{flex:"0 0 auto",width:d.GLYPH_SLOT,height:d.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:m.CHROME},children:a}),t.jsx(o.Box,{component:"span","data-testid":"data-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),E&&t.jsx(o.Box,{component:"span","data-testid":"data-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",color:m.CHROME},children:n})]}),N={display:"flex",alignItems:"center",gap:d.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:C?"pointer":"default"};return t.jsxs(o.Box,{ref:T,"data-testid":"data-row","data-selected":r?"true":void 0,onDoubleClick:g,onContextMenu:h,style:{display:"flex",alignItems:"center",gap:d.TRAIL_GAP,boxSizing:"border-box",width:"100%",height:d.DATA_PITCH,paddingInline:ao,borderRadius:"var(--mantine-radius-sm)",background:j,color:m.VALUE,fontSize:es,lineHeight:so},children:[C?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-button",role:R?"option":void 0,"aria-current":P,"aria-selected":I,tabIndex:l,onClick:O,onFocus:u,onBlur:f,style:N,children:D}):t.jsx(o.Box,{"data-testid":"data-row-body",role:R?"option":void 0,"aria-current":P,"aria-selected":I,tabIndex:l,onFocus:u,onBlur:f,style:N,children:D}),L&&t.jsx(be,{children:x})]})}function as({label:e,unit:n,sortDirection:a,defaultSortDirection:r,onSortChange:i,sortPriority:l}){const[p,g]=Y.useUncontrolled({value:a,defaultValue:r,finalValue:"none",onChange:i}),h=Xe(),u=i!==void 0,f=p!=="none",x=C=>{g(p==="ascending"?"descending":"ascending",C)},b=t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{component:"span","data-testid":"data-row-header-label",title:e,style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:f?m.VALUE:void 0},children:e}),n!==void 0&&t.jsx(o.Box,{component:"span","data-testid":"data-row-header-unit",style:{flex:"0 0 auto",whiteSpace:"nowrap"},children:n}),l!==void 0&&f&&t.jsx(o.Box,{component:"span","aria-hidden":"true",style:{flex:"0 0 auto",display:"flex"},children:t.jsx(Kt,{children:h.format(l)})}),f&&t.jsx(o.Box,{component:"span","data-testid":"data-row-header-sort-glyph","data-direction":p,style:{flex:"0 0 auto",display:"flex",alignItems:"center",color:m.VALUE,transform:p==="ascending"?"rotate(180deg)":void 0},children:t.jsx(oe,{name:"chevronDown",size:d.CHEVRON})})]}),T=u||f;return t.jsx(o.Box,{"data-testid":"data-row-header",role:T?"columnheader":void 0,"aria-sort":T?p:void 0,style:{display:"flex",alignItems:"center",gap:d.GUTTER,boxSizing:"border-box",width:"100%",height:ts,paddingInline:ao,fontSize:"var(--mantine-font-size-sm)",lineHeight:so,color:m.CHROME},children:u?t.jsx(o.UnstyledButton,{type:"button","data-testid":"data-row-header-sort",onClick:x,style:{display:"flex",alignItems:"center",gap:d.GUTTER,flex:"1 1 auto",minWidth:0,height:"100%",background:"transparent",color:"inherit",font:"inherit",textAlign:"start",cursor:"pointer"},children:b}):b})}function Kt({children:e}){return t.jsx(o.Badge,{component:"span","data-testid":"rank-chip",style:{flex:"0 0 auto",background:m.RAISED,color:m.VALUE,fontWeight:ns,textTransform:"none",letterSpacing:"normal"},children:e})}const In=2,ss=1,is=13,ls=2,cs=1,ds=1,us=64,io=4,En=io/2,lo=4,ps=12,Ye=100,fs=1.5,Mt=100;function yt({children:e,end:n,id:a}){return t.jsx(o.Box,{component:"span",id:a,"data-testid":`chart-axis-${n}`,style:{flex:"0 0 auto",minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:m.CHROME,whiteSpace:"nowrap"},children:e})}function co(){return t.jsx(o.Box,{"data-testid":"chart-baseline",style:{flex:"0 0 auto",height:ss,background:m.BORDER}})}function uo({caption:e,rows:n,testId:a}){return t.jsxs(o.VisuallyHidden,{component:"table","data-testid":a,children:[e!==void 0&&t.jsx("caption",{children:e}),t.jsx("tbody",{children:n.map(r=>t.jsxs("tr",{children:[t.jsx("th",{scope:"row",children:r.header}),t.jsx("td",{children:r.value})]},r.id))})]})}function hs(e,n){if(e.length===0)return null;const a=Ye/2;if(e.length===1)return`0,${a} ${Ye},${a}`;const r=Math.min(...e),l=Math.max(...e)-r,p=e.length-1;return e.map((g,h)=>{const u=Gr(h/p,Ye,n),f=l===0?a:Ye-(g-r)/l*Ye;return`${u},${f}`}).join(" ")}function po(){const e=s.useId(),n=`${e}min`,a=`${e}max`;return{min:n,max:a,describedBy:`${n} ${a}`}}function gs({bins:e,label:n,minLabel:a,maxLabel:r,busy:i,live:l,trailing:p}){const g=Xe(),h=po(),u=e.reduce((x,b)=>Math.max(x,b.count,0),0),f=e.map((x,b)=>({id:`${x.label}-${String(b)}`,header:x.label,value:g.format(x.count)}));return t.jsxs(o.Box,{"data-testid":"histogram-row","aria-busy":i,style:{display:"flex",alignItems:"flex-start",gap:d.TRAIL_GAP,height:d.HISTOGRAM_HEIGHT},children:[t.jsxs(o.Box,{"data-testid":"histogram-chart",...Ge(l,i),style:{flex:"1 1 auto",minWidth:0,height:"100%",display:"flex",flexDirection:"column",gap:In},children:[t.jsxs(o.Box,{"data-testid":"histogram-drawing",role:n===void 0?void 0:"img","aria-label":n,"aria-describedby":n===void 0?void 0:h.describedBy,"aria-hidden":n===void 0?!0:void 0,style:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column",gap:In},children:[t.jsx(o.Box,{"data-testid":"histogram-plot",style:{flex:"1 1 auto",minHeight:0,display:"flex",alignItems:"flex-end",gap:ls},children:e.map((x,b)=>{const T=Math.max(0,x.count),C=u===0?0:T/u*Mt,S=x.highlighted===!0;return t.jsx(o.Box,{"data-testid":"histogram-bar","data-highlighted":S?"true":"false","aria-hidden":"true",title:x.label,style:{flex:"1 1 0",minWidth:0,height:`${String(C)}%`,minHeight:T>0?ds:0,background:S?m.ACCENT:m.BORDER,borderRadius:cs}},`${x.label}-${String(b)}`)})}),t.jsx(co,{})]}),t.jsxs(o.Box,{"data-testid":"chart-axis",style:{flex:"0 0 auto",height:is,display:"flex",alignItems:"center",justifyContent:"space-between",gap:lo},children:[t.jsx(yt,{end:"min",id:h.min,children:a}),t.jsx(yt,{end:"max",id:h.max,children:r})]})]}),t.jsx(uo,{caption:n,rows:f,testId:"histogram-values"}),at(p)&&t.jsx(be,{children:p})]})}function xs({values:e,label:n,minLabel:a,maxLabel:r,busy:i,live:l,trailing:p}){const g=Ae(),h=Xe(),u=po(),f=hs(e,g),x=e.map((b,T)=>({id:`point-${String(T)}`,header:h.format(T+1),value:h.format(b)}));return t.jsxs(o.Box,{"data-testid":"sparkline-row","aria-busy":i,style:{display:"flex",alignItems:"center",gap:d.TRAIL_GAP,height:d.SPARKLINE_HEIGHT},children:[t.jsxs(o.Box,{"data-testid":"sparkline-chart",...Ge(l,i),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:lo},children:[t.jsx(yt,{end:"min",id:u.min,children:a}),t.jsxs(o.Box,{"data-testid":"sparkline-drawing",role:n===void 0?void 0:"img","aria-label":n,"aria-describedby":n===void 0?void 0:u.describedBy,"aria-hidden":n===void 0?!0:void 0,style:{flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",color:m.BORDER},children:[t.jsx(o.Box,{component:"svg","data-testid":"sparkline-plot",width:"100%",height:d.CONTROL_HEIGHT,viewBox:`0 0 ${String(Ye)} ${String(Ye)}`,preserveAspectRatio:"none",fill:"none",stroke:"currentColor",strokeWidth:fs,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",style:{display:"block",overflow:"visible"},children:f!==null&&t.jsx("polyline",{points:f,vectorEffect:"non-scaling-stroke"})}),t.jsx(co,{})]}),t.jsx(yt,{end:"max",id:u.max,children:r})]}),t.jsx(uo,{caption:n,rows:x,testId:"sparkline-values"}),at(p)&&t.jsx(be,{children:p})]})}function ms({name:e,percentile:n,value:a,rank:r,busy:i,live:l,onClick:p,onDoubleClick:g,onContextMenu:h,onFocus:u,onBlur:f}){const x=se(),b=$n(),T=s.useId(),C=p,S=C!==void 0,E=Math.min(Mt,Math.max(0,n)),L=x.percentile(b(Math.round(E))),R=P=>{C!==void 0&&C(P,nt(P))},I=P=>{C!==void 0&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),C(P,nt(P)))};return t.jsxs(o.Box,{"data-testid":"metric-row",role:S?"button":void 0,tabIndex:S?0:void 0,...Ge(l,i),onClick:R,onKeyDown:I,onDoubleClick:g,onContextMenu:h,onFocus:u,onBlur:f,style:{display:"flex",alignItems:"center",gap:d.GUTTER,height:d.ROW_PITCH,cursor:S?"pointer":"default"},children:[t.jsx(o.Box,{component:"span",id:T,"data-testid":"metric-row-name",title:e,style:{flex:"1 1 auto",minWidth:0,fontSize:ps,lineHeight:1.2,color:m.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),t.jsx(o.Progress.Root,{"data-testid":"metric-row-bar",role:"progressbar","aria-labelledby":T,"aria-valuemin":0,"aria-valuemax":Mt,"aria-valuenow":E,"aria-valuetext":L,title:L,size:io,style:{flex:`0 0 ${String(us)}px`,borderRadius:En,background:m.SURFACE},children:t.jsx(o.Progress.Section,{"data-testid":"metric-row-fill",value:E,withAria:!1,color:m.ACCENT,style:{borderRadius:En}})}),t.jsx(o.Box,{component:"span","data-testid":"metric-row-value",style:{flex:"0 0 auto",fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:m.VALUE},children:a}),r!==void 0&&t.jsx(Kt,{children:r})]})}const fo=s.createContext(!1);function ho({showLabels:e=!1,children:n}){return t.jsx(fo.Provider,{value:e,children:n})}function st(){return s.useContext(fo)}const bs=d.VALUE_INSET-d.GLYPH_SLOT,ys=2,vs=1,ws=2,Is=3;function Es(e){if(e.fullValue!==void 0)return e.fullValue;if(typeof e.value=="string")return e.value;if(typeof e.value=="number")return String(e.value)}function Ss({segment:e,grow:n,index:a}){const{glyph:r,value:i,unit:l,mono:p=!1}=e;let g=null;Bt(r)?g=t.jsx(rt,{name:r}):Ft(r)?g=t.jsx(o.Box,{component:"span","data-letter":r,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:r}):r!=null&&(g=r);const h=Es(e),u=e.fullValue!==void 0;return t.jsxs(o.Box,{"data-testid":"compound-segment","data-segment-index":a,"data-grow":n?"true":"false",style:{display:"flex",alignItems:"center",boxSizing:"border-box",flex:n?"1 1 auto":"0 0 auto",minWidth:0,height:d.CONTROL_HEIGHT,paddingBlock:0,paddingInline:bs},children:[g!==null&&t.jsx(o.Box,{"data-testid":"compound-segment-slot",style:{flex:"0 0 auto",width:d.GLYPH_SLOT,height:d.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:m.CHROME},children:g}),t.jsx(o.Box,{component:"span","data-testid":"compound-segment-value","data-mono":p?"true":"false",title:h,"aria-hidden":u?!0:void 0,style:{flex:n?"1 1 auto":"0 0 auto",minWidth:0,fontFamily:p?"var(--mantine-font-family-monospace)":void 0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:m.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",unicodeBidi:"isolate"},children:i}),u&&t.jsx(o.VisuallyHidden,{children:e.fullValue}),l!==void 0&&t.jsx(o.Box,{component:"span","data-testid":"compound-segment-unit",style:{flex:"0 0 auto",marginInlineStart:ys,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:m.CHROME},children:l})]})}function Cs(e,n){if(!(n>=ws&&n<=Is))return`CompoundRow "${e}" was given ${String(n)} ${n===1?"segment":"segments"}, and it holds two or three. A compound row shows one value together with the parts that belong to it: use PanelField for a single value, and a table or a list of rows for more than three.`}function Ts(e,n){if(n!==1)return`CompoundRow "${e}" was given ${String(n)} segments that set grow, and exactly one should. The segment that sets grow takes the box's leftover width and should be the main value, with the rest sized to their content. Using the first segment that sets it, or the leading segment when none does.`}function Rs({label:e,segments:n,width:a=d.BODY,trailing:r,busy:i,live:l,onClick:p,onFocus:g,onBlur:h}){const u=st(),f=s.useId(),x=n.filter(j=>j.grow===!0).length;Pe(Cs(e,n.length)),Pe(Ts(e,x));const b=n.findIndex(j=>j.grow===!0),T=b===-1?0:b,C=p!==void 0,S=ro(l,i)!=="off",E=C||S,L=C?void 0:f,R=E?void 0:f,I=E||u,P={display:"flex",alignItems:"center",boxSizing:"border-box",flex:u?"1 1 auto":"0 0 auto",width:u?void 0:a,minWidth:0,height:d.CONTROL_HEIGHT,background:m.SURFACE,borderRadius:"var(--mantine-radius-sm)",overflow:"hidden",textAlign:"start",cursor:C?"pointer":void 0},O=t.jsxs(t.Fragment,{children:[E&&t.jsx(o.VisuallyHidden,{id:L,children:e}),n.map((j,D)=>t.jsxs(s.Fragment,{children:[D>0&&t.jsx(o.Box,{"data-testid":"compound-row-hairline",style:{flex:"0 0 auto",width:vs,height:d.CONTROL_HEIGHT,background:m.PANEL}}),t.jsx(Ss,{segment:j,grow:D===T,index:D})]},D))]});return t.jsxs(o.Box,{"data-testid":"compound-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:d.TRAIL_GAP,height:d.ROW_PITCH},children:[u&&t.jsx(o.Box,{component:"span",id:R,"data-testid":"compound-row-label",title:e,"aria-hidden":E?!0:void 0,style:{flex:`0 0 ${d.LABEL_COLUMN}px`,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:m.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),C?t.jsx(o.UnstyledButton,{type:"button",title:e,"data-testid":"compound-row-box","data-interactive":"true",...Ge(l,i),onClick:p,onFocus:g,onBlur:h,style:P,children:O}):t.jsx(o.Box,{role:"group","aria-label":I?void 0:e,"aria-labelledby":I?f:void 0,title:e,"data-testid":"compound-row-box","data-interactive":"false",...Ge(l,i),onFocus:g,onBlur:h,style:P,children:O}),t.jsx(be,{children:r})]})}const Ot=d.VALUE_INSET-d.GLYPH_SLOT,xt=4,Sn=4,Ps=d.VALUE_INSET+d.LABEL_COLUMN,Cn={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},go=s.forwardRef(function(n,a){const{label:r,glyph:i,kind:l,value:p,defaultValue:g,onChange:h,data:u,unit:f,width:x=d.FIELD,bound:b=!1,mixed:T=!1,placeholder:C,pending:S=!1,min:E,max:L,step:R,onScrubStart:I,onScrub:P,onScrubEnd:O,onClick:j,disabled:D=!1,readOnly:N,boundDescription:z,pendingDescription:B,title:$,style:A,className:k,onKeyDown:v,...y}=n,_=st(),M=se(),X=Ae(),K=Y.useMediaQuery("(pointer: coarse)"),[de,F]=Y.useUncontrolled({value:p===null?"":p,defaultValue:g,finalValue:"",onChange:h}),q=l??(u!==void 0?"select":"text"),W=q==="select",je=q==="select"&&u!==void 0,Le=N??(h===void 0&&g===void 0),re=String(de),ye=C===!0,ve=T||ye;let Z;T?Z=M.mixed:ye?Z=re:typeof C=="string"&&(Z=C);const ue=[];T&&ue.push(M.mixed);const Be=z??M.fieldBound,Oe=B??M.fieldPending;b&&Be!==""&&ue.push(Be),S&&Oe!==""&&ue.push(Oe);const Ke=ue.length>0?ue.join(". "):void 0,ie=(I!==void 0||P!==void 0||O!==void 0)&&!D&&!K,ge=s.useRef(!1),we=s.useRef(!1),Ee=s.useRef(0),He=G=>{if(!ie||G.button!==0)return;G.preventDefault(),G.stopPropagation();const ne=G.currentTarget;typeof ne.setPointerCapture=="function"&&ne.setPointerCapture(G.pointerId),ge.current=!0,we.current=!1,Ee.current=G.clientX},_e=G=>{if(!ge.current)return;const ne=G.clientX-Ee.current;ne!==0&&(Ee.current=G.clientX,we.current||(we.current=!0,I==null||I(G)),P==null||P(fe(X)?-ne:ne,G))},Ve=G=>{ge.current&&(ge.current=!1,we.current&&(we.current=!1,O==null||O(G)))},qe=G=>{D||j==null||j(G)},Ze=G=>{v==null||v(G),!(j===void 0||D||G.defaultPrevented)&&(je||(G.key==="Enter"||G.key===" "&&Le)&&(G.preventDefault(),j(G)))},Ue=(G,ne)=>{F(G,ne)};let Se=null;Bt(i)?Se=t.jsx(rt,{name:i,filled:b}):Ft(i)?Se=t.jsx(o.Box,{component:"span","data-letter":i,style:{fontSize:"var(--mantine-font-size-sm)",lineHeight:1},children:i}):i!=null&&(Se=i);const $e=t.jsxs(t.Fragment,{children:[t.jsxs(o.Box,{"data-testid":"panel-field-slot","data-scrub":ie?"true":void 0,onPointerDown:ie?He:void 0,onPointerMove:ie?_e:void 0,onPointerUp:ie?Ve:void 0,onPointerCancel:ie?Ve:void 0,onLostPointerCapture:ie?Ve:void 0,style:{position:"relative",flex:"0 0 auto",width:d.GLYPH_SLOT,height:d.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:m.CHROME,cursor:ie?"ew-resize":void 0,touchAction:ie?"none":void 0},children:[Se,S&&t.jsx(o.Box,{"data-testid":"panel-field-pending",style:{position:"absolute",insetInlineStart:0,bottom:0,width:Sn,height:Sn,background:m.ACCENT}})]}),_&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-label","aria-hidden":"true",style:{flex:"1 1 auto",minWidth:0,marginInlineStart:xt,fontSize:"var(--mantine-font-size-sm)",lineHeight:1,color:m.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r})]}),xe=f!==void 0,V=xe||W?t.jsxs(t.Fragment,{children:[xe&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-unit",style:{flex:"0 0 auto",lineHeight:1},children:f}),W&&t.jsx(o.Box,{component:"span","data-testid":"panel-field-chevron",style:{flex:"0 0 auto",display:"flex",alignItems:"center",marginInlineStart:xe?xt:0},children:t.jsx(oe,{name:"chevronDown",size:d.GLYPH})})]}):void 0;let Q=Ot+xt;W&&(Q+=d.GLYPH),W&&xe&&(Q+=xt);const ee=V===void 0?void 0:`calc(${String((f==null?void 0:f.length)??0)}ch + ${String(Q)}px)`,te=ie?"auto":"none",me={"data-testid":"panel-field-value",...y,ref:a,className:k,label:r,description:Ke,placeholder:Z,disabled:D,readOnly:Le,onClick:qe,onKeyDown:Ze,leftSection:$e,leftSectionWidth:_?Ps:d.VALUE_INSET,leftSectionPointerEvents:te,leftSectionProps:{style:{insetInlineStart:0,justifyContent:"flex-start",paddingInlineStart:Ot}},rightSection:V,rightSectionWidth:ee,rightSectionPointerEvents:"none",rightSectionProps:{style:{insetInlineEnd:0,justifyContent:"flex-end",paddingInlineEnd:Ot,fontSize:"var(--mantine-font-size-sm)",color:m.CHROME}},styles:{wrapper:{marginTop:0,marginBottom:0,"--input-placeholder-color":T?m.VALUE:m.PLACEHOLDER},input:{backgroundColor:m.SURFACE,paddingInlineStart:void 0,paddingInlineEnd:void 0},label:Cn,description:Cn},wrapperProps:{title:$??r,"data-testid":"panel-field","data-kind":q,"data-bound":b?"true":void 0,"data-mixed":T?"true":void 0,"data-pending":S?"true":void 0,"data-disabled":D?"true":void 0},style:{flex:x==="fill"?"1 1 auto":"0 0 auto",width:x==="fill"?"100%":x,minWidth:0,...A}};return q==="number"?t.jsx(o.NumberInput,{...me,value:ve?"":de,onChange:Ue,min:E,max:L,step:R,hideControls:!0}):je?t.jsx(o.Select,{...me,data:u,value:ve||re===""?null:re,onChange:G=>{Ue(G??"")}}):t.jsx(o.TextInput,{...me,value:ve?"":re,onChange:G=>{Ue(G.currentTarget.value,G)}})}),As=2,js=d.BODY+d.TRAIL_GAP;function Ls(e){return s.Children.toArray(e).flatMap(n=>s.isValidElement(n)&&n.type===s.Fragment?s.Children.toArray(n.props.children):[n])}function Tn(e,n){return s.isValidElement(e)&&e.key!==null?e.key:`field-row-${String(n)}`}function Os(e){if(s.isValidElement(e)&&typeof e.props.label=="string")return e.props.label}function Rn(e){return s.isValidElement(e)&&e.type===go?s.cloneElement(e,{width:"fill"}):e}const Hs=s.forwardRef(function({children:n,trailing:a,groupLabel:r,role:i,style:l,"aria-label":p,"aria-labelledby":g,...h},u){const f=st(),x=Ls(n),b=x.length;Pe(b===0||b>As?`FieldRow was given ${String(b)} ${b===1?"field":"fields"}, and it holds one field, or two side by side. A row with none is an empty 32px gap, and a third field has nowhere to go in the 280px panel the row is measured for. Put the extra fields on rows of their own.`:void 0);const T=r??p,S=i??(T!==void 0||g!==void 0?"group":void 0),E=at(a);if(f&&b>1)return t.jsx(o.Box,{ref:u,"data-testid":"field-row-labelled","data-fields":b,role:S,"aria-label":T,"aria-labelledby":g,...h,style:{display:"flex",flexDirection:"column",...l},children:x.map((O,j)=>{const D=Os(O);return t.jsxs(o.Box,{"data-testid":"field-row","data-labelled":"true",style:{display:"flex",alignItems:"center",height:d.ROW_PITCH},children:[t.jsx(o.Box,{component:"span","data-testid":"field-row-label",title:D,style:{flex:`0 0 ${String(d.LABEL_COLUMN)}px`,minWidth:0,fontSize:"var(--mantine-font-size-sm)",lineHeight:1.2,color:m.CHROME,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:D}),t.jsx(o.Box,{"data-testid":"field-row-slot","data-width":"fill",style:{display:"flex",alignItems:"center",flex:"1 1 auto",minWidth:0,marginInlineStart:d.GUTTER,marginInlineEnd:d.TRAIL_GAP},children:t.jsx(ho,{showLabels:!1,children:Rn(O)})}),t.jsx(be,{children:j===0?a:null})]},Tn(O,j))})});const L=b<=1,R=L&&!E;let I=d.FIELD;L&&(I=R?js:d.BODY);const P=R?void 0:d.TRAIL_GAP;return t.jsxs(o.Box,{ref:u,"data-testid":"field-row","data-fields":b,role:S,"aria-label":T,"aria-labelledby":g,...h,style:{display:"flex",alignItems:"center",height:d.ROW_PITCH,...l},children:[x.map((O,j)=>t.jsx(o.Box,{"data-testid":"field-row-slot","data-width":I,style:{display:"flex",alignItems:"center",flex:`0 0 ${String(I)}px`,minWidth:0,marginInlineStart:j===0?void 0:d.GUTTER,marginInlineEnd:j===b-1?P:void 0},children:Rn(O)},Tn(O,j))),t.jsx(be,{children:a})]})}),_s=2,Ns=6,xo=1,Ds=d.CONTROL_HEIGHT-xo*2,ks=2,Pn=3,Ms=4,Gs=6,zs=d.GLYPH,Bs=3;function Fs(e,n){return n?m.DISABLED:e?m.ON_SELECTED:m.CHROME}function Vs(e){const{options:n,value:a,defaultValue:r,onChange:i,label:l,labelledBy:p,name:g,disabled:h=!1,hybrid:u=!1,width:f,trailing:x,onFocus:b,onBlur:T}=e,C=st(),S=n.length,[E]=n,[L,R]=Y.useUncontrolled({value:a,defaultValue:r,finalValue:E===void 0?"":E.value,onChange:i}),I=s.useRef(void 0);Pe(S<_s||S>Ns?`IconGroupRow was given ${String(S)} ${S===1?"option":"options"}, and it holds two to six drawable ones. One option is a statement rather than a choice and belongs in a field, and more than six stop reading as a set of drawings -- use a select instead. Rendering them anyway.`:void 0);const P=f??(S<=Bs?d.FIELD:d.BODY),O=P==="fill",j=N=>{var A;if(h||N.key!=="Home"&&N.key!=="End")return;const z=n.filter(k=>k.disabled!==!0),B=N.key==="Home"?z[0]:z[z.length-1];if(B===void 0)return;N.preventDefault(),R(B.value,N),(A=Array.from(N.currentTarget.querySelectorAll('input[type="radio"]')).find(k=>k.value===B.value))==null||A.focus()},D=n.map(N=>{const z=N.value===L,B=h||N.disabled===!0,$=C||u&&z;return{value:N.value,disabled:N.disabled,label:t.jsxs(o.Box,{component:"span","data-testid":"icon-group-button","data-value":N.value,"data-active":z?"true":"false",title:N.label,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",gap:$?Ms:0,paddingInline:$?Gs:0,width:"100%",minWidth:0,color:Fs(z,B)},children:[t.jsx(o.Box,{component:"span","data-testid":"icon-group-icon",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:N.icon}),$?t.jsx(o.Box,{component:"span","data-testid":"icon-group-word",style:{minWidth:0,fontWeight:500,lineHeight:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.label}):t.jsx(o.VisuallyHidden,{children:N.label})]})}});return t.jsxs(o.Box,{"data-testid":"icon-group-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:d.TRAIL_GAP,height:d.ROW_PITCH},children:[t.jsx(o.SegmentedControl,{data:D,value:L,onChange:N=>{const z=I.current;I.current=void 0,R(N,z)},onChangeCapture:N=>{I.current=N},onKeyDown:j,onFocus:b,onBlur:T,name:g,disabled:h,radius:"sm","aria-label":l,"aria-labelledby":p,"data-testid":"icon-group-track","data-hybrid":u?"true":void 0,__vars:{"--sc-color":m.SELECTED,"--sc-shadow":"none"},styles:{root:{boxSizing:"border-box",flex:O?"1 1 auto":"0 0 auto",width:O?"100%":P,minWidth:0,height:d.CONTROL_HEIGHT,padding:xo,gap:ks,backgroundColor:m.SURFACE,overflow:"visible"},control:{flex:"1 1 auto",minWidth:zs},label:{display:"flex",alignItems:"center",justifyContent:"center",height:Ds,padding:0,borderRadius:Pn,fontSize:"var(--mantine-font-size-sm)"},innerLabel:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minWidth:0},indicator:{backgroundColor:m.SELECTED,borderRadius:Pn,boxShadow:"none"}}}),t.jsx(be,{children:x})]})}const Us=12,$s=1.5,An=1.4,jn=4,Ws=20,Ln=220,On=2,Hn=new RegExp("\\p{Sentence_Terminal}","u"),Ys=/[.!?]/u,_n=/\s/u;function Xs(e){const n=Array.from(e);let a=0,r=0,i=0;for(;r<n.length;){if(!Hn.test(n[r])){r+=1;continue}let p=r;for(;p+1<n.length&&Hn.test(n[p+1]);)p+=1;const g=n[p+1],h=Ys.test(n[p]);r=p+1,(!h||g===void 0||_n.test(g))&&(a+=1,i=r)}return n.slice(i).some(p=>!_n.test(p))?a+1:a}function Ks(e){return Array.from(e).length}function qs(e,n){if(e!=="reading"||typeof n!="string")return;const a=Ks(n);if(a>Ln)return`ProseBlock was given a reading of ${String(a)} characters, and a reading is at most ${String(Ln)} characters. Shorten it, or it has stopped being a reading and become an explanation.`;const r=Xs(n);if(r>On)return`ProseBlock was given a reading of ${String(r)} sentences, and a reading is at most ${String(On)} sentences. Delete any sentence that repeats what is already on screen, and move the rest into an InfoCircle.`}function Zs(e,n){if(!(n===void 0||e==="runRecord"))return`ProseBlock was given onDetails on the "${e}" shape, and it belongs to "runRecord". A reading and a departure line carry no chevron, so the handler is ignored.`}function Js({variant:e,children:n,onDetails:a,busy:r,live:i}){const l=se(),p=Ae(),g=s.useId();Pe(qs(e,n)),Pe(Zs(e,a));const h=Ge(i,r);if(e==="reading")return t.jsx(o.Text,{...h,"data-testid":"prose-block","data-variant":e,style:{fontSize:Us,lineHeight:$s,color:m.PROSE},children:n});if(e==="departure")return t.jsxs(o.Box,{...h,role:"note","aria-label":l.departure,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"flex-start",gap:jn},children:[t.jsx(o.Box,{"aria-hidden":!0,"data-testid":"prose-block-warning",style:{flex:"0 0 auto",inlineSize:d.GLYPH_SLOT,blockSize:d.GLYPH_SLOT,display:"flex",alignItems:"center",justifyContent:"center",color:m.WARNING},children:t.jsx(oe,{name:"warning",size:d.GLYPH})}),t.jsx(o.Text,{span:!0,size:"sm","data-testid":"prose-block-text",style:{lineHeight:An,color:m.VALUE},children:n})]});const u=typeof n=="string"?n:void 0;return t.jsxs(o.Box,{...h,"data-testid":"prose-block","data-variant":e,style:{display:"flex",alignItems:"center",gap:jn,blockSize:Ws},children:[t.jsx(o.Text,{span:!0,size:"sm",truncate:"end",id:g,title:u,"data-testid":"prose-block-text",style:{flex:"1 1 auto",minInlineSize:0,lineHeight:An,color:m.CHROME},children:n}),a!==void 0&&t.jsx(o.UnstyledButton,{type:"button",title:l.details,"aria-label":l.details,"aria-describedby":g,"data-testid":"prose-block-details",onClick:a,style:{flex:"0 0 auto",inlineSize:d.GLYPH_SLOT,blockSize:d.GLYPH_SLOT,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:"transparent",color:m.CHROME,cursor:"pointer"},children:t.jsx(oe,{name:fe(p)?"chevronLeft":"chevronRight",size:d.CHEVRON})})]})}const Ht=4,Qs=4,ei=`polygon(0 calc(100% - ${Qs}px), 100% 0, 100% 100%, 0 100%)`,ti=120,ni=`linear-gradient(to right, ${m.SURFACE}, ${m.ACCENT})`,oi={sqrt:"scaleSqrt",linear:"scaleLinear",log:"scaleLog"},Nn={flex:"0 0 auto",lineHeight:1,color:m.CHROME,whiteSpace:"nowrap"};function ri({min:e,max:n,label:a,variant:r="size",gradient:i,scale:l,busy:p,live:g,onScaleClick:h,trailing:u}){const f=se(),x=Ae(),b=s.useId(),T=r==="color",C=l===void 0?void 0:oi[l],S=C===void 0?void 0:f[C],E=`${b}-label`,L=`${b}-min`,R=`${b}-max`,I=`${b}-scale`,P=[a===void 0?void 0:E,L,R,S===void 0?void 0:I].filter(D=>D!==void 0);let O=null;C!==void 0&&S!==void 0&&(h===void 0?O=t.jsx(o.Box,{"data-testid":"ramp-row-scale","aria-hidden":"true",title:S,style:{flex:"0 0 auto",width:d.TRAIL,height:d.CONTROL_HEIGHT,display:"flex",alignItems:"center",justifyContent:"center",color:m.CHROME},children:t.jsx(rt,{name:C})}):O=t.jsx(no,{label:S,icon:t.jsx(rt,{name:C}),onClick:h}));const j=at(u)?u:O;return t.jsxs(o.Box,{"data-testid":"ramp-row","data-variant":r,"data-scale":l,style:{display:"flex",alignItems:"center",gap:Ht,height:d.ROW_PITCH},children:[t.jsxs(o.Box,{"data-testid":"ramp-row-figure",role:"img","aria-labelledby":P.join(" "),...Ge(g,p),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:Ht},children:[a!==void 0&&t.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-label",id:E,children:a}),t.jsx(o.Text,{span:!0,size:"sm",id:L,"data-testid":"ramp-row-min",style:Nn,children:e}),t.jsx(o.Box,{"data-testid":"ramp-row-ramp","data-variant":r,"aria-hidden":"true",style:{flex:"1 1 auto",minWidth:ti,height:d.GLYPH,boxSizing:"border-box",background:T?i??ni:m.CHROME,borderRadius:T?"var(--mantine-radius-xs)":void 0,border:T?`1px solid ${m.BORDER}`:void 0,clipPath:T?void 0:ei,...zr(x)}}),t.jsx(o.Text,{span:!0,size:"sm",id:R,"data-testid":"ramp-row-max",style:Nn,children:n}),S!==void 0&&t.jsx(o.VisuallyHidden,{"data-testid":"ramp-row-a11y-scale",id:I,children:S})]}),t.jsx(o.Box,{style:{flex:"0 0 auto",display:"flex",marginInlineStart:d.TRAIL_GAP-Ht},children:t.jsx(be,{children:j})})]})}const ai=4,si=`${String(d.TOGGLE_PITCH)}px`,ii=2;function li({label:e,checked:n,defaultChecked:a,onChange:r,control:i="checkbox",trailing:l,disabled:p=!1,onFocus:g,onBlur:h}){const[u,f]=Y.useUncontrolled({value:n,defaultValue:a,finalValue:!1,onChange:r}),x=C=>{f(C.currentTarget.checked,C)},b={root:{flex:"1 1 auto",minWidth:0},body:{alignItems:"center",minWidth:0},labelWrapper:{minWidth:0},label:{display:"block",height:d.TOGGLE_PITCH,paddingInlineStart:ai,fontSize:"var(--mantine-font-size-sm)",lineHeight:si,color:p?m.DISABLED:m.VALUE,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},T={title:e};return t.jsxs(o.Box,{"data-testid":"toggle-row","data-control":i,"data-checked":u?"true":"false","data-disabled":p?"true":void 0,style:{display:"flex",alignItems:"center",boxSizing:"border-box",gap:d.TRAIL_GAP,height:d.TOGGLE_PITCH},children:[i==="switch"?t.jsx(o.Switch,{"data-testid":"toggle-row-control",label:e,checked:u,disabled:p,onChange:x,onFocus:g,onBlur:h,wrapperProps:T,styles:b}):t.jsx(o.Checkbox,{"data-testid":"toggle-row-control",label:e,checked:u,disabled:p,onChange:x,onFocus:g,onBlur:h,wrapperProps:T,styles:b}),t.jsx(be,{children:l})]})}function ci({children:e,label:n,labelledBy:a}){const r=s.Children.toArray(e).length;return Pe(r<ii?`ToggleRowGroup was given ${String(r)} ${r===1?"row":"rows"}, and it holds two or more. A single checkbox on a row of its own interrupts a column of rows to say one bit: put it in the trailing slot of the row it modifies, or make it one tile of a group of icon buttons. Rendering it anyway.`:void 0),t.jsx(o.Box,{role:"group","aria-label":a===void 0?n:void 0,"aria-labelledby":a,"data-testid":"toggle-row-group","data-rows":r,style:{display:"flex",flexDirection:"column"},children:e})}function di(e="dark"){return o.useComputedColorScheme(e)}const ui={xs:o.rem(4),sm:o.rem(8),md:o.rem(16),lg:o.rem(24),xl:o.rem(32)},pi={HEIGHT:24,FONT_SIZE:11,CONTROL_PADDING:8,SECTION_GAP:4},fi="0.6.0";exports.ActionRow=Qa;exports.AdvancedButton=no;exports.COMPACT_SIZING=pi;exports.CompactColorInput=eo;exports.CompoundRow=Rs;exports.ControlGroup=sa;exports.ControlSection=pa;exports.ControlSubGroup=ga;exports.DEFAULT_GRADIENT_STOP_COLOR=mt;exports.DataRow=rs;exports.DataRowHeader=as;exports.DataTable=Oa;exports.FIELD_GLYPH_NAMES=Yn;exports.FIELD_LETTERS=Xn;exports.FieldGlyph=rt;exports.FieldRow=Hs;exports.GradientEditor=za;exports.HistogramRow=gs;exports.IconGroupRow=Vs;exports.InfoCircle=to;exports.LabelsProvider=pr;exports.MANTINE_SPACING=ui;exports.MAX_ALPHA_HEX=Vt;exports.MAX_OPACITY_PERCENT=Ut;exports.MetricRow=ms;exports.PANEL_GRID=d;exports.PANEL_INK=m;exports.POPOUT_GAP=Mn;exports.POPOUT_NESTED_GAP=Gn;exports.POPOUT_Z_INDEX_BASE=_t;exports.PanelField=go;exports.PanelLabelsProvider=ho;exports.Popout=Me;exports.PopoutButton=Kr;exports.PopoutManager=Qn;exports.PopoutRegion=Or;exports.ProseBlock=Js;exports.RampRow=ri;exports.RankChip=Kt;exports.SWATCH_COLORS_HEXA=Fn;exports.SparklineRow=xs;exports.StyleNumberInput=$a;exports.StyleSelect=Xa;exports.ToggleRow=li;exports.ToggleRowGroup=ci;exports.ToggleWithContent=qa;exports.TrailingSlot=be;exports.UI_GLYPH_NAMES=vr;exports.UiGlyph=oe;exports.VERSION=fi;exports.compactColors=kn;exports.compactDarkColors=Dn;exports.compactTheme=cr;exports.compactThemeOverride=Bn;exports.createColorStop=bt;exports.createDefaultGradientStops=oo;exports.defaultLabels=Vn;exports.getActivationMeta=nt;exports.isFieldGlyphName=Bt;exports.isFieldLetter=Ft;exports.isRtl=fe;exports.isValidHex=Cr;exports.opacityToAlphaHex=Wt;exports.parseAlphaFromHexa=$t;exports.parseHexaColor=Er;exports.parseLocaleNumber=Un;exports.toHexaColor=Sr;exports.useActualColorScheme=di;exports.useCollator=Wn;exports.useDirection=Ae;exports.useLabels=se;exports.useLocale=ze;exports.useNumberFormatter=Xe;exports.useNumberParser=zt;exports.useOrdinalFormatter=$n;exports.usePanelLabels=st;exports.usePopoutRegion=Jn;