<html>
<head>
<title>InterPlanetary Wayback (ipwb)</title>
<link rel="stylesheet" href="/ipwbassets/webui.css" />
<script src="/ipwbassets/webui.js"></script>
<link rel="apple-touch-icon" sizes="180x180" href="/ipwbassets/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/ipwbassets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/ipwbassets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/ipwbassets/favicons/manifest.json">
<link rel="mask-icon" href="/ipwbassets/favicons/safari-pinned-tab.svg" color="#5bbad5">
<meta name="apple-mobile-web-app-title" content="ipwb">
<meta name="application-name" content="ipwb">
<meta name="theme-color" content="#ffffff">

<script>
let uris = {{ uris|safe }}
</script>
</head>
<body>

<div id="wrapper">
  <div>
    <h1><img src="/ipwbassets/logo.png" alt="ipwb" /></h1>
    <form onsubmit="handleSubmit(); return false;" method="get" action="/memento/*/">
      <input type="text" placeholder="http://example.com" id="url" name="url" aria-label="Enter a URI" required />
      <input type="submit" value="Search URL in the archive"/>
    </form>
  </div>
  <footer>
  <p id="memCount"><a id="memCountListLink"><span id="memCountInt">{{ summary.urimCount}}</span></a> Memento<span id="plural">s</span> available</p>
  <details>
    <summary>Options and Details...</summary>
      <p><label>Archive Index(es): </label>{{ summary.indexPath }}</p>
      <p><label class="twoRowLabel">Service Worker: </label><div><span id="serviceWorkerVersion">checking...</span><br /><button id="reinstallServiceWorker">Reinstall Service Worker</button></div></p>
      <p><form method="post" action="/upload" enctype="multipart/form-data">
        <label class="twoRowLabel">Upload WARC</label>
        <div>
          <input type="file" name="file"><br />
          <input type="submit" value="Upload" style="display: inline">
        </div>
        </form>
      </p>
      <p class="centered topSpace"><a id="webui" target="_blank">IPFS WebUI</a></p>
      <p class="centered"><a href="https://github.com/oduwsdl/ipwb/" target="_blank">IPWB Help</a></p>

  </details>

  </footer>
    <div id="uris" class="hidden">
    <h3 id="urisHeader"><abbr title="Uniform Resource Identifiers">URIs</abbr> locally available</h3>
    <h4 id="htmlCountHeader">{{ pluralize(summary.urimCount, 'memento', 'mementos') }} of {{ pluralize(summary.urirCount, 'resource', 'resources') }} with <span id="htmlPages">{{ summary.htmlCount }}</span>
        HTML page<span id="htmlPagesPlurality">s</span> listed
        <button id="showEmbeddedURI" data-defaultValue="Show All" data-activatedValue="Show Only HTML Pages">Show All</button></h4>
    <ul id="uriList"></ul>
  </div>

</div>

<script>
addEventListeners()
setPlurality()
registerServiceWorker()
</script>
</body>
</html>
