Liferay.Loader.define("commerce-dashboard-web$d3-transition@1.2.0/src/transition/attrTween", ['module', 'exports', 'require'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    import { namespace } from "d3-selection";

    function attrInterpolate(name, i) {
      return function (t) {
        this.setAttribute(name, i(t));
      };
    }

    function attrInterpolateNS(fullname, i) {
      return function (t) {
        this.setAttributeNS(fullname.space, fullname.local, i(t));
      };
    }

    function attrTweenNS(fullname, value) {
      var t0, i0;
      function tween() {
        var i = value.apply(this, arguments);
        if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
        return t0;
      }
      tween._value = value;
      return tween;
    }

    function attrTween(name, value) {
      var t0, i0;
      function tween() {
        var i = value.apply(this, arguments);
        if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
        return t0;
      }
      tween._value = value;
      return tween;
    }

    export default function (name, value) {
      var key = "attr." + name;
      if (arguments.length < 2) return (key = this.tween(key)) && key._value;
      if (value == null) return this.tween(key, null);
      if (typeof value !== "function") throw new Error();
      var fullname = namespace(name);
      return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
    }
  }
});
//# sourceMappingURL=attrTween.js.map