<script type="application/javascript">
  window.idoitRootPath = '[{isys_application::instance()->www_path}]';
</script>
<!-- FLOW-262 Remove '<base ...>' -->
<style>
    #contentWrapper {
        top: 0px;
    }
</style>
<iframe id="flows-window" style="width: 100%;height: calc(100% - 4px);border: none;"
        src="[{isys_application::instance()->www_path}]flows/iframe/[{$slug}]"></iframe>
<script type="application/javascript">
  (() => {
    window.addEventListener('message', message => {
      if (message.origin !== window.origin) {
        return;
      }
      const data = message.data;
      if (typeof data !== 'object' || !data.hasOwnProperty('type') || data.type !== 'url:changed') {
        return;
      }
      const url = data.url;
      if (url) {
        history.pushState(undefined, undefined, `[{isys_application::instance()->www_path}]flows${url}`);
      }
    });
  })();
</script>
