/*! For license information please see archive.bundle.min.js.LICENSE.txt */ (()=>{var t={239(t){t.exports=function(t,e){var n,i,s=0;function r(){var r,o,a=n,l=arguments.length;t:for(;a;){if(a.args.length===arguments.length){for(o=0;o11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t},w={field:null,bound:void 0,ariaLabel:"Use the arrow keys to pick a date",position:"bottom left",reposition:!0,format:"YYYY-MM-DD",toString:null,parse:null,defaultDate:null,setDefaultDate:!1,firstDay:0,firstWeekOfYearMinDays:4,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,pickWholeWeek:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,enableSelectionDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,blurFieldOnSelect:!0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,events:[],onSelect:null,onOpen:null,onClose:null,onDraw:null,keyboardInput:!0},k=function(t,e,n){for(e+=t.firstDay;e>=7;)e-=7;return n?t.i18n.weekdaysShort[e]:t.i18n.weekdays[e]},x=function(t){var e=[],n="false";if(t.isEmpty){if(!t.showDaysInNextAndPreviousMonths)return'';e.push("is-outside-current-month"),t.enableSelectionDaysInNextAndPreviousMonths||e.push("is-selection-disabled")}return t.isDisabled&&e.push("is-disabled"),t.isToday&&e.push("is-today"),t.isSelected&&(e.push("is-selected"),n="true"),t.hasEvent&&e.push("has-event"),t.isInRange&&e.push("is-inrange"),t.isStartRange&&e.push("is-startrange"),t.isEndRange&&e.push("is-endrange"),'"},S=function(n,i,s,r){var o=new Date(s,i,n);return''+(e?t(o).isoWeek():function(t,e){t.setHours(0,0,0,0);var n=t.getDate(),i=t.getDay(),s=e,r=s-1,o=function(t){return(t+7-1)%7};t.setDate(n+r-o(i));var a=new Date(t.getFullYear(),0,s),l=(t.getTime()-a.getTime())/864e5;return 1+Math.round((l-r+o(a.getDay()))/7)}(o,r))+""},D=function(t,e,n,i){return''+(e?t.reverse():t).join("")+""},E=function(t,e,n,i,s,r){var o,a,l,c,u,d=t._o,p=n===d.minYear,f=n===d.maxYear,m='
',v=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('");for(c='
'+d.i18n.months[i]+'
",h(d.yearRange)?(o=d.yearRange[0],a=d.yearRange[1]+1):(o=n-d.yearRange,a=1+n+d.yearRange),l=[];o=d.minYear&&l.push('");return u='
'+n+d.yearSuffix+'
",d.showMonthAfterYear?m+=u+c:m+=c+u,p&&(0===i||d.minMonth>=i)&&(v=!1),f&&(11===i||d.maxMonth<=i)&&(y=!1),0===e&&(m+='"),e===t._o.numberOfMonths-1&&(m+='"),m+"
"},I=function(t,e,n){return''+function(t){var e,n=[];for(t.showWeekNumber&&n.push(""),e=0;e<7;e++)n.push('");return""+(t.isRTL?n.reverse():n).join("")+""}(t)+(""+e.join("")+"
'+k(t,e,!0)+"
")},A=function(o){var l=this,c=l.config(o);l._onMouseDown=function(t){if(l._v){var e=(t=t||window.event).target||t.srcElement;if(e)if(a(e,"is-disabled")||(!a(e,"pika-button")||a(e,"is-empty")||a(e.parentNode,"is-disabled")?a(e,"pika-prev")?l.prevMonth():a(e,"pika-next")&&l.nextMonth():(l.setDate(new Date(e.getAttribute("data-pika-year"),e.getAttribute("data-pika-month"),e.getAttribute("data-pika-day"))),c.bound&&s(function(){l.hide(),c.blurFieldOnSelect&&c.field&&c.field.blur()},100))),a(e,"pika-select"))l._c=!0;else{if(!t.preventDefault)return t.returnValue=!1,!1;t.preventDefault()}}},l._onChange=function(t){var e=(t=t||window.event).target||t.srcElement;e&&(a(e,"pika-select-month")?l.gotoMonth(e.value):a(e,"pika-select-year")&&l.gotoYear(e.value))},l._onKeyChange=function(t){if(t=t||window.event,l.isVisible())switch(t.keyCode){case 13:case 27:c.field&&c.field.blur();break;case 37:l.adjustDate("subtract",1);break;case 38:l.adjustDate("subtract",7);break;case 39:l.adjustDate("add",1);break;case 40:l.adjustDate("add",7);break;case 8:case 46:l.setDate(null)}},l._parseFieldValue=function(){if(c.parse)return c.parse(c.field.value,c.format);if(e){var n=t(c.field.value,c.format,c.formatStrict);return n&&n.isValid()?n.toDate():null}return new Date(Date.parse(c.field.value))},l._onInputChange=function(t){var e;t.firedBy!==l&&(e=l._parseFieldValue(),u(e)&&l.setDate(e),l._v||l.show())},l._onInputFocus=function(){l.show()},l._onInputClick=function(){l.show()},l._onInputBlur=function(){var t=i.activeElement;do{if(a(t,"pika-single"))return}while(t=t.parentNode);l._c||(l._b=s(function(){l.hide()},50)),l._c=!1},l._onClick=function(t){var e=(t=t||window.event).target||t.srcElement,i=e;if(e){!n&&a(e,"pika-select")&&(e.onchange||(e.setAttribute("onchange","return;"),r(e,"change",l._onChange)));do{if(a(i,"pika-single")||i===c.trigger)return}while(i=i.parentNode);l._v&&e!==c.trigger&&i!==c.trigger&&l.hide()}},l.el=i.createElement("div"),l.el.className="pika-single"+(c.isRTL?" is-rtl":"")+(c.theme?" "+c.theme:""),r(l.el,"mousedown",l._onMouseDown,!0),r(l.el,"touchend",l._onMouseDown,!0),r(l.el,"change",l._onChange),c.keyboardInput&&r(i,"keydown",l._onKeyChange),c.field&&(c.container?c.container.appendChild(l.el):c.bound?i.body.appendChild(l.el):c.field.parentNode.insertBefore(l.el,c.field.nextSibling),r(c.field,"change",l._onInputChange),c.defaultDate||(c.defaultDate=l._parseFieldValue(),c.setDefaultDate=!0));var h=c.defaultDate;u(h)?c.setDefaultDate?l.setDate(h,!0):l.gotoDate(h):l.gotoDate(new Date),c.bound?(this.hide(),l.el.className+=" is-bound",r(c.trigger,"click",l._onInputClick),r(c.trigger,"focus",l._onInputFocus),r(c.trigger,"blur",l._onInputBlur)):this.show()};return A.prototype={config:function(t){this._o||(this._o=y({},w,!0));var e=y(this._o,t,!0);e.isRTL=!!e.isRTL,e.field=e.field&&e.field.nodeName?e.field:null,e.theme="string"==typeof e.theme&&e.theme?e.theme:null,e.bound=!!(void 0!==e.bound?e.field&&e.bound:e.field),e.trigger=e.trigger&&e.trigger.nodeName?e.trigger:e.field,e.disableWeekends=!!e.disableWeekends,e.disableDayFn="function"==typeof e.disableDayFn?e.disableDayFn:null;var n=parseInt(e.numberOfMonths,10)||1;if(e.numberOfMonths=n>4?4:n,u(e.minDate)||(e.minDate=!1),u(e.maxDate)||(e.maxDate=!1),e.minDate&&e.maxDate&&e.maxDate100&&(e.yearRange=100);return e},toString:function(n){return n=n||this._o.format,u(this._d)?this._o.toString?this._o.toString(this._d,n):e?t(this._d).format(n):this._d.toDateString():""},getMoment:function(){return e?t(this._d):null},setMoment:function(n,i){e&&t.isMoment(n)&&this.setDate(n.toDate(),i)},getDate:function(){return u(this._d)?new Date(this._d.getTime()):null},setDate:function(t,e){if(!t)return this._d=null,this._o.field&&(this._o.field.value="",g(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof t&&(t=new Date(Date.parse(t))),u(t)){var n=this._o.minDate,i=this._o.maxDate;u(n)&&ti&&(t=i),this._d=new Date(t.getTime()),m(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),g(this._o.field,"change",{firedBy:this})),e||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},clear:function(){this.setDate(null)},gotoDate:function(t){var e=!0;if(u(t)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),i=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),s=t.getTime();i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),e=s=r&&(this._y=r,!isNaN(a)&&this._m>a&&(this._m=a));for(var c=0;c";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&s(function(){n.trigger.focus()},1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label",n.ariaLabel)}},adjustPosition:function(){var t,e,n,s,r,o,a,h,u,d,p,f;if(!this._o.container){if(this.el.style.position="absolute",e=t=this._o.trigger,n=this.el.offsetWidth,s=this.el.offsetHeight,r=window.innerWidth||i.documentElement.clientWidth,o=window.innerHeight||i.documentElement.clientHeight,a=window.pageYOffset||i.body.scrollTop||i.documentElement.scrollTop,p=!0,f=!0,"function"==typeof t.getBoundingClientRect)h=(d=t.getBoundingClientRect()).left+window.pageXOffset,u=d.bottom+window.pageYOffset;else for(h=e.offsetLeft,u=e.offsetTop+e.offsetHeight;e=e.offsetParent;)h+=e.offsetLeft,u+=e.offsetTop;(this._o.reposition&&h+n>r||this._o.position.indexOf("right")>-1&&h-n+t.offsetWidth>0)&&(h=h-n+t.offsetWidth,p=!1),(this._o.reposition&&u+s>o+a||this._o.position.indexOf("top")>-1&&u-s-t.offsetHeight>0)&&(u=u-s-t.offsetHeight,f=!1),this.el.style.left=h+"px",this.el.style.top=u+"px",l(this.el,p?"left-aligned":"right-aligned"),l(this.el,f?"bottom-aligned":"top-aligned"),c(this.el,p?"right-aligned":"left-aligned"),c(this.el,f?"top-aligned":"bottom-aligned")}},render:function(t,e,n){var i=this._o,s=new Date,r=f(t,e),o=new Date(t,e,1).getDay(),a=[],l=[];m(s),i.firstDay>0&&(o-=i.firstDay)<0&&(o+=7);for(var c=0===e?11:e-1,h=11===e?0:e+1,p=0===e?t-1:t,y=11===e?t+1:t,g=f(p,c),b=r+o,w=b;w>7;)w-=7;b+=7-w;for(var k=!1,E=0,A=0;E=r+o,T=E-o+1,P=e,B=t,j=i.startRange&&v(i.startRange,_),R=i.endRange&&v(i.endRange,_),F=i.startRange&&i.endRange&&i.startRange<_&&_i.maxDate||i.disableWeekends&&d(_)||i.disableDayFn&&i.disableDayFn(_),isEmpty:L,isStartRange:j,isEndRange:R,isInRange:F,showDaysInNextAndPreviousMonths:i.showDaysInNextAndPreviousMonths,enableSelectionDaysInNextAndPreviousMonths:i.enableSelectionDaysInNextAndPreviousMonths};i.pickWholeWeek&&M&&(k=!0),l.push(x(N)),7===++A&&(i.showWeekNumber&&l.unshift(S(E-o,e,t,i.firstWeekOfYearMinDays)),a.push(D(l,i.isRTL,i.pickWholeWeek,k)),l=[],A=0,k=!1)}return I(i,a,n)},isVisible:function(){return this._v},show:function(){this.isVisible()||(this._v=!0,this.draw(),c(this.el,"is-hidden"),this._o.bound&&(r(i,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var t=this._v;!1!==t&&(this._o.bound&&o(i,"click",this._onClick),this._o.container||(this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto"),l(this.el,"is-hidden"),this._v=!1,void 0!==t&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){var t=this._o;this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),t.keyboardInput&&o(i,"keydown",this._onKeyChange),t.field&&(o(t.field,"change",this._onInputChange),t.bound&&(o(t.trigger,"click",this._onInputClick),o(t.trigger,"focus",this._onInputFocus),o(t.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},A}(e)}()},471(t,e,n){var i;!function(){"use strict";var s={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(t){return function(t,e){var n,i,o,a,l,c,h,u,d,p=1,f=t.length,m="";for(i=0;i=0),a.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a.width?parseInt(a.width):0);break;case"e":n=a.precision?parseFloat(n).toExponential(a.precision):parseFloat(n).toExponential();break;case"f":n=a.precision?parseFloat(n).toFixed(a.precision):parseFloat(n);break;case"g":n=a.precision?String(Number(n.toPrecision(a.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a.precision?n.substring(0,a.precision):n;break;case"t":n=String(!!n),n=a.precision?n.substring(0,a.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a.precision?n.substring(0,a.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a.precision?n.substring(0,a.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}s.json.test(a.type)?m+=n:(!s.number.test(a.type)||u&&!a.sign?d="":(d=u?"+":"-",n=n.toString().replace(s.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",h=a.width-(d+n).length,l=a.width&&h>0?c.repeat(h):"",m+=a.align?d+n+l:"0"===c?d+l+n:l+d+n)}return m}(function(t){if(a[t])return a[t];for(var e,n=t,i=[],r=0;n;){if(null!==(e=s.text.exec(n)))i.push(e[0]);else if(null!==(e=s.modulo.exec(n)))i.push("%");else{if(null===(e=s.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){r|=1;var o=[],l=e[2],c=[];if(null===(c=s.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=s.key_access.exec(l)))o.push(c[1]);else{if(null===(c=s.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}e[2]=o}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}n=n.substring(e[0].length)}return a[t]=i}(t),arguments)}function o(t,e){return r.apply(null,[t].concat(e||[]))}var a=Object.create(null);"undefined"!=typeof window&&(window.sprintf=r,window.vsprintf=o,void 0===(i=function(){return{sprintf:r,vsprintf:o}}.call(e,n,e,t))||(t.exports=i))}()},154(t){"use strict";t.exports=window.moment}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,n),r.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=function(t){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()};function e(e){const{component:n,load:i,name:s,querySelector:r={},querySelectorAll:o={},options:a={}}=e;if("function"!=typeof n)return;const l=()=>{(()=>{const t=void 0===s?null==e?void 0:e.root:`[data-component='${s}']`;let n;try{n=document.querySelectorAll(t)}catch(t){return console.error(t),[]}return n.length<1?(console.log(`No elements found for ${t}`),[]):Array.from(n).map(t=>{const e={};return Object.keys(r).forEach(n=>{e[n]=t.querySelector(r[n])}),Object.keys(o).forEach(n=>{const i=t.querySelectorAll(o[n]);e[n]=Array.from(i)}),{element:t,children:e,options:a}})})().forEach(t=>new n(t))};if(!1===i)return l;!0!==i?function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e)if("function"==typeof n)n(e);else if(Array.isArray(n)){const[t,i]=n;null==t||t.addEventListener(i,e)}}(l,i):l()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n0?(this.downIntent+=e,this.upIntent=0,this.downIntent>this.THRESHOLD&&(this.element.classList.add("scroll-down"),this.element.classList.remove("scroll-up"))):e<0&&(this.upIntent-=e,this.downIntent=0,this.upIntent>this.THRESHOLD&&(this.element.classList.add("scroll-up"),this.element.classList.remove("scroll-down")))),this.lastY=t}},{key:"destroy",value:function(){var t;this.scrollAttached&&(window.removeEventListener("scroll",this.onScroll),this.scrollAttached=!1),this.observer&&(this.observer.disconnect(),this.observer=null),null!=d&&null!==(t=d.lgMax)&&void 0!==t&&t.removeListener&&d.lgMax.removeListener(this.handleBreakpoints),this.onScroll=null}}])}()});var m,v,y,g,b=n(239),w=n.n(b);function k(t,e,n){return(e=l(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(471),w()(console.error),m={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},v=["(","?"],y={")":["("],":":["?","?:"]},g=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var x={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,n){if(t)throw e;return n}};var S={contextDelimiter:"",onMissingKey:null};function D(t,e){var n;for(n in this.data=t,this.pluralForms={},this.options={},S)this.options[n]=void 0!==e&&n in e?e[n]:S[n]}function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function I(t){for(var e=1;e=0||m[s]3&&void 0!==arguments[3]?arguments[3]:10,o=t[e];if(O(n)&&M(i))if("function"==typeof s)if("number"==typeof r){var a={callback:s,priority:r,namespace:i};if(o[n]){var l,c=o[n].handlers;for(l=c.length;l>0&&!(r>=c[l-1].priority);l--);l===c.length?c[l]=a:c.splice(l,0,a),o.__current.forEach(function(t){t.name===n&&t.currentIndex>=l&&t.currentIndex++})}else o[n]={handlers:[a],runs:0};"hookAdded"!==n&&t.doAction("hookAdded",n,i,s,r)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},L=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,s){var r=t[e];if(O(i)&&(n||M(s))){if(!r[i])return 0;var o=0;if(n)o=r[i].handlers.length,r[i]={runs:r[i].runs,handlers:[]};else for(var a=r[i].handlers,l=function(t){a[t].namespace===s&&(a.splice(t,1),o++,r.__current.forEach(function(e){e.name===i&&e.currentIndex>=t&&e.currentIndex--}))},c=a.length-1;c>=0;c--)l(c);return"hookRemoved"!==i&&t.doAction("hookRemoved",i,s),o}}},T=function(t,e){return function(n,i){var s=t[e];return void 0!==i?n in s&&s[n].handlers.some(function(t){return t.namespace===i}):n in s}},P=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i){var s=t[e];s[i]||(s[i]={handlers:[],runs:0}),s[i].runs++;for(var r=s[i].handlers,o=arguments.length,a=new Array(o>1?o-1:0),l=1;l1&&void 0!==arguments[1]?arguments[1]:"default";i.data[e]=I(I(I({},A),i.data[e]),t),i.data[e][""]=I(I({},A[""]),i.data[e][""])},a=function(t,e){o(t,e),r()},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;return i.data[t]||o(void 0,t),i.dcnpgettext(t,e,n,s,r)},c=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},h=function(t,e,i){var s=l(i,e,t);return n?(s=n.applyFilters("i18n.gettext_with_context",s,t,e,i),n.applyFilters("i18n.gettext_with_context_"+c(i),s,t,e,i)):s};if(n){var u=function(t){_.test(t)&&r()};n.addAction("hookAdded","core/i18n",u),n.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return i.data[t]},setLocaleData:a,resetLocaleData:function(t,e){i.data={},i.pluralForms={},a(t,e)},subscribe:function(t){return s.add(t),function(){return s.delete(t)}},__:function(t,e){var i=l(e,void 0,t);return n?(i=n.applyFilters("i18n.gettext",i,t,e),n.applyFilters("i18n.gettext_"+c(e),i,t,e)):i},_x:h,_n:function(t,e,i,s){var r=l(s,void 0,t,e,i);return n?(r=n.applyFilters("i18n.ngettext",r,t,e,i,s),n.applyFilters("i18n.ngettext_"+c(s),r,t,e,i,s)):r},_nx:function(t,e,i,s,r){var o=l(r,s,t,e,i);return n?(o=n.applyFilters("i18n.ngettext_with_context",o,t,e,i,s,r),n.applyFilters("i18n.ngettext_with_context_"+c(r),o,t,e,i,s,r)):o},isRTL:function(){return"rtl"===h("ltr","text direction")},hasTranslation:function(t,e,s){var r,o,a=e?e+""+t:t,l=!(null===(r=i.data)||void 0===r||null===(o=r[null!=s?s:"default"])||void 0===o||!o[a]);return n&&(l=n.applyFilters("i18n.has_translation",l,t,e,s),l=n.applyFilters("i18n.has_translation_"+c(s),l,t,e,s)),l}}}(0,0,F));N.getLocaleData.bind(N);var K=N.setLocaleData.bind(N),U=(N.resetLocaleData.bind(N),N.subscribe.bind(N),N.__.bind(N));N._x.bind(N),N._n.bind(N),N._nx.bind(N),N.isRTL.bind(N),N.hasTranslation.bind(N);const H=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});function W(t){var e=['a[href]:not([aria-hidden="true"])',"area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(","),n=t.querySelectorAll(e);return Array.prototype.slice.call(n)}var q=function(){return h(function t(e){if(o(this,t),this.stringDescription="Popup",Object.assign(this,e),this.interactiveChildElements=W(this.target),this.interactiveChildElements.length>0){var n=r(this.interactiveChildElements,1)[0];this.firstItem=n,this.lastItem=this.interactiveChildElements[this.interactiveChildElements.length-1]}this.state={expanded:!1},this.setup=this.setup.bind(this),this.destroy=this.destroy.bind(this),this.manageExpandedState=this.manageExpandedState.bind(this),this.setExpandedState=this.setExpandedState.bind(this),this.controllerKeyDownHandler=this.controllerKeyDownHandler.bind(this),this.targetKeyDownHandler=this.targetKeyDownHandler.bind(this),this.closeOnTabOut=this.closeOnTabOut.bind(this),this.closeOnOutsideClick=this.closeOnOutsideClick.bind(this),this.setup()},[{key:"setExpandedState",value:function(t){this.controller.setAttribute("aria-expanded","".concat(t)),this.target.setAttribute("aria-hidden","".concat(!t)),this.state.expanded=t}},{key:Symbol.toStringTag,get:function(){return this.stringDescription}},{key:"setup",value:function(){var t=this.state.expanded;this.controller.popup=this,this.target.popup=this,this.controller.setAttribute("aria-haspopup","menu"),this.controller.setAttribute("aria-expanded","".concat(t)),this.controller.setAttribute("aria-controls",this.target.id),this.target!==this.controller.nextElementSibling&&this.controller.setAttribute("aria-owns",this.target.id),this.target.setAttribute("aria-hidden","".concat(!t)),this.controller.addEventListener("click",this.manageExpandedState),this.controller.addEventListener("keydown",this.controllerKeyDownHandler),this.target.addEventListener("keydown",this.targetKeyDownHandler),document.body.addEventListener("click",this.closeOnOutsideClick)}},{key:"destroy",value:function(){this.controller.popup=null,this.target.popup=null,this.controller.removeAttribute("aria-haspopup"),this.controller.removeAttribute("aria-expanded"),this.controller.removeAttribute("aria-controls"),this.target!==this.controller.nextElementSibling&&this.controller.removeAttribute("aria-owns"),this.target.removeAttribute("aria-hidden"),this.controller.removeEventListener("click",this.manageExpandedState),this.controller.removeEventListener("keydown",this.controllerKeyDownHandler),this.target.removeEventListener("keydown",this.targetKeyDownHandler),document.body.removeEventListener("click",this.closeOnOutsideClick),this.state={expanded:!1}}},{key:"controllerKeyDownHandler",value:function(t){if(this.state.expanded){var e=H.ESC,n=H.TAB,i=t.keyCode;e===i?(t.stopPropagation(),t.preventDefault(),this.setExpandedState(!1)):n===i&&(t.preventDefault(),this.firstItem.focus())}}},{key:"targetKeyDownHandler",value:function(t){var e=H.ESC,n=H.TAB,i=t.keyCode,s=this.state.expanded,r=document.activeElement;e===i&&s?(t.stopPropagation(),t.preventDefault(),this.setExpandedState(!1),this.controller.focus()):n===i&&(!t.shiftKey||this.firstItem!==r&&this.target!==r?this.lastChild===r&&this.setExpandedState(!1):(t.preventDefault(),this.controller.focus()))}},{key:"manageExpandedState",value:function(t){t.preventDefault(),this.state.expanded?this.setExpandedState(!1):this.setExpandedState(!0)}},{key:"closeOnTabOut",value:function(t){H.TAB===t.keyCode&&!t.shiftKey&&this.state.expanded&&this.setExpandedState(!1)}},{key:"closeOnOutsideClick",value:function(t){this.state.expanded&&t.target!==this.controller&&!this.target.contains(t.target)&&this.setExpandedState(!1)}}])}(),Y=function(){function t(e){o(this,t),this.stringDescription="MenuItem",this.list=e,Object.assign(e,{menuItem:this}),this.listItems=Array.prototype.slice.call(e.children),this.handleListKeydown=this.handleListKeydown.bind(this),this.destroy=this.destroy.bind(this),this.init()}return h(t,[{key:Symbol.toStringTag,get:function(){return this.stringDescription}},{key:"init",value:function(){var e=this;this.menuItems=this.listItems.reduce(function(t,e){var n=e.firstElementChild;return null!==n&&"A"===n.nodeName?[].concat(f(t),[n]):t},[]),this.menuItemsLength=this.menuItems.length,this.menuItems.forEach(function(n){n.addEventListener("keydown",e.handleListKeydown);var i=e.constructor.nextElementIsUl(n);i&&(new t(i).previousSibling=n)});var n=r(this.menuItems,1);this.firstItem=n[0],this.lastItem=this.menuItems[this.menuItemsLength-1]}},{key:"handleListKeydown",value:function(t){var e=t.keyCode,n=H.UP,i=H.DOWN,s=H.LEFT,r=H.RIGHT,o=document.activeElement,a=this.list.contains(o)?o:this.menuItems[0],l=this.menuItems.length-1,c=this.menuItems.indexOf(a);if([n,i].includes(e)){t.stopPropagation(),t.preventDefault();var h=e===n?c-1:c+1;n===e&&h<0&&(h=l),i===e&&l0&&this.popups.forEach(function(t){var e;void 0!==t.target.menuItem&&"[object MenuItem]"===(null==t||null===(e=t.target)||void 0===e||null===(e=e.menuItem)||void 0===e?void 0:e.toString())&&t.target.menuItem.destroy(),t.destroy()})}}])}(),$=function(){return h(function t(e,n,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:250;o(this,t),Object.assign(this,{callback:i,event:n,element:e,frequency:s,timeout:!1}),this.requestTick=this.requestTick.bind(this),this.update=this.update.bind(this),this.callback?this.element.addEventListener(this.event,this.requestTick):console.error("Throttle error: you must specify a callback.")},[{key:"update",value:function(){this.callback(),window.clearTimeout(this.timeout),this.timeout=!1}},{key:"requestTick",value:function(){var t=this;this.timeout||(this.timeout=window.setTimeout(function(){window.requestAnimationFrame(t.update)},this.frequency))}},{key:"destroy",value:function(){this.element.removeEventListener(this.event,this.requestTick)}}])}();function V(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36,e=r(Math.random().toString(t).split("."),2)[1];return"id_".concat(e)}function X(t,e){var n=document.createElement("span");return n.classList.add("screen-reader-text"),Object.assign(n,{id:t,innerText:e}),n}var G=function(){return h(function t(e){o(this,t),this.list=e,this.articleItems=Array.prototype.slice.call(e.children),K({"":{}},"sciencenews"),Object.assign(this,{firstItem:this.articleItems[0]}),this.lastIndex=this.articleItems.length-1,this.state={activeDescendant:this.firstItem},this.prepItems=this.prepItems.bind(this),this.updateActiveState=this.updateActiveState.bind(this),this.clearActiveState=this.clearActiveState.bind(this),this.getParentPopup=this.getParentPopup.bind(this),this.handleListBlur=this.handleListBlur.bind(this),this.handleListKeydown=this.handleListKeydown.bind(this),this.parentPopup=this.getParentPopup(),this.prepItems(),this.init()},[{key:"getParentPopup",value:function(){for(var t=this.list.parentElement;"[object Popup]"!==(null===(e=t)||void 0===e||null===(e=e.popup)||void 0===e?void 0:e.toString());){var e;t=t.parentElement}return t.popup}},{key:"prepItems",value:function(){this.articleItems.forEach(function(t){var e=W(t);""===t.id&&t.setAttribute("id",V()),e.forEach(function(e){e.setAttribute("id",V()),e.setAttribute("data-child-of",t.id)})})}},{key:"updateActiveState",value:function(t){this.state.activeDescendant.removeAttribute("aria-selected"),this.state.activeDescendant=t,this.list.setAttribute("aria-activedescendant",t.id),t.setAttribute("aria-selected","true")}},{key:"clearActiveState",value:function(){var t=this.state.activeDescendant;this.list.removeAttribute("aria-activedescendant"),t.removeAttribute("aria-selected"),this.state.activeDescendant=this.firstItem,this.list.setAttribute("aria-describedby",this.initialListDescribedby)}},{key:"init",value:function(){this.list.setAttribute("role","group"),this.list.setAttribute("tabindex","0"),this.initialListDescribedby="group-widget-list-help group-widget-list-enter-help group-widget-esc-help",this.activeListDescribedby="group-widget-list-help group-widget-move-back-help group-widget-tab-help group-widget-esc-help",this.constructor.addHelpText(),this.list.setAttribute("aria-describedby",this.initialListDescribedby),this.list.addEventListener("blur",this.handleListBlur),this.list.addEventListener("keydown",this.handleListKeydown)}},{key:"handleListBlur",value:function(){this.list.contains(document.activeElement)||this.clearActiveState()}},{key:"handleListKeydown",value:function(t){var e=H.UP,n=H.DOWN,i=H.RIGHT,s=H.LEFT,o=H.TAB,a=t.keyCode,l=t.shiftKey,c=this.state.activeDescendant,h=this.articleItems.indexOf(c),u=this.list.hasAttribute("aria-activedescendant"),d=this.constructor.getItemParent(c);if(u||(i===a?(t.preventDefault(),this.updateActiveState(this.firstItem),this.list.setAttribute("aria-describedby",this.activeListDescribedby)):s===a?(t.preventDefault(),this.parentPopup.setExpandedState(!1),this.parentPopup.controller.focus()):[e,n].includes(a)&&(t.preventDefault(),this.parentPopup.firstItem.focus())),u)if(s===a)t.preventDefault(),d?this.updateActiveState(d):this.clearActiveState();else if([e,n].includes(a)&&!d){t.preventDefault();var p=a===e?h-1:h+1;e===a&&p<0&&(p=this.lastIndex),n===a&&this.lastIndex0){t.preventDefault();var m=f.indexOf(c),v=r(f,1)[0];if(d){var y=l?m-1:m+1,g=y<0||f.length-12&&void 0!==arguments[2]&&arguments[2],i=et(t,e);return i?n?document.querySelectorAll(i):document.querySelector(i):null}var it=function(){return h(function t(e){var n=e.element,i=e.children,s=e.options;o(this,t),this.element=n,this.children=i,this.options=s,K({"":{}},"sciencenews"),this.moveComponent=this.moveComponent.bind(this),this.updateControllerText=this.updateControllerText.bind(this),this.navBarWrapper=nt("wrapper","nav-bar"),this.navBar=nt("nav-bar","nav-bar"),this.actionsList=nt("actions","nav-bar"),this.moveComponent(),d.lgMin.addListener(this.moveComponent),this.init(),this.updateControllerText()},[{key:"moveComponent",value:function(){var t=this.children.controller;if(null!==this.navBarWrapper&&null!==this.navBar&&null!==this.actionsList){var e=t.parentElement,n=this.element.parentElement;d.lgMin.matches?e!==this.navBar&&n!==this.navBar&&this.navBar.insertBefore(this.element,this.actionsList):e!==this.navBarWrapper&&n!==this.navBarWrapper&&this.navBarWrapper.appendChild(this.element)}}},{key:"init",value:function(){var t=this,e=this.children,n=e.controller,i=e.target;this.disclosure=new tt({controller:n,target:i,onOpen:this.updateControllerText,onClose:this.updateControllerText});var s=X("header-search-help",U("Use the Shift key with the Tab key to tab back to the search input.","sciencenews"));document.body.appendChild(s),i.style.clip="rect(0, 0, 0, 0)",i.addEventListener("transitionend",function(){t.disclosure.state.expanded||(i.style.clip="rect(0, 0, 0, 0)")})}},{key:"updateControllerText",value:function(){var t=this.children,e=t.controller,n=t.target,i=t.openText,s=t.closeText,r=t.input,o=this.disclosure.state.expanded;i.setAttribute("aria-hidden","".concat(o)),s.setAttribute("aria-hidden","".concat(!o)),o?(n.style.clip="auto",e.setAttribute("aria-describedby","header-search-help"),r.focus()):e.removeAttribute("aria-describedby")}}])}(),st=p(sciencenewsClassnames["header-search"]);e({name:"header-search",component:it,querySelector:{target:st.wrapper,controller:st.toggle,openText:st.open,closeText:st.close,input:"input"}});var rt=function(){return h(function t(e){if(o(this,t),null==e||!(e instanceof HTMLFormElement))throw new Error("Invalid form element.");this.form=e,this.validateEmailInput=this.validateEmailInput.bind(this),this.formSubmit=this.formSubmit.bind(this),this.checkEmailInput=this.checkEmailInput.bind(this),this.updateState=this.updateState.bind(this),this.updateReadyState=this.updateReadyState.bind(this),this.init()},[{key:"updateState",value:function(t){var e=new CustomEvent("sn.formstatechange",{bubbles:!0,composed:!0,detail:{status:t}});this.form.dispatchEvent(e)}},{key:"updateReadyState",value:function(){Object.defineProperty(this.form,"faReadyState",{value:"ready",configurable:!0});var t=new CustomEvent("sn.formready",{bubbles:!0,composed:!0,detail:{}});this.form.dispatchEvent(t)}},{key:"init",value:function(){this.emailInput=this.form.querySelector('[name="email"]'),this.nonceInput=this.form.querySelector('[name="nonce"]'),this.submit=this.form.querySelector('[type="submit"]'),this.honeyPot=this.form.querySelector('[name="client_key"]'),this.formId=this.form.querySelector('[name="form_id"]'),this.control=this.form.querySelector('[name="control"]'),null!=this.emailInput&&(this.form.addEventListener("submit",this.formSubmit),this.emailInput.addEventListener("input",this.checkEmailInput),this.updateReadyState())}},{key:"checkEmailInput",value:function(){null!==this.emailInput.getAttribute("aria-invalid")&&this.emailInput.removeAttribute("aria-invalid")}},{key:"validateEmailInput",value:function(){var t=this.emailInput,e=t.value,n=t.pattern,i=new RegExp(n),s=e.trim();return e.trim().length>0&&i.test(s)}},{key:"formSubmit",value:function(t){var e,n=this;if(t.preventDefault(),!this.validateEmailInput())return this.emailInput.setAttribute("aria-invalid","true"),!1;var i=window.location,s=i.pathname,r=i.search,o=null!==(e=this.honeyPot)&&void 0!==e&&e.value?this.honeyPot.value:"",a=this.nonceInput.value,l=this.formId.value,c=this.control.value,h=encodeURIComponent(this.emailInput.value);this.emailInput.removeAttribute("aria-invalid"),this.updateState("loading");var u=["client_key=".concat(o),"control=".concat(c),"email=".concat(h),"form_id=".concat(l),"page=".concat(s)],d="".concat(u.join("&")).concat(r),p=new XMLHttpRequest;p.open("POST",this.form.action,!0),p.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),p.setRequestHeader("X-WP-Nonce",a),p.send(encodeURI(d)),p.onreadystatechange=function(){if(p.readyState===XMLHttpRequest.DONE){var t=p.status;0===t||t>=200&&t<400?n.updateState("success"):n.updateState("error")}}}}])}();function ot(t,e){var n=e.status,i={loading:"login-form--loading",success:"login-form--success",error:"login-form--error"};requestAnimationFrame(function(){"loading"===n?t.classList.remove(i.success,i.error):t.classList.remove(i.loading),t.classList.add(i[n])})}function at(t){for(var e=1;e(Object.defineProperty(t,this.componentName.toLowerCase(),{value:this,configurable:!0}),t));this.referenceElements=[...this.referenceElements,...e]}deleteSelfReferences(){this.referenceElements.forEach(t=>{delete t[this.componentName.toLowerCase()]})}getState(){return this.state}warnDeprecated(t,e=!1){const n=e?`Use ${e} instead.`:"";console.warn(`${this.componentName}:`,`${t} is deprecated.`,`${n}`)}}const ft=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40});function mt(t){if(Array.isArray(t))return t;let e=[];return t instanceof HTMLElement?e=new Array(t):(t instanceof NodeList||t instanceof HTMLCollection)&&(e=Array.prototype.slice.call(t,0)),e}function vt(t){(Array.isArray(t)?t:mt(t)).forEach(t=>{t.removeAttribute("tabindex")})}function yt(t){(Array.isArray(t)?t:mt(t)).forEach(t=>{t.setAttribute("tabindex","-1")})}function gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(gt=function(){return!!t})()}function bt(t,e,n,i){var s=ut(ht(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof s?function(t){return s.apply(n,t)}:s}var wt=function(t){function e(t,n){var i,s,r,l;if(o(this,e),s=this,l=[n],r=ht(r=e),i=function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(s,gt()?Reflect.construct(r,l||[],ht(s).constructor):r.apply(s,l)),null==t)throw new Error("Configuration error: A target element is required.");return i.target=t,i.componentName="ProgrammaticDialog",Object.assign(i,{content:[],onInit:function(){},onStateChange:function(){},onDestroy:function(){}},n),i.init=i.init.bind(i),i.handleTargetKeydown=i.handleTargetKeydown.bind(i),i.hideOnOutsideClick=i.hideOnOutsideClick.bind(i),i.handleKeydownEsc=i.handleKeydownEsc.bind(i),i.show=i.show.bind(i),i.hide=i.hide.bind(i),i.destroy=i.destroy.bind(i),i.stateWasUpdated=i.stateWasUpdated.bind(i),i.setInteractiveChildren=i.setInteractiveChildren.bind(i),i.setDialogController=i.setDialogController.bind(i),i.controllerClick=i.controllerClick.bind(i),i.init(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dt(t,e)}(e,t),h(e,[{key:"setDialogController",value:function(t){this.controller=t,bt(e,"setSelfReference",this,3)([[this.controller]]),this.controllerIsNotAButton="BUTTON"!==this.controller.nodeName&&null===this.controller.getAttribute("role"),this.controllerIsNotAButton&&(this.controller.setAttribute("role","button"),this.controller.setAttribute("tabindex","0")),this.controller.setAttribute("aria-expanded","false"),this.controller.addEventListener("click",this.controllerClick),this.controller.addEventListener("keydown",this.controllerKeydown)}},{key:"setInteractiveChildren",value:function(){this.interactiveChildElements=function(t){const e=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(","),n=t.querySelectorAll(e);return Array.prototype.slice.call(n)}(this.target);var t=r(function(t){const e=mt(t),n=e.length-1,{0:i,[n]:s}=e;return[i,s]}(this.interactiveChildElements),2),e=t[0],n=t[1];this.firstInteractiveChild=e,this.lastInteractiveChild=n}},{key:"init",value:function(){var t,n,i=this;if(0===this.content.length||null==this.content?this.content=Array.from(document.body.children).filter(function(t){return!t.contains(i.target)}):this.content=(t=this.content,Array.isArray(t)?t:t instanceof HTMLElement?new Array(t):t instanceof NodeList||t instanceof HTMLCollection?Array.from(t):[]),0===this.content.length)throw new Error("Configuration error: The Dialog target should not be within the main site content.");bt(e,"setSelfReference",this,3)([[this.target]]),this.setInteractiveChildren(),yt(this.interactiveChildElements),null!==(n=this.target)&&""===n.id&&n.setAttribute("id",function(t=36){const[,e]=Math.random().toString(t).split(".");return`id_${e}`}()),this.target.setAttribute("aria-hidden","true"),this.target.setAttribute("hidden",""),this.target.setAttribute("role","dialog"),this.target.setAttribute("aria-modal","true"),this.target.addEventListener("keydown",this.handleTargetKeydown),this.state={expanded:!1},this.onInit.call(this)}},{key:"stateWasUpdated",value:function(){var t=this.state.expanded,e=this.content.length;if(this.setInteractiveChildren(),t){this.target.setAttribute("tabindex","0");for(var n=0;n a")),g=nt("topics-menu",c),b=nt("topics-menu__list",c),w=nt("list","topics-megamenu");Object.assign(this,{toggle:u,navBar:p,menu:m,topics:g,topicsList:b,actions:f,topicsMegaMenu:w,submenuLinks:y,menuButton:{}}),this.handleBreakpointChanges=this.handleBreakpointChanges.bind(this),this.setUpMenuButton=this.setUpMenuButton.bind(this),this.useHamburgerMenu=this.useHamburgerMenu.bind(this),this.setUpPrimaryMenu=this.setUpPrimaryMenu.bind(this),this.setUpPrimaryMenuItem=this.setUpPrimaryMenuItem.bind(this),this.setUpSecondaryMenuItems=this.setUpSecondaryMenuItems.bind(this),this.setUpSecondaryMenu=this.setUpSecondaryMenu.bind(this),this.addKeydownPatches=this.addKeydownPatches.bind(this),this.removeKeydownPatches=this.removeKeydownPatches.bind(this),this.patchTopLevelKeydown=this.patchTopLevelKeydown.bind(this),this.patchNavBarKeydown=this.patchNavBarKeydown.bind(this),this.patchMenuButtonKeydown=this.patchMenuButtonKeydown.bind(this),this.patchPrimaryMenuFirstItem=this.patchPrimaryMenuFirstItem.bind(this),this.patchTopicsMenuFirstItem=this.patchTopicsMenuFirstItem.bind(this),this.persistMenuButton?this.useHamburgerMenu():(this.handleBreakpointChanges(),d.lgMin.addListener(this.handleBreakpointChanges))},[{key:"handleBreakpointChanges",value:function(){d.lgMin.matches?(this.setUpPrimaryMenu(),this.topicsMenu instanceof Y&&this.topicsMenu.destroy(),this.menuButton instanceof q&&this.menuButton.destroy(),this.removeKeydownPatches(),null!==this.topics&&this.topics.contains(document.activeElement)&&this.topicsMegaMenu.menu.firstItem.focus()):this.useHamburgerMenu()}},{key:"setUpMenuButton",value:function(){this.menuButton instanceof q?this.menuButton.setup():this.menuButton=new q({controller:this.toggle,target:this.navBar}),this.menuButton.controller.addEventListener("keydown",this.patchMenuButtonKeydown)}},{key:"setUpPrimaryMenu",value:function(){this.primaryMenu instanceof Y&&this.primaryMenu.destroy(),this.primaryMenu instanceof z?this.primaryMenu.init():this.primaryMenu=new z(this.menu)}},{key:"setUpPrimaryMenuItem",value:function(){this.primaryMenu instanceof z&&this.primaryMenu.destroy(),this.primaryMenu instanceof Y?this.primaryMenu.init():this.primaryMenu=new Y(this.menu)}},{key:"setUpSecondaryMenuItems",value:function(){null!==this.topics&&(this.topicsMenu instanceof Y?this.topicsMenu.init():this.topicsMenu=new Y(this.topics))}},{key:"setUpSecondaryMenu",value:function(){this.topicsMenu instanceof Y&&this.topicsMenu.destroy(),null!==this.topicsList&&(this.topicsSubMenu instanceof z?this.topicsSubMenu.init():this.topicsSubMenu=new z(this.topicsList))}},{key:"useHamburgerMenu",value:function(){this.setUpMenuButton(),this.setUpPrimaryMenuItem(),this.setUpSecondaryMenuItems(),this.setUpSecondaryMenu(),this.addKeydownPatches(),(this.navBar.contains(document.activeElement)||null!==this.topics&&this.topics.contains(document.activeElement))&&this.menuButton.controller.focus()}},{key:"removeKeydownPatches",value:function(){(this.primaryMenu instanceof Y||this.primaryMenu instanceof z)&&this.primaryMenu.firstItem.removeEventListener("keydown",this.patchPrimaryMenuFirstItem),this.topicsMenu instanceof Y&&this.topicsMenu.firstItem.removeEventListener("keydown",this.patchTopicsMenuFirstItem),this.menu.removeEventListener("keydown",this.patchTopLevelKeydown),null!==this.topics&&this.topics.removeEventListener("keydown",this.patchTopLevelKeydown),this.navBar.removeEventListener("keydown",this.patchNavBarKeydown)}},{key:"addKeydownPatches",value:function(){this.primaryMenu.firstItem.addEventListener("keydown",this.patchPrimaryMenuFirstItem),null!==this.topics&&this.topicsMenu.firstItem.addEventListener("keydown",this.patchTopicsMenuFirstItem),this.menu.addEventListener("keydown",this.patchTopLevelKeydown),null!==this.topics&&this.topics.addEventListener("keydown",this.patchTopLevelKeydown),this.navBar.addEventListener("keydown",this.patchNavBarKeydown)}},{key:"patchTopLevelKeydown",value:function(t){var e=t.keyCode,n=t.target;H.LEFT!==e||void 0!==n.menuItem&&void 0!==n.menuItem.previousSibling||(this.menuButton.setExpandedState(!1),this.menuButton.controller.focus())}},{key:"patchNavBarKeydown",value:function(t){var e=t.keyCode,n=H.HOME,i=H.END;n===e?(t.preventDefault(),this.menuButton.firstItem.focus()):i===e&&(t.preventDefault(),this.menuButton.lastItem.focus())}},{key:"patchTopicsMenuFirstItem",value:function(t){var e=t.keyCode,n=H.UP;H.DOWN===e&&void 0!==this.primaryMenu.firstItem?(t.preventDefault(),this.primaryMenu.firstItem.focus()):n===e&&(t.preventDefault(),this.menuButton.lastItem.focus())}},{key:"patchPrimaryMenuFirstItem",value:function(t){var e=t.keyCode;H.UP===e&&void 0!==this.topicsMenu.firstItem&&(t.preventDefault(),this.topicsMenu.firstItem.focus())}},{key:"patchMenuButtonKeydown",value:function(t){var e=t.keyCode,n=H.UP;[n,H.DOWN].includes(e)&&(t.preventDefault(),this.menuButton.state.expanded||this.menuButton.setExpandedState(!0),n===e?this.menuButton.lastItem.focus():this.menuButton.firstItem.focus())}}])}(),xt=p(sciencenewsClassnames["nav-bar"]);e({name:"nav-bar",component:kt,querySelector:{toggle:xt.toggle,navBar:xt.navBar,actions:xt.actions},querySelectorAll:{},options:{menuStylesheet:"primary-menu"}}),e({name:"newsletter-signup",component:function(){return h(function t(e){var n=e.element,i=e.children,s=e.options;o(this,t),this.element=n,this.children=i,this.options=s,this.init=this.init.bind(this),this.init()},[{key:"init",value:function(){var t=this;this.element.addEventListener("sn.formstatechange",function(e){ot(t.element,e.detail)})}}])}()}),e({name:"cookie-banner",component:function(){return h(function t(e){var n=e.element,i=e.children,s=e.options;o(this,t),this.element=n,this.children=i,this.options=s,this.init=this.init.bind(this),this.handleButtonClick=this.handleButtonClick.bind(this);var r=amScripts.global.sitePrefix,a="snhs"===r?"sn":r;this.cookieName="".concat(a,"-cookies-accepted"),"true"!==lt.get(this.cookieName)&&this.init()},[{key:"handleButtonClick",value:function(){lt.set(this.cookieName,!0,{expires:365}),this.element.setAttribute("hidden",""),this.element.setAttribute("aria-hidden","true")}},{key:"init",value:function(){var t=this.children.button;this.element.removeAttribute("hidden"),this.element.removeAttribute("aria-hidden"),t.addEventListener("click",this.handleButtonClick)}}])}(),querySelector:{button:p(sciencenewsClassnames["cookie-banner"]).button}}),e({name:"form-assembly-form",component:function(){return h(function t(e){var n=e.element,i=e.children,s=e.options;o(this,t),this.element=n,this.children=i,this.options=s,this.init=this.init.bind(this),this.init()},[{key:"init",value:function(){var t=this;this.element.addEventListener("sn.formstatechange",function(e){ot(t.element,e.detail)})}}])}()});var St=n(529),Dt=n.n(St);function Et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}e({name:"date-picker",component:function(){return h(function t(e){var n=e.element,i=e.children,s=e.options;o(this,t),this.element=n,this.children=i,this.options=s,this.ariaSetup=this.ariaSetup.bind(this),this.onOpen=this.onOpen.bind(this),this.onClose=this.onClose.bind(this),this.togglePicker=this.togglePicker.bind(this),this.openCalendar="open-calendar",this.selectDate="select-date",this.init()},[{key:"onOpen",value:function(){var t=this.children,e=t.trigger,n=t.container;e.setAttribute("aria-expanded","true"),e.setAttribute("aria-labelledby",this.selectDate),n.setAttribute("aria-hidden","false")}},{key:"onClose",value:function(){var t=this.children,e=t.trigger,n=t.container;e.setAttribute("aria-expanded","false"),e.setAttribute("aria-labelledby",this.openCalendar),n.setAttribute("aria-hidden","true")}},{key:"setEventListeners",value:function(){var t=this,e=this.children.trigger,n=H.TAB,i=H.ESC,s=H.LEFT,r=H.UP,o=H.RIGHT,a=H.DOWN;document.body.addEventListener("click",this.togglePicker),document.body.addEventListener("touchend",function(n){n.target!==e&&t.picker.isVisible()&&t.picker.hide()}),document.body.addEventListener("keydown",function(e){var n=e.keyCode;t.picker.isVisible()&&i===n&&t.picker.hide(),[s,r,o,a].includes(n)&&t.picker.isVisible()&&e.preventDefault()}),e.addEventListener("keydown",function(e){var i=e.keyCode,s=e.shiftKey;n!==i||s||t.picker.hide()})}},{key:"ariaSetup",value:function(){var t=this.children,e=t.trigger,n=t.container;e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-controls",n.id),e.removeAttribute("tabindex"),n.setAttribute("aria-hidden","true")}},{key:"togglePicker",value:function(t){var e=this.children.trigger,n=t.target;n===e?this.picker.isVisible()?this.picker.hide():this.picker.show():this.picker.el.contains(n)||this.picker.hide()}},{key:"init",value:function(){var t=this,e=this.children,n=function(t){for(var e=1;e{var t={239(t){t.exports=function(t,e){var n,i,r=0;function s(){var s,o,a=n,l=arguments.length;t:for(;a;){if(a.args.length===arguments.length){for(o=0;o=0),a.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a.width?parseInt(a.width):0);break;case"e":n=a.precision?parseFloat(n).toExponential(a.precision):parseFloat(n).toExponential();break;case"f":n=a.precision?parseFloat(n).toFixed(a.precision):parseFloat(n);break;case"g":n=a.precision?String(Number(n.toPrecision(a.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a.precision?n.substring(0,a.precision):n;break;case"t":n=String(!!n),n=a.precision?n.substring(0,a.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a.precision?n.substring(0,a.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a.precision?n.substring(0,a.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}r.json.test(a.type)?m+=n:(!r.number.test(a.type)||u&&!a.sign?d="":(d=u?"+":"-",n=n.toString().replace(r.sign,"")),c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",h=a.width-(d+n).length,l=a.width&&h>0?c.repeat(h):"",m+=a.align?d+n+l:"0"===c?d+l+n:l+d+n)}return m}(function(t){if(a[t])return a[t];for(var e,n=t,i=[],s=0;n;){if(null!==(e=r.text.exec(n)))i.push(e[0]);else if(null!==(e=r.modulo.exec(n)))i.push("%");else{if(null===(e=r.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){s|=1;var o=[],l=e[2],c=[];if(null===(c=r.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=r.key_access.exec(l)))o.push(c[1]);else{if(null===(c=r.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}e[2]=o}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}n=n.substring(e[0].length)}return a[t]=i}(t),arguments)}function o(t,e){return s.apply(null,[t].concat(e||[]))}var a=Object.create(null);e.sprintf=s,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=s,window.vsprintf=o,void 0===(i=function(){return{sprintf:s,vsprintf:o}}.call(e,n,e,t))||(t.exports=i))}()}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=function(t){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()};function e(e){const{component:n,load:i,name:r,querySelector:s={},querySelectorAll:o={},options:a={}}=e;if("function"!=typeof n)return;const l=()=>{(()=>{const t=void 0===r?null==e?void 0:e.root:`[data-component='${r}']`;let n;try{n=document.querySelectorAll(t)}catch(t){return console.error(t),[]}return n.length<1?(console.log(`No elements found for ${t}`),[]):Array.from(n).map(t=>{const e={};return Object.keys(s).forEach(n=>{e[n]=t.querySelector(s[n])}),Object.keys(o).forEach(n=>{const i=t.querySelectorAll(o[n]);e[n]=Array.from(i)}),{element:t,children:e,options:a}})})().forEach(t=>new n(t))};if(!1===i)return l;!0!==i?function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e)if("function"==typeof n)n(e);else if(Array.isArray(n)){const[t,i]=n;null==t||t.addEventListener(i,e)}}(l,i):l()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n2&&void 0!==arguments[2]&&arguments[2],i=function(t,e){var n=t.split("-").map(function(t,e){return 0===e?t:t.charAt(0).toUpperCase()+t.slice(1)}).join(""),i=u(sciencenewsClassnames[e]);return void 0!==i[n]&&i[n]}(t,e);return i?n?document.querySelectorAll(i):document.querySelector(i):null}var p,f,m,y,v=n(239),b=n.n(v),g=n(471),A=n.n(g),w=b()(console.error);p={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},f=["(","?"],m={")":["("],":":["?","?:"]},y=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var S={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,n){if(t)throw e;return n}};var x={contextDelimiter:"",onMissingKey:null};function k(t,e){var n;for(n in this.data=t,this.pluralForms={},this.options={},x)this.options[n]=void 0!==e&&n in e?e[n]:x[n]}function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function C(t){for(var e=1;e=0||p[r]3&&void 0!==arguments[3]?arguments[3]:10,o=t[e];if(j(n)&&_(i))if("function"==typeof r)if("number"==typeof s){var a={callback:r,priority:s,namespace:i};if(o[n]){var l,c=o[n].handlers;for(l=c.length;l>0&&!(s>=c[l-1].priority);l--);l===c.length?c[l]=a:c.splice(l,0,a),o.__current.forEach(function(t){t.name===n&&t.currentIndex>=l&&t.currentIndex++})}else o[n]={handlers:[a],runs:0};"hookAdded"!==n&&t.doAction("hookAdded",n,i,r,s)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}},P=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,r){var s=t[e];if(j(i)&&(n||_(r))){if(!s[i])return 0;var o=0;if(n)o=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else for(var a=s[i].handlers,l=function(t){a[t].namespace===r&&(a.splice(t,1),o++,s.__current.forEach(function(e){e.name===i&&e.currentIndex>=t&&e.currentIndex--}))},c=a.length-1;c>=0;c--)l(c);return"hookRemoved"!==i&&t.doAction("hookRemoved",i,r),o}}},L=function(t,e){return function(n,i){var r=t[e];return void 0!==i?n in r&&r[n].handlers.some(function(t){return t.namespace===i}):n in r}},T=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i){var r=t[e];r[i]||(r[i]={handlers:[],runs:0}),r[i].runs++;for(var s=r[i].handlers,o=arguments.length,a=new Array(o>1?o-1:0),l=1;l1&&void 0!==arguments[1]?arguments[1]:"default";i.data[e]=C(C(C({},E),i.data[e]),t),i.data[e][""]=C(C({},E[""]),i.data[e][""])},a=function(t,e){o(t,e),s()},l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;return i.data[t]||o(void 0,t),i.dcnpgettext(t,e,n,r,s)},c=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},h=function(t,e,i){var r=l(i,e,t);return n?(r=n.applyFilters("i18n.gettext_with_context",r,t,e,i),n.applyFilters("i18n.gettext_with_context_"+c(i),r,t,e,i)):r};if(n){var u=function(t){O.test(t)&&s()};n.addAction("hookAdded","core/i18n",u),n.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return i.data[t]},setLocaleData:a,resetLocaleData:function(t,e){i.data={},i.pluralForms={},a(t,e)},subscribe:function(t){return r.add(t),function(){return r.delete(t)}},__:function(t,e){var i=l(e,void 0,t);return n?(i=n.applyFilters("i18n.gettext",i,t,e),n.applyFilters("i18n.gettext_"+c(e),i,t,e)):i},_x:h,_n:function(t,e,i,r){var s=l(r,void 0,t,e,i);return n?(s=n.applyFilters("i18n.ngettext",s,t,e,i,r),n.applyFilters("i18n.ngettext_"+c(r),s,t,e,i,r)):s},_nx:function(t,e,i,r,s){var o=l(s,r,t,e,i);return n?(o=n.applyFilters("i18n.ngettext_with_context",o,t,e,i,r,s),n.applyFilters("i18n.ngettext_with_context_"+c(s),o,t,e,i,r,s)):o},isRTL:function(){return"rtl"===h("ltr","text direction")},hasTranslation:function(t,e,r){var s,o,a=e?e+""+t:t,l=!(null===(s=i.data)||void 0===s||null===(o=s[null!=r?r:"default"])||void 0===o||!o[a]);return n&&(l=n.applyFilters("i18n.has_translation",l,t,e,r),l=n.applyFilters("i18n.has_translation_"+c(r),l,t,e,r)),l}}}(0,0,K));M.getLocaleData.bind(M);var R=M.setLocaleData.bind(M),H=(M.resetLocaleData.bind(M),M.subscribe.bind(M),M.__.bind(M));function q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function $(t){for(var e=1;e1?e-1:0),i=1;i0?this.getAllActiveInputIds():[];t=null===n?{items:a({},this.type,i)}:{items:this.updateState(n.items,i)},window.history.replaceState(t,""),this.filteredIds=i,this.filterPosts(),this.updateTotalCount()}},{key:"pushHistory",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=window.history.state,n=this.constructor.getBaseUrl();!0===t?n.searchParams.delete(this.type):n.searchParams.set(this.type,this.filteredIds.join(",")),window.history.replaceState({items:this.updateState(e.items,this.filteredIds)},"",n)}},{key:"updateTotalCount",value:function(){var t=this;this.totalCount.innerText=this.items.filter(function(e){return!e.classList.contains(t.hide)}).length}},{key:"filterPosts",value:function(){var t=this,e=window.history.state.items,n=e.themes,i=void 0===n?[]:n,r=e.connections,s=void 0===r?[]:r,o=!i.length&&!s.length,a=i.length&&s.length;this.items.forEach(function(e){var n=!0,r=t.constructor.hasTypes(e,i,"themes"),l=t.constructor.hasTypes(e,s,"connections");switch(!0){case o:case a&&r&&l:case!a&&(r||l):n=!1;break;default:n=!0}e.classList.toggle(t.hide,n)})}},{key:"updateState",value:function(t,e){return Object.assign(t,a({},this.type,e))}},{key:"createItem",value:function(t){var e=document.createElement("span"),n=document.createTextNode(t);e.appendChild(n),this.selectedIds.appendChild(e)}}],[{key:"unique",value:function(t){return function(t){if(Array.isArray(t))return i(t)}(e=new Set(t))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||r(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var e}},{key:"getBaseUrl",value:function(){return new URL(window.location)}},{key:"hasTypes",value:function(t,e,n){var i,s,o=t.dataset[n];return void 0!==(i=e.filter(function(t){return o.includes(Number(t))}),s=1,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return a}}(i,s)||r(i,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0]}}])}(),querySelector:{},querySelectorAll:{},options:{hide:"snc-hide",linkActive:"snc-active"}});class B{constructor(){this.state={},this.searchString="",this.referenceElements=[],this.setState=this.setState.bind(this),this.getState=this.getState.bind(this),this.setSelfReference=this.setSelfReference.bind(this),this.warnDeprecated=this.warnDeprecated.bind(this)}setState(t){Object.assign(this.state,t),"function"==typeof this.stateWasUpdated&&this.stateWasUpdated()}setSelfReference(t){const e=[...t].map(t=>(Object.defineProperty(t,this.componentName.toLowerCase(),{value:this,configurable:!0}),t));this.referenceElements=[...this.referenceElements,...e]}deleteSelfReferences(){this.referenceElements.forEach(t=>{delete t[this.componentName.toLowerCase()]})}getState(){return this.state}warnDeprecated(t,e=!1){const n=e?`Use ${e} instead.`:"";console.warn(`${this.componentName}:`,`${t} is deprecated.`,`${n}`)}}const z=Object.freeze({TAB:9,RETURN:13,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40}),W=function(t){const e=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(","),n=t.querySelectorAll(e);return Array.prototype.slice.call(n)};function J(t){if(Array.isArray(t))return t;let e=[];return t instanceof HTMLElement?e=new Array(t):(t instanceof NodeList||t instanceof HTMLCollection)&&(e=Array.prototype.slice.call(t,0)),e}function Z(t){(Array.isArray(t)?t:J(t)).forEach(t=>{t.removeAttribute("tabindex")})}function X(t){(Array.isArray(t)?t:J(t)).forEach(t=>{t.setAttribute("tabindex","-1")})}function G(t){null!==t&&""===t.id&&t.setAttribute("id",function(t=36){const[,e]=Math.random().toString(t).split(".");return`id_${e}`}())}function Q(t){const e=J(t),n=e.length-1,{0:i,[n]:r}=e;return[i,r]}class V extends B{constructor(t){super(t),this.componentName="Popup",Object.assign(this,{controller:null,target:null,type:"true",onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},t),this.state={expanded:!1},this.init=this.init.bind(this),this.setInteractiveChildren=this.setInteractiveChildren.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()}setInteractiveChildren(){const{expanded:t}=this.state;if(this.interactiveChildElements=W(this.target),t?Z(this.interactiveChildElements):X(this.interactiveChildElements),0{t.getAttribute("id").includes("id_")&&t.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"),Z(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 Y{constructor(t){switch(this.searchString="",this.clearSearch=null,!0){case Array.isArray(t):this.items=t;break;case t instanceof NodeList:this.items=Array.prototype.slice.call(t,0);break;case null!==t&&"UL"===t.nodeName:this.items=Array.prototype.slice.call(t.children,0);break;default:this.items=null}}getItem(t){if(null!==this.items){const e=String.fromCharCode(t);this.searchString+=e,null!==this.clearSearch&&(clearTimeout(this.clearSearch),this.clearSearch=null),this.clearSearch=setTimeout(()=>{this.searchString="",this.clearSearch=null},500);const n=this.items.filter(t=>0===t.textContent.toLowerCase().indexOf(this.searchString.toLowerCase()));return n.length?n[0]:null}return null}}class tt extends B{constructor(t){super(t),this.componentName="Disclosure",Object.assign(this,{controller:null,target:null,loadOpen:!1,allowOutsideClick:!0,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},t),this.state={expanded:this.loadOpen},this.setInteractiveChildren=this.setInteractiveChildren.bind(this),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()}setInteractiveChildren(){const{expanded:t}=this.state;this.interactiveChildElements=W(this.target),t?Z(this.interactiveChildElements):X(this.interactiveChildElements)}init(){super.setSelfReference([this.controller,this.target]);const{expanded:t}=this.state;[this.controller,this.target].forEach(t=>{G(t)}),this.controller.setAttribute("aria-expanded",`${t}`),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),t||(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),this.setInteractiveChildren(),this.onInit.call(this)}stateWasUpdated(){const{expanded:t}=this.state;this.controller.setAttribute("aria-expanded",`${t}`),t?(this.target.setAttribute("aria-hidden","false"),this.target.removeAttribute("hidden")):(this.target.setAttribute("aria-hidden","true"),this.target.setAttribute("hidden","")),t?Z(this.interactiveChildElements):X(this.interactiveChildElements),this.onStateChange.call(this,this.state)}handleControllerKeydown(t){const{SPACE:e,RETURN:n}=z,{keyCode:i}=t;[e,n].includes(i)&&this.toggleExpandedState(t)}toggleExpandedState(t){t.preventDefault(),this.state.expanded?this.close():this.open()}closeOnOutsideClick(t){this.state.expanded&&t.target!==this.controller&&!this.target.contains(t.target)&&this.close()}destroy(){this.deleteSelfReferences(),[this.controller,this.target].forEach(t=>{t.getAttribute("id").includes("id_")&&t.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"),Z(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})}}function et(t,e){return null!=t&&t instanceof e}class nt extends B{static nextElementIsUl(t){const e=t.nextElementSibling;return null!==e&&"UL"===e.nodeName&&e}constructor(t){if(super(t),this.componentName="Menu",t.menu){const{menu:e}=t;Object.assign(t,{list:e,menu:void 0}),this.warnDeprecated("config.menu","config.list")}Object.assign(this,{list:null,collapse:!1,itemMatches:"*",onInit:()=>{},onDestroy:()=>{}},t),this.setMenuItems=this.setMenuItems.bind(this),this.handleListKeydown=this.handleListKeydown.bind(this),this.destroy=this.destroy.bind(this),null!==this.list&&"UL"===this.list.nodeName&&this.init()}setMenuItems(){this.disclosures=[],this.menuItems=Array.from(this.list.children).reduce((t,e)=>{const[n,...i]=Array.from(e.children);let r=n;return null!==r&&r.matches("a,button")||([r]=Array.from(i).filter(t=>t.matches("a,button"))),void 0!==r&&r.matches(this.itemMatches)?[...t,r]:t},[]),this.search=new Y(this.menuItems),this.menuItems.forEach((t,e)=>{t.parentElement.setAttribute("role","presentation"),t.setAttribute("role","menuitem"),t.setAttribute("aria-setsize",this.menuItems.length),t.setAttribute("aria-posinset",e+1);const n=this.constructor.nextElementIsUl(t);if(n){if(this.collapse){const e=new tt({controller:t,target:n});this.disclosures.push(e)}new nt({list:n,itemMatches:this.itemMatches}).previousSibling=t}});const[t,e]=Q(this.menuItems);Object.assign(this,{firstItem:t,lastItem:e})}init(){super.setSelfReference([this.list]),this.list.setAttribute("role","menu"),this.setMenuItems(),this.list.addEventListener("keydown",this.handleListKeydown),this.onInit.call(this)}handleListKeydown(t){const{keyCode:e}=t,{UP:n,DOWN:i,LEFT:r,RIGHT:s,HOME:o,END:a,ESC:l}=z,{activeElement:c}=document,h=this.list.contains(c)?c:this.menuItems[0];switch(e){case n:case i:{const n=function(t,e,n){const{UP:i,DOWN:r}=z;return function(t,e,n,i){const{next:r,previous:s}=i,o=n.indexOf(e),a=n.length-1;let l=t===s?o-1:o+1;return s===t&&0>l&&(l=a),r===t&&a{t.parentElement.removeAttribute("role"),t.removeAttribute("role"),t.removeAttribute("aria-setsize"),t.removeAttribute("aria-posinset");const e=this.constructor.nextElementIsUl(t);e&&et(e.menu,nt)&&e.menu.destroy()}),this.disclosures.forEach(t=>{t.destroy()}),this.onDestroy.call(this)}}class it extends B{constructor(t){super(t),this.componentName="MenuButton",Object.assign(this,{controller:null,target:null,list:null,onInit:()=>{},onStateChange:()=>{},onDestroy:()=>{}},t),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 V({controller:this.controller,target:this.target,type:"menu",onStateChange:this.onPopupStateChange}),null!==this.list&&"UL"===this.list.nodeName?this.menu=new nt({list:this.list}):"UL"===this.target.nodeName&&(this.menu=new nt({list:this.target})),this.controller.addEventListener("keydown",this.handleControllerKeydown),this.state={expanded:!1},this.onInit.call(this)}onPopupStateChange(t){this.setState(t),this.onStateChange.call(this,this.state)}handleControllerKeydown(t){const{keyCode:e}=t,{RETURN:n,UP:i,DOWN:r,SPACE:s}=z;switch(e){case n:case s:case r:t.preventDefault(),this.show(),this.menu.firstItem&&this.menu.firstItem.focus();break;case i:t.preventDefault(),this.show(),this.menu.lastItem&&this.menu.lastItem.focus()}}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()}}var rt=function(){return h(function t(e){var n=e.element,i=e.children,r=e.options;l(this,t),this.element=n,this.children=i,this.options=r,this.init=this.init.bind(this),this.onMenuSelect=this.onMenuSelect.bind(this),this.handleJumpMenuClick=this.handleJumpMenuClick.bind(this),this.handleJumpMenuKeydown=this.handleJumpMenuKeydown.bind(this),this.init()},[{key:"handleJumpMenuKeydown",value:function(t){z.RETURN===t.keyCode&&"A"===t.target.nodeName&&(t.preventDefault(),this.onMenuSelect(t.target))}},{key:"handleJumpMenuClick",value:function(t){"A"===t.target.nodeName&&(t.preventDefault(),this.onMenuSelect(t.target))}},{key:"onMenuSelect",value:function(t){var e=t.hash,n=window.history.state,i=new URL(window.location);i.hash=e,window.location.href=i.href,window.history.replaceState(n,"",i),this.menuButton.hide()}},{key:"init",value:function(){var t=this.children,e=t.controller,n=t.target;this.menuButton=new it({controller:e,target:n}),n.addEventListener("click",this.handleJumpMenuClick),n.addEventListener("keydown",this.handleJumpMenuKeydown)}}])}(),st=u(sciencenewsClassnames["milestones-jump-to-decade"]);e({name:"milestones-jump-to-decade",component:rt,querySelector:{controller:st.controller,target:st.target}})})()})(); //# sourceMappingURL=centennial-milestones.bundle.min.js.map;