"use strict";var e=require("@gem-sdk/core"),t=require("@gem-sdk/system");const r=e=>{let t=e.desktop,r=e.tablet?e.tablet:t,p=e.mobile?e.mobile:r;return{desktop:t,tablet:r,mobile:p}},p={desktop:"1200px",tablet:"100%",mobile:"100%"},a=(e,t)=>t?.[e]==="100%"?{contentWidth:"100%",wrapperWidth:"100%",wrapperPadding:"var(--g-ct-p)"}:t?.[e]==="default"?{contentWidth:`var(--g-ct-w, ${p[e]})`,wrapperWidth:`calc(var(--g-ct-w, ${p[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, ${p[e]}) + 2 * var(--g-ct-p, 15px))`,wrapperPadding:"var(--g-ct-p, 15px)"};function d(e,t){if(!e||!t)return{};let r={};return["normal","hover","active"].forEach(p=>{let a=e?.[p],d=t?.[p];a&&d&&(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}}(a.width,d))}),r}exports.checkHasBackgroundVideo=t=>e.DEVICES.some(r=>{let p=e.getValueByDevice(t,r);return!!p&&(p?.videoType==="html5"&&p?.videoHtml5||p?.videoType==="youtube"&&p?.video)}),exports.createStyleObject=e=>{let t=a("desktop",e),r=a("tablet",e),p=a("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}}},exports.getData=(r,p)=>{let{builderProps:a}=r,d=t.createStateOrContext({background:p,uid:a?.uid});return{stateData:e.dataStringify(d).replaceAll("'","&#039;")}},exports.getInnerRadiusExcludeBorder=function(e,t){return{desktop:d(e?.desktop,t?.desktop),tablet:d(e?.tablet??e?.desktop,t?.tablet??t?.desktop),mobile:d(e?.mobile??e?.tablet??e?.desktop,t?.mobile??t?.tablet??t?.desktop)}},exports.isRenderHtmlVideo=e=>{let t=r(e||{}),p=t.desktop?.videoType,a=t.tablet?.videoType,d=t.mobile?.videoType;return"html5"==p||"html5"==a||"html5"==d},exports.isRenderYoutubeVideo=e=>{let t=r(e||{}),p=t.desktop?.videoType,a=t.tablet?.videoType,d=t.mobile?.videoType;return"youtube"==p||"youtube"==a||"youtube"==d};
