define('ember-toolbars/transitions/swap-out', ['exports', 'liquid-fire', 'ember-toolbars/transition-helpers'], function (exports, _liquidFire, _transitionHelpers) {
  'use strict';

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

  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }

    return obj;
  }

  function swapOut(dimension, direction, opts) {
    var _this = this;

    var _propertiesFor = (0, _transitionHelpers.propertiesFor)(dimension),
        property = _propertiesFor.property,
        measure = _propertiesFor.measure;

    return (0, _transitionHelpers.waitForPrevious)(this, 'moving-in').then(function () {
      var bigger = (0, _transitionHelpers.biggestSize)(_this, measure);
      var animateMargin = (0, _transitionHelpers.marginAdjustment)(_this, measure, opts);
      var halfDuration = { duration: opts.duration / 2 };
      return _liquidFire.Promise.all([animateMargin(), (0, _liquidFire.animate)(_this.oldElement, _defineProperty({}, property, -1 * bigger * direction + 'px'), halfDuration).then(function () {
        return (0, _liquidFire.animate)(_this.newElement, _defineProperty({}, property, ["0px", -1 * bigger * direction + 'px']), halfDuration, 'moving-in');
      })]);
    });
  }
});