"use strict";var core=require("@gem-sdk/core");const getDisplayStyle=e=>Object.keys(e??{}).filter(e=>["--d","--d-mobile","--d-tablet"].includes(e)).reduce((t,r)=>({...t,[r]:e?.[r]}),{}),pointerEventStyle=e=>Object.keys(e??{}).filter(e=>["--d","--d-mobile","--d-tablet"].includes(e)).reduce((t,r)=>({...t,[r.replace("--d","--pe")]:e?.[r]==="none"?"none":"auto"}),{}),getBorderStyle=e=>Object.keys(e??{}).filter(e=>["--bw","--bw-mobile","--bw-tablet","--bc","--bc-tablet","--bc-mobile","--b","--b-tablet","--b-mobile","--bs","--bs-tablet","--bs-mobile","--radius","--radius-tablet","--radius-mobile","--bblr","--bbrr","--btlr","--btrr","--bblr-tablet","--bbrr-tablet","--btlr-tablet","--btrr-tablet","--bblr-mobile","--bbrr-mobile","--btlr-mobile","--btrr-mobile"].includes(e)).reduce((t,r)=>({...t,[r]:e?.[r]}),{}),getWrapperDialogStyle=e=>Object.keys(e??{}).filter(e=>e.startsWith("--mt")||e.startsWith("--mb")||e.startsWith("--ml")||e.startsWith("--mr")).reduce((t,r)=>({...t,[r]:e?.[r]}),{}),getInnerStyle=e=>Object.keys(e??{}).filter(t=>!Object.keys(getWrapperDialogStyle(e)).includes(t)&&!Object.keys(getDisplayStyle(e)).includes(t)&&!Object.keys(getBorderStyle(e)).includes(t)).reduce((t,r)=>({...t,[r]:e?.[r]}),{}),createDialogKey=(e="",t="")=>({id:`dialog:${e}:${t}`,time:`dialog:${e}:${t}:time`}),isShowModal=(e,t=0)=>{let r=e?new Date(Number(e)):new Date,l=Date.now()-r.getTime(),i=Math.abs(l/24/60/60/1e3);return i>=t},isMobile=e=>!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e),getPropertyByDevice=(e,t)=>"tablet"===t?e?.tablet??e?.desktop:"mobile"===t?e?.mobile??e?.tablet??e?.desktop:e?.desktop,heightStyle=(e,t)=>({...e?.desktop?core.makeStyle({h:"100%"}):t?.desktop?core.makeStyle({h:t.desktop}):core.makeStyle({minh:"300px"}),"--h-tablet":getPropertyByDevice(e,"tablet")?"100%":getPropertyByDevice(t,"tablet")??"300px","--h-mobile":getPropertyByDevice(e,"mobile")?"100%":getPropertyByDevice(t,"mobile")??"300px","--maxh":getPropertyByDevice(e,"desktop")?"100%":"","--maxh-tablet":getPropertyByDevice(e,"tablet")?"100%":"","--maxh-mobile":getPropertyByDevice(e,"mobile")?"100%":""}),removeHeightPercentForContent=e=>({...e,"--h":e["--h"]?.includes("%")?"100%":e["--h"],"--h-tablet":e["--h-tablet"]?.includes("%")?"100%":e["--h-tablet"],"--h-mobile":e["--h-mobile"]?.includes("%")?"100%":e["--h-mobile"]}),parseNumber=e=>{let t=parseFloat(e?.toString()??"0");return isNaN(t)?0:t},getOverlayOpacity=e=>"number"!=typeof e||isNaN(e)?"string"==typeof e?parseFloat(e)+"%":"0%":e+"%";exports.createDialogKey=createDialogKey,exports.getBorderStyle=getBorderStyle,exports.getDisplayStyle=getDisplayStyle,exports.getInnerStyle=getInnerStyle,exports.getOverlayOpacity=getOverlayOpacity,exports.getPropertyByDevice=getPropertyByDevice,exports.getWrapperDialogStyle=getWrapperDialogStyle,exports.heightStyle=heightStyle,exports.isMobile=isMobile,exports.isShowModal=isShowModal,exports.parseNumber=parseNumber,exports.pointerEventStyle=pointerEventStyle,exports.removeHeightPercentForContent=removeHeightPercentForContent;
