"use strict";

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

var _constants = require("@instructure/quiz-common/lib/constants");

var _crossDomainMessaging = require("../util/crossDomainMessaging");

var crossDomainMessagingMiddleware = function crossDomainMessagingMiddleware(store) {
  return function (next) {
    return function (action) {
      if (action.type === _constants.POST_TO_PARENT) {
        (0, _crossDomainMessaging.postToParent)(action.payload);
      }

      return next(action);
    };
  };
};

var _default = crossDomainMessagingMiddleware;
exports.default = _default;