import{u as F,r as o,j as e,L as z}from"./vendor-BXQAQzXu.js";import{S as H,N as J,M as q,a as K}from"./ui-CbCB892d.js";import{S as Q,a as W}from"./svg-DmTSu4C7.js";import{t as M}from"./transformUtm-9lP4nPuV.js";import{O as X}from"./OptimizedImage-BbLjun1q.js";const ae=({listOffer:D,slideSpace:E=32,offsetNumber:Y=290,width:I=352,slidePerView:R=0,hasMore:P=!0,assetUrl:V,popUpData:Z,onDetailsClick:a})=>{const{utm:c}=F();o.useState(null);const[d,u]=o.useState(!1),l=D,C=o.useCallback(t=>{let s="";const r=typeof window<"u"&&sessionStorage.getItem("utmData");return r?s=M(t,JSON.parse(r)):s=M(t,c),s},[c]),n=o.useRef(null);let i=R;return i<=0&&(i="auto"),e.jsxs("div",{className:`w-full max-w-1120 mx-auto !overflow-visible px-6 md:px-0`,children:[e.jsx(H,{modules:[J,q],spaceBetween:E,slidesPerView:i,onBeforeInit:t=>{n.current=t},freeMode:!0,mousewheel:{forceToAxis:!0,releaseOnEdges:!0,sensitivity:1},className:"!overflow-visible",children:l.map((t,s)=>{var f,p,h,x,b,v,N,g,j,w,y,S,O,k,L,B,U,$;const r=(f=t.attributes)!=null&&f.offerSlug?t.attributes.offerSlug:"#",G=((b=(x=(h=(p=t.attributes)==null?void 0:p.offerFeaturedImage)==null?void 0:h.data)==null?void 0:x.attributes)==null?void 0:b.url)!=null?V+t.attributes.offerFeaturedImage.data.attributes.url:"https://placehold.co/600x400.png",T=(j=(g=(N=(v=t.attributes)==null?void 0:v.property)==null?void 0:N.data)==null?void 0:g.attributes)!=null&&j.propertyDisplayName?(O=(S=(y=(w=t.attributes)==null?void 0:w.property)==null?void 0:y.data)==null?void 0:S.attributes)==null?void 0:O.propertyDisplayName:"Property",m=(k=t.attributes)!=null&&k.offerName?(L=t.attributes)==null?void 0:L.offerName:"Offer Name",A=(B=t.attributes)!=null&&B.offerShortDesc?(U=t.attributes)==null?void 0:U.offerShortDesc:"Offer Body";return e.jsx(K,{style:{width:`${I}px`},className:"slider-primary",children:e.jsxs("div",{className:"shadow-drop-shadow-base",children:[e.jsx(X,{src:G,alt:m||"Offer image",className:"slider-img",onClick:()=>a(r),priority:s===0}),e.jsxs("div",{className:"slider-content",children:[e.jsxs("div",{className:"slider-details",children:[e.jsx("span",{className:"golden-technicaltext",children:T}),e.jsx("p",{onClick:()=>a(r),className:`heading4-subheadline-rev font-medium line-clamp-1 ${a?"cursor-pointer":""}`,children:m}),e.jsx("p",{className:"bodytext2-leadingtrim line-clamp-3 min-h-[40px] pt-[1px]",children:A})]}),e.jsxs("div",{className:"slider-button",children:[e.jsx("a",{href:C(`${($=t.attributes)==null?void 0:$.ctaUrl}`),className:"button-primary",children:"Book Now"}),e.jsxs("button",{onClick:()=>a(r),className:"button-popup",onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:["Details",e.jsx("span",{className:`${d?"hidden":""}`,children:e.jsx(Q,{})}),e.jsx("span",{className:`${d?"":"hidden"}`,children:e.jsx(W,{})})]})]})]})]})},s)})}),e.jsxs("div",{className:`${l.length>3?"justify-between":"justify-center"} slider-navigation`,children:[l.length>3&&e.jsxs("div",{className:`hidden md:flex gap-9`,children:[e.jsx("button",{onClick:()=>{var t;return(t=n.current)==null?void 0:t.slidePrev()},children:e.jsx("img",{src:"/icon/chevron-prev.svg",width:"40",height:"40",alt:"Previous offer"})}),e.jsx("button",{onClick:()=>{var t;return(t=n.current)==null?void 0:t.slideNext()},children:e.jsx("img",{src:"/icon/chevron-next.svg",width:"40",height:"40",alt:"Next offer"})})]}),e.jsx("div",{className:`w-full max-w-[312px] mx-auto md:w-auto md:mx-0`,children:e.jsx(z,{to:"/special-offers",prefetch:"intent",className:`${P?"block":"hidden"} w-full px-6 py-2 text-grayscale-2 border border-grayscale-2 text-[16px] font-bold hover:border-midnightBlue-base hover:text-midnightBlue-base`,children:"See All Exclusive Surprises"})})]})]})};export{ae as S};