@tap-payments/os-micro-frontend-shared 0.3.297 → 0.3.299

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/build/_chunks/chunk-4TI3DO2I.js +2 -0
  2. package/build/_chunks/chunk-BFJT5WSV.js +0 -0
  3. package/build/_chunks/chunk-CUKFER4H.js +1 -0
  4. package/build/_chunks/{chunk-5W3FKPP7.js → chunk-E4LADATG.js} +1 -1
  5. package/build/_chunks/{chunk-YA3JU4XB.js → chunk-G6PIEK53.js} +1 -1
  6. package/build/_chunks/chunk-IKGDJDP5.js +1 -0
  7. package/build/_chunks/chunk-IXFXTDH7.js +1 -0
  8. package/build/_chunks/chunk-S5UJ7YPE.js +2 -0
  9. package/build/components/Calender/index.d.ts +3 -3
  10. package/build/components/Calender/index.js +1 -1
  11. package/build/components/ColumnViews/index.js +1 -1
  12. package/build/components/DateFilter/index.js +1 -1
  13. package/build/components/DateInput/index.d.ts +3 -5
  14. package/build/components/DateInput/index.js +1 -1
  15. package/build/components/FilterDropdown/index.js +1 -1
  16. package/build/components/ListColumnFilter/index.js +1 -1
  17. package/build/components/ListHeader/index.js +1 -1
  18. package/build/components/PhoneFilter/index.js +1 -1
  19. package/build/components/RangeCalender/index.js +1 -1
  20. package/build/components/StatusFilter/index.js +1 -1
  21. package/build/components/StatusIcons/index.js +1 -1
  22. package/build/components/TableCells/CustomCells/DueDateCell/DueDateCell.d.ts +5 -4
  23. package/build/components/TableCells/CustomCells/DueDateCell/index.d.ts +1 -0
  24. package/build/components/TableCells/CustomCells/InvoiceStatusCell/utils.d.ts +1 -0
  25. package/build/components/TableCells/index.js +1 -1
  26. package/build/components/Timepicker/index.d.ts +3 -5
  27. package/build/components/Timepicker/index.js +1 -1
  28. package/build/components/index.js +1 -1
  29. package/build/components/modules/RangeCalender/index.js +1 -1
  30. package/build/components/modules/WindowShell/index.js +1 -1
  31. package/build/components/modules/index.js +1 -1
  32. package/build/datetime/components/DateInput/index.d.ts +5 -0
  33. package/build/{components → datetime/components}/DateInput/style.d.ts +1 -1
  34. package/build/{components → datetime/components}/DateInput/type.d.ts +2 -2
  35. package/build/{components → datetime/components}/DateInput/utils.d.ts +1 -1
  36. package/build/{components/Calender/Calender.d.ts → datetime/components/DatePicker/DatePicker.d.ts} +7 -6
  37. package/build/datetime/components/DatePicker/index.d.ts +4 -0
  38. package/build/{components/Calender → datetime/components/DatePicker}/style.d.ts +3 -3
  39. package/build/datetime/components/DateRangeCalendar/TimePicker/TimePicker.d.ts +3 -1
  40. package/build/datetime/components/DateRangeCalendar/types.d.ts +2 -0
  41. package/build/datetime/components/TimePicker/TimePicker.d.ts +16 -0
  42. package/build/datetime/components/TimePicker/index.d.ts +6 -0
  43. package/build/{components/Timepicker → datetime/components/TimePicker}/style.d.ts +3 -3
  44. package/build/datetime/components/ZonedDueDateCell/ZonedDueDateCell.d.ts +5 -0
  45. package/build/datetime/components/ZonedDueDateCell/index.d.ts +2 -0
  46. package/build/{components/TableCells/CustomCells/DueDateCell → datetime/components/ZonedDueDateCell}/style.d.ts +1 -1
  47. package/build/datetime/components/ZonedDueDateCell/types.d.ts +13 -0
  48. package/build/datetime/components/index.d.ts +8 -0
  49. package/build/datetime/components/index.js +1 -1
  50. package/build/datetime/index.js +1 -1
  51. package/build/index.js +1 -1
  52. package/package.json +1 -1
  53. package/build/_chunks/chunk-BE2RKFQJ.js +0 -1
  54. package/build/_chunks/chunk-F5BIYZTP.js +0 -1
  55. package/build/_chunks/chunk-LQM3Z2DG.js +0 -2
  56. package/build/_chunks/chunk-P4O6ZUHX.js +0 -1
  57. package/build/_chunks/chunk-SFSBWZ7X.js +0 -2
  58. package/build/components/TableCells/CustomCells/DueDateCell/type.d.ts +0 -6
  59. package/build/components/TableCells/CustomCells/DueDateCell/utils.d.ts +0 -9
  60. package/build/components/Timepicker/Timepicker.d.ts +0 -16
  61. /package/build/{components → datetime/components}/DateInput/DateInput.d.ts +0 -0
  62. /package/build/{components → datetime/components}/DateInput/constants.d.ts +0 -0
  63. /package/build/{components → datetime/components}/DateInput/icons.d.ts +0 -0
  64. /package/build/{components/Timepicker → datetime/components/TimePicker}/constant.d.ts +0 -0
  65. /package/build/{components/Timepicker → datetime/components/TimePicker}/utils.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-WFI7MJL2.js';import {a as a$1}from'./chunk-XGCSZNS4.js';import {aa,ba}from'./chunk-LLM6NHYM.js';import {Xb,Hb}from'./chunk-6HNOCQKM.js';import {forwardRef,useState,useMemo,useCallback,memo}from'react';import w from'@mui/material/Box';import {jsxs,jsx}from'react/jsx-runtime';import {styled,alpha}from'@mui/material/styles';import Ke from'react-date-object';import q from'react-date-object/calendars/arabic';import Xe from'react-date-object/calendars/gregorian';import K from'react-date-object/locales/arabic_en';import et from'react-date-object/locales/gregorian_en';var r={gregorian:"gregorian",hijri:"hijri"};var s="os-shared-DateInput",a={root:`${s}-root`,card:`${s}-card`,header:`${s}-header`,label:`${s}-label`,parts:`${s}-parts`,day:`${s}-day`,month:`${s}-month`,year:`${s}-year`,switcher:`${s}-switcher`,switcherLabel:`${s}-switcherLabel`,helperText:`${s}-helperText`},ge=r.gregorian,De="Day",Me="Month",Se="Year",we="Switch to Hijri Calendar",Ce="Switch to Gregorian Calendar",$e=4,Pe=8,Ve=.85,J=.55,Oe=4,S={day:52,year:72},je={day:44},ke={day:1,month:3,year:1},ve=200,U=1900,Fe=10,Le=["January","February","March","April","May","June","July","August","September","October","November","December"],He=["Muharram","Safar","Rabi' al-Awwal","Rabi' al-Thani","Jumada al-Awwal","Jumada al-Thani","Rajab","Sha'ban","Ramadan","Shawwal","Dhul-Qa'dah","Dhul-Hijjah"],Ne={day:null,month:null,year:null},vt=256,be=30,Ie={height:be,minHeight:be,boxSizing:"border-box"},D={MenuListProps:{sx:{gap:0}},PaperProps:{sx:{maxHeight:vt,[`& .${a$1.option}`]:Ie,"& .MuiMenuItem-root":Ie}}},We={...D,PaperProps:{...D.PaperProps,sx:{...D.PaperProps.sx,minWidth:S.year}}};function Re(e){return jsxs("svg",{width:12,height:12,viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":true,...e,children:[jsx("path",{d:"M7.375 8.625H1.625C0.935 8.625 0.375 8.065 0.375 7.375V1.625C0.375 0.935 0.935 0.375 1.625 0.375H7.375C8.065 0.375 8.625 0.935 8.625 1.625V7.375C8.625 8.065 8.065 8.625 7.375 8.625Z",stroke:"currentColor",strokeWidth:"0.75"}),jsx("path",{d:"M0.375 2.375H8.625",stroke:"currentColor",strokeWidth:"0.75"}),jsx("circle",{cx:"2.375",cy:"4.375",r:"0.625",fill:"currentColor"}),jsx("circle",{cx:"4.5",cy:"4.375",r:"0.625",fill:"currentColor"}),jsx("circle",{cx:"6.625",cy:"4.375",r:"0.625",fill:"currentColor"}),jsx("circle",{cx:"2.375",cy:"6.625",r:"0.625",fill:"currentColor"}),jsx("circle",{cx:"4.5",cy:"6.625",r:"0.625",fill:"currentColor"})]})}var{day:Lt,month:Ht,year:Nt}=ke,Te=[`& .${a.day}`,`& .${a.month}`,`& .${a.year}`].join(", "),Q={boxSizing:"border-box",maxWidth:"100%",overflow:"hidden",minWidth:0},Ye=styled(w)({display:"flex",flexDirection:"column",width:"100%",minWidth:0,containerType:"inline-size"}),Ge=styled(w,{shouldForwardProp:e=>!["$error","$feedbackType","$hasSwitcher","$hasFeedback"].includes(e)})(({theme:e,$error:t,$feedbackType:n,$hasSwitcher:o,$hasFeedback:l})=>{let m=(n?aa(e,n).borderColor:void 0)??(t?e.palette.error.main:e.v2.palette.grey[100]),y=`${$e}px`,P=l?0:o?`${Pe}px`:y;return {display:"flex",flexDirection:"column",width:"100%",overflow:"hidden",boxSizing:"border-box",backgroundColor:e.palette.common.white,border:`1px solid ${m}`,borderBottom:l?"none":`1px solid ${m}`,borderRadius:`${y} ${y} ${P} ${P}`,"& .MuiInputBase-root.Mui-disabled":{opacity:Ve}}}),Be=styled(w)({display:"flex",flexDirection:"column",gap:8,padding:8,boxSizing:"border-box",width:"100%"}),ze=styled(w)({display:"flex",alignItems:"center",gap:4,minHeight:10}),Ee=styled("span")(({theme:e})=>({fontSize:10,fontWeight:500,fontStyle:"normal",lineHeight:"100%",letterSpacing:0,color:e.palette.grey[700]})),Ae=styled(w)({"--date-input-day-min":`${S.day}px`,"--date-input-year-min":`${S.year}px`,display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"flex-start",gap:Oe,width:"100%",minWidth:0,boxSizing:"border-box",[`& .${a.day}`]:{...Q,flex:`${Lt} 0 0`,minWidth:"var(--date-input-day-min)"},[`& .${a.month}`]:{...Q,flex:`${Ht} 0 0`},[`& .${a.year}`]:{...Q,flex:`${Nt} 0 0`,minWidth:"var(--date-input-year-min)"},[`${Te} .MuiFormControl-root, ${Te} .MuiInputBase-root`]:{width:"100%",maxWidth:"100%",boxSizing:"border-box"},[`& .${a.day} .MuiFormControl-root`]:{minWidth:"var(--date-input-day-min)"},[`& .${a.month} .MuiFormControl-root`]:{minWidth:0},[`& .${a.year} .MuiFormControl-root`]:{minWidth:"var(--date-input-year-min)"},[`& .${a.year} .${a$1.value}`]:{flex:"0 0 auto",minWidth:"4ch",fontVariantNumeric:"tabular-nums",textOverflow:"clip"},[`@container (max-width: ${ve}px)`]:{"--date-input-day-min":`${je.day}px`,[`& .${a.day}`]:{flex:"0 0 var(--date-input-day-min)"},[`& .${a.month}`]:{flex:"1 1 0"},[`& .${a.year}`]:{flex:"0 0 var(--date-input-year-min)"}}}),Je=styled("button")(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",width:"100%",minHeight:32,margin:0,padding:8,boxSizing:"border-box",border:"none",borderRadius:0,backgroundColor:alpha(e.palette.common.black,.05),color:e.palette.text.primary,cursor:"pointer",appearance:"none",fontFamily:"inherit",whiteSpace:"nowrap","&:hover:not(:disabled)":{backgroundColor:alpha(e.palette.common.black,.08)},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"},"&:focus-visible:not(:disabled)":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:-2}})),Ue=styled("span")({display:"inline-flex",flexDirection:"row",flexWrap:"nowrap",alignItems:"center",gap:4,minWidth:0,whiteSpace:"nowrap"}),Qe=styled("span",{shouldForwardProp:e=>e!=="$disabled"})(({$disabled:e=false})=>({width:12,height:12,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:e?J:1,"& svg":{display:"block",width:12,height:12}})),Ze=styled("span",{shouldForwardProp:e=>e!=="$disabled"})(({theme:e,$disabled:t=false})=>({display:"block",fontSize:10,fontWeight:500,fontStyle:"normal",lineHeight:"16px",letterSpacing:0,whiteSpace:"nowrap",color:e.v2.palette.base.black,opacity:t?J:1})),_e=styled("small",{shouldForwardProp:e=>e!=="$error"})(({theme:e,$error:t})=>({color:t?e.palette.error.main:alpha(e.palette.common.black,.6),fontSize:10,lineHeight:"10px",marginTop:4,display:"block"})),F={width:"100%",maxWidth:"100%"},qe={...F,minWidth:0};function i(e){if(e==null||e==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}function tt(e){return i(e.day)!=null&&i(e.month)!=null&&i(e.year)!=null}function at(e){return {day:e.day,month:e.month.number,year:e.year}}function rt(e,t){let n=i(e.day),o=i(e.month),l=i(e.year);if(n==null||o==null||l==null)return null;let u=t===r.hijri,m=new Ke({year:l,month:o,day:1,calendar:u?q:Xe,locale:u?K:et}),y=m.month.length;return m.setDay(Math.min(Math.max(n,1),y)),m}function _(e){let t=rt(e,r.gregorian);return t?(t.convert(q,K),at(t)):null}function Wt(e){let t=rt(e,r.hijri);return t?(t.convert(Xe,et),at(t)):null}function nt(e,t){return t!==r.hijri?e:_(e)??{day:null,month:null,year:null}}function ot(e,t){return t!==r.hijri?e:Wt(e)}function Rt(e,t){return new Date(e,t,0).getDate()}function X(e,t,n){return t==null||t<1||t>12?30:n===r.hijri?e==null?30:new Ke({year:e,month:t,day:1,calendar:q,locale:K}).month.length:Rt(e??2001,t)}function lt(e){let t=Math.max(1,Math.min(31,Math.floor(e)));return Array.from({length:t},(n,o)=>{let l=o+1;return {value:l,label:String(l)}})}function it(e){return (e===r.hijri?He:Le).map((n,o)=>({value:o+1,label:n}))}function pt(e,t){let n=Math.floor(Math.min(e,t)),o=Math.floor(Math.max(e,t)),l=[];for(let u=o;u>=n;u-=1)l.push({value:u,label:String(u)});return l}function ut(e,t){let n=_({day:1,month:1,year:e}),o=_({day:31,month:12,year:t});return {yearMin:i(n?.year)??e,yearMax:i(o?.year)??t}}function dt(){return new Date().getFullYear()+Fe}function st(e,t){let n=i(e.day);if(n==null)return e;let o=X(i(e.year),i(e.month),t);return n<=o?e:{...e,day:o}}function ct(e){return e===r.hijri?r.gregorian:r.hijri}function mt(e){return e==null?null:Array.isArray(e)?e[0]??null:e}var ht=forwardRef(function({label:t,value:n,onChange:o,dayOptions:l,monthOptions:u,yearOptions:m,dayLabel:y=De,monthLabel:P=Me,yearLabel:xt=Se,hasCalendarSwitcher:re=false,calendarMode:ne,onCalendarModeChange:oe,switcherLabel:ft,yearMin:H=U,yearMax:yt,disabled:x=false,error:bt=false,helperText:le,feedback:N,id:M="DateInput",className:It,sx:gt,dateInputClassNames:f},Dt){let W=n!==void 0,[Mt,St]=useState(Ne),R=W?n:Mt,T=ne!==void 0,[wt,Ct]=useState(ge),V=T?ne:wt,[ie,Y]=useState(null),$t=!!(l||u||m),b=V===r.hijri&&!$t,{isProvided:pe,isVisible:ue,type:Pt}=Xb(N),de=!!bt&&!pe,se=t?.trim()??"",ce=ft??(V===r.hijri?Ce:we),I=useMemo(()=>{if(!b)return R;let d=nt(R,r.hijri);return tt(d)?d:ie??d},[ie,b,R]),G=yt??dt(),O=useMemo(()=>b?ut(H,G):{yearMin:H,yearMax:G},[b,G,H]),B=b?r.hijri:r.gregorian,me=X(i(I.year),i(I.month),B),Vt=useMemo(()=>l??lt(me),[me,l]),Ot=useMemo(()=>u??it(B),[B,u]),jt=useMemo(()=>m??pt(O.yearMin,O.yearMax),[O.yearMax,O.yearMin,m]),z=useCallback(d=>{let j=l?d:st(d,r.gregorian);W||St(j),o?.(j);},[l,W,o]),E=useCallback(d=>j=>{let A={...I,[d]:mt(j)};if(!b){z(A);return}let he=ot(A,r.hijri);if(he){Y(null),z(he);return}Y(A);},[z,I,b]),kt=useCallback(()=>{if(x)return;let d=ct(V);Y(null),T||Ct(d),oe?.(d);},[V,x,T,oe]);return jsxs(Ye,{ref:Dt,id:M,"data-testid":"DateInput",className:Hb(a.root,f?.root,It),sx:gt,children:[jsxs(Ge,{className:Hb(a.card,f?.card),$error:de,$feedbackType:ue?Pt:void 0,$hasSwitcher:re,$hasFeedback:ue,children:[jsxs(Be,{children:[se?jsx(ze,{className:Hb(a.header,f?.header),children:jsx(Ee,{className:Hb(a.label,f?.label),children:se})}):null,jsxs(Ae,{className:Hb(a.parts,f?.parts),children:[jsx(w,{className:a.day,children:jsx(a$2,{id:`${M}-day`,label:y,options:Vt,value:I.day,onChange:E("day"),disabled:x,MenuProps:D,sx:F})}),jsx(w,{className:a.month,children:jsx(a$2,{id:`${M}-month`,label:P,options:Ot,value:I.month,onChange:E("month"),disabled:x,MenuProps:D,sx:qe})}),jsx(w,{className:a.year,children:jsx(a$2,{id:`${M}-year`,label:xt,options:jt,value:I.year,onChange:E("year"),disabled:x,MenuProps:We,sx:F})})]})]}),re?jsx(Je,{type:"button",id:`${M}-switcher`,className:Hb(a.switcher,f?.switcher),onClick:kt,disabled:x,"aria-label":ce,children:jsxs(Ue,{children:[jsx(Qe,{$disabled:x,children:jsx(Re,{"aria-hidden":true})}),jsx(Ze,{className:Hb(a.switcherLabel,f?.switcherLabel),$disabled:x,children:ce})]})}):null]}),N?jsx(ba,{...N}):null,!pe&&le?jsx(_e,{className:Hb(a.helperText,f?.helperText),$error:de,children:le}):null]})});ht.displayName="DateInput";var L=memo(ht);
