'use strict';

var asyncToGenerator = require('./asyncToGenerator-58c289d9.js');
var slicedToArray = require('./slicedToArray-5d1bc3b3.js');
var _extends = require('./extends-29bdbc6d.js');
var React = require('react');
var reactTwitterEmbed = require('react-twitter-embed');
var index = require('./index-efca863c.js');
var smoothscroll = require('./smoothscroll-99df7f93.js');
var moment = require('./moment-aca40de1.js');
var QueueDeckExpanded = require('./QueueDeckExpanded.js');
var Breadcrumbs = require('./Breadcrumbs.js');
var Feature = require('./Feature.js');
var urlFor = require('./urlFor.js');
var getSerializers = require('./index-70cfabd2.js');
var BlockContent = require('./BlockContent-36e54d77.js');
require('./_commonjsHelpers-06173234.js');
require('./es6.string.iterator-c2573ffd.js');
require('./_to-object-6de10e57.js');
require('./web.dom.iterable-46657b5c.js');
require('./_library-dd23b178.js');
require('./core.get-iterator-method-f474eacc.js');
require('./_iter-detect-55a5657a.js');
require('./_object-pie-083f2dd6.js');
require('./toConsumableArray-ddb70795.js');
require('react-bootstrap');
require('./index.es-f3e47207.js');
require('./visibility-sensor-eb2c5b69.js');
require('react-dom');
require('./index-0e4427c8.js');
require('prop-types');
require('next/router');
require('./index-eadd5035.js');
require('./main-025fdc78.js');
require('./entities-3f9d0f2f.js');
require('./ADInfeed-e7aecdf9.js');
require('react-bootstrap/Card');
require('./AdSlot.js');
require('./debounce-d4a2369b.js');
require('./isSymbol-03abbdf0.js');
require('./toNumber-5e1fac58.js');
require('./Beam.js');
require('./stringify-c9ac1214.js');
require('./Segment.js');
require('./AuthorComponent-c21aac7f.js');
require('./lodash-f0783643.js');
require('./ADlgInfeed-0941023e.js');
require('./getContentCategory-f38a4c00.js');
require('./timeDifferenceCalc.js');
require('react-bootstrap/Breadcrumb');
require('react-bootstrap/Carousel');
require('./index-187c967e.js');
require('./util-6f784d85.js');
require('./typeof-88a668c5.js');
require('./_is-array-6128bd56.js');
require('./brightcove-react-player-loader.es-a195642e.js');
require('./GroupDeck.js');
require('./SocialShare.js');
require('next/head');
require('react-share');
require('./_object-to-array-8fe5a54f.js');
require('react-bootstrap/Pagination');
require('react-bootstrap/Button');
require('react-bootstrap/Row');
require('react-bootstrap/Col');
require('./inherits-c2065b95.js');
require('./_object-sap-a175b4a9.js');
require('./define-property-c88be878.js');
require('./index.esm-974f47d9.js');
require('./iconBase-68959171.js');
require('react-bootstrap/Figure');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var ImageSlider = function ImageSlider(props) {
  var innerSlider = React.useRef(null);
  var tile = React.useRef(null);
  var viewableWindow = React.useRef(null);

  var _useState = React.useState(0),
      _useState2 = slicedToArray._slicedToArray(_useState, 2),
      tileSize = _useState2[0],
      setTileSize = _useState2[1];

  var _useState3 = React.useState(false),
      _useState4 = slicedToArray._slicedToArray(_useState3, 2),
      showScroller = _useState4[0],
      setShowScroller = _useState4[1];

  var _useState5 = React.useState(0),
      _useState6 = slicedToArray._slicedToArray(_useState5, 2),
      scrollPosition = _useState6[0],
      setScrollPosition = _useState6[1];

  var builder = index.imageUrlBuilder(props.client);
  function urlFor(source) {
    return builder.image(source);
  }
  function scrollSlider(e, direction) {
    var slide = e.target.parentElement;
    var scrollOffset = scrollPosition;
    var viewableWidth = slide.clientWidth;
    //calculate viewable size / slide
    var numberOfSlidesToScroll = Math.floor(tile.current.clientWidth + 25); //width of the tile plus margin
    var scrollDirection = void 0;
    if (direction === 'next') {
      scrollDirection = scrollOffset + numberOfSlidesToScroll;
      if (scrollOffset + viewableWidth + 25 >= innerSlider.current.offsetWidth) {
        scrollDirection = 0;
      }
    }
    if (direction === 'prev') {
      scrollDirection = scrollOffset - numberOfSlidesToScroll;
      if (scrollOffset === 0) {
        if (window.innerWidth > 1399) {
          scrollDirection = innerSlider.current.offsetWidth - tileSize * 3 - 70;
        }
        if (window.innerWidth < 1399 && window.innerWidth > 592) {
          scrollDirection = innerSlider.current.offsetWidth - tileSize * 2 - 40;
        }
        if (window.innerWidth < 592) {
          scrollDirection = innerSlider.current.offsetWidth - tileSize * 1 - 24;
        }
      }
    }
    slide.scrollTo({
      left: scrollDirection,
      behavior: 'smooth'
    });
    setScrollPosition(scrollDirection);
  }
  var setThumbSize = function setThumbSize() {
    var thumbSize = void 0;
    var scrollerVisible = false;
    if (window.innerWidth > 1399) {
      thumbSize = Math.floor(viewableWindow.current.clientWidth / 3 - 40);
      if (props.data.slides.length > 3) {
        scrollerVisible = true;
      }
    }
    if (window.innerWidth < 1399 && window.innerWidth > 592) {
      thumbSize = Math.floor(viewableWindow.current.clientWidth / 2 - 48);
      if (props.data.slides.length > 2) {
        scrollerVisible = true;
      }
    }
    if (window.innerWidth < 592) {
      thumbSize = Math.floor(viewableWindow.current.clientWidth / 1 - 64);
      if (props.data.slides.length > 1) {
        scrollerVisible = true;
      }
    }
    if (thumbSize !== tileSize) {
      setTileSize(thumbSize);
      setScrollPosition(0);
      setShowScroller(scrollerVisible);
      var videoRows = document.querySelectorAll('#vid-slider .row');
      for (var i = 0; i < videoRows.length; i++) {
        videoRows[i].scrollTo({
          left: 0,
          behavior: 'smooth'
        });
      }
    }
  };
  React.useEffect(function () {
    //IE11 Polyfill
    smoothscroll.smoothscroll.polyfill();
    setThumbSize();

    window.addEventListener('resize', setThumbSize);

    return function () {
      return window.removeEventListener('resize', setThumbSize);
    };
  }, []);

  var variant = 'black';
  return React__default['default'].createElement(
    React__default['default'].Fragment,
    null,
    React__default['default'].createElement(
      'div',
      { ref: viewableWindow, id: 'vid-slider', className: 'col' },
      React__default['default'].createElement(
        'div',
        { className: 'row' },
        showScroller && React__default['default'].createElement(
          'div',
          { onClick: function onClick(e) {
              return scrollSlider(e, 'prev');
            }, className: 'tile__slider-prev', style: { color: variant } },
          React__default['default'].createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow left' })
        ),
        showScroller && React__default['default'].createElement(
          'div',
          { onClick: function onClick(e) {
              return scrollSlider(e, 'next');
            }, className: 'tile__slider-next', style: { color: variant } },
          React__default['default'].createElement('i', { style: { border: 'solid ' + variant, borderWidth: '0 4px 4px 0' }, className: 'arrow right' })
        ),
        React__default['default'].createElement(
          'div',
          { ref: innerSlider, className: 'row__inner' },
          props.data.slides.map(function (img, index) {
            var thumbnail = urlFor(img.slideshowImage).width(250);
            if (!img.slideshowImage.link) {
              return React__default['default'].createElement(
                'div',
                { ref: tile, key: index, className: 'tile', style: { width: tileSize + 'px' } },
                React__default['default'].createElement(
                  'div',
                  { className: 'tile__media' },
                  React__default['default'].createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
                ),
                React__default['default'].createElement('div', { style: { color: variant }, className: 'tile__info' })
              );
            } else {
              return React__default['default'].createElement(
                'a',
                { ref: tile, key: index, href: img.slideshowImage.link, target: img.slideshowImage.blank ? '_target' : '_self', className: 'tile', style: { width: tileSize + 'px' } },
                React__default['default'].createElement(
                  'div',
                  { className: 'tile__media' },
                  React__default['default'].createElement('img', { className: 'tile__img', src: thumbnail, alt: img.slideshowImage.alt ? img.slideshowImage.alt : '', style: { width: tileSize + 'px' } })
                ),
                React__default['default'].createElement('div', { style: { color: variant }, className: 'tile__info' })
              );
            }
          })
        )
      ),
      React__default['default'].createElement(
        'style',
        { jsx: 'true' },
        '\n          #vid-slider * {\n            box-sizing: border-box;\n            -ms-overflow-style: none;\n          }\n          #vid-slider::-webkit-scrollbar-thumb {\n            display: none;\n          }\n          #vid-slider::-webkit-scrollbar {\n            display: none;\n          }\n          #vid-slider .row::-webkit-scrollbar {\n            display: none;\n          }\n          #vid-slider .row::-webkit-scrollbar-thumb {\n            display: none;\n          }\n          #vid-slider {\n            position: relative;\n            -ms-overflow-style: none;\n            padding: 0 1.5rem;\n            margin-bottom: 0 !important;\n          }\n          #vid-slider .now-playing {\n            position: absolute;\n            top: 0.5rem;\n            left: 1rem;\n            color: white;\n            background: rgba(0, 0, 0, 0.75);\n          }\n          #vid-slider h1,\n          #vid-slider p {\n            text-align: center;\n            width: 100%;\n            max-width: 500px;\n            margin: auto;\n          }\n          #vid-slider,\n          #vidHolder {\n            max-width: 805px;\n          }\n          #vid-slider a:link,\n          #vid-slider a:hover,\n          #vid-slider a:active,\n          #vid-slider a:visited {\n            transition: color 150ms;\n            color: #95a5a6;\n            text-decoration: none;\n          }\n          #vid-slider a:hover {\n            color: #7f8c8d;\n            text-decoration: underline;\n          }\n          #vid-slider .contain {\n            width: 100%;\n          }\n          #vid-slider .row {\n            overflow-x: scroll;\n            width: 100%;\n            -ms-overflow-style: none;\n            overflow-y: hidden !important;\n          }\n          #vid-slider .tile__info {\n            white-space: normal !important;\n            position: absolute;\n            text-align: center;\n            color: ' + (props.dark ? 'white' : '#383838') + ';\n            opacity: 1;\n            font-size: 0.9rem;\n            font-weight: bold;\n            transition: opacity 0.25s;\n          }\n          #vid-slider .row__inner {\n            transition: 450ms -webkit-transform;\n            transition: 450ms transform;\n            transition: 450ms transform, 450ms -webkit-transform;\n            font-size: 0;\n            white-space: nowrap;\n            margin: 25px 0 70px !important;\n            padding-bottom: 10px;\n            padding-left: 0;\n          }\n          #vid-slider .tile {\n            position: relative;\n            display: inline-block;\n            margin: 0 12px;\n            font-size: 20px;\n            transition: 450ms all;\n            -webkit-transform-origin: center left;\n            transform-origin: center left;\n          }\n  \n          #vid-slider .tile:first-child {\n            margin-left: 15px;\n          }\n          #vid-slider .tile__img {\n            height: auto;\n            -o-object-fit: contain;\n            object-fit: contain;\n            object-position: center;\n          }\n          #vid-slider .tile__details {\n            position: absolute;\n            bottom: 0;\n            left: 0;\n            right: 0;\n            top: 0;\n            font-size: 10px;\n            opacity: 0;\n            background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);\n            transition: 450ms opacity;\n          }\n          #vid-slider .tile__details:after,\n          #vid-slider .tile__details:before {\n            content: \'\';\n  \n            position: absolute;\n            top: 50%;\n            left: 50%;\n            display: #000;\n          }\n          #vid-slider .tile__details:after {\n            margin-top: -25px;\n            margin-left: -25px;\n            width: 50px;\n            height: 50px;\n            border: 3px solid #ecf0f1;\n            line-height: 50px;\n            text-align: center;\n            border-radius: 100%;\n            background: rgba(0, 0, 0, 0.5);\n            z-index: 1;\n          }\n          #vid-slider .tile__details:before {\n            content: \'\';\n            background: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 64 64\' width=\'64\' height=\'64\' fill=\'white\'><path d=\'M26 46 L46 32 L26 18 Z\'/></svg>")\n              no-repeat center center;\n            left: 0;\n            width: 100%;\n            height: 3rem;\n            font-size: 30px;\n            margin-right: 12px;\n            margin-top: -24px;\n            text-align: center;\n            z-index: 2;\n            color: white;\n          }\n  \n          #vid-slider .tile__title {\n            position: absolute;\n            bottom: 0;\n            padding: 10px;\n            max-width: 250px;\n          }\n          #vid-slider .tile__title_text {\n            position: relative;\n            left: 0;\n            white-space: normal;\n          }\n  \n          #vid-slider .tile__slider-prev,\n          #vid-slider .tile__slider-next {\n            width: 30px;\n            background: transparent;\n            border: none;\n            position: absolute;\n            top: 50%;\n            transform: translateY(-50%);\n            z-index: 99;\n            cursor: pointer;\n            color: ' + (props.dark ? 'white' : 'black') + ';\n            display: flex;\n            justify-content: center;\n            align-items: center;\n            font-size: 2rem;\n          }\n          #vid-slider .tile__slider-prev {\n            left: -0.5rem;\n            padding: 1rem;\n          }\n          #vid-slider .tile__slider-next {\n            right: -0.5rem;\n            padding: 1rem;\n          }\n          #vid-slider,\n          #vid-slider .row {\n            margin: 0;\n          }\n  \n          #vid-slider .row::-webkit-scrollbar-thumb {\n            background-color: transparent !important;\n          }\n          #vid-slider i {\n            border: solid ' + (props.dark ? 'white' : 'black') + ';\n            border-width: 0 4px 4px 0;\n            display: inline-block;\n            padding: 4px;\n            pointer-events: none;\n          }\n          #vid-slider .right {\n            transform: rotate(-45deg);\n            -webkit-transform: rotate(-45deg);\n          }\n          #vid-slider .left {\n            transform: rotate(135deg);\n            -webkit-transform: rotate(135deg);\n          }\n          @media screen and (min-width: 1399px) {\n            .block-content #vid-slider .tile__img {\n              height: auto;\n            }\n            .block-content #vid-slider .tile {\n              height: auto;\n            }\n          }\n  \n          @media screen and (max-width: 1399px) {\n            #vid-slider,\n            #vidHolder {\n              max-width: 620px;\n            }\n          }\n          @media screen and (max-width: 1200px) {\n            #vid-slider,\n            #vidHolder {\n              max-width: 580px;\n            }\n          }\n          @media screen and (max-width: 967px) {\n            #vid-slider {\n              max-width: 100%;\n            }\n  \n            #vid-slider .row__inner {\n              margin: 60px 0 50px !important;\n            }\n          }\n  \n          @media screen and (max-width: 768px) {\n            #vidHolder {\n              position: unset;\n              width: 100%;\n            }\n          }\n          @media screen and (max-width: 568px) {\n            #vidHolder {\n              position: unset;\n              width: 100%;\n            }\n  \n            #vid-slider .row__inner {\n              margin: 30px 0 70px;\n            }\n          }\n        '
      )
    )
  );
};

