@tap-payments/os-micro-frontend-shared 0.3.302 → 0.3.303-test.1795085783
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-DOK4RXSY.js → chunk-4XVL7XMK.js} +1 -1
- package/build/_chunks/{chunk-F537SQRQ.js → chunk-6KMLSV4C.js} +1 -1
- package/build/_chunks/{chunk-TZZV6XFT.js → chunk-6XJ2WMEL.js} +1 -1
- package/build/_chunks/{chunk-S3EORDGB.js → chunk-PHHMAYQ6.js} +1 -1
- package/build/_chunks/{chunk-JSTCL624.js → chunk-Z3NFOUSJ.js} +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Window/index.js +1 -1
- package/build/components/WindowServices/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/modules/JSONViewWindow/index.js +1 -1
- package/build/components/modules/VirtualTables/index.js +1 -1
- package/build/components/modules/WindowShell/index.js +1 -1
- package/build/components/modules/index.js +1 -1
- package/build/datetime/components/DateRangeFilter/DateRangeFilter.d.ts +3 -2
- package/build/datetime/components/DateRangeFilter/style.d.ts +9 -0
- package/build/datetime/components/index.js +1 -1
- package/build/index.js +1 -1
- package/build/types/apps.d.ts +12 -25
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-JSTCL624.js';import {b as b$4,h,c,j as j$1,i}from'./chunk-NR5II44J.js';import {b as b$6}from'./chunk-VYVRCIYJ.js';import {a as a$1}from'./chunk-BFBJOTG2.js';import {a as a$2}from'./chunk-UF4J7JEY.js';import {b as b$7}from'./chunk-LVK5VG43.js';import {b as b$1}from'./chunk-LJWTINBT.js';import {b as b$5}from'./chunk-W77B5KVI.js';import {b as b$8}from'./chunk-26OK5BYP.js';import {d as d$1}from'./chunk-6LO7PI3V.js';import {c as c$1}from'./chunk-PEOYN7GO.js';import {b as b$2}from'./chunk-LZKPVI6B.js';import {b as b$3}from'./chunk-OHT5KJVT.js';import {b as b$a}from'./chunk-PNLHCTCW.js';import {b as b$9}from'./chunk-N57Z6DIM.js';import {t,p,z,j,b,D,d,R,B,v as v$1,V as V$1,f}from'./chunk-6ZPNLCMN.js';import {n,u,y as y$1}from'./chunk-IXFXTDH7.js';import {l,p as p$1}from'./chunk-JY4U45C5.js';import {Vb as Vb$1,Ab,qa as qa$1,Hb,fa,Ya as Ya$1,Xa as Xa$1,Wa,xa,Ra,Sa,Ua,Va,Ta,ub,W,ca,Z,ba,zb as zb$1,pa,yb as yb$2}from'./chunk-MMXWSV6V.js';import {v,m,b as b$b,r}from'./chunk-53X3U5WT.js';import {Cb,zb,Bb,Xd,Fj,rc,Ei as Ei$1,Ci as Ci$1,Di as Di$1,Eh,Pg,Vh,Ve,ik,ja as ja$1,Ak,rk,F,E,jc,kc,hc,ma,Ll as Ll$1,Eb,Fb as Fb$1,Gb,C,Zj,Dh,yb as yb$1,im as im$1,xb as xb$1,Hb as Hb$1,gh,lh,mh,jh,ih,dh,eh,fh,bh,ch,nh,T,zi,Bi,Ai as Ai$1,yi,Fi as Fi$1,Wg,Rj,Sj,H,no,G,wb as wb$1,z as z$1,cp,da,ca as ca$1,na,tk,Ck,uk,kk,mk,xk,zk,sk,pk,qk,Pn as Pn$1,cc,dc,Rh,vk,Bk,jk,Oh,oh as oh$1,zh as zh$1,yh,xh,wh,vh,uh,th as th$1,sh,rh,qh,ph,Yh as Yh$1,Wh,Xh as Xh$1,$h as $h$1,_h as _h$1,de,_d,ce,Hn,Fn,vi as vi$1,qb as qb$1,$d as $d$1,wn as wn$1,ae,rb as rb$1,Gh as Gh$1,Fh,Ih,Kh,Jh as Jh$1,Lh,wk,me,vf as vf$1,uf as uf$1,tf as tf$1,sf as sf$1,rf as rf$1,wf as wf$1,qf,Ba,Aa,nf as nf$1,mf as mf$1,lf as lf$1,hi as hi$1,gi,ji,ii,ki,ak,_j,$j,Kj,Ij,Jj,Tb,Pm as Pm$1,Mm as Mm$1,Hm,Im as Im$1,Om,Am as Am$1,Qm,Bm as Bm$1,Rm as Rm$1,Cm,Jm as Jm$1,Em as Em$1,Gm as Gm$1,Nm as Nm$1,Fm,ym as ym$1,Km as Km$1,Lm as Lm$1,zm as zm$1,Dm as Dm$1,xm,wm as wm$1,vm as vm$1,um as um$1,tm as tm$1,$g as $g$1,Xk,fk,vb,gk,hk,ub as ub$1,nk,sb,ok,va as va$1,ua,h as h$1,Vg,oo as oo$1}from'./chunk-VRGBJY4Q.js';import is,{forwardRef,useId,memo,useState,useEffect,useMemo,useCallback,useRef,Fragment as Fragment$1}from'react';import {useTranslation}from'react-i18next';import {styled,Box,Menu,MenuItem,ListItemIcon,ListItemText,Paper,Button,TextField,Typography,Popper,CircularProgress,Link,useTheme as useTheme$1,TableCell}from'@mui/material';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {styled as styled$1,useTheme}from'@mui/material/styles';import qg from'@mui/material/TableCell';import Bn from'@mui/material/Box';import ay from'@mui/material/SvgIcon';import ft from'lodash/camelCase';import $m from'dayjs';import DI from'dayjs/plugin/timezone';import RI from'dayjs/plugin/utc';import eu from'lodash/startCase';import oT from'@mui/material/Popover';import cS from'@mui/material/ClickAwayListener';import iS from'@mui/material/Popper';import IS from'@mui/material/Typography';import RC from'@mui/material/Button';var hr={ORDER:{label:"order",icon:yi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:Ai$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Bi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:zi,color:"#32ADE6"}},Ir={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 br=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Tr=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),Sr=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Hg({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n}){let r=Vb$1(useId(),"agreement-icon"),i=useTheme$1(),{t:a}=useTranslation(),l=useMemo(()=>[...t?[Ir.SAVED_TOKEN]:[],...(o||0)>0?[Ir.COUNT]:[],...e&&hr[e]?[hr[e]]:[]],[t,o,e]),s=m=>n?jsx(Sr,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a("totalPaymentCount",{amount:b$b(o)}),children:jsx(Tr,{children:jsxs(br,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Ir.COUNT.color},children:["x",o]})})})},m):jsx(a$2,{value:o,index:m},m),p$1=l.map((m,f)=>m.label==="countBadge"?s(f):jsx(p,{title:a(m.label),children:jsx(Sr,{children:n?jsx(Tr,{children:jsx(br,{"data-testid":"AgreementCell_agreementType",sx:{color:m.color},children:a(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(Sr,{children:n?jsx(Tr,{children:jsx(br,{"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:Fi$1,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 Kc=Hg;var zg=Kc;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 Xc=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Jc=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 Qc=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var wa={"3DS":{tooltip:"3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:ch,borderColor:"rgba(31, 136, 208, 0.10)"}},ed={FAILED:{tooltip:"Failed",icon:Wg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:dh,borderColor:"rgba(255, 61, 0, 0.10)"}};function $g({transactionStatus:e,eci:t,authType:o,isTextShown:n}){let r=Vb$1(useId(),"auth-icons"),i=useMemo(()=>{let l=e?ed[e]:null,s=l?.tooltip,p=e==="AUTHENTICATED"?null:l?.icon;return [{tooltip:s,content:n?s:p,type:n?"text":"icon"},...o?[{tooltip:o,content:n?wa[o]?.tooltip:wa[o]?.icon,type:n?"text":"icon"}]:[],{tooltip:"",content:t?`ECI ${t}`:"",type:"text"}]},[e,n,o,t]),a=useMemo(()=>i.filter(l=>!!l.content).map((l,s)=>{let p$1=l.type==="text"?jsx(Jc,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Xc,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":l.content,children:l.content})}):jsx(d,{sx:{width:"16px",height:"16px"},src:l.content,alt:l.tooltip});return jsx(p,{title:l.tooltip,children:p$1},`${l.tooltip}-${s}`)}),[i]);return jsx(Qc,{id:r,"data-testid":"AuthIcons",children:a})}var od=$g;var Gg=(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 Yg=od;var nd=styled$1(qg,{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 Jg=forwardRef(({children:e,...t},o)=>{let n=Vb$1(useId(),"table-cell");return jsx(nd,{id:n,component:"div","data-testid":"TableCell",...t,ref:o,children:e})}),y=memo(Jg);var id=styled("span",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:t})=>({display:"flex",width:"17px",height:"12px",backgroundColor:t?Ab(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"}),et=styled(motion.div)(({theme:e})=>({borderRadius:"12px",backgroundColor:e.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5)})),tA=styled("img")(()=>({width:"12px",height:"12px"})),ad=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"})),oA=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})),ld=styled("div")(()=>({display:"flex",width:"24px",height:"24px",alignItems:"center",justifyContent:"center",borderRadius:"64px;",border:"1px solid #F2F2F2;"})),sd=styled(t)(({theme:e})=>({width:24,height:24,fontSize:"8.5px",fontWeight:500,color:e.palette.background.default,border:`1px solid ${e.palette.divider}`})),V=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}`})),pd=styled(V)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:e.palette.info.light,borderColor:e.palette.divider,minWidth:"88px",height:"24px"})),cd=styled(V)(({theme:e})=>({color:e.palette.grey.A700,backgroundColor:`${e.palette.grey.A700}1A`,minWidth:"88px",height:"24px"})),wr=styled(y)(()=>({fontSize:"11px",textAlign:"left",display:"flex",justifyContent:"flex-start",alignItems:"center",overflow:"hidden",gap:"4px",textOverflow:"ellipsis",whiteSpace:"nowrap"})),ye=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ce=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),_=styled("img")(()=>({width:"36px",height:"24px"})),Ar=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"}`})),tt=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:hk},CAPTURED:{icon:gk}};var Pr=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})),vr=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)})),Er=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"}`})),Dr=styled$1("img")({width:"14px",height:"14px"}),eo=styled$1(Ce)({width:"16px",height:"16px"}),bt=styled$1("img")({width:"16px",height:"16px"}),dd=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function Rr(e){return e<5?5:e===100?95:e}var md=styled$1(Bn)({display:"flex",alignItems:"center",gap:"12px"});function ax({value:e,format:t,flagIcon:o,hasFlag:n,tableMode:r,...i}){let a=o&&jsx(p,{title:fa(o||""),children:jsx(b$3,{countryCode:o})}),l=useMemo(()=>v(e,t),[e]);return jsx(y,{...i,children:jsxs(md,{children:[n&&jsx(id,{sx:{visibility:"visible"},className:"geography-box",children:a}),jsx(Box,{sx:{...qa$1(r)&&{fontSize:"11px"}},children:l})]})})}var Zo=ax;function ud({value:e,currentTimezone:t=no.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r$1=false,...i}){let a=m=>r(e,{currentTimezone:t,targetTimezone:m}),l=a(o),s=a(n),p$1=v(s),c=!r$1&&n!==o;return jsxs(Bn,{sx:{display:"flex",gap:"8px"},children:[jsx(Zo,{value:l,...i}),c&&jsx(p,{title:p$1,children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}function dx({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}`,a=jsx(Fragment,{children:o?.map(l=>{let s=l.name||l.description,p=(s?.length||0)>20?`${s?.slice(0,20)}...`:s;return jsx("div",{children:p},l.id)})});return jsx(p,{title:(o||[]).length>1?a:void 0,children:jsx(y,{...n,children:jsx("span",{children:i})})})}var mx=dx;function fx({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(y,{sx:{fontSize:"11px"},...n,children:i})}var Cx=fx;var fd=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Lr=styled$1("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...qa$1(t)&&{fontSize:"11px",color:e.palette.text.primary}})),Cd=styled$1("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),gd=styled$1("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function yx({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i,hideCustomerInitiatedIcon:a,hideTimezoneIcon:l,phone:s,email:p$1,id:c,...m}){let{t:f}=useTranslation(),C=e===false?f("merchantInitiated"):"",g=ub(i),I=i?.split(" ")?.map(b=>b?.[0]?.toUpperCase()).join(""),S=useMemo(()=>W(),[]),A=n&&jsx(p,{title:t,children:jsx(sd,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:S},src:r,alt:r,children:I})}),u=useMemo(()=>[{name:"ID",value:c},{name:"Name",value:i},{name:"Email",value:p$1},{name:"Phone",value:s}],[p$1,s,c,i]),x=useMemo(()=>u.some(({value:b})=>b)?jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:u.map(({name:b,value:T},w)=>T&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${b}`,children:b==="Name"?T:`${b}: ${T}`},`${w}-${T}`))}):null,[u]);return jsx(y,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(fd,{"data-testid":"CustomerCell_StyledCustomerCell",children:[A,jsx(p,{title:x,children:jsx(Lr,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":g,children:t})}),!l&&jsx(Cd,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(gd,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!a&&jsx(p,{title:C,children:jsx(ad,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!C,children:C&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:wb$1,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var hx=yx;function bx({children:e,customerName:t}){let o=ub(t);return jsx(Lr,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var Tx=bx;var kr=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),xd=styled$1("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:qa$1(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),yd=styled$1("span")(({theme:e,tableMode:t})=>({fontSize:qa$1(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),va=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),Vr=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 h1=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:a})=>{let l=ca(t,o),s=ca(n,r),p=ca(i,a);return jsxs(va,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Z[e]:""}),jsxs(va,{children:[e!=="fx"&&jsxs(Vr,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(b$9,{currency:o})," ",l.integerAmount,".",l.decimalAmount]})]}),jsxs(Vr,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(b$9,{currency:r})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(Vr,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(b$9,{currency:a})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var to=({tableMode:e,conversionType:t})=>t?jsx(xd,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var oo=({tableMode:e,amount:t,currency:o})=>jsx(yd,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(b$9,{currency:o,fontSize:10})})," ",jsx(b$a,{amount:t,currency:o,sx:{fontSize:"inherit",fontWeight:"inherit"}})]}):jsx("span",{children:"-"})});var Id="default";function Ex({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(y,{...i,children:jsxs(kr,{children:[jsx(p,{title:n||"",children:jsx(Box,{children:jsx(to,{tableMode:Id,conversionType:e})})}),o&&jsx(p,{title:jsx(b$9,{currency:o}),children:jsx(b$3,{currencyCode:o})}),jsx(p,{title:r,children:jsx(oo,{tableMode:Id,amount:t,currency:o})})]})})}var Dx=Ex;var bd="text";function Mx({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(y,{...i,children:jsxs(kr,{children:[jsx(p,{title:n||"",children:jsx(to,{tableMode:bd,conversionType:e})}),jsx(p,{title:jsx(b$9,{currency:o}),children:jsx("span",{})}),jsx(p,{title:r,children:jsx(oo,{tableMode:bd,amount:t,currency:o})})]})})}var Lx=Mx;var Td="sheet";function Vx({conversionType:e,amount:t,currency:o}){let{integerAmount:n,decimalAmount:r}=ca(t,o);return jsxs(b$1,{copyTrigger:"click",copyText:t?`${n}.${r}`:"-",children:[jsx(to,{tableMode:Td,conversionType:e}),jsx(oo,{tableMode:Td,amount:t,currency:o})]})}var Bx=Vx;var wd=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Ad=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})),Ea=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"})),ro=(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}}),io=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"}})),ao=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}})),lo=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"})),Pd=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var vd=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var so=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>vd(e),[e]),n=useMemo(()=>Object.values(o).filter(Boolean),[o]),r=useMemo(()=>{if(!t)return 0;let i=Object.entries(o).findIndex(([a])=>a===t);return i===-1?Math.floor((n.length-1)/2):i},[o,t,n.length]);return {statusesList:n,centerIconIndex:r}};function Fx({statuses:e,centerIconKey:t,...o}){let{statusesList:n}=so({statuses:e,centerIconKey:t}),r=useTheme(),i=n.length||0;return jsx(y,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(lo,{whileHover:"animate",animate:"start",statusesCount:i,children:n.map((a,l)=>a?jsx(ao,{order:l,variants:ro(l,r.shadows[4],40),children:jsx(io,{children:a})},l):null)})})}var Ox=Fx;function _x({statuses:e,...t}){let{statusesList:o}=so({statuses:e});return jsx(y,{...t,children:jsx(Pd,{sx:{paddingRight:"30px"},children:o.map((n,r)=>jsx(Fragment$1,{children:n},r))})})}var zx=_x;function $x({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r}=so({statuses:e,centerIconKey:t}),i=useTheme(),a=r.length||0,l=o||120;return jsx(y,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(lo,{whileHover:"animate",animate:"start",statusesCount:a,children:r.map((s,p)=>s?jsx(ao,{order:p,variants:ro(p,i.shadows[4],l),children:jsx(io,{isTextShown:true,children:s})},p):null)})})}var Gx=$x;var Zx=styled(Menu)(()=>({zIndex:2e3,".MuiMenu-paper":{borderRadius:4},".MuiMenu-list":{padding:0}})),Xx=styled(MenuItem)(({theme:e})=>({display:"flex",gap:"4px",minHeight:"36px",alignItems:"center",paddingInline:8,"&:hover":{backgroundColor:"transparent",boxShadow:e.shadows[10]}})),Jx=styled(ListItemIcon)(()=>({minWidth:"16px !important"})),Qx=styled(ListItemText)(()=>({".MuiTypography-root":{fontSize:"0.6875rem"}})),Fr=({id:e="ActionMenu",open:t,anchorEl:o,onClose:n,items:r})=>jsx(Zx,{id:e,"data-testid":"ActionMenu",open:t,anchorEl:o,onClose:n,onContextMenu:i=>{i.preventDefault(),n();},children:r.map((i,a)=>jsxs(Xx,{onClick:l=>{i.onClick?.(l);},onContextMenu:i.onContextMenu,children:[i.icon&&jsx(Jx,{children:i.icon}),jsx(Qx,{children:i.label})]},`${i.label}-${a}`))});var Hr=styled$1("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:qa$1(t)?"4px":e.spacing(1),overflow:"visible"})),_r=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}})),Ed=styled$1("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),Se=styled$1(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function Dd({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(Se,{src:jc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(Se,{src:kc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(Se,{src:hc,className:"spinner-loader"},"spinner-icon"):jsx(p,{title:r("moreActions"),children:jsx(Ed,{alt:"more",src:ma,isActive:n},"ellipsis-icon")})}Dd.displayName="ActionIconsVariants";var tn=memo(Dd);var po={GRAY:{icon:Bb,color:"#CFCFCF"},ORANGE:{icon:zb,color:"#FFD503"},RED:{icon:Cb,color:"#FF0000"}},zr={"#CFCFCF":"gray","#FFD503":"orange","#FF0000":"red",gray:"gray",red:"red",orange:"orange"},Ur={flag:E,dispute:F,refund:rk,void:Ak,capture:ja$1,cancel:ik,clock:Ve,reverse:Vh,destination:Pg,invoice:Eh,users:Di$1,brand:Ci$1,clipboard:Ei$1,viewApi:Xd,viewReceipt:rc,delete:Fj};function $r({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),a=!!r,l=(e||[]).filter(g=>g.isShown!==false),s=l.some(g=>g.isLoading),p=l.some(g=>g.isError),c=l.some(g=>g.isSuccess),m=l.length>0||!!n,f=g=>{s||!m||i(g.currentTarget);},C=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:a,filteredActions:l,isAnyActionLoading:s,isAnyActionHasError:p,isAnyActionSuccessful:c,areThereAnyShownActions:m,handleClick:f,handleClose:C,setAnchorEl:i}}var Rd=e=>jsx(ay,{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 Ld=".IDButton-root:not(.IDButton-hoverDisabled):hover &",kd=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",[Ld]:{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}})),Vd=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"},[Ld]:{gridTemplateColumns:"1fr",opacity:1,transition:"grid-template-columns 0.3s ease, opacity 0.3s ease 0.3s"}}));function dy({icon:e=jsx(Rd,{}),id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,className:i,...a}){let{t:l}=useTranslation();return jsx(p,{title:l("copy"),children:jsx(Bn,{className:Hb("IDButton-root",n&&"IDButton-hoverDisabled",i),sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...a,children:jsxs(kd,{className:"IDButton-button",children:[t?jsx(Vd,{className:"IDButton-rowId",children:jsx("span",{children:t})}):null,t?jsx(D,{className:"IDButton-icon",icon:e,text:t,onClick:()=>r?.()}):null]})})})}var La=memo(dy);var Ev=memo(({flag:e,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:a=true,row:l,showJsonViewer:s=true,isTextShown:p$1,showIdButton:c=true,onCopyId:m,rowId:f,onJsonViewClick:C,renderDropdown:g,startSlot:I,...S})=>{let{t:A}=useTranslation(),{open:u,anchorEl:x,filteredActions:b,isAnyActionLoading:T,isAnyActionHasError:w,isAnyActionSuccessful:h,areThereAnyShownActions:P,handleClick:k,handleClose:H,setAnchorEl:K}=$r({actions:t,isDropdownShown:a,onCloseDropdown:i,renderDropdown:g});return jsx(y,{...S,sx:{overflow:"visible",...S.sx},children:jsxs(Hr,{"data-testid":"ActionCell_ActionCellContainer",children:[I,e&&jsx(Fragment,{children:p$1?jsx(p,{title:o,children:jsx(V,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(p,{title:o,children:jsxs(et,{"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(Se,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:po[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:zr[po[e]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),c&&jsx(La,{id:f||l.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:C,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(p,{title:A("jsonViewer"),children:jsx(ld,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Xd,alt:"icon"},"id-icon")})})})}),jsxs(_r,{id:"styled-popover",selected:!!r||u,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":P,sx:{...!P&&{pointerEvents:"none"}},children:[jsx(jo,{onClick:k,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":P,sx:{...!P&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(tn,{isAnyActionLoading:T,isAnyActionHasError:w,isAnyActionSuccessful:h,areThereAnyShownActions:P})})}),r,g?g(x,K):jsx(Fragment,{children:P&&jsx(Fr,{open:u,onClose:H,anchorEl:x,items:b.map(B=>({label:B.label,onClick:N=>{B?.onClick?.(N),B.hasActionMenu||H();},onContextMenu:N=>{B?.onRightClick?.(N),H();},icon:B.customIcon||jsx(Se,{icon:B.icon,src:B.iconSrc??(B.icon&&Ur[B.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${B.label.trim()}`)}))})})]})]})]})})});function yy({flag:e,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:a=true,rowId:l,onJsonViewClick:s,tableMode:p$1,...c}){return jsx(y,{...c,sx:{overflow:"visible"},children:jsxs(Hr,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p$1,children:[e&&jsx(Fragment,{children:i?jsx(p,{title:t,children:jsx(V,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(p,{title:t,children:jsxs(et,{"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(Se,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:po[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:zr[po[e]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),a&&jsx(b$1,{sx:{minWidth:"213px"},children:l||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 hy=memo(yy);function Sy({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:a,anchorEl:l,filteredActions:s,isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:f,handleClick:C,handleClose:g,setAnchorEl:I}=$r({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(y,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(_r,{id:"styled-popover",selected:!!t||a,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":f,sx:{...!f&&{pointerEvents:"none"}},children:[jsx(jo,{onClick:C,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":f,sx:{...!f&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(tn,{isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:f})})}),r?r(l,I):jsxs(Fragment,{children:[t,f&&jsx(Fr,{open:a,onClose:g,anchorEl:l,items:s.map(S=>({label:S.label,onClick:A=>{S?.onClick?.(A),S.hasActionMenu||g();},onContextMenu:A=>{S?.onRightClick?.(A),g();},icon:S.customIcon||jsx(Se,{icon:S.icon,src:S.iconSrc??(S.icon&&Ur[S.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${S.label.trim()}`)}))})]})]})})})}var wy=memo(Sy);function vy({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(y,{...r,children:jsxs(Bn,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(At,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$1,{type:e,isTextShown:o})]})})}var Ey=vy;var Wd=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),Fd=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`})),Od=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 Hd=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 Ly({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let l=useMemo(()=>{if(typeof e=="number")return e;let c=Number(e);return Number.isNaN(c)?void 0:c},[e]),s=l!==void 0?l>0:!!e,p$1=l!==void 0&&l>1;return !s||r?null:jsx(Bn,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsxs(Od,{children:[jsx(Hd,{src:z$1,pointLeft:i==="left"}),p$1&&jsx(Wd,{children:jsx(Fd,{children:e})})]})})})}var ky=Ly;function Ny(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(Bn,{sx:{display:"flex",gap:"4px",alignItems:"center"},...n,children:r.map((i,a)=>{let l=ba(i?.amount||0),s=`${l.integerAmount}.${l.decimalAmount}`;return jsxs(b$1,{copyTrigger:"click",copyText:s,children:[i?.id," | ",jsx(b$9,{currency:i?.currency})," ",s]},i?.id||a)})})}var Wy=Ny;function Hy({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let l=o?.destination||[],s=ba(n||0),p$1=ba(l?.[0]?.amount||0);return !e||r?null:jsx(Bn,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsx(V,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",l?.[0]?.id," - ",jsx(b$9,{currency:l?.[0]?.currency})," ",p$1.integerAmount,".",p$1.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",l?.[0]?.id," - ",jsx(b$9,{currency:l?.[0]?.currency})," ",s.integerAmount,".",s.decimalAmount]})})})})}var _y=Hy;var NE=({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=ba(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(b$9,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(b$9,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var Ud=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"})),$d=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 Gd(e){return e<5?5:e===100?95:e}function Yy({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),a=jsx(b$9,{currency:n}),{integerAmount:l,decimalAmount:s}=ca(o,n),p$1=`${l}.${s}`,c=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",a," ",p$1]}),[o,n]);return e===0||o<0?null:jsx(y,{...r,children:jsx(p,{title:c,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(Ud,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs($d,{percentage:e,children:[e,"% ",jsx(Ar,{percentage:Gd(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 jy=Yy;function Ky({remainingAmount:e,currency:t}){let o=jsx(b$9,{currency:t}),{integerAmount:n,decimalAmount:r}=ca(e,t),i=`${n}.${r}`;return jsxs(b$1,{copyTrigger:"click",copyText:`${n}.${r}`,children:[o," ",i]})}var Zy=Ky;var Oa=["authenticationMode","paymentAuth","paymentAgreement"],Ha=["paymentIssuer","paymentInitiated","paymentDevice"],Yd=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...Ha,...Oa];var Kd=styled$1(Bn)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),Zd=styled$1(Bn)(()=>({marginLeft:"8px",width:20}));function th(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let a of Yd)if(e?.[a])return {centerIcon:e?.[a],centerIconId:a};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(b$2,{sx:{justifyContent:"center",zIndex:101},main:t,startItems:Ha.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),endItems:Oa.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),endAdornment:n||r?jsxs(Kd,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}):void 0,startAdornment:i?jsx(Zd,{children:e.paymentType}):void 0})}var oh=memo(th);var Jd=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function LD({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r(ft(zb$1(t,n)?o:n))} - ${e?.last_four}`;return jsx(p,{title:i,children:jsxs(Jd,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}function FD({method:e}){let{t}=useTranslation();return e?jsx(Me,{source:se(e)??e,title:`Payment Method - ${t(ft(e))}`}):null}function $D({type:e}){let{t}=useTranslation();return e?jsx(Me,{source:se(e)??e??"",title:`Payment Type - ${t(ft(e))}`}):null}function ZD({scheme:e}){let{t}=useTranslation();return e?jsx(Me,{source:se(e)??e,title:`Payment Scheme - ${t(ft(e))}`}):null}var nR=({mode:e})=>e?jsx(p,{title:cp[e],children:jsx(Bn,{component:"img",src:e==="C"?da:ca$1})}):null;var Yr={ORDER:{label:"order",icon:yi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:Ai$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Bi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:zi,color:"#32ADE6"}},jr={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 qr=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Kr=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),tm=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"})),om=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),_a=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Zr=(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"}}}),Xr=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Th({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:a}=useTranslation(),l=useMemo(()=>[...t?[jr.SAVED_TOKEN]:[],...(o||0)>0?[jr.COUNT]:[],...e&&Yr[e]?[Yr[e]]:[]],[t,o,e]),s=f=>n?jsx(Xr,{"data-testid":"AgreementCell_countBadge",order:f,variants:Zr(f,n?85:0),children:jsx(p,{title:a("totalPaymentCount",{amount:b$b(o)}),children:jsx(Kr,{children:jsxs(qr,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:jr.COUNT.color},children:["x",o]})})})},f):jsx(a$2,{value:o,index:f},f),p$1=l.map((f,C)=>f.label==="countBadge"?s(C):jsx(p,{title:a(f.label),children:jsx(Xr,{order:C,variants:Zr(C,C>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx(Kr,{children:jsx(qr,{"data-testid":"AgreementCell_agreementType",sx:{color:f.color},children:a(f.label)})}):jsx(_a,{src:f.icon,alt:"agreement"})},f.color)},f.color)),c=p$1.length,m=jsx(p,{title:"No agreement",children:jsx(Xr,{order:0,variants:Zr(0,0),sx:{width:n?"auto":"36px"},children:n?jsx(Kr,{children:jsx(qr,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(_a,{src:Fi$1,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(y,{...r,children:jsx(om,{"data-testid":"AgreementCell",children:jsx(tm,{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 Sh=Th;var rm=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 Ah({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(y,{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(et,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(V,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(rm,{src:na,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var Ph=Ah;var im={REFUNDED:qk,PAID_OUT:pk,SETTLED:sk,PENDING:rk,UNKNOWN:zk,TIMEDOUT:xk,CANCELLED:ik,FAILED:mk,DECLINED:kk,RESTRICTED:uk,IN_PROGRESS:Ck,ACCEPTED:tk},am={REFUNDED:"refunded"};function lm({status:e,refundTooltip:t}){let{t:o}=useTranslation();return jsx(p,{title:jsxs("div",{children:[jsx("div",{children:o(ft(e))}),t]}),children:jsx(Ce,{children:jsx("img",{src:im[e],alt:"refund-requested"})})})}function pm({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,refundTooltip:l}){let{t:s}=useTranslation();return Pn$1?.includes(e??"")?jsx(He,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,iconWrapperStyles:{height:17}}):jsx(lm,{status:e,refundTooltip:l})}var cm=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})),dm=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})),mm=styled$1(Zo)(({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 um=styled$1("img")({width:"14px",height:"14px"}),fm=styled$1(Bn)(({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 za({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r$1,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:l,errorCode:s,acquirerCode:p$1,gatewayCode:c,timezone:m}){let f=useTheme(),{t:C}=useTranslation(),g=r(new Date(Number(r$1)),{currentTimezone:oo$1,targetTimezone:m?.offset}),I=useMemo(()=>t||(e==="REFUNDED"?qk:sk),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(p,{title:jsxs("div",{children:[jsx("div",{children:n??C(am.REFUNDED)}),o]}),children:jsxs(cm,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r$1&&{animate:{boxShadow:f.shadows[4]}}},sx:{...!r$1&&{backgroundColor:"transparent"}},children:[jsx(um,{sx:{...!r$1&&{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$1&&jsx(dm,{children:jsx(mm,{value:g})})})]})}):jsx(pm,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:l,errorCode:s,acquirerCode:p$1,gatewayCode:c})}var gm=()=>{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 _h({status:e,date:t,refundTooltip:o,isTextShown:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a,acquirerCode:l,gatewayCode:s,unCapturedTooltip:p$1,timezone:c,refundTooltipLabel:m,refundIcon:f,...C}){let{t:g}=useTranslation(),I=gm(),S=useCallback(u=>$m(u).format("MMM D, YYYY"),[]),A=Pn$1.includes(e);return jsx(y,{...C,style:{overflow:"visible"},children:jsx(ye,{children:jsx(fm,{width:n?"auto":"36px",sx:{...A&&{border:"none"}},children:n?jsx(p,{title:t?S(t):g(ft(e)),children:jsx(V,{sx:{...I[e]?I[e]:I.PENDING},children:g(ft(e))})}):jsx(za,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p$1,acquirerTooltip:i,errorCode:a,acquirerCode:l,gatewayCode:s,timezone:c,refundTooltipLabel:m,refundIcon:f})})})})}var zh=_h;var ym=styled("img")(()=>({width:"16px",height:"16px"})),hm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Im=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`})),bm=styled("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function Uh({walletId:e,country:t,showCountry:o=true,...n}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(hm,{children:[o&&t&&jsx(p,{title:fa(t),children:jsx(b$3,{countryCode:t})}),jsxs(Im,{children:[jsx(ym,{src:cc,alt:"wallet-icon"}),e&&jsxs(bm,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var $h=Uh;var Tm=styled("img")(()=>({width:"16px",height:"16px"})),Sm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),wm=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}`})),Am=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 Gh({walletId:e,country:t,name:o,...n}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Sm,{children:[t&&jsx(p,{title:fa(t),children:jsx(b$3,{countryCode:t})}),jsxs(wm,{children:[jsx(Tm,{src:dc,alt:"bank-icon"}),e&&jsxs(Am,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var Yh=Gh;var Ga={PAID_OUT:pk,SETTLED:vk,PENDING:Rh,INITIATED:Rh,FAILED:mk};function Zh({payoutStatus:e="PAID_OUT",...t}){let{t:o}=useTranslation(),n=useTheme();return jsx(y,{...t,children:jsx(ye,{children:jsx(Ce,{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&&Ga[e]&&jsx(p,{title:o(ft(e)),children:jsx(_,{src:Ga[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var Xh=Zh;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 Jh=styled$1("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var ke={ABANDONED:Oh,IN_PROGRESS:Ck,VOID:Ak,CANCELLED:ik,CAPTURED:jk,INITIATED:Ck,FAILED:mk,DECLINED:kk,RESTRICTED:uk,TIMEDOUT:xk,UNKNOWN:zk,AUTHORIZED:Bk},oi={UNKNOWN:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FF7A00",background:"#FF7A001A"},TIMEDOUT:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FF7A00",background:"#FFF3E5"},FAILED:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FF7A00",background:"#FFF3E5"},DECLINED:{gatewayIcon:ok,acquirerIcon:sb,color:"#FF3D00",background:"#FFEAE5"},RESTRICTED:{gatewayIcon:ok,acquirerIcon:sb,color:"#FF3D00",background:"#FFEAE5"},ABANDONED:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FFD600",background:"#FFFBE5"},CANCELLED:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FFD600",background:"#FFFBE5"},INITIATED:{color:"#8D8D94",background:"transparent",gatewayIcon:nk,acquirerIcon:ub$1}},Pm={PENDING:rk,REFUNDED:qk},Ya={PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},REFUNDED:{color:"#4E1FD0",backgroundColor:"#4E1FD00D"}},dn={PAID_OUT:pk,SETTLED:vk,PENDING:wk},Et={AUTHORIZED:Bk},vm={CAPTURED:{color:"#1F88D0",background:"#1F88D00D"}};var ja=ke;function tI({status:e,chargeStatus:t,isTextShown:o,...n}){let{t:r}=useTranslation();return jsx(y,{...n,children:jsxs(ye,{children:[jsx(ri,{status:e,isTextShown:o}),t&&ja[t]&&jsx(p,{title:r(ft(t)),children:jsx(_,{src:ja[t],alt:"charge-icon"})})]})})}var oI=tI;var rI={FAILED:gh,PENDING:nh,INITIATED:ch,ATTEMPTED:bh,EXEMPTED:fh,EXEMPTED_WITH_TRANSACTION:fh,EXEMPTED_WITHOUT_TRANSACTION:eh,REJECTED:dh,UNAVAILABLE:ih,UNDETERMINED:jh,SUCCESS:mh,AUTHENTICATED:lh,AUTHENTICATED_WITH_TRANSACTION:lh,AUTHENTICATED_WITHOUT_TRANSACTION:lh,AUTHENTICATED_AUTHORIZE_FAILED:gh},qa={FAILED:oh$1,PENDING:ph,INITIATED:qh,ATTEMPTED:rh,EXEMPTED:sh,EXEMPTED_WITH_TRANSACTION:sh,EXEMPTED_WITHOUT_TRANSACTION:th$1,REJECTED:uh,UNAVAILABLE:vh,UNDETERMINED:wh,SUCCESS:xh,AUTHENTICATED:yh,AUTHENTICATED_WITH_TRANSACTION:yh,AUTHENTICATED_WITHOUT_TRANSACTION:zh$1,AUTHENTICATED_AUTHORIZE_FAILED:oh$1},Dt=ke;function lI({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a,...l}){let{t:s}=useTranslation(),p$1=useTheme(),c=[e&&qa[e]?jsx(p,{title:s(ft(e)),children:jsx("img",{src:qa[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&Dt[o]?jsx(p,{title:s(ft(o)),children:jsx(He,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:a})}):null,t&&Et[t]?jsx(p,{title:s(ft(t)),children:jsx("img",{src:Et[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),m=c.length||0;return jsx(y,{...l,sx:{position:"relative",overflow:"visible"},children:jsx(lo,{whileHover:"animate",animate:"start",statusesCount:m,children:c.map((f,C)=>f?jsx(ao,{order:C,variants:ro(C,p$1.shadows[4],40),children:jsx(io,{children:f})},C):null)})})}var sI=lI;var Za={issuer:_h$1,scheme:$h$1,device:Yh$1,app:Xh$1,wallet:Wh,biometric:Yh$1};function dI({type:e,...t}){let{t:o}=useTranslation();return jsx(y,{...t,children:jsx(ye,{children:jsx(Ce,{className:"authentication-status",children:e&&Za[e]&&jsx(p,{title:o(ft(e)),children:jsx(_,{src:Za[e],alt:"authentication-type"})})})})})}var mI=dI;var Em={SMS:ce,EMAIL:_d,WHATSAPP:de};var Dm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Rm=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Mm=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"})),Lm=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),km=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),Vm=(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 gI({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]},l=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(tt,{order:c,variants:Vm(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(km,{children:jsx(Lm,{sx:{color:i[p$1]},children:m})}):jsx(Rm,{src:Em[p$1],alt:p$1})})},`${p$1}-${c}`)}),s=l?.length||0;return jsx(y,{...o,children:jsx(Dm,{children:l?.length>0?jsx(Mm,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:s||0,variants:{animate:{width:(s||0)*38}},style:{zIndex:29},children:l}):null})})}var xI=gI;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 Bm=styled(j)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));var hI={sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"};function II({dueDate:e,expiryDate:t,zone:o,format:n$1=hI,...r}){let i=useMemo(()=>({label:e?n(e,o,n$1):void 0,tooltip:"Due Date"}),[e,o,n$1]),a=useMemo(()=>({label:t?n(t,o,n$1):void 0,tooltip:"Expiry Date"}),[t,o,n$1]),l=c=>jsx(p,{title:c.tooltip,children:jsx(Bm,{children:c.label})}),s=useMemo(()=>e?l(i):t?l(a):null,[i,a,e,t]),p$1=useMemo(()=>t&&e?[l(a)]:[],[i,a,e,t]);return !e&&!t?null:jsx(y,{...r,sx:{position:"relative",overflow:"visible"},children:jsx(b$2,{sx:{justifyContent:"flex-start",zIndex:101},main:s,endItems:p$1})})}var Xa=II;function Nm(e){return jsx(Xa,{...e,zone:y$1()??u})}var Wm=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 Ja=styled("img")({width:"24px",height:"24px"});function wI({products:e,...t}){let o=e?.map((r,i)=>jsx(Ja,{sx:{...r?.toLowerCase()===Fn.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:Hn.find(a=>a.code?.toLowerCase()===r?.toLowerCase())?.iconUrl,alt:"product-icon"},`${i}-${r}`)),n=jsxs(Wm,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(Ja,{src:vi$1,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(y,{...t,style:{overflow:"visible"},children:jsx(ye,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:n})})})}var AI=wI;function li(e){return jsx(wr,{...e,children:jsx(p,{title:e.tooltip||e.children,children:e.children})})}var _m=styled$1(Bn)(()=>({display:"flex",alignItems:"center",gap:"8px"})),zm=styled$1(Bn)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function YV({currency:e}){return jsxs(_m,{children:[jsx(b$3,{currencyCode:e}),jsx(zm,{children:e})]})}$m.extend(RI);$m.extend(DI);function Gm({value:e,...t}){let o=useMemo(()=>v(e,{sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"}),[e]);return jsx(y,{...t,children:o})}var Ym=styled$1(Bn)(({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 mB({reference:e}){return e?jsx(p,{title:`Bank - ${e}`,children:jsx(Ym,{children:jsx(Bn,{component:"img",src:qb$1,alt:"bank",width:14})})}):jsx(Fragment,{})}var Qa={acquirer:qb$1,generic:rb$1,payment:ae,gateway:wn$1,order:$d$1};var jm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),qm=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Km=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"})),Zm=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Xm=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled("div")(()=>({height:"18px"}));var Jm=(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 HI=120,_I=50;function zI({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),[i,a]=useState(null),l=useRef(null),s=useRef(false),p$1=useRef(false),c=useRef(null),m=useTheme(),f=useMemo(()=>Object.keys(Qa).filter(T=>!!o[T]),[o]),C=()=>{c.current&&(clearTimeout(c.current),c.current=null);},g=()=>{a(l.current);},I=()=>{s.current=true,p$1.current=false,r(true),a(null),C(),c.current=setTimeout(()=>{p$1.current=true,g();},HI);};useEffect(()=>()=>C(),[]);let S=()=>{s.current||I();},A=()=>{C(),l.current=null,s.current=false,p$1.current=false,a(null),r(false);},u=T=>{if(l.current=T,p$1.current){C(),a(T);return}s.current||I();},x=()=>{l.current=null,p$1.current&&(C(),c.current=setTimeout(g,_I));},b=f.length;return jsx(y,{...o,children:jsx(jm,{children:b>0?jsx(Km,{layout:true,className:"reference-sources-container",whileHover:"animate",onHoverStart:S,onHoverEnd:A,animate:n?"animate":"start",sourcesCount:b,variants:{animate:{width:b*38}},style:{zIndex:29},children:f.map((T,w)=>{let h=t?.(T)||`${eu(T)} - ${o[T]}`,P=i===T;return jsx(tt,{order:w,variants:Jm(w,m.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},onMouseEnter:()=>u(T),onMouseLeave:x,children:jsx(p,{open:P,disableHoverListener:true,disableInteractive:true,title:P?h:"",children:e?jsx(Xm,{children:jsx(Zm,{children:eu(T)})}):jsx(qm,{src:Qa[T],alt:T,sx:{...T==="order"&&{width:"11.82px"}}})})},`${T}-${w}`)})}):null})})}var UI=zI;var el={Y:{tooltip:"Authenticated",icon:lh,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Wg,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Wg,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:bh,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Wg,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:ch,borderColor:"#F2F2F2"}},tl={"3DS":{tooltip:"3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled("img")(()=>({width:"12.67px",height:"15px"}));var ou=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),nu=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 ru=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"})),iu=(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}}}),au=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function GI({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),a=useMemo(()=>{let p=el[e??"noAuth"]??el.noAuth,c=p?.tooltip,m=p?.icon;return [{tooltip:c,content:t?c:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?tl[n]?.tooltip:tl[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),l=useMemo(()=>a.filter(p=>!!p.content).map((p$1,c)=>{let m=p$1.type==="text"?jsx(au,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(V,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p$1.content,children:p$1.content})}):jsx(nu,{src:p$1.content,alt:p$1.tooltip});return jsx(p,{title:p$1.tooltip,children:jsx(tt,{order:-1*c,variants:iu(c,i.shadows[4],t?124:39),sx:{...p$1.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p$1.tooltip}-${c}`)}),[r,a,t,i]),s=l.length;return jsx(y,{...r,children:jsx(ou,{children:s>0?jsx(ru,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:s,variants:{animate:{width:38}},style:{zIndex:29},children:l}):null})})}var YI=GI;var ol={checkout:Fh,checkoutSuccess:Gh$1};function KI({status:e,...t}){let{t:o}=useTranslation();return jsx(y,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&ol[e]&&jsx(p,{title:o(ft(e)),children:jsx(_,{src:ol[e],alt:"checkout-icon"})})})})}var ZI=KI;var nl={TRANSACTED:Lh,INITIATED:Jh$1,CANCELLED:Kh,EXPIRED:Ih};function pu({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(y,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&nl[e]&&jsx(p,{title:n(ft(e)),children:jsx(_,{src:nl[e],alt:"intents-icon"})}),t&&Dt[t]&&jsx(p,{title:n(ft(t)),children:jsx(He,{chargeStatus:t})})]})})}var du=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"})),mu=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 uu(e){return e<5?5:e===100?95:e}var di={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function tb({percentage:e,date:t,payoutStatus:o,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:a,...l}){let{t:s}=useTranslation(),p$1=useTheme();return e===0?null:jsx(y,{...l,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(du,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...a&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(mu,{percentage:e,sx:{backgroundColor:"#eeeeee",...a&&{backgroundColor:"transparent",border:"none"}},variants:{...!a&&{animate:{boxShadow:p$1.shadows[4]}}},children:a?jsxs(V,{children:[e,"%"]}):jsxs(Fragment,{children:[e," % ",jsx(Ar,{percentage:uu(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(Ce,{className:"payout-status",style:{visibility:o==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:a?"auto":"24px"},children:o&&dn[o]&&jsx(p,{title:n||s(ft(o)),children:a?jsx(V,{sx:{color:di[o].color,border:`1px solid ${di[o].color}1a`,backgroundColor:di[o].backgroundColor},children:s(ft(o))}):jsx(_,{src:dn[o],alt:"settled-icon"})})})]})})}var ob=tb;var rb={sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"};function gu(e){return n(e,y$1()??u,rb)}function xu(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"}}}var yu={DELETED:lf$1,DRAFT:mf$1,CREATED:nf$1,CANCELLED:Aa,CANCELED:Aa,EXPIRED:Ba,PAID:qf,REFUNDED:wf$1,DELIVERED:rf$1,VIEWED:sf$1,SAVED:tf$1,SCHEDULED:uf$1,PENDING:vf$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 il=styled("img")(()=>({height:"13.125px",width:"12px"})),mi=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),hu=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"})),Iu=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));function bu({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),a=e?oi[e]:null,l=e&&ke[e]&&jsx(Iu,{style:r,children:jsx(_,{src:ke[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(ft(e)),children:jsxs(Bn,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[l,!!Pn$1?.includes(e||"")&&jsx(hu,{style:{background:a?.color},children:o})]})}):null}function Tu({status:e,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:a=0,...l}){let{t:s}=useTranslation(),p$1=useTheme(),c=e?yu[e]:null,m=xu(e),f=`${s(e?.toLowerCase()||"")} ${gu($m(t).valueOf())}`,C=useMemo(()=>jsx(bu,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),g=useMemo(()=>jsx(p,{title:s("reminded"),children:jsxs(Bn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(il,{sx:{width:"14px",height:"14px"},src:me,alt:"icon"}),jsx(z,{style:{background:p$1.palette.error.main,fontWeight:600,color:p$1.palette.common.white},children:a})]})}),[a]),I=useMemo(()=>{if(c)return jsx(p,{title:s(f||""),children:jsx(il,{src:c,alt:"status icon"})});if(n&&Dt[n])return C;if(a)return g},[c,n,a]);return !e&&!n&&!a?null:jsx(y,{...l,sx:{position:"relative",overflow:"visible"},children:jsx(b$2,{sx:{justifyContent:"flex-start",zIndex:101},endAdornment:o&&e==="VIEWED"&&c?[jsx(z,{style:{marginRight:"8px",color:"#fff",backgroundColor:m.color},children:o})]:void 0,main:I,startItems:a&&c?[g]:void 0,endItems:n&&Dt[n]&&c?[C]:void 0})})}function gb({tooltip:e,children:t,badge:o,...n}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(p,{title:e,children:jsx(et,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(V,{"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 xb=gb;var sl={ACTIVE:ji,EXPIRED:ii,PENDING:ji,SAVED:gi,TRANSACTED:hi$1,CONSUMED:hi$1};var yb=(f=>(f.ABANDONED="ABANDONED",f.IN_PROGRESS="IN_PROGRESS",f.VOID="VOID",f.CANCELLED="CANCELLED",f.CAPTURED="CAPTURED",f.INITIATED="INITIATED",f.FAILED="FAILED",f.DECLINED="DECLINED",f.RESTRICTED="RESTRICTED",f.TIMEDOUT="TIMEDOUT",f.UNKNOWN="UNKNOWN",f.AUTHORIZED="AUTHORIZED",f))(yb||{});function Ib({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n,errorCode:r,cardId:i,hasChargeIcon:a,hasAuthorizedIcon:l,...s}){let{t:p$1}=useTranslation();return jsx(y,{...s,sx:{position:"relative",overflow:"visible"},children:jsxs(ye,{sx:{gap:"0.5rem"},children:[e&&sl[e]&&jsx(p,{title:p$1(ft(e)),children:jsx(_,{src:sl[e],alt:"token-icon"})}),i&&jsx(p,{title:p$1(ft(e)),children:jsx(_,{src:ki,alt:"card-icon"})}),a&&jsx(p,{title:p$1(ft("CAPTURED")),children:jsx(He,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n,errorCode:r})}),l&&jsx(p,{title:p$1(ft("AUTHORIZED")),children:jsx(_,{src:Et.AUTHORIZED,alt:"authorized-icon"})})]})})}var bb=Ib;var cl=styled("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),wu=styled("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),Au=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function Sb({brandName:e,brandIcon:t,...o}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(Au,{children:[jsx(wu,{children:t?jsx(p,{title:e,children:jsx(cl,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=Ci$1;}})}):jsx(cl,{src:Ci$1,alt:"brand icon"})}),jsx("span",{children:e})]})})}var wb=Sb;function vu({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]??"",a=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 a?jsx(p,{title:a,children:jsx(Box,{component:"img",src:ak,alt:"meta",sx:{cursor:"pointer"}})}):null}var Eu=styled$1(motion.img,{shouldForwardProp:e=>e!=="width"&&e!=="height"})(({width:e,height:t})=>({width:e||"16px",height:t||"16px"}));var Rb=({width:e,height:t,sx:o}={})=>{let n=Vb$1(useId(),"animated-spinner-icon");return jsx(Eu,{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}})},Du=Rb;var Ru=Du;var Lu=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"})),ku=styled$1(motion.img)(()=>({width:"16px",height:"16px"}));var Vb=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),a=useMemo(()=>r?kc:o?jc:_j,[r,o]);return jsx(p,{title:t?"":"Pending",children:jsx(Lu,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(Ru,{},"spinner"):jsx(ku,{src:t?a:$j,alt:"Download Report"})})})})};var Nb=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(p,{title:`Receipt - ${e}`,children:jsx(V,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:rc,alt:"receipt"})})})});var Wb=({receiptId:e})=>jsx(wr,{children:jsx("span",{children:e})});var Fb=({receiptId:e})=>jsx(li,{children:jsx("span",{children:e})});var Wu=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"}})),Fu=styled(Bn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled("img")(()=>({width:"16px",height:"11.73px"}));var Ou=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"}})),Hu=styled("img")(()=>({width:"10.5px",height:"10.5px"})),_u=styled("div")({marginLeft:"auto",width:"auto"});var zu={incomplete:Jj,complete:Ij,reviewed:Ij,verified:Kj};function Uu({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let a=zu[o??"incomplete"];return jsx(y,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(p,{title:e,children:jsx(Wu,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(Fu,{children:[jsx(p,{title:t?fa(t):"",children:jsx(b$3,{countryCode:t})}),jsx(Ou,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(_u,{children:jsx(Hu,{src:a})})]})})})})}function Gu({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(y,{...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,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Yu={incomplete:Jj,complete:Ij,reviewed:Ij,verified:Kj};var ju=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1.029px solid #F2F2F2",borderRadius:"44px",padding:"4px 8px",lineHeight:"120%"})),qu=styled("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),Ku=styled("img")(()=>({width:"10.5px",height:"10.5px"})),Zu=styled("span")(({theme:e})=>({fontSize:"9.5px",fontWeight:400,color:e.palette.common.white,backgroundColor:e.palette.grey[700],borderRadius:"4px",padding:"1px 2px"})),Xu=styled("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),Ju=styled("div")({display:"flex",alignItems:"center",gap:"8px"}),Qu=styled("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function ef({id:e,status:t,count:o,name:n,...r}){let i=Yu[t??"incomplete"];return jsx(y,{...r,sx:{cursor:"pointer"},children:jsx(p,{title:n,children:jsx(ju,{children:e?jsxs(Xu,{children:[jsx(qu,{children:e}),jsxs(Ju,{children:[jsx(Ku,{src:i}),o>1&&jsx("div",{children:jsxs(Zu,{children:["+",o-1]})})]})]}):jsx(Qu,{children:"Not Available"})})})})}var tf=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"})),of=styled(Bn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),nf=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"}})),rf=styled("img")(()=>({width:"10.5px",height:"10.5px"})),af=styled("div")({marginLeft:"auto",width:"auto"});var lf={incomplete:Jj,complete:Ij,reviewed:Ij,verified:Kj};function sf({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=lf[t??"incomplete"];return jsx(y,{...r,children:jsx(p,{title:e.name,children:jsx(tf,{hasClick:!!r.onClick,children:jsxs(of,{children:[n,jsx(nf,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx(af,{children:jsx(rf,{src:i})})]})})})})}var pf=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),cf=styled("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),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:"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 mf=(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"}}}),uf=styled(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var qb=e=>!e.startsWith("http://")&&!e.startsWith("https://"),Ci=e=>/^https?:\/\//i.test(e),ff=(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 Kb(e,t);case "ios":case "android":case "mobile_app":return Zb(e,t);default:return e}},Kb=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:Ci(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:Ci(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:Ci(e)?null:`https://x.com/${e}`:null},Zb=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?Ci(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,Cf=e=>{!e||typeof e!="string"||window.open(qb(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function Xb({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let a=r.address,l=r.code?.replace(/_/g,""),s=i===e?.length-1,p$1=ff(r.address??"",r.code??"");return jsx(p,{title:a,children:jsx(tt,{order:i,variants:mf(i,0,s),sx:{width:"36px",cursor:p$1?"pointer":"default"},onClick:()=>{r?.address&&Cf(p$1);},children:jsx(cf,{src:r.logo,alt:l})})},`${r}-${i}`)}),n=o?.length||0;return jsx(y,{...t,children:jsx(pf,{children:o?.length>0?jsx(df,{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 Jb=Xb;function nT({channels:e}){let t=useRef(null),[o,n]=useState(false),[r,i]=useState(null),a=!!r;useEffect(()=>{t.current&&n(t.current.scrollHeight>20);},[e]);let l=useMemo(()=>(e||[]).filter(s=>!!s.address),[e]);return jsxs(uf,{children:[jsx(Bn,{sx:{display:"flex",flexWrap:"wrap",gap:o?"8px":"4px"},ref:t,children:l.map(s=>jsxs(b$1,{copyTrigger:"click",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(Bn,{onClick:s=>{i(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(oT,{open:a,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(Bn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:l.map(s=>jsxs(b$1,{copyTrigger:"click",copyText:s.address,children:[s.name?.en,": ",s.address]},s.id))})})]})}var rT=nT;var xf={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function lT({type:e,count:t,sx:o,...n}){let{t:r}=useTranslation(),i=t?.toString();return jsxs(Bn,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$1,{copyTrigger:"click",copyText:e,unknownText:r("noPaymentAgreement"),sx:o,...n,children:e&&xf[e]}),i&&jsx(b$1,{copyTrigger:"click",copyText:i,sx:{minWidth:"38px"},...n,children:i})]})}var sT=lT;var hf={CYBERSOURCE:tm$1,MPGS:um$1,NETCETERA:vm$1,APPLEPAY:wm$1,TAP3DS:xm,FSS:Dm$1,BENEFIT:zm$1,QPAY:Lm$1,POSTPAY:Km$1,BENEFITPAY:ym$1,MEEZA:Fm,STC_PAY:Nm$1,NGENIUS:Gm$1,KNET:Em$1,PAYPAL:Jm$1,FAWRY:Cm,TPG:Rm$1,DEEMA:Bm$1,TPAY:Qm,"CAREEM PAY":Am$1,TABBY:Om,OMANNET:Im$1,NPG:Hm,SPG:Mm$1,TAMARA:Pm$1};var bf=styled(Bn)(({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})),Tf=styled("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function Sf({provider:e,...t}){let o=hf[e];return o?jsx(bf,{children:jsx(Tf,{src:o,alt:e})}):jsx(y,{...t,children:jsx(V,{children:e})})}var wf={CHARGE:Xk,AUTHORIZE:Bk,SAVE_TOKEN:$g$1},Af={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},Pf={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var vf=styled(Bn,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=Pf[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}}),Ef=styled("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),Df=styled("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function Mf({purpose:e,...t}){let o=wf[e],n=Af[e];return jsxs(vf,{purposeType:e,...t,children:[jsx(Ef,{src:o,alt:e}),jsx(Df,{children:n})]})}var kf=8,uT=16,pt=kf*2+uT,Vf=100,Bf=6,fT=pt+Bf+Vf,Nf=styled$1(y)(()=>({position:"relative",overflow:"visible",width:pt,minWidth:pt,maxWidth:pt,display:"inline-flex",padding:0})),Wf=styled$1(Bn)(()=>({position:"relative",width:pt,height:24,flexShrink:0,overflow:"visible"})),Ff=styled$1(Bn,{shouldForwardProp:e=>e!=="hasLabel"})(({theme:e,hasLabel:t})=>({position:"absolute",top:0,left:0,width:pt,minWidth:pt,maxWidth:pt,height:24,display:"inline-flex",alignItems:"center",gap:Bf,paddingInline:kf,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:fT,zIndex:100,boxShadow:"0px 0px 16px 0px #00000021","& .link-cell-label":{maxWidth:Vf,opacity:1}}}})),Of=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 gT({url:e,label:t}){let o=l(),n=()=>{try{xa(e),o.success("Copied!");}catch{o.error("Failed to copy");}};return e?jsx(Nf,{children:jsx(Wf,{children:jsxs(Ff,{hasLabel:!!t,onClick:n,children:[jsx(d,{src:Ll$1,alt:"link"}),t&&jsx(Of,{className:"link-cell-label",children:t})]})})}):null}var xT=memo(gT);function k6({items:e}){let[t,o]=useState(null),n=!!t,r=useCallback(({quantity:l,currency:s,amount:p,name:c})=>`${l?`Qty ${l}`:""} ${c?`- ${c}`:""} ${s||p?"-":""} ${s||""} ${p||""}`,[]);if(!e||!e.length)return null;let[i,...a]=e;return jsxs(Bn,{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(Bn,{onClick:l=>{o(l.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(oT,{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(Bn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:a?.map(l=>jsx(b$1,{copyTrigger:"click",copyText:r(l),children:r(l)},l.id))})})]})}var Hf="ListHeader";var _f=styled(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),zf=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)})),Uf=styled(j)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.v2.typography.fontWeightMedium,lineHeight:"120%"})),$f=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),Gf=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),Yf=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function hi({children:e,component:t="header",...o}){return jsx(_f,{component:t,...o,children:e})}function Ii({title:e,toolbar:t}){return jsxs(zf,{children:[jsx("span",{children:!!e&&jsx(Uf,{children:e})}),t]})}function bi({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(Gf,{as:"aside",children:[o,jsx(b$8,{value:e?.value,items:e?.options,onValueChange:e?.onChange&&(r=>e.onChange?.(r)),keepInactive:n,itemSx:e?.buttonSx}),jsx(d$1,{value:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,isActive:t?.isActive??true,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]}})),Ti=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})),vo=styled(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),Eo=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})),wn=styled(Box)(()=>({width:16})),Zf=styled(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),Xf=styled(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),Jf=styled(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),Qf=styled(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),eC=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]}})),tC=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"}})),gl=styled(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),xl=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),oC=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)"})),nC=styled(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),Si=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 rC=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"}})),iC=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 yl={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}},aC=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"})),lC=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}})),sC={p:0,width:14,height:14,minWidth:14,minHeight:14,"& .MuiSvgIcon-root":{width:16,height:16}},pC=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})),dC=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})),mC={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},uC=e=>({fontSize:11,fontWeight:500,textTransform:"none",backgroundColor:"info.dark",minWidth:80,height:38,borderRadius:"8px",boxShadow:"none","&:hover":{backgroundColor:e.palette.info.dark}}),fC=styled("div",{shouldForwardProp:e=>e!=="sandboxMode"&&e!=="maximized"&&e!=="isDragging"})(({maximized:e,isDragging:t})=>({...!e&&{borderTopRightRadius:12,borderTopLeftRadius:12},...t&&{cursor:"move"},margin:0,position:"sticky",top:0,left:0,right:0,zIndex:1e3,background:"#eaeaea",backdropFilter:"blur(32px)"}));function Il(e,t){let[o,n]=useState(null),[r,i]=useState(null),a=useCallback(()=>{n(null),i(null);},[]),l=useCallback((p,c)=>{n(p.currentTarget),i(c);},[]),s=useCallback(()=>{r&&a();},[r,a]);return useEffect(()=>{e||(a(),t?.());},[e,t,a]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:a,handleSubMenuOpen:l,handleMenuScroll:s}}function LT(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 bl(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),a=useRef(0),l=useRef(false),s=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((g,I)=>{l.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:g,clientY:I+a.current,pointerType:"mouse",isPrimary:true})),l.current=false;},[]),c=useCallback(()=>{if(o.current!==null)return;let g=()=>{let I=i.current;if(!t.current||!I)return;let S=I.getBoundingClientRect(),{x:A,y:u}=n.current,x=u-S.top,b=S.bottom-u;if(x>0&&x<60){let T=(60-x)/60*15;I.scrollTop-=T,a.current-=T,p(A,u);}else if(b>0&&b<60){let T=(60-b)/60*15;I.scrollTop+=T,a.current+=T,p(A,u);}o.current=requestAnimationFrame(g);};o.current=requestAnimationFrame(g);},[p]),m=useCallback(g=>{l.current||(n.current={x:g.clientX,y:g.clientY},r.current=g.pointerId,t.current&&a.current!==0&&(g.stopImmediatePropagation(),p(g.clientX,g.clientY)));},[p]),f=useCallback(()=>{i.current=LT(e.current),a.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),c();},[e,m,c]),C=useCallback(()=>{t.current=false,a.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:f,onDragEnd:C}}function Sl({columns:e,setTableViews:t}){let o=useCallback(i=>{let a=i.map(l=>e.find(s=>s.name===l)).filter(l=>!!l);t?.(a);},[e,t]),n=useCallback(i=>{let a=e.map(l=>{if(l.name!==i)return l;let s=l.menuItems&&l.menuItems.length>0,p=!l.selected;if(!s)return {...l,selected:p};let c=l.menuItems?.map(m=>({...m,selected:p}));return {...l,selected:p,menuItems:c}});t?.(a);},[e,t]),r=useCallback((i,a)=>{let l=e.map(s=>{if(s.name!==i)return s;let p=s.menuItems?.map(m=>m.name===a?{...m,selected:!m.selected}:m),c=p?.some(m=>m.selected)??false;return {...s,menuItems:p,selected:c}});t?.(l);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function Al({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let a=e.menuItems&&e.menuItems.length>0,l=o===e.name,s=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(C=>C.selected)&&!e.menuItems?.every(C=>C.selected)),[e.selected,e.menuItems]),c=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(C=>{a&&r(C,e.name);},[a,r,e.name]),f=useCallback(()=>{a||i();},[a,i]);return {isIndeterminate:p,hasSubmenuItems:a,isSubmenuOpen:l,isFirstItem:s,handleColumnClick:c,handleMouseEnter:m,handleMouseLeave:f}}var L=(e="")=>e.toLowerCase()==="date",we=(e="")=>e.toLowerCase()==="index",wi=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(l=>l.lang===t)?.text||r.name[0]?.text||r.code,a=r.fields?.length?r.fields.map(l=>({name:l.code,label:l.name?.find(s=>s.lang===t||s.lang==="")?.text||l.code,selected:l.default??false})):void 0;o.push({name:r.code,label:i,selected:L(r.code)?true:r.default??false,menuItems:a?.length?a:void 0});});}),o},VT=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?wi([n]):[]},Pl=(e,t,o="en")=>{let n=e.map((i,a)=>{let l=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:a+1,default:i.selected??false,...l?.length?{fields:l}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},BT=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(a=>a.code));n.columns.forEach(a=>{i.has(a.code)||r.columns.push(a);});}else t.set(n.code,{...n,columns:[...n.columns]});});}),Array.from(t.values())};var NT=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),WT=(e,t)=>e.map(o=>({...o,default:o.id===t})),Ai=e=>e.role??(e.default?"default":void 0),Vt=e=>!!e.role||!!e.default,Ae=e=>!Vt(e),gC=e=>Ae(e),Pn=e=>e.filter(gC).length,vl=e=>e.filter(Ae).length,Pi=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(l=>{let s=t==="sheet"?"sheet":"advanced",p=l.layout.find(w=>w.code.toLowerCase()===s),c=p?wi([p],o):[],m=l.id,f=Ra,C=Sa,g=c.some(w=>L(w.name))?c:[C,...c],I=g.findIndex(w=>L(w.name)),A=(I>0?[g[I],...g.filter(w=>!L(w.name))]:g).filter(w=>!we(w.name)),u=[f,...A],x=Ai(l),b=Vt(l),T={id:m,label:l.name,role:x,isCustom:!b,selected:l.selected,default:!!l.default,columns:u.map(w=>w.name),submenu:u};b?(l.default&&!i&&(i=u),r.push(T)):n.push(T);});let a=r.find(l=>l.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:a}},El=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=Pi(e,t,o),a=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:a}},vi=(e,t)=>{let o=[];Ae(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=Ra;if(!o.some(m=>L(m.name)))return [n,Sa,...o];let i=o.findIndex(m=>L(m.name)),a=i>=0?o[i]:Sa,l=o.filter(m=>!L(m.name)&&!we(m.name)),s=[a,...l],p=s.some(m=>we(m.name)),c=s.findIndex(m=>we(m.name));if(p&&c>0){let m=s[c],f=s.filter(C=>!we(C.name));return [m,...f]}return p&&c===0?s:[n,...s]},FT=(e,t)=>vi(e,t).length>0,Mo=e=>e.filter(t=>!we(t.name));var ge=e=>e.toLowerCase(),xC=e=>new Map(e.filter(t=>!L(t.name)).map(t=>[ge(t.name),t])),yC=(e,t)=>e.some(o=>ge(o)===ge(t)),Dl=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>ge(r.name)===ge(o.name));return {...o,selected:n?.selected??false}})}),vn=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}},Ml=(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}}),En=(e,t,o)=>e.map(n=>{if(n.name!==t)return n;let r=n.menuItems?.map(a=>a.name===o?{...a,selected:!a.selected}:a),i=r?.some(a=>a.selected)??false;return {...n,menuItems:r,selected:i}}),Ll=(e,t)=>e.map(o=>{if(L(o.name))return o;let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),kl=e=>{let t=e.filter(o=>!L(o.name));return t.length===0?false:t.every(o=>o.menuItems?.length?o.menuItems.every(n=>n.selected):o.selected)},Vl=(e,t)=>e.filter(r=>!L(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,Bl=(e,t)=>e.trim().length>0&&e.length<=t,oe=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Nl=(e,t)=>e.map(o=>{if(o.name!==t)return o;if(L(o.name))return {...o,selected:true};let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),Wl=(e,t)=>e.map(o=>{if(L(o.name))return {...o,selected:true};let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),Fl=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),Ol=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,Rl=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Dn=(e,t)=>{if(e.length!==t.length)return false;let o=Rl(e),n=Rl(t);for(let r=0;r<o.length;r++){let i=o[r],a=n[r];if(i.name!==a.name||i.selected!==a.selected)return false;if(i.menuItems&&a.menuItems){if(i.menuItems.length!==a.menuItems.length)return false;for(let l=0;l<i.menuItems.length;l++)if(i.menuItems[l].name!==a.menuItems[l].name||i.menuItems[l].selected!==a.menuItems[l].selected)return false}else if(i.menuItems||a.menuItems)return false}return true},OT=e=>e.filter(t=>!L(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Hl=(e,t)=>{let o=e.filter(i=>!L(i.name)).map(i=>i.name),n=xC(t),r=[];for(let i of o){let a=e.find(s=>ge(s.name)===ge(i)),l=n.get(ge(i));l?r.push(a?Dl(l,a):{...l,selected:false,menuItems:l.menuItems?.map(s=>({...s,selected:false}))}):a&&r.push(a);}for(let[,i]of n)if(!yC(o,i.name)){let a=e.find(l=>ge(l.name)===ge(i.name));r.push(a?Dl(i,a):{...i,selected:false,menuItems:i.menuItems?.map(l=>({...l,selected:false}))});}return r},_l=e=>e.filter(t=>!L(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),zl=(e,t)=>{let o=xC(e),n=t.filter(i=>!L(i.name)).map(i=>i.name),r=[];for(let i of n){let a=t.find(s=>ge(s.name)===ge(i)),l=o.get(ge(i));l&&a?r.push(Dl(l,a)):l&&r.push({...l,selected:false,menuItems:l.menuItems?.map(s=>({...s,selected:false}))});}for(let[,i]of o)yC(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});return r};function hC(e,t,o="en"){if(!e?.layout?.length)return [];let n=qa$1(t)?"sheet":"advanced",r=e.layout.find(l=>l.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(l=>{let s=l.name?.find(c=>c.lang===o)?.text||l.name?.[0]?.text||l.code,p=l.fields?.length?l.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:l.code,label:s,selected:L(l.code)?true:l.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(l=>L(l.name))?i:[{name:Sa.name,label:Sa.label,selected:true},...i]}var Ei=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function Di(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function HT(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,a)=>Ei(i)-Ei(a))})),n=hC(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:Ai(e),isCustom:Ae(e),default:e.default}}var Ri=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=pa(t)?"Advanced":"Sheet",r=e.layout.find(i=>{let a=i.code?.trim();return a===n||a?.toLowerCase()===n.toLowerCase()})||e.layout.find(i=>{let a=i.code?.trim()?.toLowerCase();return pa(t)?a==="default"||a==="advanced":a==="sheet"||a==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(a=>{let s=!!a.fields?.length&&a.fields.some(c=>c.default??false),p=(a.default??false)||s;return {code:a.code,name:a.name&&a.name.length>0?a.name:[{text:a.code,lang:"en"}],selected:p,sort_order:Ei(a),fields:a.fields?.map(c=>({code:c.code.toLowerCase(),type:"single",parameters:[{parameter:c.code.toLowerCase(),code:c.code.toLowerCase(),selected:c.default??false}]}))||[{code:a.code.toLowerCase(),type:"single",parameters:[{parameter:a.code.toLowerCase(),code:a.code.toLowerCase(),selected:a.default??false}]}]}}).sort((a,l)=>(a.sort_order??999)-(l.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let a=r.name.toLowerCase(),l;r.menuItems&&r.menuItems.length>0?l=r.menuItems.filter(m=>m.selected):l=[{name:a,label:r.label||r.name,selected:true}];let s=l.length>0?l.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:a,code:a}],p=l.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:a,type:p,parameters:s}]}}):[]},_T=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?Ri(o,t):[]};function Ul(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function $l(e,t){let o=t?.name??e?.name??"",n=t?.layout,r=Array.isArray(n)?n[0]:n??null,a=[...e?.layout??[]];if(r){let l=r.code?.toLowerCase(),s=a.findIndex(p=>p.code?.toLowerCase()===l);s>=0?a[s]=r:a.push(r);}return {name:o,layout:a}}var Gl=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var IC=e=>[...Ua[e]??Ua.default],zT=e=>Va[e]??Va.default,UT=(e,t)=>({code:e,name:[{text:Ta[e],lang:"en"}],selected:true,sort_order:t}),$T=(e,t)=>e?.layout?.some(o=>IC(t).includes(o.code?.toLowerCase()??""))??false,Yl=(e,t,o)=>{let n=Va[t],r=o?.layout?.find(a=>a.code?.toLowerCase()===n.toLowerCase()),i=r?{...r,columns:r.columns?.map(a=>({...a,name:a.name?.map(l=>({...l})),fields:a.fields?.map(l=>({...l,name:l.name?.map(s=>({...s}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var Mi=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:l}=El(t,e,o),p=(n?Pi([n],e,o).defaultTemplate:void 0)??a,c=p?.submenu?structuredClone(p.submenu):[],m=Pn(t);return {customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:l,defaultColumns:c,customTemplateCount:m}},[t,e,o,n]);var Li=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:a,allTemplates:l,customTemplateCount:s})=>{let[p,c]=useState(null),[m,f]=useState(false),[C,g]=useState(null),[I,S]=useState(false),[A,u]=useState(null),[x,b]=useState(null),[T,w]=useState(),[h,P]=useState(l.find(v=>v.selected)?.id??a?.id),k=useRef(l.find(v=>v.selected)?.id??a?.id),H=useCallback(v=>{let R=v.submenu?.filter(j=>j.selected)||[];return {...v,submenu:R,columns:R.map(j=>j.name)}},[]),K=useCallback(v=>{k.current=v?.id,t?.(v?H(v):void 0);},[t,H]),B=useMemo(()=>h?l.find(v=>v.id===h):a,[l,h,a]),N=useMemo(()=>oe(B?.submenu||i),[B,i]),W=useMemo(()=>({id:h||a?.id||"default",label:B?.label||a?.label||"Default"}),[B,h,a?.id,a?.label]);useEffect(()=>{let v=l.find(fe=>fe.selected)?.id,R=a?.id,j=h?l.some(fe=>fe.id===h):false;if(!(h&&!j&&v!==h)){if(v&&v!==h){P(v);return}if(!h){P(v??R);return}j||P(v??R);}},[l,a?.id,h]),useEffect(()=>{!h||!B||B.id===h&&k.current!==h&&(k.current=h,t?.(H(B)));},[h,B,t,H]);let Y=useCallback(v=>{c(R=>R?null:v.currentTarget);},[]),ce=useCallback(()=>{c(null);},[]),be=useCallback((v,R)=>{P(R?.id),K(R),ce();},[ce,K]),ue=useCallback((v=false,R,j,fe)=>{s!=null&&s>=3||(g(null),S(v),u(R??null),b(j?.length?j:null),w(fe),f(true),c(null));},[s]),F=useCallback(v=>{let R=l.find(j=>j.id===v.id)??v;g(R),S(true),u(null),b(R.submenu?.length?oe(R.submenu):null),f(true);},[l]),We=useCallback(()=>{f(false),g(null),S(false),u(null),b(null),w(void 0);},[]);useEffect(()=>{if(!m||!C?.id)return;let v=l.find(R=>R.id===C.id);v&&(g(v),b(v.submenu?.length?oe(v.submenu):null));},[m,C?.id,l]);let Yi=useCallback(async v=>{if(C){let R=C.id;await n?.(R,v),P(R);let j=l.find(fe=>fe.id===R)??C;K(j),ce();}else {let R=await o?.({...v,sourceTemplateId:T});if(R?.id){P(R.id);let j=l.find(fe=>fe.id===R.id);K(j??{id:R.id,label:R.name,isCustom:true,columns:v.selectedColumns.map(fe=>fe.name),submenu:v.selectedColumns});}}},[C,n,o,ce,l,K,T]),ji=useCallback(async v=>{let R=l.find(j=>j.id===v);await r?.(R?.id??v),h===(R?.id??v)&&P(a?.id);},[l,r,h,a]);return {anchorEl:p,isCreateDialogOpen:m,editingView:C,selectedViewInfo:W,shouldUseCurrentState:I,selectedView:B,currentViewColumns:N,initialColumnsForCreate:A,availableColumnsForCreate:x,handleViewButtonClick:Y,handleCloseViewDropdown:ce,handleSelectedViewInfo:be,handleOpenCreateDialog:ue,handleOpenEditDialog:F,handleCloseCreateDialog:We,handleSaveView:Yi,handleDeleteView:ji}};var Lo=()=>{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);},[]),a=useCallback(()=>{r.current=setTimeout(()=>{t(null),n(null);},0);},[]),l=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:a,cancelClose:l,forceClose:s}};var SC=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((s,p)=>{t(s),n(p);},[]),a=useCallback(()=>{t(null),n(null);},[]),l=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:a,cancelNestedClose:l}};var Xl=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,a]=useState(()=>n?.label||""),[l,s]=useState([]),p=useRef(false),c=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:f,anchorEl:C,openSubmenu:g,closeSubmenu:I,cancelClose:S}=Lo(),A=Ra,u=Sa;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let W=n.submenu&&n.submenu.length>0?n.submenu:o,Y=t.length>0?t:W,be=Hl(W,Y).filter(We=>!we(We.name)&&!L(We.name)),ue=[A,u,...be];s(ue),c.current=oe(ue);let F=n.label?.trim()||"";m.current=F,a(F);}else {let W=t.length>0?t:r,ce=(r&&r.length>0?zl(W,r):_l(W)).filter(ue=>!we(ue.name)&&!L(ue.name)),be=[A,u,...ce];s(be),c.current=oe(be),m.current="",a("");}else if(e&&n){let W=n.label?.trim()||"";a(W);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,A,u]);let x=useMemo(()=>l.map(N=>N.name),[l]),b=useMemo(()=>kl(l),[l]),T=useMemo(()=>Vl(l,b),[l,b]),w=useMemo(()=>Bl(i,20),[i]),h=useMemo(()=>{let N=i.trim()!==m.current,W=c.current.length>0&&!Dn(l,c.current);return N||W},[i,l]);return {templateName:i,setTemplateName:a,selectedColumns:l,columnNames:x,allSelected:b,someSelected:T,isNameValid:w,hasChanges:h,hoveredColumn:f,anchorEl:C,openSubmenu:g,closeSubmenu:I,cancelClose:S,handleReorder:N=>{let W=N.filter(Y=>!L(Y)).flatMap(Y=>l.find(ce=>ce.name===Y)??[]);s([A,u,...W]);},handleColumnToggle:N=>{s(W=>Ml(W,N));},handleSubItemToggle:(N,W)=>{s(Y=>En(Y,N,W));},handleSelectAll:()=>{s(N=>Ll(N,!b));},handleResetToDefault:()=>{c.current.length>0&&s(oe(c.current));}}};function Ql({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:a,lang:l="en",mainDefaultTemplate:s}){let p=useMemo(()=>s??e.find(u=>u.default),[e,s]),c=e.find(u=>u.selected)?.id??p?.id,m=useCallback(u=>{t(x=>x.find(T=>T.selected)?.id===u?x:x.map(T=>({...T,selected:u?T.id===u:false})));},[t]),f=useCallback(async({name:u,layout:x,sourceTemplateId:b})=>{if(Pn(e)>=3)return;let T=e.find(k=>k.id===b)??e.find(k=>k.id===c)??p,w=Yl(x,i,T),h=await o({name:u,layout:w}),P=Di(h);return t(k=>[...k.filter(K=>K.id!==P.id).map(K=>({...K,selected:false})),{...P,selected:true}]),{id:h.id,name:h.name??""}},[o,t,i,p,e,c]),C=useCallback(async u=>{await r(u),t(x=>x.filter(b=>b.id!==u)),m(c===u?p?.id:c);},[r,t,p,m]),g=useCallback(async(u,x)=>{let b=e.find(k=>k.id===u),{name:T,layout:w}=$l(b,x),h=await n(u,{name:T,layout:w}),P=Di(h);t(k=>Ul(k,H=>H.id===u,P)),m(P.id);},[e,n,t,m]),I=useMemo(()=>({templates:e,onCreateCustomView:f,onEditCustomView:g,onDeleteCustomView:C,isLoading:a,mainDefaultTemplate:s}),[e,f,g,C,a,s]),S=useCallback(u=>{if(!p){m(void 0);return}if(!u?.id){m(p.id);return}if(Vt(u)){m(u.id);return}let x=e.find(b=>b.id===u.id);if(x){m(x.id);return}Ae(u)&&m(u.id);},[e,p,m]),A=useMemo(()=>{let u=e.find(b=>c?b.id===c:false)??p;if(!u)return [];let x=Ri(u,i);return x.length>0?x:[]},[i,e,c,p]);return {customViews:I,onViewChange:S,columnsView:A,selectedViewId:c}}function QT({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:a,handleSubMenuClose:l}){let{t:s}=useTranslation(),p=useTheme(),{isIndeterminate:c,hasSubmenuItems:m,isSubmenuOpen:f,isFirstItem:C,handleColumnClick:g,handleMouseEnter:I,handleMouseLeave:S}=Al({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:a,handleSubMenuClose:l}),A=u=>u?s(u)??eu(u):"";return jsxs(Bn,{sx:{borderTop:`1px solid ${p.palette.divider}`,...C&&{borderTop:"none",height:33}},children:[jsxs(V$1,{isIndeterminate:c,isSelected:e.selected,onMouseEnter:I,onMouseLeave:S,onClick:g,children:[jsx(Bn,{sx:{flex:1},children:A(e.label)}),m&&jsx("img",{src:xb$1,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(R,{open:f,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:l,children:e.menuItems?.map(u=>jsx(V$1,{isSelected:e.selected&&u.selected,onClick:()=>i(e.name,u.name),children:A(u.label)},u.name))})]},e.name)}var vC=QT;function nS({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:a}=useTranslation(),l=useMemo(()=>n||[],[n]),s=useMemo(()=>l.map(A=>A.name),[l]),{reorderColumns:p,toggleColumnSelection:c,toggleSubmenuItem:m}=Sl({columns:l,setTableViews:o}),{subMenuAnchorEl:f,openSubMenuName:C,handleSubMenuClose:g,handleSubMenuOpen:I,handleMenuScroll:S}=Il(e,i);return jsxs(vo,{"data-testid":"TableView_CustomViews",children:[jsxs(Ao,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:a("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:S,children:l.map((A,u)=>jsx(vC,{column:A,index:u,openSubMenuName:C,subMenuAnchorEl:f,toggleColumnSelection:c,toggleSubmenuItem:m,handleSubMenuOpen:I,handleSubMenuClose:g},A.name))})})]})]})}var ts=memo(nS);function lS({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:a}=useTranslation();return jsxs(vo,{"data-testid":"TableView_DefaultViews",children:[jsxs(Ao,{onClick:l=>{n(l);},children:[jsx("div",{children:t.label}),jsx("img",{src:Eb,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(iS,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(Po,{children:[Ya$1.map(l=>jsxs(Eo,{onClick:()=>{o(l),r?.(l);},children:[l.id===t.id?jsx("img",{className:"check-icon",src:Fb$1,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:l.label}),jsx(wn,{})]},l.id)),jsxs(Eo,{sx:{border:"none"},onClick:l=>{l.stopPropagation(),o(Xa$1),r?.(Xa$1);},children:[t.id===Xa$1.id?jsx("img",{className:"check-icon",src:Fb$1,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:a("createCustomView")}),jsx(wn,{})]})]})})]})}var os=is.memo(lS);function dS({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[a,l]=useState(null),[s,p$1]=useState(null),[c,m]=useState(null),[f,C$1]=useState(Wa),{t:g}=useTranslation(),I=x=>{e?.(),l(x.currentTarget),t(true);},S=()=>{p$1(null),m(null);},A=()=>{l(null),t(false),C$1(Wa);},u=x=>{C$1(x),x.id!==Xa$1.id&&r?.(x),S();};return a?jsx(cS,{onClickAway:S,children:jsxs(Ti,{"data-testid":"TableView",children:[f.id===Xa$1.id&&jsx(ts,{tableViews:n,setTableViews:o,anchorEl:c,open:!!c,onSelect:x=>{m(c?null:x.currentTarget),p$1(null);},onClose:()=>{m(null);}}),jsx(os,{open:!!s,anchorEl:s,setSelectedViewInfo:x=>{u(x);},selectedViewInfo:f,onSelect:x=>{p$1(s?null:x.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(Ao,{sx:{width:32,justifyContent:"center"},onClick:A,children:jsx("img",{src:Gb,alt:"close"})})]})}):jsx(p,{title:g("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":g("tableView")})})}var ns=memo(dS);var DC=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:a,isModified:l=false})=>{let{hoveredNestedColumn:s,nestedSubmenuAnchorEl:p,openNestedSubmenu:c,closeNestedSubmenu:m,cancelNestedClose:f$1}=SC();return jsxs(Fragment,{children:[jsxs(lC,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(f,{checked:t,indeterminate:o,onChange:C=>{C.stopPropagation(),n();},onClick:C=>{C.stopPropagation();},sx:sC})}),jsx(Typography,{component:"button",disabled:!l,onClick:C=>{C.stopPropagation(),l&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:l?"pointer":"default",padding:0,opacity:l?1:.5,pointerEvents:l?"auto":"none","&:hover":l?{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((C,g)=>{let I=C.menuItems&&C.menuItems.length>0,{checked:S,indeterminate:A}=vn(C),u=L(C.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:x=>I&&c(C.name,x.currentTarget),onMouseLeave:()=>I&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(V$1,{isSelected:I?S:C.selected,isIndeterminate:I?A:false,isDisabled:u,onClick:()=>{u||i(C.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:C.label||C.name})}),I&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:yb$1,alt:"arrow",style:{height:12}})})]}),I&&jsx(Popper,{open:s===C.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:f$1,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Si,{children:C.menuItems?.map((x,b)=>jsxs(is.Fragment,{children:[jsx(V$1,{isSelected:x.selected,isDisabled:u,onClick:()=>{u||a(C.name,x.name);},children:x.label||x.name}),b<(C.menuItems?.length??0)-1&&jsx(v$1,{})]},x.name))})]})})]}),g<e.length-1&&jsx(v$1,{})]},C.name)})})})]})};function bS({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:a=[],onEditCustomView:l,defaultColumns:s=[],defaultTemplate:p$1,defaultTemplates:c=[],customTemplateCount:m,isLoading:f}){let{t:C}=useTranslation(),{hoveredColumn:g,anchorEl:I,openSubmenu:S,closeSubmenu:A,cancelClose:u,forceClose:x}=Lo(),[b,T]=is.useState(null),[w,h]=is.useState(null),P=useMemo(()=>[...c.length?c:p$1?[p$1]:[],...a],[c,p$1,a]),k=useCallback(E=>E.submenu?.length?E.submenu:s,[s]),H=useCallback(E=>E?vi(E,k(E)):s,[s,k]),K=useCallback(E=>H(E).length>0,[H]),B=useMemo(()=>g?P.find(E=>E.id===g):void 0,[g,P]),N=useMemo(()=>H(B),[B,H]),W=useMemo(()=>g?w?.length?w:N:[],[g,N,w]),Y=useMemo(()=>Fl(W),[W]),ce=useMemo(()=>Ol(W,Y),[W,Y]),be=w!=null&&!Dn(w,N),ue=(m??vl(a))>=3,F=f||ue,We=F||!be;function Yi(E){x(),h(null);let Z;if(Vt(E)){let xe=E.submenu?.length?E.submenu:s.length?s:p$1?.submenu??[];Z={...E,submenu:oe(xe),columns:xe.map(Ee=>Ee.name)};}else Ae(E)&&(Z=E);o(E,Z);}function ji(E,Z){let xe=P.find(Ee=>Ee.id===E);h(oe(H(xe))),S(E,Z);}function v(){h(null),A(),x();}function R$1(E){if(E.stopPropagation(),We)return;let Z=oe(N),xe=w?.length?oe(w):Z;i?.(true,xe,Z,B?.id),h(null),x();}function j(E){w&&h(Nl(w,E));}function fe(E,Z){w&&h(En(w,E,Z));}function Mg(){w&&h(Wl(w,!Y));}function Lg(){h(oe(N));}return jsxs(vo,{"data-testid":"ViewsDropdown",children:[jsx(iS,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(Po,{onScroll:x,children:[jsx(IS,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(v$1,{}),P.map(E=>{let Z=Ae(E),xe=!Z&&K(E);return jsxs(Eo,{onMouseEnter:Ee=>{Z?T(E.id):xe&&ji(E.id,Ee.currentTarget);},onMouseLeave:()=>{Z?T(null):xe&&A();},onClick:()=>Yi(E),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[E.id===t.id?jsx("img",{style:{width:15,height:15},src:Zj,alt:"check"}):jsx(Do,{}),jsx("span",{style:{flex:1,fontSize:11},children:E.label}),Z&&b===E.id&&jsx("img",{src:Dh,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:Ee=>{Ee.stopPropagation(),r?.(),l?.(E);}}),xe&&jsx("img",{src:yb$1,alt:"arrow",style:{height:12}})]},E.id)}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!ue,children:jsxs(Eo,{sx:{border:"none",opacity:F?.5:1,cursor:F?"not-allowed":"pointer"},onClick:E=>{if(E.stopPropagation(),F)return;let Z=oe(H(p$1)),xe=Z.map(Ee=>({...Ee,selected:false,menuItems:Ee.menuItems?.map(kg=>({...kg,selected:false}))}));i?.(true,xe,Z,p$1?.id),x();},children:[jsx(Do,{}),jsxs(Bn,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:im$1,alt:"",style:{opacity:F?.5:1,width:10,height:10}}),jsx("span",{style:{color:F?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:C("New Custom View")})]}),jsx(wn,{})]})})]})}),g&&I&&W.length>0&&jsx(R,{open:!!I,anchorEl:I,placement:"auto-end",onMouseEnter:u,onMouseLeave:v,children:jsxs(pC,{children:[jsx(DC,{columns:Mo(W),allCurrentSelected:Y,someCurrentSelected:ce,onSelectAll:Mg,onReset:Lg,onColumnToggle:j,onNestedItemToggle:fe,anchorEl:I,isModified:be}),jsxs(dC,{children:[jsx(RC,{variant:"text",onClick:v,sx:mC,children:"Cancel"}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!ue,children:jsx(RC,{variant:"contained",onClick:R$1,disabled:We,sx:uC,children:"Create view"})})]})]})})]})}var as=is.memo(bS);var kC=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:a,onColumnToggle:l,onSubItemToggle:s,onSelectAll:p,onResetToDefault:c,onSubmenuEnter:m,onSubmenuLeave:f$1,onCancelClose:C$1})=>{let g=useRef(null),{onDragStart:I,onDragEnd:S}=bl(g),A=useCallback(u=>{if(Gl(u.target)){u.preventDefault();return}I();},[I]);return jsxs(Qf,{children:[jsxs(eC,{children:[jsx(gl,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(xl,{onClick:u=>{u.stopPropagation(),p();},children:jsx(f,{checked:o,indeterminate:n,size:"small",sx:yl,onChange:u=>{u.stopPropagation(),p();},onClick:u=>{u.stopPropagation();}})}),jsx(Typography,{onClick:u=>{u.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:u=>{u.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:g,axis:"y",onReorder:a,values:t,style:{listStyle:"none",padding:0,margin:0},children:e.map(u=>{let x=L(u.name),b=u.menuItems&&u.menuItems.length>0,{checked:T,indeterminate:w}=vn(u);return jsxs(Reorder.Item,{value:u.name,drag:x?false:"y",dragListener:!x,dragConstraints:g,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:A,onDragEnd:S,children:[jsxs(tC,{isHovered:r===u.name,isDate:x,onMouseEnter:h=>b&&m(u.name,h.currentTarget),onMouseLeave:()=>b&&f$1(),onClick:h=>{(h.target.closest('[role="checkbox"]')||h.target.closest('input[type="checkbox"]'))&&h.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(gl,{children:jsx("img",{src:Hb$1,alt:"drag",draggable:false,style:{width:16,height:16,cursor:x?"default":"grab",pointerEvents:"none"}})}),jsx(xl,{onMouseDown:h=>{h.stopPropagation();},onPointerDown:h=>{h.stopPropagation();},children:jsx(f,{checked:T,indeterminate:w,onChange:h=>{h.stopPropagation(),l(u.name);},onClick:h=>{h.stopPropagation();},disabled:x,size:"small",sx:yl})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:u.label||u.name}),b&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:xb$1,alt:"arrow",style:{width:12,height:12}})})]}),b&&jsx(Popper,{open:r===u.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:C$1,onMouseLeave:f$1,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Si,{children:u.menuItems?.map((h,P)=>jsxs(is.Fragment,{children:[jsx(V$1,{isSelected:h.selected,isDisabled:x,onClick:()=>{x||s(u.name,h.name);},sx:{fontSize:13},children:h.label||h.name}),P<(u.menuItems?.length??0)-1&&jsx(v$1,{})]},h.name))})]})})]},u.name)})})})]})};function DS({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i$1,onDelete:a,tableViews:l=[],mode:s="sheet",stackOrder:p=1}){let{t:c$1}=useTranslation(),m=useDragControls(),[f,C]=useState(false),[g,I]=useState(false);useEffect(()=>{e||(C(false),I(false));},[e]),useEffect(()=>{if(!e)return;let F=We=>{We.key==="Escape"&&t();};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[e,t]);let{templateName:S,setTemplateName:A,selectedColumns:u,allSelected:x,someSelected:b,isNameValid:T,hasChanges:w,hoveredColumn:h$1,anchorEl:P,openSubmenu:k,closeSubmenu:H,cancelClose:K,handleReorder:B,handleColumnToggle:N,handleSubItemToggle:W,handleSelectAll:Y,handleResetToDefault:ce}=Xl({open:e,availableColumns:n,defaultColumns:r,editingView:i$1,tableViews:l}),be=async()=>{if(!(!T||!w||g||f)){I(true);try{let F=Pl(u,s);await o?.({name:S,selectedColumns:u,layout:F}),t();}catch{console.warn("Failed to create view");}finally{I(false);}}},ue=async()=>{if(!i$1||f||g)return;let F=i$1.id;C(true);try{await a?.(F),t();}catch{console.warn("Failed to delete view");}finally{C(false);}};return e?jsxs(aC,{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(fC,{id:"draggable-dialog-title",onPointerDown:F=>m.start(F),style:{cursor:"move",flexShrink:0},children:jsxs(b$4,{children:[jsx(h,{children:jsx(c,{onClick:t,onPointerDown:F=>F.stopPropagation()})}),jsx(j$1,{title:i$1?"Edit Custom View":c$1("createCustomView")||"Create Custom View"}),jsx(i,{})]})}),jsxs(Zf,{children:[jsxs(Xf,{onScroll:()=>{H();},children:[jsxs(Jf,{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$1&&jsx(rC,{onClick:ue,disabled:f||g,children:f?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$5,{name:"custom-template-name",label:"Template Name",value:S,onChange:F=>A(F),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:F=>F.currentTarget.removeAttribute("readonly")},required:true})}),jsx(kC,{selectedColumns:Mo(u),columnNames:Mo(u).map(F=>F.name),allSelected:x,someSelected:b,hoveredColumn:h$1,anchorEl:P,onReorder:B,onColumnToggle:N,onSubItemToggle:W,onSelectAll:Y,onResetToDefault:ce,onSubmenuEnter:k,onSubmenuLeave:H,onCancelClose:K})]}),jsx(oC,{}),jsx(nC,{children:jsx(iC,{variant:"contained",onClick:be,disabled:!T||!w||g||f,title:T?void 0:`Name is required. Current: "${S}"`,children:g?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:i$1?"Saving...":"Creating..."})]}):i$1?"Update View":"Create View"})})]})]}):null}var ls=DS;function kS({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:a="en",isLoading:l,mainDefaultTemplate:s}){let{t:p$1}=useTranslation(),{defaultColumns:c,defaultTemplate:m,defaultTemplates:f,customViews:C$1,allTemplates:g,customTemplateCount:I}=Mi({tableMode:i,templates:t,lang:a,mainDefaultTemplate:s}),{anchorEl:S,isCreateDialogOpen:A,editingView:u,selectedViewInfo:x,shouldUseCurrentState:b$1,currentViewColumns:T,initialColumnsForCreate:w,availableColumnsForCreate:h,handleViewButtonClick:P,handleCloseViewDropdown:k,handleSelectedViewInfo:H,handleOpenCreateDialog:K,handleOpenEditDialog:B,handleCloseCreateDialog:N,handleSaveView:W,handleDeleteView:Y}=Li({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:c,defaultTemplate:m,allTemplates:g,customTemplateCount:I});return jsxs(Fragment,{children:[jsx(cS,{onClickAway:k,children:jsxs(Ti,{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:P,"aria-label":p$1("tableView")})}),jsx(as,{open:!!S,anchorEl:S,onClose:k,setSelectedViewInfo:H,selectedViewInfo:x,onCreateCustomView:K,customViews:C$1,onEditCustomView:B,defaultColumns:c,defaultTemplate:m,defaultTemplates:f,customTemplateCount:I,isLoading:l})]})}),jsx(ls,{open:A,onClose:N,availableColumns:h?.length?h:c,defaultColumns:c,onCreate:W,editingView:u,onDelete:Y,tableViews:b$1?w??T:void 0,mode:i})]})}var OC=memo(kS);function ss(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function kn({children:e,component:t="aside",...o}){return jsx(Yf,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function Fi({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:a,lang:l}){let{isColumnPickerVisible:s,setIsColumnPickerVisible:p,timezoneCountryCodes:c}=ss(t?.segmentCountries),m=e?.variant==="acceptance",f=n?.tableMode??"default",C=useMemo(()=>n?.onSheetToggle?jsx(b$6,{tableMode:f,onToggle:n.onSheetToggle}):null,[f,n?.onSheetToggle]);return jsxs(kn,{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,C&&!m&&C,i?.calendar??(o&&t&&jsx(a$1,{defaultDate:o.date,onDateChange:g=>{let[I,S]=g;I&&S&&o.onDateChange([I,S]);},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})),a&&i?.reports,C&&m&&C]}),n?.onViewChange&&(n.templates?jsx(OC,{onViewChange:n.onViewChange,tableMode:f,lang:l,...n.templates}):jsx(ns,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!s&&i.trailing]})}function zS({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:a,activeFilter:l,views:s,search:p,slots:c,children:m}){let f=useMemo(()=>jsx(Fi,{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(hi,{"data-testid":Hf,children:[t?.maximized&&jsx(Ii,{title:e,toolbar:f}),jsxs($f,{as:"section",children:[jsx(bi,{status:a,activeFilter:l,beforeStatus:c?.beforeStatus}),!t?.maximized&&f]}),m]})}var zC=memo(zS);var US=styled$1(j)(()=>({fontSize:"11px"})),UC=styled$1(Bn)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),$C=styled$1(Bn)(({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}`})),GC=styled$1(b)(()=>({minWidth:"auto",width:70})),YC=styled$1(b)(()=>({minWidth:"auto",width:70})),jC=styled$1(Bn)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),cs=styled$1(US)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),qC=styled$1(Bn)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),KC=styled$1(Bn)(({theme:e})=>({...a(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),ZC=styled$1(cs)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),XC=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 QC({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,timezone:r,browserTimezone:i,defaultCountryTimezone:a,onTimezoneChange:l,timezoneCountriesCodes:s=[],onConfirm:p,onCloseDropdown:c}){let m$1=Vb$1(useId(),"date-filter"),{t:f}=useTranslation(),C=useRef(null),g=()=>p(e),I=p$1(g,c),S=b=>{t(b),requestAnimationFrame(()=>C.current?.focus());},A=b=>{g(),c(b);},u=useCallback(b=>n(b),[n]),x=b=>{if(!b)return "";let[T,w]=b,h=$m(T).format("MMM D"),P=$m(w).format("MMM D");return h===P?h:`${h} - ${P}`};return jsxs(KC,{ref:C,tabIndex:-1,onKeyDown:I,id:m$1,"data-testid":"DateFilter",children:[jsxs(jC,{children:[jsx(qC,{children:jsx(cs,{component:"span",children:f("filterBy")})}),jsx(UC,{children:jsx(a$1,{defaultDate:e||m(0),onDateChange:S,maxDateRange:365,mode:o,onCalendarModeSwitch:u,browserTimezone:i,defaultCountryTimezone:a,timezone:r,onChangeTimezone:l,timezoneCountriesCodes:s,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(b,T)=>jsxs(XC,{variant:"secondary",size:"md",fullWidth:true,open:b,onClick:T,children:[jsx("span",{children:x(e)||"Date"}),jsx(d,{src:fk,alt:"selected",sx:{width:16,height:16}})]})},x(e))}),e&&jsx(ZC,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs($C,{children:[jsx(YC,{variant:"secondary",size:"md",onClick:c,children:f("cancel")}),jsx(GC,{variant:"primary",size:"md",onClick:A,children:f("okay")})]})]})}function QS({voidPercentage:e,capturePercentage:t,captureCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:l,remainingAmount:s,isSheetViewShown:p$1,selectionProps:c={}}){let m=Number(t)+Number(e)===100||s<=0,f=Vb$1(useId(),"capture-auto-icon"),C=useTheme(),{t:g}=useTranslation(),I=ba(s||0),S=useCallback(T=>`Auto ${T} - ${a} ${I.integerAmount}.${I.decimalAmount}`,[a,I.decimalAmount,I.integerAmount]),A=useCallback(T=>{let w=T==="Capture"?r:i,{integerAmount:h,decimalAmount:P}=ca(w,a);return `Partial ${T} - ${a} ${h}.${P}`},[r,i,a]),u=t>0?jsx(p,{title:A("Capture"),children:jsxs(Pr,{isCapture:true,isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:C.shadows[4]}},children:[jsx(Dr,{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(vr,{isCapture:true,percentage:t,children:[t,"% ",jsx(Er,{isCapture:true,percentage:Rr(t)})]}),o>1&&jsxs(z,{compact:true,color:"dark",children:[o,"x"]})]})]})}):n==="CAPTURED"&&!m?jsx(p,{title:S("Capture"),children:jsx(eo,{children:jsx(bt,{src:qo.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:S("Capture"),children:jsx(eo,{children:jsx(bt,{src:qo.CAPTURED?.icon,alt:"auto"})})}),x=t===100?jsx(p,{title:g("captured"),children:jsx(dd,{children:jsx(bt,{src:jk,alt:"captured"})})}):u,b=useMemo(()=>p$1&&x?jsx(b$1,{copyTrigger:"click",copyText:g("captured"),children:g("captured")}):l&&x?jsx(pd,{children:g("captured")}):x,[l,x,p$1,g]);return b&&jsx("div",{id:f,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:b})}var tg=QS;function iw({voidPercentage:e,capturePercentage:t,voidCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:l,isSheetViewShown:s,selectionProps:p$1={},remainingAmount:c}){let m=Number(t)+Number(e)===100||c<=0,f=Vb$1(useId(),"void-auto-icon"),C=useTheme(),{t:g}=useTranslation(),I=ba(c||0),S=useCallback(T=>`Auto ${T} - ${a} ${I.integerAmount}.${I.decimalAmount}`,[a,I.decimalAmount,I.integerAmount]),A=useCallback(T=>{let w=T==="Capture"?r:i,{integerAmount:h,decimalAmount:P}=ca(w,a);return `Partial ${T} - ${a} ${h}.${P}`},[r,i,a]),u=e>0||i?jsx(p,{title:A("Void"),children:jsxs(Pr,{isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:C.palette.common.white,border:`0.75px solid ${C.palette.grey[600]}1A`},variants:{animate:{boxShadow:C.shadows[4]}},children:[jsx(Dr,{src:Ak,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(vr,{percentage:e,children:[e,"% ",jsx(Er,{percentage:Rr(e)})]}),o>0&&jsxs(z,{compact:true,color:"neutral",children:[o,"x"]})]})]})}):n==="VOID"&&!m?jsx(p,{title:S("Void"),children:jsx(eo,{children:jsx(bt,{src:qo.VOID?.icon,alt:"auto"})})}):null,x=e===100?jsx(p,{title:g("void"),children:jsx(eo,{children:jsx(bt,{src:Ak,alt:"void"})})}):u,b=useMemo(()=>s&&x?jsx(b$1,{copyTrigger:"click",copyText:g("void"),children:g("void")}):l&&x?jsx(cd,{children:g("void")}):x,[l,x,s,g]);return b?jsx("div",{id:f,"data-testid":"VoidAutoIcon",style:{...!s&&{zIndex:11}},children:b}):null}var ng=iw;var aw=tg;var cw=({authorizedStatus:e,isTextShown:t,iconStyles:o,tableMode:n,chipIndex:r=0,selectionProps:i={}})=>{let{t:a}=useTranslation(),l=useTheme(),s=a(ft(e));return qa$1(n)?jsx(b$1,{copyTrigger:"click",copyText:s,children:s}):jsx(p,{title:s,children:t?jsx(V,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:l.palette.info.dark},children:s}):jsx(d,{src:Et[e],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:o})})};var rg=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)})),ig=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),ds=styled$1("img")(()=>({width:"10px",height:"10px"})),ms=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"})),us=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"}})),ag=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),lg=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),sg={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},pg={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},cg={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},dg={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},fs={fadeIn:{duration:.3},animate:{duration:.1}},mg={fadeIn:{opacity:1}},ug=styled$1(V)(()=>({width:"88px",height:"100%"})),Cs=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.25),height:"100%"}));function He({chargeStatus:e,gatewayTooltip:t,acquirerTooltip:o,chargeTooltip:n,errorCode:r,isTextShown:i,gatewayCode:a,acquirerCode:l,unCapturedStyles:s,iconStyles:p$1,iconWrapperStyles:c,gatewayIconWrapperStyles:m,gatewayContainerStyles:f,gateWayIconStyles:C,showBadge:g=true,isSheetViewShown:I=false,selectionProps:S={},chipIndex:A=0}){let u=e?oi[e]:null,x=e?vm[e]:null,b=useTheme(),{t:T}=useTranslation(),w=Vb$1(useId(),"charge-status-icon"),h=n&&jsx(Fragment,{children:jsx("div",{children:n})}),P=o&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:o})]}),k=t&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:t})]}),H=e&&ke[e]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:u?"50%":"",...c},children:jsx(_,{src:ke[e],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:u?"50%":"",width:"16px",height:"16px",...p$1}})});return I?jsxs(Cs,{children:[jsxs(b$1,{copyTrigger:"click",copyText:T(ft(e)),children:[T(ft(e))," ",r]}),u&&jsxs(Fragment,{children:[a&&jsxs(b$1,{copyTrigger:"click",copyText:"Gateway",children:["Gateway ",a]}),l&&jsxs(b$1,{copyTrigger:"click",copyText:"Acquirer",children:["Acquirer ",l]})]})]}):i?jsxs(Cs,{children:[jsx(p,{title:h,children:jsxs(ug,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:u?.background||x?.background||"transparent",color:u?.color||x?.color||b.palette.info.dark,borderColor:`${u?.color||x?.color||b.palette.info.dark}1A`},children:[T(ft(e))," ",r]})}),u&&jsxs(Fragment,{children:[a&&jsx(p,{title:k,children:jsxs(V,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:u?.background||x?.background||"transparent",color:u?.color||x?.color||b.palette.info.dark},children:["Gateway ",a]})}),l&&jsx(p,{title:P,children:jsxs(V,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:u?.background||x?.background||"transparent",color:u?.color||x?.color||b.palette.info.dark},children:["Acquirer ",l]})})]})]}):jsx(Ce,{id:w,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...c},children:Pn$1?.includes(e||"")&&(h||P||k)?jsxs(lg,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...g&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...s},children:[jsx(ag,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:u?.background}},children:jsx(p,{title:h??T(ft(e)),children:jsxs(Fragment,{children:[H,jsx(ig,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:dg,style:{...r&&{padding:"0 !important"}},children:jsx(rg,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:u?.color},transition:sg,variants:mg,initial:{opacity:0},children:r})})]})})}),jsx(us,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:fs,variants:pg,style:f,isVisible:!!k,children:k&&jsx(p,{title:k,children:jsx(ms,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:u?.background,...m},children:jsx(ds,{src:u?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:C})})})}),jsx(us,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:fs,variants:cg,style:f,isVisible:!!P,children:P&&jsx(p,{title:P,children:jsx(ms,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:u?.background,...m},children:jsx(ds,{src:u?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:C})})})})]}):jsx(p,{title:h??T(ft(e)),children:jsx(Ce,{children:H})})})}var xw=()=>{let{t:e}=useTranslation(),t=Vb$1(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 yw={G:"Global",R:"Regional",L:"Local"},At=({geographyVariant:e,countryCode:t,isTextShown:o})=>{let n=e?yw[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$3,{countryCode:t})})};var bw=({geographyVariant:e,isTextShown:t,deviceCountry:o,deviceType:n,tableMode:r})=>{let i=Vb$1(useId(),"device-icon-chip");return jsxs(Bn,{id:i,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...qa$1(r)&&{height:"18px"}},children:[jsx(At,{geographyVariant:e,isTextShown:t,countryCode:o}),jsx(c$1,{type:n,isTextShown:t,tableMode:r})]})};var ww=({isDisputeOpen:e,iconStyles:t})=>{let o=Vb$1(useId(),"dispute-icon");return jsx(_,{id:o,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:e?va$1:ua,alt:"dispute-icon",style:t})};var yg=styled$1(Bn,{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",gap:e.spacing(.5),...qa$1(t)&&{height:"18px"},alignItems:"center"})),hg=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function xs({countryCode:e,isTextShown:t,cardNumber:o,bankName:n,tableMode:r}){let i=Vb$1(useId(),"issuer-icon"),a=o?.slice(0,4),l=o?.slice(-4);return jsxs(yg,{id:i,"data-testid":"IssuerIcon",tableMode:r,children:[e&&jsx(At,{countryCode:e,isTextShown:t}),jsx(p,{title:`${n?`Issuer - ${n}`:""}`,children:jsx(hg,{children:`${a||""} ${l||""}`})})]})}var Dw=xs;var kw=({payoutStatus:e="PENDING",isTextShown:t,payoutTooltip:o,iconStyles:n,isSheetViewShown:r,chipIndex:i=0,selectionProps:a={}})=>{let{t:l}=useTranslation(),s=Vb$1(useId(),"payout-icon"),p$1=l(ft(e)),c=o||p$1;return r?jsx(b$1,{copyTrigger:"click",copyText:p$1,children:p$1}):jsx(p,{title:c,children:t?jsx(mi,{id:s,"data-testid":"StatusCell_PayoutStatusLabel",children:p$1}):jsx(_,{id:s,src:dn[e],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:n})})};var Fw=({isTextShown:e,refundStatus:t="PENDING",refundTooltip:o="",refundCount:n,iconStyles:r,isSheetViewShown:i,chipIndex:a=0,selectionProps:l={}})=>{let{t:s}=useTranslation(),p$1=useTheme(),c=Vb$1(useId(),"refund-icon"),m=(n||0)>1,f=s(ft(t));if(i)return jsxs(b$1,{copyTrigger:"click",copyText:f,children:[f," ",m?`${n}x`:null]});let C=jsxs(Ad,{"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(mi,{id:c,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:Ya[t].color,backgroundColor:Ya[t].backgroundColor,width:"90px"},children:jsxs(Ea,{whileInView:m?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[f," ",m?C:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:m?jsxs(Ea,{id:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[jsx(wd,{src:sk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),C]}):jsx(_,{id:c,src:Pm[t],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:r})})},Ig=Fw;var Ow=Ig;var Hw={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},se=e=>Hw[e?.toLowerCase()||""]||e;styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var bg=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 Tg=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Sg=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 wg=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function Me({source:e,isTextShown:t,title:o,width:n,height:r,imgSx:i}){let{t:a}=useTranslation(),l=h$1(e);return jsx(p,{title:o,children:t?jsx(Sg,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(Tg,{"data-testid":"SourceCell_TextLabel","data-source":e,children:a(ft(e))})}):jsx(bg,{src:l,alt:e,width:n,height:r,onError:s=>{s.currentTarget.src=h$1("card");},sx:i})})}function qw({payment:e,card:t,isTextShown:o,firstIcon:n}){let r=Vb$1(useId(),"source-icons"),{t:i}=useTranslation(),a=useCallback(()=>{let p=[],c=yb$2(e),m=e?.method,f=e?.scheme;return se(m)?.toLowerCase()===se(f)?.toLowerCase()?p.push(se(m),se(c)):p.push(se(m),se(c),se(f)),p},[e]),l=useMemo(()=>jsx(Me,{source:n,isTextShown:o,title:i(ft(n))},n),[n,o,i]),s=useMemo(()=>a()?.filter(p=>!!p&&p!==n)?.map((p,c,m)=>{let f=e?.wallet===i("sv_wallet")?i("storedValueWallet"):i("passThruWallet"),C=c===m.length-1&&t?.last_four?`${i(ft(p))} - ${t?.last_four}`:i(ft(p));return jsx(Me,{source:p,isTextShown:o,title:c===0&&p==="Wallet"?f:C},`${p}-${c}`)}),[a,e,t,o,i,n]);return jsxs(Box,{id:r,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[n&&l,s,t?.last_four&&jsxs(wg,{children:["\xB7\xB7\xB7 ",t?.last_four]})]})}var Nn={PROCESSED:Vg,FAILED:""};var Eg=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Dg=styled("img")(()=>({width:"16px",height:"16px"})),Rg=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ri({status:e,isTextShown:t,isSheetViewShown:o}){let n=useTheme$1(),{t:r}=useTranslation(),i=Vb$1(useId(),"destination-icon"),a=r(ft(e));return o&&Nn[e]?jsx(b$1,{copyTrigger:"click",copyText:a,children:a}):t&&Nn[e]?jsx(Eg,{id:i,"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:"#1F88D00D",color:e==="PROCESSED"?n.palette.info.dark:n.palette.common.black},children:a}):jsx(Rg,{id:i,"data-testid":"DestinationIcon",className:"destination-status",children:e&&Nn[e]&&jsx(p,{title:r(ft(e)),children:jsx(Dg,{src:Nn[e],alt:"destination-icon"})})})}
|
|
1
|
+
import {a}from'./chunk-Z3NFOUSJ.js';import {b as b$4,h,c,j as j$1,i}from'./chunk-NR5II44J.js';import {b as b$6}from'./chunk-VYVRCIYJ.js';import {a as a$1}from'./chunk-BFBJOTG2.js';import {a as a$2}from'./chunk-UF4J7JEY.js';import {b as b$7}from'./chunk-LVK5VG43.js';import {b as b$1}from'./chunk-LJWTINBT.js';import {b as b$5}from'./chunk-W77B5KVI.js';import {b as b$8}from'./chunk-26OK5BYP.js';import {d as d$1}from'./chunk-6LO7PI3V.js';import {c as c$1}from'./chunk-PEOYN7GO.js';import {b as b$2}from'./chunk-LZKPVI6B.js';import {b as b$3}from'./chunk-OHT5KJVT.js';import {b as b$a}from'./chunk-PNLHCTCW.js';import {b as b$9}from'./chunk-N57Z6DIM.js';import {l,p as p$1}from'./chunk-JY4U45C5.js';import {n,u,y as y$1}from'./chunk-IXFXTDH7.js';import {t,p,z,j,b,D,d,R,B,v as v$1,V as V$1,f}from'./chunk-6ZPNLCMN.js';import {Vb as Vb$1,Ab,qa as qa$1,Hb,fa,Ya as Ya$1,Xa as Xa$1,Wa,xa,Ra,Sa,Ua,Va,Ta,ub,W,ca,Z,ba,zb as zb$1,pa,yb as yb$2}from'./chunk-MMXWSV6V.js';import {v,m,b as b$b,r}from'./chunk-53X3U5WT.js';import {Cb,zb,Bb,Xd,Fj,rc,Ei as Ei$1,Ci as Ci$1,Di as Di$1,Eh,Pg,Vh,Ve,ik,ja as ja$1,Ak,rk,F,E,jc,kc,hc,ma,Ll as Ll$1,Eb,Fb as Fb$1,Gb,C,Zj,Dh,yb as yb$1,im as im$1,xb as xb$1,Hb as Hb$1,gh,lh,mh,jh,ih,dh,eh,fh,bh,ch,nh,T,zi,Bi,Ai as Ai$1,yi,Fi as Fi$1,Wg,Rj,Sj,H,no,G,wb as wb$1,z as z$1,cp,da,ca as ca$1,na,tk,Ck,uk,kk,mk,xk,zk,sk,pk,qk,Pn as Pn$1,cc,dc,Rh,vk,Bk,jk,Oh,oh as oh$1,zh as zh$1,yh,xh,wh,vh,uh,th as th$1,sh,rh,qh,ph,Yh as Yh$1,Wh,Xh as Xh$1,$h as $h$1,_h as _h$1,de,_d,ce,Hn,Fn,vi as vi$1,qb as qb$1,$d as $d$1,wn as wn$1,ae,rb as rb$1,Gh as Gh$1,Fh,Ih,Kh,Jh as Jh$1,Lh,wk,me,vf as vf$1,uf as uf$1,tf as tf$1,sf as sf$1,rf as rf$1,wf as wf$1,qf,Ba,Aa,nf as nf$1,mf as mf$1,lf as lf$1,hi as hi$1,gi,ji,ii,ki,ak,_j,$j,Kj,Ij,Jj,Tb,Pm as Pm$1,Mm as Mm$1,Hm,Im as Im$1,Om,Am as Am$1,Qm,Bm as Bm$1,Rm as Rm$1,Cm,Jm as Jm$1,Em as Em$1,Gm as Gm$1,Nm as Nm$1,Fm,ym as ym$1,Km as Km$1,Lm as Lm$1,zm as zm$1,Dm as Dm$1,xm,wm as wm$1,vm as vm$1,um as um$1,tm as tm$1,$g as $g$1,Xk,fk,vb,gk,hk,ub as ub$1,nk,sb,ok,va as va$1,ua,h as h$1,Vg,oo as oo$1}from'./chunk-VRGBJY4Q.js';import is,{forwardRef,useId,memo,useState,useEffect,useMemo,useCallback,useRef,Fragment as Fragment$1}from'react';import {useTranslation}from'react-i18next';import {styled,Box,Menu,MenuItem,ListItemIcon,ListItemText,Paper,Button,TextField,Typography,Popper,CircularProgress,Link,useTheme as useTheme$1,TableCell}from'@mui/material';import {motion,AnimatePresence,Reorder,useDragControls}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {styled as styled$1,useTheme}from'@mui/material/styles';import qg from'@mui/material/TableCell';import Bn from'@mui/material/Box';import ay from'@mui/material/SvgIcon';import ft from'lodash/camelCase';import $m from'dayjs';import DI from'dayjs/plugin/timezone';import RI from'dayjs/plugin/utc';import eu from'lodash/startCase';import oT from'@mui/material/Popover';import cS from'@mui/material/ClickAwayListener';import iS from'@mui/material/Popper';import IS from'@mui/material/Typography';import RC from'@mui/material/Button';var hr={ORDER:{label:"order",icon:yi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:Ai$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Bi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:zi,color:"#32ADE6"}},Ir={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 br=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Tr=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),Sr=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Hg({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n}){let r=Vb$1(useId(),"agreement-icon"),i=useTheme$1(),{t:a}=useTranslation(),l=useMemo(()=>[...t?[Ir.SAVED_TOKEN]:[],...(o||0)>0?[Ir.COUNT]:[],...e&&hr[e]?[hr[e]]:[]],[t,o,e]),s=m=>n?jsx(Sr,{"data-testid":"AgreementCell_countBadge",children:jsx(p,{title:a("totalPaymentCount",{amount:b$b(o)}),children:jsx(Tr,{children:jsxs(br,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:Ir.COUNT.color},children:["x",o]})})})},m):jsx(a$2,{value:o,index:m},m),p$1=l.map((m,f)=>m.label==="countBadge"?s(f):jsx(p,{title:a(m.label),children:jsx(Sr,{children:n?jsx(Tr,{children:jsx(br,{"data-testid":"AgreementCell_agreementType",sx:{color:m.color},children:a(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(Sr,{children:n?jsx(Tr,{children:jsx(br,{"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:Fi$1,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 Kc=Hg;var zg=Kc;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 Xc=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Jc=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 Qc=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"4px"}));var wa={"3DS":{tooltip:"3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:ch,borderColor:"rgba(31, 136, 208, 0.10)"}},ed={FAILED:{tooltip:"Failed",icon:Wg,borderColor:"rgba(255, 61, 0, 0.10)"},REJECTED:{tooltip:"Rejected",icon:dh,borderColor:"rgba(255, 61, 0, 0.10)"}};function $g({transactionStatus:e,eci:t,authType:o,isTextShown:n}){let r=Vb$1(useId(),"auth-icons"),i=useMemo(()=>{let l=e?ed[e]:null,s=l?.tooltip,p=e==="AUTHENTICATED"?null:l?.icon;return [{tooltip:s,content:n?s:p,type:n?"text":"icon"},...o?[{tooltip:o,content:n?wa[o]?.tooltip:wa[o]?.icon,type:n?"text":"icon"}]:[],{tooltip:"",content:t?`ECI ${t}`:"",type:"text"}]},[e,n,o,t]),a=useMemo(()=>i.filter(l=>!!l.content).map((l,s)=>{let p$1=l.type==="text"?jsx(Jc,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(Xc,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":l.content,children:l.content})}):jsx(d,{sx:{width:"16px",height:"16px"},src:l.content,alt:l.tooltip});return jsx(p,{title:l.tooltip,children:p$1},`${l.tooltip}-${s}`)}),[i]);return jsx(Qc,{id:r,"data-testid":"AuthIcons",children:a})}var od=$g;var Gg=(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 Yg=od;var nd=styled$1(qg,{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 Jg=forwardRef(({children:e,...t},o)=>{let n=Vb$1(useId(),"table-cell");return jsx(nd,{id:n,component:"div","data-testid":"TableCell",...t,ref:o,children:e})}),y=memo(Jg);var id=styled("span",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:t})=>({display:"flex",width:"17px",height:"12px",backgroundColor:t?Ab(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"}),et=styled(motion.div)(({theme:e})=>({borderRadius:"12px",backgroundColor:e.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5)})),tA=styled("img")(()=>({width:"12px",height:"12px"})),ad=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"})),oA=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})),ld=styled("div")(()=>({display:"flex",width:"24px",height:"24px",alignItems:"center",justifyContent:"center",borderRadius:"64px;",border:"1px solid #F2F2F2;"})),sd=styled(t)(({theme:e})=>({width:24,height:24,fontSize:"8.5px",fontWeight:500,color:e.palette.background.default,border:`1px solid ${e.palette.divider}`})),V=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}`})),pd=styled(V)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:e.palette.info.light,borderColor:e.palette.divider,minWidth:"88px",height:"24px"})),cd=styled(V)(({theme:e})=>({color:e.palette.grey.A700,backgroundColor:`${e.palette.grey.A700}1A`,minWidth:"88px",height:"24px"})),wr=styled(y)(()=>({fontSize:"11px",textAlign:"left",display:"flex",justifyContent:"flex-start",alignItems:"center",overflow:"hidden",gap:"4px",textOverflow:"ellipsis",whiteSpace:"nowrap"})),ye=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Ce=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),_=styled("img")(()=>({width:"36px",height:"24px"})),Ar=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"}`})),tt=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:hk},CAPTURED:{icon:gk}};var Pr=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})),vr=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)})),Er=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"}`})),Dr=styled$1("img")({width:"14px",height:"14px"}),eo=styled$1(Ce)({width:"16px",height:"16px"}),bt=styled$1("img")({width:"16px",height:"16px"}),dd=styled$1(Box)({display:"flex",alignItems:"center",justifyContent:"center"});function Rr(e){return e<5?5:e===100?95:e}var md=styled$1(Bn)({display:"flex",alignItems:"center",gap:"12px"});function ax({value:e,format:t,flagIcon:o,hasFlag:n,tableMode:r,...i}){let a=o&&jsx(p,{title:fa(o||""),children:jsx(b$3,{countryCode:o})}),l=useMemo(()=>v(e,t),[e]);return jsx(y,{...i,children:jsxs(md,{children:[n&&jsx(id,{sx:{visibility:"visible"},className:"geography-box",children:a}),jsx(Box,{sx:{...qa$1(r)&&{fontSize:"11px"}},children:l})]})})}var Zo=ax;function ud({value:e,currentTimezone:t=no.UTC,timezoneOffset:o=0,defaultTimezoneOffset:n=0,hideTimezoneIcon:r$1=false,...i}){let a=m=>r(e,{currentTimezone:t,targetTimezone:m}),l=a(o),s=a(n),p$1=v(s),c=!r$1&&n!==o;return jsxs(Bn,{sx:{display:"flex",gap:"8px"},children:[jsx(Zo,{value:l,...i}),c&&jsx(p,{title:p$1,children:jsx("img",{src:H,width:14,alt:"timezone"})})]})}function dx({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}`,a=jsx(Fragment,{children:o?.map(l=>{let s=l.name||l.description,p=(s?.length||0)>20?`${s?.slice(0,20)}...`:s;return jsx("div",{children:p},l.id)})});return jsx(p,{title:(o||[]).length>1?a:void 0,children:jsx(y,{...n,children:jsx("span",{children:i})})})}var mx=dx;function fx({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(y,{sx:{fontSize:"11px"},...n,children:i})}var Cx=fx;var fd=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Lr=styled$1("span",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"25ch",flex:1,...qa$1(t)&&{fontSize:"11px",color:e.palette.text.primary}})),Cd=styled$1("span")({width:"11.6px",height:"11.6px",flexShrink:0,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"flex-start"}),gd=styled$1("img")({width:"11.6px",height:"11.6px",borderRadius:"50%"});function yx({customerInitiated:e,children:t,isTimezoneIconShown:o,hasCustomerIcon:n,customerIcon:r,customerName:i,hideCustomerInitiatedIcon:a,hideTimezoneIcon:l,phone:s,email:p$1,id:c,...m}){let{t:f}=useTranslation(),C=e===false?f("merchantInitiated"):"",g=ub(i),I=i?.split(" ")?.map(b=>b?.[0]?.toUpperCase()).join(""),S=useMemo(()=>W(),[]),A=n&&jsx(p,{title:t,children:jsx(sd,{"data-testid":"CustomerCell_customerShownIcon",sx:{background:S},src:r,alt:r,children:I})}),u=useMemo(()=>[{name:"ID",value:c},{name:"Name",value:i},{name:"Email",value:p$1},{name:"Phone",value:s}],[p$1,s,c,i]),x=useMemo(()=>u.some(({value:b})=>b)?jsx("div",{"data-testid":"CustomerCell_customerTooltip",children:u.map(({name:b,value:T},w)=>T&&jsx("div",{"data-testid":`CustomerCell_customerTooltip_${b}`,children:b==="Name"?T:`${b}: ${T}`},`${w}-${T}`))}):null,[u]);return jsx(y,{...m,"data-testid":"CustomerCell_TableCell",children:jsxs(fd,{"data-testid":"CustomerCell_StyledCustomerCell",children:[A,jsx(p,{title:x,children:jsx(Lr,{"data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":g,children:t})}),!l&&jsx(Cd,{"data-testid":"CustomerCell_StyledCustomerIconContainer",children:o&&jsx(gd,{src:G,"data-testid":"CustomerCell_StyledCustomerIcon"})}),!a&&jsx(p,{title:C,children:jsx(ad,{"data-testid":"CustomerCell_StarBadgeWrapper",className:"geography-box",isShown:!!C,children:C&&jsx("img",{"data-testid":"CustomerCell_merchantInitiatedIcon",src:wb$1,alt:"merchant",style:{width:"16px",height:"16px"}})})})]})})}var hx=yx;function bx({children:e,customerName:t}){let o=ub(t);return jsx(Lr,{tableMode:"sheet","data-testid":"CustomerCell_StyledCustomerName","data-is-arabic":o,children:e})}var Tx=bx;var kr=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",gap:e.spacing(1)})),xd=styled$1("span")(({theme:e,tableMode:t})=>({backgroundColor:e.palette.grey[100],display:"block",borderRadius:"4px",padding:"1.5px 3px",fontSize:qa$1(t)?"11px":"10px",lineHeight:"13px",textTransform:"uppercase",fontWeight:e.typography.fontWeightBold})),yd=styled$1("span")(({theme:e,tableMode:t})=>({fontSize:qa$1(t)?"11px":e.typography.body2.fontSize,lineHeight:"17px",fontWeight:"700"})),va=styled$1("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"})),Vr=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 h1=({type:e,selectAmount:t,selectCurrency:o,requestAmount:n,requestCurrency:r,merchantAmount:i,merchantCurrency:a})=>{let l=ca(t,o),s=ca(n,r),p=ca(i,a);return jsxs(va,{sx:{textAlign:"right",justifyContent:"flex-end"},children:[jsx("span",{style:{fontWeight:"bold"},children:e?Z[e]:""}),jsxs(va,{children:[e!=="fx"&&jsxs(Vr,{children:[jsx("span",{children:"Customer Selected"})," ",jsxs("span",{children:[jsx(b$9,{currency:o})," ",l.integerAmount,".",l.decimalAmount]})]}),jsxs(Vr,{children:[jsx("span",{children:"Charge"})," ",jsxs("span",{children:[jsx(b$9,{currency:r})," ",s.integerAmount,".",s.decimalAmount]})]}),jsxs(Vr,{children:[jsx("span",{children:"Settlement"})," ",jsxs("span",{children:[jsx(b$9,{currency:a})," ",p.integerAmount,".",p.decimalAmount]})]})]})]})};var to=({tableMode:e,conversionType:t})=>t?jsx(xd,{tableMode:e,className:"conversion-type",children:t}):jsx(Fragment,{});var oo=({tableMode:e,amount:t,currency:o})=>jsx(yd,{tableMode:e,children:t!==void 0?jsxs(Fragment,{children:[jsx("span",{children:jsx(b$9,{currency:o,fontSize:10})})," ",jsx(b$a,{amount:t,currency:o,sx:{fontSize:"inherit",fontWeight:"inherit"}})]}):jsx("span",{children:"-"})});var Id="default";function Ex({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(y,{...i,children:jsxs(kr,{children:[jsx(p,{title:n||"",children:jsx(Box,{children:jsx(to,{tableMode:Id,conversionType:e})})}),o&&jsx(p,{title:jsx(b$9,{currency:o}),children:jsx(b$3,{currencyCode:o})}),jsx(p,{title:r,children:jsx(oo,{tableMode:Id,amount:t,currency:o})})]})})}var Dx=Ex;var bd="text";function Mx({conversionType:e,amount:t,currency:o,tooltipLabel:n,amountTooltipLabel:r,...i}){return jsx(y,{...i,children:jsxs(kr,{children:[jsx(p,{title:n||"",children:jsx(to,{tableMode:bd,conversionType:e})}),jsx(p,{title:jsx(b$9,{currency:o}),children:jsx("span",{})}),jsx(p,{title:r,children:jsx(oo,{tableMode:bd,amount:t,currency:o})})]})})}var Lx=Mx;var Td="sheet";function Vx({conversionType:e,amount:t,currency:o}){let{integerAmount:n,decimalAmount:r}=ca(t,o);return jsxs(b$1,{copyTrigger:"click",copyText:t?`${n}.${r}`:"-",children:[jsx(to,{tableMode:Td,conversionType:e}),jsx(oo,{tableMode:Td,amount:t,currency:o})]})}var Bx=Vx;var wd=styled$1(motion.img)(()=>({width:"14px",height:"14px"})),Ad=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})),Ea=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"})),ro=(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}}),io=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"}})),ao=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}})),lo=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"})),Pd=styled$1("div")(()=>({display:"flex",gap:"4px",justifyContent:"flex-start",alignItems:"center",position:"relative",width:"100%",overflow:"visible"}));var vd=e=>e?Object.keys(e).filter(t=>e[t]).reduce((t,o)=>(t[o]=e[o],t),{}):{};var so=({statuses:e,centerIconKey:t})=>{let o=useMemo(()=>vd(e),[e]),n=useMemo(()=>Object.values(o).filter(Boolean),[o]),r=useMemo(()=>{if(!t)return 0;let i=Object.entries(o).findIndex(([a])=>a===t);return i===-1?Math.floor((n.length-1)/2):i},[o,t,n.length]);return {statusesList:n,centerIconIndex:r}};function Fx({statuses:e,centerIconKey:t,...o}){let{statusesList:n}=so({statuses:e,centerIconKey:t}),r=useTheme(),i=n.length||0;return jsx(y,{...o,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(lo,{whileHover:"animate",animate:"start",statusesCount:i,children:n.map((a,l)=>a?jsx(ao,{order:l,variants:ro(l,r.shadows[4],40),children:jsx(io,{children:a})},l):null)})})}var Ox=Fx;function _x({statuses:e,...t}){let{statusesList:o}=so({statuses:e});return jsx(y,{...t,children:jsx(Pd,{sx:{paddingRight:"30px"},children:o.map((n,r)=>jsx(Fragment$1,{children:n},r))})})}var zx=_x;function $x({statuses:e,centerIconKey:t,xGap:o,...n}){let{statusesList:r}=so({statuses:e,centerIconKey:t}),i=useTheme(),a=r.length||0,l=o||120;return jsx(y,{...n,"data-testid":"StatusCell",sx:{position:"relative",overflow:"visible"},children:jsx(lo,{whileHover:"animate",animate:"start",statusesCount:a,children:r.map((s,p)=>s?jsx(ao,{order:p,variants:ro(p,i.shadows[4],l),children:jsx(io,{isTextShown:true,children:s})},p):null)})})}var Gx=$x;var Zx=styled(Menu)(()=>({zIndex:2e3,".MuiMenu-paper":{borderRadius:4},".MuiMenu-list":{padding:0}})),Xx=styled(MenuItem)(({theme:e})=>({display:"flex",gap:"4px",minHeight:"36px",alignItems:"center",paddingInline:8,"&:hover":{backgroundColor:"transparent",boxShadow:e.shadows[10]}})),Jx=styled(ListItemIcon)(()=>({minWidth:"16px !important"})),Qx=styled(ListItemText)(()=>({".MuiTypography-root":{fontSize:"0.6875rem"}})),Fr=({id:e="ActionMenu",open:t,anchorEl:o,onClose:n,items:r})=>jsx(Zx,{id:e,"data-testid":"ActionMenu",open:t,anchorEl:o,onClose:n,onContextMenu:i=>{i.preventDefault(),n();},children:r.map((i,a)=>jsxs(Xx,{onClick:l=>{i.onClick?.(l);},onContextMenu:i.onContextMenu,children:[i.icon&&jsx(Jx,{children:i.icon}),jsx(Qx,{children:i.label})]},`${i.label}-${a}`))});var Hr=styled$1("section",{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",textAlign:"center",borderRadius:"50%",gap:qa$1(t)?"4px":e.spacing(1),overflow:"visible"})),_r=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}})),Ed=styled$1("img",{shouldForwardProp:e=>e!=="isActive"})(({isActive:e})=>({width:"18px",height:"18px",...!e&&{pointerEvents:"none",filter:"opacity(0.3)"}})),Se=styled$1(motion.img)(({icon:e})=>({width:"13.3px",height:"13.3px",...e==="cancel"&&{padding:"1.15px"}}));function Dd({isAnyActionLoading:e,isAnyActionHasError:t,isAnyActionSuccessful:o,areThereAnyShownActions:n}){let{t:r}=useTranslation();return t?jsx(Se,{src:jc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"fail-icon"):o?jsx(Se,{src:kc,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},"success-icon"):e?jsx(Se,{src:hc,className:"spinner-loader"},"spinner-icon"):jsx(p,{title:r("moreActions"),children:jsx(Ed,{alt:"more",src:ma,isActive:n},"ellipsis-icon")})}Dd.displayName="ActionIconsVariants";var tn=memo(Dd);var po={GRAY:{icon:Bb,color:"#CFCFCF"},ORANGE:{icon:zb,color:"#FFD503"},RED:{icon:Cb,color:"#FF0000"}},zr={"#CFCFCF":"gray","#FFD503":"orange","#FF0000":"red",gray:"gray",red:"red",orange:"orange"},Ur={flag:E,dispute:F,refund:rk,void:Ak,capture:ja$1,cancel:ik,clock:Ve,reverse:Vh,destination:Pg,invoice:Eh,users:Di$1,brand:Ci$1,clipboard:Ei$1,viewApi:Xd,viewReceipt:rc,delete:Fj};function $r({actions:e,isDropdownShown:t,onCloseDropdown:o,renderDropdown:n}){let[r,i]=useState(null),a=!!r,l=(e||[]).filter(g=>g.isShown!==false),s=l.some(g=>g.isLoading),p=l.some(g=>g.isError),c=l.some(g=>g.isSuccess),m=l.length>0||!!n,f=g=>{s||!m||i(g.currentTarget);},C=()=>{i(null),o?.();};return useEffect(()=>{t||i(null);},[t]),{anchorEl:r,open:a,filteredActions:l,isAnyActionLoading:s,isAnyActionHasError:p,isAnyActionSuccessful:c,areThereAnyShownActions:m,handleClick:f,handleClose:C,setAnchorEl:i}}var Rd=e=>jsx(ay,{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 Ld=".IDButton-root:not(.IDButton-hoverDisabled):hover &",kd=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",[Ld]:{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}})),Vd=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"},[Ld]:{gridTemplateColumns:"1fr",opacity:1,transition:"grid-template-columns 0.3s ease, opacity 0.3s ease 0.3s"}}));function dy({icon:e=jsx(Rd,{}),id:t,sx:o,disableOnHoverEffect:n=false,onCopyId:r,className:i,...a}){let{t:l}=useTranslation();return jsx(p,{title:l("copy"),children:jsx(Bn,{className:Hb("IDButton-root",n&&"IDButton-hoverDisabled",i),sx:{position:"relative",width:"24px",height:"24px",cursor:"pointer",...o},...a,children:jsxs(kd,{className:"IDButton-button",children:[t?jsx(Vd,{className:"IDButton-rowId",children:jsx("span",{children:t})}):null,t?jsx(D,{className:"IDButton-icon",icon:e,text:t,onClick:()=>r?.()}):null]})})})}var La=memo(dy);var Ev=memo(({flag:e,actions:t,flagTooltip:o,flagsCount:n,dropdownAction:r,onCloseDropdown:i,isDropdownShown:a=true,row:l,showJsonViewer:s=true,isTextShown:p$1,showIdButton:c=true,onCopyId:m,rowId:f,onJsonViewClick:C,renderDropdown:g,startSlot:I,...S})=>{let{t:A}=useTranslation(),{open:u,anchorEl:x,filteredActions:b,isAnyActionLoading:T,isAnyActionHasError:w,isAnyActionSuccessful:h,areThereAnyShownActions:P,handleClick:k,handleClose:H,setAnchorEl:K}=$r({actions:t,isDropdownShown:a,onCloseDropdown:i,renderDropdown:g});return jsx(y,{...S,sx:{overflow:"visible",...S.sx},children:jsxs(Hr,{"data-testid":"ActionCell_ActionCellContainer",children:[I,e&&jsx(Fragment,{children:p$1?jsx(p,{title:o,children:jsx(V,{"data-testid":"ActionCell_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:o})}):jsx(p,{title:o,children:jsxs(et,{"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(Se,{"data-testid":"ActionCell_FlagIcon",sx:{width:"12px",height:"11px"},src:po[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:zr[po[e]?.color]||"orange","data-testid":"ActionCell_StyledBadge",children:[n,"x"]})})]})})}),c&&jsx(La,{id:f||l.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:C,type:"button","data-testid":"ActionCell_TransparentButton",children:jsx(p,{title:A("jsonViewer"),children:jsx(ld,{"data-testid":"ActionCell_IdButtonContainer",children:jsx(motion.img,{src:Xd,alt:"icon"},"id-icon")})})})}),jsxs(_r,{id:"styled-popover",selected:!!r||u,"data-testid":"ActionCell_ActionsIconContainer","data-is-active":P,sx:{...!P&&{pointerEvents:"none"}},children:[jsx(jo,{onClick:k,"data-testid":"ActionCell_ActionsIconContainer_TransparentButton","data-is-active":P,sx:{...!P&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(tn,{isAnyActionLoading:T,isAnyActionHasError:w,isAnyActionSuccessful:h,areThereAnyShownActions:P})})}),r,g?g(x,K):jsx(Fragment,{children:P&&jsx(Fr,{open:u,onClose:H,anchorEl:x,items:b.map(B=>({label:B.label,onClick:N=>{B?.onClick?.(N),B.hasActionMenu||H();},onContextMenu:N=>{B?.onRightClick?.(N),H();},icon:B.customIcon||jsx(Se,{icon:B.icon,src:B.iconSrc??(B.icon&&Ur[B.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${B.label.trim()}`)}))})})]})]})]})})});function yy({flag:e,flagTooltip:t,flagsCount:o,row:n,showJsonViewer:r=true,isTextShown:i,showIdButton:a=true,rowId:l,onJsonViewClick:s,tableMode:p$1,...c}){return jsx(y,{...c,sx:{overflow:"visible"},children:jsxs(Hr,{"data-testid":"ActionsColumn_ActionCellContainer",tableMode:p$1,children:[e&&jsx(Fragment,{children:i?jsx(p,{title:t,children:jsx(V,{"data-testid":"ActionsColumn_FlagLabel",sx:{textAlign:"left",justifyContent:"flex-start"},children:t})}):jsx(p,{title:t,children:jsxs(et,{"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(Se,{"data-testid":"ActionsColumn_FlagIcon",sx:{width:"12px",height:"11px"},src:po[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:zr[po[e]?.color]||"orange","data-testid":"ActionsColumn_StyledBadge",children:[o,"x"]})})]})})}),a&&jsx(b$1,{sx:{minWidth:"213px"},children:l||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 hy=memo(yy);function Sy({actions:e,dropdownAction:t,onCloseDropdown:o,isDropdownShown:n=true,renderDropdown:r,...i}){let{open:a,anchorEl:l,filteredActions:s,isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:f,handleClick:C,handleClose:g,setAnchorEl:I}=$r({actions:e,isDropdownShown:n,onCloseDropdown:o,renderDropdown:r});return jsx(y,{...i,sx:{overflow:"visible"},children:jsx("div",{"data-testid":"ActionIconColumn_Container",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"5px"},children:jsxs(_r,{id:"styled-popover",selected:!!t||a,"data-testid":"ActionIconColumn_ActionsIconContainer","data-is-active":f,sx:{...!f&&{pointerEvents:"none"}},children:[jsx(jo,{onClick:C,"data-testid":"ActionIconColumn_ActionsIconContainer_TransparentButton","data-is-active":f,sx:{...!f&&{pointerEvents:"none"}},children:jsx(AnimatePresence,{mode:"wait",children:jsx(tn,{isAnyActionLoading:p,isAnyActionHasError:c,isAnyActionSuccessful:m,areThereAnyShownActions:f})})}),r?r(l,I):jsxs(Fragment,{children:[t,f&&jsx(Fr,{open:a,onClose:g,anchorEl:l,items:s.map(S=>({label:S.label,onClick:A=>{S?.onClick?.(A),S.hasActionMenu||g();},onContextMenu:A=>{S?.onRightClick?.(A),g();},icon:S.customIcon||jsx(Se,{icon:S.icon,src:S.iconSrc??(S.icon&&Ur[S.icon]),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},`action.label-${S.label.trim()}`)}))})]})]})})})}var wy=memo(Sy);function vy({deviceType:e,geographyVariant:t,isTextShown:o,deviceCountry:n,...r}){return jsx(y,{...r,children:jsxs(Bn,{sx:{display:"flex",gap:"8px",alignItems:"center"},children:[jsx(At,{geographyVariant:t,isTextShown:o,countryCode:n}),jsx(c$1,{type:e,isTextShown:o})]})})}var Ey=vy;var Wd=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1),position:"relative",minWidth:"23px",height:"24px"})),Fd=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`})),Od=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 Hd=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 Ly({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let l=useMemo(()=>{if(typeof e=="number")return e;let c=Number(e);return Number.isNaN(c)?void 0:c},[e]),s=l!==void 0?l>0:!!e,p$1=l!==void 0&&l>1;return !s||r?null:jsx(Bn,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsxs(Od,{children:[jsx(Hd,{src:z$1,pointLeft:i==="left"}),p$1&&jsx(Wd,{children:jsx(Fd,{children:e})})]})})})}var ky=Ly;function Ny(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(Bn,{sx:{display:"flex",gap:"4px",alignItems:"center"},...n,children:r.map((i,a)=>{let l=ba(i?.amount||0),s=`${l.integerAmount}.${l.decimalAmount}`;return jsxs(b$1,{copyTrigger:"click",copyText:s,children:[i?.id," | ",jsx(b$9,{currency:i?.currency})," ",s]},i?.id||a)})})}var Wy=Ny;function Hy({destinationsCount:e,destinationsTooltip:t,destination:o,destinationsAmount:n,hidden:r,iconDirection:i,...a}){let l=o?.destination||[],s=ba(n||0),p$1=ba(l?.[0]?.amount||0);return !e||r?null:jsx(Bn,{sx:{width:"fit-content",overflow:"visible"},...a,children:jsx(p,{title:t,children:jsx(V,{sx:{textAlign:"left",justifyContent:"flex-start",height:"auto"},children:e&&typeof e=="number"&&e>1?jsxs("div",{children:["Destination ",l?.[0]?.id," - ",jsx(b$9,{currency:l?.[0]?.currency})," ",p$1.integerAmount,".",p$1.decimalAmount," +",e-1]}):jsxs("div",{children:["Destination ",l?.[0]?.id," - ",jsx(b$9,{currency:l?.[0]?.currency})," ",s.integerAmount,".",s.decimalAmount]})})})})}var _y=Hy;var NE=({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=ba(r.amount||0);return jsxs("div",{children:[r?.id," - ",jsx(b$9,{currency:r?.currency})," ",i.integerAmount,".",i.decimalAmount]},r?.id)})]}):jsxs("div",{children:["Destination ",o?.[0]?.id," - ",jsx(b$9,{currency:o?.[0]?.currency})," ",t.integerAmount,".",t.decimalAmount]})};var Ud=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"})),$d=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 Gd(e){return e<5?5:e===100?95:e}function Yy({percentage:e=0,days:t,remainingAmount:o=0,currency:n,...r}){let i=useTheme(),a=jsx(b$9,{currency:n}),{integerAmount:l,decimalAmount:s}=ca(o,n),p$1=`${l}.${s}`,c=useMemo(()=>jsxs(Fragment,{children:["Remaining Authorized Balance - ",a," ",p$1]}),[o,n]);return e===0||o<0?null:jsx(y,{...r,children:jsx(p,{title:c,placement:"top",children:jsx("div",{style:{height:24},children:jsxs(Ud,{whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:22},variants:{animate:{...!!t&&{boxShadow:i.shadows[4]}}},children:[jsxs($d,{percentage:e,children:[e,"% ",jsx(Ar,{percentage:Gd(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 jy=Yy;function Ky({remainingAmount:e,currency:t}){let o=jsx(b$9,{currency:t}),{integerAmount:n,decimalAmount:r}=ca(e,t),i=`${n}.${r}`;return jsxs(b$1,{copyTrigger:"click",copyText:`${n}.${r}`,children:[o," ",i]})}var Zy=Ky;var Oa=["authenticationMode","paymentAuth","paymentAgreement"],Ha=["paymentIssuer","paymentInitiated","paymentDevice"],Yd=["paymentMethod","paymentType","paymentScheme","paymentCardNumber",...Ha,...Oa];var Kd=styled$1(Bn)(()=>({marginRight:"8px",display:"flex",alignItems:"center",gap:"4px"})),Zd=styled$1(Bn)(()=>({marginLeft:"8px",width:20}));function th(e){let{centerIcon:t,centerIconId:o}=useMemo(()=>{for(let a of Yd)if(e?.[a])return {centerIcon:e?.[a],centerIconId:a};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(b$2,{sx:{justifyContent:"center",zIndex:101},main:t,startItems:Ha.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),endItems:Oa.filter(a=>a!==o&&e?.[a]).map(a=>e?.[a]),endAdornment:n||r?jsxs(Kd,{children:[n&&e.paymentScheme,r&&e.paymentCardNumber]}):void 0,startAdornment:i?jsx(Zd,{children:e.paymentType}):void 0})}var oh=memo(th);var Jd=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function LD({card:e,paymentMethod:t,paymentType:o,paymentScheme:n}){let{t:r}=useTranslation();if(!e.last_four)return null;let i=e?.name||`${r(ft(zb$1(t,n)?o:n))} - ${e?.last_four}`;return jsx(p,{title:i,children:jsxs(Jd,{children:["\xB7\xB7\xB7 ",e?.last_four]})})}function FD({method:e}){let{t}=useTranslation();return e?jsx(Me,{source:se(e)??e,title:`Payment Method - ${t(ft(e))}`}):null}function $D({type:e}){let{t}=useTranslation();return e?jsx(Me,{source:se(e)??e??"",title:`Payment Type - ${t(ft(e))}`}):null}function ZD({scheme:e}){let{t}=useTranslation();return e?jsx(Me,{source:se(e)??e,title:`Payment Scheme - ${t(ft(e))}`}):null}var nR=({mode:e})=>e?jsx(p,{title:cp[e],children:jsx(Bn,{component:"img",src:e==="C"?da:ca$1})}):null;var Yr={ORDER:{label:"order",icon:yi,color:"#5E30EB"},SAVED_CARD:{label:"cardAgreement",icon:Ai$1,color:"#76BB40"},SUBSCRIPTION:{label:"subscription",icon:Bi,color:"#00C7BE"},INSTALLMENT:{label:"installment",icon:zi,color:"#32ADE6"}},jr={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 qr=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Kr=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px"})),tm=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"})),om=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),_a=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Zr=(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"}}}),Xr=styled(motion.span)(({order:e})=>({zIndex:(e||0)+1}));function Th({type:e,hasSavedCard:t,totalPaymentsCount:o,isTextShown:n,...r}){let i=useTheme(),{t:a}=useTranslation(),l=useMemo(()=>[...t?[jr.SAVED_TOKEN]:[],...(o||0)>0?[jr.COUNT]:[],...e&&Yr[e]?[Yr[e]]:[]],[t,o,e]),s=f=>n?jsx(Xr,{"data-testid":"AgreementCell_countBadge",order:f,variants:Zr(f,n?85:0),children:jsx(p,{title:a("totalPaymentCount",{amount:b$b(o)}),children:jsx(Kr,{children:jsxs(qr,{"data-testid":"AgreementCell_totalPaymentsCount",sx:{color:jr.COUNT.color},children:["x",o]})})})},f):jsx(a$2,{value:o,index:f},f),p$1=l.map((f,C)=>f.label==="countBadge"?s(C):jsx(p,{title:a(f.label),children:jsx(Xr,{order:C,variants:Zr(C,C>1&&n?62:0),sx:{width:n?"auto":"36px"},children:n?jsx(Kr,{children:jsx(qr,{"data-testid":"AgreementCell_agreementType",sx:{color:f.color},children:a(f.label)})}):jsx(_a,{src:f.icon,alt:"agreement"})},f.color)},f.color)),c=p$1.length,m=jsx(p,{title:"No agreement",children:jsx(Xr,{order:0,variants:Zr(0,0),sx:{width:n?"auto":"36px"},children:n?jsx(Kr,{children:jsx(qr,{"data-testid":"AgreementCell_agreementType",sx:{color:i.palette.text.secondary},children:"No agreement"})}):jsx(_a,{src:Fi$1,alt:"no-agreement"})},"no-agreement")},"no-agreement");return jsx(y,{...r,children:jsx(om,{"data-testid":"AgreementCell",children:jsx(tm,{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 Sh=Th;var rm=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 Ah({hasAuth:e,tooltip:t,isTextShown:o,align:n,...r}){return jsx(y,{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(et,{"data-testid":"AuthCell_BadgeWrapper",children:o?jsx(V,{"data-testid":"AuthCell_TextLabel",sx:{minWidth:"max-content"},children:t}):jsx(rm,{src:na,alt:"icon","data-testid":"AuthCell_AuthIcon"})})}):null})}var Ph=Ah;var im={REFUNDED:qk,PAID_OUT:pk,SETTLED:sk,PENDING:rk,UNKNOWN:zk,TIMEDOUT:xk,CANCELLED:ik,FAILED:mk,DECLINED:kk,RESTRICTED:uk,IN_PROGRESS:Ck,ACCEPTED:tk},am={REFUNDED:"refunded"};function lm({status:e,refundTooltip:t}){let{t:o}=useTranslation();return jsx(p,{title:jsxs("div",{children:[jsx("div",{children:o(ft(e))}),t]}),children:jsx(Ce,{children:jsx("img",{src:im[e],alt:"refund-requested"})})})}function pm({status:e,gatewayTooltip:t,unCapturedTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,refundTooltip:l}){let{t:s}=useTranslation();return Pn$1?.includes(e??"")?jsx(He,{chargeStatus:e,gatewayTooltip:t,chargeTooltip:o,acquirerTooltip:n,errorCode:r,acquirerCode:i,gatewayCode:a,iconWrapperStyles:{height:17}}):jsx(lm,{status:e,refundTooltip:l})}var cm=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})),dm=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})),mm=styled$1(Zo)(({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 um=styled$1("img")({width:"14px",height:"14px"}),fm=styled$1(Bn)(({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 za({status:e,refundIcon:t,refundTooltip:o,refundTooltipLabel:n,date:r$1,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:l,errorCode:s,acquirerCode:p$1,gatewayCode:c,timezone:m}){let f=useTheme(),{t:C}=useTranslation(),g=r(new Date(Number(r$1)),{currentTimezone:oo$1,targetTimezone:m?.offset}),I=useMemo(()=>t||(e==="REFUNDED"?qk:sk),[e,t]);return ["REFUNDED","PAID_OUT"].includes(e??"")?jsx(p,{title:jsxs("div",{children:[jsx("div",{children:n??C(am.REFUNDED)}),o]}),children:jsxs(cm,{whileHover:["animate","fadeIn"],animate:"start",variants:{...r$1&&{animate:{boxShadow:f.shadows[4]}}},sx:{...!r$1&&{backgroundColor:"transparent"}},children:[jsx(um,{sx:{...!r$1&&{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$1&&jsx(dm,{children:jsx(mm,{value:g})})})]})}):jsx(pm,{status:e,refundTooltip:o,gatewayTooltip:i,unCapturedTooltip:a,acquirerTooltip:l,errorCode:s,acquirerCode:p$1,gatewayCode:c})}var gm=()=>{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 _h({status:e,date:t,refundTooltip:o,isTextShown:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a,acquirerCode:l,gatewayCode:s,unCapturedTooltip:p$1,timezone:c,refundTooltipLabel:m,refundIcon:f,...C}){let{t:g}=useTranslation(),I=gm(),S=useCallback(u=>$m(u).format("MMM D, YYYY"),[]),A=Pn$1.includes(e);return jsx(y,{...C,style:{overflow:"visible"},children:jsx(ye,{children:jsx(fm,{width:n?"auto":"36px",sx:{...A&&{border:"none"}},children:n?jsx(p,{title:t?S(t):g(ft(e)),children:jsx(V,{sx:{...I[e]?I[e]:I.PENDING},children:g(ft(e))})}):jsx(za,{status:e,refundTooltip:o,date:t,gatewayTooltip:r,unCapturedTooltip:p$1,acquirerTooltip:i,errorCode:a,acquirerCode:l,gatewayCode:s,timezone:c,refundTooltipLabel:m,refundIcon:f})})})})}var zh=_h;var ym=styled("img")(()=>({width:"16px",height:"16px"})),hm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),Im=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`})),bm=styled("span")(({theme:e})=>({color:e.palette.info.dark,fontSize:"14px",lineHeight:"16.8px"}));function Uh({walletId:e,country:t,showCountry:o=true,...n}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(hm,{children:[o&&t&&jsx(p,{title:fa(t),children:jsx(b$3,{countryCode:t})}),jsxs(Im,{children:[jsx(ym,{src:cc,alt:"wallet-icon"}),e&&jsxs(bm,{children:["\xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var $h=Uh;var Tm=styled("img")(()=>({width:"16px",height:"16px"})),Sm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.5)})),wm=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}`})),Am=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 Gh({walletId:e,country:t,name:o,...n}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...n,children:jsxs(Sm,{children:[t&&jsx(p,{title:fa(t),children:jsx(b$3,{countryCode:t})}),jsxs(wm,{children:[jsx(Tm,{src:dc,alt:"bank-icon"}),e&&jsxs(Am,{children:[o," \xB7\xB7\xB7\xB7 ",e?.substring((e?.length||0)-4)]})]})]})})}var Yh=Gh;var Ga={PAID_OUT:pk,SETTLED:vk,PENDING:Rh,INITIATED:Rh,FAILED:mk};function Zh({payoutStatus:e="PAID_OUT",...t}){let{t:o}=useTranslation(),n=useTheme();return jsx(y,{...t,children:jsx(ye,{children:jsx(Ce,{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&&Ga[e]&&jsx(p,{title:o(ft(e)),children:jsx(_,{src:Ga[e],alt:"settled-icon",style:{width:"16px",height:"16px",objectFit:"contain"}})})})})})}var Xh=Zh;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 Jh=styled$1("span")(({theme:e})=>({textDecorationLine:"underline",color:e.palette.info.dark}));var ke={ABANDONED:Oh,IN_PROGRESS:Ck,VOID:Ak,CANCELLED:ik,CAPTURED:jk,INITIATED:Ck,FAILED:mk,DECLINED:kk,RESTRICTED:uk,TIMEDOUT:xk,UNKNOWN:zk,AUTHORIZED:Bk},oi={UNKNOWN:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FF7A00",background:"#FF7A001A"},TIMEDOUT:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FF7A00",background:"#FFF3E5"},FAILED:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FF7A00",background:"#FFF3E5"},DECLINED:{gatewayIcon:ok,acquirerIcon:sb,color:"#FF3D00",background:"#FFEAE5"},RESTRICTED:{gatewayIcon:ok,acquirerIcon:sb,color:"#FF3D00",background:"#FFEAE5"},ABANDONED:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FFD600",background:"#FFFBE5"},CANCELLED:{gatewayIcon:nk,acquirerIcon:ub$1,color:"#FFD600",background:"#FFFBE5"},INITIATED:{color:"#8D8D94",background:"transparent",gatewayIcon:nk,acquirerIcon:ub$1}},Pm={PENDING:rk,REFUNDED:qk},Ya={PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},REFUNDED:{color:"#4E1FD0",backgroundColor:"#4E1FD00D"}},dn={PAID_OUT:pk,SETTLED:vk,PENDING:wk},Et={AUTHORIZED:Bk},vm={CAPTURED:{color:"#1F88D0",background:"#1F88D00D"}};var ja=ke;function tI({status:e,chargeStatus:t,isTextShown:o,...n}){let{t:r}=useTranslation();return jsx(y,{...n,children:jsxs(ye,{children:[jsx(ri,{status:e,isTextShown:o}),t&&ja[t]&&jsx(p,{title:r(ft(t)),children:jsx(_,{src:ja[t],alt:"charge-icon"})})]})})}var oI=tI;var rI={FAILED:gh,PENDING:nh,INITIATED:ch,ATTEMPTED:bh,EXEMPTED:fh,EXEMPTED_WITH_TRANSACTION:fh,EXEMPTED_WITHOUT_TRANSACTION:eh,REJECTED:dh,UNAVAILABLE:ih,UNDETERMINED:jh,SUCCESS:mh,AUTHENTICATED:lh,AUTHENTICATED_WITH_TRANSACTION:lh,AUTHENTICATED_WITHOUT_TRANSACTION:lh,AUTHENTICATED_AUTHORIZE_FAILED:gh},qa={FAILED:oh$1,PENDING:ph,INITIATED:qh,ATTEMPTED:rh,EXEMPTED:sh,EXEMPTED_WITH_TRANSACTION:sh,EXEMPTED_WITHOUT_TRANSACTION:th$1,REJECTED:uh,UNAVAILABLE:vh,UNDETERMINED:wh,SUCCESS:xh,AUTHENTICATED:yh,AUTHENTICATED_WITH_TRANSACTION:yh,AUTHENTICATED_WITHOUT_TRANSACTION:zh$1,AUTHENTICATED_AUTHORIZE_FAILED:oh$1},Dt=ke;function lI({status:e,authorizedStatus:t,chargeStatus:o,chargeTooltip:n,gatewayTooltip:r,acquirerTooltip:i,errorCode:a,...l}){let{t:s}=useTranslation(),p$1=useTheme(),c=[e&&qa[e]?jsx(p,{title:s(ft(e)),children:jsx("img",{src:qa[e],alt:"authentication-icon",style:{width:"36px",height:"24px",objectFit:"scale-down"}})}):null,o&&Dt[o]?jsx(p,{title:s(ft(o)),children:jsx(He,{showAuthorizedStatus:true,chargeStatus:o,gatewayTooltip:r,chargeTooltip:n,acquirerTooltip:i,errorCode:a})}):null,t&&Et[t]?jsx(p,{title:s(ft(t)),children:jsx("img",{src:Et[t],alt:"authorized-icon",style:{width:"36px",height:"20px",objectFit:"scale-down"}})}):null].filter(Boolean),m=c.length||0;return jsx(y,{...l,sx:{position:"relative",overflow:"visible"},children:jsx(lo,{whileHover:"animate",animate:"start",statusesCount:m,children:c.map((f,C)=>f?jsx(ao,{order:C,variants:ro(C,p$1.shadows[4],40),children:jsx(io,{children:f})},C):null)})})}var sI=lI;var Za={issuer:_h$1,scheme:$h$1,device:Yh$1,app:Xh$1,wallet:Wh,biometric:Yh$1};function dI({type:e,...t}){let{t:o}=useTranslation();return jsx(y,{...t,children:jsx(ye,{children:jsx(Ce,{className:"authentication-status",children:e&&Za[e]&&jsx(p,{title:o(ft(e)),children:jsx(_,{src:Za[e],alt:"authentication-type"})})})})})}var mI=dI;var Em={SMS:ce,EMAIL:_d,WHATSAPP:de};var Dm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),Rm=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Mm=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"})),Lm=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),km=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"})),Vm=(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 gI({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]},l=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(tt,{order:c,variants:Vm(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(km,{children:jsx(Lm,{sx:{color:i[p$1]},children:m})}):jsx(Rm,{src:Em[p$1],alt:p$1})})},`${p$1}-${c}`)}),s=l?.length||0;return jsx(y,{...o,children:jsx(Dm,{children:l?.length>0?jsx(Mm,{layout:true,className:"payment-sources-container",whileHover:"animate",animate:"start",sourcesCount:s||0,variants:{animate:{width:(s||0)*38}},style:{zIndex:29},children:l}):null})})}var xI=gI;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 Bm=styled(j)(({theme:e})=>({fontSize:"11px",fontWeight:500,color:"#000",cursor:"default"}));var hI={sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"};function II({dueDate:e,expiryDate:t,zone:o,format:n$1=hI,...r}){let i=useMemo(()=>({label:e?n(e,o,n$1):void 0,tooltip:"Due Date"}),[e,o,n$1]),a=useMemo(()=>({label:t?n(t,o,n$1):void 0,tooltip:"Expiry Date"}),[t,o,n$1]),l=c=>jsx(p,{title:c.tooltip,children:jsx(Bm,{children:c.label})}),s=useMemo(()=>e?l(i):t?l(a):null,[i,a,e,t]),p$1=useMemo(()=>t&&e?[l(a)]:[],[i,a,e,t]);return !e&&!t?null:jsx(y,{...r,sx:{position:"relative",overflow:"visible"},children:jsx(b$2,{sx:{justifyContent:"flex-start",zIndex:101},main:s,endItems:p$1})})}var Xa=II;function Nm(e){return jsx(Xa,{...e,zone:y$1()??u})}var Wm=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 Ja=styled("img")({width:"24px",height:"24px"});function wI({products:e,...t}){let o=e?.map((r,i)=>jsx(Ja,{sx:{...r?.toLowerCase()===Fn.tokens.code?.toLowerCase()&&{borderRadius:"8px",border:"1px solid rgba(0, 0, 0, 0.10)"}},className:"app-logo",src:Hn.find(a=>a.code?.toLowerCase()===r?.toLowerCase())?.iconUrl,alt:"product-icon"},`${i}-${r}`)),n=jsxs(Wm,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:"10px 0px 8px 0px #F2F2F2"}},children:[jsx(Ja,{src:vi$1,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(y,{...t,style:{overflow:"visible"},children:jsx(ye,{children:jsx("div",{style:{width:"30px",position:"relative",zIndex:24},children:n})})})}var AI=wI;function li(e){return jsx(wr,{...e,children:jsx(p,{title:e.tooltip||e.children,children:e.children})})}var _m=styled$1(Bn)(()=>({display:"flex",alignItems:"center",gap:"8px"})),zm=styled$1(Bn)(({theme:e})=>({fontSize:"14px",color:e.palette.text.primary,lineHeight:"16.8px"}));function YV({currency:e}){return jsxs(_m,{children:[jsx(b$3,{currencyCode:e}),jsx(zm,{children:e})]})}$m.extend(RI);$m.extend(DI);function Gm({value:e,...t}){let o=useMemo(()=>v(e,{sameDay:"[Today]",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM D, YYYY",lastWeek:"MMM D, YYYY",nextWeek:"MMM D, YYYY"}),[e]);return jsx(y,{...t,children:o})}var Ym=styled$1(Bn)(({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 mB({reference:e}){return e?jsx(p,{title:`Bank - ${e}`,children:jsx(Ym,{children:jsx(Bn,{component:"img",src:qb$1,alt:"bank",width:14})})}):jsx(Fragment,{})}var Qa={acquirer:qb$1,generic:rb$1,payment:ae,gateway:wn$1,order:$d$1};var jm=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),qm=styled("img")(()=>({maxWidth:"36px",maxHeight:"24px"})),Km=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"})),Zm=styled("span")(()=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0"})),Xm=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"4px"}));styled("div")(()=>({height:"18px"}));var Jm=(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 HI=120,_I=50;function zI({isTextShown:e,getTooltipTitle:t,...o}){let[n,r]=useState(false),[i,a]=useState(null),l=useRef(null),s=useRef(false),p$1=useRef(false),c=useRef(null),m=useTheme(),f=useMemo(()=>Object.keys(Qa).filter(T=>!!o[T]),[o]),C=()=>{c.current&&(clearTimeout(c.current),c.current=null);},g=()=>{a(l.current);},I=()=>{s.current=true,p$1.current=false,r(true),a(null),C(),c.current=setTimeout(()=>{p$1.current=true,g();},HI);};useEffect(()=>()=>C(),[]);let S=()=>{s.current||I();},A=()=>{C(),l.current=null,s.current=false,p$1.current=false,a(null),r(false);},u=T=>{if(l.current=T,p$1.current){C(),a(T);return}s.current||I();},x=()=>{l.current=null,p$1.current&&(C(),c.current=setTimeout(g,_I));},b=f.length;return jsx(y,{...o,children:jsx(jm,{children:b>0?jsx(Km,{layout:true,className:"reference-sources-container",whileHover:"animate",onHoverStart:S,onHoverEnd:A,animate:n?"animate":"start",sourcesCount:b,variants:{animate:{width:b*38}},style:{zIndex:29},children:f.map((T,w)=>{let h=t?.(T)||`${eu(T)} - ${o[T]}`,P=i===T;return jsx(tt,{order:w,variants:Jm(w,m.shadows[4],e?83:0),sx:{width:e?"79px":"36px"},onMouseEnter:()=>u(T),onMouseLeave:x,children:jsx(p,{open:P,disableHoverListener:true,disableInteractive:true,title:P?h:"",children:e?jsx(Xm,{children:jsx(Zm,{children:eu(T)})}):jsx(qm,{src:Qa[T],alt:T,sx:{...T==="order"&&{width:"11.82px"}}})})},`${T}-${w}`)})}):null})})}var UI=zI;var el={Y:{tooltip:"Authenticated",icon:lh,borderColor:"rgba(31, 136, 208, 0.10)"},N:{tooltip:"Failed Authentication",icon:Wg,borderColor:"rgba(240, 130, 0, 0.10)"},R:{tooltip:"Failed Authentication",icon:Wg,borderColor:"rgba(240, 130, 0, 0.10)"},A:{tooltip:"Attempted",icon:bh,borderColor:"rgba(31, 136, 208, 0.10)"},U:{tooltip:"Failed Authentication",icon:Wg,borderColor:"rgba(240, 130, 0, 0.10)"},noAuth:{tooltip:"Not Authenticated",icon:ch,borderColor:"#F2F2F2"}},tl={"3DS":{tooltip:"3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"},"Device Biometric":{tooltip:"Biometric",icon:Rj,borderColor:"rgba(31, 136, 208, 0.10)"},"Non-3DS":{tooltip:"Non 3DS",icon:Sj,borderColor:"rgba(31, 136, 208, 0.10)"}};styled("img")(()=>({width:"12.67px",height:"15px"}));var ou=styled(motion.div)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),nu=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 ru=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"})),iu=(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}}}),au=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",paddingInline:"8px",textAlign:"center",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}));function GI({transactionStatus:e,isTextShown:t,eci:o,authType:n,...r}){let i=useTheme$1(),a=useMemo(()=>{let p=el[e??"noAuth"]??el.noAuth,c=p?.tooltip,m=p?.icon;return [{tooltip:c,content:t?c:m,type:t?"text":"icon"},...n?[{tooltip:n,content:t?tl[n]?.tooltip:tl[n]?.icon,type:t?"text":"icon"}]:[],{tooltip:"",content:o?`ECI ${o}`:"",type:"text"}]},[e,o,t]),l=useMemo(()=>a.filter(p=>!!p.content).map((p$1,c)=>{let m=p$1.type==="text"?jsx(au,{"data-testid":"AuthenticationCell_BadgeTextWrapper",children:jsx(V,{sx:{border:"none"},"data-testid":"AuthenticationCell_TextLabel","data-source":p$1.content,children:p$1.content})}):jsx(nu,{src:p$1.content,alt:p$1.tooltip});return jsx(p,{title:p$1.tooltip,children:jsx(tt,{order:-1*c,variants:iu(c,i.shadows[4],t?124:39),sx:{...p$1.type==="text"&&{width:t?"120px":"58px"}},children:m})},`${p$1.tooltip}-${c}`)}),[r,a,t,i]),s=l.length;return jsx(y,{...r,children:jsx(ou,{children:s>0?jsx(ru,{layout:true,className:"authentication-sources-container",whileHover:"animate",animate:"start",sourcesCount:s,variants:{animate:{width:38}},style:{zIndex:29},children:l}):null})})}var YI=GI;var ol={checkout:Fh,checkoutSuccess:Gh$1};function KI({status:e,...t}){let{t:o}=useTranslation();return jsx(y,{...t,sx:{overflow:"visible"},children:jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:e&&ol[e]&&jsx(p,{title:o(ft(e)),children:jsx(_,{src:ol[e],alt:"checkout-icon"})})})})}var ZI=KI;var nl={TRANSACTED:Lh,INITIATED:Jh$1,CANCELLED:Kh,EXPIRED:Ih};function pu({status:e,chargeStatus:t,...o}){let{t:n}=useTranslation();return jsx(y,{...o,sx:{overflow:"visible"},children:jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"8px",overflow:"visible"},children:[e&&nl[e]&&jsx(p,{title:n(ft(e)),children:jsx(_,{src:nl[e],alt:"intents-icon"})}),t&&Dt[t]&&jsx(p,{title:n(ft(t)),children:jsx(He,{chargeStatus:t})})]})})}var du=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"})),mu=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 uu(e){return e<5?5:e===100?95:e}var di={PAID_OUT:{color:"#2ACE00",backgroundColor:"#2ACE000D"},PENDING:{color:"#FF7A00",backgroundColor:"#FF7A000D"},SETTLED:{color:"#2ACE00",backgroundColor:""}};function tb({percentage:e,date:t,payoutStatus:o,payoutTooltip:n,chargeTooltip:r,refundCount:i,isTextShown:a,...l}){let{t:s}=useTranslation(),p$1=useTheme();return e===0?null:jsx(y,{...l,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(du,{whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{gap:"4px"}},sx:{...a&&{height:"auto",padding:"0",backgroundColor:"transparent"}},children:[jsx(mu,{percentage:e,sx:{backgroundColor:"#eeeeee",...a&&{backgroundColor:"transparent",border:"none"}},variants:{...!a&&{animate:{boxShadow:p$1.shadows[4]}}},children:a?jsxs(V,{children:[e,"%"]}):jsxs(Fragment,{children:[e," % ",jsx(Ar,{percentage:uu(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(Ce,{className:"payout-status",style:{visibility:o==="PENDING"?"hidden":"visible",position:"relative",left:"57px",width:a?"auto":"24px"},children:o&&dn[o]&&jsx(p,{title:n||s(ft(o)),children:a?jsx(V,{sx:{color:di[o].color,border:`1px solid ${di[o].color}1a`,backgroundColor:di[o].backgroundColor},children:s(ft(o))}):jsx(_,{src:dn[o],alt:"settled-icon"})})})]})})}var ob=tb;var rb={sameDay:"[Today at] h:mm A",nextDay:"[Tomorrow]",lastDay:"[Yesterday]",sameElse:"MMM DD, YYYY",lastWeek:"MMM DD, YYYY",nextWeek:"MMM DD, YYYY"};function gu(e){return n(e,y$1()??u,rb)}function xu(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"}}}var yu={DELETED:lf$1,DRAFT:mf$1,CREATED:nf$1,CANCELLED:Aa,CANCELED:Aa,EXPIRED:Ba,PAID:qf,REFUNDED:wf$1,DELIVERED:rf$1,VIEWED:sf$1,SAVED:tf$1,SCHEDULED:uf$1,PENDING:vf$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 il=styled("img")(()=>({height:"13.125px",width:"12px"})),mi=styled("div")(()=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",width:"65px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4.5px 8px",borderRadius:"24px"})),hu=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"})),Iu=styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px"}));function bu({chargeStatus:e,chargeTooltip:t,errorCode:o,iconStyles:n,iconWrapperStyles:r}){let{t:i}=useTranslation(),a=e?oi[e]:null,l=e&&ke[e]&&jsx(Iu,{style:r,children:jsx(_,{src:ke[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(ft(e)),children:jsxs(Bn,{sx:{display:"flex",gap:"6px",alignItems:"center"},children:[l,!!Pn$1?.includes(e||"")&&jsx(hu,{style:{background:a?.color},children:o})]})}):null}function Tu({status:e,date:t,viewsCount:o,chargeStatus:n,errorCode:r,chargeTooltip:i,remindedCount:a=0,...l}){let{t:s}=useTranslation(),p$1=useTheme(),c=e?yu[e]:null,m=xu(e),f=`${s(e?.toLowerCase()||"")} ${gu($m(t).valueOf())}`,C=useMemo(()=>jsx(bu,{chargeStatus:n,errorCode:r,chargeTooltip:i}),[n,r,i]),g=useMemo(()=>jsx(p,{title:s("reminded"),children:jsxs(Bn,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},children:[jsx(il,{sx:{width:"14px",height:"14px"},src:me,alt:"icon"}),jsx(z,{style:{background:p$1.palette.error.main,fontWeight:600,color:p$1.palette.common.white},children:a})]})}),[a]),I=useMemo(()=>{if(c)return jsx(p,{title:s(f||""),children:jsx(il,{src:c,alt:"status icon"})});if(n&&Dt[n])return C;if(a)return g},[c,n,a]);return !e&&!n&&!a?null:jsx(y,{...l,sx:{position:"relative",overflow:"visible"},children:jsx(b$2,{sx:{justifyContent:"flex-start",zIndex:101},endAdornment:o&&e==="VIEWED"&&c?[jsx(z,{style:{marginRight:"8px",color:"#fff",backgroundColor:m.color},children:o})]:void 0,main:I,startItems:a&&c?[g]:void 0,endItems:n&&Dt[n]&&c?[C]:void 0})})}function gb({tooltip:e,children:t,badge:o,...n}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...n,children:t?jsx(p,{title:e,children:jsx(et,{"data-testid":"BadgeCell_BadgeWrapper",children:jsxs(V,{"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 xb=gb;var sl={ACTIVE:ji,EXPIRED:ii,PENDING:ji,SAVED:gi,TRANSACTED:hi$1,CONSUMED:hi$1};var yb=(f=>(f.ABANDONED="ABANDONED",f.IN_PROGRESS="IN_PROGRESS",f.VOID="VOID",f.CANCELLED="CANCELLED",f.CAPTURED="CAPTURED",f.INITIATED="INITIATED",f.FAILED="FAILED",f.DECLINED="DECLINED",f.RESTRICTED="RESTRICTED",f.TIMEDOUT="TIMEDOUT",f.UNKNOWN="UNKNOWN",f.AUTHORIZED="AUTHORIZED",f))(yb||{});function Ib({status:e,chargeTooltip:t,gatewayTooltip:o,acquirerTooltip:n,errorCode:r,cardId:i,hasChargeIcon:a,hasAuthorizedIcon:l,...s}){let{t:p$1}=useTranslation();return jsx(y,{...s,sx:{position:"relative",overflow:"visible"},children:jsxs(ye,{sx:{gap:"0.5rem"},children:[e&&sl[e]&&jsx(p,{title:p$1(ft(e)),children:jsx(_,{src:sl[e],alt:"token-icon"})}),i&&jsx(p,{title:p$1(ft(e)),children:jsx(_,{src:ki,alt:"card-icon"})}),a&&jsx(p,{title:p$1(ft("CAPTURED")),children:jsx(He,{showAuthorizedStatus:true,chargeStatus:"CAPTURED",gatewayTooltip:o,chargeTooltip:t,acquirerTooltip:n,errorCode:r})}),l&&jsx(p,{title:p$1(ft("AUTHORIZED")),children:jsx(_,{src:Et.AUTHORIZED,alt:"authorized-icon"})})]})})}var bb=Ib;var cl=styled("img")(()=>({maxWidth:"13px",maxHeight:"13px"})),wu=styled("div")(({theme:e})=>({width:"24px",height:"24px",border:`1px solid ${e.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%"})),Au=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));function Sb({brandName:e,brandIcon:t,...o}){return jsx(y,{style:{textAlign:"center",overflow:"visible"},...o,children:jsxs(Au,{children:[jsx(wu,{children:t?jsx(p,{title:e,children:jsx(cl,{src:t,alt:"brand icon",onError:r=>{r.currentTarget.src=Ci$1;}})}):jsx(cl,{src:Ci$1,alt:"brand icon"})}),jsx("span",{children:e})]})})}var wb=Sb;function vu({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]??"",a=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 a?jsx(p,{title:a,children:jsx(Box,{component:"img",src:ak,alt:"meta",sx:{cursor:"pointer"}})}):null}var Eu=styled$1(motion.img,{shouldForwardProp:e=>e!=="width"&&e!=="height"})(({width:e,height:t})=>({width:e||"16px",height:t||"16px"}));var Rb=({width:e,height:t,sx:o}={})=>{let n=Vb$1(useId(),"animated-spinner-icon");return jsx(Eu,{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}})},Du=Rb;var Ru=Du;var Lu=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"})),ku=styled$1(motion.img)(()=>({width:"16px",height:"16px"}));var Vb=({onClick:e,isSettlementsAvailable:t,isDownloadError:o,isDownloadLoading:n,isDownloadSuccess:r})=>{let i=useMemo(()=>n||r||o,[n,r,o]),a=useMemo(()=>r?kc:o?jc:_j,[r,o]);return jsx(p,{title:t?"":"Pending",children:jsx(Lu,{onClick:()=>t&&!i&&e(),children:jsx(AnimatePresence,{mode:"wait",initial:false,children:n?jsx(Ru,{},"spinner"):jsx(ku,{src:t?a:$j,alt:"Download Report"})})})})};var Nb=({receiptId:e})=>jsx(TableCell,{component:"div",children:jsx(p,{title:`Receipt - ${e}`,children:jsx(V,{sx:{padding:"3px 8px",maxWidth:"50px"},children:jsx("img",{src:rc,alt:"receipt"})})})});var Wb=({receiptId:e})=>jsx(wr,{children:jsx("span",{children:e})});var Fb=({receiptId:e})=>jsx(li,{children:jsx("span",{children:e})});var Wu=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"}})),Fu=styled(Bn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"}));styled("img")(()=>({width:"16px",height:"11.73px"}));var Ou=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"}})),Hu=styled("img")(()=>({width:"10.5px",height:"10.5px"})),_u=styled("div")({marginLeft:"auto",width:"auto"});var zu={incomplete:Jj,complete:Ij,reviewed:Ij,verified:Kj};function Uu({entity:e,country:t,verificationStatus:o,licenseNumber:n,hideStatus:r,...i}){let a=zu[o??"incomplete"];return jsx(y,{...i,sx:{cursor:i?.onClick?"pointer":"default"},children:jsx(p,{title:e,children:jsx(Wu,{hasClick:!!i?.onClick,licenseNumber:n,children:jsxs(Fu,{children:[jsx(p,{title:t?fa(t):"",children:jsx(b$3,{countryCode:t})}),jsx(Ou,{licenseNumber:n,children:n||"Not Available"}),!r&&jsx(_u,{children:jsx(Hu,{src:a})})]})})})})}function Gu({marketPlaceIcon:e,marketPlaceName:t,...o}){return jsx(y,{...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,alt:"marketplace",style:{maxWidth:"18px",maxHeight:"18px",objectFit:"cover"}})}),jsx(Typography,{noWrap:true,sx:{fontSize:"14px",fontWeight:400},children:t})]})})})}var Yu={incomplete:Jj,complete:Ij,reviewed:Ij,verified:Kj};var ju=styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),border:"1.029px solid #F2F2F2",borderRadius:"44px",padding:"4px 8px",lineHeight:"120%"})),qu=styled("div")(({theme:e})=>({fontSize:"14px",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"84px"})),Ku=styled("img")(()=>({width:"10.5px",height:"10.5px"})),Zu=styled("span")(({theme:e})=>({fontSize:"9.5px",fontWeight:400,color:e.palette.common.white,backgroundColor:e.palette.grey[700],borderRadius:"4px",padding:"1px 2px"})),Xu=styled("div")({width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"}),Ju=styled("div")({display:"flex",alignItems:"center",gap:"8px"}),Qu=styled("div")({fontWeight:400,fontSize:14,lineHeight:"120%",letterSpacing:0,color:"#B1B1B1",textAlign:"center",width:"100%"});function ef({id:e,status:t,count:o,name:n,...r}){let i=Yu[t??"incomplete"];return jsx(y,{...r,sx:{cursor:"pointer"},children:jsx(p,{title:n,children:jsx(ju,{children:e?jsxs(Xu,{children:[jsx(qu,{children:e}),jsxs(Ju,{children:[jsx(Ku,{src:i}),o>1&&jsx("div",{children:jsxs(Zu,{children:["+",o-1]})})]})]}):jsx(Qu,{children:"Not Available"})})})})}var tf=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"})),of=styled(Bn)(()=>({display:"flex",alignItems:"center",gap:"4px",overflow:"hidden",width:"100%"})),nf=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"}})),rf=styled("img")(()=>({width:"10.5px",height:"10.5px"})),af=styled("div")({marginLeft:"auto",width:"auto"});var lf={incomplete:Jj,complete:Ij,reviewed:Ij,verified:Kj};function sf({brand:e,verificationStatus:t,hideStatus:o,brandLogo:n,...r}){let i=lf[t??"incomplete"];return jsx(y,{...r,children:jsx(p,{title:e.name,children:jsx(tf,{hasClick:!!r.onClick,children:jsxs(of,{children:[n,jsx(nf,{brandName:e.name,children:e.name||"Not Available"}),!o&&jsx(af,{children:jsx(rf,{src:i})})]})})})})}var pf=styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),cf=styled("img")(()=>({maxWidth:"36px",maxHeight:"16px"})),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:"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 mf=(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"}}}),uf=styled(Box)(()=>({display:"flex",gap:"4px",maxWidth:"440px",justifyContent:"space-between",height:"18px"}));var qb=e=>!e.startsWith("http://")&&!e.startsWith("https://"),Ci=e=>/^https?:\/\//i.test(e),ff=(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 Kb(e,t);case "ios":case "android":case "mobile_app":return Zb(e,t);default:return e}},Kb=(e,t)=>{let o=e.toLowerCase();return t==="linkedin"?o.includes("linkedin.com")||o.includes("linked.com")?e:Ci(e)?null:`https://linkedin.com/company/${e}`:t==="instagram"?o.includes("instagram.com")?e:Ci(e)?null:`https://instagram.com/${e}`:t==="twitter"?o.includes("twitter.com")||o.includes("x.com")?e:Ci(e)?null:`https://x.com/${e}`:null},Zb=(e,t)=>e.toLowerCase().includes("apps.apple.com")&&t==="ios"?e:t==="android"?Ci(e)?e:`https://play.google.com/store/apps/details?id=${e}`:null,Cf=e=>{!e||typeof e!="string"||window.open(qb(e)?`https://${e}`:e,"_blank","noopener,noreferrer");};function Xb({channels:e,...t}){let o=e?.filter(r=>!!r.address)?.map((r,i)=>{let a=r.address,l=r.code?.replace(/_/g,""),s=i===e?.length-1,p$1=ff(r.address??"",r.code??"");return jsx(p,{title:a,children:jsx(tt,{order:i,variants:mf(i,0,s),sx:{width:"36px",cursor:p$1?"pointer":"default"},onClick:()=>{r?.address&&Cf(p$1);},children:jsx(cf,{src:r.logo,alt:l})})},`${r}-${i}`)}),n=o?.length||0;return jsx(y,{...t,children:jsx(pf,{children:o?.length>0?jsx(df,{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 Jb=Xb;function nT({channels:e}){let t=useRef(null),[o,n]=useState(false),[r,i]=useState(null),a=!!r;useEffect(()=>{t.current&&n(t.current.scrollHeight>20);},[e]);let l=useMemo(()=>(e||[]).filter(s=>!!s.address),[e]);return jsxs(uf,{children:[jsx(Bn,{sx:{display:"flex",flexWrap:"wrap",gap:o?"8px":"4px"},ref:t,children:l.map(s=>jsxs(b$1,{copyTrigger:"click",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(Bn,{onClick:s=>{i(s.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(oT,{open:a,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(Bn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:l.map(s=>jsxs(b$1,{copyTrigger:"click",copyText:s.address,children:[s.name?.en,": ",s.address]},s.id))})})]})}var rT=nT;var xf={SAVED_CARD:"Card Agreement",ORDER:"Order",SUBSCRIPTION:"Subscription",INSTALLMENT:"Installment"};function lT({type:e,count:t,sx:o,...n}){let{t:r}=useTranslation(),i=t?.toString();return jsxs(Bn,{sx:{display:"flex",flexDirection:"row",gap:"4px"},children:[jsx(b$1,{copyTrigger:"click",copyText:e,unknownText:r("noPaymentAgreement"),sx:o,...n,children:e&&xf[e]}),i&&jsx(b$1,{copyTrigger:"click",copyText:i,sx:{minWidth:"38px"},...n,children:i})]})}var sT=lT;var hf={CYBERSOURCE:tm$1,MPGS:um$1,NETCETERA:vm$1,APPLEPAY:wm$1,TAP3DS:xm,FSS:Dm$1,BENEFIT:zm$1,QPAY:Lm$1,POSTPAY:Km$1,BENEFITPAY:ym$1,MEEZA:Fm,STC_PAY:Nm$1,NGENIUS:Gm$1,KNET:Em$1,PAYPAL:Jm$1,FAWRY:Cm,TPG:Rm$1,DEEMA:Bm$1,TPAY:Qm,"CAREEM PAY":Am$1,TABBY:Om,OMANNET:Im$1,NPG:Hm,SPG:Mm$1,TAMARA:Pm$1};var bf=styled(Bn)(({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})),Tf=styled("img")(()=>({width:"100%",height:"100%",objectFit:"contain"}));function Sf({provider:e,...t}){let o=hf[e];return o?jsx(bf,{children:jsx(Tf,{src:o,alt:e})}):jsx(y,{...t,children:jsx(V,{children:e})})}var wf={CHARGE:Xk,AUTHORIZE:Bk,SAVE_TOKEN:$g$1},Af={CHARGE:"Charge",AUTHORIZE:"Authorization",SAVE_TOKEN:"Save Token"},Pf={CHARGE:{backgroundColor:"#1F88D01A",color:"#1F88D0",border:"none"},AUTHORIZE:{backgroundColor:"#FFFFFF",color:"#1F88D0",border:"#1F88D01A"},SAVE_TOKEN:{backgroundColor:"#1F88D00D",color:"#1F88D0",border:"#1F88D01A"}};var vf=styled(Bn,{shouldForwardProp:e=>!["purposeType"].includes(e)})(({purposeType:e})=>{let t=Pf[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}}),Ef=styled("img")(()=>({width:"16px",height:"16px",objectFit:"contain",flexShrink:0})),Df=styled("span")(()=>({whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}));function Mf({purpose:e,...t}){let o=wf[e],n=Af[e];return jsxs(vf,{purposeType:e,...t,children:[jsx(Ef,{src:o,alt:e}),jsx(Df,{children:n})]})}var kf=8,uT=16,pt=kf*2+uT,Vf=100,Bf=6,fT=pt+Bf+Vf,Nf=styled$1(y)(()=>({position:"relative",overflow:"visible",width:pt,minWidth:pt,maxWidth:pt,display:"inline-flex",padding:0})),Wf=styled$1(Bn)(()=>({position:"relative",width:pt,height:24,flexShrink:0,overflow:"visible"})),Ff=styled$1(Bn,{shouldForwardProp:e=>e!=="hasLabel"})(({theme:e,hasLabel:t})=>({position:"absolute",top:0,left:0,width:pt,minWidth:pt,maxWidth:pt,height:24,display:"inline-flex",alignItems:"center",gap:Bf,paddingInline:kf,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:fT,zIndex:100,boxShadow:"0px 0px 16px 0px #00000021","& .link-cell-label":{maxWidth:Vf,opacity:1}}}})),Of=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 gT({url:e,label:t}){let o=l(),n=()=>{try{xa(e),o.success("Copied!");}catch{o.error("Failed to copy");}};return e?jsx(Nf,{children:jsx(Wf,{children:jsxs(Ff,{hasLabel:!!t,onClick:n,children:[jsx(d,{src:Ll$1,alt:"link"}),t&&jsx(Of,{className:"link-cell-label",children:t})]})})}):null}var xT=memo(gT);function k6({items:e}){let[t,o]=useState(null),n=!!t,r=useCallback(({quantity:l,currency:s,amount:p,name:c})=>`${l?`Qty ${l}`:""} ${c?`- ${c}`:""} ${s||p?"-":""} ${s||""} ${p||""}`,[]);if(!e||!e.length)return null;let[i,...a]=e;return jsxs(Bn,{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(Bn,{onClick:l=>{o(l.currentTarget.parentElement);},sx:{height:"18px"},children:jsx(b$1,{sx:{minWidth:25,borderRadius:"24px",overflow:"hidden"},children:"..."})}),jsx(oT,{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(Bn,{sx:{display:"flex",flexDirection:"column",gap:"4px",padding:"4px"},children:a?.map(l=>jsx(b$1,{copyTrigger:"click",copyText:r(l),children:r(l)},l.id))})})]})}var Hf="ListHeader";var _f=styled(Box)(({theme:e})=>({backgroundColor:e.palette.background.default,paddingInline:e.spacing(4),paddingBottom:e.spacing(2),paddingTop:e.spacing(2),overflowX:"clip"})),zf=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)})),Uf=styled(j)(({theme:e})=>({fontSize:"1.75rem",fontWeight:e.v2.typography.fontWeightMedium,lineHeight:"120%"})),$f=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(3),width:"100%"})),Gf=styled(Box)(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:e.spacing(1)})),Yf=styled(Box)(()=>({display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"8px",flexShrink:0}));function hi({children:e,component:t="header",...o}){return jsx(_f,{component:t,...o,children:e})}function Ii({title:e,toolbar:t}){return jsxs(zf,{children:[jsx("span",{children:!!e&&jsx(Uf,{children:e})}),t]})}function bi({status:e,activeFilter:t,beforeStatus:o}){let n=t?.visible??false;return jsxs(Gf,{as:"aside",children:[o,jsx(b$8,{value:e?.value,items:e?.options,onValueChange:e?.onChange&&(r=>e.onChange?.(r)),keepInactive:n,itemSx:e?.buttonSx}),jsx(d$1,{value:t?.ids,visible:n,label:t?.label,dismissible:t?.dismissible,isActive:t?.isActive??true,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]}})),Ti=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})),vo=styled(Box)(()=>({minWidth:160,position:"relative",marginRight:0,paddingRight:0})),Eo=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})),wn=styled(Box)(()=>({width:16})),Zf=styled(Box)(({theme:e})=>({display:"flex",flexDirection:"column",height:"calc(100% - 32px)",backgroundColor:e.palette.background.paper,position:"relative"})),Xf=styled(Box)(()=>({flex:1,overflowY:"auto",paddingLeft:16,paddingRight:16,paddingBottom:64})),Jf=styled(Box)(()=>({padding:"24px 0",display:"flex",justifyContent:"space-between",alignItems:"center"})),Qf=styled(Box)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"8px",overflow:"hidden",display:"flex",flexDirection:"column",flex:1,minHeight:0})),eC=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]}})),tC=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"}})),gl=styled(Box)(()=>({width:20,height:20,marginRight:8,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),xl=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",padding:0,width:14,height:14,minWidth:14,minHeight:14,flexShrink:0})),oC=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)"})),nC=styled(Box)(({theme:e})=>({position:"absolute",bottom:12,right:16,padding:6,backgroundColor:e.palette.background.paper,border:"1px solid #9F9F9F29",borderRadius:"4px"})),Si=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 rC=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"}})),iC=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 yl={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}},aC=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"})),lC=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}})),sC={p:0,width:14,height:14,minWidth:14,minHeight:14,"& .MuiSvgIcon-root":{width:16,height:16}},pC=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})),dC=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})),mC={fontSize:11,fontWeight:400,textTransform:"none",color:"text.primary",minWidth:80,height:38,borderRadius:"8px",border:"1px solid",borderColor:"divider"},uC=e=>({fontSize:11,fontWeight:500,textTransform:"none",backgroundColor:"info.dark",minWidth:80,height:38,borderRadius:"8px",boxShadow:"none","&:hover":{backgroundColor:e.palette.info.dark}}),fC=styled("div",{shouldForwardProp:e=>e!=="sandboxMode"&&e!=="maximized"&&e!=="isDragging"})(({maximized:e,isDragging:t})=>({...!e&&{borderTopRightRadius:12,borderTopLeftRadius:12},...t&&{cursor:"move"},margin:0,position:"sticky",top:0,left:0,right:0,zIndex:1e3,background:"#eaeaea",backdropFilter:"blur(32px)"}));function Il(e,t){let[o,n]=useState(null),[r,i]=useState(null),a=useCallback(()=>{n(null),i(null);},[]),l=useCallback((p,c)=>{n(p.currentTarget),i(c);},[]),s=useCallback(()=>{r&&a();},[r,a]);return useEffect(()=>{e||(a(),t?.());},[e,t,a]),{subMenuAnchorEl:o,openSubMenuName:r,handleSubMenuClose:a,handleSubMenuOpen:l,handleMenuScroll:s}}function LT(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 bl(e){let t=useRef(false),o=useRef(null),n=useRef({x:0,y:0}),r=useRef(1),i=useRef(null),a=useRef(0),l=useRef(false),s=useCallback(()=>{o.current!==null&&(cancelAnimationFrame(o.current),o.current=null);},[]),p=useCallback((g,I)=>{l.current=true,window.dispatchEvent(new PointerEvent("pointermove",{bubbles:true,cancelable:true,pointerId:r.current,clientX:g,clientY:I+a.current,pointerType:"mouse",isPrimary:true})),l.current=false;},[]),c=useCallback(()=>{if(o.current!==null)return;let g=()=>{let I=i.current;if(!t.current||!I)return;let S=I.getBoundingClientRect(),{x:A,y:u}=n.current,x=u-S.top,b=S.bottom-u;if(x>0&&x<60){let T=(60-x)/60*15;I.scrollTop-=T,a.current-=T,p(A,u);}else if(b>0&&b<60){let T=(60-b)/60*15;I.scrollTop+=T,a.current+=T,p(A,u);}o.current=requestAnimationFrame(g);};o.current=requestAnimationFrame(g);},[p]),m=useCallback(g=>{l.current||(n.current={x:g.clientX,y:g.clientY},r.current=g.pointerId,t.current&&a.current!==0&&(g.stopImmediatePropagation(),p(g.clientX,g.clientY)));},[p]),f=useCallback(()=>{i.current=LT(e.current),a.current=0,t.current=true,window.addEventListener("pointermove",m,{capture:true}),c();},[e,m,c]),C=useCallback(()=>{t.current=false,a.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:f,onDragEnd:C}}function Sl({columns:e,setTableViews:t}){let o=useCallback(i=>{let a=i.map(l=>e.find(s=>s.name===l)).filter(l=>!!l);t?.(a);},[e,t]),n=useCallback(i=>{let a=e.map(l=>{if(l.name!==i)return l;let s=l.menuItems&&l.menuItems.length>0,p=!l.selected;if(!s)return {...l,selected:p};let c=l.menuItems?.map(m=>({...m,selected:p}));return {...l,selected:p,menuItems:c}});t?.(a);},[e,t]),r=useCallback((i,a)=>{let l=e.map(s=>{if(s.name!==i)return s;let p=s.menuItems?.map(m=>m.name===a?{...m,selected:!m.selected}:m),c=p?.some(m=>m.selected)??false;return {...s,menuItems:p,selected:c}});t?.(l);},[e,t]);return {reorderColumns:o,toggleColumnSelection:n,toggleSubmenuItem:r}}function Al({column:e,index:t,openSubMenuName:o,toggleColumnSelection:n,handleSubMenuOpen:r,handleSubMenuClose:i}){let a=e.menuItems&&e.menuItems.length>0,l=o===e.name,s=t===0,p=useMemo(()=>!!(e.selected&&e.menuItems?.some(C=>C.selected)&&!e.menuItems?.every(C=>C.selected)),[e.selected,e.menuItems]),c=useCallback(()=>{n(e.name);},[n,e.name]),m=useCallback(C=>{a&&r(C,e.name);},[a,r,e.name]),f=useCallback(()=>{a||i();},[a,i]);return {isIndeterminate:p,hasSubmenuItems:a,isSubmenuOpen:l,isFirstItem:s,handleColumnClick:c,handleMouseEnter:m,handleMouseLeave:f}}var L=(e="")=>e.toLowerCase()==="date",we=(e="")=>e.toLowerCase()==="index",wi=(e,t="en")=>{let o=[];return e.forEach(n=>{n.columns.forEach(r=>{let i=r.name.find(l=>l.lang===t)?.text||r.name[0]?.text||r.code,a=r.fields?.length?r.fields.map(l=>({name:l.code,label:l.name?.find(s=>s.lang===t||s.lang==="")?.text||l.code,selected:l.default??false})):void 0;o.push({name:r.code,label:i,selected:L(r.code)?true:r.default??false,menuItems:a?.length?a:void 0});});}),o},VT=(e,t)=>{if(!t?.length)return [];let o=e==="sheet"?"sheet":"advanced",n=t.find(r=>r.code.toLowerCase()===o);return n?wi([n]):[]},Pl=(e,t,o="en")=>{let n=e.map((i,a)=>{let l=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:a+1,default:i.selected??false,...l?.length?{fields:l}:{}}});return {code:t==="sheet"?"Sheet":"Advanced",columns:n}},BT=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(a=>a.code));n.columns.forEach(a=>{i.has(a.code)||r.columns.push(a);});}else t.set(n.code,{...n,columns:[...n.columns]});});}),Array.from(t.values())};var NT=(e,t,o=false)=>({label:e,id:`custom_${Date.now()}`,columns:t.map(n=>n.name),submenu:t,isCustom:true,default:o}),WT=(e,t)=>e.map(o=>({...o,default:o.id===t})),Ai=e=>e.role??(e.default?"default":void 0),Vt=e=>!!e.role||!!e.default,Ae=e=>!Vt(e),gC=e=>Ae(e),Pn=e=>e.filter(gC).length,vl=e=>e.filter(Ae).length,Pi=(e,t="sheet",o="en")=>{let n=[],r=[],i;e.forEach(l=>{let s=t==="sheet"?"sheet":"advanced",p=l.layout.find(w=>w.code.toLowerCase()===s),c=p?wi([p],o):[],m=l.id,f=Ra,C=Sa,g=c.some(w=>L(w.name))?c:[C,...c],I=g.findIndex(w=>L(w.name)),A=(I>0?[g[I],...g.filter(w=>!L(w.name))]:g).filter(w=>!we(w.name)),u=[f,...A],x=Ai(l),b=Vt(l),T={id:m,label:l.name,role:x,isCustom:!b,selected:l.selected,default:!!l.default,columns:u.map(w=>w.name),submenu:u};b?(l.default&&!i&&(i=u),r.push(T)):n.push(T);});let a=r.find(l=>l.default)??r[0];return {customViews:n,defaultTemplates:r,defaultTemplateColumns:i,defaultTemplate:a}},El=(e,t="sheet",o="en")=>{let{customViews:n,defaultTemplates:r,defaultTemplate:i}=Pi(e,t,o),a=[...r,...n];return {customViews:n,defaultTemplates:r,defaultTemplate:i,allTemplates:a}},vi=(e,t)=>{let o=[];Ae(e)?o=e.submenu??[]:o=e.submenu?.length?e.submenu:t;let n=Ra;if(!o.some(m=>L(m.name)))return [n,Sa,...o];let i=o.findIndex(m=>L(m.name)),a=i>=0?o[i]:Sa,l=o.filter(m=>!L(m.name)&&!we(m.name)),s=[a,...l],p=s.some(m=>we(m.name)),c=s.findIndex(m=>we(m.name));if(p&&c>0){let m=s[c],f=s.filter(C=>!we(C.name));return [m,...f]}return p&&c===0?s:[n,...s]},FT=(e,t)=>vi(e,t).length>0,Mo=e=>e.filter(t=>!we(t.name));var ge=e=>e.toLowerCase(),xC=e=>new Map(e.filter(t=>!L(t.name)).map(t=>[ge(t.name),t])),yC=(e,t)=>e.some(o=>ge(o)===ge(t)),Dl=(e,t)=>({...e,selected:t.selected??false,menuItems:e.menuItems?.map(o=>{let n=t.menuItems?.find(r=>ge(r.name)===ge(o.name));return {...o,selected:n?.selected??false}})}),vn=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}},Ml=(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}}),En=(e,t,o)=>e.map(n=>{if(n.name!==t)return n;let r=n.menuItems?.map(a=>a.name===o?{...a,selected:!a.selected}:a),i=r?.some(a=>a.selected)??false;return {...n,menuItems:r,selected:i}}),Ll=(e,t)=>e.map(o=>{if(L(o.name))return o;let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),kl=e=>{let t=e.filter(o=>!L(o.name));return t.length===0?false:t.every(o=>o.menuItems?.length?o.menuItems.every(n=>n.selected):o.selected)},Vl=(e,t)=>e.filter(r=>!L(r.name)).some(r=>r.menuItems?.length?r.menuItems.some(i=>i.selected):r.selected)&&!t,Bl=(e,t)=>e.trim().length>0&&e.length<=t,oe=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Nl=(e,t)=>e.map(o=>{if(o.name!==t)return o;if(L(o.name))return {...o,selected:true};let n=!o.selected,r=o.menuItems?.map(i=>({...i,selected:n}));return {...o,selected:n,menuItems:r}}),Wl=(e,t)=>e.map(o=>{if(L(o.name))return {...o,selected:true};let n=o.menuItems?.map(r=>({...r,selected:t}));return {...o,selected:t,menuItems:n}}),Fl=e=>e.length===0?false:e.every(t=>t.menuItems?.length?t.menuItems.every(o=>o.selected):t.selected),Ol=(e,t)=>e.length===0?false:e.some(n=>n.menuItems?.length?n.menuItems.some(r=>r.selected):n.selected)&&!t,Rl=e=>e.map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Dn=(e,t)=>{if(e.length!==t.length)return false;let o=Rl(e),n=Rl(t);for(let r=0;r<o.length;r++){let i=o[r],a=n[r];if(i.name!==a.name||i.selected!==a.selected)return false;if(i.menuItems&&a.menuItems){if(i.menuItems.length!==a.menuItems.length)return false;for(let l=0;l<i.menuItems.length;l++)if(i.menuItems[l].name!==a.menuItems[l].name||i.menuItems[l].selected!==a.menuItems[l].selected)return false}else if(i.menuItems||a.menuItems)return false}return true},OT=e=>e.filter(t=>!L(t.name)).map(t=>({...t,selected:t.selected??false,menuItems:t.menuItems?.map(o=>({...o,selected:o.selected??false}))})),Hl=(e,t)=>{let o=e.filter(i=>!L(i.name)).map(i=>i.name),n=xC(t),r=[];for(let i of o){let a=e.find(s=>ge(s.name)===ge(i)),l=n.get(ge(i));l?r.push(a?Dl(l,a):{...l,selected:false,menuItems:l.menuItems?.map(s=>({...s,selected:false}))}):a&&r.push(a);}for(let[,i]of n)if(!yC(o,i.name)){let a=e.find(l=>ge(l.name)===ge(i.name));r.push(a?Dl(i,a):{...i,selected:false,menuItems:i.menuItems?.map(l=>({...l,selected:false}))});}return r},_l=e=>e.filter(t=>!L(t.name)).map(t=>({...t,selected:false,menuItems:t.menuItems?.map(o=>({...o,selected:false}))})),zl=(e,t)=>{let o=xC(e),n=t.filter(i=>!L(i.name)).map(i=>i.name),r=[];for(let i of n){let a=t.find(s=>ge(s.name)===ge(i)),l=o.get(ge(i));l&&a?r.push(Dl(l,a)):l&&r.push({...l,selected:false,menuItems:l.menuItems?.map(s=>({...s,selected:false}))});}for(let[,i]of o)yC(n,i.name)||r.push({...i,selected:false,menuItems:i.menuItems?.map(a=>({...a,selected:false}))});return r};function hC(e,t,o="en"){if(!e?.layout?.length)return [];let n=qa$1(t)?"sheet":"advanced",r=e.layout.find(l=>l.code?.toLowerCase()===n);if(!r?.columns?.length)return [];let i=r.columns.map(l=>{let s=l.name?.find(c=>c.lang===o)?.text||l.name?.[0]?.text||l.code,p=l.fields?.length?l.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:l.code,label:s,selected:L(l.code)?true:l.default??false,...p&&p.length>0&&{menuItems:p}}});return i.some(l=>L(l.name))?i:[{name:Sa.name,label:Sa.label,selected:true},...i]}var Ei=e=>{let t=e?.order;if(t==null)return 999;let o=Number(t);return Number.isFinite(o)?o:999};function Di(e){return {...e,layout:e.layout?.map(t=>({...t,columns:[...t.columns??[]]}))??[]}}function HT(e,t){let o=e.layout?.map(r=>({...r,columns:[...r.columns??[]].sort((i,a)=>Ei(i)-Ei(a))})),n=hC(e,t);return {id:e.id,label:e.name,layout:o,submenu:n,columns:n.map(r=>r.name),role:Ai(e),isCustom:Ae(e),default:e.default}}var Ri=(e,t)=>{if(!e)return [];let o=e;if(e.layout&&Array.isArray(e.layout)&&e.layout.length>0){let n=pa(t)?"Advanced":"Sheet",r=e.layout.find(i=>{let a=i.code?.trim();return a===n||a?.toLowerCase()===n.toLowerCase()})||e.layout.find(i=>{let a=i.code?.trim()?.toLowerCase();return pa(t)?a==="default"||a==="advanced":a==="sheet"||a==="sheets"});if(r&&r.columns&&r.columns.length>0)return r.columns.map(a=>{let s=!!a.fields?.length&&a.fields.some(c=>c.default??false),p=(a.default??false)||s;return {code:a.code,name:a.name&&a.name.length>0?a.name:[{text:a.code,lang:"en"}],selected:p,sort_order:Ei(a),fields:a.fields?.map(c=>({code:c.code.toLowerCase(),type:"single",parameters:[{parameter:c.code.toLowerCase(),code:c.code.toLowerCase(),selected:c.default??false}]}))||[{code:a.code.toLowerCase(),type:"single",parameters:[{parameter:a.code.toLowerCase(),code:a.code.toLowerCase(),selected:a.default??false}]}]}}).sort((a,l)=>(a.sort_order??999)-(l.sort_order??999))}return o.submenu&&Array.isArray(o.submenu)&&o.submenu.length>0?o.submenu.map((r,i)=>{let a=r.name.toLowerCase(),l;r.menuItems&&r.menuItems.length>0?l=r.menuItems.filter(m=>m.selected):l=[{name:a,label:r.label||r.name,selected:true}];let s=l.length>0?l.map(m=>({parameter:m.name.toLowerCase(),code:m.name.toLowerCase()})):[{parameter:a,code:a}],p=l.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:a,type:p,parameters:s}]}}):[]},_T=(e,t)=>{if(!e||!Array.isArray(e)||e.length===0)return [];let o=e?.find(n=>n.default)||e[0];return o?Ri(o,t):[]};function Ul(e,t,o){let n=e.findIndex(t);if(n===-1)return e;let r=[...e];return r[n]=o,r}function $l(e,t){let o=t?.name??e?.name??"",n=t?.layout,r=Array.isArray(n)?n[0]:n??null,a=[...e?.layout??[]];if(r){let l=r.code?.toLowerCase(),s=a.findIndex(p=>p.code?.toLowerCase()===l);s>=0?a[s]=r:a.push(r);}return {name:o,layout:a}}var Gl=e=>{let t=e;return t?!!(t.closest('[role="checkbox"]')||t.closest('input[type="checkbox"]')||t.closest('[class*="CheckboxWrapper"]')):false};var IC=e=>[...Ua[e]??Ua.default],zT=e=>Va[e]??Va.default,UT=(e,t)=>({code:e,name:[{text:Ta[e],lang:"en"}],selected:true,sort_order:t}),$T=(e,t)=>e?.layout?.some(o=>IC(t).includes(o.code?.toLowerCase()??""))??false,Yl=(e,t,o)=>{let n=Va[t],r=o?.layout?.find(a=>a.code?.toLowerCase()===n.toLowerCase()),i=r?{...r,columns:r.columns?.map(a=>({...a,name:a.name?.map(l=>({...l})),fields:a.fields?.map(l=>({...l,name:l.name?.map(s=>({...s}))}))}))??[]}:{code:n,columns:[]};return [e,i]};var Mi=({tableMode:e,templates:t,lang:o="en",mainDefaultTemplate:n})=>useMemo(()=>{let{customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:l}=El(t,e,o),p=(n?Pi([n],e,o).defaultTemplate:void 0)??a,c=p?.submenu?structuredClone(p.submenu):[],m=Pn(t);return {customViews:r,defaultTemplates:i,defaultTemplate:a,allTemplates:l,defaultColumns:c,customTemplateCount:m}},[t,e,o,n]);var Li=({mode:e,onViewChange:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:i,defaultTemplate:a,allTemplates:l,customTemplateCount:s})=>{let[p,c]=useState(null),[m,f]=useState(false),[C,g]=useState(null),[I,S]=useState(false),[A,u]=useState(null),[x,b]=useState(null),[T,w]=useState(),[h,P]=useState(l.find(v=>v.selected)?.id??a?.id),k=useRef(l.find(v=>v.selected)?.id??a?.id),H=useCallback(v=>{let R=v.submenu?.filter(j=>j.selected)||[];return {...v,submenu:R,columns:R.map(j=>j.name)}},[]),K=useCallback(v=>{k.current=v?.id,t?.(v?H(v):void 0);},[t,H]),B=useMemo(()=>h?l.find(v=>v.id===h):a,[l,h,a]),N=useMemo(()=>oe(B?.submenu||i),[B,i]),W=useMemo(()=>({id:h||a?.id||"default",label:B?.label||a?.label||"Default"}),[B,h,a?.id,a?.label]);useEffect(()=>{let v=l.find(fe=>fe.selected)?.id,R=a?.id,j=h?l.some(fe=>fe.id===h):false;if(!(h&&!j&&v!==h)){if(v&&v!==h){P(v);return}if(!h){P(v??R);return}j||P(v??R);}},[l,a?.id,h]),useEffect(()=>{!h||!B||B.id===h&&k.current!==h&&(k.current=h,t?.(H(B)));},[h,B,t,H]);let Y=useCallback(v=>{c(R=>R?null:v.currentTarget);},[]),ce=useCallback(()=>{c(null);},[]),be=useCallback((v,R)=>{P(R?.id),K(R),ce();},[ce,K]),ue=useCallback((v=false,R,j,fe)=>{s!=null&&s>=3||(g(null),S(v),u(R??null),b(j?.length?j:null),w(fe),f(true),c(null));},[s]),F=useCallback(v=>{let R=l.find(j=>j.id===v.id)??v;g(R),S(true),u(null),b(R.submenu?.length?oe(R.submenu):null),f(true);},[l]),We=useCallback(()=>{f(false),g(null),S(false),u(null),b(null),w(void 0);},[]);useEffect(()=>{if(!m||!C?.id)return;let v=l.find(R=>R.id===C.id);v&&(g(v),b(v.submenu?.length?oe(v.submenu):null));},[m,C?.id,l]);let Yi=useCallback(async v=>{if(C){let R=C.id;await n?.(R,v),P(R);let j=l.find(fe=>fe.id===R)??C;K(j),ce();}else {let R=await o?.({...v,sourceTemplateId:T});if(R?.id){P(R.id);let j=l.find(fe=>fe.id===R.id);K(j??{id:R.id,label:R.name,isCustom:true,columns:v.selectedColumns.map(fe=>fe.name),submenu:v.selectedColumns});}}},[C,n,o,ce,l,K,T]),ji=useCallback(async v=>{let R=l.find(j=>j.id===v);await r?.(R?.id??v),h===(R?.id??v)&&P(a?.id);},[l,r,h,a]);return {anchorEl:p,isCreateDialogOpen:m,editingView:C,selectedViewInfo:W,shouldUseCurrentState:I,selectedView:B,currentViewColumns:N,initialColumnsForCreate:A,availableColumnsForCreate:x,handleViewButtonClick:Y,handleCloseViewDropdown:ce,handleSelectedViewInfo:be,handleOpenCreateDialog:ue,handleOpenEditDialog:F,handleCloseCreateDialog:We,handleSaveView:Yi,handleDeleteView:ji}};var Lo=()=>{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);},[]),a=useCallback(()=>{r.current=setTimeout(()=>{t(null),n(null);},0);},[]),l=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:a,cancelClose:l,forceClose:s}};var SC=()=>{let[e,t]=useState(null),[o,n]=useState(null),r=useRef(null),i=useCallback((s,p)=>{t(s),n(p);},[]),a=useCallback(()=>{t(null),n(null);},[]),l=useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null);},[]);return {hoveredNestedColumn:e,nestedSubmenuAnchorEl:o,openNestedSubmenu:i,closeNestedSubmenu:a,cancelNestedClose:l}};var Xl=({open:e,availableColumns:t,defaultColumns:o,editingView:n,tableViews:r=[]})=>{let[i,a]=useState(()=>n?.label||""),[l,s]=useState([]),p=useRef(false),c=useRef([]),m=useRef(n?.label?.trim()||""),{hoveredColumn:f,anchorEl:C,openSubmenu:g,closeSubmenu:I,cancelClose:S}=Lo(),A=Ra,u=Sa;useEffect(()=>{if(!e){p.current=false;return}if(!p.current&&e)if(n){let W=n.submenu&&n.submenu.length>0?n.submenu:o,Y=t.length>0?t:W,be=Hl(W,Y).filter(We=>!we(We.name)&&!L(We.name)),ue=[A,u,...be];s(ue),c.current=oe(ue);let F=n.label?.trim()||"";m.current=F,a(F);}else {let W=t.length>0?t:r,ce=(r&&r.length>0?zl(W,r):_l(W)).filter(ue=>!we(ue.name)&&!L(ue.name)),be=[A,u,...ce];s(be),c.current=oe(be),m.current="",a("");}else if(e&&n){let W=n.label?.trim()||"";a(W);}p.current=e;},[e,n?.id,n?.label,n?.submenu,t,o,r,A,u]);let x=useMemo(()=>l.map(N=>N.name),[l]),b=useMemo(()=>kl(l),[l]),T=useMemo(()=>Vl(l,b),[l,b]),w=useMemo(()=>Bl(i,20),[i]),h=useMemo(()=>{let N=i.trim()!==m.current,W=c.current.length>0&&!Dn(l,c.current);return N||W},[i,l]);return {templateName:i,setTemplateName:a,selectedColumns:l,columnNames:x,allSelected:b,someSelected:T,isNameValid:w,hasChanges:h,hoveredColumn:f,anchorEl:C,openSubmenu:g,closeSubmenu:I,cancelClose:S,handleReorder:N=>{let W=N.filter(Y=>!L(Y)).flatMap(Y=>l.find(ce=>ce.name===Y)??[]);s([A,u,...W]);},handleColumnToggle:N=>{s(W=>Ml(W,N));},handleSubItemToggle:(N,W)=>{s(Y=>En(Y,N,W));},handleSelectAll:()=>{s(N=>Ll(N,!b));},handleResetToDefault:()=>{c.current.length>0&&s(oe(c.current));}}};function Ql({templates:e,setTemplates:t,createTemplate:o,updateTemplate:n,deleteTemplate:r,tableMode:i,isTemplatesLoading:a,lang:l="en",mainDefaultTemplate:s}){let p=useMemo(()=>s??e.find(u=>u.default),[e,s]),c=e.find(u=>u.selected)?.id??p?.id,m=useCallback(u=>{t(x=>x.find(T=>T.selected)?.id===u?x:x.map(T=>({...T,selected:u?T.id===u:false})));},[t]),f=useCallback(async({name:u,layout:x,sourceTemplateId:b})=>{if(Pn(e)>=3)return;let T=e.find(k=>k.id===b)??e.find(k=>k.id===c)??p,w=Yl(x,i,T),h=await o({name:u,layout:w}),P=Di(h);return t(k=>[...k.filter(K=>K.id!==P.id).map(K=>({...K,selected:false})),{...P,selected:true}]),{id:h.id,name:h.name??""}},[o,t,i,p,e,c]),C=useCallback(async u=>{await r(u),t(x=>x.filter(b=>b.id!==u)),m(c===u?p?.id:c);},[r,t,p,m]),g=useCallback(async(u,x)=>{let b=e.find(k=>k.id===u),{name:T,layout:w}=$l(b,x),h=await n(u,{name:T,layout:w}),P=Di(h);t(k=>Ul(k,H=>H.id===u,P)),m(P.id);},[e,n,t,m]),I=useMemo(()=>({templates:e,onCreateCustomView:f,onEditCustomView:g,onDeleteCustomView:C,isLoading:a,mainDefaultTemplate:s}),[e,f,g,C,a,s]),S=useCallback(u=>{if(!p){m(void 0);return}if(!u?.id){m(p.id);return}if(Vt(u)){m(u.id);return}let x=e.find(b=>b.id===u.id);if(x){m(x.id);return}Ae(u)&&m(u.id);},[e,p,m]),A=useMemo(()=>{let u=e.find(b=>c?b.id===c:false)??p;if(!u)return [];let x=Ri(u,i);return x.length>0?x:[]},[i,e,c,p]);return {customViews:I,onViewChange:S,columnsView:A,selectedViewId:c}}function QT({column:e,index:t,openSubMenuName:o,subMenuAnchorEl:n,toggleColumnSelection:r,toggleSubmenuItem:i,handleSubMenuOpen:a,handleSubMenuClose:l}){let{t:s}=useTranslation(),p=useTheme(),{isIndeterminate:c,hasSubmenuItems:m,isSubmenuOpen:f,isFirstItem:C,handleColumnClick:g,handleMouseEnter:I,handleMouseLeave:S}=Al({column:e,index:t,openSubMenuName:o,toggleColumnSelection:r,handleSubMenuOpen:a,handleSubMenuClose:l}),A=u=>u?s(u)??eu(u):"";return jsxs(Bn,{sx:{borderTop:`1px solid ${p.palette.divider}`,...C&&{borderTop:"none",height:33}},children:[jsxs(V$1,{isIndeterminate:c,isSelected:e.selected,onMouseEnter:I,onMouseLeave:S,onClick:g,children:[jsx(Bn,{sx:{flex:1},children:A(e.label)}),m&&jsx("img",{src:xb$1,className:"arrow-icon",alt:"arrow"})]}),m&&jsx(R,{open:f,anchorEl:n,placement:"right-start",onMouseEnter:()=>{},onMouseLeave:l,children:e.menuItems?.map(u=>jsx(V$1,{isSelected:e.selected&&u.selected,onClick:()=>i(e.name,u.name),children:A(u.label)},u.name))})]},e.name)}var vC=QT;function nS({open:e,onSelect:t,setTableViews:o,tableViews:n,anchorEl:r,onClose:i}){let{t:a}=useTranslation(),l=useMemo(()=>n||[],[n]),s=useMemo(()=>l.map(A=>A.name),[l]),{reorderColumns:p,toggleColumnSelection:c,toggleSubmenuItem:m}=Sl({columns:l,setTableViews:o}),{subMenuAnchorEl:f,openSubMenuName:C,handleSubMenuClose:g,handleSubMenuOpen:I,handleMenuScroll:S}=Il(e,i);return jsxs(vo,{"data-testid":"TableView_CustomViews",children:[jsxs(Ao,{"data-testid":"TableView_CustomViews_Button",onClick:t,children:[jsx("div",{children:a("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:S,children:l.map((A,u)=>jsx(vC,{column:A,index:u,openSubMenuName:C,subMenuAnchorEl:f,toggleColumnSelection:c,toggleSubmenuItem:m,handleSubMenuOpen:I,handleSubMenuClose:g},A.name))})})]})]})}var ts=memo(nS);function lS({open:e,selectedViewInfo:t,setSelectedViewInfo:o,onSelect:n,onTableViewOptionClick:r,anchorEl:i}){let{t:a}=useTranslation();return jsxs(vo,{"data-testid":"TableView_DefaultViews",children:[jsxs(Ao,{onClick:l=>{n(l);},children:[jsx("div",{children:t.label}),jsx("img",{src:Eb,alt:"arrow",style:{...!!e&&{transform:"rotate(180deg)"}}})]}),jsx(iS,{open:e,anchorEl:i,placement:"bottom-start",children:jsxs(Po,{children:[Ya$1.map(l=>jsxs(Eo,{onClick:()=>{o(l),r?.(l);},children:[l.id===t.id?jsx("img",{className:"check-icon",src:Fb$1,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:l.label}),jsx(wn,{})]},l.id)),jsxs(Eo,{sx:{border:"none"},onClick:l=>{l.stopPropagation(),o(Xa$1),r?.(Xa$1);},children:[t.id===Xa$1.id?jsx("img",{className:"check-icon",src:Fb$1,alt:"arrow"}):jsx(Do,{}),jsx("span",{children:a("createCustomView")}),jsx(wn,{})]})]})})]})}var os=is.memo(lS);function dS({onViewChange:e,setIsViewVisible:t,setTableViews:o,tableViews:n,resetTableViews:r,onTableViewOptionClick:i}){let[a,l]=useState(null),[s,p$1]=useState(null),[c,m]=useState(null),[f,C$1]=useState(Wa),{t:g}=useTranslation(),I=x=>{e?.(),l(x.currentTarget),t(true);},S=()=>{p$1(null),m(null);},A=()=>{l(null),t(false),C$1(Wa);},u=x=>{C$1(x),x.id!==Xa$1.id&&r?.(x),S();};return a?jsx(cS,{onClickAway:S,children:jsxs(Ti,{"data-testid":"TableView",children:[f.id===Xa$1.id&&jsx(ts,{tableViews:n,setTableViews:o,anchorEl:c,open:!!c,onSelect:x=>{m(c?null:x.currentTarget),p$1(null);},onClose:()=>{m(null);}}),jsx(os,{open:!!s,anchorEl:s,setSelectedViewInfo:x=>{u(x);},selectedViewInfo:f,onSelect:x=>{p$1(s?null:x.currentTarget),m(null);},onTableViewOptionClick:i}),jsx(Ao,{sx:{width:32,justifyContent:"center"},onClick:A,children:jsx("img",{src:Gb,alt:"close"})})]})}):jsx(p,{title:g("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":g("tableView")})})}var ns=memo(dS);var DC=({columns:e,allCurrentSelected:t,someCurrentSelected:o,onSelectAll:n,onReset:r,onColumnToggle:i,onNestedItemToggle:a,isModified:l=false})=>{let{hoveredNestedColumn:s,nestedSubmenuAnchorEl:p,openNestedSubmenu:c,closeNestedSubmenu:m,cancelNestedClose:f$1}=SC();return jsxs(Fragment,{children:[jsxs(lC,{children:[jsx(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:jsx(f,{checked:t,indeterminate:o,onChange:C=>{C.stopPropagation(),n();},onClick:C=>{C.stopPropagation();},sx:sC})}),jsx(Typography,{component:"button",disabled:!l,onClick:C=>{C.stopPropagation(),l&&r();},sx:{fontSize:11,fontWeight:500,color:"#1F88D0",background:"none",border:"none",cursor:l?"pointer":"default",padding:0,opacity:l?1:.5,pointerEvents:l?"auto":"none","&:hover":l?{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((C,g)=>{let I=C.menuItems&&C.menuItems.length>0,{checked:S,indeterminate:A}=vn(C),u=L(C.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:x=>I&&c(C.name,x.currentTarget),onMouseLeave:()=>I&&m(),children:[jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},children:[jsx(V$1,{isSelected:I?S:C.selected,isIndeterminate:I?A:false,isDisabled:u,onClick:()=>{u||i(C.name);},sx:{flex:1,display:"flex",alignItems:"center"},children:jsx("span",{children:C.label||C.name})}),I&&jsx(Box,{sx:{display:"flex",alignItems:"center",pr:1,pointerEvents:"none"},children:jsx("img",{src:yb$1,alt:"arrow",style:{height:12}})})]}),I&&jsx(Popper,{open:s===C.name,anchorEl:p,placement:"right-start",sx:{zIndex:1e4},children:jsxs(Box,{onMouseEnter:f$1,onMouseLeave:m,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Si,{children:C.menuItems?.map((x,b)=>jsxs(is.Fragment,{children:[jsx(V$1,{isSelected:x.selected,isDisabled:u,onClick:()=>{u||a(C.name,x.name);},children:x.label||x.name}),b<(C.menuItems?.length??0)-1&&jsx(v$1,{})]},x.name))})]})})]}),g<e.length-1&&jsx(v$1,{})]},C.name)})})})]})};function bS({open:e,selectedViewInfo:t,setSelectedViewInfo:o,anchorEl:n,onClose:r,onCreateCustomView:i,customViews:a=[],onEditCustomView:l,defaultColumns:s=[],defaultTemplate:p$1,defaultTemplates:c=[],customTemplateCount:m,isLoading:f}){let{t:C}=useTranslation(),{hoveredColumn:g,anchorEl:I,openSubmenu:S,closeSubmenu:A,cancelClose:u,forceClose:x}=Lo(),[b,T]=is.useState(null),[w,h]=is.useState(null),P=useMemo(()=>[...c.length?c:p$1?[p$1]:[],...a],[c,p$1,a]),k=useCallback(E=>E.submenu?.length?E.submenu:s,[s]),H=useCallback(E=>E?vi(E,k(E)):s,[s,k]),K=useCallback(E=>H(E).length>0,[H]),B=useMemo(()=>g?P.find(E=>E.id===g):void 0,[g,P]),N=useMemo(()=>H(B),[B,H]),W=useMemo(()=>g?w?.length?w:N:[],[g,N,w]),Y=useMemo(()=>Fl(W),[W]),ce=useMemo(()=>Ol(W,Y),[W,Y]),be=w!=null&&!Dn(w,N),ue=(m??vl(a))>=3,F=f||ue,We=F||!be;function Yi(E){x(),h(null);let Z;if(Vt(E)){let xe=E.submenu?.length?E.submenu:s.length?s:p$1?.submenu??[];Z={...E,submenu:oe(xe),columns:xe.map(Ee=>Ee.name)};}else Ae(E)&&(Z=E);o(E,Z);}function ji(E,Z){let xe=P.find(Ee=>Ee.id===E);h(oe(H(xe))),S(E,Z);}function v(){h(null),A(),x();}function R$1(E){if(E.stopPropagation(),We)return;let Z=oe(N),xe=w?.length?oe(w):Z;i?.(true,xe,Z,B?.id),h(null),x();}function j(E){w&&h(Nl(w,E));}function fe(E,Z){w&&h(En(w,E,Z));}function Mg(){w&&h(Wl(w,!Y));}function Lg(){h(oe(N));}return jsxs(vo,{"data-testid":"ViewsDropdown",children:[jsx(iS,{open:e,anchorEl:n,placement:"bottom-start",children:jsxs(Po,{onScroll:x,children:[jsx(IS,{sx:{paddingX:1.25,py:1.1,fontWeight:500,fontSize:11,color:"#8D8D94"},children:"View"}),jsx(v$1,{}),P.map(E=>{let Z=Ae(E),xe=!Z&&K(E);return jsxs(Eo,{onMouseEnter:Ee=>{Z?T(E.id):xe&&ji(E.id,Ee.currentTarget);},onMouseLeave:()=>{Z?T(null):xe&&A();},onClick:()=>Yi(E),sx:{position:"relative",cursor:"pointer",pr:1.5},children:[E.id===t.id?jsx("img",{style:{width:15,height:15},src:Zj,alt:"check"}):jsx(Do,{}),jsx("span",{style:{flex:1,fontSize:11},children:E.label}),Z&&b===E.id&&jsx("img",{src:Dh,alt:"edit",style:{width:12,height:12,cursor:"pointer"},onClick:Ee=>{Ee.stopPropagation(),r?.(),l?.(E);}}),xe&&jsx("img",{src:yb$1,alt:"arrow",style:{height:12}})]},E.id)}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"left",disableHoverListener:!ue,children:jsxs(Eo,{sx:{border:"none",opacity:F?.5:1,cursor:F?"not-allowed":"pointer"},onClick:E=>{if(E.stopPropagation(),F)return;let Z=oe(H(p$1)),xe=Z.map(Ee=>({...Ee,selected:false,menuItems:Ee.menuItems?.map(kg=>({...kg,selected:false}))}));i?.(true,xe,Z,p$1?.id),x();},children:[jsx(Do,{}),jsxs(Bn,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsx("img",{src:im$1,alt:"",style:{opacity:F?.5:1,width:10,height:10}}),jsx("span",{style:{color:F?"#999":"#1F88D0",fontSize:11,fontWeight:500},children:C("New Custom View")})]}),jsx(wn,{})]})})]})}),g&&I&&W.length>0&&jsx(R,{open:!!I,anchorEl:I,placement:"auto-end",onMouseEnter:u,onMouseLeave:v,children:jsxs(pC,{children:[jsx(DC,{columns:Mo(W),allCurrentSelected:Y,someCurrentSelected:ce,onSelectAll:Mg,onReset:Lg,onColumnToggle:j,onNestedItemToggle:fe,anchorEl:I,isModified:be}),jsxs(dC,{children:[jsx(RC,{variant:"text",onClick:v,sx:mC,children:"Cancel"}),jsx(p,{title:"Limit reached. Delete a view to create a new one.",placement:"top",disableHoverListener:!ue,children:jsx(RC,{variant:"contained",onClick:R$1,disabled:We,sx:uC,children:"Create view"})})]})]})})]})}var as=is.memo(bS);var kC=({selectedColumns:e,columnNames:t,allSelected:o,someSelected:n,hoveredColumn:r,anchorEl:i,onReorder:a,onColumnToggle:l,onSubItemToggle:s,onSelectAll:p,onResetToDefault:c,onSubmenuEnter:m,onSubmenuLeave:f$1,onCancelClose:C$1})=>{let g=useRef(null),{onDragStart:I,onDragEnd:S}=bl(g),A=useCallback(u=>{if(Gl(u.target)){u.preventDefault();return}I();},[I]);return jsxs(Qf,{children:[jsxs(eC,{children:[jsx(gl,{children:jsx("img",{src:C,alt:"drag",style:{width:16,height:16,opacity:.5}})}),jsx(xl,{onClick:u=>{u.stopPropagation(),p();},children:jsx(f,{checked:o,indeterminate:n,size:"small",sx:yl,onChange:u=>{u.stopPropagation(),p();},onClick:u=>{u.stopPropagation();}})}),jsx(Typography,{onClick:u=>{u.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:u=>{u.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:g,axis:"y",onReorder:a,values:t,style:{listStyle:"none",padding:0,margin:0},children:e.map(u=>{let x=L(u.name),b=u.menuItems&&u.menuItems.length>0,{checked:T,indeterminate:w}=vn(u);return jsxs(Reorder.Item,{value:u.name,drag:x?false:"y",dragListener:!x,dragConstraints:g,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:A,onDragEnd:S,children:[jsxs(tC,{isHovered:r===u.name,isDate:x,onMouseEnter:h=>b&&m(u.name,h.currentTarget),onMouseLeave:()=>b&&f$1(),onClick:h=>{(h.target.closest('[role="checkbox"]')||h.target.closest('input[type="checkbox"]'))&&h.stopPropagation();},sx:{width:"100%",position:"relative"},children:[jsx(gl,{children:jsx("img",{src:Hb$1,alt:"drag",draggable:false,style:{width:16,height:16,cursor:x?"default":"grab",pointerEvents:"none"}})}),jsx(xl,{onMouseDown:h=>{h.stopPropagation();},onPointerDown:h=>{h.stopPropagation();},children:jsx(f,{checked:T,indeterminate:w,onChange:h=>{h.stopPropagation(),l(u.name);},onClick:h=>{h.stopPropagation();},disabled:x,size:"small",sx:yl})}),jsx(Typography,{sx:{flex:1,fontSize:13,fontWeight:400,color:"text.primary",ml:1},children:u.label||u.name}),b&&jsx(Box,{sx:{display:"flex",alignItems:"center",ml:1,flexShrink:0},children:jsx("img",{src:xb$1,alt:"arrow",style:{width:12,height:12}})})]}),b&&jsx(Popper,{open:r===u.name,anchorEl:i,placement:"right-start",sx:{zIndex:1e4},modifiers:[{name:"offset",options:{offset:[0,0]}}],children:jsxs(Box,{onMouseEnter:C$1,onMouseLeave:f$1,sx:{display:"flex",pl:.5},children:[jsx(Box,{sx:{width:8,height:"100%",position:"absolute",left:-8,top:0,bottom:0}}),jsx(Si,{children:u.menuItems?.map((h,P)=>jsxs(is.Fragment,{children:[jsx(V$1,{isSelected:h.selected,isDisabled:x,onClick:()=>{x||s(u.name,h.name);},sx:{fontSize:13},children:h.label||h.name}),P<(u.menuItems?.length??0)-1&&jsx(v$1,{})]},h.name))})]})})]},u.name)})})})]})};function DS({open:e,onClose:t,onCreate:o,availableColumns:n=[],defaultColumns:r=[],editingView:i$1,onDelete:a,tableViews:l=[],mode:s="sheet",stackOrder:p=1}){let{t:c$1}=useTranslation(),m=useDragControls(),[f,C]=useState(false),[g,I]=useState(false);useEffect(()=>{e||(C(false),I(false));},[e]),useEffect(()=>{if(!e)return;let F=We=>{We.key==="Escape"&&t();};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[e,t]);let{templateName:S,setTemplateName:A,selectedColumns:u,allSelected:x,someSelected:b,isNameValid:T,hasChanges:w,hoveredColumn:h$1,anchorEl:P,openSubmenu:k,closeSubmenu:H,cancelClose:K,handleReorder:B,handleColumnToggle:N,handleSubItemToggle:W,handleSelectAll:Y,handleResetToDefault:ce}=Xl({open:e,availableColumns:n,defaultColumns:r,editingView:i$1,tableViews:l}),be=async()=>{if(!(!T||!w||g||f)){I(true);try{let F=Pl(u,s);await o?.({name:S,selectedColumns:u,layout:F}),t();}catch{console.warn("Failed to create view");}finally{I(false);}}},ue=async()=>{if(!i$1||f||g)return;let F=i$1.id;C(true);try{await a?.(F),t();}catch{console.warn("Failed to delete view");}finally{C(false);}};return e?jsxs(aC,{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(fC,{id:"draggable-dialog-title",onPointerDown:F=>m.start(F),style:{cursor:"move",flexShrink:0},children:jsxs(b$4,{children:[jsx(h,{children:jsx(c,{onClick:t,onPointerDown:F=>F.stopPropagation()})}),jsx(j$1,{title:i$1?"Edit Custom View":c$1("createCustomView")||"Create Custom View"}),jsx(i,{})]})}),jsxs(Zf,{children:[jsxs(Xf,{onScroll:()=>{H();},children:[jsxs(Jf,{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$1&&jsx(rC,{onClick:ue,disabled:f||g,children:f?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$5,{name:"custom-template-name",label:"Template Name",value:S,onChange:F=>A(F),inputProps:{maxLength:20,autoComplete:"off",readOnly:true,"data-form-type":"other",onFocus:F=>F.currentTarget.removeAttribute("readonly")},required:true})}),jsx(kC,{selectedColumns:Mo(u),columnNames:Mo(u).map(F=>F.name),allSelected:x,someSelected:b,hoveredColumn:h$1,anchorEl:P,onReorder:B,onColumnToggle:N,onSubItemToggle:W,onSelectAll:Y,onResetToDefault:ce,onSubmenuEnter:k,onSubmenuLeave:H,onCancelClose:K})]}),jsx(oC,{}),jsx(nC,{children:jsx(iC,{variant:"contained",onClick:be,disabled:!T||!w||g||f,title:T?void 0:`Name is required. Current: "${S}"`,children:g?jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsx(CircularProgress,{size:14,color:"inherit"}),jsx("span",{children:i$1?"Saving...":"Creating..."})]}):i$1?"Update View":"Create View"})})]})]}):null}var ls=DS;function kS({onViewChange:e,templates:t,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,tableMode:i="default",lang:a="en",isLoading:l,mainDefaultTemplate:s}){let{t:p$1}=useTranslation(),{defaultColumns:c,defaultTemplate:m,defaultTemplates:f,customViews:C$1,allTemplates:g,customTemplateCount:I}=Mi({tableMode:i,templates:t,lang:a,mainDefaultTemplate:s}),{anchorEl:S,isCreateDialogOpen:A,editingView:u,selectedViewInfo:x,shouldUseCurrentState:b$1,currentViewColumns:T,initialColumnsForCreate:w,availableColumnsForCreate:h,handleViewButtonClick:P,handleCloseViewDropdown:k,handleSelectedViewInfo:H,handleOpenCreateDialog:K,handleOpenEditDialog:B,handleCloseCreateDialog:N,handleSaveView:W,handleDeleteView:Y}=Li({mode:i,onViewChange:e,onCreateCustomView:o,onEditCustomView:n,onDeleteCustomView:r,defaultColumns:c,defaultTemplate:m,allTemplates:g,customTemplateCount:I});return jsxs(Fragment,{children:[jsx(cS,{onClickAway:k,children:jsxs(Ti,{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:P,"aria-label":p$1("tableView")})}),jsx(as,{open:!!S,anchorEl:S,onClose:k,setSelectedViewInfo:H,selectedViewInfo:x,onCreateCustomView:K,customViews:C$1,onEditCustomView:B,defaultColumns:c,defaultTemplate:m,defaultTemplates:f,customTemplateCount:I,isLoading:l})]})}),jsx(ls,{open:A,onClose:N,availableColumns:h?.length?h:c,defaultColumns:c,onCreate:W,editingView:u,onDelete:Y,tableViews:b$1?w??T:void 0,mode:i})]})}var OC=memo(kS);function ss(e=[]){let[t,o]=useState(false),n=useMemo(()=>e.map(({code:r})=>r),[e]);return {isColumnPickerVisible:t,setIsColumnPickerVisible:o,timezoneCountryCodes:n}}function kn({children:e,component:t="aside",...o}){return jsx(Yf,{component:t,"data-testid":"ListHeaderToolbar",...o,children:e})}function Fi({display:e,timezone:t,calendar:o,views:n,search:r,slots:i,reportsVisible:a,lang:l}){let{isColumnPickerVisible:s,setIsColumnPickerVisible:p,timezoneCountryCodes:c}=ss(t?.segmentCountries),m=e?.variant==="acceptance",f=n?.tableMode??"default",C=useMemo(()=>n?.onSheetToggle?jsx(b$6,{tableMode:f,onToggle:n.onSheetToggle}):null,[f,n?.onSheetToggle]);return jsxs(kn,{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,C&&!m&&C,i?.calendar??(o&&t&&jsx(a$1,{defaultDate:o.date,onDateChange:g=>{let[I,S]=g;I&&S&&o.onDateChange([I,S]);},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})),a&&i?.reports,C&&m&&C]}),n?.onViewChange&&(n.templates?jsx(OC,{onViewChange:n.onViewChange,tableMode:f,lang:l,...n.templates}):jsx(ns,{onViewChange:n.onViewChange,setIsViewVisible:p,tableViews:n.columns,setTableViews:n.setColumns,resetTableViews:n.onPresetReset,onTableViewOptionClick:n.onPresetOptionClick})),i?.trailing&&!s&&i.trailing]})}function zS({title:e,display:t,lang:o,reportsVisible:n,timezone:r,calendar:i,status:a,activeFilter:l,views:s,search:p,slots:c,children:m}){let f=useMemo(()=>jsx(Fi,{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(hi,{"data-testid":Hf,children:[t?.maximized&&jsx(Ii,{title:e,toolbar:f}),jsxs($f,{as:"section",children:[jsx(bi,{status:a,activeFilter:l,beforeStatus:c?.beforeStatus}),!t?.maximized&&f]}),m]})}var zC=memo(zS);var US=styled$1(j)(()=>({fontSize:"11px"})),UC=styled$1(Bn)(()=>({display:"flex",alignItems:"center",gap:"4px",width:"100%",paddingInline:"16px"})),$C=styled$1(Bn)(({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}`})),GC=styled$1(b)(()=>({minWidth:"auto",width:70})),YC=styled$1(b)(()=>({minWidth:"auto",width:70})),jC=styled$1(Bn)(()=>({display:"flex",flexDirection:"column",gap:"8px",marginBottom:"8px"})),cs=styled$1(US)(()=>({fontSize:"11px",fontWeight:500,color:"#8D8D94",padding:"8px 16px"})),qC=styled$1(Bn)(({theme:e})=>({borderBlock:`1px solid ${e.palette.divider}`,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"2px",width:"100%"})),KC=styled$1(Bn)(({theme:e})=>({...a(e),width:"auto",marginTop:"8px","&:focus":{outline:"none"}})),ZC=styled$1(cs)(()=>({color:"#1F88D0",padding:"4px 24px",cursor:"pointer"})),XC=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 QC({dateRange:e,onDateRangeChange:t,calendarMode:o,onCalendarModeChange:n,timezone:r,browserTimezone:i,defaultCountryTimezone:a,onTimezoneChange:l,timezoneCountriesCodes:s=[],onConfirm:p,onCloseDropdown:c}){let m$1=Vb$1(useId(),"date-filter"),{t:f}=useTranslation(),C=useRef(null),g=()=>p(e),I=p$1(g,c),S=b=>{t(b),requestAnimationFrame(()=>C.current?.focus());},A=b=>{g(),c(b);},u=useCallback(b=>n(b),[n]),x=b=>{if(!b)return "";let[T,w]=b,h=$m(T).format("MMM D"),P=$m(w).format("MMM D");return h===P?h:`${h} - ${P}`};return jsxs(KC,{ref:C,tabIndex:-1,onKeyDown:I,id:m$1,"data-testid":"DateFilter",children:[jsxs(jC,{children:[jsx(qC,{children:jsx(cs,{component:"span",children:f("filterBy")})}),jsx(UC,{children:jsx(a$1,{defaultDate:e||m(0),onDateChange:S,maxDateRange:365,mode:o,onCalendarModeSwitch:u,browserTimezone:i,defaultCountryTimezone:a,timezone:r,onChangeTimezone:l,timezoneCountriesCodes:s,mainSx:{width:"100%"},popperProps:{placement:"right-start"},renderCalendarButton:(b,T)=>jsxs(XC,{variant:"secondary",size:"md",fullWidth:true,open:b,onClick:T,children:[jsx("span",{children:x(e)||"Date"}),jsx(d,{src:fk,alt:"selected",sx:{width:16,height:16}})]})},x(e))}),e&&jsx(ZC,{component:"span",onClick:()=>t(void 0),children:"Clear"})]}),jsxs($C,{children:[jsx(YC,{variant:"secondary",size:"md",onClick:c,children:f("cancel")}),jsx(GC,{variant:"primary",size:"md",onClick:A,children:f("okay")})]})]})}function QS({voidPercentage:e,capturePercentage:t,captureCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:l,remainingAmount:s,isSheetViewShown:p$1,selectionProps:c={}}){let m=Number(t)+Number(e)===100||s<=0,f=Vb$1(useId(),"capture-auto-icon"),C=useTheme(),{t:g}=useTranslation(),I=ba(s||0),S=useCallback(T=>`Auto ${T} - ${a} ${I.integerAmount}.${I.decimalAmount}`,[a,I.decimalAmount,I.integerAmount]),A=useCallback(T=>{let w=T==="Capture"?r:i,{integerAmount:h,decimalAmount:P}=ca(w,a);return `Partial ${T} - ${a} ${h}.${P}`},[r,i,a]),u=t>0?jsx(p,{title:A("Capture"),children:jsxs(Pr,{isCapture:true,isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:C.shadows[4]}},children:[jsx(Dr,{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(vr,{isCapture:true,percentage:t,children:[t,"% ",jsx(Er,{isCapture:true,percentage:Rr(t)})]}),o>1&&jsxs(z,{compact:true,color:"dark",children:[o,"x"]})]})]})}):n==="CAPTURED"&&!m?jsx(p,{title:S("Capture"),children:jsx(eo,{children:jsx(bt,{src:qo.CAPTURED?.icon,alt:"auto"})})}):jsx(p,{title:S("Capture"),children:jsx(eo,{children:jsx(bt,{src:qo.CAPTURED?.icon,alt:"auto"})})}),x=t===100?jsx(p,{title:g("captured"),children:jsx(dd,{children:jsx(bt,{src:jk,alt:"captured"})})}):u,b=useMemo(()=>p$1&&x?jsx(b$1,{copyTrigger:"click",copyText:g("captured"),children:g("captured")}):l&&x?jsx(pd,{children:g("captured")}):x,[l,x,p$1,g]);return b&&jsx("div",{id:f,"data-testid":"CaptureAutoIcon",style:{zIndex:12},children:b})}var tg=QS;function iw({voidPercentage:e,capturePercentage:t,voidCount:o,autoType:n,captureAmount:r,voidAmount:i,currency:a,isTextShown:l,isSheetViewShown:s,selectionProps:p$1={},remainingAmount:c}){let m=Number(t)+Number(e)===100||c<=0,f=Vb$1(useId(),"void-auto-icon"),C=useTheme(),{t:g}=useTranslation(),I=ba(c||0),S=useCallback(T=>`Auto ${T} - ${a} ${I.integerAmount}.${I.decimalAmount}`,[a,I.decimalAmount,I.integerAmount]),A=useCallback(T=>{let w=T==="Capture"?r:i,{integerAmount:h,decimalAmount:P}=ca(w,a);return `Partial ${T} - ${a} ${h}.${P}`},[r,i,a]),u=e>0||i?jsx(p,{title:A("Void"),children:jsxs(Pr,{isFullyUsed:m,whileHover:["animate","fadeIn"],animate:"start",sx:{zIndex:14,background:C.palette.common.white,border:`0.75px solid ${C.palette.grey[600]}1A`},variants:{animate:{boxShadow:C.shadows[4]}},children:[jsx(Dr,{src:Ak,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(vr,{percentage:e,children:[e,"% ",jsx(Er,{percentage:Rr(e)})]}),o>0&&jsxs(z,{compact:true,color:"neutral",children:[o,"x"]})]})]})}):n==="VOID"&&!m?jsx(p,{title:S("Void"),children:jsx(eo,{children:jsx(bt,{src:qo.VOID?.icon,alt:"auto"})})}):null,x=e===100?jsx(p,{title:g("void"),children:jsx(eo,{children:jsx(bt,{src:Ak,alt:"void"})})}):u,b=useMemo(()=>s&&x?jsx(b$1,{copyTrigger:"click",copyText:g("void"),children:g("void")}):l&&x?jsx(cd,{children:g("void")}):x,[l,x,s,g]);return b?jsx("div",{id:f,"data-testid":"VoidAutoIcon",style:{...!s&&{zIndex:11}},children:b}):null}var ng=iw;var aw=tg;var cw=({authorizedStatus:e,isTextShown:t,iconStyles:o,tableMode:n,chipIndex:r=0,selectionProps:i={}})=>{let{t:a}=useTranslation(),l=useTheme(),s=a(ft(e));return qa$1(n)?jsx(b$1,{copyTrigger:"click",copyText:s,children:s}):jsx(p,{title:s,children:t?jsx(V,{"data-testid":"StatusCell_AuthorizedStatusLabel",sx:{color:l.palette.info.dark},children:s}):jsx(d,{src:Et[e],alt:"authorized-icon","data-testid":"StatusCell_AuthorizedStatusIcon",sx:o})})};var rg=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)})),ig=styled$1(motion.span)(()=>({display:"block",width:"0",overflow:"hidden"})),ds=styled$1("img")(()=>({width:"10px",height:"10px"})),ms=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"})),us=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"}})),ag=styled$1(motion.div)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start"})),lg=styled$1(motion.span)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"absolute",minHeight:"24px",cursor:"pointer",borderRadius:"16px"})),sg={delay:.2,ease:"easeIn",fadeIn:{duration:.2}},pg={animate:{width:"auto",paddingRight:"4px",paddingLeft:"4px"},fadeIn:{opacity:1,transition:{delay:.7}}},cg={animate:{width:"auto"},fadeIn:{opacity:1,transition:{delay:1}}},dg={animate:{width:"auto",paddingRight:"8px",paddingLeft:"4px"}},fs={fadeIn:{duration:.3},animate:{duration:.1}},mg={fadeIn:{opacity:1}},ug=styled$1(V)(()=>({width:"88px",height:"100%"})),Cs=styled$1(Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(.25),height:"100%"}));function He({chargeStatus:e,gatewayTooltip:t,acquirerTooltip:o,chargeTooltip:n,errorCode:r,isTextShown:i,gatewayCode:a,acquirerCode:l,unCapturedStyles:s,iconStyles:p$1,iconWrapperStyles:c,gatewayIconWrapperStyles:m,gatewayContainerStyles:f,gateWayIconStyles:C,showBadge:g=true,isSheetViewShown:I=false,selectionProps:S={},chipIndex:A=0}){let u=e?oi[e]:null,x=e?vm[e]:null,b=useTheme(),{t:T}=useTranslation(),w=Vb$1(useId(),"charge-status-icon"),h=n&&jsx(Fragment,{children:jsx("div",{children:n})}),P=o&&jsxs(Fragment,{children:[jsx("div",{children:"Acquirer"}),jsx("div",{children:o})]}),k=t&&jsxs(Fragment,{children:[jsx("div",{children:"Gateway"}),jsx("div",{children:t})]}),H=e&&ke[e]&&jsx("div",{"data-testid":"ChargeStatusIcon_ChargeIcon",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:u?"50%":"",...c},children:jsx(_,{src:ke[e],alt:"charge-icon","data-testid":"ChargeStatusIcon_StatusIcon",style:{borderRadius:u?"50%":"",width:"16px",height:"16px",...p$1}})});return I?jsxs(Cs,{children:[jsxs(b$1,{copyTrigger:"click",copyText:T(ft(e)),children:[T(ft(e))," ",r]}),u&&jsxs(Fragment,{children:[a&&jsxs(b$1,{copyTrigger:"click",copyText:"Gateway",children:["Gateway ",a]}),l&&jsxs(b$1,{copyTrigger:"click",copyText:"Acquirer",children:["Acquirer ",l]})]})]}):i?jsxs(Cs,{children:[jsx(p,{title:h,children:jsxs(ug,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:u?.background||x?.background||"transparent",color:u?.color||x?.color||b.palette.info.dark,borderColor:`${u?.color||x?.color||b.palette.info.dark}1A`},children:[T(ft(e))," ",r]})}),u&&jsxs(Fragment,{children:[a&&jsx(p,{title:k,children:jsxs(V,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:u?.background||x?.background||"transparent",color:u?.color||x?.color||b.palette.info.dark},children:["Gateway ",a]})}),l&&jsx(p,{title:P,children:jsxs(V,{"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:u?.background||x?.background||"transparent",color:u?.color||x?.color||b.palette.info.dark},children:["Acquirer ",l]})})]})]}):jsx(Ce,{id:w,"data-testid":"ChargeStatusIcon_StatusIconWrapper",style:{...c},children:Pn$1?.includes(e||"")&&(h||P||k)?jsxs(lg,{"data-testid":"ChargeStatusIcon_UnCapturedContainer",whileHover:["animate","fadeIn"],style:{left:"0",...g&&{paddingInline:"12px",border:"1px solid #F2F2F2",borderRadius:"12px",backgroundColor:"#fff"},...s},children:[jsx(ag,{"data-testid":"ChargeStatusIcon_UnCapturedBadge",sx:{borderRadius:"56px"},initial:{background:"transparent"},variants:{animate:{background:u?.background}},children:jsx(p,{title:h??T(ft(e)),children:jsxs(Fragment,{children:[H,jsx(ig,{"data-testid":"ChargeStatusIcon_ErrorCodeWrapper",transition:{animate:{duration:.05}},variants:dg,style:{...r&&{padding:"0 !important"}},children:jsx(rg,{"data-testid":"ChargeStatusIcon_ErrorCodeLabel",sx:{background:u?.color},transition:sg,variants:mg,initial:{opacity:0},children:r})})]})})}),jsx(us,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:fs,variants:pg,style:f,isVisible:!!k,children:k&&jsx(p,{title:k,children:jsx(ms,{"data-testid":"ChargeStatusIcon_GatewayIconWrapper",style:{background:u?.background,...m},children:jsx(ds,{src:u?.gatewayIcon,alt:"gateway-icon","data-testid":"ChargeStatusIcon_GatewayIcon",style:C})})})}),jsx(us,{"data-testid":"ChargeStatusIcon_GatewaysContainer",transition:fs,variants:cg,style:f,isVisible:!!P,children:P&&jsx(p,{title:P,children:jsx(ms,{"data-testid":"ChargeStatusIcon_AcquirerIconWrapper",style:{background:u?.background,...m},children:jsx(ds,{src:u?.acquirerIcon,alt:"acquirer-icon","data-testid":"ChargeStatusIcon_AcquirerIcon",style:C})})})})]}):jsx(p,{title:h??T(ft(e)),children:jsx(Ce,{children:H})})})}var xw=()=>{let{t:e}=useTranslation(),t=Vb$1(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 yw={G:"Global",R:"Regional",L:"Local"},At=({geographyVariant:e,countryCode:t,isTextShown:o})=>{let n=e?yw[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$3,{countryCode:t})})};var bw=({geographyVariant:e,isTextShown:t,deviceCountry:o,deviceType:n,tableMode:r})=>{let i=Vb$1(useId(),"device-icon-chip");return jsxs(Bn,{id:i,"data-testid":"DeviceIconChip",sx:{display:"flex",gap:"8px",alignItems:"center",...qa$1(r)&&{height:"18px"}},children:[jsx(At,{geographyVariant:e,isTextShown:t,countryCode:o}),jsx(c$1,{type:n,isTextShown:t,tableMode:r})]})};var ww=({isDisputeOpen:e,iconStyles:t})=>{let o=Vb$1(useId(),"dispute-icon");return jsx(_,{id:o,"data-testid":"StatusCell_DisputeStatusIcon",sx:{width:"13.5px",height:"13.5px"},src:e?va$1:ua,alt:"dispute-icon",style:t})};var yg=styled$1(Bn,{shouldForwardProp:e=>e!=="tableMode"})(({theme:e,tableMode:t})=>({display:"flex",gap:e.spacing(.5),...qa$1(t)&&{height:"18px"},alignItems:"center"})),hg=styled$1("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function xs({countryCode:e,isTextShown:t,cardNumber:o,bankName:n,tableMode:r}){let i=Vb$1(useId(),"issuer-icon"),a=o?.slice(0,4),l=o?.slice(-4);return jsxs(yg,{id:i,"data-testid":"IssuerIcon",tableMode:r,children:[e&&jsx(At,{countryCode:e,isTextShown:t}),jsx(p,{title:`${n?`Issuer - ${n}`:""}`,children:jsx(hg,{children:`${a||""} ${l||""}`})})]})}var Dw=xs;var kw=({payoutStatus:e="PENDING",isTextShown:t,payoutTooltip:o,iconStyles:n,isSheetViewShown:r,chipIndex:i=0,selectionProps:a={}})=>{let{t:l}=useTranslation(),s=Vb$1(useId(),"payout-icon"),p$1=l(ft(e)),c=o||p$1;return r?jsx(b$1,{copyTrigger:"click",copyText:p$1,children:p$1}):jsx(p,{title:c,children:t?jsx(mi,{id:s,"data-testid":"StatusCell_PayoutStatusLabel",children:p$1}):jsx(_,{id:s,src:dn[e],alt:"settled-icon","data-testid":"StatusCell_PayoutStatusIcon",style:n})})};var Fw=({isTextShown:e,refundStatus:t="PENDING",refundTooltip:o="",refundCount:n,iconStyles:r,isSheetViewShown:i,chipIndex:a=0,selectionProps:l={}})=>{let{t:s}=useTranslation(),p$1=useTheme(),c=Vb$1(useId(),"refund-icon"),m=(n||0)>1,f=s(ft(t));if(i)return jsxs(b$1,{copyTrigger:"click",copyText:f,children:[f," ",m?`${n}x`:null]});let C=jsxs(Ad,{"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(mi,{id:c,"data-testid":"StatusCell_RefundStatusLabel",sx:{color:Ya[t].color,backgroundColor:Ya[t].backgroundColor,width:"90px"},children:jsxs(Ea,{whileInView:m?["animate","fadeIn"]:void 0,variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[f," ",m?C:null]})})}):jsx(p,{title:jsx("div",{children:jsx("div",{children:o})}),children:m?jsxs(Ea,{id:c,whileHover:["animate","fadeIn"],animate:"start",variants:{animate:{boxShadow:p$1.shadows[4],gap:p$1.spacing(.5)}},children:[jsx(wd,{src:sk,alt:"multi-refunded-icon","data-testid":"StatusCell_MultiRefundIcon"}),C]}):jsx(_,{id:c,src:Pm[t],alt:"refunded-icon","data-testid":"StatusCell_RefundStatusIcon",style:r})})},Ig=Fw;var Ow=Ig;var Hw={american_express:"AMEX",debit:"card",credit:"card",unionpay:"UnionPay",jaywan:"JAYWAN"},se=e=>Hw[e?.toLowerCase()||""]||e;styled("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)}));var bg=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 Tg=styled("span")(({theme:e})=>({fontSize:"11px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"2px 0",color:e.palette.text.primary})),Sg=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 wg=styled("span")(({theme:e})=>({fontSize:"10px",fontWeight:500,color:e.palette.text.primary}));function Me({source:e,isTextShown:t,title:o,width:n,height:r,imgSx:i}){let{t:a}=useTranslation(),l=h$1(e);return jsx(p,{title:o,children:t?jsx(Sg,{"data-testid":"SourceCell_BadgeTextWrapper",children:jsx(Tg,{"data-testid":"SourceCell_TextLabel","data-source":e,children:a(ft(e))})}):jsx(bg,{src:l,alt:e,width:n,height:r,onError:s=>{s.currentTarget.src=h$1("card");},sx:i})})}function qw({payment:e,card:t,isTextShown:o,firstIcon:n}){let r=Vb$1(useId(),"source-icons"),{t:i}=useTranslation(),a=useCallback(()=>{let p=[],c=yb$2(e),m=e?.method,f=e?.scheme;return se(m)?.toLowerCase()===se(f)?.toLowerCase()?p.push(se(m),se(c)):p.push(se(m),se(c),se(f)),p},[e]),l=useMemo(()=>jsx(Me,{source:n,isTextShown:o,title:i(ft(n))},n),[n,o,i]),s=useMemo(()=>a()?.filter(p=>!!p&&p!==n)?.map((p,c,m)=>{let f=e?.wallet===i("sv_wallet")?i("storedValueWallet"):i("passThruWallet"),C=c===m.length-1&&t?.last_four?`${i(ft(p))} - ${t?.last_four}`:i(ft(p));return jsx(Me,{source:p,isTextShown:o,title:c===0&&p==="Wallet"?f:C},`${p}-${c}`)}),[a,e,t,o,i,n]);return jsxs(Box,{id:r,"data-testid":"SourceIcons",display:"flex",alignItems:"center",gap:.5,children:[n&&l,s,t?.last_four&&jsxs(wg,{children:["\xB7\xB7\xB7 ",t?.last_four]})]})}var Nn={PROCESSED:Vg,FAILED:""};var Eg=styled("span")(({theme:e})=>({fontSize:"11px",padding:"2px 0",color:e.palette.text.primary})),Dg=styled("img")(()=>({width:"16px",height:"16px"})),Rg=styled("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}));function ri({status:e,isTextShown:t,isSheetViewShown:o}){let n=useTheme$1(),{t:r}=useTranslation(),i=Vb$1(useId(),"destination-icon"),a=r(ft(e));return o&&Nn[e]?jsx(b$1,{copyTrigger:"click",copyText:a,children:a}):t&&Nn[e]?jsx(Eg,{id:i,"data-testid":"ChargeStatusIcon_isTextShown","data-status":ft(e),sx:{background:"#1F88D00D",color:e==="PROCESSED"?n.palette.info.dark:n.palette.common.black},children:a}):jsx(Rg,{id:i,"data-testid":"DestinationIcon",className:"destination-status",children:e&&Nn[e]&&jsx(p,{title:r(ft(e)),children:jsx(Dg,{src:Nn[e],alt:"destination-icon"})})})}
|
|
2
2
|
export{ww as $,Nb as $a,HT as $b,yd as A,Yh as Aa,vl as Ab,va as B,Xh as Ba,Pi as Bb,Vr as C,Jh as Ca,El as Cb,h1 as D,oI as Da,vi as Db,to as E,rI as Ea,FT as Eb,oo as F,sI as Fa,Mo as Fb,Dx as G,mI as Ga,vn as Gb,Lx as H,xI as Ha,Ml as Hb,Bx as I,Xa as Ia,En as Ib,Ox as J,Nm as Ja,Ll as Jb,zx as K,AI as Ka,kl as Kb,Gx as L,li as La,Vl as Lb,tn as M,YV as Ma,Bl as Mb,La as N,Gm as Na,oe as Nb,Ev as O,mB as Oa,Nl as Ob,hy as P,UI as Pa,Wl as Pb,wy as Q,YI as Qa,Fl as Qb,zg as R,ZI as Ra,Ol as Rb,Gg as S,pu as Sa,Rl as Sb,Yg as T,ob as Ta,Dn as Tb,ng as U,Tu as Ua,OT as Ub,aw as V,xb as Va,Hl as Vb,cw as W,yb as Wa,_l as Wb,He as X,bb as Xa,zl as Xb,xw as Y,wb as Ya,hC as Yb,At as Z,vu as Za,Ei as Zb,bw as _,Vb as _a,Di as _b,y as a,Dw as aa,Wb as ab,Ri as ac,id as b,kw as ba,Fb as bb,_T as bc,jo as c,Ow as ca,Uu as cb,Ul as cc,et as d,se as da,Gu as db,$l as dc,tA as e,Me as ea,ef as eb,Gl as ec,ad as f,qw as fa,sf as fb,IC as fc,oA as g,ri as ga,Jb as gb,zT as gc,ld as h,Ey as ha,rT as hb,UT as hc,sd as i,ky as ia,sT as ib,$T as ic,V as j,Wy as ja,Sf as jb,Yl as jc,pd as k,_y as ka,Mf as kb,Mi as kc,cd as l,NE as la,xT as lb,Li as lc,wr as m,jy as ma,k6 as mb,Lo as mc,ye as n,Zy as na,L as nb,Ql as nc,Ce as o,oh as oa,we as ob,ts as oc,_ as p,LD as pa,wi as pb,os as pc,Ar as q,FD as qa,VT as qb,ns as qc,tt as r,$D as ra,Pl as rb,as as rc,Zo as s,ZD as sa,BT as sb,ls as sc,ud as t,nR as ta,NT as tb,kn as tc,mx as u,Sh as ua,WT as ub,zC as uc,Cx as v,Ph as va,Ai as vb,QC as vc,hx as w,lm as wa,Vt as wb,Tx as x,pm as xa,Ae as xb,kr as y,zh as ya,gC as yb,xd as z,$h as za,Pn as zb};
|