"use strict";

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; }

/*
Copyright 2021 Q-CTRL. All rights reserved.

Licensed under the Q-CTRL Terms of service (the "License"). Unauthorized
copying or use of this file, via any medium, is strictly prohibited.
Proprietary and confidential. You may not use this file except in compliance
with the License. You may obtain a copy of the License at

     https://q-ctrl.com/terms

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS. See the
License for the specific language.
*/
var _ = require("lodash");

var plugin = require("tailwindcss/plugin"); // Spacing


module.exports = function (_ref) {
  var addUtilities = _ref.addUtilities,
      theme = _ref.theme,
      variants = _ref.variants,
      e = _ref.e;

  var spacersUtilities = _.map(theme("spacer"), function (value, key) {
    var _ref2;

    return _ref2 = {}, _defineProperty(_ref2, ".".concat(e("sp-".concat(key))), {
      padding: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("spy-".concat(key))), {
      paddingTop: "".concat(value),
      paddingBottom: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("spx-".concat(key))), {
      paddingLeft: "".concat(value),
      paddingRight: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("spt-".concat(key))), {
      paddingTop: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("spb-".concat(key))), {
      paddingBottom: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("spl-".concat(key))), {
      paddingLeft: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("spr-".concat(key))), {
      paddingRight: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("sm-".concat(key))), {
      margin: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("smy-".concat(key))), {
      marginTop: "".concat(value),
      marginBottom: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("smx-".concat(key))), {
      marginLeft: "".concat(value),
      marginRight: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("smt-".concat(key))), {
      marginTop: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("smb-".concat(key))), {
      marginBottom: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("sml-".concat(key))), {
      marginLeft: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("smr-".concat(key))), {
      marginRight: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("sw-".concat(key))), {
      width: "".concat(value)
    }), _defineProperty(_ref2, ".".concat(e("sh-".concat(key))), {
      height: "".concat(value)
    }), _ref2;
  });

  var frameUtilities = _.map(theme("frame"), function (value, key) {
    return _defineProperty({}, ".".concat(e("frame-".concat(key))), {
      padding: "".concat(value)
    });
  });

  var frameBorderUtilities = _.map(theme("borderFrame"), function (value, key) {
    return _defineProperty({}, ".".concat(e("b-frame-".concat(key))), {
      padding: "".concat(value)
    });
  });

  var frameSquashUtilities = _.map(theme("squash"), function (value, key) {
    return _defineProperty({}, ".".concat(e("squash-".concat(key))), {
      padding: "".concat(value)
    });
  });

  var frameBorderSquashUtilities = _.map(theme("borderSquash"), function (value, key) {
    return _defineProperty({}, ".".concat(e("b-squash-".concat(key))), {
      padding: "".concat(value)
    });
  });

  var frameStretchUtilities = _.map(theme("stretch"), function (value, key) {
    return _defineProperty({}, ".".concat(e("stretch-".concat(key))), {
      padding: "".concat(value)
    });
  });

  var frameBorderStretchUtilities = _.map(theme("borderStretch"), function (value, key) {
    return _defineProperty({}, ".".concat(e("b-stretch-".concat(key))), {
      padding: "".concat(value)
    });
  });

  var stacksUtilities = _.map(theme("stack"), function (value, key) {
    var _ref9;

    return _ref9 = {}, _defineProperty(_ref9, ".".concat(e("stack-".concat(key))), {
      margin: "0 0 ".concat(value)
    }), _defineProperty(_ref9, ".".concat(e("stack-t-".concat(key))), {
      margin: "".concat(value, " 0 0")
    }), _ref9;
  });

  var inlinesUtilities = _.map(theme("inline"), function (value, key) {
    var _ref10;

    return _ref10 = {}, _defineProperty(_ref10, ".".concat(e("inline-".concat(key))), {
      margin: "0 ".concat(value, " 0 0")
    }), _defineProperty(_ref10, ".".concat(e("inline-l-".concat(key))), {
      margin: "0 0 0 ".concat(value)
    }), _defineProperty(_ref10, ".".concat(e("inline-r-".concat(key))), {
      margin: "0 ".concat(value, " 0 0")
    }), _ref10;
  });

  addUtilities([spacersUtilities, frameUtilities, frameBorderUtilities, frameSquashUtilities, frameBorderSquashUtilities, frameStretchUtilities, frameBorderStretchUtilities, stacksUtilities, inlinesUtilities], variants('spacers'));
};