@tap-payments/os-micro-frontend-shared 0.3.236 → 0.3.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/_chunks/{chunk-BKNQSCBV.js → chunk-2XNQLMFM.js} +1 -1
- package/build/_chunks/{chunk-BPNPETQW.js → chunk-43XF5CRO.js} +1 -1
- package/build/_chunks/{chunk-BHWA2DLO.js → chunk-52SSIU72.js} +1 -1
- package/build/_chunks/{chunk-7X7LW27Y.js → chunk-5HOZNLSR.js} +1 -1
- package/build/_chunks/{chunk-HTGQGXGP.js → chunk-5WL77ZBM.js} +2 -2
- package/build/_chunks/{chunk-5SFRPT5L.js → chunk-5Y3OU2UP.js} +1 -1
- package/build/_chunks/{chunk-IIJQTMKH.js → chunk-6A5SWPB6.js} +1 -1
- package/build/_chunks/{chunk-CFSDYUG2.js → chunk-6QZVOWJ6.js} +1 -1
- package/build/_chunks/{chunk-XAEPLBLE.js → chunk-7FWE55BT.js} +1 -1
- package/build/_chunks/{chunk-MS6Y34N5.js → chunk-7XRUWRO6.js} +1 -1
- package/build/_chunks/{chunk-AL2ZSXZ6.js → chunk-APMKSK4Y.js} +1 -1
- package/build/_chunks/{chunk-YRTPK5WI.js → chunk-BQ2KBU6T.js} +1 -1
- package/build/_chunks/{chunk-I3QG6QAH.js → chunk-BTKZVYP2.js} +1 -1
- package/build/_chunks/{chunk-ZNWFFR5B.js → chunk-BYLK5XJE.js} +1 -1
- package/build/_chunks/{chunk-UQAAPVOP.js → chunk-CF7XBOFD.js} +1 -1
- package/build/_chunks/{chunk-CXEGE4O2.js → chunk-D23EYDCG.js} +1 -1
- package/build/_chunks/{chunk-KBD5ZHSX.js → chunk-DSDWO75H.js} +1 -1
- package/build/_chunks/{chunk-B4MLPOHF.js → chunk-EGFHFXWK.js} +1 -1
- package/build/_chunks/{chunk-KNZ7WDVM.js → chunk-EILAHGVW.js} +1 -1
- package/build/_chunks/{chunk-ASVSVGU7.js → chunk-EQLCA7C5.js} +1 -1
- package/build/_chunks/{chunk-HX4ZQZMG.js → chunk-FBFQA3FH.js} +1 -1
- package/build/_chunks/{chunk-GWRYOFFH.js → chunk-FGRPEMXW.js} +1 -1
- package/build/_chunks/{chunk-OTVBJARD.js → chunk-FSYQDLRZ.js} +1 -1
- package/build/_chunks/{chunk-YM6QK2DF.js → chunk-G6LS5UQQ.js} +1 -1
- package/build/_chunks/{chunk-QY7A3NAZ.js → chunk-GEJI7SEX.js} +1 -1
- package/build/_chunks/{chunk-3EFRQRQL.js → chunk-GK34VOCD.js} +2 -2
- package/build/_chunks/{chunk-BL4G7JLV.js → chunk-GOXECOLH.js} +1 -1
- package/build/_chunks/{chunk-2G7ZSBO4.js → chunk-GPDV5GOU.js} +1 -1
- package/build/_chunks/{chunk-TKK3WRVP.js → chunk-GRKRA3TP.js} +1 -1
- package/build/_chunks/{chunk-Y6XCG6I3.js → chunk-GT3H3NIX.js} +1 -1
- package/build/_chunks/{chunk-PT6E5ELZ.js → chunk-GXN65QXO.js} +1 -1
- package/build/_chunks/{chunk-X6ONAMFY.js → chunk-HUNQN3PG.js} +1 -1
- package/build/_chunks/{chunk-R4UDDMWN.js → chunk-IIZ35FW7.js} +1 -1
- package/build/_chunks/{chunk-5V5JLLTM.js → chunk-INPKNRJG.js} +1 -1
- package/build/_chunks/chunk-ITT4ZZK7.js +1 -0
- package/build/_chunks/{chunk-66CFHR7D.js → chunk-JI5U3KGK.js} +1 -1
- package/build/_chunks/{chunk-ZN6XHB3Y.js → chunk-JQ4RAYWG.js} +1 -1
- package/build/_chunks/{chunk-M5YZJU34.js → chunk-KFDZXGYC.js} +1 -1
- package/build/_chunks/{chunk-Z5G7GROD.js → chunk-KKQCH4E6.js} +1 -1
- package/build/_chunks/{chunk-KFPNUXMC.js → chunk-KVC3QSDQ.js} +1 -1
- package/build/_chunks/chunk-L7L22FDR.js +1 -0
- package/build/_chunks/{chunk-5KGTZKEN.js → chunk-LAXNYZ2B.js} +1 -1
- package/build/_chunks/chunk-LIM4ZN7L.js +1 -0
- package/build/_chunks/chunk-LIX5BAAS.js +1 -0
- package/build/_chunks/{chunk-4IDLOUJ7.js → chunk-LXD5Y42H.js} +1 -1
- package/build/_chunks/{chunk-K7QBMMBJ.js → chunk-M44UZ3VI.js} +1 -1
- package/build/_chunks/{chunk-DIQEZXOU.js → chunk-M6P6RMTN.js} +2 -2
- package/build/_chunks/{chunk-7YAANFKA.js → chunk-MFZ3F3JQ.js} +1 -1
- package/build/_chunks/{chunk-OOCQKRLE.js → chunk-N3J7SFM3.js} +1 -1
- package/build/_chunks/{chunk-HQZAZXS5.js → chunk-NAMY656Y.js} +1 -1
- package/build/_chunks/{chunk-V6UM44EE.js → chunk-OMISGJLX.js} +1 -1
- package/build/_chunks/{chunk-DOBRREPI.js → chunk-OQ3FO5YB.js} +1 -1
- package/build/_chunks/{chunk-MBHOPWO5.js → chunk-OYSUD47M.js} +1 -1
- package/build/_chunks/{chunk-ZBOMFKID.js → chunk-PTLHPNSH.js} +1 -1
- package/build/_chunks/chunk-PY3KVMCZ.js +2 -0
- package/build/_chunks/{chunk-UWMNSF7E.js → chunk-QWWU4QAA.js} +1 -1
- package/build/_chunks/{chunk-H2JRT32Y.js → chunk-QYGCP3DY.js} +1 -1
- package/build/_chunks/{chunk-IK7SEBKG.js → chunk-RUEG6MLM.js} +1 -1
- package/build/_chunks/{chunk-J3IQ3LK6.js → chunk-S6KU6TLU.js} +1 -1
- package/build/_chunks/{chunk-RSMUKCU7.js → chunk-SMEJI5LC.js} +1 -1
- package/build/_chunks/{chunk-AIZCIUGN.js → chunk-SSCOCVXS.js} +1 -1
- package/build/_chunks/{chunk-SVB4LDND.js → chunk-T75OG2WZ.js} +1 -1
- package/build/_chunks/{chunk-3JH2VK4V.js → chunk-TDFNWFK7.js} +1 -1
- package/build/_chunks/{chunk-R2ADPEMK.js → chunk-TJ6HQMDL.js} +1 -1
- package/build/_chunks/{chunk-YFFUFJLA.js → chunk-V5LH2RXO.js} +1 -1
- package/build/_chunks/{chunk-6FIFHADT.js → chunk-VJ7TCN2H.js} +1 -1
- package/build/_chunks/{chunk-JO5SBXD2.js → chunk-W5VV3DNY.js} +1 -1
- package/build/_chunks/{chunk-NLBIEL5G.js → chunk-WRHR6LTZ.js} +1 -1
- package/build/_chunks/{chunk-JW2LQWTK.js → chunk-WZQR2LCT.js} +1 -1
- package/build/_chunks/{chunk-BFJBUXOL.js → chunk-X5HJKL6O.js} +1 -1
- package/build/_chunks/{chunk-XY72MNWO.js → chunk-XGZGXMTI.js} +1 -1
- package/build/_chunks/{chunk-L6COP35A.js → chunk-XMCBD5O6.js} +1 -1
- package/build/_chunks/{chunk-W3U44CAS.js → chunk-YL3VBHEM.js} +1 -1
- package/build/_chunks/{chunk-QCKVQDTV.js → chunk-ZEQDF7FG.js} +1 -1
- package/build/_chunks/{chunk-P6ZNNZQJ.js → chunk-ZU3QYC6H.js} +1 -1
- package/build/components/ActionsDropdownMenu/index.js +1 -1
- package/build/components/ActiveFilterChip/index.js +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/AnimatedSpinnerIcon/index.js +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/AreaChart/index.js +1 -1
- package/build/components/Autocomplete/index.js +1 -1
- package/build/components/AvatarStack/index.js +1 -1
- package/build/components/Calender/index.js +1 -1
- package/build/components/ColorPicker/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/ConfirmDialog/index.js +1 -1
- package/build/components/CountryFilter/index.js +1 -1
- package/build/components/CountryFlag/index.js +1 -1
- package/build/components/CurrenciesMenu/index.js +1 -1
- package/build/components/CurrencyAmount/index.js +1 -1
- package/build/components/CurrencyAmountInput/index.js +1 -1
- package/build/components/CurrencySymbol/index.js +1 -1
- package/build/components/CustomBackdrop/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/DeviceIcon/index.js +1 -1
- package/build/components/DropdownMenu/index.js +1 -1
- package/build/components/EmptyState/index.js +1 -1
- package/build/components/ErrorToast/index.js +1 -1
- package/build/components/FileDropbox/FileDropbox.d.ts +4 -0
- package/build/components/FileDropbox/constants.d.ts +13 -0
- package/build/components/FileDropbox/index.d.ts +3 -0
- package/build/components/FileDropbox/index.js +1 -0
- package/build/components/FileDropbox/style.d.ts +19 -0
- package/build/components/FileDropbox/type.d.ts +65 -0
- package/build/components/FilePreview/FilePreview.d.ts +3 -3
- package/build/components/FilePreview/constants.d.ts +10 -0
- package/build/components/FilePreview/index.d.ts +3 -3
- package/build/components/FilePreview/index.js +1 -1
- package/build/components/FilePreview/style.d.ts +8 -21
- package/build/components/FilePreview/type.d.ts +19 -6
- package/build/components/FileUploader/FileUploader.d.ts +3 -3
- package/build/components/FileUploader/constants.d.ts +11 -0
- package/build/components/FileUploader/index.d.ts +3 -3
- package/build/components/FileUploader/index.js +1 -1
- package/build/components/FileUploader/style.d.ts +7 -22
- package/build/components/FileUploader/type.d.ts +31 -10
- package/build/components/FileUploader/utils.d.ts +2 -0
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/Filters/index.js +1 -1
- package/build/components/FlippingCard/index.js +1 -1
- package/build/components/FormSelect/index.js +1 -1
- package/build/components/GroupedSelect/index.js +1 -1
- package/build/components/HeatMap/index.js +1 -1
- package/build/components/IconWithBadge/index.js +1 -1
- package/build/components/InputBase/index.js +1 -1
- package/build/components/Inputs/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/LeftPeekRightExpandingChip/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/ListLayout/index.js +1 -1
- package/build/components/Loader/index.js +1 -1
- package/build/components/Logo/index.js +1 -1
- package/build/components/MFWidgetLoader/index.js +1 -1
- package/build/components/MaskedText/index.js +1 -1
- package/build/components/MultiSelect/index.js +1 -1
- package/build/components/NestedDropdown/index.js +1 -1
- package/build/components/NestedMultiSelect/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/ProgressRing/index.js +1 -1
- package/build/components/RHFGroupedSelect/index.js +1 -1
- package/build/components/RHFInput/index.js +1 -1
- package/build/components/RHFPhoneInput/index.js +1 -1
- package/build/components/RHFSwitch/index.js +1 -1
- package/build/components/RadioGroup/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/RatingCount/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/RightLeftExpandingCenterChip/index.js +1 -1
- package/build/components/SearchButton/index.js +1 -1
- package/build/components/SearchInput/index.js +1 -1
- package/build/components/SheetViewChip/index.js +1 -1
- package/build/components/Sidebar/index.js +1 -1
- package/build/components/StatusBar/index.js +1 -1
- package/build/components/StatusButton/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/StatusLabel/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TextInput/index.js +1 -1
- package/build/components/Timepicker/index.js +1 -1
- package/build/components/ToggleView/index.js +1 -1
- package/build/components/Toolbar/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/index.d.ts +3 -4
- package/build/components/index.js +1 -1
- package/build/components/primitives/index.js +1 -1
- package/build/hooks/index.js +1 -1
- package/build/index.js +1 -1
- package/build/utils/file.d.ts +2 -0
- package/build/utils/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-24GWCDZ5.js +0 -1
- package/build/_chunks/chunk-5ZLWBDSA.js +0 -2
- package/build/_chunks/chunk-JECOERWM.js +0 -1
- package/build/_chunks/chunk-MZMXF4IE.js +0 -1
- package/build/_chunks/chunk-SAYH35C3.js +0 -1
- package/build/components/FileInputPreview/FileInputPreview.d.ts +0 -5
- package/build/components/FileInputPreview/index.d.ts +0 -1
- package/build/components/FileInputPreview/index.js +0 -1
- package/build/components/FileInputPreview/style.d.ts +0 -9
- package/build/components/FileInputPreview/type.d.ts +0 -21
- package/build/components/FileInputPreview/utils.d.ts +0 -3
- package/build/components/FileUpload/FileUpload.d.ts +0 -4
- package/build/components/FileUpload/FileUploadBase.d.ts +0 -4
- package/build/components/FileUpload/index.d.ts +0 -3
- package/build/components/FileUpload/index.js +0 -1
- package/build/components/FileUpload/style.d.ts +0 -39
- package/build/components/FileUpload/type.d.ts +0 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
import {$,Fb,A,
|
|
1
|
+
import {$,Fb,A,wc,xc}from'./chunk-L7L22FDR.js';import {useState,useEffect,useCallback,useLayoutEffect,useRef,useMemo}from'react';import {useLocation}from'react-router';import {useTheme}from'@mui/material/styles';function H(){let{innerWidth:e,innerHeight:n}=window;return {width:e,height:n}}function ge(){let[e,n]=useState(H);return useEffect(()=>{let t;function o(){cancelAnimationFrame(t),t=requestAnimationFrame(()=>{n(H());});}return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),cancelAnimationFrame(t);}},[]),e}var Te=()=>{let[e,n]=useState(false),[t,o]=useState(false),r=useCallback(()=>{n(true);},[]),s=useCallback(()=>{n(false);},[]),i=useCallback(()=>{o(true);},[]),a=useCallback(()=>{o(false);},[]);return {onMouseContentEnter:i,onMouseContentLeave:a,isHovered:e,isContentHovered:t,onMouseEnter:r,onMouseLeave:s}};function be({value:e,delay:n}){let[t,o]=useState(e);return useEffect(()=>{let r;return e?o(e):r=setTimeout(()=>{o(e);},n),()=>{clearTimeout(r);}},[e]),t}function Me(e,n){let[t,o]=useState({});return useEffect(()=>{e&&o(s=>({...s,[e]:n||0}));},[n,e]),{getBadgeCount:useCallback(s=>s?t[s]:"",[t])}}var ke=()=>{let{pathname:e}=useLocation();useLayoutEffect(()=>{$()||(window.location.href="/login");},[e]);};function He(e){return {isParameterSelected:(o,r)=>r?.map(s=>Fb(e,o,s)),getColumnOrder:o=>{let r=e.findIndex(s=>s.name?.toLowerCase()===o?.toLowerCase());return r===-1?100:r}}}var De=e=>{let[n,t]=useState(false);return useEffect(()=>{let o=e?.current;if(!o)return;let r=new IntersectionObserver(([s])=>{t(!s.isIntersecting);});return r.observe(o),()=>r.disconnect()},[e]),{showShadow:n}};var Pe=()=>{let e=useTheme(),n=e.palette.mode==="dark",t=e.palette.mode==="light";return {isDark:n,isLight:t}};function ze(){let[e,n]=useState(0),t=useRef(null),o=A(e),r=()=>{t.current&&(clearInterval(t.current),t.current=null);},s=()=>{r(),n(0);},i=a=>{a<=0||(t.current&&r(),n(a),t.current=setInterval(()=>{n(c=>{let u=c-1;return u<=0&&r(),u});},1e3));};return useEffect(()=>()=>{r();},[]),{timer:e,formattedTime:o,startTimer:i,stopTimer:r,resetTimer:s}}var Ne=e=>{let n=useMemo(()=>new Map(e.map(i=>[i.code.toLowerCase(),i])),[e]),t=useCallback(i=>n.get(i.toLowerCase()),[n]),o=useCallback(({appCode:i,serviceCode:a})=>t(i)?.app_services.find(({code:c})=>c.toLowerCase()===a.toLowerCase()),[t]),r=useCallback(({appCode:i,serviceCode:a})=>o({appCode:i,serviceCode:a})?.functions??[],[o]),s=useCallback(({appCode:i,serviceCode:a,functionCode:c})=>r({appCode:i,serviceCode:a}).find(({code:u})=>u?.toLowerCase()===c.toLowerCase()),[r]);return {getAppInfo:t,getServiceInfo:o,getServiceFunctions:r,getFunctionInfo:s}};function F(e){return useCallback((...n)=>{let t=new CustomEvent(e,{detail:n});window.dispatchEvent(t);},[e])}function Xe(e,n){let t=useRef(n);t.current=n,useEffect(()=>{let o=r=>{let s=r;t.current(...s.detail||[]);};return window.addEventListener(e,o),()=>{window.removeEventListener(e,o);}},[e]);}var et=(e,n)=>{let{selectedEntity:t,selectedMerchant:o,displayName:r}=useMemo(()=>{let s=n?.entities.find(c=>c.id===e?.entityId),i=s?.merchants?.find(c=>c.id===e?.merchantId),a=i?.display_name??i?.legacy_id??"Select";return {selectedEntity:s,selectedMerchant:i,displayName:a}},[n,e?.entityId,e?.merchantId]);return {selectedBrand:n,selectedEntity:t,selectedMerchant:o,displayName:r}};var se=()=>crypto.randomUUID();function rt(){let e=F("on-toast"),n=useCallback(t=>(o,r)=>{let s=r?.id??se();return e({action:"show",variant:t,message:o,options:{...r,id:s}}),s},[e]);return useMemo(()=>{let t=n("default");return t.success=n("success"),t.error=n("error"),t.loading=n("loading"),t.custom=n("custom"),t.dismiss=o=>{e({action:"dismiss",variant:"dismiss",toastId:o});},t.remove=o=>{e({action:"remove",variant:"remove",toastId:o});},t},[n,e])}var ae=10;function at({threshold:e=ae,containerRef:n}={}){let[t,o]=useState(true),[r,s]=useState(false),[i,a]=useState(false),c=useCallback(l=>{let{scrollTop:m,scrollHeight:p,clientHeight:f}=l;a(p>f+e),o(m<=e),s(p-(m+f)<=e);},[e]),u=useCallback(l=>{if(l){if("currentTarget"in l){c(l.currentTarget);return}c(l);}},[c]);return useEffect(()=>{if(!n?.current)return;let l=n.current;u(l);let m=new ResizeObserver(()=>{u(l);});return m.observe(l),()=>{m.disconnect();}},[n,u]),{handleScroll:u,scrolledToTop:t,scrolledToBottom:r,scrollable:i}}var lt=(e={})=>{let{checkUrl:n="/status",checkIntervalMs:t=3e4,debounceMs:o=800,timeoutMs:r=5e3}=e,s=typeof window<"u"&&typeof navigator<"u",[i,a]=useState(s?navigator.onLine:true),[c,u]=useState(false),[l,m]=useState(null),p=useRef(null),f=useRef(null),g=useCallback(d=>{p.current!==null&&window.clearTimeout(p.current),p.current=window.setTimeout(()=>{a(d),p.current=null;},o);},[o]);return useEffect(()=>{if(!s)return;let d=null,w=()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null);},v=async()=>{u(true),m(null),d?.abort(),d=new AbortController;try{let M=window.setTimeout(()=>{d?.abort();},r),y=await fetch(n,{method:"GET",cache:"no-store",signal:d.signal});window.clearTimeout(M);let x=y.ok;g(x),x?w():m(`Health check failed with status ${y.status}`);}catch{g(false),m("Unable to reach network");}finally{u(false);}},S=()=>{w(),g(true);},C=()=>{g(false),w(),v(),f.current=window.setInterval(v,t);};return window.addEventListener("online",S),window.addEventListener("offline",C),navigator.onLine||(v(),f.current=window.setInterval(v,t)),()=>{window.removeEventListener("online",S),window.removeEventListener("offline",C),p.current!==null&&window.clearTimeout(p.current),w(),d?.abort();}},[s,n,t,o,r,g]),s?{isOnline:i,isChecking:c,error:l}:{isOnline:false,isChecking:false,error:"Online status is only available in a browser environment."}};var dt=(e={},n,t)=>{let o=wc(e,t.requiredFilterKeys);return {columns:useMemo(()=>xc(n,o,t),[n,o])}};function ht(e,n){return useCallback(t=>{t.key==="Enter"?(t.preventDefault(),e(),n(t)):t.key==="Escape"&&n(t);},[e,n])}function Ct(){let[e,n]=useState(true);return {onScrollHandler:useCallback(o=>{let{scrollTop:r,scrollHeight:s,clientHeight:i}=o.currentTarget,a=r===0||i<s-r-1;n(c=>c===a?c:a);},[]),showShadow:e}}export{ge as a,Te as b,be as c,Me as d,ke as e,He as f,De as g,Pe as h,ze as i,Ne as j,F as k,Xe as l,et as m,rt as n,at as o,lt as p,dt as q,ht as r,Ct as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-FSYQDLRZ.js';import {L,aa}from'./chunk-V5LH2RXO.js';import {a}from'./chunk-DSDWO75H.js';import {Dc}from'./chunk-L7L22FDR.js';import {Cb,A}from'./chunk-GCJPCGH3.js';import ne,{memo,useState,useEffect}from'react';import P from'@mui/material/Box';import te from'@mui/material/InputAdornment';import oe from'@mui/material/Skeleton';import {styled,Popper,Box,ClickAwayListener}from'@mui/material';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {styled as styled$1}from'@mui/material/styles';var N=styled("button")(({theme:e,disabled:o})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"12px",borderRadius:"3px"},".arrow":{width:14,alignSelf:""},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px",borderRadius:"2px"},cursor:o?"default":"pointer",opacity:o?.5:1,paddingTop:0,backgroundColor:"transparent",border:"none",paddingInlineStart:0,minWidth:70,marginTop:1})),_=styled(Popper)(({theme:e})=>({zIndex:9999,backgroundColor:e.palette.common.white,padding:"4px 8px",borderRadius:"4px",border:`1px solid ${e.palette.divider}`,width:100})),H=styled("ul")(()=>({listStyle:"none",padding:0,margin:0,maxHeight:100,overflow:"auto"})),q=styled("li")(({theme:e})=>({display:"flex",gap:"4px",alignItems:"center",".logo":{width:"15.568px",height:"10.889px",borderRadius:"3px"},".arrow":{width:14},span:{color:e.palette.text.primary,fontWeight:500,fontSize:"11px"},height:24,cursor:"pointer"})),z=styled(L)(()=>({flexGrow:1,maxWidth:"100%",height:24,padding:"4px",marginBottom:"4px"})),D=styled(Box)(()=>({color:"red !important"}));function G({isLoading:e,countries:o,value:n,onCountryChange:l,required:b,disabled:f}){let[s,C]=useState(),[u,g]=useState(null),[y,i]=useState([]),[I,S]=useState(""),a$1=!!u&&!f,w=t=>{t.stopPropagation(),g(t.currentTarget);},m=()=>{g(null);},L=t=>{l?.(t),C(t),m(),i(o);},k=t=>{let p=t.target.value.toString()??"";if(S(p),!p){i(o);return}let Y=o.filter(F=>F.idd_prefix.toString().startsWith(p)||F.iso2.toLowerCase().startsWith(p.toLowerCase()));i(Y);};return useEffect(()=>{n&&C(n);},[n?.countryId]),useEffect(()=>{o.length&&i(o);},[o.length]),jsxs(P,{"data-testid":"CountriesList",sx:{position:"relative"},children:[jsx(N,{type:"button","aria-describedby":"CountriesList_CountriesWrapper",onClick:w,disabled:e||f,children:e?jsx(oe,{variant:"rectangular",width:56.5,height:15,sx:{borderRadius:"4px"}}):jsxs(Fragment,{children:[s&&jsxs(Fragment,{children:[jsx("img",{src:s.logo,alt:"c",className:"logo"}),jsx(P,{component:"span",flex:1,children:`+${s?.idd_prefix}`})]}),b&&jsx(D,{component:"span",children:"*"}),jsx(P,{component:"img",src:Cb,alt:"d",className:"arrow",sx:{...a$1&&{transform:"rotate(180deg)"}}})]})}),a$1&&jsx(a,{onClick:m,sx:{zIndex:9999}}),a$1&&jsx(ClickAwayListener,{onClickAway:m,children:jsxs(_,{id:"CountriesList_CountriesWrapper",open:a$1,anchorEl:u,"data-testid":"CountriesList_CountriesWrapper",placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-8,6]}}],children:[jsx(z,{type:"number",endAdornment:jsx(te,{position:"end",children:jsx("img",{src:A,alt:"arrow"})}),onChange:k,hideArrows:true,disableFocusRing:true,"data-testid":"CountriesList_InputStyled",value:I}),jsx(H,{"data-testid":"CountriesList_CountriesListStyled",children:y.map(t=>{let p=s?.countryId===t.countryId;return jsxs(q,{onClick:()=>{L(t);},sx:{backgroundColor:p?"#F9F9F9":"transparent",color:p?"#000":"#8D8D94"},children:[jsx("img",{src:t.logo,alt:"c",className:"logo"}),jsx("span",{children:`+${t.idd_prefix}`})]},`country-code-${t.countryId}`)})})]})})]})}G.displayName="CountriesList";var V=memo(G);var v=V;styled$1(P,{shouldForwardProp:e=>!["feedbackType","hasFeedback"].includes(e)})(({theme:e,feedbackType:o,hasFeedback:n})=>{let{borderColor:l}=aa(e,o);return {border:`1px solid ${o?l:e.palette.divider}`,display:"flex",position:"relative",alignItems:"center",borderRadius:n?"4px 4px 0 0":"4px",borderBottom:n?"none":void 0}});var K=styled$1(b)({flexGrow:1,maxWidth:"100%",paddingInlineEnd:0,img:{cursor:"pointer"}});styled$1("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"}));styled$1(P)(()=>({flex:1}));function U({phoneValue:e,error:o,hasError:n,countries:l,isCountriesLoading:b,countryValue:f,onCountryChange:s,onPhoneChange:C,helperText:u,required:g,disabled:y,feedback:i,id:I="PhoneInput",...S},a){let w=t=>{s?.(t);},m=i?.message??u,{isProvided:L}=Dc(i,{message:m});return jsx(K,{id:I,type:"number",value:e,"data-testid":"PhoneInput",ref:a,disableFocusRing:true,inputProps:{autoComplete:"off"},error:(o??n??false)&&!L,disabled:y,feedback:i,helperText:u,startAdornment:jsx(v,{isLoading:b,countries:l,value:f,onCountryChange:w,required:g,disabled:y}),...S,onChange:C,hideArrows:true})}U.displayName="PhoneInput";var X=ne.forwardRef(U);export{v as a,X as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {h,g,a,f,e,d,c}from'./chunk-
|
|
1
|
+
import {h,g,a,f,e,d,c}from'./chunk-SMEJI5LC.js';import {z}from'./chunk-V5LH2RXO.js';import {Bc,Ka,g as g$1}from'./chunk-L7L22FDR.js';import {yl,ja,Ta,Ng,il,Ya,Sa,Wg,Vg,Xg,Ug,Zg,zb,yb,zk,hk,gb,uk,B,w,A,D,Sh,gk,u,Ak}from'./chunk-GCJPCGH3.js';import {memo,useId,useState,useRef,useEffect,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';import {useTheme}from'@mui/material';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function L({isActive:p,disableHover:n}){let[c,C]=useState(false),s=useTheme(),e=()=>{n||C(true);},i=()=>{C(false);},h=p?s.palette.common.white:s.palette.grey[700],u=c?s.palette.common.black:"transparent";return jsx("svg",{width:"27",height:"30",viewBox:"0 0 27 32",xmlns:"http://www.w3.org/2000/svg",children:jsxs("g",{id:"Group 140343",children:[jsx("path",{id:"Active",d:"M0 0H11C19.8366 0 27 7.16344 27 16C27 24.8366 19.8366 32 11 32H0V0Z",fill:u,fillOpacity:"0.1",onMouseEnter:e,onMouseLeave:i}),jsx("path",{id:"Union",fillRule:"evenodd",clipRule:"evenodd",d:"M15.6941 15.0078C15.6494 15.0193 15.6083 15.043 15.5758 15.0769L12.5026 18.1501L12.5025 18.1501L15.5756 15.0769C15.6082 15.043 15.6493 15.0193 15.6941 15.0078ZM12.5619 18.7465C12.5426 18.7512 12.5227 18.7536 12.5026 18.7536C12.4363 18.7536 12.3727 18.7273 12.3258 18.6804L9.07581 15.4304C9.04012 15.3957 9.01559 15.3512 9.00535 15.3025C8.99511 15.2538 8.99963 15.2032 9.01833 15.1571C9.03703 15.111 9.06907 15.0715 9.11033 15.0437C9.13446 15.0275 9.16112 15.0156 9.18904 15.0086C9.16105 15.0156 9.13433 15.0275 9.11013 15.0438C9.06887 15.0716 9.03684 15.111 9.01814 15.1571C8.99944 15.2032 8.99492 15.2539 9.00516 15.3026C9.0154 15.3513 9.03993 15.3958 9.07562 15.4305L12.3256 18.6805C12.3725 18.7273 12.4361 18.7537 12.5024 18.7537C12.5226 18.7537 12.5426 18.7512 12.5619 18.7465ZM16.1965 15.342C16.1781 15.4301 16.1338 15.5105 16.0693 15.5731L12.8205 18.8219C12.7361 18.9063 12.6217 18.9537 12.5024 18.9537C12.3831 18.9537 12.2686 18.9062 12.1842 18.8219L8.93507 15.5728C8.87148 15.5105 8.82775 15.4308 8.80944 15.3437C8.79101 15.2561 8.79914 15.165 8.8328 15.082C8.86646 14.999 8.92412 14.9279 8.99839 14.8779C9.07266 14.8279 9.16022 14.8011 9.24978 14.8011C9.30998 14.8011 9.36958 14.8132 9.42503 14.8366C9.47997 14.8599 9.52973 14.8938 9.57144 14.9364L12.5024 17.8673L15.433 14.9368C15.5151 14.852 15.6273 14.803 15.7454 14.8002C15.836 14.798 15.9252 14.8233 16.0013 14.8728C16.0773 14.9222 16.1367 14.9935 16.1715 15.0772C16.2063 15.1609 16.2151 15.2533 16.1965 15.342Z",fill:h})]})})}var vt={inProgress:Ak,initiated:Ak,abandoned:u,cancelled:gk,reversed:Sh,reports:D,search:A,chevronDown:w,unAuthorized:B,unSettled:uk,unCaptured:gb,captured:hk,authorized:zk,openFlag:yb,closedFlag:zb,unauthenticated:Zg,authenticated:Ug,paidOut:Xg,scheduled:Vg,checked:Wg,dashedChecked:Sa,deactivated:Ya,destination:il,destinationReversed:Ng,outstanding:Ta,active:ja,inactive:yl};var Nt=memo(p=>{let{variant:n="inActive",badgeCount:c$1,icon:C,label:s,dropdownOptions:e$1,selectedStatus:i,onButtonBodyClick:h$1,iconMapper:u=vt,buttonSx:Bt,...bt}=p,St=Bc(useId(),"status-button"),[Lt,M]=useState(0),{t:y}=useTranslation(),E=useRef(null),[x,f$1]=useState(null),[o,H]=useState(i??e$1?.[0]?.status);useEffect(()=>{i!==void 0&&H(i);},[i]);let d$1=useMemo(()=>!!e$1?.length,[e$1]),I=!!x&&Lt>1,l=n==="active",P=useMemo(()=>l?"active":"inactive",[l]),m=useMemo(()=>o?e$1?.find(t=>t.status===o):null,[o,e$1]),kt=useMemo(()=>{if(m?.icon)return jsx(h,{variant:n,children:m.icon});let t=o&&u[o]?o:C;if(t&&u[t])return jsx(g,{icon:t,variant:n,src:u[t],alt:`${t}-icon`})},[m,o,u,C,n]),wt=useMemo(()=>!c$1||Number.isNaN(Ka(c$1))?null:jsx(z,{color:P,children:g$1(Number(c$1))}),[c$1,P]),T=useMemo(()=>d$1?jsx(L,{isActive:l}):null,[d$1,l]);useEffect(()=>{l||(M(0),f$1(null));},[l]);let g$2=useCallback(()=>{f$1(null);},[]),A=useCallback(()=>{d$1&&f$1(I?null:E.current);},[d$1,I]),Mt=useCallback(t=>{t.stopPropagation(),p?.onClick?.(t),h$1?.(o||e$1?.[0]?.status||"all"),A(),M(B=>B+1);},[p,h$1,o,e$1,A]),D=useCallback(t=>B=>{t?.onClick?.(B),H(t.status),g$2();},[g$2]),yt=useMemo(()=>e$1?.map(t=>({...t,onClick:D(t)}))||[],[e$1,D]),Et=a[n],xt=useMemo(()=>m?.label||(o?y(o):s),[m,o,y,s]);return jsxs(Fragment,{children:[jsx(Et,{id:St,"data-testid":"StatusButton",...bt,ref:E,onClick:Mt,statusVariant:n,sx:{...d$1&&{paddingInlineEnd:"27px"},...Bt},children:jsxs(f,{children:[jsxs(e,{variant:n,children:[kt,xt,wt]}),T&&jsx(d,{children:T})]})}),I&&d$1&&jsx(c,{open:I,onClose:g$2,anchorEl:x,menuItems:yt})]})}),gt=Nt;var oo=gt;
|
|
2
2
|
export{L as a,oo as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,k,a,g,e,d,c,f,i,h as h$1,j}from'./chunk-
|
|
1
|
+
import {b,k,a,g,e,d,c,f,i,h as h$1,j}from'./chunk-GPDV5GOU.js';import {h}from'./chunk-SSCOCVXS.js';import {b as b$1}from'./chunk-MUR4ILTY.js';import {A}from'./chunk-GCJPCGH3.js';import {useState,useMemo}from'react';import {useFormContext,Controller}from'react-hook-form';import {jsx,jsxs}from'react/jsx-runtime';function G({name:J,helperText:N,getOptionValue:l,getOptionLabel:o,renderOption:y,isOptionEqualToValue:f$1,getOptionDisabled:h$2,menuSearchable:d$1=false,menuSearchPlaceholder:M="Search",showCheckbox:Q=true,menuHasSelectionSummary:T=false,valueOnly:C=false,options:c$1,isLoading:b$2,...u}){let{control:X}=useFormContext(),[s,Y]=useState(""),p=t=>(l?l(t):t?.id)??"",Z=t=>!C||!t?.length?t??[]:t.map(n=>c$1?.find(a=>p(a)===n)).filter(Boolean),_=t=>t?.map(p)??[],j$1=useMemo(()=>{if(!d$1||!s.trim())return c$1??[];let t=s.toLowerCase().trim();return (c$1??[]).filter(n=>{let a=(o?o(n):n?.label)??"";return String(a).toLowerCase().includes(t)})},[c$1,d$1,s,o]);return jsx(Controller,{name:J,control:X,defaultValue:[],render:({field:t,fieldState:n})=>{let a$1=Array.isArray(t.value)?t.value.filter(e=>e!=null).length:0,V=T&&a$1>0,g$1=Z(t.value);return jsxs(h,{...u,isLoading:b$2,...t,options:c$1??[],value:g$1,getOptionLabel:o,hasError:!!n.error,helperText:N??n.error?.message,onChange:e=>t.onChange(C?_(e):e),MenuProps:{...u.MenuProps,autoFocus:false,disableEnforceFocus:true},children:[d$1&&jsx(b,{disableSticky:true,children:jsx(k,{placeholder:M,value:s,onChange:e=>Y(e.target.value),onKeyDown:e=>e.stopPropagation(),onKeyUp:e=>e.stopPropagation(),disableUnderline:true,fullWidth:true,inputProps:{"aria-label":M},endAdornment:b$2?jsx(a,{"aria-hidden":true,children:jsx(b$1,{})}):jsx(g,{src:A,alt:"search"})})}),V&&jsx(e,{disableSticky:true,children:jsxs(d,{children:[jsxs(c,{children:[a$1," selected"]}),jsx(f,{type:"button",variant:"text",disableRipple:true,"aria-label":"Clear all selected options",onMouseDown:e=>{e.preventDefault(),e.stopPropagation();},onClick:e=>{e.preventDefault(),e.stopPropagation(),u.onClear?u.onClear():t.onChange([]);},children:"Clear"})]})}),j$1?.map((e,O)=>{let m=g$1?.some(S=>{if(S==null)return false;if(f$1)return f$1(e,S);if(l){let R=l(e),v=l(S);return R===v||String(R)===String(v)}let I=e?.id,x=S?.id;return I===x||String(I)===String(x)}),P=h$2?h$2(e):false,ee=o?o(e):e.label,w=y?y(e):ee;return jsx(i,{value:(l?l(e):e?.id)??"",disabled:P,$selected:m,children:Q?jsxs(h$1,{children:[jsx(j,{checked:m,$mutedRect:m&&P}),w]}):w},`${O}-${(l?l(e):e?.id)??""}`)})]})}})}export{G as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f as f$1}from'./chunk-
|
|
1
|
+
import {f as f$1}from'./chunk-CF7XBOFD.js';import {styled,Button,Box,alpha}from'@mui/material';var l=t=>({...t.typography.subtitle1,borderRadius:"50px",borderWidth:"1px",borderStyle:"solid",minWidth:"135.11px",height:"32px",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",textTransform:"none",transition:"none",paddingInline:t.spacing(2)}),n=styled(Button,{shouldForwardProp:t=>t!=="statusVariant"})(({theme:t,statusVariant:e})=>({...l(t),...e==="active"?{background:t.palette.background.gradient.shadedBlue,color:t.palette.common.white,"&:hover":{background:t.palette.background.gradient.shadedBlue,opacity:.8}}:{backgroundColor:t.palette.common.white,borderColor:t.palette.grey[100],color:t.palette.text.primary,"&:hover":{backgroundColor:t.palette.common.white,opacity:.7}}})),u={active:n,inActive:n};styled(Box)(({theme:t,variant:e})=>({borderRadius:"50px",backgroundColor:e==="active"?alpha(t.palette.text.primary,.1):t.palette.grey[100],display:"flex",justifyContent:"center",alignItems:"center",paddingInline:t.spacing(.5),paddingBlock:t.spacing(.25),color:e==="active"?t.palette.common.white:t.palette.text.primary,fontSize:"8px",fontWeight:700,lineHeight:"10px"}));styled("img")(({theme:t,variant:e,icon:a})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(a??"")&&e==="inActive")&&a!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"}));var m=styled("p")(({theme:t})=>({fontSize:"0.6875rem",color:t.palette.background.default,fontStyle:"normal",margin:"auto",textTransform:"capitalize"})),h=styled(f$1)(({theme:t})=>({backgroundColor:"white",boxShadow:t.shadows[21],borderRadius:"0.25rem","& .MuiPaper-root":{borderRadius:"0.25rem",width:"12.5rem"}})),y=styled("span")(()=>({width:"27px",height:"100%",maxHeight:"100%",position:"absolute",top:"0",right:"0",bottom:"0",overflow:"hidden"})),b=styled(Box)(({variant:t})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"0.5rem",fontWeight:t==="active"?700:400})),f=styled(Box)(()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"100%"})),S=styled("img")(({theme:t,variant:e,icon:a})=>({fill:e==="active"?t.palette.common.white:t.palette.text.primary,color:e==="active"?t.palette.common.white:t.palette.text.primary,...!(["openFlag","closedFlag"].includes(a??"")&&e==="inActive")&&a!=="captured"&&{filter:e==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"},maxWidth:"14px",maxHeight:"14px"})),v=styled(Box)(({variant:t})=>({width:"14px",height:"14px",display:"flex",alignItems:"center","& img":{width:"14px",height:"14px",filter:t==="active"?"brightness(0) invert(1)":"brightness(0) invert(0)"}}));export{u as a,m as b,h as c,y as d,b as e,f,S as g,v as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-HDCNWBW5.js';import {aa,ba}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-HDCNWBW5.js';import {aa,ba}from'./chunk-V5LH2RXO.js';import {Bc,Dc}from'./chunk-L7L22FDR.js';import Ie,{forwardRef,useState,useId,useCallback,useMemo}from'react';import we from'@mui/material/InputLabel';import Le from'@mui/material/MenuItem';import ge from'@mui/material/SvgIcon';import {jsx,jsxs}from'react/jsx-runtime';import U from'@mui/material/Box';import Se from'@mui/material/IconButton';import be from'@mui/material/CircularProgress';import he from'@mui/material/FormControl';import _ from'@mui/material/Select';import {styled}from'@mui/material/styles';var N=forwardRef((e,r)=>jsx(ge,{ref:r,viewBox:"0 0 8 8",fontSize:"small",...e,children:jsx("path",{d:"M6.63965 0.102539C6.75727 0.0997602 6.87304 0.133137 6.97168 0.197266C7.07023 0.261345 7.14718 0.353407 7.19238 0.461914C7.23757 0.570522 7.24961 0.690513 7.22559 0.805664C7.20154 0.920834 7.1425 1.02595 7.05762 1.10742L7.05664 1.10938L4.56738 3.59766L4.49512 3.66992L7.05762 6.23242C7.11359 6.28617 7.15865 6.35066 7.18945 6.42188C7.22023 6.49308 7.23648 6.5699 7.2373 6.64746C7.23809 6.72499 7.22359 6.80223 7.19434 6.87402C7.16499 6.9459 7.1213 7.0115 7.06641 7.06641C7.01149 7.12132 6.94592 7.16498 6.87402 7.19434C6.8022 7.22362 6.72502 7.23809 6.64746 7.2373C6.56987 7.23649 6.4931 7.22024 6.42188 7.18945C6.35064 7.15865 6.28618 7.1136 6.23242 7.05762L6.23145 7.05664L3.74219 4.56836L3.66992 4.49512L3.59766 4.56836L1.1084 7.05664L1.10742 7.05762C1.05365 7.11362 0.989227 7.15864 0.917969 7.18945C0.846721 7.22025 0.769997 7.2365 0.692383 7.2373C0.614798 7.23809 0.537661 7.22364 0.46582 7.19434C0.393921 7.16498 0.328351 7.12132 0.273438 7.06641C0.218559 7.01151 0.174849 6.94589 0.145508 6.87402C0.116258 6.80223 0.101751 6.72498 0.102539 6.64746C0.103364 6.5699 0.119618 6.49308 0.150391 6.42188C0.181198 6.35065 0.226245 6.28617 0.282227 6.23242L2.84473 3.66992L2.77246 3.59766L0.283203 1.10938L0.282227 1.1084L0.224609 1.04297C0.172384 0.974382 0.136093 0.894624 0.118164 0.80957C0.0942576 0.695891 0.104774 0.577375 0.148438 0.469727C0.192107 0.362124 0.266971 0.269962 0.363281 0.205078C0.459591 0.140238 0.573348 0.105497 0.689453 0.105469C0.767281 0.105527 0.844313 0.121103 0.916016 0.151367C0.987801 0.181723 1.05308 0.226359 1.10742 0.282227L3.66992 2.84473L6.23242 0.282227C6.33914 0.171037 6.48558 0.106239 6.63965 0.102539Z",fill:"#20232B",stroke:"white",strokeWidth:.20511})}));N.displayName="DefaultClearIcon";var y=N;function M({size:e=20,color:r="grey.A400",...n}){return jsx(be,{size:e,sx:{backgroundColor:"transparent",color:r},...n})}function B({endAdornmentProp:e,isLoading:r,showClear:n,showMenuArrow:l,menuOpen:m,IconComponent:s,ClearIconComponent:f=y,onClear:d,onClearDefault:p}){return !(e||n||r||l)?null:jsxs(U,{className:"SelectBase-endAdornmentRoot",component:"span",children:[e,r?jsx(M,{}):null,!r&&n?jsx(Se,{className:"SelectBase-clearIconButton",type:"button",tabIndex:0,size:"small","aria-label":"Clear selection",onMouseDown:t=>{t.preventDefault(),t.stopPropagation();},onClick:t=>{t.preventDefault(),t.stopPropagation(),d?d():p();},sx:t=>({p:"1px",flexShrink:0,cursor:"pointer",color:"inherit",backgroundColor:"transparent",...s?{mr:2}:{},"&:hover":{backgroundColor:t.palette.action.hover},"&:focus-visible":{outline:`2px solid ${t.palette.primary.main}`,outlineOffset:1}}),children:jsx(f,{sx:{fontSize:8,width:8,height:8}})}):null,!r&&l&&!s&&jsx(U,{component:"span",className:`SelectBase-menuTriggerIcon${m?" SelectBase-menuTriggerIcon-open":""}`,"aria-hidden":true,children:jsx(a,{})})]})}function G(e,r){if(e==null)return false;if(Array.isArray(e))return e.length>0;if(typeof e=="object"){if(r){let l=r(e);return l!=null&&l!==""}let n=e.id;return n!=null&&n!==""}return String(e)!==""}var Z=styled(he)(({theme:e})=>({minWidth:52,height:"40px !important",maxHeight:"40px !important",backgroundColor:"transparent",width:"100%",cursor:"pointer","& .MuiInputBase-root":{cursor:"pointer"},"& .MuiInputBase-root.Mui-disabled":{cursor:"default"},"& .MuiFormLabel-asterisk":{color:"red"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)",color:`${e.palette.grey[700]} !important`,height:"100%",pointerEvents:"none"},".MuiFormLabel-root.MuiFormLabel-filled":{transform:"translate(8px, 8px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"}}));styled(_)(({theme:e})=>({fontSize:"11px",lineHeight:"11px",color:e.palette.common.black,borderRadius:"4px",boxShadow:e.shadows[17],border:"none",outline:"none","&:focus":{border:"1px solid #1F88D0"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"rgba(0, 0, 0, 0.23)"},"&.Mui-focused fieldset":{border:"2px solid red"}},minWidth:52,height:"40px !important",maxHeight:"40px !important",width:"100%","& .MuiFormLabel-asterisk":{color:"red"},"& .MuiFormLabel-root":{fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%",transform:"translate(8px, 15px) scale(1)"},".MuiFormLabel-root.MuiFormLabel-filled":{transform:"translate(8px, 8px) scale(0.75) "},".MuiFormLabel-root.Mui-focused":{transform:"translate(8px, 8px) scale(0.75)",fontSize:"10px",fontStyle:"normal",fontWeight:500,lineHeight:"100%"}}));var J=styled("small")(({theme:e})=>({color:e.palette.error.main,fontSize:"10px",lineHeight:"10px",marginTop:"4px",display:"block"})),K=styled(_,{shouldForwardProp:e=>!["feedbackType","hasFeedback"].includes(e)})(({theme:e,error:r,feedbackType:n,hasFeedback:l})=>{let{borderColor:m}=aa(e,n),s=l?"4px 4px 0 0":"4px";return {width:"100%",height:"40px !important",maxHeight:"40px !important",borderRadius:s,overflow:"hidden",backgroundColor:e.palette.grey[400],"&.Mui-disabled":{backgroundColor:e.palette.grey[400]},".MuiSelect-select":{padding:"0 8px !important",height:"40px !important",maxHeight:"40px !important",display:"flex",alignItems:"flex-end !important",backgroundColor:`${e.palette.grey[400]} !important`,borderRadius:s,fontSize:"11px",cursor:"pointer","&:focus":{backgroundColor:`${e.palette.grey[400]} !important`}},"&.Mui-disabled .MuiSelect-select":{cursor:"default"},".MuiSelect-filled":{padding:"0 8px !important"},"&.MuiInputBase-adornedEnd":{display:"inline-flex",alignItems:"center",backgroundColor:e.palette.grey[400],gap:0},"&&.MuiInputBase-adornedEnd .MuiInputBase-input":{flex:"1 1 0%",minWidth:0,width:"auto",maxWidth:"100%"},"& .SelectBase-endAdornmentRoot":{display:"flex",alignItems:"center",flexShrink:0,gap:"8px",position:"relative",zIndex:1},"& .SelectBase-menuTriggerIcon":{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"inherit",lineHeight:0,"& svg, & .MuiSvgIcon-root":{transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter})}},"& .SelectBase-menuTriggerIcon-open svg, & .SelectBase-menuTriggerIcon-open .MuiSvgIcon-root":{transform:"rotate(180deg)"},"&.Mui-disabled .MuiSelect-icon":{color:"rgba(0, 0, 0, 0.38)"},"&.Mui-disabled .SelectBase-menuTriggerIcon":{cursor:"default",color:"rgba(0, 0, 0, 0.38)","& svg path":{fill:"rgba(0, 0, 0, 0.38)",stroke:"rgba(0, 0, 0, 0.38)"}},...n&&{border:`1px solid ${m}`},...l&&{borderBottom:"none"},...r&&{border:`1px solid ${e.palette.error.main}`}}}),Q=styled(U)(()=>({display:"flex",alignItems:"stretch",height:"100%",flexDirection:"column",flex:1,cursor:"pointer","&:has(.MuiInputBase-root.Mui-disabled)":{cursor:"default"}}));function Pe({required:e,hasError:r,label:n,value:l,helperText:m,feedback:s,onChange:f,options:d,isOptionEqualToValue:p,renderOption:h,getOptionValue:t,isLoading:I,children:Y,getOptionLabel:k,IconComponent:F,showClearIcon:j=false,ClearIconComponent:q=y,onClear:O,endAdornment:V,inputProps:ee,open:C,onOpen:w,onClose:L,...P},oe){let[te,re]=useState(false),ne=Bc(useId(),"select-base-multiple"),le=C??te,v=useCallback((o,a)=>{a?w?.(o):L?.(o),C===void 0&&re(a);},[w,L,C]),ae=o=>{f?.(o);},ie=()=>{let o=l?.filter(a=>a!=null)??[];return t?o.map(t):o.map(a=>a?.id)},se=useMemo(()=>d?.filter(o=>l?.some(a=>{if(a==null)return false;if(p)return p(o,a);if(t){let g=t(o),b=t(a);return g===b||String(g)===String(b)}let c=o?.id,i=a?.id;return c===i||String(c)===String(i)})),[d,l,p,t]),de=()=>se?.map(o=>k?k(o):o.label)?.join(", "),E=!!(P.disabled||I),pe=j&&G(l,t)&&!E,ce=jsx(B,{endAdornmentProp:V,isLoading:!!I,showClear:pe,showMenuArrow:!I,menuOpen:le,IconComponent:F,ClearIconComponent:q,onClear:O,onClearDefault:()=>f?.([])}),{isProvided:ue,isVisible:R,type:me}=Dc(s);return jsxs(Q,{children:[jsxs(Z,{id:ne,variant:"filled","data-testid":"SelectBase",required:e,children:[jsx(we,{id:`select-label-${n.trim()}`,"data-testid":"SelectBase_InputLabel",children:n}),jsx(K,{multiple:true,"data-testid":"SelectBase_Select",ref:oe,value:ie()??"",error:r&&!R,feedbackType:me,hasFeedback:R,disableUnderline:true,required:e,labelId:`select-label-${n.trim()}`,id:`select-label-${n.trim()}`,renderValue:de,...P,open:C,onOpen:o=>v(o,true),onClose:o=>v(o,false),inputProps:ee,disabled:E,IconComponent:F??(()=>null),endAdornment:ce,onChange:o=>{let c=o.target.value?.map(i=>d?.find(g=>{if(t){let A=t(g);return A===i||String(A)===String(i)}let b=g?.id;return b===i||String(b)===String(i)}));f?.(c?.filter(i=>i!=null)??[]);},children:Y||d?.map((o,a)=>{let c=p?p(o,l):o?.id===l?.id;return jsx(Le,{value:(t?t(o):o?.id)??"",onClick:()=>{ae(o);},sx:{fontSize:"12px",backgroundColor:i=>c?i.palette.action.hover:i.palette.common.white},children:h?h(o):o.label},`select-base-multiple-item-${a}`)})})]}),ue?jsx(ba,{...s}):jsx(J,{children:m})]})}var so=Ie.forwardRef(Pe);export{y as a,B as b,G as c,Z as d,J as e,K as f,Q as g,so as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {j}from'./chunk-
|
|
1
|
+
import {j}from'./chunk-V5LH2RXO.js';import {styled,Box,Button}from'@mui/material';var d=styled(j)(({theme:o})=>{let{grey:r}=o.v2.palette;return {fontWeight:o.v2.typography.fontWeightMedium,fontSize:"0.6875rem",color:r[500],paddingInlineStart:o.v2.spacing(16),paddingTop:o.v2.spacing(8),paddingBottom:o.v2.spacing(8),paddingInlineEnd:o.v2.spacing(8),borderBottom:`1px solid ${r[100]}`}}),l=styled(Box)(({theme:o})=>({padding:"8px 16px",display:"flex",gap:"8px",justifyContent:"center",position:"sticky",bottom:0,backgroundColor:"white",zIndex:99999,borderTop:`1px solid ${o.palette.divider}`})),c=styled(Button)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.info.dark}`,backgroundColor:o.palette.info.dark,fontWeight:700,fontSize:"11px",color:o.palette.common.white,"&:hover":{backgroundColor:o.palette.info.dark}})),s=styled(Button)(({theme:o})=>({textTransform:"capitalize",minWidth:"auto",width:74,borderRadius:"4px",border:`1px solid ${o.palette.divider}`,backgroundColor:o.palette.common.white,fontWeight:500,fontSize:"11px",color:o.palette.text.primary,"&:hover":{background:"transparent"}}));export{d as a,l as b,c,s as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {zc}from'./chunk-MZMXF4IE.js';import {useId,useState,useRef,useCallback,useMemo,useEffect,useLayoutEffect}from'react';import {motion,AnimatePresence,useMotionValue,animate}from'framer-motion';import zt from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=3,ft=styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:0,minWidth:0,height:"auto",lineHeight:1,position:"relative",zIndex:1001,fontSize:"12px",color:t.palette.text.primary})),ht=styled(motion.div)(()=>({display:"inline-flex"})),ut=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),gt=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),tt=styled(motion.div)(({side:t})=>({position:"absolute",display:"flex",alignItems:"center",...t==="left"?{right:"100%",flexDirection:"row-reverse",transformOrigin:"right center"}:{},...t==="right"?{left:"100%",flexDirection:"row",transformOrigin:"left center"}:{},top:"50%",transform:"translateY(-50%)",gap:0,pointerEvents:"auto",overflow:"visible"})),et=styled("div")(({side:t})=>({position:"absolute",top:0,bottom:0,...t==="left"?{right:"100%"}:{left:"100%"},pointerEvents:"auto",background:"transparent"})),xt=styled(motion.div)(()=>({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:24,overflow:"visible"})),j=t=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,fontSize:12,boxSizing:"border-box",whiteSpace:"nowrap",overflow:"visible"}),mt=styled(motion.div)(({theme:t})=>({...j(t),position:"relative",zIndex:2,minWidth:24,flex:"0 0 auto",display:"inline-flex",overflow:"hidden",willChange:"transform"})),Ct=styled(motion.span)(()=>({display:"inline-flex",alignItems:"center",transform:"translateZ(0)"})),nt=styled(motion.span)(({theme:t})=>({display:"inline-flex",whiteSpace:"nowrap",overflow:"hidden",boxSizing:"border-box",willChange:"width",border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,height:"24px",alignItems:"center",paddingInline:"0px"})),it=styled(motion.span)(()=>({display:"inline-flex",whiteSpace:"nowrap",alignItems:"center",height:"100%"})),yt=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",left:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),Et=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",right:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),rt=styled(motion.div)(({theme:t})=>({...j(t),minWidth:24,flex:"0 0 auto",display:"inline-flex"})),vt=styled(zt)(()=>({position:"relative",overflow:"visible",zIndex:101,display:"flex",alignItems:"center",justifyContent:"center",minHeight:"20px"}));var L=24;function Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}){let[l,P]=useState(false),[r,q]=useState({left:0,right:0}),[c,G]=useState([]),[d,X]=useState([]),[f,J]=useState(0),[b,Y]=useState(0),m=useRef(null),k=useRef(null),z=useRef(null),M=useRef(null),A=useRef([]),O=useRef([]),T=useRef(null),$=useRef(null),I=useRef(null),w=useCallback((e,i)=>{if(e===i)return true;if(e.length!==i.length)return false;for(let a=0;a<e.length;a++)if(e[a]!==i[a])return false;return true},[]),D=useCallback((e,i)=>e.left===i.left&&e.right===i.right,[]),g=useMotionValue(0),n=useMotionValue(0),N=useMotionValue(0),C=useMemo(()=>{if(!c.length)return [];let e=[],i=x+c[0]/2;e.push(i);for(let a=1;a<c.length;a++)i+=c[a-1]/2+x+c[a]/2,e.push(i);return e},[c]),y=useMemo(()=>{if(!d.length)return [];let e=[],i=x+d[0]/2;e.push(i);for(let a=1;a<d.length;a++)i+=d[a-1]/2+x+d[a]/2,e.push(i);return e},[d]),Lt=l&&h?f:0,K=l&&u?b:0,at=h?f:0,Wt=useCallback(()=>{m.current&&clearTimeout(m.current),P(true);},[]),St=useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>P(false),120);},[]),_=useCallback(()=>{let e=k.current,i=M.current,a=z.current,Q=r;if(e){let R=e.getBoundingClientRect(),Z=(i??a)?.getBoundingClientRect();if(Z){let Pt=Math.round(Z.left-R.left),kt=Math.round(Z.right-R.left);Q={left:Pt,right:kt};}}let st=A.current.map(R=>R?R.offsetWidth:L),lt=O.current.map(R=>R?R.offsetWidth:L),pt=T.current?.scrollWidth??0,ct=$.current?.scrollWidth??0;D(r,Q)||q(Q),w(c,st)||G(st),w(d,lt)||X(lt),f!==pt&&J(pt),b!==ct&&Y(ct);},[r,c,d,f,b,D,w]),B=useCallback(()=>{I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{_();});},[_]);useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),useLayoutEffect(()=>{_();},[H,t,v,h,u,_]),useEffect(()=>(B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B),I.current&&cancelAnimationFrame(I.current);}),[B]),useEffect(()=>{let i=animate(g,l&&h?f:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,h,f,g]),useEffect(()=>{let i=animate(n,l&&u?b:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,u,b,n]);let wt=useMemo(()=>{if(!C.length)return 0;let e=C.length-1,i=c[e]??L;return C[e]+i/2+K+x},[C,c,K]),Ht=useMemo(()=>{if(!y.length)return 0;let e=y.length-1,i=d[e]??L;return at+y[e]+i/2+x},[y,d,at]);return {isHovering:l,handleMouseEnter:Wt,handleMouseLeave:St,centerWrapRef:k,centerContentRef:z,centerChipRef:M,anchors:r,leftChipRefs:A,rightChipRefs:O,leftOffsets:C,rightOffsets:y,expandableRightInnerRef:T,expandableLeftInnerRef:$,expandableRightWidth:f,expandableLeftWidth:b,expandedRightMV:g,expandedLeftMV:n,shiftX:N,rightShift:Lt,leftShift:K,leftHoverWidth:wt,rightHoverWidth:Ht}}function Ot({leftIcons:t=[],rightIcons:v=[],centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u,expandedZIndex:l=1e3,...P}){let{isHovering:r,handleMouseEnter:q,handleMouseLeave:c,centerWrapRef:G,centerContentRef:d,centerChipRef:X,anchors:f,leftChipRefs:J,rightChipRefs:b,leftOffsets:Y,rightOffsets:m,expandableRightInnerRef:k,expandableLeftInnerRef:z,expandedRightMV:M,expandedLeftMV:A,shiftX:O,rightShift:T,leftShift:$,leftHoverWidth:I,rightHoverWidth:w}=Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}),D=zc(useId(),"right-left-expanding-center-chip");return jsx(vt,{...P,id:D,"data-testid":"RightLeftExpandingCenterChipBox",children:jsx(ht,{"data-testid":"CenterShiftWrapper",initial:false,style:{x:O},children:jsxs(ft,{"data-testid":"CenterIconWrapper",ref:G,onMouseLeave:c,children:[jsxs(xt,{"data-testid":"PeekContainer",children:[jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(yt,{"data-testid":"LeftPeekChip",initial:{opacity:0,scale:.95,x:-4},animate:r?{opacity:0,scale:.9,x:-6}:{opacity:1,scale:1,x:-5},exit:{opacity:0,scale:.95,x:-4},transition:{duration:.18,ease:"easeOut"}},"left-peek")}),jsx(mt,{"data-testid":"CenterChip",ref:X,onMouseEnter:q,style:{borderRadius:(()=>{let g=u&&r,n=h&&r;return g&&n?"0":g?"0 12px 12px 0":n?"12px 0 0 12px":"12px"})(),borderLeft:u&&r?"none":void 0,borderRight:h&&r?"none":void 0},children:jsx(Ct,{"data-testid":"CenterContent",ref:d,children:H})}),u&&jsx(nt,{"data-testid":"ExpandableLeftContainer",style:{width:A,position:"absolute",right:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"12px 0 0 12px",borderRight:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableLeftInner",ref:z,children:u})}),h&&jsx(nt,{"data-testid":"ExpandableRightContainer",style:{width:M,position:"absolute",left:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"0 12px 12px 0",borderLeft:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableRightInner",ref:k,children:h})}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(Et,{"data-testid":"RightPeekChip",initial:{opacity:0,scale:.95,x:4},animate:r?{opacity:0,scale:.9,x:6}:{opacity:1,scale:1,x:5},exit:{opacity:0,scale:.95,x:4},transition:{duration:.18,ease:"easeOut"}},"right-peek")})]}),r&&t.length>0&&jsx(et,{"data-testid":"LeftHoverBridge",side:"left",style:{width:I,right:`calc(100% - ${f.left}px)`,zIndex:l,pointerEvents:"auto"}}),r&&v.length>0&&jsx(et,{"data-testid":"RightHoverBridge",side:"right",style:{width:w,left:`${f.right}px`,zIndex:l,pointerEvents:"auto"}}),jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(tt,{"data-testid":"LeftExpandedSection",side:"left",style:{right:`calc(100% - ${f.left}px)`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:t.map((g,n)=>{let C=(Y[n]??(L+x)*(n+1))+$;return jsx(ut,{"data-testid":`LeftExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:-C}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(t.length-n)},children:jsx(rt,{"data-testid":`LeftExpandChip-${n}`,ref:y=>J.current[n]=y,children:g})},`left-${n}`)})},"left-expanded")}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(tt,{"data-testid":"RightExpandedSection",side:"right",style:{left:`${f.right}px`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:v.map((g,n)=>{let N=m[n]??(L+x)*(n+1),C=T;return jsx(gt,{"data-testid":`RightExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:C+N}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(v.length-n)},children:jsx(rt,{"data-testid":`RightExpandChip-${n}`,ref:y=>b.current[n]=y,children:g})},`right-${n}`)})},"right-expanded")})]})})})}var Tt=Ot;export{Tt as a};
|
|
1
|
+
import {Bc}from'./chunk-L7L22FDR.js';import {useId,useState,useRef,useCallback,useMemo,useEffect,useLayoutEffect}from'react';import {motion,AnimatePresence,useMotionValue,animate}from'framer-motion';import zt from'@mui/material/Box';import {styled}from'@mui/material/styles';import {jsx,jsxs}from'react/jsx-runtime';var x=3,ft=styled(motion.div)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:0,minWidth:0,height:"auto",lineHeight:1,position:"relative",zIndex:1001,fontSize:"12px",color:t.palette.text.primary})),ht=styled(motion.div)(()=>({display:"inline-flex"})),ut=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),gt=styled(motion.span)(({theme:t})=>({position:"static",display:"inline-flex",alignItems:"center",justifyContent:"center",width:0,overflow:"visible",margin:0,padding:0,fontSize:"10px",lineHeight:1,color:t.palette.text.secondary,userSelect:"none"})),tt=styled(motion.div)(({side:t})=>({position:"absolute",display:"flex",alignItems:"center",...t==="left"?{right:"100%",flexDirection:"row-reverse",transformOrigin:"right center"}:{},...t==="right"?{left:"100%",flexDirection:"row",transformOrigin:"left center"}:{},top:"50%",transform:"translateY(-50%)",gap:0,pointerEvents:"auto",overflow:"visible"})),et=styled("div")(({side:t})=>({position:"absolute",top:0,bottom:0,...t==="left"?{right:"100%"}:{left:"100%"},pointerEvents:"auto",background:"transparent"})),xt=styled(motion.div)(()=>({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",height:24,overflow:"visible"})),j=t=>({border:`1px solid ${t.palette.divider}`,borderRadius:"12px",backgroundColor:t.palette.background.paper,paddingInline:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,fontSize:12,boxSizing:"border-box",whiteSpace:"nowrap",overflow:"visible"}),mt=styled(motion.div)(({theme:t})=>({...j(t),position:"relative",zIndex:2,minWidth:24,flex:"0 0 auto",display:"inline-flex",overflow:"hidden",willChange:"transform"})),Ct=styled(motion.span)(()=>({display:"inline-flex",alignItems:"center",transform:"translateZ(0)"})),nt=styled(motion.span)(({theme:t})=>({display:"inline-flex",whiteSpace:"nowrap",overflow:"hidden",boxSizing:"border-box",willChange:"width",border:`1px solid ${t.palette.divider}`,backgroundColor:t.palette.background.paper,height:"24px",alignItems:"center",paddingInline:"0px"})),it=styled(motion.span)(()=>({display:"inline-flex",whiteSpace:"nowrap",alignItems:"center",height:"100%"})),yt=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",left:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),Et=styled(motion.div)(({theme:t})=>({...j(t),position:"absolute",right:0,zIndex:1,pointerEvents:"none",minWidth:24,paddingInline:0})),rt=styled(motion.div)(({theme:t})=>({...j(t),minWidth:24,flex:"0 0 auto",display:"inline-flex"})),vt=styled(zt)(()=>({position:"relative",overflow:"visible",zIndex:101,display:"flex",alignItems:"center",justifyContent:"center",minHeight:"20px"}));var L=24;function Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}){let[l,P]=useState(false),[r,q]=useState({left:0,right:0}),[c,G]=useState([]),[d,X]=useState([]),[f,J]=useState(0),[b,Y]=useState(0),m=useRef(null),k=useRef(null),z=useRef(null),M=useRef(null),A=useRef([]),O=useRef([]),T=useRef(null),$=useRef(null),I=useRef(null),w=useCallback((e,i)=>{if(e===i)return true;if(e.length!==i.length)return false;for(let a=0;a<e.length;a++)if(e[a]!==i[a])return false;return true},[]),D=useCallback((e,i)=>e.left===i.left&&e.right===i.right,[]),g=useMotionValue(0),n=useMotionValue(0),N=useMotionValue(0),C=useMemo(()=>{if(!c.length)return [];let e=[],i=x+c[0]/2;e.push(i);for(let a=1;a<c.length;a++)i+=c[a-1]/2+x+c[a]/2,e.push(i);return e},[c]),y=useMemo(()=>{if(!d.length)return [];let e=[],i=x+d[0]/2;e.push(i);for(let a=1;a<d.length;a++)i+=d[a-1]/2+x+d[a]/2,e.push(i);return e},[d]),Lt=l&&h?f:0,K=l&&u?b:0,at=h?f:0,Wt=useCallback(()=>{m.current&&clearTimeout(m.current),P(true);},[]),St=useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>P(false),120);},[]),_=useCallback(()=>{let e=k.current,i=M.current,a=z.current,Q=r;if(e){let R=e.getBoundingClientRect(),Z=(i??a)?.getBoundingClientRect();if(Z){let Pt=Math.round(Z.left-R.left),kt=Math.round(Z.right-R.left);Q={left:Pt,right:kt};}}let st=A.current.map(R=>R?R.offsetWidth:L),lt=O.current.map(R=>R?R.offsetWidth:L),pt=T.current?.scrollWidth??0,ct=$.current?.scrollWidth??0;D(r,Q)||q(Q),w(c,st)||G(st),w(d,lt)||X(lt),f!==pt&&J(pt),b!==ct&&Y(ct);},[r,c,d,f,b,D,w]),B=useCallback(()=>{I.current&&cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{_();});},[_]);useEffect(()=>()=>{m.current&&clearTimeout(m.current);},[]),useLayoutEffect(()=>{_();},[H,t,v,h,u,_]),useEffect(()=>(B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B),I.current&&cancelAnimationFrame(I.current);}),[B]),useEffect(()=>{let i=animate(g,l&&h?f:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,h,f,g]),useEffect(()=>{let i=animate(n,l&&u?b:0,{duration:.2,ease:"easeOut"});return ()=>i.stop()},[l,u,b,n]);let wt=useMemo(()=>{if(!C.length)return 0;let e=C.length-1,i=c[e]??L;return C[e]+i/2+K+x},[C,c,K]),Ht=useMemo(()=>{if(!y.length)return 0;let e=y.length-1,i=d[e]??L;return at+y[e]+i/2+x},[y,d,at]);return {isHovering:l,handleMouseEnter:Wt,handleMouseLeave:St,centerWrapRef:k,centerContentRef:z,centerChipRef:M,anchors:r,leftChipRefs:A,rightChipRefs:O,leftOffsets:C,rightOffsets:y,expandableRightInnerRef:T,expandableLeftInnerRef:$,expandableRightWidth:f,expandableLeftWidth:b,expandedRightMV:g,expandedLeftMV:n,shiftX:N,rightShift:Lt,leftShift:K,leftHoverWidth:wt,rightHoverWidth:Ht}}function Ot({leftIcons:t=[],rightIcons:v=[],centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u,expandedZIndex:l=1e3,...P}){let{isHovering:r,handleMouseEnter:q,handleMouseLeave:c,centerWrapRef:G,centerContentRef:d,centerChipRef:X,anchors:f,leftChipRefs:J,rightChipRefs:b,leftOffsets:Y,rightOffsets:m,expandableRightInnerRef:k,expandableLeftInnerRef:z,expandedRightMV:M,expandedLeftMV:A,shiftX:O,rightShift:T,leftShift:$,leftHoverWidth:I,rightHoverWidth:w}=Rt({leftIcons:t,rightIcons:v,centerIcon:H,expandableCenterRight:h,expandableCenterLeft:u}),D=Bc(useId(),"right-left-expanding-center-chip");return jsx(vt,{...P,id:D,"data-testid":"RightLeftExpandingCenterChipBox",children:jsx(ht,{"data-testid":"CenterShiftWrapper",initial:false,style:{x:O},children:jsxs(ft,{"data-testid":"CenterIconWrapper",ref:G,onMouseLeave:c,children:[jsxs(xt,{"data-testid":"PeekContainer",children:[jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(yt,{"data-testid":"LeftPeekChip",initial:{opacity:0,scale:.95,x:-4},animate:r?{opacity:0,scale:.9,x:-6}:{opacity:1,scale:1,x:-5},exit:{opacity:0,scale:.95,x:-4},transition:{duration:.18,ease:"easeOut"}},"left-peek")}),jsx(mt,{"data-testid":"CenterChip",ref:X,onMouseEnter:q,style:{borderRadius:(()=>{let g=u&&r,n=h&&r;return g&&n?"0":g?"0 12px 12px 0":n?"12px 0 0 12px":"12px"})(),borderLeft:u&&r?"none":void 0,borderRight:h&&r?"none":void 0},children:jsx(Ct,{"data-testid":"CenterContent",ref:d,children:H})}),u&&jsx(nt,{"data-testid":"ExpandableLeftContainer",style:{width:A,position:"absolute",right:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"12px 0 0 12px",borderRight:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableLeftInner",ref:z,children:u})}),h&&jsx(nt,{"data-testid":"ExpandableRightContainer",style:{width:M,position:"absolute",left:"100%",top:0,height:"24px",zIndex:1,opacity:r?1:0,pointerEvents:r?"auto":"none",borderRadius:"0 12px 12px 0",borderLeft:"none"},initial:false,transition:{duration:.2,ease:"easeOut"},children:jsx(it,{"data-testid":"ExpandableRightInner",ref:k,children:h})}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(Et,{"data-testid":"RightPeekChip",initial:{opacity:0,scale:.95,x:4},animate:r?{opacity:0,scale:.9,x:6}:{opacity:1,scale:1,x:5},exit:{opacity:0,scale:.95,x:4},transition:{duration:.18,ease:"easeOut"}},"right-peek")})]}),r&&t.length>0&&jsx(et,{"data-testid":"LeftHoverBridge",side:"left",style:{width:I,right:`calc(100% - ${f.left}px)`,zIndex:l,pointerEvents:"auto"}}),r&&v.length>0&&jsx(et,{"data-testid":"RightHoverBridge",side:"right",style:{width:w,left:`${f.right}px`,zIndex:l,pointerEvents:"auto"}}),jsx(AnimatePresence,{initial:false,children:t.length>0&&jsx(tt,{"data-testid":"LeftExpandedSection",side:"left",style:{right:`calc(100% - ${f.left}px)`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:t.map((g,n)=>{let C=(Y[n]??(L+x)*(n+1))+$;return jsx(ut,{"data-testid":`LeftExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:-C}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(t.length-n)},children:jsx(rt,{"data-testid":`LeftExpandChip-${n}`,ref:y=>J.current[n]=y,children:g})},`left-${n}`)})},"left-expanded")}),jsx(AnimatePresence,{initial:false,children:v.length>0&&jsx(tt,{"data-testid":"RightExpandedSection",side:"right",style:{left:`${f.right}px`,top:"50%",position:"absolute",pointerEvents:r?"auto":"none",zIndex:l},initial:{opacity:0,x:0,y:"-50%"},animate:r?{opacity:1,x:0,y:"-50%"}:{opacity:0,x:0,y:"-50%"},exit:{opacity:0,x:0,y:"-50%"},transition:{duration:.25,ease:"easeOut"},children:v.map((g,n)=>{let N=m[n]??(L+x)*(n+1),C=T;return jsx(gt,{"data-testid":`RightExpandIcon-${n}`,initial:{opacity:0,x:0},animate:r?{opacity:1,x:C+N}:{opacity:0,x:0},exit:{opacity:0,x:0},transition:{duration:.25+n*.04,ease:"easeOut"},style:{zIndex:l+(v.length-n)},children:jsx(rt,{"data-testid":`RightExpandChip-${n}`,ref:y=>b.current[n]=y,children:g})},`right-${n}`)})},"right-expanded")})]})})})}var Tt=Ot;export{Tt as a};
|