@aiquants/console-ui 0.6.5 → 0.7.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/README.md +77 -35
- package/dist/chunk-H4DAGEIG.js +1 -0
- package/dist/chunk-WUST5VT6.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +29 -4
- package/dist/index.d.ts +29 -4
- package/dist/index.js +1 -1
- package/dist/styles/console-ui.css +26 -0
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/package.json +6 -4
- package/dist/chunk-5TR7VUZM.js +0 -1
- package/dist/chunk-K7BETTSL.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as bt,A as S,B as va,C as wa,D as Pa,E as Ca,F as Na,G as ka,H as La,I as Ma,J as Sa,K as Ia,L as $a,M as Aa,N as lt,O as ut,P as ct,Q as z,R as U,S as Fa,T as I,U as Da,V as pt,W as yt,X as Ha,Y as ft,Z as mt,_ as gt,a as ue,aa as ht,b as la,ba as Ie,c as at,ca as Ba,d as ua,da as _a,e as ca,ea as qa,f as D,fa as Ga,g as pa,ga as Va,h as ya,i as fa,j as ma,k as ga,l as hn,m as ba,n as ha,o as ke,p as Le,q as it,r as Me,s as Ra,t as Ta,u as st,v as Se,w as Ea,x as W,y as xa,z as dt}from"./chunk-5TR7VUZM.js";import{a as Oa,b as Ka,c as Ua,d as Rt}from"./chunk-FXEGLGL7.js";import{createContext as Rn,useCallback as Tn,useContext as Pt,useLayoutEffect as En,useMemo as Tt,useRef as Et}from"react";import{jsx as wt,jsxs as Ln}from"react/jsx-runtime";var $e=Rn(null),Ct=" ",xt='[inert], [aria-hidden="true" i]',Nt="dialog:modal",Ae="data-cui-dialog-announcer",xn=`:scope > [${Ae}]`,vn=e=>{if(e.closest(xt)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(Nt)],r=t.activeElement,a=n.filter(s=>s.contains(r)),o=a.length>0?a:n;if(o.every(s=>s.contains(e)))return{region:e};let i=o.find(s=>o.every(u=>u.contains(s)));if(i===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 l=i.querySelector(xn);return l===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:l.closest(xt)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:l}},wn=e=>{try{e.querySelectorAll(Nt)}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}},ce=150,Pn=1e3,vt=new WeakMap,Cn=(e,t)=>{let n=vt.get(e)??new Set,r={text:t};vt.set(e,n.add(r)),setTimeout(()=>n.delete(r),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ct),e.replaceChildren(a)},Nn=({locale:e,formatLocale:t,timeZone:n,testId:r,children:a})=>{if(Pt($e)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let i=st(e),[l]=Intl.getCanonicalLocales(t),s=Tt(()=>new Intl.DateTimeFormat(l,{timeZone:n}).resolvedOptions().timeZone,[l,n]),u=Et(null),p=Et(null);En(()=>{wn(u.current.ownerDocument)},[]);let d=Tn(b=>{if(b.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:T,settle:m,deadline:E}=p.current;p.current=null,clearTimeout(m),clearTimeout(E);let h=u.current;if(h===null)return;let R=T.join(Ct),x=vn(h);if("hidden"in x)throw new Error(`announce: the live region is hidden from assistive technology (${x.hidden}), so this announcement would be lost: ${R}`);Cn(x.region,R)},y=p.current;if(y===null){p.current={texts:[b],settle:setTimeout(f,ce),deadline:setTimeout(f,Pn)};return}y.texts.push(b),clearTimeout(y.settle),y.settle=setTimeout(f,ce)},[]),c=Tt(()=>({locale:e,formatLocale:l,timeZone:s,labels:i,announce:d}),[e,l,s,i,d]);return wt($e.Provider,{value:c,children:Ln("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[a,wt("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:u})]})})},k=()=>{let e=Pt($e);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{k()},kn=()=>k().announce;var pe=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as te,jsxs as kt}from"react/jsx-runtime";var Mn=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=k();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 te("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:kt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>kt("li",{className:"cui-breadcrumb-item",children:[te("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:i=>pe(i,o.href,n),children:o.label}),te("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),te("li",{className:"cui-breadcrumb-item",children:te("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Dn,useRef as Hn}from"react";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})};import{useLayoutEffect as Sn}from"react";var In=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"]),$n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!In.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:r})=>{Sn(()=>{let a=$n(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}>`)})};import{jsx as An}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:i,tabIndex:l,ref:s,children:u})=>(g(),An(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:i,tabIndex:l,ref:s,children:u}));var Fn=/\s/,Fe=(e,t)=>{if(e===""||Fn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},J=(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 Fe(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(" ")};import{jsx as O,jsxs as _n}from"react/jsx-runtime";var On={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"}},De=({subject:e,children:t})=>{let n=Hn(null);return H(n,e),O("span",{ref:n,children:t})},A=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:i,expanded:l,controls:s,ref:u,dataAttributes:p,busy:d,busyLabel:c})=>{g();let b=Dn(),f=J(o,b),y=d===!0||o!==void 0,T=On[e],m=E=>{if(ye(E),y){E.preventDefault();return}a?.(E)};return _n("span",{className:"cui-button-group",children:[O("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":T.fg,"data-cui-surface":T.surface,"data-cui-type":T.type,"data-testid":n,"aria-disabled":y?!0:void 0,"aria-busy":d===!0?!0:void 0,"aria-describedby":B(i,f),"aria-expanded":l,"aria-controls":s,onClick:m,ref:u,...w(p),children:O(De,{subject:{testId:n,part:"label",host:"button"},children:d===!0?c:t})}),o?.reason===void 0?null:O(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:o.reason})]})},Kn=({onNavigate:e,children:t,testId:n,ref:r})=>(g(),O("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:r,children:O(De,{subject:{testId:n,part:"label",host:"button"},children:t})})),Un=/^[^\s#]+$/,Bn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a})=>{if(g(),!Un.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return O("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:r,...w(a),children:O(De,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{useId as Lt}from"react";import{useCallback as qn}from"react";var Gn=229,Vn=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),He=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Vn.has(e.type)&&(e.value!==""||e.validity.badInput),Oe=e=>e.nativeEvent.isComposing||e.keyCode===Gn,_=(e,t)=>{e.key!=="Escape"||Oe(e)||He(e.target)||(e.stopPropagation(),t())},Wn=e=>qn(t=>_(t,e),[e]);import{Fragment as Xn,jsx as q,jsxs as ne}from"react/jsx-runtime";var Mt=e=>e===void 0?void 0:t=>_(t,e),Ke=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:i,ref:l,dataAttributes:s,children:u})=>{g();let p=Lt(),d=Mt(a);return ne("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:d,...w(s),children:[ne("div",{className:"cui-card-header",children:[ne("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:q("div",{className:"cui-card-actions",children:r})]}),u]})},zn={3:"h3",4:"h4"},Jn=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:i,headingRef:l,ref:s,dataAttributes:u,children:p})=>{g();let d=Lt(),c=Mt(o),b=zn[r],f=ne(Xn,{children:[ne("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:d,"data-cui-type":"body","data-testid":`${i}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":d,"data-testid":i,ref:s,onKeyDown:c,...w(u),children:f}):q("div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(u),children:f})};import{jsx as St}from"react/jsx-runtime";var jn=({label:e,code:t,testId:n})=>(g(),St("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:St("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as Zn}from"react";import{jsx as Yn}from"react/jsx-runtime";var X=({ruleKey:e,css:t})=>Yn("style",{href:e,precedence:"cui",children:t});import{jsx as N,jsxs as G}from"react/jsx-runtime";var Qn=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let i=Zn();for(let d of[r,a])if(!(Number.isFinite(d)&&d>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${d}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let d of n)for(let c of t)if(!Object.hasOwn(d.cells,c.key))throw new RangeError(`Column "${d.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,s=`cui-comparison-a${r}-c${a}-n${n.length}`,u=d=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${d}"]`,p=`${u("table")}{display:none}@container (min-width:${I(l)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[N(X,{ruleKey:s,css:p}),N("div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[N("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[N("col",{style:{width:I(r)}}),n.map(d=>N("col",{},d.key))]}),N("thead",{children:G("tr",{children:[N("td",{}),n.map(d=>N("th",{scope:"col",children:d.heading},d.key))]})}),N("tbody",{children:t.map(d=>G("tr",{children:[N("th",{scope:"row",children:d.label}),n.map(c=>N("td",{children:c.cells[d.key]("table")},c.key))]},d.key))})]})}),N("div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((d,c)=>{let b=`${i}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[N("div",{className:"cui-comparison-heading",id:b,children:d.heading}),N("dl",{className:"cui-comparison-list",children:t.map(f=>G("div",{children:[N("dt",{children:f.label}),N("dd",{children:d.cells[f.key]("stack")})]},f.key))})]},d.key)})})]})};import{Fragment as or,useCallback as ar,useId as ir,useLayoutEffect as At,useRef as qe}from"react";var re="[data-cui-row-focus]",Ue="[data-cui-row-detail]",er=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${re}`)],It=(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(re)?(r+=1,n.set(a,r)):r>=0&&a.matches(Ue)&&n.set(a,r);return n},$t=(e,t,n,r)=>{let a=er(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)]};import{useCallback as tr,useLayoutEffect as Be,useReducer as nr,useRef as _e}from"react";var rr=e=>e+1,oe=e=>{let t=_e(e),n=_e(null),r=_e(!1),[,a]=nr(rr,0),o=tr((i=>()=>{r.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return Be(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Be(()=>{t.current=e}),Be(()=>{let i=n.current;if(i===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);i.isConnected||!l||t.current(i)?.focus()}),o};import{jsx as L,jsxs as fe}from"react/jsx-runtime";var sr=new Map,dr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',lr=(e,t,n)=>{At(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(dr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${W} px target does not fit its ${dt} px; use row-control), not <${a.localName}>`)})},ur=(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}`)},cr=e=>e==null?null:L("div",{className:"cui-table-header-note",children:e}),pr=(e,t,n,r,a)=>{let o=e.open(t);return L("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:L("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},yr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:i,rowSize:l,rowDetail:s,empty:u,testId:p,ref:d})=>{g();let c=ir(),b=qe(null);lr(b,l,p);let f=qe(null),y=qe(sr),T=oe(h=>$t(h,b.current,f.current,y.current));At(()=>{y.current=It(b.current,f.current)});let m=ar(h=>{f.current=h;let R=T(h);return()=>{f.current=null,R()}},[T]),E=yt(n);return ur(n,p),L("div",{className:"cui-container","data-testid":p,ref:d,children:r.length===0?L(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:m,testId:`${p}-empty`,children:u}):L("section",{ref:T,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:fe("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":I(E)},children:[L("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),L("colgroup",{children:n.map(h=>L("col",{style:h.width.fixedPx===void 0?void 0:{width:I(h.width.fixedPx)}},h.key))}),L("thead",{children:L("tr",{children:n.map(h=>fe("th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:L("div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),L("tbody",{ref:b,children:r.map(h=>fe(or,{children:[L("tr",{ref:T,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(i?.(h)),children:n.map(R=>R.rowHeader===!0?fe("th",{scope:"row","data-cui-align":R.align,children:[R.cell(h),R.rowHeaderNote===void 0?null:cr(R.rowHeaderNote(h))]},R.key):L("td",{"data-cui-align":R.align,children:R.cell(h)},R.key))}),s===void 0?null:pr(s,h,n.length,o,T)]},a(h)))})]})})})};import{jsx as Ge,jsxs as mr}from"react/jsx-runtime";var fr=({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 Ge("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>mr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ge("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ge("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Ft,useLayoutEffect as Dt,useRef as Ve}from"react";import{jsx as ae,jsxs as Ot}from"react/jsx-runtime";var Ht=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},gr=(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},br=(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")},hr=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:i})=>{let{labels:l}=k(),s=Ft(),u=Ft(),p=Ve(null),d=Ve(null),c=Ve(!1);return Dt(()=>{let m=p.current;if(n&&!m.open){let E=a===void 0?null:gr(m,a.current);d.current=m.ownerDocument.activeElement,m.showModal(),E!==null&&br(m,E)}else!n&&m.open&&m.close()},[n,a]),Dt(()=>{let m=p.current;return()=>{m.open&&(m.close(),Ht(d.current),d.current=null)}},[]),Ot("dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:p,onClose:m=>{m.currentTarget.open||(Ht(d.current),d.current=null,n&&r())},onCancel:m=>{let E=c.current;c.current=!1,(E||He(m.currentTarget.ownerDocument.activeElement))&&m.preventDefault()},onKeyDownCapture:m=>{c.current=Oe(m)},onKeyUpCapture:()=>{c.current=!1},children:[Ot("div",{className:"cui-dialog-header",children:[ae("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),ae("div",{className:"cui-dialog-actions",children:ae(A,{variant:"secondary",testId:`${o}-close`,onClick:()=>p.current?.close(),children:l.close})})]}),t===void 0?null:ae("div",{id:u,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),i,ae("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ae]:"","data-testid":`${o}-announcer`})]})};import{useId as Rr,useRef as Tr}from"react";import{jsx as We,jsxs as Kt}from"react/jsx-runtime";var Er=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Rr(),i=Tr(null);return H(i,{testId:r,part:"summary",host:"button"}),Kt("div",{className:"cui-disclosure","data-testid":r,children:[Kt("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:[We("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),We("span",{ref:i,children:e})]}),We("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{useId as j}from"react";import{Fragment as Mr,jsx as v,jsxs as $}from"react/jsx-runtime";var xr=/\s/,ze=e=>{if(e!==void 0&&(typeof e!="string"||e===""||xr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Ut=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},Y=({description:e,error:t,errorId:n})=>{g();let r=j(),a=j(),o=j(),i=n===void 0?o:Fe(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:i].filter(u=>u!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Z=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>$(Mr,{children:[e===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:v(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),me=({htmlFor:e,hidden:t,children:n})=>v("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),vr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:i,descriptionId:l,errorId:s}=Y({label:e,description:t,error:n,errorId:r});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[v(me,{htmlFor:i.id,hidden:void 0,children:e}),o(i),v(Z,{description:t,error:n,descriptionId:l,errorId:s,testId:a})]})},Bt=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:i,name:l,maxLength:s,list:u,autoComplete:p,inputMode:d,prefix:c,labelHidden:b,required:f,testId:y,ref:T})=>{let{control:m,descriptionId:E,errorId:h}=Y({label:e,description:t,error:n,errorId:r}),R=j();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(s!==void 0&&i==="datetime-local")throw new RangeError(`A ${i} input takes no maxLength: ${s}`);let x=i==="password",M=v("input",{className:"cui-input",type:i,name:ze(l),maxLength:Ut(s),value:a,list:u,autoComplete:p,inputMode:d,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:f,onChange:K=>o(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:T,...m,"aria-describedby":B(c===void 0?void 0:R,m["aria-describedby"])});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[v(me,{htmlFor:m.id,hidden:b,children:e}),c===void 0?M:$("div",{className:"cui-input-group",children:[v("span",{className:"cui-input-prefix",id:R,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${y}-prefix`,children:c}),M]}),v(Z,{description:t,error:n,descriptionId:E,errorId:h,testId:y})]})},wr=e=>v(Bt,{...e}),Pr=e=>v(Bt,{...e,type:"password"}),Cr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:i,maxLength:l,required:s,testId:u,ref:p})=>{let{control:d,descriptionId:c,errorId:b}=Y({label:e,description:t,error:n,errorId:r});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${u}-field`,children:[v(me,{htmlFor:d.id,hidden:void 0,children:e}),v("textarea",{className:"cui-input cui-textarea",name:ze(i),maxLength:Ut(l),value:a,required:s,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":u,ref:p,...d}),v(Z,{description:t,error:n,descriptionId:c,errorId:b,testId:u})]})},Nr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,name:l,labelHidden:s,unavailable:u,testId:p,ref:d})=>{let{control:c,descriptionId:b,errorId:f}=Y({label:e,description:t,error:n,errorId:r}),y=j(),T=J(u,y);return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[v(me,{htmlFor:c.id,hidden:s,children:e}),v("select",{className:"cui-input",name:ze(l),value:a,onChange:m=>{u===void 0&&i(m.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:d,...c,"aria-disabled":u===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],T),children:o.map(m=>v("option",{value:m.value,children:m.label},m.value))}),v(Z,{description:t,error:n,descriptionId:b,errorId:f,testId:p}),u?.reason===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:y,testId:`${p}-reason`,children:u.reason})]})},kr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,testId:l,ref:s})=>{let u=j(),{control:p,descriptionId:d,errorId:c}=Y({label:e,description:t,error:n,errorId:r});return $("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>$("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:u,value:b.value,checked:b.value===a,onChange:()=>i(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?s:void 0}),v("span",{children:b.label})]},b.value)),v(Z,{description:t,error:n,descriptionId:d,errorId:c,testId:l})]})},Lr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:i,testId:l,ref:s})=>{let{control:u,descriptionId:p,errorId:d}=Y({label:e,description:t,error:n,errorId:r}),c=o.map(y=>y.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(y=>!c.includes(y));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return $("fieldset",{className:"cui-checkbox-group","aria-describedby":u["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[v("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((y,T)=>$("label",{className:"cui-checkbox","data-cui-type":"body",children:[v("input",{type:"checkbox",value:y.value,checked:f.has(y.value),onChange:()=>i(c.filter(m=>m===y.value?!f.has(m):f.has(m))),"aria-invalid":u["aria-invalid"],"data-testid":`${l}-option-${y.value}`,ref:T===0?s:void 0}),v("span",{children:y.label})]},y.value)),v(Z,{description:t,error:n,descriptionId:p,errorId:d,testId:l})]})};import{createContext as Sr,useContext as Ir,useId as Wt,useMemo as $r}from"react";import{Fragment as jt,jsx as C,jsxs as ge}from"react/jsx-runtime";var zt=Sr(null),_t="surface",qt={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"}},Gt={face:"info-tint",line:"info-accent"},Jt={normal:"border-control",high:"info-accent"},Ar=["normal","high"],Fr=[1,2,3,4],F=S.space["space-2"],Dr="fg",Hr="fg-secondary",Xt=e=>{let t=Ir(zt);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Je=(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}`)},Or=e=>{g();let t=Wt(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:i,children:l}=e;Je(o,"widthPx",r),Je(o,"heightPx",a);let s=$r(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),u=ge(jt,{children:[C("defs",{children:Ar.map(b=>C("marker",{id:s.arrowIds[b],viewBox:`0 0 ${F} ${F}`,refX:F,refY:F/2,markerWidth:F,markerHeight:F,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:C("path",{d:`M 0 0 L ${F} ${F/2} L 0 ${F} z`,"data-cui-stroke":Jt[b],"data-testid":`${o}-arrow-${b}`})},b))}),C(zt.Provider,{value:s,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!D(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return C("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:C("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":_t,"data-cui-face":"sans",style:{"--cui-figure-inline":I(r),"--cui-figure-block":I(a)},onKeyDown:f===void 0?void 0:y=>_(y,f),"data-testid":o,...w(i),children:u})})}let{viewBox:p,pointer:d,svgRef:c}=e;return C("div",{className:"cui-container","data-testid":`${o}-frame`,children:C("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":_t,"data-cui-face":"sans","data-cui-pan":d===void 0?void 0:"true","data-cui-cursor":d?.cursor,style:{"--cui-figure-inline":I(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(i),...d?.handlers,children:u})})},Vt=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},Kr=(e,t,n)=>{for(let r of t){let a=Rt.light[r.fg],o=n.find(i=>a[i]===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`)}},Ur=e=>{g();let t=Xt("FigureNode"),n=Wt(),{x:r,y:a,shape:o,tone:i,outline:l,selected:s,name:u,title:p,press:d,testId:c,dataAttributes:b}=e,f=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"&&d===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&d!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(d!==void 0&&!D(d.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(d.label)}`);let y=s?Gt:qt[i];Kr(c,f,[qt[i].face,Gt.face]);let T,m,E;if(o.kind==="box"){if(u===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 R=Vt(c,()=>lt({name:u,notes:f.map(M=>M.text)}));if(Je(c,"a box's widthPx",o.widthPx),o.widthPx<R.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${R.minWidthPx} px)`);T={width:o.widthPx,height:R.heightPx,left:r,top:a};let x=ut(f.length);m=ge("g",{"data-cui-surface":y.face,children:[C("rect",{className:"cui-figure-plate",width:o.widthPx,height:R.heightPx,rx:S.radius["radius-item"],"data-cui-fill":y.face,"data-cui-stroke":y.line,"data-testid":`${c}-plate`}),C("text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:S.type.body.size,"data-cui-fg":Dr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:u}),f.map((M,K)=>C("text",{x:x.insetPx,y:x.notesPx[K],fontSize:S.type.caption.size,"data-cui-fg":M.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:M.text},K))]}),E=C("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:R.heightPx+2*U,rx:S.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let R=Vt(c,()=>ct(u,o.radiusPx));T={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},m=ge(jt,{children:[C("g",{"data-cui-surface":y.face,children:C("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":y.face,"data-cui-stroke":y.line,"data-testid":`${c}-plate`})}),u===null?null:C("text",{className:"cui-figure-label",x:0,y:R.extentBelowPx-S.type.caption.lineHeight/2,fontSize:S.type.caption.size,"data-cui-fg":Hr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:u})]}),E=C("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(d!==void 0){if(T.width<W||T.height<W)throw new RangeError(`${c}: a pressable node must be at least the ${W} px target: ${T.width} \xD7 ${T.height}`);if(T.left<z||T.top<z||T.left+T.width+z>t.widthPx||T.top+T.height+z>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${z} px to the figure's edge for its focus ring`)}let h=d===void 0?{}:{role:"button",tabIndex:0,"aria-label":d.label,"aria-describedby":d.description===void 0?void 0:n,"aria-expanded":d.expanded,"aria-controls":d.expanded?d.controls:void 0,onClick:R=>{R.currentTarget.focus(),d.onPress()},onKeyDown:R=>{R.key!=="Enter"&&R.key!==" "||(R.preventDefault(),R.repeat||d.onPress())}};return ge("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":i,"data-cui-outline":l,"data-selected":String(s),...h,"data-testid":c,...w(b),children:[p===void 0?null:C("title",{children:p}),d?.description===void 0?null:C("desc",{id:n,"data-testid":`${c}-description`,children:d.description}),d===void 0?null:E,m]})},Br=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:i})=>{g();let l=Xt("FigureEdge");if(!Fr.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return C("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":Jt[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(i),children:a===void 0?null:C("title",{children:a})})};import{jsx as Gr}from"react/jsx-runtime";var _r={1:"h1",2:"h2",3:"h3"},qr=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=_r[e];return Gr(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})};import{jsx as zr}from"react/jsx-runtime";var Vr={removed:"danger-tint",added:"success-tint"},Wr=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return zr(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":Vr[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as jr}from"react/jsx-runtime";var Jr={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"}},Xr={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Xe=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?Jr[e]:{fg:"on-solid",surface:Xr[e]};return jr("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})};import{useId as Yr}from"react";import{jsx as ie,jsxs as Zr}from"react/jsx-runtime";var je=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=Yr();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 i=r===null?null:{max:r,now:Math.min(n,r)};return Zr("div",{className:"cui-progress","data-testid":a,children:[ie(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),ie("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":i?.max,"aria-valuenow":i?.now,"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:ie("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),ie("div",{"aria-hidden":"true",children:ie(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as be,jsxs as Yt}from"react/jsx-runtime";var Qr=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>Yt(Ke,{title:e,actions:r===void 0?void 0:be(A,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[Yt("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[be("span",{className:"cui-visually-hidden",children:`${e} `}),be(Xe,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:be(je,{...n,testId:`${a}-progress`}),o]});import{createContext as eo,useContext as to}from"react";import{jsx as se}from"react/jsx-runtime";var Ye=eo(null),no="space-2",ro=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:i}=e;if(n!==void 0&&!D(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,s=l!==void 0,u=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return se(Ye.Provider,{value:e.marker,children:se(u,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?no:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:i})})},oo=({testId:e,dataAttributes:t,children:n})=>{g();let r=to(Ye);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return se("li",{className:"cui-list-item","data-testid":e,...w(t),children:se("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:se(Ye.Provider,{value:null,children:n})})})};import{useCallback as Qt,useLayoutEffect as io,useRef as he}from"react";import{jsx as Zt}from"react/jsx-runtime";var ao=({tone:e,testId:t,children:n})=>(g(),Zt("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})),de=({occurrence:e,testId:t,children:n})=>(g(),Zt("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));import{jsx as Re,jsxs as co}from"react/jsx-runtime";var en=e=>[...e.querySelectorAll(re)].filter(t=>{let n=t.closest(Ue);return n===null||!e.contains(n)}),so=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=en(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${re} elements for ${e.count} rows`);return n},lo=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},uo=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:i})=>{let{formatLocale:l,labels:s}=k(),u=he(null),p=he(null),d=he(null),c=he(!1),b=()=>{let m=o.ref.current;u.current={shown:new Set(m===null?[]:en(m)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};io(()=>{let m=c.current;c.current=!1;let E=u.current;if(E===null)return;let h=so(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let R=lo(h,E.shown),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||R!==void 0||x||n)||(u.current=null,x||R===void 0))return;let M=[null,document.body].includes(document.activeElement);(d.current!==null&&document.activeElement===d.current||m&&M)&&R.focus()});let f=oe(()=>n?p.current:d.current),y=Qt((m=>{d.current=m;let E=f(m);return()=>{d.current=null,c.current=m===document.activeElement,E()}}),[f]),T=Qt((m=>{p.current=m;let E=f(m);return()=>{p.current=null,E()}}),[f]);return n?Re("div",{className:"cui-load-more","data-testid":i,children:Re(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:T,testId:`${i}-end`,children:s.endOfRecords})}):co("div",{className:"cui-load-more","data-testid":i,children:[Re(A,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:b,ref:y,testId:`${i}-button`,children:s.loadMore(ue(a,l))}),r===null?null:Re(de,{occurrence:r.occurrence,testId:`${i}-failure`,children:s.loadFailed(r.reason)})]})};import{jsx as Ze,jsxs as tn}from"react/jsx-runtime";var po=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=pt({masterMinPx:n,detailMinPx:r,gapPx:S.space["space-6"]});return tn("div",{className:"cui-container","data-testid":a,children:[Ze(X,{ruleKey:o.key,css:o.css}),tn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[Ze("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),Ze("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Te}from"react/jsx-runtime";var Ee=e=>{let{formatLocale:t,labels:n}=k(),{testId:r}=e;if(e.keep===void 0){let{value:i,unit:l}=e;if(l!==void 0&&!D(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(i===null)return Te("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let s=ue(i,t);return Te("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:at(s,l)})}let{text:a,keep:o}=e;if(a===null)return Te("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!D(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 Te("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as xe,jsxs as fo}from"react/jsx-runtime";var yo=({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 fo("span",{className:"cui-meter","data-testid":o,children:[xe("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:xe("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),xe("span",{"aria-hidden":"true",children:xe(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as mo,useRef as go}from"react";import{jsx as Qe,jsxs as Ro}from"react/jsx-runtime";var bo={ArrowLeft:-1,ArrowRight:1},ho=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:i})=>{g();let l=mo(),s=go(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let u=t.map(y=>y.id);if(new Set(u).size!==u.length)throw new RangeError(`Tab keys must be unique: ${u.join(", ")}`);let p=u.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${u.join(", ")}`);let d=y=>`${l}-tab-${y}`,c=`${l}-panel`,b=y=>{let T=t[y];T.id!==n&&r(T.id),s.current.get(T.id)?.focus()};return Ro("div",{className:"cui-panel-tabs","data-testid":a,children:[Qe("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:y=>{let T=t.findIndex(R=>s.current.get(R.id)===y.target),m=T<0?p:T,E=bo[y.key],h;if(E!==void 0){let R=getComputedStyle(y.currentTarget).direction==="rtl"?-E:E;h=(m+R+t.length)%t.length}else if(y.key==="Home")h=0;else if(y.key==="End")h=t.length-1;else return;y.preventDefault(),b(h)},children:t.map((y,T)=>{let m=T===p;return Qe("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:d(T),"aria-selected":m,"aria-controls":c,tabIndex:m?0:-1,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${y.id}`,ref:E=>{E===null?s.current.delete(y.id):s.current.set(y.id,E)},onClick:()=>b(T),children:y.label},y.id)})}),Qe("div",{role:"tabpanel",id:c,"aria-labelledby":d(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};import{jsx as nn,jsxs as Eo}from"react/jsx-runtime";var To=({failure:e,onReload:t,forbiddenMessage:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:i}=k();return Eo("div",{className:"cui-resource-failed","data-testid":o,children:[nn(de,{occurrence:e.occurrence,testId:`${o}-alert`,children:i.failureSentence(e,n,r===void 0?i.loadFailed:r)}),e.status===403?null:nn(A,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};import{jsx as et,jsxs as vo}from"react/jsx-runtime";var xo=({label:e,options:t,value:n,onValueChange:r,testId:a})=>{g();let o=new Set(t.map(i=>i.value));if(t.length<2||o.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!o.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...o].join(", ")}`);return vo("fieldset",{className:"cui-segmented-group","data-testid":a,children:[et("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),et("div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return et("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||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as wo,useRef as Po}from"react";import{jsx as Q}from"react/jsx-runtime";var rn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,children:i})=>{g();let l=Po(null);H(l,{testId:r,part:"row",host:"button"});let s=wo(p=>{if(l.current=p,typeof o=="function")return o(p);o!=null&&(o.current=p)},[o]);return Q("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:s,...w(a),children:i})},Co=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:i,rowTestId:l,rowData:s,empty:u,testId:p,ref:d})=>(g(),Q("div",{className:"cui-selectable","data-testid":p,ref:d,children:t.length===0?Q(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):Q("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return Q("li",{children:Q(rn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:s?.(c),children:i(c)})},b)})})}));import{useId as No}from"react";import{jsx as ve,jsxs as on}from"react/jsx-runtime";var ko=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:i,testId:l})=>{g();let s=No();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 u=o(t);return on("div",{className:"cui-field","data-testid":`${l}-field`,children:[ve("label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),on("div",{className:"cui-slider",children:[ve("input",{className:"cui-slider-input",id:s,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":u,"data-testid":l,onChange:p=>i(p.currentTarget.valueAsNumber)}),ve("span",{className:"cui-slider-value","aria-hidden":"true",children:ve(P,{fg:"fg",type:"body",testId:`${l}-value`,children:u})})]})]})};import{jsx as an}from"react/jsx-runtime";var Lo=({gap:e,testId:t,children:n})=>(g(),an("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Mo=({gap:e,as:t="div",testId:n,children:r})=>(g(),an(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as tt,jsxs as dn}from"react/jsx-runtime";var sn={done:0,current:1,pending:2},So={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Io=({label:e,steps:t,testId:n})=>{let{labels:r}=k();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,i)=>i>0&&sn[o.state]<sn[t[i-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 tt("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,i)=>{let l=So[o.state],s=a[o.state];return dn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[tt("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":i+1}),dn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:tt("span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};import{useId as $o,useRef as Ao}from"react";import{jsx as we,jsxs as ln}from"react/jsx-runtime";var Fo=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:i,dataAttributes:l})=>{g();let s=$o(),u=Ao(null);H(u,{testId:o,part:"label",host:"button"});let p=J(a,s),d=a!==void 0,c=ln("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":d?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{d||r(!n)},...w(l),children:[we("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:we("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),we("span",{className:t===!0?"cui-visually-hidden":void 0,ref:u,children:e})]});return a?.reason===void 0?c:ln("span",{className:"cui-button-group",children:[c,we(P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as Do,useEffect as Ho,useId as Oo,useRef as un,useState as Ko}from"react";import{jsx as le,jsxs as cn}from"react/jsx-runtime";var Uo=({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 i=new Set(t.map(f=>f.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...i].join(", ")}`);let[s,u]=Ko(!1),p=un(null),d=un(null),c=Oo(),b=Do(f=>{u(!1),f&&p.current?.contains(document.activeElement)&&d.current?.focus()},[]);return Ho(()=>{if(!(o&&s))return;let f=y=>{p.current!==null&&!p.current.contains(y.target)&&b(!0)};return document.addEventListener("pointerdown",f,!0),()=>document.removeEventListener("pointerdown",f,!0)},[o,s,b]),cn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>_(f,()=>b(!0)):void 0,children:[o?cn("button",{ref:d,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>u(f=>!f),children:[le("span",{className:"cui-tabs-summary-label",children:l.label}),le("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,le("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let y=f.id===n;return le("li",{className:"cui-tabs-item",children:le("a",{className:"cui-tab",href:f.href,"aria-current":y?"page":void 0,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:T=>{pe(T,f.href,r),T.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};import{Children as Bo,Fragment as _o,isValidElement as qo}from"react";import{jsx as V,jsxs as yn}from"react/jsx-runtime";var Go={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Vo=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 yn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[V("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),V("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),V("p",{className:"cui-tile-value","data-cui-fg":Go[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?V(Ee,{value:e.value,unit:e.unit,testId:l}):V(Ee,{text:e.text,keep:"wrap",testId:l})})]})},pn=e=>Bo.toArray(e).flatMap(t=>{if(!qo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_o?pn(t.props.children):[t]}),Wo=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=ft(e,t,S.space["space-2"]),o=pn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return yn("div",{className:"cui-container","data-testid":n,children:[V(X,{ruleKey:a.key,css:a.css}),V("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as zo,useRef as fn}from"react";import{jsx as Xo}from"react/jsx-runtime";var Pe=e=>[...e.querySelectorAll("button")],Jo=({label:e,testId:t,children:n})=>{g();let r=fn(null),a=fn(null);zo(()=>{let s=Pe(r.current),u=a.current!==null&&s.includes(a.current)?a.current:s[0]??null;a.current=u;for(let p of s)p.tabIndex=p===u?0:-1});let o=s=>{for(let u of Pe(r.current))u.tabIndex=u===s?0:-1;a.current=s};return Xo("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:s=>{let u=Pe(s.currentTarget).find(p=>p.contains(s.target));u!==void 0&&o(u)},onKeyDown:s=>{let u=Pe(s.currentTarget),p=u.indexOf(s.target);if(p===-1)return;let d=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=d==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[d]:(p+1)%u.length,[c]:(p-1+u.length)%u.length,Home:0,End:u.length-1}[s.key];if(f===void 0)return;s.preventDefault();let y=u[f];o(y),y.focus()},children:n})};import{useCallback as ee,useEffect as Zo,useLayoutEffect as gn,useRef as ot}from"react";import{useCallback as Ce,useEffect as jo,useLayoutEffect as Yo,useRef as nt,useState as rt}from"react";var mn=e=>e===null?ke:Le,Ne=(e,t,n,r,a)=>{let[o,i]=rt(()=>({key:e,state:mn(e)})),[l,s]=rt(0),[u,p]=rt(0),d=nt(t),c=nt(null),b=nt(l);Yo(()=>{d.current=t}),jo(()=>{if(e===null){i({key:null,state:ke});return}let h=new AbortController;c.current=e;let R=l===b.current?"revision":"reload";return b.current=l,i(x=>Object.is(x.key,e)?{key:e,state:r(x.state,R)}:{key:e,state:Le}),d.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,i(M=>({key:e,state:a(M.state,x)})))},x=>{h.signal.aborted||i(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,u]);let f=Ce(()=>s(h=>h+1),[]),y=Ce(()=>p(h=>h+1),[]),T=Ce((h,R)=>{i(x=>Object.is(x.key,h)?{key:h,state:R(x.state)}:x)},[]),m=Ce((h,R)=>{T(h,R),Object.is(c.current,h)&&y()},[T,y]);return{state:Object.is(o.key,e)?o.state:mn(e),reload:f,refresh:y,update:T,write:m}};var Qo=(e,t,n)=>{let r=ot(t);gn(()=>{r.current=t});let a=ee(m=>r.current.first(m),[]),{state:o,reload:i,refresh:l,update:s,write:u}=Ne(e,a,n,mt,gt),p=ot({key:e,state:o});gn(()=>{p.current={key:e,state:o}});let d=ot(null),c=ee(()=>{d.current?.controller.abort(),d.current=null},[]);Zo(()=>c,[e,n,c]);let b=ee(()=>{c(),i()},[c,i]),f=ee(()=>{c(),l()},[c,l]),y=ee(()=>{let{key:m,state:E}=p.current;if(m===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 h=E.value.next,R={key:m,controller:new AbortController,maps:[]};d.current=R,s(m,bt),r.current.next(h,R.controller.signal).then(x=>{d.current===R&&(d.current=null,s(m,M=>R.maps.reduce((K,bn)=>Ie(K,bn),ht(M,h,x))))},x=>{d.current===R&&s(m,()=>{throw x})})},[s]),T=ee((m,E)=>{let h=d.current;h!==null&&Object.is(h.key,m)&&h.maps.push(E),u(m,R=>Ie(R,E))},[u]);return{state:o,reload:b,refresh:f,loadMore:y,updateList:T}};import{useCallback as ea,useRef as ta,useState as na}from"react";var ra=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",oa=()=>{let[e,t]=na(null),n=ta(null),r=ea((a,o)=>{let i=o();if(!ra(i))return;let l=Symbol(a);n.current=l,t(a);let s=()=>{n.current===l&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:r}};import{useCallback as aa}from"react";var ia=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:i}=Ne(e,t,n,it,Me),l=aa((s,u)=>i(s,p=>Me(p,{ok:!0,value:u})),[i]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as da}from"react/jsx-runtime";var sa=({testId:e,children:t})=>(g(),da("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,de as AlertMessage,Mn as Breadcrumb,A as Button,dt as COMPACT_ROW_PX,Ta as CONSOLE_UI_LABEL_CATALOGS,Ua as CONTRAST_MINIMUM,Rt as CONTRAST_PAIRS,Ke as Card,Jn as CardSection,Lr as CheckboxGroup,Mo as Cluster,jn as CodeBlock,Qn as ComparisonGrid,Nn as ConsoleUiRoot,yr as DataTable,fr as DescriptionList,hr as Dialog,Er as Disclosure,z as FIGURE_RING_REACH_PX,La as FLEXIBLE_COLUMN_MIN_PX,vr as Field,Or as Figure,Br as FigureEdge,Ur as FigureNode,Bn as FragmentLink,hn as HTTP_FORBIDDEN,qr as Heading,Wr as InlineChange,Qr as JobCard,Se as LATTICE_PX,Kn as Link,ro as List,oo as ListItem,uo as LoadMore,po as MasterDetail,Ee as Measured,yo as Meter,Vo as MetricTile,ao as Notice,ho as PanelTabs,Pr as PasswordInput,Xe as Pill,je as ProgressBar,xa as ROW_WITH_CONTROL_PX,kr as RadioGroup,To as ResourceFailed,rn as RowButton,xo as SegmentedControl,Nr as Select,Co as SelectableList,ko as Slider,Lo as Stack,Io as Stepper,Fo as Switch,W as TARGET_PX,S as TOKENS,Va as TONES,qa as TONE_HUES,Ga as TONE_ROLES,Uo as Tabs,P as Text,Cr as TextArea,wr as TextInput,Wo as TileGrid,Jo as Toolbar,sa as VisuallyHidden,pa as ZonedTimeError,bt as beginPage,mt as beginPagedReload,it as beginReload,Ca as ceil8,Ea as ceilToLattice,Na as cellContentInlinePx,Ma as comparisonAttributePx,Ka as contrastRatio,Ia as countSampleText,va as cssVar,lt as figureBoxPlan,ct as figureDiscLabelPlan,ga as fillLabel,ka as fixedColumnPx,ha as flatMapOutcome,la as formatByteSize,ue as formatCount,ma as formatInstant,Fa as goldenSectionPx,Oa as hexToSrgb,Sa as instantSampleText,D as isReadableText,Me as keepLastGood,Ba as lightDark,ba as mapOutcome,Ie as mapPagedList,Da as masterDetailPlan,Pa as monoTextWidthEm,_a as placeholderRule,I as pxToRem,ua as readDecimalText,ca as readIntegerText,Ra as reasonAside,st as resolveConsoleUiLabels,gt as settleFirstPage,ht as settlePage,Aa as spacedTextWidthEm,Ha as tableFrameMinInlinePx,yt as tableMinInlinePx,wa as textWidthEm,ft as tileGridPlan,$a as tileMinInlinePx,ya as toOffsetIso,fa as toWallTime,kn as useAnnounce,k as useConsoleUi,Wn as useEscapeToClose,oe as useFocusRescue,Qo as usePagedResource,oa as usePendingPress,ia as useResource};
|
|
1
|
+
import{$ as xt,A as _a,B as qa,C as Ga,D as Va,E as Wa,F as za,G as yt,H as ft,I as mt,J as z,K as U,L as Ja,M as F,N as Xa,O as gt,P as bt,Q as ja,R as ht,S as Ya,T as Za,U as Qa,V as Me,W as Ie,X as Rt,Y as Fe,Z as Tt,_ as Et,a as ue,aa as vt,b as wa,ba as $e,c as ut,ca as ri,d as Pa,da as oi,e as Na,ea as ai,f as D,fa as ii,g as Ca,ga as si,h as ka,i as La,j as Sa,k as Ma,l as Ia,m as Fa,n as ct,o as Se,p as $a,q as W,r as Aa,s as pt,t as M,u as Da,v as Ha,w as Oa,x as Ka,y as Ua,z as Ba}from"./chunk-H4DAGEIG.js";import{a as ei,b as ti,c as ni,d as wt}from"./chunk-FXEGLGL7.js";import{useEffect as Jn,useRef as Xn}from"react";import{useId as Un,useRef as Bn}from"react";import{createContext as wn,useCallback as Pn,useContext as St,useLayoutEffect as Nn,useMemo as Pt,useRef as Nt}from"react";import{jsx as Lt,jsxs as $n}from"react/jsx-runtime";var Ae=wn(null),Mt=" ",Ct='[inert], [aria-hidden="true" i]',It="dialog:modal",De="data-cui-dialog-announcer",Cn=`:scope > [${De}]`,kn=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(s=>s.contains(o)),r=a.length>0?a:n;if(r.every(s=>s.contains(e)))return{region:e};let i=r.find(s=>r.every(u=>u.contains(s)));if(i===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=i.querySelector(Cn);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}},Ln=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}},ce=150,Sn=1e3,kt=new WeakMap,Mn=(e,t)=>{let n=kt.get(e)??new Set,o={text:t};kt.set(e,n.add(o)),setTimeout(()=>n.delete(o),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(r=>r.text).join(Mt),e.replaceChildren(a)},In=({locale:e,formatLocale:t,timeZone:n,accessFailure:o,testId:a,children:r})=>{if(St(Ae)!==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=ct(e),[s]=Intl.getCanonicalLocales(t),u=Pt(()=>new Intl.DateTimeFormat(s,{timeZone:n}).resolvedOptions().timeZone,[s,n]),p=Nt(null),l=Nt(null);Nn(()=>{Ln(p.current.ownerDocument)},[]);let c=Pn(m=>{if(m.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:y,settle:E,deadline:R}=l.current;l.current=null,clearTimeout(E),clearTimeout(R);let T=p.current;if(T===null)return;let x=y.join(Mt),k=kn(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: ${x}`);Mn(k.region,x)},h=l.current;if(h===null){l.current={texts:[m],settle:setTimeout(f,ce),deadline:setTimeout(f,Sn)};return}h.texts.push(m),clearTimeout(h.settle),h.settle=setTimeout(f,ce)},[]),b=Pt(()=>({locale:e,formatLocale:s,timeZone:u,labels:d,announce:c,accessFailure:o}),[e,s,u,d,c,o]);return Lt(Ae.Provider,{value:b,children:$n("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":a,children:[r,Lt("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-announcer`,ref:p})]})})},C=()=>{let e=St(Ae);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{C()},He=()=>C().announce,Fn=()=>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 pe=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};import{useLayoutEffect as An}from"react";var Dn=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"]),Hn=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!Dn.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:o})=>{An(()=>{let a=Hn(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}>`)})};import{jsx as On}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:o="span",space:a,testId:r,id:i,tabIndex:d,ref:s,children:u})=>(g(),On(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:i,tabIndex:d,ref:s,children:u}));var Kn=/\s/,Oe=(e,t)=>{if(e===""||Kn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},J=(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 Oe(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(" ")};import{jsx as O,jsxs as Wn}from"react/jsx-runtime";var _n={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"}},Ke=({subject:e,children:t})=>{let n=Bn(null);return H(n,e),O("span",{ref:n,children:t})},I=({variant:e,children:t,testId:n,type:o="button",onClick:a,unavailable:r,describedBy:i,expanded:d,controls:s,ref:u,dataAttributes:p,busy:l,busyLabel:c})=>{g();let b=Un(),m=J(r,b),f=l===!0||r!==void 0,h=_n[e],y=E=>{if(pe(E),f){E.preventDefault();return}a?.(E)};return Wn("span",{className:"cui-button-group",children:[O("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":l===!0?!0:void 0,"aria-describedby":B(i,m),"aria-expanded":d,"aria-controls":s,onClick:y,ref:u,...w(p),children:O(Ke,{subject:{testId:n,part:"label",host:"button"},children:l===!0?c:t})}),r?.reason===void 0?null:O(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:r.reason})]})},qn=({onNavigate:e,children:t,testId:n,ref:o})=>(g(),O("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:o,children:O(Ke,{subject:{testId:n,part:"label",host:"button"},children:t})})),Gn=/^[^\s#]+$/,Vn=({targetId:e,children:t,testId:n,onFollow:o,dataAttributes:a})=>{if(g(),!Gn.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return O("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:o,...w(a),children:O(Ke,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{jsx as Ft}from"react/jsx-runtime";var zn=({gap:e,testId:t,children:n})=>(g(),Ft("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Ue=({gap:e,as:t="div",testId:n,children:o})=>(g(),Ft(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:o}));import{jsx as ye,jsxs as $t}from"react/jsx-runtime";var jn=new Set(["sign-in","sign-in-again","sign-in-again-in-new-window"]),Yn=" ",Zn=({view:e,handlers:t,testId:n})=>{let o=He(),a=e.actions.map(({action:d,label:s})=>{let u=t[d];if(u===void 0)throw new TypeError(`AccessFailureNotice: no handler for the action ${JSON.stringify(d)}`);return{action:d,label:s,handler:u}}),r=e.politeness==="status"?[e.title,...e.sentences].join(Yn):null,i=Xn(null);return Jn(()=>{r===null||i.current===r||(i.current=r,o(r))},[o,r]),$t("div",{className:"cui-access-failure","data-cui-access-failure":e.kind,"data-testid":n,children:[$t("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:[ye("p",{className:"cui-access-failure-title","data-cui-measure":"reading","data-testid":`${n}-title`,children:e.title}),e.sentences.map(d=>ye("p",{className:"cui-access-failure-sentence","data-cui-measure":"reading",children:d},d))]}),a.length===0?null:ye(Ue,{gap:"space-2",testId:`${n}-actions`,children:a.map(({action:d,label:s,handler:u})=>ye(I,{variant:jn.has(d)?"primary":"secondary",onClick:u,testId:`${n}-${d}`,children:s},d))})]})};var fe=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as te,jsxs as At}from"react/jsx-runtime";var Qn=({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 te("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":o,children:At("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(r=>At("li",{className:"cui-breadcrumb-item",children:[te("a",{className:"cui-link",href:r.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${o}-${r.id}`,onClick:i=>fe(i,r.href,n),children:r.label}),te("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},r.id)),te("li",{className:"cui-breadcrumb-item",children:te("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${o}-current`,children:t})})]})})};import{useId as Dt}from"react";import{useCallback as er}from"react";var tr=229,nr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),me=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&nr.has(e.type)&&(e.value!==""||e.validity.badInput),Be=e=>e.nativeEvent.isComposing||e.keyCode===tr,_=(e,t)=>{e.key!=="Escape"||Be(e)||me(e.target)||(e.stopPropagation(),t())},rr=e=>er(t=>_(t,e),[e]);import{Fragment as ir,jsx as q,jsxs as ne}from"react/jsx-runtime";var Ht=e=>e===void 0?void 0:t=>_(t,e),_e=({id:e,title:t,description:n,actions:o,onEscape:a,testId:r,headingRef:i,ref:d,dataAttributes:s,children:u})=>{g();let p=Dt(),l=Ht(a);return ne("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:l,...w(s),children:[ne("div",{className:"cui-card-header",children:[ne("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${r}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),o===void 0?null:q("div",{className:"cui-card-actions",children:o})]}),u]})},or={3:"h3",4:"h4"},ar=({id:e,title:t,subtitle:n,level:o=3,region:a=!1,onEscape:r,testId:i,headingRef:d,ref:s,dataAttributes:u,children:p})=>{g();let l=Dt(),c=Ht(r),b=or[o],m=ne(ir,{children:[ne("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:l,"data-cui-type":"body","data-testid":`${i}-heading`,ref:d,tabIndex:d===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":l,"data-testid":i,ref:s,onKeyDown:c,...w(u),children:m}):q("div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(u),children:m})};import{jsx as Ot}from"react/jsx-runtime";var sr=({label:e,code:t,testId:n})=>(g(),Ot("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:Ot("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as lr}from"react";import{jsx as dr}from"react/jsx-runtime";var X=({ruleKey:e,css:t})=>dr("style",{href:e,precedence:"cui",children:t});import{jsx as L,jsxs as G}from"react/jsx-runtime";var ur=({caption:e,attributes:t,columns:n,attributePx:o,columnMinPx:a,testId:r})=>{g();let i=lr();for(let l of[o,a])if(!(Number.isFinite(l)&&l>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${l}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let l of n)for(let c of t)if(!Object.hasOwn(l.cells,c.key))throw new RangeError(`Column "${l.key}" has no value for attribute "${c.key}"`);let d=o+n.length*a,s=`cui-comparison-a${o}-c${a}-n${n.length}`,u=l=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${l}"]`,p=`${u("table")}{display:none}@container (min-width:${F(d)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":r,children:[L(X,{ruleKey:s,css:p}),L("div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[L("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[L("col",{style:{width:F(o)}}),n.map(l=>L("col",{},l.key))]}),L("thead",{children:G("tr",{children:[L("td",{}),n.map(l=>L("th",{scope:"col",children:l.heading},l.key))]})}),L("tbody",{children:t.map(l=>G("tr",{children:[L("th",{scope:"row",children:l.label}),n.map(c=>L("td",{children:c.cells[l.key]("table")},c.key))]},l.key))})]})}),L("div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((l,c)=>{let b=`${i}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[L("div",{className:"cui-comparison-heading",id:b,children:l.heading}),L("dl",{className:"cui-comparison-list",children:t.map(m=>G("div",{children:[L("dt",{children:m.label}),L("dd",{children:l.cells[m.key]("stack")})]},m.key))})]},l.key)})})]})};import{Fragment as mr,useCallback as gr,useId as br,useLayoutEffect as Bt,useRef as We}from"react";var re="[data-cui-row-focus]",qe="[data-cui-row-detail]",cr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${re}`)],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(re)?(o+=1,n.set(a,o)):o>=0&&a.matches(qe)&&n.set(a,o);return n},Ut=(e,t,n,o)=>{let a=cr(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)]};import{useCallback as pr,useLayoutEffect as Ge,useReducer as yr,useRef as Ve}from"react";var fr=e=>e+1,oe=e=>{let t=Ve(e),n=Ve(null),o=Ve(!1),[,a]=yr(fr,0),r=pr((i=>()=>{o.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return Ge(()=>(o.current=!0,()=>{o.current=!1,n.current=null}),[]),Ge(()=>{t.current=e}),Ge(()=>{let i=n.current;if(i===null)return;n.current=null;let d=[null,document.body].includes(document.activeElement);i.isConnected||!d||t.current(i)?.focus()}),r};import{jsx as S,jsxs as ge}from"react/jsx-runtime";var hr=new Map,Rr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',Tr=(e,t,n)=>{Bt(()=>{let o=e.current;if(t!=="row-compact"||o===null)return;let a=[...o.querySelectorAll(Rr)].find(r=>r.parentElement!==o);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${W} px target does not fit its ${pt} px; use row-control), not <${a.localName}>`)})},Er=(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:S("div",{className:"cui-table-header-note",children:e}),vr=(e,t,n,o,a)=>{let r=e.open(t);return S("tr",{ref:a,hidden:!r,"data-cui-row-detail":r?"open":"closed","data-testid":`${o}-detail`,children:S("td",{colSpan:n,id:e.id(t),children:r?e.render(t):null})})},wr=({caption:e,captionHidden:t,columns:n,rows:o,rowKey:a,rowTestId:r,rowData:i,rowSize:d,rowDetail:s,empty:u,testId:p,ref:l})=>{g();let c=br(),b=We(null);Tr(b,d,p);let m=We(null),f=We(hr),h=oe(R=>Ut(R,b.current,m.current,f.current));Bt(()=>{f.current=Kt(b.current,m.current)});let y=gr(R=>{m.current=R;let T=h(R);return()=>{m.current=null,T()}},[h]),E=bt(n);return Er(n,p),S("div",{className:"cui-container","data-testid":p,ref:l,children:o.length===0?S(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:y,testId:`${p}-empty`,children:u}):S("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:ge("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":F(E)},children:[S("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),S("colgroup",{children:n.map(R=>S("col",{style:R.width.fixedPx===void 0?void 0:{width:F(R.width.fixedPx)}},R.key))}),S("thead",{children:S("tr",{children:n.map(R=>ge("th",{scope:"col","data-cui-align":R.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[R.header,R.note===void 0?null:S("div",{className:"cui-table-header-note",children:R.note})]},R.key))})}),S("tbody",{ref:b,children:o.map(R=>ge(mr,{children:[S("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":r,...w(i?.(R)),children:n.map(T=>T.rowHeader===!0?ge("th",{scope:"row","data-cui-align":T.align,children:[T.cell(R),T.rowHeaderNote===void 0?null:xr(T.rowHeaderNote(R))]},T.key):S("td",{"data-cui-align":T.align,children:T.cell(R)},T.key))}),s===void 0?null:vr(s,R,n.length,r,h)]},a(R)))})]})})})};import{jsx as ze,jsxs as Nr}from"react/jsx-runtime";var Pr=({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 ze("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>Nr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[ze("dt",{"data-cui-fg":"fg-secondary",children:n.term}),ze("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as _t,useLayoutEffect as qt,useRef as Je}from"react";import{jsx as ae,jsxs as Vt}from"react/jsx-runtime";var Gt=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},Cr=(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},kr=(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")},Lr=e=>e instanceof HTMLInputElement&&e.type==="search",Sr=({title:e,description:t,open:n,onClose:o,initialFocus:a,testId:r,children:i})=>{let{labels:d}=C(),s=_t(),u=_t(),p=Je(null),l=Je(null),c=Je(!1);return qt(()=>{let y=p.current;if(n&&!y.open){let E=a===void 0?null:Cr(y,a.current);l.current=y.ownerDocument.activeElement,y.showModal(),E!==null&&kr(y,E)}else!n&&y.open&&y.close()},[n,a]),qt(()=>{let y=p.current;return()=>{y.open&&(y.close(),Gt(l.current),l.current=null)}},[]),Vt("dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:u,"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(l.current),l.current=null,n&&o())},onCancel:y=>{let E=c.current;c.current=!1,(E||me(y.currentTarget.ownerDocument.activeElement))&&y.preventDefault()},onKeyDownCapture:y=>{let E=Be(y);c.current=E,y.key==="Escape"&&!E&&me(y.target)&&!Lr(y.target)&&y.preventDefault()},onKeyUpCapture:()=>{c.current=!1},children:[Vt("div",{className:"cui-dialog-header",children:[ae("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),ae("div",{className:"cui-dialog-actions",children:ae(I,{variant:"secondary",testId:`${r}-close`,onClick:()=>p.current?.close(),children:d.close})})]}),t===void 0?null:ae("div",{id:u,"data-cui-measure":"reading","data-testid":`${r}-description`,children:t}),i,ae("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[De]:"","data-testid":`${r}-announcer`})]})};import{useId as Mr,useRef as Ir}from"react";import{jsx as Xe,jsxs as Wt}from"react/jsx-runtime";var Fr=({summary:e,open:t,onOpenChange:n,testId:o,children:a})=>{g();let r=Mr(),i=Ir(null);return H(i,{testId:o,part:"summary",host:"button"}),Wt("div",{className:"cui-disclosure","data-testid":o,children:[Wt("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:[Xe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),Xe("span",{ref:i,children:e})]}),Xe("div",{className:"cui-disclosure-panel",id:r,hidden:!t,"data-testid":`${o}-panel`,children:a})]})};import{accessFailureKindOfStatus as Ar}from"@aiquants/auth-core";import{Fragment as Dr}from"react";import{jsx as zt}from"react/jsx-runtime";var $r=({tone:e,testId:t,children:n})=>(g(),zt("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})),ie=({occurrence:e,testId:t,children:n})=>(g(),zt("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));import{jsx as Jt}from"react/jsx-runtime";var je=({failure:e,place:t,deniedSentence:n,failed:o,retry:a,testId:r})=>{let{labels:i,accessFailure:d}=C();if(n.trim()==="")throw new RangeError("FailureMessage: deniedSentence must be a non-empty sentence");let s=e.status===null?null:Ar(e.status);return s===null?Jt(ie,{occurrence:e.occurrence,testId:r,children:i.failureSentence(e,o)}):Jt(Dr,{children:d({kind:s,place:t,deniedSentence:s==="forbidden"?i.forbiddenBecause(n,e.reason):null,retry:a})},e.occurrence)};import{useId as j}from"react";import{Fragment as Vr,jsx as v,jsxs as $}from"react/jsx-runtime";var Hr=/\s/,Ye=e=>{if(e!==void 0&&(typeof e!="string"||e===""||Hr.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},Y=({description:e,error:t,errorId:n})=>{g();let o=j(),a=j(),r=j(),i=n===void 0?r:Oe(n,"a field's error"),d=[e===void 0?null:a,t===void 0?null:i].filter(u=>u!==null).join(" ");return{control:{id:o,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Z=({description:e,error:t,descriptionId:n,errorId:o,testId:a})=>$(Vr,{children:[e===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:v(P,{as:"p",fg:"danger-fg",type:"body",id:o,testId:`${a}-error`,children:t})]}),be=({htmlFor:e,hidden:t,children:n})=>v("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),Or=({label:e,description:t,error:n,errorId:o,testId:a,children:r})=>{let{control:i,descriptionId:d,errorId:s}=Y({label:e,description:t,error:n,errorId:o});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[v(be,{htmlFor:i.id,hidden:void 0,children:e}),r(i),v(Z,{description:t,error:n,descriptionId:d,errorId:s,testId:a})]})},jt=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,type:i,name:d,maxLength:s,list:u,autoComplete:p,inputMode:l,prefix:c,labelHidden:b,required:m,testId:f,ref:h})=>{let{control:y,descriptionId:E,errorId:R}=Y({label:e,description:t,error:n,errorId:o}),T=j();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(s!==void 0&&i==="datetime-local")throw new RangeError(`A ${i} input takes no maxLength: ${s}`);let x=i==="password",k=v("input",{className:"cui-input",type:i,name:Ye(d),maxLength:Xt(s),value:a,list:u,autoComplete:p,inputMode:l,spellCheck:x?!1:void 0,autoCapitalize:x?"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 $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${f}-field`,children:[v(be,{htmlFor:y.id,hidden:b,children:e}),c===void 0?k:$("div",{className:"cui-input-group",children:[v("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]}),v(Z,{description:t,error:n,descriptionId:E,errorId:R,testId:f})]})},Kr=e=>v(jt,{...e}),Ur=e=>v(jt,{...e,type:"password"}),Br=({label:e,description:t,error:n,errorId:o,value:a,onValueChange:r,name:i,maxLength:d,required:s,testId:u,ref:p})=>{let{control:l,descriptionId:c,errorId:b}=Y({label:e,description:t,error:n,errorId:o});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${u}-field`,children:[v(be,{htmlFor:l.id,hidden:void 0,children:e}),v("textarea",{className:"cui-input cui-textarea",name:Ye(i),maxLength:Xt(d),value:a,required:s,onChange:m=>r(m.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":u,ref:p,...l}),v(Z,{description:t,error:n,descriptionId:c,errorId:b,testId:u})]})},_r=({label:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:i,name:d,labelHidden:s,unavailable:u,testId:p,ref:l})=>{let{control:c,descriptionId:b,errorId:m}=Y({label:e,description:t,error:n,errorId:o}),f=j(),h=J(u,f);return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[v(be,{htmlFor:c.id,hidden:s,children:e}),v("select",{className:"cui-input",name:Ye(d),value:a,onChange:y=>{u===void 0&&i(y.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:l,...c,"aria-disabled":u===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],h),children:r.map(y=>v("option",{value:y.value,children:y.label},y.value))}),v(Z,{description:t,error:n,descriptionId:b,errorId:m,testId:p}),u?.reason===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${p}-reason`,children:u.reason})]})},qr=({legend:e,description:t,error:n,errorId:o,value:a,options:r,onValueChange:i,testId:d,ref:s})=>{let u=j(),{control:p,descriptionId:l,errorId:c}=Y({label:e,description:t,error:n,errorId:o});return $("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),r.map((b,m)=>$("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:u,value:b.value,checked:b.value===a,onChange:()=>i(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${b.value}`,ref:m===0?s:void 0}),v("span",{children:b.label})]},b.value)),v(Z,{description:t,error:n,descriptionId:l,errorId:c,testId:d})]})},Gr=({legend:e,description:t,error:n,errorId:o,values:a,options:r,onValuesChange:i,testId:d,ref:s})=>{let{control:u,descriptionId:p,errorId:l}=Y({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 $("fieldset",{className:"cui-checkbox-group","aria-describedby":u["aria-describedby"],"data-invalid":n!==void 0,"data-testid":d,children:[v("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),r.map((f,h)=>$("label",{className:"cui-checkbox","data-cui-type":"body",children:[v("input",{type:"checkbox",value:f.value,checked:m.has(f.value),onChange:()=>i(c.filter(y=>y===f.value?!m.has(y):m.has(y))),"aria-invalid":u["aria-invalid"],"data-testid":`${d}-option-${f.value}`,ref:h===0?s:void 0}),v("span",{children:f.label})]},f.value)),v(Z,{description:t,error:n,descriptionId:p,errorId:l,testId:d})]})};import{createContext as Wr,useContext as zr,useId as tn,useMemo as Jr}from"react";import{Fragment as an,jsx as N,jsxs as he}from"react/jsx-runtime";var nn=Wr(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"},Xr=["normal","high"],jr=[1,2,3,4],A=M.space["space-2"],Yr="fg",Zr="fg-secondary",on=e=>{let t=zr(nn);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Ze=(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}`)},Qr=e=>{g();let t=tn(),{kind:n,widthPx:o,heightPx:a,testId:r,dataAttributes:i,children:d}=e;Ze(r,"widthPx",o),Ze(r,"heightPx",a);let s=Jr(()=>({kind:n,widthPx:o,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,o,a,t]),u=he(an,{children:[N("defs",{children:Xr.map(b=>N("marker",{id:s.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:N("path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":rn[b],"data-testid":`${r}-arrow-${b}`})},b))}),N(nn.Provider,{value:s,children:d})]});if(e.kind==="group"){let{label:b,onEscape:m}=e;if(!D(b))throw new RangeError(`${r}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return N("div",{className:"cui-figure-frame","data-testid":`${r}-frame`,children:N("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":F(o),"--cui-figure-block":F(a)},onKeyDown:m===void 0?void 0:f=>_(f,m),"data-testid":r,...w(i),children:u})})}let{viewBox:p,pointer:l,svgRef:c}=e;return N("div",{className:"cui-container","data-testid":`${r}-frame`,children:N("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":l===void 0?void 0:"true","data-cui-cursor":l?.cursor,style:{"--cui-figure-inline":F(o),"--cui-figure-ratio":String(a/o)},"data-testid":r,...w(i),...l?.handlers,children:u})})},en=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},eo=(e,t,n)=>{for(let o of t){let a=wt.light[o.fg],r=n.find(i=>a[i]===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`)}},to=e=>{g();let t=on("FigureNode"),n=tn(),{x:o,y:a,shape:r,tone:i,outline:d,selected:s,name:u,title:p,press:l,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"&&l===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&l!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(l!==void 0&&!D(l.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(l.label)}`);let f=s?Qt:Zt[i];eo(c,m,[Zt[i].face,Qt.face]);let h,y,E;if(r.kind==="box"){if(u===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,()=>yt({name:u,notes:m.map(k=>k.text)}));if(Ze(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 x=ft(m.length);y=he("g",{"data-cui-surface":f.face,children:[N("rect",{className:"cui-figure-plate",width:r.widthPx,height:T.heightPx,rx:M.radius["radius-item"],"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`}),N("text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:M.type.body.size,"data-cui-fg":Yr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:u}),m.map((k,K)=>N("text",{x:x.insetPx,y:x.notesPx[K],fontSize:M.type.caption.size,"data-cui-fg":k.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:k.text},K))]}),E=N("rect",{className:"cui-figure-ring",x:-U,y:-U,width:r.widthPx+2*U,height:T.heightPx+2*U,rx:M.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let T=en(c,()=>mt(u,r.radiusPx));h={width:2*r.radiusPx,height:2*r.radiusPx,left:o-r.radiusPx,top:a-r.radiusPx},y=he(an,{children:[N("g",{"data-cui-surface":f.face,children:N("circle",{className:"cui-figure-plate",r:r.radiusPx,"data-cui-fill":f.face,"data-cui-stroke":f.line,"data-testid":`${c}-plate`})}),u===null?null:N("text",{className:"cui-figure-label",x:0,y:T.extentBelowPx-M.type.caption.lineHeight/2,fontSize:M.type.caption.size,"data-cui-fg":Zr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:u})]}),E=N("circle",{className:"cui-figure-ring",r:r.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(l!==void 0){if(h.width<W||h.height<W)throw new RangeError(`${c}: a pressable node must be at least the ${W} px target: ${h.width} \xD7 ${h.height}`);if(h.left<z||h.top<z||h.left+h.width+z>t.widthPx||h.top+h.height+z>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${z} px to the figure's edge for its focus ring`)}let R=l===void 0?{}:{role:"button",tabIndex:0,"aria-label":l.label,"aria-describedby":l.description===void 0?void 0:n,"aria-expanded":l.expanded,"aria-controls":l.expanded?l.controls:void 0,onClick:T=>{T.currentTarget.focus(),l.onPress()},onKeyDown:T=>{T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),T.repeat||l.onPress())}};return he("g",{className:"cui-figure-node",transform:`translate(${o} ${a})`,"data-cui-tone":i,"data-cui-outline":d,"data-selected":String(s),...R,"data-testid":c,...w(b),children:[p===void 0?null:N("title",{children:p}),l?.description===void 0?null:N("desc",{id:n,"data-testid":`${c}-description`,children:l.description}),l===void 0?null:E,y]})},no=({d:e,emphasis:t,weight:n,arrow:o,title:a,testId:r,dataAttributes:i})=>{g();let d=on("FigureEdge");if(!jr.includes(n))throw new RangeError(`${r}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return N("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(i),children:a===void 0?null:N("title",{children:a})})};import{jsx as ao}from"react/jsx-runtime";var ro={1:"h1",2:"h2",3:"h3"},oo=({level:e,type:t,testId:n,headingRef:o,children:a})=>{g();let r=ro[e];return ao(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})};import{jsx as lo}from"react/jsx-runtime";var io={removed:"danger-tint",added:"success-tint"},so=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return lo(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":io[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as po}from"react/jsx-runtime";var uo={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"}},co={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Qe=({tone:e,variant:t,testId:n,dataAttributes:o,children:a})=>{g();let r=t==="tint"?uo[e]:{fg:"on-solid",surface:co[e]};return po("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})};import{useId as yo}from"react";import{jsx as se,jsxs as fo}from"react/jsx-runtime";var et=({label:e,valueText:t,value:n,max:o,testId:a})=>{g();let r=yo();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 i=o===null?null:{max:o,now:Math.min(n,o)};return fo("div",{className:"cui-progress","data-testid":a,children:[se(P,{as:"p",fg:"fg",type:"body",id:r,children:e}),se("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":r,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":i?.max,"aria-valuenow":i?.now,"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:se("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),se("div",{"aria-hidden":"true",children:se(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as Re,jsxs as sn}from"react/jsx-runtime";var mo=({title:e,status:t,progress:n,cancel:o,testId:a,children:r})=>sn(_e,{title:e,actions:o===void 0?void 0:Re(I,{variant:"secondary",busy:o.busy,busyLabel:o.busyLabel,onClick:o.onCancel,testId:`${a}-cancel`,children:o.label}),testId:a,children:[sn("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[Re("span",{className:"cui-visually-hidden",children:`${e} `}),Re(Qe,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:Re(et,{...n,testId:`${a}-progress`}),r]});import{createContext as go,useContext as bo}from"react";import{jsx as de}from"react/jsx-runtime";var tt=go(null),ho="space-2",Ro=e=>{g();let{gap:t,label:n,id:o,hidden:a,testId:r,children:i}=e;if(n!==void 0&&!D(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,s=d!==void 0,u=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return de(tt.Provider,{value:e.marker,children:de(u,{className:"cui-list",role:"list","aria-label":n,id:o,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?ho:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":d,"data-testid":r,children:i})})},To=({testId:e,dataAttributes:t,children:n})=>{g();let o=bo(tt);if(o===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return de("li",{className:"cui-list-item","data-testid":e,...w(t),children:de("div",{className:"cui-list-body","data-cui-measure":o==="none"?void 0:"reading",children:de(tt.Provider,{value:null,children:n})})})};import{useCallback as dn,useLayoutEffect as Eo,useRef as Te}from"react";import{jsx as Ee,jsxs as Po}from"react/jsx-runtime";var ln=e=>[...e.querySelectorAll(re)].filter(t=>{let n=t.closest(qe);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} ${re} elements for ${e.count} rows`);return n},vo=(e,t)=>{let n=-1;return e.forEach((o,a)=>{t.has(o)&&(n=a)}),e[n+1]},wo=({onLoad:e,busy:t,done:n,failure:o,limit:a,rows:r,testId:i})=>{let{formatLocale:d,labels:s}=C(),u=Te(null),p=Te(null),l=Te(null),c=Te(!1),b=()=>{let y=r.ref.current;u.current={shown:new Set(y===null?[]:ln(y)),failureOccurrence:o===null?null:o.occurrence,busySeen:!1},e()};Eo(()=>{let y=c.current;c.current=!1;let E=u.current;if(E===null)return;let R=xo(r);if(t){E.busySeen=!0,E.shown=new Set(R);return}let T=vo(R,E.shown),x=o!==null&&o.occurrence!==E.failureOccurrence;if(!(E.busySeen||T!==void 0||x||n)||(u.current=null,x||T===void 0))return;let k=[null,document.body].includes(document.activeElement);(l.current!==null&&document.activeElement===l.current||y&&k)&&T.focus()});let m=oe(()=>n?p.current:l.current),f=dn((y=>{l.current=y;let E=m(y);return()=>{l.current=null,c.current=y===document.activeElement,E()}}),[m]),h=dn((y=>{p.current=y;let E=m(y);return()=>{p.current=null,E()}}),[m]);return n?Ee("div",{className:"cui-load-more","data-testid":i,children:Ee(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${i}-end`,children:s.endOfRecords})}):Po("div",{className:"cui-load-more","data-testid":i,children:[Ee(I,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:b,ref:f,testId:`${i}-button`,children:s.loadMore(ue(a,d))}),o===null?null:Ee(ie,{occurrence:o.occurrence,testId:`${i}-failure`,children:s.loadFailed(o.reason)})]})};import{jsx as nt,jsxs as un}from"react/jsx-runtime";var No=({master:e,detail:t,masterMinPx:n,detailMinPx:o,testId:a})=>{g();let r=gt({masterMinPx:n,detailMinPx:o,gapPx:M.space["space-6"]});return un("div",{className:"cui-container","data-testid":a,children:[nt(X,{ruleKey:r.key,css:r.css}),un("div",{className:"cui-master-detail","data-cui-master-detail":r.key,children:[nt("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),nt("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as xe}from"react/jsx-runtime";var ve=e=>{let{formatLocale:t,labels:n}=C(),{testId:o}=e;if(e.keep===void 0){let{value:i,unit:d}=e;if(d!==void 0&&!D(d))throw new RangeError(`${o}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(i===null)return xe("span",{className:"cui-measured","data-measured":"false","data-testid":o,children:n.unmeasured});let s=ue(i,t);return xe("span",{className:"cui-measured","data-measured":"true","data-testid":o,children:ut(s,d)})}let{text:a,keep:r}=e;if(a===null)return xe("span",{className:"cui-measured","data-measured":"false","data-cui-keep":r,"data-testid":o,children:n.unmeasured});if(!D(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 xe("span",{className:"cui-measured","data-measured":"true","data-cui-keep":r,"data-testid":o,children:a})};import{jsx as we,jsxs as ko}from"react/jsx-runtime";var Co=({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 ko("span",{className:"cui-meter","data-testid":r,children:[we("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:we("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(o-n)*100}%`},"data-testid":`${r}-fill`})}),we("span",{"aria-hidden":"true",children:we(P,{fg:"fg",type:"body",testId:`${r}-value`,children:a})})]})};import{useId as Lo,useRef as So}from"react";import{jsx as rt,jsxs as Fo}from"react/jsx-runtime";var Mo={ArrowLeft:-1,ArrowRight:1},Io=({label:e,items:t,value:n,onValueChange:o,testId:a,panelDescribedBy:r,children:i})=>{g();let d=Lo(),s=So(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let u=t.map(f=>f.id);if(new Set(u).size!==u.length)throw new RangeError(`Tab keys must be unique: ${u.join(", ")}`);let p=u.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${u.join(", ")}`);let l=f=>`${d}-tab-${f}`,c=`${d}-panel`,b=f=>{let h=t[f];h.id!==n&&o(h.id),s.current.get(h.id)?.focus()};return Fo("div",{className:"cui-panel-tabs","data-testid":a,children:[rt("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:f=>{let h=t.findIndex(T=>s.current.get(T.id)===f.target),y=h<0?p:h,E=Mo[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 rt("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:l(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?s.current.delete(f.id):s.current.set(f.id,E)},onClick:()=>b(h),children:f.label},f.id)})}),rt("div",{role:"tabpanel",id:c,"aria-labelledby":l(p),"aria-describedby":r,"data-testid":`${a}-panel`,children:i})]})};import{accessFailureKindOfStatus as $o}from"@aiquants/auth-core";import{jsx as ot,jsxs as Do}from"react/jsx-runtime";var Ao=({failure:e,onReload:t,deniedSentence:n,failureMessage:o,rescueRef:a,testId:r})=>{let{labels:i}=C(),d=ot(je,{failure:e,place:"read",deniedSentence:n,failed:o===void 0?i.loadFailed:o,retry:t,testId:`${r}-alert`});return e.status!==null&&$o(e.status)!==null?ot("div",{className:"cui-resource-failed",ref:a,"data-testid":r,children:d},e.occurrence):Do("div",{className:"cui-resource-failed","data-testid":r,children:[d,ot(I,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${r}-reload`,children:i.reload})]})};import{jsx as at,jsxs as Oo}from"react/jsx-runtime";var Ho=({label:e,options:t,value:n,onValueChange:o,testId:a})=>{g();let r=new Set(t.map(i=>i.value));if(t.length<2||r.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!r.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...r].join(", ")}`);return Oo("fieldset",{className:"cui-segmented-group","data-testid":a,children:[at("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),at("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===n;return at("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||o(i.value)},children:i.label},i.value)})})]})};import{useCallback as Ko,useRef as Uo}from"react";import{jsx as Q}from"react/jsx-runtime";var cn=({selected:e,controls:t,onSelect:n,testId:o,dataAttributes:a,ref:r,children:i})=>{g();let d=Uo(null);H(d,{testId:o,part:"row",host:"button"});let s=Ko(p=>{if(d.current=p,typeof r=="function")return r(p);r!=null&&(r.current=p)},[r]);return Q("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=>{pe(p),n()},ref:s,...w(a),children:i})},Bo=({label:e,items:t,itemKey:n,selectedKey:o,onSelect:a,detailId:r,renderRow:i,rowTestId:d,rowData:s,empty:u,testId:p,ref:l})=>(g(),Q("div",{className:"cui-selectable","data-testid":p,ref:l,children:t.length===0?Q(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):Q("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return Q("li",{children:Q(cn,{selected:b===o,controls:r,onSelect:()=>a(c),testId:d,dataAttributes:s?.(c),children:i(c)})},b)})})}));import{useId as _o}from"react";import{jsx as Pe,jsxs as pn}from"react/jsx-runtime";var qo=({label:e,value:t,min:n,max:o,step:a,valueText:r,onValueChange:i,testId:d})=>{g();let s=_o();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 u=r(t);return pn("div",{className:"cui-field","data-testid":`${d}-field`,children:[Pe("label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),pn("div",{className:"cui-slider",children:[Pe("input",{className:"cui-slider-input",id:s,type:"range",min:n,max:o,step:a,value:t,"aria-valuetext":u,"data-testid":d,onChange:p=>i(p.currentTarget.valueAsNumber)}),Pe("span",{className:"cui-slider-value","aria-hidden":"true",children:Pe(P,{fg:"fg",type:"body",testId:`${d}-value`,children:u})})]})]})};import{jsx as it,jsxs as fn}from"react/jsx-runtime";var yn={done:0,current:1,pending:2},Go={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Vo=({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,i)=>i>0&&yn[r.state]<yn[t[i-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 it("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((r,i)=>{let d=Go[r.state],s=a[r.state];return fn("li",{className:"cui-step","aria-current":r.state==="current"?"step":void 0,"data-cui-step":r.state,"data-testid":`${n}-${r.id}`,children:[it("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":i+1}),fn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[r.label,s===null?null:it("span",{className:"cui-visually-hidden",children:` (${s})`})]})]},r.id)})})};import{useId as Wo,useRef as zo}from"react";import{jsx as Ne,jsxs as mn}from"react/jsx-runtime";var Jo=({label:e,labelHidden:t,checked:n,onCheckedChange:o,unavailable:a,testId:r,ref:i,dataAttributes:d})=>{g();let s=Wo(),u=zo(null);H(u,{testId:r,part:"label",host:"button"});let p=J(a,s),l=a!==void 0,c=mn("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":l?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":r,ref:i,onClick:()=>{l||o(!n)},...w(d),children:[Ne("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${r}-track`,children:Ne("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${r}-thumb`})}),Ne("span",{className:t===!0?"cui-visually-hidden":void 0,ref:u,children:e})]});return a?.reason===void 0?c:mn("span",{className:"cui-button-group",children:[c,Ne(P,{fg:"fg-muted",type:"body",id:s,testId:`${r}-reason`,children:a.reason})]})};import{useCallback as Xo,useEffect as jo,useId as Yo,useRef as gn,useState as Zo}from"react";import{jsx as le,jsxs as bn}from"react/jsx-runtime";var Qo=({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 i=new Set(t.map(m=>m.id));if(i.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: ${[...i].join(", ")}`);let[s,u]=Zo(!1),p=gn(null),l=gn(null),c=Yo(),b=Xo(m=>{u(!1),m&&p.current?.contains(document.activeElement)&&l.current?.focus()},[]);return jo(()=>{if(!(r&&s))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,s,b]),bn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":r?"":void 0,"data-cui-open":r&&s?"":void 0,onKeyDown:r&&s?m=>_(m,()=>b(!0)):void 0,children:[r?bn("button",{ref:l,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>u(m=>!m),children:[le("span",{className:"cui-tabs-summary-label",children:d.label}),le("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,le("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 le("li",{className:"cui-tabs-item",children:le("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=>{fe(h,m.href,o),h.defaultPrevented&&b(!1)},children:m.label})},m.id)})})]})};import{Children as ea,Fragment as ta,isValidElement as na}from"react";import{jsx as V,jsxs as Rn}from"react/jsx-runtime";var ra={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},oa=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 Rn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":o,"data-testid":a,...w(r),children:[V("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),V("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),V("p",{className:"cui-tile-value","data-cui-fg":ra[o],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?V(ve,{value:e.value,unit:e.unit,testId:d}):V(ve,{text:e.text,keep:"wrap",testId:d})})]})},hn=e=>ea.toArray(e).flatMap(t=>{if(!na(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===ta?hn(t.props.children):[t]}),aa=({count:e,minInlinePx:t,testId:n,children:o})=>{g();let a=ht(e,t,M.space["space-2"]),r=hn(o).length;if(r!==e)throw new RangeError(`TileGrid has ${r} tiles but count is ${e}`);return Rn("div",{className:"cui-container","data-testid":n,children:[V(X,{ruleKey:a.key,css:a.css}),V("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:o})]})};import{useLayoutEffect as ia,useRef as Tn}from"react";import{jsx as da}from"react/jsx-runtime";var Ce=e=>[...e.querySelectorAll("button")],sa=({label:e,testId:t,children:n})=>{g();let o=Tn(null),a=Tn(null);ia(()=>{let s=Ce(o.current),u=a.current!==null&&s.includes(a.current)?a.current:s[0]??null;a.current=u;for(let p of s)p.tabIndex=p===u?0:-1});let r=s=>{for(let u of Ce(o.current))u.tabIndex=u===s?0:-1;a.current=s};return da("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:o,onFocus:s=>{let u=Ce(s.currentTarget).find(p=>p.contains(s.target));u!==void 0&&r(u)},onKeyDown:s=>{let u=Ce(s.currentTarget),p=u.indexOf(s.target);if(p===-1)return;let l=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=l==="ArrowRight"?"ArrowLeft":"ArrowRight",m={[l]:(p+1)%u.length,[c]:(p-1+u.length)%u.length,Home:0,End:u.length-1}[s.key];if(m===void 0)return;s.preventDefault();let f=u[m];r(f),f.focus()},children:n})};import{useState as la}from"react";var ua=e=>{let[t,n]=la({failure:null,count:0});return e!==null&&e!==t.failure?(n({failure:e,count:t.count+1}),t.count+1):t.count};import{useCallback as ee,useEffect as ya,useLayoutEffect as xn,useRef as lt}from"react";import{useCallback as ke,useEffect as ca,useLayoutEffect as pa,useRef as st,useState as dt}from"react";var En=e=>e===null?Me:Ie,Le=(e,t,n,o,a)=>{let[r,i]=dt(()=>({key:e,state:En(e)})),[d,s]=dt(0),[u,p]=dt(0),l=st(t),c=st(null),b=st(d);pa(()=>{l.current=t}),ca(()=>{if(e===null){i({key:null,state:Me});return}let R=new AbortController;c.current=e;let T=d===b.current?"revision":"reload";return b.current=d,i(x=>Object.is(x.key,e)?{key:e,state:o(x.state,T)}:{key:e,state:Ie}),l.current(R.signal).then(x=>{R.signal.aborted||(c.current=null,i(k=>({key:e,state:a(k.state,x)})))},x=>{R.signal.aborted||i(()=>{throw x})}),()=>{R.abort(),c.current=null}},[e,n,d,u]);let m=ke(()=>s(R=>R+1),[]),f=ke(()=>p(R=>R+1),[]),h=ke((R,T)=>{i(x=>Object.is(x.key,R)?{key:R,state:T(x.state)}:x)},[]),y=ke((R,T)=>{h(R,T),Object.is(c.current,R)&&f()},[h,f]);return{state:Object.is(r.key,e)?r.state:En(e),reload:m,refresh:f,update:h,write:y}};var fa=(e,t,n)=>{let o=lt(t);xn(()=>{o.current=t});let a=ee(y=>o.current.first(y),[]),{state:r,reload:i,refresh:d,update:s,write:u}=Le(e,a,n,Tt,Et),p=lt({key:e,state:r});xn(()=>{p.current={key:e,state:r}});let l=lt(null),c=ee(()=>{l.current?.controller.abort(),l.current=null},[]);ya(()=>c,[e,n,c]);let b=ee(()=>{c(),i()},[c,i]),m=ee(()=>{c(),d()},[c,d]),f=ee(()=>{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:[]};l.current=T,s(y,xt),o.current.next(R,T.controller.signal).then(x=>{l.current===T&&(l.current=null,s(y,k=>T.maps.reduce((K,vn)=>$e(K,vn),vt(k,R,x))))},x=>{l.current===T&&s(y,()=>{throw x})})},[s]),h=ee((y,E)=>{let R=l.current;R!==null&&Object.is(R.key,y)&&R.maps.push(E),u(y,T=>$e(T,E))},[u]);return{state:r,reload:b,refresh:m,loadMore:f,updateList:h}};import{useCallback as ma,useRef as ga,useState as ba}from"react";var ha=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Ra=()=>{let[e,t]=ba(null),n=ga(null),o=ma((a,r)=>{let i=r();if(!ha(i))return;let d=Symbol(a);n.current=d,t(a);let s=()=>{n.current===d&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:o}};import{useCallback as Ta}from"react";var Ea=(e,t,n)=>{let{state:o,reload:a,refresh:r,write:i}=Le(e,t,n,Rt,Fe),d=Ta((s,u)=>i(s,p=>Fe(p,{ok:!0,value:u})),[i]);return{state:o,reload:a,refresh:r,put:d}};import{jsx as va}from"react/jsx-runtime";var xa=({testId:e,children:t})=>(g(),va("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,Zn as AccessFailureNotice,ie as AlertMessage,Qn as Breadcrumb,I as Button,pt as COMPACT_ROW_PX,Fa as CONSOLE_UI_LABEL_CATALOGS,ni as CONTRAST_MINIMUM,wt as CONTRAST_PAIRS,_e as Card,ar as CardSection,Gr as CheckboxGroup,Ue as Cluster,sr as CodeBlock,ur as ComparisonGrid,In as ConsoleUiRoot,wr as DataTable,Pr as DescriptionList,Sr as Dialog,Fr as Disclosure,z as FIGURE_RING_REACH_PX,_a as FLEXIBLE_COLUMN_MIN_PX,je as FailureMessage,Or as Field,Qr as Figure,no as FigureEdge,to as FigureNode,Vn as FragmentLink,Ya as HTTP_FORBIDDEN,oo as Heading,so as InlineChange,mo as JobCard,Se as LATTICE_PX,qn as Link,Ro as List,To as ListItem,wo as LoadMore,No as MasterDetail,ve as Measured,Co as Meter,oa as MetricTile,$r as Notice,Io as PanelTabs,Ur as PasswordInput,Qe as Pill,et as ProgressBar,Aa as ROW_WITH_CONTROL_PX,qr as RadioGroup,Ao as ResourceFailed,cn as RowButton,Ho as SegmentedControl,_r as Select,Bo as SelectableList,qo as Slider,zn as Stack,Vo as Stepper,Jo as Switch,W as TARGET_PX,M as TOKENS,si as TONES,ai as TONE_HUES,ii as TONE_ROLES,Qo as Tabs,P as Text,Br as TextArea,Kr as TextInput,aa as TileGrid,sa as Toolbar,xa as VisuallyHidden,Ca as ZonedTimeError,xt as beginPage,Tt as beginPagedReload,Rt as beginReload,Ka as ceil8,$a as ceilToLattice,Ua as cellContentInlinePx,qa as comparisonAttributePx,ti as contrastRatio,Va as countSampleText,Da as cssVar,yt as figureBoxPlan,mt as figureDiscLabelPlan,Ma as fillLabel,Ba as fixedColumnPx,Qa as flatMapOutcome,wa as formatByteSize,ue as formatCount,Sa as formatInstant,Ja as goldenSectionPx,ei as hexToSrgb,Ga as instantSampleText,D as isReadableText,Fe as keepLastGood,ri as lightDark,Za as mapOutcome,$e as mapPagedList,Xa as masterDetailPlan,Oa as monoTextWidthEm,oi as placeholderRule,F as pxToRem,Pa as readDecimalText,Na as readIntegerText,Ia as reasonAside,ct as resolveConsoleUiLabels,Et as settleFirstPage,vt as settlePage,za as spacedTextWidthEm,ja as tableFrameMinInlinePx,bt as tableMinInlinePx,Ha as textWidthEm,ht as tileGridPlan,Wa as tileMinInlinePx,ka as toOffsetIso,La as toWallTime,Fn as useAccessFailure,He as useAnnounce,C as useConsoleUi,rr as useEscapeToClose,ua as useFailureOccurrence,oe as useFocusRescue,fa as usePagedResource,Ra as usePendingPress,Ea as useResource};
|
|
@@ -864,6 +864,32 @@
|
|
|
864
864
|
gap: var(--cui-space-2);
|
|
865
865
|
}
|
|
866
866
|
|
|
867
|
+
/* アクセスの失敗の知らせ: 題と文を持つ注記の箱の下に操作の横並びを置く。ボタンは塗りの外の面に置くので、枠と焦点の輪は
|
|
868
|
+
面の上の配色の組のまま (警告の塗りの上の組は配色の表に無い) */
|
|
869
|
+
.cui-access-failure {
|
|
870
|
+
display: flex;
|
|
871
|
+
flex-direction: column;
|
|
872
|
+
align-items: flex-start;
|
|
873
|
+
gap: var(--cui-space-2);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/* 題と文は 1 つずつの段落で、注記の箱の中に間を空けて積む */
|
|
877
|
+
.cui-access-failure-message {
|
|
878
|
+
display: flex;
|
|
879
|
+
flex-direction: column;
|
|
880
|
+
gap: var(--cui-space-1);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.cui-access-failure-title,
|
|
884
|
+
.cui-access-failure-sentence {
|
|
885
|
+
margin: 0;
|
|
886
|
+
overflow-wrap: anywhere;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.cui-access-failure-title {
|
|
890
|
+
font-weight: var(--cui-font-weight-bold);
|
|
891
|
+
}
|
|
892
|
+
|
|
867
893
|
/* 主の一覧: 1 行の行は上下の余白 12 と body の行 20 で 44。行と行の間は 4 */
|
|
868
894
|
.cui-selectable-list {
|
|
869
895
|
display: flex;
|
package/dist/testing.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 _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var
|
|
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 _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var E=new Set,T=new WeakMap,v="[autofocus], a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])",_= exports.openModals =()=>[...E].filter(e=>e.isConnected&&e.open),A= exports.sendCloseRequest =e=>{let t=e.dispatchEvent(new Event("cancel",{cancelable:!0}));return t&&e.close(),t},C= exports.pressEscape =e=>e.ownerDocument.activeElement.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",code:"Escape",bubbles:!0,cancelable:!0,composed:!0}))&&A(e),I= exports.installDialogModel =()=>{typeof HTMLDialogElement>"u"||"showModal"in HTMLDialogElement.prototype||Object.defineProperties(HTMLDialogElement.prototype,{showModal:{configurable:!0,writable:!0,value(){if(!this.isConnected)throw new DOMException("The dialog is not connected","InvalidStateError");if(this.open){if(E.has(this))return;throw new DOMException("The dialog is already open as a non-modal dialog","InvalidStateError")}T.set(this,this.ownerDocument.activeElement),this.setAttribute("open",""),E.add(this),_optionalChain([this, 'access', _2 => _2.querySelector, 'call', _3 => _3(v), 'optionalAccess', _4 => _4.focus, 'call', _5 => _5()])}},close:{configurable:!0,writable:!0,value(){if(!this.open)return;this.removeAttribute("open"),E.delete(this);let e=_nullishCoalesce(T.get(this), () => (null));T.delete(this),e instanceof HTMLElement&&e.isConnected&&e.focus(),setTimeout(()=>{this.dispatchEvent(new Event("close"))},0)}}})};var H=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,P=/^(?:fill|stroke|color|bgcolor|opacity|[a-z]+(?:-[a-z]+)*-opacity|stop-color|flood-color|lighting-color|filter|mask)$/,x="http://www.w3.org/2000/svg",S="path, rect, circle, ellipse, line, polyline, polygon",q="title, desc, metadata",$="[data-cui-marker]",U=/^\[data-[a-z0-9_-]+(?:[~|^$*]?="[^"\\]*")?\]$/,j=e=>{let t=e.style,l=[];for(let s=0;s<t.length;s+=1){let n=t.item(s);H.test(n)&&l.push(n)}return l},O=(e,t,l)=>{let s=[];for(let n=t;n!==null;n=n.parentElement){let i=j(n);i.length>0&&s.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${e} \u306E ${n.tagName} \u306E ${i.join(", ")}`);let c=n.getAttributeNames().filter(d=>P.test(d));if(c.length>0&&s.push(`\u5857\u308A\u306E\u5C5E\u6027: ${e} \u306E ${n.tagName} \u306E ${c.join(", ")}`),n===l)break}return s},K=e=>{let t=e.closest("[data-testid]");return t===null?e.tagName:`${e.tagName} ${t.getAttribute("data-testid")}`},z=e=>{for(let t=e.parentElement;t!==null;t=t.parentElement)if(t.hasAttribute("data-cui-surface"))return t;return null},B=e=>Object.hasOwn(_chunk7M4I26BScjs.e,e)&&_chunk7M4I26BScjs.e[e]==="nonText",F=(e,t)=>{let l=_chunk7M4I26BScjs.d.light,s=t.closest("[data-cui-fg]"),n=t.closest("[data-cui-surface]");if(s===null||n===null)return{failures:[`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${e}`],pair:null};let i=s.getAttribute("data-cui-fg"),c=n.getAttribute("data-cui-surface");return Object.hasOwn(l,i)&&Object.hasOwn(l[i],c)?{failures:O(e,t,s.contains(n)?s:n),pair:`${i}/${c}`}:{failures:[`\u8868\u306B\u7121\u3044\u7D44: ${e}: ${i} on ${c}`],pair:null}},G=(e,t)=>t.flatMap(l=>{if(!U.test(l))throw new RangeError(`A role scan excludes only by one data-* attribute selector: ${l}`);if(e.matches(l))throw new RangeError(`A role scan exclusion must not match the root it scans: ${l}`);let s=[...e.querySelectorAll(l)];if(s.length===0)throw new RangeError(`A role scan exclusion matches no element under the root: ${l}`);return s}),W= exports.scanColourRoles =(e,t)=>{let l=G(e,t===void 0?[]:t.exclude),s=o=>l.some(r=>r.contains(o)),n=[],i=new Set,c=new Set,d=0,b=0,M=_chunk7M4I26BScjs.d.light,R=(o,r)=>{d+=1;let a=F(o,r);n.push(...a.failures),a.pair!==null&&i.add(a.pair)},w=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=w.nextNode();o!==null;o=w.nextNode()){let r=o.data.trim(),a=o.parentElement;r===""||_optionalChain([a, 'access', _6 => _6.closest, 'call', _7 => _7(q), 'optionalAccess', _8 => _8.namespaceURI])===x||s(a)||R(r,a)}let N=[e,...e.querySelectorAll($)].filter(o=>o.matches($)&&!s(o));for(let o of N)for(let r of o.children)s(r)||R(`\u5370 ${_nullishCoalesce(r.getAttribute("data-testid"), () => (r.tagName))}`,r);let L=[e,...e.querySelectorAll(S)].filter(o=>o.namespaceURI===x&&o.matches(S)&&!s(o));for(let o of L){b+=1;let r=K(o),a=o.getAttribute("data-cui-stroke"),u=o.getAttribute("data-cui-fill"),p=o.closest("[data-cui-surface]");if(a===null&&u===null||p===null){n.push(`\u5F79\u5272\u306E\u7121\u3044\u56F3\u5F62: ${r}`);continue}let f=p.getAttribute("data-cui-surface");u!==null&&u!==f&&n.push(`\u9762\u3068\u9055\u3046\u5857\u308A: ${r}: ${u} on ${f}`);let m=u===null?null:z(p),D=m===null?p:m;if(a!==null){let k=m===null?[f]:[f,m.getAttribute("data-cui-surface")];for(let g of k)B(a)&&Object.hasOwn(M[a],g)?c.add(`${a}/${g}`):n.push(`\u8868\u306B\u7121\u3044\u7DDA\u306E\u7D44: ${r}: ${a} on ${g}`)}n.push(...O(r,o,D))}return{failures:n,measured:i,texts:d,measuredGraphics:c,graphics:b}};exports.installDialogModel = I; exports.openModals = _; exports.pressEscape = C; exports.scanColourRoles = W; exports.sendCloseRequest = A;
|
package/dist/testing.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const openModals: () => readonly HTMLDialogElement[];
|
|
2
|
+
declare const sendCloseRequest: (dialog: HTMLDialogElement) => boolean;
|
|
2
3
|
declare const pressEscape: (dialog: HTMLDialogElement) => boolean;
|
|
3
4
|
declare const installDialogModel: () => void;
|
|
4
5
|
type RoleScanOptions = {
|
|
@@ -12,4 +13,4 @@ type RoleScanResult = {
|
|
|
12
13
|
readonly graphics: number;
|
|
13
14
|
};
|
|
14
15
|
declare const scanColourRoles: (root: Element, options?: RoleScanOptions) => RoleScanResult;
|
|
15
|
-
export { type RoleScanOptions, type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles };
|
|
16
|
+
export { type RoleScanOptions, type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles, sendCloseRequest };
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const openModals: () => readonly HTMLDialogElement[];
|
|
2
|
+
declare const sendCloseRequest: (dialog: HTMLDialogElement) => boolean;
|
|
2
3
|
declare const pressEscape: (dialog: HTMLDialogElement) => boolean;
|
|
3
4
|
declare const installDialogModel: () => void;
|
|
4
5
|
type RoleScanOptions = {
|
|
@@ -12,4 +13,4 @@ type RoleScanResult = {
|
|
|
12
13
|
readonly graphics: number;
|
|
13
14
|
};
|
|
14
15
|
declare const scanColourRoles: (root: Element, options?: RoleScanOptions) => RoleScanResult;
|
|
15
|
-
export { type RoleScanOptions, type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles };
|
|
16
|
+
export { type RoleScanOptions, type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles, sendCloseRequest };
|
package/dist/testing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as h,e as
|
|
1
|
+
import{d as h,e as y}from"./chunk-FXEGLGL7.js";var E=new Set,T=new WeakMap,v="[autofocus], a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])",_=()=>[...E].filter(e=>e.isConnected&&e.open),A=e=>{let t=e.dispatchEvent(new Event("cancel",{cancelable:!0}));return t&&e.close(),t},C=e=>e.ownerDocument.activeElement.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",code:"Escape",bubbles:!0,cancelable:!0,composed:!0}))&&A(e),I=()=>{typeof HTMLDialogElement>"u"||"showModal"in HTMLDialogElement.prototype||Object.defineProperties(HTMLDialogElement.prototype,{showModal:{configurable:!0,writable:!0,value(){if(!this.isConnected)throw new DOMException("The dialog is not connected","InvalidStateError");if(this.open){if(E.has(this))return;throw new DOMException("The dialog is already open as a non-modal dialog","InvalidStateError")}T.set(this,this.ownerDocument.activeElement),this.setAttribute("open",""),E.add(this),this.querySelector(v)?.focus()}},close:{configurable:!0,writable:!0,value(){if(!this.open)return;this.removeAttribute("open"),E.delete(this);let e=T.get(this)??null;T.delete(this),e instanceof HTMLElement&&e.isConnected&&e.focus(),setTimeout(()=>{this.dispatchEvent(new Event("close"))},0)}}})};var H=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,P=/^(?:fill|stroke|color|bgcolor|opacity|[a-z]+(?:-[a-z]+)*-opacity|stop-color|flood-color|lighting-color|filter|mask)$/,x="http://www.w3.org/2000/svg",S="path, rect, circle, ellipse, line, polyline, polygon",q="title, desc, metadata",$="[data-cui-marker]",U=/^\[data-[a-z0-9_-]+(?:[~|^$*]?="[^"\\]*")?\]$/,j=e=>{let t=e.style,l=[];for(let s=0;s<t.length;s+=1){let n=t.item(s);H.test(n)&&l.push(n)}return l},O=(e,t,l)=>{let s=[];for(let n=t;n!==null;n=n.parentElement){let i=j(n);i.length>0&&s.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${e} \u306E ${n.tagName} \u306E ${i.join(", ")}`);let c=n.getAttributeNames().filter(d=>P.test(d));if(c.length>0&&s.push(`\u5857\u308A\u306E\u5C5E\u6027: ${e} \u306E ${n.tagName} \u306E ${c.join(", ")}`),n===l)break}return s},K=e=>{let t=e.closest("[data-testid]");return t===null?e.tagName:`${e.tagName} ${t.getAttribute("data-testid")}`},z=e=>{for(let t=e.parentElement;t!==null;t=t.parentElement)if(t.hasAttribute("data-cui-surface"))return t;return null},B=e=>Object.hasOwn(y,e)&&y[e]==="nonText",F=(e,t)=>{let l=h.light,s=t.closest("[data-cui-fg]"),n=t.closest("[data-cui-surface]");if(s===null||n===null)return{failures:[`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${e}`],pair:null};let i=s.getAttribute("data-cui-fg"),c=n.getAttribute("data-cui-surface");return Object.hasOwn(l,i)&&Object.hasOwn(l[i],c)?{failures:O(e,t,s.contains(n)?s:n),pair:`${i}/${c}`}:{failures:[`\u8868\u306B\u7121\u3044\u7D44: ${e}: ${i} on ${c}`],pair:null}},G=(e,t)=>t.flatMap(l=>{if(!U.test(l))throw new RangeError(`A role scan excludes only by one data-* attribute selector: ${l}`);if(e.matches(l))throw new RangeError(`A role scan exclusion must not match the root it scans: ${l}`);let s=[...e.querySelectorAll(l)];if(s.length===0)throw new RangeError(`A role scan exclusion matches no element under the root: ${l}`);return s}),W=(e,t)=>{let l=G(e,t===void 0?[]:t.exclude),s=o=>l.some(r=>r.contains(o)),n=[],i=new Set,c=new Set,d=0,b=0,M=h.light,R=(o,r)=>{d+=1;let a=F(o,r);n.push(...a.failures),a.pair!==null&&i.add(a.pair)},w=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=w.nextNode();o!==null;o=w.nextNode()){let r=o.data.trim(),a=o.parentElement;r===""||a.closest(q)?.namespaceURI===x||s(a)||R(r,a)}let N=[e,...e.querySelectorAll($)].filter(o=>o.matches($)&&!s(o));for(let o of N)for(let r of o.children)s(r)||R(`\u5370 ${r.getAttribute("data-testid")??r.tagName}`,r);let L=[e,...e.querySelectorAll(S)].filter(o=>o.namespaceURI===x&&o.matches(S)&&!s(o));for(let o of L){b+=1;let r=K(o),a=o.getAttribute("data-cui-stroke"),u=o.getAttribute("data-cui-fill"),p=o.closest("[data-cui-surface]");if(a===null&&u===null||p===null){n.push(`\u5F79\u5272\u306E\u7121\u3044\u56F3\u5F62: ${r}`);continue}let f=p.getAttribute("data-cui-surface");u!==null&&u!==f&&n.push(`\u9762\u3068\u9055\u3046\u5857\u308A: ${r}: ${u} on ${f}`);let m=u===null?null:z(p),D=m===null?p:m;if(a!==null){let k=m===null?[f]:[f,m.getAttribute("data-cui-surface")];for(let g of k)B(a)&&Object.hasOwn(M[a],g)?c.add(`${a}/${g}`):n.push(`\u8868\u306B\u7121\u3044\u7DDA\u306E\u7D44: ${r}: ${a} on ${g}`)}n.push(...O(r,o,D))}return{failures:n,measured:i,texts:d,measuredGraphics:c,graphics:b}};export{I as installDialogModel,_ as openModals,C as pressEscape,W as scanColourRoles,A as sendCloseRequest};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiquants/console-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css"
|
|
@@ -60,10 +60,12 @@
|
|
|
60
60
|
"author": "AI Quants",
|
|
61
61
|
"license": "MIT",
|
|
62
62
|
"peerDependencies": {
|
|
63
|
+
"@aiquants/auth-core": "^0.8.0",
|
|
63
64
|
"react": ">=19",
|
|
64
65
|
"react-dom": ">=19"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
68
|
+
"@aiquants/auth-core": "0.8.0",
|
|
67
69
|
"@testing-library/jest-dom": "^6.9.1",
|
|
68
70
|
"@testing-library/react": "^16.3.2",
|
|
69
71
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -94,9 +96,9 @@
|
|
|
94
96
|
"build:self": "tsup && node ../../.config/scripts/strip-dts-comments.mjs dist",
|
|
95
97
|
"build:watch": "tsup --watch",
|
|
96
98
|
"dev": "tsup --watch",
|
|
97
|
-
"publish:patch": "pnpm run typecheck && pnpm run --if-present test && pnpm run build && node ../../.config/scripts/check-publish-leaks.mjs && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
|
|
98
|
-
"publish:minor": "pnpm run typecheck && pnpm run --if-present test && pnpm run build && node ../../.config/scripts/check-publish-leaks.mjs && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
|
|
99
|
-
"publish:major": "pnpm run typecheck && pnpm run --if-present test && pnpm run build && node ../../.config/scripts/check-publish-leaks.mjs && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
|
|
99
|
+
"publish:patch": "pnpm run typecheck && pnpm run --if-present test && pnpm run build && node ../../.config/scripts/check-publish-leaks.mjs && node ../../.config/scripts/check-peer-floors.mjs --bump patch && pnpm version patch --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
|
|
100
|
+
"publish:minor": "pnpm run typecheck && pnpm run --if-present test && pnpm run build && node ../../.config/scripts/check-publish-leaks.mjs && node ../../.config/scripts/check-peer-floors.mjs --bump minor && pnpm version minor --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
|
|
101
|
+
"publish:major": "pnpm run typecheck && pnpm run --if-present test && pnpm run build && node ../../.config/scripts/check-publish-leaks.mjs && node ../../.config/scripts/check-peer-floors.mjs --bump major && pnpm version major --no-git-tag-version --no-git-checks && pnpm publish --no-git-checks",
|
|
100
102
|
"typecheck": "tsc --noEmit",
|
|
101
103
|
"clean": "rimraf dist",
|
|
102
104
|
"lint": "biome lint src/",
|
package/dist/chunk-5TR7VUZM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Pe=[{name:"B",power:0,fractionDigits:0},{name:"KiB",power:1,fractionDigits:1},{name:"MiB",power:2,fractionDigits:1},{name:"GiB",power:3,fractionDigits:2},{name:"TiB",power:4,fractionDigits:2}],j=new Map,K=e=>Number.isSafeInteger(e)&&e>=0,V=(e,n,t)=>{let r=`${t} ${n}`,o=j.get(r);return o===void 0&&(o=new Intl.NumberFormat(n,{minimumFractionDigits:t,maximumFractionDigits:t,useGrouping:!0}),j.set(r,o)),o.format(e===0?0:e)},w=(e,n)=>{if(!K(e))throw new RangeError(`A count must be a non-negative safe integer: ${e}`);return V(e,n,0)},Y=(e,n)=>Number((e/1024**n.power).toFixed(n.fractionDigits)),_e=(e,n)=>{if(!K(e))throw new RangeError(`A byte size must be a non-negative safe integer: ${e}`);let[t,...r]=Pe,o=t,i=Y(e,o);for(let d of r){if(i<1024)break;o=d,i=Y(e,o)}return`${V(i,n,o.fractionDigits)} ${o.name}`},J=(e,n)=>n===void 0?e:`${e} ${n}`;var we=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/,Oe=/[!-~]/g;var Ie=/^[^eE]*[1-9]/,q=e=>{let n=e.replace(Oe,r=>String.fromCharCode(r.charCodeAt(0)-65248)).trim();if(!we.test(n))return null;let t=Number(n);return Number.isFinite(t)?t===0?Ie.test(n)?null:0:t:null},Ne=e=>{let n=q(e);return n!==null&&Number.isSafeInteger(n)?n:null};var Me=/[^\p{White_Space}\p{Cc}\p{Cf}\p{Default_Ignorable_Code_Point}]/u,f=e=>Me.test(e);var l=class extends RangeError{reason;constructor(n,t){super(t),this.name="ZonedTimeError",this.reason=n}},Le=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/,Fe=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(?:(Z)|([+-])(\d{2}):(\d{2}))$/,$e=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(?:(Z)|([+-])(\d{2}):?(\d{2}))$/,Z=864e5,I=6e4,E={min:1,max:9999},Q=new Map,ee=new Map,Ae=e=>{let n=Q.get(e);return n===void 0&&(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Q.set(e,n)),n},ne=e=>{let n=new Date(0);return n.setUTCFullYear(e.year,e.month-1,e.day),n.setUTCHours(e.hour,e.minute,e.second,0),n.getUTCFullYear()===e.year&&n.getUTCMonth()===e.month-1&&n.getUTCDate()===e.day&&n.getUTCHours()===e.hour&&n.getUTCMinutes()===e.minute&&n.getUTCSeconds()===e.second?n.getTime():null},N=(e,n)=>{let[t,r,o,i,d,s,R]=n;if(R!==void 0&&/[1-9]/.test(R))throw new l("subsecond",`Fractions of a second cannot be kept: ${e}`);let p={year:Number(t),month:Number(r),day:Number(o),hour:Number(i),minute:Number(d),second:s===void 0?0:Number(s)},X=p.year>=E.min?ne(p):null;if(X===null)throw new l("malformed",`Not a calendar date and time: ${e}`);return{fields:p,millis:X}},M=(e,n)=>{let t=new Map(Ae(n).formatToParts(new Date(e)).map(o=>[o.type,o.value])),r={year:Number(t.get("year")),month:Number(t.get("month")),day:Number(t.get("day")),hour:Number(t.get("hour")),minute:Number(t.get("minute")),second:Number(t.get("second"))};if(t.get("era")!=="AD"||r.year>E.max)throw new l("malformed",`The wall clock falls outside years ${E.min}-${E.max}: ${new Date(e).toISOString()}`);return r},O=(e,n)=>ne(M(e,n))-e,g=e=>String(e).padStart(2,"0"),te=(e,n)=>{let t=`${String(e.year).padStart(4,"0")}-${g(e.month)}-${g(e.day)}T${g(e.hour)}:${g(e.minute)}`;return n||e.second!==0?`${t}:${g(e.second)}`:t},De=e=>{if(e%I!==0)throw new l("malformed",`The zone's offset is not a whole number of minutes: ${e} ms`);let n=Math.abs(e)/I;return`${e<0?"-":"+"}${g(Math.floor(n/60))}:${g(n%60)}`},Ue=(e,n)=>{let t=Le.exec(e);if(t===null)throw new l("malformed",`Not a wall time (YYYY-MM-DDTHH:mm[:ss]): ${e}`);let{fields:r,millis:o}=N(e,t.slice(1)),d=[...new Set([O(o-Z,n),O(o+Z,n)])].filter(s=>O(o-s,n)===s);if(d.length===0)throw new l("nonexistent",`${e} does not exist in ${n}`);if(d.length>1)throw new l("ambiguous",`${e} occurs twice in ${n}`);return`${te(r,!0)}${De(d[0])}`},re=(e,n)=>{let[t,r,o,i]=n;if(t!==void 0)return 0;if(Number(o)>23||Number(i)>59)throw new l("malformed",`Not a valid offset: ${e}`);return(r==="-"?-1:1)*(Number(o)*60+Number(i))*I},ve=(e,n)=>{let t=Fe.exec(e);if(t===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:r}=N(e,t.slice(1,8));return te(M(r-re(e,t.slice(8)),n),!1)},Be=(e,n)=>{let t=JSON.stringify([e,n]),r=ee.get(t);return r===void 0&&(r=new Intl.DateTimeFormat(e,{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}),ee.set(t,r)),r},L=(e,n,t)=>{let r=$e.exec(e);if(r===null)throw new l("malformed",`Not an ISO 8601 instant with an offset: ${e}`);let{millis:o}=N(e,[...r.slice(1,7),void 0]),i=o-re(e,r.slice(7));return M(i,t),Be(n,t).format(i)};function He(e,n){return e.replace(/\{(\w+)\}/g,(t,r)=>Object.hasOwn(n,r)?String(n[r]):t)}var oe=403,We=(e,n)=>e.ok?{ok:!0,value:n(e.value)}:e,ze=(e,n)=>e.ok?n(e.value):e,Kn={kind:"idle"},Ge={kind:"loading"},F=(e,n)=>e.kind==="ready"?{...e,refreshing:!0}:e.kind==="failed"?n==="reload"?{...e,retrying:!0}:e:Ge,$=(e,n)=>n.ok?{kind:"ready",value:n.value,refreshing:!1,refreshFailure:null}:e.kind==="failed"&&e.status===403?e.retrying?{...e,retrying:!1}:e:e.kind==="ready"&&n.status!==403?{kind:"ready",value:e.value,refreshing:!1,refreshFailure:{status:n.status,reason:n.reason}}:{kind:"failed",status:n.status,reason:n.reason,occurrence:e.kind==="failed"?e.occurrence+1:1,retrying:!1};var T=e=>e===""?"":` (${e})`,ae=e=>(n,t,r)=>n.status===403?e(t,n.reason):r(n.reason),ie=(e,n)=>n===""?e:`${e} Reason: ${n}.`,se=(e,n)=>n===""?e:`${e}${n}\u3002`,C={en:{unmeasured:"Not measured",loading:"Loading",loadFailed:e=>`Could not load${T(e)}.`,refreshFailed:e=>`Could not refresh${T(e)}.`,forbiddenBecause:ie,failureSentence:ae(ie),loadMore:e=>`Show ${e} more`,endOfRecords:"No more records",close:"Close",cancel:"Cancel",reload:"Reload",breadcrumb:"Breadcrumb",stepDone:"Done",stepPending:"Not started"},ja:{unmeasured:"\u672A\u6E2C\u5B9A",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D",loadFailed:e=>`\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F${T(e)}\u3002`,refreshFailed:e=>`\u66F4\u65B0\u306B\u5931\u6557\u3057\u307E\u3057\u305F${T(e)}\u3002`,forbiddenBecause:se,failureSentence:ae(se),loadMore:e=>`\u3055\u3089\u306B ${e} \u4EF6\u3092\u8868\u793A`,endOfRecords:"\u3053\u308C\u4EE5\u4E0A\u306E\u8A18\u9332\u306F\u3042\u308A\u307E\u305B\u3093",close:"\u9589\u3058\u308B",cancel:"\u3084\u3081\u308B",reload:"\u518D\u8AAD\u307F\u8FBC\u307F",breadcrumb:"\u30D1\u30F3\u304F\u305A",stepDone:"\u5B8C\u4E86",stepPending:"\u672A\u7740\u624B"}},Xe=e=>{if(!Object.hasOwn(C,e))throw new RangeError(`No console UI labels for locale "${e}"; supported: ${Object.keys(C).join(", ")}`);return C[e]};var je=4,Ye=[1,2,3,4,6,8,12,16,24],Ke=16,Ve=5/4,D={caption:-2,body:-1,"body-lg":0,title:0,heading:1,display:2,"display-lg":3},Je=11,le=3/2,qe=7/4,Ze=7/4,Qe=120,en=3/2,nn=[1,2,3],de=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);return Math.ceil(e/4)*4},U=e=>{if(!Number.isInteger(e))throw new RangeError(`A type step must be an integer: ${e}`);return Math.max(Je,Math.round(Ke*Ve**e))},v=(e,n)=>de(e*n),ce=v(U(D.body),le),b=ce+24,ue=b+8,me=ce+8,A={weight:{regular:400,medium:500,bold:700},radius:{"radius-control":4,"radius-item":8,"radius-container":12,"radius-pill":9999},stroke:{"border-width":1,"focus-width":2,"focus-offset":2,"marker-width":2}},tn=()=>Object.fromEntries(Ye.map(e=>[`space-${e}`,e*4])),rn=()=>{let e=Object.fromEntries(Object.entries(D).map(([t,r])=>{let o=U(r);return[t,{size:o,lineHeight:v(o,t==="title"?Ze:le)}]})),n=U(D.body);return{...e,prose:{size:n,lineHeight:v(n,qe)}}},on=()=>Object.fromEntries(nn.map(e=>[`motion-${e}`,Qe*en**(e-1)])),fe=e=>Object.freeze({space:Object.freeze(tn()),type:Object.freeze(rn()),weight:A.weight,radius:A.radius,size:Object.freeze({"size-target":b,"size-control":b,"size-row":b,"size-row-control":ue,"size-row-compact":me}),stroke:A.stroke,motion:Object.freeze(on()),color:Object.freeze({...e})});var an={fg:{light:"#0f172b",dark:"#f8fafc"},"fg-secondary":{light:"#314158",dark:"#e2e8f0"},"fg-muted":{light:"#44536a",dark:"#cad5e2"},"danger-fg":{light:"#9f0712",dark:"#ffc9c9"},"warning-fg":{light:"#7b3306",dark:"#fee685"},"success-fg":{light:"#006045",dark:"#a4f4cf"},"info-fg":{light:"#193cb8",dark:"#bedbff"},"on-solid":{light:"#ffffff",dark:"#0f172b"},surface:{light:"#ffffff",dark:"#0f172b"},subtle:{light:"#f8fafc",dark:"#1d293d"},sunken:{light:"#f1f5f9",dark:"#020618"},"danger-tint":{light:"#fef2f2",dark:"#460809"},"warning-tint":{light:"#fffbeb",dark:"#461901"},"success-tint":{light:"#ecfdf5",dark:"#002c22"},"info-tint":{light:"#eff6ff",dark:"#162456"},"neutral-solid":{light:"#314158",dark:"#cad5e2"},"danger-solid":{light:"#9f0712",dark:"#ffa2a2"},"success-solid":{light:"#006045",dark:"#5ee9b5"},"info-solid":{light:"#193cb8",dark:"#8ec5ff"},"warning-solid":{light:"#7b3306",dark:"#ffd230"},"danger-accent":{light:"#e7000b",dark:"#ff6467"},"warning-accent":{light:"#bb4d00",dark:"#fcbb00"},"success-accent":{light:"#009966",dark:"#00d492"},"info-accent":{light:"#155dfc",dark:"#51a2ff"},focus:{light:"#155dfc",dark:"#51a2ff"},"border-control":{light:"#62748e",dark:"#90a1b9"},"border-subtle":{light:"#e2e8f0",dark:"#314158"}},a=fe(an),sn="--cui-",ln=e=>`var(${sn}${e})`;var dn=e=>e>=32&&e<=126||e>=65377&&e<=65500||e>=65512&&e<=65518,ge=(e,n)=>{let t=0,r=0;for(let o of e)dn(o.codePointAt(0))?r+=1:t+=1;return t*1+r*n},h=e=>ge(e,.55),x=e=>ge(e,.6),u=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return Math.max(0,Math.ceil((e-1e-9)/8))*8};var pe="caption",W="body",z=2*a.space["space-3"],ye={type:"caption",paddingInlinePx:2*a.space["space-2"]},B={type:"body",paddingInlinePx:2*a.space["space-3"]+2*a.stroke["border-width"],minInlinePx:a.size["size-control"]},Te={type:"body",minInlinePx:a.size["size-target"]},S={trackInlinePx:2*a.type.body.lineHeight+3*a.space["space-1"],labelGapPx:a.space["space-2"],type:"body"},H={captionType:"caption",valueType:"heading",paddingInlinePx:2*a.space["space-3"]},cn=10,un="2000-01-01T00:00:00Z",mn=9999999,be=(e,n,t)=>(n==="mono"?x(e):h(e))*a.type[t].size,fn=(e,n)=>{if(e.length===0)throw new RangeError(`A ${n} needs at least one text to be measured with`);for(let t of e)if(!f(t))throw new RangeError(`A ${n} sample must hold a readable character: ${JSON.stringify(t)}`);return e},c=(e,n,t,r)=>Math.max(...fn(e,n).map(o=>be(o,t,r))),G=e=>{switch(e.kind){case"text":return c(e.texts,"text",e.face,e.type);case"measured":return c(e.texts,"measured value","sans",W);case"pill":return c(e.labels,"pill","sans",ye.type)+ye.paddingInlinePx;case"button":return Math.max(B.minInlinePx,c(e.labels,"button","sans",B.type)+B.paddingInlinePx);case"link":return Math.max(Te.minInlinePx,c(e.labels,"link","sans",Te.type));case"switch":return e.labelHidden?S.trackInlinePx:S.trackInlinePx+S.labelGapPx+c(e.labels,"switch","sans",S.type);case"cluster":{if(e.items.length===0)throw new RangeError("A cluster needs at least one item to be measured with");return e.items.reduce((n,t)=>n+G(t),0)+(e.items.length-1)*a.space[e.gap]}}},gn=(e,n)=>{let t=c([e.header],"column header","sans",pe),r=e.note===void 0?0:c(e.note,"column header note","sans",pe);return u(Math.max(t,r,...n.map(G))+z)},pn=u(be("\u3042".repeat(cn),"sans",W)+z),yn=e=>u(c(e,"comparison attribute","sans",W)+z),Tn=(e,n)=>L(un,e,n),bn=(e,n)=>{if(n!==void 0&&!f(n))throw new RangeError(`A count sample's unit must hold a readable character: ${JSON.stringify(n)}`);return J(w(mn,e),n)},hn=(e,n)=>u(Math.max(c(e,"tile caption","sans",H.captionType),c(n,"tile value","sans",H.valueType))+H.paddingInlinePx);var xn=.12,kn=.16,Rn=/[\u0020\u00a0\u1361\u{10100}\u{10101}\u{1039f}\u{1091f}]/u,k=a.space["space-3"],P=(e,n)=>{let t=0,r=0;for(let i of e)t+=1,Rn.test(i)&&(r+=1);return(n==="mono"?x(e):h(e))+xn*t+kn*r},En=e=>{for(let t of[e.name,...e.notes])if(!f(t))throw new RangeError(`A figure node's name and notes must hold a readable character: ${JSON.stringify(t)}`);let n=Math.max(P(e.name,"sans")*a.type.body.size,...e.notes.map(t=>P(t,"sans")*a.type.caption.size));return{minWidthPx:u(n)+2*k,heightPx:2*k+a.type.body.lineHeight+e.notes.length*a.type.caption.lineHeight}},ct=e=>{let n=k+a.type.body.lineHeight;return{insetPx:k,namePx:k+a.type.body.lineHeight/2,notesPx:Array.from({length:e},(t,r)=>n+r*a.type.caption.lineHeight+a.type.caption.lineHeight/2)}},Cn=(e,n)=>{if(e!==null&&!f(e))throw new RangeError(`A disc's name must hold a readable character: ${JSON.stringify(e)}`);if(!(Number.isFinite(n)&&n>0))throw new RangeError(`A disc's radius must be a positive finite px value: ${n}`);return e===null?{widthPx:0,extentBelowPx:n+he}:{widthPx:u(P(e,"sans")*a.type.caption.size),extentBelowPx:n+a.space["space-1"]+a.type.caption.lineHeight}},he=a.stroke["focus-offset"]+a.stroke["focus-width"],ut=a.stroke["focus-offset"]+a.stroke["focus-width"]/2;var _=(1+Math.sqrt(5))/2,Sn=(e,n)=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`A length must be a finite number of px at or above 0: ${e}`);if(!(Number.isInteger(n)&&n>=0))throw new RangeError(`A golden section step must be an integer at or above 0: ${n}`);return e/_**n};var Pn=e=>{if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Length must be a finite px value >= 0: ${e}`);return e},m=e=>`${Pn(e)/16}rem`;var xe=({masterMinPx:e,detailMinPx:n,gapPx:t})=>{for(let r of[e,n])if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Pane minimum must be a positive px value: ${r}`);if(!(Number.isFinite(t)&&t>=0))throw new RangeError(`Gap must be a px value >= 0: ${t}`);return e+t+n},_n=(e,n)=>{let t=xe(n);if(!(Number.isFinite(e)&&e>=0))throw new RangeError(`Container width must be a px value >= 0: ${e}`);if(e<t)return{sideBySide:!1,sideBySideFromPx:t,masterInlinePx:e,detailInlinePx:e};let r=(e-n.gapPx)/(1+_),o=Math.min(Math.max(n.masterMinPx,r),e-n.gapPx-n.detailMinPx);return{sideBySide:!0,sideBySideFromPx:t,masterInlinePx:o,detailInlinePx:e-n.gapPx-o}},Tt=e=>{let n=xe(e),t=`cui-master-detail-m${e.masterMinPx}-d${e.detailMinPx}-g${e.gapPx}`,r=`[data-cui-master-detail="${t}"]`,o=m(e.gapPx),i=`${r}{grid-template-columns:minmax(0,1fr);gap:${o}}`,d=`clamp(${m(e.masterMinPx)},calc((100% - ${o}) / ${1+_}),calc(100% - ${o} - ${m(e.detailMinPx)}))`,s=`@container (min-width:${m(n)}){${r}{grid-template-columns:${d} minmax(0,1fr)}}`;return{key:t,css:i+s}};var wn=2*a.space["space-1"],ke=e=>{if(!(Number.isFinite(e)&&e>0))throw new RangeError(`Column width must be a positive px value: ${e}`);return e},Re=e=>{if(e.length===0)throw new RangeError("A table needs at least one column");let n=0,t=null;for(let{width:r}of e){if(r.fixedPx!==void 0){n+=ke(r.fixedPx);continue}let o=ke(r.minPx);if(t!==null&&t!==o)throw new RangeError(`Flexible columns share the remaining width equally, so their minimums must be equal: ${t} and ${o}`);t=o,n+=o}return n},On=e=>Re(e)+wn;var In=(e,n,t)=>{if(!(Number.isSafeInteger(e)&&e>0))throw new RangeError(`Tile count must be a positive integer: ${e}`);if(!(Number.isFinite(n)&&n>0))throw new RangeError(`Tile minimum width must be a positive px value: ${n}`);if(!(Number.isFinite(t)&&t>=0))throw new RangeError(`Tile gap must be a px value >= 0: ${t}`);let r=[];for(let s=1;s<=e;s+=1)e%s===0&&r.push({columns:s,minContainerPx:s*n+(s-1)*t});let o=`cui-tiles-n${e}-m${n}-g${t}`,i=`[data-cui-tile-grid="${o}"]`,d=r.map(({columns:s,minContainerPx:R})=>{let p=`${i}{grid-template-columns:repeat(${s},minmax(0,1fr))}`;return s===1?p:`@container (min-width:${m(R)}){${p}}`});return{key:o,steps:r,css:d.join("")}};var Nn=(e,n)=>{let t=F(e,n);return t.kind==="ready"?{...t,value:{...t.value,loadingMore:!1}}:t},Mn=(e,n)=>$(e,n.ok?{ok:!0,value:{rows:n.value.rows,next:n.value.next,meta:n.value.meta,loadingMore:!1,moreFailure:null}}:n),Ln=e=>e.kind==="ready"&&!e.refreshing&&e.value.next!==null&&!e.value.loadingMore?{...e,value:{...e.value,loadingMore:!0}}:e,Fn=(e,n,t)=>{if(!(e.kind==="ready"&&e.value.loadingMore&&Object.is(e.value.next,n)))return e;if(t.ok)return{...e,value:{...e.value,rows:[...e.value.rows,...t.value.rows],next:t.value.next,loadingMore:!1,moreFailure:null}};let r=e.value.moreFailure===null?1:e.value.moreFailure.occurrence+1;return{...e,value:{...e.value,loadingMore:!1,moreFailure:{reason:t.reason,occurrence:r}}}},$n=(e,n)=>{if(e.kind!=="ready")return e;let{rows:t,meta:r}=n({rows:e.value.rows,meta:e.value.meta});return{...e,value:{...e.value,rows:t,meta:r}}};var An=/^#[0-9a-f]{6}$/i,Dn=/^[a-z][a-z0-9-]*$/,Ee=e=>{if(!An.test(e))throw new RangeError(`A palette colour must be #rrggbb: ${e}`);return e},Ce=({light:e,dark:n})=>`light-dark(${Ee(e)}, ${Ee(n)})`,Un=e=>{if(!Dn.test(e))throw new RangeError(`A root attribute must be lowercase letters, digits and hyphens, starting with a letter: ${e}`);return`[${e}] ::placeholder { color: ${Ce(a.color["fg-muted"])}; opacity: 1; }`};var Se=["indigo","violet","purple","fuchsia","pink","rose","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue"],vn=["fg","tint","accent","line","solid","solid-hover"],Bn={indigo:{fg:{light:"#372aac",dark:"#c6d2ff"},tint:{light:"#eff3ff",dark:"#1e1a4d"},accent:{light:"#4f39f6",dark:"#7c86ff"}},violet:{fg:{light:"#5d0ec0",dark:"#ddd6ff"},tint:{light:"#f5f3ff",dark:"#2f0d68"},accent:{light:"#7f22fe",dark:"#a684ff"}},purple:{fg:{light:"#6e11b0",dark:"#e9d4ff"},tint:{light:"#faf5ff",dark:"#3c0366"},accent:{light:"#9810fa",dark:"#c27aff"}},fuchsia:{fg:{light:"#8a0194",dark:"#f6cfff"},tint:{light:"#fdf4ff",dark:"#4b004f"},accent:{light:"#c800de",dark:"#ed6aff"}},pink:{fg:{light:"#a3004c",dark:"#fccee8"},tint:{light:"#fdf2f8",dark:"#510424"},accent:{light:"#e60076",dark:"#fb64b6"}},rose:{fg:{light:"#a50036",dark:"#ffccd3"},tint:{light:"#fff1f2",dark:"#4d0218"},accent:{light:"#ec003f",dark:"#ff637e"}},red:{fg:{light:"#9f0712",dark:"#ffc9c9"},tint:{light:"#fef2f2",dark:"#460809"},accent:{light:"#e7000b",dark:"#ff6467"}},orange:{fg:{light:"#7e2a0c",dark:"#ffd6a7"},tint:{light:"#fff7ed",dark:"#441306"},accent:{light:"#f54900",dark:"#ff8904"}},amber:{fg:{light:"#7b3306",dark:"#fee685"},tint:{light:"#fffbeb",dark:"#461901"},accent:{light:"#bb4d00",dark:"#fcbb00"}},yellow:{fg:{light:"#733e0a",dark:"#fff085"},tint:{light:"#fefce8",dark:"#432004"},accent:{light:"#a65f00",dark:"#fdc700"}},lime:{fg:{light:"#35530e",dark:"#d8f999"},tint:{light:"#f7fee7",dark:"#192e03"},accent:{light:"#497d00",dark:"#9ae600"}},green:{fg:{light:"#0d542b",dark:"#b9f8cf"},tint:{light:"#f0fdf4",dark:"#032e15"},accent:{light:"#008236",dark:"#05df72"}},emerald:{fg:{light:"#004f3b",dark:"#a4f4cf"},tint:{light:"#ecfdf5",dark:"#002c22"},accent:{light:"#009966",dark:"#00d492"}},teal:{fg:{light:"#0b4f4a",dark:"#96f7e4"},tint:{light:"#f0fdfa",dark:"#022f2e"},accent:{light:"#009689",dark:"#00d5be"}},cyan:{fg:{light:"#104e64",dark:"#a2f4fd"},tint:{light:"#ecfeff",dark:"#053345"},accent:{light:"#0092b8",dark:"#00d3f2"}},sky:{fg:{light:"#024a70",dark:"#b8e6fe"},tint:{light:"#f0f9ff",dark:"#052f4a"},accent:{light:"#0084d1",dark:"#00bcff"}},blue:{fg:{light:"#193cb8",dark:"#bedbff"},tint:{light:"#eff6ff",dark:"#162456"},accent:{light:"#155dfc",dark:"#51a2ff"}}},y=({light:e,dark:n})=>Object.freeze({light:e,dark:n}),Hn=({fg:e,tint:n,accent:t})=>Object.freeze({fg:y(e),tint:y(n),accent:y(t),line:y({light:e.dark,dark:e.light}),solid:y(e),"solid-hover":y({light:n.dark,dark:n.light})}),Wn=Object.freeze(Object.fromEntries(Se.map(e=>[e,Hn(Bn[e])])));export{w as a,_e as b,J as c,q as d,Ne as e,f,l as g,Ue as h,ve as i,L as j,He as k,oe as l,We as m,ze as n,Kn as o,Ge as p,F as q,$ as r,T as s,C as t,Xe as u,je as v,de as w,b as x,ue as y,me as z,a as A,ln as B,h as C,x as D,u as E,G as F,gn as G,pn as H,yn as I,Tn as J,bn as K,hn as L,P as M,En as N,ct as O,Cn as P,he as Q,ut as R,Sn as S,m as T,_n as U,Tt as V,Re as W,On as X,In as Y,Nn as Z,Mn as _,Ln as $,Fn as aa,$n as ba,Ce as ca,Un as da,Se as ea,vn as fa,Wn as ga};
|