@tap-payments/os-micro-frontend-shared 0.3.265 → 0.3.267
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/build/_chunks/{chunk-UXR6RZN4.js → chunk-2RPPZGV7.js} +1 -1
- package/build/_chunks/{chunk-ZDBICST5.js → chunk-37JEPAIM.js} +1 -1
- package/build/_chunks/{chunk-PI3EDHDX.js → chunk-6STWPH4M.js} +1 -1
- package/build/_chunks/{chunk-WXCTMI3J.js → chunk-7VJMQ6ZC.js} +1 -1
- package/build/_chunks/{chunk-5DKCOPDF.js → chunk-EOBVIUIS.js} +1 -1
- package/build/_chunks/{chunk-TY7VGG46.js → chunk-J43HMZGL.js} +1 -1
- package/build/_chunks/{chunk-UPZR423T.js → chunk-Q4FLSRWN.js} +1 -1
- package/build/_chunks/{chunk-BK7CW4W6.js → chunk-ROKMSXYO.js} +1 -1
- package/build/_chunks/{chunk-LTIWXK7D.js → chunk-TKQTJ4MH.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/AreaChart/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/AvatarStack/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/Card/index.js +1 -1
- package/build/components/CardList/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CountryFlag/index.js +1 -1
- package/build/components/CurrenciesMenu/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DateInput/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/EmptyState/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/FileDropbox/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FilterChip/index.js +1 -1
- package/build/components/FilterDropdown/components/MerchantsFilterItem/type.d.ts +2 -2
- package/build/components/FilterDropdown/components/MerchantsFilterItem/utils.d.ts +2 -2
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlippingCard/index.js +1 -1
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LeftPeekRightExpandingChip/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/ListLayout/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/Logo/index.js +1 -1
- package/build/components/MFWidgetLoader/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MultiLevelSelect/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/Select/index.js +1 -1
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/Sidebar/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TextInput/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/ToolbarIcon/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/modules/RangeCalender/index.js +1 -1
- package/build/components/modules/VirtualTables/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/constants/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/datetime/index.d.ts +2 -0
- package/build/datetime/index.js +1 -1
- package/build/datetime/wirePeriod.d.ts +15 -0
- package/build/hooks/index.js +1 -1
- package/build/hooks/useSelectedMerchantDetails.d.ts +5 -5
- package/build/index.js +1 -1
- package/build/types/brand.d.ts +19 -0
- package/build/types/index.js +1 -1
- package/build/utils/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-TY7VGG46.js';import {b as b$a,c as c$3}from'./chunk-LTIWXK7D.js';import {b as b$1}from'./chunk-BXVLLRHG.js';import {a as a$5}from'./chunk-XRUOTYCI.js';import {a as a$6,f as f$2,e as e$1,b as b$d,g as g$1,d as d$5,c as c$5}from'./chunk-LON6X4MJ.js';import {g,a as a$8}from'./chunk-UC5FMNUV.js';import {a as a$4}from'./chunk-FTRMTWS4.js';import {a as a$9}from'./chunk-64ZDTAAW.js';import {a as a$1}from'./chunk-DFEQ23C7.js';import {b as b$7}from'./chunk-REZFP4CA.js';import {b as b$5}from'./chunk-GBGW63EG.js';import {b as b$b}from'./chunk-XXCH74F3.js';import {b as b$6}from'./chunk-MF5ATA3Y.js';import {d as d$3}from'./chunk-YIZKLFYJ.js';import {a as a$7,b as b$c,d as d$4,c as c$4}from'./chunk-DRRME7J2.js';import {b as b$9}from'./chunk-FMUJQ45L.js';import {b as b$8}from'./chunk-RNJI3YXH.js';import {c as c$2}from'./chunk-LVQ2UFZT.js';import {f,a as a$2,b as b$3,d as d$1,c as c$1,e}from'./chunk-TN55SPRQ.js';import {b as b$2}from'./chunk-TZOMS57X.js';import {b as b$4,c,d as d$2}from'./chunk-LXG5YXOJ.js';import {a as a$3}from'./chunk-EG32DA46.js';import {t,p,z,j,V,b,R,D,d,B,v as v$1,f as f$1}from'./chunk-AXNWVU3K.js';import {n,r}from'./chunk-5DKCOPDF.js';import {Bc,gc,Ya,ya,nc,Na,z as z$1,Eb as Eb$1,Db,Cb as Cb$1,Xa,cc,db,xb as xb$1,yb as yb$1,Ab as Ab$1,Bb as Bb$1,zb as zb$2,ac,Ca,Ka,Fa,Ja as Ja$1,fc,q,ec,f as f$3,v as v$2}from'./chunk-RUFO5P34.js';import {Cb,zb as zb$1,Bb,Wd as Wd$1,Ej,rc,Di,Bi as Bi$1,Ci as Ci$1,Dh as Dh$1,Og as Og$1,Uh,Ue,hk,ja,zk,qk,F,E,Mj,Lj,Kj,Ij,Gj,Hj,Jj,jc,kc,hc,ma,Kl as Kl$1,Eb,Fb,Gb as Gb$1,C,Yj,Ch as Ch$1,yb,hm,Mh as Mh$1,Lh as Lh$1,jb as jb$1,xb,yo,Yc,Xc,Hb,fh as fh$1,kh as kh$1,lh as lh$1,ih as ih$1,hh as hh$1,ch,dh,eh as eh$1,ah as ah$1,bh as bh$1,mh as mh$1,T,yi as yi$1,Ai,zi as zi$1,xi,Ei,Vg as Vg$1,Qj,Rj,H as H$1,no as no$1,G,wb as wb$1,z as z$2,hp,da,ca,na,sk,Bk,tk,jk,lk as lk$1,wk,yk as yk$1,rk,ok,pk,Pn,cc as cc$1,dc,Qh,uk as uk$1,nh,yh as yh$1,xh as xh$1,wh,vh,uh as uh$1,th as th$1,sh as sh$1,rh,qh,ph as ph$1,oh as oh$1,Xh as Xh$1,Vh,Wh,_h,Zh,ce,Zd,be as be$1,Hn,Fn as Fn$1,ui,qb,_d as _d$1,vn,$d as $d$1,rb,Fh as Fh$1,Eh as Eh$1,Hh as Hh$1,Jh as Jh$1,Ih as Ih$1,Kh,le as le$1,uf as uf$1,tf as tf$1,sf as sf$1,rf as rf$1,qf as qf$1,vf as vf$1,pf,Ba,Aa,mf as mf$1,lf,kf,gi,fi,ii as ii$1,hi,ji,$j,Zj,_j,Tb as Tb$1,Om,Lm,Gm,Hm,Nm,zm,Pm,Am,Qm,Bm,Im,Dm,Fm,Mm,Em,xm,Jm,Km,ym,Cm,wm,vm,um,tm,sm,_g as _g$1,Ak,Wk,ak,ek,vb,fk,ik,gk,va,ua,h,Ug as Ug$1,oo as oo$1}from'./chunk-IQAHULGQ.js';import Ds,{forwardRef,useId,memo,createContext,useState,useEffect,useMemo,useCallback,useRef,Fragment as Fragment$1,useContext}from'react';import {useTranslation}from'react-i18next';import {styled,Box,Paper,Button,TextField,Typography,Popper,CircularProgress,Link,useTheme as useTheme$1,TableCell,ClickAwayListener}from'@mui/material';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {styled as styled$1,alpha,useTheme}from'@mui/material/styles';import ry from'@mui/material/TableCell';import Yn from'@mui/material/Box';import lI from'@mui/material/SvgIcon';import wt from'lodash/camelCase';import $u from'dayjs';import MS from'dayjs/plugin/timezone';import DS from'dayjs/plugin/utc';import sf from'lodash/startCase';import tw from'@mui/material/Popover';import p0 from'@mui/material/ClickAwayListener';import r0 from'@mui/material/Popper';import y0 from'@mui/material/Typography';import VC from'@mui/material/Button';import g1 from'@mui/material/Menu';var Br={ORDER:{label:"order",icon:xi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:zi$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Ai,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:yi$1,color:"#32ADE6"}},Vr={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var Nr=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Wr=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),Fr=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Xh({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n}){let r=Bc(useId(),"agreement-icon"),i=useTheme$1(),{t:l}=useTranslation(),a=useMemo(()=>[...t?[Vr.SAVED_TOKEN]:[],...(o||0)>0?[Vr.COUNT]:[],...e&&Br[e]?[Br[e]]:[]],[t,o,e]),s=m=>n?jsx(Fr,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:l("totalPaymentCount",{amount:f$3(o)}),children:jsx(Wr,{children:jsxs(Nr,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Vr.COUNT.color},children:["x",o]})})})},m):jsx(a$9,{value:o,index:m},m),p$1=a.map((m,u)=>m.label==="countBadge"?s(u):jsx(p,{title:l(m.label),children:jsx(Fr,{children:n?jsx(Wr,{children:jsx(Nr,{"data-testid":"AgreementCell_agreementType",sx:{color:m.color},children:l(m.label)})}):jsx(d,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:m.icon,alt:"agreement"})},m.color)},m.color)),c=jsx(p,{title:"No agreement",children:jsx(Fr,{children:n?jsx(Wr,{children:jsx(Nr,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(d,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ei,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:r,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:p$1?.length>0?p$1:c})}var rd=Xh;var Jh=rd;styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));var ad=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),ld=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var sd=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var Ja={"3DS":{tooltip:"3DS",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:bh$1,borderColor:"rgba(31, 136, 208, 0.10)"}},pd={FAILED:{tooltip:"Failed",icon:Vg$1,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:ch,borderColor:"rgba(255, 61, 0, 0.10)"}};function ey({transactionStatus:e,eci:t,authType:o,isTextShown:n}){let r=Bc(useId(),"auth-icons"),i=useMemo(()=>{let a=e?pd[e]:null,s=a?.tooltip,p=e==="AUTHENTICATED"?null:a?.icon;return [{tooltip:s,content:n?s:p,type:n?"text":"icon"},...o?[{tooltip:o,content:n?Ja[o]?.tooltip:Ja[o]?.icon,type:n?"text":"icon"}]:[],{tooltip:"",content:t?`ECI ${t}`:"",type:"text"}]},[e,n,o,t]),l=useMemo(()=>i.filter(a=>!!a.content).map((a,s)=>{let p$1=a.type==="text"?jsx(ld,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(ad,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":a.content,children:a.content})}):jsx(d,{sx:{width:"16px",height:"16px"},src:a.content,alt:a.tooltip});return jsx(p,{title:a.tooltip,children:p$1},`${a.tooltip}-${s}`)}),[i]);return jsx(sd,{id:r,"data-testid":"AuthIcons",children:l})}var md=ey;var ty=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}});var oy=md;var dd=styled$1(ry,{shouldForwardProp:e=>e!=="rowId"})(({theme:e})=>({fontSize:e.typography.body2.fontSize,fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,padding:e.spacing(0),verticalAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block",width:"100%",border:"none",textAlign:e?.direction==="ltr"?"left":"right"}));var sy=forwardRef(({children:e,...t},o)=>{let n=Bc(useId(),"table-cell");return jsx(dd,{id:n,component:"div","data-testid":"TableCell",...t,ref:o,children:e})}),v=memo(sy);var fd=styled("span",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:t})=>({display:"flex",width:"17px",height:"12px",backgroundColor:t?gc(e.palette)[t]:"transparent",borderRadius:"2px",flexShrink:0,overflow:"hidden",visibility:"hidden","& > img":{width:"100%",height:"100%",objectFit:"cover"}})),Jo=styled("button")({background:"transparent",border:"none",padding:0,cursor:"pointer",outline:"none",display:"flex",alignItems:"center",justifyContent:"center",overflow:"visible"}),ct=styled(motion.div)(({theme:e})=>({borderRadius:"12px",backgroundColor:e.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5)})),kP=styled("img")(()=>({width:"12px",height:"12px"})),gd=styled("span",{shouldForwardProp:e=>e!=="isShown"})(({theme:e,isShown:t})=>({...t&&{border:`1px solid ${e.palette.divider}`},borderRadius:"12px",backgroundColor:t?e.palette.background.paper:"transparent",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,overflow:"hidden",visibility:"hidden"})),BP=styled("span")(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600})),Cd=styled("div")(()=>({display:"flex",width:"24px",height:"24px",alignItems:"center",justifyContent:"center",borderRadius:"64px;",border:"1px solid #F2F2F2;"})),xd=styled(t)(({theme:e})=>({width:24,height:24,fontSize:"8.5px",fontWeight:500,color:e.palette.background.default,border:`1px solid ${e.palette.divider}`})),H=styled("div")(({theme:e})=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`})),hd=styled(H)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:e.palette.info.light,borderColor:e.palette.divider,minWidth:"88px",height:"24px"})),yd=styled(H)(({theme:e})=>({color:e.palette.grey.A700,backgroundColor:`${e.palette.grey.A700}1A`,minWidth:"88px",height:"24px"})),Hr=styled(v)(()=>({fontSize:"11px",textAlign:"left",display:"flex",justifyContent:"flex-start",alignItems:"center",overflow:"hidden",gap:"4px",textOverflow:"ellipsis",whiteSpace:"nowrap"})),we=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ie=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),U=styled("img")(()=>({width:"36px",height:"24px"})),Or=styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`})),mt=styled(motion.span)(({theme:e,order:t})=>({position:"absolute",left:0,zIndex:t+6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var Qo={VOID:{icon:gk},CAPTURED:{icon:fk}};var _r=styled$1(motion.div)(({theme:e,isCapture:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5),paddingInline:e.spacing(.3),paddingBlock:e.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:t?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),zr=styled$1("div")(({theme:e,percentage:t,isCapture:o})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} ${o?e.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:o?e.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),$r=styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`})),Ur=styled$1("img")({width:"14px",height:"14px"}),to=styled$1(Ie)({width:"16px",height:"16px"}),Mt=styled$1("img")({width:"16px",height:"16px"}),Id=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function Gr(e){return e<5?5:e===100?95:e}var bd=styled$1(Yn)({display:"flex",alignItems:"center",gap:"12px"});function Cy({value:e,format:t,flagIcon:o,hasFlag:n,tableMode:r,...i}){let l=o&&jsx(p,{title:Na(o||""),children:jsx(b$2,{countryCode:o})}),a=useMemo(()=>z$1(e,t),[e]);return jsx(v,{...i,children:jsxs(bd,{children:[n&&jsx(fd,{sx:{visibility:"visible"},className:"geography-box",children:l}),jsx(Box,{sx:{...Ya(r)&&{fontSize:"11px"}},children:a})]})})}var tn=Cy;function Sd({value:e,currentTimezone:t=no$1.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r=false,...i}){let l=m=>v$2(e,{currentTimezone:t,targetTimezone:m}),a=l(o),s=l(n),p$1=z$1(s),c=!r&&n!==o;return jsxs(Yn,{sx:{display:"flex",gap:"8px"},children:[jsx(tn,{value:a,...i}),c&&jsx(p,{title:p$1,children:jsx("img",{src:H$1,width:14,alt:"timezone"})})]})}function by({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`,l=jsx(Fragment,{children:o?.map(a=>{let s=a.name||a.description,p=(s?.length||0)>20?`${s?.slice(0,20)}...`:s;return jsx("div",{children:p},a.id)})});return jsx(p,{title:(o||[]).length>1?l:void 0,children:jsx(v,{...n,children:jsx("span",{children:i})})})}var Sy=by;function wy({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`;return jsx(v,{sx:{fontSize:"11px"},...n,children:i})}var vy=wy;var Td=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),jr=styled$1("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...Ya(t)&&{fontSize:"11px",color:e.palette.text.primary}})),wd=styled$1("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),vd=styled$1("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function Ey({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i,hideCustomerInitiatedIcon:l,hideTimezoneIcon:a,phone:s,email:p$1,id:c,...m}){let{t:u}=useTranslation(),f=e===false?u("merchantInitiated"):"",x=ac(i),I=i?.split(" ")?.map(y=>y?.[0]?.toUpperCase()).join(""),b=useMemo(()=>Ca(),[]),S=n&&jsx(p,{title:t,children:jsx(xd,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:b},src:r,alt:r,children:I})}),d=useMemo(()=>[{name:"ID",value:c},{name:"Name",value:i},{name:"Email",value:p$1},{name:"Phone",value:s}],[p$1,s,c,i]),C=useMemo(()=>d.some(({value:y})=>y)?jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:d.map(({name:y,value:w},T)=>w&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${y}`,children:y==="Name"?w:`${y}: ${w}`},`${T}-${w}`))}):null,[d]);return jsx(v,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(Td,{"data-testid":"CustomerCell_StyledCustomerCell",children:[S,jsx(p,{title:C,children:jsx(jr,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":x,children:t})}),!a&&jsx(wd,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(vd,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!l&&jsx(p,{title:f,children:jsx(gd,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!f,children:f&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:wb$1,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var My=Ey;function Ly({children:e,customerName:t}){let o=ac(t);return jsx(jr,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var Ry=Ly;var Kr=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),Ad=styled$1("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:Ya(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),Pd=styled$1("span")(({theme:e,tableMode:t})=>({fontSize:Ya(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),tl=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),qr=styled$1("div")(({theme:e,count:t})=>({justifyContent:"space-between",display:"flex",width:"100%",gap:(t||1)<=1?e.spacing(1.5):e.spacing(1)}));var ZE=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:l})=>{let a=Ka(t,o),s=Ka(n,r),p=Ka(i,l);return jsxs(tl,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Fa[e]:""}),jsxs(tl,{children:[e!=="fx"&&jsxs(qr,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(b$8,{currency:o})," ",a.integerAmount,".",a.decimalAmount]})]}),jsxs(qr,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(b$8,{currency:r})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(qr,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(b$8,{currency:l})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var oo=({tableMode:e,conversionType:t})=>t?jsx(Ad,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var no=({tableMode:e,amount:t,currency:o})=>jsx(Pd,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(b$8,{currency:o,fontSize:10})})," ",jsx(b$9,{amount:t,currency:o,sx:{fontSize:"inherit",fontWeight:"inherit"}})]}):jsx("span",{children:"-"})});var Md="default";function Fy({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(v,{...i,children:jsxs(Kr,{children:[jsx(p,{title:n||"",children:jsx(Box,{children:jsx(oo,{tableMode:Md,conversionType:e})})}),o&&jsx(p,{title:jsx(b$8,{currency:o}),children:jsx(b$2,{currencyCode:o})}),jsx(p,{title:r,children:jsx(no,{tableMode:Md,amount:t,currency:o})})]})})}var Hy=Fy;var Dd="text";function _y({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(v,{...i,children:jsxs(Kr,{children:[jsx(p,{title:n||"",children:jsx(oo,{tableMode:Dd,conversionType:e})}),jsx(p,{title:jsx(b$8,{currency:o}),children:jsx("span",{})}),jsx(p,{title:r,children:jsx(no,{tableMode:Dd,amount:t,currency:o})})]})})}var zy=_y;var Ld="sheet";function Uy({conversionType:e,amount:t,currency:o}){let{integerAmount:n,decimalAmount:r}=Ka(t,o);return jsxs(b$1,{copyTrigger:"press",copyText:t?`${n}.${r}`:"-",children:[jsx(oo,{tableMode:Ld,conversionType:e}),jsx(no,{tableMode:Ld,amount:t,currency:o})]})}var Gy=Uy;var kd=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Bd=styled$1(motion.span)(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:e.palette.secondary.main})),ol=styled$1(motion.div)(({theme:e})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.secondary.main}1A`,paddingInline:e.spacing(.5),borderRadius:"56px"})),io=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}}),ao=styled$1(motion.span)(({isTextShown:e,theme:t})=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e?"auto":"36px",...e&&{border:"none"}})),lo=styled$1(motion.div,{shouldForwardProp:e=>e!=="order"})(({order:e=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:e+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),so=styled$1(motion.div,{shouldForwardProp:e=>e!=="statusesCount"})(({statusesCount:e=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${e*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Vd=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var Nd=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var po=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>Nd(e),[e]),n=useMemo(()=>Object.values(o).filter(Boolean),[o]),r=useMemo(()=>{if(!t)return 0;let i=Object.entries(o).findIndex(([l])=>l===t);return i===-1?Math.floor((n.length-1)/2):i},[o,t,n.length]);return {statusesList:n,centerIconIndex:r}};function Ky({statuses:e,centerIconKey:t,...o}){let{statusesList:n}=po({statuses:e,centerIconKey:t}),r=useTheme(),i=n.length||0;return jsx(v,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(so,{whileHover:"animate",animate:"start",statusesCount:i,children:n.map((l,a)=>l?jsx(lo,{order:a,variants:io(a,r.shadows[4],40),children:jsx(ao,{children:l})},a):null)})})}var qy=Ky;function Zy({statuses:e,...t}){let{statusesList:o}=po({statuses:e});return jsx(v,{...t,children:jsx(Vd,{sx:{paddingRight:"30px"},children:o.map((n,r)=>jsx(Fragment$1,{children:n},r))})})}var Jy=Zy;function eI({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r}=po({statuses:e,centerIconKey:t}),i=useTheme(),l=r.length||0,a=o||120;return jsx(v,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(so,{whileHover:"animate",animate:"start",statusesCount:l,children:r.map((s,p)=>s?jsx(lo,{order:p,variants:io(p,i.shadows[4],a),children:jsx(ao,{isTextShown:true,children:s})},p):null)})})}var tI=eI;var Qr=styled$1("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:Ya(t)?"4px":e.spacing(1),overflow:"visible"})),ei=styled$1("span")(({selected:e})=>({overflow:"visible",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative","&:hover":{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},...e&&{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},span:{flexGrow:1}})),Wd=styled$1("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),De=styled$1(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function Fd({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(De,{src:jc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(De,{src:kc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(De,{src:hc,className:"spinner-loader"},"spinner-icon"):jsx(p,{title:r("moreActions"),children:jsx(Wd,{alt:"more",src:ma,isActive:n},"ellipsis-icon")})}Fd.displayName="ActionIconsVariants";var ln=memo(Fd);var co={GRAY:{icon:Bb,color:"#CFCFCF"},ORANGE:{icon:zb$1,color:"#FFD503"},RED:{icon:Cb,color:"#FF0000"}},ti={"#CFCFCF":"gray","#FFD503":"orange","#FF0000":"red",gray:"gray",red:"red",orange:"orange"},oi={flag:E,dispute:F,refund:qk,void:zk,capture:ja,cancel:hk,clock:Ue,reverse:Uh,destination:Og$1,invoice:Dh$1,users:Ci$1,brand:Bi$1,clipboard:Di,viewApi:Wd$1,viewReceipt:rc,delete:Ej};function ni({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),l=!!r,a=(e||[]).filter(x=>x.isShown!==false),s=a.some(x=>x.isLoading),p=a.some(x=>x.isError),c=a.some(x=>x.isSuccess),m=a.length>0||!!n,u=x=>{s||!m||i(x.currentTarget);},f=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:l,filteredActions:a,isAnyActionLoading:s,isAnyActionHasError:p,isAnyActionSuccessful:c,areThereAnyShownActions:m,handleClick:u,handleClose:f,setAnchorEl:i}}var Hd=e=>jsx(lI,{sx:{height:12.6,width:13},...e,children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"13",viewBox:"2.67 1.07 10.66 12.66",fill:"none",children:jsxs("g",{transform:"translate(-4 -4)",children:[jsx("path",{d:"M7.5918 15.166C7.5918 16.4041 8.5959 17.4072 9.83398 17.4072H15.5273L15.334 17.6973C15.101 18.0473 14.7079 18.2577 14.2871 18.2578H9.83398C8.12641 18.2578 6.74219 16.8736 6.74219 15.166V8.71289C6.74219 8.2923 6.9526 7.89944 7.30273 7.66602L7.5918 7.47266V15.166ZM10.167 5.74121H15.5C16.4651 5.74121 17.2586 6.534 17.2588 7.49902V14.833C17.2586 15.798 16.4651 16.5908 15.5 16.5908H10.167C9.20193 16.5908 8.40838 15.798 8.4082 14.833V7.49902C8.40838 6.534 9.20193 5.74121 10.167 5.74121ZM10.167 6.59082C9.6596 6.59082 9.25896 6.99168 9.25879 7.49902V14.833C9.25896 15.3404 9.6596 15.7412 10.167 15.7412H15.5C16.0074 15.7412 16.408 15.3404 16.4082 14.833V7.49902C16.408 6.99168 16.0074 6.59082 15.5 6.59082H10.167Z",fill:"#20232B",stroke:"white",strokeWidth:"0.15"}),jsx("path",{d:"M10.7598 12.84V9H11.4851V12.84H10.7598Z",fill:"black"}),jsx("path",{d:"M12.2846 12.84V9H13.5272C13.5574 9 13.6197 9.00089 13.7139 9.00267C13.8081 9.00444 13.8988 9.01067 13.9859 9.02133C14.2952 9.05867 14.5574 9.16622 14.7726 9.344C14.9877 9.52178 15.1512 9.74756 15.2632 10.0213C15.3752 10.2951 15.4312 10.5947 15.4312 10.92C15.4312 11.2453 15.3752 11.5449 15.2632 11.8187C15.1512 12.0924 14.9877 12.3182 14.7726 12.496C14.5574 12.6738 14.2952 12.7813 13.9859 12.8187C13.8988 12.8293 13.8081 12.8356 13.7139 12.8373C13.6197 12.8391 13.5574 12.84 13.5272 12.84H12.2846ZM13.0206 12.1573H13.5272C13.5752 12.1573 13.6401 12.1564 13.7219 12.1547C13.8037 12.1511 13.8774 12.1431 13.9432 12.1307C14.1103 12.0969 14.2463 12.0187 14.3512 11.896C14.4579 11.7733 14.5361 11.6258 14.5859 11.4533C14.6374 11.2809 14.6632 11.1031 14.6632 10.92C14.6632 10.728 14.6366 10.5458 14.5832 10.3733C14.5317 10.2009 14.4526 10.0551 14.3459 9.936C14.2392 9.81689 14.105 9.74133 13.9432 9.70933C13.8774 9.69511 13.8037 9.68711 13.7219 9.68533C13.6401 9.68356 13.5752 9.68267 13.5272 9.68267H13.0206V12.1573Z",fill:"black"})]})})});var _d=".IDButton-root:not(.IDButton-hoverDisabled):hover &",zd=styled$1("div")(({theme:e})=>({paddingInlineStart:"8px",border:"1px solid transparent",display:"flex",gap:"4px",alignItems:"center",justifyContent:"flex-end",backgroundColor:e.palette.common.white,float:"right",borderRadius:"56px",height:"100%",paddingLeft:"4px",paddingRight:"4px",width:"24px",overflow:"hidden",[_d]:{width:"max-content",overflow:"visible",borderColor:"rgba(92, 92, 92, 0.05)",boxShadow:"-7px 0px 8px 0px #F2F2F2",position:"absolute",right:0,top:0,zIndex:101}})),$d=styled$1("div")(({theme:e})=>({color:e.palette.text.primary,fontSize:"11px",lineHeight:"120%",display:"grid",gridTemplateColumns:"0fr",opacity:0,transition:"grid-template-columns 0.1s ease, opacity 0.1s ease","& > span":{overflow:"hidden",minWidth:0,whiteSpace:"nowrap"},[_d]:{gridTemplateColumns:"1fr",opacity:1,transition:"grid-template-columns 0.3s ease, opacity 0.3s ease 0.3s"}}));function dI({icon:e=jsx(Hd,{}),id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,className:i,...l}){let{t:a}=useTranslation();return jsx(p,{title:a("copy"),children:jsx(Yn,{className:nc("IDButton-root",n&&"IDButton-hoverDisabled",i),sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...l,children:jsxs(zd,{className:"IDButton-button",children:[t?jsx($d,{className:"IDButton-rowId",children:jsx("span",{children:t})}):null,t?jsx(D,{className:"IDButton-icon",icon:e,text:t,onClick:()=>r?.()}):null]})})})}var il=memo(dI);var nL=memo(({flag:e,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:l=true,row:a,showJsonViewer:s=true,isTextShown:p$1,showIdButton:c=true,onCopyId:m,rowId:u,onJsonViewClick:f$1,renderDropdown:x,startSlot:I,...b})=>{let{t:S}=useTranslation(),{open:d,anchorEl:C,filteredActions:y,isAnyActionLoading:w,isAnyActionHasError:T,isAnyActionSuccessful:h,areThereAnyShownActions:A,handleClick:P,handleClose:M,setAnchorEl:E}=ni({actions:t,isDropdownShown:l,onCloseDropdown:i,renderDropdown:x});return jsx(v,{...b,sx:{overflow:"visible",...b.sx},children:jsxs(Qr,{"data-testid":"ActionCell_ActionCellContainer",children:[I,e&&jsx(Fragment,{children:p$1?jsx(p,{title:o,children:jsx(H,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(p,{title:o,children:jsxs(ct,{"data-testid":"ActionCell_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(De,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:co[e]?.icon,alt:"flag-icon"}),(n??0)>1&&jsx(motion.div,{"data-testid":"ActionCell_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:ti[co[e]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),c&&jsx(il,{id:u||a.id,onCopyId:m}),jsxs("div",{"data-testid":"ActionCell_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[s&&jsx(Fragment,{children:jsx(Jo,{onClick:f$1,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(p,{title:S("jsonViewer"),children:jsx(Cd,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Wd$1,alt:"icon"},"id-icon")})})})}),jsxs(ei,{id:"styled-popover",selected:!!r||d,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":A,sx:{...!A&&{pointerEvents:"none"}},children:[jsx(Jo,{onClick:P,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":A,sx:{...!A&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(ln,{isAnyActionLoading:w,isAnyActionHasError:T,isAnyActionSuccessful:h,areThereAnyShownActions:A})})}),r,x?x(C,E):jsx(Fragment,{children:A&&jsx(f,{style:{zIndex:2e3},open:d,onClose:M,anchorEl:C,menuItems:y.map(k=>({...k,onClick:N=>{k?.onClick?.(N),k.hasActionMenu||M();},onRightClick:N=>{k?.onRightClick?.(N),M();},icon:k.customIcon||jsx(De,{icon:k.icon,src:k.iconSrc??(k.icon&&oi[k.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${k.label.trim()}`)}))})})]})]})]})})});function yI({flag:e,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:l=true,rowId:a,onJsonViewClick:s,tableMode:p$1,...c}){return jsx(v,{...c,sx:{overflow:"visible"},children:jsxs(Qr,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p$1,children:[e&&jsx(Fragment,{children:i?jsx(p,{title:t,children:jsx(H,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(p,{title:t,children:jsxs(ct,{"data-testid":"ActionsColumn_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(De,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:co[e]?.icon,alt:"flag-icon"}),(o??0)>1&&jsx(motion.div,{"data-testid":"ActionsColumn_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:ti[co[e]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),l&&jsx(b$1,{sx:{minWidth:"213px"},children:a||n.id}),jsx("div",{"data-testid":"ActionsColumn_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:r&&jsx(b$1,{onClick:s,children:"View API"})})]})})}var II=memo(yI);function wI({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:l,anchorEl:a,filteredActions:s,isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:u,handleClick:f$1,handleClose:x,setAnchorEl:I}=ni({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(v,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(ei,{id:"styled-popover",selected:!!t||l,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":u,sx:{...!u&&{pointerEvents:"none"}},children:[jsx(Jo,{onClick:f$1,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":u,sx:{...!u&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(ln,{isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:u})})}),r?r(a,I):jsxs(Fragment,{children:[t,u&&jsx(f,{style:{zIndex:2e3},open:l,onClose:x,anchorEl:a,menuItems:s.map(b=>({...b,onClick:S=>{b?.onClick?.(S),b.hasActionMenu||x();},onRightClick:S=>{b?.onRightClick?.(S),x();},icon:b.customIcon||jsx(De,{icon:b.icon,src:b.iconSrc??(b.icon&&oi[b.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${b.label.trim()}`)}))})]})]})})})}var vI=memo(wI);function EI({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(v,{...r,children:jsxs(Yn,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(kt,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$2,{type:e,isTextShown:o})]})})}var MI=EI;var Yd=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),jd=styled("span")(({theme:e})=>({fontSize:e.typography.pxToRem(12),color:e.palette.info.dark,fontWeight:700,paddingInline:e.spacing(1),borderRadius:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.info.dark}1A`})),Kd=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`,paddingInline:e.spacing(1),borderRadius:"56px",height:"24px"}));styled("img")(({theme:e,order:t})=>({borderRadius:"50%",backgroundColor:e.palette.common.white,width:"16px",height:"16px",padding:"2px",zIndex:t+1,position:"absolute",left:`${t*9}px`}));var qd=styled("img")(({pointLeft:e})=>({width:"12.5px",height:"13px",transform:`scale(${e?"-1":"1"}, 1)`}));styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",backgroundColor:e.palette.common.white,borderRadius:"50%",width:"16px",height:"16px",fontSize:"8px",fontWeight:e.typography.fontWeightBold,lineHeight:"11px",position:"absolute",left:"18px",zIndex:4,textAlign:"center",span:{flexGrow:1}}));function kI({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...l}){let a=useMemo(()=>{if(typeof e=="number")return e;let c=Number(e);return Number.isNaN(c)?void 0:c},[e]),s=a!==void 0?a>0:!!e,p$1=a!==void 0&&a>1;return !s||r?null:jsx(Yn,{sx:{width:"fit-content",overflow:"visible"},...l,children:jsx(p,{title:t,children:jsxs(Kd,{children:[jsx(qd,{src:z$2,pointLeft:i==="left"}),p$1&&jsx(Yd,{children:jsx(jd,{children:e})})]})})})}var BI=kI;function WI(e){let{destination:t,...o}=e,n={...o};delete n.destinationsCount,delete n.destinationsTooltip,delete n.destinationsAmount,delete n.hidden,delete n.iconDirection,delete n.selectionProps,delete n.flagIcon;let r=t?.destination||[];return jsx(Yn,{sx:{display:"flex",gap:"4px",alignItems:"center"},...n,children:r.map((i,l)=>{let a=Ja$1(i?.amount||0),s=`${a.integerAmount}.${a.decimalAmount}`;return jsxs(b$1,{copyTrigger:"press",copyText:s,children:[i?.id," | ",jsx(b$8,{currency:i?.currency})," ",s]},i?.id||l)})})}var FI=WI;function _I({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...l}){let a=o?.destination||[],s=Ja$1(n||0),p$1=Ja$1(a?.[0]?.amount||0);return !e||r?null:jsx(Yn,{sx:{width:"fit-content",overflow:"visible"},...l,children:jsx(p,{title:t,children:jsx(H,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",a?.[0]?.id," - ",jsx(b$8,{currency:a?.[0]?.currency})," ",p$1.integerAmount,".",p$1.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",a?.[0]?.id," - ",jsx(b$8,{currency:a?.[0]?.currency})," ",s.integerAmount,".",s.decimalAmount]})})})})}var zI=_I;var mR=({destination:e,amount:t})=>{let o=e?.destination||[];return o?.length>1?jsxs("div",{children:[jsx("div",{children:"Destination"}),e?.destination?.map(r=>{let i=Ja$1(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(b$8,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(b$8,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var Jd=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",minWidth:"24px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,zIndex:10,position:"absolute"})),Qd=styled("div")(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function eu(e){return e<5?5:e===100?95:e}function jI({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),l=jsx(b$8,{currency:n}),{integerAmount:a,decimalAmount:s}=Ka(o,n),p$1=`${a}.${s}`,c=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",l," ",p$1]}),[o,n]);return e===0||o<0?null:jsx(v,{...r,children:jsx(p,{title:c,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(Jd,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs(Qd,{percentage:e,children:[e,"% ",jsx(Or,{percentage:eu(e)})]}),!!t&&jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px",width:0},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs("span",{children:[t," days left"]})})]})})})})}var KI=jI;function XI({remainingAmount:e,currency:t}){let o=jsx(b$8,{currency:t}),{integerAmount:n,decimalAmount:r}=Ka(e,t),i=`${n}.${r}`;return jsxs(b$1,{copyTrigger:"press",copyText:`${n}.${r}`,children:[o," ",i]})}var ZI=XI;var dl=["authenticationMode","paymentAuth","paymentAgreement"],ul=["paymentIssuer","paymentInitiated","paymentDevice"],tu=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...ul,...dl];var ru=styled$1(Yn)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),iu=styled$1(Yn)(()=>({marginLeft:"8px",width:20}));function ob(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let l of tu)if(e?.[l])return {centerIcon:e?.[l],centerIconId:l};return {centerIcon:null,centerIconId:null}},[e]);if(!o)return null;let n=o!=="paymentScheme"&&e.paymentScheme,r=o!=="paymentCardNumber"&&e.paymentCardNumber,i=o!=="paymentType"&&e.paymentType;return jsx(a$1,{expandedZIndex:0,centerIcon:t,leftIcons:ul.filter(l=>l!==o&&e?.[l]).map(l=>e?.[l]),rightIcons:dl.filter(l=>l!==o&&e?.[l]).map(l=>e?.[l]),expandableCenterRight:(n||r)&&jsxs(ru,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}),expandableCenterLeft:i&&jsx(iu,{children:e.paymentType})})}var nb=memo(ob);var lu=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function lk({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r(wt(fc(t,n)?o:n))} - ${e?.last_four}`;return jsx(p,{title:i,children:jsxs(lu,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}function uk({method:e}){let{t}=useTranslation();return e?jsx(_e,{source:de(e)??e,title:`Payment Method - ${t(wt(e))}`}):null}function yk({type:e}){let{t}=useTranslation();return e?jsx(_e,{source:de(e)??e??"",title:`Payment Type - ${t(wt(e))}`}):null}function vk({scheme:e}){let{t}=useTranslation();return e?jsx(_e,{source:de(e)??e,title:`Payment Scheme - ${t(wt(e))}`}):null}var Rk=({mode:e})=>e?jsx(p,{title:hp[e],children:jsx(Yn,{component:"img",src:e==="C"?da:ca})}):null;var ii={ORDER:{label:"order",icon:xi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:zi$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Ai,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:yi$1,color:"#32ADE6"}},ai={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var li=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),si=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),cu=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),mu=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),fl=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),pi=(e,t)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}}),ci=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Tb({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:l}=useTranslation(),a=useMemo(()=>[...t?[ai.SAVED_TOKEN]:[],...(o||0)>0?[ai.COUNT]:[],...e&&ii[e]?[ii[e]]:[]],[t,o,e]),s=u=>n?jsx(ci,{"data-testid":"AgreementCell_countBadge",order:u,variants:pi(u,n?85:0),children:jsx(p,{title:l("totalPaymentCount",{amount:f$3(o)}),children:jsx(si,{children:jsxs(li,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:ai.COUNT.color},children:["x",o]})})})},u):jsx(a$9,{value:o,index:u},u),p$1=a.map((u,f)=>u.label==="countBadge"?s(f):jsx(p,{title:l(u.label),children:jsx(ci,{order:f,variants:pi(f,f>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx(si,{children:jsx(li,{"data-testid":"AgreementCell_agreementType",sx:{color:u.color},children:l(u.label)})}):jsx(fl,{src:u.icon,alt:"agreement"})},u.color)},u.color)),c=p$1.length,m=jsx(p,{title:"No agreement",children:jsx(ci,{order:0,variants:pi(0,0),sx:{width:n?"auto":"36px"},children:n?jsx(si,{children:jsx(li,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(fl,{src:Ei,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(v,{...r,children:jsx(mu,{"data-testid":"AgreementCell",children:jsx(cu,{layout:true,className:"payment-sources-container","data-testid":"AgreementCell_PaymentSourcesContainer",whileHover:"animate",animate:"start",sourcesCount:c||0,variants:{animate:{width:(c||0)*38}},children:p$1?.length>0?p$1:m})})})}var wb=Tb;var uu=styled$1("img")(()=>({width:"12.67px",height:"15px"}));styled$1("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));function Ab({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(v,{style:{textAlign:n||"center",overflow:"visible",display:"flex",width:"100%",justifyContent:n==="left"?"flex-start":"center"},...r,children:e?jsx(p,{title:t,children:jsx(ct,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(H,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(uu,{src:na,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var Pb=Ab;var fu={REFUNDED:pk,PAID_OUT:ok,SETTLED:rk,PENDING:qk,UNKNOWN:yk$1,TIMEDOUT:wk,CANCELLED:hk,FAILED:lk$1,DECLINED:jk,RESTRICTED:tk,IN_PROGRESS:Bk,ACCEPTED:sk},gu={REFUNDED:"refunded"};function Cu({status:e,refundTooltip:t}){let{t:o}=useTranslation();return jsx(p,{title:jsxs("div",{children:[jsx("div",{children:o(wt(e))}),t]}),children:jsx(Ie,{children:jsx("img",{src:fu[e],alt:"refund-requested"})})})}function hu({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:l,refundTooltip:a}){let{t:s}=useTranslation();return Pn?.includes(e??"")?jsx(Xe,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:l,iconWrapperStyles:{height:17}}):jsx(Cu,{status:e,refundTooltip:a})}var yu=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.625),paddingBlock:e.spacing(.625),height:"24px",minWidth:"24px",backgroundColor:"#ede8fb",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),Iu=styled$1("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0})),bu=styled$1(tn)(({theme:e})=>({fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled$1("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var Su=styled$1("img")({width:"14px",height:"14px"}),Tu=styled$1(Yn)(({theme:e})=>({position:"relative",zIndex:25,border:`1px solid ${e.palette.divider}`,height:24,borderRadius:"12px",padding:"3px 4px","> div":{paddingTop:0,paddingBottom:0,height:16}}));function gl({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r,gatewayTooltip:i,unCapturedTooltip:l,acquirerTooltip:a,errorCode:s,acquirerCode:p$1,gatewayCode:c,timezone:m}){let u=useTheme(),{t:f}=useTranslation(),x=v$2(new Date(Number(r)),{currentTimezone:oo$1,targetTimezone:m?.offset}),I=useMemo(()=>t||(e==="REFUNDED"?pk:rk),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(p,{title:jsxs("div",{children:[jsx("div",{children:n??f(gu.REFUNDED)}),o]}),children:jsxs(yu,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r&&{animate:{boxShadow:u.shadows[4]}}},sx:{...!r&&{backgroundColor:"transparent"}},children:[jsx(Su,{sx:{...!r&&{width:"16px",height:"16px"}},src:I,alt:"refunded"}),jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:r&&jsx(Iu,{children:jsx(bu,{value:x})})})]})}):jsx(hu,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:l,acquirerTooltip:a,errorCode:s,acquirerCode:p$1,gatewayCode:c})}var vu=()=>{let e=useTheme();return {REFUNDED:{color:e.palette.common.lightPurple,backgroundColor:`${e.palette.common.lightPurple}1A`},PENDING:{color:e.palette.custom[500],backgroundColor:`${e.palette.custom[500]}0d`},PAID_OUT:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},SETTLED:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},UNKNOWN:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},TIMEDOUT:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},FAILED:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},DECLINED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},RESTRICTED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},IN_PROGRESS:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`},CANCELLED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},ACCEPTED:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`}}};function zb({status:e,date:t,refundTooltip:o,isTextShown:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:l,acquirerCode:a,gatewayCode:s,unCapturedTooltip:p$1,timezone:c,refundTooltipLabel:m,refundIcon:u,...f}){let{t:x}=useTranslation(),I=vu(),b=useCallback(d=>$u(d).format("MMM D, YYYY"),[]),S=Pn.includes(e);return jsx(v,{...f,style:{overflow:"visible"},children:jsx(we,{children:jsx(Tu,{width:n?"auto":"36px",sx:{...S&&{border:"none"}},children:n?jsx(p,{title:t?b(t):x(wt(e)),children:jsx(H,{sx:{...I[e]?I[e]:I.PENDING},children:x(wt(e))})}):jsx(gl,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p$1,acquirerTooltip:i,errorCode:l,acquirerCode:a,gatewayCode:s,timezone:c,refundTooltipLabel:m,refundIcon:u})})})})}var $b=zb;var Pu=styled("img")(()=>({width:"16px",height:"16px"})),Eu=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Mu=styled("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.info.dark}1a`})),Du=styled("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function Ub({walletId:e,country:t,showCountry:o=true,...n}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Eu,{children:[o&&t&&jsx(p,{title:Na(t),children:jsx(b$2,{countryCode:t})}),jsxs(Mu,{children:[jsx(Pu,{src:cc$1,alt:"wallet-icon"}),e&&jsxs(Du,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var Gb=Ub;var Lu=styled("img")(()=>({width:"16px",height:"16px"})),Ru=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),ku=styled("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.common.white}`,border:`1px solid ${e.palette.divider}`})),Bu=styled("span")(({theme:e})=>({color:`${e.palette.text.primary}`,fontSize:"14px",lineHeight:"16.8px"}));styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function Yb({walletId:e,country:t,name:o,...n}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Ru,{children:[t&&jsx(p,{title:Na(t),children:jsx(b$2,{countryCode:t})}),jsxs(ku,{children:[jsx(Lu,{src:dc,alt:"bank-icon"}),e&&jsxs(Bu,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var jb=Yb;var hl={PAID_OUT:ok,SETTLED:uk$1,PENDING:Qh,INITIATED:Qh,FAILED:lk$1};function Zb({payoutStatus:e="PAID_OUT",...t}){let{t:o}=useTranslation(),n=useTheme();return jsx(v,{...t,children:jsx(we,{children:jsx(Ie,{className:"payout-status",style:{visibility:"visible",width:"36px",borderRadius:"23.1px",backgroundColor:n.palette.common.white,border:`1.029px solid ${n.palette.divider}`},children:e&&hl[e]&&jsx(p,{title:o(wt(e)),children:jsx(U,{src:hl[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var Jb=Zb;styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"}));styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"}));styled$1(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)}));styled$1("img")(()=>({width:"13px",height:"13px"}));styled$1(motion.span)(({theme:e})=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"}));styled$1(motion.div)(()=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0}));styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"}));var Qb=styled$1("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var yl=a$6;function oS({status:e,chargeStatus:t,isTextShown:o,...n}){let{t:r}=useTranslation();return jsx(v,{...n,children:jsxs(we,{children:[jsx(Ci,{status:e,isTextShown:o}),t&&yl[t]&&jsx(p,{title:r(wt(t)),children:jsx(U,{src:yl[t],alt:"charge-icon"})})]})})}var nS=oS;var iS={FAILED:fh$1,PENDING:mh$1,INITIATED:bh$1,ATTEMPTED:ah$1,EXEMPTED:eh$1,EXEMPTED_WITH_TRANSACTION:eh$1,EXEMPTED_WITHOUT_TRANSACTION:dh,REJECTED:ch,UNAVAILABLE:hh$1,UNDETERMINED:ih$1,SUCCESS:lh$1,AUTHENTICATED:kh$1,AUTHENTICATED_WITH_TRANSACTION:kh$1,AUTHENTICATED_WITHOUT_TRANSACTION:kh$1,AUTHENTICATED_AUTHORIZE_FAILED:fh$1},Il={FAILED:nh,PENDING:oh$1,INITIATED:ph$1,ATTEMPTED:qh,EXEMPTED:rh,EXEMPTED_WITH_TRANSACTION:rh,EXEMPTED_WITHOUT_TRANSACTION:sh$1,REJECTED:th$1,UNAVAILABLE:uh$1,UNDETERMINED:vh,SUCCESS:wh,AUTHENTICATED:xh$1,AUTHENTICATED_WITH_TRANSACTION:xh$1,AUTHENTICATED_WITHOUT_TRANSACTION:yh$1,AUTHENTICATED_AUTHORIZE_FAILED:nh},Nt=a$6;function sS({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:l,...a}){let{t:s}=useTranslation(),p$1=useTheme(),c=[e&&Il[e]?jsx(p,{title:s(wt(e)),children:jsx("img",{src:Il[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&Nt[o]?jsx(p,{title:s(wt(o)),children:jsx(Xe,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:l})}):null,t&&f$2[t]?jsx(p,{title:s(wt(t)),children:jsx("img",{src:f$2[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),m=c.length||0;return jsx(v,{...a,sx:{position:"relative",overflow:"visible"},children:jsx(so,{whileHover:"animate",animate:"start",statusesCount:m,children:c.map((u,f)=>u?jsx(lo,{order:f,variants:io(f,p$1.shadows[4],40),children:jsx(ao,{children:u})},f):null)})})}var pS=sS;var Sl={issuer:Zh,scheme:_h,device:Xh$1,app:Wh,wallet:Vh,biometric:Xh$1};function dS({type:e,...t}){let{t:o}=useTranslation();return jsx(v,{...t,children:jsx(we,{children:jsx(Ie,{className:"authentication-status",children:e&&Sl[e]&&jsx(p,{title:o(wt(e)),children:jsx(U,{src:Sl[e],alt:"authentication-type"})})})})})}var uS=dS;var Vu={SMS:be$1,EMAIL:Zd,WHATSAPP:ce};var Nu=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Wu=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Fu=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),Hu=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Ou=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),_u=(e,t)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}});function xS({channels:e,isTextShown:t,...o}){let{t:n}=useTranslation(),r=useTheme(),i={WHATSAPP:r.palette.custom[700],EMAIL:r.palette.custom[800],SMS:r.palette.custom[900]},a=e?.sort(p=>p==="EMAIL"?-1:p==="SMS"?1:p==="WHATSAPP"?2:0)?.filter(p=>!!p)?.map((p$1,c)=>{if(!p$1)return null;let m=n(p$1?.toLowerCase());return jsx(mt,{order:c,variants:_u(c,t?74:0),sx:{width:t?"70px":"36px"},children:jsx(p,{title:m,placement:"top",wrapperProps:{sx:{width:"100%",height:"100%",justifyContent:"center"}},children:t?jsx(Ou,{children:jsx(Hu,{sx:{color:i[p$1]},children:m})}):jsx(Wu,{src:Vu[p$1],alt:p$1})})},`${p$1}-${c}`)}),s=a?.length||0;return jsx(v,{...o,children:jsx(Nu,{children:a?.length>0?jsx(Fu,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:s||0,variants:{animate:{width:(s||0)*38}},style:{zIndex:29},children:a}):null})})}var hS=xS;function hn(e){return z$1(e,{sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"})}styled(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"80px",fontSize:"10px",color:e.palette.text.primary}));styled("img")(()=>({width:"16px",height:"16px"}));styled("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));styled("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));var zu=styled(j)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));function IS({dueDate:e,expiryDate:t,...o}){let n=useMemo(()=>({label:hn($u(e).valueOf()),tooltip:"Due Date"}),[e]),r=useMemo(()=>({label:hn($u(t).valueOf()),tooltip:"Expiry Date"}),[t]),i=s=>jsx(p,{title:s.tooltip,children:jsx(zu,{children:s.label})}),l=useMemo(()=>e?i(n):t?i(r):null,[n,r,e,t]),a=useMemo(()=>t&&e?[i(r)]:[],[n,r,e,t]);return !e&&!t?null:jsx(v,{...o,sx:{position:"relative",overflow:"visible"},children:jsx(a$1,{sx:{justifyContent:"flex-start"},centerIcon:l,rightIcons:a})})}var bS=IS;var Uu=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),height:"34px",minWidth:"24px",borderRadius:"8px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10,border:"1px solid transparent","&:hover":{backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`}}));styled("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var Tl=styled("img")({width:"24px",height:"24px"});function wS({products:e,...t}){let o=e?.map((r,i)=>jsx(Tl,{sx:{...r?.toLowerCase()===Fn$1.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:Hn.find(l=>l.code?.toLowerCase()===r?.toLowerCase())?.iconUrl,alt:"product-icon"},`${i}-${r}`)),n=jsxs(Uu,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(Tl,{src:ui,alt:"products-icon"}),jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:o})]});return jsx(v,{...t,style:{overflow:"visible"},children:jsx(we,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:n})})})}var vS=wS;function yi(e){return jsx(Hr,{...e,children:jsx(p,{title:e.tooltip||e.children,children:e.children})})}var Ku=styled$1(Yn)(()=>({display:"flex",alignItems:"center",gap:"8px"})),qu=styled$1(Yn)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function xW({currency:e}){return jsxs(Ku,{children:[jsx(b$2,{currencyCode:e}),jsx(qu,{children:e})]})}$u.extend(DS);$u.extend(MS);function Ju({value:e,...t}){let o=useMemo(()=>z$1(e,{sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"}),[e]);return jsx(v,{...t,children:o})}var Qu=styled$1(Yn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:36,height:24,border:`1px solid ${e.palette.divider}`,borderRadius:"24px","&:hover":{boxShadow:e.shadows[4]}}));function WW({reference:e}){return e?jsx(p,{title:`Bank - ${e}`,children:jsx(Qu,{children:jsx(Yn,{component:"img",src:qb,alt:"bank",width:14})})}):jsx(Fragment,{})}var wl={acquirer:qb,generic:rb,payment:$d$1,gateway:vn,order:_d$1};var ef=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),tf=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),of=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({sourcesCount:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${e*6+36}px `,minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),nf=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),rf=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled("div")(()=>({height:"18px"}));var af=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});var OS=120,_S=50;function zS({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),[i,l]=useState(null),a=useRef(null),s=useRef(false),p$1=useRef(false),c=useRef(null),m=useTheme(),u=useMemo(()=>Object.keys(wl).filter(w=>!!o[w]),[o]),f=()=>{c.current&&(clearTimeout(c.current),c.current=null);},x=()=>{l(a.current);},I=()=>{s.current=true,p$1.current=false,r(true),l(null),f(),c.current=setTimeout(()=>{p$1.current=true,x();},OS);};useEffect(()=>()=>f(),[]);let b=()=>{s.current||I();},S=()=>{f(),a.current=null,s.current=false,p$1.current=false,l(null),r(false);},d=w=>{if(a.current=w,p$1.current){f(),l(w);return}s.current||I();},C=()=>{a.current=null,p$1.current&&(f(),c.current=setTimeout(x,_S));},y=u.length;return jsx(v,{...o,children:jsx(ef,{children:y>0?jsx(of,{layout:true,className:"reference-sources-container",whileHover:"animate",onHoverStart:b,onHoverEnd:S,animate:n?"animate":"start",sourcesCount:y,variants:{animate:{width:y*38}},style:{zIndex:29},children:u.map((w,T)=>{let h=t?.(w)||`${sf(w)} - ${o[w]}`,A=i===w;return jsx(mt,{order:T,variants:af(T,m.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},onMouseEnter:()=>d(w),onMouseLeave:C,children:jsx(p,{open:A,disableHoverListener:true,disableInteractive:true,title:A?h:"",children:e?jsx(rf,{children:jsx(nf,{children:sf(w)})}):jsx(tf,{src:wl[w],alt:w,sx:{...w==="order"&&{width:"11.82px"}}})})},`${w}-${T}`)})}):null})})}var $S=zS;var vl={Y:{tooltip:"Authenticated",icon:kh$1,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Vg$1,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Vg$1,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:ah$1,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Vg$1,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:bh$1,borderColor:"#F2F2F2"}},Al={"3DS":{tooltip:"3DS",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled("img")(()=>({width:"12.67px",height:"15px"}));var cf=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),mf=styled("img")({width:"16px",height:"16px"});styled("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"10px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));var df=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),uf=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}}),ff=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function GS({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),l=useMemo(()=>{let p=vl[e??"noAuth"]??vl.noAuth,c=p?.tooltip,m=p?.icon;return [{tooltip:c,content:t?c:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?Al[n]?.tooltip:Al[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),a=useMemo(()=>l.filter(p=>!!p.content).map((p$1,c)=>{let m=p$1.type==="text"?jsx(ff,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(H,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p$1.content,children:p$1.content})}):jsx(mf,{src:p$1.content,alt:p$1.tooltip});return jsx(p,{title:p$1.tooltip,children:jsx(mt,{order:-1*c,variants:uf(c,i.shadows[4],t?124:39),sx:{...p$1.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p$1.tooltip}-${c}`)}),[r,l,t,i]),s=a.length;return jsx(v,{...r,children:jsx(cf,{children:s>0?jsx(df,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:s,variants:{animate:{width:38}},style:{zIndex:29},children:a}):null})})}var YS=GS;var Pl={checkout:Eh$1,checkoutSuccess:Fh$1};function qS({status:e,...t}){let{t:o}=useTranslation();return jsx(v,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&Pl[e]&&jsx(p,{title:o(wt(e)),children:jsx(U,{src:Pl[e],alt:"checkout-icon"})})})})}var XS=qS;var El={TRANSACTED:Kh,INITIATED:Ih$1,CANCELLED:Jh$1,EXPIRED:Hh$1};function xf({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(v,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&El[e]&&jsx(p,{title:n(wt(e)),children:jsx(U,{src:El[e],alt:"intents-icon"})}),t&&Nt[t]&&jsx(p,{title:n(wt(t)),children:jsx(Xe,{chargeStatus:t})})]})})}var yf=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",fontSize:"10px",color:e.palette.text.primary,zIndex:24,overflow:"visible",position:"absolute",gap:"0px"})),If=styled(motion.div)(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(.5),minWidth:"44px"}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function bf(e){return e<5?5:e===100?95:e}var Ti={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function tT({percentage:e,date:t,payoutStatus:o,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:l,...a}){let{t:s}=useTranslation(),p$1=useTheme();return e===0?null:jsx(v,{...a,style:{overflow:"visible",position:"relative"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:[jsx(p,{title:r,children:jsxs(yf,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...l&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(If,{percentage:e,sx:{backgroundColor:"#eeeeee",...l&&{backgroundColor:"transparent",border:"none"}},variants:{...!l&&{animate:{boxShadow:p$1.shadows[4]}}},children:l?jsxs(H,{children:[e,"%"]}):jsxs(Fragment,{children:[e," % ",jsx(Or,{percentage:bf(e)})]})}),i>1&&jsx(motion.div,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:jsx(motion.div,{style:{alignItems:"center",justifyContent:"center",gap:"4px",position:"relative",zIndex:22,overflow:"visible"},initial:{width:0,opacity:0,paddingRight:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",paddingRight:"4px",boxShadow:p$1.shadows[4]},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:"neutral",children:[i,"x"]})})})]})}),jsx(Ie,{className:"payout-status",style:{visibility:o==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:l?"auto":"24px"},children:o&&e$1[o]&&jsx(p,{title:n||s(wt(o)),children:l?jsx(H,{sx:{color:Ti[o].color,border:`1px solid ${Ti[o].color}1a`,backgroundColor:Ti[o].backgroundColor},children:s(wt(o))}):jsx(U,{src:e$1[o],alt:"settled-icon"})})})]})})}var oT=tT;var wf={DELETED:kf,DRAFT:lf,CREATED:mf$1,CANCELLED:Aa,CANCELED:Aa,EXPIRED:Ba,PAID:pf,REFUNDED:vf$1,DELIVERED:qf$1,VIEWED:rf$1,SAVED:sf$1,SCHEDULED:tf$1,PENDING:uf$1,REMINDED:""};styled(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:e.palette.text.primary}));var Dl=styled("img")(()=>({height:"13.125px",width:"12px"})),wi=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),vf=styled("div")(({theme:e})=>({color:e.palette.common.white,background:e.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Af=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));function Pf(e){switch(e){case "CANCELLED":case "DELETED":return {color:"#FF3D00",background:"#FFF5F2"};case "VIEWED":return {color:"#1F88D0",background:"#e1edf8"};case "REFUNDED":return {color:"#4E1FD0",background:"#ede8fb"};case "PAID":return {color:"#2ACE00",background:"#EAFAE5"};case "EXPIRED":return {color:"#FF7A00",background:"#FFF2E5"};case void 0:return {color:"#FF7A00",background:"transparent"};default:return {color:"#818181",background:"#F2F2F2"}}}function Ef({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),l=e?b$d[e]:null,a=e&&a$6[e]&&jsx(Af,{style:r,children:jsx(U,{src:a$6[e],alt:"charge-icon",style:{width:"16px",height:"16px",...n}})}),s=t&&jsx(Fragment,{children:jsx("div",{children:t})});return e?jsx(p,{title:s??i(wt(e)),children:jsxs(Yn,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[a,!!Pn?.includes(e||"")&&jsx(vf,{style:{background:l?.color},children:o})]})}):null}function Mf({status:e,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:l=0,...a}){let{t:s}=useTranslation(),p$1=useTheme(),c=e?wf[e]:null,m=Pf(e),u=`${s(e?.toLowerCase()||"")} ${hn($u(t).valueOf())}`,f=useMemo(()=>jsx(Ef,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),x=useMemo(()=>jsx(p,{title:s("reminded"),children:jsxs(Yn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(Dl,{sx:{width:"14px",height:"14px"},src:le$1,alt:"icon"}),jsx(z,{style:{background:p$1.palette.error.main,fontWeight:600,color:p$1.palette.common.white},children:l})]})}),[l]),I=useMemo(()=>{if(c)return jsx(p,{title:s(u||""),children:jsx(Dl,{src:c,alt:"status icon"})});if(n&&Nt[n])return f;if(l)return x},[c,n,l]);return !e&&!n&&!l?null:jsx(v,{...a,sx:{position:"relative",overflow:"visible"},children:jsx(a$1,{sx:{justifyContent:"flex-start"},expandableCenterRight:o&&e==="VIEWED"&&c?[jsx(z,{style:{marginRight:"8px",color:"#fff",backgroundColor:m.color},children:o})]:void 0,centerIcon:I,leftIcons:l&&c?[x]:void 0,rightIcons:n&&Nt[n]&&c?[f]:void 0})})}function gT({tooltip:e,children:t,badge:o,...n}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(p,{title:e,children:jsx(ct,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(H,{"data-testid":"BadgeCell_TextLabel",sx:{minWidth:"max-content",gap:"0.5rem"},children:[t,(o||0)>1&&jsxs(z,{color:"dark",style:{fontWeight:"bold"},children:["+",o]})]})})}):null})}var CT=gT;var kl={ACTIVE:ii$1,EXPIRED:hi,PENDING:ii$1,SAVED:fi,TRANSACTED:gi,CONSUMED:gi};var xT=(u=>(u.ABANDONED="ABANDONED",u.IN_PROGRESS="IN_PROGRESS",u.VOID="VOID",u.CANCELLED="CANCELLED",u.CAPTURED="CAPTURED",u.INITIATED="INITIATED",u.FAILED="FAILED",u.DECLINED="DECLINED",u.RESTRICTED="RESTRICTED",u.TIMEDOUT="TIMEDOUT",u.UNKNOWN="UNKNOWN",u.AUTHORIZED="AUTHORIZED",u))(xT||{});function yT({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n,errorCode:r,cardId:i,hasChargeIcon:l,hasAuthorizedIcon:a,...s}){let{t:p$1}=useTranslation();return jsx(v,{...s,sx:{position:"relative",overflow:"visible"},children:jsxs(we,{sx:{gap:"0.5rem"},children:[e&&kl[e]&&jsx(p,{title:p$1(wt(e)),children:jsx(U,{src:kl[e],alt:"token-icon"})}),i&&jsx(p,{title:p$1(wt(e)),children:jsx(U,{src:ji,alt:"card-icon"})}),l&&jsx(p,{title:p$1(wt("CAPTURED")),children:jsx(Xe,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n,errorCode:r})}),a&&jsx(p,{title:p$1(wt("AUTHORIZED")),children:jsx(U,{src:f$2.AUTHORIZED,alt:"authorized-icon"})})]})})}var IT=yT;var Vl=styled("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),Lf=styled("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),Rf=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function ST({brandName:e,brandIcon:t,...o}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(Rf,{children:[jsx(Lf,{children:t?jsx(p,{title:e,children:jsx(Vl,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=Bi$1;}})}):jsx(Vl,{src:Bi$1,alt:"brand icon"})}),jsx("span",{children:e})]})})}var TT=ST;function Bf({metadata:e}){let t=Object.keys(e)[0]??"",o=Object.keys(e)[1]??"",n=Object.keys(e)[2]??"",r=Object.keys(e)[3]??"",i=Object.keys(e)[4]??"",l=t||o||n||r||i?`${e[t]?`${e[t]}${e[o]||e[n]||e[r]||e[i]?",":""}`:""}${e[o]?`${e[o]}${e[n]||e[r]||e[i]?",":""}`:""}${e[n]?`${e[n]}${e[r]||e[i]?",":""}`:""}${e[r]?`${e[r]}${e[i]?",":""}`:""}${e[i]??""}`:"";return l?jsx(p,{title:l,children:jsx(Box,{component:"img",src:$j,alt:"meta",sx:{cursor:"pointer"}})}):null}var Vf=styled$1(motion.img,{shouldForwardProp:e=>e!=="width"&&e!=="height"})(({width:e,height:t})=>({width:e||"16px",height:t||"16px"}));var MT=({width:e,height:t,sx:o}={})=>{let n=Bc(useId(),"animated-spinner-icon");return jsx(Vf,{id:n,"data-testid":"AnimatedSpinnerIcon",src:hc,alt:"Loading",className:"spinner-loader",width:e,height:t,sx:o,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}})},Nf=MT;var Wf=Nf;var Hf=styled$1("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"36px",cursor:"pointer"})),Of=styled$1(motion.img)(()=>({width:"16px",height:"16px"}));var kT=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),l=useMemo(()=>r?kc:o?jc:Zj,[r,o]);return jsx(p,{title:t?"":"Pending",children:jsx(Hf,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(Wf,{},"spinner"):jsx(Of,{src:t?l:_j,alt:"Download Report"})})})})};var VT=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(p,{title:`Receipt - ${e}`,children:jsx(H,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:rc,alt:"receipt"})})})});var NT=({receiptId:e})=>jsx(Hr,{children:jsx("span",{children:e})});var WT=({receiptId:e})=>jsx(yi,{children:jsx("span",{children:e})});var Uf=styled("div",{shouldForwardProp:e=>!["licenseNumber","hasClick"].includes(e)})(({theme:e,licenseNumber:t,hasClick:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:o?"pointer":"default",...t&&{padding:"3.5px 8px"}})),Gf=styled(Yn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled("img")(()=>({width:"16px",height:"11.73px"}));var Yf=styled("div",{shouldForwardProp:e=>!["licenseNumber"].includes(e)})(({theme:e,licenseNumber:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:"0",width:"74px",...!t&&{color:"#B1B1B1",width:"84px"}})),jf=styled("img")(()=>({width:"10.5px",height:"10.5px"})),Kf=styled("div")({marginLeft:"auto",width:"auto"});var qf={incomplete:Ij,complete:Hj,reviewed:Hj,verified:Jj};function Xf({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let l=qf[o??"incomplete"];return jsx(v,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(p,{title:e,children:jsx(Uf,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(Gf,{children:[jsx(p,{title:t?Na(t):"",children:jsx(b$2,{countryCode:t})}),jsx(Yf,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(Kf,{children:jsx(jf,{src:l})})]})})})})}function Jf({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(v,{...o,children:jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:t&&jsxs(Fragment,{children:[jsx(Box,{sx:{width:"24px",height:"24px",border:"1px solid #F2F2F2",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e??jsx("img",{src:Tb$1,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Qf={incomplete:Ij,complete:Hj,reviewed:Hj,verified:Jj};var eg=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1.029px solid #F2F2F2",borderRadius:"44px",padding:"4px 8px",lineHeight:"120%"})),tg=styled("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),og=styled("img")(()=>({width:"10.5px",height:"10.5px"})),ng=styled("span")(({theme:e})=>({fontSize:"9.5px",fontWeight:400,color:e.palette.common.white,backgroundColor:e.palette.grey[700],borderRadius:"4px",padding:"1px 2px"})),rg=styled("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),ig=styled("div")({display:"flex",alignItems:"center",gap:"8px"}),ag=styled("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function lg({id:e,status:t,count:o,name:n,...r}){let i=Qf[t??"incomplete"];return jsx(v,{...r,sx:{cursor:"pointer"},children:jsx(p,{title:n,children:jsx(eg,{children:e?jsxs(rg,{children:[jsx(tg,{children:e}),jsxs(ig,{children:[jsx(og,{src:i}),o>1&&jsx("div",{children:jsxs(ng,{children:["+",o-1]})})]})]}):jsx(ag,{children:"Not Available"})})})})}var sg=styled("div",{shouldForwardProp:e=>!["hasClick"].includes(e)})(({theme:e,hasClick:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:t?"pointer":"default"})),pg=styled(Yn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),cg=styled("p",{shouldForwardProp:e=>!["brandName"].includes(e)})(({theme:e,brandName:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"74px",margin:"0",...!t&&{color:"#B1B1B1",width:"84px"}})),mg=styled("img")(()=>({width:"10.5px",height:"10.5px"})),dg=styled("div")({marginLeft:"auto",width:"auto"});var ug={incomplete:Ij,complete:Hj,reviewed:Hj,verified:Jj};function fg({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=ug[t??"incomplete"];return jsx(v,{...r,children:jsx(p,{title:e.name,children:jsx(sg,{hasClick:!!r.onClick,children:jsxs(pg,{children:[n,jsx(cg,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx(dg,{children:jsx(mg,{src:i})})]})})})})}var gg=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Cg=styled("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),xg=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"}));styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));var hg=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},...o&&{boxShadow:"7px 0px 8px 0px #F2F2F2"}}}),yg=styled(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var jT=e=>!e.startsWith("http://")&&!e.startsWith("https://"),Pi=e=>/^https?:\/\//i.test(e),Ig=(e,t)=>{switch(t){case "website":return e;case "physical_store":case "call_center":return null;case "linkedin":case "instagram":case "twitter":case "social_media":return KT(e,t);case "ios":case "android":case "mobile_app":return qT(e,t);default:return e}},KT=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:Pi(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:Pi(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:Pi(e)?null:`https://x.com/${e}`:null},qT=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?Pi(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,bg=e=>{!e||typeof e!="string"||window.open(jT(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function XT({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let l=r.address,a=r.code?.replace(/_/g,""),s=i===e?.length-1,p$1=Ig(r.address??"",r.code??"");return jsx(p,{title:l,children:jsx(mt,{order:i,variants:hg(i,0,s),sx:{width:"36px",cursor:p$1?"pointer":"default"},onClick:()=>{r?.address&&bg(p$1);},children:jsx(Cg,{src:r.logo,alt:a})})},`${r}-${i}`)}),n=o?.length||0;return jsx(v,{...t,children:jsx(gg,{children:o?.length>0?jsx(xg,{layout:true,className:"sales-channels-container",whileHover:"animate",animate:"start",sourcesCount:n||0,variants:{animate:{width:(n||0)*38}},style:{zIndex:29},children:o}):null})})}var ZT=XT;function ow({channels:e}){let t=useRef(null),[o,n]=useState(false),[r,i]=useState(null),l=!!r;useEffect(()=>{t.current&&n(t.current.scrollHeight>20);},[e]);let a=useMemo(()=>(e||[]).filter(s=>!!s.address),[e]);return jsxs(yg,{children:[jsx(Yn,{sx:{display:"flex",flexWrap:"wrap",gap:o?"8px":"4px"},ref:t,children:a.map(s=>jsxs(b$1,{copyTrigger:"press",copyText:s.address,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px","& div":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px"}},children:[s.name?.en,": ",s.address]},s.id))}),o&&jsx(Yn,{onClick:s=>{i(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(tw,{open:l,anchorEl:r,sx:{minWidth:r?.clientWidth},onClose:()=>{i(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:r?.clientWidth,marginTop:"22px"}}},children:jsx(Yn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:a.map(s=>jsxs(b$1,{copyTrigger:"press",copyText:s.address,children:[s.name?.en,": ",s.address]},s.id))})})]})}var nw=ow;var Tg={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function aw({type:e,count:t,sx:o,...n}){let{t:r}=useTranslation(),i=t?.toString();return jsxs(Yn,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$1,{copyTrigger:"press",copyText:e,unknownText:r("noPaymentAgreement"),sx:o,...n,children:e&&Tg[e]}),i&&jsx(b$1,{copyTrigger:"press",copyText:i,sx:{minWidth:"38px"},...n,children:i})]})}var lw=aw;var vg={CYBERSOURCE:sm,MPGS:tm,NETCETERA:um,APPLEPAY:vm,TAP3DS:wm,FSS:Cm,BENEFIT:ym,QPAY:Km,POSTPAY:Jm,BENEFITPAY:xm,MEEZA:Em,STC_PAY:Mm,NGENIUS:Fm,KNET:Dm,PAYPAL:Im,FAWRY:Bm,TPG:Qm,DEEMA:Am,TPAY:Pm,"CAREEM PAY":zm,TABBY:Nm,OMANNET:Hm,NPG:Gm,SPG:Lm,TAMARA:Om};var Pg=styled(Yn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"24px",gap:"8px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper})),Eg=styled("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function Mg({provider:e,...t}){let o=vg[e];return o?jsx(Pg,{children:jsx(Eg,{src:o,alt:e})}):jsx(v,{...t,children:jsx(H,{children:e})})}var Dg={CHARGE:Wk,AUTHORIZE:Ak,SAVE_TOKEN:_g$1},Lg={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},Rg={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var kg=styled(Yn,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=Rg[e];return {display:"flex",alignItems:"center",justifyContent:"start",gap:"4px",minWidth:"86px",width:"100%",height:"24px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${t.border}`,backgroundColor:t.backgroundColor,color:t.color,fontSize:"12px",fontWeight:400}}),Bg=styled("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),Vg=styled("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function Wg({purpose:e,...t}){let o=Dg[e],n=Lg[e];return jsxs(kg,{purposeType:e,...t,children:[jsx(Bg,{src:o,alt:e}),jsx(Vg,{children:n})]})}var Hg=8,dw=16,yt=Hg*2+dw,Og=100,_g=6,uw=yt+_g+Og,zg=styled$1(v)(()=>({position:"relative",overflow:"visible",width:yt,minWidth:yt,maxWidth:yt,display:"inline-flex",padding:0})),$g=styled$1(Yn)(()=>({position:"relative",width:yt,height:24,flexShrink:0,overflow:"visible"})),Ug=styled$1(Yn,{shouldForwardProp:e=>e!=="hasLabel"})(({theme:e,hasLabel:t})=>({position:"absolute",top:0,left:0,width:yt,minWidth:yt,maxWidth:yt,height:24,display:"inline-flex",alignItems:"center",gap:_g,paddingInline:Hg,borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper,boxSizing:"border-box",cursor:"pointer",overflow:"hidden",transition:e.transitions.create(["max-width","box-shadow"]),"& img":{flexShrink:0},...t&&{"&:hover":{width:"max-content",maxWidth:uw,zIndex:100,boxShadow:"0px 0px 16px 0px #00000021","& .link-cell-label":{maxWidth:Og,opacity:1}}}})),Gg=styled$1("span")(({theme:e})=>({display:"inline-block",maxWidth:0,opacity:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:12,lineHeight:"16px",color:e.palette.text.primary,transition:e.transitions.create(["max-width","opacity"],{duration:e.transitions.duration.shorter})}));function gw({url:e,label:t}){let o=n(),n$1=()=>{try{db(e),o.success("Copied!");}catch{o.error("Failed to copy");}};return e?jsx(zg,{children:jsx($g,{children:jsxs(Ug,{hasLabel:!!t,onClick:n$1,children:[jsx(d,{src:Kl$1,alt:"link"}),t&&jsx(Gg,{className:"link-cell-label",children:t})]})})}):null}var Cw=memo(gw);function n3({items:e}){let[t,o]=useState(null),n=!!t,r=useCallback(({quantity:a,currency:s,amount:p,name:c})=>`${a?`Qty ${a}`:""} ${c?`- ${c}`:""} ${s||p?"-":""} ${s||""} ${p||""}`,[]);if(!e||!e.length)return null;let[i,...l]=e;return jsxs(Yn,{sx:{display:"flex",gap:"4px",alignItems:"center"},children:[jsx(b$1,{children:jsx(j,{noWrap:true,sx:{maxWidth:e.length>1?190:220,fontSize:11},children:r(i)})}),e.length>1&&jsx(Yn,{onClick:a=>{o(a.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(tw,{open:n,anchorEl:t,sx:{minWidth:t?.clientWidth},onClose:()=>{o(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:t?.clientWidth,marginTop:"22px"}}},children:jsx(Yn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:l?.map(a=>jsx(b$1,{copyTrigger:"press",copyText:r(a),children:r(a)},a.id))})})]})}var Yg="ListHeader";var jg=styled(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),Kg=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%",marginBottom:e.spacing(2.25),marginTop:e.spacing(2)})),qg=styled(j)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.v2.typography.fontWeightMedium,lineHeight:"120%"})),Xg=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),Zg=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),Jg=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function Li({children:e,component:t="header",...o}){return jsx(jg,{component:t,...o,children:e})}function Ri({title:e,toolbar:t}){return jsxs(Kg,{children:[jsx("span",{children:!!e&&jsx(qg,{children:e})}),t]})}function ki({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(Zg,{as:"aside",children:[o,jsx(a$5,{status:e?.value,availableStatuses:e?.options,onStatusChange:e?.onChange,isActiveFilterVisible:n,buttonSx:e?.buttonSx}),jsx(d$3,{value:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,onDismiss:t?.onDismiss})]})}var Ao=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:"4px",background:e.palette.common.white,padding:"8px",border:"1px solid",borderColor:e.palette.divider,gap:8,height:32,cursor:"pointer","&:hover":{border:"1px solid",borderColor:e.palette.info.dark,boxShadow:e.shadows[7]}})),Bi=styled(Box)(({theme:e})=>({background:e.palette.common.white,display:"flex",gap:e.spacing(1),alignItems:"center",color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,textTransform:"capitalize",position:"relative",transition:"0.5s",paddingRight:0,marginRight:0,"&:after":{content:'""',position:"absolute",left:-8,right:0,width:"100%",height:"100%",boxShadow:e.shadows[11],borderRadius:e.spacing(.5),paddingInlineStart:e.spacing(1),paddingTop:"9px",paddingBottom:"9px",paddingInlineEnd:"9px",zIndex:-1},"& > *:last-child":{marginRight:0,paddingRight:"6px"}})),Po=styled(Box)(({theme:e})=>({background:e.palette.common.white,borderRadius:e.spacing(1),boxShadow:e.shadows[5],border:"1px solid",borderColor:e.palette.divider,zIndex:5,fontSize:"11px",width:192})),Eo=styled(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),Mo=styled(Box,{shouldForwardProp:e=>e!=="addColumnViewEl"})(({theme:e})=>({padding:e.spacing(1),paddingInlineEnd:2,borderBottom:"1px solid",borderColor:e.palette.divider,display:"flex",alignItems:"center",height:32,cursor:"pointer",img:{height:12},".check-icon":{height:"auto",marginInlineEnd:e.spacing(1)},"&:hover":{color:e.palette.info.dark,fontWeight:e.typography.fontWeightBold},"&.add-column":{justifyContent:"space-between",paddingInlineEnd:e.spacing(1),position:"relative",border:"none",zIndex:5,borderBottom:"1px solid",borderColor:e.palette.divider,borderTopRightRadius:e.spacing(1),borderTopLeftRadius:e.spacing(1),"&:hover":{boxShadow:e.shadows[6]}}})),Do=styled(Box)(()=>({width:15})),Mn=styled(Box)(()=>({width:16})),oC=styled(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),nC=styled(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),rC=styled(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),iC=styled(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),aC=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:e.palette.grey[50],cursor:"pointer","&:hover":{backgroundColor:e.palette.grey[100]}})),lC=styled(Box,{shouldForwardProp:e=>e!=="isHovered"&&e!=="isDate"})(({theme:e,isHovered:t,isDate:o})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:t?e.palette.action.hover:e.palette.background.paper,cursor:o?"default":"grab","&:hover":{backgroundColor:o?e.palette.background.paper:e.palette.action.hover},"&:last-child":{borderBottom:"none"}})),_l=styled(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),zl=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),sC=styled(Box)(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,height:35,borderTop:"1px solid",borderColor:e.palette.divider,background:"#F6F8FACC",backdropFilter:"blur(24px)"})),pC=styled(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),Vi=styled(Paper)(()=>({paddingTop:4,paddingBottom:4,minWidth:180,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",borderRadius:"8px"}));styled(Box)(()=>({display:"flex",alignItems:"center",padding:"8px 12px",cursor:"pointer"}));var cC=styled(Button)(({theme:e})=>({color:e.palette.error.main,textTransform:"none",fontSize:10,fontWeight:500,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,"&:hover":{backgroundColor:"transparent"}})),mC=styled(Button)(({theme:e})=>({fontSize:9,fontWeight:600,borderRadius:4,paddingLeft:20,paddingRight:20,paddingTop:8,paddingBottom:8,height:28,textTransform:"none",backgroundColor:e.palette.info.dark,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{backgroundColor:e.palette.grey[300],color:e.palette.grey[500]}}));styled(TextField)(({theme:e})=>({"& .MuiFilledInput-root":{borderRadius:"8px",backgroundColor:e.palette.background.paper,border:"1px solid",borderColor:e.palette.divider,"&:hover":{backgroundColor:e.palette.background.paper},"&.Mui-focused":{backgroundColor:e.palette.background.paper},"&::before, &::after":{display:"none"}}}));var $l={display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0,"& .MuiSvgIcon-root":{width:16,height:16},"& img":{width:14,height:14}},dC=styled(motion.div)(({theme:e})=>({position:"fixed",display:"flex",flexDirection:"column",maxHeight:"calc(100vh - 46px)",backgroundColor:e.palette.background.paper,boxShadow:"0px 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:12,overflow:"hidden",boxSizing:"border-box"})),uC=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),cursor:"pointer","&:hover":{backgroundColor:e.palette.action.hover}})),fC={p:0,width:14,height:14,minWidth:14,minHeight:14,"& .MuiSvgIcon-root":{width:16,height:16}},gC=styled(Box)(()=>({minWidth:200,display:"flex",flexDirection:"column",maxHeight:"80vh",overflow:"hidden"})),CC=styled(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:6,paddingRight:6,minHeight:0})),xC=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-end",gap:12,paddingTop:8,paddingBottom:8,paddingLeft:12,paddingRight:12,flexShrink:0,borderTop:"1px solid",borderColor:e.palette.divider})),hC={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},yC=e=>({fontSize:11,fontWeight:500,textTransform:"none",backgroundColor:"info.dark",minWidth:80,height:38,borderRadius:"8px",boxShadow:"none","&:hover":{backgroundColor:e.palette.info.dark}});function Gl(e,t){let[o,n]=useState(null),[r,i]=useState(null),l=useCallback(()=>{n(null),i(null);},[]),a=useCallback((p,c)=>{n(p.currentTarget),i(c);},[]),s=useCallback(()=>{r&&l();},[r,l]);return useEffect(()=>{e||(l(),t?.());},[e,t,l]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:l,handleSubMenuOpen:a,handleMenuScroll:s}}function Lw(e){let t=e;for(;t&&t!==document.body;){let n=window.getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement;}return document.documentElement}function Yl(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),l=useRef(0),a=useRef(false),s=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((x,I)=>{a.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:x,clientY:I+l.current,pointerType:"mouse",isPrimary:true})),a.current=false;},[]),c=useCallback(()=>{if(o.current!==null)return;let x=()=>{let I=i.current;if(!t.current||!I)return;let b=I.getBoundingClientRect(),{x:S,y:d}=n.current,C=d-b.top,y=b.bottom-d;if(C>0&&C<60){let w=(60-C)/60*15;I.scrollTop-=w,l.current-=w,p(S,d);}else if(y>0&&y<60){let w=(60-y)/60*15;I.scrollTop+=w,l.current+=w,p(S,d);}o.current=requestAnimationFrame(x);};o.current=requestAnimationFrame(x);},[p]),m=useCallback(x=>{a.current||(n.current={x:x.clientX,y:x.clientY},r.current=x.pointerId,t.current&&l.current!==0&&(x.stopImmediatePropagation(),p(x.clientX,x.clientY)));},[p]),u=useCallback(()=>{i.current=Lw(e.current),l.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),c();},[e,m,c]),f=useCallback(()=>{t.current=false,l.current=0,s(),window.removeEventListener("pointermove",m,{capture:true});},[m,s]);return useEffect(()=>()=>{t.current=false,s(),window.removeEventListener("pointermove",m,{capture:true});},[m,s]),{onDragStart:u,onDragEnd:f}}function Kl({columns:e,setTableViews:t}){let o=useCallback(i=>{let l=i.map(a=>e.find(s=>s.name===a)).filter(a=>!!a);t?.(l);},[e,t]),n=useCallback(i=>{let l=e.map(a=>{if(a.name!==i)return a;let s=a.menuItems&&a.menuItems.length>0,p=!a.selected;if(!s)return {...a,selected:p};let c=a.menuItems?.map(m=>({...m,selected:p}));return {...a,selected:p,menuItems:c}});t?.(l);},[e,t]),r=useCallback((i,l)=>{let a=e.map(s=>{if(s.name!==i)return s;let p=s.menuItems?.map(m=>m.name===l?{...m,selected:!m.selected}:m),c=p?.some(m=>m.selected)??false;return {...s,menuItems:p,selected:c}});t?.(a);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function Xl({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let l=e.menuItems&&e.menuItems.length>0,a=o===e.name,s=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(f=>f.selected)&&!e.menuItems?.every(f=>f.selected)),[e.selected,e.menuItems]),c=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(f=>{l&&r(f,e.name);},[l,r,e.name]),u=useCallback(()=>{l||i();},[l,i]);return {isIndeterminate:p,hasSubmenuItems:l,isSubmenuOpen:a,isFirstItem:s,handleColumnClick:c,handleMouseEnter:m,handleMouseLeave:u}}var W=(e="")=>e.toLowerCase()==="date",Le=(e="")=>e.toLowerCase()==="index",Ni=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(a=>a.lang===t)?.text||r.name[0]?.text||r.code,l=r.fields?.length?r.fields.map(a=>({name:a.code,label:a.name?.find(s=>s.lang===t||s.lang==="")?.text||a.code,selected:a.default??false})):void 0;o.push({name:r.code,label:i,selected:W(r.code)?true:r.default??false,menuItems:l?.length?l:void 0});});}),o},kw=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?Ni([n]):[]},Zl=(e,t,o="en")=>{let n=e.map((i,l)=>{let a=i.menuItems?.map(p=>({code:p.name,name:[{text:typeof p.label=="string"?p.label:p.name,lang:o||""}],default:p.selected??false})),s=typeof i.label=="string"?i.label:i.name;return {code:i.name,name:[{text:s,lang:o}],order:l+1,default:i.selected??false,...a?.length?{fields:a}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},Bw=e=>{let t=new Map;return e.forEach(o=>{o.layout.forEach(n=>{let r=t.get(n.code);if(r){let i=new Set(r.columns.map(l=>l.code));n.columns.forEach(l=>{i.has(l.code)||r.columns.push(l);});}else t.set(n.code,{...n,columns:[...n.columns]});});}),Array.from(t.values())};var Vw=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),Nw=(e,t)=>e.map(o=>({...o,default:o.id===t})),Wi=e=>e.role??(e.default?"default":void 0),_t=e=>!!e.role||!!e.default,Re=e=>!_t(e),bC=e=>Re(e),Ln=e=>e.filter(bC).length,Jl=e=>e.filter(Re).length,Fi=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(a=>{let s=t==="sheet"?"sheet":"advanced",p=a.layout.find(T=>T.code.toLowerCase()===s),c=p?Ni([p],o):[],m=a.id,u=xb$1,f=yb$1,x=c.some(T=>W(T.name))?c:[f,...c],I=x.findIndex(T=>W(T.name)),S=(I>0?[x[I],...x.filter(T=>!W(T.name))]:x).filter(T=>!Le(T.name)),d=[u,...S],C=Wi(a),y=_t(a),w={id:m,label:a.name,role:C,isCustom:!y,selected:a.selected,default:!!a.default,columns:d.map(T=>T.name),submenu:d};y?(a.default&&!i&&(i=d),r.push(w)):n.push(w);});let l=r.find(a=>a.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:l}},Ql=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=Fi(e,t,o),l=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:l}},Hi=(e,t)=>{let o=[];Re(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=xb$1;if(!o.some(m=>W(m.name)))return [n,yb$1,...o];let i=o.findIndex(m=>W(m.name)),l=i>=0?o[i]:yb$1,a=o.filter(m=>!W(m.name)&&!Le(m.name)),s=[l,...a],p=s.some(m=>Le(m.name)),c=s.findIndex(m=>Le(m.name));if(p&&c>0){let m=s[c],u=s.filter(f=>!Le(f.name));return [m,...u]}return p&&c===0?s:[n,...s]},Ww=(e,t)=>Hi(e,t).length>0,Ro=e=>e.filter(t=>!Le(t.name));var be=e=>e.toLowerCase(),SC=e=>new Map(e.filter(t=>!W(t.name)).map(t=>[be(t.name),t])),TC=(e,t)=>e.some(o=>be(o)===be(t)),es=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>be(r.name)===be(o.name));return {...o,selected:n?.selected??false}})}),Rn=e=>{if(!e.menuItems?.length)return {checked:e.selected??false,indeterminate:false};let t=e.menuItems.filter(o=>o.selected).length;return {checked:t>0,indeterminate:t>0&&t<e.menuItems.length}},os=(e,t)=>e.map(o=>{if(o.name!==t)return o;let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),kn=(e,t,o)=>e.map(n=>{if(n.name!==t)return n;let r=n.menuItems?.map(l=>l.name===o?{...l,selected:!l.selected}:l),i=r?.some(l=>l.selected)??false;return {...n,menuItems:r,selected:i}}),ns=(e,t)=>e.map(o=>{if(W(o.name))return o;let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),rs=e=>{let t=e.filter(o=>!W(o.name));return t.length===0?false:t.every(o=>o.menuItems?.length?o.menuItems.every(n=>n.selected):o.selected)},is=(e,t)=>e.filter(r=>!W(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,as=(e,t)=>e.trim().length>0&&e.length<=t,le=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),ls=(e,t)=>e.map(o=>{if(o.name!==t)return o;if(W(o.name))return {...o,selected:true};let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),ss=(e,t)=>e.map(o=>{if(W(o.name))return {...o,selected:true};let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),ps=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),cs=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,ts=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Bn=(e,t)=>{if(e.length!==t.length)return false;let o=ts(e),n=ts(t);for(let r=0;r<o.length;r++){let i=o[r],l=n[r];if(i.name!==l.name||i.selected!==l.selected)return false;if(i.menuItems&&l.menuItems){if(i.menuItems.length!==l.menuItems.length)return false;for(let a=0;a<i.menuItems.length;a++)if(i.menuItems[a].name!==l.menuItems[a].name||i.menuItems[a].selected!==l.menuItems[a].selected)return false}else if(i.menuItems||l.menuItems)return false}return true},Fw=e=>e.filter(t=>!W(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),ms=(e,t)=>{let o=e.filter(i=>!W(i.name)).map(i=>i.name),n=SC(t),r=[];for(let i of o){let l=e.find(s=>be(s.name)===be(i)),a=n.get(be(i));a?r.push(l?es(a,l):{...a,selected:false,menuItems:a.menuItems?.map(s=>({...s,selected:false}))}):l&&r.push(l);}for(let[,i]of n)if(!TC(o,i.name)){let l=e.find(a=>be(a.name)===be(i.name));r.push(l?es(i,l):{...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});}return r},ds=e=>e.filter(t=>!W(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),us=(e,t)=>{let o=SC(e),n=t.filter(i=>!W(i.name)).map(i=>i.name),r=[];for(let i of n){let l=t.find(s=>be(s.name)===be(i)),a=o.get(be(i));a&&l?r.push(es(a,l)):a&&r.push({...a,selected:false,menuItems:a.menuItems?.map(s=>({...s,selected:false}))});}for(let[,i]of o)TC(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(l=>({...l,selected:false}))});return r};function wC(e,t,o="en"){if(!e?.layout?.length)return [];let n=Ya(t)?"sheet":"advanced",r=e.layout.find(a=>a.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(a=>{let s=a.name?.find(c=>c.lang===o)?.text||a.name?.[0]?.text||a.code,p=a.fields?.length?a.fields.map(c=>({name:c.code,label:c.name?.find(m=>m.lang===o||m.lang==="")?.text||c.code,selected:c.default??false})):void 0;return {name:a.code,label:s,selected:W(a.code)?true:a.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(a=>W(a.name))?i:[{name:yb$1.name,label:yb$1.label,selected:true},...i]}var Oi=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function _i(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function Hw(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,l)=>Oi(i)-Oi(l))})),n=wC(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:Wi(e),isCustom:Re(e),default:e.default}}var zi=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=Xa(t)?"Advanced":"Sheet",r=e.layout.find(i=>{let l=i.code?.trim();return l===n||l?.toLowerCase()===n.toLowerCase()})||e.layout.find(i=>{let l=i.code?.trim()?.toLowerCase();return Xa(t)?l==="default"||l==="advanced":l==="sheet"||l==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(l=>{let s=!!l.fields?.length&&l.fields.some(c=>c.default??false),p=(l.default??false)||s;return {code:l.code,name:l.name&&l.name.length>0?l.name:[{text:l.code,lang:"en"}],selected:p,sort_order:Oi(l),fields:l.fields?.map(c=>({code:c.code.toLowerCase(),type:"single",parameters:[{parameter:c.code.toLowerCase(),code:c.code.toLowerCase(),selected:c.default??false}]}))||[{code:l.code.toLowerCase(),type:"single",parameters:[{parameter:l.code.toLowerCase(),code:l.code.toLowerCase(),selected:l.default??false}]}]}}).sort((l,a)=>(l.sort_order??999)-(a.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let l=r.name.toLowerCase(),a;r.menuItems&&r.menuItems.length>0?a=r.menuItems.filter(m=>m.selected):a=[{name:l,label:r.label||r.name,selected:true}];let s=a.length>0?a.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:l,code:l}],p=a.length>1?"combined":"single";return {code:r.name,name:[{text:r.label||r.name,lang:"en"}],selected:r.selected,sort_order:i+1,fields:[{code:l,type:p,parameters:s}]}}):[]},Ow=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?zi(o,t):[]};function fs(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function gs(e,t){let o=t?.name??e?.name??"",n=t?.layout,r=Array.isArray(n)?n[0]:n??null,l=[...e?.layout??[]];if(r){let a=r.code?.toLowerCase(),s=l.findIndex(p=>p.code?.toLowerCase()===a);s>=0?l[s]=r:l.push(r);}return {name:o,layout:l}}var Cs=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var vC=e=>[...Ab$1[e]??Ab$1.default],_w=e=>Bb$1[e]??Bb$1.default,zw=(e,t)=>({code:e,name:[{text:zb$2[e],lang:"en"}],selected:true,sort_order:t}),$w=(e,t)=>e?.layout?.some(o=>vC(t).includes(o.code?.toLowerCase()??""))??false,xs=(e,t,o)=>{let n=Bb$1[t],r=o?.layout?.find(l=>l.code?.toLowerCase()===n.toLowerCase()),i=r?{...r,columns:r.columns?.map(l=>({...l,name:l.name?.map(a=>({...a})),fields:l.fields?.map(a=>({...a,name:a.name?.map(s=>({...s}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var $i=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:l,allTemplates:a}=Ql(t,e,o),p=(n?Fi([n],e,o).defaultTemplate:void 0)??l,c=p?.submenu?structuredClone(p.submenu):[],m=Ln(t);return {customViews:r,defaultTemplates:i,defaultTemplate:l,allTemplates:a,defaultColumns:c,customTemplateCount:m}},[t,e,o,n]);var Ui=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:l,allTemplates:a,customTemplateCount:s})=>{let[p,c]=useState(null),[m,u]=useState(false),[f,x]=useState(null),[I,b]=useState(false),[S,d]=useState(null),[C,y]=useState(null),[w,T]=useState(),[h,A]=useState(a.find(L=>L.selected)?.id??l?.id),P=useRef(a.find(L=>L.selected)?.id??l?.id),M=useCallback(L=>{let V=L.submenu?.filter(J=>J.selected)||[];return {...L,submenu:V,columns:V.map(J=>J.name)}},[]),E=useCallback(L=>{P.current=L?.id,t?.(L?M(L):void 0);},[t,M]),k=useMemo(()=>h?a.find(L=>L.id===h):l,[a,h,l]),N=useMemo(()=>le(k?.submenu||i),[k,i]),F=useMemo(()=>({id:h||l?.id||"default",label:k?.label||l?.label||"Default"}),[k,h,l?.id,l?.label]);useEffect(()=>{let L=a.find(he=>he.selected)?.id,V=l?.id,J=h?a.some(he=>he.id===h):false;if(!(h&&!J&&L!==h)){if(L&&L!==h){A(L);return}if(!h){A(L??V);return}J||A(L??V);}},[a,l?.id,h]),useEffect(()=>{!h||!k||k.id===h&&P.current!==h&&(P.current=h,t?.(M(k)));},[h,k,t,M]);let Z=useCallback(L=>{c(V=>V?null:L.currentTarget);},[]),fe=useCallback(()=>{c(null);},[]),Pe=useCallback((L,V)=>{A(V?.id),E(V),fe();},[fe,E]),xe=useCallback((L=false,V,J,he)=>{s!=null&&s>=3||(x(null),b(L),d(V??null),y(J?.length?J:null),T(he),u(true),c(null));},[s]),_=useCallback(L=>{let V=a.find(J=>J.id===L.id)??L;x(V),b(true),d(null),y(V.submenu?.length?le(V.submenu):null),u(true);},[a]),je=useCallback(()=>{u(false),x(null),b(false),d(null),y(null),T(void 0);},[]);useEffect(()=>{if(!m||!f?.id)return;let L=a.find(V=>V.id===f.id);L&&(x(L),y(L.submenu?.length?le(L.submenu):null));},[m,f?.id,a]);let ga=useCallback(async L=>{if(f){let V=f.id;await n?.(V,L),A(V);let J=a.find(he=>he.id===V)??f;E(J),fe();}else {let V=await o?.({...L,sourceTemplateId:w});if(V?.id){A(V.id);let J=a.find(he=>he.id===V.id);E(J??{id:V.id,label:V.name,isCustom:true,columns:L.selectedColumns.map(he=>he.name),submenu:L.selectedColumns});}}},[f,n,o,fe,a,E,w]),Ca=useCallback(async L=>{let V=a.find(J=>J.id===L);await r?.(V?.id??L),h===(V?.id??L)&&A(l?.id);},[a,r,h,l]);return {anchorEl:p,isCreateDialogOpen:m,editingView:f,selectedViewInfo:F,shouldUseCurrentState:I,selectedView:k,currentViewColumns:N,initialColumnsForCreate:S,availableColumnsForCreate:C,handleViewButtonClick:Z,handleCloseViewDropdown:fe,handleSelectedViewInfo:Pe,handleOpenCreateDialog:xe,handleOpenEditDialog:_,handleCloseCreateDialog:je,handleSaveView:ga,handleDeleteView:Ca}};var ko=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((p,c)=>{r.current&&(clearTimeout(r.current),r.current=null),t(p),n(c);},[]),l=useCallback(()=>{r.current=setTimeout(()=>{t(null),n(null);},0);},[]),a=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),t(null),n(null);},[]);return {hoveredColumn:e,anchorEl:o,openSubmenu:i,closeSubmenu:l,cancelClose:a,forceClose:s}};var EC=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((s,p)=>{t(s),n(p);},[]),l=useCallback(()=>{t(null),n(null);},[]),a=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:l,cancelNestedClose:a}};var Ss=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,l]=useState(()=>n?.label||""),[a,s]=useState([]),p=useRef(false),c=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:u,anchorEl:f,openSubmenu:x,closeSubmenu:I,cancelClose:b}=ko(),S=xb$1,d=yb$1;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let F=n.submenu&&n.submenu.length>0?n.submenu:o,Z=t.length>0?t:F,Pe=ms(F,Z).filter(je=>!Le(je.name)&&!W(je.name)),xe=[S,d,...Pe];s(xe),c.current=le(xe);let _=n.label?.trim()||"";m.current=_,l(_);}else {let F=t.length>0?t:r,fe=(r&&r.length>0?us(F,r):ds(F)).filter(xe=>!Le(xe.name)&&!W(xe.name)),Pe=[S,d,...fe];s(Pe),c.current=le(Pe),m.current="",l("");}else if(e&&n){let F=n.label?.trim()||"";l(F);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,S,d]);let C=useMemo(()=>a.map(N=>N.name),[a]),y=useMemo(()=>rs(a),[a]),w=useMemo(()=>is(a,y),[a,y]),T=useMemo(()=>as(i,20),[i]),h=useMemo(()=>{let N=i.trim()!==m.current,F=c.current.length>0&&!Bn(a,c.current);return N||F},[i,a]);return {templateName:i,setTemplateName:l,selectedColumns:a,columnNames:C,allSelected:y,someSelected:w,isNameValid:T,hasChanges:h,hoveredColumn:u,anchorEl:f,openSubmenu:x,closeSubmenu:I,cancelClose:b,handleReorder:N=>{let F=N.filter(Z=>!W(Z)).flatMap(Z=>a.find(fe=>fe.name===Z)??[]);s([S,d,...F]);},handleColumnToggle:N=>{s(F=>os(F,N));},handleSubItemToggle:(N,F)=>{s(Z=>kn(Z,N,F));},handleSelectAll:()=>{s(N=>ns(N,!y));},handleResetToDefault:()=>{c.current.length>0&&s(le(c.current));}}};function ws({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:l,lang:a="en",mainDefaultTemplate:s}){let p=useMemo(()=>s??e.find(d=>d.default),[e,s]),c=e.find(d=>d.selected)?.id??p?.id,m=useCallback(d=>{t(C=>C.find(w=>w.selected)?.id===d?C:C.map(w=>({...w,selected:d?w.id===d:false})));},[t]),u=useCallback(async({name:d,layout:C,sourceTemplateId:y})=>{if(Ln(e)>=3)return;let w=e.find(P=>P.id===y)??e.find(P=>P.id===c)??p,T=xs(C,i,w),h=await o({name:d,layout:T}),A=_i(h);return t(P=>[...P.filter(E=>E.id!==A.id).map(E=>({...E,selected:false})),{...A,selected:true}]),{id:h.id,name:h.name??""}},[o,t,i,p,e,c]),f=useCallback(async d=>{await r(d),t(C=>C.filter(y=>y.id!==d)),m(c===d?p?.id:c);},[r,t,p,m]),x=useCallback(async(d,C)=>{let y=e.find(P=>P.id===d),{name:w,layout:T}=gs(y,C),h=await n(d,{name:w,layout:T}),A=_i(h);t(P=>fs(P,M=>M.id===d,A)),m(A.id);},[e,n,t,m]),I=useMemo(()=>({templates:e,onCreateCustomView:u,onEditCustomView:x,onDeleteCustomView:f,isLoading:l,mainDefaultTemplate:s}),[e,u,x,f,l,s]),b=useCallback(d=>{if(!p){m(void 0);return}if(!d?.id){m(p.id);return}if(_t(d)){m(d.id);return}let C=e.find(y=>y.id===d.id);if(C){m(C.id);return}Re(d)&&m(d.id);},[e,p,m]),S=useMemo(()=>{let d=e.find(y=>c?y.id===c:false)??p;if(!d)return [];let C=zi(d,i);return C.length>0?C:[]},[i,e,c,p]);return {customViews:I,onViewChange:b,columnsView:S,selectedViewId:c}}function Jw({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:l,handleSubMenuClose:a}){let{t:s}=useTranslation(),p=useTheme(),{isIndeterminate:c,hasSubmenuItems:m,isSubmenuOpen:u,isFirstItem:f,handleColumnClick:x,handleMouseEnter:I,handleMouseLeave:b}=Xl({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:l,handleSubMenuClose:a}),S=d=>d?s(d)??sf(d):"";return jsxs(Yn,{sx:{borderTop:`1px solid ${p.palette.divider}`,...f&&{borderTop:"none",height:33}},children:[jsxs(V,{isIndeterminate:c,isSelected:e.selected,onMouseEnter:I,onMouseLeave:b,onClick:x,children:[jsx(Yn,{sx:{flex:1},children:S(e.label)}),m&&jsx("img",{src:xb,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(R,{open:u,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:a,children:e.menuItems?.map(d=>jsx(V,{isSelected:e.selected&&d.selected,onClick:()=>i(e.name,d.name),children:S(d.label)},d.name))})]},e.name)}var RC=Jw;function o0({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:l}=useTranslation(),a=useMemo(()=>n||[],[n]),s=useMemo(()=>a.map(S=>S.name),[a]),{reorderColumns:p,toggleColumnSelection:c,toggleSubmenuItem:m}=Kl({columns:a,setTableViews:o}),{subMenuAnchorEl:u,openSubMenuName:f,handleSubMenuClose:x,handleSubMenuOpen:I,handleMenuScroll:b}=Gl(e,i);return jsxs(Eo,{"data-testid":"TableView_CustomViews",children:[jsxs(Ao,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:l("columns")}),jsx("img",{src:Eb,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsxs(R,{open:e,anchorEl:r,"data-testid":"TableView_CustomViews_Popper",sx:{padding:0,marginTop:"8px",borderRadius:1},children:[e&&jsx(B,{onClick:i}),jsx(Po,{component:"article","data-testid":"TableView_CustomViews_List",children:jsx(Reorder.Group,{as:"div",axis:"y",onReorder:p,values:s,onScroll:b,children:a.map((S,d)=>jsx(RC,{column:S,index:d,openSubMenuName:f,subMenuAnchorEl:u,toggleColumnSelection:c,toggleSubmenuItem:m,handleSubMenuOpen:I,handleSubMenuClose:x},S.name))})})]})]})}var As=memo(o0);function a0({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:l}=useTranslation();return jsxs(Eo,{"data-testid":"TableView_DefaultViews",children:[jsxs(Ao,{onClick:a=>{n(a);},children:[jsx("div",{children:t.label}),jsx("img",{src:Eb,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(r0,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(Po,{children:[Eb$1.map(a=>jsxs(Mo,{onClick:()=>{o(a),r?.(a);},children:[a.id===t.id?jsx("img",{className:"check-icon",src:Fb,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:a.label}),jsx(Mn,{})]},a.id)),jsxs(Mo,{sx:{border:"none"},onClick:a=>{a.stopPropagation(),o(Db),r?.(Db);},children:[t.id===Db.id?jsx("img",{className:"check-icon",src:Fb,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:l("createCustomView")}),jsx(Mn,{})]})]})})]})}var Ps=Ds.memo(a0);function c0({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[l,a]=useState(null),[s,p$1]=useState(null),[c,m]=useState(null),[u,f]=useState(Cb$1),{t:x}=useTranslation(),I=C=>{e?.(),a(C.currentTarget),t(true);},b$1=()=>{p$1(null),m(null);},S=()=>{a(null),t(false),f(Cb$1);},d$1=C=>{f(C),C.id!==Db.id&&r?.(C),b$1();};return l?jsx(p0,{onClickAway:b$1,children:jsxs(Bi,{"data-testid":"TableView",children:[u.id===Db.id&&jsx(As,{tableViews:n,setTableViews:o,anchorEl:c,open:!!c,onSelect:C=>{m(c?null:C.currentTarget),p$1(null);},onClose:()=>{m(null);}}),jsx(Ps,{open:!!s,anchorEl:s,setSelectedViewInfo:C=>{d$1(C);},selectedViewInfo:u,onSelect:C=>{p$1(s?null:C.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(Ao,{sx:{width:32,justifyContent:"center"},onClick:S,children:jsx("img",{src:Gb$1,alt:"close"})})]})}):jsx(p,{title:x("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"TableView_no_anchorViewEl",onClick:I,"aria-label":x("tableView")})})}var Es=memo(c0);var BC=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:l,isModified:a=false})=>{let{hoveredNestedColumn:s,nestedSubmenuAnchorEl:p,openNestedSubmenu:c,closeNestedSubmenu:m,cancelNestedClose:u}=EC();return jsxs(Fragment,{children:[jsxs(uC,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(f$1,{checked:t,indeterminate:o,onChange:f=>{f.stopPropagation(),n();},onClick:f=>{f.stopPropagation();},sx:fC})}),jsx(Typography,{component:"button",disabled:!a,onClick:f=>{f.stopPropagation(),a&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:a?"pointer":"default",padding:0,opacity:a?1:.5,pointerEvents:a?"auto":"none","&:hover":a?{textDecoration:"underline"}:void 0},children:"Reset"})]}),jsx(v$1,{}),jsx(CC,{onScroll:m,children:jsx(Box,{component:"ul",sx:{listStyle:"none",padding:0,margin:0},children:e.map((f,x)=>{let I=f.menuItems&&f.menuItems.length>0,{checked:b,indeterminate:S}=Rn(f),d=W(f.name);return jsxs(Box,{component:"li",sx:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%"},children:[jsxs(Box,{sx:{position:"relative"},onMouseEnter:C=>I&&c(f.name,C.currentTarget),onMouseLeave:()=>I&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(V,{isSelected:I?b:f.selected,isIndeterminate:I?S:false,isDisabled:d,onClick:()=>{d||i(f.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:f.label||f.name})}),I&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:yb,alt:"arrow",style:{height:12}})})]}),I&&jsx(Popper,{open:s===f.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:u,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Vi,{children:f.menuItems?.map((C,y)=>jsxs(Ds.Fragment,{children:[jsx(V,{isSelected:C.selected,isDisabled:d,onClick:()=>{d||l(f.name,C.name);},children:C.label||C.name}),y<(f.menuItems?.length??0)-1&&jsx(v$1,{})]},C.name))})]})})]}),x<e.length-1&&jsx(v$1,{})]},f.name)})})})]})};function I0({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:l=[],onEditCustomView:a,defaultColumns:s=[],defaultTemplate:p$1,defaultTemplates:c=[],customTemplateCount:m,isLoading:u}){let{t:f}=useTranslation(),{hoveredColumn:x,anchorEl:I,openSubmenu:b,closeSubmenu:S,cancelClose:d,forceClose:C}=ko(),[y,w]=Ds.useState(null),[T,h]=Ds.useState(null),A=useMemo(()=>[...c.length?c:p$1?[p$1]:[],...l],[c,p$1,l]),P=useCallback(R=>R.submenu?.length?R.submenu:s,[s]),M=useCallback(R=>R?Hi(R,P(R)):s,[s,P]),E=useCallback(R=>M(R).length>0,[M]),k=useMemo(()=>x?A.find(R=>R.id===x):void 0,[x,A]),N=useMemo(()=>M(k),[k,M]),F=useMemo(()=>x?T?.length?T:N:[],[x,N,T]),Z=useMemo(()=>ps(F),[F]),fe=useMemo(()=>cs(F,Z),[F,Z]),Pe=T!=null&&!Bn(T,N),xe=(m??Jl(l))>=3,_=u||xe,je=_||!Pe;function ga(R){C(),h(null);let te;if(_t(R)){let Se=R.submenu?.length?R.submenu:s.length?s:p$1?.submenu??[];te={...R,submenu:le(Se),columns:Se.map(Ne=>Ne.name)};}else Re(R)&&(te=R);o(R,te);}function Ca(R,te){let Se=A.find(Ne=>Ne.id===R);h(le(M(Se))),b(R,te);}function L(){h(null),S(),C();}function V(R){if(R.stopPropagation(),je)return;let te=le(N),Se=T?.length?le(T):te;i?.(true,Se,te,k?.id),h(null),C();}function J(R){T&&h(ls(T,R));}function he(R,te){T&&h(kn(T,R,te));}function _h(){T&&h(ss(T,!Z));}function zh(){h(le(N));}return jsxs(Eo,{"data-testid":"ViewsDropdown",children:[jsx(r0,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(Po,{onScroll:C,children:[jsx(y0,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(v$1,{}),A.map(R=>{let te=Re(R),Se=!te&&E(R);return jsxs(Mo,{onMouseEnter:Ne=>{te?w(R.id):Se&&Ca(R.id,Ne.currentTarget);},onMouseLeave:()=>{te?w(null):Se&&S();},onClick:()=>ga(R),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[R.id===t.id?jsx("img",{style:{width:15,height:15},src:Yj,alt:"check"}):jsx(Do,{}),jsx("span",{style:{flex:1,fontSize:11},children:R.label}),te&&y===R.id&&jsx("img",{src:Ch$1,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:Ne=>{Ne.stopPropagation(),r?.(),a?.(R);}}),Se&&jsx("img",{src:yb,alt:"arrow",style:{height:12}})]},R.id)}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!xe,children:jsxs(Mo,{sx:{border:"none",opacity:_?.5:1,cursor:_?"not-allowed":"pointer"},onClick:R=>{if(R.stopPropagation(),_)return;let te=le(M(p$1)),Se=te.map(Ne=>({...Ne,selected:false,menuItems:Ne.menuItems?.map($h=>({...$h,selected:false}))}));i?.(true,Se,te,p$1?.id),C();},children:[jsx(Do,{}),jsxs(Yn,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:hm,alt:"",style:{opacity:_?.5:1,width:10,height:10}}),jsx("span",{style:{color:_?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:f("New Custom View")})]}),jsx(Mn,{})]})})]})}),x&&I&&F.length>0&&jsx(R,{open:!!I,anchorEl:I,placement:"auto-end",onMouseEnter:d,onMouseLeave:L,children:jsxs(gC,{children:[jsx(BC,{columns:Ro(F),allCurrentSelected:Z,someCurrentSelected:fe,onSelectAll:_h,onReset:zh,onColumnToggle:J,onNestedItemToggle:he,anchorEl:I,isModified:Pe}),jsxs(xC,{children:[jsx(VC,{variant:"text",onClick:L,sx:hC,children:"Cancel"}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!xe,children:jsx(VC,{variant:"contained",onClick:V,disabled:je,sx:yC,children:"Create view"})})]})]})})]})}var Ls=Ds.memo(I0);var FC=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:l,onColumnToggle:a,onSubItemToggle:s,onSelectAll:p,onResetToDefault:c,onSubmenuEnter:m,onSubmenuLeave:u,onCancelClose:f})=>{let x=useRef(null),{onDragStart:I,onDragEnd:b}=Yl(x),S=useCallback(d=>{if(Cs(d.target)){d.preventDefault();return}I();},[I]);return jsxs(iC,{children:[jsxs(aC,{children:[jsx(_l,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(zl,{onClick:d=>{d.stopPropagation(),p();},children:jsx(f$1,{checked:o,indeterminate:n,size:"small",sx:$l,onChange:d=>{d.stopPropagation(),p();},onClick:d=>{d.stopPropagation();}})}),jsx(Typography,{onClick:d=>{d.stopPropagation(),p();},sx:{flex:1,fontSize:13,fontWeight:500,color:"text.primary",ml:.75,cursor:"pointer"},children:"Select All"}),jsx(Link,{component:"button",type:"button",onClick:d=>{d.stopPropagation(),c();},underline:"none",sx:{fontSize:13,fontWeight:500,cursor:"pointer",color:"common.blue"},children:"Reset to default"})]}),jsx(Box,{sx:{flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto",position:"relative"},children:jsx(Reorder.Group,{ref:x,axis:"y",onReorder:l,values:t,style:{listStyle:"none",padding:0,margin:0},children:e.map(d=>{let C=W(d.name),y=d.menuItems&&d.menuItems.length>0,{checked:w,indeterminate:T}=Rn(d);return jsxs(Reorder.Item,{value:d.name,drag:C?false:"y",dragListener:!C,dragConstraints:x,dragElastic:{top:0,bottom:0,left:0,right:0},transition:{duration:0},whileDrag:{zIndex:9999,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",scale:1},style:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%",willChange:"transform"},onDragStart:S,onDragEnd:b,children:[jsxs(lC,{isHovered:r===d.name,isDate:C,onMouseEnter:h=>y&&m(d.name,h.currentTarget),onMouseLeave:()=>y&&u(),onClick:h=>{(h.target.closest('[role="checkbox"]')||h.target.closest('input[type="checkbox"]'))&&h.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(_l,{children:jsx("img",{src:Hb,alt:"drag",draggable:false,style:{width:16,height:16,cursor:C?"default":"grab",pointerEvents:"none"}})}),jsx(zl,{onMouseDown:h=>{h.stopPropagation();},onPointerDown:h=>{h.stopPropagation();},children:jsx(f$1,{checked:w,indeterminate:T,onChange:h=>{h.stopPropagation(),a(d.name);},onClick:h=>{h.stopPropagation();},disabled:C,size:"small",sx:$l})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:d.label||d.name}),y&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:xb,alt:"arrow",style:{width:12,height:12}})})]}),y&&jsx(Popper,{open:r===d.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:f,onMouseLeave:u,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Vi,{children:d.menuItems?.map((h,A)=>jsxs(Ds.Fragment,{children:[jsx(V,{isSelected:h.selected,isDisabled:C,onClick:()=>{C||s(d.name,h.name);},sx:{fontSize:13},children:h.label||h.name}),A<(d.menuItems?.length??0)-1&&jsx(v$1,{})]},h.name))})]})})]},d.name)})})})]})};function E0({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i,onDelete:l,tableViews:a=[],mode:s="sheet",stackOrder:p=1}){let{t:c$1}=useTranslation(),m=useDragControls(),[u,f]=useState(false),[x,I]=useState(false);useEffect(()=>{e||(f(false),I(false));},[e]),useEffect(()=>{if(!e)return;let _=je=>{je.key==="Escape"&&t();};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,t]);let{templateName:b,setTemplateName:S,selectedColumns:d,allSelected:C,someSelected:y,isNameValid:w,hasChanges:T,hoveredColumn:h,anchorEl:A,openSubmenu:P,closeSubmenu:M,cancelClose:E,handleReorder:k,handleColumnToggle:N,handleSubItemToggle:F,handleSelectAll:Z,handleResetToDefault:fe}=Ss({open:e,availableColumns:n,defaultColumns:r,editingView:i,tableViews:a}),Pe=async()=>{if(!(!w||!T||x||u)){I(true);try{let _=Zl(d,s);await o?.({name:b,selectedColumns:d,layout:_}),t();}catch{console.warn("Failed to create view");}finally{I(false);}}},xe=async()=>{if(!i||u||x)return;let _=i.id;f(true);try{await l?.(_),t();}catch{console.warn("Failed to delete view");}finally{f(false);}};return e?jsxs(dC,{role:"dialog","aria-modal":"true","data-testid":"CreateViewDialog",drag:true,dragListener:false,dragControls:m,dragMomentum:false,initial:false,style:{width:450,minWidth:0,maxWidth:"min(100vw - 16px, 450px)",height:600,left:`max(8px, calc(50% - ${450/2}px))`,top:`max(8px, calc(50% - ${600/2}px))`},animate:{zIndex:2+p},transition:{duration:.1},children:[jsx(c,{id:"draggable-dialog-title",onPointerDown:_=>m.start(_),style:{cursor:"move",flexShrink:0},children:jsx(d$2,{isHovered:true,title:i?"Edit Custom View":c$1("createCustomView")||"Create Custom View",leftActions:jsx(a$3,{onClick:t,onPointerDown:_=>_.stopPropagation()})})}),jsxs(oC,{children:[jsxs(nC,{onScroll:()=>{M();},children:[jsxs(rC,{children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#9F9F9F",lineHeight:"0.7"},children:"Custom"}),jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#20232B",lineHeight:1.2},children:"View"})]}),i&&jsx(cC,{onClick:xe,disabled:u||x,children:u?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:"Deleting..."})]}):"Delete View"})]}),jsx(Box,{sx:{mb:3},children:jsx(b$6,{name:"custom-template-name",label:"Template Name",value:b,onChange:_=>S(_),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:_=>_.currentTarget.removeAttribute("readonly")},required:true})}),jsx(FC,{selectedColumns:Ro(d),columnNames:Ro(d).map(_=>_.name),allSelected:C,someSelected:y,hoveredColumn:h,anchorEl:A,onReorder:k,onColumnToggle:N,onSubItemToggle:F,onSelectAll:Z,onResetToDefault:fe,onSubmenuEnter:P,onSubmenuLeave:M,onCancelClose:E})]}),jsx(sC,{}),jsx(pC,{children:jsx(mC,{variant:"contained",onClick:Pe,disabled:!w||!T||x||u,title:w?void 0:`Name is required. Current: "${b}"`,children:x?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:i?"Saving...":"Creating..."})]}):i?"Update View":"Create View"})})]})]}):null}var Rs=E0;function R0({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:l="en",isLoading:a,mainDefaultTemplate:s}){let{t:p$1}=useTranslation(),{defaultColumns:c,defaultTemplate:m,defaultTemplates:u,customViews:f,allTemplates:x,customTemplateCount:I}=$i({tableMode:i,templates:t,lang:l,mainDefaultTemplate:s}),{anchorEl:b$1,isCreateDialogOpen:S,editingView:d$1,selectedViewInfo:C$1,shouldUseCurrentState:y,currentViewColumns:w,initialColumnsForCreate:T,availableColumnsForCreate:h,handleViewButtonClick:A,handleCloseViewDropdown:P,handleSelectedViewInfo:M,handleOpenCreateDialog:E,handleOpenEditDialog:k,handleCloseCreateDialog:N,handleSaveView:F,handleDeleteView:Z}=Ui({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:c,defaultTemplate:m,allTemplates:x,customTemplateCount:I});return jsxs(Fragment,{children:[jsx(p0,{onClickAway:P,children:jsxs(Bi,{sx:{width:"32px"},"data-testid":"ViewsMenu",children:[jsx(p,{title:p$1("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"ViewsMenu_button",onClick:A,"aria-label":p$1("tableView")})}),jsx(Ls,{open:!!b$1,anchorEl:b$1,onClose:P,setSelectedViewInfo:M,selectedViewInfo:C$1,onCreateCustomView:E,customViews:f,onEditCustomView:k,defaultColumns:c,defaultTemplate:m,defaultTemplates:u,customTemplateCount:I,isLoading:a})]})}),jsx(Rs,{open:S,onClose:N,availableColumns:h?.length?h:c,defaultColumns:c,onCreate:F,editingView:d$1,onDelete:Z,tableViews:y?T??w:void 0,mode:i})]})}var UC=memo(R0);function ks(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function W0({tableMode:e,onToggle:t}){let o=Xa(e),n=Ya(e);return jsx(b,{variant:"secondary",size:"md",icon:jsx(d,{src:n?Mh$1:Lh$1,alt:`${e}-mode`,sx:{width:14,height:14}}),onClick:t,"aria-label":`${e}-mode`,sx:r=>o?{}:{borderColor:r.v2.palette.brand[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}})}var YC=memo(W0);function Fn({children:e,component:t="aside",...o}){return jsx(Jg,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function Xi({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:l,lang:a}){let{isColumnPickerVisible:s,setIsColumnPickerVisible:p,timezoneCountryCodes:c}=ks(t?.segmentCountries),m=e?.variant==="acceptance",u=n?.tableMode??"default",f=useMemo(()=>n?.onSheetToggle?jsx(YC,{tableMode:u,onToggle:n.onSheetToggle}):null,[u,n?.onSheetToggle]);return jsxs(Fn,{children:[i?.leading&&!s&&i.leading,!s&&jsxs(Fragment,{children:[r?.onChange&&jsx(b$7,{onSearchChange:r.onChange,placeholder:r.placeholder,defaultValue:r.defaultValue}),i?.filter,f&&!m&&f,i?.calendar??(o&&t&&jsx(a$4,{defaultDate:o.date,onDateChange:x=>{let[I,b]=x;I&&b&&o.onDateChange([I,b]);},mode:o.mode,onCalendarModeSwitch:o.onModeChange,maxDateRange:o.maxRange??31,groupBy:o.groupBy,onCalendarGroupChange:o.onGroupByChange,browserTimezone:t.browserTimezone,defaultCountryTimezone:t.defaultCountryTimezone,timezone:t.timezone,onChangeTimezone:t.onChangeTimezone,timezoneCountriesCodes:c})),l&&i?.reports,f&&m&&f]}),n?.onViewChange&&(n.templates?jsx(UC,{onViewChange:n.onViewChange,tableMode:u,lang:a,...n.templates}):jsx(Es,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!s&&i.trailing]})}function U0({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:l,activeFilter:a,views:s,search:p,slots:c,children:m}){let u=Bc(useId(),"list-header"),f=useMemo(()=>jsx(Xi,{display:t,timezone:r,calendar:i,views:s,search:p,slots:c,reportsVisible:n,lang:o}),[t,r,i,s,p,c,n,o]);return jsxs(Li,{id:u,"data-testid":Yg,children:[t?.maximized&&jsx(Ri,{title:e,toolbar:f}),jsxs(Xg,{as:"section",children:[jsx(ki,{status:l,activeFilter:a,beforeStatus:c?.beforeStatus}),!t?.maximized&&f]}),m]})}var qC=memo(U0);var ZC=styled$1(Yn,{shouldForwardProp:e=>e!=="maximized"})(({theme:e,maximized:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),overflow:"hidden",height:t?"4.75rem":"4.1875rem",paddingBottom:t?"0rem":"1.2rem",paddingInline:e.spacing(4),paddingTop:t?"1.35rem":e.spacing(.5)})),Y0=ya(),JC=styled$1(j,{shouldForwardProp:e=>e!=="title"&&e!=="isDropdown"})(({title:e,isDropdown:t,theme:o})=>{let{base:n}=o.v2.palette;return {position:"relative",fontWeight:o.typography.fontWeightMedium,padding:o.spacing(1),color:n.black,fontSize:"11px",lineHeight:"15px",borderRadius:o.shape.borderRadius,transition:o.transitions.create(["backgroundColor","boxShadow"],{easing:o.transitions.easing.sharp,duration:o.transitions.duration.complex}),whiteSpace:"nowrap",textTransform:"capitalize","&:hover, &.active":{...!t&&{backgroundColor:n.white,boxShadow:o.shadows[2]},cursor:"pointer",position:"relative",color:"transparent","&:after":{...e&&{content:`"${e}"`},color:n.black,fontWeight:o.v2.typography.fontWeightBold,overflow:"hidden",position:"absolute",top:0,bottom:0,right:0,left:0,display:"flex",alignItems:"center",justifyContent:t?"flex-start":"center",letterSpacing:Y0==="safari"?"-1px":"",padding:8,borderRadius:o.shape.borderRadius}}}});function X0({isDropdown:e=false,name:t,code:o,activeCode:n,navigateToMenuItem:r,onClickServiceItem:i}){let[l,a]=useState(null),{t:s}=useTranslation(),p=!!l,c=()=>{a(null);};return jsxs(Fragment,{children:[jsx(JC,{isDropdown:e,className:n.toLowerCase()===o.toLowerCase()?"active":"",onClick:m=>{m.preventDefault(),m.stopPropagation(),r(o);},title:t,onContextMenu:m=>{m.preventDefault(),m.stopPropagation(),c(),a(m.currentTarget);},children:t}),jsx(f,{open:p,anchorEl:l,onClose:c,menuItems:[{label:s("openNewWindow"),name:"new",icon:jsx("img",{src:jb$1,alt:"new-window-icon"}),onClick:m=>{m.stopPropagation(),i?.(o),c();}}]})]})}var QC=memo(X0);var a1=e$1=>jsx(e,{src:e$1.className.includes("MuiSelect-iconOpen")?Yc:Xc,alt:"dropdown"});function l1({isMaximized:e,serviceCode:t,dimensions:o,services:n,onChangeServiceCode:r,onClickServiceItem:i}){let l=Bc(useId(),"app-services"),[a,s]=useState(0),[p,c]=useState(false),[m,u]=useState(""),f=useRef(null),[x,I]=Ds.useState(false),{i18n:b}=useTranslation(),S=T=>{u(T.target.value);},d=()=>{I(T=>!T);},C=useMemo(()=>cc(n.filter(T=>T.code.toLowerCase()===decodeURIComponent(t).toLowerCase())?.[0]?.name,b.language),[n,b.language,t]);useEffect(()=>{u(C);},[C]),useEffect(()=>{s(f.current?.offsetWidth+51+8+3);},[]),useEffect(()=>{c(Number(o?.width)<a+10);},[o?.width,a]);let y=T=>{r?.(T),I(false);},w=T=>jsx(c$1,{children:T});return jsxs(ZC,{id:l,"data-testid":"AppServices",maximized:e,children:[!!n?.length&&!p&&jsx(Box,{ref:f,display:"flex",gap:"8px",flexDirection:"row",sx:{userSelect:"none"},children:n.map((T,h)=>jsx(QC,{activeCode:t,onClickServiceItem:i,navigateToMenuItem:y,name:cc(T.name,b.language)||"",code:T.code},`service-item-${T.code}-${h}`))}),!!n?.length&&p&&jsx(a$2,{open:x,onClick:d,displayEmpty:true,inputProps:{"aria-label":"Without label"},MenuProps:{anchorOrigin:{vertical:40,horizontal:83},PaperProps:{style:{borderRadius:"0.25rem",width:"10.43rem",padding:0}},MenuListProps:{disablePadding:true}},value:m,IconComponent:a1,onChange:S,renderValue:w,sx:{"& .MuiOutlinedInput-root.MuiList-root-MuiMenu-list":{paddingTop:"0px !important",paddingBottom:"0px !important"}},children:n.map((T,h)=>cc(T.name,b.language)?.toLowerCase()===m?.toLowerCase()?null:jsx(b$3,{value:cc(T.name,b.language),onClick:A=>{A.preventDefault(),A.stopPropagation(),y(T.code);},children:jsx(d$1,{children:cc(T.name,b.language)})},`option-${T.code}-${h}`))})]})}var ex=memo(l1);var Fs=ex;function u1({appCode:e,services:t,isMaximized:o,dimensions:n,serviceCode:r,ui:{onStartDrag:i},onChangeServiceCode:l,onClickServiceItem:a,sx:s}){let p=Bc(useId(),"app-services-bar"),[c,m]=useState(false),u=useCallback(x=>{i?.(x),m(true);},[i,m]),f=()=>{m(false);};return !e||!t?.length?null:jsx(b$4,{id:p,"data-testid":"AppServicesBar",onPointerDown:u,onPointerUp:f,isDragging:c,sx:s,children:jsx(Fs,{onClickServiceItem:a,dimensions:{width:n.width},serviceCode:r,services:t,isMaximized:o,onChangeServiceCode:l})})}var ox=memo(u1);var f1=ox;var rx=styled$1(Yn,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,minHeight:32,minWidth:30,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:e.palette.common.white,":hover":{opacity:.7},...t&&{boxShadow:`0px 0px 4px 0px ${e.palette.info.dark}80`,border:`1px solid ${e.palette.info.dark}`,backgroundColor:`${e.palette.info.dark}0D`,gap:"6px",padding:"0 8px"}})),ix=styled$1(Yn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",minWidth:14,height:14,borderRadius:"50%",background:e.palette.background.gradient.shadedBlue,color:e.palette.common.white,fontSize:"8px",fontWeight:700,lineHeight:"14px",flexShrink:0})),ax=styled$1(Yn)(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"2px","& img":{width:14,height:14}})),lx=styled$1(g1)(({theme:e})=>({marginTop:e.spacing(1),marginBottom:e.spacing(1),minWidth:193,"& .MuiPaper-root":{borderRadius:e.spacing(.5),"&>.MuiList-root":{padding:0}}})),sx=styled$1(j)(({theme:e})=>{let{grey:t}=e.v2.palette;return {fontWeight:e.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:t[500],paddingInlineStart:e.v2.spacing(16),paddingTop:e.v2.spacing(8),paddingBottom:e.v2.spacing(8),paddingInlineEnd:e.v2.spacing(8),borderBottom:`1px solid ${t[100]}`,display:"block"}}),Hs=styled$1(Yn)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",backgroundColor:e.palette.common.white,borderTop:`1px solid ${e.palette.divider}`})),Os=styled$1(VC)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{color:"#fff !important",opacity:.5}})),_s=styled$1(VC)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}}));var zs=createContext(null);function h1(){let e=useContext(zs);if(!e)throw new Error("useFilterDropdown must be used inside a FilterDropdown");return e}function cx({onConfirm:e,onCancel:t,isOkayButDisabled:o,children:n,isDisabled:r,icon:i,title:l,menuStyle:a,hideTitle:s=false,hideFooter:p=false,activeFiltersCount:c,onClearFilters:m,renderButton:u,onOpenChange:f,menuProps:x,...I}){let b=Bc(useId(),"filter-dropdown"),[S,d]=useState(null),C=!!S,{t:y}=useTranslation(),w=()=>{d(null),f?.(false);},T=E=>{if(!r){if(!C){d(E.currentTarget),f?.(true);return}w();}},h=()=>{C&&(t?.(),w());},A=()=>{e?.(),w();},P=typeof c=="number"&&c>0,M=E=>{E.stopPropagation(),m?.();};return jsx(zs.Provider,{value:{onConfirm:A,onCancel:h,onClose:w},children:jsx(p0,{onClickAway:h,children:jsxs(Yn,{id:b,"data-testid":"FilterDropdown",...I,children:[jsx(rx,{className:"filter-button",isActive:C||P,onClick:T,sx:{...r&&{pointerEvents:"none",opacity:.5,...I.sx}},children:u??jsxs(Fragment,{children:[jsx(Yn,{component:"img",src:i??ak,alt:"filter"}),P&&jsxs(Fragment,{children:[jsx(ix,{children:c}),jsx(ax,{onClick:M,"aria-label":"clear filters",children:jsx(Yn,{component:"img",src:Gb$1,alt:"clear"})})]})]})}),jsxs(lx,{anchorEl:S,open:C,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{marginTop:"8px",marginBottom:"8px",width:193,...a},...x,children:[!s&&jsx(sx,{component:"span",children:l??y("filterBy")}),n,!p&&jsxs(Hs,{children:[jsx(_s,{onClick:h,children:y("cancel")}),jsx(Os,{disabled:o,onClick:A,children:y("okay")})]})]}),C&&jsx(B,{onClick:w})]})})})}var mx=styled$1(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),dx=styled$1(Yn)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),ux=styled$1(Yn)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),fx=styled$1(Yn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"178px"}));function Ys({brand:e,merchantsIds:t,onChangeMerchant:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,anchorEl:i}){let[l,a]=useState(""),s=!!i,p=useCallback(S=>t.includes(S),[t]),c=(S,d)=>{if(S.stopPropagation(),p(d)){o?.(t.filter(y=>y!==d));return}let C=[...new Set([...t,d])];o?.(C);},m=S=>t.length===1&&t[0]===S&&n,u=S=>{a(S);},f=()=>{a("");},x=useMemo(()=>e.merchants??[],[e.merchants]),I=useMemo(()=>{if(!l?.trim())return x;let S=l.trim().toLowerCase();return x?.filter(d=>(d?.display_name??"").toLowerCase().includes(S)||(d?.legacy_id??"").toLowerCase().includes(S))},[l,x]),b=useMemo(()=>r?I:x,[I,x,r]);return jsxs(R,{open:s,anchorEl:i,placement:"right-start",children:[r&&x.length>1&&jsx(Yn,{sx:{p:"8px"},children:jsx(b$5,{fullWidth:true,placeholder:"Merchants",name:"merchants",value:l,onChange:S=>u(S.target.value),onClear:f})}),b?.map(S=>jsx(mx,{isDisabled:m(S.legacy_id),isSelected:p(S.legacy_id),onClick:d=>{m(S.legacy_id)||c(d,S.legacy_id);},sx:{maxHeight:36,minHeight:36},children:jsxs(dx,{children:[jsx(fx,{component:"span",children:S.display_name}),jsx(ux,{component:"span",children:S.legacy_id})]})},S?.legacy_id))]})}var Qi=Ys;var Cx=styled$1(Yn)(()=>({display:"flex",gap:"4px",alignItems:"center",flex:1,marginInlineEnd:"8px"}));function qs({brand:e,merchantsIds:t,isDisabled:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,renderBrandLogo:i,onChangeMerchant:l}){let[a,s]=useState(null),p=!!a,c=b=>{s(b.currentTarget);},m=()=>{s(null);},u=useMemo(()=>e.merchants?.filter(b=>t.includes(b.legacy_id)),[t,e.merchants]),f=useMemo(()=>u?.length===e.merchants?.length,[u?.length,e.merchants?.length]),x=useMemo(()=>!f&&u.length>0,[f,u]),I=b=>{if(b.stopPropagation(),f){l?.(t.filter(S=>!e.merchants.some(({legacy_id:d})=>S===d)));return}if(x){let S=[...new Set([...t,...u.map(({legacy_id:d})=>d)])];l?.(S);return}l?.([...t,...e.merchants.map(({legacy_id:S})=>S)]);};return jsxs(V,{isSelected:f,isIndeterminate:x,onMouseEnter:c,onMouseLeave:m,onClick:b=>{o||I(b);},isDisabled:o,sx:{maxHeight:35,minHeight:35,...p&&{boxShadow:"0px 0px 16px 0px #00000021"}},children:[jsxs(Cx,{children:[i?.(e.logo),jsx(j,{sx:{fontSize:"11px"},children:cc(e.name)})]}),e.merchants?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsx(Qi,{anchorEl:a,brand:e,merchantsIds:t,onChangeMerchant:l,atLeastOneMerchantSelected:n,showSearchInput:r})]})}var hx=qs;function Xs({brands:e,isLoading:t,onFilterChange:o,merchantsIds:n=[],atLeastOneMerchantSelected:r=false,showSearchInput:i=false,hideCheckbox:l=false,renderBrandLogo:a}){let[s,p]=useState(null),[c,m]=useState(""),u=!!s,{t:f}=useTranslation(),x=P=>{p(P.currentTarget);},I=()=>{p(null);},b=useMemo(()=>e.length?e.every(P=>P.merchants?.every(({legacy_id:M})=>n.includes(M))):false,[n,e,l]),S=useMemo(()=>!b&&n.length>0,[n,b]),d=useMemo(()=>e.filter(P=>P.merchants?.some(M=>n?.includes(M.legacy_id))).length,[e,n]),C=()=>{if(b&&!r){o?.([]);return}let P=e.flatMap(M=>M.merchants?.map(({legacy_id:E})=>E));o?.(P);},y=t||!e?.length,w=P=>{m(P);},T=()=>{m("");},h=useMemo(()=>{if(!c.trim())return e;let P=c.trim().toLowerCase();return e.filter(M=>cc(M.name)?.toLowerCase()?.includes(P)||M.merchants?.some(E=>E.legacy_id?.toLowerCase().includes(P)))},[c,e]),A=useMemo(()=>i?h:e,[e,h,i]);return jsxs(V,{isDisabled:y,isSelected:b,startAdornment:l?null:void 0,isIndeterminate:S,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...u&&{boxShadow:"0px 0px 16px 0px #00000021"},...y&&{pointerEvents:"none",opacity:.5,cursor:"default"}},onMouseEnter:x,onMouseLeave:I,onClick:C,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:f("merchant")}),e.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),e?.length===1?jsx(Qi,{anchorEl:s,brand:e[0],merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i}):jsxs(R,{open:u,anchorEl:s,placement:"right-start",children:[i&&e.length>1&&jsx(Yn,{sx:{p:"8px"},children:jsx(b$5,{id:"merchants-search-input",fullWidth:true,placeholder:"Brands",name:"brands",value:c,onChange:P=>w(P.target.value),onClear:T})}),A?.map(P=>jsx(hx,{isDisabled:d===1&&r,brand:P,merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i,renderBrandLogo:a},P.id))]})]})}var bx=styled$1(Yn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"164px"}));function F1({retailersIds:e=[],isLoading:t,retailers:o=[],onFilterChange:n,atLeastOneRetailerSelected:r=false,showSearchInput:i=false,hideCheckbox:l=false}){let[a,s]=useState(null),p=!!a,{t:c,i18n:m}=useTranslation(),[u,f]=useState(""),x=E=>{s(E.currentTarget);},I=()=>{s(null);},b=useCallback(E=>e?.includes(E),[e]),S=useMemo(()=>o.length?o.every(E=>b(E.id)):false,[o,b,l]),d=useMemo(()=>!S&&e.length>0,[e,S]),C=()=>{if(S&&!r){n?.([]);return}n?.(o.map(E=>E.id));},y=E=>e.length===1&&e[0]===E&&r,w=(E,k)=>{if(E.stopPropagation(),y(k))return;if(b(k)){n?.(e.filter(F=>F!==k));return}let N=[...new Set([...e,k])];n?.(N);},T=t||!o?.length,h=E=>{f(E);},A=()=>{f("");},P=useMemo(()=>u?.trim()?o?.filter(E=>(E?.brand?.name?.[m.language]??E?.brand?.name?.en??"").toLowerCase().includes(u.trim().toLowerCase())):o,[u,o,m.language]),M=useMemo(()=>i?P:o,[P,o,i]);return jsxs(V,{isDisabled:T,isSelected:S,startAdornment:l?null:void 0,isIndeterminate:d,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...p&&{boxShadow:"0px 0px 16px 0px #00000021"},...T&&{opacity:.5,pointerEvents:"none",cursor:"default"}},onMouseEnter:x,onMouseLeave:I,onClick:C,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:c("retailers")}),o?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsxs(R,{open:p,anchorEl:a,placement:"right-start",sx:{height:300,width:200,overflow:"auto"},children:[i&&jsx(Yn,{sx:{p:"8px"},children:jsx(b$5,{id:"retailers-search-field",fullWidth:true,placeholder:"Retailers",name:"retailers",value:u,onChange:E=>h(E.target.value),onClear:A})}),M?.map((E,k)=>jsx(V,{isSelected:b(E.id),isDisabled:t||y(E.id),onClick:N=>{w(N,E.id);},sx:{maxHeight:35,minHeight:35},children:jsx(bx,{children:E?.brand?.name?.[m.language]??E?.brand?.name?.en})},`key-${E?.id}-${k}`))]})]})}var wx=memo(F1);function $1({countriesIds:e=[],isLoading:t,countries:o=[],onFilterChange:n,atLeastOneCountrySelected:r=false,hideCheckbox:i=false}){let[l,a]=useState(null),s=!!l,{t:p}=useTranslation(),c=C=>{s||a(C.currentTarget);},m=()=>{s&&a(null);},u=useCallback(C=>e?.includes(C),[e]),f=useMemo(()=>o.length?o.every(C=>u(C)):false,[o,u]),x=useMemo(()=>!f&&e.length>0,[e,f]),I=()=>{if(!r){if(f){n?.([]);return}n?.(o);}},b=C=>e.length===1&&e[0]===C&&r,S=(C,y)=>{if(C.stopPropagation(),b(y))return;if(u(y)){n?.(e.filter(T=>T!==y));return}let w=[...new Set([...e,y])];n?.(w);},d=t||o?.length<=0||r;return jsxs(V,{isDisabled:d,isSelected:f,startAdornment:i?null:void 0,isIndeterminate:x,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...s&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:c,onMouseLeave:m,onClick:I,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:p("walletCountry")}),o?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsx(R,{open:s,anchorEl:l,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((C,y)=>jsxs(V,{isSelected:u(C),isDisabled:t||b(C),onClick:w=>{S(w,C);},sx:{maxHeight:35,minHeight:35},children:[jsx(b$2,{countryCode:C}),jsx(j,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:Na(C)})]},`key-${C}-${y}`))})]})}var Px=memo($1);function K1({currenciesIds:e=[],isLoading:t,currencies:o=[],onFilterChange:n,atLeastOneCurrencySelected:r=false,hideCheckbox:i=false}){let[l,a]=useState(null),s=!!l,{t:p}=useTranslation(),c=C=>{s||a(C.currentTarget);},m=()=>{s&&a(null);},u=useCallback(C=>e?.includes(C),[e]),f=useMemo(()=>o.length?o.every(C=>u(C)):false,[o,u]),x=useMemo(()=>!f&&e.length>0,[e,f]),I=()=>{if(!r){if(f){n?.([]);return}n?.(o);}},b=C=>e.length===1&&e[0]===C&&r,S=(C,y)=>{if(C.stopPropagation(),b(y))return;if(u(y)){n?.(e.filter(T=>T!==y));return}let w=[...new Set([...e,y])];n?.(w);},d=t||o?.length<=0||r;return jsxs(V,{isDisabled:d,isSelected:f,startAdornment:i?null:void 0,isIndeterminate:x,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...s&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:c,onMouseLeave:m,onClick:I,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:p("currency")}),o?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsx(R,{open:s,anchorEl:l,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((C,y)=>yo[C]?.country?jsxs(V,{isSelected:u(C),isDisabled:t||b(C),onClick:T=>{S(T,C);},sx:{maxHeight:35,minHeight:35},children:[jsx(b$2,{countryCode:yo[C].country})," ",jsx(j,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:C})]},`key-${C}-${y}`):null)})]})}var Dx=memo(K1);var q1=(r=>(r.BRAND="BRAND",r.COUNTRY="COUNTRY",r.ENTITY="ENTITY",r.MERCHANT="MERCHANT",r))(q1||{});var X1="/",Gn=5,Lx=(...e)=>e.join(X1),Zs=e=>[e.label,e.id],Rx=(e,t)=>{if(e.levelKey==="MERCHANT")return e.id.toLowerCase().includes(t)?e:null;let o=(e.children??[]).map(i=>Rx(i,t)).filter(i=>i!==null);if(!o.length)return null;let{searchProps:n,...r}=e;return {...r,children:o,...o.length>=Gn&&{searchProps:n}}},kx=(e,t,o)=>{let n=e.map(r=>{let i=r.entities??[],a=Array.from(new Set(i.map(s=>s.country).filter(Boolean))).map(s=>{let c=i.filter(m=>m.country===s).map(m=>{let f=(m.merchants??[]).map(x=>({id:x.legacy_id,label:x.display_name,levelKey:"MERCHANT",status:t.includes(x.legacy_id)?"CHECKED":"UNCHECKED",hintText:x.legacy_id}));return {id:Lx(r.id,s,m.id),label:cc(m.legal_name,o)??m.id,levelKey:"ENTITY",children:f,header:"Merchants",...f.length>=Gn&&{searchProps:{getValues:Zs}}}});return {id:Lx(r.id,s),label:Na(s)??s,levelKey:"COUNTRY",children:c,header:"Entities",iconComponent:jsx(b$2,{countryCode:s,width:14}),...c.length>=Gn&&{searchProps:{getValues:Zs}}}});return {id:r.id,label:cc(r.name,o)??r.id,levelKey:"BRAND",children:a,header:"Countries",icon:{fileId:r.logo},...a.length>=Gn&&{searchProps:{getValues:Zs}}}});return {levelKey:"BRAND",children:n,header:"Brands",...n.length>=Gn&&{searchProps:{filterItem:(r,i)=>(typeof r.label=="string"?r.label.toLowerCase():"").includes(i)?r:Rx(r,i)}}}};var ov=e=>{let{brands:t,isLoading:o,initialValue:n,onFilterChange:r,BrandLogoComponent:i,hideCheckbox:l}=e,[a,s]=useState(null),[p,c]=useState("UNCHECKED"),m=useRef(null),u=!!a,{t:f,i18n:x}=useTranslation(),I=useMemo(()=>kx(t,n,x.language),[t,n,x.language]),b=I.children??[],S=o||!b.length,d=useCallback(T=>{let h=T.filter(P=>P.status==="CHECKED"),A=T.filter(P=>P.status==="INDETERMINATE");return h.length===b.length?"CHECKED":A.length>0||h.length>0?"INDETERMINATE":"UNCHECKED"},[b]),C=useCallback(({selectedTree:T})=>{c(d(T));},[d]),y=useCallback(T=>{c(d(T));let h=b$a.filterNodesByLevelKey(T,"MERCHANT").map(({id:A})=>A);r?.(h);},[r,d]),w=useCallback(()=>{m.current?.toggleAll(p!=="CHECKED");},[p]);return jsxs(V,{startAdornment:l?null:void 0,isSelected:p==="CHECKED",isIndeterminate:p==="INDETERMINATE",isDisabled:S,onMouseEnter:T=>s(T.currentTarget),onMouseLeave:()=>s(null),onClick:w,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...u&&{boxShadow:"0px 0px 16px 0px #00000021"},...S&&{pointerEvents:"none",opacity:.5,cursor:"default"}},children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:f("merchant")}),t.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),!o&&jsx(c$3,{ref:m,placement:"right-start",anchorEl:a,exposeOnlySelectedTree:true,treeDefinition:I,onChange:y,onMounted:C,IconComponent:i})]})},Vx=ov;var rv=Vx;function Nx({onPhoneChange:e,onCountryChange:t,selectedPhone:o,selectedCountry:n,countriesOptions:r,isCountriesLoading:i}){let l=Bc(useId(),"phone-filter");return jsx(b$b,{id:l,"data-testid":"ColumnFilterInputs_PhoneInput",phoneValue:o,onPhoneChange:a=>{e(a);},countryValue:n,onCountryChange:a=>{t(a?.countryId);},countries:r||[],isCountriesLoading:i||false,error:false,disabled:i,placeholder:"User Mobile",sx:{"&.MuiInputBase-root":{paddingLeft:"0px !important"}}})}var Wx=(e,t)=>{let o=e||{},n={};return t?.forEach(({value:r})=>{let i=o?.[r];n[r]=i===void 0?"all":i;}),n};function Hx({anchorEl:e,options:t,apiKey:o="statuses",initialStatuses:n,onCloseDropdown:r$1,onClear:i,onConfirm:l}){let a=!!e,s=Bc(useId(),"status-filter"),{t:p}=useTranslation(),[c,m]=useState(()=>Wx(n,t)),u=useRef(null),[f,x]=useState(null),[I,b]=useState(null),S=(A,P)=>{x(A.currentTarget),b(P);},d=useCallback(()=>{x(null),b(null);},[]),C=useCallback(A=>{r$1(A),d();},[d,r$1]),y=()=>{let A=Object.keys(c).reduce((M,E)=>{let k=c[E];return k!=="all"&&(M[E]=k),M},{});Object.values(c).every(M=>M==="all")?i([o]):l({[o]:A});},w=r(y,r$1),T=A=>{y(),r$1(A);},h=A=>{I&&m(P=>({...P,[I]:A}));};return jsx(ClickAwayListener,{onClickAway:A=>{A.stopPropagation(),r$1(A);},children:jsxs(Yn,{id:s,"data-testid":"StatusFilter",ref:u,tabIndex:-1,onKeyDown:w,children:[jsxs(R,{open:a,anchorEl:e,children:[jsx(a$7,{component:"span",children:p("filterBy")}),t.map(({value:A,label:P})=>jsxs(V,{onClick:M=>{x(M.currentTarget);},onMouseOver:M=>{S(M,A);},sx:{minHeight:"35px",padding:"8px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}},startAdornment:null,children:[jsx(Yn,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:P}),jsx(Yn,{component:"img",src:xb,width:16,height:12,sx:{marginLeft:"auto"}})]},A)),jsxs(b$c,{children:[jsx(d$4,{onClick:C,children:p("cancel")}),jsx(c$4,{onClick:T,children:p("okay")})]})]}),jsx(Popper,{open:!!f,anchorEl:f,placement:"right-start",onMouseLeave:d,children:jsx(Yn,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(g,{options:[{value:"all",label:"All"},{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}],value:c[I||""],onOptionChange:h,sx:A=>({[`& .${a$8.item}:hover`]:{boxShadow:A.v2.elevation[200]}})})})})]})})}var dv=styled$1(j)(()=>({fontSize:"11px"})),Ox=styled$1(Yn)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),_x=styled$1(Yn)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${e.palette.divider}`})),zx=styled$1(b)(()=>({minWidth:"auto",width:70})),$x=styled$1(b)(()=>({minWidth:"auto",width:70})),Ux=styled$1(Yn)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),ep=styled$1(dv)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),Gx=styled$1(Yn)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),Yx=styled$1(Yn)(({theme:e})=>({...a(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),jx=styled$1(ep)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),Kx=styled$1(b,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:t})=>{let{brand:o}=t.v2.palette;return {fontSize:"11px",fontWeight:t.v2.typography.fontWeightMedium,padding:t.v2.spacing(8),width:"100%",height:32,justifyContent:"space-between",gap:t.v2.spacing(4),...e&&{borderColor:o[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}}});function Xx({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,timezone:r$1,browserTimezone:i,defaultCountryTimezone:l,onTimezoneChange:a,timezoneCountriesCodes:s=[],onConfirm:p,onCloseDropdown:c}){let m=Bc(useId(),"date-filter"),{t:u}=useTranslation(),f=useRef(null),x=()=>p(e),I=r(x,c),b=y=>{t(y),requestAnimationFrame(()=>f.current?.focus());},S=y=>{x(),c(y);},d$1=useCallback(y=>n(y),[n]),C=y=>{if(!y)return "";let[w,T]=y,h=$u(w).format("MMM D"),A=$u(T).format("MMM D");return h===A?h:`${h} - ${A}`};return jsxs(Yx,{ref:f,tabIndex:-1,onKeyDown:I,id:m,"data-testid":"DateFilter",children:[jsxs(Ux,{children:[jsx(Gx,{children:jsx(ep,{component:"span",children:u("filterBy")})}),jsx(Ox,{children:jsx(a$4,{defaultDate:e||q(0),onDateChange:b,maxDateRange:365,mode:o,onCalendarModeSwitch:d$1,browserTimezone:i,defaultCountryTimezone:l,timezone:r$1,onChangeTimezone:a,timezoneCountriesCodes:s,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(y,w)=>jsxs(Kx,{variant:"secondary",size:"md",fullWidth:true,open:y,onClick:w,children:[jsx("span",{children:C(e)||"Date"}),jsx(d,{src:ek,alt:"selected",sx:{width:16,height:16}})]})},C(e))}),e&&jsx(jx,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs(_x,{children:[jsx($x,{variant:"secondary",size:"md",onClick:c,children:u("cancel")}),jsx(zx,{variant:"primary",size:"md",onClick:S,children:u("okay")})]})]})}var Zx=styled$1(Yn)(()=>({maxHeight:"210px",maxWidth:"177px",overflowY:"auto",padding:0})),Jx=styled$1(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},maxHeight:35,minHeight:35})),Qx=styled$1(Yn)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),eh=styled$1(Yn)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),th=styled$1(Yn)(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"120px"})),oh=styled$1(R)(()=>({marginBottom:"8px"}));function ih({anchorEl:e,onCloseDropdown:t,list:o,apiKey:n,placeholder:r$1,onConfirm:i,onClear:l,onClickItem:a,inputValue:s,onInputValueChange:p,selectedListItems:c}){let m=Bc(useId(),"list-column-filter"),{t:u}=useTranslation(),f=()=>i(),x=r(f,t),I=h=>{f(),t(h);},b=h=>{l?.(),t(h);},S=!!s.trim().length,d=()=>{S&&p("");},C=h=>{p(h);},y=useMemo(()=>S?o?.filter(h=>h.name.toLowerCase().includes(s.trim().toLowerCase())):o,[s,S,o]),w=S&&!y.length||!o.length,T=useMemo(()=>new Set(c),[c]);return jsxs(oh,{id:m,"data-testid":"ListColumnFilter",open:!!e,anchorEl:e,onKeyDown:x,children:[jsx(a$7,{component:"span",children:u("filterBy")}),!!o?.length&&jsx(Box,{sx:{padding:"8px 16px"},children:jsx(b$5,{fullWidth:true,value:s,name:n,placeholder:r$1,onChange:h=>C(h.target.value),onClear:d})}),jsx(Zx,{children:w?jsx(Box,{sx:{p:1,textAlign:"center",fontSize:"11px"},children:"No data available"}):y?.map((h,A)=>jsx(Jx,{isSelected:T.has(h?.id),onClick:()=>{a(h?.id);},children:jsxs(Qx,{children:[jsx(th,{children:h.name}),jsx(eh,{component:"span",children:h.id})]})},`${h.id}-${A}`))}),jsxs(b$c,{children:[jsx(d$4,{onClick:b,children:u("cancel")}),jsx(c$4,{onClick:I,children:u("okay")})]})]})}var ah="os-shared-VerificationIcon",aa={root:`${ah}-root`,img:`${ah}-img`},lh=(a=>(a.Verified="verified",a.Reviewed="reviewed",a.Completed="completed",a.Incomplete="incomplete",a.Rejected="rejected",a.Closed="closed",a.Archived="archived",a))(lh||{});var la={verified:Jj,reviewed:Hj,completed:Gj,incomplete:Ij,rejected:Kj,closed:Lj,archived:Mj},sa={verified:"#2ACE0029",reviewed:"#11D0FA29",completed:"#11D0FA29",incomplete:"#D9D9D929",rejected:"#FF3D0029",closed:"#D9D9D929",archived:"#D9D9D929"};var bv=2.3,sh=styled$1("span",{shouldForwardProp:e=>!["$variant","$bgColor","$size"].includes(e)})(({$variant:e="default",$bgColor:t,$size:o=10.5})=>{let n=Math.round(o*bv);return {display:"inline-flex",alignItems:"center",justifyContent:"center",...e==="circle"&&{width:`${n}px`,height:`${n}px`,borderRadius:"50%",backgroundColor:t||"#D9D9D929"}}});var ph=forwardRef(({className:e,sx:t,icon:o,label:n,variant:r="default",size:i=10.5,width:l,height:a,...s},p$1)=>{let c=la[o]||la.incomplete,m=sa[o]||sa.incomplete,u=n===null?"":n||sf(o),f=l??i,x=a??i,I=jsx(sh,{ref:p$1,className:nc(aa.root,e),sx:t,"data-testid":"VerificationIcon",$variant:r,$bgColor:m,$size:i,...s,children:jsx("img",{className:aa.img,loading:"lazy",src:c,alt:u||o,width:f,height:x})});return n===null?I:jsx(p,{title:u,wrapperProps:{display:"inline-flex"},children:I})});ph.displayName="VerificationIcon";var vv=memo(ph);function Lv({voidPercentage:e,capturePercentage:t,captureCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:l,isTextShown:a,remainingAmount:s,isSheetViewShown:p$1,selectionProps:c={}}){let m=Number(t)+Number(e)===100||s<=0,u=Bc(useId(),"capture-auto-icon"),f=useTheme(),{t:x}=useTranslation(),I=Ja$1(s||0),b=useCallback(w=>`Auto ${w} - ${l} ${I.integerAmount}.${I.decimalAmount}`,[l,I.decimalAmount,I.integerAmount]),S=useCallback(w=>{let T=w==="Capture"?r:i,{integerAmount:h,decimalAmount:A}=Ka(T,l);return `Partial ${w} - ${l} ${h}.${A}`},[r,i,l]),d=t>0?jsx(p,{title:S("Capture"),children:jsxs(_r,{isCapture:true,isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:f.shadows[4]}},children:[jsx(Ur,{src:vb,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(zr,{isCapture:true,percentage:t,children:[t,"% ",jsx($r,{isCapture:true,percentage:Gr(t)})]}),o>1&&jsxs(z,{compact:true,color:"dark",children:[o,"x"]})]})]})}):n==="CAPTURED"&&!m?jsx(p,{title:b("Capture"),children:jsx(to,{children:jsx(Mt,{src:Qo.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:b("Capture"),children:jsx(to,{children:jsx(Mt,{src:Qo.CAPTURED?.icon,alt:"auto"})})}),C=t===100?jsx(p,{title:x("captured"),children:jsx(Id,{children:jsx(Mt,{src:ik,alt:"captured"})})}):d,y=useMemo(()=>p$1&&C?jsx(b$1,{copyTrigger:"press",copyText:x("captured"),children:x("captured")}):a&&C?jsx(hd,{children:x("captured")}):C,[a,C,p$1,x]);return y&&jsx("div",{id:u,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:y})}var mh=Lv;function Wv({voidPercentage:e,capturePercentage:t,voidCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:l,isTextShown:a,isSheetViewShown:s,selectionProps:p$1={},remainingAmount:c}){let m=Number(t)+Number(e)===100||c<=0,u=Bc(useId(),"void-auto-icon"),f=useTheme(),{t:x}=useTranslation(),I=Ja$1(c||0),b=useCallback(w=>`Auto ${w} - ${l} ${I.integerAmount}.${I.decimalAmount}`,[l,I.decimalAmount,I.integerAmount]),S=useCallback(w=>{let T=w==="Capture"?r:i,{integerAmount:h,decimalAmount:A}=Ka(T,l);return `Partial ${w} - ${l} ${h}.${A}`},[r,i,l]),d=e>0||i?jsx(p,{title:S("Void"),children:jsxs(_r,{isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:f.palette.common.white,border:`0.75px solid ${f.palette.grey[600]}1A`},variants:{animate:{boxShadow:f.shadows[4]}},children:[jsx(Ur,{src:zk,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(zr,{percentage:e,children:[e,"% ",jsx($r,{percentage:Gr(e)})]}),o>0&&jsxs(z,{compact:true,color:"neutral",children:[o,"x"]})]})]})}):n==="VOID"&&!m?jsx(p,{title:b("Void"),children:jsx(to,{children:jsx(Mt,{src:Qo.VOID?.icon,alt:"auto"})})}):null,C=e===100?jsx(p,{title:x("void"),children:jsx(to,{children:jsx(Mt,{src:zk,alt:"void"})})}):d,y=useMemo(()=>s&&C?jsx(b$1,{copyTrigger:"press",copyText:x("void"),children:x("void")}):a&&C?jsx(yd,{children:x("void")}):C,[a,C,s,x]);return y?jsx("div",{id:u,"data-testid":"VoidAutoIcon",style:{...!s&&{zIndex:11}},children:y}):null}var uh=Wv;var Fv=mh;var zv=({authorizedStatus:e,isTextShown:t,iconStyles:o,tableMode:n,chipIndex:r=0,selectionProps:i={}})=>{let{t:l}=useTranslation(),a=useTheme(),s=l(wt(e));return Ya(n)?jsx(b$1,{copyTrigger:"press",copyText:s,children:s}):jsx(p,{title:s,children:t?jsx(H,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:a.palette.info.dark},children:s}):jsx(d,{src:f$2[e],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:o})})};var fh=styled$1(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)})),gh=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),np=styled$1("img")(()=>({width:"10px",height:"10px"})),rp=styled$1(motion.span)(({theme:e})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),ip=styled$1(motion.div,{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!e&&{padding:"0 !important"}})),Ch=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),xh=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),hh={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},yh={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Ih={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},bh={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},ap={fadeIn:{duration:.3},animate:{duration:.1}},Sh={fadeIn:{opacity:1}},Th=styled$1(H)(()=>({width:"88px",height:"100%"})),lp=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.25),height:"100%"}));function Xe({chargeStatus:e,gatewayTooltip:t,acquirerTooltip:o,chargeTooltip:n,errorCode:r,isTextShown:i,gatewayCode:l,acquirerCode:a,unCapturedStyles:s,iconStyles:p$1,iconWrapperStyles:c,gatewayIconWrapperStyles:m,gatewayContainerStyles:u,gateWayIconStyles:f,showBadge:x=true,isSheetViewShown:I=false,selectionProps:b={},chipIndex:S=0}){let d=e?b$d[e]:null,C=e?g$1[e]:null,y=useTheme(),{t:w}=useTranslation(),T=Bc(useId(),"charge-status-icon"),h=n&&jsx(Fragment,{children:jsx("div",{children:n})}),A=o&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:o})]}),P=t&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:t})]}),M=e&&a$6[e]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:d?"50%":"",...c},children:jsx(U,{src:a$6[e],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:d?"50%":"",width:"16px",height:"16px",...p$1}})});return I?jsxs(lp,{children:[jsxs(b$1,{copyTrigger:"press",copyText:w(wt(e)),children:[w(wt(e))," ",r]}),d&&jsxs(Fragment,{children:[l&&jsxs(b$1,{copyTrigger:"press",copyText:"Gateway",children:["Gateway ",l]}),a&&jsxs(b$1,{copyTrigger:"press",copyText:"Acquirer",children:["Acquirer ",a]})]})]}):i?jsxs(lp,{children:[jsx(p,{title:h,children:jsxs(Th,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:d?.background||C?.background||"transparent",color:d?.color||C?.color||y.palette.info.dark,borderColor:`${d?.color||C?.color||y.palette.info.dark}1A`},children:[w(wt(e))," ",r]})}),d&&jsxs(Fragment,{children:[l&&jsx(p,{title:P,children:jsxs(H,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:d?.background||C?.background||"transparent",color:d?.color||C?.color||y.palette.info.dark},children:["Gateway ",l]})}),a&&jsx(p,{title:A,children:jsxs(H,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:d?.background||C?.background||"transparent",color:d?.color||C?.color||y.palette.info.dark},children:["Acquirer ",a]})})]})]}):jsx(Ie,{id:T,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...c},children:Pn?.includes(e||"")&&(h||A||P)?jsxs(xh,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...x&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...s},children:[jsx(Ch,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:d?.background}},children:jsx(p,{title:h??w(wt(e)),children:jsxs(Fragment,{children:[M,jsx(gh,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:bh,style:{...r&&{padding:"0 !important"}},children:jsx(fh,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:d?.color},transition:hh,variants:Sh,initial:{opacity:0},children:r})})]})})}),jsx(ip,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:ap,variants:yh,style:u,isVisible:!!P,children:P&&jsx(p,{title:P,children:jsx(rp,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:d?.background,...m},children:jsx(np,{src:d?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:f})})})}),jsx(ip,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:ap,variants:Ih,style:u,isVisible:!!A,children:A&&jsx(p,{title:A,children:jsx(rp,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:d?.background,...m},children:jsx(np,{src:d?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:f})})})})]}):jsx(p,{title:h??w(wt(e)),children:jsx(Ie,{children:M})})})}var qv=()=>{let{t:e}=useTranslation(),t=Bc(useId(),"customer-initiated-icon");return jsx(p,{title:e("merchantInitiated"),children:jsx("img",{id:t,"data-testid":"merchantInitiatedIcon",src:wb$1,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Xv={G:"Global",R:"Regional",L:"Local"},kt=({geographyVariant:e,countryCode:t,isTextShown:o})=>{let n=e?Xv[e]:void 0,r=n||t?`${n||""} ${n&&t?"-":""} ${t?`Country - ${t}`:""}`:void 0;return o||!t?null:jsx(p,{title:r,children:jsx(b$2,{countryCode:t})})};var Qv=({geographyVariant:e,isTextShown:t,deviceCountry:o,deviceType:n,tableMode:r})=>{let i=Bc(useId(),"device-icon-chip");return jsxs(Yn,{id:i,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Ya(r)&&{height:"18px"}},children:[jsx(kt,{geographyVariant:e,isTextShown:t,countryCode:o}),jsx(c$2,{type:n,isTextShown:t,tableMode:r})]})};var oA=({isDisputeOpen:e,iconStyles:t})=>{let o=Bc(useId(),"dispute-icon");return jsx(U,{id:o,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:e?va:ua,alt:"dispute-icon",style:t})};var Eh=styled$1(Yn,{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",gap:e.spacing(.5),...Ya(t)&&{height:"18px"},alignItems:"center"})),Mh=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function pp({countryCode:e,isTextShown:t,cardNumber:o,bankName:n,tableMode:r}){let i=Bc(useId(),"issuer-icon"),l=o?.slice(0,4),a=o?.slice(-4);return jsxs(Eh,{id:i,"data-testid":"IssuerIcon",tableMode:r,children:[e&&jsx(kt,{countryCode:e,isTextShown:t}),jsx(p,{title:`${n?`Issuer - ${n}`:""}`,children:jsx(Mh,{children:`${l||""} ${a||""}`})})]})}var lA=pp;var mA=({payoutStatus:e="PENDING",isTextShown:t,payoutTooltip:o,iconStyles:n,isSheetViewShown:r,chipIndex:i=0,selectionProps:l={}})=>{let{t:a}=useTranslation(),s=Bc(useId(),"payout-icon"),p$1=a(wt(e)),c=o||p$1;return r?jsx(b$1,{copyTrigger:"press",copyText:p$1,children:p$1}):jsx(p,{title:c,children:t?jsx(wi,{id:s,"data-testid":"StatusCell_PayoutStatusLabel",children:p$1}):jsx(U,{id:s,src:e$1[e],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:n})})};var CA=({isTextShown:e,refundStatus:t="PENDING",refundTooltip:o="",refundCount:n,iconStyles:r,isSheetViewShown:i,chipIndex:l=0,selectionProps:a={}})=>{let{t:s}=useTranslation(),p$1=useTheme(),c=Bc(useId(),"refund-icon"),m=(n||0)>1,u=s(wt(t));if(i)return jsxs(b$1,{copyTrigger:"press",copyText:u,children:[u," ",m?`${n}x`:null]});let f=jsxs(Bd,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[n,"x"]});return e?jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:jsx(wi,{id:c,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d$5[t].color,backgroundColor:d$5[t].backgroundColor,width:"90px"},children:jsxs(ol,{whileInView:m?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[u," ",m?f:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:m?jsxs(ol,{id:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[jsx(kd,{src:rk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),f]}):jsx(U,{id:c,src:c$5[t],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:r})})},Dh=CA;var xA=Dh;var hA={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},de=e=>hA[e?.toLowerCase()||""]||e;styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var Lh=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));var Rh=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),kh=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var Bh=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function _e({source:e,isTextShown:t,title:o,width:n,height:r,imgSx:i}){let{t:l}=useTranslation(),a=h(e);return jsx(p,{title:o,children:t?jsx(kh,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(Rh,{"data-testid":"SourceCell_TextLabel","data-source":e,children:l(wt(e))})}):jsx(Lh,{src:a,alt:e,width:n,height:r,onError:s=>{s.currentTarget.src=h("card");},sx:i})})}function AA({payment:e,card:t,isTextShown:o,firstIcon:n}){let r=Bc(useId(),"source-icons"),{t:i}=useTranslation(),l=useCallback(()=>{let p=[],c=ec(e),m=e?.method,u=e?.scheme;return de(m)?.toLowerCase()===de(u)?.toLowerCase()?p.push(de(m),de(c)):p.push(de(m),de(c),de(u)),p},[e]),a=useMemo(()=>jsx(_e,{source:n,isTextShown:o,title:i(wt(n))},n),[n,o,i]),s=useMemo(()=>l()?.filter(p=>!!p&&p!==n)?.map((p,c,m)=>{let u=e?.wallet===i("sv_wallet")?i("storedValueWallet"):i("passThruWallet"),f=c===m.length-1&&t?.last_four?`${i(wt(p))} - ${t?.last_four}`:i(wt(p));return jsx(_e,{source:p,isTextShown:o,title:c===0&&p==="Wallet"?u:f},`${p}-${c}`)}),[l,e,t,o,i,n]);return jsxs(Box,{id:r,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[n&&a,s,t?.last_four&&jsxs(Bh,{children:["\xB7\xB7\xB7 ",t?.last_four]})]})}var jn={PROCESSED:Ug$1,FAILED:""};var Fh=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Hh=styled("img")(()=>({width:"16px",height:"16px"})),Oh=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function Ci({status:e,isTextShown:t,isSheetViewShown:o}){let n=useTheme$1(),{t:r}=useTranslation(),i=Bc(useId(),"destination-icon"),l=r(wt(e));return o&&jn[e]?jsx(b$1,{copyTrigger:"press",copyText:l,children:l}):t&&jn[e]?jsx(Fh,{id:i,"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:"#1F88D00D",color:e==="PROCESSED"?n.palette.info.dark:n.palette.common.black},children:l}):jsx(Oh,{id:i,"data-testid":"DestinationIcon",className:"destination-status",children:e&&jn[e]&&jsx(p,{title:r(wt(e)),children:jsx(Hh,{src:jn[e],alt:"destination-icon"})})})}
|
|
1
|
+
import {a}from'./chunk-J43HMZGL.js';import {b as b$a,c as c$3}from'./chunk-TKQTJ4MH.js';import {b as b$1}from'./chunk-BXVLLRHG.js';import {a as a$5}from'./chunk-XRUOTYCI.js';import {a as a$6,f as f$2,e as e$1,b as b$d,g as g$1,d as d$5,c as c$5}from'./chunk-LON6X4MJ.js';import {g,a as a$8}from'./chunk-UC5FMNUV.js';import {a as a$4}from'./chunk-FTRMTWS4.js';import {a as a$9}from'./chunk-64ZDTAAW.js';import {a as a$1}from'./chunk-DFEQ23C7.js';import {b as b$7}from'./chunk-REZFP4CA.js';import {b as b$5}from'./chunk-GBGW63EG.js';import {b as b$b}from'./chunk-XXCH74F3.js';import {b as b$6}from'./chunk-MF5ATA3Y.js';import {d as d$3}from'./chunk-YIZKLFYJ.js';import {a as a$7,b as b$c,d as d$4,c as c$4}from'./chunk-DRRME7J2.js';import {b as b$9}from'./chunk-FMUJQ45L.js';import {b as b$8}from'./chunk-RNJI3YXH.js';import {c as c$2}from'./chunk-LVQ2UFZT.js';import {f,a as a$2,b as b$3,d as d$1,c as c$1,e}from'./chunk-TN55SPRQ.js';import {b as b$2}from'./chunk-TZOMS57X.js';import {b as b$4,c,d as d$2}from'./chunk-LXG5YXOJ.js';import {a as a$3}from'./chunk-EG32DA46.js';import {t,p,z,j,V,b,R,D,d,B,v as v$1,f as f$1}from'./chunk-AXNWVU3K.js';import {n,r}from'./chunk-EOBVIUIS.js';import {Bc,gc,Ya,ya,nc,Na,z as z$1,Eb as Eb$1,Db,Cb as Cb$1,Xa,cc,db,xb as xb$1,yb as yb$1,Ab as Ab$1,Bb as Bb$1,zb as zb$2,ac,Ca,Ka,Fa,Ja as Ja$1,fc,q,ec,f as f$3,v as v$2}from'./chunk-RUFO5P34.js';import {Cb,zb as zb$1,Bb,Wd as Wd$1,Ej,rc,Di,Bi as Bi$1,Ci as Ci$1,Dh as Dh$1,Og as Og$1,Uh,Ue,hk,ja,zk,qk,F,E,Mj,Lj,Kj,Ij,Gj,Hj,Jj,jc,kc,hc,ma,Kl as Kl$1,Eb,Fb,Gb as Gb$1,C,Yj,Ch as Ch$1,yb,hm,Mh as Mh$1,Lh as Lh$1,jb as jb$1,xb,yo,Yc,Xc,Hb,fh as fh$1,kh as kh$1,lh as lh$1,ih as ih$1,hh as hh$1,ch,dh,eh as eh$1,ah as ah$1,bh as bh$1,mh as mh$1,T,yi as yi$1,Ai,zi as zi$1,xi,Ei,Vg as Vg$1,Qj,Rj,H as H$1,no as no$1,G,wb as wb$1,z as z$2,hp,da,ca,na,sk,Bk,tk,jk,lk as lk$1,wk,yk as yk$1,rk,ok,pk,Pn,cc as cc$1,dc,Qh,uk as uk$1,nh,yh as yh$1,xh as xh$1,wh,vh,uh as uh$1,th as th$1,sh as sh$1,rh,qh,ph as ph$1,oh as oh$1,Xh as Xh$1,Vh,Wh,_h,Zh,ce,Zd,be as be$1,Hn,Fn as Fn$1,ui,qb,_d as _d$1,vn,$d as $d$1,rb,Fh as Fh$1,Eh as Eh$1,Hh as Hh$1,Jh as Jh$1,Ih as Ih$1,Kh,le as le$1,uf as uf$1,tf as tf$1,sf as sf$1,rf as rf$1,qf as qf$1,vf as vf$1,pf,Ba,Aa,mf as mf$1,lf,kf,gi,fi,ii as ii$1,hi,ji,$j,Zj,_j,Tb as Tb$1,Om,Lm,Gm,Hm,Nm,zm,Pm,Am,Qm,Bm,Im,Dm,Fm,Mm,Em,xm,Jm,Km,ym,Cm,wm,vm,um,tm,sm,_g as _g$1,Ak,Wk,ak,ek,vb,fk,ik,gk,va,ua,h,Ug as Ug$1,oo as oo$1}from'./chunk-IQAHULGQ.js';import Ds,{forwardRef,useId,memo,createContext,useState,useEffect,useMemo,useCallback,useRef,Fragment as Fragment$1,useContext}from'react';import {useTranslation}from'react-i18next';import {styled,Box,Paper,Button,TextField,Typography,Popper,CircularProgress,Link,useTheme as useTheme$1,TableCell,ClickAwayListener}from'@mui/material';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {styled as styled$1,alpha,useTheme}from'@mui/material/styles';import ry from'@mui/material/TableCell';import Yn from'@mui/material/Box';import lI from'@mui/material/SvgIcon';import wt from'lodash/camelCase';import $u from'dayjs';import MS from'dayjs/plugin/timezone';import DS from'dayjs/plugin/utc';import sf from'lodash/startCase';import tw from'@mui/material/Popover';import p0 from'@mui/material/ClickAwayListener';import r0 from'@mui/material/Popper';import y0 from'@mui/material/Typography';import VC from'@mui/material/Button';import g1 from'@mui/material/Menu';var Br={ORDER:{label:"order",icon:xi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:zi$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Ai,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:yi$1,color:"#32ADE6"}},Vr={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var Nr=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Wr=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),Fr=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Xh({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n}){let r=Bc(useId(),"agreement-icon"),i=useTheme$1(),{t:l}=useTranslation(),a=useMemo(()=>[...t?[Vr.SAVED_TOKEN]:[],...(o||0)>0?[Vr.COUNT]:[],...e&&Br[e]?[Br[e]]:[]],[t,o,e]),s=m=>n?jsx(Fr,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:l("totalPaymentCount",{amount:f$3(o)}),children:jsx(Wr,{children:jsxs(Nr,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Vr.COUNT.color},children:["x",o]})})})},m):jsx(a$9,{value:o,index:m},m),p$1=a.map((m,u)=>m.label==="countBadge"?s(u):jsx(p,{title:l(m.label),children:jsx(Fr,{children:n?jsx(Wr,{children:jsx(Nr,{"data-testid":"AgreementCell_agreementType",sx:{color:m.color},children:l(m.label)})}):jsx(d,{sx:{maxWidth:"16px",maxHeight:"16px",height:"auto",width:"auto"},src:m.icon,alt:"agreement"})},m.color)},m.color)),c=jsx(p,{title:"No agreement",children:jsx(Fr,{children:n?jsx(Wr,{children:jsx(Nr,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(d,{sx:{maxWidth:"24px",maxHeight:"24px",height:"auto",width:"auto"},src:Ei,alt:"agreement"})},"no-agreement")},"no-agreement");return jsx(Box,{id:r,"data-testid":"AgreementIcon",sx:{display:"flex",alignItems:"center",gap:"4px"},children:p$1?.length>0?p$1:c})}var rd=Xh;var Jh=rd;styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"}));styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));var ad=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),ld=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px",textAlign:"center",width:"100%"}));styled("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var sd=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var Ja={"3DS":{tooltip:"3DS",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:bh$1,borderColor:"rgba(31, 136, 208, 0.10)"}},pd={FAILED:{tooltip:"Failed",icon:Vg$1,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:ch,borderColor:"rgba(255, 61, 0, 0.10)"}};function ey({transactionStatus:e,eci:t,authType:o,isTextShown:n}){let r=Bc(useId(),"auth-icons"),i=useMemo(()=>{let a=e?pd[e]:null,s=a?.tooltip,p=e==="AUTHENTICATED"?null:a?.icon;return [{tooltip:s,content:n?s:p,type:n?"text":"icon"},...o?[{tooltip:o,content:n?Ja[o]?.tooltip:Ja[o]?.icon,type:n?"text":"icon"}]:[],{tooltip:"",content:t?`ECI ${t}`:"",type:"text"}]},[e,n,o,t]),l=useMemo(()=>i.filter(a=>!!a.content).map((a,s)=>{let p$1=a.type==="text"?jsx(ld,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(ad,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":a.content,children:a.content})}):jsx(d,{sx:{width:"16px",height:"16px"},src:a.content,alt:a.tooltip});return jsx(p,{title:a.tooltip,children:p$1},`${a.tooltip}-${s}`)}),[i]);return jsx(sd,{id:r,"data-testid":"AuthIcons",children:l})}var md=ey;var ty=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}});var oy=md;var dd=styled$1(ry,{shouldForwardProp:e=>e!=="rowId"})(({theme:e})=>({fontSize:e.typography.body2.fontSize,fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,padding:e.spacing(0),verticalAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block",width:"100%",border:"none",textAlign:e?.direction==="ltr"?"left":"right"}));var sy=forwardRef(({children:e,...t},o)=>{let n=Bc(useId(),"table-cell");return jsx(dd,{id:n,component:"div","data-testid":"TableCell",...t,ref:o,children:e})}),v=memo(sy);var fd=styled("span",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:t})=>({display:"flex",width:"17px",height:"12px",backgroundColor:t?gc(e.palette)[t]:"transparent",borderRadius:"2px",flexShrink:0,overflow:"hidden",visibility:"hidden","& > img":{width:"100%",height:"100%",objectFit:"cover"}})),Jo=styled("button")({background:"transparent",border:"none",padding:0,cursor:"pointer",outline:"none",display:"flex",alignItems:"center",justifyContent:"center",overflow:"visible"}),ct=styled(motion.div)(({theme:e})=>({borderRadius:"12px",backgroundColor:e.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5)})),kP=styled("img")(()=>({width:"12px",height:"12px"})),gd=styled("span",{shouldForwardProp:e=>e!=="isShown"})(({theme:e,isShown:t})=>({...t&&{border:`1px solid ${e.palette.divider}`},borderRadius:"12px",backgroundColor:t?e.palette.background.paper:"transparent",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,overflow:"hidden",visibility:"hidden"})),BP=styled("span")(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600})),Cd=styled("div")(()=>({display:"flex",width:"24px",height:"24px",alignItems:"center",justifyContent:"center",borderRadius:"64px;",border:"1px solid #F2F2F2;"})),xd=styled(t)(({theme:e})=>({width:24,height:24,fontSize:"8.5px",fontWeight:500,color:e.palette.background.default,border:`1px solid ${e.palette.divider}`})),H=styled("div")(({theme:e})=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`})),hd=styled(H)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:e.palette.info.light,borderColor:e.palette.divider,minWidth:"88px",height:"24px"})),yd=styled(H)(({theme:e})=>({color:e.palette.grey.A700,backgroundColor:`${e.palette.grey.A700}1A`,minWidth:"88px",height:"24px"})),Hr=styled(v)(()=>({fontSize:"11px",textAlign:"left",display:"flex",justifyContent:"flex-start",alignItems:"center",overflow:"hidden",gap:"4px",textOverflow:"ellipsis",whiteSpace:"nowrap"})),we=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ie=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),U=styled("img")(()=>({width:"36px",height:"24px"})),Or=styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`})),mt=styled(motion.span)(({theme:e,order:t})=>({position:"absolute",left:0,zIndex:t+6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var Qo={VOID:{icon:gk},CAPTURED:{icon:fk}};var _r=styled$1(motion.div)(({theme:e,isCapture:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5),paddingInline:e.spacing(.3),paddingBlock:e.spacing(.3),height:"100%",minWidth:"100%",backgroundColor:t?"#eaf3fb":"#eeeeee",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),zr=styled$1("div")(({theme:e,percentage:t,isCapture:o})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} ${o?e.palette.info.dark:"#656565"}`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:o?e.palette.info.dark:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),$r=styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`})),Ur=styled$1("img")({width:"14px",height:"14px"}),to=styled$1(Ie)({width:"16px",height:"16px"}),Mt=styled$1("img")({width:"16px",height:"16px"}),Id=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function Gr(e){return e<5?5:e===100?95:e}var bd=styled$1(Yn)({display:"flex",alignItems:"center",gap:"12px"});function Cy({value:e,format:t,flagIcon:o,hasFlag:n,tableMode:r,...i}){let l=o&&jsx(p,{title:Na(o||""),children:jsx(b$2,{countryCode:o})}),a=useMemo(()=>z$1(e,t),[e]);return jsx(v,{...i,children:jsxs(bd,{children:[n&&jsx(fd,{sx:{visibility:"visible"},className:"geography-box",children:l}),jsx(Box,{sx:{...Ya(r)&&{fontSize:"11px"}},children:a})]})})}var tn=Cy;function Sd({value:e,currentTimezone:t=no$1.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r=false,...i}){let l=m=>v$2(e,{currentTimezone:t,targetTimezone:m}),a=l(o),s=l(n),p$1=z$1(s),c=!r&&n!==o;return jsxs(Yn,{sx:{display:"flex",gap:"8px"},children:[jsx(tn,{value:a,...i}),c&&jsx(p,{title:p$1,children:jsx("img",{src:H$1,width:14,alt:"timezone"})})]})}function by({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`,l=jsx(Fragment,{children:o?.map(a=>{let s=a.name||a.description,p=(s?.length||0)>20?`${s?.slice(0,20)}...`:s;return jsx("div",{children:p},a.id)})});return jsx(p,{title:(o||[]).length>1?l:void 0,children:jsx(v,{...n,children:jsx("span",{children:i})})})}var Sy=by;function wy({value:e,label:t,items:o,...n}){let r=Number.isInteger(e)&&Number(e)>1&&t.charAt(t.length-1)!=="s"?`${t}s`:t,i=`${e} ${r}`;return jsx(v,{sx:{fontSize:"11px"},...n,children:i})}var vy=wy;var Td=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),jr=styled$1("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...Ya(t)&&{fontSize:"11px",color:e.palette.text.primary}})),wd=styled$1("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),vd=styled$1("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function Ey({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i,hideCustomerInitiatedIcon:l,hideTimezoneIcon:a,phone:s,email:p$1,id:c,...m}){let{t:u}=useTranslation(),f=e===false?u("merchantInitiated"):"",x=ac(i),I=i?.split(" ")?.map(y=>y?.[0]?.toUpperCase()).join(""),b=useMemo(()=>Ca(),[]),S=n&&jsx(p,{title:t,children:jsx(xd,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:b},src:r,alt:r,children:I})}),d=useMemo(()=>[{name:"ID",value:c},{name:"Name",value:i},{name:"Email",value:p$1},{name:"Phone",value:s}],[p$1,s,c,i]),C=useMemo(()=>d.some(({value:y})=>y)?jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:d.map(({name:y,value:w},T)=>w&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${y}`,children:y==="Name"?w:`${y}: ${w}`},`${T}-${w}`))}):null,[d]);return jsx(v,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(Td,{"data-testid":"CustomerCell_StyledCustomerCell",children:[S,jsx(p,{title:C,children:jsx(jr,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":x,children:t})}),!a&&jsx(wd,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(vd,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!l&&jsx(p,{title:f,children:jsx(gd,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!f,children:f&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:wb$1,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var My=Ey;function Ly({children:e,customerName:t}){let o=ac(t);return jsx(jr,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var Ry=Ly;var Kr=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),Ad=styled$1("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:Ya(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),Pd=styled$1("span")(({theme:e,tableMode:t})=>({fontSize:Ya(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),tl=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),qr=styled$1("div")(({theme:e,count:t})=>({justifyContent:"space-between",display:"flex",width:"100%",gap:(t||1)<=1?e.spacing(1.5):e.spacing(1)}));var ZE=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:l})=>{let a=Ka(t,o),s=Ka(n,r),p=Ka(i,l);return jsxs(tl,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Fa[e]:""}),jsxs(tl,{children:[e!=="fx"&&jsxs(qr,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(b$8,{currency:o})," ",a.integerAmount,".",a.decimalAmount]})]}),jsxs(qr,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(b$8,{currency:r})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(qr,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(b$8,{currency:l})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var oo=({tableMode:e,conversionType:t})=>t?jsx(Ad,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var no=({tableMode:e,amount:t,currency:o})=>jsx(Pd,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(b$8,{currency:o,fontSize:10})})," ",jsx(b$9,{amount:t,currency:o,sx:{fontSize:"inherit",fontWeight:"inherit"}})]}):jsx("span",{children:"-"})});var Md="default";function Fy({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(v,{...i,children:jsxs(Kr,{children:[jsx(p,{title:n||"",children:jsx(Box,{children:jsx(oo,{tableMode:Md,conversionType:e})})}),o&&jsx(p,{title:jsx(b$8,{currency:o}),children:jsx(b$2,{currencyCode:o})}),jsx(p,{title:r,children:jsx(no,{tableMode:Md,amount:t,currency:o})})]})})}var Hy=Fy;var Dd="text";function _y({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(v,{...i,children:jsxs(Kr,{children:[jsx(p,{title:n||"",children:jsx(oo,{tableMode:Dd,conversionType:e})}),jsx(p,{title:jsx(b$8,{currency:o}),children:jsx("span",{})}),jsx(p,{title:r,children:jsx(no,{tableMode:Dd,amount:t,currency:o})})]})})}var zy=_y;var Ld="sheet";function Uy({conversionType:e,amount:t,currency:o}){let{integerAmount:n,decimalAmount:r}=Ka(t,o);return jsxs(b$1,{copyTrigger:"press",copyText:t?`${n}.${r}`:"-",children:[jsx(oo,{tableMode:Ld,conversionType:e}),jsx(no,{tableMode:Ld,amount:t,currency:o})]})}var Gy=Uy;var kd=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Bd=styled$1(motion.span)(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600,backgroundColor:e.palette.secondary.main})),ol=styled$1(motion.div)(({theme:e})=>({height:"16px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.secondary.main}1A`,paddingInline:e.spacing(.5),borderRadius:"56px"})),io=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*49,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}}),ao=styled$1(motion.span)(({isTextShown:e,theme:t})=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e?"auto":"36px",...e&&{border:"none"}})),lo=styled$1(motion.div,{shouldForwardProp:e=>e!=="order"})(({order:e=0})=>({display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,zIndex:e+6,width:"fit-content",height:"24px",cursor:"pointer",borderRadius:"16px","&:hover":{zIndex:200}})),so=styled$1(motion.div,{shouldForwardProp:e=>e!=="statusesCount"})(({statusesCount:e=1})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",minWidth:`${e*6+36}px`,height:"24px",cursor:"pointer",borderRadius:"16px",overflow:"visible"})),Vd=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var Nd=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var po=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>Nd(e),[e]),n=useMemo(()=>Object.values(o).filter(Boolean),[o]),r=useMemo(()=>{if(!t)return 0;let i=Object.entries(o).findIndex(([l])=>l===t);return i===-1?Math.floor((n.length-1)/2):i},[o,t,n.length]);return {statusesList:n,centerIconIndex:r}};function Ky({statuses:e,centerIconKey:t,...o}){let{statusesList:n}=po({statuses:e,centerIconKey:t}),r=useTheme(),i=n.length||0;return jsx(v,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(so,{whileHover:"animate",animate:"start",statusesCount:i,children:n.map((l,a)=>l?jsx(lo,{order:a,variants:io(a,r.shadows[4],40),children:jsx(ao,{children:l})},a):null)})})}var qy=Ky;function Zy({statuses:e,...t}){let{statusesList:o}=po({statuses:e});return jsx(v,{...t,children:jsx(Vd,{sx:{paddingRight:"30px"},children:o.map((n,r)=>jsx(Fragment$1,{children:n},r))})})}var Jy=Zy;function eI({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r}=po({statuses:e,centerIconKey:t}),i=useTheme(),l=r.length||0,a=o||120;return jsx(v,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(so,{whileHover:"animate",animate:"start",statusesCount:l,children:r.map((s,p)=>s?jsx(lo,{order:p,variants:io(p,i.shadows[4],a),children:jsx(ao,{isTextShown:true,children:s})},p):null)})})}var tI=eI;var Qr=styled$1("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:Ya(t)?"4px":e.spacing(1),overflow:"visible"})),ei=styled$1("span")(({selected:e})=>({overflow:"visible",borderRadius:"50%",display:"flex",justifyContent:"center",alignItems:"center",position:"relative","&:hover":{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},...e&&{boxShadow:"0px 0px 20px rgba(0, 0, 0, 0.18);"},span:{flexGrow:1}})),Wd=styled$1("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),De=styled$1(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function Fd({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(De,{src:jc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(De,{src:kc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(De,{src:hc,className:"spinner-loader"},"spinner-icon"):jsx(p,{title:r("moreActions"),children:jsx(Wd,{alt:"more",src:ma,isActive:n},"ellipsis-icon")})}Fd.displayName="ActionIconsVariants";var ln=memo(Fd);var co={GRAY:{icon:Bb,color:"#CFCFCF"},ORANGE:{icon:zb$1,color:"#FFD503"},RED:{icon:Cb,color:"#FF0000"}},ti={"#CFCFCF":"gray","#FFD503":"orange","#FF0000":"red",gray:"gray",red:"red",orange:"orange"},oi={flag:E,dispute:F,refund:qk,void:zk,capture:ja,cancel:hk,clock:Ue,reverse:Uh,destination:Og$1,invoice:Dh$1,users:Ci$1,brand:Bi$1,clipboard:Di,viewApi:Wd$1,viewReceipt:rc,delete:Ej};function ni({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),l=!!r,a=(e||[]).filter(x=>x.isShown!==false),s=a.some(x=>x.isLoading),p=a.some(x=>x.isError),c=a.some(x=>x.isSuccess),m=a.length>0||!!n,u=x=>{s||!m||i(x.currentTarget);},f=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:l,filteredActions:a,isAnyActionLoading:s,isAnyActionHasError:p,isAnyActionSuccessful:c,areThereAnyShownActions:m,handleClick:u,handleClose:f,setAnchorEl:i}}var Hd=e=>jsx(lI,{sx:{height:12.6,width:13},...e,children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"13",viewBox:"2.67 1.07 10.66 12.66",fill:"none",children:jsxs("g",{transform:"translate(-4 -4)",children:[jsx("path",{d:"M7.5918 15.166C7.5918 16.4041 8.5959 17.4072 9.83398 17.4072H15.5273L15.334 17.6973C15.101 18.0473 14.7079 18.2577 14.2871 18.2578H9.83398C8.12641 18.2578 6.74219 16.8736 6.74219 15.166V8.71289C6.74219 8.2923 6.9526 7.89944 7.30273 7.66602L7.5918 7.47266V15.166ZM10.167 5.74121H15.5C16.4651 5.74121 17.2586 6.534 17.2588 7.49902V14.833C17.2586 15.798 16.4651 16.5908 15.5 16.5908H10.167C9.20193 16.5908 8.40838 15.798 8.4082 14.833V7.49902C8.40838 6.534 9.20193 5.74121 10.167 5.74121ZM10.167 6.59082C9.6596 6.59082 9.25896 6.99168 9.25879 7.49902V14.833C9.25896 15.3404 9.6596 15.7412 10.167 15.7412H15.5C16.0074 15.7412 16.408 15.3404 16.4082 14.833V7.49902C16.408 6.99168 16.0074 6.59082 15.5 6.59082H10.167Z",fill:"#20232B",stroke:"white",strokeWidth:"0.15"}),jsx("path",{d:"M10.7598 12.84V9H11.4851V12.84H10.7598Z",fill:"black"}),jsx("path",{d:"M12.2846 12.84V9H13.5272C13.5574 9 13.6197 9.00089 13.7139 9.00267C13.8081 9.00444 13.8988 9.01067 13.9859 9.02133C14.2952 9.05867 14.5574 9.16622 14.7726 9.344C14.9877 9.52178 15.1512 9.74756 15.2632 10.0213C15.3752 10.2951 15.4312 10.5947 15.4312 10.92C15.4312 11.2453 15.3752 11.5449 15.2632 11.8187C15.1512 12.0924 14.9877 12.3182 14.7726 12.496C14.5574 12.6738 14.2952 12.7813 13.9859 12.8187C13.8988 12.8293 13.8081 12.8356 13.7139 12.8373C13.6197 12.8391 13.5574 12.84 13.5272 12.84H12.2846ZM13.0206 12.1573H13.5272C13.5752 12.1573 13.6401 12.1564 13.7219 12.1547C13.8037 12.1511 13.8774 12.1431 13.9432 12.1307C14.1103 12.0969 14.2463 12.0187 14.3512 11.896C14.4579 11.7733 14.5361 11.6258 14.5859 11.4533C14.6374 11.2809 14.6632 11.1031 14.6632 10.92C14.6632 10.728 14.6366 10.5458 14.5832 10.3733C14.5317 10.2009 14.4526 10.0551 14.3459 9.936C14.2392 9.81689 14.105 9.74133 13.9432 9.70933C13.8774 9.69511 13.8037 9.68711 13.7219 9.68533C13.6401 9.68356 13.5752 9.68267 13.5272 9.68267H13.0206V12.1573Z",fill:"black"})]})})});var _d=".IDButton-root:not(.IDButton-hoverDisabled):hover &",zd=styled$1("div")(({theme:e})=>({paddingInlineStart:"8px",border:"1px solid transparent",display:"flex",gap:"4px",alignItems:"center",justifyContent:"flex-end",backgroundColor:e.palette.common.white,float:"right",borderRadius:"56px",height:"100%",paddingLeft:"4px",paddingRight:"4px",width:"24px",overflow:"hidden",[_d]:{width:"max-content",overflow:"visible",borderColor:"rgba(92, 92, 92, 0.05)",boxShadow:"-7px 0px 8px 0px #F2F2F2",position:"absolute",right:0,top:0,zIndex:101}})),$d=styled$1("div")(({theme:e})=>({color:e.palette.text.primary,fontSize:"11px",lineHeight:"120%",display:"grid",gridTemplateColumns:"0fr",opacity:0,transition:"grid-template-columns 0.1s ease, opacity 0.1s ease","& > span":{overflow:"hidden",minWidth:0,whiteSpace:"nowrap"},[_d]:{gridTemplateColumns:"1fr",opacity:1,transition:"grid-template-columns 0.3s ease, opacity 0.3s ease 0.3s"}}));function dI({icon:e=jsx(Hd,{}),id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,className:i,...l}){let{t:a}=useTranslation();return jsx(p,{title:a("copy"),children:jsx(Yn,{className:nc("IDButton-root",n&&"IDButton-hoverDisabled",i),sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...l,children:jsxs(zd,{className:"IDButton-button",children:[t?jsx($d,{className:"IDButton-rowId",children:jsx("span",{children:t})}):null,t?jsx(D,{className:"IDButton-icon",icon:e,text:t,onClick:()=>r?.()}):null]})})})}var il=memo(dI);var nL=memo(({flag:e,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:l=true,row:a,showJsonViewer:s=true,isTextShown:p$1,showIdButton:c=true,onCopyId:m,rowId:u,onJsonViewClick:f$1,renderDropdown:x,startSlot:I,...b})=>{let{t:S}=useTranslation(),{open:d,anchorEl:C,filteredActions:y,isAnyActionLoading:w,isAnyActionHasError:T,isAnyActionSuccessful:h,areThereAnyShownActions:A,handleClick:P,handleClose:M,setAnchorEl:E}=ni({actions:t,isDropdownShown:l,onCloseDropdown:i,renderDropdown:x});return jsx(v,{...b,sx:{overflow:"visible",...b.sx},children:jsxs(Qr,{"data-testid":"ActionCell_ActionCellContainer",children:[I,e&&jsx(Fragment,{children:p$1?jsx(p,{title:o,children:jsx(H,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(p,{title:o,children:jsxs(ct,{"data-testid":"ActionCell_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(De,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:co[e]?.icon,alt:"flag-icon"}),(n??0)>1&&jsx(motion.div,{"data-testid":"ActionCell_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:ti[co[e]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),c&&jsx(il,{id:u||a.id,onCopyId:m}),jsxs("div",{"data-testid":"ActionCell_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:[s&&jsx(Fragment,{children:jsx(Jo,{onClick:f$1,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(p,{title:S("jsonViewer"),children:jsx(Cd,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Wd$1,alt:"icon"},"id-icon")})})})}),jsxs(ei,{id:"styled-popover",selected:!!r||d,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":A,sx:{...!A&&{pointerEvents:"none"}},children:[jsx(Jo,{onClick:P,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":A,sx:{...!A&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(ln,{isAnyActionLoading:w,isAnyActionHasError:T,isAnyActionSuccessful:h,areThereAnyShownActions:A})})}),r,x?x(C,E):jsx(Fragment,{children:A&&jsx(f,{style:{zIndex:2e3},open:d,onClose:M,anchorEl:C,menuItems:y.map(k=>({...k,onClick:N=>{k?.onClick?.(N),k.hasActionMenu||M();},onRightClick:N=>{k?.onRightClick?.(N),M();},icon:k.customIcon||jsx(De,{icon:k.icon,src:k.iconSrc??(k.icon&&oi[k.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${k.label.trim()}`)}))})})]})]})]})})});function yI({flag:e,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:l=true,rowId:a,onJsonViewClick:s,tableMode:p$1,...c}){return jsx(v,{...c,sx:{overflow:"visible"},children:jsxs(Qr,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p$1,children:[e&&jsx(Fragment,{children:i?jsx(p,{title:t,children:jsx(H,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(p,{title:t,children:jsxs(ct,{"data-testid":"ActionsColumn_FlagBadge",sx:{paddingInline:"12px",width:"auto",alignItems:"center",position:"relative",zIndex:21,gap:"0px"},whileHover:["animate","fadeIn"],variants:{animate:{gap:"4px"}},children:[jsx(De,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:co[e]?.icon,alt:"flag-icon"}),(o??0)>1&&jsx(motion.div,{"data-testid":"ActionsColumn_StyledBadge_Container",style:{alignItems:"center",justifyContent:"center",gap:"4px",display:"flex",zIndex:10},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:ti[co[e]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),l&&jsx(b$1,{sx:{minWidth:"213px"},children:a||n.id}),jsx("div",{"data-testid":"ActionsColumn_IconsContainer",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:r&&jsx(b$1,{onClick:s,children:"View API"})})]})})}var II=memo(yI);function wI({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:l,anchorEl:a,filteredActions:s,isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:u,handleClick:f$1,handleClose:x,setAnchorEl:I}=ni({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(v,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(ei,{id:"styled-popover",selected:!!t||l,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":u,sx:{...!u&&{pointerEvents:"none"}},children:[jsx(Jo,{onClick:f$1,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":u,sx:{...!u&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(ln,{isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:u})})}),r?r(a,I):jsxs(Fragment,{children:[t,u&&jsx(f,{style:{zIndex:2e3},open:l,onClose:x,anchorEl:a,menuItems:s.map(b=>({...b,onClick:S=>{b?.onClick?.(S),b.hasActionMenu||x();},onRightClick:S=>{b?.onRightClick?.(S),x();},icon:b.customIcon||jsx(De,{icon:b.icon,src:b.iconSrc??(b.icon&&oi[b.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${b.label.trim()}`)}))})]})]})})})}var vI=memo(wI);function EI({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(v,{...r,children:jsxs(Yn,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(kt,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$2,{type:e,isTextShown:o})]})})}var MI=EI;var Yd=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),jd=styled("span")(({theme:e})=>({fontSize:e.typography.pxToRem(12),color:e.palette.info.dark,fontWeight:700,paddingInline:e.spacing(1),borderRadius:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${e.palette.info.dark}1A`})),Kd=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`,paddingInline:e.spacing(1),borderRadius:"56px",height:"24px"}));styled("img")(({theme:e,order:t})=>({borderRadius:"50%",backgroundColor:e.palette.common.white,width:"16px",height:"16px",padding:"2px",zIndex:t+1,position:"absolute",left:`${t*9}px`}));var qd=styled("img")(({pointLeft:e})=>({width:"12.5px",height:"13px",transform:`scale(${e?"-1":"1"}, 1)`}));styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",backgroundColor:e.palette.common.white,borderRadius:"50%",width:"16px",height:"16px",fontSize:"8px",fontWeight:e.typography.fontWeightBold,lineHeight:"11px",position:"absolute",left:"18px",zIndex:4,textAlign:"center",span:{flexGrow:1}}));function kI({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...l}){let a=useMemo(()=>{if(typeof e=="number")return e;let c=Number(e);return Number.isNaN(c)?void 0:c},[e]),s=a!==void 0?a>0:!!e,p$1=a!==void 0&&a>1;return !s||r?null:jsx(Yn,{sx:{width:"fit-content",overflow:"visible"},...l,children:jsx(p,{title:t,children:jsxs(Kd,{children:[jsx(qd,{src:z$2,pointLeft:i==="left"}),p$1&&jsx(Yd,{children:jsx(jd,{children:e})})]})})})}var BI=kI;function WI(e){let{destination:t,...o}=e,n={...o};delete n.destinationsCount,delete n.destinationsTooltip,delete n.destinationsAmount,delete n.hidden,delete n.iconDirection,delete n.selectionProps,delete n.flagIcon;let r=t?.destination||[];return jsx(Yn,{sx:{display:"flex",gap:"4px",alignItems:"center"},...n,children:r.map((i,l)=>{let a=Ja$1(i?.amount||0),s=`${a.integerAmount}.${a.decimalAmount}`;return jsxs(b$1,{copyTrigger:"press",copyText:s,children:[i?.id," | ",jsx(b$8,{currency:i?.currency})," ",s]},i?.id||l)})})}var FI=WI;function _I({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...l}){let a=o?.destination||[],s=Ja$1(n||0),p$1=Ja$1(a?.[0]?.amount||0);return !e||r?null:jsx(Yn,{sx:{width:"fit-content",overflow:"visible"},...l,children:jsx(p,{title:t,children:jsx(H,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",a?.[0]?.id," - ",jsx(b$8,{currency:a?.[0]?.currency})," ",p$1.integerAmount,".",p$1.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",a?.[0]?.id," - ",jsx(b$8,{currency:a?.[0]?.currency})," ",s.integerAmount,".",s.decimalAmount]})})})})}var zI=_I;var mR=({destination:e,amount:t})=>{let o=e?.destination||[];return o?.length>1?jsxs("div",{children:[jsx("div",{children:"Destination"}),e?.destination?.map(r=>{let i=Ja$1(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(b$8,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(b$8,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var Jd=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",minWidth:"24px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,zIndex:10,position:"absolute"})),Qd=styled("div")(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function eu(e){return e<5?5:e===100?95:e}function jI({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),l=jsx(b$8,{currency:n}),{integerAmount:a,decimalAmount:s}=Ka(o,n),p$1=`${a}.${s}`,c=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",l," ",p$1]}),[o,n]);return e===0||o<0?null:jsx(v,{...r,children:jsx(p,{title:c,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(Jd,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs(Qd,{percentage:e,children:[e,"% ",jsx(Or,{percentage:eu(e)})]}),!!t&&jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px",width:0},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs("span",{children:[t," days left"]})})]})})})})}var KI=jI;function XI({remainingAmount:e,currency:t}){let o=jsx(b$8,{currency:t}),{integerAmount:n,decimalAmount:r}=Ka(e,t),i=`${n}.${r}`;return jsxs(b$1,{copyTrigger:"press",copyText:`${n}.${r}`,children:[o," ",i]})}var ZI=XI;var dl=["authenticationMode","paymentAuth","paymentAgreement"],ul=["paymentIssuer","paymentInitiated","paymentDevice"],tu=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...ul,...dl];var ru=styled$1(Yn)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),iu=styled$1(Yn)(()=>({marginLeft:"8px",width:20}));function ob(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let l of tu)if(e?.[l])return {centerIcon:e?.[l],centerIconId:l};return {centerIcon:null,centerIconId:null}},[e]);if(!o)return null;let n=o!=="paymentScheme"&&e.paymentScheme,r=o!=="paymentCardNumber"&&e.paymentCardNumber,i=o!=="paymentType"&&e.paymentType;return jsx(a$1,{expandedZIndex:0,centerIcon:t,leftIcons:ul.filter(l=>l!==o&&e?.[l]).map(l=>e?.[l]),rightIcons:dl.filter(l=>l!==o&&e?.[l]).map(l=>e?.[l]),expandableCenterRight:(n||r)&&jsxs(ru,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}),expandableCenterLeft:i&&jsx(iu,{children:e.paymentType})})}var nb=memo(ob);var lu=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function lk({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r(wt(fc(t,n)?o:n))} - ${e?.last_four}`;return jsx(p,{title:i,children:jsxs(lu,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}function uk({method:e}){let{t}=useTranslation();return e?jsx(_e,{source:de(e)??e,title:`Payment Method - ${t(wt(e))}`}):null}function yk({type:e}){let{t}=useTranslation();return e?jsx(_e,{source:de(e)??e??"",title:`Payment Type - ${t(wt(e))}`}):null}function vk({scheme:e}){let{t}=useTranslation();return e?jsx(_e,{source:de(e)??e,title:`Payment Scheme - ${t(wt(e))}`}):null}var Rk=({mode:e})=>e?jsx(p,{title:hp[e],children:jsx(Yn,{component:"img",src:e==="C"?da:ca})}):null;var ii={ORDER:{label:"order",icon:xi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:zi$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Ai,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:yi$1,color:"#32ADE6"}},ai={SAVED_TOKEN:{label:"savedToken",icon:T,color:"#76BB40"},COUNT:{label:"countBadge",icon:"countBadge",color:"#76BB40"}};styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)}));styled("img")(()=>({width:"35px",height:"16px",display:"block"}));styled("span")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"14.67px",height:"10px"}));styled("img")(()=>({maxWidth:"100%",width:"100%"}));var li=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),si=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),cu=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),mu=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),fl=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),pi=(e,t)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}}),ci=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Tb({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:l}=useTranslation(),a=useMemo(()=>[...t?[ai.SAVED_TOKEN]:[],...(o||0)>0?[ai.COUNT]:[],...e&&ii[e]?[ii[e]]:[]],[t,o,e]),s=u=>n?jsx(ci,{"data-testid":"AgreementCell_countBadge",order:u,variants:pi(u,n?85:0),children:jsx(p,{title:l("totalPaymentCount",{amount:f$3(o)}),children:jsx(si,{children:jsxs(li,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:ai.COUNT.color},children:["x",o]})})})},u):jsx(a$9,{value:o,index:u},u),p$1=a.map((u,f)=>u.label==="countBadge"?s(f):jsx(p,{title:l(u.label),children:jsx(ci,{order:f,variants:pi(f,f>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx(si,{children:jsx(li,{"data-testid":"AgreementCell_agreementType",sx:{color:u.color},children:l(u.label)})}):jsx(fl,{src:u.icon,alt:"agreement"})},u.color)},u.color)),c=p$1.length,m=jsx(p,{title:"No agreement",children:jsx(ci,{order:0,variants:pi(0,0),sx:{width:n?"auto":"36px"},children:n?jsx(si,{children:jsx(li,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(fl,{src:Ei,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(v,{...r,children:jsx(mu,{"data-testid":"AgreementCell",children:jsx(cu,{layout:true,className:"payment-sources-container","data-testid":"AgreementCell_PaymentSourcesContainer",whileHover:"animate",animate:"start",sourcesCount:c||0,variants:{animate:{width:(c||0)*38}},children:p$1?.length>0?p$1:m})})})}var wb=Tb;var uu=styled$1("img")(()=>({width:"12.67px",height:"15px"}));styled$1("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));function Ab({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(v,{style:{textAlign:n||"center",overflow:"visible",display:"flex",width:"100%",justifyContent:n==="left"?"flex-start":"center"},...r,children:e?jsx(p,{title:t,children:jsx(ct,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(H,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(uu,{src:na,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var Pb=Ab;var fu={REFUNDED:pk,PAID_OUT:ok,SETTLED:rk,PENDING:qk,UNKNOWN:yk$1,TIMEDOUT:wk,CANCELLED:hk,FAILED:lk$1,DECLINED:jk,RESTRICTED:tk,IN_PROGRESS:Bk,ACCEPTED:sk},gu={REFUNDED:"refunded"};function Cu({status:e,refundTooltip:t}){let{t:o}=useTranslation();return jsx(p,{title:jsxs("div",{children:[jsx("div",{children:o(wt(e))}),t]}),children:jsx(Ie,{children:jsx("img",{src:fu[e],alt:"refund-requested"})})})}function hu({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:l,refundTooltip:a}){let{t:s}=useTranslation();return Pn?.includes(e??"")?jsx(Xe,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:l,iconWrapperStyles:{height:17}}):jsx(Cu,{status:e,refundTooltip:a})}var yu=styled$1(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.625),paddingBlock:e.spacing(.625),height:"24px",minWidth:"24px",backgroundColor:"#ede8fb",borderRadius:"56px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10})),Iu=styled$1("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0})),bu=styled$1(tn)(({theme:e})=>({fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main}));styled$1("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled$1("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var Su=styled$1("img")({width:"14px",height:"14px"}),Tu=styled$1(Yn)(({theme:e})=>({position:"relative",zIndex:25,border:`1px solid ${e.palette.divider}`,height:24,borderRadius:"12px",padding:"3px 4px","> div":{paddingTop:0,paddingBottom:0,height:16}}));function gl({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r,gatewayTooltip:i,unCapturedTooltip:l,acquirerTooltip:a,errorCode:s,acquirerCode:p$1,gatewayCode:c,timezone:m}){let u=useTheme(),{t:f}=useTranslation(),x=v$2(new Date(Number(r)),{currentTimezone:oo$1,targetTimezone:m?.offset}),I=useMemo(()=>t||(e==="REFUNDED"?pk:rk),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(p,{title:jsxs("div",{children:[jsx("div",{children:n??f(gu.REFUNDED)}),o]}),children:jsxs(yu,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r&&{animate:{boxShadow:u.shadows[4]}}},sx:{...!r&&{backgroundColor:"transparent"}},children:[jsx(Su,{sx:{...!r&&{width:"16px",height:"16px"}},src:I,alt:"refunded"}),jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:r&&jsx(Iu,{children:jsx(bu,{value:x})})})]})}):jsx(hu,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:l,acquirerTooltip:a,errorCode:s,acquirerCode:p$1,gatewayCode:c})}var vu=()=>{let e=useTheme();return {REFUNDED:{color:e.palette.common.lightPurple,backgroundColor:`${e.palette.common.lightPurple}1A`},PENDING:{color:e.palette.custom[500],backgroundColor:`${e.palette.custom[500]}0d`},PAID_OUT:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},SETTLED:{color:e.palette.common.green,backgroundColor:`${e.palette.common.green}0d`},UNKNOWN:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},TIMEDOUT:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},FAILED:{color:e.palette.custom[500],background:`${e.palette.custom[500]}1A`},DECLINED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},RESTRICTED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},IN_PROGRESS:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`},CANCELLED:{color:e.palette.error.main,background:`${e.palette.error.main}1A`},ACCEPTED:{color:e.palette.grey[700],background:`${e.palette.grey[700]}1A`}}};function zb({status:e,date:t,refundTooltip:o,isTextShown:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:l,acquirerCode:a,gatewayCode:s,unCapturedTooltip:p$1,timezone:c,refundTooltipLabel:m,refundIcon:u,...f}){let{t:x}=useTranslation(),I=vu(),b=useCallback(d=>$u(d).format("MMM D, YYYY"),[]),S=Pn.includes(e);return jsx(v,{...f,style:{overflow:"visible"},children:jsx(we,{children:jsx(Tu,{width:n?"auto":"36px",sx:{...S&&{border:"none"}},children:n?jsx(p,{title:t?b(t):x(wt(e)),children:jsx(H,{sx:{...I[e]?I[e]:I.PENDING},children:x(wt(e))})}):jsx(gl,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p$1,acquirerTooltip:i,errorCode:l,acquirerCode:a,gatewayCode:s,timezone:c,refundTooltipLabel:m,refundIcon:u})})})})}var $b=zb;var Pu=styled("img")(()=>({width:"16px",height:"16px"})),Eu=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Mu=styled("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.info.dark}1a`})),Du=styled("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function Ub({walletId:e,country:t,showCountry:o=true,...n}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Eu,{children:[o&&t&&jsx(p,{title:Na(t),children:jsx(b$2,{countryCode:t})}),jsxs(Mu,{children:[jsx(Pu,{src:cc$1,alt:"wallet-icon"}),e&&jsxs(Du,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var Gb=Ub;var Lu=styled("img")(()=>({width:"16px",height:"16px"})),Ru=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),ku=styled("span")(({theme:e})=>({display:"flex",paddingInline:e.spacing(1),paddingBlock:e.spacing(.5),alignItems:"center",justifyContent:"center",gap:e.spacing(.5),borderRadius:"56px",background:`${e.palette.common.white}`,border:`1px solid ${e.palette.divider}`})),Bu=styled("span")(({theme:e})=>({color:`${e.palette.text.primary}`,fontSize:"14px",lineHeight:"16.8px"}));styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function Yb({walletId:e,country:t,name:o,...n}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Ru,{children:[t&&jsx(p,{title:Na(t),children:jsx(b$2,{countryCode:t})}),jsxs(ku,{children:[jsx(Lu,{src:dc,alt:"bank-icon"}),e&&jsxs(Bu,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var jb=Yb;var hl={PAID_OUT:ok,SETTLED:uk$1,PENDING:Qh,INITIATED:Qh,FAILED:lk$1};function Zb({payoutStatus:e="PAID_OUT",...t}){let{t:o}=useTranslation(),n=useTheme();return jsx(v,{...t,children:jsx(we,{children:jsx(Ie,{className:"payout-status",style:{visibility:"visible",width:"36px",borderRadius:"23.1px",backgroundColor:n.palette.common.white,border:`1.029px solid ${n.palette.divider}`},children:e&&hl[e]&&jsx(p,{title:o(wt(e)),children:jsx(U,{src:hl[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var Jb=Zb;styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"}));styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"}));styled$1(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)}));styled$1("img")(()=>({width:"13px",height:"13px"}));styled$1(motion.span)(({theme:e})=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"}));styled$1(motion.div)(()=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0}));styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"}));var Qb=styled$1("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var yl=a$6;function oS({status:e,chargeStatus:t,isTextShown:o,...n}){let{t:r}=useTranslation();return jsx(v,{...n,children:jsxs(we,{children:[jsx(Ci,{status:e,isTextShown:o}),t&&yl[t]&&jsx(p,{title:r(wt(t)),children:jsx(U,{src:yl[t],alt:"charge-icon"})})]})})}var nS=oS;var iS={FAILED:fh$1,PENDING:mh$1,INITIATED:bh$1,ATTEMPTED:ah$1,EXEMPTED:eh$1,EXEMPTED_WITH_TRANSACTION:eh$1,EXEMPTED_WITHOUT_TRANSACTION:dh,REJECTED:ch,UNAVAILABLE:hh$1,UNDETERMINED:ih$1,SUCCESS:lh$1,AUTHENTICATED:kh$1,AUTHENTICATED_WITH_TRANSACTION:kh$1,AUTHENTICATED_WITHOUT_TRANSACTION:kh$1,AUTHENTICATED_AUTHORIZE_FAILED:fh$1},Il={FAILED:nh,PENDING:oh$1,INITIATED:ph$1,ATTEMPTED:qh,EXEMPTED:rh,EXEMPTED_WITH_TRANSACTION:rh,EXEMPTED_WITHOUT_TRANSACTION:sh$1,REJECTED:th$1,UNAVAILABLE:uh$1,UNDETERMINED:vh,SUCCESS:wh,AUTHENTICATED:xh$1,AUTHENTICATED_WITH_TRANSACTION:xh$1,AUTHENTICATED_WITHOUT_TRANSACTION:yh$1,AUTHENTICATED_AUTHORIZE_FAILED:nh},Nt=a$6;function sS({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:l,...a}){let{t:s}=useTranslation(),p$1=useTheme(),c=[e&&Il[e]?jsx(p,{title:s(wt(e)),children:jsx("img",{src:Il[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&Nt[o]?jsx(p,{title:s(wt(o)),children:jsx(Xe,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:l})}):null,t&&f$2[t]?jsx(p,{title:s(wt(t)),children:jsx("img",{src:f$2[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),m=c.length||0;return jsx(v,{...a,sx:{position:"relative",overflow:"visible"},children:jsx(so,{whileHover:"animate",animate:"start",statusesCount:m,children:c.map((u,f)=>u?jsx(lo,{order:f,variants:io(f,p$1.shadows[4],40),children:jsx(ao,{children:u})},f):null)})})}var pS=sS;var Sl={issuer:Zh,scheme:_h,device:Xh$1,app:Wh,wallet:Vh,biometric:Xh$1};function dS({type:e,...t}){let{t:o}=useTranslation();return jsx(v,{...t,children:jsx(we,{children:jsx(Ie,{className:"authentication-status",children:e&&Sl[e]&&jsx(p,{title:o(wt(e)),children:jsx(U,{src:Sl[e],alt:"authentication-type"})})})})})}var uS=dS;var Vu={SMS:be$1,EMAIL:Zd,WHATSAPP:ce};var Nu=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Wu=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Fu=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),Hu=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Ou=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),_u=(e,t)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}});function xS({channels:e,isTextShown:t,...o}){let{t:n}=useTranslation(),r=useTheme(),i={WHATSAPP:r.palette.custom[700],EMAIL:r.palette.custom[800],SMS:r.palette.custom[900]},a=e?.sort(p=>p==="EMAIL"?-1:p==="SMS"?1:p==="WHATSAPP"?2:0)?.filter(p=>!!p)?.map((p$1,c)=>{if(!p$1)return null;let m=n(p$1?.toLowerCase());return jsx(mt,{order:c,variants:_u(c,t?74:0),sx:{width:t?"70px":"36px"},children:jsx(p,{title:m,placement:"top",wrapperProps:{sx:{width:"100%",height:"100%",justifyContent:"center"}},children:t?jsx(Ou,{children:jsx(Hu,{sx:{color:i[p$1]},children:m})}):jsx(Wu,{src:Vu[p$1],alt:p$1})})},`${p$1}-${c}`)}),s=a?.length||0;return jsx(v,{...o,children:jsx(Nu,{children:a?.length>0?jsx(Fu,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:s||0,variants:{animate:{width:(s||0)*38}},style:{zIndex:29},children:a}):null})})}var hS=xS;function hn(e){return z$1(e,{sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"})}styled(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"80px",fontSize:"10px",color:e.palette.text.primary}));styled("img")(()=>({width:"16px",height:"16px"}));styled("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));styled("div")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.error.main}));var zu=styled(j)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));function IS({dueDate:e,expiryDate:t,...o}){let n=useMemo(()=>({label:hn($u(e).valueOf()),tooltip:"Due Date"}),[e]),r=useMemo(()=>({label:hn($u(t).valueOf()),tooltip:"Expiry Date"}),[t]),i=s=>jsx(p,{title:s.tooltip,children:jsx(zu,{children:s.label})}),l=useMemo(()=>e?i(n):t?i(r):null,[n,r,e,t]),a=useMemo(()=>t&&e?[i(r)]:[],[n,r,e,t]);return !e&&!t?null:jsx(v,{...o,sx:{position:"relative",overflow:"visible"},children:jsx(a$1,{sx:{justifyContent:"flex-start"},centerIcon:l,rightIcons:a})})}var bS=IS;var Uu=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),height:"34px",minWidth:"24px",borderRadius:"8px",width:"fit-content",fontSize:"10px",color:e.palette.text.primary,position:"relative",zIndex:10,border:"1px solid transparent","&:hover":{backgroundColor:e.palette.common.white,border:`1px solid ${e.palette.divider}`}}));styled("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"12px",fontWeight:e.typography.fontWeightRegular,color:e.palette.secondary.main,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));styled("span")(({theme:e,isCapture:t})=>({backgroundColor:t?e.palette.info.dark:"#656565",color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600}));var Tl=styled("img")({width:"24px",height:"24px"});function wS({products:e,...t}){let o=e?.map((r,i)=>jsx(Tl,{sx:{...r?.toLowerCase()===Fn$1.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:Hn.find(l=>l.code?.toLowerCase()===r?.toLowerCase())?.iconUrl,alt:"product-icon"},`${i}-${r}`)),n=jsxs(Uu,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(Tl,{src:ui,alt:"products-icon"}),jsx(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:o})]});return jsx(v,{...t,style:{overflow:"visible"},children:jsx(we,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:n})})})}var vS=wS;function yi(e){return jsx(Hr,{...e,children:jsx(p,{title:e.tooltip||e.children,children:e.children})})}var Ku=styled$1(Yn)(()=>({display:"flex",alignItems:"center",gap:"8px"})),qu=styled$1(Yn)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function xW({currency:e}){return jsxs(Ku,{children:[jsx(b$2,{currencyCode:e}),jsx(qu,{children:e})]})}$u.extend(DS);$u.extend(MS);function Ju({value:e,...t}){let o=useMemo(()=>z$1(e,{sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"}),[e]);return jsx(v,{...t,children:o})}var Qu=styled$1(Yn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:36,height:24,border:`1px solid ${e.palette.divider}`,borderRadius:"24px","&:hover":{boxShadow:e.shadows[4]}}));function WW({reference:e}){return e?jsx(p,{title:`Bank - ${e}`,children:jsx(Qu,{children:jsx(Yn,{component:"img",src:qb,alt:"bank",width:14})})}):jsx(Fragment,{})}var wl={acquirer:qb,generic:rb,payment:$d$1,gateway:vn,order:_d$1};var ef=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),tf=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),of=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({sourcesCount:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${e*6+36}px `,minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),nf=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),rf=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled("div")(()=>({height:"18px"}));var af=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t}});var OS=120,_S=50;function zS({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),[i,l]=useState(null),a=useRef(null),s=useRef(false),p$1=useRef(false),c=useRef(null),m=useTheme(),u=useMemo(()=>Object.keys(wl).filter(w=>!!o[w]),[o]),f=()=>{c.current&&(clearTimeout(c.current),c.current=null);},x=()=>{l(a.current);},I=()=>{s.current=true,p$1.current=false,r(true),l(null),f(),c.current=setTimeout(()=>{p$1.current=true,x();},OS);};useEffect(()=>()=>f(),[]);let b=()=>{s.current||I();},S=()=>{f(),a.current=null,s.current=false,p$1.current=false,l(null),r(false);},d=w=>{if(a.current=w,p$1.current){f(),l(w);return}s.current||I();},C=()=>{a.current=null,p$1.current&&(f(),c.current=setTimeout(x,_S));},y=u.length;return jsx(v,{...o,children:jsx(ef,{children:y>0?jsx(of,{layout:true,className:"reference-sources-container",whileHover:"animate",onHoverStart:b,onHoverEnd:S,animate:n?"animate":"start",sourcesCount:y,variants:{animate:{width:y*38}},style:{zIndex:29},children:u.map((w,T)=>{let h=t?.(w)||`${sf(w)} - ${o[w]}`,A=i===w;return jsx(mt,{order:T,variants:af(T,m.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},onMouseEnter:()=>d(w),onMouseLeave:C,children:jsx(p,{open:A,disableHoverListener:true,disableInteractive:true,title:A?h:"",children:e?jsx(rf,{children:jsx(nf,{children:sf(w)})}):jsx(tf,{src:wl[w],alt:w,sx:{...w==="order"&&{width:"11.82px"}}})})},`${w}-${T}`)})}):null})})}var $S=zS;var vl={Y:{tooltip:"Authenticated",icon:kh$1,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Vg$1,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Vg$1,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:ah$1,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Vg$1,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:bh$1,borderColor:"#F2F2F2"}},Al={"3DS":{tooltip:"3DS",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Qj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled("img")(()=>({width:"12.67px",height:"15px"}));var cf=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),mf=styled("img")({width:"16px",height:"16px"});styled("div")(({theme:e})=>({borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(.516),fontSize:"10px",fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),lineHeight:0}));var df=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"})),uf=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"},...e>0&&{opacity:0}},animate:{x:o?e*o:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},boxShadow:t,...e>0&&{opacity:1}}}),ff=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function GS({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),l=useMemo(()=>{let p=vl[e??"noAuth"]??vl.noAuth,c=p?.tooltip,m=p?.icon;return [{tooltip:c,content:t?c:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?Al[n]?.tooltip:Al[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),a=useMemo(()=>l.filter(p=>!!p.content).map((p$1,c)=>{let m=p$1.type==="text"?jsx(ff,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(H,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p$1.content,children:p$1.content})}):jsx(mf,{src:p$1.content,alt:p$1.tooltip});return jsx(p,{title:p$1.tooltip,children:jsx(mt,{order:-1*c,variants:uf(c,i.shadows[4],t?124:39),sx:{...p$1.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p$1.tooltip}-${c}`)}),[r,l,t,i]),s=a.length;return jsx(v,{...r,children:jsx(cf,{children:s>0?jsx(df,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:s,variants:{animate:{width:38}},style:{zIndex:29},children:a}):null})})}var YS=GS;var Pl={checkout:Eh$1,checkoutSuccess:Fh$1};function qS({status:e,...t}){let{t:o}=useTranslation();return jsx(v,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&Pl[e]&&jsx(p,{title:o(wt(e)),children:jsx(U,{src:Pl[e],alt:"checkout-icon"})})})})}var XS=qS;var El={TRANSACTED:Kh,INITIATED:Ih$1,CANCELLED:Jh$1,EXPIRED:Hh$1};function xf({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(v,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&El[e]&&jsx(p,{title:n(wt(e)),children:jsx(U,{src:El[e],alt:"intents-icon"})}),t&&Nt[t]&&jsx(p,{title:n(wt(t)),children:jsx(Xe,{chargeStatus:t})})]})})}var yf=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",paddingInline:e.spacing(.5),paddingBlock:e.spacing(.5),backgroundColor:"#eeeeee",borderRadius:"56px",height:"24px",fontSize:"10px",color:e.palette.text.primary,zIndex:24,overflow:"visible",position:"absolute",gap:"0px"})),If=styled(motion.div)(({theme:e,percentage:t})=>({border:`0.6px ${[0,100].includes(t)?"solid":"dashed"} #656565`,borderRadius:"80px",padding:e.spacing(.316),paddingLeft:e.spacing(1),fontSize:"7px",fontWeight:e.typography.fontWeightBold,color:"#656565",display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(.5),minWidth:"44px"}));styled("div")(({percentage:e,isCapture:t,theme:o})=>({background:`conic-gradient(${t?o.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?o.palette.info.dark:"#656565"}`}));function bf(e){return e<5?5:e===100?95:e}var Ti={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function tT({percentage:e,date:t,payoutStatus:o,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:l,...a}){let{t:s}=useTranslation(),p$1=useTheme();return e===0?null:jsx(v,{...a,style:{overflow:"visible",position:"relative"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:[jsx(p,{title:r,children:jsxs(yf,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...l&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(If,{percentage:e,sx:{backgroundColor:"#eeeeee",...l&&{backgroundColor:"transparent",border:"none"}},variants:{...!l&&{animate:{boxShadow:p$1.shadows[4]}}},children:l?jsxs(H,{children:[e,"%"]}):jsxs(Fragment,{children:[e," % ",jsx(Or,{percentage:bf(e)})]})}),i>1&&jsx(motion.div,{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px"},children:jsx(motion.div,{style:{alignItems:"center",justifyContent:"center",gap:"4px",position:"relative",zIndex:22,overflow:"visible"},initial:{width:0,opacity:0,paddingRight:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",paddingRight:"4px",boxShadow:p$1.shadows[4]},fadeIn:{transition:{delay:.5},opacity:1}},children:jsxs(z,{compact:true,color:"neutral",children:[i,"x"]})})})]})}),jsx(Ie,{className:"payout-status",style:{visibility:o==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:l?"auto":"24px"},children:o&&e$1[o]&&jsx(p,{title:n||s(wt(o)),children:l?jsx(H,{sx:{color:Ti[o].color,border:`1px solid ${Ti[o].color}1a`,backgroundColor:Ti[o].backgroundColor},children:s(wt(o))}):jsx(U,{src:e$1[o],alt:"settled-icon"})})})]})})}var oT=tT;var wf={DELETED:kf,DRAFT:lf,CREATED:mf$1,CANCELLED:Aa,CANCELED:Aa,EXPIRED:Ba,PAID:pf,REFUNDED:vf$1,DELIVERED:qf$1,VIEWED:rf$1,SAVED:sf$1,SCHEDULED:tf$1,PENDING:uf$1,REMINDED:""};styled(motion.div)(({theme:e,background:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5),paddingInline:e.spacing(.75),paddingBlock:e.spacing(.5),backgroundColor:t,height:"24px",width:"fit-content",borderRadius:"24px",fontSize:"10px",color:e.palette.text.primary}));var Dl=styled("img")(()=>({height:"13.125px",width:"12px"})),wi=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),vf=styled("div")(({theme:e})=>({color:e.palette.common.white,background:e.palette.error.main,fontSize:"0.6rem",fontWeight:600,borderRadius:"16px",padding:"2px 8px",display:"flex",alignItems:"center",justifyContent:"center"})),Af=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));function Pf(e){switch(e){case "CANCELLED":case "DELETED":return {color:"#FF3D00",background:"#FFF5F2"};case "VIEWED":return {color:"#1F88D0",background:"#e1edf8"};case "REFUNDED":return {color:"#4E1FD0",background:"#ede8fb"};case "PAID":return {color:"#2ACE00",background:"#EAFAE5"};case "EXPIRED":return {color:"#FF7A00",background:"#FFF2E5"};case void 0:return {color:"#FF7A00",background:"transparent"};default:return {color:"#818181",background:"#F2F2F2"}}}function Ef({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),l=e?b$d[e]:null,a=e&&a$6[e]&&jsx(Af,{style:r,children:jsx(U,{src:a$6[e],alt:"charge-icon",style:{width:"16px",height:"16px",...n}})}),s=t&&jsx(Fragment,{children:jsx("div",{children:t})});return e?jsx(p,{title:s??i(wt(e)),children:jsxs(Yn,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[a,!!Pn?.includes(e||"")&&jsx(vf,{style:{background:l?.color},children:o})]})}):null}function Mf({status:e,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:l=0,...a}){let{t:s}=useTranslation(),p$1=useTheme(),c=e?wf[e]:null,m=Pf(e),u=`${s(e?.toLowerCase()||"")} ${hn($u(t).valueOf())}`,f=useMemo(()=>jsx(Ef,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),x=useMemo(()=>jsx(p,{title:s("reminded"),children:jsxs(Yn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(Dl,{sx:{width:"14px",height:"14px"},src:le$1,alt:"icon"}),jsx(z,{style:{background:p$1.palette.error.main,fontWeight:600,color:p$1.palette.common.white},children:l})]})}),[l]),I=useMemo(()=>{if(c)return jsx(p,{title:s(u||""),children:jsx(Dl,{src:c,alt:"status icon"})});if(n&&Nt[n])return f;if(l)return x},[c,n,l]);return !e&&!n&&!l?null:jsx(v,{...a,sx:{position:"relative",overflow:"visible"},children:jsx(a$1,{sx:{justifyContent:"flex-start"},expandableCenterRight:o&&e==="VIEWED"&&c?[jsx(z,{style:{marginRight:"8px",color:"#fff",backgroundColor:m.color},children:o})]:void 0,centerIcon:I,leftIcons:l&&c?[x]:void 0,rightIcons:n&&Nt[n]&&c?[f]:void 0})})}function gT({tooltip:e,children:t,badge:o,...n}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(p,{title:e,children:jsx(ct,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(H,{"data-testid":"BadgeCell_TextLabel",sx:{minWidth:"max-content",gap:"0.5rem"},children:[t,(o||0)>1&&jsxs(z,{color:"dark",style:{fontWeight:"bold"},children:["+",o]})]})})}):null})}var CT=gT;var kl={ACTIVE:ii$1,EXPIRED:hi,PENDING:ii$1,SAVED:fi,TRANSACTED:gi,CONSUMED:gi};var xT=(u=>(u.ABANDONED="ABANDONED",u.IN_PROGRESS="IN_PROGRESS",u.VOID="VOID",u.CANCELLED="CANCELLED",u.CAPTURED="CAPTURED",u.INITIATED="INITIATED",u.FAILED="FAILED",u.DECLINED="DECLINED",u.RESTRICTED="RESTRICTED",u.TIMEDOUT="TIMEDOUT",u.UNKNOWN="UNKNOWN",u.AUTHORIZED="AUTHORIZED",u))(xT||{});function yT({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n,errorCode:r,cardId:i,hasChargeIcon:l,hasAuthorizedIcon:a,...s}){let{t:p$1}=useTranslation();return jsx(v,{...s,sx:{position:"relative",overflow:"visible"},children:jsxs(we,{sx:{gap:"0.5rem"},children:[e&&kl[e]&&jsx(p,{title:p$1(wt(e)),children:jsx(U,{src:kl[e],alt:"token-icon"})}),i&&jsx(p,{title:p$1(wt(e)),children:jsx(U,{src:ji,alt:"card-icon"})}),l&&jsx(p,{title:p$1(wt("CAPTURED")),children:jsx(Xe,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n,errorCode:r})}),a&&jsx(p,{title:p$1(wt("AUTHORIZED")),children:jsx(U,{src:f$2.AUTHORIZED,alt:"authorized-icon"})})]})})}var IT=yT;var Vl=styled("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),Lf=styled("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),Rf=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function ST({brandName:e,brandIcon:t,...o}){return jsx(v,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(Rf,{children:[jsx(Lf,{children:t?jsx(p,{title:e,children:jsx(Vl,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=Bi$1;}})}):jsx(Vl,{src:Bi$1,alt:"brand icon"})}),jsx("span",{children:e})]})})}var TT=ST;function Bf({metadata:e}){let t=Object.keys(e)[0]??"",o=Object.keys(e)[1]??"",n=Object.keys(e)[2]??"",r=Object.keys(e)[3]??"",i=Object.keys(e)[4]??"",l=t||o||n||r||i?`${e[t]?`${e[t]}${e[o]||e[n]||e[r]||e[i]?",":""}`:""}${e[o]?`${e[o]}${e[n]||e[r]||e[i]?",":""}`:""}${e[n]?`${e[n]}${e[r]||e[i]?",":""}`:""}${e[r]?`${e[r]}${e[i]?",":""}`:""}${e[i]??""}`:"";return l?jsx(p,{title:l,children:jsx(Box,{component:"img",src:$j,alt:"meta",sx:{cursor:"pointer"}})}):null}var Vf=styled$1(motion.img,{shouldForwardProp:e=>e!=="width"&&e!=="height"})(({width:e,height:t})=>({width:e||"16px",height:t||"16px"}));var MT=({width:e,height:t,sx:o}={})=>{let n=Bc(useId(),"animated-spinner-icon");return jsx(Vf,{id:n,"data-testid":"AnimatedSpinnerIcon",src:hc,alt:"Loading",className:"spinner-loader",width:e,height:t,sx:o,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}})},Nf=MT;var Wf=Nf;var Hf=styled$1("span")(({theme:e})=>({border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",minWidth:"36px",cursor:"pointer"})),Of=styled$1(motion.img)(()=>({width:"16px",height:"16px"}));var kT=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),l=useMemo(()=>r?kc:o?jc:Zj,[r,o]);return jsx(p,{title:t?"":"Pending",children:jsx(Hf,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(Wf,{},"spinner"):jsx(Of,{src:t?l:_j,alt:"Download Report"})})})})};var VT=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(p,{title:`Receipt - ${e}`,children:jsx(H,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:rc,alt:"receipt"})})})});var NT=({receiptId:e})=>jsx(Hr,{children:jsx("span",{children:e})});var WT=({receiptId:e})=>jsx(yi,{children:jsx("span",{children:e})});var Uf=styled("div",{shouldForwardProp:e=>!["licenseNumber","hasClick"].includes(e)})(({theme:e,licenseNumber:t,hasClick:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:o?"pointer":"default",...t&&{padding:"3.5px 8px"}})),Gf=styled(Yn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled("img")(()=>({width:"16px",height:"11.73px"}));var Yf=styled("div",{shouldForwardProp:e=>!["licenseNumber"].includes(e)})(({theme:e,licenseNumber:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:"0",width:"74px",...!t&&{color:"#B1B1B1",width:"84px"}})),jf=styled("img")(()=>({width:"10.5px",height:"10.5px"})),Kf=styled("div")({marginLeft:"auto",width:"auto"});var qf={incomplete:Ij,complete:Hj,reviewed:Hj,verified:Jj};function Xf({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let l=qf[o??"incomplete"];return jsx(v,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(p,{title:e,children:jsx(Uf,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(Gf,{children:[jsx(p,{title:t?Na(t):"",children:jsx(b$2,{countryCode:t})}),jsx(Yf,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(Kf,{children:jsx(jf,{src:l})})]})})})})}function Jf({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(v,{...o,children:jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:t&&jsxs(Fragment,{children:[jsx(Box,{sx:{width:"24px",height:"24px",border:"1px solid #F2F2F2",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e??jsx("img",{src:Tb$1,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Qf={incomplete:Ij,complete:Hj,reviewed:Hj,verified:Jj};var eg=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1.029px solid #F2F2F2",borderRadius:"44px",padding:"4px 8px",lineHeight:"120%"})),tg=styled("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),og=styled("img")(()=>({width:"10.5px",height:"10.5px"})),ng=styled("span")(({theme:e})=>({fontSize:"9.5px",fontWeight:400,color:e.palette.common.white,backgroundColor:e.palette.grey[700],borderRadius:"4px",padding:"1px 2px"})),rg=styled("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),ig=styled("div")({display:"flex",alignItems:"center",gap:"8px"}),ag=styled("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function lg({id:e,status:t,count:o,name:n,...r}){let i=Qf[t??"incomplete"];return jsx(v,{...r,sx:{cursor:"pointer"},children:jsx(p,{title:n,children:jsx(eg,{children:e?jsxs(rg,{children:[jsx(tg,{children:e}),jsxs(ig,{children:[jsx(og,{src:i}),o>1&&jsx("div",{children:jsxs(ng,{children:["+",o-1]})})]})]}):jsx(ag,{children:"Not Available"})})})})}var sg=styled("div",{shouldForwardProp:e=>!["hasClick"].includes(e)})(({theme:e,hasClick:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1px solid #F2F2F2",borderRadius:"44px",padding:"3.5px 5px",height:"24px",cursor:t?"pointer":"default"})),pg=styled(Yn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),cg=styled("p",{shouldForwardProp:e=>!["brandName"].includes(e)})(({theme:e,brandName:t})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"74px",margin:"0",...!t&&{color:"#B1B1B1",width:"84px"}})),mg=styled("img")(()=>({width:"10.5px",height:"10.5px"})),dg=styled("div")({marginLeft:"auto",width:"auto"});var ug={incomplete:Ij,complete:Hj,reviewed:Hj,verified:Jj};function fg({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=ug[t??"incomplete"];return jsx(v,{...r,children:jsx(p,{title:e.name,children:jsx(sg,{hasClick:!!r.onClick,children:jsxs(pg,{children:[n,jsx(cg,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx(dg,{children:jsx(mg,{src:i})})]})})})})}var gg=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Cg=styled("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),xg=styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"default",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"}));styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));var hg=(e,t,o)=>({start:{x:e*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t?e*t:e*39,transition:{duration:.3,type:"tween",ease:"easeOut"},...o&&{boxShadow:"7px 0px 8px 0px #F2F2F2"}}}),yg=styled(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var jT=e=>!e.startsWith("http://")&&!e.startsWith("https://"),Pi=e=>/^https?:\/\//i.test(e),Ig=(e,t)=>{switch(t){case "website":return e;case "physical_store":case "call_center":return null;case "linkedin":case "instagram":case "twitter":case "social_media":return KT(e,t);case "ios":case "android":case "mobile_app":return qT(e,t);default:return e}},KT=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:Pi(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:Pi(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:Pi(e)?null:`https://x.com/${e}`:null},qT=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?Pi(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,bg=e=>{!e||typeof e!="string"||window.open(jT(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function XT({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let l=r.address,a=r.code?.replace(/_/g,""),s=i===e?.length-1,p$1=Ig(r.address??"",r.code??"");return jsx(p,{title:l,children:jsx(mt,{order:i,variants:hg(i,0,s),sx:{width:"36px",cursor:p$1?"pointer":"default"},onClick:()=>{r?.address&&bg(p$1);},children:jsx(Cg,{src:r.logo,alt:a})})},`${r}-${i}`)}),n=o?.length||0;return jsx(v,{...t,children:jsx(gg,{children:o?.length>0?jsx(xg,{layout:true,className:"sales-channels-container",whileHover:"animate",animate:"start",sourcesCount:n||0,variants:{animate:{width:(n||0)*38}},style:{zIndex:29},children:o}):null})})}var ZT=XT;function ow({channels:e}){let t=useRef(null),[o,n]=useState(false),[r,i]=useState(null),l=!!r;useEffect(()=>{t.current&&n(t.current.scrollHeight>20);},[e]);let a=useMemo(()=>(e||[]).filter(s=>!!s.address),[e]);return jsxs(yg,{children:[jsx(Yn,{sx:{display:"flex",flexWrap:"wrap",gap:o?"8px":"4px"},ref:t,children:a.map(s=>jsxs(b$1,{copyTrigger:"press",copyText:s.address,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px","& div":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"367px"}},children:[s.name?.en,": ",s.address]},s.id))}),o&&jsx(Yn,{onClick:s=>{i(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(tw,{open:l,anchorEl:r,sx:{minWidth:r?.clientWidth},onClose:()=>{i(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:r?.clientWidth,marginTop:"22px"}}},children:jsx(Yn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:a.map(s=>jsxs(b$1,{copyTrigger:"press",copyText:s.address,children:[s.name?.en,": ",s.address]},s.id))})})]})}var nw=ow;var Tg={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function aw({type:e,count:t,sx:o,...n}){let{t:r}=useTranslation(),i=t?.toString();return jsxs(Yn,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$1,{copyTrigger:"press",copyText:e,unknownText:r("noPaymentAgreement"),sx:o,...n,children:e&&Tg[e]}),i&&jsx(b$1,{copyTrigger:"press",copyText:i,sx:{minWidth:"38px"},...n,children:i})]})}var lw=aw;var vg={CYBERSOURCE:sm,MPGS:tm,NETCETERA:um,APPLEPAY:vm,TAP3DS:wm,FSS:Cm,BENEFIT:ym,QPAY:Km,POSTPAY:Jm,BENEFITPAY:xm,MEEZA:Em,STC_PAY:Mm,NGENIUS:Fm,KNET:Dm,PAYPAL:Im,FAWRY:Bm,TPG:Qm,DEEMA:Am,TPAY:Pm,"CAREEM PAY":zm,TABBY:Nm,OMANNET:Hm,NPG:Gm,SPG:Lm,TAMARA:Om};var Pg=styled(Yn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"24px",gap:"8px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper})),Eg=styled("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function Mg({provider:e,...t}){let o=vg[e];return o?jsx(Pg,{children:jsx(Eg,{src:o,alt:e})}):jsx(v,{...t,children:jsx(H,{children:e})})}var Dg={CHARGE:Wk,AUTHORIZE:Ak,SAVE_TOKEN:_g$1},Lg={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},Rg={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var kg=styled(Yn,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=Rg[e];return {display:"flex",alignItems:"center",justifyContent:"start",gap:"4px",minWidth:"86px",width:"100%",height:"24px",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${t.border}`,backgroundColor:t.backgroundColor,color:t.color,fontSize:"12px",fontWeight:400}}),Bg=styled("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),Vg=styled("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function Wg({purpose:e,...t}){let o=Dg[e],n=Lg[e];return jsxs(kg,{purposeType:e,...t,children:[jsx(Bg,{src:o,alt:e}),jsx(Vg,{children:n})]})}var Hg=8,dw=16,yt=Hg*2+dw,Og=100,_g=6,uw=yt+_g+Og,zg=styled$1(v)(()=>({position:"relative",overflow:"visible",width:yt,minWidth:yt,maxWidth:yt,display:"inline-flex",padding:0})),$g=styled$1(Yn)(()=>({position:"relative",width:yt,height:24,flexShrink:0,overflow:"visible"})),Ug=styled$1(Yn,{shouldForwardProp:e=>e!=="hasLabel"})(({theme:e,hasLabel:t})=>({position:"absolute",top:0,left:0,width:yt,minWidth:yt,maxWidth:yt,height:24,display:"inline-flex",alignItems:"center",gap:_g,paddingInline:Hg,borderRadius:"24px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.background.paper,boxSizing:"border-box",cursor:"pointer",overflow:"hidden",transition:e.transitions.create(["max-width","box-shadow"]),"& img":{flexShrink:0},...t&&{"&:hover":{width:"max-content",maxWidth:uw,zIndex:100,boxShadow:"0px 0px 16px 0px #00000021","& .link-cell-label":{maxWidth:Og,opacity:1}}}})),Gg=styled$1("span")(({theme:e})=>({display:"inline-block",maxWidth:0,opacity:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:12,lineHeight:"16px",color:e.palette.text.primary,transition:e.transitions.create(["max-width","opacity"],{duration:e.transitions.duration.shorter})}));function gw({url:e,label:t}){let o=n(),n$1=()=>{try{db(e),o.success("Copied!");}catch{o.error("Failed to copy");}};return e?jsx(zg,{children:jsx($g,{children:jsxs(Ug,{hasLabel:!!t,onClick:n$1,children:[jsx(d,{src:Kl$1,alt:"link"}),t&&jsx(Gg,{className:"link-cell-label",children:t})]})})}):null}var Cw=memo(gw);function n3({items:e}){let[t,o]=useState(null),n=!!t,r=useCallback(({quantity:a,currency:s,amount:p,name:c})=>`${a?`Qty ${a}`:""} ${c?`- ${c}`:""} ${s||p?"-":""} ${s||""} ${p||""}`,[]);if(!e||!e.length)return null;let[i,...l]=e;return jsxs(Yn,{sx:{display:"flex",gap:"4px",alignItems:"center"},children:[jsx(b$1,{children:jsx(j,{noWrap:true,sx:{maxWidth:e.length>1?190:220,fontSize:11},children:r(i)})}),e.length>1&&jsx(Yn,{onClick:a=>{o(a.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(tw,{open:n,anchorEl:t,sx:{minWidth:t?.clientWidth},onClose:()=>{o(null);},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{style:{maxWidth:"unset",minWidth:t?.clientWidth,marginTop:"22px"}}},children:jsx(Yn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:l?.map(a=>jsx(b$1,{copyTrigger:"press",copyText:r(a),children:r(a)},a.id))})})]})}var Yg="ListHeader";var jg=styled(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),Kg=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%",marginBottom:e.spacing(2.25),marginTop:e.spacing(2)})),qg=styled(j)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.v2.typography.fontWeightMedium,lineHeight:"120%"})),Xg=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),Zg=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),Jg=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function Li({children:e,component:t="header",...o}){return jsx(jg,{component:t,...o,children:e})}function Ri({title:e,toolbar:t}){return jsxs(Kg,{children:[jsx("span",{children:!!e&&jsx(qg,{children:e})}),t]})}function ki({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(Zg,{as:"aside",children:[o,jsx(a$5,{status:e?.value,availableStatuses:e?.options,onStatusChange:e?.onChange,isActiveFilterVisible:n,buttonSx:e?.buttonSx}),jsx(d$3,{value:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,onDismiss:t?.onDismiss})]})}var Ao=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:"4px",background:e.palette.common.white,padding:"8px",border:"1px solid",borderColor:e.palette.divider,gap:8,height:32,cursor:"pointer","&:hover":{border:"1px solid",borderColor:e.palette.info.dark,boxShadow:e.shadows[7]}})),Bi=styled(Box)(({theme:e})=>({background:e.palette.common.white,display:"flex",gap:e.spacing(1),alignItems:"center",color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,textTransform:"capitalize",position:"relative",transition:"0.5s",paddingRight:0,marginRight:0,"&:after":{content:'""',position:"absolute",left:-8,right:0,width:"100%",height:"100%",boxShadow:e.shadows[11],borderRadius:e.spacing(.5),paddingInlineStart:e.spacing(1),paddingTop:"9px",paddingBottom:"9px",paddingInlineEnd:"9px",zIndex:-1},"& > *:last-child":{marginRight:0,paddingRight:"6px"}})),Po=styled(Box)(({theme:e})=>({background:e.palette.common.white,borderRadius:e.spacing(1),boxShadow:e.shadows[5],border:"1px solid",borderColor:e.palette.divider,zIndex:5,fontSize:"11px",width:192})),Eo=styled(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),Mo=styled(Box,{shouldForwardProp:e=>e!=="addColumnViewEl"})(({theme:e})=>({padding:e.spacing(1),paddingInlineEnd:2,borderBottom:"1px solid",borderColor:e.palette.divider,display:"flex",alignItems:"center",height:32,cursor:"pointer",img:{height:12},".check-icon":{height:"auto",marginInlineEnd:e.spacing(1)},"&:hover":{color:e.palette.info.dark,fontWeight:e.typography.fontWeightBold},"&.add-column":{justifyContent:"space-between",paddingInlineEnd:e.spacing(1),position:"relative",border:"none",zIndex:5,borderBottom:"1px solid",borderColor:e.palette.divider,borderTopRightRadius:e.spacing(1),borderTopLeftRadius:e.spacing(1),"&:hover":{boxShadow:e.shadows[6]}}})),Do=styled(Box)(()=>({width:15})),Mn=styled(Box)(()=>({width:16})),oC=styled(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),nC=styled(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),rC=styled(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),iC=styled(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),aC=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:e.palette.grey[50],cursor:"pointer","&:hover":{backgroundColor:e.palette.grey[100]}})),lC=styled(Box,{shouldForwardProp:e=>e!=="isHovered"&&e!=="isDate"})(({theme:e,isHovered:t,isDate:o})=>({display:"flex",alignItems:"center",padding:"12px",borderBottom:"1px solid",borderColor:e.palette.divider,backgroundColor:t?e.palette.action.hover:e.palette.background.paper,cursor:o?"default":"grab","&:hover":{backgroundColor:o?e.palette.background.paper:e.palette.action.hover},"&:last-child":{borderBottom:"none"}})),_l=styled(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),zl=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),sC=styled(Box)(({theme:e})=>({position:"absolute",bottom:0,left:0,right:0,height:35,borderTop:"1px solid",borderColor:e.palette.divider,background:"#F6F8FACC",backdropFilter:"blur(24px)"})),pC=styled(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),Vi=styled(Paper)(()=>({paddingTop:4,paddingBottom:4,minWidth:180,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",borderRadius:"8px"}));styled(Box)(()=>({display:"flex",alignItems:"center",padding:"8px 12px",cursor:"pointer"}));var cC=styled(Button)(({theme:e})=>({color:e.palette.error.main,textTransform:"none",fontSize:10,fontWeight:500,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,"&:hover":{backgroundColor:"transparent"}})),mC=styled(Button)(({theme:e})=>({fontSize:9,fontWeight:600,borderRadius:4,paddingLeft:20,paddingRight:20,paddingTop:8,paddingBottom:8,height:28,textTransform:"none",backgroundColor:e.palette.info.dark,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{backgroundColor:e.palette.grey[300],color:e.palette.grey[500]}}));styled(TextField)(({theme:e})=>({"& .MuiFilledInput-root":{borderRadius:"8px",backgroundColor:e.palette.background.paper,border:"1px solid",borderColor:e.palette.divider,"&:hover":{backgroundColor:e.palette.background.paper},"&.Mui-focused":{backgroundColor:e.palette.background.paper},"&::before, &::after":{display:"none"}}}));var $l={display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0,"& .MuiSvgIcon-root":{width:16,height:16},"& img":{width:14,height:14}},dC=styled(motion.div)(({theme:e})=>({position:"fixed",display:"flex",flexDirection:"column",maxHeight:"calc(100vh - 46px)",backgroundColor:e.palette.background.paper,boxShadow:"0px 8px 32px rgba(0, 0, 0, 0.15)",borderRadius:12,overflow:"hidden",boxSizing:"border-box"})),uC=styled(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),paddingTop:e.spacing(1),paddingBottom:e.spacing(1),cursor:"pointer","&:hover":{backgroundColor:e.palette.action.hover}})),fC={p:0,width:14,height:14,minWidth:14,minHeight:14,"& .MuiSvgIcon-root":{width:16,height:16}},gC=styled(Box)(()=>({minWidth:200,display:"flex",flexDirection:"column",maxHeight:"80vh",overflow:"hidden"})),CC=styled(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:6,paddingRight:6,minHeight:0})),xC=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-end",gap:12,paddingTop:8,paddingBottom:8,paddingLeft:12,paddingRight:12,flexShrink:0,borderTop:"1px solid",borderColor:e.palette.divider})),hC={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},yC=e=>({fontSize:11,fontWeight:500,textTransform:"none",backgroundColor:"info.dark",minWidth:80,height:38,borderRadius:"8px",boxShadow:"none","&:hover":{backgroundColor:e.palette.info.dark}});function Gl(e,t){let[o,n]=useState(null),[r,i]=useState(null),l=useCallback(()=>{n(null),i(null);},[]),a=useCallback((p,c)=>{n(p.currentTarget),i(c);},[]),s=useCallback(()=>{r&&l();},[r,l]);return useEffect(()=>{e||(l(),t?.());},[e,t,l]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:l,handleSubMenuOpen:a,handleMenuScroll:s}}function Lw(e){let t=e;for(;t&&t!==document.body;){let n=window.getComputedStyle(t).overflowY;if((n==="auto"||n==="scroll")&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement;}return document.documentElement}function Yl(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),l=useRef(0),a=useRef(false),s=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((x,I)=>{a.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:x,clientY:I+l.current,pointerType:"mouse",isPrimary:true})),a.current=false;},[]),c=useCallback(()=>{if(o.current!==null)return;let x=()=>{let I=i.current;if(!t.current||!I)return;let b=I.getBoundingClientRect(),{x:S,y:d}=n.current,C=d-b.top,y=b.bottom-d;if(C>0&&C<60){let w=(60-C)/60*15;I.scrollTop-=w,l.current-=w,p(S,d);}else if(y>0&&y<60){let w=(60-y)/60*15;I.scrollTop+=w,l.current+=w,p(S,d);}o.current=requestAnimationFrame(x);};o.current=requestAnimationFrame(x);},[p]),m=useCallback(x=>{a.current||(n.current={x:x.clientX,y:x.clientY},r.current=x.pointerId,t.current&&l.current!==0&&(x.stopImmediatePropagation(),p(x.clientX,x.clientY)));},[p]),u=useCallback(()=>{i.current=Lw(e.current),l.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),c();},[e,m,c]),f=useCallback(()=>{t.current=false,l.current=0,s(),window.removeEventListener("pointermove",m,{capture:true});},[m,s]);return useEffect(()=>()=>{t.current=false,s(),window.removeEventListener("pointermove",m,{capture:true});},[m,s]),{onDragStart:u,onDragEnd:f}}function Kl({columns:e,setTableViews:t}){let o=useCallback(i=>{let l=i.map(a=>e.find(s=>s.name===a)).filter(a=>!!a);t?.(l);},[e,t]),n=useCallback(i=>{let l=e.map(a=>{if(a.name!==i)return a;let s=a.menuItems&&a.menuItems.length>0,p=!a.selected;if(!s)return {...a,selected:p};let c=a.menuItems?.map(m=>({...m,selected:p}));return {...a,selected:p,menuItems:c}});t?.(l);},[e,t]),r=useCallback((i,l)=>{let a=e.map(s=>{if(s.name!==i)return s;let p=s.menuItems?.map(m=>m.name===l?{...m,selected:!m.selected}:m),c=p?.some(m=>m.selected)??false;return {...s,menuItems:p,selected:c}});t?.(a);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function Xl({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let l=e.menuItems&&e.menuItems.length>0,a=o===e.name,s=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(f=>f.selected)&&!e.menuItems?.every(f=>f.selected)),[e.selected,e.menuItems]),c=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(f=>{l&&r(f,e.name);},[l,r,e.name]),u=useCallback(()=>{l||i();},[l,i]);return {isIndeterminate:p,hasSubmenuItems:l,isSubmenuOpen:a,isFirstItem:s,handleColumnClick:c,handleMouseEnter:m,handleMouseLeave:u}}var W=(e="")=>e.toLowerCase()==="date",Le=(e="")=>e.toLowerCase()==="index",Ni=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(a=>a.lang===t)?.text||r.name[0]?.text||r.code,l=r.fields?.length?r.fields.map(a=>({name:a.code,label:a.name?.find(s=>s.lang===t||s.lang==="")?.text||a.code,selected:a.default??false})):void 0;o.push({name:r.code,label:i,selected:W(r.code)?true:r.default??false,menuItems:l?.length?l:void 0});});}),o},kw=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?Ni([n]):[]},Zl=(e,t,o="en")=>{let n=e.map((i,l)=>{let a=i.menuItems?.map(p=>({code:p.name,name:[{text:typeof p.label=="string"?p.label:p.name,lang:o||""}],default:p.selected??false})),s=typeof i.label=="string"?i.label:i.name;return {code:i.name,name:[{text:s,lang:o}],order:l+1,default:i.selected??false,...a?.length?{fields:a}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},Bw=e=>{let t=new Map;return e.forEach(o=>{o.layout.forEach(n=>{let r=t.get(n.code);if(r){let i=new Set(r.columns.map(l=>l.code));n.columns.forEach(l=>{i.has(l.code)||r.columns.push(l);});}else t.set(n.code,{...n,columns:[...n.columns]});});}),Array.from(t.values())};var Vw=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),Nw=(e,t)=>e.map(o=>({...o,default:o.id===t})),Wi=e=>e.role??(e.default?"default":void 0),_t=e=>!!e.role||!!e.default,Re=e=>!_t(e),bC=e=>Re(e),Ln=e=>e.filter(bC).length,Jl=e=>e.filter(Re).length,Fi=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(a=>{let s=t==="sheet"?"sheet":"advanced",p=a.layout.find(T=>T.code.toLowerCase()===s),c=p?Ni([p],o):[],m=a.id,u=xb$1,f=yb$1,x=c.some(T=>W(T.name))?c:[f,...c],I=x.findIndex(T=>W(T.name)),S=(I>0?[x[I],...x.filter(T=>!W(T.name))]:x).filter(T=>!Le(T.name)),d=[u,...S],C=Wi(a),y=_t(a),w={id:m,label:a.name,role:C,isCustom:!y,selected:a.selected,default:!!a.default,columns:d.map(T=>T.name),submenu:d};y?(a.default&&!i&&(i=d),r.push(w)):n.push(w);});let l=r.find(a=>a.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:l}},Ql=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=Fi(e,t,o),l=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:l}},Hi=(e,t)=>{let o=[];Re(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=xb$1;if(!o.some(m=>W(m.name)))return [n,yb$1,...o];let i=o.findIndex(m=>W(m.name)),l=i>=0?o[i]:yb$1,a=o.filter(m=>!W(m.name)&&!Le(m.name)),s=[l,...a],p=s.some(m=>Le(m.name)),c=s.findIndex(m=>Le(m.name));if(p&&c>0){let m=s[c],u=s.filter(f=>!Le(f.name));return [m,...u]}return p&&c===0?s:[n,...s]},Ww=(e,t)=>Hi(e,t).length>0,Ro=e=>e.filter(t=>!Le(t.name));var be=e=>e.toLowerCase(),SC=e=>new Map(e.filter(t=>!W(t.name)).map(t=>[be(t.name),t])),TC=(e,t)=>e.some(o=>be(o)===be(t)),es=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>be(r.name)===be(o.name));return {...o,selected:n?.selected??false}})}),Rn=e=>{if(!e.menuItems?.length)return {checked:e.selected??false,indeterminate:false};let t=e.menuItems.filter(o=>o.selected).length;return {checked:t>0,indeterminate:t>0&&t<e.menuItems.length}},os=(e,t)=>e.map(o=>{if(o.name!==t)return o;let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),kn=(e,t,o)=>e.map(n=>{if(n.name!==t)return n;let r=n.menuItems?.map(l=>l.name===o?{...l,selected:!l.selected}:l),i=r?.some(l=>l.selected)??false;return {...n,menuItems:r,selected:i}}),ns=(e,t)=>e.map(o=>{if(W(o.name))return o;let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),rs=e=>{let t=e.filter(o=>!W(o.name));return t.length===0?false:t.every(o=>o.menuItems?.length?o.menuItems.every(n=>n.selected):o.selected)},is=(e,t)=>e.filter(r=>!W(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,as=(e,t)=>e.trim().length>0&&e.length<=t,le=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),ls=(e,t)=>e.map(o=>{if(o.name!==t)return o;if(W(o.name))return {...o,selected:true};let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),ss=(e,t)=>e.map(o=>{if(W(o.name))return {...o,selected:true};let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),ps=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),cs=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,ts=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Bn=(e,t)=>{if(e.length!==t.length)return false;let o=ts(e),n=ts(t);for(let r=0;r<o.length;r++){let i=o[r],l=n[r];if(i.name!==l.name||i.selected!==l.selected)return false;if(i.menuItems&&l.menuItems){if(i.menuItems.length!==l.menuItems.length)return false;for(let a=0;a<i.menuItems.length;a++)if(i.menuItems[a].name!==l.menuItems[a].name||i.menuItems[a].selected!==l.menuItems[a].selected)return false}else if(i.menuItems||l.menuItems)return false}return true},Fw=e=>e.filter(t=>!W(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),ms=(e,t)=>{let o=e.filter(i=>!W(i.name)).map(i=>i.name),n=SC(t),r=[];for(let i of o){let l=e.find(s=>be(s.name)===be(i)),a=n.get(be(i));a?r.push(l?es(a,l):{...a,selected:false,menuItems:a.menuItems?.map(s=>({...s,selected:false}))}):l&&r.push(l);}for(let[,i]of n)if(!TC(o,i.name)){let l=e.find(a=>be(a.name)===be(i.name));r.push(l?es(i,l):{...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});}return r},ds=e=>e.filter(t=>!W(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),us=(e,t)=>{let o=SC(e),n=t.filter(i=>!W(i.name)).map(i=>i.name),r=[];for(let i of n){let l=t.find(s=>be(s.name)===be(i)),a=o.get(be(i));a&&l?r.push(es(a,l)):a&&r.push({...a,selected:false,menuItems:a.menuItems?.map(s=>({...s,selected:false}))});}for(let[,i]of o)TC(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(l=>({...l,selected:false}))});return r};function wC(e,t,o="en"){if(!e?.layout?.length)return [];let n=Ya(t)?"sheet":"advanced",r=e.layout.find(a=>a.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(a=>{let s=a.name?.find(c=>c.lang===o)?.text||a.name?.[0]?.text||a.code,p=a.fields?.length?a.fields.map(c=>({name:c.code,label:c.name?.find(m=>m.lang===o||m.lang==="")?.text||c.code,selected:c.default??false})):void 0;return {name:a.code,label:s,selected:W(a.code)?true:a.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(a=>W(a.name))?i:[{name:yb$1.name,label:yb$1.label,selected:true},...i]}var Oi=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function _i(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function Hw(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,l)=>Oi(i)-Oi(l))})),n=wC(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:Wi(e),isCustom:Re(e),default:e.default}}var zi=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=Xa(t)?"Advanced":"Sheet",r=e.layout.find(i=>{let l=i.code?.trim();return l===n||l?.toLowerCase()===n.toLowerCase()})||e.layout.find(i=>{let l=i.code?.trim()?.toLowerCase();return Xa(t)?l==="default"||l==="advanced":l==="sheet"||l==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(l=>{let s=!!l.fields?.length&&l.fields.some(c=>c.default??false),p=(l.default??false)||s;return {code:l.code,name:l.name&&l.name.length>0?l.name:[{text:l.code,lang:"en"}],selected:p,sort_order:Oi(l),fields:l.fields?.map(c=>({code:c.code.toLowerCase(),type:"single",parameters:[{parameter:c.code.toLowerCase(),code:c.code.toLowerCase(),selected:c.default??false}]}))||[{code:l.code.toLowerCase(),type:"single",parameters:[{parameter:l.code.toLowerCase(),code:l.code.toLowerCase(),selected:l.default??false}]}]}}).sort((l,a)=>(l.sort_order??999)-(a.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let l=r.name.toLowerCase(),a;r.menuItems&&r.menuItems.length>0?a=r.menuItems.filter(m=>m.selected):a=[{name:l,label:r.label||r.name,selected:true}];let s=a.length>0?a.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:l,code:l}],p=a.length>1?"combined":"single";return {code:r.name,name:[{text:r.label||r.name,lang:"en"}],selected:r.selected,sort_order:i+1,fields:[{code:l,type:p,parameters:s}]}}):[]},Ow=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?zi(o,t):[]};function fs(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function gs(e,t){let o=t?.name??e?.name??"",n=t?.layout,r=Array.isArray(n)?n[0]:n??null,l=[...e?.layout??[]];if(r){let a=r.code?.toLowerCase(),s=l.findIndex(p=>p.code?.toLowerCase()===a);s>=0?l[s]=r:l.push(r);}return {name:o,layout:l}}var Cs=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var vC=e=>[...Ab$1[e]??Ab$1.default],_w=e=>Bb$1[e]??Bb$1.default,zw=(e,t)=>({code:e,name:[{text:zb$2[e],lang:"en"}],selected:true,sort_order:t}),$w=(e,t)=>e?.layout?.some(o=>vC(t).includes(o.code?.toLowerCase()??""))??false,xs=(e,t,o)=>{let n=Bb$1[t],r=o?.layout?.find(l=>l.code?.toLowerCase()===n.toLowerCase()),i=r?{...r,columns:r.columns?.map(l=>({...l,name:l.name?.map(a=>({...a})),fields:l.fields?.map(a=>({...a,name:a.name?.map(s=>({...s}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var $i=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:l,allTemplates:a}=Ql(t,e,o),p=(n?Fi([n],e,o).defaultTemplate:void 0)??l,c=p?.submenu?structuredClone(p.submenu):[],m=Ln(t);return {customViews:r,defaultTemplates:i,defaultTemplate:l,allTemplates:a,defaultColumns:c,customTemplateCount:m}},[t,e,o,n]);var Ui=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:l,allTemplates:a,customTemplateCount:s})=>{let[p,c]=useState(null),[m,u]=useState(false),[f,x]=useState(null),[I,b]=useState(false),[S,d]=useState(null),[C,y]=useState(null),[w,T]=useState(),[h,A]=useState(a.find(L=>L.selected)?.id??l?.id),P=useRef(a.find(L=>L.selected)?.id??l?.id),M=useCallback(L=>{let V=L.submenu?.filter(J=>J.selected)||[];return {...L,submenu:V,columns:V.map(J=>J.name)}},[]),E=useCallback(L=>{P.current=L?.id,t?.(L?M(L):void 0);},[t,M]),k=useMemo(()=>h?a.find(L=>L.id===h):l,[a,h,l]),N=useMemo(()=>le(k?.submenu||i),[k,i]),F=useMemo(()=>({id:h||l?.id||"default",label:k?.label||l?.label||"Default"}),[k,h,l?.id,l?.label]);useEffect(()=>{let L=a.find(he=>he.selected)?.id,V=l?.id,J=h?a.some(he=>he.id===h):false;if(!(h&&!J&&L!==h)){if(L&&L!==h){A(L);return}if(!h){A(L??V);return}J||A(L??V);}},[a,l?.id,h]),useEffect(()=>{!h||!k||k.id===h&&P.current!==h&&(P.current=h,t?.(M(k)));},[h,k,t,M]);let Z=useCallback(L=>{c(V=>V?null:L.currentTarget);},[]),fe=useCallback(()=>{c(null);},[]),Pe=useCallback((L,V)=>{A(V?.id),E(V),fe();},[fe,E]),xe=useCallback((L=false,V,J,he)=>{s!=null&&s>=3||(x(null),b(L),d(V??null),y(J?.length?J:null),T(he),u(true),c(null));},[s]),_=useCallback(L=>{let V=a.find(J=>J.id===L.id)??L;x(V),b(true),d(null),y(V.submenu?.length?le(V.submenu):null),u(true);},[a]),je=useCallback(()=>{u(false),x(null),b(false),d(null),y(null),T(void 0);},[]);useEffect(()=>{if(!m||!f?.id)return;let L=a.find(V=>V.id===f.id);L&&(x(L),y(L.submenu?.length?le(L.submenu):null));},[m,f?.id,a]);let ga=useCallback(async L=>{if(f){let V=f.id;await n?.(V,L),A(V);let J=a.find(he=>he.id===V)??f;E(J),fe();}else {let V=await o?.({...L,sourceTemplateId:w});if(V?.id){A(V.id);let J=a.find(he=>he.id===V.id);E(J??{id:V.id,label:V.name,isCustom:true,columns:L.selectedColumns.map(he=>he.name),submenu:L.selectedColumns});}}},[f,n,o,fe,a,E,w]),Ca=useCallback(async L=>{let V=a.find(J=>J.id===L);await r?.(V?.id??L),h===(V?.id??L)&&A(l?.id);},[a,r,h,l]);return {anchorEl:p,isCreateDialogOpen:m,editingView:f,selectedViewInfo:F,shouldUseCurrentState:I,selectedView:k,currentViewColumns:N,initialColumnsForCreate:S,availableColumnsForCreate:C,handleViewButtonClick:Z,handleCloseViewDropdown:fe,handleSelectedViewInfo:Pe,handleOpenCreateDialog:xe,handleOpenEditDialog:_,handleCloseCreateDialog:je,handleSaveView:ga,handleDeleteView:Ca}};var ko=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((p,c)=>{r.current&&(clearTimeout(r.current),r.current=null),t(p),n(c);},[]),l=useCallback(()=>{r.current=setTimeout(()=>{t(null),n(null);},0);},[]),a=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]),s=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),t(null),n(null);},[]);return {hoveredColumn:e,anchorEl:o,openSubmenu:i,closeSubmenu:l,cancelClose:a,forceClose:s}};var EC=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((s,p)=>{t(s),n(p);},[]),l=useCallback(()=>{t(null),n(null);},[]),a=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:l,cancelNestedClose:a}};var Ss=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,l]=useState(()=>n?.label||""),[a,s]=useState([]),p=useRef(false),c=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:u,anchorEl:f,openSubmenu:x,closeSubmenu:I,cancelClose:b}=ko(),S=xb$1,d=yb$1;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let F=n.submenu&&n.submenu.length>0?n.submenu:o,Z=t.length>0?t:F,Pe=ms(F,Z).filter(je=>!Le(je.name)&&!W(je.name)),xe=[S,d,...Pe];s(xe),c.current=le(xe);let _=n.label?.trim()||"";m.current=_,l(_);}else {let F=t.length>0?t:r,fe=(r&&r.length>0?us(F,r):ds(F)).filter(xe=>!Le(xe.name)&&!W(xe.name)),Pe=[S,d,...fe];s(Pe),c.current=le(Pe),m.current="",l("");}else if(e&&n){let F=n.label?.trim()||"";l(F);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,S,d]);let C=useMemo(()=>a.map(N=>N.name),[a]),y=useMemo(()=>rs(a),[a]),w=useMemo(()=>is(a,y),[a,y]),T=useMemo(()=>as(i,20),[i]),h=useMemo(()=>{let N=i.trim()!==m.current,F=c.current.length>0&&!Bn(a,c.current);return N||F},[i,a]);return {templateName:i,setTemplateName:l,selectedColumns:a,columnNames:C,allSelected:y,someSelected:w,isNameValid:T,hasChanges:h,hoveredColumn:u,anchorEl:f,openSubmenu:x,closeSubmenu:I,cancelClose:b,handleReorder:N=>{let F=N.filter(Z=>!W(Z)).flatMap(Z=>a.find(fe=>fe.name===Z)??[]);s([S,d,...F]);},handleColumnToggle:N=>{s(F=>os(F,N));},handleSubItemToggle:(N,F)=>{s(Z=>kn(Z,N,F));},handleSelectAll:()=>{s(N=>ns(N,!y));},handleResetToDefault:()=>{c.current.length>0&&s(le(c.current));}}};function ws({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:l,lang:a="en",mainDefaultTemplate:s}){let p=useMemo(()=>s??e.find(d=>d.default),[e,s]),c=e.find(d=>d.selected)?.id??p?.id,m=useCallback(d=>{t(C=>C.find(w=>w.selected)?.id===d?C:C.map(w=>({...w,selected:d?w.id===d:false})));},[t]),u=useCallback(async({name:d,layout:C,sourceTemplateId:y})=>{if(Ln(e)>=3)return;let w=e.find(P=>P.id===y)??e.find(P=>P.id===c)??p,T=xs(C,i,w),h=await o({name:d,layout:T}),A=_i(h);return t(P=>[...P.filter(E=>E.id!==A.id).map(E=>({...E,selected:false})),{...A,selected:true}]),{id:h.id,name:h.name??""}},[o,t,i,p,e,c]),f=useCallback(async d=>{await r(d),t(C=>C.filter(y=>y.id!==d)),m(c===d?p?.id:c);},[r,t,p,m]),x=useCallback(async(d,C)=>{let y=e.find(P=>P.id===d),{name:w,layout:T}=gs(y,C),h=await n(d,{name:w,layout:T}),A=_i(h);t(P=>fs(P,M=>M.id===d,A)),m(A.id);},[e,n,t,m]),I=useMemo(()=>({templates:e,onCreateCustomView:u,onEditCustomView:x,onDeleteCustomView:f,isLoading:l,mainDefaultTemplate:s}),[e,u,x,f,l,s]),b=useCallback(d=>{if(!p){m(void 0);return}if(!d?.id){m(p.id);return}if(_t(d)){m(d.id);return}let C=e.find(y=>y.id===d.id);if(C){m(C.id);return}Re(d)&&m(d.id);},[e,p,m]),S=useMemo(()=>{let d=e.find(y=>c?y.id===c:false)??p;if(!d)return [];let C=zi(d,i);return C.length>0?C:[]},[i,e,c,p]);return {customViews:I,onViewChange:b,columnsView:S,selectedViewId:c}}function Jw({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:l,handleSubMenuClose:a}){let{t:s}=useTranslation(),p=useTheme(),{isIndeterminate:c,hasSubmenuItems:m,isSubmenuOpen:u,isFirstItem:f,handleColumnClick:x,handleMouseEnter:I,handleMouseLeave:b}=Xl({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:l,handleSubMenuClose:a}),S=d=>d?s(d)??sf(d):"";return jsxs(Yn,{sx:{borderTop:`1px solid ${p.palette.divider}`,...f&&{borderTop:"none",height:33}},children:[jsxs(V,{isIndeterminate:c,isSelected:e.selected,onMouseEnter:I,onMouseLeave:b,onClick:x,children:[jsx(Yn,{sx:{flex:1},children:S(e.label)}),m&&jsx("img",{src:xb,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(R,{open:u,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:a,children:e.menuItems?.map(d=>jsx(V,{isSelected:e.selected&&d.selected,onClick:()=>i(e.name,d.name),children:S(d.label)},d.name))})]},e.name)}var RC=Jw;function o0({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:l}=useTranslation(),a=useMemo(()=>n||[],[n]),s=useMemo(()=>a.map(S=>S.name),[a]),{reorderColumns:p,toggleColumnSelection:c,toggleSubmenuItem:m}=Kl({columns:a,setTableViews:o}),{subMenuAnchorEl:u,openSubMenuName:f,handleSubMenuClose:x,handleSubMenuOpen:I,handleMenuScroll:b}=Gl(e,i);return jsxs(Eo,{"data-testid":"TableView_CustomViews",children:[jsxs(Ao,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:l("columns")}),jsx("img",{src:Eb,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsxs(R,{open:e,anchorEl:r,"data-testid":"TableView_CustomViews_Popper",sx:{padding:0,marginTop:"8px",borderRadius:1},children:[e&&jsx(B,{onClick:i}),jsx(Po,{component:"article","data-testid":"TableView_CustomViews_List",children:jsx(Reorder.Group,{as:"div",axis:"y",onReorder:p,values:s,onScroll:b,children:a.map((S,d)=>jsx(RC,{column:S,index:d,openSubMenuName:f,subMenuAnchorEl:u,toggleColumnSelection:c,toggleSubmenuItem:m,handleSubMenuOpen:I,handleSubMenuClose:x},S.name))})})]})]})}var As=memo(o0);function a0({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:l}=useTranslation();return jsxs(Eo,{"data-testid":"TableView_DefaultViews",children:[jsxs(Ao,{onClick:a=>{n(a);},children:[jsx("div",{children:t.label}),jsx("img",{src:Eb,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(r0,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(Po,{children:[Eb$1.map(a=>jsxs(Mo,{onClick:()=>{o(a),r?.(a);},children:[a.id===t.id?jsx("img",{className:"check-icon",src:Fb,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:a.label}),jsx(Mn,{})]},a.id)),jsxs(Mo,{sx:{border:"none"},onClick:a=>{a.stopPropagation(),o(Db),r?.(Db);},children:[t.id===Db.id?jsx("img",{className:"check-icon",src:Fb,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:l("createCustomView")}),jsx(Mn,{})]})]})})]})}var Ps=Ds.memo(a0);function c0({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[l,a]=useState(null),[s,p$1]=useState(null),[c,m]=useState(null),[u,f]=useState(Cb$1),{t:x}=useTranslation(),I=C=>{e?.(),a(C.currentTarget),t(true);},b$1=()=>{p$1(null),m(null);},S=()=>{a(null),t(false),f(Cb$1);},d$1=C=>{f(C),C.id!==Db.id&&r?.(C),b$1();};return l?jsx(p0,{onClickAway:b$1,children:jsxs(Bi,{"data-testid":"TableView",children:[u.id===Db.id&&jsx(As,{tableViews:n,setTableViews:o,anchorEl:c,open:!!c,onSelect:C=>{m(c?null:C.currentTarget),p$1(null);},onClose:()=>{m(null);}}),jsx(Ps,{open:!!s,anchorEl:s,setSelectedViewInfo:C=>{d$1(C);},selectedViewInfo:u,onSelect:C=>{p$1(s?null:C.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(Ao,{sx:{width:32,justifyContent:"center"},onClick:S,children:jsx("img",{src:Gb$1,alt:"close"})})]})}):jsx(p,{title:x("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"TableView_no_anchorViewEl",onClick:I,"aria-label":x("tableView")})})}var Es=memo(c0);var BC=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:l,isModified:a=false})=>{let{hoveredNestedColumn:s,nestedSubmenuAnchorEl:p,openNestedSubmenu:c,closeNestedSubmenu:m,cancelNestedClose:u}=EC();return jsxs(Fragment,{children:[jsxs(uC,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(f$1,{checked:t,indeterminate:o,onChange:f=>{f.stopPropagation(),n();},onClick:f=>{f.stopPropagation();},sx:fC})}),jsx(Typography,{component:"button",disabled:!a,onClick:f=>{f.stopPropagation(),a&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:a?"pointer":"default",padding:0,opacity:a?1:.5,pointerEvents:a?"auto":"none","&:hover":a?{textDecoration:"underline"}:void 0},children:"Reset"})]}),jsx(v$1,{}),jsx(CC,{onScroll:m,children:jsx(Box,{component:"ul",sx:{listStyle:"none",padding:0,margin:0},children:e.map((f,x)=>{let I=f.menuItems&&f.menuItems.length>0,{checked:b,indeterminate:S}=Rn(f),d=W(f.name);return jsxs(Box,{component:"li",sx:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%"},children:[jsxs(Box,{sx:{position:"relative"},onMouseEnter:C=>I&&c(f.name,C.currentTarget),onMouseLeave:()=>I&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(V,{isSelected:I?b:f.selected,isIndeterminate:I?S:false,isDisabled:d,onClick:()=>{d||i(f.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:f.label||f.name})}),I&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:yb,alt:"arrow",style:{height:12}})})]}),I&&jsx(Popper,{open:s===f.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:u,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Vi,{children:f.menuItems?.map((C,y)=>jsxs(Ds.Fragment,{children:[jsx(V,{isSelected:C.selected,isDisabled:d,onClick:()=>{d||l(f.name,C.name);},children:C.label||C.name}),y<(f.menuItems?.length??0)-1&&jsx(v$1,{})]},C.name))})]})})]}),x<e.length-1&&jsx(v$1,{})]},f.name)})})})]})};function I0({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:l=[],onEditCustomView:a,defaultColumns:s=[],defaultTemplate:p$1,defaultTemplates:c=[],customTemplateCount:m,isLoading:u}){let{t:f}=useTranslation(),{hoveredColumn:x,anchorEl:I,openSubmenu:b,closeSubmenu:S,cancelClose:d,forceClose:C}=ko(),[y,w]=Ds.useState(null),[T,h]=Ds.useState(null),A=useMemo(()=>[...c.length?c:p$1?[p$1]:[],...l],[c,p$1,l]),P=useCallback(R=>R.submenu?.length?R.submenu:s,[s]),M=useCallback(R=>R?Hi(R,P(R)):s,[s,P]),E=useCallback(R=>M(R).length>0,[M]),k=useMemo(()=>x?A.find(R=>R.id===x):void 0,[x,A]),N=useMemo(()=>M(k),[k,M]),F=useMemo(()=>x?T?.length?T:N:[],[x,N,T]),Z=useMemo(()=>ps(F),[F]),fe=useMemo(()=>cs(F,Z),[F,Z]),Pe=T!=null&&!Bn(T,N),xe=(m??Jl(l))>=3,_=u||xe,je=_||!Pe;function ga(R){C(),h(null);let te;if(_t(R)){let Se=R.submenu?.length?R.submenu:s.length?s:p$1?.submenu??[];te={...R,submenu:le(Se),columns:Se.map(Ne=>Ne.name)};}else Re(R)&&(te=R);o(R,te);}function Ca(R,te){let Se=A.find(Ne=>Ne.id===R);h(le(M(Se))),b(R,te);}function L(){h(null),S(),C();}function V(R){if(R.stopPropagation(),je)return;let te=le(N),Se=T?.length?le(T):te;i?.(true,Se,te,k?.id),h(null),C();}function J(R){T&&h(ls(T,R));}function he(R,te){T&&h(kn(T,R,te));}function _h(){T&&h(ss(T,!Z));}function zh(){h(le(N));}return jsxs(Eo,{"data-testid":"ViewsDropdown",children:[jsx(r0,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(Po,{onScroll:C,children:[jsx(y0,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(v$1,{}),A.map(R=>{let te=Re(R),Se=!te&&E(R);return jsxs(Mo,{onMouseEnter:Ne=>{te?w(R.id):Se&&Ca(R.id,Ne.currentTarget);},onMouseLeave:()=>{te?w(null):Se&&S();},onClick:()=>ga(R),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[R.id===t.id?jsx("img",{style:{width:15,height:15},src:Yj,alt:"check"}):jsx(Do,{}),jsx("span",{style:{flex:1,fontSize:11},children:R.label}),te&&y===R.id&&jsx("img",{src:Ch$1,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:Ne=>{Ne.stopPropagation(),r?.(),a?.(R);}}),Se&&jsx("img",{src:yb,alt:"arrow",style:{height:12}})]},R.id)}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!xe,children:jsxs(Mo,{sx:{border:"none",opacity:_?.5:1,cursor:_?"not-allowed":"pointer"},onClick:R=>{if(R.stopPropagation(),_)return;let te=le(M(p$1)),Se=te.map(Ne=>({...Ne,selected:false,menuItems:Ne.menuItems?.map($h=>({...$h,selected:false}))}));i?.(true,Se,te,p$1?.id),C();},children:[jsx(Do,{}),jsxs(Yn,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:hm,alt:"",style:{opacity:_?.5:1,width:10,height:10}}),jsx("span",{style:{color:_?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:f("New Custom View")})]}),jsx(Mn,{})]})})]})}),x&&I&&F.length>0&&jsx(R,{open:!!I,anchorEl:I,placement:"auto-end",onMouseEnter:d,onMouseLeave:L,children:jsxs(gC,{children:[jsx(BC,{columns:Ro(F),allCurrentSelected:Z,someCurrentSelected:fe,onSelectAll:_h,onReset:zh,onColumnToggle:J,onNestedItemToggle:he,anchorEl:I,isModified:Pe}),jsxs(xC,{children:[jsx(VC,{variant:"text",onClick:L,sx:hC,children:"Cancel"}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!xe,children:jsx(VC,{variant:"contained",onClick:V,disabled:je,sx:yC,children:"Create view"})})]})]})})]})}var Ls=Ds.memo(I0);var FC=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:l,onColumnToggle:a,onSubItemToggle:s,onSelectAll:p,onResetToDefault:c,onSubmenuEnter:m,onSubmenuLeave:u,onCancelClose:f})=>{let x=useRef(null),{onDragStart:I,onDragEnd:b}=Yl(x),S=useCallback(d=>{if(Cs(d.target)){d.preventDefault();return}I();},[I]);return jsxs(iC,{children:[jsxs(aC,{children:[jsx(_l,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(zl,{onClick:d=>{d.stopPropagation(),p();},children:jsx(f$1,{checked:o,indeterminate:n,size:"small",sx:$l,onChange:d=>{d.stopPropagation(),p();},onClick:d=>{d.stopPropagation();}})}),jsx(Typography,{onClick:d=>{d.stopPropagation(),p();},sx:{flex:1,fontSize:13,fontWeight:500,color:"text.primary",ml:.75,cursor:"pointer"},children:"Select All"}),jsx(Link,{component:"button",type:"button",onClick:d=>{d.stopPropagation(),c();},underline:"none",sx:{fontSize:13,fontWeight:500,cursor:"pointer",color:"common.blue"},children:"Reset to default"})]}),jsx(Box,{sx:{flex:1,minHeight:0,overflowX:"hidden",overflowY:"auto",position:"relative"},children:jsx(Reorder.Group,{ref:x,axis:"y",onReorder:l,values:t,style:{listStyle:"none",padding:0,margin:0},children:e.map(d=>{let C=W(d.name),y=d.menuItems&&d.menuItems.length>0,{checked:w,indeterminate:T}=Rn(d);return jsxs(Reorder.Item,{value:d.name,drag:C?false:"y",dragListener:!C,dragConstraints:x,dragElastic:{top:0,bottom:0,left:0,right:0},transition:{duration:0},whileDrag:{zIndex:9999,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",scale:1},style:{listStyle:"none",margin:0,padding:0,position:"relative",zIndex:1,backgroundColor:"#fff",width:"100%",willChange:"transform"},onDragStart:S,onDragEnd:b,children:[jsxs(lC,{isHovered:r===d.name,isDate:C,onMouseEnter:h=>y&&m(d.name,h.currentTarget),onMouseLeave:()=>y&&u(),onClick:h=>{(h.target.closest('[role="checkbox"]')||h.target.closest('input[type="checkbox"]'))&&h.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(_l,{children:jsx("img",{src:Hb,alt:"drag",draggable:false,style:{width:16,height:16,cursor:C?"default":"grab",pointerEvents:"none"}})}),jsx(zl,{onMouseDown:h=>{h.stopPropagation();},onPointerDown:h=>{h.stopPropagation();},children:jsx(f$1,{checked:w,indeterminate:T,onChange:h=>{h.stopPropagation(),a(d.name);},onClick:h=>{h.stopPropagation();},disabled:C,size:"small",sx:$l})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:d.label||d.name}),y&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:xb,alt:"arrow",style:{width:12,height:12}})})]}),y&&jsx(Popper,{open:r===d.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:f,onMouseLeave:u,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Vi,{children:d.menuItems?.map((h,A)=>jsxs(Ds.Fragment,{children:[jsx(V,{isSelected:h.selected,isDisabled:C,onClick:()=>{C||s(d.name,h.name);},sx:{fontSize:13},children:h.label||h.name}),A<(d.menuItems?.length??0)-1&&jsx(v$1,{})]},h.name))})]})})]},d.name)})})})]})};function E0({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i,onDelete:l,tableViews:a=[],mode:s="sheet",stackOrder:p=1}){let{t:c$1}=useTranslation(),m=useDragControls(),[u,f]=useState(false),[x,I]=useState(false);useEffect(()=>{e||(f(false),I(false));},[e]),useEffect(()=>{if(!e)return;let _=je=>{je.key==="Escape"&&t();};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,t]);let{templateName:b,setTemplateName:S,selectedColumns:d,allSelected:C,someSelected:y,isNameValid:w,hasChanges:T,hoveredColumn:h,anchorEl:A,openSubmenu:P,closeSubmenu:M,cancelClose:E,handleReorder:k,handleColumnToggle:N,handleSubItemToggle:F,handleSelectAll:Z,handleResetToDefault:fe}=Ss({open:e,availableColumns:n,defaultColumns:r,editingView:i,tableViews:a}),Pe=async()=>{if(!(!w||!T||x||u)){I(true);try{let _=Zl(d,s);await o?.({name:b,selectedColumns:d,layout:_}),t();}catch{console.warn("Failed to create view");}finally{I(false);}}},xe=async()=>{if(!i||u||x)return;let _=i.id;f(true);try{await l?.(_),t();}catch{console.warn("Failed to delete view");}finally{f(false);}};return e?jsxs(dC,{role:"dialog","aria-modal":"true","data-testid":"CreateViewDialog",drag:true,dragListener:false,dragControls:m,dragMomentum:false,initial:false,style:{width:450,minWidth:0,maxWidth:"min(100vw - 16px, 450px)",height:600,left:`max(8px, calc(50% - ${450/2}px))`,top:`max(8px, calc(50% - ${600/2}px))`},animate:{zIndex:2+p},transition:{duration:.1},children:[jsx(c,{id:"draggable-dialog-title",onPointerDown:_=>m.start(_),style:{cursor:"move",flexShrink:0},children:jsx(d$2,{isHovered:true,title:i?"Edit Custom View":c$1("createCustomView")||"Create Custom View",leftActions:jsx(a$3,{onClick:t,onPointerDown:_=>_.stopPropagation()})})}),jsxs(oC,{children:[jsxs(nC,{onScroll:()=>{M();},children:[jsxs(rC,{children:[jsxs(Box,{children:[jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#9F9F9F",lineHeight:"0.7"},children:"Custom"}),jsx(Typography,{sx:{fontSize:24,fontWeight:700,color:"#20232B",lineHeight:1.2},children:"View"})]}),i&&jsx(cC,{onClick:xe,disabled:u||x,children:u?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:"Deleting..."})]}):"Delete View"})]}),jsx(Box,{sx:{mb:3},children:jsx(b$6,{name:"custom-template-name",label:"Template Name",value:b,onChange:_=>S(_),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:_=>_.currentTarget.removeAttribute("readonly")},required:true})}),jsx(FC,{selectedColumns:Ro(d),columnNames:Ro(d).map(_=>_.name),allSelected:C,someSelected:y,hoveredColumn:h,anchorEl:A,onReorder:k,onColumnToggle:N,onSubItemToggle:F,onSelectAll:Z,onResetToDefault:fe,onSubmenuEnter:P,onSubmenuLeave:M,onCancelClose:E})]}),jsx(sC,{}),jsx(pC,{children:jsx(mC,{variant:"contained",onClick:Pe,disabled:!w||!T||x||u,title:w?void 0:`Name is required. Current: "${b}"`,children:x?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:i?"Saving...":"Creating..."})]}):i?"Update View":"Create View"})})]})]}):null}var Rs=E0;function R0({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:l="en",isLoading:a,mainDefaultTemplate:s}){let{t:p$1}=useTranslation(),{defaultColumns:c,defaultTemplate:m,defaultTemplates:u,customViews:f,allTemplates:x,customTemplateCount:I}=$i({tableMode:i,templates:t,lang:l,mainDefaultTemplate:s}),{anchorEl:b$1,isCreateDialogOpen:S,editingView:d$1,selectedViewInfo:C$1,shouldUseCurrentState:y,currentViewColumns:w,initialColumnsForCreate:T,availableColumnsForCreate:h,handleViewButtonClick:A,handleCloseViewDropdown:P,handleSelectedViewInfo:M,handleOpenCreateDialog:E,handleOpenEditDialog:k,handleCloseCreateDialog:N,handleSaveView:F,handleDeleteView:Z}=Ui({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:c,defaultTemplate:m,allTemplates:x,customTemplateCount:I});return jsxs(Fragment,{children:[jsx(p0,{onClickAway:P,children:jsxs(Bi,{sx:{width:"32px"},"data-testid":"ViewsMenu",children:[jsx(p,{title:p$1("tableView"),children:jsx(b,{variant:"secondary",size:"md",icon:jsx(d,{src:C,alt:"view",sx:{width:14,height:14}}),"data-testid":"ViewsMenu_button",onClick:A,"aria-label":p$1("tableView")})}),jsx(Ls,{open:!!b$1,anchorEl:b$1,onClose:P,setSelectedViewInfo:M,selectedViewInfo:C$1,onCreateCustomView:E,customViews:f,onEditCustomView:k,defaultColumns:c,defaultTemplate:m,defaultTemplates:u,customTemplateCount:I,isLoading:a})]})}),jsx(Rs,{open:S,onClose:N,availableColumns:h?.length?h:c,defaultColumns:c,onCreate:F,editingView:d$1,onDelete:Z,tableViews:y?T??w:void 0,mode:i})]})}var UC=memo(R0);function ks(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function W0({tableMode:e,onToggle:t}){let o=Xa(e),n=Ya(e);return jsx(b,{variant:"secondary",size:"md",icon:jsx(d,{src:n?Mh$1:Lh$1,alt:`${e}-mode`,sx:{width:14,height:14}}),onClick:t,"aria-label":`${e}-mode`,sx:r=>o?{}:{borderColor:r.v2.palette.brand[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}})}var YC=memo(W0);function Fn({children:e,component:t="aside",...o}){return jsx(Jg,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function Xi({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:l,lang:a}){let{isColumnPickerVisible:s,setIsColumnPickerVisible:p,timezoneCountryCodes:c}=ks(t?.segmentCountries),m=e?.variant==="acceptance",u=n?.tableMode??"default",f=useMemo(()=>n?.onSheetToggle?jsx(YC,{tableMode:u,onToggle:n.onSheetToggle}):null,[u,n?.onSheetToggle]);return jsxs(Fn,{children:[i?.leading&&!s&&i.leading,!s&&jsxs(Fragment,{children:[r?.onChange&&jsx(b$7,{onSearchChange:r.onChange,placeholder:r.placeholder,defaultValue:r.defaultValue}),i?.filter,f&&!m&&f,i?.calendar??(o&&t&&jsx(a$4,{defaultDate:o.date,onDateChange:x=>{let[I,b]=x;I&&b&&o.onDateChange([I,b]);},mode:o.mode,onCalendarModeSwitch:o.onModeChange,maxDateRange:o.maxRange??31,groupBy:o.groupBy,onCalendarGroupChange:o.onGroupByChange,browserTimezone:t.browserTimezone,defaultCountryTimezone:t.defaultCountryTimezone,timezone:t.timezone,onChangeTimezone:t.onChangeTimezone,timezoneCountriesCodes:c})),l&&i?.reports,f&&m&&f]}),n?.onViewChange&&(n.templates?jsx(UC,{onViewChange:n.onViewChange,tableMode:u,lang:a,...n.templates}):jsx(Es,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!s&&i.trailing]})}function U0({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:l,activeFilter:a,views:s,search:p,slots:c,children:m}){let u=Bc(useId(),"list-header"),f=useMemo(()=>jsx(Xi,{display:t,timezone:r,calendar:i,views:s,search:p,slots:c,reportsVisible:n,lang:o}),[t,r,i,s,p,c,n,o]);return jsxs(Li,{id:u,"data-testid":Yg,children:[t?.maximized&&jsx(Ri,{title:e,toolbar:f}),jsxs(Xg,{as:"section",children:[jsx(ki,{status:l,activeFilter:a,beforeStatus:c?.beforeStatus}),!t?.maximized&&f]}),m]})}var qC=memo(U0);var ZC=styled$1(Yn,{shouldForwardProp:e=>e!=="maximized"})(({theme:e,maximized:t})=>({display:"flex",alignItems:"center",gap:e.spacing(1),overflow:"hidden",height:t?"4.75rem":"4.1875rem",paddingBottom:t?"0rem":"1.2rem",paddingInline:e.spacing(4),paddingTop:t?"1.35rem":e.spacing(.5)})),Y0=ya(),JC=styled$1(j,{shouldForwardProp:e=>e!=="title"&&e!=="isDropdown"})(({title:e,isDropdown:t,theme:o})=>{let{base:n}=o.v2.palette;return {position:"relative",fontWeight:o.typography.fontWeightMedium,padding:o.spacing(1),color:n.black,fontSize:"11px",lineHeight:"15px",borderRadius:o.shape.borderRadius,transition:o.transitions.create(["backgroundColor","boxShadow"],{easing:o.transitions.easing.sharp,duration:o.transitions.duration.complex}),whiteSpace:"nowrap",textTransform:"capitalize","&:hover, &.active":{...!t&&{backgroundColor:n.white,boxShadow:o.shadows[2]},cursor:"pointer",position:"relative",color:"transparent","&:after":{...e&&{content:`"${e}"`},color:n.black,fontWeight:o.v2.typography.fontWeightBold,overflow:"hidden",position:"absolute",top:0,bottom:0,right:0,left:0,display:"flex",alignItems:"center",justifyContent:t?"flex-start":"center",letterSpacing:Y0==="safari"?"-1px":"",padding:8,borderRadius:o.shape.borderRadius}}}});function X0({isDropdown:e=false,name:t,code:o,activeCode:n,navigateToMenuItem:r,onClickServiceItem:i}){let[l,a]=useState(null),{t:s}=useTranslation(),p=!!l,c=()=>{a(null);};return jsxs(Fragment,{children:[jsx(JC,{isDropdown:e,className:n.toLowerCase()===o.toLowerCase()?"active":"",onClick:m=>{m.preventDefault(),m.stopPropagation(),r(o);},title:t,onContextMenu:m=>{m.preventDefault(),m.stopPropagation(),c(),a(m.currentTarget);},children:t}),jsx(f,{open:p,anchorEl:l,onClose:c,menuItems:[{label:s("openNewWindow"),name:"new",icon:jsx("img",{src:jb$1,alt:"new-window-icon"}),onClick:m=>{m.stopPropagation(),i?.(o),c();}}]})]})}var QC=memo(X0);var a1=e$1=>jsx(e,{src:e$1.className.includes("MuiSelect-iconOpen")?Yc:Xc,alt:"dropdown"});function l1({isMaximized:e,serviceCode:t,dimensions:o,services:n,onChangeServiceCode:r,onClickServiceItem:i}){let l=Bc(useId(),"app-services"),[a,s]=useState(0),[p,c]=useState(false),[m,u]=useState(""),f=useRef(null),[x,I]=Ds.useState(false),{i18n:b}=useTranslation(),S=T=>{u(T.target.value);},d=()=>{I(T=>!T);},C=useMemo(()=>cc(n.filter(T=>T.code.toLowerCase()===decodeURIComponent(t).toLowerCase())?.[0]?.name,b.language),[n,b.language,t]);useEffect(()=>{u(C);},[C]),useEffect(()=>{s(f.current?.offsetWidth+51+8+3);},[]),useEffect(()=>{c(Number(o?.width)<a+10);},[o?.width,a]);let y=T=>{r?.(T),I(false);},w=T=>jsx(c$1,{children:T});return jsxs(ZC,{id:l,"data-testid":"AppServices",maximized:e,children:[!!n?.length&&!p&&jsx(Box,{ref:f,display:"flex",gap:"8px",flexDirection:"row",sx:{userSelect:"none"},children:n.map((T,h)=>jsx(QC,{activeCode:t,onClickServiceItem:i,navigateToMenuItem:y,name:cc(T.name,b.language)||"",code:T.code},`service-item-${T.code}-${h}`))}),!!n?.length&&p&&jsx(a$2,{open:x,onClick:d,displayEmpty:true,inputProps:{"aria-label":"Without label"},MenuProps:{anchorOrigin:{vertical:40,horizontal:83},PaperProps:{style:{borderRadius:"0.25rem",width:"10.43rem",padding:0}},MenuListProps:{disablePadding:true}},value:m,IconComponent:a1,onChange:S,renderValue:w,sx:{"& .MuiOutlinedInput-root.MuiList-root-MuiMenu-list":{paddingTop:"0px !important",paddingBottom:"0px !important"}},children:n.map((T,h)=>cc(T.name,b.language)?.toLowerCase()===m?.toLowerCase()?null:jsx(b$3,{value:cc(T.name,b.language),onClick:A=>{A.preventDefault(),A.stopPropagation(),y(T.code);},children:jsx(d$1,{children:cc(T.name,b.language)})},`option-${T.code}-${h}`))})]})}var ex=memo(l1);var Fs=ex;function u1({appCode:e,services:t,isMaximized:o,dimensions:n,serviceCode:r,ui:{onStartDrag:i},onChangeServiceCode:l,onClickServiceItem:a,sx:s}){let p=Bc(useId(),"app-services-bar"),[c,m]=useState(false),u=useCallback(x=>{i?.(x),m(true);},[i,m]),f=()=>{m(false);};return !e||!t?.length?null:jsx(b$4,{id:p,"data-testid":"AppServicesBar",onPointerDown:u,onPointerUp:f,isDragging:c,sx:s,children:jsx(Fs,{onClickServiceItem:a,dimensions:{width:n.width},serviceCode:r,services:t,isMaximized:o,onChangeServiceCode:l})})}var ox=memo(u1);var f1=ox;var rx=styled$1(Yn,{shouldForwardProp:e=>e!=="isActive"})(({theme:e,isActive:t})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,minHeight:32,minWidth:30,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",backgroundColor:e.palette.common.white,":hover":{opacity:.7},...t&&{boxShadow:`0px 0px 4px 0px ${e.palette.info.dark}80`,border:`1px solid ${e.palette.info.dark}`,backgroundColor:`${e.palette.info.dark}0D`,gap:"6px",padding:"0 8px"}})),ix=styled$1(Yn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",minWidth:14,height:14,borderRadius:"50%",background:e.palette.background.gradient.shadedBlue,color:e.palette.common.white,fontSize:"8px",fontWeight:700,lineHeight:"14px",flexShrink:0})),ax=styled$1(Yn)(()=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"2px","& img":{width:14,height:14}})),lx=styled$1(g1)(({theme:e})=>({marginTop:e.spacing(1),marginBottom:e.spacing(1),minWidth:193,"& .MuiPaper-root":{borderRadius:e.spacing(.5),"&>.MuiList-root":{padding:0}}})),sx=styled$1(j)(({theme:e})=>{let{grey:t}=e.v2.palette;return {fontWeight:e.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:t[500],paddingInlineStart:e.v2.spacing(16),paddingTop:e.v2.spacing(8),paddingBottom:e.v2.spacing(8),paddingInlineEnd:e.v2.spacing(8),borderBottom:`1px solid ${t[100]}`,display:"block"}}),Hs=styled$1(Yn)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",backgroundColor:e.palette.common.white,borderTop:`1px solid ${e.palette.divider}`})),Os=styled$1(VC)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.info.dark}`,backgroundColor:e.palette.info.dark,fontWeight:700,fontSize:"11px",color:e.palette.common.white,"&:hover":{backgroundColor:e.palette.info.dark},"&.Mui-disabled":{color:"#fff !important",opacity:.5}})),_s=styled$1(VC)(({theme:e})=>({textTransform:"capitalize",minWidth:"auto",width:70,borderRadius:"4px",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,fontWeight:500,fontSize:"11px",color:e.palette.text.primary,"&:hover":{background:"transparent"}}));var zs=createContext(null);function h1(){let e=useContext(zs);if(!e)throw new Error("useFilterDropdown must be used inside a FilterDropdown");return e}function cx({onConfirm:e,onCancel:t,isOkayButDisabled:o,children:n,isDisabled:r,icon:i,title:l,menuStyle:a,hideTitle:s=false,hideFooter:p=false,activeFiltersCount:c,onClearFilters:m,renderButton:u,onOpenChange:f,menuProps:x,...I}){let b=Bc(useId(),"filter-dropdown"),[S,d]=useState(null),C=!!S,{t:y}=useTranslation(),w=()=>{d(null),f?.(false);},T=E=>{if(!r){if(!C){d(E.currentTarget),f?.(true);return}w();}},h=()=>{C&&(t?.(),w());},A=()=>{e?.(),w();},P=typeof c=="number"&&c>0,M=E=>{E.stopPropagation(),m?.();};return jsx(zs.Provider,{value:{onConfirm:A,onCancel:h,onClose:w},children:jsx(p0,{onClickAway:h,children:jsxs(Yn,{id:b,"data-testid":"FilterDropdown",...I,children:[jsx(rx,{className:"filter-button",isActive:C||P,onClick:T,sx:{...r&&{pointerEvents:"none",opacity:.5,...I.sx}},children:u??jsxs(Fragment,{children:[jsx(Yn,{component:"img",src:i??ak,alt:"filter"}),P&&jsxs(Fragment,{children:[jsx(ix,{children:c}),jsx(ax,{onClick:M,"aria-label":"clear filters",children:jsx(Yn,{component:"img",src:Gb$1,alt:"clear"})})]})]})}),jsxs(lx,{anchorEl:S,open:C,onClose:h,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{marginTop:"8px",marginBottom:"8px",width:193,...a},...x,children:[!s&&jsx(sx,{component:"span",children:l??y("filterBy")}),n,!p&&jsxs(Hs,{children:[jsx(_s,{onClick:h,children:y("cancel")}),jsx(Os,{disabled:o,onClick:A,children:y("okay")})]})]}),C&&jsx(B,{onClick:w})]})})})}var mx=styled$1(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"}})),dx=styled$1(Yn)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),ux=styled$1(Yn)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),fx=styled$1(Yn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"178px"}));function Ys({brand:e,merchantsIds:t,onChangeMerchant:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,anchorEl:i}){let[l,a]=useState(""),s=!!i,p=useCallback(S=>t.includes(S),[t]),c=(S,d)=>{if(S.stopPropagation(),p(d)){o?.(t.filter(y=>y!==d));return}let C=[...new Set([...t,d])];o?.(C);},m=S=>t.length===1&&t[0]===S&&n,u=S=>{a(S);},f=()=>{a("");},x=useMemo(()=>e.merchants??[],[e.merchants]),I=useMemo(()=>{if(!l?.trim())return x;let S=l.trim().toLowerCase();return x?.filter(d=>(d?.display_name??"").toLowerCase().includes(S)||(d?.legacy_id??"").toLowerCase().includes(S))},[l,x]),b=useMemo(()=>r?I:x,[I,x,r]);return jsxs(R,{open:s,anchorEl:i,placement:"right-start",children:[r&&x.length>1&&jsx(Yn,{sx:{p:"8px"},children:jsx(b$5,{fullWidth:true,placeholder:"Merchants",name:"merchants",value:l,onChange:S=>u(S.target.value),onClear:f})}),b?.map(S=>jsx(mx,{isDisabled:m(S.legacy_id),isSelected:p(S.legacy_id),onClick:d=>{m(S.legacy_id)||c(d,S.legacy_id);},sx:{maxHeight:36,minHeight:36},children:jsxs(dx,{children:[jsx(fx,{component:"span",children:S.display_name}),jsx(ux,{component:"span",children:S.legacy_id})]})},S?.legacy_id))]})}var Qi=Ys;var Cx=styled$1(Yn)(()=>({display:"flex",gap:"4px",alignItems:"center",flex:1,marginInlineEnd:"8px"}));function qs({brand:e,merchantsIds:t,isDisabled:o,atLeastOneMerchantSelected:n=false,showSearchInput:r=false,renderBrandLogo:i,onChangeMerchant:l}){let[a,s]=useState(null),p=!!a,c=b=>{s(b.currentTarget);},m=()=>{s(null);},u=useMemo(()=>e.merchants?.filter(b=>t.includes(b.legacy_id)),[t,e.merchants]),f=useMemo(()=>u?.length===e.merchants?.length,[u?.length,e.merchants?.length]),x=useMemo(()=>!f&&u.length>0,[f,u]),I=b=>{if(b.stopPropagation(),f){l?.(t.filter(S=>!e.merchants.some(({legacy_id:d})=>S===d)));return}if(x){let S=[...new Set([...t,...u.map(({legacy_id:d})=>d)])];l?.(S);return}l?.([...t,...e.merchants.map(({legacy_id:S})=>S)]);};return jsxs(V,{isSelected:f,isIndeterminate:x,onMouseEnter:c,onMouseLeave:m,onClick:b=>{o||I(b);},isDisabled:o,sx:{maxHeight:35,minHeight:35,...p&&{boxShadow:"0px 0px 16px 0px #00000021"}},children:[jsxs(Cx,{children:[i?.(e.logo),jsx(j,{sx:{fontSize:"11px"},children:cc(e.name)})]}),e.merchants?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsx(Qi,{anchorEl:a,brand:e,merchantsIds:t,onChangeMerchant:l,atLeastOneMerchantSelected:n,showSearchInput:r})]})}var hx=qs;function Xs({brands:e,isLoading:t,onFilterChange:o,merchantsIds:n=[],atLeastOneMerchantSelected:r=false,showSearchInput:i=false,hideCheckbox:l=false,renderBrandLogo:a}){let[s,p]=useState(null),[c,m]=useState(""),u=!!s,{t:f}=useTranslation(),x=P=>{p(P.currentTarget);},I=()=>{p(null);},b=useMemo(()=>e.length?e.every(P=>P.merchants?.every(({legacy_id:M})=>n.includes(M))):false,[n,e,l]),S=useMemo(()=>!b&&n.length>0,[n,b]),d=useMemo(()=>e.filter(P=>P.merchants?.some(M=>n?.includes(M.legacy_id))).length,[e,n]),C=()=>{if(b&&!r){o?.([]);return}let P=e.flatMap(M=>M.merchants?.map(({legacy_id:E})=>E));o?.(P);},y=t||!e?.length,w=P=>{m(P);},T=()=>{m("");},h=useMemo(()=>{if(!c.trim())return e;let P=c.trim().toLowerCase();return e.filter(M=>cc(M.name)?.toLowerCase()?.includes(P)||M.merchants?.some(E=>E.legacy_id?.toLowerCase().includes(P)))},[c,e]),A=useMemo(()=>i?h:e,[e,h,i]);return jsxs(V,{isDisabled:y,isSelected:b,startAdornment:l?null:void 0,isIndeterminate:S,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...u&&{boxShadow:"0px 0px 16px 0px #00000021"},...y&&{pointerEvents:"none",opacity:.5,cursor:"default"}},onMouseEnter:x,onMouseLeave:I,onClick:C,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:f("merchant")}),e.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),e?.length===1?jsx(Qi,{anchorEl:s,brand:e[0],merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i}):jsxs(R,{open:u,anchorEl:s,placement:"right-start",children:[i&&e.length>1&&jsx(Yn,{sx:{p:"8px"},children:jsx(b$5,{id:"merchants-search-input",fullWidth:true,placeholder:"Brands",name:"brands",value:c,onChange:P=>w(P.target.value),onClear:T})}),A?.map(P=>jsx(hx,{isDisabled:d===1&&r,brand:P,merchantsIds:n,onChangeMerchant:o,atLeastOneMerchantSelected:r,showSearchInput:i,renderBrandLogo:a},P.id))]})]})}var bx=styled$1(Yn)(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"164px"}));function F1({retailersIds:e=[],isLoading:t,retailers:o=[],onFilterChange:n,atLeastOneRetailerSelected:r=false,showSearchInput:i=false,hideCheckbox:l=false}){let[a,s]=useState(null),p=!!a,{t:c,i18n:m}=useTranslation(),[u,f]=useState(""),x=E=>{s(E.currentTarget);},I=()=>{s(null);},b=useCallback(E=>e?.includes(E),[e]),S=useMemo(()=>o.length?o.every(E=>b(E.id)):false,[o,b,l]),d=useMemo(()=>!S&&e.length>0,[e,S]),C=()=>{if(S&&!r){n?.([]);return}n?.(o.map(E=>E.id));},y=E=>e.length===1&&e[0]===E&&r,w=(E,k)=>{if(E.stopPropagation(),y(k))return;if(b(k)){n?.(e.filter(F=>F!==k));return}let N=[...new Set([...e,k])];n?.(N);},T=t||!o?.length,h=E=>{f(E);},A=()=>{f("");},P=useMemo(()=>u?.trim()?o?.filter(E=>(E?.brand?.name?.[m.language]??E?.brand?.name?.en??"").toLowerCase().includes(u.trim().toLowerCase())):o,[u,o,m.language]),M=useMemo(()=>i?P:o,[P,o,i]);return jsxs(V,{isDisabled:T,isSelected:S,startAdornment:l?null:void 0,isIndeterminate:d,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...p&&{boxShadow:"0px 0px 16px 0px #00000021"},...T&&{opacity:.5,pointerEvents:"none",cursor:"default"}},onMouseEnter:x,onMouseLeave:I,onClick:C,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:c("retailers")}),o?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsxs(R,{open:p,anchorEl:a,placement:"right-start",sx:{height:300,width:200,overflow:"auto"},children:[i&&jsx(Yn,{sx:{p:"8px"},children:jsx(b$5,{id:"retailers-search-field",fullWidth:true,placeholder:"Retailers",name:"retailers",value:u,onChange:E=>h(E.target.value),onClear:A})}),M?.map((E,k)=>jsx(V,{isSelected:b(E.id),isDisabled:t||y(E.id),onClick:N=>{w(N,E.id);},sx:{maxHeight:35,minHeight:35},children:jsx(bx,{children:E?.brand?.name?.[m.language]??E?.brand?.name?.en})},`key-${E?.id}-${k}`))]})]})}var wx=memo(F1);function $1({countriesIds:e=[],isLoading:t,countries:o=[],onFilterChange:n,atLeastOneCountrySelected:r=false,hideCheckbox:i=false}){let[l,a]=useState(null),s=!!l,{t:p}=useTranslation(),c=C=>{s||a(C.currentTarget);},m=()=>{s&&a(null);},u=useCallback(C=>e?.includes(C),[e]),f=useMemo(()=>o.length?o.every(C=>u(C)):false,[o,u]),x=useMemo(()=>!f&&e.length>0,[e,f]),I=()=>{if(!r){if(f){n?.([]);return}n?.(o);}},b=C=>e.length===1&&e[0]===C&&r,S=(C,y)=>{if(C.stopPropagation(),b(y))return;if(u(y)){n?.(e.filter(T=>T!==y));return}let w=[...new Set([...e,y])];n?.(w);},d=t||o?.length<=0||r;return jsxs(V,{isDisabled:d,isSelected:f,startAdornment:i?null:void 0,isIndeterminate:x,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...s&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:c,onMouseLeave:m,onClick:I,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:p("walletCountry")}),o?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsx(R,{open:s,anchorEl:l,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((C,y)=>jsxs(V,{isSelected:u(C),isDisabled:t||b(C),onClick:w=>{S(w,C);},sx:{maxHeight:35,minHeight:35},children:[jsx(b$2,{countryCode:C}),jsx(j,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:Na(C)})]},`key-${C}-${y}`))})]})}var Px=memo($1);function K1({currenciesIds:e=[],isLoading:t,currencies:o=[],onFilterChange:n,atLeastOneCurrencySelected:r=false,hideCheckbox:i=false}){let[l,a]=useState(null),s=!!l,{t:p}=useTranslation(),c=C=>{s||a(C.currentTarget);},m=()=>{s&&a(null);},u=useCallback(C=>e?.includes(C),[e]),f=useMemo(()=>o.length?o.every(C=>u(C)):false,[o,u]),x=useMemo(()=>!f&&e.length>0,[e,f]),I=()=>{if(!r){if(f){n?.([]);return}n?.(o);}},b=C=>e.length===1&&e[0]===C&&r,S=(C,y)=>{if(C.stopPropagation(),b(y))return;if(u(y)){n?.(e.filter(T=>T!==y));return}let w=[...new Set([...e,y])];n?.(w);},d=t||o?.length<=0||r;return jsxs(V,{isDisabled:d,isSelected:f,startAdornment:i?null:void 0,isIndeterminate:x,sx:{maxHeight:35,minHeight:35,padding:"12px 8px 12px 16px",...s&&{boxShadow:"0px 0px 16px 0px #00000021"},...!o?.length&&{opacity:.5,pointerEvents:"none"}},onMouseEnter:c,onMouseLeave:m,onClick:I,children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:p("currency")}),o?.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),jsx(R,{open:s,anchorEl:l,placement:"right-start",sx:{width:200,overflow:"auto"},children:o?.map((C,y)=>yo[C]?.country?jsxs(V,{isSelected:u(C),isDisabled:t||b(C),onClick:T=>{S(T,C);},sx:{maxHeight:35,minHeight:35},children:[jsx(b$2,{countryCode:yo[C].country})," ",jsx(j,{sx:{fontSize:"11px !important",fontWeight:"500 !important"},children:C})]},`key-${C}-${y}`):null)})]})}var Dx=memo(K1);var q1=(r=>(r.BRAND="BRAND",r.COUNTRY="COUNTRY",r.ENTITY="ENTITY",r.MERCHANT="MERCHANT",r))(q1||{});var X1="/",Gn=5,Lx=(...e)=>e.join(X1),Zs=e=>[e.label,e.id],Rx=(e,t)=>{if(e.levelKey==="MERCHANT")return e.id.toLowerCase().includes(t)?e:null;let o=(e.children??[]).map(i=>Rx(i,t)).filter(i=>i!==null);if(!o.length)return null;let{searchProps:n,...r}=e;return {...r,children:o,...o.length>=Gn&&{searchProps:n}}},kx=(e,t,o)=>{let n=e.map(r=>{let i=r.entities??[],a=Array.from(new Set(i.map(s=>s.country).filter(Boolean))).map(s=>{let c=i.filter(m=>m.country===s).map(m=>{let f=(m.merchants??[]).map(x=>({id:x.legacy_id,label:x.display_name,levelKey:"MERCHANT",status:t.includes(x.legacy_id)?"CHECKED":"UNCHECKED",hintText:x.legacy_id}));return {id:Lx(r.id,s,m.id),label:cc(m.legal_name,o)??m.id,levelKey:"ENTITY",children:f,header:"Merchants",...f.length>=Gn&&{searchProps:{getValues:Zs}}}});return {id:Lx(r.id,s),label:Na(s)??s,levelKey:"COUNTRY",children:c,header:"Entities",iconComponent:jsx(b$2,{countryCode:s,width:14}),...c.length>=Gn&&{searchProps:{getValues:Zs}}}});return {id:r.id,label:cc(r.name,o)??r.id,levelKey:"BRAND",children:a,header:"Countries",icon:{fileId:r.logo??""},...a.length>=Gn&&{searchProps:{getValues:Zs}}}});return {levelKey:"BRAND",children:n,header:"Brands",...n.length>=Gn&&{searchProps:{filterItem:(r,i)=>(typeof r.label=="string"?r.label.toLowerCase():"").includes(i)?r:Rx(r,i)}}}};var ov=e=>{let{brands:t,isLoading:o,initialValue:n,onFilterChange:r,BrandLogoComponent:i,hideCheckbox:l}=e,[a,s]=useState(null),[p,c]=useState("UNCHECKED"),m=useRef(null),u=!!a,{t:f,i18n:x}=useTranslation(),I=useMemo(()=>kx(t,n,x.language),[t,n,x.language]),b=I.children??[],S=o||!b.length,d=useCallback(T=>{let h=T.filter(P=>P.status==="CHECKED"),A=T.filter(P=>P.status==="INDETERMINATE");return h.length===b.length?"CHECKED":A.length>0||h.length>0?"INDETERMINATE":"UNCHECKED"},[b]),C=useCallback(({selectedTree:T})=>{c(d(T));},[d]),y=useCallback(T=>{c(d(T));let h=b$a.filterNodesByLevelKey(T,"MERCHANT").map(({id:A})=>A);r?.(h);},[r,d]),w=useCallback(()=>{m.current?.toggleAll(p!=="CHECKED");},[p]);return jsxs(V,{startAdornment:l?null:void 0,isSelected:p==="CHECKED",isIndeterminate:p==="INDETERMINATE",isDisabled:S,onMouseEnter:T=>s(T.currentTarget),onMouseLeave:()=>s(null),onClick:w,sx:{maxHeight:36,minHeight:36,padding:"12px 8px 12px 16px",...u&&{boxShadow:"0px 0px 16px 0px #00000021"},...S&&{pointerEvents:"none",opacity:.5,cursor:"default"}},children:[jsx(j,{sx:{fontSize:"11px",flex:1},children:f("merchant")}),t.length>0&&jsx("img",{src:xb,alt:"arrow",style:{height:12}}),!o&&jsx(c$3,{ref:m,placement:"right-start",anchorEl:a,exposeOnlySelectedTree:true,treeDefinition:I,onChange:y,onMounted:C,IconComponent:i})]})},Vx=ov;var rv=Vx;function Nx({onPhoneChange:e,onCountryChange:t,selectedPhone:o,selectedCountry:n,countriesOptions:r,isCountriesLoading:i}){let l=Bc(useId(),"phone-filter");return jsx(b$b,{id:l,"data-testid":"ColumnFilterInputs_PhoneInput",phoneValue:o,onPhoneChange:a=>{e(a);},countryValue:n,onCountryChange:a=>{t(a?.countryId);},countries:r||[],isCountriesLoading:i||false,error:false,disabled:i,placeholder:"User Mobile",sx:{"&.MuiInputBase-root":{paddingLeft:"0px !important"}}})}var Wx=(e,t)=>{let o=e||{},n={};return t?.forEach(({value:r})=>{let i=o?.[r];n[r]=i===void 0?"all":i;}),n};function Hx({anchorEl:e,options:t,apiKey:o="statuses",initialStatuses:n,onCloseDropdown:r$1,onClear:i,onConfirm:l}){let a=!!e,s=Bc(useId(),"status-filter"),{t:p}=useTranslation(),[c,m]=useState(()=>Wx(n,t)),u=useRef(null),[f,x]=useState(null),[I,b]=useState(null),S=(A,P)=>{x(A.currentTarget),b(P);},d=useCallback(()=>{x(null),b(null);},[]),C=useCallback(A=>{r$1(A),d();},[d,r$1]),y=()=>{let A=Object.keys(c).reduce((M,E)=>{let k=c[E];return k!=="all"&&(M[E]=k),M},{});Object.values(c).every(M=>M==="all")?i([o]):l({[o]:A});},w=r(y,r$1),T=A=>{y(),r$1(A);},h=A=>{I&&m(P=>({...P,[I]:A}));};return jsx(ClickAwayListener,{onClickAway:A=>{A.stopPropagation(),r$1(A);},children:jsxs(Yn,{id:s,"data-testid":"StatusFilter",ref:u,tabIndex:-1,onKeyDown:w,children:[jsxs(R,{open:a,anchorEl:e,children:[jsx(a$7,{component:"span",children:p("filterBy")}),t.map(({value:A,label:P})=>jsxs(V,{onClick:M=>{x(M.currentTarget);},onMouseOver:M=>{S(M,A);},sx:{minHeight:"35px",padding:"8px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}},startAdornment:null,children:[jsx(Yn,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:P}),jsx(Yn,{component:"img",src:xb,width:16,height:12,sx:{marginLeft:"auto"}})]},A)),jsxs(b$c,{children:[jsx(d$4,{onClick:C,children:p("cancel")}),jsx(c$4,{onClick:T,children:p("okay")})]})]}),jsx(Popper,{open:!!f,anchorEl:f,placement:"right-start",onMouseLeave:d,children:jsx(Yn,{sx:{backgroundColor:"#fff",borderEndEndRadius:"8px",border:"1px solid #F2F2F2"},children:jsx(g,{options:[{value:"all",label:"All"},{value:"enabled",label:"Enabled"},{value:"disabled",label:"Disabled"}],value:c[I||""],onOptionChange:h,sx:A=>({[`& .${a$8.item}:hover`]:{boxShadow:A.v2.elevation[200]}})})})})]})})}var dv=styled$1(j)(()=>({fontSize:"11px"})),Ox=styled$1(Yn)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),_x=styled$1(Yn)(({theme:e})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"flex-end",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${e.palette.divider}`})),zx=styled$1(b)(()=>({minWidth:"auto",width:70})),$x=styled$1(b)(()=>({minWidth:"auto",width:70})),Ux=styled$1(Yn)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),ep=styled$1(dv)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),Gx=styled$1(Yn)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),Yx=styled$1(Yn)(({theme:e})=>({...a(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),jx=styled$1(ep)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),Kx=styled$1(b,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:t})=>{let{brand:o}=t.v2.palette;return {fontSize:"11px",fontWeight:t.v2.typography.fontWeightMedium,padding:t.v2.spacing(8),width:"100%",height:32,justifyContent:"space-between",gap:t.v2.spacing(4),...e&&{borderColor:o[500],boxShadow:"0px 0px 4px 0px rgba(31, 136, 208, 0.50)"}}});function Xx({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,timezone:r$1,browserTimezone:i,defaultCountryTimezone:l,onTimezoneChange:a,timezoneCountriesCodes:s=[],onConfirm:p,onCloseDropdown:c}){let m=Bc(useId(),"date-filter"),{t:u}=useTranslation(),f=useRef(null),x=()=>p(e),I=r(x,c),b=y=>{t(y),requestAnimationFrame(()=>f.current?.focus());},S=y=>{x(),c(y);},d$1=useCallback(y=>n(y),[n]),C=y=>{if(!y)return "";let[w,T]=y,h=$u(w).format("MMM D"),A=$u(T).format("MMM D");return h===A?h:`${h} - ${A}`};return jsxs(Yx,{ref:f,tabIndex:-1,onKeyDown:I,id:m,"data-testid":"DateFilter",children:[jsxs(Ux,{children:[jsx(Gx,{children:jsx(ep,{component:"span",children:u("filterBy")})}),jsx(Ox,{children:jsx(a$4,{defaultDate:e||q(0),onDateChange:b,maxDateRange:365,mode:o,onCalendarModeSwitch:d$1,browserTimezone:i,defaultCountryTimezone:l,timezone:r$1,onChangeTimezone:a,timezoneCountriesCodes:s,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(y,w)=>jsxs(Kx,{variant:"secondary",size:"md",fullWidth:true,open:y,onClick:w,children:[jsx("span",{children:C(e)||"Date"}),jsx(d,{src:ek,alt:"selected",sx:{width:16,height:16}})]})},C(e))}),e&&jsx(jx,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs(_x,{children:[jsx($x,{variant:"secondary",size:"md",onClick:c,children:u("cancel")}),jsx(zx,{variant:"primary",size:"md",onClick:S,children:u("okay")})]})]})}var Zx=styled$1(Yn)(()=>({maxHeight:"210px",maxWidth:"177px",overflowY:"auto",padding:0})),Jx=styled$1(V)(()=>({padding:"12px 16px",border:"none !important","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},maxHeight:35,minHeight:35})),Qx=styled$1(Yn)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),eh=styled$1(Yn)(({theme:e})=>({color:alpha(e.palette.text.primary,.5),fontSize:"9px"})),th=styled$1(Yn)(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"120px"})),oh=styled$1(R)(()=>({marginBottom:"8px"}));function ih({anchorEl:e,onCloseDropdown:t,list:o,apiKey:n,placeholder:r$1,onConfirm:i,onClear:l,onClickItem:a,inputValue:s,onInputValueChange:p,selectedListItems:c}){let m=Bc(useId(),"list-column-filter"),{t:u}=useTranslation(),f=()=>i(),x=r(f,t),I=h=>{f(),t(h);},b=h=>{l?.(),t(h);},S=!!s.trim().length,d=()=>{S&&p("");},C=h=>{p(h);},y=useMemo(()=>S?o?.filter(h=>h.name.toLowerCase().includes(s.trim().toLowerCase())):o,[s,S,o]),w=S&&!y.length||!o.length,T=useMemo(()=>new Set(c),[c]);return jsxs(oh,{id:m,"data-testid":"ListColumnFilter",open:!!e,anchorEl:e,onKeyDown:x,children:[jsx(a$7,{component:"span",children:u("filterBy")}),!!o?.length&&jsx(Box,{sx:{padding:"8px 16px"},children:jsx(b$5,{fullWidth:true,value:s,name:n,placeholder:r$1,onChange:h=>C(h.target.value),onClear:d})}),jsx(Zx,{children:w?jsx(Box,{sx:{p:1,textAlign:"center",fontSize:"11px"},children:"No data available"}):y?.map((h,A)=>jsx(Jx,{isSelected:T.has(h?.id),onClick:()=>{a(h?.id);},children:jsxs(Qx,{children:[jsx(th,{children:h.name}),jsx(eh,{component:"span",children:h.id})]})},`${h.id}-${A}`))}),jsxs(b$c,{children:[jsx(d$4,{onClick:b,children:u("cancel")}),jsx(c$4,{onClick:I,children:u("okay")})]})]})}var ah="os-shared-VerificationIcon",aa={root:`${ah}-root`,img:`${ah}-img`},lh=(a=>(a.Verified="verified",a.Reviewed="reviewed",a.Completed="completed",a.Incomplete="incomplete",a.Rejected="rejected",a.Closed="closed",a.Archived="archived",a))(lh||{});var la={verified:Jj,reviewed:Hj,completed:Gj,incomplete:Ij,rejected:Kj,closed:Lj,archived:Mj},sa={verified:"#2ACE0029",reviewed:"#11D0FA29",completed:"#11D0FA29",incomplete:"#D9D9D929",rejected:"#FF3D0029",closed:"#D9D9D929",archived:"#D9D9D929"};var bv=2.3,sh=styled$1("span",{shouldForwardProp:e=>!["$variant","$bgColor","$size"].includes(e)})(({$variant:e="default",$bgColor:t,$size:o=10.5})=>{let n=Math.round(o*bv);return {display:"inline-flex",alignItems:"center",justifyContent:"center",...e==="circle"&&{width:`${n}px`,height:`${n}px`,borderRadius:"50%",backgroundColor:t||"#D9D9D929"}}});var ph=forwardRef(({className:e,sx:t,icon:o,label:n,variant:r="default",size:i=10.5,width:l,height:a,...s},p$1)=>{let c=la[o]||la.incomplete,m=sa[o]||sa.incomplete,u=n===null?"":n||sf(o),f=l??i,x=a??i,I=jsx(sh,{ref:p$1,className:nc(aa.root,e),sx:t,"data-testid":"VerificationIcon",$variant:r,$bgColor:m,$size:i,...s,children:jsx("img",{className:aa.img,loading:"lazy",src:c,alt:u||o,width:f,height:x})});return n===null?I:jsx(p,{title:u,wrapperProps:{display:"inline-flex"},children:I})});ph.displayName="VerificationIcon";var vv=memo(ph);function Lv({voidPercentage:e,capturePercentage:t,captureCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:l,isTextShown:a,remainingAmount:s,isSheetViewShown:p$1,selectionProps:c={}}){let m=Number(t)+Number(e)===100||s<=0,u=Bc(useId(),"capture-auto-icon"),f=useTheme(),{t:x}=useTranslation(),I=Ja$1(s||0),b=useCallback(w=>`Auto ${w} - ${l} ${I.integerAmount}.${I.decimalAmount}`,[l,I.decimalAmount,I.integerAmount]),S=useCallback(w=>{let T=w==="Capture"?r:i,{integerAmount:h,decimalAmount:A}=Ka(T,l);return `Partial ${w} - ${l} ${h}.${A}`},[r,i,l]),d=t>0?jsx(p,{title:S("Capture"),children:jsxs(_r,{isCapture:true,isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:f.shadows[4]}},children:[jsx(Ur,{src:vb,alt:"captured"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(zr,{isCapture:true,percentage:t,children:[t,"% ",jsx($r,{isCapture:true,percentage:Gr(t)})]}),o>1&&jsxs(z,{compact:true,color:"dark",children:[o,"x"]})]})]})}):n==="CAPTURED"&&!m?jsx(p,{title:b("Capture"),children:jsx(to,{children:jsx(Mt,{src:Qo.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:b("Capture"),children:jsx(to,{children:jsx(Mt,{src:Qo.CAPTURED?.icon,alt:"auto"})})}),C=t===100?jsx(p,{title:x("captured"),children:jsx(Id,{children:jsx(Mt,{src:ik,alt:"captured"})})}):d,y=useMemo(()=>p$1&&C?jsx(b$1,{copyTrigger:"press",copyText:x("captured"),children:x("captured")}):a&&C?jsx(hd,{children:x("captured")}):C,[a,C,p$1,x]);return y&&jsx("div",{id:u,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:y})}var mh=Lv;function Wv({voidPercentage:e,capturePercentage:t,voidCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:l,isTextShown:a,isSheetViewShown:s,selectionProps:p$1={},remainingAmount:c}){let m=Number(t)+Number(e)===100||c<=0,u=Bc(useId(),"void-auto-icon"),f=useTheme(),{t:x}=useTranslation(),I=Ja$1(c||0),b=useCallback(w=>`Auto ${w} - ${l} ${I.integerAmount}.${I.decimalAmount}`,[l,I.decimalAmount,I.integerAmount]),S=useCallback(w=>{let T=w==="Capture"?r:i,{integerAmount:h,decimalAmount:A}=Ka(T,l);return `Partial ${w} - ${l} ${h}.${A}`},[r,i,l]),d=e>0||i?jsx(p,{title:S("Void"),children:jsxs(_r,{isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:f.palette.common.white,border:`0.75px solid ${f.palette.grey[600]}1A`},variants:{animate:{boxShadow:f.shadows[4]}},children:[jsx(Ur,{src:zk,alt:"void"}),jsxs(motion.div,{style:{display:"none",alignItems:"center",justifyContent:"center",gap:"4px"},initial:{width:0,opacity:0},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex"},fadeIn:{transition:{delay:.5},opacity:1}},children:[jsxs(zr,{percentage:e,children:[e,"% ",jsx($r,{percentage:Gr(e)})]}),o>0&&jsxs(z,{compact:true,color:"neutral",children:[o,"x"]})]})]})}):n==="VOID"&&!m?jsx(p,{title:b("Void"),children:jsx(to,{children:jsx(Mt,{src:Qo.VOID?.icon,alt:"auto"})})}):null,C=e===100?jsx(p,{title:x("void"),children:jsx(to,{children:jsx(Mt,{src:zk,alt:"void"})})}):d,y=useMemo(()=>s&&C?jsx(b$1,{copyTrigger:"press",copyText:x("void"),children:x("void")}):a&&C?jsx(yd,{children:x("void")}):C,[a,C,s,x]);return y?jsx("div",{id:u,"data-testid":"VoidAutoIcon",style:{...!s&&{zIndex:11}},children:y}):null}var uh=Wv;var Fv=mh;var zv=({authorizedStatus:e,isTextShown:t,iconStyles:o,tableMode:n,chipIndex:r=0,selectionProps:i={}})=>{let{t:l}=useTranslation(),a=useTheme(),s=l(wt(e));return Ya(n)?jsx(b$1,{copyTrigger:"press",copyText:s,children:s}):jsx(p,{title:s,children:t?jsx(H,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:a.palette.info.dark},children:s}):jsx(d,{src:f$2[e],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:o})})};var fh=styled$1(motion.span)(({theme:e})=>({color:e.palette.common.white,display:"block",fontWeight:e.typography.fontWeightBold,fontSize:"9.78px",borderRadius:"4px",paddingInline:e.spacing(.45)})),gh=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),np=styled$1("img")(()=>({width:"10px",height:"10px"})),rp=styled$1(motion.span)(({theme:e})=>({width:"18px",height:"18px",borderRadius:"50%",backgroundColor:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,position:"relative"})),ip=styled$1(motion.div,{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",width:"0",overflow:"hidden",opacity:0,...!e&&{padding:"0 !important"}})),Ch=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),xh=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),hh={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},yh={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},Ih={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},bh={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},ap={fadeIn:{duration:.3},animate:{duration:.1}},Sh={fadeIn:{opacity:1}},Th=styled$1(H)(()=>({width:"88px",height:"100%"})),lp=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.25),height:"100%"}));function Xe({chargeStatus:e,gatewayTooltip:t,acquirerTooltip:o,chargeTooltip:n,errorCode:r,isTextShown:i,gatewayCode:l,acquirerCode:a,unCapturedStyles:s,iconStyles:p$1,iconWrapperStyles:c,gatewayIconWrapperStyles:m,gatewayContainerStyles:u,gateWayIconStyles:f,showBadge:x=true,isSheetViewShown:I=false,selectionProps:b={},chipIndex:S=0}){let d=e?b$d[e]:null,C=e?g$1[e]:null,y=useTheme(),{t:w}=useTranslation(),T=Bc(useId(),"charge-status-icon"),h=n&&jsx(Fragment,{children:jsx("div",{children:n})}),A=o&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:o})]}),P=t&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:t})]}),M=e&&a$6[e]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:d?"50%":"",...c},children:jsx(U,{src:a$6[e],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:d?"50%":"",width:"16px",height:"16px",...p$1}})});return I?jsxs(lp,{children:[jsxs(b$1,{copyTrigger:"press",copyText:w(wt(e)),children:[w(wt(e))," ",r]}),d&&jsxs(Fragment,{children:[l&&jsxs(b$1,{copyTrigger:"press",copyText:"Gateway",children:["Gateway ",l]}),a&&jsxs(b$1,{copyTrigger:"press",copyText:"Acquirer",children:["Acquirer ",a]})]})]}):i?jsxs(lp,{children:[jsx(p,{title:h,children:jsxs(Th,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:d?.background||C?.background||"transparent",color:d?.color||C?.color||y.palette.info.dark,borderColor:`${d?.color||C?.color||y.palette.info.dark}1A`},children:[w(wt(e))," ",r]})}),d&&jsxs(Fragment,{children:[l&&jsx(p,{title:P,children:jsxs(H,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:d?.background||C?.background||"transparent",color:d?.color||C?.color||y.palette.info.dark},children:["Gateway ",l]})}),a&&jsx(p,{title:A,children:jsxs(H,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:d?.background||C?.background||"transparent",color:d?.color||C?.color||y.palette.info.dark},children:["Acquirer ",a]})})]})]}):jsx(Ie,{id:T,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...c},children:Pn?.includes(e||"")&&(h||A||P)?jsxs(xh,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...x&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...s},children:[jsx(Ch,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:d?.background}},children:jsx(p,{title:h??w(wt(e)),children:jsxs(Fragment,{children:[M,jsx(gh,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:bh,style:{...r&&{padding:"0 !important"}},children:jsx(fh,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:d?.color},transition:hh,variants:Sh,initial:{opacity:0},children:r})})]})})}),jsx(ip,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:ap,variants:yh,style:u,isVisible:!!P,children:P&&jsx(p,{title:P,children:jsx(rp,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:d?.background,...m},children:jsx(np,{src:d?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:f})})})}),jsx(ip,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:ap,variants:Ih,style:u,isVisible:!!A,children:A&&jsx(p,{title:A,children:jsx(rp,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:d?.background,...m},children:jsx(np,{src:d?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:f})})})})]}):jsx(p,{title:h??w(wt(e)),children:jsx(Ie,{children:M})})})}var qv=()=>{let{t:e}=useTranslation(),t=Bc(useId(),"customer-initiated-icon");return jsx(p,{title:e("merchantInitiated"),children:jsx("img",{id:t,"data-testid":"merchantInitiatedIcon",src:wb$1,alt:"merchant",style:{width:"16px",height:"16px"}})})};var Xv={G:"Global",R:"Regional",L:"Local"},kt=({geographyVariant:e,countryCode:t,isTextShown:o})=>{let n=e?Xv[e]:void 0,r=n||t?`${n||""} ${n&&t?"-":""} ${t?`Country - ${t}`:""}`:void 0;return o||!t?null:jsx(p,{title:r,children:jsx(b$2,{countryCode:t})})};var Qv=({geographyVariant:e,isTextShown:t,deviceCountry:o,deviceType:n,tableMode:r})=>{let i=Bc(useId(),"device-icon-chip");return jsxs(Yn,{id:i,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...Ya(r)&&{height:"18px"}},children:[jsx(kt,{geographyVariant:e,isTextShown:t,countryCode:o}),jsx(c$2,{type:n,isTextShown:t,tableMode:r})]})};var oA=({isDisputeOpen:e,iconStyles:t})=>{let o=Bc(useId(),"dispute-icon");return jsx(U,{id:o,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:e?va:ua,alt:"dispute-icon",style:t})};var Eh=styled$1(Yn,{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",gap:e.spacing(.5),...Ya(t)&&{height:"18px"},alignItems:"center"})),Mh=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function pp({countryCode:e,isTextShown:t,cardNumber:o,bankName:n,tableMode:r}){let i=Bc(useId(),"issuer-icon"),l=o?.slice(0,4),a=o?.slice(-4);return jsxs(Eh,{id:i,"data-testid":"IssuerIcon",tableMode:r,children:[e&&jsx(kt,{countryCode:e,isTextShown:t}),jsx(p,{title:`${n?`Issuer - ${n}`:""}`,children:jsx(Mh,{children:`${l||""} ${a||""}`})})]})}var lA=pp;var mA=({payoutStatus:e="PENDING",isTextShown:t,payoutTooltip:o,iconStyles:n,isSheetViewShown:r,chipIndex:i=0,selectionProps:l={}})=>{let{t:a}=useTranslation(),s=Bc(useId(),"payout-icon"),p$1=a(wt(e)),c=o||p$1;return r?jsx(b$1,{copyTrigger:"press",copyText:p$1,children:p$1}):jsx(p,{title:c,children:t?jsx(wi,{id:s,"data-testid":"StatusCell_PayoutStatusLabel",children:p$1}):jsx(U,{id:s,src:e$1[e],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:n})})};var CA=({isTextShown:e,refundStatus:t="PENDING",refundTooltip:o="",refundCount:n,iconStyles:r,isSheetViewShown:i,chipIndex:l=0,selectionProps:a={}})=>{let{t:s}=useTranslation(),p$1=useTheme(),c=Bc(useId(),"refund-icon"),m=(n||0)>1,u=s(wt(t));if(i)return jsxs(b$1,{copyTrigger:"press",copyText:u,children:[u," ",m?`${n}x`:null]});let f=jsxs(Bd,{"data-testid":"StatusCell_RefundsCountBadge",initial:{width:0,opacity:0,padding:"0px"},transition:{animate:{duration:.5},fadeIn:{duration:.2}},variants:{animate:{width:"auto",display:"flex",padding:"1.285px 2.569px"},fadeIn:{transition:{delay:.5},opacity:1}},children:[n,"x"]});return e?jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:jsx(wi,{id:c,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:d$5[t].color,backgroundColor:d$5[t].backgroundColor,width:"90px"},children:jsxs(ol,{whileInView:m?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[u," ",m?f:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:m?jsxs(ol,{id:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[jsx(kd,{src:rk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),f]}):jsx(U,{id:c,src:c$5[t],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:r})})},Dh=CA;var xA=Dh;var hA={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},de=e=>hA[e?.toLowerCase()||""]||e;styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var Lh=styled("img")(()=>({maxWidth:"24px",maxHeight:"16px"}));styled(motion.span,{shouldForwardProp:e=>e!=="sourcesCount"})(({theme:e,sourcesCount:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minWidth:`${t*6+36}px `,minHeight:"24px",cursor:"pointer",backgroundColor:e.palette.background.paper,borderRadius:"16px"}));var Rh=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),kh=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%"}));styled("span")(({theme:e})=>({position:"absolute",left:0,zIndex:6,border:`1px solid ${e.palette.divider}`,borderRadius:"12px",backgroundColor:e.palette.background.paper,width:"36px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center"}));var Bh=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function _e({source:e,isTextShown:t,title:o,width:n,height:r,imgSx:i}){let{t:l}=useTranslation(),a=h(e);return jsx(p,{title:o,children:t?jsx(kh,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(Rh,{"data-testid":"SourceCell_TextLabel","data-source":e,children:l(wt(e))})}):jsx(Lh,{src:a,alt:e,width:n,height:r,onError:s=>{s.currentTarget.src=h("card");},sx:i})})}function AA({payment:e,card:t,isTextShown:o,firstIcon:n}){let r=Bc(useId(),"source-icons"),{t:i}=useTranslation(),l=useCallback(()=>{let p=[],c=ec(e),m=e?.method,u=e?.scheme;return de(m)?.toLowerCase()===de(u)?.toLowerCase()?p.push(de(m),de(c)):p.push(de(m),de(c),de(u)),p},[e]),a=useMemo(()=>jsx(_e,{source:n,isTextShown:o,title:i(wt(n))},n),[n,o,i]),s=useMemo(()=>l()?.filter(p=>!!p&&p!==n)?.map((p,c,m)=>{let u=e?.wallet===i("sv_wallet")?i("storedValueWallet"):i("passThruWallet"),f=c===m.length-1&&t?.last_four?`${i(wt(p))} - ${t?.last_four}`:i(wt(p));return jsx(_e,{source:p,isTextShown:o,title:c===0&&p==="Wallet"?u:f},`${p}-${c}`)}),[l,e,t,o,i,n]);return jsxs(Box,{id:r,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[n&&a,s,t?.last_four&&jsxs(Bh,{children:["\xB7\xB7\xB7 ",t?.last_four]})]})}var jn={PROCESSED:Ug$1,FAILED:""};var Fh=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Hh=styled("img")(()=>({width:"16px",height:"16px"})),Oh=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function Ci({status:e,isTextShown:t,isSheetViewShown:o}){let n=useTheme$1(),{t:r}=useTranslation(),i=Bc(useId(),"destination-icon"),l=r(wt(e));return o&&jn[e]?jsx(b$1,{copyTrigger:"press",copyText:l,children:l}):t&&jn[e]?jsx(Fh,{id:i,"data-testid":"ChargeStatusIcon_isTextShown","data-status":wt(e),sx:{background:"#1F88D00D",color:e==="PROCESSED"?n.palette.info.dark:n.palette.common.black},children:l}):jsx(Oh,{id:i,"data-testid":"DestinationIcon",className:"destination-status",children:e&&jn[e]&&jsx(p,{title:r(wt(e)),children:jsx(Hh,{src:jn[e],alt:"destination-icon"})})})}
|
|
2
2
|
export{oA as $,NT as $a,zi as $b,Pd as A,jb as Aa,Fi as Ab,cx as Ac,tl as B,Jb as Ba,Ql as Bb,Xs as Bc,qr as C,Qb as Ca,Hi as Cb,wx as Cc,ZE as D,nS as Da,Ww as Db,Px as Dc,oo as E,iS as Ea,Ro as Eb,Dx as Ec,no as F,pS as Fa,Rn as Fb,q1 as Fc,Hy as G,uS as Ga,os as Gb,X1 as Gc,zy as H,hS as Ha,kn as Hb,Gn as Hc,Gy as I,bS as Ia,ns as Ib,Lx as Ic,qy as J,vS as Ja,rs as Jb,kx as Jc,Jy as K,yi as Ka,is as Kb,rv as Kc,tI as L,xW as La,as as Lb,Nx as Lc,ln as M,Ju as Ma,le as Mb,Hx as Mc,il as N,WW as Na,ls as Nb,Xx as Nc,nL as O,$S as Oa,ss as Ob,ih as Oc,II as P,YS as Pa,ps as Pb,aa as Pc,vI as Q,XS as Qa,cs as Qb,lh as Qc,Jh as R,xf as Ra,ts as Rb,la as Rc,ty as S,oT as Sa,Bn as Sb,sa as Sc,oy as T,Mf as Ta,Fw as Tb,vv as Tc,uh as U,CT as Ua,ms as Ub,Fv as V,xT as Va,ds as Vb,zv as W,IT as Wa,us as Wb,Xe as X,TT as Xa,wC as Xb,qv as Y,Bf as Ya,Oi as Yb,kt as Z,kT as Za,_i as Zb,Qv as _,VT as _a,Hw as _b,v as a,lA as aa,WT as ab,Ow as ac,fd as b,mA as ba,Xf as bb,fs as bc,Jo as c,xA as ca,Jf as cb,gs as cc,ct as d,de as da,lg as db,Cs as dc,kP as e,_e as ea,fg as eb,vC as ec,gd as f,AA as fa,ZT as fb,_w as fc,BP as g,Ci as ga,nw as gb,zw as gc,Cd as h,MI as ha,lw as hb,$w as hc,xd as i,BI as ia,Mg as ib,xs as ic,H as j,FI as ja,Wg as jb,$i as jc,hd as k,zI as ka,Cw as kb,Ui as kc,yd as l,mR as la,n3 as lb,ko as lc,Hr as m,KI as ma,W as mb,ws as mc,we as n,ZI as na,Le as nb,As as nc,Ie as o,nb as oa,Ni as ob,Ps as oc,U as p,lk as pa,kw as pb,Es as pc,Or as q,uk as qa,Zl as qb,Ls as qc,mt as r,yk as ra,Bw as rb,Rs as rc,tn as s,vk as sa,Vw as sb,Fn as sc,Sd as t,Rk as ta,Nw as tb,qC as tc,Sy as u,wb as ua,Wi as ub,Fs as uc,vy as v,Pb as va,_t as vb,f1 as vc,My as w,Cu as wa,Re as wb,Hs as wc,Ry as x,hu as xa,bC as xb,Os as xc,Kr as y,$b as ya,Ln as yb,_s as yc,Ad as z,Gb as za,Jl as zb,h1 as zc};
|