const verticalEmbedDataNormalizer = (componentData) => {
  const { selectedProduct, type } = componentData;
  const { html, description } = selectedProduct;
  if (html) {
    const additionalData = {};
    !selectedProduct.pageUrl && (additionalData.pageUrl = selectedProduct.html.match(/href="[^"]*/g)?.[0]?.slice(6));
    if (type === "event") {
      !selectedProduct.scheduling && (additionalData.scheduling = selectedProduct.description.match(/[^|]+/)?.[0]);
      !selectedProduct.location && (additionalData.location = selectedProduct.description.match(/[^|]*$/)?.[0]);
    } else if (type === "booking") {
      !selectedProduct.durations && (additionalData.durations = description);
    }
    return {
      ...componentData,
      selectedProduct: { ...additionalData, ...selectedProduct }
    };
  } else {
    return componentData;
  }
};
export {
  verticalEmbedDataNormalizer
};
//# sourceMappingURL=vertical-embed-data-normalizer.js.map
