PageSourceSearch

https://www.prestonmazda.com/resources/components/dealerOnTrack/de….9.24a26a87f4c3be850232f857cc149210db453171

js prestonmazda.com collected 2026-10-04 13:30:12 UTC 6,333 bytes, 1 lines download raw bytes

1"use strict";var DealerOnTrack=(function(){function l(){}return Object.defineProperty(l,"safeGetAllTrackers",{get:function(){return typeof ga<"u"&&(ga!=null&&ga.getAll)?ga.getAll():(function(){return console.warn("'ga.getAll' is not defined"),null})()},enumerable:!1,configurable:!0}),l.initialize=function(e){this.isNoOp=e.IsNoOp,window.addEventListener("DOMContentLoaded",function(){var t=document.querySelectorAll("[data-dealerontrack-type]");t.forEach(function(r){l.setupEventByType(r)}),console.log("DealerOnTrack Initialized");var a=document.querySelectorAll(".priceBlockItemButton > a, .priceBlockItemOffer > a, .priceBlockItemInput > a, .priceBlockItemButton > price-details-button > a, .priceBlockItemButton > button, .priceBlockItemInput input-button-price-element.btn");a.forEach(function(r){r.dataset.dealerontrackType||r.addEventListener("click",function(n){var i=r.closest("li"),o=i===null?"":i.dataset.dealerontrackPosition,c=r.closest(".srpVehicle, .vehicle-card")!==null;l.pricingStackEvent(n,o,c?"SRP":"VDP")})})})},l.setupDynamicElements=function(){var e=document.querySelectorAll("[data-dealerontrack-type]:not([data-dealerontrack-enabled])");e.forEach(function(t){l.setupEventByType(t)})},l.setupEventByType=function(e){var t=this,a,r,n,i,o,c=(a=e.dataset.dealerontrackType)!==null&&a!==void 0?a:"default",s=e.dataset.dealerontrackCategory,u=(r=e.dataset.dealerontrackAction)!==null&&r!==void 0?r:"",f=(n=e.dataset.dealerontrackLabel)!==null&&n!==void 0?n:"",g=(i=e.dataset.dealerontrackValue)!==null&&i!==void 0?i:"",k=(o=e.dataset.dealerontrackItem)!==null&&o!==void 0?o:"",h=e.dataset.dealerontrackCallback,m=e.dataset.dealerontrackTrigger;e.dataset.dealerontrackEnabled!=="true"&&(m==="change"?e.addEventListener(m,function(){var v,d;t.event(s,(d=(v=e.dataset.dealerontrackPosition)!==null&&v!==void 0?v:new TaggingCommandParser(e.dataset.dealerontrackAction).Value)!==null&&d!==void 0?d:"On Click",new TaggingCommandParser(f).Value,g,h)}):c==="pricingStack"?e.addEventListener("click",function(v){t.pricingStackDataAttributesEvent(u,g,s,k,f)}):e.addEventListener("click",function(v){var d,p;t.event(s,(p=(d=e.dataset.dealerontrackPosition)!==null&&d!==void 0?d:new TaggingCommandParser(e.dataset.dealerontrackAction).Value)!==null&&p!==void 0?p:"On Click",new TaggingCommandParser(f).Value,g,h)}),e.dataset.dealerontrackEnabled="true")},l.event=function(e,t,a,r,n){if(this.isNoOp){n&&n(t);return}var i=!1;n&&setTimeout(function(){i||(i=!0,console.log("DealerOnTrack callBack function on timeout"),n(t))},3e3);var o=0,c=this.safeGetAllTrackers;if(c){if(a===void 0)for(var s=0;s<c.length;s++){var u=c[s];n?(ga(""+u.get("name")+".send","event",e,t,{hitCallback:function(){o=o+1,c.length==o&&!i&&(i=!0,console.log("DealerOnTrack hitCallback called!"),n(t))}}),console.log("ga send event called!")):ga(""+u.get("name")+".send","event",e,t)}else if(r===void 0||r==="")for(var s=0;s<c.length;s++){var u=c[s];n?(ga(""+u.get("name")+".send","event",e,t,a,{hitCallback:function(){o=o+1,c.length==o&&!i&&(i=!0,console.log("DealerOnTrack hitCallback called!"),n(t))}}),console.log("ga send event called!")):ga(""+u.get("name")+".send","event",e,t,a)}else for(var s=0;s<c.length;s++){var u=c[s];n?(ga(""+u.get("name")+".send","event",e,t,a,r,{hitCallback:function(){o=o+1,c.length==o&&!i&&(i=!0,console.log("DealerOnTrack hitCallback called!"),n(t))}}),console.log("DealerOnTrack ga send event called!")):ga(""+u.get("name")+".send","event",e,t,a,r)}console.log("Fired DealerOnTrack.event(".concat(e,", ").concat(t,", ").concat(a,", ").concat(r,", ").concat(n,")"))}},l.pricingStackEvent=function(e,t,a){if(!this.isNoOp){var r=t||window.location.href,n=e.target||e.currentTarget||e.toElement,i=n.dataset.elementtype==="LinkButton"&&n.classList.contains("callNowClass"),o=i?"Click-to-Call":"VDP/SRP Buttons",c=n.target==="_blank"?"Open in new Tab - ":"",s=n.innerText||n.title||n.alt,u="".concat(a," - ").concat(c).concat(i?"Call for Details":s);this.event(o,r,u)}},l.pricingStackDataAttributesEvent=function(e,t,a,r,n){if(!this.isNoOp){var i=e||window.location.href,o="".concat(t," - ").concat(r," - ").concat(n);this.event(a,i,o)}},l.isNoOp=!1,l})(),TaggingCommand=(function(){function l(e){this.supportedCommands=["selector","script","literal"],this.supportedScripts=["geturl"],this.parseCommand(e)}return l.prototype.parseCommand=function(e){var t=e.split("::");if(this.command=t[0],t.length>1){var a=t[1].split(",");this.primaryInstruction=a[0],a.length>1&&(this.secondaryInstruction=a[1])}if(t.length>2){var r=t[2].split(",");this.defaultInstruction=r[0],r.length>1&&(this.defaultSecondaryInstruction=r[1])}},Object.defineProperty(l.prototype,"IsValid",{get:function(){if(!this.command||!this.primaryInstruction||this.command=="script"&&!this.supportedScripts.includes(this.primaryInstruction))return!1;var e=this.supportedCommands.includes(this.command);return e}
1,enumerable:!1,configurable:!0}),l})(),TaggingCommandParser=(function(){function l(e){this.commands=[],this.isParsable=!1,this.item=e,this.parseCommands(e)}return l.prototype.parseCommands=function(e){var t=this,a=e.split("|");a.forEach(function(r){var n=new TaggingCommand(r);n.IsValid&&t.commands.push(n)}),this.commands.length>0&&(this.isParsable=!0)},Object.defineProperty(l.prototype,"Value",{get:function(){var e=this;if(!this.isParsable)return this.item;var t="";return this.commands.forEach(function(a){switch(a.command){case"selector":{var r=e.getElementValue(a.primaryInstruction,a.secondaryInstruction);!r&&a.defaultInstruction&&(r=e.getElementValue(a.defaultInstruction,a.defaultSecondaryInstruction)),t+=r;break}case"literal":t+=a.primaryInstruction;break;case"geturl":t+=window.location.href;break}}),t||this.item},enumerable:!1,configurable:!0}),l.prototype.getElementValue=function(e,t){var a=this,r=document.querySelectorAll(e),n=[];return r.forEach(function(i){var o,c,s,u;if(t)t?.startsWith("data-")?u=i?.getAttribute(t):u=a.getElementValue(t);else if(i instanceof HTMLSelectElement){var f=(o=i[i.selectedIndex])===null||o===void 0?void 0:o.innerText;f&&(u=f)}else u=(s=(c=i.value)!==null&&c!==void 0?c:i.textContent)!==null&&s!==void 0?s:i.innerText;u&&n.push(u.replace(/[\n\r]+/g,"").trim())}),n.length==0?"":n.join(",")},l})();try{module.exports={TaggingCommand,TaggingCommandParser}}catch{console.warn("module is not defined")}

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.