static/frontend: remove theme toggle keyboard shortcut

This keyboard shortcut is no longer necessary now
that we have a button in the footer to toggle the
theme.

Change-Id: I194672c668842ff90ae24fce58a62687c14f4c2b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/354597
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/static/frontend/_modals.tmpl b/static/frontend/_modals.tmpl
index d698dd7..ecf9e07 100644
--- a/static/frontend/_modals.tmpl
+++ b/static/frontend/_modals.tmpl
@@ -69,14 +69,6 @@
             <tr><td class="ShortcutsDialog-key">
               <strong>f</strong> or <strong>F</strong></td><td> : Jump to</td>
             </tr>
-            <tr><td class="ShortcutsDialog-key">
-              <strong>t</strong> or <strong>T</strong></td><td> : Toggle theme</td>
-              <td class="ShortcutsDialog-theme">
-                <span class="go-Chip go-Chip--inverted ShortcutsDialog-themeLight">light</span>
-                <span class="go-Chip go-Chip--inverted ShortcutsDialog-themeDark">dark</span>
-                <span class="go-Chip go-Chip--inverted ShortcutsDialog-themeAuto">auto</span>
-              </td>
-            </tr>
             <tr>
               <td class="ShortcutsDialog-key"><strong>y</strong> or <strong>Y</strong></td>
               <td> : Canonical URL</td>
