PageSourceSearch

https://coborns.com/scripts/addCallout.js?v=P9q7mme4DOTJ02xndXqVJDdF9xJRBTxgzJqQDAvJ7vI

js coborns.com collected 2026-10-03 23:44:39 UTC 4,684 bytes, 1 lines download raw bytes

1!function(){async function t(){if(!window.instacartUrl||"undefined"===window.instacartUrl)return void console.log("Instacart URL is not set correctly:",window.instacartUrl);window.__adCalloutInitDataPromise||(window.__adCalloutInitDataPromise=async function(){await new Promise(((t,e)=>{const n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===this.readyState&&200===this.status){const e=new Event("initRequestCompleted");document.dispatchEvent(e),t()}},n.open("POST",`${window.instacartUrl}/idp/v1/init`,!0),n.withCredentials=!0,n.send(null)}));const t=await async function(){const t=`${window.instacartUrl}/idp/v1/users/self/location`;try{const e=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!e.ok)throw new Error(`Failed to fetch Instacart zipcode: ${e.status}`);const n=await e.json();return console.log("Current zipcode:",n),n.postal_code||null}catch(t){return console.error("Error fetching Instacart zipcode:",t),null}}();if(!t)return console.log("No zipcode record found."),null;const e=await async function(t){const e=`${window.instacartUrl}/idp/v1/shops?postal_code=${t}`;try{const t=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json"},credentials:"include"});if(!t.ok)throw new Error(`Failed to fetch Instacart store ids: ${t.status}`);const n=await t.json();return console.log("Store Ids:",n),n||null}catch(t){return console.error("Error fetching Instacart store ids:",t),null}}(t);return e?{zipcode:t,storeId:e}:(console.log("No store id record found."),null)}());const t=await window.__adCalloutInitDataPromise;if(!t)return;const i=Array.from(document.querySelectorAll(".adContainer"));if(0!==i.length)for(const s of i){const i=s.getAttribute("data-widget-id");if(i)try{const c=await e(t.storeId.shops[0].address.street_address,i),{requiredTags:l,hasUserTags:d}=await n(c,i);if(!l||0===l.size)continue;const u=s.getAttribute("data-default-banner-id")||"",f=await o(l,0,i,u);if(f)r(f.Body,f.Link,!0,i);else if(u.trim()){const t=await a(u,i);t&&t.Body?r(t.Body,null,!0,i):r(null,null,!1,i)}else r(null,null,!1,i);await new Promise((t=>setTimeout(t,0)))}catch(t){console.error(`Error processing widget ${i}:`,t)}}}async function e(t,e){const n=(t=t.replace(/\u2018/g,"'").replace(/\u2019/g,"'")).replace(/'/g,"''"),o=`/api/default/locations?$select=Id,Name,ctabannerassociation&$filter=${encodeURIComponent(`Address/Street eq '${n}'`)}`;try{const t=await fetch(o);if(!t.ok)throw new Error(`Failed to fetch location data for Widget ${e}: ${t.status}`);const n=await t.json();return console.log("Location data:",n),n.value?.[0]||null}catch(t){return console.error("Error fetching location:",t),null}}async function n(t,e){try{const n=document.querySelector(`#adContainer-${e}`).getAttribute("data-classifications");let o=[];try{o=n?JSON.parse(n):[]}catch(t){console.error(`JSON Parsing Error for Widget ${e}:`,t)}const a=new Set(o.map((t=>t?.id?t.id.trim():null)).filter((t=>
1t))),r=new Set(t?.ctabannerassociation||[]);let i;console.log(`Widget ${e} - Location Tags:`,[...r]);let s=a.size>0;return i=s?new Set([...r,...a]):r,console.log(`Widget ${e} - Final Required Tags:`,[...i]),{requiredTags:i,hasUserTags:s}}catch(t){return null}}async function o(t,e,n,o){if(!t||0===t.size)return console.warn(`No required tags for widget ${n}.`),null;let a=0;const r=[];for(;;){const t=`/api/default/calloutbanners?$select=Id,PublicationDate,Title,Body,Link,ctabannerassociation&$top=100&$skip=${a}`,e=await fetch(t);if(!e.ok)throw new Error(`Widget ${n} - Fetch error ${e.status}`);const o=await e.json();if(r.push(...o.value),o.value.length<100)break;a+=100}const i=[...t],s=r.filter((t=>{if(o?.trim()&&t.Id===o)return!1;const e=new Set(t.ctabannerassociation||[]);return i.every((t=>e.has(t)))&&e.size===i.length})).map((e=>({...e,matchScore:(e.ctabannerassociation||[]).filter((e=>t.has(e))).length}))).sort(((t,e)=>e.matchScore-t.matchScore));return s.length?s[0]:null}async function a(t,e){const n=`/api/default/calloutbanners(${t})`;try{const t=await fetch(n);if(!t.ok)throw new Error(`Failed to fetch default ad banner: ${t.status}`);const o=await t.json();return console.log(`Widget ${e} - Default banner data:`,o),o||null}catch(t){return console.error("Error fetching default ad banner:",t),null}}function r(t,e,n,o){const a=document.querySelector(`#adContainer-${o}`);if(a&&(a.style.display=n?"block":"none",n&&(a.style.height="auto")),t){const e=a.querySelector(".adBody");e&&(e.innerHTML=t)}console.log(`Widget ${o} - Ad Displayed:`,{body:t,link:e})}!function e(){window.instacartUrl&&"undefined"!==window.instacartUrl?document.addEventListener("ic-session-ready",t):setTimeout(e,50)}()}();

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.