;(() => {
  if (!location.search.includes(`redirect=true`)) {
    return
  }

  const v3Url = document.body.dataset.v3Url
  if (!v3Url) {
    return
  }

  const hashRedirect =
    typeof __pageRedirects !== 'undefined' && __pageRedirects[location.hash]
  const finalUrl = hashRedirect || v3Url

  const preferV3 = localStorage.getItem('prefer-v3')
  if (preferV3 === 'true') {
    location.href = `https://vuejs.org${finalUrl}`
  } else if (preferV3 === 'false') {
    return
  }

  const today = new Date()
  const target = new Date('2022-05-07')
  const timeinmilisec = target.getTime() - today.getTime()
  const days = Math.ceil(timeinmilisec / (1000 * 60 * 60 * 24))

  const el = document.createElement('div')
  el.className = `v3-notice`
  el.innerHTML = `
<h3>Heads Up!</h3>
<p>
This page contains documentation for Vue 2. The Vue 3 version of the URL you are visiting is: <a id="v3-url" target="_blank"></a>.
</p>
<p>
The original URL, <code>https://vuejs.org<span id="original-url"></span></code>
will permanantly redirect to the v3 URL above after <b>May 7th, 2022 (${days} days from now).</b> If you need
future access to this v2 page, please use the v2-prefixed URL
<code>https://v2.vuejs.org<span id="current-url"></span></code>.
</p>
<p>
You can learn more about the Vue 2 -> Vue 3 default version switch in
<a target="_blank" href="https://blog.vuejs.org/posts/vue-3-as-the-new-default.html">this blog post</a>.
</p>
<p>
Would you like to start redirecting all v2 URLs to v3 right now?
</p>
<p>
<a class="go">Yes</a>
<a class="stay">Not yet</a>
</p>
  `.trim()

  const style = document.createElement('style')
  style.textContent = `
.v3-notice {
  position: fixed;
  top: 20px;
  --width: min(calc(100vw - 20px), 500px);
  left: calc(50vw - var(--width) / 2);
  width: var(--width);
  z-index: 9999;
  background-color: #f8f8f8;
  border: 2px solid #ffa500;
  border-radius: 8px;
  padding: 0 20px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}
.v3-notice a {
  color: #42b983;
  font-weight: bold;
}
.v3-notice .go, .v3-notice .stay {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.v3-notice .go {
  background-color: #42b983;
  color: #fff;
}
.v3-notice .stay {
  background-color: #ddd;
  color: #666;
}
.v3-notice code {
  background-color: transparent;
}
  `

  document.body.appendChild(style)
  document.body.appendChild(el)

  el.querySelector('#original-url').textContent = location.pathname
  el.querySelector('#current-url').textContent = location.pathname
  const v3Link = el.querySelector('#v3-url')

  v3Link.textContent =
    v3Link.href =
    el.querySelector('.go').href =
      `https://vuejs.org${finalUrl}`

  el.querySelector('.go').addEventListener('click', () => {
    localStorage.setItem('prefer-v3', 'true')
  })

  el.querySelector('.stay').addEventListener('click', () => {
    localStorage.setItem('prefer-v3', 'false')
    document.body.removeChild(el)
    document.body.removeChild(style)
    location.href = location.pathname
  })
})()

@@ -301,945 +301,242 @@
 nst 
-preferV3 = localStorage.getItem('prefer-v3')%0A  if (preferV3 === 'true') %7B%0A    location.href = %60https://vuejs.org$%7BfinalUrl%7D%60%0A  %7D else if (preferV3 === 'false') %7B%0A    return%0A  %7D%0A%0A  const today = new Date()%0A  const target = new Date('2022-05-07')%0A  const timeinmilisec = target.getTime() - today.getTime()%0A  const days = Math.ceil(timeinmilisec / (1000 * 60 * 60 * 24))%0A%0A  const el = document.createElement('div')%0A  el.className = %60v3-notice%60%0A  el.innerHTML = %60%0A%3Ch3%3EHeads Up!%3C/h3%3E%0A%3Cp%3E%0AThis page contains documentation for Vue 2. The Vue 3 version of the URL you are visiting is: %3Ca id=%22v3-url%22 target=%22_blank%22%3E%3C/a%3E.%0A%3C/p%3E%0A%3Cp%3E%0AThe original URL, %3Ccode%3Ehttps://vuejs.org%3Cspan id=%22original-url%22%3E%3C/span%3E%3C/code%3E%0Awill permanantly redirect to the v3 URL above after %3Cb%3EMay 7th, 2022 ($%7Bdays%7D days from now).%3C/b%3E If you need%0Afuture access to this v2 page, please use the v2-prefixed URL%0A%3Ccode%3Ehttps://v2.vuejs.org%3Cspan id=%22current-url%22%3E%3C/span%3E%3C/code
+el = document.createElement('div')%0A  el.className = %60v3-notice%60%0A  el.innerHTML = %60%0A%3Ch3%3EHeads Up!%3C/h3%3E%0A%3Cp%3E%0AThis page contains documentation for Vue 2. The Vue 3 version of the URL you are visiting is: %3Ca id=%22v3-url%22 target=%22_blank%22%3E%3C/a
 %3E.%0A%3C
@@ -731,127 +731,44 @@
 %3Cp%3E%0A
-Would you like to start redirecting all v2 URLs to v3 right now?%0A%3C/p%3E%0A%3Cp%3E%0A%3Ca class=%22go%22%3EYes%3C/a%3E%0A%3Ca class=%22stay%22%3ENot yet
+  %3Ca class=%22stay%22%3EStay on Vue 2 docs
 %3C/a%3E
@@ -1624,122 +1624,89 @@
 or('
-#original-url').textContent = location.pathname%0A  el.querySelector('#current-url').textContent = location.pathname
+.stay').addEventListener('click', () =%3E %7B%0A    document.body.removeChild(el)%0A  %7D)%0A
 %0A  c
@@ -1747,17 +1747,16 @@
 3-url')%0A
-%0A
   v3Link
@@ -1769,20 +1769,16 @@
 ontent =
-%0A   
  v3Link.
@@ -1787,416 +1787,39 @@
 ef =
-%0A    el.querySelector('.go').href =%0A      %60https://vuejs.org$%7BfinalUrl%7D%60%0A%0A  el.querySelector('.go').addEventListener('click', () =%3E %7B%0A    localStorage.setItem('prefer-v3', 'true')%0A  %7D)%0A%0A  el.querySelector('.stay').addEventListener('click', () =%3E %7B%0A    localStorage.setItem('prefer-v3', 'false')%0A    document.body.removeChild(el)%0A    document.body.removeChild(style)%0A    location.href = location.pathname%0A  %7D)
+ %60https://vuejs.org$%7BfinalUrl%7D%60
 %0A%7D)(

update notice