@takecasper/acuity-design-system 2.4.2 → 2.4.3
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/KebabMenu/KebabMenu.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +780 -768
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KebabMenu.d.ts","sourceRoot":"","sources":["../../../src/components/KebabMenu/KebabMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"KebabMenu.d.ts","sourceRoot":"","sources":["../../../src/components/KebabMenu/KebabMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAI/C,KAAK,aAAa,GAAG;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,UAAU,cAAc;IACtB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAqD9C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -87,7 +87,7 @@ return result$$;`.replaceAll("$$",String(Jl)));return Jl+=1,(a,c)=>s(o,a,c)},kc=
|
|
|
87
87
|
`));pt(e.current.state)!==W&&(n.debug("Setting selection model"),e.current.setState(Y=>C({},Y,{rowSelection:t.rowSelection?W:[]})),e.current.forceUpdate())},[e,n,t.rowSelection,t.signature,d]),x=g.useCallback(W=>pt(e.current.state).includes(W),[e]),w=g.useCallback(W=>{if(t.rowSelection===!1||u&&!u(e.current.getRowParams(W)))return!1;const K=nt(e)[W];return!((K==null?void 0:K.type)==="footer"||(K==null?void 0:K.type)==="pinnedRow")},[e,t.rowSelection,u]),k=g.useCallback(()=>zb(e),[e]),v=g.useCallback((W,K=!0,Y=!1)=>{var J,ne,Z,oe,ee,ae,fe,xe,pe,Me,Re,Je;if(e.current.isRowSelectable(W))if(l.current=W,Y){n.debug(`Setting selection for row ${W}`);const De=[],Oe=Ye=>{De.push(Ye)};K&&(Oe(W),o&&sr(e,h,W,(ne=(J=t.rowSelectionPropagation)==null?void 0:J.descendants)!=null?ne:!1,(oe=(Z=t.rowSelectionPropagation)==null?void 0:Z.parents)!=null?oe:!1,Oe)),e.current.setRowSelectionModel(De)}else{n.debug(`Toggling selection for row ${W}`);const De=pt(e.current.state),Oe=new Set(De);Oe.delete(W);const Ye=He=>{Oe.add(He)},qe=He=>{Oe.delete(He)};K?(Ye(W),o&&sr(e,h,W,(ae=(ee=t.rowSelectionPropagation)==null?void 0:ee.descendants)!=null?ae:!1,(xe=(fe=t.rowSelectionPropagation)==null?void 0:fe.parents)!=null?xe:!1,Ye)):o&&ii(e,h,W,(Me=(pe=t.rowSelectionPropagation)==null?void 0:pe.descendants)!=null?Me:!1,(Je=(Re=t.rowSelectionPropagation)==null?void 0:Re.parents)!=null?Je:!1,qe),(Oe.size<2||d)&&e.current.setRowSelectionModel(Array.from(Oe))}},[e,n,o,h,(S=t.rowSelectionPropagation)==null?void 0:S.descendants,(H=t.rowSelectionPropagation)==null?void 0:H.parents,d]),F=g.useCallback((W,K=!0,Y=!1)=>{n.debug("Setting selection for several rows");const J=W.filter(oe=>e.current.isRowSelectable(oe));let ne;if(Y){if(K){if(ne=new Set(J),o){const ee=ae=>{ne.add(ae)};J.forEach(ae=>{var fe,xe,pe,Me;sr(e,h,ae,(xe=(fe=t.rowSelectionPropagation)==null?void 0:fe.descendants)!=null?xe:!1,(Me=(pe=t.rowSelectionPropagation)==null?void 0:pe.parents)!=null?Me:!1,ee)})}}else ne=new Set;const oe=ln(e);if(ne.size===Object.keys(oe).length&&Array.from(ne).every(ee=>oe[ee]===ee))return}else{ne=new Set(Object.values(ln(e)));const oe=ae=>{ne.add(ae)},ee=ae=>{ne.delete(ae)};J.forEach(ae=>{var fe,xe,pe,Me,Re,Je,De,Oe;K?(ne.add(ae),o&&sr(e,h,ae,(xe=(fe=t.rowSelectionPropagation)==null?void 0:fe.descendants)!=null?xe:!1,(Me=(pe=t.rowSelectionPropagation)==null?void 0:pe.parents)!=null?Me:!1,oe)):(ee(ae),o&&ii(e,h,ae,(Je=(Re=t.rowSelectionPropagation)==null?void 0:Re.descendants)!=null?Je:!1,(Oe=(De=t.rowSelectionPropagation)==null?void 0:De.parents)!=null?Oe:!1,ee))})}(ne.size<2||d)&&e.current.setRowSelectionModel(Array.from(ne))},[n,o,d,e,h,(z=t.rowSelectionPropagation)==null?void 0:z.descendants,(q=t.rowSelectionPropagation)==null?void 0:q.parents]),j=g.useCallback(W=>{var J,ne,Z,oe;if(!m||!o||W.length===0)return W;const K=new Set(W),Y=ee=>{K.add(ee)};for(const ee of W)sr(e,h,ee,(ne=(J=t.rowSelectionPropagation)==null?void 0:J.descendants)!=null?ne:!1,(oe=(Z=t.rowSelectionPropagation)==null?void 0:Z.parents)!=null?oe:!1,Y,K);return Array.from(K)},[e,h,(U=t.rowSelectionPropagation)==null?void 0:U.descendants,(Q=t.rowSelectionPropagation)==null?void 0:Q.parents,m,o]),y=g.useCallback(({startId:W,endId:K},Y=!0,J=!1)=>{if(!e.current.getRow(W)||!e.current.getRow(K))return;n.debug(`Expanding selection from row ${W} to row ${K}`);const ne=Vn(e),Z=ne.indexOf(W),oe=ne.indexOf(K),[ee,ae]=Z>oe?[oe,Z]:[Z,oe],fe=ne.slice(ee,ae+1);e.current.selectRows(fe,Y,J)},[e,n]),A={selectRow:v,setRowSelectionModel:b,getSelectedRows:k,isRowSelected:x,isRowSelectable:w},N={selectRows:F,selectRowRange:y,getPropagatedRowSelectionModel:j};Se(e,A,"public"),Se(e,N,t.signature===wt.DataGrid?"private":"public");const M=g.useRef(!0),P=g.useCallback((W=!1)=>{var ae;if(M.current)return;const K=pt(e.current.state),Y=vt(e),J=Qn(e),ne=C({},ln(e)),Z=fe=>t.filterMode==="server"?!Y[fe]:!Y[fe]||J[fe]===!1;let oe=!1;K.forEach(fe=>{var pe;if(Z(fe)){if(t.keepNonExistentRowsSelected)return;delete ne[fe],oe=!0;return}if(!((pe=t.rowSelectionPropagation)!=null&&pe.parents))return;const xe=h[fe];if(xe.type==="group"){if(xe.isAutoGenerated){delete ne[fe],oe=!0;return}xe.children.every(Re=>J[Re]===!1)||(delete ne[fe],oe=!0)}});const ee=m&&((ae=t.rowSelectionPropagation)==null?void 0:ae.parents)&&Object.keys(ne).length>0;if(oe||ee&&!W){const fe=Object.values(ne);ee?e.current.selectRows(fe,!0,!0):e.current.setRowSelectionModel(fe)}},[e,m,(X=t.rowSelectionPropagation)==null?void 0:X.parents,t.keepNonExistentRowsSelected,t.filterMode,h]),R=g.useCallback((W,K)=>{const Y=K.metaKey||K.ctrlKey,J=!a&&!Y&&!Ax(K),ne=!d||J,Z=e.current.isRowSelected(W);ne?e.current.selectRow(W,J?!0:!Z,!0):e.current.selectRow(W,!Z,!1)},[e,d,a]),_=g.useCallback((W,K)=>{var ne;if(c)return;const Y=(ne=K.target.closest(`.${I.cell}`))==null?void 0:ne.getAttribute("data-field");if(Y===Jn.field||Y===mo)return;if(Y){const Z=e.current.getColumn(Y);if((Z==null?void 0:Z.type)===ho)return}nt(e)[W.id].type!=="pinnedRow"&&(K.shiftKey&&d?p(W.id):R(W.id,K))},[c,d,e,p,R]),O=g.useCallback((W,K)=>{var Y;d&&K.shiftKey&&((Y=window.getSelection())==null||Y.removeAllRanges())},[d]),D=g.useCallback((W,K)=>{d&&K.nativeEvent.shiftKey?p(W.id):e.current.selectRow(W.id,W.value,!d)},[e,p,d]),V=g.useCallback(W=>{const K=t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?Yc(e):Vn(e);e.current.selectRows(K,W.value)},[e,t.checkboxSelectionVisibleOnly,t.pagination,t.paginationMode]),E=g.useCallback((W,K)=>{if(e.current.getCellMode(W.id,W.field)!==_e.Edit&&!jr(K)){if(ro(K.key)&&K.shiftKey){const Y=gt(e);if(Y&&Y.id!==W.id){K.preventDefault();const J=e.current.isRowSelected(Y.id);if(!d){e.current.selectRow(Y.id,!J,!0);return}const ne=e.current.getRowIndexRelativeToVisibleRows(Y.id),Z=e.current.getRowIndexRelativeToVisibleRows(W.id);let oe,ee;ne>Z?J?(oe=Z,ee=ne-1):(oe=Z,ee=ne):J?(oe=ne+1,ee=Z):(oe=ne,ee=Z);const fe=an(e).rows.slice(oe,ee+1).map(xe=>xe.id);e.current.selectRows(fe,!J);return}}if(K.key===" "&&K.shiftKey){K.preventDefault(),R(W.id,K);return}String.fromCharCode(K.keyCode)==="A"&&(K.ctrlKey||K.metaKey)&&(K.preventDefault(),F(e.current.getAllRowIds(),!0))}},[e,R,F,d]),T=ze.useEventCallback(()=>{if(!t.rowSelection){e.current.setRowSelectionModel([]);return}if(s===void 0)return;if(!o||!m||s.length===0){e.current.setRowSelectionModel(s);return}const W=e.current.getPropagatedRowSelectionModel(s);if(W.length!==s.length||!W.every(K=>s.includes(K))){e.current.setRowSelectionModel(W);return}e.current.setRowSelectionModel(s)});le(e,"sortedRowsSet",r(()=>P(!0))),le(e,"filteredRowsSet",r(()=>P())),le(e,"rowClick",r(_)),le(e,"rowSelectionCheckboxChange",r(D)),le(e,"headerSelectionCheckboxChange",V),le(e,"cellMouseDown",r(O)),le(e,"cellKeyDown",r(E)),g.useEffect(()=>{T()},[e,s,t.rowSelection,T]);const L=s!=null;g.useEffect(()=>{if(L||!t.rowSelection)return;const W=pt(e.current.state);if(w){const K=W.filter(Y=>w(Y));K.length<W.length&&e.current.setRowSelectionModel(K)}},[e,w,L,t.rowSelection]),g.useEffect(()=>{if(!t.rowSelection||L)return;const W=pt(e.current.state);!d&&W.length>1&&e.current.setRowSelectionModel([])},[e,d,a,L,t.rowSelection]),g.useEffect(()=>{r(P)},[P,r]),g.useEffect(()=>{M.current&&(M.current=!1)},[])},dv=e=>{const{classes:t}=e;return g.useMemo(()=>{const n={cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]};return Xe.default(n,Te,t)},[t])},fv=(e,t)=>{const n={classes:t.classes},r=dv(n),o=g.useCallback(s=>{const l=C({},Jn,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),a=t.checkboxSelection,c=s.lookup[yt]!=null;return a&&!c?(s.lookup[yt]=l,s.orderedFields=[yt,...s.orderedFields]):!a&&c?(delete s.lookup[yt],s.orderedFields=s.orderedFields.filter(u=>u!==yt)):a&&c&&(s.lookup[yt]=C({},l,s.lookup[yt]),t.columns.some(u=>u.field===yt)||(s.orderedFields=[yt,...s.orderedFields.filter(u=>u!==yt)])),s},[e,r,t.columns,t.checkboxSelection]);Ue(e,"hydrateColumns",o)},hv=(e,t)=>{var r,o,s,l;const n=(l=(s=t.sortModel)!=null?s:(o=(r=t.initialState)==null?void 0:r.sorting)==null?void 0:o.sortModel)!=null?l:[];return C({},e,{sorting:{sortModel:dc(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},gv=(e,t)=>{var y,A;const n=ct(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:jt,changeEvent:"sortModelChange"});const r=g.useCallback((N,M)=>{const P=jt(e),R=P.findIndex(O=>O.field===N);let _=[...P];return R>-1?(M==null?void 0:M.sort)==null?_.splice(R,1):_.splice(R,1,M):_=[...P,M],_},[e]),o=g.useCallback((N,M)=>{var _,O;const R=jt(e).find(D=>D.field===N.field);if(R){const D=M===void 0?Yl((_=N.sortingOrder)!=null?_:t.sortingOrder,R.sort):M;return D===void 0?void 0:C({},R,{sort:D})}return{field:N.field,sort:M===void 0?Yl((O=N.sortingOrder)!=null?O:t.sortingOrder):M}},[e,t.sortingOrder]),s=g.useCallback((N,M)=>M==null||M.sortable===!1||t.disableColumnSorting?N:(M.sortingOrder||t.sortingOrder).some(R=>!!R)?[...N,"columnMenuSortItem"]:N,[t.sortingOrder,t.disableColumnSorting]),l=g.useCallback(()=>{e.current.setState(N=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),C({},N,{sorting:C({},N.sorting,{sortedRows:As(nt(e),ft,!1)})});const M=jt(N,e.current.instanceId),P=W1(M,e),R=e.current.applyStrategyProcessor("sorting",{sortRowList:P});return C({},N,{sorting:C({},N.sorting,{sortedRows:R})})}),e.current.publishEvent("sortedRowsSet"),e.current.forceUpdate()},[e,n,t.sortingMode]),a=g.useCallback(N=>{jt(e)!==N&&(n.debug("Setting sort model"),e.current.setState(Xl(N,t.disableMultipleColumnsSorting)),e.current.forceUpdate(),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),c=g.useCallback((N,M,P)=>{const R=e.current.getColumn(N),_=o(R,M);let O;!P||t.disableMultipleColumnsSorting?O=(_==null?void 0:_.sort)==null?[]:[_]:O=r(R.field,_),e.current.setSortModel(O)},[e,r,o,t.disableMultipleColumnsSorting]),u=g.useCallback(()=>jt(e),[e]),d=g.useCallback(()=>Vs(e).map(M=>M.model),[e]),h=g.useCallback(()=>Zn(e),[e]),m=g.useCallback(N=>e.current.getSortedRowIds()[N],[e]);Se(e,{getSortModel:u,getSortedRows:d,getSortedRowIds:h,getRowIdFromRowIndex:m,setSortModel:a,sortColumn:c,applySorting:l},"public");const b=g.useCallback((N,M)=>{var _,O;const P=jt(e);return!M.exportOnlyDirtyModels||t.sortModel!=null||((O=(_=t.initialState)==null?void 0:_.sorting)==null?void 0:O.sortModel)!=null||P.length>0?C({},N,{sorting:{sortModel:P}}):N},[e,t.sortModel,(A=(y=t.initialState)==null?void 0:y.sorting)==null?void 0:A.sortModel]),x=g.useCallback((N,M)=>{var R;const P=(R=M.stateToRestore.sorting)==null?void 0:R.sortModel;return P==null?N:(e.current.setState(Xl(P,t.disableMultipleColumnsSorting)),C({},N,{callbacks:[...N.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),w=g.useCallback(N=>{const M=nt(e),P=M[ft],R=N.sortRowList?N.sortRowList(P.children.map(_=>M[_])):[...P.children];return P.footerId!=null&&R.push(P.footerId),R},[e]);Ue(e,"exportState",b),Ue(e,"restoreState",x),lo(e,Cn,"sorting",w);const k=g.useCallback(({field:N,colDef:M},P)=>{if(!M.sortable||t.disableColumnSorting)return;const R=P.shiftKey||P.metaKey||P.ctrlKey;c(N,void 0,R)},[c,t.disableColumnSorting]),v=g.useCallback(({field:N,colDef:M},P)=>{!M.sortable||t.disableColumnSorting||P.key==="Enter"&&!P.ctrlKey&&!P.metaKey&&c(N,void 0,P.shiftKey)},[c,t.disableColumnSorting]),F=g.useCallback(()=>{const N=jt(e),M=Qt(e);if(N.length>0){const P=N.filter(R=>M[R.field]);P.length<N.length&&e.current.setSortModel(P)}},[e]),j=g.useCallback(N=>{N==="sorting"&&e.current.applySorting()},[e]);Ue(e,"columnMenu",s),le(e,"columnHeaderClick",k),le(e,"columnHeaderKeyDown",v),le(e,"rowsSet",e.current.applySorting),le(e,"columnsChange",F),le(e,"activeStrategyProcessorChange",j),Ir(()=>{e.current.applySorting()}),re.unstable_useEnhancedEffect(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function zi(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,s=o+r;if(r>t)return o;if(s-t>n)return s-t;if(o<n)return o}const mv=(e,t)=>{const n=Gt.useRtl(),r=ct(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,s=e.current.virtualScrollerRef,l=te(e,fn),a=g.useCallback(h=>{var k;const m=at(e.current.state),p=kr(e),b=t.unstable_listView?[Gn(e.current.state)]:Ke(e);if(!(h.rowIndex==null)&&p===0||b.length===0)return!1;r.debug(`Scrolling to cell at row ${h.rowIndex}, col: ${h.colIndex} `);let w={};if(h.colIndex!==void 0){const v=dn(e);let F;if(typeof h.rowIndex!="undefined"){const j=(k=l[h.rowIndex])==null?void 0:k.id,y=e.current.unstable_getCellColSpanInfo(j,h.colIndex);y&&!y.spannedByColSpan&&(F=y.cellProps.width)}typeof F=="undefined"&&(F=b[h.colIndex].computedWidth),w.left=zi({containerSize:m.viewportOuterSize.width,scrollPosition:Math.abs(s.current.scrollLeft),elementSize:F,elementOffset:v[h.colIndex]})}if(h.rowIndex!==void 0){const v=er(e.current.state),F=rC(e),j=Kc(e),y=t.pagination?h.rowIndex-F*j:h.rowIndex,A=v.positions[y+1]?v.positions[y+1]-v.positions[y]:v.currentPageTotalHeight-v.positions[y];w.top=zi({containerSize:m.viewportInnerSize.height,scrollPosition:s.current.scrollTop,elementSize:A,elementOffset:v.positions[y]})}return w=e.current.unstable_applyPipeProcessors("scrollToIndexes",w,h),typeof w.left!==void 0||typeof w.top!==void 0?(e.current.scroll(w),!0):!1},[r,e,s,t.pagination,l,t.unstable_listView]),c=g.useCallback(h=>{if(s.current&&h.left!==void 0&&o.current){const m=n?-1:1;o.current.scrollLeft=h.left,s.current.scrollLeft=m*h.left,r.debug(`Scrolling left: ${h.left}`)}s.current&&h.top!==void 0&&(s.current.scrollTop=h.top,r.debug(`Scrolling top: ${h.top}`)),r.debug("Scrolling, updating container, and viewport")},[s,n,o,r]),u=g.useCallback(()=>s!=null&&s.current?{top:s.current.scrollTop,left:s.current.scrollLeft}:{top:0,left:0},[s]);Se(e,{scroll:c,scrollToIndexes:a,getScrollPosition:u},"public")};function pv(e,t){Ae(e,"columnHeaderClick",t.onColumnHeaderClick),Ae(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),Ae(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),Ae(e,"columnHeaderOver",t.onColumnHeaderOver),Ae(e,"columnHeaderOut",t.onColumnHeaderOut),Ae(e,"columnHeaderEnter",t.onColumnHeaderEnter),Ae(e,"columnHeaderLeave",t.onColumnHeaderLeave),Ae(e,"cellClick",t.onCellClick),Ae(e,"cellDoubleClick",t.onCellDoubleClick),Ae(e,"cellKeyDown",t.onCellKeyDown),Ae(e,"preferencePanelClose",t.onPreferencePanelClose),Ae(e,"preferencePanelOpen",t.onPreferencePanelOpen),Ae(e,"menuOpen",t.onMenuOpen),Ae(e,"menuClose",t.onMenuClose),Ae(e,"rowDoubleClick",t.onRowDoubleClick),Ae(e,"rowClick",t.onRowClick),Ae(e,"stateChange",t.onStateChange)}function bv(e,t=166){let n,r;const o=()=>{n=void 0,e(...r)};function s(...l){r=l,n===void 0&&(n=setTimeout(o,t))}return s.clear=()=>{clearTimeout(n),n=void 0},s}const ds={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableVirtualization:!1,editMode:zt.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,indeterminateCheckboxAction:"deselect",keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:process.env.NODE_ENV==="production"?"error":"warn",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resetPageOnSortFilter:!1,resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rowPositionsDebounceMs:166,rows:[],rowSelection:!0,rowSpacingType:"margin",showCellVerticalBorder:!1,showColumnVerticalBorder:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,unstable_rowSpanning:!1,virtualizeColumnsWithAutoRowHeight:!1},On={width:0,height:0},Cv={isReady:!1,root:On,viewportOuterSize:On,viewportInnerSize:On,contentSize:On,minimumSize:On,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0},wv=(e,t,n)=>{const r=Cv,o=Un(n);return C({},e,{dimensions:C({},r,pd(t,n,o,Yn(n)))})},md=be(Ke,dn,(e,t)=>{const n=e.length;return n===0?0:Dn(t[n-1]+e[n-1].computedWidth,1)});function xv(e,t){const n=ct(e,"useResizeContainer"),r=g.useRef(!1),o=g.useRef(On),s=te(e,Yn),l=te(e,Un),a=te(e,md),c=g.useRef(!0),u=g.useRef({counter:0,heights:{content:0,pinnedTop:0,pinnedBottom:0}}),{rowHeight:d,headerHeight:h,groupHeaderHeight:m,headerFilterHeight:p,headersTotalHeight:b,leftPinnedWidth:x,rightPinnedWidth:w}=pd(t,e,l,s),k=g.useRef(void 0),v=g.useCallback(()=>at(e.current.state),[e]),F=g.useCallback(D=>{e.current.setState(V=>C({},V,{dimensions:D})),e.current.rootElementRef.current&&Gi(e.current.rootElementRef.current,at(e.current.state))},[e]),j=g.useCallback(()=>{const D=e.current.mainElementRef.current;if(!D)return;const V=re.unstable_ownerWindow(D).getComputedStyle(D),E={width:parseFloat(V.width)||0,height:parseFloat(V.height)||0};(!k.current||!Wi(k.current,E))&&(e.current.publishEvent("resize",E),k.current=E)},[e]),y=g.useCallback(()=>{const D=at(e.current.state);if(!D.isReady)return 0;const V=an(e);if(t.getRowHeight){const T=Fr(e),L=T.lastRowIndex-T.firstRowIndex;return Math.min(L-1,V.rows.length)}const E=Math.floor(D.viewportInnerSize.height/d);return Math.min(E,V.rows.length)},[e,t.getRowHeight,d]),A=g.useCallback(()=>{var W,K;if(c.current)return;const D=yv(e.current.mainElementRef.current,t.scrollbarSize),V=er(e.current.state),E=b+V.pinnedTopRowsTotalHeight,T=V.pinnedBottomRowsTotalHeight,$={width:a-x-w,height:Dn(V.currentPageTotalHeight,1)},G=e.current.state.dimensions;let S,H,z=!1,q=!1;if(t.autoHeight)q=!1,z=Math.round(a)>Math.round(o.current.width),S={width:o.current.width,height:E+T+$.height},H={width:Math.max(0,S.width-(q?D:0)),height:Math.max(0,S.height-(z?D:0))};else{S={width:o.current.width,height:o.current.height},H={width:Math.max(0,S.width-x-w),height:Math.max(0,S.height-E-T)};const Y=$,J=H,ne=Y.width>J.width,Z=Y.height>J.height;(ne||Z)&&(q=Z,z=Y.width+(q?D:0)>J.width,z&&(q=Y.height+D>J.height));{const oe=u.current,ee=V.currentPageTotalHeight!==oe.heights.content||V.pinnedTopRowsTotalHeight!==oe.heights.pinnedTop||V.pinnedBottomRowsTotalHeight!==oe.heights.pinnedBottom;ee&&(oe.counter=0,oe.heights={content:V.currentPageTotalHeight,pinnedTop:V.pinnedTopRowsTotalHeight,pinnedBottom:V.pinnedBottomRowsTotalHeight}),G.isReady&&q!==G.hasScrollY&&(ee||(oe.counter+=1),oe.counter>=2&&(q=!1,z=ne))}q&&(H.width-=D),z&&(H.height-=D)}const U=Math.max(S.width,a+(q?D:0)),Q={width:a,height:E+$.height+T},X={isReady:!0,root:o.current,viewportOuterSize:S,viewportInnerSize:H,contentSize:$,minimumSize:Q,hasScrollX:z,hasScrollY:q,scrollbarSize:D,headerHeight:h,groupHeaderHeight:m,headerFilterHeight:p,rowWidth:U,rowHeight:d,columnsTotalWidth:a,leftPinnedWidth:x,rightPinnedWidth:w,headersTotalHeight:b,topContainerHeight:E,bottomContainerHeight:T};sn(G,X)||(F(X),Wi(X.viewportInnerSize,G.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",X.viewportInnerSize),(K=(W=e.current).updateRenderContext)==null||K.call(W))},[e,F,t.scrollbarSize,t.autoHeight,d,h,m,p,a,b,x,w]),N=re.unstable_useEventCallback(A),M=g.useMemo(()=>t.resizeThrottleMs>0?bv(()=>{N(),e.current.publishEvent("debouncedResize",o.current)},t.resizeThrottleMs):void 0,[e,t.resizeThrottleMs,N]);g.useEffect(()=>M==null?void 0:M.clear,[M]);const P={resize:j,getRootDimensions:v},R={updateDimensions:A,getViewportPageSize:y};re.unstable_useEnhancedEffect(A,[A]),Se(e,P,"public"),Se(e,R,"private");const _=g.useCallback(D=>{Gi(D,at(e.current.state))},[e]),O=g.useCallback(D=>{if(o.current=D,D.height===0&&!r.current&&!t.autoHeight&&!to&&(n.error(["The parent DOM element of the Data Grid has an empty height.","Please make sure that this element has an intrinsic height.","The grid displays with a height of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
|
|
88
88
|
`)),r.current=!0),D.width===0&&!r.current&&!to&&(n.error(["The parent DOM element of the Data Grid has an empty width.","Please make sure that this element has an intrinsic width.","The grid displays with a width of 0px.","","More details: https://mui.com/r/x-data-grid-no-dimensions."].join(`
|
|
89
89
|
`)),r.current=!0),c.current||!M){c.current=!1,A();return}M()},[A,t.autoHeight,M,n]);Ae(e,"rootMount",_),Ae(e,"resize",O),Ae(e,"debouncedResize",t.onResize)}function Gi(e,t){const n=(r,o)=>e.style.setProperty(r,o);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function pd(e,t,n,r){var s,l;const o=Tc(e.rowHeight,ds.rowHeight,yb);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor(((s=e.columnGroupHeaderHeight)!=null?s:e.columnHeaderHeight)*n),headerFilterHeight:Math.floor(((l=e.headerFilterHeight)!=null?l:e.columnHeaderHeight)*n),columnsTotalWidth:md(t),headersTotalHeight:xo(t,e),leftPinnedWidth:r.left.reduce((a,c)=>a+c.computedWidth,0),rightPinnedWidth:r.right.reduce((a,c)=>a+c.computedWidth,0)}}const Bi=new WeakMap;function yv(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=Bi.get(e);if(n!==void 0)return n;const o=re.unstable_ownerDocument(e).createElement("div");o.style.width="99px",o.style.height="99px",o.style.position="absolute",o.style.overflow="scroll",o.className="scrollDiv",e.appendChild(o);const s=o.offsetWidth-o.clientWidth;return e.removeChild(o),Bi.set(e,s),s}function Wi(e,t){return e.width===t.width&&e.height===t.height}const vv=typeof globalThis.ResizeObserver!="undefined"?globalThis.ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},Sv=(e,t,n)=>{n.current.caches.rowsMeta={heights:new Map};const r=Rs(n.current.state),o=kr(n),s=Mr(n.current.state),l=Math.min(s.enabled?s.paginationModel.pageSize:o,o);return C({},e,{rowsMeta:{currentPageTotalHeight:l*r,positions:Array.from({length:l},(a,c)=>c*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},kv=(e,t)=>{const{getRowHeight:n,getRowSpacing:r,getEstimatedRowHeight:o}=t,s=e.current.caches.rowsMeta.heights,l=g.useRef(-1),a=g.useRef(!1),c=g.useRef(!1),u=te(e,Un),d=Us(e),h=te(e,Kn),m=te(e,Rs),p=R=>{let _=s.get(R);return _===void 0&&(_={content:m,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},s.set(R,_)),_},b=g.useCallback(R=>{var D,V;const _=at(e.current.state).rowHeight,O=e.current.getRowHeightEntry(R.id);if(!n)O.content=_,O.needsFirstMeasurement=!1;else{const E=n(C({},R,{densityFactor:u}));if(E==="auto"){if(O.needsFirstMeasurement){const T=o?o(C({},R,{densityFactor:u})):_;O.content=T!=null?T:_}a.current=!0,O.autoHeight=!0}else O.content=Tc(E,_,vb),O.needsFirstMeasurement=!1,O.autoHeight=!1}if(r){const E=e.current.getRowIndexRelativeToVisibleRows(R.id),T=r(C({},R,{isFirstVisible:E===0,isLastVisible:E===d.rows.length-1,indexRelativeToCurrentPage:E}));O.spacingTop=(D=T.top)!=null?D:0,O.spacingBottom=(V=T.bottom)!=null?V:0}else O.spacingTop=0,O.spacingBottom=0;return e.current.unstable_applyPipeProcessors("rowHeight",O,R),O},[e,d.rows,n,o,m,r,u]),x=g.useCallback(()=>{a.current=!1;const R=h.top.reduce((T,L)=>{const $=b(L);return T+$.content+$.spacingTop+$.spacingBottom+$.detail},0),_=h.bottom.reduce((T,L)=>{const $=b(L);return T+$.content+$.spacingTop+$.spacingBottom+$.detail},0),O=[],D=d.rows.reduce((T,L)=>{O.push(T);const $=b(L),G=$.content+$.spacingTop+$.spacingBottom+$.detail;return T+G},0);a.current||(l.current=1/0);const V=R!==e.current.state.rowsMeta.pinnedTopRowsTotalHeight||_!==e.current.state.rowsMeta.pinnedBottomRowsTotalHeight||D!==e.current.state.rowsMeta.currentPageTotalHeight,E={currentPageTotalHeight:D,positions:O,pinnedTopRowsTotalHeight:R,pinnedBottomRowsTotalHeight:_};e.current.setState(T=>C({},T,{rowsMeta:E})),V&&e.current.updateDimensions(),c.current=!0},[e,h,d.rows,b]),w=R=>{var _,O;return(O=(_=s.get(R))==null?void 0:_.content)!=null?O:m},k=(R,_)=>{const O=e.current.getRowHeightEntry(R),D=O.content!==_;O.needsFirstMeasurement=!1,O.content=_,c.current&&(c.current=!D)},v=R=>{var _,O;return(O=(_=s.get(R))==null?void 0:_.autoHeight)!=null?O:!1},F=()=>l.current,j=R=>{a.current&&R>l.current&&(l.current=R)},y=()=>{s.clear(),x()},A=Bt.default(()=>new vv(R=>{var _;for(let O=0;O<R.length;O+=1){const D=R[O],V=D.borderBoxSize&&D.borderBoxSize.length>0?D.borderBoxSize[0].blockSize:D.contentRect.height,E=D.target.__mui_id;if(((_=du(e))==null?void 0:_.id)===E&&V===0)return;e.current.unstable_storeRowHeightMeasurement(E,V)}c.current||requestAnimationFrame(()=>{e.current.requestPipeProcessorsApplication("rowHeight")})})).current,N=(R,_)=>(R.__mui_id=_,A.observe(R),()=>A.unobserve(R));nl(e,"rowHeight",x),re.unstable_useEnhancedEffect(()=>{x()},[x]);const M={unstable_getRowHeight:w,unstable_setLastMeasuredRowIndex:j,unstable_storeRowHeightMeasurement:k,resetRowHeights:y},P={hydrateRowsMeta:x,observeRowHeight:N,rowHasAutoHeight:v,getRowHeightEntry:p,getLastMeasuredRowIndex:F};Se(e,M,"public"),Se(e,P,"private")},Iv=e=>{const t=g.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=g.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(l=>{l()}),e.current.forceUpdate()},[e]);Se(e,{exportState:t,restoreState:n},"public")},Mv=e=>{const t=g.useRef({}),n=(a,c)=>{var u;return(u=t.current[a])==null?void 0:u[c]},r=()=>{t.current={}},o=g.useCallback(({rowId:a,minFirstColumn:c,maxLastColumn:u,columns:d})=>{for(let h=c;h<u;h+=1){const m=Ev({apiRef:e,lookup:t.current,columnIndex:h,rowId:a,minFirstColumnIndex:c,maxLastColumnIndex:u,columns:d});m.colSpan>1&&(h+=m.colSpan-1)}},[e]),s={unstable_getCellColSpanInfo:n},l={resetColSpan:r,calculateColSpan:o};Se(e,s,"public"),Se(e,l,"private"),le(e,"columnOrderChange",r)};function Ev(e){const{apiRef:t,lookup:n,columnIndex:r,rowId:o,minFirstColumnIndex:s,maxLastColumnIndex:l,columns:a}=e,c=a.length,u=a[r],d=t.current.getRow(o),h=t.current.getRowValue(d,u),m=typeof u.colSpan=="function"?u.colSpan(h,d,u,t):u.colSpan;if(!m||m===1)return Xo(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:1,width:u.computedWidth}}),{colSpan:1};let p=u.computedWidth;for(let b=1;b<m;b+=1){const x=r+b;if(x>=s&&x<l){const w=a[x];p+=w.computedWidth,Xo(n,o,r+b,{spannedByColSpan:!0,rightVisibleCellIndex:Math.min(r+m,c-1),leftVisibleCellIndex:r})}Xo(n,o,r,{spannedByColSpan:!1,cellProps:{colSpan:m,width:p}})}return{colSpan:m}}function Xo(e,t,n,r){e[t]||(e[t]={}),e[t][n]=r}const bd=(e,t,n)=>{if(pc(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(`
|
|
90
|
-
`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(s=>{bd(s,[...t,r],n)})},fs=e=>{if(!e)return{};const t={};return e.forEach(n=>{bd(n,[],t)}),t},hs=(e,t,n)=>{const r=c=>{var u;return(u=t[c])!=null?u:[]},o=[],s=Math.max(...e.map(c=>r(c).length)),l=(c,u,d)=>sn(r(c).slice(0,d+1),r(u).slice(0,d+1)),a=(c,u)=>!!(n!=null&&n.left&&n.left.includes(c)&&!n.left.includes(u)||n!=null&&n.right&&!n.right.includes(c)&&n.right.includes(u));for(let c=0;c<s;c+=1){const u=e.reduce((d,h)=>{var w;const m=(w=r(h)[c])!=null?w:null;if(d.length===0)return[{columnFields:[h],groupId:m}];const p=d[d.length-1],b=p.columnFields[p.columnFields.length-1];return p.groupId!==m||!l(b,h,c)||a(b,h)?[...d,{columnFields:[h],groupId:m}]:[...d.slice(0,d.length-1),{columnFields:[...p.columnFields,h],groupId:m}]},[]);o.push(u)}return o},Pv=["groupId","children"],rl=e=>{let t={};return e.forEach(n=>{if(pc(n))return;const{groupId:r,children:o}=n,s=me(n,Pv);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");process.env.NODE_ENV!=="production"&&(o||console.warn(`MUI X: group groupId=${r} has no children.`));const l=C({},s,{groupId:r}),a=rl(o);if(a[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=C({},t,a,{[r]:l})}),C({},t)},Tv=(e,t,n)=>{var u,d,h;if(!t.columnGroupingModel)return e;const r=Yt(n),o=Xn(n),s=rl((u=t.columnGroupingModel)!=null?u:[]),l=fs((d=t.columnGroupingModel)!=null?d:[]),a=hs(r,l,(h=n.current.state.pinnedColumns)!=null?h:{}),c=o.length===0?0:Math.max(...o.map(m=>{var p,b;return(b=(p=l[m])==null?void 0:p.length)!=null?b:0}));return C({},e,{columnGrouping:{lookup:s,unwrappedGroupingModel:l,headerStructure:a,maxDepth:c}})},Fv=(e,t)=>{const n=g.useCallback(a=>{var u;return(u=ou(e)[a])!=null?u:[]},[e]),r=g.useCallback(()=>su(e),[e]);Se(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const s=g.useCallback(()=>{var c;const a=fs((c=t.columnGroupingModel)!=null?c:[]);e.current.setState(u=>{var p,b,x;const d=(b=(p=u.columns)==null?void 0:p.orderedFields)!=null?b:[],h=(x=u.pinnedColumns)!=null?x:{},m=hs(d,a,h);return C({},u,{columnGrouping:C({},u.columnGrouping,{headerStructure:m})})})},[e,t.columnGroupingModel]),l=g.useCallback(a=>{var x,w,k;const c=(k=(w=(x=e.current).getPinnedColumns)==null?void 0:w.call(x))!=null?k:{},u=Yt(e),d=Xn(e),h=rl(a!=null?a:[]),m=fs(a!=null?a:[]),p=hs(u,m,c),b=d.length===0?0:Math.max(...d.map(v=>{var F,j;return(j=(F=m[v])==null?void 0:F.length)!=null?j:0}));e.current.setState(v=>C({},v,{columnGrouping:{lookup:h,unwrappedGroupingModel:m,headerStructure:p,maxDepth:b}}))},[e]);le(e,"columnIndexChange",s),le(e,"columnsChange",()=>{l(t.columnGroupingModel)}),le(e,"columnVisibilityModelChange",()=>{l(t.columnGroupingModel)}),g.useEffect(()=>{l(t.columnGroupingModel)},[l,t.columnGroupingModel])};function jv(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function qi(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Ui(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function Ov(e,t,n){return n==="Left"?e-t.left:t.right-e}function Rv(e){return e==="Right"?"Left":"Right"}function Lv(e,t){const n=e.classList.contains(I["columnSeparator--sideRight"])?"Right":"Left";return t?Rv(n):n}function Ki(e){e.preventDefault(),e.stopImmediatePropagation()}function Dv(e){const t=g.useRef(void 0),n=()=>cu(e),r=te(e,n);return g.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=jv()}return t.current}}function Hv(e,t){if(e.length<4)return e;const n=e.slice();n.sort((a,c)=>a-c);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],s=o-r,l=s<5?5:s*t;return n.filter(a=>a>r-l&&a<o+l)}function _v(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(I.autosizing),n.forEach(s=>{var b,x;const a=nx(e.current,s.field).map(w=>{var k;return(k=w.getBoundingClientRect().width)!=null?k:0}),c=t.includeOutliers?a:Hv(a,t.outliersFactor);if(t.includeHeaders){const w=tx(e.current,s.field);if(w){const k=w.querySelector(`.${I.columnHeaderTitle}`),v=w.querySelector(`.${I.columnHeaderTitleContainerContent}`),F=w.querySelector(`.${I.iconButtonContainer}`),j=w.querySelector(`.${I.menuIcon}`),y=k!=null?k:v,A=window.getComputedStyle(w,null),N=parseInt(A.paddingLeft,10)+parseInt(A.paddingRight,10),P=y.scrollWidth+1+N+((b=F==null?void 0:F.clientWidth)!=null?b:0)+((x=j==null?void 0:j.clientWidth)!=null?x:0);c.push(P)}}const u=s.minWidth!==-1/0&&s.minWidth!==void 0,d=s.maxWidth!==1/0&&s.maxWidth!==void 0,h=u?s.minWidth:0,m=d?s.maxWidth:1/0,p=c.length===0?0:Math.max(...c);r[s.field]=xt(p,h,m)}),o.classList.remove(I.autosizing),r}const Av=e=>C({},e,{columnResize:{resizingColumnField:""}});function Vv(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const Nv=(e,t)=>{const n=Gt.useRtl(),r=ct(e,"useGridColumnResize"),o=Bt.default(Vv).current,s=g.useRef(null),l=g.useRef(null),a=wn.default(),c=g.useRef(void 0),u=P=>{var E,T;r.debug(`Updating width to ${P} for col ${o.colDef.field}`);const R=o.columnHeaderElement.offsetWidth,_=P-R,O=P-o.initialColWidth;if(O>0){const L=o.initialTotalWidth+O;(T=(E=e.current.rootElementRef)==null?void 0:E.current)==null||T.style.setProperty("--DataGrid-rowWidth",`${L}px`)}o.colDef.computedWidth=P,o.colDef.width=P,o.colDef.flex=0,o.columnHeaderElement.style.width=`${P}px`;const D=o.headerFilterElement;D&&(D.style.width=`${P}px`),o.groupHeaderElements.forEach(L=>{const $=L;let G;$.getAttribute("aria-colspan")==="1"?G=`${P}px`:G=`${$.offsetWidth+_}px`,$.style.width=G}),o.cellElements.forEach(L=>{const $=L;let G;$.getAttribute("aria-colspan")==="1"?G=`${P}px`:G=`${$.offsetWidth+_}px`,$.style.setProperty("--width",G)});const V=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);V===rn.LEFT&&(Pn(o.fillerLeft,"width",_),o.leftPinnedCellsAfter.forEach(L=>{Pn(L,"left",_)}),o.leftPinnedHeadersAfter.forEach(L=>{Pn(L,"left",_)})),V===rn.RIGHT&&(Pn(o.fillerRight,"width",_),o.rightPinnedCellsBefore.forEach(L=>{Pn(L,"right",_)}),o.rightPinnedHeadersBefore.forEach(L=>{Pn(L,"right",_)}))},d=P=>{if(k(),o.previousMouseClickEvent){const R=o.previousMouseClickEvent,_=R.timeStamp,O=R.clientX,D=R.clientY;if(P.timeStamp-_<300&&P.clientX===O&&P.clientY===D){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,P);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const R=Nt(e.current.state);o.groupHeaderElements.forEach(_=>{const O=K0(_),D=_,E=`${O.reduce((T,L)=>R.columnVisibilityModel[L]!==!1?T+R.lookup[L].computedWidth:T,0)}px`;D.style.width=E})}a.start(0,()=>{e.current.publishEvent("columnResizeStop",null,P)})},h=(P,R,_)=>{var E;const O=e.current.rootElementRef.current;o.initialColWidth=P.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=P,o.columnHeaderElement=U0(e.current.columnHeadersContainerRef.current,P.field);const D=O.querySelector(`.${I.headerFilterRow} [data-field="${Jt(P.field)}"]`);D&&(o.headerFilterElement=D),o.groupHeaderElements=X0((E=e.current.columnHeadersContainerRef)==null?void 0:E.current,P.field),o.cellElements=Y0(o.columnHeaderElement,e.current),o.fillerLeft=Si(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=Si(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const V=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=V!==rn.LEFT?[]:Z0(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=V!==rn.RIGHT?[]:Q0(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=V!==rn.LEFT?[]:J0(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=V!==rn.RIGHT?[]:ex(e.current,o.columnHeaderElement,n),l.current=Lv(R,n),s.current=Ov(_,o.columnHeaderElement.getBoundingClientRect(),l.current)},m=re.unstable_useEventCallback(d),p=re.unstable_useEventCallback(P=>{if(P.buttons===0){m(P);return}let R=Ui(s.current,P.clientX,o.columnHeaderElement.getBoundingClientRect(),l.current);R=xt(R,o.colDef.minWidth,o.colDef.maxWidth),u(R);const _={element:o.columnHeaderElement,colDef:o.colDef,width:R};e.current.publishEvent("columnResize",_,P)}),b=re.unstable_useEventCallback(P=>{qi(P,c.current)&&d(P)}),x=re.unstable_useEventCallback(P=>{const R=qi(P,c.current);if(!R)return;if(P.type==="mousemove"&&P.buttons===0){b(P);return}let _=Ui(s.current,R.x,o.columnHeaderElement.getBoundingClientRect(),l.current);_=xt(_,o.colDef.minWidth,o.colDef.maxWidth),u(_);const O={element:o.columnHeaderElement,colDef:o.colDef,width:_};e.current.publishEvent("columnResize",O,P)}),w=re.unstable_useEventCallback(P=>{const R=no(P.target,I["columnSeparator--resizable"]);if(!R)return;const _=P.changedTouches[0];_!=null&&(c.current=_.identifier);const O=no(P.target,I.columnHeader),D=q0(O),V=e.current.getColumn(D);r.debug(`Start Resize on col ${V.field}`),e.current.publishEvent("columnResizeStart",{field:D},P),h(V,R,_.clientX);const E=re.unstable_ownerDocument(P.currentTarget);E.addEventListener("touchmove",x),E.addEventListener("touchend",b)}),k=g.useCallback(()=>{const P=re.unstable_ownerDocument(e.current.rootElementRef.current);P.body.style.removeProperty("cursor"),P.removeEventListener("mousemove",p),P.removeEventListener("mouseup",m),P.removeEventListener("touchmove",x),P.removeEventListener("touchend",b),setTimeout(()=>{P.removeEventListener("click",Ki,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,p,m,x,b]),v=g.useCallback(({field:P})=>{e.current.setState(R=>C({},R,{columnResize:C({},R.columnResize,{resizingColumnField:P})})),e.current.forceUpdate()},[e]),F=g.useCallback(()=>{e.current.setState(P=>C({},P,{columnResize:C({},P.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),j=re.unstable_useEventCallback(({colDef:P},R)=>{if(R.button!==0||!R.currentTarget.classList.contains(I["columnSeparator--resizable"]))return;R.preventDefault(),r.debug(`Start Resize on col ${P.field}`),e.current.publishEvent("columnResizeStart",{field:P.field},R),h(P,R.currentTarget,R.clientX);const _=re.unstable_ownerDocument(e.current.rootElementRef.current);_.body.style.cursor="col-resize",o.previousMouseClickEvent=R.nativeEvent,_.addEventListener("mousemove",p),_.addEventListener("mouseup",m),_.addEventListener("click",Ki,!0)}),y=re.unstable_useEventCallback((P,R)=>{if(t.disableAutosize||R.button!==0)return;const _=e.current.state.columns.lookup[P.field];_.resizable!==!1&&e.current.autosizeColumns(C({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[_.field]}))}),A=Dv(e),N=g.useRef(!1),M=g.useCallback(async P=>{var V,E;if(!((V=e.current.rootElementRef)==null?void 0:V.current)||N.current)return;N.current=!0;const _=Nt(e.current.state),O=C({},Gw,P,{columns:(E=P==null?void 0:P.columns)!=null?E:_.orderedFields});O.columns=O.columns.filter(T=>_.columnVisibilityModel[T]!==!1);const D=O.columns.map(T=>e.current.state.columns.lookup[T]);try{!t.disableVirtualization&&O.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await A());const T=_v(e,O,D),L=D.map($=>C({},$,{width:T[$.field],computedWidth:T[$.field],flex:0}));if(O.expand){const G=_.orderedFields.map(q=>_.lookup[q]).filter(q=>_.columnVisibilityModel[q.field]!==!1).reduce((q,U)=>{var Q,X;return q+((X=(Q=T[U.field])!=null?Q:U.computedWidth)!=null?X:U.width)},0),z=e.current.getRootDimensions().viewportInnerSize.width-G;if(z>0){const q=z/(L.length||1);L.forEach(U=>{U.width+=q,U.computedWidth+=q})}}e.current.updateColumns(L),L.forEach(($,G)=>{if($.width!==D[G].width){const S=$.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement($.field),colDef:$,width:S})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),N.current=!1}},[e,A,t.disableVirtualization]);g.useEffect(()=>k,[k]),fa.default(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),Gc(e,()=>{var P;return(P=e.current.columnHeadersContainerRef)==null?void 0:P.current},"touchstart",w,{passive:!0}),Se(e,{autosizeColumns:M},"public"),le(e,"columnResizeStop",F),le(e,"columnResizeStart",v),le(e,"columnSeparatorMouseDown",j),le(e,"columnSeparatorDoubleClick",y),Ae(e,"columnResize",t.onColumnResize),Ae(e,"columnWidthChange",t.onColumnWidthChange)};function Pn(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function $v(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function Xi(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const Yo=(e,t,n)=>{var s;if(!e)return null;let r=e[t.field];const o=(s=t.rowSpanValueGetter)!=null?s:t.valueGetter;return o&&(r=o(r,e,t,n)),r},Hn={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},io={firstRowIndex:0,lastRowIndex:0},zv=new Set([yt,"__reorder__",mo]),Yi=20,Cd=(e,t,n,r,o,s,l)=>{const a=s?{}:C({},e.current.state.rowSpanning.spannedCells),c=s?{}:C({},e.current.state.rowSpanning.hiddenCells),u=s?{}:C({},e.current.state.rowSpanning.hiddenCellOriginMap);return s&&(l=io),t.forEach(d=>{var h;if(!zv.has(d.field)){for(let m=o.firstRowIndex;m<o.lastRowIndex;m+=1){const p=n[m];if((h=c[p.id])!=null&&h[d.field])continue;const b=Yo(p.model,d,e);if(b==null)continue;let x=p.id,w=m,k=0;const v=[];if(m===o.firstRowIndex){let j=m-1,y=n[j];for(;j>=r.firstRowIndex&&y&&Yo(y.model,d,e)===b;){const A=n[j+1];c[A.id]?c[A.id][d.field]=!0:c[A.id]={[d.field]:!0},v.push(m),k+=1,x=y.id,w=j,j-=1,y=n[j]}}v.forEach(j=>{u[j]?u[j][d.field]=w:u[j]={[d.field]:w}});let F=m+1;for(;F<=r.lastRowIndex&&n[F]&&Yo(n[F].model,d,e)===b;){const j=n[F];c[j.id]?c[j.id][d.field]=!0:c[j.id]={[d.field]:!0},u[F]?u[F][d.field]=w:u[F]={[d.field]:w},F+=1,k+=1}k>0&&(a[x]?a[x][d.field]=k+1:a[x]={[d.field]:k+1})}l={firstRowIndex:Math.min(l.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:a,hiddenCells:c,hiddenCellOriginMap:u,processedRange:l}},wd=(e,t)=>{const n=fr(t).length;if(e.pagination){const r=Kc(t);let o=Yi;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(Yi,n)}},Gv=(e,t,n)=>{var b;if(!t.unstable_rowSpanning)return C({},e,{rowSpanning:Hn});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],s=e.rows.dataRowIdToModelLookup,l=e.columns.lookup,a=!!e.filter.filterModel.items.length||!!((b=e.filter.filterModel.quickFilterValues)!=null&&b.length);if(!r.length||!o.length||!s||!l||a)return C({},e,{rowSpanning:Hn});const c=wd(t,n),u=r.map(x=>({id:x,model:s[x]})),d=o.map(x=>l[x]),{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p}=Cd(n,d,u,c,c,!0,io);return C({},e,{rowSpanning:{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p}})},Bv=(e,t)=>{const n=Bt.default(()=>e.current.state.rowSpanning!==Hn?wd(t,e):io),r=g.useCallback((s,l=!1)=>{const{range:a,rows:c}=an(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(a===null||!Xi(s))return;l&&(n.current=io);const u=$v({firstRowIndex:s.firstRowIndex,lastRowIndex:Math.min(s.lastRowIndex,a.lastRowIndex+1)},n.current);if(u===null)return;const d=Ke(e),{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p,processedRange:b}=Cd(e,d,c,a,u,l,n.current);n.current=b;const x=Object.keys(h).length,w=Object.keys(m).length,k=Object.keys(e.current.state.rowSpanning.spannedCells).length,v=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(l||x!==k||w!==v)||x===0&&k===0||e.current.setState(y=>C({},y,{rowSpanning:{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p}}))},[e,n,t.pagination,t.paginationMode]),o=g.useCallback(()=>{const s=Fr(e);Xi(s)&&r(s,!0)},[e,r]);le(e,"renderedRowsIntervalChange",mn(t.unstable_rowSpanning,r)),le(e,"sortedRowsSet",mn(t.unstable_rowSpanning,o)),le(e,"paginationModelChange",mn(t.unstable_rowSpanning,o)),le(e,"filteredRowsSet",mn(t.unstable_rowSpanning,o)),le(e,"columnsChange",mn(t.unstable_rowSpanning,o)),g.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===Hn&&o():e.current.state.rowSpanning!==Hn&&e.current.setState(s=>C({},s,{rowSpanning:Hn}))},[e,o,t.unstable_rowSpanning])},Wv=(e,t,n)=>C({},e,{listViewColumn:t.unstable_listColumn?C({},t.unstable_listColumn,{computedWidth:gs(n)}):void 0});function qv(e,t){const n=()=>{e.current.setState(s=>s.listViewColumn?C({},s,{listViewColumn:C({},s.listViewColumn,{computedWidth:gs(e)})}):s)},r=g.useRef(null);le(e,"viewportInnerSizeChange",s=>{r.current!==s.width&&(r.current=s.width,n())}),le(e,"columnVisibilityModelChange",n),ia.default(()=>{const s=t.unstable_listColumn;s&&e.current.setState(l=>C({},l,{listViewColumn:C({},s,{computedWidth:gs(e)})}))},[e,t.unstable_listColumn]),g.useEffect(()=>{t.unstable_listView&&!t.unstable_listColumn&&kt(["MUI X: The `unstable_listColumn` prop must be set if `unstable_listView` is enabled.",'To fix, pass a column definition to the `unstable_listColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.',"For more details, see https://mui.com/x/react-data-grid/list-view/"])},[t.unstable_listView,t.unstable_listColumn])}function gs(e){return at(e.current.state).viewportInnerSize.width}const Uv=(e,t)=>{const n=my(e,t);return fv(n,t),iv(n),lt(hy,n,t),lt(cv,n,t),lt(Sy,n,t),lt(nv,n,t),lt(By,n,t),lt(ev,n,t),lt(_y,n,t),lt(hv,n,t),lt(qy,n,t),lt(Ry,n,t),lt(Gv,n,t),lt(Iy,n,t),lt(Av,n,t),lt(yy,n,t),lt(Tv,n,t),lt(rw,n,t),lt(wv,n,t),lt(Sv,n,t),lt(Wv,n,t),$y(n,t),uv(n,t),ky(n,t),rv(n,t),Bv(n,t),av(n,t),Mv(n),Fv(n,t),tv(n,t),Ay(n,t),Uy(n,t),Hy(n,t),gv(n,t),My(n,t),Nv(n,t),Wy(n,t),kv(n,t),mv(n,t),vy(n),Py(n,t),Oy(n,t),xy(n,t),xv(n,t),pv(n,t),Iv(n),ow(n,t),qv(n,t),n},Kv=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:s,showRightBorder:l,groupId:a,pinnedPosition:c}=e,u={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",l&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder","withBorderColor",a===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",c===Ie.LEFT&&"columnHeader--pinnedLeft",c===Ie.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return re.unstable_composeClasses(u,Te,t)};function Xv(e){var $;const{groupId:t,width:n,depth:r,maxDepth:o,fields:s,height:l,colIndex:a,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:h,pinnedOffset:m}=e,p=ue(),b=Gt.useRtl(),x=g.useRef(null),w=ke(),k=te(w,su),v=t?k[t]:{},{headerName:F=t!=null?t:"",description:j="",headerAlign:y=void 0}=v;let A;const N=t&&(($=k[t])==null?void 0:$.renderHeaderGroup),M=g.useMemo(()=>({groupId:t,headerName:F,description:j,depth:r,maxDepth:o,fields:s,colIndex:a,isLastColumn:d}),[t,F,j,r,o,s,a,d]);t&&N&&(A=N(M));const P=C({},e,{classes:p.classes,headerAlign:y,depth:r,isDragging:!1}),R=F!=null?F:t,_=re.unstable_useId(),O=t===null?`empty-group-cell-${_}`:t,D=Kv(P);g.useLayoutEffect(()=>{if(c){const S=x.current.querySelector('[tabindex="0"]')||x.current;if(!S)return;if(Zs())S.focus({preventScroll:!0});else{const H=w.current.getScrollPosition();S.focus(),w.current.scroll(H)}}},[w,c]);const V=g.useCallback(G=>S=>{jr(S)||w.current.publishEvent(G,M,S)},[w,M]),E=g.useMemo(()=>({onKeyDown:V("columnGroupHeaderKeyDown"),onFocus:V("columnGroupHeaderFocus"),onBlur:V("columnGroupHeaderBlur")}),[V]),T=typeof v.headerClassName=="function"?v.headerClassName(M):v.headerClassName,L=g.useMemo(()=>vo(C({},e.style),b,h,m),[h,m,e.style,b]);return i.jsx(ju,C({ref:x,classes:D,columnMenuOpen:!1,colIndex:a,height:l,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:A,headerClassName:T,description:j,elementId:O,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:R,"aria-colspan":s.length,"data-fields":`|-${s.join("-|-")}-|`,style:L},E))}const Zi=ge.styled("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Yv=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:a,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:m}=e,[p,b]=g.useState(""),[x,w]=g.useState(""),k=Et(),v=ue(),F=te(k,ou),j=te(k,dn),y=te(k,nw),A=te(k,Yn),N=te(k,Qt),M=fu(j,y,A.left.length),P=te(k,uo),R=te(k,ic),_=te(k,x1),O=te(k,y1),D=te(k,ac),V=g.useCallback(X=>w(X.field),[]),E=g.useCallback(()=>w(""),[]),T=g.useCallback(X=>b(X.field),[]),L=g.useCallback(()=>b(""),[]),$=g.useMemo(()=>A.left.length?{firstColumnIndex:0,lastColumnIndex:A.left.length}:null,[A.left.length]),G=g.useMemo(()=>A.right.length?{firstColumnIndex:t.length-A.right.length,lastColumnIndex:t.length}:null,[A.right.length,t.length]);le(k,"columnResizeStart",V),le(k,"columnResizeStop",E),le(k,"columnHeaderDragStart",T),le(k,"columnHeaderDragEnd",L);const S=X=>{const{renderContext:W=y}=X||{},K=W.firstColumnIndex,Y=W.lastColumnIndex;return{renderedColumns:t.slice(K,Y),firstColumnToRender:K,lastColumnToRender:Y}},H=(X,W,K,Y=!1)=>{const J=(X==null?void 0:X.position)===Ie.RIGHT,ne=(X==null?void 0:X.position)===void 0,Z=A.right.length>0&&J||A.right.length===0&&ne,oe=M-K;return i.jsxs(g.Fragment,{children:[ne&&i.jsx("div",{role:"presentation",style:{width:oe}}),W,ne&&i.jsx("div",{role:"presentation",className:Pe(I.filler,Y&&I["filler--borderBottom"])}),Z&&i.jsx(el,{header:!0,pinnedRight:J,borderBottom:Y,borderTop:!1})]})},z=(X,W={})=>{const{renderedColumns:K,firstColumnToRender:Y}=S(X),J=[];for(let ne=0;ne<K.length;ne+=1){const Z=K[ne],oe=Y+ne,ee=oe===0,ae=o!==null&&o.field===Z.field||ee&&!m?0:-1,fe=l!==null&&l.field===Z.field,xe=u.open&&u.field===Z.field,pe=X==null?void 0:X.position,Me=mr(pe,Z.computedWidth,oe,j,P,D),Re=pe===Ie.RIGHT?K[ne-1]:K[ne+1],Je=Re?l!==null&&l.field===Re.field:!1,De=oe+1===j.length-A.right.length,Oe=ne,Ye=K.length,qe=so(pe,Oe),we=oo(pe,Oe,Ye,v.showColumnVerticalBorder,R);J.push(i.jsx(fx,C({},n[Z.field],{columnMenuOpen:xe,filterItemsCounter:r[Z.field]&&r[Z.field].length,headerHeight:_,isDragging:Z.field===p,colDef:Z,colIndex:oe,isResizing:x===Z.field,isLast:oe===j.length-1,hasFocus:fe,tabIndex:ae,pinnedPosition:pe,pinnedOffset:Me,isLastUnpinned:De,isSiblingFocused:Je,showLeftBorder:qe,showRightBorder:we},W),Z.field))}return H(X,J,0)},q=()=>i.jsxs(Zi,{role:"row","aria-rowindex":c+1,ownerState:v,className:I["row--borderBottom"],children:[$&&z({position:Ie.LEFT,renderContext:$},{disableReorder:!0}),z({renderContext:y}),G&&z({position:Ie.RIGHT,renderContext:G},{disableReorder:!0,separatorSide:Qs.Left})]}),U=({depth:X,params:W})=>{var Ye,qe,we,He;const K=S(W);if(K.renderedColumns.length===0)return null;const{firstColumnToRender:Y,lastColumnToRender:J}=K,ne=h[X],Z=t[Y].field,oe=(qe=(Ye=F[Z])==null?void 0:Ye[X])!=null?qe:null,ee=ne.findIndex(({groupId:ve,columnFields:ce})=>ve===oe&&ce.includes(Z)),ae=t[J-1].field,fe=(He=(we=F[ae])==null?void 0:we[X])!=null?He:null,xe=ne.findIndex(({groupId:ve,columnFields:ce})=>ve===fe&&ce.includes(ae)),pe=ne.slice(ee,xe+1).map(ve=>C({},ve,{columnFields:ve.columnFields.filter(ce=>d[ce]!==!1)})).filter(ve=>ve.columnFields.length>0),Me=pe[0].columnFields.indexOf(Z),Je=pe[0].columnFields.slice(0,Me).reduce((ve,ce)=>{var Ce;const ye=N[ce];return ve+((Ce=ye.computedWidth)!=null?Ce:0)},0);let De=Y;const Oe=pe.map(({groupId:ve,columnFields:ce},ye)=>{const Ce=a!==null&&a.depth===X&&ce.includes(a.field),Ze=s!==null&&s.depth===X&&ce.includes(s.field)?0:-1,ot={width:ce.reduce((Dt,Ht)=>Dt+N[Ht].computedWidth,0),fields:ce,colIndex:De},Qe=W.position,Pt=mr(Qe,ot.width,De,j,P,D);De+=ce.length;let Tt=ye;return Qe===Ie.LEFT&&(Tt=De-1),i.jsx(Xv,{groupId:ve,width:ot.width,fields:ot.fields,colIndex:ot.colIndex,depth:X,isLastColumn:ye===pe.length-1,maxDepth:c,height:O,hasFocus:Ce,tabIndex:Ze,pinnedPosition:Qe,pinnedOffset:Pt,showLeftBorder:so(Qe,Tt),showRightBorder:oo(Qe,Tt,pe.length,v.showColumnVerticalBorder,R)},ye)});return H(W,Oe,Je)};return{renderContext:y,leftRenderContext:$,rightRenderContext:G,pinnedColumns:A,visibleColumns:t,columnPositions:j,getFillers:H,getColumnHeadersRow:q,getColumnsToRender:S,getColumnGroupHeadersRows:()=>{if(c===0)return null;const X=[];for(let W=0;W<c;W+=1)X.push(i.jsxs(Zi,{role:"row","aria-rowindex":W+1,ownerState:v,children:[$&&U({depth:W,params:{position:Ie.LEFT,renderContext:$,maxLastColumn:$.lastColumnIndex}}),U({depth:W,params:{renderContext:y}}),G&&U({depth:W,params:{position:Ie.RIGHT,renderContext:G,maxLastColumn:G.lastColumnIndex}})]},W));return X},getPinnedCellOffset:mr,isDragging:!!p,getInnerProps:()=>({role:"rowgroup"})}},Zv=["className"],Qv=e=>{const{classes:t}=e,n={root:["columnHeaders"]};return Xe.default(n,Te,t)},Jv=Ge.styled("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),eS=je(function(t,n){const{className:r}=t,o=me(t,Zv),s=ue(),l=Qv(s);return i.jsx(Jv,C({className:Pe(l.root,r),ownerState:s},o,{role:"presentation",ref:n}))}),tS=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],xd=je(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:s,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:h,columnVisibility:m,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:b}=t,x=me(t,tS),{getInnerProps:w,getColumnHeadersRow:k,getColumnGroupHeadersRows:v}=Yv({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:s,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:h,columnVisibility:m,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:b});return i.jsxs(eS,C({},x,w(),{ref:n,children:[v(),k()]}))});process.env.NODE_ENV!=="production"&&(xd.propTypes={columnGroupHeaderFocus:f.shape({depth:f.number.isRequired,field:f.string.isRequired}),columnGroupHeaderTabIndexState:f.shape({depth:f.number.isRequired,field:f.string.isRequired}),columnGroupsHeaderStructure:f.arrayOf(f.arrayOf(f.shape({columnFields:f.arrayOf(f.string).isRequired,groupId:f.string}))).isRequired,columnHeaderFocus:f.shape({field:f.string.isRequired}),columnHeaderTabIndexState:f.shape({field:f.string.isRequired}),columnMenuState:f.shape({field:f.string,open:f.bool.isRequired}).isRequired,columnVisibility:f.object.isRequired,filterColumnLookup:f.object.isRequired,hasOtherElementInTabSequence:f.bool.isRequired,headerGroupingMaxDepth:f.number.isRequired,sortColumnLookup:f.object.isRequired,visibleColumns:f.arrayOf(f.object).isRequired});const nS=Zt(xd);function rS(e){return null}function oS(e){return null}const sS=je(function(t,n){const o=ke().current.getLocaleText("noResultsOverlayLabel");return i.jsx(So,C({},t,{ref:n,children:o}))}),lS=["sortingOrder"],iS=g.memo(function(t){const{sortingOrder:n}=t,r=me(t,lS),o=ue(),[s]=n,l=s==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return l?i.jsx(l,C({},r)):null}),aS=["native"];function cS(e){let{native:t}=e,n=me(e,aS);return t?i.jsx("option",C({},n)):i.jsx(Xt.default,C({},n))}const uS={booleanCellTrueIcon:Ox,booleanCellFalseIcon:Wo,columnMenuIcon:Px,openFilterButtonIcon:yx,filterPanelDeleteIcon:Wo,columnFilteredIcon:Pi,columnSelectorIcon:Sx,columnUnsortedIcon:iS,columnSortedAscendingIcon:ki,columnSortedDescendingIcon:Ii,columnResizeIcon:kx,densityCompactIcon:Ix,densityStandardIcon:Mx,densityComfortableIcon:Ex,exportIcon:jx,moreActionsIcon:Rx,treeDataCollapseIcon:Ei,treeDataExpandIcon:Mi,groupingCriteriaCollapseIcon:Ei,groupingCriteriaExpandIcon:Mi,detailPanelExpandIcon:Ti,detailPanelCollapseIcon:Tx,rowReorderIcon:Fi,quickFilterIcon:vx,quickFilterClearIcon:Wo,columnMenuHideIcon:Lx,columnMenuSortAscendingIcon:ki,columnMenuSortDescendingIcon:Ii,columnMenuFilterIcon:Pi,columnMenuManageColumnsIcon:Dx,columnMenuClearIcon:Hx,loadIcon:Fx,filterPanelAddIcon:Ti,filterPanelRemoveAllIcon:_x,columnReorderIcon:Fi},dS=C({},uS,{baseBadge:xh.default,baseCheckbox:yh.default,baseDivider:vh.default,baseTextField:ha.default,baseFormControl:Sh.default,baseSelect:kh.default,baseButton:Ih.default,baseIconButton:ga.default,baseInputAdornment:Mh.default,baseTooltip:ma.default,basePopper:bs.default,baseInputLabel:Eh.default,baseSelectOption:cS,baseChip:Ph.default}),fS=C({},dS,{cell:u0,skeletonCell:p0,columnHeaderFilterIconButton:Du,columnHeaderSortIcon:wx,columnMenu:Uu,columnHeaders:nS,detailPanels:rS,footer:od,footerRowCount:ad,toolbar:null,pinnedRows:oS,loadingOverlay:sd,noResultsOverlay:sS,noRowsOverlay:ld,pagination:id,filterPanel:Qu,columnsPanel:Ku,columnsManagement:Ju,panel:Xu,row:K2}),hS={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},gS=fS,mS=e=>{const t=ge.useTheme(),n=n0(g.useMemo(()=>Ge.getThemeProps({props:e,theme:t,name:"MuiDataGrid"}),[t,e])),r=g.useMemo(()=>C({},S1,n.localeText),[n.localeText]),o=g.useMemo(()=>e0({defaultSlots:gS,slots:n.slots}),[n.slots]),s=g.useMemo(()=>Object.keys(ds).reduce((l,a)=>{var c;return l[a]=(c=n[a])!=null?c:ds[a],l},{}),[n]);return g.useMemo(()=>C({},n,s,{localeText:r,slots:o},hS),[n,r,o,s])},pS={hooks:{useGridAriaAttributes:X2,useGridRowAriaAttributes:Y2,useCellAggregationResult:()=>null}},yd=je(function(t,n){var s;const r=mS(t),o=Uv(r.apiRef,r);return process.env.NODE_ENV!=="production"&&o0(r,r0),i.jsx(Z2,{privateApiRef:o,configuration:pS,props:r,children:i.jsx(R0,C({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,(s=r.slotProps)==null?void 0:s.root,{ref:n}))})}),bS=g.memo(yd);yd.propTypes={apiRef:f.shape({current:f.object.isRequired}),"aria-label":f.string,"aria-labelledby":f.string,autoHeight:f.bool,autoPageSize:f.bool,autosizeOnMount:f.bool,autosizeOptions:f.shape({columns:f.arrayOf(f.string),disableColumnVirtualization:f.bool,expand:f.bool,includeHeaders:f.bool,includeOutliers:f.bool,outliersFactor:f.number}),cellModesModel:f.object,checkboxSelection:f.bool,classes:f.object,clipboardCopyCellDelimiter:f.string,columnBufferPx:f.number,columnGroupHeaderHeight:f.number,columnGroupingModel:f.arrayOf(f.object),columnHeaderHeight:f.number,columns:f.arrayOf(f.object).isRequired,columnVisibilityModel:f.object,density:f.oneOf(["comfortable","compact","standard"]),disableAutosize:f.bool,disableColumnFilter:f.bool,disableColumnMenu:f.bool,disableColumnResize:f.bool,disableColumnSelector:f.bool,disableColumnSorting:f.bool,disableDensitySelector:f.bool,disableEval:f.bool,disableMultipleRowSelection:f.bool,disableRowSelectionOnClick:f.bool,disableVirtualization:f.bool,editMode:f.oneOf(["cell","row"]),estimatedRowCount:f.number,experimentalFeatures:f.shape({warnIfFocusStateIsNotSynced:f.bool}),filterDebounceMs:f.number,filterMode:f.oneOf(["client","server"]),filterModel:f.shape({items:f.arrayOf(f.shape({field:f.string.isRequired,id:f.oneOfType([f.number,f.string]),operator:f.string.isRequired,value:f.any})).isRequired,logicOperator:f.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:f.bool,quickFilterLogicOperator:f.oneOf(["and","or"]),quickFilterValues:f.array}),forwardedProps:f.object,getCellClassName:f.func,getDetailPanelContent:f.func,getEstimatedRowHeight:f.func,getRowClassName:f.func,getRowHeight:f.func,getRowId:f.func,getRowSpacing:f.func,hideFooter:f.bool,hideFooterPagination:f.bool,hideFooterSelectedRowCount:f.bool,ignoreDiacritics:f.bool,ignoreValueFormatterDuringExport:f.oneOfType([f.shape({clipboardExport:f.bool,csvExport:f.bool}),f.bool]),indeterminateCheckboxAction:f.oneOf(["deselect","select"]),initialState:f.object,isCellEditable:f.func,isRowSelectable:f.func,keepNonExistentRowsSelected:f.bool,loading:f.bool,localeText:f.object,logger:f.shape({debug:f.func.isRequired,error:f.func.isRequired,info:f.func.isRequired,warn:f.func.isRequired}),logLevel:f.oneOf(["debug","error","info","warn",!1]),nonce:f.string,onCellClick:f.func,onCellDoubleClick:f.func,onCellEditStart:f.func,onCellEditStop:f.func,onCellKeyDown:f.func,onCellModesModelChange:f.func,onClipboardCopy:f.func,onColumnHeaderClick:f.func,onColumnHeaderContextMenu:f.func,onColumnHeaderDoubleClick:f.func,onColumnHeaderEnter:f.func,onColumnHeaderLeave:f.func,onColumnHeaderOut:f.func,onColumnHeaderOver:f.func,onColumnOrderChange:f.func,onColumnResize:f.func,onColumnVisibilityModelChange:f.func,onColumnWidthChange:f.func,onDensityChange:f.func,onFilterModelChange:f.func,onMenuClose:f.func,onMenuOpen:f.func,onPaginationMetaChange:f.func,onPaginationModelChange:f.func,onPreferencePanelClose:f.func,onPreferencePanelOpen:f.func,onProcessRowUpdateError:f.func,onResize:f.func,onRowClick:f.func,onRowCountChange:f.func,onRowDoubleClick:f.func,onRowEditStart:f.func,onRowEditStop:f.func,onRowModesModelChange:f.func,onRowSelectionModelChange:f.func,onSortModelChange:f.func,onStateChange:f.func,pageSizeOptions:f.arrayOf(f.oneOfType([f.number,f.shape({label:f.string.isRequired,value:f.number.isRequired})]).isRequired),pagination:f.oneOf([!0]),paginationMeta:f.shape({hasNextPage:f.bool}),paginationMode:f.oneOf(["client","server"]),paginationModel:f.shape({page:f.number.isRequired,pageSize:f.number.isRequired}),processRowUpdate:f.func,resetPageOnSortFilter:f.bool,resizeThrottleMs:f.number,rowBufferPx:f.number,rowCount:f.number,rowHeight:f.number,rowModesModel:f.object,rowPositionsDebounceMs:f.number,rows:f.arrayOf(f.object),rowSelection:f.bool,rowSelectionModel:f.oneOfType([f.arrayOf(f.oneOfType([f.number,f.string]).isRequired),f.number,f.string]),rowSpacingType:f.oneOf(["border","margin"]),scrollbarSize:f.number,showCellVerticalBorder:f.bool,showColumnVerticalBorder:f.bool,slotProps:f.object,slots:f.object,sortingMode:f.oneOf(["client","server"]),sortingOrder:f.arrayOf(f.oneOf(["asc","desc"])),sortModel:f.arrayOf(f.shape({field:f.string.isRequired,sort:f.oneOf(["asc","desc"])})),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),unstable_rowSpanning:f.bool,virtualizeColumnsWithAutoRowHeight:f.bool};const CS=({sx:e,...t})=>{const n=ge.useTheme();return i.jsx(bS,{disableRowSelectionOnClick:!0,...t,sx:{border:`1px solid ${n.palette.neutral.lighter}`,borderRadius:"8px",fontFamily:n.typography.fontFamily,fontSize:"0.875rem",[`& .${I.columnHeader}`]:{backgroundColor:"rgba(217, 217, 217, 0.10)",color:n.palette.neutral.dark,fontSize:"0.75rem",fontWeight:600,"&:focus, &:focus-within":{outline:`2px solid ${n.palette.primary.main}`,outlineOffset:"-2px"}},[`& .${I.columnSeparator}`]:{color:n.palette.neutral.lighter},[`& .${I.row}`]:{"&:hover":{backgroundColor:n.palette.neutral.lighter},"&.Mui-selected":{backgroundColor:n.palette.neutral.lighter,"&:hover":{backgroundColor:n.palette.neutral.lighter}}},[`& .${I.cell}`]:{color:n.palette.text.primary,"&:focus, &:focus-within":{outline:`2px solid ${n.palette.primary.main}`,outlineOffset:"-2px"}},[`& .${I.footerContainer}`]:{borderTop:`1px solid ${n.palette.neutral.lighter}`},[`& .${I.overlay}`]:{color:n.palette.neutral.dark},...e}})},wS=e=>"name"in e&&typeof e.name=="string"?e.name:"",xS=({className:e,columns:t,data:n=[],hideStarIcon:r=!1,isLoading:o=!1,sort:s,onConfigure:l,alwaysShowConfigureIcon:a=!1,onDelete:c,onEdit:u,onSelectRow:d,renderInlineEdit:h,labels:m={}})=>{const[p,b]=se.useState(""),{actions:x="Actions",noRecords:w="There are no records.",edit:k="Edit",configure:v="Configure"}=m,F=R=>u?u(p,R).then(()=>b("")):Promise.resolve(),j=se.useCallback((R,_)=>()=>{switch(_){case"configure":l==null||l(R);break;case"delete":c==null||c(R);break;case"edit":b(R);break;case"select":d==null||d(R);break}},[l,c,d]),y=R=>!!(l||c||u)&&R!==p,A="#F5F5F5",N="#555555",M="#FFFFFF",P="#364699";return i.jsx(B.TableContainer,{className:e,children:i.jsxs(Ah.default,{sx:{minWidth:800,"& td, & th":{px:4.5,py:3}},children:[i.jsx(Vh.default,{sx:{background:"rgba(217, 217, 217, 0.10)"},children:i.jsxs(dr.default,{sx:{border:"1px solid #F5F5F5"},children:[t.map((R,_)=>i.jsx(bt.default,{sortDirection:(s==null?void 0:s.column)===R.dataKey?s==null?void 0:s.direction:!1,sx:_<t.length-1?{borderRight:"1px solid #F5F5F5"}:void 0,children:R.onSort?i.jsx(Nh.default,{active:(s==null?void 0:s.column)===R.dataKey,direction:(s==null?void 0:s.column)===R.dataKey?s==null?void 0:s.direction:"asc",onClick:()=>{var O;return(O=R.onSort)==null?void 0:O.call(R,{column:R.dataKey,direction:(s==null?void 0:s.column)===R.dataKey&&(s==null?void 0:s.direction)==="asc"?"desc":"asc"})},children:i.jsx(B.Typography,{sx:{color:N,textTransform:"capitalize"},variant:"caption",children:R.label})}):i.jsx(B.Typography,{sx:{color:N,textTransform:"capitalize"},variant:"caption",children:R.label})},`${String(R.dataKey)}-header`)),y()&&i.jsx(bt.default,{children:i.jsx("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)"},children:x})})]})}),o&&i.jsx(Po.default,{sx:{"& td":{borderBottomColor:A}},children:i.jsx(dr.default,{children:i.jsx(bt.default,{colSpan:t.length+(y()?1:0),children:i.jsx(B.LinearProgress,{"aria-label":"Loading"})})})}),!o&&n.length===0&&i.jsx(Po.default,{sx:{"& td":{borderBottomColor:A}},children:i.jsx(dr.default,{children:i.jsx(bt.default,{colSpan:t.length+(y()?1:0),children:i.jsx(B.Typography,{sx:{textAlign:"center",color:N,my:5},children:w})})})}),!o&&n.length>0&&i.jsx(Po.default,{sx:{"& td":{borderBottomColor:A}},children:n.map(R=>i.jsxs(dr.default,{sx:{"&:hover, &:focus-within":{backgroundColor:A},"&:hover .favorite-button, &:focus-within .favorite-button":{backgroundColor:M},"&:hover .hover-icon, &:focus-within .hover-icon":{opacity:1},"&:focus-visible":{outline:`2px solid ${P}`,outlineOffset:"-2px"},cursor:R.id!==p?"pointer":"default"},tabIndex:R.id!==p?0:void 0,onClick:R.id!==p?j(R.id,"select"):void 0,onKeyDown:R.id!==p?_=>{_.target===_.currentTarget&&_.key==="Enter"&&(_.preventDefault(),j(R.id,"select")())}:void 0,children:[R.id===p?i.jsx(bt.default,{colSpan:t.length+(y(R.id)?0:1),children:h?h(R.id,wS(R),F,()=>b("")):null}):t.map((_,O)=>{var D,V;return i.jsx(bt.default,{children:i.jsx("div",{style:O===0?{display:"flex",alignItems:"center",gap:10}:void 0,children:O===0?i.jsxs(i.Fragment,{children:[!r&&i.jsx(B.IconButton,{disabled:!0,"aria-label":"favorite",className:"favorite-button",size:"small",sx:{borderRadius:"10px",backgroundColor:A},children:i.jsx(Hh.default,{fontSize:"inherit"})}),i.jsx(B.Typography,{sx:{fontWeight:700,color:"text.primary",fontSize:"0.875rem",cursor:"pointer","&:hover":{textDecoration:"underline"}},onClick:j(R.id,"select"),children:_.render?_.render(R):_.dataKey?String((D=R[_.dataKey])!=null?D:""):""})]}):i.jsx("div",{style:{fontWeight:400,color:N,fontSize:"0.75rem"},children:_.render?_.render(R):_.dataKey?String((V=R[_.dataKey])!=null?V:""):""})})},`${String(R.id)}-${String(_.dataKey)}`)}),y(R.id)&&i.jsxs(bt.default,{align:"right",children:[l&&i.jsx(B.Tooltip,{title:v,children:i.jsx(B.IconButton,{"aria-label":v,className:a?void 0:"hover-icon",size:"small",sx:a?void 0:{opacity:0},onClick:_=>{_.stopPropagation(),j(R.id,"configure")()},children:i.jsx(_h.default,{fontSize:"inherit"})})}),u&&i.jsx(B.Tooltip,{title:k,children:i.jsx(B.IconButton,{"aria-label":k,className:"hover-icon",size:"small",sx:{opacity:0},onClick:_=>{_.stopPropagation(),j(R.id,"edit")()},children:i.jsx(Dh.default,{fontSize:"inherit"})})})]})]},R.id))})]})})},yS=({children:e})=>i.jsx(B.Table,{sx:{"& .MuiTableHead-root":{background:"rgba(217, 217, 217, 0.10)","& .MuiTableCell-root":{border:"1px solid #F5F5F5",color:"text.secondary"}},"& .MuiTableCell-root":{whiteSpace:"nowrap"},"& .MuiTableBody-root":{"& .MuiTableRow-root":{"&.checked":{background:"#F5F5F5"},"&:hover":{background:"#F5F5F5",transition:"200ms","& .actionIcons":{opacity:"1"},"& .tableButton":{background:"#FFF"}}}}},children:e}),ol=()=>i.jsxs(B.SvgIcon,{fontSize:"small",children:[i.jsx("rect",{fill:"#fff",height:"20",width:"20",x:"2",y:"2"}),i.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",fill:"none",stroke:"#D9D9D9",strokeWidth:"2"}),i.jsx("path",{d:"M17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"})]}),vd=()=>i.jsxs(B.SvgIcon,{fontSize:"small",children:[i.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",fill:"none",stroke:"#D9D9D9",strokeWidth:"2"}),i.jsx("path",{d:"M7 11h10v2H7z"})]}),Sd=({allChecked:e,someChecked:t,onSelectAll:n})=>i.jsx(bt.default,{sx:{padding:"8px 12px",width:"1%"},children:i.jsx(B.Checkbox,{checked:e,checkedIcon:i.jsx(ol,{}),indeterminate:t&&!e,indeterminateIcon:i.jsx(vd,{}),size:"small",sx:{padding:"0","& .MuiSvgIcon-root":{fill:"#D9D9D9"},"&.Mui-checked .MuiSvgIcon-root, &.MuiCheckbox-indeterminate .MuiSvgIcon-root":{fill:"#364699"}},onChange:n,slotProps:{input:{"aria-label":"Select all rows",ref:r=>{r&&(r.indeterminate=t&&!e)}}}})}),kd=({sortDirection:e})=>i.jsxs("svg",{fill:"none",height:"16",viewBox:"0 0 13 16",width:"13",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M3.5 7L6.5 3L9.5 7H3.5Z",fill:"#333333",fillOpacity:e==="desc"?"0":"0.6"}),i.jsx("path",{d:"M3.5 9L6.5 13L9.5 9H3.5Z",fill:"#333333",fillOpacity:e==="asc"?"0":"0.6"})]});function vS({field:e,label:t,sx:n,value:r,setTableSearch:o,setTableSort:s,sortDirection:l,searchable:a=!0}){const[c,u]=se.useState(!1),d=a&&(c||!!r);return i.jsx(bt.default,{sx:{padding:"3px 2px 3px 6px",...n},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:i.jsxs(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"2px"},children:[a?i.jsx(B.TextField,{disabled:!d,placeholder:t,size:"small",slotProps:{input:{startAdornment:i.jsx(B.InputAdornment,{position:"start",children:i.jsx(zh.default,{sx:{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),transitionDelay:"100ms",opacity:d?1:0,fontSize:"1rem"}})}),endAdornment:i.jsx(B.InputAdornment,{position:"end",sx:{position:"absolute",top:"2px",right:"2px"},children:i.jsx(B.IconButton,{size:"small","aria-label":`Clear ${t} search`,sx:{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),opacity:r?1:0,pointerEvents:r?"auto":"none"},onClick:()=>o(h=>({...h,[e]:""})),children:i.jsx($h.default,{sx:{fontSize:"0.75rem"}})})}),autoComplete:"off"}},sx:{"& .MuiInputBase-root":{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),backgroundColor:d?"neutral.lightest":"transparent",borderRadius:"8px",color:d?"inherit":"text.secondary",fontSize:"0.75rem",height:"unset",paddingLeft:"6px",paddingRight:"4px"},"& .MuiInputBase-input":{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),cursor:d?"text":"default",position:"relative",left:d?"0":"-18px",padding:"4px 0"},"& .MuiInputBase-input::placeholder":{opacity:"1"},"& .MuiOutlinedInput-notchedOutline":{borderWidth:"1px !important",borderColor:d?"#D9D9D9 !important":"transparent !important"},"& .MuiInputAdornment-positionStart":{marginRight:"4px"}},value:r,onChange:h=>o(m=>({...m,[e]:h.target.value}))}):i.jsx(B.Box,{sx:{color:"text.secondary",fontSize:"0.75rem",lineHeight:1.2,paddingLeft:"6px",whiteSpace:"nowrap"},children:t}),i.jsx(B.IconButton,{size:"small","aria-label":`Sort by ${t}`,onClick:()=>s(h=>{if(!h)return{field:e,direction:"asc"};if(h.direction==="asc")return{field:e,direction:"desc"}}),children:i.jsx(kd,{sortDirection:l})})]})})}const Id=se.memo(vS),SS={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},kS=({shouldRenderCheckbox:e,shouldRenderAction:t,items:n,tableSearch:r,setTableSearch:o,tableSort:s,setTableSort:l,allChecked:a,someChecked:c,onSelectAll:u})=>i.jsx(B.TableHead,{children:i.jsxs(B.TableRow,{children:[e?i.jsx(Sd,{allChecked:a,someChecked:c,onSelectAll:u}):null,n.map(d=>{var h;return d.type==="tableCell"?i.jsx(bt.default,{children:i.jsx(B.Typography,{sx:{color:"text.secondary",fontSize:"0.75rem"},children:d.label})},d.id):d.type==="searchable"?i.jsx(Id,{field:d.field,label:d.label,setTableSearch:o,setTableSort:l,sortDirection:(s==null?void 0:s.field)===d.field?s==null?void 0:s.direction:void 0,value:(h=r[d.field])!=null?h:""},d.id):null}),t?i.jsx(bt.default,{children:i.jsx(B.Box,{component:"span",sx:SS,children:"Actions"})}):null]})}),Md=se.memo(({id:e,index:t,checked:n,onTableRowCheck:r,children:o,onClick:s,shouldRenderCheckbox:l})=>i.jsxs(dr.default,{className:n?"checked":"",sx:{cursor:s?"pointer":void 0},onClick:s,children:[l?i.jsx(bt.default,{sx:{padding:"13px 12px",borderBottom:"1px solid #F5F5F5"},children:i.jsx(B.Checkbox,{checked:n,checkedIcon:i.jsx(ol,{}),indeterminateIcon:i.jsx(Gh.default,{}),size:"small",sx:{padding:"0","& .MuiSvgIcon-root":{fill:"#D9D9D9"},"&.Mui-checked .MuiSvgIcon-root":{fill:"#364699"}},slotProps:{input:{"aria-label":`Select row ${t+1}`}},onClick:r?a=>{a.stopPropagation(),r(e,t,a)}:void 0})}):null,o]},e));Md.displayName="CustomTableRow";const IS=({label:e})=>i.jsx(bt.default,{sx:{padding:"7px 16px"},children:i.jsx(B.Typography,{sx:{fontSize:"0.75rem"},children:e})});function Ed(e,t,n){const r=u=>typeof u=="string"?u.toLowerCase():Array.isArray(u)&&u.every(d=>typeof d=="string")?u.join(" ").toLowerCase():"",o=(u,d)=>{if(!d)return!0;const h=d.toLowerCase();return typeof u=="string"?u.toLowerCase().includes(h):Array.isArray(u)&&u.every(m=>typeof m=="string")?u.some(m=>m.toLowerCase().includes(h)):!1},s=e.filter(u=>t?Object.entries(t).every(([d,h])=>o(u[d],h)):!0);if(!n)return s;const{field:l,direction:a}=n,c=a==="asc"?1:-1;return[...s].sort((u,d)=>{const h=u[l],m=d[l];if(typeof h=="number"&&typeof m=="number")return c*(h-m);const p=r(h),b=r(m);return p&&b?c*p.localeCompare(b):0})}const MS=e=>{const[t,n]=se.useState({}),[r,o]=se.useState(),[s,l]=se.useState(new Set),[a,c]=se.useState(null),u=Ed(e,t,r),d=u.map(w=>w.id).filter(Boolean),h=d.length>0&&d.every(w=>s.has(w)),m=d.some(w=>s.has(w));return{tableSearch:t,setTableSearch:n,tableSort:r,setTableSort:o,allChecked:h,someChecked:m,onSelectAll:()=>{u.every(w=>s.has(w.id))?l(new Set):l(new Set(u.map(w=>w.id)))},onTableRowCheck:(w,k,v)=>{if(v.shiftKey&&a!==null){const F=Math.min(a,k),j=Math.max(a,k),y=new Set(s);d.slice(F,j+1).forEach(A=>y.add(A)),l(y)}else{const F=new Set(s);F.has(w)?F.delete(w):F.add(w),l(F)}c(k)},filteredTableData:u,checkedIds:s,unselectAll:()=>l(new Set)}},Pd=g.default.forwardRef(({onClick:e,holdDuration:t=2e3,holdLabel:n="Hold to confirm...",children:r,disabled:o,...s},l)=>{const[a,c]=se.useState(!1),[u,d]=se.useState(!1),[h,m]=se.useState(0),p=se.useRef(null),b=se.useRef(null),x=se.useRef(0),w=se.useRef(!1),k=()=>{p.current&&(clearTimeout(p.current),p.current=null),b.current&&(clearInterval(b.current),b.current=null)},v=()=>{o||u||a||(k(),x.current=performance.now(),m(0),c(!0),b.current=setInterval(()=>{const j=performance.now()-x.current;m(Math.min(j/t*100,100))},16),p.current=setTimeout(()=>{k(),m(100),c(!1),d(!0),(async()=>{try{await e()}finally{d(!1),m(0)}})()},t))},F=()=>{a&&(k(),c(!1),m(0))};return se.useEffect(()=>()=>k(),[]),i.jsx(B.Box,{sx:{position:"relative"},children:i.jsx(B.Button,{ref:l,disabled:o||u,onPointerDown:v,onPointerUp:F,onPointerLeave:F,onPointerCancel:F,onKeyDown:j=>{j.key!==" "&&j.key!=="Enter"||w.current||(j.preventDefault(),w.current=!0,v())},onKeyUp:j=>{j.key!==" "&&j.key!=="Enter"||(w.current=!1,F())},onBlur:()=>{w.current=!1,F()},sx:{display:"flex",alignItems:"center",gap:1,width:"100%",touchAction:"none"},...s,children:a?i.jsxs(i.Fragment,{children:[i.jsx(B.CircularProgress,{size:18,sx:{color:"inherit","& .MuiCircularProgress-circleDeterminate":{transition:"none"}},thickness:7,value:h,variant:"determinate"}),i.jsx("span",{children:n})]}):r})})});Pd.displayName="HoldToConfirmButton";const ES=({menuItems:e,ariaLabel:t="Open menu"})=>{const[n,r]=se.useState(null),o=!!n,s=c=>{r(c.currentTarget)},l=()=>{r(null)},a=c=>{c(),l()};return i.jsxs(i.Fragment,{children:[i.jsx(B.IconButton,{"aria-haspopup":"true","aria-label":t,onClick:s,children:i.jsx(Bh.default,{})}),i.jsx(B.Menu,{anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:o,transformOrigin:{vertical:"top",horizontal:"right"},onClose:l,children:e.map((c,u)=>i.jsx(B.MenuItem,{onClick:()=>a(c.onClick),children:c.label},u))})]})},PS=({title:e,className:t,subtitle:n,"data-testid":r})=>i.jsxs("div",{children:[i.jsx("h1",{className:`text-primary text-lg font-bold uppercase ${t!=null?t:""}`,"data-testid":r,children:e}),n&&i.jsx("p",{className:"text-neutral text-sm",children:n})]}),cr=({type:e})=>{switch(e){case"error":return i.jsx(Uh.default,{sx:{color:"#5C0924"}});case"info":return i.jsx(Kh.default,{sx:{color:"#161E4A"}});case"success":return i.jsx(Wh.default,{sx:{color:"#00514B"}});case"warning":return i.jsx(Xh.default,{sx:{color:"#816E09"}});case"default":default:return null}},TS=e=>{const t=e.type==="error",n=se.useCallback(r=>{r&&t&&r.focus()},[t]);return i.jsx(ga.default,{ref:n,"aria-label":e.ariaLabel||"Close notification",sx:{position:"absolute",top:8,right:8,padding:"4px"},onClick:()=>e.closeToast(!0),children:i.jsx(qh.default,{sx:{fontSize:"1rem",color:"#555555"}})})},FS=e=>i.jsx(Kt.ToastContainer,{hideProgressBar:!0,newestOnTop:!0,"aria-label":"Toast",className:"whitespace-pre-wrap",closeButton:TS,position:"top-right",transition:Kt.Slide,...e}),ur="relative min-h-auto! text-sm border-l-[5px] rounded-none! p-2! pr-10!",jS={default:(e,t)=>Kt.toast(e,{ariaLabel:e,autoClose:3e3,className:ur,type:"default",icon:i.jsx(cr,{type:"default"}),...t}),error:(e,t)=>Kt.toast.error(e!=null?e:"There was an error! Please try again.",{ariaLabel:e!=null?e:"There was an error! Please try again",autoClose:15e3,className:`${ur} text-[#5C0924]! bg-[#FBEAEC]! border-[#5C0924]`,type:"error",icon:i.jsx(cr,{type:"error"}),...t}),info:(e,t)=>Kt.toast.info(e,{ariaLabel:e,autoClose:3500,className:`${ur} text-[#161E4A]! bg-[#E9ECF6]! border-[#161E4A]`,type:"info",icon:i.jsx(cr,{type:"info"}),...t}),ok:(e,t)=>Kt.toast.success(e!=null?e:"Success!",{ariaLabel:e!=null?e:"Success!",autoClose:2500,className:`${ur} text-[#00514B]! bg-[#EBF6F5]! border-[#00514B]`,type:"success",icon:i.jsx(cr,{type:"success"}),...t}),warning:(e,t)=>Kt.toast.warning(e,{ariaLabel:e,autoClose:3500,className:`${ur} text-[#816E09]! bg-[#FEFBE0]! border-[#816E09]!`,type:"warning",icon:i.jsx(cr,{type:"warning"}),...t}),dismiss:e=>Kt.toast.dismiss(e),isActive:e=>Kt.toast.isActive(e)},OS=ge.styled(({className:e,...t})=>i.jsx(ma.default,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${Jo.tooltipClasses.tooltip}`]:{backgroundColor:"#FFFFFF",color:e.palette.text.primary,border:"1px solid #D9D9D9",borderRadius:"8px",padding:"16px",fontSize:"0.875rem",fontWeight:400,boxShadow:"0 4px 4px 0 rgba(85, 85, 85, 0.10)",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px",maxWidth:"none"},[`& .${Jo.tooltipClasses.arrow}`]:{color:"#FFFFFF","&::before":{backgroundColor:"#FFFFFF",border:"1px solid #D9D9D9"}}})),RS=({icon:e,title:t,showOnlyOnOverflow:n=!1,children:r,...o})=>{const[s,l]=se.useState(!1),[a,c]=se.useState(null);se.useEffect(()=>{if(!n||!a)return;const m=()=>{l(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight)};m();const p=new ResizeObserver(m);return p.observe(a),()=>p.disconnect()},[n,a]);const u=e?i.jsxs(B.Box,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:[e,t]}):t,d=n&&se.isValidElement(r)?se.cloneElement(r,{ref:c}):r,h=n?!s:o.disableHoverListener;return i.jsx(OS,{...o,disableHoverListener:h,title:u,children:d})},LS={sm:{width:"1.5rem",height:"1.5rem",fontSize:"0.75rem"},md:{width:"2.5rem",height:"2.5rem",fontSize:"0.875rem"},lg:{width:"3.75rem",height:"3.75rem",fontSize:"1.5rem"},xl:{width:"7.5rem",height:"7.5rem",fontSize:"3rem"}},DS=({user:e,size:t="sm"})=>{var u,d,h,m;const n=ge.useTheme(),r=(d=(u=e==null?void 0:e.personalInfo.firstName)==null?void 0:u.charAt(0).toUpperCase())!=null?d:"",o=(m=(h=e==null?void 0:e.personalInfo.lastName)==null?void 0:h.charAt(0).toUpperCase())!=null?m:"",s=`${r}${o}`.trim()||" ",{width:l,height:a,fontSize:c}=LS[t];return i.jsx(B.Avatar,{sx:{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,width:l,height:a,fontSize:c,border:t==="sm"?`2px solid ${n.palette.neutral.lighter}`:void 0,[n.breakpoints.between("sm","md")]:{width:"33px !important",height:"33px !important"}},children:s})},HS=({messages:e})=>{const t=ge.useTheme();return e.length===0?null:i.jsx(B.Alert,{icon:i.jsx(Yh.default,{sx:{color:"#665312"}}),severity:"warning",sx:{display:"flex",backgroundColor:t.palette.warning.lightest,justifyContent:"center"},children:i.jsx(B.Typography,{sx:{fontFamily:"Lato",fontWeight:500,color:"#665312"},children:e.join(", ")})})},Td=24,Qi=-40,_S=0,Fd=e=>{if(e<=0)return 0;const t=20*Math.log10(e);return Math.min(1,Math.max(0,(t-Qi)/(_S-Qi)))},jd=(e,t,n=Td)=>e<=Math.floor(n*t),AS={default:{height:"18px",gap:"0.25rem",bar:{width:"0.625rem"},radius:"2px"},small:{height:"0.625rem",gap:"2px",bar:{width:"7px",boxSizing:"border-box"},radius:"1px"}},sl=({className:e,volume:t,label:n="Input Level",hideLabel:r=!1,barCount:o=Td,size:s="default"})=>{const l=ge.useTheme(),a=Array.from({length:o},(d,h)=>h+1),c=AS[s],u=Fd(t);return i.jsxs(B.Box,{className:e,sx:{width:"100%",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[!r&&i.jsx(B.Typography,{sx:{fontFamily:l.typography.fontFamily,fontWeight:l.typography.fontWeightBold},children:n}),i.jsx(B.Box,{...r&&{role:"img","aria-label":n},sx:{width:"100%",height:c.height,display:"flex",gap:c.gap},children:a.map(d=>i.jsx(B.Box,{sx:{...c.bar,height:"100%",borderRadius:c.radius,border:`0.5px solid ${l.palette.neutral.light}`,backgroundColor:jd(d,u,o)?l.palette["acuity-green"].main:l.customColors.white}},`audio-volume-bar-${d}`))})]})},ll=e=>{const[t,n]=se.useState(0);return se.useEffect(()=>{if(!e){n(0);return}let r;const o=new AudioContext,s=o.createMediaStreamSource(e),l=o.createAnalyser();l.fftSize=512,s.connect(l);const a=new Uint8Array(l.frequencyBinCount),c=()=>{let u=0;l.getByteTimeDomainData(a);for(let d=0;d<a.length;d++){const h=(a[d]-128)/128;u+=h*h}n(Math.sqrt(u/a.length)),r=requestAnimationFrame(c)};return c(),()=>{cancelAnimationFrame(r),l.disconnect(),s.disconnect(),o.close()}},[e]),t},VS=({stream:e,levelLabel:t})=>{const n=ll(e);return i.jsx(B.Box,{"data-testid":"recording-audio-level",sx:{width:"fit-content"},children:i.jsx(sl,{volume:n,label:t,hideLabel:!0,barCount:8,size:"small"})})},NS=({label:e="Recording",stream:t,levelLabel:n="Input Level",className:r})=>{const o=ge.useTheme();return i.jsxs(B.Box,{className:r,role:"alert",sx:{display:"inline-grid",gridTemplateColumns:"auto auto",alignItems:"center",columnGap:"0.5rem",rowGap:"0.25rem",padding:"0.5rem 0.75rem",backgroundColor:o.customColors.white,borderRadius:"9999px",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"},children:[i.jsx(B.Box,{"aria-hidden":!0,sx:{width:12,height:12,borderRadius:"50%",backgroundColor:o.palette.error.main,justifySelf:"center"}}),i.jsx(B.Typography,{sx:{fontSize:"0.875rem",fontWeight:500,lineHeight:"1.25rem",color:o.palette.neutral.darkest,margin:0},children:e}),i.jsx(Zh.default,{"aria-hidden":!0,sx:{color:o.palette.neutral.darkest,fontSize:14,justifySelf:"center"}}),i.jsx(VS,{stream:t,levelLabel:n})]})},$S={audio:{label:"Select your Microphone",okMessage:"Microphone is working perfectly!",errorMessage:"There is a problem with your microphone. Please select your input again to proceed with your test."},video:{label:"Select your Camera",okMessage:"Camera is working as intended",errorMessage:"There is a problem with your webcam, Please select your camera input again to proceed with your test. "}},Od=({className:e,disabled:t,error:n,hideLabel:r=!1,options:o=[],type:s,value:l="",onChange:a,showMessage:c=!0,pendingMessage:u,pendingTone:d="neutral",compact:h=!1,labels:m})=>{const p=ge.useTheme(),{label:b,okMessage:x,errorMessage:w}=m!=null?m:$S[s],k=se.useMemo(()=>({width:h?"329px":r?"485px":"100%",height:h?"49px":r?"54px":"auto",labelFontSize:h?"8px":"10px",valueFontSize:h?"12px":"16px",labelColor:h?p.palette.neutral.darkest:p.palette.neutral.main,valueColor:h?p.palette.neutral.darkest:p.palette.neutral.dark,borderRadius:h?"10px":"8px",gap:h?"0px":"4px"}),[h,r,p.palette.neutral]),v=se.useMemo(()=>r||h?{width:k.width,height:k.height,borderRadius:k.borderRadius,padding:"10px","& .MuiSelect-select":{padding:h?"19px 10px":"10px",display:"flex",flexDirection:"column",gap:"4px"}}:{},[r,h,k]),F=se.useCallback(M=>{a(M.target.value)},[a]),j=se.useCallback(M=>{const P=o.find(R=>R.deviceId===M);return!P||!r&&!h?(P==null?void 0:P.label)||"":i.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",gap:k.gap},children:[i.jsx(B.Typography,{component:"span",sx:{fontFamily:p.typography.fontFamily,fontSize:k.labelFontSize,fontWeight:600,lineHeight:"20px",color:k.labelColor},children:b}),i.jsx(B.Typography,{component:"span",sx:{fontFamily:p.typography.fontFamily,fontSize:k.valueFontSize,fontWeight:600,lineHeight:"20px",color:k.valueColor},children:P.label})]})},[o,r,h,k,p.typography,b]),y=!n&&!!l&&!!u,A=!n&&!!l&&!u,N=!!n;return i.jsxs(B.Box,{className:e,sx:{width:"100%",minWidth:"300px"},children:[!r&&i.jsx(B.Typography,{sx:{fontFamily:p.typography.fontFamily,fontWeight:p.typography.fontWeightBold,mb:"0.5rem"},children:b}),i.jsx(B.FormControl,{sx:{mb:"0.375rem"},fullWidth:!0,disabled:!o.length,children:i.jsx(B.Select,{SelectDisplayProps:{"aria-label":b},disabled:t,value:l,onChange:F,sx:v,renderValue:j,children:o.map(M=>i.jsx(B.MenuItem,{"aria-label":M.label,value:M.deviceId,children:M.label},M.deviceId))})}),c&&i.jsxs(B.Box,{"aria-live":"polite",sx:{minHeight:"20px",display:"flex",alignItems:"center",gap:"0.5rem"},children:[y&&d==="neutral"&&i.jsxs(i.Fragment,{children:[i.jsx(eg.default,{fontSize:"small",sx:{color:p.palette.neutral.dark}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette.neutral.dark},children:u})]}),y&&d==="error"&&i.jsxs(i.Fragment,{children:[i.jsx(ml.default,{fontSize:"small",sx:{color:p.palette["acuity-red"].main}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette["acuity-red"].main},children:u})]}),A&&i.jsxs(i.Fragment,{children:[i.jsx(Jh.default,{fontSize:"small",sx:{color:p.palette["acuity-green"].darkest}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette["acuity-green"].darkest},children:x})]}),N&&i.jsxs(i.Fragment,{children:[i.jsx(ml.default,{fontSize:"small",sx:{color:p.palette["acuity-red"].main}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette["acuity-red"].main},children:w})]})]})]})},Rd=.02,Ld=250,Dd=8e3,Hd=(e,t)=>{const[n,r]=se.useState(t?"listening":"idle"),o=se.useRef(0),s=e>=Rd,l=n==="detected";return se.useEffect(()=>{if(o.current=0,!t){r("idle");return}r("listening");const a=setTimeout(()=>{r(c=>c==="listening"?"silent":c)},Dd);return()=>clearTimeout(a)},[t]),se.useEffect(()=>{if(!t||!s||l)return;const a=Date.now(),c=setTimeout(()=>r("detected"),Math.max(0,Ld-o.current));return()=>{clearTimeout(c),o.current+=Date.now()-a}},[t,s,l]),n},_d={speakToTest:"Speak to check your microphone.",noSoundDetected:"No sound detected. Speak into your microphone or choose another device.",inputLevel:"Input Level"},zS=({stream:e})=>{const t=ge.useTheme(),n=se.useRef(null);return se.useEffect(()=>{n.current&&(n.current.srcObject=e!=null?e:null)},[e]),i.jsxs(B.Box,{sx:{position:"relative",width:"100%",aspectRatio:"16 / 9",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"12px",border:`1px solid ${t.palette.neutral.light}`,backgroundColor:t.palette.neutral.lighter,overflow:"hidden"},children:[i.jsx(Qh.default,{"aria-hidden":!0,sx:{fontSize:80,color:t.palette.neutral.dark}}),i.jsx(B.Box,{component:"video",ref:n,autoPlay:!0,muted:!0,playsInline:!0,disablePictureInPicture:!0,"aria-hidden":!0,sx:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)",display:e?"block":"none"}})]})},GS=({devices:e,labels:t,onStatusChange:n})=>{const r=ll(e.audioStream),o=Hd(r,e.audioStream);se.useEffect(()=>n==null?void 0:n(o),[o,n]);let s;return o==="silent"?s=t.noSoundDetected:o!=="detected"&&(s=t.speakToTest),i.jsxs(i.Fragment,{children:[i.jsx(Od,{type:"audio",disabled:e.audioPerm!=="granted"||!e.audioDevices.length,error:e.audioError,options:e.audioDevices,value:e.activeAudioId,onChange:e.onSelectAudio,pendingMessage:s,pendingTone:o==="silent"?"error":"neutral",labels:t.microphone}),i.jsx(sl,{volume:r,label:t.inputLevel})]})},BS=({devices:e,onMicStatusChange:t,labels:n,className:r})=>{const o=ge.useTheme(),s={..._d,...n};return i.jsxs(B.Box,{className:r,sx:{width:"100%",display:"flex",justifyContent:"center",flexWrap:{xs:"wrap",md:"nowrap"},gap:"3rem"},children:[i.jsx(B.Box,{sx:{width:"100%",maxWidth:"624px"},children:i.jsx(zS,{stream:e.videoStream})}),i.jsx(B.Box,{sx:{display:{xs:"none",md:"block"},borderLeft:`1px solid ${o.palette.neutral.lighter}`}}),i.jsxs(B.Box,{sx:{width:"100%",maxWidth:"330px",display:"flex",flexDirection:"column",gap:"2.5rem"},children:[i.jsx(Od,{type:"video",disabled:e.videoPerm!=="granted"||!e.videoDevices.length,error:e.videoError,options:e.videoDevices,value:e.activeVideoId,onChange:e.onSelectVideo,labels:s.camera}),i.jsx(GS,{devices:e,labels:s,onStatusChange:t})]})]})};function Ji(e){const t=Math.abs(e);return t<10?`0${t}`:t.toString()}function il(e){const t=Math.floor(Math.abs(e)/60)*Math.sign(e),n=Math.abs(e)%60;return`${e<0?"-":""}${Ji(t)}:${Ji(n)}`}const WS=({timeLeft:e,timerLabel:t,variant:n="info",showClockIcon:r=!0,accessibleLabel:o="Time Left : "})=>{const s=ge.useTheme(),l=il(e),a=n==="info",c=a?s.palette.primary.main:s.palette.warning.darkest,u=a?s.palette.primary.lightest:s.palette.warning.lightest;return i.jsxs(B.Stack,{role:"timer","aria-live":"polite","aria-label":t||o,direction:"row",sx:{color:c,padding:{xs:"0.5rem 0.75rem",sm:"0.75rem 1rem"},backgroundColor:u,justifyContent:"space-between",borderRadius:"1rem",minWidth:0,maxWidth:"100%",overflow:"hidden",flexShrink:1,...a?{}:{border:`1px solid ${c}`}},children:[i.jsxs(B.Stack,{direction:"row",spacing:"0.25rem",alignItems:"center",sx:{minWidth:0,overflow:"hidden",flexShrink:1},children:[r&&i.jsx(tg.default,{sx:{flexShrink:0}}),t&&i.jsx(B.Typography,{sx:{fontSize:{xs:"0.875rem",sm:"1rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t})]}),i.jsx(B.Typography,{sx:{fontWeight:"bold",ml:"0.5rem",fontSize:{xs:"0.875rem",sm:"1rem"},flexShrink:0,minWidth:"fit-content"},children:l})]})},Ad=B.styled(B.Box)(()=>({width:"100%",maxWidth:624,aspectRatio:"4/3",borderRadius:10,overflow:"hidden",position:"relative",height:"100%",maxHeight:368,marginBottom:"2.5rem",display:"flex",alignItems:"center",justifyContent:"center"})),qS=({imageUrl:e,altText:t="Preview Image"})=>e?i.jsx(Ad,{children:i.jsx("img",{src:e,alt:t,style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}})}):null,Vt="Lato, sans-serif",US=e=>{var t,n,r,o,s,l,a,c,u,d,h,m,p,b,x,w,k,v,F,j,y,A;return{h1:{fontFamily:(t=e.typography.fontFamily)!=null?t:Vt,fontWeight:(n=e.typography.fontWeightBold)!=null?n:700,fontSize:(r=e.typography["4xl"])!=null?r:"3rem",textAlign:"left",verticalAlign:"middle"},h2:{fontFamily:(o=e.typography.fontFamily)!=null?o:Vt,fontWeight:(s=e.typography.fontWeightMedium)!=null?s:600,fontSize:(l=e.typography["3xl"])!=null?l:"2.5rem",textAlign:"left",verticalAlign:"middle"},h3:{fontFamily:(a=e.typography.fontFamily)!=null?a:Vt,fontWeight:(c=e.typography.fontWeightRegular)!=null?c:400,fontSize:(u=e.typography["2xl"])!=null?u:"2rem",textAlign:"left",width:"100%",mt:"1rem"},h4:{fontFamily:(d=e.typography.fontFamily)!=null?d:Vt,fontWeight:(h=e.typography.fontWeightMedium)!=null?h:700,fontSize:(m=e.typography.base)!=null?m:"1rem",textAlign:"left",verticalAlign:"middle"},ul:{fontFamily:(p=e.typography.fontFamily)!=null?p:Vt,fontWeight:(b=e.typography.fontWeightRegular)!=null?b:400,listStyleType:"disc",pl:"1rem",textAlign:"left",width:"100%",pt:0},ol:{fontFamily:(x=e.typography.fontFamily)!=null?x:Vt,fontWeight:(w=e.typography.fontWeightRegular)!=null?w:400,listStyleType:"decimal",pl:"1rem",mt:"0.5rem",textAlign:"left",width:"100%"},p:{fontFamily:(k=e.typography.fontFamily)!=null?k:Vt,fontWeight:(v=e.typography.fontWeightRegular)!=null?v:400,mt:"0.25rem",textAlign:"left",wordBreak:"break-word",width:"100%"},a:{fontFamily:(F=e.typography.fontFamily)!=null?F:Vt,fontWeight:(j=e.typography.fontWeightRegular)!=null?j:400,color:e.palette.primary.main,textDecoration:"underline"},li:{fontFamily:(y=e.typography.fontFamily)!=null?y:Vt,fontWeight:(A=e.typography.fontWeightRegular)!=null?A:400,display:"list-item",p:0}}},tn=(e,t,n)=>{var o,s;const r=e.typography[t];return{fontSize:(o=r==null?void 0:r.fontSize)!=null?o:n.fontSize,lineHeight:(s=r==null?void 0:r.lineHeight)!=null?s:n.lineHeight}},al=e=>{var l,a,c,u;const t=(l=e.typography.fontFamily)!=null?l:Vt,n=(a=e.typography.fontWeightRegular)!=null?a:400,r=(c=e.typography.fontWeightMedium)!=null?c:600,o=(u=e.typography.fontWeightBold)!=null?u:700,s={fontFamily:t,letterSpacing:"normal",textAlign:"left",m:0};return{fontFamily:t,"& h1":{...s,...tn(e,"4xl",{fontSize:"2.25rem",lineHeight:"3rem"}),fontWeight:o},"& h2":{...s,...tn(e,"3xl",{fontSize:"1.625rem",lineHeight:"2.25rem"}),fontWeight:r},"& h3":{...s,...tn(e,"2xl",{fontSize:"1.4375rem",lineHeight:"2rem"}),fontWeight:n,mt:"1rem"},"& h4":{...s,...tn(e,"base",{fontSize:"1rem",lineHeight:"1.5rem"}),fontWeight:r},"& h5":{...s,...tn(e,"sm",{fontSize:"0.875rem",lineHeight:"1.25rem"}),fontWeight:o},"& h6":{...s,...tn(e,"sm",{fontSize:"0.875rem",lineHeight:"1.25rem"}),fontWeight:r},"& p":{fontFamily:t,...tn(e,"base",{fontSize:"1rem",lineHeight:"1.5rem"}),fontWeight:n,letterSpacing:"normal",textAlign:"left",wordBreak:"break-word",m:0,mt:"0.25rem"},"& ul, & ol":{fontFamily:t,...tn(e,"base",{fontSize:"1rem",lineHeight:"1.5rem"}),fontWeight:n,textAlign:"left",m:0,pl:"1rem",pr:0},"& ul":{listStyleType:"disc",pt:0,pb:"0.5rem"},"& ol":{listStyleType:"decimal",mt:"0.5rem",pt:"0.5rem",pb:"0.5rem"},"& li":{display:"list-item",m:0,p:0},"& li > p":{m:0},"& a":{color:e.palette.primary.main,textDecoration:"underline"},"& strong":{fontWeight:o},"& em":{fontStyle:"italic"}}},KS=B.styled(B.Box)(({theme:e})=>({width:"100%",borderRadius:"10px",overflow:"hidden",position:"relative",height:"100%",padding:"0.5rem",fontFamily:e.typography.fontFamily})),XS=({content:e=""})=>{const t=ge.useTheme(),n=se.useMemo(()=>al(t),[t]);return i.jsx(KS,{"data-testid":"content-text",sx:n,children:i.jsx(ng.default,{components:{a({children:r,href:o}){return i.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:r})}},children:e})})},tt={primary:{darkest:"#161E4A",dark:"#253170",main:"#364699",light:"#7779B8",lighter:"#B0B1D7",lightest:"#E9ECF6"},secondary:{darkest:"#15436E",dark:"#205C94",main:"#2C76BC",light:"#799DD1",lighter:"#B3C6E5",lightest:"#EAF1F9"},error:{darkest:"#720202",dark:"#A90508",main:"#E40A0A",light:"#F97054",lighter:"#FFB19E",lightest:"#FFECE8"},info:{darkest:"#0D556D",dark:"#157393",main:"#5A65E4",light:"#76B2CF",lighter:"#B2D3E3",lightest:"#EBF4F8"},warning:{darkest:"#816E09",dark:"#E0CA01",main:"#FCE833",light:"#FFEE7A",lighter:"#FFF5B1",lightest:"#FEFBE0"},success:{darkest:"#24590A",dark:"#387F14",main:"#4DA81F",light:"#89C368",lighter:"#BCDEA9",lightest:"#EEF8EB"},neutral:{darkest:"#333333",dark:"#555555",main:"#949494",light:"#B8B8B8",lighter:"#F5F5F5",lightest:"#FFFFFF"},"acuity-green":{darkest:"#00514B",dark:"#007A72",main:"#00A59B",light:"#70C0B8",lighter:"#B0DBD6",lightest:"#EBF6F5"},"acuity-red":{darkest:"#5C0924",dark:"#8A1339",main:"#BA1E50",light:"#D66D80",lighter:"#ECACB5",lightest:"#FBEAEC"},customColors:{black:"#000000",white:"#FFFFFF","light-gray":"#D9D9D9","medium-gray":"#767676","transparent-medium":"rgba(0, 0, 0, 0.25)","transparent-light":"rgba(0, 0, 0, 0.05)"}},ea=[1,2,3,4,5,6],Vd={toolbar:"Formatting",undo:"Undo",redo:"Redo",textStyle:"Text style",paragraph:"Paragraph",heading:e=>`Heading ${e}`,bold:"Bold",italic:"Italic",numberedList:"Numbered list",bulletedList:"Bulleted list"},YS=e=>i.jsx(B.SvgIcon,{viewBox:"0 0 24 25",...e,children:i.jsx("path",{d:"M7.404 18.5V17.5H14.658C15.6953 17.5 16.5787 17.1443 17.308 16.433C18.0387 15.7217 18.404 14.853 18.404 13.827C18.404 12.801 18.039 11.9357 17.309 11.231C16.5783 10.5257 15.6947 10.173 14.658 10.173H6.916L9.881 13.138L9.173 13.846L5 9.673L9.173 5.5L9.881 6.208L6.916 9.173H14.658C15.9667 9.173 17.085 9.62433 18.013 10.527C18.9397 11.4297 19.403 12.5297 19.403 13.827C19.403 15.1243 18.9397 16.2277 18.013 17.137C17.0863 18.0463 15.9677 18.5007 14.657 18.5H7.404Z"})}),ZS=e=>i.jsx(B.SvgIcon,{viewBox:"0 0 24 25",...e,children:i.jsx("path",{d:"M16.596 18.5V17.5H9.342C8.30467 17.5 7.42133 17.1443 6.692 16.433C5.96133 15.7217 5.596 14.853 5.596 13.827C5.596 12.801 5.961 11.9357 6.691 11.231C7.42167 10.5257 8.30533 10.173 9.342 10.173H17.084L14.119 13.138L14.827 13.846L19 9.673L14.827 5.5L14.119 6.208L17.084 9.173H9.342C8.03333 9.173 6.915 9.62433 5.987 10.527C5.06033 11.4297 4.597 12.5297 4.597 13.827C4.597 15.1243 5.06033 16.2277 5.987 17.137C6.91367 18.0463 8.03233 18.5007 9.343 18.5H16.596Z"})}),QS=ge.alpha(tt.neutral.darkest,.87),Tn=({Icon:e,label:t,onClick:n,disabled:r,pressed:o})=>i.jsx(B.Tooltip,{title:t,children:i.jsx("span",{children:i.jsx(B.IconButton,{"aria-label":t,"aria-pressed":o,disabled:r,size:"small",onClick:n,onMouseDown:s=>s.preventDefault(),sx:{borderRadius:"0.25rem",color:o?tt.customColors.white:tt.neutral.dark,backgroundColor:o?tt.primary.main:"transparent","&:hover":{color:tt.customColors.white,backgroundColor:tt.primary.main},"&.Mui-focusVisible":{outline:`2px solid ${tt.primary.main}`,outlineOffset:2}},children:i.jsx(e,{fontSize:"inherit"})})})}),Zo=()=>i.jsx(B.Divider,{flexItem:!0,orientation:"vertical",sx:{borderColor:tt.neutral.lighter,maxHeight:"30px",mt:"5px",mx:.5}}),JS=({id:e,label:t,value:n,onChange:r,"aria-describedby":o,height:s,disabled:l=!1,labels:a})=>{var k;const c=ge.useTheme(),u={...Vd,...a},d=`label_${e}`,h=se.useRef(n),m=se.useRef(r);se.useEffect(()=>{m.current=r},[r]);const p=Eo.useEditor({extensions:[ag.default.configure({strike:!1,underline:!1,code:!1,codeBlock:!1,horizontalRule:!1,link:{openOnClick:!1}}),oh.Markdown],content:n,contentType:"markdown",editable:!l,editorProps:{attributes:{id:e,role:"textbox","aria-multiline":"true","aria-labelledby":d,...o?{"aria-describedby":o}:{}}},onUpdate:({editor:v})=>{const F=v.getMarkdown();h.current=F,m.current(F)}});se.useEffect(()=>{!p||n===h.current||(h.current=n,p.commands.setContent(n,{contentType:"markdown",emitUpdate:!1}))},[p,n]),se.useEffect(()=>{p==null||p.setEditable(!l)},[p,l]);const b=Eo.useEditorState({editor:p,selector:({editor:v})=>{var F,j,y,A,N,M,P;return{canUndo:(F=v==null?void 0:v.can().undo())!=null?F:!1,canRedo:(j=v==null?void 0:v.can().redo())!=null?j:!1,isBold:(y=v==null?void 0:v.isActive("bold"))!=null?y:!1,isItalic:(A=v==null?void 0:v.isActive("italic"))!=null?A:!1,isOrderedList:(N=v==null?void 0:v.isActive("orderedList"))!=null?N:!1,isBulletList:(M=v==null?void 0:v.isActive("bulletList"))!=null?M:!1,headingLevel:(P=ea.find(R=>v==null?void 0:v.isActive("heading",{level:R})))!=null?P:0}}}),x=se.useMemo(()=>al(c),[c]),w=v=>()=>{l||v()};return i.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",minWidth:0},children:[i.jsx(B.Typography,{id:d,component:"label",onClick:()=>p==null?void 0:p.commands.focus(),sx:{fontFamily:c.typography.fontFamily,fontSize:"1rem",mb:1,width:"fit-content"},children:t}),i.jsxs(B.Box,{"data-testid":"markdown-editor-frame",sx:{display:"flex",flexDirection:"column",height:s},children:[i.jsxs(B.Box,{role:"toolbar","aria-label":u.toolbar,"aria-controls":e,sx:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"center",columnGap:.5,rowGap:.5,mb:"0.75rem"},children:[i.jsx(Tn,{Icon:YS,label:u.undo,disabled:l||!(b!=null&&b.canUndo),onClick:w(()=>p==null?void 0:p.chain().focus().undo().run())}),i.jsx(Tn,{Icon:ZS,label:u.redo,disabled:l||!(b!=null&&b.canRedo),onClick:w(()=>p==null?void 0:p.chain().focus().redo().run())}),i.jsx(Zo,{}),i.jsx(B.Tooltip,{title:u.textStyle,placement:"top",children:i.jsxs(B.Select,{variant:"standard",disableUnderline:!0,displayEmpty:!0,disabled:l,value:(k=b==null?void 0:b.headingLevel)!=null?k:0,inputProps:{"aria-label":u.textStyle},IconComponent:v=>i.jsx(ig.default,{...v,sx:{fontSize:"1rem"}}),onChange:v=>{const F=Number(v.target.value);F===0?p==null||p.chain().focus().setParagraph().run():p==null||p.chain().focus().setHeading({level:F}).run()},sx:{minWidth:"120px",fontFamily:c.typography.fontFamily,fontSize:"1rem",color:QS,fontWeight:b!=null&&b.headingLevel?700:400,backgroundColor:"transparent"},children:[i.jsx(B.MenuItem,{value:0,sx:{fontWeight:400},children:u.paragraph}),ea.map(v=>i.jsx(B.MenuItem,{value:v,sx:{fontWeight:700},children:u.heading(v)},v))]})}),i.jsx(Zo,{}),i.jsx(Tn,{Icon:rg.default,label:u.bold,disabled:l,pressed:b==null?void 0:b.isBold,onClick:w(()=>p==null?void 0:p.chain().focus().toggleBold().run())}),i.jsx(Tn,{Icon:og.default,label:u.italic,disabled:l,pressed:b==null?void 0:b.isItalic,onClick:w(()=>p==null?void 0:p.chain().focus().toggleItalic().run())}),i.jsx(Zo,{}),i.jsx(Tn,{Icon:lg.default,label:u.numberedList,disabled:l,pressed:b==null?void 0:b.isOrderedList,onClick:w(()=>p==null?void 0:p.chain().focus().toggleOrderedList().run())}),i.jsx(Tn,{Icon:sg.default,label:u.bulletedList,disabled:l,pressed:b==null?void 0:b.isBulletList,onClick:w(()=>p==null?void 0:p.chain().focus().toggleBulletList().run())})]}),i.jsx(B.Box,{"data-testid":"markdown-editor-scroll",onClick:()=>p==null?void 0:p.commands.focus(),sx:{flex:1,minHeight:s===void 0?"300px":0,overflowY:"auto",overflowWrap:"anywhere",border:`1px solid ${tt.customColors["light-gray"]}`,borderRadius:"0.375rem",px:"1.25rem",py:"0.75rem",cursor:l?"default":"text",backgroundColor:l?tt.neutral.lighter:void 0,"&:focus-within":{borderColor:tt.primary.main},"& .tiptap":{outline:"none",minHeight:"100%"},...x},children:i.jsx(Eo.EditorContent,{editor:p})})]})]})},e5=({label:e,onClick:t,ariaLabel:n})=>{const r=ge.useTheme();return i.jsx(B.Button,{onClick:t,"aria-label":n||e,startIcon:i.jsx(cg.default,{sx:{fontSize:24}}),"data-testid":"video-replay-button",sx:{backgroundColor:r.palette.neutral.lightest,minWidth:"200px",maxWidth:"min(80vw, 500px)",minHeight:"52px",borderRadius:4,padding:"14px 16px",gap:1,pointerEvents:"auto",transition:"transform 0.2s ease, box-shadow 0.2s ease",border:"none",color:r.palette.primary.main,fontWeight:700,fontSize:"1rem",textTransform:"none",whiteSpace:"normal",textAlign:"center",wordBreak:"break-word","&:hover":{backgroundColor:r.palette.neutral.lightest,boxShadow:`0 2px 8px ${r.palette.primary.light}`},"& .MuiButton-startIcon":{color:r.palette.primary.main,fontSize:24,flexShrink:0}},children:e})},t5=ge.styled(B.Button)(({theme:e,disabled:t})=>({whiteSpace:"nowrap",padding:"0.75rem 1rem",height:"48px",borderRadius:"16px",fontSize:e.typography.base.fontSize,fontWeight:e.typography.fontWeightBold,textTransform:"none",marginTop:"1rem","&&":{color:e.customColors.white},backgroundColor:t?e.palette.neutral.main:e.palette.primary.main,"&:hover":{backgroundColor:t?e.palette.neutral.light:e.palette.primary.dark},"&:focus":{boxShadow:`0 0 0 4px ${e.palette.primary.lighter}`},[e.breakpoints.down("sm")]:{whiteSpace:"normal",padding:"0.25rem 0.5rem"}})),n5=ge.styled(B.Button)(({theme:e,disabled:t})=>({whiteSpace:"nowrap",padding:"0.25rem 0.75rem",width:"145px",marginBottom:"1rem",marginTop:"1rem",borderRadius:"1.5rem",backgroundColor:t?e.palette.neutral.light:e.palette.error.dark,"&:hover":{backgroundColor:t?e.palette.neutral.light:e.palette.error.main},"&:focus":{boxShadow:`0 0 0 4px ${e.palette.error.lighter}`},display:"flex",alignItems:"center",justifyContent:"center","&&":{color:e.customColors.white},textTransform:"none",[e.breakpoints.down("sm")]:{whiteSpace:"normal",padding:"0.25rem 0.5rem",width:"100%"}})),r5=({children:e})=>{const t=ge.useTheme();return i.jsx(B.BottomNavigation,{sx:{backgroundColor:t.customColors.white,borderTop:1,borderColor:t.palette.neutral.light,height:"88px",minHeight:"88px",maxHeight:"88px",width:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",borderBottomLeftRadius:"1.5rem",borderBottomRightRadius:"1.5rem",overflow:"hidden",padding:0,flexShrink:0,position:"relative",zIndex:15},children:e})},cl={en:"en-CA",fr:"fr-CA"};function o5(e){const t=(e!=null?e:"").toLowerCase().split(/[-_]/)[0];return t in cl?t:"en"}const s5=1e4;function Nd(e,t){var o;const n=t.toLowerCase(),r=n.split("-")[0];return(o=e.find(s=>s.lang.toLowerCase().replace("_","-")===n))!=null?o:e.find(s=>s.lang.toLowerCase().startsWith(r))}function Qo(){return typeof window!="undefined"&&"speechSynthesis"in window&&typeof window.SpeechSynthesisUtterance=="function"}const l5=({text:e,language:t,playLabel:n="Text to speech",stopLabel:r="Stop reading aloud"})=>{const[o,s]=se.useState(!1),[l]=se.useState(Qo),a=se.useRef(null),c=se.useCallback(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]),u=se.useCallback(()=>{c(),Qo()&&window.speechSynthesis.cancel(),s(!1)},[c]);se.useEffect(()=>u,[u]),se.useEffect(()=>{u()},[e,u]);const d=se.useCallback(()=>{if(!Qo()||!e)return;window.speechSynthesis.cancel();const h=new SpeechSynthesisUtterance(e),m=cl[t];h.lang=m;const p=Nd(window.speechSynthesis.getVoices(),m);p&&(h.voice=p);const b=()=>{c(),s(!1)};h.onend=b,h.onerror=b,s(!0),window.speechSynthesis.speak(h),c(),a.current=setInterval(()=>{if(!window.speechSynthesis.speaking){c();return}window.speechSynthesis.pause(),window.speechSynthesis.resume()},s5)},[e,t,c]);return!l||!e?null:i.jsx(B.Button,{onClick:o?u:d,startIcon:o?i.jsx(ug.default,{}):i.jsx(dg.default,{}),variant:"outlined","aria-live":"polite",sx:{whiteSpace:"nowrap",flexShrink:0,borderRadius:"1rem",textTransform:"none"},children:o?r:n})},$d=pa.default.div`
|
|
90
|
+
`));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(s=>{bd(s,[...t,r],n)})},fs=e=>{if(!e)return{};const t={};return e.forEach(n=>{bd(n,[],t)}),t},hs=(e,t,n)=>{const r=c=>{var u;return(u=t[c])!=null?u:[]},o=[],s=Math.max(...e.map(c=>r(c).length)),l=(c,u,d)=>sn(r(c).slice(0,d+1),r(u).slice(0,d+1)),a=(c,u)=>!!(n!=null&&n.left&&n.left.includes(c)&&!n.left.includes(u)||n!=null&&n.right&&!n.right.includes(c)&&n.right.includes(u));for(let c=0;c<s;c+=1){const u=e.reduce((d,h)=>{var w;const m=(w=r(h)[c])!=null?w:null;if(d.length===0)return[{columnFields:[h],groupId:m}];const p=d[d.length-1],b=p.columnFields[p.columnFields.length-1];return p.groupId!==m||!l(b,h,c)||a(b,h)?[...d,{columnFields:[h],groupId:m}]:[...d.slice(0,d.length-1),{columnFields:[...p.columnFields,h],groupId:m}]},[]);o.push(u)}return o},Pv=["groupId","children"],rl=e=>{let t={};return e.forEach(n=>{if(pc(n))return;const{groupId:r,children:o}=n,s=me(n,Pv);if(!r)throw new Error("MUI X: An element of the columnGroupingModel does not have either `field` or `groupId`.");process.env.NODE_ENV!=="production"&&(o||console.warn(`MUI X: group groupId=${r} has no children.`));const l=C({},s,{groupId:r}),a=rl(o);if(a[r]!==void 0||t[r]!==void 0)throw new Error(`MUI X: The groupId ${r} is used multiple times in the columnGroupingModel.`);t=C({},t,a,{[r]:l})}),C({},t)},Tv=(e,t,n)=>{var u,d,h;if(!t.columnGroupingModel)return e;const r=Yt(n),o=Xn(n),s=rl((u=t.columnGroupingModel)!=null?u:[]),l=fs((d=t.columnGroupingModel)!=null?d:[]),a=hs(r,l,(h=n.current.state.pinnedColumns)!=null?h:{}),c=o.length===0?0:Math.max(...o.map(m=>{var p,b;return(b=(p=l[m])==null?void 0:p.length)!=null?b:0}));return C({},e,{columnGrouping:{lookup:s,unwrappedGroupingModel:l,headerStructure:a,maxDepth:c}})},Fv=(e,t)=>{const n=g.useCallback(a=>{var u;return(u=ou(e)[a])!=null?u:[]},[e]),r=g.useCallback(()=>su(e),[e]);Se(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const s=g.useCallback(()=>{var c;const a=fs((c=t.columnGroupingModel)!=null?c:[]);e.current.setState(u=>{var p,b,x;const d=(b=(p=u.columns)==null?void 0:p.orderedFields)!=null?b:[],h=(x=u.pinnedColumns)!=null?x:{},m=hs(d,a,h);return C({},u,{columnGrouping:C({},u.columnGrouping,{headerStructure:m})})})},[e,t.columnGroupingModel]),l=g.useCallback(a=>{var x,w,k;const c=(k=(w=(x=e.current).getPinnedColumns)==null?void 0:w.call(x))!=null?k:{},u=Yt(e),d=Xn(e),h=rl(a!=null?a:[]),m=fs(a!=null?a:[]),p=hs(u,m,c),b=d.length===0?0:Math.max(...d.map(v=>{var F,j;return(j=(F=m[v])==null?void 0:F.length)!=null?j:0}));e.current.setState(v=>C({},v,{columnGrouping:{lookup:h,unwrappedGroupingModel:m,headerStructure:p,maxDepth:b}}))},[e]);le(e,"columnIndexChange",s),le(e,"columnsChange",()=>{l(t.columnGroupingModel)}),le(e,"columnVisibilityModelChange",()=>{l(t.columnGroupingModel)}),g.useEffect(()=>{l(t.columnGroupingModel)},[l,t.columnGroupingModel])};function jv(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function qi(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){const r=e.changedTouches[n];if(r.identifier===t)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Ui(e,t,n,r){let o=e;return r==="Right"?o+=t-n.left:o+=n.right-t,o}function Ov(e,t,n){return n==="Left"?e-t.left:t.right-e}function Rv(e){return e==="Right"?"Left":"Right"}function Lv(e,t){const n=e.classList.contains(I["columnSeparator--sideRight"])?"Right":"Left";return t?Rv(n):n}function Ki(e){e.preventDefault(),e.stopImmediatePropagation()}function Dv(e){const t=g.useRef(void 0),n=()=>cu(e),r=te(e,n);return g.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=jv()}return t.current}}function Hv(e,t){if(e.length<4)return e;const n=e.slice();n.sort((a,c)=>a-c);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],s=o-r,l=s<5?5:s*t;return n.filter(a=>a>r-l&&a<o+l)}function _v(e,t,n){const r={},o=e.current.rootElementRef.current;return o.classList.add(I.autosizing),n.forEach(s=>{var b,x;const a=nx(e.current,s.field).map(w=>{var k;return(k=w.getBoundingClientRect().width)!=null?k:0}),c=t.includeOutliers?a:Hv(a,t.outliersFactor);if(t.includeHeaders){const w=tx(e.current,s.field);if(w){const k=w.querySelector(`.${I.columnHeaderTitle}`),v=w.querySelector(`.${I.columnHeaderTitleContainerContent}`),F=w.querySelector(`.${I.iconButtonContainer}`),j=w.querySelector(`.${I.menuIcon}`),y=k!=null?k:v,A=window.getComputedStyle(w,null),N=parseInt(A.paddingLeft,10)+parseInt(A.paddingRight,10),P=y.scrollWidth+1+N+((b=F==null?void 0:F.clientWidth)!=null?b:0)+((x=j==null?void 0:j.clientWidth)!=null?x:0);c.push(P)}}const u=s.minWidth!==-1/0&&s.minWidth!==void 0,d=s.maxWidth!==1/0&&s.maxWidth!==void 0,h=u?s.minWidth:0,m=d?s.maxWidth:1/0,p=c.length===0?0:Math.max(...c);r[s.field]=xt(p,h,m)}),o.classList.remove(I.autosizing),r}const Av=e=>C({},e,{columnResize:{resizingColumnField:""}});function Vv(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const Nv=(e,t)=>{const n=Gt.useRtl(),r=ct(e,"useGridColumnResize"),o=Bt.default(Vv).current,s=g.useRef(null),l=g.useRef(null),a=wn.default(),c=g.useRef(void 0),u=P=>{var E,T;r.debug(`Updating width to ${P} for col ${o.colDef.field}`);const R=o.columnHeaderElement.offsetWidth,_=P-R,O=P-o.initialColWidth;if(O>0){const L=o.initialTotalWidth+O;(T=(E=e.current.rootElementRef)==null?void 0:E.current)==null||T.style.setProperty("--DataGrid-rowWidth",`${L}px`)}o.colDef.computedWidth=P,o.colDef.width=P,o.colDef.flex=0,o.columnHeaderElement.style.width=`${P}px`;const D=o.headerFilterElement;D&&(D.style.width=`${P}px`),o.groupHeaderElements.forEach(L=>{const $=L;let G;$.getAttribute("aria-colspan")==="1"?G=`${P}px`:G=`${$.offsetWidth+_}px`,$.style.width=G}),o.cellElements.forEach(L=>{const $=L;let G;$.getAttribute("aria-colspan")==="1"?G=`${P}px`:G=`${$.offsetWidth+_}px`,$.style.setProperty("--width",G)});const V=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);V===rn.LEFT&&(Pn(o.fillerLeft,"width",_),o.leftPinnedCellsAfter.forEach(L=>{Pn(L,"left",_)}),o.leftPinnedHeadersAfter.forEach(L=>{Pn(L,"left",_)})),V===rn.RIGHT&&(Pn(o.fillerRight,"width",_),o.rightPinnedCellsBefore.forEach(L=>{Pn(L,"right",_)}),o.rightPinnedHeadersBefore.forEach(L=>{Pn(L,"right",_)}))},d=P=>{if(k(),o.previousMouseClickEvent){const R=o.previousMouseClickEvent,_=R.timeStamp,O=R.clientX,D=R.clientY;if(P.timeStamp-_<300&&P.clientX===O&&P.clientY===D){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,P);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const R=Nt(e.current.state);o.groupHeaderElements.forEach(_=>{const O=K0(_),D=_,E=`${O.reduce((T,L)=>R.columnVisibilityModel[L]!==!1?T+R.lookup[L].computedWidth:T,0)}px`;D.style.width=E})}a.start(0,()=>{e.current.publishEvent("columnResizeStop",null,P)})},h=(P,R,_)=>{var E;const O=e.current.rootElementRef.current;o.initialColWidth=P.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=P,o.columnHeaderElement=U0(e.current.columnHeadersContainerRef.current,P.field);const D=O.querySelector(`.${I.headerFilterRow} [data-field="${Jt(P.field)}"]`);D&&(o.headerFilterElement=D),o.groupHeaderElements=X0((E=e.current.columnHeadersContainerRef)==null?void 0:E.current,P.field),o.cellElements=Y0(o.columnHeaderElement,e.current),o.fillerLeft=Si(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=Si(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const V=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=V!==rn.LEFT?[]:Z0(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=V!==rn.RIGHT?[]:Q0(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=V!==rn.LEFT?[]:J0(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=V!==rn.RIGHT?[]:ex(e.current,o.columnHeaderElement,n),l.current=Lv(R,n),s.current=Ov(_,o.columnHeaderElement.getBoundingClientRect(),l.current)},m=re.unstable_useEventCallback(d),p=re.unstable_useEventCallback(P=>{if(P.buttons===0){m(P);return}let R=Ui(s.current,P.clientX,o.columnHeaderElement.getBoundingClientRect(),l.current);R=xt(R,o.colDef.minWidth,o.colDef.maxWidth),u(R);const _={element:o.columnHeaderElement,colDef:o.colDef,width:R};e.current.publishEvent("columnResize",_,P)}),b=re.unstable_useEventCallback(P=>{qi(P,c.current)&&d(P)}),x=re.unstable_useEventCallback(P=>{const R=qi(P,c.current);if(!R)return;if(P.type==="mousemove"&&P.buttons===0){b(P);return}let _=Ui(s.current,R.x,o.columnHeaderElement.getBoundingClientRect(),l.current);_=xt(_,o.colDef.minWidth,o.colDef.maxWidth),u(_);const O={element:o.columnHeaderElement,colDef:o.colDef,width:_};e.current.publishEvent("columnResize",O,P)}),w=re.unstable_useEventCallback(P=>{const R=no(P.target,I["columnSeparator--resizable"]);if(!R)return;const _=P.changedTouches[0];_!=null&&(c.current=_.identifier);const O=no(P.target,I.columnHeader),D=q0(O),V=e.current.getColumn(D);r.debug(`Start Resize on col ${V.field}`),e.current.publishEvent("columnResizeStart",{field:D},P),h(V,R,_.clientX);const E=re.unstable_ownerDocument(P.currentTarget);E.addEventListener("touchmove",x),E.addEventListener("touchend",b)}),k=g.useCallback(()=>{const P=re.unstable_ownerDocument(e.current.rootElementRef.current);P.body.style.removeProperty("cursor"),P.removeEventListener("mousemove",p),P.removeEventListener("mouseup",m),P.removeEventListener("touchmove",x),P.removeEventListener("touchend",b),setTimeout(()=>{P.removeEventListener("click",Ki,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,p,m,x,b]),v=g.useCallback(({field:P})=>{e.current.setState(R=>C({},R,{columnResize:C({},R.columnResize,{resizingColumnField:P})})),e.current.forceUpdate()},[e]),F=g.useCallback(()=>{e.current.setState(P=>C({},P,{columnResize:C({},P.columnResize,{resizingColumnField:""})})),e.current.forceUpdate()},[e]),j=re.unstable_useEventCallback(({colDef:P},R)=>{if(R.button!==0||!R.currentTarget.classList.contains(I["columnSeparator--resizable"]))return;R.preventDefault(),r.debug(`Start Resize on col ${P.field}`),e.current.publishEvent("columnResizeStart",{field:P.field},R),h(P,R.currentTarget,R.clientX);const _=re.unstable_ownerDocument(e.current.rootElementRef.current);_.body.style.cursor="col-resize",o.previousMouseClickEvent=R.nativeEvent,_.addEventListener("mousemove",p),_.addEventListener("mouseup",m),_.addEventListener("click",Ki,!0)}),y=re.unstable_useEventCallback((P,R)=>{if(t.disableAutosize||R.button!==0)return;const _=e.current.state.columns.lookup[P.field];_.resizable!==!1&&e.current.autosizeColumns(C({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[_.field]}))}),A=Dv(e),N=g.useRef(!1),M=g.useCallback(async P=>{var V,E;if(!((V=e.current.rootElementRef)==null?void 0:V.current)||N.current)return;N.current=!0;const _=Nt(e.current.state),O=C({},Gw,P,{columns:(E=P==null?void 0:P.columns)!=null?E:_.orderedFields});O.columns=O.columns.filter(T=>_.columnVisibilityModel[T]!==!1);const D=O.columns.map(T=>e.current.state.columns.lookup[T]);try{!t.disableVirtualization&&O.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await A());const T=_v(e,O,D),L=D.map($=>C({},$,{width:T[$.field],computedWidth:T[$.field],flex:0}));if(O.expand){const G=_.orderedFields.map(q=>_.lookup[q]).filter(q=>_.columnVisibilityModel[q.field]!==!1).reduce((q,U)=>{var Q,X;return q+((X=(Q=T[U.field])!=null?Q:U.computedWidth)!=null?X:U.width)},0),z=e.current.getRootDimensions().viewportInnerSize.width-G;if(z>0){const q=z/(L.length||1);L.forEach(U=>{U.width+=q,U.computedWidth+=q})}}e.current.updateColumns(L),L.forEach(($,G)=>{if($.width!==D[G].width){const S=$.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement($.field),colDef:$,width:S})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),N.current=!1}},[e,A,t.disableVirtualization]);g.useEffect(()=>k,[k]),fa.default(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),Gc(e,()=>{var P;return(P=e.current.columnHeadersContainerRef)==null?void 0:P.current},"touchstart",w,{passive:!0}),Se(e,{autosizeColumns:M},"public"),le(e,"columnResizeStop",F),le(e,"columnResizeStart",v),le(e,"columnSeparatorMouseDown",j),le(e,"columnSeparatorDoubleClick",y),Ae(e,"columnResize",t.onColumnResize),Ae(e,"columnWidthChange",t.onColumnWidthChange)};function Pn(e,t,n){e&&(e.style[t]=`${parseInt(e.style[t],10)+n}px`)}function $v(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex<t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?{firstRowIndex:e.firstRowIndex,lastRowIndex:t.firstRowIndex-1}:e}function Xi(e){return e.firstRowIndex!==0||e.lastRowIndex!==0}const Yo=(e,t,n)=>{var s;if(!e)return null;let r=e[t.field];const o=(s=t.rowSpanValueGetter)!=null?s:t.valueGetter;return o&&(r=o(r,e,t,n)),r},Hn={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},io={firstRowIndex:0,lastRowIndex:0},zv=new Set([yt,"__reorder__",mo]),Yi=20,Cd=(e,t,n,r,o,s,l)=>{const a=s?{}:C({},e.current.state.rowSpanning.spannedCells),c=s?{}:C({},e.current.state.rowSpanning.hiddenCells),u=s?{}:C({},e.current.state.rowSpanning.hiddenCellOriginMap);return s&&(l=io),t.forEach(d=>{var h;if(!zv.has(d.field)){for(let m=o.firstRowIndex;m<o.lastRowIndex;m+=1){const p=n[m];if((h=c[p.id])!=null&&h[d.field])continue;const b=Yo(p.model,d,e);if(b==null)continue;let x=p.id,w=m,k=0;const v=[];if(m===o.firstRowIndex){let j=m-1,y=n[j];for(;j>=r.firstRowIndex&&y&&Yo(y.model,d,e)===b;){const A=n[j+1];c[A.id]?c[A.id][d.field]=!0:c[A.id]={[d.field]:!0},v.push(m),k+=1,x=y.id,w=j,j-=1,y=n[j]}}v.forEach(j=>{u[j]?u[j][d.field]=w:u[j]={[d.field]:w}});let F=m+1;for(;F<=r.lastRowIndex&&n[F]&&Yo(n[F].model,d,e)===b;){const j=n[F];c[j.id]?c[j.id][d.field]=!0:c[j.id]={[d.field]:!0},u[F]?u[F][d.field]=w:u[F]={[d.field]:w},F+=1,k+=1}k>0&&(a[x]?a[x][d.field]=k+1:a[x]={[d.field]:k+1})}l={firstRowIndex:Math.min(l.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.lastRowIndex,o.lastRowIndex)}}}),{spannedCells:a,hiddenCells:c,hiddenCellOriginMap:u,processedRange:l}},wd=(e,t)=>{const n=fr(t).length;if(e.pagination){const r=Kc(t);let o=Yi;return r>0&&(o=r-1),{firstRowIndex:0,lastRowIndex:Math.min(o,n)}}return{firstRowIndex:0,lastRowIndex:Math.min(Yi,n)}},Gv=(e,t,n)=>{var b;if(!t.unstable_rowSpanning)return C({},e,{rowSpanning:Hn});const r=e.rows.dataRowIds||[],o=e.columns.orderedFields||[],s=e.rows.dataRowIdToModelLookup,l=e.columns.lookup,a=!!e.filter.filterModel.items.length||!!((b=e.filter.filterModel.quickFilterValues)!=null&&b.length);if(!r.length||!o.length||!s||!l||a)return C({},e,{rowSpanning:Hn});const c=wd(t,n),u=r.map(x=>({id:x,model:s[x]})),d=o.map(x=>l[x]),{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p}=Cd(n,d,u,c,c,!0,io);return C({},e,{rowSpanning:{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p}})},Bv=(e,t)=>{const n=Bt.default(()=>e.current.state.rowSpanning!==Hn?wd(t,e):io),r=g.useCallback((s,l=!1)=>{const{range:a,rows:c}=an(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(a===null||!Xi(s))return;l&&(n.current=io);const u=$v({firstRowIndex:s.firstRowIndex,lastRowIndex:Math.min(s.lastRowIndex,a.lastRowIndex+1)},n.current);if(u===null)return;const d=Ke(e),{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p,processedRange:b}=Cd(e,d,c,a,u,l,n.current);n.current=b;const x=Object.keys(h).length,w=Object.keys(m).length,k=Object.keys(e.current.state.rowSpanning.spannedCells).length,v=Object.keys(e.current.state.rowSpanning.hiddenCells).length;!(l||x!==k||w!==v)||x===0&&k===0||e.current.setState(y=>C({},y,{rowSpanning:{spannedCells:h,hiddenCells:m,hiddenCellOriginMap:p}}))},[e,n,t.pagination,t.paginationMode]),o=g.useCallback(()=>{const s=Fr(e);Xi(s)&&r(s,!0)},[e,r]);le(e,"renderedRowsIntervalChange",mn(t.unstable_rowSpanning,r)),le(e,"sortedRowsSet",mn(t.unstable_rowSpanning,o)),le(e,"paginationModelChange",mn(t.unstable_rowSpanning,o)),le(e,"filteredRowsSet",mn(t.unstable_rowSpanning,o)),le(e,"columnsChange",mn(t.unstable_rowSpanning,o)),g.useEffect(()=>{t.unstable_rowSpanning?e.current.state.rowSpanning===Hn&&o():e.current.state.rowSpanning!==Hn&&e.current.setState(s=>C({},s,{rowSpanning:Hn}))},[e,o,t.unstable_rowSpanning])},Wv=(e,t,n)=>C({},e,{listViewColumn:t.unstable_listColumn?C({},t.unstable_listColumn,{computedWidth:gs(n)}):void 0});function qv(e,t){const n=()=>{e.current.setState(s=>s.listViewColumn?C({},s,{listViewColumn:C({},s.listViewColumn,{computedWidth:gs(e)})}):s)},r=g.useRef(null);le(e,"viewportInnerSizeChange",s=>{r.current!==s.width&&(r.current=s.width,n())}),le(e,"columnVisibilityModelChange",n),ia.default(()=>{const s=t.unstable_listColumn;s&&e.current.setState(l=>C({},l,{listViewColumn:C({},s,{computedWidth:gs(e)})}))},[e,t.unstable_listColumn]),g.useEffect(()=>{t.unstable_listView&&!t.unstable_listColumn&&kt(["MUI X: The `unstable_listColumn` prop must be set if `unstable_listView` is enabled.",'To fix, pass a column definition to the `unstable_listColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.',"For more details, see https://mui.com/x/react-data-grid/list-view/"])},[t.unstable_listView,t.unstable_listColumn])}function gs(e){return at(e.current.state).viewportInnerSize.width}const Uv=(e,t)=>{const n=my(e,t);return fv(n,t),iv(n),lt(hy,n,t),lt(cv,n,t),lt(Sy,n,t),lt(nv,n,t),lt(By,n,t),lt(ev,n,t),lt(_y,n,t),lt(hv,n,t),lt(qy,n,t),lt(Ry,n,t),lt(Gv,n,t),lt(Iy,n,t),lt(Av,n,t),lt(yy,n,t),lt(Tv,n,t),lt(rw,n,t),lt(wv,n,t),lt(Sv,n,t),lt(Wv,n,t),$y(n,t),uv(n,t),ky(n,t),rv(n,t),Bv(n,t),av(n,t),Mv(n),Fv(n,t),tv(n,t),Ay(n,t),Uy(n,t),Hy(n,t),gv(n,t),My(n,t),Nv(n,t),Wy(n,t),kv(n,t),mv(n,t),vy(n),Py(n,t),Oy(n,t),xy(n,t),xv(n,t),pv(n,t),Iv(n),ow(n,t),qv(n,t),n},Kv=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:s,showRightBorder:l,groupId:a,pinnedPosition:c}=e,u={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",l&&"columnHeader--withRightBorder",s&&"columnHeader--withLeftBorder","withBorderColor",a===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",c===Ie.LEFT&&"columnHeader--pinnedLeft",c===Ie.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return re.unstable_composeClasses(u,Te,t)};function Xv(e){var $;const{groupId:t,width:n,depth:r,maxDepth:o,fields:s,height:l,colIndex:a,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:h,pinnedOffset:m}=e,p=ue(),b=Gt.useRtl(),x=g.useRef(null),w=ke(),k=te(w,su),v=t?k[t]:{},{headerName:F=t!=null?t:"",description:j="",headerAlign:y=void 0}=v;let A;const N=t&&(($=k[t])==null?void 0:$.renderHeaderGroup),M=g.useMemo(()=>({groupId:t,headerName:F,description:j,depth:r,maxDepth:o,fields:s,colIndex:a,isLastColumn:d}),[t,F,j,r,o,s,a,d]);t&&N&&(A=N(M));const P=C({},e,{classes:p.classes,headerAlign:y,depth:r,isDragging:!1}),R=F!=null?F:t,_=re.unstable_useId(),O=t===null?`empty-group-cell-${_}`:t,D=Kv(P);g.useLayoutEffect(()=>{if(c){const S=x.current.querySelector('[tabindex="0"]')||x.current;if(!S)return;if(Zs())S.focus({preventScroll:!0});else{const H=w.current.getScrollPosition();S.focus(),w.current.scroll(H)}}},[w,c]);const V=g.useCallback(G=>S=>{jr(S)||w.current.publishEvent(G,M,S)},[w,M]),E=g.useMemo(()=>({onKeyDown:V("columnGroupHeaderKeyDown"),onFocus:V("columnGroupHeaderFocus"),onBlur:V("columnGroupHeaderBlur")}),[V]),T=typeof v.headerClassName=="function"?v.headerClassName(M):v.headerClassName,L=g.useMemo(()=>vo(C({},e.style),b,h,m),[h,m,e.style,b]);return i.jsx(ju,C({ref:x,classes:D,columnMenuOpen:!1,colIndex:a,height:l,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:A,headerClassName:T,description:j,elementId:O,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:R,"aria-colspan":s.length,"data-fields":`|-${s.join("-|-")}-|`,style:L},E))}const Zi=ge.styled("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow",overridesResolver:(e,t)=>t.columnHeaderRow})({display:"flex"}),Yv=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:s,columnHeaderFocus:l,columnGroupHeaderFocus:a,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:h,hasOtherElementInTabSequence:m}=e,[p,b]=g.useState(""),[x,w]=g.useState(""),k=Et(),v=ue(),F=te(k,ou),j=te(k,dn),y=te(k,nw),A=te(k,Yn),N=te(k,Qt),M=fu(j,y,A.left.length),P=te(k,uo),R=te(k,ic),_=te(k,x1),O=te(k,y1),D=te(k,ac),V=g.useCallback(X=>w(X.field),[]),E=g.useCallback(()=>w(""),[]),T=g.useCallback(X=>b(X.field),[]),L=g.useCallback(()=>b(""),[]),$=g.useMemo(()=>A.left.length?{firstColumnIndex:0,lastColumnIndex:A.left.length}:null,[A.left.length]),G=g.useMemo(()=>A.right.length?{firstColumnIndex:t.length-A.right.length,lastColumnIndex:t.length}:null,[A.right.length,t.length]);le(k,"columnResizeStart",V),le(k,"columnResizeStop",E),le(k,"columnHeaderDragStart",T),le(k,"columnHeaderDragEnd",L);const S=X=>{const{renderContext:W=y}=X||{},K=W.firstColumnIndex,Y=W.lastColumnIndex;return{renderedColumns:t.slice(K,Y),firstColumnToRender:K,lastColumnToRender:Y}},H=(X,W,K,Y=!1)=>{const J=(X==null?void 0:X.position)===Ie.RIGHT,ne=(X==null?void 0:X.position)===void 0,Z=A.right.length>0&&J||A.right.length===0&&ne,oe=M-K;return i.jsxs(g.Fragment,{children:[ne&&i.jsx("div",{role:"presentation",style:{width:oe}}),W,ne&&i.jsx("div",{role:"presentation",className:Pe(I.filler,Y&&I["filler--borderBottom"])}),Z&&i.jsx(el,{header:!0,pinnedRight:J,borderBottom:Y,borderTop:!1})]})},z=(X,W={})=>{const{renderedColumns:K,firstColumnToRender:Y}=S(X),J=[];for(let ne=0;ne<K.length;ne+=1){const Z=K[ne],oe=Y+ne,ee=oe===0,ae=o!==null&&o.field===Z.field||ee&&!m?0:-1,fe=l!==null&&l.field===Z.field,xe=u.open&&u.field===Z.field,pe=X==null?void 0:X.position,Me=mr(pe,Z.computedWidth,oe,j,P,D),Re=pe===Ie.RIGHT?K[ne-1]:K[ne+1],Je=Re?l!==null&&l.field===Re.field:!1,De=oe+1===j.length-A.right.length,Oe=ne,Ye=K.length,qe=so(pe,Oe),we=oo(pe,Oe,Ye,v.showColumnVerticalBorder,R);J.push(i.jsx(fx,C({},n[Z.field],{columnMenuOpen:xe,filterItemsCounter:r[Z.field]&&r[Z.field].length,headerHeight:_,isDragging:Z.field===p,colDef:Z,colIndex:oe,isResizing:x===Z.field,isLast:oe===j.length-1,hasFocus:fe,tabIndex:ae,pinnedPosition:pe,pinnedOffset:Me,isLastUnpinned:De,isSiblingFocused:Je,showLeftBorder:qe,showRightBorder:we},W),Z.field))}return H(X,J,0)},q=()=>i.jsxs(Zi,{role:"row","aria-rowindex":c+1,ownerState:v,className:I["row--borderBottom"],children:[$&&z({position:Ie.LEFT,renderContext:$},{disableReorder:!0}),z({renderContext:y}),G&&z({position:Ie.RIGHT,renderContext:G},{disableReorder:!0,separatorSide:Qs.Left})]}),U=({depth:X,params:W})=>{var Ye,qe,we,He;const K=S(W);if(K.renderedColumns.length===0)return null;const{firstColumnToRender:Y,lastColumnToRender:J}=K,ne=h[X],Z=t[Y].field,oe=(qe=(Ye=F[Z])==null?void 0:Ye[X])!=null?qe:null,ee=ne.findIndex(({groupId:ve,columnFields:ce})=>ve===oe&&ce.includes(Z)),ae=t[J-1].field,fe=(He=(we=F[ae])==null?void 0:we[X])!=null?He:null,xe=ne.findIndex(({groupId:ve,columnFields:ce})=>ve===fe&&ce.includes(ae)),pe=ne.slice(ee,xe+1).map(ve=>C({},ve,{columnFields:ve.columnFields.filter(ce=>d[ce]!==!1)})).filter(ve=>ve.columnFields.length>0),Me=pe[0].columnFields.indexOf(Z),Je=pe[0].columnFields.slice(0,Me).reduce((ve,ce)=>{var Ce;const ye=N[ce];return ve+((Ce=ye.computedWidth)!=null?Ce:0)},0);let De=Y;const Oe=pe.map(({groupId:ve,columnFields:ce},ye)=>{const Ce=a!==null&&a.depth===X&&ce.includes(a.field),Ze=s!==null&&s.depth===X&&ce.includes(s.field)?0:-1,ot={width:ce.reduce((Dt,Ht)=>Dt+N[Ht].computedWidth,0),fields:ce,colIndex:De},Qe=W.position,Pt=mr(Qe,ot.width,De,j,P,D);De+=ce.length;let Tt=ye;return Qe===Ie.LEFT&&(Tt=De-1),i.jsx(Xv,{groupId:ve,width:ot.width,fields:ot.fields,colIndex:ot.colIndex,depth:X,isLastColumn:ye===pe.length-1,maxDepth:c,height:O,hasFocus:Ce,tabIndex:Ze,pinnedPosition:Qe,pinnedOffset:Pt,showLeftBorder:so(Qe,Tt),showRightBorder:oo(Qe,Tt,pe.length,v.showColumnVerticalBorder,R)},ye)});return H(W,Oe,Je)};return{renderContext:y,leftRenderContext:$,rightRenderContext:G,pinnedColumns:A,visibleColumns:t,columnPositions:j,getFillers:H,getColumnHeadersRow:q,getColumnsToRender:S,getColumnGroupHeadersRows:()=>{if(c===0)return null;const X=[];for(let W=0;W<c;W+=1)X.push(i.jsxs(Zi,{role:"row","aria-rowindex":W+1,ownerState:v,children:[$&&U({depth:W,params:{position:Ie.LEFT,renderContext:$,maxLastColumn:$.lastColumnIndex}}),U({depth:W,params:{renderContext:y}}),G&&U({depth:W,params:{position:Ie.RIGHT,renderContext:G,maxLastColumn:G.lastColumnIndex}})]},W));return X},getPinnedCellOffset:mr,isDragging:!!p,getInnerProps:()=>({role:"rowgroup"})}},Zv=["className"],Qv=e=>{const{classes:t}=e,n={root:["columnHeaders"]};return Xe.default(n,Te,t)},Jv=Ge.styled("div",{name:"MuiDataGrid",slot:"ColumnHeaders",overridesResolver:(e,t)=>t.columnHeaders})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),eS=je(function(t,n){const{className:r}=t,o=me(t,Zv),s=ue(),l=Qv(s);return i.jsx(Jv,C({className:Pe(l.root,r),ownerState:s},o,{role:"presentation",ref:n}))}),tS=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],xd=je(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:s,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:h,columnVisibility:m,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:b}=t,x=me(t,tS),{getInnerProps:w,getColumnHeadersRow:k,getColumnGroupHeadersRows:v}=Yv({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:s,columnHeaderTabIndexState:l,columnGroupHeaderTabIndexState:a,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:h,columnVisibility:m,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:b});return i.jsxs(eS,C({},x,w(),{ref:n,children:[v(),k()]}))});process.env.NODE_ENV!=="production"&&(xd.propTypes={columnGroupHeaderFocus:f.shape({depth:f.number.isRequired,field:f.string.isRequired}),columnGroupHeaderTabIndexState:f.shape({depth:f.number.isRequired,field:f.string.isRequired}),columnGroupsHeaderStructure:f.arrayOf(f.arrayOf(f.shape({columnFields:f.arrayOf(f.string).isRequired,groupId:f.string}))).isRequired,columnHeaderFocus:f.shape({field:f.string.isRequired}),columnHeaderTabIndexState:f.shape({field:f.string.isRequired}),columnMenuState:f.shape({field:f.string,open:f.bool.isRequired}).isRequired,columnVisibility:f.object.isRequired,filterColumnLookup:f.object.isRequired,hasOtherElementInTabSequence:f.bool.isRequired,headerGroupingMaxDepth:f.number.isRequired,sortColumnLookup:f.object.isRequired,visibleColumns:f.arrayOf(f.object).isRequired});const nS=Zt(xd);function rS(e){return null}function oS(e){return null}const sS=je(function(t,n){const o=ke().current.getLocaleText("noResultsOverlayLabel");return i.jsx(So,C({},t,{ref:n,children:o}))}),lS=["sortingOrder"],iS=g.memo(function(t){const{sortingOrder:n}=t,r=me(t,lS),o=ue(),[s]=n,l=s==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return l?i.jsx(l,C({},r)):null}),aS=["native"];function cS(e){let{native:t}=e,n=me(e,aS);return t?i.jsx("option",C({},n)):i.jsx(Xt.default,C({},n))}const uS={booleanCellTrueIcon:Ox,booleanCellFalseIcon:Wo,columnMenuIcon:Px,openFilterButtonIcon:yx,filterPanelDeleteIcon:Wo,columnFilteredIcon:Pi,columnSelectorIcon:Sx,columnUnsortedIcon:iS,columnSortedAscendingIcon:ki,columnSortedDescendingIcon:Ii,columnResizeIcon:kx,densityCompactIcon:Ix,densityStandardIcon:Mx,densityComfortableIcon:Ex,exportIcon:jx,moreActionsIcon:Rx,treeDataCollapseIcon:Ei,treeDataExpandIcon:Mi,groupingCriteriaCollapseIcon:Ei,groupingCriteriaExpandIcon:Mi,detailPanelExpandIcon:Ti,detailPanelCollapseIcon:Tx,rowReorderIcon:Fi,quickFilterIcon:vx,quickFilterClearIcon:Wo,columnMenuHideIcon:Lx,columnMenuSortAscendingIcon:ki,columnMenuSortDescendingIcon:Ii,columnMenuFilterIcon:Pi,columnMenuManageColumnsIcon:Dx,columnMenuClearIcon:Hx,loadIcon:Fx,filterPanelAddIcon:Ti,filterPanelRemoveAllIcon:_x,columnReorderIcon:Fi},dS=C({},uS,{baseBadge:xh.default,baseCheckbox:yh.default,baseDivider:vh.default,baseTextField:ha.default,baseFormControl:Sh.default,baseSelect:kh.default,baseButton:Ih.default,baseIconButton:ga.default,baseInputAdornment:Mh.default,baseTooltip:ma.default,basePopper:bs.default,baseInputLabel:Eh.default,baseSelectOption:cS,baseChip:Ph.default}),fS=C({},dS,{cell:u0,skeletonCell:p0,columnHeaderFilterIconButton:Du,columnHeaderSortIcon:wx,columnMenu:Uu,columnHeaders:nS,detailPanels:rS,footer:od,footerRowCount:ad,toolbar:null,pinnedRows:oS,loadingOverlay:sd,noResultsOverlay:sS,noRowsOverlay:ld,pagination:id,filterPanel:Qu,columnsPanel:Ku,columnsManagement:Ju,panel:Xu,row:K2}),hS={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",unstable_listView:!1},gS=fS,mS=e=>{const t=ge.useTheme(),n=n0(g.useMemo(()=>Ge.getThemeProps({props:e,theme:t,name:"MuiDataGrid"}),[t,e])),r=g.useMemo(()=>C({},S1,n.localeText),[n.localeText]),o=g.useMemo(()=>e0({defaultSlots:gS,slots:n.slots}),[n.slots]),s=g.useMemo(()=>Object.keys(ds).reduce((l,a)=>{var c;return l[a]=(c=n[a])!=null?c:ds[a],l},{}),[n]);return g.useMemo(()=>C({},n,s,{localeText:r,slots:o},hS),[n,r,o,s])},pS={hooks:{useGridAriaAttributes:X2,useGridRowAriaAttributes:Y2,useCellAggregationResult:()=>null}},yd=je(function(t,n){var s;const r=mS(t),o=Uv(r.apiRef,r);return process.env.NODE_ENV!=="production"&&o0(r,r0),i.jsx(Z2,{privateApiRef:o,configuration:pS,props:r,children:i.jsx(R0,C({className:r.className,style:r.style,sx:r.sx},r.forwardedProps,(s=r.slotProps)==null?void 0:s.root,{ref:n}))})}),bS=g.memo(yd);yd.propTypes={apiRef:f.shape({current:f.object.isRequired}),"aria-label":f.string,"aria-labelledby":f.string,autoHeight:f.bool,autoPageSize:f.bool,autosizeOnMount:f.bool,autosizeOptions:f.shape({columns:f.arrayOf(f.string),disableColumnVirtualization:f.bool,expand:f.bool,includeHeaders:f.bool,includeOutliers:f.bool,outliersFactor:f.number}),cellModesModel:f.object,checkboxSelection:f.bool,classes:f.object,clipboardCopyCellDelimiter:f.string,columnBufferPx:f.number,columnGroupHeaderHeight:f.number,columnGroupingModel:f.arrayOf(f.object),columnHeaderHeight:f.number,columns:f.arrayOf(f.object).isRequired,columnVisibilityModel:f.object,density:f.oneOf(["comfortable","compact","standard"]),disableAutosize:f.bool,disableColumnFilter:f.bool,disableColumnMenu:f.bool,disableColumnResize:f.bool,disableColumnSelector:f.bool,disableColumnSorting:f.bool,disableDensitySelector:f.bool,disableEval:f.bool,disableMultipleRowSelection:f.bool,disableRowSelectionOnClick:f.bool,disableVirtualization:f.bool,editMode:f.oneOf(["cell","row"]),estimatedRowCount:f.number,experimentalFeatures:f.shape({warnIfFocusStateIsNotSynced:f.bool}),filterDebounceMs:f.number,filterMode:f.oneOf(["client","server"]),filterModel:f.shape({items:f.arrayOf(f.shape({field:f.string.isRequired,id:f.oneOfType([f.number,f.string]),operator:f.string.isRequired,value:f.any})).isRequired,logicOperator:f.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:f.bool,quickFilterLogicOperator:f.oneOf(["and","or"]),quickFilterValues:f.array}),forwardedProps:f.object,getCellClassName:f.func,getDetailPanelContent:f.func,getEstimatedRowHeight:f.func,getRowClassName:f.func,getRowHeight:f.func,getRowId:f.func,getRowSpacing:f.func,hideFooter:f.bool,hideFooterPagination:f.bool,hideFooterSelectedRowCount:f.bool,ignoreDiacritics:f.bool,ignoreValueFormatterDuringExport:f.oneOfType([f.shape({clipboardExport:f.bool,csvExport:f.bool}),f.bool]),indeterminateCheckboxAction:f.oneOf(["deselect","select"]),initialState:f.object,isCellEditable:f.func,isRowSelectable:f.func,keepNonExistentRowsSelected:f.bool,loading:f.bool,localeText:f.object,logger:f.shape({debug:f.func.isRequired,error:f.func.isRequired,info:f.func.isRequired,warn:f.func.isRequired}),logLevel:f.oneOf(["debug","error","info","warn",!1]),nonce:f.string,onCellClick:f.func,onCellDoubleClick:f.func,onCellEditStart:f.func,onCellEditStop:f.func,onCellKeyDown:f.func,onCellModesModelChange:f.func,onClipboardCopy:f.func,onColumnHeaderClick:f.func,onColumnHeaderContextMenu:f.func,onColumnHeaderDoubleClick:f.func,onColumnHeaderEnter:f.func,onColumnHeaderLeave:f.func,onColumnHeaderOut:f.func,onColumnHeaderOver:f.func,onColumnOrderChange:f.func,onColumnResize:f.func,onColumnVisibilityModelChange:f.func,onColumnWidthChange:f.func,onDensityChange:f.func,onFilterModelChange:f.func,onMenuClose:f.func,onMenuOpen:f.func,onPaginationMetaChange:f.func,onPaginationModelChange:f.func,onPreferencePanelClose:f.func,onPreferencePanelOpen:f.func,onProcessRowUpdateError:f.func,onResize:f.func,onRowClick:f.func,onRowCountChange:f.func,onRowDoubleClick:f.func,onRowEditStart:f.func,onRowEditStop:f.func,onRowModesModelChange:f.func,onRowSelectionModelChange:f.func,onSortModelChange:f.func,onStateChange:f.func,pageSizeOptions:f.arrayOf(f.oneOfType([f.number,f.shape({label:f.string.isRequired,value:f.number.isRequired})]).isRequired),pagination:f.oneOf([!0]),paginationMeta:f.shape({hasNextPage:f.bool}),paginationMode:f.oneOf(["client","server"]),paginationModel:f.shape({page:f.number.isRequired,pageSize:f.number.isRequired}),processRowUpdate:f.func,resetPageOnSortFilter:f.bool,resizeThrottleMs:f.number,rowBufferPx:f.number,rowCount:f.number,rowHeight:f.number,rowModesModel:f.object,rowPositionsDebounceMs:f.number,rows:f.arrayOf(f.object),rowSelection:f.bool,rowSelectionModel:f.oneOfType([f.arrayOf(f.oneOfType([f.number,f.string]).isRequired),f.number,f.string]),rowSpacingType:f.oneOf(["border","margin"]),scrollbarSize:f.number,showCellVerticalBorder:f.bool,showColumnVerticalBorder:f.bool,slotProps:f.object,slots:f.object,sortingMode:f.oneOf(["client","server"]),sortingOrder:f.arrayOf(f.oneOf(["asc","desc"])),sortModel:f.arrayOf(f.shape({field:f.string.isRequired,sort:f.oneOf(["asc","desc"])})),sx:f.oneOfType([f.arrayOf(f.oneOfType([f.func,f.object,f.bool])),f.func,f.object]),unstable_rowSpanning:f.bool,virtualizeColumnsWithAutoRowHeight:f.bool};const CS=({sx:e,...t})=>{const n=ge.useTheme();return i.jsx(bS,{disableRowSelectionOnClick:!0,...t,sx:{border:`1px solid ${n.palette.neutral.lighter}`,borderRadius:"8px",fontFamily:n.typography.fontFamily,fontSize:"0.875rem",[`& .${I.columnHeader}`]:{backgroundColor:"rgba(217, 217, 217, 0.10)",color:n.palette.neutral.dark,fontSize:"0.75rem",fontWeight:600,"&:focus, &:focus-within":{outline:`2px solid ${n.palette.primary.main}`,outlineOffset:"-2px"}},[`& .${I.columnSeparator}`]:{color:n.palette.neutral.lighter},[`& .${I.row}`]:{"&:hover":{backgroundColor:n.palette.neutral.lighter},"&.Mui-selected":{backgroundColor:n.palette.neutral.lighter,"&:hover":{backgroundColor:n.palette.neutral.lighter}}},[`& .${I.cell}`]:{color:n.palette.text.primary,"&:focus, &:focus-within":{outline:`2px solid ${n.palette.primary.main}`,outlineOffset:"-2px"}},[`& .${I.footerContainer}`]:{borderTop:`1px solid ${n.palette.neutral.lighter}`},[`& .${I.overlay}`]:{color:n.palette.neutral.dark},...e}})},wS=e=>"name"in e&&typeof e.name=="string"?e.name:"",xS=({className:e,columns:t,data:n=[],hideStarIcon:r=!1,isLoading:o=!1,sort:s,onConfigure:l,alwaysShowConfigureIcon:a=!1,onDelete:c,onEdit:u,onSelectRow:d,renderInlineEdit:h,labels:m={}})=>{const[p,b]=se.useState(""),{actions:x="Actions",noRecords:w="There are no records.",edit:k="Edit",configure:v="Configure"}=m,F=R=>u?u(p,R).then(()=>b("")):Promise.resolve(),j=se.useCallback((R,_)=>()=>{switch(_){case"configure":l==null||l(R);break;case"delete":c==null||c(R);break;case"edit":b(R);break;case"select":d==null||d(R);break}},[l,c,d]),y=R=>!!(l||c||u)&&R!==p,A="#F5F5F5",N="#555555",M="#FFFFFF",P="#364699";return i.jsx(B.TableContainer,{className:e,children:i.jsxs(Ah.default,{sx:{minWidth:800,"& td, & th":{px:4.5,py:3}},children:[i.jsx(Vh.default,{sx:{background:"rgba(217, 217, 217, 0.10)"},children:i.jsxs(dr.default,{sx:{border:"1px solid #F5F5F5"},children:[t.map((R,_)=>i.jsx(bt.default,{sortDirection:(s==null?void 0:s.column)===R.dataKey?s==null?void 0:s.direction:!1,sx:_<t.length-1?{borderRight:"1px solid #F5F5F5"}:void 0,children:R.onSort?i.jsx(Nh.default,{active:(s==null?void 0:s.column)===R.dataKey,direction:(s==null?void 0:s.column)===R.dataKey?s==null?void 0:s.direction:"asc",onClick:()=>{var O;return(O=R.onSort)==null?void 0:O.call(R,{column:R.dataKey,direction:(s==null?void 0:s.column)===R.dataKey&&(s==null?void 0:s.direction)==="asc"?"desc":"asc"})},children:i.jsx(B.Typography,{sx:{color:N,textTransform:"capitalize"},variant:"caption",children:R.label})}):i.jsx(B.Typography,{sx:{color:N,textTransform:"capitalize"},variant:"caption",children:R.label})},`${String(R.dataKey)}-header`)),y()&&i.jsx(bt.default,{children:i.jsx("span",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0,0,0,0)"},children:x})})]})}),o&&i.jsx(Po.default,{sx:{"& td":{borderBottomColor:A}},children:i.jsx(dr.default,{children:i.jsx(bt.default,{colSpan:t.length+(y()?1:0),children:i.jsx(B.LinearProgress,{"aria-label":"Loading"})})})}),!o&&n.length===0&&i.jsx(Po.default,{sx:{"& td":{borderBottomColor:A}},children:i.jsx(dr.default,{children:i.jsx(bt.default,{colSpan:t.length+(y()?1:0),children:i.jsx(B.Typography,{sx:{textAlign:"center",color:N,my:5},children:w})})})}),!o&&n.length>0&&i.jsx(Po.default,{sx:{"& td":{borderBottomColor:A}},children:n.map(R=>i.jsxs(dr.default,{sx:{"&:hover, &:focus-within":{backgroundColor:A},"&:hover .favorite-button, &:focus-within .favorite-button":{backgroundColor:M},"&:hover .hover-icon, &:focus-within .hover-icon":{opacity:1},"&:focus-visible":{outline:`2px solid ${P}`,outlineOffset:"-2px"},cursor:R.id!==p?"pointer":"default"},tabIndex:R.id!==p?0:void 0,onClick:R.id!==p?j(R.id,"select"):void 0,onKeyDown:R.id!==p?_=>{_.target===_.currentTarget&&_.key==="Enter"&&(_.preventDefault(),j(R.id,"select")())}:void 0,children:[R.id===p?i.jsx(bt.default,{colSpan:t.length+(y(R.id)?0:1),children:h?h(R.id,wS(R),F,()=>b("")):null}):t.map((_,O)=>{var D,V;return i.jsx(bt.default,{children:i.jsx("div",{style:O===0?{display:"flex",alignItems:"center",gap:10}:void 0,children:O===0?i.jsxs(i.Fragment,{children:[!r&&i.jsx(B.IconButton,{disabled:!0,"aria-label":"favorite",className:"favorite-button",size:"small",sx:{borderRadius:"10px",backgroundColor:A},children:i.jsx(Hh.default,{fontSize:"inherit"})}),i.jsx(B.Typography,{sx:{fontWeight:700,color:"text.primary",fontSize:"0.875rem",cursor:"pointer","&:hover":{textDecoration:"underline"}},onClick:j(R.id,"select"),children:_.render?_.render(R):_.dataKey?String((D=R[_.dataKey])!=null?D:""):""})]}):i.jsx("div",{style:{fontWeight:400,color:N,fontSize:"0.75rem"},children:_.render?_.render(R):_.dataKey?String((V=R[_.dataKey])!=null?V:""):""})})},`${String(R.id)}-${String(_.dataKey)}`)}),y(R.id)&&i.jsxs(bt.default,{align:"right",children:[l&&i.jsx(B.Tooltip,{title:v,children:i.jsx(B.IconButton,{"aria-label":v,className:a?void 0:"hover-icon",size:"small",sx:a?void 0:{opacity:0},onClick:_=>{_.stopPropagation(),j(R.id,"configure")()},children:i.jsx(_h.default,{fontSize:"inherit"})})}),u&&i.jsx(B.Tooltip,{title:k,children:i.jsx(B.IconButton,{"aria-label":k,className:"hover-icon",size:"small",sx:{opacity:0},onClick:_=>{_.stopPropagation(),j(R.id,"edit")()},children:i.jsx(Dh.default,{fontSize:"inherit"})})})]})]},R.id))})]})})},yS=({children:e})=>i.jsx(B.Table,{sx:{"& .MuiTableHead-root":{background:"rgba(217, 217, 217, 0.10)","& .MuiTableCell-root":{border:"1px solid #F5F5F5",color:"text.secondary"}},"& .MuiTableCell-root":{whiteSpace:"nowrap"},"& .MuiTableBody-root":{"& .MuiTableRow-root":{"&.checked":{background:"#F5F5F5"},"&:hover":{background:"#F5F5F5",transition:"200ms","& .actionIcons":{opacity:"1"},"& .tableButton":{background:"#FFF"}}}}},children:e}),ol=()=>i.jsxs(B.SvgIcon,{fontSize:"small",children:[i.jsx("rect",{fill:"#fff",height:"20",width:"20",x:"2",y:"2"}),i.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",fill:"none",stroke:"#D9D9D9",strokeWidth:"2"}),i.jsx("path",{d:"M17.99 9l-1.41-1.42-6.59 6.59-2.58-2.57-1.42 1.41 4 3.99z"})]}),vd=()=>i.jsxs(B.SvgIcon,{fontSize:"small",children:[i.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z",fill:"none",stroke:"#D9D9D9",strokeWidth:"2"}),i.jsx("path",{d:"M7 11h10v2H7z"})]}),Sd=({allChecked:e,someChecked:t,onSelectAll:n})=>i.jsx(bt.default,{sx:{padding:"8px 12px",width:"1%"},children:i.jsx(B.Checkbox,{checked:e,checkedIcon:i.jsx(ol,{}),indeterminate:t&&!e,indeterminateIcon:i.jsx(vd,{}),size:"small",sx:{padding:"0","& .MuiSvgIcon-root":{fill:"#D9D9D9"},"&.Mui-checked .MuiSvgIcon-root, &.MuiCheckbox-indeterminate .MuiSvgIcon-root":{fill:"#364699"}},onChange:n,slotProps:{input:{"aria-label":"Select all rows",ref:r=>{r&&(r.indeterminate=t&&!e)}}}})}),kd=({sortDirection:e})=>i.jsxs("svg",{fill:"none",height:"16",viewBox:"0 0 13 16",width:"13",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M3.5 7L6.5 3L9.5 7H3.5Z",fill:"#333333",fillOpacity:e==="desc"?"0":"0.6"}),i.jsx("path",{d:"M3.5 9L6.5 13L9.5 9H3.5Z",fill:"#333333",fillOpacity:e==="asc"?"0":"0.6"})]});function vS({field:e,label:t,sx:n,value:r,setTableSearch:o,setTableSort:s,sortDirection:l,searchable:a=!0}){const[c,u]=se.useState(!1),d=a&&(c||!!r);return i.jsx(bt.default,{sx:{padding:"3px 2px 3px 6px",...n},onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:i.jsxs(B.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"2px"},children:[a?i.jsx(B.TextField,{disabled:!d,placeholder:t,size:"small",slotProps:{input:{startAdornment:i.jsx(B.InputAdornment,{position:"start",children:i.jsx(zh.default,{sx:{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),transitionDelay:"100ms",opacity:d?1:0,fontSize:"1rem"}})}),endAdornment:i.jsx(B.InputAdornment,{position:"end",sx:{position:"absolute",top:"2px",right:"2px"},children:i.jsx(B.IconButton,{size:"small","aria-label":`Clear ${t} search`,sx:{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),opacity:r?1:0,pointerEvents:r?"auto":"none"},onClick:()=>o(h=>({...h,[e]:""})),children:i.jsx($h.default,{sx:{fontSize:"0.75rem"}})})}),autoComplete:"off"}},sx:{"& .MuiInputBase-root":{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),backgroundColor:d?"neutral.lightest":"transparent",borderRadius:"8px",color:d?"inherit":"text.secondary",fontSize:"0.75rem",height:"unset",paddingLeft:"6px",paddingRight:"4px"},"& .MuiInputBase-input":{transition:h=>h.transitions.create("all",{duration:h.transitions.duration.standard}),cursor:d?"text":"default",position:"relative",left:d?"0":"-18px",padding:"4px 0"},"& .MuiInputBase-input::placeholder":{opacity:"1"},"& .MuiOutlinedInput-notchedOutline":{borderWidth:"1px !important",borderColor:d?"#D9D9D9 !important":"transparent !important"},"& .MuiInputAdornment-positionStart":{marginRight:"4px"}},value:r,onChange:h=>o(m=>({...m,[e]:h.target.value}))}):i.jsx(B.Box,{sx:{color:"text.secondary",fontSize:"0.75rem",lineHeight:1.2,paddingLeft:"6px",whiteSpace:"nowrap"},children:t}),i.jsx(B.IconButton,{size:"small","aria-label":`Sort by ${t}`,onClick:()=>s(h=>{if(!h)return{field:e,direction:"asc"};if(h.direction==="asc")return{field:e,direction:"desc"}}),children:i.jsx(kd,{sortDirection:l})})]})})}const Id=se.memo(vS),SS={position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0},kS=({shouldRenderCheckbox:e,shouldRenderAction:t,items:n,tableSearch:r,setTableSearch:o,tableSort:s,setTableSort:l,allChecked:a,someChecked:c,onSelectAll:u})=>i.jsx(B.TableHead,{children:i.jsxs(B.TableRow,{children:[e?i.jsx(Sd,{allChecked:a,someChecked:c,onSelectAll:u}):null,n.map(d=>{var h;return d.type==="tableCell"?i.jsx(bt.default,{children:i.jsx(B.Typography,{sx:{color:"text.secondary",fontSize:"0.75rem"},children:d.label})},d.id):d.type==="searchable"?i.jsx(Id,{field:d.field,label:d.label,setTableSearch:o,setTableSort:l,sortDirection:(s==null?void 0:s.field)===d.field?s==null?void 0:s.direction:void 0,value:(h=r[d.field])!=null?h:""},d.id):null}),t?i.jsx(bt.default,{children:i.jsx(B.Box,{component:"span",sx:SS,children:"Actions"})}):null]})}),Md=se.memo(({id:e,index:t,checked:n,onTableRowCheck:r,children:o,onClick:s,shouldRenderCheckbox:l})=>i.jsxs(dr.default,{className:n?"checked":"",sx:{cursor:s?"pointer":void 0},onClick:s,children:[l?i.jsx(bt.default,{sx:{padding:"13px 12px",borderBottom:"1px solid #F5F5F5"},children:i.jsx(B.Checkbox,{checked:n,checkedIcon:i.jsx(ol,{}),indeterminateIcon:i.jsx(Gh.default,{}),size:"small",sx:{padding:"0","& .MuiSvgIcon-root":{fill:"#D9D9D9"},"&.Mui-checked .MuiSvgIcon-root":{fill:"#364699"}},slotProps:{input:{"aria-label":`Select row ${t+1}`}},onClick:r?a=>{a.stopPropagation(),r(e,t,a)}:void 0})}):null,o]},e));Md.displayName="CustomTableRow";const IS=({label:e})=>i.jsx(bt.default,{sx:{padding:"7px 16px"},children:i.jsx(B.Typography,{sx:{fontSize:"0.75rem"},children:e})});function Ed(e,t,n){const r=u=>typeof u=="string"?u.toLowerCase():Array.isArray(u)&&u.every(d=>typeof d=="string")?u.join(" ").toLowerCase():"",o=(u,d)=>{if(!d)return!0;const h=d.toLowerCase();return typeof u=="string"?u.toLowerCase().includes(h):Array.isArray(u)&&u.every(m=>typeof m=="string")?u.some(m=>m.toLowerCase().includes(h)):!1},s=e.filter(u=>t?Object.entries(t).every(([d,h])=>o(u[d],h)):!0);if(!n)return s;const{field:l,direction:a}=n,c=a==="asc"?1:-1;return[...s].sort((u,d)=>{const h=u[l],m=d[l];if(typeof h=="number"&&typeof m=="number")return c*(h-m);const p=r(h),b=r(m);return p&&b?c*p.localeCompare(b):0})}const MS=e=>{const[t,n]=se.useState({}),[r,o]=se.useState(),[s,l]=se.useState(new Set),[a,c]=se.useState(null),u=Ed(e,t,r),d=u.map(w=>w.id).filter(Boolean),h=d.length>0&&d.every(w=>s.has(w)),m=d.some(w=>s.has(w));return{tableSearch:t,setTableSearch:n,tableSort:r,setTableSort:o,allChecked:h,someChecked:m,onSelectAll:()=>{u.every(w=>s.has(w.id))?l(new Set):l(new Set(u.map(w=>w.id)))},onTableRowCheck:(w,k,v)=>{if(v.shiftKey&&a!==null){const F=Math.min(a,k),j=Math.max(a,k),y=new Set(s);d.slice(F,j+1).forEach(A=>y.add(A)),l(y)}else{const F=new Set(s);F.has(w)?F.delete(w):F.add(w),l(F)}c(k)},filteredTableData:u,checkedIds:s,unselectAll:()=>l(new Set)}},Pd=g.default.forwardRef(({onClick:e,holdDuration:t=2e3,holdLabel:n="Hold to confirm...",children:r,disabled:o,...s},l)=>{const[a,c]=se.useState(!1),[u,d]=se.useState(!1),[h,m]=se.useState(0),p=se.useRef(null),b=se.useRef(null),x=se.useRef(0),w=se.useRef(!1),k=()=>{p.current&&(clearTimeout(p.current),p.current=null),b.current&&(clearInterval(b.current),b.current=null)},v=()=>{o||u||a||(k(),x.current=performance.now(),m(0),c(!0),b.current=setInterval(()=>{const j=performance.now()-x.current;m(Math.min(j/t*100,100))},16),p.current=setTimeout(()=>{k(),m(100),c(!1),d(!0),(async()=>{try{await e()}finally{d(!1),m(0)}})()},t))},F=()=>{a&&(k(),c(!1),m(0))};return se.useEffect(()=>()=>k(),[]),i.jsx(B.Box,{sx:{position:"relative"},children:i.jsx(B.Button,{ref:l,disabled:o||u,onPointerDown:v,onPointerUp:F,onPointerLeave:F,onPointerCancel:F,onKeyDown:j=>{j.key!==" "&&j.key!=="Enter"||w.current||(j.preventDefault(),w.current=!0,v())},onKeyUp:j=>{j.key!==" "&&j.key!=="Enter"||(w.current=!1,F())},onBlur:()=>{w.current=!1,F()},sx:{display:"flex",alignItems:"center",gap:1,width:"100%",touchAction:"none"},...s,children:a?i.jsxs(i.Fragment,{children:[i.jsx(B.CircularProgress,{size:18,sx:{color:"inherit","& .MuiCircularProgress-circleDeterminate":{transition:"none"}},thickness:7,value:h,variant:"determinate"}),i.jsx("span",{children:n})]}):r})})});Pd.displayName="HoldToConfirmButton";const ES=({menuItems:e,ariaLabel:t="Open menu"})=>{const[n,r]=se.useState(null),o=!!n,s=se.useId(),l=`${s}-trigger`,a=`${s}-menu`,c=h=>{r(h.currentTarget)},u=()=>{r(null)},d=h=>{h(),u()};return i.jsxs(i.Fragment,{children:[i.jsx(B.IconButton,{"aria-controls":o?a:void 0,"aria-expanded":o,"aria-haspopup":"true","aria-label":t,id:l,onClick:c,children:i.jsx(Bh.default,{})}),i.jsx(B.Menu,{anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:o,slotProps:{list:{id:a,"aria-labelledby":l}},transformOrigin:{vertical:"top",horizontal:"right"},onClose:u,children:e.map((h,m)=>i.jsx(B.MenuItem,{onClick:()=>d(h.onClick),children:h.label},m))})]})},PS=({title:e,className:t,subtitle:n,"data-testid":r})=>i.jsxs("div",{children:[i.jsx("h1",{className:`text-primary text-lg font-bold uppercase ${t!=null?t:""}`,"data-testid":r,children:e}),n&&i.jsx("p",{className:"text-neutral text-sm",children:n})]}),cr=({type:e})=>{switch(e){case"error":return i.jsx(Uh.default,{sx:{color:"#5C0924"}});case"info":return i.jsx(Kh.default,{sx:{color:"#161E4A"}});case"success":return i.jsx(Wh.default,{sx:{color:"#00514B"}});case"warning":return i.jsx(Xh.default,{sx:{color:"#816E09"}});case"default":default:return null}},TS=e=>{const t=e.type==="error",n=se.useCallback(r=>{r&&t&&r.focus()},[t]);return i.jsx(ga.default,{ref:n,"aria-label":e.ariaLabel||"Close notification",sx:{position:"absolute",top:8,right:8,padding:"4px"},onClick:()=>e.closeToast(!0),children:i.jsx(qh.default,{sx:{fontSize:"1rem",color:"#555555"}})})},FS=e=>i.jsx(Kt.ToastContainer,{hideProgressBar:!0,newestOnTop:!0,"aria-label":"Toast",className:"whitespace-pre-wrap",closeButton:TS,position:"top-right",transition:Kt.Slide,...e}),ur="relative min-h-auto! text-sm border-l-[5px] rounded-none! p-2! pr-10!",jS={default:(e,t)=>Kt.toast(e,{ariaLabel:e,autoClose:3e3,className:ur,type:"default",icon:i.jsx(cr,{type:"default"}),...t}),error:(e,t)=>Kt.toast.error(e!=null?e:"There was an error! Please try again.",{ariaLabel:e!=null?e:"There was an error! Please try again",autoClose:15e3,className:`${ur} text-[#5C0924]! bg-[#FBEAEC]! border-[#5C0924]`,type:"error",icon:i.jsx(cr,{type:"error"}),...t}),info:(e,t)=>Kt.toast.info(e,{ariaLabel:e,autoClose:3500,className:`${ur} text-[#161E4A]! bg-[#E9ECF6]! border-[#161E4A]`,type:"info",icon:i.jsx(cr,{type:"info"}),...t}),ok:(e,t)=>Kt.toast.success(e!=null?e:"Success!",{ariaLabel:e!=null?e:"Success!",autoClose:2500,className:`${ur} text-[#00514B]! bg-[#EBF6F5]! border-[#00514B]`,type:"success",icon:i.jsx(cr,{type:"success"}),...t}),warning:(e,t)=>Kt.toast.warning(e,{ariaLabel:e,autoClose:3500,className:`${ur} text-[#816E09]! bg-[#FEFBE0]! border-[#816E09]!`,type:"warning",icon:i.jsx(cr,{type:"warning"}),...t}),dismiss:e=>Kt.toast.dismiss(e),isActive:e=>Kt.toast.isActive(e)},OS=ge.styled(({className:e,...t})=>i.jsx(ma.default,{...t,classes:{popper:e}}))(({theme:e})=>({[`& .${Jo.tooltipClasses.tooltip}`]:{backgroundColor:"#FFFFFF",color:e.palette.text.primary,border:"1px solid #D9D9D9",borderRadius:"8px",padding:"16px",fontSize:"0.875rem",fontWeight:400,boxShadow:"0 4px 4px 0 rgba(85, 85, 85, 0.10)",display:"flex",justifyContent:"center",alignItems:"center",gap:"10px",maxWidth:"none"},[`& .${Jo.tooltipClasses.arrow}`]:{color:"#FFFFFF","&::before":{backgroundColor:"#FFFFFF",border:"1px solid #D9D9D9"}}})),RS=({icon:e,title:t,showOnlyOnOverflow:n=!1,children:r,...o})=>{const[s,l]=se.useState(!1),[a,c]=se.useState(null);se.useEffect(()=>{if(!n||!a)return;const m=()=>{l(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight)};m();const p=new ResizeObserver(m);return p.observe(a),()=>p.disconnect()},[n,a]);const u=e?i.jsxs(B.Box,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:[e,t]}):t,d=n&&se.isValidElement(r)?se.cloneElement(r,{ref:c}):r,h=n?!s:o.disableHoverListener;return i.jsx(OS,{...o,disableHoverListener:h,title:u,children:d})},LS={sm:{width:"1.5rem",height:"1.5rem",fontSize:"0.75rem"},md:{width:"2.5rem",height:"2.5rem",fontSize:"0.875rem"},lg:{width:"3.75rem",height:"3.75rem",fontSize:"1.5rem"},xl:{width:"7.5rem",height:"7.5rem",fontSize:"3rem"}},DS=({user:e,size:t="sm"})=>{var u,d,h,m;const n=ge.useTheme(),r=(d=(u=e==null?void 0:e.personalInfo.firstName)==null?void 0:u.charAt(0).toUpperCase())!=null?d:"",o=(m=(h=e==null?void 0:e.personalInfo.lastName)==null?void 0:h.charAt(0).toUpperCase())!=null?m:"",s=`${r}${o}`.trim()||" ",{width:l,height:a,fontSize:c}=LS[t];return i.jsx(B.Avatar,{sx:{backgroundColor:n.palette.primary.main,color:n.palette.primary.contrastText,width:l,height:a,fontSize:c,border:t==="sm"?`2px solid ${n.palette.neutral.lighter}`:void 0,[n.breakpoints.between("sm","md")]:{width:"33px !important",height:"33px !important"}},children:s})},HS=({messages:e})=>{const t=ge.useTheme();return e.length===0?null:i.jsx(B.Alert,{icon:i.jsx(Yh.default,{sx:{color:"#665312"}}),severity:"warning",sx:{display:"flex",backgroundColor:t.palette.warning.lightest,justifyContent:"center"},children:i.jsx(B.Typography,{sx:{fontFamily:"Lato",fontWeight:500,color:"#665312"},children:e.join(", ")})})},Td=24,Qi=-40,_S=0,Fd=e=>{if(e<=0)return 0;const t=20*Math.log10(e);return Math.min(1,Math.max(0,(t-Qi)/(_S-Qi)))},jd=(e,t,n=Td)=>e<=Math.floor(n*t),AS={default:{height:"18px",gap:"0.25rem",bar:{width:"0.625rem"},radius:"2px"},small:{height:"0.625rem",gap:"2px",bar:{width:"7px",boxSizing:"border-box"},radius:"1px"}},sl=({className:e,volume:t,label:n="Input Level",hideLabel:r=!1,barCount:o=Td,size:s="default"})=>{const l=ge.useTheme(),a=Array.from({length:o},(d,h)=>h+1),c=AS[s],u=Fd(t);return i.jsxs(B.Box,{className:e,sx:{width:"100%",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[!r&&i.jsx(B.Typography,{sx:{fontFamily:l.typography.fontFamily,fontWeight:l.typography.fontWeightBold},children:n}),i.jsx(B.Box,{...r&&{role:"img","aria-label":n},sx:{width:"100%",height:c.height,display:"flex",gap:c.gap},children:a.map(d=>i.jsx(B.Box,{sx:{...c.bar,height:"100%",borderRadius:c.radius,border:`0.5px solid ${l.palette.neutral.light}`,backgroundColor:jd(d,u,o)?l.palette["acuity-green"].main:l.customColors.white}},`audio-volume-bar-${d}`))})]})},ll=e=>{const[t,n]=se.useState(0);return se.useEffect(()=>{if(!e){n(0);return}let r;const o=new AudioContext,s=o.createMediaStreamSource(e),l=o.createAnalyser();l.fftSize=512,s.connect(l);const a=new Uint8Array(l.frequencyBinCount),c=()=>{let u=0;l.getByteTimeDomainData(a);for(let d=0;d<a.length;d++){const h=(a[d]-128)/128;u+=h*h}n(Math.sqrt(u/a.length)),r=requestAnimationFrame(c)};return c(),()=>{cancelAnimationFrame(r),l.disconnect(),s.disconnect(),o.close()}},[e]),t},VS=({stream:e,levelLabel:t})=>{const n=ll(e);return i.jsx(B.Box,{"data-testid":"recording-audio-level",sx:{width:"fit-content"},children:i.jsx(sl,{volume:n,label:t,hideLabel:!0,barCount:8,size:"small"})})},NS=({label:e="Recording",stream:t,levelLabel:n="Input Level",className:r})=>{const o=ge.useTheme();return i.jsxs(B.Box,{className:r,role:"alert",sx:{display:"inline-grid",gridTemplateColumns:"auto auto",alignItems:"center",columnGap:"0.5rem",rowGap:"0.25rem",padding:"0.5rem 0.75rem",backgroundColor:o.customColors.white,borderRadius:"9999px",boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"},children:[i.jsx(B.Box,{"aria-hidden":!0,sx:{width:12,height:12,borderRadius:"50%",backgroundColor:o.palette.error.main,justifySelf:"center"}}),i.jsx(B.Typography,{sx:{fontSize:"0.875rem",fontWeight:500,lineHeight:"1.25rem",color:o.palette.neutral.darkest,margin:0},children:e}),i.jsx(Zh.default,{"aria-hidden":!0,sx:{color:o.palette.neutral.darkest,fontSize:14,justifySelf:"center"}}),i.jsx(VS,{stream:t,levelLabel:n})]})},$S={audio:{label:"Select your Microphone",okMessage:"Microphone is working perfectly!",errorMessage:"There is a problem with your microphone. Please select your input again to proceed with your test."},video:{label:"Select your Camera",okMessage:"Camera is working as intended",errorMessage:"There is a problem with your webcam, Please select your camera input again to proceed with your test. "}},Od=({className:e,disabled:t,error:n,hideLabel:r=!1,options:o=[],type:s,value:l="",onChange:a,showMessage:c=!0,pendingMessage:u,pendingTone:d="neutral",compact:h=!1,labels:m})=>{const p=ge.useTheme(),{label:b,okMessage:x,errorMessage:w}=m!=null?m:$S[s],k=se.useMemo(()=>({width:h?"329px":r?"485px":"100%",height:h?"49px":r?"54px":"auto",labelFontSize:h?"8px":"10px",valueFontSize:h?"12px":"16px",labelColor:h?p.palette.neutral.darkest:p.palette.neutral.main,valueColor:h?p.palette.neutral.darkest:p.palette.neutral.dark,borderRadius:h?"10px":"8px",gap:h?"0px":"4px"}),[h,r,p.palette.neutral]),v=se.useMemo(()=>r||h?{width:k.width,height:k.height,borderRadius:k.borderRadius,padding:"10px","& .MuiSelect-select":{padding:h?"19px 10px":"10px",display:"flex",flexDirection:"column",gap:"4px"}}:{},[r,h,k]),F=se.useCallback(M=>{a(M.target.value)},[a]),j=se.useCallback(M=>{const P=o.find(R=>R.deviceId===M);return!P||!r&&!h?(P==null?void 0:P.label)||"":i.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",gap:k.gap},children:[i.jsx(B.Typography,{component:"span",sx:{fontFamily:p.typography.fontFamily,fontSize:k.labelFontSize,fontWeight:600,lineHeight:"20px",color:k.labelColor},children:b}),i.jsx(B.Typography,{component:"span",sx:{fontFamily:p.typography.fontFamily,fontSize:k.valueFontSize,fontWeight:600,lineHeight:"20px",color:k.valueColor},children:P.label})]})},[o,r,h,k,p.typography,b]),y=!n&&!!l&&!!u,A=!n&&!!l&&!u,N=!!n;return i.jsxs(B.Box,{className:e,sx:{width:"100%",minWidth:"300px"},children:[!r&&i.jsx(B.Typography,{sx:{fontFamily:p.typography.fontFamily,fontWeight:p.typography.fontWeightBold,mb:"0.5rem"},children:b}),i.jsx(B.FormControl,{sx:{mb:"0.375rem"},fullWidth:!0,disabled:!o.length,children:i.jsx(B.Select,{SelectDisplayProps:{"aria-label":b},disabled:t,value:l,onChange:F,sx:v,renderValue:j,children:o.map(M=>i.jsx(B.MenuItem,{"aria-label":M.label,value:M.deviceId,children:M.label},M.deviceId))})}),c&&i.jsxs(B.Box,{"aria-live":"polite",sx:{minHeight:"20px",display:"flex",alignItems:"center",gap:"0.5rem"},children:[y&&d==="neutral"&&i.jsxs(i.Fragment,{children:[i.jsx(eg.default,{fontSize:"small",sx:{color:p.palette.neutral.dark}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette.neutral.dark},children:u})]}),y&&d==="error"&&i.jsxs(i.Fragment,{children:[i.jsx(ml.default,{fontSize:"small",sx:{color:p.palette["acuity-red"].main}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette["acuity-red"].main},children:u})]}),A&&i.jsxs(i.Fragment,{children:[i.jsx(Jh.default,{fontSize:"small",sx:{color:p.palette["acuity-green"].darkest}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette["acuity-green"].darkest},children:x})]}),N&&i.jsxs(i.Fragment,{children:[i.jsx(ml.default,{fontSize:"small",sx:{color:p.palette["acuity-red"].main}}),i.jsx(B.Typography,{sx:{fontSize:"10px",color:p.palette["acuity-red"].main},children:w})]})]})]})},Rd=.02,Ld=250,Dd=8e3,Hd=(e,t)=>{const[n,r]=se.useState(t?"listening":"idle"),o=se.useRef(0),s=e>=Rd,l=n==="detected";return se.useEffect(()=>{if(o.current=0,!t){r("idle");return}r("listening");const a=setTimeout(()=>{r(c=>c==="listening"?"silent":c)},Dd);return()=>clearTimeout(a)},[t]),se.useEffect(()=>{if(!t||!s||l)return;const a=Date.now(),c=setTimeout(()=>r("detected"),Math.max(0,Ld-o.current));return()=>{clearTimeout(c),o.current+=Date.now()-a}},[t,s,l]),n},_d={speakToTest:"Speak to check your microphone.",noSoundDetected:"No sound detected. Speak into your microphone or choose another device.",inputLevel:"Input Level"},zS=({stream:e})=>{const t=ge.useTheme(),n=se.useRef(null);return se.useEffect(()=>{n.current&&(n.current.srcObject=e!=null?e:null)},[e]),i.jsxs(B.Box,{sx:{position:"relative",width:"100%",aspectRatio:"16 / 9",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"12px",border:`1px solid ${t.palette.neutral.light}`,backgroundColor:t.palette.neutral.lighter,overflow:"hidden"},children:[i.jsx(Qh.default,{"aria-hidden":!0,sx:{fontSize:80,color:t.palette.neutral.dark}}),i.jsx(B.Box,{component:"video",ref:n,autoPlay:!0,muted:!0,playsInline:!0,disablePictureInPicture:!0,"aria-hidden":!0,sx:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",transform:"scaleX(-1)",display:e?"block":"none"}})]})},GS=({devices:e,labels:t,onStatusChange:n})=>{const r=ll(e.audioStream),o=Hd(r,e.audioStream);se.useEffect(()=>n==null?void 0:n(o),[o,n]);let s;return o==="silent"?s=t.noSoundDetected:o!=="detected"&&(s=t.speakToTest),i.jsxs(i.Fragment,{children:[i.jsx(Od,{type:"audio",disabled:e.audioPerm!=="granted"||!e.audioDevices.length,error:e.audioError,options:e.audioDevices,value:e.activeAudioId,onChange:e.onSelectAudio,pendingMessage:s,pendingTone:o==="silent"?"error":"neutral",labels:t.microphone}),i.jsx(sl,{volume:r,label:t.inputLevel})]})},BS=({devices:e,onMicStatusChange:t,labels:n,className:r})=>{const o=ge.useTheme(),s={..._d,...n};return i.jsxs(B.Box,{className:r,sx:{width:"100%",display:"flex",justifyContent:"center",flexWrap:{xs:"wrap",md:"nowrap"},gap:"3rem"},children:[i.jsx(B.Box,{sx:{width:"100%",maxWidth:"624px"},children:i.jsx(zS,{stream:e.videoStream})}),i.jsx(B.Box,{sx:{display:{xs:"none",md:"block"},borderLeft:`1px solid ${o.palette.neutral.lighter}`}}),i.jsxs(B.Box,{sx:{width:"100%",maxWidth:"330px",display:"flex",flexDirection:"column",gap:"2.5rem"},children:[i.jsx(Od,{type:"video",disabled:e.videoPerm!=="granted"||!e.videoDevices.length,error:e.videoError,options:e.videoDevices,value:e.activeVideoId,onChange:e.onSelectVideo,labels:s.camera}),i.jsx(GS,{devices:e,labels:s,onStatusChange:t})]})]})};function Ji(e){const t=Math.abs(e);return t<10?`0${t}`:t.toString()}function il(e){const t=Math.floor(Math.abs(e)/60)*Math.sign(e),n=Math.abs(e)%60;return`${e<0?"-":""}${Ji(t)}:${Ji(n)}`}const WS=({timeLeft:e,timerLabel:t,variant:n="info",showClockIcon:r=!0,accessibleLabel:o="Time Left : "})=>{const s=ge.useTheme(),l=il(e),a=n==="info",c=a?s.palette.primary.main:s.palette.warning.darkest,u=a?s.palette.primary.lightest:s.palette.warning.lightest;return i.jsxs(B.Stack,{role:"timer","aria-live":"polite","aria-label":t||o,direction:"row",sx:{color:c,padding:{xs:"0.5rem 0.75rem",sm:"0.75rem 1rem"},backgroundColor:u,justifyContent:"space-between",borderRadius:"1rem",minWidth:0,maxWidth:"100%",overflow:"hidden",flexShrink:1,...a?{}:{border:`1px solid ${c}`}},children:[i.jsxs(B.Stack,{direction:"row",spacing:"0.25rem",alignItems:"center",sx:{minWidth:0,overflow:"hidden",flexShrink:1},children:[r&&i.jsx(tg.default,{sx:{flexShrink:0}}),t&&i.jsx(B.Typography,{sx:{fontSize:{xs:"0.875rem",sm:"1rem"},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t})]}),i.jsx(B.Typography,{sx:{fontWeight:"bold",ml:"0.5rem",fontSize:{xs:"0.875rem",sm:"1rem"},flexShrink:0,minWidth:"fit-content"},children:l})]})},Ad=B.styled(B.Box)(()=>({width:"100%",maxWidth:624,aspectRatio:"4/3",borderRadius:10,overflow:"hidden",position:"relative",height:"100%",maxHeight:368,marginBottom:"2.5rem",display:"flex",alignItems:"center",justifyContent:"center"})),qS=({imageUrl:e,altText:t="Preview Image"})=>e?i.jsx(Ad,{children:i.jsx("img",{src:e,alt:t,style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}})}):null,Vt="Lato, sans-serif",US=e=>{var t,n,r,o,s,l,a,c,u,d,h,m,p,b,x,w,k,v,F,j,y,A;return{h1:{fontFamily:(t=e.typography.fontFamily)!=null?t:Vt,fontWeight:(n=e.typography.fontWeightBold)!=null?n:700,fontSize:(r=e.typography["4xl"])!=null?r:"3rem",textAlign:"left",verticalAlign:"middle"},h2:{fontFamily:(o=e.typography.fontFamily)!=null?o:Vt,fontWeight:(s=e.typography.fontWeightMedium)!=null?s:600,fontSize:(l=e.typography["3xl"])!=null?l:"2.5rem",textAlign:"left",verticalAlign:"middle"},h3:{fontFamily:(a=e.typography.fontFamily)!=null?a:Vt,fontWeight:(c=e.typography.fontWeightRegular)!=null?c:400,fontSize:(u=e.typography["2xl"])!=null?u:"2rem",textAlign:"left",width:"100%",mt:"1rem"},h4:{fontFamily:(d=e.typography.fontFamily)!=null?d:Vt,fontWeight:(h=e.typography.fontWeightMedium)!=null?h:700,fontSize:(m=e.typography.base)!=null?m:"1rem",textAlign:"left",verticalAlign:"middle"},ul:{fontFamily:(p=e.typography.fontFamily)!=null?p:Vt,fontWeight:(b=e.typography.fontWeightRegular)!=null?b:400,listStyleType:"disc",pl:"1rem",textAlign:"left",width:"100%",pt:0},ol:{fontFamily:(x=e.typography.fontFamily)!=null?x:Vt,fontWeight:(w=e.typography.fontWeightRegular)!=null?w:400,listStyleType:"decimal",pl:"1rem",mt:"0.5rem",textAlign:"left",width:"100%"},p:{fontFamily:(k=e.typography.fontFamily)!=null?k:Vt,fontWeight:(v=e.typography.fontWeightRegular)!=null?v:400,mt:"0.25rem",textAlign:"left",wordBreak:"break-word",width:"100%"},a:{fontFamily:(F=e.typography.fontFamily)!=null?F:Vt,fontWeight:(j=e.typography.fontWeightRegular)!=null?j:400,color:e.palette.primary.main,textDecoration:"underline"},li:{fontFamily:(y=e.typography.fontFamily)!=null?y:Vt,fontWeight:(A=e.typography.fontWeightRegular)!=null?A:400,display:"list-item",p:0}}},tn=(e,t,n)=>{var o,s;const r=e.typography[t];return{fontSize:(o=r==null?void 0:r.fontSize)!=null?o:n.fontSize,lineHeight:(s=r==null?void 0:r.lineHeight)!=null?s:n.lineHeight}},al=e=>{var l,a,c,u;const t=(l=e.typography.fontFamily)!=null?l:Vt,n=(a=e.typography.fontWeightRegular)!=null?a:400,r=(c=e.typography.fontWeightMedium)!=null?c:600,o=(u=e.typography.fontWeightBold)!=null?u:700,s={fontFamily:t,letterSpacing:"normal",textAlign:"left",m:0};return{fontFamily:t,"& h1":{...s,...tn(e,"4xl",{fontSize:"2.25rem",lineHeight:"3rem"}),fontWeight:o},"& h2":{...s,...tn(e,"3xl",{fontSize:"1.625rem",lineHeight:"2.25rem"}),fontWeight:r},"& h3":{...s,...tn(e,"2xl",{fontSize:"1.4375rem",lineHeight:"2rem"}),fontWeight:n,mt:"1rem"},"& h4":{...s,...tn(e,"base",{fontSize:"1rem",lineHeight:"1.5rem"}),fontWeight:r},"& h5":{...s,...tn(e,"sm",{fontSize:"0.875rem",lineHeight:"1.25rem"}),fontWeight:o},"& h6":{...s,...tn(e,"sm",{fontSize:"0.875rem",lineHeight:"1.25rem"}),fontWeight:r},"& p":{fontFamily:t,...tn(e,"base",{fontSize:"1rem",lineHeight:"1.5rem"}),fontWeight:n,letterSpacing:"normal",textAlign:"left",wordBreak:"break-word",m:0,mt:"0.25rem"},"& ul, & ol":{fontFamily:t,...tn(e,"base",{fontSize:"1rem",lineHeight:"1.5rem"}),fontWeight:n,textAlign:"left",m:0,pl:"1rem",pr:0},"& ul":{listStyleType:"disc",pt:0,pb:"0.5rem"},"& ol":{listStyleType:"decimal",mt:"0.5rem",pt:"0.5rem",pb:"0.5rem"},"& li":{display:"list-item",m:0,p:0},"& li > p":{m:0},"& a":{color:e.palette.primary.main,textDecoration:"underline"},"& strong":{fontWeight:o},"& em":{fontStyle:"italic"}}},KS=B.styled(B.Box)(({theme:e})=>({width:"100%",borderRadius:"10px",overflow:"hidden",position:"relative",height:"100%",padding:"0.5rem",fontFamily:e.typography.fontFamily})),XS=({content:e=""})=>{const t=ge.useTheme(),n=se.useMemo(()=>al(t),[t]);return i.jsx(KS,{"data-testid":"content-text",sx:n,children:i.jsx(ng.default,{components:{a({children:r,href:o}){return i.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:r})}},children:e})})},tt={primary:{darkest:"#161E4A",dark:"#253170",main:"#364699",light:"#7779B8",lighter:"#B0B1D7",lightest:"#E9ECF6"},secondary:{darkest:"#15436E",dark:"#205C94",main:"#2C76BC",light:"#799DD1",lighter:"#B3C6E5",lightest:"#EAF1F9"},error:{darkest:"#720202",dark:"#A90508",main:"#E40A0A",light:"#F97054",lighter:"#FFB19E",lightest:"#FFECE8"},info:{darkest:"#0D556D",dark:"#157393",main:"#5A65E4",light:"#76B2CF",lighter:"#B2D3E3",lightest:"#EBF4F8"},warning:{darkest:"#816E09",dark:"#E0CA01",main:"#FCE833",light:"#FFEE7A",lighter:"#FFF5B1",lightest:"#FEFBE0"},success:{darkest:"#24590A",dark:"#387F14",main:"#4DA81F",light:"#89C368",lighter:"#BCDEA9",lightest:"#EEF8EB"},neutral:{darkest:"#333333",dark:"#555555",main:"#949494",light:"#B8B8B8",lighter:"#F5F5F5",lightest:"#FFFFFF"},"acuity-green":{darkest:"#00514B",dark:"#007A72",main:"#00A59B",light:"#70C0B8",lighter:"#B0DBD6",lightest:"#EBF6F5"},"acuity-red":{darkest:"#5C0924",dark:"#8A1339",main:"#BA1E50",light:"#D66D80",lighter:"#ECACB5",lightest:"#FBEAEC"},customColors:{black:"#000000",white:"#FFFFFF","light-gray":"#D9D9D9","medium-gray":"#767676","transparent-medium":"rgba(0, 0, 0, 0.25)","transparent-light":"rgba(0, 0, 0, 0.05)"}},ea=[1,2,3,4,5,6],Vd={toolbar:"Formatting",undo:"Undo",redo:"Redo",textStyle:"Text style",paragraph:"Paragraph",heading:e=>`Heading ${e}`,bold:"Bold",italic:"Italic",numberedList:"Numbered list",bulletedList:"Bulleted list"},YS=e=>i.jsx(B.SvgIcon,{viewBox:"0 0 24 25",...e,children:i.jsx("path",{d:"M7.404 18.5V17.5H14.658C15.6953 17.5 16.5787 17.1443 17.308 16.433C18.0387 15.7217 18.404 14.853 18.404 13.827C18.404 12.801 18.039 11.9357 17.309 11.231C16.5783 10.5257 15.6947 10.173 14.658 10.173H6.916L9.881 13.138L9.173 13.846L5 9.673L9.173 5.5L9.881 6.208L6.916 9.173H14.658C15.9667 9.173 17.085 9.62433 18.013 10.527C18.9397 11.4297 19.403 12.5297 19.403 13.827C19.403 15.1243 18.9397 16.2277 18.013 17.137C17.0863 18.0463 15.9677 18.5007 14.657 18.5H7.404Z"})}),ZS=e=>i.jsx(B.SvgIcon,{viewBox:"0 0 24 25",...e,children:i.jsx("path",{d:"M16.596 18.5V17.5H9.342C8.30467 17.5 7.42133 17.1443 6.692 16.433C5.96133 15.7217 5.596 14.853 5.596 13.827C5.596 12.801 5.961 11.9357 6.691 11.231C7.42167 10.5257 8.30533 10.173 9.342 10.173H17.084L14.119 13.138L14.827 13.846L19 9.673L14.827 5.5L14.119 6.208L17.084 9.173H9.342C8.03333 9.173 6.915 9.62433 5.987 10.527C5.06033 11.4297 4.597 12.5297 4.597 13.827C4.597 15.1243 5.06033 16.2277 5.987 17.137C6.91367 18.0463 8.03233 18.5007 9.343 18.5H16.596Z"})}),QS=ge.alpha(tt.neutral.darkest,.87),Tn=({Icon:e,label:t,onClick:n,disabled:r,pressed:o})=>i.jsx(B.Tooltip,{title:t,children:i.jsx("span",{children:i.jsx(B.IconButton,{"aria-label":t,"aria-pressed":o,disabled:r,size:"small",onClick:n,onMouseDown:s=>s.preventDefault(),sx:{borderRadius:"0.25rem",color:o?tt.customColors.white:tt.neutral.dark,backgroundColor:o?tt.primary.main:"transparent","&:hover":{color:tt.customColors.white,backgroundColor:tt.primary.main},"&.Mui-focusVisible":{outline:`2px solid ${tt.primary.main}`,outlineOffset:2}},children:i.jsx(e,{fontSize:"inherit"})})})}),Zo=()=>i.jsx(B.Divider,{flexItem:!0,orientation:"vertical",sx:{borderColor:tt.neutral.lighter,maxHeight:"30px",mt:"5px",mx:.5}}),JS=({id:e,label:t,value:n,onChange:r,"aria-describedby":o,height:s,disabled:l=!1,labels:a})=>{var k;const c=ge.useTheme(),u={...Vd,...a},d=`label_${e}`,h=se.useRef(n),m=se.useRef(r);se.useEffect(()=>{m.current=r},[r]);const p=Eo.useEditor({extensions:[ag.default.configure({strike:!1,underline:!1,code:!1,codeBlock:!1,horizontalRule:!1,link:{openOnClick:!1}}),oh.Markdown],content:n,contentType:"markdown",editable:!l,editorProps:{attributes:{id:e,role:"textbox","aria-multiline":"true","aria-labelledby":d,...o?{"aria-describedby":o}:{}}},onUpdate:({editor:v})=>{const F=v.getMarkdown();h.current=F,m.current(F)}});se.useEffect(()=>{!p||n===h.current||(h.current=n,p.commands.setContent(n,{contentType:"markdown",emitUpdate:!1}))},[p,n]),se.useEffect(()=>{p==null||p.setEditable(!l)},[p,l]);const b=Eo.useEditorState({editor:p,selector:({editor:v})=>{var F,j,y,A,N,M,P;return{canUndo:(F=v==null?void 0:v.can().undo())!=null?F:!1,canRedo:(j=v==null?void 0:v.can().redo())!=null?j:!1,isBold:(y=v==null?void 0:v.isActive("bold"))!=null?y:!1,isItalic:(A=v==null?void 0:v.isActive("italic"))!=null?A:!1,isOrderedList:(N=v==null?void 0:v.isActive("orderedList"))!=null?N:!1,isBulletList:(M=v==null?void 0:v.isActive("bulletList"))!=null?M:!1,headingLevel:(P=ea.find(R=>v==null?void 0:v.isActive("heading",{level:R})))!=null?P:0}}}),x=se.useMemo(()=>al(c),[c]),w=v=>()=>{l||v()};return i.jsxs(B.Box,{sx:{display:"flex",flexDirection:"column",minWidth:0},children:[i.jsx(B.Typography,{id:d,component:"label",onClick:()=>p==null?void 0:p.commands.focus(),sx:{fontFamily:c.typography.fontFamily,fontSize:"1rem",mb:1,width:"fit-content"},children:t}),i.jsxs(B.Box,{"data-testid":"markdown-editor-frame",sx:{display:"flex",flexDirection:"column",height:s},children:[i.jsxs(B.Box,{role:"toolbar","aria-label":u.toolbar,"aria-controls":e,sx:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"center",columnGap:.5,rowGap:.5,mb:"0.75rem"},children:[i.jsx(Tn,{Icon:YS,label:u.undo,disabled:l||!(b!=null&&b.canUndo),onClick:w(()=>p==null?void 0:p.chain().focus().undo().run())}),i.jsx(Tn,{Icon:ZS,label:u.redo,disabled:l||!(b!=null&&b.canRedo),onClick:w(()=>p==null?void 0:p.chain().focus().redo().run())}),i.jsx(Zo,{}),i.jsx(B.Tooltip,{title:u.textStyle,placement:"top",children:i.jsxs(B.Select,{variant:"standard",disableUnderline:!0,displayEmpty:!0,disabled:l,value:(k=b==null?void 0:b.headingLevel)!=null?k:0,inputProps:{"aria-label":u.textStyle},IconComponent:v=>i.jsx(ig.default,{...v,sx:{fontSize:"1rem"}}),onChange:v=>{const F=Number(v.target.value);F===0?p==null||p.chain().focus().setParagraph().run():p==null||p.chain().focus().setHeading({level:F}).run()},sx:{minWidth:"120px",fontFamily:c.typography.fontFamily,fontSize:"1rem",color:QS,fontWeight:b!=null&&b.headingLevel?700:400,backgroundColor:"transparent"},children:[i.jsx(B.MenuItem,{value:0,sx:{fontWeight:400},children:u.paragraph}),ea.map(v=>i.jsx(B.MenuItem,{value:v,sx:{fontWeight:700},children:u.heading(v)},v))]})}),i.jsx(Zo,{}),i.jsx(Tn,{Icon:rg.default,label:u.bold,disabled:l,pressed:b==null?void 0:b.isBold,onClick:w(()=>p==null?void 0:p.chain().focus().toggleBold().run())}),i.jsx(Tn,{Icon:og.default,label:u.italic,disabled:l,pressed:b==null?void 0:b.isItalic,onClick:w(()=>p==null?void 0:p.chain().focus().toggleItalic().run())}),i.jsx(Zo,{}),i.jsx(Tn,{Icon:lg.default,label:u.numberedList,disabled:l,pressed:b==null?void 0:b.isOrderedList,onClick:w(()=>p==null?void 0:p.chain().focus().toggleOrderedList().run())}),i.jsx(Tn,{Icon:sg.default,label:u.bulletedList,disabled:l,pressed:b==null?void 0:b.isBulletList,onClick:w(()=>p==null?void 0:p.chain().focus().toggleBulletList().run())})]}),i.jsx(B.Box,{"data-testid":"markdown-editor-scroll",onClick:()=>p==null?void 0:p.commands.focus(),sx:{flex:1,minHeight:s===void 0?"300px":0,overflowY:"auto",overflowWrap:"anywhere",border:`1px solid ${tt.customColors["light-gray"]}`,borderRadius:"0.375rem",px:"1.25rem",py:"0.75rem",cursor:l?"default":"text",backgroundColor:l?tt.neutral.lighter:void 0,"&:focus-within":{borderColor:tt.primary.main},"& .tiptap":{outline:"none",minHeight:"100%"},...x},children:i.jsx(Eo.EditorContent,{editor:p})})]})]})},e5=({label:e,onClick:t,ariaLabel:n})=>{const r=ge.useTheme();return i.jsx(B.Button,{onClick:t,"aria-label":n||e,startIcon:i.jsx(cg.default,{sx:{fontSize:24}}),"data-testid":"video-replay-button",sx:{backgroundColor:r.palette.neutral.lightest,minWidth:"200px",maxWidth:"min(80vw, 500px)",minHeight:"52px",borderRadius:4,padding:"14px 16px",gap:1,pointerEvents:"auto",transition:"transform 0.2s ease, box-shadow 0.2s ease",border:"none",color:r.palette.primary.main,fontWeight:700,fontSize:"1rem",textTransform:"none",whiteSpace:"normal",textAlign:"center",wordBreak:"break-word","&:hover":{backgroundColor:r.palette.neutral.lightest,boxShadow:`0 2px 8px ${r.palette.primary.light}`},"& .MuiButton-startIcon":{color:r.palette.primary.main,fontSize:24,flexShrink:0}},children:e})},t5=ge.styled(B.Button)(({theme:e,disabled:t})=>({whiteSpace:"nowrap",padding:"0.75rem 1rem",height:"48px",borderRadius:"16px",fontSize:e.typography.base.fontSize,fontWeight:e.typography.fontWeightBold,textTransform:"none",marginTop:"1rem","&&":{color:e.customColors.white},backgroundColor:t?e.palette.neutral.main:e.palette.primary.main,"&:hover":{backgroundColor:t?e.palette.neutral.light:e.palette.primary.dark},"&:focus":{boxShadow:`0 0 0 4px ${e.palette.primary.lighter}`},[e.breakpoints.down("sm")]:{whiteSpace:"normal",padding:"0.25rem 0.5rem"}})),n5=ge.styled(B.Button)(({theme:e,disabled:t})=>({whiteSpace:"nowrap",padding:"0.25rem 0.75rem",width:"145px",marginBottom:"1rem",marginTop:"1rem",borderRadius:"1.5rem",backgroundColor:t?e.palette.neutral.light:e.palette.error.dark,"&:hover":{backgroundColor:t?e.palette.neutral.light:e.palette.error.main},"&:focus":{boxShadow:`0 0 0 4px ${e.palette.error.lighter}`},display:"flex",alignItems:"center",justifyContent:"center","&&":{color:e.customColors.white},textTransform:"none",[e.breakpoints.down("sm")]:{whiteSpace:"normal",padding:"0.25rem 0.5rem",width:"100%"}})),r5=({children:e})=>{const t=ge.useTheme();return i.jsx(B.BottomNavigation,{sx:{backgroundColor:t.customColors.white,borderTop:1,borderColor:t.palette.neutral.light,height:"88px",minHeight:"88px",maxHeight:"88px",width:"100%",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center",borderBottomLeftRadius:"1.5rem",borderBottomRightRadius:"1.5rem",overflow:"hidden",padding:0,flexShrink:0,position:"relative",zIndex:15},children:e})},cl={en:"en-CA",fr:"fr-CA"};function o5(e){const t=(e!=null?e:"").toLowerCase().split(/[-_]/)[0];return t in cl?t:"en"}const s5=1e4;function Nd(e,t){var o;const n=t.toLowerCase(),r=n.split("-")[0];return(o=e.find(s=>s.lang.toLowerCase().replace("_","-")===n))!=null?o:e.find(s=>s.lang.toLowerCase().startsWith(r))}function Qo(){return typeof window!="undefined"&&"speechSynthesis"in window&&typeof window.SpeechSynthesisUtterance=="function"}const l5=({text:e,language:t,playLabel:n="Text to speech",stopLabel:r="Stop reading aloud"})=>{const[o,s]=se.useState(!1),[l]=se.useState(Qo),a=se.useRef(null),c=se.useCallback(()=>{a.current!==null&&(clearInterval(a.current),a.current=null)},[]),u=se.useCallback(()=>{c(),Qo()&&window.speechSynthesis.cancel(),s(!1)},[c]);se.useEffect(()=>u,[u]),se.useEffect(()=>{u()},[e,u]);const d=se.useCallback(()=>{if(!Qo()||!e)return;window.speechSynthesis.cancel();const h=new SpeechSynthesisUtterance(e),m=cl[t];h.lang=m;const p=Nd(window.speechSynthesis.getVoices(),m);p&&(h.voice=p);const b=()=>{c(),s(!1)};h.onend=b,h.onerror=b,s(!0),window.speechSynthesis.speak(h),c(),a.current=setInterval(()=>{if(!window.speechSynthesis.speaking){c();return}window.speechSynthesis.pause(),window.speechSynthesis.resume()},s5)},[e,t,c]);return!l||!e?null:i.jsx(B.Button,{onClick:o?u:d,startIcon:o?i.jsx(ug.default,{}):i.jsx(dg.default,{}),variant:"outlined","aria-live":"polite",sx:{whiteSpace:"nowrap",flexShrink:0,borderRadius:"1rem",textTransform:"none"},children:o?r:n})},$d=pa.default.div`
|
|
91
91
|
flex-direction: row;
|
|
92
92
|
display: flex;
|
|
93
93
|
align-items: center;
|