import{_ as X,a as Y,b as ee}from"./CrSM3cNE.js";import{_ as ae}from"./DyTDafb2.js";import{_ as te,e as l,c as _,d as r,t as I,T as D,U as R,f as d,h as oe,i as ne,u as se,j as le,m as v,l as ce,q as re,r as ie,s as ue,x as _e,y as de,z as me,C as U,A as pe,L as T,B as N,D as fe,b as ge,F as o,E as p,n as E,g as ve,G as he,H as L,S as j,I as H}from"./CSGWN0Ke.js";import{c as V}from"./Dci3BOLr.js";import{u as be}from"./CoNkNGrd.js";import{u as ke}from"./00Wz9xmJ.js";import"./RssLZfLx.js";import"./BITtZpNW.js";import"./FvgwuZVK.js";import"./DCT9NofI.js";const ye={props:{content:{type:Object,required:!0,default:()=>{}}},data(){return{}},computed:{documentIndex(){if("document_index"in this.content){let c=[...this.content.document_index],a;for(const n of c)n.child_of_parent?"child_items"in a&&(a.child_items.push(n),c=c.filter(h=>h!==n)):(a=n,a.child_items=[]);for(const n in c)return c}return!1}},mounted(){},methods:{}},xe={key:0,class:"anchor-menu bg-red-300 font-serif text-lg tracking-normal break-words mx-auto px-8 xl:px-6 py-12"},Ce={class:"mx-auto"},Se={class:"font-serif tracking-normal text-2xl md:text-3xl mb-4"},we={class:"block w-full border-b border-dashed border-grey-500 pl-4 pb-2"},Ie=["href"],Le={key:0},$e={class:"block w-full border-b border-dashed border-grey-500 pl-8 pb-2"},Be=["href"];function Pe(c,a,n,h,b,i){return i.documentIndex.length?(l(),_("div",xe,[r("div",Ce,[r("h2",Se,I(c.$prismic.asText(n.content.index_title)),1),r("nav",null,[r("ol",null,[(l(!0),_(D,null,R(i.documentIndex,m=>(l(),_("li",{key:m.anchor_link,class:"flex flex-col"},[r("span",we,[r("a",{href:"#"+m.anchor_link,class:"font-bold"},I(c.$prismic.asText(m.anchor_title)),9,Ie)]),m.child_items?(l(),_("ol",Le,[(l(!0),_(D,null,R(m.child_items,u=>(l(),_("li",{key:u.anchor_link,class:"block w-full pl-4"},[r("span",$e,[r("a",{href:"#"+u.anchor_link,class:"font-bold"},I(c.$prismic.asText(u.anchor_title)),9,Be)])]))),128))])):d("",!0)]))),128))])])])])):d("",!0)}const qe=te(ye,[["render",Pe]]),Ae={class:"document-content mx-auto relative px-8 pb-6 xl:px-6"},Ge=oe({__name:"index",async setup(c){var A;let a,n;const{$styling:h}=ne(),{client:b}=se(),i=le(),m=([a,n]=v(()=>he()),a=await a,n(),a),u=ce(),$=re(),B=ie(),z=be(),G=ue(),O=([a,n]=v(()=>ke()),a=await a,n(),a),k=_e(),Z=de(),P=me(),f=U(()=>i.params.controller),{BASE_URL:y}=pe().public,e=T(null);G.value=!1;const x=T(null),q=m.find(s=>s.uid===i.params.controller);if(q){const{data:s}=([a,n]=v(()=>L(f.value+u.value,()=>b.getByUID("club",f.value,{lang:u.value}),"$NryaLoQWBe")),a=await a,n(),a);if(s.value&&(e.value=s.value.data),(A=s.value)!=null&&A.alternate_languages&&(P.value.club=s.value.alternate_languages,P.value.club_page=[]),!e.value)throw N({statusCode:404,fatal:!0});Z.value=e.value.do_not_allow_campaign_takeover||!1,"custom_enquire_number"in e.value&&e.value.custom_enquire_number&&(z.value.enquireNowCustomNumber=e.value.custom_enquire_numbe),B.value=h(e.value.backgroundColour,"")||"";const{data:g}=([a,n]=v(()=>L(f+"sticky",()=>b.getByID(s.value.data.sticky_promo.id,{lang:u.value}),"$R7Uq7pnGcJ")),a=await a,n(),a);x.value=g;const t=s.value;("social_cards"in t.data&&t.data.social_cards&&t.data.social_cards[0]&&t.data.social_cards[0].social_card_image.facebook?Object.keys(t.data.social_cards[0].social_card_image.facebook).length===0:!0)?k.value={}:(t.data.sharing_url=y+i.path,t.data.sharing_locale=t.lang?t.lang.split("-")[0]+"_"+t.lang.split("-")[1].toUpperCase():"en_GB",k.value=t.data)}else{const{data:s,error:g}=([a,n]=v(()=>L(f.value,()=>b.getByUID("page",f.value,{lang:u.value}),"$KA1Z5rfzqE")),a=await a,n(),a);if(B.value="",!s.value||g.value)throw console.log(!s.value,g.value),N({statusCode:404,fatal:!0});e.value=s.value.data;const t=s.value;(t.data.social_cards&&t.data.social_cards[0]&&t.data.social_cards[0].social_card_image.facebook?Object.keys(t.data.social_cards[0].social_card_image.facebook).length===0:!0)?k.value={}:(t.data.sharing_url=y+i.path,t.data.sharing_locale=t.lang?t.lang.split("-")[0]+"_"+t.lang.split("-")[1].toUpperCase():"en_GB",k.value=t.data)}const C="body1"in e.value&&e.value.body1.length?e.value.body1:!1,S=e.value?Object.keys(e.value.image.largeorientland).length===0:!1,F=U(()=>"canonical"in e.value&&"uid"in e.value.canonical&&e.value.canonical.uid?y+fe(e.value.canonical):y+i.path);return ge({htmlAttrs:{lang:i.params.lang},title:e.value?e.value.meta_title||e.value.meta_title_default:"",meta:[{hid:"description",name:"description",content:e.value.meta_description||O.meta_description_default}],link:[{rel:"canonical",href:F}]}),(s,g)=>{const t=X,w=ae,J=qe,K=j,Q=j,W=Y,M=ee;return l(),_("div",null,[o(S)?(l(),p(t,{key:0,content:o(e)},null,8,["content"])):o(e)?(l(),p(w,{key:1,content:o(e)},null,8,["content"])):d("",!0),o(C)&&"document_index"in o(e)?(l(),p(J,{key:2,content:o(e)},null,8,["content"])):d("",!0),o(C)?(l(),_("div",{key:3,class:E({"bg-red-300":o(S)&&!o($)})},[r("div",Ae,[ve(K,{class:"",slices:o(C),components:o(H)(o(V))},null,8,["slices","components"])])],2)):d("",!0),r("div",{class:E({"bg-red-300":o(S)&&!o($)})},[o(e)&&o(e).body?(l(),p(Q,{key:0,slices:o(e).body,components:o(H)(o(V))},null,8,["slices","components"])):d("",!0)],2),o(x)?(l(),p(W,{key:4,stickydata:o(x)},null,8,["stickydata"])):d("",!0),o(q)?(l(),p(M,{key:5})):d("",!0)])}}});export{Ge as default};