@tap-payments/os-micro-frontend-shared 0.3.258 → 0.3.259

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.
Files changed (156) hide show
  1. package/build/_chunks/{chunk-AHODKW2D.js → chunk-2GLRJMN6.js} +1 -1
  2. package/build/_chunks/{chunk-BLPTYUL5.js → chunk-2VTHWP5O.js} +1 -1
  3. package/build/_chunks/{chunk-WX3CZG6V.js → chunk-2YMYAWCC.js} +1 -1
  4. package/build/_chunks/{chunk-BNHPA7NL.js → chunk-3Q56NVXD.js} +1 -1
  5. package/build/_chunks/{chunk-GUU2BANS.js → chunk-3SAFFK2C.js} +1 -1
  6. package/build/_chunks/{chunk-CUGWXBZN.js → chunk-47BHC5LL.js} +1 -1
  7. package/build/_chunks/{chunk-6PNJ5QPQ.js → chunk-4FT2ICWU.js} +1 -1
  8. package/build/_chunks/{chunk-VKTXI56O.js → chunk-4H6XYG5C.js} +1 -1
  9. package/build/_chunks/{chunk-TZEK6NIP.js → chunk-4LPCR6ZF.js} +1 -1
  10. package/build/_chunks/{chunk-ZTZOHMJ3.js → chunk-4QNW7VH5.js} +1 -1
  11. package/build/_chunks/{chunk-LHPUWQK3.js → chunk-5CD6N5WK.js} +1 -1
  12. package/build/_chunks/{chunk-2FZQAWTT.js → chunk-5ECCKNZT.js} +1 -1
  13. package/build/_chunks/{chunk-QX5RXH7X.js → chunk-5FYG5C5W.js} +1 -1
  14. package/build/_chunks/{chunk-TP36G4JZ.js → chunk-6IXI7ZJE.js} +1 -1
  15. package/build/_chunks/{chunk-QLBJFLHC.js → chunk-6PWROCU5.js} +1 -1
  16. package/build/_chunks/{chunk-J2SOCIJU.js → chunk-6TR2DWQY.js} +1 -1
  17. package/build/_chunks/{chunk-GRNUANVM.js → chunk-6X45NOYG.js} +1 -1
  18. package/build/_chunks/{chunk-Q2XPHAIX.js → chunk-7XVKL6SF.js} +1 -1
  19. package/build/_chunks/{chunk-BVZCPC4B.js → chunk-AUQFVSAC.js} +1 -1
  20. package/build/_chunks/{chunk-FXLC7QM6.js → chunk-BAZGWIYZ.js} +1 -1
  21. package/build/_chunks/{chunk-IDPTEI5C.js → chunk-BUPQRYGO.js} +1 -1
  22. package/build/_chunks/{chunk-YXRP3YVA.js → chunk-CBFESEDG.js} +1 -1
  23. package/build/_chunks/{chunk-SQ6X7XQI.js → chunk-COIJDUHT.js} +1 -1
  24. package/build/_chunks/{chunk-HP4Q6HNE.js → chunk-CT276QU7.js} +1 -1
  25. package/build/_chunks/{chunk-KP2UMMK5.js → chunk-D5BPWGPP.js} +1 -1
  26. package/build/_chunks/{chunk-2QYAHYYH.js → chunk-E6UD7XMZ.js} +1 -1
  27. package/build/_chunks/{chunk-J7KCH7KM.js → chunk-EILUWZWD.js} +1 -1
  28. package/build/_chunks/{chunk-TXVDWYET.js → chunk-F5VP5A5Z.js} +1 -1
  29. package/build/_chunks/{chunk-7EBCOZWQ.js → chunk-FGDCJZ3X.js} +1 -1
  30. package/build/_chunks/{chunk-IDIANGVR.js → chunk-GSYHTYAN.js} +1 -1
  31. package/build/_chunks/{chunk-PCY4RMGU.js → chunk-GYHZKV2M.js} +1 -1
  32. package/build/_chunks/{chunk-3ARGSIW6.js → chunk-H63JPGDI.js} +1 -1
  33. package/build/_chunks/{chunk-NU6TMNMX.js → chunk-HBND2EFC.js} +1 -1
  34. package/build/_chunks/{chunk-G7FUKYC4.js → chunk-ILP5V6AY.js} +1 -1
  35. package/build/_chunks/{chunk-53FTAIGE.js → chunk-IV3TDZ3W.js} +1 -1
  36. package/build/_chunks/{chunk-TSI47ZRD.js → chunk-IXDYEJOF.js} +1 -1
  37. package/build/_chunks/{chunk-OGUM23ZV.js → chunk-J3A4TPFU.js} +1 -1
  38. package/build/_chunks/{chunk-N4CCG67Z.js → chunk-KCC5EOJP.js} +1 -1
  39. package/build/_chunks/{chunk-SX2JK42Q.js → chunk-KD4X7VNJ.js} +1 -1
  40. package/build/_chunks/{chunk-6QJCOTT4.js → chunk-LANVM4W7.js} +1 -1
  41. package/build/_chunks/{chunk-LSJ4DU5A.js → chunk-LSTZ77FI.js} +1 -1
  42. package/build/_chunks/{chunk-ECCMCTOM.js → chunk-M3UPFS34.js} +1 -1
  43. package/build/_chunks/{chunk-5CIBM232.js → chunk-M4PHQC7I.js} +1 -1
  44. package/build/_chunks/{chunk-AGUMSHB4.js → chunk-N5IV44PM.js} +1 -1
  45. package/build/_chunks/{chunk-UDF64CIJ.js → chunk-N7D3VKQ4.js} +1 -1
  46. package/build/_chunks/{chunk-PGMH7MPJ.js → chunk-NELF4II6.js} +1 -1
  47. package/build/_chunks/{chunk-M6YVU7V3.js → chunk-NLADERC7.js} +1 -1
  48. package/build/_chunks/{chunk-URDUQGSO.js → chunk-OLE3W5SY.js} +1 -1
  49. package/build/_chunks/{chunk-MZ4CDPE6.js → chunk-PMZXK7AV.js} +1 -1
  50. package/build/_chunks/{chunk-NUJYDXCY.js → chunk-RKQ3VHJO.js} +1 -1
  51. package/build/_chunks/{chunk-OTAHIU6Z.js → chunk-RZU53SJQ.js} +1 -1
  52. package/build/_chunks/{chunk-DJB73WJX.js → chunk-SCF7O6LM.js} +1 -1
  53. package/build/_chunks/{chunk-IRIZPPXM.js → chunk-SONL3PF7.js} +1 -1
  54. package/build/_chunks/{chunk-U7BM5XPI.js → chunk-SXRJIWUP.js} +1 -1
  55. package/build/_chunks/{chunk-N63SPB7J.js → chunk-UV5IVWMW.js} +1 -1
  56. package/build/_chunks/{chunk-C2QLJW5U.js → chunk-UWTIO4U2.js} +1 -1
  57. package/build/_chunks/{chunk-VTM5XAA4.js → chunk-VDPT33NC.js} +1 -1
  58. package/build/_chunks/{chunk-6JO37S7T.js → chunk-VJJE7KB7.js} +1 -1
  59. package/build/_chunks/{chunk-YQKWAH6Y.js → chunk-VPHTGRAH.js} +1 -1
  60. package/build/_chunks/{chunk-E7OZE7FK.js → chunk-VXCS5OYH.js} +1 -1
  61. package/build/_chunks/{chunk-USHKRLP3.js → chunk-W4S3ZMMM.js} +1 -1
  62. package/build/_chunks/{chunk-FEZOSRP2.js → chunk-WAIH2SQK.js} +1 -1
  63. package/build/_chunks/{chunk-TP2IR3FW.js → chunk-WK3YZ7WJ.js} +1 -1
  64. package/build/_chunks/{chunk-6AISJMRA.js → chunk-WMUG67X7.js} +1 -1
  65. package/build/_chunks/{chunk-ZDRR6O4Q.js → chunk-XEFJRFJH.js} +1 -1
  66. package/build/_chunks/{chunk-KGG6V7HL.js → chunk-XSMQJ22A.js} +1 -1
  67. package/build/_chunks/{chunk-667MADJD.js → chunk-YPYTJOXU.js} +1 -1
  68. package/build/_chunks/{chunk-LPVUMEPP.js → chunk-YWQQPN2Y.js} +1 -1
  69. package/build/_chunks/{chunk-EOEZUZCE.js → chunk-YZXLBSZX.js} +1 -1
  70. package/build/_chunks/{chunk-BHQDWVM3.js → chunk-ZP7BOXHM.js} +1 -1
  71. package/build/_chunks/chunk-ZTNJXPMT.js +2 -0
  72. package/build/components/ActionsDropdownMenu/index.js +1 -1
  73. package/build/components/Alert/index.js +1 -1
  74. package/build/components/AppServices/index.js +1 -1
  75. package/build/components/AppServicesBar/index.js +1 -1
  76. package/build/components/AppWindowWrapper/index.js +1 -1
  77. package/build/components/AreaChart/index.js +1 -1
  78. package/build/components/Autocomplete/index.js +1 -1
  79. package/build/components/AvatarStack/index.js +1 -1
  80. package/build/components/Calender/index.js +1 -1
  81. package/build/components/Card/index.js +1 -1
  82. package/build/components/ColorPicker/index.js +1 -1
  83. package/build/components/ColumnViews/index.js +1 -1
  84. package/build/components/ConfirmDialog/index.js +1 -1
  85. package/build/components/CountryFilter/index.js +1 -1
  86. package/build/components/CountryFlag/index.js +1 -1
  87. package/build/components/CurrenciesMenu/index.js +1 -1
  88. package/build/components/CurrencyAmount/index.js +1 -1
  89. package/build/components/CurrencyAmountInput/index.js +1 -1
  90. package/build/components/CurrencySymbol/index.js +1 -1
  91. package/build/components/DateFilter/index.js +1 -1
  92. package/build/components/DeviceIcon/index.js +1 -1
  93. package/build/components/DropdownMenu/index.js +1 -1
  94. package/build/components/EmptyState/index.js +1 -1
  95. package/build/components/ErrorToast/index.js +1 -1
  96. package/build/components/FileDropbox/index.js +1 -1
  97. package/build/components/FilePreview/index.js +1 -1
  98. package/build/components/FileUploader/index.js +1 -1
  99. package/build/components/FilterChip/index.js +1 -1
  100. package/build/components/FilterDropdown/index.js +1 -1
  101. package/build/components/Filters/index.js +1 -1
  102. package/build/components/FlippingCard/index.js +1 -1
  103. package/build/components/FormSelect/index.js +1 -1
  104. package/build/components/GroupedSelect/index.js +1 -1
  105. package/build/components/HeatMap/index.js +1 -1
  106. package/build/components/InputBase/index.js +1 -1
  107. package/build/components/Inputs/index.js +1 -1
  108. package/build/components/JSONViewer/index.js +1 -1
  109. package/build/components/LeftPeekRightExpandingChip/index.js +1 -1
  110. package/build/components/ListColumnFilter/index.js +1 -1
  111. package/build/components/ListHeader/index.js +1 -1
  112. package/build/components/ListLayout/index.js +1 -1
  113. package/build/components/Loader/index.js +1 -1
  114. package/build/components/Logo/index.js +1 -1
  115. package/build/components/MFWidgetLoader/index.js +1 -1
  116. package/build/components/MaskedText/index.js +1 -1
  117. package/build/components/MultiSelect/index.js +1 -1
  118. package/build/components/NestedDropdown/index.js +1 -1
  119. package/build/components/NestedMultiSelect/index.js +1 -1
  120. package/build/components/PhoneFilter/index.js +1 -1
  121. package/build/components/PhoneInput/index.js +1 -1
  122. package/build/components/ProgressRing/index.js +1 -1
  123. package/build/components/RadioGroup/index.js +1 -1
  124. package/build/components/RangeCalender/index.js +1 -1
  125. package/build/components/RatingCount/index.js +1 -1
  126. package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
  127. package/build/components/SearchButton/index.js +1 -1
  128. package/build/components/SearchInput/index.js +1 -1
  129. package/build/components/SheetViewChip/index.js +1 -1
  130. package/build/components/Sidebar/index.js +1 -1
  131. package/build/components/StatusBar/index.js +1 -1
  132. package/build/components/StatusButton/index.js +1 -1
  133. package/build/components/StatusFilter/index.js +1 -1
  134. package/build/components/StatusIcons/index.js +1 -1
  135. package/build/components/StatusLabel/index.js +1 -1
  136. package/build/components/TableCells/index.js +1 -1
  137. package/build/components/TableReports/index.js +1 -1
  138. package/build/components/TextInput/index.js +1 -1
  139. package/build/components/Timepicker/index.js +1 -1
  140. package/build/components/ToggleView/index.js +1 -1
  141. package/build/components/Toolbar/index.js +1 -1
  142. package/build/components/ToolbarIcon/index.js +1 -1
  143. package/build/components/TreeDropdown/index.js +1 -1
  144. package/build/components/VerificationIcon/index.js +1 -1
  145. package/build/components/VirtualTables/index.js +1 -1
  146. package/build/components/Widget/index.js +1 -1
  147. package/build/components/index.js +1 -1
  148. package/build/components/primitives/index.js +1 -1
  149. package/build/constants/apps.d.ts +24 -0
  150. package/build/constants/index.js +1 -1
  151. package/build/datetime/components/index.js +1 -1
  152. package/build/hooks/index.js +1 -1
  153. package/build/index.js +1 -1
  154. package/build/utils/index.js +1 -1
  155. package/package.json +1 -1
  156. package/build/_chunks/chunk-RNBTIRD7.js +0 -2
