From 3a4ed1bf4dfde86db8c2f3d609510502c580fa0a Mon Sep 17 00:00:00 2001 From: Ryan Domingue Date: Sun, 29 Mar 2020 16:44:49 -0700 Subject: [PATCH] Adds docs assets --- docs/_data/assets.yaml | 2 +- docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js | 2 ++ docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js.map | 1 + docs/build/js/global.14fb354bfee817c4342c.bundle.min.js | 2 -- docs/build/js/global.14fb354bfee817c4342c.bundle.min.js.map | 1 - 5 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js create mode 100644 docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js.map delete mode 100644 docs/build/js/global.14fb354bfee817c4342c.bundle.min.js delete mode 100644 docs/build/js/global.14fb354bfee817c4342c.bundle.min.js.map diff --git a/docs/_data/assets.yaml b/docs/_data/assets.yaml index 095e00dd..0ac06472 100644 --- a/docs/_data/assets.yaml +++ b/docs/_data/assets.yaml @@ -1 +1 @@ -global: { css: 'build/css/global.f0739c4bd2ecae532939.min.css', js: 'build/js/global.14fb354bfee817c4342c.bundle.min.js' } +global: { css: 'build/css/global.f0739c4bd2ecae532939.min.css', js: 'build/js/global.0bfa4ac419357bb76f4b.bundle.min.js' } diff --git a/docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js b/docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js new file mode 100644 index 00000000..1cd9c806 --- /dev/null +++ b/docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js @@ -0,0 +1,2 @@ +(function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&'object'==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:e}),2&n&&'string'!=typeof e)for(var a in e)t.d(r,a,function(t){return e[t]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='/build/',t(t.s=10)})([function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(e,t,n){'use strict';function r(e){return Object.keys(e).reduce(function(t,n){return t[n]='.'.concat(e[n]),t},{})}function a(e){if(Array.isArray(e))return e;let t=[];return e instanceof HTMLElement?t=Array(e):(e instanceof NodeList||e instanceof HTMLCollection)&&(t=Array.prototype.slice.call(e,0)),t}function i(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.removeAttribute('tabindex')})}function o(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.setAttribute('tabindex','-1')})}function d(e,t){const n=Array.isArray(t)?t:a(t),r=Array.isArray(e)?e:a(e);if(i(n),0!n.includes(e));o(e)}}function l(e=36){const[,t]=Math.random().toString(e).split('.');return`id_${t}`}function s(e){null!==e&&''===e.id&&e.setAttribute('id',l())}function c(e,t){return void 0!==e&&null!==e&&e instanceof t}function u(e,t,n,r){const{next:a,previous:i}=r,o=n.indexOf(t),d=n.length-1;let l=e===i?o-1:o+1;return i===e&&0>l&&(l=d),a===e&&d(Object.defineProperty(e,this.componentName.toLowerCase(),{value:this,configurable:!0}),e));this.referenceElements=[...this.referenceElements,...t]}deleteSelfReferences(){this.referenceElements.forEach((e)=>{delete e[this.componentName.toLowerCase()]})}getState(){return this.state}warnDeprecated(e,t=!1){const n=t?`Use ${t} instead.`:'';console.warn(`${this.componentName}:`,`${e} is deprecated.`,`${n}`)}}const y=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});var A=y,E=function(e){const t=e.querySelectorAll('a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])');return Array.prototype.slice.call(t)};class S extends f{constructor(e){super(e),this.componentName='Popup';Object.assign(this,{controller:null,target:null,type:'true',onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:!1},this.init=this.init.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.controllerClickHandler=this.controllerClickHandler.bind(this),this.controllerKeyDownHandler=this.controllerKeyDownHandler.bind(this),this.targetKeyDownHandler=this.targetKeyDownHandler.bind(this),this.hideOnTabOut=this.hideOnTabOut.bind(this),this.hideOnOutsideClick=this.hideOnOutsideClick.bind(this),this.destroy=this.destroy.bind(this),this.controllerIsNotAButton='BUTTON'!==this.controller.nodeName&&null===this.controller.getAttribute('role'),null!==this.controller&&null!==this.target&&this.init()}init(){if(super.setSelfReference([this.controller,this.target]),this.interactiveChildElements=E(this.target),o(this.interactiveChildElements),0{e.getAttribute('id').includes('id_')&&e.removeAttribute('id')}),this.controller.removeAttribute('aria-haspopup'),this.controller.removeAttribute('aria-expanded'),this.controller.removeAttribute('aria-controls'),this.controller.removeAttribute('aria-owns'),this.controllerIsNotAButton&&(this.controller.removeAttribute('role'),this.controller.removeAttribute('tabindex')),this.target.removeAttribute('aria-hidden'),this.target.removeAttribute('hidden'),i(this.interactiveChildElements),this.controller.removeEventListener('click',this.controllerClickHandler),this.controller.removeEventListener('keydown',this.controllerKeyDownHandler),this.target.removeEventListener('keydown',this.targetKeyDownHandler),document.body.removeEventListener('click',this.hideOnOutsideClick),this.state={expanded:!1},this.onDestroy.call(this)}show(){this.setState({expanded:!0})}hide(){this.setState({expanded:!1})}}class C{constructor(e){switch(this.searchString='',this.clearSearch=null,!0){case Array.isArray(e):{this.items=e;break}case e instanceof NodeList:{this.items=Array.prototype.slice.call(e,0);break}case null!==e&&'UL'===e.nodeName:{this.items=Array.prototype.slice.call(e.children,0);break}default:{this.items=null;break}}}getItem(e){if(null!==this.items){const t=String.fromCharCode(e);this.searchString+=t,null!==this.clearSearch&&(clearTimeout(this.clearSearch),this.clearSearch=null),this.clearSearch=setTimeout(()=>{this.searchString='',this.clearSearch=null},500);const n=this.items.filter((e)=>{const t=e.textContent.toLowerCase();return 0===t.indexOf(this.searchString.toLowerCase())});return n.length?n[0]:null}return null}}class x extends f{constructor(e){super(e),this.componentName='Disclosure';Object.assign(this,{controller:null,target:null,loadOpen:!1,allowOutsideClick:!0,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:this.loadOpen},this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.toggleExpandedState=this.toggleExpandedState.bind(this),this.closeOnOutsideClick=this.closeOnOutsideClick.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){super.setSelfReference([this.controller,this.target]);const{expanded:e}=this.state;this.interactiveChildElements=E(this.target),[this.controller,this.target].forEach((e)=>{s(e)}),this.controller.setAttribute('aria-expanded',`${e}`),this.controller.setAttribute('aria-controls',this.target.id),'BUTTON'!==this.controller.nodeName&&(this.controller.setAttribute('role','button'),'A'!==this.controller.nodeName&&null===this.controller.getAttribute('tabindex')&&this.controller.setAttribute('tabindex','0')),this.target!==this.controller.nextElementSibling&&this.controller.setAttribute('aria-owns',this.target.id),e||(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),this.controller.addEventListener('click',this.toggleExpandedState),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.allowOutsideClick||document.body.addEventListener('click',this.closeOnOutsideClick),o(this.interactiveChildElements),this.onInit.call(this)}stateWasUpdated(){const{expanded:e}=this.state;this.controller.setAttribute('aria-expanded',`${e}`),e?(this.target.setAttribute('aria-hidden','false'),this.target.removeAttribute('hidden')):(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),e?i(this.interactiveChildElements):o(this.interactiveChildElements),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{SPACE:t,RETURN:n}=A,{keyCode:r}=e;[t,n].includes(r)&&this.toggleExpandedState(e)}toggleExpandedState(e){e.preventDefault(),this.state.expanded?this.close():this.open()}closeOnOutsideClick(e){this.state.expanded&&e.target!==this.controller&&!this.target.contains(e.target)&&this.close()}destroy(){this.deleteSelfReferences(),[this.controller,this.target].forEach((e)=>{e.getAttribute('id').includes('id_')&&e.removeAttribute('id')}),this.controller.removeAttribute('aria-expanded'),this.controller.removeAttribute('aria-controls'),this.controller.removeAttribute('aria-owns'),this.controller.removeAttribute('tabindex'),'BUTTON'!==this.controller.nodeName&&this.controller.removeAttribute('role'),this.target.removeAttribute('aria-hidden'),this.target.removeAttribute('hidden'),i(this.interactiveChildElements),this.controller.removeEventListener('click',this.toggleExpandedState),this.controller.removeEventListener('keydown',this.handleControllerKeydown),document.body.removeEventListener('click',this.closeOnOutsideClick),this.state={expanded:this.loadOpen},this.onDestroy.call(this)}open(){this.setState({expanded:!0})}close(){this.setState({expanded:!1})}}class w extends f{static getHelpIds(){return['#ac-describe-submenu-help','#ac-describe-esc-help','#ac-describe-submenu-explore','#ac-describe-submenu-back']}static nextElementIsUl(e){const t=e.nextElementSibling;return!(null===t||'UL'!==t.nodeName)&&t}constructor(e){if(super(e),this.componentName='Menu',e.menu){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}Object.assign(this,{list:null,collapse:!1,onInit:()=>{},onDestroy:()=>{}},e),this.handleListKeydown=this.handleListKeydown.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menu'),this.listItems=Array.prototype.slice.call(this.list.children),this.menuItems=this.listItems.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuItems),this.menuItemsLength=this.menuItems.length,this.list.addEventListener('keydown',this.handleListKeydown),h(w.getHelpIds()),this.disclosures=[],this.menuItems.forEach((e,t)=>{e.parentElement.setAttribute('role','presentation'),e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-submenu-explore ac-describe-submenu-help ac-describe-submenu-back ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuItemsLength),e.setAttribute('aria-posinset',t+1);const n=this.constructor.nextElementIsUl(e);if(n){if(this.collapse){const t=new x({controller:e,target:n});this.disclosures.push(t)}const t=new w({list:n});t.previousSibling=e}});const[e]=this.menuItems,t=this.menuItems[this.menuItems.length-1];Object.assign(this,{firstItem:e,lastItem:t}),this.onInit.call(this)}handleListKeydown(e){const{keyCode:t}=e,{UP:n,DOWN:r,LEFT:a,RIGHT:i,HOME:o,END:d,ESC:l}=A,{activeElement:s}=document,u=this.list.contains(s)?s:this.menuItems[0];switch(t){case n:case r:{const n=p(t,u,this.menuItems);n&&(e.stopPropagation(),e.preventDefault(),n.focus());break}case o:{e.preventDefault(),this.firstItem.focus();break}case d:{e.preventDefault(),this.lastItem.focus();break}case i:{const t=this.constructor.nextElementIsUl(u);if(t&&c(t.menu,w)){e.stopPropagation(),e.preventDefault(),c(u.disclosure,x)&&u.disclosure.open();const{menu:n}=t;n.firstItem.focus()}break}case a:{void 0===this.previousSibling||this.previousSibling.hasAttribute('aria-haspopup')||(e.preventDefault(),e.stopPropagation(),c(this.previousSibling.disclosure,x)&&this.previousSibling.disclosure.close(),this.previousSibling.focus());break}case l:break;default:{e.stopPropagation();const n=this.search.getItem(t);null!==n&&n.focus();break}}}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.list.removeEventListener('keydown',this.handleListKeydown),this.menuItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset');const t=this.constructor.nextElementIsUl(e);t&&c(t.menu,w)&&t.menu.destroy()}),this.disclosures.forEach((e)=>{e.destroy()}),this.onDestroy.call(this)}}class I extends f{static getPopupFromMenubarItem(e){return!!c(e.popup,S)&&e.popup}static getHelpIds(){return['#ac-describe-top-level-help','#ac-describe-submenu-help','#ac-describe-esc-help']}constructor(e){super(e),this.componentName='MenuBar',Object.keys(e).forEach((t)=>{if('menu'===t){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}['onPopupDestroy','onPopupStateChange'].includes(t)&&this.warnDeprecated(`config.${t}`)});Object.assign(this,{list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{},onPopupInit:()=>{}},e),this.handleMenuBarKeydown=this.handleMenuBarKeydown.bind(this),this.handleMenuBarClick=this.handleMenuBarClick.bind(this),this.handleMenuItemKeydown=this.handleMenuItemKeydown.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.trackPopupState=this.trackPopupState.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menubar'),this.menuBarChildren=Array.prototype.slice.call(this.list.children),this.menuBarItems=this.menuBarChildren.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuBarItems),this.menuLength=this.menuBarItems.length,h(I.getHelpIds()),this.menuBarItems.forEach((e,t)=>{e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-top-level-help ac-describe-submenu-help ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuLength),e.setAttribute('aria-posinset',t+1),e.parentElement.setAttribute('role','presentation'),e.parentElement.addEventListener('keydown',this.handleMenuBarKeydown),e.addEventListener('click',this.handleMenuBarClick)}),this.lastIndex=this.menuLength-1,this.clickEvent=new MouseEvent('click',{view:window,bubbles:!0,cancelable:!0}),this.popups=this.menuBarItems.reduce((e,t)=>{const n=t.nextElementSibling;if(null!==n&&'UL'===n.nodeName){const r=new S({controller:t,target:n,onInit:this.onPopupInit,onStateChange:this.trackPopupState,type:'menu'}),a=new w({list:n});return n.addEventListener('keydown',this.handleMenuItemKeydown),a.previousSibling=t,[...e,r]}return e},[]);const[e]=this.menuBarItems;this.state={menubarItem:e,popup:this.constructor.getPopupFromMenubarItem(e),expanded:!1},d(this.menuBarItems,e),this.onInit.call(this)}trackPopupState(e={}){const{menubarItem:t}=this.state,n=this.constructor.getPopupFromMenubarItem(t),r=!1===n||Object.prototype.hasOwnProperty.call(e,'expanded')?e.expanded:n.getState();this.state=Object.assign({menubarItem:t,popup:n,expanded:r})}stateWasUpdated(){const{menubarItem:e}=this.state;this.trackPopupState(),d(this.menuBarItems,e),e.focus(),this.onStateChange.call(this,this.state)}handleMenuBarKeydown(e){const{LEFT:t,RIGHT:n,DOWN:r,HOME:a,END:i,SPACE:o,RETURN:d}=A,{keyCode:l}=e,{menubarItem:s,popup:c}=this.state;switch(l){case t:case n:{const t=b(l,s,this.menuBarItems);t&&(e.stopPropagation(),e.preventDefault(),c&&c.setState({expanded:!1}),this.setState({menubarItem:t}));break}case o:case d:case r:{c&&(e.stopPropagation(),e.preventDefault(),!c.state.expanded&&c.setState({expanded:!0}),c.firstChild.focus());break}case a:{e.preventDefault();const[t]=this.menuBarItems;this.setState({menubarItem:t});break}case i:{e.preventDefault(),this.setState({menubarItem:this.menuBarItems[this.lastIndex]});break}default:{const e=this.search.getItem(l);null!==e&&this.setState({menubarItem:e});break}}}handleMenuBarClick(e){this.setState({menubarItem:e.target})}handleMenuItemKeydown(e){const{SPACE:t,RETURN:n}=A,{keyCode:r,target:a}=e;[t,n].includes(r)&&'A'===a.nodeName&&(e.stopPropagation(),e.preventDefault(),a.dispatchEvent(this.clickEvent))}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.menuBarItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset'),e.removeAttribute('role'),e.parentElement.removeEventListener('keydown',this.handleMenuBarKeydown),e.removeEventListener('click',this.handleMenuBarClick)}),i(this.menuBarItems),this.popups.forEach((e)=>{c(e.target.menu,w)&&e.target.menu.destroy(),e.target.removeEventListener('keydown',this.handleMenuItemKeydown),e.destroy()}),this.onDestroy.call(this)}}class k extends f{static createCloseButton(){const e=document.createElement('button');return e.innerText='Close',e}constructor(e){super(e),this.componentName='Dialog';const t={controller:null,target:null,content:null,close:this.constructor.createCloseButton(),onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}};Object.assign(this,t,e),void 0===e.close&&null!==this.target&&this.target.insertBefore(this.close,this.target.firstChild),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleKeydownEsc=this.handleKeydownEsc.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null===this.controller||null===this.target||null===this.content||this.content.contains(this.target)||this.init()}init(){super.setSelfReference([this.controller,this.target]),this.popup=new S({controller:this.controller,target:this.target,type:'dialog',onStateChange:this.onPopupStateChange}),this.interactiveChildren=E(this.target),this.close.addEventListener('click',this.hide),this.target.addEventListener('keydown',this.handleTargetKeydown),this.popup.target.removeEventListener('keydown',this.popup.targetKeyDownHandler),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange({expanded:e}){this.setState({expanded:e})}stateWasUpdated(){const{expanded:e}=this.state;this.interactiveChildren=E(this.target),e?(this.content.setAttribute('aria-hidden','true'),this.content.setAttribute('hidden',''),document.body.addEventListener('keydown',this.handleKeydownEsc),this.close.focus()):(this.content.setAttribute('aria-hidden','false'),this.content.removeAttribute('hidden'),document.body.removeEventListener('keydown',this.handleKeydownEsc),this.controller.focus()),this.onStateChange.call(this,this.state)}outsideClick(e){const{expanded:t}=this.popup.getState();t&&!this.target.contains(e.target)&&this.hide()}handleTargetKeydown(e){const{TAB:t}=A,{keyCode:n,shiftKey:r}=e;if(this.popup.getState().expanded&&n===t){const{activeElement:t}=document,n=this.interactiveChildren.length-1,[a]=this.interactiveChildren,i=this.interactiveChildren[n];r&&a===t?(e.preventDefault(),i.focus()):!r&&i===t&&(e.preventDefault(),a.focus())}}handleKeydownEsc(e){const{ESC:t}=A,{keyCode:n}=e;t===n&&this.hide()}destroy(){this.deleteSelfReferences(),this.popup.destroy(),this.content.removeAttribute('aria-hidden'),this.close.removeEventListener('click',this.hide),this.target.removeEventListener('keydown',this.handleTargetKeydown),document.body.removeEventListener('keydown',this.handleKeydownEsc),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}var L=n(2),D=r(siteClassNames.popup),T=D.button,K=D.info,O=document.querySelector(T),N=document.querySelector(K),P=new S({controller:O,target:N}),B=n(3),U=r(siteClassNames.tablist),R=U.list,H=U.panel,W=document.querySelector(R),M=document.querySelectorAll(H),q=new class extends f{constructor(e){if(super(),this.componentName='Tablist',e.tablist){const{tablist:t}=e;Object.assign(e,{tabs:t,tablist:void 0}),this.warnDeprecated('config.tablist','config.tabs')}if('UL'!==e.tabs.nodeName)return void console.warn('Tablist requires a
    for the tabs.');Object.assign(this,{list:null,panels:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={activeIndex:0},this.handlePanelKeydown=this.handlePanelKeydown.bind(this),this.handleTabsKeydown=this.handleTabsKeydown.bind(this),this.handleTabsClick=this.handleTabsClick.bind(this),this.switchTo=this.switchTo.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),Array.isArray(this.panels)||(this.panels=Array.prototype.slice.call(this.panels)),this.tabLinks=Array.prototype.filter.call(this.tabs.children,(e)=>null!==e.querySelector('a[href]')).map((e)=>e.querySelector('a[href]')),this.tabLinks.length===this.panels.length&&this.init()}init(){const{activeIndex:e}=this.state;this.tabs.setAttribute('role','tablist'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.setAttribute('role','presentation')}),this.tabLinks.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tab'),e===n?t.setAttribute('aria-selected','true'):t.setAttribute('tabindex','-1'),t.setAttribute('aria-controls',this.panels[n].id)}),this.tabs.addEventListener('click',this.handleTabsClick),this.tabs.addEventListener('keydown',this.handleTabsKeydown),this.panels.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tabpanel'),t.setAttribute('aria-labelledby',this.tabLinks[n].id),e===n?(t.setAttribute('tabindex','0'),t.setAttribute('aria-hidden','false'),t.removeAttribute('hidden')):(t.setAttribute('aria-hidden','true'),t.setAttribute('hidden','')),t.addEventListener('keydown',this.handlePanelKeydown)}),this.interactiveChildren=E(this.panels[e]),this.onInit.call(this)}stateWasUpdated(){const{activeIndex:e}=this.state,[t]=this.tabLinks.filter((e)=>'true'===e.getAttribute('aria-selected')),n=this.tabLinks.indexOf(t);t.setAttribute('tabindex','-1'),t.removeAttribute('aria-selected'),this.panels[n].setAttribute('aria-hidden','true'),this.panels[n].setAttribute('hidden',''),this.panels[n].removeAttribute('tabindex');const r=E(this.panels[n]);o(r),this.tabLinks[e].removeAttribute('tabindex'),this.tabLinks[e].setAttribute('aria-selected','true'),this.panels[e].setAttribute('aria-hidden','false'),this.panels[e].removeAttribute('hidden'),this.panels[e].setAttribute('tabindex','0'),this.interactiveChildren=E(this.panels[e]),i(this.interactiveChildren),this.onStateChange.call(this,this.state)}handlePanelKeydown(e){const{TAB:t}=A,{activeIndex:n}=this.state,{keyCode:r,shiftKey:a}=e,{activeElement:i}=document,[o]=this.interactiveChildren;r===t&&a&&(i===this.panels[n]?(e.preventDefault(),this.tabLinks[n].focus()):i===o&&(e.preventDefault(),this.panels[n].focus()))}handleTabsKeydown(e){const{TAB:t,LEFT:n,RIGHT:r,DOWN:a,HOME:i,END:o}=A,{keyCode:d,shiftKey:l,target:s}=e,c=this.tabLinks.indexOf(s);switch(d){case t:{l||(e.preventDefault(),this.panels[c].focus());break}case n:case r:{const t=b(d,s,this.tabLinks);t&&(e.preventDefault(),this.switchTo(this.tabLinks.indexOf(t)),t.focus());break}case a:{e.preventDefault(),this.panels[c].setAttribute('tabindex','0'),this.panels[c].focus();break}case i:{e.preventDefault(),this.switchTo(0),this.tabLinks[0].focus();break}case o:{e.preventDefault();const t=this.tabLinks.length-1;this.switchTo(t),this.tabLinks[t].focus();break}default:}}handleTabsClick(e){const{target:t}=e;e.preventDefault(),'true'!==t.getAttribute('aria-selected')&&this.tabLinks.includes(t)&&this.switchTo(this.tabLinks.indexOf(t))}switchTo(e){this.setState({activeIndex:e})}destroy(){this.tabs.removeAttribute('role'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.removeAttribute('role')}),this.deleteSelfReferences(),this.tabLinks.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-selected'),e.removeAttribute('tabindex'),e.removeAttribute('aria-controls'),e.removeEventListener('click',this.handleTabsClick),e.removeEventListener('keydown',this.handleTabsKeydown)}),this.panels.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-hidden'),e.removeAttribute('hidden'),e.removeAttribute('tabindex'),e.removeAttribute('aria-labelledby');const t=E(e);i(t),e.removeEventListener('keydown',this.handlePanelKeydown)}),this.onDestroy.call(this)}}({tabs:W,panels:M}),_=n(4),F=r(siteClassNames.listbox),G=F.button,z=F.list,j=document.querySelector(G),V=document.querySelector(z),Q=new class extends f{constructor(e){super(e),this.componentName='ListBox';Object.assign(this,{controller:null,target:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.preventWindowScroll=this.preventWindowScroll.bind(this),this.handleControllerKeyup=this.handleControllerKeyup.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleTargetClicks=this.handleTargetClicks.bind(this),this.handleTargetBlur=this.handleTargetBlur.bind(this),this.scrollOptionIntoView=this.scrollOptionIntoView.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.init()}init(){super.setSelfReference([this.controller,this.target]),this.options=Array.prototype.slice.call(this.target.children,0),this.search=new C(this.options),this.options.forEach((e)=>{s(e),e.setAttribute('role','option')});const[e]=this.options,t=this.options[this.options.length-1];Object.assign(this,{firstOption:e,lastOption:t}),this.state={activeDescendant:this.firstOption},this.popup=new S({controller:this.controller,target:this.target,type:'listbox',onStateChange:this.onPopupStateChange}),this.target.setAttribute('role','listbox'),this.target.setAttribute('tabindex','-1'),this.controller.addEventListener('keydown',this.handleControllerKeyup),this.target.addEventListener('keydown',this.handleTargetKeydown),this.target.addEventListener('click',this.handleTargetClicks),this.target.addEventListener('blur',this.handleTargetBlur),window.addEventListener('keydown',this.preventWindowScroll),this.onInit.call(this)}stateWasUpdated(){const{activeDescendant:e,expanded:t}=this.state;if(t){const t=this.target.querySelector('[aria-selected="true"]');null!==t&&t.removeAttribute('aria-selected'),e.setAttribute('aria-selected','true'),this.target.setAttribute('aria-activedescendant',e.id),this.scrollOptionIntoView(e)}this.onStateChange.call(this,this.state)}onPopupStateChange({expanded:e}){const{activeDescendant:t}=this.state;e?this.target.focus():(this.target.removeAttribute('aria-activedescendant'),this.controller.textContent=t.textContent,this.target.contains(document.activeElement)&&this.controller.focus()),this.setState({activeDescendant:t,expanded:e})}preventWindowScroll(e){const{UP:t,DOWN:n}=A,{target:r,keyCode:a}=e;r===this.target&&[t,n].includes(a)&&e.preventDefault()}handleControllerKeyup(e){const{UP:t,DOWN:n}=A;[t,n].includes(e.keyCode)&&(e.preventDefault(),this.show())}handleTargetKeydown(e){const{activeDescendant:t}=this.state,{keyCode:n}=e,{RETURN:r,ESC:a,UP:i,DOWN:o,SPACE:d,HOME:l,END:s}=A;switch(n){case a:case r:case d:{e.preventDefault(),this.hide(),this.controller.focus();break}case i:case o:{let r=t;r=n===i?r.previousElementSibling:r.nextElementSibling,r&&(e.preventDefault(),this.setState({activeDescendant:r}));break}case l:{e.preventDefault(),this.setState({activeDescendant:this.firstOption});break}case s:{e.preventDefault(),this.setState({activeDescendant:this.lastOption});break}default:{const e=this.search.getItem(n);null!==e&&this.setState({activeDescendant:e});break}}}handleTargetClicks(e){this.setState({activeDescendant:e.target}),this.hide()}handleTargetBlur(){this.popup.getState().expanded&&this.hide()}scrollOptionIntoView(e){const{scrollHeight:t,clientHeight:n,scrollTop:r}=this.target,{offsetTop:a,offsetHeight:i}=e;if(t>n){const e=a+i;e>n+r?this.target.scrollTop=e-n:a{e.removeAttribute('role'),e.removeAttribute('aria-selected'),e.getAttribute('id').includes('id_')&&e.removeAttribute('id')}),this.popup.destroy(),this.target.removeAttribute('role'),this.target.removeAttribute('tabindex'),this.target.removeAttribute('aria-activedescendant'),this.controller.removeEventListener('keyup',this.handleControllerKeyup),this.target.removeEventListener('keydown',this.handleTargetKeydown),this.target.removeEventListener('click',this.handleTargetClicks),this.target.removeEventListener('blur',this.handleTargetBlur),window.removeEventListener('keydown',this.preventWindowScroll),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:j,target:V}),X=n(5),Y=r(siteClassNames.menu),Z=Y.list,$=document.querySelector(Z),J=new w({list:$}),ee=n(6),te=r(siteClassNames.dialog),ne=te.link,re=te.closeButton;window.addEventListener('load',function(){var e=document.querySelector(ne),t=document.getElementById('dialog'),n=document.querySelector(re),r=document.querySelector('.site'),a=new k({controller:e,target:t,close:n,content:r})});var ae=n(7),ie=r(siteClassNames.menubar),oe=ie.list,de=document.querySelector(oe),le=new I({list:de}),se=n(8),ce=r(siteClassNames.disclosure),ue=ce.button,pe=ce.info,be=document.querySelectorAll(ue),me=document.querySelectorAll(pe);if(be.length===me.length)Array.prototype.map.call(be,function(e,t){return new x({controller:e,target:me[t]})});var he=n(9),ge=r(siteClassNames.menubutton),ve=ge.button,fe=ge['menu-wrapper'],ye=ge.menu,Ae=document.querySelector(ve),Ee=document.querySelector(fe),Se=document.querySelector(ye),Ce=new class extends f{constructor(e){super(e),this.componentName='MenuButton';Object.assign(this,{controller:null,target:null,list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){this.popup=new S({controller:this.controller,target:this.target,type:'menu',onStateChange:this.onPopupStateChange}),null!==this.list&&'UL'===this.list.nodeName?this.menu=new w({list:this.list}):'UL'===this.target.nodeName&&(this.menu=new w({list:this.target})),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange(e){this.setState(e),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{keyCode:t}=e,{RETURN:n,UP:r,DOWN:a,SPACE:i}=A;switch(t){case n:case i:case a:{e.preventDefault(),this.show(),this.menu.firstItem&&this.menu.firstItem.focus();break}case r:{e.preventDefault(),this.show(),this.menu.lastItem&&this.menu.lastItem.focus();break}default:}}destroy(){this.popup.destroy(),this.menu.destroy(),this.controller.removeEventListener('keydown',this.handleControllerKeydown),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:Ae,target:Ee,list:Se})}]); +//# sourceMappingURL=global.0bfa4ac419357bb76f4b.bundle.min.js.map \ No newline at end of file diff --git a/docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js.map b/docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js.map new file mode 100644 index 00000000..a698924b --- /dev/null +++ b/docs/build/js/global.0bfa4ac419357bb76f4b.bundle.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"js/global.0bfa4ac419357bb76f4b.bundle.min.js","sources":["webpack:///js/global.0bfa4ac419357bb76f4b.bundle.min.js"],"sourcesContent":["(function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&'object'==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:e}),2&n&&'string'!=typeof e)for(var a in e)t.d(r,a,function(t){return e[t]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='/build/',t(t.s=10)})([function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(e,t,n){'use strict';function r(e){return Object.keys(e).reduce(function(t,n){return t[n]='.'.concat(e[n]),t},{})}function a(e){if(Array.isArray(e))return e;let t=[];return e instanceof HTMLElement?t=Array(e):(e instanceof NodeList||e instanceof HTMLCollection)&&(t=Array.prototype.slice.call(e,0)),t}function i(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.removeAttribute('tabindex')})}function o(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.setAttribute('tabindex','-1')})}function d(e,t){const n=Array.isArray(t)?t:a(t),r=Array.isArray(e)?e:a(e);if(i(n),0!n.includes(e));o(e)}}function l(e=36){const[,t]=Math.random().toString(e).split('.');return`id_${t}`}function s(e){null!==e&&''===e.id&&e.setAttribute('id',l())}function c(e,t){return void 0!==e&&null!==e&&e instanceof t}function u(e,t,n,r){const{next:a,previous:i}=r,o=n.indexOf(t),d=n.length-1;let l=e===i?o-1:o+1;return i===e&&0>l&&(l=d),a===e&&d(Object.defineProperty(e,this.componentName.toLowerCase(),{value:this,configurable:!0}),e));this.referenceElements=[...this.referenceElements,...t]}deleteSelfReferences(){this.referenceElements.forEach((e)=>{delete e[this.componentName.toLowerCase()]})}getState(){return this.state}warnDeprecated(e,t=!1){const n=t?`Use ${t} instead.`:'';console.warn(`${this.componentName}:`,`${e} is deprecated.`,`${n}`)}}const y=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});var A=y,E=function(e){const t=e.querySelectorAll('a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^=\"-\"])');return Array.prototype.slice.call(t)};class S extends f{constructor(e){super(e),this.componentName='Popup';Object.assign(this,{controller:null,target:null,type:'true',onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:!1},this.init=this.init.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.controllerClickHandler=this.controllerClickHandler.bind(this),this.controllerKeyDownHandler=this.controllerKeyDownHandler.bind(this),this.targetKeyDownHandler=this.targetKeyDownHandler.bind(this),this.hideOnTabOut=this.hideOnTabOut.bind(this),this.hideOnOutsideClick=this.hideOnOutsideClick.bind(this),this.destroy=this.destroy.bind(this),this.controllerIsNotAButton='BUTTON'!==this.controller.nodeName&&null===this.controller.getAttribute('role'),null!==this.controller&&null!==this.target&&this.init()}init(){if(super.setSelfReference([this.controller,this.target]),this.interactiveChildElements=E(this.target),o(this.interactiveChildElements),0{e.getAttribute('id').includes('id_')&&e.removeAttribute('id')}),this.controller.removeAttribute('aria-haspopup'),this.controller.removeAttribute('aria-expanded'),this.controller.removeAttribute('aria-controls'),this.controller.removeAttribute('aria-owns'),this.controllerIsNotAButton&&(this.controller.removeAttribute('role'),this.controller.removeAttribute('tabindex')),this.target.removeAttribute('aria-hidden'),this.target.removeAttribute('hidden'),i(this.interactiveChildElements),this.controller.removeEventListener('click',this.controllerClickHandler),this.controller.removeEventListener('keydown',this.controllerKeyDownHandler),this.target.removeEventListener('keydown',this.targetKeyDownHandler),document.body.removeEventListener('click',this.hideOnOutsideClick),this.state={expanded:!1},this.onDestroy.call(this)}show(){this.setState({expanded:!0})}hide(){this.setState({expanded:!1})}}class C{constructor(e){switch(this.searchString='',this.clearSearch=null,!0){case Array.isArray(e):{this.items=e;break}case e instanceof NodeList:{this.items=Array.prototype.slice.call(e,0);break}case null!==e&&'UL'===e.nodeName:{this.items=Array.prototype.slice.call(e.children,0);break}default:{this.items=null;break}}}getItem(e){if(null!==this.items){const t=String.fromCharCode(e);this.searchString+=t,null!==this.clearSearch&&(clearTimeout(this.clearSearch),this.clearSearch=null),this.clearSearch=setTimeout(()=>{this.searchString='',this.clearSearch=null},500);const n=this.items.filter((e)=>{const t=e.textContent.toLowerCase();return 0===t.indexOf(this.searchString.toLowerCase())});return n.length?n[0]:null}return null}}class x extends f{constructor(e){super(e),this.componentName='Disclosure';Object.assign(this,{controller:null,target:null,loadOpen:!1,allowOutsideClick:!0,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:this.loadOpen},this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.toggleExpandedState=this.toggleExpandedState.bind(this),this.closeOnOutsideClick=this.closeOnOutsideClick.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){super.setSelfReference([this.controller,this.target]);const{expanded:e}=this.state;this.interactiveChildElements=E(this.target),[this.controller,this.target].forEach((e)=>{s(e)}),this.controller.setAttribute('aria-expanded',`${e}`),this.controller.setAttribute('aria-controls',this.target.id),'BUTTON'!==this.controller.nodeName&&(this.controller.setAttribute('role','button'),'A'!==this.controller.nodeName&&null===this.controller.getAttribute('tabindex')&&this.controller.setAttribute('tabindex','0')),this.target!==this.controller.nextElementSibling&&this.controller.setAttribute('aria-owns',this.target.id),e||(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),this.controller.addEventListener('click',this.toggleExpandedState),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.allowOutsideClick||document.body.addEventListener('click',this.closeOnOutsideClick),o(this.interactiveChildElements),this.onInit.call(this)}stateWasUpdated(){const{expanded:e}=this.state;this.controller.setAttribute('aria-expanded',`${e}`),e?(this.target.setAttribute('aria-hidden','false'),this.target.removeAttribute('hidden')):(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),e?i(this.interactiveChildElements):o(this.interactiveChildElements),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{SPACE:t,RETURN:n}=A,{keyCode:r}=e;[t,n].includes(r)&&this.toggleExpandedState(e)}toggleExpandedState(e){e.preventDefault(),this.state.expanded?this.close():this.open()}closeOnOutsideClick(e){this.state.expanded&&e.target!==this.controller&&!this.target.contains(e.target)&&this.close()}destroy(){this.deleteSelfReferences(),[this.controller,this.target].forEach((e)=>{e.getAttribute('id').includes('id_')&&e.removeAttribute('id')}),this.controller.removeAttribute('aria-expanded'),this.controller.removeAttribute('aria-controls'),this.controller.removeAttribute('aria-owns'),this.controller.removeAttribute('tabindex'),'BUTTON'!==this.controller.nodeName&&this.controller.removeAttribute('role'),this.target.removeAttribute('aria-hidden'),this.target.removeAttribute('hidden'),i(this.interactiveChildElements),this.controller.removeEventListener('click',this.toggleExpandedState),this.controller.removeEventListener('keydown',this.handleControllerKeydown),document.body.removeEventListener('click',this.closeOnOutsideClick),this.state={expanded:this.loadOpen},this.onDestroy.call(this)}open(){this.setState({expanded:!0})}close(){this.setState({expanded:!1})}}class w extends f{static getHelpIds(){return['#ac-describe-submenu-help','#ac-describe-esc-help','#ac-describe-submenu-explore','#ac-describe-submenu-back']}static nextElementIsUl(e){const t=e.nextElementSibling;return!(null===t||'UL'!==t.nodeName)&&t}constructor(e){if(super(e),this.componentName='Menu',e.menu){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}Object.assign(this,{list:null,collapse:!1,onInit:()=>{},onDestroy:()=>{}},e),this.handleListKeydown=this.handleListKeydown.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menu'),this.listItems=Array.prototype.slice.call(this.list.children),this.menuItems=this.listItems.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuItems),this.menuItemsLength=this.menuItems.length,this.list.addEventListener('keydown',this.handleListKeydown),h(w.getHelpIds()),this.disclosures=[],this.menuItems.forEach((e,t)=>{e.parentElement.setAttribute('role','presentation'),e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-submenu-explore ac-describe-submenu-help ac-describe-submenu-back ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuItemsLength),e.setAttribute('aria-posinset',t+1);const n=this.constructor.nextElementIsUl(e);if(n){if(this.collapse){const t=new x({controller:e,target:n});this.disclosures.push(t)}const t=new w({list:n});t.previousSibling=e}});const[e]=this.menuItems,t=this.menuItems[this.menuItems.length-1];Object.assign(this,{firstItem:e,lastItem:t}),this.onInit.call(this)}handleListKeydown(e){const{keyCode:t}=e,{UP:n,DOWN:r,LEFT:a,RIGHT:i,HOME:o,END:d,ESC:l}=A,{activeElement:s}=document,u=this.list.contains(s)?s:this.menuItems[0];switch(t){case n:case r:{const n=p(t,u,this.menuItems);n&&(e.stopPropagation(),e.preventDefault(),n.focus());break}case o:{e.preventDefault(),this.firstItem.focus();break}case d:{e.preventDefault(),this.lastItem.focus();break}case i:{const t=this.constructor.nextElementIsUl(u);if(t&&c(t.menu,w)){e.stopPropagation(),e.preventDefault(),c(u.disclosure,x)&&u.disclosure.open();const{menu:n}=t;n.firstItem.focus()}break}case a:{void 0===this.previousSibling||this.previousSibling.hasAttribute('aria-haspopup')||(e.preventDefault(),e.stopPropagation(),c(this.previousSibling.disclosure,x)&&this.previousSibling.disclosure.close(),this.previousSibling.focus());break}case l:break;default:{e.stopPropagation();const n=this.search.getItem(t);null!==n&&n.focus();break}}}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.list.removeEventListener('keydown',this.handleListKeydown),this.menuItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset');const t=this.constructor.nextElementIsUl(e);t&&c(t.menu,w)&&t.menu.destroy()}),this.disclosures.forEach((e)=>{e.destroy()}),this.onDestroy.call(this)}}class I extends f{static getPopupFromMenubarItem(e){return!!c(e.popup,S)&&e.popup}static getHelpIds(){return['#ac-describe-top-level-help','#ac-describe-submenu-help','#ac-describe-esc-help']}constructor(e){super(e),this.componentName='MenuBar',Object.keys(e).forEach((t)=>{if('menu'===t){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}['onPopupDestroy','onPopupStateChange'].includes(t)&&this.warnDeprecated(`config.${t}`)});Object.assign(this,{list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{},onPopupInit:()=>{}},e),this.handleMenuBarKeydown=this.handleMenuBarKeydown.bind(this),this.handleMenuBarClick=this.handleMenuBarClick.bind(this),this.handleMenuItemKeydown=this.handleMenuItemKeydown.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.trackPopupState=this.trackPopupState.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menubar'),this.menuBarChildren=Array.prototype.slice.call(this.list.children),this.menuBarItems=this.menuBarChildren.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuBarItems),this.menuLength=this.menuBarItems.length,h(I.getHelpIds()),this.menuBarItems.forEach((e,t)=>{e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-top-level-help ac-describe-submenu-help ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuLength),e.setAttribute('aria-posinset',t+1),e.parentElement.setAttribute('role','presentation'),e.parentElement.addEventListener('keydown',this.handleMenuBarKeydown),e.addEventListener('click',this.handleMenuBarClick)}),this.lastIndex=this.menuLength-1,this.clickEvent=new MouseEvent('click',{view:window,bubbles:!0,cancelable:!0}),this.popups=this.menuBarItems.reduce((e,t)=>{const n=t.nextElementSibling;if(null!==n&&'UL'===n.nodeName){const r=new S({controller:t,target:n,onInit:this.onPopupInit,onStateChange:this.trackPopupState,type:'menu'}),a=new w({list:n});return n.addEventListener('keydown',this.handleMenuItemKeydown),a.previousSibling=t,[...e,r]}return e},[]);const[e]=this.menuBarItems;this.state={menubarItem:e,popup:this.constructor.getPopupFromMenubarItem(e),expanded:!1},d(this.menuBarItems,e),this.onInit.call(this)}trackPopupState(e={}){const{menubarItem:t}=this.state,n=this.constructor.getPopupFromMenubarItem(t),r=!1===n||Object.prototype.hasOwnProperty.call(e,'expanded')?e.expanded:n.getState();this.state=Object.assign({menubarItem:t,popup:n,expanded:r})}stateWasUpdated(){const{menubarItem:e}=this.state;this.trackPopupState(),d(this.menuBarItems,e),e.focus(),this.onStateChange.call(this,this.state)}handleMenuBarKeydown(e){const{LEFT:t,RIGHT:n,DOWN:r,HOME:a,END:i,SPACE:o,RETURN:d}=A,{keyCode:l}=e,{menubarItem:s,popup:c}=this.state;switch(l){case t:case n:{const t=b(l,s,this.menuBarItems);t&&(e.stopPropagation(),e.preventDefault(),c&&c.setState({expanded:!1}),this.setState({menubarItem:t}));break}case o:case d:case r:{c&&(e.stopPropagation(),e.preventDefault(),!c.state.expanded&&c.setState({expanded:!0}),c.firstChild.focus());break}case a:{e.preventDefault();const[t]=this.menuBarItems;this.setState({menubarItem:t});break}case i:{e.preventDefault(),this.setState({menubarItem:this.menuBarItems[this.lastIndex]});break}default:{const e=this.search.getItem(l);null!==e&&this.setState({menubarItem:e});break}}}handleMenuBarClick(e){this.setState({menubarItem:e.target})}handleMenuItemKeydown(e){const{SPACE:t,RETURN:n}=A,{keyCode:r,target:a}=e;[t,n].includes(r)&&'A'===a.nodeName&&(e.stopPropagation(),e.preventDefault(),a.dispatchEvent(this.clickEvent))}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.menuBarItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset'),e.removeAttribute('role'),e.parentElement.removeEventListener('keydown',this.handleMenuBarKeydown),e.removeEventListener('click',this.handleMenuBarClick)}),i(this.menuBarItems),this.popups.forEach((e)=>{c(e.target.menu,w)&&e.target.menu.destroy(),e.target.removeEventListener('keydown',this.handleMenuItemKeydown),e.destroy()}),this.onDestroy.call(this)}}class k extends f{static createCloseButton(){const e=document.createElement('button');return e.innerText='Close',e}constructor(e){super(e),this.componentName='Dialog';const t={controller:null,target:null,content:null,close:this.constructor.createCloseButton(),onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}};Object.assign(this,t,e),void 0===e.close&&null!==this.target&&this.target.insertBefore(this.close,this.target.firstChild),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleKeydownEsc=this.handleKeydownEsc.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null===this.controller||null===this.target||null===this.content||this.content.contains(this.target)||this.init()}init(){super.setSelfReference([this.controller,this.target]),this.popup=new S({controller:this.controller,target:this.target,type:'dialog',onStateChange:this.onPopupStateChange}),this.interactiveChildren=E(this.target),this.close.addEventListener('click',this.hide),this.target.addEventListener('keydown',this.handleTargetKeydown),this.popup.target.removeEventListener('keydown',this.popup.targetKeyDownHandler),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange({expanded:e}){this.setState({expanded:e})}stateWasUpdated(){const{expanded:e}=this.state;this.interactiveChildren=E(this.target),e?(this.content.setAttribute('aria-hidden','true'),this.content.setAttribute('hidden',''),document.body.addEventListener('keydown',this.handleKeydownEsc),this.close.focus()):(this.content.setAttribute('aria-hidden','false'),this.content.removeAttribute('hidden'),document.body.removeEventListener('keydown',this.handleKeydownEsc),this.controller.focus()),this.onStateChange.call(this,this.state)}outsideClick(e){const{expanded:t}=this.popup.getState();t&&!this.target.contains(e.target)&&this.hide()}handleTargetKeydown(e){const{TAB:t}=A,{keyCode:n,shiftKey:r}=e;if(this.popup.getState().expanded&&n===t){const{activeElement:t}=document,n=this.interactiveChildren.length-1,[a]=this.interactiveChildren,i=this.interactiveChildren[n];r&&a===t?(e.preventDefault(),i.focus()):!r&&i===t&&(e.preventDefault(),a.focus())}}handleKeydownEsc(e){const{ESC:t}=A,{keyCode:n}=e;t===n&&this.hide()}destroy(){this.deleteSelfReferences(),this.popup.destroy(),this.content.removeAttribute('aria-hidden'),this.close.removeEventListener('click',this.hide),this.target.removeEventListener('keydown',this.handleTargetKeydown),document.body.removeEventListener('keydown',this.handleKeydownEsc),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}var L=n(2),D=r(siteClassNames.popup),T=D.button,K=D.info,O=document.querySelector(T),N=document.querySelector(K),P=new S({controller:O,target:N}),B=n(3),U=r(siteClassNames.tablist),R=U.list,H=U.panel,W=document.querySelector(R),M=document.querySelectorAll(H),q=new class extends f{constructor(e){if(super(),this.componentName='Tablist',e.tablist){const{tablist:t}=e;Object.assign(e,{tabs:t,tablist:void 0}),this.warnDeprecated('config.tablist','config.tabs')}if('UL'!==e.tabs.nodeName)return void console.warn('Tablist requires a
      for the tabs.');Object.assign(this,{list:null,panels:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={activeIndex:0},this.handlePanelKeydown=this.handlePanelKeydown.bind(this),this.handleTabsKeydown=this.handleTabsKeydown.bind(this),this.handleTabsClick=this.handleTabsClick.bind(this),this.switchTo=this.switchTo.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),Array.isArray(this.panels)||(this.panels=Array.prototype.slice.call(this.panels)),this.tabLinks=Array.prototype.filter.call(this.tabs.children,(e)=>null!==e.querySelector('a[href]')).map((e)=>e.querySelector('a[href]')),this.tabLinks.length===this.panels.length&&this.init()}init(){const{activeIndex:e}=this.state;this.tabs.setAttribute('role','tablist'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.setAttribute('role','presentation')}),this.tabLinks.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tab'),e===n?t.setAttribute('aria-selected','true'):t.setAttribute('tabindex','-1'),t.setAttribute('aria-controls',this.panels[n].id)}),this.tabs.addEventListener('click',this.handleTabsClick),this.tabs.addEventListener('keydown',this.handleTabsKeydown),this.panels.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tabpanel'),t.setAttribute('aria-labelledby',this.tabLinks[n].id),e===n?(t.setAttribute('tabindex','0'),t.setAttribute('aria-hidden','false'),t.removeAttribute('hidden')):(t.setAttribute('aria-hidden','true'),t.setAttribute('hidden','')),t.addEventListener('keydown',this.handlePanelKeydown)}),this.interactiveChildren=E(this.panels[e]),this.onInit.call(this)}stateWasUpdated(){const{activeIndex:e}=this.state,[t]=this.tabLinks.filter((e)=>'true'===e.getAttribute('aria-selected')),n=this.tabLinks.indexOf(t);t.setAttribute('tabindex','-1'),t.removeAttribute('aria-selected'),this.panels[n].setAttribute('aria-hidden','true'),this.panels[n].setAttribute('hidden',''),this.panels[n].removeAttribute('tabindex');const r=E(this.panels[n]);o(r),this.tabLinks[e].removeAttribute('tabindex'),this.tabLinks[e].setAttribute('aria-selected','true'),this.panels[e].setAttribute('aria-hidden','false'),this.panels[e].removeAttribute('hidden'),this.panels[e].setAttribute('tabindex','0'),this.interactiveChildren=E(this.panels[e]),i(this.interactiveChildren),this.onStateChange.call(this,this.state)}handlePanelKeydown(e){const{TAB:t}=A,{activeIndex:n}=this.state,{keyCode:r,shiftKey:a}=e,{activeElement:i}=document,[o]=this.interactiveChildren;r===t&&a&&(i===this.panels[n]?(e.preventDefault(),this.tabLinks[n].focus()):i===o&&(e.preventDefault(),this.panels[n].focus()))}handleTabsKeydown(e){const{TAB:t,LEFT:n,RIGHT:r,DOWN:a,HOME:i,END:o}=A,{keyCode:d,shiftKey:l,target:s}=e,c=this.tabLinks.indexOf(s);switch(d){case t:{l||(e.preventDefault(),this.panels[c].focus());break}case n:case r:{const t=b(d,s,this.tabLinks);t&&(e.preventDefault(),this.switchTo(this.tabLinks.indexOf(t)),t.focus());break}case a:{e.preventDefault(),this.panels[c].setAttribute('tabindex','0'),this.panels[c].focus();break}case i:{e.preventDefault(),this.switchTo(0),this.tabLinks[0].focus();break}case o:{e.preventDefault();const t=this.tabLinks.length-1;this.switchTo(t),this.tabLinks[t].focus();break}default:}}handleTabsClick(e){const{target:t}=e;e.preventDefault(),'true'!==t.getAttribute('aria-selected')&&this.tabLinks.includes(t)&&this.switchTo(this.tabLinks.indexOf(t))}switchTo(e){this.setState({activeIndex:e})}destroy(){this.tabs.removeAttribute('role'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.removeAttribute('role')}),this.deleteSelfReferences(),this.tabLinks.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-selected'),e.removeAttribute('tabindex'),e.removeAttribute('aria-controls'),e.removeEventListener('click',this.handleTabsClick),e.removeEventListener('keydown',this.handleTabsKeydown)}),this.panels.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-hidden'),e.removeAttribute('hidden'),e.removeAttribute('tabindex'),e.removeAttribute('aria-labelledby');const t=E(e);i(t),e.removeEventListener('keydown',this.handlePanelKeydown)}),this.onDestroy.call(this)}}({tabs:W,panels:M}),_=n(4),F=r(siteClassNames.listbox),G=F.button,z=F.list,j=document.querySelector(G),V=document.querySelector(z),Q=new class extends f{constructor(e){super(e),this.componentName='ListBox';Object.assign(this,{controller:null,target:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.preventWindowScroll=this.preventWindowScroll.bind(this),this.handleControllerKeyup=this.handleControllerKeyup.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleTargetClicks=this.handleTargetClicks.bind(this),this.handleTargetBlur=this.handleTargetBlur.bind(this),this.scrollOptionIntoView=this.scrollOptionIntoView.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.init()}init(){super.setSelfReference([this.controller,this.target]),this.options=Array.prototype.slice.call(this.target.children,0),this.search=new C(this.options),this.options.forEach((e)=>{s(e),e.setAttribute('role','option')});const[e]=this.options,t=this.options[this.options.length-1];Object.assign(this,{firstOption:e,lastOption:t}),this.state={activeDescendant:this.firstOption},this.popup=new S({controller:this.controller,target:this.target,type:'listbox',onStateChange:this.onPopupStateChange}),this.target.setAttribute('role','listbox'),this.target.setAttribute('tabindex','-1'),this.controller.addEventListener('keydown',this.handleControllerKeyup),this.target.addEventListener('keydown',this.handleTargetKeydown),this.target.addEventListener('click',this.handleTargetClicks),this.target.addEventListener('blur',this.handleTargetBlur),window.addEventListener('keydown',this.preventWindowScroll),this.onInit.call(this)}stateWasUpdated(){const{activeDescendant:e,expanded:t}=this.state;if(t){const t=this.target.querySelector('[aria-selected=\"true\"]');null!==t&&t.removeAttribute('aria-selected'),e.setAttribute('aria-selected','true'),this.target.setAttribute('aria-activedescendant',e.id),this.scrollOptionIntoView(e)}this.onStateChange.call(this,this.state)}onPopupStateChange({expanded:e}){const{activeDescendant:t}=this.state;e?this.target.focus():(this.target.removeAttribute('aria-activedescendant'),this.controller.textContent=t.textContent,this.target.contains(document.activeElement)&&this.controller.focus()),this.setState({activeDescendant:t,expanded:e})}preventWindowScroll(e){const{UP:t,DOWN:n}=A,{target:r,keyCode:a}=e;r===this.target&&[t,n].includes(a)&&e.preventDefault()}handleControllerKeyup(e){const{UP:t,DOWN:n}=A;[t,n].includes(e.keyCode)&&(e.preventDefault(),this.show())}handleTargetKeydown(e){const{activeDescendant:t}=this.state,{keyCode:n}=e,{RETURN:r,ESC:a,UP:i,DOWN:o,SPACE:d,HOME:l,END:s}=A;switch(n){case a:case r:case d:{e.preventDefault(),this.hide(),this.controller.focus();break}case i:case o:{let r=t;r=n===i?r.previousElementSibling:r.nextElementSibling,r&&(e.preventDefault(),this.setState({activeDescendant:r}));break}case l:{e.preventDefault(),this.setState({activeDescendant:this.firstOption});break}case s:{e.preventDefault(),this.setState({activeDescendant:this.lastOption});break}default:{const e=this.search.getItem(n);null!==e&&this.setState({activeDescendant:e});break}}}handleTargetClicks(e){this.setState({activeDescendant:e.target}),this.hide()}handleTargetBlur(){this.popup.getState().expanded&&this.hide()}scrollOptionIntoView(e){const{scrollHeight:t,clientHeight:n,scrollTop:r}=this.target,{offsetTop:a,offsetHeight:i}=e;if(t>n){const e=a+i;e>n+r?this.target.scrollTop=e-n:a{e.removeAttribute('role'),e.removeAttribute('aria-selected'),e.getAttribute('id').includes('id_')&&e.removeAttribute('id')}),this.popup.destroy(),this.target.removeAttribute('role'),this.target.removeAttribute('tabindex'),this.target.removeAttribute('aria-activedescendant'),this.controller.removeEventListener('keyup',this.handleControllerKeyup),this.target.removeEventListener('keydown',this.handleTargetKeydown),this.target.removeEventListener('click',this.handleTargetClicks),this.target.removeEventListener('blur',this.handleTargetBlur),window.removeEventListener('keydown',this.preventWindowScroll),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:j,target:V}),X=n(5),Y=r(siteClassNames.menu),Z=Y.list,$=document.querySelector(Z),J=new w({list:$}),ee=n(6),te=r(siteClassNames.dialog),ne=te.link,re=te.closeButton;window.addEventListener('load',function(){var e=document.querySelector(ne),t=document.getElementById('dialog'),n=document.querySelector(re),r=document.querySelector('.site'),a=new k({controller:e,target:t,close:n,content:r})});var ae=n(7),ie=r(siteClassNames.menubar),oe=ie.list,de=document.querySelector(oe),le=new I({list:de}),se=n(8),ce=r(siteClassNames.disclosure),ue=ce.button,pe=ce.info,be=document.querySelectorAll(ue),me=document.querySelectorAll(pe);if(be.length===me.length)Array.prototype.map.call(be,function(e,t){return new x({controller:e,target:me[t]})});var he=n(9),ge=r(siteClassNames.menubutton),ve=ge.button,fe=ge['menu-wrapper'],ye=ge.menu,Ae=document.querySelector(ve),Ee=document.querySelector(fe),Se=document.querySelector(ye),Ce=new class extends f{constructor(e){super(e),this.componentName='MenuButton';Object.assign(this,{controller:null,target:null,list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){this.popup=new S({controller:this.controller,target:this.target,type:'menu',onStateChange:this.onPopupStateChange}),null!==this.list&&'UL'===this.list.nodeName?this.menu=new w({list:this.list}):'UL'===this.target.nodeName&&(this.menu=new w({list:this.target})),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange(e){this.setState(e),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{keyCode:t}=e,{RETURN:n,UP:r,DOWN:a,SPACE:i}=A;switch(t){case n:case i:case a:{e.preventDefault(),this.show(),this.menu.firstItem&&this.menu.firstItem.focus();break}case r:{e.preventDefault(),this.show(),this.menu.lastItem&&this.menu.lastItem.focus();break}default:}}destroy(){this.popup.destroy(),this.menu.destroy(),this.controller.removeEventListener('keydown',this.handleControllerKeydown),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:Ae,target:Ee,list:Se})}]);"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file diff --git a/docs/build/js/global.14fb354bfee817c4342c.bundle.min.js b/docs/build/js/global.14fb354bfee817c4342c.bundle.min.js deleted file mode 100644 index 79e37c49..00000000 --- a/docs/build/js/global.14fb354bfee817c4342c.bundle.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&'object'==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:e}),2&n&&'string'!=typeof e)for(var a in e)t.d(r,a,function(t){return e[t]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='/build/',t(t.s=10)})([function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(e,t,n){'use strict';function r(e){return Object.keys(e).reduce(function(t,n){return t[n]='.'.concat(e[n]),t},{})}function a(e){if(Array.isArray(e))return e;let t=[];return e instanceof HTMLElement?t=Array(e):(e instanceof NodeList||e instanceof HTMLCollection)&&(t=Array.prototype.slice.call(e,0)),t}function i(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.removeAttribute('tabindex')})}function o(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.setAttribute('tabindex','-1')})}function d(e,t){const n=Array.isArray(t)?t:a(t),r=Array.isArray(e)?e:a(e);if(i(n),0!n.includes(e));o(e)}}function l(e=36){const[,t]=Math.random().toString(e).split('.');return`id_${t}`}function s(e){null!==e&&''===e.id&&e.setAttribute('id',l())}function c(e,t){return void 0!==e&&null!==e&&e instanceof t}function u(e,t,n,r){const{next:a,previous:i}=r,o=n.indexOf(t),d=n.length-1;let l=e===i?o-1:o+1;return i===e&&0>l&&(l=d),a===e&&d(Object.defineProperty(e,this.componentName.toLowerCase(),{value:this,configurable:!0}),e));this.referenceElements=[...this.referenceElements,...t]}deleteSelfReferences(){this.referenceElements.forEach((e)=>{delete e[this.componentName.toLowerCase()]})}getState(){return this.state}warnDeprecated(e,t=!1){const n=t?`Use ${t} instead.`:'';console.warn(`${this.componentName}:`,`${e} is deprecated.`,`${n}`)}}const y=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});var E=y,S=function(e){const t=e.querySelectorAll('a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^="-"])');return Array.prototype.slice.call(t)};class A extends v{constructor(e){super(e),this.componentName='Popup';Object.assign(this,{controller:null,target:null,type:'true',onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:!1},this.init=this.init.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.controllerClickHandler=this.controllerClickHandler.bind(this),this.controllerKeyDownHandler=this.controllerKeyDownHandler.bind(this),this.targetKeyDownHandler=this.targetKeyDownHandler.bind(this),this.hideOnTabOut=this.hideOnTabOut.bind(this),this.hideOnOutsideClick=this.hideOnOutsideClick.bind(this),this.destroy=this.destroy.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){if(super.setSelfReference([this.controller,this.target]),this.interactiveChildElements=S(this.target),o(this.interactiveChildElements),0{this.searchString='',this.clearSearch=null},500);const n=this.items.filter((e)=>{const t=e.textContent.toLowerCase();return 0===t.indexOf(this.searchString.toLowerCase())});return n.length?n[0]:null}return null}}class x extends v{constructor(e){super(e),this.componentName='Disclosure';Object.assign(this,{controller:null,target:null,loadOpen:!1,allowOutsideClick:!0,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:this.loadOpen},this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.toggleExpandedState=this.toggleExpandedState.bind(this),this.closeOnOutsideClick=this.closeOnOutsideClick.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){super.setSelfReference([this.controller,this.target]);const{expanded:e}=this.state;this.interactiveChildElements=S(this.target),[this.controller,this.target].forEach((e)=>{s(e)}),this.controller.setAttribute('aria-expanded',`${e}`),this.controller.setAttribute('aria-controls',this.target.id),'BUTTON'!==this.controller.nodeName&&(this.controller.setAttribute('role','button'),'A'!==this.controller.nodeName&&null===this.controller.getAttribute('tabindex')&&this.controller.setAttribute('tabindex','0')),this.target!==this.controller.nextElementSibling&&this.controller.setAttribute('aria-owns',this.target.id),e||(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),this.controller.addEventListener('click',this.toggleExpandedState),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.allowOutsideClick||document.body.addEventListener('click',this.closeOnOutsideClick),o(this.interactiveChildElements),this.onInit.call(this)}stateWasUpdated(){const{expanded:e}=this.state;this.controller.setAttribute('aria-expanded',`${e}`),e?(this.target.setAttribute('aria-hidden','false'),this.target.removeAttribute('hidden')):(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),e?i(this.interactiveChildElements):o(this.interactiveChildElements),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{SPACE:t,RETURN:n}=E,{keyCode:r}=e;[t,n].includes(r)&&this.toggleExpandedState(e)}toggleExpandedState(e){e.preventDefault(),this.state.expanded?this.close():this.open()}closeOnOutsideClick(e){this.state.expanded&&e.target!==this.controller&&!this.target.contains(e.target)&&this.close()}destroy(){this.deleteSelfReferences(),this.controller.removeAttribute('aria-expanded'),this.controller.removeAttribute('aria-controls'),this.controller.removeAttribute('aria-owns'),this.controller.removeAttribute('tabindex'),this.target.removeAttribute('aria-hidden'),this.target.removeAttribute('hidden'),this.controller.removeEventListener('click',this.toggleExpandedState),document.body.removeEventListener('click',this.closeOnOutsideClick),this.state={expanded:this.loadOpen},this.onDestroy.call(this)}open(){this.setState({expanded:!0})}close(){this.setState({expanded:!1})}}class w extends v{static getHelpIds(){return['#ac-describe-submenu-help','#ac-describe-esc-help','#ac-describe-submenu-explore','#ac-describe-submenu-back']}static nextElementIsUl(e){const t=e.nextElementSibling;return!(null===t||'UL'!==t.nodeName)&&t}constructor(e){if(super(e),this.componentName='Menu',e.menu){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}Object.assign(this,{list:null,collapse:!1,onInit:()=>{},onDestroy:()=>{}},e),this.handleListKeydown=this.handleListKeydown.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menu'),this.listItems=Array.prototype.slice.call(this.list.children),this.menuItems=this.listItems.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuItems),this.menuItemsLength=this.menuItems.length,this.list.addEventListener('keydown',this.handleListKeydown),h(w.getHelpIds()),this.disclosures=[],this.menuItems.forEach((e,t)=>{e.parentElement.setAttribute('role','presentation'),e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-submenu-explore ac-describe-submenu-help ac-describe-submenu-back ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuItemsLength),e.setAttribute('aria-posinset',t+1);const n=this.constructor.nextElementIsUl(e);if(n){if(this.collapse){const t=new x({controller:e,target:n});this.disclosures.push(t)}const t=new w({list:n});t.previousSibling=e}});const[e]=this.menuItems,t=this.menuItems[this.menuItems.length-1];Object.assign(this,{firstItem:e,lastItem:t}),this.onInit.call(this)}handleListKeydown(e){const{keyCode:t}=e,{UP:n,DOWN:r,LEFT:a,RIGHT:i,HOME:o,END:d,ESC:l}=E,{activeElement:s}=document,u=this.list.contains(s)?s:this.menuItems[0];switch(t){case n:case r:{const n=p(t,u,this.menuItems);n&&(e.stopPropagation(),e.preventDefault(),n.focus());break}case o:{e.preventDefault(),this.firstItem.focus();break}case d:{e.preventDefault(),this.lastItem.focus();break}case i:{const t=this.constructor.nextElementIsUl(u);if(t&&c(t.menu,w)){e.stopPropagation(),e.preventDefault(),c(u.disclosure,x)&&u.disclosure.open();const{menu:n}=t;n.firstItem.focus()}break}case a:{void 0===this.previousSibling||this.previousSibling.hasAttribute('aria-haspopup')||(e.preventDefault(),e.stopPropagation(),c(this.previousSibling.disclosure,x)&&this.previousSibling.disclosure.close(),this.previousSibling.focus());break}case l:break;default:{e.stopPropagation();const n=this.search.getItem(t);null!==n&&n.focus();break}}}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.list.removeEventListener('keydown',this.handleListKeydown),this.menuItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset');const t=this.constructor.nextElementIsUl(e);t&&c(t.menu,w)&&t.menu.destroy()}),this.disclosures.forEach((e)=>{e.destroy()}),this.onDestroy.call(this)}}class I extends v{static getPopupFromMenubarItem(e){return!!c(e.popup,A)&&e.popup}static getHelpIds(){return['#ac-describe-top-level-help','#ac-describe-submenu-help','#ac-describe-esc-help']}constructor(e){super(e),this.componentName='MenuBar',Object.keys(e).forEach((t)=>{if('menu'===t){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}['onPopupDestroy','onPopupStateChange'].includes(t)&&this.warnDeprecated(`config.${t}`)});Object.assign(this,{list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{},onPopupInit:()=>{}},e),this.handleMenuBarKeydown=this.handleMenuBarKeydown.bind(this),this.handleMenuBarClick=this.handleMenuBarClick.bind(this),this.handleMenuItemKeydown=this.handleMenuItemKeydown.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.trackPopupState=this.trackPopupState.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menubar'),this.menuBarChildren=Array.prototype.slice.call(this.list.children),this.menuBarItems=this.menuBarChildren.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuBarItems),this.menuLength=this.menuBarItems.length,h(I.getHelpIds()),this.menuBarItems.forEach((e,t)=>{e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-top-level-help ac-describe-submenu-help ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuLength),e.setAttribute('aria-posinset',t+1),e.parentElement.setAttribute('role','presentation'),e.parentElement.addEventListener('keydown',this.handleMenuBarKeydown),e.addEventListener('click',this.handleMenuBarClick)}),this.lastIndex=this.menuLength-1,this.clickEvent=new MouseEvent('click',{view:window,bubbles:!0,cancelable:!0}),this.popups=this.menuBarItems.reduce((e,t)=>{const n=t.nextElementSibling;if(null!==n&&'UL'===n.nodeName){const r=new A({controller:t,target:n,onInit:this.onPopupInit,onStateChange:this.trackPopupState,type:'menu'}),a=new w({list:n});return n.addEventListener('keydown',this.handleMenuItemKeydown),a.previousSibling=t,[...e,r]}return e},[]);const[e]=this.menuBarItems;this.state={menubarItem:e,popup:this.constructor.getPopupFromMenubarItem(e),expanded:!1},d(this.menuBarItems,e),this.onInit.call(this)}trackPopupState(e={}){const{menubarItem:t}=this.state,n=this.constructor.getPopupFromMenubarItem(t),r=!1===n||Object.prototype.hasOwnProperty.call(e,'expanded')?e.expanded:n.getState();this.state=Object.assign({menubarItem:t,popup:n,expanded:r})}stateWasUpdated(){const{menubarItem:e}=this.state;this.trackPopupState(),d(this.menuBarItems,e),e.focus(),this.onStateChange.call(this,this.state)}handleMenuBarKeydown(e){const{LEFT:t,RIGHT:n,DOWN:r,HOME:a,END:i,SPACE:o,RETURN:d}=E,{keyCode:l}=e,{menubarItem:s,popup:c}=this.state;switch(l){case t:case n:{const t=b(l,s,this.menuBarItems);t&&(e.stopPropagation(),e.preventDefault(),c&&c.setState({expanded:!1}),this.setState({menubarItem:t}));break}case o:case d:case r:{c&&(e.stopPropagation(),e.preventDefault(),!c.state.expanded&&c.setState({expanded:!0}),c.firstChild.focus());break}case a:{e.preventDefault();const[t]=this.menuBarItems;this.setState({menubarItem:t});break}case i:{e.preventDefault(),this.setState({menubarItem:this.menuBarItems[this.lastIndex]});break}default:{const e=this.search.getItem(l);null!==e&&this.setState({menubarItem:e});break}}}handleMenuBarClick(e){this.setState({menubarItem:e.target})}handleMenuItemKeydown(e){const{SPACE:t,RETURN:n}=E,{keyCode:r,target:a}=e;[t,n].includes(r)&&'A'===a.nodeName&&(e.stopPropagation(),e.preventDefault(),a.dispatchEvent(this.clickEvent))}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.menuBarItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset'),e.removeAttribute('role'),e.parentElement.removeEventListener('keydown',this.handleMenuBarKeydown),e.removeEventListener('click',this.handleMenuBarClick)}),this.popups.forEach((e)=>{c(e.target.menu,w)&&e.target.menu.destroy(),e.destroy()}),i(this.menuBarItems),this.onDestroy.call(this)}}class k extends v{static createCloseButton(){const e=document.createElement('button');return e.innerText='Close',e}constructor(e){super(e),this.componentName='Dialog';const t={controller:null,target:null,content:null,close:this.constructor.createCloseButton(),onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}};Object.assign(this,t,e),void 0===e.close&&null!==this.target&&this.target.insertBefore(this.close,this.target.firstChild),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleKeydownEsc=this.handleKeydownEsc.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null===this.controller||null===this.target||null===this.content||this.content.contains(this.target)||this.init()}init(){super.setSelfReference([this.controller,this.target]),this.popup=new A({controller:this.controller,target:this.target,type:'dialog',onStateChange:this.onPopupStateChange}),this.interactiveChildren=S(this.target),this.close.addEventListener('click',this.hide),this.target.addEventListener('keydown',this.handleTargetKeydown),this.popup.target.removeEventListener('keydown',this.popup.targetKeyDownHandler),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange({expanded:e}){this.setState({expanded:e})}stateWasUpdated(){const{expanded:e}=this.state;this.interactiveChildren=S(this.target),e?(this.content.setAttribute('aria-hidden','true'),this.content.setAttribute('hidden',''),document.body.addEventListener('keydown',this.handleKeydownEsc),this.close.focus()):(this.content.setAttribute('aria-hidden','false'),this.content.removeAttribute('hidden'),document.body.removeEventListener('keydown',this.handleKeydownEsc),this.controller.focus()),this.onStateChange.call(this,this.state)}outsideClick(e){const{expanded:t}=this.popup.getState();t&&!this.target.contains(e.target)&&this.hide()}handleTargetKeydown(e){const{TAB:t}=E,{keyCode:n,shiftKey:r}=e;if(this.popup.getState().expanded&&n===t){const{activeElement:t}=document,n=this.interactiveChildren.length-1,[a]=this.interactiveChildren,i=this.interactiveChildren[n];r&&a===t?(e.preventDefault(),i.focus()):!r&&i===t&&(e.preventDefault(),a.focus())}}handleKeydownEsc(e){const{ESC:t}=E,{keyCode:n}=e;t===n&&this.hide()}destroy(){this.deleteSelfReferences(),this.popup.destroy(),this.close.removeEventListener('click',this.hide),this.target.removeEventListener('keydown',this.handleTargetKeydown),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}var D=n(2),L=r(siteClassNames.popup),T=L.button,O=L.info,K=document.querySelector(T),P=document.querySelector(O),N=new A({controller:K,target:P}),B=n(3),U=r(siteClassNames.tablist),R=U.list,H=U.panel,W=document.querySelector(R),M=document.querySelectorAll(H),q=new class extends v{constructor(e){if(super(),this.componentName='Tablist',e.tablist){const{tablist:t}=e;Object.assign(e,{tabs:t,tablist:void 0}),this.warnDeprecated('config.tablist','config.tabs')}if('UL'!==e.tabs.nodeName)return void console.warn('Tablist requires a
        for the tabs.');Object.assign(this,{list:null,panels:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={activeIndex:0},this.handlePanelKeydown=this.handlePanelKeydown.bind(this),this.handleTabsKeydown=this.handleTabsKeydown.bind(this),this.handleTabsClick=this.handleTabsClick.bind(this),this.switchTo=this.switchTo.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),Array.isArray(this.panels)||(this.panels=Array.prototype.slice.call(this.panels)),this.tabLinks=Array.prototype.filter.call(this.tabs.children,(e)=>null!==e.querySelector('a[href]')).map((e)=>e.querySelector('a[href]')),this.tabLinks.length===this.panels.length&&this.init()}init(){const{activeIndex:e}=this.state;this.tabs.setAttribute('role','tablist'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.setAttribute('role','presentation')}),this.tabLinks.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tab'),e===n?t.setAttribute('aria-selected','true'):t.setAttribute('tabindex','-1'),t.setAttribute('aria-controls',this.panels[n].id)}),this.tabs.addEventListener('click',this.handleTabsClick),this.tabs.addEventListener('keydown',this.handleTabsKeydown),this.panels.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tabpanel'),t.setAttribute('aria-labelledby',this.tabLinks[n].id),e===n?(t.setAttribute('tabindex','0'),t.setAttribute('aria-hidden','false'),t.removeAttribute('hidden')):(t.setAttribute('aria-hidden','true'),t.setAttribute('hidden','')),t.addEventListener('keydown',this.handlePanelKeydown)}),this.interactiveChildren=S(this.panels[e]),this.onInit.call(this)}stateWasUpdated(){const{activeIndex:e}=this.state,[t]=this.tabLinks.filter((e)=>'true'===e.getAttribute('aria-selected')),n=this.tabLinks.indexOf(t);t.setAttribute('tabindex','-1'),t.removeAttribute('aria-selected'),this.panels[n].setAttribute('aria-hidden','true'),this.panels[n].setAttribute('hidden',''),this.panels[n].removeAttribute('tabindex');const r=S(this.panels[n]);o(r),this.tabLinks[e].removeAttribute('tabindex'),this.tabLinks[e].setAttribute('aria-selected','true'),this.panels[e].setAttribute('aria-hidden','false'),this.panels[e].removeAttribute('hidden'),this.panels[e].setAttribute('tabindex','0'),this.interactiveChildren=S(this.panels[e]),i(this.interactiveChildren),this.onStateChange.call(this,this.state)}handlePanelKeydown(e){const{TAB:t}=E,{activeIndex:n}=this.state,{keyCode:r,shiftKey:a}=e,{activeElement:i}=document,[o]=this.interactiveChildren;r===t&&a&&(i===this.panels[n]?(e.preventDefault(),this.tabLinks[n].focus()):i===o&&(e.preventDefault(),this.panels[n].focus()))}handleTabsKeydown(e){const{TAB:t,LEFT:n,RIGHT:r,DOWN:a,HOME:i,END:o}=E,{keyCode:d,shiftKey:l,target:s}=e,c=this.tabLinks.indexOf(s);switch(d){case t:{l||(e.preventDefault(),this.panels[c].focus());break}case n:case r:{const t=b(d,s,this.tabLinks);t&&(e.preventDefault(),this.switchTo(this.tabLinks.indexOf(t)),t.focus());break}case a:{e.preventDefault(),this.panels[c].setAttribute('tabindex','0'),this.panels[c].focus();break}case i:{e.preventDefault(),this.switchTo(0),this.tabLinks[0].focus();break}case o:{e.preventDefault();const t=this.tabLinks.length-1;this.switchTo(t),this.tabLinks[t].focus();break}default:}}handleTabsClick(e){const{target:t}=e;e.preventDefault(),'true'!==t.getAttribute('aria-selected')&&this.tabLinks.includes(t)&&this.switchTo(this.tabLinks.indexOf(t))}switchTo(e){this.setState({activeIndex:e})}destroy(){this.tabs.removeAttribute('role'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.removeAttribute('role')}),this.deleteSelfReferences(),this.tabLinks.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-selected'),e.removeAttribute('tabindex'),e.removeAttribute('aria-controls'),e.removeEventListener('click',this.handleTabsClick),e.removeEventListener('keydown',this.handleTabsKeydown)}),this.panels.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-hidden'),e.removeAttribute('hidden'),e.removeAttribute('tabindex');const t=S(e);i(t),e.removeEventListener('keydown',this.handlePanelKeydown)}),this.onDestroy.call(this)}}({tabs:W,panels:M}),F=n(4),_=r(siteClassNames.listbox),G=_.button,z=_.list,j=document.querySelector(G),V=document.querySelector(z),Q=new class extends v{constructor(e){super(e),this.componentName='ListBox';Object.assign(this,{controller:null,target:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.preventWindowScroll=this.preventWindowScroll.bind(this),this.handleControllerKeyup=this.handleControllerKeyup.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleTargetClicks=this.handleTargetClicks.bind(this),this.handleTargetBlur=this.handleTargetBlur.bind(this),this.scrollOptionIntoView=this.scrollOptionIntoView.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.init()}init(){super.setSelfReference([this.controller,this.target]),this.options=Array.prototype.slice.call(this.target.children,0),this.search=new C(this.options),this.options.forEach((e)=>{s(e),e.setAttribute('role','option')});const[e]=this.options,t=this.options[this.options.length-1];Object.assign(this,{firstOption:e,lastOption:t}),this.state={activeDescendant:this.firstOption},this.popup=new A({controller:this.controller,target:this.target,type:'listbox',onStateChange:this.onPopupStateChange}),this.target.setAttribute('role','listbox'),this.target.setAttribute('tabindex','-1'),this.controller.addEventListener('keydown',this.handleControllerKeyup),this.target.addEventListener('keydown',this.handleTargetKeydown),this.target.addEventListener('click',this.handleTargetClicks),this.target.addEventListener('blur',this.handleTargetBlur),window.addEventListener('keydown',this.preventWindowScroll),this.onInit.call(this)}stateWasUpdated(){const{activeDescendant:e,expanded:t}=this.state;if(t){const t=this.target.querySelector('[aria-selected="true"]');null!==t&&t.removeAttribute('aria-selected'),e.setAttribute('aria-selected','true'),this.target.setAttribute('aria-activedescendant',e.id),this.scrollOptionIntoView(e)}this.onStateChange.call(this,this.state)}onPopupStateChange({expanded:e}){const{activeDescendant:t}=this.state;e?this.target.focus():(this.target.removeAttribute('aria-activedescendant'),this.controller.textContent=t.textContent,this.target.contains(document.activeElement)&&this.controller.focus()),this.setState({activeDescendant:t,expanded:e})}preventWindowScroll(e){const{UP:t,DOWN:n}=E,{target:r,keyCode:a}=e;r===this.target&&[t,n].includes(a)&&e.preventDefault()}handleControllerKeyup(e){const{UP:t,DOWN:n}=E;[t,n].includes(e.keyCode)&&(e.preventDefault(),this.show())}handleTargetKeydown(e){const{activeDescendant:t}=this.state,{keyCode:n}=e,{RETURN:r,ESC:a,UP:i,DOWN:o,SPACE:d,HOME:l,END:s}=E;switch(n){case a:case r:case d:{e.preventDefault(),this.hide(),this.controller.focus();break}case i:case o:{let r=t;r=n===i?r.previousElementSibling:r.nextElementSibling,r&&(e.preventDefault(),this.setState({activeDescendant:r}));break}case l:{e.preventDefault(),this.setState({activeDescendant:this.firstOption});break}case s:{e.preventDefault(),this.setState({activeDescendant:this.lastOption});break}default:{const e=this.search.getItem(n);null!==e&&this.setState({activeDescendant:e});break}}}handleTargetClicks(e){this.setState({activeDescendant:e.target}),this.hide()}handleTargetBlur(){this.popup.getState().expanded&&this.hide()}scrollOptionIntoView(e){const{scrollHeight:t,clientHeight:n,scrollTop:r}=this.target,{offsetTop:a,offsetHeight:i}=e;if(t>n){const e=a+i;e>n+r?this.target.scrollTop=e-n:a{e.removeAttribute('role')}),this.popup.destroy(),this.target.removeAttribute('role'),this.target.removeAttribute('tabindex'),this.controller.removeEventListener('keyup',this.handleControllerKeyup),this.target.removeEventListener('keydown',this.handleTargetKeydown),this.target.removeEventListener('click',this.handleTargetClicks),this.target.removeEventListener('blur',this.handleTargetBlur),window.removeEventListener('keydown',this.preventWindowScroll),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:j,target:V}),X=n(5),Y=r(siteClassNames.menu),Z=Y.list,$=document.querySelector(Z),J=new w({list:$}),ee=n(6),te=r(siteClassNames.dialog),ne=te.link,re=te.closeButton;window.addEventListener('load',function(){var e=document.querySelector(ne),t=document.getElementById('dialog'),n=document.querySelector(re),r=document.querySelector('.site'),a=new k({controller:e,target:t,close:n,content:r})});var ae=n(7),ie=r(siteClassNames.menubar),oe=ie.list,de=document.querySelector(oe),le=new I({list:de}),se=n(8),ce=r(siteClassNames.disclosure),ue=ce.button,pe=ce.info,be=document.querySelectorAll(ue),me=document.querySelectorAll(pe);if(be.length===me.length)Array.prototype.map.call(be,function(e,t){return new x({controller:e,target:me[t]})});var he=n(9),ge=r(siteClassNames.menubutton),fe=ge.button,ve=ge['menu-wrapper'],ye=ge.menu,Ee=document.querySelector(fe),Se=document.querySelector(ve),Ae=document.querySelector(ye),Ce=new class extends v{constructor(e){super(e),this.componentName='MenuButton';Object.assign(this,{controller:null,target:null,list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){this.popup=new A({controller:this.controller,target:this.target,type:'menu',onStateChange:this.onPopupStateChange}),null!==this.list&&'UL'===this.list.nodeName?this.menu=new w({list:this.list}):'UL'===this.target.nodeName&&(this.menu=new w({list:this.target})),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange(e){this.setState(e),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{keyCode:t}=e,{RETURN:n,UP:r,DOWN:a,SPACE:i}=E;switch(t){case n:case i:case a:{e.preventDefault(),this.show(),this.menu.firstItem&&this.menu.firstItem.focus();break}case r:{e.preventDefault(),this.show(),this.menu.lastItem&&this.menu.lastItem.focus();break}default:}}destroy(){this.popup.destroy(),this.menu.destroy(),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:Ee,target:Se,list:Ae})}]); -//# sourceMappingURL=global.14fb354bfee817c4342c.bundle.min.js.map \ No newline at end of file diff --git a/docs/build/js/global.14fb354bfee817c4342c.bundle.min.js.map b/docs/build/js/global.14fb354bfee817c4342c.bundle.min.js.map deleted file mode 100644 index f2120c3d..00000000 --- a/docs/build/js/global.14fb354bfee817c4342c.bundle.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"js/global.14fb354bfee817c4342c.bundle.min.js","sources":["webpack:///js/global.14fb354bfee817c4342c.bundle.min.js"],"sourcesContent":["(function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){'undefined'!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:'Module'}),Object.defineProperty(e,'__esModule',{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&'object'==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,'default',{enumerable:!0,value:e}),2&n&&'string'!=typeof e)for(var a in e)t.d(r,a,function(t){return e[t]}.bind(null,a));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e['default']}:function(){return e};return t.d(n,'a',n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p='/build/',t(t.s=10)})([function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(e,t,n){'use strict';function r(e){return Object.keys(e).reduce(function(t,n){return t[n]='.'.concat(e[n]),t},{})}function a(e){if(Array.isArray(e))return e;let t=[];return e instanceof HTMLElement?t=Array(e):(e instanceof NodeList||e instanceof HTMLCollection)&&(t=Array.prototype.slice.call(e,0)),t}function i(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.removeAttribute('tabindex')})}function o(e){const t=Array.isArray(e)?e:a(e);t.forEach((e)=>{e.setAttribute('tabindex','-1')})}function d(e,t){const n=Array.isArray(t)?t:a(t),r=Array.isArray(e)?e:a(e);if(i(n),0!n.includes(e));o(e)}}function l(e=36){const[,t]=Math.random().toString(e).split('.');return`id_${t}`}function s(e){null!==e&&''===e.id&&e.setAttribute('id',l())}function c(e,t){return void 0!==e&&null!==e&&e instanceof t}function u(e,t,n,r){const{next:a,previous:i}=r,o=n.indexOf(t),d=n.length-1;let l=e===i?o-1:o+1;return i===e&&0>l&&(l=d),a===e&&d(Object.defineProperty(e,this.componentName.toLowerCase(),{value:this,configurable:!0}),e));this.referenceElements=[...this.referenceElements,...t]}deleteSelfReferences(){this.referenceElements.forEach((e)=>{delete e[this.componentName.toLowerCase()]})}getState(){return this.state}warnDeprecated(e,t=!1){const n=t?`Use ${t} instead.`:'';console.warn(`${this.componentName}:`,`${e} is deprecated.`,`${n}`)}}const y=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});var E=y,S=function(e){const t=e.querySelectorAll('a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),iframe,object,embed,[contenteditable],[tabindex]:not([tabindex^=\"-\"])');return Array.prototype.slice.call(t)};class A extends v{constructor(e){super(e),this.componentName='Popup';Object.assign(this,{controller:null,target:null,type:'true',onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:!1},this.init=this.init.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.controllerClickHandler=this.controllerClickHandler.bind(this),this.controllerKeyDownHandler=this.controllerKeyDownHandler.bind(this),this.targetKeyDownHandler=this.targetKeyDownHandler.bind(this),this.hideOnTabOut=this.hideOnTabOut.bind(this),this.hideOnOutsideClick=this.hideOnOutsideClick.bind(this),this.destroy=this.destroy.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){if(super.setSelfReference([this.controller,this.target]),this.interactiveChildElements=S(this.target),o(this.interactiveChildElements),0{this.searchString='',this.clearSearch=null},500);const n=this.items.filter((e)=>{const t=e.textContent.toLowerCase();return 0===t.indexOf(this.searchString.toLowerCase())});return n.length?n[0]:null}return null}}class x extends v{constructor(e){super(e),this.componentName='Disclosure';Object.assign(this,{controller:null,target:null,loadOpen:!1,allowOutsideClick:!0,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={expanded:this.loadOpen},this.init=this.init.bind(this),this.destroy=this.destroy.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.toggleExpandedState=this.toggleExpandedState.bind(this),this.closeOnOutsideClick=this.closeOnOutsideClick.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){super.setSelfReference([this.controller,this.target]);const{expanded:e}=this.state;this.interactiveChildElements=S(this.target),[this.controller,this.target].forEach((e)=>{s(e)}),this.controller.setAttribute('aria-expanded',`${e}`),this.controller.setAttribute('aria-controls',this.target.id),'BUTTON'!==this.controller.nodeName&&(this.controller.setAttribute('role','button'),'A'!==this.controller.nodeName&&null===this.controller.getAttribute('tabindex')&&this.controller.setAttribute('tabindex','0')),this.target!==this.controller.nextElementSibling&&this.controller.setAttribute('aria-owns',this.target.id),e||(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),this.controller.addEventListener('click',this.toggleExpandedState),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.allowOutsideClick||document.body.addEventListener('click',this.closeOnOutsideClick),o(this.interactiveChildElements),this.onInit.call(this)}stateWasUpdated(){const{expanded:e}=this.state;this.controller.setAttribute('aria-expanded',`${e}`),e?(this.target.setAttribute('aria-hidden','false'),this.target.removeAttribute('hidden')):(this.target.setAttribute('aria-hidden','true'),this.target.setAttribute('hidden','')),e?i(this.interactiveChildElements):o(this.interactiveChildElements),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{SPACE:t,RETURN:n}=E,{keyCode:r}=e;[t,n].includes(r)&&this.toggleExpandedState(e)}toggleExpandedState(e){e.preventDefault(),this.state.expanded?this.close():this.open()}closeOnOutsideClick(e){this.state.expanded&&e.target!==this.controller&&!this.target.contains(e.target)&&this.close()}destroy(){this.deleteSelfReferences(),this.controller.removeAttribute('aria-expanded'),this.controller.removeAttribute('aria-controls'),this.controller.removeAttribute('aria-owns'),this.controller.removeAttribute('tabindex'),this.target.removeAttribute('aria-hidden'),this.target.removeAttribute('hidden'),this.controller.removeEventListener('click',this.toggleExpandedState),document.body.removeEventListener('click',this.closeOnOutsideClick),this.state={expanded:this.loadOpen},this.onDestroy.call(this)}open(){this.setState({expanded:!0})}close(){this.setState({expanded:!1})}}class w extends v{static getHelpIds(){return['#ac-describe-submenu-help','#ac-describe-esc-help','#ac-describe-submenu-explore','#ac-describe-submenu-back']}static nextElementIsUl(e){const t=e.nextElementSibling;return!(null===t||'UL'!==t.nodeName)&&t}constructor(e){if(super(e),this.componentName='Menu',e.menu){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}Object.assign(this,{list:null,collapse:!1,onInit:()=>{},onDestroy:()=>{}},e),this.handleListKeydown=this.handleListKeydown.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menu'),this.listItems=Array.prototype.slice.call(this.list.children),this.menuItems=this.listItems.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuItems),this.menuItemsLength=this.menuItems.length,this.list.addEventListener('keydown',this.handleListKeydown),h(w.getHelpIds()),this.disclosures=[],this.menuItems.forEach((e,t)=>{e.parentElement.setAttribute('role','presentation'),e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-submenu-explore ac-describe-submenu-help ac-describe-submenu-back ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuItemsLength),e.setAttribute('aria-posinset',t+1);const n=this.constructor.nextElementIsUl(e);if(n){if(this.collapse){const t=new x({controller:e,target:n});this.disclosures.push(t)}const t=new w({list:n});t.previousSibling=e}});const[e]=this.menuItems,t=this.menuItems[this.menuItems.length-1];Object.assign(this,{firstItem:e,lastItem:t}),this.onInit.call(this)}handleListKeydown(e){const{keyCode:t}=e,{UP:n,DOWN:r,LEFT:a,RIGHT:i,HOME:o,END:d,ESC:l}=E,{activeElement:s}=document,u=this.list.contains(s)?s:this.menuItems[0];switch(t){case n:case r:{const n=p(t,u,this.menuItems);n&&(e.stopPropagation(),e.preventDefault(),n.focus());break}case o:{e.preventDefault(),this.firstItem.focus();break}case d:{e.preventDefault(),this.lastItem.focus();break}case i:{const t=this.constructor.nextElementIsUl(u);if(t&&c(t.menu,w)){e.stopPropagation(),e.preventDefault(),c(u.disclosure,x)&&u.disclosure.open();const{menu:n}=t;n.firstItem.focus()}break}case a:{void 0===this.previousSibling||this.previousSibling.hasAttribute('aria-haspopup')||(e.preventDefault(),e.stopPropagation(),c(this.previousSibling.disclosure,x)&&this.previousSibling.disclosure.close(),this.previousSibling.focus());break}case l:break;default:{e.stopPropagation();const n=this.search.getItem(t);null!==n&&n.focus();break}}}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.list.removeEventListener('keydown',this.handleListKeydown),this.menuItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset');const t=this.constructor.nextElementIsUl(e);t&&c(t.menu,w)&&t.menu.destroy()}),this.disclosures.forEach((e)=>{e.destroy()}),this.onDestroy.call(this)}}class I extends v{static getPopupFromMenubarItem(e){return!!c(e.popup,A)&&e.popup}static getHelpIds(){return['#ac-describe-top-level-help','#ac-describe-submenu-help','#ac-describe-esc-help']}constructor(e){super(e),this.componentName='MenuBar',Object.keys(e).forEach((t)=>{if('menu'===t){const{menu:t}=e;Object.assign(e,{list:t,menu:void 0}),this.warnDeprecated('config.menu','config.list')}['onPopupDestroy','onPopupStateChange'].includes(t)&&this.warnDeprecated(`config.${t}`)});Object.assign(this,{list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{},onPopupInit:()=>{}},e),this.handleMenuBarKeydown=this.handleMenuBarKeydown.bind(this),this.handleMenuBarClick=this.handleMenuBarClick.bind(this),this.handleMenuItemKeydown=this.handleMenuItemKeydown.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.trackPopupState=this.trackPopupState.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&'UL'===this.list.nodeName&&this.init()}init(){super.setSelfReference([this.list]),this.list.setAttribute('role','menubar'),this.menuBarChildren=Array.prototype.slice.call(this.list.children),this.menuBarItems=this.menuBarChildren.reduce((e,t)=>{const n=t.firstElementChild;return null!==n&&'A'===n.nodeName?[...e,n]:e},[]),this.search=new C(this.menuBarItems),this.menuLength=this.menuBarItems.length,h(I.getHelpIds()),this.menuBarItems.forEach((e,t)=>{e.setAttribute('role','menuitem'),e.setAttribute('aria-describedby','ac-describe-top-level-help ac-describe-submenu-help ac-describe-esc-help'),e.setAttribute('aria-setsize',this.menuLength),e.setAttribute('aria-posinset',t+1),e.parentElement.setAttribute('role','presentation'),e.parentElement.addEventListener('keydown',this.handleMenuBarKeydown),e.addEventListener('click',this.handleMenuBarClick)}),this.lastIndex=this.menuLength-1,this.clickEvent=new MouseEvent('click',{view:window,bubbles:!0,cancelable:!0}),this.popups=this.menuBarItems.reduce((e,t)=>{const n=t.nextElementSibling;if(null!==n&&'UL'===n.nodeName){const r=new A({controller:t,target:n,onInit:this.onPopupInit,onStateChange:this.trackPopupState,type:'menu'}),a=new w({list:n});return n.addEventListener('keydown',this.handleMenuItemKeydown),a.previousSibling=t,[...e,r]}return e},[]);const[e]=this.menuBarItems;this.state={menubarItem:e,popup:this.constructor.getPopupFromMenubarItem(e),expanded:!1},d(this.menuBarItems,e),this.onInit.call(this)}trackPopupState(e={}){const{menubarItem:t}=this.state,n=this.constructor.getPopupFromMenubarItem(t),r=!1===n||Object.prototype.hasOwnProperty.call(e,'expanded')?e.expanded:n.getState();this.state=Object.assign({menubarItem:t,popup:n,expanded:r})}stateWasUpdated(){const{menubarItem:e}=this.state;this.trackPopupState(),d(this.menuBarItems,e),e.focus(),this.onStateChange.call(this,this.state)}handleMenuBarKeydown(e){const{LEFT:t,RIGHT:n,DOWN:r,HOME:a,END:i,SPACE:o,RETURN:d}=E,{keyCode:l}=e,{menubarItem:s,popup:c}=this.state;switch(l){case t:case n:{const t=b(l,s,this.menuBarItems);t&&(e.stopPropagation(),e.preventDefault(),c&&c.setState({expanded:!1}),this.setState({menubarItem:t}));break}case o:case d:case r:{c&&(e.stopPropagation(),e.preventDefault(),!c.state.expanded&&c.setState({expanded:!0}),c.firstChild.focus());break}case a:{e.preventDefault();const[t]=this.menuBarItems;this.setState({menubarItem:t});break}case i:{e.preventDefault(),this.setState({menubarItem:this.menuBarItems[this.lastIndex]});break}default:{const e=this.search.getItem(l);null!==e&&this.setState({menubarItem:e});break}}}handleMenuBarClick(e){this.setState({menubarItem:e.target})}handleMenuItemKeydown(e){const{SPACE:t,RETURN:n}=E,{keyCode:r,target:a}=e;[t,n].includes(r)&&'A'===a.nodeName&&(e.stopPropagation(),e.preventDefault(),a.dispatchEvent(this.clickEvent))}destroy(){this.deleteSelfReferences(),this.list.removeAttribute('role'),this.menuBarItems.forEach((e)=>{e.parentElement.removeAttribute('role'),e.removeAttribute('aria-describedby'),e.removeAttribute('aria-setsize'),e.removeAttribute('aria-posinset'),e.removeAttribute('role'),e.parentElement.removeEventListener('keydown',this.handleMenuBarKeydown),e.removeEventListener('click',this.handleMenuBarClick)}),this.popups.forEach((e)=>{c(e.target.menu,w)&&e.target.menu.destroy(),e.destroy()}),i(this.menuBarItems),this.onDestroy.call(this)}}class k extends v{static createCloseButton(){const e=document.createElement('button');return e.innerText='Close',e}constructor(e){super(e),this.componentName='Dialog';const t={controller:null,target:null,content:null,close:this.constructor.createCloseButton(),onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}};Object.assign(this,t,e),void 0===e.close&&null!==this.target&&this.target.insertBefore(this.close,this.target.firstChild),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleKeydownEsc=this.handleKeydownEsc.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),null===this.controller||null===this.target||null===this.content||this.content.contains(this.target)||this.init()}init(){super.setSelfReference([this.controller,this.target]),this.popup=new A({controller:this.controller,target:this.target,type:'dialog',onStateChange:this.onPopupStateChange}),this.interactiveChildren=S(this.target),this.close.addEventListener('click',this.hide),this.target.addEventListener('keydown',this.handleTargetKeydown),this.popup.target.removeEventListener('keydown',this.popup.targetKeyDownHandler),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange({expanded:e}){this.setState({expanded:e})}stateWasUpdated(){const{expanded:e}=this.state;this.interactiveChildren=S(this.target),e?(this.content.setAttribute('aria-hidden','true'),this.content.setAttribute('hidden',''),document.body.addEventListener('keydown',this.handleKeydownEsc),this.close.focus()):(this.content.setAttribute('aria-hidden','false'),this.content.removeAttribute('hidden'),document.body.removeEventListener('keydown',this.handleKeydownEsc),this.controller.focus()),this.onStateChange.call(this,this.state)}outsideClick(e){const{expanded:t}=this.popup.getState();t&&!this.target.contains(e.target)&&this.hide()}handleTargetKeydown(e){const{TAB:t}=E,{keyCode:n,shiftKey:r}=e;if(this.popup.getState().expanded&&n===t){const{activeElement:t}=document,n=this.interactiveChildren.length-1,[a]=this.interactiveChildren,i=this.interactiveChildren[n];r&&a===t?(e.preventDefault(),i.focus()):!r&&i===t&&(e.preventDefault(),a.focus())}}handleKeydownEsc(e){const{ESC:t}=E,{keyCode:n}=e;t===n&&this.hide()}destroy(){this.deleteSelfReferences(),this.popup.destroy(),this.close.removeEventListener('click',this.hide),this.target.removeEventListener('keydown',this.handleTargetKeydown),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}var D=n(2),L=r(siteClassNames.popup),T=L.button,O=L.info,K=document.querySelector(T),P=document.querySelector(O),N=new A({controller:K,target:P}),B=n(3),U=r(siteClassNames.tablist),R=U.list,H=U.panel,W=document.querySelector(R),M=document.querySelectorAll(H),q=new class extends v{constructor(e){if(super(),this.componentName='Tablist',e.tablist){const{tablist:t}=e;Object.assign(e,{tabs:t,tablist:void 0}),this.warnDeprecated('config.tablist','config.tabs')}if('UL'!==e.tabs.nodeName)return void console.warn('Tablist requires a
          for the tabs.');Object.assign(this,{list:null,panels:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.state={activeIndex:0},this.handlePanelKeydown=this.handlePanelKeydown.bind(this),this.handleTabsKeydown=this.handleTabsKeydown.bind(this),this.handleTabsClick=this.handleTabsClick.bind(this),this.switchTo=this.switchTo.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),Array.isArray(this.panels)||(this.panels=Array.prototype.slice.call(this.panels)),this.tabLinks=Array.prototype.filter.call(this.tabs.children,(e)=>null!==e.querySelector('a[href]')).map((e)=>e.querySelector('a[href]')),this.tabLinks.length===this.panels.length&&this.init()}init(){const{activeIndex:e}=this.state;this.tabs.setAttribute('role','tablist'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.setAttribute('role','presentation')}),this.tabLinks.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tab'),e===n?t.setAttribute('aria-selected','true'):t.setAttribute('tabindex','-1'),t.setAttribute('aria-controls',this.panels[n].id)}),this.tabs.addEventListener('click',this.handleTabsClick),this.tabs.addEventListener('keydown',this.handleTabsKeydown),this.panels.forEach((t,n)=>{super.setSelfReference([t]),s(t),t.setAttribute('role','tabpanel'),t.setAttribute('aria-labelledby',this.tabLinks[n].id),e===n?(t.setAttribute('tabindex','0'),t.setAttribute('aria-hidden','false'),t.removeAttribute('hidden')):(t.setAttribute('aria-hidden','true'),t.setAttribute('hidden','')),t.addEventListener('keydown',this.handlePanelKeydown)}),this.interactiveChildren=S(this.panels[e]),this.onInit.call(this)}stateWasUpdated(){const{activeIndex:e}=this.state,[t]=this.tabLinks.filter((e)=>'true'===e.getAttribute('aria-selected')),n=this.tabLinks.indexOf(t);t.setAttribute('tabindex','-1'),t.removeAttribute('aria-selected'),this.panels[n].setAttribute('aria-hidden','true'),this.panels[n].setAttribute('hidden',''),this.panels[n].removeAttribute('tabindex');const r=S(this.panels[n]);o(r),this.tabLinks[e].removeAttribute('tabindex'),this.tabLinks[e].setAttribute('aria-selected','true'),this.panels[e].setAttribute('aria-hidden','false'),this.panels[e].removeAttribute('hidden'),this.panels[e].setAttribute('tabindex','0'),this.interactiveChildren=S(this.panels[e]),i(this.interactiveChildren),this.onStateChange.call(this,this.state)}handlePanelKeydown(e){const{TAB:t}=E,{activeIndex:n}=this.state,{keyCode:r,shiftKey:a}=e,{activeElement:i}=document,[o]=this.interactiveChildren;r===t&&a&&(i===this.panels[n]?(e.preventDefault(),this.tabLinks[n].focus()):i===o&&(e.preventDefault(),this.panels[n].focus()))}handleTabsKeydown(e){const{TAB:t,LEFT:n,RIGHT:r,DOWN:a,HOME:i,END:o}=E,{keyCode:d,shiftKey:l,target:s}=e,c=this.tabLinks.indexOf(s);switch(d){case t:{l||(e.preventDefault(),this.panels[c].focus());break}case n:case r:{const t=b(d,s,this.tabLinks);t&&(e.preventDefault(),this.switchTo(this.tabLinks.indexOf(t)),t.focus());break}case a:{e.preventDefault(),this.panels[c].setAttribute('tabindex','0'),this.panels[c].focus();break}case i:{e.preventDefault(),this.switchTo(0),this.tabLinks[0].focus();break}case o:{e.preventDefault();const t=this.tabLinks.length-1;this.switchTo(t),this.tabLinks[t].focus();break}default:}}handleTabsClick(e){const{target:t}=e;e.preventDefault(),'true'!==t.getAttribute('aria-selected')&&this.tabLinks.includes(t)&&this.switchTo(this.tabLinks.indexOf(t))}switchTo(e){this.setState({activeIndex:e})}destroy(){this.tabs.removeAttribute('role'),Array.prototype.forEach.call(this.tabs.children,(e)=>{'LI'===e.nodeName&&e.removeAttribute('role')}),this.deleteSelfReferences(),this.tabLinks.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-selected'),e.removeAttribute('tabindex'),e.removeAttribute('aria-controls'),e.removeEventListener('click',this.handleTabsClick),e.removeEventListener('keydown',this.handleTabsKeydown)}),this.panels.forEach((e)=>{e.removeAttribute('role'),e.removeAttribute('aria-hidden'),e.removeAttribute('hidden'),e.removeAttribute('tabindex');const t=S(e);i(t),e.removeEventListener('keydown',this.handlePanelKeydown)}),this.onDestroy.call(this)}}({tabs:W,panels:M}),F=n(4),_=r(siteClassNames.listbox),G=_.button,z=_.list,j=document.querySelector(G),V=document.querySelector(z),Q=new class extends v{constructor(e){super(e),this.componentName='ListBox';Object.assign(this,{controller:null,target:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.preventWindowScroll=this.preventWindowScroll.bind(this),this.handleControllerKeyup=this.handleControllerKeyup.bind(this),this.handleTargetKeydown=this.handleTargetKeydown.bind(this),this.handleTargetClicks=this.handleTargetClicks.bind(this),this.handleTargetBlur=this.handleTargetBlur.bind(this),this.scrollOptionIntoView=this.scrollOptionIntoView.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),this.stateWasUpdated=this.stateWasUpdated.bind(this),this.init()}init(){super.setSelfReference([this.controller,this.target]),this.options=Array.prototype.slice.call(this.target.children,0),this.search=new C(this.options),this.options.forEach((e)=>{s(e),e.setAttribute('role','option')});const[e]=this.options,t=this.options[this.options.length-1];Object.assign(this,{firstOption:e,lastOption:t}),this.state={activeDescendant:this.firstOption},this.popup=new A({controller:this.controller,target:this.target,type:'listbox',onStateChange:this.onPopupStateChange}),this.target.setAttribute('role','listbox'),this.target.setAttribute('tabindex','-1'),this.controller.addEventListener('keydown',this.handleControllerKeyup),this.target.addEventListener('keydown',this.handleTargetKeydown),this.target.addEventListener('click',this.handleTargetClicks),this.target.addEventListener('blur',this.handleTargetBlur),window.addEventListener('keydown',this.preventWindowScroll),this.onInit.call(this)}stateWasUpdated(){const{activeDescendant:e,expanded:t}=this.state;if(t){const t=this.target.querySelector('[aria-selected=\"true\"]');null!==t&&t.removeAttribute('aria-selected'),e.setAttribute('aria-selected','true'),this.target.setAttribute('aria-activedescendant',e.id),this.scrollOptionIntoView(e)}this.onStateChange.call(this,this.state)}onPopupStateChange({expanded:e}){const{activeDescendant:t}=this.state;e?this.target.focus():(this.target.removeAttribute('aria-activedescendant'),this.controller.textContent=t.textContent,this.target.contains(document.activeElement)&&this.controller.focus()),this.setState({activeDescendant:t,expanded:e})}preventWindowScroll(e){const{UP:t,DOWN:n}=E,{target:r,keyCode:a}=e;r===this.target&&[t,n].includes(a)&&e.preventDefault()}handleControllerKeyup(e){const{UP:t,DOWN:n}=E;[t,n].includes(e.keyCode)&&(e.preventDefault(),this.show())}handleTargetKeydown(e){const{activeDescendant:t}=this.state,{keyCode:n}=e,{RETURN:r,ESC:a,UP:i,DOWN:o,SPACE:d,HOME:l,END:s}=E;switch(n){case a:case r:case d:{e.preventDefault(),this.hide(),this.controller.focus();break}case i:case o:{let r=t;r=n===i?r.previousElementSibling:r.nextElementSibling,r&&(e.preventDefault(),this.setState({activeDescendant:r}));break}case l:{e.preventDefault(),this.setState({activeDescendant:this.firstOption});break}case s:{e.preventDefault(),this.setState({activeDescendant:this.lastOption});break}default:{const e=this.search.getItem(n);null!==e&&this.setState({activeDescendant:e});break}}}handleTargetClicks(e){this.setState({activeDescendant:e.target}),this.hide()}handleTargetBlur(){this.popup.getState().expanded&&this.hide()}scrollOptionIntoView(e){const{scrollHeight:t,clientHeight:n,scrollTop:r}=this.target,{offsetTop:a,offsetHeight:i}=e;if(t>n){const e=a+i;e>n+r?this.target.scrollTop=e-n:a{e.removeAttribute('role')}),this.popup.destroy(),this.target.removeAttribute('role'),this.target.removeAttribute('tabindex'),this.controller.removeEventListener('keyup',this.handleControllerKeyup),this.target.removeEventListener('keydown',this.handleTargetKeydown),this.target.removeEventListener('click',this.handleTargetClicks),this.target.removeEventListener('blur',this.handleTargetBlur),window.removeEventListener('keydown',this.preventWindowScroll),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:j,target:V}),X=n(5),Y=r(siteClassNames.menu),Z=Y.list,$=document.querySelector(Z),J=new w({list:$}),ee=n(6),te=r(siteClassNames.dialog),ne=te.link,re=te.closeButton;window.addEventListener('load',function(){var e=document.querySelector(ne),t=document.getElementById('dialog'),n=document.querySelector(re),r=document.querySelector('.site'),a=new k({controller:e,target:t,close:n,content:r})});var ae=n(7),ie=r(siteClassNames.menubar),oe=ie.list,de=document.querySelector(oe),le=new I({list:de}),se=n(8),ce=r(siteClassNames.disclosure),ue=ce.button,pe=ce.info,be=document.querySelectorAll(ue),me=document.querySelectorAll(pe);if(be.length===me.length)Array.prototype.map.call(be,function(e,t){return new x({controller:e,target:me[t]})});var he=n(9),ge=r(siteClassNames.menubutton),fe=ge.button,ve=ge['menu-wrapper'],ye=ge.menu,Ee=document.querySelector(fe),Se=document.querySelector(ve),Ae=document.querySelector(ye),Ce=new class extends v{constructor(e){super(e),this.componentName='MenuButton';Object.assign(this,{controller:null,target:null,list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},e),this.handleControllerKeydown=this.handleControllerKeydown.bind(this),this.onPopupStateChange=this.onPopupStateChange.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.destroy=this.destroy.bind(this),null!==this.controller&&null!==this.target&&this.init()}init(){this.popup=new A({controller:this.controller,target:this.target,type:'menu',onStateChange:this.onPopupStateChange}),null!==this.list&&'UL'===this.list.nodeName?this.menu=new w({list:this.list}):'UL'===this.target.nodeName&&(this.menu=new w({list:this.target})),this.controller.addEventListener('keydown',this.handleControllerKeydown),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange(e){this.setState(e),this.onStateChange.call(this,this.state)}handleControllerKeydown(e){const{keyCode:t}=e,{RETURN:n,UP:r,DOWN:a,SPACE:i}=E;switch(t){case n:case i:case a:{e.preventDefault(),this.show(),this.menu.firstItem&&this.menu.firstItem.focus();break}case r:{e.preventDefault(),this.show(),this.menu.lastItem&&this.menu.lastItem.focus();break}default:}}destroy(){this.popup.destroy(),this.menu.destroy(),this.onDestroy.call(this)}show(){this.popup.show()}hide(){this.popup.hide()}}({controller:Ee,target:Se,list:Ae})}]);"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file