import{l as y}from"./Cfh3kXIQ.js";import{u as h}from"./DKI1tQ5i.js";import{l as v,k as n,u as t,E as a,F as L,N as U,R as c,P as i,U as C}from"./DEIzhR9A.js";const g=["href","target"],x={key:2},B=v({__name:"InternalOrExternalLink",props:{ctaUrl:{type:Object,required:!0}},setup(u){const o=u,{isInEditorMode:d}=h(),p=e=>{if(d.value)return"div";switch(e){case"story":return"NuxtLink";case"url":return"a"}},l=e=>o.ctaUrl.linktype===e,k=n(()=>l("story")),r=n(()=>l("url")),s=n(()=>p(o.ctaUrl.linktype)),_=n(()=>o.ctaUrl.cached_url),m=n(()=>k?`/${o.ctaUrl.cached_url}`.replace("//","/"):void 0);return(e,N)=>{const f=y;return t(s)==="NuxtLink"?(a(),L(f,{key:0,to:t(m),target:t(r)?"_blank":void 0},{default:U(()=>[c(e.$slots,"default")]),_:3},8,["to","target"])):t(s)==="a"?(a(),i("a",{key:1,href:t(r)?t(_):void 0,target:t(r)?"_blank":void 0},[c(e.$slots,"default")],8,g)):t(s)==="div"?(a(),i("div",x,[c(e.$slots,"default")])):C("",!0)}}});export{B as _};