import{DEVICES as e,getResponsiveValueByScreen as r}from"@gem-sdk/core";import{useRef as t,useEffect as n}from"react";let getDeviceProperty=(e,r)=>`--${e}${"desktop"===r?"":`-${r}`}`,makeStyleGapForLabel=(t,n)=>{let o={};return e.forEach(e=>{let l=getDeviceProperty("mr",e),c=getDeviceProperty("mb",e),i=r(t,e);o="vertical"===i?{...o,[c]:n,[l]:"0px"}:{...o,[l]:n,[c]:"0px"}}),o};function isColorDark(e){if(!e)return;e=e.replace(/^#/,"");let r=parseInt(e.slice(0,2),16),t=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return .2126*r+.7152*t+.0722*n<128}let useTransition=(e,r)=>{let o=t(null),l=t([]);n(()=>{o.current=e},[e]),n(()=>{null!==l.current&&o.current&&"function"==typeof o.current&&o.current(...l.current),l.current=r},r)};export{isColorDark,makeStyleGapForLabel,useTransition};
