'use client';
import{jsxs as e,Fragment as t,jsx as o}from"react/jsx-runtime";import{useEditorMode as l,makeStyleResponsive as r,getStyleBackgroundByDevice as a}from"@gem-sdk/core";import i from"next/dynamic";import m from"next/script";import{getKlaviyoCode as n,getKlaviyoScriptUri as d,getKlaviyoFormCode as s}from"../common/helpers.js";let KlaviyoSampleContent=i(()=>import("./Klaviyo/KlaviyoSampleContent.js")),InstantKlaviyo=({setting:i,styles:p,builderAttrs:y,style:f})=>{let{klaviyoCodes:c,background:v}=i??{},C=l(),u=()=>{let e=s(c?.formCode||"");return c?.isEmbed&&c?.formCode&&"edit"!==C&&e};return e(t,{children:["edit"!==C&&n(c?.klaviyoCode||"")&&o(m,{strategy:"lazyOnload",src:d(n(c?.klaviyoCode||"")),defer:!0}),e("div",{...y,style:{...f,...r("ta",p?.align),...a(v)},className:"gp-h-full gp-w-full",children:[u()&&o("div",{className:s(c?.formCode||"")}),"edit"===C&&o(KlaviyoSampleContent,{style:p})]})]})};export{InstantKlaviyo as default};
