{
  "version": 3,
  "sources": ["/cdn/shop/t/40/assets/bfcm-sub-cart.js?cb=1794350612514"],
  "sourcesContent": ["/* BFCM 2026 SUBSCRIBE - the cart script of snippets/bfcm-sub-cart.liquid (RFC 0007 section 11.5, PR 3;\n * moved out of the snippet into this cached asset by PR 3b, RFC 0007 S57). It keeps every BFCM\n * subscription pair consistent in the drawer and on /cart, on every page: an orphan $0 line goes, a\n * missing $0 line is put back once with its card's consent (K1), each $0 line follows its bundle's\n * quantity (always down, and up while its card is switched on) and twin and SGWS plan lines are held\n * at the card's limit (S76; the limit is each entry's \"max\"; a switched-off card's twin at its $0\n * line's quantity, S76 review), each BFCM subscription row's plan name is printed as text and the $0\n * rows locked (no renewal sentence: the snippet's data carries none since Graeme, 9 Nov; Sanjeet,\n * 10 Nov), unsure passes unlock instead (K4), and the _bfcm_sub_system cart attribute follows the\n * SGWS plan line (S51). A pass runs after a drawer change seen in any of three ways (a row added or\n * removed, a BFCM row redrawn in place, UpCart's cart-updated callback) and again while the drawer\n * shows a bundle at a quantity the cart does not hold yet (S76 review). The rules themselves are\n * documented where they run, below, and in the snippet's header.\n *\n * WHERE ITS DATA COMES FROM. Nothing in this file is Liquid. The snippet prints one JSON element,\n * #BfcmSubCartData, with every value it needs (the pairs, the base offers, the page-load flag, the\n * toast texts in the page's language), and loads this file only where it printed that element: the\n * layout render, when the Glass Water System config holds at least one usable subscribe object, never\n * in the theme editor. With no data element, or no pair in it, this file does nothing at all.\n *\n * TIMING (it is loaded with defer). It runs once the whole page has been parsed and before\n * DOMContentLoaded, in document order with the other deferred and module scripts: after theme.js and\n * vendor.min.js (modules in the head) and after the picker's assets/fall-sale-picker.js (in the main\n * content above the layout's render), before six-pack-cart.js, loop-plan-guard.js and UpCart's own\n * bundle (a deferred app-embed script further down the body). So:\n *   - #BfcmSubCartData is always in the document when this runs, wherever the snippet printed it.\n *   - The page-load flag (DATA.flag) decorates the drawer rows already drawn at once, by their\n *     variant (the first pass then corrects them from the cart), and schedules that first pass, 500 ms\n *     after this file runs. A row drawn later is decorated by the drawer observer within a frame.\n *   - window.bfcmSubCart (extraCheckoutItems, reconcile) exists from then on. It is undefined before\n *     it, and for good if this file failed to load or stopped on an error. Nothing calls it yet: the\n *     Fly custom-script edit of design 11.6 step 4 (R12) is conditional. A caller that clears or\n *     rebuilds the cart must FAIL CLOSED when it is missing: no clearing and no rebuild, straight to\n *     /checkout with the cart as it is. A missing object never means \"no extra items\": a rebuilt\n *     checkout would lose the $0 lines, so the twins would sell at the subscribe price with no\n *     subscription (DR6), and the SGWS plan line (F9).\n *   - The picker's bfcm-sub:reconcile listener and the /cart remove click are attached then. The\n *     picker dispatches bfcm-sub:reconcile only at the end of a subscribe add, which needs a click on\n *     a picker that is itself a deferred script earlier in the same list, and the add marker in\n *     localStorage covers the rest.\n *   - UpCart's item-removed and cart-updated callbacks can NOT be attached then: UpCart's bundle\n *     runs after this file. Each is registered once, at DOMContentLoaded, which waits for every\n *     deferred script (UpCart's included, however slow its download); window load and a poll (30 s\n *     from the latest of the three) cover an API that UpCart only sets up later.\n *   - The drawer observer starts then too, and UpCart's shadow root (if it uses one) is looked for\n *     then, at DOMContentLoaded, at load and by its poll.\n *   - The saved /cart toasts (bfcmSubReload) are shown 250 ms after this file runs; the theme's toast\n *     element (theme.js, earlier in the same list) is listening by then.\n *   - IF IT NEVER RUNS (the request failed or was blocked) or stops on an error while starting, /cart\n *     fails open (K4): the loader's onerror (in the snippet) and the catch at the end of this file\n *     show every $0 line's remove controls, which sections/main-cart.liquid renders hidden, so an\n *     orphan subscription can always be removed there. The drawer needs nothing: only this file locks\n *     its rows.\n *\n * Shared with assets/fall-sale-picker.js, so change them in both files together: the localStorage keys\n * bfcmSubAddingUntil, bfcmSubConsent and bfcmSubRestored, the bfcm-sub:reconcile event, and the\n * offer-id and Fly-property name lists.\n */\n(function () {\n  'use strict';\n  /* /cart fails open (K4): sections/main-cart.liquid renders a $0 line's remove controls hidden, and\n   * only this file reveals them or keeps them hidden. If it stops on an error while starting, they are\n   * shown, as the loader's onerror shows them when this file never loads. */\n  function showCartRemoves() {\n    try {\n      document.querySelectorAll('[data-bfcm-sub-remove]').forEach(function (link) {\n        link.hidden = false;\n      });\n    } catch (error) {\n      /* Nothing more can be done. */\n    }\n  }\n  try {\n    if (window.bfcmSubCart) return;\n    var dataEl = document.getElementById('BfcmSubCartData');\n    if (!dataEl) return;\n    var DATA = JSON.parse(dataEl.textContent || 'null') || {};\n    var PAIRS = [];\n    var SYSTEMS = [];\n    (Array.isArray(DATA.pairs) ? DATA.pairs : []).forEach(function (entry) {\n      if (!entry || !entry.card || !entry.plan) return;\n      if (entry.ph && entry.twinOffer && entry.twinVariant) PAIRS.push(entry);\n      else if (entry.system) SYSTEMS.push(entry);\n    });\n    if (!PAIRS.length && !SYSTEMS.length) return;\n    var BASES = Array.isArray(DATA.bases) ? DATA.bases : [];\n    var TOASTS = DATA.toasts || {};\n    /* S57 (PR 3b): the everyday and other non-BFCM plans, as the snippet's ONE fenced list\n     * (snippets/bfcm-sub-denied-plans.liquid, \",id,id,\"). The snippet already gives no pair to a card\n     * on one of them; here a cart LINE on one of them is never a BFCM line: never a pair's $0 line, a\n     * twin or a system line, so never capped, locked or decorated, never in extraCheckoutItems, and\n     * never a reason for an unsure pass. One rule of PR #106 still reaches it (analyse): a $0 line of a\n     * card's placeholder that is not on its BFCM plan goes, whatever its plan. */\n    var DENIED = typeof DATA.denied === 'string' ? DATA.denied : '';\n\n    /* Shared with assets/fall-sale-picker.js: change the names in both files together. */\n    var ADDING_KEY = 'bfcmSubAddingUntil';\n    var CONSENT_KEY = 'bfcmSubConsent';\n    var RESTORED_KEY = 'bfcmSubRestored';\n    var RELOAD_KEY = 'bfcmSubReload';\n    var ATTR = '_bfcm_sub_system';\n    var DAY = 24 * 60 * 60 * 1000;\n    var OFFER_NAMES = ['OfferId', 'Offer Id', '_offerId', '_gfbOfferId', '_OfferId', '_flyBundles:OfferId'];\n    var FLY_NAMES = OFFER_NAMES.concat(['Bundle', 'Bundle Name', '_bundleName', 'Items', 'Bundle Items', '_bundleItems', '_Details']);\n    /* S76: the most a card takes with its subscription, from its entry's \"max\" (the snippet clamps it\n     * to 1..the page's maxQuantity, as the picker does); 10 when the entry has none. */\n    function limitOf(entry) {\n      var n = Math.floor(Number(entry && entry.max));\n      return n >= 1 ? n : 10;\n    }\n    var ON_CART_PAGE =\n      (document.body && document.body.getAttribute('data-page-type') === 'cart') ||\n      /\\/cart\\/?$/.test(window.location.pathname || '');\n\n    function root() {\n      return (window.Shopify && window.Shopify.routes && window.Shopify.routes.root) || '/';\n    }\n    function roots() {\n      var out = [document];\n      var sr = window.upcartDocumentOrShadowRoot;\n      if (sr && sr !== document) out.push(sr);\n      return out;\n    }\n    function log(message) {\n      if (window.console) console.info(message);\n    }\n    var logged = {};\n    function logOnce(tag, message) {\n      if (logged[tag]) return;\n      logged[tag] = true;\n      log(message);\n    }\n\n    /* ---- Reading lines: the normaliser of snippets/bundle-aware-cart-quantity.liquid (K4). ---- */\n    function norm(key) {\n      return String(key || '').toLowerCase().replace(/[^a-z0-9]/g, '');\n    }\n    function prop(properties, names) {\n      if (!properties || typeof properties !== 'object') return null;\n      var wanted = names.map(norm);\n      var keys = Object.keys(properties);\n      for (var i = 0; i < keys.length; i += 1) {\n        if (wanted.indexOf(norm(keys[i])) !== -1) return properties[keys[i]];\n      }\n      return null;\n    }\n    function looksFly(it) {\n      var properties = it && it.properties;\n      if (!properties || typeof properties !== 'object') return false;\n      var wanted = FLY_NAMES.map(norm);\n      return Object.keys(properties).some(function (key) { return wanted.indexOf(norm(key)) !== -1; });\n    }\n    function lineOffer(it) {\n      var value = prop(it && it.properties, OFFER_NAMES);\n      return value ? String(value).split('_')[0] : '';\n    }\n    function planOf(it) {\n      var p = it && it.selling_plan_allocation && it.selling_plan_allocation.selling_plan;\n      return p && p.id ? String(p.id) : '';\n    }\n    /* S57: is this plan id on the list? Is this line on a listed plan? */\n    function planListed(planId) {\n      return !!planId && DENIED.indexOf(',' + String(planId) + ',') !== -1;\n    }\n    function notListed(it) {\n      return !planListed(planOf(it));\n    }\n    /* A $0 line: the product's own price is 0. Every placeholder is (the picker's gate checks\n     * it), so a line on a placeholder variant that costs anything is a real product behind a\n     * mistyped id (DR22) and is never treated, locked or removed as a subscription line. The\n     * same test as sections/main-cart.liquid (line_item.original_price == 0). */\n    function zeroPriced(it) {\n      if (!it) return false;\n      var v = it.original_price !== undefined && it.original_price !== null ? it.original_price : it.price;\n      return v !== undefined && v !== null && v !== '' && Number(v) === 0;\n    }\n\n    /* ---- localStorage, every access guarded: private mode records nothing (DR29). ---- */\n    function readStore(key) {\n      try {\n        var value = JSON.parse(window.localStorage.getItem(key) || '{}');\n        return value && typeof value === 'object' && !Array.isArray(value) ? value : {};\n      } catch (error) {\n        return {};\n      }\n    }\n    function writeStore(key, value) {\n      try {\n        if (Object.keys(value).length) window.localStorage.setItem(key, JSON.stringify(value));\n        else window.localStorage.removeItem(key);\n      } catch (error) {\n        /* Private mode: nothing is recorded. */\n      }\n    }\n    function addingUntil() {\n      try {\n        return Number(window.localStorage.getItem(ADDING_KEY)) || 0;\n      } catch (error) {\n        return 0;\n      }\n    }\n    function revoke(card) {\n      var consent = readStore(CONSENT_KEY);\n      if (!consent[card]) return;\n      delete consent[card];\n      writeStore(CONSENT_KEY, consent);\n    }\n\n    /* The theme's toast parses its message as HTML (assets/theme.js), so the copy is escaped. */\n    function escapeHtml(text) {\n      return String(text)\n        .replace(/&/g, '&amp;')\n        .replace(/</g, '&lt;')\n        .replace(/>/g, '&gt;')\n        .replace(/\"/g, '&quot;')\n        .replace(/'/g, '&#39;');\n    }\n    function toast(key) {\n      var text = TOASTS[key];\n      if (!text) return;\n      document.dispatchEvent(new CustomEvent('toast:show', { detail: { message: escapeHtml(text) } }));\n    }\n\n    /* ---- Which pairs this page acts on (K1, DR22). ----\n     * Fly's page data, where it is on the page, names each FBT offer's parent variant. A pair whose\n     * twin offer it lists with a parent is kept only when that parent IS the pasted twinVariantId\n     * (the picker's own rule, _twinParentMatches) and is no base offer's parent; it is then\n     * CONFIRMED. A pair whose twin offer Fly does not list, or every pair on a page without Fly's\n     * data, is kept UNCONFIRMED: no re-add can happen without a consent record anyway, and only\n     * the picker writes those, after its own check. A DROPPED pair gets no write at all, and its\n     * $0 rows are left unlocked, so the shopper can always remove them (K4). */\n    function flyList() {\n      var list = window.fly_app_data && window.fly_app_data.data && window.fly_app_data.data.frequentBoughtData;\n      return Array.isArray(list) ? list : null;\n    }\n    function flyParentOf(offerId) {\n      var list = flyList();\n      if (!list) return '';\n      var entry = null;\n      list.forEach(function (it) {\n        if (!entry && it && (it.offerId === offerId || (it.metafieldData && it.metafieldData.offerId === offerId))) entry = it;\n      });\n      var gid = entry && entry.metafieldData && entry.metafieldData.parentProductId;\n      return gid ? String(gid).split('/').pop() : '';\n    }\n    function judgePairs() {\n      var out = { active: [], dropped: [] };\n      if (!flyList()) {\n        PAIRS.forEach(function (p) { out.active.push({ pair: p, confirmed: false }); });\n        return out;\n      }\n      var baseParents = BASES.map(flyParentOf).filter(Boolean);\n      PAIRS.forEach(function (p) {\n        var parent = flyParentOf(p.twinOffer);\n        if (parent && baseParents.indexOf(parent) !== -1) {\n          logOnce('clash:' + p.card, '[bfcm-sub-cart] card ' + p.card + ': the twin offer ' + p.twinOffer + ' lists a base offer\\'s parent; that pair is ignored and its $0 rows are left unlocked');\n          out.dropped.push(p);\n        } else if (parent && parent !== String(p.twinVariant)) {\n          logOnce('parent:' + p.card, '[bfcm-sub-cart] card ' + p.card + ': Fly lists ' + parent + ' as the parent of ' + p.twinOffer + ', not twinVariantId ' + p.twinVariant + '; that pair is ignored and its $0 rows are left unlocked');\n          out.dropped.push(p);\n        } else {\n          out.active.push({ pair: p, confirmed: !!parent });\n        }\n      });\n      return out;\n    }\n\n    /* A pair's lines in a cart. TWIN: a merged line on the twin variant that names no OTHER offer\n     * (a line stamped with another offer is that offer's bundle, so a twin variant pasted as a\n     * base parent cannot turn an unticked bundle into a twin), with or without properties of its\n     * own (D4, F6: the variant is what survives a Fly property change); or a component line\n     * stamped with the twin offer. CAPPABLE: only a twin line known to BE the twin - Fly confirmed\n     * its variant, or it names the twin offer - is ever held at the card's limit or counted as the\n     * bundle quantity its $0 line follows (S76), so a mistyped id can never cut a shopper's own\n     * line. PLACEHOLDER: a $0 line on the placeholder variant (zeroPriced), looked\n     * for in `phItems` when given (analyse passes the whole cart, listed plans included), else in\n     * `items`. */\n    function pairLines(items, j, phItems) {\n      var p = j.pair;\n      var merged = [];\n      var parts = [];\n      items.forEach(function (it) {\n        var offer = lineOffer(it);\n        if (String(it.variant_id) === String(p.twinVariant)) {\n          if (!offer || offer === p.twinOffer) merged.push(it);\n        } else if (offer && offer === p.twinOffer) parts.push(it);\n      });\n      return {\n        merged: merged,\n        parts: parts,\n        twins: merged.length + (parts.length ? 1 : 0),\n        cappable: merged.filter(function (it) { return j.confirmed || lineOffer(it) === p.twinOffer; }),\n        placeholders: (phItems || items).filter(function (it) { return String(it.variant_id) === String(p.ph) && zeroPriced(it); })\n      };\n    }\n\n    /* ---- One pass over the cart: what should be written. Rules per pair, none blocking another. ---- */\n    function analyse(cart, judged) {\n      /* S57: lines on a listed plan are not looked at by the twin, system and unsure rules below, and\n       * are never a pair's $0 line (no plan on the list is ever a pair's plan). The one rule that still\n       * reaches them is PR #106's: a $0 line of a card's placeholder that is not on its BFCM plan goes,\n       * whatever its plan, a listed one included. That product is only ever sold as the BFCM\n       * subscription line, so such a line is never a shopper's own everyday line; left in the cart it\n       * would check out as a $0 subscription on an everyday plan that no BFCM Loop flow handles, or\n       * sit beside the BFCM $0 line put back for the same bundle. */\n      var items = cart.items.filter(notListed);\n      var now = Date.now();\n      var twinVariants = judged.active.map(function (j) { return String(j.pair.twinVariant); });\n      var out = { unsure: false, updates: {}, readds: [], toasts: {}, dropConsent: [], seen: false, systemLine: false };\n      var set = function (key, quantity) { if (key) out.updates[key] = quantity; };\n      /* K4: a Fly-looking line whose offer cannot be read and whose variant is no known twin. */\n      out.unsure = items.some(function (it) {\n        return looksFly(it) && !lineOffer(it) && twinVariants.indexOf(String(it.variant_id)) === -1;\n      });\n      var consent = readStore(CONSENT_KEY);\n      var restored = readStore(RESTORED_KEY);\n      judged.active.forEach(function (j) {\n        var p = j.pair;\n        var lines = pairLines(items, j, cart.items);\n        var merged = lines.merged;\n        var parts = lines.parts;\n        var twins = lines.twins;\n        var placeholders = lines.placeholders;\n        if (twins || placeholders.length) out.seen = true;\n        if (!twins) {\n          /* T = 0, P > 0: an orphan, ours by construction. Nothing else can block this. */\n          if (placeholders.length) {\n            placeholders.forEach(function (it) { set(it.key, 0); });\n            out.toasts.removedOrphan = true;\n          }\n          if (consent[p.card]) out.dropConsent.push(p.card);\n          return;\n        }\n        /* S76: the twin held at the card's limit in total (F12, S50 at 1 before), only on lines known\n         * to be the twin (pairLines), the first lines in cart order keeping theirs. A twin made of\n         * separate component lines is not touched: that is unsure for a quantity. */\n        var limit = limitOf(p);\n        /* A $0 line off its plan is never wanted: it goes (below), and the T > 0, P = 0 rule applies. */\n        var onPlan = placeholders.filter(function (it) { return planOf(it) === String(p.plan); });\n        /* S76 review (2 Nov): a card switched off takes no new subscription, so its $0 line never\n         * follows the bundle up; then the bundle may not go up either, or the extra bundles would sell\n         * at the subscribe price with no subscription (DR6). Held at its $0 line's quantity, and at 1\n         * when that line is gone (S50's hold before S76). */\n        var hold = limit;\n        if (p.enabled !== true) hold = Math.min(limit, Math.max(1, onPlan.length ? Number(onPlan[0].quantity) || 0 : 0));\n        var cappable = lines.cappable;\n        var total = cappable.reduce(function (n, it) { return n + (Number(it.quantity) || 0); }, 0);\n        if (!parts.length && total > hold) {\n          var budget = hold;\n          cappable.forEach(function (it) {\n            var q = Number(it.quantity) || 0;\n            var keep = Math.min(q, budget);\n            budget -= keep;\n            if (keep !== q) set(it.key, keep);\n          });\n          out.toasts.capped = true;\n          total = hold;\n        }\n        /* The number of bundles is KNOWN when every twin line is a merged line known to be the twin;\n         * a $0 line then follows it. Otherwise (component lines, or a twin line nothing confirms) it\n         * is only held at the limit. */\n        var known = !parts.length && merged.length > 0 && cappable.length === merged.length;\n        placeholders.forEach(function (it) { if (onPlan.indexOf(it) === -1) set(it.key, 0); });\n        if (!onPlan.length) {\n          var twinKey = (merged[0] || parts[0]).key || '';\n          var record = consent[p.card];\n          var hasConsent =\n            !!record && typeof record === 'object' && now - Number(record.at) < DAY &&\n            String(record.twinVariant) === String(p.twinVariant) && String(record.placeholder) === String(p.ph);\n          if (!hasConsent || p.enabled !== true) {\n            logOnce('alone:' + p.card + ':' + twinKey, '[bfcm-sub-cart] card ' + p.card + ': its bundle is in the cart without its filter subscription, and ' +\n              (p.enabled === true ? 'no ticked add recorded consent for it' : 'the card is switched off') + '; nothing written');\n          } else if (restored[twinKey] && now - Number(restored[twinKey]) < DAY) {\n            logOnce('again:' + twinKey, '[bfcm-sub-cart] card ' + p.card + ': its filter subscription was put back once already; nothing written');\n          } else {\n            /* Put back at the bundle quantity when it is known (S76), else at 1. */\n            out.readds.push({ pair: p, twinKey: twinKey, quantity: known ? total : 1 });\n          }\n        } else {\n          /* Keep one $0 line (S76): at the bundle quantity when it is known - always down, and up only\n           * while the card is switched on - else only held at the card's limit. */\n          onPlan.forEach(function (it, i) {\n            var q = Number(it.quantity) || 0;\n            if (i > 0) set(it.key, 0);\n            else if (!known) {\n              if (q > limit) set(it.key, limit);\n            } else if (q > total || (q < total && p.enabled === true)) {\n              set(it.key, total);\n            }\n          });\n        }\n      });\n      SYSTEMS.forEach(function (s) {\n        var limit = limitOf(s);\n        items.forEach(function (it) {\n          if (String(it.variant_id) !== String(s.system) || planOf(it) !== String(s.plan)) return;\n          out.seen = true;\n          out.systemLine = true;\n          /* S76: held at the card's limit (1 before). */\n          if (Number(it.quantity) > limit) {\n            set(it.key, limit);\n            out.toasts.capped = true;\n          }\n        });\n      });\n      return out;\n    }\n\n    /* Restore and consent housekeeping (K6, K1): a restore entry goes after 24 h or once its twin\n     * line has left the cart; a consent record after 24 h, or when its pair has no twin (not on an\n     * unsure pass, which cannot tell). */\n    function housekeep(cart, result) {\n      var now = Date.now();\n      var keys = {};\n      cart.items.forEach(function (it) { keys[it.key] = true; });\n      var restored = readStore(RESTORED_KEY);\n      var changed = false;\n      Object.keys(restored).forEach(function (key) {\n        if (!(now - Number(restored[key]) < DAY) || !keys[key]) {\n          delete restored[key];\n          changed = true;\n        }\n      });\n      if (changed) writeStore(RESTORED_KEY, restored);\n      var consent = readStore(CONSENT_KEY);\n      changed = false;\n      Object.keys(consent).forEach(function (card) {\n        var record = consent[card];\n        var stale = !record || typeof record !== 'object' || !(now - Number(record.at) < DAY);\n        if (stale || (!result.unsure && result.dropConsent.indexOf(card) !== -1)) {\n          delete consent[card];\n          changed = true;\n        }\n      });\n      if (changed) writeStore(CONSENT_KEY, consent);\n    }\n\n    /* ---- Writing. One cart/update.js for every quantity, keyed by line key; re-adds after it, one JSON\n     * add each; the attribute in its own request (no `updates`, so the bundle-aware quantity\n     * guard lets it through). A failed write is never retried. On /cart the page reloads after a\n     * successful line write - once, never in a loop. ---- */\n    var failed = {};\n    var selfRemoved = {};\n    function post(path, body) {\n      return fetch(root() + path, {\n        method: 'POST',\n        headers: { 'Content-Type': 'application/json', Accept: 'application/json' },\n        body: JSON.stringify(body)\n      }).then(function (response) { return !!(response && response.ok); }, function () { return false; });\n    }\n    /* Reloads /cart once per write signature (never in a loop) and says whether it did. The toasts\n     * of the pass ride along in the same record and are shown once the page is back (below),\n     * because a toast shown now would be gone with the page before anyone could read it. */\n    function reloadOnce(signature, toastKeys) {\n      try {\n        var last = JSON.parse(window.sessionStorage.getItem(RELOAD_KEY) || 'null');\n        if (last && last.sig === signature && Date.now() - Number(last.at) < 60000) return false;\n        window.sessionStorage.setItem(RELOAD_KEY, JSON.stringify({ sig: signature, at: Date.now(), toasts: toastKeys || [] }));\n      } catch (error) {\n        /* No storage: reload anyway, and the toasts are lost with the page. */\n      }\n      window.location.reload();\n      return true;\n    }\n    /* The toasts a /cart pass saved before its reload, taken once (the record itself stays, for\n     * the loop guard above). Shown after DOMContentLoaded, when theme.js has its toast element up. */\n    function takeSavedToasts() {\n      try {\n        var last = JSON.parse(window.sessionStorage.getItem(RELOAD_KEY) || 'null');\n        if (!last || !Array.isArray(last.toasts) || !last.toasts.length) return [];\n        var keys = Date.now() - Number(last.at) < 60000 ? last.toasts : [];\n        last.toasts = [];\n        window.sessionStorage.setItem(RELOAD_KEY, JSON.stringify(last));\n        return keys;\n      } catch (error) {\n        return [];\n      }\n    }\n    function commit(cart, result) {\n      var wrote = false;\n      var shown = {};\n      var writes = [];\n      var chain = Promise.resolve();\n      if (!result.unsure) {\n        var updates = {};\n        Object.keys(result.updates).forEach(function (key) {\n          var tag = key + '>' + result.updates[key];\n          if (failed[tag]) return;\n          updates[key] = result.updates[key];\n          writes.push(tag);\n        });\n        if (Object.keys(updates).length) {\n          chain = chain.then(function () {\n            Object.keys(updates).forEach(function (key) { if (updates[key] === 0) selfRemoved[key] = Date.now(); });\n            return post('cart/update.js', { updates: updates }).then(function (ok) {\n              if (!ok) {\n                Object.keys(updates).forEach(function (key) { failed[key + '>' + updates[key]] = true; });\n                log('[bfcm-sub-cart] a cart update failed; it is not retried');\n                return;\n              }\n              wrote = true;\n              if (result.toasts.removedOrphan) shown.removedOrphan = true;\n              if (result.toasts.capped) shown.capped = true;\n            });\n          });\n        }\n        result.readds.forEach(function (readd) {\n          chain = chain.then(function () {\n            /* Recorded BEFORE the add, so it is never tried twice within 24 h (K6). */\n            var restored = readStore(RESTORED_KEY);\n            restored[readd.twinKey] = Date.now();\n            writeStore(RESTORED_KEY, restored);\n            writes.push('add:' + readd.pair.card);\n            return post('cart/add.js', { items: [{ id: Number(readd.pair.ph), quantity: Number(readd.quantity) || 1, selling_plan: Number(readd.pair.plan) }] }).then(function (ok) {\n              if (!ok) {\n                log('[bfcm-sub-cart] card ' + readd.pair.card + ': the filter subscription could not be put back; nothing more is done');\n                return;\n              }\n              wrote = true;\n              shown.restored = true;\n            });\n          });\n        });\n      }\n      /* The Checkout Blocks attribute is not a line, so it is written on unsure passes too. */\n      var want = result.systemLine ? '1' : '';\n      var have = cart.attributes && cart.attributes[ATTR] ? String(cart.attributes[ATTR]) : '';\n      var attrTag = have + '>' + want;\n      if (want !== have && !failed[attrTag]) {\n        chain = chain.then(function () {\n          var attributes = {};\n          attributes[ATTR] = want;\n          return post('cart/update.js', { attributes: attributes }).then(function (ok) {\n            if (!ok) {\n              failed[attrTag] = true;\n              log('[bfcm-sub-cart] the cart attribute could not be written; it is not retried');\n            }\n          });\n        });\n      }\n      return chain.then(function () {\n        var keys = Object.keys(shown);\n        if (!wrote) {\n          keys.forEach(toast);\n          return;\n        }\n        document.dispatchEvent(new CustomEvent('cart:refresh', { bubbles: true }));\n        try {\n          if (typeof window.upcartRefreshCart === 'function') window.upcartRefreshCart();\n        } catch (error) {\n          /* The drawer is UpCart's; the cart itself is already right. */\n        }\n        if (ON_CART_PAGE && reloadOnce(writes.sort().join('|'), keys)) return;\n        keys.forEach(toast);\n      });\n    }\n\n    /* ---- The pass itself: debounced, and never while a subscribe add is in flight in any tab. ---- */\n    var lastCart = null;\n    var lineInfo = {};\n    var unsureNow = false;\n    var sawBfcm = DATA.flag === true;\n    var timer = null;\n    var busy = false;\n    var again = false;\n    /* S76 review (2 Nov): what the passes have read, for the triggers below. lastReadSig is the last\n     * cart read (its line keys and quantities), sameReads how many passes in a row have read that same\n     * cart, passEndedAt when the last pass ended. ahead: the last FINISHED pass found a bundle or SGWS\n     * plan row drawn at another quantity than the cart it read (it is false while a pass is reading the\n     * cart); rechecks counts the passes repeated for that, and aheadCalls the no-argument cart-updated\n     * callbacks let through over a run of passes that find the drawer ahead; both start again once a\n     * pass finds the drawer in step (3b below). */\n    var lastReadSig = '';\n    var sameReads = 0;\n    var passEndedAt = 0;\n    var ahead = false;\n    var rechecks = 0;\n    var aheadCalls = 0;\n    var RECHECK_MS = 800;\n    var RECHECKS = 5;\n    function schedule(delay) {\n      window.clearTimeout(timer);\n      timer = window.setTimeout(reconcile, typeof delay === 'number' ? delay : 500);\n    }\n    /* A cart's lines as one string (key@quantity, sorted), or '' when it cannot be read. */\n    function cartSig(cart) {\n      if (!cart || !Array.isArray(cart.items)) return '';\n      var parts = [];\n      for (var i = 0; i < cart.items.length; i += 1) {\n        var it = cart.items[i];\n        if (!it || !it.key) return '';\n        parts.push(String(it.key) + '@' + (Number(it.quantity) || 0));\n      }\n      return '#' + parts.sort().join('|');\n    }\n    /* S76 review: is a bundle (twin) or SGWS plan row DRAWN at another quantity than the cart just read\n     * holds? Then UpCart has drawn a change that its own request has not made yet (it draws first and\n     * asks the store after), and the pass is repeated a little later - at most RECHECKS times in a\n     * row - so the $0 line still follows once that change lands, even if nothing announces it. Rows\n     * after decorate(), whose classes say which rows are twins and SGWS plan lines. */\n    function drawnAhead(cart) {\n      var qty = {};\n      cart.items.forEach(function (it) { qty[String(it.key)] = Number(it.quantity) || 0; });\n      return rows().some(function (row) {\n        if (!row.classList.contains('bfcm-sub-twin') && !row.classList.contains('bfcm-sub-sys')) return false;\n        var key = rowKey(row);\n        var drawn = parseInt(rowQty(row), 10);\n        return !!key && Object.prototype.hasOwnProperty.call(qty, key) && drawn >= 0 && drawn !== qty[key];\n      });\n    }\n    function remember(cart) {\n      lineInfo = {};\n      cart.items.forEach(function (it) {\n        var p = it.selling_plan_allocation && it.selling_plan_allocation.selling_plan;\n        lineInfo[it.key] = { plan: planOf(it), planName: p && p.name ? String(p.name) : '', zero: zeroPriced(it), offer: lineOffer(it), listed: !notListed(it), qty: Number(it.quantity) || 0 };\n      });\n    }\n    function reconcile() {\n      timer = null;\n      if (busy) {\n        again = true;\n        return;\n      }\n      var until = addingUntil();\n      if (until > Date.now()) {\n        schedule(until - Date.now() + 100);\n        return;\n      }\n      busy = true;\n      ahead = false;\n      fetch(root() + 'cart.js', { cache: 'no-store', headers: { Accept: 'application/json' } })\n        .then(function (response) { return response && response.ok ? response.json() : null; })\n        .then(function (cart) {\n          if (!cart || !Array.isArray(cart.items)) {\n            /* No cart to judge, so nothing may stay locked: /cart fails open (K4). The next pass that\n             * reads the cart locks the paired rows again. */\n            if (ON_CART_PAGE) showCartRemoves();\n            return null;\n          }\n          lastCart = cart;\n          var sig = cartSig(cart);\n          sameReads = sig && sig === lastReadSig ? sameReads + 1 : 0;\n          lastReadSig = sig;\n          remember(cart);\n          /* One judgement of the pairs for the whole pass: the rows decorate() locks are exactly\n           * the ones analyse() acts on, never a dropped pair's. */\n          var judged = judgePairs();\n          var result = analyse(cart, judged);\n          sawBfcm = result.seen;\n          if (result.unsure && !unsureNow) {\n            log('[bfcm-sub-cart] a line looks like a Fly bundle but its offer cannot be read: no line is written, and the $0 rows are unlocked');\n          }\n          unsureNow = result.unsure;\n          housekeep(cart, result);\n          decorate(judged);\n          ahead = drawnAhead(cart);\n          return commit(cart, result);\n        })\n        .catch(function (error) {\n          if (ON_CART_PAGE) showCartRemoves();\n          if (window.console) console.warn('[bfcm-sub-cart] reconcile failed', error);\n        })\n        .then(function () {\n          busy = false;\n          passEndedAt = Date.now();\n          if (!ahead) {\n            rechecks = 0;\n            aheadCalls = 0;\n          }\n          if (again) {\n            again = false;\n            schedule();\n          } else if (ahead && timer === null && rechecks < RECHECKS) {\n            /* S76 review: the drawer is ahead of the cart (drawnAhead): look again a little later. */\n            rechecks += 1;\n            schedule(RECHECK_MS);\n          }\n        });\n    }\n\n    /* ---- The drawer (cosmetic; the pass above is the guard). A row's id is its line key. ---- */\n    function rows() {\n      var out = [];\n      roots().forEach(function (r) {\n        r.querySelectorAll('.upcart-product-item').forEach(function (row) { out.push(row); });\n      });\n      return out;\n    }\n    function rowVariant(row) {\n      var m = String(row.id || '').match(/(\\d+):[0-9a-f]{32}/i);\n      return m ? m[1] : '';\n    }\n    function rowKey(row) {\n      var m = String(row.id || '').match(/(\\d+:[0-9a-f]{32})/i);\n      return m ? m[1] : '';\n    }\n    function rowQty(row) {\n      var input = row.querySelector('.upcart-product-quantity-input');\n      return input ? String(input.value) : '';\n    }\n    /* On this plan: from the last cart read, else from UpCart's own product link. */\n    function rowOnPlan(row, plan) {\n      var info = lineInfo[rowKey(row)];\n      if (info && info.plan) return info.plan === String(plan);\n      var link = row.querySelector('a[href*=\"selling_plan=\"]');\n      var m = link ? String(link.getAttribute('href') || '').match(/selling_plan=(\\d+)/) : null;\n      return !!(m && m[1] === String(plan));\n    }\n    function planNameOf(row) {\n      var info = lineInfo[rowKey(row)];\n      if (info && info.planName) return info.planName;\n      var option = row.querySelector('select option:checked');\n      return option ? String(option.textContent || '').trim() : '';\n    }\n    /* A text note under the row's title. The plan name goes first and the sentence after it, the\n     * order design 11.1 gives (\"its plan name\", then the sentence). The data carries no sentence\n     * since Graeme, 9 Nov; Sanjeet, 10 Nov, so only the plan name is printed, and any sentence note\n     * is removed. */\n    function setNote(row, className, text) {\n      var note = row.querySelector('.' + className);\n      if (!text) {\n        if (note) note.remove();\n        return;\n      }\n      if (!note) {\n        note = document.createElement('span');\n        note.className = className;\n        var plan = className === 'bfcm-sub-note' ? row.querySelector('.bfcm-sub-plan') : null;\n        var anchor = plan || row.querySelector('.upcart-product-title-link') || row.querySelector('.upcart-product-title');\n        if (anchor && anchor.parentNode) anchor.parentNode.insertBefore(note, anchor.nextSibling);\n        else row.appendChild(note);\n      }\n      if (note.textContent !== text) note.textContent = text;\n    }\n    function setNotes(row, planText, sentence) {\n      /* The sentence is removed and put back after the plan name, so the order holds even when\n       * the plan name arrives after the sentence (it comes from the cart read). */\n      var note = row.querySelector('.bfcm-sub-note');\n      var plan = row.querySelector('.bfcm-sub-plan');\n      if (note && planText && !plan) note.remove();\n      setNote(row, 'bfcm-sub-plan', planText);\n      setNote(row, 'bfcm-sub-note', sentence);\n    }\n    function setInert(row, on) {\n      row.querySelectorAll('a').forEach(function (link) {\n        if (on && !link.hasAttribute('data-bfcm-sub-inert')) {\n          link.setAttribute('data-bfcm-sub-inert', link.getAttribute('tabindex') || '');\n          link.setAttribute('tabindex', '-1');\n          link.setAttribute('aria-disabled', 'true');\n        } else if (!on && link.hasAttribute('data-bfcm-sub-inert')) {\n          var before = link.getAttribute('data-bfcm-sub-inert');\n          link.removeAttribute('data-bfcm-sub-inert');\n          link.removeAttribute('aria-disabled');\n          if (before) link.setAttribute('tabindex', before);\n          else link.removeAttribute('tabindex');\n        }\n      });\n    }\n    function systemOf(row, variant) {\n      var found = null;\n      SYSTEMS.forEach(function (s) {\n        if (!found && variant === String(s.system) && rowOnPlan(row, s.plan)) found = s;\n      });\n      return found;\n    }\n    /* Does a drawer row trigger a pass? Every configured pair counts here, dropped or not: a read\n     * too many costs one request, a missed removal costs a stale cart. */\n    function relevant(row) {\n      var v = rowVariant(row);\n      if (!v) return false;\n      return PAIRS.some(function (p) { return v === String(p.ph) || v === String(p.twinVariant); }) || !!systemOf(row, v);\n    }\n    /* Is this row a twin line of the judged pair? The same test as pairLines, on what the last\n     * cart read said about the row's line (before any read: only a confirmed variant counts). */\n    function twinRow(info, j) {\n      if (info) return !info.offer || info.offer === j.pair.twinOffer;\n      return j.confirmed;\n    }\n    /* S57: a row whose line is on a listed plan, from the last cart read, else from UpCart's own\n     * product link (as rowOnPlan reads it). Such a row is no BFCM row: it is decorated as nothing. */\n    function rowListed(row) {\n      var info = lineInfo[rowKey(row)];\n      if (info) return info.listed === true;\n      var link = row.querySelector('a[href*=\"selling_plan=\"]');\n      var m = link ? String(link.getAttribute('href') || '').match(/selling_plan=(\\d+)/) : null;\n      return !!(m && planListed(m[1]));\n    }\n    function decorate(judged) {\n      var pairs = (judged || judgePairs()).active;\n      var list = rows();\n      watchRows(list);\n      list.forEach(function (row) {\n        var v = rowListed(row) ? '' : rowVariant(row);\n        var info = lineInfo[rowKey(row)];\n        var pair = null;\n        var twin = false;\n        pairs.forEach(function (j) {\n          /* Only a $0 line is a subscription row (before the first read the variant is enough). */\n          if (v && v === String(j.pair.ph) && (!info || info.zero)) pair = j.pair;\n          if (v && v === String(j.pair.twinVariant) && twinRow(info, j)) twin = true;\n        });\n        if (pair) {\n          row.classList.add('bfcm-sub-ph');\n          row.classList.toggle('bfcm-sub-ph--open', unsureNow);\n          /* The select that showed the plan name is hidden, so the plan name is printed as text\n           * (design 11.1); it comes from the cart data, so the row says what it is with no\n           * sentence (none since Graeme, 9 Nov; Sanjeet, 10 Nov; the snippet's style hides\n           * UpCart's own copy of the plan name here). S76: the row's stepper stays hidden, so above 1\n           * the plan name carries the quantity, count first as the drawer and checkout show\n           * quantities (\"N x <plan name>\", S76 review): the row's own quantity, as UpCart last drew\n           * it, else the last cart read's. */\n          var drawn = parseInt(rowQty(row), 10);\n          var n = drawn > 0 ? drawn : info ? info.qty : 0;\n          var planText = planNameOf(row);\n          setNotes(row, planText && n > 1 ? n + ' \\u00d7 ' + planText : planText, pair.sentence || '');\n          setInert(row, true);\n          return;\n        }\n        if (row.classList.contains('bfcm-sub-ph')) {\n          /* A row node reused for another line, or a pair this pass does not act on: give it back\n           * its controls. */\n          row.classList.remove('bfcm-sub-ph', 'bfcm-sub-ph--open');\n          setInert(row, false);\n          setNotes(row, '', '');\n        }\n        row.classList.toggle('bfcm-sub-twin', twin);\n        var system = v ? systemOf(row, v) : null;\n        if (system) {\n          /* The plan name as text FIRST, then the select and upgrade go (D6). No sentence since\n           * Graeme, 9 Nov; Sanjeet, 10 Nov. */\n          setNotes(row, planNameOf(row), system.sentence || '');\n          row.classList.add('bfcm-sub-sys');\n        } else if (row.classList.contains('bfcm-sub-sys')) {\n          row.classList.remove('bfcm-sub-sys');\n          setNotes(row, '', '');\n        }\n      });\n      /* /cart: a $0 line's hidden remove controls are revealed on an unsure pass (K4), and for any\n       * placeholder this pass does not act on (a dropped pair), so a line nothing will ever\n       * remove can always be removed by the shopper. */\n      var acted = {};\n      pairs.forEach(function (j) { acted[String(j.pair.ph)] = true; });\n      document.querySelectorAll('[data-bfcm-sub-remove]').forEach(function (link) {\n        var open = unsureNow || !acted[link.getAttribute('data-bfcm-sub-variant') || ''];\n        if (link.hidden === open) link.hidden = !open;\n      });\n    }\n\n    /* ---- Triggers. ---- */\n    /* 1. The picker, at the end of every subscribe add. */\n    document.addEventListener('bfcm-sub:reconcile', function () { schedule(0); });\n\n    /* 2. A change in the drawer's lines (row id and quantity), when the drawer shows a BFCM row\n     * or the last pass saw one (so a removal is noticed too). */\n    var lastSig = '';\n    var queued = false;\n    function onMutate() {\n      if (queued) return;\n      queued = true;\n      window.requestAnimationFrame(function () {\n        queued = false;\n        var list = rows();\n        if (!list.length) return;\n        decorate();\n        var sig = list.map(function (row) { return row.id + '@' + rowQty(row); }).sort().join('|');\n        if (sig === lastSig) return;\n        lastSig = sig;\n        if (sawBfcm || list.some(relevant)) schedule();\n      });\n    }\n    new MutationObserver(onMutate).observe(document.documentElement, { childList: true, subtree: true });\n    /* S76 review (2 Nov): UpCart is a React app, which may redraw a changed quantity IN PLACE - the\n     * row node stays, only its text and its input's value change - so no node is added or removed\n     * and the observer above sees nothing. Each BFCM row (a twin, $0 or SGWS plan row) is therefore\n     * also watched itself for text and value-attribute changes; observe() on a row already watched\n     * only renews it. This script's own row changes are node and class changes, so they never\n     * trigger it. */\n    var rowWatch = new MutationObserver(onMutate);\n    function watchRows(list) {\n      if (!rowWatch) return;\n      list.forEach(function (row) {\n        if (relevant(row)) rowWatch.observe(row, { characterData: true, attributes: true, attributeFilter: ['value'], subtree: true });\n      });\n    }\n    var shadowWatched = false;\n    function watchShadow() {\n      var sr = window.upcartDocumentOrShadowRoot;\n      if (shadowWatched || !sr || sr === document) return;\n      shadowWatched = true;\n      new MutationObserver(onMutate).observe(sr, { childList: true, subtree: true });\n    }\n    watchShadow();\n    var shadowPolls = 0;\n    var shadowPoll = window.setInterval(function () {\n      watchShadow();\n      shadowPolls += 1;\n      if (shadowWatched || shadowPolls > 30) window.clearInterval(shadowPoll);\n    }, 500);\n\n    /* 3. UpCart's item-removed event (it does not carry the plan, hence the re-read). A $0 line\n     * the SHOPPER removed, through an unlocked row, takes its card's consent with it, so it is\n     * never put back against their action; one this script removed itself does not. */\n    function removedBySelf(key, variant) {\n      var now = Date.now();\n      if (key && selfRemoved[key] && now - selfRemoved[key] < 15000) return true;\n      return Object.keys(selfRemoved).some(function (k) {\n        return now - selfRemoved[k] < 15000 && k.indexOf(variant + ':') === 0;\n      });\n    }\n    function onItemRemoved(event) {\n      try {\n        var item = (event && (event.item || (event.detail && event.detail.item))) || null;\n        var key = item && item.key ? String(item.key) : '';\n        var variant = item ? String(item.variant_id || item.id || '') : '';\n        if (!variant && key) variant = key.split(':')[0];\n        /* S57: the event carries no plan; the last cart read says whether that line was on a listed\n         * plan, and such a line was never a card's subscription line. */\n        if (key && lineInfo[key] && lineInfo[key].listed === true) variant = '';\n        PAIRS.forEach(function (p) {\n          if (variant !== String(p.ph) || removedBySelf(key, variant)) return;\n          revoke(p.card);\n          log('[bfcm-sub-cart] card ' + p.card + ': the shopper removed its filter subscription; it will not be put back');\n        });\n      } catch (error) {\n        /* Nothing to learn from this event. */\n      }\n      schedule();\n    }\n    /* 3b. UpCart's cart-updated callback (S76 review, 2 Nov). UpCart may redraw a changed quantity in\n     * place, or draw it before its own request has changed the cart (see 2 above): its documented\n     * upcartSubscribeCartUpdated(cb) says when the cart itself has changed, so a pass is scheduled\n     * then, as for a drawer change. It also follows this script's own writes, which costs one pass\n     * that writes nothing. A callback alone never writes: a pass writes only when the cart it reads\n     * is out of step. Its reads are limited, not ruled out (an UpCart that keeps calling back keeps\n     * the passes reading): a callback that carries the cart the last pass read is ignored, and one\n     * that carries no readable cart is ignored for 2 s after a pass once two passes in a row have\n     * read the same cart (the drawer observers and the rechecks still run), unless the last finished\n     * pass found the drawer ahead: then up to RECHECKS of them, counted over a run of passes that\n     * find it ahead, still get a pass. Each callback let through restarts the 500 ms wait, so it can\n     * replace a planned recheck. Only while a BFCM line is, or was, in sight. */\n    function bfcmLineIn(cart) {\n      return cart.items.some(function (it) {\n        var v = String(it && it.variant_id);\n        return PAIRS.some(function (p) { return v === String(p.ph) || v === String(p.twinVariant); }) ||\n          SYSTEMS.some(function (s) { return v === String(s.system); });\n      });\n    }\n    function onCartUpdated(arg) {\n      try {\n        var cart = arg && Array.isArray(arg.items) ? arg : arg && arg.cart && Array.isArray(arg.cart.items) ? arg.cart : null;\n        var sig = cartSig(cart);\n        if (sig) {\n          if (sig === lastReadSig || !(sawBfcm || bfcmLineIn(cart))) return;\n        } else if (!(sawBfcm || rows().some(relevant))) {\n          return;\n        } else if (sameReads >= 2 && Date.now() - passEndedAt < 2000) {\n          /* Except while the last finished pass found the drawer ahead of the cart (never while a pass\n           * is reading: ahead is false then): that change may only just have landed, while the\n           * rechecks run or after they are spent, so up to RECHECKS such callbacks still get a pass. */\n          if (!ahead || aheadCalls >= RECHECKS) return;\n          aheadCalls += 1;\n        }\n      } catch (error) {\n        /* An unreadable callback argument: the pass reads the cart itself. */\n      }\n      schedule();\n    }\n\n    /* Registered ONCE each. UpCart's bundle is a deferred app-embed script after this file, so its API\n     * is not there yet when this runs (see TIMING in the header): it is tried now, at\n     * DOMContentLoaded (which waits for UpCart's deferred bundle, however slow its download) and at\n     * window load, and a poll runs for 30 s from the latest of those, for an API UpCart only sets up\n     * later. */\n    var removedHooked = false;\n    function subscribeRemoved() {\n      if (removedHooked) return true;\n      if (typeof window.upcartSubscribeItemRemoved !== 'function') return false;\n      removedHooked = true;\n      try {\n        window.upcartSubscribeItemRemoved(onItemRemoved);\n      } catch (error) {\n        log('[bfcm-sub-cart] UpCart\\'s item-removed callback could not be registered');\n      }\n      return true;\n    }\n    var updatedHooked = false;\n    function subscribeUpdated() {\n      if (updatedHooked) return true;\n      if (typeof window.upcartSubscribeCartUpdated !== 'function') return false;\n      updatedHooked = true;\n      try {\n        window.upcartSubscribeCartUpdated(onCartUpdated);\n      } catch (error) {\n        log('[bfcm-sub-cart] UpCart\\'s cart-updated callback could not be registered');\n      }\n      return true;\n    }\n    function subscribeBoth() {\n      var removed = subscribeRemoved();\n      var updated = subscribeUpdated();\n      return removed && updated;\n    }\n    var removedTries = 0;\n    var removedPoll = null;\n    function hookRemoved() {\n      if (subscribeBoth()) return;\n      removedTries = 0;\n      if (removedPoll) return;\n      removedPoll = window.setInterval(function () {\n        removedTries += 1;\n        if (subscribeBoth() || removedTries >= 120) {\n          window.clearInterval(removedPoll);\n          removedPoll = null;\n        }\n      }, 250);\n    }\n    hookRemoved();\n    function lateHooks() {\n      hookRemoved();\n      watchShadow();\n    }\n    if (document.readyState !== 'complete') {\n      document.addEventListener('DOMContentLoaded', lateHooks, { once: true });\n      window.addEventListener('load', lateHooks, { once: true });\n    }\n\n    /* 4. /cart: a revealed remove link on a $0 line is the shopper's own removal, as above. */\n    document.addEventListener('click', function (event) {\n      var link = event.target && event.target.closest ? event.target.closest('[data-bfcm-sub-remove]') : null;\n      if (!link) return;\n      var variant = link.getAttribute('data-bfcm-sub-variant') || '';\n      PAIRS.forEach(function (p) { if (variant === String(p.ph)) revoke(p.card); });\n    }, true);\n\n    /* 5. The page loaded with a BFCM line in the cart (or a stale Checkout Blocks attribute). The\n     * drawer rows already drawn before this file ran (the observer only sees later changes) are\n     * decorated at once, by variant, and the pass then corrects them from the cart, as on the\n     * observer's path. Only with the flag: without it no pass would follow to unlock a priced line on\n     * a mistyped placeholder id (DR22). */\n    if (DATA.flag === true) {\n      try {\n        decorate();\n      } catch (error) {\n        /* The first pass decorates again. */\n      }\n      schedule();\n    }\n\n    /* 6. /cart came back from this script's own reload: the toasts of that pass, once. */\n    var savedToasts = takeSavedToasts();\n    if (savedToasts.length) {\n      var showSaved = function () { window.setTimeout(function () { savedToasts.forEach(toast); }, 250); };\n      if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', showSaved, { once: true });\n      else showSaved();\n    }\n\n    /* 7. /cart (S76 review, 2 Nov): the hidden updates[] of a $0 line (sections/main-cart.liquid)\n     * follow what the shopper types into its bundle's quantity at once, so a Checkout click made before\n     * the theme's own update and reload posts the $0 line at the pass's rule applied to what was typed\n     * (only the typed one of the bundle's two inputs changes). This list carries two values per line,\n     * so Shopify most likely ignores it (an inference): the pass after the reload is the real check.\n     * The pass's rule: down always, up only while the card is switched\n     * on, never above the card's limit. Only for a bundle the last read saw as ONE merged line known\n     * to be the twin, with ONE $0 line on its plan, and never on an unsure cart (K4). The $0 line's\n     * row is found by its own remove link (data-bfcm-sub-variant), else by the line key in that\n     * link's address. */\n    function hiddenQuantities(ph, key) {\n      var byVariant = [];\n      var byKey = [];\n      document.querySelectorAll('[data-bfcm-sub-remove]').forEach(function (link) {\n        var row = link.closest ? link.closest('tr') : null;\n        if (!row) return;\n        if ((link.getAttribute('data-bfcm-sub-variant') || '') === ph && byVariant.indexOf(row) === -1) byVariant.push(row);\n        var m = String(link.getAttribute('href') || '').match(/[?&]id=([^&#]+)/);\n        var id = '';\n        try {\n          id = m ? decodeURIComponent(m[1]) : '';\n        } catch (error) {\n          id = '';\n        }\n        if (id === key && byKey.indexOf(row) === -1) byKey.push(row);\n      });\n      var found = byVariant.length === 1 ? byVariant : byKey.length === 1 ? byKey : [];\n      var out = [];\n      found.forEach(function (row) {\n        row.querySelectorAll('input[type=\"hidden\"][name=\"updates[]\"]').forEach(function (input) { out.push(input); });\n      });\n      return out;\n    }\n    function followTyped(key, typed) {\n      if (!key || !(typed >= 0) || !lastCart || unsureNow) return;\n      var items = lastCart.items.filter(notListed);\n      judgePairs().active.forEach(function (j) {\n        var lines = pairLines(items, j, lastCart.items);\n        if (lines.parts.length || lines.merged.length !== 1 || lines.cappable.length !== 1 || String(lines.merged[0].key) !== key) return;\n        var onPlan = lines.placeholders.filter(function (it) { return planOf(it) === String(j.pair.plan); });\n        if (onPlan.length !== 1) return;\n        var have = Number(onPlan[0].quantity) || 0;\n        var want = Math.min(typed, limitOf(j.pair));\n        var target = String(want > have && j.pair.enabled !== true ? have : want);\n        hiddenQuantities(String(j.pair.ph), String(onPlan[0].key)).forEach(function (hidden) {\n          if (hidden.value !== target) hidden.value = target;\n        });\n      });\n    }\n    var typedInputs = {};\n    function onCartQuantity(event) {\n      try {\n        var input = event && event.target;\n        if (!input || input.name !== 'updates[]' || !input.getAttribute) return;\n        var key = input.getAttribute('data-line-key') || '';\n        if (key) typedInputs[key] = input;\n        followTyped(key, parseInt(input.value, 10));\n      } catch (error) {\n        /* The pass after the theme's reload still checks the pair. */\n      }\n    }\n    /* When the store refuses a typed quantity, the theme puts the old one back WITHOUT an event\n     * (quantity-selector restoreDefaultValue(), assets/theme.js), so the copy above would be left at\n     * the refused number. On Checkout (the submit, before the form is posted) the copy is made again\n     * from what each typed bundle input holds at that moment, by the same rule, whether the theme's\n     * change went through, is still on its way, or was refused. A form.submit() or a read of the\n     * form's data without a submit event is not covered; nothing in the theme does either. */\n    function onCartSubmit(event) {\n      try {\n        var form = event && event.target;\n        Object.keys(typedInputs).forEach(function (key) {\n          var input = typedInputs[key];\n          if (form && input && input.form === form) followTyped(key, parseInt(input.value, 10));\n        });\n      } catch (error) {\n        /* As above. */\n      }\n    }\n    if (ON_CART_PAGE) {\n      document.addEventListener('input', onCartQuantity, true);\n      document.addEventListener('change', onCartQuantity, true);\n      document.addEventListener('submit', onCartSubmit, true);\n    }\n\n    /* For Santevia's Fly custom script, if it must ever rebuild a checkout (R12, design 11.6 step 4,\n     * which is conditional: nothing calls this yet): what the rebuilt checkout must carry besides the\n     * bundles - each $0 line whose bundle is in the cart, and the SGWS plan line, each with its plan.\n     * Pass the cart the script has just read (cart.js); with no argument it uses this file's last\n     * read, which is null until a pass has run on the page (call window.bfcmSubCart.reconcile() and\n     * wait for it first, or pass the cart). An orphan $0 line, whose bundle is gone, is left out: it\n     * must not reach checkout without it. On an unsure cart (a Fly-looking line whose offer cannot be\n     * read) every $0 line is kept, because its bundle may be the line that cannot be read. A line on\n     * a listed plan (S57) is never one of them. THE CALLER FAILS CLOSED: when window.bfcmSubCart is\n     * missing (this file did not load, or stopped), it must not clear or rebuild the cart at all, and\n     * goes straight to /checkout with the cart as it is - a missing object is never \"no extras\". */\n    window.bfcmSubCart = {\n      extraCheckoutItems: function (cartArg) {\n        var cart = cartArg && Array.isArray(cartArg.items) ? cartArg : lastCart;\n        var out = [];\n        if (!cart || !Array.isArray(cart.items)) return out;\n        var items = cart.items.filter(notListed);\n        var judged = judgePairs();\n        var twinVariants = judged.active.map(function (j) { return String(j.pair.twinVariant); });\n        var unsure = items.some(function (it) {\n          return looksFly(it) && !lineOffer(it) && twinVariants.indexOf(String(it.variant_id)) === -1;\n        });\n        judged.active.forEach(function (j) {\n          var lines = pairLines(items, j);\n          var onPlan = lines.placeholders.filter(function (it) { return planOf(it) === String(j.pair.plan); });\n          if (onPlan.length && (lines.twins || unsure)) {\n            /* S76: at its own quantity, which the pass keeps equal to its bundle's. */\n            out.push({ id: Number(j.pair.ph), quantity: Number(onPlan[0].quantity) || 1, selling_plan: Number(j.pair.plan) });\n          }\n        });\n        SYSTEMS.forEach(function (s) {\n          items.forEach(function (it) {\n            if (String(it.variant_id) === String(s.system) && planOf(it) === String(s.plan)) {\n              out.push({ id: Number(s.system), quantity: Number(it.quantity) || 1, selling_plan: Number(s.plan) });\n            }\n          });\n        });\n        return out;\n      },\n      reconcile: function () { schedule(0); }\n    };\n  } catch (error) {\n    showCartRemoves();\n    if (window.console) console.warn('[bfcm-sub-cart] not started', error);\n  }\n})();\n"],
  "mappings": "CA0DC,UAAY,CACX,aAIA,SAAS,iBAAkB,CACzB,GAAI,CACF,SAAS,iBAAiB,wBAAwB,EAAE,QAAQ,SAAU,KAAM,CAC1E,KAAK,OAAS,EAChB,CAAC,CACH,OAAS,MAAO,CAEhB,CACF,CACA,GAAI,CAkCF,IAAS,QAAT,SAAiB,MAAO,CACtB,IAAI,EAAI,KAAK,MAAM,OAAO,OAAS,MAAM,GAAG,CAAC,EAC7C,OAAO,GAAK,EAAI,EAAI,EACtB,EAKS,KAAT,UAAgB,CACd,OAAQ,OAAO,SAAW,OAAO,QAAQ,QAAU,OAAO,QAAQ,OAAO,MAAS,GACpF,EACS,MAAT,UAAiB,CACf,IAAI,IAAM,CAAC,QAAQ,EACf,GAAK,OAAO,2BAChB,O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