{
  "version": 3,
  "sources": ["/cdn/shop/t/20/assets/cart-drawer.js?dpw=cart-standard-v1"],
  "sourcesContent": ["const FINCH_INSURANCE_STORAGE_KEY = 'finch-cart-insurance-enabled';\nconst FINCH_GIFT_DECLINED_STORAGE_KEY = 'finch-cart-gift-declined';\nconst FINCH_GIFT_MARKER = 'cart-threshold';\n\nclass CartDrawer extends HTMLElement {\n  constructor() {\n    super();\n\n    this.activeElement = null;\n    this.upsellRequestInFlight = false;\n    this.insuranceIntentToken = 0;\n    this.insuranceQueue = Promise.resolve();\n    this.insuranceMutationInFlight = false;\n    this.giftIntentToken = 0;\n    this.giftQueue = Promise.resolve();\n    this.giftMutationInFlight = false;\n    this.giftReconcileScheduled = false;\n    this.cartMutationQueue = Promise.resolve();\n    this.cartMutationActive = false;\n    this.sectionRefreshToken = 0;\n    this.sectionRefreshAbortController = null;\n    this.focusTransitionHandler = null;\n    this.focusTransitionPanel = null;\n\n    this.onDrawerClick = this.onDrawerClick.bind(this);\n    this.onDocumentKeydown = this.onDocumentKeydown.bind(this);\n\n    this.addEventListener('click', this.onDrawerClick);\n  }\n\n  connectedCallback() {\n    document.addEventListener('keydown', this.onDocumentKeydown);\n    this.cartUpdateUnsubscriber?.();\n    this.cartUpdateUnsubscriber = subscribe(PUB_SUB_EVENTS.cartUpdate, (event) => {\n      // ProductForm renders this same section response immediately after publishing.\n      // Rendering it here too could let an older response overwrite insurance state.\n      if (event.source === 'product-form') return;\n\n      if (event.cartData?.sections?.['cart-drawer']) {\n        this.syncAfterExternalRender(event.cartData);\n        return;\n      }\n\n      return this.refreshFromServer({ openDrawer: false });\n    });\n    this.setHeaderCartIconAccessibility();\n    this.syncEmptyState();\n    this.syncInsuranceControlsFromMarkup();\n    this.initialiseInsurancePreference();\n    this.scheduleGiftReconcile();\n  }\n\n  disconnectedCallback() {\n    document.removeEventListener('keydown', this.onDocumentKeydown);\n    this.cartUpdateUnsubscriber?.();\n    this.cartUpdateUnsubscriber = undefined;\n    window.clearTimeout(this.focusFallbackTimer);\n    this.sectionRefreshAbortController?.abort();\n  }\n\n  onDocumentKeydown(event) {\n    if (event.key === 'Escape' && this.classList.contains('active')) this.close();\n  }\n\n  onDrawerClick(event) {\n    const target = event.target instanceof Element ? event.target : null;\n    if (!target) return;\n\n    if (target.closest('#CartDrawer-Overlay, [data-finch-cart-close], .drawer__close')) {\n      event.preventDefault();\n      this.close();\n      return;\n    }\n\n    const upsellAddButton = target.closest('[data-finch-upsell-add]');\n    if (upsellAddButton) {\n      event.preventDefault();\n      this.addUpsell(upsellAddButton);\n      return;\n    }\n\n    if (target.closest('[data-finch-gift-remove]')) this.writeGiftDeclined(true);\n\n    const insuranceToggle = target.closest('[data-finch-insurance-toggle]');\n    if (insuranceToggle) {\n      if (!insuranceToggle.matches('input[type=\"checkbox\"]')) event.preventDefault();\n      this.handleInsuranceIntent(insuranceToggle);\n    }\n  }\n\n  setHeaderCartIconAccessibility() {\n    const cartLink = document.querySelector('#cart-icon-bubble');\n    if (!cartLink) return;\n\n    cartLink.setAttribute('aria-expanded', String(this.classList.contains('active')));\n    cartLink.setAttribute('aria-controls', 'CartDrawer');\n    if (cartLink.dataset.finchCartDrawerBound === 'true') return;\n\n    cartLink.dataset.finchCartDrawerBound = 'true';\n    cartLink.setAttribute('role', 'button');\n    cartLink.setAttribute('aria-haspopup', 'dialog');\n\n    cartLink.addEventListener('click', (event) => {\n      event.preventDefault();\n      this.open(cartLink);\n    });\n\n    cartLink.addEventListener('keydown', (event) => {\n      if (event.key !== ' ' && event.key !== 'Enter') return;\n      event.preventDefault();\n      this.open(cartLink);\n    });\n  }\n\n  open(triggeredBy) {\n    if (triggeredBy) this.setActiveElement(triggeredBy);\n\n    const noteSummary = this.querySelector('[id^=\"Details-\"] summary');\n    if (noteSummary && !noteSummary.hasAttribute('role')) this.setSummaryAccessibility(noteSummary);\n\n    this.classList.add('animate');\n    window.requestAnimationFrame(() => this.classList.add('active'));\n    document.body.classList.add('overflow-hidden');\n    document.querySelector('#cart-icon-bubble')?.setAttribute('aria-expanded', 'true');\n\n    let focusApplied = false;\n    const focusDrawer = () => {\n      if (focusApplied) return;\n      focusApplied = true;\n      window.clearTimeout(this.focusFallbackTimer);\n\n      const focusContainer = this.classList.contains('is-empty')\n        ? this.querySelector('.drawer__inner-empty') || this.querySelector('.drawer__inner')\n        : this.querySelector('#CartDrawer') || this.querySelector('.drawer__inner');\n      const initialFocus = this.querySelector('.drawer__close') || this.querySelector('.drawer__inner');\n\n      if (!focusContainer || !initialFocus) return;\n      if (typeof window.trapFocus === 'function') {\n        window.trapFocus(focusContainer, initialFocus);\n      } else {\n        initialFocus.focus();\n      }\n    };\n\n    const drawerPanel = this.querySelector('.drawer__inner');\n    if (this.focusTransitionPanel && this.focusTransitionHandler) {\n      this.focusTransitionPanel.removeEventListener('transitionend', this.focusTransitionHandler);\n    }\n    this.focusTransitionPanel = drawerPanel;\n    this.focusTransitionHandler = (event) => {\n      if (event.target !== drawerPanel || event.propertyName !== 'transform' || !this.classList.contains('active')) {\n        return;\n      }\n      drawerPanel.removeEventListener('transitionend', this.focusTransitionHandler);\n      this.focusTransitionHandler = null;\n      this.focusTransitionPanel = null;\n      focusDrawer();\n    };\n    drawerPanel?.addEventListener('transitionend', this.focusTransitionHandler);\n    window.clearTimeout(this.focusFallbackTimer);\n    this.focusFallbackTimer = window.setTimeout(() => {\n      if (this.classList.contains('active')) focusDrawer();\n    }, 350);\n  }\n\n  close() {\n    this.classList.remove('active');\n    document.body.classList.remove('overflow-hidden');\n    document.querySelector('#cart-icon-bubble')?.setAttribute('aria-expanded', 'false');\n    window.clearTimeout(this.focusFallbackTimer);\n    if (this.focusTransitionPanel && this.focusTransitionHandler) {\n      this.focusTransitionPanel.removeEventListener('transitionend', this.focusTransitionHandler);\n    }\n    this.focusTransitionHandler = null;\n    this.focusTransitionPanel = null;\n\n    const focusTarget = this.activeElement?.isConnected\n      ? this.activeElement\n      : document.querySelector('#cart-icon-bubble');\n\n    if (typeof window.removeTrapFocus === 'function') {\n      window.removeTrapFocus(focusTarget);\n    } else {\n      focusTarget?.focus();\n    }\n  }\n\n  refreshFocusTrap(focusSelector = null) {\n    if (!this.classList.contains('active')) return;\n\n    const panel = this.querySelector('.drawer__inner');\n    if (!panel) return;\n\n    const currentFocus = this.contains(document.activeElement) && document.activeElement !== document.body\n      ? document.activeElement\n      : null;\n    const requestedFocus = focusSelector ? this.querySelector(focusSelector) : null;\n    const focusTarget = requestedFocus || currentFocus || this.querySelector('.drawer__close') || panel;\n\n    if (typeof window.removeTrapFocus === 'function') window.removeTrapFocus();\n    if (typeof window.trapFocus === 'function') {\n      window.trapFocus(panel, focusTarget);\n    } else {\n      focusTarget.focus();\n    }\n  }\n\n  setSummaryAccessibility(summary) {\n    summary.setAttribute('role', 'button');\n    summary.setAttribute('aria-expanded', String(summary.parentElement?.hasAttribute('open')));\n\n    const contentId = summary.nextElementSibling?.id;\n    if (contentId) summary.setAttribute('aria-controls', contentId);\n\n    summary.addEventListener('click', (event) => {\n      const details = event.currentTarget.closest('details');\n      event.currentTarget.setAttribute('aria-expanded', String(!details?.hasAttribute('open')));\n    });\n\n    if (typeof window.onKeyUpEscape === 'function') {\n      summary.parentElement?.addEventListener('keyup', window.onKeyUpEscape);\n    }\n  }\n\n  renderContents(parsedState, options = {}) {\n    if (!parsedState?.sections) return;\n\n    const shouldOpen = options.openDrawer ?? true;\n    const wasActive = this.classList.contains('active');\n\n    this.productId = parsedState.id;\n    this.syncRootStateFromSection(parsedState.sections['cart-drawer']);\n    this.getSectionsToRender().forEach((section) => {\n      const sectionElement = section.selector\n        ? document.querySelector(section.selector)\n        : document.getElementById(section.id);\n      const sectionHtml = parsedState.sections[section.id];\n      if (!sectionElement || !sectionHtml) return;\n\n      const innerHtml = this.getSectionInnerHTML(sectionHtml, section.selector);\n      if (innerHtml !== null) sectionElement.innerHTML = innerHtml;\n    });\n\n    this.syncEmptyState(parsedState);\n    this.setHeaderCartIconAccessibility();\n    this.syncInsuranceControlsFromMarkup();\n    this.initialiseInsurancePreference();\n    this.scheduleGiftReconcile();\n    if (this.cartMutationActive) this.setCartControlsBusy(true);\n\n    if (shouldOpen && !wasActive) {\n      window.setTimeout(() => this.open());\n    } else if (wasActive) {\n      window.requestAnimationFrame(() => this.refreshFocusTrap(options.focusSelector));\n    }\n  }\n\n  syncAfterExternalRender(parsedState, options = {}) {\n    if (parsedState?.sections?.['cart-drawer']) {\n      this.syncRootStateFromSection(parsedState.sections['cart-drawer']);\n    }\n\n    this.syncEmptyState(parsedState);\n    this.setHeaderCartIconAccessibility();\n    this.syncInsuranceControlsFromMarkup();\n    this.initialiseInsurancePreference();\n    this.scheduleGiftReconcile();\n\n    if (this.classList.contains('active')) {\n      window.requestAnimationFrame(() => this.refreshFocusTrap(options.focusSelector));\n    }\n  }\n\n  async refreshFromServer(options = {}) {\n    const requestToken = ++this.sectionRefreshToken;\n    this.sectionRefreshAbortController?.abort();\n    const controller = new AbortController();\n    this.sectionRefreshAbortController = controller;\n\n    const cartUrl = window.routes?.cart_url || '/cart';\n    const url = new URL(cartUrl, window.location.origin);\n    url.searchParams.set('sections', this.getSectionsToRender().map((section) => section.id).join(','));\n    url.searchParams.set('sections_url', window.location.pathname);\n\n    try {\n      const response = await fetch(url.toString(), {\n        headers: { Accept: 'application/json' },\n        credentials: 'same-origin',\n        signal: controller.signal,\n      });\n      const sections = await response.json();\n      if (!response.ok) throw new Error('Winkelwagen kon niet worden vernieuwd.');\n      if (requestToken !== this.sectionRefreshToken) return;\n\n      this.renderContents({ sections }, { openDrawer: options.openDrawer ?? false });\n    } catch (error) {\n      if (error.name !== 'AbortError') {\n        console.error(error);\n        this.announce('Winkelwagen kon niet worden vernieuwd.', true);\n      }\n    } finally {\n      if (requestToken === this.sectionRefreshToken) this.sectionRefreshAbortController = null;\n    }\n  }\n\n  syncEmptyState(parsedState = {}) {\n    const sectionHtml = parsedState.sections?.['cart-drawer'];\n    if (sectionHtml) this.syncRootStateFromSection(sectionHtml);\n\n    let isEmpty = this.dataset.visibleItemCount === '0';\n    if (this.dataset.visibleItemCount === undefined && sectionHtml) {\n      const parsed = new DOMParser().parseFromString(sectionHtml, 'text/html');\n      isEmpty = Boolean(parsed.querySelector('.drawer__inner-empty'));\n    } else if (this.dataset.visibleItemCount === undefined && typeof parsedState.item_count === 'number') {\n      isEmpty = parsedState.item_count === 0;\n    }\n\n    this.classList.toggle('is-empty', isEmpty);\n    if (isEmpty) {\n      this.cleanupOrphanedInsurance();\n      this.scheduleGiftReconcile();\n    }\n  }\n\n  syncRootStateFromSection(sectionHtml) {\n    if (!sectionHtml) return;\n\n    const parsed = new DOMParser().parseFromString(sectionHtml, 'text/html');\n    const source = parsed.querySelector('cart-drawer[data-visible-item-count]');\n    if (!source) return;\n\n    [\n      'visibleItemCount',\n      'counterItemCount',\n      'eligibleItemCount',\n      'promoState',\n      'promoRewards',\n      'cartTotalCents',\n      'insuranceVariantId',\n      'insuranceInCart',\n      'defaultEnabled',\n      'giftFeatureActive',\n      'giftVariantId',\n      'giftQuantity',\n      'giftQualifies',\n      'giftThresholdCents',\n    ].forEach((key) => {\n      if (source.dataset[key] !== undefined) this.dataset[key] = source.dataset[key];\n    });\n  }\n\n  cleanupOrphanedInsurance() {\n    if (\n      this.dataset.visibleItemCount !== '0' ||\n      this.dataset.insuranceInCart !== 'true' ||\n      this.insuranceMutationInFlight\n    ) {\n      return;\n    }\n\n    const variantId = this.getInsuranceVariantId();\n    if (!variantId) return;\n\n    this.queueInsuranceReconcile(false, variantId, { persistPreference: false });\n  }\n\n  getSectionInnerHTML(html, selector = '.shopify-section') {\n    const parsed = new DOMParser().parseFromString(html, 'text/html');\n    const source = parsed.querySelector(selector || '.shopify-section') || parsed.querySelector('.shopify-section');\n    return source ? source.innerHTML : null;\n  }\n\n  getSectionsToRender() {\n    return [\n      {\n        id: 'cart-drawer',\n        selector: '#CartDrawer',\n      },\n      {\n        id: 'cart-icon-bubble',\n      },\n    ];\n  }\n\n  getSectionDOM(html, selector = '.shopify-section') {\n    return new DOMParser().parseFromString(html, 'text/html').querySelector(selector);\n  }\n\n  setActiveElement(element) {\n    this.activeElement = element;\n  }\n\n  async addUpsell(button) {\n    if (this.upsellRequestInFlight || this.isControlBusy(button)) return;\n\n    const variantId = Number(button.dataset.variantId);\n    if (!Number.isFinite(variantId) || variantId <= 0) {\n      this.announce('Dit product kon niet worden toegevoegd.', true);\n      return;\n    }\n\n    this.upsellRequestInFlight = true;\n    this.setControlBusy(button, true);\n    this.setActiveElement(document.activeElement);\n\n    try {\n      await this.enqueueCartMutation(async () => {\n        const parsedState = await this.requestJSON(window.routes.cart_add_url, {\n          items: [{ id: variantId, quantity: 1 }],\n          sections: this.getSectionsToRender().map((section) => section.id),\n          sections_url: window.location.pathname,\n        });\n\n        this.renderContents(parsedState, { openDrawer: this.classList.contains('active') });\n        this.publishCartUpdate(parsedState, variantId);\n        this.announce(button.dataset.successMessage || 'Product toegevoegd aan je winkelwagen.');\n      });\n    } catch (error) {\n      console.error(error);\n      this.announce(error.message || 'Dit product kon niet worden toegevoegd.', true);\n    } finally {\n      this.upsellRequestInFlight = false;\n      this.setControlBusy(button, false);\n    }\n  }\n\n  initialiseInsurancePreference() {\n    const toggle = this.querySelector('[data-finch-insurance-toggle]');\n    const variantId = this.getInsuranceVariantId(toggle);\n    if (!toggle || !variantId) return;\n\n    const serverState = this.getInsuranceStateFromMarkup(toggle);\n    const storedPreference = this.readInsurancePreference();\n    const defaultValue = this.readBooleanData(toggle, 'defaultEnabled');\n    const desiredState = storedPreference ?? (serverState ? true : defaultValue ?? false);\n\n    this.setInsuranceControls(desiredState, false);\n    if (desiredState !== serverState) this.queueInsuranceReconcile(desiredState, variantId);\n  }\n\n  handleInsuranceIntent(toggle) {\n    if (this.isControlBusy(toggle)) return;\n\n    const variantId = this.getInsuranceVariantId(toggle);\n    if (!variantId) {\n      this.announce('De verzendverzekering is niet beschikbaar.', true);\n      return;\n    }\n\n    const currentState = this.getInsuranceControlState(toggle);\n    const desiredState = toggle.matches('input[type=\"checkbox\"]') ? toggle.checked : !currentState;\n\n    this.writeInsurancePreference(desiredState);\n    this.setInsuranceControls(desiredState, true);\n    this.queueInsuranceReconcile(desiredState, variantId);\n  }\n\n  queueInsuranceReconcile(desiredState, variantId, { persistPreference = true } = {}) {\n    const intentToken = ++this.insuranceIntentToken;\n    this.insuranceQueue = this.insuranceQueue\n      .catch(() => undefined)\n      .then(() =>\n        this.enqueueCartMutation(() =>\n          this.reconcileInsurance(intentToken, desiredState, variantId, persistPreference)\n        )\n      );\n    return this.insuranceQueue;\n  }\n\n  async reconcileInsurance(intentToken, desiredState, variantId, persistPreference = true) {\n    if (intentToken !== this.insuranceIntentToken) return;\n\n    this.insuranceMutationInFlight = true;\n    this.setInsuranceControls(desiredState, true);\n    let serverState = this.getInsuranceStateFromMarkup();\n\n    try {\n      const cart = await this.fetchCart();\n      const matchingItems = cart.items.filter((item) => Number(item.variant_id) === Number(variantId));\n      const matchingQuantity = matchingItems.reduce((total, item) => total + item.quantity, 0);\n      serverState = matchingQuantity > 0;\n\n      const alreadyCorrect = desiredState ? matchingQuantity === 1 : matchingQuantity === 0;\n      if (alreadyCorrect) {\n        if (intentToken === this.insuranceIntentToken) {\n          this.setInsuranceControls(serverState, false);\n          if (persistPreference) this.writeInsurancePreference(serverState);\n        }\n        return;\n      }\n\n      const updates = {};\n      if (matchingItems.length) {\n        matchingItems.forEach((item, index) => {\n          updates[item.key] = desiredState && index === 0 ? 1 : 0;\n        });\n      } else if (desiredState) {\n        updates[String(variantId)] = 1;\n      }\n\n      const parsedState = await this.requestJSON(window.routes.cart_update_url, {\n        updates,\n        sections: this.getSectionsToRender().map((section) => section.id),\n        sections_url: window.location.pathname,\n      });\n\n      const verifiedQuantity = parsedState.items\n        .filter((item) => Number(item.variant_id) === Number(variantId))\n        .reduce((total, item) => total + item.quantity, 0);\n      const verifiedState = verifiedQuantity > 0;\n\n      if ((desiredState && verifiedQuantity !== 1) || (!desiredState && verifiedQuantity !== 0)) {\n        throw new Error('De verzendverzekering kon niet worden bijgewerkt.');\n      }\n\n      this.renderContents(parsedState, {\n        openDrawer: this.classList.contains('active'),\n        focusSelector: '[data-finch-insurance-toggle]',\n      });\n      this.publishCartUpdate(parsedState, variantId);\n\n      if (intentToken === this.insuranceIntentToken) {\n        if (persistPreference) this.writeInsurancePreference(verifiedState);\n        this.setInsuranceControls(verifiedState, false);\n        this.announce(\n          verifiedState\n            ? 'Verzendverzekering toegevoegd aan je winkelwagen.'\n            : 'Verzendverzekering verwijderd uit je winkelwagen.'\n        );\n      }\n    } catch (error) {\n      console.error(error);\n      if (intentToken === this.insuranceIntentToken) {\n        let verifiedServerState = serverState;\n        try {\n          const latestCart = await this.fetchCart();\n          verifiedServerState = latestCart.items.some(\n            (item) => Number(item.variant_id) === Number(variantId) && item.quantity > 0\n          );\n        } catch (verificationError) {\n          console.error(verificationError);\n        }\n\n        if (persistPreference) this.writeInsurancePreference(verifiedServerState);\n        this.setInsuranceControls(verifiedServerState, false);\n        this.announce(error.message || 'De verzendverzekering kon niet worden bijgewerkt.', true);\n      }\n    } finally {\n      this.insuranceMutationInFlight = false;\n      if (intentToken === this.insuranceIntentToken) this.setInsuranceBusy(false);\n    }\n  }\n\n  scheduleGiftReconcile() {\n    if (this.giftReconcileScheduled) return;\n\n    this.giftReconcileScheduled = true;\n    Promise.resolve().then(() => {\n      this.giftReconcileScheduled = false;\n      this.queueGiftReconcile();\n    });\n  }\n\n  queueGiftReconcile() {\n    const variantId = this.getGiftVariantId();\n    const giftQuantity = Number(this.dataset.giftQuantity || 0);\n    const featureActive = this.dataset.giftFeatureActive === 'true';\n    const qualifies = featureActive && this.dataset.giftQualifies === 'true';\n\n    if (!qualifies) this.writeGiftDeclined(false);\n    if (!variantId || (!qualifies && giftQuantity <= 0)) return Promise.resolve();\n    if (qualifies && giftQuantity === 1 && !this.readGiftDeclined()) return Promise.resolve();\n    if (qualifies && giftQuantity === 0 && this.readGiftDeclined()) return Promise.resolve();\n\n    const intentToken = ++this.giftIntentToken;\n    this.giftQueue = this.giftQueue\n      .catch(() => undefined)\n      .then(() => this.enqueueCartMutation(() => this.reconcileGift(intentToken, variantId, qualifies)));\n    return this.giftQueue;\n  }\n\n  async reconcileGift(intentToken, variantId, qualifies) {\n    if (intentToken !== this.giftIntentToken) return;\n\n    this.giftMutationInFlight = true;\n    try {\n      const cart = await this.fetchCart();\n      const managedItems = cart.items.filter(\n        (item) =>\n          Number(item.variant_id) === Number(variantId) &&\n          item.properties?._finch_auto_gift === FINCH_GIFT_MARKER\n      );\n      const managedQuantity = managedItems.reduce((total, item) => total + item.quantity, 0);\n\n      if (!qualifies) {\n        this.writeGiftDeclined(false);\n        if (!managedItems.length) return;\n\n        const updates = Object.fromEntries(managedItems.map((item) => [item.key, 0]));\n        const parsedState = await this.requestJSON(window.routes.cart_update_url, {\n          updates,\n          sections: this.getSectionsToRender().map((section) => section.id),\n          sections_url: window.location.pathname,\n        });\n        this.renderContents(parsedState, { openDrawer: this.classList.contains('active') });\n        this.publishCartUpdate(parsedState, variantId);\n        return;\n      }\n\n      if (this.readGiftDeclined() && managedQuantity === 0) return;\n      if (managedItems.length === 1 && managedQuantity === 1) return;\n\n      let parsedState;\n      if (managedItems.length) {\n        const updates = {};\n        managedItems.forEach((item, index) => {\n          updates[item.key] = index === 0 ? 1 : 0;\n        });\n        parsedState = await this.requestJSON(window.routes.cart_update_url, {\n          updates,\n          sections: this.getSectionsToRender().map((section) => section.id),\n          sections_url: window.location.pathname,\n        });\n      } else {\n        parsedState = await this.requestJSON(window.routes.cart_add_url, {\n          items: [\n            {\n              id: variantId,\n              quantity: 1,\n              properties: {\n                _finch_auto_gift: FINCH_GIFT_MARKER,\n                _finch_auto_gift_source: 'threshold-auto',\n              },\n            },\n          ],\n          sections: this.getSectionsToRender().map((section) => section.id),\n          sections_url: window.location.pathname,\n        });\n      }\n\n      this.renderContents(parsedState, {\n        openDrawer: this.classList.contains('active'),\n        focusSelector: '[data-finch-gift-line] [data-finch-gift-remove]',\n      });\n      this.publishCartUpdate(parsedState, variantId);\n    } catch (error) {\n      console.error(error);\n      this.announce('Het gratis cadeau kon niet automatisch worden bijgewerkt. Je kunt wel gewoon afrekenen.', true);\n    } finally {\n      this.giftMutationInFlight = false;\n    }\n  }\n\n  getGiftVariantId() {\n    const variantId = Number(this.dataset.giftVariantId);\n    return Number.isFinite(variantId) && variantId > 0 ? variantId : null;\n  }\n\n  getGiftDeclinedStorageKey() {\n    return `${FINCH_GIFT_DECLINED_STORAGE_KEY}:${this.dataset.giftVariantId || 'none'}:${\n      this.dataset.giftThresholdCents || '0'\n    }`;\n  }\n\n  readGiftDeclined() {\n    try {\n      return window.sessionStorage.getItem(this.getGiftDeclinedStorageKey()) === 'true';\n    } catch (_error) {\n      return false;\n    }\n  }\n\n  writeGiftDeclined(declined) {\n    try {\n      const key = this.getGiftDeclinedStorageKey();\n      if (declined) {\n        window.sessionStorage.setItem(key, 'true');\n      } else {\n        window.sessionStorage.removeItem(key);\n      }\n    } catch (_error) {\n      // Storage may be unavailable; the server cart remains authoritative.\n    }\n  }\n\n  async fetchCart() {\n    const response = await fetch(`${window.routes.cart_url}.js`, {\n      method: 'GET',\n      headers: { Accept: 'application/json' },\n      credentials: 'same-origin',\n    });\n\n    const data = await response.json();\n    if (!response.ok) throw new Error(data.description || data.message || 'Winkelwagen kon niet worden geladen.');\n    return data;\n  }\n\n  async requestJSON(url, body) {\n    const response = await fetch(url, {\n      method: 'POST',\n      headers: {\n        Accept: 'application/json',\n        'Content-Type': 'application/json',\n        'X-Requested-With': 'XMLHttpRequest',\n      },\n      credentials: 'same-origin',\n      body: JSON.stringify(body),\n    });\n\n    let data;\n    try {\n      data = await response.json();\n    } catch (_error) {\n      throw new Error('Shopify gaf geen geldig antwoord.');\n    }\n\n    if (!response.ok || data.status || data.errors) {\n      const errors = typeof data.errors === 'string' ? data.errors : null;\n      throw new Error(errors || data.description || data.message || 'Winkelwagen kon niet worden bijgewerkt.');\n    }\n\n    return data;\n  }\n\n  enqueueCartMutation(task) {\n    const queued = this.cartMutationQueue\n      .catch(() => undefined)\n      .then(async () => {\n        await this.waitForCartIdle();\n        this.cartMutationActive = true;\n        this.setCartControlsBusy(true);\n        try {\n          return await task();\n        } finally {\n          this.cartMutationActive = false;\n          this.setCartControlsBusy(false);\n        }\n      });\n\n    this.cartMutationQueue = queued;\n    return queued;\n  }\n\n  async waitForCartIdle() {\n    for (let attempt = 0; attempt < 50; attempt += 1) {\n      if (!this.querySelector('#CartDrawer-CartItems.cart__items--disabled')) return;\n      await new Promise((resolve) => window.setTimeout(resolve, 50));\n    }\n  }\n\n  setCartControlsBusy(busy) {\n    this.querySelectorAll(\n      '[data-finch-upsell-add], [data-finch-insurance-toggle], .quantity__button, cart-remove-button button, #CartDrawer-Checkout'\n    ).forEach((control) => {\n      control.toggleAttribute('disabled', busy);\n      control.setAttribute('aria-disabled', String(busy));\n    });\n  }\n\n  getInsuranceVariantId(toggle = this.querySelector('[data-finch-insurance-toggle]')) {\n    const source = this.querySelector('[data-insurance-variant-id], [data-variant-id]');\n    const rawId =\n      toggle?.dataset.variantId ||\n      toggle?.dataset.insuranceVariantId ||\n      source?.dataset.variantId ||\n      source?.dataset.insuranceVariantId ||\n      this.dataset.insuranceVariantId;\n    const variantId = Number(rawId);\n    return Number.isFinite(variantId) && variantId > 0 ? variantId : null;\n  }\n\n  getInsuranceStateFromMarkup(toggle = this.querySelector('[data-finch-insurance-toggle]')) {\n    const source = this.querySelector('[data-insurance-in-cart]');\n    const value = toggle?.dataset.insuranceInCart ?? source?.dataset.insuranceInCart ?? this.dataset.insuranceInCart;\n    if (value !== undefined) return value === 'true';\n    return this.getInsuranceControlState(toggle);\n  }\n\n  getInsuranceControlState(toggle) {\n    if (!toggle) return false;\n    if (toggle.matches('input[type=\"checkbox\"]')) return toggle.checked;\n    return toggle.getAttribute('aria-checked') === 'true' || toggle.dataset.enabled === 'true';\n  }\n\n  syncInsuranceControlsFromMarkup() {\n    const toggle = this.querySelector('[data-finch-insurance-toggle]');\n    if (!toggle) return;\n    this.setInsuranceControls(this.getInsuranceStateFromMarkup(toggle), this.insuranceMutationInFlight);\n  }\n\n  setInsuranceControls(enabled, busy) {\n    this.querySelectorAll('[data-finch-insurance-toggle]').forEach((toggle) => {\n      if (toggle.matches('input[type=\"checkbox\"]')) toggle.checked = enabled;\n      toggle.setAttribute('aria-checked', String(enabled));\n      toggle.dataset.enabled = String(enabled);\n      this.setControlBusy(toggle, busy);\n    });\n  }\n\n  setInsuranceBusy(busy) {\n    this.querySelectorAll('[data-finch-insurance-toggle]').forEach((toggle) => this.setControlBusy(toggle, busy));\n  }\n\n  readBooleanData(element, key) {\n    const attributeName = `data-${key.replace(/[A-Z]/g, (character) => `-${character.toLowerCase()}`)}`;\n    const source = this.querySelector(`[${attributeName}]`);\n    const value = element?.dataset[key] ?? source?.dataset[key] ?? this.dataset[key];\n    if (value === undefined) return null;\n    return value === 'true';\n  }\n\n  readInsurancePreference() {\n    try {\n      const value = window.sessionStorage.getItem(FINCH_INSURANCE_STORAGE_KEY);\n      return value === null ? null : value === 'true';\n    } catch (_error) {\n      return null;\n    }\n  }\n\n  writeInsurancePreference(enabled) {\n    try {\n      window.sessionStorage.setItem(FINCH_INSURANCE_STORAGE_KEY, String(enabled));\n    } catch (_error) {\n      // Storage can be unavailable in strict privacy modes; cart state remains authoritative.\n    }\n  }\n\n  setControlBusy(control, busy) {\n    if (!control) return;\n\n    control.classList.toggle('loading', busy);\n    control.toggleAttribute('disabled', busy);\n    control.setAttribute('aria-disabled', String(busy));\n    control.setAttribute('aria-busy', String(busy));\n    control.querySelector('.loading__spinner')?.classList.toggle('hidden', !busy);\n  }\n\n  isControlBusy(control) {\n    return control?.getAttribute('aria-busy') === 'true' || control?.disabled;\n  }\n\n  announce(message, isError = false) {\n    const liveRegion = this.querySelector('[data-finch-live-region], #CartDrawer-LiveRegionText');\n    const errorRegion = this.querySelector('#CartDrawer-CartErrors');\n    if (isError) {\n      if (liveRegion) liveRegion.textContent = '';\n      if (errorRegion) errorRegion.textContent = message;\n      return;\n    }\n\n    if (errorRegion) errorRegion.textContent = '';\n    if (liveRegion) {\n      liveRegion.textContent = message;\n      liveRegion.setAttribute('aria-hidden', 'false');\n    }\n  }\n\n  publishCartUpdate(cartData, variantId) {\n    if (typeof publish !== 'function' || typeof PUB_SUB_EVENTS === 'undefined' || !PUB_SUB_EVENTS.cartUpdate) return;\n    publish(PUB_SUB_EVENTS.cartUpdate, {\n      source: 'cart-items',\n      cartData,\n      variantId,\n    });\n  }\n}\n\nif (!customElements.get('cart-drawer')) customElements.define('cart-drawer', CartDrawer);\n\nclass CartDrawerItems extends CartItems {\n  connectedCallback() {\n    // The persistent <cart-drawer> owns cartUpdate subscriptions. This element\n    // is conditionally removed in the empty state and therefore cannot own them.\n  }\n\n  getSectionsToRender() {\n    return [\n      {\n        id: 'CartDrawer',\n        section: 'cart-drawer',\n        selector: '.drawer__inner',\n      },\n      {\n        id: 'cart-icon-bubble',\n        section: 'cart-icon-bubble',\n        selector: '.shopify-section',\n      },\n    ];\n  }\n}\n\nif (!customElements.get('cart-drawer-items')) customElements.define('cart-drawer-items', CartDrawerItems);\n"],
  "mappings": "AAAA,MAAM,4BAA8B,+BAC9B,gCAAkC,2BAClC,kBAAoB,iBAE1B,MAAM,mBAAmB,WAAY,CACnC,aAAc,CACZ,MAAM,EAEN,KAAK,cAAgB,KACrB,KAAK,sBAAwB,GAC7B,KAAK,qBAAuB,EAC5B,KAAK,eAAiB,QAAQ,QAAQ,EACtC,KAAK,0BAA4B,GACjC,KAAK,gBAAkB,EACvB,KAAK,UAAY,QAAQ,QAAQ,EACjC,KAAK,qBAAuB,GAC5B,KAAK,uBAAyB,GAC9B,KAAK,kBAAoB,QAAQ,QAAQ,EACzC,KAAK,mBAAqB,GAC1B,KAAK,oBAAsB,EAC3B,KAAK,8BAAgC,KACrC,KAAK,uBAAyB,KAC9B,KAAK,qBAAuB,KAE5B,KAAK,cAAgB,KAAK,cAAc,KAAK,IAAI,EACj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