1"use strict";(self.webpackChunktrux_common=self.webpackChunktrux_common||[]).push([[4702],{14702:function(t,e,s){s.r(e);var a=s(52891);e.default=class extends a.xI{static VDP_PATH_REGEXP=/\/(?:new|used)\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+\/[un]\d{4,}/;connect(){this.requestSeq=0,this.installUrlWatcher()}disconnect(){this.removeUrlWatcher()}installUrlWatcher(){this.lastPath=window.location.pathname,this.popHandler=()=>this.onUrlChanged(),window.addEventListener("popstate",this.popHandler),this.origPushState=history.pushState,this.origReplaceState=history.replaceState;const t=this;history.pushState=function(...e){const s=t.origPushState.apply(this,e);return t.onUrlChanged(),s},history.replaceState=function(...e){const s=t.origReplaceState.apply(this,e);return t.onUrlChanged(),s}}removeUrlWatcher(){window.removeEventListener("popstate",this.popHandler),history.pushState=this.origPushState,history.replaceState=this.origReplaceState}onUrlChanged(){const t=window.location.pathname;t!==this.lastPath&&(this.lastPath=t,this.refresh())}isVdpPath(t){return this.constructor.VDP_PATH_REGEXP.test(t)}async refresh(){const t=window.location.pathname,e=++this.requestSeq;try{const s=await fetch(`/api/seo/markup-geo?path=${encodeURIComponent(t)}`,{headers:{Accept:"application/json"}});if(!s.ok)return;const a=await s.json();if(e!==this.requestSeq||!a.variant)return;this.patchMarkup(a.variant)}catch(t){}}patchMarkup(t){const e=this.findAutoDealerScript();if(!e)return;const{script:s,json:a}=e,n={"@type":"PostalAddress"};t.streetAddress&&(n.streetAddress=t.streetAddress),n.addressLocality=t.addressLocality,n.addressRegion=t.addressRegion,n.addressCountry=t.addressCountry,a.address=n,t.latitude&&t.longitude?a.geo={"@type":"GeoCoordinates",latitude:t.latitude,longitude:t.longitude}:delete a.geo,t.telephone&&a.contactPoint&&(a.contactPoint.telephone=[t.telephone]),s.textContent=JSON.stringify(a,null,4)}findAutoDealerScript(){for(const t of document.querySelectorAll('script[type="application/ld+json"]'))try{const e=JSON.parse(t.textContent);if(e&&"AutoDealer"===e["@type"])return{script:t,json:e}}catch(t){}return null}}}}]);
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.