text: "use strict";
  /* ***************************************************************************
   *
   * Copyright (c) 2021, the iexjs authors.
   *
   * This file is part of the iexjs library, distributed under the terms of
   * the Apache License 2.0.  The full license can be found in the LICENSE file.
   *
   */
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.marketShortInterest = exports.shortInterest = void 0;
  const client_1 = require("../client");
  const common_1 = require("../common");
  /**
   * The consolidated market short interest positions in all IEX-listed securities are included in the IEX Short Interest Report.
   *
   * https://iexcloud.io/docs/api/#listed-short-interest-list-in-dev
   *
   * @param {string} symbol Ticker to request
   * @param {string} date Effective Datetime
   * @param {string} token Access token
   * @param {string} version API version
   * @param {string} filter https://iexcloud.io/docs/api/#filter-results
   * @param {string} format output format
   */
  const shortInterest = (symbol, date, { token, version, filter, format } = {}) => {
      common_1._raiseIfNotStr(symbol);
      if (date) {
          return common_1._get({
              url: `stock/${common_1._quoteSymbols(symbol)}/short-interest/${common_1._strOrDate(date)}`,
              token,
              version,
              filter,
              format,
          });
      }
      return common_1._get({
          url: `stock/${common_1._quoteSymbols(symbol)}/short-interest`,
          token,
          version,
          filter,
          format,
      });
  };
  exports.shortInterest = shortInterest;
  client_1.Client.prototype.shortInterest = function (symbol, date, { filter, format } = {}) {
      return exports.shortInterest(symbol, date, {
          token: this._token,
          version: this._version,
          filter,
          format,
      });
  };
  /**
   * The consolidated market short interest positions in all IEX-listed securities are included in the IEX Short Interest Report.
   *
   * https://iexcloud.io/docs/api/#listed-short-interest-list-in-dev
   *
   * @param {string} date effective datetime
   * @param {string} token Access token
   * @param {string} version API version
   * @param {string} filter https://iexcloud.io/docs/api/#filter-results
   * @param {string} format output format
   */
  const marketShortInterest = (date, { token, version, filter, format } = {}) => {
      if (date) {
          return common_1._get({
              url: `stock/market/short-interest/${common_1._strOrDate(date)}`,
              token,
              version,
              filter,
              format,
          });
      }
      return common_1._get({
          url: `stock/market/short-interest`,
          token,
          version,
          filter,
          format,
      });
  };
  exports.marketShortInterest = marketShortInterest;
  client_1.Client.prototype.marketShortInterest = function (date, { filter, format } = {}) {
      return exports.marketShortInterest(date, {
          token: this._token,
          version: this._version,
          filter,
          format,
      });
  };
  