import t from "./index-defineProperty.js";
import r, { Component as n } from "react";
import i from "./index-Initialize.js";
class h extends n {
  constructor(...a) {
    super(...a), t(this, "state", {}), t(this, "handleReady", (e) => {
      this.setState({
        api: e
      }, this.handleParse);
    }), t(this, "handleContainer", (e) => {
      this.setState({
        container: e
      }, this.handleParse);
    }), t(this, "handleParse", () => {
      const {
        api: e,
        container: s
      } = this.state;
      !e || !s || e.parse(s);
    });
  }
  render() {
    const {
      className: a,
      children: e
    } = this.props;
    return r.createElement("div", {
      className: a,
      ref: this.handleContainer
    }, r.createElement(i, {
      onReady: this.handleReady
    }, e({
      handleParse: this.handleParse
    })));
  }
}
t(h, "defaultProps", {
  className: void 0
});
export {
  h as default
};
