@eschoolbase/client-ui 0.2.1 → 0.3.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/components/Textarea/RichTextControl.d.ts +3 -0
- package/dist/components/Textarea/Textarea.d.ts +4 -1
- package/dist/components/Textarea/Textarea.types.d.ts +9 -0
- package/dist/components/Textarea/index.d.ts +1 -1
- package/dist/components/Textarea/sanitizeHtml.d.ts +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1756 -1467
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils/portalHost.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime"),n=require("react-dom");function r(...e){return e.filter(Boolean).join(` `)}var i=`client-ui:`;function a(e){let t=i+e.trim(),n=3735928559,r=1103547991;for(let e=0;e<t.length;e++){let i=t.charCodeAt(e);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,`0`)}var o=[`1cd9d9bd20471f`],s=``,c=new Set,l=!1,u=(0,e.createContext)(null);function d(e){s=e,l=!1,c.forEach(e=>e())}function f(e){return!e||!e.trim()?!1:o.includes(a(e))}var p=e=>(c.add(e),()=>{c.delete(e)}),m=()=>s;function h(){let t=(0,e.useContext)(u),n=(0,e.useSyncExternalStore)(p,m,m),r=f(t??n);return(0,e.useEffect)(()=>{r||l||(l=!0,console.error(`[client-ui] Missing or invalid license key. Components are disabled. Pass licenseKey to <ThemeProvider> or call setLicenseKey() once at app start.`))},[r]),r}var g={root:`cui-UnlicensedNotice-module__root--FdnRG`};function _(){return(0,t.jsx)(`span`,{role:`alert`,className:g.root,children:`client-ui: missing or invalid license key`})}var v={button:`cui-Button-module__button--2ZuB7`,sm:`cui-Button-module__sm--NhG0g`,md:`cui-Button-module__md--hH4h3`,lg:`cui-Button-module__lg--2plQf`,fullWidth:`cui-Button-module__fullWidth--36oJT`,primary:`cui-Button-module__primary--s1sM6`,secondary:`cui-Button-module__secondary--R0waJ`,outline:`cui-Button-module__outline--F5jq-`,ghost:`cui-Button-module__ghost--1KINV`,danger:`cui-Button-module__danger--V4fX8`,link:`cui-Button-module__link--Zt5hw`,spinner:`cui-Button-module__spinner--ZExvW`,spin:`cui-Button-module__spin--JvkZu`},y=(0,e.forwardRef)(function({variant:e=`primary`,size:n=`md`,loading:i=!1,fullWidth:a=!1,type:o=`button`,disabled:s,className:c,children:l,...u},d){return h()?(0,t.jsxs)(`button`,{...u,ref:d,type:o,disabled:s||i,"aria-busy":i||void 0,"data-variant":e,"data-size":n,className:r(v.button,v[e],v[n],a&&v.fullWidth,c),children:[i?(0,t.jsx)(`span`,{className:v.spinner,"aria-hidden":`true`}):null,l]}):(0,t.jsx)(_,{})}),b=(0,e.createContext)(null);function x(t){let n=(0,e.useContext)(b),r=(0,e.useId)(),i=n?.id??t.id??r,a=!!(t.required??n?.required),o=!!(t.disabled??n?.disabled),s=!!t.error||!!n?.invalid,c=[t[`aria-describedby`],n?.describedById].filter(Boolean).join(` `)||void 0;return{id:i,required:a,disabled:o,invalid:s,labelId:n?.labelId,"aria-invalid":s?!0:void 0,"aria-describedby":c}}var S={root:`cui-FormField-module__root--QkVj-`,label:`cui-FormField-module__label--98wVM`,labelDisabled:`cui-FormField-module__labelDisabled--I5V6c`,required:`cui-FormField-module__required--Erm4t`,message:`cui-FormField-module__message--FUq3k`,helper:`cui-FormField-module__helper--JuBZ6`,error:`cui-FormField-module__error--4SHKr`};function C({children:n,label:i,required:a=!1,helperText:o,error:s,disabled:c=!1,id:l,className:u,...d}){let f=(0,e.useId)(),p=l??f,m=!!s,g=m?`${p}-error`:o?`${p}-helper`:void 0,v=(0,e.useMemo)(()=>({id:p,describedById:g,labelId:i?`${p}-label`:void 0,required:a,disabled:c,invalid:m}),[p,g,i,a,c,m]);return h()?(0,t.jsx)(b.Provider,{value:v,children:(0,t.jsxs)(`div`,{...d,className:r(S.root,u),children:[i?(0,t.jsxs)(`label`,{id:`${p}-label`,htmlFor:p,className:r(S.label,c&&S.labelDisabled),children:[i,a?(0,t.jsx)(`span`,{className:S.required,"aria-hidden":`true`,children:`*`}):null]}):null,n,m?(0,t.jsx)(`p`,{id:g,className:r(S.message,S.error),role:`alert`,children:s}):o?(0,t.jsx)(`p`,{id:g,className:r(S.message,S.helper),children:o}):null]})}):(0,t.jsx)(_,{})}var w=(e,t=2)=>String(e).padStart(t,`0`),T=e=>`${w(e.getFullYear(),4)}-${w(e.getMonth()+1)}-${w(e.getDate())}`;function E(e){if(!e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let t=new Date(`${e}T12:00:00`);return Number.isFinite(t.getTime())&&T(t)===e?t:null}var D=()=>{let e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12)},O=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t,12);function k(e,t){let n=new Date(e.getFullYear(),e.getMonth()+t,1,12),r=new Date(n.getFullYear(),n.getMonth()+1,0,12).getDate();return new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),r),12)}var A=(e,t)=>!!(e&&t&&T(e)===T(t));function j(e,t){let n=new Date(e.getFullYear(),e.getMonth(),1,12),r=(n.getDay()-t+7)%7;return Array.from({length:42},(e,t)=>O(n,t-r))}function ee(e,t=D()){let n=E(e.min),r=E(e.max),i=T(t),a=new Set((e.disabledDates??[]).map(e=>e instanceof Date?T(e):E(e)?e:null).filter(e=>e!==null)),o=(e.disabledRanges??[]).map(e=>({from:E(e.from),to:E(e.to)})).filter(e=>e.from!==null&&e.to!==null).map(e=>({from:T(e.from),to:T(e.to)})),s=new Set(e.disabledDaysOfWeek??[]);return t=>{let c=T(t);return n&&c<T(n)||r&&c>T(r)||e.disablePast&&c<i||e.disableFuture&&c>i||a.has(c)||s.has(t.getDay())||o.some(e=>c>=e.from&&c<=e.to)?!0:e.isDateDisabled?.(t)??!1}}function M(e,t){if(!t(e))return e;for(let n=1;n<=366;n++){let r=O(e,n);if(!t(r))return r;let i=O(e,-n);if(!t(i))return i}return e}var N=e=>`${w(e.getFullYear(),4)}-${w(e.getMonth()+1)}`;function P(e){return!e||!/^\d{4}-\d{2}$/.test(e)?null:E(`${e}-01`)}function F(e,t=D()){let n=e.min&&P(e.min)?e.min:null,r=e.max&&P(e.max)?e.max:null,i=N(t),a=new Set((e.disabledMonths??[]).filter(e=>P(e)));return t=>{let o=N(t);return n&&o<n||r&&o>r||e.disablePast&&o<i||e.disableFuture&&o>i||a.has(o)?!0:e.isMonthDisabled?.(t)??!1}}var te=e=>`${T(e)}T${w(e.getHours())}:${w(e.getMinutes())}`;function I(e){let t=/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::\d{2}(?:\.\d+)?)?$/.exec(e??``);if(!t)return null;let n=E(t[1]),r=Number(t[2]),i=Number(t[3]);return!n||r>23||i>59?null:new Date(n.getFullYear(),n.getMonth(),n.getDate(),r,i)}var L=(e,t,n)=>new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,n),R={root:`cui-Calendar-module__root--Nuha8`,header:`cui-Calendar-module__header--BPQQc`,title:`cui-Calendar-module__title--HmlTp`,nav:`cui-Calendar-module__nav--m7oVU`,titleButton:`cui-Calendar-module__titleButton--o056C`,day:`cui-Calendar-module__day--3Adk8`,cell:`cui-Calendar-module__cell--i93Lx`,footerButton:`cui-Calendar-module__footerButton--xlHWH`,weekdays:`cui-Calendar-module__weekdays--q0AWC`,grid:`cui-Calendar-module__grid--QMyQn`,selected:`cui-Calendar-module__selected--6Q-na`,outside:`cui-Calendar-module__outside--JWMZI`,today:`cui-Calendar-module__today--DNP-o`,cells:`cui-Calendar-module__cells--741gl`,active:`cui-Calendar-module__active--Moaen`,footer:`cui-Calendar-module__footer--Kkc3d`,footerPrimary:`cui-Calendar-module__footerPrimary--nNPYm`,currentCell:`cui-Calendar-module__currentCell--9oL2S`},ne=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:e===`left`?`M12 5l-5 5 5 5`:`M8 5l5 5-5 5`})});function re({selected:n,isDisabled:i,weekStartsOn:a,locale:o,onSelect:s,allowClear:c,showFooter:l=!0}){let u=D(),[d,f]=(0,e.useState)(()=>M(n??u,i)),[p,m]=(0,e.useState)(`days`),h=(0,e.useRef)(null),g=(0,e.useRef)(!0),_=(0,e.useMemo)(()=>new Intl.DateTimeFormat(o,{month:`long`}).format(d),[d,o]),v=(0,e.useMemo)(()=>Array.from({length:12},(e,t)=>new Intl.DateTimeFormat(o,{month:`short`}).format(new Date(2024,t,1))),[o]),y=(0,e.useMemo)(()=>{let e=new Date(2024,0,7+a);return Array.from({length:7},(t,n)=>{let r=O(e,n);return{short:new Intl.DateTimeFormat(o,{weekday:`short`}).format(r),long:new Intl.DateTimeFormat(o,{weekday:`long`}).format(r)}})},[o,a]),b=(0,e.useMemo)(()=>new Intl.DateTimeFormat(o,{dateStyle:`full`}),[o]),x=(0,e.useMemo)(()=>j(d,a),[d,a]),S=d.getFullYear(),C=Math.floor((S-1)/12)*12+1,w=T(d);(0,e.useEffect)(()=>{p===`days`&&g.current&&h.current?.querySelector(`[data-date="${w}"]`)?.focus({preventScroll:!0})},[w,p]);let E=e=>{g.current=!0,f(e)},ee=e=>{let t={ArrowLeft:()=>O(d,-1),ArrowRight:()=>O(d,1),ArrowUp:()=>O(d,-7),ArrowDown:()=>O(d,7),PageUp:()=>k(d,e.shiftKey?-12:-1),PageDown:()=>k(d,e.shiftKey?12:1),Home:()=>O(d,-((d.getDay()-a+7)%7)),End:()=>O(d,6-(d.getDay()-a+7)%7)}[e.key];t&&(e.preventDefault(),E(t()))},N=e=>{g.current=!1,f(t=>k(t,e*(p===`years`?144:p===`months`?12:1)))},P=p===`years`?`Previous 12 years`:p===`months`?`Previous year`:`Previous month`,F=p===`years`?`Next 12 years`:p===`months`?`Next year`:`Next month`;return(0,t.jsxs)(`div`,{className:R.root,children:[(0,t.jsxs)(`div`,{className:R.header,children:[(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":P,onClick:()=>N(-1),children:ne(`left`)}),(0,t.jsx)(`div`,{className:R.title,"aria-live":`polite`,children:p===`years`?(0,t.jsxs)(`span`,{children:[C,` - `,C+11]}):(0,t.jsxs)(t.Fragment,{children:[p===`days`?(0,t.jsx)(`button`,{type:`button`,className:R.titleButton,"aria-label":`Choose month`,onClick:()=>m(`months`),children:_}):null,(0,t.jsx)(`button`,{type:`button`,className:R.titleButton,"aria-label":`Choose year`,onClick:()=>m(`years`),children:S})]})}),(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":F,onClick:()=>N(1),children:ne(`right`)})]}),p===`days`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`div`,{className:R.weekdays,"aria-hidden":`true`,children:y.map(e=>(0,t.jsx)(`span`,{children:e.short},e.long))}),(0,t.jsx)(`div`,{ref:h,className:R.grid,role:`group`,"aria-label":`${_} ${S}`,onKeyDown:ee,children:x.map(e=>{let a=T(e),o=e.getMonth()!==d.getMonth(),c=A(e,n);return(0,t.jsx)(`button`,{type:`button`,"data-date":a,tabIndex:A(e,d)?0:-1,"aria-disabled":i(e)||void 0,"aria-label":b.format(e),"aria-pressed":c,"aria-current":A(e,u)?`date`:void 0,className:r(R.day,o&&R.outside,A(e,u)&&R.today,c&&R.selected),onClick:()=>{i(e)||s(e)},children:e.getDate()},a)})})]}):p===`months`?(0,t.jsx)(`div`,{className:R.cells,children:v.map((e,n)=>(0,t.jsx)(`button`,{type:`button`,className:r(R.cell,n===d.getMonth()&&R.active),onClick:()=>{g.current=!0,f(e=>k(e,n-e.getMonth())),m(`days`)},children:e},e))}):(0,t.jsx)(`div`,{className:R.cells,children:Array.from({length:12},(e,t)=>C+t).map(e=>(0,t.jsx)(`button`,{type:`button`,className:r(R.cell,e===S&&R.active),onClick:()=>{g.current=!0,f(t=>k(t,(e-t.getFullYear())*12)),m(`months`)},children:e},e))}),l?(0,t.jsxs)(`div`,{className:R.footer,children:[c?(0,t.jsx)(`button`,{type:`button`,className:R.footerButton,onClick:()=>s(null),children:`Clear`}):(0,t.jsx)(`span`,{}),(0,t.jsx)(`button`,{type:`button`,className:r(R.footerButton,R.footerPrimary),disabled:i(u),onClick:()=>s(u),children:`Today`})]}):null]})}var z={control:`cui-PickerField-module__control--hv4-k`,trigger:`cui-PickerField-module__trigger--nMtV1`,open:`cui-PickerField-module__open--2Fuec`,value:`cui-PickerField-module__value--ygNxN`,placeholder:`cui-PickerField-module__placeholder--1Dyyf`,sm:`cui-PickerField-module__sm--D-r4h`,md:`cui-PickerField-module__md--BznWY`,lg:`cui-PickerField-module__lg--kVaWE`,icon:`cui-PickerField-module__icon--d3eU4`,clear:`cui-PickerField-module__clear--aFEVN`,invalid:`cui-PickerField-module__invalid--rZMR8`,disabled:`cui-PickerField-module__disabled--YO0Rv`,panel:`cui-PickerField-module__panel--QoUNQ`,"cui-datepicker-in":`cui-PickerField-module__cui-datepicker-in--J-Ky1`},B=4,ie=420,V=`button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]`,ae=(0,e.forwardRef)(function({id:i,required:a,disabled:o,error:s,"aria-describedby":c,size:l=`md`,displayText:u,placeholder:d,name:f,hiddenValue:p,clearable:m,onClear:h,clearLabel:g,panelLabel:_,panelWidth:v=300,icon:y=`calendar`,className:b,onClick:S,onKeyDown:C,children:w,...T},E){let D=x({id:i,required:a,disabled:o,error:s,"aria-describedby":c}),O=`${(0,e.useId)()}-panel`,k=(0,e.useRef)(null),A=(0,e.useRef)(null),j=(0,e.useRef)(null),ee=(0,e.useCallback)(e=>{A.current=e,typeof E==`function`?E(e):E&&(E.current=e)},[E]),[M,N]=(0,e.useState)(!1),[P,F]=(0,e.useState)(null),[te,I]=(0,e.useState)(),L=(0,e.useCallback)(()=>{let e=k.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<ie&&t.top>n,i={left:Math.max(8,Math.min(t.left,window.innerWidth-v))};r?i.bottom=window.innerHeight-t.top+B:i.top=t.bottom+B,F(i)},[v]),R=()=>{D.disabled||(L(),I(k.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),N(!0))},[ne,re]=(0,e.useState)(0),ae=(e=!0)=>{N(!1),e&&re(e=>e+1)};(0,e.useEffect)(()=>{ne>0&&A.current?.focus({preventScroll:!0})},[ne]),(0,e.useEffect)(()=>{if(!M)return;let e=()=>requestAnimationFrame(L),t=e=>{let t=e.target;!k.current?.contains(t)&&!j.current?.contains(t)&&N(!1)};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[M,L]);let oe=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),ae();return}if(e.key!==`Tab`)return;let t=Array.from(j.current?.querySelectorAll(V)??[]),n=t[0],r=t[t.length-1];n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},se=u!==null,ce=m&&se&&!D.disabled;return(0,t.jsxs)(`div`,{ref:k,className:r(z.control,z[l],D.invalid&&z.invalid,D.disabled&&z.disabled,M&&z.open,b),children:[(0,t.jsx)(`button`,{...T,ref:ee,id:D.id,type:`button`,"aria-haspopup":`dialog`,"aria-expanded":M,"aria-controls":M?O:void 0,"aria-invalid":D[`aria-invalid`],"aria-describedby":D[`aria-describedby`],"aria-required":D.required||void 0,disabled:D.disabled,className:r(z.trigger,!se&&z.placeholder),onClick:e=>{S?.(e),!e.defaultPrevented&&(M?ae(!1):R())},onKeyDown:e=>{C?.(e),!e.defaultPrevented&&!M&&e.key===`ArrowDown`&&(e.preventDefault(),R())},children:(0,t.jsx)(`span`,{className:z.value,children:u??d})}),ce?(0,t.jsx)(`button`,{type:`button`,className:z.clear,"aria-label":g,onClick:()=>{h(),A.current?.focus({preventScroll:!0})},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})}):null,(0,t.jsx)(`svg`,{className:z.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:y===`clock`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,t.jsx)(`path`,{d:`M12 7v5l3 2`})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`15`,rx:`2`}),(0,t.jsx)(`path`,{d:`M4 10h16M9 3v4M15 3v4`})]})}),f?(0,t.jsx)(`input`,{type:`hidden`,name:f,value:p}):null,M&&P?(0,n.createPortal)((0,t.jsx)(`div`,{ref:j,id:O,role:`dialog`,"aria-label":_,className:z.panel,style:P,"data-theme":te,onKeyDown:oe,children:w({close:ae})}),document.body):null]})});function oe({label:e,helperText:n,error:r,required:i,disabled:a,id:o,children:s}){return h()?!e&&!n&&!r?(0,t.jsx)(t.Fragment,{children:s}):(0,t.jsx)(C,{id:o,label:e,helperText:n,error:r,required:i,disabled:a,children:s}):(0,t.jsx)(_,{})}var se=ae,ce=(0,e.forwardRef)(function({label:n,helperText:r,error:i,required:a,disabled:o,id:s,value:c,defaultValue:l,onChange:u,min:d,max:f,disablePast:p,disableFuture:m,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v,placeholder:y=`Select a date`,name:b,clearable:x=!0,weekStartsOn:S=0,locale:C,...w},D){let O=c!==void 0,[k,A]=(0,e.useState)(l??``),j=E(O?c:k),M=ee({min:d,max:f,disablePast:p,disableFuture:m,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v}),N=(0,e.useMemo)(()=>new Intl.DateTimeFormat(C,{day:`2-digit`,month:`short`,year:`numeric`}),[C]),P=e=>{O||A(e),u?.(e)};return(0,t.jsx)(oe,{label:n,helperText:r,error:i,required:a,disabled:o,id:s,children:(0,t.jsx)(se,{...w,ref:D,id:s,required:a,disabled:o,error:i,name:b,hiddenValue:j?T(j):``,displayText:j?N.format(j):null,placeholder:y,clearable:x,clearLabel:`Clear date`,onClear:()=>P(``),panelLabel:`Choose date`,children:({close:e})=>(0,t.jsx)(re,{selected:j,isDisabled:M,weekStartsOn:S,locale:C,allowClear:x,onSelect:t=>{P(t?T(t):``),e()}})})})}),H={root:`cui-TimeColumns-module__root--Cvrka`,column:`cui-TimeColumns-module__column--pbegA`,list:`cui-TimeColumns-module__list--7VPVy`,option:`cui-TimeColumns-module__option--cz6mr`,selected:`cui-TimeColumns-module__selected--HDZ6k`},le=e=>String(e).padStart(2,`0`);function U({hours:e,minutes:n,onChange:r,minuteStep:i,use12Hours:a,isTimeDisabled:o}){let s=e??0,c=n??0,l=s>=12,u=Array.from({length:Math.ceil(60/i)},(e,t)=>t*i).filter(e=>e<60);n!==null&&!u.includes(n)&&u.push(n),u.sort((e,t)=>e-t);let d=e=>u.every(t=>o(e,t)),f=a?Array.from({length:12},(e,t)=>{let n=t+(l?12:0);return{value:n,label:String(t===0?12:t),disabled:d(n)}}):Array.from({length:24},(e,t)=>({value:t,label:le(t),disabled:d(t)})),p=u.map(e=>({value:e,label:le(e),disabled:o(s,e)})),m=e=>Array.from({length:12},(t,n)=>e+n).every(d),h=[{value:0,label:`AM`,disabled:m(0)},{value:12,label:`PM`,disabled:m(12)}];return(0,t.jsxs)(`div`,{className:H.root,children:[(0,t.jsx)(ue,{label:`Hours`,options:f,selected:e,onSelect:e=>r(e,c)}),(0,t.jsx)(ue,{label:`Minutes`,options:p,selected:n,onSelect:e=>r(s,e)}),a?(0,t.jsx)(ue,{label:`AM or PM`,options:h,selected:e===null?null:l?12:0,onSelect:e=>r(s%12+e,c)}):null]})}function ue({label:n,options:i,selected:a,onSelect:o}){let s=(0,e.useRef)(null),c=i.findIndex(e=>e.value===a);return(0,e.useEffect)(()=>{let e=s.current,t=e?.querySelector(`[aria-selected="true"]`);e&&t&&(e.scrollTop=Math.max(0,t.offsetTop-e.clientHeight/2+t.offsetHeight/2))},[a]),(0,t.jsx)(`div`,{className:H.column,children:(0,t.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":n,className:H.list,onKeyDown:e=>{let t=Array.from(s.current?.querySelectorAll(`[role="option"]`)??[]),n=t.indexOf(document.activeElement),r=-1;e.key===`ArrowDown`?r=Math.min(n+1,t.length-1):e.key===`ArrowUp`?r=Math.max(n-1,0):e.key===`Home`?r=0:e.key===`End`&&(r=t.length-1),!(r<0)&&(e.preventDefault(),t[r]?.focus({preventScroll:!1}))},children:i.map((e,n)=>{let i=e.value===a;return(0,t.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,tabIndex:i||c===-1&&n===0?0:-1,className:r(H.option,i&&H.selected),onClick:()=>{e.disabled||o(e.value)},children:e.label},e.value)})})})}var W={timeHeading:`cui-DateTimePicker-module__timeHeading--Wk-z9`,footer:`cui-DateTimePicker-module__footer---mP1S`,footerActions:`cui-DateTimePicker-module__footerActions--Io2QZ`,footerButton:`cui-DateTimePicker-module__footerButton--gUs4k`,done:`cui-DateTimePicker-module__done--XjGrY`};function G(e,t){if(!e)return null;let n=I(e);if(n)return n;let r=E(e);return r?L(r,t?23:0,t?59:0):null}var de=e=>{let t=/^(\d{2}):(\d{2})$/.exec(e),n=t?Number(t[1]):0,r=t?Number(t[2]):0;return n>23||r>59?[0,0]:[n,r]},fe=(0,e.forwardRef)(function({label:n,helperText:r,error:i,required:a,disabled:o,id:s,value:c,defaultValue:l,onChange:u,min:d,max:f,disablePast:p,disableFuture:m,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v,minuteStep:y=5,use12Hours:b=!1,defaultTime:x=`00:00`,placeholder:S=`Select date and time`,name:C,clearable:w=!0,weekStartsOn:E=0,locale:k,...A},j){let N=c!==void 0,[P,F]=(0,e.useState)(l??``),R=I(N?c:P),ne=new Date,z=[G(d,!1),p?ne:null].filter(e=>e!==null).sort((e,t)=>t.getTime()-e.getTime())[0],B=[G(f,!0),m?ne:null].filter(e=>e!==null).sort((e,t)=>e.getTime()-t.getTime())[0],ie=ee({min:z?T(z):void 0,max:B?T(B):void 0,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v}),V=e=>ie(e)||z!==void 0&&e<L(z,z.getHours(),z.getMinutes())||B!==void 0&&e>L(B,B.getHours(),B.getMinutes()),ae=(0,e.useMemo)(()=>new Intl.DateTimeFormat(k,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:b}),[k,b]),ce=e=>{let t=e?te(e):``;N||F(t),u?.(t)},H=(e,t,n)=>{let r=L(e,t,n);if(!V(r))return r;for(let t=0;t<1440;t+=y){let n=L(e,Math.floor(t/60),t%60);if(!V(n))return n}return r},le=()=>R??M(D(),ie),[ue,fe]=de(x),pe=new Date;return(0,t.jsx)(oe,{label:n,helperText:r,error:i,required:a,disabled:o,id:s,children:(0,t.jsx)(se,{...A,ref:j,id:s,required:a,disabled:o,error:i,name:C,hiddenValue:R?te(R):``,displayText:R?ae.format(R):null,placeholder:S,clearable:w,clearLabel:`Clear date and time`,onClear:()=>ce(null),panelLabel:`Choose date and time`,panelWidth:b?340:320,icon:`clock`,children:({close:e})=>(0,t.jsxs)(`div`,{children:[(0,t.jsx)(re,{selected:R,isDisabled:ie,weekStartsOn:E,locale:k,allowClear:w,showFooter:!1,onSelect:e=>{e&&ce(H(e,R?.getHours()??ue,R?.getMinutes()??fe))}}),(0,t.jsx)(`div`,{className:W.timeHeading,children:`Time`}),(0,t.jsx)(U,{hours:R?R.getHours():null,minutes:R?R.getMinutes():null,minuteStep:y,use12Hours:b,isTimeDisabled:(e,t)=>V(L(le(),e,t)),onChange:(e,t)=>ce(L(le(),e,t))}),(0,t.jsxs)(`div`,{className:W.footer,children:[w?(0,t.jsx)(`button`,{type:`button`,className:W.footerButton,onClick:()=>{ce(null)},children:`Clear`}):(0,t.jsx)(`span`,{}),(0,t.jsxs)(`span`,{className:W.footerActions,children:[(0,t.jsx)(`button`,{type:`button`,className:W.footerButton,disabled:V(pe),onClick:()=>ce(L(O(pe,0),pe.getHours(),pe.getMinutes())),children:`Now`}),(0,t.jsx)(`button`,{type:`button`,className:`${W.footerButton} ${W.done}`,onClick:()=>e(),children:`Done`})]})]})]})})})}),pe=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:e===`left`?`M12 5l-5 5 5 5`:`M8 5l5 5-5 5`})}),me=(e,t)=>new Date(e,t,1,12);function he({selected:n,isDisabled:i,locale:a,onSelect:o,allowClear:s}){let c=D(),[l,u]=(0,e.useState)(()=>me((n??c).getFullYear(),(n??c).getMonth())),[d,f]=(0,e.useState)(`months`),p=(0,e.useRef)(null),m=(0,e.useRef)(!0),h=l.getFullYear(),g=Math.floor((h-1)/12)*12+1,_=(0,e.useMemo)(()=>Array.from({length:12},(e,t)=>new Intl.DateTimeFormat(a,{month:`short`}).format(new Date(2024,t,1))),[a]),v=(0,e.useMemo)(()=>new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`}),[a]),y=N(l);(0,e.useEffect)(()=>{d===`months`&&m.current&&p.current?.querySelector(`[data-month="${y}"]`)?.focus({preventScroll:!0})},[y,d]);let b=e=>{let t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];t!==void 0&&(e.preventDefault(),m.current=!0,u(e=>k(e,t)))},x=e=>{m.current=!1,u(t=>k(t,e*(d===`years`?144:12)))};return(0,t.jsxs)(`div`,{className:R.root,children:[(0,t.jsxs)(`div`,{className:R.header,children:[(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":d===`years`?`Previous 12 years`:`Previous year`,onClick:()=>x(-1),children:pe(`left`)}),(0,t.jsx)(`div`,{className:R.title,"aria-live":`polite`,children:d===`years`?(0,t.jsxs)(`span`,{children:[g,` - `,g+11]}):(0,t.jsx)(`button`,{type:`button`,className:R.titleButton,"aria-label":`Choose year`,onClick:()=>f(`years`),children:h})}),(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":d===`years`?`Next 12 years`:`Next year`,onClick:()=>x(1),children:pe(`right`)})]}),d===`months`?(0,t.jsx)(`div`,{ref:p,className:R.cells,role:`group`,"aria-label":`Months of ${h}`,onKeyDown:b,children:_.map((e,a)=>{let s=me(h,a),u=N(s),d=n!==null&&N(n)===u;return(0,t.jsx)(`button`,{type:`button`,"data-month":u,tabIndex:a===l.getMonth()?0:-1,"aria-label":v.format(s),"aria-pressed":d,"aria-current":N(c)===u?`date`:void 0,"aria-disabled":i(s)||void 0,className:r(R.cell,d&&R.active,N(c)===u&&!d&&R.currentCell),onClick:()=>{i(s)||o(s)},children:e},u)})}):(0,t.jsx)(`div`,{className:R.cells,children:Array.from({length:12},(e,t)=>g+t).map(e=>(0,t.jsx)(`button`,{type:`button`,className:r(R.cell,e===h&&R.active),onClick:()=>{m.current=!0,u(t=>k(t,(e-t.getFullYear())*12)),f(`months`)},children:e},e))}),(0,t.jsxs)(`div`,{className:R.footer,children:[s?(0,t.jsx)(`button`,{type:`button`,className:R.footerButton,onClick:()=>o(null),children:`Clear`}):(0,t.jsx)(`span`,{}),(0,t.jsx)(`button`,{type:`button`,className:r(R.footerButton,R.footerPrimary),disabled:i(me(c.getFullYear(),c.getMonth())),onClick:()=>o(P(N(c))),children:`This month`})]})]})}var ge=(0,e.forwardRef)(function({label:n,helperText:r,error:i,required:a,disabled:o,id:s,value:c,defaultValue:l,onChange:u,min:d,max:f,disablePast:p,disableFuture:m,disabledMonths:h,isMonthDisabled:g,placeholder:_=`Select a month`,name:v,clearable:y=!0,locale:b,...x},S){let C=c!==void 0,[w,T]=(0,e.useState)(l??``),E=P(C?c:w),D=F({min:d,max:f,disablePast:p,disableFuture:m,disabledMonths:h,isMonthDisabled:g}),O=(0,e.useMemo)(()=>new Intl.DateTimeFormat(b,{month:`long`,year:`numeric`}),[b]),k=e=>{C||T(e),u?.(e)};return(0,t.jsx)(oe,{label:n,helperText:r,error:i,required:a,disabled:o,id:s,children:(0,t.jsx)(se,{...x,ref:S,id:s,required:a,disabled:o,error:i,name:v,hiddenValue:E?N(E):``,displayText:E?O.format(E):null,placeholder:_,clearable:y,clearLabel:`Clear month`,onClear:()=>k(``),panelLabel:`Choose month`,children:({close:e})=>(0,t.jsx)(he,{selected:E,isDisabled:D,locale:b,allowClear:y,onSelect:t=>{k(t?N(t):``),e()}})})})}),_e=[`date`,`datetime-local`,`month`],ve=e=>_e.includes(e),ye=(0,e.forwardRef)(function({type:n,label:r,helperText:i,error:a,required:o,disabled:s,id:c,name:l,size:u,value:d,defaultValue:f,onChange:p,min:m,max:h,placeholder:g,className:_,dateOptions:v={}},y){let b=(0,e.useRef)(null),x=(0,e.useCallback)(e=>{b.current=e,typeof y==`function`?y(e):y&&(y.current=e)},[y]),S=d!==void 0,[C,w]=(0,e.useState)(String(f??``)),T=S?String(d):C,E={id:c,label:r,helperText:i,error:a,required:o,disabled:s,size:u,placeholder:g,className:_,value:T,onChange:e=>{let t=b.current;t&&(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set?.call(t,e),t.dispatchEvent(new Event(`input`,{bubbles:!0})))},min:m===void 0?void 0:String(m),max:h===void 0?void 0:String(h),locale:v.locale,clearable:v.clearable,disablePast:v.disablePast,disableFuture:v.disableFuture};return(0,t.jsxs)(t.Fragment,{children:[n===`month`?(0,t.jsx)(ge,{...E,disabledMonths:v.disabledMonths,isMonthDisabled:v.isMonthDisabled}):n===`datetime-local`?(0,t.jsx)(fe,{...E,disabledDates:v.disabledDates,disabledRanges:v.disabledRanges,disabledDaysOfWeek:v.disabledDaysOfWeek,isDateDisabled:v.isDateDisabled,weekStartsOn:v.weekStartsOn,minuteStep:v.minuteStep,use12Hours:v.use12Hours,defaultTime:v.defaultTime}):(0,t.jsx)(ce,{...E,disabledDates:v.disabledDates,disabledRanges:v.disabledRanges,disabledDaysOfWeek:v.disabledDaysOfWeek,isDateDisabled:v.isDateDisabled,weekStartsOn:v.weekStartsOn}),(0,t.jsx)(`input`,{ref:x,hidden:!0,readOnly:!0,tabIndex:-1,type:`text`,name:l,value:T,onChange:e=>{S||w(e.target.value),p?.(e)}})]})}),be={control:`cui-Input-module__control--e3jPo`,disabled:`cui-Input-module__disabled--nzcnQ`,invalid:`cui-Input-module__invalid--VyrnA`,sm:`cui-Input-module__sm--SCPkT`,md:`cui-Input-module__md--weRbk`,lg:`cui-Input-module__lg--ic8a4`,input:`cui-Input-module__input--WjT81`,affix:`cui-Input-module__affix--zz0Xe`,readOnly:`cui-Input-module__readOnly--0ag-W`},xe=(0,e.forwardRef)(function({id:e,required:n,disabled:i,error:a,"aria-describedby":o,prefix:s,suffix:c,size:l=`md`,readOnly:u,className:d,...f},p){let m=x({id:e,required:n,disabled:i,error:a,"aria-describedby":o});return(0,t.jsxs)(`div`,{className:r(be.control,be[l],m.invalid&&be.invalid,m.disabled&&be.disabled,u&&be.readOnly,d),children:[s?(0,t.jsx)(`span`,{className:be.affix,children:s}):null,(0,t.jsx)(`input`,{...f,ref:p,id:m.id,required:m.required,disabled:m.disabled,readOnly:u,"aria-invalid":m[`aria-invalid`],"aria-describedby":m[`aria-describedby`],className:be.input}),c?(0,t.jsx)(`span`,{className:be.affix,children:c}):null]})}),K=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?ve(r.type)?(0,t.jsx)(ye,{label:e,helperText:n,...r,type:r.type,ref:i}):!e&&!n&&!r.error?(0,t.jsx)(xe,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(xe,{...r,ref:i})}):(0,t.jsx)(_,{})}),Se={toggle:`cui-PasswordInput-module__toggle--WNeX9`},Ce=(0,e.forwardRef)(function({showLabel:n=`Show password`,hideLabel:r=`Hide password`,autoComplete:i,disabled:a,...o},s){let[c,l]=(0,e.useState)(!1);return(0,t.jsx)(K,{...o,ref:s,type:c?`text`:`password`,autoComplete:i??`current-password`,disabled:a,suffix:(0,t.jsx)(`button`,{type:`button`,className:Se.toggle,"aria-label":c?r:n,"aria-pressed":c,disabled:a,onClick:()=>l(e=>!e),children:(0,t.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`path`,{d:`M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z`}),(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),c?null:(0,t.jsx)(`path`,{d:`M4 4l16 16`})]})})})}),we={search:`cui-SearchInput-module__search--XCZD4`,icon:`cui-SearchInput-module__icon--I9nEG`,clear:`cui-SearchInput-module__clear--r3kgN`},Te=(0,e.forwardRef)(function({value:n,defaultValue:r,onChange:i,onClear:a,clearLabel:o=`Clear search`,disabled:s,readOnly:c,...l},u){let d=(0,e.useRef)(null),f=(0,e.useCallback)(e=>{d.current=e,typeof u==`function`?u(e):u&&(u.current=e)},[u]),p=n!==void 0,[m,h]=(0,e.useState)(String(r??``)),g=p?String(n):m,_=g.length>0&&!s&&!c;return(0,t.jsx)(K,{...l,ref:f,type:`search`,className:we.search,value:g,disabled:s,readOnly:c,onChange:e=>{p||h(e.target.value),i?.(e)},prefix:(0,t.jsxs)(`svg`,{className:we.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`}),(0,t.jsx)(`path`,{d:`M16 16l4.5 4.5`})]}),suffix:_?(0,t.jsx)(`button`,{type:`button`,className:we.clear,"aria-label":o,onClick:()=>{p||h(``),a?.(),d.current?.focus()},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})}):void 0})}),Ee=`(prefers-color-scheme: dark)`;function De(){return(0,e.useSyncExternalStore)(e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(Ee);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(Ee).matches,()=>!1)}var Oe=new Set;function ke(e){try{return window.localStorage.getItem(e)}catch{return null}}function Ae(e,t){try{window.localStorage.setItem(e,t)}catch{}Oe.forEach(e=>e())}function je(t){return(0,e.useSyncExternalStore)(e=>(Oe.add(e),window.addEventListener(`storage`,e),()=>{Oe.delete(e),window.removeEventListener(`storage`,e)}),()=>t?ke(t):null,()=>null)}var Me={root:`cui-ThemeProvider-module__root--2DEGi`},Ne=(0,e.createContext)(null);function Pe({children:n,theme:i,defaultTheme:a=`light`,onThemeChange:o,storageKey:s,licenseKey:c,className:l,...d}){let[f,p]=(0,e.useState)(a),m=je(i===void 0?s:void 0),h=De(),g=i??m??f,_=g===`system`?h?`dark`:`light`:g,v=(0,e.useCallback)(e=>{i===void 0&&(p(e),s&&Ae(s,e)),o?.(e)},[i,o,s]),y=(0,e.useMemo)(()=>({theme:g,resolvedTheme:_,setTheme:v}),[g,_,v]),b=(0,e.useContext)(u);return(0,t.jsx)(Ne.Provider,{value:y,children:(0,t.jsx)(u.Provider,{value:c??b,children:(0,t.jsx)(`div`,{...d,"data-theme":_,className:r(Me.root,l),children:n})})})}function Fe(){let t=(0,e.useContext)(Ne);if(!t)throw Error(`useTheme must be used within a <ThemeProvider>.`);return t}function Ie(){return(0,e.useContext)(Ne)}var Le={backdrop:`cui-Overlay-module__backdrop--HLwOh`,"cui-overlay-fade":`cui-Overlay-module__cui-overlay-fade--coHyQ`,center:`cui-Overlay-module__center--vmNyk`,right:`cui-Overlay-module__right--TmGqB`,left:`cui-Overlay-module__left--MRs4h`,panel:`cui-Overlay-module__panel--c5Gk2`,"cui-overlay-pop":`cui-Overlay-module__cui-overlay-pop--5VC2-`,"cui-overlay-slide-right":`cui-Overlay-module__cui-overlay-slide-right--2aZId`,"cui-overlay-slide-left":`cui-Overlay-module__cui-overlay-slide-left--0nCKr`},Re=`a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,ze=0,Be=``;function Ve(){ze===0&&(Be=document.body.style.overflow,document.body.style.overflow=`hidden`),ze+=1}function He(){ze=Math.max(0,ze-1),ze===0&&(document.body.style.overflow=Be)}function Ue({open:i,onClose:a,placement:o,panelClassName:s,closeOnBackdrop:c=!0,closeOnEscape:l=!0,role:u=`dialog`,"aria-label":d,children:f,className:p}){let m=(0,e.useId)(),h=`${m}-title`,g=`${m}-description`,_=(0,e.useRef)(null),v=(0,e.useRef)(!1),y=Ie();return(0,e.useEffect)(()=>{if(!i)return;let e=document.activeElement;Ve();let t=_.current;return(t?.querySelector(`[data-autofocus]`)??t)?.focus({preventScroll:!0}),()=>{He(),e?.focus?.({preventScroll:!0})}},[i]),i?(0,n.createPortal)((0,t.jsx)(`div`,{className:r(Le.backdrop,Le[o]),"data-theme":y?.resolvedTheme,onMouseDown:e=>{v.current=e.target===e.currentTarget},onClick:e=>{c&&v.current&&e.target===e.currentTarget&&a(),v.current=!1},children:(0,t.jsx)(`div`,{ref:_,role:u,"aria-modal":`true`,"aria-label":d,"aria-labelledby":d?void 0:h,"aria-describedby":g,tabIndex:-1,className:r(Le.panel,s,p),onKeyDown:e=>{if(e.key===`Escape`&&l){e.preventDefault(),e.stopPropagation(),a();return}if(e.key!==`Tab`)return;let t=Array.from(_.current?.querySelectorAll(Re)??[]),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement;e.shiftKey&&(i===n||i===_.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())},children:f({titleId:h,descriptionId:g})})}),document.body):null}var We={header:`cui-OverlayContent-module__header--uLtSD`,heading:`cui-OverlayContent-module__heading--8AaPl`,title:`cui-OverlayContent-module__title--I6nN9`,description:`cui-OverlayContent-module__description--fRdN6`,close:`cui-OverlayContent-module__close--uCSa1`,body:`cui-OverlayContent-module__body--EGPJE`,footer:`cui-OverlayContent-module__footer--qJLyt`};function Ge({titleId:e,descriptionId:n,title:r,description:i,footer:a,hideCloseButton:o,closeLabel:s=`Close`,onClose:c,children:l}){return(0,t.jsxs)(t.Fragment,{children:[r||i||!o?(0,t.jsxs)(`header`,{className:We.header,children:[(0,t.jsxs)(`div`,{className:We.heading,children:[r?(0,t.jsx)(`h2`,{id:e,className:We.title,children:r}):null,i?(0,t.jsx)(`p`,{id:n,className:We.description,children:i}):null]}),o?null:(0,t.jsx)(`button`,{type:`button`,className:We.close,"aria-label":s,onClick:c,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}):null,(0,t.jsx)(`div`,{className:We.body,children:l}),a?(0,t.jsx)(`footer`,{className:We.footer,children:a}):null]})}var Ke={panel:`cui-Modal-module__panel--lp9I7`,sm:`cui-Modal-module__sm--K5k3W`,md:`cui-Modal-module__md--gvyR7`,lg:`cui-Modal-module__lg--BgB1a`,xl:`cui-Modal-module__xl--MR-68`,full:`cui-Modal-module__full--z-yai`,bare:`cui-Modal-module__bare--8uhGX`};function qe({open:e,onClose:n,title:i,description:a,children:o,footer:s,size:c=`md`,closeOnBackdrop:l,closeOnEscape:u,hideCloseButton:d,bare:f=!1,role:p,"aria-label":m,className:g}){return h()?(0,t.jsx)(Ue,{open:e,onClose:n,placement:`center`,panelClassName:r(Ke.panel,Ke[c],f&&Ke.bare),className:g,closeOnBackdrop:l,closeOnEscape:u,role:p,"aria-label":m,children:({titleId:e,descriptionId:r})=>f?typeof o==`function`?o({titleId:e,descriptionId:r,onClose:n}):o:(0,t.jsx)(Ge,{titleId:e,descriptionId:r,title:i,description:a,footer:s,hideCloseButton:d,onClose:n,children:typeof o==`function`?null:o})}):e?(0,t.jsx)(_,{}):null}var Je={panel:`cui-Drawer-module__panel--wUX0N`,sm:`cui-Drawer-module__sm--AQ96e`,md:`cui-Drawer-module__md---2Ihw`,lg:`cui-Drawer-module__lg--gWSe1`};function Ye({open:e,onClose:n,title:i,description:a,children:o,footer:s,placement:c=`right`,size:l=`md`,closeOnBackdrop:u,closeOnEscape:d,hideCloseButton:f,role:p,"aria-label":m,className:g}){return h()?(0,t.jsx)(Ue,{open:e,onClose:n,placement:c,panelClassName:r(Je.panel,Je[l]),className:g,closeOnBackdrop:u,closeOnEscape:d,role:p,"aria-label":m,children:({titleId:e,descriptionId:r})=>(0,t.jsx)(Ge,{titleId:e,descriptionId:r,title:i,description:a,footer:s,hideCloseButton:f,onClose:n,children:o})}):e?(0,t.jsx)(_,{}):null}var Xe={confirmText:`cui-ConfirmDialog-module__confirmText--NaqTy`};function Ze({open:n,onClose:r,onConfirm:i,title:a,message:o,confirmLabel:s=`Confirm`,cancelLabel:c=`Cancel`,tone:l=`default`,loading:u=!1,requireText:d}){let[f,p]=(0,e.useState)(``),m=d===void 0||f===d,h=l===`danger`;return(0,t.jsx)(qe,{open:n,onClose:()=>{u||(p(``),r())},role:`alertdialog`,size:`sm`,title:a,description:o,closeOnBackdrop:!u,closeOnEscape:!u,hideCloseButton:!0,footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y,{variant:`outline`,disabled:u,"data-autofocus":h?``:void 0,onClick:()=>{p(``),r()},children:c}),(0,t.jsx)(y,{variant:h?`danger`:`primary`,loading:u,disabled:!m,"data-autofocus":h?void 0:``,onClick:i,children:s})]}),children:d===void 0?null:(0,t.jsx)(`div`,{className:Xe.confirmText,children:(0,t.jsx)(K,{label:`Type ${d} to confirm`,value:f,disabled:u,autoComplete:`off`,placeholder:d,onChange:e=>p(e.target.value)})})})}var q={control:`cui-Select-module__control--OqOfI`,trigger:`cui-Select-module__trigger--ECKfC`,open:`cui-Select-module__open--PADOK`,value:`cui-Select-module__value--7CDNo`,placeholder:`cui-Select-module__placeholder--yUgBU`,sm:`cui-Select-module__sm--TPJwf`,md:`cui-Select-module__md--nOV6u`,lg:`cui-Select-module__lg--NGPOa`,chevron:`cui-Select-module__chevron--PLUsh`,clear:`cui-Select-module__clear--2OgzI`,invalid:`cui-Select-module__invalid--opDrx`,disabled:`cui-Select-module__disabled--8YgjS`,popover:`cui-Select-module__popover--VnWAu`,"cui-select-in":`cui-Select-module__cui-select-in--VGYFd`,top:`cui-Select-module__top--v5FSw`,"cui-select-in-top":`cui-Select-module__cui-select-in-top--fwYA4`,searchWrap:`cui-Select-module__searchWrap--YBOFZ`,search:`cui-Select-module__search--FrUXx`,list:`cui-Select-module__list--CI08p`,option:`cui-Select-module__option--Hvo8n`,optionLabel:`cui-Select-module__optionLabel--FGiUZ`,selected:`cui-Select-module__selected--8A13A`,highlighted:`cui-Select-module__highlighted--YIVPT`,optionDisabled:`cui-Select-module__optionDisabled--FhDw-`,check:`cui-Select-module__check--RxZrV`,empty:`cui-Select-module__empty--KmYrm`,spinner:`cui-Select-module__spinner--OxCAP`,"cui-select-spin":`cui-Select-module__cui-select-spin--MQqaM`},Qe=4,$e=280,et=500,tt=e=>Array.isArray(e)?e:e?[e]:[],nt=(0,e.forwardRef)(function({options:i,placeholder:a=`Select an option`,size:o=`md`,multiple:s=!1,clearable:c=!0,onSearch:l,loading:u=!1,emptyMessage:d=`No options found.`,listClassName:f,name:p,value:m,defaultValue:h,onChange:g,id:_,required:v,disabled:y,error:b,"aria-describedby":S,className:C,onKeyDown:w,onClick:T,...E},D){let O=x({id:_,required:v,disabled:y,error:b,"aria-describedby":S}),k=(0,e.useId)(),A=`${k}-list`,j=`${k}-value`,ee=e=>`${k}-option-${e}`,M=(0,e.useRef)(null),N=(0,e.useRef)(null),P=(0,e.useRef)(null),F=(0,e.useRef)(null),te=(0,e.useRef)(null),[I,L]=(0,e.useState)(!1),[R,ne]=(0,e.useState)(null),[re,z]=(0,e.useState)(``),[B,ie]=(0,e.useState)(!1),[V,ae]=(0,e.useState)(0),oe=m!==void 0,[se,ce]=(0,e.useState)(()=>tt(h)),H=oe?tt(m):se,le=(0,e.useCallback)(e=>{N.current=e,typeof D==`function`?D(e):D&&(D.current=e)},[D]),U=(0,e.useMemo)(()=>{if(l||!re)return i;let e=re.toLowerCase();return i.filter(t=>t.label.toLowerCase().includes(e))},[i,re,l]),ue=e=>{oe||ce(e),g?.(s?e:e[0]??``)},W=e=>{let t=e.findIndex(e=>!e.disabled);return t===-1?0:t},G=(0,e.useCallback)(()=>{let e=M.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<$e&&t.top>n?`top`:`bottom`,i={left:t.left,width:t.width};r===`bottom`?i.top=t.bottom+Qe:i.bottom=window.innerHeight-t.top+Qe,ne({style:i,placement:r})},[]),de=()=>{if(O.disabled)return;G(),z(``),ie(!1);let e=i.findIndex(e=>H.includes(e.value));ae(e===-1?W(i):e),L(!0)},fe=(e=!0)=>{L(!1),e&&N.current?.focus({preventScroll:!0})},pe=e=>{e.disabled||(s?ue(H.includes(e.value)?H.filter(t=>t!==e.value):[...H,e.value]):(ue([e.value]),fe()),z(``),ie(!1))},me=e=>{if(!U.length)return;let t=V;for(let n=0;n<U.length&&(t=(t+e+U.length)%U.length,U[t]?.disabled);n++);ae(t)};(0,e.useEffect)(()=>{I&&F.current?.focus({preventScroll:!0})},[I]),(0,e.useEffect)(()=>{B&&te.current?.focus({preventScroll:!0})},[B]);let he=(0,e.useRef)(l);(0,e.useEffect)(()=>{he.current=l},[l]),(0,e.useEffect)(()=>{if(!I||!he.current)return;let e=setTimeout(()=>he.current?.(re),et);return()=>clearTimeout(e)},[re,I]),(0,e.useEffect)(()=>{if(!I)return;let e=()=>requestAnimationFrame(G);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[I,G]),(0,e.useEffect)(()=>{if(!I)return;let e=e=>{let t=e.target;!M.current?.contains(t)&&!P.current?.contains(t)&&L(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[I]),(0,e.useEffect)(()=>{if(!I)return;let e=F.current,t=e?.children[V];e&&t&&(t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+t.offsetHeight>e.scrollTop+e.clientHeight&&(e.scrollTop=t.offsetTop+t.offsetHeight-e.clientHeight))},[V,I]);let ge=e=>{w?.(e),!e.defaultPrevented&&!I&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),de())},_e=e=>{switch(e.key){case`Escape`:e.preventDefault(),e.stopPropagation(),fe();return;case`ArrowDown`:e.preventDefault(),me(1);return;case`ArrowUp`:e.preventDefault(),me(-1);return;case`Home`:if(B)return;e.preventDefault(),ae(W(U));return;case`End`:if(B)return;e.preventDefault(),ae(Math.max(U.length-1,0));return;case`Enter`:e.preventDefault(),e.stopPropagation(),U[V]&&pe(U[V]);return;case`Tab`:L(!1),N.current?.focus({preventScroll:!0});return;case` `:if(B)return;e.preventDefault(),U[V]&&pe(U[V]);return}let t=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;!B&&t&&(e.preventDefault(),z(e.key),ae(0),ie(!0))},ve=i.filter(e=>H.includes(e.value)),ye=H.length>0,be=H.length>1?`${H.length} selected`:ve[0]?.label??a,xe=c&&ye&&!O.disabled,K=I?M.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`):void 0,Se=I&&U[V]?ee(V):void 0,Ce=O.labelId?`${O.labelId} ${j}`:void 0;return(0,t.jsxs)(`div`,{ref:M,className:r(q.control,q[o],O.invalid&&q.invalid,O.disabled&&q.disabled,I&&q.open,C),children:[(0,t.jsx)(`button`,{...E,ref:le,id:O.id,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":I,"aria-controls":I?A:void 0,"aria-labelledby":Ce,"aria-invalid":O[`aria-invalid`],"aria-describedby":O[`aria-describedby`],"aria-required":O.required||void 0,disabled:O.disabled,className:r(q.trigger,!ve.length&&q.placeholder),onClick:e=>{T?.(e),!e.defaultPrevented&&(I?fe(!1):de())},onKeyDown:ge,children:(0,t.jsx)(`span`,{id:j,className:q.value,children:be})}),xe?(0,t.jsx)(`button`,{type:`button`,className:q.clear,"aria-label":`Clear selection`,onClick:()=>{ue([]),N.current?.focus({preventScroll:!0})},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})}):null,(0,t.jsx)(`svg`,{className:q.chevron,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M5 7.5l5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),p?H.length>0?H.map(e=>(0,t.jsx)(`input`,{type:`hidden`,name:p,value:e},e)):!s&&(0,t.jsx)(`input`,{type:`hidden`,name:p,value:``}):null,I&&R?(0,n.createPortal)((0,t.jsxs)(`div`,{ref:P,className:r(q.popover,q[R.placement]),style:R.style,"data-theme":K??void 0,onKeyDown:_e,children:[B?(0,t.jsx)(`div`,{className:q.searchWrap,children:(0,t.jsx)(`input`,{ref:te,type:`text`,className:q.search,placeholder:`Search options...`,"aria-label":`Search options`,"aria-controls":A,"aria-activedescendant":Se,autoComplete:`off`,value:re,onChange:e=>{let t=e.target.value;z(t),ae(0),t===``&&(ie(!1),F.current?.focus({preventScroll:!0}))}})}):null,(0,t.jsx)(`ul`,{ref:F,id:A,role:`listbox`,tabIndex:-1,"aria-labelledby":Ce,"aria-multiselectable":s||void 0,"aria-activedescendant":B?void 0:Se,className:r(q.list,f),children:U.length>0?U.map((e,n)=>{let i=H.includes(e.value);return(0,t.jsxs)(`li`,{id:ee(n),role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,className:r(q.option,i&&q.selected,n===V&&q.highlighted,e.disabled&&q.optionDisabled),onMouseEnter:()=>!e.disabled&&ae(n),onClick:()=>pe(e),children:[(0,t.jsx)(`span`,{className:q.optionLabel,children:e.label}),i?(0,t.jsx)(`svg`,{className:q.check,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4.5 10.5l3.5 3.5 7.5-8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}):null]},e.value)}):(0,t.jsx)(`li`,{className:q.empty,role:`presentation`,children:u?(0,t.jsx)(`span`,{className:q.spinner,role:`status`,"aria-label":`Loading`}):d})})]}),document.body):null]})}),rt=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){if(!h())return(0,t.jsx)(_,{});let a=r;return!e&&!n&&!r.error?(0,t.jsx)(nt,{...a,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(nt,{...a,ref:i})})});function it(e,t,n=1,r=1){let i=Math.max(0,Math.floor(t));if(i===0)return[];let a=Math.min(Math.max(1,Math.floor(e)),i),o=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),s=o(1,Math.min(r,i)),c=o(Math.max(i-r+1,r+1),i),l=Math.max(Math.min(a-n,i-r-n*2-1),r+2),u=Math.min(Math.max(a+n,r+n*2+2),c.length>0?c[0]-2:i-1),d=[...s];return l>r+2?d.push(`ellipsis-start`):r+1<i-r&&d.push(r+1),d.push(...o(l,u)),u<i-r-1?d.push(`ellipsis-end`):i-r>r&&d.push(i-r),d.push(...c),d.filter((e,t)=>typeof e!=`number`||d.indexOf(e)===t)}var J={root:`cui-Pagination-module__root--ITRjt`,info:`cui-Pagination-module__info--4yuss`,summary:`cui-Pagination-module__summary--ZTggV`,pageSize:`cui-Pagination-module__pageSize--rDNL9`,pages:`cui-Pagination-module__pages--Fz8bC`,button:`cui-Pagination-module__button----Saq`,current:`cui-Pagination-module__current--Ca1M4`,ellipsis:`cui-Pagination-module__ellipsis--V294k`,split:`cui-Pagination-module__split--GnzEp`,splitLeft:`cui-Pagination-module__splitLeft--s3TPn`,splitCenter:`cui-Pagination-module__splitCenter--1Sosz`,splitRight:`cui-Pagination-module__splitRight--3gp2C`,joined:`cui-Pagination-module__joined--SDJ-W`,pageOf:`cui-Pagination-module__pageOf--pEVDE`,pageNumber:`cui-Pagination-module__pageNumber--rayzm`,first:`cui-Pagination-module__first--2Gg56`,prev:`cui-Pagination-module__prev--aNYld`,next:`cui-Pagination-module__next--QC3Z9`,last:`cui-Pagination-module__last--zJ-7Y`},at=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:e})});function ot({page:e,pageCount:n,onPageChange:i,siblingCount:a=1,boundaryCount:o=1,showFirstLast:s=!1,layout:c=`default`,pageSize:l,totalItems:u,pageSizeOptions:d,onPageSizeChange:f,disabled:p=!1,"aria-label":m=`Pagination`,className:g,...v}){if(!h())return(0,t.jsx)(_,{});let y=Math.max(1,n),b=Math.min(Math.max(1,e),y),x=it(b,y,a,o),S=e=>{!p&&e>=1&&e<=y&&e!==b&&i(e)},C=c===`split`,w=s||C,T=l!==void 0&&u!==void 0,E=u===0||!l?0:(b-1)*l+1,D=l&&u!==void 0?Math.min(b*l,u):0,O=d&&d.length>0&&f,k=T?(0,t.jsx)(`span`,{className:J.summary,children:C?`Showing ${E}-${D} of ${u} Rows`:`Showing ${E}-${D} of ${u}`}):null,A=O?(0,t.jsxs)(`div`,{className:J.pageSize,children:[(0,t.jsx)(`span`,{"aria-hidden":`true`,children:C?`Row Per Page`:`Rows per page`}),(0,t.jsx)(rt,{"aria-label":`Rows per page`,size:`sm`,clearable:!1,disabled:p,value:String(l??d[0]),options:d.map(e=>({label:String(e),value:String(e)})),onChange:e=>f(Number(e))})]}):null,j=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`ul`,{className:r(J.pages,C&&J.joined),children:[w?(0,t.jsx)(`li`,{className:J.first,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`First page`,disabled:p||b===1,onClick:()=>S(1),children:at(`M11 5l-5 5 5 5M15 5v10`)})}):null,(0,t.jsx)(`li`,{className:J.prev,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`Previous page`,disabled:p||b===1,onClick:()=>S(b-1),children:at(`M12 5l-5 5 5 5`)})}),x.map(e=>typeof e==`number`?(0,t.jsx)(`li`,{className:J.pageNumber,children:(0,t.jsx)(`button`,{type:`button`,className:r(J.button,e===b&&J.current),"aria-label":`Page ${e}`,"aria-current":e===b?`page`:void 0,disabled:p,onClick:()=>S(e),children:e})},e):(0,t.jsx)(`li`,{className:r(J.ellipsis,J.pageNumber),"aria-hidden":`true`,children:`…`},e)),(0,t.jsx)(`li`,{className:J.next,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`Next page`,disabled:p||b===y,onClick:()=>S(b+1),children:at(`M8 5l5 5-5 5`)})}),w?(0,t.jsx)(`li`,{className:J.last,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`Last page`,disabled:p||b===y,onClick:()=>S(y),children:at(`M9 5l5 5-5 5M5 5v10`)})}):null]}),C?(0,t.jsxs)(`span`,{className:J.pageOf,"aria-hidden":`true`,children:[`Page `,(0,t.jsx)(`strong`,{children:b}),` of `,y]}):null]});return C?(0,t.jsxs)(`nav`,{...v,"aria-label":m,className:r(J.root,J.split,g),children:[(0,t.jsx)(`div`,{className:J.splitLeft,children:A}),(0,t.jsx)(`div`,{className:J.splitCenter,children:j}),(0,t.jsx)(`div`,{className:J.splitRight,children:k})]}):(0,t.jsxs)(`nav`,{...v,"aria-label":m,className:r(J.root,g),children:[(0,t.jsxs)(`div`,{className:J.info,children:[k,A]}),j]})}var Y={container:`cui-Table-module__container--Kb-5q`,table:`cui-Table-module__table--Dkosn`,caption:`cui-Table-module__caption--9vU1I`,head:`cui-Table-module__head--nm9rX`,th:`cui-Table-module__th--PNuEx`,sorted:`cui-Table-module__sorted--PJE-z`,sortable:`cui-Table-module__sortable--W4c6P`,sortButton:`cui-Table-module__sortButton--V9clQ`,center:`cui-Table-module__center--kj838`,end:`cui-Table-module__end--eOUuQ`,sticky:`cui-Table-module__sticky--QfxLu`,td:`cui-Table-module__td--jv9tA`,start:`cui-Table-module__start--H-44v`,foot:`cui-Table-module__foot--0JhPm`,row:`cui-Table-module__row--DD8Km`,selected:`cui-Table-module__selected--DTjQs`,clickable:`cui-Table-module__clickable--B6Si-`,sortIcon:`cui-Table-module__sortIcon--V3-dH`,sortActive:`cui-Table-module__sortActive--4aqxc`,sortIdle:`cui-Table-module__sortIdle--ja3Xa`,flush:`cui-Table-module__flush--sZ9XS`},st=(0,e.forwardRef)(function({stickyHeader:e=!1,bordered:n=!0,containerClassName:i,scrollLabel:a,className:o,...s},c){return h()?(0,t.jsx)(`div`,{className:r(Y.container,!n&&Y.flush,i),tabIndex:0,role:`region`,"aria-label":a,children:(0,t.jsx)(`table`,{...s,ref:c,className:r(Y.table,e&&Y.sticky,o)})}):(0,t.jsx)(_,{})}),ct=(0,e.forwardRef)(function({className:e,...n},i){return(0,t.jsx)(`thead`,{...n,ref:i,className:r(Y.head,e)})}),lt=(0,e.forwardRef)(function({className:e,...n},r){return(0,t.jsx)(`tbody`,{...n,ref:r,className:e})}),ut=(0,e.forwardRef)(function({className:e,...n},i){return(0,t.jsx)(`tfoot`,{...n,ref:i,className:r(Y.foot,e)})}),dt=(0,e.forwardRef)(function({selected:e=!1,className:n,...i},a){return(0,t.jsx)(`tr`,{...i,ref:a,"data-selected":e||void 0,className:r(Y.row,e&&Y.selected,i.onClick&&Y.clickable,n)})}),ft=(0,e.forwardRef)(function({align:e=`start`,sortable:n=!1,sortDirection:i=null,onSort:a,className:o,children:s,scope:c=`col`,...l},u){let d=n?i===`asc`?`ascending`:i===`desc`?`descending`:`none`:void 0;return(0,t.jsx)(`th`,{...l,ref:u,scope:c,"aria-sort":d,className:r(Y.th,Y[e],n&&Y.sortable,n&&i&&Y.sorted,o),children:n?(0,t.jsxs)(`button`,{type:`button`,className:Y.sortButton,onClick:a,children:[s,(0,t.jsx)(`svg`,{className:r(Y.sortIcon,i?Y.sortActive:Y.sortIdle),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:i?3:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:i===`asc`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`path`,{d:`m5 12 7-7 7 7`}),(0,t.jsx)(`path`,{d:`M12 19V5`})]}):i===`desc`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`path`,{d:`M12 5v14`}),(0,t.jsx)(`path`,{d:`m19 12-7 7-7-7`})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`path`,{d:`m21 16-4 4-4-4`}),(0,t.jsx)(`path`,{d:`M17 20V4`}),(0,t.jsx)(`path`,{d:`m3 8 4-4 4 4`}),(0,t.jsx)(`path`,{d:`M7 4v16`})]})})]}):s})}),pt=(0,e.forwardRef)(function({align:e=`start`,className:n,...i},a){return(0,t.jsx)(`td`,{...i,ref:a,className:r(Y.td,Y[e],n)})}),mt=(0,e.forwardRef)(function({className:e,...n},i){return(0,t.jsx)(`caption`,{...n,ref:i,className:r(Y.caption,e)})}),ht={root:`cui-PageHeader-module__root--agDwp`,main:`cui-PageHeader-module__main--ePn-k`,back:`cui-PageHeader-module__back--L-i-M`,heading:`cui-PageHeader-module__heading--tWgg0`,title:`cui-PageHeader-module__title--mv-ab`,subtitle:`cui-PageHeader-module__subtitle--NHWmM`,actions:`cui-PageHeader-module__actions--6XyFL`};function gt({title:e,subtitle:n,onBack:i,backLabel:a=`Go back`,actions:o,className:s,...c}){return h()?(0,t.jsxs)(`header`,{...c,className:r(ht.root,s),children:[(0,t.jsxs)(`div`,{className:ht.main,children:[i?(0,t.jsx)(`button`,{type:`button`,className:ht.back,"aria-label":a,onClick:i,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`m12 19-7-7 7-7M19 12H5`})})}):null,(0,t.jsxs)(`div`,{className:ht.heading,children:[(0,t.jsx)(`h1`,{className:ht.title,children:e}),n?(0,t.jsx)(`p`,{className:ht.subtitle,children:n}):null]})]}),o?(0,t.jsx)(`div`,{className:ht.actions,children:o}):null]}):(0,t.jsx)(_,{})}var _t={pill:`cui-StatusPill-module__pill--kySDR`,label:`cui-StatusPill-module__label--tqHM5`,dot:`cui-StatusPill-module__dot--pfXRR`,pulse:`cui-StatusPill-module__pulse--UHRQO`,"cui-status-pulse":`cui-StatusPill-module__cui-status-pulse--Li6eg`,success:`cui-StatusPill-module__success--gn6ct`,info:`cui-StatusPill-module__info--hBiaf`,danger:`cui-StatusPill-module__danger--G-Lnk`,warning:`cui-StatusPill-module__warning--9shGi`,neutral:`cui-StatusPill-module__neutral--FL7Kb`,empty:`cui-StatusPill-module__empty--78LZC`},vt={active:`success`,completed:`info`,expired:`danger`,cancelled:`danger`,canceled:`danger`,pending:`warning`};function yt({status:e,tone:n,className:i,...a}){if(!e)return(0,t.jsx)(`span`,{className:_t.empty,children:`—`});let o=e.trim().toLowerCase(),s=n??vt[o]??`neutral`,c=s===`success`||o===`completed`;return(0,t.jsxs)(`span`,{className:r(_t.pill,_t[s],i),...a,children:[(0,t.jsx)(`span`,{className:r(_t.dot,c&&_t.pulse),"aria-hidden":`true`}),(0,t.jsx)(`span`,{className:_t.label,children:e})]})}var bt={root:`cui-Checkbox-module__root--mY3qk`,label:`cui-Checkbox-module__label--cwRtI`,disabled:`cui-Checkbox-module__disabled--x7-eg`,input:`cui-Checkbox-module__input--2kt-h`,box:`cui-Checkbox-module__box--OCPee`,check:`cui-Checkbox-module__check--4HYWn`,dash:`cui-Checkbox-module__dash--5Dkdl`,invalid:`cui-Checkbox-module__invalid---Cs7q`,text:`cui-Checkbox-module__text--EmtRj`,required:`cui-Checkbox-module__required--t9DLN`,message:`cui-Checkbox-module__message--ZPKsV`,helper:`cui-Checkbox-module__helper--16DrX`,error:`cui-Checkbox-module__error--E-bmD`},xt=(0,e.forwardRef)(function({label:n,helperText:i,error:a,indeterminate:o=!1,id:s,required:c,disabled:l,"aria-describedby":u,className:d,...f},p){let m=(0,e.useRef)(null),g=(0,e.useCallback)(e=>{m.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]);(0,e.useEffect)(()=>{m.current&&(m.current.indeterminate=o)},[o]);let v=x({id:s,required:c,disabled:l,error:a,"aria-describedby":u});if(!h())return(0,t.jsx)(_,{});let y=`${v.id}-message`,b=!!(a||i),S=[v[`aria-describedby`],b?y:void 0].filter(Boolean).join(` `)||void 0;return(0,t.jsxs)(`div`,{className:r(bt.root,d),children:[(0,t.jsxs)(`label`,{className:r(bt.label,v.disabled&&bt.disabled),children:[(0,t.jsx)(`input`,{...f,ref:g,id:v.id,type:`checkbox`,required:v.required,disabled:v.disabled,"aria-invalid":v[`aria-invalid`],"aria-describedby":S,className:r(bt.input,v.invalid&&bt.invalid)}),(0,t.jsxs)(`span`,{className:bt.box,"aria-hidden":`true`,children:[(0,t.jsx)(`svg`,{className:bt.check,viewBox:`0 0 20 20`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4.5 10.5l3.5 3.5 7.5-8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,t.jsx)(`svg`,{className:bt.dash,viewBox:`0 0 20 20`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M5 10h10`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`})})]}),n?(0,t.jsxs)(`span`,{className:bt.text,children:[n,v.required?(0,t.jsx)(`span`,{className:bt.required,"aria-hidden":`true`,children:`*`}):null]}):null]}),b?(0,t.jsx)(`p`,{id:y,className:r(bt.message,a?bt.error:bt.helper),role:a?`alert`:void 0,children:a||i}):null]})}),St={root:`cui-DropdownMenu-module__root--5ZetV`,trigger:`cui-DropdownMenu-module__trigger--9fhIT`,open:`cui-DropdownMenu-module__open--tByXu`,custom:`cui-DropdownMenu-module__custom--Ow9rI`,menu:`cui-DropdownMenu-module__menu---RiRW`,"cui-dropdown-in":`cui-DropdownMenu-module__cui-dropdown-in--pvAgp`,item:`cui-DropdownMenu-module__item--T-QPZ`,danger:`cui-DropdownMenu-module__danger--C0jN3`,label:`cui-DropdownMenu-module__label--6yP76`,icon:`cui-DropdownMenu-module__icon--zOP3d`},Ct=4,wt=192,Tt=200,Et=`[role="menuitem"]:not([aria-disabled="true"])`;function Dt({items:i,position:a=`right`,label:o=`More actions`,children:s,onOpenChange:c,disabled:l=!1,className:u}){let d=h(),f=`${(0,e.useId)()}-menu`,p=(0,e.useRef)(null),m=(0,e.useRef)(null),[g,v]=(0,e.useState)(!1),[y,b]=(0,e.useState)(null),[x,S]=(0,e.useState)(),[C,w]=(0,e.useState)(0),T=(0,e.useCallback)(()=>{let e=p.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<Tt&&t.top>n?{bottom:window.innerHeight-t.top+Ct}:{top:t.bottom+Ct},i=t.left+wt<=window.innerWidth-8;a===`right`&&i?r.left=t.left:r.right=Math.max(8,window.innerWidth-t.right),b(r)},[a]),E=e=>{v(e),c?.(e)},D=()=>{l||(T(),S(p.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),E(!0))},O=(e=!0)=>{E(!1),e&&w(e=>e+1)};if((0,e.useEffect)(()=>{C>0&&p.current?.focus({preventScroll:!0})},[C]),(0,e.useEffect)(()=>{g&&m.current?.querySelector(Et)?.focus({preventScroll:!0})},[g]),(0,e.useEffect)(()=>{if(!g)return;let e=()=>requestAnimationFrame(T),t=e=>{let t=e.target;!p.current?.contains(t)&&!m.current?.contains(t)&&(v(!1),c?.(!1))};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[g,T,c]),!d)return(0,t.jsx)(_,{});let k=e=>{let t=Array.from(m.current?.querySelectorAll(Et)??[]);if(t.length===0)return;let n=t.indexOf(document.activeElement);t[e===`first`?0:e===`last`?t.length-1:(n+e+t.length)%t.length]?.focus({preventScroll:!0})};return(0,t.jsxs)(`span`,{className:r(St.root,u),children:[(0,t.jsx)(`button`,{ref:p,type:`button`,className:r(St.trigger,g&&St.open,s!==void 0&&St.custom),"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?f:void 0,"aria-label":o,title:o,disabled:l,onClick:()=>g?O(!1):D(),onKeyDown:e=>{!g&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),D())},children:s??(0,t.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`10`,cy:`4`,r:`1.6`}),(0,t.jsx)(`circle`,{cx:`10`,cy:`10`,r:`1.6`}),(0,t.jsx)(`circle`,{cx:`10`,cy:`16`,r:`1.6`})]})}),g&&y?(0,n.createPortal)((0,t.jsx)(`div`,{ref:m,id:f,role:`menu`,"aria-label":o,className:St.menu,style:y,"data-theme":x,onKeyDown:e=>{let t={ArrowDown:()=>k(1),ArrowUp:()=>k(-1),Home:()=>k(`first`),End:()=>k(`last`),Escape:()=>O(),Tab:()=>O()}[e.key];t&&(e.key!==`Tab`&&(e.preventDefault(),e.stopPropagation()),t())},children:i.map((e,n)=>(0,t.jsxs)(`button`,{type:`button`,role:`menuitem`,tabIndex:-1,"aria-disabled":e.disabled||void 0,className:r(St.item,e.variant===`danger`&&St.danger),onClick:()=>{if(!e.disabled)try{e.onClick()}finally{O()}},children:[(0,t.jsx)(`span`,{className:St.label,children:e.label}),e.icon?(0,t.jsx)(`span`,{className:St.icon,"aria-hidden":`true`,children:e.icon}):null]},`${e.label}-${n}`))}),document.body):null]})}var Ot={root:`cui-Skeleton-module__root--qaX19`,"cui-skeleton-pulse":`cui-Skeleton-module__cui-skeleton-pulse--HzSoY`,rect:`cui-Skeleton-module__rect--do1uR`,text:`cui-Skeleton-module__text---A8IF`,circle:`cui-Skeleton-module__circle--DYcl8`};function kt({variant:e=`rect`,width:n,height:i,className:a,style:o,...s}){if(!h())return(0,t.jsx)(_,{});let c={width:n,height:i??(e===`circle`?n:void 0)};return(0,t.jsx)(`span`,{"aria-hidden":`true`,...s,className:r(Ot.root,Ot[e],a),style:{...c,...o}})}var X={root:`cui-DataTable-module__root--HvZz-`,toolbar:`cui-DataTable-module__toolbar--4lbQW`,tableArea:`cui-DataTable-module__tableArea--2IsW7`,scroll:`cui-DataTable-module__scroll--grEU0`,selectCell:`cui-DataTable-module__selectCell--yjLWA`,actionsColumn:`cui-DataTable-module__actionsColumn--6fXOt`,actions:`cui-DataTable-module__actions--1wPSm`,actionButton:`cui-DataTable-module__actionButton--ihRbN`,actionDanger:`cui-DataTable-module__actionDanger--CkExi`,actionText:`cui-DataTable-module__actionText--6T0WJ`,cellText:`cui-DataTable-module__cellText--1ji4z`,stateBox:`cui-DataTable-module__stateBox--O065C`,empty:`cui-DataTable-module__empty--s0Jz2`,emptyIcon:`cui-DataTable-module__emptyIcon--RgTU-`,errorCell:`cui-DataTable-module__errorCell--xz1j4`,errorIcon:`cui-DataTable-module__errorIcon--Wtuhr`,errorText:`cui-DataTable-module__errorText--Huxzu`,footer:`cui-DataTable-module__footer--1nvuh`,srOnly:`cui-DataTable-module__srOnly--oPO5S`,selectionBar:`cui-DataTable-module__selectionBar--EPNRt`,selectionCount:`cui-DataTable-module__selectionCount--6vKgz`,selectionDivider:`cui-DataTable-module__selectionDivider--Ye0rn`,bulkButton:`cui-DataTable-module__bulkButton--YxXgc`,bulkDanger:`cui-DataTable-module__bulkDanger--nRDT6`,selectionClear:`cui-DataTable-module__selectionClear--XAB0l`};function At({count:e,actions:n=[],onClear:i,className:a}){return e<=0?null:(0,t.jsxs)(`div`,{role:`region`,"aria-label":`Selection`,className:r(X.selectionBar,a),children:[(0,t.jsxs)(`span`,{className:X.selectionCount,"aria-live":`polite`,children:[e,` selected`]}),n.length>0?(0,t.jsx)(`span`,{className:X.selectionDivider,"aria-hidden":`true`}):null,n.map(e=>(0,t.jsxs)(y,{variant:`outline`,size:`sm`,className:r(X.bulkButton,e.variant===`danger`&&X.bulkDanger),disabled:e.disabled,onClick:e.onClick,children:[e.icon,e.label]},e.label)),(0,t.jsx)(`button`,{type:`button`,className:X.selectionClear,onClick:i,children:`Clear selection`})]})}function jt({field:e,value:n,onChange:r,label:i,ariaLabel:a,size:o=`md`,placeholder:s}){let c=i?{label:i}:{"aria-label":a??e.label};return e.type===`select`?(0,t.jsx)(rt,{...c,size:o,placeholder:s??e.placeholder??`Any ${e.label.toLowerCase()}`,options:e.options??[],value:n,onChange:r}):e.type===`date`?(0,t.jsx)(ce,{...c,size:o,placeholder:s??e.placeholder,value:n,onChange:r}):(0,t.jsx)(K,{...c,size:o,placeholder:s??e.placeholder,value:n,onChange:e=>r(e.target.value)})}var Z={root:`cui-TableFilters-module__root--zi-Kz`,bar:`cui-TableFilters-module__bar--B-b9P`,barEnd:`cui-TableFilters-module__barEnd--HPVWe`,search:`cui-TableFilters-module__search--QrMo-`,actions:`cui-TableFilters-module__actions--UnPiI`,filtersIcon:`cui-TableFilters-module__filtersIcon--XyAIP`,panelFooter:`cui-TableFilters-module__panelFooter--xaqMb`,count:`cui-TableFilters-module__count--5M3Un`,chips:`cui-TableFilters-module__chips--reWRQ`,chip:`cui-TableFilters-module__chip--QEswZ`,chipLabel:`cui-TableFilters-module__chipLabel--CzGgZ`,chipValue:`cui-TableFilters-module__chipValue---2oKH`,chipRemove:`cui-TableFilters-module__chipRemove--6xGcC`,clearAll:`cui-TableFilters-module__clearAll--wPJlE`,dynamic:`cui-TableFilters-module__dynamic--Y3yu6`,noFilters:`cui-TableFilters-module__noFilters--bCV6B`,rows:`cui-TableFilters-module__rows--Zj1HM`,row:`cui-TableFilters-module__row--smRHE`,rowField:`cui-TableFilters-module__rowField--n7iAh`,rowValue:`cui-TableFilters-module__rowValue--VTRCH`,rowRemove:`cui-TableFilters-module__rowRemove--ddRMK`},Mt=0,Nt=()=>Mt+=1;function Pt(e){return Object.entries(e).map(([e,t])=>({id:Nt(),key:e,value:t}))}function Ft(e){let t={};for(let n of e)n.key&&n.value.trim()!==``&&(t[n.key]=n.value);return t}function It({fields:e,rows:n,onChange:r}){let i=new Set(n.map(e=>e.key).filter(Boolean)),a=e.filter(e=>!i.has(e.key)),o=(e,t)=>r(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(`div`,{className:Z.dynamic,children:[n.length===0?(0,t.jsx)(`p`,{className:Z.noFilters,children:`No filters yet. Add one to narrow down the table.`}):(0,t.jsx)(`ul`,{className:Z.rows,children:n.map((a,s)=>{let c=e.find(e=>e.key===a.key),l=e.filter(e=>e.key===a.key||!i.has(e.key));return(0,t.jsxs)(`li`,{className:Z.row,"aria-label":`Filter ${s+1}`,children:[(0,t.jsx)(`div`,{className:Z.rowField,children:(0,t.jsx)(rt,{"aria-label":`Field for filter ${s+1}`,size:`sm`,clearable:!1,value:a.key,options:l.map(e=>({label:e.label,value:e.key})),onChange:e=>o(a.id,{key:e,value:``})})}),(0,t.jsx)(`div`,{className:Z.rowValue,children:c?(0,t.jsx)(jt,{field:c,value:a.value,size:`sm`,ariaLabel:`Value for ${c.label}`,onChange:e=>o(a.id,{value:e})},c.key):null}),(0,t.jsx)(`button`,{type:`button`,className:Z.rowRemove,"aria-label":`Delete ${c?.label??`empty`} filter`,onClick:()=>r(n.filter(e=>e.id!==a.id)),children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})})]},a.id)})}),(0,t.jsx)(y,{variant:`outline`,size:`sm`,disabled:a.length===0,onClick:()=>{let e=a[0];e&&r([...n,{id:Nt(),key:e.key,value:``}])},children:`+ Add filter`})]})}function Lt(e){return Object.fromEntries(Object.entries(e??{}).filter(([,e])=>e.trim()!==``))}function Rt(e,t){return e.type===`select`?e.options?.find(e=>e.value===t)?.label??t:t}function zt({fields:n,values:r,onApply:i,onClose:a,title:o}){let[s,c]=(0,e.useState)(()=>Pt(r));return(0,t.jsx)(Ye,{open:!0,onClose:a,title:o,description:`Add the filters you want to use.`,size:`sm`,footer:(0,t.jsxs)(`div`,{className:Z.panelFooter,children:[(0,t.jsx)(y,{variant:`outline`,disabled:s.length===0,onClick:()=>c([]),children:`Reset`}),(0,t.jsx)(y,{onClick:()=>{i(Ft(s)),a()},children:`Apply Filters`})]}),children:(0,t.jsx)(It,{fields:n,rows:s,onChange:c})})}function Bt({search:n=``,onSearchChange:i,searchPlaceholder:a=`Search...`,searchDelay:o=0,fields:s,values:c,onValuesChange:l,panelTitle:u=`Filters`,className:d}){let f=h(),[p,m]=(0,e.useState)(!1),[g,v]=(0,e.useState)(n),b=(0,e.useRef)(void 0),x=(0,e.useRef)(n);if(x.current!==n&&(x.current=n,n!==g&&v(n)),(0,e.useEffect)(()=>()=>clearTimeout(b.current),[]),!f)return(0,t.jsx)(_,{});let S=Lt(c),C=(s??[]).filter(e=>S[e.key]!==void 0),w=!!(s&&s.length>0&&l),T=e=>{v(e),clearTimeout(b.current),o>0?b.current=setTimeout(()=>i?.(e),o):i?.(e)};return(0,t.jsxs)(`div`,{className:r(Z.root,d),children:[(0,t.jsxs)(`div`,{className:Z.bar,children:[i?(0,t.jsx)(`div`,{className:Z.search,children:(0,t.jsx)(Te,{"aria-label":`Search`,placeholder:a,value:g,onChange:e=>T(e.target.value),onClear:()=>T(``)})}):null,(0,t.jsx)(`div`,{className:Z.barEnd,children:w?(0,t.jsxs)(y,{variant:`outline`,size:`sm`,"aria-haspopup":`dialog`,onClick:()=>m(!0),children:[(0,t.jsx)(`svg`,{className:Z.filtersIcon,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M3 5.5h14M5.5 10h9M8 14.5h4`})}),`Filters`,C.length>0?(0,t.jsx)(`span`,{className:Z.count,"aria-label":`${C.length} active`,children:C.length}):null]}):null})]}),C.length>0?(0,t.jsxs)(`ul`,{className:Z.chips,"aria-label":`Active filters`,children:[C.map(e=>(0,t.jsxs)(`li`,{className:Z.chip,children:[(0,t.jsxs)(`span`,{className:Z.chipLabel,children:[e.label,`:`]}),` `,(0,t.jsx)(`strong`,{className:Z.chipValue,children:Rt(e,S[e.key])}),(0,t.jsx)(`button`,{type:`button`,className:Z.chipRemove,"aria-label":`Remove filter ${e.label}`,onClick:()=>{let{[e.key]:t,...n}=S;l?.(n)},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})})]},e.key)),(0,t.jsx)(`li`,{children:(0,t.jsxs)(`button`,{type:`button`,className:Z.clearAll,onClick:()=>l?.({}),children:[(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4 10a6 6 0 106-6H7M7 1.5L4.5 4 7 6.5`})}),`Clear all`]})})]}):null,p&&w?(0,t.jsx)(zt,{fields:s??[],values:S,title:u,onApply:e=>l?.(e),onClose:()=>m(!1)}):null]})}function Vt(e,t){return e.accessor?e.accessor(t):t[String(e.accessorKey)]}var Ht=e=>e==null?``:e instanceof Date?e.toISOString():String(e);function Ut(e,t,n){let r=n.trim().toLowerCase();return r?e.filter(e=>t.some(t=>(t.searchValue?t.searchValue(e):Ht(Vt(t,e))).toLowerCase().includes(r))):e}function Wt(e,t,n){let r=Object.entries(n).filter(([,e])=>e.trim()!==``);return r.length===0?e:e.filter(e=>r.every(([n,r])=>{let i=t.find(e=>String(e.accessorKey)===n);if(!i)return!0;if(i.filterFn)return i.filterFn(e,r);let a=Ht(Vt(i,e));return i.filterType===`select`||i.filterType===`date`?a===r:a.toLowerCase().includes(r.trim().toLowerCase())}))}var Gt=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function Kt(e,t,n){if(!n)return e;let r=t.find(e=>String(e.accessorKey)===n.key);if(!r)return e;let i=e=>r.sortValue?r.sortValue(e):Vt(r,e),a=n.direction===`asc`?1:-1;return e.map((e,t)=>({row:e,index:t,value:i(e)})).sort((e,t)=>{let n=e.value===null||e.value===void 0||e.value===``,r=t.value===null||t.value===void 0||t.value===``;if(n||r)return n===r?e.index-t.index:n?1:-1;let i=typeof e.value==`number`&&typeof t.value==`number`?e.value-t.value:e.value instanceof Date&&t.value instanceof Date?e.value.getTime()-t.value.getTime():Gt.compare(Ht(e.value),Ht(t.value));return i===0?e.index-t.index:i*a}).map(e=>e.row)}function qt(e,t,n){let r=(Math.max(1,t)-1)*n;return e.slice(r,r+n)}function Jt(e,t){return!e||e.key!==t?{key:t,direction:`asc`}:e.direction===`asc`?{key:t,direction:`desc`}:null}var Yt=[10,15,20,50,100],Xt=async(e,t)=>await(await fetch(e,t)).json();function Zt(e){let t=/^https?:/i.test(e.fetchUrl)?e.fetchUrl:`${e.apiBaseUrl??``}${e.fetchUrl}`,n=[];e.search&&n.push(`searchText:${e.search}`),e.additionalFilter&&n.push(e.additionalFilter),e.sort&&(n.push(`orderByColumn:${e.sort.key}`),n.push(`orderBy:${e.sort.direction}`));for(let[t,r]of Object.entries(e.filters))r&&n.push(`${t}:${r}`);let r=new URLSearchParams;return r.append(`pageNo`,String(e.pageNo)),r.append(`pageSize`,String(e.pageSize)),n.length>0&&r.append(`filter`,n.join(`;`)),`${t}${t.includes(`?`)?`&`:`?`}${r.toString()}`}function Qt(e){let t=e.data,n=Array.isArray(t)?t:t?.items??t??[],r=Array.isArray(t)?{}:t??{};return{rows:Array.isArray(n)?n:[],totalPages:r.totalPage??0,totalItems:r.totalData??0}}var $t=class extends Error{};async function en(e,t){let n=await t(e,{method:`GET`});if(n.status===!1)throw new $t(n.message||`Failed to fetch data`);return Qt(n)}async function tn(e,t){let n=[],r=1,i;do{let a=await en(e(r,100),t);n.push(...a.rows),i=a.totalPages||1,r+=1}while(r<=i&&r<=100);return n}function nn(t,n){let[r,i]=(0,e.useState)(t);return(0,e.useEffect)(()=>{if(n<=0)return;let e=setTimeout(()=>i(t),n);return()=>clearTimeout(e)},[t,n]),n<=0?t:r}var rn=[128,80,96],an=e=>e===`left`?`start`:e===`right`?`end`:e,on=(0,t.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,t.jsx)(`path`,{d:`M12 7.5v5M12 16h.01`})]}),sn=(0,t.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`5`,rx:`1`}),(0,t.jsx)(`path`,{d:`M5 9v9a1 1 0 001 1h12a1 1 0 001-1V9M10 13h4`})]});function cn({columns:n,data:i,fetchUrl:a,apiBaseUrl:o,callApi:s=Xt,additionalFilter:c,refreshTrigger:l,debounceMs:u,registerApi:d,getRowId:f,loading:p=!1,loadingRows:m=5,emptyMessage:g,emptyState:v,searchable:b=!0,searchPlaceholder:x,search:S,defaultSearch:C=``,onSearchChange:w,filters:T,defaultFilters:E,onFiltersChange:D,manualFiltering:O=!1,sort:k,defaultSort:A=null,onSortChange:j,manualSorting:ee=!1,pagination:M,page:N,defaultPage:P=1,onPageChange:F,pageSize:te,defaultPageSize:I=10,onPageSizeChange:L,pageSizeOptions:R=Yt,manualPagination:ne=!1,totalItems:re,selection:z,onRowClick:B,actions:ie,actionsClassName:V,belowToolbar:ae,bulkActions:oe,caption:se,stickyHeader:ce=!0,className:H,tableClassName:le,containerClassName:U,"aria-label":ue}){let W=h(),G=a!==void 0,de=M??!0,[fe,pe]=(0,e.useState)(C),[me,he]=(0,e.useState)(E??{}),[ge,_e]=(0,e.useState)(A),[ve,ye]=(0,e.useState)(P),[be,xe]=(0,e.useState)(I),K=S??fe,Se=T??me,Ce=k===void 0?ge:k,we=te??be,Te=N??ve,Ee=(0,e.useMemo)(()=>n.filter(e=>e.filterable).map(e=>({key:String(e.accessorKey),label:typeof e.header==`string`?e.header:String(e.accessorKey),type:e.filterType??`text`,options:e.filterOptions})),[n]),De=()=>{Te!==1&&(N===void 0&&ye(1),F?.(1))},Oe=e=>{S===void 0&&pe(e),w?.(e),De()},ke=e=>{T===void 0&&he(e),D?.(e),De()},Ae=e=>{let t=Jt(Ce,e);k===void 0&&_e(t),j?.(t)},je=e=>{N===void 0&&ye(e),F?.(e)},Me=e=>{te===void 0&&xe(e),L?.(e),De()},Ne=u??(G?500:0),Pe=nn(K,Ne),Fe=nn(Se,Ne),Ie=JSON.stringify([a,o,c,l,de,Te,we,Ce,Pe,Fe]),[Le,Re]=(0,e.useState)(null);(0,e.useEffect)(()=>{if(!G)return;let e=!1,t=(e,t)=>Zt({fetchUrl:a,apiBaseUrl:o,pageNo:e,pageSize:t,search:Pe,additionalFilter:c,sort:Ce,filters:Fe});return(async()=>{try{if(de){let e=await en(t(Te,we),s);return{key:Ie,error:null,...e}}let e=await tn(t,s);return{key:Ie,error:null,rows:e,totalPages:0,totalItems:0}}catch(e){let t=e instanceof Error&&e.message?e.message:`An unexpected error occurred`;return{key:Ie,error:t,rows:[],totalPages:0,totalItems:0}}})().then(t=>{e||Re(t)}),()=>{e=!0}},[Ie]),(0,e.useEffect)(()=>{d?.({updateRow:(e,t)=>Re(n=>n&&{...n,rows:n.rows.map(n=>n.id===e?{...n,...t}:n)})})},[d]);let ze=G?Le?.key!==Ie:p,Be=G&&!ze?Le?.error??null:null,Ve=(0,e.useMemo)(()=>G?Le?.rows??[]:i??[],[G,Le,i]),He=G||O,Ue=(0,e.useMemo)(()=>{let e=Ve;return He||(e=Wt(Ut(e,n,K),n,Se)),G||ee||(e=Kt(e,n,Ce)),e},[Ve,n,K,Se,Ce,He,G,ee]);if(!W)return(0,t.jsx)(_,{});let We=G||ne,Ge=G?Le?.totalItems??0:ne?re??Ve.length:Ue.length,Ke=G?Math.max(1,Le?.totalPages??1):Math.max(1,Math.ceil(Ge/we)),qe=Math.min(Math.max(1,Te),Ke),Je=!de||We?Ue:qt(Ue,qe,we),Ye=(e,t)=>String(f?f(e,t):e.id??t),Xe=Je.map(Ye),Ze=z?.selected??[],q=Xe.filter(e=>Ze.includes(e)),Qe=Xe.length>0&&q.length===Xe.length,$e=q.length>0&&!Qe,et=()=>{z&&z.onChange(Qe?Ze.filter(e=>!Xe.includes(e)):[...new Set([...Ze,...Xe])])},tt=e=>{z&&z.onChange(Ze.includes(e)?Ze.filter(t=>t!==e):[...Ze,e])},nt=!!(ie&&ie.length>0),rt=b||Ee.length>0,it=K.trim()!==``||Object.values(Se).some(e=>e.trim()!==``),J=n.length+ +!!z+ +!!nt,at={onClick:e=>e.stopPropagation()},Y=g??`No data available`,ut=(e,t)=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),B?.(t))},ht=e=>{let n=(ie??[]).filter(t=>!t.hidden?.(e));if(n.length===0)return null;let i=e=>e.variant===`danger`;if(n.length===1){let a=n[0];return(0,t.jsx)(`button`,{type:`button`,className:r(X.actionButton,i(a)&&X.actionDanger),title:a.label,"aria-label":a.label,onClick:()=>a.onClick(e),children:a.icon??(0,t.jsx)(`span`,{className:X.actionText,children:a.label})})}return(0,t.jsx)(Dt,{items:n.map(t=>({label:t.label,icon:t.icon,variant:i(t)?`danger`:`default`,onClick:()=>t.onClick(e)}))})},gt=(0,t.jsx)(`div`,{className:X.tableArea,"aria-busy":ze||void 0,children:(0,t.jsxs)(st,{"aria-label":ue,scrollLabel:ue?`${ue} (scrollable)`:void 0,stickyHeader:ce,bordered:!1,className:le,containerClassName:r(X.scroll,U),children:[se?(0,t.jsx)(mt,{children:se}):null,(0,t.jsx)(ct,{children:(0,t.jsxs)(dt,{children:[z?(0,t.jsx)(ft,{className:X.selectCell,children:(0,t.jsx)(xt,{"aria-label":`Select all rows`,checked:Qe,indeterminate:$e,disabled:Xe.length===0||ze,onChange:et})}):null,n.map(e=>{let n=String(e.accessorKey);return(0,t.jsx)(ft,{align:an(e.align),sortable:e.sortable,sortDirection:Ce?.key===n?Ce.direction:null,onSort:()=>Ae(n),className:e.className,style:e.width===void 0?void 0:{width:e.width},children:e.header},n)}),nt?(0,t.jsx)(ft,{align:`center`,className:V??X.actionsColumn,children:`Actions`}):null]})}),(0,t.jsx)(lt,{children:Be?(0,t.jsx)(dt,{children:(0,t.jsx)(pt,{colSpan:J,className:X.errorCell,children:(0,t.jsxs)(`div`,{className:X.stateBox,role:`alert`,children:[(0,t.jsx)(`span`,{className:X.errorIcon,children:on}),(0,t.jsx)(`span`,{className:X.errorText,children:Be})]})})}):ze?Array.from({length:m},(e,n)=>(0,t.jsx)(dt,{children:Array.from({length:J},(e,n)=>(0,t.jsx)(pt,{align:nt&&n===J-1?`center`:void 0,children:nt&&n===J-1?(0,t.jsx)(kt,{width:32,height:32,style:{borderRadius:6,display:`inline-block`}}):(0,t.jsx)(kt,{variant:`text`,height:16,width:rn[n===0?0:n%2==0?2:1],style:{borderRadius:4}})},n))},`loading-${n}`)):Je.length===0?(0,t.jsx)(dt,{children:(0,t.jsx)(pt,{colSpan:J,className:X.empty,children:v??(0,t.jsxs)(`div`,{className:X.stateBox,children:[(0,t.jsx)(`span`,{className:X.emptyIcon,children:sn}),(0,t.jsx)(`span`,{children:it?`No results match your search or filters.`:Y}),it?(0,t.jsx)(y,{variant:`link`,size:`sm`,onClick:()=>{Oe(``),ke({})},children:`Clear search and filters`}):null]})})}):Je.map((e,r)=>{let i=Ye(e,r),a=Ze.includes(i);return(0,t.jsxs)(dt,{selected:a,onClick:B?()=>B(e):void 0,onKeyDown:B?t=>ut(t,e):void 0,tabIndex:B?0:void 0,children:[z?(0,t.jsx)(pt,{className:X.selectCell,...at,children:(0,t.jsx)(xt,{"aria-label":`Select row`,checked:a,onChange:()=>tt(i)})}):null,n.map(n=>{let r=Vt(n,e);return(0,t.jsx)(pt,{align:an(n.align),className:n.className,style:n.width===void 0?void 0:{width:n.width},children:n.render?n.render(r,e):(0,t.jsx)(`span`,{className:X.cellText,children:r==null?`-`:String(r)})},String(n.accessorKey))}),nt?(0,t.jsx)(pt,{align:`center`,className:V??X.actionsColumn,...at,children:(0,t.jsx)(`div`,{className:X.actions,children:ht(e)})}):null]},i)})})]})});return(0,t.jsxs)(`div`,{className:r(X.root,H),children:[rt?(0,t.jsx)(`div`,{className:X.toolbar,children:(0,t.jsx)(Bt,{search:b?K:void 0,onSearchChange:b?Oe:void 0,searchPlaceholder:x??`Search...`,fields:Ee,values:Se,onValuesChange:Ee.length>0?ke:void 0})}):null,z&&Ze.length>0?(0,t.jsx)(At,{count:Ze.length,actions:oe?.map(e=>({...e,onClick:()=>e.onClick(Ze)})),onClear:()=>z.onChange([])}):null,ae,gt,(0,t.jsx)(`div`,{role:`status`,className:X.srOnly,children:ze?`Loading`:Be?`Error`:`${Ge} ${Ge===1?`result`:`results`}`}),de?(0,t.jsx)(`div`,{className:X.footer,children:(0,t.jsx)(ot,{layout:`split`,page:qe,pageCount:Ke,onPageChange:je,pageSize:we,totalItems:Ge,pageSizeOptions:R,onPageSizeChange:Me,disabled:ze})}):null]})}function ln(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;let t=e/1048576;return`${t<10?t.toFixed(1):Math.round(t)} MB`}function un(e,t){let n=(t??``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(e.slice(0,-1)):i===e)}var dn=(e,t)=>e.name===t.name&&e.size===t.size&&e.lastModified===t.lastModified,fn=e=>`${e.name}-${e.size}-${e.lastModified}`,pn=e=>e.type.startsWith(`image/`),mn={backdrop:`cui-ImageCropper-module__backdrop--0zPLq`,dialog:`cui-ImageCropper-module__dialog--h13vH`,title:`cui-ImageCropper-module__title--ZWlWm`,frame:`cui-ImageCropper-module__frame--yTW8V`,circle:`cui-ImageCropper-module__circle--GRs32`,image:`cui-ImageCropper-module__image--vUaXt`,loading:`cui-ImageCropper-module__loading--rNK90`,zoom:`cui-ImageCropper-module__zoom--CIboz`,error:`cui-ImageCropper-module__error---SDrv`,actions:`cui-ImageCropper-module__actions--OC3A0`,cancel:`cui-ImageCropper-module__cancel--miwJS`,apply:`cui-ImageCropper-module__apply--9Ncg6`},hn=280,gn=4,_n=12,vn=e=>e===`image/png`?`png`:e===`image/webp`?`webp`:`jpg`;function yn({file:i,aspect:a,shape:o,outputWidth:s,outputType:c,outputQuality:l,title:u=`Crop photo`,theme:d,onApply:f,onCancel:p}){let m=(0,e.useId)(),h=(0,e.useRef)(null),[g,_]=(0,e.useState)(null),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(1),[S,C]=(0,e.useState)({x:0,y:0}),[w,T]=(0,e.useState)(!1),E=(0,e.useRef)(null),D=a>=1?hn:Math.round(hn*a),O=a>=1?Math.round(hn/a):hn;(0,e.useEffect)(()=>{let e=document.activeElement;return h.current?.focus({preventScroll:!0}),()=>e?.focus?.({preventScroll:!0})},[]),(0,e.useEffect)(()=>{let e,t=new Image;t.onload=()=>_({image:t,width:t.naturalWidth,height:t.naturalHeight}),t.onerror=()=>y(!0);try{e=URL.createObjectURL(i),t.src=e}catch{t.onerror?.(new Event(`error`))}return()=>{t.onload=null,t.onerror=null,e&&URL.revokeObjectURL(e)}},[i]);let k=g?Math.max(D/g.width,O/g.height):1,A=k*b,j=(e,t,n)=>{if(!g)return{x:0,y:0};let r=Math.max(0,(g.width*n-D)/2),i=Math.max(0,(g.height*n-O)/2);return{x:Math.min(r,Math.max(-r,e)),y:Math.min(i,Math.max(-i,t))}},ee=e=>{let t=Math.min(gn,Math.max(1,e));x(t),C(e=>j(e.x,e.y,k*t))},M=(e,t)=>C(n=>j(n.x+e,n.y+t,A)),N=e=>{e.currentTarget.setPointerCapture?.(e.pointerId),E.current={x:e.clientX,y:e.clientY,ox:S.x,oy:S.y}},P=e=>{let t=E.current;t&&C(j(t.ox+e.clientX-t.x,t.oy+e.clientY-t.y,A))},F=()=>{E.current=null},te=()=>{if(!g||w)return;T(!0);let e=Math.round(s),t=Math.max(1,Math.round(s/a)),n=document.createElement(`canvas`);n.width=e,n.height=t;let r=n.getContext(`2d`);if(!r){T(!1),y(!0);return}let o=(g.width*A-D)/2/A-S.x/A,u=(g.height*A-O)/2/A-S.y/A;r.imageSmoothingQuality=`high`,r.drawImage(g.image,o,u,D/A,O/A,0,0,e,t),n.toBlob(e=>{if(!e){T(!1),y(!0);return}let t=i.name.replace(/\.[^.]+$/,``)||`photo`,n=e.type||c;f(new File([e],`${t}.${vn(n)}`,{type:n,lastModified:Date.now()}))},c,l)},I=(0,t.jsx)(`div`,{className:mn.backdrop,"data-theme":d,children:(0,t.jsxs)(`div`,{ref:h,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m,tabIndex:-1,className:mn.dialog,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),p();return}if(e.key===`Tab`){let t=Array.from(h.current?.querySelectorAll(`button:not([disabled]), input, [tabindex="0"]`)??[]),n=t[0],r=t[t.length-1];if(!n||!r)return;e.shiftKey&&(document.activeElement===n||document.activeElement===h.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}},children:[(0,t.jsx)(`h2`,{id:m,className:mn.title,children:u}),v?(0,t.jsx)(`p`,{className:mn.error,role:`alert`,children:`This image could not be opened. Try a different file.`}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`div`,{className:r(mn.frame,o===`circle`&&mn.circle),style:{width:D,height:O},tabIndex:0,role:`group`,"aria-label":`Crop area. Drag, or use the arrow keys to move the photo and plus and minus to zoom.`,onPointerDown:N,onPointerMove:P,onPointerUp:F,onPointerCancel:F,onKeyDown:e=>{let t={ArrowLeft:[_n,0],ArrowRight:[-12,0],ArrowUp:[0,_n],ArrowDown:[0,-12]}[e.key];t?(e.preventDefault(),M(t[0],t[1])):e.key===`+`||e.key===`=`?(e.preventDefault(),ee(b+.1)):e.key===`-`?(e.preventDefault(),ee(b-.1)):e.key===`Enter`&&(e.preventDefault(),te())},children:g?(0,t.jsx)(`img`,{src:g.image.src,alt:``,draggable:!1,className:mn.image,style:{width:g.width*A,height:g.height*A,transform:`translate(calc(-50% + ${S.x}px), calc(-50% + ${S.y}px))`}}):(0,t.jsx)(`span`,{className:mn.loading,children:`Loading…`})}),(0,t.jsxs)(`label`,{className:mn.zoom,children:[(0,t.jsx)(`span`,{children:`Zoom`}),(0,t.jsx)(`input`,{type:`range`,min:1,max:gn,step:.01,value:b,disabled:!g,"aria-label":`Zoom`,onChange:e=>ee(Number(e.target.value))})]})]}),(0,t.jsxs)(`div`,{className:mn.actions,children:[(0,t.jsx)(`button`,{type:`button`,className:mn.cancel,onClick:p,children:`Cancel`}),(0,t.jsx)(`button`,{type:`button`,className:mn.apply,disabled:!g||w||v,onClick:te,children:w?`Saving…`:`Apply`})]})]})});return(0,n.createPortal)(I,document.body)}var Q={root:`cui-FileInput-module__root--UvQj-`,zone:`cui-FileInput-module__zone--KEX1g`,disabled:`cui-FileInput-module__disabled--uRez3`,dragging:`cui-FileInput-module__dragging--4Sxh9`,invalid:`cui-FileInput-module__invalid--2Qqgy`,tile:`cui-FileInput-module__tile--FgwD7`,addTile:`cui-FileInput-module__addTile--sQKX0`,fieldFace:`cui-FileInput-module__fieldFace--DCcJw`,input:`cui-FileInput-module__input--dBre-`,icon:`cui-FileInput-module__icon--5x7xh`,browseLink:`cui-FileInput-module__browseLink--Trbwz`,hint:`cui-FileInput-module__hint--2lRnS`,hintText:`cui-FileInput-module__hintText--QTvBs`,list:`cui-FileInput-module__list--TzN0u`,item:`cui-FileInput-module__item--ud4cx`,itemThumb:`cui-FileInput-module__itemThumb--HcBdl`,itemIcon:`cui-FileInput-module__itemIcon--qwa4y`,name:`cui-FileInput-module__name--INaW3`,size:`cui-FileInput-module__size--x3JyK`,remove:`cui-FileInput-module__remove--STMmH`,rejected:`cui-FileInput-module__rejected--Fu9ek`,buttonRow:`cui-FileInput-module__buttonRow--gdqos`,buttonFace:`cui-FileInput-module__buttonFace--ClnEW`,button:`cui-FileInput-module__button--i8fAu`,buttonIcon:`cui-FileInput-module__buttonIcon--di6dt`,summary:`cui-FileInput-module__summary--5T73u`,fieldValue:`cui-FileInput-module__fieldValue--dqK5-`,fieldPlaceholder:`cui-FileInput-module__fieldPlaceholder--HZAla`,browse:`cui-FileInput-module__browse--fpTZh`,imageRoot:`cui-FileInput-module__imageRoot--rYX4H`,circle:`cui-FileInput-module__circle--bmCto`,tileImage:`cui-FileInput-module__tileImage--olRdu`,tileEmpty:`cui-FileInput-module__tileEmpty--fY9QB`,overlay:`cui-FileInput-module__overlay--IC-qb`,imageSide:`cui-FileInput-module__imageSide--g8HVF`,removeText:`cui-FileInput-module__removeText--3kIrj`,gallery:`cui-FileInput-module__gallery--wpMjX`,thumbItem:`cui-FileInput-module__thumbItem--5BdfZ`,addItem:`cui-FileInput-module__addItem--gAv77`,thumbImage:`cui-FileInput-module__thumbImage--68iIu`,thumbFallback:`cui-FileInput-module__thumbFallback--EuLpR`,thumbName:`cui-FileInput-module__thumbName--1uZrH`,thumbRemove:`cui-FileInput-module__thumbRemove--jpxg4`},bn=()=>typeof URL<`u`&&typeof URL.createObjectURL==`function`;function xn(e){try{return URL.createObjectURL(e)}catch{return}}var Sn=({className:e})=>(0,t.jsx)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M12 16V4M7 9l5-5 5 5M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3`})}),Cn=({className:e})=>(0,t.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,t.jsx)(`circle`,{cx:`9`,cy:`10`,r:`1.5`}),(0,t.jsx)(`path`,{d:`M21 16l-5-5-8 8`})]}),wn=({className:e})=>(0,t.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`path`,{d:`M7 3h7l5 5v12a1 1 0 01-1 1H7a1 1 0 01-1-1V4a1 1 0 011-1z`}),(0,t.jsx)(`path`,{d:`M14 3v5h5`})]}),Tn=()=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})}),En=(0,e.forwardRef)(function({id:n,required:i,disabled:a,error:o,"aria-describedby":s,variant:c=`dropzone`,multiple:l,accept:u,maxSize:d,maxFiles:f,preview:p=!0,shape:m=`square`,aspectRatio:h=4/3,tileSize:g=128,crop:_=!0,cropOutputWidth:v,cropOutputType:y,cropOutputQuality:b,cropTitle:S,buttonLabel:C,placeholder:w=`No file chosen`,onFilesChange:T,className:E,...D},O){let k=x({id:n,required:i,disabled:a,error:o,"aria-describedby":s}),A=(0,e.useId)(),j=`${A}-hint`,ee=`${A}-rejected`,M=c===`image`||c===`gallery`,N=c===`gallery`?!0:c===`image`?!1:l??!1,P=u??(M?`image/*`:void 0),F=(0,e.useRef)(null),te=(0,e.useCallback)(e=>{F.current=e,typeof O==`function`?O(e):O&&(O.current=e)},[O]),[I,L]=(0,e.useState)([]),[R,ne]=(0,e.useState)([]),[re,z]=(0,e.useState)(!1),[B,ie]=(0,e.useState)(null),[V,ae]=(0,e.useState)({}),oe=(0,e.useRef)({});(0,e.useEffect)(()=>()=>{Object.values(oe.current).forEach(e=>URL.revokeObjectURL(e))},[]);let se=e=>{try{let t=new DataTransfer;e.forEach(e=>t.items.add(e)),F.current&&(F.current.files=t.files)}catch{}},ce=e=>{let t={};if(bn()){for(let n of e){let e=fn(n),r=oe.current[e];if(r)t[e]=r;else if(pn(n)){let r=xn(n);r&&(t[e]=r)}}for(let[e,n]of Object.entries(oe.current))t[e]||URL.revokeObjectURL(n)}oe.current=t,ae(t),L(e),se(e),T?.(e)},H=e=>{if(k.disabled||e.length===0)return;let t=[],n=[];for(let r of e)un(r,P)?d!==void 0&&r.size>d?t.push(`${r.name}: larger than ${ln(d)}`):n.push(r):t.push(`${r.name}: file type not accepted`);let r=n[0];if(c===`image`&&_&&r&&r.type!==`image/svg+xml`){ne(t),ie({file:r,theme:F.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0});return}let i;if(!N)i=n.length>0?[n[0]]:I;else{i=[...I];for(let e of n)i.some(t=>dn(t,e))||i.push(e);f!==void 0&&i.length>f&&(t.push(`You can add up to ${f} files`),i=i.slice(0,f))}ne(t),i.length!==I.length||i.some((e,t)=>e!==I[t])?ce(i):se(I)},le=e=>{H(Array.from(e.target.files??[]))},U=e=>{e.preventDefault(),z(!1),H(Array.from(e.dataTransfer.files))},ue=e=>{ne([]),ce(I.filter(t=>t!==e))},W=[P?`Accepted: ${P.split(`,`).map(e=>e.trim()).join(`, `)}`:null,d===void 0?null:`Max ${ln(d)} each`].filter(Boolean).join(` · `),G=[k[`aria-describedby`],W?j:void 0,R.length?ee:void 0].filter(Boolean).join(` `)||void 0,de=k.invalid||R.length>0,fe=()=>{k.disabled||F.current?.click()},pe={onDragEnter:e=>{e.preventDefault(),k.disabled||z(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||z(!1)},onDrop:U},me=(0,t.jsx)(`input`,{...D,ref:te,id:k.id,type:`file`,multiple:N,accept:P,required:k.required&&I.length===0,disabled:k.disabled,"aria-invalid":de?!0:void 0,"aria-describedby":G,className:Q.input,onChange:le,onClick:e=>e.stopPropagation()}),he=m===`rectangle`?Math.max(.2,h):1,ge=Math.round(g/he),_e=v??(m===`rectangle`?800:512),ve=r(de&&Q.invalid,k.disabled&&Q.disabled),ye=I.map(e=>e.name).join(`, `),be=(e,n)=>{let r=V[fn(e)];return r?(0,t.jsx)(`img`,{src:r,alt:``,className:n}):null},xe=I.length>0?(0,t.jsx)(`ul`,{className:Q.list,"aria-label":`Selected files`,children:I.map(e=>(0,t.jsxs)(`li`,{className:Q.item,children:[p&&V[fn(e)]?be(e,Q.itemThumb??``):(0,t.jsx)(wn,{className:Q.itemIcon}),(0,t.jsx)(`span`,{className:Q.name,children:e.name}),(0,t.jsx)(`span`,{className:Q.size,children:ln(e.size)}),(0,t.jsx)(`button`,{type:`button`,className:Q.remove,"aria-label":`Remove ${e.name}`,disabled:k.disabled,onClick:()=>ue(e),children:(0,t.jsx)(Tn,{})})]},fn(e)))}):null,K=W&&c!==`dropzone`?(0,t.jsx)(`span`,{id:j,className:Q.hintText,children:W}):null,Se;if(c===`button`)Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:Q.buttonRow,children:[(0,t.jsxs)(`div`,{className:r(Q.buttonFace,ve),onClick:fe,children:[me,(0,t.jsxs)(`span`,{className:Q.button,children:[(0,t.jsx)(Sn,{className:Q.buttonIcon}),C??(N?`Choose files`:`Choose file`)]})]}),(0,t.jsx)(`span`,{className:Q.summary,children:ye||w})]}),K,xe]});else if(c===`field`)Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:r(Q.fieldFace,ve),onClick:fe,children:[me,(0,t.jsx)(`span`,{className:r(Q.fieldValue,!ye&&Q.fieldPlaceholder),children:ye||w}),(0,t.jsx)(`span`,{className:Q.browse,children:`Browse`})]}),K,xe]});else if(c===`image`){let e=I[0],n=e?V[fn(e)]:void 0;Se=(0,t.jsxs)(`div`,{className:Q.imageRoot,children:[(0,t.jsxs)(`div`,{className:r(Q.tile,m===`circle`&&Q.circle,re&&Q.dragging,ve),style:{width:g,height:ge},onClick:fe,...pe,children:[me,n?(0,t.jsx)(`img`,{src:n,alt:e?.name??``,className:Q.tileImage}):(0,t.jsxs)(`span`,{className:Q.tileEmpty,children:[(0,t.jsx)(Cn,{className:Q.icon}),(0,t.jsx)(`span`,{children:e?e.name:`Upload photo`})]}),(0,t.jsx)(`span`,{className:Q.overlay,children:e?`Change`:`Choose`})]}),(0,t.jsxs)(`div`,{className:Q.imageSide,children:[e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`span`,{className:Q.name,children:e.name}),(0,t.jsx)(`span`,{className:Q.size,children:ln(e.size)}),(0,t.jsx)(`button`,{type:`button`,className:Q.removeText,disabled:k.disabled,onClick:()=>ue(e),children:`Remove image`})]}):null,K]})]})}else if(c===`gallery`){let e=f!==void 0&&I.length>=f;Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`ul`,{className:Q.gallery,"aria-label":`Selected images`,children:[I.map(e=>(0,t.jsxs)(`li`,{className:Q.thumbItem,children:[V[fn(e)]?be(e,Q.thumbImage??``):(0,t.jsx)(`span`,{className:Q.thumbFallback,children:(0,t.jsx)(wn,{className:Q.icon})}),(0,t.jsx)(`span`,{className:Q.thumbName,children:e.name}),(0,t.jsx)(`button`,{type:`button`,className:r(Q.remove,Q.thumbRemove),"aria-label":`Remove ${e.name}`,disabled:k.disabled,onClick:()=>ue(e),children:(0,t.jsx)(Tn,{})})]},fn(e))),e?null:(0,t.jsx)(`li`,{className:Q.addItem,children:(0,t.jsxs)(`div`,{className:r(Q.addTile,re&&Q.dragging,ve),onClick:fe,...pe,children:[me,(0,t.jsx)(Cn,{className:Q.icon}),(0,t.jsx)(`span`,{children:`Add images`})]})})]}),e?me:null,K]})}else Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:r(Q.zone,re&&Q.dragging,ve),onClick:fe,...pe,children:[me,(0,t.jsx)(Sn,{className:Q.icon}),(0,t.jsxs)(`span`,{className:Q.prompt,children:[(0,t.jsx)(`span`,{className:Q.browseLink,children:N?`Choose files`:`Choose a file`}),` `,`or drag and drop`]}),W?(0,t.jsx)(`span`,{id:j,className:Q.hint,children:W}):null]}),xe]});return(0,t.jsxs)(`div`,{className:r(Q.root,E),children:[Se,B?(0,t.jsx)(yn,{file:B.file,aspect:he,shape:m===`circle`?`circle`:`rect`,outputWidth:_e,outputType:y??([`image/png`,`image/jpeg`,`image/webp`].includes(B.file.type)?B.file.type:`image/png`),outputQuality:b,title:S,theme:B.theme,onApply:e=>{ie(null),ce([e]),F.current?.focus({preventScroll:!0})},onCancel:()=>{ie(null),se(I),F.current?.focus({preventScroll:!0})}}):null,R.length>0?(0,t.jsx)(`p`,{id:ee,className:Q.rejected,role:`alert`,children:R.join(`. `)}):null]})}),Dn=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?!e&&!n&&!r.error?(0,t.jsx)(En,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(En,{...r,ref:i})}):(0,t.jsx)(_,{})}),On={textarea:`cui-Textarea-module__textarea--Z-y6g`,invalid:`cui-Textarea-module__invalid--E88X-`,"resize-none":`cui-Textarea-module__resize-none---T499`,"resize-vertical":`cui-Textarea-module__resize-vertical--P4hRY`,"resize-horizontal":`cui-Textarea-module__resize-horizontal--htj2f`,"resize-both":`cui-Textarea-module__resize-both--wR4os`,readOnly:`cui-Textarea-module__readOnly--mI513`},kn=(0,e.forwardRef)(function({id:e,required:n,disabled:i,error:a,"aria-describedby":o,rows:s=3,resize:c=`vertical`,readOnly:l,className:u,...d},f){let p=x({id:e,required:n,disabled:i,error:a,"aria-describedby":o});return(0,t.jsx)(`textarea`,{...d,ref:f,id:p.id,rows:s,required:p.required,disabled:p.disabled,readOnly:l,"aria-invalid":p[`aria-invalid`],"aria-describedby":p[`aria-describedby`],className:r(On.textarea,On[`resize-${c}`],p.invalid&&On.invalid,l&&On.readOnly,u)})}),An=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?!e&&!n&&!r.error?(0,t.jsx)(kn,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(kn,{...r,ref:i})}):(0,t.jsx)(_,{})}),jn={root:`cui-Switch-module__root--Y5Ydi`,label:`cui-Switch-module__label--LrH7V`,disabled:`cui-Switch-module__disabled--2aZ0V`,input:`cui-Switch-module__input--5BPNu`,track:`cui-Switch-module__track--7ObdZ`,thumb:`cui-Switch-module__thumb---FTeK`,invalid:`cui-Switch-module__invalid--4QBSq`,required:`cui-Switch-module__required--cVb-Z`,message:`cui-Switch-module__message--fA-a5`,helper:`cui-Switch-module__helper--gZCYS`,error:`cui-Switch-module__error--OSPrU`},Mn=(0,e.forwardRef)(function({label:e,helperText:n,error:i,id:a,required:o,disabled:s,"aria-describedby":c,className:l,...u},d){let f=x({id:a,required:o,disabled:s,error:i,"aria-describedby":c});if(!h())return(0,t.jsx)(_,{});let p=`${f.id}-message`,m=!!(i||n),g=[f[`aria-describedby`],m?p:void 0].filter(Boolean).join(` `)||void 0;return(0,t.jsxs)(`div`,{className:r(jn.root,l),children:[(0,t.jsxs)(`label`,{className:r(jn.label,f.disabled&&jn.disabled),children:[(0,t.jsx)(`input`,{...u,ref:d,id:f.id,type:`checkbox`,role:`switch`,required:f.required,disabled:f.disabled,"aria-invalid":f[`aria-invalid`],"aria-describedby":g,className:r(jn.input,f.invalid&&jn.invalid)}),(0,t.jsx)(`span`,{className:jn.track,"aria-hidden":`true`,children:(0,t.jsx)(`span`,{className:jn.thumb})}),e?(0,t.jsxs)(`span`,{className:jn.text,children:[e,f.required?(0,t.jsx)(`span`,{className:jn.required,"aria-hidden":`true`,children:`*`}):null]}):null]}),m?(0,t.jsx)(`p`,{id:p,className:r(jn.message,i?jn.error:jn.helper),role:i?`alert`:void 0,children:i||n}):null]})}),Nn={root:`cui-Badge-module__root--5osNT`,dot:`cui-Badge-module__dot--i0c-G`,neutral:`cui-Badge-module__neutral--lulSm`,primary:`cui-Badge-module__primary--S0WCS`,success:`cui-Badge-module__success--u9JiS`,warning:`cui-Badge-module__warning--nsGp-`,danger:`cui-Badge-module__danger--PD2hz`,info:`cui-Badge-module__info--na6DQ`};function Pn({color:e=`neutral`,dot:n=!1,className:i,children:a,...o}){return h()?(0,t.jsxs)(`span`,{...o,className:r(Nn.root,Nn[e],i),children:[n?(0,t.jsx)(`span`,{className:Nn.dot,"aria-hidden":`true`}):null,a]}):(0,t.jsx)(_,{})}var Fn={root:`cui-Tabs-module__root---VKVI`,list:`cui-Tabs-module__list--qRVME`,tab:`cui-Tabs-module__tab--IdDYc`,selected:`cui-Tabs-module__selected--TxfYv`,icon:`cui-Tabs-module__icon--LYFix`,panel:`cui-Tabs-module__panel--08i9c`};function In({items:n,value:i,defaultValue:a,onValueChange:o,className:s,"aria-label":c,...l}){let u=(0,e.useId)(),d=(0,e.useRef)([]),f=n.find(e=>!e.disabled)?.value,[p,m]=(0,e.useState)(a??f);if(!h())return(0,t.jsx)(_,{});let g=i??p,v=n.findIndex(e=>e.value===g),y=n[v],b=e=>{i===void 0&&m(e),o?.(e)},x=(e,t)=>{let r=n.length,i=t===`first`?-1:t===`last`?r:e,a=t===`first`?1:t===`last`?-1:t;for(let e=0;e<r;e++){i=(i+a+r)%r;let e=n[i];if(e&&!e.disabled){b(e.value),d.current[i]?.focus();return}}},S=(e,t)=>{let n=getComputedStyle(e.currentTarget).direction===`rtl`,r=n?`ArrowLeft`:`ArrowRight`,i=n?`ArrowRight`:`ArrowLeft`;if(e.key===r)x(t,1);else if(e.key===i)x(t,-1);else if(e.key===`Home`)x(t,`first`);else if(e.key===`End`)x(t,`last`);else return;e.preventDefault()},C=e=>`${u}-tab-${e}`,w=e=>`${u}-panel-${e}`;return(0,t.jsxs)(`div`,{...l,className:r(Fn.root,s),children:[(0,t.jsx)(`div`,{role:`tablist`,"aria-label":c,className:Fn.list,children:n.map((e,n)=>{let i=n===v;return(0,t.jsxs)(`button`,{ref:e=>{d.current[n]=e},id:C(n),type:`button`,role:`tab`,"aria-selected":i,"aria-controls":i&&e.content!==void 0?w(n):void 0,tabIndex:i?0:-1,disabled:e.disabled,className:r(Fn.tab,i&&Fn.selected),onClick:()=>b(e.value),onKeyDown:e=>S(e,n),children:[e.icon?(0,t.jsx)(`span`,{className:Fn.icon,"aria-hidden":`true`,children:e.icon}):null,e.label]},e.value)})}),y&&y.content!==void 0?(0,t.jsx)(`div`,{role:`tabpanel`,id:w(v),"aria-labelledby":C(v),tabIndex:0,className:Fn.panel,children:y.content}):null]})}var Ln={root:`cui-FormSection-module__root--M70AE`,header:`cui-FormSection-module__header--xTDAF`,heading:`cui-FormSection-module__heading--QU0-u`,title:`cui-FormSection-module__title--cw5qX`,subtitle:`cui-FormSection-module__subtitle--cIB53`,divider:`cui-FormSection-module__divider--954nY`,fields:`cui-FormSection-module__fields--ALVzc`,columns2:`cui-FormSection-module__columns2--IgG6n`,columns3:`cui-FormSection-module__columns3--q-4XF`};function Rn({title:n,subtitle:i,children:a,columns:o=1,headingLevel:s=3,className:c,...l}){let u=(0,e.useId)(),d=!!(n||i);return h()?(0,t.jsxs)(`section`,{...l,"aria-labelledby":n?u:l[`aria-labelledby`],className:r(Ln.root,c),children:[d?(0,t.jsxs)(`div`,{className:Ln.header,children:[(0,t.jsxs)(`div`,{className:Ln.heading,children:[n?(0,e.createElement)(`h${s}`,{id:u,className:Ln.title},n):null,i?(0,t.jsx)(`p`,{className:Ln.subtitle,children:i}):null]}),(0,t.jsx)(`span`,{className:Ln.divider,"aria-hidden":`true`})]}):null,(0,t.jsx)(`div`,{className:r(Ln.fields,Ln[`columns${o}`]),children:a})]}):(0,t.jsx)(_,{})}var zn={root:`cui-Avatar-module__root--fXu-J`,xs:`cui-Avatar-module__xs--oSaLL`,sm:`cui-Avatar-module__sm--sZ2bk`,md:`cui-Avatar-module__md--Fdkbz`,lg:`cui-Avatar-module__lg--pTTUA`,xl:`cui-Avatar-module__xl--mW58F`,image:`cui-Avatar-module__image--ieqGp`,fallback:`cui-Avatar-module__fallback--BWBXY`,tone0:`cui-Avatar-module__tone0--NoD23`,tone1:`cui-Avatar-module__tone1--xFqRb`,tone2:`cui-Avatar-module__tone2--nxsRe`,tone3:`cui-Avatar-module__tone3--goa6z`,tone4:`cui-Avatar-module__tone4--g6kRy`,primary:`cui-Avatar-module__primary--HKPgn`},Bn=[zn.tone0,zn.tone1,zn.tone2,zn.tone3,zn.tone4];function Vn(e){let t=(e??``).trim().split(/\s+/).filter(Boolean);return t.length===0?``:((t[0]?.[0]??``)+(t.length>1?t[t.length-1]?.[0]??``:``)).toUpperCase()}function Hn(e){let t=e??``,n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)>>>0;return Bn[n%Bn.length]}function Un({name:n,src:i,size:a=`md`,tone:o=`auto`,className:s,...c}){let[l,u]=(0,e.useState)(null),d=!!i&&i!==l,f=Vn(n);return h()?(0,t.jsx)(`span`,{role:c[`aria-hidden`]?void 0:`img`,"aria-label":c[`aria-hidden`]||!n?void 0:n,...c,className:r(zn.root,zn[a],!d&&(o===`primary`?zn.primary:Hn(n)),s),children:d?(0,t.jsx)(`img`,{className:zn.image,src:i??void 0,alt:``,onError:()=>u(i??null)}):f?(0,t.jsx)(`span`,{"aria-hidden":`true`,children:f}):(0,t.jsxs)(`svg`,{className:zn.fallback,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`8`,r:`4`,fill:`currentColor`}),(0,t.jsx)(`path`,{d:`M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z`,fill:`currentColor`})]})}):(0,t.jsx)(_,{})}var $={root:`cui-AccountPanel-module__root--Twbp0`,rootSidebar:`cui-AccountPanel-module__rootSidebar--OMB7L`,contents:`cui-AccountPanel-module__contents--OFL-r`,triggerHeader:`cui-AccountPanel-module__triggerHeader--ib8Bi`,triggerOpen:`cui-AccountPanel-module__triggerOpen--NbT3m`,triggerSidebar:`cui-AccountPanel-module__triggerSidebar--FeaXc`,collapsed:`cui-AccountPanel-module__collapsed--c8z-m`,identityText:`cui-AccountPanel-module__identityText--eziAT`,triggerName:`cui-AccountPanel-module__triggerName--f56mY`,triggerRole:`cui-AccountPanel-module__triggerRole--KpeeO`,panel:`cui-AccountPanel-module__panel--PinlA`,"cui-account-in":`cui-AccountPanel-module__cui-account-in--QVNEb`,panelSidebar:`cui-AccountPanel-module__panelSidebar--EuGZh`,identity:`cui-AccountPanel-module__identity--lZRA7`,email:`cui-AccountPanel-module__email--Ze3OW`,avatarRing:`cui-AccountPanel-module__avatarRing--FQrz4`,avatarInner:`cui-AccountPanel-module__avatarInner--5ZfEz`,greeting:`cui-AccountPanel-module__greeting--am-j3`,role:`cui-AccountPanel-module__role--E9lrf`,pills:`cui-AccountPanel-module__pills--5gSce`,pill:`cui-AccountPanel-module__pill--vK7aC`,actionIcon:`cui-AccountPanel-module__actionIcon--oReIE`,externalIcon:`cui-AccountPanel-module__externalIcon--dJc16`,details:`cui-AccountPanel-module__details--MGxxd`,detailRow:`cui-AccountPanel-module__detailRow--VzvVD`,apps:`cui-AccountPanel-module__apps--KRMBA`,appsTitle:`cui-AccountPanel-module__appsTitle--mcvnH`,grid:`cui-AccountPanel-module__grid--KYmem`,app:`cui-AccountPanel-module__app--Dj--X`,tile:`cui-AccountPanel-module__tile--YKNda`,tonePrimary:`cui-AccountPanel-module__tonePrimary--lAexZ`,toneInfo:`cui-AccountPanel-module__toneInfo--yb-xj`,toneSuccess:`cui-AccountPanel-module__toneSuccess--XIJic`,toneWarning:`cui-AccountPanel-module__toneWarning--oz2d6`,toneDanger:`cui-AccountPanel-module__toneDanger--MP2rJ`,toneNeutral:`cui-AccountPanel-module__toneNeutral--diEHz`,appName:`cui-AccountPanel-module__appName--MJc25`,danger:`cui-AccountPanel-module__danger--t0t-L`,dangerAction:`cui-AccountPanel-module__dangerAction--jvJ7-`},Wn=8,Gn=12,Kn=352,qn=`a[href], button:not([disabled])`,Jn=({href:e,className:n,title:r,onClick:i,children:a})=>(0,t.jsx)(`a`,{href:e,className:n,title:r,onClick:i,children:a}),Yn={primary:$.tonePrimary,info:$.toneInfo,success:$.toneSuccess,warning:$.toneWarning,danger:$.toneDanger,neutral:$.toneNeutral};function Xn(){return(0,t.jsx)(`svg`,{className:$.externalIcon,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M8 5H5v10h10v-3M11 5h4v4M15 5l-7 7`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Zn({user:i,apps:a=[],actions:o=[],placement:s=`header`,collapsed:c=!1,appsTitle:l=`All Apps`,greeting:u=`Hi`,renderLink:d=Jn,className:f}){let p=s===`sidebar`,m=(0,e.useId)(),g=(0,e.useRef)(null),v=(0,e.useRef)(null),y=(0,e.useRef)(null),[b,x]=(0,e.useState)(!1),[S,C]=(0,e.useState)(null),[w,T]=(0,e.useState)(),E=()=>{let e=v.current;if(!e)return;let t=e.getBoundingClientRect();if(p){let e=Math.min(Kn,window.innerWidth-24);C({left:Math.max(Gn,Math.min(t.right+Wn,window.innerWidth-e-Gn)),bottom:Math.max(Gn,window.innerHeight-t.bottom)})}else C({top:t.bottom+Wn,right:Math.max(Gn,window.innerWidth-t.right)})},D=()=>{E(),T(g.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),x(!0)},O=()=>x(!1);(0,e.useEffect)(()=>{b&&y.current?.focus({preventScroll:!0})},[b]),(0,e.useEffect)(()=>{if(!b)return;let e=()=>requestAnimationFrame(E),t=e=>{let t=e.target;!g.current?.contains(t)&&!y.current?.contains(t)&&O()};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[b,p]);let k=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),O(),v.current?.focus({preventScroll:!0});return}if(e.key!==`Tab`)return;let t=Array.from(y.current?.querySelectorAll(qn)??[]),n=t[0],r=t[t.length-1];n&&r&&(e.shiftKey&&(document.activeElement===n||document.activeElement===y.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))};if(!h())return(0,t.jsx)(_,{});let A=i.name.trim().split(/\s+/)[0]??i.name,j=o.filter(e=>e.tone!==`danger`),ee=o.filter(e=>e.tone===`danger`),M=e=>{e.onClick?.(),O()},N=(0,t.jsxs)(`div`,{ref:y,id:m,role:`dialog`,"aria-label":`Account`,tabIndex:-1,className:r($.panel,p&&$.panelSidebar),style:S??void 0,"data-theme":w,onKeyDown:k,children:[(0,t.jsxs)(`div`,{className:$.identity,children:[i.email?(0,t.jsx)(`p`,{className:$.email,children:i.email}):null,(0,t.jsx)(`span`,{className:$.avatarRing,children:(0,t.jsx)(`span`,{className:$.avatarInner,children:(0,t.jsx)(Un,{name:i.name,src:i.avatarUrl,size:`xl`,tone:`primary`,"aria-hidden":`true`})})}),(0,t.jsxs)(`p`,{className:$.greeting,children:[u,`, `,A,`!`]}),i.role?(0,t.jsx)(`span`,{className:$.role,children:i.role}):null,j.length>0?(0,t.jsx)(`div`,{className:$.pills,children:j.map(e=>{let n=(0,t.jsxs)(t.Fragment,{children:[e.icon?(0,t.jsx)(`span`,{className:$.actionIcon,"aria-hidden":`true`,children:e.icon}):null,(0,t.jsx)(`span`,{children:e.label}),e.external?(0,t.jsx)(Xn,{}):null]});return e.href&&!e.disabled?e.external?(0,t.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,title:e.title,className:$.pill,onClick:()=>O(),children:n},e.id):(0,t.jsx)(`span`,{className:$.contents,children:d({href:e.href,className:$.pill??``,title:e.title,onClick:()=>O(),children:n})},e.id):(0,t.jsx)(`button`,{type:`button`,disabled:e.disabled,title:e.title,className:$.pill,onClick:()=>M(e),children:n},e.id)})}):null]}),i.details?.length?(0,t.jsx)(`dl`,{className:$.details,children:i.details.map(e=>(0,t.jsxs)(`div`,{className:$.detailRow,children:[(0,t.jsx)(`dt`,{children:e.label}),(0,t.jsx)(`dd`,{children:e.value})]},e.label))}):null,a.length>0?(0,t.jsxs)(`section`,{className:$.apps,"aria-label":l,children:[(0,t.jsx)(`p`,{className:$.appsTitle,children:l}),(0,t.jsx)(`div`,{className:$.grid,children:a.map(e=>{let n=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`span`,{className:r($.tile,Yn[e.tone??`primary`]),"aria-hidden":`true`,children:e.icon}),(0,t.jsx)(`span`,{className:$.appName,children:e.name})]});return e.current?(0,t.jsx)(`span`,{className:$.contents,children:d({href:e.url,className:$.app??``,title:e.description,onClick:()=>O(),children:n})},e.id):(0,t.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,title:e.description,className:$.app,children:n},e.id)})})]}):null,ee.length>0?(0,t.jsx)(`div`,{className:$.danger,children:ee.map(e=>(0,t.jsxs)(`button`,{type:`button`,disabled:e.disabled,title:e.title,className:$.dangerAction,onClick:()=>M(e),children:[e.icon?(0,t.jsx)(`span`,{className:$.actionIcon,"aria-hidden":`true`,children:e.icon}):null,e.label]},e.id))}):null]});return(0,t.jsxs)(`div`,{ref:g,className:r($.root,p&&$.rootSidebar,f),children:[(0,t.jsxs)(`button`,{ref:v,type:`button`,"aria-label":`Account: ${i.name}`,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":b?m:void 0,className:r(p?$.triggerSidebar:$.triggerHeader,p&&c&&$.collapsed,b&&$.triggerOpen),onClick:()=>b?O():D(),children:[(0,t.jsx)(Un,{name:i.name,src:i.avatarUrl,size:`sm`,tone:`primary`,"aria-hidden":`true`}),p&&!c?(0,t.jsxs)(`span`,{className:$.identityText,children:[(0,t.jsx)(`span`,{className:$.triggerName,children:i.name}),i.role?(0,t.jsx)(`span`,{className:$.triggerRole,children:i.role}):null]}):null]}),b&&S?(0,n.createPortal)(N,document.body):null]})}var Qn={root:`cui-Typography-module__root--PebSf`,h1:`cui-Typography-module__h1--pJqnF`,h2:`cui-Typography-module__h2--8YqGv`,h3:`cui-Typography-module__h3--DT-DL`,h4:`cui-Typography-module__h4--UsocF`,body:`cui-Typography-module__body--s-YlR`,bodySm:`cui-Typography-module__bodySm--RPpZ5`,caption:`cui-Typography-module__caption--K-n4O`,label:`cui-Typography-module__label---CGg4`,"color-default":`cui-Typography-module__color-default--U4Xg0`,"color-secondary":`cui-Typography-module__color-secondary--5wnuV`,"color-muted":`cui-Typography-module__color-muted--GLLRl`,"color-disabled":`cui-Typography-module__color-disabled--bBBVc`,"color-primary":`cui-Typography-module__color-primary--B-bVH`,"color-success":`cui-Typography-module__color-success--hXHcS`,"color-warning":`cui-Typography-module__color-warning---oLwA`,"color-danger":`cui-Typography-module__color-danger--sStkk`,"color-info":`cui-Typography-module__color-info--4uSt5`,"weight-normal":`cui-Typography-module__weight-normal--fFcMp`,"weight-medium":`cui-Typography-module__weight-medium--5RtTe`,"weight-semibold":`cui-Typography-module__weight-semibold--TDOgV`,"weight-bold":`cui-Typography-module__weight-bold--YahG3`,"align-start":`cui-Typography-module__align-start--mX51I`,"align-center":`cui-Typography-module__align-center--2Ng2u`,"align-end":`cui-Typography-module__align-end--6LwA3`,truncate:`cui-Typography-module__truncate--3B0O4`},$n={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,body:`p`,"body-sm":`p`,caption:`span`,label:`span`},er={h1:Qn.h1,h2:Qn.h2,h3:Qn.h3,h4:Qn.h4,body:Qn.body,"body-sm":Qn.bodySm,caption:Qn.caption,label:Qn.label};function tr({variant:n=`body`,as:i,color:a=`default`,weight:o,align:s,truncate:c=!1,className:l,...u}){return h()?(0,e.createElement)(i??$n[n],{...u,className:r(Qn.root,er[n],Qn[`color-${a}`],o&&Qn[`weight-${o}`],s&&Qn[`align-${s}`],c&&Qn.truncate,l)}):(0,t.jsx)(_,{})}var nr={root:`cui-ThemeToggle-module__root--k2-Go`,option:`cui-ThemeToggle-module__option--CngnC`,input:`cui-ThemeToggle-module__input--0nC-Q`,face:`cui-ThemeToggle-module__face--jX0TD`,icon:`cui-ThemeToggle-module__icon--N0Uj1`},rr={light:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,t.jsx)(`path`,{d:`M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4`})]}),dark:(0,t.jsx)(`path`,{d:`M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z`}),system:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`12`,rx:`2`}),(0,t.jsx)(`path`,{d:`M8 20h8M12 16v4`})]})},ir={light:`Light`,dark:`Dark`,system:`System`};function ar({modes:n=[`light`,`dark`,`system`],compact:i=!1,className:a,"aria-label":o=`Theme`,...s}){let{theme:c,setTheme:l}=Fe(),u=(0,e.useId)();return h()?(0,t.jsx)(`div`,{...s,role:`radiogroup`,"aria-label":o,className:r(nr.root,a),children:n.map(e=>{let n=ir[e]??e;return(0,t.jsxs)(`label`,{className:nr.option,title:i?n:void 0,children:[(0,t.jsx)(`input`,{type:`radio`,name:u,value:e,checked:c===e,onChange:()=>l(e),className:nr.input,"aria-label":i?n:void 0}),(0,t.jsxs)(`span`,{className:nr.face,children:[rr[e]?(0,t.jsx)(`svg`,{className:nr.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:rr[e]}):null,i?null:n]})]},e)})}):(0,t.jsx)(_,{})}exports.AccountPanel=Zn,exports.Avatar=Un,exports.Badge=Pn,exports.Button=y,exports.Checkbox=xt,exports.ConfirmDialog=Ze,exports.DataTable=cn,exports.DatePicker=ce,exports.DateTimePicker=fe,exports.Drawer=Ye,exports.DropdownMenu=Dt,exports.FileInput=Dn,exports.FormField=C,exports.FormSection=Rn,exports.Input=K,exports.Modal=qe,exports.MonthPicker=ge,exports.PageHeader=gt,exports.Pagination=ot,exports.PasswordInput=Ce,exports.SearchInput=Te,exports.Select=rt,exports.SelectionBar=At,exports.Skeleton=kt,exports.StatusPill=yt,exports.Switch=Mn,exports.Table=st,exports.TableBody=lt,exports.TableCaption=mt,exports.TableCell=pt,exports.TableFoot=ut,exports.TableHead=ct,exports.TableHeaderCell=ft,exports.TableRow=dt,exports.Tabs=In,exports.Textarea=An,exports.ThemeProvider=Pe,exports.ThemeToggle=ar,exports.Typography=tr,exports.cn=r,exports.formatFileSize=ln,exports.getInitials=Vn,exports.getPageItems=it,exports.setLicenseKey=d,exports.useFormFieldControl=x,exports.useTheme=Fe;
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react/jsx-runtime"),n=require("react-dom");function r(...e){return e.filter(Boolean).join(` `)}var i=`client-ui:`;function a(e){let t=i+e.trim(),n=3735928559,r=1103547991;for(let e=0;e<t.length;e++){let i=t.charCodeAt(e);n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(16).padStart(14,`0`)}var o=[`1cd9d9bd20471f`],s=``,c=new Set,l=!1,u=(0,e.createContext)(null);function d(e){s=e,l=!1,c.forEach(e=>e())}function f(e){return!e||!e.trim()?!1:o.includes(a(e))}var p=e=>(c.add(e),()=>{c.delete(e)}),m=()=>s;function h(){let t=(0,e.useContext)(u),n=(0,e.useSyncExternalStore)(p,m,m),r=f(t??n);return(0,e.useEffect)(()=>{r||l||(l=!0,console.error(`[client-ui] Missing or invalid license key. Components are disabled. Pass licenseKey to <ThemeProvider> or call setLicenseKey() once at app start.`))},[r]),r}var g={root:`cui-UnlicensedNotice-module__root--FdnRG`};function _(){return(0,t.jsx)(`span`,{role:`alert`,className:g.root,children:`client-ui: missing or invalid license key`})}var v={button:`cui-Button-module__button--2ZuB7`,sm:`cui-Button-module__sm--NhG0g`,md:`cui-Button-module__md--hH4h3`,lg:`cui-Button-module__lg--2plQf`,fullWidth:`cui-Button-module__fullWidth--36oJT`,primary:`cui-Button-module__primary--s1sM6`,secondary:`cui-Button-module__secondary--R0waJ`,outline:`cui-Button-module__outline--F5jq-`,ghost:`cui-Button-module__ghost--1KINV`,danger:`cui-Button-module__danger--V4fX8`,link:`cui-Button-module__link--Zt5hw`,spinner:`cui-Button-module__spinner--ZExvW`,spin:`cui-Button-module__spin--JvkZu`},y=(0,e.forwardRef)(function({variant:e=`primary`,size:n=`md`,loading:i=!1,fullWidth:a=!1,type:o=`button`,disabled:s,className:c,children:l,...u},d){return h()?(0,t.jsxs)(`button`,{...u,ref:d,type:o,disabled:s||i,"aria-busy":i||void 0,"data-variant":e,"data-size":n,className:r(v.button,v[e],v[n],a&&v.fullWidth,c),children:[i?(0,t.jsx)(`span`,{className:v.spinner,"aria-hidden":`true`}):null,l]}):(0,t.jsx)(_,{})}),b=(0,e.createContext)(null);function x(t){let n=(0,e.useContext)(b),r=(0,e.useId)(),i=n?.id??t.id??r,a=!!(t.required??n?.required),o=!!(t.disabled??n?.disabled),s=!!t.error||!!n?.invalid,c=[t[`aria-describedby`],n?.describedById].filter(Boolean).join(` `)||void 0;return{id:i,required:a,disabled:o,invalid:s,labelId:n?.labelId,"aria-invalid":s?!0:void 0,"aria-describedby":c}}var S={root:`cui-FormField-module__root--QkVj-`,label:`cui-FormField-module__label--98wVM`,labelDisabled:`cui-FormField-module__labelDisabled--I5V6c`,required:`cui-FormField-module__required--Erm4t`,message:`cui-FormField-module__message--FUq3k`,helper:`cui-FormField-module__helper--JuBZ6`,error:`cui-FormField-module__error--4SHKr`};function C({children:n,label:i,required:a=!1,helperText:o,error:s,disabled:c=!1,id:l,className:u,...d}){let f=(0,e.useId)(),p=l??f,m=!!s,g=m?`${p}-error`:o?`${p}-helper`:void 0,v=(0,e.useMemo)(()=>({id:p,describedById:g,labelId:i?`${p}-label`:void 0,required:a,disabled:c,invalid:m}),[p,g,i,a,c,m]);return h()?(0,t.jsx)(b.Provider,{value:v,children:(0,t.jsxs)(`div`,{...d,className:r(S.root,u),children:[i?(0,t.jsxs)(`label`,{id:`${p}-label`,htmlFor:p,className:r(S.label,c&&S.labelDisabled),children:[i,a?(0,t.jsx)(`span`,{className:S.required,"aria-hidden":`true`,children:`*`}):null]}):null,n,m?(0,t.jsx)(`p`,{id:g,className:r(S.message,S.error),role:`alert`,children:s}):o?(0,t.jsx)(`p`,{id:g,className:r(S.message,S.helper),children:o}):null]})}):(0,t.jsx)(_,{})}var w=(e,t=2)=>String(e).padStart(t,`0`),T=e=>`${w(e.getFullYear(),4)}-${w(e.getMonth()+1)}-${w(e.getDate())}`;function E(e){if(!e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let t=new Date(`${e}T12:00:00`);return Number.isFinite(t.getTime())&&T(t)===e?t:null}var D=()=>{let e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12)},O=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t,12);function k(e,t){let n=new Date(e.getFullYear(),e.getMonth()+t,1,12),r=new Date(n.getFullYear(),n.getMonth()+1,0,12).getDate();return new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),r),12)}var A=(e,t)=>!!(e&&t&&T(e)===T(t));function j(e,t){let n=new Date(e.getFullYear(),e.getMonth(),1,12),r=(n.getDay()-t+7)%7;return Array.from({length:42},(e,t)=>O(n,t-r))}function ee(e,t=D()){let n=E(e.min),r=E(e.max),i=T(t),a=new Set((e.disabledDates??[]).map(e=>e instanceof Date?T(e):E(e)?e:null).filter(e=>e!==null)),o=(e.disabledRanges??[]).map(e=>({from:E(e.from),to:E(e.to)})).filter(e=>e.from!==null&&e.to!==null).map(e=>({from:T(e.from),to:T(e.to)})),s=new Set(e.disabledDaysOfWeek??[]);return t=>{let c=T(t);return n&&c<T(n)||r&&c>T(r)||e.disablePast&&c<i||e.disableFuture&&c>i||a.has(c)||s.has(t.getDay())||o.some(e=>c>=e.from&&c<=e.to)?!0:e.isDateDisabled?.(t)??!1}}function M(e,t){if(!t(e))return e;for(let n=1;n<=366;n++){let r=O(e,n);if(!t(r))return r;let i=O(e,-n);if(!t(i))return i}return e}var N=e=>`${w(e.getFullYear(),4)}-${w(e.getMonth()+1)}`;function P(e){return!e||!/^\d{4}-\d{2}$/.test(e)?null:E(`${e}-01`)}function F(e,t=D()){let n=e.min&&P(e.min)?e.min:null,r=e.max&&P(e.max)?e.max:null,i=N(t),a=new Set((e.disabledMonths??[]).filter(e=>P(e)));return t=>{let o=N(t);return n&&o<n||r&&o>r||e.disablePast&&o<i||e.disableFuture&&o>i||a.has(o)?!0:e.isMonthDisabled?.(t)??!1}}var te=e=>`${T(e)}T${w(e.getHours())}:${w(e.getMinutes())}`;function I(e){let t=/^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::\d{2}(?:\.\d+)?)?$/.exec(e??``);if(!t)return null;let n=E(t[1]),r=Number(t[2]),i=Number(t[3]);return!n||r>23||i>59?null:new Date(n.getFullYear(),n.getMonth(),n.getDate(),r,i)}var L=(e,t,n)=>new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,n),R={root:`cui-Calendar-module__root--Nuha8`,header:`cui-Calendar-module__header--BPQQc`,title:`cui-Calendar-module__title--HmlTp`,nav:`cui-Calendar-module__nav--m7oVU`,titleButton:`cui-Calendar-module__titleButton--o056C`,day:`cui-Calendar-module__day--3Adk8`,cell:`cui-Calendar-module__cell--i93Lx`,footerButton:`cui-Calendar-module__footerButton--xlHWH`,weekdays:`cui-Calendar-module__weekdays--q0AWC`,grid:`cui-Calendar-module__grid--QMyQn`,selected:`cui-Calendar-module__selected--6Q-na`,outside:`cui-Calendar-module__outside--JWMZI`,today:`cui-Calendar-module__today--DNP-o`,cells:`cui-Calendar-module__cells--741gl`,active:`cui-Calendar-module__active--Moaen`,footer:`cui-Calendar-module__footer--Kkc3d`,footerPrimary:`cui-Calendar-module__footerPrimary--nNPYm`,currentCell:`cui-Calendar-module__currentCell--9oL2S`},ne=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:e===`left`?`M12 5l-5 5 5 5`:`M8 5l5 5-5 5`})});function re({selected:n,isDisabled:i,weekStartsOn:a,locale:o,onSelect:s,allowClear:c,showFooter:l=!0}){let u=D(),[d,f]=(0,e.useState)(()=>M(n??u,i)),[p,m]=(0,e.useState)(`days`),h=(0,e.useRef)(null),g=(0,e.useRef)(!0),_=(0,e.useMemo)(()=>new Intl.DateTimeFormat(o,{month:`long`}).format(d),[d,o]),v=(0,e.useMemo)(()=>Array.from({length:12},(e,t)=>new Intl.DateTimeFormat(o,{month:`short`}).format(new Date(2024,t,1))),[o]),y=(0,e.useMemo)(()=>{let e=new Date(2024,0,7+a);return Array.from({length:7},(t,n)=>{let r=O(e,n);return{short:new Intl.DateTimeFormat(o,{weekday:`short`}).format(r),long:new Intl.DateTimeFormat(o,{weekday:`long`}).format(r)}})},[o,a]),b=(0,e.useMemo)(()=>new Intl.DateTimeFormat(o,{dateStyle:`full`}),[o]),x=(0,e.useMemo)(()=>j(d,a),[d,a]),S=d.getFullYear(),C=Math.floor((S-1)/12)*12+1,w=T(d);(0,e.useEffect)(()=>{p===`days`&&g.current&&h.current?.querySelector(`[data-date="${w}"]`)?.focus({preventScroll:!0})},[w,p]);let E=e=>{g.current=!0,f(e)},ee=e=>{let t={ArrowLeft:()=>O(d,-1),ArrowRight:()=>O(d,1),ArrowUp:()=>O(d,-7),ArrowDown:()=>O(d,7),PageUp:()=>k(d,e.shiftKey?-12:-1),PageDown:()=>k(d,e.shiftKey?12:1),Home:()=>O(d,-((d.getDay()-a+7)%7)),End:()=>O(d,6-(d.getDay()-a+7)%7)}[e.key];t&&(e.preventDefault(),E(t()))},N=e=>{g.current=!1,f(t=>k(t,e*(p===`years`?144:p===`months`?12:1)))},P=p===`years`?`Previous 12 years`:p===`months`?`Previous year`:`Previous month`,F=p===`years`?`Next 12 years`:p===`months`?`Next year`:`Next month`;return(0,t.jsxs)(`div`,{className:R.root,children:[(0,t.jsxs)(`div`,{className:R.header,children:[(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":P,onClick:()=>N(-1),children:ne(`left`)}),(0,t.jsx)(`div`,{className:R.title,"aria-live":`polite`,children:p===`years`?(0,t.jsxs)(`span`,{children:[C,` - `,C+11]}):(0,t.jsxs)(t.Fragment,{children:[p===`days`?(0,t.jsx)(`button`,{type:`button`,className:R.titleButton,"aria-label":`Choose month`,onClick:()=>m(`months`),children:_}):null,(0,t.jsx)(`button`,{type:`button`,className:R.titleButton,"aria-label":`Choose year`,onClick:()=>m(`years`),children:S})]})}),(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":F,onClick:()=>N(1),children:ne(`right`)})]}),p===`days`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`div`,{className:R.weekdays,"aria-hidden":`true`,children:y.map(e=>(0,t.jsx)(`span`,{children:e.short},e.long))}),(0,t.jsx)(`div`,{ref:h,className:R.grid,role:`group`,"aria-label":`${_} ${S}`,onKeyDown:ee,children:x.map(e=>{let a=T(e),o=e.getMonth()!==d.getMonth(),c=A(e,n);return(0,t.jsx)(`button`,{type:`button`,"data-date":a,tabIndex:A(e,d)?0:-1,"aria-disabled":i(e)||void 0,"aria-label":b.format(e),"aria-pressed":c,"aria-current":A(e,u)?`date`:void 0,className:r(R.day,o&&R.outside,A(e,u)&&R.today,c&&R.selected),onClick:()=>{i(e)||s(e)},children:e.getDate()},a)})})]}):p===`months`?(0,t.jsx)(`div`,{className:R.cells,children:v.map((e,n)=>(0,t.jsx)(`button`,{type:`button`,className:r(R.cell,n===d.getMonth()&&R.active),onClick:()=>{g.current=!0,f(e=>k(e,n-e.getMonth())),m(`days`)},children:e},e))}):(0,t.jsx)(`div`,{className:R.cells,children:Array.from({length:12},(e,t)=>C+t).map(e=>(0,t.jsx)(`button`,{type:`button`,className:r(R.cell,e===S&&R.active),onClick:()=>{g.current=!0,f(t=>k(t,(e-t.getFullYear())*12)),m(`months`)},children:e},e))}),l?(0,t.jsxs)(`div`,{className:R.footer,children:[c?(0,t.jsx)(`button`,{type:`button`,className:R.footerButton,onClick:()=>s(null),children:`Clear`}):(0,t.jsx)(`span`,{}),(0,t.jsx)(`button`,{type:`button`,className:r(R.footerButton,R.footerPrimary),disabled:i(u),onClick:()=>s(u),children:`Today`})]}):null]})}var z=`cui-portal-root`;function B(){let e=document.getElementById(z);return e||(e=document.createElement(`div`),e.id=z,document.body.appendChild(e)),e}var V={control:`cui-PickerField-module__control--hv4-k`,trigger:`cui-PickerField-module__trigger--nMtV1`,open:`cui-PickerField-module__open--2Fuec`,value:`cui-PickerField-module__value--ygNxN`,placeholder:`cui-PickerField-module__placeholder--1Dyyf`,sm:`cui-PickerField-module__sm--D-r4h`,md:`cui-PickerField-module__md--BznWY`,lg:`cui-PickerField-module__lg--kVaWE`,icon:`cui-PickerField-module__icon--d3eU4`,clear:`cui-PickerField-module__clear--aFEVN`,invalid:`cui-PickerField-module__invalid--rZMR8`,disabled:`cui-PickerField-module__disabled--YO0Rv`,panel:`cui-PickerField-module__panel--QoUNQ`,"cui-datepicker-in":`cui-PickerField-module__cui-datepicker-in--J-Ky1`},ie=4,ae=420,H=`button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]`,oe=(0,e.forwardRef)(function({id:i,required:a,disabled:o,error:s,"aria-describedby":c,size:l=`md`,displayText:u,placeholder:d,name:f,hiddenValue:p,clearable:m,onClear:h,clearLabel:g,panelLabel:_,panelWidth:v=300,icon:y=`calendar`,className:b,onClick:S,onKeyDown:C,children:w,...T},E){let D=x({id:i,required:a,disabled:o,error:s,"aria-describedby":c}),O=`${(0,e.useId)()}-panel`,k=(0,e.useRef)(null),A=(0,e.useRef)(null),j=(0,e.useRef)(null),ee=(0,e.useCallback)(e=>{A.current=e,typeof E==`function`?E(e):E&&(E.current=e)},[E]),[M,N]=(0,e.useState)(!1),[P,F]=(0,e.useState)(null),[te,I]=(0,e.useState)(),L=(0,e.useCallback)(()=>{let e=k.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<ae&&t.top>n,i={left:Math.max(8,Math.min(t.left,window.innerWidth-v))};r?i.bottom=window.innerHeight-t.top+ie:i.top=t.bottom+ie,F(i)},[v]),R=()=>{D.disabled||(L(),I(k.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),N(!0))},[ne,re]=(0,e.useState)(0),z=(e=!0)=>{N(!1),e&&re(e=>e+1)};(0,e.useEffect)(()=>{ne>0&&A.current?.focus({preventScroll:!0})},[ne]),(0,e.useEffect)(()=>{if(!M)return;let e=()=>requestAnimationFrame(L),t=e=>{let t=e.target;!k.current?.contains(t)&&!j.current?.contains(t)&&N(!1)};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[M,L]);let oe=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),z();return}if(e.key!==`Tab`)return;let t=Array.from(j.current?.querySelectorAll(H)??[]),n=t[0],r=t[t.length-1];n&&r&&(e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))},se=u!==null,ce=m&&se&&!D.disabled;return(0,t.jsxs)(`div`,{ref:k,className:r(V.control,V[l],D.invalid&&V.invalid,D.disabled&&V.disabled,M&&V.open,b),children:[(0,t.jsx)(`button`,{...T,ref:ee,id:D.id,type:`button`,"aria-haspopup":`dialog`,"aria-expanded":M,"aria-controls":M?O:void 0,"aria-invalid":D[`aria-invalid`],"aria-describedby":D[`aria-describedby`],"aria-required":D.required||void 0,disabled:D.disabled,className:r(V.trigger,!se&&V.placeholder),onClick:e=>{S?.(e),!e.defaultPrevented&&(M?z(!1):R())},onKeyDown:e=>{C?.(e),!e.defaultPrevented&&!M&&e.key===`ArrowDown`&&(e.preventDefault(),R())},children:(0,t.jsx)(`span`,{className:V.value,children:u??d})}),ce?(0,t.jsx)(`button`,{type:`button`,className:V.clear,"aria-label":g,onClick:()=>{h(),A.current?.focus({preventScroll:!0})},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})}):null,(0,t.jsx)(`svg`,{className:V.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:y===`clock`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8`}),(0,t.jsx)(`path`,{d:`M12 7v5l3 2`})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`rect`,{x:`4`,y:`5`,width:`16`,height:`15`,rx:`2`}),(0,t.jsx)(`path`,{d:`M4 10h16M9 3v4M15 3v4`})]})}),f?(0,t.jsx)(`input`,{type:`hidden`,name:f,value:p}):null,M&&P?(0,n.createPortal)((0,t.jsx)(`div`,{ref:j,id:O,role:`dialog`,"aria-label":_,className:V.panel,style:P,"data-theme":te,onKeyDown:oe,children:w({close:z})}),B()):null]})});function se({label:e,helperText:n,error:r,required:i,disabled:a,id:o,children:s}){return h()?!e&&!n&&!r?(0,t.jsx)(t.Fragment,{children:s}):(0,t.jsx)(C,{id:o,label:e,helperText:n,error:r,required:i,disabled:a,children:s}):(0,t.jsx)(_,{})}var ce=oe,U=(0,e.forwardRef)(function({label:n,helperText:r,error:i,required:a,disabled:o,id:s,value:c,defaultValue:l,onChange:u,min:d,max:f,disablePast:p,disableFuture:m,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v,placeholder:y=`Select a date`,name:b,clearable:x=!0,weekStartsOn:S=0,locale:C,...w},D){let O=c!==void 0,[k,A]=(0,e.useState)(l??``),j=E(O?c:k),M=ee({min:d,max:f,disablePast:p,disableFuture:m,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v}),N=(0,e.useMemo)(()=>new Intl.DateTimeFormat(C,{day:`2-digit`,month:`short`,year:`numeric`}),[C]),P=e=>{O||A(e),u?.(e)};return(0,t.jsx)(se,{label:n,helperText:r,error:i,required:a,disabled:o,id:s,children:(0,t.jsx)(ce,{...w,ref:D,id:s,required:a,disabled:o,error:i,name:b,hiddenValue:j?T(j):``,displayText:j?N.format(j):null,placeholder:y,clearable:x,clearLabel:`Clear date`,onClear:()=>P(``),panelLabel:`Choose date`,children:({close:e})=>(0,t.jsx)(re,{selected:j,isDisabled:M,weekStartsOn:S,locale:C,allowClear:x,onSelect:t=>{P(t?T(t):``),e()}})})})}),le={root:`cui-TimeColumns-module__root--Cvrka`,column:`cui-TimeColumns-module__column--pbegA`,list:`cui-TimeColumns-module__list--7VPVy`,option:`cui-TimeColumns-module__option--cz6mr`,selected:`cui-TimeColumns-module__selected--HDZ6k`},W=e=>String(e).padStart(2,`0`);function ue({hours:e,minutes:n,onChange:r,minuteStep:i,use12Hours:a,isTimeDisabled:o}){let s=e??0,c=n??0,l=s>=12,u=Array.from({length:Math.ceil(60/i)},(e,t)=>t*i).filter(e=>e<60);n!==null&&!u.includes(n)&&u.push(n),u.sort((e,t)=>e-t);let d=e=>u.every(t=>o(e,t)),f=a?Array.from({length:12},(e,t)=>{let n=t+(l?12:0);return{value:n,label:String(t===0?12:t),disabled:d(n)}}):Array.from({length:24},(e,t)=>({value:t,label:W(t),disabled:d(t)})),p=u.map(e=>({value:e,label:W(e),disabled:o(s,e)})),m=e=>Array.from({length:12},(t,n)=>e+n).every(d),h=[{value:0,label:`AM`,disabled:m(0)},{value:12,label:`PM`,disabled:m(12)}];return(0,t.jsxs)(`div`,{className:le.root,children:[(0,t.jsx)(G,{label:`Hours`,options:f,selected:e,onSelect:e=>r(e,c)}),(0,t.jsx)(G,{label:`Minutes`,options:p,selected:n,onSelect:e=>r(s,e)}),a?(0,t.jsx)(G,{label:`AM or PM`,options:h,selected:e===null?null:l?12:0,onSelect:e=>r(s%12+e,c)}):null]})}function G({label:n,options:i,selected:a,onSelect:o}){let s=(0,e.useRef)(null),c=i.findIndex(e=>e.value===a);return(0,e.useEffect)(()=>{let e=s.current,t=e?.querySelector(`[aria-selected="true"]`);e&&t&&(e.scrollTop=Math.max(0,t.offsetTop-e.clientHeight/2+t.offsetHeight/2))},[a]),(0,t.jsx)(`div`,{className:le.column,children:(0,t.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":n,className:le.list,onKeyDown:e=>{let t=Array.from(s.current?.querySelectorAll(`[role="option"]`)??[]),n=t.indexOf(document.activeElement),r=-1;e.key===`ArrowDown`?r=Math.min(n+1,t.length-1):e.key===`ArrowUp`?r=Math.max(n-1,0):e.key===`Home`?r=0:e.key===`End`&&(r=t.length-1),!(r<0)&&(e.preventDefault(),t[r]?.focus({preventScroll:!1}))},children:i.map((e,n)=>{let i=e.value===a;return(0,t.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,tabIndex:i||c===-1&&n===0?0:-1,className:r(le.option,i&&le.selected),onClick:()=>{e.disabled||o(e.value)},children:e.label},e.value)})})})}var de={timeHeading:`cui-DateTimePicker-module__timeHeading--Wk-z9`,footer:`cui-DateTimePicker-module__footer---mP1S`,footerActions:`cui-DateTimePicker-module__footerActions--Io2QZ`,footerButton:`cui-DateTimePicker-module__footerButton--gUs4k`,done:`cui-DateTimePicker-module__done--XjGrY`};function fe(e,t){if(!e)return null;let n=I(e);if(n)return n;let r=E(e);return r?L(r,t?23:0,t?59:0):null}var pe=e=>{let t=/^(\d{2}):(\d{2})$/.exec(e),n=t?Number(t[1]):0,r=t?Number(t[2]):0;return n>23||r>59?[0,0]:[n,r]},me=(0,e.forwardRef)(function({label:n,helperText:r,error:i,required:a,disabled:o,id:s,value:c,defaultValue:l,onChange:u,min:d,max:f,disablePast:p,disableFuture:m,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v,minuteStep:y=5,use12Hours:b=!1,defaultTime:x=`00:00`,placeholder:S=`Select date and time`,name:C,clearable:w=!0,weekStartsOn:E=0,locale:k,...A},j){let N=c!==void 0,[P,F]=(0,e.useState)(l??``),R=I(N?c:P),ne=new Date,z=[fe(d,!1),p?ne:null].filter(e=>e!==null).sort((e,t)=>t.getTime()-e.getTime())[0],B=[fe(f,!0),m?ne:null].filter(e=>e!==null).sort((e,t)=>e.getTime()-t.getTime())[0],V=ee({min:z?T(z):void 0,max:B?T(B):void 0,disabledDates:h,disabledRanges:g,disabledDaysOfWeek:_,isDateDisabled:v}),ie=e=>V(e)||z!==void 0&&e<L(z,z.getHours(),z.getMinutes())||B!==void 0&&e>L(B,B.getHours(),B.getMinutes()),ae=(0,e.useMemo)(()=>new Intl.DateTimeFormat(k,{day:`2-digit`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:b}),[k,b]),H=e=>{let t=e?te(e):``;N||F(t),u?.(t)},oe=(e,t,n)=>{let r=L(e,t,n);if(!ie(r))return r;for(let t=0;t<1440;t+=y){let n=L(e,Math.floor(t/60),t%60);if(!ie(n))return n}return r},U=()=>R??M(D(),V),[le,W]=pe(x),G=new Date;return(0,t.jsx)(se,{label:n,helperText:r,error:i,required:a,disabled:o,id:s,children:(0,t.jsx)(ce,{...A,ref:j,id:s,required:a,disabled:o,error:i,name:C,hiddenValue:R?te(R):``,displayText:R?ae.format(R):null,placeholder:S,clearable:w,clearLabel:`Clear date and time`,onClear:()=>H(null),panelLabel:`Choose date and time`,panelWidth:b?340:320,icon:`clock`,children:({close:e})=>(0,t.jsxs)(`div`,{children:[(0,t.jsx)(re,{selected:R,isDisabled:V,weekStartsOn:E,locale:k,allowClear:w,showFooter:!1,onSelect:e=>{e&&H(oe(e,R?.getHours()??le,R?.getMinutes()??W))}}),(0,t.jsx)(`div`,{className:de.timeHeading,children:`Time`}),(0,t.jsx)(ue,{hours:R?R.getHours():null,minutes:R?R.getMinutes():null,minuteStep:y,use12Hours:b,isTimeDisabled:(e,t)=>ie(L(U(),e,t)),onChange:(e,t)=>H(L(U(),e,t))}),(0,t.jsxs)(`div`,{className:de.footer,children:[w?(0,t.jsx)(`button`,{type:`button`,className:de.footerButton,onClick:()=>{H(null)},children:`Clear`}):(0,t.jsx)(`span`,{}),(0,t.jsxs)(`span`,{className:de.footerActions,children:[(0,t.jsx)(`button`,{type:`button`,className:de.footerButton,disabled:ie(G),onClick:()=>H(L(O(G,0),G.getHours(),G.getMinutes())),children:`Now`}),(0,t.jsx)(`button`,{type:`button`,className:`${de.footerButton} ${de.done}`,onClick:()=>e(),children:`Done`})]})]})]})})})}),he=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:e===`left`?`M12 5l-5 5 5 5`:`M8 5l5 5-5 5`})}),ge=(e,t)=>new Date(e,t,1,12);function _e({selected:n,isDisabled:i,locale:a,onSelect:o,allowClear:s}){let c=D(),[l,u]=(0,e.useState)(()=>ge((n??c).getFullYear(),(n??c).getMonth())),[d,f]=(0,e.useState)(`months`),p=(0,e.useRef)(null),m=(0,e.useRef)(!0),h=l.getFullYear(),g=Math.floor((h-1)/12)*12+1,_=(0,e.useMemo)(()=>Array.from({length:12},(e,t)=>new Intl.DateTimeFormat(a,{month:`short`}).format(new Date(2024,t,1))),[a]),v=(0,e.useMemo)(()=>new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`}),[a]),y=N(l);(0,e.useEffect)(()=>{d===`months`&&m.current&&p.current?.querySelector(`[data-month="${y}"]`)?.focus({preventScroll:!0})},[y,d]);let b=e=>{let t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];t!==void 0&&(e.preventDefault(),m.current=!0,u(e=>k(e,t)))},x=e=>{m.current=!1,u(t=>k(t,e*(d===`years`?144:12)))};return(0,t.jsxs)(`div`,{className:R.root,children:[(0,t.jsxs)(`div`,{className:R.header,children:[(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":d===`years`?`Previous 12 years`:`Previous year`,onClick:()=>x(-1),children:he(`left`)}),(0,t.jsx)(`div`,{className:R.title,"aria-live":`polite`,children:d===`years`?(0,t.jsxs)(`span`,{children:[g,` - `,g+11]}):(0,t.jsx)(`button`,{type:`button`,className:R.titleButton,"aria-label":`Choose year`,onClick:()=>f(`years`),children:h})}),(0,t.jsx)(`button`,{type:`button`,className:R.nav,"aria-label":d===`years`?`Next 12 years`:`Next year`,onClick:()=>x(1),children:he(`right`)})]}),d===`months`?(0,t.jsx)(`div`,{ref:p,className:R.cells,role:`group`,"aria-label":`Months of ${h}`,onKeyDown:b,children:_.map((e,a)=>{let s=ge(h,a),u=N(s),d=n!==null&&N(n)===u;return(0,t.jsx)(`button`,{type:`button`,"data-month":u,tabIndex:a===l.getMonth()?0:-1,"aria-label":v.format(s),"aria-pressed":d,"aria-current":N(c)===u?`date`:void 0,"aria-disabled":i(s)||void 0,className:r(R.cell,d&&R.active,N(c)===u&&!d&&R.currentCell),onClick:()=>{i(s)||o(s)},children:e},u)})}):(0,t.jsx)(`div`,{className:R.cells,children:Array.from({length:12},(e,t)=>g+t).map(e=>(0,t.jsx)(`button`,{type:`button`,className:r(R.cell,e===h&&R.active),onClick:()=>{m.current=!0,u(t=>k(t,(e-t.getFullYear())*12)),f(`months`)},children:e},e))}),(0,t.jsxs)(`div`,{className:R.footer,children:[s?(0,t.jsx)(`button`,{type:`button`,className:R.footerButton,onClick:()=>o(null),children:`Clear`}):(0,t.jsx)(`span`,{}),(0,t.jsx)(`button`,{type:`button`,className:r(R.footerButton,R.footerPrimary),disabled:i(ge(c.getFullYear(),c.getMonth())),onClick:()=>o(P(N(c))),children:`This month`})]})]})}var ve=(0,e.forwardRef)(function({label:n,helperText:r,error:i,required:a,disabled:o,id:s,value:c,defaultValue:l,onChange:u,min:d,max:f,disablePast:p,disableFuture:m,disabledMonths:h,isMonthDisabled:g,placeholder:_=`Select a month`,name:v,clearable:y=!0,locale:b,...x},S){let C=c!==void 0,[w,T]=(0,e.useState)(l??``),E=P(C?c:w),D=F({min:d,max:f,disablePast:p,disableFuture:m,disabledMonths:h,isMonthDisabled:g}),O=(0,e.useMemo)(()=>new Intl.DateTimeFormat(b,{month:`long`,year:`numeric`}),[b]),k=e=>{C||T(e),u?.(e)};return(0,t.jsx)(se,{label:n,helperText:r,error:i,required:a,disabled:o,id:s,children:(0,t.jsx)(ce,{...x,ref:S,id:s,required:a,disabled:o,error:i,name:v,hiddenValue:E?N(E):``,displayText:E?O.format(E):null,placeholder:_,clearable:y,clearLabel:`Clear month`,onClear:()=>k(``),panelLabel:`Choose month`,children:({close:e})=>(0,t.jsx)(_e,{selected:E,isDisabled:D,locale:b,allowClear:y,onSelect:t=>{k(t?N(t):``),e()}})})})}),ye=[`date`,`datetime-local`,`month`],be=e=>ye.includes(e),xe=(0,e.forwardRef)(function({type:n,label:r,helperText:i,error:a,required:o,disabled:s,id:c,name:l,size:u,value:d,defaultValue:f,onChange:p,min:m,max:h,placeholder:g,className:_,dateOptions:v={}},y){let b=(0,e.useRef)(null),x=(0,e.useCallback)(e=>{b.current=e,typeof y==`function`?y(e):y&&(y.current=e)},[y]),S=d!==void 0,[C,w]=(0,e.useState)(String(f??``)),T=S?String(d):C,E={id:c,label:r,helperText:i,error:a,required:o,disabled:s,size:u,placeholder:g,className:_,value:T,onChange:e=>{let t=b.current;t&&(Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set?.call(t,e),t.dispatchEvent(new Event(`input`,{bubbles:!0})))},min:m===void 0?void 0:String(m),max:h===void 0?void 0:String(h),locale:v.locale,clearable:v.clearable,disablePast:v.disablePast,disableFuture:v.disableFuture};return(0,t.jsxs)(t.Fragment,{children:[n===`month`?(0,t.jsx)(ve,{...E,disabledMonths:v.disabledMonths,isMonthDisabled:v.isMonthDisabled}):n===`datetime-local`?(0,t.jsx)(me,{...E,disabledDates:v.disabledDates,disabledRanges:v.disabledRanges,disabledDaysOfWeek:v.disabledDaysOfWeek,isDateDisabled:v.isDateDisabled,weekStartsOn:v.weekStartsOn,minuteStep:v.minuteStep,use12Hours:v.use12Hours,defaultTime:v.defaultTime}):(0,t.jsx)(U,{...E,disabledDates:v.disabledDates,disabledRanges:v.disabledRanges,disabledDaysOfWeek:v.disabledDaysOfWeek,isDateDisabled:v.isDateDisabled,weekStartsOn:v.weekStartsOn}),(0,t.jsx)(`input`,{ref:x,hidden:!0,readOnly:!0,tabIndex:-1,type:`text`,name:l,value:T,onChange:e=>{S||w(e.target.value),p?.(e)}})]})}),K={control:`cui-Input-module__control--e3jPo`,disabled:`cui-Input-module__disabled--nzcnQ`,invalid:`cui-Input-module__invalid--VyrnA`,sm:`cui-Input-module__sm--SCPkT`,md:`cui-Input-module__md--weRbk`,lg:`cui-Input-module__lg--ic8a4`,input:`cui-Input-module__input--WjT81`,affix:`cui-Input-module__affix--zz0Xe`,readOnly:`cui-Input-module__readOnly--0ag-W`},Se=(0,e.forwardRef)(function({id:e,required:n,disabled:i,error:a,"aria-describedby":o,prefix:s,suffix:c,size:l=`md`,readOnly:u,className:d,...f},p){let m=x({id:e,required:n,disabled:i,error:a,"aria-describedby":o});return(0,t.jsxs)(`div`,{className:r(K.control,K[l],m.invalid&&K.invalid,m.disabled&&K.disabled,u&&K.readOnly,d),children:[s?(0,t.jsx)(`span`,{className:K.affix,children:s}):null,(0,t.jsx)(`input`,{...f,ref:p,id:m.id,required:m.required,disabled:m.disabled,readOnly:u,"aria-invalid":m[`aria-invalid`],"aria-describedby":m[`aria-describedby`],className:K.input}),c?(0,t.jsx)(`span`,{className:K.affix,children:c}):null]})}),Ce=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?be(r.type)?(0,t.jsx)(xe,{label:e,helperText:n,...r,type:r.type,ref:i}):!e&&!n&&!r.error?(0,t.jsx)(Se,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(Se,{...r,ref:i})}):(0,t.jsx)(_,{})}),we={toggle:`cui-PasswordInput-module__toggle--WNeX9`},Te=(0,e.forwardRef)(function({showLabel:n=`Show password`,hideLabel:r=`Hide password`,autoComplete:i,disabled:a,...o},s){let[c,l]=(0,e.useState)(!1);return(0,t.jsx)(Ce,{...o,ref:s,type:c?`text`:`password`,autoComplete:i??`current-password`,disabled:a,suffix:(0,t.jsx)(`button`,{type:`button`,className:we.toggle,"aria-label":c?r:n,"aria-pressed":c,disabled:a,onClick:()=>l(e=>!e),children:(0,t.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`path`,{d:`M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z`}),(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),c?null:(0,t.jsx)(`path`,{d:`M4 4l16 16`})]})})})}),Ee={search:`cui-SearchInput-module__search--XCZD4`,icon:`cui-SearchInput-module__icon--I9nEG`,clear:`cui-SearchInput-module__clear--r3kgN`},De=(0,e.forwardRef)(function({value:n,defaultValue:r,onChange:i,onClear:a,clearLabel:o=`Clear search`,disabled:s,readOnly:c,...l},u){let d=(0,e.useRef)(null),f=(0,e.useCallback)(e=>{d.current=e,typeof u==`function`?u(e):u&&(u.current=e)},[u]),p=n!==void 0,[m,h]=(0,e.useState)(String(r??``)),g=p?String(n):m,_=g.length>0&&!s&&!c;return(0,t.jsx)(Ce,{...l,ref:f,type:`search`,className:Ee.search,value:g,disabled:s,readOnly:c,onChange:e=>{p||h(e.target.value),i?.(e)},prefix:(0,t.jsxs)(`svg`,{className:Ee.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`11`,cy:`11`,r:`6.5`}),(0,t.jsx)(`path`,{d:`M16 16l4.5 4.5`})]}),suffix:_?(0,t.jsx)(`button`,{type:`button`,className:Ee.clear,"aria-label":o,onClick:()=>{p||h(``),a?.(),d.current?.focus()},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})}):void 0})}),Oe=`(prefers-color-scheme: dark)`;function ke(){return(0,e.useSyncExternalStore)(e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>{};let t=window.matchMedia(Oe);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)},()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(Oe).matches,()=>!1)}var Ae=new Set;function je(e){try{return window.localStorage.getItem(e)}catch{return null}}function Me(e,t){try{window.localStorage.setItem(e,t)}catch{}Ae.forEach(e=>e())}function Ne(t){return(0,e.useSyncExternalStore)(e=>(Ae.add(e),window.addEventListener(`storage`,e),()=>{Ae.delete(e),window.removeEventListener(`storage`,e)}),()=>t?je(t):null,()=>null)}var Pe={root:`cui-ThemeProvider-module__root--2DEGi`},Fe=(0,e.createContext)(null);function Ie({children:n,theme:i,defaultTheme:a=`light`,onThemeChange:o,storageKey:s,licenseKey:c,className:l,...d}){let[f,p]=(0,e.useState)(a),m=Ne(i===void 0?s:void 0),h=ke(),g=i??m??f,_=g===`system`?h?`dark`:`light`:g,v=(0,e.useCallback)(e=>{i===void 0&&(p(e),s&&Me(s,e)),o?.(e)},[i,o,s]),y=(0,e.useMemo)(()=>({theme:g,resolvedTheme:_,setTheme:v}),[g,_,v]),b=(0,e.useContext)(u);return(0,t.jsx)(Fe.Provider,{value:y,children:(0,t.jsx)(u.Provider,{value:c??b,children:(0,t.jsx)(`div`,{...d,"data-theme":_,className:r(Pe.root,l),children:n})})})}function Le(){let t=(0,e.useContext)(Fe);if(!t)throw Error(`useTheme must be used within a <ThemeProvider>.`);return t}function Re(){return(0,e.useContext)(Fe)}var ze={backdrop:`cui-Overlay-module__backdrop--HLwOh`,"cui-overlay-water":`cui-Overlay-module__cui-overlay-water--Y9SoM`,center:`cui-Overlay-module__center--vmNyk`,right:`cui-Overlay-module__right--TmGqB`,left:`cui-Overlay-module__left--MRs4h`,panel:`cui-Overlay-module__panel--c5Gk2`,"cui-overlay-pop":`cui-Overlay-module__cui-overlay-pop--5VC2-`,"cui-overlay-slide-right":`cui-Overlay-module__cui-overlay-slide-right--2aZId`,"cui-overlay-slide-left":`cui-Overlay-module__cui-overlay-slide-left--0nCKr`,closing:`cui-Overlay-module__closing--7Fqhr`,"cui-overlay-water-out":`cui-Overlay-module__cui-overlay-water-out--Et5pr`,"cui-overlay-pop-out":`cui-Overlay-module__cui-overlay-pop-out--j-IRn`,"cui-overlay-slide-right-out":`cui-Overlay-module__cui-overlay-slide-right-out--2ukGY`,"cui-overlay-slide-left-out":`cui-Overlay-module__cui-overlay-slide-left-out--c67wf`,"cui-overlay-fade":`cui-Overlay-module__cui-overlay-fade--coHyQ`},Be=`a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,Ve=200;function He(){return typeof window.matchMedia!=`function`||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Ue=0,We=``;function Ge(){Ue===0&&(We=document.body.style.overflow,document.body.style.overflow=`hidden`),Ue+=1}function Ke(){Ue=Math.max(0,Ue-1),Ue===0&&(document.body.style.overflow=We)}function qe({open:i,onClose:a,placement:o,panelClassName:s,closeOnBackdrop:c=!0,closeOnEscape:l=!0,role:u=`dialog`,"aria-label":d,children:f,className:p}){let m=(0,e.useId)(),h=`${m}-title`,g=`${m}-description`,_=(0,e.useRef)(null),v=(0,e.useRef)(!1),y=Re();(0,e.useEffect)(()=>{if(!i)return;let e=document.activeElement;Ge();let t=_.current;return(t?.querySelector(`[data-autofocus]`)??t)?.focus({preventScroll:!0}),()=>{Ke(),e?.focus?.({preventScroll:!0})}},[i]);let[b,x]=(0,e.useState)(i);if(i&&!b&&x(!0),!i&&b&&He()&&x(!1),(0,e.useEffect)(()=>{if(i||!b)return;let e=setTimeout(()=>x(!1),Ve);return()=>clearTimeout(e)},[i,b]),!i&&!b)return null;let S=!i;return(0,n.createPortal)((0,t.jsx)(`div`,{className:r(ze.backdrop,ze[o],S&&ze.closing),"data-theme":y?.resolvedTheme,onMouseDown:e=>{v.current=e.target===e.currentTarget},onClick:e=>{c&&v.current&&e.target===e.currentTarget&&a(),v.current=!1},children:(0,t.jsx)(`div`,{ref:_,role:u,"aria-modal":`true`,"aria-label":d,"aria-labelledby":d?void 0:h,"aria-describedby":g,tabIndex:-1,className:r(ze.panel,s,p),onKeyDown:e=>{if(e.key===`Escape`&&l){e.preventDefault(),e.stopPropagation(),a();return}if(e.key!==`Tab`)return;let t=Array.from(_.current?.querySelectorAll(Be)??[]),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement;e.shiftKey&&(i===n||i===_.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())},children:f({titleId:h,descriptionId:g})})}),B())}var Je={header:`cui-OverlayContent-module__header--uLtSD`,heading:`cui-OverlayContent-module__heading--8AaPl`,title:`cui-OverlayContent-module__title--I6nN9`,description:`cui-OverlayContent-module__description--fRdN6`,close:`cui-OverlayContent-module__close--uCSa1`,body:`cui-OverlayContent-module__body--EGPJE`,footer:`cui-OverlayContent-module__footer--qJLyt`};function Ye({titleId:e,descriptionId:n,title:r,description:i,footer:a,hideCloseButton:o,closeLabel:s=`Close`,onClose:c,children:l}){return(0,t.jsxs)(t.Fragment,{children:[r||i||!o?(0,t.jsxs)(`header`,{className:Je.header,children:[(0,t.jsxs)(`div`,{className:Je.heading,children:[r?(0,t.jsx)(`h2`,{id:e,className:Je.title,children:r}):null,i?(0,t.jsx)(`p`,{id:n,className:Je.description,children:i}):null]}),o?null:(0,t.jsx)(`button`,{type:`button`,className:Je.close,"aria-label":s,onClick:c,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}):null,(0,t.jsx)(`div`,{className:Je.body,children:l}),a?(0,t.jsx)(`footer`,{className:Je.footer,children:a}):null]})}var Xe={panel:`cui-Modal-module__panel--lp9I7`,sm:`cui-Modal-module__sm--K5k3W`,md:`cui-Modal-module__md--gvyR7`,lg:`cui-Modal-module__lg--BgB1a`,xl:`cui-Modal-module__xl--MR-68`,full:`cui-Modal-module__full--z-yai`,bare:`cui-Modal-module__bare--8uhGX`};function Ze({open:e,onClose:n,title:i,description:a,children:o,footer:s,size:c=`md`,closeOnBackdrop:l,closeOnEscape:u,hideCloseButton:d,bare:f=!1,role:p,"aria-label":m,className:g}){return h()?(0,t.jsx)(qe,{open:e,onClose:n,placement:`center`,panelClassName:r(Xe.panel,Xe[c],f&&Xe.bare),className:g,closeOnBackdrop:l,closeOnEscape:u,role:p,"aria-label":m,children:({titleId:e,descriptionId:r})=>f?typeof o==`function`?o({titleId:e,descriptionId:r,onClose:n}):o:(0,t.jsx)(Ye,{titleId:e,descriptionId:r,title:i,description:a,footer:s,hideCloseButton:d,onClose:n,children:typeof o==`function`?null:o})}):e?(0,t.jsx)(_,{}):null}var Qe={panel:`cui-Drawer-module__panel--wUX0N`,sm:`cui-Drawer-module__sm--AQ96e`,md:`cui-Drawer-module__md---2Ihw`,lg:`cui-Drawer-module__lg--gWSe1`};function $e({open:e,onClose:n,title:i,description:a,children:o,footer:s,placement:c=`right`,size:l=`md`,closeOnBackdrop:u,closeOnEscape:d,hideCloseButton:f,role:p,"aria-label":m,className:g}){return h()?(0,t.jsx)(qe,{open:e,onClose:n,placement:c,panelClassName:r(Qe.panel,Qe[l]),className:g,closeOnBackdrop:u,closeOnEscape:d,role:p,"aria-label":m,children:({titleId:e,descriptionId:r})=>(0,t.jsx)(Ye,{titleId:e,descriptionId:r,title:i,description:a,footer:s,hideCloseButton:f,onClose:n,children:o})}):e?(0,t.jsx)(_,{}):null}var et={confirmText:`cui-ConfirmDialog-module__confirmText--NaqTy`};function tt({open:n,onClose:r,onConfirm:i,title:a,message:o,confirmLabel:s=`Confirm`,cancelLabel:c=`Cancel`,tone:l=`default`,loading:u=!1,requireText:d}){let[f,p]=(0,e.useState)(``),m=d===void 0||f===d,h=l===`danger`;return(0,t.jsx)(Ze,{open:n,onClose:()=>{u||(p(``),r())},role:`alertdialog`,size:`sm`,title:a,description:o,closeOnBackdrop:!u,closeOnEscape:!u,hideCloseButton:!0,footer:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y,{variant:`outline`,disabled:u,"data-autofocus":h?``:void 0,onClick:()=>{p(``),r()},children:c}),(0,t.jsx)(y,{variant:h?`danger`:`primary`,loading:u,disabled:!m,"data-autofocus":h?void 0:``,onClick:i,children:s})]}),children:d===void 0?null:(0,t.jsx)(`div`,{className:et.confirmText,children:(0,t.jsx)(Ce,{label:`Type ${d} to confirm`,value:f,disabled:u,autoComplete:`off`,placeholder:d,onChange:e=>p(e.target.value)})})})}var q={control:`cui-Select-module__control--OqOfI`,trigger:`cui-Select-module__trigger--ECKfC`,open:`cui-Select-module__open--PADOK`,value:`cui-Select-module__value--7CDNo`,placeholder:`cui-Select-module__placeholder--yUgBU`,sm:`cui-Select-module__sm--TPJwf`,md:`cui-Select-module__md--nOV6u`,lg:`cui-Select-module__lg--NGPOa`,chevron:`cui-Select-module__chevron--PLUsh`,clear:`cui-Select-module__clear--2OgzI`,invalid:`cui-Select-module__invalid--opDrx`,disabled:`cui-Select-module__disabled--8YgjS`,popover:`cui-Select-module__popover--VnWAu`,"cui-select-in":`cui-Select-module__cui-select-in--VGYFd`,top:`cui-Select-module__top--v5FSw`,"cui-select-in-top":`cui-Select-module__cui-select-in-top--fwYA4`,searchWrap:`cui-Select-module__searchWrap--YBOFZ`,search:`cui-Select-module__search--FrUXx`,list:`cui-Select-module__list--CI08p`,option:`cui-Select-module__option--Hvo8n`,optionLabel:`cui-Select-module__optionLabel--FGiUZ`,selected:`cui-Select-module__selected--8A13A`,highlighted:`cui-Select-module__highlighted--YIVPT`,optionDisabled:`cui-Select-module__optionDisabled--FhDw-`,check:`cui-Select-module__check--RxZrV`,empty:`cui-Select-module__empty--KmYrm`,spinner:`cui-Select-module__spinner--OxCAP`,"cui-select-spin":`cui-Select-module__cui-select-spin--MQqaM`},nt=4,rt=280,it=500,at=e=>Array.isArray(e)?e:e?[e]:[],ot=(0,e.forwardRef)(function({options:i,placeholder:a=`Select an option`,size:o=`md`,multiple:s=!1,clearable:c=!0,onSearch:l,loading:u=!1,emptyMessage:d=`No options found.`,listClassName:f,name:p,value:m,defaultValue:h,onChange:g,id:_,required:v,disabled:y,error:b,"aria-describedby":S,className:C,onKeyDown:w,onClick:T,...E},D){let O=x({id:_,required:v,disabled:y,error:b,"aria-describedby":S}),k=(0,e.useId)(),A=`${k}-list`,j=`${k}-value`,ee=e=>`${k}-option-${e}`,M=(0,e.useRef)(null),N=(0,e.useRef)(null),P=(0,e.useRef)(null),F=(0,e.useRef)(null),te=(0,e.useRef)(null),[I,L]=(0,e.useState)(!1),[R,ne]=(0,e.useState)(null),[re,z]=(0,e.useState)(``),[V,ie]=(0,e.useState)(!1),[ae,H]=(0,e.useState)(0),oe=m!==void 0,[se,ce]=(0,e.useState)(()=>at(h)),U=oe?at(m):se,le=(0,e.useCallback)(e=>{N.current=e,typeof D==`function`?D(e):D&&(D.current=e)},[D]),W=(0,e.useMemo)(()=>{if(l||!re)return i;let e=re.toLowerCase();return i.filter(t=>t.label.toLowerCase().includes(e))},[i,re,l]),ue=e=>{oe||ce(e),g?.(s?e:e[0]??``)},G=e=>{let t=e.findIndex(e=>!e.disabled);return t===-1?0:t},de=(0,e.useCallback)(()=>{let e=M.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<rt&&t.top>n?`top`:`bottom`,i={left:t.left,width:t.width};r===`bottom`?i.top=t.bottom+nt:i.bottom=window.innerHeight-t.top+nt,ne({style:i,placement:r})},[]),fe=()=>{if(O.disabled)return;de(),z(``),ie(!1);let e=i.findIndex(e=>U.includes(e.value));H(e===-1?G(i):e),L(!0)},pe=(e=!0)=>{L(!1),e&&N.current?.focus({preventScroll:!0})},me=e=>{e.disabled||(s?ue(U.includes(e.value)?U.filter(t=>t!==e.value):[...U,e.value]):(ue([e.value]),pe()),z(``),ie(!1))},he=e=>{if(!W.length)return;let t=ae;for(let n=0;n<W.length&&(t=(t+e+W.length)%W.length,W[t]?.disabled);n++);H(t)};(0,e.useEffect)(()=>{I&&F.current?.focus({preventScroll:!0})},[I]),(0,e.useEffect)(()=>{V&&te.current?.focus({preventScroll:!0})},[V]);let ge=(0,e.useRef)(l);(0,e.useEffect)(()=>{ge.current=l},[l]),(0,e.useEffect)(()=>{if(!I||!ge.current)return;let e=setTimeout(()=>ge.current?.(re),it);return()=>clearTimeout(e)},[re,I]),(0,e.useEffect)(()=>{if(!I)return;let e=()=>requestAnimationFrame(de);return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[I,de]),(0,e.useEffect)(()=>{if(!I)return;let e=e=>{let t=e.target;!M.current?.contains(t)&&!P.current?.contains(t)&&L(!1)};return document.addEventListener(`mousedown`,e,!0),()=>document.removeEventListener(`mousedown`,e,!0)},[I]),(0,e.useEffect)(()=>{if(!I)return;let e=F.current,t=e?.children[ae];e&&t&&(t.offsetTop<e.scrollTop?e.scrollTop=t.offsetTop:t.offsetTop+t.offsetHeight>e.scrollTop+e.clientHeight&&(e.scrollTop=t.offsetTop+t.offsetHeight-e.clientHeight))},[ae,I]);let _e=e=>{w?.(e),!e.defaultPrevented&&!I&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),fe())},ve=e=>{switch(e.key){case`Escape`:e.preventDefault(),e.stopPropagation(),pe();return;case`ArrowDown`:e.preventDefault(),he(1);return;case`ArrowUp`:e.preventDefault(),he(-1);return;case`Home`:if(V)return;e.preventDefault(),H(G(W));return;case`End`:if(V)return;e.preventDefault(),H(Math.max(W.length-1,0));return;case`Enter`:e.preventDefault(),e.stopPropagation(),W[ae]&&me(W[ae]);return;case`Tab`:L(!1),N.current?.focus({preventScroll:!0});return;case` `:if(V)return;e.preventDefault(),W[ae]&&me(W[ae]);return}let t=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;!V&&t&&(e.preventDefault(),z(e.key),H(0),ie(!0))},ye=i.filter(e=>U.includes(e.value)),be=U.length>0,xe=U.length>1?`${U.length} selected`:ye[0]?.label??a,K=c&&be&&!O.disabled,Se=I?M.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`):void 0,Ce=I&&W[ae]?ee(ae):void 0,we=O.labelId?`${O.labelId} ${j}`:void 0;return(0,t.jsxs)(`div`,{ref:M,className:r(q.control,q[o],O.invalid&&q.invalid,O.disabled&&q.disabled,I&&q.open,C),children:[(0,t.jsx)(`button`,{...E,ref:le,id:O.id,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":I,"aria-controls":I?A:void 0,"aria-labelledby":we,"aria-invalid":O[`aria-invalid`],"aria-describedby":O[`aria-describedby`],"aria-required":O.required||void 0,disabled:O.disabled,className:r(q.trigger,!ye.length&&q.placeholder),onClick:e=>{T?.(e),!e.defaultPrevented&&(I?pe(!1):fe())},onKeyDown:_e,children:(0,t.jsx)(`span`,{id:j,className:q.value,children:xe})}),K?(0,t.jsx)(`button`,{type:`button`,className:q.clear,"aria-label":`Clear selection`,onClick:()=>{ue([]),N.current?.focus({preventScroll:!0})},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`})})}):null,(0,t.jsx)(`svg`,{className:q.chevron,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M5 7.5l5 5 5-5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),p?U.length>0?U.map(e=>(0,t.jsx)(`input`,{type:`hidden`,name:p,value:e},e)):!s&&(0,t.jsx)(`input`,{type:`hidden`,name:p,value:``}):null,I&&R?(0,n.createPortal)((0,t.jsxs)(`div`,{ref:P,className:r(q.popover,q[R.placement]),style:R.style,"data-theme":Se??void 0,onKeyDown:ve,children:[V?(0,t.jsx)(`div`,{className:q.searchWrap,children:(0,t.jsx)(`input`,{ref:te,type:`text`,className:q.search,placeholder:`Search options...`,"aria-label":`Search options`,"aria-controls":A,"aria-activedescendant":Ce,autoComplete:`off`,value:re,onChange:e=>{let t=e.target.value;z(t),H(0),t===``&&(ie(!1),F.current?.focus({preventScroll:!0}))}})}):null,(0,t.jsx)(`ul`,{ref:F,id:A,role:`listbox`,tabIndex:-1,"aria-labelledby":we,"aria-multiselectable":s||void 0,"aria-activedescendant":V?void 0:Ce,className:r(q.list,f),children:W.length>0?W.map((e,n)=>{let i=U.includes(e.value);return(0,t.jsxs)(`li`,{id:ee(n),role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,className:r(q.option,i&&q.selected,n===ae&&q.highlighted,e.disabled&&q.optionDisabled),onMouseEnter:()=>!e.disabled&&H(n),onClick:()=>me(e),children:[(0,t.jsx)(`span`,{className:q.optionLabel,children:e.label}),i?(0,t.jsx)(`svg`,{className:q.check,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4.5 10.5l3.5 3.5 7.5-8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}):null]},e.value)}):(0,t.jsx)(`li`,{className:q.empty,role:`presentation`,children:u?(0,t.jsx)(`span`,{className:q.spinner,role:`status`,"aria-label":`Loading`}):d})})]}),B()):null]})}),st=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){if(!h())return(0,t.jsx)(_,{});let a=r;return!e&&!n&&!r.error?(0,t.jsx)(ot,{...a,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(ot,{...a,ref:i})})});function ct(e,t,n=1,r=1){let i=Math.max(0,Math.floor(t));if(i===0)return[];let a=Math.min(Math.max(1,Math.floor(e)),i),o=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),s=o(1,Math.min(r,i)),c=o(Math.max(i-r+1,r+1),i),l=Math.max(Math.min(a-n,i-r-n*2-1),r+2),u=Math.min(Math.max(a+n,r+n*2+2),c.length>0?c[0]-2:i-1),d=[...s];return l>r+2?d.push(`ellipsis-start`):r+1<i-r&&d.push(r+1),d.push(...o(l,u)),u<i-r-1?d.push(`ellipsis-end`):i-r>r&&d.push(i-r),d.push(...c),d.filter((e,t)=>typeof e!=`number`||d.indexOf(e)===t)}var J={root:`cui-Pagination-module__root--ITRjt`,info:`cui-Pagination-module__info--4yuss`,summary:`cui-Pagination-module__summary--ZTggV`,pageSize:`cui-Pagination-module__pageSize--rDNL9`,pages:`cui-Pagination-module__pages--Fz8bC`,button:`cui-Pagination-module__button----Saq`,current:`cui-Pagination-module__current--Ca1M4`,ellipsis:`cui-Pagination-module__ellipsis--V294k`,split:`cui-Pagination-module__split--GnzEp`,splitLeft:`cui-Pagination-module__splitLeft--s3TPn`,splitCenter:`cui-Pagination-module__splitCenter--1Sosz`,splitRight:`cui-Pagination-module__splitRight--3gp2C`,joined:`cui-Pagination-module__joined--SDJ-W`,pageOf:`cui-Pagination-module__pageOf--pEVDE`,pageNumber:`cui-Pagination-module__pageNumber--rayzm`,first:`cui-Pagination-module__first--2Gg56`,prev:`cui-Pagination-module__prev--aNYld`,next:`cui-Pagination-module__next--QC3Z9`,last:`cui-Pagination-module__last--zJ-7Y`},lt=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:e})});function ut({page:e,pageCount:n,onPageChange:i,siblingCount:a=1,boundaryCount:o=1,showFirstLast:s=!1,layout:c=`default`,pageSize:l,totalItems:u,pageSizeOptions:d,onPageSizeChange:f,disabled:p=!1,"aria-label":m=`Pagination`,className:g,...v}){if(!h())return(0,t.jsx)(_,{});let y=Math.max(1,n),b=Math.min(Math.max(1,e),y),x=ct(b,y,a,o),S=e=>{!p&&e>=1&&e<=y&&e!==b&&i(e)},C=c===`split`,w=s||C,T=l!==void 0&&u!==void 0,E=u===0||!l?0:(b-1)*l+1,D=l&&u!==void 0?Math.min(b*l,u):0,O=d&&d.length>0&&f,k=T?(0,t.jsx)(`span`,{className:J.summary,children:C?`Showing ${E}-${D} of ${u} Rows`:`Showing ${E}-${D} of ${u}`}):null,A=O?(0,t.jsxs)(`div`,{className:J.pageSize,children:[(0,t.jsx)(`span`,{"aria-hidden":`true`,children:C?`Row Per Page`:`Rows per page`}),(0,t.jsx)(st,{"aria-label":`Rows per page`,size:`sm`,clearable:!1,disabled:p,value:String(l??d[0]),options:d.map(e=>({label:String(e),value:String(e)})),onChange:e=>f(Number(e))})]}):null,j=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`ul`,{className:r(J.pages,C&&J.joined),children:[w?(0,t.jsx)(`li`,{className:J.first,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`First page`,disabled:p||b===1,onClick:()=>S(1),children:lt(`M11 5l-5 5 5 5M15 5v10`)})}):null,(0,t.jsx)(`li`,{className:J.prev,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`Previous page`,disabled:p||b===1,onClick:()=>S(b-1),children:lt(`M12 5l-5 5 5 5`)})}),x.map(e=>typeof e==`number`?(0,t.jsx)(`li`,{className:J.pageNumber,children:(0,t.jsx)(`button`,{type:`button`,className:r(J.button,e===b&&J.current),"aria-label":`Page ${e}`,"aria-current":e===b?`page`:void 0,disabled:p,onClick:()=>S(e),children:e})},e):(0,t.jsx)(`li`,{className:r(J.ellipsis,J.pageNumber),"aria-hidden":`true`,children:`…`},e)),(0,t.jsx)(`li`,{className:J.next,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`Next page`,disabled:p||b===y,onClick:()=>S(b+1),children:lt(`M8 5l5 5-5 5`)})}),w?(0,t.jsx)(`li`,{className:J.last,children:(0,t.jsx)(`button`,{type:`button`,className:J.button,"aria-label":`Last page`,disabled:p||b===y,onClick:()=>S(y),children:lt(`M9 5l5 5-5 5M5 5v10`)})}):null]}),C?(0,t.jsxs)(`span`,{className:J.pageOf,"aria-hidden":`true`,children:[`Page `,(0,t.jsx)(`strong`,{children:b}),` of `,y]}):null]});return C?(0,t.jsxs)(`nav`,{...v,"aria-label":m,className:r(J.root,J.split,g),children:[(0,t.jsx)(`div`,{className:J.splitLeft,children:A}),(0,t.jsx)(`div`,{className:J.splitCenter,children:j}),(0,t.jsx)(`div`,{className:J.splitRight,children:k})]}):(0,t.jsxs)(`nav`,{...v,"aria-label":m,className:r(J.root,g),children:[(0,t.jsxs)(`div`,{className:J.info,children:[k,A]}),j]})}var Y={container:`cui-Table-module__container--Kb-5q`,table:`cui-Table-module__table--Dkosn`,caption:`cui-Table-module__caption--9vU1I`,head:`cui-Table-module__head--nm9rX`,th:`cui-Table-module__th--PNuEx`,sorted:`cui-Table-module__sorted--PJE-z`,sortable:`cui-Table-module__sortable--W4c6P`,sortButton:`cui-Table-module__sortButton--V9clQ`,center:`cui-Table-module__center--kj838`,end:`cui-Table-module__end--eOUuQ`,sticky:`cui-Table-module__sticky--QfxLu`,td:`cui-Table-module__td--jv9tA`,start:`cui-Table-module__start--H-44v`,foot:`cui-Table-module__foot--0JhPm`,row:`cui-Table-module__row--DD8Km`,selected:`cui-Table-module__selected--DTjQs`,clickable:`cui-Table-module__clickable--B6Si-`,sortIcon:`cui-Table-module__sortIcon--V3-dH`,sortActive:`cui-Table-module__sortActive--4aqxc`,sortIdle:`cui-Table-module__sortIdle--ja3Xa`,flush:`cui-Table-module__flush--sZ9XS`},dt=(0,e.forwardRef)(function({stickyHeader:e=!1,bordered:n=!0,containerClassName:i,scrollLabel:a,className:o,...s},c){return h()?(0,t.jsx)(`div`,{className:r(Y.container,!n&&Y.flush,i),tabIndex:0,role:`region`,"aria-label":a,children:(0,t.jsx)(`table`,{...s,ref:c,className:r(Y.table,e&&Y.sticky,o)})}):(0,t.jsx)(_,{})}),ft=(0,e.forwardRef)(function({className:e,...n},i){return(0,t.jsx)(`thead`,{...n,ref:i,className:r(Y.head,e)})}),pt=(0,e.forwardRef)(function({className:e,...n},r){return(0,t.jsx)(`tbody`,{...n,ref:r,className:e})}),mt=(0,e.forwardRef)(function({className:e,...n},i){return(0,t.jsx)(`tfoot`,{...n,ref:i,className:r(Y.foot,e)})}),ht=(0,e.forwardRef)(function({selected:e=!1,className:n,...i},a){return(0,t.jsx)(`tr`,{...i,ref:a,"data-selected":e||void 0,className:r(Y.row,e&&Y.selected,i.onClick&&Y.clickable,n)})}),gt=(0,e.forwardRef)(function({align:e=`start`,sortable:n=!1,sortDirection:i=null,onSort:a,className:o,children:s,scope:c=`col`,...l},u){let d=n?i===`asc`?`ascending`:i===`desc`?`descending`:`none`:void 0;return(0,t.jsx)(`th`,{...l,ref:u,scope:c,"aria-sort":d,className:r(Y.th,Y[e],n&&Y.sortable,n&&i&&Y.sorted,o),children:n?(0,t.jsxs)(`button`,{type:`button`,className:Y.sortButton,onClick:a,children:[s,(0,t.jsx)(`svg`,{className:r(Y.sortIcon,i?Y.sortActive:Y.sortIdle),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:i?3:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:i===`asc`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`path`,{d:`m5 12 7-7 7 7`}),(0,t.jsx)(`path`,{d:`M12 19V5`})]}):i===`desc`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`path`,{d:`M12 5v14`}),(0,t.jsx)(`path`,{d:`m19 12-7 7-7-7`})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`path`,{d:`m21 16-4 4-4-4`}),(0,t.jsx)(`path`,{d:`M17 20V4`}),(0,t.jsx)(`path`,{d:`m3 8 4-4 4 4`}),(0,t.jsx)(`path`,{d:`M7 4v16`})]})})]}):s})}),_t=(0,e.forwardRef)(function({align:e=`start`,className:n,...i},a){return(0,t.jsx)(`td`,{...i,ref:a,className:r(Y.td,Y[e],n)})}),vt=(0,e.forwardRef)(function({className:e,...n},i){return(0,t.jsx)(`caption`,{...n,ref:i,className:r(Y.caption,e)})}),yt={root:`cui-PageHeader-module__root--agDwp`,main:`cui-PageHeader-module__main--ePn-k`,back:`cui-PageHeader-module__back--L-i-M`,heading:`cui-PageHeader-module__heading--tWgg0`,title:`cui-PageHeader-module__title--mv-ab`,subtitle:`cui-PageHeader-module__subtitle--NHWmM`,actions:`cui-PageHeader-module__actions--6XyFL`};function bt({title:e,subtitle:n,onBack:i,backLabel:a=`Go back`,actions:o,className:s,...c}){return h()?(0,t.jsxs)(`header`,{...c,className:r(yt.root,s),children:[(0,t.jsxs)(`div`,{className:yt.main,children:[i?(0,t.jsx)(`button`,{type:`button`,className:yt.back,"aria-label":a,onClick:i,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`m12 19-7-7 7-7M19 12H5`})})}):null,(0,t.jsxs)(`div`,{className:yt.heading,children:[(0,t.jsx)(`h1`,{className:yt.title,children:e}),n?(0,t.jsx)(`p`,{className:yt.subtitle,children:n}):null]})]}),o?(0,t.jsx)(`div`,{className:yt.actions,children:o}):null]}):(0,t.jsx)(_,{})}var xt={pill:`cui-StatusPill-module__pill--kySDR`,label:`cui-StatusPill-module__label--tqHM5`,dot:`cui-StatusPill-module__dot--pfXRR`,pulse:`cui-StatusPill-module__pulse--UHRQO`,"cui-status-pulse":`cui-StatusPill-module__cui-status-pulse--Li6eg`,success:`cui-StatusPill-module__success--gn6ct`,info:`cui-StatusPill-module__info--hBiaf`,danger:`cui-StatusPill-module__danger--G-Lnk`,warning:`cui-StatusPill-module__warning--9shGi`,neutral:`cui-StatusPill-module__neutral--FL7Kb`,empty:`cui-StatusPill-module__empty--78LZC`},St={active:`success`,completed:`info`,expired:`danger`,cancelled:`danger`,canceled:`danger`,pending:`warning`};function Ct({status:e,tone:n,className:i,...a}){if(!e)return(0,t.jsx)(`span`,{className:xt.empty,children:`—`});let o=e.trim().toLowerCase(),s=n??St[o]??`neutral`,c=s===`success`||o===`completed`;return(0,t.jsxs)(`span`,{className:r(xt.pill,xt[s],i),...a,children:[(0,t.jsx)(`span`,{className:r(xt.dot,c&&xt.pulse),"aria-hidden":`true`}),(0,t.jsx)(`span`,{className:xt.label,children:e})]})}var wt={root:`cui-Checkbox-module__root--mY3qk`,label:`cui-Checkbox-module__label--cwRtI`,disabled:`cui-Checkbox-module__disabled--x7-eg`,input:`cui-Checkbox-module__input--2kt-h`,box:`cui-Checkbox-module__box--OCPee`,check:`cui-Checkbox-module__check--4HYWn`,dash:`cui-Checkbox-module__dash--5Dkdl`,invalid:`cui-Checkbox-module__invalid---Cs7q`,text:`cui-Checkbox-module__text--EmtRj`,required:`cui-Checkbox-module__required--t9DLN`,message:`cui-Checkbox-module__message--ZPKsV`,helper:`cui-Checkbox-module__helper--16DrX`,error:`cui-Checkbox-module__error--E-bmD`},Tt=(0,e.forwardRef)(function({label:n,helperText:i,error:a,indeterminate:o=!1,id:s,required:c,disabled:l,"aria-describedby":u,className:d,...f},p){let m=(0,e.useRef)(null),g=(0,e.useCallback)(e=>{m.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]);(0,e.useEffect)(()=>{m.current&&(m.current.indeterminate=o)},[o]);let v=x({id:s,required:c,disabled:l,error:a,"aria-describedby":u});if(!h())return(0,t.jsx)(_,{});let y=`${v.id}-message`,b=!!(a||i),S=[v[`aria-describedby`],b?y:void 0].filter(Boolean).join(` `)||void 0;return(0,t.jsxs)(`div`,{className:r(wt.root,d),children:[(0,t.jsxs)(`label`,{className:r(wt.label,v.disabled&&wt.disabled),children:[(0,t.jsx)(`input`,{...f,ref:g,id:v.id,type:`checkbox`,required:v.required,disabled:v.disabled,"aria-invalid":v[`aria-invalid`],"aria-describedby":S,className:r(wt.input,v.invalid&&wt.invalid)}),(0,t.jsxs)(`span`,{className:wt.box,"aria-hidden":`true`,children:[(0,t.jsx)(`svg`,{className:wt.check,viewBox:`0 0 20 20`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4.5 10.5l3.5 3.5 7.5-8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,t.jsx)(`svg`,{className:wt.dash,viewBox:`0 0 20 20`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M5 10h10`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`})})]}),n?(0,t.jsxs)(`span`,{className:wt.text,children:[n,v.required?(0,t.jsx)(`span`,{className:wt.required,"aria-hidden":`true`,children:`*`}):null]}):null]}),b?(0,t.jsx)(`p`,{id:y,className:r(wt.message,a?wt.error:wt.helper),role:a?`alert`:void 0,children:a||i}):null]})}),Et={root:`cui-DropdownMenu-module__root--5ZetV`,trigger:`cui-DropdownMenu-module__trigger--9fhIT`,open:`cui-DropdownMenu-module__open--tByXu`,custom:`cui-DropdownMenu-module__custom--Ow9rI`,menu:`cui-DropdownMenu-module__menu---RiRW`,"cui-dropdown-in":`cui-DropdownMenu-module__cui-dropdown-in--pvAgp`,item:`cui-DropdownMenu-module__item--T-QPZ`,danger:`cui-DropdownMenu-module__danger--C0jN3`,label:`cui-DropdownMenu-module__label--6yP76`,icon:`cui-DropdownMenu-module__icon--zOP3d`},Dt=4,Ot=192,kt=200,At=`[role="menuitem"]:not([aria-disabled="true"])`;function jt({items:i,position:a=`right`,label:o=`More actions`,children:s,onOpenChange:c,disabled:l=!1,className:u}){let d=h(),f=`${(0,e.useId)()}-menu`,p=(0,e.useRef)(null),m=(0,e.useRef)(null),[g,v]=(0,e.useState)(!1),[y,b]=(0,e.useState)(null),[x,S]=(0,e.useState)(),[C,w]=(0,e.useState)(0),T=(0,e.useRef)(c);(0,e.useEffect)(()=>{T.current=c});let E=(0,e.useCallback)(()=>{let e=p.current;if(!e)return;let t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,r=n<kt&&t.top>n?{bottom:window.innerHeight-t.top+Dt}:{top:t.bottom+Dt},i=t.left+Ot<=window.innerWidth-8;a===`right`&&i?r.left=t.left:r.right=Math.max(8,window.innerWidth-t.right),b(e=>e&&e.top===r.top&&e.bottom===r.bottom&&e.left===r.left&&e.right===r.right?e:r)},[a]),D=e=>{v(e),T.current?.(e)},O=()=>{l||(E(),S(p.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),D(!0))},k=(e=!0)=>{D(!1),e&&w(e=>e+1)};if((0,e.useEffect)(()=>{C>0&&p.current?.focus({preventScroll:!0})},[C]),(0,e.useEffect)(()=>{g&&m.current?.querySelector(At)?.focus({preventScroll:!0})},[g]),(0,e.useEffect)(()=>{if(!g)return;let e=()=>requestAnimationFrame(E),t=e=>{let t=e.target;!p.current?.contains(t)&&!m.current?.contains(t)&&(v(!1),T.current?.(!1))};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[g,E]),!d)return(0,t.jsx)(_,{});let A=e=>{let t=Array.from(m.current?.querySelectorAll(At)??[]);if(t.length===0)return;let n=t.indexOf(document.activeElement);t[e===`first`?0:e===`last`?t.length-1:(n+e+t.length)%t.length]?.focus({preventScroll:!0})};return(0,t.jsxs)(`span`,{className:r(Et.root,u),children:[(0,t.jsx)(`button`,{ref:p,type:`button`,className:r(Et.trigger,g&&Et.open,s!==void 0&&Et.custom),"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":g?f:void 0,"aria-label":o,title:o,disabled:l,onClick:()=>g?k(!1):O(),onKeyDown:e=>{!g&&(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),O())},children:s??(0,t.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`10`,cy:`4`,r:`1.6`}),(0,t.jsx)(`circle`,{cx:`10`,cy:`10`,r:`1.6`}),(0,t.jsx)(`circle`,{cx:`10`,cy:`16`,r:`1.6`})]})}),g&&y?(0,n.createPortal)((0,t.jsx)(`div`,{ref:m,id:f,role:`menu`,"aria-label":o,className:Et.menu,style:y,"data-theme":x,onKeyDown:e=>{let t={ArrowDown:()=>A(1),ArrowUp:()=>A(-1),Home:()=>A(`first`),End:()=>A(`last`),Escape:()=>k(),Tab:()=>k()}[e.key];t&&(e.key!==`Tab`&&(e.preventDefault(),e.stopPropagation()),t())},children:i.map((e,n)=>(0,t.jsxs)(`button`,{type:`button`,role:`menuitem`,tabIndex:-1,"aria-disabled":e.disabled||void 0,className:r(Et.item,e.variant===`danger`&&Et.danger),onClick:()=>{if(!e.disabled)try{e.onClick()}finally{k()}},children:[(0,t.jsx)(`span`,{className:Et.label,children:e.label}),e.icon?(0,t.jsx)(`span`,{className:Et.icon,"aria-hidden":`true`,children:e.icon}):null]},`${e.label}-${n}`))}),B()):null]})}var Mt={root:`cui-Skeleton-module__root--qaX19`,"cui-skeleton-pulse":`cui-Skeleton-module__cui-skeleton-pulse--HzSoY`,rect:`cui-Skeleton-module__rect--do1uR`,text:`cui-Skeleton-module__text---A8IF`,circle:`cui-Skeleton-module__circle--DYcl8`};function Nt({variant:e=`rect`,width:n,height:i,className:a,style:o,...s}){if(!h())return(0,t.jsx)(_,{});let c={width:n,height:i??(e===`circle`?n:void 0)};return(0,t.jsx)(`span`,{"aria-hidden":`true`,...s,className:r(Mt.root,Mt[e],a),style:{...c,...o}})}var X={root:`cui-DataTable-module__root--HvZz-`,toolbar:`cui-DataTable-module__toolbar--4lbQW`,tableArea:`cui-DataTable-module__tableArea--2IsW7`,scroll:`cui-DataTable-module__scroll--grEU0`,selectCell:`cui-DataTable-module__selectCell--yjLWA`,actionsColumn:`cui-DataTable-module__actionsColumn--6fXOt`,actions:`cui-DataTable-module__actions--1wPSm`,actionButton:`cui-DataTable-module__actionButton--ihRbN`,actionDanger:`cui-DataTable-module__actionDanger--CkExi`,actionText:`cui-DataTable-module__actionText--6T0WJ`,cellText:`cui-DataTable-module__cellText--1ji4z`,stateBox:`cui-DataTable-module__stateBox--O065C`,empty:`cui-DataTable-module__empty--s0Jz2`,emptyIcon:`cui-DataTable-module__emptyIcon--RgTU-`,errorCell:`cui-DataTable-module__errorCell--xz1j4`,errorIcon:`cui-DataTable-module__errorIcon--Wtuhr`,errorText:`cui-DataTable-module__errorText--Huxzu`,footer:`cui-DataTable-module__footer--1nvuh`,srOnly:`cui-DataTable-module__srOnly--oPO5S`,selectionBar:`cui-DataTable-module__selectionBar--EPNRt`,selectionCount:`cui-DataTable-module__selectionCount--6vKgz`,selectionDivider:`cui-DataTable-module__selectionDivider--Ye0rn`,bulkButton:`cui-DataTable-module__bulkButton--YxXgc`,bulkDanger:`cui-DataTable-module__bulkDanger--nRDT6`,selectionClear:`cui-DataTable-module__selectionClear--XAB0l`};function Pt({count:e,actions:n=[],onClear:i,className:a}){return e<=0?null:(0,t.jsxs)(`div`,{role:`region`,"aria-label":`Selection`,className:r(X.selectionBar,a),children:[(0,t.jsxs)(`span`,{className:X.selectionCount,"aria-live":`polite`,children:[e,` selected`]}),n.length>0?(0,t.jsx)(`span`,{className:X.selectionDivider,"aria-hidden":`true`}):null,n.map(e=>(0,t.jsxs)(y,{variant:`outline`,size:`sm`,className:r(X.bulkButton,e.variant===`danger`&&X.bulkDanger),disabled:e.disabled,onClick:e.onClick,children:[e.icon,e.label]},e.label)),(0,t.jsx)(`button`,{type:`button`,className:X.selectionClear,onClick:i,children:`Clear selection`})]})}function Ft({field:e,value:n,onChange:r,label:i,ariaLabel:a,size:o=`md`,placeholder:s}){let c=i?{label:i}:{"aria-label":a??e.label};return e.type===`select`?(0,t.jsx)(st,{...c,size:o,placeholder:s??e.placeholder??`Any ${e.label.toLowerCase()}`,options:e.options??[],value:n,onChange:r}):e.type===`date`?(0,t.jsx)(U,{...c,size:o,placeholder:s??e.placeholder,value:n,onChange:r}):(0,t.jsx)(Ce,{...c,size:o,placeholder:s??e.placeholder,value:n,onChange:e=>r(e.target.value)})}var Z={root:`cui-TableFilters-module__root--zi-Kz`,bar:`cui-TableFilters-module__bar--B-b9P`,barEnd:`cui-TableFilters-module__barEnd--HPVWe`,search:`cui-TableFilters-module__search--QrMo-`,actions:`cui-TableFilters-module__actions--UnPiI`,filtersIcon:`cui-TableFilters-module__filtersIcon--XyAIP`,panelFooter:`cui-TableFilters-module__panelFooter--xaqMb`,count:`cui-TableFilters-module__count--5M3Un`,chips:`cui-TableFilters-module__chips--reWRQ`,chip:`cui-TableFilters-module__chip--QEswZ`,"cui-chip-in":`cui-TableFilters-module__cui-chip-in--4ge2G`,chipLabel:`cui-TableFilters-module__chipLabel--CzGgZ`,chipValue:`cui-TableFilters-module__chipValue---2oKH`,chipRemove:`cui-TableFilters-module__chipRemove--6xGcC`,clearAll:`cui-TableFilters-module__clearAll--wPJlE`,dynamic:`cui-TableFilters-module__dynamic--Y3yu6`,noFilters:`cui-TableFilters-module__noFilters--bCV6B`,rows:`cui-TableFilters-module__rows--Zj1HM`,row:`cui-TableFilters-module__row--smRHE`,rowField:`cui-TableFilters-module__rowField--n7iAh`,rowValue:`cui-TableFilters-module__rowValue--VTRCH`,rowRemove:`cui-TableFilters-module__rowRemove--ddRMK`},It=0,Lt=()=>It+=1;function Rt(e){return Object.entries(e).map(([e,t])=>({id:Lt(),key:e,value:t}))}function zt(e){let t={};for(let n of e)n.key&&n.value.trim()!==``&&(t[n.key]=n.value);return t}function Bt({fields:e,rows:n,onChange:r}){let i=new Set(n.map(e=>e.key).filter(Boolean)),a=e.filter(e=>!i.has(e.key)),o=(e,t)=>r(n.map(n=>n.id===e?{...n,...t}:n));return(0,t.jsxs)(`div`,{className:Z.dynamic,children:[n.length===0?(0,t.jsx)(`p`,{className:Z.noFilters,children:`No filters yet. Add one to narrow down the table.`}):(0,t.jsx)(`ul`,{className:Z.rows,children:n.map((a,s)=>{let c=e.find(e=>e.key===a.key),l=e.filter(e=>e.key===a.key||!i.has(e.key));return(0,t.jsxs)(`li`,{className:Z.row,"aria-label":`Filter ${s+1}`,children:[(0,t.jsx)(`div`,{className:Z.rowField,children:(0,t.jsx)(st,{"aria-label":`Field for filter ${s+1}`,size:`sm`,clearable:!1,value:a.key,options:l.map(e=>({label:e.label,value:e.key})),onChange:e=>o(a.id,{key:e,value:``})})}),(0,t.jsx)(`div`,{className:Z.rowValue,children:c?(0,t.jsx)(Ft,{field:c,value:a.value,size:`sm`,ariaLabel:`Value for ${c.label}`,onChange:e=>o(a.id,{value:e})},c.key):null}),(0,t.jsx)(`button`,{type:`button`,className:Z.rowRemove,"aria-label":`Delete ${c?.label??`empty`} filter`,onClick:()=>r(n.filter(e=>e.id!==a.id)),children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})})]},a.id)})}),(0,t.jsx)(y,{variant:`outline`,size:`sm`,disabled:a.length===0,onClick:()=>{let e=a[0];e&&r([...n,{id:Lt(),key:e.key,value:``}])},children:`+ Add filter`})]})}function Vt(e){return Object.fromEntries(Object.entries(e??{}).filter(([,e])=>e.trim()!==``))}function Ht(e,t){return e.type===`select`?e.options?.find(e=>e.value===t)?.label??t:t}function Ut({fields:n,values:r,onApply:i,onClose:a,title:o}){let[s,c]=(0,e.useState)(()=>Rt(r));return(0,t.jsx)($e,{open:!0,onClose:a,title:o,description:`Add the filters you want to use.`,size:`sm`,footer:(0,t.jsxs)(`div`,{className:Z.panelFooter,children:[(0,t.jsx)(y,{variant:`outline`,disabled:s.length===0,onClick:()=>c([]),children:`Reset`}),(0,t.jsx)(y,{onClick:()=>{i(zt(s)),a()},children:`Apply Filters`})]}),children:(0,t.jsx)(Bt,{fields:n,rows:s,onChange:c})})}function Wt({search:n=``,onSearchChange:i,searchPlaceholder:a=`Search...`,searchDelay:o=0,fields:s,values:c,onValuesChange:l,panelTitle:u=`Filters`,className:d}){let f=h(),[p,m]=(0,e.useState)(!1),[g,v]=(0,e.useState)(n),b=(0,e.useRef)(void 0),x=(0,e.useRef)(n);if(x.current!==n&&(x.current=n,n!==g&&v(n)),(0,e.useEffect)(()=>()=>clearTimeout(b.current),[]),!f)return(0,t.jsx)(_,{});let S=Vt(c),C=(s??[]).filter(e=>S[e.key]!==void 0),w=!!(s&&s.length>0&&l),T=e=>{v(e),clearTimeout(b.current),o>0?b.current=setTimeout(()=>i?.(e),o):i?.(e)};return(0,t.jsxs)(`div`,{className:r(Z.root,d),children:[(0,t.jsxs)(`div`,{className:Z.bar,children:[i?(0,t.jsx)(`div`,{className:Z.search,children:(0,t.jsx)(De,{"aria-label":`Search`,size:`sm`,placeholder:a,value:g,onChange:e=>T(e.target.value),onClear:()=>T(``)})}):null,(0,t.jsx)(`div`,{className:Z.barEnd,children:w?(0,t.jsxs)(y,{variant:`outline`,size:`sm`,"aria-haspopup":`dialog`,onClick:()=>m(!0),children:[(0,t.jsx)(`svg`,{className:Z.filtersIcon,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M3 5.5h14M5.5 10h9M8 14.5h4`})}),`Filters`,C.length>0?(0,t.jsx)(`span`,{className:Z.count,"aria-label":`${C.length} active`,children:C.length}):null]}):null})]}),C.length>0?(0,t.jsxs)(`ul`,{className:Z.chips,"aria-label":`Active filters`,children:[C.map(e=>(0,t.jsxs)(`li`,{className:Z.chip,children:[(0,t.jsxs)(`span`,{className:Z.chipLabel,children:[e.label,`:`]}),` `,(0,t.jsx)(`strong`,{className:Z.chipValue,children:Ht(e,S[e.key])}),(0,t.jsx)(`button`,{type:`button`,className:Z.chipRemove,"aria-label":`Remove filter ${e.label}`,onClick:()=>{let{[e.key]:t,...n}=S;l?.(n)},children:(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})})})]},e.key)),(0,t.jsx)(`li`,{children:(0,t.jsxs)(`button`,{type:`button`,className:Z.clearAll,onClick:()=>l?.({}),children:[(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M4 10a6 6 0 106-6H7M7 1.5L4.5 4 7 6.5`})}),`Clear all`]})})]}):null,p&&w?(0,t.jsx)(Ut,{fields:s??[],values:S,title:u,onApply:e=>l?.(e),onClose:()=>m(!1)}):null]})}function Gt(e,t){return e.accessor?e.accessor(t):t[String(e.accessorKey)]}var Kt=e=>e==null?``:e instanceof Date?e.toISOString():String(e);function qt(e,t,n){let r=n.trim().toLowerCase();return r?e.filter(e=>t.some(t=>(t.searchValue?t.searchValue(e):Kt(Gt(t,e))).toLowerCase().includes(r))):e}function Jt(e,t,n){let r=Object.entries(n).filter(([,e])=>e.trim()!==``);return r.length===0?e:e.filter(e=>r.every(([n,r])=>{let i=t.find(e=>String(e.accessorKey)===n);if(!i)return!0;if(i.filterFn)return i.filterFn(e,r);let a=Kt(Gt(i,e));return i.filterType===`select`||i.filterType===`date`?a===r:a.toLowerCase().includes(r.trim().toLowerCase())}))}var Yt=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`});function Xt(e,t,n){if(!n)return e;let r=t.find(e=>String(e.accessorKey)===n.key);if(!r)return e;let i=e=>r.sortValue?r.sortValue(e):Gt(r,e),a=n.direction===`asc`?1:-1;return e.map((e,t)=>({row:e,index:t,value:i(e)})).sort((e,t)=>{let n=e.value===null||e.value===void 0||e.value===``,r=t.value===null||t.value===void 0||t.value===``;if(n||r)return n===r?e.index-t.index:n?1:-1;let i=typeof e.value==`number`&&typeof t.value==`number`?e.value-t.value:e.value instanceof Date&&t.value instanceof Date?e.value.getTime()-t.value.getTime():Yt.compare(Kt(e.value),Kt(t.value));return i===0?e.index-t.index:i*a}).map(e=>e.row)}function Zt(e,t,n){let r=(Math.max(1,t)-1)*n;return e.slice(r,r+n)}function Qt(e,t){return!e||e.key!==t?{key:t,direction:`asc`}:e.direction===`asc`?{key:t,direction:`desc`}:null}var $t=[10,15,20,50,100],en=async(e,t)=>await(await fetch(e,t)).json();function tn(e){let t=/^https?:/i.test(e.fetchUrl)?e.fetchUrl:`${e.apiBaseUrl??``}${e.fetchUrl}`,n=[];e.search&&n.push(`searchText:${e.search}`),e.additionalFilter&&n.push(e.additionalFilter),e.sort&&(n.push(`orderByColumn:${e.sort.key}`),n.push(`orderBy:${e.sort.direction}`));for(let[t,r]of Object.entries(e.filters))r&&n.push(`${t}:${r}`);let r=new URLSearchParams;return r.append(`pageNo`,String(e.pageNo)),r.append(`pageSize`,String(e.pageSize)),n.length>0&&r.append(`filter`,n.join(`;`)),`${t}${t.includes(`?`)?`&`:`?`}${r.toString()}`}function nn(e){let t=e.data,n=Array.isArray(t)?t:t?.items??t??[],r=Array.isArray(t)?{}:t??{};return{rows:Array.isArray(n)?n:[],totalPages:r.totalPage??0,totalItems:r.totalData??0}}var rn=class extends Error{};async function an(e,t){let n=await t(e,{method:`GET`});if(n.status===!1)throw new rn(n.message||`Failed to fetch data`);return nn(n)}async function on(e,t){let n=[],r=1,i;do{let a=await an(e(r,100),t);n.push(...a.rows),i=a.totalPages||1,r+=1}while(r<=i&&r<=100);return n}function sn(t,n){let[r,i]=(0,e.useState)(t);return(0,e.useEffect)(()=>{if(n<=0)return;let e=setTimeout(()=>i(t),n);return()=>clearTimeout(e)},[t,n]),n<=0?t:r}var cn=[128,80,96],ln=e=>e===`left`?`start`:e===`right`?`end`:e,un=(0,t.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,t.jsx)(`path`,{d:`M12 7.5v5M12 16h.01`})]}),dn=(0,t.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`5`,rx:`1`}),(0,t.jsx)(`path`,{d:`M5 9v9a1 1 0 001 1h12a1 1 0 001-1V9M10 13h4`})]});function fn({columns:n,data:i,fetchUrl:a,apiBaseUrl:o,callApi:s=en,additionalFilter:c,refreshTrigger:l,debounceMs:u,registerApi:d,getRowId:f,loading:p=!1,loadingRows:m=5,emptyMessage:g,emptyState:v,searchable:b=!0,searchPlaceholder:x,search:S,defaultSearch:C=``,onSearchChange:w,filters:T,defaultFilters:E,onFiltersChange:D,manualFiltering:O=!1,sort:k,defaultSort:A=null,onSortChange:j,manualSorting:ee=!1,pagination:M,page:N,defaultPage:P=1,onPageChange:F,pageSize:te,defaultPageSize:I=10,onPageSizeChange:L,pageSizeOptions:R=$t,manualPagination:ne=!1,totalItems:re,selection:z,onRowClick:B,actions:V,actionsClassName:ie,belowToolbar:ae,bulkActions:H,caption:oe,stickyHeader:se=!0,className:ce,tableClassName:U,containerClassName:le,"aria-label":W}){let ue=h(),G=a!==void 0,de=M??!0,[fe,pe]=(0,e.useState)(C),[me,he]=(0,e.useState)(E??{}),[ge,_e]=(0,e.useState)(A),[ve,ye]=(0,e.useState)(P),[be,xe]=(0,e.useState)(I),K=S??fe,Se=T??me,Ce=k===void 0?ge:k,we=te??be,Te=N??ve,Ee=(0,e.useMemo)(()=>n.filter(e=>e.filterable).map(e=>({key:String(e.accessorKey),label:typeof e.header==`string`?e.header:String(e.accessorKey),type:e.filterType??`text`,options:e.filterOptions})),[n]),De=()=>{Te!==1&&(N===void 0&&ye(1),F?.(1))},Oe=e=>{S===void 0&&pe(e),w?.(e),De()},ke=e=>{T===void 0&&he(e),D?.(e),De()},Ae=e=>{let t=Qt(Ce,e);k===void 0&&_e(t),j?.(t)},je=e=>{N===void 0&&ye(e),F?.(e)},Me=e=>{te===void 0&&xe(e),L?.(e),De()},Ne=u??(G?500:0),Pe=sn(K,Ne),Fe=sn(Se,Ne),Ie=JSON.stringify([a,o,c,l,de,Te,we,Ce,Pe,Fe]),[Le,Re]=(0,e.useState)(null);(0,e.useEffect)(()=>{if(!G)return;let e=!1,t=(e,t)=>tn({fetchUrl:a,apiBaseUrl:o,pageNo:e,pageSize:t,search:Pe,additionalFilter:c,sort:Ce,filters:Fe});return(async()=>{try{if(de){let e=await an(t(Te,we),s);return{key:Ie,error:null,...e}}let e=await on(t,s);return{key:Ie,error:null,rows:e,totalPages:0,totalItems:0}}catch(e){let t=e instanceof Error&&e.message?e.message:`An unexpected error occurred`;return{key:Ie,error:t,rows:[],totalPages:0,totalItems:0}}})().then(t=>{e||Re(t)}),()=>{e=!0}},[Ie]),(0,e.useEffect)(()=>{d?.({updateRow:(e,t)=>Re(n=>n&&{...n,rows:n.rows.map(n=>n.id===e?{...n,...t}:n)})})},[d]);let ze=G?Le?.key!==Ie:p,Be=G&&!ze?Le?.error??null:null,Ve=(0,e.useMemo)(()=>G?Le?.rows??[]:i??[],[G,Le,i]),He=G||O,Ue=(0,e.useMemo)(()=>{let e=Ve;return He||(e=Jt(qt(e,n,K),n,Se)),G||ee||(e=Xt(e,n,Ce)),e},[Ve,n,K,Se,Ce,He,G,ee]);if(!ue)return(0,t.jsx)(_,{});let We=G||ne,Ge=G?Le?.totalItems??0:ne?re??Ve.length:Ue.length,Ke=G?Math.max(1,Le?.totalPages??1):Math.max(1,Math.ceil(Ge/we)),qe=Math.min(Math.max(1,Te),Ke),Je=!de||We?Ue:Zt(Ue,qe,we),Ye=(e,t)=>String(f?f(e,t):e.id??t),Xe=Je.map(Ye),Ze=z?.selected??[],Qe=Xe.filter(e=>Ze.includes(e)),$e=Xe.length>0&&Qe.length===Xe.length,et=Qe.length>0&&!$e,tt=()=>{z&&z.onChange($e?Ze.filter(e=>!Xe.includes(e)):[...new Set([...Ze,...Xe])])},q=e=>{z&&z.onChange(Ze.includes(e)?Ze.filter(t=>t!==e):[...Ze,e])},nt=!!(V&&V.length>0),rt=b||Ee.length>0,it=K.trim()!==``||Object.values(Se).some(e=>e.trim()!==``),at=n.length+ +!!z+ +!!nt,ot={onClick:e=>e.stopPropagation()},st=g??`No data available`,ct=(e,t)=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),B?.(t))},J=e=>{let n=(V??[]).filter(t=>!t.hidden?.(e));if(n.length===0)return null;let i=e=>e.variant===`danger`;if(n.length===1){let a=n[0];return(0,t.jsx)(`button`,{type:`button`,className:r(X.actionButton,i(a)&&X.actionDanger),title:a.label,"aria-label":a.label,onClick:()=>a.onClick(e),children:a.icon??(0,t.jsx)(`span`,{className:X.actionText,children:a.label})})}return(0,t.jsx)(jt,{items:n.map(t=>({label:t.label,icon:t.icon,variant:i(t)?`danger`:`default`,onClick:()=>t.onClick(e)}))})},lt=(0,t.jsx)(`div`,{className:X.tableArea,"aria-busy":ze||void 0,children:(0,t.jsxs)(dt,{"aria-label":W,scrollLabel:W?`${W} (scrollable)`:void 0,stickyHeader:se,bordered:!1,className:U,containerClassName:r(X.scroll,le),children:[oe?(0,t.jsx)(vt,{children:oe}):null,(0,t.jsx)(ft,{children:(0,t.jsxs)(ht,{children:[z?(0,t.jsx)(gt,{className:X.selectCell,children:(0,t.jsx)(Tt,{"aria-label":`Select all rows`,checked:$e,indeterminate:et,disabled:Xe.length===0||ze,onChange:tt})}):null,n.map(e=>{let n=String(e.accessorKey);return(0,t.jsx)(gt,{align:ln(e.align),sortable:e.sortable,sortDirection:Ce?.key===n?Ce.direction:null,onSort:()=>Ae(n),className:e.className,style:e.width===void 0?void 0:{width:e.width},children:e.header},n)}),nt?(0,t.jsx)(gt,{align:`center`,className:ie??X.actionsColumn,children:`Actions`}):null]})}),(0,t.jsx)(pt,{children:Be?(0,t.jsx)(ht,{children:(0,t.jsx)(_t,{colSpan:at,className:X.errorCell,children:(0,t.jsxs)(`div`,{className:X.stateBox,role:`alert`,children:[(0,t.jsx)(`span`,{className:X.errorIcon,children:un}),(0,t.jsx)(`span`,{className:X.errorText,children:Be})]})})}):ze?Array.from({length:m},(e,n)=>(0,t.jsx)(ht,{children:Array.from({length:at},(e,n)=>(0,t.jsx)(_t,{align:nt&&n===at-1?`center`:void 0,children:nt&&n===at-1?(0,t.jsx)(Nt,{width:32,height:32,style:{borderRadius:6,display:`inline-block`}}):(0,t.jsx)(Nt,{variant:`text`,height:16,width:cn[n===0?0:n%2==0?2:1],style:{borderRadius:4}})},n))},`loading-${n}`)):Je.length===0?(0,t.jsx)(ht,{children:(0,t.jsx)(_t,{colSpan:at,className:X.empty,children:v??(0,t.jsxs)(`div`,{className:X.stateBox,children:[(0,t.jsx)(`span`,{className:X.emptyIcon,children:dn}),(0,t.jsx)(`span`,{children:it?`No results match your search or filters.`:st}),it?(0,t.jsx)(y,{variant:`link`,size:`sm`,onClick:()=>{Oe(``),ke({})},children:`Clear search and filters`}):null]})})}):Je.map((e,r)=>{let i=Ye(e,r),a=Ze.includes(i);return(0,t.jsxs)(ht,{selected:a,onClick:B?()=>B(e):void 0,onKeyDown:B?t=>ct(t,e):void 0,tabIndex:B?0:void 0,children:[z?(0,t.jsx)(_t,{className:X.selectCell,...ot,children:(0,t.jsx)(Tt,{"aria-label":`Select row`,checked:a,onChange:()=>q(i)})}):null,n.map(n=>{let r=Gt(n,e);return(0,t.jsx)(_t,{align:ln(n.align),className:n.className,style:n.width===void 0?void 0:{width:n.width},children:n.render?n.render(r,e):(0,t.jsx)(`span`,{className:X.cellText,children:r==null?`-`:String(r)})},String(n.accessorKey))}),nt?(0,t.jsx)(_t,{align:`center`,className:ie??X.actionsColumn,...ot,children:(0,t.jsx)(`div`,{className:X.actions,children:J(e)})}):null]},i)})})]})});return(0,t.jsxs)(`div`,{className:r(X.root,ce),children:[rt?(0,t.jsx)(`div`,{className:X.toolbar,children:(0,t.jsx)(Wt,{search:b?K:void 0,onSearchChange:b?Oe:void 0,searchPlaceholder:x??`Search...`,fields:Ee,values:Se,onValuesChange:Ee.length>0?ke:void 0})}):null,z&&Ze.length>0?(0,t.jsx)(Pt,{count:Ze.length,actions:H?.map(e=>({...e,onClick:()=>e.onClick(Ze)})),onClear:()=>z.onChange([])}):null,ae,lt,(0,t.jsx)(`div`,{role:`status`,className:X.srOnly,children:ze?`Loading`:Be?`Error`:`${Ge} ${Ge===1?`result`:`results`}`}),de?(0,t.jsx)(`div`,{className:X.footer,children:(0,t.jsx)(ut,{layout:`split`,page:qe,pageCount:Ke,onPageChange:je,pageSize:we,totalItems:Ge,pageSizeOptions:R,onPageSizeChange:Me,disabled:ze})}):null]})}function pn(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;let t=e/1048576;return`${t<10?t.toFixed(1):Math.round(t)} MB`}function mn(e,t){let n=(t??``).split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(e.slice(0,-1)):i===e)}var hn=(e,t)=>e.name===t.name&&e.size===t.size&&e.lastModified===t.lastModified,gn=e=>`${e.name}-${e.size}-${e.lastModified}`,_n=e=>e.type.startsWith(`image/`),vn={backdrop:`cui-ImageCropper-module__backdrop--0zPLq`,dialog:`cui-ImageCropper-module__dialog--h13vH`,title:`cui-ImageCropper-module__title--ZWlWm`,frame:`cui-ImageCropper-module__frame--yTW8V`,circle:`cui-ImageCropper-module__circle--GRs32`,image:`cui-ImageCropper-module__image--vUaXt`,loading:`cui-ImageCropper-module__loading--rNK90`,zoom:`cui-ImageCropper-module__zoom--CIboz`,error:`cui-ImageCropper-module__error---SDrv`,actions:`cui-ImageCropper-module__actions--OC3A0`,cancel:`cui-ImageCropper-module__cancel--miwJS`,apply:`cui-ImageCropper-module__apply--9Ncg6`},yn=280,bn=4,xn=12,Sn=e=>e===`image/png`?`png`:e===`image/webp`?`webp`:`jpg`;function Cn({file:i,aspect:a,shape:o,outputWidth:s,outputType:c,outputQuality:l,title:u=`Crop photo`,theme:d,onApply:f,onCancel:p}){let m=(0,e.useId)(),h=(0,e.useRef)(null),[g,_]=(0,e.useState)(null),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(1),[S,C]=(0,e.useState)({x:0,y:0}),[w,T]=(0,e.useState)(!1),E=(0,e.useRef)(null),D=a>=1?yn:Math.round(yn*a),O=a>=1?Math.round(yn/a):yn;(0,e.useEffect)(()=>{let e=document.activeElement;return h.current?.focus({preventScroll:!0}),()=>e?.focus?.({preventScroll:!0})},[]),(0,e.useEffect)(()=>{let e,t=new Image;t.onload=()=>_({image:t,width:t.naturalWidth,height:t.naturalHeight}),t.onerror=()=>y(!0);try{e=URL.createObjectURL(i),t.src=e}catch{t.onerror?.(new Event(`error`))}return()=>{t.onload=null,t.onerror=null,e&&URL.revokeObjectURL(e)}},[i]);let k=g?Math.max(D/g.width,O/g.height):1,A=k*b,j=(e,t,n)=>{if(!g)return{x:0,y:0};let r=Math.max(0,(g.width*n-D)/2),i=Math.max(0,(g.height*n-O)/2);return{x:Math.min(r,Math.max(-r,e)),y:Math.min(i,Math.max(-i,t))}},ee=e=>{let t=Math.min(bn,Math.max(1,e));x(t),C(e=>j(e.x,e.y,k*t))},M=(e,t)=>C(n=>j(n.x+e,n.y+t,A)),N=e=>{e.currentTarget.setPointerCapture?.(e.pointerId),E.current={x:e.clientX,y:e.clientY,ox:S.x,oy:S.y}},P=e=>{let t=E.current;t&&C(j(t.ox+e.clientX-t.x,t.oy+e.clientY-t.y,A))},F=()=>{E.current=null},te=()=>{if(!g||w)return;T(!0);let e=Math.round(s),t=Math.max(1,Math.round(s/a)),n=document.createElement(`canvas`);n.width=e,n.height=t;let r=n.getContext(`2d`);if(!r){T(!1),y(!0);return}let o=(g.width*A-D)/2/A-S.x/A,u=(g.height*A-O)/2/A-S.y/A;r.imageSmoothingQuality=`high`,r.drawImage(g.image,o,u,D/A,O/A,0,0,e,t),n.toBlob(e=>{if(!e){T(!1),y(!0);return}let t=i.name.replace(/\.[^.]+$/,``)||`photo`,n=e.type||c;f(new File([e],`${t}.${Sn(n)}`,{type:n,lastModified:Date.now()}))},c,l)},I=(0,t.jsx)(`div`,{className:vn.backdrop,"data-theme":d,children:(0,t.jsxs)(`div`,{ref:h,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m,tabIndex:-1,className:vn.dialog,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),p();return}if(e.key===`Tab`){let t=Array.from(h.current?.querySelectorAll(`button:not([disabled]), input, [tabindex="0"]`)??[]),n=t[0],r=t[t.length-1];if(!n||!r)return;e.shiftKey&&(document.activeElement===n||document.activeElement===h.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}},children:[(0,t.jsx)(`h2`,{id:m,className:vn.title,children:u}),v?(0,t.jsx)(`p`,{className:vn.error,role:`alert`,children:`This image could not be opened. Try a different file.`}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`div`,{className:r(vn.frame,o===`circle`&&vn.circle),style:{width:D,height:O},tabIndex:0,role:`group`,"aria-label":`Crop area. Drag, or use the arrow keys to move the photo and plus and minus to zoom.`,onPointerDown:N,onPointerMove:P,onPointerUp:F,onPointerCancel:F,onKeyDown:e=>{let t={ArrowLeft:[xn,0],ArrowRight:[-12,0],ArrowUp:[0,xn],ArrowDown:[0,-12]}[e.key];t?(e.preventDefault(),M(t[0],t[1])):e.key===`+`||e.key===`=`?(e.preventDefault(),ee(b+.1)):e.key===`-`?(e.preventDefault(),ee(b-.1)):e.key===`Enter`&&(e.preventDefault(),te())},children:g?(0,t.jsx)(`img`,{src:g.image.src,alt:``,draggable:!1,className:vn.image,style:{width:g.width*A,height:g.height*A,transform:`translate(calc(-50% + ${S.x}px), calc(-50% + ${S.y}px))`}}):(0,t.jsx)(`span`,{className:vn.loading,children:`Loading…`})}),(0,t.jsxs)(`label`,{className:vn.zoom,children:[(0,t.jsx)(`span`,{children:`Zoom`}),(0,t.jsx)(`input`,{type:`range`,min:1,max:bn,step:.01,value:b,disabled:!g,"aria-label":`Zoom`,onChange:e=>ee(Number(e.target.value))})]})]}),(0,t.jsxs)(`div`,{className:vn.actions,children:[(0,t.jsx)(`button`,{type:`button`,className:vn.cancel,onClick:p,children:`Cancel`}),(0,t.jsx)(`button`,{type:`button`,className:vn.apply,disabled:!g||w||v,onClick:te,children:w?`Saving…`:`Apply`})]})]})});return(0,n.createPortal)(I,B())}var Q={root:`cui-FileInput-module__root--UvQj-`,zone:`cui-FileInput-module__zone--KEX1g`,disabled:`cui-FileInput-module__disabled--uRez3`,dragging:`cui-FileInput-module__dragging--4Sxh9`,invalid:`cui-FileInput-module__invalid--2Qqgy`,tile:`cui-FileInput-module__tile--FgwD7`,addTile:`cui-FileInput-module__addTile--sQKX0`,fieldFace:`cui-FileInput-module__fieldFace--DCcJw`,input:`cui-FileInput-module__input--dBre-`,icon:`cui-FileInput-module__icon--5x7xh`,browseLink:`cui-FileInput-module__browseLink--Trbwz`,hint:`cui-FileInput-module__hint--2lRnS`,hintText:`cui-FileInput-module__hintText--QTvBs`,list:`cui-FileInput-module__list--TzN0u`,item:`cui-FileInput-module__item--ud4cx`,itemThumb:`cui-FileInput-module__itemThumb--HcBdl`,itemIcon:`cui-FileInput-module__itemIcon--qwa4y`,name:`cui-FileInput-module__name--INaW3`,size:`cui-FileInput-module__size--x3JyK`,remove:`cui-FileInput-module__remove--STMmH`,rejected:`cui-FileInput-module__rejected--Fu9ek`,buttonRow:`cui-FileInput-module__buttonRow--gdqos`,buttonFace:`cui-FileInput-module__buttonFace--ClnEW`,button:`cui-FileInput-module__button--i8fAu`,buttonIcon:`cui-FileInput-module__buttonIcon--di6dt`,summary:`cui-FileInput-module__summary--5T73u`,fieldValue:`cui-FileInput-module__fieldValue--dqK5-`,fieldPlaceholder:`cui-FileInput-module__fieldPlaceholder--HZAla`,browse:`cui-FileInput-module__browse--fpTZh`,imageRoot:`cui-FileInput-module__imageRoot--rYX4H`,circle:`cui-FileInput-module__circle--bmCto`,tileImage:`cui-FileInput-module__tileImage--olRdu`,tileEmpty:`cui-FileInput-module__tileEmpty--fY9QB`,overlay:`cui-FileInput-module__overlay--IC-qb`,imageSide:`cui-FileInput-module__imageSide--g8HVF`,removeText:`cui-FileInput-module__removeText--3kIrj`,gallery:`cui-FileInput-module__gallery--wpMjX`,thumbItem:`cui-FileInput-module__thumbItem--5BdfZ`,addItem:`cui-FileInput-module__addItem--gAv77`,thumbImage:`cui-FileInput-module__thumbImage--68iIu`,thumbFallback:`cui-FileInput-module__thumbFallback--EuLpR`,thumbName:`cui-FileInput-module__thumbName--1uZrH`,thumbRemove:`cui-FileInput-module__thumbRemove--jpxg4`},wn=()=>typeof URL<`u`&&typeof URL.createObjectURL==`function`;function Tn(e){try{return URL.createObjectURL(e)}catch{return}}var En=({className:e})=>(0,t.jsx)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M12 16V4M7 9l5-5 5 5M4 16v3a1 1 0 001 1h14a1 1 0 001-1v-3`})}),Dn=({className:e})=>(0,t.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`16`,rx:`2`}),(0,t.jsx)(`circle`,{cx:`9`,cy:`10`,r:`1.5`}),(0,t.jsx)(`path`,{d:`M21 16l-5-5-8 8`})]}),On=({className:e})=>(0,t.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`path`,{d:`M7 3h7l5 5v12a1 1 0 01-1 1H7a1 1 0 01-1-1V4a1 1 0 011-1z`}),(0,t.jsx)(`path`,{d:`M14 3v5h5`})]}),kn=()=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M6 6l8 8M14 6l-8 8`})}),An=(0,e.forwardRef)(function({id:n,required:i,disabled:a,error:o,"aria-describedby":s,variant:c=`dropzone`,multiple:l,accept:u,maxSize:d,maxFiles:f,preview:p=!0,shape:m=`square`,aspectRatio:h=4/3,tileSize:g=128,crop:_=!0,cropOutputWidth:v,cropOutputType:y,cropOutputQuality:b,cropTitle:S,buttonLabel:C,placeholder:w=`No file chosen`,onFilesChange:T,className:E,...D},O){let k=x({id:n,required:i,disabled:a,error:o,"aria-describedby":s}),A=(0,e.useId)(),j=`${A}-hint`,ee=`${A}-rejected`,M=c===`image`||c===`gallery`,N=c===`gallery`?!0:c===`image`?!1:l??!1,P=u??(M?`image/*`:void 0),F=(0,e.useRef)(null),te=(0,e.useCallback)(e=>{F.current=e,typeof O==`function`?O(e):O&&(O.current=e)},[O]),[I,L]=(0,e.useState)([]),[R,ne]=(0,e.useState)([]),[re,z]=(0,e.useState)(!1),[B,V]=(0,e.useState)(null),[ie,ae]=(0,e.useState)({}),H=(0,e.useRef)({});(0,e.useEffect)(()=>()=>{Object.values(H.current).forEach(e=>URL.revokeObjectURL(e))},[]);let oe=e=>{try{let t=new DataTransfer;e.forEach(e=>t.items.add(e)),F.current&&(F.current.files=t.files)}catch{}},se=e=>{let t={};if(wn()){for(let n of e){let e=gn(n),r=H.current[e];if(r)t[e]=r;else if(_n(n)){let r=Tn(n);r&&(t[e]=r)}}for(let[e,n]of Object.entries(H.current))t[e]||URL.revokeObjectURL(n)}H.current=t,ae(t),L(e),oe(e),T?.(e)},ce=e=>{if(k.disabled||e.length===0)return;let t=[],n=[];for(let r of e)mn(r,P)?d!==void 0&&r.size>d?t.push(`${r.name}: larger than ${pn(d)}`):n.push(r):t.push(`${r.name}: file type not accepted`);let r=n[0];if(c===`image`&&_&&r&&r.type!==`image/svg+xml`){ne(t),V({file:r,theme:F.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0});return}let i;if(!N)i=n.length>0?[n[0]]:I;else{i=[...I];for(let e of n)i.some(t=>hn(t,e))||i.push(e);f!==void 0&&i.length>f&&(t.push(`You can add up to ${f} files`),i=i.slice(0,f))}ne(t),i.length!==I.length||i.some((e,t)=>e!==I[t])?se(i):oe(I)},U=e=>{ce(Array.from(e.target.files??[]))},le=e=>{e.preventDefault(),z(!1),ce(Array.from(e.dataTransfer.files))},W=e=>{ne([]),se(I.filter(t=>t!==e))},ue=[P?`Accepted: ${P.split(`,`).map(e=>e.trim()).join(`, `)}`:null,d===void 0?null:`Max ${pn(d)} each`].filter(Boolean).join(` · `),G=[k[`aria-describedby`],ue?j:void 0,R.length?ee:void 0].filter(Boolean).join(` `)||void 0,de=k.invalid||R.length>0,fe=()=>{k.disabled||F.current?.click()},pe={onDragEnter:e=>{e.preventDefault(),k.disabled||z(!0)},onDragOver:e=>e.preventDefault(),onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||z(!1)},onDrop:le},me=(0,t.jsx)(`input`,{...D,ref:te,id:k.id,type:`file`,multiple:N,accept:P,required:k.required&&I.length===0,disabled:k.disabled,"aria-invalid":de?!0:void 0,"aria-describedby":G,className:Q.input,onChange:U,onClick:e=>e.stopPropagation()}),he=m===`rectangle`?Math.max(.2,h):1,ge=Math.round(g/he),_e=v??(m===`rectangle`?800:512),ve=r(de&&Q.invalid,k.disabled&&Q.disabled),ye=I.map(e=>e.name).join(`, `),be=(e,n)=>{let r=ie[gn(e)];return r?(0,t.jsx)(`img`,{src:r,alt:``,className:n}):null},xe=I.length>0?(0,t.jsx)(`ul`,{className:Q.list,"aria-label":`Selected files`,children:I.map(e=>(0,t.jsxs)(`li`,{className:Q.item,children:[p&&ie[gn(e)]?be(e,Q.itemThumb??``):(0,t.jsx)(On,{className:Q.itemIcon}),(0,t.jsx)(`span`,{className:Q.name,children:e.name}),(0,t.jsx)(`span`,{className:Q.size,children:pn(e.size)}),(0,t.jsx)(`button`,{type:`button`,className:Q.remove,"aria-label":`Remove ${e.name}`,disabled:k.disabled,onClick:()=>W(e),children:(0,t.jsx)(kn,{})})]},gn(e)))}):null,K=ue&&c!==`dropzone`?(0,t.jsx)(`span`,{id:j,className:Q.hintText,children:ue}):null,Se;if(c===`button`)Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:Q.buttonRow,children:[(0,t.jsxs)(`div`,{className:r(Q.buttonFace,ve),onClick:fe,children:[me,(0,t.jsxs)(`span`,{className:Q.button,children:[(0,t.jsx)(En,{className:Q.buttonIcon}),C??(N?`Choose files`:`Choose file`)]})]}),(0,t.jsx)(`span`,{className:Q.summary,children:ye||w})]}),K,xe]});else if(c===`field`)Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:r(Q.fieldFace,ve),onClick:fe,children:[me,(0,t.jsx)(`span`,{className:r(Q.fieldValue,!ye&&Q.fieldPlaceholder),children:ye||w}),(0,t.jsx)(`span`,{className:Q.browse,children:`Browse`})]}),K,xe]});else if(c===`image`){let e=I[0],n=e?ie[gn(e)]:void 0;Se=(0,t.jsxs)(`div`,{className:Q.imageRoot,children:[(0,t.jsxs)(`div`,{className:r(Q.tile,m===`circle`&&Q.circle,re&&Q.dragging,ve),style:{width:g,height:ge},onClick:fe,...pe,children:[me,n?(0,t.jsx)(`img`,{src:n,alt:e?.name??``,className:Q.tileImage}):(0,t.jsxs)(`span`,{className:Q.tileEmpty,children:[(0,t.jsx)(Dn,{className:Q.icon}),(0,t.jsx)(`span`,{children:e?e.name:`Upload photo`})]}),(0,t.jsx)(`span`,{className:Q.overlay,children:e?`Change`:`Choose`})]}),(0,t.jsxs)(`div`,{className:Q.imageSide,children:[e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`span`,{className:Q.name,children:e.name}),(0,t.jsx)(`span`,{className:Q.size,children:pn(e.size)}),(0,t.jsx)(`button`,{type:`button`,className:Q.removeText,disabled:k.disabled,onClick:()=>W(e),children:`Remove image`})]}):null,K]})]})}else if(c===`gallery`){let e=f!==void 0&&I.length>=f;Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`ul`,{className:Q.gallery,"aria-label":`Selected images`,children:[I.map(e=>(0,t.jsxs)(`li`,{className:Q.thumbItem,children:[ie[gn(e)]?be(e,Q.thumbImage??``):(0,t.jsx)(`span`,{className:Q.thumbFallback,children:(0,t.jsx)(On,{className:Q.icon})}),(0,t.jsx)(`span`,{className:Q.thumbName,children:e.name}),(0,t.jsx)(`button`,{type:`button`,className:r(Q.remove,Q.thumbRemove),"aria-label":`Remove ${e.name}`,disabled:k.disabled,onClick:()=>W(e),children:(0,t.jsx)(kn,{})})]},gn(e))),e?null:(0,t.jsx)(`li`,{className:Q.addItem,children:(0,t.jsxs)(`div`,{className:r(Q.addTile,re&&Q.dragging,ve),onClick:fe,...pe,children:[me,(0,t.jsx)(Dn,{className:Q.icon}),(0,t.jsx)(`span`,{children:`Add images`})]})})]}),e?me:null,K]})}else Se=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:r(Q.zone,re&&Q.dragging,ve),onClick:fe,...pe,children:[me,(0,t.jsx)(En,{className:Q.icon}),(0,t.jsxs)(`span`,{className:Q.prompt,children:[(0,t.jsx)(`span`,{className:Q.browseLink,children:N?`Choose files`:`Choose a file`}),` `,`or drag and drop`]}),ue?(0,t.jsx)(`span`,{id:j,className:Q.hint,children:ue}):null]}),xe]});return(0,t.jsxs)(`div`,{className:r(Q.root,E),children:[Se,B?(0,t.jsx)(Cn,{file:B.file,aspect:he,shape:m===`circle`?`circle`:`rect`,outputWidth:_e,outputType:y??([`image/png`,`image/jpeg`,`image/webp`].includes(B.file.type)?B.file.type:`image/png`),outputQuality:b,title:S,theme:B.theme,onApply:e=>{V(null),se([e]),F.current?.focus({preventScroll:!0})},onCancel:()=>{V(null),oe(I),F.current?.focus({preventScroll:!0})}}):null,R.length>0?(0,t.jsx)(`p`,{id:ee,className:Q.rejected,role:`alert`,children:R.join(`. `)}):null]})}),jn=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){return h()?!e&&!n&&!r.error?(0,t.jsx)(An,{...r,ref:i}):(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:(0,t.jsx)(An,{...r,ref:i})}):(0,t.jsx)(_,{})}),Mn=new Set([`p`,`div`,`br`,`strong`,`b`,`em`,`i`,`u`,`s`,`ul`,`ol`,`li`,`blockquote`,`a`]),Nn=new Set([`script`,`style`,`iframe`,`object`,`embed`,`template`,`noscript`]),Pn=/^(https?:|mailto:|tel:|\/|#)/i;function Fn(e,t){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function In(e){for(let t of Array.from(e.childNodes))if(t.nodeType===Node.COMMENT_NODE)e.removeChild(t);else if(t.nodeType===Node.ELEMENT_NODE){let n=t,r=n.tagName.toLowerCase();if(Nn.has(r)){e.removeChild(n);continue}if(In(n),!Mn.has(r)){Fn(e,n);continue}let i=r===`a`?(n.getAttribute(`href`)??``).trim():``;for(let e of Array.from(n.attributes))n.removeAttribute(e.name);r===`a`&&(Pn.test(i)?(n.setAttribute(`href`,i),n.setAttribute(`target`,`_blank`),n.setAttribute(`rel`,`noopener noreferrer`)):Fn(e,n))}}function Ln(e){if(!e)return``;let t=new DOMParser().parseFromString(e,`text/html`);return In(t.body),t.body.innerHTML}function Rn(e){if(!e)return!0;let t=new DOMParser().parseFromString(e,`text/html`);return(t.body.textContent??``).trim()===``&&!t.body.querySelector(`li`)}var zn={textarea:`cui-Textarea-module__textarea--Z-y6g`,invalid:`cui-Textarea-module__invalid--E88X-`,"resize-none":`cui-Textarea-module__resize-none---T499`,"resize-vertical":`cui-Textarea-module__resize-vertical--P4hRY`,"resize-horizontal":`cui-Textarea-module__resize-horizontal--htj2f`,"resize-both":`cui-Textarea-module__resize-both--wR4os`,readOnly:`cui-Textarea-module__readOnly--mI513`,rich:`cui-Textarea-module__rich--dwRWk`,richDisabled:`cui-Textarea-module__richDisabled--Nt5FH`,toolbar:`cui-Textarea-module__toolbar--CWteq`,tool:`cui-Textarea-module__tool--qkdM3`,toolActive:`cui-Textarea-module__toolActive--Y3LVI`,editor:`cui-Textarea-module__editor--Pwcbx`},Bn=e=>(0,t.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:e}),Vn=[{command:`bold`,label:`Bold`,icon:Bn((0,t.jsx)(`path`,{d:`M6 4h5a3 3 0 010 6H6zM6 10h6a3 3 0 010 6H6z`}))},{command:`italic`,label:`Italic`,icon:Bn((0,t.jsx)(`path`,{d:`M8 4h6M6 16h6M11 4l-2 12`}))},{command:`underline`,label:`Underline`,icon:Bn((0,t.jsx)(`path`,{d:`M6 4v6a4 4 0 008 0V4M5 17h10`}))},{command:`insertUnorderedList`,label:`Bulleted list`,icon:Bn((0,t.jsx)(`path`,{d:`M8 5h9M8 10h9M8 15h9M3.5 5h.01M3.5 10h.01M3.5 15h.01`}))},{command:`insertOrderedList`,label:`Numbered list`,icon:Bn((0,t.jsx)(`path`,{d:`M9 5h8M9 10h8M9 15h8M3.5 4.5l1-.5v3M3 11.5h2L3 14h2`}))}],Hn=Bn((0,t.jsx)(`path`,{d:`M8.5 11.5a3 3 0 004.2 0l2.3-2.3a3 3 0 00-4.2-4.2l-.8.8M11.5 8.5a3 3 0 00-4.2 0L5 10.8a3 3 0 004.2 4.2l.8-.8`})),Un=Bn((0,t.jsx)(`path`,{d:`M5 5h10M10 5l-2 10M7 15h4M4 16l12-12`}));function Wn(){return typeof document.execCommand==`function`}function Gn(e){try{return typeof document.queryCommandState==`function`&&document.queryCommandState(e)}catch{return!1}}var Kn=e=>Ln(typeof e==`string`?e:``),qn=e=>Rn(e)?``:e;function Jn({id:n,required:i,disabled:a,error:o,"aria-describedby":s,"aria-label":c,rows:l=3,resize:u=`vertical`,readOnly:d,className:f,name:p,placeholder:m,value:h,defaultValue:g,onValueChange:_}){let v=x({id:n,required:i,disabled:a,error:o,"aria-describedby":s}),y=(0,e.useRef)(null),b=(0,e.useRef)(null),[S,C]=(0,e.useState)(()=>qn(Kn(h??g))),[w,T]=(0,e.useState)({}),E=!v.disabled&&!d;(0,e.useLayoutEffect)(()=>{let e=h??(b.current===null?g:void 0);if(typeof e!=`string`)return;let t=Kn(e);y.current&&t!==b.current&&(y.current.innerHTML=t,b.current=t,C(qn(t)))},[h]);let D=(0,e.useCallback)(()=>{let e=y.current;if(!e)return;let t=Ln(e.innerHTML);b.current=t,C(qn(t)),_?.(qn(t))},[_]),O=(0,e.useCallback)(()=>{let e=y.current,t=document.getSelection()?.anchorNode;e&&t&&e.contains(t)&&T({bold:Gn(`bold`),italic:Gn(`italic`),underline:Gn(`underline`),insertUnorderedList:Gn(`insertUnorderedList`),insertOrderedList:Gn(`insertOrderedList`)})},[]);(0,e.useEffect)(()=>(document.addEventListener(`selectionchange`,O),()=>document.removeEventListener(`selectionchange`,O)),[O]);let k=(e,t)=>{E&&Wn()&&(y.current?.focus(),document.execCommand(e,!1,t),D(),O())},A=()=>{if(!E)return;let e=window.prompt(`Link address (https://...)`);e?.trim()&&k(`createLink`,e.trim())},j=e=>e.preventDefault();return(0,t.jsxs)(`div`,{className:r(zn.rich,v.invalid&&zn.invalid,!E&&zn.richDisabled,f),children:[(0,t.jsxs)(`div`,{role:`toolbar`,"aria-label":`Formatting`,className:zn.toolbar,children:[Vn.map(e=>(0,t.jsx)(`button`,{type:`button`,className:r(zn.tool,w[e.command]&&zn.toolActive),"aria-label":e.label,title:e.label,"aria-pressed":!!w[e.command],disabled:!E,onMouseDown:j,onClick:()=>k(e.command),children:e.icon},e.command)),(0,t.jsx)(`button`,{type:`button`,className:zn.tool,"aria-label":`Link`,title:`Link`,disabled:!E,onMouseDown:j,onClick:A,children:Hn}),(0,t.jsx)(`button`,{type:`button`,className:zn.tool,"aria-label":`Clear formatting`,title:`Clear formatting`,disabled:!E,onMouseDown:j,onClick:()=>k(`removeFormat`),children:Un})]}),(0,t.jsx)(`div`,{ref:y,id:v.id,role:`textbox`,"aria-multiline":`true`,"aria-label":c,"aria-labelledby":c?void 0:v.labelId,"aria-required":v.required||void 0,"aria-invalid":v[`aria-invalid`],"aria-describedby":v[`aria-describedby`],"aria-disabled":v.disabled||void 0,"aria-readonly":d||void 0,contentEditable:E,suppressContentEditableWarning:!0,tabIndex:v.disabled?-1:0,"data-placeholder":m,"data-empty":S===``?`true`:void 0,className:r(zn.editor,zn[`resize-${u}`]),style:{minHeight:`calc(${l} * 1lh + var(--cui-space-4))`},onInput:D,onKeyUp:O,onMouseUp:O,onPaste:e=>{E&&Wn()&&(e.preventDefault(),document.execCommand(`insertText`,!1,e.clipboardData.getData(`text/plain`)))}}),p?(0,t.jsx)(`input`,{type:`hidden`,name:p,value:S}):null]})}var Yn=(0,e.forwardRef)(function({id:e,required:n,disabled:i,error:a,"aria-describedby":o,rows:s=3,resize:c=`vertical`,readOnly:l,className:u,...d},f){let p=x({id:e,required:n,disabled:i,error:a,"aria-describedby":o});return(0,t.jsx)(`textarea`,{...d,ref:f,id:p.id,rows:s,required:p.required,disabled:p.disabled,readOnly:l,"aria-invalid":p[`aria-invalid`],"aria-describedby":p[`aria-describedby`],className:r(zn.textarea,zn[`resize-${c}`],p.invalid&&zn.invalid,l&&zn.readOnly,u)})}),Xn=(0,e.forwardRef)(function({label:e,helperText:n,...r},i){if(!h())return(0,t.jsx)(_,{});let{type:a,onValueChange:o,...s}=r,c=a===`rich`?(0,t.jsx)(Jn,{...s,onValueChange:o}):(0,t.jsx)(Yn,{...s,ref:i});return!e&&!n&&!r.error?c:(0,t.jsx)(C,{id:r.id,label:e,helperText:n,error:r.error,required:r.required,disabled:r.disabled,children:c})}),Zn={root:`cui-Switch-module__root--Y5Ydi`,label:`cui-Switch-module__label--LrH7V`,disabled:`cui-Switch-module__disabled--2aZ0V`,input:`cui-Switch-module__input--5BPNu`,track:`cui-Switch-module__track--7ObdZ`,thumb:`cui-Switch-module__thumb---FTeK`,invalid:`cui-Switch-module__invalid--4QBSq`,required:`cui-Switch-module__required--cVb-Z`,message:`cui-Switch-module__message--fA-a5`,helper:`cui-Switch-module__helper--gZCYS`,error:`cui-Switch-module__error--OSPrU`},Qn=(0,e.forwardRef)(function({label:e,helperText:n,error:i,id:a,required:o,disabled:s,"aria-describedby":c,className:l,...u},d){let f=x({id:a,required:o,disabled:s,error:i,"aria-describedby":c});if(!h())return(0,t.jsx)(_,{});let p=`${f.id}-message`,m=!!(i||n),g=[f[`aria-describedby`],m?p:void 0].filter(Boolean).join(` `)||void 0;return(0,t.jsxs)(`div`,{className:r(Zn.root,l),children:[(0,t.jsxs)(`label`,{className:r(Zn.label,f.disabled&&Zn.disabled),children:[(0,t.jsx)(`input`,{...u,ref:d,id:f.id,type:`checkbox`,role:`switch`,required:f.required,disabled:f.disabled,"aria-invalid":f[`aria-invalid`],"aria-describedby":g,className:r(Zn.input,f.invalid&&Zn.invalid)}),(0,t.jsx)(`span`,{className:Zn.track,"aria-hidden":`true`,children:(0,t.jsx)(`span`,{className:Zn.thumb})}),e?(0,t.jsxs)(`span`,{className:Zn.text,children:[e,f.required?(0,t.jsx)(`span`,{className:Zn.required,"aria-hidden":`true`,children:`*`}):null]}):null]}),m?(0,t.jsx)(`p`,{id:p,className:r(Zn.message,i?Zn.error:Zn.helper),role:i?`alert`:void 0,children:i||n}):null]})}),$n={root:`cui-Badge-module__root--5osNT`,dot:`cui-Badge-module__dot--i0c-G`,neutral:`cui-Badge-module__neutral--lulSm`,primary:`cui-Badge-module__primary--S0WCS`,success:`cui-Badge-module__success--u9JiS`,warning:`cui-Badge-module__warning--nsGp-`,danger:`cui-Badge-module__danger--PD2hz`,info:`cui-Badge-module__info--na6DQ`};function er({color:e=`neutral`,dot:n=!1,className:i,children:a,...o}){return h()?(0,t.jsxs)(`span`,{...o,className:r($n.root,$n[e],i),children:[n?(0,t.jsx)(`span`,{className:$n.dot,"aria-hidden":`true`}):null,a]}):(0,t.jsx)(_,{})}var tr={root:`cui-Tabs-module__root---VKVI`,list:`cui-Tabs-module__list--qRVME`,tab:`cui-Tabs-module__tab--IdDYc`,indicator:`cui-Tabs-module__indicator--kvQsf`,indicatorAnimated:`cui-Tabs-module__indicatorAnimated--nLss-`,selected:`cui-Tabs-module__selected--TxfYv`,icon:`cui-Tabs-module__icon--LYFix`,panel:`cui-Tabs-module__panel--08i9c`,"cui-tabs-panel-in":`cui-Tabs-module__cui-tabs-panel-in--UJWoo`};function nr({items:n,value:i,defaultValue:a,onValueChange:o,className:s,"aria-label":c,...l}){let u=(0,e.useId)(),d=(0,e.useRef)([]),f=n.find(e=>!e.disabled)?.value,[p,m]=(0,e.useState)(a??f),g=(0,e.useRef)(null),[v,y]=(0,e.useState)(),b=h(),x=i??p,S=n.findIndex(e=>e.value===x),C=n[S];if((0,e.useLayoutEffect)(()=>{let e=d.current[S];if(!e){y(void 0);return}let t=()=>y(t=>{let n=e.offsetLeft,r=e.offsetWidth;return t&&t.left===n&&t.width===r?t:{left:n,width:r,animate:t!==void 0}});if(t(),typeof ResizeObserver>`u`||!g.current)return;let n=new ResizeObserver(t);return n.observe(g.current),n.observe(e),()=>n.disconnect()},[S,n.length,b]),(0,e.useEffect)(()=>{d.current[S]?.scrollIntoView?.({block:`nearest`,inline:`nearest`})},[S]),!b)return(0,t.jsx)(_,{});let w=e=>{i===void 0&&m(e),o?.(e)},T=(e,t)=>{let r=n.length,i=t===`first`?-1:t===`last`?r:e,a=t===`first`?1:t===`last`?-1:t;for(let e=0;e<r;e++){i=(i+a+r)%r;let e=n[i];if(e&&!e.disabled){w(e.value),d.current[i]?.focus();return}}},E=(e,t)=>{let n=getComputedStyle(e.currentTarget).direction===`rtl`,r=n?`ArrowLeft`:`ArrowRight`,i=n?`ArrowRight`:`ArrowLeft`;if(e.key===r)T(t,1);else if(e.key===i)T(t,-1);else if(e.key===`Home`)T(t,`first`);else if(e.key===`End`)T(t,`last`);else return;e.preventDefault()},D=e=>`${u}-tab-${e}`,O=e=>`${u}-panel-${e}`;return(0,t.jsxs)(`div`,{...l,className:r(tr.root,s),children:[(0,t.jsxs)(`div`,{ref:g,role:`tablist`,"aria-label":c,className:tr.list,children:[n.map((e,n)=>{let i=n===S;return(0,t.jsxs)(`button`,{ref:e=>{d.current[n]=e},id:D(n),type:`button`,role:`tab`,"aria-selected":i,"aria-controls":i&&e.content!==void 0?O(n):void 0,tabIndex:i?0:-1,disabled:e.disabled,className:r(tr.tab,i&&tr.selected),onClick:()=>w(e.value),onKeyDown:e=>E(e,n),children:[e.icon?(0,t.jsx)(`span`,{className:tr.icon,"aria-hidden":`true`,children:e.icon}):null,e.label]},e.value)}),v?(0,t.jsx)(`span`,{"aria-hidden":`true`,className:r(tr.indicator,v.animate&&tr.indicatorAnimated),style:{left:v.left,width:v.width}}):null]}),C&&C.content!==void 0?(0,t.jsx)(`div`,{role:`tabpanel`,id:O(S),"aria-labelledby":D(S),tabIndex:0,className:tr.panel,children:C.content},C.value):null]})}var rr={root:`cui-FormSection-module__root--M70AE`,header:`cui-FormSection-module__header--xTDAF`,heading:`cui-FormSection-module__heading--QU0-u`,title:`cui-FormSection-module__title--cw5qX`,subtitle:`cui-FormSection-module__subtitle--cIB53`,divider:`cui-FormSection-module__divider--954nY`,fields:`cui-FormSection-module__fields--ALVzc`,columns2:`cui-FormSection-module__columns2--IgG6n`,columns3:`cui-FormSection-module__columns3--q-4XF`};function ir({title:n,subtitle:i,children:a,columns:o=1,headingLevel:s=3,className:c,...l}){let u=(0,e.useId)(),d=!!(n||i);return h()?(0,t.jsxs)(`section`,{...l,"aria-labelledby":n?u:l[`aria-labelledby`],className:r(rr.root,c),children:[d?(0,t.jsxs)(`div`,{className:rr.header,children:[(0,t.jsxs)(`div`,{className:rr.heading,children:[n?(0,e.createElement)(`h${s}`,{id:u,className:rr.title},n):null,i?(0,t.jsx)(`p`,{className:rr.subtitle,children:i}):null]}),(0,t.jsx)(`span`,{className:rr.divider,"aria-hidden":`true`})]}):null,(0,t.jsx)(`div`,{className:r(rr.fields,rr[`columns${o}`]),children:a})]}):(0,t.jsx)(_,{})}var ar={root:`cui-Avatar-module__root--fXu-J`,xs:`cui-Avatar-module__xs--oSaLL`,sm:`cui-Avatar-module__sm--sZ2bk`,md:`cui-Avatar-module__md--Fdkbz`,lg:`cui-Avatar-module__lg--pTTUA`,xl:`cui-Avatar-module__xl--mW58F`,image:`cui-Avatar-module__image--ieqGp`,fallback:`cui-Avatar-module__fallback--BWBXY`,tone0:`cui-Avatar-module__tone0--NoD23`,tone1:`cui-Avatar-module__tone1--xFqRb`,tone2:`cui-Avatar-module__tone2--nxsRe`,tone3:`cui-Avatar-module__tone3--goa6z`,tone4:`cui-Avatar-module__tone4--g6kRy`,primary:`cui-Avatar-module__primary--HKPgn`},or=[ar.tone0,ar.tone1,ar.tone2,ar.tone3,ar.tone4];function sr(e){let t=(e??``).trim().split(/\s+/).filter(Boolean);return t.length===0?``:((t[0]?.[0]??``)+(t.length>1?t[t.length-1]?.[0]??``:``)).toUpperCase()}function cr(e){let t=e??``,n=0;for(let e=0;e<t.length;e++)n=n*31+t.charCodeAt(e)>>>0;return or[n%or.length]}function lr({name:n,src:i,size:a=`md`,tone:o=`auto`,className:s,...c}){let[l,u]=(0,e.useState)(null),d=!!i&&i!==l,f=sr(n);return h()?(0,t.jsx)(`span`,{role:c[`aria-hidden`]?void 0:`img`,"aria-label":c[`aria-hidden`]||!n?void 0:n,...c,className:r(ar.root,ar[a],!d&&(o===`primary`?ar.primary:cr(n)),s),children:d?(0,t.jsx)(`img`,{className:ar.image,src:i??void 0,alt:``,onError:()=>u(i??null)}):f?(0,t.jsx)(`span`,{"aria-hidden":`true`,children:f}):(0,t.jsxs)(`svg`,{className:ar.fallback,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`8`,r:`4`,fill:`currentColor`}),(0,t.jsx)(`path`,{d:`M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z`,fill:`currentColor`})]})}):(0,t.jsx)(_,{})}var $={root:`cui-AccountPanel-module__root--Twbp0`,rootSidebar:`cui-AccountPanel-module__rootSidebar--OMB7L`,contents:`cui-AccountPanel-module__contents--OFL-r`,triggerHeader:`cui-AccountPanel-module__triggerHeader--ib8Bi`,triggerOpen:`cui-AccountPanel-module__triggerOpen--NbT3m`,triggerSidebar:`cui-AccountPanel-module__triggerSidebar--FeaXc`,collapsed:`cui-AccountPanel-module__collapsed--c8z-m`,identityText:`cui-AccountPanel-module__identityText--eziAT`,triggerName:`cui-AccountPanel-module__triggerName--f56mY`,triggerRole:`cui-AccountPanel-module__triggerRole--KpeeO`,panel:`cui-AccountPanel-module__panel--PinlA`,"cui-account-in":`cui-AccountPanel-module__cui-account-in--QVNEb`,panelSidebar:`cui-AccountPanel-module__panelSidebar--EuGZh`,identity:`cui-AccountPanel-module__identity--lZRA7`,email:`cui-AccountPanel-module__email--Ze3OW`,avatarRing:`cui-AccountPanel-module__avatarRing--FQrz4`,avatarInner:`cui-AccountPanel-module__avatarInner--5ZfEz`,greeting:`cui-AccountPanel-module__greeting--am-j3`,role:`cui-AccountPanel-module__role--E9lrf`,pills:`cui-AccountPanel-module__pills--5gSce`,pill:`cui-AccountPanel-module__pill--vK7aC`,actionIcon:`cui-AccountPanel-module__actionIcon--oReIE`,externalIcon:`cui-AccountPanel-module__externalIcon--dJc16`,details:`cui-AccountPanel-module__details--MGxxd`,detailRow:`cui-AccountPanel-module__detailRow--VzvVD`,apps:`cui-AccountPanel-module__apps--KRMBA`,appsTitle:`cui-AccountPanel-module__appsTitle--mcvnH`,grid:`cui-AccountPanel-module__grid--KYmem`,app:`cui-AccountPanel-module__app--Dj--X`,tile:`cui-AccountPanel-module__tile--YKNda`,tonePrimary:`cui-AccountPanel-module__tonePrimary--lAexZ`,toneInfo:`cui-AccountPanel-module__toneInfo--yb-xj`,toneSuccess:`cui-AccountPanel-module__toneSuccess--XIJic`,toneWarning:`cui-AccountPanel-module__toneWarning--oz2d6`,toneDanger:`cui-AccountPanel-module__toneDanger--MP2rJ`,toneNeutral:`cui-AccountPanel-module__toneNeutral--diEHz`,appName:`cui-AccountPanel-module__appName--MJc25`,danger:`cui-AccountPanel-module__danger--t0t-L`,dangerAction:`cui-AccountPanel-module__dangerAction--jvJ7-`},ur=8,dr=12,fr=352,pr=`a[href], button:not([disabled])`,mr=({href:e,className:n,title:r,onClick:i,children:a})=>(0,t.jsx)(`a`,{href:e,className:n,title:r,onClick:i,children:a}),hr={primary:$.tonePrimary,info:$.toneInfo,success:$.toneSuccess,warning:$.toneWarning,danger:$.toneDanger,neutral:$.toneNeutral};function gr(){return(0,t.jsx)(`svg`,{className:$.externalIcon,viewBox:`0 0 20 20`,"aria-hidden":`true`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M8 5H5v10h10v-3M11 5h4v4M15 5l-7 7`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function _r({user:i,apps:a=[],actions:o=[],placement:s=`header`,collapsed:c=!1,appsTitle:l=`All Apps`,greeting:u=`Hi`,renderLink:d=mr,className:f}){let p=s===`sidebar`,m=(0,e.useId)(),g=(0,e.useRef)(null),v=(0,e.useRef)(null),y=(0,e.useRef)(null),[b,x]=(0,e.useState)(!1),[S,C]=(0,e.useState)(null),[w,T]=(0,e.useState)(),E=()=>{let e=v.current;if(!e)return;let t=e.getBoundingClientRect();if(p){let e=Math.min(fr,window.innerWidth-24);C({left:Math.max(dr,Math.min(t.right+ur,window.innerWidth-e-dr)),bottom:Math.max(dr,window.innerHeight-t.bottom)})}else C({top:t.bottom+ur,right:Math.max(dr,window.innerWidth-t.right)})},D=()=>{E(),T(g.current?.closest(`[data-theme]`)?.getAttribute(`data-theme`)??void 0),x(!0)},O=()=>x(!1);(0,e.useEffect)(()=>{b&&y.current?.focus({preventScroll:!0})},[b]),(0,e.useEffect)(()=>{if(!b)return;let e=()=>requestAnimationFrame(E),t=e=>{let t=e.target;!g.current?.contains(t)&&!y.current?.contains(t)&&O()};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),document.addEventListener(`mousedown`,t,!0),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e),document.removeEventListener(`mousedown`,t,!0)}},[b,p]);let k=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),O(),v.current?.focus({preventScroll:!0});return}if(e.key!==`Tab`)return;let t=Array.from(y.current?.querySelectorAll(pr)??[]),n=t[0],r=t[t.length-1];n&&r&&(e.shiftKey&&(document.activeElement===n||document.activeElement===y.current)?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus()))};if(!h())return(0,t.jsx)(_,{});let A=i.name.trim().split(/\s+/)[0]??i.name,j=o.filter(e=>e.tone!==`danger`),ee=o.filter(e=>e.tone===`danger`),M=e=>{e.onClick?.(),O()},N=(0,t.jsxs)(`div`,{ref:y,id:m,role:`dialog`,"aria-label":`Account`,tabIndex:-1,className:r($.panel,p&&$.panelSidebar),style:S??void 0,"data-theme":w,onKeyDown:k,children:[(0,t.jsxs)(`div`,{className:$.identity,children:[i.email?(0,t.jsx)(`p`,{className:$.email,children:i.email}):null,(0,t.jsx)(`span`,{className:$.avatarRing,children:(0,t.jsx)(`span`,{className:$.avatarInner,children:(0,t.jsx)(lr,{name:i.name,src:i.avatarUrl,size:`xl`,tone:`primary`,"aria-hidden":`true`})})}),(0,t.jsxs)(`p`,{className:$.greeting,children:[u,`, `,A,`!`]}),i.role?(0,t.jsx)(`span`,{className:$.role,children:i.role}):null,j.length>0?(0,t.jsx)(`div`,{className:$.pills,children:j.map(e=>{let n=(0,t.jsxs)(t.Fragment,{children:[e.icon?(0,t.jsx)(`span`,{className:$.actionIcon,"aria-hidden":`true`,children:e.icon}):null,(0,t.jsx)(`span`,{children:e.label}),e.external?(0,t.jsx)(gr,{}):null]});return e.href&&!e.disabled?e.external?(0,t.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,title:e.title,className:$.pill,onClick:()=>O(),children:n},e.id):(0,t.jsx)(`span`,{className:$.contents,children:d({href:e.href,className:$.pill??``,title:e.title,onClick:()=>O(),children:n})},e.id):(0,t.jsx)(`button`,{type:`button`,disabled:e.disabled,title:e.title,className:$.pill,onClick:()=>M(e),children:n},e.id)})}):null]}),i.details?.length?(0,t.jsx)(`dl`,{className:$.details,children:i.details.map(e=>(0,t.jsxs)(`div`,{className:$.detailRow,children:[(0,t.jsx)(`dt`,{children:e.label}),(0,t.jsx)(`dd`,{children:e.value})]},e.label))}):null,a.length>0?(0,t.jsxs)(`section`,{className:$.apps,"aria-label":l,children:[(0,t.jsx)(`p`,{className:$.appsTitle,children:l}),(0,t.jsx)(`div`,{className:$.grid,children:a.map(e=>{let n=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`span`,{className:r($.tile,hr[e.tone??`primary`]),"aria-hidden":`true`,children:e.icon}),(0,t.jsx)(`span`,{className:$.appName,children:e.name})]});return e.current?(0,t.jsx)(`span`,{className:$.contents,children:d({href:e.url,className:$.app??``,title:e.description,onClick:()=>O(),children:n})},e.id):(0,t.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,title:e.description,className:$.app,children:n},e.id)})})]}):null,ee.length>0?(0,t.jsx)(`div`,{className:$.danger,children:ee.map(e=>(0,t.jsxs)(`button`,{type:`button`,disabled:e.disabled,title:e.title,className:$.dangerAction,onClick:()=>M(e),children:[e.icon?(0,t.jsx)(`span`,{className:$.actionIcon,"aria-hidden":`true`,children:e.icon}):null,e.label]},e.id))}):null]});return(0,t.jsxs)(`div`,{ref:g,className:r($.root,p&&$.rootSidebar,f),children:[(0,t.jsxs)(`button`,{ref:v,type:`button`,"aria-label":`Account: ${i.name}`,"aria-haspopup":`dialog`,"aria-expanded":b,"aria-controls":b?m:void 0,className:r(p?$.triggerSidebar:$.triggerHeader,p&&c&&$.collapsed,b&&$.triggerOpen),onClick:()=>b?O():D(),children:[(0,t.jsx)(lr,{name:i.name,src:i.avatarUrl,size:`sm`,tone:`primary`,"aria-hidden":`true`}),p&&!c?(0,t.jsxs)(`span`,{className:$.identityText,children:[(0,t.jsx)(`span`,{className:$.triggerName,children:i.name}),i.role?(0,t.jsx)(`span`,{className:$.triggerRole,children:i.role}):null]}):null]}),b&&S?(0,n.createPortal)(N,B()):null]})}var vr={root:`cui-Typography-module__root--PebSf`,h1:`cui-Typography-module__h1--pJqnF`,h2:`cui-Typography-module__h2--8YqGv`,h3:`cui-Typography-module__h3--DT-DL`,h4:`cui-Typography-module__h4--UsocF`,body:`cui-Typography-module__body--s-YlR`,bodySm:`cui-Typography-module__bodySm--RPpZ5`,caption:`cui-Typography-module__caption--K-n4O`,label:`cui-Typography-module__label---CGg4`,"color-default":`cui-Typography-module__color-default--U4Xg0`,"color-secondary":`cui-Typography-module__color-secondary--5wnuV`,"color-muted":`cui-Typography-module__color-muted--GLLRl`,"color-disabled":`cui-Typography-module__color-disabled--bBBVc`,"color-primary":`cui-Typography-module__color-primary--B-bVH`,"color-success":`cui-Typography-module__color-success--hXHcS`,"color-warning":`cui-Typography-module__color-warning---oLwA`,"color-danger":`cui-Typography-module__color-danger--sStkk`,"color-info":`cui-Typography-module__color-info--4uSt5`,"weight-normal":`cui-Typography-module__weight-normal--fFcMp`,"weight-medium":`cui-Typography-module__weight-medium--5RtTe`,"weight-semibold":`cui-Typography-module__weight-semibold--TDOgV`,"weight-bold":`cui-Typography-module__weight-bold--YahG3`,"align-start":`cui-Typography-module__align-start--mX51I`,"align-center":`cui-Typography-module__align-center--2Ng2u`,"align-end":`cui-Typography-module__align-end--6LwA3`,truncate:`cui-Typography-module__truncate--3B0O4`},yr={h1:`h1`,h2:`h2`,h3:`h3`,h4:`h4`,body:`p`,"body-sm":`p`,caption:`span`,label:`span`},br={h1:vr.h1,h2:vr.h2,h3:vr.h3,h4:vr.h4,body:vr.body,"body-sm":vr.bodySm,caption:vr.caption,label:vr.label};function xr({variant:n=`body`,as:i,color:a=`default`,weight:o,align:s,truncate:c=!1,className:l,...u}){return h()?(0,e.createElement)(i??yr[n],{...u,className:r(vr.root,br[n],vr[`color-${a}`],o&&vr[`weight-${o}`],s&&vr[`align-${s}`],c&&vr.truncate,l)}):(0,t.jsx)(_,{})}var Sr={root:`cui-ThemeToggle-module__root--k2-Go`,option:`cui-ThemeToggle-module__option--CngnC`,input:`cui-ThemeToggle-module__input--0nC-Q`,face:`cui-ThemeToggle-module__face--jX0TD`,icon:`cui-ThemeToggle-module__icon--N0Uj1`},Cr={light:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,t.jsx)(`path`,{d:`M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4`})]}),dark:(0,t.jsx)(`path`,{d:`M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z`}),system:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`12`,rx:`2`}),(0,t.jsx)(`path`,{d:`M8 20h8M12 16v4`})]})},wr={light:`Light`,dark:`Dark`,system:`System`};function Tr({modes:n=[`light`,`dark`,`system`],compact:i=!1,className:a,"aria-label":o=`Theme`,...s}){let{theme:c,setTheme:l}=Le(),u=(0,e.useId)();return h()?(0,t.jsx)(`div`,{...s,role:`radiogroup`,"aria-label":o,className:r(Sr.root,a),children:n.map(e=>{let n=wr[e]??e;return(0,t.jsxs)(`label`,{className:Sr.option,title:i?n:void 0,children:[(0,t.jsx)(`input`,{type:`radio`,name:u,value:e,checked:c===e,onChange:()=>l(e),className:Sr.input,"aria-label":i?n:void 0}),(0,t.jsxs)(`span`,{className:Sr.face,children:[Cr[e]?(0,t.jsx)(`svg`,{className:Sr.icon,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:Cr[e]}):null,i?null:n]})]},e)})}):(0,t.jsx)(_,{})}exports.AccountPanel=_r,exports.Avatar=lr,exports.Badge=er,exports.Button=y,exports.Checkbox=Tt,exports.ConfirmDialog=tt,exports.DataTable=fn,exports.DatePicker=U,exports.DateTimePicker=me,exports.Drawer=$e,exports.DropdownMenu=jt,exports.FileInput=jn,exports.FormField=C,exports.FormSection=ir,exports.Input=Ce,exports.Modal=Ze,exports.MonthPicker=ve,exports.PageHeader=bt,exports.Pagination=ut,exports.PasswordInput=Te,exports.SearchInput=De,exports.Select=st,exports.SelectionBar=Pt,exports.Skeleton=Nt,exports.StatusPill=Ct,exports.Switch=Qn,exports.Table=dt,exports.TableBody=pt,exports.TableCaption=vt,exports.TableCell=_t,exports.TableFoot=mt,exports.TableHead=ft,exports.TableHeaderCell=gt,exports.TableRow=ht,exports.Tabs=nr,exports.Textarea=Xn,exports.ThemeProvider=Ie,exports.ThemeToggle=Tr,exports.Typography=xr,exports.cn=r,exports.formatFileSize=pn,exports.getInitials=sr,exports.getPageItems=ct,exports.setLicenseKey=d,exports.useFormFieldControl=x,exports.useTheme=Le;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|