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