1"use strict";(self.webpackChunktaggbaa=self.webpackChunktaggbaa||[]).push([[36],{9974:function(e,t,i){i.r(t),i.d(t,{setUp:function(){return l}});var n=i(4971),a=i(836),o=i(9480),r=i(5910);const s=new class{constructor(){this.dealerOem=""}initialize(e){this.dealerOem=e.dealerOem,this.setFpsEvents()}setFpsEvents(){window.FPS?.get([{VOIAggregateNameplate:{}}],{success:e=>this.handleVoiSuccess(e),error:e=>console.error("FPS VOI error:",e)})}handleVoiSuccess(e){const t=e[0]?.VOIAggregateNameplate;if(!t||0===t.length)return void this.hideElement(document.getElementById("voi-integration"));const i=t[0],{make:n,model:a,year:o,searchLink:r}=this.parseVoiData(i),s=this.buildDQLQuery(n,a,o),l=window.btoa(s);this.fetchInventory(l,r)}parseVoiData(e){const t=e._brand,i=e._year??"";let n="";if(-1===e._nameplate.indexOf(this.dealerOem))n=e._nameplate;else{const t=e._nameplate.indexOf(this.dealerOem);n=e._nameplate.substring(t+this.dealerOem.length).trim()}return{make:t,model:n,year:i,searchLink:`?Make=${t}&Year=${i}&Model=${n}`}}buildDQLQuery(e,t,i){let n=`Make='${e}'`;return i&&(n+=` and Year=${i}`),t&&(n+=` and Model='${t}'`),n}async fetchInventory(e,t){try{const i=await fetch(`/api/inventory/queryFps/?filter=${e}&encoded=true`);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const n=await i.json();window.vois=window.vois||[];for(const e of n)if(window.vois.push(e),3===window.vois.length){const e=document.getElementById("allResultsTab");if(e){const i=e.querySelector("a");i&&(i.href+=t)}break}this.updateWidgets()}catch(e){console.error("Error fetching VOI inventory:",e)}}updateWidgets(){window.vehiclesOfInterestWidget&&window.vehiclesOfInterestWidget.update(),window.fordVehiclesOfInterestOfferModelWidget&&window.fordVehiclesOfInterestOfferModelWidget.update()}hideElement(e){e&&(e.style.display="none")}};function l(e,t){const i=a.P.getPageDataFromScript();if(!i)return;const l=i.Dealer?.DealerCode,d=(window.DlronGlobal_ActiveOemProgram??"").trim().toLowerCase();!function(e,t){e?.action&&e?.year&&e?.make&&window.FPS.set([window.FPS.lib.ActionNameplateT3(e.year,e.make,`${e.make} ${e.model??""}`.trim(),t,window.FPS.actions[e.action])])}(e,l),t.pageType===n.k.Vdp?function(e){const t=(0,o.E)();window.FPS.set([window.FPS.lib.SpecificVehicleViewT3(t.vin,"DealerON",e,e,t.year,t.make,`${t.make} ${t.model}`,t.trim,window.location.href,window.FPS.actions.SVVSIT3)])}(l):t.pageType===n.k.Mrp?function(e,t){const i=(0,r.p)(e);i&&window.FPS.set([window.FPS.lib.ActionNameplateT3(i.year,i.make,`${i.make} ${i.model}`,t,window.FPS.actions.ViewPage)])}(i,l):t.pageType===n.k.Srp&&function(e,t,i){const n=e.PageData;if("new"!==n?.VehicleType||!n.Filters||!Object.keys(n.Filters).includes("Model"))return;const a=n.Filters.Year;let o;if(a){const e=a.split("-")[1];o=e?Number.parseInt(e):(new Date).getFullYear()}let r=n.Filters.Make;r&&(r=r.split(",")[0]??t);let s=n.Filters.Model;s&&(s=s.split(",")[0]??""),window.FPS.set([window.FPS.lib.ActionNameplateT3(o,r,`${r} ${s}`,i,window.FPS.actions.SIResultsT3)])}(i,d,l),i.Dealer?.IsVoiEnabled&&s.initialize({dealerOem:d})}}}]);
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.