1import{rdbkMainUrl as c,rdbkMain as n,onboardingLoader as s,onboardingHomescreen as w,onboardingPeriods as b,qrcodeModal as a,choiceModal as r,officesModal as l,redirectButton404 as f,playlistWrapper as h}from"woody_addon_roadbook_elements";function t(e){if(n&&n.classList.add("hide"),s&&s.classList.add("hide"),w&&w.classList.add("hide"),b&&b.classList.add("hide"),a&&a.classList.add("hide"),r&&r.classList.add("hide"),l&&l.classList.add("hide"),e=="main")n!==null&&n.classList.remove("hide");else if(e=="loader")s!==null&&s.classList.remove("hide"),h!==null&&window.dispatchEvent(new Event("load"));else if(e=="periods")t("main");else if(e=="homescreen")window.location.search.indexOf("preview=")!=-1?t("main"):(localStorage.getItem("rdbk_homescreen")==="true"||w==null,t("periods"));else if(e=="qrcode"&&a)a.classList.remove("hide");else if(e=="choice"&&r)r.classList.remove("hide");else if(e=="offices"&&l)l.classList.remove("hide");else if(e=="404"&&f){const o=g();o?f.href=`${c}/r/${o}`:f.href=c}const i=new CustomEvent("showStep",{detail:{step:e}});document.dispatchEvent(i)}function g(){let e=null;const i=new URL(window.location.href),o=new URLSearchParams(i.search);if(o.has("preview"))return null;if(window.globals&&window.globals.rdbk&&window.globals.rdbk.id)e=window.globals.rdbk.id;else if(o.has("rdbk_id")&&o.get("rdbk_id").trim()!==""&&/^#([A-Za-z0-9]{6})$/.test(o.get("rdbk_id").trim()))e=o.get("rdbk_id").trim();else if(/^#([A-Za-z0-9]{6})$/.test(window.location.hash))e=window.location.hash.split("#")[1];else if(localStorage.getItem("rdbk_id")){if(e=localStorage.getItem("rdbk_id"),window.globals.post_type&&window.globals.post_type=="woody_rdbk_feeds")return window.location.href=window.location.origin+window.location.pathname+"?rdbk_id="+e,!1}else if(window.globals&&window.globals.rdbk&&window.globals.rdbk.feed_id)return m(),!1;return e&&localStorage.setItem("rdbk_id",e),e}function p(e){fetch(window.origin+"/wp-json/woody/roadbook/"+e,{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"}}).then(function(i){i.ok?i.json().then(o=>{if(o.metadata&&o.metadata.trip&&o.metadata.trip.period){const d=o.metadata.trip.period;sessionStorage.setItem("date_globals",JSON.stringify([{data:{start:d.from,end:d.to},date:new Date().toISOString()}]))}t("homescreen")}):console.error("Fetch getRdbkAndInit")}).catch(function(i){localStorage.removeItem("rdbk_id"),console.error("Fetch getRdbkAndInit : "+i.message)})}function m(){window.globals&&window.globals.rdbk&&window.globals.rdbk.feed_id&&fetch("/wp-json/woody/roadbook/create",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({id:window.globals.rdbk.feed_id})}).then(function(e){e.ok?e.json().then(i=>{const o=i.content.split("/"),d=o[o.length-1];localStorage.setItem("rdbk_id",d),window.globals.post_type&&window.globals.post_type=="woody_rdbk_feeds"?window.location.href=c+"/r/"+d:window.location.reload()}):console.error("Fetch createRdbkID")}).catch(function(e){console.error("Fetch createRdbkID : "+e.message)})}export{p as getRdbkAndInit,g as getRdbkID,t as showStep};
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.