PageSourceSearch

https://www.garberauto.com/static/assets/libraries/ddc-phone-swapping/live-latest/umd.js

js garberauto.com collected 2026-09-24 12:06:04 UTC 21,971 bytes, 2 lines download raw bytes

1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["<%= libraryReference %>"]={})}(this,(function(t){"use strict";let e=null;const i=t=>window.aiIdExchange?(e||(e=window.aiIdExchange(t).then((({callsourceSessionId:t}={})=>t||null)).catch((()=>null))),e):Promise.resolve(null),s=(t,e,i={})=>{window.newrelic&&window.newrelic.addPageAction("callsource",{tcdcmpid:e,callsourceStatus:t,...i})};class n{constructor(){if(!window?.DDC?.siteSettings||!window?.DDC?.callTrackingSettings)return void console.warn("Skipping phone swapping: missing window.DDC.siteSettings.callTrackingSettings.");this.DEPT_WILD_CARD="*",this.cleanRegex=/[()\s.+-]/gi,this.phoneMetaParamRegex=/(?:dept=)([^&]*)&(?:accountId=)([^&]*)/,this.defaultCleanCapturingRegEx=/^(\d{3})(\d{3})(\d{4})$/,this.defaultReplacementFormat="$1-$2-$3",this.parensReplacementFormat="($1) $2-$3",this.dotReplacementFormat="$1.$2.$3",this.compiledPhoneRegEx=/((?:(?:\+){1}?(?:[\s-.]{1})?)?(?:(?:\d{7,11})|(?:\(?:?(?:\d{3})\)?(?:[\s-.])?(?:\d{3})(?:[\s-.])?(?:\d{4}))))(?:\?([^\s]*))?/gm,this.compiledLinkPhoneRegex=/(?:tel:)(?:\d{1})?((?:\d{3})(?:[\s-.])?(?:\d{3})(?:[\s-.])?(?:\d{4}))(?:\?([^\s]*))?/,this.urlParams=new URLSearchParams(window.location.search),this.ddcref=this.urlParams.get("ddcref")||sessionStorage.getItem("ddcref"),this.tcdcmpid=this.urlParams.get("tcdcmpid")||sessionStorage.getItem("tcdcmpid"),this.artifactOverride=this.urlParams.get("artifactOverride")||this.getCookieValue("phoneSwappingArtifact"),this.root=document.body,this.head=document.head,this.newrelic=window.newrelic,this.excludedAttributes=["vin","src","uuid","fragmentId","slideId"],this.allAccounts=[],this.waitCount=0,this.waitLimit=15,this.waitCountAutoId=0,this.waitLimitAutoId=30,this.errorCount={},this.errorLimit=3,this.lookupCache={},this.numberArtifact={},this.insertedNodes=[],this.deptDestinationNumbers={},this.thirdPartyTrackingConfig=window.DDC.callTrackingSettings.thirdPartyPhoneTrackingConfiguration,this.metrics={requestsMade:0,numbersSwapped:0},this.tcdcmpid&&this.tcdcmpid.indexOf("&")>-1&&(this.newrelic.setCustomAttribute("tcdCampaignIdInvalid",this.tcdcmpid),this.tcdcmpid=this.tcdcmpid.substring(0,this.tcdcmpid.indexOf("&"))),this.newrelic&&this.tcdcmpid&&this.newrelic.setCustomAttribute("tcdCampaignId",this.tcdcmpid);let t=[];const e=window.DDC.callTrackingSettings.callTrackingAccountIdsOverride||[];if(this.thirdPartyTrackingConfig)t=[window.DDC.siteSettings.accountId],this.loggingContext=`PHONESWAPPING:THIRD PARTY (${this.thirdPartyTrackingConfig.name})`;else{const i=window.DDC.siteSettings.childAccountIds||[];t=e.length<1?[window.DDC.siteSettings.accountId,...i]:[window.DDC.siteSettings.accountId,...e],this.loggingContext="PHONESWAPPING:DDC"}this.accountArtifactsToLoad=t.filter(((t,e,i)=>i.indexOf(t)===e)),this.platform=window.DDC.client.isMobile?"DDC_MOBILE":"DDC_PRIMARY_WEBSITE",this.log(`Phone Swapping platform: ${this.platform}`),this.DDC_DEPT_CONVENTION={"COMPANY PHONE 2":"CUSTOM1","COMPANY PHONE 3":"CUSTOM2"},this.DDC_ONSITE_CONVENTION={CUSTOM1:"SERVICE",CUSTOM2:"PARTS"},this.FETCH_ERROR_MESSAGE="Error fetching phone numbers:",this.logIfFound(this.tcdcmpid,`Found TCD campaign ID: ${this.tcdcmpid}`),this.logIfFound(this.ddcref,`Found ddcref campaign ID: ${this.ddcref}`),this.logIfFound(this.artifactOverride,`Phone Swapping Artifact Override JSON: ${this.artifactOverride}`),this.processedNodes=new WeakSet}init(t){if(this.numberArtifact){const e=performance.now();this.mergePhoneArtifacts(),this.domTraverse(this.root,this.swapNumbers),this.domTraverse(this.head,this.swapNumbers);const i=performance.now(),s=(i-e).toFixed(2),n=(i-t).toFixed(2);this.trackPerformance("DOM PARSE",s),this.trackPerformance("TOTAL TIME ELAPSED",n),"loading"===document.readyState?window.addEventListener("DOMContentLoaded",(()=>this.onReady())):this.onReady(),window.addEventListener("wsInvListingShown",(t=>{const e=t.detail.id,i=document.querySelector(`[data-uuid='${e}']`);i&&this.domTraverse(i,this.swapNumbers)}))}}onReady(){(async()=>{const t=sessionStorage.getItem("tcdcmpid");t&&s("tcdcmpid found in session storage",t);const e=new URLSearchParams(window.location.search).get("tcdcmpid")||t;if(window.aiIdExchange)try{const t=await i(e);if(!t)throw new Error("callsourceSessionId is undefined");s("aiIdExchange success",e,{callsourceSessionId:t}),window.coxAutoDataLayer.push({user:{sessionizedCallTrackingId:t}})}catch(t){window?.DDC?.log("error","aiIdExchange failed"),s("aiIdExchange failed",e)}})(),this.domTraverse(this.root,this.swapNumbers),this.domTraverse(this.head,this.swapNumbers),this.observeDOM(document.body,this.observedNodeTraverse.bind(this,this))}initIfReady(t){Object.values(this.loadedAccountArtifacts).filter((t=>t)).length>0?(this.trackPerformance("TOTAL ARTIFACT REQUESTS",(performance.now()-t).toFixed(2)),this.init(t)):this.log("No phone artifacts loaded. Skipping DOM parse.")}observeDOM(t,e){const i=window.MutationObserver||window.WebKitMutationObserver;if(t&&1===t.nodeType)if(i){new i((t=>{const i=[];t.forEach((t=>{t.addedNodes.length&&i.push(...t.addedNodes)})),i.length&&e(i)})).observe(t,{childList:!0,subtree:!0})}else window.addEventListener&&(t.addEventListener("DOMNodeInserted",e,!1),t.addEventListener("DOMNodeRemoved",e,!1))}observedNodeTraverse(t,e){e.forEach((e=>{1===e.nodeType&&(t.swapPhoneOnNode(e),e.childNodes.length&&this.observedNodeTraverse(t,Array.from(e.childNodes)))}
1))}domTraverse(t,e){for(t||(t=document.body),e.call(this,t),t&&(t=t.firstChild);t;){const i="SCRIPT"===t.tagName&&t.getAttribute&&t.getAttribute("src"),s="LINK"===t.tagName||"STYLE"===t.tagName;i||s||this.domTraverse(t,e),t=t.nextSibling}}cleanNumber(t){return t.replace(this.cleanRegex,"")}swapNumbers(t){const e=t||this.root;this.numberArtifact?this.swapPhoneOnNode(e):this.waitCount<this.waitLimit&&(this.waitCount++,setTimeout((()=>this.swapNumbers(t)),100))}swapPhoneOnNode(t){if(t&&!this.processedNodes.has(t)&&(this.processedNodes.add(t),t)){let e,i;switch(t.hasAttribute&&t.hasAttribute("data-phone-ref")&&(e=t.getAttribute("data-phone-ref"),i=t.getAttribute("data-account-ref")),t.dataset&&this.swapDataAttributeNumber(t,e,i),t.nodeName){case"#text":this.swapTextNodeNumber(t,e,i);break;case"A":this.swapLinkNodeNumber(t,e,i);break;case"META":this.swapMetaNodeNumber(t,e,i)}}}swapDataAttributeNumber(t,e,i){if(t.dataset){let s=e,n=i;if(!s&&!n){const e=this.getReplacementMetaDataFromNode(t);[s,n]=e}Object.keys(t.dataset).forEach((e=>{const i=t.dataset[e],r=this.compiledPhoneRegEx.exec(i);if(r&&r[0]&&this.validPhoneAttr(e)){const o=r[0],a=r[1],c=r[2];if(c&&this.phoneMetaParamRegex.test(c)){const t=this.phoneMetaParamRegex.exec(c);[,s,n]=t}const d=this.getNumber(a,s,n);if(d){const r=this.formatReplacementNumber(d,a);this.logNumberSwap("DATA",o,a,s,n,r),t.dataset[e]=i.replace(o,r)}else t.dataset[e]=i.replace(o,a)}}))}}swapMetaNodeNumber(t,e,i){if(t&&t.content&&t.content.length>0){let s;const n=e,r=i;let o=t.content;for(;null!==(s=this.compiledPhoneRegEx.exec(t.content));){const t=s[0],e=s[1],i=this.getNumber(e,n);if(i){const s=this.formatReplacementNumber(i,e);this.logNumberSwap("META",t,e,n,r,s),o=o.replace(new RegExp(t,"g"),s)}}t.content=o}}swapTextNodeNumber(t,e,i){if(t&&t.nodeValue&&t.nodeValue.length>0){let s;for(;null!==(s=this.compiledPhoneRegEx.exec(t.data));){let n=e,r=i;if(!n&&!r){const e=this.getReplacementMetaDataFromNode(t);[n,r]=e}const o=s[0],a=s[1],c=s[2];if(c&&this.phoneMetaParamRegex.test(c)){const t=this.phoneMetaParamRegex.exec(c);[,n,r]=t}const d=this.getNumber(a,n,r);if(d){const e=this.formatReplacementNumber(d,a);this.logNumberSwap("TEXT",o,a,n,r,e),t.nodeValue=t.nodeValue.replace(o,e);const{parentNode:i}=t;i&&i.hasAttribute("data-phone-ref")&&(i.replaceWith?i.replaceWith(t):i.parentNode.replaceChild(t,i))}}}}swapLinkNodeNumber(t,e,i){const s=this.compiledLinkPhoneRegex.exec(t.href);if(s&&s[0]){let n=e,r=i;const o=s[0],a=s[1],c=s[2];if(!n&&!r){const e=this.getReplacementMetaDataFromNode(t);[n,r]=e}if(c&&this.phoneMetaParamRegex.test(c)){const t=this.phoneMetaParamRegex.exec(c);[,n,r]=t}const d=this.getNumber(a,n,r);d?(this.logNumberSwap("LINK",o,a,n,r,d),t.href=`tel:${d.replace(/\s*/gi,"")}`):(t.href=`tel:${a.replace(/\s*/gi,"")}`,t.setAttribute("data-phone-ref",n),t.setAttribute("data-account-ref",r))}}getCategorizedTrackingData(t,e,i,s){return t.find((t=>!!t.isTrackingNumber&&(i?s?t.trackingCategory===i&&t.trackingId===s:t.trackingCategory===i:t.trackingCategory===e)))}validPhoneAttr(t){return!this.excludedAttributes.includes(t)}getDeptForDDCCategory(t,e){if(t.indexOf("COMPANY PHONE 2")>-1){if("DDC_MOBILE"===e)return"SERVICE";if("DDC_PRIMARY_WEBSITE"===e)return"CUSTOM1"}else if(t.indexOf("COMPANY PHONE 3")>-1){if("DDC_MOBILE"===e)return"PARTS";if("DDC_PRIMARY_WEBSITE"===e)return"CUSTOM2"}else if(1===t.length)return t[0]}getReplacementNumberArtifacts(t,e,i){let s=[];if(t[e]){if(t[e][i])s=[...t[e][i]];else{const n=i?.toUpperCase();n&&Object.keys(t[e]).forEach((i=>{i.toUpperCase().startsWith(n)&&(s=[...s,...t[e][i]])}))}this.DDC_ONSITE_CONVENTION[i]&&t[e][this.DDC_ONSITE_CONVENTION[i]]&&(s=[...s,...t[e][this.DDC_ONSITE_CONVENTION[i]]]),t[e][this.DEPT_WILD_CARD]&&(s=[...s,...t[e][this.DEPT_WILD_CARD]])}return s}phoneNumberOnPageToAccountDept(t,e){let i=null,s=null;const n=t[e]||{};for(const t of Object.keys(n)){const e=n[t];if(this.tcdcmpid)for(const n of e){if(this.getReplacementNumberArtifacts(this.numberArtifact,t,n)){i=n,s=t;break}}else{const n=this.getDeptForDDCCategory(e,this.platform);if(this.getReplacementNumberArtifacts(this.numberArtifact,t,n)){i=n,s=t;break}for(const n of e){let e=n;e=this.DDC_DEPT_CONVENTION[n]||this.DDC_DEPT_CONVENTION[n.toUpperCase()]||n;if(this.getReplacementNumberArtifacts(this.numberArtifact,t,e)){i=e,s=t;break}}}}return[s,i]}getReplacementMetaDataFromNode(t){if(!t)return[];let e,i,s=t,n=0,r=s.hasAttribute&&s.hasAttribute("data-phone-ref");for(;!r&&s&&s!==document.body&&n<3;)s=s.parentNode,r=s&&s.hasAttribute&&s.hasAttribute("data-phone-ref"),n+=1;return s&&s.getAttribute&&(e=s.getAttribute("data-phone-ref"),i=s.getAttribute("data-account-ref")),[e,i]}getReplacementTrackingData(t,e){let i=null;const s=e[1];return t&&(this.tcdcmpid&&("DDC_MOBILE"===this.platform&&"SALES"===s&&(i=this.getCategorizedTrackingData(t,this.platform,"MOBILE_AD",this.tcdcmpid)),i||(i=this.getCategorizedTrackingData(t,this.platform,"TCD",this.tcdcmpid))),!i&&this.ddcref&&(i=this.getCategorizedTrackingData(t,this.platform,"CAMPAIGN",this.ddcref)),i||(i=this.getCategorizedTrackingData(t,this.platform,this.platform))),i}getNumber(t,e,i){if(!t||!i)return!1;const s="DDC_MOBILE"===this.platform?"MOBILE_AD":"TCD",n=this.cleanNumber(t).replace("tel:","");this.log(`Clean lookup number from cleanNumber: ${n} and account: ${i}`);let r="";if(!e||!i)return null;r=`${n}_${e}_${i}`,this.log(`Lookup key: ${r} and current cache, checking index for already swapped: ${Object.values(this.lookupCache).indexOf(r)}`,this.lookupCache);const o=-1!==Object.values(this.lookupCache).indexOf(r);if(this.log(`Account ${i}, already swapped: ${o}`),o)return null;if(!this.lookupCache[r]&&(this.lookupCache[r]=this.lookupNumber(n,e,i),this.tcdcmpid&&Object.keys(this.allAccounts).length)){const t=this.allAccounts.filter((t=>t.account===i));this.log(`For ${i} found ${t.length>0?t.length:0} results`),t.forEach((t=>{const i=t.phones.filter((t=>t.trackingId===this.tcdcmpid&&t.profitCenter===e&&t.trackingCategory===s));if(i.length)this.log(`Results in phone swap array matching ${this.tcdcmpid} ${e}`,i),this.lookupCache[r]=i[0].number;else{const t=this.allAccounts.filter((t=>t.account===window.DDC.siteProperties.topLevelPhoneSwappingAccount));if(this.log(`Using top level account for number: ${JSON.stringify(t)}`),t.length){const i=t[0].phones.filter((t=>t.trackingId===this.tcdcmpid&&t.profitCenter===e&&t.trackingCategory===s));i.length&&(this.log(`Top level account after filters: ${JSON.stringify(i)}`),this.lookupCache[r]=i[0].number)}}}))}return this.lookupCache[r]}lookupNumber(t,e,i){let s=null;11===t.length&&([s,...t]=t);const n=[i,e];if(!n[0]||!n[1]){if(this.deptDestinationNumbers[t]){const e=this.phoneNumberOnPageToAccountDept(this.deptDestinationNumbers,t);n[0]=n[0]||e[0],n[1]=n[1]||e[1]}}const r=this.getReplacementNumberArtifacts(this.numberArtifact,n[0],n[1]),o=this.getReplacementTrackingData(r,n),a=o?o.number:null;return a&&s?`${s} ${a}`:(this.log(`Replacement number from lookupNumber: ${a}`),a)}detectExistingFormat(t){if(t){if(/^\(\d{3}\)/.test(t))return this.parensReplacementFormat;if(/^\d{3}\.\d{3}\.\d{4}$/.test(t))return this.dotReplacementFormat}return this.defaultReplacementFormat}formatReplacementNumber(t,e){let i,s;switch(window?.DDC?.siteProperties?.phoneNumberFormat){case"parentheses":s=this.parensReplacementFormat;break;case"dot":s=this.dotReplacementFormat;break;default:s=this.detectExistingFormat(e)}return t&&t===this.cleanNumber(t)&&(i=t.replace(this.defaultCleanCapturingRegEx,s)),i||t}loadNumbers(t,e){const i=e||performance.now();if(this.artifactOverride){const e=JSON.parse(this.artifactOverride);this.fillDeptToDestMap(t,e.phones),this.log(`Using Artifact Override: ${(performance.now()-i).toFixed(2)} ms.`),this.init(i)}else if(this.thirdPartyTrackingConfig){const{url:s,apiKey:n,username:r,password:o,accountId:a}=this.thirdPartyTrackingConfig,c=performance.now();this.metrics.requestsMade+=1;const d=new XMLHttpRequest;d.open("POST",s,!0),d.onreadystatechange=function(){if(4===d.readyState){const{status:s}=d;if(200===s){const e=(performance.now()-c).toFixed(2);e>500&&this.trackPerformance("ARTIFACT REQUEST SLOW",e),this.loadedAccountArtifacts[t]=!0;const s=JSON.parse(d.responseText).map((t=>({number:t.number,isTrackingNumber:!0,trackingCategory:this.platform,locationOnSite:this.DEPT_WILD_CARD})));this.fillDeptToDestMap(t,s,!1),this.initIfReady(i)}else s>=400&&s<500?this.handleNumberLoadFail.apply(this,[t,e,s]):s>=500&&this.handleNumberLoadError.apply(this,[t,e,s]);this.newrelic&&this.newrelic.setCustomAttribute("phoneSwapStatus",s)}}.bind(this),d.send(this.generateThirdPartyPostBody(r,o,n,a,"jsonString"))}else{const s=performance.now();this.metrics.requestsMade+=1;const n=new XMLHttpRequest;n.open("GET",`${window.DDC.callTrackingSettings.callTrackingArtifactBaseUrl}/${t}.json`,!0),n.onload=()=>
1{if(200===n.status){const e=JSON.parse(n.responseText);this.fillDeptToDestMap(t,e.phones),this.loadedAccountArtifacts[t]=!0;const r=(performance.now()-s).toFixed(2);r>500&&this.trackPerformance("ARTIFACT REQUEST SLOW",r),this.initIfReady(i)}else this.handleNumberLoadError.apply(this,[t,e,n.status])},n.onerror=()=>{n.status>=500?this.handleNumberLoadError.apply(this,[t,e,n.status]):this.handleNumberLoadFail.apply(this,[t,e,n.status])},n.send()}}loadNumbersFromService(t,e=performance.now()){if(this.metrics.requestsMade+=1,this.newrelic){const t=window.DDC.phonesUrl.includes("phone-swap-service-v2")?"v2":"v1";this.newrelic.setCustomAttribute("phoneSwapServiceVersion",t)}this.isAutoIdIntegration()&&this.waitCountAutoId<this.waitLimitAutoId?window.autoid_inited?t.forEach((t=>{this.loadNumbersFromAutoId(t,e)})):(this.waitCountAutoId+=1,setTimeout((()=>this.loadNumbersFromService(t,e)),100)):this.fetchAccountsFromService(t,e)}fetchAccountsFromService(t,e,{onSuccess:i=()=>{},onFailure:s=()=>{}}={}){const n=new URL(window.DDC.phonesUrl);n.searchParams.append("platform",this.platform),this.tcdcmpid&&n.searchParams.append("tcdcmpid",this.tcdcmpid),this.ddcref&&n.searchParams.append("ddcref",this.ddcref);try{const r=new AbortController,o=setTimeout((()=>r.abort()),3e3);fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:r.signal}).then((t=>(clearTimeout(o),t.json()))).then((t=>{Array.isArray(t)?(t.forEach((t=>{const e=this.allAccounts.findIndex((e=>e.account===t.account));e>-1?this.allAccounts[e]=t:this.allAccounts.push(t);const{account:i,phones:s}=t;this.fillDeptToDestMap(i,s),this.loadedAccountArtifacts[i]=!0})),this.initIfReady(e),i()):(this.log(this.FETCH_ERROR_MESSAGE,"Response is not an array"),s())})).catch((t=>{this.log(this.FETCH_ERROR_MESSAGE,t),s()}))}catch(t){this.log(this.FETCH_ERROR_MESSAGE,t),s()}}isAutoIdIntegration(){return window.DDC.enableCallsourcePhoneSwapping&&!!window.aiGetNumbers}
1reportAutoIdNumberRequest(t,e,i,s,n){this.newrelic&&this.newrelic.addPageAction("autoIdNumberRequest",{ddcAccountId:t,numbersRequested:e,numbersReturned:i,outcome:s,callsourceSessionId:n})}async loadNumbersFromAutoId(t,e){const s=[],n=[],r=i(this.tcdcmpid);try{const[i,o]=await Promise.all([window.aiGetNumbers({numbers:n}),r]),a=i?.campaigns,c={};(a||[]).forEach((t=>{const{campaign_name:e,replaced_number:i,dni:n}=t;if(!e||!i||!n)return;const r=e.toUpperCase(),o=this.cleanNumber(`${n}`),a={number:o,isTrackingNumber:!0,department:r,locationOnSite:r,trackingCategory:this.platform,profitCenter:r};s.push(a),c[`${r}_replacedNumber`]=`${i}`,c[`${r}_dni`]=o})),this.newrelic&&Object.keys(c).length>0&&this.newrelic.addPageAction("autoIdCampaignResult",{ddcAccountId:t,callsourceSessionId:o,...c}),this.reportAutoIdNumberRequest(t,n.length,s.length,s.length>0?"success":"empty",o),0===s.length?this.fetchAccountsFromService([t],e,{onSuccess:()=>{this.newrelic&&this.newrelic.addPageAction("autoIdFallback",{ddcAccountId:t,triggerReason:"empty",fallbackOutcome:"success"})},onFailure:()=>{this.newrelic&&this.newrelic.addPageAction("autoIdFallback",{ddcAccountId:t,triggerReason:"empty",fallbackOutcome:"fail"}),this.handleNumberLoadFail(t,e,"[aiGetNumbers] no results.")}}):(this.allAccounts.push({account:t,phones:s}),this.fillDeptToDestMap(t,s),this.loadedAccountArtifacts[t]=!0,this.initIfReady(e))}catch(i){const s=await r;
1this.reportAutoIdNumberRequest(t,n.length,0,"error",s),this.fetchAccountsFromService([t],e,{onSuccess:()=>{this.newrelic&&this.newrelic.addPageAction("autoIdFallback",{ddcAccountId:t,triggerReason:"error",fallbackOutcome:"success"})},onFailure:()=>{this.newrelic&&this.newrelic.addPageAction("autoIdFallback",{ddcAccountId:t,triggerReason:"error",fallbackOutcome:"fail"}),this.handleNumberLoadFail(t,e,i)}})}}loadAllNumbers(){const t=performance.now();if(this.loadedAccountArtifacts={},this.thirdPartyTrackingConfig){const e=this.accountArtifactsToLoad[0];this.loadNumbers(e,t,this.thirdPartyTrackingConfig)}else this.loadNumbersFromService.bind(this,this.accountArtifactsToLoad,t)()}fillDeptToDestMap(t,e,i=!0){e.forEach((e=>{!0===i&&(this.deptDestinationNumbers[this.cleanNumber(e.number)]?(this.deptDestinationNumbers[this.cleanNumber(e.number)][t]||(this.deptDestinationNumbers[this.cleanNumber(e.number)][t]=[]),this.deptDestinationNumbers[this.cleanNumber(e.number)][t].push(e.department&&e.department.toUpperCase())):(this.deptDestinationNumbers[this.cleanNumber(e.number)]={[t]:[]},this.deptDestinationNumbers[this.cleanNumber(e.number)][t].push(e.department&&e.department.toUpperCase()))),!0===e.isTrackingNumber&&this.fillPhoneArtifact(t,e)}))}fillPhoneArtifact(t,e){this.numberArtifact[t]?(this.numberArtifact[t][e.locationOnSite]=this.numberArtifact[t][e.locationOnSite]||[],this.numberArtifact[t][e.locationOnSite].push(e)):this.numberArtifact[t]={[e.locationOnSite]:[e]}}mergePhoneArtifacts(){window.DDC.siteProperties&&!0===window.DDC.siteProperties.callTrackingRollupNumbersToAccount&&window.DDC.callTrackingSettings.callTrackingAccountIdsOverride.filter((t=>t!==window.DDC.siteSettings.accountId)).forEach((t=>{void 0!==this.numberArtifact[t]&&Object.keys(this.numberArtifact[t]).forEach((e=>{void 0!==this.numberArtifact[window.DDC.siteSettings.accountId]&&(void 0===this.numberArtifact[window.DDC.siteSettings.accountId][e]&&(this.numberArtifact[window.DDC.siteSettings.accountId][e]=[]),this.numberArtifact[window.DDC.siteSettings.accountId][e]=[...this.numberArtifact[window.DDC.siteSettings.accountId][e].concat(this.numberArtifact[t][e])])}))}))}handleNumberLoadError(t,e,i){if(this.errorCount[t]=this.errorCount[t]||0,this.errorCount[t]+=1,this.errorCount[t]<this.errorLimit){const s="ARTIFACT REQUEST ERROR "+(i?` - ${i}`:"");this.log(s),this.trackPerformance(s,(performance.now()-e).toFixed(2)),this.loadNumbers(t,e)}else this.handleNumberLoadFail(t,e,null,"error limit")}handleNumberLoadFail(t,e,i){const s="ARTIFACT REQUEST FAILED "+(i?` - ${i}`:"");this.loadedAccountArtifacts[t]=!1,this.initIfReady(e),this.trackPerformance(s,(performance.now()-e).toFixed(2)),this.log(`NUMBERS NOT SWAPPED FOR ${t}`)}getCookieValue(t){const e=new RegExp(`${t}=(.*?)(;|$)`).exec(document.cookie);return e?e[1]:null}logIfFound(t,e){t&&this.log(e)}log(...t){if(!(window.location.search.indexOf("_phoneswappingdebug=true")>0&&window.console))return this.log=function(){},null;window.console.log.apply(this,t)}logNumberSwap(t,e,i,s,n,r){this.metrics.numbersSwapped+=1,this.newrelic&&this.newrelic.setCustomAttribute("phoneNumbersSwapped",this.metrics.numbersSwapped),this.log(`SWAPPING NUMBER ${t}:`),this.log(`Found Swappable Content: ${e}`);const o=n&&s?`for ${n}-${s}`:" first found ";this.log(`${i} ${o} with ${r}`)}trackPerformance(t,e){this.log(`${t} took ${e}ms.`),this.newrelic&&this.newrelic.addPageAction("phoneSwapping",{loggingContext:this.loggingContext,action:t,duration:e?parseFloat(e):0})}generateThirdPartyPostBody(t,e,i,s,n="json"){const r={api:i,username:t,password:e,site_id:parseInt(s,10),external_id:window.DDC.callTrackingSettings.callTrackingSessionId,currentPage:document.location.href,defaultPage:window.DDC.siteSettings.defaultDomain,defaultDomain:window.DDC.siteSettings.defaultDomain,cookies:{utmz:this.getCookieValue("__utmz"),utma:this.getCookieValue("__utma")}};return document.referrer&&(r.previousPage=encodeURIComponent(document.referrer)),"jsonString"===n?JSON.stringify(r):"json"===n?r:void 0}}const r=new n;window.phoneSwapping=r,r?.loadAllNumbers?.(),t.PhoneSwapping=n,t.phoneSwapping=r}));
2//# sourceMappingURL=umd.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.