'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-a1121663.js');
require('./data-model-f9df493f.js');
require('./User-ed078a17.js');
const product = require('./product-379cb86f.js');

const DevingenProductPage = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.fetchProduct = async () => {
      const { id } = this.match.params;
      const productResponse = await this.apiDevingen.getProduct(id).catch((e) => this.error = e);
      if (!productResponse)
        return;
      this.product = product.Product.decode(productResponse);
    };
  }
  componentWillLoad() {
    this.fetchProduct();
  }
  render() {
    const { apiData, apiDevingen, product, products, workspaceOwnerships } = this;
    if (!product) {
      return (index.h("div", { class: "d-flex justify-content-center pt-3" }, index.h("dvn-progress", { indefinite: true })));
    }
    const Tag = `devingen-product-root-${product.type}`;
    return (index.h(index.Host, null, index.h(Tag, { apiData: apiData, apiDevingen: apiDevingen, product: product, products: products, workspaceOwnerships: workspaceOwnerships })));
  }
};

exports.devingen_product_page = DevingenProductPage;
