'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 country associated with either the current order on the order status page
 * or the selected country in the customer account interface,
 * and automatically re-renders your component if the country changes.
 */
function useLocalizationCountry() {
  const api$1 = api.useApi();
  const extensionTarget = api$1.extension.target;
  if (!('country' in api$1.localization)) {
    throw new errors.ExtensionHasNoFieldError('country', extensionTarget);
  }
  return subscription.useSubscription(api$1.localization.country);
}

exports.useLocalizationCountry = useLocalizationCountry;
