PageSourceSearch

https://www.kupi.com/seo-landings/_next/static/chunks/0d3s0-x8cu-ny.js

js kupi.com collected 2026-10-01 12:07:26 UTC 51,874 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,363983,e=>{"use strict";var t=e.i(204241),r=e.i(774177),a=e.i(351039),i=e.i(423246),o=e.i(4340),s=e.i(43999),n=e.i(326875),l=e.i(178999);let c=(0,t.createEvent)({sid:"arkijb6d",name:"setActiveArrivalSuggestContext"}),u=(0,t.createStore)(null,{sid:"1zhbgxj",name:"$activeArrivalSuggestContext"});(0,t.sample)({and:[{clock:c,target:u}],or:{sid:"46nmuc41"}});let{setAnalyticsReady:d,routeError:p}=(0,l.createSuggestErrorDelivery)(e=>{(0,s.getSearchFormAnalyticsObj)().arrivalSuggestError(e)}),g=({context:e,error:t,suggestGroup:r})=>({trip_index:e?.trip_index??null,is_complex_trip:e?.is_complex_trip??!1,...(0,n.normalizeSuggestErrorFields)(t),suggest_group:r,url:(0,n.getSuggestPageUrl)()}),f=(e,t)=>null!==e&&!e.is_live_query&&!(0,a.isAbortError)(t);(0,t.sample)({and:[{clock:o.fetchSearchHistoryFx.fail,source:u,filter:(e,{params:t,error:r})=>f(e,r)&&"arrival"===t.field,fn:(e,{error:t})=>g({context:e,error:t,suggestGroup:"history"}),target:p}],or:{sid:"3vqawr49"}}),(0,t.sample)({and:[{clock:r.fetchAccountPreferencesFx.fail,source:u,filter:(e,{params:t,error:r})=>f(e,r)&&"arrival"===t.field,fn:(e,{error:t})=>g({context:e,error:t,suggestGroup:"preferences"}),target:p}],or:{sid:"7p5gwuym"}});let m=(0,t.sample)({and:[{clock:i.fetchPopularDestinationsFx.fail,source:u,filter:(e,{error:t})=>f(e,t),fn:(e,{error:t,params:r})=>({context:e,error:t,withoutCountriesOptions:r.withoutCountriesOptions})}],or:{sid:"bxinjo1g",name:"popularDestinationsFailed"}});(0,t.sample)({and:[{clock:m,fn:({context:e,error:t})=>g({context:e,error:t,suggestGroup:"popular_cities"}),target:p}],or:{sid:"dgc71m0z"}}),(0,t.sample)({and:[{clock:m,filter:({withoutCountriesOptions:e})=>!e,fn:({context:e,error:t})=>g({context:e,error:t,suggestGroup:"popular_countries"}),target:p}],or:{sid:"bpksahar"}});let y=(0,t.createEvent)({sid:"4880k9wc",name:"arrivalQuerySuggestFailed"});(0,t.sample)({and:[{clock:y,source:u,filter:(e,{error:t})=>!!e&&!(0,a.isAbortError)(t),fn:(e,{error:t})=>g({context:e,error:t,suggestGroup:"query"}),target:p}],or:{sid:"cqwykcwe"}}),e.s(["$activeArrivalSuggestContext",0,u,"arrivalQuerySuggestFailed",0,y,"setActiveArrivalSuggestContext",0,c,"setArrivalSuggestAnalyticsReady",0,d])},411934,e=>{"use strict";var t=e.i(204241),r=e.i(774177),a=e.i(351039),i=e.i(605284),o=e.i(4340),s=e.i(43999),n=e.i(326875),l=e.i(178999);let c=(0,t.createEvent)({sid:"9m5r74bh",name:"setActiveDepartureSuggestContext"}),u=(0,t.createStore)(null,{sid:"5076vy2r",name:"$activeDepartureSuggestContext"});(0,t.sample)({and:[{clock:c,target:u}],or:{sid:"z0dxqqt"}});let{setAnalyticsReady:d,routeError:p}=(0,l.createSuggestErrorDelivery)(e=>{(0,s.getSearchFormAnalyticsObj)().departureSuggestError(e)}),g=({context:e,error:t,suggestGroup:r})=>({trip_index:e?.trip_index??null,is_complex_trip:e?.is_complex_trip??!1,...(0,n.normalizeSuggestErrorFields)(t),suggest_group:r,url:(0,n.getSuggestPageUrl)()}),f=(e,t)=>null!==e&&!e.is_live_query&&!(0,a.isAbortError)(t);(0,t.sample)({and:[{clock:i.fetchNearbyLocationsFx.fail,source:u,filter:(e,{error:t})=>f(e,t),fn:(e,{error:t})=>{if(!e)throw Error("Departure suggest group error without context");return g({context:e,error:t,suggestGroup:"nearest"})},target:p}],or:{sid:"7pjk7u0o"}}),(0,t.sample)({and:[{clock:o.fetchSearchHistoryFx.fail,source:u,filter:(e,{params:t,error:r})=>f(e,r)&&"departure"===t.field,fn:(e,{error:t})=>g({context:e,error:t,suggestGroup:"history"}),target:p}],or:{sid:"3hh8345d"}}),(0,t.sample)({and:[{clock:r.fetchAccountPreferencesFx.fail,source:u,filter:(e,{params:t,error:r})=>f(e,r)&&"departure"===t.field,fn:(e,{error:t})=>g({context:e,error:t,suggestGroup:"preferences"}),target:p}],or:{sid:"b10onq5o"}});let m=(0,t.createEvent)({sid:"azxar45p",name:"departureQuerySuggestFailed"});(0,t.sample)({and:[{clock:m,source:u,filter:(e,{error:t})=>!!e&&!(0,a.isAbortError)(t),fn:(e,{error:t})=>g({context:e,error:t,suggestGroup:"query"}),target:p}],or:{sid:"d2xmnle8"}}),e.s(["$activeDepartureSuggestContext",0,u,"departureQuerySuggestFailed",0,m,"setActiveDepartureSuggestContext",0,c,"setDepartureSuggestAnalyticsReady",0,d])},456439,e=>{"use strict";e.i(266756);var t=e.i(887133),r=e.i(477987);e.s(["useDirectionDefaults",0,function(){return{formDefaults:{from:(0,r.useUnit)(t.$selectedCity),to:null}}}])},774177,666650,166293,4340,e=>{"use strict";var t=e.i(204241);e.i(924856);var r=e.i(563943),a=e.i(778400),i=e.i(343528),o=e.i(743082);let s=e=>{if("city"===e.type)return e;if("airport"===e.type&&e.airport){let{cityCode:t,cityName:r,countryCode:a}=e.airport;return t&&r?{id:`city-${t}`,type:"city",label:r,sublabel:t,code:t,cityName:r,countryName:e.countryName,city:{code:t,name:r,countryCode:a}}:null}if("railway"===e.type&&e.railway){let{cityCode:t,cityName:r,countryCode:a}=e.railway;return t&&r?{id:`city-${t}`,type:"city",label:r,sublabel:t,code:t,cityName:r,countryName:e.countryName,city:{code:t,name:r,countryCode:a}}:null}return null};async function n(e){let t=await (0,o.reAuthFetch)(fetch,`${(0,r.getApiConfig)((0,a.clientDomain)()).ACCOUNT}${r.ACCOUNT_ENDPOINTS.SUGGEST}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({})});if(!t.ok)return[];let n=await t.json();if("success"!==n.status)return[];let l=((e,t)=>{let r="departure"===t?e.top_departure_airports??[]:e.top_arrival_airports??[],a=[],i=new Set;for(let e of r){let t=e.trim().toUpperCase();!t||i.has(t)||(i.add(t),a.push(t))}return a})(n,e.field);if(0===l.length)return[];let c=await Promise.all(l.map(t=>(0,i.fetchDirectionByCode)(t,e.language,e.isKpb,void 0,"city"))),u=[],d=new Set;for(let e of c){if(!e)continue;let t=s(e);!t||d.has(t.code)||(d.add(t.code),u.push(t))}return u}
1let l=(0,t.createEffect)(async e=>{let t=await n({language:e.language,isKpb:e.isKpb,field:e.field});return 0===t.length?null:{label:e.yourPreferencesLabel,suggestGroup:"preferences",options:t}},{sid:"c4nn2tgs",name:"fetchAccountPreferencesFx"});e.s(["fetchAccountPreferencesFx",0,l],774177);var c=e.i(207295);function u(e,t){return t?`${e}|${t}`:e}e.s(["buildDirectionLookupKey",0,u],666650);var d=e.i(485785);let p=e=>e.trim().toUpperCase();function g(e){let t,r=e.trim();if(!r)return null;let a=r.toLowerCase();if(a.startsWith("airport:")){let e=p(r.slice(8));return e?{storageKey:`airport:${e}`,code:e,preferKind:"airport"}:null}if(a.startsWith("iatax:")){let e=p(r.slice(6));return e?{storageKey:`iatax:${e}`,code:e,preferKind:"city"}:null}let i=/^rzd:(.+)$/i.exec(r);if(i?.[1]){let e=(0,d.toRailwayApiCode)(i[1].trim());return e?{storageKey:`rzd:${(0,d.stripRzdPrefix)(e)}`,code:e}:null}if(t=r.trim(),/^\d{7}$/.test(t)||/^[А-Яа-яЁё-]+$/.test(t)){let e=(0,d.toRailwayApiCode)(r);return e?{storageKey:`rzd:${(0,d.stripRzdPrefix)(e)}`,code:e}:null}let o=p(r);return o?{storageKey:`iatax:${o}`,code:o,preferKind:"city"}:null}let f="search-form:search-history";function m(e){return g(e)?.storageKey??""}let y=e=>!!e&&"object"==typeof e&&"string"==typeof e.departure&&"string"==typeof e.arrival&&"string"==typeof e.departure_date&&"string"==typeof e.last_usage&&e.departure.length>0&&e.arrival.length>0&&e.departure_date.length>0&&e.last_usage.length>0,h=e=>`${m(e.departure)}|${m(e.arrival)}`,b=e=>{let t=Date.parse(e);return Number.isFinite(t)?t:0};function v(e){let t=new Map;for(let r of e){let e=h(r),a=t.get(e);(!a||b(r.last_usage)>=b(a.last_usage))&&t.set(e,r)}return[...t.values()].sort((e,t)=>b(t.last_usage)-b(e.last_usage))}function S(){let e=c.safeLocalStorage.getItem(f);if(!e)return[];try{let t=JSON.parse(e);if(t&&"object"==typeof t&&!Array.isArray(t)&&Array.isArray(t.search_history))return v(t.search_history.filter(y));if(Array.isArray(t))return v(t.filter(y));return[]}catch{return[]}}let $=(e,t)=>(0,o.reAuthFetch)(fetch,`${(0,r.getApiConfig)((0,a.clientDomain)()).ACCOUNT}${e}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t)}),D=async()=>{try{var e;let t=await $(r.ACCOUNT_ENDPOINTS.SEARCH_HISTORY,{v:"2.0"});if(!t.ok)return[];let a=await t.json();if("success"!==a.status)return[];return e=a.data?.search_history??a.search_history,e?.length?e.filter(e=>"string"==typeof e.departure&&"string"==typeof e.arrival&&"string"==typeof e.departure_date&&e.departure.length>0&&e.arrival.length>0&&e.departure_date.length>0).map(e=>({departure:e.departure,arrival:e.arrival,departure_date:e.departure_date,last_usage:"string"==typeof e.last_usage&&e.last_usage.length>0?e.last_usage:e.departure_date,..."string"==typeof e.search_id?{search_id:e.search_id}:{},..."string"==typeof e.account_id?{account_id:e.account_id}:{}})):[]}catch{return[]}},A=async(e,t)=>{let r=t.field??"arrival",a=new Set,o=[];for(let t of e){let e="departure"===r?t.departure:t.arrival,i=g(e);if(!i)continue;let s=function(e){let t=g(e);return t?u(t.code,t.preferKind):""}(e);!s||a.has(s)||(a.add(s),o.push({code:i.code,preferKind:i.preferKind}))}return 0===o.length?[]:(await Promise.all(o.map(({code:e,preferKind:r})=>(0,i.fetchDirectionByCode)(e,t.language,t.isKpb,void 0,r)))).filter(e=>null!==e)};async function C(e){return A(v([...S(),...e.accountId?await D():[]]),e)}async function E(e){let{items:t,syncToApi:a=!1}=e;if(0===t.length)return!1;if(!function(e){let t;if(0===e.length)return S();let r=new Date().toISOString(),a=v([...e.map(e=>({departure:e.departure,arrival:e.arrival,departure_date:e.departure_date,last_usage:e.last_usage??r,...e.search_id?{search_id:e.search_id}:{},...e.account_id?{account_id:e.account_id}:{}})),...S()]);t={search_history:v(a).slice(0,10)},c.safeLocalStorage.setItem(f,JSON.stringify(t))}(t),!a)return!0;try{let e=await $(r.ACCOUNT_ENDPOINTS.SEARCH_HISTORY_ADD,{v:"2.0",search_history:t});if(!e.ok)return!0;return await e.json(),!0}catch{return!0}}e.s(["addSearchHistory",0,E,"fetchSearchHistory",0,C,"takeSearchHistoryOptionsForTransport",0,function(e,t="all",r=3){return e.filter(e=>(function(e,t="all"){return"all"===t||("airplane"===t?"railway"!==e.type:"train"!==t||"airport"!==e.type)})(e,t)).slice(0,r)}],166293);
1let k=(0,t.createEffect)(async e=>(await C({accountId:e.accountId,language:e.language,isKpb:e.isKpb,field:e.field})).map(e=>({...e,suggestSource:"history"})),{sid:"bs1mx9j2",name:"fetchSearchHistoryFx"}),w=(0,t.createEffect)(async({items:e,syncToApi:t})=>E({items:e,syncToApi:t}),{sid:"55pimif2",name:"addSearchHistoryFx"});e.s(["addSearchHistoryFx",0,w,"fetchSearchHistoryFx",0,k],4340)},351039,755609,43999,326875,178999,e=>{"use strict";e.i(924856);var t=e.i(554913),r=e.i(992546),a=e.i(204241);async function i({params:e,withGroupedOptions:a,withoutCountriesOptions:o,citiesOnly:s,groupLabels:n,signal:l}){let c=!1!==e.isKpb,u=await (0,t.fetchSuggestLocation)({query:e.query,language:e.language,isKpb:e.isKpb??!0,searchType:e.searchType??"all",suggestTarget:e.suggestTarget??"departure",departureLocation:e.departureLocation,arrivalLocation:e.arrivalLocation,signal:l});return a?(0,r.mapSuggestLocationToGroupedOptions)(u,{withoutCountriesOptions:o,groupLabels:n,includeRailway:c,preferExplicitCountriesFirst:!0}):(0,r.mapSuggestLocationToOptions)(u,{includeRailway:!s&&c,citiesOnly:s,withoutCountriesOptions:o})}let o=(0,a.createEffect)(i,{sid:"5tv7zloa",name:"searchDirectionsFx"});e.s(["isAbortError",0,function(e){return e instanceof DOMException&&"AbortError"===e.name||e instanceof Error&&"AbortError"===e.name},"searchDirections",0,i,"searchDirectionsFx",0,o],351039),e.i(559412);var s=e.i(888061),n=e.i(730069);let l="search_id",c=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,u=e=>"string"==typeof e&&c.test(e),d=(0,a.createStore)(null,{sid:"7lq1p31v",name:"$searchId",and:{sid:"search-form/$searchId"}}),p=(0,a.createEvent)({sid:"search-form/setSearchId"},{sid:"4eqmvnb0",name:"setSearchId"}),g=(0,a.createEvent)({sid:"search-form/regenerateSearchId"},{sid:"c5m7ilvd",name:"regenerateSearchId"});d.on(p,(e,t)=>t),(0,a.sample)({and:[{clock:g,fn:()=>crypto.randomUUID(),target:d}],or:{sid:"9y6s69yo"}});let f=()=>({search_id:d.getState()});e.s(["$searchId",0,d,"SEARCH_ID_QUERY_PARAM",0,l,"appendSearchIdToUrl",0,e=>{let t=d.getState();if(!t)return e;let r=e.indexOf("#"),a=-1===r?e:e.slice(0,r),i=-1===r?"":e.slice(r+1),o=a.includes("?")?"&":"?",s=`${a}${o}${l}=${encodeURIComponent(t)}`;return i?`${s}#${i}`:s},"getSearchIdParam",0,f,"isValidSearchId",0,u,"parseSearchIdFromQuery",0,e=>{if(!e)return null;let t=new URLSearchParams(e.startsWith("?")?e.slice(1):e).get(l);return u(t)?t:null},"regenerateSearchId",0,g,"setSearchId",0,p,"startSearchSession",0,g,"stripSearchIdFromLocation",0,()=>{let e=new URLSearchParams(window.location.search);if(!e.has(l))return;e.delete(l);let t=e.toString(),r=t?`${window.location.pathname}?${t}`:window.location.pathname;window.history.replaceState(window.history.state,"",r)}],755609);let m=(0,n.createBlockAnalytics)("search_form",!1),y=m.createCustomEvent("submit.valid");(0,a.sample)({and:[{clock:y,source:s.$ymReady,filter:e=>e,fn:(e,t)=>({goal:"search_form.submit.valid",params:{route:(({departures:e,arrivals:t,complex_trip_parts:r})=>r?.length?r.map(({departure_iata_code:e,arrival_iata_code:t})=>`${e}-${t}`).join("-"):`${e?.[0]?.iata_code??""}-${t?.[0]?.iata_code??""}`)(t)}}),target:s.ymReachGoal}],or:{sid:"6152efdn"}});let h=m.createCustomEvent("tooltip.show"),b=m.createCustomEvent("tooltip.close");e.s(["getSearchFormAnalyticsObj",0,()=>({departureSelected:e=>{m.createCustomEvent("departure.selected")(e)},arrivalSelected:e=>{m.createCustomEvent("arrival.selected")(e)},directionChangeClick:e=>{m.createCustomEvent("direction_change.click")(e)},departureDateSelected:e=>{m.createCustomEvent("departure_date.selected")(e)},returnDateSelected:e=>{m.createCustomEvent("return_date.selected")(e)},onewayOnlySelected:e=>{m.createCustomEvent("oneway_only.selected")(e)},tipClick:e=>{m.createCustomEvent("tip.click")(e)},submitValid:e=>{y({...e,...f()})},submitInvalid:e=>{m.createCustomEvent("submit.invalid")(e)},complexTripSelect:e=>{m.createCustomEvent("complex_trip.select")(e)},complexTripClick:e=>{m.createCustomEvent("complex_trip.click")(e)},flexibleDatesClick:e=>{m.createCustomEvent("flexible_dates.click")(e)},tripDurationClick:e=>{m.createCustomEvent("flexible_dates.trip_duration.click")(e)},filterTabClick:e=>{m.createCustomEvent("filter_tab.click")(e)},tabChange:e=>{m.createCustomEvent("tab.change")(e)},passengerSelect:e=>{m.createCustomEvent("passenger.select")(e)},departureClick:e=>{m.createCustomEvent("departure.click")(e)},departureClear:e=>{m.createCustomEvent("departure.clear")(e)},departureSuggestShow:e=>{m.createCustomEvent("departure.suggest.show")(e)},departureSuggestEmpty:e=>{m.createCustomEvent("departure.suggest.empty")(e)},departureSuggestError:e=>{m.createCustomEvent("departure.suggest.error")(e)},arrivalClick:e=>{m.createCustomEvent("arrival.click")(e)},arrivalSuggestShow:e=>{m.createCustomEvent("arrival.suggest.show")(e)},arrivalSuggestEmpty:e=>{m.createCustomEvent("arrival.suggest.empty")(e)},arrivalSuggestError:e=>{m.createCustomEvent("arrival.suggest.error")(e)},arrivalClear:e=>{m.createCustomEvent("arrival.clear")(e)},departureDateClick:e=>{m.createCustomEvent("departure_date.click")(e)},returnDateClick:e=>{m.createCustomEvent("return_date.click")(e)},passengerClick:e=>{m.createCustomEvent("passenger.click")(e)}}),"searchFormTooltipClose",0,b,"searchFormTooltipShow",0,h],43999);let v=e=>e.some(e=>"options"in e&&Array.isArray(e.options));e.s(["countSuggestOptions",0,e=>v(e)?e.reduce((e,t)=>
1e+t.options.filter(e=>!e.isSkeleton).length,0):e.filter(e=>!e.isSkeleton).length,"getSuggestPageUrl",0,()=>window.location.href,"hasSuggestSkeleton",0,e=>v(e)?e.some(e=>e.options.some(e=>!!e.isSkeleton)):e.some(e=>!!e.isSkeleton),"isSameSuggestOption",0,(e,t)=>e===t||!!t.selectKey&&e.selectKey===t.selectKey,"normalizeSuggestErrorFields",0,e=>e instanceof Error?{error_status:e.name||"Error",error_message:e.message||null}:"string"==typeof e?{error_status:"Error",error_message:e}:{error_status:"Error",error_message:null},"tagSuggestOptionsForDisplay",0,e=>v(e)?e.map((e,t)=>({...e,options:e.options.map((r,a)=>({...r,selectKey:r.selectKey??`${e.suggestGroup??"group"}-${t}-${a}-${r.id}`}))})):e.map((e,t)=>({...e,selectKey:e.selectKey??`flat-${t}-${e.id}`})),"withSelectedSuggestMeta",0,(e,t)=>e?{...e,selectedSuggestGroup:t.suggest_group}:null],326875),e.s(["createSuggestErrorDelivery",0,e=>{let t=(0,a.createEvent)({sid:"xh9xf37",name:"setAnalyticsReady"}),r=(0,a.createStore)(!1,{sid:"7lj7nb11",name:"$analyticsReady"}).on(t,(e,t)=>t),i=(0,a.createEvent)({sid:"6n8efs6d",name:"enqueueError"}
1),o=(0,a.createStore)([],{sid:"bjfc9eji",name:"$pendingErrors"}).on(i,(e,t)=>[...e,t]).on(t,(e,t)=>t?e:[]),s=(0,a.createEffect)(t=>{e(t)},{sid:"avz5bei1",name:"sendErrorFx"}),n=(0,a.createEffect)(t=>{for(let r of t)e(r)},{sid:"abt5zic3",name:"flushPendingErrorsFx"}),l=(0,a.createEvent)({sid:"16s9zoiy",name:"routeError"});return(0,a.sample)({and:[{clock:l,source:r,filter:e=>e,fn:(e,t)=>t,target:s}],or:{sid:"48951yln",name:"createSuggestErrorDelivery"}}),(0,a.sample)({and:[{clock:l,source:r,filter:e=>!e,fn:(e,t)=>t,target:i}],or:{sid:"dd7qi65s",name:"createSuggestErrorDelivery"}}),(0,a.sample)({and:[{clock:t,source:o,filter:(e,t)=>t,fn:e=>e,target:n}],or:{sid:"7ae0mwa",name:"createSuggestErrorDelivery"}}),(0,a.sample)({and:[{clock:n.done,fn:()=>[],target:o}],or:{sid:"5fox40vy",name:"createSuggestErrorDelivery"}}),{setAnalyticsReady:t,routeError:l}}],178999)},605284,e=>{"use strict";e.i(924856);var t=e.i(554913),r=e.i(992546),a=e.i(428733),i=e.i(387792);let o=(0,e.i(204241).createEffect)(async e=>{let o=e.formValues.routes[0],s=(0,i.resolveSuggestContextLocationCode)(o?.departure??null),n=(0,i.resolveSuggestContextLocationCode)(o?.arrival??null),l=await (0,t.fetchSuggestLocation)({query:"",language:e.language,isKpb:e.isKpb,searchType:(0,a.mapTransportTabToSearchType)(e.transportKind),suggestTarget:"departure",departureLocation:s,arrivalLocation:n,clientIp:e.clientIp,userCoordinates:e.userCoordinates}),c=(0,r.mapSuggestLocationToOptions)(l,{includeRailway:e.isKpb,withoutCountriesOptions:!0}).filter(e=>"city"===e.type||"airport"===e.type||"railway"===e.type);return 0===c.length?null:{label:e.nearYouLabel,suggestGroup:"nearest",options:c}},{sid:"am3jp51f",name:"fetchNearbyLocationsFx"});e.s(["fetchNearbyLocationsFx",0,o])},980975,827135,872248,788099,106512,989526,379654,880077,251139,780196,247261,204298,611876,128724,98183,183753,899169,e=>{"use strict";let t,r,a,i,o,s,n,l,c,u,d;var p,g=e.i(204241),f=e.i(477987);e.i(333978);var m=e.i(843677);e.i(924856);var y=e.i(624273);function h(e,t,r){let a=r?.count??1,i=r?.type??"city";return{label:e,suggestGroup:r?.suggestGroup,options:Array.from({length:a},(e,r)=>({id:`${t}-skeleton-${r}`,type:i,label:" ",code:"",cityName:"",countryName:"",isSkeleton:!0}))}}function b(e){return!!(e.popularCities&&e.anywhere)}e.s(["applyPopularDestinationLabels",0,function(e,t){return e.map(e=>{let r=e.options.map(e=>"anywhere"!==e.type?e:{...e,label:t.anywhere,sublabel:t.anywhereSublabel});return r.some(e=>"anywhere"===e.type)?{...e,label:"",options:r}:r.every(e=>"country"===e.type)?{...e,label:t.popularCountries,suggestGroup:"popular_countries",options:r}:r.some(e=>"city"===e.type||"airport"===e.type||"railway"===e.type)?{...e,label:t.popularCities,suggestGroup:"popular_cities",options:r}:{...e,options:r}})},"areDirectionLabelsReady",0,b],827135),e.i(266756);var v=e.i(887133),S=e.i(387792);let $={DATE:"date",RANGE:"range"};e.s(["ROUTE_TYPE",0,$],872248);let D=Object.freeze({type:$.DATE,value:null}),A=Object.freeze({arrival:null,departure:null,departureDate:{...D},backDate:{...D}}),C=Object.freeze({arrival:null,departure:null,date:{...D}}),E=Object.freeze({routeType:"simple",passengers:{adults:1,childrenAges:[]},cabinClass:"ECONOMY_CLASS",routes:[A]});e.s(["COMPOSITE_ROUTE_DEFAULT_VALUE",0,C,"DATE_DEFAULT_VALUE",0,D,"ROUTE_DEFAULT_VALUE",0,A,"defaultFormValues",0,E],788099);var k=e.i(817422);let w={selectDirection:"Select direction",selectDate:"Select date",selectDepartureDate:"Select departure date",sameIataError:"Departure and arrival cannot be the same"},x=(t=w.sameIataError,r=k.z.object({type:k.z.literal($.DATE),value:k.z.number().nullable()}),a=k.z.object({start:k.z.number(),end:k.z.number()}),i=k.z.object({type:k.z.literal($.RANGE),value:a.nullable()}),o=k.z.object({id:k.z.string().min(1,w.selectDirection),type:k.z.enum(["airport","city","country","railway","anywhere"]),label:k.z.string().min(1,w.selectDirection),sublabel:k.z.string().optional(),code:k.z.string().min(1,w.selectDirection),cityName:k.z.string(),countryName:k.z.string(),coordinates:k.z.object({latitude:k.z.number(),longitude:k.z.number()}).optional()}).passthrough(),s=k.z.object({departure:o.nullable().refine(e=>null!==e,{message:w.selectDirection}),arrival:o.nullable().refine(e=>null!==e,{message:w.selectDirection}),departureDate:k.z.union([k.z.object({type:k.z.literal($.DATE),value:k.z.number().min(1,w.selectDepartureDate).nullable().refine(e=>null!==e,{message:w.selectDate})}),k.z.object({type:k.z.literal($.RANGE),value:a})]),backDate:k.z.union([r,i])}).refine(e=>!(e.departure?.code&&e.arrival?.code)||e.departure.code!==e.arrival.code,{message:t,path:["arrival"]}),n=k.z.object({departure:o.nullable().refine(e=>null!==e,{message:w.selectDirection}),arrival:o.nullable().refine(e=>null!==e,{message:w.selectDirection}),date:k.z.object({type:k.z.literal($.DATE),value:k.z.number().min(1,w.selectDate).nullable().refine(e=>null!==e,{message:w.selectDate})})}).refine(e=>!(e.departure?.code&&e.arrival?.code)||e.departure.code!==e.arrival.code,{message:t,path:["arrival"]}),l=k.z.object({adults:k.z.number().min(1).max(9),childrenAges:k.z.array(k.z.number().min(0).max(17)).max(8)}),c=k.z.object({routeType:k.z.literal("simple"),routes:k.z.tuple([s]),passengers:l,cabinClass:k.z.enum(["ECONOMY_CLASS","BUSINESS_CLASS"])}),u=k.z.object({routeType:k.z.literal("composite"),routes:k.z.array(n).min(2).max(6),passengers:l,cabinClass:k.z.enum(["ECONOMY_CLASS","BUSINESS_CLASS"])}),d=k.z.discriminatedUnion("routeType",[c,u]),{dateInputSchema:r,dateRangeInputSchema:i,directionSchema:o,simpleRouteSchema:s,compositeRouteSchema:n,passengersSchema:l,simpleFormSchema:c,compositeFormSchema:u,searchFormSchema:d}),_=w.sameIataError,F=x.searchFormSchema,z=e=>e.length>1,P=e=>"departureDate"in e,T=e=>!!P(e)&&(e.departureDate?.type===$.RANGE||e.backDate?.type===$.RANGE);e.s(["SAME_IATA_ERROR",0,_,"isCompositeRoutes",0,z,"isFlexibleDatesRoute",0,T,"isSimpleRouteShape",0,P,"isWithFlexibleDates",0,e=>e.some(T),"searchFormSchema",0,F],106512);let I=e=>!P(e)&&"date"in e,L=e=>{var t;return I(e)?e:{departure:e.departure,arrival:e.arrival,date:(t=e.departureDate).type===$.DATE?{type:$.DATE,value:t.value}:t.type===$.RANGE&&t.value?{type:$.DATE,value:t.value.start}:{...D}}},K=e=>{let{routes:t,routeType:r}=e,a=t.some(I),i=t.some(P);return a&&i?r:t.length>1||a&&!i?"composite":i&&!a?"simple":r},R=e=>{if("simple"===K(e)){let t=e.routes[0];return t?[P(t)?t:{departure:t.departure,arrival:t.arrival,departureDate:t.date??{...D},backDate:{...D}}]:[A]}return e.routes.map(L)};e.s(["coerceSearchFormRoutes",0,R,"getRouteBackDateInput",0,e=>e&&P(e)?e.backDate??A.backDate:A.backDate,"getRouteDepartureDateInput",0,e=>e?P(e)?e.departureDate??A.departureDate:"date"in e&&e.date?e.date:A.departureDate:A.departureDate,"resolveEffectiveSearchFormRouteType",0,K],989526);let G=e=>{if(!e?.routes?.length)return e;let t=K(e),r=R({...e,routeType:t});return e.routeType===t&&e.routes.length===r.length&&e.routes.every((e,t)=>e===r[t])?e:{...e,routeType:t,routes:r}};e.s(["normalizeSearchFormData",0,G],379654);var O=e.i(453059),N=e.i(342179);let H=e=>{if(!e[0]&&!e[1])return!1;let t=1===e.length&&!!(e[0]&&"backDate"in e[0]&&e[0].backDate?.value),r=2===e.length&&e?.[0]?.departure?.code===e?.[1]?.arrival?.code&&e?.[0]?.arrival?.code===e?.[1]?.departure?.code;return t||r},j=e=>e.some(e=>e.arrival?.code.toLowerCase()===N.SUGGEST_VARIANT.ANYWHERE),U=e=>e.some(e=>!!P(e)&&e.departureDate.type===O.ROUTE_TYPE.RANGE);e.s(["checkIsAnywhereRoute",0,j,"checkIsFlexibleDates",0,U,"checkIsRoundTripRoutes",0,H],880077);let q=(0,g.createStore)(E,{sid:"d5b1i0j4",name:"$searchFormDefaults",and:{sid:"search-form/$searchFormDefaults"}}),V=(0,g.createEvent)({sid:"search-form/setSearchFormDefaults"},{sid:"a3wuqr23",name:"setSearchFormDefaults"});q.on(V,(e,t)=>G(t));let Y=(0,g.createStore)(0,{sid:"6m6gwt73",name:"$searchFormDefaultsGeneration",and:{sid:"search-form/$searchFormDefaultsGeneration",serialize:"ignore"}});Y.on(V,e=>e+1);let B=(0,g.createStore)(E,{sid:"c9eijnr",name:"$searchFormValues",and:{sid:"search-form/$searchFormValues"}}),M=(0,g.createEvent)({sid:"search-form/syncFormValues"},{sid:"bgouw4r1",name:"syncFormValues"});B.on(M,(e,t)=>G(t)),B.on(V,(e,t)=>G(t));let W=B.map(e=>e.routeType),Q=B.map(e=>e.routes),J=Q.map(e=>e[0]??null),Z=J.map(e=>e?.departure??null),X=J.map(e=>
1e&&"arrival"in e?e.arrival:null),ee=B.map(e=>e.passengers),et=B.map(e=>e.cabinClass),er=(0,g.createStore)(void 0,{sid:"dbki739o",name:"$isCompositePreviewMode",and:{sid:"search-form/$isCompositePreviewMode",skipVoid:!1}}),ea=(0,g.createEvent)({sid:"1n6hle69",name:"setCompositePreviewMode"});er.on(ea,(e,t)=>t);let ei=(0,g.createStore)(E,{sid:"1r7m9l9y",name:"$submittedFormValues",and:{sid:"search-form/$submittedFormValues",skipVoid:!1}}),eo=(0,g.createEvent)({sid:"search-form/setSubmittedFormValues"},{sid:"dga7vcx6",name:"setSubmittedFormValues"}),es=(0,g.createEvent)({sid:"search-form/searchFormSubmitted"},{sid:"ddcli7a3",name:"searchFormSubmitted"});ei.on(eo,(e,t)=>G(t));let en=e=>e?.value?"date"===e.type?String(e.value):"object"==typeof e.value&&"start"in e.value&&"end"in e.value?`${e.value.start}-${e.value.end}`:null:null,el=e=>"date"in e?en(e.date):"departureDate"in e?en(e.departureDate):null,ec=e=>"backDate"in e?en(e.backDate):null,eu=(e,t)=>e.departure?.code===t.departure?.code&&("arrival"in e?e.arrival?.code:void 0)===("arrival"in t?t.arrival?.code:void 0)&&el(e)===el(t)&&ec(e)===ec(t),ed=(0,g.combine)({and:[B,ei,(e,t)=>!((e,t)=>{if(e.routeType!==t.routeType||e.routes.length!==t.routes.length)return!1;for(let r=0;r<e.routes.length;r++){let a=e.routes[r],i=t.routes[r];if(a&&i&&!eu(a,i))return!1}if(e.passengers.adults!==t.passengers.adults)return!1;let r=e.passengers.childrenAges,a=t.passengers.childrenAges;if(r.length!==a.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==a[e])return!1;return e.cabinClass===t.cabinClass})(e,t)],or:{sid:"70zhqzah",name:"$isFormChanged"}}),ep=e=>{let t=e.routes[0],r=t&&"arrival"in t?t.arrival:null,a={isWithFlexibleDates:U(e?.routes),isAnywhereRoute:j(e?.routes),isRoundTrip:H(e.routes)};return{...e,...a,isComplexTrip:z(e?.routes)&&!a.isWithFlexibleDates,isInCountrySearch:r?.type==="country"||!r?.type&&3>Number(r?.code.length??0)}},eg=B.map(ep),ef=ei.map(ep);e.s(["$arrival",0,X,"$cabinClass",0,et,"$departure",0,Z,"$firstRoute",0,J,"$isCompositePreviewMode",0,er,"$isFormChanged",0,ed,"$parsedSearchParams",0,eg,"$parsedSubmittedSearchParams",0,ef,"$passengers",0,ee,"$routeType",0,W,"$routes",0,Q,"$searchFormDefaults",0,q,"$searchFormDefaultsGeneration",0,Y,"$searchFormValues",0,B,"$submittedFormValues",0,ei,"searchFormSubmitted",0,es,"setCompositePreviewMode",0,ea,"setSearchFormDefaults",0,V,"setSubmittedFormValues",0,eo,"syncFormValues",0,M],251139);var em=e.i(577641),ey=((p={}).AIRPLANE="airplane",p.TRAIN="train",p);e.s(["TRANSPORT_KIND",()=>ey],780196);let eh=(0,g.createEvent)({sid:"bt6p56at",name:"setTransportKind"}),eb=(0,g.createStore)("all",{sid:"39jy1brl",name:"$selectedTransportKind"});eb.on(eh,(e,t)=>t);let ev=(0,g.combine)({and:[eb,m.$isRailwayHidden,(e,t)=>t?ey.AIRPLANE:e],or:{sid:"7x3yicck",name:"$transportKind"}}),eS=(0,g.createStore)(null,{sid:"8sphec2i",name:"$suggestSearchTypeOverride"});e.s(["$selectedTransportKind",0,eb,"$suggestSearchTypeOverride",0,eS,"$transportKind",0,ev,"setTransportKind",0,eh],247261);var e$=e.i(423246),eD=e.i(428733);let eA=(0,g.createStore)([],{sid:"yte8f9b",name:"$popularDestinationsGroups"}),eC=(0,g.createStore)(void 0,{sid:"19fhuy03",name:"$currentDirectionFrom",and:{sid:"search-form/$currentDirectionFrom",skipVoid:!1}}),eE=(0,g.createStore)({anywhere:"",anywhereSublabel:"",popularCities:"",popularCountries:"",cities:"",countries:"",searchHistory:"",yourPreferences:"",nearYou:""},{sid:"50z3mfm1",name:"$directionLabels"}),ek=(0,g.createEvent)({sid:"6i6b8hz2",name:"initPopularDestinations"}),ew=(0,g.createEvent)({sid:"z1obg7v",name:"setWithoutCountriesOptions"}),ex=(0,g.createEvent)({sid:"3cvexn41",name:"setCurrentDirectionFrom"}),e_=(0,g.createEvent)({sid:"2btld0p1",name:"setDirectionLabels"});eC.on(ex,(e,t)=>t),eE.on(e_,(e,t)=>Object.keys(t).every(r=>e[r]===t[r])?e:t);let eF=(0,g.createStore)("idle",{sid:"vctqgi",name:"$popularDestinationsStatus"}),ez=(0,g.createStore)(!1,{sid:"7tknt0wk",name:"$isPopularDestinationsLoading"}).on(e$.fetchPopularDestinationsFx.pending,(e,t)=>t),eP=(0,g.createStore)(!1,{sid:"9wxeq2qq",name:"$withoutCountriesOptions"}),eT=(0,g.combine)({and:[{lang:m.$lang},({lang:e})=>{let t=e?.split("-")[0]??"ru";return"ru"===t||"en"===t}],or:{sid:"dlcyq75u",name:"$isPriceMapEnabled"}});eP.on(ew,(e,t)=>t);let eI=({labels:e})=>b(e);function eL(e){return{label:"",options:[{id:"anywhere",type:"anywhere",label:e.anywhere,sublabel:e.anywhereSublabel,code:em.ANYWHERE_CODE,cityName:"",countryName:""}]}}(0,g.sample)({and:[{clock:[ek,eC,eP,eE,eT,m.$lang,m.$isKpb,ev,eS],source:{currentDirectionFrom:eC,withoutCountriesOptions:eP,labels:eE,withAnywhere:eT,lang:m.$lang,isKpb:m.$isKpb,transportKind:ev,suggestOverride:eS},filter:eI,fn:()=>"loading",target:eF}],or:{sid:"amlufxnd"}}),(0,g.sample)({and:[{clock:[ek,eC,eP,eE,eT,m.$lang,m.$isKpb,ev,eS],source:{currentDirectionFrom:eC,withoutCountriesOptions:eP,labels:eE,withAnywhere:eT,lang:m.$lang,isKpb:m.$isKpb,transportKind:ev,suggestOverride:eS},fn:({currentDirectionFrom:e,withoutCountriesOptions:t,labels:r,withAnywhere:a,lang:i,isKpb:o,transportKind:s,suggestOverride:n})=>({language:(0,y.resolveSuggesterLanguageByBrand)(i,o),isKpb:o,searchType:n??(0,eD.mapTransportTabToSearchType)(s),departureLocation:(0,S.resolveSuggestContextLocationCode)(e),withoutCountriesOptions:t,labels:r,withAnywhere:a}),filter:eI,target:e$.fetchPopularDestinationsFx}],or:{sid:"ab3th7t2"}}),(0,g.sample)({and:[{clock:e$.fetchPopularDestinationsFx.doneData,target:eA}],or:{sid:"dir63e4"}}),(0,g.sample)({and:[{clock:e$.fetchPopularDestinationsFx.done,fn:()=>"ready",target:eF}],or:{sid:"347phzi4"}}),(0,g.sample)({and:[{clock:e$.fetchPopularDestinationsFx.fail,fn:()=>[],target:eA}],or:{sid:"8x4wcgsi"}}),(0,g.sample)({and:[{clock:e$.fetchPopularDestinationsFx.fail,fn:()=>"ready",target:eF}],or:{sid:"dchdsem2"}});let eK=(0,g.combine)({and:[{groups:eA,status:eF,labels:eE,withoutCountriesOptions:eP,withAnywhere:eT},({groups:e,status:t,labels:r,withoutCountriesOptions:a,withAnywhere:i})=>{if(!b(r))return[];if(e.length>0)return e;if("ready"===t)return i&&r.anywhere?[eL(r)]:[];if("loading"===t){let e;return e=[],i&&r.anywhere&&e.push(eL(r)),r.popularCities&&e.push(h(r.popularCities,"popular-cities",{suggestGroup:"popular_cities"})),!a&&r.popularCountries&&e.push(h(r.popularCountries,"popular-countries",{type:"country",suggestGroup:"popular_countries"})),e}return[]}],or:{sid:"dihkjfbc",name:"$popularDestinationsSuggestGroups"}});(0,g.sample)({and:[{clock:ex,source:v.$selectedCity,filter:(e,t)=>null!==t&&e?.code!==t.code,fn:(e,t)=>t,target:v.userSelectCity}],or:{sid:"dddqtx4c"}}),(0,g.sample)({and:[{clock:B,source:eC,filter:(e,t)=>{let r=t.routes[0]?.departure??null;return void 0===e||e?.code!==r?.code},fn:(e,t)=>t.routes[0]?.departure??null,target:ex}],or:{sid:"ciqmekpy"}}),e.s(["$currentDirectionFrom",0,eC,"$directionLabels",0,eE,"$isPopularDestinationsLoading",0,ez,"$isPriceMapEnabled",0,eT,"$popularDestinationsGroups",0,eA,"$popularDestinationsSuggestGroups",0,eK,"$withoutCountriesOptions",0,eP,"initPopularDestinations",0,ek,"setCurrentDirectionFrom",0,ex,"setDirectionLabels",0,e_,"setWithoutCountriesOptions",0,ew],204298);var eR=e.i(774177);let eG=(0,g.createEvent)({sid:"1ug77th0",name:"initAccountPreferences"}
1),eO=(0,g.createEvent)({sid:"46wgl7sw",name:"initDeparturePreferences"}),eN=(0,g.createStore)(null,{sid:"42gj9g5l",name:"$accountPreferencesGroup",and:{sid:"search-form/$accountPreferencesGroup"}}),eH=(0,g.createStore)(null,{sid:"aynhf7ml",name:"$departurePreferencesGroup",and:{sid:"search-form/$departurePreferencesGroup"}}),ej=(0,g.createStore)("idle",{sid:"c0mwhff1",name:"$arrivalPreferencesStatus"}).on(m.$isAuthorized,(e,t)=>t?e:"idle"),eU=(0,g.createStore)("idle",{sid:"bx41fnkv",name:"$departurePreferencesStatus"}).on(m.$isAuthorized,(e,t)=>t?e:"idle");(0,g.createStore)(!1,{sid:"1wql8xuq",name:"$isAccountPreferencesLoading"}).on(eR.fetchAccountPreferencesFx.pending,(e,t)=>t);let eq=({accountId:e,isAuthorized:t,labels:r})=>t&&!!e&&b(r)&&!!r.yourPreferences;(0,g.sample)({and:[{clock:[eG,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:eq,fn:()=>"loading",target:ej}],or:{sid:"28yhx9tg"}}),(0,g.sample)({and:[{clock:[eG,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:eq,fn:({labels:e,lang:t,isKpb:r})=>({language:(0,y.resolveSuggesterLanguageByBrand)(t,r),isKpb:r,yourPreferencesLabel:e.yourPreferences,field:"arrival"}),target:eR.fetchAccountPreferencesFx}],or:{sid:"67s3110t"}}),(0,g.sample)({and:[{clock:[eO,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:eq,fn:()=>"loading",target:eU}],or:{sid:"7rxn3151"}}
1),(0,g.sample)({and:[{clock:[eO,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:eq,fn:({labels:e,lang:t,isKpb:r})=>({language:(0,y.resolveSuggesterLanguageByBrand)(t,r),isKpb:r,yourPreferencesLabel:e.yourPreferences,field:"departure"}),target:eR.fetchAccountPreferencesFx}],or:{sid:"ch8ekvxf"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.done,filter:({params:e})=>"arrival"===e.field,fn:({result:e})=>e,target:eN}],or:{sid:"9pfswh04"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.done,filter:({params:e})=>"departure"===e.field,fn:({result:e})=>e,target:eH}],or:{sid:"8xb5bjmo"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.done,filter:({params:e})=>"arrival"===e.field,fn:()=>"ready",target:ej}],or:{sid:"an3yl2gs"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.done,filter:({params:e})=>"departure"===e.field,fn:()=>"ready",target:eU}],or:{sid:"cm713y23"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.fail,filter:({params:e})=>"arrival"===e.field,fn:()=>null,target:eN}],or:{sid:"4z27suai"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.fail,filter:({params:e})=>"departure"===e.field,fn:()=>null,target:eH}],or:{sid:"5scbytwx"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.fail,filter:({params:e})=>"arrival"===e.field,fn:()=>"ready",target:ej}],or:{sid:"b4zldxfg"}}),(0,g.sample)({and:[{clock:eR.fetchAccountPreferencesFx.fail,filter:({params:e})=>"departure"===e.field,fn:()=>"ready",target:eU}],or:{sid:"1eyf69lt"}}),(0,g.sample)({and:[{clock:m.$isAuthorized,filter:e=>!e,fn:()=>null,target:[eN,eH]}],or:{sid:"dptjysbr"}});let eV=(0,g.combine)({and:[{isAuthorized:m.$isAuthorized,accountId:m.$accountId,group:eN,status:ej,labels:eE},({isAuthorized:e,accountId:t,group:r,status:a,labels:i})=>e&&t&&i.yourPreferences?r||("ready"===a?null:h(i.yourPreferences,"preferences-arrival",{suggestGroup:"preferences"})):null],or:{sid:"4hzon3sx",name:"$accountPreferencesSuggestGroup"}}),eY=(0,g.combine)({and:[{isAuthorized:m.$isAuthorized,accountId:m.$accountId,group:eH,status:eU,labels:eE},({isAuthorized:e,accountId:t,group:r,status:a,labels:i})=>e&&t&&i.yourPreferences?r||("ready"===a?null:h(i.yourPreferences,"preferences-departure",{suggestGroup:"preferences"})):null],or:{sid:"34dme697",name:"$departurePreferencesSuggestGroup"}});e.s(["$accountPreferencesSuggestGroup",0,eV,"$departurePreferencesSuggestGroup",0,eY,"initAccountPreferences",0,eG,"initDeparturePreferences",0,eO],611876);var eB=e.i(605284);let eM=(0,g.createEvent)({sid:"pv16p0",name:"initNearbyLocations"}),eW=(0,g.createStore)(null,{sid:"427wr35o",name:"$nearbyLocationsGroup",and:{sid:"search-form/$nearbyLocationsGroup"}}),eQ=(0,g.createStore)("idle",{sid:"219o5pu5",name:"$nearbyLocationsStatus"});(0,g.createStore)(!1,{sid:"9ojbrn74",name:"$isNearbyLocationsLoading"}).on(eB.fetchNearbyLocationsFx.pending,(e,t)=>t);let eJ=({clientIp:e,labels:t})=>!!e&&b(t)&&!!t.nearYou;(0,g.sample)({and:[{clock:[eM,m.$clientIP,m.$geoLocationData,m.$lang,m.$isKpb,ev],source:{clientIp:m.$clientIP,geoLocation:m.$geoLocationData,formValues:B,labels:eE,lang:m.$lang,isKpb:m.$isKpb,transportKind:ev},filter:eJ,fn:()=>"loading",target:eQ}],or:{sid:"ce8kkb4v"}}),(0,g.sample)({and:[{clock:[eM,m.$clientIP,m.$geoLocationData,m.$lang,m.$isKpb,ev],source:{clientIp:m.$clientIP,geoLocation:m.$geoLocationData,formValues:B,labels:eE,lang:m.$lang,isKpb:m.$isKpb,transportKind:ev},filter:eJ,fn:({clientIp:e,geoLocation:t,formValues:r,labels:a,lang:i,isKpb:o,transportKind:s})=>{let n="number"==typeof t?.latitude&&"number"==typeof t?.longitude;return{language:(0,y.resolveSuggesterLanguageByBrand)(i,o),isKpb:o,nearYouLabel:a.nearYou,clientIp:e,userCoordinates:n?[t.latitude,t.longitude]:void 0,formValues:r,transportKind:s}},target:eB.fetchNearbyLocationsFx}],or:{sid:"191a73ed"}}),(0,g.sample)({and:[{clock:eB.fetchNearbyLocationsFx.doneData,target:eW}],or:{sid:"cubd6z7z"}}),(0,g.sample)({and:[{clock:eB.fetchNearbyLocationsFx.done,fn:()=>"ready",target:eQ}],or:{sid:"9bluex1v"}}),(0,g.sample)({and:[{clock:eB.fetchNearbyLocationsFx.fail,fn:()=>null,target:eW}],or:{sid:"12potbb8"}}),(0,g.sample)({and:[{clock:eB.fetchNearbyLocationsFx.fail,fn:()=>"ready",target:eQ}],or:{sid:"pnr710e"}});let eZ=(0,g.combine)({and:[{clientIp:m.$clientIP,group:eW,status:eQ,labels:eE},({clientIp:e,group:t,status:r,labels:a})=>a.nearYou?t||("ready"!==r&&e?h(a.nearYou,"nearby-locations",{suggestGroup:"nearest"}):null):null],or:{sid:"3lwhmj54",name:"$nearbyLocationsSuggestGroup"}});e.s(["$nearbyLocationsSuggestGroup",0,eZ,"initNearbyLocations",0,eM],128724);var eX=e.i(166293),e0=e.i(485785);let e1=e=>e.includes("Rzd:")?"rzd":"iatax",e7=e=>e.startsWith("Rzd:")?e.replace("Rzd:",""):e,e9=e=>{if(!e)return"";if("string"==typeof e){let t,r;return t=e1(e),r=e7(e),`${t}:${r}`}if("railway"===e.type){let t=e.code.startsWith("Rzd:")?e.code:`Rzd:${e.code}`;return`rzd:${e7(t)}`}return"airport"===e.type?`airport:${e7(e.code)}`:`iatax:${e7(e.code)}`};e.s(["buildDateRoute",0,(e,t,r)=>`${e9(e)}_${r}_date_${r}_${e9(t)}`,"buildRangeRoute",0,(e,t,r,a)=>
1`${e9(e)}_${r}_range_${a}_${e9(t)}`,"cleanStationCode",0,e7,"formatRouteDate",0,e=>{if(!e)return"";let t=new Date(e),r=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${r}-${a}-${i}`},"formatRouteStation",0,e9,"getStationCodeForRoute",0,e=>e?.code?"railway"===e.type?(0,e0.toRailwayApiCode)(e.code):e7(e.code):"","getStationPrefix",0,e1],98183);let e4=e=>{if(!e)return null;let t="number"==typeof e?new Date(e):e,r=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${r}-${a}-${i}`},e2=e=>e?"anywhere"===e.type?"anywhere":"country"===e.type?"country":"railway"===e.type||e.code?.startsWith("Rzd:")?"railway_station":"airport"===e.type?"airport":"city":"city",e3=e=>e&&e.type===$.DATE?e.value:null,e5=e=>"composite"===e.routeType;function e6(e){if(!e||"anywhere"===e.type)return;let t=e.code?.trim()??"";if("airport"===e.type?t=(e.airport?.iataCode??e.code)?.trim()??"":"railway"===e.type&&(t=(e.railway?.code??e.code)?.trim()??""),t)return e9({code:t,type:e.type})||void 0}e.s(["createComplexTripParts",0,e=>{if(e5(e))return e.routes.map((e,t)=>{let r="date"in e?e.date:"departureDate"in e?e.departureDate:void 0;return{trip_index:t+1,departure_iata_code:e.departure?.code?e7(e.departure.code):"",arrival_iata_code:e.arrival?.code?e7(e.arrival.code):"",departure_date:e4(e3(r))}})},"createDirectionObject",0,e=>({iata_code:e?.code?e7(e.code):"",type:e2(e)}),"createInvalidComplexTripParts",0,(e,t)=>{if(e5(e))return e.routes.map((e,r)=>{let a=t?.routes,i=a?.[r];return{trip_index:r+1,invalid_departure:!!i?.departure,invalid_arrival:!!i?.arrival,invalid_departure_date:!!(i?.departureDate||i?.date)}})},"formatDate",0,e4,"getChildrenCount",0,e=>e.passengers?.childrenAges?.length||0,"getDateMax",0,e=>e&&e.type===$.RANGE&&e.value?e.value.end:null,"getDateMin",0,e=>e&&e.type===$.RANGE&&e.value?e.value.start:null,"getDateValue",0,e3,"getDirectionType",0,e2,"getPassengerCategories",0,e=>{let t=e.passengers?.adults||1,r=e.passengers?.childrenAges||[],a=r.filter(e=>e>=2&&e<12).length,i=r.filter(e=>e<2).length;return{adults:t,children:a,infants:i,total:t+a+i}},"isComplexTrip",0,e5],183753);let e8=e=>{let t="date"in e?e.date:e.departureDate;if(!t||t.type!==$.DATE)return null;let r=e3(t);return r?e4(r):null},te=e=>!!e&&"anywhere"!==e.type;function tt(e){let t=[];for(let r of e.routes){let e=e6(r.departure),a=e6(r.arrival),i=e8(r);e&&a&&i&&te(r.arrival)&&t.push({departure:e,arrival:a,departure_date:i})}return t}var tr=e.i(4340);let ta=(0,g.createEvent)({sid:"9pl56jq1",name:"initSearchHistory"}),ti=(0,g.createEvent)({sid:"d4g0occ2",name:"initDepartureSearchHistory"}),to=(0,g.createEvent)({sid:"bvv9ke13",name:"searchHistorySaveRequested"}),ts=(0,g.createStore)([],{sid:"2tmhu7ti",name:"$arrivalSearchHistoryPool",and:{sid:"search-form/$arrivalSearchHistoryPool"}}),tn=(0,g.createStore)([],{sid:"49lrcx7y",name:"$departureSearchHistoryPool",and:{sid:"search-form/$departureSearchHistoryPool"}}),tl=(0,g.createStore)("idle",{sid:"omyglmu",name:"$arrivalSearchHistoryStatus"}).on(m.$isAuthorized,()=>"idle"),tc=(0,g.createStore)("idle",{sid:"dajxe0ua",name:"$departureSearchHistoryStatus"}).on(m.$isAuthorized,()=>"idle");(0,g.createStore)(!1,{sid:"d1c00kv3",name:"$isSearchHistoryLoading"}).on(tr.fetchSearchHistoryFx.pending,(e,t)=>t);let tu=({accountId:e,isAuthorized:t,labels:r})=>b(r)&&!!r.searchHistory&&(!t||!!e),td=({options:e,transportKind:t,label:r})=>{let a=(0,eX.takeSearchHistoryOptionsForTransport)(e,t);return 0===a.length?null:{label:r,suggestGroup:"history",options:a}},tp=(0,g.combine)({and:[{options:ts,transportKind:ev,labels:eE,withoutCountriesOptions:eP},({options:e,transportKind:t,labels:r,withoutCountriesOptions:a})=>r.searchHistory?td({options:a?e.filter(e=>"country"!==e.type):e,transportKind:t,label:r.searchHistory}):null],or:{sid:"py9wyhh",name:"$searchHistoryGroup"}}),tg=(0,g.combine)({and:[{options:tn,transportKind:ev,labels:eE},({options:e,transportKind:t,labels:r})=>r.searchHistory?td({options:e,transportKind:t,label:r.searchHistory}):null],or:{sid:"7e9u9c5o",name:"$departureSearchHistoryGroup"}});(0,g.sample)({and:[{clock:[ta,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:tu,fn:()=>"loading",target:tl}],or:{sid:"547gx80t"}}),(0,g.sample)({and:[{clock:[ta,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:tu,fn:({accountId:e,isAuthorized:t,lang:r,isKpb:a})=>({accountId:t&&e?e:void 0,language:(0,y.resolveSuggesterLanguageByBrand)(r,a),isKpb:a,field:"arrival"}),target:tr.fetchSearchHistoryFx}],or:{sid:"b2uih2a1"}}),(0,g.sample)({and:[{clock:[ti,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:tu,fn:()=>"loading",target:tc}],or:{sid:"9yl1dh4b"}}),(0,g.sample)({and:[{clock:[ti,m.$accountId,m.$isAuthorized,eE,m.$lang,m.$isKpb],source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized,labels:eE,lang:m.$lang,isKpb:m.$isKpb},filter:tu,fn:({accountId:e,isAuthorized:t,lang:r,isKpb:a})=>({accountId:t&&e?e:void 0,language:(0,y.resolveSuggesterLanguageByBrand)(r,a),isKpb:a,field:"departure"}),target:tr.fetchSearchHistoryFx}],or:{sid:"c8hvilca"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.done,filter:({params:e})=>"arrival"===e.field,fn:({result:e})=>e,target:ts}],or:{sid:"4sgncve0"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.done,filter:({params:e})=>"departure"===e.field,fn:({result:e})=>e,target:tn}],or:{sid:"2vk7k51s"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.done,filter:({params:e})=>"arrival"===e.field,fn:()=>"ready",target:tl}],or:{sid:"9c55be6t"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.done,filter:({params:e})=>"departure"===e.field,fn:()=>"ready",target:tc}],or:{sid:"5sl4qcze"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.fail,filter:({params:e})=>"arrival"===e.field,fn:()=>[],target:ts}],or:{sid:"ani6ri35"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.fail,filter:({params:e})=>"departure"===e.field,fn:()=>[],target:tn}],or:{sid:"652zcp3t"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.fail,filter:({params:e})=>"arrival"===e.field,fn:()=>"ready",target:tl}],or:{sid:"3ldb0k0d"}}),(0,g.sample)({and:[{clock:tr.fetchSearchHistoryFx.fail,filter:({params:e})=>"departure"===e.field,fn:()=>"ready",target:tc}],or:{sid:"c6yk4o9a"}}),(0,g.sample)({and:[{clock:m.$isAuthorized,target:[ta,ti]}],or:{sid:"72pu3eak"}});let tf=(0,g.combine)({and:[{group:tp,status:tl,labels:eE},({group:e,status:t,labels:r})=>r.searchHistory?"loading"===t?h(r.searchHistory,"search-history-arrival",{suggestGroup:"history"}):"ready"===t?e:null:null],or:{sid:"6s50rcil",name:"$searchHistorySuggestGroup"}}),tm=(0,g.combine)({and:[{group:tg,status:tc,labels:eE},({group:e,status:t,labels:r})=>r.searchHistory?"loading"===t?h(r.searchHistory,"search-history-departure",{suggestGroup:"history"}):"ready"===t?e:null:null],or:{sid:"3nrkxwmv",name:"$departureSearchHistorySuggestGroup"}});(0,g.sample)({and:[{clock:to,source:{accountId:m.$accountId,isAuthorized:m.$isAuthorized},filter:(e,t)=>tt(t).length>0,fn:({accountId:e,isAuthorized:t},r)=>({items:tt(r),syncToApi:t&&!!e}),target:tr.addSearchHistoryFx}],or:{sid:"3q8rh0hy"}}),(0,g.sample)({and:[{clock:tr.addSearchHistoryFx.done,filter:({result:e})=>e,target:[ta,ti]}],or:{sid:"3lcoc69"}}),e.s(["$departureSearchHistorySuggestGroup",0,tm,"$searchHistorySuggestGroup",0,tf,"initDepartureSearchHistory",0,ti,"initSearchHistory",0,ta,"searchHistorySaveRequested",0,to],899169);let ty=(0,f.createGate)({and:[],or:{sid:"2ajkkdif",name:"directionInputToGate"}}),th=(0,f.createGate)({and:[],or:{sid:"aao25ig5",name:"directionInputFromGate"}});(0,g.sample)({and:[{clock:ty.open,source:eE,filter:b,target:ek}],or:{sid:"b1l9svr"}}),(0,g.sample)({and:[{clock:ty.open,source:eE,filter:e=>b(e)&&!!e.searchHistory,target:ta}
1],or:{sid:"73oxmgou"}}),(0,g.sample)({and:[{clock:ty.open,source:eE,filter:e=>b(e)&&!!e.yourPreferences,target:eG}],or:{sid:"1ekf1fv5"}}),(0,g.sample)({and:[{clock:th.open,source:eE,filter:e=>b(e)&&!!e.searchHistory,target:ti}],or:{sid:"69sr04v0"}}),(0,g.sample)({and:[{clock:th.open,source:eE,filter:e=>b(e)&&!!e.yourPreferences,target:eO}],or:{sid:"a2sg0rb7"}}),(0,g.sample)({and:[{clock:th.open,source:eE,filter:e=>b(e)&&!!e.nearYou,target:eM}],or:{sid:"3fhn7gaz"}}),(0,g.sample)({and:[{clock:eE,source:th.status,filter:(e,t)=>e&&b(t)&&!!t.nearYou,target:eM}],or:{sid:"5nu0xvgp"}}),e.s(["directionInputFromGate",0,th,"directionInputToGate",0,ty],980975)},577641,423246,e=>{"use strict";let t="ANYW";e.s(["ANYWHERE_CODE",0,t],577641),e.i(924856);var r=e.i(554913),a=e.i(992546);e.i(428733);let i=(0,e.i(204241).createEffect)(async({language:e,isKpb:i,searchType:o,departureLocation:s,withoutCountriesOptions:n,labels:l,withAnywhere:c})=>{let u=await (0,r.fetchSuggestLocation)({query:"",language:e,isKpb:i,searchType:o,suggestTarget:"arrival",departureLocation:s}),d=(0,a.mapSuggestLocationToGroupedOptions)(u,{withoutCountriesOptions:n,groupLabels:{cities:l.popularCities,countries:l.popularCountries},includeRailway:i});return c?[{label:"",options:[{id:"anywhere",type:"anywhere",label:l.anywhere,sublabel:l.anywhereSublabel,code:t,cityName:"",countryName:""}]},...d]:d},{sid:"9bglfsgs",name:"fetchPopularDestinationsFx"});e.s(["fetchPopularDestinationsFx",0,i],423246)},992546,e=>{"use strict";var t=e.i(485785);function r(e){if(e&&!(e.length<2))return{latitude:e[0],longitude:e[1]}}function a(e){return e.country_name??e.country?.name??e.city?.country?.name??""}function i(e,t){return t?.code??e.country?.code??e.city?.country?.code??""}function o(e,t,a){let i=e.name;return{id:`city-${e.code}`,type:"city",label:i,sublabel:e.code,code:e.code,cityName:i,countryName:a,city:{code:e.code,name:i,countryCode:t,coordinates:r(e.coordinates)}}}function s(e,t,a,i,o,s,n){return{id:`railway-${e}`,type:"railway",label:t,sublabel:e,code:e,cityName:i,countryName:s,railway:{code:e,name:t,cityCode:a,cityName:i,countryCode:o,coordinates:r(n)}}}function n(e,t){return{id:`country-${e}`,type:"country",label:t,sublabel:"",code:e,cityName:"",countryName:t,country:{code:e,name:t}}}function l(e){return n(e.code,e.name)}function c(e,r){return!r&&(0,t.isRailwayLocationCode)(e)}function u(e,n,l){if(c(e.code,l))return;let u=a(e),d=i(e),p=e.name,g=e.anyports??[];if(l&&(0,t.isRailwayLocationCode)(e.code)&&0===g.length)return void n.push(s(e.code,e.name,e.code,e.name,d,u,e.coordinates));for(let t of(n.some(t=>t.code===e.code&&"city"===t.type)||n.push(o(e,d,u)),g)){if("airport"===t.kind){var f;n.push((f=e.code,{id:`airport-${t.code}`,type:"airport",label:t.name,sublabel:t.code,code:t.code,cityName:p,countryName:u,airport:{iataCode:t.code,name:t.name,cityCode:f,cityName:p,countryCode:d,coordinates:r(t.coordinates)}}));continue}l&&"railway_station"===t.kind&&n.push(s(t.code,t.name,t.city?.code??e.code,t.city?.name??p,t.city?.country?.code??d,t.city?.country?.name??u,t.coordinates))}}e.s(["mapSuggestLocationToGroupedOptions",0,function(e,t={}){let{includeRailway:r=!0,withoutCountriesOptions:o=!1,groupLabels:s,preferExplicitCountriesFirst:c=!1}=t,d=[],p=[],g=new Set,f=e.locations.some(e=>"country"===e.kind);for(let t of e.locations){if("country"===t.kind){!o&&f&&p.length<3&&!g.has(t.code)&&(p.push(l(t)),g.add(t.code));continue}"city"===t.kind&&(u(t,d,r),o||f||function(e,t,r){if(t.length>=3)return;let o=i(e),s=a(e);!o||!s||r.has(o)||(t.push(n(o,s)),r.add(o))}(t,p,g))}let m=[],y={label:s?.cities??"",options:d},h={label:s?.countries??"",options:p};return c&&f?(p.length>0&&m.push(h),d.length>0&&m.push(y)):(d.length>0&&m.push(y),p.length>0&&m.push(h)),m},"mapSuggestLocationToOptions",0,function(e,t={}){let{includeRailway:r=!0,citiesOnly:s=!1,withoutCountriesOptions:n=!1}=t;if(s){let t=[];for(let r of e.locations){if("city"!==r.kind||c(r.code,!1))continue;let e=a(r),s=i(r);t.some(e=>e.code===r.code&&"city"===e.type)||t.push(o(r,s,e))}return t}let d=[],p=[],g=new Set,f=e.locations.some(e=>
1"country"===e.kind);for(let t of e.locations){if("country"===t.kind){!n&&f&&p.length<3&&!g.has(t.code)&&(p.push(l(t)),g.add(t.code));continue}"city"===t.kind&&u(t,d,r)}return p.length>0?[...p,...d]:d}])},387792,e=>{"use strict";let t=/^[A-Z]{3}$/,r=/^\d{7}$/,a=/^Rzd:(\d{7})$/;function i(e){let i=e.trim();if(!i)return;let o=i.match(a);return o?.[1]?o[1]:r.test(i)||t.test(i)?i:void 0}e.s(["resolveSuggestContextLocationCode",0,function(e){if(e&&"anywhere"!==e.type){if("airport"===e.type){let t=e.airport?.cityCode??e.city?.code??void 0;return t?i(t):void 0}if("railway"===e.type){let t=e.railway?.cityCode??e.city?.code;if(t&&t!==e.code)return i(t)}return i(e.code)}}])}]);

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.