@@ -1,2 +1,2 @@
1
- import {f}from'./chunk-USHKRLP3.js';import {z}from'./chunk-FEZOSRP2.js';import {Bc,Ka,g}from'./chunk-ZTZOHMJ3.js';import {Al,ja,Va,Pg,kl,_a,Ua,Yg,Xg,Zg,Wg,$g,Bb,Ab,Bk,jk,ib,wk,B,w as w$1,A,D,Uh,ik,u,Ck}from'./chunk-RNBTIRD7.js';import {memo,useId,useState,useRef,useEffect,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Button,Box,alpha,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function w({isActive:t,disableHover:e}){let[n,g]=useState(false),l=useTheme(),r=()=>{e||g(true);},u=()=>{g(false);},C=t?l.palette.common.white:l.palette.grey[700],d=n?l.palette.common.black:"transparent";return jsx("svg",{width:"27",height:"30",viewBox:"0 0 27 32",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{id:"Group 140343",children:[jsx("path",{id:"Active",d:"M0 0H11C19.8366 0 27 7.16344 27 16C27 24.8366 19.8366 32 11 32H0V0Z",fill:d,fillOpacity:"0.1",onMouseEnter:r,onMouseLeave:u}),jsx("path",{id:"Union",fillRule:"evenodd",clipRule:"evenodd",d:"M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z",fill:C})]})})}var zt=t=>({...t.typography.subtitle1,borderRadius:"50px",borderWidth:"1px",borderStyle:"solid",minWidth:"135.11px",height:"32px",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",textTransform:"none",transition:"none",paddingInline:t.spacing(2)}),mt=styled(Button,{shouldForwardProp:t=>t!=="statusVariant"})(({theme:t,statusVariant:e})=>({...zt(t),...e==="active"?{background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,"&:hover":{background:t.palette.background.gradient.shadedBlue,opacity:.8}}:{backgroundColor:t.palette.common.white,borderColor:t.palette.grey[100],color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.common.white,opacity:.7}}})),gt={active:mt,inActive:mt};styled(Box)(({theme:t,variant:e})=>({borderRadius:"50px",backgroundColor:e==="active"?alpha(t.palette.text.primary,.1):t.palette.grey[100],display:"flex",justifyContent:"center",alignItems:"center",paddingInline:t.spacing(.5),paddingBlock:t.spacing(.25),color:e==="active"?t.palette.common.white:t.palette.text.primary,fontSize:"8px",fontWeight:700,lineHeight:"10px"}));styled("img")(({theme:t,variant:e,icon:n})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(n??"")&&e==="inActive")&&n!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"}));styled("p")(({theme:t})=>({fontSize:"0.6875rem",color:t.palette.background.default,fontStyle:"normal",margin:"auto",textTransform:"capitalize"}));var ht=styled(f)(({theme:t})=>({backgroundColor:"white",boxShadow:t.shadows[21],borderRadius:"0.25rem","& .MuiPaper-root":{borderRadius:"0.25rem",width:"12.5rem"}})),Ct=styled("span")(()=>({width:"27px",height:"100%",maxHeight:"100%",position:"absolute",top:"0",right:"0",bottom:"0",overflow:"hidden"})),ft=styled(Box)(({variant:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"0.5rem",fontWeight:t==="active"?700:400})),vt=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%"})),It=styled("img")(({theme:t,variant:e,icon:n})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(n??"")&&e==="inActive")&&n!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"})),xt=styled(Box)(({variant:t})=>({width:"14px",height:"14px",display:"flex",alignItems:"center","& img":{width:"14px",height:"14px",filter:t==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"}}));var bt={inProgress:Ck,initiated:Ck,abandoned:u,cancelled:ik,reversed:Uh,reports:D,search:A,chevronDown:w$1,unAuthorized:B,unSettled:wk,unCaptured:ib,captured:jk,authorized:Bk,openFlag:Ab,closedFlag:Bb,unauthenticated:$g,authenticated:Wg,paidOut:Zg,scheduled:Xg,checked:Yg,dashedChecked:Ua,deactivated:_a,destination:kl,destinationReversed:Pg,outstanding:Va,active:ja,inactive:Al};var Ut=memo(t=>{let{variant:e="inActive",badgeCount:n,icon:g$1,label:l,dropdownOptions:r,selectedStatus:u,onButtonBodyClick:C,iconMapper:d=bt,buttonSx:yt,...wt}=t,kt=Bc(useId(),"status-button"),[Lt,M]=useState(0),{t:R}=useTranslation(),P=useRef(null),[T,x]=useState(null),[a,V]=useState(u??r?.[0]?.status);useEffect(()=>{u!==void 0&&V(u);},[u]);let p=useMemo(()=>!!r?.length,[r]),f=!!T&&Lt>1,m=e==="active",H=useMemo(()=>m?"active":"inactive",[m]),h=useMemo(()=>a?r?.find(o=>o.status===a):null,[a,r]),Mt=useMemo(()=>{if(h?.icon)return jsx(xt,{variant:e,children:h.icon});let o=a&&d[a]?a:g$1;if(o&&d[o])return jsx(It,{icon:o,variant:e,src:d[o],alt:`${o}-icon`})},[h,a,d,g$1,e]),Rt=useMemo(()=>!n||Number.isNaN(Ka(n))?null:jsx(z,{color:H,children:g(Number(n))}),[n,H]),W=useMemo(()=>p?jsx(w,{isActive:m}):null,[p,m]);useEffect(()=>{m||(M(0),x(null));},[m]);let b=useCallback(()=>{x(null);},[]),A=useCallback(()=>{p&&x(f?null:P.current);},[p,f]),Pt=useCallback(o=>{o.stopPropagation(),t?.onClick?.(o),C?.(a||r?.[0]?.status||"all"),A(),M(B=>B+1);},[t,C,a,r,A]),E=useCallback(o=>B=>{o?.onClick?.(B),V(o.status),b();},[b]),Tt=useMemo(()=>r?.map(o=>({...o,onClick:E(o)}))||[],[r,E]),Vt=gt[e],Ht=useMemo(()=>h?.label||(a?R(a):l),[h,a,R,l]);return jsxs(Fragment,{children:[jsx(Vt,{id:kt,"data-testid":"StatusButton",...wt,ref:P,onClick:Pt,statusVariant:e,sx:{...p&&{paddingInlineEnd:"27px"},...yt},children:jsxs(vt,{children:[jsxs(ft,{variant:e,children:[Mt,Ht,Rt]}),W&&jsx(Ct,{children:W})]})}),f&&p&&jsx(ht,{open:f,onClose:b,anchorEl:T,menuItems:Tt})]})}),St=Ut;var ge=St;
1
+ import {f}from'./chunk-W4S3ZMMM.js';import {z}from'./chunk-WAIH2SQK.js';import {Bc,Ka,g}from'./chunk-4QNW7VH5.js';import {Al,ja,Va,Pg,kl,_a,Ua,Yg,Xg,Zg,Wg,$g,Bb,Ab,Bk,jk,ib,wk,B,w as w$1,A,D,Uh,ik,u,Ck}from'./chunk-ZTNJXPMT.js';import {memo,useId,useState,useRef,useEffect,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {styled,Button,Box,alpha,useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function w({isActive:t,disableHover:e}){let[n,g]=useState(false),l=useTheme(),r=()=>{e||g(true);},u=()=>{g(false);},C=t?l.palette.common.white:l.palette.grey[700],d=n?l.palette.common.black:"transparent";return jsx("svg",{width:"27",height:"30",viewBox:"0 0 27 32",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{id:"Group 140343",children:[jsx("path",{id:"Active",d:"M0 0H11C19.8366 0 27 7.16344 27 16C27 24.8366 19.8366 32 11 32H0V0Z",fill:d,fillOpacity:"0.1",onMouseEnter:r,onMouseLeave:u}),jsx("path",{id:"Union",fillRule:"evenodd",clipRule:"evenodd",d:"M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z",fill:C})]})})}var zt=t=>({...t.typography.subtitle1,borderRadius:"50px",borderWidth:"1px",borderStyle:"solid",minWidth:"135.11px",height:"32px",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",textTransform:"none",transition:"none",paddingInline:t.spacing(2)}),mt=styled(Button,{shouldForwardProp:t=>t!=="statusVariant"})(({theme:t,statusVariant:e})=>({...zt(t),...e==="active"?{background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,"&:hover":{background:t.palette.background.gradient.shadedBlue,opacity:.8}}:{backgroundColor:t.palette.common.white,borderColor:t.palette.grey[100],color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.common.white,opacity:.7}}})),gt={active:mt,inActive:mt};styled(Box)(({theme:t,variant:e})=>({borderRadius:"50px",backgroundColor:e==="active"?alpha(t.palette.text.primary,.1):t.palette.grey[100],display:"flex",justifyContent:"center",alignItems:"center",paddingInline:t.spacing(.5),paddingBlock:t.spacing(.25),color:e==="active"?t.palette.common.white:t.palette.text.primary,fontSize:"8px",fontWeight:700,lineHeight:"10px"}));styled("img")(({theme:t,variant:e,icon:n})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(n??"")&&e==="inActive")&&n!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"}));styled("p")(({theme:t})=>({fontSize:"0.6875rem",color:t.palette.background.default,fontStyle:"normal",margin:"auto",textTransform:"capitalize"}));var ht=styled(f)(({theme:t})=>({backgroundColor:"white",boxShadow:t.shadows[21],borderRadius:"0.25rem","& .MuiPaper-root":{borderRadius:"0.25rem",width:"12.5rem"}})),Ct=styled("span")(()=>({width:"27px",height:"100%",maxHeight:"100%",position:"absolute",top:"0",right:"0",bottom:"0",overflow:"hidden"})),ft=styled(Box)(({variant:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"0.5rem",fontWeight:t==="active"?700:400})),vt=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%"})),It=styled("img")(({theme:t,variant:e,icon:n})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(n??"")&&e==="inActive")&&n!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"})),xt=styled(Box)(({variant:t})=>({width:"14px",height:"14px",display:"flex",alignItems:"center","& img":{width:"14px",height:"14px",filter:t==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"}}));var bt={inProgress:Ck,initiated:Ck,abandoned:u,cancelled:ik,reversed:Uh,reports:D,search:A,chevronDown:w$1,unAuthorized:B,unSettled:wk,unCaptured:ib,captured:jk,authorized:Bk,openFlag:Ab,closedFlag:Bb,unauthenticated:$g,authenticated:Wg,paidOut:Zg,scheduled:Xg,checked:Yg,dashedChecked:Ua,deactivated:_a,destination:kl,destinationReversed:Pg,outstanding:Va,active:ja,inactive:Al};var Ut=memo(t=>{let{variant:e="inActive",badgeCount:n,icon:g$1,label:l,dropdownOptions:r,selectedStatus:u,onButtonBodyClick:C,iconMapper:d=bt,buttonSx:yt,...wt}=t,kt=Bc(useId(),"status-button"),[Lt,M]=useState(0),{t:R}=useTranslation(),P=useRef(null),[T,x]=useState(null),[a,V]=useState(u??r?.[0]?.status);useEffect(()=>{u!==void 0&&V(u);},[u]);let p=useMemo(()=>!!r?.length,[r]),f=!!T&&Lt>1,m=e==="active",H=useMemo(()=>m?"active":"inactive",[m]),h=useMemo(()=>a?r?.find(o=>o.status===a):null,[a,r]),Mt=useMemo(()=>{if(h?.icon)return jsx(xt,{variant:e,children:h.icon});let o=a&&d[a]?a:g$1;if(o&&d[o])return jsx(It,{icon:o,variant:e,src:d[o],alt:`${o}-icon`})},[h,a,d,g$1,e]),Rt=useMemo(()=>!n||Number.isNaN(Ka(n))?null:jsx(z,{color:H,children:g(Number(n))}),[n,H]),W=useMemo(()=>p?jsx(w,{isActive:m}):null,[p,m]);useEffect(()=>{m||(M(0),x(null));},[m]);let b=useCallback(()=>{x(null);},[]),A=useCallback(()=>{p&&x(f?null:P.current);},[p,f]),Pt=useCallback(o=>{o.stopPropagation(),t?.onClick?.(o),C?.(a||r?.[0]?.status||"all"),A(),M(B=>B+1);},[t,C,a,r,A]),E=useCallback(o=>B=>{o?.onClick?.(B),V(o.status),b();},[b]),Tt=useMemo(()=>r?.map(o=>({...o,onClick:E(o)}))||[],[r,E]),Vt=gt[e],Ht=useMemo(()=>h?.label||(a?R(a):l),[h,a,R,l]);return jsxs(Fragment,{children:[jsx(Vt,{id:kt,"data-testid":"StatusButton",...wt,ref:P,onClick:Pt,statusVariant:e,sx:{...p&&{paddingInlineEnd:"27px"},...yt},children:jsxs(vt,{children:[jsxs(ft,{variant:e,children:[Mt,Ht,Rt]}),W&&jsx(Ct,{children:W})]})}),f&&p&&jsx(ht,{open:f,onClose:b,anchorEl:T,menuItems:Tt})]})}),St=Ut;var ge=St;
2
2
  export{w as a,ge as b};
@@ -1 +1 @@
1
- import {T,S as S$1,b as b$1}from'./chunk-FEZOSRP2.js';import {forwardRef,memo,createContext,useState,useRef,useCallback,useMemo,useContext}from'react';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=styled(T)(({theme:o})=>({[`& .${S$1.title}`]:{fontSize:"13px",fontWeight:700,lineHeight:o.typography.h6.lineHeight,borderBottom:`1px solid ${o.palette.divider}`,margin:0,padding:"16px 16px 16px 12px",color:o.palette.text.primary}})),y=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),p=styled(b$1)(({theme:o})=>({paddingInline:o.spacing(3),paddingBlock:o.spacing(1),borderRadius:o.spacing(.5),minWidth:64,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:o.palette.text.primary,textTransform:"none",border:`1px solid ${o.palette.divider}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o.palette.action.hover}})),D=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),S=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var b=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},d)=>jsx(x,{ref:d,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(y,{children:[jsx(D,{children:o}),jsxs(S,{children:[jsx(p,{variant:"ghost",onClick:s,children:i||"No"}),jsx(p,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));b.displayName="ConfirmDialog";var h=memo(b);var g=createContext(null);function M(){let o=useContext(g);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var H={open:false,message:null,title:void 0,confirmText:void 0,cancelText:void 0,sx:void 0,dismissible:true};function z({children:o}){let[t,a]=useState(H),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(d=>({...d,open:false})),n(e));},[]),s=useCallback(e=>new Promise(n=>{i.current?.(false),i.current=n,a({open:true,dismissible:e.dismissible??true,message:e.message,title:e.title,confirmText:e.confirmText,cancelText:e.cancelText,sx:e.sx});}),[]),m=useMemo(()=>({confirm:s}),[s]);return jsxs(g.Provider,{value:m,children:[o,jsx(h,{open:t.open,message:t.message,title:t.title,confirmText:t.confirmText,cancelText:t.cancelText,onConfirm:()=>r(true),onCancel:()=>r(false),onClose:t.dismissible?()=>r(false):void 0,sx:t.sx})]})}var O=memo(z);export{M as a,O as b};
1
+ import {T,S as S$1,b as b$1}from'./chunk-WAIH2SQK.js';import {forwardRef,memo,createContext,useState,useRef,useCallback,useMemo,useContext}from'react';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=styled(T)(({theme:o})=>({[`& .${S$1.title}`]:{fontSize:"13px",fontWeight:700,lineHeight:o.typography.h6.lineHeight,borderBottom:`1px solid ${o.palette.divider}`,margin:0,padding:"16px 16px 16px 12px",color:o.palette.text.primary}})),y=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),p=styled(b$1)(({theme:o})=>({paddingInline:o.spacing(3),paddingBlock:o.spacing(1),borderRadius:o.spacing(.5),minWidth:64,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:o.palette.text.primary,textTransform:"none",border:`1px solid ${o.palette.divider}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o.palette.action.hover}})),D=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),S=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var b=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},d)=>jsx(x,{ref:d,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(y,{children:[jsx(D,{children:o}),jsxs(S,{children:[jsx(p,{variant:"ghost",onClick:s,children:i||"No"}),jsx(p,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));b.displayName="ConfirmDialog";var h=memo(b);var g=createContext(null);function M(){let o=useContext(g);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var H={open:false,message:null,title:void 0,confirmText:void 0,cancelText:void 0,sx:void 0,dismissible:true};function z({children:o}){let[t,a]=useState(H),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(d=>({...d,open:false})),n(e));},[]),s=useCallback(e=>new Promise(n=>{i.current?.(false),i.current=n,a({open:true,dismissible:e.dismissible??true,message:e.message,title:e.title,confirmText:e.confirmText,cancelText:e.cancelText,sx:e.sx});}),[]),m=useMemo(()=>({confirm:s}),[s]);return jsxs(g.Provider,{value:m,children:[o,jsx(h,{open:t.open,message:t.message,title:t.title,confirmText:t.confirmText,cancelText:t.cancelText,onConfirm:()=>r(true),onCancel:()=>r(false),onClose:t.dismissible?()=>r(false):void 0,sx:t.sx})]})}var O=memo(z);export{M as a,O as b};
@@ -1 +1 @@
1
- import {j}from'./chunk-FEZOSRP2.js';import {nc}from'./chunk-ZTZOHMJ3.js';import {forwardRef,memo}from'react';import C from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var p="os-shared-Card",o={root:`${p}-root`,header:`${p}-header`,title:`${p}-title`},n=233,f=39;var c=styled(C)(({theme:r})=>{let{grey:e}=r.v2.palette;return {display:"flex",flexDirection:"column",height:n,border:`1px solid ${e[100]}`,borderRadius:r.v2.radius(8),backgroundColor:"#FBFBFB",fontSize:r.v2.typography.textVariants.body.small.regular.fontSize,transform:"scale(1)"}}),y=styled(C,{shouldForwardProp:r=>r!=="$hasStartAdornment"})(({theme:r,$hasStartAdornment:e})=>({display:"flex",alignItems:"center",...e&&{gap:r.v2.spacing(8)},height:f,flexShrink:0,overflow:"visible",padding:`${r.v2.spacing(8)} ${r.v2.spacing(12)}`,borderBottom:`1px solid ${r.v2.palette.grey[100]}`})),x=styled(j)(({theme:r})=>({flexGrow:1,minWidth:0,color:r.v2.palette.grey[900],textTransform:"capitalize"}));var H=forwardRef(({id:r,className:e,sx:d,children:s,...a},l)=>jsx(c,{ref:l,component:"article",id:r,"data-testid":r??"Card",...a,className:nc(o.root,e),sx:d,children:s}));H.displayName="Card";var v=memo(H);var g=forwardRef(({id:r,className:e,sx:d,children:s,startAdornment:a,endAdornment:l,...S},N)=>jsxs(y,{ref:N,component:"header",id:r,"data-testid":r??"CardHeader",...S,$hasStartAdornment:a!=null,className:nc(o.header,e),sx:d,children:[a,jsx(x,{component:"div",textVariant:"body.small.semibold",className:o.title,children:s}),l]}));g.displayName="CardHeader";var T=memo(g);export{o as a,v as b,T as c};
1
+ import {j}from'./chunk-WAIH2SQK.js';import {nc}from'./chunk-4QNW7VH5.js';import {forwardRef,memo}from'react';import C from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var p="os-shared-Card",o={root:`${p}-root`,header:`${p}-header`,title:`${p}-title`},n=233,f=39;var c=styled(C)(({theme:r})=>{let{grey:e}=r.v2.palette;return {display:"flex",flexDirection:"column",height:n,border:`1px solid ${e[100]}`,borderRadius:r.v2.radius(8),backgroundColor:"#FBFBFB",fontSize:r.v2.typography.textVariants.body.small.regular.fontSize,transform:"scale(1)"}}),y=styled(C,{shouldForwardProp:r=>r!=="$hasStartAdornment"})(({theme:r,$hasStartAdornment:e})=>({display:"flex",alignItems:"center",...e&&{gap:r.v2.spacing(8)},height:f,flexShrink:0,overflow:"visible",padding:`${r.v2.spacing(8)} ${r.v2.spacing(12)}`,borderBottom:`1px solid ${r.v2.palette.grey[100]}`})),x=styled(j)(({theme:r})=>({flexGrow:1,minWidth:0,color:r.v2.palette.grey[900],textTransform:"capitalize"}));var H=forwardRef(({id:r,className:e,sx:d,children:s,...a},l)=>jsx(c,{ref:l,component:"article",id:r,"data-testid":r??"Card",...a,className:nc(o.root,e),sx:d,children:s}));H.displayName="Card";var v=memo(H);var g=forwardRef(({id:r,className:e,sx:d,children:s,startAdornment:a,endAdornment:l,...S},N)=>jsxs(y,{ref:N,component:"header",id:r,"data-testid":r??"CardHeader",...S,$hasStartAdornment:a!=null,className:nc(o.header,e),sx:d,children:[a,jsx(x,{component:"div",textVariant:"body.small.semibold",className:o.title,children:s}),l]}));g.displayName="CardHeader";var T=memo(g);export{o as a,v as b,T as c};
@@ -1 +1 @@
1
- import {mc,nc}from'./chunk-ZTZOHMJ3.js';import {forwardRef,useCallback,memo}from'react';import {jsxs,jsx}from'react/jsx-runtime';import {styled,alpha}from'@mui/material/styles';var n="os-shared-FilterChip",r={root:`${n}-root`,label:`${n}-label`,dismissButton:`${n}-dismissButton`,dismissIcon:`${n}-dismissIcon`},h=",",u="Dismiss filter";function y({className:t}){return jsxs("svg",{className:t,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":"true",children:[jsx("path",{d:"M1.79488 1.73941L6.31572 6.26024",stroke:"currentColor",strokeWidth:"0.875",strokeMiterlimit:"10",strokeLinecap:"round"}),jsx("path",{d:"M6.31572 1.73941L1.79488 6.26024",stroke:"currentColor",strokeWidth:"0.875",strokeMiterlimit:"10",strokeLinecap:"round"})]})}var S=styled("div",{shouldForwardProp:t=>!["$disabled"].includes(t)})(({theme:t,$disabled:e})=>{let{base:o}=t.v2.palette;return {display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",gap:t.v2.spacing(8),height:"32px",paddingInline:t.v2.spacing(16),minWidth:"8.4rem",maxWidth:"16rem",boxSizing:"border-box",background:"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)",color:o.white,borderRadius:t.v2.radius(48),...t.v2.typography.textVariants.body.small.regular,whiteSpace:"nowrap",overflow:"hidden",cursor:"default",opacity:e?.6:1}}),L=styled("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:"1 1 auto",textAlign:"center"}),I=styled("button",{shouldForwardProp:t=>t!=="$disabled"})(({theme:t,$disabled:e})=>{let{base:o}=t.v2.palette;return {display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:0,width:"16px",height:"16px",padding:0,border:"none",borderRadius:"50%",backgroundColor:alpha(o.black,.1),color:o.white,cursor:e?"not-allowed":"pointer",opacity:e?.6:1,transition:"opacity 150ms ease, background-color 150ms ease","&:hover":e?void 0:{backgroundColor:alpha(o.black,.2)},"&:focus-visible":{outline:`2px solid ${o.white}`,outlineOffset:"1px"},"& svg":{display:"block"}}});var E=forwardRef(({label:t,value:e,separator:o=h,visible:_=true,dismissible:k=true,onDismiss:p,dismissLabel:P=u,disabled:s=false,children:x,id:F,sx:R,className:w,slotProps:A,"data-testid":T},D)=>{let{label:d,dismissButton:i}=A??{},v=useCallback(m=>{m.stopPropagation(),!s&&(i?.onClick?.(m),p?.(m));},[s,i,p]);if(!_)return null;let c=t??(typeof e=="string"?e:e&&e.length>0?e.join(o):void 0);if(!c&&!x)return null;let N=k&&p!=null;return jsxs(S,{ref:D,id:F,"data-testid":T??F??"FilterChip",className:nc(r.root,w),sx:mc({},R),$disabled:s,role:"status",children:[c?jsx(L,{...d,className:nc(r.label,d?.className),sx:mc({},d?.sx),children:c}):x,N&&jsx(I,{...i,type:"button","aria-label":i?.["aria-label"]??P,disabled:s,onClick:v,className:nc(r.dismissButton,i?.className),sx:mc({},i?.sx),$disabled:s,children:jsx(y,{className:r.dismissIcon})})]})});E.displayName="FilterChip";var U=memo(E);export{r as a,h as b,u as c,U as d};
1
+ import {mc,nc}from'./chunk-4QNW7VH5.js';import {forwardRef,useCallback,memo}from'react';import {jsxs,jsx}from'react/jsx-runtime';import {styled,alpha}from'@mui/material/styles';var n="os-shared-FilterChip",r={root:`${n}-root`,label:`${n}-label`,dismissButton:`${n}-dismissButton`,dismissIcon:`${n}-dismissIcon`},h=",",u="Dismiss filter";function y({className:t}){return jsxs("svg",{className:t,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":"true",children:[jsx("path",{d:"M1.79488 1.73941L6.31572 6.26024",stroke:"currentColor",strokeWidth:"0.875",strokeMiterlimit:"10",strokeLinecap:"round"}),jsx("path",{d:"M6.31572 1.73941L1.79488 6.26024",stroke:"currentColor",strokeWidth:"0.875",strokeMiterlimit:"10",strokeLinecap:"round"})]})}var S=styled("div",{shouldForwardProp:t=>!["$disabled"].includes(t)})(({theme:t,$disabled:e})=>{let{base:o}=t.v2.palette;return {display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",gap:t.v2.spacing(8),height:"32px",paddingInline:t.v2.spacing(16),minWidth:"8.4rem",maxWidth:"16rem",boxSizing:"border-box",background:"linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)",color:o.white,borderRadius:t.v2.radius(48),...t.v2.typography.textVariants.body.small.regular,whiteSpace:"nowrap",overflow:"hidden",cursor:"default",opacity:e?.6:1}}),L=styled("span")({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:"1 1 auto",textAlign:"center"}),I=styled("button",{shouldForwardProp:t=>t!=="$disabled"})(({theme:t,$disabled:e})=>{let{base:o}=t.v2.palette;return {display:"inline-flex",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:0,width:"16px",height:"16px",padding:0,border:"none",borderRadius:"50%",backgroundColor:alpha(o.black,.1),color:o.white,cursor:e?"not-allowed":"pointer",opacity:e?.6:1,transition:"opacity 150ms ease, background-color 150ms ease","&:hover":e?void 0:{backgroundColor:alpha(o.black,.2)},"&:focus-visible":{outline:`2px solid ${o.white}`,outlineOffset:"1px"},"& svg":{display:"block"}}});var E=forwardRef(({label:t,value:e,separator:o=h,visible:_=true,dismissible:k=true,onDismiss:p,dismissLabel:P=u,disabled:s=false,children:x,id:F,sx:R,className:w,slotProps:A,"data-testid":T},D)=>{let{label:d,dismissButton:i}=A??{},v=useCallback(m=>{m.stopPropagation(),!s&&(i?.onClick?.(m),p?.(m));},[s,i,p]);if(!_)return null;let c=t??(typeof e=="string"?e:e&&e.length>0?e.join(o):void 0);if(!c&&!x)return null;let N=k&&p!=null;return jsxs(S,{ref:D,id:F,"data-testid":T??F??"FilterChip",className:nc(r.root,w),sx:mc({},R),$disabled:s,role:"status",children:[c?jsx(L,{...d,className:nc(r.label,d?.className),sx:mc({},d?.sx),children:c}):x,N&&jsx(I,{...i,type:"button","aria-label":i?.["aria-label"]??P,disabled:s,onClick:v,className:nc(r.dismissButton,i?.className),sx:mc({},i?.sx),$disabled:s,children:jsx(y,{className:r.dismissIcon})})]})});E.displayName="FilterChip";var U=memo(E);export{r as a,h as b,u as c,U as d};
@@ -1 +1 @@
1
- import {b}from'./chunk-YQKWAH6Y.js';import {V as V$1,f,l,R,v}from'./chunk-FEZOSRP2.js';import {o}from'./chunk-ECCMCTOM.js';import {yb}from'./chunk-RNBTIRD7.js';import {createContext,forwardRef,useMemo,useState,useRef,useCallback,useEffect,useImperativeHandle,useContext}from'react';import Re from'@mui/material/Stack';import ne from'@mui/material/Typography';import ie from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import {Stack}from'@mui/material';import it from'lodash/debounce';import j from'memoize-one';var Ue=(r=>(r.CHECKED="CHECKED",r.UNCHECKED="UNCHECKED",r.INDETERMINATE="INDETERMINATE",r))(Ue||{});styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})}));styled(ie)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"}));var F=styled(V$1)({minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,backgroundColor:"#fff","--menuitem-border-rad":"4px","&:hover":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),V=styled(e=>jsx(F,{startAdornment:null,...e}))(({theme:e})=>({fontSize:11,fontWeight:500,color:e.palette.grey[700],minHeight:36,maxHeight:"auto",cursor:"auto",":hover":{boxShadow:"none",zIndex:1}}));var _=createContext({treeMapper:{},handleSelect:()=>{},multiple:false}),Ve=({children:e,treeMapper:t,handleSelect:o,multiple:r,IconComponent:n})=>{let i=useMemo(()=>({treeMapper:t,handleSelect:o,multiple:r,IconComponent:n}),[t,o,r,n]);return jsx(_.Provider,{value:i,children:e})},re=Ve;var Ge=()=>{let e=useContext(_);if(!e)throw new Error("'useTreeDropdown' must be used within an 'TreeDropdownProvider'");return e},B=Ge;var ae=styled(f)({padding:0,paddingRight:"4px",width:"14px !important",".MuiSvgIcon-root":{width:"12px !important",height:"12px !important"}}),se=styled(l)({padding:0}),le=styled(ie)(()=>({display:"flex",gap:"8px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center",minWidth:0})),pe=styled(e=>jsx(ne,{noWrap:true,component:"span",...e}))(({theme:e})=>({flex:1,fontSize:"inherit",width:"100%",display:"inline-block",color:e.palette.text.primary})),de=styled(e=>jsx(ne,{noWrap:true,...e}))(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:8})),ce=styled(ie,{shouldForwardProp:e=>e!=="isOneDigit"})(({theme:e,isOneDigit:t=true})=>({borderRadius:t?"50%":"4px",background:e.palette.divider,width:t?13:"auto",height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px",...!t&&{padding:"0 3px"}})),ue=styled("img")(()=>({height:12}));var Je=e=>{let{checked:t,indeterminate:o,onSelect:r}=e,{multiple:n}=B(),i=useCallback(a=>{a.stopPropagation(),r(a);},[r]);return n?jsx(ae,{size:"small",checked:t,indeterminate:o,onChange:i}):jsx(se,{checked:t,onChange:i})},he=Je;var Ze=e=>{let{renderItem:t,header:o,footer:r,...n}=e,{treeMapper:i,handleSelect:a,multiple:c,IconComponent:p}=B(),{label:s,icon:d,iconComponent:l,levelIndex:h=0,children:f,nestedMenuSx:I,hintText:y,disableHovering:m,itemProps:T,searchProps:u,subLevelKey:E}=n,[x,N]=useState(null),w=!!f,H=f?.length,L=useCallback(R=>{m||N(R.currentTarget);},[m]),S=useCallback(()=>{m||N(null);},[m]);useEffect(()=>{m&&N(null);},[m]);let M=useMemo(()=>l||(d&&p?jsx(p,{fileId:d.fileId,width:d.width??20,height:d.height??20}):null),[l,d,p]),g=i[n.id]?.status==="CHECKED",k=c?i[n.id]?.status==="INDETERMINATE":false,O=c||!w,v=useCallback(R=>{R.stopPropagation(),a(R.target.checked,n);},[a,n]);return jsxs(F,{startAdornment:null,onMouseEnter:L,onMouseLeave:S,"data-testid":n.id,onClick:()=>{a(!g,n);},...T,children:[t?t({nodeProps:n,checked:g,indeterminate:k,onSelect:v}):jsxs(le,{width:"100%","data-testid":"Content",children:[O&&jsx(he,{checked:g,indeterminate:k,onSelect:v}),M,jsxs(Stack,{flex:1,width:"100%",minWidth:0,children:[jsx(pe,{title:typeof s=="string"?s:void 0,children:s}),y&&jsx(de,{title:typeof y=="string"?y:void 0,children:y})]}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[H&&jsx(ce,{isOneDigit:Math.floor(H/10)===0,children:H}),w&&jsx(ue,{src:yb,alt:"Expand"})]})]}),!!f&&jsx(U,{anchorEl:x,menuItems:f,levelIndex:h+1,sx:I,header:o,levelKey:E,footer:r,searchProps:u})]})},ge=Ze;var xe=ge;var Ce=styled(R)({maxHeight:"100%"}),ye=styled("div")({position:"relative","&:before, &:after":{display:"none"},"&.scrollable":{position:"relative","&::before, &::after":{display:"block",content:'""',position:"absolute",left:0,width:"100%",height:"20px",opacity:1,pointerEvents:"none",zIndex:2,transition:"opacity 0.3s ease-out"},"&::before":{top:0,background:"linear-gradient(to top, transparent, rgba(255, 255, 255, 1))"},"&::after":{bottom:0,background:"linear-gradient(to bottom, transparent, rgba(255, 255, 255, 1))"}},"&.scrolled-to-top":{"&::before":{opacity:0}},"&.scrolled-to-bottom":{"&::after":{opacity:0}}}),be=styled("ul")({listStyle:"none",padding:0,margin:0,maxHeight:300,overflow:"auto"});var rt=({children:e,onScroll:t})=>{let o$1=useRef(null),{scrolledToBottom:r,scrolledToTop:n,scrollable:i,handleScroll:a}=o({containerRef:o$1}),c=useMemo(()=>[r&&"scrolled-to-bottom",n&&"scrolled-to-top",i&&"scrollable"].filter(Boolean).join(" "),[r,n,i]),p=useCallback(s=>{t(s),a(s);},[t,a]);return jsx(ye,{sx:{position:"relative"},className:c,children:jsx(be,{ref:o$1,onScroll:p,children:e})})},Ne=rt;var at=e=>{let{initialValue:t="",getValues:o,filterItem:r,onChange:n,items:i,enabled:a=false,debounceMs:c=300}=e,[p,s]=useState(t),[d,l]=useState(t),h=useMemo(()=>it(m=>{l(m);},c),[c]);useEffect(()=>(h(p),()=>h.cancel()),[h,p]);let f=useCallback(m=>{let T=m.target.value;s(T),h(T),n?.(m);},[n,h]),I=useCallback(()=>{s(""),l(""),h.cancel(),n?.({target:{value:""}});},[n,h]),y=useMemo(()=>{if(!a||!d.trim())return i;let m=d.toLowerCase();return r?i.reduce((T,u)=>{let E=r(u,m);return E&&T.push(E),T},[]):o?i.filter(T=>o(T).some(u=>u.toLowerCase().includes(m))):(console.error("`searchProps.getValues` is required for searching, provide it on the tree node level or the global search props"),i)},[i,d,o,r,a]);return {searchText:p,filteredItems:y,handleSearch:f,handleReset:I}},ve=at;var ft=e=>{let{anchorEl:t,sx:o,levelIndex:r=0,placement:n,menuItems:i,header:a,footer:c,levelKey:p,searchProps:s}=e,[d,l]=useState(false),h=!!t,f=!!s,{searchText:I,filteredItems:y,handleSearch:m,handleReset:T}=ve({...s,enabled:f,items:i}),u=useRef(),E=useCallback(()=>{l(true),clearTimeout(u.current),u.current=setTimeout(()=>{l(false);},100);},[]);return useEffect(()=>()=>clearTimeout(u.current),[]),jsx(Ce,{open:h,anchorEl:t,placement:r>0?"right-start":n,"data-level":r,"data-level-key":p,onClick:x=>x.stopPropagation(),sx:{...o,"&.MuiPopper-dropdown":{"&:after":{display:"none"}}},children:jsxs(Re,{divider:jsx(v,{flexItem:true}),children:[a&&jsx(V,{children:a}),f&&jsxs(Re,{divider:jsx(v,{flexItem:true,sx:{my:1}}),children:[jsx(ie,{sx:{p:1},children:jsx(b,{id:`tree-search-input-${r}`,...s?.inputProps,placeholder:s?.inputProps?.placeholder??"Search...",onChange:m,value:I,inputProps:{autoComplete:"off"},onClear:T})}),y.length===0&&s?.noResultsText&&jsx(ne,{component:"div",fontSize:10,color:x=>alpha(x.palette.text.primary,.4),textAlign:"center",minHeight:36,fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",children:jsx("span",{children:"No results found"})})]}),jsx(Ne,{onScroll:E,children:y.map((x,N)=>jsx(xe,{disableHovering:d,...x,levelIndex:r,subLevelKey:x.levelKey,nestedMenuSx:o},`${r}-${x.id}-${N}`))}),c&&jsx(V,{children:c})]})})},U=ft;function ht(e){function t(o){let r=o.children?o.children.map(t):void 0;if(r?.length===1&&r[0].children?.length&&!r[0].disablePromotion){let n=r[0];r=n.children,o={...o,header:n.header??o.header,footer:n.footer??o.footer,searchProps:n.searchProps??o.searchProps};}return {...o,children:r}}return e.map(t)}function we(e,t,o=[]){for(let r of e)r.status==="CHECKED"&&o.push(r.id),r.children&&we(r.children,t,o);return o}function He(e,t=[],o={},r=false){for(let n of e){let i=r?"CHECKED":n.status??"UNCHECKED";o[n.id]={status:i,...t.length?{_parents:t}:{}},n.children&&He(n.children,[...t,n.id],o,i==="CHECKED");}return o}function Le(e,t){let o=He(e),r=we(e,t),n=o;for(let i of r)n=q(n,i,true);return n}function ke(e,t){return e.map(o=>({...o,status:t[o.id]?.status??"UNCHECKED",children:o.children?ke(o.children,t):void 0}))}function Tt(e){let t={};for(let o of Object.keys(e)){let r=e[o]._parents;if(!r?.length)continue;let n=r[r.length-1];t[n]??(t[n]=[]),t[n].push(o);}return t}function q(e,t,o){let r=structuredClone(e),n=Tt(e),i=o?"CHECKED":"UNCHECKED";function a(p){r[p].status=i;for(let s of n[p]??[])a(s);}function c(p){let s=r[p]._parents;if(!s?.length)return;let d=s[s.length-1],h=(n[d]??[]).map(f=>r[f].status);h.every(f=>f==="CHECKED")?r[d].status="CHECKED":h.every(f=>f==="UNCHECKED")?r[d].status="UNCHECKED":r[d].status="INDETERMINATE",c(d);}return a(t),c(t),r}function gt(e){function t(o){let r=o.children?.map(t).filter(Boolean);return o.status==="CHECKED"||o.status==="INDETERMINATE"||r&&r.length>0?{...o,children:r}:null}return e.map(t).filter(Boolean)}function De(e){let t={};for(let o in e)t[o]={status:"UNCHECKED",...e[o]._parents?{_parents:e[o]._parents}:{}};return t}function Ke(e,t,o,r){if(r)return q(e,t,o);if(!o)return De(e);let n=De(e);return q(n,t,true)}function xt(e,t){let o=[];function r(n){n.levelKey===t&&o.push(n),n.children?.forEach(i=>r(i));}return e.forEach(r),o}var C={denormalizeTree:j((e,t)=>ke(e,t)),extractSelectedBranches:j(e=>gt(e)),filterNodesByLevelKey:j((e,t)=>xt(e,t))};function J(e){let t=ht(e.children??[]);if(t.length===1&&t[0].children?.length&&!t[0].disablePromotion){let[o]=t;return J({levelKey:o.levelKey,children:o.children,header:o.header??e.header,footer:o.footer??e.footer,searchProps:o.searchProps??e.searchProps})}return {...e,children:t}}var It=forwardRef((e,t)=>{let{anchorEl:o,placement:r="bottom-start",treeDefinition:n,sx:i,onChange:a,multiple:c=true,exposeOnlySelectedTree:p=false,IconComponent:s,onMounted:d}=e,{children:l=[]}=n,h=useMemo(()=>J(n),[n]),{header:f,footer:I,children:y=[],searchProps:m,levelKey:T}=h,[u,E]=useState({}),x=useRef(d);x.current=d;let N=useCallback(()=>C.denormalizeTree(l,u),[l,u]),w=useCallback(()=>C.extractSelectedBranches(N()),[N]),H=useCallback((S,M)=>{let g=Ke(u,M.id,S,c);E(g),a&&a(p?C.extractSelectedBranches(C.denormalizeTree(l,g)):C.denormalizeTree(l,g));},[a,l,u,c,p]),L=useCallback(S=>{let g=((k,O)=>{let v={...k};return Object.keys(v).forEach(R=>{v[R]={...v[R],status:O?"CHECKED":"UNCHECKED"};}),v})(u,S);E(g),a&&a(p?C.extractSelectedBranches(C.denormalizeTree(l,g)):C.denormalizeTree(l,g));},[u,a,l,p]);return useEffect(()=>{let S=Le(l||[],c);E(S);let M=C.denormalizeTree(l,S),g=C.extractSelectedBranches(M);x.current?.({state:S,tree:M,selectedTree:g});},[l,c]),useImperativeHandle(t,()=>({treeMapper:u,getFullTree:N,getSelectedTree:w,toggleAll:L}),[u,N,w,L]),jsx(re,{treeMapper:u,IconComponent:s,handleSelect:H,multiple:c,children:jsx(U,{anchorEl:o,sx:i,header:f,footer:I,menuItems:y,levelKey:T,searchProps:m,placement:r})})}),ze=It;var Xo=ze;export{Ue as a,C as b,Xo as c};
1
+ import {b}from'./chunk-VPHTGRAH.js';import {V as V$1,f,l,R,v}from'./chunk-WAIH2SQK.js';import {o}from'./chunk-M3UPFS34.js';import {yb}from'./chunk-ZTNJXPMT.js';import {createContext,forwardRef,useMemo,useState,useRef,useCallback,useEffect,useImperativeHandle,useContext}from'react';import Re from'@mui/material/Stack';import ne from'@mui/material/Typography';import ie from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import {Stack}from'@mui/material';import it from'lodash/debounce';import j from'memoize-one';var Ue=(r=>(r.CHECKED="CHECKED",r.UNCHECKED="UNCHECKED",r.INDETERMINATE="INDETERMINATE",r))(Ue||{});styled("img",{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:t})=>({transform:t?"rotate(180deg)":"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})}));styled(ie)(()=>({display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"4px",borderTop:"1px solid #F2F2F2"}));var F=styled(V$1)({minWidth:120,minHeight:36,maxHeight:36,paddingTop:0,paddingBottom:0,backgroundColor:"#fff","--menuitem-border-rad":"4px","&:hover":{boxShadow:"0px 0px 16px rgba(0, 0, 0, 0.13)",zIndex:1}}),V=styled(e=>jsx(F,{startAdornment:null,...e}))(({theme:e})=>({fontSize:11,fontWeight:500,color:e.palette.grey[700],minHeight:36,maxHeight:"auto",cursor:"auto",":hover":{boxShadow:"none",zIndex:1}}));var _=createContext({treeMapper:{},handleSelect:()=>{},multiple:false}),Ve=({children:e,treeMapper:t,handleSelect:o,multiple:r,IconComponent:n})=>{let i=useMemo(()=>({treeMapper:t,handleSelect:o,multiple:r,IconComponent:n}),[t,o,r,n]);return jsx(_.Provider,{value:i,children:e})},re=Ve;var Ge=()=>{let e=useContext(_);if(!e)throw new Error("'useTreeDropdown' must be used within an 'TreeDropdownProvider'");return e},B=Ge;var ae=styled(f)({padding:0,paddingRight:"4px",width:"14px !important",".MuiSvgIcon-root":{width:"12px !important",height:"12px !important"}}),se=styled(l)({padding:0}),le=styled(ie)(()=>({display:"flex",gap:"8px",justifyContent:"space-between",flexGrow:1,width:"100%",alignItems:"center",minWidth:0})),pe=styled(e=>jsx(ne,{noWrap:true,component:"span",...e}))(({theme:e})=>({flex:1,fontSize:"inherit",width:"100%",display:"inline-block",color:e.palette.text.primary})),de=styled(e=>jsx(ne,{noWrap:true,...e}))(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:8})),ce=styled(ie,{shouldForwardProp:e=>e!=="isOneDigit"})(({theme:e,isOneDigit:t=true})=>({borderRadius:t?"50%":"4px",background:e.palette.divider,width:t?13:"auto",height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px",...!t&&{padding:"0 3px"}})),ue=styled("img")(()=>({height:12}));var Je=e=>{let{checked:t,indeterminate:o,onSelect:r}=e,{multiple:n}=B(),i=useCallback(a=>{a.stopPropagation(),r(a);},[r]);return n?jsx(ae,{size:"small",checked:t,indeterminate:o,onChange:i}):jsx(se,{checked:t,onChange:i})},he=Je;var Ze=e=>{let{renderItem:t,header:o,footer:r,...n}=e,{treeMapper:i,handleSelect:a,multiple:c,IconComponent:p}=B(),{label:s,icon:d,iconComponent:l,levelIndex:h=0,children:f,nestedMenuSx:I,hintText:y,disableHovering:m,itemProps:T,searchProps:u,subLevelKey:E}=n,[x,N]=useState(null),w=!!f,H=f?.length,L=useCallback(R=>{m||N(R.currentTarget);},[m]),S=useCallback(()=>{m||N(null);},[m]);useEffect(()=>{m&&N(null);},[m]);let M=useMemo(()=>l||(d&&p?jsx(p,{fileId:d.fileId,width:d.width??20,height:d.height??20}):null),[l,d,p]),g=i[n.id]?.status==="CHECKED",k=c?i[n.id]?.status==="INDETERMINATE":false,O=c||!w,v=useCallback(R=>{R.stopPropagation(),a(R.target.checked,n);},[a,n]);return jsxs(F,{startAdornment:null,onMouseEnter:L,onMouseLeave:S,"data-testid":n.id,onClick:()=>{a(!g,n);},...T,children:[t?t({nodeProps:n,checked:g,indeterminate:k,onSelect:v}):jsxs(le,{width:"100%","data-testid":"Content",children:[O&&jsx(he,{checked:g,indeterminate:k,onSelect:v}),M,jsxs(Stack,{flex:1,width:"100%",minWidth:0,children:[jsx(pe,{title:typeof s=="string"?s:void 0,children:s}),y&&jsx(de,{title:typeof y=="string"?y:void 0,children:y})]}),jsxs(Stack,{direction:"row",alignItems:"center",spacing:.5,children:[H&&jsx(ce,{isOneDigit:Math.floor(H/10)===0,children:H}),w&&jsx(ue,{src:yb,alt:"Expand"})]})]}),!!f&&jsx(U,{anchorEl:x,menuItems:f,levelIndex:h+1,sx:I,header:o,levelKey:E,footer:r,searchProps:u})]})},ge=Ze;var xe=ge;var Ce=styled(R)({maxHeight:"100%"}),ye=styled("div")({position:"relative","&:before, &:after":{display:"none"},"&.scrollable":{position:"relative","&::before, &::after":{display:"block",content:'""',position:"absolute",left:0,width:"100%",height:"20px",opacity:1,pointerEvents:"none",zIndex:2,transition:"opacity 0.3s ease-out"},"&::before":{top:0,background:"linear-gradient(to top, transparent, rgba(255, 255, 255, 1))"},"&::after":{bottom:0,background:"linear-gradient(to bottom, transparent, rgba(255, 255, 255, 1))"}},"&.scrolled-to-top":{"&::before":{opacity:0}},"&.scrolled-to-bottom":{"&::after":{opacity:0}}}),be=styled("ul")({listStyle:"none",padding:0,margin:0,maxHeight:300,overflow:"auto"});var rt=({children:e,onScroll:t})=>{let o$1=useRef(null),{scrolledToBottom:r,scrolledToTop:n,scrollable:i,handleScroll:a}=o({containerRef:o$1}),c=useMemo(()=>[r&&"scrolled-to-bottom",n&&"scrolled-to-top",i&&"scrollable"].filter(Boolean).join(" "),[r,n,i]),p=useCallback(s=>{t(s),a(s);},[t,a]);return jsx(ye,{sx:{position:"relative"},className:c,children:jsx(be,{ref:o$1,onScroll:p,children:e})})},Ne=rt;var at=e=>{let{initialValue:t="",getValues:o,filterItem:r,onChange:n,items:i,enabled:a=false,debounceMs:c=300}=e,[p,s]=useState(t),[d,l]=useState(t),h=useMemo(()=>it(m=>{l(m);},c),[c]);useEffect(()=>(h(p),()=>h.cancel()),[h,p]);let f=useCallback(m=>{let T=m.target.value;s(T),h(T),n?.(m);},[n,h]),I=useCallback(()=>{s(""),l(""),h.cancel(),n?.({target:{value:""}});},[n,h]),y=useMemo(()=>{if(!a||!d.trim())return i;let m=d.toLowerCase();return r?i.reduce((T,u)=>{let E=r(u,m);return E&&T.push(E),T},[]):o?i.filter(T=>o(T).some(u=>u.toLowerCase().includes(m))):(console.error("`searchProps.getValues` is required for searching, provide it on the tree node level or the global search props"),i)},[i,d,o,r,a]);return {searchText:p,filteredItems:y,handleSearch:f,handleReset:I}},ve=at;var ft=e=>{let{anchorEl:t,sx:o,levelIndex:r=0,placement:n,menuItems:i,header:a,footer:c,levelKey:p,searchProps:s}=e,[d,l]=useState(false),h=!!t,f=!!s,{searchText:I,filteredItems:y,handleSearch:m,handleReset:T}=ve({...s,enabled:f,items:i}),u=useRef(),E=useCallback(()=>{l(true),clearTimeout(u.current),u.current=setTimeout(()=>{l(false);},100);},[]);return useEffect(()=>()=>clearTimeout(u.current),[]),jsx(Ce,{open:h,anchorEl:t,placement:r>0?"right-start":n,"data-level":r,"data-level-key":p,onClick:x=>x.stopPropagation(),sx:{...o,"&.MuiPopper-dropdown":{"&:after":{display:"none"}}},children:jsxs(Re,{divider:jsx(v,{flexItem:true}),children:[a&&jsx(V,{children:a}),f&&jsxs(Re,{divider:jsx(v,{flexItem:true,sx:{my:1}}),children:[jsx(ie,{sx:{p:1},children:jsx(b,{id:`tree-search-input-${r}`,...s?.inputProps,placeholder:s?.inputProps?.placeholder??"Search...",onChange:m,value:I,inputProps:{autoComplete:"off"},onClear:T})}),y.length===0&&s?.noResultsText&&jsx(ne,{component:"div",fontSize:10,color:x=>alpha(x.palette.text.primary,.4),textAlign:"center",minHeight:36,fontWeight:500,display:"flex",alignItems:"center",justifyContent:"center",children:jsx("span",{children:"No results found"})})]}),jsx(Ne,{onScroll:E,children:y.map((x,N)=>jsx(xe,{disableHovering:d,...x,levelIndex:r,subLevelKey:x.levelKey,nestedMenuSx:o},`${r}-${x.id}-${N}`))}),c&&jsx(V,{children:c})]})})},U=ft;function ht(e){function t(o){let r=o.children?o.children.map(t):void 0;if(r?.length===1&&r[0].children?.length&&!r[0].disablePromotion){let n=r[0];r=n.children,o={...o,header:n.header??o.header,footer:n.footer??o.footer,searchProps:n.searchProps??o.searchProps};}return {...o,children:r}}return e.map(t)}function we(e,t,o=[]){for(let r of e)r.status==="CHECKED"&&o.push(r.id),r.children&&we(r.children,t,o);return o}function He(e,t=[],o={},r=false){for(let n of e){let i=r?"CHECKED":n.status??"UNCHECKED";o[n.id]={status:i,...t.length?{_parents:t}:{}},n.children&&He(n.children,[...t,n.id],o,i==="CHECKED");}return o}function Le(e,t){let o=He(e),r=we(e,t),n=o;for(let i of r)n=q(n,i,true);return n}function ke(e,t){return e.map(o=>({...o,status:t[o.id]?.status??"UNCHECKED",children:o.children?ke(o.children,t):void 0}))}function Tt(e){let t={};for(let o of Object.keys(e)){let r=e[o]._parents;if(!r?.length)continue;let n=r[r.length-1];t[n]??(t[n]=[]),t[n].push(o);}return t}function q(e,t,o){let r=structuredClone(e),n=Tt(e),i=o?"CHECKED":"UNCHECKED";function a(p){r[p].status=i;for(let s of n[p]??[])a(s);}function c(p){let s=r[p]._parents;if(!s?.length)return;let d=s[s.length-1],h=(n[d]??[]).map(f=>r[f].status);h.every(f=>f==="CHECKED")?r[d].status="CHECKED":h.every(f=>f==="UNCHECKED")?r[d].status="UNCHECKED":r[d].status="INDETERMINATE",c(d);}return a(t),c(t),r}function gt(e){function t(o){let r=o.children?.map(t).filter(Boolean);return o.status==="CHECKED"||o.status==="INDETERMINATE"||r&&r.length>0?{...o,children:r}:null}return e.map(t).filter(Boolean)}function De(e){let t={};for(let o in e)t[o]={status:"UNCHECKED",...e[o]._parents?{_parents:e[o]._parents}:{}};return t}function Ke(e,t,o,r){if(r)return q(e,t,o);if(!o)return De(e);let n=De(e);return q(n,t,true)}function xt(e,t){let o=[];function r(n){n.levelKey===t&&o.push(n),n.children?.forEach(i=>r(i));}return e.forEach(r),o}var C={denormalizeTree:j((e,t)=>ke(e,t)),extractSelectedBranches:j(e=>gt(e)),filterNodesByLevelKey:j((e,t)=>xt(e,t))};function J(e){let t=ht(e.children??[]);if(t.length===1&&t[0].children?.length&&!t[0].disablePromotion){let[o]=t;return J({levelKey:o.levelKey,children:o.children,header:o.header??e.header,footer:o.footer??e.footer,searchProps:o.searchProps??e.searchProps})}return {...e,children:t}}var It=forwardRef((e,t)=>{let{anchorEl:o,placement:r="bottom-start",treeDefinition:n,sx:i,onChange:a,multiple:c=true,exposeOnlySelectedTree:p=false,IconComponent:s,onMounted:d}=e,{children:l=[]}=n,h=useMemo(()=>J(n),[n]),{header:f,footer:I,children:y=[],searchProps:m,levelKey:T}=h,[u,E]=useState({}),x=useRef(d);x.current=d;let N=useCallback(()=>C.denormalizeTree(l,u),[l,u]),w=useCallback(()=>C.extractSelectedBranches(N()),[N]),H=useCallback((S,M)=>{let g=Ke(u,M.id,S,c);E(g),a&&a(p?C.extractSelectedBranches(C.denormalizeTree(l,g)):C.denormalizeTree(l,g));},[a,l,u,c,p]),L=useCallback(S=>{let g=((k,O)=>{let v={...k};return Object.keys(v).forEach(R=>{v[R]={...v[R],status:O?"CHECKED":"UNCHECKED"};}),v})(u,S);E(g),a&&a(p?C.extractSelectedBranches(C.denormalizeTree(l,g)):C.denormalizeTree(l,g));},[u,a,l,p]);return useEffect(()=>{let S=Le(l||[],c);E(S);let M=C.denormalizeTree(l,S),g=C.extractSelectedBranches(M);x.current?.({state:S,tree:M,selectedTree:g});},[l,c]),useImperativeHandle(t,()=>({treeMapper:u,getFullTree:N,getSelectedTree:w,toggleAll:L}),[u,N,w,L]),jsx(re,{treeMapper:u,IconComponent:s,handleSelect:H,multiple:c,children:jsx(U,{anchorEl:o,sx:i,header:f,footer:I,menuItems:y,levelKey:T,searchProps:m,placement:r})})}),ze=It;var Xo=ze;export{Ue as a,C as b,Xo as c};
@@ -1 +1 @@
1
- import {nc}from'./chunk-ZTZOHMJ3.js';import {Sh}from'./chunk-RNBTIRD7.js';import {forwardRef,memo}from'react';import h from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var o="os-shared-EmptyState",t={root:`${o}-root`,icon:`${o}-icon`,title:`${o}-title`,description:`${o}-description`},l="Empty state",n="No data found",y="There is nothing to show here yet.";var c=styled(h)(()=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"0.5rem"})),S=styled("img")(()=>({width:"2rem",height:"2rem"})),d=styled("h1")(({theme:e})=>({fontWeight:600,fontSize:"1rem",color:e.palette.text?.primary,padding:0,margin:0,textAlign:"center"})),f=styled("p")(({theme:e})=>({fontWeight:400,fontSize:"0.75rem",color:e.palette.text?.primary,padding:0,margin:0,opacity:.5,textAlign:"center"}));var T=jsx(S,{src:Sh,alt:l,className:t.icon}),x=forwardRef(({className:e,sx:E,icon:g=T,title:m=n,description:r=y,children:N,...u},D)=>jsxs(c,{ref:D,className:nc(t.root,e),sx:E,"data-testid":"EmptyState",...u,children:[g,m?jsx(d,{className:t.title,children:m}):null,r?jsx(f,{className:t.description,children:r}):null,N]}));x.displayName="EmptyState";var A=memo(x);export{t as a,A as b};
1
+ import {nc}from'./chunk-4QNW7VH5.js';import {Sh}from'./chunk-ZTNJXPMT.js';import {forwardRef,memo}from'react';import h from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var o="os-shared-EmptyState",t={root:`${o}-root`,icon:`${o}-icon`,title:`${o}-title`,description:`${o}-description`},l="Empty state",n="No data found",y="There is nothing to show here yet.";var c=styled(h)(()=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"0.5rem"})),S=styled("img")(()=>({width:"2rem",height:"2rem"})),d=styled("h1")(({theme:e})=>({fontWeight:600,fontSize:"1rem",color:e.palette.text?.primary,padding:0,margin:0,textAlign:"center"})),f=styled("p")(({theme:e})=>({fontWeight:400,fontSize:"0.75rem",color:e.palette.text?.primary,padding:0,margin:0,opacity:.5,textAlign:"center"}));var T=jsx(S,{src:Sh,alt:l,className:t.icon}),x=forwardRef(({className:e,sx:E,icon:g=T,title:m=n,description:r=y,children:N,...u},D)=>jsxs(c,{ref:D,className:nc(t.root,e),sx:E,"data-testid":"EmptyState",...u,children:[g,m?jsx(d,{className:t.title,children:m}):null,r?jsx(f,{className:t.description,children:r}):null,N]}));x.displayName="EmptyState";var A=memo(x);export{t as a,A as b};
@@ -1 +1 @@
1
- import {d,r as r$1}from'./chunk-FEZOSRP2.js';import {mc,nc}from'./chunk-ZTZOHMJ3.js';import {Td,Ye}from'./chunk-RNBTIRD7.js';import {forwardRef,useMemo,memo}from'react';import {styled}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var N="os-shared-Logo",r={root:`${N}-root`,skeleton:`${N}-skeleton`},C="logo";var I=styled(d)(({theme:n})=>({borderRadius:"50%",backgroundColor:n.palette.common.white}));var R=forwardRef(({className:n,sx:f,id:s,src:o,width:g=24,height:l=24,isError:e,isLoading:S,fallback:t,alt:P=C},U)=>{let m=useMemo(()=>typeof o!="string"&&!!o?.type?.includes("application/pdf"),[o]),d=useMemo(()=>o?typeof o=="string"?o:(window.URL?URL:webkitURL).createObjectURL(o):"",[o]),w=useMemo(()=>e||!o?typeof t=="string"&&t?t:Td:m?Ye:d,[o,t,e,m,d]);return S?jsx(r$1,{variant:"circular",className:r.skeleton,sx:mc({width:g,height:l,flexShrink:0},f),"data-testid":s??"Logo"}):(e||!o)&&t!==void 0&&typeof t!="string"?jsx(Fragment,{children:t}):jsx(I,{ref:U,id:s,"data-testid":s??"Logo",alt:P,src:w,className:nc(r.root,n),sx:mc({width:g,height:l,objectFit:m&&o&&!e?"none":"contain"},f)})});R.displayName="Logo";var D=memo(R);export{r as a,D as b};
1
+ import {d,r as r$1}from'./chunk-WAIH2SQK.js';import {mc,nc}from'./chunk-4QNW7VH5.js';import {Td,Ye}from'./chunk-ZTNJXPMT.js';import {forwardRef,useMemo,memo}from'react';import {styled}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var N="os-shared-Logo",r={root:`${N}-root`,skeleton:`${N}-skeleton`},C="logo";var I=styled(d)(({theme:n})=>({borderRadius:"50%",backgroundColor:n.palette.common.white}));var R=forwardRef(({className:n,sx:f,id:s,src:o,width:g=24,height:l=24,isError:e,isLoading:S,fallback:t,alt:P=C},U)=>{let m=useMemo(()=>typeof o!="string"&&!!o?.type?.includes("application/pdf"),[o]),d=useMemo(()=>o?typeof o=="string"?o:(window.URL?URL:webkitURL).createObjectURL(o):"",[o]),w=useMemo(()=>e||!o?typeof t=="string"&&t?t:Td:m?Ye:d,[o,t,e,m,d]);return S?jsx(r$1,{variant:"circular",className:r.skeleton,sx:mc({width:g,height:l,flexShrink:0},f),"data-testid":s??"Logo"}):(e||!o)&&t!==void 0&&typeof t!="string"?jsx(Fragment,{children:t}):jsx(I,{ref:U,id:s,"data-testid":s??"Logo",alt:P,src:w,className:nc(r.root,n),sx:mc({width:g,height:l,objectFit:m&&o&&!e?"none":"contain"},f)})});R.displayName="Logo";var D=memo(R);export{r as a,D as b};
@@ -1 +1 @@
1
- import {Bc}from'./chunk-ZTZOHMJ3.js';import {useId,useState,useRef,useCallback,useMemo,useEffect,useLayoutEffect}from'react';import {motion,AnimatePresence,useMotionValue,animate}from'framer-motion';import zt from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=3,ft=styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:0,minWidth:0,height:"auto",lineHeight:1,position:"relative",zIndex:1001,fontSize:"12px",color:t.palette.text.primary})),ht=styled(motion.div)(()=>({display:"inline-flex"})),ut=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),gt=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),tt=styled(motion.div)(({side:t})=>({position:"absolute",display:"flex",alignItems:"center",...t==="left"?{right:"100%",flexDirection:"row-reverse",transformOrigin:"right center"}:{},...t==="right"?{left:"100%",flexDirection:"row",transformOrigin:"left center"}:{},top:"50%",transform:"translateY(-50%)",gap:0,pointerEvents:"auto",overflow:"visible"})),et=styled("div")(({side:t})=>({position:"absolute",top:0,bottom:0,...t==="left"?{right:"100%"}:{left:"100%"},pointerEvents:"auto",background:"transparent"})),xt=styled(motion.div)(()=>({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:24,overflow:"visible"})),j=t=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,fontSize:12,boxSizing:"border-box",whiteSpace:"nowrap",overflow:"visible"}),mt=styled(motion.div)(({theme:t})=>({...j(t),position:"relative",zIndex:2,minWidth:24,flex:"0 0 auto",display:"inline-flex",overflow:"hidden",willChange:"transform"})),Ct=styled(motion.span)(()=>({display:"inline-flex",alignItems:"center",transform:"translateZ(0)"})),nt=styled(motion.span)(({theme:t})=>({display:"inline-flex",whiteSpace:"nowrap",overflow:"hidden",boxSizing:"border-box",willChange:"width",border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,height:"24px",alignItems:"center",paddingInline:"0px"})),it=styled(motion.span)(()=>({display:"inline-flex",whiteSpace:"nowrap",alignItems:"center",height:"100%"})),yt=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",left:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),Et=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",right:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),rt=styled(motion.div)(({theme:t})=>({...j(t),minWidth:24,flex:"0 0 auto",display:"inline-flex"})),vt=styled(zt)(()=>({position:"relative",overflow:"visible",zIndex:101,display:"flex",alignItems:"center",justifyContent:"center",minHeight:"20px"}));var L=24;function Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}){let[l,P]=useState(false),[r,q]=useState({left:0,right:0}),[c,G]=useState([]),[d,X]=useState([]),[f,J]=useState(0),[b,Y]=useState(0),m=useRef(null),k=useRef(null),z=useRef(null),M=useRef(null),A=useRef([]),O=useRef([]),T=useRef(null),$=useRef(null),I=useRef(null),w=useCallback((e,i)=>{if(e===i)return true;if(e.length!==i.length)return false;for(let a=0;a<e.length;a++)if(e[a]!==i[a])return false;return true},[]),D=useCallback((e,i)=>e.left===i.left&&e.right===i.right,[]),g=useMotionValue(0),n=useMotionValue(0),N=useMotionValue(0),C=useMemo(()=>{if(!c.length)return [];let e=[],i=x+c[0]/2;e.push(i);for(let a=1;a<c.length;a++)i+=c[a-1]/2+x+c[a]/2,e.push(i);return e},[c]),y=useMemo(()=>{if(!d.length)return [];let e=[],i=x+d[0]/2;e.push(i);for(let a=1;a<d.length;a++)i+=d[a-1]/2+x+d[a]/2,e.push(i);return e},[d]),Lt=l&&h?f:0,K=l&&u?b:0,at=h?f:0,Wt=useCallback(()=>{m.current&&clearTimeout(m.current),P(true);},[]),St=useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>P(false),120);},[]),_=useCallback(()=>{let e=k.current,i=M.current,a=z.current,Q=r;if(e){let R=e.getBoundingClientRect(),Z=(i??a)?.getBoundingClientRect();if(Z){let Pt=Math.round(Z.left-R.left),kt=Math.round(Z.right-R.left);Q={left:Pt,right:kt};}}let st=A.current.map(R=>R?R.offsetWidth:L),lt=O.current.map(R=>R?R.offsetWidth:L),pt=T.current?.scrollWidth??0,ct=$.current?.scrollWidth??0;D(r,Q)||q(Q),w(c,st)||G(st),w(d,lt)||X(lt),f!==pt&&J(pt),b!==ct&&Y(ct);},[r,c,d,f,b,D,w]),B=useCallback(()=>{I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{_();});},[_]);useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),useLayoutEffect(()=>{_();},[H,t,v,h,u,_]),useEffect(()=>(B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B),I.current&&cancelAnimationFrame(I.current);}),[B]),useEffect(()=>{let i=animate(g,l&&h?f:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,h,f,g]),useEffect(()=>{let i=animate(n,l&&u?b:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,u,b,n]);let wt=useMemo(()=>{if(!C.length)return 0;let e=C.length-1,i=c[e]??L;return C[e]+i/2+K+x},[C,c,K]),Ht=useMemo(()=>{if(!y.length)return 0;let e=y.length-1,i=d[e]??L;return at+y[e]+i/2+x},[y,d,at]);return {isHovering:l,handleMouseEnter:Wt,handleMouseLeave:St,centerWrapRef:k,centerContentRef:z,centerChipRef:M,anchors:r,leftChipRefs:A,rightChipRefs:O,leftOffsets:C,rightOffsets:y,expandableRightInnerRef:T,expandableLeftInnerRef:$,expandableRightWidth:f,expandableLeftWidth:b,expandedRightMV:g,expandedLeftMV:n,shiftX:N,rightShift:Lt,leftShift:K,leftHoverWidth:wt,rightHoverWidth:Ht}}function Ot({leftIcons:t=[],rightIcons:v=[],centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u,expandedZIndex:l=1e3,...P}){let{isHovering:r,handleMouseEnter:q,handleMouseLeave:c,centerWrapRef:G,centerContentRef:d,centerChipRef:X,anchors:f,leftChipRefs:J,rightChipRefs:b,leftOffsets:Y,rightOffsets:m,expandableRightInnerRef:k,expandableLeftInnerRef:z,expandedRightMV:M,expandedLeftMV:A,shiftX:O,rightShift:T,leftShift:$,leftHoverWidth:I,rightHoverWidth:w}=Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}),D=Bc(useId(),"right-left-expanding-center-chip");return jsx(vt,{...P,id:D,"data-testid":"RightLeftExpandingCenterChipBox",children:jsx(ht,{"data-testid":"CenterShiftWrapper",initial:false,style:{x:O},children:jsxs(ft,{"data-testid":"CenterIconWrapper",ref:G,onMouseLeave:c,children:[jsxs(xt,{"data-testid":"PeekContainer",children:[jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(yt,{"data-testid":"LeftPeekChip",initial:{opacity:0,scale:.95,x:-4},animate:r?{opacity:0,scale:.9,x:-6}:{opacity:1,scale:1,x:-5},exit:{opacity:0,scale:.95,x:-4},transition:{duration:.18,ease:"easeOut"}},"left-peek")}),jsx(mt,{"data-testid":"CenterChip",ref:X,onMouseEnter:q,style:{borderRadius:(()=>{let g=u&&r,n=h&&r;return g&&n?"0":g?"0 12px 12px 0":n?"12px 0 0 12px":"12px"})(),borderLeft:u&&r?"none":void 0,borderRight:h&&r?"none":void 0},children:jsx(Ct,{"data-testid":"CenterContent",ref:d,children:H})}),u&&jsx(nt,{"data-testid":"ExpandableLeftContainer",style:{width:A,position:"absolute",right:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"12px 0 0 12px",borderRight:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableLeftInner",ref:z,children:u})}),h&&jsx(nt,{"data-testid":"ExpandableRightContainer",style:{width:M,position:"absolute",left:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"0 12px 12px 0",borderLeft:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableRightInner",ref:k,children:h})}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(Et,{"data-testid":"RightPeekChip",initial:{opacity:0,scale:.95,x:4},animate:r?{opacity:0,scale:.9,x:6}:{opacity:1,scale:1,x:5},exit:{opacity:0,scale:.95,x:4},transition:{duration:.18,ease:"easeOut"}},"right-peek")})]}),r&&t.length>0&&jsx(et,{"data-testid":"LeftHoverBridge",side:"left",style:{width:I,right:`calc(100% - ${f.left}px)`,zIndex:l,pointerEvents:"auto"}}),r&&v.length>0&&jsx(et,{"data-testid":"RightHoverBridge",side:"right",style:{width:w,left:`${f.right}px`,zIndex:l,pointerEvents:"auto"}}),jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(tt,{"data-testid":"LeftExpandedSection",side:"left",style:{right:`calc(100% - ${f.left}px)`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:t.map((g,n)=>{let C=(Y[n]??(L+x)*(n+1))+$;return jsx(ut,{"data-testid":`LeftExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:-C}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(t.length-n)},children:jsx(rt,{"data-testid":`LeftExpandChip-${n}`,ref:y=>J.current[n]=y,children:g})},`left-${n}`)})},"left-expanded")}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(tt,{"data-testid":"RightExpandedSection",side:"right",style:{left:`${f.right}px`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:v.map((g,n)=>{let N=m[n]??(L+x)*(n+1),C=T;return jsx(gt,{"data-testid":`RightExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:C+N}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(v.length-n)},children:jsx(rt,{"data-testid":`RightExpandChip-${n}`,ref:y=>b.current[n]=y,children:g})},`right-${n}`)})},"right-expanded")})]})})})}var Tt=Ot;export{Tt as a};
1
+ import {Bc}from'./chunk-4QNW7VH5.js';import {useId,useState,useRef,useCallback,useMemo,useEffect,useLayoutEffect}from'react';import {motion,AnimatePresence,useMotionValue,animate}from'framer-motion';import zt from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=3,ft=styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:0,minWidth:0,height:"auto",lineHeight:1,position:"relative",zIndex:1001,fontSize:"12px",color:t.palette.text.primary})),ht=styled(motion.div)(()=>({display:"inline-flex"})),ut=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),gt=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),tt=styled(motion.div)(({side:t})=>({position:"absolute",display:"flex",alignItems:"center",...t==="left"?{right:"100%",flexDirection:"row-reverse",transformOrigin:"right center"}:{},...t==="right"?{left:"100%",flexDirection:"row",transformOrigin:"left center"}:{},top:"50%",transform:"translateY(-50%)",gap:0,pointerEvents:"auto",overflow:"visible"})),et=styled("div")(({side:t})=>({position:"absolute",top:0,bottom:0,...t==="left"?{right:"100%"}:{left:"100%"},pointerEvents:"auto",background:"transparent"})),xt=styled(motion.div)(()=>({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:24,overflow:"visible"})),j=t=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,fontSize:12,boxSizing:"border-box",whiteSpace:"nowrap",overflow:"visible"}),mt=styled(motion.div)(({theme:t})=>({...j(t),position:"relative",zIndex:2,minWidth:24,flex:"0 0 auto",display:"inline-flex",overflow:"hidden",willChange:"transform"})),Ct=styled(motion.span)(()=>({display:"inline-flex",alignItems:"center",transform:"translateZ(0)"})),nt=styled(motion.span)(({theme:t})=>({display:"inline-flex",whiteSpace:"nowrap",overflow:"hidden",boxSizing:"border-box",willChange:"width",border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,height:"24px",alignItems:"center",paddingInline:"0px"})),it=styled(motion.span)(()=>({display:"inline-flex",whiteSpace:"nowrap",alignItems:"center",height:"100%"})),yt=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",left:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),Et=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",right:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),rt=styled(motion.div)(({theme:t})=>({...j(t),minWidth:24,flex:"0 0 auto",display:"inline-flex"})),vt=styled(zt)(()=>({position:"relative",overflow:"visible",zIndex:101,display:"flex",alignItems:"center",justifyContent:"center",minHeight:"20px"}));var L=24;function Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}){let[l,P]=useState(false),[r,q]=useState({left:0,right:0}),[c,G]=useState([]),[d,X]=useState([]),[f,J]=useState(0),[b,Y]=useState(0),m=useRef(null),k=useRef(null),z=useRef(null),M=useRef(null),A=useRef([]),O=useRef([]),T=useRef(null),$=useRef(null),I=useRef(null),w=useCallback((e,i)=>{if(e===i)return true;if(e.length!==i.length)return false;for(let a=0;a<e.length;a++)if(e[a]!==i[a])return false;return true},[]),D=useCallback((e,i)=>e.left===i.left&&e.right===i.right,[]),g=useMotionValue(0),n=useMotionValue(0),N=useMotionValue(0),C=useMemo(()=>{if(!c.length)return [];let e=[],i=x+c[0]/2;e.push(i);for(let a=1;a<c.length;a++)i+=c[a-1]/2+x+c[a]/2,e.push(i);return e},[c]),y=useMemo(()=>{if(!d.length)return [];let e=[],i=x+d[0]/2;e.push(i);for(let a=1;a<d.length;a++)i+=d[a-1]/2+x+d[a]/2,e.push(i);return e},[d]),Lt=l&&h?f:0,K=l&&u?b:0,at=h?f:0,Wt=useCallback(()=>{m.current&&clearTimeout(m.current),P(true);},[]),St=useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>P(false),120);},[]),_=useCallback(()=>{let e=k.current,i=M.current,a=z.current,Q=r;if(e){let R=e.getBoundingClientRect(),Z=(i??a)?.getBoundingClientRect();if(Z){let Pt=Math.round(Z.left-R.left),kt=Math.round(Z.right-R.left);Q={left:Pt,right:kt};}}let st=A.current.map(R=>R?R.offsetWidth:L),lt=O.current.map(R=>R?R.offsetWidth:L),pt=T.current?.scrollWidth??0,ct=$.current?.scrollWidth??0;D(r,Q)||q(Q),w(c,st)||G(st),w(d,lt)||X(lt),f!==pt&&J(pt),b!==ct&&Y(ct);},[r,c,d,f,b,D,w]),B=useCallback(()=>{I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{_();});},[_]);useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),useLayoutEffect(()=>{_();},[H,t,v,h,u,_]),useEffect(()=>(B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B),I.current&&cancelAnimationFrame(I.current);}),[B]),useEffect(()=>{let i=animate(g,l&&h?f:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,h,f,g]),useEffect(()=>{let i=animate(n,l&&u?b:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,u,b,n]);let wt=useMemo(()=>{if(!C.length)return 0;let e=C.length-1,i=c[e]??L;return C[e]+i/2+K+x},[C,c,K]),Ht=useMemo(()=>{if(!y.length)return 0;let e=y.length-1,i=d[e]??L;return at+y[e]+i/2+x},[y,d,at]);return {isHovering:l,handleMouseEnter:Wt,handleMouseLeave:St,centerWrapRef:k,centerContentRef:z,centerChipRef:M,anchors:r,leftChipRefs:A,rightChipRefs:O,leftOffsets:C,rightOffsets:y,expandableRightInnerRef:T,expandableLeftInnerRef:$,expandableRightWidth:f,expandableLeftWidth:b,expandedRightMV:g,expandedLeftMV:n,shiftX:N,rightShift:Lt,leftShift:K,leftHoverWidth:wt,rightHoverWidth:Ht}}function Ot({leftIcons:t=[],rightIcons:v=[],centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u,expandedZIndex:l=1e3,...P}){let{isHovering:r,handleMouseEnter:q,handleMouseLeave:c,centerWrapRef:G,centerContentRef:d,centerChipRef:X,anchors:f,leftChipRefs:J,rightChipRefs:b,leftOffsets:Y,rightOffsets:m,expandableRightInnerRef:k,expandableLeftInnerRef:z,expandedRightMV:M,expandedLeftMV:A,shiftX:O,rightShift:T,leftShift:$,leftHoverWidth:I,rightHoverWidth:w}=Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}),D=Bc(useId(),"right-left-expanding-center-chip");return jsx(vt,{...P,id:D,"data-testid":"RightLeftExpandingCenterChipBox",children:jsx(ht,{"data-testid":"CenterShiftWrapper",initial:false,style:{x:O},children:jsxs(ft,{"data-testid":"CenterIconWrapper",ref:G,onMouseLeave:c,children:[jsxs(xt,{"data-testid":"PeekContainer",children:[jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(yt,{"data-testid":"LeftPeekChip",initial:{opacity:0,scale:.95,x:-4},animate:r?{opacity:0,scale:.9,x:-6}:{opacity:1,scale:1,x:-5},exit:{opacity:0,scale:.95,x:-4},transition:{duration:.18,ease:"easeOut"}},"left-peek")}),jsx(mt,{"data-testid":"CenterChip",ref:X,onMouseEnter:q,style:{borderRadius:(()=>{let g=u&&r,n=h&&r;return g&&n?"0":g?"0 12px 12px 0":n?"12px 0 0 12px":"12px"})(),borderLeft:u&&r?"none":void 0,borderRight:h&&r?"none":void 0},children:jsx(Ct,{"data-testid":"CenterContent",ref:d,children:H})}),u&&jsx(nt,{"data-testid":"ExpandableLeftContainer",style:{width:A,position:"absolute",right:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"12px 0 0 12px",borderRight:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableLeftInner",ref:z,children:u})}),h&&jsx(nt,{"data-testid":"ExpandableRightContainer",style:{width:M,position:"absolute",left:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"0 12px 12px 0",borderLeft:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableRightInner",ref:k,children:h})}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(Et,{"data-testid":"RightPeekChip",initial:{opacity:0,scale:.95,x:4},animate:r?{opacity:0,scale:.9,x:6}:{opacity:1,scale:1,x:5},exit:{opacity:0,scale:.95,x:4},transition:{duration:.18,ease:"easeOut"}},"right-peek")})]}),r&&t.length>0&&jsx(et,{"data-testid":"LeftHoverBridge",side:"left",style:{width:I,right:`calc(100% - ${f.left}px)`,zIndex:l,pointerEvents:"auto"}}),r&&v.length>0&&jsx(et,{"data-testid":"RightHoverBridge",side:"right",style:{width:w,left:`${f.right}px`,zIndex:l,pointerEvents:"auto"}}),jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(tt,{"data-testid":"LeftExpandedSection",side:"left",style:{right:`calc(100% - ${f.left}px)`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:t.map((g,n)=>{let C=(Y[n]??(L+x)*(n+1))+$;return jsx(ut,{"data-testid":`LeftExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:-C}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(t.length-n)},children:jsx(rt,{"data-testid":`LeftExpandChip-${n}`,ref:y=>J.current[n]=y,children:g})},`left-${n}`)})},"left-expanded")}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(tt,{"data-testid":"RightExpandedSection",side:"right",style:{left:`${f.right}px`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:v.map((g,n)=>{let N=m[n]??(L+x)*(n+1),C=T;return jsx(gt,{"data-testid":`RightExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:C+N}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(v.length-n)},children:jsx(rt,{"data-testid":`RightExpandChip-${n}`,ref:y=>b.current[n]=y,children:g})},`right-${n}`)})},"right-expanded")})]})})})}var Tt=Ot;export{Tt as a};