@maxio-com/react-ui-components 9.8.1 → 9.9.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 CHANGED
@@ -1 +1 @@
1
- import*as e from"react";import a,{useRef as t,useEffect as l,useState as n,cloneElement as i,isValidElement as o,createContext as r,useId as s,useContext as c,Children as m,useMemo as d,forwardRef as u,useCallback as p,useImperativeHandle as v}from"react";import x from"classnames";import{useId as g,useLink as h,useButton as b,useCheckboxGroupItem as E,useCheckbox as f,useCheckboxGroup as _,useRadio as N,useRadioGroup as w,useTextField as y,useProgressBar as k,useToggleButton as C}from"react-aria";import{flexRender as I,useReactTable as P,getSortedRowModel as S,getExpandedRowModel as $,getCoreRowModel as D}from"@tanstack/react-table";export{createColumnHelper}from"@tanstack/react-table";import{useToggleState as T}from"@react-stately/toggle";import{useCheckboxGroupState as O}from"@react-stately/checkbox";import{AnimatePresence as z,motion as R}from"framer-motion";import{useDismiss as M,useFocus as L,useHover as V,useClick as H,useFloating as A,offset as B,useInteractions as W,useRole as F,FloatingPortal as j}from"@floating-ui/react-dom-interactions";import{useRadioGroupState as q}from"@react-stately/radio";import{Popover as U,OverlayArrow as G,ListBox as Y,ListBoxItem as Z,composeRenderProps as K,ListBoxSection as X,Header as Q}from"react-aria-components";export{DialogTrigger,Pressable}from"react-aria-components";import{useToastState as J,useToastQueue as ee,ToastQueue as ae}from"@react-stately/toast";import{useToast as te,useToastRegion as le}from"@react-aria/toast";const ne=["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","dropbox","hubspot","sage","oracle","quotapath","avalara","pipedrive","quickbooks","salesforce","xero"],ie=["dropbox","hubspot","sage","oracle","quotapath"],oe=["avalara","pipedrive","quickbooks","salesforce","xero"],re=({variant:e,color:t,className:l,size:n})=>{const i=(e,a)=>a.includes(e),o=i(e,ne)||i(e,ie),r=i(e,oe),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,ie)&&!i(e,oe)},l);return a.createElement("i",{className:s})},se=({item:e,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=t(null),c=t(!1),m=g();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:h,link:b}=e,E=x("maxio-action-list__label",{"maxio-truncate":i});return a.createElement("a",{"aria-labelledby":m,...b,className:x("maxio-action-list__content",b.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},d&&a.createElement(re,{variant:d,className:x("maxio-action-list__leading-icon",u)}),a.createElement("span",{className:E,id:m},v),h&&a.createElement("span",{className:"maxio-action-list__description"},h),p&&a.createElement(re,{variant:p,className:"maxio-action-list__trailing-icon"}))},ce=(e,a,t)=>0===e?e:1===e&&"divider"===a[e-1].type?t||e:"divider"===a[e-1].type?ce(e-1,a,t||e):e-1,me=({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=>ce(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(se,{item:e,truncateLabel:o,key:`listbox-${e.id}`,isSelected:t===m,small:r,...l})))},de=({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(re,{variant:i,className:"maxio-link__icon"}))},ue=({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"})},pe=({fullWidth:e=!1,leadingElement:l,trailingElement:n,icon:r,variant:s="primary",size:c,...m})=>{const d=t(null),{linkProps:u}=h({...m},d),p=x("maxio-button",m.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":e});return a.createElement("a",{...u,ref:d,className:p,href:m.href},l&&i(l,{...o(l)&&{className:"maxio-button__leading-element"}}),m.children,(n||r)&&i(n||r,{...o(n||r)&&{className:"maxio-button__trailing-element"}}))},ve=({disabled:e,loading:l=!1,fullWidth:n=!1,leadingElement:r,trailingElement:s,icon:c,variant:m="primary",size:d,...u})=>{const p=t(null),{buttonProps:v}=b({...u,isDisabled:e,formAction:"string"==typeof u.formAction?u.formAction:void 0},p),g=["primary","danger"].includes(m),h=x("maxio-button",u.className,{[`maxio-button--${d}`]:d,[`maxio-button--${m}`]:m,"maxio-button--loading":l,"maxio-button--full-width":n});return a.createElement("button",{...v,className:h,ref:p},r&&i(r,{...o(r)&&{className:"maxio-button__leading-element"}}),u.children,!l&&(s||c)&&i(s||c,{...o(s||c)&&{className:"maxio-button__trailing-element"}}),l&&a.createElement(ue,{className:"maxio-button__trailing-element",size:"md",white:g}))},xe=e=>(e=>"href"in e)(e)?a.createElement(pe,{...e}):a.createElement(ve,{...e}),ge=({"aria-label":e,className:t,...l})=>a.createElement(xe,{"aria-label":e,className:x("maxio-button--icon",t),...l},null),he=({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(re,{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(de,{className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(ge,{icon:a.createElement(re,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-alert__dismiss"}))},be=r({}),Ee=({children:e})=>{const[t,l]=n(!1),i=s(),o=s();return a.createElement(be.Provider,{value:{controlsId:i,buttonId:o,isOpen:t,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},e)};function fe(){const e=c(be);if(!e||"object"==typeof e&&0===Object.keys(e).length)throw new Error("useMenu hook must be used within a MenuProvider");return e}const _e=({children:e})=>{const{isOpen:t,onToggle:l,onClose:n}=fe();return a.createElement("details",{open:t,onToggle:l,className:"maxio-action-menu"},"function"==typeof e?e({isOpen:t,onClose:n}):e)},Ne=({children:e})=>a.createElement(Ee,null,a.createElement(_e,null,e)),we=({items:e,alignItemsEnd:t=!1})=>{const l=x("maxio-action-menu__content",{"maxio-action-menu__content--align-end":t}),{controlsId:n,buttonId:i}=fe();return a.createElement("div",{className:l,role:"presentation"},a.createElement(me,{role:"menu",itemProps:{role:"menuitem"},id:n,"aria-labelledby":i,items:e}))},ye=({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}=fe();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(re,{variant:t,className:`${o} maxio-button__trailing-element`}))},ke=({className:e,src:t,alt:l="avatar"})=>a.createElement("img",{className:x("maxio-avatar",e),alt:l,src:t}),Ce=({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(re,{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(de,{href:i,..."warning"!==r&&{variant:"inverse"},underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(ge,{icon:a.createElement(re,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-banner__dismiss"}))},Ie=({children:e,className:t,href:l,...n})=>{const i=l?a.createElement(de,{size:"sm",href:l},e):e;return a.createElement("li",{className:x("maxio-breadcrumbs__item",t),...n},i)},Pe="Breadcrumbs requires at least one BreadcrumbsItem as children",Se='Last BreadcrumbsItem should not have "href" prop. It is the current page.',$e="Breadcrumbs only accepts BreadcrumbsItem as children",De=({className:e,children:t,...l})=>{const n=m.count(t);if(0===n)throw new Error(Pe);const r=m.map(t,(e,a)=>{if(o(e)&&e.type===Ie){if(a===n-1&&e.props.href)throw new Error(Se);return i(e,{"aria-current":a===n-1?"page":void 0})}throw new Error($e)});return a.createElement("nav",{"aria-label":"Breadcrumb",...l},a.createElement("ol",{className:x("maxio-breadcrumbs",e)},r))},Te="row-controls",Oe="row-actions",ze=({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))},Re=({children:e})=>a.createElement("thead",null,e),Me=({children:e})=>a.createElement("tbody",null,e),Le=({children:e,table:t,header:l,className:n,enableExpanding:i,...o})=>{var r,s,c,m,d,u,p,v,g,h,b;const E=null==l?void 0:l.column,f=null===(r=null==E?void 0:E.getCanSort)||void 0===r?void 0:r.call(E),_=null===(s=null==E?void 0:E.getToggleSortingHandler)||void 0===s?void 0:s.call(E),N=null==l?void 0:l.isPlaceholder,w=null===(m=null===(c=null==E?void 0:E.columnDef)||void 0===c?void 0:c.meta)||void 0===m?void 0:m.align,y=null===(u=null===(d=null==E?void 0:E.columnDef)||void 0===d?void 0:d.meta)||void 0===u?void 0:u.width,k=null===(v=null===(p=null==E?void 0:E.columnDef)||void 0===p?void 0:p.meta)||void 0===v?void 0:v.controls,C=null===(h=null===(g=null==E?void 0:E.columnDef)||void 0===g?void 0:g.meta)||void 0===h?void 0:h.actions,I=null==E?void 0:E.getIsPinned(),P=null==E?void 0:E.getIsSorted(),S="asc"===P,$=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${I}`]:I,"maxio-data-table__cell--sortable":f,"maxio-data-table__cell--active":P,[`maxio-data-table__cell--${w}`]:w,"maxio-data-table__cell--controls":k,"maxio-data-table__cell--actions":C}),D=y?{width:y}:{},T=((e,a)=>e&&a?"arrow-up":e&&!a?"arrow-down":"arrow-down-up")(!!P,S),O=null==t?void 0:t.getToggleAllRowsExpandedHandler(),z=null===(b=null==t?void 0:t.getIsAllRowsExpanded)||void 0===b?void 0:b.call(t),R=(null==l?void 0:l.headerGroup.headers[0].id)===Te?1:0,M=i&&(null==l?void 0:l.index)===R;return N?null:a.createElement("th",{scope:"col",role:"columnheader","aria-sort":P?S?"ascending":"descending":"none",className:$,onClick:_,colSpan:null==l?void 0:l.colSpan,style:D,...o},a.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&M&&a.createElement(ge,{size:"sm",variant:"ghost",icon:a.createElement(re,{size:"xs",variant:z?"chevron-down":"chevron-right"}),onClick:O,"aria-label":z?"Collapse all rows":"Expand all rows","data-open":z,className:"maxio-data-table__expand-button"}),e,f&&a.createElement(re,{variant:T,className:"maxio-data-table__sort-icon"})))},Ve=({children:e,row:t,isChild:l,isHeader:n,className:i})=>{var o,r,s;const c=null===(o=null==t?void 0:t.getIsSelected)||void 0===o?void 0:o.call(t),m=(null===(r=null==t?void 0:t.getCanExpand)||void 0===r?void 0:r.call(t))&&(null===(s=null==t?void 0:t.getIsExpanded)||void 0===s?void 0:s.call(t)),d=x({"maxio-data-table__row":!n,"maxio-data-table__header-row":n,"maxio-data-table__row--active":c,"maxio-data-table__row--expanded":m,"maxio-data-table__row--expanded-child":l},i);return a.createElement("tr",{className:d},e)},He=r({}),Ae=u(({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))});Ae.displayName="InnerCheckbox";const Be=({label:e,error:l=!1,className:n,indeterminate:i,value:o="",disabled:r,readOnly:s,defaultChecked:m,checked:d,...u})=>{const p=t(null),v=c(He),{inputProps:x,isDisabled:g,isInvalid:h,isSelected:b}=v&&Object.keys(v).length>0?E({value:o,"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,...u},v,p):f({"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,value:o,...u},T({...u,isSelected:d,defaultSelected:m}),p);return a.createElement(Ae,{inputProps:x,checked:b,disabled:g,invalid:h,indeterminate:i,className:n,error:l,label:e,ref:p,...u})},We=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-helper-text",t),...l},e),Fe=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-error",t),...l},a.createElement(re,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},e)),je=({helperText:e,className:t,errorMessage:l,children:n,disabled:i,label:o,defaultValue:r,name:s,...c})=>{var m;const d=O({defaultValue:r,name:s,errorMessage:l,description:e,label:o,isDisabled:i,isInvalid:!!l,...c}),{groupProps:u,labelProps:p,descriptionProps:v,errorMessageProps:g,isInvalid:h}=_({"aria-label":null===(m=null!=o?o:c["aria-label"])||void 0===m?void 0:m.toString(),isDisabled:i,isInvalid:!!l,...c},d),b=x("maxio-checkbox-group",{"maxio-checkbox-group--disabled":i},t),E=e&&!l;return a.createElement("div",{className:b,...u},o&&a.createElement("label",{className:"maxio-checkbox-group__label",...p},o),a.createElement(He.Provider,{value:d},n),E&&a.createElement(We,{...v},e),l&&h&&a.createElement(Fe,{...g},l))},qe=({table:e})=>{var t,l,n,i;const o=null===(t=null==e?void 0:e.getToggleAllPageRowsSelectedHandler)||void 0===t?void 0:t.call(e),r=(null===(l=null==e?void 0:e.getIsAllPageRowsSelected)||void 0===l?void 0:l.call(e))||(null===(n=null==e?void 0:e.getIsAllRowsSelected)||void 0===n?void 0:n.call(e)),s=null===(i=null==e?void 0:e.getIsSomePageRowsSelected)||void 0===i?void 0:i.call(e);return a.createElement(Be,{"aria-label":"Select all rows",onChange:e=>{o("boolean"==typeof e?{target:{checked:e}}:e)},checked:r,indeterminate:!r&&s})},Ue=({row:e})=>{var t,l,n,i;const o=null===(t=null==e?void 0:e.getToggleSelectedHandler)||void 0===t?void 0:t.call(e),r=(null===(l=null==e?void 0:e.getIsSelected)||void 0===l?void 0:l.call(e))||(null===(n=null==e?void 0:e.getIsAllSubRowsSelected)||void 0===n?void 0:n.call(e)),s=null===(i=null==e?void 0:e.getIsSomeSelected)||void 0===i?void 0:i.call(e),c=e.id||e.index;return a.createElement(Be,{"aria-label":`Select row ${c}`,onChange:o,checked:r,indeterminate:s})},Ge=({children:e})=>a.createElement("div",{className:"maxio-data-table__cell-flex"},e),Ye=({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,h=null==u?void 0:u.getIsPinned(),b=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${h}`]:h,[`maxio-data-table__cell--${p}`]:p,"maxio-data-table__cell--controls":v,"maxio-data-table__cell--actions":g});return a.createElement("td",{className:b,...i},l)},Ze=({row:e,SubRowComponent:t,pattern:l,enableExpanding:n})=>{var i,o,r,s,c;const m=t&&e.getParentRow()&&e.getParentRow().getIsExpanded(),d=m&&e.getVisibleCells()[0].column.columnDef.id===Te,u=m&&e.getVisibleCells()[e.getVisibleCells().length-1].column.columnDef.id===Oe,p=[u,d].filter(Boolean).length,v=e.getVisibleCells().length-p,x=null!==(o=null===(i=e.getParentRow())||void 0===i?void 0:i.index)&&void 0!==o?o:e.index,g=l&&t&&x%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(r=e.getCanExpand)||void 0===r?void 0:r.call(e),b=null===(s=null==e?void 0:e.getToggleExpandedHandler)||void 0===s?void 0:s.call(e),E=null===(c=null==e?void 0:e.getIsExpanded)||void 0===c?void 0:c.call(e),f=h&&n?0:1.75,_=e.getVisibleCells()[0].column.columnDef.id===Te?1:0;return a.createElement(a.Fragment,{key:e.id},m?a.createElement(Ve,{key:`${e.id}-sub`,row:e,isChild:!0,className:g},d&&a.createElement(Ye,{className:"maxio-data-table__cell--pinned-left"}),a.createElement(Ye,{colSpan:v},t(e)),u&&a.createElement(Ye,{className:"maxio-data-table__cell--pinned-right"})):a.createElement(Ve,{key:`${e.id}-parent`,row:e,className:g},e.getVisibleCells().map(t=>{const l=n&&t.column.getIndex()===_;return a.createElement(Ye,{key:t.id,row:e,cell:t},a.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${(null==e?void 0:e.depth)+f}rem`}:void 0},n&&h&&l&&a.createElement(ge,{size:"sm",variant:"ghost",icon:a.createElement(re,{size:"xs",variant:E?"chevron-down":"chevron-right"}),onClick:b,"aria-label":E?"Collapse row":"Expand row","data-open":E,className:"maxio-data-table__expand-button"}),I(t.column.columnDef.cell,t.getContext())))})))},Ke=({pattern:e,size:t="md",SubRowComponent:n,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:m,columns:u,actions:p,...v})=>{const x=(({columns:e,HeaderControls:t,RowControls:l,RowActions:n,actions:i,enableExpanding:o,enableRowSelection:r})=>d(()=>{const s={id:Te,header:e=>a.createElement(t,{...e,enableExpanding:o,enableRowSelection:r}),cell:e=>a.createElement(l,{...e,enableExpanding:o}),meta:{controls:!0}},c=i&&n?{id:Oe,header:"",cell:e=>a.createElement(n,{...e},i(e.row,e.table)),meta:{actions:!0}}:null;let m=[...e];return r&&(m=[s,...m]),c&&(m=[...m,c]),m},[i,n,o,r,e,t,l]))({columns:u,HeaderControls:qe,RowControls:Ue,RowActions:Ge,actions:p,enableRowSelection:c,enableExpanding:Boolean(m)}),g=P({state:{columnPinning:{left:["row-controls"],right:["row-actions"]},...v.state},getSubRows:e=>e.subRows,getCoreRowModel:D(),enableRowSelection:c,enableExpanding:Boolean(m),...!v.manualExpanding&&{getExpandedRowModel:$()},enableSorting:s,...!v.manualSorting&&{getSortedRowModel:S()},columns:x,...v}),h=g.getCanSomeRowsExpand(),b=g.getState();return l(()=>{null==i||i(b.expanded)},[i,b.expanded]),l(()=>{null==o||o(b.rowSelection)},[o,b.rowSelection]),l(()=>{null==r||r(b.sorting)},[r,b.sorting]),a.createElement(ze,{pattern:e,size:t,isExpandable:h,isUsingCustomRow:!!n},a.createElement(Re,null,g.getHeaderGroups().map(e=>a.createElement(Ve,{key:e.id,table:g,isHeader:!0},e.headers.map(e=>a.createElement(Le,{key:e.id,table:g,header:e,enableExpanding:m},I(e.column.columnDef.header,e.getContext())))))),a.createElement(Me,null,g.getRowModel().rows.map(t=>a.createElement(Ze,{key:t.id,row:t,pattern:e,SubRowComponent:n,enableExpanding:m}))))},Xe={click:H,hover:e=>V(e,{delay:100}),focus:L,dismiss:M},Qe=(e,a)=>a.map(a=>Xe[a](e)),Je=({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}=A({placement:e,open:a,onOpenChange:e=>o(e),middleware:[B(i)]}),{getReferenceProps:x,getFloatingProps:g}=W([...Qe(u,n),F(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:x,getFloatingProps:g}};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 aa(e=500){const[a,i]=n(()=>{const{innerWidth:e,innerHeight:a}=window;return{windowWitdh:e,windowHeight:a}}),o=t(null);return l(()=>{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}const ta=({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:h},floatingElementCSSPosition:b}=Je({isActive:l,onOverlayUpdate:d,autoHideMs:m,floatingElementOffset:s,interactions:i,placement:n}),E=a.createElement(z,null,l&&a.createElement(R.div,{ref:g,style:b,...c,...v()},r()));return a.createElement(a.Fragment,null,a.createElement("div",{ref:h,className:x("maxio-inline-flex",u),...p(),"data-testid":"overlay-trigger"},e),t?a.createElement(j,{id:"maxio-ui-portal"},E):E)},la=({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)),na={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:u,usePortal:v,className:x,onVisibilityUpdate:g,floatingElementOffset:h=5})=>{const[b,E]=n(!1),f=void 0!==u,_=t(null),N=p(e=>{_.current&&clearTimeout(_.current),_.current=window.setTimeout(()=>{f||E(e),g&&g(e)},50)},[f,g]),w=d(()=>(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(ta,{role:"tooltip",className:x,floatingElementOffset:h,motionSettings:w,isActive:f?u:b,onOverlayUpdate:N,autoHideMs:m,usePortal:v,placement:o,interactions:i,renderOverlay:()=>a.createElement(la,{size:s,arrowPosition:na[o],maxWidth:r},c())},e)},oa=r({}),ra=({indent:e=!1,disabled:l=!1,invalid:n=!1,label:i,...o})=>{const r=t(null),s=c(oa),{inputProps:m,isDisabled:d}=N({...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",...m,name:s.name||m.name}),a.createElement("span",{className:"maxio-radio__control"}),a.createElement("span",{className:"maxio-radio__label"},i))},sa=({children:e,label:t,errorMessage:l,helperText:n,disabled:i=!1,invalid:o=!1,name:r,defaultValue:s,...c})=>{const m=q({isDisabled:i,isInvalid:o,description:n,name:r,label:t,errorMessage:l,defaultValue:s,...c}),{radioGroupProps:d,labelProps:u,descriptionProps:p,errorMessageProps:v}=w({"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(oa.Provider,{value:m},e),o&&l&&a.createElement(Fe,{...v},l),n&&!o&&a.createElement(We,{...p},n)))},ca=u(({disabled:e=!1,invalid:l=!1,readOnly:n=!1,size:i="md",label:o,helperText:r,showErrorMessage:s=!0,errorMessage:c,leadingElement:m=null,trailingElement:d=null,fullWidth:u,className:p,...g},h)=>{var b,E;const f=t(null);v(h,()=>f.current);const{spellCheck:_,...N}=g,w={...N,label:o,description:r,errorMessage:c,defaultValue:null===(b=g.defaultValue)||void 0===b?void 0:b.toString(),value:null===(E=g.value)||void 0===E?void 0:E.toString(),isDisabled:e,isReadOnly:n,isInvalid:l},{labelProps:k,inputProps:C,descriptionProps:I,errorMessageProps:P}=y(w,f),S=x("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":l,"maxio-text-field--readonly":n,"maxio-text-field--full-width":u},p),$=l&&c&&s;return a.createElement("div",{className:S},o&&a.createElement("label",{className:"maxio-text-field__label",...k},o),a.createElement("div",{className:"maxio-text-field__items"},m&&a.createElement("div",{className:"maxio-text-field__leading-element"},m),a.createElement("input",{ref:f,type:"text",className:"maxio-text-field__input",...C,spellCheck:_}),d&&a.createElement("div",{className:"maxio-text-field__trailing-element"},d)),r&&!$&&a.createElement("div",{className:"maxio-form-helper-text",...I},r),$&&a.createElement(Fe,{...P},c))});ca.displayName="TextInput";const ma=({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=g();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(re,{variant:"chevron-up-down"})),!!r&&a.createElement(Fe,null,r),o&&!r&&a.createElement("div",{className:"maxio-form-helper-text"},o))},da=({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,x]=n(r.toString());l(()=>{x(m.toString())},[m]);const g=Math.ceil(i/u),h=m<g,b=m>1,E=u*(m-1)+1,f=Math.min(u*m,i),_=s.map(e=>({label:e.toString(),value:e.toString()})),N=Array.from({length:g},(e,a)=>a+1).map(e=>({label:e.toString(),value:e.toString()})),w=e=>{d(e),null==t||t({currentPage:e,itemsPerPage:u})},y=e=>{const a=parseInt(e,10);if(isNaN(a))return void x(m.toString());const t=Math.max(1,Math.min(a,g));x(t.toString()),w(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(ma,{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,E,"–",f," of ",i," items")),a.createElement("div",{className:"maxio-pagination__current-page"},c?a.createElement(ca,{className:"maxio-pagination__page-input",value:v,min:1,max:g,onChange:e=>(e=>{x(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(ma,{inline:!0,size:e,"aria-label":"Select page",onChange:e=>w(Number(e.target.value)),value:m,options:N,id:"page-index-large"}),a.createElement("div",{className:"maxio-pagination__label"},"of ",g," pages")),a.createElement("div",{className:"maxio-pagination__controls"},a.createElement(ia,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(ge,{icon:a.createElement(re,{variant:"chevron-left"}),size:e,variant:"ghost",onClick:()=>w(m-1),"aria-label":"Previous",disabled:!b})),a.createElement(ia,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(ge,{icon:a.createElement(re,{variant:"chevron-right"}),size:e,variant:"ghost",onClick:()=>w(m+1),"aria-label":"Next",disabled:!h}))))},ua=({className:e,hideArrow:t=!1,children:l,...n})=>a.createElement(U,{...n,className:x("maxio-popover",e)},a.createElement(a.Fragment,null,!t&&a.createElement(G,{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)),pa=({label:e,helperText:t,size:l="md",variant:n="default",status:i,value:o,maxValue:r=100})=>{const s=g(),c=g(),m=i&&!!e&&!!o&&!("inline"===n),d=t&&!("inline"===n),u=t&&"inline"===n,{progressBarProps:p,labelProps:v}=k({maxValue:r,value:o,label:e}),h=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:h,...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))},va=({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(re,{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(re,{variant:t}))),xa=e=>"heading"!==e.type,ga=e=>{const a=(e=>e.flat().filter(xa).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 xa(e)&&(null===(t=e.items)||void 0===t?void 0:t.includes(a))?{...e,isOpen:!0}:e})):e},ha=r({}),ba=()=>c(ha),Ea=({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)),[x,g]=n(()=>ga(s)),{windowWitdh:h}=aa(200);l(()=>{u.current&&(null==o||o(p))},[p,o]),l(()=>{u.current=!0},[]),l(()=>{!function(e){if(!c)return;e<d&&p&&b()}(h)},[h]),l(()=>{"boolean"==typeof i&&v(i)},[i]);const b=()=>{v(!1)};return a.createElement(ha.Provider,{value:{sections:x,topDropdownItems:m,onSectionOpen:e=>{g(a=>a.map(a=>a.map(a=>xa(a)?{...a,isOpen:(null==a?void 0:a.name)===e&&!a.isOpen}:a)))},isOpen:p,onOpen:()=>{v(!0)},onClose:b,withIcons:r,shouldToggleSidebar:c}},e)},fa=()=>{const{onOpen:e,topDropdownItems:l,isOpen:n}=ba(),{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:u,itemsCount:p}=d(()=>({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(va,{type:"menu",isTooltipVisible:!n&&c,leadingIcon:i.icon,trailingIcon:"chevron-up-down",leadingIconClassName:i.iconClass},i.title)):a.createElement(va,{type:"menu",trailingIcon:"chevron-up-down"},i.title)),a.createElement(me,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:u,small:!0})))},_a=({section:e})=>{const{isOpen:l,withIcons:n}=ba(),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(va,{isTooltipVisible:o&&!l,type:"menu",leadingIcon:n?e.icon:void 0},e.name)))},Na=({section:e})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=ba(),c=t(null),m=ea(c);if(!xa(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(_a,{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(va,{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))))))},wa=()=>{const{sections:e}=ba();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(Na,{key:`section-list-item-${e.type}-${t}-${l}`,section:e})))))},ya=()=>{const{onClose:e,shouldToggleSidebar:t}=ba();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(re,{variant:"sidebar"})))},ka=()=>{const{isOpen:e}=ba();return a.createElement("nav",{className:x("maxio-side-nav",{"maxio-side-nav--collapsed":!e})},a.createElement(ya,null),a.createElement(fa,null),a.createElement("div",{className:"maxio-side-nav__items-container"},a.createElement(wa,null)))},Ca=({withIcons:e=!0,shouldToggleSidebar:t=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>a.createElement(Ea,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:e,shouldToggleSidebar:t,topDropdownItems:l,sections:n},a.createElement(ka,null)),Ia=r({}),Pa=()=>c(Ia),Sa=({children:e,variant:t="line",withDivider:i=!1,defaultIndex:o=0,onChange:r,index:s})=>{const[c,m]=n(()=>void 0!==s?s:o);l(()=>{void 0===s&&m(o),"number"==typeof s&&m(s)},[o,s]);return a.createElement(Ia.Provider,{value:{currentIndex:c,variant:t,withDivider:i,onChange:e=>{let a;a="function"==typeof e?e(c):e,void 0===s&&m(a),"function"==typeof r&&r(a)}}},e)},$a=({disabled:e=!1,value:n=0,isCurrent:i,...o})=>{const{onChange:r,currentIndex:s}=Pa(),c=x("maxio-tabs__tab",{"maxio-tabs__tab--active":s===n,"maxio-tabs__tab--disabled":e,"maxio-tabs__tab--icon":"icon"===o.type}),m=()=>{r(n)},d={"aria-selected":i,id:`tab-${n}`,"aria-controls":`panel-${n}`,role:"tab",tabIndex:i?0:-1},u=t(null),p=t(!1);if(l(()=>{var e;i&&p.current&&(null===(e=u.current)||void 0===e||e.focus())},[i]),l(()=>{p.current=!0},[]),"icon"===o.type){const{icon:e,...t}=o;return a.createElement("div",{className:c,ref:u,onClick:m,...d,...t},a.createElement("div",{className:"maxio-tabs__tab__content"},e))}const{children:v,rightIcon:g,...h}=o;return a.createElement("div",{ref:u,className:c,onClick:m,...d,...h},a.createElement("div",{className:"maxio-tabs__tab__content"},v,g||null))},Da=({children:e,variant:t="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>a.createElement(Sa,{defaultIndex:n,variant:t,withDivider:l,index:i,onChange:o},e),Ta=({children:e,value:t,...l})=>{const{currentIndex:n}=Pa();return a.createElement("div",{...l,...t?{id:`panel-${t}`}:{},role:"tabpanel","aria-labelledby":`tab-${t}`,hidden:n!==t},e)},Oa=({children:e})=>{const{currentIndex:t}=Pa();return a.createElement(a.Fragment,null,m.map(e,(e,a)=>{if(o(e)&&e.type===Ta)return a===t?i(e,{value:a}):null;throw new Error("You can only pass <TabPanel /> component as children")}))},za=(e,a,t)=>0===e?e:1===e&&a[e-1].disabled?t||e:a[e-1].disabled?za(e-1,a,t||e):e-1,Ra=({children:e,className:l,ariaLabel:n,...r})=>{const{variant:s,withDivider:c,currentIndex:d,onChange:u}=Pa(),p=x("maxio-tabs",l,{"maxio-tabs--contained":"contained"===s,"maxio-tabs--divider":c}),v=t(null),g=()=>m.map(e,e=>e.props);return a.createElement("div",{className:p,role:"tablist","aria-label":n,"aria-orientation":"horizontal",ref:v,onKeyDown:e=>{var a;"ArrowRight"===e.key&&u(e=>((e,a)=>{const t=a.findIndex((a,t)=>!a.disabled&&t>e);return-1===t?e:t})(e,g())),"ArrowLeft"===e.key&&u(e=>za(e,g())),null===(a=v.current)||void 0===a||a.focus()},...r},m.map(e,(e,a)=>{if(o(e)&&e.type===$a)return i(e,{value:a,isCurrent:d===a});throw new Error("You can only pass <Tab /> component as children")}))},Ma=({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(re,{variant:i,className:"maxio-tag__icon"}),a.createElement("span",{className:"maxio-tag__label"},e),o&&a.createElement(re,{variant:o,className:"maxio-tag__icon"}))},La=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__header",t),...l},e);La.displayName="Card.Header";const Va=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__body",t),...l},e);Va.displayName="Card.Body";const Ha=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__footer",t),...l},e);Ha.displayName="Card.Footer";const Aa=({children:e,className:t,variant:l="primary",...n})=>a.createElement("div",{className:x("maxio-card",`maxio-card--${l}`,t),...n},e);Aa.displayName="Card";const Ba=Object.assign(Aa,{Header:La,Body:Va,Footer:Ha}),Wa=({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 Fa,ja,qa,Ua;function Ga(){return Ga=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},Ga.apply(null,arguments)}const Ya=a=>e.createElement("svg",Ga({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},a),Fa||(Fa=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"})),ja||(ja=e.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),qa||(qa=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"})),Ua||(Ua=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"}))),Za=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(Ya,{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)})},Ka=({state:e,...l})=>{var n,i;const o=t(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:m}=te(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(re,{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(de,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),d&&a.createElement(ge,{variant:"ghost",icon:a.createElement(re,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...m}))},Xa=({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(Ka,{key:t.key,toast:t,state:e})))},Qa=({children:e,...t})=>{const{maxVisibleToasts:l=5,...n}=t,i=J({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(Xa,{...t,state:i}))},Ja=r(null),et=({children:e,toastQueue:t,...l})=>{const n=ee(t),i=p(()=>{n.visibleToasts.forEach(e=>{t.close(e.key)})},[n.visibleToasts,t]),o=d(()=>({addToast:t.add.bind(t),removeToast:t.clear.bind(t),removeAllToasts:i,state:n}),[t,i,n]);return a.createElement(Ja.Provider,{value:o},e,n.visibleToasts.length>0&&a.createElement(Xa,{...l,state:n}))},at=()=>{const e=c(Ja);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 tt extends ae{}const lt=({defaultChecked:e,checked:t,onChange:l,disabled:n,valueDescription:i,valueDescriptionPosition:o,className:r,name:c,id:m,...d})=>{const u=s(),v="boolean"==typeof e,g=m||u,h="left"===o?"row":"row-reverse",b=i&&o,E=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]),f=d["aria-label"]||(b?void 0:i);return a.createElement("div",{className:x("maxio-toggle",r,{"maxio-toggle--disabled":n}),style:{display:"inline-flex",flexDirection:h},"data-testid":"toggle-container"},b?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:E,disabled:n,className:"maxio-toggle__checkbox",id:g,name:c,"aria-label":f}),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"})))))},nt=({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)},it=({children:e,actions:t,sideNavIsClosed:l,openSideNav:n})=>a.createElement("nav",{className:"maxio-top-bar"},l&&a.createElement(ge,{"aria-label":"Open Side Navigation",variant:"ghost",icon:a.createElement(re,{variant:"sidebar"}),onClick:n}),a.createElement(nt,{grow:!0,justifyContent:"end"},e),t),ot=({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)},rt={sm:"h3",md:"h2",lg:"h1"},st=({children:e,size:t="sm",className:l,...n})=>{const i=rt[t],o=x(`maxio-heading-${t}`,l);return a.createElement(i,{className:o,...n},e)},ct=({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)},mt=({as:e="div",children:t,className:l,...n})=>{const i=e,o=x("maxio-code",l);return a.createElement(i,{className:o,...n},t)},dt=({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)},ut=({...e})=>{const l=t(null),{buttonProps:n}=b(e,l);return a.createElement("button",{...n,className:"maxio-chip__dismiss-button"},a.createElement(re,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},pt=({label:e,onDismiss:l,dismissLabel:n,leadingIcon:i,trailingIcon:o,title:r,...s})=>{const c=t(null),m=T(s),{buttonProps:d}=C(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(re,{variant:i,className:"maxio-chip__icon"}),a.createElement("span",{className:"maxio-chip__label"},e),o&&!l&&a.createElement(re,{variant:o,className:"maxio-chip__icon"})),l&&a.createElement(ut,{onPress:l,"aria-label":n}))},vt=({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:h,justifyContent:b,alignItems:E,...f})=>{const _=x(h,{"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-${b}`]:b,[`maxio-items-${E}`]:E});return a.createElement("div",{className:_||void 0,...f},e)},xt=({className:e,...t})=>a.createElement(Y,{...t,className:x("maxio-listbox",e)});xt.displayName="ListBox";const gt=({className:e,...t})=>{const l=t.textValue||("string"==typeof t.children?t.children:void 0);return a.createElement(Z,{...t,textValue:l,className:x("maxio-listbox__item",e)},K(t.children,(e,{isSelected:t})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-listbox__content"},"string"==typeof e?a.createElement(ot,{size:"sm"},e):e),t&&a.createElement(re,{variant:"check"}))))};gt.displayName="ListBox.Item";const ht=({className:e,...t})=>a.createElement(X,{...t,className:x("maxio-listbox__section",e)});ht.displayName="ListBox.Section";const bt=({className:e,...t})=>a.createElement(Q,{...t,className:x("maxio-listbox__header",e)});bt.displayName="ListBox.Header";const Et=Object.assign(xt,{Item:gt,Section:ht,Header:bt}),ft={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"},_t=({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("div",{className:"maxio-auth-layout__header"}),a.createElement("div",{className:"maxio-auth-layout__main"},o&&a.createElement(he,{display:"block",title:o.title,sentiment:o.sentiment},o.children),a.createElement("div",{className:"maxio-auth-layout__content-wrapper"},r,a.createElement("div",{className:"maxio-auth-layout__content"},a.createElement(nt,{flexDirection:"col",gap:2},a.createElement(nt,{alignItems:"center",gap:2},i,a.createElement(st,{size:"lg",className:x("maxio-auth-layout__heading",ft[n])},t)),l&&a.createElement(ot,{size:"sm",className:"maxio-auth-layout__description"},l)),e))),a.createElement(nt,{alignItems:"center",className:"maxio-auth-layout__footer"},s),a.createElement("div",{className:"maxio-auth-layout__border-top"}),a.createElement("div",{className:"maxio-auth-layout__border-bottom"}),a.createElement("div",{className:"maxio-auth-layout__border-left"}),a.createElement("div",{className:"maxio-auth-layout__border-right"}),a.createElement("div",{className:"maxio-auth-layout__gradient-bottom"}),a.createElement("div",{className:"maxio-auth-layout__gradient-top"}));export{me as ActionList,he as Alert,_t as AuthLayout,ke as Avatar,Ce as Banner,ot as Body,De as Breadcrumbs,Ie as BreadcrumbsItem,xe as Button,Ba as Card,Be as Checkbox,je as CheckboxGroup,pt as Chip,mt as Code,Ke as DataTable,ct as Display,nt as Flex,Fe as FormErrorMessage,We as FormHelperText,et as GlobalToastProvider,vt as Grid,st as Heading,re as Icon,ge as IconButton,dt as Label,de as Link,Et as ListBox,ue as LoadingSpinner,Za as Logo,Ne as Menu,ye as MenuButton,we as MenuList,ta as OverlayTrigger,da as Pagination,ua as Popover,pa as ProgressBar,ra as Radio,sa as RadioGroup,ma as Select,Ca as SideNav,$a as Tab,Ra as TabList,Ta as TabPanel,Oa as TabPanels,Da as Tabs,Ma as Tag,ca as TextInput,Wa as Tile,Qa as ToastProvider,tt as ToastQueue,lt as Toggle,la as Tooltip,ia as TooltipTrigger,it as TopBar,ea as useHover,Je as useOverlayTrigger,at as useToast,aa as useWindowSize};
1
+ import*as e from"react";import a,{useRef as t,useEffect as l,useState as n,cloneElement as i,isValidElement as o,createContext as r,useId as s,useContext as c,Children as m,useMemo as d,forwardRef as u,useCallback as p,useImperativeHandle as v}from"react";import x from"classnames";import{useId as g,useLink as b,useButton as h,useCheckboxGroupItem as E,useCheckbox as f,useCheckboxGroup as _,useRadio as N,useRadioGroup as w,useTextField as y,useProgressBar as k,useToggleButton as C}from"react-aria";import{flexRender as I,useReactTable as P,getSortedRowModel as S,getExpandedRowModel as $,getCoreRowModel as D}from"@tanstack/react-table";export{createColumnHelper}from"@tanstack/react-table";import{useToggleState as T}from"@react-stately/toggle";import{useCheckboxGroupState as z}from"@react-stately/checkbox";import{AnimatePresence as O,motion as R}from"framer-motion";import{useDismiss as M,useFocus as L,useHover as V,useClick as B,useFloating as H,offset as A,useInteractions as W,useRole as F,FloatingPortal as j}from"@floating-ui/react-dom-interactions";import{useRadioGroupState as q}from"@react-stately/radio";import{Popover as U,OverlayArrow as G,ListBox as Y,ListBoxItem as Z,composeRenderProps as K,ListBoxSection as X,Header as Q}from"react-aria-components";export{DialogTrigger,Pressable}from"react-aria-components";import{useToastState as J,useToastQueue as ee,ToastQueue as ae}from"@react-stately/toast";import{useToast as te,useToastRegion as le}from"@react-aria/toast";const ne=["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","dropbox","hubspot","sage","oracle","quotapath","avalara","pipedrive","quickbooks","salesforce","xero"],ie=["dropbox","hubspot","sage","oracle","quotapath"],oe=["avalara","pipedrive","quickbooks","salesforce","xero"],re=({variant:e,color:t,className:l,size:n})=>{const i=(e,a)=>a.includes(e),o=i(e,ne)||i(e,ie),r=i(e,oe),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,ie)&&!i(e,oe)},l);return a.createElement("i",{className:s})},se=({item:e,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=t(null),c=t(!1),m=g();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:b,link:h}=e,E=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(re,{variant:d,className:x("maxio-action-list__leading-icon",u)}),a.createElement("span",{className:E,id:m},v),b&&a.createElement("span",{className:"maxio-action-list__description"},b),p&&a.createElement(re,{variant:p,className:"maxio-action-list__trailing-icon"}))},ce=(e,a,t)=>0===e?e:1===e&&"divider"===a[e-1].type?t||e:"divider"===a[e-1].type?ce(e-1,a,t||e):e-1,me=({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=>ce(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(se,{item:e,truncateLabel:o,key:`listbox-${e.id}`,isSelected:t===m,small:r,...l})))},de=({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(re,{variant:i,className:"maxio-link__icon"}))},ue=({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"})},pe=({fullWidth:e=!1,leadingElement:l,trailingElement:n,icon:r,variant:s="primary",size:c,...m})=>{const d=t(null),{linkProps:u}=b({...m},d),p=x("maxio-button",m.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":e});return a.createElement("a",{...u,ref:d,className:p,href:m.href},l&&i(l,{...o(l)&&{className:"maxio-button__leading-element"}}),m.children,(n||r)&&i(n||r,{...o(n||r)&&{className:"maxio-button__trailing-element"}}))},ve=({disabled:e,loading:l=!1,fullWidth:n=!1,leadingElement:r,trailingElement:s,icon:c,variant:m="primary",size:d,...u})=>{const p=t(null),{buttonProps:v}=h({...u,isDisabled:e,formAction:"string"==typeof u.formAction?u.formAction:void 0},p),g=["primary","danger"].includes(m),b=x("maxio-button",u.className,{[`maxio-button--${d}`]:d,[`maxio-button--${m}`]:m,"maxio-button--loading":l,"maxio-button--full-width":n});return a.createElement("button",{...v,className:b,ref:p},r&&i(r,{...o(r)&&{className:"maxio-button__leading-element"}}),u.children,!l&&(s||c)&&i(s||c,{...o(s||c)&&{className:"maxio-button__trailing-element"}}),l&&a.createElement(ue,{className:"maxio-button__trailing-element",size:"md",white:g}))},xe=e=>(e=>"href"in e)(e)?a.createElement(pe,{...e}):a.createElement(ve,{...e}),ge=({"aria-label":e,className:t,...l})=>a.createElement(xe,{"aria-label":e,className:x("maxio-button--icon",t),...l},null),be=({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(re,{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(de,{className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(ge,{icon:a.createElement(re,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-alert__dismiss"}))},he=r({}),Ee=({children:e})=>{const[t,l]=n(!1),i=s(),o=s();return a.createElement(he.Provider,{value:{controlsId:i,buttonId:o,isOpen:t,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},e)};function fe(){const e=c(he);if(!e||"object"==typeof e&&0===Object.keys(e).length)throw new Error("useMenu hook must be used within a MenuProvider");return e}const _e=({children:e})=>{const{isOpen:t,onToggle:l,onClose:n}=fe();return a.createElement("details",{open:t,onToggle:l,className:"maxio-action-menu"},"function"==typeof e?e({isOpen:t,onClose:n}):e)},Ne=({children:e})=>a.createElement(Ee,null,a.createElement(_e,null,e)),we=({items:e,alignItemsEnd:t=!1})=>{const l=x("maxio-action-menu__content",{"maxio-action-menu__content--align-end":t}),{controlsId:n,buttonId:i}=fe();return a.createElement("div",{className:l,role:"presentation"},a.createElement(me,{role:"menu",itemProps:{role:"menuitem"},id:n,"aria-labelledby":i,items:e}))},ye=({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}=fe();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(re,{variant:t,className:`${o} maxio-button__trailing-element`}))},ke=({className:e,src:t,alt:l="avatar"})=>a.createElement("img",{className:x("maxio-avatar",e),alt:l,src:t}),Ce=({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(re,{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(de,{href:i,..."warning"!==r&&{variant:"inverse"},underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(ge,{icon:a.createElement(re,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-banner__dismiss"}))},Ie=({children:e,className:t,href:l,...n})=>{const i=l?a.createElement(de,{size:"sm",href:l},e):e;return a.createElement("li",{className:x("maxio-breadcrumbs__item",t),...n},i)},Pe="Breadcrumbs requires at least one BreadcrumbsItem as children",Se='Last BreadcrumbsItem should not have "href" prop. It is the current page.',$e="Breadcrumbs only accepts BreadcrumbsItem as children",De=({className:e,children:t,...l})=>{const n=m.count(t);if(0===n)throw new Error(Pe);const r=m.map(t,(e,a)=>{if(o(e)&&e.type===Ie){if(a===n-1&&e.props.href)throw new Error(Se);return i(e,{"aria-current":a===n-1?"page":void 0})}throw new Error($e)});return a.createElement("nav",{"aria-label":"Breadcrumb",...l},a.createElement("ol",{className:x("maxio-breadcrumbs",e)},r))},Te="row-controls",ze="row-actions",Oe=({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))},Re=({children:e})=>a.createElement("thead",null,e),Me=({children:e})=>a.createElement("tbody",null,e),Le=({children:e,table:t,header:l,className:n,enableExpanding:i,...o})=>{var r,s,c,m,d,u,p,v,g,b,h;const E=null==l?void 0:l.column,f=null===(r=null==E?void 0:E.getCanSort)||void 0===r?void 0:r.call(E),_=null===(s=null==E?void 0:E.getToggleSortingHandler)||void 0===s?void 0:s.call(E),N=null==l?void 0:l.isPlaceholder,w=null===(m=null===(c=null==E?void 0:E.columnDef)||void 0===c?void 0:c.meta)||void 0===m?void 0:m.align,y=null===(u=null===(d=null==E?void 0:E.columnDef)||void 0===d?void 0:d.meta)||void 0===u?void 0:u.width,k=null===(v=null===(p=null==E?void 0:E.columnDef)||void 0===p?void 0:p.meta)||void 0===v?void 0:v.controls,C=null===(b=null===(g=null==E?void 0:E.columnDef)||void 0===g?void 0:g.meta)||void 0===b?void 0:b.actions,I=null==E?void 0:E.getIsPinned(),P=null==E?void 0:E.getIsSorted(),S="asc"===P,$=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${I}`]:I,"maxio-data-table__cell--sortable":f,"maxio-data-table__cell--active":P,[`maxio-data-table__cell--${w}`]:w,"maxio-data-table__cell--controls":k,"maxio-data-table__cell--actions":C}),D=y?{width:y}:{},T=((e,a)=>e&&a?"arrow-up":e&&!a?"arrow-down":"arrow-down-up")(!!P,S),z=null==t?void 0:t.getToggleAllRowsExpandedHandler(),O=null===(h=null==t?void 0:t.getIsAllRowsExpanded)||void 0===h?void 0:h.call(t),R=(null==l?void 0:l.headerGroup.headers[0].id)===Te?1:0,M=i&&(null==l?void 0:l.index)===R;return N?null:a.createElement("th",{scope:"col",role:"columnheader","aria-sort":P?S?"ascending":"descending":"none",className:$,onClick:_,colSpan:null==l?void 0:l.colSpan,style:D,...o},a.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&M&&a.createElement(ge,{size:"sm",variant:"ghost",icon:a.createElement(re,{size:"xs",variant:O?"chevron-down":"chevron-right"}),onClick:z,"aria-label":O?"Collapse all rows":"Expand all rows","data-open":O,className:"maxio-data-table__expand-button"}),e,f&&a.createElement(re,{variant:T,className:"maxio-data-table__sort-icon"})))},Ve=({children:e,row:t,isChild:l,isHeader:n,className:i})=>{var o,r,s;const c=null===(o=null==t?void 0:t.getIsSelected)||void 0===o?void 0:o.call(t),m=(null===(r=null==t?void 0:t.getCanExpand)||void 0===r?void 0:r.call(t))&&(null===(s=null==t?void 0:t.getIsExpanded)||void 0===s?void 0:s.call(t)),d=x({"maxio-data-table__row":!n,"maxio-data-table__header-row":n,"maxio-data-table__row--active":c,"maxio-data-table__row--expanded":m,"maxio-data-table__row--expanded-child":l},i);return a.createElement("tr",{className:d},e)},Be=r({}),He=u(({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))});He.displayName="InnerCheckbox";const Ae=({label:e,error:l=!1,className:n,indeterminate:i,value:o="",disabled:r,readOnly:s,defaultChecked:m,checked:d,...u})=>{const p=t(null),v=c(Be),{inputProps:x,isDisabled:g,isInvalid:b,isSelected:h}=v&&Object.keys(v).length>0?E({value:o,"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,...u},v,p):f({"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,value:o,...u},T({...u,isSelected:d,defaultSelected:m}),p);return a.createElement(He,{inputProps:x,checked:h,disabled:g,invalid:b,indeterminate:i,className:n,error:l,label:e,ref:p,...u})},We=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-helper-text",t),...l},e),Fe=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-error",t),...l},a.createElement(re,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},e)),je=({helperText:e,className:t,errorMessage:l,children:n,disabled:i,label:o,defaultValue:r,name:s,...c})=>{var m;const d=z({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}=_({"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),E=e&&!l;return a.createElement("div",{className:h,...u},o&&a.createElement("label",{className:"maxio-checkbox-group__label",...p},o),a.createElement(Be.Provider,{value:d},n),E&&a.createElement(We,{...v},e),l&&b&&a.createElement(Fe,{...g},l))},qe=({table:e})=>{var t,l,n,i;const o=null===(t=null==e?void 0:e.getToggleAllPageRowsSelectedHandler)||void 0===t?void 0:t.call(e),r=(null===(l=null==e?void 0:e.getIsAllPageRowsSelected)||void 0===l?void 0:l.call(e))||(null===(n=null==e?void 0:e.getIsAllRowsSelected)||void 0===n?void 0:n.call(e)),s=null===(i=null==e?void 0:e.getIsSomePageRowsSelected)||void 0===i?void 0:i.call(e);return a.createElement(Ae,{"aria-label":"Select all rows",onChange:e=>{o("boolean"==typeof e?{target:{checked:e}}:e)},checked:r,indeterminate:!r&&s})},Ue=({row:e})=>{var t,l,n,i;const o=null===(t=null==e?void 0:e.getToggleSelectedHandler)||void 0===t?void 0:t.call(e),r=(null===(l=null==e?void 0:e.getIsSelected)||void 0===l?void 0:l.call(e))||(null===(n=null==e?void 0:e.getIsAllSubRowsSelected)||void 0===n?void 0:n.call(e)),s=null===(i=null==e?void 0:e.getIsSomeSelected)||void 0===i?void 0:i.call(e),c=e.id||e.index;return a.createElement(Ae,{"aria-label":`Select row ${c}`,onChange:o,checked:r,indeterminate:s})},Ge=({children:e})=>a.createElement("div",{className:"maxio-data-table__cell-flex"},e),Ye=({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});return a.createElement("td",{className:h,...i},l)},Ze=({row:e,SubRowComponent:t,pattern:l,enableExpanding:n})=>{var i,o,r,s,c;const m=t&&e.getParentRow()&&e.getParentRow().getIsExpanded(),d=m&&e.getVisibleCells()[0].column.columnDef.id===Te,u=m&&e.getVisibleCells()[e.getVisibleCells().length-1].column.columnDef.id===ze,p=[u,d].filter(Boolean).length,v=e.getVisibleCells().length-p,x=null!==(o=null===(i=e.getParentRow())||void 0===i?void 0:i.index)&&void 0!==o?o:e.index,g=l&&t&&x%2==1?"maxio-data-table__row--with-pattern":void 0,b=null===(r=e.getCanExpand)||void 0===r?void 0:r.call(e),h=null===(s=null==e?void 0:e.getToggleExpandedHandler)||void 0===s?void 0:s.call(e),E=null===(c=null==e?void 0:e.getIsExpanded)||void 0===c?void 0:c.call(e),f=b&&n?0:1.75,_=e.getVisibleCells()[0].column.columnDef.id===Te?1:0;return a.createElement(a.Fragment,{key:e.id},m?a.createElement(Ve,{key:`${e.id}-sub`,row:e,isChild:!0,className:g},d&&a.createElement(Ye,{className:"maxio-data-table__cell--pinned-left"}),a.createElement(Ye,{colSpan:v},t(e)),u&&a.createElement(Ye,{className:"maxio-data-table__cell--pinned-right"})):a.createElement(Ve,{key:`${e.id}-parent`,row:e,className:g},e.getVisibleCells().map(t=>{const l=n&&t.column.getIndex()===_;return a.createElement(Ye,{key:t.id,row:e,cell:t},a.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${(null==e?void 0:e.depth)+f}rem`}:void 0},n&&b&&l&&a.createElement(ge,{size:"sm",variant:"ghost",icon:a.createElement(re,{size:"xs",variant:E?"chevron-down":"chevron-right"}),onClick:h,"aria-label":E?"Collapse row":"Expand row","data-open":E,className:"maxio-data-table__expand-button"}),I(t.column.columnDef.cell,t.getContext())))})))},Ke=({pattern:e,size:t="md",SubRowComponent:n,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:m,columns:u,actions:p,...v})=>{const x=(({columns:e,HeaderControls:t,RowControls:l,RowActions:n,actions:i,enableExpanding:o,enableRowSelection:r})=>d(()=>{const s={id:Te,header:e=>a.createElement(t,{...e,enableExpanding:o,enableRowSelection:r}),cell:e=>a.createElement(l,{...e,enableExpanding:o}),meta:{controls:!0}},c=i&&n?{id:ze,header:"",cell:e=>a.createElement(n,{...e},i(e.row,e.table)),meta:{actions:!0}}:null;let m=[...e];return r&&(m=[s,...m]),c&&(m=[...m,c]),m},[i,n,o,r,e,t,l]))({columns:u,HeaderControls:qe,RowControls:Ue,RowActions:Ge,actions:p,enableRowSelection:c,enableExpanding:Boolean(m)}),g=P({state:{columnPinning:{left:["row-controls"],right:["row-actions"]},...v.state},getSubRows:e=>e.subRows,getCoreRowModel:D(),enableRowSelection:c,enableExpanding:Boolean(m),...!v.manualExpanding&&{getExpandedRowModel:$()},enableSorting:s,...!v.manualSorting&&{getSortedRowModel:S()},columns:x,...v}),b=g.getCanSomeRowsExpand(),h=g.getState();return l(()=>{null==i||i(h.expanded)},[i,h.expanded]),l(()=>{null==o||o(h.rowSelection)},[o,h.rowSelection]),l(()=>{null==r||r(h.sorting)},[r,h.sorting]),a.createElement(Oe,{pattern:e,size:t,isExpandable:b,isUsingCustomRow:!!n},a.createElement(Re,null,g.getHeaderGroups().map(e=>a.createElement(Ve,{key:e.id,table:g,isHeader:!0},e.headers.map(e=>a.createElement(Le,{key:e.id,table:g,header:e,enableExpanding:m},I(e.column.columnDef.header,e.getContext())))))),a.createElement(Me,null,g.getRowModel().rows.map(t=>a.createElement(Ze,{key:t.id,row:t,pattern:e,SubRowComponent:n,enableExpanding:m}))))},Xe={click:B,hover:e=>V(e,{delay:100}),focus:L,dismiss:M},Qe=(e,a)=>a.map(a=>Xe[a](e)),Je=({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}=H({placement:e,open:a,onOpenChange:e=>o(e),middleware:[A(i)]}),{getReferenceProps:x,getFloatingProps:g}=W([...Qe(u,n),F(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:x,getFloatingProps:g}};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 aa(e=500){const[a,i]=n(()=>{const{innerWidth:e,innerHeight:a}=window;return{windowWitdh:e,windowHeight:a}}),o=t(null);return l(()=>{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}const ta=({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}=Je({isActive:l,onOverlayUpdate:d,autoHideMs:m,floatingElementOffset:s,interactions:i,placement:n}),E=a.createElement(O,null,l&&a.createElement(R.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(j,{id:"maxio-ui-portal"},E):E)},la=({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)),na={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:u,usePortal:v,className:x,onVisibilityUpdate:g,floatingElementOffset:b=5})=>{const[h,E]=n(!1),f=void 0!==u,_=t(null),N=p(e=>{_.current&&clearTimeout(_.current),_.current=window.setTimeout(()=>{f||E(e),g&&g(e)},50)},[f,g]),w=d(()=>(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(ta,{role:"tooltip",className:x,floatingElementOffset:b,motionSettings:w,isActive:f?u:h,onOverlayUpdate:N,autoHideMs:m,usePortal:v,placement:o,interactions:i,renderOverlay:()=>a.createElement(la,{size:s,arrowPosition:na[o],maxWidth:r},c())},e)},oa=r({}),ra=({indent:e=!1,disabled:l=!1,invalid:n=!1,label:i,...o})=>{const r=t(null),s=c(oa),{inputProps:m,isDisabled:d}=N({...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",...m,name:s.name||m.name}),a.createElement("span",{className:"maxio-radio__control"}),a.createElement("span",{className:"maxio-radio__label"},i))},sa=({children:e,label:t,errorMessage:l,helperText:n,disabled:i=!1,invalid:o=!1,name:r,defaultValue:s,...c})=>{const m=q({isDisabled:i,isInvalid:o,description:n,name:r,label:t,errorMessage:l,defaultValue:s,...c}),{radioGroupProps:d,labelProps:u,descriptionProps:p,errorMessageProps:v}=w({"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(oa.Provider,{value:m},e),o&&l&&a.createElement(Fe,{...v},l),n&&!o&&a.createElement(We,{...p},n)))},ca=u(({disabled:e=!1,invalid:l=!1,readOnly:n=!1,size:i="md",label:o,helperText:r,showErrorMessage:s=!0,errorMessage:c,leadingElement:m=null,trailingElement:d=null,fullWidth:u,className:p,...g},b)=>{var h,E;const f=t(null);v(b,()=>f.current);const{spellCheck:_,...N}=g,w={...N,label:o,description:r,errorMessage:c,defaultValue:null===(h=g.defaultValue)||void 0===h?void 0:h.toString(),value:null===(E=g.value)||void 0===E?void 0:E.toString(),isDisabled:e,isReadOnly:n,isInvalid:l},{labelProps:k,inputProps:C,descriptionProps:I,errorMessageProps:P}=y(w,f),S=x("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":l,"maxio-text-field--readonly":n,"maxio-text-field--full-width":u},p),$=l&&c&&s;return a.createElement("div",{className:S},o&&a.createElement("label",{className:"maxio-text-field__label",...k},o),a.createElement("div",{className:"maxio-text-field__items"},m&&a.createElement("div",{className:"maxio-text-field__leading-element"},m),a.createElement("input",{ref:f,type:"text",className:"maxio-text-field__input",...C,spellCheck:_}),d&&a.createElement("div",{className:"maxio-text-field__trailing-element"},d)),r&&!$&&a.createElement("div",{className:"maxio-form-helper-text",...I},r),$&&a.createElement(Fe,{...P},c))});ca.displayName="TextInput";const ma=({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=g();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(re,{variant:"chevron-up-down"})),!!r&&a.createElement(Fe,null,r),o&&!r&&a.createElement("div",{className:"maxio-form-helper-text"},o))},da=({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,x]=n(r.toString());l(()=>{x(m.toString())},[m]);const g=Math.ceil(i/u),b=m<g,h=m>1,E=u*(m-1)+1,f=Math.min(u*m,i),_=s.map(e=>({label:e.toString(),value:e.toString()})),N=Array.from({length:g},(e,a)=>a+1).map(e=>({label:e.toString(),value:e.toString()})),w=e=>{d(e),null==t||t({currentPage:e,itemsPerPage:u})},y=e=>{const a=parseInt(e,10);if(isNaN(a))return void x(m.toString());const t=Math.max(1,Math.min(a,g));x(t.toString()),w(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(ma,{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,E,"–",f," of ",i," items")),a.createElement("div",{className:"maxio-pagination__current-page"},c?a.createElement(ca,{className:"maxio-pagination__page-input",value:v,min:1,max:g,onChange:e=>(e=>{x(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(ma,{inline:!0,size:e,"aria-label":"Select page",onChange:e=>w(Number(e.target.value)),value:m,options:N,id:"page-index-large"}),a.createElement("div",{className:"maxio-pagination__label"},"of ",g," pages")),a.createElement("div",{className:"maxio-pagination__controls"},a.createElement(ia,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(ge,{icon:a.createElement(re,{variant:"chevron-left"}),size:e,variant:"ghost",onClick:()=>w(m-1),"aria-label":"Previous",disabled:!h})),a.createElement(ia,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(ge,{icon:a.createElement(re,{variant:"chevron-right"}),size:e,variant:"ghost",onClick:()=>w(m+1),"aria-label":"Next",disabled:!b}))))},ua=({className:e,hideArrow:t=!1,children:l,...n})=>a.createElement(U,{...n,className:x("maxio-popover",e)},a.createElement(a.Fragment,null,!t&&a.createElement(G,{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)),pa=({label:e,helperText:t,size:l="md",variant:n="default",status:i,value:o,maxValue:r=100})=>{const s=g(),c=g(),m=i&&!!e&&!!o&&!("inline"===n),d=t&&!("inline"===n),u=t&&"inline"===n,{progressBarProps:p,labelProps:v}=k({maxValue:r,value:o,label:e}),b=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:b,...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))},va=({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(re,{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(re,{variant:t}))),xa=e=>"heading"!==e.type,ga=e=>{const a=(e=>e.flat().filter(xa).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 xa(e)&&(null===(t=e.items)||void 0===t?void 0:t.includes(a))?{...e,isOpen:!0}:e})):e},ba=r({}),ha=()=>c(ba),Ea=({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)),[x,g]=n(()=>ga(s)),{windowWitdh:b}=aa(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(ba.Provider,{value:{sections:x,topDropdownItems:m,onSectionOpen:e=>{g(a=>a.map(a=>a.map(a=>xa(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)},fa=()=>{const{onOpen:e,topDropdownItems:l,isOpen:n}=ha(),{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:u,itemsCount:p}=d(()=>({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(va,{type:"menu",isTooltipVisible:!n&&c,leadingIcon:i.icon,trailingIcon:"chevron-up-down",leadingIconClassName:i.iconClass},i.title)):a.createElement(va,{type:"menu",trailingIcon:"chevron-up-down"},i.title)),a.createElement(me,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:u,small:!0})))},_a=({section:e})=>{const{isOpen:l,withIcons:n}=ha(),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(va,{isTooltipVisible:o&&!l,type:"menu",leadingIcon:n?e.icon:void 0},e.name)))},Na=({section:e})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=ha(),c=t(null),m=ea(c);if(!xa(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(_a,{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(va,{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))))))},wa=()=>{const{sections:e}=ha();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(Na,{key:`section-list-item-${e.type}-${t}-${l}`,section:e})))))},ya=()=>{const{onClose:e,shouldToggleSidebar:t}=ha();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(re,{variant:"sidebar"})))},ka=()=>{const{isOpen:e}=ha();return a.createElement("nav",{className:x("maxio-side-nav",{"maxio-side-nav--collapsed":!e})},a.createElement(ya,null),a.createElement(fa,null),a.createElement("div",{className:"maxio-side-nav__items-container"},a.createElement(wa,null)))},Ca=({withIcons:e=!0,shouldToggleSidebar:t=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>a.createElement(Ea,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:e,shouldToggleSidebar:t,topDropdownItems:l,sections:n},a.createElement(ka,null)),Ia=r({}),Pa=()=>c(Ia),Sa=({children:e,variant:t="line",withDivider:i=!1,defaultIndex:o=0,onChange:r,index:s})=>{const[c,m]=n(()=>void 0!==s?s:o);l(()=>{void 0===s&&m(o),"number"==typeof s&&m(s)},[o,s]);return a.createElement(Ia.Provider,{value:{currentIndex:c,variant:t,withDivider:i,onChange:e=>{let a;a="function"==typeof e?e(c):e,void 0===s&&m(a),"function"==typeof r&&r(a)}}},e)},$a=({disabled:e=!1,value:n=0,isCurrent:i,...o})=>{const{onChange:r,currentIndex:s}=Pa(),c=x("maxio-tabs__tab",{"maxio-tabs__tab--active":s===n,"maxio-tabs__tab--disabled":e,"maxio-tabs__tab--icon":"icon"===o.type}),m=()=>{r(n)},d={"aria-selected":i,id:`tab-${n}`,"aria-controls":`panel-${n}`,role:"tab",tabIndex:i?0:-1},u=t(null),p=t(!1);if(l(()=>{var e;i&&p.current&&(null===(e=u.current)||void 0===e||e.focus())},[i]),l(()=>{p.current=!0},[]),"icon"===o.type){const{icon:e,...t}=o;return a.createElement("div",{className:c,ref:u,onClick:m,...d,...t},a.createElement("div",{className:"maxio-tabs__tab__content"},e))}const{children:v,rightIcon:g,...b}=o;return a.createElement("div",{ref:u,className:c,onClick:m,...d,...b},a.createElement("div",{className:"maxio-tabs__tab__content"},v,g||null))},Da=({children:e,variant:t="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>a.createElement(Sa,{defaultIndex:n,variant:t,withDivider:l,index:i,onChange:o},e),Ta=({children:e,value:t,...l})=>{const{currentIndex:n}=Pa();return a.createElement("div",{...l,...t?{id:`panel-${t}`}:{},role:"tabpanel","aria-labelledby":`tab-${t}`,hidden:n!==t},e)},za=({children:e})=>{const{currentIndex:t}=Pa();return a.createElement(a.Fragment,null,m.map(e,(e,a)=>{if(o(e)&&e.type===Ta)return a===t?i(e,{value:a}):null;throw new Error("You can only pass <TabPanel /> component as children")}))},Oa=(e,a,t)=>0===e?e:1===e&&a[e-1].disabled?t||e:a[e-1].disabled?Oa(e-1,a,t||e):e-1,Ra=({children:e,className:l,ariaLabel:n,...r})=>{const{variant:s,withDivider:c,currentIndex:d,onChange:u}=Pa(),p=x("maxio-tabs",l,{"maxio-tabs--contained":"contained"===s,"maxio-tabs--divider":c}),v=t(null),g=()=>m.map(e,e=>e.props);return a.createElement("div",{className:p,role:"tablist","aria-label":n,"aria-orientation":"horizontal",ref:v,onKeyDown:e=>{var a;"ArrowRight"===e.key&&u(e=>((e,a)=>{const t=a.findIndex((a,t)=>!a.disabled&&t>e);return-1===t?e:t})(e,g())),"ArrowLeft"===e.key&&u(e=>Oa(e,g())),null===(a=v.current)||void 0===a||a.focus()},...r},m.map(e,(e,a)=>{if(o(e)&&e.type===$a)return i(e,{value:a,isCurrent:d===a});throw new Error("You can only pass <Tab /> component as children")}))},Ma=({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(re,{variant:i,className:"maxio-tag__icon"}),a.createElement("span",{className:"maxio-tag__label"},e),o&&a.createElement(re,{variant:o,className:"maxio-tag__icon"}))},La=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__header",t),...l},e);La.displayName="Card.Header";const Va=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__body",t),...l},e);Va.displayName="Card.Body";const Ba=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__footer",t),...l},e);Ba.displayName="Card.Footer";const Ha=({children:e,className:t,variant:l="primary",...n})=>a.createElement("div",{className:x("maxio-card",`maxio-card--${l}`,t),...n},e);Ha.displayName="Card";const Aa=Object.assign(Ha,{Header:La,Body:Va,Footer:Ba}),Wa=({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 Fa,ja,qa,Ua;function Ga(){return Ga=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},Ga.apply(null,arguments)}const Ya=a=>e.createElement("svg",Ga({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},a),Fa||(Fa=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"})),ja||(ja=e.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),qa||(qa=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"})),Ua||(Ua=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"}))),Za=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(Ya,{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)})},Ka=({state:e,...l})=>{var n,i;const o=t(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:m}=te(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(re,{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(de,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),d&&a.createElement(ge,{variant:"ghost",icon:a.createElement(re,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...m}))},Xa=({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(Ka,{key:t.key,toast:t,state:e})))},Qa=({children:e,...t})=>{const{maxVisibleToasts:l=5,...n}=t,i=J({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(Xa,{...t,state:i}))},Ja=r(null),et=({children:e,toastQueue:t,...l})=>{const n=ee(t),i=p(()=>{n.visibleToasts.forEach(e=>{t.close(e.key)})},[n.visibleToasts,t]),o=d(()=>({addToast:t.add.bind(t),removeToast:t.clear.bind(t),removeAllToasts:i,state:n}),[t,i,n]);return a.createElement(Ja.Provider,{value:o},e,n.visibleToasts.length>0&&a.createElement(Xa,{...l,state:n}))},at=()=>{const e=c(Ja);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 tt extends ae{}const lt=({defaultChecked:e,checked:t,onChange:l,disabled:n,valueDescription:i,valueDescriptionPosition:o,className:r,name:c,id:m,...d})=>{const u=s(),v="boolean"==typeof e,g=m||u,b="left"===o?"row":"row-reverse",h=i&&o,E=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]),f=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:E,disabled:n,className:"maxio-toggle__checkbox",id:g,name:c,"aria-label":f}),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"})))))},nt=({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)},it=({children:e,actions:t,sideNavIsClosed:l,openSideNav:n})=>a.createElement("nav",{className:"maxio-top-bar"},l&&a.createElement(ge,{"aria-label":"Open Side Navigation",variant:"ghost",icon:a.createElement(re,{variant:"sidebar"}),onClick:n}),a.createElement(nt,{grow:!0,justifyContent:"end"},e),t),ot=({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)},rt={sm:"h3",md:"h2",lg:"h1"},st=({children:e,size:t="sm",className:l,...n})=>{const i=rt[t],o=x(`maxio-heading-${t}`,l);return a.createElement(i,{className:o,...n},e)},ct=({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)},mt=({as:e="div",children:t,className:l,...n})=>{const i=e,o=x("maxio-code",l);return a.createElement(i,{className:o,...n},t)},dt=({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)},ut=({...e})=>{const l=t(null),{buttonProps:n}=h(e,l);return a.createElement("button",{...n,className:"maxio-chip__dismiss-button"},a.createElement(re,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},pt=({label:e,onDismiss:l,dismissLabel:n,leadingIcon:i,trailingIcon:o,title:r,...s})=>{const c=t(null),m=T(s),{buttonProps:d}=C(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(re,{variant:i,className:"maxio-chip__icon"}),a.createElement("span",{className:"maxio-chip__label"},e),o&&!l&&a.createElement(re,{variant:o,className:"maxio-chip__icon"})),l&&a.createElement(ut,{onPress:l,"aria-label":n}))},vt=({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:E,...f})=>{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-${E}`]:E});return a.createElement("div",{className:_||void 0,...f},e)},xt=({className:e,...t})=>a.createElement(Y,{...t,className:x("maxio-listbox",e)});xt.displayName="ListBox";const gt=({className:e,...t})=>{const l=t.textValue||("string"==typeof t.children?t.children:void 0);return a.createElement(Z,{...t,textValue:l,className:x("maxio-listbox__item",e)},K(t.children,(e,{isSelected:t})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-listbox__content"},"string"==typeof e?a.createElement(ot,{size:"sm"},e):e),t&&a.createElement(re,{variant:"check"}))))};gt.displayName="ListBox.Item";const bt=({className:e,...t})=>a.createElement(X,{...t,className:x("maxio-listbox__section",e)});bt.displayName="ListBox.Section";const ht=({className:e,...t})=>a.createElement(Q,{...t,className:x("maxio-listbox__header",e)});ht.displayName="ListBox.Header";const Et=Object.assign(xt,{Item:gt,Section:bt,Header:ht}),ft={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"},_t=({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(nt,{alignItems:"center",justifyContent:"between"},a.createElement(Za,{size:"md"}),r),o&&a.createElement(be,{display:"block",title:o.title,sentiment:o.sentiment},o.children),a.createElement(Aa,{variant:"secondary"},a.createElement(Aa.Body,null,a.createElement(nt,{flexDirection:"col",gap:6},a.createElement(nt,{flexDirection:"col",gap:2},a.createElement(nt,{alignItems:"center",gap:2},i,a.createElement(st,{size:"lg",className:x("maxio-auth-layout__heading",ft[n])},t)),l&&a.createElement(nt,{style:{color:"var(--maxio-color-text-tertiary)"}},a.createElement(ot,{size:"sm",className:"maxio-auth-layout__description"},l))),e)),s&&a.createElement(Aa.Footer,null,s)));export{me as ActionList,be as Alert,_t as AuthLayout,ke as Avatar,Ce as Banner,ot as Body,De as Breadcrumbs,Ie as BreadcrumbsItem,xe as Button,Aa as Card,Ae as Checkbox,je as CheckboxGroup,pt as Chip,mt as Code,Ke as DataTable,ct as Display,nt as Flex,Fe as FormErrorMessage,We as FormHelperText,et as GlobalToastProvider,vt as Grid,st as Heading,re as Icon,ge as IconButton,dt as Label,de as Link,Et as ListBox,ue as LoadingSpinner,Za as Logo,Ne as Menu,ye as MenuButton,we as MenuList,ta as OverlayTrigger,da as Pagination,ua as Popover,pa as ProgressBar,ra as Radio,sa as RadioGroup,ma as Select,Ca as SideNav,$a as Tab,Ra as TabList,Ta as TabPanel,za as TabPanels,Da as Tabs,Ma as Tag,ca as TextInput,Wa as Tile,Qa as ToastProvider,tt as ToastQueue,lt as Toggle,la as Tooltip,ia as TooltipTrigger,it as TopBar,ea as useHover,Je as useOverlayTrigger,at as useToast,aa as useWindowSize};