import{u as n,j as p,F as g,a as i,R as u,_ as x}from"./index.js";import{s as $,C as c}from"./styled-components.browser.esm.js";import{L as w}from"./animate.es.js";import{N as b,g as y}from"./translationUtils.js";const E=u.lazy(()=>x(()=>import("./UploadPortal.js"),["UploadPortal.js","index.js","animate.es.js","styled-components.browser.esm.js","useBlockScroll.js"]));function _(){const e=n(t=>t.setUploadOpen),a=n(t=>t.settings),m=n(t=>t.postWidth),r=n(t=>t.company),d=n(t=>{var o;return(o=t.market)==null?void 0:o.language}),v=()=>{var o,s;let t=`https://upload.cevoid.com/${r==null?void 0:r.slug}?mode=modal&origin=${window.location.href}`;return(o=a==null?void 0:a.callToAction)!=null&&o.uploadSource&&(t+=`&source=${(s=a==null?void 0:a.callToAction)==null?void 0:s.uploadSource}`),d&&(t+=`&language=${d}`),t},h=()=>{if(document.getElementById("cevoid-iframe-loader"))return;const o=document.createElement("div");o.id="cevoid-iframe-loader",o.style.overflow="hidden",o.style.position="fixed",o.style.pointerEvents="none",o.style.opacity=0,o.style.zIndex=-1,o.style.willChange="transform",document.body.appendChild(o)},f=()=>{const t=document.getElementById("cevoid-iframe-loader");if(document.getElementById("cevoid-upload-frame"))return;const o=document.createElement("iframe");o.id="cevoid-upload-frame",o.src=v(),o.title="Upload",o.allowtransparency=!0,t.appendChild(o)},l=()=>{h(),f()};return p(g,{children:[i(I,{className:"cevoid-not-loaded",$width:m,$usernameLocation:a==null?void 0:a.usernameLocation,onMouseEnter:l,onTouchStart:l,children:i("div",{className:"cevoid-cta",onClick:()=>e(!0),children:p("div",{className:"cevoid-cta-content",children:[i("div",{className:"cevoid-cta-text",children:i(b,{children:y("callToActionText","Upload a post")})}),i(w,{})]})})},"cta-box"),i(u.Suspense,{fallback:i("div",{}),children:i(E,{},"upload-portal")})]})}const I=$.div` position: relative; overflow: hidden; width: 100%; max-width: 100%; padding-bottom: 100%; opacity: 0; transform: scale(0.95); ${e=>e.$usernameLocation==="INSIDE"&&c` height: 100%; `} .cevoid-cta { background: var(--cevoid-call-to-action-background); border-radius: var(--cevoid-corner-roundness); color: var(--cevoid-call-to-action-text); cursor: pointer; display: block; height: 100%; width: 100%; overflow: hidden; position: absolute; .cevoid-cta-content { position: absolute; z-index: 1; background: var(--cevoid-call-to-action-background); width: 100%; bottom: 0px; display: flex; flex-direction: column; grid-gap: 10px; border-radius: 0px 0px var(--cevoid-corner-roundness) var(--cevoid-corner-roundness); padding: calc(${e=>e.$width/10}px); text-align: left; ${e=>e.$width>400&&c` padding: 40px; `} .cevoid-cta-text { font-size: calc(${e=>e.$width/10}px); line-height: 1.2em; span { color: var(--cevoid-call-to-action-text) !important; } ${e=>e.$width>400&&c` font-size: 32px; `} ${e=>e.$width<200&&c` font-size: 20px; `} } svg { height: auto; transition: 0.4s transform cubic-bezier(0.39, 0.575, 0.565, 1); width: calc(${e=>e.$width/4}px); color: var(--cevoid-call-to-action-text) !important; ${e=>e.$width>400&&c` width: 100px; `} } } &:hover { background: ${({background:e})=>e}; svg { transform: translateX(10px); } } } `;export{_ as C,I as a};