2
+ export{r as a,a as b,L as c};
File without changes
@@ -0,0 +1 @@
1
+ import {a,d,b,c,j as j$1,e}from'./chunk-IKGDJDP5.js';import {fc,gc}from'./chunk-VRGBJY4Q.js';import {memo,useState}from'react';import Z from'@mui/material/ClickAwayListener';import _ from'@mui/material/Popper';import {useTranslation}from'react-i18next';import {DateObject,Calendar}from'react-multi-date-picker';import l from'@mui/material/Box';import s from'@mui/material/Button';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var j=styled(s)(()=>({minWidth:"auto",padding:0,"& > img":{cursor:"pointer"}})),z=styled(l)(()=>({position:"relative"})),H=styled(l,{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"}})),W=styled(s,{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]}})),R=styled(l)(({theme:t})=>({display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8,padding:"16px",borderTop:`1px solid ${t.palette.divider}`})),A=styled(s)(({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}})),E=styled(s)(({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}})),Y=styled(l)(()=>({display:"flex",gap:"8px"}));var re=["Su","Mo","Tu","We","Th","Fr","Sa"];function oe({id:t="date-picker",isAr:e$1=false,value:o,setValue:D,enableTimePicker:d$1,placement:L,sx:I,...N}){let[y,w]=useState(null),[P,V]=useState(o?new DateObject(new Date(o.toLocaleString())):new DateObject(new Date)),[T,u]=useState(o?new DateObject(new Date(o.toLocaleString())):new DateObject(new Date)),$=o?.hour?a(o.hour):d(),q=o?.hour?b(o.hour):b(new Date().getHours()),[p,G]=useState({hour:$,minute:o?.minute??c(),period:q}),{t:C}=useTranslation(),f=!!y,J=r=>r==="right"?e$1?fc:gc:e$1?gc:fc,K=r=>{w(r.currentTarget);},x=()=>{w(null);},Q=()=>{let r=p.hour;d$1&&(r=e(p.hour,p.period||"AM"));let i=d$1?T.setHour(r).setMinute(p.minute):T;V(i),D&&D(i),x();},U=r=>{G(r);};return jsx(Z,{onClickAway:x,children:jsxs(z,{sx:{...I},id:t,"data-testid":"DatePicker",children:[jsx(W,{onClick:K,open:f,className:"date-picker-button",children:P.format("MMM D, YYYY")}),jsx(_,{open:f,anchorEl:y,placement:L,children:jsxs(H,{className:"date-picker-popover",open:f,children:[jsx(Calendar,{numberOfMonths:1,format:"MMM DD YYYY",monthYearSeparator:" ",renderButton:(r,i)=>jsx(j,{onClick:i,children:jsx("img",{src:J(r),alt:"arrow"})}),onMonthChange:r=>{u(r);},onYearChange:r=>{u(r);},onChange:r=>{u(r);},weekDays:e$1?void 0:re,minDate:new Date,value:P,...N}),jsxs(R,{sx:{...d$1&&{justifyContent:"space-between"}},children:[d$1&&jsx(j$1,{enableRealTimeChange:true,onChange:U,defaultTime:p}),jsxs(Y,{children:[jsx(A,{variant:"contained",onClick:x,children:C("cancel")}),jsx(E,{variant:"contained",onClick:Q,children:C("okay")})]})]})]})})]})})}var F=memo(oe);var ae=F;export{F as a,ae as b};
@@ -1 +1 @@
1
- import {h as h$1,i,b as b$1,c as c$2,f as f$2,e,d as d$1,j as j$1}from'./chunk-GZT6TVCH.js';import {d,c as c$1}from'./chunk-MXFH4OXG.js';import {f,g,h as h$2,i as i$1,b}from'./chunk-YUT3GEP2.js';import {h,c,f as f$1}from'./chunk-ISC5KT5E.js';import {Gb,Hb}from'./chunk-6HNOCQKM.js';import'./chunk-VRGBJY4Q.js';import {memo,forwardRef,useState,useEffect,useRef}from'react';import {createPortal}from'react-dom';import oo from'@mui/material/Backdrop';import {styled,alpha}from'@mui/material/styles';import v from'@mui/material/Box';import {motion,animate}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var H="os-shared-WindowShell",x={root:`${H}-root`,sidebar:`${H}-sidebar`,body:`${H}-body`,panel:`${H}-panel`};var we=styled(v)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",backgroundColor:"transparent"})),xe=styled(v)(()=>({flexShrink:0,overflow:"hidden auto",backgroundColor:"transparent",transition:"none"})),be=styled(v)(({theme:e})=>({flexShrink:0,overflow:"hidden auto",borderLeft:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",transition:"none"})),ye=styled(v)(()=>({display:"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0})),ze=styled(v,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative",width:e})),Ne=styled(motion.div)(()=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative"})),Ce=styled(motion.div,{shouldForwardProp:e=>e!=="$slotWidth"})(({$slotWidth:e})=>({width:e,minWidth:e,minHeight:"100%",height:"100%",overflow:"hidden"})),Ie=styled(v,{shouldForwardProp:e=>e!=="$visible"&&e!=="$duration"})(({$visible:e=true,$duration:o=h})=>({display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,maxWidth:e?160:0,opacity:e?1:0,pointerEvents:e?"auto":"none",transition:o>0?`max-width ${.3*o}s ease-in-out, opacity ${.24*o}s ease-in-out`:"none"})),Te=styled(h$1,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e}:null})),Pe=styled(i,{shouldForwardProp:e=>e!=="$width"&&e!=="$justifyContent"})(({$width:e,$justifyContent:o="flex-start"})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e,justifyContent:o}:null}));var Ue=220;function ge(e,o,a){return Math.min(Math.max(e,o??0),a??1/0)}function Ae(e,o,a,n){if(Math.abs(e-o)<=1)return;let r=animate(0,1,{duration:a,onUpdate:t=>{n(s=>({...s,width:e+(o-e)*t}));}});return ()=>r.stop()}function G(e,o){if(e===false)return {duration:0,resize:o};let a=typeof e=="object"?e:void 0,n=a?.duration;return {duration:typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):h,resize:a?.resize??o}}function j(e){return e?.children==null||e.expand?.isExpanded===false?false:e.expand?.isExpanded===true}function F(e,o=Ue){let a=Array.isArray(e)?e.flat():[e];for(let n=a.length-1;n>=0;n--){let r=a[n];if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.width=="number")return r.width}return o}function Ee(e){let o=e["data-id"]??e.id;return o!=null?{"data-id":o}:{}}function Me({kind:e,slot:o,isOpen:a,fullWidth:n,wrapperWidth:r,animateWrapperWidth:t,animation:s}){let p=e==="sidebar"?xe:be,d=e==="sidebar"?x.sidebar:x.panel,m=o["data-testid"]?`${o["data-testid"]}Wrapper`:e==="sidebar"?"WindowShellSidebarWrapper":"WindowShellPanelWrapper",i=o["data-testid"]??o.id??(e==="sidebar"?"WindowShellSidebar":"WindowShellPanel"),l=Ee(o),u=jsx(p,{id:o.id,className:Hb(d,o.className),"data-testid":i,...l,sx:Gb({width:n,minWidth:0},o.sx),children:jsx(Ce,{$slotWidth:n,initial:false,animate:{x:a?0:-n},transition:{duration:s.duration},children:o.children})});return t?jsx(Ne,{"data-testid":m,...l,initial:false,animate:{width:r},transition:{duration:s.duration},children:u}):jsx(ze,{"data-testid":m,...l,$width:r,children:u})}Me.displayName="WindowShellSlotColumn";var J=memo(Me);function De({baseWindowWidth:e,sidebar:o,panel:a,content:n,bodyContent:r,sidebarOpen:t,showPanel:s,sidebarFullWidth:p,panelFullWidth:d,sidebarAnimation:m,panelAnimation:i}){let{size:l}=b(),u=i.resize==="window",W=typeof e=="number"?Math.max(0,e-(u?d:0)-(m.resize==="window"&&!t?p:0)):l.width,b$1=u?s?Math.min(d,Math.max(0,l.width-W)):0:s?d:0,y=t?p:0;return jsxs(we,{className:Hb(x.root),children:[o?.children?jsx(J,{kind:"sidebar",slot:o,isOpen:t,fullWidth:p,wrapperWidth:y,animateWrapperWidth:true,animation:m}):null,jsx(ye,{id:n?.id?`${n.id}Body`:void 0,className:Hb(x.body,n?.className),"data-testid":n?.["data-testid"]?`${n["data-testid"]}Body`:n?.id?`${n.id}Body`:"WindowShellBody",...(n?.["data-id"]??n?.id)!=null?{"data-id":n?.["data-id"]?`${n["data-id"]}Body`:`${n?.id}Body`}:null,sx:n?.sx,children:r}),a?.children?jsx(J,{kind:"panel",slot:a,isOpen:s,fullWidth:d,wrapperWidth:b$1,animateWrapperWidth:!u,animation:i}):null]})}De.displayName="WindowShellSlotsLayout";var Re=memo(De);function $e({sidebarOpen:e,showPanel:o,sidebarResize:a,panelResize:n,sidebarDuration:r,panelDuration:t}){let{size:s,setSize:p,defaultSize:d,minSize:m,maxSize:i}=b(),l=useRef(s);l.current=s;let u=useRef(d.width),W=useRef(e),b$1=useRef(o),y=useRef(d.width);return useEffect(()=>{let C=b$1.current!==o,w=W.current!==e,E=y.current!==d.width;b$1.current=o,W.current=e,y.current=d.width;let S;if(w&&a==="window"?S=r:(C&&n==="window"||E&&!C&&!w)&&(S=t),S==null)return;let h=ge(d.width,m?.width,i?.width);return u.current=h,Ae(l.current.width,h,S,p)},[d.width,o,e,a,n,r,t,m?.width,i?.width,p]),null}$e.displayName="WindowShellAnimator";var Oe=memo($e);function ve({toolbar:e$1,sidebar:o,panel:a,animationDuration:n=h}){let{title:r,titleIcon:t,onClose:s,onMinimize:p,onMaximize:d,startAdornment:m,endAdornment:i,id:l,className:u,"data-testid":W,"data-id":b$2,sx:y}=e$1??{},{isMaximized:C}=b(),w=typeof s=="function"?s:void 0,E=typeof p=="function"?p:void 0,S=typeof d=="function"?d:void 0,h=o?.expand,c=a?.expand,z=j(a),L=h?.isExpanded??true,M=h!=null&&o?.children!=null,D=c!=null&&a?.children!=null&&z,k=M&&D,V=F(a?.sx),_=o!=null?F(o.sx):0,I=Math.max(_,V),T=k&&L?I:void 0,Z=D?I:void 0,X=D;return jsxs(b$1,{id:l??f$1,className:u,"data-testid":W??l??"WindowToolbar","data-id":b$2??l,sx:y,children:[jsxs(Te,{$width:T,children:[w?jsx(c$2,{onClick:w}):null,E?jsx(f$2,{onClick:E}):null,S?jsx(e,{isMaximized:C,onClick:S}):null,M&&h?jsx(d$1,{direction:h.isExpanded??true?"left":"right",active:h.isExpanded??true,onClick:h.onExpand,children:h.label}):null,m]}),jsx(j$1,{title:r,icon:t}),jsxs(Pe,{$width:Z,$justifyContent:i?"space-between":"flex-start",children:[D?jsx(Ie,{$visible:X,$duration:n,children:jsx(d$1,{sx:{flexShrink:0},direction:c?.isExpanded??true?"left":"right",active:z,onClick:c?.onExpand,children:c?.label})}):null,i]})]})}ve.displayName="WindowShellToolbar";var Fe=memo(ve);var Be=forwardRef(function({isOpen:o,className:a,sx:n,toolbar:r,services:t,sidebar:s,panel:p,footer:d$1,content:m,window:i,backdrop:l},u){let W=t?.list??[],b=(t?.isLoading??false)||W.length>0,y=d$1!=null&&(d$1.isVisible??true),C=s?.children,w=F(s?.sx),E=p?.children,S=p!=null?F(p.sx):0,h=m?.children,c$2=s?.expand?.isExpanded??C!=null,z=j(p),L=!!(C||E),[M,D]=useState(w),[k,V]=useState(S);useEffect(()=>{c$2&&D(w),z&&V(S);},[c$2,w,z,S]);let _=r?.onClose??r?.onMinimize??(()=>{}),I=G(s?.animation,"in-place"),T=G(p?.animation,"in-place"),Z=(()=>{let P=i?.defaultSize;if(typeof P?.width!="number")return P;let oe=(I.resize==="window"&&!c$2?M:0)+(T.resize==="window"&&!z?k:0);return oe>0?{...P,width:Math.max(0,P.width-oe)}:P})(),X={height:i?.minSize?.height??i?.defaultSize?.height??c,...i?.minSize?.width!=null?{width:i.minSize.width}:null},Le=l!=null&&(l.isVisible??true)&&o&&!i?.isMinimized,_e=(i?.order??0)+10-1,ee=jsx(oo,{open:true,onClick:_,id:l?.id,className:l?.className,"data-testid":l?.["data-testid"]??l?.id??"WindowShellBackdrop",...(l?.["data-id"]??l?.id)!=null?{"data-id":l?.["data-id"]??l?.id}:null,sx:Gb({zIndex:_e,backgroundColor:P=>alpha(P.palette.common.black,.3)},l?.sx)});return jsxs(Fragment,{children:[Le&&(i?.disablePortal?ee:createPortal(ee,document.body)),jsxs(f,{ref:u,isOpen:o,onClose:_,defaultSize:Z,minSize:X,maxSize:i?.maxSize,defaultPosition:i?.defaultPosition,containerRef:i?.containerRef,order:i?.order,isMinimized:i?.isMinimized,isMaximized:i?.isMaximized,id:i?.id,className:Hb(x.root,i?.className,a),sx:n,onResize:i?.onResize,onDragStart:i?.onDragStart,onMouseDown:i?.onMouseDown,onClick:i?.onClick,disablePortal:i?.disablePortal,"data-testid":i?.["data-testid"]??i?.id,"data-id":i?.["data-id"]??i?.id,children:[jsx(Oe,{sidebarOpen:c$2,showPanel:z,sidebarWidth:M,panelWidth:k,sidebarResize:I.resize,panelResize:T.resize,sidebarDuration:I.duration,panelDuration:T.duration}),jsx(Fe,{toolbar:r,sidebar:s,panel:p,animationDuration:T.duration}),b?t?.isLoading?jsx(d,{appCode:t?.appCode,id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:Gb({height:"auto",flexShrink:0},t?.sx)}):jsx(c$1,{services:W,serviceCode:t?.activeCode??"",onOpenService:t?.onOpen,onOpenServiceInNewWindow:t?.onOpenInNewWindow,language:t?.language??"en",openInNewWindowLabel:t?.openInNewWindowLabel??"Open in new window",id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:t?.sx}):null,jsx(g,{id:m?.id,className:m?.className,"data-testid":m?.["data-testid"]??m?.id,"data-id":m?.["data-id"]??m?.id,sx:L?void 0:m?.sx,children:L?jsx(Re,{baseWindowWidth:typeof i?.defaultSize?.width=="number"?i.defaultSize.width:void 0,sidebar:s,panel:p,content:m,bodyContent:h,sidebarOpen:c$2,showPanel:z,sidebarFullWidth:M,panelFullWidth:k,sidebarAnimation:I,panelAnimation:T}):h}),y?jsxs(h$2,{id:d$1?.id,className:d$1?.className,"data-testid":d$1?.["data-testid"]??d$1?.id,"data-id":d$1?.["data-id"]??d$1?.id,sx:d$1?.isVisible===true?Gb(d$1?.sx??{},{"&:empty, &:has(> :only-child:empty)":{display:"flex"}}):d$1?.sx,children:[d$1?.children,d$1?.actions?jsx(i$1,{children:d$1.actions}):null]}):null]})]})});Be.displayName="WindowShell";var to=memo(Be);export{x as a,to as b};
1
+ import {h as h$1,i,b as b$1,c as c$2,f as f$2,e,d as d$1,j as j$1}from'./chunk-GZT6TVCH.js';import {f,g,h as h$2,i as i$1,b}from'./chunk-YUT3GEP2.js';import {d,c as c$1}from'./chunk-MXFH4OXG.js';import {h,c,f as f$1}from'./chunk-ISC5KT5E.js';import {Gb,Hb}from'./chunk-6HNOCQKM.js';import'./chunk-VRGBJY4Q.js';import {memo,forwardRef,useState,useEffect,useRef}from'react';import {createPortal}from'react-dom';import oo from'@mui/material/Backdrop';import {styled,alpha}from'@mui/material/styles';import v from'@mui/material/Box';import {motion,animate}from'framer-motion';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var H="os-shared-WindowShell",x={root:`${H}-root`,sidebar:`${H}-sidebar`,body:`${H}-body`,panel:`${H}-panel`};var we=styled(v)(()=>({display:"flex",flexDirection:"row",flex:1,minHeight:0,height:"100%",backgroundColor:"transparent"})),xe=styled(v)(()=>({flexShrink:0,overflow:"hidden auto",backgroundColor:"transparent",transition:"none"})),be=styled(v)(({theme:e})=>({flexShrink:0,overflow:"hidden auto",borderLeft:`1px solid ${e.palette.divider}`,backgroundColor:"transparent",transition:"none"})),ye=styled(v)(()=>({display:"flex",flexDirection:"column",flex:1,minWidth:0,minHeight:0})),ze=styled(v,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative",width:e})),Ne=styled(motion.div)(()=>({flexShrink:0,overflow:"hidden",display:"flex",alignItems:"stretch",position:"relative"})),Ce=styled(motion.div,{shouldForwardProp:e=>e!=="$slotWidth"})(({$slotWidth:e})=>({width:e,minWidth:e,minHeight:"100%",height:"100%",overflow:"hidden"})),Ie=styled(v,{shouldForwardProp:e=>e!=="$visible"&&e!=="$duration"})(({$visible:e=true,$duration:o=h})=>({display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,maxWidth:e?160:0,opacity:e?1:0,pointerEvents:e?"auto":"none",transition:o>0?`max-width ${.3*o}s ease-in-out, opacity ${.24*o}s ease-in-out`:"none"})),Te=styled(h$1,{shouldForwardProp:e=>e!=="$width"})(({$width:e})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e}:null})),Pe=styled(i,{shouldForwardProp:e=>e!=="$width"&&e!=="$justifyContent"})(({$width:e,$justifyContent:o="flex-start"})=>({...e!=null?{flex:`0 0 ${e}px`,maxWidth:e,justifyContent:o}:null}));var Ue=220;function ge(e,o,a){return Math.min(Math.max(e,o??0),a??1/0)}function Ae(e,o,a,n){if(Math.abs(e-o)<=1)return;let r=animate(0,1,{duration:a,onUpdate:t=>{n(s=>({...s,width:e+(o-e)*t}));}});return ()=>r.stop()}function G(e,o){if(e===false)return {duration:0,resize:o};let a=typeof e=="object"?e:void 0,n=a?.duration;return {duration:typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):h,resize:a?.resize??o}}function j(e){return e?.children==null||e.expand?.isExpanded===false?false:e.expand?.isExpanded===true}function F(e,o=Ue){let a=Array.isArray(e)?e.flat():[e];for(let n=a.length-1;n>=0;n--){let r=a[n];if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&typeof r.width=="number")return r.width}return o}function Ee(e){let o=e["data-id"]??e.id;return o!=null?{"data-id":o}:{}}function Me({kind:e,slot:o,isOpen:a,fullWidth:n,wrapperWidth:r,animateWrapperWidth:t,animation:s}){let p=e==="sidebar"?xe:be,d=e==="sidebar"?x.sidebar:x.panel,m=o["data-testid"]?`${o["data-testid"]}Wrapper`:e==="sidebar"?"WindowShellSidebarWrapper":"WindowShellPanelWrapper",i=o["data-testid"]??o.id??(e==="sidebar"?"WindowShellSidebar":"WindowShellPanel"),l=Ee(o),u=jsx(p,{id:o.id,className:Hb(d,o.className),"data-testid":i,...l,sx:Gb({width:n,minWidth:0},o.sx),children:jsx(Ce,{$slotWidth:n,initial:false,animate:{x:a?0:-n},transition:{duration:s.duration},children:o.children})});return t?jsx(Ne,{"data-testid":m,...l,initial:false,animate:{width:r},transition:{duration:s.duration},children:u}):jsx(ze,{"data-testid":m,...l,$width:r,children:u})}Me.displayName="WindowShellSlotColumn";var J=memo(Me);function De({baseWindowWidth:e,sidebar:o,panel:a,content:n,bodyContent:r,sidebarOpen:t,showPanel:s,sidebarFullWidth:p,panelFullWidth:d,sidebarAnimation:m,panelAnimation:i}){let{size:l}=b(),u=i.resize==="window",W=typeof e=="number"?Math.max(0,e-(u?d:0)-(m.resize==="window"&&!t?p:0)):l.width,b$1=u?s?Math.min(d,Math.max(0,l.width-W)):0:s?d:0,y=t?p:0;return jsxs(we,{className:Hb(x.root),children:[o?.children?jsx(J,{kind:"sidebar",slot:o,isOpen:t,fullWidth:p,wrapperWidth:y,animateWrapperWidth:true,animation:m}):null,jsx(ye,{id:n?.id?`${n.id}Body`:void 0,className:Hb(x.body,n?.className),"data-testid":n?.["data-testid"]?`${n["data-testid"]}Body`:n?.id?`${n.id}Body`:"WindowShellBody",...(n?.["data-id"]??n?.id)!=null?{"data-id":n?.["data-id"]?`${n["data-id"]}Body`:`${n?.id}Body`}:null,sx:n?.sx,children:r}),a?.children?jsx(J,{kind:"panel",slot:a,isOpen:s,fullWidth:d,wrapperWidth:b$1,animateWrapperWidth:!u,animation:i}):null]})}De.displayName="WindowShellSlotsLayout";var Re=memo(De);function $e({sidebarOpen:e,showPanel:o,sidebarResize:a,panelResize:n,sidebarDuration:r,panelDuration:t}){let{size:s,setSize:p,defaultSize:d,minSize:m,maxSize:i}=b(),l=useRef(s);l.current=s;let u=useRef(d.width),W=useRef(e),b$1=useRef(o),y=useRef(d.width);return useEffect(()=>{let C=b$1.current!==o,w=W.current!==e,E=y.current!==d.width;b$1.current=o,W.current=e,y.current=d.width;let S;if(w&&a==="window"?S=r:(C&&n==="window"||E&&!C&&!w)&&(S=t),S==null)return;let h=ge(d.width,m?.width,i?.width);return u.current=h,Ae(l.current.width,h,S,p)},[d.width,o,e,a,n,r,t,m?.width,i?.width,p]),null}$e.displayName="WindowShellAnimator";var Oe=memo($e);function ve({toolbar:e$1,sidebar:o,panel:a,animationDuration:n=h}){let{title:r,titleIcon:t,onClose:s,onMinimize:p,onMaximize:d,startAdornment:m,endAdornment:i,id:l,className:u,"data-testid":W,"data-id":b$2,sx:y}=e$1??{},{isMaximized:C}=b(),w=typeof s=="function"?s:void 0,E=typeof p=="function"?p:void 0,S=typeof d=="function"?d:void 0,h=o?.expand,c=a?.expand,z=j(a),L=h?.isExpanded??true,M=h!=null&&o?.children!=null,D=c!=null&&a?.children!=null&&z,k=M&&D,V=F(a?.sx),_=o!=null?F(o.sx):0,I=Math.max(_,V),T=k&&L?I:void 0,Z=D?I:void 0,X=D;return jsxs(b$1,{id:l??f$1,className:u,"data-testid":W??l??"WindowToolbar","data-id":b$2??l,sx:y,children:[jsxs(Te,{$width:T,children:[w?jsx(c$2,{onClick:w}):null,E?jsx(f$2,{onClick:E}):null,S?jsx(e,{isMaximized:C,onClick:S}):null,M&&h?jsx(d$1,{direction:h.isExpanded??true?"left":"right",active:h.isExpanded??true,onClick:h.onExpand,children:h.label}):null,m]}),jsx(j$1,{title:r,icon:t}),jsxs(Pe,{$width:Z,$justifyContent:i?"space-between":"flex-start",children:[D?jsx(Ie,{$visible:X,$duration:n,children:jsx(d$1,{sx:{flexShrink:0},direction:c?.isExpanded??true?"left":"right",active:z,onClick:c?.onExpand,children:c?.label})}):null,i]})]})}ve.displayName="WindowShellToolbar";var Fe=memo(ve);var Be=forwardRef(function({isOpen:o,className:a,sx:n,toolbar:r,services:t,sidebar:s,panel:p,footer:d$1,content:m,window:i,backdrop:l},u){let W=t?.list??[],b=(t?.isLoading??false)||W.length>0,y=d$1!=null&&(d$1.isVisible??true),C=s?.children,w=F(s?.sx),E=p?.children,S=p!=null?F(p.sx):0,h=m?.children,c$2=s?.expand?.isExpanded??C!=null,z=j(p),L=!!(C||E),[M,D]=useState(w),[k,V]=useState(S);useEffect(()=>{c$2&&D(w),z&&V(S);},[c$2,w,z,S]);let _=r?.onClose??r?.onMinimize??(()=>{}),I=G(s?.animation,"in-place"),T=G(p?.animation,"in-place"),Z=(()=>{let P=i?.defaultSize;if(typeof P?.width!="number")return P;let oe=(I.resize==="window"&&!c$2?M:0)+(T.resize==="window"&&!z?k:0);return oe>0?{...P,width:Math.max(0,P.width-oe)}:P})(),X={height:i?.minSize?.height??i?.defaultSize?.height??c,...i?.minSize?.width!=null?{width:i.minSize.width}:null},Le=l!=null&&(l.isVisible??true)&&o&&!i?.isMinimized,_e=(i?.order??0)+10-1,ee=jsx(oo,{open:true,onClick:_,id:l?.id,className:l?.className,"data-testid":l?.["data-testid"]??l?.id??"WindowShellBackdrop",...(l?.["data-id"]??l?.id)!=null?{"data-id":l?.["data-id"]??l?.id}:null,sx:Gb({zIndex:_e,backgroundColor:P=>alpha(P.palette.common.black,.3)},l?.sx)});return jsxs(Fragment,{children:[Le&&(i?.disablePortal?ee:createPortal(ee,document.body)),jsxs(f,{ref:u,isOpen:o,onClose:_,defaultSize:Z,minSize:X,maxSize:i?.maxSize,defaultPosition:i?.defaultPosition,containerRef:i?.containerRef,order:i?.order,isMinimized:i?.isMinimized,isMaximized:i?.isMaximized,id:i?.id,className:Hb(x.root,i?.className,a),sx:n,onResize:i?.onResize,onDragStart:i?.onDragStart,onMouseDown:i?.onMouseDown,onClick:i?.onClick,disablePortal:i?.disablePortal,"data-testid":i?.["data-testid"]??i?.id,"data-id":i?.["data-id"]??i?.id,children:[jsx(Oe,{sidebarOpen:c$2,showPanel:z,sidebarWidth:M,panelWidth:k,sidebarResize:I.resize,panelResize:T.resize,sidebarDuration:I.duration,panelDuration:T.duration}),jsx(Fe,{toolbar:r,sidebar:s,panel:p,animationDuration:T.duration}),b?t?.isLoading?jsx(d,{appCode:t?.appCode,id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:Gb({height:"auto",flexShrink:0},t?.sx)}):jsx(c$1,{services:W,serviceCode:t?.activeCode??"",onOpenService:t?.onOpen,onOpenServiceInNewWindow:t?.onOpenInNewWindow,language:t?.language??"en",openInNewWindowLabel:t?.openInNewWindowLabel??"Open in new window",id:t?.id,className:t?.className,"data-testid":t?.["data-testid"]??t?.id,"data-id":t?.["data-id"]??t?.id,sx:t?.sx}):null,jsx(g,{id:m?.id,className:m?.className,"data-testid":m?.["data-testid"]??m?.id,"data-id":m?.["data-id"]??m?.id,sx:L?void 0:m?.sx,children:L?jsx(Re,{baseWindowWidth:typeof i?.defaultSize?.width=="number"?i.defaultSize.width:void 0,sidebar:s,panel:p,content:m,bodyContent:h,sidebarOpen:c$2,showPanel:z,sidebarFullWidth:M,panelFullWidth:k,sidebarAnimation:I,panelAnimation:T}):h}),y?jsxs(h$2,{id:d$1?.id,className:d$1?.className,"data-testid":d$1?.["data-testid"]??d$1?.id,"data-id":d$1?.["data-id"]??d$1?.id,sx:d$1?.isVisible===true?Gb(d$1?.sx??{},{"&:empty, &:has(> :only-child:empty)":{display:"flex"}}):d$1?.sx,children:[d$1?.children,d$1?.actions?jsx(i$1,{children:d$1.actions}):null]}):null]})]})});Be.displayName="WindowShell";var to=memo(Be);export{x as a,to as b};
@@ -1 +1 @@
1
- import {b}from'./chunk-2JVB4CBT.js';import {b as b$1}from'./chunk-I5DP4JJP.js';import {j,a}from'./chunk-F5BIYZTP.js';import {R,B as B$1,x,h}from'./chunk-LLM6NHYM.js';import {Ib,Jb,Vb}from'./chunk-6HNOCQKM.js';import {m}from'./chunk-53X3U5WT.js';import {Xc,Yc,Wj,Xj,Yj,fc,gc,Zj,ec}from'./chunk-VRGBJY4Q.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:Yc,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:ec,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,i]=m();return [new q(o),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?fc:gc:e?gc:fc;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=>Ib(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:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,alt:"entity-timezone"}),jsx(b,{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,D)=>{let j=a?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,a);},sx:{gap:"4px"},children:[j?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx(b,{countryCode:a?.countryCode}),jsx(F,{className:j?"selected":"",children:a?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:i}){let t=useMemo(()=>i?Jb(i):void 0,[i]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,alt:"user-timezone"}),jsx(b,{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?Wj:o?.timezone===t.timezone?Xj:Yj,[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(b,{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(${Xc})`}},".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(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(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=Vb(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(B$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(b$1,{severity:"error",message: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 {b}from'./chunk-2JVB4CBT.js';import {b as b$1}from'./chunk-I5DP4JJP.js';import {j,a}from'./chunk-IKGDJDP5.js';import {R,B as B$1,x,h}from'./chunk-LLM6NHYM.js';import {Ib,Jb,Vb}from'./chunk-6HNOCQKM.js';import {m}from'./chunk-53X3U5WT.js';import {Xc,Yc,Wj,Xj,Yj,fc,gc,Zj,ec}from'./chunk-VRGBJY4Q.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:Yc,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:ec,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,i]=m();return [new q(o),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?fc:gc:e?gc:fc;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=>Ib(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:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Xj,alt:"entity-timezone"}),jsx(b,{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,D)=>{let j=a?.timezone===e?.timezone;return jsxs(L,{onClick:te=>{c(te,a);},sx:{gap:"4px"},children:[j?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx(b,{countryCode:a?.countryCode}),jsx(F,{className:j?"selected":"",children:a?.label})]},`timezone-item-${D}`)})})})]})}function xe({onChange:e,selectedTimezone:o,browserTimezone:i}){let t=useMemo(()=>i?Jb(i):void 0,[i]),n=()=>{t&&e(t);},p=t?.timezone===o?.timezone;return jsxs(L,{onClick:n,children:[p?jsx("img",{src:Zj,alt:"icon"}):jsx(A,{}),jsx("img",{src:Wj,alt:"user-timezone"}),jsx(b,{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?Wj:o?.timezone===t.timezone?Xj:Yj,[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(b,{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(${Xc})`}},".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(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(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=Vb(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(B$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(b$1,{severity:"error",message: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};
@@ -0,0 +1 @@
1
+ import {j as j$1,L,R as R$1}from'./chunk-LLM6NHYM.js';import {ea}from'./chunk-6HNOCQKM.js';import {el,fl}from'./chunk-VRGBJY4Q.js';import {useState,useEffect}from'react';import ee from'@mui/material/ClickAwayListener';import x from'@mui/material/Box';import {styled,alpha}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var Y=r=>r===0?12:r<=12?r:r-12,te=r=>r>=12?"PM":"AM",B=()=>new Date().getMinutes(),S=()=>{let r=new Date().getHours();return Y(r)},oe=(r,o)=>o==="AM"&&r===12?0:o==="PM"&&r!==12?r+12:r;var z=["AM","PM"],g=12,b=59;var F=styled(x)(()=>({width:157,padding:"16px",display:"flex",alignItems:"center",justifyContent:"center",gap:"16px"})),$=styled(j$1,{shouldForwardProp:r=>r!=="open"&&r!=="size"})(({theme:r,open:o,size:n})=>{let{base:p,grey:s,brand:h}=r.v2.palette;return {fontSize:"11px",fontWeight:500,background:p.white,border:`1px solid ${s[100]}`,borderRadius:"19px",height:n==="large"?32:24,width:n==="large"?74:58,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",...o&&{boxShadow:"0px 0px 4px 0px #1F88D080",borderColor:h[500]}}}),f=styled(x)(()=>({textAlign:"center",cursor:"pointer",userSelect:"none"})),j=styled(j$1,{shouldForwardProp:r=>r!=="selected"})(({theme:r,selected:o})=>{let{base:n,grey:p,brand:s}=r.v2.palette;return {fontSize:"11px",fontWeight:500,background:n.white,border:`1px solid ${p[100]}`,borderRadius:"4px",height:24,width:33,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",...o&&{borderColor:"transparent",color:s[500],backgroundColor:alpha(s[500],.1)}}}),R=styled(x)(()=>({display:"flex",flexDirection:"column",gap:"4px"})),N=styled(x)(()=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px"})),k=styled(x)(()=>({display:"flex",flexDirection:"column",justifyContent:"center",gap:"6px"})),H=styled(L)(()=>({flexGrow:1,maxWidth:"100%",".MuiInput-input":{fontWeight:"500",fontSize:"11px",textAlign:"center"},".MuiInput-root":{paddingInline:"8px"},height:32,width:32}));function G({id:r="time-picker",onChange:o,defaultTime:n,enableRealTimeChange:p,size:s="large"}){let[h,I]=useState(null),[a,O]=useState(n?.period??(new Date().getHours()>=12?"PM":"AM")),[c,P]=useState(n?.hour??S()),[l,y]=useState(n?.minute??B()),v=!!h;useEffect(()=>{p&&o?.({hour:c,minute:l,period:a});},[c,l,a,p]);let U=e=>{I(e.currentTarget);},q=()=>{I(null),o?.({hour:c,minute:l,period:a});},J=e=>{O(e);},u=e=>e<10?`0${e}`:e.toString(),K=e=>{let m=ea(u(Number(e.target.value)));if(m>12){e.preventDefault();return}P(m);},D=()=>{P(e=>e===12?1:e+1);},E=()=>{P(e=>e===1?12:e-1);},Q=e=>{let m=ea(u(Number(e.target.value)));if(m>59){e.preventDefault();return}y(m);},V=()=>{y(e=>e===59?(D(),0):e+1);},X=()=>{y(e=>e===0?(E(),59):e-1);};return jsx(ee,{onClickAway:q,children:jsxs(x,{id:r,"data-testid":"TimePicker",children:[jsx($,{size:s,open:v,onClick:U,children:`${u(c)}:${u(l)}${a.toLowerCase()}`}),jsx(R$1,{open:v,anchorEl:h,placement:"top-start",sx:{marginTop:"8px",marginBottom:"8px"},children:jsxs(F,{children:[jsxs(N,{children:[jsxs(k,{children:[jsx(f,{onClick:D,children:jsx("img",{src:el,alt:"arrow"})}),jsx(H,{type:"number",hideArrows:true,disableFocusRing:true,value:u(c),onChange:K}),jsx(f,{onClick:E,children:jsx("img",{src:fl,alt:"arrow"})})]}),jsx(j$1,{children:":"}),jsxs(k,{children:[jsx(f,{onClick:V,children:jsx("img",{src:el,alt:"arrow"})}),jsx(H,{type:"number",hideArrows:true,disableFocusRing:true,value:u(l),onChange:Q}),jsx(f,{onClick:X,children:jsx("img",{src:fl,alt:"arrow"})})]})]}),jsx(R,{children:z.map(e=>jsx(j,{onClick:()=>{J(e);},selected:a===e,children:e},e))})]})})]})})}var ke=G;export{Y as a,te as b,B as c,S as d,oe as e,z as f,g,b as h,G as i,ke as j};
@@ -0,0 +1 @@
1
+ import x from'dayjs';import v from'dayjs/plugin/calendar.js';import ee from'dayjs/plugin/customParseFormat.js';import te from'dayjs/plugin/utc.js';import {getTimezone,getCountry}from'countries-and-timezones';x.extend(te);x.extend(ee);x.extend(v);var _=x;var b=/(?:Z|[+-]\d{2}:?\d{2})$/i,c=e=>{if(e==null||e==="")return;if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e;if(typeof e=="number"){if(!Number.isFinite(e))return;let o=new Date(e);return Number.isNaN(o.getTime())?void 0:o}let t=e.trim();if(!b.test(t))return;let n=new Date(t);return Number.isNaN(n.getTime())?void 0:n},h=e=>{let t=new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.ms));return t.setUTCFullYear(e.year),t.getTime()};var O=(e,t=2)=>String(e).padStart(t,"0"),Y=new Map,ne=e=>{let t=Y.get(e);if(t)return t;try{let n=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",era:"short",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});return Y.set(e,n),n}catch{return}},oe=e=>{let t=r=>Number(e.find(a=>a.type===r)?.value??0),n=t("year");return {year:e.find(r=>r.type==="era")?.value==="BC"?1-n:n,month:t("month"),day:t("day"),hour:t("hour"),minute:t("minute"),second:t("second"),ms:0}},re=new Set(["Africa/Cairo","Egypt"]),ae=2023,E=new Map,se=(e,t)=>{let n=E.get(e);if(n)return n;let o=t.resolvedOptions().timeZone;return E.set(e,o),o},P=(e,t,n)=>{let o=new Date(Date.UTC(e,t+1,0));return o.getUTCDate()-(o.getUTCDay()-n+7)%7},ie=e=>{let t=new Date(e).getUTCFullYear();if(t<ae)return;let n=Date.UTC(t,3,P(t,3,5))-2*36e5,o=Date.UTC(t,9,P(t,9,4)+1)-3*36e5;return e>=n&&e<o?180:120},s=(e,t=Date.now())=>{let n=c(t),o=ne(e);if(!n||!o)return;if(re.has(se(e,o))){let a=ie(n.getTime());if(a!==void 0)return a}let r=Math.floor(n.getTime()/1e3)*1e3;return Math.round((h(oe(o.formatToParts(n)))-r)/6e4)},de=(e,t,n=Date.now())=>{let o=s(e,n),r=s(t,n);return o!==void 0&&r!==void 0&&o!==r},T=(e,t=Date.now())=>{let n=s(e,t);if(n===void 0)return "";let o=Math.abs(n);return `UTC${n<0?"-":"+"}${O(Math.floor(o/60))}:${O(o%60)}`};var B=e=>`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")} ${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}.${String(e.ms).padStart(3,"0")}`,m=e=>({year:e.year(),month:e.month()+1,day:e.date(),hour:e.hour(),minute:e.minute(),second:e.second(),ms:e.millisecond()}),z=e=>Number.isNaN(e.getTime())?void 0:{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),ms:e.getMilliseconds()},ue=[31,28,31,30,31,30,31,31,30,31,30,31],ce=e=>e%4===0&&(e%100!==0||e%400===0),fe=68,me=e=>e>=48&&e<=57,N=e=>e.length>0&&[...e].every(t=>t>="0"&&t<="9"),$=e=>{let t=e.month===2&&ce(e.year)?29:ue[e.month-1];return e.month<1||e.month>12||e.day<1||e.day>(t??0)||e.hour>23||e.minute>59||e.second>59?void 0:e},le=e=>{let t=0;for(;t<e.length&&(me(e.charCodeAt(t))||e[t]==="-"||e[t]==="/");)t++;return t},pe=e=>{let t=e.split("-"),n=[4,2,2];return t.length===3&&t.every((o,r)=>o.length===n[r]&&N(o))?t.map(Number):void 0},ye=e=>{let t=e.split("/");if(t.length!==3||!t.every(N))return;let[n,o,r]=t;if(n.length>2||o.length>2||r.length<2||r.length>4)return;let a=Number(r);return [a<100?(a>fe?1900:2e3)+a:a,Number(o),Number(n)]},De=e=>{let[t,n,o="0"]=e.split(":"),[r,a="0"]=o.split(".");if(!(t===void 0||n===void 0)&&!(a.length>3||![t,n,r,a].every(N)))return {hour:Number(t),minute:Number(n),second:Number(r),ms:Number(a.padEnd(3,"0"))}},A=e=>{let t=e.trim(),n=t.slice(0,le(t)),o=n.includes("/"),r=o?ye(n):pe(n);if(!r)return;let[a,u,p]=r,i=t.slice(n.length).trim(),[g="",q=""]=(i[0]==="T"||i[0]==="t"?i.slice(1):i).trim().split(" ").filter(Boolean),D=q.toUpperCase();if(D&&(!o||D!=="AM"&&D!=="PM"))return;if(!g)return $({year:a,month:u,day:p,hour:0,minute:0,second:0,ms:0});let I=De(g);if(!I||D&&(I.hour<1||I.hour>12))return;let Q=D?I.hour%12+(D==="PM"?12:0):I.hour;return $({year:a,month:u,day:p,...I,hour:Q})},Ie=e=>{let t=A(e);return t&&H(t)},H=e=>{let t=new Date(0);return t.setFullYear(e.year,e.month-1,e.day),t.setHours(e.hour,e.minute,e.second,e.ms),t},d=(e,t)=>{let n=c(e);if(!n)return;let o=s(t,n);if(o!==void 0)return _.utc(n.getTime()+o*6e4)},Ce=(e,t)=>{let n=d(e,t);if(n)return H(m(n))},U=(e,t,n)=>{let o=d(e,n),r=d(t,n);return o&&r?[m(o),m(r)]:void 0},ge=(e,t)=>e.year===t.year&&e.month===t.month&&e.day===t.day,he=(e,t,n)=>{let o=U(e,t,n);return !!o&&ge(o[0],o[1])},Te=(e,t,n)=>{let o=U(e,t,n);return !!o&&o[0].year===o[1].year},L=e=>Date.UTC(e.year,e.month-1,e.day),Ze=(e,t,n)=>{let o=U(e,t,n);if(o)return Math.abs(L(o[1])-L(o[0]))/864e5};var xe=(e,t)=>{let n=h(e),o=s(t,n-864e5),r=s(t,n+864e5);if(o===void 0||r===void 0)return;let u=(o===r?[o]:[o,r]).map(i=>n-i*6e4),p=u.filter(i=>i+(s(t,i)??NaN)*6e4===n);return new Date(p.length?Math.min(...p):Math.max(...u))},l=(e,t)=>{if(e==null||e==="")return;if(!(e instanceof Date)){if(typeof e=="number"){if(!Number.isFinite(e))return;let o=new Date(e);return Number.isNaN(o.getTime())?void 0:o}if(b.test(e.trim()))return c(e)}let n=typeof e=="string"?A(e):z(e);if(n)return xe(n,t)};var be=(e,t)=>{if(!(typeof e!="number"||!Number.isFinite(e))&&!(Math.abs(e)>864e13))return l(new Date(e).toISOString().replace(/Z$/,""),t)},y=(e,t)=>{let n=c(e);if(!n)return;let o=s(t,n);if(o!==void 0)return n.getTime()+o*6e4};var Me=(e,t,n=e[1])=>{let o=y(e[0],t),r=y(e[1],t),a=T(t,n);if(!(o===void 0||r===void 0||!a))return {from:o,to:r,offset:a}};var Fe=e=>{let t=", h:mma",n=e?"MMM DD":"MMM DD, YYYY";return {sameDay:`[Today]${t}`,nextDay:`[Tomorrow]${t}`,lastDay:`[Yesterday]${t}`,sameElse:`${n}${t}`,lastWeek:`${n}${t}`,nextWeek:`${n}${t}`}},ke=e=>({sameDay:e,nextDay:e,lastDay:e,sameElse:e,lastWeek:e,nextWeek:e}),Se=(e,t,n)=>{let o=d(e,t),r=d(Date.now(),t);return !o||!r?"":o.calendar(r,n??Fe(o.isSame(r,"year")))};var X=(e,t)=>{let n=l(e?.[0],t),o=l(e?.[1],t);return n&&o?[n,o]:void 0},j=(e,t)=>{let n=X(e,t);if(!n)return;let o=d(n[0],t),r=d(n[1],t);if(!(!o||!r))return [{fields:m(o),instant:n[0]},{fields:m(r),instant:n[1]}]},G=(e,t=0)=>{let n=new Date(Date.UTC(e.year,e.month-1,e.day+t));return B({year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:0,minute:0,second:0,ms:0})},M=(e,t,n=0)=>l(G(e,n),t),W=(e,t)=>{let n=l(G(e,1),t);return n&&new Date(n.getTime()-1)},Ne=(e,t)=>{let n=M(e.fields,t);return !!n&&n.getTime()===e.instant.getTime()||e.fields.hour===23&&e.fields.minute===59},Ae=(e,t)=>{let n=j(e,t);if(!n)return false;let[o,r]=n;return o.fields.year!==r.fields.year||o.fields.month!==r.fields.month||o.fields.day!==r.fields.day||Ne(r,t)},Ue=(e,t)=>{let n=j(e,t);if(!n)return;let o=M(n[0].fields,t),r=W(n[1].fields,t);return o&&r?[o,r]:void 0},We=(e,t)=>{let n=d(Date.now(),t);if(!n)return;let o=m(n),r=Number.isFinite(e)&&e>=1?Math.floor(e):1,a=W(o,t),u=M(o,t,-(r-1));return u&&a?[u,a]:void 0},Re=(e,t)=>{let n=d(Date.now(),t);if(!n)return;let o=m(n),r=Number.isFinite(e)&&e>=1?Math.floor(e):1,a=new Date(Date.UTC(o.year,o.month-1-r,1)),u=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()+1,0)).getUTCDate(),p={...o,year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:Math.min(o.day,u)},i=M(p,t),g=W(o,t);return i&&g?[i,g]:void 0},we=(e,t)=>({from:y(e[0],t),to:y(e[1],t)});var Ye=new Intl.DisplayNames(["en"],{type:"region"}),R=e=>{try{return Ye.of(e)}catch{return}},Ee={US:"America/New_York",CA:"America/Toronto",BR:"America/Sao_Paulo",MX:"America/Mexico_City",AR:"America/Argentina/Buenos_Aires",CL:"America/Santiago",AU:"Australia/Sydney",NZ:"Pacific/Auckland",RU:"Europe/Moscow",UA:"Europe/Kyiv",ES:"Europe/Madrid",PT:"Europe/Lisbon",ID:"Asia/Jakarta",KZ:"Asia/Almaty",UZ:"Asia/Tashkent",MN:"Asia/Ulaanbaatar"},C="UTC",K={id:C,countryCode:C,countryName:C},F=e=>{if(!e)return false;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}),!0}catch{return false}},w=e=>{if(!e)return;if(e===C)return K;let t=getTimezone(e);if(t){let[n]=t.countries;return {id:e,countryCode:n??"",countryName:R(n)??n??e}}return F(e)?{id:e,countryCode:"",countryName:e}:void 0},J=e=>{let t=e?.trim().toUpperCase();if(!t)return;if(t===C)return K;let n=getCountry(t),o=Ee[t]??n?.timezones[0];if(o)return {id:o,countryCode:t,countryName:R(t)??n?.name??t}},Pe=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||void 0}catch{return}},k=(e,t)=>({zone:e,countryCode:t?.trim().toUpperCase()||w(e)?.countryCode||""}),$e=e=>{if(e){if(typeof e=="string")return F(e)?k(e):void 0;if(!(!e.timezone||!F(e.timezone)))return k(e.timezone,e.countryCode)}},Le=e=>{let t=J(e);return t?k(t.id,t.countryCode):void 0},Be=(e,t)=>!!e&&!!t&&e.zone===t.zone&&e.countryCode===t.countryCode,V=(e,t=Date.now())=>{let n=T(e.zone,t).replace("UTC","GMT");return n?`(${n}) ${R(e.countryCode)??w(e.zone)?.countryName??e.zone}`:""},ze=e=>({timezone:e.zone,countryCode:e.countryCode,label:V(e),offset:(s(e.zone)??0)/60});export{$e as A,Le as B,Be as C,V as D,ze as E,s as a,de as b,T as c,Ie as d,Ce as e,he as f,Te as g,Ze as h,l as i,be as j,y as k,Me as l,ke as m,Se as n,X as o,Ae as p,Ue as q,We as r,Re as s,we as t,C as u,F as v,w,J as x,Pe as y,k as z};