'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var api = require('./api.js');
var subscription = require('./subscription.js');
var errors = require('./errors.js');

/**
 * Returns the current line items for the checkout, and automatically re-renders
 * your component if line items are added, removed, or updated.
 */
function useCartLines() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('lines' in api$1)) {
    throw new errors.ExtensionHasNoFieldError('lines', extensionTarget);
  }
  return subscription.useSubscription(api$1.lines);
}

exports.useCartLines = useCartLines;
