@tap-payments/os-micro-frontend-shared 0.3.204 → 0.3.206-test.1
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-23U364TN.js +15 -0
- package/build/_chunks/chunk-2K7FRRCP.js +1 -0
- package/build/_chunks/{chunk-XRPWK6RS.js → chunk-2RBU3WZ4.js} +1 -1
- package/build/_chunks/{chunk-KSUB7D4I.js → chunk-2VS35WT4.js} +1 -1
- package/build/_chunks/{chunk-XFKIRVNC.js → chunk-3352EIHQ.js} +1 -1
- package/build/_chunks/{chunk-6PC37PPT.js → chunk-34DUFFV5.js} +1 -1
- package/build/_chunks/{chunk-QIXGNSMS.js → chunk-3JDO4H7Q.js} +1 -1
- package/build/_chunks/{chunk-FUHQHDFU.js → chunk-3XNXNKGA.js} +1 -1
- package/build/_chunks/{chunk-LVMXAYG4.js → chunk-3ZQC3MDU.js} +1 -1
- package/build/_chunks/{chunk-TPW4MNF2.js → chunk-42BRQZI3.js} +1 -1
- package/build/_chunks/{chunk-4WRWJH73.js → chunk-4QFJRJGW.js} +1 -1
- package/build/_chunks/{chunk-2VUXVEP7.js → chunk-4W4V45ZR.js} +1 -1
- package/build/_chunks/{chunk-RZQR6OKW.js → chunk-4WHJ7C3Y.js} +1 -1
- package/build/_chunks/{chunk-IVDDMAXY.js → chunk-67EIV5FM.js} +1 -1
- package/build/_chunks/{chunk-IK4ZSYGL.js → chunk-6NTTIIW2.js} +1 -1
- package/build/_chunks/{chunk-SSNINCVE.js → chunk-7HRMITJB.js} +1 -1
- package/build/_chunks/{chunk-PHFROICE.js → chunk-A4SRSOLM.js} +1 -1
- package/build/_chunks/{chunk-YK63ONAG.js → chunk-AFMJ46QZ.js} +1 -1
- package/build/_chunks/chunk-CB7QJIZT.js +1 -0
- package/build/_chunks/{chunk-6JTFF3VW.js → chunk-CJBK6DV4.js} +1 -1
- package/build/_chunks/{chunk-MUIVC4CL.js → chunk-CN452QD3.js} +1 -1
- package/build/_chunks/{chunk-HGQNAGSV.js → chunk-CWX3YQHY.js} +1 -1
- package/build/_chunks/{chunk-HTLKVSJT.js → chunk-D5DOI2CG.js} +1 -1
- package/build/_chunks/{chunk-UWRIO72X.js → chunk-DILHFFYM.js} +1 -1
- package/build/_chunks/chunk-EHKI2PGC.js +1 -0
- package/build/_chunks/chunk-ES5ERGO6.js +1 -0
- package/build/_chunks/{chunk-P2H74WSQ.js → chunk-F3BU4KEC.js} +1 -1
- package/build/_chunks/{chunk-SCP6HRIN.js → chunk-FINICJL3.js} +1 -1
- package/build/_chunks/{chunk-7S3N5ORJ.js → chunk-FIYSYENR.js} +1 -1
- package/build/_chunks/{chunk-64UZTZD2.js → chunk-FPR4MUXK.js} +1 -1
- package/build/_chunks/{chunk-2SEM6V2E.js → chunk-GBJOORSO.js} +1 -1
- package/build/_chunks/{chunk-ATIIYEYN.js → chunk-GJCU6ZVE.js} +1 -1
- package/build/_chunks/{chunk-XGQCJ7GJ.js → chunk-HXIYFSTZ.js} +1 -1
- package/build/_chunks/{chunk-4IYJOL5M.js → chunk-IRTMCMMM.js} +1 -1
- package/build/_chunks/chunk-JCOA42LB.js +1 -0
- package/build/_chunks/chunk-JCWLHRJH.js +1 -0
- package/build/_chunks/{chunk-L6IHJID2.js → chunk-JKOG6QAB.js} +1 -1
- package/build/_chunks/{chunk-3JVG47JU.js → chunk-JQV74CFY.js} +1 -1
- package/build/_chunks/{chunk-B7FSN6KR.js → chunk-K3VCY2Z7.js} +1 -1
- package/build/_chunks/{chunk-UWN3X5YM.js → chunk-K7BX77NR.js} +1 -1
- package/build/_chunks/{chunk-OLWGUR2Y.js → chunk-KGJKMOL6.js} +1 -1
- package/build/_chunks/{chunk-KOPV7LFW.js → chunk-LGIGA7B2.js} +1 -1
- package/build/_chunks/{chunk-J7YLPBTX.js → chunk-MVPNFQCV.js} +1 -1
- package/build/_chunks/{chunk-4VFYFG3T.js → chunk-MW3S7RYL.js} +1 -1
- package/build/_chunks/chunk-MWDLX22N.js +1 -0
- package/build/_chunks/{chunk-P76XOTCB.js → chunk-OGFZTWW2.js} +1 -1
- package/build/_chunks/{chunk-IY2CABAN.js → chunk-OQXHFUUW.js} +1 -1
- package/build/_chunks/{chunk-IUQKBIXU.js → chunk-PDRNFDWB.js} +1 -1
- package/build/_chunks/{chunk-Z3FZSJZZ.js → chunk-PIVDC3CV.js} +1 -1
- package/build/_chunks/{chunk-RWAHMAFU.js → chunk-PYBAY4RD.js} +1 -1
- package/build/_chunks/{chunk-JGEMCA56.js → chunk-QCWTNVJS.js} +1 -1
- package/build/_chunks/{chunk-UKFKZVCU.js → chunk-RCTRSOJN.js} +1 -1
- package/build/_chunks/{chunk-PTLDMQUB.js → chunk-RJGHAJAS.js} +1 -1
- package/build/_chunks/{chunk-TFM77CT6.js → chunk-RQRTDUVJ.js} +1 -1
- package/build/_chunks/{chunk-MOX5HIJO.js → chunk-SLOXJ5HL.js} +1 -1
- package/build/_chunks/chunk-T7VGACSG.js +1 -0
- package/build/_chunks/{chunk-FCPQ7FTN.js → chunk-TCP65H54.js} +1 -1
- package/build/_chunks/chunk-TR3VV66O.js +2 -0
- package/build/_chunks/{chunk-EKVX2K2J.js → chunk-TYUXEDNW.js} +1 -1
- package/build/_chunks/{chunk-DWGQIGE4.js → chunk-U4TG6SH2.js} +1 -1
- package/build/_chunks/{chunk-LV5UGVUC.js → chunk-UDDOFJHJ.js} +1 -1
- package/build/_chunks/{chunk-T6KF6EB7.js → chunk-UPTSWYDF.js} +1 -1
- package/build/_chunks/{chunk-BOQMO6XZ.js → chunk-VAXOBYQH.js} +1 -1
- package/build/_chunks/{chunk-ALEWQKNK.js → chunk-VKHUWB7W.js} +1 -1
- package/build/_chunks/{chunk-MIWTFNVW.js → chunk-VS4GPQTT.js} +1 -1
- package/build/_chunks/{chunk-FWVZQRRW.js → chunk-VSI64YFN.js} +1 -1
- package/build/_chunks/{chunk-HFSQR3AV.js → chunk-WA2NAHKX.js} +1 -1
- package/build/_chunks/chunk-WF2OFWBH.js +1 -0
- package/build/_chunks/{chunk-RQEAA45J.js → chunk-X4RPIJQQ.js} +1 -1
- package/build/_chunks/{chunk-XGZGBCXK.js → chunk-XB6KSBAO.js} +1 -1
- package/build/_chunks/{chunk-HKH2SAJZ.js → chunk-YOFP6Q2H.js} +1 -1
- package/build/_chunks/{chunk-GRRYGOCE.js → chunk-YSMDH3WQ.js} +1 -1
- package/build/_chunks/{chunk-MMEZVNEQ.js → chunk-Z3B4EDSN.js} +1 -1
- package/build/_chunks/{chunk-2OTSLKKQ.js → chunk-ZHEAWCTY.js} +1 -1
- package/build/components/ActionMenu/index.js +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/ActivityAreaChart/index.js +1 -1
- package/build/components/AmountInput/index.js +1 -1
- package/build/components/AnimatedSpinnerIcon/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/Autocomplete/index.js +1 -1
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/ChipStack/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CountryFlag/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/CustomBackdrop/index.js +1 -1
- package/build/components/Customer/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/Discount/index.js +1 -1
- package/build/components/DisplayAmount/index.js +1 -1
- package/build/components/Dropdown2/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/EmptyState/EmptyState.d.ts +4 -0
- package/build/components/EmptyState/constants.d.ts +13 -0
- package/build/components/EmptyState/index.d.ts +3 -0
- package/build/components/EmptyState/index.js +1 -0
- package/build/components/EmptyState/style.d.ts +7 -0
- package/build/components/EmptyState/type.d.ts +17 -0
- package/build/components/Error/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FileUpload/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/FlippingCard/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/Input/index.js +1 -1
- package/build/components/InputBase/SelectBase/SelectBase.d.ts +4 -0
- package/build/components/InputBase/index.js +1 -1
- package/build/components/InputNumber/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LeftPeekRightExpandingChip/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/ListLayout/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/MFWidgetLoader/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MerchantCurrencyDropdown/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MerchantsDropdown/index.js +1 -1
- package/build/components/MultiSelectDropdownButton/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/NestedMultiSelect/index.js +1 -1
- package/build/components/NoInternet/index.js +1 -1
- package/build/components/OpenFileInNewTab/index.js +1 -1
- package/build/components/PartnersFilter/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RFH/Inputs/FormSelect/FormSelectSelectMenu.d.ts +2 -1
- package/build/components/RFH/Inputs/FormSelect/type.d.ts +7 -1
- package/build/components/RFH/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/ReceiptsViewer/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
- package/build/components/SalesChannelFilter/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchListInput/index.js +1 -1
- package/build/components/SelectDropdown/index.js +1 -1
- package/build/components/SheetViewChip/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/Timeline/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/ToggleView/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VAT/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/WindowAppIcon/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.d.ts +1 -6
- package/build/components/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -1
- package/build/utils/reactKeys.d.ts +12 -0
- package/package.json +2 -2
- package/build/_chunks/chunk-36PFADPE.js +0 -1
- package/build/_chunks/chunk-3MDX5OYC.js +0 -1
- package/build/_chunks/chunk-52PIMKF7.js +0 -1
- package/build/_chunks/chunk-EILZ7V32.js +0 -1
- package/build/_chunks/chunk-K5DZ7DWN.js +0 -1
- package/build/_chunks/chunk-L4MAU66Y.js +0 -1
- package/build/_chunks/chunk-N5Z6J4PU.js +0 -2
- package/build/_chunks/chunk-R4DKHM5B.js +0 -15
- package/build/_chunks/chunk-RGAQ3SMH.js +0 -1
- package/build/_chunks/chunk-WVIZJXME.js +0 -1
- package/build/_chunks/chunk-Y3D6D36R.js +0 -1
- package/build/_chunks/chunk-YVGH7DI7.js +0 -1
- package/build/_chunks/chunk-ZQ6GJ4H5.js +0 -1
- package/build/components/AmountConversionFilter/AmountConversionFilter.d.ts +0 -20
- package/build/components/AmountConversionFilter/MultiSelectCurrencyFilter.d.ts +0 -10
- package/build/components/AmountConversionFilter/index.d.ts +0 -1
- package/build/components/AmountConversionFilter/index.js +0 -1
- package/build/components/AmountConversionFilter/style.d.ts +0 -19
- package/build/components/AmountSlider/AmountSlider.d.ts +0 -18
- package/build/components/AmountSlider/index.d.ts +0 -2
- package/build/components/AmountSlider/index.js +0 -1
- package/build/components/AmountSlider/style.d.ts +0 -25
- package/build/components/CardEmptyState/CardEmptyState.d.ts +0 -3
- package/build/components/CardEmptyState/index.d.ts +0 -3
- package/build/components/CardEmptyState/index.js +0 -1
- package/build/components/CardEmptyState/style.d.ts +0 -7
- package/build/components/CardEmptyState/type.d.ts +0 -5
- package/build/components/CurrencyFilter/CurrencyFilter.d.ts +0 -11
- package/build/components/CurrencyFilter/index.d.ts +0 -1
- package/build/components/CurrencyFilter/index.js +0 -1
- package/build/components/LanguageDropdown/LanguageDropdown.d.ts +0 -7
- package/build/components/LanguageDropdown/index.d.ts +0 -2
- package/build/components/LanguageDropdown/index.js +0 -1
- package/build/components/LanguageDropdown/style.d.ts +0 -6
- package/build/components/ResizableHeightInput/ResizableHeightInput.d.ts +0 -11
- package/build/components/ResizableHeightInput/index.d.ts +0 -2
- package/build/components/ResizableHeightInput/index.js +0 -1
- package/build/components/ResizableHeightInput/style.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import {zc}from'./chunk-
|
|
1
|
+
import {zc}from'./chunk-ZHEAWCTY.js';import {Nj,j,m as m$1}from'./chunk-M5HS3EYQ.js';import {memo,useId}from'react';import d from'@mui/material/Box';import {jsx}from'react/jsx-runtime';function g({countryCode:o,currencyCode:t,...n}){let l=zc(useId(),"country-flag");return jsx(d,{...n,id:l,"data-testid":"CountryFlag",component:"img",src:o&&j(o)||t&&m$1(t)||Nj,width:n.width||16,alt:o??t??"flag",loading:"lazy",onError:u=>{u.currentTarget.src=Nj;}})}g.displayName="CountryFlag";var m=memo(g);var h=m;export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j,b,d as d$1,n}from'./chunk-
|
|
1
|
+
import {j,b,d as d$1,n}from'./chunk-XB6KSBAO.js';import {Wb,zc}from'./chunk-ZHEAWCTY.js';import {Bj,Cj,Ij,Oe as Oe$1}from'./chunk-M5HS3EYQ.js';import {forwardRef,useState,useImperativeHandle,useEffect,useMemo,memo,useId}from'react';import {Button}from'@mui/material';import p from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {useTranslation}from'react-i18next';import {useDropzone}from'react-dropzone';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var G=styled(p)(()=>({textAlign:"center",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"32px"})),u=styled(p)(()=>({paddingInline:"40px"})),d=styled(j,{shouldForwardProp:e=>e!=="isError"})(({theme:e,isError:i})=>({color:i?"#FF2000":e.v2.palette.base.black,fontSize:"18px",fontWeight:600,lineHeight:"20px",marginBottom:"8px"})),J=styled(p)(({theme:e})=>({color:e.palette.text.primary,fontSize:"12px",fontWeight:500,lineHeight:"20px",padding:"4px 12px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,cursor:"pointer"})),g=styled(j)(({theme:e})=>({color:alpha(e.v2.palette.base.black,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"})),F=styled(p,{shouldForwardProp:e=>e!=="width"})(({theme:e,width:i})=>({width:i||431,minHeight:176,border:`1px dashed ${e.palette.secondary.light}`,borderRadius:"8px",padding:"24px 0",display:"flex",alignItems:"center",justifyContent:"center"})),h=styled(p)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"24px",color:e.palette.text.primary,fontSize:"14px",lineHeight:"20px",cursor:"default"})),K=styled("span")(()=>({fontWeight:600,textDecorationLine:"underline",cursor:"pointer"})),w=styled(p)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",color:e.palette.text.primary})),z=styled(p)(({theme:e})=>({color:alpha(e.palette.text.primary,.7),fontSize:"12px",fontWeight:500,lineHeight:"20px"})),O=styled(Button)(({theme:e,disabled:i})=>({borderRadius:"4px",minWidth:"105px",background:i?alpha(e.palette.info.dark,.4):e.palette.info.dark,color:e.palette.common.white,padding:"4px 8px",fontSize:"9px",fontWeight:600,height:"32px",display:"flex",alignItems:"center",justifyContent:"center",textTransform:"none","&:hover":{background:e.palette.info.dark,opacity:.8},"&.Mui-disabled":{color:e.palette.common.white}})),Q=styled(p)(()=>({display:"flex",gap:"8px",justifyContent:"center",alignItems:"center",padding:"6px",boxShadow:"0px 4px 40px 0px rgba(0, 0, 0, 0.19)",borderRadius:"4px"}));var Y=forwardRef(({accept:e,footer:i,options:x,isCreateLoading:U,progress:oe,error:R,errorHint:te,subtitleComponent:S,isSuccess:P,onConfirm:re,isSendDisabled:ie,errorActionComponent:le,title:l,width:b$1,successFooter:pe,progressVariant:ae},ne)=>{let{t:a}=useTranslation(),[n$1,H]=useState([]),{getRootProps:de,getInputProps:se,open:f,acceptedFiles:v,isDragReject:j,fileRejections:s}=useDropzone(x);useImperativeHandle(ne,()=>({open:f}),[f]),useEffect(()=>{H(v);},[v]);let B=Wb(x?.maxSize||0,0).toUpperCase(),c=useMemo(()=>{let ce=s.length&&s[0].errors.some(k=>k.code==="file-invalid-type"),me=s.length&&s[0].errors.some(k=>k.code==="file-too-large");return j||ce?a("invalidFileType"):me?`File is larger than ${B}`:R},[j,R,s,B,a]),C=useMemo(()=>n$1.length?jsxs(w,{sx:{fontWeight:600},children:[jsx(p,{children:n$1[0].name}),jsx(z,{children:Wb(n$1[0].size)})]}):null,[n$1]);return P&&n$1.length&&!U?jsxs(Fragment,{children:[jsxs(u,{children:[typeof l=="string"?jsx(d,{children:l}):l??jsx(d,{children:"File uploaded"}),S]}),jsx(F,{width:b$1,children:jsxs(h,{children:[P&&jsx(p,{component:"img",src:Bj,width:56,height:56}),C]})}),pe??jsxs(Q,{children:[jsx(b,{variant:"secondary",size:"md",icon:jsx(d$1,{src:Cj,alt:"delete"}),onClick:()=>{H([]);},"aria-label":"delete"}),jsx(O,{disabled:ie,onClick:()=>{re?.(n$1);},children:"Bulk Send"})]})]}):U&&n$1.length?jsxs(Fragment,{children:[jsxs(u,{children:[l&&typeof l!="string"?l:jsxs(Fragment,{children:[jsx(d,{children:l??a("uploading")}),jsx(g,{children:a("wait")})]}),S]}),jsx(F,{width:b$1,children:jsxs(h,{children:[U&&jsx(n,{size:56,value:oe,variant:ae??"determinate"}),C]})}),i]}):jsxs(Fragment,{children:[jsxs(u,{children:[c?jsx(d,{isError:true,children:c}):typeof l=="string"?jsx(d,{children:l}):l??jsx(d,{children:a("uploadBulkFile")}),S||!!c&&jsx(g,{children:"Supported formats: xls, xlxs"})]}),jsxs(F,{width:b$1,...de(),children:[jsx("input",{...se()}),jsxs(h,{"data-slot":"content",children:[jsx(p,{component:"img",src:c?Ij:Oe$1,width:56,height:56}),te,C,c?jsx(Fragment,{children:le||jsx(J,{onClick:f,children:a("uploadAgain")})}):jsxs(w,{children:[jsxs(p,{children:[jsx(K,{onClick:f,children:"Click to upload"})," or drag and drop"]}),jsxs(z,{children:["Maximum file size ",B]}),e&&jsx(g,{children:a("supportedFormats",{accept:e})})]})]})]}),i]})});Y.displayName="FileUploadBase";var Z=memo(Y);var L=forwardRef((e,i)=>{let x=zc(useId(),"file-upload");return jsx(G,{id:x,"data-testid":"FileUpload","data-slot":"file-upload-wrapper",children:jsx(Z,{...e,ref:i})})});L.displayName="FileUpload";var ee=memo(L);var Oe=ee;export{Oe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZONDSLTR.js';import {p}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-ZONDSLTR.js';import {p}from'./chunk-XB6KSBAO.js';import {zc,f as f$1}from'./chunk-ZHEAWCTY.js';import {mb}from'./chunk-M5HS3EYQ.js';import {useId}from'react';import {useTranslation}from'react-i18next';import {jsx,jsxs}from'react/jsx-runtime';var m=t=>({start:{x:t*6,transition:{duration:.3,type:"tween",ease:"easeIn"}},animate:{x:t*39,transition:{duration:.3,type:"tween",ease:"easeOut"}}});var d=({children:t})=>jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2px"},children:t});function f({value:t,index:e}){let s=zc(useId(),"rating-count"),{t:u}=useTranslation();return jsx(p,{title:u("totalPaymentCount",{amount:f$1(t)}),wrapperProps:{display:"inline-flex"},children:jsx(a,{id:s,order:e,variants:m(e),"data-testid":"RatingCount",children:jsxs(d,{children:[jsx("img",{src:mb,alt:"star",style:{width:"10px",height:"10px"}})," ",(t||0)>1&&jsx("span",{style:{fontSize:"9.782px"},children:t})]})})})}export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f as f$1}from'./chunk-
|
|
1
|
+
import {f as f$1}from'./chunk-VAXOBYQH.js';import {a as a$1}from'./chunk-FIYSYENR.js';import {a as a$2}from'./chunk-K3VCY2Z7.js';import {a,f,e}from'./chunk-3JDO4H7Q.js';import {z as z$1}from'./chunk-XB6KSBAO.js';import {Ka,g,zc}from'./chunk-ZHEAWCTY.js';import {Cb}from'./chunk-M5HS3EYQ.js';import {memo,useRef,useMemo,useCallback,useId,useState}from'react';import {styled,Typography,Box,Popper}from'@mui/material';import {useTranslation}from'react-i18next';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var O=styled(Typography)(()=>({display:"block",textAlign:"center",fontSize:"10px",fontWeight:500,color:"#8D8D94",padding:"24px 0"})),A=styled(Box,{shouldForwardProp:t=>t!=="isDisabled"})(({isDisabled:t})=>({display:"flex",justifyContent:"space-between",alignItems:"center",gap:"4px",...t&&{"& img":{opacity:.3}}}));var tt=memo(t=>{let{variant:e$1="inActive",badgeCount:o,label:r,...n}=t,s=useRef(null),m=useMemo(()=>!o||Number.isNaN(Ka(o))?null:jsx(z$1,{color:"inactive",children:g(Number(o))}),[o]),a$1=useCallback(p=>{p.stopPropagation(),t?.onClick?.(p);},[t]),l=a[e$1];return jsx(l,{"data-testid":"MultiSelectStatusButton",...n,ref:s,onClick:a$1,statusVariant:e$1,children:jsx(f,{children:jsxs(e,{variant:e$1,children:[r,m]})})})}),W=tt;function V(t){let e=new Set;return t.filter(o=>e.has(o.value)?false:(e.add(o.value),true))}function h(t,e){let o=e.toLowerCase();return t.reduce((r,n)=>{if(n.options?.length){let s=h(n.options,e);s.length&&r.push({...n,options:s});}else (n.placeholder?.toLowerCase().includes(o)||n.value.toLowerCase().includes(o))&&r.push(n);return r},[])}function it({buttonLabel:t,onClear:e,onConfirm:o,dropdownItems:r,apiKey:n,data:s,styles:m,buttonDisabled:a,searchable:l,searchPlaceholder:p}){let{t:Q}=useTranslation(),Y=p??`${Q("search")}...`,$=zc(useId(),"multi-select-dropdown-button"),[C,b]=useState(null),[u,d]=useState(""),G=c=>{b(c.currentTarget);},g=()=>{b(null),d("");},x=!!C,L=s?.[n],J=Array.isArray(L)?L.length:0,S=useMemo(()=>{if(!r)return r;let c=V(r);return !l||!u?c:h(c,u)},[l,u,r]),v=l&&!!u&&S?.length===0,U=l?jsxs(Fragment,{children:[jsx(a$1,{name:"multi-select-search",value:u,placeholder:Y,onSearchChange:d,onSearchReset:()=>d(""),sx:{pt:0}}),v&&jsx(O,{children:"No results found"})]}):void 0;return jsxs("div",{id:$,"data-testid":"MultiSelectDropdownButton",children:[jsx(W,{onClick:G,label:jsxs(A,{isDisabled:a,children:[t,jsx("img",{src:Cb,alt:"arrow-down"})]}),disabled:a,badgeCount:J}),x&&jsx(a$2,{onClick:g}),jsx(Popper,{open:x,anchorEl:C,placement:"bottom-start",sx:{zIndex:9999},children:jsx(f$1,{onCloseDropdown:g,filter:{apiKey:n,data:s,onClear:e,onConfirm:o,options:S,type:"list"},styles:{...m,height:v?"auto":"300px",overflowY:"scroll",maxWidth:"200px"},header:U,searchable:l})})]})}var z=memo(it);var Ot=z;export{Ot as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-JQV74CFY.js';import {s}from'./chunk-F3BU4KEC.js';import {memo,useState,useRef,useEffect}from'react';import {useTranslation}from'react-i18next';import F from'@mui/material/Box';import K from'@mui/material/Button';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var Q=styled(F)(({theme:n})=>({background:n.palette.grey[700],width:27,height:14,display:"inline-flex",alignItems:"center",marginInlineStart:"4px",borderRadius:"10px",padding:"2px 6px",img:{cursor:"pointer"}})),E=styled(F)(()=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"center"})),b=styled(K)(({theme:n})=>({textTransform:"capitalize",minWidth:"auto",width:"100%",borderRadius:"4px",border:`1px solid ${n.palette.info.dark}`,backgroundColor:n.palette.info.dark,fontWeight:700,fontSize:"11px",color:n.palette.common.white,"&:hover":{backgroundColor:n.palette.info.dark}})),O=styled(K)(({theme:n})=>({textTransform:"capitalize",minWidth:"auto",width:"100%",borderRadius:"4px",border:`1px solid ${n.palette.divider}`,backgroundColor:n.palette.common.white,fontWeight:500,fontSize:"11px",color:n.palette.text.primary,"&:hover":{background:"transparent"}}));var v="188px";function $({onCloseDropdown:n,filter:o,styles:g,header:R,searchable:c$1}){let[T,W]=useState([]),{t:f}=useTranslation(),p=useRef([]),B=o?.options?.map(e=>e.value).join(",")??"";useEffect(()=>{let e=i=>{let r=o?.data?.[o.apiKey]??[];if(Array.isArray(r)&&r.length)return new Set(r).has(i)},s=i=>i.map(({placeholder:r,value:t,isSelected:a,icon:l,options:d})=>{let x;if(c$1){let m=p.current.find(y=>y.apiKey===t);x=m!==void 0?m.isSelected??false:(a||e(t)||d?.every(({value:y})=>e(y)))??false;}else x=(a||e(t)||d?.every(({value:m})=>e(m)))??false;return {...r&&{label:r},name:t,selected:x,...l&&{icon:l},...d?.length&&{menuItems:s(d)}}});o.options&&W(s(o.options));},[o?.data,B,c$1]);let h=()=>{p.current=[];},P=e=>{h(),n(e);},I=()=>{if(c$1){let e=new Set(o?.data?.[o.apiKey]??[]);p.current.forEach(({apiKey:s,options:i,isSelected:r})=>{i?i.forEach(({apiKey:t,isSelected:a})=>{a?e.add(t):e.delete(t);}):r?e.add(s):e.delete(s);}),o?.onConfirm?.({[o.apiKey]:[...e]});}else {let e=p.current.reduce((s,{options:i,apiKey:r,isSelected:t})=>{if(i){let a=i.filter(({isSelected:l})=>l);a.length&&s.push(...a.map(({apiKey:l})=>l));}else t&&s.push(r);return s},[]);p.current.length&&o?.onConfirm?.({[o.apiKey]:[...new Set(e)]});}h();},V=s(I,n),A=e=>{I(),n(e);},N=e=>{let s=r=>r.map(({name:t,selected:a,menuItems:l,label:d})=>({...d&&{placeholder:d},apiKey:t,isSelected:a,...l?.length&&{options:s(l)}})),i=s(e);if(c$1){let r=new Set(i.map(t=>t.apiKey));p.current=[...p.current.filter(t=>!r.has(t.apiKey)),...i];}else p.current=i;},w=g?.maxWidth??v,k={maxWidth:w,width:`min(${w}, max-content)`};return jsx(c,{"data-testid":"ColumnFilter_List",title:f("filterBy")||"Filter by",menuItems:T,style:g,menuSx:k,sx:[e=>({...k,marginTop:"10px",textAlign:"left",boxShadow:e.shadows[3],overflow:"hidden",".nested-menu-item":{height:41,zIndex:9999}}),...(Array.isArray(o.sx)?o.sx:[o.sx]).filter(Boolean)],updatedList:N,header:R,onKeyDown:V,footer:jsxs(E,{sx:{position:"sticky",bottom:0,zIndex:99999},children:[jsx(O,{onClick:P,children:f("cancel")},"nested-dropdown-cancel"),jsx(b,{onClick:A,children:f("okay")},"nested-dropdown-ok")]})})}var M=memo($);var ce=M;export{v as a,Q as b,E as c,b as d,O as e,ce as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {lc}from'./chunk-
|
|
1
|
+
import {lc}from'./chunk-ZHEAWCTY.js';import {forwardRef,memo}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled}from'@mui/material/styles';var o="os-shared-MaskedText",t={root:`${o}-root`,start:`${o}-start`,mask:`${o}-mask`,end:`${o}-end`};var p=()=>jsxs("svg",{width:"16",height:"8",viewBox:"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,children:[jsx("circle",{cx:"3",cy:"4",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"8",cy:"4",r:"1.5",fill:"currentColor"}),jsx("circle",{cx:"13",cy:"4",r:"1.5",fill:"currentColor"})]});var k=styled("span")(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.v2.spacing(2),minWidth:0,color:"inherit",font:"inherit",lineHeight:1,whiteSpace:"nowrap"})),m=styled("span")({minWidth:0}),c=styled("span")({display:"inline-flex",alignItems:"center",flexShrink:0,lineHeight:0,"& svg":{display:"block",width:16,height:8}});function M(e,d,n){let s=Math.max(0,d),a=Math.max(0,n);return !e||s+a>=e.length?{start:e,end:"",isMasked:false}:{start:e.slice(0,s),end:e.slice(e.length-a),isMasked:true}}var T=forwardRef(({className:e,sx:d,text:n,startLength:s=8,endLength:a=4,separator:y,id:h,...g},S)=>{let{start:C,end:N,isMasked:u}=M(n,s,a);return jsxs(k,{ref:S,id:h??"MaskedText",className:lc(t.root,e),sx:d,"data-testid":"MaskedText",...g,children:[jsx(m,{className:t.start,children:C}),u&&jsxs(Fragment,{children:[jsx(c,{className:t.mask,children:y??jsx(p,{})}),jsx(m,{className:t.end,children:N})]})]})});T.displayName="MaskedText";var P=memo(T);
|
|
2
2
|
export{t as a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {zc,bb,lc,kc,_b}from'./chunk-
|
|
1
|
+
import {zc,bb,lc,kc,_b}from'./chunk-ZHEAWCTY.js';import {Ro,ta,ra}from'./chunk-M5HS3EYQ.js';import {forwardRef,useId,useRef,useState,useEffect,useCallback,memo}from'react';import {useTranslation}from'react-i18next';import {useForkRef}from'@mui/material/utils';import R from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var f="os-shared-SheetViewChip",r={root:`${f}-root`,chip:`${f}-chip`,text:`${f}-text`,copyButton:`${f}-copyButton`},J=2e3,K=.3;var Q=styled("div")({position:"relative",width:"fit-content",maxWidth:"100%",'[data-column-align="right"] &':{marginLeft:"auto"}}),x=styled(R,{shouldForwardProp:e=>!["chipTextColor","chipBgColor","chipBorderColor","disabled","isSelected","disableAnimation"].includes(e)})(({theme:e,isSelected:w,chipTextColor:n=e.palette.text.primary,chipBgColor:i="#EFF1F2",chipBorderColor:o="#EFF1F2",disabled:h=false,disableAnimation:y})=>({display:"flex",justifyContent:"center",alignItems:"center",gap:"4px",height:"18px",padding:"0px 8px",borderRadius:"30px",border:`1px solid ${o}`,backgroundColor:i,color:n,cursor:h?"not-allowed":"pointer",opacity:h?.5:1,whiteSpace:"nowrap",fontSize:"11px",minWidth:"67px",maxWidth:"none",width:"fit-content",overflow:"hidden",textOverflow:"unset",boxSizing:"border-box",...w&&{boxShadow:"white 7px 0px 8px 2px"},...y&&{transition:"none !important",animation:"none !important",transform:"none !important","& *":{transform:"none !important"}}})),L=styled(R)(()=>({gap:"4px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,flex:1})),U=styled(R)(()=>({position:"absolute",top:0,height:"100%",width:"12px",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center"})),Y=styled("img",{shouldForwardProp:e=>e!=="isVisible"})(({isVisible:e})=>({height:12,width:12,objectFit:"contain",opacity:e?1:0,transform:`translateX(${e?0:-5}px)`,pointerEvents:e?"auto":"none",transition:"opacity 100ms ease, transform 100ms ease"}));var oe=forwardRef(({id:e,className:w,children:n,copyText:i,copyTrigger:o="hover",animationDirection:h="right",animationDuration:y=200,disableAnimation:S=false,disabled:v=false,unknownText:ie,fullWidth:a=false,containerStyles:se,sx:b,onClick:g,onMouseEnter:V,onMouseLeave:E,...N},F)=>{let $=zc(useId(),"sheet-view-chip"),{t:ne}=useTranslation(),k=useRef(null),re=useForkRef(k,F),M=useRef(),[P,c]=useState(false),[W,A]=useState(false),p=o==="always"||P,I=p&&!!i,l=h==="left",H=Math.max(0,y),T=K*1e3,ae=p?0:T;useEffect(()=>{if(o!=="press"||!P)return;let t=me=>{k.current?.contains(me.target)||c(false);};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[o,P]),useEffect(()=>()=>clearTimeout(M.current),[]);let pe=useCallback(t=>{o==="press"&&c(true),g?.(t);},[o,g]),le=useCallback(t=>{o==="hover"&&i&&c(true),V?.(t);},[o,i,V]),de=useCallback(t=>{o==="hover"&&c(false),E?.(t);},[o,E]),he=useCallback(t=>{t.stopPropagation(),i&&(A(true),bb(i),clearTimeout(M.current),M.current=setTimeout(()=>A(false),J));},[i]),B=lc(r.chip,w);if(!n)return jsx(x,{...N,chipBgColor:Ro.bgColor,chipBorderColor:Ro.borderColor,chipTextColor:Ro.textColor,ref:F,id:e??$,"data-testid":"SheetViewChip",className:lc(r.root,B),disabled:v,disableAnimation:S,onClick:g,onMouseEnter:V,onMouseLeave:E,sx:kc(b??{},t=>({borderColor:t.palette.divider,width:a?"100%":"auto"})),children:ne(ie??"unknown")});let ce=S?"none":`z-index 0ms linear ${p?0:T+H}ms`,z={zIndex:p?3:0,transition:ce};return jsxs(Q,{ref:re,id:e??$,"data-testid":"SheetViewChip",className:r.root,style:{...z,...se,...a&&{width:"100%",minWidth:0,marginLeft:0}},children:[jsx(x,{...N,"aria-hidden":true,className:B,disabled:v,sx:kc(b??{},{visibility:"hidden",pointerEvents:"none",width:a?"100%":"fit-content"}),children:jsx(L,{children:n})}),jsx("div",{style:{position:"absolute",top:0,...z,width:a?"100%":"max-content",left:l?"auto":0,right:l?0:"auto"},children:jsxs(x,{...N,className:B,isSelected:p,disabled:v,disableAnimation:S,onClick:pe,onMouseEnter:le,onMouseLeave:de,sx:kc({width:a?"100%":"auto"},b),children:[jsx("div",{style:{display:"flex",gap:"4px",...a&&{maxWidth:"100%",width:"100%"},paddingRight:I&&!l?12:0,paddingLeft:I&&l?12:0,transition:`padding ${H}ms ease ${ae}ms`},children:jsx(L,{className:r.text,"data-is-arabic":typeof n=="string"&&_b(n),children:n})}),i&&jsx(U,{className:r.copyButton,sx:l?{left:"8px"}:{right:"8px"},children:jsx(Y,{isVisible:I,src:W?ta:ra,alt:W?"copied":"copy",onClick:he})})]})})]})});oe.displayName="SheetViewChip";var ye=memo(oe);export{r as a,ye as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {zc}from'./chunk-
|
|
1
|
+
import {zc}from'./chunk-ZHEAWCTY.js';import {Mc}from'./chunk-M5HS3EYQ.js';import {memo,useId}from'react';import d from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsxs,jsx}from'react/jsx-runtime';var e=styled(d)(({theme:r})=>({fontSize:"10px",color:r.palette.error.light,padding:"8px",background:r.palette.background.gradient.error,borderRadius:"4px",display:"flex",gap:"4px",alignItems:"center",height:32}));function l({error:r,...i}){let n=zc(useId(),"error");return jsxs(e,{...i,id:n,"data-testid":"Error",children:[jsx("img",{src:Mc,alt:"w"}),r]})}var p=memo(l);var k=p;export{k as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {T,S,b as b$1}from'./chunk-
|
|
1
|
+
import {T,S,b as b$1}from'./chunk-XB6KSBAO.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 u=styled(T)(({theme:o})=>({[`& .${S.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}})),x=styled("div")(({theme:o})=>({display:"flex",flexDirection:"column",gap:o.spacing(2),minWidth:"256px",padding:o.spacing(2)})),d=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}})),y=styled("p")(({theme:o})=>({margin:0,fontSize:o.typography.fontSize,fontWeight:o.typography.fontWeightMedium,lineHeight:o.typography.body1.lineHeight})),D=styled("div")(({theme:o})=>({display:"flex",gap:o.spacing(1),justifyContent:"flex-end"}));var v=forwardRef(({message:o,title:t,confirmText:a,cancelText:i,onConfirm:r,onCancel:s,className:m,sx:e,...n},T)=>jsx(u,{ref:T,"data-testid":"ConfirmDialog",heading:t,className:m,sx:e,...n,children:jsxs(x,{children:[jsx(y,{children:o}),jsxs(D,{children:[jsx(d,{variant:"ghost",onClick:s,children:i||"No"}),jsx(d,{variant:"ghost",onClick:r,children:a||"Yes"})]})]})}));v.displayName="ConfirmDialog";var b=memo(v);var p=createContext(null);function W(){let o=useContext(p);if(!o)throw new Error("useConfirm must be used within <ConfirmDialogProvider>");return o}var R={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(R),i=useRef(null),r=useCallback(e=>{let n=i.current;n&&(i.current=null,a(R),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(p.Provider,{value:m,children:[o,jsx(b,{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{W as a,O as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-HDCNWBW5.js';import {d,R as R$1,L,V}from'./chunk-XB6KSBAO.js';import {Cc,lc}from'./chunk-ZHEAWCTY.js';import {Eb,A as A$1,Pc,vb}from'./chunk-M5HS3EYQ.js';import {forwardRef,useState,useMemo,memo,useRef,useLayoutEffect}from'react';import Je from'@mui/material/ClickAwayListener';import {CircularProgress}from'@mui/material';import h from'@mui/material/Box';import ee from'@mui/material/Typography';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var y="os-shared-NestedMultiSelect",c={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`};var te=e=>({display:"flex",padding:"4px 8px 4px 6px",alignItems:"center",gap:"4px",borderRadius:"13px",backgroundColor:e,fontSize:"10px",fontWeight:500,cursor:"pointer"}),le=styled(h,{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>{let{base:l}=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(l.black,.6),[`& .${c.label}`]:{opacity:.7,cursor:"not-allowed"},[`& .${c.placeholder}`]:{color:alpha(l.black,.6)},[`& .${c.arrow}`]:{opacity:.6},[`& .${c.fieldRow}`]:{opacity:.7},[`& .${c.fieldRow} *`]:{cursor:"not-allowed"}},[`&.${c.open} .${c.arrow}`]:{transform:"rotate(180deg)"}}}),oe=styled(ee)(({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"})),ne=styled(ee)(()=>({margin:0,fontWeight:500,fontSize:"11px",lineHeight:"18px",padding:"22px 24px 8px 8px"})),ie=styled(h)(({theme:e})=>({position:"absolute",top:15,right:4,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})})),re=styled(h)(()=>({display:"flex",flexDirection:"column",padding:"8px"})),se=styled(h)(()=>({display:"flex",columnGap:"8px",rowGap:"8px",flexWrap:"wrap",paddingInlineEnd:"20px"})),ae=styled(h)(({theme:e})=>({...te(`${e.palette.info.dark}1a`),maxWidth:"150px"})),ce=styled("span")(()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})),de=styled(h)(()=>({position:"relative",width:"100%",minWidth:0})),ue=styled(h)(()=>({display:"flex",flexWrap:"nowrap",alignItems:"center",gap:"4px",width:"100%",minWidth:0,overflow:"hidden",padding:"22px 24px 8px 8px"})),A=styled(h,{shouldForwardProp:e=>e!=="$truncate"})(({theme:e,$truncate:t})=>({...te(`${e.palette.info.dark}1a`),overflow:"hidden",cursor:"inherit",flex:t?"1 1 auto":"0 0 auto",width:"max-content",maxWidth:t?"100%":"none",minWidth:t?0:"auto"})),pe=styled("span")(()=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0})),Se=styled("span")(()=>({position:"fixed",left:0,top:0,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap",width:"max-content",display:"inline-flex",padding:"4px 8px 4px 6px",fontSize:"10px",fontWeight:500})),me=styled(h)(()=>({flex:1,maxWidth:"220px",minWidth:"89px"})),fe=styled(h,{shouldForwardProp:e=>e!=="$maxWidth"})(({$maxWidth:e})=>({display:"flex",gap:"12px",justifyContent:"space-between",flexGrow:1,alignItems:"center",maxWidth:e,minWidth:"89px"}));function Me(e,t,l){let i=4*Math.max(e.length-1,0);if(e.reduce((s,a)=>s+a,0)+i<=t)return {count:e.length,truncateLast:false};let r=0,n=0;for(let s=0;s<e.length;s+=1){let a=n>0?4:0,m=s===e.length-1?0:4+l;if(r+a+e[s]+m<=t){r+=a+e[s],n+=1;continue}let S=t-r-a-m;if(n===0||S>=48)return {count:n+1,truncateLast:true};break}return {count:Math.max(n,1),truncateLast:false}}function Ne(e,t,l,i){let o=e.length;if(o===0)return {count:0,truncateLast:false};let r=4*Math.max(o-1,0),s=e.reduce((a,x)=>a+x,0)+r+(i?4+l:0);return {count:o,truncateLast:s>t}}var E=e=>!e.options&&typeof e.value=="string",I=e=>e.value??e.label,R=(e,t)=>t?.some(l=>l.value===e.value)??false,he=(e,t,l)=>{if(R(e,t)){l(t?.filter(i=>i.value!==e.value)||[]);return}l([...t||[],e]);},$=e=>E(e)?[e]:(e.options??[]).flatMap($),D=(e,t)=>{let l=e.filter(i=>R(i,t)).length;return {allSelected:e.length>0&&l===e.length,someSelected:l>0&&l<e.length}},ye=(e,t,l)=>{let i=new Set(e.map(n=>n.value));if(D(e,t).allSelected){l((t??[]).filter(n=>!i.has(n.value)));return}let o=new Set((t??[]).map(n=>n.value)),r=e.filter(n=>!o.has(n.value));l([...t??[],...r]);},De=(e,t)=>{let l=e[t];return typeof l=="string"?l:""},He=(e,t,l)=>l.some(i=>De(e,i).toLowerCase().includes(t)),H=(e,t,l)=>{if(!t)return e;let i=t.toLowerCase();return e.reduce((o,r)=>{if(E(r))return He(r,i,l)&&o.push(r),o;let n=H(r.options??[],t,l);return n.length>0&&o.push({...r,options:n}),o},[])};function Ge({options:e,maxVisibleSelected:t}){let l=useRef(null),i=useRef(null),o=typeof t=="number"&&Number.isFinite(t),r=o?Math.max(0,Math.floor(t)):e.length,[n,s]=useState({count:Math.min(r,e.length),truncateLast:false});useLayoutEffect(()=>{let f=l.current,S=i.current;if(!f||!S)return;let g=()=>{let C=e.slice(0,r).map(N=>(S.textContent=N.label,S.offsetWidth));S.textContent=`+${e.length}`;let v=S.offsetWidth,b=getComputedStyle(f),M=f.clientWidth-parseFloat(b.paddingLeft)-parseFloat(b.paddingRight),w=o?Ne(C,M,v,e.length>C.length):Me(C,M,v);s(N=>N.count===w.count&&N.truncateLast===w.truncateLast?N:w);};g();let L=new ResizeObserver(g);return L.observe(f),()=>L.disconnect()},[r,o,e]);let a=e.slice(0,n.count),x=e.length-n.count,m=Cc("field-badge");return jsxs(de,{children:[jsx(Se,{ref:i,"aria-hidden":true}),jsxs(ue,{ref:l,className:c.fieldRow,children:[a.map((f,S)=>{let g=n.truncateLast&&S===a.length-1;return jsx(A,{$truncate:g,children:jsx(pe,{children:f.label})},m(f.value,S))}),x>0?jsx(A,{children:jsxs("span",{children:["+",x]})}):null]})]})}var ge=Ge;function Le({label:e,maxWidth:t,itemCount:l,isSelected:i,isIndeterminate:o,onToggle:r,children:n}){let[s,a]=useState(null);return jsxs(V,{isSelected:i,isIndeterminate:o,onClick:m=>{m.stopPropagation(),m.preventDefault(),r();},onMouseEnter:m=>{l>0&&a(m.currentTarget);},onMouseLeave:()=>{s&&a(null);},children:[jsxs(fe,{$maxWidth:t,children:[e,jsx("img",{src:vb,className:"arrow-icon",alt:"arrow"})]}),jsx(R$1,{sx:{maxHeight:"450px",overflow:"auto"},open:!!s,anchorEl:s,placement:"right-start",children:n})]})}function ve({option:e,value:t,onChange:l}){let i=o=>{o.stopPropagation(),o.preventDefault(),he(e,t,l);};return jsx(V,{isSelected:R(e,t),onClick:i,children:jsx(me,{children:e.label})})}var Ke=340,Ue=220;function G({node:e,depth:t,value:l,onChange:i}){if(E(e))return jsx(ve,{option:e,value:l,onChange:i});if(!e.options)return null;let o=e.options,r=$(e),{allSelected:n,someSelected:s}=D(r,l);return jsx(Le,{label:e.label,maxWidth:t===0?Ke:Ue,itemCount:o.length,isSelected:n,isIndeterminate:s,onToggle:()=>ye(r,l,i),children:o.map(a=>jsx(G,{node:a,depth:t+1,value:l,onChange:i},I(a)))})}var Ze=["label"],Be=forwardRef(({options:e,onChange:t,value:l,maxVisibleSelected:i,placeholder:o,label:r,isLoading:n,searchBy:s=Ze,disabled:a$1,className:x,sx:m,searchable:f=true,searchPlaceholder:S,onOpen:g,onClose:L$1},C)=>{let[v,b]=useState(null),[M,w]=useState(""),N=!!v,Fe=r??o,Oe=r?o??"Please Select":"Please Select",We=d=>{if(N){b(null),L$1?.();return}b(d.currentTarget),g?.();},Ee=()=>{b(null),L$1?.();},Ie=()=>{M&&w("");},Re=useMemo(()=>H(e,M,s),[e,M,s]),K=l?.length??0,Te=Cc("selected-badge"),ke=n?jsx(CircularProgress,{size:16}):jsx(d,{src:M?Eb:A$1,alt:M?"close":"search",onClick:Ie,sx:{width:12,height:12,cursor:M?"pointer":"default"}});return jsx(Je,{onClickAway:()=>{N&&Ee();},children:jsxs(le,{ref:C,id:"FieldWrapper","data-testid":"NestedMultiSelect",$disabled:a$1,"aria-disabled":a$1||void 0,className:lc(c.root,N&&c.open,x),sx:m,onClick:d=>!a$1&&We(d),children:[jsx(oe,{className:c.label,component:"label",children:Fe}),K===0&&jsx(ne,{className:c.placeholder,component:"p",children:Oe}),jsx(ie,{className:c.arrow,"aria-hidden":true,children:jsx(a,{})}),K>0&&l?jsx(ge,{options:l,maxVisibleSelected:i}):null,jsx(R$1,{open:N,anchorEl:v,sx:{margin:"8px 0",maxHeight:330,overflow:"auto",maxWidth:"340px"},panelProps:{className:c.menu},children:jsxs(re,{children:[f?jsx(L,{className:c.search,fullWidth:true,size:"md",placeholder:S??o??"Select",endAdornment:ke,value:M,onClick:d=>{d.stopPropagation();},onMouseDown:d=>{d.stopPropagation();},onChange:d=>{w(d.target.value);},sx:{mb:"4px"}}):null,jsx(se,{children:l?.map((d$1,Ae)=>jsxs(ae,{className:c.selectedBadge,onClick:U=>{U.stopPropagation(),U.preventDefault(),t(l?.filter($e=>$e.value!==d$1.value)||[]);},children:[jsx(d,{src:Pc,alt:"blue-check",sx:{width:10,height:7.5}}),jsx(ce,{children:d$1.label}),jsx(d,{src:Eb,alt:"close",sx:{width:9,height:9}})]},Te(d$1.value,Ae)))}),Re.map(d=>jsx(G,{node:d,depth:0,value:l,onChange:t},I(d)))]})})]})})});Be.displayName="NestedMultiSelect";var je=memo(Be);export{c as a,je as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-FWVZQRRW.js';import {j,a as a$3}from'./chunk-6PC37PPT.js';import {a as a$1}from'./chunk-B7FSN6KR.js';import {R,x,h}from'./chunk-XGZGBCXK.js';import {a}from'./chunk-EKVX2K2J.js';import {mc,nc,zc,o}from'./chunk-2OTSLKKQ.js';import {Uc,Vc,Uj,Vj,Wj,dc,ec,Xj,cc}from'./chunk-M5HS3EYQ.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import It from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Xe={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:i,onUpdate:t}){let[n,p]=useState(null),m=!!n&&i,{t:s}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},l=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:s("groupedBy")}),jsxs(Ke,{onClick:u,open:m,children:[jsx("span",{children:Xe[o]}),jsx(S,{component:"img",src:Vc,alt:"arrow",sx:{...m&&{transform:"rotate(180deg)"}}})]}),jsx(R,{open:m,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Xe).map(([d,a])=>jsx(qe,{onClick:()=>{l(d);},className:o===d?"active":"",children:a},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function se({isHijri:e,onCalendarModeSwitch:o}){let{t:i}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:cc,alt:"hijri"}),jsx("span",{children:i("hijri")})]}),jsx(h,{checked:e,onChange:t})]})})}var no=se;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var J=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,X=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),Z=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,i]=o();return [new q(o$1),new q(i)]}return [new q(e?.[0]),new q(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:i=false}){let t={locale:J({isHijri:o,isAr:i}),calendar:X(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,i]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(m=>jsx(ao,{onClick:s=>{s.preventDefault(),e(m.value);},children:p(m.id)},m.id))})})}var lo=ce;var so=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:i,onChange:t,numberOfMonths:n=2,...p},m){let s=c=>c==="right"?e?dc:ec:e?ec:dc;return jsx(Calendar,{ref:m,numberOfMonths:n,value:i,onChange:t,calendar:X(o),locale:J({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(so,{onClick:u,children:jsx("img",{src:s(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),F=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:i,defaultCountryTimezone:t}){let[n,p]=useState(null),m=a=>{n||p(a.currentTarget);},s=()=>{n&&p(null);},c=(a,D)=>{a.stopPropagation(),o(D);},u=useMemo(()=>i?.map(a=>mc(a)),[i]),l=useMemo(()=>u?.some(a=>e?.timezone===a?.timezone),[u,e]),d=useMemo(()=>e&&l?e:t,[e,t,l]);return jsxs(L,{onMouseEnter:m,onMouseLeave:s,onClick:()=>{e&&o(d);},children:[l?jsx("img",{src:Xj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Vj,alt:"entity-timezone"}),jsx(a,{countryCode:d?.countryCode}),jsx(F,{className:l?"selected":"",children:l?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((a$1,D)=>{let j=a$1?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,a$1);},sx:{gap:"4px"},children:[j?jsx("img",{src:Xj,alt:"icon"}):jsx(A,{}),jsx(a,{countryCode:a$1?.countryCode}),jsx(F,{className:j?"selected":"",children:a$1?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:i}){let t=useMemo(()=>i?nc(i):void 0,[i]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Xj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Uj,alt:"user-timezone"}),jsx(a,{countryCode:t?.countryCode}),jsx(F,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:i,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,m]=useState(null),s=!!p,c=()=>{m(null);},u=a=>{e(a),c();},l=a=>{m(a.currentTarget);},d=useMemo(()=>i===o?.timezone?Uj:o?.timezone===t.timezone?Vj:Wj,[i,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:s,onClick:l,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:s,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:i})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S,{shouldForwardProp:e=>e!=="$isSingleMonth"})(({theme:e,$isSingleMonth:o})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none",...o&&{width:"100%"}},".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,...o&&{display:"block !important"}},".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"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Uc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:i}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,m]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),s=({period:l,hour:d})=>l==="PM"&&d!==12?d+12:l==="AM"&&d===12?0:d,c=({hour:l,minute:d,period:a})=>{o([t.setHour(s({hour:l,period:a})).setMinute(d).setSecond(0),n]);},u=({hour:l,minute:d,period:a})=>{o([t,n.setHour(s({hour:l,period:a})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:i("allDay")}),jsx(h,{checked:p,onChange:l=>{m(!p),l.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a$3(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a$3(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Po=Mt;var Io=Po;function At({defaultDate:e,onDateChange:o,mode:i="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:m,maxDateRange:s,onCalendarGroupChange:c,groupBy:u,timezone:l,onChangeTimezone:d,browserTimezone:a,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Fo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(Z(e)),[x$1,C]=useState(w),[ze,Se]=useState(l??null),[ve,Wo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),P=useRef(null),Ho=zc(useId(),"range-calender"),ne=i==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(Z(e));}},[y]),useEffect(()=>{if(e){let r=Z(e);ke(r),C(r),P.current&&P.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(l??null);},[l,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),$=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===$&&!p?r:`${r} - ${$}`},[w,p]),Yo=r=>{if(r.length<2||!s){C(r);return}let $=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Pe=It(Qo).diff($,"day");if(Pe<=s){C(r);return}Ee(true),C([r[0],r[1].subtract(Pe-s,"d")]),setTimeout(()=>{Ee(false);},3e3);},$o=r=>{C([M(r[0]),B(r[1])]),P.current&&P.current.set("date",r[0]);},Go=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(a$1,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:Go,$isSingleMonth:n===1,children:[!m&&jsxs(zo,{children:[jsx(lo,{onChange:$o,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Wo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:P,numberOfMonths:n,...Fo}),jsx(x,{in:Be&&!!s,children:jsx(a$2,{error:re("dateRangeError",{number:s}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&a&&Te&&jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:a,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Io,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var bi=Ao;export{bi as a};
|
|
1
|
+
import {a as a$2}from'./chunk-VSI64YFN.js';import {j,a as a$3}from'./chunk-34DUFFV5.js';import {a as a$1}from'./chunk-K3VCY2Z7.js';import {a}from'./chunk-TYUXEDNW.js';import {R,x,h}from'./chunk-XB6KSBAO.js';import {mc,nc,zc,o}from'./chunk-ZHEAWCTY.js';import {Uc,Vc,Uj,Vj,Wj,dc,ec,Xj,cc}from'./chunk-M5HS3EYQ.js';import {memo,forwardRef,useState,useMemo,useRef,useId,useEffect,useCallback}from'react';import S from'@mui/material/Box';import bt from'@mui/material/Popper';import It from'dayjs';import {useTranslation}from'react-i18next';import {Calendar,DateObject}from'react-multi-date-picker';import Ko from'@mui/material/ClickAwayListener';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';import he from'@mui/material/Button';import q from'react-date-object';import ot from'react-date-object/calendars/arabic';import tt from'react-date-object/calendars/gregorian';import rt from'react-date-object/locales/arabic_ar';import nt from'react-date-object/locales/arabic_en';import it from'react-date-object/locales/gregorian_ar';import at from'react-date-object/locales/gregorian_en';var Ne=styled(S)(({theme:e})=>({color:e.palette.grey[700],fontSize:"9px",fontWeight:500,marginBottom:"6px"})),Ke=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({borderRadius:"4px",border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,height:32,padding:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",...o&&{border:`1px solid ${e.palette.info.dark}`,background:e.palette.common.white,boxShadow:e.shadows[7]}})),_e=styled(S)(({theme:e})=>({borderRadius:"8px",background:e.palette.common.white,boxShadow:"0px 8px 36px 0px rgba(0, 0, 0, 0.15)",textAlign:"center",color:e.palette.grey[900],fontSize:"12px",fontWeight:500,lineHeight:"20px",letterSpacing:"0.1px",padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",flexDirection:"column"})),qe=styled(S)(({theme:e})=>({width:71,padding:"4px 0",cursor:"pointer","&:hover, &.active":{borderRadius:"100px",background:e.palette.info.light}}));var Xe={day:"Day",month:"Month",quarter:"Quarter",year:"Year"};function qo({sx:e,groupBy:o,isCalenderOpen:i,onUpdate:t}){let[n,p]=useState(null),m=!!n&&i,{t:s}=useTranslation(),c=()=>{p(null);},u=d=>{p(d.currentTarget);},l=d=>{t?.(d),c();};return jsx(Ko,{onClickAway:c,children:jsxs(S,{sx:e,children:[jsx(Ne,{children:s("groupedBy")}),jsxs(Ke,{onClick:u,open:m,children:[jsx("span",{children:Xe[o]}),jsx(S,{component:"img",src:Vc,alt:"arrow",sx:{...m&&{transform:"rotate(180deg)"}}})]}),jsx(R,{open:m,anchorEl:n,children:jsx(_e,{sx:{width:n?.clientWidth},children:Object.entries(Xe).map(([d,a])=>jsx(qe,{onClick:()=>{l(d);},className:o===d?"active":"",children:a},`${d}-groupedBy`))})})]})})}var Ve=memo(qo);var eo=Ve;var oo=styled(S)(({theme:e})=>({border:"1px solid",borderColor:e.palette.divider,borderRadius:"50px",paddingInline:"6px 12px",color:e.palette.text.primary,fontSize:"11px",display:"flex",gap:"8px",alignItems:"center",justifyContent:"space-between",height:32,marginTop:"8px",img:{width:16,height:16},"& > div":{display:"flex",alignItems:"center",gap:"2px"}}));function se({isHijri:e,onCalendarModeSwitch:o}){let{t:i}=useTranslation(),t=()=>{o?.(e?"gregorian":"hijri");};return jsx(S,{children:jsxs(oo,{children:[jsxs(S,{children:[jsx("img",{src:cc,alt:"hijri"}),jsx("span",{children:i("hijri")})]}),jsx(h,{checked:e,onChange:t})]})})}var no=se;var ao=styled(he)(({theme:e})=>({cursor:"pointer",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,color:e.palette.text.primary,fontSize:"11px",fontWeight:e.typography.fontWeightRegular,paddingInline:"12px",height:32,width:"max-content",textTransform:"unset","&:hover":{boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark}})),po=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"8px"}));var J=({isHijri:e,isAr:o=false})=>e?o?rt:nt:o?it:at,X=e=>e?ot:tt,M=e=>e.setHour(0).setMinute(0).setSecond(0).setMillisecond(0),B=e=>e.setHour(23).setMinute(59).setSecond(59).setMillisecond(999),Z=e=>{if(!(e?.[0]instanceof Date)||!(e?.[1]instanceof Date)){let[o$1,i]=o();return [new q(o$1),new q(i)]}return [new q(e?.[0]),new q(e?.[1])]};function ce({onChange:e,isHijri:o,isAr:i=false}){let t={locale:J({isHijri:o,isAr:i}),calendar:X(o)},n=useMemo(()=>[{id:"today",value:[new DateObject(t),new DateObject(t)]},{id:"lastWeek",value:[new DateObject(t).subtract(6,"day"),new DateObject(t)]},{id:"lastMonth",value:[new DateObject(t).subtract(30,"day"),new DateObject(t)]},{id:new DateObject(t).subtract(1,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(1,"month").toFirstOfMonth(),new DateObject(t).subtract(1,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(2,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(2,"month").toFirstOfMonth(),new DateObject(t).subtract(2,"month").toLastOfMonth()]},{id:new DateObject(t).subtract(3,"month").toFirstOfMonth().format("MMMM YYYY"),value:[new DateObject(t).subtract(3,"month").toFirstOfMonth(),new DateObject(t).subtract(3,"month").toLastOfMonth()]}],[o,i]),{t:p}=useTranslation();return jsx(S,{"data-testid":"RangeCalender_QuickFilters",children:jsx(po,{children:n.map(m=>jsx(ao,{onClick:s=>{s.preventDefault(),e(m.value);},children:p(m.id)},m.id))})})}var lo=ce;var so=styled(he)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}}));var ft=["Su","Mo","Tu","We","Th","Fr","Sa"];function gt({isAr:e=false,isHijri:o,values:i,onChange:t,numberOfMonths:n=2,...p},m){let s=c=>c==="right"?e?dc:ec:e?ec:dc;return jsx(Calendar,{ref:m,numberOfMonths:n,value:i,onChange:t,calendar:X(o),locale:J({isHijri:o,isAr:e}),range:true,format:"MMM DD",monthYearSeparator:" ",renderButton:(c,u)=>jsx(so,{onClick:u,children:jsx("img",{src:s(c),alt:"arrow"})}),weekDays:e?void 0:ft,maxDate:new Date,...p})}var mo=forwardRef(gt);var co=mo;var uo=styled(S)(()=>({'[class$="-IndicatorsContainer2"]':{display:"none"},"#react-select-2-listbox":{width:300}})),V=styled(S)(({theme:e})=>({borderRadius:e.spacing(.5),border:`1px solid ${e.palette.divider}`,background:e.palette.common.white,boxShadow:e.shadows[10],minWidth:200,width:"max-content",overflow:"auto"})),fo=styled(S,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:o})=>({width:156,fontSize:"11px",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,minHeight:32,borderRadius:"4px",padding:e.spacing(1),whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",cursor:"pointer",display:"flex",alignItems:"center",gap:e.spacing(1),fontWeight:500,...o&&{borderRadius:"4px",boxShadow:e.shadows[7],border:"1px solid",borderColor:e.palette.info.dark,background:e.palette.common.white},span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}})),L=styled(S)(({theme:e})=>({padding:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",display:"flex",alignItems:"center",gap:e.spacing(1),height:33,cursor:"pointer","&:hover":{boxShadow:"0px 0px 16px 0px #00000021"},"&+&":{borderTop:"1px solid",borderColor:e.palette.divider},"&.active span":{fontWeight:500},span:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),A=styled(S)(()=>({width:12,height:12})),F=styled(S)(({theme:e})=>({fontSize:"11px",color:e.palette.text.secondary,lineHeight:"15.03px","&.selected":{color:e.palette.info.dark}}));function ge({selectedTimezone:e,onChange:o,timezoneCountriesCodes:i,defaultCountryTimezone:t}){let[n,p]=useState(null),m=a=>{n||p(a.currentTarget);},s=()=>{n&&p(null);},c=(a,D)=>{a.stopPropagation(),o(D);},u=useMemo(()=>i?.map(a=>mc(a)),[i]),l=useMemo(()=>u?.some(a=>e?.timezone===a?.timezone),[u,e]),d=useMemo(()=>e&&l?e:t,[e,t,l]);return jsxs(L,{onMouseEnter:m,onMouseLeave:s,onClick:()=>{e&&o(d);},children:[l?jsx("img",{src:Xj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Vj,alt:"entity-timezone"}),jsx(a,{countryCode:d?.countryCode}),jsx(F,{className:l?"selected":"",children:l?e?.label:t?.label}),jsx(bt,{open:!!n,anchorEl:n,placement:"right-start",sx:{zIndex:3},disablePortal:true,children:jsx(V,{sx:{maxHeight:300},children:u?.map((a$1,D)=>{let j=a$1?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,a$1);},sx:{gap:"4px"},children:[j?jsx("img",{src:Xj,alt:"icon"}):jsx(A,{}),jsx(a,{countryCode:a$1?.countryCode}),jsx(F,{className:j?"selected":"",children:a$1?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:i}){let t=useMemo(()=>i?nc(i):void 0,[i]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Xj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Uj,alt:"user-timezone"}),jsx(a,{countryCode:t?.countryCode}),jsx(F,{className:p?"selected":"",children:t?.label})]})}function St({onChange:e,selectedTimezone:o,browserTimezone:i,defaultCountryTimezone:t,timezoneCountriesCodes:n}){let[p,m]=useState(null),s=!!p,c=()=>{m(null);},u=a=>{e(a),c();},l=a=>{m(a.currentTarget);},d=useMemo(()=>i===o?.timezone?Uj:o?.timezone===t.timezone?Vj:Wj,[i,t.timezone,o?.timezone]);return jsx(Ko,{onClickAway:c,children:jsxs(uo,{"data-testid":"CustomTimezone",children:[jsxs(fo,{open:s,onClick:l,children:[jsx("img",{src:d,alt:"timezone-icon"}),jsx(a,{countryCode:o?.countryCode}),jsx("span",{children:o?.label})]}),jsx(bt,{open:s,anchorEl:p,placement:"top-start",sx:{zIndex:1400},children:jsxs(V,{"data-testid":"CustomTimezone_dropdown",children:[jsx(ge,{onChange:u,selectedTimezone:o,defaultCountryTimezone:t,timezoneCountriesCodes:n}),jsx(xe,{onChange:u,selectedTimezone:o,browserTimezone:i})]})})]})})}var xo=memo(St);var bo=xo;var ho=styled(S,{shouldForwardProp:e=>e!=="$isSingleMonth"})(({theme:e,$isSingleMonth:o})=>({display:"flex",marginTop:"8px",background:e.palette.common.white,boxShadow:e.shadows[9],borderRadius:e.spacing(1),color:e.palette.text.primary,fontSize:"11px",".rmdp-calendar":{padding:"8px 16px 16px"},".rmdp-rtl *":{fontFamily:"Tajawal"},".rmdp-rtl .sd":{paddingTop:"4px"},".rmdp-wrapper":{position:"relative",borderRadius:"8px",boxShadow:"none",...o&&{width:"100%"}},".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,...o&&{display:"block !important"}},".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"},".rmdp-day.rmdp-disabled":{color:"#ccc",cursor:"not-allowed"}})),yo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",background:"transparent",color:e.palette.text.primary,border:"1px solid",borderColor:e.palette.divider,fontWeight:500,borderRadius:"4px","&:hover":{background:"transparent",color:e.palette.text.primary}})),wo=styled(he)(({theme:e})=>({textTransform:"capitalize",padding:"8px 24px",width:75,height:32,fontSize:"11px",borderRadius:"4px",fontWeight:700,background:e.palette.info.dark,"&:hover":{background:e.palette.info.dark}})),Co=styled(S)(()=>({display:"flex",gap:8,marginLeft:"auto",flexShrink:0})),To=styled(he,{shouldForwardProp:e=>e!=="open"})(({open:e,theme:o})=>({color:o.palette.text.primary,fontSize:"11px",fontWeight:500,padding:o.spacing(1),borderRadius:"4px",border:"1px solid",borderColor:o.palette.divider,background:o.palette.common.white,textTransform:"none",height:32,...e&&{border:"1px solid",borderColor:o.palette.info.dark,boxShadow:o.shadows[7]}})),ko=styled(S)(({theme:e})=>({background:e.palette.common.white,display:"flex",justifyContent:"space-between",alignItems:"center",gap:10,padding:"16px",borderTop:"1px solid",borderColor:e.palette.divider,borderBottomRightRadius:"8px"})),zo=styled(S)(({theme:e})=>({padding:16,paddingInlineEnd:"23px",borderRight:"1px solid",borderColor:e.palette.divider,background:e.palette.common.white,width:"max-content",borderTopLeftRadius:"8px",borderBottomLeftRadius:"8px",display:"flex",flexDirection:"column",gap:10,justifyContent:"space-between"})),So=styled(S)(()=>({display:"flex",alignItems:"center",gap:"10px"})),vo=styled(S)(()=>({position:"relative"})),Do=styled(S)(()=>({display:"flex",flexDirection:"column",gap:"24px"}));var Mo=styled(S,{shouldForwardProp:e=>e!=="isAllDay"})(({theme:e,isAllDay:o})=>({display:"flex",alignItems:"center",gap:e.spacing(1),position:"relative",paddingInline:"5px",".label":{width:"max-content"},...!o&&{paddingRight:e.spacing(1),"&:after":{content:'""',position:"absolute",width:"1px",background:e.palette.divider,right:0,height:17}}})),Bo=styled(S)(()=>({width:235})),Eo=styled(S)(({theme:e})=>({display:"flex",gap:"4px",".rmdp-input":{width:"64px",borderRadius:"19px",border:"1px solid",borderColor:e.palette.divider,color:e.palette.text.primary,fontSize:"11px",fontWeight:500,background:"transparent",cursor:"pointer"},".rmdp-input:focus":{boxShadow:e.shadows[7],border:`1px solid ${e.palette.info.dark}`,borderRadius:"19px"},".rmdp-time-picker":{boxShadow:e.shadows[5],borderRadius:e.spacing(1),padding:e.spacing(2),minWidth:"auto !important",div:{marginTop:0,display:"block"},"> div":{width:32,height:64},".rmdp-arrow":{borderColor:`${e.palette.background.transparent[1]} !important`},".rmdp-arrow-container":{justifyContent:"center","&:hover":{backgroundColor:"transparent",boxShadow:"unset"}},input:{borderRadius:"4px",border:`1px solid ${e.palette.divider}`,padding:0,width:32,height:32,fontSize:"11px",color:e.palette.text.primary,fontWeight:500,"&:focus, &:focus-visible":{border:`1px solid ${e.palette.info.dark}`,outline:"unset"}},".dvdr":{margin:"7px 4px 0"},".rmdp-am, .rmdp-pm":{margin:0,width:32,height:32,flex:"auto",justifyContent:"center",fontSize:"11px",color:e.palette.text.primary,fontWeight:500,display:"flex",cursor:"default"},"> div:last-child":{marginInlineStart:"4px",display:"block !important"},".rmdp-down, .rmdp-up":{position:"relative",i:{display:"none"},"&:before":{content:'""',position:"absolute",top:"5px",width:"10px",height:"10px",backgroundImage:`url(${Uc})`}},".rmdp-down:before":{transform:"rotate(180deg)"}},".rmdp-container":{position:"relative","> div":{top:"unset !important",bottom:"28px",transform:"unset !important"}}})),Oo=styled(S)(({theme:e})=>({display:"flex",gap:"8px",alignItems:"center",borderRadius:"50px",border:"1px solid",borderColor:e.palette.divider,paddingInline:"5px",width:"fit-content",height:32}));function Mt({values:e,setValues:o}){let{t:i}=useTranslation(),t=new DateObject(e[0]),n=new DateObject(e[1]),[p,m]=useState(t.dayOfYear===n.dayOfYear&&t.hour===0&&t.minute===0&&n.hour===23&&n.minute===59),s=({period:l,hour:d})=>l==="PM"&&d!==12?d+12:l==="AM"&&d===12?0:d,c=({hour:l,minute:d,period:a})=>{o([t.setHour(s({hour:l,period:a})).setMinute(d).setSecond(0),n]);},u=({hour:l,minute:d,period:a})=>{o([t,n.setHour(s({hour:l,period:a})).setMinute(d).setSecond(59)]);};return jsx(Bo,{children:jsxs(Oo,{children:[jsxs(Mo,{isAllDay:p,children:[jsx("span",{className:"label",children:i("allDay")}),jsx(h,{checked:p,onChange:l=>{m(!p),l.target.checked?o([M(e[0]),B(e[1])]):o(e);}})]}),!p&&jsxs(Eo,{children:[jsx(j,{defaultTime:{hour:a$3(t.hour),minute:t.minute,period:t.hour>=12?"PM":"AM"},size:"small",onChange:c,enableRealTimeChange:true},`${e[0]?.toString()}-start`),jsx(j,{defaultTime:{hour:a$3(n.hour),minute:n.minute,period:n.hour>=12?"PM":"AM"},size:"small",onChange:u,enableRealTimeChange:true},`${e[1]?.toString()}-end`)]})]})})}var Po=Mt;var Io=Po;function At({defaultDate:e,onDateChange:o,mode:i="gregorian",onCalendarModeSwitch:t,numberOfMonths:n,noTimezone:p,noQuickFilter:m,maxDateRange:s,onCalendarGroupChange:c,groupBy:u,timezone:l,onChangeTimezone:d,browserTimezone:a,renderCalendarButton:D,mainSx:j,popperProps:te,rangeDatePickerProps:Fo,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te}){let[w,ke]=useState(Z(e)),[x$1,C]=useState(w),[ze,Se]=useState(l??null),[ve,Wo]=useState(u||"day"),[De,Me]=useState(null),y=!!De,[Be,Ee]=useState(false),{t:re}=useTranslation(),P=useRef(null),Ho=zc(useId(),"range-calender"),ne=i==="hijri",Y=()=>{Me(null);},Oe=r=>{Me(r.currentTarget);};useEffect(()=>{if(!y){if(n===1)return;C(Z(e));}},[y]),useEffect(()=>{if(e){let r=Z(e);ke(r),C(r),P.current&&P.current.set("date",r[0]);}},[e]),useEffect(()=>{Se(l??null);},[l,y]);let Re=()=>{ke(x$1),Y();let r;x$1[0].dayOfYear===x$1[1].dayOfYear?r=[x$1[0],x$1[1]]:r=[M(x$1[0]),B(x$1[1])],o([r[0].toDate(),r[1].toDate()]),c?.(ve||"day"),d?.(ze);},jo=useCallback(()=>{let r=w[0].format("MMM D"),$=w[1]?w[1].format("MMM D"):w[0].format("MMM D");return r===$&&!p?r:`${r} - ${$}`},[w,p]),Yo=r=>{if(r.length<2||!s){C(r);return}let $=M(r[0]).toDate(),Qo=B(r[1]).toDate(),Pe=It(Qo).diff($,"day");if(Pe<=s){C(r);return}Ee(true),C([r[0],r[1].subtract(Pe-s,"d")]),setTimeout(()=>{Ee(false);},3e3);},$o=r=>{C([M(r[0]),B(r[1])]),P.current&&P.current.set("date",r[0]);},Go=r=>{r.key==="Enter"&&x$1[1]&&!Be?(r.stopPropagation(),Re()):r.key==="Escape"&&(r.stopPropagation(),Y());};return jsxs(vo,{id:Ho,"data-testid":"RangeCalender",sx:j,children:[D?D(y,Oe):jsx(To,{onClick:Oe,open:y,children:(w[0]||w[1])&&jo()}),y&&jsx(a$1,{onClick:r=>{r.stopPropagation(),Y();}}),jsx(bt,{open:y,anchorEl:De,placement:"bottom-end",...te,children:jsxs(ho,{onKeyDown:Go,$isSingleMonth:n===1,children:[!m&&jsxs(zo,{children:[jsx(lo,{onChange:$o,isHijri:ne}),jsxs(Do,{children:[u&&jsx(eo,{groupBy:ve,isCalenderOpen:y,onUpdate:r=>{Wo(r);}}),jsx(no,{isHijri:ne,onCalendarModeSwitch:t})]})]}),jsxs(S,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[jsx(co,{values:x$1,onChange:Yo,isHijri:ne,ref:P,numberOfMonths:n,...Fo}),jsx(x,{in:Be&&!!s,children:jsx(a$2,{error:re("dateRangeError",{number:s}),sx:{marginInline:"16px",marginBottom:"16px"}})}),jsxs(ko,{sx:{borderBottomLeftRadius:"8px"},children:[!p&&Ce&&a&&Te&&jsx(So,{children:jsx(bo,{onChange:Se,selectedTimezone:ze,browserTimezone:a,defaultCountryTimezone:Ce,timezoneCountriesCodes:Te},String(y))}),new DateObject(x$1[0]).dayOfYear===new DateObject(x$1[1]).dayOfYear&&jsx(Io,{values:x$1,setValues:C}),jsxs(Co,{children:[jsx(yo,{variant:"contained",onClick:Y,children:re("cancel")}),jsx(wo,{variant:"contained",onClick:Re,disabled:!x$1[1],children:re("okay")})]})]})]})]})})]})}var Ao=At;var bi=Ao;export{bi as a};
|