@maxio-com/react-ui-components 9.20.1 → 9.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/skills/maxio-react/SKILL.md +2 -0
- package/dist/skills/maxio-react/references/components-copy-to-clipboard.md +184 -0
- package/dist/skills/maxio-react/references/components-data-table.md +1 -1
- package/dist/skills/maxio-react/references/components-drawer.md +1 -1
- package/dist/skills/maxio-react/references/components-empty-state.md +173 -0
- package/dist/skills/maxio-react/references/components-toggle.md +1 -1
- package/dist/skills/maxio-react/references/components-tooltip.md +1 -1
- package/package.json +2 -2
- package/typings/index.d.ts +41 -10
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import a,{useRef as t,useEffect as l,useState as n,forwardRef as i,cloneElement as o,isValidElement as r,createContext as s,useId as c,useContext as m,Children as d,useMemo as u,useCallback as p,useLayoutEffect as v,useImperativeHandle as g}from"react";import x from"classnames";import{useId as b,useLink as h,useButton as f,usePress as E,useFocusRing as _,mergeProps as w,useCheckboxGroupItem as N,useCheckbox as y,useCheckboxGroup as I,useRadio as k,useRadioGroup as R,useTextField as C,useProgressBar as S,useToggleButton as P}from"react-aria";import{useObjectRef as $,useResizeObserver as D}from"@react-aria/utils";import{flexRender as T,useReactTable as M,getSortedRowModel as O,getExpandedRowModel as z,getCoreRowModel as B}from"@tanstack/react-table";export{createColumnHelper}from"@tanstack/react-table";import{dropTargetForElements as A,draggable as L,monitorForElements as W}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/adapter.js";import{attachInstruction as F,extractInstruction as H}from"@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/tree-item.js";import{useToggleState as V}from"@react-stately/toggle";import{useCheckboxGroupState as j}from"@react-stately/checkbox";import{Popover as K,OverlayArrow as q,Button as U,TooltipTrigger as G,Tooltip as Z,MenuTrigger as Y,Menu as X,MenuItem as Q,ModalOverlay as J,Modal as ee,Dialog as ae,ListBox as te,composeRenderProps as le,ListBoxItem as ne,ListBoxSection as ie,Header as oe,ComboBox as re,Label as se,Input as ce,Text as me,FieldError as de,TextField as ue,TextArea as pe,ToggleButtonGroup as ve,ToggleButton as ge,SelectionIndicator as xe,Tab as be,Tabs as he,TabPanel as fe,TabPanels as Ee,TabListStateContext as _e,TabList as we}from"react-aria-components";export{DialogTrigger,Pressable}from"react-aria-components";import{AnimatePresence as Ne,motion as ye}from"framer-motion";import{useDismiss as Ie,useFocus as ke,useHover as Re,useClick as Ce,useFloating as Se,offset as Pe,useInteractions as $e,useRole as De,FloatingPortal as Te}from"@floating-ui/react-dom-interactions";import{useRadioGroupState as Me}from"@react-stately/radio";import{useToastState as Oe,useToastQueue as ze,ToastQueue as Be}from"@react-stately/toast";import{useToast as Ae,useToastRegion as Le}from"@react-aria/toast";const We=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],Fe=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],He=["avalara","pipedrive","quickbooks","salesforce","xero"],Ve=({variant:e,color:t,className:l,size:n})=>{const i=(e,a)=>a.includes(e),o=i(e,We)||i(e,Fe),r=i(e,He),s=x({"fa-kit":o,"fa-kit-duotone":r,"fa-sharp fa-regular":!o&&!r,[`fa-${e}`]:!0,[`fa-${n}`]:n,[`maxio-icon--${t}`]:t&&!i(e,Fe)&&!i(e,He)},l);return a.createElement("i",{className:s})},je=({item:e,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=t(null),c=t(!1),m=b();if(l(()=>{var e;n&&c.current&&(null===(e=s.current)||void 0===e||e.focus())},[n]),l(()=>{c.current=!0},[]),"divider"===e.type)return a.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:v,description:g,link:h}=e,f=x("maxio-action-list__label",{"maxio-truncate":i});return a.createElement("a",{"aria-labelledby":m,...h,className:x("maxio-action-list__content",h.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},d&&a.createElement(Ve,{variant:d,className:x("maxio-action-list__leading-icon",u)}),a.createElement("span",{className:f,id:m},v),g&&a.createElement("span",{className:"maxio-action-list__description"},g),p&&a.createElement(Ve,{variant:p,className:"maxio-action-list__trailing-icon"}))},Ke=(e,a,t)=>0===e?e:1===e&&"divider"===a[e-1].type?t||e:"divider"===a[e-1].type?Ke(e-1,a,t||e):e-1,qe=({items:e,isShadowed:t=!0,itemProps:l={},className:i,truncateLabels:o=!1,small:r=!1,...s})=>{const c=x("maxio-action-list",i,{"maxio-action-list--shadow":t}),[m,d]=n(()=>e.findIndex(e=>"divider"!==e.type));return 0===e.length?null:a.createElement("div",{className:c,onKeyDown:a=>{if("Space"===a.code||"Enter"===a.code){const a=e[m];a&&"divider"!==a.type&&window.open(a.link.href,a.link.target||"_self")}"ArrowUp"===a.code&&(a.preventDefault(),d(a=>Ke(a,e))),"ArrowDown"===a.code&&(a.preventDefault(),d(a=>((e,a)=>{const t=a.findIndex((a,t)=>"divider"!==a.type&&t>e);return-1===t?e:t})(a,e)))},role:"listbox",...s},e.map((e,t)=>a.createElement(je,{item:e,truncateLabel:o,key:`listbox-${e.id}`,isSelected:t===m,small:r,...l})))},Ue=({className:e,children:t,disabled:l,external:n,icon:i,size:o="sm",underline:r,variant:s,...c})=>{const m=x("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":l,[`maxio-link--${s}`]:s,"maxio-link--underline":r},e),d=n?"_blank":"_self";return a.createElement("a",{className:m,target:d,...c},t,i&&a.createElement(Ve,{variant:i,className:"maxio-link__icon"}))},Ge=({size:e="md",white:t=!1,className:l})=>{const n=x("maxio-loading-spinner",l,`maxio-loading-spinner--${e}`,{"maxio-loading-spinner--white":t});return a.createElement("div",{className:n,role:"status","aria-label":"loading"})},Ze=i(({fullWidth:e=!1,leadingElement:t,trailingElement:l,icon:n,variant:i="primary",size:s,...c},m)=>{const d=$(m),{linkProps:u}=h({...c},d),p=x("maxio-button",c.className,{[`maxio-button--${s}`]:s,[`maxio-button--${i}`]:i,"maxio-button--full-width":e});return a.createElement("a",{...u,ref:d,className:p,href:c.href},t&&o(t,{...r(t)&&{className:"maxio-button__leading-element"}}),c.children,(l||n)&&o(l||n,{...r(l||n)&&{className:"maxio-button__trailing-element"}}))}),Ye=i(({disabled:e,loading:t=!1,fullWidth:l=!1,leadingElement:n,trailingElement:i,icon:s,variant:c="primary",size:m,...d},u)=>{const p=$(u),{buttonProps:v}=f({...d,isDisabled:e,formAction:"string"==typeof d.formAction?d.formAction:void 0},p),g=["primary","danger"].includes(c),b=x("maxio-button",d.className,{[`maxio-button--${m}`]:m,[`maxio-button--${c}`]:c,"maxio-button--loading":t,"maxio-button--full-width":l});return a.createElement("button",{...v,className:b,ref:p},n&&o(n,{...r(n)&&{className:"maxio-button__leading-element"}}),d.children,!t&&(i||s)&&o(i||s,{...r(i||s)&&{className:"maxio-button__trailing-element"}}),t&&a.createElement(Ge,{className:"maxio-button__trailing-element",size:"md",white:g}))}),Xe=i((e,t)=>(e=>"href"in e)(e)?a.createElement(Ze,{...e,ref:t}):a.createElement(Ye,{...e,ref:t})),Qe=({"aria-label":e,className:t,...l})=>a.createElement(Xe,{"aria-label":e,className:x("maxio-button--icon",t),...l},null),Je=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Alert component requires either children or title prop to be rendered"),null;const m=x("maxio-alert",{[`maxio-alert--${r}`]:"info"!==r&&r},c),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return a.createElement("div",{className:m},a.createElement(Ve,{variant:d,className:"maxio-alert__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-alert__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-alert__title"},t),e&&a.createElement("span",{className:"maxio-alert__message"},e),l&&i&&a.createElement(Ue,{className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(Qe,{icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-alert__dismiss"}))},ea=s({}),aa=({children:e})=>{const[t,l]=n(!1),i=c(),o=c();return a.createElement(ea.Provider,{value:{controlsId:i,buttonId:o,isOpen:t,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},e)};function ta(){const e=m(ea);if(!e||"object"==typeof e&&0===Object.keys(e).length)throw new Error("useMenu hook must be used within a MenuProvider");return e}const la=({children:e})=>{const{isOpen:t,onToggle:l,onClose:n}=ta();return a.createElement("details",{open:t,onToggle:l,className:"maxio-action-menu"},"function"==typeof e?e({isOpen:t,onClose:n}):e)},na=({children:e})=>a.createElement(aa,null,a.createElement(la,null,e)),ia=({items:e,alignItemsEnd:t=!1})=>{const l=x("maxio-action-menu__content",{"maxio-action-menu__content--align-end":t}),{controlsId:n,buttonId:i}=ta();return a.createElement("div",{className:l,role:"presentation"},a.createElement(qe,{role:"menu",itemProps:{role:"menuitem"},id:n,"aria-labelledby":i,items:e}))},oa=({children:e,iconName:t="chevron-down","aria-label":l,size:n="md",variant:i="secondary"})=>{const o=x({"maxio-action-menu__chevron":"chevron-down"===t}),r=x("maxio-button",`maxio-button--${i}`,`maxio-button--${n}`,{"maxio-button--icon":t&&!e}),{isOpen:s,buttonId:c,controlsId:m}=ta();return a.createElement("summary",{className:r,"aria-haspopup":"true","aria-label":l,"aria-expanded":s,"aria-controls":m,id:c},e&&a.createElement("span",null,e),t&&a.createElement(Ve,{variant:t,className:`${o} maxio-button__trailing-element`}))},ra=({className:e,src:t,alt:l="avatar"})=>a.createElement("img",{className:x("maxio-avatar",e),alt:l,src:t}),sa=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Banner component requires either children or title prop to be rendered"),null;const m=x("maxio-banner",{[`maxio-banner--${r}`]:"info"!==r&&r,className:c}),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return a.createElement("div",{className:m,"aria-live":"assertive"},a.createElement(Ve,{variant:d,className:"maxio-banner__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-banner__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-banner__title"},t),e&&a.createElement("span",{className:"maxio-banner__message"},e),l&&i&&a.createElement(Ue,{href:i,..."warning"!==r&&{variant:"inverse"},underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(Qe,{icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-banner__dismiss"}))},ca=({children:e,className:t,href:l,...n})=>{const i=l?a.createElement(Ue,{size:"sm",href:l},e):e;return a.createElement("li",{className:x("maxio-breadcrumbs__item",t),...n},i)},ma="Breadcrumbs requires at least one BreadcrumbsItem as children",da='Last BreadcrumbsItem should not have "href" prop. It is the current page.',ua="Breadcrumbs only accepts BreadcrumbsItem as children",pa=({className:e,children:t,...l})=>{const n=d.count(t);if(0===n)throw new Error(ma);const i=d.map(t,(e,a)=>{if(r(e)&&e.type===ca){if(a===n-1&&e.props.href)throw new Error(da);return o(e,{"aria-current":a===n-1?"page":void 0})}throw new Error(ua)});return a.createElement("nav",{"aria-label":"Breadcrumb",...l},a.createElement("ol",{className:x("maxio-breadcrumbs",e)},i))},va="row-controls",ga="row-actions",xa=({children:e,pattern:t,size:l,isExpandable:i,isUsingCustomRow:o})=>{const[r,s]=n(!1),[c,m]=n(!1),d=t&&o&&i,u=x("maxio-data-table",{"maxio-data-table--pattern":t&&!d,"maxio-data-table--expanded-child-pattern":d,"maxio-data-table--with-custom-row":o,[`maxio-data-table--${l}`]:l,"maxio-data-table--with-pinned-left-border":r,"maxio-data-table--with-pinned-right-border":c});return a.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const a=e.target;s(a.scrollLeft>0),m(a.scrollWidth-a.clientWidth-a.scrollLeft>0)}},a.createElement("table",{className:u},e))},ba=({children:e})=>a.createElement("thead",null,e),ha=({children:e})=>a.createElement("tbody",null,e),fa=({children:e,table:t,header:l,className:n,enableExpanding:i,...o})=>{var r,s,c,m,d,u,p,v,g,b,h;const f=null==l?void 0:l.column,E=null===(r=null==f?void 0:f.getCanSort)||void 0===r?void 0:r.call(f),_=null===(s=null==f?void 0:f.getToggleSortingHandler)||void 0===s?void 0:s.call(f),w=null==l?void 0:l.isPlaceholder,N=null===(m=null===(c=null==f?void 0:f.columnDef)||void 0===c?void 0:c.meta)||void 0===m?void 0:m.align,y=null===(u=null===(d=null==f?void 0:f.columnDef)||void 0===d?void 0:d.meta)||void 0===u?void 0:u.width,I=null===(v=null===(p=null==f?void 0:f.columnDef)||void 0===p?void 0:p.meta)||void 0===v?void 0:v.controls,k=null===(b=null===(g=null==f?void 0:f.columnDef)||void 0===g?void 0:g.meta)||void 0===b?void 0:b.actions,R=null==f?void 0:f.getIsPinned(),C=null==f?void 0:f.getIsSorted(),S="asc"===C,P=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${R}`]:R,"maxio-data-table__cell--sortable":E,"maxio-data-table__cell--active":C,[`maxio-data-table__cell--${N}`]:N,"maxio-data-table__cell--controls":I,"maxio-data-table__cell--actions":k}),$={...y?{width:y}:{},..."left"===R?{left:null==f?void 0:f.getStart("left")}:"right"===R?{right:null==f?void 0:f.getAfter("right")}:{}},D=((e,a)=>e&&a?"arrow-up":e&&!a?"arrow-down":"arrow-down-up")(!!C,S),T=null==t?void 0:t.getToggleAllRowsExpandedHandler(),M=null===(h=null==t?void 0:t.getIsAllRowsExpanded)||void 0===h?void 0:h.call(t),O=(null==l?void 0:l.headerGroup.headers[0].id)===va?1:0,z=i&&(null==l?void 0:l.index)===O;return w?null:a.createElement("th",{scope:"col",role:"columnheader","aria-sort":C?S?"ascending":"descending":"none",className:P,onClick:_,colSpan:null==l?void 0:l.colSpan,style:$,...o},a.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&z&&a.createElement(Qe,{size:"sm",variant:"ghost",icon:a.createElement(Ve,{size:"xs",variant:M?"chevron-down":"chevron-right"}),onClick:T,"aria-label":M?"Collapse all rows":"Expand all rows","data-open":M,className:"maxio-data-table__expand-button"}),e,E&&a.createElement(Ve,{variant:D,className:"maxio-data-table__sort-icon"})))},Ea=e=>{var a;return null!==(a=e.subRows)&&void 0!==a?a:[]},_a=(e,a)=>Object.assign({},e,{subRows:a}),wa=(e,a,t=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...t,l];if(n===a)return i;const o=wa(Ea(n),a,i);if(o)return o}return null},Na=(e,a)=>{const[t,...l]=a,n=e[t];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(t,1),{data:i,item:n};const o=Na(Ea(n),l);return o?(i[t]=_a(n,o.data),{data:i,item:o.item}):null},ya=(e,a,t,l)=>{const n=[...e];if(0===a.length)return n.splice(t,0,l),n;const[i,...o]=a,r=e[i];if(!r)return null;const s=ya(Ea(r),o,t,l);return s?(n[i]=_a(r,s),n):null},Ia=(e,a)=>{let t,l=e;for(const e of a){if(t=l[e],!t)return;l=Ea(t)}return t},ka="maxio-data-table-row",Ra=s(null),Ca=()=>m(Ra),Sa=e=>e.type===ka&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,Pa=e=>{const a=(e=>{const a=H(e);return a&&"instruction-blocked"!==a.type?"reorder-above"===a.type?"before":"reorder-below"===a.type?"after":"make-child"===a.type?"inside":null:null})(e);return"string"==typeof e.rowId&&a?{rowId:e.rowId,position:a}:null},$a=({availability:e,children:i,data:o,enableExpanding:r,getRowReorderLabel:s,onRowReorder:m,rowReorderMode:d,table:v})=>{const g=`maxio-data-table-${c()}`,[x,b]=n(""),[h,f]=n(null),[E,_]=n(null),w=t(null),N=p(e=>v.getCoreRowModel().rowsById[e],[v]),y=p(e=>{var a;return null!==(a=null==s?void 0:s(e))&&void 0!==a?a:e.id},[s]),I=p((e,a)=>{const t=N(e),l=N(a.rowId);if(!t||!l)return null;const n=((e,a,t,l,n)=>{var i,o;if(a.id===t.id||!((e,a,t,l)=>{var n,i;return"all"===l||("siblings"===l?"inside"!==t&&(null!==(n=e.parentId)&&void 0!==n?n:null)===(null!==(i=a.parentId)&&void 0!==i?i:null):"inside"===t?e.depth===a.depth+1:e.depth===a.depth)})(a,t,l,n))return null;const r=wa(e,a.original),s=wa(e,t.original);if(!r||!s||(m=s,(c=r).length<m.length&&c.every((e,a)=>m[a]===e)))return null;var c,m;const d=Na(e,r);if(!d)return null;const u=((e,a)=>{const t=[...e],l=a.length-1;return l>=0&&e.length>l&&a.slice(0,l).every((a,t)=>e[t]===a)&&a[l]<e[l]&&(t[l]-=1),t})(s,r),p=u[u.length-1];if(void 0===p)return null;const v="inside"===l?u:u.slice(0,-1),g=Ia(d.data,u);if(!g)return null;const x="inside"===l?Ea(g).length:p+("after"===l?1:0),b={parentRowId:"inside"===l?t.id:null!==(i=t.parentId)&&void 0!==i?i:null,index:x},h={parentRowId:null!==(o=a.parentId)&&void 0!==o?o:null,index:a.index};if(h.parentRowId===b.parentRowId&&h.index===b.index)return null;const f=ya(d.data,v,x,d.item);return f?{data:f,source:h,destination:b}:null})(o,t,l,a.position,d);return n&&!r&&null!==n.destination.parentRowId&&n.destination.parentRowId!==n.source.parentRowId?null:n},[o,r,N,d]),k=p(e=>{w.current=e,f(e)},[]),R=p((e,a)=>{const t=N(e),l=N(a.rowId),n=I(e,a);return t&&l&&n?(m({...n,row:t,rowId:t.id,targetRow:l,targetRowId:l.id,position:a.position}),b(`${y(t)} moved ${i=y(l),o=a.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(b("That row cannot be moved to this position."),!1);var i,o},[y,I,N,m]),C=p((e,{input:a,element:t,source:l})=>{const n={rowId:e.id,instanceId:g},i=F(n,{element:t,input:a,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),o=Pa(i),r=Sa(l.data)&&l.data.instanceId===g&&Boolean(o&&I(l.data.rowId,o));return{...i,isValid:r}},[I,g]),S=p((a,t)=>{if(!e.available)return()=>{};const l=e=>{const a=e.isValid?Pa(e):null;k(a)};return A({element:t,canDrop:({source:e})=>Sa(e.data)&&e.data.instanceId===g&&e.data.rowId!==a.id&&!a.getParentRows().some(a=>a.id===e.data.rowId),getData:e=>C(a,e),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{var e;(null===(e=w.current)||void 0===e?void 0:e.rowId)===a.id&&k(null)}})},[e,C,g,k]),P=p((a,t)=>{const l=t.closest("tr");return e.available&&l instanceof HTMLElement?L({element:l,dragHandle:t,getInitialData:()=>({type:ka,instanceId:g,rowId:a.id})}):()=>{}},[e,g]);l(()=>{if(e.available)return W({canMonitor:({source:e})=>Sa(e.data)&&e.data.instanceId===g,onDragStart:({source:e})=>{if(!Sa(e.data))return;const a=N(e.data.rowId);_(e.data.rowId),a&&b(`${y(a)} grabbed. Choose a destination.`)},onDrop:({source:e,location:a})=>{var t;if(Sa(e.data)){const l=null===(t=a.current.dropTargets[0])||void 0===t?void 0:t.data,n=!0===(null==l?void 0:l.isValid)?Pa(l):null;n?R(e.data.rowId,n):b("Row move cancelled.")}_(null),k(null)}})},[R,e,y,N,g,k]),l(()=>{if("inside"!==(null==h?void 0:h.position))return;const e=N(h.rowId);if(!(null==e?void 0:e.getCanExpand())||e.getIsExpanded())return;const a=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(a)},[h,N]);const $=p(a=>{var t;if(!e.available)return[];const l=a.parentId?N(a.parentId):null,n=null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:v.getCoreRowModel().rows,i=n.findIndex(e=>e.id===a.id);if(-1===i)return[];const o=n[i-1],r=n[i+1],s=n[0],c=n[n.length-1],m=[];if(i>1&&s&&m.push({id:"top",label:"Move to top",target:{rowId:s.id,position:"before"}}),o&&m.push({id:"up",label:"Move up",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),i<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),l){let e=l;for(;e.parentId;){const a=N(e.parentId);if(!a)break;e=a}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return v.getCoreRowModel().flatRows.forEach(e=>{e.id!==a.parentId&&m.push({id:`move-to:${e.id}`,label:`Move to ${y(e)}`,target:{rowId:e.id,position:"inside"}})}),m.filter(e=>Boolean(I(a.id,e.target)))},[e,y,I,N,v]),D=p(a=>{var t;if(!e.available)return!1;const l=a.parentId?N(a.parentId):null;return(null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:v.getCoreRowModel().rows).length>1||"siblings"!==d&&("all"===d?Boolean(l):!(!r||0===a.depth)&&v.getCoreRowModel().flatRows.some(e=>e.depth===a.depth-1&&e.id!==a.parentId))},[e,r,N,d,v]),T=u(()=>({activeTarget:h,availability:e,draggingRowId:E,getActions:$,getLabel:y,hasActions:D,moveRow:R,registerHandle:P,registerRow:S}),[h,e,R,E,$,y,D,P,S]);return a.createElement(Ra.Provider,{value:T},i,a.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},x))},Da=({children:e,row:t,isChild:l,isHeader:n,className:i,onRowAction:o,...r})=>{var s,c,m,d,u;const p=null===(s=null==t?void 0:t.getIsSelected)||void 0===s?void 0:s.call(t),v=(null===(c=null==t?void 0:t.getCanExpand)||void 0===c?void 0:c.call(t))&&(null===(m=null==t?void 0:t.getIsExpanded)||void 0===m?void 0:m.call(t)),g=Boolean(t&&o&&!n&&!l),b=a.useRef(null),h=Ca(),f=null==h?void 0:h.registerRow,N=a.useRef(null),y=e=>{N.current=e.target},{pressProps:I}=E({isDisabled:!g,onPress:e=>{var a;const l=null!==(a=N.current)&&void 0!==a?a:e.target;N.current=null,t&&o&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(l)&&o(t)}}),{focusProps:k,isFocused:R}=_(),C=x({"maxio-data-table__row":!n,"maxio-data-table__header-row":n,"maxio-data-table__row--active":p||R,"maxio-data-table__row--expanded":v,"maxio-data-table__row--expanded-child":l,"maxio-data-table__row--actionable":g,"maxio-data-table__row--dragging":Boolean(t)&&(null==h?void 0:h.draggingRowId)===(null==t?void 0:t.id),[`maxio-data-table__row--drop-${null===(d=null==h?void 0:h.activeTarget)||void 0===d?void 0:d.position}`]:Boolean(t)&&(null===(u=null==h?void 0:h.activeTarget)||void 0===u?void 0:u.rowId)===(null==t?void 0:t.id)},i);a.useEffect(()=>{if(t&&f&&b.current&&!n&&!l)return f(t,b.current)},[l,n,f,t]);const S=g?w({onClickCapture:y,onKeyDownCapture:y,tabIndex:0},I,k,r):r;return a.createElement("tr",{...S,ref:b,className:C,tabIndex:g?S.tabIndex:r.tabIndex},e)},Ta=s({}),Ma=i(({checked:e,disabled:t,invalid:l,indeterminate:n,className:i,inputProps:o,error:r,label:s},c)=>{const m=x("maxio-checkbox",{"maxio-checkbox--checked":e,"maxio-checkbox--disabled":t,"maxio-checkbox--error":l,"maxio-checkbox--indeterminate":n},i);return a.createElement("label",{className:m},a.createElement("input",{type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:c,...o}),a.createElement("span",{className:"maxio-checkbox__control"},r&&a.createElement("span",{className:"maxio-checkbox__control-error"})),s&&a.createElement("span",{className:"maxio-checkbox__label"},s))});Ma.displayName="InnerCheckbox";const Oa=({label:e,error:l=!1,className:n,indeterminate:i,value:o="",disabled:r,readOnly:s,defaultChecked:c,checked:d,...u})=>{const p=t(null),v=m(Ta),{inputProps:g,isDisabled:x,isInvalid:b,isSelected:h}=v&&Object.keys(v).length>0?N({value:o,"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,...u},v,p):y({"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,value:o,...u},V({...u,isSelected:d,defaultSelected:c}),p);return a.createElement(Ma,{inputProps:g,checked:h,disabled:x,invalid:b,indeterminate:i,className:n,error:l,label:e,ref:p,...u})},za=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-helper-text",t),...l},e),Ba=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-error",t),...l},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},e)),Aa=({helperText:e,className:t,errorMessage:l,children:n,disabled:i,label:o,defaultValue:r,name:s,...c})=>{var m;const d=j({defaultValue:r,name:s,errorMessage:l,description:e,label:o,isDisabled:i,isInvalid:!!l,...c}),{groupProps:u,labelProps:p,descriptionProps:v,errorMessageProps:g,isInvalid:b}=I({"aria-label":null===(m=null!=o?o:c["aria-label"])||void 0===m?void 0:m.toString(),isDisabled:i,isInvalid:!!l,...c},d),h=x("maxio-checkbox-group",{"maxio-checkbox-group--disabled":i},t),f=e&&!l;return a.createElement("div",{className:h,...u},o&&a.createElement("label",{className:"maxio-checkbox-group__label",...p},o),a.createElement(Ta.Provider,{value:d},n),f&&a.createElement(za,{...v},e),l&&b&&a.createElement(Ba,{...g},l))},La=({table:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleAllPageRowsSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsAllPageRowsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomePageRowsSelected)||void 0===r?void 0:r.call(e);return t?a.createElement(a.Fragment,null,l&&a.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),a.createElement(Oa,{"aria-label":"Select all rows",onChange:e=>{s("boolean"==typeof e?{target:{checked:e}}:e)},checked:c,indeterminate:!c&&m})):null},Wa=({className:e,hideArrow:t=!1,children:l,offset:n=4,...i})=>a.createElement(K,{...i,className:x("maxio-popover",e),offset:n},a.createElement(a.Fragment,null,!t&&a.createElement(q,{className:"maxio-popover__arrow"},a.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},a.createElement("path",{d:"M0 0 L6 6 L12 0"}))),l)),Fa=({row:e})=>{var t,l;const n=Ca(),i=null==n?void 0:n.registerHandle,o=null==n?void 0:n.getActions,r=null==n?void 0:n.hasActions,s=a.useRef(null),[c,m]=a.useState(!1),d=(null==n?void 0:n.draggingRowId)===e.id,u=null!==(t=null==n?void 0:n.getLabel(e))&&void 0!==t?t:e.id,p=a.useMemo(()=>{var a;return null!==(a=null==r?void 0:r(e))&&void 0!==a&&a},[r,e]),v=a.useMemo(()=>{var a;return c&&null!==(a=null==o?void 0:o(e))&&void 0!==a?a:[]},[o,c,e]),g=null!==(l=n&&!n.availability.available?n.availability.message:void 0)&&void 0!==l?l:p?void 0:`No moves are available for ${u}.`;a.useEffect(()=>{if(i&&s.current&&!g)return i(e,s.current)},[i,e,g]),a.useEffect(()=>{g&&m(!1)},[g]);const x=a.createElement(U,{ref:s,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${u}`,"aria-pressed":d,"aria-disabled":!!g||void 0,onPress:()=>{g||m(!0)}},a.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(g?"maxio-icon--disabled":"maxio-icon--secondary")}));return g?a.createElement(G,{delay:0,closeDelay:0},x,a.createElement(Z,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},a.createElement("div",{className:"maxio-tooltip__content"},g))):a.createElement(Y,{trigger:"longPress",isOpen:c,onOpenChange:m},x,a.createElement(Wa,{placement:"bottom start",hideArrow:!0},a.createElement(X,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:v,onAction:a=>{const t=v.find(e=>e.id===a);t&&(null==n||n.moveRow(e.id,t.target),requestAnimationFrame(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}},e=>a.createElement(Q,{id:e.id,textValue:e.label,className:"maxio-data-table__reorder-menu-item"},e.label))))},Ha=({row:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllSubRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomeSelected)||void 0===r?void 0:r.call(e),d=e.id||e.index;return a.createElement(a.Fragment,null,l&&a.createElement(Fa,{row:e}),t&&a.createElement(Oa,{"aria-label":`Select row ${d}`,onChange:s,checked:c,indeterminate:m}))},Va=({children:e})=>a.createElement("div",{className:"maxio-data-table__cell-flex"},e),ja=({row:e,cell:t,children:l,className:n,...i})=>{var o,r,s,c,m,d;const u=null==t?void 0:t.column,p=null===(r=null===(o=null==u?void 0:u.columnDef)||void 0===o?void 0:o.meta)||void 0===r?void 0:r.align,v=null===(c=null===(s=null==u?void 0:u.columnDef)||void 0===s?void 0:s.meta)||void 0===c?void 0:c.controls,g=null===(d=null===(m=null==u?void 0:u.columnDef)||void 0===m?void 0:m.meta)||void 0===d?void 0:d.actions,b=null==u?void 0:u.getIsPinned(),h=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${b}`]:b,[`maxio-data-table__cell--${p}`]:p,"maxio-data-table__cell--controls":v,"maxio-data-table__cell--actions":g}),f="left"===b?{left:null==u?void 0:u.getStart("left")}:"right"===b?{right:null==u?void 0:u.getAfter("right")}:{};return a.createElement("td",{className:h,style:f,...i},l)},Ka=({row:e,SubRowComponent:t,pattern:l,enableExpanding:n,onRowAction:i})=>{var o,r,s,c,m;const d=t&&e.getParentRow()&&e.getParentRow().getIsExpanded(),u=d&&e.getVisibleCells()[0].column.columnDef.id===va,p=d&&e.getVisibleCells()[e.getVisibleCells().length-1].column.columnDef.id===ga,v=[p,u].filter(Boolean).length,g=e.getVisibleCells().length-v,x=null!==(r=null===(o=e.getParentRow())||void 0===o?void 0:o.index)&&void 0!==r?r:e.index,b=l&&t&&x%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(s=e.getCanExpand)||void 0===s?void 0:s.call(e),f=null===(c=null==e?void 0:e.getToggleExpandedHandler)||void 0===c?void 0:c.call(e),E=null===(m=null==e?void 0:e.getIsExpanded)||void 0===m?void 0:m.call(e),_=h&&n?0:1.75,w=e.getVisibleCells()[0].column.columnDef.id===va?1:0,N=e.getVisibleCells().find(({column:e})=>{var a;const{actions:t,controls:l}=null!==(a=e.columnDef.meta)&&void 0!==a?a:{};return!t&&!l}),y=i&&N?N.id:void 0;return a.createElement(a.Fragment,{key:e.id},d?a.createElement(Da,{key:`${e.id}-sub`,row:e,isChild:!0,className:b},u&&a.createElement(ja,{className:"maxio-data-table__cell--pinned-left"}),a.createElement(ja,{colSpan:g},t(e)),p&&a.createElement(ja,{className:"maxio-data-table__cell--pinned-right"})):a.createElement(Da,{key:`${e.id}-parent`,row:e,className:b,onRowAction:i,"aria-labelledby":y},e.getVisibleCells().map(t=>{const l=n&&t.column.getIndex()===w;return a.createElement(ja,{key:t.id,row:e,cell:t,id:t.id},a.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${(null==e?void 0:e.depth)+_}rem`}:void 0},n&&h&&l&&a.createElement(Qe,{size:"sm",variant:"ghost",icon:a.createElement(Ve,{size:"xs",variant:E?"chevron-down":"chevron-right"}),onClick:f,"aria-label":E?"Collapse row":"Expand row","data-open":E,className:"maxio-data-table__expand-button"}),T(t.column.columnDef.cell,t.getContext())))})))},qa={available:!0},Ua={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},Ga={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Za={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Ya=(e=[])=>e.filter(e=>e!==va&&e!==ga),Xa=[],Qa=e=>e.subRows,Ja=({pattern:e,size:t="md",SubRowComponent:n,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:m,columns:d,actions:p,actionsColumnSize:v,onRowAction:g,enableRowReordering:x=!1,getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f="siblings",getRowId:E,getSubRows:_,state:w,...N})=>{var y,I;const k=x?void 0:n,R=!x&&s,C=(({columns:e,HeaderControls:t,RowControls:l,RowActions:n,actions:i,actionsColumnSize:o,enableExpanding:r,enableRowSelection:s,enableRowReordering:c})=>u(()=>{const m={id:va,size:s&&c?72:40,header:e=>a.createElement(t,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),cell:e=>a.createElement(l,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=i&&n?{id:ga,size:null!=o?o:40,header:"",cell:e=>a.createElement(n,null,i(e.row,e.table)),meta:{actions:!0}}:null;let u=[...e];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[i,o,n,r,s,c,e,t,l]))({columns:d,HeaderControls:La,RowControls:Ha,RowActions:Va,actions:p,actionsColumnSize:v,enableRowSelection:c,enableRowReordering:x,enableExpanding:Boolean(m)}),S=M({state:{...w,...x&&{sorting:Xa},columnPinning:{left:[...c||x?[va]:[],...Ya(null===(y=null==w?void 0:w.columnPinning)||void 0===y?void 0:y.left)],right:[...Ya(null===(I=null==w?void 0:w.columnPinning)||void 0===I?void 0:I.right),...p?[ga]:[]]}},getCoreRowModel:B(),enableRowSelection:c,enableExpanding:Boolean(m),...!N.manualExpanding&&{getExpandedRowModel:z()},...!N.manualSorting&&!x&&{getSortedRowModel:O()},columns:C,getRowId:E,...N,getSubRows:x?Qa:null!=_?_:Qa,enableSorting:R,...x&&{getSortedRowModel:void 0}}),P=S.getCanSomeRowsExpand(),$=S.getState(),D=(({columnFilters:e,globalFilter:a,grouping:t,hasPagination:l})=>e.length>0||null!=a&&""!==a?Ua:t.length>0?Ga:l?Za:qa)({columnFilters:$.columnFilters,globalFilter:$.globalFilter,grouping:$.grouping,hasPagination:Boolean(N.getPaginationRowModel||N.manualPagination)});l(()=>{null==i||i($.expanded)},[i,$.expanded]),l(()=>{null==o||o($.rowSelection)},[o,$.rowSelection]),l(()=>{x||null==r||r($.sorting)},[x,r,$.sorting]);const A=a.createElement(xa,{pattern:e,size:t,isExpandable:P,isUsingCustomRow:Boolean(k)},a.createElement(ba,null,S.getHeaderGroups().map(e=>a.createElement(Da,{key:e.id,table:S,isHeader:!0},e.headers.map(e=>a.createElement(fa,{key:e.id,table:S,header:e,enableExpanding:m},T(e.column.columnDef.header,e.getContext())))))),a.createElement(ha,null,S.getRowModel().rows.map(t=>a.createElement(Ka,{key:t.id,row:t,pattern:e,SubRowComponent:k,enableExpanding:m,onRowAction:g}))));return x&&E&&h?a.createElement($a,{availability:D,data:N.data,enableExpanding:Boolean(m),getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f,table:S},A):A},et={sm:"h3",md:"h2",lg:"h1"},at=({children:e,size:t="sm",className:l,...n})=>{const i=et[t],o=x(`maxio-heading-${t}`,l);return a.createElement(i,{className:o,...n},e)},tt=({open:e,onOpenChange:t,placement:l="right",backdrop:n="dim",size:i="md",className:o,title:r,description:s,children:c,footer:m})=>{const d=a.useId(),u={"data-placement":l,"data-size":i};return a.createElement(J,{isOpen:e,onOpenChange:t,isDismissable:!0,className:x("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===n})},a.createElement(ee,{className:x("maxio-drawer",o),...u},a.createElement(ae,{className:"maxio-drawer__dialog","aria-labelledby":d},({close:e})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-drawer__header"},a.createElement("div",{className:"maxio-drawer__title-group"},a.createElement(at,{id:d,size:"md",className:"maxio-drawer__title"},r),s&&a.createElement("p",{className:"maxio-drawer__description"},s)),a.createElement(Qe,{"aria-label":"Close",onClick:e,icon:a.createElement(Ve,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),a.createElement("div",{className:"maxio-drawer__body"},c),null!=m&&a.createElement("div",{className:"maxio-drawer__footer"},m)))))},lt={click:Ce,hover:e=>Re(e,{delay:100}),focus:ke,dismiss:Ie},nt=(e,a)=>a.map(a=>lt[a](e)),it=({placement:e="top",isActive:a=!1,interactions:n=["hover"],floatingElementOffset:i=0,onOverlayUpdate:o,autoHideMs:r})=>{const s=t(null),{strategy:c,x:m,y:d,context:u,floating:p,reference:v}=Se({placement:e,open:a,onOpenChange:e=>o(e),middleware:[Pe(i)]}),{getReferenceProps:g,getFloatingProps:x}=$e([...nt(u,n),De(u,{role:"tooltip"})]);l(()=>{s.current&&clearTimeout(s.current),a&&r&&(s.current=window.setTimeout(()=>o(!1),r))},[a,r]);return{isActive:a,refs:{floating:p,reference:v},floatingElementCSSPosition:{position:c,top:null!=d?d:0,left:null!=m?m:0},getReferenceProps:g,getFloatingProps:x}};function ot(e,a=0){const i=t((new Date).getTime()),o=t((new Date).getTime()),[r,s]=n(!1);return l(()=>{const t=()=>{i.current=(new Date).getTime(),s(!0)},l=()=>{o.current=(new Date).getTime(),window.setTimeout(()=>{i.current-o.current<=0&&s(!1)},a)},n=e&&e.current;return n&&(n.addEventListener("mouseenter",t),n.addEventListener("mouseleave",l)),()=>{n&&(n.removeEventListener("mouseenter",t),n.removeEventListener("mouseleave",l))}},[e]),r}function rt(e=500){const[a,i]=n(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:a}=window;return{windowWitdh:e,windowHeight:a}}),o=t(null);return l(()=>{if("undefined"==typeof window)return;const a=()=>{var a;const{innerWidth:t,innerHeight:l}=window;window.clearTimeout(null!==(a=o.current)&&void 0!==a?a:void 0),o.current=window.setTimeout(()=>{i({windowWitdh:t,windowHeight:l})},e)};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[e]),a}function st(e){const[a,t]=n(()=>{var a,t;return null!==(t=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==t?t:0}),l=()=>{var a,l;const n=null!==(l=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==l?l:0;t(e=>0===n&&e>0?e:n)};return v(l,[e]),D({ref:e,onResize:l}),a}const ct=({children:e,usePortal:t=!1,isActive:l=!1,placement:n="top",interactions:i=["hover"],role:o="tooltip",renderOverlay:r,floatingElementOffset:s,motionSettings:c={},autoHideMs:m,onOverlayUpdate:d,className:u})=>{const{getReferenceProps:p,getFloatingProps:v,refs:{floating:g,reference:b},floatingElementCSSPosition:h}=it({isActive:l,onOverlayUpdate:d,autoHideMs:m,floatingElementOffset:s,interactions:i,placement:n}),f=a.createElement(Ne,null,l&&a.createElement(ye.div,{ref:g,style:h,...c,...v()},r()));return a.createElement(a.Fragment,null,a.createElement("div",{ref:b,className:x("maxio-inline-flex",u),...p(),"data-testid":"overlay-trigger"},e),t?a.createElement(Te,{id:"maxio-ui-portal"},f):f)},mt=({children:e,arrowPosition:t,size:l="regular",maxWidth:n=160})=>a.createElement("div",{"data-testid":"tooltip",className:x("maxio-tooltip",`maxio-tooltip--${l}`,{[`maxio-tooltip--arrow-${t}`]:t})},a.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:n}},e)),dt={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},ut=({children:e,interactions:i=["hover"],placement:o="right",maxWidth:r=160,size:s="regular",renderContent:c,autoHideMs:m,isVisible:d,usePortal:v,className:g,onVisibilityUpdate:x,floatingElementOffset:b=5})=>{const[h,f]=n(!1),E=void 0!==d,_=t(null),w=p(e=>{_.current&&clearTimeout(_.current),_.current=window.setTimeout(()=>{E||f(e),x&&x(e)},50)},[E,x]),N=u(()=>(e=>{const a=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",t=`translate${a}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:t},animate:{opacity:1,visibility:"visible",transform:`translate${a}(0px)`},exit:{opacity:0,visibility:"hidden",transform:t},transition:{ease:[.4,0,.5,1],duration:.2}}})(o),[o]);return l(()=>()=>{_.current&&clearTimeout(_.current)},[]),a.createElement(ct,{role:"tooltip",className:g,floatingElementOffset:b,motionSettings:N,isActive:E?d:h,onOverlayUpdate:w,autoHideMs:m,usePortal:v,placement:o,interactions:i,renderOverlay:()=>a.createElement(mt,{size:s,arrowPosition:dt[o],maxWidth:r},c())},e)},pt=({as:e="div",children:t,compact:l=!1,size:n="md",className:i,...o})=>{const r=e,s=x({[`maxio-body-${n}`]:!l,[`maxio-body-${n}-compact`]:l},i);return a.createElement(r,{className:s,...o},t)},vt=({className:e,render:t,showSelectAll:l=!1,...n})=>a.createElement(te,{...n,className:le(e,e=>x("maxio-listbox",e)),render:(e,n)=>{const{selectionManager:i}=n.state,o=t?t(e,n):a.createElement("div",{...e});if("multiple"!==i.selectionMode||!l)return o;if(0===[...i.collection.getKeys()].filter(e=>{const a=i.collection.getItem(e);return"item"===(null==a?void 0:a.type)&&i.canSelectItem(e)}).length)return o;const r=i.isSelectAll,s=r&&i.disallowEmptySelection;return a.createElement("div",null,a.createElement("div",{className:"maxio-listbox__select-all"},a.createElement(Xe,{type:"button",variant:"ghost",trailingElement:a.createElement(Ve,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:s,onClick:()=>i.toggleSelectAll()},"Select all")),o)}});vt.displayName="ListBox";const gt=({className:e,...t})=>{const l=t.textValue||("string"==typeof t.children?t.children:void 0);return a.createElement(ne,{...t,textValue:l,className:x("maxio-listbox__item",e)},le(t.children,(e,{isSelected:t})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-listbox__content"},"string"==typeof e?a.createElement(pt,{size:"sm"},e):e),t&&a.createElement(Ve,{variant:"check"}))))};gt.displayName="ListBox.Item";const xt=({className:e,...t})=>a.createElement(ie,{...t,className:x("maxio-listbox__section",e)});xt.displayName="ListBox.Section";const bt=({className:e,...t})=>a.createElement(oe,{...t,className:x("maxio-listbox__header",e)});bt.displayName="ListBox.Header";const ht=Object.assign(vt,{Item:gt,Section:xt,Header:bt}),ft=({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,fullWidth:c,className:m,placeholder:d,renderEmptyState:u,selectionMode:p,children:v,...g})=>{const b=a.useRef(null),h=a.useRef(null),[f,E]=a.useState(),[_,w]=a.useState(0),N=!!r,y=t||N,I=v,k=a.useCallback(()=>{const e=b.current;if(!e)return;const a=h.current,t=a?a.getBoundingClientRect().left-e.getBoundingClientRect().left:0;w(e=>e===-t?e:-t),E(a=>{const t=`${e.offsetWidth}px`;return(null==a?void 0:a["--trigger-width"])===t?a:{"--trigger-width":t}})},[]);a.useEffect(()=>{const e=b.current;if(!e)return;if(k(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(k);return a.observe(e),()=>a.disconnect()},[k]);const R=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":y,"maxio-text-field--readonly":l,"maxio-text-field--full-width":c},m);return a.createElement(re,{...g,isDisabled:e,isInvalid:y,isReadOnly:l,selectionMode:p,className:R},i&&a.createElement(se,{className:"maxio-text-field__label"},i),a.createElement("div",{ref:b,className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(ce,{ref:h,className:"maxio-text-field__input",placeholder:d}),a.createElement("div",{className:"maxio-text-field__trailing-element"},a.createElement(U,{className:x("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},a.createElement(Ve,{variant:"chevron-up-down"})))),o&&!N&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},e=>a.createElement(a.Fragment,null,a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},"function"==typeof r?r(e):r))),a.createElement(Wa,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:_,style:f},a.createElement(ht,{renderEmptyState:u},I)))};ft.displayName="ComboBox";const Et=e=>a.createElement(ht.Item,{...e});Et.displayName="ComboBox.Item";const _t=e=>a.createElement(ht.Section,{...e});_t.displayName="ComboBox.Section";const wt=e=>a.createElement(ht.Header,{...e});wt.displayName="ComboBox.Header";const Nt=Object.assign(ft,{Item:Et,Section:_t,Header:wt}),yt=s({}),It=({indent:e=!1,disabled:l=!1,invalid:n=!1,label:i,...o})=>{const r=t(null),s=m(yt),{inputProps:c,isDisabled:d}=k({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||i,isDisabled:l},s,r),u=x("maxio-radio",{"maxio-radio--indent":e,"maxio-radio--disabled":d||s.isDisabled,"maxio-radio--error":n||s.isInvalid});return a.createElement("label",{className:u},a.createElement("input",{ref:r,role:"radio",type:"radio",className:"maxio-radio__input",...c,name:s.name||c.name}),a.createElement("span",{className:"maxio-radio__control"}),a.createElement("span",{className:"maxio-radio__label"},i))},kt=({children:e,label:t,errorMessage:l,helperText:n,disabled:i=!1,invalid:o=!1,name:r,defaultValue:s,...c})=>{const m=Me({isDisabled:i,isInvalid:o,description:n,name:r,label:t,errorMessage:l,defaultValue:s,...c}),{radioGroupProps:d,labelProps:u,descriptionProps:p,errorMessageProps:v}=R({"aria-label":c["aria-label"]||t,...c},m);return a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-radio-group",...d},t&&a.createElement("label",{className:"maxio-radio-group__label",...u},t),a.createElement(yt.Provider,{value:m},e),o&&l&&a.createElement(Ba,{...v},l),n&&!o&&a.createElement(za,{...p},n)))},Rt=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,trailingElement:c=null,fullWidth:m,className:d,...u},p)=>{const v=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":t,"maxio-text-field--readonly":l,"maxio-text-field--full-width":m},d);return a.createElement(ue,{...u,isDisabled:e,isReadOnly:l,isInvalid:t,className:v},i&&a.createElement(se,{className:"maxio-text-field__label"},i),a.createElement("div",{className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(ce,{ref:p,className:"maxio-text-field__input"}),c&&a.createElement("div",{className:"maxio-text-field__trailing-element"},c)),o&&!(t&&r)&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Rt.displayName="TextField";const Ct=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,fullWidth:s,className:c,...m},d)=>{const u=x("maxio-text-area",`maxio-text-area--${n}`,{"maxio-text-area--disabled":e,"maxio-text-area--error":t,"maxio-text-area--readonly":l,"maxio-text-area--full-width":s},c);return a.createElement(ue,{...m,isDisabled:e,isReadOnly:l,isInvalid:t,className:u},i&&a.createElement(se,{className:"maxio-form-label"},i),a.createElement(pe,{ref:d,className:"maxio-text-area__input"}),o&&!(t&&r)&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Ct.displayName="TextArea";const St=i(({disabled:e=!1,invalid:n=!1,readOnly:i=!1,size:o="md",label:r,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:v,...b},h)=>{var f,E;const _=t(null);g(h,()=>_.current),l(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:w,...N}=b,y={...N,label:r,description:s,errorMessage:m,defaultValue:null===(f=b.defaultValue)||void 0===f?void 0:f.toString(),value:null===(E=b.value)||void 0===E?void 0:E.toString(),isDisabled:e,isReadOnly:i,isInvalid:n},{labelProps:I,inputProps:k,descriptionProps:R,errorMessageProps:S}=C(y,_),P=x("maxio-text-field",`maxio-text-field--${o}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},v),$=n&&m&&c;return a.createElement("div",{className:P},r&&a.createElement("label",{className:"maxio-text-field__label",...I},r),a.createElement("div",{className:"maxio-text-field__items"},d&&a.createElement("div",{className:"maxio-text-field__leading-element"},d),a.createElement("input",{ref:_,type:"text",className:"maxio-text-field__input",...k,spellCheck:w}),u&&a.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!$&&a.createElement("div",{className:"maxio-form-helper-text",...R},s),$&&a.createElement(Ba,{...S},m))});St.displayName="TextInput";const Pt=({options:e,label:t,size:l="md",inline:n=!1,disabled:i=!1,helperText:o,errorMessage:r,fullWidth:s=!1,...c})=>{const m=x("maxio-select",`maxio-select--${l}`,{"maxio-select--disabled":i,"maxio-select--inline":n,"maxio-select--error":!!r,"maxio-select--full-width":s}),d=b();return a.createElement("div",{className:m},t&&a.createElement("label",{htmlFor:d,className:"maxio-select__label"},t),a.createElement("div",{className:"maxio-select__input-container"},a.createElement("select",{id:d,className:"maxio-select__input",disabled:i,...c},e.map(e=>a.createElement("option",{key:`option-${e.value}`,value:e.value,disabled:e.disabled},e.label))),a.createElement(Ve,{variant:"chevron-up-down"})),!!r&&a.createElement(Ba,null,r),o&&!r&&a.createElement("div",{className:"maxio-form-helper-text"},o))},$t=({size:e="md",onChange:t,totalItems:i=0,itemsPerPage:o=30,currentPage:r=1,pageSizeOptions:s,manualPageInput:c=!1})=>{const[m,d]=n(r),[u,p]=n(o),[v,g]=n(r.toString());l(()=>{g(m.toString())},[m]);const x=Math.ceil(i/u),b=m<x,h=m>1,f=u*(m-1)+1,E=Math.min(u*m,i),_=s.map(e=>({label:e.toString(),value:e.toString()})),w=Array.from({length:x},(e,a)=>a+1).map(e=>({label:e.toString(),value:e.toString()})),N=e=>{d(e),null==t||t({currentPage:e,itemsPerPage:u})},y=e=>{const a=parseInt(e,10);if(isNaN(a))return void g(m.toString());const t=Math.max(1,Math.min(a,x));g(t.toString()),N(t)};return a.createElement("div",{className:"maxio-pagination"},a.createElement("div",{className:"maxio-pagination__items-per-page"},a.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),a.createElement(Pt,{inline:!0,size:e,options:_,onChange:e=>{return a=Number(e.target.value),p(a),d(1),void(null==t||t({currentPage:1,itemsPerPage:a}));var a},value:u,id:"items-per-page-large"})),a.createElement("div",{className:"maxio-pagination__total-items"},a.createElement("span",null,f,"–",E," of ",i," items")),a.createElement("div",{className:"maxio-pagination__current-page"},c?a.createElement(St,{className:"maxio-pagination__page-input",value:v,min:1,max:x,onChange:e=>(e=>{g(e)})(e),onBlur:e=>{y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(y(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:e,type:"number",onWheel:e=>e.preventDefault()}):a.createElement(Pt,{inline:!0,size:e,"aria-label":"Select page",onChange:e=>N(Number(e.target.value)),value:m,options:w,id:"page-index-large"}),a.createElement("div",{className:"maxio-pagination__label"},"of ",x," pages")),a.createElement("div",{className:"maxio-pagination__controls"},a.createElement(ut,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(Qe,{icon:a.createElement(Ve,{variant:"chevron-left"}),size:e,variant:"ghost",onClick:()=>N(m-1),"aria-label":"Previous",disabled:!h})),a.createElement(ut,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(Qe,{icon:a.createElement(Ve,{variant:"chevron-right"}),size:e,variant:"ghost",onClick:()=>N(m+1),"aria-label":"Next",disabled:!b}))))},Dt=({label:e,helperText:t,size:l="md",variant:n="default",status:i,value:o,maxValue:r=100})=>{const s=b(),c=b(),m=i&&!!e&&!!o&&!("inline"===n),d=t&&!("inline"===n),u=t&&"inline"===n,{progressBarProps:p,labelProps:v}=S({maxValue:r,value:o,label:e}),g=x("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===l,"maxio-progress-bar--success":o&&!("inline"===n)&&"success"===i,"maxio-progress-bar--error":o&&!("inline"===n)&&"error"===i,"maxio-progress-bar--indent":"indent"===n,"maxio-progress-bar--inline":"inline"===n,"maxio-progress-bar--indeterminate":void 0===o});return a.createElement("div",{className:g,...p},a.createElement("div",{id:s,className:"maxio-progress-bar__label",...v},e),u&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t),a.createElement("div",{className:"maxio-progress-bar__track"},a.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${o}%`}})),m&&a.createElement("div",{className:`maxio-progress-bar__${i}-icon`}),d&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t))},Tt=({className:e,size:t="md",fullWidth:l=!1,selectionMode:n="single",orientation:i="horizontal",disallowEmptySelection:o=!0,...r})=>a.createElement(ve,{...r,selectionMode:n,orientation:i,disallowEmptySelection:o,className:le(e,e=>x("maxio-segmented-control",`maxio-segmented-control--${t}`,{"maxio-segmented-control--full-width":l},e))});Tt.displayName="SegmentedControl";const Mt=({className:e,children:t,...l})=>a.createElement(ge,{...l,className:le(e,e=>x("maxio-segmented-control__item",e))},le(t,e=>a.createElement(a.Fragment,null,a.createElement(xe,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),e)));Mt.displayName="SegmentedControl.Item";const Ot=Object.assign(Tt,{Item:Mt}),zt=({leadingIcon:e,trailingIcon:t,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:o=!1})=>a.createElement(a.Fragment,null,e&&a.createElement(ut,{usePortal:!0,isVisible:o,renderContent:()=>n,floatingElementOffset:12},a.createElement("span",{className:"maxio-side-nav__icon"},a.createElement(Ve,{variant:e,className:i}))),a.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),t&&a.createElement("span",{className:"maxio-side-nav__menu-chevron"},a.createElement(Ve,{variant:t}))),Bt=e=>"heading"!==e.type,At=e=>{const a=(e=>e.flat().filter(Bt).map(e=>e.items).flat().find(e=>null==e?void 0:e.isCurrent))(e);return a?e.map(e=>e.map(e=>{var t;return Bt(e)&&(null===(t=e.items)||void 0===t?void 0:t.includes(a))?{...e,isOpen:!0}:e})):e},Lt=s({}),Wt=()=>m(Lt),Ft=({children:e,isOpen:i,onChange:o,withIcons:r=!0,sections:s,shouldToggleSidebar:c=!0,topDropdownItems:m,collapseBreakpoint:d=800})=>{const u=t(!1),[p,v]=n(()=>!c||("boolean"==typeof i?i:"undefined"==typeof window||window.innerWidth>d)),[g,x]=n(()=>At(s)),{windowWitdh:b}=rt(200);l(()=>{u.current&&(null==o||o(p))},[p,o]),l(()=>{u.current=!0},[]),l(()=>{!function(e){if(!c)return;e<d&&p&&h()}(b)},[b]),l(()=>{"boolean"==typeof i&&v(i)},[i]);const h=()=>{v(!1)};return a.createElement(Lt.Provider,{value:{sections:g,topDropdownItems:m,onSectionOpen:e=>{x(a=>a.map(a=>a.map(a=>Bt(a)?{...a,isOpen:(null==a?void 0:a.name)===e&&!a.isOpen}:a)))},isOpen:p,onOpen:()=>{v(!0)},onClose:h,withIcons:r,shouldToggleSidebar:c}},e)},Ht=()=>{const{onOpen:e,topDropdownItems:l,isOpen:n}=Wt(),{mainItem:i,otherItems:o,actions:r}=l,s=t(null),c=ot(s),m=({id:e,title:a,icon:t,iconClass:l,url:n,...i})=>({id:e,label:a,leadingIconName:t,leadingIconClassName:l,link:{href:n,...i}}),{items:d,itemsCount:p}=u(()=>({itemsCount:o.length+r.length,items:[...o.map(m),(null==o?void 0:o.length)>0&&(null==r?void 0:r.length)>0?{type:"divider",id:"item-divider"}:null,...r.map(m)].filter(e=>null!=e)}),[r,o]);return a.createElement(a.Fragment,null,0===p?a.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:i.url,onClick:e},a.createElement("span",{className:"maxio-side-nav__menu-title"},i.title)):a.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},a.createElement("summary",{onClick:e,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:s},i.url?a.createElement(a.Fragment,null,a.createElement(zt,{type:"menu",isTooltipVisible:!n&&c,leadingIcon:i.icon,trailingIcon:"chevron-up-down",leadingIconClassName:i.iconClass},i.title)):a.createElement(zt,{type:"menu",trailingIcon:"chevron-up-down"},i.title)),a.createElement(qe,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:d,small:!0})))},Vt=({section:e})=>{const{isOpen:l,withIcons:n}=Wt(),i=t(null),o=ot(i);return a.createElement("li",{className:"maxio-side-nav__item","data-key":e.key,"data-testid":"maxio-sidebar-section"},a.createElement("a",{className:"maxio-side-nav__link","aria-current":e.isCurrent?"page":void 0,role:"button",href:e.href,ref:i},a.createElement(zt,{isTooltipVisible:o&&!l,type:"menu",leadingIcon:n?e.icon:void 0},e.name)))},jt=({section:e})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=Wt(),c=t(null),m=ot(c);if(!Bt(e))return a.createElement("li",{className:"maxio-side-nav__item-header"},e.title);return e.Component?a.createElement(e.Component,{section:e}):e.href?a.createElement(Vt,{section:e}):a.createElement("li",{className:x("maxio-side-nav__item",{"maxio-side-nav__item--icon":s}),"data-testid":"maxio-sidebar-section"},a.createElement("button",{className:"maxio-side-nav__menu-button",ref:c,"aria-expanded":e.isOpen?"true":"false",type:"button",onClick:()=>{o(e.name),i()}},a.createElement(zt,{type:"menu",isTooltipVisible:!r&&m,leadingIcon:s?e.icon:void 0,trailingIcon:(null===(l=e.items)||void 0===l?void 0:l.length)?"chevron-down":void 0},e.name)),a.createElement("ul",{className:"maxio-side-nav__menu"},null===(n=e.items)||void 0===n?void 0:n.map(e=>a.createElement("li",{key:`section-sub-item-${e.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},a.createElement("a",{className:"maxio-side-nav__link",href:e.href,"aria-current":e.isCurrent?"page":void 0},a.createElement("span",{className:"maxio-side-nav__link-title"},e.name))))))},Kt=()=>{const{sections:e}=Wt();return a.createElement(a.Fragment,null,e.map((e,t)=>a.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${t}`},e.map((e,l)=>a.createElement(jt,{key:`section-list-item-${e.type}-${t}-${l}`,section:e})))))},qt=()=>{const{onClose:e,shouldToggleSidebar:t}=Wt();return a.createElement("div",{className:"maxio-side-nav__logo-container"},a.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),t&&a.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:e},a.createElement(Ve,{variant:"sidebar"})))},Ut=()=>{const{isOpen:e}=Wt();return a.createElement("nav",{className:x("maxio-side-nav",{"maxio-side-nav--collapsed":!e})},a.createElement(qt,null),a.createElement(Ht,null),a.createElement("div",{className:"maxio-side-nav__items-container"},a.createElement(Kt,null)))},Gt=({withIcons:e=!0,shouldToggleSidebar:t=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>a.createElement(Ft,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:e,shouldToggleSidebar:t,topDropdownItems:l,sections:n},a.createElement(Ut,null)),Zt=({disabled:e=!1,value:t=0,className:l,id:n,isCurrent:i,...o})=>{const r="icon"===o.type,s=({isSelected:a})=>x("maxio-tabs__tab",l,{"maxio-tabs__tab--active":a,"maxio-tabs__tab--disabled":e,"maxio-tabs__tab--icon":r});if("icon"===o.type){const{icon:l,...n}=o;return a.createElement(be,{id:t,isDisabled:e,...n,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},l))}const{children:c,rightIcon:m,...d}=o;return a.createElement(be,{id:t,isDisabled:e,...d,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},c,m||null))},Yt=s({variant:"line",withDivider:!1}),Xt=({children:e,variant:t="line",withDivider:l=!1})=>a.createElement(Yt.Provider,{value:{variant:t,withDivider:l}},e),Qt=({children:e,variant:t="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>a.createElement(he,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:n,onSelectionChange:e=>null==o?void 0:o(Number(e))},a.createElement(Xt,{variant:t,withDivider:l},e)),Jt=({children:e,value:t,className:l,id:n,...i})=>a.createElement(fe,{id:t,className:x("maxio-tabs__panel",l),...i},e),el=({children:e})=>{const t=d.map(e,(e,a)=>{if(!r(e)||e.type!==Jt)throw new Error("You can only pass <TabPanel /> component as children");return o(e,{key:a,value:a})});return a.createElement(Ee,{className:"maxio-tabs__panels"},t)},al=({children:e,className:l,ariaLabel:i,overflow:s="none",moreLabel:u="More",...p})=>{const{variant:g,withDivider:b}=m(Yt),h=m(_e),f=c(),[E,_]=n(!1),w=x("maxio-tabs",l,{"maxio-tabs--contained":"contained"===g,"maxio-tabs--divider":b}),N=d.map(e,e=>e);(null!=N?N:[]).forEach(e=>{if(!r(e)||e.type!==Zt)throw new Error("You can only pass <Tab /> component as children")});const y="auto"===s&&!!(null==N?void 0:N.length),{ref:I,moreButtonRef:k,overflowIndexes:R,handleKeyDownCapture:C}=(({overflowEnabled:e,childrenArray:a})=>{const l=t(null),i=t(null),o=t(null),[r,s]=n(null),c=st(l),d=m(_e),u=null!=(null==d?void 0:d.selectedKey)?Number(d.selectedKey):null,[p,g]=n([]);v(()=>{var t;if(!e||!r)return void g((null!=a?a:[]).map((e,a)=>a));const{visibleIndexes:l}=((e,a,t,l)=>{const n=e.map((e,a)=>a);if(e.reduce((e,a)=>e+a,0)<=a)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let o=t;for(const t of n){if(o+e[t]>a)break;o+=e[t],i.push(t)}if(null!==l&&!i.includes(l)){for(o+=e[l];o>a&&i.length>0;)o-=e[i.pop()];i.push(l)}i.sort((e,a)=>e-a);const r=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:r}})(r.tabWidths,c,r.moreButtonWidth,null!==(t=o.current)&&void 0!==t?t:u);l.length===(null!=a?a:[]).length&&(o.current=null),g(l)},[e,r,c]),v(()=>{e&&r&&null!==u&&g(e=>(e.includes(u)||(o.current=u),((e,a,t,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,a)=>e-a);let o=l+i.reduce((e,t)=>e+a[t],0);for(;o>t&&i.length>1;){const e=i.length-1,t=i[e]===n?e-1:e,[l]=i.splice(t,1);o-=a[l]}return i})(e,r.tabWidths,c,r.moreButtonWidth,u)))},[u]);const x=e?(null!=a?a:[]).map((e,a)=>a).filter(e=>!p.includes(e)):[],b=((e,a)=>e.filter(e=>{var t;return!(null===(t=null==a?void 0:a[e])||void 0===t?void 0:t.props.disabled)}))(p,a);v(()=>{var t,n;if(!e||!l.current)return void s(e=>null===e?e:null);const o=Array.from(l.current.querySelectorAll('[role="tab"]')),r=null!==(n=null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect().width)&&void 0!==n?n:0;s(e=>{var t;const l=(null!=a?a:[]).map((a,t)=>{var l,n,i;const r=null!==(n=null===(l=o[t])||void 0===l?void 0:l.getBoundingClientRect().width)&&void 0!==n?n:0;return r>0?r:null!==(i=null==e?void 0:e.tabWidths[t])&&void 0!==i?i:0}),n=r>0?r:null!==(t=null==e?void 0:e.moreButtonWidth)&&void 0!==t?t:0,i=(null==e?void 0:e.tabWidths.length)===l.length&&e.tabWidths.every((e,a)=>e===l[a]);return e&&i&&e.moreButtonWidth===n?e:{tabWidths:l,moreButtonWidth:n}})},[a,e]);const h=e=>{var a,t;void 0!==e&&(null==d||d.selectionManager.setFocused(!0),null==d||d.selectionManager.setFocusedKey(e),null==d||d.setSelectedKey(e),null===(t=null===(a=l.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus())};return{ref:l,moreButtonRef:i,visibleIndexes:p,overflowIndexes:x,handleKeyDownCapture:e=>{var a;if(0===x.length)return;const t=document.activeElement===i.current,l=null==d?void 0:d.selectionManager.focusedKey,n=t?-1:b.indexOf(Number(l));if(t||-1!==n)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(n<b.length-1?h(b[n+1]):null===(a=i.current)||void 0===a||a.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?h(b[b.length-1]):n>0&&h(b[n-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[b.length-1])}}}})({overflowEnabled:y,childrenArray:N}),S=a.createElement("span",{className:"maxio-tabs__tab__content"},u,a.createElement(Ve,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),P=R.map(e=>{return`#${a=f,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(a):a.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var a});return a.createElement("div",{id:f,className:w,ref:I,onKeyDownCapture:C},P.length>0&&a.createElement("style",null,`${P.join(", ")} { display: none; }`),a.createElement(we,{"aria-label":i,className:"maxio-contents",...p},(null!=N?N:[]).map((e,a)=>o(e,{key:a,value:a}))),y&&R.length>0&&a.createElement(Y,{isOpen:E,onOpenChange:_},a.createElement(U,{ref:k,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":u},S),E&&a.createElement(Wa,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},a.createElement(X,{"aria-label":`${u} tabs`,onAction:e=>{null==h||h.setSelectedKey(e),requestAnimationFrame(()=>{var a,t;null===(t=null===(a=I.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus()})}},R.map(e=>{const t=N[e],{disabled:l,type:n,"aria-label":i,"aria-labelledby":o}=t.props,r="icon"===n?t.props.icon:t.props.children;return a.createElement(Q,{key:e,id:e,isDisabled:!!l,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},r)})))))},tl=({children:e,size:t,sentiment:l,kind:n="primary",leadingIcon:i,trailingIcon:o})=>{const r=x("maxio-tag",`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`,!!t&&`maxio-tag--${t}`);return a.createElement("div",{className:r},i&&a.createElement(Ve,{variant:i,className:"maxio-tag__icon"}),a.createElement("span",{className:"maxio-tag__label"},e),o&&a.createElement(Ve,{variant:o,className:"maxio-tag__icon"}))},ll=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__header",t),...l},e);ll.displayName="Card.Header";const nl=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__body",t),...l},e);nl.displayName="Card.Body";const il=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__footer",t),...l},e);il.displayName="Card.Footer";const ol=({children:e,className:t,variant:l="primary",...n})=>a.createElement("div",{className:x("maxio-card",`maxio-card--${l}`,t),...n},e);ol.displayName="Card";const rl=Object.assign(ol,{Header:ll,Body:nl,Footer:il}),sl=({children:e,className:t,href:l,onClick:n,target:i,disabled:o})=>{const r=l||n;if(!r)return a.createElement("div",{className:"maxio-tile"},e);const s=x("maxio-tile",t,{"maxio-tile--clickable":r,"maxio-tile--disabled":o});return a.createElement("a",{className:s,href:l,target:i,onClick:e=>{o&&l&&e.preventDefault(),!o&&n&&n()}},e)};var cl,ml,dl,ul;function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},pl.apply(null,arguments)}const vl=a=>e.createElement("svg",pl({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},a),cl||(cl=e.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),ml||(ml=e.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),dl||(dl=e.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),ul||(ul=e.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),gl=e=>{const{size:t="sm",className:l,variant:n="lockup",alt:i="maxio logo"}=e,o="mark"===n,r="number"==typeof t;return a.createElement(vl,{role:"img",viewBox:o?"0 0 240 240":"0 0 1036 240","aria-label":i,height:r?t:void 0,className:x("maxio-logo",!r&&`maxio-logo--${t}`,o&&"maxio-logo--mark",l)})},xl=({state:e,...l})=>{var n,i;const o=t(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:m}=Ae(l,e,o),{closable:d=!0,underline:u=!0,external:p=!1}=l.toast.content,v=x("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),g={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return a.createElement("div",{className:v,"data-maxio-mode":"dark",...r,ref:o},a.createElement(Ve,{variant:g,className:"maxio-toast__icon"}),a.createElement("div",{className:"maxio-toast__container",...s},a.createElement("div",{className:"maxio-toast__content",...c},l.toast.content.title&&a.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&a.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),(null===(n=l.toast.content.link)||void 0===n?void 0:n.text)&&(null===(i=l.toast.content.link)||void 0===i?void 0:i.href)&&a.createElement(Ue,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),d&&a.createElement(Qe,{variant:"ghost",icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...m}))},bl=({state:e,...t})=>{const l=a.useRef(null),{regionProps:n}=Le(t,e,l);return a.createElement("div",{...n,ref:l,className:t.className,style:{display:"flex",flexDirection:"column",gap:"10px"}},e.visibleToasts.map(t=>a.createElement(xl,{key:t.key,toast:t,state:e})))},hl=({children:e,...t})=>{const{maxVisibleToasts:l=5,...n}=t,i=Oe({maxVisibleToasts:l,...n});return a.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),a.createElement(a.Fragment,null,e(i),i.visibleToasts.length>0&&a.createElement(bl,{...t,state:i}))},fl=s(null),El=({children:e,toastQueue:t,...l})=>{const n=ze(t),i=p(()=>{n.visibleToasts.forEach(e=>{t.close(e.key)})},[n.visibleToasts,t]),o=u(()=>({addToast:t.add.bind(t),removeToast:t.clear.bind(t),removeAllToasts:i,state:n}),[t,i,n]);return a.createElement(fl.Provider,{value:o},e,n.visibleToasts.length>0&&a.createElement(bl,{...l,state:n}))},_l=()=>{const e=m(fl);if(!e)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return e};class wl extends Be{}const Nl=({defaultChecked:e,checked:t,onChange:l,disabled:n,valueDescription:i,valueDescriptionPosition:o,className:r,name:s,id:m,...d})=>{const u=c(),v="boolean"==typeof e,g=m||u,b="left"===o?"row":"row-reverse",h=i&&o,f=p(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const a=e.currentTarget.checked;v&&(e.currentTarget.checked=!a),l&&l(!a,e)}},[v,l]),E=d["aria-label"]||(h?void 0:i);return a.createElement("div",{className:x("maxio-toggle",r,{"maxio-toggle--disabled":n}),style:{display:"inline-flex",flexDirection:b},"data-testid":"toggle-container"},h?a.createElement("label",{className:"maxio-toggle__label",htmlFor:g},i):null,a.createElement("div",{className:"maxio-toggle__container"},a.createElement("input",{type:"checkbox",defaultChecked:e,checked:t,onChange:e=>{l&&l(e.target.checked,e)},onKeyDown:f,disabled:n,className:"maxio-toggle__checkbox",id:g,name:s,"aria-label":E}),a.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":t,"aria-hidden":"true"},a.createElement("div",{className:"maxio-toggle__handle"}),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-on"})),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-off"})))))},yl=({basis:e,flex:t,flexDirection:l,wrap:n,grow:i,shrink:o,gap:r,gapX:s,gapY:c,className:m,children:d,alignItems:u,justifyContent:p,...v})=>{const g=x("maxio-flex",{[`maxio-flex-${t}`]:t,[`maxio-basis-${e}`]:void 0!==e,[`maxio-flex-${l}`]:l,[`maxio-flex-${n}`]:n,"maxio-grow":i,"maxio-grow-0":!1===i,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${r}`]:void 0!==r,[`maxio-gap-x-${s}`]:void 0!==s,[`maxio-gap-y-${c}`]:void 0!==c,[`maxio-items-${u}`]:u,[`maxio-justify-${p}`]:p},m);return a.createElement("div",{className:g,...v},d)},Il=({children:e,actions:t,sideNavIsClosed:l,openSideNav:n})=>a.createElement("nav",{className:"maxio-top-bar"},l&&a.createElement(Qe,{"aria-label":"Open Side Navigation",variant:"ghost",icon:a.createElement(Ve,{variant:"sidebar"}),onClick:n}),a.createElement(yl,{grow:!0,justifyContent:"end"},e),t),kl=({as:e="div",children:t,size:l="md",className:n,...i})=>{const o=e,r=x(`maxio-display-${l}`,n);return a.createElement(o,{className:r,...i},t)},Rl=({as:e="div",children:t,className:l,...n})=>{const i=e,o=x("maxio-code",l);return a.createElement(i,{className:o,...n},t)},Cl=({as:e="div",children:t,size:l="sm",className:n,...i})=>{const o=e,r=x(`maxio-label-${l}`,n);return a.createElement(o,{className:r,...i},t)},Sl=({...e})=>{const l=t(null),{buttonProps:n}=f(e,l);return a.createElement("button",{...n,className:"maxio-chip__dismiss-button"},a.createElement(Ve,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},Pl=({label:e,onDismiss:l,dismissLabel:n,leadingIcon:i,trailingIcon:o,title:r,...s})=>{const c=t(null),m=V(s),{buttonProps:d}=P(s,m,c),u=x("maxio-chip",{"maxio-chip--selected":null==m?void 0:m.isSelected}),p=x("maxio-chip__button",{"maxio-chip--dismissible":l});return a.createElement("div",{className:u},a.createElement("button",{className:p,ref:c,...d,title:r},i&&a.createElement(Ve,{variant:i,className:"maxio-chip__icon"}),a.createElement("span",{className:"maxio-chip__label"},e),o&&!l&&a.createElement(Ve,{variant:o,className:"maxio-chip__icon"})),l&&a.createElement(Sl,{onPress:l,"aria-label":n}))},$l=({children:e,templateColumns:t,templateRows:l,autoColumns:n,autoRows:i,inline:o,column:r,columnStart:s,columnEnd:c,row:m,rowStart:d,rowEnd:u,gap:p,gapX:v,gapY:g,className:b,justifyContent:h,alignItems:f,...E})=>{const _=x(b,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${t}`]:t,[`maxio-grid-rows-${l}`]:l,[`maxio-auto-cols-${n}`]:n,[`maxio-auto-rows-${i}`]:i,["maxio-col-"+("auto"===r?"auto":`span-${r}`)]:r,[`maxio-col-start-${s}`]:s,[`maxio-col-end-${c}`]:c,["maxio-row-"+("auto"===m?"auto":`span-${m}`)]:m,[`maxio-row-start-${d}`]:d,[`maxio-row-end-${u}`]:u,[`maxio-gap-${p}`]:void 0!==p,[`maxio-gap-x-${v}`]:void 0!==v,[`maxio-gap-y-${g}`]:void 0!==g,[`maxio-justify-${h}`]:h,[`maxio-items-${f}`]:f});return a.createElement("div",{className:_||void 0,...E},e)},Dl={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"},Tl=({children:e,heading:t,description:l,sentiment:n="success",leadingElement:i=null,alert:o,topAddon:r=null,footer:s})=>a.createElement("div",{className:"maxio-auth-layout"},a.createElement(yl,{alignItems:"center",justifyContent:"between"},a.createElement(gl,{size:"md"}),r),o&&a.createElement(Je,{display:"block",title:o.title,sentiment:o.sentiment},o.children),a.createElement(rl,{variant:"secondary"},a.createElement(rl.Body,null,a.createElement(yl,{flexDirection:"col",gap:6},a.createElement(yl,{flexDirection:"col",gap:2},a.createElement(yl,{alignItems:"center",gap:2},i,a.createElement(at,{size:"lg",className:x("maxio-auth-layout__heading",Dl[n])},t)),l&&a.createElement(yl,{style:{color:"var(--maxio-color-text-tertiary)"}},a.createElement(pt,{size:"sm",className:"maxio-auth-layout__description"},l))),e)),s&&a.createElement(rl.Footer,null,s)));export{qe as ActionList,Je as Alert,Tl as AuthLayout,ra as Avatar,sa as Banner,pt as Body,pa as Breadcrumbs,ca as BreadcrumbsItem,Xe as Button,rl as Card,Oa as Checkbox,Aa as CheckboxGroup,Pl as Chip,Rl as Code,Nt as ComboBox,Ja as DataTable,kl as Display,tt as Drawer,yl as Flex,Ba as FormErrorMessage,za as FormHelperText,El as GlobalToastProvider,$l as Grid,at as Heading,Ve as Icon,Qe as IconButton,Cl as Label,Ue as Link,ht as ListBox,Ge as LoadingSpinner,gl as Logo,na as Menu,oa as MenuButton,ia as MenuList,ct as OverlayTrigger,$t as Pagination,Wa as Popover,Dt as ProgressBar,It as Radio,kt as RadioGroup,Ot as SegmentedControl,Pt as Select,Gt as SideNav,Zt as Tab,al as TabList,Jt as TabPanel,el as TabPanels,Qt as Tabs,tl as Tag,Ct as TextArea,Rt as TextField,St as TextInput,sl as Tile,hl as ToastProvider,wl as ToastQueue,Nl as Toggle,mt as Tooltip,ut as TooltipTrigger,Il as TopBar,st as useElementResizeObserver,ot as useHover,it as useOverlayTrigger,_l as useToast,rt as useWindowSize};
|
|
1
|
+
import*as e from"react";import a,{useRef as t,useEffect as l,useState as n,forwardRef as i,cloneElement as o,isValidElement as r,createContext as s,useId as c,useContext as m,Children as d,useLayoutEffect as u,useCallback as p,useMemo as v,useImperativeHandle as g}from"react";import x from"classnames";import{useId as b,useLink as h,useButton as f,VisuallyHidden as E,usePress as _,useFocusRing as w,mergeProps as N,useCheckboxGroupItem as y,useCheckbox as I,useCheckboxGroup as k,useRadio as C,useRadioGroup as R,useTextField as S,useProgressBar as P,useToggleButton as $}from"react-aria";import{useObjectRef as D,useResizeObserver as T}from"@react-aria/utils";import{AnimatePresence as M,motion as z}from"framer-motion";import{useDismiss as O,useFocus as A,useHover as B,useClick as L,useFloating as W,autoUpdate as F,offset as H,useInteractions as V,useRole as j,FloatingPortal as K}from"@floating-ui/react-dom-interactions";import{flexRender as q,useReactTable as U,getSortedRowModel as G,getExpandedRowModel as Z,getCoreRowModel as Y}from"@tanstack/react-table";export{createColumnHelper}from"@tanstack/react-table";import{dropTargetForElements as X,draggable as Q,monitorForElements as J}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/adapter.js";import{attachInstruction as ee,extractInstruction as ae}from"@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/tree-item.js";import{useToggleState as te}from"@react-stately/toggle";import{useCheckboxGroupState as le}from"@react-stately/checkbox";import{Popover as ne,OverlayArrow as ie,Button as oe,TooltipTrigger as re,Tooltip as se,MenuTrigger as ce,Menu as me,MenuItem as de,ModalOverlay as ue,Modal as pe,Dialog as ve,ListBox as ge,composeRenderProps as xe,ListBoxItem as be,ListBoxSection as he,Header as fe,ComboBox as Ee,Label as _e,Input as we,Text as Ne,FieldError as ye,TextField as Ie,TextArea as ke,ToggleButtonGroup as Ce,ToggleButton as Re,SelectionIndicator as Se,Tab as Pe,Tabs as $e,TabPanel as De,TabPanels as Te,TabListStateContext as Me,TabList as ze}from"react-aria-components";export{DialogTrigger,Pressable}from"react-aria-components";import{useRadioGroupState as Oe}from"@react-stately/radio";import{useToastState as Ae,useToastQueue as Be,ToastQueue as Le}from"@react-stately/toast";import{useToast as We,useToastRegion as Fe}from"@react-aria/toast";const He=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],Ve=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],je=["avalara","pipedrive","quickbooks","salesforce","xero"],Ke=({variant:e,color:t,className:l,size:n})=>{const i=(e,a)=>a.includes(e),o=i(e,He)||i(e,Ve),r=i(e,je),s=x({"fa-kit":o,"fa-kit-duotone":r,"fa-sharp fa-regular":!o&&!r,[`fa-${e}`]:!0,[`fa-${n}`]:n,[`maxio-icon--${t}`]:t&&!i(e,Ve)&&!i(e,je)},l);return a.createElement("i",{className:s})},qe=({item:e,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=t(null),c=t(!1),m=b();if(l(()=>{var e;n&&c.current&&(null===(e=s.current)||void 0===e||e.focus())},[n]),l(()=>{c.current=!0},[]),"divider"===e.type)return a.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:v,description:g,link:h}=e,f=x("maxio-action-list__label",{"maxio-truncate":i});return a.createElement("a",{"aria-labelledby":m,...h,className:x("maxio-action-list__content",h.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},d&&a.createElement(Ke,{variant:d,className:x("maxio-action-list__leading-icon",u)}),a.createElement("span",{className:f,id:m},v),g&&a.createElement("span",{className:"maxio-action-list__description"},g),p&&a.createElement(Ke,{variant:p,className:"maxio-action-list__trailing-icon"}))},Ue=(e,a,t)=>0===e?e:1===e&&"divider"===a[e-1].type?t||e:"divider"===a[e-1].type?Ue(e-1,a,t||e):e-1,Ge=({items:e,isShadowed:t=!0,itemProps:l={},className:i,truncateLabels:o=!1,small:r=!1,...s})=>{const c=x("maxio-action-list",i,{"maxio-action-list--shadow":t}),[m,d]=n(()=>e.findIndex(e=>"divider"!==e.type));return 0===e.length?null:a.createElement("div",{className:c,onKeyDown:a=>{if("Space"===a.code||"Enter"===a.code){const a=e[m];a&&"divider"!==a.type&&window.open(a.link.href,a.link.target||"_self")}"ArrowUp"===a.code&&(a.preventDefault(),d(a=>Ue(a,e))),"ArrowDown"===a.code&&(a.preventDefault(),d(a=>((e,a)=>{const t=a.findIndex((a,t)=>"divider"!==a.type&&t>e);return-1===t?e:t})(a,e)))},role:"listbox",...s},e.map((e,t)=>a.createElement(qe,{item:e,truncateLabel:o,key:`listbox-${e.id}`,isSelected:t===m,small:r,...l})))},Ze=({className:e,children:t,disabled:l,external:n,icon:i,size:o="sm",underline:r,variant:s,...c})=>{const m=x("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":l,[`maxio-link--${s}`]:s,"maxio-link--underline":r},e),d=n?"_blank":"_self";return a.createElement("a",{className:m,target:d,...c},t,i&&a.createElement(Ke,{variant:i,className:"maxio-link__icon"}))},Ye=({size:e="md",white:t=!1,className:l})=>{const n=x("maxio-loading-spinner",l,`maxio-loading-spinner--${e}`,{"maxio-loading-spinner--white":t});return a.createElement("div",{className:n,role:"status","aria-label":"loading"})},Xe=i(({fullWidth:e=!1,leadingElement:t,trailingElement:l,icon:n,variant:i="primary",size:s,...c},m)=>{const d=D(m),{linkProps:u}=h({...c},d),p=x("maxio-button",c.className,{[`maxio-button--${s}`]:s,[`maxio-button--${i}`]:i,"maxio-button--full-width":e});return a.createElement("a",{...u,ref:d,className:p,href:c.href},t&&o(t,{...r(t)&&{className:"maxio-button__leading-element"}}),c.children,(l||n)&&o(l||n,{...r(l||n)&&{className:"maxio-button__trailing-element"}}))}),Qe=i(({disabled:e,loading:t=!1,fullWidth:l=!1,leadingElement:n,trailingElement:i,icon:s,variant:c="primary",size:m,...d},u)=>{const p=D(u),{buttonProps:v}=f({...d,isDisabled:e,formAction:"string"==typeof d.formAction?d.formAction:void 0},p),g=["primary","danger"].includes(c),b=x("maxio-button",d.className,{[`maxio-button--${m}`]:m,[`maxio-button--${c}`]:c,"maxio-button--loading":t,"maxio-button--full-width":l});return a.createElement("button",{...v,className:b,ref:p},n&&o(n,{...r(n)&&{className:"maxio-button__leading-element"}}),d.children,!t&&(i||s)&&o(i||s,{...r(i||s)&&{className:"maxio-button__trailing-element"}}),t&&a.createElement(Ye,{className:"maxio-button__trailing-element",size:"md",white:g}))}),Je=i((e,t)=>(e=>"href"in e)(e)?a.createElement(Xe,{...e,ref:t}):a.createElement(Qe,{...e,ref:t})),ea=({"aria-label":e,className:t,...l})=>a.createElement(Je,{"aria-label":e,className:x("maxio-button--icon",t),...l},null),aa=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Alert component requires either children or title prop to be rendered"),null;const m=x("maxio-alert",{[`maxio-alert--${r}`]:"info"!==r&&r},c),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return a.createElement("div",{className:m},a.createElement(Ke,{variant:d,className:"maxio-alert__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-alert__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-alert__title"},t),e&&a.createElement("span",{className:"maxio-alert__message"},e),l&&i&&a.createElement(Ze,{className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(ea,{icon:a.createElement(Ke,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-alert__dismiss"}))},ta=s({}),la=({children:e})=>{const[t,l]=n(!1),i=c(),o=c();return a.createElement(ta.Provider,{value:{controlsId:i,buttonId:o,isOpen:t,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},e)};function na(){const e=m(ta);if(!e||"object"==typeof e&&0===Object.keys(e).length)throw new Error("useMenu hook must be used within a MenuProvider");return e}const ia=({children:e})=>{const{isOpen:t,onToggle:l,onClose:n}=na();return a.createElement("details",{open:t,onToggle:l,className:"maxio-action-menu"},"function"==typeof e?e({isOpen:t,onClose:n}):e)},oa=({children:e})=>a.createElement(la,null,a.createElement(ia,null,e)),ra=({items:e,alignItemsEnd:t=!1})=>{const l=x("maxio-action-menu__content",{"maxio-action-menu__content--align-end":t}),{controlsId:n,buttonId:i}=na();return a.createElement("div",{className:l,role:"presentation"},a.createElement(Ge,{role:"menu",itemProps:{role:"menuitem"},id:n,"aria-labelledby":i,items:e}))},sa=({children:e,iconName:t="chevron-down","aria-label":l,size:n="md",variant:i="secondary"})=>{const o=x({"maxio-action-menu__chevron":"chevron-down"===t}),r=x("maxio-button",`maxio-button--${i}`,`maxio-button--${n}`,{"maxio-button--icon":t&&!e}),{isOpen:s,buttonId:c,controlsId:m}=na();return a.createElement("summary",{className:r,"aria-haspopup":"true","aria-label":l,"aria-expanded":s,"aria-controls":m,id:c},e&&a.createElement("span",null,e),t&&a.createElement(Ke,{variant:t,className:`${o} maxio-button__trailing-element`}))},ca=({className:e,src:t,alt:l="avatar"})=>a.createElement("img",{className:x("maxio-avatar",e),alt:l,src:t}),ma=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Banner component requires either children or title prop to be rendered"),null;const m=x("maxio-banner",{[`maxio-banner--${r}`]:"info"!==r&&r,className:c}),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return a.createElement("div",{className:m,"aria-live":"assertive"},a.createElement(Ke,{variant:d,className:"maxio-banner__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-banner__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-banner__title"},t),e&&a.createElement("span",{className:"maxio-banner__message"},e),l&&i&&a.createElement(Ze,{href:i,..."warning"!==r&&{variant:"inverse"},underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(ea,{icon:a.createElement(Ke,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-banner__dismiss"}))},da=({children:e,className:t,href:l,...n})=>{const i=l?a.createElement(Ze,{size:"sm",href:l},e):e;return a.createElement("li",{className:x("maxio-breadcrumbs__item",t),...n},i)},ua="Breadcrumbs requires at least one BreadcrumbsItem as children",pa='Last BreadcrumbsItem should not have "href" prop. It is the current page.',va="Breadcrumbs only accepts BreadcrumbsItem as children",ga=({className:e,children:t,...l})=>{const n=d.count(t);if(0===n)throw new Error(ua);const i=d.map(t,(e,a)=>{if(r(e)&&e.type===da){if(a===n-1&&e.props.href)throw new Error(pa);return o(e,{"aria-current":a===n-1?"page":void 0})}throw new Error(va)});return a.createElement("nav",{"aria-label":"Breadcrumb",...l},a.createElement("ol",{className:x("maxio-breadcrumbs",e)},i))},xa=({children:e,arrowPosition:t,size:l="regular",maxWidth:n=160})=>a.createElement("div",{"data-testid":"tooltip",className:x("maxio-tooltip",`maxio-tooltip--${l}`,{[`maxio-tooltip--arrow-${t}`]:t})},a.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:n}},e)),ba={click:L,hover:e=>B(e,{delay:100}),focus:A,dismiss:O},ha=(e,a)=>a.map(a=>ba[a](e)),fa=({placement:e="top",isActive:a=!1,interactions:n=["hover"],floatingElementOffset:i=0,onOverlayUpdate:o,autoHideMs:r})=>{const s=t(null),{strategy:c,x:m,y:d,context:u,floating:p,reference:v}=W({placement:e,open:a,onOpenChange:e=>o(e),middleware:[H(i)],whileElementsMounted:F}),{getReferenceProps:g,getFloatingProps:x}=V([...ha(u,n),j(u,{role:"tooltip"})]);l(()=>{s.current&&clearTimeout(s.current),a&&r&&(s.current=window.setTimeout(()=>o(!1),r))},[a,r]);return{isActive:a,refs:{floating:p,reference:v},floatingElementCSSPosition:{position:c,top:null!=d?d:0,left:null!=m?m:0},getReferenceProps:g,getFloatingProps:x}};function Ea(e,a=0){const i=t((new Date).getTime()),o=t((new Date).getTime()),[r,s]=n(!1);return l(()=>{const t=()=>{i.current=(new Date).getTime(),s(!0)},l=()=>{o.current=(new Date).getTime(),window.setTimeout(()=>{i.current-o.current<=0&&s(!1)},a)},n=e&&e.current;return n&&(n.addEventListener("mouseenter",t),n.addEventListener("mouseleave",l)),()=>{n&&(n.removeEventListener("mouseenter",t),n.removeEventListener("mouseleave",l))}},[e]),r}function _a(e=500){const[a,i]=n(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:a}=window;return{windowWitdh:e,windowHeight:a}}),o=t(null);return l(()=>{if("undefined"==typeof window)return;const a=()=>{var a;const{innerWidth:t,innerHeight:l}=window;window.clearTimeout(null!==(a=o.current)&&void 0!==a?a:void 0),o.current=window.setTimeout(()=>{i({windowWitdh:t,windowHeight:l})},e)};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[e]),a}function wa(e){const[a,t]=n(()=>{var a,t;return null!==(t=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==t?t:0}),l=()=>{var a,l;const n=null!==(l=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==l?l:0;t(e=>0===n&&e>0?e:n)};return u(l,[e]),T({ref:e,onResize:l}),a}const Na=({children:e,usePortal:t=!1,isActive:l=!1,placement:n="top",interactions:i=["hover"],role:o="tooltip",renderOverlay:r,floatingElementOffset:s,motionSettings:c={},autoHideMs:m,onOverlayUpdate:d,className:u})=>{const{getReferenceProps:p,getFloatingProps:v,refs:{floating:g,reference:b},floatingElementCSSPosition:h}=fa({isActive:l,onOverlayUpdate:d,autoHideMs:m,floatingElementOffset:s,interactions:i,placement:n}),f=a.createElement(M,null,l&&a.createElement(z.div,{ref:g,style:h,...c,...v()},r()));return a.createElement(a.Fragment,null,a.createElement("div",{ref:b,className:x("maxio-inline-flex",u),...p(),"data-testid":"overlay-trigger"},e),t?a.createElement(K,{id:"maxio-ui-portal"},f):f)},ya={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},Ia=({children:e,interactions:i=["hover"],placement:o="right",maxWidth:r=160,size:s="regular",renderContent:c,autoHideMs:m,isVisible:d,usePortal:u,className:g,onVisibilityUpdate:x,floatingElementOffset:b=5})=>{const[h,f]=n(!1),E=void 0!==d,_=t(null),w=p(e=>{_.current&&clearTimeout(_.current),_.current=window.setTimeout(()=>{E||f(e),x&&x(e)},50)},[E,x]),N=v(()=>(e=>{const a=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",t=`translate${a}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:t},animate:{opacity:1,visibility:"visible",transform:`translate${a}(0px)`},exit:{opacity:0,visibility:"hidden",transform:t},transition:{ease:[.4,0,.5,1],duration:.2}}})(o),[o]);return l(()=>()=>{_.current&&clearTimeout(_.current)},[]),a.createElement(Na,{role:"tooltip",className:g,floatingElementOffset:b,motionSettings:N,isActive:E?d:h,onOverlayUpdate:w,autoHideMs:m,usePortal:u,placement:o,interactions:i,renderOverlay:()=>a.createElement(xa,{size:s,arrowPosition:ya[o],maxWidth:r},c())},e)},ka={idle:"copy-file",copied:"check",error:"error"},Ca=({value:e,copyLabel:i="Copy",copiedLabel:o="Copied!",copyErrorLabel:r="Copy failed",size:s="md",variant:c="ghost",disabled:m,resetAfterMs:d=2e3,tooltipPlacement:u="top",onCopy:v,onCopyError:g,onClick:x,className:b,...h})=>{const{feedbackState:f,feedbackLabel:_,announcement:w,handleCopy:N}=((e,{copyLabel:a,copiedLabel:i,copyErrorLabel:o,resetAfterMs:r,onCopy:s,onCopyError:c,onClick:m})=>{const[d,u]=n(null),v=t(null),g=t(0),x=t(!0),b=t(0),h=t(e),f=p(()=>{null!==v.current&&(clearTimeout(v.current),v.current=null)},[]),E=p(()=>{f(),u(null)},[f]),_=p((e,a)=>{f(),u({state:e,value:a,announceId:++g.current}),v.current=window.setTimeout(E,r)},[f,r,E]);l(()=>{h.current=e,E()},[E,e]),l(()=>(x.current=!0,()=>{x.current=!1,f()}),[f]);const w=p(async a=>{null==m||m(a);const t=++b.current,l=e,n=()=>!x.current||t!==b.current||l!==h.current;try{await navigator.clipboard.writeText(l)}catch(e){return n()||_("error",l),void(null==c||c(e))}n()||_("copied",l),null==s||s(l)},[m,s,c,_,e]),N=(null==d?void 0:d.value)===e?d.state:"idle",y={idle:a,copied:i,error:o}[N];return{feedbackState:N,feedbackLabel:y,announcement:"idle"!==N&&d?{id:d.announceId,message:y}:null,handleCopy:w}})(e,{copyLabel:i,copiedLabel:o,copyErrorLabel:r,resetAfterMs:d,onCopy:v,onCopyError:g,onClick:x});return a.createElement(a.Fragment,null,a.createElement(Ia,{interactions:["hover","focus"],placement:u,size:"small",renderContent:()=>_},a.createElement(ea,{...h,"aria-label":i,className:b,variant:c,size:s,disabled:m,onClick:N,trailingElement:a.createElement(Ke,{variant:ka[f]})})),a.createElement(E,null,a.createElement("span",{role:"status","aria-live":"polite","aria-atomic":"true"},w&&a.createElement("span",{key:w.id},w.message))))},Ra="row-controls",Sa="row-actions",Pa=({children:e,pattern:t,size:l,isExpandable:i,isUsingCustomRow:o})=>{const[r,s]=n(!1),[c,m]=n(!1),d=t&&o&&i,u=x("maxio-data-table",{"maxio-data-table--pattern":t&&!d,"maxio-data-table--expanded-child-pattern":d,"maxio-data-table--with-custom-row":o,[`maxio-data-table--${l}`]:l,"maxio-data-table--with-pinned-left-border":r,"maxio-data-table--with-pinned-right-border":c});return a.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const a=e.target;s(a.scrollLeft>0),m(a.scrollWidth-a.clientWidth-a.scrollLeft>0)}},a.createElement("table",{className:u},e))},$a=({children:e})=>a.createElement("thead",null,e),Da=({children:e})=>a.createElement("tbody",null,e),Ta=({children:e,table:t,header:l,className:n,enableExpanding:i,...o})=>{var r,s,c,m,d,u,p,v,g,b,h;const f=null==l?void 0:l.column,E=null===(r=null==f?void 0:f.getCanSort)||void 0===r?void 0:r.call(f),_=null===(s=null==f?void 0:f.getToggleSortingHandler)||void 0===s?void 0:s.call(f),w=null==l?void 0:l.isPlaceholder,N=null===(m=null===(c=null==f?void 0:f.columnDef)||void 0===c?void 0:c.meta)||void 0===m?void 0:m.align,y=null===(u=null===(d=null==f?void 0:f.columnDef)||void 0===d?void 0:d.meta)||void 0===u?void 0:u.width,I=null===(v=null===(p=null==f?void 0:f.columnDef)||void 0===p?void 0:p.meta)||void 0===v?void 0:v.controls,k=null===(b=null===(g=null==f?void 0:f.columnDef)||void 0===g?void 0:g.meta)||void 0===b?void 0:b.actions,C=null==f?void 0:f.getIsPinned(),R=null==f?void 0:f.getIsSorted(),S="asc"===R,P=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${C}`]:C,"maxio-data-table__cell--sortable":E,"maxio-data-table__cell--active":R,[`maxio-data-table__cell--${N}`]:N,"maxio-data-table__cell--controls":I,"maxio-data-table__cell--actions":k}),$={...y?{width:y}:{},..."left"===C?{left:null==f?void 0:f.getStart("left")}:"right"===C?{right:null==f?void 0:f.getAfter("right")}:{}},D=((e,a)=>e&&a?"arrow-up":e&&!a?"arrow-down":"arrow-down-up")(!!R,S),T=null==t?void 0:t.getToggleAllRowsExpandedHandler(),M=null===(h=null==t?void 0:t.getIsAllRowsExpanded)||void 0===h?void 0:h.call(t),z=(null==l?void 0:l.headerGroup.headers[0].id)===Ra?1:0,O=i&&(null==l?void 0:l.index)===z;return w?null:a.createElement("th",{scope:"col",role:"columnheader","aria-sort":R?S?"ascending":"descending":"none",className:P,onClick:_,colSpan:null==l?void 0:l.colSpan,style:$,...o},a.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&O&&a.createElement(ea,{size:"sm",variant:"ghost",icon:a.createElement(Ke,{size:"xs",variant:M?"chevron-down":"chevron-right"}),onClick:T,"aria-label":M?"Collapse all rows":"Expand all rows","data-open":M,className:"maxio-data-table__expand-button"}),e,E&&a.createElement(Ke,{variant:D,className:"maxio-data-table__sort-icon"})))},Ma=e=>{var a;return null!==(a=e.subRows)&&void 0!==a?a:[]},za=(e,a)=>Object.assign({},e,{subRows:a}),Oa=(e,a,t=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...t,l];if(n===a)return i;const o=Oa(Ma(n),a,i);if(o)return o}return null},Aa=(e,a)=>{const[t,...l]=a,n=e[t];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(t,1),{data:i,item:n};const o=Aa(Ma(n),l);return o?(i[t]=za(n,o.data),{data:i,item:o.item}):null},Ba=(e,a,t,l)=>{const n=[...e];if(0===a.length)return n.splice(t,0,l),n;const[i,...o]=a,r=e[i];if(!r)return null;const s=Ba(Ma(r),o,t,l);return s?(n[i]=za(r,s),n):null},La=(e,a)=>{let t,l=e;for(const e of a){if(t=l[e],!t)return;l=Ma(t)}return t},Wa="maxio-data-table-row",Fa=s(null),Ha=()=>m(Fa),Va=e=>e.type===Wa&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,ja=e=>{const a=(e=>{const a=ae(e);return a&&"instruction-blocked"!==a.type?"reorder-above"===a.type?"before":"reorder-below"===a.type?"after":"make-child"===a.type?"inside":null:null})(e);return"string"==typeof e.rowId&&a?{rowId:e.rowId,position:a}:null},Ka=({availability:e,children:i,data:o,enableExpanding:r,getRowReorderLabel:s,onRowReorder:m,rowReorderMode:d,table:u})=>{const g=`maxio-data-table-${c()}`,[x,b]=n(""),[h,f]=n(null),[E,_]=n(null),w=t(null),N=p(e=>u.getCoreRowModel().rowsById[e],[u]),y=p(e=>{var a;return null!==(a=null==s?void 0:s(e))&&void 0!==a?a:e.id},[s]),I=p((e,a)=>{const t=N(e),l=N(a.rowId);if(!t||!l)return null;const n=((e,a,t,l,n)=>{var i,o;if(a.id===t.id||!((e,a,t,l)=>{var n,i;return"all"===l||("siblings"===l?"inside"!==t&&(null!==(n=e.parentId)&&void 0!==n?n:null)===(null!==(i=a.parentId)&&void 0!==i?i:null):"inside"===t?e.depth===a.depth+1:e.depth===a.depth)})(a,t,l,n))return null;const r=Oa(e,a.original),s=Oa(e,t.original);if(!r||!s||(m=s,(c=r).length<m.length&&c.every((e,a)=>m[a]===e)))return null;var c,m;const d=Aa(e,r);if(!d)return null;const u=((e,a)=>{const t=[...e],l=a.length-1;return l>=0&&e.length>l&&a.slice(0,l).every((a,t)=>e[t]===a)&&a[l]<e[l]&&(t[l]-=1),t})(s,r),p=u[u.length-1];if(void 0===p)return null;const v="inside"===l?u:u.slice(0,-1),g=La(d.data,u);if(!g)return null;const x="inside"===l?Ma(g).length:p+("after"===l?1:0),b={parentRowId:"inside"===l?t.id:null!==(i=t.parentId)&&void 0!==i?i:null,index:x},h={parentRowId:null!==(o=a.parentId)&&void 0!==o?o:null,index:a.index};if(h.parentRowId===b.parentRowId&&h.index===b.index)return null;const f=Ba(d.data,v,x,d.item);return f?{data:f,source:h,destination:b}:null})(o,t,l,a.position,d);return n&&!r&&null!==n.destination.parentRowId&&n.destination.parentRowId!==n.source.parentRowId?null:n},[o,r,N,d]),k=p(e=>{w.current=e,f(e)},[]),C=p((e,a)=>{const t=N(e),l=N(a.rowId),n=I(e,a);return t&&l&&n?(m({...n,row:t,rowId:t.id,targetRow:l,targetRowId:l.id,position:a.position}),b(`${y(t)} moved ${i=y(l),o=a.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(b("That row cannot be moved to this position."),!1);var i,o},[y,I,N,m]),R=p((e,{input:a,element:t,source:l})=>{const n={rowId:e.id,instanceId:g},i=ee(n,{element:t,input:a,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),o=ja(i),r=Va(l.data)&&l.data.instanceId===g&&Boolean(o&&I(l.data.rowId,o));return{...i,isValid:r}},[I,g]),S=p((a,t)=>{if(!e.available)return()=>{};const l=e=>{const a=e.isValid?ja(e):null;k(a)};return X({element:t,canDrop:({source:e})=>Va(e.data)&&e.data.instanceId===g&&e.data.rowId!==a.id&&!a.getParentRows().some(a=>a.id===e.data.rowId),getData:e=>R(a,e),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{var e;(null===(e=w.current)||void 0===e?void 0:e.rowId)===a.id&&k(null)}})},[e,R,g,k]),P=p((a,t)=>{const l=t.closest("tr");return e.available&&l instanceof HTMLElement?Q({element:l,dragHandle:t,getInitialData:()=>({type:Wa,instanceId:g,rowId:a.id})}):()=>{}},[e,g]);l(()=>{if(e.available)return J({canMonitor:({source:e})=>Va(e.data)&&e.data.instanceId===g,onDragStart:({source:e})=>{if(!Va(e.data))return;const a=N(e.data.rowId);_(e.data.rowId),a&&b(`${y(a)} grabbed. Choose a destination.`)},onDrop:({source:e,location:a})=>{var t;if(Va(e.data)){const l=null===(t=a.current.dropTargets[0])||void 0===t?void 0:t.data,n=!0===(null==l?void 0:l.isValid)?ja(l):null;n?C(e.data.rowId,n):b("Row move cancelled.")}_(null),k(null)}})},[C,e,y,N,g,k]),l(()=>{if("inside"!==(null==h?void 0:h.position))return;const e=N(h.rowId);if(!(null==e?void 0:e.getCanExpand())||e.getIsExpanded())return;const a=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(a)},[h,N]);const $=p(a=>{var t;if(!e.available)return[];const l=a.parentId?N(a.parentId):null,n=null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:u.getCoreRowModel().rows,i=n.findIndex(e=>e.id===a.id);if(-1===i)return[];const o=n[i-1],r=n[i+1],s=n[0],c=n[n.length-1],m=[];if(i>1&&s&&m.push({id:"top",label:"Move to top",target:{rowId:s.id,position:"before"}}),o&&m.push({id:"up",label:"Move up",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),i<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),l){let e=l;for(;e.parentId;){const a=N(e.parentId);if(!a)break;e=a}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return u.getCoreRowModel().flatRows.forEach(e=>{e.id!==a.parentId&&m.push({id:`move-to:${e.id}`,label:`Move to ${y(e)}`,target:{rowId:e.id,position:"inside"}})}),m.filter(e=>Boolean(I(a.id,e.target)))},[e,y,I,N,u]),D=p(a=>{var t;if(!e.available)return!1;const l=a.parentId?N(a.parentId):null;return(null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:u.getCoreRowModel().rows).length>1||"siblings"!==d&&("all"===d?Boolean(l):!(!r||0===a.depth)&&u.getCoreRowModel().flatRows.some(e=>e.depth===a.depth-1&&e.id!==a.parentId))},[e,r,N,d,u]),T=v(()=>({activeTarget:h,availability:e,draggingRowId:E,getActions:$,getLabel:y,hasActions:D,moveRow:C,registerHandle:P,registerRow:S}),[h,e,C,E,$,y,D,P,S]);return a.createElement(Fa.Provider,{value:T},i,a.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},x))},qa=({children:e,row:t,isChild:l,isHeader:n,className:i,onRowAction:o,...r})=>{var s,c,m,d,u;const p=null===(s=null==t?void 0:t.getIsSelected)||void 0===s?void 0:s.call(t),v=(null===(c=null==t?void 0:t.getCanExpand)||void 0===c?void 0:c.call(t))&&(null===(m=null==t?void 0:t.getIsExpanded)||void 0===m?void 0:m.call(t)),g=Boolean(t&&o&&!n&&!l),b=a.useRef(null),h=Ha(),f=null==h?void 0:h.registerRow,E=a.useRef(null),y=e=>{E.current=e.target},{pressProps:I}=_({isDisabled:!g,onPress:e=>{var a;const l=null!==(a=E.current)&&void 0!==a?a:e.target;E.current=null,t&&o&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(l)&&o(t)}}),{focusProps:k,isFocused:C}=w(),R=x({"maxio-data-table__row":!n,"maxio-data-table__header-row":n,"maxio-data-table__row--active":p||C,"maxio-data-table__row--expanded":v,"maxio-data-table__row--expanded-child":l,"maxio-data-table__row--actionable":g,"maxio-data-table__row--dragging":Boolean(t)&&(null==h?void 0:h.draggingRowId)===(null==t?void 0:t.id),[`maxio-data-table__row--drop-${null===(d=null==h?void 0:h.activeTarget)||void 0===d?void 0:d.position}`]:Boolean(t)&&(null===(u=null==h?void 0:h.activeTarget)||void 0===u?void 0:u.rowId)===(null==t?void 0:t.id)},i);a.useEffect(()=>{if(t&&f&&b.current&&!n&&!l)return f(t,b.current)},[l,n,f,t]);const S=g?N({onClickCapture:y,onKeyDownCapture:y,tabIndex:0},I,k,r):r;return a.createElement("tr",{...S,ref:b,className:R,tabIndex:g?S.tabIndex:r.tabIndex},e)},Ua=s({}),Ga=i(({checked:e,disabled:t,invalid:l,indeterminate:n,className:i,inputProps:o,error:r,label:s},c)=>{const m=x("maxio-checkbox",{"maxio-checkbox--checked":e,"maxio-checkbox--disabled":t,"maxio-checkbox--error":l,"maxio-checkbox--indeterminate":n},i);return a.createElement("label",{className:m},a.createElement("input",{type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:c,...o}),a.createElement("span",{className:"maxio-checkbox__control"},r&&a.createElement("span",{className:"maxio-checkbox__control-error"})),s&&a.createElement("span",{className:"maxio-checkbox__label"},s))});Ga.displayName="InnerCheckbox";const Za=({label:e,error:l=!1,className:n,indeterminate:i,value:o="",disabled:r,readOnly:s,defaultChecked:c,checked:d,...u})=>{const p=t(null),v=m(Ua),{inputProps:g,isDisabled:x,isInvalid:b,isSelected:h}=v&&Object.keys(v).length>0?y({value:o,"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,...u},v,p):I({"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,value:o,...u},te({...u,isSelected:d,defaultSelected:c}),p);return a.createElement(Ga,{inputProps:g,checked:h,disabled:x,invalid:b,indeterminate:i,className:n,error:l,label:e,ref:p,...u})},Ya=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-helper-text",t),...l},e),Xa=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-error",t),...l},a.createElement(Ke,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},e)),Qa=({helperText:e,className:t,errorMessage:l,children:n,disabled:i,label:o,defaultValue:r,name:s,...c})=>{var m;const d=le({defaultValue:r,name:s,errorMessage:l,description:e,label:o,isDisabled:i,isInvalid:!!l,...c}),{groupProps:u,labelProps:p,descriptionProps:v,errorMessageProps:g,isInvalid:b}=k({"aria-label":null===(m=null!=o?o:c["aria-label"])||void 0===m?void 0:m.toString(),isDisabled:i,isInvalid:!!l,...c},d),h=x("maxio-checkbox-group",{"maxio-checkbox-group--disabled":i},t),f=e&&!l;return a.createElement("div",{className:h,...u},o&&a.createElement("label",{className:"maxio-checkbox-group__label",...p},o),a.createElement(Ua.Provider,{value:d},n),f&&a.createElement(Ya,{...v},e),l&&b&&a.createElement(Xa,{...g},l))},Ja=({table:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleAllPageRowsSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsAllPageRowsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomePageRowsSelected)||void 0===r?void 0:r.call(e);return t?a.createElement(a.Fragment,null,l&&a.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),a.createElement(Za,{"aria-label":"Select all rows",onChange:e=>{s("boolean"==typeof e?{target:{checked:e}}:e)},checked:c,indeterminate:!c&&m})):null},et=({className:e,hideArrow:t=!1,children:l,offset:n=4,...i})=>a.createElement(ne,{...i,className:x("maxio-popover",e),offset:n},a.createElement(a.Fragment,null,!t&&a.createElement(ie,{className:"maxio-popover__arrow"},a.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},a.createElement("path",{d:"M0 0 L6 6 L12 0"}))),l)),at=({row:e})=>{var t,l;const n=Ha(),i=null==n?void 0:n.registerHandle,o=null==n?void 0:n.getActions,r=null==n?void 0:n.hasActions,s=a.useRef(null),[c,m]=a.useState(!1),d=(null==n?void 0:n.draggingRowId)===e.id,u=null!==(t=null==n?void 0:n.getLabel(e))&&void 0!==t?t:e.id,p=a.useMemo(()=>{var a;return null!==(a=null==r?void 0:r(e))&&void 0!==a&&a},[r,e]),v=a.useMemo(()=>{var a;return c&&null!==(a=null==o?void 0:o(e))&&void 0!==a?a:[]},[o,c,e]),g=null!==(l=n&&!n.availability.available?n.availability.message:void 0)&&void 0!==l?l:p?void 0:`No moves are available for ${u}.`;a.useEffect(()=>{if(i&&s.current&&!g)return i(e,s.current)},[i,e,g]),a.useEffect(()=>{g&&m(!1)},[g]);const x=a.createElement(oe,{ref:s,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${u}`,"aria-pressed":d,"aria-disabled":!!g||void 0,onPress:()=>{g||m(!0)}},a.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(g?"maxio-icon--disabled":"maxio-icon--secondary")}));return g?a.createElement(re,{delay:0,closeDelay:0},x,a.createElement(se,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},a.createElement("div",{className:"maxio-tooltip__content"},g))):a.createElement(ce,{trigger:"longPress",isOpen:c,onOpenChange:m},x,a.createElement(et,{placement:"bottom start",hideArrow:!0},a.createElement(me,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:v,onAction:a=>{const t=v.find(e=>e.id===a);t&&(null==n||n.moveRow(e.id,t.target),requestAnimationFrame(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}},e=>a.createElement(de,{id:e.id,textValue:e.label,className:"maxio-data-table__reorder-menu-item"},e.label))))},tt=({row:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllSubRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomeSelected)||void 0===r?void 0:r.call(e),d=e.id||e.index;return a.createElement(a.Fragment,null,l&&a.createElement(at,{row:e}),t&&a.createElement(Za,{"aria-label":`Select row ${d}`,onChange:s,checked:c,indeterminate:m}))},lt=({children:e})=>a.createElement("div",{className:"maxio-data-table__cell-flex"},e),nt=({row:e,cell:t,children:l,className:n,...i})=>{var o,r,s,c,m,d;const u=null==t?void 0:t.column,p=null===(r=null===(o=null==u?void 0:u.columnDef)||void 0===o?void 0:o.meta)||void 0===r?void 0:r.align,v=null===(c=null===(s=null==u?void 0:u.columnDef)||void 0===s?void 0:s.meta)||void 0===c?void 0:c.controls,g=null===(d=null===(m=null==u?void 0:u.columnDef)||void 0===m?void 0:m.meta)||void 0===d?void 0:d.actions,b=null==u?void 0:u.getIsPinned(),h=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${b}`]:b,[`maxio-data-table__cell--${p}`]:p,"maxio-data-table__cell--controls":v,"maxio-data-table__cell--actions":g}),f="left"===b?{left:null==u?void 0:u.getStart("left")}:"right"===b?{right:null==u?void 0:u.getAfter("right")}:{};return a.createElement("td",{className:h,style:f,...i},l)},it=({row:e,SubRowComponent:t,pattern:l,enableExpanding:n,onRowAction:i})=>{var o,r,s,c,m;const d=t&&e.getParentRow()&&e.getParentRow().getIsExpanded(),u=d&&e.getVisibleCells()[0].column.columnDef.id===Ra,p=d&&e.getVisibleCells()[e.getVisibleCells().length-1].column.columnDef.id===Sa,v=[p,u].filter(Boolean).length,g=e.getVisibleCells().length-v,x=null!==(r=null===(o=e.getParentRow())||void 0===o?void 0:o.index)&&void 0!==r?r:e.index,b=l&&t&&x%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(s=e.getCanExpand)||void 0===s?void 0:s.call(e),f=null===(c=null==e?void 0:e.getToggleExpandedHandler)||void 0===c?void 0:c.call(e),E=null===(m=null==e?void 0:e.getIsExpanded)||void 0===m?void 0:m.call(e),_=h&&n?0:1.75,w=e.getVisibleCells()[0].column.columnDef.id===Ra?1:0,N=e.getVisibleCells().find(({column:e})=>{var a;const{actions:t,controls:l}=null!==(a=e.columnDef.meta)&&void 0!==a?a:{};return!t&&!l}),y=i&&N?N.id:void 0;return a.createElement(a.Fragment,{key:e.id},d?a.createElement(qa,{key:`${e.id}-sub`,row:e,isChild:!0,className:b},u&&a.createElement(nt,{className:"maxio-data-table__cell--pinned-left"}),a.createElement(nt,{colSpan:g},t(e)),p&&a.createElement(nt,{className:"maxio-data-table__cell--pinned-right"})):a.createElement(qa,{key:`${e.id}-parent`,row:e,className:b,onRowAction:i,"aria-labelledby":y},e.getVisibleCells().map(t=>{const l=n&&t.column.getIndex()===w;return a.createElement(nt,{key:t.id,row:e,cell:t,id:t.id},a.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${(null==e?void 0:e.depth)+_}rem`}:void 0},n&&h&&l&&a.createElement(ea,{size:"sm",variant:"ghost",icon:a.createElement(Ke,{size:"xs",variant:E?"chevron-down":"chevron-right"}),onClick:f,"aria-label":E?"Collapse row":"Expand row","data-open":E,className:"maxio-data-table__expand-button"}),q(t.column.columnDef.cell,t.getContext())))})))},ot={available:!0},rt={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},st={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},ct={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},mt=(e=[])=>e.filter(e=>e!==Ra&&e!==Sa),dt=[],ut=e=>e.subRows,pt=({pattern:e,size:t="md",SubRowComponent:n,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:m,columns:d,actions:u,actionsColumnSize:p,onRowAction:g,enableRowReordering:x=!1,getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f="siblings",getRowId:E,getSubRows:_,state:w,...N})=>{var y,I;const k=x?void 0:n,C=!x&&s,R=(({columns:e,HeaderControls:t,RowControls:l,RowActions:n,actions:i,actionsColumnSize:o,enableExpanding:r,enableRowSelection:s,enableRowReordering:c})=>v(()=>{const m={id:Ra,size:s&&c?72:40,header:e=>a.createElement(t,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),cell:e=>a.createElement(l,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=i&&n?{id:Sa,size:null!=o?o:40,header:"",cell:e=>a.createElement(n,null,i(e.row,e.table)),meta:{actions:!0}}:null;let u=[...e];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[i,o,n,r,s,c,e,t,l]))({columns:d,HeaderControls:Ja,RowControls:tt,RowActions:lt,actions:u,actionsColumnSize:p,enableRowSelection:c,enableRowReordering:x,enableExpanding:Boolean(m)}),S=U({state:{...w,...x&&{sorting:dt},columnPinning:{left:[...c||x?[Ra]:[],...mt(null===(y=null==w?void 0:w.columnPinning)||void 0===y?void 0:y.left)],right:[...mt(null===(I=null==w?void 0:w.columnPinning)||void 0===I?void 0:I.right),...u?[Sa]:[]]}},getCoreRowModel:Y(),enableRowSelection:c,enableExpanding:Boolean(m),...!N.manualExpanding&&{getExpandedRowModel:Z()},...!N.manualSorting&&!x&&{getSortedRowModel:G()},columns:R,getRowId:E,...N,getSubRows:x?ut:null!=_?_:ut,enableSorting:C,...x&&{getSortedRowModel:void 0}}),P=S.getCanSomeRowsExpand(),$=S.getState(),D=(({columnFilters:e,globalFilter:a,grouping:t,hasPagination:l})=>e.length>0||null!=a&&""!==a?rt:t.length>0?st:l?ct:ot)({columnFilters:$.columnFilters,globalFilter:$.globalFilter,grouping:$.grouping,hasPagination:Boolean(N.getPaginationRowModel||N.manualPagination)});l(()=>{null==i||i($.expanded)},[i,$.expanded]),l(()=>{null==o||o($.rowSelection)},[o,$.rowSelection]),l(()=>{x||null==r||r($.sorting)},[x,r,$.sorting]);const T=a.createElement(Pa,{pattern:e,size:t,isExpandable:P,isUsingCustomRow:Boolean(k)},a.createElement($a,null,S.getHeaderGroups().map(e=>a.createElement(qa,{key:e.id,table:S,isHeader:!0},e.headers.map(e=>a.createElement(Ta,{key:e.id,table:S,header:e,enableExpanding:m},q(e.column.columnDef.header,e.getContext())))))),a.createElement(Da,null,S.getRowModel().rows.map(t=>a.createElement(it,{key:t.id,row:t,pattern:e,SubRowComponent:k,enableExpanding:m,onRowAction:g}))));return x&&E&&h?a.createElement(Ka,{availability:D,data:N.data,enableExpanding:Boolean(m),getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f,table:S},T):T},vt={sm:"h3",md:"h2",lg:"h1"},gt=({children:e,size:t="sm",className:l,...n})=>{const i=vt[t],o=x(`maxio-heading-${t}`,l);return a.createElement(i,{className:o,...n},e)},xt=({open:e,onOpenChange:t,placement:l="right",backdrop:n="dim",size:i="md",className:o,title:r,description:s,children:c,footer:m})=>{const d=a.useId(),u={"data-placement":l,"data-size":i};return a.createElement(ue,{isOpen:e,onOpenChange:t,isDismissable:!0,className:x("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===n})},a.createElement(pe,{className:x("maxio-drawer",o),...u},a.createElement(ve,{className:"maxio-drawer__dialog","aria-labelledby":d},({close:e})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-drawer__header"},a.createElement("div",{className:"maxio-drawer__title-group"},a.createElement(gt,{id:d,size:"md",className:"maxio-drawer__title"},r),s&&a.createElement("p",{className:"maxio-drawer__description"},s)),a.createElement(ea,{"aria-label":"Close",onClick:e,icon:a.createElement(Ke,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),a.createElement("div",{className:"maxio-drawer__body"},c),null!=m&&a.createElement("div",{className:"maxio-drawer__footer"},m)))))},bt=({as:e="div",children:t,compact:l=!1,size:n="md",className:i,...o})=>{const r=e,s=x({[`maxio-body-${n}`]:!l,[`maxio-body-${n}-compact`]:l},i);return a.createElement(r,{className:s,...o},t)},ht=({as:e="div",children:t,size:l="md",className:n,...i})=>{const o=e,r=x(`maxio-display-${l}`,n);return a.createElement(o,{className:r,...i},t)},ft=({as:e="div",children:t,className:l,...n})=>{const i=e,o=x("maxio-code",l);return a.createElement(i,{className:o,...n},t)},Et=({as:e="div",children:t,size:l="sm",className:n,...i})=>{const o=e,r=x(`maxio-label-${l}`,n);return a.createElement(o,{className:r,...i},t)},_t=({basis:e,flex:t,flexDirection:l,wrap:n,grow:i,shrink:o,gap:r,gapX:s,gapY:c,className:m,children:d,alignItems:u,justifyContent:p,...v})=>{const g=x("maxio-flex",{[`maxio-flex-${t}`]:t,[`maxio-basis-${e}`]:void 0!==e,[`maxio-flex-${l}`]:l,[`maxio-flex-${n}`]:n,"maxio-grow":i,"maxio-grow-0":!1===i,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${r}`]:void 0!==r,[`maxio-gap-x-${s}`]:void 0!==s,[`maxio-gap-y-${c}`]:void 0!==c,[`maxio-items-${u}`]:u,[`maxio-justify-${p}`]:p},m);return a.createElement("div",{className:g,...v},d)},wt=({hasActiveFilters:e=!1,title:t,headingLevel:l="h2",description:n,actions:i,className:o,...r})=>{const s=x("maxio-empty-state",o),c=l,m=!t&&!n?e?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":n;return a.createElement("div",{className:s,...r},a.createElement(_t,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},a.createElement(_t,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},t&&a.createElement(c,{className:"maxio-heading-lg"},t),m&&a.createElement(bt,{size:"sm",className:"maxio-empty-state__description"},m)),i&&a.createElement(_t,{alignItems:"center",gap:2},i)))},Nt=({className:e,render:t,showSelectAll:l=!1,...n})=>a.createElement(ge,{...n,className:xe(e,e=>x("maxio-listbox",e)),render:(e,n)=>{const{selectionManager:i}=n.state,o=t?t(e,n):a.createElement("div",{...e});if("multiple"!==i.selectionMode||!l)return o;if(0===[...i.collection.getKeys()].filter(e=>{const a=i.collection.getItem(e);return"item"===(null==a?void 0:a.type)&&i.canSelectItem(e)}).length)return o;const r=i.isSelectAll,s=r&&i.disallowEmptySelection;return a.createElement("div",null,a.createElement("div",{className:"maxio-listbox__select-all"},a.createElement(Je,{type:"button",variant:"ghost",trailingElement:a.createElement(Ke,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:s,onClick:()=>i.toggleSelectAll()},"Select all")),o)}});Nt.displayName="ListBox";const yt=({className:e,...t})=>{const l=t.textValue||("string"==typeof t.children?t.children:void 0);return a.createElement(be,{...t,textValue:l,className:x("maxio-listbox__item",e)},xe(t.children,(e,{isSelected:t})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-listbox__content"},"string"==typeof e?a.createElement(bt,{size:"sm"},e):e),t&&a.createElement(Ke,{variant:"check"}))))};yt.displayName="ListBox.Item";const It=({className:e,...t})=>a.createElement(he,{...t,className:x("maxio-listbox__section",e)});It.displayName="ListBox.Section";const kt=({className:e,...t})=>a.createElement(fe,{...t,className:x("maxio-listbox__header",e)});kt.displayName="ListBox.Header";const Ct=Object.assign(Nt,{Item:yt,Section:It,Header:kt}),Rt=({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,fullWidth:c,className:m,placeholder:d,renderEmptyState:u,selectionMode:p,children:v,...g})=>{const b=a.useRef(null),h=a.useRef(null),[f,E]=a.useState(),[_,w]=a.useState(0),N=!!r,y=t||N,I=v,k=a.useCallback(()=>{const e=b.current;if(!e)return;const a=h.current,t=a?a.getBoundingClientRect().left-e.getBoundingClientRect().left:0;w(e=>e===-t?e:-t),E(a=>{const t=`${e.offsetWidth}px`;return(null==a?void 0:a["--trigger-width"])===t?a:{"--trigger-width":t}})},[]);a.useEffect(()=>{const e=b.current;if(!e)return;if(k(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(k);return a.observe(e),()=>a.disconnect()},[k]);const C=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":y,"maxio-text-field--readonly":l,"maxio-text-field--full-width":c},m);return a.createElement(Ee,{...g,isDisabled:e,isInvalid:y,isReadOnly:l,selectionMode:p,className:C},i&&a.createElement(_e,{className:"maxio-text-field__label"},i),a.createElement("div",{ref:b,className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(we,{ref:h,className:"maxio-text-field__input",placeholder:d}),a.createElement("div",{className:"maxio-text-field__trailing-element"},a.createElement(oe,{className:x("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},a.createElement(Ke,{variant:"chevron-up-down"})))),o&&!N&&a.createElement(Ne,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(ye,{className:"maxio-form-error"},e=>a.createElement(a.Fragment,null,a.createElement(Ke,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},"function"==typeof r?r(e):r))),a.createElement(et,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:_,style:f},a.createElement(Ct,{renderEmptyState:u},I)))};Rt.displayName="ComboBox";const St=e=>a.createElement(Ct.Item,{...e});St.displayName="ComboBox.Item";const Pt=e=>a.createElement(Ct.Section,{...e});Pt.displayName="ComboBox.Section";const $t=e=>a.createElement(Ct.Header,{...e});$t.displayName="ComboBox.Header";const Dt=Object.assign(Rt,{Item:St,Section:Pt,Header:$t}),Tt=s({}),Mt=({indent:e=!1,disabled:l=!1,invalid:n=!1,label:i,...o})=>{const r=t(null),s=m(Tt),{inputProps:c,isDisabled:d}=C({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||i,isDisabled:l},s,r),u=x("maxio-radio",{"maxio-radio--indent":e,"maxio-radio--disabled":d||s.isDisabled,"maxio-radio--error":n||s.isInvalid});return a.createElement("label",{className:u},a.createElement("input",{ref:r,role:"radio",type:"radio",className:"maxio-radio__input",...c,name:s.name||c.name}),a.createElement("span",{className:"maxio-radio__control"}),a.createElement("span",{className:"maxio-radio__label"},i))},zt=({children:e,label:t,errorMessage:l,helperText:n,disabled:i=!1,invalid:o=!1,name:r,defaultValue:s,...c})=>{const m=Oe({isDisabled:i,isInvalid:o,description:n,name:r,label:t,errorMessage:l,defaultValue:s,...c}),{radioGroupProps:d,labelProps:u,descriptionProps:p,errorMessageProps:v}=R({"aria-label":c["aria-label"]||t,...c},m);return a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-radio-group",...d},t&&a.createElement("label",{className:"maxio-radio-group__label",...u},t),a.createElement(Tt.Provider,{value:m},e),o&&l&&a.createElement(Xa,{...v},l),n&&!o&&a.createElement(Ya,{...p},n)))},Ot=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,trailingElement:c=null,fullWidth:m,className:d,...u},p)=>{const v=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":t,"maxio-text-field--readonly":l,"maxio-text-field--full-width":m},d);return a.createElement(Ie,{...u,isDisabled:e,isReadOnly:l,isInvalid:t,className:v},i&&a.createElement(_e,{className:"maxio-text-field__label"},i),a.createElement("div",{className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(we,{ref:p,className:"maxio-text-field__input"}),c&&a.createElement("div",{className:"maxio-text-field__trailing-element"},c)),o&&!(t&&r)&&a.createElement(Ne,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(ye,{className:"maxio-form-error"},a.createElement(Ke,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Ot.displayName="TextField";const At=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,fullWidth:s,className:c,...m},d)=>{const u=x("maxio-text-area",`maxio-text-area--${n}`,{"maxio-text-area--disabled":e,"maxio-text-area--error":t,"maxio-text-area--readonly":l,"maxio-text-area--full-width":s},c);return a.createElement(Ie,{...m,isDisabled:e,isReadOnly:l,isInvalid:t,className:u},i&&a.createElement(_e,{className:"maxio-form-label"},i),a.createElement(ke,{ref:d,className:"maxio-text-area__input"}),o&&!(t&&r)&&a.createElement(Ne,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(ye,{className:"maxio-form-error"},a.createElement(Ke,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});At.displayName="TextArea";const Bt=i(({disabled:e=!1,invalid:n=!1,readOnly:i=!1,size:o="md",label:r,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:v,...b},h)=>{var f,E;const _=t(null);g(h,()=>_.current),l(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:w,...N}=b,y={...N,label:r,description:s,errorMessage:m,defaultValue:null===(f=b.defaultValue)||void 0===f?void 0:f.toString(),value:null===(E=b.value)||void 0===E?void 0:E.toString(),isDisabled:e,isReadOnly:i,isInvalid:n},{labelProps:I,inputProps:k,descriptionProps:C,errorMessageProps:R}=S(y,_),P=x("maxio-text-field",`maxio-text-field--${o}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},v),$=n&&m&&c;return a.createElement("div",{className:P},r&&a.createElement("label",{className:"maxio-text-field__label",...I},r),a.createElement("div",{className:"maxio-text-field__items"},d&&a.createElement("div",{className:"maxio-text-field__leading-element"},d),a.createElement("input",{ref:_,type:"text",className:"maxio-text-field__input",...k,spellCheck:w}),u&&a.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!$&&a.createElement("div",{className:"maxio-form-helper-text",...C},s),$&&a.createElement(Xa,{...R},m))});Bt.displayName="TextInput";const Lt=({options:e,label:t,size:l="md",inline:n=!1,disabled:i=!1,helperText:o,errorMessage:r,fullWidth:s=!1,...c})=>{const m=x("maxio-select",`maxio-select--${l}`,{"maxio-select--disabled":i,"maxio-select--inline":n,"maxio-select--error":!!r,"maxio-select--full-width":s}),d=b();return a.createElement("div",{className:m},t&&a.createElement("label",{htmlFor:d,className:"maxio-select__label"},t),a.createElement("div",{className:"maxio-select__input-container"},a.createElement("select",{id:d,className:"maxio-select__input",disabled:i,...c},e.map(e=>a.createElement("option",{key:`option-${e.value}`,value:e.value,disabled:e.disabled},e.label))),a.createElement(Ke,{variant:"chevron-up-down"})),!!r&&a.createElement(Xa,null,r),o&&!r&&a.createElement("div",{className:"maxio-form-helper-text"},o))},Wt=({size:e="md",onChange:t,totalItems:i=0,itemsPerPage:o=30,currentPage:r=1,pageSizeOptions:s,manualPageInput:c=!1})=>{const[m,d]=n(r),[u,p]=n(o),[v,g]=n(r.toString());l(()=>{g(m.toString())},[m]);const x=Math.ceil(i/u),b=m<x,h=m>1,f=u*(m-1)+1,E=Math.min(u*m,i),_=s.map(e=>({label:e.toString(),value:e.toString()})),w=Array.from({length:x},(e,a)=>a+1).map(e=>({label:e.toString(),value:e.toString()})),N=e=>{d(e),null==t||t({currentPage:e,itemsPerPage:u})},y=e=>{const a=parseInt(e,10);if(isNaN(a))return void g(m.toString());const t=Math.max(1,Math.min(a,x));g(t.toString()),N(t)};return a.createElement("div",{className:"maxio-pagination"},a.createElement("div",{className:"maxio-pagination__items-per-page"},a.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),a.createElement(Lt,{inline:!0,size:e,options:_,onChange:e=>{return a=Number(e.target.value),p(a),d(1),void(null==t||t({currentPage:1,itemsPerPage:a}));var a},value:u,id:"items-per-page-large"})),a.createElement("div",{className:"maxio-pagination__total-items"},a.createElement("span",null,f,"–",E," of ",i," items")),a.createElement("div",{className:"maxio-pagination__current-page"},c?a.createElement(Bt,{className:"maxio-pagination__page-input",value:v,min:1,max:x,onChange:e=>(e=>{g(e)})(e),onBlur:e=>{y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(y(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:e,type:"number",onWheel:e=>e.preventDefault()}):a.createElement(Lt,{inline:!0,size:e,"aria-label":"Select page",onChange:e=>N(Number(e.target.value)),value:m,options:w,id:"page-index-large"}),a.createElement("div",{className:"maxio-pagination__label"},"of ",x," pages")),a.createElement("div",{className:"maxio-pagination__controls"},a.createElement(Ia,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(ea,{icon:a.createElement(Ke,{variant:"chevron-left"}),size:e,variant:"ghost",onClick:()=>N(m-1),"aria-label":"Previous",disabled:!h})),a.createElement(Ia,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(ea,{icon:a.createElement(Ke,{variant:"chevron-right"}),size:e,variant:"ghost",onClick:()=>N(m+1),"aria-label":"Next",disabled:!b}))))},Ft=({label:e,helperText:t,size:l="md",variant:n="default",status:i,value:o,maxValue:r=100})=>{const s=b(),c=b(),m=i&&!!e&&!!o&&!("inline"===n),d=t&&!("inline"===n),u=t&&"inline"===n,{progressBarProps:p,labelProps:v}=P({maxValue:r,value:o,label:e}),g=x("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===l,"maxio-progress-bar--success":o&&!("inline"===n)&&"success"===i,"maxio-progress-bar--error":o&&!("inline"===n)&&"error"===i,"maxio-progress-bar--indent":"indent"===n,"maxio-progress-bar--inline":"inline"===n,"maxio-progress-bar--indeterminate":void 0===o});return a.createElement("div",{className:g,...p},a.createElement("div",{id:s,className:"maxio-progress-bar__label",...v},e),u&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t),a.createElement("div",{className:"maxio-progress-bar__track"},a.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${o}%`}})),m&&a.createElement("div",{className:`maxio-progress-bar__${i}-icon`}),d&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t))},Ht=({className:e,size:t="md",fullWidth:l=!1,selectionMode:n="single",orientation:i="horizontal",disallowEmptySelection:o=!0,...r})=>a.createElement(Ce,{...r,selectionMode:n,orientation:i,disallowEmptySelection:o,className:xe(e,e=>x("maxio-segmented-control",`maxio-segmented-control--${t}`,{"maxio-segmented-control--full-width":l},e))});Ht.displayName="SegmentedControl";const Vt=({className:e,children:t,...l})=>a.createElement(Re,{...l,className:xe(e,e=>x("maxio-segmented-control__item",e))},xe(t,e=>a.createElement(a.Fragment,null,a.createElement(Se,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),e)));Vt.displayName="SegmentedControl.Item";const jt=Object.assign(Ht,{Item:Vt}),Kt=({leadingIcon:e,trailingIcon:t,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:o=!1})=>a.createElement(a.Fragment,null,e&&a.createElement(Ia,{usePortal:!0,isVisible:o,renderContent:()=>n,floatingElementOffset:12},a.createElement("span",{className:"maxio-side-nav__icon"},a.createElement(Ke,{variant:e,className:i}))),a.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),t&&a.createElement("span",{className:"maxio-side-nav__menu-chevron"},a.createElement(Ke,{variant:t}))),qt=e=>"heading"!==e.type,Ut=e=>{const a=(e=>e.flat().filter(qt).map(e=>e.items).flat().find(e=>null==e?void 0:e.isCurrent))(e);return a?e.map(e=>e.map(e=>{var t;return qt(e)&&(null===(t=e.items)||void 0===t?void 0:t.includes(a))?{...e,isOpen:!0}:e})):e},Gt=s({}),Zt=()=>m(Gt),Yt=({children:e,isOpen:i,onChange:o,withIcons:r=!0,sections:s,shouldToggleSidebar:c=!0,topDropdownItems:m,collapseBreakpoint:d=800})=>{const u=t(!1),[p,v]=n(()=>!c||("boolean"==typeof i?i:"undefined"==typeof window||window.innerWidth>d)),[g,x]=n(()=>Ut(s)),{windowWitdh:b}=_a(200);l(()=>{u.current&&(null==o||o(p))},[p,o]),l(()=>{u.current=!0},[]),l(()=>{!function(e){if(!c)return;e<d&&p&&h()}(b)},[b]),l(()=>{"boolean"==typeof i&&v(i)},[i]);const h=()=>{v(!1)};return a.createElement(Gt.Provider,{value:{sections:g,topDropdownItems:m,onSectionOpen:e=>{x(a=>a.map(a=>a.map(a=>qt(a)?{...a,isOpen:(null==a?void 0:a.name)===e&&!a.isOpen}:a)))},isOpen:p,onOpen:()=>{v(!0)},onClose:h,withIcons:r,shouldToggleSidebar:c}},e)},Xt=()=>{const{onOpen:e,topDropdownItems:l,isOpen:n}=Zt(),{mainItem:i,otherItems:o,actions:r}=l,s=t(null),c=Ea(s),m=({id:e,title:a,icon:t,iconClass:l,url:n,...i})=>({id:e,label:a,leadingIconName:t,leadingIconClassName:l,link:{href:n,...i}}),{items:d,itemsCount:u}=v(()=>({itemsCount:o.length+r.length,items:[...o.map(m),(null==o?void 0:o.length)>0&&(null==r?void 0:r.length)>0?{type:"divider",id:"item-divider"}:null,...r.map(m)].filter(e=>null!=e)}),[r,o]);return a.createElement(a.Fragment,null,0===u?a.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:i.url,onClick:e},a.createElement("span",{className:"maxio-side-nav__menu-title"},i.title)):a.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},a.createElement("summary",{onClick:e,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:s},i.url?a.createElement(a.Fragment,null,a.createElement(Kt,{type:"menu",isTooltipVisible:!n&&c,leadingIcon:i.icon,trailingIcon:"chevron-up-down",leadingIconClassName:i.iconClass},i.title)):a.createElement(Kt,{type:"menu",trailingIcon:"chevron-up-down"},i.title)),a.createElement(Ge,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:d,small:!0})))},Qt=({section:e})=>{const{isOpen:l,withIcons:n}=Zt(),i=t(null),o=Ea(i);return a.createElement("li",{className:"maxio-side-nav__item","data-key":e.key,"data-testid":"maxio-sidebar-section"},a.createElement("a",{className:"maxio-side-nav__link","aria-current":e.isCurrent?"page":void 0,role:"button",href:e.href,ref:i},a.createElement(Kt,{isTooltipVisible:o&&!l,type:"menu",leadingIcon:n?e.icon:void 0},e.name)))},Jt=({section:e})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=Zt(),c=t(null),m=Ea(c);if(!qt(e))return a.createElement("li",{className:"maxio-side-nav__item-header"},e.title);return e.Component?a.createElement(e.Component,{section:e}):e.href?a.createElement(Qt,{section:e}):a.createElement("li",{className:x("maxio-side-nav__item",{"maxio-side-nav__item--icon":s}),"data-testid":"maxio-sidebar-section"},a.createElement("button",{className:"maxio-side-nav__menu-button",ref:c,"aria-expanded":e.isOpen?"true":"false",type:"button",onClick:()=>{o(e.name),i()}},a.createElement(Kt,{type:"menu",isTooltipVisible:!r&&m,leadingIcon:s?e.icon:void 0,trailingIcon:(null===(l=e.items)||void 0===l?void 0:l.length)?"chevron-down":void 0},e.name)),a.createElement("ul",{className:"maxio-side-nav__menu"},null===(n=e.items)||void 0===n?void 0:n.map(e=>a.createElement("li",{key:`section-sub-item-${e.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},a.createElement("a",{className:"maxio-side-nav__link",href:e.href,"aria-current":e.isCurrent?"page":void 0},a.createElement("span",{className:"maxio-side-nav__link-title"},e.name))))))},el=()=>{const{sections:e}=Zt();return a.createElement(a.Fragment,null,e.map((e,t)=>a.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${t}`},e.map((e,l)=>a.createElement(Jt,{key:`section-list-item-${e.type}-${t}-${l}`,section:e})))))},al=()=>{const{onClose:e,shouldToggleSidebar:t}=Zt();return a.createElement("div",{className:"maxio-side-nav__logo-container"},a.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),t&&a.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:e},a.createElement(Ke,{variant:"sidebar"})))},tl=()=>{const{isOpen:e}=Zt();return a.createElement("nav",{className:x("maxio-side-nav",{"maxio-side-nav--collapsed":!e})},a.createElement(al,null),a.createElement(Xt,null),a.createElement("div",{className:"maxio-side-nav__items-container"},a.createElement(el,null)))},ll=({withIcons:e=!0,shouldToggleSidebar:t=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>a.createElement(Yt,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:e,shouldToggleSidebar:t,topDropdownItems:l,sections:n},a.createElement(tl,null)),nl=({disabled:e=!1,value:t=0,className:l,id:n,isCurrent:i,...o})=>{const r="icon"===o.type,s=({isSelected:a})=>x("maxio-tabs__tab",l,{"maxio-tabs__tab--active":a,"maxio-tabs__tab--disabled":e,"maxio-tabs__tab--icon":r});if("icon"===o.type){const{icon:l,...n}=o;return a.createElement(Pe,{id:t,isDisabled:e,...n,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},l))}const{children:c,rightIcon:m,...d}=o;return a.createElement(Pe,{id:t,isDisabled:e,...d,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},c,m||null))},il=s({variant:"line",withDivider:!1}),ol=({children:e,variant:t="line",withDivider:l=!1})=>a.createElement(il.Provider,{value:{variant:t,withDivider:l}},e),rl=({children:e,variant:t="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>a.createElement($e,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:n,onSelectionChange:e=>null==o?void 0:o(Number(e))},a.createElement(ol,{variant:t,withDivider:l},e)),sl=({children:e,value:t,className:l,id:n,...i})=>a.createElement(De,{id:t,className:x("maxio-tabs__panel",l),...i},e),cl=({children:e})=>{const t=d.map(e,(e,a)=>{if(!r(e)||e.type!==sl)throw new Error("You can only pass <TabPanel /> component as children");return o(e,{key:a,value:a})});return a.createElement(Te,{className:"maxio-tabs__panels"},t)},ml=({children:e,className:l,ariaLabel:i,overflow:s="none",moreLabel:p="More",...v})=>{const{variant:g,withDivider:b}=m(il),h=m(Me),f=c(),[E,_]=n(!1),w=x("maxio-tabs",l,{"maxio-tabs--contained":"contained"===g,"maxio-tabs--divider":b}),N=d.map(e,e=>e);(null!=N?N:[]).forEach(e=>{if(!r(e)||e.type!==nl)throw new Error("You can only pass <Tab /> component as children")});const y="auto"===s&&!!(null==N?void 0:N.length),{ref:I,moreButtonRef:k,overflowIndexes:C,handleKeyDownCapture:R}=(({overflowEnabled:e,childrenArray:a})=>{const l=t(null),i=t(null),o=t(null),[r,s]=n(null),c=wa(l),d=m(Me),p=null!=(null==d?void 0:d.selectedKey)?Number(d.selectedKey):null,[v,g]=n([]);u(()=>{var t;if(!e||!r)return void g((null!=a?a:[]).map((e,a)=>a));const{visibleIndexes:l}=((e,a,t,l)=>{const n=e.map((e,a)=>a);if(e.reduce((e,a)=>e+a,0)<=a)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let o=t;for(const t of n){if(o+e[t]>a)break;o+=e[t],i.push(t)}if(null!==l&&!i.includes(l)){for(o+=e[l];o>a&&i.length>0;)o-=e[i.pop()];i.push(l)}i.sort((e,a)=>e-a);const r=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:r}})(r.tabWidths,c,r.moreButtonWidth,null!==(t=o.current)&&void 0!==t?t:p);l.length===(null!=a?a:[]).length&&(o.current=null),g(l)},[e,r,c]),u(()=>{e&&r&&null!==p&&g(e=>(e.includes(p)||(o.current=p),((e,a,t,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,a)=>e-a);let o=l+i.reduce((e,t)=>e+a[t],0);for(;o>t&&i.length>1;){const e=i.length-1,t=i[e]===n?e-1:e,[l]=i.splice(t,1);o-=a[l]}return i})(e,r.tabWidths,c,r.moreButtonWidth,p)))},[p]);const x=e?(null!=a?a:[]).map((e,a)=>a).filter(e=>!v.includes(e)):[],b=((e,a)=>e.filter(e=>{var t;return!(null===(t=null==a?void 0:a[e])||void 0===t?void 0:t.props.disabled)}))(v,a);u(()=>{var t,n;if(!e||!l.current)return void s(e=>null===e?e:null);const o=Array.from(l.current.querySelectorAll('[role="tab"]')),r=null!==(n=null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect().width)&&void 0!==n?n:0;s(e=>{var t;const l=(null!=a?a:[]).map((a,t)=>{var l,n,i;const r=null!==(n=null===(l=o[t])||void 0===l?void 0:l.getBoundingClientRect().width)&&void 0!==n?n:0;return r>0?r:null!==(i=null==e?void 0:e.tabWidths[t])&&void 0!==i?i:0}),n=r>0?r:null!==(t=null==e?void 0:e.moreButtonWidth)&&void 0!==t?t:0,i=(null==e?void 0:e.tabWidths.length)===l.length&&e.tabWidths.every((e,a)=>e===l[a]);return e&&i&&e.moreButtonWidth===n?e:{tabWidths:l,moreButtonWidth:n}})},[a,e]);const h=e=>{var a,t;void 0!==e&&(null==d||d.selectionManager.setFocused(!0),null==d||d.selectionManager.setFocusedKey(e),null==d||d.setSelectedKey(e),null===(t=null===(a=l.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus())};return{ref:l,moreButtonRef:i,visibleIndexes:v,overflowIndexes:x,handleKeyDownCapture:e=>{var a;if(0===x.length)return;const t=document.activeElement===i.current,l=null==d?void 0:d.selectionManager.focusedKey,n=t?-1:b.indexOf(Number(l));if(t||-1!==n)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(n<b.length-1?h(b[n+1]):null===(a=i.current)||void 0===a||a.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?h(b[b.length-1]):n>0&&h(b[n-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[b.length-1])}}}})({overflowEnabled:y,childrenArray:N}),S=a.createElement("span",{className:"maxio-tabs__tab__content"},p,a.createElement(Ke,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),P=C.map(e=>{return`#${a=f,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(a):a.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var a});return a.createElement("div",{id:f,className:w,ref:I,onKeyDownCapture:R},P.length>0&&a.createElement("style",null,`${P.join(", ")} { display: none; }`),a.createElement(ze,{"aria-label":i,className:"maxio-contents",...v},(null!=N?N:[]).map((e,a)=>o(e,{key:a,value:a}))),y&&C.length>0&&a.createElement(ce,{isOpen:E,onOpenChange:_},a.createElement(oe,{ref:k,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":p},S),E&&a.createElement(et,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},a.createElement(me,{"aria-label":`${p} tabs`,onAction:e=>{null==h||h.setSelectedKey(e),requestAnimationFrame(()=>{var a,t;null===(t=null===(a=I.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus()})}},C.map(e=>{const t=N[e],{disabled:l,type:n,"aria-label":i,"aria-labelledby":o}=t.props,r="icon"===n?t.props.icon:t.props.children;return a.createElement(de,{key:e,id:e,isDisabled:!!l,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},r)})))))},dl=({children:e,size:t,sentiment:l,kind:n="primary",leadingIcon:i,trailingIcon:o})=>{const r=x("maxio-tag",`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`,!!t&&`maxio-tag--${t}`);return a.createElement("div",{className:r},i&&a.createElement(Ke,{variant:i,className:"maxio-tag__icon"}),a.createElement("span",{className:"maxio-tag__label"},e),o&&a.createElement(Ke,{variant:o,className:"maxio-tag__icon"}))},ul=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__header",t),...l},e);ul.displayName="Card.Header";const pl=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__body",t),...l},e);pl.displayName="Card.Body";const vl=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__footer",t),...l},e);vl.displayName="Card.Footer";const gl=({children:e,className:t,variant:l="primary",...n})=>a.createElement("div",{className:x("maxio-card",`maxio-card--${l}`,t),...n},e);gl.displayName="Card";const xl=Object.assign(gl,{Header:ul,Body:pl,Footer:vl}),bl=({children:e,className:t,href:l,onClick:n,target:i,disabled:o})=>{const r=l||n;if(!r)return a.createElement("div",{className:"maxio-tile"},e);const s=x("maxio-tile",t,{"maxio-tile--clickable":r,"maxio-tile--disabled":o});return a.createElement("a",{className:s,href:l,target:i,onClick:e=>{o&&l&&e.preventDefault(),!o&&n&&n()}},e)};var hl,fl,El,_l;function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},wl.apply(null,arguments)}const Nl=a=>e.createElement("svg",wl({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},a),hl||(hl=e.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),fl||(fl=e.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),El||(El=e.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),_l||(_l=e.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),yl=e=>{const{size:t="sm",className:l,variant:n="lockup",alt:i="maxio logo"}=e,o="mark"===n,r="number"==typeof t;return a.createElement(Nl,{role:"img",viewBox:o?"0 0 240 240":"0 0 1036 240","aria-label":i,height:r?t:void 0,className:x("maxio-logo",!r&&`maxio-logo--${t}`,o&&"maxio-logo--mark",l)})},Il=({state:e,...l})=>{var n,i;const o=t(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:m}=We(l,e,o),{closable:d=!0,underline:u=!0,external:p=!1}=l.toast.content,v=x("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),g={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return a.createElement("div",{className:v,"data-maxio-mode":"dark",...r,ref:o},a.createElement(Ke,{variant:g,className:"maxio-toast__icon"}),a.createElement("div",{className:"maxio-toast__container",...s},a.createElement("div",{className:"maxio-toast__content",...c},l.toast.content.title&&a.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&a.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),(null===(n=l.toast.content.link)||void 0===n?void 0:n.text)&&(null===(i=l.toast.content.link)||void 0===i?void 0:i.href)&&a.createElement(Ze,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),d&&a.createElement(ea,{variant:"ghost",icon:a.createElement(Ke,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...m}))},kl=({state:e,...t})=>{const l=a.useRef(null),{regionProps:n}=Fe(t,e,l);return a.createElement("div",{...n,ref:l,className:t.className,style:{display:"flex",flexDirection:"column",gap:"10px"}},e.visibleToasts.map(t=>a.createElement(Il,{key:t.key,toast:t,state:e})))},Cl=({children:e,...t})=>{const{maxVisibleToasts:l=5,...n}=t,i=Ae({maxVisibleToasts:l,...n});return a.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),a.createElement(a.Fragment,null,e(i),i.visibleToasts.length>0&&a.createElement(kl,{...t,state:i}))},Rl=s(null),Sl=({children:e,toastQueue:t,...l})=>{const n=Be(t),i=p(()=>{n.visibleToasts.forEach(e=>{t.close(e.key)})},[n.visibleToasts,t]),o=v(()=>({addToast:t.add.bind(t),removeToast:t.clear.bind(t),removeAllToasts:i,state:n}),[t,i,n]);return a.createElement(Rl.Provider,{value:o},e,n.visibleToasts.length>0&&a.createElement(kl,{...l,state:n}))},Pl=()=>{const e=m(Rl);if(!e)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return e};class $l extends Le{}const Dl=({defaultChecked:e,checked:t,onChange:l,disabled:n,valueDescription:i,valueDescriptionPosition:o,className:r,name:s,id:m,...d})=>{const u=c(),v="boolean"==typeof e,g=m||u,b="left"===o?"row":"row-reverse",h=i&&o,f=p(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const a=e.currentTarget.checked;v&&(e.currentTarget.checked=!a),l&&l(!a,e)}},[v,l]),E=d["aria-label"]||(h?void 0:i);return a.createElement("div",{className:x("maxio-toggle",r,{"maxio-toggle--disabled":n}),style:{display:"inline-flex",flexDirection:b},"data-testid":"toggle-container"},h?a.createElement("label",{className:"maxio-toggle__label",htmlFor:g},i):null,a.createElement("div",{className:"maxio-toggle__container"},a.createElement("input",{type:"checkbox",defaultChecked:e,checked:t,onChange:e=>{l&&l(e.target.checked,e)},onKeyDown:f,disabled:n,className:"maxio-toggle__checkbox",id:g,name:s,"aria-label":E}),a.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":t,"aria-hidden":"true"},a.createElement("div",{className:"maxio-toggle__handle"}),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-on"})),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-off"})))))},Tl=({children:e,actions:t,sideNavIsClosed:l,openSideNav:n})=>a.createElement("nav",{className:"maxio-top-bar"},l&&a.createElement(ea,{"aria-label":"Open Side Navigation",variant:"ghost",icon:a.createElement(Ke,{variant:"sidebar"}),onClick:n}),a.createElement(_t,{grow:!0,justifyContent:"end"},e),t),Ml=({...e})=>{const l=t(null),{buttonProps:n}=f(e,l);return a.createElement("button",{...n,className:"maxio-chip__dismiss-button"},a.createElement(Ke,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},zl=({label:e,onDismiss:l,dismissLabel:n,leadingIcon:i,trailingIcon:o,title:r,...s})=>{const c=t(null),m=te(s),{buttonProps:d}=$(s,m,c),u=x("maxio-chip",{"maxio-chip--selected":null==m?void 0:m.isSelected}),p=x("maxio-chip__button",{"maxio-chip--dismissible":l});return a.createElement("div",{className:u},a.createElement("button",{className:p,ref:c,...d,title:r},i&&a.createElement(Ke,{variant:i,className:"maxio-chip__icon"}),a.createElement("span",{className:"maxio-chip__label"},e),o&&!l&&a.createElement(Ke,{variant:o,className:"maxio-chip__icon"})),l&&a.createElement(Ml,{onPress:l,"aria-label":n}))},Ol=({children:e,templateColumns:t,templateRows:l,autoColumns:n,autoRows:i,inline:o,column:r,columnStart:s,columnEnd:c,row:m,rowStart:d,rowEnd:u,gap:p,gapX:v,gapY:g,className:b,justifyContent:h,alignItems:f,...E})=>{const _=x(b,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${t}`]:t,[`maxio-grid-rows-${l}`]:l,[`maxio-auto-cols-${n}`]:n,[`maxio-auto-rows-${i}`]:i,["maxio-col-"+("auto"===r?"auto":`span-${r}`)]:r,[`maxio-col-start-${s}`]:s,[`maxio-col-end-${c}`]:c,["maxio-row-"+("auto"===m?"auto":`span-${m}`)]:m,[`maxio-row-start-${d}`]:d,[`maxio-row-end-${u}`]:u,[`maxio-gap-${p}`]:void 0!==p,[`maxio-gap-x-${v}`]:void 0!==v,[`maxio-gap-y-${g}`]:void 0!==g,[`maxio-justify-${h}`]:h,[`maxio-items-${f}`]:f});return a.createElement("div",{className:_||void 0,...E},e)},Al={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"},Bl=({children:e,heading:t,description:l,sentiment:n="success",leadingElement:i=null,alert:o,topAddon:r=null,footer:s})=>a.createElement("div",{className:"maxio-auth-layout"},a.createElement(_t,{alignItems:"center",justifyContent:"between"},a.createElement(yl,{size:"md"}),r),o&&a.createElement(aa,{display:"block",title:o.title,sentiment:o.sentiment},o.children),a.createElement(xl,{variant:"secondary"},a.createElement(xl.Body,null,a.createElement(_t,{flexDirection:"col",gap:6},a.createElement(_t,{flexDirection:"col",gap:2},a.createElement(_t,{alignItems:"center",gap:2},i,a.createElement(gt,{size:"lg",className:x("maxio-auth-layout__heading",Al[n])},t)),l&&a.createElement(_t,{style:{color:"var(--maxio-color-text-tertiary)"}},a.createElement(bt,{size:"sm",className:"maxio-auth-layout__description"},l))),e)),s&&a.createElement(xl.Footer,null,s)));export{Ge as ActionList,aa as Alert,Bl as AuthLayout,ca as Avatar,ma as Banner,bt as Body,ga as Breadcrumbs,da as BreadcrumbsItem,Je as Button,xl as Card,Za as Checkbox,Qa as CheckboxGroup,zl as Chip,ft as Code,Dt as ComboBox,Ca as CopyToClipboard,pt as DataTable,ht as Display,xt as Drawer,wt as EmptyState,_t as Flex,Xa as FormErrorMessage,Ya as FormHelperText,Sl as GlobalToastProvider,Ol as Grid,gt as Heading,Ke as Icon,ea as IconButton,Et as Label,Ze as Link,Ct as ListBox,Ye as LoadingSpinner,yl as Logo,oa as Menu,sa as MenuButton,ra as MenuList,Na as OverlayTrigger,Wt as Pagination,et as Popover,Ft as ProgressBar,Mt as Radio,zt as RadioGroup,jt as SegmentedControl,Lt as Select,ll as SideNav,nl as Tab,ml as TabList,sl as TabPanel,cl as TabPanels,rl as Tabs,dl as Tag,At as TextArea,Ot as TextField,Bt as TextInput,bl as Tile,Cl as ToastProvider,$l as ToastQueue,Dl as Toggle,xa as Tooltip,Ia as TooltipTrigger,Tl as TopBar,wa as useElementResizeObserver,Ea as useHover,fa as useOverlayTrigger,Pl as useToast,_a as useWindowSize};
|