import{_ as L,R as M,a7 as z,af as F,W as k,o as i,c,k as e,p as $,d as p,l as f,a as s,b as C,q,t as S,s as H,y as U,f as V,r as A,b8 as Q,h as R,z as J}from"./CmnEfQIC.js";import X from"./WebImageWithGallery-Cwz9Cgoz.mjs";import"./WebImage-C1Tp4muM.mjs";import"./nuxt-link-BEs8tQ-R.mjs";import"./useImageUrl-1XbeiwSF.mjs";const K={class:"slide-overlay"},Y={key:2,class:"reduce-opacity"},Z={class:"slide-content"},ee={key:0,class:"overlay-text"},te={key:1},le={class:"overlay-button"},ae={class:"overlay-button-label"},ie={class:"previous-button"},se={class:"next-button"},ne=["innerHTML"],oe={class:"slide-count"},re={__name:"WebMediaGalleryNew",props:{images:{type:Array,required:!0},slide:{type:Number,default:-1},primaryImage:{type:Object,required:!0},nextGallery:{type:Object}},setup(t){const l=t,a=M(!1),o=z("page"),n=F().getStyles("secondary-container"),u=n.backgroundColor,b=n.borderColor,j=n.textColor,N=k(()=>l.images&&l.images.map(m=>(m.displayName?`<p><h3>${m.displayName}</h3></p>`:"")+(m.body?m.body.replace("<a>","</a>"):""))),w=k(()=>l.images.length),h=k(()=>l.slide-1>=0&&l.slide-1<w.value),g=k(()=>l.slide-1),_=k(()=>o.pageData.route.fullPath.split("?")[0]),x=k(()=>{const m=o.pageData.route.fullPath.split("?")[1],d={};return m&&m.split("&").map(v=>v.split("=")).forEach(([v,G])=>{d[v]=G}),d}),O=k(()=>a.value?"Next":"Start");function T(m){return m.split("?")[0]}function B(m){return Object.keys(m).map(d=>`${d}=${m[d]}`).join("&")}function r(){x.value.id=o.pageData.contentId,x.value.slide=1,window.location.href=`${_.value}?${B(x.value)}`}function y(){g.value<=w.value&&(g.value<w.value-1?(x.value.slide=l.slide+1,window.location=`${_.value}?${B(x.value)}`):a.value=!0)}function I(){a.value?a.value=!1:g.value>0&&(x.value.slide=l.slide-1,window.location=`${_.value}?${B(x.value)}`)}function D(){window.location=l.nextGallery.siteContext.path??nextGallery.objectId}function P(){window.location=_.value}return(m,d)=>{const v=V,G=X,W=A,E=Q;return i(),c("div",{class:U(["ebm-gallery","ebm-gallery--stacked"]),style:$({border:e(b)?`1px solid ${e(b)}`:""})},[e(g)>=0?(i(),c("div",{key:0,class:"close-slideshow",style:$({backgroundColor:e(u)}),onClick:d[0]||(d[0]=_e=>P())},[p(v,{icon:"mdi:close",width:22})],4)):f("",!0),s("div",K,[e(h)&&!e(a)?(i(),C(G,{key:0,"image-url":T(t.images[e(g)].src),credit:t.images[e(g)].credit,alt:t.images[e(g)].alt,images:[t.images[e(g)]],"image-shaping":"fill-blur","aspect-ratio":"full-teaser",class:"slide-image"},null,8,["image-url","credit","alt","images"])):(i(),C(W,{key:1,src:e(a)?T(t.nextGallery.primaryImage.src)+"?height=496&w=881&auto=format,compress&fit=fill&fill=blur":T(t.primaryImage.src)+"?height=496&w=881&auto=format,compress&fit=fill&fill=blur",style:{width:"100%"},class:"background","image-shaping":"fill-blur","aspect-ratio":"full-teaser"},null,8,["src"])),e(a)?(i(),c("div",Y)):f("",!0),s("div",Z,[e(a)?(i(),c("div",ee,[s("p",null,[d[2]||(d[2]=q("UP NEXT: ")),d[3]||(d[3]=s("br",null,null,-1)),q(S(t.nextGallery.name),1)])])):f("",!0),!e(h)||e(a)?(i(),c("div",te,[s("div",le,[p(E,{icon:"mdi:camera",size:"large",onOnClick:d[1]||(d[1]=()=>{e(a)?D():r()})},{default:H(()=>[p(v,{icon:"mdi:camera",width:30}),s("span",ae,S(e(O))+" Slideshow",1)]),_:1})])])):f("",!0),s("div",ie,[e(g)>0||e(a)?(i(),c("button",{key:0,onClick:I},[p(v,{icon:"mdi:chevron-left",width:50,class:"icon","icon-color":"#fff"})])):f("",!0)]),s("div",se,[e(h)&&!e(a)&&!(t.slide===e(w)&&!t.nextGallery)?(i(),c("button",{key:0,onClick:y},[p(v,{icon:"mdi:chevron-right",class:"icon",width:50,"icon-color":"#fff"})])):f("",!0)])])]),e(h)&&!e(a)?(i(),c("div",{key:1,class:"slide-text",style:$({backgroundColor:e(u),color:e(j)})},[s("div",{class:"content",innerHTML:e(N)[e(g)]},null,8,ne),s("div",oe," Slide "+S(t.slide)+" of "+S(t.images.length),1)],4)):f("",!0)],4)}}},de=L(re,[["__scopeId","data-v-0fb25460"]]),ce={class:U(["ebm-gallery","ebm-gallery--stacked"])},ue={class:"slide-overlay"},me={key:2,class:"reduce-opacity"},ge={class:"slide-content"},ye={key:0,class:"overlay-text"},fe={key:1},be={class:"overlay-button"},he={class:"overlay-button-label"},ve={class:"previous-button"},pe={class:"next-button"},xe={key:1,class:"slide-text"},we=["innerHTML"],ke={class:"slide-count"},$e={__name:"WebMediaGallery",props:{images:{type:Array,required:!0},slideTextBackground:{type:String},slide:{type:Number,default:-1},primaryImage:{type:Object,required:!0},nextGallery:{type:Object}},setup(t){const l=t,{path:a,query:o}=R(),n=M(!1),u=l.slide-1,b=l.slide-1>=0&&l.slide-1<l.images.length,j=z("page"),N=l.images&&l.images.map(r=>(r.displayName?`<p><h3>${r.displayName}</h3></p>`:"")+(r.body?r.body.replace("<a>","</a>"):"")),w=k(()=>n.value?"Next":"Start");function h(r){return r.split("?")[0]}function g(r){return Object.keys(r).map(y=>`${y}=${r[y]}`).join("&")}function _(){o.id=j.pageData.contentId,o.slide=1,window.location.href=`${a}?${g(o)}`}function x(){u<=l.images.length&&(u<l.images.length-1?(o.slide=l.slide+1,window.location=`${a}?${g(o)}`):n.value=!0)}function O(){n.value?n.value=!1:u>0&&(o.slide=l.slide-1,window.location=`${a}?${g(o)}`)}function T(){window.location=l.nextGallery.siteContext.path??nextGallery.objectId}function B(){window.location=a}return(r,y)=>{var d,v,G,W;const I=V,D=X,P=A,m=Q;return i(),c("div",ce,[s("div",{style:$({background:t.slideTextBackground})},[u>=0?(i(),c("div",{key:0,class:"close-slideshow",onClick:y[0]||(y[0]=E=>B())},[p(I,{icon:"mdi:close",width:22})])):f("",!0),s("div",ue,[e(b)&&!e(n)?(i(),C(D,{key:0,"image-url":h(t.images[u].src),credit:t.images[u].credit,alt:t.images[u].alt,images:[t.images[u]],"image-shaping":"fill-blur","aspect-ratio":"full-teaser",class:"slide-image"},null,8,["image-url","credit","alt","images"])):(i(),C(P,{key:1,src:e(n)?h(t.nextGallery.primaryImage.src)+"?height=496&w=881&auto=format,compress&fit=fill&fill=blur":h(t.primaryImage.src)+"?height=496&w=881&auto=format,compress&fit=fill&fill=blur",style:{width:"100%"},class:"background","image-shaping":"fill-blur","aspect-ratio":"full-teaser"},null,8,["src"])),e(n)?(i(),c("div",me)):f("",!0),s("div",ge,[e(n)?(i(),c("div",ye,[s("p",null,[y[2]||(y[2]=q("UP NEXT: ")),y[3]||(y[3]=s("br",null,null,-1)),q(S(t.nextGallery.name),1)])])):f("",!0),!e(b)||e(n)?(i(),c("div",fe,[s("div",be,[p(m,{icon:"mdi:camera",size:"large",onOnClick:y[1]||(y[1]=()=>{e(n)?T():_()})},{default:H(()=>[p(I,{icon:"mdi:camera",width:30}),s("span",he,S(e(w))+" Slideshow",1)]),_:1})])])):f("",!0),s("div",ve,[u>0||e(n)?(i(),c("button",{key:0,style:$({background:r.$ss.baseStyles.primaryColor}),onClick:O},[p(I,{icon:"mdi:chevron-left",width:50,class:"icon",style:$({color:(d=r.$ss)!=null&&d.useNewDesign?"white":(v=r.$ss.baseStyles)==null?void 0:v.bodyBackgroundColor})},null,8,["style"])],4)):f("",!0)]),s("div",pe,[e(b)&&!e(n)&&!(t.slide===t.images.length&&!t.nextGallery)?(i(),c("button",{key:0,style:$({background:r.$ss.baseStyles.primaryColor}),onClick:x},[p(I,{icon:"mdi:chevron-right",class:"icon",width:50,style:$({color:(G=r.$ss)!=null&&G.useNewDesign?"white":(W=r.$ss.baseStyles)==null?void 0:W.bodyBackgroundColor})},null,8,["style"])],4)):f("",!0)])])]),e(b)&&!e(n)?(i(),c("div",xe,[s("div",{class:"content",innerHTML:e(N)[u]},null,8,we),s("div",ke," Slide "+S(t.slide)+" of "+S(t.images.length),1)])):f("",!0)],4)])}}},Se=L($e,[["__scopeId","data-v-06c7ab4b"]]),Be={__name:"ImageGalleryBlock",props:{data:{type:Object,required:!0,validator(t){return["primaryImage","nextGallery"].every(l=>l in t)}},settings:{type:Object,required:!0,validator(t){return["slideTextBackground"].every(l=>l in t)}},page:{type:Object,required:!0,validator(t){}}},setup(t){const{query:l}=R(),a=t,o=J({});function n(){return a.data.images.edges.map(b=>b.node).filter(b=>b.id!==a.data.primaryImage.id)}function u(){return l.slide!==void 0&&l.id!==void 0&&Number(l.id)===Number(a.page.pageData.contentId)?Number(l.slide):-1}return o.imageGalleryImages=n(),o.imageGallerySlide=u(),(b,j)=>{var h;const N=de,w=Se;return(h=b.$ss)!=null&&h.useNewDesign?(i(),C(N,{key:0,images:e(o).imageGalleryImages,slide:e(o).imageGallerySlide,"primary-image":t.data.primaryImage,"next-gallery":t.data.nextGallery},null,8,["images","slide","primary-image","next-gallery"])):(i(),C(w,{key:1,images:e(o).imageGalleryImages,"slide-text-background":t.settings.slideTextBackground,slide:e(o).imageGallerySlide,"primary-image":t.data.primaryImage,"next-gallery":t.data.nextGallery},null,8,["images","slide-text-background","slide","primary-image","next-gallery"]))}}};export{Be as default};