PageSourceSearch

https://www.eastcoastcars.net/static/assets/libraries/ddc-js-api/1.12.8/lib.js

js eastcoastcars.net collected 2026-09-24 12:19:29 UTC 84,183 bytes, 2 lines download raw bytes

1!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function t(t,i){return function(e){if(Array.isArray(e))return e}(t)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,a,o,r,s=[],l=!0,d=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){d=!0,a=e}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(d)throw a}}return s}}(t,i)||function(t,i){if(t){if("string"==typeof t)return e(t,i);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,i):void 0}}(t,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const i=e=>{let t=e;return t=t.replace(/^(tps-)/,""),t=t.replace(/^(cst-parse-)/,""),t=t.replace(/^(cst-)/,""),t=t.replace(/^(cw-)/,""),t},n=e=>{if(!e)return"Undefined";const t=["Web Integration API","Third Party Services API Full","Third Party Services API Compatible","Third Party Services API Hybrid","Third Party Services Velocity","Custom Work (cms-sites)"];return t.includes(e)?e:"wise"===e.toLowerCase()?t[0]:"api"===e.toLowerCase()?t[1]:"api_compatible"===e.toLowerCase()?t[2]:"hybrid"===e.toLowerCase()||e.startsWith("tps")?t[3]:"legacy"===e.toLowerCase()?t[4]:"custom"===e.toLowerCase()||e.startsWith("cw")||e.startsWith("cst")?t[5]:"Undefined"},a=e=>e&&"0"!==e&&"PLEASE_CALL"!==e&&parseInt(("number"==typeof e?String(e):e).replace(" ","").replace(" ","").replace("$","").replace(",","").trim(),10)||0,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ",i=e.toLowerCase();i=i.split(t);for(let e=0;e<i.length;e++)i[e]=i[e].charAt(0).toUpperCase()+i[e].slice(1);return i.join(" ")},r="data-location",s="Insert",l="Insert Call To Action",d="Modify Call To Action",c="Modify Links On Page",u="primary-banner",h="Restrictively Modify Call To Action",p="Update",g="vehicle-badge",v="vehicle-ctas",m="vehicle-media",y="vehicle-payments",w="vehicle-pricing",f=`${g}-custom`,b=`${v}-custom`,P=`${m}-custom`,C=`${y}-custom`,I=`${w}-custom`,D=["mywallet","toyota-smartpath-banners"],E=["cox-dr-sales-checkin"],A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e3;return new Promise((i,n)=>{const a=document.querySelector(e);if(a)return i(a);let o;const r=setTimeout(()=>{o&&o.disconnect(),n(new Error(`Element with selector "${e}" not found within ${t}ms`))},t);o=new MutationObserver((t,n)=>{const a=document.querySelector(e);a&&(clearTimeout(r),n.disconnect(),i(a))}),o.observe(document.documentElement,{childList:!0,subtree:!0})})},L=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t="mobile-navbar/open",i=[".ddc-mobile-fragment-nav",'[data-location~="primary-menu"]'];return new Promise(n=>{if((()=>{var e;const t=null===(e=document.querySelector(".ddc-document"))||void 0===e?void 0:e.classList;return null==t?void 0:t.contains("active")})())Promise.race(i.map(e=>A(e,1e4))).then(()=>n(!0)).catch(()=>n(!1));else{var a;if(null===(a=window.DDC)||void 0===a||null===(a=a.pubsub)||void 0===a||!a.subscribe)return void n(!1);let o;const r=async()=>{o&&clearTimeout(o),Promise.race(i.map(e=>A(e,1e4))).then(()=>{var e;n(!0),null===(e=window.DDC)||void 0===e||null===(e=e.pubsub)||void 0===e||e.unsubscribe(t,r)}).catch(()=>n(!1))};e&&(o=setTimeout(()=>{var e;null===(e=window.DDC)||void 0===e||null===(e=e.pubsub)||void 0===e||e.unsubscribe(t,r),n(!1)},e)),window.DDC.pubsub.subscribe(t,r)}})},T=()=>new Promise(e=>{"loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e,{once:!0})}),S=async()=>{var e,t,i;return t=null===(e=window.DDC)||void 0===e||null===(e=e.PrivateAPI)||void 0===e?void 0:e.integrationsLoaded,i="WIAPILoaded",new Promise(e=>{!1!==t&&void 0!==t?e(t):window.addEventListener(i,t=>{e(t)},{once:!0})})},$=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15e3;return new Promise((n,a)=>{let o;const r=setTimeout(()=>{var t,n;((null===(t=window)||void 0===t?void 0:t.clearInterval)||(null===(n=global)||void 0===n?void 0:n.clearInterval)||(()=>{}))(o),a(new Error(`Timed out after ${i}ms waiting for ${e} to become available`))},i);o=setInterval(()=>{var t,i,a,s;const l=e.split(".");let d=window;l.every(e=>void 0!==d[e]&&(d=d[e],!0))&&(((null===(t=window)||void 0===t?void 0:t.clearInterval)||(null===(i=global)||void 0===i?void 0:i.clearInterval)||(()=>{}))(o),((null===(a=window)||void 0===a?void 0:a.clearTimeout)||(null===(s=global)||void 0===s?void 0:s.clearTimeout)||(()=>{}))(r),n(!0))},t)})},k=()=>{const e=window.DDC.siteSettings,t=e.accountId,i=void 0===t?"":t,n=e.siteId,a=void 0===n?"":n,o=e.defaultDomain,r=void 0===o?"":o,s=window.DDC.dataLayer.page,l=s.pageInfo,d=l.pageName,c=void 0===d?"":d,u=l.pagePath,h=void 0===u?"":u,p=s.attributes.locale;
1return{account:i,siteId:a,defaultDomain:r,pageName:c,pagePath:h,locale:void 0===p?"":p}},x=(e,t)=>{if(100*Math.random()<=5&&window.newrelic){const a=t;"Failed"!==a.status&&(a.status="Success"),window.newrelic.addPageAction("WebIntegrationEvent",{integrationId:i(e.integrationId),integrationType:n(e.integrationType),integrationCategory:e.integrationCategory||"",placesInventoryContent:e.placesInventoryContent||!1,...a,...k()})}},O=e=>{const t=`${e}=`,i=document.cookie.split(";");for(let e=0;e<i.length;e++){let n=i[e];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return null};let j;const N=async()=>{if(!Object.keys(window.DDC.dataLayer).length||!Object.keys(window.DDC.siteSettings).length)throw new Error("DDC DataLayer is not defined. Aborting Web Integration API.");if(!j){var e;const t=window.DDC.dataLayer.page,i=t.pageInfo,n=t.attributes,a=window.DDC.dataLayer.site,o=a.design,r=a.franchises,s=window.DDC.siteSettings,l=null==i?void 0:i.isVlp,d=null==i?void 0:i.isVdp,c=null==i?void 0:i.isHomepage,u=null===(e=document.querySelector('link[rel="canonical"]'))||void 0===e?void 0:e.href,h=(null==i?void 0:i.pageUrl)||"";j={accountId:s.accountId||"",siteId:s.siteId||"",defaultDomain:s.defaultDomain||"",indexPage:c,searchPage:l,detailPage:d,pageName:i.pageName||"",layoutType:n.layoutType||"",locale:n.locale||"",pageUrl:h,childSiteUrl:u!==h?u:"",design:o,franchises:r,ga_clientId:O("_ga")||"",ga_visitorId:O("_gid")||""}}return j};var M,U,F,R;const q=null===(M=window)||void 0===M||null===(M=M.DDC)||void 0===M||null===(M=M.Flags)||void 0===M?void 0:M["wiapi-fetch-priority-js"],_=null===(U=window)||void 0===U||null===(U=U.DDC)||void 0===U||null===(U=U.Flags)||void 0===U?void 0:U["wiapi-fetch-priority-css"],W={fetchPriorityJS:!(!q||"false"===q)&&q,fetchPriorityCSS:!(!_||"false"===_)&&_,inlinePrimaryBanner:(null===(F=window)||void 0===F||null===(F=F.DDC)||void 0===F||null===(F=F.Flags)||void 0===F?void 0:F["wiapi-inline-primary-banner"])||!1,onlyCoxIntegrations:(null===(R=window)||void 0===R||null===(R=R.DDC)||void 0===R||null===(R=R.Flags)||void 0===R?void 0:R["enabled-wise-tps-integration-list"])||""},V=new Set,J=(e,t)=>(t||document).querySelector(e),z=(e,t)=>{const i=t||document;return Array.from(i.querySelectorAll(e))},H=async e=>{if("function"!=typeof e.querySelectorAll)return;const t=await N();var i;if("desktop"===t.layoutType){if(null!==(i=window.DDC)&&void 0!==i&&null!==(i=i.modules)&&void 0!==i&&i.dialog&&!window.DDC.modules.dialog.active&&jQuery(document).trigger("modulesRefresh",{modules:{dialog:window.DDC.modules.dialog}}),window.DDC.modules&&window.DDC.modules.popover){z('[data-toggle="popover"]',e).forEach(e=>{!0!==e.getAttribute("data-initialized")&&window.DDC.modules.popover.load(e)})}}else if("mobile"===t.layoutType){var n;if("function"==typeof(null===(n=window)||void 0===n||null===(n=n.DDC)||void 0===n||null===(n=n.mobile)||void 0===n||null===(n=n.slidein)||void 0===n?void 0:n.init)){const t=z('.dialog, [data-toggle="popover"]',e);t.length>0&&t.forEach(e=>{window.DDC.mobile.slidein.init(e)})}}},G=e=>window.DDC&&window.DDC.getUrlParams?(e&&x(e,{methodType:"getUrlParams",status:"Success"}),window.DDC.getUrlParams()):(e&&x(e,{methodType:"getUrlParams",status:"Failed"}),null),B=e=>{var t;const i=(null===(t=window)||void 0===t||null===(t=t.DDC)||void 0===t||null===(t=t.dataLayer)||void 0===t||null===(t=t.page)||void 0===t||null===(t=t.attributes)||void 0===t?void 0:t.locale)||"en_US";let n;return"object"==typeof e?n=e[i]?e[i]:e.en_US:"string"==typeof e&&(n=e),n},K=async()=>{var e;const t=null===(e=window)||void 0===e?void 0:e.DDC,i=t.InvData,n=t.dataLayer,a=t.PrivateAPI,o=t.WS;if(!i)return!1;const r=i.srpReady,s=null==o?void 0:o.state["ws-inv-data"];if(s&&!0!==(null==a?void 0:a.wsInvListingRendered))try{await $("DDC.PrivateAPI.wsInvListingRendered",100,1e4)}catch{}return i&&(!s||r)&&((e,t)=>{var i;const n=(null==e?void 0:e.inventory)||{},a=n.pageInfo,o=n.inventory;return o&&(null==a?void 0:a.totalCount)>=0&&(null==t||null===(i=t.vehicles)||void 0===i?void 0:i.length)===o.length})(i,n)},Y=()=>{var e;const t=window.DDC,i=t.InvData,n=t.dataLayer;return!i&&(null==n||null===(e=n.vehicles)||void 0===e?void 0:e.length)>=0&&!document.querySelector(".inventory-listing-grid .hproduct")},Q=()=>!!J(".inventory-listing-grid .hproduct"),X=()=>{var e;return null===(e=window)||void 0===e||null===(e=e.DDC)||void 0===e||null===(e=e.dataLayer)||void 0===e||null===(e=e.page)||void 0===e||null===(e=e.pageInfo)||void 0===e?void 0:e.isVdp},Z=()=>{var e;return null===(e=window)||void 0===e||null===(e=e.DDC)||void 0===e||null===(e=e.dataLayer)||void 0===e||null===(e=e.page)||void 0===e||null===(e=e.pageInfo)||void 0===e?void 0:e.isVlp},ee=()=>{var e;return Z()&&(null===(e=window)||void 0===e||null===(e=e.DDC)||void 0===e||null===(e=e.WS)||void 0===e?void 0:e.state["ws-inv-listing"])},te=async e=>!Z()&&!X()||new Promise(t=>{let i,n;const a=e=>{clearInterval(i),clearTimeout(n),t(e)};n=setTimeout(()=>a(!1),3e4),i=setInterval(async()=>{let t;"inv"===e?t=await K()||Y()||Q():"facet"===e&&(t=(()=>{var e;return(null===(e=window)||void 0===e||null===(e=e.DDC)||void 0===e||null===(e=e.InvData)||void 0===e||null===(e=e.facets)||void 0===e||null===(e=e.facets)||void 0===e?void 0:e.length)>0})()),t&&a(!0)},100)}),ie=()=>te("inv"),ne={passive:!0,once:!0,capture:!0},ae=function(e){var t;const i="object"==typeof e?e.integrationId:e;if(null!==(t=window)&&void 0!==t&&null!==(t=t.DDC)&&void 0!==t&&t.integrationLog){for(var n,a=arguments.length,o=new Array(a>1?a-1:0),r=1;r<a;r++)o[r-1]=arguments[r];null===(n=window)||void 0===n||null===(n=n.DDC)||void 0===n||n.integrationLog(i,...o)}},oe=()=>{const e=G();return e&&"debug"===e._integrationMode},re=()=>{const e=G();return e&&(oe()&&"trace"===e._integrationLogLevel||"trace"===e._integrationMode)};oe();const se=re(),le=["[data-location]",".ws-tps-placeholder",".ddc-content"],de=(e,t,i)=>{const n=i.querySelectorAll?i.querySelectorAll("a"):[];
1[i,...n].forEach(e=>{const t=e.getAttribute?e.getAttribute("href"):e.href;!t||t.startsWith("/")&&!t.startsWith("//")||e.setAttribute("rel","nofollow")});const a=(e=>{if(!e)return 0;let t,i,n=0;if(0===e.length)return n;const a=e.replace(/key=[0-9a-z%]+/gi,"").replace(/[^0-9a-z]/gi,"");for(t=0;t<a.length;t++)i=a.charCodeAt(t),n=(n<<5)-n+i,n|=0;return n})(i.outerHTML),s=t.closest("[data-location]").querySelectorAll(`[data-web-api-unique-hash="${a}"]`);return s.length>0?(ae(`Already inserted content for ${e.integrationId}. Skipping.`),s):(i.setAttribute("data-web-api-unique-hash",a),i.setAttribute("data-web-api-inserted",!0),i.addEventListener&&i.addEventListener("click",t=>{((e,t)=>{var i,n;if(!(e||t||null!==(i=window)&&void 0!==i&&null!==(i=i.DDC)&&void 0!==i&&i.fireTrackingEvent))return;const a=t.srcElement;let s=a;a.getAttribute("alt")||a.getAttribute("title")?s=a:a.closest("button")?s=a.closest("button"):a.closest("a")&&(s=a.closest("a"));let l=s.closest(`[${r}]`)?s.closest(`[${r}]`).getAttribute(r):"Unknown Location";"page-footer"===l&&(l="overlay-content");const d=s.getAttribute("aria-label")||s.textContent&&["BUTTON","A"].includes(s.tagName)?s.textContent:s.getAttribute("alt")||s.getAttribute("title")||"Third Party Content",c=null===(n=s.closest(".vehicle-card"))||void 0===n?void 0:n.getAttribute("data-uuid"),u={event:"thirdPartyUserEvent",product:e.integrationId,step:o(l.split(" ")[0],"-"),element:d,action:"clicked",result:"success",vehicleUuid:c};window.DDC.fireTrackingEvent(u)})(e,t)},ne),t.appendChild(i),t.classList&&t.classList.remove("hide","hidden"),H(t),le.forEach(e=>{const n=t.closest(e);n&&("primary-banner"===n.getAttribute("data-location")&&i.querySelector("img")&&i.querySelector("img").classList.add("align-center"),n.outerHTML&&n.outerHTML.includes("vehicle-media-container")&&(n.innerHTML="",n.appendChild(t)),n.classList.remove("hide","hidden"))}),x(e,{methodType:"Append",appendElement:i.tagName}),t)};class ce{constructor(e){this.name=e,this.getElements=this.getElements.bind(this),this.getMeta=this.getMeta.bind(this),this.isReady=this.isReady.bind(this)}async isReady(){return!0}async getElements(e){const t=`[data-location~="${this.name}"]`,i=null!=e&&e.uuid?document.querySelector(`[data-uuid="${e.uuid}"]`):document;if(!i)return[];const n=i.querySelectorAll(t);return 0===n.length&&se&&ae("WARNING",`The '${this.name}' location was targeted on this page but does not exist.`),n}async getConfig(){return{elementType:"div"}}prepareLocation(){return!0}getMeta(e){return null}}class ue extends ce{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.classes,n=void 0===i?"":i,a=t.elementType,o=void 0===a?"div":a,r=t.singleLocation,s=void 0!==r&&r,l=t.clearContent,d=void 0!==l&&l,c=t.placement,u=void 0===c?"default":c;super(e),this.options={classes:n,elementType:o,singleLocation:s,clearContent:d,placement:u}}async getConfig(){return this.options}getMeta(){return N()}}var he;const pe=["askingPrice","internetPrice","msrp","oemPriceMapHighMSRP","retailValue","salePrice"],ge=["accountId","address","autodataCaId","bodyStyle","certified","chromeId","classification","dealerCodes","doors","driveLine","engine","engineSize","exteriorColor","deliveryDateRange","fuelType","images","indexPosition","interiorColor","inventoryDate","inventoryType","make","model","modelCode","odometer","optionCodes","packageCode","priorityType","stockNumber","transmission","trim","uuid","vin"],ve=((null===(he=window.DDC)||void 0===he?void 0:he.dataLayer)||{}).additionalInventoryFields,me=void 0===ve?[]:ve,ye=(e,t)=>{if(t)return t;let i=e.toLowerCase();return"certified"===i||i.includes("pre")||i.includes("d'occasion")||"usado"===i?i="used":(i.includes("neuf")||"nuevo"===i)&&(i="new"),i},we=(e,t)=>"certified"===e||"true"===t||!0===t||!1,fe=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=e;return n.highestPrice=n.highestPrice||0,n.startingPrice=n.startingPrice||0,n.finalPrice=n.finalPrice||0,pe.forEach(e=>{const i=e.toLowerCase(),o=t[i]||t[e]||0,r=a(o);n[e]=r,r>n.highestPrice&&(n.highestPrice=r)}),n.startingPrice>n.highestPrice&&(n.highestPrice=n.startingPrice),n.finalPrice>n.highestPrice&&(n.highestPrice=n.finalPrice),0===n.finalPrice&&(n.startingPrice>0?n.finalPrice=n.startingPrice:n.highestPrice>0&&(n.finalPrice=n.highestPrice)),!n.startingPrice&&n.finalPrice&&(n.startingPrice=n.finalPrice),me.forEach(e
1=>{void 0!==t[e]&&(n[e]=t[e])}),i.reduce((e,i)=>({...e,[i]:!1!==t[i]&&(t[i]||"")}),n)},be=async e=>{if(!(await N()).searchPage||0===z(".inventory-listing-grid").length)return ae("INFO","Not a grid view inventory page. Skipping further inventory processing."),!1;return z("[data-uuid]").map(i=>{const n=i.dataset,o=[],r=J(".url",i),s=r&&r.href?r.href:"";let l=0,d=0,c=0;const u=z(".image-wrap img",i);if(u.length>0){const e=u[0];e.getAttribute("data-src")?o.push(e.getAttribute("data-src").split("?")[0]):e.src&&o.push(e.src.split("?")[0]),n.images=o}if(!n)return ae("INFO","Vehicle data not found. Aborting inventory events."),!1;if(i.querySelectorAll){const e=z(".detailed-pricing .value, .gv-pricing .value",i);let t=!1;e.forEach(e=>{if(null===e.offsetParent||e.parentElement.classList.contains("stackedConditionalRebate")||e.parentElement.classList.contains("stackedConditionalFinal"))return;const i=a(e.innerText);i&&(i>l&&(l=i),t||(d=i,t=!0),(e.parentElement.classList.contains("stackedFinal")||e.parentElement.classList.contains("finalPrice"))&&(c=i))})}const h="string"==typeof n.dealercodes?(e=>{const i=e.replace("{","").replace("}","").split(",").map(e=>e.split("=").map(e=>e.trim())).reduce((e,i)=>{let n=t(i,2),a=n[0],o=n[1];return e[a]=o,e},{});return i})(n.dealercodes):{},p="string"==typeof n.optioncodes?n.optioncodes.replace(/[[\]\s]/gi,"").split(","):[];const g=we(n.type,i.certified),v=ye(n.type,null),m={accountId:n.accountid||"",address:n.address||{},autodataCaId:n.autodatacaid||"",bodyStyle:n.bodystyle||"",certified:g,chromeId:n.chromeid||"",cityFuelEconomy:parseInt(n.cityfueleconomy,10)||0,classification:n.classification||"",dealerCodes:h,doors:n.doors||"",driveLine:n.driveline||"",engine:n.engine||"",engineSize:n.enginesize||"",deliveryDateRange:n.deliveryDateRange||"",exteriorColor:n.exteriorcolor||"",finalPrice:c,fuelType:n.fueltype||"",highwayFuelEconomy:parseInt(n.highwayfueleconomy,10)||0,highestPrice:l,images:o,interiorColor:n.interiorcolor||"",inventoryDate:n.inventorydate||"",inventoryType:v,link:s,make:n.make||"",model:n.model||"",modelCode:n.modelcode||"",odometer:parseInt(n.odometer,10)||0,oemSourcedMerchandisingStatus:n.oemSourcedMerchandisingStatus||"",optionCodes:p,packageCode:n.packagecode||"",packages:n.packages?n.packages:"",startingPrice:d,status:n.status?n.status.replace(/ /g,"_").toLowerCase():"",stockNumber:n.stocknumber||"",transmission:n.transmission||"",trim:n.trim||"",uuid:n.uuid||"",vin:n.vin||"",year:parseInt(n.year,10)||0};return fe(m,n,e)})},Pe=async function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];window.DDC.PrivateAPI=window.DDC.PrivateAPI||{},window.DDC.PrivateAPI.inventoryData=window.DDC.PrivateAPI.inventoryData||{},0===i.length&&i.push("default");const n=i.join("|").toString();return window.DDC.PrivateAPI.inventoryData[n]&&0!==window.DDC.PrivateAPI.inventoryData[n].length||("responsive"===e?window.DDC.PrivateAPI.inventoryData[n]=await(async e=>{var i,n;const o=(null===(i=window.DDC)||void 0===i||null===(i=i.dataLayer)||void 0===i?void 0:i.vehicles)||[],r=null!==(n=window.DDC)&&void 0!==n&&null!==(n=n.InvData)&&void 0!==n&&n.inventory?window.DDC.InvData.inventory.inventory:[],s=[...ge,...e],l={cityFuelEfficiency:"cityFuelEconomy",highwayFuelEfficiency:"highwayFuelEconomy"};return o.map(i=>{var n,o;const d={highestPrice:0,startingPrice:0,year:i.modelYear};s.forEach(e=>{if("certified"===e){const t=i.inventoryType;d[e]=we(t,i[e])}else if(void 0!==i[e]&&!d[e]){const t=i.inventoryType;d[e]="inventoryType"===e?ye(t,i.newOrUsed):i[e]}}),d.status=i.status?i.status.replace(/ /g,"_").toLowerCase():"",Object.entries(l).forEach(e=>{i[e[0]]&&(d[e[1]]=i[e[0]])}),void 0!==i.link&&(d.link=`${window.location.origin}${i.link}`),(void 0===d.optionCodes||1===d.optionCodes.length&&""===d.optionCodes[0])&&(d.optionCodes=[]),d.images&&d.images.length>0&&d.images[0].uri&&(d.images=[d.images[0].uri]);const c=t(r.filter(e=>e.uuid===d.uuid&&e),1)[0],u=(null==c||null===(n=c.pricing)||void 0===n?void 0:n.dPrice)||(null==c||null===(o=c.pricing)||void 0===o?void 0:o.dprice);let h=!1;
1return c&&u&&(Object.entries(u).forEach(e=>{if(e.length<2)return;const t=e[1],i=t.typeClass;if(i&&(pe.includes(i)||t.isFinalPrice)){const e="PLEASE_CALL"===t.value?0:a(t.value);e>0&&(e>d.highestPrice&&(d.highestPrice=e),pe.includes(i)&&(d[i]=e),t.isFinalPrice&&d.highestPrice>0&&d.highestPrice/3<e&&(d.finalPrice=e),!1===h&&(d.startingPrice=e,h=!0))}}),!d.finalPrice&&d.startingPrice&&(d.finalPrice=d.startingPrice)),fe(d,i,e)})})(i):"legacy"===e?window.DDC.PrivateAPI.inventoryData[n]=await(async e=>{var i;const n=await N();if(null===(i=window.DDC)||void 0===i||!i.dataLayer)return[];const o=window.DDC.dataLayer.vehicles||[],r=n.detailPage&&o.length>0?[o[0]]:z("[data-uuid]"),s=[...pe,"oemPriceMapHighMSRP","final-price","stackedFinal"];let l=[];return s.forEach(e=>{l.push(`.${e} .value`),l.push(`.${e} .price`),l.push(`.${e} .price-value`)}),l.push(".final-price .price"),l=l.join(", "),r.map(i=>{let r,d,c,u,h=[],p=0,g=0,v=i.uuid;if(n.detailPage)c=J(".ws-detailed-pricing, .inventory-detail-pricing"),r=`${window.location.origin}${window.location.pathname}`;else if(n.searchPage&&J(".hproduct",i)){c=J(".hproduct",i),v=i.getAttribute("data-uuid");const e=J(".url",c);e&&e.href&&(r=e.href)}if(c&&"string"==typeof c.dealerCodes&&(c.dealerCodes=JSON.parse(c.dealerCodes)),o.length>0){if(u=t(o.filter(e=>e.uuid===v&&e),1)[0],!u)return ae("INFO",`No data found in data layer for vehicle UUID ${v}. Skipping.`),!1}else c&&(u=c);u.address&&u.accountName&&(u.address.accountName=u.accountName),u.images&&u.images.length>0&&(h=u.images.map(e=>e.uri)),n.detailPage?d=z(l):n.searchPage&&c&&(d=z(l,c));let m=!1;d.length>0&&d.forEach(e=>{(e.parentElement&&e.parentElement.classList.length>0?Array.from(e.parentElement.classList):[]).forEach(t=>{if(s.includes(t)){const t=a(e.innerText);t&&!m&&(g=t,m=!0),(0===p||p>0&&p/3<t)&&(p=t)}})});const y=we(u.inventoryType,u.certified),w=ye(u.inventoryType,u.newOrUsed),f={accountId:u.accountId||"",address:u.address||{},autodataCaId:u.autodataCaId||"",bodyStyle:u.bodyStyle||"",certified:y,chromeId:u.chromeId||"",cityFuelEconomy:parseInt(u.cityFuelEfficiency,10)||0,classification:u.classification||"",dealerCodes:"string"==typeof u.dealerCodes?JSON.parse(u.dealerCodes):u.dealerCodes||{},doors:u.doors||"",driveLine:u.driveLine||"",engine:u.engine||"",engineSize:u.engineSize||"",deliveryDateRange:u.deliveryDateRange||"",exteriorColor:u.exteriorColor||"",finalPrice:p,fuelType:u.fuelType||"",highwayFuelEconomy:parseInt(u.highwayFuelEfficiency,10)||0,images:h,interiorColor:u.interiorColor||"",inventoryDate:u.inventoryDate||"",inventoryType:w,link:r,make:u.make||"",model:u.model||"",modelCode:u.modelCode||"",odometer:parseInt(u.odometer,10)||0,oemSourcedMerchandisingStatus:i.oemSourcedMerchandisingStatus||"",optionCodes:u.optionCodesOther&&u.optionCodesOther.length?u.optionCodesOther:u.optionCodes||[],packageCode:u.packageCode||"",packages:u.packages?u.packages:"",startingPrice:g,status:u.status?u.status.replace(/ /g,"_").toLowerCase():"",stockNumber:u.stockNumber||"",transmission:u.transmission||"",trim:u.trim||"",uuid:u.uuid||"",vin:u.vin||"",year:parseInt(u.modelYear,10)||0};return fe(f,u,e)})})(i):"grid"===e&&(window.DDC.PrivateAPI.inventoryData[n]=await be(i))),window.DDC.PrivateAPI.inventoryData[n]},Ce=async e=>(await ie(),await K()?Pe("responsive",e):Y()?Pe("legacy",e):Q()?Pe("grid",e):[]),Ie=async(e,t)=>{const i=await N();if(!i.searchPage&&!i.detailPage)return[];const n=await Ce(t);return e&&x(e,{methodType:"getVehicleData",status:"Success"}),n},De=async function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=[],a=ge.includes(t)?[]:[t];return(await Ce(a)).forEach(e=>{e[t]&&(0===i.length||i.includes(e.uuid))&&n.push(e[t])}),e&&x(e,{methodType:"getAttributeForVehicles",status:"Success"}),n};class Ee extends ue{async isReady(){return ie()}getMeta(e){return(async(e,t)=>{var i;const n=await N(),a=await Ce(t),o=(null===(i=window.DDC)||void 0===i||null===(i=i.dataLayer)||void 0===i?void 0:i.vehicles)||[],r=n.detailPage&&o.length>0?o[0].uuid:e.closest("[data-uuid]").getAttribute("data-uuid"),s=a.filter(e=>e.uuid===r&&e);return s.length>0?s[0]:null})(e)}}const Ae="vehicle-card-badge badge hidden";
1class Le extends Ee{async getConfig(){return{classes:`${Ae} m-3 p-0`,elementType:"li",gridSrpClasses:`${Ae} align-center m-0 p-3`,responsiveSrpClasses:`${Ae} m-2 py-3`,vdpClasses:`${Ae} align-center`}}}class Te extends ce{constructor(e){super(e),this.name=e}async isReady(){return ie()}async getConfig(){return{singleLocation:!0}}getMeta(){return N()}}class Se extends Ee{async getConfig(){return{classes:"badge m-0 mt-3",elementType:"li",gridSrpClasses:"badge m-0",placement:"first",responsiveSrpClasses:"m-0 mb-3 px-3",vdpClasses:"m-0"}}}const $e="listings-placeholder",ke="listings-ad",xe=Object.freeze({content:new ue("content"),"digital-retailing":new Ee("digital-retailing"),"facet-browse":new ue("facet-browse"),"header-toolbar":new class extends ce{async getConfig(){const e=await N(),t={elementType:"div"},i=document.querySelector(".responsive-centered-nav");return"desktop"===e.layoutType&&(t.classes="d-flex flex-column justify-content-center align-items-end navbar",i&&(t.classes=`${t.classes} m-4`)),t}prepareLocation(){const e=document.querySelector('\n\t\t\t[data-widget-id="template-navbar1"] .navbar-inner\n\t\t');if(!e)return;const t=e.querySelectorAll("\n\t\t\t.ddc-btn-nav,\n\t\t\tdiv.ddc-btn-wiapi\n\t\t");e.className=e.className.replace(new RegExp(/navbar-inner-count-\d/,"g"),""),e.classList.add(`navbar-inner-count-${t.length.toString()}`)}getMeta(){return N()}}("header-toolbar"),heading:new ue("heading"),"listing-filters":new Te("listing-filters"),"listings-placeholder-1":new Te(`${$e}-1`),"listings-placeholder-2":new Te(`${$e}-2`),"listings-placeholder-3":new Te(`${$e}-3`),"listings-placeholder-4":new Te(`${$e}-4`),"listings-placeholder-5":new Te(`${$e}-5`),"listings-ad-1":new Te(`${ke}-1`),"listings-ad-2":new Te(`${ke}-2`),"listings-ad-3":new Te(`${ke}-3`),"mobile-vdp-footer":new Ee("mobile-vdp-footer",{elementType:"li",clearContent:!0}),"primary-menu-top":new ue("primary-menu-top",{classes:"panel panel-default",elementType:"li",singleLocation:!0,placement:"first"}),"primary-menu-bottom":new ue("primary-menu-bottom",{classes:"panel panel-default",elementType:"li",singleLocation:!0}),"page-footer":new ue("page-footer"),"primary-banner":new class extends ce{constructor(e){super(e),this.name=e}isReady(){return ie()}getMeta(){return N()}}("primary-banner",{classes:"mt-3 px-4"}),"privacy-form":new ue("privacy-form",{clearContent:!0,singleLocation:!0}),"search-facet-pricing":new class extends ce{constructor(e){super(e||"search-facet")}async isReady(){return te("facet")}async getConfig(){return{classes:"facet m-0 mt-3",elementType:"div",responsiveSrpClasses:"m-0 mb-3 px-3",singleLocation:!0}}getMeta(){return N()}}("search-facet-pricing"),"secondary-content":new ue("secondary-content"),"site-text-search":new ue("site-text-search"),"vehicle-badge":new Le("vehicle-badge"),"vehicle-badge-custom":new Le("vehicle-badge-custom"),"vehicle-build-offer":new Ee("vehicle-build-offer",{classes:"mb-3"}),"vehicle-ctas":new Ee("vehicle-ctas",{classes:"mb-3"}),"vehicle-ctas-bottom":new Ee("vehicle-ctas-bottom",{classes:"mb-3"}),"vehicle-ctas-custom":new Ee("vehicle-ctas-custom",{classes:"mb-3"}),"vehicle-ctas-top":new Ee("vehicle-ctas-top",{classes:"mb-3"}),"vehicle-media":new Se("vehicle-media"),"vehicle-media-container":new Ee("vehicle-media-container"),"vehicle-media-custom":new Se("vehicle-media-custom"),"vehicle-payments":new Ee("vehicle-payments",{classes:"mb-3",singleLocation:!0}),"vehicle-payments-primary":new Ee("vehicle-payments-primary",{classes:"mb-3",singleLocation:!0}),"vehicle-payments-custom":new Ee("vehicle-payments-custom",{classes:"mb-3",singleLocation:!0}),"vehicle-pricing":new Ee("vehicle-pricing",{classes:"mb-3"}),"vehicle-pricing-custom":new Ee("vehicle-pricing-custom",{classes:"mb-3"}),"vehicle-pricing-digital-retailing":new Ee("vehicle-pricing-digital-retailing",{classes:"mb-3"})}),Oe=["ask","drive"],je=[],Ne=["x-time","schedule-service","quote-build","value-a-trade","payment-search","pre-approval"],Me={},Ue={};["chat","check-availability","delivery","digital-retailing","eprice","location-finder","payment-calculator","pre-approval","request-a-quote","reserve-it-now","send-to-phone","social","test-drive","text-us","value-a-trade","window-sticker"].forEach(e
1=>{const t=`vehicle-${e}-button`;Me[t]=new Ee(t)}),Oe.forEach(e=>{const t=`vehicle-${e}-button`;je.push(t),Ue[t]=new Ee(t)});const Fe=Object.freeze({...Me,...Ue}),Re=Object.keys(xe),qe=Object.keys(Me),_e=Object.keys(Ue),We=ee(),Ve=(e,t)=>("object"==typeof t&&Object.keys(t).forEach(i=>{i&&e.setAttribute(i,t[i])}),e),Je=(e,t,i)=>(t.classList.remove("hidden"),e.init&&e.init.integrationId&&t.setAttribute("data-modified-by",e.init.integrationId),t.setAttribute("data-content-source","Web Integration API"),e.targetLocation&&t.setAttribute("data-content-intent",e.targetLocation),e.destinationLocation&&t.setAttribute("data-content-destination",e.destinationLocation),i&&t.setAttribute("data-location",i),t),ze=function(e,t,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const o=!e.destinationLocation||!je.includes(e.destinationLocation);let r;t.closest(".ddc-mobile-header-nav")||t.closest('[data-location~="primary-menu"]')||t.closest(".mobile-menu")||t.closest(".ddc-mobile-header-sub-nav")||t.closest("#ddc-mobile-header-nav")||i.onclick?r=t:(r=t.parentNode?t.cloneNode(!0):t,t.parentNode&&t.parentNode.replaceChild(r,t));const s=B(i.text);if(i.href?r.href=i.href:i.src?r.href=i.src:(r.setAttribute("href","#"),r.removeAttribute("data-href")),i.style&&"string"==typeof i.style&&(r.style=i.style.trim()),n&&o&&(r.classList.add("btn","btn-block"),We&&r.classList.add("btn-sm"),r.classList.remove("btn-default","btn-primary")),i.imgSrc){r.innerHTML="";let e=document.createElement("img");e.src=i.imgSrc,e.alt=i.imgAlt?B(i.imgAlt):s,i.imgClasses&&(e.className=i.imgClasses),e=Ve(e,i.imgAttributes),r.appendChild(e)}else s&&(r.innerHTML=s,r.setAttribute("alt",s),n&&o&&("primary"===i.type||"text"===i.type?r.classList.add(`btn-${i.type}`):r.classList.add("btn-default")));if(i.onclick){if(r.dataset.wiapiProcessed)return r;const t=function(e){e.preventDefault();try{return i.onclick.call(this,e)}catch(e){throw ae("[BUTTONMARKUP] Error in onclick handler:",e),e}};r.addEventListener("click",t),r.dataset.wiapiProcessed="true",e.targetLocation&&(r.dataset.wiapiIntent=e.targetLocation)}if(i.target&&r.setAttribute("target",i.target),["data-width","data-dialog-class"].forEach(e=>{r.removeAttribute(e)}),r=Ve(r,i.attributes),["dialog","hide","hidden"].forEach(e=>{r.classList.remove(e)}),i.classes&&""!==i.classes.trim()&&i.classes.trim().split(" ").forEach(e=>{r.classList.add(e)}),a&&(r=Je(e,r)),i.popover){const e={toggle:"popover",animation:i.popover.animation||!0,container:i.popover.container||"body","delay-show":i.popover.delayShow||0,"delay-hide":i.popover.delayHide||0,title:B(i.popover.title)||"",content:B(i.popover.content)||"",html:i.popover.html||"",placement:i.popover.placement||"left",trigger:i.popover.trigger||"hover"};Object.keys(e).forEach(t=>{r.setAttribute(`data-${t}`,e[t])})}return r};class He{constructor(){this.data={},this.push=this.push.bind(this),this.forEach=this.forEach.bind(this),this.ensureListForKey=this.ensureListForKey.bind(this),this.clear=this.clear.bind(this)}push(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this.ensureListForKey(e).push(...i)}forEach(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this.ensureListForKey(e).forEach(...i)}ensureListForKey(e){return void 0===this.data[e]&&(this.data[e]=[]),this.data[e]}clear(){this.data={}}}const Ge=Object.freeze({"schedule-service":new class extends ce{constructor(){super("page-schedule-service-button")}}}),Be=Object.keys(Ge),Ke=(e,t)=>{if("string"!=typeof e||0===e.length)throw new Error(`${t} must be a non-zero length string. Got: ${e}.`)},Ye=(e,t)=>{if(!e||"object"!=typeof e)throw new Error(`${t} must be an object. Got: ${e}.`)},Qe=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(e),a=[];if(!n.every(e=>{const i=t.indexOf(e)>=0;return i||a.push(e),i}))throw new Error(`Found the following invalid props '${a.join(", ")}'. Only the following props are allowed '${t.join(", ")}', in ${i}.`)},Xe=(e,t)=>{Ye(e,t),Ke(e.integrationId,"integrationId"),Ke(e.integrationType,"integrationType")};class Ze{constructor(e,t){Xe(e,"init"),this.init=e,this.callback=t}}const et=new He,tt=new He,it=(e,t,i)=>{try{t((n=i,JSON.parse(JSON.stringify(n))))}catch(t){ae(`Callback failed: ${e} ${JSON.stringify(i)}.`,t)}var n},nt=["vehicle-media"],at=["image","html"],ot=["primary","secondary","last"],rt=["insert","replace"],st={"vehicle-media":{}},lt=new Set,dt=e=>{if(!nt.includes(e))throw new Error(`Unsupported gallery: '${e}'. Expected one of: ${nt.join(", ")}.`)},ct=(e,t)=>
1{if(!t)throw new Error(`Unsupported request. ${e} is a required field.`)},ut=window._.debounce(e=>{const t={vin:e,content:st["vehicle-media"][e]};window.dispatchEvent(new CustomEvent("wiapiVehicleMediaUpdated",{detail:t}))},100),ht=window._.debounce(()=>{window.dispatchEvent(new CustomEvent("wiapiAllVehiclesMediaUpdated",{detail:{content:st["vehicle-media"]}}))},100),pt=(e,t,i)=>{t.forEach(t=>{const n=t.vin,a=t.images,o=t.insertMethod,r=void 0===o?"insert":o;ct("vin",n),ct("images",a),(e=>{if(!rt.includes(e))throw new Error(`Unsupported vehicle media content insertMethod: '${e}'. Expected one of: ${rt.join(", ")}.`)})(r);const s=i.find(e=>e.vin===n);st["vehicle-media"][n]=st["vehicle-media"][n]||ot.reduce((e,t)=>(e[t]=[],e),{}),st["vehicle-media"][n].insertMethod=r,st["vehicle-media"][n].vehicle=s,a.forEach(t=>{const i=t.type,a=t.position,o=t.src,r=t.thumbnail,s=void 0===r?"":r,l=t.html,d=t.trigger,c=void 0===d?"click":d,u=t.callback;if((e=>{if(!at.includes(e))throw new Error(`Unsupported vehicle media content type: '${e}'. Expected one of: ${at.join(", ")}.`)})(i),(e=>{if(!ot.includes(e))throw new Error(`Unsupported vehicle media position: '${e}'. Expected one of: ${ot.join(", ")}.`)})(a),at.includes(i)){const t=`${n}${a}${o}`;let r="";if(!o||""===o.trim())throw r="Vehicle media images must have a 'src' property.",e&&x(e,{methodType:"insertVehicleMedia",status:"Failed",message:r}),new Error(r);if("html"===i&&(!l&&!u||l&&""===l.trim()&&!u))throw r="Vehicle media HTML must have an 'html' property with content.",e&&x(e,{methodType:"insertVehicleMedia",status:"Failed",message:r}),new Error(r);lt.has(t)||st["vehicle-media"][n][a].push({vin:n,type:i,src:o,thumbnail:s&&""!==s.trim()?s:o,position:a,html:l,trigger:c,callback:u}),lt.add(t)}}),ut(n)}),ht()},gt=e=>{const t=document.createElement("template"),i=e.trim();return t.innerHTML=i,t.content.firstChild};const vt=e=>e.includes("{")&&e.includes("}"),mt=(e,t)=>{let i=e;return Object.keys(t).forEach(e=>{if("integrationUrl"!==e&&i.includes(`{${e}}`)){const n=new RegExp(`{${e}}`,"g");i=i.replace(n,t[e])}}),i},yt=async()=>{var e;if(null!==(e=window.DDC)&&void 0!==e&&null!==(e=e.apiLoaderInstance)&&void 0!==e&&e.loadConfigs)return window.DDC.apiLoaderInstance.loadConfigs();if(window.DDC.PrivateAPI=window.DDC.PrivateAPI||{},window.DDC.PrivateAPI.integrationConfigs){const e=window.DDC.PrivateAPI.integrationConfigs;if("function"==typeof e.then)return ae("loadConfigs","Using existing config promise"),e;if("object"==typeof e&&null!==e)return ae("loadConfigs","Using cached config data"),Promise.resolve(e)}throw new Error("APILoader not available for config loading. Ensure loader.js is included before the main API.")},wt=async e=>{const t=window.DDC.Integration.settings;return Object.keys(t).forEach(e=>{i(e)!==e&&(t[i(e)]=t[e],delete t[e])}),void 0!==t[e.integrationId]&&(x(e,{methodType:"getConfigDeprecated",status:"Success"}),t[e.integrationId])},ft=async function(e,i,n,a){let o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const r="object"==typeof n&&(oe()||re()),s=G();if(i[e.integrationId]){if(r&&"override"===s._integrationConfig)return n;const a=i[e.integrationId].fields,l=await N(),d=l.layoutType;if(!i[e.integrationId].wiseIntegration){const t="mobile"===d&&!0===a.enabledSeamless,i="desktop"===d&&!0===a.enabledDesktop;if(!t&&!i)throw o&&x(e,{methodType:"getConfig",status:`Disabled for ${d}`}),new Error(`Config for ${e.integrationId} found but not enabled for the current device type.`)}const c=["includedPages","excludedPages","thirdPartyServiceDebug"],u={srp:"searchPage",vdp:"detailPage",index:"indexPage"},h=Object.keys(a).filter(e=>!c.includes(e)&&!e.startsWith("enabled")&&!e.startsWith("addTo")).reduce((i,n)=>{const o=i;if(n.split("-").length>1){const i=t(n.split("-"),2),r=i[0],s=i[1];l[u[s]]&&(re()&&ae(e.integrationId,`Using override key '${n}' to set field '${r}' to '${a[n]}' for '${u[s]}'.`),o[r]=a[n])}else n in o||(o[n]=a[n]);return o},{});return o&&x(e,{methodType:"getConfig",status:"Success"}),h}{if(r)return n;o&&x(e,{methodType:"getConfig",status:"Not Found"});const t=a?[...Object.keys(i),...Object.keys(window.DDC.Integration.settings)]:Object.keys(i),s=t.length?`Integration configs are available only for the following -> ${[...new Set(t)].join(", ")}`:"";throw new Error(`Config for ${e.integrationId} not found. ${s}`)}},bt=async(e,t,i)=>{const n=await yt();x(e,{methodType:t,status:"Success"});const a=(o=[e.integrationId,...i],r=n,o.reduce((e,t)=>
1e&&e[t]?e[t]:null,r));var o,r;return null===a?{}:a},Pt=async e=>bt(e,"getContentMappings",["contentMappings"]),Ct=async e=>bt(e,"getSiteProperties",["supplementaryData","siteProperties"]),It=async e=>bt(e,"getSitemap",["supplementaryData","siteMaps"]),Dt=async function(e){var t;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const a=null===(t=window)||void 0===t||null===(t=t.DDC)||void 0===t||null===(t=t.Integration)||void 0===t?void 0:t.settings;if(a){const t=await wt(e);if(!1!==t)return t}try{const t=await yt(),o=await ft(e,t,i,a,n);if(o)return o}catch(t){n&&x(e,{methodType:"getConfig",status:"Failed",message:t}),ae(e,`Error calling getConfig. ${t}`)}return null};var Et=Object.freeze({__proto__:null,hasPlaceHolders:vt,replacePlaceHolders:mt,loadConfigs:yt,processLegacyConfigData:wt,processConfigData:ft,getContentMappings:Pt,getSiteProperties:Ct,getSitemap:It,getConfig:Dt});const At=(e,t,i)=>{void 0===window.DDC.PrivateAPI&&(window.DDC.PrivateAPI={}),void 0===window.DDC.PrivateAPI.timings&&(window.DDC.PrivateAPI.timings={}),void 0===window.DDC.PrivateAPI.timings[e]&&(window.DDC.PrivateAPI.timings[e]={}),void 0===window.DDC.PrivateAPI.timings[e][t]&&(window.DDC.PrivateAPI.timings[e][t]=[]),window.DDC.PrivateAPI.timings[e][t].push(i)},Lt=e=>{var t;return Boolean(null===(t=e.closest)||void 0===t?void 0:t.call(e,'.modal, [role="dialog"]'))};class Tt extends ce{constructor(e){super(),this.searchSelectors=e}getMeta(){return N()}async getElements(){const e=[],t=new Set;this.searchSelectors.forEach(i=>{const n=Array.from(document.querySelectorAll(i)).filter(e=>!Lt(e)),a=n.filter(e=>!e.dataset.wiapiProcessed),o=n.filter(e=>e.dataset.wiapiProcessed);o.length>0&&o.forEach(e=>{e.removeAttribute("data-wiapiprocessed"),a.push(e)}),a.forEach(i=>{t.has(i)||(e.push(i),t.add(i))})});return[".ddc-mobile-fragment-nav",'[data-location~="primary-menu"]',".mobile-menu","#ddc-mobile-header-nav"].forEach(i=>{const n=document.querySelector(i);n&&this.searchSelectors.forEach(i=>{const a=Array.from(n.querySelectorAll(i)),o=a.filter(e=>!e.dataset.wiapiProcessed),r=a.filter(e=>e.dataset.wiapiProcessed);r.length>0&&r.forEach(e=>{e.removeAttribute("data-wiapiprocessed"),o.push(e)}),o.forEach(i=>{t.has(i)||(e.push(i),t.add(i))})})}),e}}const St=["href","target","onclick","popover","attributes"],$t=[g,v,m,y,w];class kt{constructor(e,t,i,n,a,o,r){const s=o||n;Xe(e,"init"),((e,t)=>{let i=Re;if(e===p&&(i=qe),e===d&&(i=[...qe,...Re]),e===h&&(i=_e),e===c&&(i=Ne),!i.includes(t))throw new Error(`Invalid location: ${t}. Valid options are: ${i.join(", ")}.`)})(i,s),this.uniqueId=(()=>{const e=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1);return e()+e()+e()+e()})(),this.init=e,this.methodType=i,this.targetLocation=s,this.destinationLocation=null,this.defaultLocation=n,this.type=a,this.integrationCall=r,this.getInsertSite=this.getInsertSite.bind(this),this.apply=this.apply.bind(this),this.timingKey=`${this.init.integrationId}-${this.targetLocation}`}async getInsertSite(e,t){if(null!=t&&t.singleLocation){const i=[`[data-web-api-id="${this.init.integrationId}"]`];null!=t&&t.placement&&i.push(`[data-web-api-placement="${t.placement}"]`);const n=null==e?void 0:e.querySelector(i.join(""));if(n)return n}const i=null!=t&&t.elementType?t.elementType:"div",n=document.createElement(i);n.setAttribute("data-web-api-id",this.init.integrationId),null!=t&&t.placement&&n.setAttribute("data-web-api-placement",t.placement),n.setAttribute("data-web-api-unique-id",this.uniqueId);let a="",o="";if(t&&(t.style&&n.setAttribute("style",t.style),t.responsiveSrpClasses&&await K()?o=`${t.responsiveSrpClasses}`:t.gridSrpClasses&&Q()?o=`${t.gridSrpClasses}`:t.vdpClasses&&X()?(a=`${a} p-4`,null!=e&&e.getAttribute("data-list-classes")&&(a=null==e?void 0:e.getAttribute("data-list-classes")),o=`${t.vdpClasses}`):t.classes&&(o=`${t.classes}`),n.setAttribute("class",`${o} ${a} hidden`)),null!=t&&t.clearContent)for(;null!=e&&e.firstChild;)e.removeChild(e.firstChild);return null!=t&&t.placement&&"first"===(null==t?void 0:t.placement)&&null!=e&&e.firstChild?e.insertBefore(n,e.firstChild):null==e||e.appendChild(n),n}async apply(e,i){const n=Date.now(),a=await Dt(this.init,!1,!1);
1null!=a&&a.useCustomInsertLocations&&$t.includes(this.targetLocation)&&!this.targetLocation.endsWith("-custom")&&(this.targetLocation=`${this.targetLocation}-custom`);let o=null;if(this.methodType===d||this.methodType===h){const e=await Pt(this.init),i=e.buttons||e.button;i&&Object.entries(i).forEach(e=>{const i=t(e,2),n=i[0],a=i[1];n===this.targetLocation&&a&&(o=Fe[a]?Fe[a]:new Ee(a),this.destinationLocation=a)}),await ie(),o&&("hidden"===o.name||document.querySelector(`[data-location="${o.name}"]`))||(o=xe[this.defaultLocation],this.methodType=l)}else if(this.methodType===l)o=xe[this.defaultLocation];else if(this.methodType===s)o=xe[this.targetLocation];else if(this.methodType===p)o=Fe[this.targetLocation];else if(this.methodType===c){const e=((await Pt(this.init)).links||{})[this.targetLocation]||[];if(e&&e.length){const t=e.map(e=>`a[href^="${e}"]`);t.some(e=>document.querySelectorAll(e).length>0)?o=new Tt(t):ae("[EDITOR] No links found for any selectors")}else ae("[EDITOR] No link targets found for intent:",this.targetLocation)}if(!o)return;await o.isReady();const r=await o.getElements(e),u=await o.getConfig();setTimeout(()=>{r&&r.forEach(async t=>{try{var r,g;const v=await o.getMeta(t),m=!(!i||!e||(null==e?void 0:e.uuid)!==(null==v?void 0:v.uuid))||!e,y=0===(null==t||null===(r=t.querySelectorAll(`[data-web-api-unique-id="${this.uniqueId}"]`))||void 0===r?void 0:r.length);if(!m||!y)return;if(await o.prepareLocation(t),this.methodType===l||this.methodType===d||this.methodType===h||this.methodType===c){const e=this.integrationCall(v);if("object"!=typeof e)return;{let i=e;if(this.methodType===h||this.methodType===c){const n=e.href,a=e.target,r=e.onclick,s=e.popover,l=e.attributes,d=function(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;i[n]=e[n]}return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}(e,St);i={href:n,target:a,onclick:r,popover:s,attributes:l};const u=Object.keys(d||{});if(u.length){const e=u.join(", ");ae(this.init.integrationId,`tried to modify the following button attributes ${e} of ${o.name} which is not allowed.`)}const h=ze(this,t,i,this.methodType!==c);H(h)}else if(this.methodType===l){const e=document.createElement("a");de(this.init,await this.getInsertSite(t,u),ze(this,e,i)),H(e)}else if(this.methodType===d){let e;const n="A"===t.nodeName;n&&(e=await this.getInsertSite(null,u),t.parentNode.appendChild(e),e=Je(this,e,t.getAttribute("data-location")),t.getAttribute("data-location")&&t.removeAttribute("data-location"));const a="BUTTON"===t.nodeName;let o,r;a&&(o=document.createElement("a"),t.replaceWith(o)),r=n?t:a?o:t.querySelector("a");const s=ze(this,r,i,!0,!n);e&&e.appendChild(s),H(s)}}}else if(this.methodType===s){(null==a?void 0:a.renderAsFirstChild)&&o.name===w&&(u.placement="first"),this.integrationCall(await this.getInsertSite(t,u),v)}else this.methodType===p&&(ae("WARNING: The `API.update` method is deprecated and will soon be removed. Please use `API.insertCallToAction` instead. For details, please visit https://dealerdotcom.github.io/web-integration-api-docs/#api-insertcalltoaction-type-intent-setupfunction-meta"),this.integrationCall(t,v));const f=t.closest("[data-location]");null==f||null===(g=f.classList)||void 0===g||g.remove("hide","hidden"),x(this.init,{methodType:this.methodType,status:"Success",locationName:this.targetLocation});const b=Date.now();At(this.methodType,this.timingKey,b-n)}catch(e){const t=Date.now();ae(this.init.integrationId,`Failed to edit into ${this.targetLocation} and took ${t-n}ms to fail... ${e}`),x(this.init,{methodType:this.methodType,status:"Failed",locationName:this.targetLocation,message:e})}})},0)}}let xt=null,Ot=null;const jt=e=>{var t;if(1!==e.nodeType)return!1;if("A"===e.nodeName)return e.hasAttribute("href")&&!Lt(e);const i=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"a[href]");return Boolean((null==i?void 0:i.length)&&Array.from(i).some(e=>!Lt(e)))},Nt=e=>{var t;return!(xt||"function"!=typeof MutationObserver||null===(t=document)||void 0===t||!t.body)&&(xt=new MutationObserver(t=>{(e=>e.some(e=>Array.from(e.addedNodes).some(jt)))(t)&&(clearTimeout(Ot),Ot=setTimeout(()=>{ae("[LINK_WATCHER] New links on page, re-applying link takeover"),e()},50))}),xt.observe(document.body,{childList:!0,subtree:!0}),!0)},Mt=new Set,Ut="listings-placeholder";let Ft=null,Rt=null;const qt=(e,t,i)=>{e.size>=5&&(t&&t.disconnect(),Ft=e,i(e))},_t=()=>{if(Rt)return Rt;const e=`[data-location*="${Ut}"]`,t=document.querySelectorAll(e),i=new Map;
1return t.forEach(e=>{const t=e.getAttribute("data-location"),n=i.get(t)||[];i.set(t,[...n,e])}),Rt=new Promise(t=>{qt(i,null,t);const n=new MutationObserver(a=>{a.forEach(a=>{if("childList"===a.type){a.target.querySelectorAll(e).forEach(e=>{const t=e.getAttribute("data-location"),n=i.get(t)||[];i.set(t,[...n,e])}),qt(i,n,t)}})}),a=document.querySelector(".srp-wrapper-listing");a&&n.observe(a,{childList:!0,subtree:!0})}),Rt},Wt=e=>!(null==e||!e.includes(Ut)),Vt=e=>Mt.has(e),Jt=e=>D.includes(e),zt=async(e,t)=>{var i;if(t===`${Ut}-5`)return!0;if(t===`${Ut}-1`)return!!Jt(e.integrationId)||(window.DDC.PrivateAPI.hasPrimaryPlaceholderIntegration||Ft||(Ft=await _t()),!(window.DDC.PrivateAPI.hasPrimaryPlaceholderIntegration||Vt(t)));Ft||(Ft=await _t());return 0!==((null===(i=Ft)||void 0===i?void 0:i.get(t))||[]).length&&!Vt(t)},Ht=async(e,t)=>{let i=t;if(i===u&&ee()&&W.inlinePrimaryBanner&&(i=`${Ut}-1`),!Wt(i))return i;const n=await(async(e,t)=>{if(await zt(e,t))return t;Ft||(Ft=await _t());const i=Array.from(Ft.keys());i.sort();const n=i.find(i=>!Vt(i)&&i!==t&&zt(e,i));return n||`${Ut}-5`})(e,i);return(e=>{Wt(e)&&Mt.add(e)})(n),n},Gt=new Set,Bt=new Set,Kt=new Set,Yt=new Set,Qt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Gt.forEach(t=>{const i=e.exclude,n=e.include;t.targetLocation?i&&t.targetLocation.startsWith(i)||n&&!t.targetLocation.startsWith(n)||t.apply():ae("No target location was set for insert:",t)})},Xt=()=>{Yt.forEach(e=>{e.apply()})},Zt=function(e,t,i,n,a,o,r){let l=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];const u=new kt(i,e,t,n,a,o,r),g=window.DDC.InvData&&n&&n.startsWith("vehicle");l?(t===s||[p,d,h].includes(t))&&(n&&n.startsWith("vehicle")?Bt.add(u):Gt.add(u)):!l&&g&&Kt.add(u),t===c&&(Yt.add(u),Nt(Xt)),u.apply();return x(i,{methodType:t,locationName:o||n}),u},ei=async function(e,t,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("object"!=typeof e||null===e)throw new Error(`init must be an object. Got: ${e}.`);const a=await Ht(e,t);return Zt("insert",s,e,a,null,null,i,n)},ti=async function(e,t,i,n){let a,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=null;const s=await Dt(e);"button"===t&&(r=null!=s&&s.useCustomInsertLocations?"vehicle-ctas-custom":"vehicle-ctas",a=`vehicle-${i}-button`);const l=Oe.includes(i)?h:d;return Zt("insertCallToAction",l,e,r,t,a,n,o)},ii=async function(e,t,i){return Zt("update",p,e,t,null,null,i,!(arguments.length>3&&void 0!==arguments[3])||arguments[3])},ni=["mobile"],ai=["top","bottom"],oi=["primary-menu"],ri={},si=(e,t,i)=>{(e=>{if(!e)throw new Error("Location is required to set a modification.");if(ri[e])throw new Error(`The location '${e}' has already been modified by integration '${ri[e].integration}'.`)})(t),ri[t]={integration:e,...i},(e=>window._.debounce(()=>{window.dispatchEvent(new CustomEvent("wiapiPageModificationUpdate",{detail:{location:e}}))},100))(t)()},li="wiapiSettings",di=["showPayments","useFilterSortPlaceholders","delayLoadVdpFooter"],ci=e=>{const t=JSON.parse(sessionStorage.getItem(li))||{};return e?(null==t?void 0:t[e])||{}:t},ui=async e=>(await S(),ci(e)),hi=async function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=(await N()).pageName;if(!n)return;const a=ci(),o=(e=>["true","false"].includes(e)?"true"===e:e)(t);a[n]||(a[n]={}),void 0===o||!i&&!0===a[n][e]||(a[n][e]=o,(e=>{sessionStorage.setItem(li,JSON.stringify(e))})(a))},pi=e=>(di.forEach(async t=>{void 0!==e[t]&&hi(t,e[t])}),!0);class gi{constructor(e,t,a,o,r){const s="string"==typeof e?e:e.integrationId,l="string"==typeof e?e:e.integrationType,d="string"==typeof e?[]:e.scriptAttributes||[];Ke(s,"integrationId"),Ke(t,"src"),Ke(a,"type"),((e,t)=>{if(!(e instanceof Map))throw new Error(`${t} must be a Map. Got: ${typeof e}.`)})(o,"attributes"),this.init={integrationId:i(s),integrationType:n(l)},this.scriptAttributes=d,this.src=t,this.fileType=a,this.attr=o,this.immutableAttr=["data-web-api-id","data-web-api-type","async","type","src"],this.methodType=this.fileType?`load${this.fileType.toUpperCase()}`:"Load",this.isIntegrationLoad=r,this.load=this.load.bind(this),this.invoked=!1}load(e){if(this.invoked)return new Promise(e=>{e(`Resource ${this.src} already loaded.`)});const t=e=>{const t=this.isIntegrationLoad?"Integration Loaded":this.methodType;x(this.init,{methodType:t,load:this.src,status:e})},i=()=>(this.invoked=!0,new Promise((e,i)=>{const n="js"===this.fileType?"script":"link",a=document.createElement(n);switch(a.setAttribute("data-web-api-id",this.init.integrationId),a.setAttribute("data-web-api-type",this.init.integrationType),n){case"script":if(a.type="text/javascript",a.src=this.src,a.async=!0,W.fetchPriorityJS&&a.setAttribute("fetchpriority",W.fetchPriorityJS),this.attr.forEach((e,t)=>{switch(t){case"priority":break;case"jstype":case"type":"module"===e&&a.setAttribute("type","module");break;case"synchronicity":"async"===e&&a.setAttribute("async","async");break;default:this.immutableAttr.includes(t)||a.setAttribute(t,e)}}
1),this.scriptAttributes.forEach(e=>{let t=e.name,i=e.value;this.immutableAttr.includes(t.toLowerCase())||a.setAttribute(t,i)}),["body","head"].includes(this.attr.get("priority")))return;document.body.appendChild(a);break;case"link":a.type="text/css",a.rel="stylesheet",a.media="all",a.href=this.src,W.fetchPriorityCSS&&a.setAttribute("fetchpriority",W.fetchPriorityCSS),document.head.appendChild(a)}a.onload=()=>{this.invoked=!0,t("Success"),e(this.src)},a.onerror=()=>{t("Failed"),i(this.src)}}).catch(e=>{ae(this.init.integrationId,`ERROR: ${e.toString()} failed to load!`)}));return["all","css"].includes(e)&&"css"===this.fileType||["all","js"].includes(e)&&"js"===this.fileType?i():"unknown"===this.fileType&&new Promise((e,t)=>{t(new Error(`Failed to load unknown resource type of file ${this.src}`))})}}const vi=[],mi=G(),yi=async function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map,a=arguments.length>4?arguments[4]:void 0;const o=i||(e=>e.includes(".css")||e.includes("/css")?"css":e.includes(".js")||e.includes("/js")?"js":"unknown")(t),r=new gi(e,t,o,n,a);return!!vi.some(e=>e.src===t)||(vi.push(r),r.load(o))},wi=async function(e,t,i){return yi(e,t,"js",i,arguments.length>3&&void 0!==arguments[3]&&arguments[3])},fi=e=>vi.forEach(t=>{t.invoked||t.load(e)}),bi=O("WebIntegrationAPITestLoader");if(bi&&void 0!==mi._integrationMode){const e=bi.split("|"),t=e[0],i=e[1];yi(t,i)}const Pi="DISABLE_THIRD_PARTY",Ci="ENABLE_THIRD_PARTY",Ii="DEBUG_THIRD_PARTY",Di="COX_ONLY",Ei="RESET_CUSTOM",Ai="INVALID_PROTOCOL",Li="DEVICE_ENABLEMENT",Ti=e=>{switch(e){case Di:return(()=>{throw new Error("External integrations are disabled due to onlyCoxIntegration mode.")})();case Ii:return(()=>{throw new Error("This integration is disabled because Third Party Debug is enabled.")})();case Li:return(()=>{throw new Error("Integration disabled for target device.")})();case Pi:return(()=>{throw new Error("Integration disabled due to _onlyDisableThirdParty param.")})();case Ci:return(()=>{throw new Error("Integration disabled due to _onlyEnableThirdParty param.")})();case Ai:return(()=>{throw new Error("URL defined does not start with https:// or / and HTTPS is required.")})();case Ei:return(()=>{throw new Error("Integrations are disabled.")})();default:return(()=>{throw new Error("An Error occured validating an Integration")})()}},Si=(e,t)=>{switch(e){case Di:return(e=>{const t=e.integrationId,i=e.integrationUrl;ae(t,"External integrations are disabled due to onlyCoxIntegration mode.",`Skipping JS: ${i}`)})(t);case Ii:return(e=>{const t=e.integrationId,i=e.integrationUrl;ae(t,"This integration is disabled because Third Party Debug is enabled.",`Skipping JS: ${i}`)})(t);case Li:return(e=>{const t=e.integrationId;ae(t,`Config for ${t} found but not enabled for the current device type.`)})(t);case Pi:return(e=>{const t=e.integrationId;ae(`Skipping load of ${t} due to _onlyDisableThirdParty URL parameter.`)})(t);case Ci:return(e=>{const t=e.integrationId;ae(`Skipping load of ${t} due to _onlyEnableThirdParty URL parameter.`)})(t);case Ai:return(e=>{const t=e.integrationId;ae(`ERROR with '${t}' integration setup:`,"URL defined does not start with https:// or / and HTTPS is required.")})(t);case Ei:return(e=>{const t=e.integrationId,i=e.integrationUrl;ae(t,`Integrations are disabled. Skipping JS: ${i}`)})(t);case"LOADING_INTEGRATION_JS":return(e=>{const t=e.integrationId,i=e.integrationUrl;ae(t,`Loading Integration JS: ${i}`)})(t);default:return}};class $i{constructor(e,t,i,n,a,o,r,s,l){this.debugMode=e,this.enabledDesktop=t,this.enabledSeamless=i,this.integrationId=n,this.integrationUrl=a,this.integrationList=o,this.layoutType=r,this.urlParams=s,this.wiseIntegration=l}reducer(e){switch(e){case Di:((e,t)=>{const i=t.integrationId,n=t.urlParams,a=t.integrationList,o=t.integrationUrl,r=((e,t,i)=>!("onlyCoxIntegration"===t._mode&&!i.includes(e)))(i,n,a);r||(Si(e,{integrationId:i,integrationUrl:o}),Ti(e))})(e,{integrationId:this.integrationId,urlParams:this.urlParams,integrationList:this.integrationList,integrationUrl:this.integrationUrl});break;case Ii:((e,t)=>{const i=t.debugMode,n=t.integrationId,a=t.integrationUrl,o=((e,t)=>
1!0!==t||"true"===e.thirdPartyServiceDebug)(t.urlParams,i);o||(Si(e,{integrationId:n,integrationUrl:a}),Ti(e))})(e,{debugMode:this.debugMode,integrationId:this.integrationId,integrationUrl:this.integrationUrl,urlParams:this.urlParams});break;case Li:((e,t)=>{const i=t.wiseIntegration,n=t.layoutType,a=t.enabledSeamless,o=t.enabledDesktop,r=t.integrationId;((e,t,i,n)=>{if(!e)switch(t){case"mobile":return i;case"desktop":return n;default:return!1}return!0})(i,n,a,o)||(Si(e,{integrationId:r}),Ti(e))})(e,{wiseIntegration:this.wiseIntegration,layoutType:this.layoutType,enabledSeamless:this.enabledSeamless,enabledDesktop:this.enabledDesktop,integrationId:this.integrationId});break;case Pi:((e,t)=>{const i=t.integrationId,n=((e,t)=>!t._onlyDisableThirdParty||t._onlyDisableThirdParty!==e)(i,t.urlParams);n||(Si(e,{integrationId:i}),Ti(e))})(e,{integrationId:this.integrationId,urlParams:this.urlParams});break;case Ci:((e,t)=>{const i=t.integrationId,n=((e,t)=>!t._onlyEnableThirdParty||t._onlyEnableThirdParty===e)(i,t.urlParams);n||(Si(e,{integrationId:i}),Ti(e))})(e,{integrationId:this.integrationId,urlParams:this.urlParams});break;case Ai:((e,t)=>{const i=t.integrationId;n=t.integrationUrl,n.startsWith("https://")||n.startsWith("/")||(Si(e,{integrationId:i}),Ti(e));var n})(e,{integrationId:this.integrationId,integrationUrl:this.integrationUrl});break;case Ei:((e,t)=>{const i=t.integrationId,n=t.integrationUrl,a=(e=>"resetCustom"!==e._mode&&("true"!==e._disableTPS||"true"===e._enableWIAPI)&&"true"!==e._disableWIAPI)(t.urlParams);a||(Si(e,{integrationId:i,integrationUrl:n}),Ti(e))})(e,{integrationId:this.integrationId,integrationUrl:this.integrationUrl,urlParams:this.urlParams})}}all(){this.reducer(Li),this.reducer(Pi),this.reducer(Ci),this.reducer(Ai),this.reducer(Di),this.reducer(Ei),this.reducer(Ii)}validate(e){this.reducer(e)}validateList(e){e.forEach(e=>{this.validate(e)})}}const ki=W.onlyCoxIntegrations.split(",").map(e=>e.trim()),xi=async()=>{const e=await yt(),i=await N(),n=G(),a=Object.keys(e).reduce((a,o)=>{const r=e[o];if(r&&r.fields&&r.fields.integrationUrl||r.urls){const s=r.debugMode,l=r.fields,d=r.wiseIntegration,c=l.enabledDesktop,u=l.enabledSeamless,h=l.excludedPages,p=i.pageName,g=i.layoutType;if(d){const v=r.urls.map(a=>new Promise(r=>{let v=a.url;const m=a.types,y=a.scriptAttributes;new $i(s,c,u,o,v,ki,g,n,d).all();let w=!1,f=!1,b=!1;if(h&&h.split(",").forEach(e=>{p.match(e)&&(f=!0)}),f||(Object.keys(l).forEach(e=>{(e.startsWith("addTo")||"includedPages"===e)&&(b=!0,l[e].split(",").forEach(e=>{("ALL"===e||p.match(e))&&(w=!0)}))}),w||b||(w=!0),!i.pageUrl.includes("cms.sales.apps.dealer.com")&&!i.pageUrl.includes("cms.sales.apps-np.dealer.com")||E.includes(o)||(w=!1)),w){Jt(o)&&(window.DDC.PrivateAPI.hasPrimaryPlaceholderIntegration=!0),pi(l),!v.startsWith("/")||v.startsWith("//")||v.startsWith("/static/")||(v=`/static${v}`);const i=vt(v)?mt(v,e[o].fields):v;ae(o,`Loading Integration JS: ${i}`),wi({integrationId:o,integrationType:"wise",scriptAttributes:y},i,m.split(",").reduce((e,i)=>{const n=t(i.split("="),2),a=n[0],o=n[1];return e.set(a,o),e},new Map),!0)}else ae(o,`Config for ${o} found but excluded for the current page: ${p}.`);r(!0)}));return[...a,...v]}{const t=new Promise(t=>{let i=l.integrationUrl;new $i(s,c,u,o,i,ki,g,n,d).all();let a=!1,r=!1,v=!1;if(h&&h.split(",").forEach(e=>{p.match(e)&&(r=!0)}),r||(Object.keys(l).forEach(e=>{(e.startsWith("addTo")||"includedPages"===e)&&(v=!0,l[e].split(",").forEach(e=>{("ALL"===e||p.match(e))&&(a=!0)}))}),a||v||(a=!0)),a){Jt(o)&&(window.DDC.PrivateAPI.hasPrimaryPlaceholderIntegration=!0),pi(l),!i.startsWith("/")||i.startsWith("//")||i.startsWith("/static/")||(i=`/static${i}`);const t=vt(i)?mt(i,e[o].fields):i;ae(o,`Loading Integration JS: ${t}`),wi({integrationId:o,integrationType:"api"},t,new Map,!0)}else ae(o,`Config for ${o} found but excluded for the current page: ${p}.`);t(!0)});return[...a,t]}}return a},[]);return await Promise.allSettled(a)},Oi=(e,t,i)=>{Xe(e,"init"),(e=>{if(Ke(e,"locationName"),!Be.includes(e))throw new Error(`Invalid location: ${e}. Valid options are: ${Be.join(", ")}.`)})(t),((e,t)=>{Ye(t,"Modifier");const i=t.schema;"schedule-service"===e&&(Ye(i,"Schema of the modifier object"),Qe(t,["schema"],`Modifier object of ${e}.`),Qe(i,["href","target","onclick","popover","attributes"],`the schema of the modifier object  of ${e}.`))})(t,i),si(e.integrationId,t,i);const n=i.schema,a=i.callback,o=Ge[t];return{apply:async()=>{await o.isReady();const i=await o.getElements();
1i&&i.forEach(i=>{switch(t){case"schedule-service":{const o=ze({init:e,location:t,schema:n,integrationCall:a},i,n,!1);H(o);break}}})}}};class ji{constructor(e){(e=>{if(Ke(e,"event type"),!e.match(/.*-v\d+/))throw new Error(`Event types must end with a version (like -v1). Got: ${e}.`)})(e),this.eventType=e,this.fireEvent=this.fireEvent.bind(this),this.invoke=this.invoke.bind(this)}fireEvent(e){(e=>{if(!e.type)throw new Error("Events must have a type property.");const t={...e,timestamp:new Date};tt.forEach(e.type,e=>{it(e.init.integrationId,e.callback,t)}),et.push(e.type,t)})({type:this.eventType,...e})}invoke(){throw new Error("Event emitters should override invoke to fire events.")}}class Ni extends ji{constructor(e){super(e),this.invokeOnce=this.invokeOnce.bind(this),this.invoked=!1}invoke(e){this.invoked||(this.invokeOnce(e),this.invoked=!0)}}const Mi=()=>{const e=window.DDC.dataLayer||{},t=e.dealership,i=void 0===t?{}:t,n=e.site,a=void 0===n?{}:n,o={};return i.dealerCode&&Array.isArray(i.dealerCode)&&i.dealerCode.forEach(e=>{Object.assign(o,e)}),{dealershipAddress1:i.address1||"",dealershipAddress2:i.address2||"",dealershipCity:i.city||"",dealershipCodes:o||[],dealershipCountry:i.country||"",dealershipFranchises:a.franchises||[],dealershipName:i.dealershipName||"",dealershipPostalCode:i.postalCode||"",dealershipStateProvince:i.stateProvince||""}};const Ui=e=>{const t=document.querySelector(".ws-inv-listing");t&&t.querySelectorAll(".loan-payment, .lease-payment").forEach(t=>{"hide"===e?t.classList.add("d-none"):"show"===e&&t.classList.remove("d-none")});const i=document.querySelectorAll("#paymentLoan, #paymentLease");i&&i.forEach(t=>{"hide"===e?t.classList.add("d-none"):"show"===e&&t.classList.remove("d-none")})},Fi=()=>{hi("hideDefaultPayments",!0),Ui("hide")},Ri=()=>{hi("hideDefaultPayments",!1,!0),Ui("show")},qi=async()=>{var e;const t=null===(e=window)||void 0===e||null===(e=e.DDC)||void 0===e||null===(e=e.siteSettings)||void 0===e?void 0:e.pageAlias;if(!t)return;const i=await ui(t),n=(()=>{const e=JSON.parse(localStorage.getItem("userShowPayments"))||{};return null==e?void 0:e.show})();null!=i&&i.hideDefaultPayments||n?Fi():Ri()};const _i="ddc-content web-api-added-placeholder hidden",Wi=(e,t)=>J(`[data-location="${t}"]`,e)||J(`[data-location="${t}-custom"]`,e),Vi=(e,t,i)=>{const n=document.createElement(e);return n.setAttribute(r,t),n.setAttribute("class","hidden"),i&&i.split(" ").forEach(e=>{n.classList.add(e)}),n},Ji=(e,t,i)=>e.includes(t)?i:t,zi=(e,t)=>{e.parentNode.insertBefore(t,e.nextSibling)},Hi=(e,t)=>{e.parentNode.insertBefore(t,e)},Gi=(e,t)=>{e.appendChild(t)},Bi=()=>{const e=z(".ddc-vehicle-cta-summary");return e.length>0?e:z('[data-widget-name="ws-vehicle-ctas"]')},Ki=(e,t)=>{if(!Wi(document,e)){const i=J(t);i&&i.setAttribute(r,e)}},Yi=new Map([["ASK","vehicle-ask-button"],["DRIVE","vehicle-drive-button"]]),Qi=async()=>{const e=J(".fixed-vdp-footer"),t=J(".links-list ul",e);return t&&(t.setAttribute("data-location","mobile-vdp-footer"),(async e=>{window.ldClient?(await window.ldClient.waitUntilReady(),e()):document.addEventListener("LDClientReady",e)})(async()=>{const t=window.ldClient.allFlags(),i=t["mobile-vdp-footer-delay"]||2e3,n=t["toggle-delay-vdp-footer"]||!1,a=await(async()=>{var e;return null!==(e=window.DDC)&&void 0!==e&&null!==(e=e.siteSettings)&&void 0!==e&&e.pageAlias&&(await ui(window.DDC.siteSettings.pageAlias)).delayLoadVdpFooter||!1})()&&n;setTimeout(()=>{var t;null==e||null===(t=e.classList)||void 0===t||t.add("in")},a?i:0)})),!0},Xi=async()=>{const e=await N(),t="data-target-locations";let i,n=[];var a,o;e.detailPage&&(i=J(".eprice-react-portal"),n=null!==(a=i)&&void 0!==a&&a.getAttribute(t)?null===(o=i)||void 0===o||null===(o=o.getAttribute(t))||void 0===o?void 0:o.split(" "):[]);return e.searchPage&&J(".inventory-listing-grid")?z(".gv-pricing").forEach(e=>{Wi(e,m)||e.appendChild(Vi("ul",m,"list-unstyled d-flex flex-column justify-content-center w-100")),Wi(e,v)||e.appendChild(Vi("div",v)),Wi(e,w)||e.appendChild(Vi("div",w)),Wi(e,g)||e.appendChild(Vi("ul",g,"list-unstyled d-flex flex-wrap justify-content-center"))}):(e.searchPage||e.detailPage)&&(await(async e=>{if(!Wi(document,u)){const t=Vi("div",u,_i);let i;e.detailPage?(i=J('[data-widget-id="tps-mediabot1"]')?J('[data-widget-id="tps-mediabot1"]'):J('[data-widget-name="ws-quick-specs"]'),i||(i=J('[data-widget-name="inventory-detail-highlighted-features"]'))):e.searchPage&&(i=J('[data-name="srp-wrapper-page-title"]')||J('[data-widget-name="inventory-listing-default"]')),i&&Hi(i,t)}return!0})(e),await(async(e,t)=>{if(!e.detailPage&&!e.searchPage)return!0;
1if(e.detailPage&&J('[data-widget-id="links-lead1"]')){const e=z('[data-widget-id="links-lead1"] .btn');e.length>0&&e.forEach(e=>{const t=e.getAttribute("data-link-label");t&&Yi.has(t)&&!e.getAttribute(r)&&e.setAttribute(r,Yi.get(t))})}if(e.detailPage&&J('[data-widget-name="ws-vehicle-ctas"]')){const e=Bi(),i=Ji(t,v,b);e.length>0&&e.forEach(e=>{e.setAttribute(r,i),z('[data-location~="vehicle-ctas"]',e).forEach(e=>{e.removeAttribute(r),e.classList.add("mb-3")})})}else{let t=[];if(e.searchPage)t=z(".pricing-area .pricing");else if(e.detailPage){const e=J(".inventory-detail-pricing .pricing");e&&t.push(e)}t.forEach(e=>{const t=document.createElement("li");t.setAttribute(r,v),t.setAttribute("class","web-api-added-placeholder hidden mt-3"),Gi(e,t)})}return!0})(e,n),await(async(e,t)=>{if(e.detailPage){const e=Ji(t,y,C);Wi(document,e)||z('[data-widget-name="ws-detailed-pricing"]').forEach(t=>{const i=Vi("div",e,`${_i} ws-detailed-pricing`);zi(t,i)})}return!0})(e,n),await(async(e,t)=>{if(e.detailPage){const i=Ji(t,v,b),n=Ji(t,w,I),a=z(`[data-location="${i}"]`);if(a.length>0){const t=a[a.length-1],i="desktop"===e.layoutType?"ddc-content responsive-content-max-hide responsive-content-mid-hide responsive-content-min-hide box web-api-added-placeholder hidden":_i,o=Vi(t.tagName.toLowerCase(),n,i);t.classList.add("pb-0"),zi(t,o)}}else e.searchPage&&z(".pricing-area .pricing").forEach(e=>{const t=Vi("li",w,"web-api-added-placeholder hidden mb-4");Gi(e,t)});return!0})(e,n),e.searchPage&&J(".inventoryList")?(z(".hproduct .media").forEach(e=>{Wi(e,m)||e.appendChild(Vi("ul",m,"list-unstyled d-flex flex-column"))}),z(".hproduct .calloutDetails ul").forEach(e=>{Wi(e,g)||e.setAttribute(r,g)})):e.detailPage&&((async(e,t)=>{const i=Ji(t,m,P),n=Ji(t,g,f);if(e.detailPage&&!Wi(document,i)){const e=J('[data-widget-name="inventory-detail-highlighted-features"]');if(e){const t=Vi("ul",i,"list-unstyled web-api-added-placeholder");Hi(e,t)}}Ki(n,".calloutDetails ul"),Ki(i,'.osiris-third-party-include [data-location="vehicle-media"]')})(e,n),await(async e=>{if(!e.detailPage)return!0;if(!Wi(document,"secondary-content")){const e=Vi("div","secondary-content",_i),t=J('[data-widget-id="detailed-specs1"]');t&&zi(t,e)}return!0})(e),await(async e=>!e.detailPage||(Bi().forEach((e,t)=>{const i=e.getAttribute("data-location"),n=0===t?"top":"bottom";e.setAttribute("data-location",`${i} vehicle-ctas-${n}`)}),!0))(e),"mobile"===e.layoutType&&await Qi())),(async e=>{if(!e.pageName.includes("PRIVACY"))return!0;const t=J('[data-widget-name="privacy-form"]');if(t)return t.setAttribute("data-location","privacy-form"),!0;if(!Wi(document,"privacy-form")){const e=Vi("div","privacy-form",_i),t=J('[data-widget-id="content1"]');t&&zi(t,e)}})(e),!0},Zi=[new class extends Ni{constructor(){super("page-load-v1")}async invokeOnce(){const e=await N();this.fireEvent({payload:e}),Qt({exclude:"listings-"}),Gt.forEach(e=>{e.apply()})}},new class extends Ni{constructor(){super("dealership-info-v1")}invokeOnce(){this.fireEvent({payload:Mi()})}}],en=[new class extends ji{constructor(){super("vehicle-data-updated-v1")}async invoke(){const e=await N(),t=await Ce();this.fireEvent({payload:{pageData:e,vehicleData:t}}),qi()}}],tn=[new class extends ji{constructor(){super("vehicle-shown-v1")}async invoke(e){const t=await N(),i=await Ce(),n=async e=>{if(e){const t=i.filter(t=>t.uuid===e.uuid);if(t.length>0){const e=t[0];this.fireEvent({payload:e}),qi()}}else i.forEach(e=>{this.fireEvent({payload:e}),qi()})};(t.searchPage||t.detailPage)&&(await ie(),(await K()&&e||!await K())&&await n(e))}}],nn=async(e,t)=>(e.forEach(e=>{const i=Date.now();try{e.invoke(t);const n=Date.now();window.DDC.integrationLog(`Firing event emitter: ${e.eventType}`),At("event-emitter",e.eventType,n-i)}catch(t){const n=Date.now();At("event-emitter-failed",e.eventType,n-i),window.DDC.integrationLog(`Event emitter ${e.eventType} failed and took ${n-i}ms to fail.`,t)}}),!0),an=async()=>(await Xi(),await(async()=>{J("li.price-btn")&&z("li.price-btn").forEach(e=>{e.classList.add("clearfix")});return!0})(),nn(Zi)),on=async()=>nn(en),rn=async e=>nn(tn,e),sn={},ln=async(e,t)=>{const i="getJwtForVehicles"===t?await De(e,"vin"):["false"];return fetch(`/api/ipp/jwt/vehicles?vins=${i.join()}`).then(i=>{if(!i.ok)throw x(e,{methodType:t,status:"Failed"}),new Error("Invalid response from the JWT endpoint.");return i.text().then(i=>{const n=(e=>{const t=e.split(".");if(t.length<2)return;const i=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(i).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(n)})(i);return x(e,{methodType:t,status:"Success"}),"getJwtForVehicles"===t?{vins:n.VINs,jwt:i}:{jwt:i}})})};class dn{constructor(e){this.init=e}getIntegrationId(){return this.init.integrationId}getIntegrationType(){return this.init.integrationType}}class cn extends dn{constructor(e){super(),this.init=e}}const un=[{className:dn,methods:{getAttributeForVehicles:De,getConfig:Dt,getDealerData:e=>new Promise((t,i)=>{const n=(window.DDC.dataLayer||{}).dealership,a=void 0===n?{}:n;if(Object.keys(a).length>0)return x(e,{methodType:"getDealerData",status:"Success"}),void t(Mi());x(e,{methodType:"getDealerData",status:"Failed"}),i(new Error("Unable to retrieve dealership data."))}),getJwtForSite:async e=>ln(e,"getJwtForSite"),getJwtForVehicles:async e=>ln(e,"getJwtForVehicles"),getPageData:async e=>{const t=await N();return x(e,{methodType:"getPageData",status:"object"==typeof t?"Success":"Failed"}),t},getPixallVisitorId:async()=>{const e=window.Cookies.get("pxa_id");return e||(await $("Pixall"),window.Pixall&&void 0!==window.Pixall.getVisitorId?window.Pixall.getVisitorId():new Error("No Pix
1all visitorId found"))},getSitemap:It,getSiteProperties:Ct,getUnlockedVehicles:async()=>{var e;const t=(null===(e=window)||void 0===e||null===(e=e.DDC)||void 0===e||null===(e=e.userProfile)||void 0===e?void 0:e.ePriceVehicles)||[];return[...new Set(t.map(e=>{var t;return null!==(t=null==e?void 0:e.itemUUID)&&void 0!==t?t:null}).filter(e=>e))]},getUrlParams:G,getVehicleData:Ie,unlockPricing:async(e,t)=>{var i;if(null===(i=window)||void 0===i||null===(i=i.DDC)||void 0===i||null===(i=i.userProfileController)||void 0===i||!i.saveInstantEpriceVehicle)return!1;let n=t;if(!n)try{n=await De(e,"uuid")}catch(e){return ae("Failed to unlock pricing:",e),!1}try{return await Promise.all(n.map(e=>(e=>new Promise(t=>{try{window.DDC.userProfileController.saveInstantEpriceVehicle(null,e)}catch(t){ae(`Failed to save vehicle with UUID ${e}:`,t)}t()}))(e))),!0}catch(e){return ae("Failed to unlock pricing:",e),!1}}}},{className:cn,methods:{getItemList:async(e,t)=>{const i=await N();if(!["inventory-badges","inventory-media"].includes(t))throw new Error(`The requested item list ${t} is not enabled for this API.`);if(!["item-list-badges"].includes(e.integrationId))throw new Error("The getItemList method is not allowed for use with this integration.");return i.searchPage||i.detailPage?(sn[t]||(sn[t]=(async(e,t,i)=>{try{const n=await fetch(t,{headers:{Accept:"application/json"}});if(!n.ok)throw e.integrationId&&x(e,{methodType:i,status:"Failed"}),new Error(`Error calling the endpoint at ${t}.`);return e.integrationId&&x(e,{methodType:i,status:"Success"}),0===n.size?{}:await n.json()}catch(e){throw new Error(`Error fetching JSON: ${e.message}`)}})(e,`/api/badge-item-lists/${t}`,"getItemList")),sn[t]):[]},getSettings:ui,hideDefaultPayments:Fi,showDefaultPayments:Ri}}];var hn;un.forEach(e=>{const i=e;Object.entries(i.methods).forEach(e=>{let n=t(e,2),a=n[0],o=n[1];i.className.prototype[a]=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n={integrationId:this.getIntegrationId(),integrationType:this.getIntegrationType()};return"getUrlParams"===a?o.call(null,n,...t):new Promise((e,i)=>{try{e(o.call(null,n,...t))}catch(e){i(e)}})}})});const pn={append:de,create:(e,t,i)=>(x(e,{methodType:"Create",type:t,...i}),"button"===t?ze(e,document.createElement("a"),i):null),insert:ei,insertOnce:async(e,t,i)=>ei(e,t,i,!1),insertCallToAction:ti,insertCallToActionOnce:async(e,t,i,n)=>ti(e,t,i,n,!1),insertGalleryContent:async(e,t,i)=>{try{dt(t);const n=Array.isArray(i)?i:[i];if("vehicle-media"===t){const t=await Ie();pt(e,n,t)}return e&&x(e,{methodType:"insertGalleryContent",location:t}),Promise.resolve()}catch(e){return Promise.reject(e)}},insertMenuContent:async(e,t,i)=>{(e=>{if(!ni.includes(e))throw new Error(`Unsupported device type: '${e}'. Expected one of: ${ni.join(", ")}.`)})((await N()).layoutType);const n=!!document.querySelector('a[data-href="/fragments/ws-nav-mobile.htm"], a[data-href="/navigation-fragments/search-navigation-and-contact.htm"]');n&&document.querySelectorAll('#ddc-mobile-header-nav[data-location="primary-menu primary-menu-top primary-menu-bottom"]').forEach(e=>{e.removeAttribute("data-location")});const a=Array.isArray(i)?i:[i];return(e=>{if(!oi.includes(e))throw new Error(`Unsupported menu target: '${e}'. Expected one of: ${oi.join(", ")}.`)})(t),await L(),a.forEach(i=>{const a=i.position,o=i.callback;(e=>{if(!ai.includes(e))throw new Error(`Unsupported menu position: '${e}'. Expected one of: ${ai.join(", ")}.`)})(a);const r=`${t}-${a}`;ei(e,r,(t,a)=>{for(;t.hasChildNodes();)t.removeChild(t.firstChild);const r=(e=>{const t=e.primaryText,i=e.secondaryText,n=e.expanded,a=e.menuIcon,o=e.subItems,r=e.position,s=e.onclick,l=e.isFragmentNavType,d=void 0===l||l,c=d?"fragment":"header";if(!t)return ae("Required primaryText field is missing."),!1;if(!o||0===o.length){const t=`\n\t\t\t<div class="panel-heading">\n\t\t\t\t<div class="panel-title">\n\t\t\t\t\t<a data-navigation-id="default" class="panel-heading-link accordion-faux collapsed" href="${e.href}" data-iconpos="left">\n\t\t\t\t\t\t<i class="icon-blank"></i>\n\t\t\t\t\t\t<span>${e.primaryText}</span>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`,i=gt(t);
1return s&&i.querySelector("a").addEventListener("click",s),i}const u=n?" in":"",h=n?"":" collapsed",p=document.createElement("div"),g=i?`<span class='subtext'>${i}</span>`:"";let v=gt(`\n\t\t<div class="panel-heading">\n\t\t\t<div class="panel-title">\n\t\t\t\t<div class="row py-3">\n\t\t\t\t\t${a?'<div class="ddc-span2"><i class="ddc-icon ddc-icon-mycars-login-circle ddc-icon-size-xxlarge"></i></div>':""}\n\t\t\t\t\t<div class="${a?"ddc-span10":"ddc-span12"} pt-3 pb-2">\n\t\t\t\t\t\t<p class="m-0">\n\t\t\t\t\t\t\t<a data-navigation-id="default" href="#" class="no-follow panel-heading-link panel-toggle${h} p-0"\n\t\t\t\t\t\t\tdata-toggle="collapse" data-target="#ddc-fragment-accordion-nav-wiapi-${r}" aria-expanded="false"\n\t\t\t\t\t\t\tui-tabs-initial-load="false" rel="nofollow">\n\t\t\t\t\t\t\t\t<i class="ddc-icon ddc-icon-size-small ddc-icon-plus"></i>\n\t\t\t\t\t\t\t\t<span class="ddc-font-size-large font-weight-bold">${t}</span></a>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p class="ddc-font-size-small">${g}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`);d||(v=gt(`\n\t\t\t<div class="panel-heading">\n\t\t\t\t<div class="panel-title">\n\t\t\t\t\t<a data-navigation-id="default" href="#" class="no-follow panel-heading-link panel-toggle${h}"\n\t\t\t\t\tdata-toggle="collapse" data-target="#ddc-header-accordion-nav-wiapi-${r}" aria-expanded="false"\n\t\t\t\t\tui-tabs-initial-load="false" rel="nofollow">\n\t\t\t\t\t\t<div class="pt-2 pb-6">\n\t\t\t\t\t\t\t${a?'<div class="ddc-span1"><i class="ddc-icon ddc-icon-mycars-login-circle ddc-icon-size-xxlarge"></i></div>':""}\n\t\t\t\t\t\t\t<i class="ddc-icon ddc-icon-size-small ddc-icon-plus"></i>\n\t\t\t\t\t\t\t<div class="${a?"ddc-span10":"ddc-span11"}">\n\t\t\t\t\t\t\t\t<span class="ddc-font-size-large font-weight-bold">${t}</span>\n\t\t\t\t\t\t\t\t<p class="ddc-font-size-small">${g}</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`));if(p.appendChild(v),!(null!=e&&e.secondaryText||null!=e&&e.subItems))return p;const m=document.createElement("ul");m.classList.add(`ddc-mobile-${c}-sub-nav`,"list-unstyled"),null!=e&&e.subItems&&e.subItems.forEach(e=>{const t=document.createElement("li"),i=document.createElement("a");i.setAttribute("data-navigation-id","default"),i.classList.add("nav-link","tier3"),i.href=e.href,i.textContent=e.text,"function"==typeof e.onclick&&i.addEventListener("click",e.onclick),t.appendChild(i),m.appendChild(t)});const y=gt(`\n\t\t<div id="ddc-${c}-accordion-nav-wiapi-${r}" class="panel-collapse collapse${u}" aria-expanded="true" style="">\n\t\t\t<div class="panel-body">\n\t\t\t</div>\n\t\t</div>\n\t`);return y.querySelector(".panel-body").appendChild(m),p.appendChild(y),p})({...i,isFragmentNavType:n});if(!r)return;const s=de(e,t,r);o&&o(s,a,i)},!0),x(e,{methodType:"insertMenuContent",location:r})}),!0},update:ii,updateOnce:async(e,t,i)=>ii(e,t,i,!1),updateLink:async function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const a=()=>Zt("updateLink",c,e,null,"links",t,i,n),o=a();try{const n="mobile"===(await N()).layoutType;n&&(await L(),await(async(e,t)=>{if(!document.querySelector('a[data-href*="/navigation-fragments/"], a[data-href*="/fragments/"]'))return void ae("[FRAGMENT_WAIT] No hamburger menu with fragment navigation found, skipping wait");const i=!!document.querySelector('[data-location~="primary-menu"]');let n;n=i?await A(".fragment-content"):await A(".ddc-mobile-fragment-nav");let a=[];try{const i=(await Promise.resolve().then(function(){return Et})).getContentMappings,n=(await i(t)).links||{};a=n[e]||[]}catch(e){ae("[FRAGMENT_WAIT] Error getting content mappings:",e)}const o=()=>{if(a.length>0){if(a.map(e=>`a[href^="${e}"]`).some(e=>null!==n.querySelector(e)))return!0}else if(null!==n.querySelector("a"))return!0;return!1};o()||await new Promise(e=>{const t=new MutationObserver(()=>{o()&&(t.disconnect(),e())});t.observe(n,{childList:!0,subtree:!0,attributes:!1}),o()&&(t.disconnect(),e())})})(t,e),a(),((e,t)=>{const i=document.querySelector(`[data-mobile-override="${e}"]`);i&&i.remove(),document.addEventListener("click",i=>{const n=i.target.closest("a");if(!n)return;if(!n.getAttribute("href"))return;const a=n.closest(".ddc-mobile-header-nav")||n.closest('[data-location~="primary-menu"]')||n.closest(".mobile-menu")||n.closest(".ddc-mobile-header-sub-nav")||n.closest("#ddc-mobile-header-nav"),o=n.dataset.wiapiIntent;if(a&&n.dataset.wiapiProcessed&&o===e){i.preventDefault(),i.stopPropagation();try{const e=t();e&&"object"==typeof e&&"function"==typeof e.onclick&&e.onclick()}catch(e){ae("[MOBILE_OVERRIDE] Error executing callback:",e)}}},{capture:!0});const n=document.createElement("div");n.setAttribute("data-mobile-override",e),n.style.display="none",document.body.appendChild(n),ae("[MOBILE_OVERRIDE] Added mobile menu override for intent:",e)})(t,i))}catch(e){ae("Could not determine layout type, proceeding with standard link update:",e)}return o},modifyContent:(e,t,i)=>{Oi(e,t,i).apply(),x(e,{methodType:"modifyContent",location:t})},load:yi,loadJS:wi,loadCSS:async(e,t)=>yi(e,t,"css"),log:ae,subscribe:(e,t,i)=>{Xe(e,"init"),Ke(t,"eventType");const n=new Ze(e,i);tt.push(t,n),et.forEach(t,t=>{it(e.integrationId,i,t)}),x(e,{subscribedEvent:t})},test:(e,t)=>
1{const i="string"==typeof e?e:e.integrationId;return i&&t&&((e,t,i)=>{let n;if(i){const e=new Date;e.setTime(e.getTime()+24*i*60*60*1e3),n=`; expires=${e.toGMTString()}`}else n="";document.cookie=`${e}=${t}${n}; path=/`})("WebIntegrationAPITestLoader",`${i}|${t}`),void 0!==mi._integrationMode&&yi(e,t)}},gn=class{constructor(e){let t,a;const o=document.currentScript&&"function"==typeof document.currentScript.getAttribute&&""!==document.currentScript.getAttribute("data-web-api-id")?document.currentScript:e;o&&"object"==typeof o&&("function"==typeof o.getAttribute&&""!==o.getAttribute("data-web-api-id")?(t=o.getAttribute("data-web-api-id"),a=o.getAttribute("data-web-api-type")||""):(t=o.integrationId,a=o.integrationType)),!t&&e&&""!==e&&(t=e,a=e),Ke(t,"integrationId"),this.init={integrationId:i(t),integrationType:n(a)},this.utils=new dn(this.init),this.privateUtils=new cn(this.init)}};Object.entries(pn).forEach(e=>{let i=t(e,2),n=i[0],a=i[1];gn.prototype[n]=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return se&&"log"!==n&&ae(`${this.init.integrationId} called ${n}:`,...t),a.call(null,this.init,...t)}});const vn=(window||{}).DDC;vn.API=gn,vn.PrivateAPI=vn.PrivateAPI||{},vn.PrivateAPI={...vn.PrivateAPI,notifyDynamicContent:()=>{an(),fi("all")},notifyInventoryContent:e=>{e?rn(e):on()},timings:{},content:{},getGalleryContent:(e,t)=>(dt(e),st[e][t]),getAllGalleryContent:e=>(dt(e),st[e]),getPageLevelModifications:e=>e?ri[e]:ri,integrationsLoaded:!1,track:x,inventoryData:null};const mn=()=>{(async()=>{var e;await T(),null!=vn&&null!==(e=vn.userProfileController)&&void 0!==e&&e.loadProfile&&vn.userProfileController.loadProfile()})(),(async()=>{window.dispatchEvent(new Event("WIAPIReady")),await xi(),window.DDC.PrivateAPI.integrationsLoaded=!0,window.dispatchEvent(new Event("WIAPILoaded"))})()};null!==(hn=window.DDC)&&void 0!==hn&&hn.apiLoaderInstance?mn():window.addEventListener("WIAPILoaderReady",mn,{once:!0});let yn=!1;const wn=async()=>(V.forEach(e=>{e.disconnect(),V.delete(e)}),Kt.clear(),window.DDC.PrivateAPI.inventoryData={},await Ce(),!0),fn=(e,t)=>{const i=async i=>{try{await t(i)}catch(t){ae(e,`Error in event handler: ${t}`)}};window.DDC&&window.DDC.pubsub?window.DDC.pubsub.subscribe(e,i):window.addEventListener(e,i)},bn=e=>{return!e||e.length<32||(rn({uuid:e}),t={uuid:e},Kt.forEach(e=>{e.apply(t,!0)}),Bt.forEach(e=>{e.apply(t,!0)})),!0;var t},Pn=e=>(Qt({include:e}),!0),Cn=e=>{const t=e.detail,i=t.id;t.isLocation?Pn(i):bn(i)},In=async()=>(window.DDC.PrivateAPI=window.DDC.PrivateAPI||{},window.DDC.PrivateAPI.inventoryData={},await wn(),await on(),await(async()=>{var e;return null!==(e=window)&&void 0!==e&&null!==(e=e.DDC)&&void 0!==e&&null!==(e=e.APIEvents)&&void 0!==e&&e.get&&(window.DDC.APIEvents.get().forEach(e=>{Cn(e)}),window.DDC.APIEvents.received=[]),window.addEventListener("wsInvListingShown",e=>{Cn(e)}),window.addEventListener("wiapiPlaceholderAvailable",e=>{Pn(e.detail.location)}),Pn("listings-")})(),!0),Dn=async()=>{await an();const e=await N();if(null!=e&&e.searchPage||null!=e&&e.detailPage)if(await ie(),await K()){var t;const e=async()=>{if(yn)return!0;yn=!0;let e=null,t=window.innerWidth,i=0;const n=()=>{const n=J("#card-layout-toggle-portal button.active .ddc-icon");if(!n)return;(n=>{clearTimeout(e),i=window.innerWidth,e=setTimeout(async()=>{(i<=n&&t>=n||i>=n&&t<=n)&&(t=window.innerWidth,In())},500)})(n.classList.contains("ddc-icon-layout-grid")?1440:768)};return window.addEventListener("resize",n,!1),n(),await In(),fn("ws-inv-data/inventory",In),window.DDC.InvData.registerToggleListingView(async()=>{await In(),document.querySelectorAll("[data-uuid]").forEach(e=>{const t=e.getAttribute("data-uuid");Cn({detail:{id:t,isLocation:!1}})})}),!0};null!==(t=window.DDC)&&void 0!==t&&null!==(t=t.PrivateAPI)&&void 0!==t&&t.wsInvListingRendered?await e():fn("ws-inv-listing-update",e)}else await on(),await rn()};(async()=>{await T(),Dn()})(),window.addEventListener("DOMContentLoaded",()=>{fi("css"),fi("js")}),window.addEventListener("load",()=>{fi("all")})});
2//# sourceMappingURL=lib.js.map

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.