'use strict';

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

const index = require('./index-85d13173.js');

const KlevuUtilSsrProvider = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.html = undefined;
    this.packed = undefined;
    this.identifier = undefined;
  }
  /**
   * packed parameter returned by KlevuSSRFetch function
   *
   * @param packed
   */
  async setPacked(packed) {
    this.packed = JSON.stringify(packed).replace(/"/g, "'");
  }
  /**
   *
   * @returns packed parameter returned by KlevuSSRFetch function for KlevuSSRHydrate function
   */
  async getPacked() {
    return JSON.parse(this.packed || "{}").replace(/'/g, '"');
  }
  render() {
    if (this.html) {
      return (index.h(index.Host, null, index.h("div", { innerHTML: this.html })));
    }
    return (index.h(index.Host, null, index.h("slot", null)));
  }
};

exports.klevu_util_ssr_provider = KlevuUtilSsrProvider;

//# sourceMappingURL=klevu-util-ssr-provider.cjs.entry.js.map