PageSourceSearch

https://www.premierholidays.co.uk/_nuxt/bmA7BkAI.js

js premierholidays.co.uk collected 2026-09-24 23:37:35 UTC 10,019 bytes, 1 lines download raw bytes

1import{_ as X}from"./CQE9BxbY.js";import{w as H,f as N}from"./DK7X3seW.js";import{_ as Q,e as M}from"./lTr7RkzU.js";import{M as G,I as D,V as x,a0 as w,Q as J,a7 as Y,a9 as q,X as p,a1 as Z,d as V,m as B,q as O,W as P}from"./BfJgI-1u.js";import"./Bhj8_NNP.js";import"./DKF9JScY.js";import"./Dp4LzAFS.js";import"./BIg6aLt4.js";import"./BVY1fCGU.js";import"./Jx4T7nIq.js";import"./BQ2uhhR1.js";import"./C1K6ie2k.js";import"./CqkleIqs.js";import"./vhhgy5la.js";import"./BShZcGEn.js";import"./Bak2IoqS.js";import"./BJcvxiDA.js";const $={__name:"FormsHolidayQuoteFaraway",props:{farawayDetails:Object},emits:["pageData"],setup(F,{expose:l,emit:o}){l();const s=o,c=F,{data:k,pending:y}=M("/api/forms/country-options",{default:()=>[]},"$ozCp0AfmBX"),f=V([]),r=V([]),t=["Please select","The cheapest","Any 2 star","Any 3 star","Any 4 star","Any 5 star","Other"],d=V([]),h=V([]),v=[],E=a=>d.value[a]||t,S=a=>{const i=c.farawayDetails.destinations[a],e=f.value[a];return!!i?.country&&!r.value[a]&&Array.isArray(e)&&e.length===0},K=a=>S(a)?[{label:"No resorts – hotels shown here",value:""}]:f.value[a]||[{label:"Please select",value:""}],_=async a=>{const i=c.farawayDetails.destinations[a];if(!i)return;const e=v[a]=(v[a]||0)+1,n=f.value[a]||[],m=i.resort;let u=null;if(m){const b=n.find(g=>g?.value===m)?.id;u=b?{countryId:i.country,resortId:b}:i.country?{countryId:i.country}:null}else i.country&&n.length===0&&(u={countryId:i.country});if(!u){h.value[a]=!1,d.value[a]=t;return}h.value[a]=!0;try{const b=await N(u);if(v[a]!==e)return;d.value[a]=H(t,b)}catch(b){if(v[a]!==e)return;console.error("Error loading hotel options:",b),d.value[a]=t}finally{v[a]===e&&(h.value[a]=!1)}},C=a=>a==null?"":typeof a=="string"||typeof a=="number"?String(a).trim().toLowerCase():"",U=a=>{const i=new Set,e=n=>{const m=C(n);m&&i.add(m)};return e(a?.id),e(a?._id),e(a?.value),e(a?.slug),e(a?.slug?.current),e(a?.code),e(a?.isoCode),e(a?.holidayType),e(a?.name),e(a?.title),i},L=["north_america","uk_&_channel_islands"],T=B(()=>{const i=(k.value??[]).filter(e=>!L.includes(e?.continent)).map(e=>{const n=U(e),m=e?.id??e?._id??e?.value??e?.slug?.current??e?.slug??e?.name??(n.size>0?Array.from(n)[0]:""),u={label:e?.name??"Unknown country",value:m?String(m):"",id:m?String(m):"",keys:Array.from(n)};for(const b of[u.value,u.label]){const g=C(b);g&&!u.keys.includes(g)&&u.keys.push(g)}return u}).filter(e=>e.value).sort((e,n)=>e.label.localeCompare(n.label));return[{label:"Please select",value:"",keys:[]},...i]}),A=async(a,i)=>{const e=[{label:"Please select",value:""}];if(!a)return e;const n=await $fetch(`/api/forms/get-resorts?countryId=${a}`);return(Array.isArray(n)?n:[]).map(u=>({label:u?.name??"",value:u?.name??"",id:u?.id??""}))},W=()=>{c.farawayDetails.destinations.push({country:"",hotel:"",resort:"",duration:5}),f.value.push([{label:"Please select",value:""}]),r.value.push(!1),d.value.push(t),h.value.push(!1)},j=()=>{c.farawayDetails.destinations.pop(),f.value.pop(),r.value.pop(),d.value.pop(),h.value.pop()};O(()=>c.farawayDetails.destinations.map(a=>a.country),async(a,i=[])=>{for(let e=0;e<a.length;e++){const n=a[e],m=i[e];if(n!==m&&c.farawayDetails.destinations[e]){if(c.farawayDetails.destinations[e].resort="",c.farawayDetails.destinations[e].hotel="",n){r.value[e]=!0;try{const u=await A(n,e);f.value[e]=u}catch(u){console.error("Error loading resort options:",u),f.value[e]=[{label:"Please select",value:""}]}finally{r.value[e]=!1}}else f.value[e]=[{label:"Please select",value:""}],r.value[e]=!1;await _(e)}}},{deep:!0}),O(()=>c.farawayDetails.destinations.map(a=>a.resort),(a,i=[])=>{for(let e=0;e<a.length;e++){if(a[e]===i[e])continue;const n=c.farawayDetails.destinations[e];n&&(n.hotel="",_(e))}},{deep:!0});const z=["Please select",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],R=B(()=>!0),I={emit:s,props:c,countries:k,countriesPending:y,resortOptions:f,resortLoading:r,baseHotelOptions:t,hotelOptions:d,hotelLoading:h,hotelRequestSeq:v,hotelOptionsFor:E,resortDisabledFor:S,resortOptionsFor:K,loadHotelsForIndex:_,normaliseKey:C,collectCountryKeysFromDoc:U,EXCLUDED_CONTINENTS:L,countryList:T,getResortOptions:A,addCentre:W,removeCentre:j,durationOptions:z,validation:R,handleSubmit:()=>{s("pageData",4)},handleBack:()=>{s("pageData",2)},watch:O,get fetchHotelNames(){return N},get withHotelOptions(){return H}};return Object.defineProperty(I,"__isScriptSetup",{enumerable:!1,value:!0}),I}},ee={class:"w-full"},ae={id:"centres"},le={class:"flex flex-wrap gap-4 my-4"},te={class:"w-full",id:"otherDetails"},se={id:"navigation",class:"w-full flex justify-between my-4 border-t border-black pt-4 mt-4"},oe=["disabled"];function ne(F,l,o,s,c,k){const y=G("FormKit"),f=X;return x(),D("div",ee,[l[11]||(l[11]=w("h3",{class:"text-2xl xl:text-3xl mb-4"},"Holiday Details",-1)),l[12]||(l[12]=w("p",{class:"ph-form-label my-2"}," We can take you to up to three different centres! If your itinerary includes more than 3 centres, please use the tailor-made quote type on the previous page. ",-1)),w("div",ae,[(x(!0),D(J,null,Y(o.farawayDetail
1s.destinations,(r,t)=>(x(),D("div",{key:t,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4"},[p(f,{loading:s.countriesPending},{default:P(()=>[p(y,{type:"select",label:"Country",name:`country${t+1}`,options:s.countryList,disabled:s.countriesPending,modelValue:o.farawayDetails.destinations[t].country,"onUpdate:modelValue":d=>o.farawayDetails.destinations[t].country=d,"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["name","options","disabled","modelValue","onUpdate:modelValue"])]),_:2},1032,["loading"]),p(f,{loading:s.resortLoading[t]},{default:P(()=>[p(y,{type:"select",label:"Resort",name:`resort${t+1}`,options:s.resortOptionsFor(t),disabled:s.resortLoading[t]||s.resortDisabledFor(t),modelValue:o.farawayDetails.destinations[t].resort,"onUpdate:modelValue":d=>o.farawayDetails.destinations[t].resort=d,"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["name","options","disabled","modelValue","onUpdate:modelValue"])]),_:2},1032,["loading"]),p(f,{loading:s.hotelLoading[t]},{default:P(()=>[p(y,{type:"select",label:"Hotel",name:`hotel${t+1}`,options:s.hotelOptionsFor(t),disabled:s.hotelLoading[t],modelValue:o.farawayDetails.destinations[t].hotel,"onUpdate:modelValue":d=>o.farawayDetails.destinations[t].hotel=d,"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["name","options","disabled","modelValue","onUpdate:modelValue"])]),_:2},1032,["loading"]),p(y,{type:"select",label:"Duration",name:`duration${t+1}`,options:s.durationOptions,modelValue:o.farawayDetails.destinations[t].duration,"onUpdate:modelValue":d=>o.farawayDetails.destinations[t].duration=d,"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["name","modelValue","onUpdate:modelValue"])]))),128)),w("div",le,[o.farawayDetails.destinations.length<6?(x(),D("button",{key:0,type:"button",class:"bg-ph-blue rounded-full px-4 py-2 text-white text-sm cursor-pointer hover:scale-[98%]",onClick:l[0]||(l[0]=r=>s.addCentre())}," Add new centre ")):q("",!0),o.farawayDetails.destinations.length>1?(x(),D("button",{key:1,type:"button",class:"bg-ph-blue rounded-full px-4 py-2 text-white text-sm cursor-pointer hover:scale-[98%]",onClick:s.removeCentre}," Remove last centre ")):q("",!0)])]),w("div",te,[l[7]||(l[7]=w("p",{class:"ph-form-label my-2"},` If you selected "other", please tell us what you're looking for: `,-1)),p(y,{type:"textarea",name:"details",label:"",modelValue:o.farawayDetails.ifOtherHotel,"onUpdate:modelValue":l[1]||(l[1]=r=>o.farawayDetails.ifOtherHotel=r),"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["modelValue"]),l[8]||(l[8]=w("p",{class:"ph-form-label my-2"}," Would you like to add an excursion? Please tell us what you want. ",-1)),p(y,{type:"textarea",name:"details",label:"",modelValue:o.farawayDetails.excursions,"onUpdate:modelValue":l[2]||(l[2]=r=>o.farawayDetails.excursions=r),"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["modelValue"]),l[9]||(l[9]=w("p",{class:"ph-form-label my-2"}," Please indicate any additional requirements such as car hire, tours and excursions or any questions you may have. Please also state if you have any special needs. ",-1)),p(y,{type:"textarea",name:"details",label:"",modelValue:o.farawayDetails.additionalDetails,"onUpdate:modelValue":l[3]||(l[3]=r=>o.farawayDetails.additionalDetails=r),"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["modelValue"]),l[10]||(l[10]=w("p",{class:"ph-form-label my-2"}," Preferred holiday spend. If you have a set budget to work with, or already have a quote elsewhere, please provide details below. We will always endeavour to match any like-for-like quotation, but will need the exact details including airline, board basis and room types. ",-1)),p(y,{type:"textarea",
1name:"details",label:"",modelValue:o.farawayDetails.budget,"onUpdate:modelValue":l[4]||(l[4]=r=>o.farawayDetails.budget=r),"outer-class":"w-full max-w-full","input-class":"w-full max-w-full","wrapper-class":"w-full max-w-full","inner-class":"w-full max-w-full"},null,8,["modelValue"])]),w("div",se,[w("button",{class:"prev",onClick:l[5]||(l[5]=r=>s.handleBack())}," Back "),w("button",{class:"next",disabled:!s.validation,onClick:l[6]||(l[6]=r=>s.validation&&s.handleSubmit())},Z(s.validation?"Next":"Please fill out all remaining fields"),9,oe)])])}const Ce=Q($,[["render",ne],["__file","faraway.vue"]]);export{Ce 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.