1import{_ as M}from"./WDxDdiq3.js";import{_ as q}from"./DcPENwG3.js";import{_ as z}from"./DasefGay.js";import{_ as T,c as H,a as K}from"./DE-G7JZ8.js";import W from"./DgbhIlr0.js";import{_ as Y}from"./D9xA4yFa.js";import{d as Q}from"./DU8fV2eM.js";import{a as j}from"./CsXuFr7W.js";import{g as I}from"./DX6qNNtM.js";import{M as X,I as c,V as a,X as p,W as R,a0 as l,u as G,a9 as L,a8 as J,O,Q as B,a7 as C,a1 as g,U as N,d as A,m as v}from"./BfJgI-1u.js";import"./BJcvxiDA.js";import"./VssDMSj1.js";import"./DwqrCUKU.js";import"./BBYzzZx4.js";import"./Dp4LzAFS.js";import"./CHsTEjTD.js";import"./C1K6ie2k.js";import"./CqkleIqs.js";import"./DXnM3pWz.js";import"./DpcnnHRn.js";import"./C_NHbtVw.js";import"./BV6SQWi2.js";import"./BQ245IE2.js";const Z={__name:"DestinationOffers",props:{dest:Object,offers:Array,resorts:Array,regions:Array,pending:{type:Boolean,default:!1}},setup(y,{expose:i}){i();const s=y,e=A("text-3xl w-full lg:w-fit text-left lg:text-center"),k=new Intl.Collator("en",{sensitivity:"base"}),x=(o="",d="")=>k.compare(o,d),u=A({resort:"ALL",sort:"price-ascending",duration:"ALL"}),b=A(12),h=()=>{b.value+=10},w=A([{label:"Price lowâhigh",value:"price-ascending"},{label:"Price highâlow",value:"price-decending"}]),m=v(()=>{const o=new Set;(s.offers||[]).forEach(r=>{const t=I(r?.itinerary);Number.isFinite(t)&&t>0&&o.add(t)});const d=Array.from(o).sort((r,t)=>r-t);return[{label:"All",value:"ALL"},...d.map(r=>({label:`${r} nights`,value:String(r)}))]}),f=v(()=>{const o=Array.isArray(s.resorts)?s.resorts.map(t=>({label:(t?.name||"").replaceAll("amp;",""),value:t?.id,slug:t?.slug})).filter(t=>t.value!==void 0&&t.value!==null):[],d=new Map;o.forEach(t=>{const n=String(t.value);d.has(n)||d.set(n,{...t,value:n})});const r=Array.from(d.values()).sort((t,n)=>x(t.label,n.label));return[{label:"All",value:"ALL"},...r]}),_=o=>{const d=j(o?.dateBands),r=Number(d?.price);return Number.isFinite(r)?r:Number.POSITIVE_INFINITY},D=(o,d)=>{const r=[...o];switch(d){case"price-ascending":return r.sort((t,n)=>_(t)-_(n));case"price-decending":return r.sort((t,n)=>_(n)-_(t));case"rating-ascending":return r.sort((t,n)=>(Number(t?.rating)||0)-(Number(n?.rating)||0));case"rating-decending":return r.sort((t,n)=>(Number(n?.rating)||0)-(Number(t?.rating)||0));case"name-decending":return r.sort((t,n)=>x(n?.name||"",t?.name||""));case"name-ascending":return r.sort((t,n)=>x(t?.name||"",n?.name||""));default:return r}},V=v(()=>{const o=u.value.resort;return!o||o==="ALL"?null:String(o)}),U=v(()=>!!V.value),S=v(()=>{const o=Array.isArray(s.offers)?s.offers:[],d=u.value.duration&&u.value.duration!=="ALL"?Number(u.value.duration):null,r=d===null?o:o.filter(t=>{const n=I(t?.itinerary);return Number.isFinite(n)&&n===d});return D(r,u.value.sort)}),P=v(()=>{const o=V.value;return o?S.value.filter(d=>(Array.isArray(d?.itinerary)?d.itinerary:[]).some(t=>(Array.isArray(t?.destination)?t.destination:[]).some(E=>String(E?.id)===o))):S.value}),F={props:s,headingClasses:e,collator:k,compareStrings:x,filters:u,offset:b,handleOffset:h,sortByValues:w,durationOptions:m,resortSelect:f,priceForOffer:_,sortOffers:D,selectedResort:V,isFilteringByResort:U,unfilteredOffers:S,filteredOffers:P,ref:A,computed:v,get getCheapest(){return j},get getDuration(){return I}};return Object.defineProperty(F,"__isScriptSetup",{enumerable:!1,value:!0}),F}},$={class:"w-full"},ee={class:"w-full flex flex-col flex-wrap justify-between"},te={class:"w-full flex flex-row flex-wrap justify-between items-center border-y-1 py-4 mb-4 gap-x-8 gap-y-3 md:gap-y-8"},se={class:"w-[200px] max-w-[300px]"},re={class:"w-[200px] max-w-[300px]"},ne={key:0,class:"w-[200px] max-w-[300px]"},oe={key:0,class:"w-full grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 items-stretch"},ie={key:1,class:"w-full flex flex-wrap justify-between"},le={id:"totals",class:"w-full text-left md:text-right my-4"},ae={class:"text-md xl:text-lg"},de={key:0},fe={key:1},ce={class:"w-full grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 items-stretch"},ue={key:2,class:"w-full flex flex-wrap justify-between"},me={id:"totals",class:"w-full text-left md:text-right my-4"},_e={class:"text-md xl:text-lg"},ge={key:0},pe={key:1},ye={class:"w-full grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 items-stretch"};function he(y,i,s,e,k,x){const u=z,b=H,h=X("FormKit"),w=W,m=Y;return a(),c("div",$,[p(m,null,{default:R(()=>[p(u,{title:`${s.dest.linkTitles.offers} in ${s.dest.name}`,text:("destinationIntro"in y?y.destinationIntro:G(Q))(s.dest.linkTitles.offersIntro,"Our current offers in {name}",s.dest.name)},null,8,["title","text"]),l("div",ee,[l("div",te,[l("h3",{class:J(e.headingClasses)},[p(b,{name:"mi:filter"}),i[3]||(i[3]=O(" Filter your results "))],2),l("div",se,[p(h,{type:"select",name:"sortBy",label:"Sort by",options:e.sortByValues,modelValue:e.filters.sort,"onUpdate:modelValue":i[0]||(i[0]=f=>e.filters.sort=f)},null,8,["options","modelValue"])]),l("div",re,[p(h,{type:"select",name:"duration",label:"Duration",options:e.durationOptions,modelValue:e.filters.duration,"onUpdate:modelValue":i[1]||(i[1]=f=>e.filters.duration=f)},null,8,["options","modelValue"])]),e.resortSelect.length>0?(a(),c("div",ne,[p(h,{type:"select",name:"resort",label:"Resort",options:e.resortSelect,modelValue:e.filters.resort,"onUpdate:modelValue":i[2]||(i[2]=f=>e.filters.resort=f)},null,8,["options","modelValue"])])):L("",!0)]),s.pending?(a(),c("div",oe,[(a(),c(B,null,C(8,f=>l("div",{key:f,class:"rounded-2xl overflow-hidden bg-ph-light-blue border border-ph-blue animate-pulse"},i[4]||(i[4]=[l("div",{class:"w-full h-32 md:h-48 bg-ph-blue/20"},null,-1),l("div",{class:"p-3 md:p-4 flex flex-col gap-3"},[l("div",{class:"h-5 bg-ph-blue/20 rounded w-3/4"}),l("div",{class:"h-4 bg-ph-blue/20 rounded w-1/2"}),l("div",{class:"h-4 bg-ph-blue/20 rounded w-2/3 mt-2"}),l("div",{class:"h-8 bg-ph-blue/20 rounded-full w-32 mt-4"})],-1)]))),64))])):e.isFilteringByResort?(a(),c("div",ue,[l("div",me,[l("p",_e,[
1i[6]||(i[6]=O(" Viewing ")),e.filteredOffers.length>e.offset?(a(),c("span",ge,g(e.offset),1)):(a(),c("span",pe,g(e.filteredOffers.length),1)),O(" offers out of "+g(e.unfilteredOffers.length)+" in "+g(s.dest.name),1)])]),l("div",ye,[(a(!0),c(B,null,C(e.filteredOffers.slice(0,e.offset),(f,_)=>(a(),N(w,{key:f?.id??_,offer:f,dest:s.dest,class:"h-full"},null,8,["offer","dest"]))),128))]),e.filteredOffers.length>e.offset?(a(),c("div",{key:0,onClick:e.handleOffset,class:"w-full p-2 bg-blue-950 text-white hover:bg-yellow-400 text-center uppercase cursor-pointer rounded-lg my-8"}," Load More ")):L("",!0)])):(a(),c("div",ie,[l("div",le,[l("p",ae,[i[5]||(i[5]=O(" Viewing ")),e.unfilteredOffers.length>e.offset?(a(),c("span",de,g(e.offset),1)):(a(),c("span",fe,g(e.unfilteredOffers.length),1)),O(" offers out of "+g(e.unfilteredOffers.length)+" in "+g(s.dest.name),1)])]),l("div",ce,[(a(!0),c(B,null,C(e.unfilteredOffers.slice(0,e.offset),(f,_)=>(a(),N(w,{key:f?.id??_,offer:f,dest:s.dest,class:"h-full"},null,8,["offer","dest"]))),128))]),e.unfilteredOffers.length>e.offset?(a(),c("div",{key:0,onClick:e.handleOffset,class:"w-full p-2 bg-blue-950 text-white hover:bg-yellow-400 text-center uppercase cursor-pointer rounded-lg my-8"}," Load More ")):L("",!0)]))])]),_:1})])}const ve=T(Z,[["render",he],["__file","offers.vue"]]),xe={__name:"destinationOffers",props:{dest:Object,pages:Array,offers:Array,pending:Boolean},setup(y,{expose:i}){i();const e={props:y};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}},be={id:"destination-body",class:"bg-white relative z-40 pt-16"};function we(y,i,s,e,k,x){const u=M,b=q,h=ve,w=K;return a(),N(w,{name:"wrapper",isTrade:!1},{default:R(()=>[s.dest.media?(a(),N(u,{key:0,slides:s.dest.media.images,type:"CLOUDINARY",title:`Offers in ${s.dest.name} `,dest:s.dest},null,8,["slides","title","dest"])):L("",!0),l("div",be,[p(b,{pages:s.pages,dest:s.dest},null,8,["pages","dest"]),p(h,{dest:s.dest,offers:s.offers,pending:s.pending,resorts:s.dest.productLinks.regionsOrResorts.filter(m=>m.type=="resort"&&m.status==="live"),regions:s.dest.productLinks.regionsOrResorts.filter(m=>m.type=="region"&&m.status==="live")},null,8,["dest","offers","pending","resorts","regions"])])]),_:1})}const We=T(xe,[["render",we],["__file","destinationOffers.vue"]]);export{We as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.