1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[61526],{61526:(e,t,o)=>{o.d(t,{$d:()=>h,C7:()=>n,aq:()=>c,kz:()=>y,mY:()=>m,ou:()=>f,qs:()=>b,x_:()=>p,zz:()=>s});var r=o(46292);async function a(e){var t,o,a,n,s;let l,d,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{l=await (0,r.t8)("/api/hotel/content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hotel_codes:[e],language:"ENG"}),signal:u.signal})}catch(e){if((null==e?void 0:e.name)==="AbortError")return{success:!1,error:"Aborted"};return{success:!1,error:null!=(a=null==e?void 0:e.message)?a:"Failed to fetch hotel content"}}if(401===l.status||403===l.status)return{success:!1,needsAuth:!0,error:"Sign in required to load hotel content."};try{d=await l.json()}catch(e){return{success:!1,error:"Could not parse Content API response."}}if(!l.ok||(null==d||null==(t=d.detail)?void 0:t.status)==="error"){let e=null!=(s=null==d||null==(n=d.detail)?void 0:n.message)?s:"Failed to fetch hotel content",t=e.toLowerCase();return t.includes("not authenticated")||t.includes("unauthorized")?{success:!1,needsAuth:!0,error:e}:{success:!1,error:e}}let c=null==d||null==(o=d.detail)?void 0:o.data;if(!c)return{success:!1,error:"No hotel data in response"};let p=c[e]||Object.values(c)[0];return p?{success:!0,data:i(p,e)}:{success:!1,error:"Hotel not found in response"}}function i(e,t){let o=[];e.room_images&&Object.entries(e.room_images).forEach(e=>{let[t,r]=e;o.push({imageTypeCode:"RMA",path:r.path,order:r.order||0,visualOrder:r.order||0,roomCode:t,roomType:t})});let r=[...(e.images||[]).map(e=>({imageTypeCode:e.imageTypeCode||"GEN",path:e.path,title:e.title||"",order:e.order||0,visualOrder:e.order||0})),...o],a=[];e.room_details&&Object.entries(e.room_details).forEach(e=>{let[t,o]=e;a.push({code:t,type:o.type||"",characterCode:o.character||"",description:o.description||"",minPax:o.minPax||1,maxPax:o.maxPax||2,maxAdults:o.maxAdults||2,maxChildren:o.maxChildren||0,minAdults:o.minAdults||1,roomFacilities:o.facilities||[],roomStays:[]})});let i=(e.interest_points||[]).map(e=>({code:e.name||"",facilityCode:parseInt(e.label)||0,facilityGroupCode:0,order:parseInt(e.label)||0,distance:parseInt(e.distance)||0})),n=(e.phones||[]).map(e=>({phoneNumber:e.number||"",phoneType:e.label||""}));return{hotelCode:t,name:e.name||"",description:e.description||"",location:{address:e.address||"",city:e.city||"",zipCode:e.postalCode||e.postal_code||"",coordinates:null},rooms:a,facilities:(e.facilities||[]).map(e=>{var t,o,r,a,i,n,s,l,d,u,c,p,m,h,g,f;return{code:null!=(r=null!=(o=null!=(t=e.facilityCode)?t:e.facility_code)?o:e.code)?r:0,groupCode:null!=(n=null!=(i=null!=(a=e.facilityGroupCode)?a:e.facility_group_code)?i:e.groupCode)?n:0,groupName:null!=(l=null!=(s=e.group)?s:e.groupName)?l:void 0,indLogic:null!=(u=null!=(d=e.indLogic)?d:e.ind_logic)&&u,indFee:null!=(m=null!=(p=null!=(c=e.indFee)?c:e.ind_fee)?p:e.paid_facility)&&m,distance:null!=(h=e.distance)?h:0,order:null!=(g=e.order)?g:0,number:null!=(f=e.number)?f:0,description:e.description||e.label||e.name||""}}),interestPoints:i,terminals:(e.nearest_terminals||[]).map((e,t)=>({terminalCode:e,distance:0,terminalType:e.includes("Airport")?"AIRPORT":"STATION"})),images:r,issues:Array.isArray(e.issues)?e.issues.map(e=>{var t,o,r,a,i,n,s,l,d,u,c;return{issueCode:null!=(o=null!=(t=e.issueCode)?t:e.issue_code)?o:"",issueType:null!=(a=null!=(r=e.issueType)?r:e.issue_type)?a:"",dateFrom:null!=(n=null!=(i=e.dateFrom)?i:e.date_from)?n:"",dateTo:null!=(l=null!=(s=e.dateTo)?s:e.date_to)?l:"",order:Number(null!=(d=e.order)?d:0),alternative:!!(null!=(c=null!=(u=e.alternative)?u:e.alternative_service)&&c)}}):[],phones:n,emails:e.email?[e.email]:[],web:e.website||e.web||"",category:{code:e.start_rating||"",group:"",simpleCode:e.start_rating||""},chain:"",accommodationType:"",boards:[],segments:[],s2c:"",ranking:e.ranking||0,lastUpdate:""}}function n(e,t){return(null==e?void 0:e.images)?e.images.filter(e=>e.roomCode===t||e.roomType===t).sort((e,t)=>(e.visualOrder||e.order)-(t.visualOrder||t.order)).map(e=>"".concat("https://photos.hotelbeds.com/giata/bigger/").concat(e.path)):[]}function s(e){return(null==e?void 0:e.images)?e.images.filter(e=>!e.roomCode&&!e.roomType).sort((e,t)=>
1(e.visualOrder||e.order)-(t.visualOrder||t.order)).map(e=>"".concat("https://photos.hotelbeds.com/giata/bigger/").concat(e.path)):[]}let l=[{test:/room|guest|suite|bedroom/i,cat:"rooms"},{test:/lobby|reception|lounge/i,cat:"lobby"},{test:/restaurant|bar|dining|breakfast|pub|cafe/i,cat:"dining"},{test:/pool|spa|gym|wellness|sauna|fitness/i,cat:"amenities"},{test:/general|exterior|outside|aerial|view|garden|terrace|beach/i,cat:"outside"}],d=[{test:/_hb_w_/i,cat:"rooms"},{test:/_hb_l_/i,cat:"lobby"},{test:/_hb_r_/i,cat:"dining"},{test:/_hb_a_/i,cat:"outside"},{test:/_hb_p_/i,cat:"amenities"}];function u(e){var t;let o=null!=(t=e.title)?t:"";for(let{test:e,cat:t}of l)if(e.test(o))return t;for(let{test:t,cat:o}of d)if(t.test(e.path))return o;return"other"}function c(e){var t;let o="https://photos.hotelbeds.com/giata/bigger/",r=(null!=(t=null==e?void 0:e.images)?t:[]).filter(e=>!e.roomCode&&!e.roomType).slice().sort((e,t)=>(e.visualOrder||e.order)-(t.visualOrder||t.order)),a={rooms:[],lobby:[],dining:[],outside:[],amenities:[],other:[]};for(let e of r)a[u(e)].push("".concat(o).concat(e.path));return{...a,all:r.map(e=>"".concat(o).concat(e.path))}}function p(e,t,o){if(!(null==e?void 0:e.images))return[];let r="https://photos.hotelbeds.com/giata/bigger/",a=e.images.filter(e=>e.roomCode===t||e.roomType===t);if(a.length>0)return a.slice().sort((e,t)=>(e.visualOrder||e.order)-(t.visualOrder||t.order)).map(e=>"".concat(r).concat(e.path));let i=e=>{let t=(e.title||"").toLowerCase();return/bathroom|wc|toilet|wash|shower/.test(t)},n=e.images.filter(e=>!e.roomCode).filter(e=>"rooms"===u({title:e.title,path:e.path})).slice().sort((e,t)=>{let o=i(e);return o!==i(t)?o?1:-1:(e.visualOrder||e.order)-(t.visualOrder||t.order)});if(0===n.length)return[];let s=n.findIndex(i),l=o%(s>0?s:n.length);return[...n.slice(l),...n.slice(0,l)].map(e=>"".concat(r).concat(e.path))}function m(e){return(null==e?void 0:e.facilities)?e.facilities.filter(e=>!0===e.indFee).filter(e=>!!e.description).map(e=>({code:e.code,groupCode:e.groupCode,description:e.description})):[]}function h(e){var t;if(!(null==e?void 0:e.phones)||0===e.phones.length)return null;let o=e.phones.find(e=>"PHONEBOOKING"===e.phoneType||"PHONEHOTEL"===e.phoneType);return o?o.phoneNumber:(null==(t=e.phones[0])?void 0:t.phoneNumber)||null}let g=new Map;async function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=g.get(e);if(o&&Date.now()-o.timestamp<864e5)return{success:!0,data:o.data};let r=await a(e,t);return r.success&&r.data&&g.set(e,{data:r.data,timestamp:Date.now()}),r}async function b(e){try{var t,o,a;let n=await (0,r.t8)("/api/hotel/content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({hotel_codes:e,language:"ENG"})}),s=await n.json();if(!n.ok||(null==(t=s.detail)?void 0:t.status)==="error")return console.error("Hotel Content API Error:",null==(a=s.detail)?void 0:a.message),{};let l=(null==(o=s.detail)?void 0:o.data)||{},d={};return Object.entries(l).forEach(e=>{let[t,o]=e,r=parseInt(t);d[r]=i(o,t),g.set(t,{data:d[r],timestamp:Date.now()})}),d}catch(e){return console.error("Batch Hotel Content fetch error:",e),{}}}function y(e,t){return t?{...e,contentData:t,roomImages:t.images.reduce((e,t)=>(t.roomCode&&(e[t.roomCode]||(e[t.roomCode]=[]),e[t.roomCode].push("https://photos.hotelbeds.com/giata/bigger/".concat(t.path))),e),{}),images:t.images.filter(e=>!e.roomCode).map(e=>({path:e.path,order:e.order})),facilities:t.facilities,interestPoints:t.interestPoints,terminals:t.terminals}:e}}}]);
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.