diff --git a/static/frontend/frontend.js b/static/frontend/frontend.js
index b7a2e01..d45ede3 100644
--- a/static/frontend/frontend.js
+++ b/static/frontend/frontend.js
@@ -1,4 +1,4 @@
-var A=Object.defineProperty;var Z=e=>A(e,"__esModule",{value:!0});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var Q=(e,t)=>{Z(e);for(var o in t)A(e,o,{get:t[o],enumerable:!0})};var K={};Q(K,{default:()=>oe});function ee(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(n,i){return!(t[n]===void 0||t[n]===i)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;e=e.parentElement}return!1}function y(e){for(;e;){if(e.localName==="dialog")return e;e=e.parentElement}return null}function I(e){e&&e.blur&&e!==document.body&&e.blur()}function te(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function w(e){return!e||!e.hasAttribute("method")?!1:e.getAttribute("method").toLowerCase()==="dialog"}function O(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(e,{attributes:!0,attributeFilter:["open"]})}else{var o=!1,n=function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}.bind(this),i,s=function(r){if(r.target===e){var u="DOMNodeRemoved";o|=r.type.substr(0,u.length)===u,window.clearTimeout(i),i=window.setTimeout(n,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){e.addEventListener(r,s)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("click",this.backdropClick_.bind(this))}var v,a,S,m,q,N,P,R,oe,J=j(()=>{v=window.CustomEvent;(!v||typeof v=="object")&&(v=function(t,o){o=o||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),n},v.prototype=window.Event.prototype);O.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)||this.downgradeModal()},downgradeModal:function(){!this.openAsModal_||(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),a.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropClick_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents");o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"],o=t.map(function(n){return n+":not([disabled])"});o.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(o.join(", "))}I(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!document.body.contains(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!a.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");ee(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,a.needsCentering(this.dialog_)?(a.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new v("close",{bubbles:!1,cancelable:!1});this.dialog_.dispatchEvent(t)}};a={};a.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"};a.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],n=null;try{n=o.cssRules}catch(Y){}if(!!n)for(var i=0;i<n.length;++i){var s=n[i],r=null;try{r=document.querySelectorAll(s.selectorText)}catch(Y){}if(!(!r||!te(r,e))){var u=s.style.getPropertyValue("top"),f=s.style.getPropertyValue("bottom");if(u&&u!=="auto"||f&&f!=="auto")return!0}}}return!1};a.needsCentering=function(e){var t=window.getComputedStyle(e);return t.position!=="absolute"||e.style.top!=="auto"&&e.style.top!==""||e.style.bottom!=="auto"&&e.style.bottom!==""?!1:!a.isInlinePositionSetByStylesheet(e)};a.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),e.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new O(e)};a.registerDialog=function(e){e.showModal||a.forceRegisterDialog(e)};a.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=1e5+150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(n){for(var i=0,s;s=n.removedNodes[i];++i){if(s instanceof Element)s.localName==="dialog"&&o.push(s);else continue;o=o.concat(s.querySelectorAll("dialog"))}}),o.length&&e(o)}))};a.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};a.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()};a.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,o;o=this.pendingDialogStack[t];++t)o.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var n=this.pendingDialogStack[0];if(n){var i=n.dialog.parentNode||document.body;i.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};a.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=y(e);){for(var t=0,o;o=this.pendingDialogStack[t];++t)if(o.dialog===e)return t===0;e=e.parentElement}return!1};a.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),I(e.target),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],o=t.dialog,n=o.compareDocumentPosition(e.target);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e.target!==document.documentElement&&document.documentElement.focus()),!1}};a.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new v("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&o.dialog.dispatchEvent(t)&&o.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)};a.DialogManager.prototype.checkDOM_=function(e){var t=this.pendingDialogStack.slice();t.forEach(function(o){e.indexOf(o.dialog)!==-1?o.downgradeModal():o.maybeHideModal()})};a.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)};a.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())};a.dm=new a.DialogManager;a.formSubmitter=null;a.useValue=null;window.HTMLDialogElement===void 0&&(S=document.createElement("form"),S.setAttribute("method","dialog"),S.method!=="dialog"&&(m=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method"),m&&(q=m.get,m.get=function(){return w(this)?"dialog":q.call(this)},N=m.set,m.set=function(e){return typeof e=="string"&&e.toLowerCase()==="dialog"?this.setAttribute("method",e):N.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",m))),document.addEventListener("click",function(e){if(a.formSubmitter=null,a.useValue=null,!e.defaultPrevented){var t=e.target;if(!(!t||!w(t.form))){var o=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!o){if(!(t.localName==="input"&&t.type==="image"))return;a.useValue=e.offsetX+","+e.offsetY}var n=y(t);!n||(a.formSubmitter=t)}}},!1),P=HTMLFormElement.prototype.submit,R=function(){if(!w(this))return P.call(this);var e=y(this);e&&e.close()},HTMLFormElement.prototype.submit=R,document.addEventListener("submit",function(e){if(!e.defaultPrevented){var t=e.target;if(!!w(t)){e.preventDefault();var o=y(t);if(!!o){var n=a.formSubmitter;n&&n.form===t?o.close(a.useValue||n.value):o.close(),a.formSubmitter=null}}}},!1));oe=a});function H(){let e=document.querySelector(".js-header"),t=document.querySelectorAll(".js-headerMenuButton");t.forEach(n=>{n.addEventListener("click",i=>{i.preventDefault(),e==null||e.classList.toggle("is-active"),n.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})});let o=document.querySelector(".js-scrim");o==null||o.addEventListener("click",n=>{n.preventDefault(),e==null||e.classList.remove("is-active"),t.forEach(i=>{i.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})})}function D(){let e=document.querySelector(".js-searchForm"),t=document.querySelector(".js-expandSearch"),o=e==null?void 0:e.querySelector("input"),n=document.querySelector(".js-headerLogo"),i=document.querySelector(".js-headerMenuButton");t==null||t.addEventListener("click",()=>{e==null||e.classList.add("go-SearchForm--expanded"),n==null||n.classList.add("go-Header-logo--hidden"),i==null||i.classList.add("go-Header-navOpen--hidden"),o==null||o.focus()}),document==null||document.addEventListener("click",s=>{(e==null?void 0:e.contains(s.target))||(e==null||e.classList.remove("go-SearchForm--expanded"),n==null||n.classList.remove("go-Header-logo--hidden"),i==null||i.classList.remove("go-Header-navOpen--hidden"))})}var M=class{constructor(t){this.el=t;this.setActive=t=>{this.activeIndex=(t+this.slides.length)%this.slides.length,this.el.setAttribute("data-slide-index",String(this.activeIndex));for(let o of this.dots)o.classList.remove("go-Carousel-dot--active");this.dots[this.activeIndex].classList.add("go-Carousel-dot--active");for(let o of this.slides)o.setAttribute("aria-hidden","true");this.slides[this.activeIndex].removeAttribute("aria-hidden"),this.liveRegion.textContent="Slide "+(this.activeIndex+1)+" of "+this.slides.length};var o;this.slides=Array.from(t.querySelectorAll(".go-Carousel-slide")),this.dots=[],this.liveRegion=document.createElement("div"),this.activeIndex=Number((o=t.getAttribute("data-slide-index"))!=null?o:0),this.initSlides(),this.initArrows(),this.initDots(),this.initLiveRegion()}initSlides(){for(let[t,o]of this.slides.entries())t!==this.activeIndex&&o.setAttribute("aria-hidden","true")}initArrows(){var o,n;let t=document.createElement("ul");t.classList.add("go-Carousel-arrows"),t.innerHTML=`
+var A=Object.defineProperty;var Y=e=>A(e,"__esModule",{value:!0});var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var j=(e,t)=>{Y(e);for(var o in t)A(e,o,{get:t[o],enumerable:!0})};var K={};j(K,{default:()=>te});function Q(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),o=function(n,i){return!(t[n]===void 0||t[n]===i)};if(t.opacity<1||o("zIndex","auto")||o("transform","none")||o("mixBlendMode","normal")||o("filter","none")||o("perspective","none")||t.isolation==="isolate"||t.position==="fixed"||t.webkitOverflowScrolling==="touch")return!0;e=e.parentElement}return!1}function y(e){for(;e;){if(e.localName==="dialog")return e;e=e.parentElement}return null}function I(e){e&&e.blur&&e!==document.body&&e.blur()}function ee(e,t){for(var o=0;o<e.length;++o)if(e[o]===t)return!0;return!1}function w(e){return!e||!e.hasAttribute("method")?!1:e.getAttribute("method").toLowerCase()==="dialog"}function O(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){var t=new MutationObserver(this.maybeHideModal.bind(this));t.observe(e,{attributes:!0,attributeFilter:["open"]})}else{var o=!1,n=function(){o?this.downgradeModal():this.maybeHideModal(),o=!1}.bind(this),i,s=function(r){if(r.target===e){var u="DOMNodeRemoved";o|=r.type.substr(0,u.length)===u,window.clearTimeout(i),i=window.setTimeout(n,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(r){e.addEventListener(r,s)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("click",this.backdropClick_.bind(this))}var v,a,S,m,q,N,P,R,te,J=Z(()=>{v=window.CustomEvent;(!v||typeof v=="object")&&(v=function(t,o){o=o||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!!o.bubbles,!!o.cancelable,o.detail||null),n},v.prototype=window.Event.prototype);O.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)||this.downgradeModal()},downgradeModal:function(){!this.openAsModal_||(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),a.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropClick_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var o=document.createEvent("MouseEvents");o.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(o),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"],o=t.map(function(n){return n+":not([disabled])"});o.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(o.join(", "))}I(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!document.body.contains(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!a.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");Q(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,a.needsCentering(this.dialog_)?(a.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),e!==void 0&&(this.dialog_.returnValue=e);var t=new v("close",{bubbles:!1,cancelable:!1});this.dialog_.dispatchEvent(t)}};a={};a.reposition=function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,o=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,o)+"px"};a.isInlinePositionSetByStylesheet=function(e){for(var t=0;t<document.styleSheets.length;++t){var o=document.styleSheets[t],n=null;try{n=o.cssRules}catch(X){}if(!!n)for(var i=0;i<n.length;++i){var s=n[i],r=null;try{r=document.querySelectorAll(s.selectorText)}catch(X){}if(!(!r||!ee(r,e))){var u=s.style.getPropertyValue("top"),f=s.style.getPropertyValue("bottom");if(u&&u!=="auto"||f&&f!=="auto")return!0}}}return!1};a.needsCentering=function(e){var t=window.getComputedStyle(e);return t.position!=="absolute"||e.style.top!=="auto"&&e.style.top!==""||e.style.bottom!=="auto"&&e.style.bottom!==""?!1:!a.isInlinePositionSetByStylesheet(e)};a.forceRegisterDialog=function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),e.localName!=="dialog")throw new Error("Failed to register dialog: The element is not a dialog.");new O(e)};a.registerDialog=function(e){e.showModal||a.forceRegisterDialog(e)};a.DialogManager=function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=1e5+150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var o=[];t.forEach(function(n){for(var i=0,s;s=n.removedNodes[i];++i){if(s instanceof Element)s.localName==="dialog"&&o.push(s);else continue;o=o.concat(s.querySelectorAll("dialog"))}}),o.length&&e(o)}))};a.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})};a.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()};a.DialogManager.prototype.updateStacking=function(){for(var e=this.zIndexHigh_,t=0,o;o=this.pendingDialogStack[t];++t)o.updateZIndex(--e,--e),t===0&&(this.overlay.style.zIndex=--e);var n=this.pendingDialogStack[0];if(n){var i=n.dialog.parentNode||document.body;i.appendChild(this.overlay)}else this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)};a.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=y(e);){for(var t=0,o;o=this.pendingDialogStack[t];++t)if(o.dialog===e)return t===0;e=e.parentElement}return!1};a.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),I(e.target),this.forwardTab_!==void 0)){var t=this.pendingDialogStack[0],o=t.dialog,n=o.compareDocumentPosition(e.target);return n&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():e.target!==document.documentElement&&document.documentElement.focus()),!1}};a.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,e.keyCode===27){e.preventDefault(),e.stopPropagation();var t=new v("cancel",{bubbles:!1,cancelable:!0}),o=this.pendingDialogStack[0];o&&o.dialog.dispatchEvent(t)&&o.dialog.close()}else e.keyCode===9&&(this.forwardTab_=!e.shiftKey)};a.DialogManager.prototype.checkDOM_=function(e){var t=this.pendingDialogStack.slice();t.forEach(function(o){e.indexOf(o.dialog)!==-1?o.downgradeModal():o.maybeHideModal()})};a.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return this.pendingDialogStack.length>=t?!1:(this.pendingDialogStack.unshift(e)===1&&this.blockDocument(),this.updateStacking(),!0)};a.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);t!==-1&&(this.pendingDialogStack.splice(t,1),this.pendingDialogStack.length===0&&this.unblockDocument(),this.updateStacking())};a.dm=new a.DialogManager;a.formSubmitter=null;a.useValue=null;window.HTMLDialogElement===void 0&&(S=document.createElement("form"),S.setAttribute("method","dialog"),S.method!=="dialog"&&(m=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method"),m&&(q=m.get,m.get=function(){return w(this)?"dialog":q.call(this)},N=m.set,m.set=function(e){return typeof e=="string"&&e.toLowerCase()==="dialog"?this.setAttribute("method",e):N.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",m))),document.addEventListener("click",function(e){if(a.formSubmitter=null,a.useValue=null,!e.defaultPrevented){var t=e.target;if(!(!t||!w(t.form))){var o=t.type==="submit"&&["button","input"].indexOf(t.localName)>-1;if(!o){if(!(t.localName==="input"&&t.type==="image"))return;a.useValue=e.offsetX+","+e.offsetY}var n=y(t);!n||(a.formSubmitter=t)}}},!1),P=HTMLFormElement.prototype.submit,R=function(){if(!w(this))return P.call(this);var e=y(this);e&&e.close()},HTMLFormElement.prototype.submit=R,document.addEventListener("submit",function(e){if(!e.defaultPrevented){var t=e.target;if(!!w(t)){e.preventDefault();var o=y(t);if(!!o){var n=a.formSubmitter;n&&n.form===t?o.close(a.useValue||n.value):o.close(),a.formSubmitter=null}}}},!1));te=a});function H(){let e=document.querySelector(".js-header"),t=document.querySelectorAll(".js-headerMenuButton");t.forEach(n=>{n.addEventListener("click",i=>{i.preventDefault(),e==null||e.classList.toggle("is-active"),n.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})});let o=document.querySelector(".js-scrim");o==null||o.addEventListener("click",n=>{n.preventDefault(),e==null||e.classList.remove("is-active"),t.forEach(i=>{i.setAttribute("aria-expanded",String(e==null?void 0:e.classList.contains("is-active")))})})}function D(){let e=document.querySelector(".js-searchForm"),t=document.querySelector(".js-expandSearch"),o=e==null?void 0:e.querySelector("input"),n=document.querySelector(".js-headerLogo"),i=document.querySelector(".js-headerMenuButton");t==null||t.addEventListener("click",()=>{e==null||e.classList.add("go-SearchForm--expanded"),n==null||n.classList.add("go-Header-logo--hidden"),i==null||i.classList.add("go-Header-navOpen--hidden"),o==null||o.focus()}),document==null||document.addEventListener("click",s=>{(e==null?void 0:e.contains(s.target))||(e==null||e.classList.remove("go-SearchForm--expanded"),n==null||n.classList.remove("go-Header-logo--hidden"),i==null||i.classList.remove("go-Header-navOpen--hidden"))})}var M=class{constructor(t){this.el=t;this.setActive=t=>{this.activeIndex=(t+this.slides.length)%this.slides.length,this.el.setAttribute("data-slide-index",String(this.activeIndex));for(let o of this.dots)o.classList.remove("go-Carousel-dot--active");this.dots[this.activeIndex].classList.add("go-Carousel-dot--active");for(let o of this.slides)o.setAttribute("aria-hidden","true");this.slides[this.activeIndex].removeAttribute("aria-hidden"),this.liveRegion.textContent="Slide "+(this.activeIndex+1)+" of "+this.slides.length};var o;this.slides=Array.from(t.querySelectorAll(".go-Carousel-slide")),this.dots=[],this.liveRegion=document.createElement("div"),this.activeIndex=Number((o=t.getAttribute("data-slide-index"))!=null?o:0),this.initSlides(),this.initArrows(),this.initDots(),this.initLiveRegion()}initSlides(){for(let[t,o]of this.slides.entries())t!==this.activeIndex&&o.setAttribute("aria-hidden","true")}initArrows(){var o,n;let t=document.createElement("ul");t.classList.add("go-Carousel-arrows"),t.innerHTML=`
       <li>
         <button class="go-Carousel-prevSlide" aria-label="Go to previous slide">
           <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_left_gm_grey_24dp.svg" alt="">
@@ -9,7 +9,7 @@
           <img class="go-Icon" height="24" width="24" src="/static/shared/icon/arrow_right_gm_grey_24dp.svg" alt="">
         </button>
       </li>
-    `,(o=t.querySelector(".go-Carousel-prevSlide"))==null||o.addEventListener("click",()=>this.setActive(this.activeIndex-1)),(n=t.querySelector(".go-Carousel-nextSlide"))==null||n.addEventListener("click",()=>this.setActive(this.activeIndex+1)),this.el.append(t)}initDots(){let t=document.createElement("ul");t.classList.add("go-Carousel-dots");for(let o=0;o<this.slides.length;o++){let n=document.createElement("li"),i=document.createElement("button");i.classList.add("go-Carousel-dot"),o===this.activeIndex&&i.classList.add("go-Carousel-dot--active"),i.innerHTML=`<span class="go-Carousel-obscured">Slide ${o+1}</span>`,i.addEventListener("click",()=>this.setActive(o)),n.append(i),t.append(n),this.dots.push(i)}this.el.append(t)}initLiveRegion(){this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),this.liveRegion.setAttribute("class","go-Carousel-obscured"),this.liveRegion.textContent=`Slide ${this.activeIndex+1} of ${this.slides.length}`,this.el.appendChild(this.liveRegion)}};var L=class{constructor(t){this.el=t;var o,n,i,s,r;this.data=(o=t.dataset.toCopy)!=null?o:t.innerText,!this.data&&((n=t.parentElement)==null?void 0:n.classList.contains("go-InputGroup"))&&(this.data=(r=this.data||((s=(i=t.parentElement)==null?void 0:i.querySelector("input"))==null?void 0:s.value))!=null?r:""),t.addEventListener("click",u=>this.handleCopyClick(u))}handleCopyClick(t){t.preventDefault();let o=1e3;if(!navigator.clipboard){this.showTooltipText("Unable to copy",o);return}navigator.clipboard.writeText(this.data).then(()=>{this.showTooltipText("Copied!",o)}).catch(()=>{this.showTooltipText("Unable to copy",o)})}showTooltipText(t,o){this.el.setAttribute("data-tooltip",t),setTimeout(()=>this.el.setAttribute("data-tooltip",""),o)}};var T=class{constructor(t){this.el=t;document.addEventListener("click",o=>{this.el.contains(o.target)||this.el.removeAttribute("open")})}};var _=class{constructor(t){this.el=t;this.el.addEventListener("change",o=>{let n=o.target,i=n.value;n.value.startsWith("/")||(i="/"+i),window.location.href=i})}};var k=class{constructor(t){this.el=t;!window.HTMLDialogElement&&!t.showModal&&Promise.resolve().then(()=>(J(),K)).then(({default:i})=>{i.registerDialog(t)});let o=t.id,n=document.querySelector(`[aria-controls="${o}"]`);n&&n.addEventListener("click",()=>{var i;this.el.showModal?this.el.showModal():this.el.open=!0,(i=t.querySelector("input"))==null||i.focus()});for(let i of this.el.querySelectorAll("[data-modal-close]"))i.addEventListener("click",()=>{this.el.close?this.el.close():this.el.open=!1})}};function E(e,t,o,n){var i;(i=window.dataLayer)!=null||(window.dataLayer=[]),typeof e=="string"?window.dataLayer.push({event:e,event_category:t,event_action:o,event_label:n}):window.dataLayer.push(e)}function U(e){var t;(t=window.dataLayer)!=null||(window.dataLayer=[]),window.dataLayer.push(e)}var B=class{constructor(){this.handlers={},document.addEventListener("keydown",t=>this.handleKeyPress(t))}on(t,o,n,i){var s,r;return(r=(s=this.handlers)[t])!=null||(s[t]=new Set),this.handlers[t].add({description:o,callback:n,...i}),this}handleKeyPress(t){var o;for(let n of(o=this.handlers[t.key.toLowerCase()])!=null?o:new Set){if(n.target&&n.target!==t.target)return;let i=t.target;if(!n.target&&((i==null?void 0:i.tagName)==="INPUT"||(i==null?void 0:i.tagName)==="SELECT"||(i==null?void 0:i.tagName)==="TEXTAREA")||(i==null?void 0:i.isContentEditable)||n.withMeta&&!(t.ctrlKey||t.metaKey)||!n.withMeta&&(t.ctrlKey||t.metaKey))return;E("keypress","hotkeys",`${t.key} pressed`,n.description),n.callback(t)}}},b=new B;var l=document.querySelector(".JumpDialog"),p=l==null?void 0:l.querySelector(".JumpDialog-body"),c=l==null?void 0:l.querySelector(".JumpDialog-list"),d=l==null?void 0:l.querySelector(".JumpDialog-input"),z=document.querySelector(".js-documentation"),h;function ne(){let e=[];if(!!z){for(let t of z.querySelectorAll("[data-kind]"))e.push(ie(t));for(let t of e)t.link.addEventListener("click",function(){l==null||l.close()});return e.sort(function(t,o){return t.lower.localeCompare(o.lower)}),e}}function ie(e){var i;let t=document.createElement("a"),o=e.getAttribute("id");t.setAttribute("href","#"+o),t.setAttribute("tabindex","-1"),t.setAttribute("data-gtmc","jump to link");let n=e.getAttribute("data-kind");return{link:t,name:o!=null?o:"",kind:n!=null?n:"",lower:(i=o==null?void 0:o.toLowerCase())!=null?i:""}}var V,g=-1;function x(e){for(V=e,h||(h=ne()),C(-1);c==null?void 0:c.firstChild;)c.firstChild.remove();if(e){let t=e.toLowerCase(),o=[],n=[],i=[],s=(r,u,f)=>r.name.substring(0,u)+"<b>"+r.name.substring(u,f)+"</b>"+r.name.substring(f);for(let r of h!=null?h:[]){let u=r.name.toLowerCase();if(u===t)r.link.innerHTML=s(r,0,r.name.length),o.push(r);else if(u.startsWith(t))r.link.innerHTML=s(r,0,e.length),n.push(r);else{let f=u.indexOf(t);f>-1&&(r.link.innerHTML=s(r,f,f+e.length),i.push(r))}}for(let r of o.concat(n).concat(i))c==null||c.appendChild(r.link)}else{if(!h||h.length===0){let t=document.createElement("i");t.innerHTML="There are no symbols on this page.",c==null||c.appendChild(t)}for(let t of h!=null?h:[])t.link.innerHTML=t.name+" <i>"+t.kind+"</i>",c==null||c.appendChild(t.link)}p&&(p.scrollTop=0),(h==null?void 0:h.length)&&c&&c.children.length>0&&C(0)}function C(e){let t=c==null?void 0:c.children;if(!(!t||!p)){if(g>=0&&t[g].classList.remove("JumpDialog-active"),e>=t.length&&(e=t.length-1),e>=0){t[e].classList.add("JumpDialog-active");let o=t[e].offsetTop-t[0].offsetTop,n=o+t[e].clientHeight;o<p.scrollTop?p.scrollTop=o:n>p.scrollTop+p.clientHeight&&(p.scrollTop=n-p.clientHeight)}g=e}}function F(e){if(g<0)return;let t=g+e;t<0&&(t=0),C(t)}function $(){var o;d==null||d.addEventListener("keyup",function(){d.value.toUpperCase()!=V.toUpperCase()&&x(d.value)}),d==null||d.addEventListener("keydown",function(n){let i=38,s=40,r=13;switch(n.which){case i:F(-1),n.preventDefault();break;case s:F(1),n.preventDefault();break;case r:g>=0&&c&&(c.children[g].click(),n.preventDefault());break}});let e=document.querySelector(".ShortcutsDialog");b.on("f","open jump to modal",n=>{(l==null?void 0:l.open)||(e==null?void 0:e.open)||(n.preventDefault(),d&&(d.value=""),l==null||l.showModal(),d==null||d.focus(),x(""))}).on("?","open shortcuts modal",()=>{(l==null?void 0:l.open)||(e==null?void 0:e.open)||e==null||e.showModal()});let t=document.querySelector(".js-jumpToInput");t&&t.addEventListener("click",()=>{d&&(d.value=""),x("")}),(o=document.querySelector(".js-openShortcuts"))==null||o.addEventListener("click",()=>{e==null||e.showModal()})}for(let e of document.querySelectorAll(".js-clipboard"))new L(e);for(let e of document.querySelectorAll(".js-modal"))new k(e);for(let e of document.querySelectorAll(".js-tooltip"))new T(e);for(let e of document.querySelectorAll(".js-selectNav"))new _(e);for(let e of document.querySelectorAll(".js-carousel"))new M(e);H();D();$();b.on("t","toggle theme",()=>{W()});b.on("/","focus search",e=>{let t=Array.from(document.querySelectorAll(".js-searchFocus")).pop();t&&!window.navigator.userAgent.includes("Firefox")&&(e.preventDefault(),t.focus())});b.on("y","set canonical url",()=>{var t;let e=(t=document.querySelector(".js-canonicalURLPath"))==null?void 0:t.dataset.canonicalUrlPath;e&&e!==""&&window.history.replaceState(null,"",e)});(function(){E({"gtm.start":new Date().getTime(),event:"gtm.js"})})();function G(){let e=new URLSearchParams(window.location.search),t=e.get("utm_source");if(t!=="gopls"&&t!=="godoc"&&t!=="pkggodev")return;let o=new URL(window.location.href);e.delete("utm_source"),o.search=e.toString(),window.history.replaceState(null,"",o.toString())}var X;((X=document.querySelector(".js-gtmID"))==null?void 0:X.dataset.gtmid)&&window.dataLayer?U(function(){G()}):G();for(let e of document.querySelectorAll(".js-toggleTheme"))e.addEventListener("click",()=>{W()});function W(){let e="dark",t=document.documentElement.getAttribute("data-theme");t==="dark"?e="light":t==="light"&&(e="auto"),document.documentElement.setAttribute("data-theme",e),document.cookie=`prefers-color-scheme=${e};path=/;max-age=31536000;`}
+    `,(o=t.querySelector(".go-Carousel-prevSlide"))==null||o.addEventListener("click",()=>this.setActive(this.activeIndex-1)),(n=t.querySelector(".go-Carousel-nextSlide"))==null||n.addEventListener("click",()=>this.setActive(this.activeIndex+1)),this.el.append(t)}initDots(){let t=document.createElement("ul");t.classList.add("go-Carousel-dots");for(let o=0;o<this.slides.length;o++){let n=document.createElement("li"),i=document.createElement("button");i.classList.add("go-Carousel-dot"),o===this.activeIndex&&i.classList.add("go-Carousel-dot--active"),i.innerHTML=`<span class="go-Carousel-obscured">Slide ${o+1}</span>`,i.addEventListener("click",()=>this.setActive(o)),n.append(i),t.append(n),this.dots.push(i)}this.el.append(t)}initLiveRegion(){this.liveRegion.setAttribute("aria-live","polite"),this.liveRegion.setAttribute("aria-atomic","true"),this.liveRegion.setAttribute("class","go-Carousel-obscured"),this.liveRegion.textContent=`Slide ${this.activeIndex+1} of ${this.slides.length}`,this.el.appendChild(this.liveRegion)}};var L=class{constructor(t){this.el=t;var o,n,i,s,r;this.data=(o=t.dataset.toCopy)!=null?o:t.innerText,!this.data&&((n=t.parentElement)==null?void 0:n.classList.contains("go-InputGroup"))&&(this.data=(r=this.data||((s=(i=t.parentElement)==null?void 0:i.querySelector("input"))==null?void 0:s.value))!=null?r:""),t.addEventListener("click",u=>this.handleCopyClick(u))}handleCopyClick(t){t.preventDefault();let o=1e3;if(!navigator.clipboard){this.showTooltipText("Unable to copy",o);return}navigator.clipboard.writeText(this.data).then(()=>{this.showTooltipText("Copied!",o)}).catch(()=>{this.showTooltipText("Unable to copy",o)})}showTooltipText(t,o){this.el.setAttribute("data-tooltip",t),setTimeout(()=>this.el.setAttribute("data-tooltip",""),o)}};var T=class{constructor(t){this.el=t;document.addEventListener("click",o=>{this.el.contains(o.target)||this.el.removeAttribute("open")})}};var _=class{constructor(t){this.el=t;this.el.addEventListener("change",o=>{let n=o.target,i=n.value;n.value.startsWith("/")||(i="/"+i),window.location.href=i})}};var k=class{constructor(t){this.el=t;!window.HTMLDialogElement&&!t.showModal&&Promise.resolve().then(()=>(J(),K)).then(({default:i})=>{i.registerDialog(t)});let o=t.id,n=document.querySelector(`[aria-controls="${o}"]`);n&&n.addEventListener("click",()=>{var i;this.el.showModal?this.el.showModal():this.el.open=!0,(i=t.querySelector("input"))==null||i.focus()});for(let i of this.el.querySelectorAll("[data-modal-close]"))i.addEventListener("click",()=>{this.el.close?this.el.close():this.el.open=!1})}};function E(e,t,o,n){var i;(i=window.dataLayer)!=null||(window.dataLayer=[]),typeof e=="string"?window.dataLayer.push({event:e,event_category:t,event_action:o,event_label:n}):window.dataLayer.push(e)}function U(e){var t;(t=window.dataLayer)!=null||(window.dataLayer=[]),window.dataLayer.push(e)}var B=class{constructor(){this.handlers={},document.addEventListener("keydown",t=>this.handleKeyPress(t))}on(t,o,n,i){var s,r;return(r=(s=this.handlers)[t])!=null||(s[t]=new Set),this.handlers[t].add({description:o,callback:n,...i}),this}handleKeyPress(t){var o;for(let n of(o=this.handlers[t.key.toLowerCase()])!=null?o:new Set){if(n.target&&n.target!==t.target)return;let i=t.target;if(!n.target&&((i==null?void 0:i.tagName)==="INPUT"||(i==null?void 0:i.tagName)==="SELECT"||(i==null?void 0:i.tagName)==="TEXTAREA")||(i==null?void 0:i.isContentEditable)||n.withMeta&&!(t.ctrlKey||t.metaKey)||!n.withMeta&&(t.ctrlKey||t.metaKey))return;E("keypress","hotkeys",`${t.key} pressed`,n.description),n.callback(t)}}},b=new B;var l=document.querySelector(".JumpDialog"),p=l==null?void 0:l.querySelector(".JumpDialog-body"),c=l==null?void 0:l.querySelector(".JumpDialog-list"),d=l==null?void 0:l.querySelector(".JumpDialog-input"),z=document.querySelector(".js-documentation"),h;function oe(){let e=[];if(!!z){for(let t of z.querySelectorAll("[data-kind]"))e.push(ne(t));for(let t of e)t.link.addEventListener("click",function(){l==null||l.close()});return e.sort(function(t,o){return t.lower.localeCompare(o.lower)}),e}}function ne(e){var i;let t=document.createElement("a"),o=e.getAttribute("id");t.setAttribute("href","#"+o),t.setAttribute("tabindex","-1"),t.setAttribute("data-gtmc","jump to link");let n=e.getAttribute("data-kind");return{link:t,name:o!=null?o:"",kind:n!=null?n:"",lower:(i=o==null?void 0:o.toLowerCase())!=null?i:""}}var V,g=-1;function x(e){for(V=e,h||(h=oe()),C(-1);c==null?void 0:c.firstChild;)c.firstChild.remove();if(e){let t=e.toLowerCase(),o=[],n=[],i=[],s=(r,u,f)=>r.name.substring(0,u)+"<b>"+r.name.substring(u,f)+"</b>"+r.name.substring(f);for(let r of h!=null?h:[]){let u=r.name.toLowerCase();if(u===t)r.link.innerHTML=s(r,0,r.name.length),o.push(r);else if(u.startsWith(t))r.link.innerHTML=s(r,0,e.length),n.push(r);else{let f=u.indexOf(t);f>-1&&(r.link.innerHTML=s(r,f,f+e.length),i.push(r))}}for(let r of o.concat(n).concat(i))c==null||c.appendChild(r.link)}else{if(!h||h.length===0){let t=document.createElement("i");t.innerHTML="There are no symbols on this page.",c==null||c.appendChild(t)}for(let t of h!=null?h:[])t.link.innerHTML=t.name+" <i>"+t.kind+"</i>",c==null||c.appendChild(t.link)}p&&(p.scrollTop=0),(h==null?void 0:h.length)&&c&&c.children.length>0&&C(0)}function C(e){let t=c==null?void 0:c.children;if(!(!t||!p)){if(g>=0&&t[g].classList.remove("JumpDialog-active"),e>=t.length&&(e=t.length-1),e>=0){t[e].classList.add("JumpDialog-active");let o=t[e].offsetTop-t[0].offsetTop,n=o+t[e].clientHeight;o<p.scrollTop?p.scrollTop=o:n>p.scrollTop+p.clientHeight&&(p.scrollTop=n-p.clientHeight)}g=e}}function F(e){if(g<0)return;let t=g+e;t<0&&(t=0),C(t)}function $(){var o;d==null||d.addEventListener("keyup",function(){d.value.toUpperCase()!=V.toUpperCase()&&x(d.value)}),d==null||d.addEventListener("keydown",function(n){let i=38,s=40,r=13;switch(n.which){case i:F(-1),n.preventDefault();break;case s:F(1),n.preventDefault();break;case r:g>=0&&c&&(c.children[g].click(),n.preventDefault());break}});let e=document.querySelector(".ShortcutsDialog");b.on("f","open jump to modal",n=>{(l==null?void 0:l.open)||(e==null?void 0:e.open)||(n.preventDefault(),d&&(d.value=""),l==null||l.showModal(),d==null||d.focus(),x(""))}).on("?","open shortcuts modal",()=>{(l==null?void 0:l.open)||(e==null?void 0:e.open)||e==null||e.showModal()});let t=document.querySelector(".js-jumpToInput");t&&t.addEventListener("click",()=>{d&&(d.value=""),x("")}),(o=document.querySelector(".js-openShortcuts"))==null||o.addEventListener("click",()=>{e==null||e.showModal()})}for(let e of document.querySelectorAll(".js-clipboard"))new L(e);for(let e of document.querySelectorAll(".js-modal"))new k(e);for(let e of document.querySelectorAll(".js-tooltip"))new T(e);for(let e of document.querySelectorAll(".js-selectNav"))new _(e);for(let e of document.querySelectorAll(".js-carousel"))new M(e);H();D();$();b.on("/","focus search",e=>{let t=Array.from(document.querySelectorAll(".js-searchFocus")).pop();t&&!window.navigator.userAgent.includes("Firefox")&&(e.preventDefault(),t.focus())});b.on("y","set canonical url",()=>{var t;let e=(t=document.querySelector(".js-canonicalURLPath"))==null?void 0:t.dataset.canonicalUrlPath;e&&e!==""&&window.history.replaceState(null,"",e)});(function(){E({"gtm.start":new Date().getTime(),event:"gtm.js"})})();function G(){let e=new URLSearchParams(window.location.search),t=e.get("utm_source");if(t!=="gopls"&&t!=="godoc"&&t!=="pkggodev")return;let o=new URL(window.location.href);e.delete("utm_source"),o.search=e.toString(),window.history.replaceState(null,"",o.toString())}var W;((W=document.querySelector(".js-gtmID"))==null?void 0:W.dataset.gtmid)&&window.dataLayer?U(function(){G()}):G();for(let e of document.querySelectorAll(".js-toggleTheme"))e.addEventListener("click",()=>{ie()});function ie(){let e="dark",t=document.documentElement.getAttribute("data-theme");t==="dark"?e="light":t==="light"&&(e="auto"),document.documentElement.setAttribute("data-theme",e),document.cookie=`prefers-color-scheme=${e};path=/;max-age=31536000;`}
 /*!
  * @license
  * Copyright 2019-2020 The Go Authors. All rights reserved.
diff --git a/static/frontend/frontend.js.map b/static/frontend/frontend.js.map
index 3bc0895..bfee5d8 100644
--- a/static/frontend/frontend.js.map
+++ b/static/frontend/frontend.js.map
@@ -1,7 +1,7 @@
 {
   "version": 3,
   "sources": ["../../third_party/dialog-polyfill/dialog-polyfill.esm.js", "../shared/header/header.ts", "../shared/carousel/carousel.ts", "../shared/clipboard/clipboard.ts", "../shared/tooltip/tooltip.ts", "../shared/outline/select.ts", "../shared/modal/modal.ts", "../shared/analytics/analytics.ts", "../shared/keyboard/keyboard.ts", "../shared/jump/jump.ts", "frontend.ts"],
-  "sourcesContent": ["// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n  supportCustomEvent = function CustomEvent(event, x) {\n    x = x || {};\n    var ev = document.createEvent('CustomEvent');\n    ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n    return ev;\n  };\n  supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n  while (el && el !== document.body) {\n    var s = window.getComputedStyle(el);\n    var invalid = function(k, ok) {\n      return !(s[k] === undefined || s[k] === ok);\n    };\n\n    if (s.opacity < 1 ||\n        invalid('zIndex', 'auto') ||\n        invalid('transform', 'none') ||\n        invalid('mixBlendMode', 'normal') ||\n        invalid('filter', 'none') ||\n        invalid('perspective', 'none') ||\n        s['isolation'] === 'isolate' ||\n        s.position === 'fixed' ||\n        s.webkitOverflowScrolling === 'touch') {\n      return true;\n    }\n    el = el.parentElement;\n  }\n  return false;\n}\n\n/**\n * Finds the nearest <dialog> from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n  while (el) {\n    if (el.localName === 'dialog') {\n      return /** @type {HTMLDialogElement} */ (el);\n    }\n    el = el.parentElement;\n  }\n  return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n  if (el && el.blur && el !== document.body) {\n    el.blur();\n  }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n  for (var i = 0; i < nodeList.length; ++i) {\n    if (nodeList[i] === node) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n  if (!el || !el.hasAttribute('method')) {\n    return false;\n  }\n  return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n  this.dialog_ = dialog;\n  this.replacedStyleTop_ = false;\n  this.openAsModal_ = false;\n\n  // Set a11y role. Browsers that support dialog implicitly know this already.\n  if (!dialog.hasAttribute('role')) {\n    dialog.setAttribute('role', 'dialog');\n  }\n\n  dialog.show = this.show.bind(this);\n  dialog.showModal = this.showModal.bind(this);\n  dialog.close = this.close.bind(this);\n\n  if (!('returnValue' in dialog)) {\n    dialog.returnValue = '';\n  }\n\n  if ('MutationObserver' in window) {\n    var mo = new MutationObserver(this.maybeHideModal.bind(this));\n    mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n  } else {\n    // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n    // seem to fire even if the element was removed as part of a parent removal. Use the removed\n    // events to force downgrade (useful if removed/immediately added).\n    var removed = false;\n    var cb = function() {\n      removed ? this.downgradeModal() : this.maybeHideModal();\n      removed = false;\n    }.bind(this);\n    var timeout;\n    var delayModel = function(ev) {\n      if (ev.target !== dialog) { return; }  // not for a child element\n      var cand = 'DOMNodeRemoved';\n      removed |= (ev.type.substr(0, cand.length) === cand);\n      window.clearTimeout(timeout);\n      timeout = window.setTimeout(cb, 0);\n    };\n    ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n      dialog.addEventListener(name, delayModel);\n    });\n  }\n  // Note that the DOM is observed inside DialogManager while any dialog\n  // is being displayed as a modal, to catch modal removal from the DOM.\n\n  Object.defineProperty(dialog, 'open', {\n    set: this.setOpen.bind(this),\n    get: dialog.hasAttribute.bind(dialog, 'open')\n  });\n\n  this.backdrop_ = document.createElement('div');\n  this.backdrop_.className = 'backdrop';\n  this.backdrop_.addEventListener('click', this.backdropClick_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = {\n\n  get dialog() {\n    return this.dialog_;\n  },\n\n  /**\n   * Maybe remove this dialog from the modal top layer. This is called when\n   * a modal dialog may no longer be tenable, e.g., when the dialog is no\n   * longer open or is no longer part of the DOM.\n   */\n  maybeHideModal: function() {\n    if (this.dialog_.hasAttribute('open') && document.body.contains(this.dialog_)) { return; }\n    this.downgradeModal();\n  },\n\n  /**\n   * Remove this dialog from the modal top layer, leaving it as a non-modal.\n   */\n  downgradeModal: function() {\n    if (!this.openAsModal_) { return; }\n    this.openAsModal_ = false;\n    this.dialog_.style.zIndex = '';\n\n    // This won't match the native <dialog> exactly because if the user set top on a centered\n    // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n    // possible to polyfill this perfectly.\n    if (this.replacedStyleTop_) {\n      this.dialog_.style.top = '';\n      this.replacedStyleTop_ = false;\n    }\n\n    // Clear the backdrop and remove from the manager.\n    this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n    dialogPolyfill.dm.removeDialog(this);\n  },\n\n  /**\n   * @param {boolean} value whether to open or close this dialog\n   */\n  setOpen: function(value) {\n    if (value) {\n      this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n    } else {\n      this.dialog_.removeAttribute('open');\n      this.maybeHideModal();  // nb. redundant with MutationObserver\n    }\n  },\n\n  /**\n   * Handles clicks on the fake .backdrop element, redirecting them as if\n   * they were on the dialog itself.\n   *\n   * @param {!Event} e to redirect\n   */\n  backdropClick_: function(e) {\n    if (!this.dialog_.hasAttribute('tabindex')) {\n      // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n      // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n      // would not be needed - clicks would move the implicit cursor there.\n      var fake = document.createElement('div');\n      this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n      fake.tabIndex = -1;\n      fake.focus();\n      this.dialog_.removeChild(fake);\n    } else {\n      this.dialog_.focus();\n    }\n\n    var redirectedEvent = document.createEvent('MouseEvents');\n    redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n        e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n        e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n    this.dialog_.dispatchEvent(redirectedEvent);\n    e.stopPropagation();\n  },\n\n  /**\n   * Focuses on the first focusable element within the dialog. This will always blur the current\n   * focus, even if nothing within the dialog is found.\n   */\n  focus_: function() {\n    // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n    var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n    if (!target && this.dialog_.tabIndex >= 0) {\n      target = this.dialog_;\n    }\n    if (!target) {\n      // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n      // alternative involves stepping through and trying to focus everything.\n      var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n      var query = opts.map(function(el) {\n        return el + ':not([disabled])';\n      });\n      // TODO(samthor): tabindex values that are not numeric are not focusable.\n      query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])');  // tabindex != \"\", not disabled\n      target = this.dialog_.querySelector(query.join(', '));\n    }\n    safeBlur(document.activeElement);\n    target && target.focus();\n  },\n\n  /**\n   * Sets the zIndex for the backdrop and dialog.\n   *\n   * @param {number} dialogZ\n   * @param {number} backdropZ\n   */\n  updateZIndex: function(dialogZ, backdropZ) {\n    if (dialogZ < backdropZ) {\n      throw new Error('dialogZ should never be < backdropZ');\n    }\n    this.dialog_.style.zIndex = dialogZ;\n    this.backdrop_.style.zIndex = backdropZ;\n  },\n\n  /**\n   * Shows the dialog. If the dialog is already open, this does nothing.\n   */\n  show: function() {\n    if (!this.dialog_.open) {\n      this.setOpen(true);\n      this.focus_();\n    }\n  },\n\n  /**\n   * Show this dialog modally.\n   */\n  showModal: function() {\n    if (this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n    }\n    if (!document.body.contains(this.dialog_)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n    }\n    if (!dialogPolyfill.dm.pushDialog(this)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n    }\n\n    if (createsStackingContext(this.dialog_.parentElement)) {\n      console.warn('A dialog is being shown inside a stacking context. ' +\n          'This may cause it to be unusable. For more information, see this link: ' +\n          'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n    }\n\n    this.setOpen(true);\n    this.openAsModal_ = true;\n\n    // Optionally center vertically, relative to the current viewport.\n    if (dialogPolyfill.needsCentering(this.dialog_)) {\n      dialogPolyfill.reposition(this.dialog_);\n      this.replacedStyleTop_ = true;\n    } else {\n      this.replacedStyleTop_ = false;\n    }\n\n    // Insert backdrop.\n    this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n    // Focus on whatever inside the dialog.\n    this.focus_();\n  },\n\n  /**\n   * Closes this HTMLDialogElement. This is optional vs clearing the open\n   * attribute, however this fires a 'close' event.\n   *\n   * @param {string=} opt_returnValue to use as the returnValue\n   */\n  close: function(opt_returnValue) {\n    if (!this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n    }\n    this.setOpen(false);\n\n    // Leave returnValue untouched in case it was set directly on the element\n    if (opt_returnValue !== undefined) {\n      this.dialog_.returnValue = opt_returnValue;\n    }\n\n    // Triggering \"close\" event for any attached listeners on the <dialog>.\n    var closeEvent = new supportCustomEvent('close', {\n      bubbles: false,\n      cancelable: false\n    });\n    this.dialog_.dispatchEvent(closeEvent);\n  }\n\n};\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n  var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n  var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n  element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n  for (var i = 0; i < document.styleSheets.length; ++i) {\n    var styleSheet = document.styleSheets[i];\n    var cssRules = null;\n    // Some browsers throw on cssRules.\n    try {\n      cssRules = styleSheet.cssRules;\n    } catch (e) {}\n    if (!cssRules) { continue; }\n    for (var j = 0; j < cssRules.length; ++j) {\n      var rule = cssRules[j];\n      var selectedNodes = null;\n      // Ignore errors on invalid selector texts.\n      try {\n        selectedNodes = document.querySelectorAll(rule.selectorText);\n      } catch(e) {}\n      if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n        continue;\n      }\n      var cssTop = rule.style.getPropertyValue('top');\n      var cssBottom = rule.style.getPropertyValue('bottom');\n      if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n  var computedStyle = window.getComputedStyle(dialog);\n  if (computedStyle.position !== 'absolute') {\n    return false;\n  }\n\n  // We must determine whether the top/bottom specified value is non-auto.  In\n  // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n  // Firefox returns the used value. So we do this crazy thing instead: check\n  // the inline style and then go through CSS rules.\n  if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n      (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n    return false;\n  }\n  return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n  if (window.HTMLDialogElement || element.showModal) {\n    console.warn('This browser already supports <dialog>, the polyfill ' +\n        'may not work correctly', element);\n  }\n  if (element.localName !== 'dialog') {\n    throw new Error('Failed to register dialog: The element is not a dialog.');\n  }\n  new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n  if (!element.showModal) {\n    dialogPolyfill.forceRegisterDialog(element);\n  }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n  /** @type {!Array<!dialogPolyfillInfo>} */\n  this.pendingDialogStack = [];\n\n  var checkDOM = this.checkDOM_.bind(this);\n\n  // The overlay is used to simulate how a modal dialog blocks the document.\n  // The blocking dialog is positioned on top of the overlay, and the rest of\n  // the dialogs on the pending dialog stack are positioned below it. In the\n  // actual implementation, the modal dialog stacking is controlled by the\n  // top layer, where z-index has no effect.\n  this.overlay = document.createElement('div');\n  this.overlay.className = '_dialog_overlay';\n  this.overlay.addEventListener('click', function(e) {\n    this.forwardTab_ = undefined;\n    e.stopPropagation();\n    checkDOM([]);  // sanity-check DOM\n  }.bind(this));\n\n  this.handleKey_ = this.handleKey_.bind(this);\n  this.handleFocus_ = this.handleFocus_.bind(this);\n\n  this.zIndexLow_ = 100000;\n  this.zIndexHigh_ = 100000 + 150;\n\n  this.forwardTab_ = undefined;\n\n  if ('MutationObserver' in window) {\n    this.mo_ = new MutationObserver(function(records) {\n      var removed = [];\n      records.forEach(function(rec) {\n        for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n          if (!(c instanceof Element)) {\n            continue;\n          } else if (c.localName === 'dialog') {\n            removed.push(c);\n          }\n          removed = removed.concat(c.querySelectorAll('dialog'));\n        }\n      });\n      removed.length && checkDOM(removed);\n    });\n  }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n  document.documentElement.addEventListener('focus', this.handleFocus_, true);\n  document.addEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n  document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n  document.removeEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n  var zIndex = this.zIndexHigh_;\n\n  for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n    dpi.updateZIndex(--zIndex, --zIndex);\n    if (i === 0) {\n      this.overlay.style.zIndex = --zIndex;\n    }\n  }\n\n  // Make the overlay a sibling of the dialog itself.\n  var last = this.pendingDialogStack[0];\n  if (last) {\n    var p = last.dialog.parentNode || document.body;\n    p.appendChild(this.overlay);\n  } else if (this.overlay.parentNode) {\n    this.overlay.parentNode.removeChild(this.overlay);\n  }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n  while (candidate = findNearestDialog(candidate)) {\n    for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n      if (dpi.dialog === candidate) {\n        return i === 0;  // only valid if top-most\n      }\n    }\n    candidate = candidate.parentElement;\n  }\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n  if (this.containedByTopDialog_(event.target)) { return; }\n\n  if (document.activeElement === document.documentElement) { return; }\n\n  event.preventDefault();\n  event.stopPropagation();\n  safeBlur(/** @type {Element} */ (event.target));\n\n  if (this.forwardTab_ === undefined) { return; }  // move focus only from a tab key\n\n  var dpi = this.pendingDialogStack[0];\n  var dialog = dpi.dialog;\n  var position = dialog.compareDocumentPosition(event.target);\n  if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n    if (this.forwardTab_) {\n      // forward\n      dpi.focus_();\n    } else if (event.target !== document.documentElement) {\n      // backwards if we're not already focused on <html>\n      document.documentElement.focus();\n    }\n  }\n\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n  this.forwardTab_ = undefined;\n  if (event.keyCode === 27) {\n    event.preventDefault();\n    event.stopPropagation();\n    var cancelEvent = new supportCustomEvent('cancel', {\n      bubbles: false,\n      cancelable: true\n    });\n    var dpi = this.pendingDialogStack[0];\n    if (dpi && dpi.dialog.dispatchEvent(cancelEvent)) {\n      dpi.dialog.close();\n    }\n  } else if (event.keyCode === 9) {\n    this.forwardTab_ = !event.shiftKey;\n  }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array<!HTMLDialogElement>} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n  // This operates on a clone because it may cause it to change. Each change also calls\n  // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n  // at a time?!\n  var clone = this.pendingDialogStack.slice();\n  clone.forEach(function(dpi) {\n    if (removed.indexOf(dpi.dialog) !== -1) {\n      dpi.downgradeModal();\n    } else {\n      dpi.maybeHideModal();\n    }\n  });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n  var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n  if (this.pendingDialogStack.length >= allowed) {\n    return false;\n  }\n  if (this.pendingDialogStack.unshift(dpi) === 1) {\n    this.blockDocument();\n  }\n  this.updateStacking();\n  return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n  var index = this.pendingDialogStack.indexOf(dpi);\n  if (index === -1) { return; }\n\n  this.pendingDialogStack.splice(index, 1);\n  if (this.pendingDialogStack.length === 0) {\n    this.unblockDocument();\n  }\n  this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.useValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with <form method=\"dialog\">.\n */\nif (window.HTMLDialogElement === undefined) {\n\n  /**\n   * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n   * one that returns the correct value.\n   */\n  var testForm = document.createElement('form');\n  testForm.setAttribute('method', 'dialog');\n  if (testForm.method !== 'dialog') {\n    var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n    if (methodDescriptor) {\n      // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n      // and don't bother to update the element.\n      var realGet = methodDescriptor.get;\n      methodDescriptor.get = function() {\n        if (isFormMethodDialog(this)) {\n          return 'dialog';\n        }\n        return realGet.call(this);\n      };\n      var realSet = methodDescriptor.set;\n      methodDescriptor.set = function(v) {\n        if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n          return this.setAttribute('method', v);\n        }\n        return realSet.call(this, v);\n      };\n      Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n    }\n  }\n\n  /**\n   * Global 'click' handler, to capture the <input type=\"submit\"> or <button> element which has\n   * submitted a <form method=\"dialog\">. Needed as Safari and others don't report this inside\n   * document.activeElement.\n   */\n  document.addEventListener('click', function(ev) {\n    dialogPolyfill.formSubmitter = null;\n    dialogPolyfill.useValue = null;\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var target = /** @type {Element} */ (ev.target);\n    if (!target || !isFormMethodDialog(target.form)) { return; }\n\n    var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);\n    if (!valid) {\n      if (!(target.localName === 'input' && target.type === 'image')) { return; }\n      // this is a <input type=\"image\">, which can submit forms\n      dialogPolyfill.useValue = ev.offsetX + ',' + ev.offsetY;\n    }\n\n    var dialog = findNearestDialog(target);\n    if (!dialog) { return; }\n\n    dialogPolyfill.formSubmitter = target;\n\n  }, false);\n\n  /**\n   * Replace the native HTMLFormElement.submit() method, as it won't fire the\n   * submit event and give us a chance to respond.\n   */\n  var nativeFormSubmit = HTMLFormElement.prototype.submit;\n  var replacementFormSubmit = function () {\n    if (!isFormMethodDialog(this)) {\n      return nativeFormSubmit.call(this);\n    }\n    var dialog = findNearestDialog(this);\n    dialog && dialog.close();\n  };\n  HTMLFormElement.prototype.submit = replacementFormSubmit;\n\n  /**\n   * Global form 'dialog' method handler. Closes a dialog correctly on submit\n   * and possibly sets its return value.\n   */\n  document.addEventListener('submit', function(ev) {\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var form = /** @type {HTMLFormElement} */ (ev.target);\n    if (!isFormMethodDialog(form)) { return; }\n    ev.preventDefault();\n\n    var dialog = findNearestDialog(form);\n    if (!dialog) { return; }\n\n    // Forms can only be submitted via .submit() or a click (?), but anyway: sanity-check that\n    // the submitter is correct before using its value as .returnValue.\n    var s = dialogPolyfill.formSubmitter;\n    if (s && s.form === form) {\n      dialog.close(dialogPolyfill.useValue || s.value);\n    } else {\n      dialog.close();\n    }\n    dialogPolyfill.formSubmitter = null;\n\n  }, false);\n}\n\nexport default dialogPolyfill;\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nexport function registerHeaderListeners(): void {\n  const header = document.querySelector('.js-header');\n  const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n  menuButtons.forEach(button => {\n    button.addEventListener('click', e => {\n      e.preventDefault();\n      header?.classList.toggle('is-active');\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n\n  const scrim = document.querySelector('.js-scrim');\n  scrim?.addEventListener('click', e => {\n    e.preventDefault();\n    header?.classList.remove('is-active');\n    menuButtons.forEach(button => {\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n}\n\nexport function registerSearchFormListeners(): void {\n  const searchForm = document.querySelector('.js-searchForm');\n  const expandSearch = document.querySelector('.js-expandSearch');\n  const input = searchForm?.querySelector('input');\n  const headerLogo = document.querySelector('.js-headerLogo');\n  const menuButton = document.querySelector('.js-headerMenuButton');\n  expandSearch?.addEventListener('click', () => {\n    searchForm?.classList.add('go-SearchForm--expanded');\n    headerLogo?.classList.add('go-Header-logo--hidden');\n    menuButton?.classList.add('go-Header-navOpen--hidden');\n    input?.focus();\n  });\n  document?.addEventListener('click', e => {\n    if (!searchForm?.contains(e.target as Node)) {\n      searchForm?.classList.remove('go-SearchForm--expanded');\n      headerLogo?.classList.remove('go-Header-logo--hidden');\n      menuButton?.classList.remove('go-Header-navOpen--hidden');\n    }\n  });\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Carousel Controller adds event listeners, accessibilty enhancements, and\n * control elements to a carousel component.\n */\nexport class CarouselController {\n  /**\n   * slides is a collection of slides in the carousel.\n   */\n  private slides: HTMLLIElement[];\n  /**\n   * dots is a collection of dot navigation controls, added to the carousel\n   * by this controller.\n   */\n  private dots: HTMLElement[];\n  /**\n   * liveRegion is a visually hidden element that notifies assitive devices\n   * of visual changes to the carousel. They are added to the carousel by\n   * this controller.\n   */\n  private liveRegion: HTMLElement;\n  /**\n   * activeIndex is the 0-index of the currently active slide.\n   */\n  private activeIndex: number;\n\n  constructor(private el: HTMLElement) {\n    this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));\n    this.dots = [];\n    this.liveRegion = document.createElement('div');\n    this.activeIndex = Number(el.getAttribute('data-slide-index') ?? 0);\n\n    this.initSlides();\n    this.initArrows();\n    this.initDots();\n    this.initLiveRegion();\n  }\n\n  private initSlides() {\n    for (const [i, v] of this.slides.entries()) {\n      if (i === this.activeIndex) continue;\n      v.setAttribute('aria-hidden', 'true');\n    }\n  }\n\n  private initArrows() {\n    const arrows = document.createElement('ul');\n    arrows.classList.add('go-Carousel-arrows');\n    arrows.innerHTML = `\n      <li>\n        <button class=\"go-Carousel-prevSlide\" aria-label=\"Go to previous slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_left_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n      <li>\n        <button class=\"go-Carousel-nextSlide\" aria-label=\"Go to next slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_right_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n    `;\n    arrows\n      .querySelector('.go-Carousel-prevSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex - 1));\n    arrows\n      .querySelector('.go-Carousel-nextSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex + 1));\n    this.el.append(arrows);\n  }\n\n  private initDots() {\n    const dots = document.createElement('ul');\n    dots.classList.add('go-Carousel-dots');\n    for (let i = 0; i < this.slides.length; i++) {\n      const li = document.createElement('li');\n      const button = document.createElement('button');\n      button.classList.add('go-Carousel-dot');\n      if (i === this.activeIndex) {\n        button.classList.add('go-Carousel-dot--active');\n      }\n      button.innerHTML = `<span class=\"go-Carousel-obscured\">Slide ${i + 1}</span>`;\n      button.addEventListener('click', () => this.setActive(i));\n      li.append(button);\n      dots.append(li);\n      this.dots.push(button);\n    }\n    this.el.append(dots);\n  }\n\n  private initLiveRegion() {\n    this.liveRegion.setAttribute('aria-live', 'polite');\n    this.liveRegion.setAttribute('aria-atomic', 'true');\n    this.liveRegion.setAttribute('class', 'go-Carousel-obscured');\n    this.liveRegion.textContent = `Slide ${this.activeIndex + 1} of ${this.slides.length}`;\n    this.el.appendChild(this.liveRegion);\n  }\n\n  private setActive = (index: number) => {\n    this.activeIndex = (index + this.slides.length) % this.slides.length;\n    this.el.setAttribute('data-slide-index', String(this.activeIndex));\n    for (const d of this.dots) {\n      d.classList.remove('go-Carousel-dot--active');\n    }\n    this.dots[this.activeIndex].classList.add('go-Carousel-dot--active');\n    for (const s of this.slides) {\n      s.setAttribute('aria-hidden', 'true');\n    }\n    this.slides[this.activeIndex].removeAttribute('aria-hidden');\n    this.liveRegion.textContent = 'Slide ' + (this.activeIndex + 1) + ' of ' + this.slides.length;\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This class decorates an element to copy arbitrary data attached via a data-\n * attribute to the clipboard.\n */\nexport class ClipboardController {\n  /**\n   * The data to be copied to the clipboard.\n   */\n  private data: string;\n\n  /**\n   * @param el The element that will trigger copying text to the clipboard. The text is\n   * expected to be within its data-to-copy attribute.\n   */\n  constructor(private el: HTMLButtonElement) {\n    this.data = el.dataset['toCopy'] ?? el.innerText;\n    // if data-to-copy is empty and the button is part of an input group\n    // capture the value of the input.\n    if (!this.data && el.parentElement?.classList.contains('go-InputGroup')) {\n      this.data = (this.data || el.parentElement?.querySelector('input')?.value) ?? '';\n    }\n    el.addEventListener('click', e => this.handleCopyClick(e));\n  }\n\n  /**\n   * Handles when the primary element is clicked.\n   */\n  handleCopyClick(e: MouseEvent): void {\n    e.preventDefault();\n    const TOOLTIP_SHOW_DURATION_MS = 1000;\n\n    // This API is not available on iOS.\n    if (!navigator.clipboard) {\n      this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      return;\n    }\n    navigator.clipboard\n      .writeText(this.data)\n      .then(() => {\n        this.showTooltipText('Copied!', TOOLTIP_SHOW_DURATION_MS);\n      })\n      .catch(() => {\n        this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      });\n  }\n\n  /**\n   * Shows the given text in a tooltip for a specified amount of time, in milliseconds.\n   */\n  showTooltipText(text: string, durationMs: number): void {\n    this.el.setAttribute('data-tooltip', text);\n    setTimeout(() => this.el.setAttribute('data-tooltip', ''), durationMs);\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ToolTipController handles closing tooltips on external clicks.\n */\nexport class ToolTipController {\n  constructor(private el: HTMLDetailsElement) {\n    document.addEventListener('click', e => {\n      const insideTooltip = this.el.contains(e.target as Element);\n      if (!insideTooltip) {\n        this.el.removeAttribute('open');\n      }\n    });\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { TreeNavController } from './tree.js';\n\nexport class SelectNavController {\n  constructor(private el: Element) {\n    this.el.addEventListener('change', e => {\n      const target = e.target as HTMLSelectElement;\n      let href = target.value;\n      if (!target.value.startsWith('/')) {\n        href = '/' + href;\n      }\n      window.location.href = href;\n    });\n  }\n}\n\nexport function makeSelectNav(tree: TreeNavController): HTMLLabelElement {\n  const label = document.createElement('label');\n  label.classList.add('go-Label');\n  label.setAttribute('aria-label', 'Menu');\n  const select = document.createElement('select');\n  select.classList.add('go-Select', 'js-selectNav');\n  label.appendChild(select);\n  const outline = document.createElement('optgroup');\n  outline.label = 'Outline';\n  select.appendChild(outline);\n  const groupMap: Record<string, HTMLOptGroupElement> = {};\n  let group: HTMLOptGroupElement;\n  for (const t of tree.treeitems) {\n    if (Number(t.depth) > 4) continue;\n    if (t.groupTreeitem) {\n      group = groupMap[t.groupTreeitem.label];\n      if (!group) {\n        group = groupMap[t.groupTreeitem.label] = document.createElement('optgroup');\n        group.label = t.groupTreeitem.label;\n        select.appendChild(group);\n      }\n    } else {\n      group = outline;\n    }\n    const o = document.createElement('option');\n    o.label = t.label;\n    o.textContent = t.label;\n    o.value = (t.el as HTMLAnchorElement).href.replace(window.location.origin, '').replace('/', '');\n    group.appendChild(o);\n  }\n  tree.addObserver(t => {\n    const hash = (t.el as HTMLAnchorElement).hash;\n    const value = select.querySelector<HTMLOptionElement>(`[value$=\"${hash}\"]`)?.value;\n    if (value) {\n      select.value = value;\n    }\n  }, 50);\n  return label;\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ModalController registers a dialog element with the polyfill if\n * necessary for the current browser, add adds event listeners to\n * close and open modals.\n */\nexport class ModalController {\n  constructor(private el: HTMLDialogElement) {\n    // Only load the dialog polyfill if necessary for the environment.\n    if (!window.HTMLDialogElement && !el.showModal) {\n      import('../../../third_party/dialog-polyfill/dialog-polyfill.esm.js').then(\n        ({ default: polyfill }) => {\n          polyfill.registerDialog(el);\n        }\n      );\n    }\n    const id = el.id;\n    const button = document.querySelector<HTMLButtonElement>(`[aria-controls=\"${id}\"]`);\n    if (button) {\n      button.addEventListener('click', () => {\n        if (this.el.showModal) {\n          this.el.showModal();\n        } else {\n          this.el.open = true;\n        }\n        el.querySelector('input')?.focus();\n      });\n    }\n    for (const close of this.el.querySelectorAll<HTMLButtonElement>('[data-modal-close]')) {\n      close.addEventListener('click', () => {\n        if (this.el.close) {\n          this.el.close();\n        } else {\n          this.el.open = false;\n        }\n      });\n    }\n  }\n}\n", "interface TagManagerEvent {\n  /**\n   * event is the name of the event, used to filter events in\n   * Google Analytics.\n   */\n  event: string;\n\n  /**\n   * event_category is a name that you supply as a way to group objects\n   * that to analyze. Typically, you will use the same category name\n   * multiple times over related UI elements (buttons, links, etc).\n   */\n  event_category?: string;\n\n  /**\n   * event_action is used to name the type of event or interaction you\n   * want to measure for a particular web object. For example, with a\n   * single \"form\" category, you can analyze a number of specific events\n   * with this parameter, such as: form entered, form submitted.\n   */\n  event_action?: string;\n\n  /**\n   * event_label provide additional information for events that you want\n   * to analyze, such as the text label of a link.\n   */\n  event_label?: string;\n\n  /**\n   * gtm.start is used to initialize Google Tag Manager.\n   */\n  'gtm.start'?: number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare global {\n  interface Window {\n    dataLayer?: (TagManagerEvent | VoidFunction)[];\n    ga?: unknown;\n  }\n}\n\n/**\n * track sends events to Google Tag Manager.\n */\nexport function track(\n  event: string | TagManagerEvent,\n  category?: string,\n  action?: string,\n  label?: string\n): void {\n  window.dataLayer ??= [];\n  if (typeof event === 'string') {\n    window.dataLayer.push({\n      event,\n      event_category: category,\n      event_action: action,\n      event_label: label,\n    });\n  } else {\n    window.dataLayer.push(event);\n  }\n}\n\n/**\n * func adds functions to run sequentionally after\n * Google Tag Manager is ready.\n */\nexport function func(fn: () => void): void {\n  window.dataLayer ??= [];\n  window.dataLayer.push(fn);\n}\n", "/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { track } from '../analytics/analytics';\n\n/**\n * Options are keyhandler callback options.\n */\ninterface Options {\n  /**\n   * target is the element the key event should filter on. The\n   * default target is the document.\n   */\n  target?: Element;\n\n  /**\n   * withMeta specifies if the event callback should fire when\n   * the key is pressed with a meta key (ctrl, alt, etc). By\n   * default meta keypresses are ignored.\n   */\n  withMeta?: boolean;\n}\n\n/**\n * KeyHandler is the config for a keyboard event callback.\n */\ninterface KeyHandler extends Options {\n  description: string;\n  callback: (e: KeyboardEvent) => void;\n}\n\n/**\n * KeyboardController controls event callbacks for sitewide\n * keyboard events. Multiple callbacks can be registered for\n * a single key and by default the controller ignores events\n * for text input targets.\n */\nclass KeyboardController {\n  handlers: Record<string, Set<KeyHandler>>;\n\n  constructor() {\n    this.handlers = {};\n    document.addEventListener('keydown', e => this.handleKeyPress(e));\n  }\n\n  /**\n   * on registers keyboard event callbacks.\n   * @param key the key to register.\n   * @param description name of the event.\n   * @param callback event callback.\n   * @param options set target and withMeta options to override the default behaviors.\n   */\n  on(key: string, description: string, callback: (e: KeyboardEvent) => void, options?: Options) {\n    this.handlers[key] ??= new Set();\n    this.handlers[key].add({ description, callback, ...options });\n    return this;\n  }\n\n  private handleKeyPress(e: KeyboardEvent) {\n    for (const handler of this.handlers[e.key.toLowerCase()] ?? new Set()) {\n      if (handler.target && handler.target !== e.target) {\n        return;\n      }\n      const t = e.target as HTMLElement | null;\n      if (\n        !handler.target &&\n        (t?.tagName === 'INPUT' || t?.tagName === 'SELECT' || t?.tagName === 'TEXTAREA')\n      ) {\n        return;\n      }\n      if (t?.isContentEditable) {\n        return;\n      }\n      if (\n        (handler.withMeta && !(e.ctrlKey || e.metaKey)) ||\n        (!handler.withMeta && (e.ctrlKey || e.metaKey))\n      ) {\n        return;\n      }\n      track('keypress', 'hotkeys', `${e.key} pressed`, handler.description);\n      handler.callback(e);\n    }\n  }\n}\n\nexport const keyboard = new KeyboardController();\n", "/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n// This file implements the behavior of the \"jump to symbol\" dialog for Go\n// package documentation, as well as the simple dialog that displays keyboard\n// shortcuts.\n\n// The DOM for the dialogs is at the bottom of static/frontend/unit/main/_modals.tmpl.\n// The CSS is in static/frontend/unit/main/_modals.css.\n\n// The dialog is activated by pressing the 'f' key. It presents a list\n// (#JumpDialog-list) of all Go symbols displayed in the documentation.\n// Entering text in the dialog's text box (#JumpDialog-filter) restricts the\n// list to symbols containing the text. Clicking on an symbol jumps to\n// its documentation.\n\n// This code is based on\n// https://go.googlesource.com/gddo/+/refs/heads/master/gddo-server/assets/site.js.\n// It was modified to remove the dependence on jquery and bootstrap.\n\nimport { keyboard } from '../keyboard/keyboard';\n\nconst jumpDialog = document.querySelector<HTMLDialogElement>('.JumpDialog');\nconst jumpBody = jumpDialog?.querySelector<HTMLDivElement>('.JumpDialog-body');\nconst jumpList = jumpDialog?.querySelector<HTMLDivElement>('.JumpDialog-list');\nconst jumpFilter = jumpDialog?.querySelector<HTMLInputElement>('.JumpDialog-input');\nconst doc = document.querySelector<HTMLDivElement>('.js-documentation');\n\ninterface JumpListItem {\n  link: HTMLAnchorElement;\n  name: string;\n  kind: string;\n  lower: string;\n}\n\nlet jumpListItems: JumpListItem[] | undefined; // All the symbols in the doc; computed only once.\n\n// collectJumpListItems returns a list of items, one for each symbol in the\n// documentation on the current page.\n//\n// It uses the data-kind attribute generated in the documentation HTML to find\n// the symbols and their id attributes.\n//\n// If there are no data-kind attributes, then we have older doc; fall back to\n// a less precise method.\nfunction collectJumpListItems() {\n  const items = [];\n  if (!doc) return;\n  for (const el of doc.querySelectorAll('[data-kind]')) {\n    items.push(newJumpListItem(el));\n  }\n\n  // Clicking on any of the links closes the dialog.\n  for (const item of items) {\n    item.link.addEventListener('click', function () {\n      jumpDialog?.close();\n    });\n  }\n  // Sort case-insensitively by symbol name.\n  items.sort(function (a, b) {\n    return a.lower.localeCompare(b.lower);\n  });\n  return items;\n}\n\n// newJumpListItem creates a new item for the DOM element el.\n// An item is an object with:\n// - name: the element's id (which is the symbol name)\n// - kind: the element's kind (function, variable, etc.),\n// - link: a link ('a' tag) to the element\n// - lower: the name in lower case, just for sorting\nfunction newJumpListItem(el: Element): JumpListItem {\n  const a = document.createElement('a');\n  const name = el.getAttribute('id');\n  a.setAttribute('href', '#' + name);\n  a.setAttribute('tabindex', '-1');\n  a.setAttribute('data-gtmc', 'jump to link');\n  const kind = el.getAttribute('data-kind');\n  return {\n    link: a,\n    name: name ?? '',\n    kind: kind ?? '',\n    lower: name?.toLowerCase() ?? '', // for sorting\n  };\n}\n\nlet lastFilterValue: string; // The last contents of the filter text box.\nlet activeJumpItem = -1; // The index of the currently active item in the list.\n\n// updateJumpList sets the elements of the dialog list to\n// everything whose name contains filter.\nfunction updateJumpList(filter: string) {\n  lastFilterValue = filter;\n  if (!jumpListItems) {\n    jumpListItems = collectJumpListItems();\n  }\n  setActiveJumpItem(-1);\n\n  // Remove all children from list.\n  while (jumpList?.firstChild) {\n    jumpList.firstChild.remove();\n  }\n\n  if (filter) {\n    // A filter is set. We treat the filter as a substring that can appear in\n    // an item name (case insensitive), and find the following matches - in\n    // order of priority:\n    //\n    // 1. Exact matches (the filter matches the item's name exactly)\n    // 2. Prefix matches (the item's name starts with filter)\n    // 3. Infix matches (the filter is a substring of the item's name)\n    const filterLowerCase = filter.toLowerCase();\n\n    const exactMatches = [];\n    const prefixMatches = [];\n    const infixMatches = [];\n\n    // makeLinkHtml creates the link name HTML for a list item. item is the DOM\n    // item. item.name.substr(boldStart, boldEnd) will be bolded.\n    const makeLinkHtml = (item: JumpListItem, boldStart: number, boldEnd: number) => {\n      return (\n        item.name.substring(0, boldStart) +\n        '<b>' +\n        item.name.substring(boldStart, boldEnd) +\n        '</b>' +\n        item.name.substring(boldEnd)\n      );\n    };\n\n    for (const item of jumpListItems ?? []) {\n      const nameLowerCase = item.name.toLowerCase();\n\n      if (nameLowerCase === filterLowerCase) {\n        item.link.innerHTML = makeLinkHtml(item, 0, item.name.length);\n        exactMatches.push(item);\n      } else if (nameLowerCase.startsWith(filterLowerCase)) {\n        item.link.innerHTML = makeLinkHtml(item, 0, filter.length);\n        prefixMatches.push(item);\n      } else {\n        const index = nameLowerCase.indexOf(filterLowerCase);\n        if (index > -1) {\n          item.link.innerHTML = makeLinkHtml(item, index, index + filter.length);\n          infixMatches.push(item);\n        }\n      }\n    }\n\n    for (const item of exactMatches.concat(prefixMatches).concat(infixMatches)) {\n      jumpList?.appendChild(item.link);\n    }\n  } else {\n    if (!jumpListItems || jumpListItems.length === 0) {\n      const msg = document.createElement('i');\n      msg.innerHTML = 'There are no symbols on this page.';\n      jumpList?.appendChild(msg);\n    }\n    // No filter set; display all items in their existing order.\n    for (const item of jumpListItems ?? []) {\n      item.link.innerHTML = item.name + ' <i>' + item.kind + '</i>';\n      jumpList?.appendChild(item.link);\n    }\n  }\n\n  if (jumpBody) {\n    jumpBody.scrollTop = 0;\n  }\n  if (jumpListItems?.length && jumpList && jumpList.children.length > 0) {\n    setActiveJumpItem(0);\n  }\n}\n\n// Set the active jump item to n.\nfunction setActiveJumpItem(n: number) {\n  const cs = jumpList?.children as HTMLCollectionOf<HTMLElement> | null | undefined;\n  if (!cs || !jumpBody) {\n    return;\n  }\n  if (activeJumpItem >= 0) {\n    cs[activeJumpItem].classList.remove('JumpDialog-active');\n  }\n  if (n >= cs.length) {\n    n = cs.length - 1;\n  }\n  if (n >= 0) {\n    cs[n].classList.add('JumpDialog-active');\n\n    // Scroll so the active item is visible.\n    // For some reason cs[n].scrollIntoView() doesn't behave as I'd expect:\n    // it moves the entire dialog box in the viewport.\n\n    // Get the top and bottom of the active item relative to jumpBody.\n    const activeTop = cs[n].offsetTop - cs[0].offsetTop;\n    const activeBottom = activeTop + cs[n].clientHeight;\n    if (activeTop < jumpBody.scrollTop) {\n      // Off the top; scroll up.\n      jumpBody.scrollTop = activeTop;\n    } else if (activeBottom > jumpBody.scrollTop + jumpBody.clientHeight) {\n      // Off the bottom; scroll down.\n      jumpBody.scrollTop = activeBottom - jumpBody.clientHeight;\n    }\n  }\n  activeJumpItem = n;\n}\n\n// Increment the activeJumpItem by delta.\nfunction incActiveJumpItem(delta: number) {\n  if (activeJumpItem < 0) {\n    return;\n  }\n  let n = activeJumpItem + delta;\n  if (n < 0) {\n    n = 0;\n  }\n  setActiveJumpItem(n);\n}\n\nexport function initModals(): void {\n  // Pressing a key in the filter updates the list (if the filter actually changed).\n  jumpFilter?.addEventListener('keyup', function () {\n    if (jumpFilter.value.toUpperCase() != lastFilterValue.toUpperCase()) {\n      updateJumpList(jumpFilter.value);\n    }\n  });\n\n  // Pressing enter in the filter selects the first element in the list.\n  jumpFilter?.addEventListener('keydown', function (event) {\n    const upArrow = 38;\n    const downArrow = 40;\n    const enterKey = 13;\n    switch (event.which) {\n      case upArrow:\n        incActiveJumpItem(-1);\n        event.preventDefault();\n        break;\n      case downArrow:\n        incActiveJumpItem(1);\n        event.preventDefault();\n        break;\n      case enterKey:\n        if (activeJumpItem >= 0) {\n          if (jumpList) {\n            (jumpList.children[activeJumpItem] as HTMLElement).click();\n            event.preventDefault();\n          }\n        }\n        break;\n    }\n  });\n\n  const shortcutsDialog = document.querySelector<HTMLDialogElement>('.ShortcutsDialog');\n\n  // - Pressing 'f' or 'F' opens the jump-to-symbol dialog.\n  // - Pressing '?' opens up the shortcut dialog.\n  // Ignore a keypress if a dialog is already open, or if it is pressed on a\n  // component that wants to consume it.\n  keyboard\n    .on('f', 'open jump to modal', e => {\n      if (jumpDialog?.open || shortcutsDialog?.open) {\n        return;\n      }\n      e.preventDefault();\n      if (jumpFilter) {\n        jumpFilter.value = '';\n      }\n      jumpDialog?.showModal();\n      jumpFilter?.focus();\n      updateJumpList('');\n    })\n    .on('?', 'open shortcuts modal', () => {\n      if (jumpDialog?.open || shortcutsDialog?.open) {\n        return;\n      }\n      shortcutsDialog?.showModal();\n    });\n\n  const jumpOutlineInput = document.querySelector('.js-jumpToInput');\n  if (jumpOutlineInput) {\n    jumpOutlineInput.addEventListener('click', () => {\n      if (jumpFilter) {\n        jumpFilter.value = '';\n      }\n      updateJumpList('');\n    });\n  }\n\n  document.querySelector('.js-openShortcuts')?.addEventListener('click', () => {\n    shortcutsDialog?.showModal();\n  });\n}\n", "/**\n * @license\n * Copyright 2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { registerHeaderListeners, registerSearchFormListeners } from 'static/shared/header/header';\nimport { CarouselController } from 'static/shared/carousel/carousel';\nimport { ClipboardController } from 'static/shared/clipboard/clipboard';\nimport { ToolTipController } from 'static/shared/tooltip/tooltip';\nimport { SelectNavController } from 'static/shared/outline/select';\nimport { ModalController } from 'static/shared/modal/modal';\nimport { initModals } from 'static/shared/jump/jump';\n\nimport { keyboard } from 'static/shared/keyboard/keyboard';\nimport * as analytics from 'static/shared/analytics/analytics';\n\nfor (const el of document.querySelectorAll<HTMLButtonElement>('.js-clipboard')) {\n  new ClipboardController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLDialogElement>('.js-modal')) {\n  new ModalController(el);\n}\n\nfor (const t of document.querySelectorAll<HTMLDetailsElement>('.js-tooltip')) {\n  new ToolTipController(t);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-selectNav')) {\n  new SelectNavController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-carousel')) {\n  new CarouselController(el);\n}\n\nregisterHeaderListeners();\nregisterSearchFormListeners();\ninitModals();\n\n// Temporary shortcut for testing out the dark theme.\nkeyboard.on('t', 'toggle theme', () => {\n  toggleTheme();\n});\n\n// Pressing '/' focuses the search box\nkeyboard.on('/', 'focus search', e => {\n  const searchInput = Array.from(\n    document.querySelectorAll<HTMLInputElement>('.js-searchFocus')\n  ).pop();\n  // Favoring the Firefox quick find feature over search input\n  // focus. See: https://github.com/golang/go/issues/41093.\n  if (searchInput && !window.navigator.userAgent.includes('Firefox')) {\n    e.preventDefault();\n    searchInput.focus();\n  }\n});\n\n// Pressing 'y' changes the browser URL to the canonical URL\n// without triggering a reload.\nkeyboard.on('y', 'set canonical url', () => {\n  const canonicalURLPath = document.querySelector<HTMLDivElement>('.js-canonicalURLPath')?.dataset[\n    'canonicalUrlPath'\n  ];\n  if (canonicalURLPath && canonicalURLPath !== '') {\n    window.history.replaceState(null, '', canonicalURLPath);\n  }\n});\n\n/**\n * setupGoogleTagManager intializes Google Tag Manager.\n */\n(function setupGoogleTagManager() {\n  analytics.track({\n    'gtm.start': new Date().getTime(),\n    event: 'gtm.js',\n  });\n})();\n\n/**\n * removeUTMSource removes the utm_source GET parameter if present.\n * This is done using JavaScript, so that the utm_source is still\n * captured by Google Analytics.\n */\nfunction removeUTMSource() {\n  const urlParams = new URLSearchParams(window.location.search);\n  const utmSource = urlParams.get('utm_source');\n  if (utmSource !== 'gopls' && utmSource !== 'godoc' && utmSource !== 'pkggodev') {\n    return;\n  }\n\n  /** Strip the utm_source query parameter and replace the URL. **/\n  const newURL = new URL(window.location.href);\n  urlParams.delete('utm_source');\n  newURL.search = urlParams.toString();\n  window.history.replaceState(null, '', newURL.toString());\n}\n\nif (document.querySelector<HTMLElement>('.js-gtmID')?.dataset.gtmid && window.dataLayer) {\n  analytics.func(function () {\n    removeUTMSource();\n  });\n} else {\n  removeUTMSource();\n}\n\nfor (const el of document.querySelectorAll('.js-toggleTheme')) {\n  el.addEventListener('click', () => {\n    toggleTheme();\n  });\n}\n\n/**\n * toggleTheme switches the preferred color scheme between auto, light, and dark.\n */\nfunction toggleTheme() {\n  let nextTheme = 'dark';\n  const theme = document.documentElement.getAttribute('data-theme');\n  if (theme === 'dark') {\n    nextTheme = 'light';\n  } else if (theme === 'light') {\n    nextTheme = 'auto';\n  }\n  document.documentElement.setAttribute('data-theme', nextTheme);\n  document.cookie = `prefers-color-scheme=${nextTheme};path=/;max-age=31536000;`;\n}\n"],
-  "mappings": "wKAAA,+BAgBA,YAAgC,EAAI,CAClC,KAAO,GAAM,IAAO,SAAS,MAAM,CACjC,GAAI,GAAI,OAAO,iBAAiB,GAC5B,EAAU,SAAS,EAAG,EAAI,CAC5B,MAAO,CAAE,GAAE,KAAO,QAAa,EAAE,KAAO,IAG1C,GAAI,EAAE,QAAU,GACZ,EAAQ,SAAU,SAClB,EAAQ,YAAa,SACrB,EAAQ,eAAgB,WACxB,EAAQ,SAAU,SAClB,EAAQ,cAAe,SACvB,EAAE,YAAiB,WACnB,EAAE,WAAa,SACf,EAAE,0BAA4B,QAChC,MAAO,GAET,EAAK,EAAG,cAEV,MAAO,GAST,WAA2B,EAAI,CAC7B,KAAO,GAAI,CACT,GAAI,EAAG,YAAc,SACnB,MAAyC,GAE3C,EAAK,EAAG,cAEV,MAAO,MAUT,WAAkB,EAAI,CACpB,AAAI,GAAM,EAAG,MAAQ,IAAO,SAAS,MACnC,EAAG,OASP,YAAoB,EAAU,EAAM,CAClC,OAAS,GAAI,EAAG,EAA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,CACrB,GAAI,GAAY,OACV,EAAQ,SAAS,gBAAgB,aAAa,cACpD,AAAI,IAAU,OACZ,EAAY,QACH,IAAU,SACnB,GAAY,QAEd,SAAS,gBAAgB,aAAa,aAAc,GACpD,SAAS,OAAS,wBAAwB",
+  "sourcesContent": ["// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n  supportCustomEvent = function CustomEvent(event, x) {\n    x = x || {};\n    var ev = document.createEvent('CustomEvent');\n    ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n    return ev;\n  };\n  supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n  while (el && el !== document.body) {\n    var s = window.getComputedStyle(el);\n    var invalid = function(k, ok) {\n      return !(s[k] === undefined || s[k] === ok);\n    };\n\n    if (s.opacity < 1 ||\n        invalid('zIndex', 'auto') ||\n        invalid('transform', 'none') ||\n        invalid('mixBlendMode', 'normal') ||\n        invalid('filter', 'none') ||\n        invalid('perspective', 'none') ||\n        s['isolation'] === 'isolate' ||\n        s.position === 'fixed' ||\n        s.webkitOverflowScrolling === 'touch') {\n      return true;\n    }\n    el = el.parentElement;\n  }\n  return false;\n}\n\n/**\n * Finds the nearest <dialog> from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n  while (el) {\n    if (el.localName === 'dialog') {\n      return /** @type {HTMLDialogElement} */ (el);\n    }\n    el = el.parentElement;\n  }\n  return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n  if (el && el.blur && el !== document.body) {\n    el.blur();\n  }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n  for (var i = 0; i < nodeList.length; ++i) {\n    if (nodeList[i] === node) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n  if (!el || !el.hasAttribute('method')) {\n    return false;\n  }\n  return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n  this.dialog_ = dialog;\n  this.replacedStyleTop_ = false;\n  this.openAsModal_ = false;\n\n  // Set a11y role. Browsers that support dialog implicitly know this already.\n  if (!dialog.hasAttribute('role')) {\n    dialog.setAttribute('role', 'dialog');\n  }\n\n  dialog.show = this.show.bind(this);\n  dialog.showModal = this.showModal.bind(this);\n  dialog.close = this.close.bind(this);\n\n  if (!('returnValue' in dialog)) {\n    dialog.returnValue = '';\n  }\n\n  if ('MutationObserver' in window) {\n    var mo = new MutationObserver(this.maybeHideModal.bind(this));\n    mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n  } else {\n    // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n    // seem to fire even if the element was removed as part of a parent removal. Use the removed\n    // events to force downgrade (useful if removed/immediately added).\n    var removed = false;\n    var cb = function() {\n      removed ? this.downgradeModal() : this.maybeHideModal();\n      removed = false;\n    }.bind(this);\n    var timeout;\n    var delayModel = function(ev) {\n      if (ev.target !== dialog) { return; }  // not for a child element\n      var cand = 'DOMNodeRemoved';\n      removed |= (ev.type.substr(0, cand.length) === cand);\n      window.clearTimeout(timeout);\n      timeout = window.setTimeout(cb, 0);\n    };\n    ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n      dialog.addEventListener(name, delayModel);\n    });\n  }\n  // Note that the DOM is observed inside DialogManager while any dialog\n  // is being displayed as a modal, to catch modal removal from the DOM.\n\n  Object.defineProperty(dialog, 'open', {\n    set: this.setOpen.bind(this),\n    get: dialog.hasAttribute.bind(dialog, 'open')\n  });\n\n  this.backdrop_ = document.createElement('div');\n  this.backdrop_.className = 'backdrop';\n  this.backdrop_.addEventListener('click', this.backdropClick_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = {\n\n  get dialog() {\n    return this.dialog_;\n  },\n\n  /**\n   * Maybe remove this dialog from the modal top layer. This is called when\n   * a modal dialog may no longer be tenable, e.g., when the dialog is no\n   * longer open or is no longer part of the DOM.\n   */\n  maybeHideModal: function() {\n    if (this.dialog_.hasAttribute('open') && document.body.contains(this.dialog_)) { return; }\n    this.downgradeModal();\n  },\n\n  /**\n   * Remove this dialog from the modal top layer, leaving it as a non-modal.\n   */\n  downgradeModal: function() {\n    if (!this.openAsModal_) { return; }\n    this.openAsModal_ = false;\n    this.dialog_.style.zIndex = '';\n\n    // This won't match the native <dialog> exactly because if the user set top on a centered\n    // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n    // possible to polyfill this perfectly.\n    if (this.replacedStyleTop_) {\n      this.dialog_.style.top = '';\n      this.replacedStyleTop_ = false;\n    }\n\n    // Clear the backdrop and remove from the manager.\n    this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n    dialogPolyfill.dm.removeDialog(this);\n  },\n\n  /**\n   * @param {boolean} value whether to open or close this dialog\n   */\n  setOpen: function(value) {\n    if (value) {\n      this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n    } else {\n      this.dialog_.removeAttribute('open');\n      this.maybeHideModal();  // nb. redundant with MutationObserver\n    }\n  },\n\n  /**\n   * Handles clicks on the fake .backdrop element, redirecting them as if\n   * they were on the dialog itself.\n   *\n   * @param {!Event} e to redirect\n   */\n  backdropClick_: function(e) {\n    if (!this.dialog_.hasAttribute('tabindex')) {\n      // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n      // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n      // would not be needed - clicks would move the implicit cursor there.\n      var fake = document.createElement('div');\n      this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n      fake.tabIndex = -1;\n      fake.focus();\n      this.dialog_.removeChild(fake);\n    } else {\n      this.dialog_.focus();\n    }\n\n    var redirectedEvent = document.createEvent('MouseEvents');\n    redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n        e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n        e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n    this.dialog_.dispatchEvent(redirectedEvent);\n    e.stopPropagation();\n  },\n\n  /**\n   * Focuses on the first focusable element within the dialog. This will always blur the current\n   * focus, even if nothing within the dialog is found.\n   */\n  focus_: function() {\n    // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n    var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n    if (!target && this.dialog_.tabIndex >= 0) {\n      target = this.dialog_;\n    }\n    if (!target) {\n      // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n      // alternative involves stepping through and trying to focus everything.\n      var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n      var query = opts.map(function(el) {\n        return el + ':not([disabled])';\n      });\n      // TODO(samthor): tabindex values that are not numeric are not focusable.\n      query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])');  // tabindex != \"\", not disabled\n      target = this.dialog_.querySelector(query.join(', '));\n    }\n    safeBlur(document.activeElement);\n    target && target.focus();\n  },\n\n  /**\n   * Sets the zIndex for the backdrop and dialog.\n   *\n   * @param {number} dialogZ\n   * @param {number} backdropZ\n   */\n  updateZIndex: function(dialogZ, backdropZ) {\n    if (dialogZ < backdropZ) {\n      throw new Error('dialogZ should never be < backdropZ');\n    }\n    this.dialog_.style.zIndex = dialogZ;\n    this.backdrop_.style.zIndex = backdropZ;\n  },\n\n  /**\n   * Shows the dialog. If the dialog is already open, this does nothing.\n   */\n  show: function() {\n    if (!this.dialog_.open) {\n      this.setOpen(true);\n      this.focus_();\n    }\n  },\n\n  /**\n   * Show this dialog modally.\n   */\n  showModal: function() {\n    if (this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n    }\n    if (!document.body.contains(this.dialog_)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n    }\n    if (!dialogPolyfill.dm.pushDialog(this)) {\n      throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n    }\n\n    if (createsStackingContext(this.dialog_.parentElement)) {\n      console.warn('A dialog is being shown inside a stacking context. ' +\n          'This may cause it to be unusable. For more information, see this link: ' +\n          'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n    }\n\n    this.setOpen(true);\n    this.openAsModal_ = true;\n\n    // Optionally center vertically, relative to the current viewport.\n    if (dialogPolyfill.needsCentering(this.dialog_)) {\n      dialogPolyfill.reposition(this.dialog_);\n      this.replacedStyleTop_ = true;\n    } else {\n      this.replacedStyleTop_ = false;\n    }\n\n    // Insert backdrop.\n    this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n    // Focus on whatever inside the dialog.\n    this.focus_();\n  },\n\n  /**\n   * Closes this HTMLDialogElement. This is optional vs clearing the open\n   * attribute, however this fires a 'close' event.\n   *\n   * @param {string=} opt_returnValue to use as the returnValue\n   */\n  close: function(opt_returnValue) {\n    if (!this.dialog_.hasAttribute('open')) {\n      throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n    }\n    this.setOpen(false);\n\n    // Leave returnValue untouched in case it was set directly on the element\n    if (opt_returnValue !== undefined) {\n      this.dialog_.returnValue = opt_returnValue;\n    }\n\n    // Triggering \"close\" event for any attached listeners on the <dialog>.\n    var closeEvent = new supportCustomEvent('close', {\n      bubbles: false,\n      cancelable: false\n    });\n    this.dialog_.dispatchEvent(closeEvent);\n  }\n\n};\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n  var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n  var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n  element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n  for (var i = 0; i < document.styleSheets.length; ++i) {\n    var styleSheet = document.styleSheets[i];\n    var cssRules = null;\n    // Some browsers throw on cssRules.\n    try {\n      cssRules = styleSheet.cssRules;\n    } catch (e) {}\n    if (!cssRules) { continue; }\n    for (var j = 0; j < cssRules.length; ++j) {\n      var rule = cssRules[j];\n      var selectedNodes = null;\n      // Ignore errors on invalid selector texts.\n      try {\n        selectedNodes = document.querySelectorAll(rule.selectorText);\n      } catch(e) {}\n      if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n        continue;\n      }\n      var cssTop = rule.style.getPropertyValue('top');\n      var cssBottom = rule.style.getPropertyValue('bottom');\n      if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n  var computedStyle = window.getComputedStyle(dialog);\n  if (computedStyle.position !== 'absolute') {\n    return false;\n  }\n\n  // We must determine whether the top/bottom specified value is non-auto.  In\n  // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n  // Firefox returns the used value. So we do this crazy thing instead: check\n  // the inline style and then go through CSS rules.\n  if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n      (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n    return false;\n  }\n  return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n  if (window.HTMLDialogElement || element.showModal) {\n    console.warn('This browser already supports <dialog>, the polyfill ' +\n        'may not work correctly', element);\n  }\n  if (element.localName !== 'dialog') {\n    throw new Error('Failed to register dialog: The element is not a dialog.');\n  }\n  new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n  if (!element.showModal) {\n    dialogPolyfill.forceRegisterDialog(element);\n  }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n  /** @type {!Array<!dialogPolyfillInfo>} */\n  this.pendingDialogStack = [];\n\n  var checkDOM = this.checkDOM_.bind(this);\n\n  // The overlay is used to simulate how a modal dialog blocks the document.\n  // The blocking dialog is positioned on top of the overlay, and the rest of\n  // the dialogs on the pending dialog stack are positioned below it. In the\n  // actual implementation, the modal dialog stacking is controlled by the\n  // top layer, where z-index has no effect.\n  this.overlay = document.createElement('div');\n  this.overlay.className = '_dialog_overlay';\n  this.overlay.addEventListener('click', function(e) {\n    this.forwardTab_ = undefined;\n    e.stopPropagation();\n    checkDOM([]);  // sanity-check DOM\n  }.bind(this));\n\n  this.handleKey_ = this.handleKey_.bind(this);\n  this.handleFocus_ = this.handleFocus_.bind(this);\n\n  this.zIndexLow_ = 100000;\n  this.zIndexHigh_ = 100000 + 150;\n\n  this.forwardTab_ = undefined;\n\n  if ('MutationObserver' in window) {\n    this.mo_ = new MutationObserver(function(records) {\n      var removed = [];\n      records.forEach(function(rec) {\n        for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n          if (!(c instanceof Element)) {\n            continue;\n          } else if (c.localName === 'dialog') {\n            removed.push(c);\n          }\n          removed = removed.concat(c.querySelectorAll('dialog'));\n        }\n      });\n      removed.length && checkDOM(removed);\n    });\n  }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n  document.documentElement.addEventListener('focus', this.handleFocus_, true);\n  document.addEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n  document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n  document.removeEventListener('keydown', this.handleKey_);\n  this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n  var zIndex = this.zIndexHigh_;\n\n  for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n    dpi.updateZIndex(--zIndex, --zIndex);\n    if (i === 0) {\n      this.overlay.style.zIndex = --zIndex;\n    }\n  }\n\n  // Make the overlay a sibling of the dialog itself.\n  var last = this.pendingDialogStack[0];\n  if (last) {\n    var p = last.dialog.parentNode || document.body;\n    p.appendChild(this.overlay);\n  } else if (this.overlay.parentNode) {\n    this.overlay.parentNode.removeChild(this.overlay);\n  }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n  while (candidate = findNearestDialog(candidate)) {\n    for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n      if (dpi.dialog === candidate) {\n        return i === 0;  // only valid if top-most\n      }\n    }\n    candidate = candidate.parentElement;\n  }\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n  if (this.containedByTopDialog_(event.target)) { return; }\n\n  if (document.activeElement === document.documentElement) { return; }\n\n  event.preventDefault();\n  event.stopPropagation();\n  safeBlur(/** @type {Element} */ (event.target));\n\n  if (this.forwardTab_ === undefined) { return; }  // move focus only from a tab key\n\n  var dpi = this.pendingDialogStack[0];\n  var dialog = dpi.dialog;\n  var position = dialog.compareDocumentPosition(event.target);\n  if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n    if (this.forwardTab_) {\n      // forward\n      dpi.focus_();\n    } else if (event.target !== document.documentElement) {\n      // backwards if we're not already focused on <html>\n      document.documentElement.focus();\n    }\n  }\n\n  return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n  this.forwardTab_ = undefined;\n  if (event.keyCode === 27) {\n    event.preventDefault();\n    event.stopPropagation();\n    var cancelEvent = new supportCustomEvent('cancel', {\n      bubbles: false,\n      cancelable: true\n    });\n    var dpi = this.pendingDialogStack[0];\n    if (dpi && dpi.dialog.dispatchEvent(cancelEvent)) {\n      dpi.dialog.close();\n    }\n  } else if (event.keyCode === 9) {\n    this.forwardTab_ = !event.shiftKey;\n  }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array<!HTMLDialogElement>} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n  // This operates on a clone because it may cause it to change. Each change also calls\n  // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n  // at a time?!\n  var clone = this.pendingDialogStack.slice();\n  clone.forEach(function(dpi) {\n    if (removed.indexOf(dpi.dialog) !== -1) {\n      dpi.downgradeModal();\n    } else {\n      dpi.maybeHideModal();\n    }\n  });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n  var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n  if (this.pendingDialogStack.length >= allowed) {\n    return false;\n  }\n  if (this.pendingDialogStack.unshift(dpi) === 1) {\n    this.blockDocument();\n  }\n  this.updateStacking();\n  return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n  var index = this.pendingDialogStack.indexOf(dpi);\n  if (index === -1) { return; }\n\n  this.pendingDialogStack.splice(index, 1);\n  if (this.pendingDialogStack.length === 0) {\n    this.unblockDocument();\n  }\n  this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.useValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with <form method=\"dialog\">.\n */\nif (window.HTMLDialogElement === undefined) {\n\n  /**\n   * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n   * one that returns the correct value.\n   */\n  var testForm = document.createElement('form');\n  testForm.setAttribute('method', 'dialog');\n  if (testForm.method !== 'dialog') {\n    var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n    if (methodDescriptor) {\n      // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n      // and don't bother to update the element.\n      var realGet = methodDescriptor.get;\n      methodDescriptor.get = function() {\n        if (isFormMethodDialog(this)) {\n          return 'dialog';\n        }\n        return realGet.call(this);\n      };\n      var realSet = methodDescriptor.set;\n      methodDescriptor.set = function(v) {\n        if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n          return this.setAttribute('method', v);\n        }\n        return realSet.call(this, v);\n      };\n      Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n    }\n  }\n\n  /**\n   * Global 'click' handler, to capture the <input type=\"submit\"> or <button> element which has\n   * submitted a <form method=\"dialog\">. Needed as Safari and others don't report this inside\n   * document.activeElement.\n   */\n  document.addEventListener('click', function(ev) {\n    dialogPolyfill.formSubmitter = null;\n    dialogPolyfill.useValue = null;\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var target = /** @type {Element} */ (ev.target);\n    if (!target || !isFormMethodDialog(target.form)) { return; }\n\n    var valid = (target.type === 'submit' && ['button', 'input'].indexOf(target.localName) > -1);\n    if (!valid) {\n      if (!(target.localName === 'input' && target.type === 'image')) { return; }\n      // this is a <input type=\"image\">, which can submit forms\n      dialogPolyfill.useValue = ev.offsetX + ',' + ev.offsetY;\n    }\n\n    var dialog = findNearestDialog(target);\n    if (!dialog) { return; }\n\n    dialogPolyfill.formSubmitter = target;\n\n  }, false);\n\n  /**\n   * Replace the native HTMLFormElement.submit() method, as it won't fire the\n   * submit event and give us a chance to respond.\n   */\n  var nativeFormSubmit = HTMLFormElement.prototype.submit;\n  var replacementFormSubmit = function () {\n    if (!isFormMethodDialog(this)) {\n      return nativeFormSubmit.call(this);\n    }\n    var dialog = findNearestDialog(this);\n    dialog && dialog.close();\n  };\n  HTMLFormElement.prototype.submit = replacementFormSubmit;\n\n  /**\n   * Global form 'dialog' method handler. Closes a dialog correctly on submit\n   * and possibly sets its return value.\n   */\n  document.addEventListener('submit', function(ev) {\n    if (ev.defaultPrevented) { return; }  // e.g. a submit which prevents default submission\n\n    var form = /** @type {HTMLFormElement} */ (ev.target);\n    if (!isFormMethodDialog(form)) { return; }\n    ev.preventDefault();\n\n    var dialog = findNearestDialog(form);\n    if (!dialog) { return; }\n\n    // Forms can only be submitted via .submit() or a click (?), but anyway: sanity-check that\n    // the submitter is correct before using its value as .returnValue.\n    var s = dialogPolyfill.formSubmitter;\n    if (s && s.form === form) {\n      dialog.close(dialogPolyfill.useValue || s.value);\n    } else {\n      dialog.close();\n    }\n    dialogPolyfill.formSubmitter = null;\n\n  }, false);\n}\n\nexport default dialogPolyfill;\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nexport function registerHeaderListeners(): void {\n  const header = document.querySelector('.js-header');\n  const menuButtons = document.querySelectorAll('.js-headerMenuButton');\n  menuButtons.forEach(button => {\n    button.addEventListener('click', e => {\n      e.preventDefault();\n      header?.classList.toggle('is-active');\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n\n  const scrim = document.querySelector('.js-scrim');\n  scrim?.addEventListener('click', e => {\n    e.preventDefault();\n    header?.classList.remove('is-active');\n    menuButtons.forEach(button => {\n      button.setAttribute('aria-expanded', String(header?.classList.contains('is-active')));\n    });\n  });\n}\n\nexport function registerSearchFormListeners(): void {\n  const searchForm = document.querySelector('.js-searchForm');\n  const expandSearch = document.querySelector('.js-expandSearch');\n  const input = searchForm?.querySelector('input');\n  const headerLogo = document.querySelector('.js-headerLogo');\n  const menuButton = document.querySelector('.js-headerMenuButton');\n  expandSearch?.addEventListener('click', () => {\n    searchForm?.classList.add('go-SearchForm--expanded');\n    headerLogo?.classList.add('go-Header-logo--hidden');\n    menuButton?.classList.add('go-Header-navOpen--hidden');\n    input?.focus();\n  });\n  document?.addEventListener('click', e => {\n    if (!searchForm?.contains(e.target as Node)) {\n      searchForm?.classList.remove('go-SearchForm--expanded');\n      headerLogo?.classList.remove('go-Header-logo--hidden');\n      menuButton?.classList.remove('go-Header-navOpen--hidden');\n    }\n  });\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * Carousel Controller adds event listeners, accessibilty enhancements, and\n * control elements to a carousel component.\n */\nexport class CarouselController {\n  /**\n   * slides is a collection of slides in the carousel.\n   */\n  private slides: HTMLLIElement[];\n  /**\n   * dots is a collection of dot navigation controls, added to the carousel\n   * by this controller.\n   */\n  private dots: HTMLElement[];\n  /**\n   * liveRegion is a visually hidden element that notifies assitive devices\n   * of visual changes to the carousel. They are added to the carousel by\n   * this controller.\n   */\n  private liveRegion: HTMLElement;\n  /**\n   * activeIndex is the 0-index of the currently active slide.\n   */\n  private activeIndex: number;\n\n  constructor(private el: HTMLElement) {\n    this.slides = Array.from(el.querySelectorAll('.go-Carousel-slide'));\n    this.dots = [];\n    this.liveRegion = document.createElement('div');\n    this.activeIndex = Number(el.getAttribute('data-slide-index') ?? 0);\n\n    this.initSlides();\n    this.initArrows();\n    this.initDots();\n    this.initLiveRegion();\n  }\n\n  private initSlides() {\n    for (const [i, v] of this.slides.entries()) {\n      if (i === this.activeIndex) continue;\n      v.setAttribute('aria-hidden', 'true');\n    }\n  }\n\n  private initArrows() {\n    const arrows = document.createElement('ul');\n    arrows.classList.add('go-Carousel-arrows');\n    arrows.innerHTML = `\n      <li>\n        <button class=\"go-Carousel-prevSlide\" aria-label=\"Go to previous slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_left_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n      <li>\n        <button class=\"go-Carousel-nextSlide\" aria-label=\"Go to next slide\">\n          <img class=\"go-Icon\" height=\"24\" width=\"24\" src=\"/static/shared/icon/arrow_right_gm_grey_24dp.svg\" alt=\"\">\n        </button>\n      </li>\n    `;\n    arrows\n      .querySelector('.go-Carousel-prevSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex - 1));\n    arrows\n      .querySelector('.go-Carousel-nextSlide')\n      ?.addEventListener('click', () => this.setActive(this.activeIndex + 1));\n    this.el.append(arrows);\n  }\n\n  private initDots() {\n    const dots = document.createElement('ul');\n    dots.classList.add('go-Carousel-dots');\n    for (let i = 0; i < this.slides.length; i++) {\n      const li = document.createElement('li');\n      const button = document.createElement('button');\n      button.classList.add('go-Carousel-dot');\n      if (i === this.activeIndex) {\n        button.classList.add('go-Carousel-dot--active');\n      }\n      button.innerHTML = `<span class=\"go-Carousel-obscured\">Slide ${i + 1}</span>`;\n      button.addEventListener('click', () => this.setActive(i));\n      li.append(button);\n      dots.append(li);\n      this.dots.push(button);\n    }\n    this.el.append(dots);\n  }\n\n  private initLiveRegion() {\n    this.liveRegion.setAttribute('aria-live', 'polite');\n    this.liveRegion.setAttribute('aria-atomic', 'true');\n    this.liveRegion.setAttribute('class', 'go-Carousel-obscured');\n    this.liveRegion.textContent = `Slide ${this.activeIndex + 1} of ${this.slides.length}`;\n    this.el.appendChild(this.liveRegion);\n  }\n\n  private setActive = (index: number) => {\n    this.activeIndex = (index + this.slides.length) % this.slides.length;\n    this.el.setAttribute('data-slide-index', String(this.activeIndex));\n    for (const d of this.dots) {\n      d.classList.remove('go-Carousel-dot--active');\n    }\n    this.dots[this.activeIndex].classList.add('go-Carousel-dot--active');\n    for (const s of this.slides) {\n      s.setAttribute('aria-hidden', 'true');\n    }\n    this.slides[this.activeIndex].removeAttribute('aria-hidden');\n    this.liveRegion.textContent = 'Slide ' + (this.activeIndex + 1) + ' of ' + this.slides.length;\n  };\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * This class decorates an element to copy arbitrary data attached via a data-\n * attribute to the clipboard.\n */\nexport class ClipboardController {\n  /**\n   * The data to be copied to the clipboard.\n   */\n  private data: string;\n\n  /**\n   * @param el The element that will trigger copying text to the clipboard. The text is\n   * expected to be within its data-to-copy attribute.\n   */\n  constructor(private el: HTMLButtonElement) {\n    this.data = el.dataset['toCopy'] ?? el.innerText;\n    // if data-to-copy is empty and the button is part of an input group\n    // capture the value of the input.\n    if (!this.data && el.parentElement?.classList.contains('go-InputGroup')) {\n      this.data = (this.data || el.parentElement?.querySelector('input')?.value) ?? '';\n    }\n    el.addEventListener('click', e => this.handleCopyClick(e));\n  }\n\n  /**\n   * Handles when the primary element is clicked.\n   */\n  handleCopyClick(e: MouseEvent): void {\n    e.preventDefault();\n    const TOOLTIP_SHOW_DURATION_MS = 1000;\n\n    // This API is not available on iOS.\n    if (!navigator.clipboard) {\n      this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      return;\n    }\n    navigator.clipboard\n      .writeText(this.data)\n      .then(() => {\n        this.showTooltipText('Copied!', TOOLTIP_SHOW_DURATION_MS);\n      })\n      .catch(() => {\n        this.showTooltipText('Unable to copy', TOOLTIP_SHOW_DURATION_MS);\n      });\n  }\n\n  /**\n   * Shows the given text in a tooltip for a specified amount of time, in milliseconds.\n   */\n  showTooltipText(text: string, durationMs: number): void {\n    this.el.setAttribute('data-tooltip', text);\n    setTimeout(() => this.el.setAttribute('data-tooltip', ''), durationMs);\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ToolTipController handles closing tooltips on external clicks.\n */\nexport class ToolTipController {\n  constructor(private el: HTMLDetailsElement) {\n    document.addEventListener('click', e => {\n      const insideTooltip = this.el.contains(e.target as Element);\n      if (!insideTooltip) {\n        this.el.removeAttribute('open');\n      }\n    });\n  }\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { TreeNavController } from './tree.js';\n\nexport class SelectNavController {\n  constructor(private el: Element) {\n    this.el.addEventListener('change', e => {\n      const target = e.target as HTMLSelectElement;\n      let href = target.value;\n      if (!target.value.startsWith('/')) {\n        href = '/' + href;\n      }\n      window.location.href = href;\n    });\n  }\n}\n\nexport function makeSelectNav(tree: TreeNavController): HTMLLabelElement {\n  const label = document.createElement('label');\n  label.classList.add('go-Label');\n  label.setAttribute('aria-label', 'Menu');\n  const select = document.createElement('select');\n  select.classList.add('go-Select', 'js-selectNav');\n  label.appendChild(select);\n  const outline = document.createElement('optgroup');\n  outline.label = 'Outline';\n  select.appendChild(outline);\n  const groupMap: Record<string, HTMLOptGroupElement> = {};\n  let group: HTMLOptGroupElement;\n  for (const t of tree.treeitems) {\n    if (Number(t.depth) > 4) continue;\n    if (t.groupTreeitem) {\n      group = groupMap[t.groupTreeitem.label];\n      if (!group) {\n        group = groupMap[t.groupTreeitem.label] = document.createElement('optgroup');\n        group.label = t.groupTreeitem.label;\n        select.appendChild(group);\n      }\n    } else {\n      group = outline;\n    }\n    const o = document.createElement('option');\n    o.label = t.label;\n    o.textContent = t.label;\n    o.value = (t.el as HTMLAnchorElement).href.replace(window.location.origin, '').replace('/', '');\n    group.appendChild(o);\n  }\n  tree.addObserver(t => {\n    const hash = (t.el as HTMLAnchorElement).hash;\n    const value = select.querySelector<HTMLOptionElement>(`[value$=\"${hash}\"]`)?.value;\n    if (value) {\n      select.value = value;\n    }\n  }, 50);\n  return label;\n}\n", "/**\n * @license\n * Copyright 2021 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n/**\n * ModalController registers a dialog element with the polyfill if\n * necessary for the current browser, add adds event listeners to\n * close and open modals.\n */\nexport class ModalController {\n  constructor(private el: HTMLDialogElement) {\n    // Only load the dialog polyfill if necessary for the environment.\n    if (!window.HTMLDialogElement && !el.showModal) {\n      import('../../../third_party/dialog-polyfill/dialog-polyfill.esm.js').then(\n        ({ default: polyfill }) => {\n          polyfill.registerDialog(el);\n        }\n      );\n    }\n    const id = el.id;\n    const button = document.querySelector<HTMLButtonElement>(`[aria-controls=\"${id}\"]`);\n    if (button) {\n      button.addEventListener('click', () => {\n        if (this.el.showModal) {\n          this.el.showModal();\n        } else {\n          this.el.open = true;\n        }\n        el.querySelector('input')?.focus();\n      });\n    }\n    for (const close of this.el.querySelectorAll<HTMLButtonElement>('[data-modal-close]')) {\n      close.addEventListener('click', () => {\n        if (this.el.close) {\n          this.el.close();\n        } else {\n          this.el.open = false;\n        }\n      });\n    }\n  }\n}\n", "interface TagManagerEvent {\n  /**\n   * event is the name of the event, used to filter events in\n   * Google Analytics.\n   */\n  event: string;\n\n  /**\n   * event_category is a name that you supply as a way to group objects\n   * that to analyze. Typically, you will use the same category name\n   * multiple times over related UI elements (buttons, links, etc).\n   */\n  event_category?: string;\n\n  /**\n   * event_action is used to name the type of event or interaction you\n   * want to measure for a particular web object. For example, with a\n   * single \"form\" category, you can analyze a number of specific events\n   * with this parameter, such as: form entered, form submitted.\n   */\n  event_action?: string;\n\n  /**\n   * event_label provide additional information for events that you want\n   * to analyze, such as the text label of a link.\n   */\n  event_label?: string;\n\n  /**\n   * gtm.start is used to initialize Google Tag Manager.\n   */\n  'gtm.start'?: number;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare global {\n  interface Window {\n    dataLayer?: (TagManagerEvent | VoidFunction)[];\n    ga?: unknown;\n  }\n}\n\n/**\n * track sends events to Google Tag Manager.\n */\nexport function track(\n  event: string | TagManagerEvent,\n  category?: string,\n  action?: string,\n  label?: string\n): void {\n  window.dataLayer ??= [];\n  if (typeof event === 'string') {\n    window.dataLayer.push({\n      event,\n      event_category: category,\n      event_action: action,\n      event_label: label,\n    });\n  } else {\n    window.dataLayer.push(event);\n  }\n}\n\n/**\n * func adds functions to run sequentionally after\n * Google Tag Manager is ready.\n */\nexport function func(fn: () => void): void {\n  window.dataLayer ??= [];\n  window.dataLayer.push(fn);\n}\n", "/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { track } from '../analytics/analytics';\n\n/**\n * Options are keyhandler callback options.\n */\ninterface Options {\n  /**\n   * target is the element the key event should filter on. The\n   * default target is the document.\n   */\n  target?: Element;\n\n  /**\n   * withMeta specifies if the event callback should fire when\n   * the key is pressed with a meta key (ctrl, alt, etc). By\n   * default meta keypresses are ignored.\n   */\n  withMeta?: boolean;\n}\n\n/**\n * KeyHandler is the config for a keyboard event callback.\n */\ninterface KeyHandler extends Options {\n  description: string;\n  callback: (e: KeyboardEvent) => void;\n}\n\n/**\n * KeyboardController controls event callbacks for sitewide\n * keyboard events. Multiple callbacks can be registered for\n * a single key and by default the controller ignores events\n * for text input targets.\n */\nclass KeyboardController {\n  handlers: Record<string, Set<KeyHandler>>;\n\n  constructor() {\n    this.handlers = {};\n    document.addEventListener('keydown', e => this.handleKeyPress(e));\n  }\n\n  /**\n   * on registers keyboard event callbacks.\n   * @param key the key to register.\n   * @param description name of the event.\n   * @param callback event callback.\n   * @param options set target and withMeta options to override the default behaviors.\n   */\n  on(key: string, description: string, callback: (e: KeyboardEvent) => void, options?: Options) {\n    this.handlers[key] ??= new Set();\n    this.handlers[key].add({ description, callback, ...options });\n    return this;\n  }\n\n  private handleKeyPress(e: KeyboardEvent) {\n    for (const handler of this.handlers[e.key.toLowerCase()] ?? new Set()) {\n      if (handler.target && handler.target !== e.target) {\n        return;\n      }\n      const t = e.target as HTMLElement | null;\n      if (\n        !handler.target &&\n        (t?.tagName === 'INPUT' || t?.tagName === 'SELECT' || t?.tagName === 'TEXTAREA')\n      ) {\n        return;\n      }\n      if (t?.isContentEditable) {\n        return;\n      }\n      if (\n        (handler.withMeta && !(e.ctrlKey || e.metaKey)) ||\n        (!handler.withMeta && (e.ctrlKey || e.metaKey))\n      ) {\n        return;\n      }\n      track('keypress', 'hotkeys', `${e.key} pressed`, handler.description);\n      handler.callback(e);\n    }\n  }\n}\n\nexport const keyboard = new KeyboardController();\n", "/*!\n * @license\n * Copyright 2019-2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\n// This file implements the behavior of the \"jump to symbol\" dialog for Go\n// package documentation, as well as the simple dialog that displays keyboard\n// shortcuts.\n\n// The DOM for the dialogs is at the bottom of static/frontend/unit/main/_modals.tmpl.\n// The CSS is in static/frontend/unit/main/_modals.css.\n\n// The dialog is activated by pressing the 'f' key. It presents a list\n// (#JumpDialog-list) of all Go symbols displayed in the documentation.\n// Entering text in the dialog's text box (#JumpDialog-filter) restricts the\n// list to symbols containing the text. Clicking on an symbol jumps to\n// its documentation.\n\n// This code is based on\n// https://go.googlesource.com/gddo/+/refs/heads/master/gddo-server/assets/site.js.\n// It was modified to remove the dependence on jquery and bootstrap.\n\nimport { keyboard } from '../keyboard/keyboard';\n\nconst jumpDialog = document.querySelector<HTMLDialogElement>('.JumpDialog');\nconst jumpBody = jumpDialog?.querySelector<HTMLDivElement>('.JumpDialog-body');\nconst jumpList = jumpDialog?.querySelector<HTMLDivElement>('.JumpDialog-list');\nconst jumpFilter = jumpDialog?.querySelector<HTMLInputElement>('.JumpDialog-input');\nconst doc = document.querySelector<HTMLDivElement>('.js-documentation');\n\ninterface JumpListItem {\n  link: HTMLAnchorElement;\n  name: string;\n  kind: string;\n  lower: string;\n}\n\nlet jumpListItems: JumpListItem[] | undefined; // All the symbols in the doc; computed only once.\n\n// collectJumpListItems returns a list of items, one for each symbol in the\n// documentation on the current page.\n//\n// It uses the data-kind attribute generated in the documentation HTML to find\n// the symbols and their id attributes.\n//\n// If there are no data-kind attributes, then we have older doc; fall back to\n// a less precise method.\nfunction collectJumpListItems() {\n  const items = [];\n  if (!doc) return;\n  for (const el of doc.querySelectorAll('[data-kind]')) {\n    items.push(newJumpListItem(el));\n  }\n\n  // Clicking on any of the links closes the dialog.\n  for (const item of items) {\n    item.link.addEventListener('click', function () {\n      jumpDialog?.close();\n    });\n  }\n  // Sort case-insensitively by symbol name.\n  items.sort(function (a, b) {\n    return a.lower.localeCompare(b.lower);\n  });\n  return items;\n}\n\n// newJumpListItem creates a new item for the DOM element el.\n// An item is an object with:\n// - name: the element's id (which is the symbol name)\n// - kind: the element's kind (function, variable, etc.),\n// - link: a link ('a' tag) to the element\n// - lower: the name in lower case, just for sorting\nfunction newJumpListItem(el: Element): JumpListItem {\n  const a = document.createElement('a');\n  const name = el.getAttribute('id');\n  a.setAttribute('href', '#' + name);\n  a.setAttribute('tabindex', '-1');\n  a.setAttribute('data-gtmc', 'jump to link');\n  const kind = el.getAttribute('data-kind');\n  return {\n    link: a,\n    name: name ?? '',\n    kind: kind ?? '',\n    lower: name?.toLowerCase() ?? '', // for sorting\n  };\n}\n\nlet lastFilterValue: string; // The last contents of the filter text box.\nlet activeJumpItem = -1; // The index of the currently active item in the list.\n\n// updateJumpList sets the elements of the dialog list to\n// everything whose name contains filter.\nfunction updateJumpList(filter: string) {\n  lastFilterValue = filter;\n  if (!jumpListItems) {\n    jumpListItems = collectJumpListItems();\n  }\n  setActiveJumpItem(-1);\n\n  // Remove all children from list.\n  while (jumpList?.firstChild) {\n    jumpList.firstChild.remove();\n  }\n\n  if (filter) {\n    // A filter is set. We treat the filter as a substring that can appear in\n    // an item name (case insensitive), and find the following matches - in\n    // order of priority:\n    //\n    // 1. Exact matches (the filter matches the item's name exactly)\n    // 2. Prefix matches (the item's name starts with filter)\n    // 3. Infix matches (the filter is a substring of the item's name)\n    const filterLowerCase = filter.toLowerCase();\n\n    const exactMatches = [];\n    const prefixMatches = [];\n    const infixMatches = [];\n\n    // makeLinkHtml creates the link name HTML for a list item. item is the DOM\n    // item. item.name.substr(boldStart, boldEnd) will be bolded.\n    const makeLinkHtml = (item: JumpListItem, boldStart: number, boldEnd: number) => {\n      return (\n        item.name.substring(0, boldStart) +\n        '<b>' +\n        item.name.substring(boldStart, boldEnd) +\n        '</b>' +\n        item.name.substring(boldEnd)\n      );\n    };\n\n    for (const item of jumpListItems ?? []) {\n      const nameLowerCase = item.name.toLowerCase();\n\n      if (nameLowerCase === filterLowerCase) {\n        item.link.innerHTML = makeLinkHtml(item, 0, item.name.length);\n        exactMatches.push(item);\n      } else if (nameLowerCase.startsWith(filterLowerCase)) {\n        item.link.innerHTML = makeLinkHtml(item, 0, filter.length);\n        prefixMatches.push(item);\n      } else {\n        const index = nameLowerCase.indexOf(filterLowerCase);\n        if (index > -1) {\n          item.link.innerHTML = makeLinkHtml(item, index, index + filter.length);\n          infixMatches.push(item);\n        }\n      }\n    }\n\n    for (const item of exactMatches.concat(prefixMatches).concat(infixMatches)) {\n      jumpList?.appendChild(item.link);\n    }\n  } else {\n    if (!jumpListItems || jumpListItems.length === 0) {\n      const msg = document.createElement('i');\n      msg.innerHTML = 'There are no symbols on this page.';\n      jumpList?.appendChild(msg);\n    }\n    // No filter set; display all items in their existing order.\n    for (const item of jumpListItems ?? []) {\n      item.link.innerHTML = item.name + ' <i>' + item.kind + '</i>';\n      jumpList?.appendChild(item.link);\n    }\n  }\n\n  if (jumpBody) {\n    jumpBody.scrollTop = 0;\n  }\n  if (jumpListItems?.length && jumpList && jumpList.children.length > 0) {\n    setActiveJumpItem(0);\n  }\n}\n\n// Set the active jump item to n.\nfunction setActiveJumpItem(n: number) {\n  const cs = jumpList?.children as HTMLCollectionOf<HTMLElement> | null | undefined;\n  if (!cs || !jumpBody) {\n    return;\n  }\n  if (activeJumpItem >= 0) {\n    cs[activeJumpItem].classList.remove('JumpDialog-active');\n  }\n  if (n >= cs.length) {\n    n = cs.length - 1;\n  }\n  if (n >= 0) {\n    cs[n].classList.add('JumpDialog-active');\n\n    // Scroll so the active item is visible.\n    // For some reason cs[n].scrollIntoView() doesn't behave as I'd expect:\n    // it moves the entire dialog box in the viewport.\n\n    // Get the top and bottom of the active item relative to jumpBody.\n    const activeTop = cs[n].offsetTop - cs[0].offsetTop;\n    const activeBottom = activeTop + cs[n].clientHeight;\n    if (activeTop < jumpBody.scrollTop) {\n      // Off the top; scroll up.\n      jumpBody.scrollTop = activeTop;\n    } else if (activeBottom > jumpBody.scrollTop + jumpBody.clientHeight) {\n      // Off the bottom; scroll down.\n      jumpBody.scrollTop = activeBottom - jumpBody.clientHeight;\n    }\n  }\n  activeJumpItem = n;\n}\n\n// Increment the activeJumpItem by delta.\nfunction incActiveJumpItem(delta: number) {\n  if (activeJumpItem < 0) {\n    return;\n  }\n  let n = activeJumpItem + delta;\n  if (n < 0) {\n    n = 0;\n  }\n  setActiveJumpItem(n);\n}\n\nexport function initModals(): void {\n  // Pressing a key in the filter updates the list (if the filter actually changed).\n  jumpFilter?.addEventListener('keyup', function () {\n    if (jumpFilter.value.toUpperCase() != lastFilterValue.toUpperCase()) {\n      updateJumpList(jumpFilter.value);\n    }\n  });\n\n  // Pressing enter in the filter selects the first element in the list.\n  jumpFilter?.addEventListener('keydown', function (event) {\n    const upArrow = 38;\n    const downArrow = 40;\n    const enterKey = 13;\n    switch (event.which) {\n      case upArrow:\n        incActiveJumpItem(-1);\n        event.preventDefault();\n        break;\n      case downArrow:\n        incActiveJumpItem(1);\n        event.preventDefault();\n        break;\n      case enterKey:\n        if (activeJumpItem >= 0) {\n          if (jumpList) {\n            (jumpList.children[activeJumpItem] as HTMLElement).click();\n            event.preventDefault();\n          }\n        }\n        break;\n    }\n  });\n\n  const shortcutsDialog = document.querySelector<HTMLDialogElement>('.ShortcutsDialog');\n\n  // - Pressing 'f' or 'F' opens the jump-to-symbol dialog.\n  // - Pressing '?' opens up the shortcut dialog.\n  // Ignore a keypress if a dialog is already open, or if it is pressed on a\n  // component that wants to consume it.\n  keyboard\n    .on('f', 'open jump to modal', e => {\n      if (jumpDialog?.open || shortcutsDialog?.open) {\n        return;\n      }\n      e.preventDefault();\n      if (jumpFilter) {\n        jumpFilter.value = '';\n      }\n      jumpDialog?.showModal();\n      jumpFilter?.focus();\n      updateJumpList('');\n    })\n    .on('?', 'open shortcuts modal', () => {\n      if (jumpDialog?.open || shortcutsDialog?.open) {\n        return;\n      }\n      shortcutsDialog?.showModal();\n    });\n\n  const jumpOutlineInput = document.querySelector('.js-jumpToInput');\n  if (jumpOutlineInput) {\n    jumpOutlineInput.addEventListener('click', () => {\n      if (jumpFilter) {\n        jumpFilter.value = '';\n      }\n      updateJumpList('');\n    });\n  }\n\n  document.querySelector('.js-openShortcuts')?.addEventListener('click', () => {\n    shortcutsDialog?.showModal();\n  });\n}\n", "/**\n * @license\n * Copyright 2020 The Go Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style\n * license that can be found in the LICENSE file.\n */\n\nimport { registerHeaderListeners, registerSearchFormListeners } from 'static/shared/header/header';\nimport { CarouselController } from 'static/shared/carousel/carousel';\nimport { ClipboardController } from 'static/shared/clipboard/clipboard';\nimport { ToolTipController } from 'static/shared/tooltip/tooltip';\nimport { SelectNavController } from 'static/shared/outline/select';\nimport { ModalController } from 'static/shared/modal/modal';\nimport { initModals } from 'static/shared/jump/jump';\n\nimport { keyboard } from 'static/shared/keyboard/keyboard';\nimport * as analytics from 'static/shared/analytics/analytics';\n\nfor (const el of document.querySelectorAll<HTMLButtonElement>('.js-clipboard')) {\n  new ClipboardController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLDialogElement>('.js-modal')) {\n  new ModalController(el);\n}\n\nfor (const t of document.querySelectorAll<HTMLDetailsElement>('.js-tooltip')) {\n  new ToolTipController(t);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-selectNav')) {\n  new SelectNavController(el);\n}\n\nfor (const el of document.querySelectorAll<HTMLSelectElement>('.js-carousel')) {\n  new CarouselController(el);\n}\n\nregisterHeaderListeners();\nregisterSearchFormListeners();\ninitModals();\n\n// Pressing '/' focuses the search box\nkeyboard.on('/', 'focus search', e => {\n  const searchInput = Array.from(\n    document.querySelectorAll<HTMLInputElement>('.js-searchFocus')\n  ).pop();\n  // Favoring the Firefox quick find feature over search input\n  // focus. See: https://github.com/golang/go/issues/41093.\n  if (searchInput && !window.navigator.userAgent.includes('Firefox')) {\n    e.preventDefault();\n    searchInput.focus();\n  }\n});\n\n// Pressing 'y' changes the browser URL to the canonical URL\n// without triggering a reload.\nkeyboard.on('y', 'set canonical url', () => {\n  const canonicalURLPath = document.querySelector<HTMLDivElement>('.js-canonicalURLPath')?.dataset[\n    'canonicalUrlPath'\n  ];\n  if (canonicalURLPath && canonicalURLPath !== '') {\n    window.history.replaceState(null, '', canonicalURLPath);\n  }\n});\n\n/**\n * setupGoogleTagManager intializes Google Tag Manager.\n */\n(function setupGoogleTagManager() {\n  analytics.track({\n    'gtm.start': new Date().getTime(),\n    event: 'gtm.js',\n  });\n})();\n\n/**\n * removeUTMSource removes the utm_source GET parameter if present.\n * This is done using JavaScript, so that the utm_source is still\n * captured by Google Analytics.\n */\nfunction removeUTMSource() {\n  const urlParams = new URLSearchParams(window.location.search);\n  const utmSource = urlParams.get('utm_source');\n  if (utmSource !== 'gopls' && utmSource !== 'godoc' && utmSource !== 'pkggodev') {\n    return;\n  }\n\n  /** Strip the utm_source query parameter and replace the URL. **/\n  const newURL = new URL(window.location.href);\n  urlParams.delete('utm_source');\n  newURL.search = urlParams.toString();\n  window.history.replaceState(null, '', newURL.toString());\n}\n\nif (document.querySelector<HTMLElement>('.js-gtmID')?.dataset.gtmid && window.dataLayer) {\n  analytics.func(function () {\n    removeUTMSource();\n  });\n} else {\n  removeUTMSource();\n}\n\nfor (const el of document.querySelectorAll('.js-toggleTheme')) {\n  el.addEventListener('click', () => {\n    toggleTheme();\n  });\n}\n\n/**\n * toggleTheme switches the preferred color scheme between auto, light, and dark.\n */\nfunction toggleTheme() {\n  let nextTheme = 'dark';\n  const theme = document.documentElement.getAttribute('data-theme');\n  if (theme === 'dark') {\n    nextTheme = 'light';\n  } else if (theme === 'light') {\n    nextTheme = 'auto';\n  }\n  document.documentElement.setAttribute('data-theme', nextTheme);\n  document.cookie = `prefers-color-scheme=${nextTheme};path=/;max-age=31536000;`;\n}\n"],
+  "mappings": "wKAAA,+BAgBA,WAAgC,EAAI,CAClC,KAAO,GAAM,IAAO,SAAS,MAAM,CACjC,GAAI,GAAI,OAAO,iBAAiB,GAC5B,EAAU,SAAS,EAAG,EAAI,CAC5B,MAAO,CAAE,GAAE,KAAO,QAAa,EAAE,KAAO,IAG1C,GAAI,EAAE,QAAU,GACZ,EAAQ,SAAU,SAClB,EAAQ,YAAa,SACrB,EAAQ,eAAgB,WACxB,EAAQ,SAAU,SAClB,EAAQ,cAAe,SACvB,EAAE,YAAiB,WACnB,EAAE,WAAa,SACf,EAAE,0BAA4B,QAChC,MAAO,GAET,EAAK,EAAG,cAEV,MAAO,GAST,WAA2B,EAAI,CAC7B,KAAO,GAAI,CACT,GAAI,EAAG,YAAc,SACnB,MAAyC,GAE3C,EAAK,EAAG,cAEV,MAAO,MAUT,WAAkB,EAAI,CACpB,AAAI,GAAM,EAAG,MAAQ,IAAO,SAAS,MACnC,EAAG,OASP,YAAoB,EAAU,EAAM,CAClC,OAAS,GAAI,EAAG,EAAI,EAAS,OAAQ,EAAE,EACrC,GAAI,EAAS,KAAO,EAClB,MAAO,GAGX,MAAO,GAOT,WAA4B,EAAI,CAC9B,MAAI,CAAC,GAAM,CAAC,EAAG,aAAa,UACnB,GAEF,EAAG,aAAa,UAAU,gBAAkB,SAOrD,WAA4B,EAAQ,CAkBlC,GAjBA,KAAK,QAAU,EACf,KAAK,k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,iBAAoC,iBAC5D,GAAI,GAAoB,GAG1B,OAAW,KAAM,UAAS,iBAAoC,gBAC5D,GAAI,GAAmB,GAGzB,IACA,IACA,IAGA,EAAS,GAAG,IAAK,eAAgB,GAAK,CACpC,GAAM,GAAc,MAAM,KACxB,SAAS,iBAAmC,oBAC5C,MAGF,AAAI,GAAe,CAAC,OAAO,UAAU,UAAU,SAAS,YACtD,GAAE,iBACF,EAAY,WAMhB,EAAS,GAAG,IAAK,oBAAqB,IAAM,CAzD5C,MA0DE,GAAM,GAAmB,YAAS,cAA8B,0BAAvC,cAAgE,QACvF,iBAEF,AAAI,GAAoB,IAAqB,IAC3C,OAAO,QAAQ,aAAa,KAAM,GAAI,KAO1C,AAAC,WAAiC,CAChC,AAAU,EAAM,CACd,YAAa,GAAI,QAAO,UACxB,MAAO,eASX,YAA2B,CACzB,GAAM,GAAY,GAAI,iBAAgB,OAAO,SAAS,QAChD,EAAY,EAAU,IAAI,cAChC,GAAI,IAAc,SAAW,IAAc,SAAW,IAAc,WAClE,OAIF,GAAM,GAAS,GAAI,KAAI,OAAO,SAAS,MACvC,EAAU,OAAO,cACjB,EAAO,OAAS,EAAU,WAC1B,OAAO,QAAQ,aAAa,KAAM,GAAI,EAAO,YA5F/C,MA+FA,AAAI,aAAS,cAA2B,eAApC,cAAkD,QAAQ,QAAS,OAAO,UAC5E,AAAU,EAAK,UAAY,CACzB,MAGF,IAGF,OAAW,KAAM,UAAS,iBAAiB,mBACzC,EAAG,iBAAiB,QAAS,IAAM,CACjC,OAOJ,aAAuB,CACrB,GAAI,GAAY,OACV,EAAQ,SAAS,gBAAgB,aAAa,cACpD,AAAI,IAAU,OACZ,EAAY,QACH,IAAU,SACnB,GAAY,QAEd,SAAS,gBAAgB,aAAa,aAAc,GACpD,SAAS,OAAS,wBAAwB",
   "names": []
 }
diff --git a/static/frontend/frontend.ts b/static/frontend/frontend.ts
index 36a84dc..77e4e51 100644
--- a/static/frontend/frontend.ts
+++ b/static/frontend/frontend.ts
@@ -40,11 +40,6 @@
 registerSearchFormListeners();
 initModals();
 
-// Temporary shortcut for testing out the dark theme.
-keyboard.on('t', 'toggle theme', () => {
-  toggleTheme();
-});
-
 // Pressing '/' focuses the search box
 keyboard.on('/', 'focus search', e => {
   const searchInput = Array.from(