@tap-payments/os-micro-frontend-shared 0.3.249 → 0.3.250
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-KSAZVDEF.js → chunk-2UKFRII4.js} +1 -1
- package/build/_chunks/{chunk-X6O4QUU6.js → chunk-365ELBRX.js} +1 -1
- package/build/_chunks/{chunk-VQLE7B6K.js → chunk-3SHK7LE5.js} +1 -1
- package/build/_chunks/{chunk-4WS2RSPW.js → chunk-4O2NNPPJ.js} +1 -1
- package/build/_chunks/{chunk-BXPQX7XO.js → chunk-4SP6Q3EY.js} +1 -1
- package/build/_chunks/{chunk-HEJOQ5F2.js → chunk-4WABGY2R.js} +1 -1
- package/build/_chunks/{chunk-YOWLYSO6.js → chunk-5GICLCXP.js} +1 -1
- package/build/_chunks/{chunk-KJJAGDWM.js → chunk-5HWKHF3E.js} +1 -1
- package/build/_chunks/{chunk-HXMJAUVM.js → chunk-5NLHGOQM.js} +1 -1
- package/build/_chunks/{chunk-UH7G7IJ7.js → chunk-6PBMGBFD.js} +1 -1
- package/build/_chunks/{chunk-DUHYMZJZ.js → chunk-72CWL2S7.js} +1 -1
- package/build/_chunks/{chunk-LEH5TUM2.js → chunk-76GYXT6V.js} +1 -1
- package/build/_chunks/{chunk-YUC5API7.js → chunk-BZJYOLJX.js} +1 -1
- package/build/_chunks/{chunk-GOVVNUKL.js → chunk-DXJQKSYR.js} +1 -1
- package/build/_chunks/{chunk-2HHIEYCG.js → chunk-DY3GC5DB.js} +1 -1
- package/build/_chunks/{chunk-PV43UQCS.js → chunk-EYUPIADW.js} +1 -1
- package/build/_chunks/{chunk-O5SBX6M7.js → chunk-FCIYZFCI.js} +1 -1
- package/build/_chunks/{chunk-2GJT5QVZ.js → chunk-HUDWUAD5.js} +1 -1
- package/build/_chunks/chunk-IXCCTAHR.js +1 -0
- package/build/_chunks/{chunk-EUCHXRXC.js → chunk-JY337SQD.js} +1 -1
- package/build/_chunks/{chunk-BIQTI6JJ.js → chunk-LQEFOWM7.js} +1 -1
- package/build/_chunks/{chunk-2HCPNFPQ.js → chunk-MBNU6SUO.js} +1 -1
- package/build/_chunks/{chunk-EXI4Y2Y5.js → chunk-MFMOVQ5M.js} +1 -1
- package/build/_chunks/{chunk-ERHRNP6H.js → chunk-MWBCSFTX.js} +1 -1
- package/build/_chunks/chunk-N76O4JDU.js +2 -0
- package/build/_chunks/{chunk-VEXVOKPI.js → chunk-NCBWDLV3.js} +1 -1
- package/build/_chunks/{chunk-4OONPLWA.js → chunk-NIVBAGVE.js} +1 -1
- package/build/_chunks/{chunk-BD36PEVC.js → chunk-NND2ZEYZ.js} +1 -1
- package/build/_chunks/{chunk-VZ5K33LE.js → chunk-ON2WVW4D.js} +1 -1
- package/build/_chunks/{chunk-RK3GAU5X.js → chunk-PDI7HVTD.js} +1 -1
- package/build/_chunks/{chunk-KO3BVB4W.js → chunk-PFDLGYL7.js} +1 -1
- package/build/_chunks/{chunk-UHGQYCUB.js → chunk-POTSD7PO.js} +1 -1
- package/build/_chunks/{chunk-I4N2AWN5.js → chunk-QFCGWCIC.js} +1 -1
- package/build/_chunks/{chunk-5DY5UOW2.js → chunk-QQGPNDCP.js} +1 -1
- package/build/_chunks/{chunk-RTK4QR4G.js → chunk-R23AMJCY.js} +1 -1
- package/build/_chunks/{chunk-4DRTPDP7.js → chunk-R7DN4AIN.js} +1 -1
- package/build/_chunks/{chunk-2VP6FILO.js → chunk-RCJQ4Y5F.js} +1 -1
- package/build/_chunks/{chunk-ID75VCUL.js → chunk-SPXAF7BU.js} +1 -1
- package/build/_chunks/{chunk-BVAQINR2.js → chunk-SQ575ZJ2.js} +1 -1
- package/build/_chunks/{chunk-M5I74B6Z.js → chunk-SYMF32J5.js} +1 -1
- package/build/_chunks/{chunk-EY3T6PVU.js → chunk-TAUOSNEX.js} +1 -1
- package/build/_chunks/{chunk-CFO3E745.js → chunk-TEC76BRB.js} +1 -1
- package/build/_chunks/{chunk-TUG3AYD7.js → chunk-TI5WSFQU.js} +1 -1
- package/build/_chunks/{chunk-NZRCTCSH.js → chunk-TKU2TNIN.js} +1 -1
- package/build/_chunks/{chunk-EMQWG4P7.js → chunk-V7XTFGZX.js} +1 -1
- package/build/_chunks/{chunk-YNCSZIKX.js → chunk-VFR37ZIO.js} +1 -1
- package/build/_chunks/{chunk-D6BYT4WG.js → chunk-VWIVGP4W.js} +1 -1
- package/build/_chunks/{chunk-7GWZH4A7.js → chunk-WMGELW2U.js} +1 -1
- package/build/_chunks/{chunk-JH7B3B3N.js → chunk-WWYUHMAI.js} +1 -1
- package/build/_chunks/{chunk-3FAZ4GJE.js → chunk-XRLART6Z.js} +1 -1
- package/build/_chunks/{chunk-4DYUPR5F.js → chunk-YPUHUMOP.js} +1 -1
- package/build/_chunks/{chunk-TVTQNIXQ.js → chunk-YRXXFAEV.js} +1 -1
- package/build/_chunks/{chunk-NVIIQM6C.js → chunk-YU4P4WBT.js} +1 -1
- package/build/_chunks/{chunk-J7SKD7ID.js → chunk-ZDE3HHHG.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/AvatarStack/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/Card/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CurrenciesMenu/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/FileDropbox/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FormSelect/index.js +1 -1
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/Logo/index.js +1 -1
- package/build/components/MultiSelect/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/NestedMultiSelect/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/Sidebar/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TextInput/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/datetime/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-MMZCR7IA.js +0 -1
- package/build/_chunks/chunk-WA5NL4IB.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {P as P$1,O}from'./chunk-
|
|
1
|
+
import {P as P$1,O}from'./chunk-N76O4JDU.js';import {nc}from'./chunk-NTNU6XF2.js';import'./chunk-CZLLJ6SR.js';import {forwardRef,useMemo,useState,memo}from'react';import {styled,alpha,useTheme}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var a="os-shared-Sidebar",e={root:`${a}-root`,header:`${a}-header`,content:`${a}-content`,footer:`${a}-footer`,link:`${a}-link`,group:`${a}-group`,groupSummary:`${a}-groupSummary`,groupSummaryActive:`${a}-groupSummaryActive`,groupSummaryExpanded:`${a}-groupSummaryExpanded`,groupHeader:`${a}-groupHeader`,groupContent:`${a}-groupContent`,groupItem:`${a}-groupItem`,startAdornment:`${a}-startAdornment`,endAdornment:`${a}-endAdornment`};var G=r=>{let{palette:n}=useTheme();return jsx("svg",{width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:jsx("path",{d:"M9.97437 5.23633C10.0426 5.23465 10.1087 5.25507 10.1648 5.29395C10.2207 5.33278 10.264 5.3876 10.2888 5.45117C10.3136 5.51487 10.3195 5.5852 10.3064 5.65234C10.2934 5.71873 10.2614 5.77954 10.2146 5.82813L7.23608 9.01172C7.17462 9.07723 7.08968 9.11518 6.99976 9.11523C6.90985 9.11523 6.82492 9.07717 6.76343 9.01172L3.78394 5.8291L3.78491 5.82812C3.73877 5.77985 3.70612 5.71999 3.69312 5.6543C3.68007 5.58802 3.68575 5.51818 3.70972 5.45508C3.7337 5.39201 3.77618 5.33717 3.83081 5.29785C3.88553 5.25857 3.95095 5.23732 4.01831 5.2373C4.0635 5.23736 4.10797 5.24702 4.14917 5.26562C4.18997 5.28407 4.2263 5.31071 4.25659 5.34375L6.99878 8.27246L9.74194 5.34375C9.80179 5.27779 9.88521 5.23858 9.97437 5.23633Z",fill:n.text.textSecondary,stroke:n.text.textSecondary,strokeWidth:"0.204167"})})};var E="linear-gradient(270deg, #147DC5 0.67%, #3DA6E1 98.91%)",H=styled("div")(({theme:r})=>{let{base:n}=r.v2.palette;return {backgroundColor:alpha(n.white,.7),backdropFilter:r.v2.blur[16],width:183,position:"sticky",padding:`${r.v2.spacing(16)} ${r.v2.spacing(8)}`,height:"100%",overflow:"hidden",display:"flex",flexDirection:"column"}}),L=styled("div")({flexShrink:0}),R=styled("div")(({theme:r})=>({display:"flex",flexDirection:"column",gap:r.v2.spacing(4),flex:1,minHeight:0,overflow:"auto"})),P=styled("div")({flexShrink:0}),C={border:"none",width:"100%",textAlign:"left",font:"inherit",cursor:"pointer"},f=styled("span")({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0}),x=styled("span")({display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginLeft:"auto"}),D=styled("button",{shouldForwardProp:r=>r!=="$isActive"})(({theme:r,$isActive:n=false})=>{let{base:o,foreground:d}=r.v2.palette;return {...C,...r.v2.typography.textVariants.body.small.regular,background:n?E:"transparent",borderRadius:r.v2.radius(4),padding:`${r.v2.spacing(4)} ${r.v2.spacing(8)}`,color:n?o.white:d.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:r.v2.spacing(4)}}),F=styled(P$1)(({theme:r})=>({"&&":{background:"transparent",boxShadow:"none"},border:"none !important",borderRadius:"4px !important",[`& .${O.summary}`]:{padding:0,paddingRight:8,minHeight:"24px",height:"24px","&.Mui-expanded":{minHeight:"24px",height:"24px"},borderRadius:"4px !important",background:"transparent",transition:"none"},[`& .${O.summary}.${e.groupSummaryActive}`]:{backgroundColor:r.v2.palette.base.white},[`& .${O.summary}.${e.groupSummaryExpanded}`]:{backgroundColor:r.v2.palette.base.white},[`& .${O.content}`]:{borderTop:"none",padding:0},[`& .${O.labelContent}`]:{flexGrow:1,minWidth:0}})),V=styled("span",{shouldForwardProp:r=>r!=="$isActive"})(({theme:r,$isActive:n=false})=>{let{base:o,foreground:d}=r.v2.palette;return {...C,...r.v2.typography.textVariants.body.small.regular,background:n?o.white:"transparent",borderRadius:r.v2.radius(4),padding:`${r.v2.spacing(4)} ${r.v2.spacing(8)}`,color:d.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:r.v2.spacing(4),width:"100%",cursor:"pointer"}}),T=styled("div")(({theme:r})=>({display:"flex",flexDirection:"column",gap:r.v2.spacing(4),paddingTop:r.v2.spacing(4)})),j=styled("button",{shouldForwardProp:r=>r!=="$isActive"})(({theme:r,$isActive:n=false})=>{let{base:o,foreground:d}=r.v2.palette;return {...C,...r.v2.typography.textVariants.body.small.regular,background:n?E:"transparent",borderRadius:r.v2.radius(4),padding:`${r.v2.spacing(4)} ${r.v2.spacing(8)}`,color:n?o.white:d.primary,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:r.v2.spacing(4)}});var $=r=>!!r.sections?.length;function M(r,n){let o=n??r?.[0]?.sections?.[0]?.id??r?.[0]?.id,d=r?.find(c=>c.id===o),u=!d||!$(d),l=u?r?.find(c=>c.sections?.some(y=>y.id===o)):d,g=l?.id??d?.id??o,b=l?u?o:l.sections?.[0]?.id:void 0;return {activeId:o,activeGroupId:g,activeLeafId:b}}var B=forwardRef(({sections:r,activeSectionId:n,onSelect:o,defaultExpandedIds:d,header:u,footer:l,id:g,className:b,sx:c},y)=>{let{activeId:h,activeGroupId:A,activeLeafId:k}=useMemo(()=>M(r,n),[r,n]),[W,O]=useState(()=>Object.fromEntries((d??[]).map(t=>[t,true])));return jsxs(H,{ref:y,id:g,"data-testid":g??"Sidebar",className:nc(e.root,b),sx:c,children:[u?jsx(L,{className:e.header,children:u}):null,jsx(R,{className:e.content,children:r?.map(t=>{if(!$(t))return jsxs(D,{type:"button",$isActive:h===t.id,"aria-current":h===t.id?"true":void 0,onClick:()=>o?.(t,void 0,[t]),className:e.link,children:[t.startAdornment?jsx(f,{className:e.startAdornment,children:t.startAdornment}):null,t.title,t.endAdornment?jsx(x,{className:e.endAdornment,children:t.endAdornment}):null]},t.id);let I=W[t.id]??t.id===A;return jsx(F,{className:e.group,expanded:I,onChange:i=>O(_=>({..._,[t.id]:i})),expandIcon:jsx(G,{}),slotProps:{root:{component:"section"},summary:{className:nc(e.groupSummary,A===t.id&&e.groupSummaryActive,I&&e.groupSummaryExpanded)}},label:jsxs(V,{$isActive:A===t.id,className:e.groupHeader,children:[t.startAdornment?jsx(f,{className:e.startAdornment,children:t.startAdornment}):null,t.title,t.endAdornment?jsx(x,{className:e.endAdornment,children:t.endAdornment}):null]}),content:jsx(T,{className:e.groupContent,children:t.sections?.map(i=>jsxs(j,{type:"button",$isActive:k===i.id,"aria-current":k===i.id?"true":void 0,onClick:()=>o?.(i,t,[t,i]),className:e.groupItem,children:[i.startAdornment?jsx(f,{className:e.startAdornment,children:i.startAdornment}):null,i.title,i.endAdornment?jsx(x,{className:e.endAdornment,children:i.endAdornment}):null]},`${t.id}-${i.id}`))})},t.id)})}),l?jsx(P,{className:e.footer,children:l}):null]})});B.displayName="Sidebar";var X=memo(B);
|
|
2
2
|
export{e as a,X as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,P as P$1,O,V as V$1,R as R$1,d}from'./chunk-
|
|
1
|
+
import {j,P as P$1,O,V as V$1,R as R$1,d}from'./chunk-N76O4JDU.js';import {nc,mc}from'./chunk-NTNU6XF2.js';import {Qc}from'./chunk-CZLLJ6SR.js';import {forwardRef,useRef,useState,memo}from'react';import Te from'@mui/material/ClickAwayListener';import Le from'@mui/material/CircularProgress';import Ce from'@mui/material/SvgIcon';import {jsx,jsxs}from'react/jsx-runtime';import m from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';var i="os-shared-GroupedSelect",r={root:`${i}-root`,trigger:`${i}-trigger`,hasLabel:`${i}-hasLabel`,triggerIcon:`${i}-triggerIcon`,menu:`${i}-menu`,groups:`${i}-groups`,group:`${i}-group`,groupLabel:`${i}-groupLabel`,option:`${i}-option`,optionCheck:`${i}-optionCheck`};function P({open:e}){return jsx(Ce,{viewBox:"0 0 8 5",sx:{width:8,height:5,transform:e?"rotate(180deg)":"none",transition:"transform 0.2s ease"},children:jsx("path",{d:"M7.30273 0.117188C7.3806 0.115307 7.4565 0.138248 7.52051 0.182617C7.58455 0.227088 7.63373 0.290458 7.66211 0.363281C7.69046 0.436073 7.69761 0.516047 7.68262 0.592773C7.66777 0.668745 7.63069 0.738375 7.57715 0.793945L4.17285 4.43164C4.10255 4.50662 4.00523 4.55078 3.90234 4.55078C3.79964 4.55064 3.703 4.5065 3.63281 4.43164L0.227539 0.794922L0.228516 0.793945C0.175799 0.738766 0.139848 0.669812 0.125 0.594727C0.11011 0.519097 0.116275 0.440194 0.143555 0.368164C0.170957 0.296002 0.218752 0.232474 0.28125 0.1875C0.343758 0.14262 0.418162 0.11821 0.495117 0.118164C0.546901 0.118166 0.598306 0.12907 0.645508 0.150391C0.691832 0.171346 0.733094 0.201824 0.767578 0.239258L3.90234 3.58691L7.03711 0.239258C7.10547 0.164191 7.20108 0.119752 7.30273 0.117188Z",fill:"#20232B",stroke:"#20232B",strokeWidth:.233333})})}var W=styled(m,{shouldForwardProp:e=>e!=="open"&&e!=="disabled"})(({disabled:e})=>({display:"flex",alignItems:"center",cursor:e?"not-allowed":"pointer",position:"relative",maxWidth:"100%"})),A=styled(m,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:t})=>({flex:1,minWidth:0,height:32,maxHeight:32,borderRadius:"4px",overflow:"hidden",backgroundColor:e.palette.grey[400],cursor:t?"default":"pointer",position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",padding:"0 28px 0 8px",[`&:where(.${r.hasLabel})`]:{height:40,maxHeight:40,justifyContent:"flex-end"}})),R=styled(j,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t})=>({fontSize:"10px",fontWeight:500,lineHeight:"10px",color:t?e.palette.text.disabled:e.palette.grey[700],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingTop:8})),B=styled(m,{shouldForwardProp:e=>e!=="$placeholder"&&e!=="$disabled"})(({theme:e,$placeholder:t,$disabled:S})=>({fontSize:"11px",lineHeight:"11px",color:S?e.palette.text.disabled:t?e.palette.text.secondary:"#000",height:22,display:"flex",alignItems:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})),D=styled(m,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t})=>({position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",opacity:t?e.palette.action.disabledOpacity:1})),F=styled(m)(()=>({display:"flex",flexDirection:"column",maxHeight:180,overflow:"auto",scrollbarWidth:"thin",scrollbarColor:"#E5E5E5 #E5E5E5"})),z=styled(P$1)(({theme:e})=>{let t=`1px solid ${alpha(e.palette.common.black,.1)}`;return {flexShrink:0,border:0,borderRadius:0,"&.Mui-expanded:not(:last-of-type)":{borderBottom:t},[`&:last-of-type .${O.summary}`]:{borderBottom:"none"},[`&.Mui-expanded:last-of-type .${O.summary}`]:{borderBottom:t},[`& .${O.summary}`]:{backgroundColor:e.palette.common.white,borderBottom:t,minHeight:28,height:"auto","& .MuiAccordionSummary-content":{margin:"auto"},"&.Mui-expanded":{backgroundColor:"#F8F8F8",minHeight:28,height:"auto"}},[`& .${O.content}`]:{borderTop:"none"}}}),K=styled(j)(({theme:e})=>({fontSize:"10px",color:e.v2.palette.grey[500],fontWeight:600,lineHeight:"10px"})),V=styled(V$1)(()=>({fontSize:"10px",fontWeight:500,textTransform:"none",justifyContent:"space-between",padding:"8px 20px"}));function Ee(e,t){return e?.id===t?.id}var Y=forwardRef(({id:e,label:t,placeholder:S,renderValue:Z,IconComponent:J,isLoading:Q=false,options:U,value:f,onChange:X,isOptionEqualToValue:_=Ee,renderOption:ee,renderGroupLabel:oe,open:te,onOpenChange:re,expandedGroupIndex:b,defaultExpandedGroupIndex:le=0,onExpandedGroupChange:ne,disabled:p=false,sx:ae,menuSx:ie,className:de},se)=>{let C=useRef(null),[G,pe]=useState(null),[ce,ue]=useState(le),s=te??G!==null,c=G??C.current,me=b??ce,w=useRef(void 0);s&&c&&c.clientWidth>0&&(w.current=c.clientWidth);let ge=w.current,h=(o,l)=>{pe(l),re?.(o);},Se=o=>{if(p)return;let l=!s;h(l,l?o.currentTarget:null);},$=()=>{s&&h(false,null);},fe=o=>{o.key==="Escape"&&$();},he=(o,l)=>{let a=l?o:null;b===void 0&&ue(a),ne?.(a);},ye=o=>{o.disabled||(X?.(o),h(false,null));},T=Z?.(f)??f?.label??null,L=J,E=!!t;return jsx(Te,{onClickAway:$,children:jsxs(W,{ref:se,id:e,"data-testid":"GroupedSelect",className:nc(r.root,de),sx:ae,open:s,disabled:p,onClick:Se,onKeyDown:fe,children:[jsxs(A,{ref:C,className:nc(r.trigger,E&&r.hasLabel),disabled:p,children:[E&&jsx(R,{$disabled:p,children:t}),jsx(B,{$placeholder:T==null,$disabled:p,children:T??S??""}),jsx(D,{className:r.triggerIcon,$disabled:p,children:Q?jsx(Le,{size:14,sx:{color:"text.secondary"}}):L?jsx(L,{className:nc(s&&"MuiSelect-iconOpen")}):jsx(P,{open:s})})]}),jsx(R$1,{open:s,anchorEl:c,placement:"bottom-start",className:r.menu,sx:mc({width:ge??c?.clientWidth,marginTop:"4px"},ie),children:jsx(F,{className:r.groups,onClick:o=>o.stopPropagation(),onMouseDown:o=>o.stopPropagation(),children:(U??[]).map((o,l)=>jsx(z,{className:r.group,expanded:me===l,onChange:a=>he(l,a),slotProps:{root:{square:true}},label:oe?.(o.group,l)??jsx(K,{variant:"caption",className:r.groupLabel,children:o.group}),content:(o?.options||[]).map((a,xe)=>{let be=_(a,f);return jsxs(V,{className:r.option,startAdornment:null,isDisabled:a.disabled,onClick:()=>ye(a),children:[ee?.(a)??a.label,be&&jsx(d,{src:Qc,alt:"selected",sx:{width:14,height:10},className:r.optionCheck})]},`${l}-${xe}`)})},`${l}`))})})]})})});Y.displayName="GroupedSelect";var ke=memo(Y);export{r as a,ke as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {T,S as S$1,b as b$1}from'./chunk-
|
|
1
|
+
import {T,S as S$1,b as b$1}from'./chunk-N76O4JDU.js';import {forwardRef,memo,createContext,useState,useRef,useCallback,useMemo,useContext}from'react';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=styled(T)(({theme:o})=>({[`& .${S$1.title}`]:{fontSize:"13px",fontWeight:700,lineHeight:o.typography.h6.lineHeight,borderBottom:`1px solid ${o.palette.divider}`,margin:0,padding:"16px 16px 16px 12px",color:o.palette.text.primary}})),y=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),p=styled(b$1)(({theme:o})=>({paddingInline:o.spacing(3),paddingBlock:o.spacing(1),borderRadius:o.spacing(.5),minWidth:64,fontSize:"11px",fontWeight:o.typography.fontWeightMedium,color:o.palette.text.primary,textTransform:"none",border:`1px solid ${o.palette.divider}`,boxShadow:"none","&:hover":{boxShadow:"none",backgroundColor:o.palette.action.hover}})),D=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),S=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var b=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},d)=>jsx(x,{ref:d,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(y,{children:[jsx(D,{children:o}),jsxs(S,{children:[jsx(p,{variant:"ghost",onClick:s,children:i||"No"}),jsx(p,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));b.displayName="ConfirmDialog";var h=memo(b);var g=createContext(null);function M(){let o=useContext(g);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var H={open:false,message:null,title:void 0,confirmText:void 0,cancelText:void 0,sx:void 0,dismissible:true};function z({children:o}){let[t,a]=useState(H),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(d=>({...d,open:false})),n(e));},[]),s=useCallback(e=>new Promise(n=>{i.current?.(false),i.current=n,a({open:true,dismissible:e.dismissible??true,message:e.message,title:e.title,confirmText:e.confirmText,cancelText:e.cancelText,sx:e.sx});}),[]),m=useMemo(()=>({confirm:s}),[s]);return jsxs(g.Provider,{value:m,children:[o,jsx(h,{open:t.open,message:t.message,title:t.title,confirmText:t.confirmText,cancelText:t.cancelText,onConfirm:()=>r(true),onCancel:()=>r(false),onClose:t.dismissible?()=>r(false):void 0,sx:t.sx})]})}var O=memo(z);export{M as a,O as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-N76O4JDU.js';import {Ud,Qi,Ri,Si,Ti,Ui}from'./chunk-CZLLJ6SR.js';import {memo}from'react';import i from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=styled(i)(({theme:o})=>({display:"flex",gap:o.spacing(1),insetInlineStart:o.spacing(1.25),zIndex:1}));styled(i)(({theme:o})=>({width:12,height:12,borderRadius:"50%",cursor:"pointer",backgroundColor:`${o.palette.grey[200]}14`,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease-in-out",img:{opacity:"0",transition:"all 0.2s ease-in-out"},"&:active":{backgroundColor:`${o.palette.grey[200]} !important`}}));var b=styled(i)(({theme:o})=>({display:"flex",height:"2rem",justifyContent:"space-between",alignItems:"center",width:"100%",paddingLeft:o.spacing(1.25),paddingRight:o.spacing(1.25),"& > *":{flex:"1 1 0px;"}})),y=styled("div",{shouldForwardProp:o=>o!=="sandboxMode"&&o!=="maximized"&&o!=="isDragging"})(({maximized:o,isDragging:t})=>({...!o&&{borderTopRightRadius:12,borderTopLeftRadius:12},...t&&{cursor:"move"},margin:0})),$=styled(i,{shouldForwardProp:o=>o!=="maximized"&&o!=="isDragging"})(({isDragging:o})=>({...o&&{cursor:"move"},position:"relative",zIndex:1,margin:0})),f=styled(i,{shouldForwardProp:o=>o!=="maximized"&&o!=="isHovered"})(({theme:o,maximized:t})=>({height:32,position:"relative",display:"flex",width:"100%",justifyContent:"center",transition:"all 0.5s ease-in-out",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",...t&&{display:"block !important",position:"fixed",right:0,left:0,zIndex:999,background:"transparent",".toolbar-wrapper":{display:"flex",justifyContent:"space-between",gap:10,alignItems:"center",position:"absolute",right:0,left:0,height:"2rem",".action-box":{visibility:"hidden"}},"&:hover":{".toolbar-wrapper":{top:0},".action-box":{visibility:"visible"}}},":hover":{".header-icon":{backgroundColor:`${o.palette.grey[200]}40`},".header-icon img":{opacity:1}}})),W=styled(y)(()=>({position:"sticky",top:0,left:0,right:0,zIndex:1e3,background:"#eaeaea",backdropFilter:"blur(32px)"})),u=styled(j)(({theme:o})=>({fontSize:"10px",color:"rgba(32, 35, 43, 0.5)",opacity:.7,textAlign:"left",fontWeight:o.v2.typography.fontWeightBold,lineHeight:"14px",userSelect:"none",paddingLeft:"0.175rem",textTransform:"capitalize"})),h=styled("div")(()=>({display:"flex",justifyContent:"center",alignItems:"center",position:"relative",textAlign:"center"})),I=styled("img")(()=>({width:14,height:14,verticalAlign:"center"}));var w=new Map([["json",Ud],["brand",Qi],["entity",Ri],["bank",Si],["individual",Ti],["password",Ui]]);function C({title:o,icon:t}){let a=w.get(t||"")??(w.get(o?.toLowerCase())||t);return jsxs(h,{className:"action-box","data-testid":"ToolbarAppIcon",children:[a&&jsx(I,{src:a,alt:"icon"}),jsx(u,{className:"title",children:o})]})}var S=C;function L({onMouseEnter:o,onMouseLeave:t,isMaximized:a,isHovered:z,rightActions:k,leftActions:n,title:A,icon:B,...H}){return jsx(f,{onMouseEnter:o,onMouseLeave:t,maximized:a,id:"toolbar","data-testid":"Toolbar",isHovered:z,...H,children:jsxs(b,{className:"toolbar-wrapper",children:[n?jsx(x,{className:"action-box",children:n}):jsx("div",{}),jsx(S,{title:A,icon:B}),k||jsx("div",{})]})})}var T=memo(L);var Z=T;export{y as a,$ as b,W as c,Z as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-WMGELW2U.js';import {Bc}from'./chunk-NTNU6XF2.js';import {vi}from'./chunk-CZLLJ6SR.js';import {memo,useId,useState,useRef,useEffect}from'react';import {useTheme}from'@mui/material';import {motion,AnimatePresence}from'framer-motion';import {useTranslation}from'react-i18next';import K from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var h=styled(motion.input)(({theme:t})=>({padding:"8px",paddingRight:"24px",borderRadius:"4px",height:32,color:t.palette.text.primary,fontSize:"11px",outline:0,zIndex:10,background:t.palette.common.white,display:"flex",minWidth:0,flexGrow:1,boxShadow:`0px 0px 4px 0px ${t.palette.info.dark}80`,border:`1px solid ${t.palette.info.dark}`,"::placeholder":{color:"#D5D5D5"}})),x=styled(motion.img)(()=>({position:"absolute",zIndex:11,cursor:"pointer"})),I=styled(b)(()=>({minWidth:"auto",borderRadius:"4px",paddingInline:"8px",position:"relative",zIndex:11})),g=styled(K)(()=>({display:"flex",alignItems:"center",justifyContent:"flex-start",position:"relative",zIndex:3,height:32,gap:8}));function j({onSearchChange:t,placeholder:v,...b}){let w=Bc(useId(),"search-button"),[e,p]=useState(false),[C,i]=useState(false),[r,l]=useState(""),c=useRef(null);useEffect(()=>{e&&c.current?.focus();},[e]);let{t:B}=useTranslation(),E=useTheme(),T=()=>{i(true),p(false),t?.(""),l("");},k=()=>{i(false),p(true),P();},P=()=>{r&&t?.(r);},R=a=>{a.key==="Enter"&&t?.(r);},z=a=>{l(a.currentTarget.value);},D={duration:.18,ease:"easeInOut"},W={duration:.05,ease:"easeIn"},A=e||C;return jsxs(g,{id:w,"data-testid":"SearchButton",children:[jsx(AnimatePresence,{initial:false,onExitComplete:()=>i(false),children:e&&jsxs(Fragment,{children:[jsx(h,{ref:c,initial:{width:30},animate:{width:200},exit:{width:30,border:`1px solid ${E.palette.divider}`,boxShadow:"none"},transition:D,style:{willChange:"width"},placeholder:v??(B("search")||""),onKeyDown:R,onChange:z}),jsx(x,{style:{right:48},initial:{opacity:1},exit:{opacity:0},transition:W,src:vi,alt:"close",onClick:T})]})}),jsx(I,{...b,variant:A?"active":"inActive",icon:"search",onClick:k})]})}var y=memo(j);var pt=y;export{pt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {V,R}from'./chunk-
|
|
1
|
+
import {V,R}from'./chunk-N76O4JDU.js';import {Bc}from'./chunk-NTNU6XF2.js';import {wb}from'./chunk-CZLLJ6SR.js';import {useId,useState,useRef,useMemo}from'react';import T from'@mui/material/Box';import {ClickAwayListener}from'@mui/material';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var h=styled("span")(()=>({fontSize:"11px"})),I=styled(V)(()=>({display:"flex",alignItems:"center",paddingInline:"16px",gap:"4px",borderBlock:"1px solid #F2F2F2",fontSize:"11px","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}})),M=styled(V)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:"#F4F4F4",fontWeight:600,paddingInline:"16px",fontSize:"11px",gap:"4px"})),k=styled(V)(()=>({gap:"2px",paddingInline:"16px",fontSize:"11px","&:hover":{backgroundColor:"#fff",boxShadow:"0px 0px 16px 0px #00000021"}})),A=styled("img")({marginLeft:"auto",width:16,height:12}),b=styled("img")({borderRadius:"2px",width:16,height:12,flexShrink:0}),w={marginTop:"8px",marginBottom:"8px",maxHeight:"190px",overflow:"auto"},P={zIndex:99999};function s({onCountriesChange:e,sx:L,selectedCountries:r,countriesOptions:i}){let B=Bc(useId(),"country-filter"),[a,g]=useState(null),f=useRef(null),y=!!a,E=()=>{if(!y){g(f.current);return}d();},d=()=>{g(null);},z=t=>r?.includes(t)??false,u=t=>{e(t);},H=t=>{let o=r?.includes(t)?r?.filter(m=>m!==t):[...r??[],t];u(o),e(o);},x=useMemo(()=>r?.length===i.length,[r,i]);return jsx(ClickAwayListener,{onClickAway:d,children:jsxs(T,{ref:f,sx:L,id:B,"data-testid":"CountryFilter",children:[jsx(T,{children:jsxs(I,{onMouseEnter:t=>{t.stopPropagation(),E();},startAdornment:null,children:[jsx(h,{children:"Country"}),jsx(A,{src:wb,alt:""})]})}),jsxs(R,{open:y,anchorEl:a,sx:w,placement:"right-start",popperSx:P,children:[jsx(M,{onClick:t=>{t.stopPropagation(),x?(u([]),e([])):(u(i.map(({value:o})=>o)),e(i.map(({value:o})=>o)));},isSelected:x,children:x?"Unselect All":"Select All"}),i.map(({value:t,label:o,icon:m})=>jsxs(k,{isSelected:z(t),onClick:()=>H(t),children:[jsx(b,{src:m,alt:""}),o]},t))]})]})})}var tt=s;export{s as a,tt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,d,b,c,j as j$1,e}from'./chunk-
|
|
1
|
+
import {a,d,b,c,j as j$1,e}from'./chunk-RCJQ4Y5F.js';import {Bc}from'./chunk-NTNU6XF2.js';import {ec,fc}from'./chunk-CZLLJ6SR.js';import {memo,useId,useState}from'react';import ee from'@mui/material/ClickAwayListener';import te from'@mui/material/Popper';import {useTranslation}from'react-i18next';import {DateObject,Calendar}from'react-multi-date-picker';import i from'@mui/material/Box';import l from'@mui/material/Button';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var O=styled(l)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}})),z=styled(i)(()=>({position:"relative"})),H=styled(i,{shouldForwardProp:t=>t!=="open"})(({open:t,theme:e})=>({display:t?"flex":"none",flexDirection:"column",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),top:37,color:e.palette.text.primary,fontSize:"11px",margin:"8px 0",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none"},".rmdp-day span":{fontSize:"11px",fontWeight:500},".rmdp-day, .rmdp-week-day":{width:40,height:40,marginBottom:"2px",padding:"4px",fontSize:"11px",color:e.palette.grey[900]},".rmdp-day-picker":{padding:0},".rmdp-day.rmdp-today span":{backgroundColor:"transparent !important",color:e.palette.info.dark},".rmdp-day.rmdp-today.end span, .rmdp-day.rmdp-today.end span":{color:e.palette.common.white},".rmdp-range, .rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover":{background:e.palette.info.light,boxShadow:"none",color:e.palette.grey[900]},".rmdp-range-hover.start, .rmdp-range.start, .rmdp-range-hover.end, .rmdp-range.end, .rmdp-rtl .rmdp-range-hover.start, .rmdp-rtl .rmdp-range.start, .rmdp-rtl .rmdp-range-hover.end, .rmdp-rtl .rmdp-range.end":{borderRadius:"50%",background:e.palette.background.gradient.darkShadedBlue,color:e.palette.common.white},".rmdp-range.start:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",right:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.start:after":{right:"unset",left:0},".rmdp-range.end:after":{content:'""',position:"absolute",background:e.palette.info.light,height:"100%",width:"50%",left:0,top:0,zIndex:-1},".rmdp-rtl .rmdp-range.end:after":{left:"unset",right:0},".rmdp-week-day":{color:e.palette.grey[700],marginBottom:"4px",fontSize:"11px",padding:"4px"},".rmdp-header-values":{color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px"},".rmdp-header-values span:nth-of-type(2)":{display:"none"},".rmdp-header":{padding:"4px 0",margin:0,fontSize:"12px"},".rmdp-top-class":{display:"block !important"},".rmdp-day.rmdp-selected span:not(.highlight)":{background:e.palette.info.dark},".rmdp-day.start.end":{overflow:"hidden"}})),j=styled(l,{shouldForwardProp:t=>t!=="open"})(({open:t,theme:e})=>({color:e.palette.text.primary,fontSize:"11px",fontWeight:500,padding:e.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,textTransform:"none",height:32,...t&&{border:"1px solid",borderColor:e.palette.info.dark,boxShadow:e.shadows[7]}})),A=styled(i)(({theme:t})=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8,padding:"16px",borderTop:`1px solid ${t.palette.divider}`})),E=styled(l)(({theme:t})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:t.palette.text.primary,border:"1px solid",borderColor:t.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:t.palette.text.primary}})),Y=styled(l)(({theme:t})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:t.palette.info.dark,"&:hover":{background:t.palette.info.dark}})),F=styled(i)(()=>({display:"flex",gap:"8px"}));var ne=["Su","Mo","Tu","We","Th","Fr","Sa"];function ae({isAr:t=false,value:e$1,setValue:y,enableTimePicker:p,placement:L,sx:R,...N}){let V=Bc(useId(),"calender"),[w,k]=useState(null),[C,$]=useState(e$1?new DateObject(new Date(e$1.toLocaleString())):new DateObject(new Date)),[D,g]=useState(e$1?new DateObject(new Date(e$1.toLocaleString())):new DateObject(new Date)),q=e$1?.hour?a(e$1.hour):d(),G=e$1?.hour?b(e$1.hour):b(new Date().getHours()),[a$1,J]=useState({hour:q,minute:e$1?.minute??c(),period:G}),{t:B}=useTranslation(),u=!!w,K=r=>r==="right"?t?ec:fc:t?fc:ec,Q=r=>{k(r.currentTarget);},f=()=>{k(null);},U=()=>{let r=a$1.hour;p&&(r=e(a$1.hour,a$1.period||"AM"));let d=p?D.setHour(r).setMinute(a$1.minute):D;$(d),y&&y(d),f();},X=r=>{J(r);};return jsx(ee,{onClickAway:f,children:jsxs(z,{sx:{...R},id:V,"data-testid":"Calender",children:[jsx(j,{onClick:Q,open:u,className:"date-button",children:C.format("MMM D, YYYY")}),jsx(te,{open:u,anchorEl:w,placement:L,children:jsxs(H,{className:"calender-content",open:u,children:[jsx(Calendar,{numberOfMonths:1,format:"MMM DD YYYY",monthYearSeparator:" ",renderButton:(r,d)=>jsx(O,{onClick:d,children:jsx("img",{src:K(r),alt:"arrow"})}),onMonthChange:r=>{g(r);},onYearChange:r=>{g(r);},onChange:r=>{g(r);},weekDays:t?void 0:ne,minDate:new Date,value:C,...N}),jsxs(A,{sx:{...p&&{justifyContent:"space-between"}},children:[p&&jsx(j$1,{enableRealTimeChange:true,onChange:X,defaultTime:a$1}),jsxs(F,{children:[jsx(E,{variant:"contained",onClick:f,children:B("cancel")}),jsx(Y,{variant:"contained",onClick:U,children:B("okay")})]})]})]})})]})})}var I=memo(ae);var Te=I;export{Te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,j as j$1,V,U,n,R,d as d$1}from'./chunk-
|
|
1
|
+
import {b,j as j$1,V,U,n,R,d as d$1}from'./chunk-N76O4JDU.js';import {nc}from'./chunk-NTNU6XF2.js';import {Oj,m}from'./chunk-CZLLJ6SR.js';import {memo,forwardRef,useState,useMemo,useCallback}from'react';import Fe from'@mui/material/ClickAwayListener';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Pe from'@mui/material/SvgIcon';import d from'@mui/material/Box';import {styled}from'@mui/material/styles';var c="os-shared-CurrenciesMenu",r={root:`${c}-root`,trigger:`${c}-trigger`,triggerInfo:`${c}-triggerInfo`,triggerLabel:`${c}-triggerLabel`,triggerArrow:`${c}-triggerArrow`,static:`${c}-static`,flag:`${c}-flag`,category:`${c}-category`,categoryLabel:`${c}-categoryLabel`,option:`${c}-option`,optionLabel:`${c}-optionLabel`};function $e({currency:e,className:o,sx:t}){let i=u=>{u.currentTarget.src!==Oj&&(u.currentTarget.src=Oj);};return jsx(d$1,{src:e?m(e):Oj,alt:e||"flag",onError:i,className:nc(r.flag,o),sx:t??{width:14,height:14}})}var C=memo($e);var j=e=>jsx(Pe,{viewBox:"0 0 8 5",sx:{width:8,height:5},...e,children:jsx("path",{d:"M7.30267 0.117188C7.38054 0.115307 7.45644 0.138248 7.52045 0.182617C7.58449 0.227088 7.63367 0.290458 7.66205 0.363281C7.6904 0.436073 7.69755 0.516047 7.68256 0.592773C7.66771 0.668745 7.63063 0.738375 7.57709 0.793945L4.17279 4.43164C4.10249 4.50662 4.00517 4.55078 3.90228 4.55078C3.79958 4.55064 3.70294 4.5065 3.63275 4.43164L0.227478 0.794922L0.228455 0.793945C0.175738 0.738766 0.139787 0.669812 0.124939 0.594727C0.110049 0.519097 0.116214 0.440194 0.143494 0.368164C0.170896 0.296002 0.218691 0.232474 0.281189 0.1875C0.343697 0.14262 0.418101 0.11821 0.495056 0.118164C0.54684 0.118166 0.598245 0.12907 0.645447 0.150391C0.691771 0.171346 0.733033 0.201824 0.767517 0.239258L3.90228 3.58691L7.03705 0.239258C7.10541 0.164191 7.20102 0.119752 7.30267 0.117188Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.233333"})});function Se({currency:e,selected:o,renderOption:t}){return t?jsx(Fragment,{children:t(e,{selected:o})}):jsxs(Fragment,{children:[jsx(C,{currency:e}),jsx(j$1,{sx:{fontSize:11},className:r.optionLabel,children:e})]})}var re=memo(Se);var y=styled(d)(()=>({display:"inline-block"})),S=styled(b,{shouldForwardProp:e=>e!=="$open"})(({theme:e,$open:o=false})=>{let{base:t,border:i,brand:u}=e.v2.palette;return {display:"flex",alignItems:"center",justifyContent:"space-between",height:32,border:`1px solid ${i.default}`,borderRadius:e.v2.radius(4),backgroundColor:t.white,minWidth:74,padding:e.v2.spacing(8),color:t.black,...Re(o,u[500]),"&.Mui-disabled":{opacity:.7,border:`1px solid ${i.default}`,backgroundColor:t.white,color:t.black}}});function Re(e,o){return e?{borderColor:o}:{}}var O=styled(d)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(4),minWidth:0})),M=styled(j$1)(()=>({fontSize:"11px",fontWeight:500,lineHeight:1.1})),F=styled(d,{shouldForwardProp:e=>e!=="$open"})(({$open:e=false})=>({display:"flex",alignItems:"center",flexShrink:0,transition:"transform 200ms cubic-bezier(0.4, 0, 0.2, 1)",...e&&{transform:"rotate(180deg)"}})),te=styled(d)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.v2.spacing(4),minWidth:0,padding:e.v2.spacing(8)})),oe=styled(d)(({theme:e})=>({borderBottom:`1px solid ${e.v2.palette.border.default}`,paddingBottom:e.v2.spacing(8),"&:last-child":{borderBottom:"none",paddingBottom:0}})),ne=styled(j$1)(({theme:e})=>({color:e.v2.palette.grey[500],fontSize:"10px",fontWeight:500,lineHeight:"100%",padding:e.v2.spacing(8)})),se=styled(V)({gap:"4px",borderTop:"none !important",height:24,[`& .${U.indicator}`]:{fontSize:11},"&:hover":{boxShadow:"7px 0px 8px 0px #F2F2F2"}});function Ae({currency:e,selected:o,onSelect:t,renderOption:i}){return jsx(se,{isSelected:o,startAdornment:null,onClick:()=>t(e),className:nc(r.option),children:jsx(re,{currency:e,selected:o,renderOption:i})})}var ae=memo(Ae);function z(e){if(!e)return "";for(let o of e){if(typeof o=="string")return o;let t=o.items??[];if(t.length>0)return t[0]}return ""}function le(e){if(!e||e.length===0)return [];let o=[],t=[],i=0,u=()=>{t.length>0&&(o.push({key:`flat-${i++}`,items:t}),t=[]);};for(let m of e)if(typeof m=="string")t.push(m);else {u();let l=m.items??[];if(l.length===0)continue;o.push({key:`group-${i++}`,label:m.label,items:l});}return u(),o}function ce(e){if(!e)return 0;let o=0;for(let t of e)typeof t=="string"?o+=1:o+=t.items?.length??0;return o}var pe=forwardRef(({value:e,defaultValue:o,onChange:t,options:i,isLoading:u=false,disabled:m=false,id:l,className:b,sx:x,menuPlacement:me,menuProps:ge,placeholder:h="",triggerIcon:D,renderOption:fe,renderSelected:N,...I},L)=>{let[G,V]=useState(null),[Ce,de]=useState(()=>o??z(i)),B=e!==void 0,v=B?e:Ce,$=!!G,ye=useMemo(()=>le(i),[i]),Z=useMemo(()=>ce(i),[i]),Me=useCallback(a=>{m||V(a.currentTarget);},[m]),A=useCallback(()=>{V(null);},[]),be=useCallback(a=>{B||de(a),t?.(a),A();},[B,t,A]),w=D===void 0?jsx(j,{}):D,{placement:xe,sx:P,...he}=ge??{},Ne=xe??me,Ie=useMemo(()=>[{margin:"8px 0",minWidth:74},...Array.isArray(P)?P:[P]],[P]);if(u)return jsx(y,{ref:L,id:l,"data-testid":l??"CurrenciesMenu",className:nc(r.root,b),sx:x,...I,children:jsxs(S,{variant:"secondary",disabled:true,className:nc(r.trigger),children:[jsx(O,{className:nc(r.triggerInfo),children:jsx(M,{className:nc(r.triggerLabel),children:h})}),jsx(n,{size:12})]})});if(Z===0)return jsx(y,{ref:L,id:l,"data-testid":l??"CurrenciesMenu",className:nc(r.root,b),sx:x,...I,children:jsxs(S,{variant:"secondary",disabled:true,className:nc(r.trigger),children:[jsx(O,{className:nc(r.triggerInfo),children:jsx(M,{className:nc(r.triggerLabel),children:h})}),w?jsx(F,{$open:false,className:nc(r.triggerArrow),children:w}):null]})});if(Z===1){let a=z(i);return jsx(y,{ref:L,id:l,"data-testid":l??"CurrenciesMenu",className:nc(r.root,b),sx:x,...I,children:jsx(te,{className:nc(r.static),children:N?jsx(Fragment,{children:N(a)}):jsxs(Fragment,{children:[jsx(C,{currency:a}),jsx(M,{className:nc(r.triggerLabel),children:a||h})]})})})}return jsx(Fe,{onClickAway:A,children:jsxs(y,{ref:L,id:l,"data-testid":l??"CurrenciesMenu",className:nc(r.root,b),sx:x,...I,children:[jsxs(S,{variant:"secondary",$open:$,disabled:m,onClick:Me,"aria-haspopup":"listbox","aria-expanded":$,className:nc(r.trigger),children:[jsx(O,{className:nc(r.triggerInfo),children:N?jsx(Fragment,{children:N(v)}):jsxs(Fragment,{children:[jsx(C,{currency:v}),jsx(M,{className:nc(r.triggerLabel),children:v||h})]})}),w?jsx(F,{$open:$,className:nc(r.triggerArrow),children:w}):null]}),jsx(R,{open:$,anchorEl:G,placement:Ne,sx:Ie,...he,children:ye.map(a=>jsxs(oe,{className:nc(r.category),children:[a.label?jsx(ne,{className:nc(r.categoryLabel),children:a.label}):null,a.items.map((T,Le)=>jsx(ae,{currency:T,selected:T===v,onSelect:be,renderOption:fe},`${a.key}:${T}-${Le}`))]},a.key))})]})})});pe.displayName="CurrenciesMenu";var ze=memo(pe);export{r as a,ze as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a}from'./chunk-HDCNWBW5.js';import {d,R as R$1,L as L$1,V,Q as Q$1}from'./chunk-WA5NL4IB.js';import {nc}from'./chunk-NTNU6XF2.js';import {Fb,A as A$1,Qc}from'./chunk-CZLLJ6SR.js';import {forwardRef,useState,useEffect,useMemo,memo,useRef,useLayoutEffect,useId}from'react';import gt from'@mui/material/ClickAwayListener';import {CircularProgress}from'@mui/material';import L from'@mui/material/Box';import fe from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var y="os-shared-NestedMultiSelect",s={root:`${y}-root`,open:`${y}-open`,label:`${y}-label`,placeholder:`${y}-placeholder`,arrow:`${y}-arrow`,menu:`${y}-menu`,search:`${y}-search`,selectedBadge:`${y}-selectedBadge`,fieldRow:`${y}-fieldRow`},re=40,A="data-nested-submenu",$="data-nested-submenu-anchor",se={strategy:"fixed"},ce=.7,ae=100,pe={width:10,height:7.5,flexShrink:0},ue={width:9,height:9,flexShrink:0};var et={overflow:"hidden",flex:"0 0 auto",width:"max-content",maxWidth:"100%",minWidth:0},tt=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),me=styled(L,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>{let{base:o}=e.v2.palette;return {width:"100%",boxSizing:"border-box",minHeight:47,textAlign:"left",flexDirection:"column",border:`1px solid ${t?"#FAFBFB":"transparent"}`,borderRadius:"4px",backgroundColor:t?"#FAFBFB":e.palette.grey[400],minWidth:"89px",position:"relative",cursor:t?"not-allowed":"pointer",...t&&{color:alpha(o.black,.6),[`& .${s.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${s.placeholder}`]:{color:alpha(o.black,.6)},[`& .${s.arrow}`]:{opacity:.6},[`& .${s.fieldRow}`]:{opacity:.7},[`& .${s.fieldRow} *`]:{cursor:"not-allowed"}},[`&.${s.open} .${s.arrow}`]:{transform:"rotate(180deg)"},[`&.${s.open} .${s.arrow} svg path, &:focus-within .${s.arrow} svg path`]:{fill:"#1F88D0",stroke:"#1F88D0"},[`&.${s.open}, &:focus-within`]:{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}}}),he=styled(fe)(({theme:e})=>({position:"absolute",top:9,left:8,margin:0,cursor:"pointer",fontSize:"10px",fontWeight:500,lineHeight:"100%",color:e.palette.grey[700],display:"block",pointerEvents:"none"})),Se=styled(fe)(()=>({margin:0,fontWeight:500,fontSize:"11px",lineHeight:"18px",padding:"22px 30px 8px 8px"})),Me=styled(L)(({theme:e})=>({position:"absolute",top:15,right:10,width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"inherit",lineHeight:0,transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter})})),ge=styled(L)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),ot={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},nt={display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",gap:"4px",width:"100%",minWidth:0},be=styled(L,{shouldForwardProp:e=>e!=="$field"})(({$field:e})=>({...nt,...e?{padding:"22px 30px 8px 8px"}:{marginBottom:"8px","&:empty":{display:"none"}}})),G=styled(L,{shouldForwardProp:e=>e!=="$field"})(({theme:e,$field:t})=>({...tt(`${e.palette.info.dark}1a`),...et,...t&&{cursor:"inherit"}})),xe=styled("span")(()=>ot),Ne=styled(L)(()=>({position:"relative",width:"100%",minWidth:0})),ye=styled(L)(()=>({flex:1,maxWidth:"220px",minWidth:"89px",fontWeight:500})),Ce=styled(L)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:"340px",minWidth:"89px",fontWeight:500}));var R=e=>!e.options&&typeof e.value=="string";function ve(e,t,o){if(e===void 0)return R(o);if(typeof e=="boolean")return e;if(typeof e=="function")return e(t,o);let n=e[t];return typeof n=="boolean"?n:R(o)}var F=e=>e.value??e.label,T=(e,t)=>t?.some(o=>o.value===e.value)??false,Le=(e,t,o)=>{if(T(e,t)){o(t?.filter(n=>n.value!==e.value)||[]);return}o([...t||[],e]);},X=e=>R(e)?[e]:(e.options??[]).flatMap(X),q=(e,t)=>{let o=e.filter(n=>T(n,t)).length;return {allSelected:e.length>0&&o===e.length,someSelected:o>0&&o<e.length}},Oe=(e,t,o)=>{let n=new Set(e.map(i=>i.value));if(q(e,t).allSelected){o((t??[]).filter(i=>!n.has(i.value)));return}let l=new Set((t??[]).map(i=>i.value)),r=e.filter(i=>!l.has(i.value));o([...t??[],...r]);},lt=(e,t)=>{let o=e[t];return typeof o=="string"?o:typeof o=="number"&&Number.isFinite(o)?String(o):""},it=(e,t,o)=>o.some(n=>lt(e,n).toLowerCase().includes(t)),Re=(e,t,o)=>{let n=t.toLowerCase().trim();if(!n)return e.map(i=>({node:i,depth:0}));let l=[],r=(i,d)=>{for(let c of i){if(R(c)){it(c,n,o)&&l.push({node:c,depth:d});continue}r(c.options??[],d+1);}};return r(e,0),l},rt=(e,t="right")=>{let o=e?.closest(`.${Q$1.panel}`);if(!e||!o)return 0;let n=e.getBoundingClientRect(),l=o.getBoundingClientRect(),r=t.startsWith("left")?n.left-l.left:l.right-n.right;return Math.max(0,r)},Ee=e=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:t})=>[0,rt(e.current,t)]}}],We=(e,t)=>e.length===t.length&&e.every((o,n)=>o===t[n]);function Be(e,t,o){let n=[],l=0;for(let r of e){if(t<=0){n.push(void 0);continue}if(l===0&&r>=t){n.push(Math.floor(t));continue}let i=l===0?0:o;if(l+i+r<=t+.5){n.push(void 0),l+=i+r;continue}let d=Math.floor(t-l-i);if(d>=ae&&d>=r*ce){n.push(d),l=0;continue}n.push(void 0),l=r;}return n}var we=(e,t)=>t instanceof Node&&!!e?.contains(t),Ie=(e,t,o)=>{if(we(t,e)||we(o,e))return true;if(!(e instanceof Element)||!o)return false;let n=e.closest(`[${A}]`)?.getAttribute($),l=n?document.getElementById(n):null;return !!(l&&o.contains(l))};function at({options:e,variant:t,hiddenCount:o=0,onRemove:n}){let l=useRef(null),r=useRef([]),[i,d$1]=useState([]),c=e.length+(o>0?1:0),C=e.map(a=>a.label).join("\0");useLayoutEffect(()=>{let a=l.current;if(!a||c===0)return;let m=()=>{let x=r.current.slice(0,c).filter(p=>p!=null);if(x.length!==c)return;let M=x.map(p=>p.style.maxWidth);x.forEach(p=>{p.style.maxWidth="none";});let h=x.map(p=>p.getBoundingClientRect().width);x.forEach((p,j)=>{p.style.maxWidth=M[j];});let g=getComputedStyle(a),W=a.clientWidth-parseFloat(g.paddingLeft)-parseFloat(g.paddingRight),z=parseFloat(g.columnGap||g.gap||"0")||0,B=Be(h,W,z);d$1(p=>We(p,B)?p:B);};m();let v=new ResizeObserver(m);return v.observe(a),()=>v.disconnect()},[c,C,t]);let f=t==="field",b=a=>m=>{m.stopPropagation(),m.preventDefault(),n?.(a);},w=a=>m=>{r.current[a]=m;};return jsxs(be,{ref:l,$field:f,className:f?s.fieldRow:void 0,children:[e.map((a,m)=>jsxs(G,{ref:w(m),$field:f,className:f?void 0:s.selectedBadge,style:i[m]!=null?{maxWidth:i[m]}:void 0,onClick:f?void 0:b(a),children:[f?null:jsx(d,{src:Qc,alt:"",sx:pe}),jsx(xe,{children:a.label}),f?null:jsx(d,{src:Fb,alt:"",sx:ue})]},`${m}-${a.value}`)),o>0?jsx(G,{ref:w(e.length),$field:f,style:i[e.length]!=null?{maxWidth:i[e.length]}:void 0,children:jsxs("span",{children:["+",o]})}):null]})}var H=at;function pt({options:e,maxVisibleValues:t}){let n=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.floor(t)):e.length,l=e.slice(0,n),r=e.length-l.length;return jsx(Ne,{children:jsx(H,{options:l,variant:"field",hiddenCount:r})})}var Ae=pt;var Fe=()=>jsx("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,style:{display:"block",flexShrink:0},children:jsx("path",{d:"M0.117188 0.504028C0.115307 0.426166 0.138248 0.350264 0.182617 0.286255C0.227088 0.222214 0.290458 0.173028 0.363281 0.144653C0.436073 0.116302 0.516047 0.109152 0.592773 0.124146C0.668745 0.138995 0.738375 0.176073 0.793945 0.229614L4.43164 3.63391C4.50662 3.70421 4.55078 3.80153 4.55078 3.90442C4.55064 4.00712 4.5065 4.10376 4.43164 4.17395L0.794922 7.57922L0.793945 7.57825C0.738766 7.63096 0.669812 7.66692 0.594727 7.68176C0.519097 7.69665 0.440194 7.69049 0.368164 7.66321C0.296002 7.63581 0.232474 7.58801 0.1875 7.52551C0.14262 7.463 0.11821 7.3886 0.118164 7.31165C0.118166 7.25986 0.12907 7.20846 0.150391 7.16125C0.171346 7.11493 0.201824 7.07367 0.239258 7.03918L3.58691 3.90442L0.239258 0.769653C0.164191 0.701295 0.119752 0.605686 0.117188 0.504028Z",fill:"#20232B",stroke:"#20232B",strokeWidth:"0.233333"})});function Ve({label:e,itemCount:t,isSelected:o,isIndeterminate:n,onToggle:l,children:r,isSelectable:i=false}){let d=useId(),c=useRef(null),C=useRef(null),f=useRef(null),b=useRef(null),[w,a]=useState(false),m=useMemo(()=>Ee(c),[]),v=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null);},x=()=>{t!==0&&(v(),a(true));},M=h=>{Ie(h.relatedTarget,c.current,C.current)||(v(),b.current=window.setTimeout(()=>{b.current=null,a(false);},re));};return useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current);},[]),useEffect(()=>{if(!w)return;let h=()=>f.current?.update();return document.addEventListener("scroll",h,true),window.addEventListener("resize",h),()=>{document.removeEventListener("scroll",h,true),window.removeEventListener("resize",h);}},[w]),jsxs(V,{id:d,ref:c,isSelected:o,isIndeterminate:n,startAdornment:i?void 0:null,onClick:h=>{if(h.stopPropagation(),h.preventDefault(),!i){x();return}l();},onMouseEnter:x,onMouseLeave:M,children:[jsxs(Ce,{children:[e,jsx(Fe,{})]}),jsx(R$1,{ref:C,popperRef:f,[A]:"",[$]:d,sx:{maxHeight:"min(450px, calc(100dvh - 16px))",overflow:"auto"},open:w,anchorEl:c.current,placement:"right-start",modifiers:m,popperOptions:se,onMouseEnter:x,onMouseLeave:M,children:r})]})}function je({option:e,value:t,onChange:o,isSelectable:n=true}){let l=T(e,t);return jsx(V,{isSelected:l,onClick:i=>{i.stopPropagation(),i.preventDefault(),n&&Le(e,t,o);},startAdornment:n?void 0:null,children:jsx(ye,{children:e.label})})}function Q({node:e,depth:t,value:o,onChange:n,isSelectable:l}){let r=ve(l,t,e);if(R(e))return jsx(je,{option:e,value:o,onChange:n,isSelectable:r});if(!e.options)return null;let i=e.options,d=X(e),{allSelected:c,someSelected:C}=q(d,o);return jsx(Ve,{label:e.label,itemCount:i.length,isSelected:c,isIndeterminate:C,isSelectable:r,onToggle:()=>Oe(d,o,n),children:i.map(f=>jsx(Q,{node:f,depth:t+1,value:o,onChange:n,isSelectable:l},F(f)))})}var bt=["label"],Xe=forwardRef(({options:e,onChange:t,value:o,maxVisibleValues:n,placeholder:l,label:r,isLoading:i,isSelectable:d$1,disabled:c,className:C,sx:f,isSearchable:b=true,searchPlaceholder:w,searchBy:a$1=bt,onOpen:m,onClose:v},x)=>{let[M,h]=useState(null),[g,W]=useState(""),[z,B]=useState(void 0),p=!!M,j=r??l,qe=r?l??"Please Select":"Please Select";useEffect(()=>{if(!M)return;let u=()=>{let K=M.clientWidth;K>0&&B(_=>_===K?_:K);};if(u(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(u);return O.observe(M),()=>O.disconnect()},[M]);let Ze=M?.clientWidth||z,Je=u=>{if(p){h(null),v?.();return}h(u.currentTarget),m?.();},Qe=()=>{h(null),v?.();},Ue=()=>{g&&W("");},Ye=useMemo(()=>Re(e,g,a$1),[e,g,a$1]),Y=o?.length??0,_e=i?jsx(CircularProgress,{size:16}):jsx(d,{src:g?Fb:A$1,alt:g?"close":"search",onClick:Ue,sx:{width:12,height:12,cursor:g?"pointer":"default"}});return jsx(gt,{onClickAway:()=>{p&&Qe();},children:jsxs(me,{ref:x,id:"FieldWrapper","data-testid":"NestedMultiSelect",$disabled:c,"aria-disabled":c||void 0,className:nc(s.root,p&&s.open,C),sx:f,onClick:u=>!c&&Je(u),children:[jsx(he,{className:s.label,component:"label",children:j}),Y===0&&jsx(Se,{className:s.placeholder,component:"p",children:qe}),jsx(Me,{className:s.arrow,"aria-hidden":true,children:i?jsx(CircularProgress,{size:16}):jsx(a,{})}),Y>0&&o?jsx(Ae,{options:o,maxVisibleValues:n}):null,jsx(R$1,{open:p,anchorEl:M,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",width:Ze},panelProps:{className:s.menu},children:jsxs(ge,{children:[b?jsx(L$1,{className:s.search,fullWidth:true,size:"md",placeholder:w??l??"Select",endAdornment:_e,value:g,onClick:u=>{u.stopPropagation();},onMouseDown:u=>{u.stopPropagation();},onChange:u=>{W(u.target.value);},sx:{mb:"8px"}}):null,jsx(H,{options:o??[],variant:"menu",onRemove:u=>{t(o?.filter(O=>O.value!==u.value)||[]);}}),Ye.map(({node:u,depth:O})=>jsx(Q,{node:u,depth:O,value:o,onChange:t,isSelectable:d$1},F(u)))]})})]})})});Xe.displayName="NestedMultiSelect";var xt=memo(Xe);
|
|
1
|
+
import {a}from'./chunk-HDCNWBW5.js';import {d,R as R$1,L as L$1,V,Q as Q$1}from'./chunk-N76O4JDU.js';import {nc}from'./chunk-NTNU6XF2.js';import {Fb,A as A$1,Qc}from'./chunk-CZLLJ6SR.js';import {forwardRef,useState,useEffect,useMemo,memo,useRef,useLayoutEffect,useId}from'react';import gt from'@mui/material/ClickAwayListener';import {CircularProgress}from'@mui/material';import L from'@mui/material/Box';import fe from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var y="os-shared-NestedMultiSelect",s={root:`${y}-root`,open:`${y}-open`,label:`${y}-label`,placeholder:`${y}-placeholder`,arrow:`${y}-arrow`,menu:`${y}-menu`,search:`${y}-search`,selectedBadge:`${y}-selectedBadge`,fieldRow:`${y}-fieldRow`},re=40,A="data-nested-submenu",$="data-nested-submenu-anchor",se={strategy:"fixed"},ce=.7,ae=100,pe={width:10,height:7.5,flexShrink:0},ue={width:9,height:9,flexShrink:0};var et={overflow:"hidden",flex:"0 0 auto",width:"max-content",maxWidth:"100%",minWidth:0},tt=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),me=styled(L,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>{let{base:o}=e.v2.palette;return {width:"100%",boxSizing:"border-box",minHeight:47,textAlign:"left",flexDirection:"column",border:`1px solid ${t?"#FAFBFB":"transparent"}`,borderRadius:"4px",backgroundColor:t?"#FAFBFB":e.palette.grey[400],minWidth:"89px",position:"relative",cursor:t?"not-allowed":"pointer",...t&&{color:alpha(o.black,.6),[`& .${s.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${s.placeholder}`]:{color:alpha(o.black,.6)},[`& .${s.arrow}`]:{opacity:.6},[`& .${s.fieldRow}`]:{opacity:.7},[`& .${s.fieldRow} *`]:{cursor:"not-allowed"}},[`&.${s.open} .${s.arrow}`]:{transform:"rotate(180deg)"},[`&.${s.open} .${s.arrow} svg path, &:focus-within .${s.arrow} svg path`]:{fill:"#1F88D0",stroke:"#1F88D0"},[`&.${s.open}, &:focus-within`]:{border:"1px solid #1F88D0",boxShadow:"0px 0px 4px 0px #1F88D080"}}}),he=styled(fe)(({theme:e})=>({position:"absolute",top:9,left:8,margin:0,cursor:"pointer",fontSize:"10px",fontWeight:500,lineHeight:"100%",color:e.palette.grey[700],display:"block",pointerEvents:"none"})),Se=styled(fe)(()=>({margin:0,fontWeight:500,fontSize:"11px",lineHeight:"18px",padding:"22px 30px 8px 8px"})),Me=styled(L)(({theme:e})=>({position:"absolute",top:15,right:10,width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:"inherit",lineHeight:0,transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter})})),ge=styled(L)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),ot={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},nt={display:"flex",flexWrap:"wrap",alignItems:"center",alignContent:"flex-start",gap:"4px",width:"100%",minWidth:0},be=styled(L,{shouldForwardProp:e=>e!=="$field"})(({$field:e})=>({...nt,...e?{padding:"22px 30px 8px 8px"}:{marginBottom:"8px","&:empty":{display:"none"}}})),G=styled(L,{shouldForwardProp:e=>e!=="$field"})(({theme:e,$field:t})=>({...tt(`${e.palette.info.dark}1a`),...et,...t&&{cursor:"inherit"}})),xe=styled("span")(()=>ot),Ne=styled(L)(()=>({position:"relative",width:"100%",minWidth:0})),ye=styled(L)(()=>({flex:1,maxWidth:"220px",minWidth:"89px",fontWeight:500})),Ce=styled(L)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:"340px",minWidth:"89px",fontWeight:500}));var R=e=>!e.options&&typeof e.value=="string";function ve(e,t,o){if(e===void 0)return R(o);if(typeof e=="boolean")return e;if(typeof e=="function")return e(t,o);let n=e[t];return typeof n=="boolean"?n:R(o)}var F=e=>e.value??e.label,T=(e,t)=>t?.some(o=>o.value===e.value)??false,Le=(e,t,o)=>{if(T(e,t)){o(t?.filter(n=>n.value!==e.value)||[]);return}o([...t||[],e]);},X=e=>R(e)?[e]:(e.options??[]).flatMap(X),q=(e,t)=>{let o=e.filter(n=>T(n,t)).length;return {allSelected:e.length>0&&o===e.length,someSelected:o>0&&o<e.length}},Oe=(e,t,o)=>{let n=new Set(e.map(i=>i.value));if(q(e,t).allSelected){o((t??[]).filter(i=>!n.has(i.value)));return}let l=new Set((t??[]).map(i=>i.value)),r=e.filter(i=>!l.has(i.value));o([...t??[],...r]);},lt=(e,t)=>{let o=e[t];return typeof o=="string"?o:typeof o=="number"&&Number.isFinite(o)?String(o):""},it=(e,t,o)=>o.some(n=>lt(e,n).toLowerCase().includes(t)),Re=(e,t,o)=>{let n=t.toLowerCase().trim();if(!n)return e.map(i=>({node:i,depth:0}));let l=[],r=(i,d)=>{for(let c of i){if(R(c)){it(c,n,o)&&l.push({node:c,depth:d});continue}r(c.options??[],d+1);}};return r(e,0),l},rt=(e,t="right")=>{let o=e?.closest(`.${Q$1.panel}`);if(!e||!o)return 0;let n=e.getBoundingClientRect(),l=o.getBoundingClientRect(),r=t.startsWith("left")?n.left-l.left:l.right-n.right;return Math.max(0,r)},Ee=e=>[{name:"flip",enabled:true,options:{rootBoundary:"viewport",padding:8,fallbackPlacements:["left-start","right-end","left-end"]}},{name:"preventOverflow",enabled:true,options:{rootBoundary:"viewport",altAxis:true,padding:8}},{name:"offset",options:{offset:({placement:t})=>[0,rt(e.current,t)]}}],We=(e,t)=>e.length===t.length&&e.every((o,n)=>o===t[n]);function Be(e,t,o){let n=[],l=0;for(let r of e){if(t<=0){n.push(void 0);continue}if(l===0&&r>=t){n.push(Math.floor(t));continue}let i=l===0?0:o;if(l+i+r<=t+.5){n.push(void 0),l+=i+r;continue}let d=Math.floor(t-l-i);if(d>=ae&&d>=r*ce){n.push(d),l=0;continue}n.push(void 0),l=r;}return n}var we=(e,t)=>t instanceof Node&&!!e?.contains(t),Ie=(e,t,o)=>{if(we(t,e)||we(o,e))return true;if(!(e instanceof Element)||!o)return false;let n=e.closest(`[${A}]`)?.getAttribute($),l=n?document.getElementById(n):null;return !!(l&&o.contains(l))};function at({options:e,variant:t,hiddenCount:o=0,onRemove:n}){let l=useRef(null),r=useRef([]),[i,d$1]=useState([]),c=e.length+(o>0?1:0),C=e.map(a=>a.label).join("\0");useLayoutEffect(()=>{let a=l.current;if(!a||c===0)return;let m=()=>{let x=r.current.slice(0,c).filter(p=>p!=null);if(x.length!==c)return;let M=x.map(p=>p.style.maxWidth);x.forEach(p=>{p.style.maxWidth="none";});let h=x.map(p=>p.getBoundingClientRect().width);x.forEach((p,j)=>{p.style.maxWidth=M[j];});let g=getComputedStyle(a),W=a.clientWidth-parseFloat(g.paddingLeft)-parseFloat(g.paddingRight),z=parseFloat(g.columnGap||g.gap||"0")||0,B=Be(h,W,z);d$1(p=>We(p,B)?p:B);};m();let v=new ResizeObserver(m);return v.observe(a),()=>v.disconnect()},[c,C,t]);let f=t==="field",b=a=>m=>{m.stopPropagation(),m.preventDefault(),n?.(a);},w=a=>m=>{r.current[a]=m;};return jsxs(be,{ref:l,$field:f,className:f?s.fieldRow:void 0,children:[e.map((a,m)=>jsxs(G,{ref:w(m),$field:f,className:f?void 0:s.selectedBadge,style:i[m]!=null?{maxWidth:i[m]}:void 0,onClick:f?void 0:b(a),children:[f?null:jsx(d,{src:Qc,alt:"",sx:pe}),jsx(xe,{children:a.label}),f?null:jsx(d,{src:Fb,alt:"",sx:ue})]},`${m}-${a.value}`)),o>0?jsx(G,{ref:w(e.length),$field:f,style:i[e.length]!=null?{maxWidth:i[e.length]}:void 0,children:jsxs("span",{children:["+",o]})}):null]})}var H=at;function pt({options:e,maxVisibleValues:t}){let n=typeof t=="number"&&Number.isFinite(t)?Math.max(0,Math.floor(t)):e.length,l=e.slice(0,n),r=e.length-l.length;return jsx(Ne,{children:jsx(H,{options:l,variant:"field",hiddenCount:r})})}var Ae=pt;var Fe=()=>jsx("svg",{width:"5",height:"8",viewBox:"0 0 5 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,style:{display:"block",flexShrink:0},children:jsx("path",{d:"M0.117188 0.504028C0.115307 0.426166 0.138248 0.350264 0.182617 0.286255C0.227088 0.222214 0.290458 0.173028 0.363281 0.144653C0.436073 0.116302 0.516047 0.109152 0.592773 0.124146C0.668745 0.138995 0.738375 0.176073 0.793945 0.229614L4.43164 3.63391C4.50662 3.70421 4.55078 3.80153 4.55078 3.90442C4.55064 4.00712 4.5065 4.10376 4.43164 4.17395L0.794922 7.57922L0.793945 7.57825C0.738766 7.63096 0.669812 7.66692 0.594727 7.68176C0.519097 7.69665 0.440194 7.69049 0.368164 7.66321C0.296002 7.63581 0.232474 7.58801 0.1875 7.52551C0.14262 7.463 0.11821 7.3886 0.118164 7.31165C0.118166 7.25986 0.12907 7.20846 0.150391 7.16125C0.171346 7.11493 0.201824 7.07367 0.239258 7.03918L3.58691 3.90442L0.239258 0.769653C0.164191 0.701295 0.119752 0.605686 0.117188 0.504028Z",fill:"#20232B",stroke:"#20232B",strokeWidth:"0.233333"})});function Ve({label:e,itemCount:t,isSelected:o,isIndeterminate:n,onToggle:l,children:r,isSelectable:i=false}){let d=useId(),c=useRef(null),C=useRef(null),f=useRef(null),b=useRef(null),[w,a]=useState(false),m=useMemo(()=>Ee(c),[]),v=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null);},x=()=>{t!==0&&(v(),a(true));},M=h=>{Ie(h.relatedTarget,c.current,C.current)||(v(),b.current=window.setTimeout(()=>{b.current=null,a(false);},re));};return useEffect(()=>()=>{b.current!=null&&window.clearTimeout(b.current);},[]),useEffect(()=>{if(!w)return;let h=()=>f.current?.update();return document.addEventListener("scroll",h,true),window.addEventListener("resize",h),()=>{document.removeEventListener("scroll",h,true),window.removeEventListener("resize",h);}},[w]),jsxs(V,{id:d,ref:c,isSelected:o,isIndeterminate:n,startAdornment:i?void 0:null,onClick:h=>{if(h.stopPropagation(),h.preventDefault(),!i){x();return}l();},onMouseEnter:x,onMouseLeave:M,children:[jsxs(Ce,{children:[e,jsx(Fe,{})]}),jsx(R$1,{ref:C,popperRef:f,[A]:"",[$]:d,sx:{maxHeight:"min(450px, calc(100dvh - 16px))",overflow:"auto"},open:w,anchorEl:c.current,placement:"right-start",modifiers:m,popperOptions:se,onMouseEnter:x,onMouseLeave:M,children:r})]})}function je({option:e,value:t,onChange:o,isSelectable:n=true}){let l=T(e,t);return jsx(V,{isSelected:l,onClick:i=>{i.stopPropagation(),i.preventDefault(),n&&Le(e,t,o);},startAdornment:n?void 0:null,children:jsx(ye,{children:e.label})})}function Q({node:e,depth:t,value:o,onChange:n,isSelectable:l}){let r=ve(l,t,e);if(R(e))return jsx(je,{option:e,value:o,onChange:n,isSelectable:r});if(!e.options)return null;let i=e.options,d=X(e),{allSelected:c,someSelected:C}=q(d,o);return jsx(Ve,{label:e.label,itemCount:i.length,isSelected:c,isIndeterminate:C,isSelectable:r,onToggle:()=>Oe(d,o,n),children:i.map(f=>jsx(Q,{node:f,depth:t+1,value:o,onChange:n,isSelectable:l},F(f)))})}var bt=["label"],Xe=forwardRef(({options:e,onChange:t,value:o,maxVisibleValues:n,placeholder:l,label:r,isLoading:i,isSelectable:d$1,disabled:c,className:C,sx:f,isSearchable:b=true,searchPlaceholder:w,searchBy:a$1=bt,onOpen:m,onClose:v},x)=>{let[M,h]=useState(null),[g,W]=useState(""),[z,B]=useState(void 0),p=!!M,j=r??l,qe=r?l??"Please Select":"Please Select";useEffect(()=>{if(!M)return;let u=()=>{let K=M.clientWidth;K>0&&B(_=>_===K?_:K);};if(u(),typeof ResizeObserver>"u")return;let O=new ResizeObserver(u);return O.observe(M),()=>O.disconnect()},[M]);let Ze=M?.clientWidth||z,Je=u=>{if(p){h(null),v?.();return}h(u.currentTarget),m?.();},Qe=()=>{h(null),v?.();},Ue=()=>{g&&W("");},Ye=useMemo(()=>Re(e,g,a$1),[e,g,a$1]),Y=o?.length??0,_e=i?jsx(CircularProgress,{size:16}):jsx(d,{src:g?Fb:A$1,alt:g?"close":"search",onClick:Ue,sx:{width:12,height:12,cursor:g?"pointer":"default"}});return jsx(gt,{onClickAway:()=>{p&&Qe();},children:jsxs(me,{ref:x,id:"FieldWrapper","data-testid":"NestedMultiSelect",$disabled:c,"aria-disabled":c||void 0,className:nc(s.root,p&&s.open,C),sx:f,onClick:u=>!c&&Je(u),children:[jsx(he,{className:s.label,component:"label",children:j}),Y===0&&jsx(Se,{className:s.placeholder,component:"p",children:qe}),jsx(Me,{className:s.arrow,"aria-hidden":true,children:i?jsx(CircularProgress,{size:16}):jsx(a,{})}),Y>0&&o?jsx(Ae,{options:o,maxVisibleValues:n}):null,jsx(R$1,{open:p,anchorEl:M,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",width:Ze},panelProps:{className:s.menu},children:jsxs(ge,{children:[b?jsx(L$1,{className:s.search,fullWidth:true,size:"md",placeholder:w??l??"Select",endAdornment:_e,value:g,onClick:u=>{u.stopPropagation();},onMouseDown:u=>{u.stopPropagation();},onChange:u=>{W(u.target.value);},sx:{mb:"8px"}}):null,jsx(H,{options:o??[],variant:"menu",onRemove:u=>{t(o?.filter(O=>O.value!==u.value)||[]);}}),Ye.map(({node:u,depth:O})=>jsx(Q,{node:u,depth:O,value:o,onChange:t,isSelectable:d$1},F(u)))]})})]})})});Xe.displayName="NestedMultiSelect";var xt=memo(Xe);
|
|
2
2
|
export{s as a,xt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {L,K,j}from'./chunk-
|
|
1
|
+
import {L,K,j}from'./chunk-N76O4JDU.js';import {xa,Ia,l,nc}from'./chunk-NTNU6XF2.js';import {forwardRef,useState,useMemo,memo}from'react';import V from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var r="os-shared-CurrencyAmountInput",t={root:`${r}-root`,field:`${r}-field`,display:`${r}-display`,integer:`${r}-integer`,separator:`${r}-separator`,decimal:`${r}-decimal`};var N=styled(V)(({theme:e})=>({color:e.v2.palette.foreground.primary,border:`1px solid ${e.v2.palette.border.default}`,padding:e.v2.spacing(8),borderRadius:e.v2.radius(4),display:"flex",alignItems:"center",justifyContent:"flex-end",width:93,height:32,textAlign:"right",input:{fontSize:"11px",border:"none",color:e.v2.palette.foreground.primary,height:30,padding:0,textAlign:"right"}})),I=styled(L)(({theme:e})=>({flexGrow:1,maxWidth:"100%",padding:0,border:"none",backgroundColor:"transparent",borderRadius:"none",height:24,[`& .${K.input}`]:{padding:0},input:{textAlign:"right",width:"100%",fontWeight:e.v2.typography.fontWeightRegular}})),b=styled(j)(({theme:e})=>({...e.v2.typography.textVariants.body.small.bold,display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",overflow:"auto"})),v=styled("span")(({theme:e})=>({fontWeight:e.v2.typography.fontWeightRegular}));var q=xa(),D=forwardRef(({amount:e,setAmount:u,maxAmount:l$1,isError:R,placeholder:E,selectedCurrency:p,id:o,className:k,sx:P,...B},M)=>{let[W,m]=useState(false),[c,S]=useState(e||""),{integerAmount:F,decimalAmount:d}=Ia(e,p?.code?.english),K=useMemo(()=>l(p?.decimals),[p]),T=n=>{let i=Number(n.target.value)||0;if(l$1&&i>l$1)return false;S(i),u(i);},H=()=>{m(false),u(Number(c));},L=n=>{q&&isNaN(Number(n.key))&&n.key!=="Backspace"&&n.key!=="."&&n.preventDefault();};return jsx(N,{id:o,"data-testid":o??"CurrencyAmountInput",className:nc(t.root,k),sx:P,...B,children:W?jsx(I,{ref:M,id:o,className:t.field,type:"number",placeholder:E??K,value:c,onChange:T,onBlur:H,onKeyDown:L,error:!!R,inputProps:{step:"0.01"},hideArrows:true,autoFocus:true,disableFocusRing:true}):jsxs(b,{id:o?`${o}-display`:void 0,"data-testid":o?`${o}-display`:"CurrencyAmount",className:t.display,component:"span",onClick:()=>{m(true);},children:[jsx("span",{className:t.integer,children:F}),d?jsxs(Fragment,{children:[jsx("span",{className:t.separator,children:"."}),jsx(v,{className:t.decimal,children:d})]}):null]})})});D.displayName="CurrencyAmountInput";var J=memo(D);export{t as a,J as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-NCBWDLV3.js';import {L,aa,B}from'./chunk-N76O4JDU.js';import {Dc}from'./chunk-NTNU6XF2.js';import {Db,A}from'./chunk-CZLLJ6SR.js';import ne,{memo,useState,useEffect}from'react';import P from'@mui/material/Box';import te from'@mui/material/InputAdornment';import oe from'@mui/material/Skeleton';import {styled,Popper,Box,ClickAwayListener}from'@mui/material';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled as styled$1}from'@mui/material/styles';var N=styled("button")(({theme:e,disabled:o})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"12px",borderRadius:"3px"},".arrow":{width:14,alignSelf:""},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px",borderRadius:"2px"},cursor:o?"default":"pointer",opacity:o?.5:1,paddingTop:0,backgroundColor:"transparent",border:"none",paddingInlineStart:0,minWidth:70,marginTop:1})),_=styled(Popper)(({theme:e})=>({zIndex:9999,backgroundColor:e.palette.common.white,padding:"4px 8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:100})),H=styled("ul")(()=>({listStyle:"none",padding:0,margin:0,maxHeight:100,overflow:"auto"})),q=styled("li")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),z=styled(L)(()=>({flexGrow:1,maxWidth:"100%",height:24,padding:"4px",marginBottom:"4px"})),D=styled(Box)(()=>({color:"red !important"}));function G({isLoading:e,countries:o,value:n,onCountryChange:l,required:b,disabled:f}){let[a,C]=useState(),[u,g]=useState(null),[y,i]=useState([]),[I,S]=useState(""),s=!!u&&!f,w=t=>{t.stopPropagation(),g(t.currentTarget);},m=()=>{g(null);},L=t=>{l?.(t),C(t),m(),i(o);},k=t=>{let p=t.target.value.toString()??"";if(S(p),!p){i(o);return}let Y=o.filter(F=>F.idd_prefix.toString().startsWith(p)||F.iso2.toLowerCase().startsWith(p.toLowerCase()));i(Y);};return useEffect(()=>{n&&C(n);},[n?.countryId]),useEffect(()=>{o.length&&i(o);},[o.length]),jsxs(P,{"data-testid":"CountriesList",sx:{position:"relative"},children:[jsx(N,{type:"button","aria-describedby":"CountriesList_CountriesWrapper",onClick:w,disabled:e||f,children:e?jsx(oe,{variant:"rectangular",width:56.5,height:15,sx:{borderRadius:"4px"}}):jsxs(Fragment,{children:[a&&jsxs(Fragment,{children:[jsx("img",{src:a.logo,alt:"c",className:"logo"}),jsx(P,{component:"span",flex:1,children:`+${a?.idd_prefix}`})]}),b&&jsx(D,{component:"span",children:"*"}),jsx(P,{component:"img",src:Db,alt:"d",className:"arrow",sx:{...s&&{transform:"rotate(180deg)"}}})]})}),s&&jsx(B,{onClick:m,sx:{zIndex:9999}}),s&&jsx(ClickAwayListener,{onClickAway:m,children:jsxs(_,{id:"CountriesList_CountriesWrapper",open:s,anchorEl:u,"data-testid":"CountriesList_CountriesWrapper",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-8,6]}}],children:[jsx(z,{type:"number",endAdornment:jsx(te,{position:"end",children:jsx("img",{src:A,alt:"arrow"})}),onChange:k,hideArrows:true,disableFocusRing:true,"data-testid":"CountriesList_InputStyled",value:I}),jsx(H,{"data-testid":"CountriesList_CountriesListStyled",children:y.map(t=>{let p=a?.countryId===t.countryId;return jsxs(q,{onClick:()=>{L(t);},sx:{backgroundColor:p?"#F9F9F9":"transparent",color:p?"#000":"#8D8D94"},children:[jsx("img",{src:t.logo,alt:"c",className:"logo"}),jsx("span",{children:`+${t.idd_prefix}`})]},`country-code-${t.countryId}`)})})]})})]})}G.displayName="CountriesList";var V=memo(G);var v=V;styled$1(P,{shouldForwardProp:e=>!["feedbackType","hasFeedback"].includes(e)})(({theme:e,feedbackType:o,hasFeedback:n})=>{let{borderColor:l}=aa(e,o);return {border:`1px solid ${o?l:e.palette.divider}`,display:"flex",position:"relative",alignItems:"center",borderRadius:n?"4px 4px 0 0":"4px",borderBottom:n?"none":void 0}});var K=styled$1(b)({flexGrow:1,maxWidth:"100%",paddingInlineEnd:0,img:{cursor:"pointer"}});styled$1("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));styled$1(P)(()=>({flex:1}));function U({phoneValue:e,error:o,hasError:n,countries:l,isCountriesLoading:b,countryValue:f,onCountryChange:a,onPhoneChange:C,helperText:u,required:g,disabled:y,feedback:i,id:I="PhoneInput",...S},s){let w=t=>{a?.(t);},m=i?.message??u,{isProvided:L}=Dc(i,{message:m});return jsx(K,{id:I,type:"number",value:e,"data-testid":"PhoneInput",ref:s,disableFocusRing:true,inputProps:{autoComplete:"off"},error:(o??n??false)&&!L,disabled:y,feedback:i,helperText:u,startAdornment:jsx(v,{isLoading:b,countries:l,value:f,onCountryChange:w,required:g,disabled:y}),...S,onChange:C,hideArrows:true})}U.displayName="PhoneInput";var X=ne.forwardRef(U);export{v as a,X as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {r,p as p$1}from'./chunk-
|
|
1
|
+
import {r,p as p$1}from'./chunk-N76O4JDU.js';import {Bc}from'./chunk-NTNU6XF2.js';import {useId,Fragment}from'react';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var u=styled(p)(({rows:e,columns:t})=>({display:"grid",gridTemplateColumns:`auto repeat(${t}, 1fr)`,gridTemplateRows:`auto repeat(${e}, 1fr)`,gap:"6px"})),L=styled(p)(()=>({width:24,position:"sticky",top:0,left:0,zIndex:3})),g=styled(p)(({theme:e})=>({display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",fontSize:"10px",fontWeight:500,color:e.palette.grey[700],lineHeight:"100%",letterSpacing:"0",position:"sticky",top:0,zIndex:2,backgroundColor:"#fbfbfb"})),M=styled(p)(({theme:e,percentage:t=0})=>({width:"24px",height:"8px",borderRadius:"1px",backgroundColor:t===0?alpha(e.palette.grey[700],.1):alpha(e.palette.info.dark,t)})),O=styled(g)(()=>({fontSize:"9px",top:"auto",left:0,zIndex:1})),w=styled(p)(()=>({padding:"22px 12px",overflow:"auto",maxHeight:"480px"}));function x({xAxis:e,yAxis:t,series:n,isLoading:s,tooltip:l}){let c=Bc(useId(),"heat-map"),d=e.labels,y=t.labels;return jsxs(w,{id:c,"data-testid":"HeatMap",children:[jsxs(u,{className:"x-labels",rows:1,columns:d.length,children:[jsx(L,{}),d.map((r,i)=>jsx(g,{children:e.render?e.render(r):r},`x-${i}-${r}`))]}),jsx(u,{className:"y-labels",rows:y.length,columns:d.length,children:y.map((r$1,i)=>jsxs(Fragment,{children:[jsx(O,{sx:{minWidth:"25px"},children:t.render?t.render(r$1):r$1},`y-${i}-${r$1}`),d.map((m,h)=>{if(s)return jsx(r,{variant:"rectangular",width:"24px",height:"8px"},`${m}-${h}`);let f=n?.[m]?.[r$1]??{};return jsx(p$1,{title:l?.render&&f?.value?l.render(f,m,r$1):null,children:jsx(M,{percentage:f?.colorOpacityDegree})},`${m}-${h}`)})]},`y-${i}-${r$1}`))})]})}var H=[.06,.1,.2,.3,.4,.5,.6,.7,.8,.9,1];function D(e,t,n){if(t===n)return 0;let s=n-t,l=(e-t)/s,c=Math.floor(l*10);return H[Math.max(0,Math.min(10,c))]}var j=x;export{D as a,j as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-N76O4JDU.js';import {styled,Box,Button}from'@mui/material';var d=styled(j)(({theme:o})=>{let{grey:r}=o.v2.palette;return {fontWeight:o.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:r[500],paddingInlineStart:o.v2.spacing(16),paddingTop:o.v2.spacing(8),paddingBottom:o.v2.spacing(8),paddingInlineEnd:o.v2.spacing(8),borderBottom:`1px solid ${r[100]}`}}),l=styled(Box)(({theme:o})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"center",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${o.palette.divider}`})),c=styled(Button)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.info.dark}`,backgroundColor:o.palette.info.dark,fontWeight:700,fontSize:"11px",color:o.palette.common.white,"&:hover":{backgroundColor:o.palette.info.dark}})),s=styled(Button)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.common.white,fontWeight:500,fontSize:"11px",color:o.palette.text.primary,"&:hover":{background:"transparent"}}));export{d as a,l as b,c,s as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,f,p}from'./chunk-
|
|
1
|
+
import {j,f,p}from'./chunk-N76O4JDU.js';import {Bc}from'./chunk-NTNU6XF2.js';import {wb}from'./chunk-CZLLJ6SR.js';import {memo,useRef,useState,useEffect,useMemo,useId}from'react';import se from'@mui/material/Popper';import {styled,Box}from'@mui/material';import {jsx,jsxs}from'react/jsx-runtime';var k=styled(j)(({theme:e})=>({fontWeight:e.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:e.v2.palette.grey[500],paddingInlineStart:e.v2.spacing(16),paddingTop:e.v2.spacing(8),paddingBottom:e.v2.spacing(8),paddingInlineEnd:e.v2.spacing(8)})),R=styled(Box,{shouldForwardProp:e=>e!=="disabled"})(({theme:e,disabled:n})=>({fontWeight:e.typography.fontWeightMedium,padding:e.spacing(1),position:"relative",display:"flex",alignItems:"center",textTransform:"capitalize",cursor:n?"not-allowed":"pointer",flex:1,zIndex:99999,".MuiButtonBase-root":{width:"16px",marginInlineEnd:"4px"}})),z=styled(Box)(({theme:e})=>({borderRadius:e.spacing(.5),background:e.palette.background.default,width:"max-content",cursor:"pointer",zIndex:99999,boxShadow:e.shadows[11],display:"flex",flexDirection:"column",".nested-menu-item + .nested-menu-item":{borderTop:`1px solid ${e.palette.divider}`,zIndex:99999},".nested-menu-item:hover":{transition:e.transitions.create(["boxShadow","border"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.complex}),boxShadow:e.shadows[6],border:"none",position:"relative"}})),B=styled(Box)(({theme:e})=>({...e.typography.subtitle1,color:e.palette.text.primary})),H=styled(f)(()=>({padding:0,paddingRight:"4px",".MuiSvgIcon-root":{width:12,height:12}})),$=styled(Box)(()=>({display:"flex",gap:"4px",alignItems:"center",flexGrow:1,minWidth:0,overflow:"hidden"})),A=styled(Box)(()=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",minWidth:0,overflow:"hidden"})),O=styled(Box)(({theme:e})=>({borderRadius:"50%",background:e.palette.divider,width:13,height:14,fontSize:"8px",fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"10px"})),G=styled(Box)(()=>({display:"flex",alignItems:"center",gap:"8px",flexShrink:0,position:"relative",left:4})),F=styled(Box)(()=>({flex:"1 0 auto"})),_=styled(Box)(()=>({position:"relative",zIndex:999999}));function q(e){return e.scrollWidth-e.clientWidth>1}function oe({children:e}){let n=useRef(null),[r,t]=useState(false);return jsx(p,{arrow:true,placement:"top",title:e,open:r,onOpen:()=>{let u=n.current;u&&q(u)&&t(true);},onClose:()=>t(false),componentsProps:{tooltip:{sx:{maxWidth:280,whiteSpace:"normal",wordBreak:"break-word"}}},wrapperProps:{sx:{flex:1,minWidth:0,display:"block",overflow:"hidden"}},children:jsx(B,{ref:n,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})})}var K=memo(oe);function ie({label:e,icon:n,name:r,menuItems:t,setSelected:u,onSelect:C,selected:s,displayChildrenCount:I,disabled:i,placement:h="right",sx:g,menuSx:P}){let[f,S]=useState(null),l=useRef(null),[a,p]=useState(false),w=o=>{!i&&s!==void 0&&(u({name:o,selected:!s}),s||p(false));};return useEffect(()=>{p(!!(t?.some(o=>o.selected)&&!t?.every(o=>o.selected)));},[]),jsxs(R,{"data-testid":"NestedDropdown_MenuItem",ref:l,className:`nested-menu-item ${f?"active":""} ${i?"disabled":""}`,onMouseEnter:o=>{!f&&t?.length&&S(o.currentTarget);},onMouseLeave:()=>{f&&S(null);},onClick:o=>{i||(o.stopPropagation(),w(r));},sx:{...t?.length&&{cursor:i?"not-allowed":"pointer"},zIndex:99999,...g},disabled:i,children:[s!==void 0&&jsx(H,{size:"small",indeterminate:a,checked:s,disabled:i}),jsxs($,{children:[n&&n,jsxs(A,{children:[e&&jsx(K,{children:e}),!!t?.length&&jsxs(G,{children:[I&&jsx(O,{children:t.length}),jsx("img",{src:wb,className:"arrow-icon",alt:"arrow",style:{height:12}})]})]})]}),t?.length&&jsx(se,{open:!!(f&&t?.length),anchorEl:f,placement:h==="left"?"left-start":"right-start",sx:{zIndex:99999,...P},children:jsx(b,{className:"child-dropdown",menuItems:t,placement:h,sx:P,onChildrenChange:o=>{let y=o.every(d=>d.selected);s!==void 0&&!i&&(y&&u({name:r,selected:true}),o.every(d=>!d.selected)&&u({name:r,selected:false}),p(o?.some(d=>d.selected)&&!o.every(d=>!d.selected)&&!y));},onSelect:o=>{C(o,r);}})})]})}var M=memo(ie);function ae({title:e,menuItems:n,onChildrenChange:r,onSelect:t,className:u,updatedList:C,footer:s,header:I,placement:i="right",...h}){let[g,P]=useState({name:"",selected:false}),[f,S]=useState();return useEffect(()=>{S(n);},[n]),useEffect(()=>{if(g.name){let{name:l,selected:a}=g,p=[],w=d=>d?.map(m=>(p.push({name:m.name,selected:a}),{...m,selected:a,...m.menuItems?.length&&{menuItems:w(m.menuItems)}})),y=(d=>d.map(m=>m.name===l?(p.push({name:m.name,selected:a}),{...m,selected:a,...m.menuItems?.length&&{menuItems:w(m.menuItems)}}):m))(f);S(y),C&&C(y),r&&r(y),t&&t(p);}},[g]),jsxs(z,{component:"article",className:`tap-dropdown ${u||""}`,...h,children:[jsx(_,{children:e&&jsx(k,{component:"p",children:e})}),I,jsx(F,{children:f?.map((l,a)=>jsx(M,{setSelected:({name:p,selected:w})=>{P({name:p,selected:w});},onSelect:p=>{t&&t(p);},placement:i,...l},`${l.name}-${a}`))}),s&&s]})}var b=memo(ae);var Y=(e,{menuItemSx:n,menuSx:r})=>(e.forEach(t=>{t.sx={...n,...t.sx},t.menuSx={...r,...t.menuSx},t.menuItems?.length&&Y(t.menuItems,{menuItemSx:n,menuSx:r});}),e);function he({title:e,menuItems:n,onSelect:r,updatedList:t,header:u,placement:C="right",menuItemSx:s={},menuSx:I={},...i}){let h=useMemo(()=>Y(n,{menuItemSx:s,menuSx:I}),[n,s,I]),[g,P]=useState(h),f=Bc(useId(),"nested-dropdown");useEffect(()=>{P(h);},[h]);let S=l=>{let a=w=>w.map(o=>({...o,selected:l.find(y=>o.name===y.name)?.selected??o.selected,...o.menuItems?.length&&{menuItems:a(o.menuItems)}})),p=a(g);P(p),t&&t(p);};return jsx(b,{id:f,"data-testid":"NestedDropdown",placement:C,menuItems:g,title:e,header:u,onSelect:l=>{r&&r(l),S(l);},...i})}var Z=memo(he);var Qe=Z;export{M as a,b,Qe as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p}from'./chunk-
|
|
1
|
+
import {p}from'./chunk-N76O4JDU.js';import {Wa,Bc,cb}from'./chunk-NTNU6XF2.js';import {Sk,ya,xa,wa,Pj}from'./chunk-CZLLJ6SR.js';import {memo,useId}from'react';import C from'@mui/material/Box';import O from'lodash/capitalize';import {useTranslation}from'react-i18next';import {styled}from'@mui/material/styles';import {jsx}from'react/jsx-runtime';var D=styled(C,{shouldForwardProp:o=>o!=="tableMode"})(({theme:o,tableMode:t})=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${o.palette.divider}`,color:o.palette.text.primary,height:Wa(t)?"18px":"24px"}));var e={DESKTOP:wa,PHONE:xa,TABLET:ya,TERMINAL:Sk};var i=o=>!!e[o];function S({type:o,isTextShown:t,tableMode:T,...E}){let p$1=Bc(useId(),"device-icon"),{t:v}=useTranslation(),m=i(o)?e[o]:null;return jsx(p,{title:m?`Device - ${cb((o??"").toLowerCase())}`:v("unKnown"),children:t?jsx(D,{id:p$1,"data-testid":"DeviceIcon",tableMode:T,children:o?O(o):"Unknown"}):jsx(C,{...E,id:p$1,"data-testid":"DeviceIcon",component:"img",src:o?m||Pj:Pj,alt:o})})}var b=memo(S);var X=b;export{e as a,i as b,X as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-N76O4JDU.js';import {g as g$1}from'./chunk-NTNU6XF2.js';import F from'react';import {useTranslation}from'react-i18next';import a from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var T="37px",f=styled(a,{shouldForwardProp:o=>o!=="showBackDrop"&&o!=="areTotalRowsNotFillingHeight"&&o!=="sandboxMode"&&o!=="maximized"})(({theme:o,showBackDrop:i,areTotalRowsNotFillingHeight:r,sandboxMode:p,maximized:n})=>({minHeight:T,...!n&&{borderBottomLeftRadius:o.spacing(1.5),borderBottomRightRadius:o.spacing(1.5)},display:"flex",alignItems:"center",border:"none",justifyContent:"space-between",padding:"6px 32px",background:p?o.palette.common.lightOrange:o.palette.grey[300],backdropFilter:"blur(32px)",boxShadow:i?o.shadows[24]:"none",borderTop:r?`1px outset ${o.palette.grey[800]}`:"none",width:"100%",marginTop:"auto",flexShrink:0,cursor:"move"})),u=styled("div")(({theme:o})=>({position:"absolute",top:0,left:0,right:0,height:"1.5px",backgroundColor:o.palette.grey[300],boxShadow:`inset 0 1px 0 0 ${o.palette.grey[300]}`})),d=styled(a)(({theme:o})=>({borderRadius:"37.5px",border:"0.75px solid rgba(242, 242, 242, 0.70)",backgroundColor:o.palette.common.white,opacity:1,paddingInline:o.spacing(1),display:"flex",alignItems:"center",height:24,gap:"7px",maxWidth:"max-content"})),x=styled(j)(()=>({fontSize:"9px",fontWeight:400,lineHeight:"10.8px"})),g=styled(j)(()=>({fontSize:"10.5px",fontWeight:700,lineHeight:"12.6px"}));styled(a)(()=>({display:"flex",gap:"3px",alignItems:"center"}));styled(a)(()=>({display:"flex",gap:"6px"}));styled("span")(()=>({fontWeight:400}));function R({totalCount:o,showBackDrop:i=false,showSeparator:r,sandboxMode:p,maximized:n,selectedCount:m,...y}){let{t:b}=useTranslation();return jsxs(f,{component:"footer","data-testid":"TableFooter",maximized:n??false,sandboxMode:p,showBackDrop:i,areTotalRowsNotFillingHeight:!!r,...y,children:[r&&jsx(u,{}),m?jsxs(d,{sx:{gap:"6px",cursor:"text"},children:[jsx(x,{children:b("selected")}),jsx(g,{children:g$1(m)})]}):null,o||o===0?jsxs(d,{sx:{gap:"6px",cursor:"text"},children:[jsx(x,{children:b("count")}),jsx(g,{children:g$1(o||0)})]}):null]})}var h=F.memo(R);var M=h;export{T as a,h as b,M as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f as f$1}from'./chunk-
|
|
1
|
+
import {f as f$1}from'./chunk-MWBCSFTX.js';import {styled,Button,Box,alpha}from'@mui/material';var l=t=>({...t.typography.subtitle1,borderRadius:"50px",borderWidth:"1px",borderStyle:"solid",minWidth:"135.11px",height:"32px",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",textTransform:"none",transition:"none",paddingInline:t.spacing(2)}),n=styled(Button,{shouldForwardProp:t=>t!=="statusVariant"})(({theme:t,statusVariant:e})=>({...l(t),...e==="active"?{background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,"&:hover":{background:t.palette.background.gradient.shadedBlue,opacity:.8}}:{backgroundColor:t.palette.common.white,borderColor:t.palette.grey[100],color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.common.white,opacity:.7}}})),u={active:n,inActive:n};styled(Box)(({theme:t,variant:e})=>({borderRadius:"50px",backgroundColor:e==="active"?alpha(t.palette.text.primary,.1):t.palette.grey[100],display:"flex",justifyContent:"center",alignItems:"center",paddingInline:t.spacing(.5),paddingBlock:t.spacing(.25),color:e==="active"?t.palette.common.white:t.palette.text.primary,fontSize:"8px",fontWeight:700,lineHeight:"10px"}));styled("img")(({theme:t,variant:e,icon:a})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(a??"")&&e==="inActive")&&a!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"}));var m=styled("p")(({theme:t})=>({fontSize:"0.6875rem",color:t.palette.background.default,fontStyle:"normal",margin:"auto",textTransform:"capitalize"})),h=styled(f$1)(({theme:t})=>({backgroundColor:"white",boxShadow:t.shadows[21],borderRadius:"0.25rem","& .MuiPaper-root":{borderRadius:"0.25rem",width:"12.5rem"}})),y=styled("span")(()=>({width:"27px",height:"100%",maxHeight:"100%",position:"absolute",top:"0",right:"0",bottom:"0",overflow:"hidden"})),b=styled(Box)(({variant:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"0.5rem",fontWeight:t==="active"?700:400})),f=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%"})),S=styled("img")(({theme:t,variant:e,icon:a})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(a??"")&&e==="inActive")&&a!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"})),v=styled(Box)(({variant:t})=>({width:"14px",height:"14px",display:"flex",alignItems:"center","& img":{width:"14px",height:"14px",filter:t==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"}}));export{u as a,m as b,h as c,y as d,b as e,f,S as g,v as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-N76O4JDU.js';import {Ia,nc}from'./chunk-NTNU6XF2.js';import {forwardRef,memo}from'react';import {styled}from'@mui/material/styles';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var r="os-shared-CurrencyAmount",e={root:`${r}-root`,integer:`${r}-integer`,separator:`${r}-separator`,decimal:`${r}-decimal`};var l=styled(j)(({theme:t})=>{let{fontSize:n,fontWeight:o}=t.v2.typography.textVariants.body.small.bold;return {fontSize:n,fontWeight:o,fontFamily:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:"inherit",display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",overflow:"auto"}}),u=styled("span")(({theme:t})=>({fontWeight:t.v2.typography.fontWeightRegular}));var f=forwardRef(({amount:t,currency:n,id:o,className:C,sx:A,...d},g)=>{let{integerAmount:h,decimalAmount:s}=Ia(t,n??"");return jsxs(l,{ref:g,component:"span",id:o,"data-testid":o??"CurrencyAmount",className:nc(e.root,C),sx:A,...d,children:[jsx("span",{className:e.integer,children:h}),s?jsxs(Fragment,{children:[jsx("span",{className:e.separator,children:"."}),jsx(u,{className:e.decimal,children:s})]}):null]})});f.displayName="CurrencyAmount";var S=memo(f);export{e as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d,r as r$1}from'./chunk-N76O4JDU.js';import {mc,nc}from'./chunk-NTNU6XF2.js';import {Sd,Xe}from'./chunk-CZLLJ6SR.js';import {forwardRef,useMemo,memo}from'react';import {styled}from'@mui/material/styles';import {jsx,Fragment}from'react/jsx-runtime';var N="os-shared-Logo",r={root:`${N}-root`,skeleton:`${N}-skeleton`},C="logo";var I=styled(d)(({theme:n})=>({borderRadius:"50%",backgroundColor:n.palette.common.white}));var R=forwardRef(({className:n,sx:f,id:s,src:o,width:g=24,height:l=24,isError:e,isLoading:S,fallback:t,alt:P=C},U)=>{let m=useMemo(()=>typeof o!="string"&&!!o?.type?.includes("application/pdf"),[o]),d=useMemo(()=>o?typeof o=="string"?o:(window.URL?URL:webkitURL).createObjectURL(o):"",[o]),w=useMemo(()=>e||!o?typeof t=="string"&&t?t:Sd:m?Xe:d,[o,t,e,m,d]);return S?jsx(r$1,{variant:"circular",className:r.skeleton,sx:mc({width:g,height:l,flexShrink:0},f),"data-testid":s??"Logo"}):(e||!o)&&t!==void 0&&typeof t!="string"?jsx(Fragment,{children:t}):jsx(I,{ref:U,id:s,"data-testid":s??"Logo",alt:P,src:w,className:nc(r.root,n),sx:mc({width:g,height:l,objectFit:m&&o&&!e?"none":"contain"},f)})});R.displayName="Logo";var D=memo(R);export{r as a,D as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-N76O4JDU.js';import {nc}from'./chunk-NTNU6XF2.js';import {if as _if}from'./chunk-CZLLJ6SR.js';import {forwardRef,memo}from'react';import {styled,Box}from'@mui/material';import {jsxs,jsx}from'react/jsx-runtime';var a="os-shared-ErrorToast",t={root:`${a}-root`,message:`${a}-message`,icon:`${a}-icon`};var i=styled(Box,{shouldForwardProp:o=>o!=="toastPosition"})(({theme:o,toastPosition:r})=>({width:160,position:"absolute",bottom:12,zIndex:1e3,display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:o.v2.palette.background.primary,height:31,gap:o.v2.spacing(8),borderRadius:o.v2.radius(8),borderWidth:1,padding:o.v2.spacing(8),border:`1px solid ${o.v2.palette.border.default}`,boxShadow:"0px 0px 16px 0px #00000014",animation:"slideIn 0.5s ease-out",...r==="bottom-center"&&{left:"50%",transform:"translateX(-50%)"},...r==="bottom-right"&&{right:12,transform:"none"},...r==="bottom-left"&&{left:12,transform:"none"},"@keyframes slideIn":{"0%":{opacity:0,transform:r==="bottom-center"?"translate(-50%, 100%)":r==="bottom-right"?"translateX(100%)":"translateX(-100%)"},"100%":{opacity:1,transform:r==="bottom-center"?"translate(-50%, 0)":"translateX(0)"}}})),l=styled("img")({cursor:"pointer"});var c=forwardRef(({message:o="Something went wrong",onRetry:r,position:f="bottom-center",id:e,className:T,sx:y,...g},x)=>jsxs(i,{ref:x,...g,className:nc(t.root,T),sx:y,id:e,"data-testid":e??"ErrorToast",toastPosition:f,children:[jsx(j,{component:"p",textVariant:"body.small.medium",noWrap:true,className:t.message,children:o}),jsx(l,{className:t.icon,onClick:b=>r?.(b),src:_if,alt:"toast-icon"})]}));c.displayName="ErrorToast";var N=memo(c);export{t as a,N as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {p,B,d,r}from'./chunk-
|
|
1
|
+
import {p,B,d,r}from'./chunk-N76O4JDU.js';import {n}from'./chunk-DQGA7KCO.js';import {_b,Bc,Mb}from'./chunk-NTNU6XF2.js';import {We,im,_e,Jj,Ye,Ze}from'./chunk-CZLLJ6SR.js';import {memo,useCallback,useState,useId,useReducer,useEffect}from'react';import {useTranslation}from'react-i18next';import {motion,AnimatePresence}from'framer-motion';import Vo from'@mui/material/CircularProgress';import U from'@mui/material/LinearProgress';import Qo from'@mui/material/Popper';import $ from'dayjs';import {styled,Box,alpha,CircularProgress}from'@mui/material';import {jsxs,jsx}from'react/jsx-runtime';import {styled as styled$1}from'@mui/material/styles';var no=styled(motion.div,{shouldForwardProp:o=>!["notificationState","open","loading","ready","failed"].includes(o)})(({theme:o,notificationState:n,open:a,loading:r,ready:p,failed:t})=>({position:"relative",border:`1px solid ${o.palette.divider}`,padding:"0 8px",height:32,borderRadius:"4px",display:"flex",alignItems:"center",overflow:"hidden",fontSize:"11px",fontWeight:500,color:o.palette.text.primary,transition:"width 2s ease-in-out",cursor:"pointer",...(n?.success||n?.failed)&&!r&&!p&&!t&&{"&:after":{content:'""',width:7,height:7,backgroundColor:n?.failed?o.palette.common.red:o.palette.success.dark,borderRadius:"50%",position:"absolute",top:5,border:`1px solid ${o.palette.common.white}`,right:6}},...a&&{border:`1px solid ${o.palette.info.dark}`,boxShadow:o.shadows[7]}})),io=styled(Box)(()=>({position:"relative"})),ao=styled(Box)(({theme:o})=>({background:o.palette.common.white,boxShadow:o.shadows[9],borderRadius:"4px",marginTop:"8px"})),po=styled(Box)(({theme:o})=>({background:o.palette.background.transparent[2],backdropFilter:"blur(2px)",color:o.palette.text.primary,fontSize:"11px",fontWeight:500,height:31,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",overflow:"hidden",borderBottomLeftRadius:"4px",borderBottomRightRadius:"4px"})),so=styled(Box)(({theme:o})=>({display:"flex",alignItems:"center",gap:"8px",padding:"5.5px 8px",minHeight:48,height:"auto",borderBottom:`1px solid ${o.palette.divider}`,cursor:"pointer","&:hover":{boxShadow:o.shadows[3]}})),lo=styled("img")(()=>({width:16,height:16,objectFit:"contain",flexShrink:0,display:"block"})),co=styled(Box)(()=>({display:"flex",flexDirection:"column",gap:"2px"})),mo=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between",flex:1})),uo=styled(Box)(({theme:o})=>({fontSize:"11px",color:o.palette.text.primary,fontWeight:500,wordBreak:"break-all",paddingInlineEnd:"8px"})),fo=styled(Box)(({theme:o})=>({fontSize:"9px",color:o.palette.text.textSecondary,fontWeight:600})),go=styled(Box)(({theme:o})=>({display:"flex",alignItems:"center",gap:"8px",height:32,padding:"4px 8px",borderBottom:`1px solid ${o.palette.divider}`,cursor:"pointer","&:hover":{boxShadow:o.shadows[3]}})),xo=styled(Box)(({theme:o})=>({fontSize:"11px",color:o.palette.text.primary,fontWeight:400,textTransform:"uppercase"})),T=styled(Box)(({theme:o})=>({borderTop:`2px solid ${o.palette.divider}`})),M=styled(Box)(({theme:o})=>({position:"absolute",bottom:0,right:0,left:0,".MuiLinearProgress-root":{backgroundColor:o.palette.divider,height:2},".MuiLinearProgress-bar":{background:o.palette.background.gradient.shadedBlue},"&.done .MuiLinearProgress-bar":{background:o.palette.success.dark},"&.failed .MuiLinearProgress-bar":{background:o.palette.common.red}})),u=styled(Box)(({theme:o})=>({display:"flex",alignItems:"center",gap:"8px",".MuiCircularProgress-root":{width:"14px !important",height:"14px !important",display:"flex"},".MuiCircularProgress-circle":{strokeWidth:"1.017px",stroke:alpha(o.palette.common.black,.62)}})),I=styled(Box)(()=>({position:"relative"})),P=styled(Box)(({theme:o})=>({position:"absolute",color:o.palette.common.black,fontSize:"7.875px",fontWeight:700,width:14,height:14,display:"flex",alignItems:"center",justifyContent:"center"})),k=styled("img")(()=>({width:14,height:14})),Do=styled(Box)(()=>({display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",padding:"8px"}));var yo=o=>{let n=new Date,a=$(o).isSame(n,"year"),r={sameDay:"DD MMM, YYYY",nextDay:"DD MMM, YYYY",lastDay:"DD MMM, YYYY",sameElse:"DD MMM, YYYY",lastWeek:"DD MMM, YYYY",nextWeek:"DD MMM, YYYY"};return a&&(r={sameDay:"DD MMM",nextDay:"DD MMM",lastDay:"DD MMM",sameElse:"DD MMM",lastWeek:"DD MMM",nextWeek:"DD MMM"}),$(o).calendar(null,r)},Ro=(o,n)=>{let a=new Date().toISOString().split("T")[0],r=n??`file_${a}`,t=/\.(xlx|xlsx|csv|txt|doc|docx|pdf|jpg|png|gif|zip|rar)$/i.exec(o),c=t?t[0]:".csv";return `${r}${c}`};var A={loading:false,success:false,error:null},Wo=(o=A,n)=>{switch(n.type){case "RESET":return A;case "LOADING":return {...o,loading:true};case "SUCCESS":return {...o,success:true};case "ERROR":return {...o,error:n.error};default:return o}},C=({onDownload:o})=>{let n$1=n(),[{loading:a,error:r,success:p},t]=useReducer(Wo,A),c=useCallback(()=>t({type:"LOADING"}),[]),m=useCallback(()=>t({type:"SUCCESS"}),[]),D=useCallback(l=>t({type:"ERROR",error:l}),[]),h=useCallback(()=>t({type:"RESET"}),[]);useEffect(()=>{(p||r)&&setTimeout(()=>{h();},3e3);},[p,r,h]);let L=useCallback(()=>{o&&(c(),o().then(l=>{m(),Mb(l.url,Ro(l.result_file,l.id));}).catch(l=>{D(l),n$1.error(l?.response?.data?.error?.message||l?.message||"Failed to download report");}));},[o,c,m,D]);return {loading:a,error:r,success:p,handleDownloadReport:L}};function No({onDownload:o}){let{loading:n,error:a,success:r,handleDownloadReport:p}=C({onDownload:o});return n?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(u,{children:jsxs(I,{children:[jsx(P,{children:"1"}),jsx(CircularProgress,{})]})})}):r?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(u,{children:jsx(k,{src:_e,alt:"done"})})}):a?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(u,{children:jsx(k,{src:Jj,alt:"failed"})})}):jsx(k,{onClick:p,src:Ye,alt:"reports"})}var Y=No;function O(){return jsxs(Do,{children:[jsx(r,{width:"16px",height:"16px",variant:"rectangular"}),jsx(r,{width:"100%",variant:"text"}),jsx(r,{width:"12px",height:"12px",variant:"circular"})]})}function Uo({reports:o,isLoading:n=false,onDownloadReport:a}){let r=useCallback(t=>a?a(t):Promise.reject(new Error("No download report function provided")),[a]),p=o.map(t=>{let c=$(t.created_at).isBefore($().subtract(1,"day")),m=_b(t.result_file);return jsxs(so,{children:[jsx(lo,{src:m,alt:"download"}),jsxs(mo,{children:[jsxs(co,{children:[jsx(uo,{children:t.result_file}),jsx(fo,{children:c?yo(new Date(t.created_at)):$(new Date(t.created_at)).fromNow()})]}),jsx(Y,{onDownload:()=>r(t.id)})]})]},t.id)});return n?jsxs(T,{children:[jsx(O,{}),jsx(O,{})]}):jsx(T,{children:p})}var ho=memo(Uo);function Jo(o){let{progress:n,reportsQueryResult:a,isStatusReady:r,isStatusFailed:p$1,isLoading:t,notificationState:c,onOpenDropdown:m,onRequestReportFile:D,onOpenReportsApp:h,hideOpenReportsApp:L=false,onDownloadReport:l,customContent:Mo}=o,[H,G]=useState(null),{t:w}=useTranslation(),E=!!H,{data:Io,isLoading:Po}=a,ko=useCallback(F=>{t||r||(m?.(),G(F.currentTarget));},[t,r,m]),y=useCallback(()=>{G(null);},[]),Co=useCallback(()=>{t||(y(),D?.());},[t,y,D]),Bo=F=>{F.stopPropagation(),h?.(),y();},Lo=()=>t?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(u,{children:[jsxs(I,{children:[jsx(P,{children:"1"}),jsx(Vo,{})]}),jsx("span",{children:w("preparing")}),jsx(M,{children:jsx(U,{variant:"determinate",value:n})})]})}):r?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(u,{children:[jsx("img",{src:_e,alt:"done"}),jsx("span",{children:w("ready")}),jsx(M,{className:"done",children:jsx(U,{variant:"determinate",value:100})})]})}):p$1?jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxs(u,{children:[jsx("img",{src:Jj,alt:"failed"}),jsx("span",{children:w("failed")}),jsx(M,{className:"failed",children:jsx(U,{variant:"determinate",value:100})})]})}):jsx("img",{src:Ze,alt:"reports"});return jsxs(io,{"data-testid":"TableReports_ReportsWrapper",children:[jsx(AnimatePresence,{children:jsx(p,{title:w("reports"),children:jsx(no,{"data-testid":"TableReports_ExportButton",onClick:ko,notificationState:c,open:E,loading:t,ready:r,failed:p$1,sx:{...(t||r||p$1)&&{borderBottom:"none"}},initial:{width:"auto"},transition:{duration:.25},children:Lo()})})}),E&&jsx(B,{onClick:y}),jsx(Qo,{open:E,anchorEl:H,placement:"bottom-end",children:jsxs(ao,{sx:{width:208},children:[Mo?.({closeDropdown:y})??jsxs(go,{onClick:Co,children:[jsx("img",{src:We,alt:"download"}),jsx(xo,{children:"csv"})]}),jsx(ho,{reports:Io?.reports??[],isLoading:Po,onDownloadReport:l}),!L&&jsx(po,{onClick:Bo,children:w("openReportsApp")})]})})]})}var bo=memo(Jo);var vo=styled$1(motion.div)(({theme:o})=>({display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",width:54,height:18,backgroundColor:"#1F88D0",borderRadius:"2px",fontSize:"8px",fontWeight:600,color:o.palette.common.white}));function nt({onDownload:o}){let n=Bc(useId(),"download-button"),{loading:a,error:r,success:p,handleDownloadReport:t}=C({onDownload:o}),{t:c}=useTranslation(),m=!a&&!r&&!p;return jsx(vo,{id:n,"data-testid":"DownloadButton",onClick:t,children:jsxs(AnimatePresence,{mode:"wait",initial:false,children:[a&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{display:"flex",alignItems:"center"},children:jsx(Vo,{size:"10px",sx:{color:"rgba(255, 255, 255, 0.62)"}})},"loading"),!!r&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsx(d,{src:im,sx:{width:"auto",height:"auto"},alt:"error"})},"error"),m&&jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:c("download")},"text")]})})}var So=memo(nt);var at=So;var fe=bo;export{C as a,Y as b,at as c,fe as d};
|