"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const schedule = require("./src-transition-schedule.cjs");
function start(name) {
  return (name + "").trim().split(/^|\s+/).every(function(t) {
    var i = t.indexOf(".");
    if (i >= 0) t = t.slice(0, i);
    return !t || t === "start";
  });
}
function onFunction(id, name, listener) {
  var on0, on1, sit = start(name) ? schedule.init : schedule.set;
  return function() {
    var schedule2 = sit(this, id), on = schedule2.on;
    if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
    schedule2.on = on1;
  };
}
function transition_on(name, listener) {
  var id = this._id;
  return arguments.length < 2 ? schedule.get(this.node(), id).on.on(name) : this.each(onFunction(id, name, listener));
}
exports.default = transition_on;
//# sourceMappingURL=src-transition-on.cjs.map
