{
  "version": 3,
  "sources": ["/cdn/shop/t/64/assets/dcl-cart-bonus.js?x=1"],
  "sourcesContent": ["/* dcl-cart-bonus.js  (rev 11)\n * 2026-11-02 (evening), Jake's call: clearance pairs (tag no-discount, or marked\n *   down with compare at above price) no longer earn the card, matching the terms\n *   page. This replaces the 2026-08-29 note below. Open box still excluded.\n * Dialed Cycling Lab, confirms the bonus gift card on the cart page.\n *\n * WHY THIS EXISTS\n * Google Merchant Center requires that a promotion be redeemable at checkout,\n * and that confirmation of receipt appear at cart or checkout. The card is\n * issued by a Shopify Flow workflow that fires on order creation, so the card\n * follows within the hour. This line is what confirms it at the moment of\n * purchase. Checkout itself is not editable on a non-Plus plan, so the cart\n * page is the surface we have.\n *\n * SURFACES\n * There are three ways to reach checkout and this covers two of them:\n *\n *   /cart page        covered, mounts on load\n *   cart drawer       covered, mounts when the drawer opens\n *   Shop Pay direct   NOT covered. Buy It Now goes from the product page straight\n *                     to Shopify's checkout, and checkout UI is not editable\n *                     without Shopify Plus. Those shoppers still see the line on\n *                     the product page before they click.\n *\n * The Alpha Loyalty cart block was removed 2026-08-27, so nothing re-renders the\n * /cart page itself. The drawer is different: it is built on open and torn down on\n * close, so the observer below re-injects each time rather than mounting once.\n *\n * ELIGIBILITY\n * Mirrors the Flow workflow exactly: vendor is Lake Cycling, product tagged\n * Shoes. /cart.js exposes vendor but not tags, so each Lake line is checked\n * against /products/{handle}.js for its tag list. Lake carts are one or two\n * lines, so this is a cheap lookup.\n *\n * The no-discount exclusion was REMOVED 2026-08-29 on Jake's call. Clearance\n * pairs earn the card, so do not add no-discount back. EXCEPTION 2026-11-02,\n * Jake's call: open box pairs (tag Open Box) do NOT earn the card. This file,\n * the Flow, and theme.liquid all exclude the Open Box tag. Otherwise the\n * Merchant Center promotion LAKE-GC-20-2026 covers every Lake shoe, and Google\n * requires receipt be confirmed at cart or checkout for everything in scope.\n *\n * Separately, the DCL_LAKE_OFFER_ELIGIBLE flag in theme.liquid still excludes\n * no-discount and must, because that one drives the 12 percent popup and 12\n * percent must never land on already-marked-down product.\n *\n * If those conditions ever drift from the Flow's, the cart will promise a card\n * the workflow does not send. Keep them in sync.\n *\n * AMOUNT\n * One 20 dollar card per qualifying pair, so the figure shown is 20 times the\n * qualifying quantity in the cart. This must match what the Flow issues. The\n * Flow loops line items and creates one card per qualifying line worth 20 times\n * that line's quantity. Change one and you must change the other.\n */\n(function () {\n  'use strict';\n\n  if (window.__dclCartBonus) return;\n  window.__dclCartBonus = true;\n\n  var VENDOR = 'Lake Cycling';\n  var NEED_TAG = 'shoes';\n  var SKIP_TAG = 'open box'; // open box pairs never earn the card (2026-11-02)\n\n  var LEAD = 'Your ';\n  var TAIL = ' Dialed gift card is emailed once your order is placed.';\n  var TAIL_MULTI = ' in Dialed gift cards is emailed once your order is placed.';\n  var PER_PAIR = 20;\n  var TERMS_HREF = '/pages/shoe-gift-card-terms';\n  var TERMS_LABEL = 'Terms';\n\n  // Preferred placement: first child of the cart footer wrapper, which puts the\n  // line above the Order note and Estimated shipping accordions where it reads as\n  // part of the order rather than a footnote on the checkout button.\n  var PREPEND = ['.cart__footer-wrapper', '.cart-drawer__footer', '.drawer__footer'];\n\n  // Fallback: insert before the checkout button. Shopify's cart form requires the\n  // name attribute, so it is the most reliable target in any theme.\n  var ANCHORS = [\n    '[name=\"checkout\"]',\n    '.cart__ctas',\n    '.cart__footer',\n    'form[action$=\"/cart\"] .cart__blocks',\n    'form[action$=\"/cart\"]'\n  ];\n\n  function anchor(root) {\n    for (var i = 0; i < PREPEND.length; i++) {\n      var el = root.querySelector(PREPEND[i]);\n      if (el) return { el: el, mode: 'prepend' };\n    }\n    for (var j = 0; j < ANCHORS.length; j++) {\n      var b = root.querySelector(ANCHORS[j]);\n      if (b) return { el: b, mode: 'before' };\n    }\n    return null;\n  }\n\n  // Containers that may hold a cart. The page itself is always checked; the rest\n  // are drawer implementations across common themes.\n  var ROOTS = [\n    '#CartDrawer',\n    'cart-drawer',\n    '.cart-drawer',\n    '.drawer--cart',\n    '#cart-drawer'\n  ];\n\n  function icon() {\n    var ns = 'http://www.w3.org/2000/svg';\n    var svg = document.createElementNS(ns, 'svg');\n    svg.setAttribute('viewBox', '0 0 24 24');\n    svg.setAttribute('width', '22');\n    svg.setAttribute('height', '22');\n    svg.setAttribute('fill', 'none');\n    svg.setAttribute('stroke', 'currentColor');\n    svg.setAttribute('stroke-width', '2');\n    svg.setAttribute('stroke-linecap', 'round');\n    svg.setAttribute('stroke-linejoin', 'round');\n    svg.setAttribute('aria-hidden', 'true');\n    ['M3 8m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v1a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1z',\n     'M12 8l0 13',\n     'M19 12v7a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-7',\n     'M7.5 8a2.5 2.5 0 0 1 0 -5a4.8 8 0 0 1 4.5 5a4.8 8 0 0 1 4.5 -5a2.5 2.5 0 0 1 0 5'\n    ].forEach(function (d) {\n      var p = document.createElementNS(ns, 'path');\n      p.setAttribute('d', d);\n      svg.appendChild(p);\n    });\n    return svg;\n  }\n\n  function styles() {\n    if (document.getElementById('dcl-cb-css')) return;\n    var s = document.createElement('style');\n    s.id = 'dcl-cb-css';\n    s.textContent = [\n      '.dcl-cb{display:flex;flex-direction:column;align-items:center;gap:10px;',\n      'width:100%;box-sizing:border-box;margin:0;padding:.25rem .75rem 1rem;',\n      'text-align:center;font-family:inherit;font-size:.9375rem;line-height:1.45;',\n      'opacity:0;transition:opacity .3s ease}',\n      '.dcl-cb.is-open{opacity:1}',\n      '.dcl-cb__mark{display:flex;align-items:center;justify-content:center;',\n      'flex-shrink:0;width:44px;height:44px;border-radius:50%;',\n      'background:#1a1a1a;color:#fff!important}',\n      '.dcl-cb__text{display:block;max-width:34ch;font-weight:700}',\n      '.dcl-cb__amt{color:#e42e0f!important}',\n      '.dcl-cb__terms{color:inherit;text-decoration:underline;',\n      'text-underline-offset:2px;white-space:nowrap;font-weight:400}',\n      '@media (max-width:749px){.dcl-cb{padding:.25rem .5rem .9rem}',\n      '.dcl-cb__mark{width:38px;height:38px}}',\n      '@media (prefers-reduced-motion:reduce){.dcl-cb{transition:none}}'\n    ].join('');\n    document.head.appendChild(s);\n  }\n\n  function mount(root) {\n    if (root.querySelector('.dcl-cb')) return;\n    var spot = anchor(root);\n    if (!spot) return;\n    if (spot.mode === 'before' && !spot.el.parentNode) return;\n\n    styles();\n\n    var row = document.createElement('div');\n    row.className = 'dcl-cb';\n    row.setAttribute('role', 'status');\n\n    var mark = document.createElement('span');\n    mark.className = 'dcl-cb__mark';\n    mark.appendChild(icon());\n\n    var txt = document.createElement('span');\n    txt.className = 'dcl-cb__text';\n    txt.appendChild(document.createTextNode(LEAD));\n    var amt = document.createElement('span');\n    amt.className = 'dcl-cb__amt';\n    amt.textContent = '$' + (pairs * PER_PAIR);\n    txt.appendChild(amt);\n    txt.appendChild(document.createTextNode((pairs > 1 ? TAIL_MULTI : TAIL) + ' '));\n    var terms = document.createElement('a');\n    terms.className = 'dcl-cb__terms';\n    terms.href = TERMS_HREF;\n    terms.textContent = TERMS_LABEL;\n    txt.appendChild(terms);\n\n    row.appendChild(mark);\n    row.appendChild(txt);\n    if (spot.mode === 'prepend') spot.el.insertBefore(row, spot.el.firstChild);\n    else spot.el.parentNode.insertBefore(row, spot.el);\n    requestAnimationFrame(function () { row.classList.add('is-open'); });\n  }\n\n  function getJSON(url) {\n    return fetch(url, { headers: { Accept: 'application/json' }, credentials: 'same-origin' })\n      .then(function (r) { return r.ok ? r.json() : null; });\n  }\n\n  // A product qualifies on the Shoes tag, unless it is tagged Open Box. Tag\n  // comparison is lower-cased because Shopify preserves the casing an admin typed.\n  function qualifies(product) {\n    if (!product || !product.tags) return false;\n    var tags = product.tags.map(function (t) { return String(t).toLowerCase(); });\n    if (tags.indexOf(NEED_TAG) === -1 || tags.indexOf(SKIP_TAG) !== -1) return false;\n    if (tags.indexOf('no-discount') !== -1) return false; // clearance (2026-11-02)\n    if (product.compare_at_price_max && product.compare_at_price_max > product.price_min) return false; // marked down\n    return true;\n  }\n\n  var eligible = false;\n  var pairs = 0;\n\n  // The drawer is rebuilt every time it opens, so watch for a cart appearing\n  // anywhere in the document and inject into it. Cheap: the callback exits\n  // immediately unless the cart actually qualifies.\n  function watchDrawers() {\n    if (!window.MutationObserver) return;\n    new MutationObserver(function () {\n      if (!eligible) return;\n      mountAll();\n    }).observe(document.body, { childList: true, subtree: true });\n  }\n\n  function clearAll() {\n    var nodes = document.querySelectorAll('.dcl-cb');\n    for (var i = 0; i < nodes.length; i++) {\n      if (nodes[i].parentNode) nodes[i].parentNode.removeChild(nodes[i]);\n    }\n  }\n\n  function mountAll() {\n    mount(document);\n    for (var i = 0; i < ROOTS.length; i++) {\n      var nodes = document.querySelectorAll(ROOTS[i]);\n      for (var j = 0; j < nodes.length; j++) mount(nodes[j]);\n    }\n  }\n\n  function check() {\n    getJSON('/cart.js').then(function (cart) {\n      if (!cart || !cart.items || !cart.items.length) return;\n\n      var handles = [];\n      cart.items.forEach(function (item) {\n        if (item.vendor !== VENDOR) return;\n        if (handles.indexOf(item.handle) === -1) handles.push(item.handle);\n      });\n      if (!handles.length) return;\n\n      Promise.all(handles.map(function (h) {\n        return getJSON('/products/' + encodeURIComponent(h) + '.js')\n          .catch(function () { return null; });\n      })).then(function (products) {\n        var ok = {};\n        for (var i = 0; i < products.length; i++) {\n          if (qualifies(products[i])) ok[products[i].handle] = true;\n        }\n        var count = 0;\n        cart.items.forEach(function (item) {\n          if (item.vendor !== VENDOR) return;\n          if (ok[item.handle]) count += item.quantity;\n        });\n        if (!count) return;\n        // The amount is baked into the rendered node, so a quantity change has to\n        // tear the old line down rather than leave a stale figure on screen.\n        if (count !== pairs) clearAll();\n        pairs = count;\n        eligible = true;\n        mountAll();\n      });\n    }).catch(function () {});\n  }\n\n  function boot() {\n    check();\n    watchDrawers();\n    // The drawer usually opens right after an add-to-cart, which changes the cart\n    // we just read. Re-check on that event so a shoe added mid-session counts.\n    document.addEventListener('click', function (e) {\n      if (!e.target || !e.target.closest) return;\n      if (!e.target.closest('[name=\"add\"], form[action*=\"/cart/add\"] [type=\"submit\"]')) return;\n      setTimeout(check, 800);\n    }, true);\n  }\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', boot);\n  } else {\n    boot();\n  }\n})();\n"],
  "mappings": "CAsDC,UAAY,CACX,aAEA,GAAI,OAAO,eAAgB,OAC3B,OAAO,eAAiB,GAExB,IAAI,OAAS,eACT,SAAW,QACX,SAAW,WAEX,KAAO,QACP,KAAO,0DACP,WAAa,8DACb,SAAW,GACX,WAAa,8BACb,YAAc,QAKd,QAAU,CAAC,wBAAyB,uBAAwB,iBAAiB,EAI7E,QAAU,CACZ,oBACA,cACA,gBACA,sCACA,uBACF,EAEA,SAAS,OAAO,KAAM,CACpB,QAAS,EAAI,EAAG,EAAI,QAAQ,OAAQ,IAAK,CACvC,IAAI,GAAK,KAAK,cAAc,QAAQ,CAAC,CAAC,EACtC,GAAI,GAAI,MAAO,CAAE,GAAI,GAAI,KAAM,SAAU,CAC3C,CACA,QAAS,EAAI,EAAG,EAAI,QAAQ,OAAQ,IAAK,CACvC,IAAI,EAAI,KAAK,cAAc,QAAQ,CAAC,CAAC,EACrC,GAAI,EAAG,MAAO,CAAE,GAAI,EAAG,KAAM,QAAS,CACxC,CACA,OAAO,IACT,CAIA,IAAI,MAAQ,CACV,cACA,cACA,eACA,gBACA,cACF,EAEA,SAAS,MAAO,CACd,IAAI,GAAK,6BACL,IAAM,SAAS,gBAAgB,GAAI,KAAK,EAC5C,WAAI,aAAa,UAAW,WAAW,EACvC,IAAI,aAAa,QAAS,IAAI,EAC9B,IAAI,aAAa,SAAU,IAAI,EAC/B,IAAI,aAAa,OAAQ,MAAM,EAC/B,IAAI,aAAa,SAAU,cAAc,EACzC,IAAI,aAAa,eAAgB,GAAG,EACpC,IAAI,aAAa,iBAAkB,OAAO,EAC1C,IAAI,aAAa,kBA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