import a from "./map-generator.js";
import p from "./stringify.js";
import c from "./warn-once.js";
import f from "./parse.js";
import g from "./result.js";
let m = a, _ = p, d = c, w = f;
const S = g;
class s {
  constructor(t, r, e) {
    r = r.toString(), this.stringified = !1, this._processor = t, this._css = r, this._opts = e, this._map = void 0;
    let o, u = _;
    this.result = new S(this._processor, o, this._opts), this.result.css = r;
    let l = this;
    Object.defineProperty(this.result, "root", {
      get() {
        return l.root;
      }
    });
    let i = new m(u, o, this._opts, r);
    if (i.isMap()) {
      let [n, h] = i.generate();
      n && (this.result.css = n), h && (this.result.map = h);
    }
  }
  get [Symbol.toStringTag]() {
    return "NoWorkResult";
  }
  get processor() {
    return this.result.processor;
  }
  get opts() {
    return this.result.opts;
  }
  get css() {
    return this.result.css;
  }
  get content() {
    return this.result.css;
  }
  get map() {
    return this.result.map;
  }
  get root() {
    if (this._root)
      return this._root;
    let t, r = w;
    try {
      t = r(this._css, this._opts);
    } catch (e) {
      this.error = e;
    }
    if (this.error)
      throw this.error;
    return this._root = t, t;
  }
  get messages() {
    return [];
  }
  warnings() {
    return [];
  }
  toString() {
    return this._css;
  }
  then(t, r) {
    return process.env.NODE_ENV !== "production" && ("from" in this._opts || d(
      "Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."
    )), this.async().then(t, r);
  }
  catch(t) {
    return this.async().catch(t);
  }
  finally(t) {
    return this.async().then(t, t);
  }
  async() {
    return this.error ? Promise.reject(this.error) : Promise.resolve(this.result);
  }
  sync() {
    if (this.error)
      throw this.error;
    return this.result;
  }
}
var W = s;
s.default = s;
export {
  W as default
};
//# sourceMappingURL=no-work-result.js.map
