import{_ as g,aN as k,ar as y,p,a1 as v,a7 as q,aG as C,D as _,Y as w,M as S,P as L,aq as E,e as r,c as a,a5 as l,E as m,w as f,n as o,d as b,O as A,W as M,Z as P,a4 as O}from"./CSGWN0Ke.js";import{u as N,b as F}from"./CoNkNGrd.js";const R={setup(){const e=k(),t=y(),s=p(),u=v(),h=N(),i=F(),d=M(),c=q(),n=C();return{clubListAction:e,iframeModal:t,activeClub:s,enquireNowVisible:u,enquireData:h,enquireOverrides:i,gtm:d,clubExplorer:c,hubspotFormModal:n}},props:{document:{type:Object,required:!0},campaignoverride:{type:String,required:!1,default:""},channeloverride:{type:String,required:!1,default:""},gaeventcategory:{type:String,required:!1,default:""},gaeventaction:{type:String,required:!1,default:""},gaeventlabel:{type:String,required:!1,default:""},slice_type:{type:String,required:!1,default:""},overriding_class:{type:String,required:!1,default:""}},data(){return{routeType:{enquirebooktour:"bookTour",enquirerequestcall:"requestCall",enquirecallus:"callUs",enquirenow:""}}},computed:{shortenLangUrl(){if(this.document.url){if("url"in this.document&&this.document.url){const e={...this.document};return e.url=e.url.replace(/^(\/[a-z]{2}-[a-z]{2}\/+)/g,`/${(this._.provides[w]||this.$route).params.lang}/`),e}}else if(this.document.type==="journal_post"||this.document.type==="ondemand_post"){const e={...this.document};return e.url=_(this.document),e}return!1},isLinkClubPage(){return"type"in this.document&&this.document.type==="club_page"},isActiveClubSet(){return!!this.activeClub},isSafetyLink(){if("type"in this.document&&this.document.type==="safety_page")if(this.isActiveClubSet&&this.activeClub.data.country){const e={...this.document};return e.uid=this.activeClub.data.country.toLowerCase(),e}else return{};return!1},clubChildPageLink(){if(this.isActiveClubSet&&this.isLinkClubPage){const e={...this.document};return e.location=this.activeClub.uid,e}return!1},iframeLinkForModal(){return!!(this.document.link_type==="Web"&&this.document.url&&this.document.url.includes("mywellness")&&this.document.url.toLowerCase().includes("classtimetable")||"url"in this.document&&this.document.url&&this.document.url.includes("widgets.mywellness.com"))},enquireNowRoute(){if(this.document.link_type==="Web"&&this.document.url.indexOf(/^[enquire][^.]*$/g)){const e=/[^/]*$/.exec(this.document.url)[0];return e in this.routeType?this.routeType[e]:!1}return!1},hubspotForm(){return this.document.link_type==="Web"&&this.document.url.includes("hubspotform")?/[^&]*$/.exec(this.document.url)[0]||"":!1},spaHotelSelector(){if(this.document.link_type==="Web"&&/hotelselector|spaselector/.test(this.document.url)){const e=/[^/]*$/.exec(this.document.url)[0],t={booking:!1,type:""};return e.includes("spaselector")?t.type="spa":e.includes("hotelselector")&&(t.type="hotel"),e.includes("booking")&&(t.booking=!0),t}return!1}},methods:{EnquireRoute(e,t){this.enquireNowVisible=!0,this.enquireData.enquiryType=e,this.enquireOverrides={channelOverride:this.channeloverride,campaignOverride:this.campaignoverride};const s=this.$mapElementPercentage(t.target);this.isActiveClubSet&&(this.enquireData.selectedClub=S(this.activeClub.data.internal_club_code),e!==""&&(this.enquireData.enquiry[e].step=1)),this.$pushGTMEvent("elementClick",{type:"button",name:"Enquire"+(e?" - "+e:""),destination:"NA",position:s,origin:this.slice_type,pageUrl:window.location.href}),this.gaeventcategory!==""&&this.gaeventaction!==""&&(gtm==null||gtm.push({event:"custom_event",category:this.gaeventcategory,action:this.gaeventaction,label:this.gaeventlabel}),this.gaeventcategory==="Sticky Promo"&&(gtm==null||gtm.push({event:"stickyPromo",sticky_promo_action:"Click"})))}}},B={class:"inline-block"},D={class:"inline-block"};function T(e,t,s,u,h,i){const d=P,c=O;return L((r(),a("div",{onClick:t[6]||(t[6]=n=>u.clubExplorer=!1)},[s.document.link_type==="Any"?l(e.$slots,"default",{key:0}):i.isLinkClubPage&&!i.isActiveClubSet?(r(),m(d,{key:1,btnstyle:"alternative",class:o(["link-style tracking-wider uppercase cursor-pointer focus:outline-gbl",s.overriding_class]),onClick:t[0]||(t[0]=n=>u.clubListAction={key:s.document.slug,booking:!1})},{default:f(()=>[l(e.$slots,"default")]),_:3},8,["class"])):i.iframeLinkForModal?(r(),a("button",{key:2,class:o(["link-style tracking-wider uppercase focus:outline-gbl",s.overriding_class]),onClick:t[1]||(t[1]=n=>u.iframeModal=s.document.url)},[l(e.$slots,"default")],2)):i.spaHotelSelector?(r(),a("button",{key:3,btnstyle:"alternative",class:o(["link-style tracking-wider uppercase cursor-pointer focus:outline-gbl",s.overriding_class]),onClick:t[2]||(t[2]=n=>u.clubListAction={key:i.spaHotelSelector.type,booking:i.spaHotelSelector.booking})},[l(e.$slots,"default")],2)):typeof i.enquireNowRoute=="string"?(r(),a("button",{key:4,class:o(["link-style tracking-wider uppercase focus:outline-gbl",s.overriding_class]),onClick:t[3]||(t[3]=n=>i.EnquireRoute(i.enquireNowRoute,n))},[b("span",B,[l(e.$slots,"default")])],2)):i.hubspotForm?(r(),a("button",{key:5,class:o(["link-style tracking-wider uppercase focus:outline-gbl",s.overriding_class]),onClick:t[4]||(t[4]=n=>u.hubspotFormModal=i.hubspotForm)},[b("span",D,[l(e.$slots,"default")])],2)):i.isSafetyLink?(r(),m(c,{key:6,field:i.isSafetyLink,onClick:t[5]||(t[5]=A(n=>e.$nuxt.$emit("launchRegionSelector",!0),["prevent"]))},{default:f(()=>[l(e.$slots,"default")]),_:3},8,["field"])):(r(),m(c,{key:7,class:o({"broken-link":s.document.isBroken}+s.overriding_class),field:i.clubChildPageLink||i.shortenLangUrl||s.document},{default:f(()=>[l(e.$slots,"default")]),_:3},8,["class","field"]))],512)),[[E,!s.document.isBroken]])}const U=g(R,[["render",T]]);export{U as _};