/* MAPS - one clean Product record per product page for Google. 11/21/2026 (SEO #1): removes the platform's duplicate Product block and keeps ours ("maps-product-ld"). 11/30/2026 (SEO step 1, approved by Darrell): completes our block with what Search Console asked for: - availability: InStock when the page's Add to cart button is active - hasMerchantReturnPolicy: per mapsweb.com/returns-policy (supplies/accessories 30 days, devices 10 days, unopened, by mail, customer pays return shipping unless MAPS error) - shippingDetails: per mapsweb.com/shipping-policy (supplies free UPS Ground at $75+, $15 under $75; device shipping is calculated at checkout or quoted as freight, so devices carry no shipping data) - description from the page's meta description when missing; name trimmed to Google's 150-character limit - pages whose only image is the platform placeholder: our Product block is removed (Google rejects product data without an image; the page itself is unchanged). 11/30/2026 (c): also removes the platform's Product list on category pages (Search Console flagged 12 category pages for missing images and the same missing fields). 11/30/2026 (d): the offer price follows the price the shopper sees. e-automate live pricing and pricing rules load after the page, so the platform's record can carry the old list price (e.g. TNE80Y showed $311.29 while the record said $273.49, below Brother UMAP). Each re-check copies the displayed price (.product-shopping-actions-prices span.has-price[data-value]) into offers.price. */ (function () { if (window.__mxProdLd) return; window.__mxProdLd = 1; var DEVICE = /^(Printers|Multifunction Printers|Large Format Printers|Specialty Printers|Label Printers|Scanners|Laptops|Desktops|Workstations|Monitors|Poly|Mobile Computers|Copiers)/i; function clean() { try { var lds = document.querySelectorAll('script[type="application/ld+json"]'); for (var i = 0; i < lds.length; i++) { var s = lds[i]; if (s.id === 'maps-product-ld') continue; var j; try { j = JSON.parse(s.textContent); } catch (e) { continue; } if (j && j['@type'] === 'Product') { s.parentNode.removeChild(s); continue; } // Category pages: the platform adds a list of Product records (no return/shipping data, empty // descriptions, "PreOrder", some without images). Google reads these as merchant listings and // flags them; each product's own page carries the complete record, so the list is removed. if (Array.isArray(j) && j.length && j.every(function (x) { return x && x['@type'] === 'Product'; })) s.parentNode.removeChild(s); } } catch (e) {} } function topCategory() { var a = document.querySelectorAll('.breadcrumb a, [class*=breadcrumb] a'); for (var i = 0; i < a.length; i++) { var t = (a[i].textContent || '').trim(); if (t && !/^home$/i.test(t) && t !== '...') return t; } return ''; } function cartActive() { var b = document.querySelectorAll('button'); for (var i = 0; i < b.length; i++) if (/add to cart/i.test(b[i].textContent || '') && !b[i].disabled && b[i].offsetParent) return true; return false; } function us(o) { o.addressCountry = 'US'; return o; } function livePrice() { var e = document.querySelectorAll('.product-shopping-actions-prices span.has-price[data-value]'); for (var i = 0; i < e.length; i++) { var v = parseFloat(e[i].getAttribute('data-value')); if (v > 0) return v; } return 0; } function shipFor(o, price, device) { var rate = device ? null : (price >= 75 ? 0 : 15); if (rate === null) { delete o.shippingDetails; return; } o.shippingDetails = { '@type': 'OfferShippingDetails', shippingRate: { '@type': 'MonetaryAmount', value: rate, currency: 'USD' }, shippingDestination: us({ '@type': 'DefinedRegion' }), deliveryTime: { '@type': 'ShippingDeliveryTime', handlingTime: { '@type': 'QuantitativeValue', minValue: 0, maxValue: 1, unitCode: 'DAY' }, transitTime: { '@type': 'QuantitativeValue', minValue: 1, maxValue: 3, unitCode: 'DAY' } } }; } function enrich() { var s = document.getElementById('maps-product-ld'); if (!s) return; if (s.__mxDone) { // Add to cart and the live price arrive after the page loads, so stock status and price can come later. try { var k = JSON.parse(s.textContent), ch = 0; if (!s.__mxAvail && cartActive()) { if (k.offers && !k.offers.availability) { k.offers.availability = 'https://schema.org/InStock'; ch = 1; } s.__mxAvail = 1; } var lp = livePrice(); if (lp && k.offers && k.offers['@type'] === 'Offer' && Math.abs(parseFloat(k.offers.price) - lp) > 0.004) { k.offers.price = lp.toFixed(2); shipFor(k.offers, lp, DEVICE.test(topCategory())); ch = 1; } if (ch) s.textContent = JSON.stringify(k); } catch (e) {} return; } var j; try { j = JSON.parse(s.textContent); } catch (e) { return; } if (!j || j['@type'] !== 'Product') return; var imgs = [].concat(j.image || []).filter(function (u) { return u && !/picture-100|no-?image|placeholder/i.test(u); }); if (!imgs.length) { s.parentNode.removeChild(s); return; } j.image = imgs; if (j.name && j.name.length > 150) j.name = j.name.slice(0, 147).replace(/\s+\S*$/, '') + '...'; if (!j.description) { var m = document.querySelector('meta[name="description"]'); var d = m && m.getAttribute('content'); if (d) j.description = d; } var o = j.offers; if (o && o['@type'] === 'Offer' && o.price) { var lp0 = livePrice(); if (lp0) o.price = lp0.toFixed(2); var price = parseFloat(o.price); var device = DEVICE.test(topCategory()); if (!o.availability && cartActive()) o.availability = 'https://schema.org/InStock'; o.hasMerchantReturnPolicy = { '@type': 'MerchantReturnPolicy', applicableCountry: 'US', returnPolicyCategory: 'https://schema.org/MerchantReturnFiniteReturnWindow', merchantReturnDays: device ? 10 : 30, returnMethod: 'https://schema.org/ReturnByMail', returnFees: 'https://schema.org/ReturnShippingFees', refundType: 'https://schema.org/FullRefund', merchantReturnLink: 'https://www.mapsweb.com/returns-policy' }; // Devices: no shipping data (calculated at checkout; freight items are quoted), only supplies/accessories. shipFor(o, price, device); } s.textContent = JSON.stringify(j); s.__mxDone = 1; } function run() { clean(); try { enrich(); } catch (e) {} } function start() { run(); setTimeout(run, 1500); setTimeout(run, 4000); setTimeout(run, 8000); setTimeout(run, 12000); try { var mo = new MutationObserver(function (ms) { for (var i = 0; i < ms.length; i++) for (var k = 0; k < ms[i].addedNodes.length; k++) { var n = ms[i].addedNodes[k]; if (n.tagName === 'SCRIPT' && n.type === 'application/ld+json') { run(); return; } } }); mo.observe(document.documentElement, { childList: true, subtree: true }); setTimeout(function () { mo.disconnect(); }, 15000); } catch (e) {} } if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start(); })();