var _this = undefined;

var PartnerDetails = function PartnerDetails(_ref) {
  var posts = _ref.posts,
      query = _ref.query,
      params = _ref.params,
      features = _ref.features,
      currentPage = _ref.currentPage,
      partnerDetails = _ref.partnerDetails,
      client = _ref.client,
      Settings = _ref.Settings,
      pageview = _ref.pageview,
      page = _ref.page;

  return React__default['default'].createElement(
    React__default['default'].Fragment,
    null,
    React__default['default'].createElement(Breadcrumbs, null),
    React__default['default'].createElement(
      'div',
      { className: 'partners-page' },
      React__default['default'].createElement(
        'div',
        { className: 'my-5 partner-logo-wrap', style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' } },
        partnerDetails.thumbnail && partnerDetails.thumbnail.link ? React__default['default'].createElement(
          'a',
          { className: 'partners-logo', style: { width: '25%', minWidth: '25%' }, href: partnerDetails.thumbnail.link, target: partnerDetails.thumbnail.blank ? '_blank' : '' },
          React__default['default'].createElement(
            'figure',
            { style: { width: '100%', textAlign: 'center' } },
            React__default['default'].createElement('img', {
              alt: partnerDetails.thumbnail && partnerDetails.thumbnail.alt ? partnerDetails.thumbnail.alt : partnerDetails.name,
              style: { maxWidth: '100%' },
              src: partnerDetails.thumbnail ? urlFor(client, partnerDetails.thumbnail.asset) : '' }),
            partnerDetails.thumbnail && partnerDetails.thumbnail.caption && React__default['default'].createElement(
              'figcaption',
              null,
              partnerDetails.thumbnail.caption
            )
          )
        ) : React__default['default'].createElement(
          'figure',
          { className: 'partners-logo', style: { width: '25%', minWidth: '25%', textAlign: 'center' } },
          React__default['default'].createElement('img', {
            alt: partnerDetails.thumbnail && partnerDetails.thumbnail.alt ? partnerDetails.thumbnail.alt : partnerDetails.name,
            style: { maxWidth: '100%' },
            src: partnerDetails.thumbnail ? urlFor(client, partnerDetails.thumbnail.asset) : '' }),
          partnerDetails.thumbnail && partnerDetails.thumbnail.caption && React__default['default'].createElement(
            'figcaption',
            null,
            partnerDetails.thumbnail.caption
          )
        ),
        React__default['default'].createElement(
          'style',
          { jsx: 'true' },
          '\n            @media screen and (max-width: 768px) {\n              .partners-logo {\n                width: 100%;\n                min-width: 100%;\n              }\n              .partner-logo-wrap {\n                flex-wrap: wrap;\n              }\n              .block-content-partners {\n                padding-left: 0 !important;\n              }\n            }\n          '
        ),
        partnerDetails.description && React__default['default'].createElement(
          'div',
          { className: 'block-content-partners my-4', style: { maxWidth: '100%', paddingLeft: '2rem', flex: '1 1 auto' } },
          React__default['default'].createElement(BlockContent.BlockContent, _extends._extends({ serializers: getSerializers.getSerializers(client), blocks: partnerDetails.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
        )
      ),
      partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides && React__default['default'].createElement(
        'div',
        { className: 'mb-4', style: { padding: '0 15px' } },
        partnerDetails.affiliates[0].title && React__default['default'].createElement(
          'h2',
          { className: 'bb-gold' },
          partnerDetails.affiliates[0].title
        ),
        React__default['default'].createElement(ImageSlider, { client: client, data: partnerDetails.affiliates[0] })
      ),
      features.length > 0 && React__default['default'].createElement(
        'div',
        { className: ' mb-5' },
        React__default['default'].createElement(Feature, { dataset: features, client: client })
      ),
      partnerDetails.twitter && React__default['default'].createElement(
        React__default['default'].Fragment,
        null,
        React__default['default'].createElement(
          'div',
          { className: 'mb-5', style: { width: '100%', textAlign: 'center', padding: '0 15px', border: '2px solid #aaa', borderRadius: '15px' } },
          React__default['default'].createElement(reactTwitterEmbed.TwitterTimelineEmbed, { sourceType: 'url', url: partnerDetails.twitter, options: { height: 400 } })
        )
      ),
      React__default['default'].createElement(
        'div',
        null,
        posts && posts.length > 0 && React__default['default'].createElement(
          React__default['default'].Fragment,
          null,
          React__default['default'].createElement(
            'h2',
            { className: 'bb-gold mb-2' },
            'Latest from ',
            partnerDetails.name
          ),
          React__default['default'].createElement('hr', null)
        ),
        React__default['default'].createElement(QueueDeckExpanded, {
          client: client,
          mapping: Settings.mapping,
          dataRecord: posts,
          query: query,
          params: params,
          currentPage: currentPage,
          seoPaginate: true,
          columns: 'rotate',
          variant: 'top',
          page: page,
          autoScroll: true,
          defaultImage: Settings.logo,
          showPublished: true,
          showCategory: true,
          pageview: pageview
        })
      )
    )
  );
};

PartnerDetails.returnGetInitialProps = function () {
  var _ref2 = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
    var category = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;

    var today, featureQuery, partnerQuery, taxonomyQuery, _ref3, _ref4, features, partnerDetails, taxonomyDetails, articlesQuery, articles;

    return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            today = moment.moment().utc().format();
            featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n      ...,\n       \'feature_img\' : feature_img.asset->url\n      }';
            partnerQuery = '*[_type == \'documentGroup\' \n      && !(_id in path("drafts.**"))\n      && references(\'' + partnerDocumentGroupID + '\')\n      && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n        description,\n          name,\n          identifier,\n          thumbnail,\n          twitter,\n          "affiliates": description[_type==\'slideshows\']{\n            ...,\n            slides->{...}\n          }\n      }';


            if (category) {
              //if partners page has a sub category such as onclive
              //e.g. /sap-partner/[category]/[partner]

              partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n    ...,\n    \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n          description,\n          name,\n          identifier,\n          thumbnail,\n          twitter,\n          "affiliates": description[_type==\'slideshows\']{\n            ...,\n            slides->{...}\n          }\n    \n    }\n  }';
            }

            taxonomyQuery = '*[_type == \'documentGroup\' \n      && !(_id in path("drafts.**"))\n      && references(\'' + partnerDocumentGroupID + '\')\n      && identifier.current == \'' + identifier + '\'] [0] {\n          \'id\': _id,\n          \'title\': name\n      }';

            if (category) {
              taxonomyQuery = '*[_type == \'documentGroup\' \n     && !(_id in path("drafts.**"))\n     && identifier.current == \'' + identifier + '\' && references(*[_type == \'documentGroup\' && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')]._id)] [0] {\n         \'id\': _id,\n         \'title\': name\n     }';
            }
            _context.next = 8;
            return asyncToGenerator._Promise.all([client.fetch(featureQuery), client.fetch(partnerQuery), client.fetch(taxonomyQuery)]);

          case 8:
            _ref3 = _context.sent;
            _ref4 = slicedToArray._slicedToArray(_ref3, 3);
            features = _ref4[0];
            partnerDetails = _ref4[1];
            taxonomyDetails = _ref4[2];
            articlesQuery = '*[_type == \'article\' && !(_id in path("drafts.**")) && defined(title) && is_visible == true && defined(url) && dateTime(published) <= dateTime(\'' + today + '\') && passwordLocked != true && references(\'' + taxonomyDetails.id + '\')] | order(published desc)[$from...$to]{\n          title,\n          summary,\n          thumbnail,\n      url,\n      published,\n      contentCategory->,\n      \'pageNumber\': ' + currentPage + '\n    }';
            _context.next = 16;
            return client.fetch(articlesQuery, params);

          case 16:
            articles = _context.sent;


            //need to exclude slideshows from body due to the affiliate slider
            if (partnerDetails && partnerDetails.description) {
              partnerDetails.description = partnerDetails.description.filter(function (block) {
                return block._type !== 'slideshows';
              });
            }

            return _context.abrupt('return', { articles: articles, taxonomyDetails: taxonomyDetails, partnerDetails: category ? partnerDetails.partner : partnerDetails, features: features, featureQuery: featureQuery, partnerQuery: partnerQuery, taxonomyQuery: taxonomyQuery, articlesQuery: articlesQuery });

          case 19:
          case 'end':
            return _context.stop();
        }
      }
    }, _callee, _this);
  }));

  return function (_x, _x2, _x3, _x4, _x5, _x6) {
    return _ref2.apply(this, arguments);
  };
}();

module.exports = PartnerDetails;
