@aiquants/console-ui 0.7.2 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkWUST5VT6cjs = require('./chunk-WUST5VT6.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var De=_react.createContext.call(void 0, null),Mt=" ",Ct='[inert], [aria-hidden="true" i]',It="dialog:modal",He="data-cui-dialog-announcer",kn=`:scope > [${He}]`,Ln=e=>{if(e.closest(Ct)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(It)],o=t.activeElement,a=n.filter(i=>i.contains(o)),r=a.length>0?a:n;if(r.every(i=>i.contains(e)))return{region:e};let s=r.find(i=>r.every(l=>l.contains(i)));if(s===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=s.querySelector(kn);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(Ct)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Sn=e=>{try{e.querySelectorAll(It)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},pe= exports.ANNOUNCE_SETTLE_MS =150,Mn=1e3,kt=new WeakMap,In=(e,t)=>{let n=_nullishCoalesce(kt.get(e), () => (new Set)),o={text:t};kt.set(e,n.add(o)),setTimeout(()=>n.delete(o),pe);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(r=>r.text).join(Mt),e.replaceChildren(a)},$n= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:o,testId:a,children:r})=>{if(_react.useContext.call(void 0, De)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof o!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");let d=_chunkWUST5VT6cjs.n.call(void 0, e),[i]=Intl.getCanonicalLocales(t),l=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(i,{timeZone:n}).resolvedOptions().timeZone,[i,n]),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Sn(p.current.ownerDocument)},[]);let c=_react.useCallback.call(void 0, m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:y,settle:E,deadline:R}=u.current;u.current=null,clearTimeout(E),clearTimeout(R);let T=p.current;if(T===null)return;let v=y.join(Mt),k=Ln(T);if("hidden"in k)throw new Error(`announce: the live region is hidden from assistive technology (${k.hidden}), so this announcement would be lost: ${v}`);In(k.region,v)},h=u.current;if(h===null){u.current={texts:[m],settle:setTimeout(f,pe),deadline:setTimeout(f,Mn)};return}h.texts.push(m),clearTimeout(h.settle),h.settle=setTimeout(f,pe)},[]),b=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:i,timeZone:l,labels:d,announce:c,accessFailure:o}),[e,i,l,d,c,o]);return _jsxruntime.jsx.call(void 0, De.Provider,{value:b,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[r,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:p})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, De);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Oe= exports.useAnnounce =()=>C().announce,Fn= exports.useAccessFailure =()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var Hn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),On=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Hn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:o})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=On(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${o} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:o="span",space:a,testId:r,id:s,tabIndex:d,ref:i,children:l})=>(g(),_jsxruntime.jsx.call(void 0, o,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":o==="p"?"reading":void 0,"data-testid":r,id:s,tabIndex:d,ref:i,children:l}));var Un=/\s/,Ke=(e,t)=>{if(e===""||Un.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},X=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Ke(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var qn={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ue=({subject:e,children:t})=>{let n=_react.useRef.call(void 0, null);return H(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},I= exports.Button =({variant:e,children:t,testId:n,type:o="button",onClick:a,unavailable:r,describedBy:s,expanded:d,controls:i,ref:l,dataAttributes:p,busy:u,busyLabel:c})=>{g();let b=_react.useId.call(void 0, ),m=X(r,b),f=u===!0||r!==void 0,h=qn[e],y=E=>{if(ye(E),f){E.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(E)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:o==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":B(s,m),"aria-expanded":d,"aria-controls":i,onClick:y,ref:l,...w(p),children:_jsxruntime.jsx.call(void 0, Ue,{subject:{testId:n,part:"label",host:"button"},children:u===!0?c:t})}),_optionalChain([r, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:r.reason})]})},Gn= exports.Link =({onNavigate:e,children:t,testId:n,ref:o})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:o,children:_jsxruntime.jsx.call(void 0, Ue,{subject:{testId:n,part:"label",host:"button"},children:t})})),Vn=/^[^\s#]+$/,Wn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:o,dataAttributes:a})=>{if(g(),!Vn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:o,...w(a),children:_jsxruntime.jsx.call(void 0, Ue,{subject:{testId:n,part:"label",host:"link"},children:t})})};var Jn=({gap:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Be= exports.Cluster =({gap:e,as:t="div",testId:n,children:o})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:o}));var Yn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),Zn=" ",Qn= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let o=Oe(),a=e.actions.map(({action:d,label:i})=>{let l=t[d];if(l===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(d)}`);return{action:d,label:i,handler:l}}),r=e.politeness==="status"?[e.title,...e.sentences].join(Zn):null,s=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{r===null||s.current===r||(s.current=r,o(r))},[o,r]),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(d=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:d},d))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, Be,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:d,label:i,handler:l})=>_jsxruntime.jsx.call(void 0, I,{variant:Yn.has(d)?"primary":"secondary",onClick:l,testId:`${n}-${d}`,children:i},d))})]})};var me=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var er=({items:e,current:t,onNavigate:n,testId:o})=>{let{labels:a}=C();if(new Set(e.map(r=>r.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(r=>r.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":o,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${o}-${r.id}`,onClick:s=>me(s,r.href,n),children:r.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${o}-current`,children:t})})]})})};var nr=229,rr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),ge=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&rr.has(e.type)&&(e.value!==""||e.validity.badInput),_e=e=>e.nativeEvent.isComposing||e.keyCode===nr,_=(e,t)=>{e.key!=="Escape"||_e(e)||ge(e.target)||(e.stopPropagation(),t())},or= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>_(t,e),[e]);var Ht=e=>e===void 0?void 0:t=>_(t,e),qe= exports.Card =({id:e,title:t,description:n,actions:o,onEscape:a,testId:r,headingRef:s,ref:d,dataAttributes:i,children:l})=>{g();let p=_react.useId.call(void 0, ),u=Ht(a);return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:d,onKeyDown:u,...w(i),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${r}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),o===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:o})]}),l]})},ar={3:"h3",4:"h4"},ir= exports.CardSection =({id:e,title:t,subtitle:n,level:o=3,region:a=!1,onEscape:r,testId:s,headingRef:d,ref:i,dataAttributes:l,children:p})=>{g();let u=_react.useId.call(void 0, ),c=Ht(r),b=ar[o],m=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:d,tabIndex:d===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(l),children:m}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(l),children:m})};var dr=({label:e,code:t,testId:n})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var j=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var cr=({caption:e,attributes:t,columns:n,attributePx:o,columnMinPx:a,testId:r})=>{g();let s=_react.useId.call(void 0, );for(let u of[o,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let d=o+n.length*a,i=`cui-comparison-a${o}-c${a}-n${n.length}`,l=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,p=`${l("table")}{display:none}@container (min-width:${_chunkWUST5VT6cjs.M.call(void 0, d)}){${l("table")}{display:block}${l("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:i,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkWUST5VT6cjs.M.call(void 0, o)}}),n.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:b,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(m=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:m.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[m.key]("stack")})]},m.key))})]},u.key)})})]})};var oe="[data-cui-row-focus]",Ge="[data-cui-row-detail]",pr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${oe}`)],Kt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let o=-1;for(let a of e===null?[]:e.children)a.matches(oe)?(o+=1,n.set(a,o)):o>=0&&a.matches(Ge)&&n.set(a,o);return n},Ut=(e,t,n,o)=>{let a=pr(t);if(a.length===0)return n;let r=o.get(e);if(r===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(r,a.length-1)]};var mr=e=>e+1,ae= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),o=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, mr,0),r=_react.useCallback.call(void 0, (s=>()=>{o.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(o.current=!0,()=>{o.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let s=n.current;if(s===null)return;n.current=null;let d=[null,document.body].includes(document.activeElement);s.isConnected||!d||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(s), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),r};var Rr=new Map,Tr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Er=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let o=e.current;if(t!=="row-compact"||o===null)return;let a=[...o.querySelectorAll(Tr)].find(r=>r.parentElement!==o);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkWUST5VT6cjs.q} px target does not fit its ${_chunkWUST5VT6cjs.s} px; use row-control), not <${a.localName}>`)})},vr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let o=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(o!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${o.key}`)},xr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),wr=(e,t,n,o,a)=>{let r=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!r,"data-cui-row-detail":r?"open":"closed","data-testid":`${o}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:r?e.render(t):null})})},Pr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:o,rowKey:a,rowTestId:r,rowData:s,rowSize:d,rowDetail:i,empty:l,testId:p,ref:u})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);Er(b,d,p);let m=_react.useRef.call(void 0, null),f=_react.useRef.call(void 0, Rr),h=ae(R=>Ut(R,b.current,m.current,f.current));_react.useLayoutEffect.call(void 0, ()=>{f.current=Kt(b.current,m.current)});let y=_react.useCallback.call(void 0, R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=_chunkWUST5VT6cjs.P.call(void 0, n);return vr(n,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:u,children:o.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:l}):_jsxruntime.jsx.call(void 0, "section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkWUST5VT6cjs.M.call(void 0, E)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(R=>_jsxruntime.jsx.call(void 0, "col",{style:R.width.fixedPx===void 0?void 0:{width:_chunkWUST5VT6cjs.M.call(void 0, R.width.fixedPx)}},R.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(R=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:b,children:o.map(R=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...w(_optionalChain([s, 'optionalCall', _8 => _8(R)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:xr(T.rowHeaderNote(R))]},T.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),i===void 0?null:wr(i,R,n.length,r,h)]},a(R)))})]})})})};var Nr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};var Gt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},kr=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},Lr=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Sr=e=>e instanceof HTMLInputElement&&e.type==="search",Mr= exports.Dialog =({title:e,description:t,open:n,onClose:o,initialFocus:a,testId:r,children:s})=>{let{labels:d}=C(),i=_react.useId.call(void 0, ),l=_react.useId.call(void 0, ),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:kr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&Lr(y,E)}else!n&&y.open&&y.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let y=p.current;return()=>{y.open&&(y.close(),Gt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:l,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":r,ref:p,onClose:y=>{y.currentTarget.open||(Gt(u.current),u.current=null,n&&o())},onCancel:y=>{let E=c.current;c.current=!1,(E||ge(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=_e(y);c.current=E,y.key==="Escape"&&!E&&ge(y.target)&&!Sr(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",testId:`${r}-close`,onClick:()=>_optionalChain([p, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:d.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:l,"data-cui-measure":"reading","data-testid":`${r}-description`,children:t}),s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[He]:"","data-testid":`${r}-announcer`})]})};var Fr=({summary:e,open:t,onOpenChange:n,testId:o,children:a})=>{g();let r=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, null);return H(s,{testId:o,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":o,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":r,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${o}-button`,onClick:()=>n(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:s,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:r,hidden:!t,"data-testid":`${o}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Ar=({tone:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),se= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));var Ye=({failure:e,place:t,deniedSentence:n,failed:o,retry:a,testId:r})=>{let{labels:s,accessFailure:d}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:_authcore.accessFailureKindOfStatus.call(void 0, e.status);return i===null?_jsxruntime.jsx.call(void 0, se,{occurrence:e.occurrence,testId:r,children:s.failureSentence(e,o)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:d({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var Or=/\s/,Ze=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Or.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Xt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Z=({description:e,error:t,errorId:n})=>{g();let o=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),r=_react.useId.call(void 0, ),s=n===void 0?r:Ke(n,"a field's error"),d=[e===void 0?null:a,t===void 0?null:s].filter(l=>l!==null).join(" ");return{control:{id:o,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},Q=({description:e,error:t,descriptionId:n,errorId:o,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:o,testId:`${a}-error`,children:t})]}),he=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Kr= exports.Field =({label:e,description:t,error:n,errorId:o,testId:a,children:r})=>{let{control:s,descriptionId:d,errorId:i}=Z({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:s.id,hidden:void 0,children:e}),r(s),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:d,errorId:i,testId:a})]})},jt=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,type:s,name:d,maxLength:i,list:l,autoComplete:p,inputMode:u,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Z({label:e,description:t,error:n,errorId:o}),T=_react.useId.call(void 0, );if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:s,name:Ze(d),maxLength:Xt(i),value:a,list:l,autoComplete:p,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:m,onChange:K=>r(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${f}-prefix`,children:c}),k]}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},Ur= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, jt,{...e}),Br= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, jt,{...e,type:"password"}),_r= exports.TextArea =({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,name:s,maxLength:d,required:i,testId:l,ref:p})=>{let{control:u,descriptionId:c,errorId:b}=Z({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:Ze(s),maxLength:Xt(d),value:a,required:i,onChange:m=>r(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":l,ref:p,...u}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:c,errorId:b,testId:l})]})},qr= exports.Select =({label:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:s,name:d,labelHidden:i,unavailable:l,testId:p,ref:u})=>{let{control:c,descriptionId:b,errorId:m}=Z({label:e,description:t,error:n,errorId:o}),f=_react.useId.call(void 0, ),h=X(l,f);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:c.id,hidden:i,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:Ze(d),value:a,onChange:y=>{l===void 0&&s(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...c,"aria-disabled":l===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:r.map(y=>_jsxruntime.jsx.call(void 0, "option",{value:y.value,children:y.label},y.value))}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),_optionalChain([l, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:l.reason})]})},Gr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:s,testId:d,ref:i})=>{let l=_react.useId.call(void 0, ),{control:p,descriptionId:u,errorId:c}=Z({label:e,description:t,error:n,errorId:o});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),r.map((b,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:l,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${b.value}`,ref:m===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:u,errorId:c,testId:d})]})},Vr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:o,values:a,options:r,onValuesChange:s,testId:d,ref:i})=>{let{control:l,descriptionId:p,errorId:u}=Z({label:e,description:t,error:n,errorId:o}),c=r.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":l["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),r.map((f,h)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>s(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":l["aria-invalid"],"data-testid":`${d}-option-${f.value}`,ref:h===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:f.label})]},f.value)),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:p,errorId:u,testId:d})]})};var nn=_react.createContext.call(void 0, null),Yt="surface",Zt={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},Qt={face:"info-tint",line:"info-accent"},rn={normal:"border-control",high:"info-accent"},jr=["normal","high"],Yr=[1,2,3,4],A=_chunkWUST5VT6cjs.t.space["space-2"],Zr="fg",Qr="fg-secondary",on=e=>{let t=_react.useContext.call(void 0, nn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Qe=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},eo= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:o,heightPx:a,testId:r,dataAttributes:s,children:d}=e;Qe(r,"widthPx",o),Qe(r,"heightPx",a);let i=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:o,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,o,a,t]),l=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:jr.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:i.arrowIds[b],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":rn[b],"data-testid":`${r}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, nn.Provider,{value:i,children:d})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!_chunkWUST5VT6cjs.f.call(void 0, b))throw new RangeError(`${r}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${r}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${o} ${a}`,"data-cui-figure":"group","data-cui-surface":Yt,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkWUST5VT6cjs.M.call(void 0, o),"--cui-figure-block":_chunkWUST5VT6cjs.M.call(void 0, a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":r,...w(s),children:l})})}let{viewBox:p,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${r}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${o} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Yt,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkWUST5VT6cjs.M.call(void 0, o),"--cui-figure-ratio":String(a/o)},"data-testid":r,...w(s),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:l})})},en=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},to=(e,t,n)=>{for(let o of t){let a=_chunk7M4I26BScjs.d.light[o.fg],r=n.find(s=>a[s]===void 0);if(r!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(o.text)} in ${o.fg} is not in the contrast table on ${r}, a face the node takes`)}},no= exports.FigureNode =e=>{g();let t=on("FigureNode"),n=_react.useId.call(void 0, ),{x:o,y:a,shape:r,tone:s,outline:d,selected:i,name:l,title:p,press:u,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(o)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${o}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let f=i?Qt:Zt[s];to(c,m,[Zt[s].face,Qt.face]);let h,y,E;if(r.kind==="box"){if(l===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=en(c,()=>_chunkWUST5VT6cjs.G.call(void 0, {name:l,notes:m.map(k=>k.text)}));if(Qe(c,"a box's widthPx",r.widthPx),r.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${r.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:r.widthPx,height:T.heightPx,left:o,top:a};let v=_chunkWUST5VT6cjs.H.call(void 0, m.length);y=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":f.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:r.widthPx,height:T.heightPx,rx:_chunkWUST5VT6cjs.t.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:_chunkWUST5VT6cjs.t.type.body.size,"data-cui-fg":Zr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:l}),m.map((k,K)=>_jsxruntime.jsx.call(void 0, "text",{x:v.insetPx,y:v.notesPx[K],fontSize:_chunkWUST5VT6cjs.t.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:k.text},K))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkWUST5VT6cjs.K,y:-_chunkWUST5VT6cjs.K,width:r.widthPx+2*_chunkWUST5VT6cjs.K,height:T.heightPx+2*_chunkWUST5VT6cjs.K,rx:_chunkWUST5VT6cjs.t.radius["radius-item"]+_chunkWUST5VT6cjs.K,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=en(c,()=>_chunkWUST5VT6cjs.I.call(void 0, l,r.radiusPx));h={width:2*r.radiusPx,height:2*r.radiusPx,left:o-r.radiusPx,top:a-r.radiusPx},y=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":f.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:r.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),l===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkWUST5VT6cjs.t.type.caption.lineHeight/2,fontSize:_chunkWUST5VT6cjs.t.type.caption.size,"data-cui-fg":Qr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:l})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:r.radiusPx+_chunkWUST5VT6cjs.K,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<_chunkWUST5VT6cjs.q||h.height<_chunkWUST5VT6cjs.q)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkWUST5VT6cjs.q} px target: ${h.width} \xD7 ${h.height}`);if(h.left<_chunkWUST5VT6cjs.J||h.top<_chunkWUST5VT6cjs.J||h.left+h.width+_chunkWUST5VT6cjs.J>t.widthPx||h.top+h.height+_chunkWUST5VT6cjs.J>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkWUST5VT6cjs.J} px to the figure's edge for its focus ring`)}let R=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${o} ${a})`,"data-cui-tone":s,"data-cui-outline":d,"data-selected":String(i),...R,"data-testid":c,...w(b),children:[p===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:p}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,y]})},ro= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:o,title:a,testId:r,dataAttributes:s})=>{g();let d=on("FigureEdge");if(!Yr.includes(n))throw new RangeError(`${r}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:o?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":rn[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":r,...w(s),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var oo={1:"h1",2:"h2",3:"h3"},ao= exports.Heading =({level:e,type:t,testId:n,headingRef:o,children:a})=>{g();let r=oo[e];return _jsxruntime.jsx.call(void 0, r,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:o,tabIndex:o===void 0?void 0:-1,children:a})};var so={removed:"danger-tint",added:"success-tint"},lo= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":so[e],"data-cui-fg":"fg","data-testid":t,children:n})};var co={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},po={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},et= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:o,children:a})=>{g();let r=t==="tint"?co[e]:{fg:"on-solid",surface:po[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":r.fg,"data-cui-surface":r.surface,"data-cui-type":"caption","data-testid":n,...w(o),children:a})};var tt=({label:e,valueText:t,value:n,max:o,testId:a})=>{g();let r=_react.useId.call(void 0, );if(o!==null){if(!(Number.isFinite(o)&&o>0))throw new RangeError(`Progress maximum must be positive: ${o}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=o===null?null:{max:o,now:Math.min(n,o)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:r,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var go=({title:e,status:t,progress:n,cancel:o,testId:a,children:r})=>_jsxruntime.jsxs.call(void 0, qe,{title:e,actions:o===void 0?void 0:_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:o.busy,busyLabel:o.busyLabel,onClick:o.onCancel,testId:`${a}-cancel`,children:o.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, et,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, tt,{...n,testId:`${a}-progress`}),r]});var nt=_react.createContext.call(void 0, null),Ro="space-2",To= exports.List =e=>{g();let{gap:t,label:n,id:o,hidden:a,testId:r,children:s}=e;if(n!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, n))throw new RangeError(`${r}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let d=e.marker==="none"?void 0:e.type,i=d!==void 0,l=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, nt.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, l,{className:"cui-list",role:"list","aria-label":n,id:o,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?Ro:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":d,"data-testid":r,children:s})})},Eo= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let o=_react.useContext.call(void 0, nt);if(o===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":o==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, nt.Provider,{value:null,children:n})})})};var ln=e=>[...e.querySelectorAll(oe)].filter(t=>{let n=t.closest(Ge);return n===null||!e.contains(n)}),xo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=ln(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${oe} elements for ${e.count} rows`);return n},wo=(e,t)=>{let n=-1;return e.forEach((o,a)=>{t.has(o)&&(n=a)}),e[n+1]},Po= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:o,limit:a,rows:r,testId:s})=>{let{formatLocale:d,labels:i}=C(),l=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let y=r.ref.current;l.current={shown:new Set(y===null?[]:ln(y)),failureOccurrence:o===null?null:o.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let y=c.current;c.current=!1;let E=l.current;if(E===null)return;let R=xo(r);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=wo(R,E.shown),v=o!==null&&o.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(l.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&T.focus()});let m=ae(()=>n?p.current:u.current),f=_react.useCallback.call(void 0, (y=>{u.current=y;let E=m(y);return()=>{u.current=null,c.current=y===document.activeElement,E()}}),[m]),h=_react.useCallback.call(void 0, (y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:f,testId:`${s}-button`,children:i.loadMore(_chunkWUST5VT6cjs.a.call(void 0, a,d))}),o===null?null:_jsxruntime.jsx.call(void 0, se,{occurrence:o.occurrence,testId:`${s}-failure`,children:i.loadFailed(o.reason)})]})};var Co=({master:e,detail:t,masterMinPx:n,detailMinPx:o,testId:a})=>{g();let r=_chunkWUST5VT6cjs.O.call(void 0, {masterMinPx:n,detailMinPx:o,gapPx:_chunkWUST5VT6cjs.t.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:r.key,css:r.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":r.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var we=e=>{let{formatLocale:t,labels:n}=C(),{testId:o}=e;if(e.keep===void 0){let{value:s,unit:d}=e;if(d!==void 0&&!_chunkWUST5VT6cjs.f.call(void 0, d))throw new RangeError(`${o}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(s===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let i=_chunkWUST5VT6cjs.a.call(void 0, s,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":o,children:_chunkWUST5VT6cjs.c.call(void 0, i,d)})}let{text:a,keep:r}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":r,"data-testid":o,children:n.unmeasured});if(!_chunkWUST5VT6cjs.f.call(void 0, a))throw new RangeError(`${o}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":r,"data-testid":o,children:a})};var ko=({label:e,value:t,min:n,max:o,valueText:a,testId:r})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(o)&&n<o))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${o}`);if(!(Number.isFinite(t)&&t>=n&&t<=o))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${o}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":r,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${r}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(o-n)*100}%`},"data-testid":`${r}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${r}-value`,children:a})})]})};var Io={ArrowLeft:-1,ArrowRight:1},$o= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:o,testId:a,panelDescribedBy:r,children:s})=>{g();let d=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let l=t.map(f=>f.id);if(new Set(l).size!==l.length)throw new RangeError(`Tab keys must be unique: ${l.join(", ")}`);let p=l.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${l.join(", ")}`);let u=f=>`${d}-tab-${f}`,c=`${d}-panel`,b=f=>{let h=t[f];h.id!==n&&o(h.id),_optionalChain([i, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(h.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>i.current.get(T.id)===f.target),y=h<0?p:h,E=Io[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?i.current.delete(f.id):i.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":r,"data-testid":`${a}-panel`,children:s})]})};var Do=({failure:e,onReload:t,deniedSentence:n,failureMessage:o,rescueRef:a,testId:r})=>{let{labels:s}=C(),d=_jsxruntime.jsx.call(void 0, Ye,{failure:e,place:"read",deniedSentence:n,failed:o===void 0?s.loadFailed:o,retry:t,testId:`${r}-alert`});return e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null?_jsxruntime.jsx.call(void 0, "div",{className:"cui-resource-failed",ref:a,"data-testid":r,children:d},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":r,children:[d,_jsxruntime.jsx.call(void 0, I,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${r}-reload`,children:s.reload})]})};var Ko=({label:e,options:t,value:n,onValueChange:o,testId:a,density:r="regular"})=>{g();let s=_react.useId.call(void 0, ),d=new Set(t.map(i=>i.value));if(t.length<2||d.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!d.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...d].join(", ")}`);if(r!=="regular"&&r!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(r)}`);return r==="compact"?_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":l,"data-testid":`${a}-${i.value}`,onClick:()=>{l||o(i.value)},children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-segment-face","data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":l,"data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{l||o(i.value)},children:i.label},i.value)})})]})};var pn=({selected:e,controls:t,onSelect:n,testId:o,dataAttributes:a,ref:r,children:s})=>{g();let d=_react.useRef.call(void 0, null);H(d,{testId:o,part:"row",host:"button"});let i=_react.useCallback.call(void 0, p=>{if(d.current=p,typeof r=="function")return r(p);r!=null&&(r.current=p)},[r]);return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":o,onClick:p=>{ye(p),n()},ref:i,...w(a),children:s})},_o= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:o,onSelect:a,detailId:r,renderRow:s,rowTestId:d,rowData:i,empty:l,testId:p,ref:u})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:l}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, pn,{selected:b===o,controls:r,onSelect:()=>a(c),testId:d,dataAttributes:_optionalChain([i, 'optionalCall', _23 => _23(c)]),children:s(c)})},b)})})}));var Go=({label:e,value:t,min:n,max:o,step:a,valueText:r,onValueChange:s,testId:d})=>{g();let i=_react.useId.call(void 0, );if(!([t,n,o,a].every(Number.isFinite)&&n<o&&a>0&&n<=t&&t<=o))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${o}, step ${a}`);let l=r(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:i,type:"range",min:n,max:o,step:a,value:t,"aria-valuetext":l,"data-testid":d,onChange:p=>s(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${d}-value`,children:l})})]})]})};var fn={done:0,current:1,pending:2},Vo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Wo= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:o}=C();if(t.length===0||new Set(t.map(r=>r.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(r=>r.id).join(", ")}`);if(t.filter(r=>r.state==="current").length>1||t.some((r,s)=>s>0&&fn[r.state]<fn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(r=>r.state).join(", ")}`);let a={done:o.stepDone,current:null,pending:o.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((r,s)=>{let d=Vo[r.state],i=a[r.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${n}-${r.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:r.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},r.id)})})};var Xo=({label:e,labelHidden:t,checked:n,onCheckedChange:o,unavailable:a,testId:r,ref:s,dataAttributes:d})=>{g();let i=_react.useId.call(void 0, ),l=_react.useRef.call(void 0, null);H(l,{testId:r,part:"label",host:"button"});let p=X(a,i),u=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,ref:s,onClick:()=>{u||o(!n)},...w(d),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${r}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:l,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:i,testId:`${r}-reason`,children:a.reason})]})};var ea=({label:e,items:t,currentId:n,onNavigate:o,testId:a,collapsible:r=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(m=>m.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let d=t.find(m=>m.id===n);if(d===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,l]=_react.useState.call(void 0, !1),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, m=>{l(!1),m&&_optionalChain([p, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(r&&i))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[r,i,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":r?"":void 0,"data-cui-open":r&&i?"":void 0,onKeyDown:r&&i?m=>_(m,()=>b(!0)):void 0,children:[r?_jsxruntime.jsxs.call(void 0, "button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>l(m=>!m),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:d.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":r?"surface":void 0,children:t.map(m=>{let f=m.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{me(h,m.href,o),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};var oa={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},aa= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:o,testId:a,dataAttributes:r}=e;if((e.text===void 0?e.value===null:e.text===null)&&o!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${o}`);let d=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":o,"data-testid":a,...w(r),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":oa[o],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, we,{value:e.value,unit:e.unit,testId:d}):_jsxruntime.jsx.call(void 0, we,{text:e.text,keep:"wrap",testId:d})})]})},Rn=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?Rn(t.props.children):[t]}),ia= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:o})=>{g();let a=_chunkWUST5VT6cjs.R.call(void 0, e,t,_chunkWUST5VT6cjs.t.space["space-2"]),r=Rn(o).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:o})]})};var ke=e=>[...e.querySelectorAll("button")],da= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let o=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=ke(o.current),l=a.current!==null&&i.includes(a.current)?a.current:_nullishCoalesce(i[0], () => (null));a.current=l;for(let p of i)p.tabIndex=p===l?0:-1});let r=i=>{for(let l of ke(o.current))l.tabIndex=l===i?0:-1;a.current=i};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:o,onFocus:i=>{let l=ke(i.currentTarget).find(p=>p.contains(i.target));l!==void 0&&r(l)},onKeyDown:i=>{let l=ke(i.currentTarget),p=l.indexOf(i.target);if(p===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[u]:(p+1)%l.length,[c]:(p-1+l.length)%l.length,Home:0,End:l.length-1}[i.key];if(m===void 0)return;i.preventDefault();let f=l[m];r(f),f.focus()},children:n})};var ca=e=>{let[t,n]=_react.useState.call(void 0, {failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};var vn=e=>e===null?_chunkWUST5VT6cjs.V:_chunkWUST5VT6cjs.W,Se=(e,t,n,o,a)=>{let[r,s]=_react.useState.call(void 0, ()=>({key:e,state:vn(e)})),[d,i]=_react.useState.call(void 0, 0),[l,p]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkWUST5VT6cjs.V});return}let R=new AbortController;c.current=e;let T=d===b.current?"revision":"reload";return b.current=d,s(v=>Object.is(v.key,e)?{key:e,state:o(v.state,T)}:{key:e,state:_chunkWUST5VT6cjs.W}),u.current(R.signal).then(v=>{R.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{R.signal.aborted||s(()=>{throw v})}),()=>{R.abort(),c.current=null}},[e,n,d,l]);let m=_react.useCallback.call(void 0, ()=>i(R=>R+1),[]),f=_react.useCallback.call(void 0, ()=>p(R=>R+1),[]),h=_react.useCallback.call(void 0, (R,T)=>{s(v=>Object.is(v.key,R)?{key:R,state:T(v.state)}:v)},[]),y=_react.useCallback.call(void 0, (R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(r.key,e)?r.state:vn(e),reload:m,refresh:f,update:h,write:y}};var ma=(e,t,n)=>{let o=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{o.current=t});let a=_react.useCallback.call(void 0, y=>o.current.first(y),[]),{state:r,reload:s,refresh:d,update:i,write:l}=Se(e,a,n,_chunkWUST5VT6cjs.Z,_chunkWUST5VT6cjs._),p=_react.useRef.call(void 0, {key:e,state:r});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:r}});let u=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),s()},[c,s]),m=_react.useCallback.call(void 0, ()=>{c(),d()},[c,d]),f=_react.useCallback.call(void 0, ()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};u.current=T,i(y,_chunkWUST5VT6cjs.$),o.current.next(R,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(y,k=>T.maps.reduce((K,wn)=>_chunkWUST5VT6cjs.ba.call(void 0, K,wn),_chunkWUST5VT6cjs.aa.call(void 0, k,R,v))))},v=>{u.current===T&&i(y,()=>{throw v})})},[i]),h=_react.useCallback.call(void 0, (y,E)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),l(y,T=>_chunkWUST5VT6cjs.ba.call(void 0, T,E))},[l]);return{state:r,reload:b,refresh:m,loadMore:f,updateList:h}};var Ra=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Ta= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),o=_react.useCallback.call(void 0, (a,r)=>{let s=r();if(!Ra(s))return;let d=Symbol(a);n.current=d,t(a);let i=()=>{n.current===d&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:o}};var va=(e,t,n)=>{let{state:o,reload:a,refresh:r,write:s}=Se(e,t,n,_chunkWUST5VT6cjs.X,_chunkWUST5VT6cjs.Y),d=_react.useCallback.call(void 0, (i,l)=>s(i,p=>_chunkWUST5VT6cjs.Y.call(void 0, p,{ok:!0,value:l})),[s]);return{state:o,reload:a,refresh:r,put:d}};var xa=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = pe; exports.AccessFailureNotice = Qn; exports.AlertMessage = se; exports.Breadcrumb = er; exports.Button = I; exports.COMPACT_ROW_PX = _chunkWUST5VT6cjs.s; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkWUST5VT6cjs.m; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.Card = qe; exports.CardSection = ir; exports.CheckboxGroup = Vr; exports.Cluster = Be; exports.CodeBlock = dr; exports.ComparisonGrid = cr; exports.ConsoleUiRoot = $n; exports.DataTable = Pr; exports.DescriptionList = Nr; exports.Dialog = Mr; exports.Disclosure = Fr; exports.FIGURE_RING_REACH_PX = _chunkWUST5VT6cjs.J; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkWUST5VT6cjs.A; exports.FailureMessage = Ye; exports.Field = Kr; exports.Figure = eo; exports.FigureEdge = ro; exports.FigureNode = no; exports.FragmentLink = Wn; exports.HTTP_FORBIDDEN = _chunkWUST5VT6cjs.S; exports.Heading = ao; exports.InlineChange = lo; exports.JobCard = go; exports.LATTICE_PX = _chunkWUST5VT6cjs.o; exports.Link = Gn; exports.List = To; exports.ListItem = Eo; exports.LoadMore = Po; exports.MasterDetail = Co; exports.Measured = we; exports.Meter = ko; exports.MetricTile = aa; exports.Notice = Ar; exports.PanelTabs = $o; exports.PasswordInput = Br; exports.Pill = et; exports.ProgressBar = tt; exports.ROW_WITH_CONTROL_PX = _chunkWUST5VT6cjs.r; exports.RadioGroup = Gr; exports.ResourceFailed = Do; exports.RowButton = pn; exports.SegmentedControl = Ko; exports.Select = qr; exports.SelectableList = _o; exports.Slider = Go; exports.Stack = Jn; exports.Stepper = Wo; exports.Switch = Xo; exports.TARGET_PX = _chunkWUST5VT6cjs.q; exports.TOKENS = _chunkWUST5VT6cjs.t; exports.TONES = _chunkWUST5VT6cjs.ga; exports.TONE_HUES = _chunkWUST5VT6cjs.ea; exports.TONE_ROLES = _chunkWUST5VT6cjs.fa; exports.Tabs = ea; exports.Text = P; exports.TextArea = _r; exports.TextInput = Ur; exports.TileGrid = ia; exports.Toolbar = da; exports.VisuallyHidden = xa; exports.ZonedTimeError = _chunkWUST5VT6cjs.g; exports.beginPage = _chunkWUST5VT6cjs.$; exports.beginPagedReload = _chunkWUST5VT6cjs.Z; exports.beginReload = _chunkWUST5VT6cjs.X; exports.ceil8 = _chunkWUST5VT6cjs.x; exports.ceilToLattice = _chunkWUST5VT6cjs.p; exports.cellContentInlinePx = _chunkWUST5VT6cjs.y; exports.comparisonAttributePx = _chunkWUST5VT6cjs.B; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkWUST5VT6cjs.D; exports.cssVar = _chunkWUST5VT6cjs.u; exports.figureBoxPlan = _chunkWUST5VT6cjs.G; exports.figureDiscLabelPlan = _chunkWUST5VT6cjs.I; exports.fillLabel = _chunkWUST5VT6cjs.k; exports.fixedColumnPx = _chunkWUST5VT6cjs.z; exports.flatMapOutcome = _chunkWUST5VT6cjs.U; exports.formatByteSize = _chunkWUST5VT6cjs.b; exports.formatCount = _chunkWUST5VT6cjs.a; exports.formatInstant = _chunkWUST5VT6cjs.j; exports.goldenSectionPx = _chunkWUST5VT6cjs.L; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkWUST5VT6cjs.C; exports.isReadableText = _chunkWUST5VT6cjs.f; exports.keepLastGood = _chunkWUST5VT6cjs.Y; exports.lightDark = _chunkWUST5VT6cjs.ca; exports.mapOutcome = _chunkWUST5VT6cjs.T; exports.mapPagedList = _chunkWUST5VT6cjs.ba; exports.masterDetailPlan = _chunkWUST5VT6cjs.N; exports.monoTextWidthEm = _chunkWUST5VT6cjs.w; exports.placeholderRule = _chunkWUST5VT6cjs.da; exports.pxToRem = _chunkWUST5VT6cjs.M; exports.readDecimalText = _chunkWUST5VT6cjs.d; exports.readIntegerText = _chunkWUST5VT6cjs.e; exports.reasonAside = _chunkWUST5VT6cjs.l; exports.resolveConsoleUiLabels = _chunkWUST5VT6cjs.n; exports.settleFirstPage = _chunkWUST5VT6cjs._; exports.settlePage = _chunkWUST5VT6cjs.aa; exports.spacedTextWidthEm = _chunkWUST5VT6cjs.F; exports.tableFrameMinInlinePx = _chunkWUST5VT6cjs.Q; exports.tableMinInlinePx = _chunkWUST5VT6cjs.P; exports.textWidthEm = _chunkWUST5VT6cjs.v; exports.tileGridPlan = _chunkWUST5VT6cjs.R; exports.tileMinInlinePx = _chunkWUST5VT6cjs.E; exports.toOffsetIso = _chunkWUST5VT6cjs.h; exports.toWallTime = _chunkWUST5VT6cjs.i; exports.useAccessFailure = Fn; exports.useAnnounce = Oe; exports.useConsoleUi = C; exports.useEscapeToClose = or; exports.useFailureOccurrence = ca; exports.useFocusRescue = ae; exports.usePagedResource = ma; exports.usePendingPress = Ta; exports.useResource = va;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkW3FRNSCOcjs = require('./chunk-W3FRNSCO.cjs');var _chunkXLOWKWIIcjs = require('./chunk-XLOWKWII.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var He=_react.createContext.call(void 0, null),Ft=" ",St='[inert], [aria-hidden="true" i]',Oe="data-cui-dialog-announcer",Sn=`:scope > [${Oe}]`,Mn=e=>{if(e.closest(St)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=_chunkW3FRNSCOcjs.b.call(void 0, e.ownerDocument);if(t.kind==="none")return{region:e};if(t.kind==="undecidable")return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let n=t.dialog;if(n.contains(e))return{region:e};let r=n.querySelector(Sn);return r===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:r.closest(St)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:r}},In=e=>{try{e.querySelectorAll(_chunkW3FRNSCOcjs.a)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},pe= exports.ANNOUNCE_SETTLE_MS =150,$n=1e3,Mt=new WeakMap,Fn=(e,t)=>{let n=_nullishCoalesce(Mt.get(e), () => (new Set)),r={text:t};Mt.set(e,n.add(r)),setTimeout(()=>n.delete(r),pe);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ft),e.replaceChildren(a)},An= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,accessFailure:r,contrast:a="standard",testId:o,children:s})=>{if(_react.useContext.call(void 0, He)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");if(typeof r!="function")throw new TypeError("ConsoleUiRoot: accessFailure must be the host's presenter of access failures (a function)");if(!_chunkXLOWKWIIcjs.h.includes(a))throw new RangeError(`ConsoleUiRoot: contrast must be one of ${_chunkXLOWKWIIcjs.h.join(", ")}: ${String(a)}`);let i=_chunkW3FRNSCOcjs.p.call(void 0, e),[d]=Intl.getCanonicalLocales(t),p=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(d,{timeZone:n}).resolvedOptions().timeZone,[d,n]),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{In(u.current.ownerDocument)},[]);let b=_react.useCallback.call(void 0, f=>{if(f.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let h=()=>{let{texts:E,settle:R,deadline:T}=c.current;c.current=null,clearTimeout(R),clearTimeout(T);let v=u.current;if(v===null)return;let k=E.join(Ft),I=Mn(v);if("hidden"in I)throw new Error(`announce: the live region is hidden from assistive technology (${I.hidden}), so this announcement would be lost: ${k}`);Fn(I.region,k)},y=c.current;if(y===null){c.current={texts:[f],settle:setTimeout(h,pe),deadline:setTimeout(h,$n)};return}y.texts.push(f),clearTimeout(y.settle),y.settle=setTimeout(h,pe)},[]),m=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:d,timeZone:p,labels:i,announce:b,accessFailure:r}),[e,d,p,i,b,r]);return _jsxruntime.jsx.call(void 0, He.Provider,{value:m,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-contrast":a,"data-cui-surface":"surface","data-cui-fg":"fg","data-testid":o,children:[s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${o}-announcer`,ref:u})]})})},C= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, He);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},Ke= exports.useAnnounce =()=>C().announce,Dn= exports.useAccessFailure =()=>C().accessFailure;var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var Kn=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),Un=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Kn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},O=(e,{testId:t,part:n,host:r})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=Un(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:s,tabIndex:l,ref:i,children:d})=>(g(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:s,tabIndex:l,ref:i,children:d}));var _n=/\s/,Ue=(e,t)=>{if(e===""||_n.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},X=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Ue(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var Vn={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Be=({subject:e,children:t})=>{let n=_react.useRef.call(void 0, null);return O(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},$= exports.Button =({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:s,expanded:l,controls:i,ref:d,dataAttributes:p,busy:u,busyLabel:c})=>{g();let b=_react.useId.call(void 0, ),m=X(o,b),f=u===!0||o!==void 0,h=Vn[e],y=E=>{if(ye(E),f){E.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(E)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":n,"aria-disabled":f?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":B(s,m),"aria-expanded":l,"aria-controls":i,onClick:y,ref:d,...w(p),children:_jsxruntime.jsx.call(void 0, Be,{subject:{testId:n,part:"label",host:"button"},children:u===!0?c:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:o.reason})]})},Wn= exports.Link =({onNavigate:e,children:t,testId:n,ref:r})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, Be,{subject:{testId:n,part:"label",host:"button"},children:t})})),zn=/^[^\s#]+$/,Jn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a})=>{if(g(),!zn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:r,...w(a),children:_jsxruntime.jsx.call(void 0, Be,{subject:{testId:n,part:"label",host:"link"},children:t})})};var jn=({gap:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),_e= exports.Cluster =({gap:e,as:t="div",testId:n,children:r})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));var Qn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),er=" ",tr= exports.AccessFailureNotice =({view:e,handlers:t,testId:n})=>{let r=Ke(),a=e.actions.map(({action:l,label:i})=>{let d=t[l];if(d===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(l)}`);return{action:l,label:i,handler:d}}),o=e.politeness==="status"?[e.title,...e.sentences].join(er):null,s=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{o===null||s.current===o||(s.current=o,r(o))},[r,o]),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-notice cui-access-failure-message",role:e.politeness==="alert"?"alert":void 0,"data-cui-tone":"warning","data-cui-surface":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":`${n}-message`,children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(l=>_jsxruntime.jsx.call(void 0, "p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:l},l))]}),a.length===0?null:_jsxruntime.jsx.call(void 0, _e,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:l,label:i,handler:d})=>_jsxruntime.jsx.call(void 0, $,{variant:Qn.has(l)?"primary":"secondary",onClick:d,testId:`${n}-${l}`,children:i},l))})]})};var me=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var nr=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=C();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:s=>me(s,o.href,n),children:o.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var or=229,ar=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),ge=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&ar.has(e.type)&&(e.value!==""||e.validity.badInput),qe=e=>e.nativeEvent.isComposing||e.keyCode===or,_=(e,t)=>{e.key!=="Escape"||qe(e)||ge(e.target)||(e.stopPropagation(),t())},ir= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>_(t,e),[e]);var Kt=e=>e===void 0?void 0:t=>_(t,e),Ge= exports.Card =({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:s,ref:l,dataAttributes:i,children:d})=>{g();let p=_react.useId.call(void 0, ),u=Kt(a);return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:u,...w(i),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:s,tabIndex:s===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),d]})},sr={3:"h3",4:"h4"},dr= exports.CardSection =({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:s,headingRef:l,ref:i,dataAttributes:d,children:p})=>{g();let u=_react.useId.call(void 0, ),c=Kt(o),b=sr[r],m=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, b,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${s}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":s,ref:i,onKeyDown:c,...w(d),children:m}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":s,ref:i,...w(d),children:m})};var ur=({label:e,code:t,testId:n})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var j=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var yr=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let s=_react.useId.call(void 0, );for(let u of[r,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of n)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,i=`cui-comparison-a${r}-c${a}-n${n.length}`,d=u=>`[data-cui-comparison="${i}"][data-cui-comparison-layout="${u}"]`,p=`${d("table")}{display:none}@container (min-width:${_chunkW3FRNSCOcjs.O.call(void 0, l)}){${d("table")}{display:block}${d("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:i,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":i,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkW3FRNSCOcjs.O.call(void 0, r)}}),n.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":i,"data-cui-comparison-layout":"stack",children:n.map((u,c)=>{let b=`${s}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:b,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(m=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:m.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[m.key]("stack")})]},m.key))})]},u.key)})})]})};var oe="[data-cui-row-focus]",Ve="[data-cui-row-detail]",fr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${oe}`)],Bt=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(oe)?(r+=1,n.set(a,r)):r>=0&&a.matches(Ve)&&n.set(a,r);return n},_t=(e,t,n,r)=>{let a=fr(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};var br=e=>e+1,ae= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, br,0),o=_react.useCallback.call(void 0, (s=>()=>{r.current&&s.contains(document.activeElement)&&(n.current=s,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let s=n.current;if(s===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);s.isConnected||!l||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(s), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var Er=new Map,vr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',xr=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(vr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkW3FRNSCOcjs.s} px target does not fit its ${_chunkW3FRNSCOcjs.u} px; use row-control), not <${a.localName}>`)})},wr=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},Pr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),Nr=(e,t,n,r,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},Cr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:s,rowSize:l,rowDetail:i,empty:d,testId:p,ref:u})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);xr(b,l,p);let m=_react.useRef.call(void 0, null),f=_react.useRef.call(void 0, Er),h=ae(R=>_t(R,b.current,m.current,f.current));_react.useLayoutEffect.call(void 0, ()=>{f.current=Bt(b.current,m.current)});let y=_react.useCallback.call(void 0, R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=_chunkW3FRNSCOcjs.R.call(void 0, n);return wr(n,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:u,children:r.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":_chunkW3FRNSCOcjs.O.call(void 0, E)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(R=>_jsxruntime.jsx.call(void 0, "col",{style:R.width.fixedPx===void 0?void 0:{width:_chunkW3FRNSCOcjs.O.call(void 0, R.width.fixedPx)}},R.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(R=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:b,children:r.map(R=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(_optionalChain([s, 'optionalCall', _8 => _8(R)])),children:n.map(T=>T.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:Pr(T.rowHeaderNote(R))]},T.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),i===void 0?null:Nr(i,R,n.length,o,h)]},a(R)))})]})})})};var kr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};var Wt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Sr=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},Mr=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},Ir=e=>e instanceof HTMLInputElement&&e.type==="search",$r= exports.Dialog =({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:s})=>{let{labels:l}=C(),i=_react.useId.call(void 0, ),d=_react.useId.call(void 0, ),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:Sr(y,a.current);u.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&Mr(y,E)}else!n&&y.open&&y.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let y=p.current;return()=>{y.open&&(y.close(),Wt(u.current),u.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":i,"aria-describedby":t===void 0?void 0:d,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:p,onClose:y=>{y.currentTarget.open||(Wt(u.current),u.current=null,n&&r())},onCancel:y=>{let E=c.current;c.current=!1,(E||ge(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=qe(y);c.current=E,y.key==="Escape"&&!E&&ge(y.target)&&!Ir(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:i,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, $,{variant:"secondary",testId:`${o}-close`,onClick:()=>_optionalChain([p, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:l.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:d,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),s,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Oe]:"","data-testid":`${o}-announcer`})]})};var Dr=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, null);return O(s,{testId:r,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:s,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};var _authcore = require('@aiquants/auth-core');var Hr=({tone:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),se= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));var Ze=({failure:e,place:t,deniedSentence:n,failed:r,retry:a,testId:o})=>{let{labels:s,accessFailure:l}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let i=e.status===null?null:_authcore.accessFailureKindOfStatus.call(void 0, e.status);return i===null?_jsxruntime.jsx.call(void 0, se,{occurrence:e.occurrence,testId:o,children:s.failureSentence(e,r)}):_jsxruntime.jsx.call(void 0, _react.Fragment,{children:l({kind:i,place:t,deniedSentence:i==="forbidden"?s.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};var Ur=/\s/,Qe=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Ur.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Yt=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Z=({description:e,error:t,errorId:n})=>{g();let r=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),s=n===void 0?o:Ue(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:s].filter(d=>d!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:s}},Q=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),he=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Br= exports.Field =({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:s,descriptionId:l,errorId:i}=Z({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:s.id,hidden:void 0,children:e}),o(s),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:l,errorId:i,testId:a})]})},Zt=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:s,name:l,maxLength:i,list:d,autoComplete:p,inputMode:u,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Z({label:e,description:t,error:n,errorId:r}),T=_react.useId.call(void 0, );if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(i!==void 0&&s==="datetime-local")throw new RangeError(`A ${s} input takes no maxLength: ${i}`);let v=s==="password",k=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:s,name:Qe(l),maxLength:Yt(i),value:a,list:d,autoComplete:p,inputMode:u,spellCheck:v?!1:void 0,autoCapitalize:v?"none":void 0,required:m,onChange:I=>o(I.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":f,ref:h,...y,"aria-describedby":B(c===void 0?void 0:T,y["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:T,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${f}-prefix`,children:c}),k]}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},_r= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, Zt,{...e}),qr= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, Zt,{...e,type:"password"}),Gr= exports.TextArea =({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:s,maxLength:l,required:i,testId:d,ref:p})=>{let{control:u,descriptionId:c,errorId:b}=Z({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:u.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:Qe(s),maxLength:Yt(l),value:a,required:i,onChange:m=>o(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:p,...u}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:c,errorId:b,testId:d})]})},Vr= exports.Select =({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,name:l,labelHidden:i,unavailable:d,testId:p,ref:u})=>{let{control:c,descriptionId:b,errorId:m}=Z({label:e,description:t,error:n,errorId:r}),f=_react.useId.call(void 0, ),h=X(d,f);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[_jsxruntime.jsx.call(void 0, he,{htmlFor:c.id,hidden:i,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:Qe(l),value:a,onChange:y=>{d===void 0&&s(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:u,...c,"aria-disabled":d===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:o.map(y=>_jsxruntime.jsx.call(void 0, "option",{value:y.value,children:y.label},y.value))}),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),_optionalChain([d, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:d.reason})]})},Wr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:s,testId:l,ref:i})=>{let d=_react.useId.call(void 0, ),{control:p,descriptionId:u,errorId:c}=Z({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,m)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:d,value:b.value,checked:b.value===a,onChange:()=>s(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:m===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:u,errorId:c,testId:l})]})},zr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:s,testId:l,ref:i})=>{let{control:d,descriptionId:p,errorId:u}=Z({label:e,description:t,error:n,errorId:r}),c=o.map(f=>f.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(f=>!c.includes(f));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let m=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":d["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((f,h)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>s(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":d["aria-invalid"],"data-testid":`${l}-option-${f.value}`,ref:h===0?i:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:f.label})]},f.value)),_jsxruntime.jsx.call(void 0, Q,{description:t,error:n,descriptionId:p,errorId:u,testId:l})]})};var on=_react.createContext.call(void 0, null),Qt="surface",en={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},tn={face:"info-tint",line:"info-accent"},an={normal:"border-control",high:"info-accent"},Zr=["normal","high"],Qr=[1,2,3,4],D=_chunkW3FRNSCOcjs.v.space["space-2"],eo="fg",to="fg-secondary",sn=e=>{let t=_react.useContext.call(void 0, on);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},et=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},no= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:s,children:l}=e;et(o,"widthPx",r),et(o,"heightPx",a);let i=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),d=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:Zr.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:i.arrowIds[b],viewBox:`0 0 ${D} ${D}`,refX:D,refY:D/2,markerWidth:D,markerHeight:D,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${D} ${D/2} L 0 ${D} z`,"data-cui-stroke":an[b],"data-testid":`${o}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, on.Provider,{value:i,children:l})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!_chunkW3FRNSCOcjs.h.call(void 0, b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":Qt,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkW3FRNSCOcjs.O.call(void 0, r),"--cui-figure-block":_chunkW3FRNSCOcjs.O.call(void 0, a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":o,...w(s),children:d})})}let{viewBox:p,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Qt,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkW3FRNSCOcjs.O.call(void 0, r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(s),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:d})})},nn=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},ro=(e,t,n)=>{for(let r of t){let a=_chunkXLOWKWIIcjs.i.light[r.fg],o=n.find(s=>a[s]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},oo= exports.FigureNode =e=>{g();let t=sn("FigureNode"),n=_react.useId.call(void 0, ),{x:r,y:a,shape:o,tone:s,outline:l,selected:i,name:d,title:p,press:u,testId:c,dataAttributes:b}=e,m=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!_chunkW3FRNSCOcjs.h.call(void 0, u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let f=i?tn:en[s];ro(c,m,[en[s].face,tn.face]);let h,y,E;if(o.kind==="box"){if(d===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let T=nn(c,()=>_chunkW3FRNSCOcjs.I.call(void 0, {name:d,notes:m.map(k=>k.text)}));if(et(c,"a box's widthPx",o.widthPx),o.widthPx<T.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${T.minWidthPx} px)`);h={width:o.widthPx,height:T.heightPx,left:r,top:a};let v=_chunkW3FRNSCOcjs.J.call(void 0, m.length);y=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":f.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:T.heightPx,rx:_chunkW3FRNSCOcjs.v.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:_chunkW3FRNSCOcjs.v.type.body.size,"data-cui-fg":eo,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:d}),m.map((k,I)=>_jsxruntime.jsx.call(void 0, "text",{x:v.insetPx,y:v.notesPx[I],fontSize:_chunkW3FRNSCOcjs.v.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${I}`,children:k.text},I))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkW3FRNSCOcjs.M,y:-_chunkW3FRNSCOcjs.M,width:o.widthPx+2*_chunkW3FRNSCOcjs.M,height:T.heightPx+2*_chunkW3FRNSCOcjs.M,rx:_chunkW3FRNSCOcjs.v.radius["radius-item"]+_chunkW3FRNSCOcjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=nn(c,()=>_chunkW3FRNSCOcjs.K.call(void 0, d,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},y=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":f.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),d===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-_chunkW3FRNSCOcjs.v.type.caption.lineHeight/2,fontSize:_chunkW3FRNSCOcjs.v.type.caption.size,"data-cui-fg":to,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:d})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkW3FRNSCOcjs.M,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<_chunkW3FRNSCOcjs.s||h.height<_chunkW3FRNSCOcjs.s)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkW3FRNSCOcjs.s} px target: ${h.width} \xD7 ${h.height}`);if(h.left<_chunkW3FRNSCOcjs.L||h.top<_chunkW3FRNSCOcjs.L||h.left+h.width+_chunkW3FRNSCOcjs.L>t.widthPx||h.top+h.height+_chunkW3FRNSCOcjs.L>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkW3FRNSCOcjs.L} px to the figure's edge for its focus ring`)}let R=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:n,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:T=>{T.currentTarget.focus(),u.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":s,"data-cui-outline":l,"data-selected":String(i),...R,"data-testid":c,...w(b),children:[p===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:p}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:E,y]})},ao= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:s})=>{g();let l=sn("FigureEdge");if(!Qr.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":an[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(s),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var io={1:"h1",2:"h2",3:"h3"},so= exports.Heading =({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=io[e];return _jsxruntime.jsx.call(void 0, o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};var uo={removed:"danger-tint",added:"success-tint"},co= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":uo[e],"data-cui-fg":"fg","data-testid":t,children:n})};var yo={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},fo={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},tt= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?yo[e]:{fg:"on-solid",surface:fo[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};var nt=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let s=r===null?null:{max:r,now:Math.min(n,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":s===null?void 0:0,"aria-valuemax":_optionalChain([s, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([s, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":s===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:s===null?void 0:{inlineSize:`${s.now/s.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var ho=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, Ge,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, $,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, tt,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, nt,{...n,testId:`${a}-progress`}),o]});var rt=_react.createContext.call(void 0, null),Eo="space-2",vo= exports.List =e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:s}=e;if(n!==void 0&&!_chunkW3FRNSCOcjs.h.call(void 0, n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,i=l!==void 0,d=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, rt.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, d,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":i?void 0:t,"data-cui-row-gap":i?t:void 0,"data-cui-column-gap":i?Eo:void 0,"data-cui-marker":i?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:s})})},xo= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let r=_react.useContext.call(void 0, rt);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, rt.Provider,{value:null,children:n})})})};var cn=e=>[...e.querySelectorAll(oe)].filter(t=>{let n=t.closest(Ve);return n===null||!e.contains(n)}),Po=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=cn(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${oe} elements for ${e.count} rows`);return n},No=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},Co= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:s})=>{let{formatLocale:l,labels:i}=C(),d=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let y=o.ref.current;d.current={shown:new Set(y===null?[]:cn(y)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let y=c.current;c.current=!1;let E=d.current;if(E===null)return;let R=Po(o);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=No(R,E.shown),v=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||v||n)||(d.current=null,v||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||y&&k)&&T.focus()});let m=ae(()=>n?p.current:u.current),f=_react.useCallback.call(void 0, (y=>{u.current=y;let E=m(y);return()=>{u.current=null,c.current=y===document.activeElement,E()}}),[m]),h=_react.useCallback.call(void 0, (y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${s}-end`,children:i.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":s,children:[_jsxruntime.jsx.call(void 0, $,{variant:"secondary",busy:t,busyLabel:i.loading,onClick:b,ref:f,testId:`${s}-button`,children:i.loadMore(_chunkW3FRNSCOcjs.c.call(void 0, a,l))}),r===null?null:_jsxruntime.jsx.call(void 0, se,{occurrence:r.occurrence,testId:`${s}-failure`,children:i.loadFailed(r.reason)})]})};var Lo=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=_chunkW3FRNSCOcjs.Q.call(void 0, {masterMinPx:n,detailMinPx:r,gapPx:_chunkW3FRNSCOcjs.v.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var we=e=>{let{formatLocale:t,labels:n}=C(),{testId:r}=e;if(e.keep===void 0){let{value:s,unit:l}=e;if(l!==void 0&&!_chunkW3FRNSCOcjs.h.call(void 0, l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(s===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let i=_chunkW3FRNSCOcjs.c.call(void 0, s,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":r,children:_chunkW3FRNSCOcjs.e.call(void 0, i,l)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!_chunkW3FRNSCOcjs.h.call(void 0, a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};var So=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var Fo={ArrowLeft:-1,ArrowRight:1},Ao= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:s})=>{g();let l=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let d=t.map(f=>f.id);if(new Set(d).size!==d.length)throw new RangeError(`Tab keys must be unique: ${d.join(", ")}`);let p=d.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${d.join(", ")}`);let u=f=>`${l}-tab-${f}`,c=`${l}-panel`,b=f=>{let h=t[f];h.id!==n&&r(h.id),_optionalChain([i, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(h.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>i.current.get(T.id)===f.target),y=h<0?p:h,E=Fo[f.key],R;if(E!==void 0){let T=getComputedStyle(f.currentTarget).direction==="rtl"?-E:E;R=(y+T+t.length)%t.length}else if(f.key==="Home")R=0;else if(f.key==="End")R=t.length-1;else return;f.preventDefault(),b(R)},children:t.map((f,h)=>{let y=h===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":y,"aria-controls":c,tabIndex:y?0:-1,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,ref:E=>{E===null?i.current.delete(f.id):i.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:s})]})};var Oo=({failure:e,onReload:t,deniedSentence:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:s}=C(),l=_jsxruntime.jsx.call(void 0, Ze,{failure:e,place:"read",deniedSentence:n,failed:r===void 0?s.loadFailed:r,retry:t,testId:`${o}-alert`});return e.status!==null&&_authcore.accessFailureKindOfStatus.call(void 0, e.status)!==null?_jsxruntime.jsx.call(void 0, "div",{className:"cui-resource-failed",ref:a,"data-testid":o,children:l},e.occurrence):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[l,_jsxruntime.jsx.call(void 0, $,{variant:"secondary",busy:e.retrying,busyLabel:s.loading,onClick:t,ref:a,testId:`${o}-reload`,children:s.reload})]})};var Bo=({label:e,options:t,value:n,onValueChange:r,testId:a,density:o="regular"})=>{g();let s=_react.useId.call(void 0, ),l=new Set(t.map(i=>i.value));if(t.length<2||l.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!l.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...l].join(", ")}`);if(o!=="regular"&&o!=="compact")throw new RangeError(`A segmented control's density is "regular" or "compact", not ${JSON.stringify(o)}`);return o==="compact"?_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","aria-labelledby":s,"data-cui-density":"compact","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-segmented-label",id:s,"data-cui-type":"caption",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-segment-face","data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"caption","data-testid":`${a}-${i.value}-face`,children:i.label})},i.value)})})]}):_jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||r(i.value)},children:i.label},i.value)})})]})};var fn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,children:s})=>{g();let l=_react.useRef.call(void 0, null);O(l,{testId:r,part:"row",host:"button"});let i=_react.useCallback.call(void 0, p=>{if(l.current=p,typeof o=="function")return o(p);o!=null&&(o.current=p)},[o]);return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p=>{ye(p),n()},ref:i,...w(a),children:s})},Go= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:s,rowTestId:l,rowData:i,empty:d,testId:p,ref:u})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:d}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, fn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:_optionalChain([i, 'optionalCall', _23 => _23(c)]),children:s(c)})},b)})})}));var Wo=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:s,testId:l})=>{g();let i=_react.useId.call(void 0, );if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let d=o(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:i,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:i,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":d,"data-testid":l,onChange:p=>s(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${l}-value`,children:d})})]})]})};var gn={done:0,current:1,pending:2},zo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Jo= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:r}=C();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,s)=>s>0&&gn[o.state]<gn[t[s-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,s)=>{let l=zo[o.state],i=a[o.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":s+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,i===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${i})`})]})]},o.id)})})};var Yo=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:s,dataAttributes:l})=>{g();let i=_react.useId.call(void 0, ),d=_react.useRef.call(void 0, null);O(d,{testId:o,part:"label",host:"button"});let p=X(a,i),u=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":u?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:s,onClick:()=>{u||r(!n)},...w(l),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:d,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:i,testId:`${o}-reason`,children:a.reason})]})};var na=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let s=new Set(t.map(m=>m.id));if(s.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(m=>m.id).join(", ")}`);let l=t.find(m=>m.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...s].join(", ")}`);let[i,d]=_react.useState.call(void 0, !1),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, m=>{d(!1),m&&_optionalChain([p, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(o&&i))return;let m=y=>p.current!==null&&!p.current.contains(y),f=y=>{m(y.target)&&b(!0)},h=y=>{m(y.target)&&b(!1)};return document.addEventListener("pointerdown",f,!0),document.addEventListener("focusin",h,!0),()=>{document.removeEventListener("pointerdown",f,!0),document.removeEventListener("focusin",h,!0)}},[o,i,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&i?"":void 0,onKeyDown:o&&i?m=>_(m,()=>b(!0)):void 0,children:[o?_jsxruntime.jsxs.call(void 0, "button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":i,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>d(m=>!m),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:l.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:i?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(m=>{let f=m.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:m.href,"aria-current":f?"page":void 0,"data-cui-fg":f?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,onClick:h=>{me(h,m.href,r),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};var ia={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},sa= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":ia[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, we,{value:e.value,unit:e.unit,testId:l}):_jsxruntime.jsx.call(void 0, we,{text:e.text,keep:"wrap",testId:l})})]})},En=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?En(t.props.children):[t]}),da= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=_chunkW3FRNSCOcjs.T.call(void 0, e,t,_chunkW3FRNSCOcjs.v.space["space-2"]),o=En(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, j,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};var ke=e=>[...e.querySelectorAll("button")],ua= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let r=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let i=ke(r.current),d=a.current!==null&&i.includes(a.current)?a.current:_nullishCoalesce(i[0], () => (null));a.current=d;for(let p of i)p.tabIndex=p===d?0:-1});let o=i=>{for(let d of ke(r.current))d.tabIndex=d===i?0:-1;a.current=i};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:i=>{let d=ke(i.currentTarget).find(p=>p.contains(i.target));d!==void 0&&o(d)},onKeyDown:i=>{let d=ke(i.currentTarget),p=d.indexOf(i.target);if(p===-1)return;let u=getComputedStyle(i.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[u]:(p+1)%d.length,[c]:(p-1+d.length)%d.length,Home:0,End:d.length-1}[i.key];if(m===void 0)return;i.preventDefault();let f=d[m];o(f),f.focus()},children:n})};var ya=e=>{let[t,n]=_react.useState.call(void 0, {failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};var wn=e=>e===null?_chunkW3FRNSCOcjs.X:_chunkW3FRNSCOcjs.Y,Se=(e,t,n,r,a)=>{let[o,s]=_react.useState.call(void 0, ()=>({key:e,state:wn(e)})),[l,i]=_react.useState.call(void 0, 0),[d,p]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){s({key:null,state:_chunkW3FRNSCOcjs.X});return}let R=new AbortController;c.current=e;let T=l===b.current?"revision":"reload";return b.current=l,s(v=>Object.is(v.key,e)?{key:e,state:r(v.state,T)}:{key:e,state:_chunkW3FRNSCOcjs.Y}),u.current(R.signal).then(v=>{R.signal.aborted||(c.current=null,s(k=>({key:e,state:a(k.state,v)})))},v=>{R.signal.aborted||s(()=>{throw v})}),()=>{R.abort(),c.current=null}},[e,n,l,d]);let m=_react.useCallback.call(void 0, ()=>i(R=>R+1),[]),f=_react.useCallback.call(void 0, ()=>p(R=>R+1),[]),h=_react.useCallback.call(void 0, (R,T)=>{s(v=>Object.is(v.key,R)?{key:R,state:T(v.state)}:v)},[]),y=_react.useCallback.call(void 0, (R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(o.key,e)?o.state:wn(e),reload:m,refresh:f,update:h,write:y}};var ba=(e,t,n)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let a=_react.useCallback.call(void 0, y=>r.current.first(y),[]),{state:o,reload:s,refresh:l,update:i,write:d}=Se(e,a,n,_chunkW3FRNSCOcjs.$,_chunkW3FRNSCOcjs.aa),p=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:o}});let u=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),s()},[c,s]),m=_react.useCallback.call(void 0, ()=>{c(),l()},[c,l]),f=_react.useCallback.call(void 0, ()=>{let{key:y,state:E}=p.current;if(y===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let R=E.value.next,T={key:y,controller:new AbortController,maps:[]};u.current=T,i(y,_chunkW3FRNSCOcjs.ba),r.current.next(R,T.controller.signal).then(v=>{u.current===T&&(u.current=null,i(y,k=>T.maps.reduce((I,Nn)=>_chunkW3FRNSCOcjs.da.call(void 0, I,Nn),_chunkW3FRNSCOcjs.ca.call(void 0, k,R,v))))},v=>{u.current===T&&i(y,()=>{throw v})})},[i]),h=_react.useCallback.call(void 0, (y,E)=>{let R=u.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),d(y,T=>_chunkW3FRNSCOcjs.da.call(void 0, T,E))},[d]);return{state:o,reload:b,refresh:m,loadMore:f,updateList:h}};var Ea=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",va= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),r=_react.useCallback.call(void 0, (a,o)=>{let s=o();if(!Ea(s))return;let l=Symbol(a);n.current=l,t(a);let i=()=>{n.current===l&&(n.current=null,t(null))};s.then(i,i)},[]);return{pendingKey:e,press:r}};var wa=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:s}=Se(e,t,n,_chunkW3FRNSCOcjs.Z,_chunkW3FRNSCOcjs._),l=_react.useCallback.call(void 0, (i,d)=>s(i,p=>_chunkW3FRNSCOcjs._.call(void 0, p,{ok:!0,value:d})),[s]);return{state:r,reload:a,refresh:o,put:l}};var Pa=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = pe; exports.AccessFailureNotice = tr; exports.AlertMessage = se; exports.Breadcrumb = nr; exports.Button = $; exports.COMPACT_ROW_PX = _chunkW3FRNSCOcjs.u; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkW3FRNSCOcjs.o; exports.CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.f; exports.CONTRAST_PAIRS = _chunkXLOWKWIIcjs.i; exports.Card = Ge; exports.CardSection = dr; exports.CheckboxGroup = zr; exports.Cluster = _e; exports.CodeBlock = ur; exports.ComparisonGrid = yr; exports.ConsoleUiRoot = An; exports.DataTable = Cr; exports.DescriptionList = kr; exports.Dialog = $r; exports.Disclosure = Dr; exports.FIGURE_RING_REACH_PX = _chunkW3FRNSCOcjs.L; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkW3FRNSCOcjs.C; exports.FailureMessage = Ze; exports.Field = Br; exports.Figure = no; exports.FigureEdge = ao; exports.FigureNode = oo; exports.FragmentLink = Jn; exports.HTTP_FORBIDDEN = _chunkW3FRNSCOcjs.U; exports.Heading = so; exports.InlineChange = co; exports.JobCard = ho; exports.LATTICE_PX = _chunkW3FRNSCOcjs.q; exports.Link = Wn; exports.List = vo; exports.ListItem = xo; exports.LoadMore = Co; exports.MORE_CONTRAST_MINIMUM = _chunkXLOWKWIIcjs.g; exports.MasterDetail = Lo; exports.Measured = we; exports.Meter = So; exports.MetricTile = sa; exports.Notice = Hr; exports.PanelTabs = Ao; exports.PasswordInput = qr; exports.Pill = tt; exports.ProgressBar = nt; exports.ROW_WITH_CONTROL_PX = _chunkW3FRNSCOcjs.t; exports.RadioGroup = Wr; exports.ResourceFailed = Oo; exports.RowButton = fn; exports.SegmentedControl = Bo; exports.Select = Vr; exports.SelectableList = Go; exports.Slider = Wo; exports.Stack = jn; exports.Stepper = Jo; exports.Switch = Yo; exports.TARGET_PX = _chunkW3FRNSCOcjs.s; exports.TOKENS = _chunkW3FRNSCOcjs.v; exports.TONES = _chunkW3FRNSCOcjs.ia; exports.TONE_HUES = _chunkW3FRNSCOcjs.ga; exports.TONE_ROLES = _chunkW3FRNSCOcjs.ha; exports.Tabs = na; exports.Text = P; exports.TextArea = Gr; exports.TextInput = _r; exports.TileGrid = da; exports.Toolbar = ua; exports.VisuallyHidden = Pa; exports.ZonedTimeError = _chunkW3FRNSCOcjs.i; exports.beginPage = _chunkW3FRNSCOcjs.ba; exports.beginPagedReload = _chunkW3FRNSCOcjs.$; exports.beginReload = _chunkW3FRNSCOcjs.Z; exports.ceil8 = _chunkW3FRNSCOcjs.z; exports.ceilToLattice = _chunkW3FRNSCOcjs.r; exports.cellContentInlinePx = _chunkW3FRNSCOcjs.A; exports.comparisonAttributePx = _chunkW3FRNSCOcjs.D; exports.contrastRatio = _chunkXLOWKWIIcjs.e; exports.countSampleText = _chunkW3FRNSCOcjs.F; exports.cssVar = _chunkW3FRNSCOcjs.w; exports.figureBoxPlan = _chunkW3FRNSCOcjs.I; exports.figureDiscLabelPlan = _chunkW3FRNSCOcjs.K; exports.fillLabel = _chunkW3FRNSCOcjs.m; exports.fixedColumnPx = _chunkW3FRNSCOcjs.B; exports.flatMapOutcome = _chunkW3FRNSCOcjs.W; exports.formatByteSize = _chunkW3FRNSCOcjs.d; exports.formatCount = _chunkW3FRNSCOcjs.c; exports.formatInstant = _chunkW3FRNSCOcjs.l; exports.goldenSectionPx = _chunkW3FRNSCOcjs.N; exports.hexToSrgb = _chunkXLOWKWIIcjs.a; exports.instantSampleText = _chunkW3FRNSCOcjs.E; exports.isReadableText = _chunkW3FRNSCOcjs.h; exports.keepLastGood = _chunkW3FRNSCOcjs._; exports.lightDark = _chunkW3FRNSCOcjs.ea; exports.mapOutcome = _chunkW3FRNSCOcjs.V; exports.mapPagedList = _chunkW3FRNSCOcjs.da; exports.masterDetailPlan = _chunkW3FRNSCOcjs.P; exports.monoTextWidthEm = _chunkW3FRNSCOcjs.y; exports.placeholderRule = _chunkW3FRNSCOcjs.fa; exports.pxToRem = _chunkW3FRNSCOcjs.O; exports.readDecimalText = _chunkW3FRNSCOcjs.f; exports.readIntegerText = _chunkW3FRNSCOcjs.g; exports.reasonAside = _chunkW3FRNSCOcjs.n; exports.resolveConsoleUiLabels = _chunkW3FRNSCOcjs.p; exports.settleFirstPage = _chunkW3FRNSCOcjs.aa; exports.settlePage = _chunkW3FRNSCOcjs.ca; exports.spacedTextWidthEm = _chunkW3FRNSCOcjs.H; exports.tableFrameMinInlinePx = _chunkW3FRNSCOcjs.S; exports.tableMinInlinePx = _chunkW3FRNSCOcjs.R; exports.textWidthEm = _chunkW3FRNSCOcjs.x; exports.tileGridPlan = _chunkW3FRNSCOcjs.T; exports.tileMinInlinePx = _chunkW3FRNSCOcjs.G; exports.toOffsetIso = _chunkW3FRNSCOcjs.j; exports.toWallTime = _chunkW3FRNSCOcjs.k; exports.topmostModalOf = _chunkW3FRNSCOcjs.b; exports.useAccessFailure = Dn; exports.useAnnounce = Ke; exports.useConsoleUi = C; exports.useEscapeToClose = ir; exports.useFailureOccurrence = ya; exports.useFocusRescue = ae; exports.usePagedResource = ba; exports.usePendingPress = va; exports.useResource = wa;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, FgRole, TypeToken, SpaceToken, ResourceFailure, TextFace, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.cjs";
2
- export { AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, CellContent, ColorScheme, ColorToken, ColumnHeaderText, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, FigureBoxLines, FigureBoxPlan, FigureDiscLabelPlan, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, TileGridPlan, TileGridStep, TokenName, Tone, ToneHue, ToneRole, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime } from "./core.cjs";
1
+ import { ConsoleUiLocale, ConsoleUiLabels, ContrastLevel, ColumnWidth, FgRole, TypeToken, SpaceToken, ResourceFailure, TextFace, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.cjs";
2
+ export { AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, CellContent, ColorScheme, ColorToken, ColumnHeaderText, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, FigureBoxLines, FigureBoxPlan, FigureDiscLabelPlan, HTTP_FORBIDDEN, LATTICE_PX, MORE_CONTRAST_MINIMUM, MasterDetailOptions, MasterDetailPlan, Measure, MeasureToken, MotionToken, PageFailure, PagedValue, PaletteName, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, TileGridPlan, TileGridStep, TokenName, Tone, ToneHue, ToneRole, TopmostModal, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime, topmostModalOf } from "./core.cjs";
3
3
  import * as react from "react";
4
4
  import { ReactNode, MouseEvent, Ref, RefObject, DOMAttributes, RefCallback, KeyboardEvent } from "react";
5
5
  import { AccessFailureAction, AccessFailureView, AccessFailurePresenter, AccessFailurePlace } from "@aiquants/auth-core";
@@ -136,10 +136,11 @@ type ConsoleUiRootProps = {
136
136
  readonly formatLocale: string;
137
137
  readonly timeZone: string;
138
138
  readonly accessFailure: AccessFailurePresenter<ReactNode>;
139
+ readonly contrast?: ContrastLevel;
139
140
  readonly testId: string;
140
141
  readonly children: ReactNode;
141
142
  };
142
- declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
143
+ declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, contrast, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
143
144
  declare const useConsoleUi: () => ConsoleUiContextValue;
144
145
  declare const useAnnounce: () => ((text: string) => void);
145
146
  declare const useAccessFailure: () => AccessFailurePresenter<ReactNode>;
@@ -721,4 +722,4 @@ type VisuallyHiddenProps = {
721
722
  readonly children: ReactNode;
722
723
  };
723
724
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
724
- export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
725
+ export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, ContrastLevel, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, FgRole, TypeToken, SpaceToken, ResourceFailure, TextFace, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
- export { AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, CellContent, ColorScheme, ColorToken, ColumnHeaderText, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, FigureBoxLines, FigureBoxPlan, FigureDiscLabelPlan, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, TileGridPlan, TileGridStep, TokenName, Tone, ToneHue, ToneRole, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime } from "./core.js";
1
+ import { ConsoleUiLocale, ConsoleUiLabels, ContrastLevel, ColumnWidth, FgRole, TypeToken, SpaceToken, ResourceFailure, TextFace, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
+ export { AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, CellContent, ColorScheme, ColorToken, ColumnHeaderText, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, FigureBoxLines, FigureBoxPlan, FigureDiscLabelPlan, HTTP_FORBIDDEN, LATTICE_PX, MORE_CONTRAST_MINIMUM, MasterDetailOptions, MasterDetailPlan, Measure, MeasureToken, MotionToken, PageFailure, PagedValue, PaletteName, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, TileGridPlan, TileGridStep, TokenName, Tone, ToneHue, ToneRole, TopmostModal, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime, topmostModalOf } from "./core.js";
3
3
  import * as react from "react";
4
4
  import { ReactNode, MouseEvent, Ref, RefObject, DOMAttributes, RefCallback, KeyboardEvent } from "react";
5
5
  import { AccessFailureAction, AccessFailureView, AccessFailurePresenter, AccessFailurePlace } from "@aiquants/auth-core";
@@ -136,10 +136,11 @@ type ConsoleUiRootProps = {
136
136
  readonly formatLocale: string;
137
137
  readonly timeZone: string;
138
138
  readonly accessFailure: AccessFailurePresenter<ReactNode>;
139
+ readonly contrast?: ContrastLevel;
139
140
  readonly testId: string;
140
141
  readonly children: ReactNode;
141
142
  };
142
- declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
143
+ declare const ConsoleUiRoot: ({ locale, formatLocale, timeZone, accessFailure, contrast, testId, children }: ConsoleUiRootProps) => react.JSX.Element;
143
144
  declare const useConsoleUi: () => ConsoleUiContextValue;
144
145
  declare const useAnnounce: () => ((text: string) => void);
145
146
  declare const useAccessFailure: () => AccessFailurePresenter<ReactNode>;
@@ -721,4 +722,4 @@ type VisuallyHiddenProps = {
721
722
  readonly children: ReactNode;
722
723
  };
723
724
  declare const VisuallyHidden: ({ testId, children }: VisuallyHiddenProps) => react.JSX.Element;
724
- export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };
725
+ export { ANNOUNCE_SETTLE_MS, type AccessFailureHandlers, AccessFailureNotice, type AccessFailureNoticeProps, AlertMessage, type AlertMessageProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps, type ButtonVariant, Card, type CardProps, CardSection, type CardSectionProps, CheckboxGroup, type CheckboxGroupProps, Cluster, type ClusterProps, CodeBlock, type CodeBlockProps, type ColumnDef, ColumnWidth, type ComparisonAttribute, type ComparisonColumn, ComparisonGrid, type ComparisonGridProps, type ComparisonLayout, type ConsoleUiContextValue, ConsoleUiLabels, ConsoleUiLocale, ConsoleUiRoot, type ConsoleUiRootProps, ContrastLevel, type DataAttributes, DataTable, type DataTableProps, type DataTableRowDetail, type DescriptionItem, DescriptionList, type DescriptionListProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, FailureMessage, type FailureMessageProps, FgRole, Field, type FieldControl, type FieldOption, type FieldProps, Figure, FigureEdge, type FigureEdgeProps, FigureNode, type FigureNodeNote, type FigureNodePress, type FigureNodeProps, type FigureNodeShape, type FigurePointer, type FigureProps, FragmentLink, type FragmentLinkProps, Heading, type HeadingProps, type HeadingType, InlineChange, type InlineChangeKind, type InlineChangeProps, type JobCancel, JobCard, type JobCardProps, KeysetPage, Link, type LinkProps, List, ListItem, type ListItemProps, type ListMarking, type ListProps, type ListTextType, LoadMore, type LoadMoreProps, MasterDetail, type MasterDetailProps, Measured, type MeasuredKeep, type MeasuredProps, Meter, type MeterProps, MetricTile, type MetricTileProps, type MetricTileTone, NextPage, Notice, type NoticeProps, PagedContent, type PagedLoaders, PagedState, type PanelTab, PanelTabs, type PanelTabsProps, PasswordInput, type PasswordInputProps, type PendingPress, Pill, type PillProps, type PillTone, ProgressBar, type ProgressBarProps, RadioGroup, type RadioGroupProps, ResourceFailed, type ResourceFailedProps, ResourceFailure, ResourceOutcome, ResourceState, RowButton, type RowButtonProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, SelectableList, type SelectableListProps, Slider, type SliderProps, SpaceToken, Stack, type StackProps, type StepState, Stepper, type StepperItem, type StepperProps, Switch, type SwitchProps, type TabItem, Tabs, type TabsProps, Text, TextArea, type TextAreaProps, TextFace, TextInput, type TextInputProps, type TextProps, TileGrid, type TileGridProps, Toolbar, type ToolbarProps, TypeToken, type Unavailable, type UsePagedResourceResult, type UseResourceResult, VisuallyHidden, type VisuallyHiddenProps, useAccessFailure, useAnnounce, useConsoleUi, useEscapeToClose, useFailureOccurrence, useFocusRescue, usePagedResource, usePendingPress, useResource };