import { __extends as h } from "./index-tslib.es6.js";
import { Subscriber as a } from "./index-Subscriber.js";
function v(t, o, r, e, n) {
  return new f(t, o, r, e, n);
}
var f = (function(t) {
  h(o, t);
  function o(r, e, n, u, b, l) {
    var i = t.call(this, r) || this;
    return i.onFinalize = b, i.shouldUnsubscribe = l, i._next = e ? function(c) {
      try {
        e(c);
      } catch (s) {
        r.error(s);
      }
    } : t.prototype._next, i._error = u ? function(c) {
      try {
        u(c);
      } catch (s) {
        r.error(s);
      } finally {
        this.unsubscribe();
      }
    } : t.prototype._error, i._complete = n ? function() {
      try {
        n();
      } catch (c) {
        r.error(c);
      } finally {
        this.unsubscribe();
      }
    } : t.prototype._complete, i;
  }
  return o.prototype.unsubscribe = function() {
    var r;
    if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {
      var e = this.closed;
      t.prototype.unsubscribe.call(this), !e && ((r = this.onFinalize) === null || r === void 0 || r.call(this));
    }
  }, o;
})(a);
export {
  f as OperatorSubscriber,
  v as createOperatorSubscriber
};
