1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[423],{24402:function(e,t,n){n.r(t),n.d(t,{default:function(){return U}});var o=n(86326),i=n(97598),r=n.n(i),a=n(42046),s=n(88983),c=n(59931),l=JSON.parse('{"error.results.notFound":"No hay resultados","error.results.serviceError":"En estos momentos el servicio no está disponible. Por favor, inténtalo de nuevo en unos minutos.","error.circuits.form.field.month.required":"Elige el mes de tu viaje","error.circuits.form.field.location.required":"Elige el destino de tu viaje","circuits.text.whereToTravel":"¿Dónde te gustarÃa viajar?","circuits.map.button.open":"Mostrar circuitos en el mapa","circuits.map.button.close":"Cerrar mapa","circuits.location.label":"PaÃs de destino","circuits.location.placeholder":"Escribe tu paÃs preferido","circuits.month.placeholder":"Elige un mes para viajar","circuits.month.allDates":"Todas las fechas","circuits.landing.checkbox.label":"Incluir circuitos para mayores de 60","circuits.senior.checkbox.label":"Solo circuitos para mayores de 60","circuits.searchbutton":"Buscar"}'),u=JSON.parse('{"error.results.notFound":"No hay resultados","error.results.serviceError":"En estos momentos el servicio no está disponible. Por favor, inténtalo de nuevo en unos minutos.","error.circuits.form.field.month.required":"Elige el mes de tu viaje","error.circuits.form.field.location.required":"Elige el destino de tu viaje","circuits.text.whereToTravel":"¿Dónde te gustarÃa viajar?","circuits.map.button.open":"Mostrar circuitos en el mapa","circuits.map.button.close":"Cerrar mapa","circuits.location.label":"PaÃs de destino","circuits.location.placeholder":"Escribe tu paÃs preferido","circuits.month.placeholder":"Elige un mes para viajar","circuits.month.allDates":"Todas las fechas","circuits.landing.checkbox.label":"Incluir circuitos para mayores de 60","circuits.senior.checkbox.label":"Solo circuitos para mayores de 60","circuits.searchbutton":"Procurar"}'),d=n(94496),p=n(46615),h=n(23674),m=n(44646),f=n(53584),g=n(82855),v=n(55823),y=n(32333),E=n(48855),C=function(e){return{isMapOpen:!1,destination:e,destinationStatus:y.h.DEFAULT,globalMessages:[]}},b=function(e,t){return(0,v.sH)(void 0,void 0,void 0,(function(){var n;return(0,v.YH)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e({type:"FetchDestinationsRequestAction"}),[4,t()];case 1:return n=o.sent(),e({type:"FetchDestinationsSuccessAction",payload:{locations:n}}),[3,3];case 2:return o.sent(),e({type:"FetchDestinationsErrorAction"}),e({type:"GlobalMessagesAddAction",payload:{messages:[{code:"error.results.serviceError",type:E.A.ERROR_TYPE}]}}),[3,3];case 3:return[2]}}
1))}))},A=function(e,t){switch(t.type){case"DestinationTextChangeAction":return function(e,t){var n;return(0,v.Cl)((0,v.Cl)({},e),{destinationText:t,destinationStatus:null!==(n=t.length)&&void 0!==n&&n?y.h.LOADING:e.destinationStatus})}(e,t.payload.text);case"FetchDestinationsRequestAction":return function(e){return(0,v.Cl)((0,v.Cl)({},e),{destinationErrorKey:""})}(e);case"FetchDestinationsSuccessAction":return function(e,t){return(0,v.Cl)((0,v.Cl)({},e),{locations:t,destinationStatus:t.length>0?y.h.DEFAULT:y.h.LOADING_ERROR,destinationErrorKey:t.length>0?"":"error.results.notFound"})}(e,t.payload.locations);case"FetchDestinationsErrorAction":return function(e){return(0,v.Cl)((0,v.Cl)({},e),{destinationStatus:y.h.DEFAULT})}(e);case"DestinationSelectedAction":return function(e,t){return(0,v.Cl)((0,v.Cl)({},e),{destination:t,destinationStatus:null!=t?y.h.VALID:y.h.DEFAULT,destinationErrorKey:""})}(e,t.payload.destination);case"DestinationBlurAction":return function(e){return(0,v.Cl)((0,v.Cl)({},e),{locations:[]})}(e);case"UpdateMapFlagAction":return function(e,t){var n=t.isMapOpen;return(0,v.Cl)((0,v.Cl)({},e),{isMapOpen:n})}(e,t.payload);case"GlobalMessagesAddAction":return function(e,t){var n=t.messages;return(0,v.Cl)((0,v.Cl)({},e),{globalMessages:n})}(e,t.payload);case"GlobalMessagesCloseAction":return function(e,t){var n,o=t.messages;return(0,v.Cl)((0,v.Cl)({},e),{globalMessages:null===(n=e.globalMessages)||void 0===n?void 0:n.filter((function(e){return null==o?void 0:o.includes(e)}))})}(e,t.payload);case"ValidateSearchAction":return function(e){var t={};return null==e.destination&&(t=(0,v.Cl)((0,v.Cl)({},t),{destinationStatus:y.h.INVALID,destinationErrorKey:"error.circuits.form.field.location.required"})),null!=e.destination?(0,v.Cl)((0,v.Cl)({},e),{search:{createdAt:(new Date).getMilliseconds(),destination:e.destination}}):(0,v.Cl)((0,v.Cl)((0,v.Cl)({},e),{search:void 0}),t)}(e);default:throw new Error("Unknown action")}},T=function(e){var t,n,i=(0,d.A)().formatMessage,r=(0,o.useReducer)(A,null===(t=e.lastSearch)||void 0===t?void 0:t.destination,C),a=r[0],s=r[1];(0,o.useEffect)((function(){null!=a.destinationText&&b(s,(function(){var t;return e.onSearchLocations(null!==(t=a.destinationText)&&void 0!==t?t:"")}))}),[a.destinationText]),(0,o.useEffect)((function(){null!=a.search&&e.onSearch(a.search)}),[a.search]);var c=function(e){void 0===e&&(e=""),s(function(e){return{type:"DestinationTextChangeAction",payload:{text:e}}}(e))};return o.createElement("form",{className:"moduleSearch"},o.createElement("fieldset",{className:"searchbox-tours"},o.createElement("div",{className:"input-line content-input-line"},o.createElement("p",null,i({id:"circuits.text.whereToTravel"})),o.createElement(p.A,{id:"circuitsDestination",placeholder:i({id:"circuits.location.placeholder"}),labelText:i({id:"circuits.location.label"}),required:!0,groupBy:null!==(n=e.groupResultsBy)&&void 0!==n?n:f.i.CONTINENT,maxOptions:g.Ig,status:a.destinationStatus,errorKey:a.destinationErrorKey,optionSelected:a.destination,options:a.locations,onChange:c,onRemove:c,onFocus:function(){null!=a.destinationText&&b(s,(function(){var t;return e.onSearchLocations(null!==(t=a.destinationText)&&void 0!==t?t:"")}))},onBlur:function(){s({type:"DestinationBlurAction"})},onLocationSelected:function(e){s(function(e){return{type:"DestinationSelectedAction",payload:{destination:e}}}(e))}}),o.createElement(h.A,{messages:a.globalMessages,onClose:function(e){s({type:"GlobalMessagesCloseAction",payload:{messages:e}})}}),null!=e.onToggleMap&&o.createElement("button",{className:"show-maps cta-light",type:"button",onClick:function(){if(null!=e.onToggleMap){var t=!a.isMapOpen;e.onToggleMap(t),s({type:"UpdateMapFlagAction",payload:{isMapOpen:t}})}}},a.isMapOpen?i({id:"circuits.map.button.close"}):i({id:"circuits.map.button.open"})),o.createElement(m.A,{buttonText:i({id:"circuits.searchbutton"}),onClick:function(){s({type:"ValidateSearchAction"})}}))))},S=s.t,D=function(e){var t,n=e.locale;return o.createElement(c.A,{locale:n,messages:(t=n,"pt"===t?u:l),onError:function(e){0},formats:{}},o.createElement(S,null,o.createElement(T,{groupResultsBy:e.groupResultsBy,lastSearch:e.lastSearch,onToggleMap:e.onToggleMap,onSearchLocations:e.onSearchLocations,onSearch:e.onSearch})))},M=n(90263);const{S4:N}=M;var x=e=>N.assignURL(`/circuitos/resultados/${e.destination.countryCode}`);const{S4:O,hN:L}=M;let F=null;const R=e=>{const t=e=>({type:f.i.CONTINENT,code:e.code,name:e.description,disabled:!0}),n=t=>{const n=t.filter((t=>t.type===f.i.COUNTRY&&(""===e||L.unaccent(t.name.toLocaleLowerCase()).indexOf(L.unaccent(e.toLocaleLowerCase()))>-1)));return[...n,...t.filter((e=>e.type===f.i.CONTINENT&&n.findIndex((t=>t.superArea===e.code))>-1))]};return null!=F?Promise.resolve(n(F)):O.get("/estaticos/circuitos/json/veci-ui-home-layer
1-circuits-destinations_es_ES.json").then((e=>(F=e?.destinations.reduce(((e,n)=>[...e,t(n),...n.countries?.map((e=>((e,t)=>({type:f.i.COUNTRY,code:t.code,name:t.description,superArea:e.code,countryCode:t.isoCode,productTags:t.productTags,image:{url:t.image.url,description:t.image.description},lat:t.geo.lat,lon:t.geo.lng}))(n,e)))]),[]),n(F)))).catch((e=>(console.warn("No hay datos disponibles",e.message),[])))},w=e=>{x(e)};var I=function(){return o.createElement(D,{onSearchLocations:R,onSearch:w,locale:a.vV})},j=n(45331);const k=e=>o.createElement(j.A,{display:e.display},I(e.preloadData));k.propTypes={display:r().bool,preloadData:r().oneOfType([r().object,r().bool])};var U=k}}]);
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.