import{DEVICES as e,getValueByDevice as t,dataStringify as r}from"@gem-sdk/core";import{createStateOrContext as p}from"@gem-sdk/system";let d=e=>{let t=e.desktop,r=e.tablet?e.tablet:t,p=e.mobile?e.mobile:r;return{desktop:t,tablet:r,mobile:p}},a={desktop:"1200px",tablet:"100%",mobile:"100%"},o=(e,t)=>t?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:t?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${a[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${a[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:t?.[e]!==void 0?{contentWidth:t?.[e],wrapperWidth:`calc(${t?.[e]} + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"}:{contentWidth:void 0,wrapperWidth:`calc(var(--g-ct-w, ${a[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"},i=e=>{let t=o("desktop",e),r=o("tablet",e),p=o("mobile",e);return{content:{desktop:t.contentWidth,tablet:r.contentWidth,mobile:p.contentWidth},wrapper:{desktop:t.wrapperWidth,tablet:r.wrapperWidth,mobile:p.wrapperWidth},padding:{desktop:t.wrapperPadding,tablet:r.wrapperPadding,mobile:p.wrapperPadding}}},l=(e,t)=>{let{builderProps:d}=e,a=p({background:t,uid:d?.uid});return{stateData:r(a).replaceAll("'","&#039;")}};function n(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(p=>{let d=e?.[p],a=t?.[p];d&&a&&(r[p]=function(e,t){if(!e||!t)return{};let r=("string"==typeof e?e.split(" "):[]).map(e=>parseInt(e,10)||0),p=Object.fromEntries(["btrr","bblr","bbrr","btlr"].map((e,p)=>[e,Math.max(0,(parseInt(t[e]??"0",10)||0)-(r[p]||0))+"px"]));return{...p,radiusType:t.radiusType}}(d.width,a))}),r}function b(e,t){return{desktop:n(e?.desktop,t?.desktop),tablet:n(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:n(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}}let c=r=>e.some(e=>{let p=t(r,e);return!!p&&(p?.videoType==="html5"&&p?.videoHtml5||p?.videoType==="youtube"&&p?.video)}),u=e=>{let t=d(e||{}),r=t.desktop?.videoType,p=t.tablet?.videoType,a=t.mobile?.videoType;return"html5"==r||"html5"==p||"html5"==a},s=e=>{let t=d(e||{}),r=t.desktop?.videoType,p=t.tablet?.videoType,a=t.mobile?.videoType;return"youtube"==r||"youtube"==p||"youtube"==a};export{c as checkHasBackgroundVideo,i as createStyleObject,l as getData,b as getInnerRadiusExcludeBorder,u as isRenderHtmlVideo,s as isRenderYoutubeVideo};
