PageSourceSearch

https://www.dfb.ch/_nuxt/oev-plus-quick-booking-widget.5OKpvtz_.js

js dfb.ch collected 2026-10-02 11:58:55 UTC 12,070 bytes, 1 lines download raw bytes

1import{Z as Ce,a3 as Ie,b7 as we,bz as Ke,c as y,r as T,d as Le,o as Fe,aD as Pe,N as V,O as $,K as a,a5 as j,U as O,P as Ve,aC as G,T as De,aP as Re,b8 as J,ch as Me,V as Ee,L as qe}from"./entry.BARHI1zD.js";import{u as Ue}from"./use-reactive-breakpoints.qFBd_-82.js";import{u as He,_ as Ne}from"./oev-plus-search-header.VppUIT-q.js";import{L as A}from"./loading-skeleton.V2GmS7N7.js";import{u as Oe}from"./use-package-availability.eRdy7S-y.js";import"./map-section-header.YTvdUHjE.js";import"./componentBase.vfA3eBuK.js";import"./client-only.N7BQUeU9.js";import"./duration.LiLOy6c8.js";import"./input-modal-mobile.P9TW_ton.js";import"./use-focus-trap.gDTl49OY.js";import"./is-element-visible._LEGGY8N.js";import"./generic-close-button.gD7KtU8B.js";import"./navigation-button.E2ILGJ_Y.js";import"./useScrollToKeepInView.c5N_mLqD.js";import"./spinner.14dMe1JC.js";import"./icon-svg.2JsGcs9G.js";import"./useKeyboardListNavigation.EO1R50aT.js";import"./Button.Vs7zN5AW.js";import"./generic-link.WmmkFWeP.js";import"./index.tsdXPcWo.js";import"./date-picker-input.p_Kw-jch.js";import"./disable-tab-focus.ZHWDX1ZR.js";import"./index.OnmhbFVy.js";import"./link-btn.hJ_ExG37.js";import"./input-switch.mIQM3sEN.js";import"./id.ZlnRo7l5.js";import"./base64.fWuH_12y.js";import"./browser-atob.76ejT264.js";const Ae=Ce({__name:"oev-plus-quick-booking-widget",props:{hideTimePicker:{type:Boolean},isInHero:{type:Boolean,default:!1},routingBase:{},showHeader:{type:Boolean,default:!1},title:{},widgetStyle:{},widgetLayout:{}},setup(r){const{public:w}=Ee(),{t:K}=Ie({useScope:"global"}),W=we(),{commit:i,dispatch:o,mapGetter:n}=Re(),s=Ke(),{breakpoints:Z}=Ue(),h=y(()=>!!r.routingBase.seoSlug&&r.routingBase.seoSlug!=="/"&&!r.routingBase.seoSlug.startsWith("gen-")&&!r.routingBase.seoSlug.endsWith("-gen")),{quickBookingWidgetClassName:X,setQuickBookingWidgetOffset:z}=He(),B=T({date:null,time:null}),D=T(!1),R=T({from:"",to:"",via:""}),l=T({from:{errorMsg:"",isLoading:!1},to:{errorMsg:"",isLoading:!1},via:{errorMsg:"",isLoading:!1}}),M=T(!0),d=n("places/getCurrentFromStation"),g=n("places/getCurrentFromStationId"),E=n("places/getCurrentFromStations"),c=n("places/getCurrentToStation"),S=n("places/getCurrentToStationId"),b=n("places/getCurrentToStations"),q=n("places/getCurrentViaStation"),v=n("places/getCurrentViaStationId"),ee=n("places/getCurrentViaStations"),Y=n("places/getDeepLink
1FromStation"),x=n("places/getDeepLinkToStation"),C=n("places/getFromDependentViaStations"),Q=n("places/getPlacesBySearchString"),te=n("places/searchHistory"),ae=n("places/getSearchStringByKey"),ie=n("places/loading"),p=n("places/getRoutingHasRoutes"),oe=Z.greaterOrEqual("768"),ne=y(()=>r.widgetLayout==="collapsed"?{unit:"px",value:h.value?140:194,mobileValue:{unit:"px",value:140}}:{unit:"px",value:h.value||r.hideTimePicker?263:333,mobileValue:{unit:"px",value:h.value||r.hideTimePicker?273:339}}),f=y(()=>n("places/routingBySlug").value(r.routingBase.seoSlug)),{availability:se,loadingPackageTravel:re,packageTravelProduct:_}=Oe(h.value,f),le=y(()=>!(p.value&&f.value.viaStations.length===0)),ue=y(()=>{if(_.value)return _.value.typeSpecific.rebatedServices.find(e=>e.type==="reservation")}),ce=y(()=>{const e=ue.value?.typeSpecific?.dateRestrictions?.to;return e?Le(e):s.latestDateToSearchInTheFuture}),de=y(()=>s.timezone);function I(e,t){i("places/addSearchHistoryEntry",{entry:e,fieldKey:t})}function k(){g.value===""&&E.value.length===1?U({autoSelect:!0,fromStation:E.value[0]}):g.value!==""&&v.value===""&&C.value.length===1?N({autoSelect:!0,viaStation:C.value[0]}):(g.value!==""&&v.value===""&&C.value.length===0&&S.value===""&&b.value.length===1||g.value!==""&&v.value!==""&&S.value===""&&b.value.length===1)&&H({toStation:b.value[0]})}function ge(){D.value=!0}function pe(){D.value=!1,l.value.via.errorMsg="",s.viaStation=null,o("places/setCurrentStation",{stationId:"",stationType:"via"}),i("places/setSearchStringByKey",{fieldKey:"station-via",value:""}),p.value&&o("places/setCurrentStation",{reloadStations:!0,stationId:"",stationType:"to"}).then(()=>{k()})}function Se(){return d.value||(l.value.from.errorMsg=K("oev_plus.routing.select_station_error")),!q.value&&D.value&&(l.value.via.errorMsg=K("oev_plus.routing.select_station_error")),c.value||(l.value.to.errorMsg=K("oev_plus.routing.select_station_error")),!!l.value.from.errorMsg||!!l.value.via.errorMsg||!!l.value.to.errorMsg}function U({autoSelect:e=!1,fromStation:t}){if(t?.id!==g.value)if(s.fromStation=t,o("places/setCurrentStation",{stationId:t?.id,stationType:"from"}),i("places/setSearchStringByKey",{fieldKey:"station-from",value:t?.title||""}),p.value){if(e)return k();o("places/setCurrentStation",{stationId:"",stationType:"via"}),i("places/setSearchStringByKey",{fieldKey:"station-via",value:""}),o("places/setCurrentStation",{reloadStations:!0,stationId:"",stationType:"to"}).then(()=>{k()}),i("places/setSearchStringByKey",{fieldKey:"station-to",value:""})}else t&&I(t,"station-from")}function H({toStation:e}){e?.id!==S.value&&(s.toStation=e,o("places/setCurrentStation",{stationId:e?.id,stationType:"to"}),i("places/setSearchStringByKey",{fieldKey:"station-to",value:e?.title||""}),!p.value&&e&&I(e,"station-to"))}function N({autoSelect:e=!1,viaStation:t}){if(t?.id!==v.value)if(s.viaStation=t,o("places/setCurrentStation",{stationId:t?.id,stationType:"via"}),i("places/setSearchStringByKey",{fieldKey:"station-via",value:t?.title||""}),p.value){if(e)return k();o("places/setCurrentStation",{reloadStations:C.value.length>1,stationId:"",stationType:"to"}).then(()=>{k()}),i("places/setSearchStringByKey",{fieldKey:"station-to",value:""})}else t&&I(t,"station-via")}function L({type:e,value:t}){R.value[e]=t}function ve(e){l.value[e].errorMsg=""}function fe({fieldKey:e,keepSearchString:t=!1}){const u=e.slice(8);switch(l.value[u].errorMsg="",t||i("places/setSearchStringByKey",{fieldKey:e,value:""}),e){case"station-from":U({autoSelect:!1,fromStation:null}),L({type:u,value:""});break;case"station-to":H({toStation:null}),L({type:u,value:""});break;case"station-via":N({autoSelect:!1,viaStation:null}),L({type:u,value:""});break}}function me(e){o("places/setCurrentStation",{stationId:"",stationType:e})}function ye({fieldKey:e,value:t}){i("places/setSearchStringByKey",{fieldKey:e,value:t})}async function he(){if(Se())return;const t={fromStation:g.value,fromStationName:d.value?.title||d.value?.name,viaStation:v.value!==""?v.value:void 0,viaStationName:q.value?.title||q.value?.name,toStation:S.value,toStationName:c.value?.title||c.value?.name,date:B.value.date?.format("YYYY-MM-DD"),time:B.value.time,type:s.type};if(w.WC_BUILD){J(W({path:r.routingBase.seoSlug!=="/"?`/routing/${r.routingBase.seoSlug}`:"/routing",query:t},w.WC_REDIRECTS.JAMES_BASE_URL));return}J(W({path:r.routingBase.seoSlug!=="/"?`/routing/${r.routingBase.seoSlug}`:"/routing",query:t}))}function ke(){const e=g.value;if(!p.value){if(d.value&&!d.value.isDeepLinkPlace&&I(d.value,"station-to"),
1c.value&&!c.value.isDeepLinkPlace&&I(c.value,"station-from"),d.value?.isDeepLinkPlace||c.value?.isDeepLinkPlace){const m=Y.value;i("places/setDeepLinkFromStation",x.value),i("places/setDeepLinkToStation",m)}s.switchFromToStation(),o("places/setCurrentStation",{stationId:S.value,stationType:"from"}),o("places/setCurrentStation",{stationId:e,stationType:"to"}),i("places/setSearchStringByKey",{fieldKey:"station-from",value:d.value?.title||""}),i("places/setSearchStringByKey",{fieldKey:"station-to",value:c.value?.title||""}),R.value={from:"",to:"",via:""};return}const t=S.value,u=f.value.fromStations.find(m=>m.id===t);if(!u){o("places/setCurrentStation",{stationId:"",stationType:"from"}),o("places/setCurrentStation",{reloadStations:!0,stationId:"",stationType:"to"}),o("places/setCurrentStation",{stationId:"",stationType:"via"});return}o("places/setCurrentStation",{stationId:u.id,stationType:"from"}),i("places/setSearchStringByKey",{fieldKey:"station-from",value:u?.title||""}),o("places/setCurrentStation",{stationId:"",stationType:"via"}),o("places/setCurrentStation",{reloadStations:!0,stationId:"",stationType:"to"}).then(()=>{if(b.value.find(m=>m.id===e)){o("places/setCurrentStation",{stationId:e,stationType:"to"}),i("places/setSearchStringByKey",{fieldKey:"station-to",value:c.value?.title||""});return}k()})}function Te({date:e,time:t}){B.value.date=e,B.value.time=t,s.date=e,s.time=t}const Be=Me(async({type:e,value:t})=>{if(L({type:e,value:t}),!t||t.length<3||Q.value(t))return;const u={searchString:t};w.ROUTERANK_PLACES_COUNTRY&&(u.country=w.ROUTERANK_PLACES_COUNTRY),l.value[e].isLoading=!0;const m=await o("places/loadPlaces",u);l.value[e].errorMsg=m?"":K("routing.station.not_found"),l.value[e].isLoading=!1},500);function be(e){s.type=e}const F=T(null);let P;return Fe(async()=>{P=new ResizeObserver(e=>{const t=e[0];z(t.target)}),F.value&&(z(F.value),P.observe(F.value)),i("places/syncLocalStorage"),s.reset(),i("places/resetSelectedStations"),await o("places/loadRoutingBySlug",r.routingBase.seoSlug),p.value&&(i("places/setFromStations",f.value.fromStations),i("places/setViaStations",f.value.viaStations),i("places/setToStations",f.value.toStations)),M.value=!1}),Pe(()=>{P&&P.disconnect()}),(e,t)=>(V(),$("div",{ref_key:"quickBookingWidget",ref:F,class:De([a(X),{"oev-plus-quick-booking-widget--has-background-image":e.widgetStyle==="Background Image","oev-plus-quick-booking-widget--is-in-hero":e.isInHero,"oev-plus-quick-booking-widget--timer-picker-visible":!a(h)&&!e.hideTimePicker}])},[a(M)?O("",!0):(V(),j(Ne,{key:0,"model-value":a(B),availability:a(se),"current-from-station":a(d),"current-from-station-id":a(g),"current-from-stations":a(E),"current-screen":"search","current-to-station":a(c),"current-to-station-id":a(S),"current-to-stations":a(b),"current-via-station-id":a(v),"current-via-stations":a(ee),"deep-link-from-station":a(Y),"deep-link-to-station":a(x),"disable-date-decrease":a(s).disableDateDecrease,"disable-date-increase":a(s).disableDateIncrease,"from-dependent-via-stations":a(C),"get-places-by-search-string":a(Q),"get-search-history-by-key":a(te),"get-search-string-by-key":a(ae),"hide-time-picker":e.hideTimePicker,"is-loading":a(ie),"is-quick-booking-widget":"","is-special-train":a(h),"is-timeline-visible":a(oe),"last-search-strings":a(R),"latest-date-to-search-in-the-future":a(ce),"places-search-fields":a(l),routing:a(f),"routing-has-routes":a(p),"search-query":a(s).searchQuery,"show-add-via-station-button":a(le),"show-header":e.showHeader,"show-switch-station-button":"",title:e.title,type:a(s).type,"loading-availability":a(re),timezone:a(de),"widget-layout":e.widgetLayout,onAddViaStationField:ge,onDeleteViaStationField:pe,onInputFromStation:U,onInputToStation:H,onInputViaStation:N,onResetPlacesSearchFieldError:ve,onResetSearchItem:fe,onSearch:he,onSearchStringChanged:me,onSetSearchStringByKey:ye,onSwitchStations:ke,"onUpdate:modelValue":Te,"onUpdate:places":a(Be),"onUpdate:type":be},null,8,["model-value","availability","current-from-station","current-from-station-id","current-from-stations","current-to-station","current-to-station-id","current-to-stations","current-via-station-id","current-via-stations","deep-link-from-station","deep-link-to-station","disable-date-decrease","disable-date-increase","from-dependent-via-stations","get-places-by-search-string","get-search-history-by-key","get-search-string-by-key","hide-time-picker","is-loading","is-special-train","is-timeline-visible","last-search-strings","latest-date-to-search-in-the-future","places-search-fields","routing","rout
1ing-has-routes","search-query","show-add-via-station-button","show-header","title","type","loading-availability","timezone","widget-layout","onUpdate:places"])),a(M)?(V(),$(Ve,{key:1},[G(A,{height:{unit:"px",value:34},type:"controls",width:{unit:"px",value:372}}),G(A,{height:a(ne),type:"controls",width:{unit:"%",value:100}},null,8,["height"]),e.widgetLayout!=="collapsed"?(V(),j(A,{key:0,height:{unit:"px",value:50},type:"buttons",width:{unit:"%",value:100}})):O("",!0)],64)):O("",!0)],2))}}),mt=qe(Ae,[["__scopeId","data-v-ce9714c4"]]);export{mt 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.