"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.referredByBundle = void 0;

var _reduxBundler = require("redux-bundler");

var _object = require("../utils/object");

var _referralCookie = require("../utils/referral-cookie");

const referredByBundle = {
  name: 'referredBy',
  selectReferredBy: _referralCookie.getReferredBy,
  reactStoreReferredBy: (0, _reduxBundler.createSelector)('selectQueryObject', queryObj => {
    if (queryObj && queryObj[_referralCookie.REFERRAL_ID_NAME]) {
      (0, _referralCookie.writeReferredBy)(queryObj[_referralCookie.REFERRAL_ID_NAME]);
      return {
        actionCreator: 'doUpdateQuery',
        args: [(0, _object.omit)(queryObj, [_referralCookie.REFERRAL_ID_NAME]), {
          maintainScrollPosition: true,
          replace: true
        }]
      };
    }
  })
};
exports.referredByBundle = referredByBundle;