<script>
  function _ls(src, notCustom) {
    var script = document.createElement("script");
    if (notCustom) {
      script.crossOrigin = "use-credentials";
    }
    script.src = src;
    return document.head.appendChild(script);
  }
  if (!("attachShadow" in Element.prototype)) {
    _ls("/static/polyfills/webcomponents-bundle.js", true);
    _ls("/static/polyfills/lit-polyfill-support.js", true);
  }
  // Modern browsers are detected primarily using the user agent string.
  // A feature detection which roughly lines up with the modern targets is used
  // as a fallback to guard against spoofs. It should be updated periodically.
  var isModern = <%= modernRegex %>.test(navigator.userAgent) &&
    "findLast" in Array.prototype;
</script>
